diff --git a/dist/main.bundle.js b/dist/main.bundle.js index cd909cabf8..84d354037c 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=[];uObject(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 r})),n.d(e,"h",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"f",(function(){return s})),n.d(e,"g",(function(){return l})),n.d(e,"e",(function(){return c})),n.d(e,"b",(function(){return f})),n.d(e,"a",(function(){return u}));var a=n(146);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 f(t){return t.charAt(0).toUpperCase()+t.slice(1)}function u(t){return t.split(" ").map(t=>f(t)).join(" ")}},,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(46),r=n(367),i=n(340),o=n(33),s=n(28),l=n(1020),c=n(88),f=n(18);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){return null!=u[t]}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=["hackDifficulty","moneyAvailable","requiredHackingSkill","serverGrowth"],i=t=>{switch(typeof t){case"number":return t;case"object":return Object(o.a)(t.min,t.max);default:throw Error(`Do not know how to convert the type '${typeof t}' to a number`)}};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,i(t.maxRamExponent)));for(const e of n)void 0!==t[e]&&(r[e]=i(t[e]));const o=new a.a(r);for(const e of t.literature||[])o.messages.push(e);o.hostname===c.a.WorldDaemon&&(o.requiredHackingSkill*=f.a.WorldDaemonDifficulty),y(o),void 0!==t.networkLayer&&e[i(t.networkLayer)-1].push(o)}const s=(t,e)=>{for(const r of t)n=r,a=e(),n.serversOnNetwork.push(a.hostname),a.serversOnNetwork.push(n.hostname);var n,a};s(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";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";let a,r,i,o;n.d(e,"d",(function(){return a})),n.d(e,"c",(function(){return r})),n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o})),function(t){t.None="",t.Company="Working for Company",t.CompanyPartTime="Working for Company part-time",t.Faction="Working for Faction",t.CreateProgram="Working on Create a Program",t.StudyClass="Studying or Taking a class at university",t.Crime="Committing a crime",t.GraftAugmentation="Grafting an Augmentation"}(a||(a={})),function(t){t.None="",t.Hacking="Faction Hacking Work",t.Field="Faction Field Work",t.Security="Faction Security Work"}(r||(r={})),function(t){t.None="",t.StudyComputerScience="studying Computer Science",t.DataStructures="taking a Data Structures course",t.Networks="taking a Networks course",t.Algorithms="taking an Algorithms course",t.Management="taking a Management course",t.Leadership="taking a Leadership course",t.GymStrength="training your strength at a gym",t.GymDefense="training your defense at a gym",t.GymDexterity="training your dexterity at a gym",t.GymAgility="training your agility at a gym"}(i||(i={})),function(t){t.None="",t.Shoplift="shoplift",t.RobStore="rob a store",t.Mug="mug someone",t.Larceny="commit larceny",t.Drugs="deal drugs",t.BondForgery="forge corporate bonds",t.TraffickArms="traffick illegal arms",t.Homicide="commit homicide",t.GrandTheftAuto="commit grand theft auto",t.Kidnap="kidnap someone for ransom",t.Assassination="assassinate a high-profile target",t.Heist="pull off the ultimate heist"}(o||(o={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var a=n(0),r=n(26),i=n(5),o=n(20),s=n(28),l=n(4),c=n(12),f=n(10),u=n(79),m=n(18),h=n(119),d=n(352);function p(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class g{constructor(t={info:"",moneyCost:0,name:"",repCost:0,factions:[]}){p(this,"baseCost",0),p(this,"baseRepRequirement",0),p(this,"isSpecial",!1),p(this,"name",""),p(this,"prereqs",[]),p(this,"mults",{}),p(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_mult&&(this.mults.hacking_mult=t.hacking_mult),t.strength_mult&&(this.mults.strength_mult=t.strength_mult),t.defense_mult&&(this.mults.defense_mult=t.defense_mult),t.dexterity_mult&&(this.mults.dexterity_mult=t.dexterity_mult),t.agility_mult&&(this.mults.agility_mult=t.agility_mult),t.charisma_mult&&(this.mults.charisma_mult=t.charisma_mult),t.hacking_exp_mult&&(this.mults.hacking_exp_mult=t.hacking_exp_mult),t.strength_exp_mult&&(this.mults.strength_exp_mult=t.strength_exp_mult),t.defense_exp_mult&&(this.mults.defense_exp_mult=t.defense_exp_mult),t.dexterity_exp_mult&&(this.mults.dexterity_exp_mult=t.dexterity_exp_mult),t.agility_exp_mult&&(this.mults.agility_exp_mult=t.agility_exp_mult),t.charisma_exp_mult&&(this.mults.charisma_exp_mult=t.charisma_exp_mult),t.hacking_chance_mult&&(this.mults.hacking_chance_mult=t.hacking_chance_mult),t.hacking_speed_mult&&(this.mults.hacking_speed_mult=t.hacking_speed_mult),t.hacking_money_mult&&(this.mults.hacking_money_mult=t.hacking_money_mult),t.hacking_grow_mult&&(this.mults.hacking_grow_mult=t.hacking_grow_mult),t.company_rep_mult&&(this.mults.company_rep_mult=t.company_rep_mult),t.faction_rep_mult&&(this.mults.faction_rep_mult=t.faction_rep_mult),t.crime_money_mult&&(this.mults.crime_money_mult=t.crime_money_mult),t.crime_success_mult&&(this.mults.crime_success_mult=t.crime_success_mult),t.work_money_mult&&(this.mults.work_money_mult=t.work_money_mult),t.hacknet_node_money_mult&&(this.mults.hacknet_node_money_mult=t.hacknet_node_money_mult),t.hacknet_node_purchase_cost_mult&&(this.mults.hacknet_node_purchase_cost_mult=t.hacknet_node_purchase_cost_mult),t.hacknet_node_ram_cost_mult&&(this.mults.hacknet_node_ram_cost_mult=t.hacknet_node_ram_cost_mult),t.hacknet_node_core_cost_mult&&(this.mults.hacknet_node_core_cost_mult=t.hacknet_node_core_cost_mult),t.hacknet_node_level_cost_mult&&(this.mults.hacknet_node_level_cost_mult=t.hacknet_node_level_cost_mult),t.bladeburner_max_stamina_mult&&(this.mults.bladeburner_max_stamina_mult=t.bladeburner_max_stamina_mult),t.bladeburner_stamina_gain_mult&&(this.mults.bladeburner_stamina_gain_mult=t.bladeburner_stamina_gain_mult),t.bladeburner_analysis_mult&&(this.mults.bladeburner_analysis_mult=t.bladeburner_analysis_mult),t.bladeburner_success_chance_mult&&(this.mults.bladeburner_success_chance_mult=t.bladeburner_success_chance_mult),t.infiltration_base_rep_increase&&(this.mults.infiltration_base_rep_increase=t.infiltration_base_rep_increase),t.infiltration_rep_mult&&(this.mults.infiltration_rep_mult=t.infiltration_rep_mult),t.infiltration_trade_mult&&(this.mults.infiltration_trade_mult=t.infiltration_trade_mult),t.infiltration_sell_mult&&(this.mults.infiltration_sell_mult=t.infiltration_sell_mult),t.infiltration_timer_mult&&(this.mults.infiltration_timer_mult=t.infiltration_timer_mult),t.infiltration_damage_reduction_mult&&(this.mults.infiltration_damage_reduction_mult=t.infiltration_damage_reduction_mult),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 t.hacking_mult&&t.hacking_mult==t.strength_mult&&t.hacking_mult==t.defense_mult&&t.hacking_mult==t.dexterity_mult&&t.hacking_mult==t.agility_mult&&t.hacking_mult==t.charisma_mult?s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.hacking_mult-1)," all skills"):(t.hacking_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.hacking_mult-1)," hacking skill")),t.strength_mult&&t.strength_mult==t.defense_mult&&t.strength_mult==t.dexterity_mult&&t.strength_mult==t.agility_mult?s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.strength_mult-1)," combat skills"):(t.strength_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.strength_mult-1)," strength skill")),t.defense_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.defense_mult-1)," defense skill")),t.dexterity_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.dexterity_mult-1)," dexterity skill")),t.agility_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.agility_mult-1)," agility skill"))),t.charisma_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.charisma_mult-1)," charisma skill"))),t.hacking_exp_mult&&t.hacking_exp_mult===t.strength_exp_mult&&t.hacking_exp_mult===t.defense_exp_mult&&t.hacking_exp_mult===t.dexterity_exp_mult&&t.hacking_exp_mult===t.agility_exp_mult&&t.hacking_exp_mult===t.charisma_exp_mult?s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.hacking_exp_mult-1)," exp for all skills"):(t.hacking_exp_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.hacking_exp_mult-1)," hacking exp")),t.strength_exp_mult&&t.strength_exp_mult===t.defense_exp_mult&&t.strength_exp_mult===t.dexterity_exp_mult&&t.strength_exp_mult===t.agility_exp_mult?s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.strength_exp_mult-1)," combat exp"):(t.strength_exp_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.strength_exp_mult-1)," strength exp")),t.defense_exp_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.defense_exp_mult-1)," defense exp")),t.dexterity_exp_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.dexterity_exp_mult-1)," dexterity exp")),t.agility_exp_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.agility_exp_mult-1)," agility exp"))),t.charisma_exp_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.charisma_exp_mult-1)," charisma exp"))),t.hacking_speed_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.hacking_speed_mult-1)," faster hack(), grow(), and weaken()")),t.hacking_chance_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.hacking_chance_mult-1)," hack() success chance")),t.hacking_money_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.hacking_money_mult-1)," hack() power")),t.hacking_grow_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.hacking_grow_mult-1)," grow() power")),t.faction_rep_mult&&t.faction_rep_mult===t.company_rep_mult?s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.faction_rep_mult-1)," reputation from factions and companies"):(t.faction_rep_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.faction_rep_mult-1)," reputation from factions")),t.company_rep_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.company_rep_mult-1)," reputation from companies"))),t.crime_money_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.crime_money_mult-1)," crime money")),t.crime_success_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.crime_success_mult-1)," crime success rate")),t.work_money_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.work_money_mult-1)," work money")),t.hacknet_node_money_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.hacknet_node_money_mult-1)," hacknet production")),t.hacknet_node_purchase_cost_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"-",r(-(t.hacknet_node_purchase_cost_mult-1))," hacknet nodes cost")),t.hacknet_node_level_cost_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"-",r(-(t.hacknet_node_level_cost_mult-1))," hacknet nodes upgrade cost")),t.bladeburner_max_stamina_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.bladeburner_max_stamina_mult-1)," Bladeburner Max Stamina")),t.bladeburner_stamina_gain_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.bladeburner_stamina_gain_mult-1)," Bladeburner Stamina gain")),t.bladeburner_analysis_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.bladeburner_analysis_mult-1)," Bladeburner Field Analysis effectiveness")),t.bladeburner_success_chance_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.bladeburner_success_chance_mult-1)," Bladeburner Contracts and Operations success chance")),t.infiltration_base_rep_increase&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.infiltration_base_rep_increase-1)," Infiltration ",l.a.ShadowsOfAnarchy," Reputation base reward")),t.infiltration_rep_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.infiltration_rep_mult-1)," Infiltration ",l.a.ShadowsOfAnarchy," Reputation reward")),t.infiltration_trade_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.infiltration_trade_mult-1)," Infiltration Reputation for trading information")),t.infiltration_sell_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.infiltration_sell_mult-1)," Infiltration cash reward for selling information")),t.infiltration_timer_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.infiltration_timer_mult-1)," Infiltration time per minigame")),t.infiltration_damage_reduction_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),r(t.infiltration_damage_reduction_mult-1)," Infiltration health lost per failed minigame")),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 i}));var a=n(15);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,DividendMaxPercentage: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"],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 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={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,"hb",(function(){return et})),n.d(e,"kb",(function(){return nt})),n.d(e,"lb",(function(){return at})),n.d(e,"tb",(function(){return rt})),n.d(e,"o",(function(){return it})),n.d(e,"p",(function(){return ot})),n.d(e,"Sb",(function(){return st})),n.d(e,"wb",(function(){return lt})),n.d(e,"fb",(function(){return ct})),n.d(e,"zb",(function(){return ft})),n.d(e,"M",(function(){return ut})),n.d(e,"jb",(function(){return mt})),n.d(e,"s",(function(){return ht})),n.d(e,"ub",(function(){return dt})),n.d(e,"K",(function(){return pt})),n.d(e,"O",(function(){return gt})),n.d(e,"I",(function(){return yt})),n.d(e,"J",(function(){return bt})),n.d(e,"F",(function(){return Et})),n.d(e,"G",(function(){return vt})),n.d(e,"L",(function(){return kt})),n.d(e,"N",(function(){return _t})),n.d(e,"ob",(function(){return wt})),n.d(e,"xb",(function(){return St})),n.d(e,"nb",(function(){return xt})),n.d(e,"Mb",(function(){return Ct})),n.d(e,"mb",(function(){return Lt})),n.d(e,"t",(function(){return Ot})),n.d(e,"Tb",(function(){return Mt})),n.d(e,"D",(function(){return Tt})),n.d(e,"Nb",(function(){return At})),n.d(e,"Vb",(function(){return Rt})),n.d(e,"E",(function(){return Nt})),n.d(e,"Kb",(function(){return Pt})),n.d(e,"Ob",(function(){return It})),n.d(e,"Jb",(function(){return Ft})),n.d(e,"Hb",(function(){return Dt})),n.d(e,"Gb",(function(){return jt})),n.d(e,"Ib",(function(){return Bt})),n.d(e,"Ub",(function(){return Gt})),n.d(e,"B",(function(){return Wt})),n.d(e,"Y",(function(){return Ht})),n.d(e,"X",(function(){return Ut})),n.d(e,"ab",(function(){return qt})),n.d(e,"V",(function(){return $t})),n.d(e,"W",(function(){return Kt})),n.d(e,"T",(function(){return zt})),n.d(e,"U",(function(){return Vt})),n.d(e,"Z",(function(){return Yt})),n.d(e,"Eb",(function(){return Jt})),n.d(e,"x",(function(){return Xt})),n.d(e,"z",(function(){return Qt})),n.d(e,"Lb",(function(){return Zt})),n.d(e,"w",(function(){return te})),n.d(e,"C",(function(){return ee})),n.d(e,"Db",(function(){return ne})),n.d(e,"Pb",(function(){return ae})),n.d(e,"y",(function(){return re})),n.d(e,"Fb",(function(){return ie})),n.d(e,"v",(function(){return oe})),n.d(e,"A",(function(){return se})),n.d(e,"Bb",(function(){return le})),n.d(e,"Qb",(function(){return ce})),n.d(e,"vb",(function(){return fe})),n.d(e,"gb",(function(){return ue})),n.d(e,"f",(function(){return me})),n.d(e,"S",(function(){return he})),n.d(e,"qb",(function(){return de})),n.d(e,"eb",(function(){return pe})),n.d(e,"m",(function(){return ge})),n.d(e,"l",(function(){return ye})),n.d(e,"e",(function(){return be})),n.d(e,"j",(function(){return Ee})),n.d(e,"g",(function(){return ve})),n.d(e,"c",(function(){return ke})),n.d(e,"b",(function(){return _e})),n.d(e,"k",(function(){return we})),n.d(e,"a",(function(){return Se})),n.d(e,"d",(function(){return xe})),n.d(e,"h",(function(){return Ce})),n.d(e,"n",(function(){return Le})),n.d(e,"i",(function(){return Oe})),n.d(e,"ib",(function(){return Me})),n.d(e,"rb",(function(){return Te})),n.d(e,"sb",(function(){return Ae})),n.d(e,"u",(function(){return Re})),n.d(e,"yb",(function(){return Ne})),n.d(e,"pb",(function(){return Pe})),n.d(e,"H",(function(){return Ie})),n.d(e,"Rb",(function(){return Fe})),n.d(e,"db",(function(){return De})),n.d(e,"r",(function(){return je})),n.d(e,"cb",(function(){return Be})),n.d(e,"bb",(function(){return Ge})),n.d(e,"Q",(function(){return We})),n.d(e,"P",(function(){return He})),n.d(e,"R",(function(){return Ue})),n.d(e,"Ab",(function(){return qe})),n.d(e,"q",(function(){return $e})),n.d(e,"Cb",(function(){return Ke}));var a=n(119),r=n(341),i=n(12),o=n(18),s=n(116),l=n(238),c=n(67),f=n(682),u=n(537),m=n(95),h=n(31),d=n(10),p=n(65),g=n(379),y=n(86),b=n(185),E=n(26),v=n(82),k=n(154),_=n(186),w=n(15),S=n(9),x=n(326),C=n(181),L=n(284),O=n(244),M=n(24),T=n(46),A=n(137),R=n(88),N=n(1367),P=n(1368),I=n(371),F=n(529),D=n(406),j=n(92),B=n(5),G=n(385),W=n(14),H=n(22),U=n(128),q=n(20),$=n(0),K=n.n($),z=n(367),V=n(94),Y=n(793),J=n(300),X=n(4),Q=n(2),Z=n(269),tt=n(34);function et(){const t=Object(A.g)({adminRights:!0,hostname:"home",ip:Object(M.e)(),isConnectedTo:!0,maxRam:8,organizationName:"Home PC",purchasedByPlayer:!0});this.currentServer=R.a.Home,Object(M.a)(t),this.getHomeComputer().programs.push(p.a.NukeProgram.name)}function nt(){this.currentServer=R.a.Home,this.numPeopleKilled=0,this.hacking=1,this.strength=1,this.defense=1,this.dexterity=1,this.agility=1,this.charisma=1,this.hacking_exp=0,this.strength_exp=0,this.defense_exp=0,this.dexterity_exp=0,this.agility_exp=0,this.charisma_exp=0,this.money=1e3+d.a.Donations,this.city=w.a.Sector12,this.location=S.a.TravelAgency,this.companyName="",this.jobs={},this.purchasedServers=[],this.factions=[],this.factionInvitations=[],this.queuedAugmentations=[];const t=Math.min(3,this.sourceFileLvl(10)+(10===this.bitNodeN?1:0))+this.sleevesFromCovenant;this.sleeves.length>t&&(this.sleeves.length=t);for(let e=this.sleeves.length;e=100?this.sleeves[t].synchronize(this):this.sleeves[t].shockRecovery(this));this.isWorking=!1,this.currentWorkFactionName="",this.currentWorkFactionDescription="",this.createProgramName="",this.className=tt.a.None,this.crimeType=tt.b.None,this.workHackExpGainRate=0,this.workStrExpGainRate=0,this.workDefExpGainRate=0,this.workDexExpGainRate=0,this.workAgiExpGainRate=0,this.workChaExpGainRate=0,this.workRepGainRate=0,this.workMoneyGainRate=0,this.workHackExpGained=0,this.workStrExpGained=0,this.workDefExpGained=0,this.workDexExpGained=0,this.workAgiExpGained=0,this.workChaExpGained=0,this.workRepGained=0,this.workMoneyGained=0,this.timeWorked=0,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=this.max_hp}function at(){this.entropy=0,this.prestigeAugmentation(),this.karma=0;for(let t=0;t0?this.intelligence=Math.floor(this.calculateSkill(this.intelligence_exp)):this.intelligence=0;const t=this.hp/this.max_hp;this.max_hp=Math.floor(10+this.defense/10),this.hp=Math.round(this.max_hp*t)}function lt(){this.hacking_chance_mult=1,this.hacking_speed_mult=1,this.hacking_money_mult=1,this.hacking_grow_mult=1,this.hacking_mult=1,this.strength_mult=1,this.defense_mult=1,this.dexterity_mult=1,this.agility_mult=1,this.charisma_mult=1,this.hacking_exp_mult=1,this.strength_exp_mult=1,this.defense_exp_mult=1,this.dexterity_exp_mult=1,this.agility_exp_mult=1,this.charisma_exp_mult=1,this.company_rep_mult=1,this.faction_rep_mult=1,this.crime_money_mult=1,this.crime_success_mult=1,this.hacknet_node_money_mult=1,this.hacknet_node_purchase_cost_mult=1,this.hacknet_node_ram_cost_mult=1,this.hacknet_node_core_cost_mult=1,this.hacknet_node_level_cost_mult=1,this.work_money_mult=1,this.bladeburner_max_stamina_mult=1,this.bladeburner_stamina_gain_mult=1,this.bladeburner_analysis_mult=1,this.bladeburner_success_chance_mult=1}function ct(t){const e=this.getHomeComputer();if(null==e)return!1;for(let n=0;n=t}function dt(t,e){this.moneySourceA instanceof G.a||(console.warn("Player.moneySourceA was not properly initialized. Resetting"),this.moneySourceA=new G.a),this.moneySourceB instanceof G.a||(console.warn("Player.moneySourceB was not properly initialized. Resetting"),this.moneySourceB=new G.a),this.moneySourceA.record(t,e),this.moneySourceB.record(t,e)}function pt(t){isNaN(t)?console.error("ERR: NaN passed into Player.gainHackingExp()"):(this.hacking_exp+=t,this.hacking_exp<0&&(this.hacking_exp=0),this.hacking=Object(C.b)(this.hacking_exp,this.hacking_mult*o.a.HackingLevelMultiplier))}function gt(t){isNaN(t)?console.error("ERR: NaN passed into Player.gainStrengthExp()"):(this.strength_exp+=t,this.strength_exp<0&&(this.strength_exp=0),this.strength=Object(C.b)(this.strength_exp,this.strength_mult*o.a.StrengthLevelMultiplier))}function yt(t){if(isNaN(t))return void console.error("ERR: NaN passed into player.gainDefenseExp()");this.defense_exp+=t,this.defense_exp<0&&(this.defense_exp=0),this.defense=Object(C.b)(this.defense_exp,this.defense_mult*o.a.DefenseLevelMultiplier);const e=this.hp/this.max_hp;this.max_hp=Math.floor(10+this.defense/10),this.hp=Math.round(this.max_hp*e)}function bt(t){isNaN(t)?console.error("ERR: NaN passed into Player.gainDexterityExp()"):(this.dexterity_exp+=t,this.dexterity_exp<0&&(this.dexterity_exp=0),this.dexterity=Object(C.b)(this.dexterity_exp,this.dexterity_mult*o.a.DexterityLevelMultiplier))}function Et(t){isNaN(t)?console.error("ERR: NaN passed into Player.gainAgilityExp()"):(this.agility_exp+=t,this.agility_exp<0&&(this.agility_exp=0),this.agility=Object(C.b)(this.agility_exp,this.agility_mult*o.a.AgilityLevelMultiplier))}function vt(t){isNaN(t)?console.error("ERR: NaN passed into Player.gainCharismaExp()"):(this.charisma_exp+=t,this.charisma_exp<0&&(this.charisma_exp=0),this.charisma=Object(C.b)(this.charisma_exp,this.charisma_mult*o.a.CharismaLevelMultiplier))}function kt(t){isNaN(t)?console.error("ERROR: NaN passed into Player.gainIntelligenceExp()"):(Q.a.sourceFileLvl(5)>0||this.intelligence>0)&&(this.intelligence_exp+=t,this.intelligence=Math.floor(this.calculateSkill(this.intelligence_exp,1)))}function _t(t){this.gainHackingExp(t.hack*this.hacking_exp_mult),this.gainStrengthExp(t.str*this.strength_exp_mult),this.gainDefenseExp(t.def*this.defense_exp_mult),this.gainDexterityExp(t.dex*this.dexterity_exp_mult),this.gainAgilityExp(t.agi*this.agility_exp_mult),this.gainCharismaExp(t.cha*this.charisma_exp_mult),this.gainIntelligenceExp(t.int)}function wt(t){const e=t.toLowerCase();return e.includes("hack")?this.hacking:e.includes("str")?this.strength:e.includes("def")?this.defense:e.includes("dex")?this.dexterity:e.includes("agi")?this.agility:e.includes("cha")?this.charisma:e.includes("int")?this.intelligence:0}function St(t,e,n){this.workType!==tt.d.Faction&&t===this.workType&&e===this.companyName||t===this.workType&&e===this.currentWorkFactionName&&n===this.factionWorkType||(this.isWorking&&this.singularityStopWork(),this.workHackExpGainRate=0,this.workStrExpGainRate=0,this.workDefExpGainRate=0,this.workDexExpGainRate=0,this.workAgiExpGainRate=0,this.workChaExpGainRate=0,this.workRepGainRate=0,this.workMoneyGainRate=0,this.workMoneyLossRate=0,this.workHackExpGained=0,this.workStrExpGained=0,this.workDefExpGained=0,this.workDexExpGained=0,this.workAgiExpGained=0,this.workChaExpGained=0,this.workRepGained=0,this.workMoneyGained=0,this.timeWorked=0,this.timeWorkedCreateProgram=0,this.timeWorkedGraftAugmentation=0,this.currentWorkFactionName="",this.currentWorkFactionDescription="",this.createProgramName="",this.graftAugmentationName="",this.className=tt.a.None,this.workType=tt.d.None)}function xt(t=1){let e=1;this.hasAugmentation(i.a.NeuroreceptorManager)||(e=this.focus?1:d.a.BaseFocusBonus);const n=e*this.workHackExpGainRate*t,a=e*this.workStrExpGainRate*t,r=e*this.workDefExpGainRate*t,o=e*this.workDexExpGainRate*t,s=e*this.workAgiExpGainRate*t,l=e*this.workChaExpGainRate*t,c=(this.workMoneyGainRate-this.workMoneyLossRate)*t;this.gainHackingExp(n),this.gainStrengthExp(a),this.gainDefenseExp(r),this.gainDexterityExp(o),this.gainAgilityExp(s),this.gainCharismaExp(l),this.gainMoney(c,this.className?"class":"work"),this.workHackExpGained+=n,this.workStrExpGained+=a,this.workDefExpGained+=r,this.workDexExpGained+=o,this.workAgiExpGained+=s,this.workChaExpGained+=l,this.workRepGained+=e*this.workRepGainRate*t,this.workMoneyGained+=e*this.workMoneyGainRate*t,this.workMoneyGained-=e*this.workMoneyLossRate*t}function Ct(t){this.resetWorkStatus(tt.d.Company,t),this.isWorking=!0,this.companyName=t,this.workType=tt.d.Company,this.workHackExpGainRate=this.getWorkHackExpGain(),this.workStrExpGainRate=this.getWorkStrExpGain(),this.workDefExpGainRate=this.getWorkDefExpGain(),this.workDexExpGainRate=this.getWorkDexExpGain(),this.workAgiExpGainRate=this.getWorkAgiExpGain(),this.workChaExpGainRate=this.getWorkChaExpGain(),this.workRepGainRate=this.getWorkRepGain(),this.workMoneyGainRate=this.getWorkMoneyGain(),this.timeNeededToCompleteWork=d.a.MillisecondsPer8Hours}function Lt(t,e=1){this.isWorking&&(this.workType===tt.d.Faction?this.workForFaction(e)&&t.toFaction(E.a[this.currentWorkFactionName]):this.workType===tt.d.CreateProgram?this.createProgramWork(e)&&t.toTerminal():this.workType===tt.d.StudyClass?this.takeClass(e)&&t.toCity():this.workType===tt.d.Crime?this.commitCrime(e)&&t.toLocation(_.a[S.a.Slums]):this.workType===tt.d.CompanyPartTime?this.workPartTime(e)&&t.toCity():this.workType===tt.d.GraftAugmentation?this.graftAugmentationWork(e)&&t.toGrafting():this.work(e)&&t.toCity())}function Ot(){const t=z.a.find(t=>t.specialName===this.companyName);if(!t)return.5;const e=Object(M.d)(t.hostname);return e instanceof T.a&&e&&e.backdoorInstalled?.75:.5}function Mt(t){let e=!1;this.timeWorked+d.a._idleSpeed*t>=d.a.MillisecondsPer8Hours&&(e=!0,t=Math.round((d.a.MillisecondsPer8Hours-this.timeWorked)/d.a._idleSpeed)),this.timeWorked+=d.a._idleSpeed*t,this.workRepGainRate=this.getWorkRepGain(),this.workMoneyGainRate=this.getWorkMoneyGain(),this.processWorkEarnings(t);const n=c.a[this.companyName];return Object(F.a)(n,this.workRepGainRate,t),!!(e||this.timeWorked>=d.a.MillisecondsPer8Hours)&&(this.finishWork(!1),!0)}function Tt(t,e=!1){t&&(this.workRepGained*=this.cancelationPenalty());const n=.5===this.cancelationPenalty()?"half":"three-quarters";c.a[this.companyName].playerReputation+=this.workRepGained,this.updateSkillLevels();let a=K.a.createElement(K.a.Fragment,null,"You earned a total of: ",K.a.createElement("br",null),K.a.createElement(q.a,{money:this.workMoneyGained}),K.a.createElement("br",null),K.a.createElement(U.a,{reputation:this.workRepGained})," reputation for the company ",K.a.createElement("br",null),this.workHackExpGained>0&&K.a.createElement(K.a.Fragment,null,B.a.formatExp(this.workHackExpGained)," hacking exp ",K.a.createElement("br",null)),this.workStrExpGained>0&&K.a.createElement(K.a.Fragment,null,B.a.formatExp(this.workStrExpGained)," strength exp ",K.a.createElement("br",null)),this.workDefExpGained>0&&K.a.createElement(K.a.Fragment,null,B.a.formatExp(this.workDefExpGained)," defense exp ",K.a.createElement("br",null)),this.workDexExpGained>0&&K.a.createElement(K.a.Fragment,null,B.a.formatExp(this.workDexExpGained)," dexterity exp ",K.a.createElement("br",null)),this.workAgiExpGained>0&&K.a.createElement(K.a.Fragment,null,B.a.formatExp(this.workAgiExpGained)," agility exp ",K.a.createElement("br",null)),this.workChaExpGained>0&&K.a.createElement(K.a.Fragment,null,B.a.formatExp(this.workChaExpGained)," charisma exp ",K.a.createElement("br",null)),K.a.createElement("br",null));if(a=t?K.a.createElement(K.a.Fragment,null,"You worked a short shift of ",Object(H.d)(this.timeWorked)," ",K.a.createElement("br",null),K.a.createElement("br",null),"Since you cancelled your work early, you only gained ",n," of the reputation you earned. ",K.a.createElement("br",null),K.a.createElement("br",null),a):K.a.createElement(K.a.Fragment,null,"You worked a full shift of 8 hours! ",K.a.createElement("br",null),K.a.createElement("br",null),a),e||Object(W.a)(a),this.isWorking=!1,this.focus=!1,this.resetWorkStatus(),e){return"You worked a short shift of "+Object(H.d)(this.timeWorked)+" and earned $"+B.a.formatMoney(this.workMoneyGained)+", "+B.a.formatReputation(this.workRepGained)+" reputation, "+B.a.formatExp(this.workHackExpGained)+" hacking exp, "+B.a.formatExp(this.workStrExpGained)+" strength exp, "+B.a.formatExp(this.workDefExpGained)+" defense exp, "+B.a.formatExp(this.workDexExpGained)+" dexterity exp, "+B.a.formatExp(this.workAgiExpGained)+" agility exp, and "+B.a.formatExp(this.workChaExpGained)+" charisma exp."}return""}function At(t){this.resetWorkStatus(tt.d.CompanyPartTime,t),this.isWorking=!0,this.companyName=t,this.workType=tt.d.CompanyPartTime,this.workHackExpGainRate=this.getWorkHackExpGain(),this.workStrExpGainRate=this.getWorkStrExpGain(),this.workDefExpGainRate=this.getWorkDefExpGain(),this.workDexExpGainRate=this.getWorkDexExpGain(),this.workAgiExpGainRate=this.getWorkAgiExpGain(),this.workChaExpGainRate=this.getWorkChaExpGain(),this.workRepGainRate=this.getWorkRepGain(),this.workMoneyGainRate=this.getWorkMoneyGain(),this.timeNeededToCompleteWork=d.a.MillisecondsPer8Hours}function Rt(t){let e=!1;return this.timeWorked+d.a._idleSpeed*t>=d.a.MillisecondsPer8Hours&&(e=!0,t=Math.round((d.a.MillisecondsPer8Hours-this.timeWorked)/d.a._idleSpeed)),this.timeWorked+=d.a._idleSpeed*t,this.workRepGainRate=this.getWorkRepGain(),this.processWorkEarnings(t),!!(e||this.timeWorked>=d.a.MillisecondsPer8Hours)&&(this.finishWorkPartTime(),!0)}function Nt(t=!1){c.a[this.companyName].playerReputation+=this.workRepGained,this.updateSkillLevels();const e=K.a.createElement(K.a.Fragment,null,"You worked for ",Object(H.d)(this.timeWorked),K.a.createElement("br",null),K.a.createElement("br",null),"You earned a total of: ",K.a.createElement("br",null),K.a.createElement(q.a,{money:this.workMoneyGained}),K.a.createElement("br",null),K.a.createElement(U.a,{reputation:this.workRepGained})," reputation for the company ",K.a.createElement("br",null),B.a.formatExp(this.workHackExpGained)," hacking exp ",K.a.createElement("br",null),B.a.formatExp(this.workStrExpGained)," strength exp ",K.a.createElement("br",null),B.a.formatExp(this.workDefExpGained)," defense exp ",K.a.createElement("br",null),B.a.formatExp(this.workDexExpGained)," dexterity exp ",K.a.createElement("br",null),B.a.formatExp(this.workAgiExpGained)," agility exp ",K.a.createElement("br",null),B.a.formatExp(this.workChaExpGained)," charisma exp",K.a.createElement("br",null));if(t||Object(W.a)(e),this.isWorking=!1,this.resetWorkStatus(),t){return"You worked for "+Object(H.d)(this.timeWorked)+" and earned a total of $"+B.a.formatMoney(this.workMoneyGained)+", "+B.a.formatReputation(this.workRepGained)+" reputation, "+B.a.formatExp(this.workHackExpGained)+" hacking exp, "+B.a.formatExp(this.workStrExpGained)+" strength exp, "+B.a.formatExp(this.workDefExpGained)+" defense exp, "+B.a.formatExp(this.workDexExpGained)+" dexterity exp, "+B.a.formatExp(this.workAgiExpGained)+" agility exp, and "+B.a.formatExp(this.workChaExpGained)+" charisma exp"}return""}function Pt(){this.focus=!0}function It(){this.focus=!1}function Ft(t){let e=1+t.favor/100;isNaN(e)&&(e=1),this.workRepGainRate*=e,this.workRepGainRate*=o.a.FactionWorkRepGain,this.isWorking=!0,this.workType=tt.d.Faction,this.currentWorkFactionName=t.name,this.timeNeededToCompleteWork=d.a.MillisecondsPer20Hours}function Dt(t){this.resetWorkStatus(tt.d.Faction,t.name,tt.c.Hacking),this.workHackExpGainRate=.15*this.hacking_exp_mult*o.a.FactionWorkExpGain,this.workRepGainRate=Object(O.c)(this,t),this.factionWorkType=tt.c.Hacking,this.currentWorkFactionDescription="carrying out hacking contracts",this.startFactionWork(t)}function jt(t){this.resetWorkStatus(tt.d.Faction,t.name,tt.c.Field),this.workHackExpGainRate=.1*this.hacking_exp_mult*o.a.FactionWorkExpGain,this.workStrExpGainRate=.1*this.strength_exp_mult*o.a.FactionWorkExpGain,this.workDefExpGainRate=.1*this.defense_exp_mult*o.a.FactionWorkExpGain,this.workDexExpGainRate=.1*this.dexterity_exp_mult*o.a.FactionWorkExpGain,this.workAgiExpGainRate=.1*this.agility_exp_mult*o.a.FactionWorkExpGain,this.workChaExpGainRate=.1*this.charisma_exp_mult*o.a.FactionWorkExpGain,this.workRepGainRate=Object(O.a)(this,t),this.factionWorkType=tt.c.Field,this.currentWorkFactionDescription="carrying out field missions",this.startFactionWork(t)}function Bt(t){this.resetWorkStatus(tt.d.Faction,t.name,tt.c.Security),this.workHackExpGainRate=.05*this.hacking_exp_mult*o.a.FactionWorkExpGain,this.workStrExpGainRate=.15*this.strength_exp_mult*o.a.FactionWorkExpGain,this.workDefExpGainRate=.15*this.defense_exp_mult*o.a.FactionWorkExpGain,this.workDexExpGainRate=.15*this.dexterity_exp_mult*o.a.FactionWorkExpGain,this.workAgiExpGainRate=.15*this.agility_exp_mult*o.a.FactionWorkExpGain,this.workChaExpGainRate=0*this.charisma_exp_mult*o.a.FactionWorkExpGain,this.workRepGainRate=Object(O.b)(this,t),this.factionWorkType=tt.c.Security,this.currentWorkFactionDescription="performing security detail",this.startFactionWork(t)}function Gt(t){const e=E.a[this.currentWorkFactionName];if(!e)return!1;switch(this.factionWorkType){case tt.c.Hacking:this.workRepGainRate=Object(O.c)(this,e);break;case tt.c.Field:this.workRepGainRate=Object(O.a)(this,e);break;case tt.c.Security:this.workRepGainRate=Object(O.b)(this,e)}this.workRepGainRate*=o.a.FactionWorkRepGain;let n=!1;return this.timeWorked+d.a._idleSpeed*t>=d.a.MillisecondsPer20Hours&&(n=!0,t=Math.round((d.a.MillisecondsPer20Hours-this.timeWorked)/d.a._idleSpeed)),this.timeWorked+=d.a._idleSpeed*t,this.processWorkEarnings(t),!!(n||this.timeWorked>=d.a.MillisecondsPer20Hours)&&(this.finishFactionWork(!1),!0)}function Wt(t,e=!1){const n=E.a[this.currentWorkFactionName];n.playerReputation+=this.workRepGained,this.updateSkillLevels();let a="";return e?a="You worked for your faction "+n.name+" for a total of "+Object(H.d)(this.timeWorked)+". You earned "+B.a.formatReputation(this.workRepGained)+" rep, "+B.a.formatExp(this.workHackExpGained)+" hacking exp, "+B.a.formatExp(this.workStrExpGained)+" str exp, "+B.a.formatExp(this.workDefExpGained)+" def exp, "+B.a.formatExp(this.workDexExpGained)+" dex exp, "+B.a.formatExp(this.workAgiExpGained)+" agi exp, and "+B.a.formatExp(this.workChaExpGained)+" cha exp.":Object(W.a)(K.a.createElement(K.a.Fragment,null,"You worked for your faction ",n.name," for a total of ",Object(H.d)(this.timeWorked)," ",K.a.createElement("br",null),K.a.createElement("br",null),"You earned a total of: ",K.a.createElement("br",null),K.a.createElement(q.a,{money:this.workMoneyGained}),K.a.createElement("br",null),K.a.createElement(U.a,{reputation:this.workRepGained})," reputation for the faction ",K.a.createElement("br",null),B.a.formatExp(this.workHackExpGained)," hacking exp ",K.a.createElement("br",null),B.a.formatExp(this.workStrExpGained)," strength exp ",K.a.createElement("br",null),B.a.formatExp(this.workDefExpGained)," defense exp ",K.a.createElement("br",null),B.a.formatExp(this.workDexExpGained)," dexterity exp ",K.a.createElement("br",null),B.a.formatExp(this.workAgiExpGained)," agility exp ",K.a.createElement("br",null),B.a.formatExp(this.workChaExpGained)," charisma exp",K.a.createElement("br",null))),this.isWorking=!1,this.resetWorkStatus(),a}function Ht(){let t=1;const e=c.a[this.companyName];this.sourceFileLvl(11)>0&&(t=1+e.favor/100);const n=this.jobs[this.companyName],a=m.a[n];return null==a?(console.error(`Could not find CompanyPosition object for ${n}. Work salary will be 0`),0):a.baseSalary*e.salaryMultiplier*this.work_money_mult*o.a.CompanyWorkMoney*t}function Ut(){const t=c.a[this.companyName],e=this.jobs[this.companyName],n=m.a[e];return null==t||null==n?(console.error(["Could not find Company object for "+this.companyName,`or CompanyPosition object for ${e}.`,"Work hack exp gain will be 0"].join(" ")),0):n.hackingExpGain*t.expMultiplier*this.hacking_exp_mult*o.a.CompanyWorkExpGain}function qt(){const t=c.a[this.companyName],e=this.jobs[this.companyName],n=m.a[e];return null==t||null==n?(console.error(["Could not find Company object for "+this.companyName,`or CompanyPosition object for ${e}.`,"Work str exp gain will be 0"].join(" ")),0):n.strengthExpGain*t.expMultiplier*this.strength_exp_mult*o.a.CompanyWorkExpGain}function $t(){const t=c.a[this.companyName],e=this.jobs[this.companyName],n=m.a[e];return null==t||null==n?(console.error(["Could not find Company object for "+this.companyName,`or CompanyPosition object for ${e}.`,"Work def exp gain will be 0"].join(" ")),0):n.defenseExpGain*t.expMultiplier*this.defense_exp_mult*o.a.CompanyWorkExpGain}function Kt(){const t=c.a[this.companyName],e=this.jobs[this.companyName],n=m.a[e];return null==t||null==n?(console.error(["Could not find Company object for "+this.companyName,`or CompanyPosition object for ${e}.`,"Work dex exp gain will be 0"].join(" ")),0):n.dexterityExpGain*t.expMultiplier*this.dexterity_exp_mult*o.a.CompanyWorkExpGain}function zt(){const t=c.a[this.companyName],e=this.jobs[this.companyName],n=m.a[e];return null==t||null==n?(console.error(["Could not find Company object for "+this.companyName,`or CompanyPosition object for ${e}.`,"Work agi exp gain will be 0"].join(" ")),0):n.agilityExpGain*t.expMultiplier*this.agility_exp_mult*o.a.CompanyWorkExpGain}function Vt(){const t=c.a[this.companyName],e=this.jobs[this.companyName],n=m.a[e];return null==t||null==n?(console.error(["Could not find Company object for "+this.companyName,`or CompanyPosition object for ${e}.`,"Work cha exp gain will be 0"].join(" ")),0):n.charismaExpGain*t.expMultiplier*this.charisma_exp_mult*o.a.CompanyWorkExpGain}function Yt(){const t=c.a[this.companyName],e=this.jobs[this.companyName],n=m.a[e];if(null==t||null==n)return console.error(["Could not find Company object for "+this.companyName,`or CompanyPosition object for ${e}.`,"Work rep gain will be 0"].join(" ")),0;let a=n.calculateJobPerformance(this.hacking,this.strength,this.defense,this.dexterity,this.agility,this.charisma);a+=this.intelligence/d.a.MaxSkillLevel;let r=1+t.favor/100;return isNaN(r)&&(r=1),a*this.company_rep_mult*r}function Jt(t,e,n){this.resetWorkStatus(),this.isWorking=!0,this.workType=tt.d.CreateProgram,this.createProgramReqLvl=n,this.timeNeededToCompleteWork=e;for(let e=0;e=100)break;this.timeWorkedCreateProgram=a/100*this.timeNeededToCompleteWork,this.getHomeComputer().programs.splice(e,1)}}this.createProgramName=t}function Xt(t){let e=1;this.hasAugmentation(i.a.NeuroreceptorManager)||(e=this.focus?1:d.a.BaseFocusBonus);const n=this.createProgramReqLvl;let a=this.hacking/n*this.getIntelligenceBonus(3);return a=1+(a-1)/5,a*=e,this.timeWorked+=d.a._idleSpeed*t,this.timeWorkedCreateProgram+=d.a._idleSpeed*t*a,this.timeWorkedCreateProgram>=this.timeNeededToCompleteWork&&(this.finishCreateProgramWork(!1),!0)}function Qt(t){const e=this.createProgramName;if(t){if(!this.getHomeComputer().programs.includes(e)){const t=e+"-"+(Math.floor(this.timeWorkedCreateProgram/this.timeNeededToCompleteWork*1e4)/100).toString()+"%-INC";this.getHomeComputer().programs.push(t)}}else this.gainIntelligenceExp(d.a.IntelligenceProgramBaseExpGain*this.timeWorked/1e3),Object(W.a)(`You've finished creating ${e}!
The new program can be found on your home computer.`),this.getHomeComputer().programs.includes(e)||this.getHomeComputer().programs.push(e);return this.isWorking=!1,this.resetWorkStatus(),"You've finished creating "+e+"! The new program can be found on your home computer."}function Zt(t,e){this.resetWorkStatus(),this.isWorking=!0,this.workType=tt.d.GraftAugmentation,this.timeNeededToCompleteWork=e,this.graftAugmentationName=t}function te(t){let e=1;this.hasAugmentation(i.a.NeuroreceptorManager)||(e=this.focus?1:d.a.BaseFocusBonus);let n=Object(Z.c)(this);return n*=e,this.timeWorked+=d.a._idleSpeed*t,this.timeWorkedGraftAugmentation+=d.a._idleSpeed*t*n,this.timeWorkedGraftAugmentation>=this.timeNeededToCompleteWork&&(this.finishGraftAugmentationWork(!1),!0)}function ee(t,e=!1){const n=this.graftAugmentationName;return!1===t?(Object(a.a)({name:n,level:1}),this.hasAugmentation(i.a.CongruityImplant)||(this.entropy+=1,this.applyEntropy(this.entropy)),Object(W.a)(`You've finished grafting ${n}.
The augmentation has been applied to your body`+(this.hasAugmentation(i.a.CongruityImplant)?".":", but you feel a bit off."))):t&&!1===e&&Object(W.a)(`You cancelled the grafting of ${n}.
Your money was not returned to you.`),t||this.gainIntelligenceExp(d.a.IntelligenceGraftBaseExpGain*this.timeWorked/1e4),this.isWorking=!1,this.resetWorkStatus(),`Grafting of ${n} has ended.`}function ne(t,e,n){this.resetWorkStatus(),this.isWorking=!0,this.workType=tt.d.StudyClass,this.workCostMult=t,this.workExpMult=e,this.className=n;const a=Object(Y.a)(this);this.workMoneyLossRate=a.workMoneyLossRate,this.workHackExpGainRate=a.workHackExpGainRate,this.workStrExpGainRate=a.workStrExpGainRate,this.workDefExpGainRate=a.workDefExpGainRate,this.workDexExpGainRate=a.workDexExpGainRate,this.workAgiExpGainRate=a.workAgiExpGainRate,this.workChaExpGainRate=a.workChaExpGainRate}function ae(t){this.timeWorked+=d.a._idleSpeed*t;const e=Object(Y.a)(this);return this.workMoneyLossRate=e.workMoneyLossRate,this.workHackExpGainRate=e.workHackExpGainRate,this.workStrExpGainRate=e.workStrExpGainRate,this.workDefExpGainRate=e.workDefExpGainRate,this.workDexExpGainRate=e.workDexExpGainRate,this.workAgiExpGainRate=e.workAgiExpGainRate,this.workChaExpGainRate=e.workChaExpGainRate,this.processWorkEarnings(t),!1}function re(t=!1){if(this.gainIntelligenceExp(d.a.IntelligenceClassBaseExpGain*Math.round(this.timeWorked/1e3)),this.workMoneyGained>0)throw new Error("ERR: Somehow gained money while taking class");if(this.updateSkillLevels(),t||Object(W.a)(K.a.createElement(K.a.Fragment,null,"After ",this.className," for ",Object(H.d)(this.timeWorked),", ",K.a.createElement("br",null),"you spent a total of ",K.a.createElement(q.a,{money:-this.workMoneyGained}),". ",K.a.createElement("br",null),K.a.createElement("br",null),"You earned a total of: ",K.a.createElement("br",null),B.a.formatExp(this.workHackExpGained)," hacking exp ",K.a.createElement("br",null),B.a.formatExp(this.workStrExpGained)," strength exp ",K.a.createElement("br",null),B.a.formatExp(this.workDefExpGained)," defense exp ",K.a.createElement("br",null),B.a.formatExp(this.workDexExpGained)," dexterity exp ",K.a.createElement("br",null),B.a.formatExp(this.workAgiExpGained)," agility exp ",K.a.createElement("br",null),B.a.formatExp(this.workChaExpGained)," charisma exp",K.a.createElement("br",null))),this.isWorking=!1,t){const t="After "+this.className+" for "+Object(H.d)(this.timeWorked)+", you spent a total of "+B.a.formatMoney(-1*this.workMoneyGained)+". You earned a total of: "+B.a.formatExp(this.workHackExpGained)+" hacking exp, "+B.a.formatExp(this.workStrExpGained)+" strength exp, "+B.a.formatExp(this.workDefExpGained)+" defense exp, "+B.a.formatExp(this.workDexExpGained)+" dexterity exp, "+B.a.formatExp(this.workAgiExpGained)+" agility exp, and "+B.a.formatExp(this.workChaExpGained)+" charisma exp";return this.resetWorkStatus(),t}return this.resetWorkStatus(),""}function ie(t,e,n,a,r,i,s,l,c,f,u=null){this.crimeType=e,this.resetWorkStatus(),this.isWorking=!0,this.focus=!0,this.workType=tt.d.Crime,null!==u&&(this.committingCrimeThruSingFn=!0,this.singFnCrimeWorkerScript=u),this.workHackExpGained=n*this.hacking_exp_mult*o.a.CrimeExpGain,this.workStrExpGained=a*this.strength_exp_mult*o.a.CrimeExpGain,this.workDefExpGained=r*this.defense_exp_mult*o.a.CrimeExpGain,this.workDexExpGained=i*this.dexterity_exp_mult*o.a.CrimeExpGain,this.workAgiExpGained=s*this.agility_exp_mult*o.a.CrimeExpGain,this.workChaExpGained=l*this.charisma_exp_mult*o.a.CrimeExpGain,this.workMoneyGained=c*this.crime_money_mult*o.a.CrimeMoney,this.timeNeededToCompleteWork=f,t.toWork()}function oe(t){return this.timeWorked+=d.a._idleSpeed*t,this.timeWorked>=this.timeNeededToCompleteWork&&(this.finishCrime(!1),!0)}function se(t){if(!t){if(Object(g.a)(this,this.crimeType)){let t=null;for(const e of Object.keys(y.a))if(y.a[e].type==this.crimeType){t=y.a[e];break}if(null==t)return Object(W.a)(`ERR: Unrecognized crime type (${this.crimeType}). This is probably a bug please contact the developer`),"";this.gainMoney(this.workMoneyGained,"crime"),this.karma-=t.karma,this.numPeopleKilled+=t.kills,t.intelligence_exp>0&&this.gainIntelligenceExp(t.intelligence_exp),this.workHackExpGained*=2,this.workStrExpGained*=2,this.workDefExpGained*=2,this.workDexExpGained*=2,this.workAgiExpGained*=2,this.workChaExpGained*=2;const e=this.singFnCrimeWorkerScript;this.committingCrimeThruSingFn&&null!==e?null==e.disableLogs.ALL&&null==e.disableLogs.commitCrime&&e.scriptRef.log("SUCCESS: Crime successful! Gained "+B.a.formatMoney(this.workMoneyGained)+", "+B.a.formatExp(this.workHackExpGained)+" hack exp, "+B.a.formatExp(this.workStrExpGained)+" str exp, "+B.a.formatExp(this.workDefExpGained)+" def exp, "+B.a.formatExp(this.workDexExpGained)+" dex exp, "+B.a.formatExp(this.workAgiExpGained)+" agi exp, "+B.a.formatExp(this.workChaExpGained)+" cha exp."):Object(W.a)(K.a.createElement(K.a.Fragment,null,"Crime successful!",K.a.createElement("br",null),K.a.createElement("br",null),"You gained:",K.a.createElement("br",null),K.a.createElement(q.a,{money:this.workMoneyGained}),K.a.createElement("br",null),B.a.formatExp(this.workHackExpGained)," hacking experience ",K.a.createElement("br",null),B.a.formatExp(this.workStrExpGained)," strength experience",K.a.createElement("br",null),B.a.formatExp(this.workDefExpGained)," defense experience",K.a.createElement("br",null),B.a.formatExp(this.workDexExpGained)," dexterity experience",K.a.createElement("br",null),B.a.formatExp(this.workAgiExpGained)," agility experience",K.a.createElement("br",null),B.a.formatExp(this.workChaExpGained)," charisma experience"))}else{this.workHackExpGained/=2,this.workStrExpGained/=2,this.workDefExpGained/=2,this.workDexExpGained/=2,this.workAgiExpGained/=2,this.workChaExpGained/=2;const t=this.singFnCrimeWorkerScript;this.committingCrimeThruSingFn&&null!==t?null==t.disableLogs.ALL&&null==t.disableLogs.commitCrime&&t.scriptRef.log("FAIL: Crime failed! Gained "+B.a.formatExp(this.workHackExpGained)+" hack exp, "+B.a.formatExp(this.workStrExpGained)+" str exp, "+B.a.formatExp(this.workDefExpGained)+" def exp, "+B.a.formatExp(this.workDexExpGained)+" dex exp, "+B.a.formatExp(this.workAgiExpGained)+" agi exp, "+B.a.formatExp(this.workChaExpGained)+" cha exp."):Object(W.a)(K.a.createElement(K.a.Fragment,null,"Crime failed!",K.a.createElement("br",null),K.a.createElement("br",null),"You gained:",K.a.createElement("br",null),B.a.formatExp(this.workHackExpGained)," hacking experience ",K.a.createElement("br",null),B.a.formatExp(this.workStrExpGained)," strength experience",K.a.createElement("br",null),B.a.formatExp(this.workDefExpGained)," defense experience",K.a.createElement("br",null),B.a.formatExp(this.workDexExpGained)," dexterity experience",K.a.createElement("br",null),B.a.formatExp(this.workAgiExpGained)," agility experience",K.a.createElement("br",null),B.a.formatExp(this.workChaExpGained)," charisma experience"))}this.gainHackingExp(this.workHackExpGained),this.gainStrengthExp(this.workStrExpGained),this.gainDefenseExp(this.workDefExpGained),this.gainDexterityExp(this.workDexExpGained),this.gainAgilityExp(this.workAgiExpGained),this.gainCharismaExp(this.workChaExpGained)}return this.committingCrimeThruSingFn=!1,this.singFnCrimeWorkerScript=null,this.isWorking=!1,this.crimeType=tt.b.None,this.resetWorkStatus(),""}function le(){if(!this.isWorking)return"";let t="";switch(this.workType){case tt.d.StudyClass:t=this.finishClass(!0);break;case tt.d.Company:t=this.finishWork(!0,!0);break;case tt.d.CompanyPartTime:t=this.finishWorkPartTime(!0);break;case tt.d.Faction:t=this.finishFactionWork(!0,!0);break;case tt.d.CreateProgram:t=this.finishCreateProgramWork(!0);break;case tt.d.Crime:t=this.finishCrime(!0);break;case tt.d.GraftAugmentation:t=this.finishGraftAugmentationWork(!0,!0);break;default:return console.error(`Unrecognized work type (${this.workType})`),""}return t}function ce(t){return"number"!=typeof t?(console.warn("Player.takeDamage() called without a numeric argument: "+t),!1):(this.hp-=t,this.hp<=0&&(this.hospitalize(),!0))}function fe(t){"number"==typeof t?(this.hp+=t,this.hp>this.max_hp&&(this.hp=this.max_hp)):console.warn("Player.regenerateHp() called without a numeric argument: "+t)}function ue(){const t=Object(D.b)(this);return V.b.emit("You've been Hospitalized for "+B.a.formatMoney(t),V.d.WARNING,2e3),this.loseMoney(t,"hospitalization"),this.hp=this.max_hp,t}function me(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(W.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(W.a)("Unfortunately, you do not qualify for a promotion
"+e)}else Object(W.a)("You are already at the highest position for your field! No promotion available")}return!1}return this.jobs[n.name]=a.name,this.isWorking&&this.workType===tt.d.Company||(this.companyName=n.name),e||Object(W.a)("Congratulations! You were offered a new job at "+n.name+" as a "+a.name+"!"),!0}function he(t,e){let n=null;if(""!==this.companyName&&(n=c.a[this.companyName]),null==n||n.name!=t.name)return e;const a=this.jobs[this.companyName];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 de(t,e=!1){1==this.isWorking&&this.workType!==tt.d.Company&&this.companyName==t&&this.finishWork(!0),delete this.jobs[t],this.companyName===t&&(this.companyName=this.hasJob()?Object.keys(this.jobs)[0]:"")}function pe(){return Boolean(Object.keys(this.jobs).length)}function ge(t=!1){return this.applyForJob(m.a[h.j[0]],t)}function ye(t=!1){return this.applyForJob(m.a[h.k[0]],t)}function be(t=!1){return this.applyForJob(m.a[h.d[0]],t)}function Ee(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(W.a)("Unfortunately, you do not qualify for this position"),!1)}function ve(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(W.a)("Unfortunately, you do not qualify for this position"),!1}function ke(t=!1){return this.applyForJob(m.a[h.b[0]],t)}function _e(t=!1){return this.applyForJob(m.a[h.c[0]],t)}function we(t=!1){return this.applyForJob(m.a[h.h[2]],t)}function Se(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(W.a)("Unfortunately, you do not qualify for this position"),!1}function xe(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,!this.focus&&this.isWorking&&this.companyName!==e.name&&this.resetWorkStatus(),this.companyName=e.name,t||Object(W.a)("Congratulations, you are now employed at "+this.location),!0):(t||Object(W.a)("Unfortunately, you do not qualify for this position"),!1))}function Ce(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,!this.focus&&this.isWorking&&this.companyName!==e.name&&this.resetWorkStatus(),this.companyName=e.name,t||Object(W.a)("Congratulations, you are now employed part-time at "+this.location),!0):(t||Object(W.a)("Unfortunately, you do not qualify for this position"),!1))}function Le(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,!this.focus&&this.isWorking&&this.companyName!==e.name&&this.resetWorkStatus(),this.companyName=e.name,t||Object(W.a)("Congratulations, you are now employed as a waiter at "+this.location),!0):(t||Object(W.a)("Unfortunately, you do not qualify for this position"),!1))}function Oe(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,!this.focus&&this.isWorking&&this.companyName!==e.name&&this.resetWorkStatus(),this.companyName=e.name,t||Object(W.a)("Congratulations, you are now employed as a part-time waiter at "+this.location),!0):(t||Object(W.a)("Unfortunately, you do not qualify for this position"),!1))}function Me(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.hacking>=a&&this.strength>=r&&this.defense>=i&&this.dexterity>=o&&this.agility>=s&&this.charisma>=l&&t.playerReputation>=e.requiredReputation}function Te(t=!0){t&&this.resetMultipliers();for(let t=0;te}const i=E.a[X.a.Illuminati];!i.isBanned&&!i.isMember&&!i.alreadyInvited&&e>=30&&this.money>=15e10&&this.hacking>=1500&&this.strength>=1200&&this.defense>=1200&&this.dexterity>=1200&&this.agility>=1200&&t.push(i);const s=E.a[X.a.Daedalus];!s.isBanned&&!s.isMember&&!s.alreadyInvited&&e>=o.a.DaedalusAugsRequirement&&this.money>=1e11&&(this.hacking>=2500||this.strength>=1500&&this.defense>=1500&&this.dexterity>=1500&&this.agility>=1500)&&t.push(s);const l=E.a[X.a.TheCovenant];!l.isBanned&&!l.isMember&&!l.alreadyInvited&&e>=20&&this.money>=75e9&&this.hacking>=850&&this.strength>=850&&this.defense>=850&&this.dexterity>=850&&this.agility>=850&&t.push(l);const f=E.a[X.a.ECorp];f.isBanned||f.isMember||f.alreadyInvited||!r(S.a.AevumECorp)||t.push(f);const u=E.a[X.a.MegaCorp];u.isBanned||u.isMember||u.alreadyInvited||!r(S.a.Sector12MegaCorp)||t.push(u);const m=E.a[X.a.BachmanAssociates];m.isBanned||m.isMember||m.alreadyInvited||!r(S.a.AevumBachmanAndAssociates)||t.push(m);const h=E.a[X.a.BladeIndustries];h.isBanned||h.isMember||h.alreadyInvited||!r(S.a.Sector12BladeIndustries)||t.push(h);const p=E.a[X.a.NWO];p.isBanned||p.isMember||p.alreadyInvited||!r(S.a.VolhavenNWO)||t.push(p);const g=E.a[X.a.ClarkeIncorporated];g.isBanned||g.isMember||g.alreadyInvited||!r(S.a.AevumClarkeIncorporated)||t.push(g);const y=E.a[X.a.OmniTekIncorporated];y.isBanned||y.isMember||y.alreadyInvited||!r(S.a.VolhavenOmniTekIncorporated)||t.push(y);const b=E.a[X.a.FourSigma];b.isBanned||b.isMember||b.alreadyInvited||!r(S.a.Sector12FourSigma)||t.push(b);const v=E.a[X.a.KuaiGongInternational];v.isBanned||v.isMember||v.alreadyInvited||!r(S.a.ChongqingKuaiGongInternational)||t.push(v);const k=E.a[X.a.FulcrumSecretTechnologies],_=Object(M.d)(R.a.FulcrumSecretTechnologies);if(!(_ instanceof T.a))throw new Error(X.a.FulcrumSecretTechnologies+" should be normal server");null==_?console.error(`Could not find ${X.a.FulcrumSecretTechnologies} Server`):k.isBanned||k.isMember||k.alreadyInvited||!_.backdoorInstalled||!r(S.a.AevumFulcrumTechnologies,25e4)||t.push(k);const x=E.a[X.a.BitRunners],C=Object(M.d)(R.a.BitRunnersServer);if(!(C instanceof T.a))throw new Error(X.a.BitRunners+" should be normal server");null==C?console.error(`Could not find ${X.a.BitRunners} Server`):x.isBanned||x.isMember||!C.backdoorInstalled||x.alreadyInvited||t.push(x);const L=E.a[X.a.TheBlackHand],O=Object(M.d)(R.a.TheBlackHandServer);if(!(O instanceof T.a))throw new Error(X.a.TheBlackHand+" should be normal server");null==O?console.error(`Could not find ${X.a.TheBlackHand} Server`):L.isBanned||L.isMember||!O.backdoorInstalled||L.alreadyInvited||t.push(L);const A=E.a[X.a.NiteSec],N=Object(M.d)(R.a.NiteSecServer);if(!(N instanceof T.a))throw new Error(X.a.NiteSec+" should be normal server");null==N?console.error(`Could not find ${X.a.NiteSec} Server`):A.isBanned||A.isMember||!N.backdoorInstalled||A.alreadyInvited||t.push(A);const P=E.a[X.a.Chongqing];!P.isBanned&&!P.isMember&&!P.alreadyInvited&&this.money>=2e7&&this.city==w.a.Chongqing&&t.push(P);const I=E.a[X.a.Sector12];!I.isBanned&&!I.isMember&&!I.alreadyInvited&&this.money>=15e6&&this.city==w.a.Sector12&&t.push(I);const F=E.a[X.a.NewTokyo];!F.isBanned&&!F.isMember&&!F.alreadyInvited&&this.money>=2e7&&this.city==w.a.NewTokyo&&t.push(F);const D=E.a[X.a.Aevum];!D.isBanned&&!D.isMember&&!D.alreadyInvited&&this.money>=4e7&&this.city==w.a.Aevum&&t.push(D);const B=E.a[X.a.Ishima];!B.isBanned&&!B.isMember&&!B.alreadyInvited&&this.money>=3e7&&this.city==w.a.Ishima&&t.push(B);const G=E.a[X.a.Volhaven];!G.isBanned&&!G.isMember&&!G.alreadyInvited&&this.money>=5e7&&this.city==w.a.Volhaven&&t.push(G);const W=E.a[X.a.SpeakersForTheDead];!W.isBanned&&!W.isMember&&!W.alreadyInvited&&this.hacking>=100&&this.strength>=300&&this.defense>=300&&this.dexterity>=300&&this.agility>=300&&this.numPeopleKilled>=30&&this.karma<=-45&&!n.includes(S.a.Sector12CIA)&&!n.includes(S.a.Sector12NSA)&&t.push(W);const H=E.a[X.a.TheDarkArmy];!H.isBanned&&!H.isMember&&!H.alreadyInvited&&this.hacking>=300&&this.strength>=300&&this.defense>=300&&this.dexterity>=300&&this.agility>=300&&this.city==w.a.Chongqing&&this.numPeopleKilled>=5&&this.karma<=-45&&!n.includes(S.a.Sector12CIA)&&!n.includes(S.a.Sector12NSA)&&t.push(H);const U=E.a[X.a.TheSyndicate];!U.isBanned&&!U.isMember&&!U.alreadyInvited&&this.hacking>=200&&this.strength>=200&&this.defense>=200&&this.dexterity>=200&&this.agility>=200&&(this.city==w.a.Aevum||this.city==w.a.Sector12)&&this.money>=1e7&&this.karma<=-90&&!n.includes(S.a.Sector12CIA)&&!n.includes(S.a.Sector12NSA)&&t.push(U);const q=E.a[X.a.Silhouette];!q.isBanned&&!q.isMember&&!q.alreadyInvited&&(a.includes("Chief Technology Officer")||a.includes("Chief Financial Officer")||a.includes("Chief Executive Officer"))&&this.money>=15e6&&this.karma<=-22&&t.push(q);const $=E.a[X.a.Tetrads];!$.isBanned&&!$.isMember&&!$.alreadyInvited&&(this.city==w.a.Chongqing||this.city==w.a.NewTokyo||this.city==w.a.Ishima)&&this.strength>=75&&this.defense>=75&&this.dexterity>=75&&this.agility>=75&&this.karma<=-18&&t.push($);const K=E.a[X.a.SlumSnakes];!K.isBanned&&!K.isMember&&!K.alreadyInvited&&this.strength>=30&&this.defense>=30&&this.dexterity>=30&&this.agility>=30&&this.karma<=-9&&this.money>=1e6&&t.push(K);const z=E.a[X.a.Netburners];let V=0,Y=0,J=0;for(let t=0;t=80&&V>=8&&Y>=4&&J>=100&&t.push(z);const Q=E.a[X.a.TianDiHui];!Q.isBanned&&!Q.isMember&&!Q.alreadyInvited&&this.money>=1e6&&this.hacking>=50&&(this.city==w.a.Chongqing||this.city==w.a.NewTokyo||this.city==w.a.Ishima)&&t.push(Q);const Z=E.a[X.a.CyberSec],tt=Object(M.d)(R.a.CyberSecServer);if(!(tt instanceof T.a))throw new Error(X.a.CyberSec+" should be normal server");return null==tt?console.error(`Could not find ${X.a.CyberSec} Server`):Z.isBanned||Z.isMember||!tt.backdoorInstalled||Z.alreadyInvited||t.push(Z),t}function Ne(t){this.bitNodeN=t}function Pe(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 Ie(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||!(E.a[t.name]instanceof b.a))return t.type=s.c.FactionReputationAll,this.gainCodingContractReward(t);const n=d.a.CodingContractBaseFactionRepGain*e;return E.a[t.name].playerReputation+=n,`Gained ${n} faction reputation for ${t.name}`;case s.c.FactionReputationAll:const a=d.a.CodingContractBaseFactionRepGain*e,r=[X.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)E.a[t]instanceof b.a&&(E.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 "+B.a.formatMoney(t)}}}function Fe(t){return null==k.a[t]?(console.warn("Player.travel() called with invalid city: "+t),!1):(this.city=t,!0)}function De(t){return null==_.a[t]?(console.warn("Player.gotoLocation() called with invalid location: "+t),!1):(this.location=t,!0)}function je(){return 10===this.bitNodeN||this.sourceFileLvl(10)>0}function Be(t){this.exploits.includes(t)||(this.exploits.push(t),V.b.emit("SF -1 acquired!",V.d.SUCCESS,2e3))}function Ge(t){const e=J.a[t];e&&(this.achievements.map(t=>t.ID).includes(t)||(this.achievements.push({ID:t,unlockedOn:(new Date).getTime()}),V.b.emit(`Unlocked Achievement: "${e.Name}"`,V.d.SUCCESS,2e3)))}function We(t){return Object(L.a)(this.intelligence,t)}function He(){return this.moneySourceA.casino}function Ue(t){return this.hasOwnProperty(t)?this[t]:1}function qe(t,e){this.hasOwnProperty(t)&&(this[t]=e)}function $e(){return 13===this.bitNodeN||this.sourceFileLvl(13)>0}function Ke(t){const e=this.sourceFiles.find(e=>e.n===t);return e?e.lvl:0}},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(2),i=n(64),o=n(378);!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(577),r=n(18),i=n(1017),o=n(340),s=n(28);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 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 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(135),o=n(143);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,"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 _})),n.d(e,"n",(function(){return w})),n.d(e,"o",(function(){return S})),n.d(e,"k",(function(){return x})),n.d(e,"j",(function(){return C})),n.d(e,"i",(function(){return L})),n.d(e,"p",(function(){return M})),n.d(e,"m",(function(){return T}));var a=n(223),r=n(211),i=n(156),o=n(41),s=n(92),l=n(377),c=n(241),f=n(347),u=n(44),m=n(24),h=n(46);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.hacknet_node_money_mult);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.hacknet_node_purchase_cost_mult)}function b(t){return Object(i.f)(t.hacknetNodes.length+1,t.hacknet_node_purchase_cost_mult)}function E(t,e,n){if(null==n)throw new Error("getMaxNumberLevelUpgrades() called without maxLevel arg");if(t.moneye.calculateLevelUpgradeCost(i,t.hacknet_node_level_cost_mult))return i;for(;a<=r;){const o=(a+r)/2|0;if(o!==n&&t.money>e.calculateLevelUpgradeCost(o,t.hacknet_node_level_cost_mult)&&t.moneye.calculateLevelUpgradeCost(o,t.hacknet_node_level_cost_mult)))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.hacknet_node_ram_cost_mult))return a;for(let n=a-1;n>=0;--n)if(t.money>e.calculateRamUpgradeCost(n,t.hacknet_node_ram_cost_mult))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.hacknet_node_core_cost_mult))return i;for(;a<=r;){const o=(a+r)/2|0;if(o!=n&&t.money>e.calculateCoreUpgradeCost(o,t.hacknet_node_core_cost_mult)&&t.moneye.calculateCoreUpgradeCost(o,t.hacknet_node_core_cost_mult)))return Math.min(i,o);a=o+1}}return 0}function _(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 w(t,e,n=1){const a=Math.round(n),r=e.calculateLevelUpgradeCost(a,t.hacknet_node_level_cost_mult);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 w(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.hacknet_node_money_mult),!0)}function S(t,e,n=1){const r=Math.round(n),i=e.calculateRamUpgradeCost(r,t.hacknet_node_ram_cost_mult);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 S(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 S(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.hacknet_node_money_mult),!0)}function x(t,e,n=1){const a=Math.round(n),r=e.calculateCoreUpgradeCost(a,t.hacknet_node_core_cost_mult);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 x(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.hacknet_node_money_mult),!0)}function C(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 C(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=Math.floor(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.DividendMaxPercentage)throw new Error("Invalid value. Must be an integer between 0 and "+_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.DividendMaxPercentage);t.dividendPercentage=100*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.moneye+_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_10__.a[e];if(t.sciResearch.qty{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 u}));var a=n(0),r=n.n(a),i=n(50),o=n(30),s=n(1),l=n(5),c=n(22),f=n(301);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.f)(u.level,0)} (${l.a.formatExp(u.exp)} exp)`:void 0!==u.level&&void 0===u.exp&&(m=""+Object(c.f)(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";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(30),o=n(148),s=n(121);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";n.d(e,"a",(function(){return a}));const a={}},,,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(4),r=n(28);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";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(".ns")||t.endsWith(".js")||(t+=".js"),e.endsWith(".ns")||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 a}));const a=new(n(948).a)},,function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var a=n(275),r=n(10),i=n(34);const o={Shoplift:new a.a("Shoplift",i.b.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",i.b.RobStore,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",i.b.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",i.b.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",i.b.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",i.b.BondForgery,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",i.b.TraffickArms,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",i.b.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",i.b.GrandTheftAuto,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",i.b.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",i.b.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",i.b.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,"b",(function(){return Ct})),n.d(e,"a",(function(){return Lt}));var a=n(0),r=n.n(a),i=n(119),o=n(109),s=n(348),l=n(9),c=n(186),f=n(44),u=n(1065),m=n(378),h=n(459),d=n(14),p=n(24),g=n(26),y=n(245),b=n(103),E=n(121),v=n(144),k=n(19),_=n(1),w=n(25),S=n(1084),x=n(1088),C=n(1110),L=n(1115),O=n(1144),M=n(1171),T=n(1192),A=n(1229),R=n(1242),N=n(1243),P=n(1244),I=n(1286),F=n(1295),D=n(1304),j=n(1329),B=n(411),G=n(638),W=n(1342),H=n(1343),U=n(1348),q=n(1349),$=n(412),K=n(1360),z=n(1371),V=n(637),Y=n(1372),J=n(1381),X=n(1384),Q=n(101),Z=n(301),tt=n(1391),et=n(200),nt=n(1392),at=n(94),rt=n(178),it=n(339),ot=n(407),st=n(594),lt=n(300),ct=n(416),ft=n(29),ut=n(417),mt=n(1394),ht=n(1397),dt=n(6),pt=n(1398),gt=n(1403),yt=n(1408),bt=n(1409),Et=n.n(bt),vt=n(1410),kt=n.n(vt),_t=n(462);const wt=location,St=Object(E.a)(t=>Object(v.a)({root:{"-ms-overflow-style":"none","scrollbar-width":"none",margin:t.spacing(0),flexGrow:1,display:"block",padding:"8px",minHeight:"100vh",boxSizing:"border-box"}})),xt=()=>{throw new Error("Router called before initialization")};let Ct={isInitialized:!1,page:xt,allowRouting:xt,toActiveScripts:xt,toAugmentations:xt,toBitVerse:xt,toBladeburner:xt,toStats:xt,toCity:xt,toCorporation:xt,toCreateProgram:xt,toDevMenu:xt,toFaction:xt,toFactions:xt,toGameOptions:xt,toGang:xt,toHacknetNodes:xt,toInfiltration:xt,toJob:xt,toMilestones:xt,toGrafting:xt,toScriptEditor:xt,toSleeves:xt,toStockMarket:xt,toTerminal:xt,toTravel:xt,toTutorial:xt,toWork:xt,toBladeburnerCinematic:xt,toLocation:xt,toStaneksGift:xt,toAchievements:xt,toThemeBrowser:xt,toImportSave:xt};function Lt({player:t,engine:e,terminal:n}){const E=St(),[{files:v,vim:bt},vt]=Object(a.useState)({files:{},vim:!1}),[xt,Lt]=Object(a.useState)(function(t){return ut.b?w.a.Recovery:t.isWorking?w.a.Work:w.a.Terminal}(t)),Ot=Object(a.useState)(0)[1],[Mt,Tt]=Object(a.useState)(!1),[At,Rt]=Object(a.useState)(t.currentWorkFactionName?g.a[t.currentWorkFactionName]:void 0);if(void 0===At&&xt===w.a.Faction)throw new Error("Trying to go to a page without the proper setup");const[Nt,Pt]=Object(a.useState)(!1),[It,Ft]=Object(a.useState)(!1),[Dt,jt]=Object(a.useState)(void 0);if(void 0===Dt&&(xt===w.a.Infiltration||xt===w.a.Location||xt===w.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)(dt.a.IsSidebarOpened),[$t,Kt]=Object(a.useState)(void 0),[zt,Vt]=Object(a.useState)(!1);if(void 0===$t&&xt===w.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(p.c)())t.runningScripts=[];o.c.saveGame(),setTimeout(()=>wt.reload(),2e3)}function Zt(){Object(d.a)("Soft Reset!"),Object(i.f)(!0),Ht(Wt+1),Ct.toTerminal()}Object(a.useEffect)(()=>m.a.subscribe(Xt),[]),Ct={isInitialized:!0,page:()=>xt,allowRouting:t=>Jt(t),toActiveScripts:()=>Lt(w.a.ActiveScripts),toAugmentations:()=>Lt(w.a.Augmentations),toBladeburner:()=>Lt(w.a.Bladeburner),toStats:()=>Lt(w.a.Stats),toCorporation:()=>Lt(w.a.Corporation),toCreateProgram:()=>Lt(w.a.CreateProgram),toDevMenu:()=>Lt(w.a.DevMenu),toFaction:(t,e=!1)=>{Tt(e),Lt(w.a.Faction),t&&Rt(t)},toFactions:()=>Lt(w.a.Factions),toGameOptions:()=>Lt(w.a.Options),toGang:()=>Lt(w.a.Gang),toHacknetNodes:()=>Lt(w.a.Hacknet),toMilestones:()=>Lt(w.a.Milestones),toGrafting:()=>Lt(w.a.Grafting),toScriptEditor:(t,e)=>{vt({files:t,vim:!(null==e||!e.vim)}),Lt(w.a.ScriptEditor)},toSleeves:()=>Lt(w.a.Sleeves),toStockMarket:()=>Lt(w.a.StockMarket),toTerminal:()=>Lt(w.a.Terminal),toTutorial:()=>Lt(w.a.Tutorial),toJob:()=>{jt(c.a[t.companyName]),Lt(w.a.Job)},toCity:()=>{Lt(w.a.City)},toTravel:()=>{t.gotoLocation(l.a.TravelAgency),Lt(w.a.Travel)},toBitVerse:(t,e)=>{Pt(t),Ft(e),Object(lt.b)(),Lt(w.a.BitVerse)},toInfiltration:t=>{jt(t),Lt(w.a.Infiltration)},toWork:()=>Lt(w.a.Work),toBladeburnerCinematic:()=>{Lt(w.a.BladeburnerCinematic),Gt(Bt)},toLocation:t=>{jt(t),Lt(w.a.Location)},toStaneksGift:()=>{Lt(w.a.StaneksGift)},toAchievements:()=>{Lt(w.a.Achievements)},toThemeBrowser:()=>{Lt(w.a.ThemeBrowser)},toImportSave:(t,e=!1)=>{Kt(t),Vt(e),Lt(w.a.ImportSave)}},Object(a.useEffect)(()=>{kt()(Ct).filter(t=>t.startsWith("to")).forEach(t=>{Ct[t]=Et()(Ct[t],(e,...n)=>{if(Yt)return e(...n);console.log(`Routing is currently disabled - Attempted router.${t}()`)})})}),Object(a.useEffect)(()=>{xt!==w.a.Terminal&&window.scrollTo(0,0)});let te=r.a.createElement(_.a,null,"Cannot load"),ee=!0,ne=!0,ae=!1;switch(xt){case w.a.Recovery:te=r.a.createElement(ut.c,{router:Ct,softReset:Zt}),ee=!1,ne=!1,ae=!0;break;case w.a.BitVerse:te=r.a.createElement(J.a,{flume:Nt,enter:ct.a,quick:It}),ee=!1,ne=!1;break;case w.a.Infiltration:te=r.a.createElement(A.a,{location:Dt}),ee=!1,ne=!1;break;case w.a.BladeburnerCinematic:te=r.a.createElement(tt.a,null),ee=!1,ne=!1;break;case w.a.Work:te=r.a.createElement(N.a,null),ee=!1;break;case w.a.Terminal:te=r.a.createElement(H.a,{terminal:n,router:Ct,player:t});break;case w.a.Sleeves:te=r.a.createElement(I.a,null);break;case w.a.StaneksGift:te=r.a.createElement(X.a,{staneksGift:Q.c});break;case w.a.Stats:te=r.a.createElement(z.a,null);break;case w.a.ScriptEditor:te=r.a.createElement(G.a,{files:v,hostname:t.getCurrentServer().hostname,player:t,router:Ct,vim:bt});break;case w.a.ActiveScripts:te=r.a.createElement(q.a,{workerScripts:et.a});break;case w.a.Hacknet:te=r.a.createElement(F.a,{player:t});break;case w.a.CreateProgram:te=r.a.createElement(B.a,null);break;case w.a.Factions:te=r.a.createElement($.a,{player:t,router:Ct});break;case w.a.Faction:te=r.a.createElement(K.a,{faction:At,augPage:Mt});break;case w.a.Milestones:te=r.a.createElement(W.a,{player:t});break;case w.a.Tutorial:te=r.a.createElement(U.a,{reactivateTutorial:()=>{Object(h.a)(),Ct.toTerminal(),Object(f.e)()}});break;case w.a.DevMenu:te=r.a.createElement(L.a,{player:t,engine:e,router:Ct});break;case w.a.Gang:te=r.a.createElement(M.a,null);break;case w.a.Corporation:te=r.a.createElement(T.a,null);break;case w.a.Bladeburner:te=r.a.createElement(O.a,null);break;case w.a.Grafting:te=r.a.createElement(R.a,null);break;case w.a.Travel:te=r.a.createElement(V.a,{p:t,router:Ct});break;case w.a.StockMarket:te=r.a.createElement(Y.a,{buyStockLong:y.a,buyStockShort:y.d,cancelOrder:b.c,eventEmitterForReset:b.e,initStockMarket:b.g,p:t,placeOrder:b.j,sellStockLong:y.c,sellStockShort:y.b,stockMarket:b.a});break;case w.a.City:te=r.a.createElement(j.a,null);break;case w.a.Job:case w.a.Location:te=r.a.createElement(D.a,{loc:Dt});break;case w.a.Options:te=r.a.createElement(P.a,{player:t,router:Ct,save:()=>o.c.saveGame(),export:()=>{Object(s.c)(t),o.c.exportGame()},forceKill:Qt,softReset:Zt});break;case w.a.Augmentations:te=r.a.createElement(C.a,{exportGameFn:()=>{Object(s.c)(t),o.c.exportGame()},installAugmentationsFn:()=>{Object(i.f)()}});break;case w.a.Achievements:te=r.a.createElement(mt.a,null);break;case w.a.ThemeBrowser:te=r.a.createElement(pt.a,{router:Ct});break;case w.a.ImportSave:te=r.a.createElement(gt.a,{importString:$t,automatic:zt,router:Ct}),ee=!1,ne=!1,ae=!0}return r.a.createElement(ft.a.Player.Provider,{value:t},r.a.createElement(ft.a.Router.Provider,{value:Ct},r.a.createElement(ht.a,{key:Wt,router:Ct,softReset:Zt},r.a.createElement(yt.a,{content:ae?te:null},r.a.createElement(at.c,null,r.a.createElement(S.a,{mode:f.a.isRunning?"tutorial":"overview"},f.a.isRunning?r.a.createElement(u.a,null):r.a.createElement(Z.a,{save:()=>o.c.saveGame(),killScripts:Qt})),ee?r.a.createElement(k.a,{display:"flex",flexDirection:"row",width:"100%"},r.a.createElement(x.a,{player:t,router:Ct,page:xt,opened:Ut,onToggled:t=>{qt(t),dt.a.IsSidebarOpened=t}}),r.a.createElement(k.a,{className:E.root},te)):r.a.createElement(k.a,{className:E.root},te),r.a.createElement(nt.a,null),ne&&r.a.createElement(r.a.Fragment,null,r.a.createElement(rt.d,null),r.a.createElement(it.b,null),r.a.createElement(ot.b,null),r.a.createElement(st.b,null),r.a.createElement(at.a,null)),r.a.createElement(_t.a,null))))))}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(10),r=n(577),i=n(41),o=n(156),s=n(340),l=n(28);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;e({snackbar:{zIndex:f.e+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 i}));var a=n(1306),r=n(368);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";n.d(e,"a",(function(){return r}));var a=n(9);const r={};r[a.a.AevumECorp]="ECP",r[a.a.Sector12MegaCorp]="MGCP",r[a.a.Sector12BladeIndustries]="BLD",r[a.a.AevumClarkeIncorporated]="CLRK",r[a.a.VolhavenOmniTekIncorporated]="OMTK",r[a.a.Sector12FourSigma]="FSIG",r[a.a.ChongqingKuaiGongInternational]="KGI",r[a.a.AevumFulcrumTechnologies]="FLCM",r[a.a.IshimaStormTechnologies]="STM",r[a.a.NewTokyoDefComm]="DCOMM",r[a.a.VolhavenHeliosLabs]="HLS",r[a.a.NewTokyoVitaLife]="VITA",r[a.a.Sector12IcarusMicrosystems]="ICRS",r[a.a.Sector12UniversalEnergy]="UNV",r[a.a.AevumAeroCorp]="AERO",r[a.a.VolhavenOmniaCybersystems]="OMN",r[a.a.ChongqingSolarisSpaceSystems]="SLRS",r[a.a.NewTokyoGlobalPharmaceuticals]="GPH",r[a.a.IshimaNovaMedical]="NVMD",r[a.a.AevumWatchdogSecurity]="WDS",r[a.a.VolhavenLexoCorp]="LXO",r[a.a.AevumRhoConstruction]="RHOC",r[a.a.Sector12AlphaEnterprises]="APHE",r[a.a.VolhavenSysCoreSecurities]="SYSC",r[a.a.VolhavenCompuTek]="CTK",r[a.a.AevumNetLinkTechnologies]="NTLK",r[a.a.IshimaOmegaSoftware]="OMGA",r[a.a.Sector12FoodNStuff]="FNS",r[a.a.Sector12JoesGuns]="JGN",r["Sigma Cosmetics"]="SGC",r["Catalyst Ventures"]="CTYS",r["Microdyne Technologies"]="MDYN",r["Titan Laboratories"]="TITN"},function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return r}));const a=[".js",".script",".ns"];function r(t){return a.some(e=>t.endsWith(e))}},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(28),r=n(770);let i=new r.a;function o(t){i=t?JSON.parse(t,a.c):new r.a}function s(t){const e=[];for(let n=0;n1?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.hacking_exp_mult*a.a.HackExpGain}function s(t,e){const n=(100-t.hackDifficulty)/100*((e.hacking-(t.requiredHackingSkill-1))/e.hacking)*e.hacking_money_mult*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.hacking+50;return 5*n/(e.hacking_speed_mult*Object(r.a)(e.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,"a",(function(){return g})),n.d(e,"b",(function(){return y})),n.d(e,"j",(function(){return b})),n.d(e,"c",(function(){return E})),n.d(e,"i",(function(){return v})),n.d(e,"d",(function(){return k})),n.d(e,"f",(function(){return _})),n.d(e,"h",(function(){return w})),n.d(e,"k",(function(){return x})),n.d(e,"g",(function(){return C})),n.d(e,"e",(function(){return L}));var a=n(769),r=n(331),i=n(153),o=n(664),s=n(1030),l=n(117),c=n(75),f=n(99),u=n(10),m=n(125),h=n(5),d=n(14),p=n(28);let g={lastUpdate:0,Orders:{},storedCycles:0,ticksUntilCycle:0};const y={};function b(t,e,n,o,s,l=null){if(!(t instanceof i.a))return l?l.log("stock.placeOrder",()=>`Invalid stock: '${t}'`):Object(d.a)("ERROR: Invalid stock passed to placeOrder() function"),!1;if("number"!=typeof e||"number"!=typeof n)return l?l.log("stock.placeOrder",()=>`Invalid arguments: shares='${e}' price='${n}'`):Object(d.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=null){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=e.cap&&(o=.1,e.b=!1),isNaN(o)&&(o=.5);const s=Math.random(),f={stockMarket:g,symbolToStockMap:y};st);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 E(t,e,n=!1){const a=b(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 v(t){for(const e of Object.keys(l.a)){if(e===c.a.currentWorkFactionName)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),i=Object(u.b)(c.a,n),s=Object(u.a)(c.a,n),f=Math.max(r*a,i*a,s*a,1/120);n.playerReputation+=f*t*c.a.faction_rep_mult*o.a.FactionPassiveRepGain}}const k=(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";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 I})),n.d(e,"b",(function(){return A})),n.d(e,"a",(function(){return P}));var a=n(160),r=n(67),i=n(10),o=n(26),s=n(82),l=n(2),c=n(24),f=n(6),u=n(103),m=n(101),h=n(94),d=n(348),p=n(14),g=n(28),y=n(342),b=n(1062),E=n(12),v=n(341),k=n(9),_=n(593),w=n(298),S=n(123),x=n(4),C=n(185),L=n(137),O=n(88);function M(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(){M(this,"PlayerSave",""),M(this,"AllServersSave",""),M(this,"CompaniesSave",""),M(this,"FactionsSave",""),M(this,"AliasesSave",""),M(this,"GlobalAliasesSave",""),M(this,"StockMarketSave",""),M(this,"SettingsSave",""),M(this,"VersionSave",""),M(this,"AllGangsSave",""),M(this,"LastExportBonus",""),M(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(w.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);P(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.log(t)}if(!u||"BitburnerSaveObject"!==u.ctor||!u.data)return Promise.reject(new Error("Save game did not seem valid"));const m={base64:t,parsed:u},h=_.a.fromJSON(JSON.parse(u.data.PlayerSave)),d={identifier:h.identifier,lastSave:h.lastSave,totalPlaytime:h.totalPlaytime,money:h.money,hacking:h.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 A(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.i)(e.StockMarketSave)}catch(t){Object(u.i)("")}else Object(u.i)("");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;nt.name===E.a.NeuroFluxGovernor);if(t)t.level+=10;else{const t=new v.a(E.a.NeuroFluxGovernor);t.level=10,l.a.augmentations.push(t)}l.a.reapplyAllAugmentations(!0),l.a.reapplyAllSourceFiles()}if(t<3&&(e.money=parseFloat(e.money),e.corporation)){e.corporation.funds=parseFloat(e.corporation.funds),e.corporation.revenue=parseFloat(e.corporation.revenue),e.corporation.expenses=parseFloat(e.corporation.expenses);for(let t=0;t0)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={...S.a}),t<16){o.a[x.a.ShadowsOfAnarchy]=new C.a(x.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")}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],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)}}}}(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,R):t!==i.a.VersionNumber&&N()}catch(t){N()}else N();return!0}const R={"& h1, & h2, & h3, & h4, & p, & a, & ul":{margin:0,color:f.a.theme.primary,whiteSpace:"initial"},"& ul":{paddingLeft:"1.5em",lineHeight:1.5}};function N(){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,R),1e3)}function P(t,e){const n=new Blob([e],{type:"text/plain"}),a=window.navigator;if(a.msSaveOrOpenBlob)a.msSaveOrOpenBlob(n,t);else{const e=document.createElement("a"),a=URL.createObjectURL(n);e.href=a,e.download=t,document.body.appendChild(e),e.click(),setTimeout((function(){document.body.removeChild(e),window.URL.revokeObjectURL(a)}),0)}}g.c.constructors.BitburnerSaveObject=T;const I=new T},function(t,e,n){"use strict";n.d(e,"c",(function(){return o})),n.d(e,"b",(function(){return s})),n.d(e,"d",(function(){return l})),n.d(e,"a",(function(){return c}));var a=n(146),r=n(24),i=n(180);function o(t,e){return e.delayReject&&e.delayReject(),new Promise((function(n,a){e.delay=window.setTimeout(()=>{e.delay=null,e.delayReject=void 0,e.env.stopFlag?a(new i.a(e)):n()},t),e.delayReject=a}))}function s(t,e){const n=Object(r.d)(t.hostname);if(null==n)throw new Error("WorkerScript constructed with invalid server ip: "+t.hostname);for(const n of t.scriptRef.dependencies){var a,i;e=null!==(a=null===(i=e)||void 0===i?void 0:i.replace(new RegExp(n.url,"g"),n.filename))&&void 0!==a?a:e}return"|DELIMITER|"+n.hostname+"|DELIMITER|"+t.name+"|DELIMITER|"+e}function l(t,e){const n=t.workerScript.scriptRef.threads;if(!e)return isNaN(n)||n<1?1:n;const a=0|e;if(isNaN(e)||a<1)throw s(t.workerScript,`Invalid thread count passed to ${t.function}: ${e}. Threads must be a positive number.`);if(a>n)throw s(t.workerScript,`Too many threads requested by ${t.function}. Requested: ${e}. Has: ${n}.`);return a}function c(t){if(!Object(a.a)(t))return!1;return 4==t.split("|DELIMITER|").length}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(0),r=n.n(a),i=n(5),o=n(20);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(968),r=n(28),i=n(578);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 y})),n.d(e,"d",(function(){return b})),n.d(e,"g",(function(){return w})),n.d(e,"f",(function(){return k})),n.d(e,"e",(function(){return g})),n.d(e,"a",(function(){return v})),n.d(e,"b",(function(){return _}));var a=n(35),r=n(79),i=n(341),o=n(12),s=n(10),l=n(26),c=n(2),f=n(459),u=n(14),m=n(1414),h=n(4),d=n(352),p=n(90);function g(){!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(E),c.a.reapplyAllAugmentations()}function y(){return s.a.MultipleAugMultiplier*[1,.96,.94,.93][c.a.sourceFileLvl(11)]}function b(){return Math.pow(y(),c.a.queuedAugmentations.length)}function E(t){t.addToFactions(t.factions);const e=t.name;_(e)&&delete r.a[e],function(t){const e=t.name;r.a[e]=t}(t)}function v(t,e=!1){const n=r.a[t.name];for(const t of Object.keys(n.mults)){const e=c.a.getMult(t)*n.mults[t];c.a.setMult(t,e)}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 k(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 _(t){return r.a.hasOwnProperty(t)}function w(t){return(t instanceof a.a?t.name:t)===o.a.NeuroFluxGovernor}},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(61),r=n(214);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 l}));var a=n(0),r=n(5),i=n(121),o=n(144);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 g}));var a=n(0),r=n.n(a),i=n(611),o=n.n(i),s=n(1119),l=n.n(s),c=n(111),f=n(1120),u=n.n(f),m=n(608),h=n.n(m),d=n(76),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(27);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 s})),n.d(e,"b",(function(){return l}));var a=n(285),r=n(661);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(46),i=n(597),o=n(18),s=n(10),l=n(65),c=n(64),f=n(768);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.hacking_grow_mult*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.hacking_grow_mult*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 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 i}));var a=n(351),r=n(28);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";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 h}));var a=n(180),r=n(421),i=n(200),o=n(297),s=n(369),l=n(24),c=n(321),f=n(14),u=n(461),m=n(2);function h(t,e,n){if(null!=n&&"boolean"==typeof n||(n=!0),t instanceof r.a)return p(t),!0;if(t instanceof s.a&&"string"==typeof e){const a=d(t.pid,n);if(a)return a;for(const a of i.a.values())if(a.name==t.filename&&a.hostname==e&&Object(c.a)(a.args,t.args))return p(a,n),!0;return!1}return"number"==typeof t?d(t,n):(console.error("killWorkerScript() called with invalid argument:"),console.error(t),!1)}function d(t,e=!0){const n=i.a.get(t);return n instanceof r.a&&(p(n,e),!0)}function p(t,e=!0){if("function"==typeof t.atExit){try{t.atExit()}catch(e){Object(f.a)(`Error trying to call atExit for script ${t.name} on ${t.hostname} ${t.scriptRef.args} ${e}`)}t.atExit=void 0}t.env.stopFlag=!0,function(t){t instanceof r.a&&t.delay&&(clearTimeout(t.delay),t.delayReject&&t.delayReject(new a.a(t)))}(t),function(t,e=!0){const n=t.hostname,a=t.name,r=Object(l.d)(n);if(null==r)return void console.error("Could not find server on which this script is running: "+n);for(let e=0;eObject(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";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 c}));var a=n(333),r=n(277),i=n(21),o=n(1),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(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))})}},,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return c})),n.d(e,"b",(function(){return f})),n.d(e,"c",(function(){return u})),n.d(e,"d",(function(){return m}));var a=n(0),r=n.n(a),i=n(18),o=n(4),s=n(15);class l{constructor(t,e,n,a="",i=r.a.createElement(r.a.Fragment,null)){this.number=t,this.difficulty=e,this.name=n,this.desc=a,this.info=i}}const c={};c.BitNode1=new l(1,0,"Source Genesis","The original BitNode",r.a.createElement(r.a.Fragment,null,"The first BitNode created by the Enders to imprison the minds of humans. It became the prototype and testing-grounds for all of the BitNodes that followed.",r.a.createElement("br",null),r.a.createElement("br",null),"This is the first BitNode that you play through. It has no special modifications or mechanics.",r.a.createElement("br",null),r.a.createElement("br",null),"Destroying this BitNode will give you Source-File 1, or if you already have this Source-File it will upgrade its level up to a maximum of 3. This Source-File lets the player start with 32GB of RAM on his/her home computer when entering a new BitNode, and also increases all of the player's multipliers by:",r.a.createElement("br",null),r.a.createElement("br",null),"Level 1: 16%",r.a.createElement("br",null),"Level 2: 24%",r.a.createElement("br",null),"Level 3: 28%")),c.BitNode2=new l(2,0,"Rise of the Underworld","From the shadows, they rose",r.a.createElement(r.a.Fragment,null,"From the shadows, they rose.",r.a.createElement("br",null),r.a.createElement("br",null),"Organized crime groups quickly filled the void of power left behind from the collapse of Western government in the 2050s. As society and civilization broke down, people quickly succumbed to the innate human impulse of evil and savagery. The organized crime factions quickly rose to the top of the modern world.",r.a.createElement("br",null),r.a.createElement("br",null),"Certain Factions (",o.a.SlumSnakes,", ",o.a.Tetrads,", ",o.a.TheSyndicate,","," ",o.a.TheDarkArmy,", ",o.a.SpeakersForTheDead,", ",o.a.NiteSec,", ",o.a.TheBlackHand,") give the player the ability to form and manage their own gangs. These gangs will earn the player money and reputation with the corresponding Faction",r.a.createElement("br",null),"Every Augmentation in the game will be available through the Factions listed above",r.a.createElement("br",null),r.a.createElement("br",null),"Destroying this BitNode will give you Source-File 2, or if you already have this Source-File it will upgrade its level up to a maximum of 3. This Source-File allows you to form gangs in other BitNodes once your karma decreases to a certain value. It also increases the player's crime success rate, crime money, and charisma multipliers by:",r.a.createElement("br",null),r.a.createElement("br",null),"Level 1: 24%",r.a.createElement("br",null),"Level 2: 36%",r.a.createElement("br",null),"Level 3: 42%")),c.BitNode3=new l(3,0,"Corporatocracy","The Price of Civilization",r.a.createElement(r.a.Fragment,null,"Our greatest illusion is that a healthy society can revolve around a single-minded pursuit of wealth.",r.a.createElement("br",null),r.a.createElement("br",null),"Sometime in the early 21st century economic and political globalization turned the world into a corporatocracy, and it never looked back. Now, the privileged elite will happily bankrupt their own countrymen, decimate their own community, and evict their neighbors from houses in their desperate bid to increase their wealth.",r.a.createElement("br",null),r.a.createElement("br",null),"In this BitNode you can create and manage your own corporation. Running a successful corporation has the potential of generating massive profits.",r.a.createElement("br",null),r.a.createElement("br",null),"Destroying this BitNode will give you Source-File 3, or if you already have this Source-File it will upgrade its level up to a maximum of 3. This Source-File lets you create corporations on other BitNodes (although some BitNodes will disable this mechanic). This Source-File also increases your charisma and company salary multipliers by:",r.a.createElement("br",null),"Level 1: 8%",r.a.createElement("br",null),"Level 2: 12%",r.a.createElement("br",null),"Level 3: 14%")),c.BitNode4=new l(4,1,"The Singularity","The Man and the Machine",r.a.createElement(r.a.Fragment,null,"The Singularity has arrived. The human race is gone, replaced by artificially superintelligent beings that are more machine than man. ",r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement("br",null),"In this BitNode you will gain access to a new set of Netscript Functions known as Singularity Functions. These functions allow you to control most aspects of the game through scripts, including working for factions/companies, purchasing/installing Augmentations, and creating programs.",r.a.createElement("br",null),r.a.createElement("br",null),"Destroying this BitNode will give you Source-File 4, or if you already have this Source-File it will upgrade its level up to a maximum of 3. This Source-File lets you access and use the Singularity Functions in other BitNodes. Each level of this Source-File reduces the RAM cost of singularity functions.")),c.BitNode5=new l(5,1,"Artificial Intelligence","Posthuman",r.a.createElement(r.a.Fragment,null,"They said it couldn't be done. They said the human brain, along with its consciousness and intelligence, couldn't be replicated. They said the complexity of the brain results from unpredictable, nonlinear interactions that couldn't be modeled by 1's and 0's. They were wrong.",r.a.createElement("br",null),r.a.createElement("br",null),"Destroying this BitNode will give you Source-File 5, or if you already have this Source-File it will upgrade its level up to a maximum of 3. This Source-File grants you a special new stat called Intelligence. Intelligence is unique because it is permanent and persistent (it never gets reset back to 1). However gaining Intelligence experience is much slower than other stats. Higher Intelligence levels will boost your production for many actions in the game. ",r.a.createElement("br",null),r.a.createElement("br",null),"In addition, this Source-File will unlock the getBitNodeMultipliers() Netscript function and let you start with Formulas.exe, and will also raise all of your hacking-related multipliers by:",r.a.createElement("br",null),r.a.createElement("br",null),"Level 1: 8%",r.a.createElement("br",null),"Level 2: 12%",r.a.createElement("br",null),"Level 3: 14%")),c.BitNode6=new l(6,1,o.a.Bladeburners,"Like Tears in Rain",r.a.createElement(r.a.Fragment,null,"In the middle of the 21st century, ",o.a.OmniTekIncorporated," began designing and manufacturing advanced synthetic androids, or Synthoids for short. They achieved a major technological breakthrough in the sixth generation of their Synthoid design, called MK-VI, by developing a hyperintelligent AI. Many argue that this was the first sentient AI ever created. This resulted in Synthoid models that were stronger, faster, and more intelligent than the humans that had created them.",r.a.createElement("br",null),r.a.createElement("br",null),"In this BitNode you will be able to access the ",o.a.Bladeburners," Division at the NSA, which provides a new mechanic for progression.",r.a.createElement("br",null),r.a.createElement("br",null),"Destroying this BitNode will give you Source-File 6, or if you already have this Source-File it will upgrade its level up to a maximum of 3. This Source-File allows you to access the NSA's ",o.a.Bladeburners," Division in other BitNodes. In addition, this Source-File will raise both the level and experience gain rate of all your combat stats by:",r.a.createElement("br",null),r.a.createElement("br",null),"Level 1: 8%",r.a.createElement("br",null),"Level 2: 12%",r.a.createElement("br",null),"Level 3: 14%")),c.BitNode7=new l(7,2,o.a.Bladeburners+" 2079","More human than humans",r.a.createElement(r.a.Fragment,null,"In the middle of the 21st century, you were doing cutting-edge work at ",o.a.OmniTekIncorporated," as part of the AI design team for advanced synthetic androids, or Synthoids for short. You helped achieve a major technological breakthrough in the sixth generation of the company's Synthoid design, called MK-VI, by developing a hyperintelligent AI. Many argue that this was the first sentient AI ever created. This resulted in Synthoid models that were stronger, faster, and more intelligent than the humans that had created them.",r.a.createElement("br",null),r.a.createElement("br",null),"In this BitNode you will be able to access the ",o.a.Bladeburners," API, which allows you to access"," ",o.a.Bladeburners,"functionality through Netscript.",r.a.createElement("br",null),r.a.createElement("br",null),"Destroying this BitNode will give you Source-File 7, or if you already have this Source-File it will upgrade its level up to a maximum of 3. This Source-File allows you to access the ",o.a.Bladeburners," Netscript API in other BitNodes. In addition, this Source-File will increase all of your ",o.a.Bladeburners," multipliers by:",r.a.createElement("br",null),r.a.createElement("br",null),"Level 1: 8%",r.a.createElement("br",null),"Level 2: 12%",r.a.createElement("br",null),"Level 3: 14%")),c.BitNode8=new l(8,2,"Ghost of Wall Street","Money never sleeps",r.a.createElement(r.a.Fragment,null,"You are trying to make a name for yourself as an up-and-coming hedge fund manager on Wall Street.",r.a.createElement("br",null),r.a.createElement("br",null),"In this BitNode:",r.a.createElement("br",null),r.a.createElement("br",null),"You start with $250 million",r.a.createElement("br",null),"You start with a WSE membership and access to the TIX API",r.a.createElement("br",null),"You are able to short stocks and place different types of orders (limit/stop)",r.a.createElement("br",null),r.a.createElement("br",null),"Destroying this BitNode will give you Source-File 8, or if you already have this Source-File it will upgrade its level up to a maximum of 3. This Source-File grants the following benefits:",r.a.createElement("br",null),r.a.createElement("br",null),"Level 1: Permanent access to WSE and TIX API",r.a.createElement("br",null),"Level 2: Ability to short stocks in other BitNodes",r.a.createElement("br",null),"Level 3: Ability to use limit/stop orders in other BitNodes",r.a.createElement("br",null),r.a.createElement("br",null),"This Source-File also increases your hacking growth multipliers by:",r.a.createElement("br",null),"Level 1: 12%",r.a.createElement("br",null),"Level 2: 18%",r.a.createElement("br",null),"Level 3: 21%")),c.BitNode9=new l(9,2,"Hacktocracy","Hacknet Unleashed",r.a.createElement(r.a.Fragment,null,"When ",o.a.FulcrumSecretTechnologies," released their open-source Linux distro Chapeau, it quickly became the OS of choice for the underground hacking community. Chapeau became especially notorious for powering the Hacknet, a global, decentralized network used for nefarious purposes. ",o.a.FulcrumSecretTechnologies," ","quickly abandoned the project and dissociated themselves from it.",r.a.createElement("br",null),r.a.createElement("br",null),"This BitNode unlocks the Hacknet Server, an upgraded version of the Hacknet Node. Hacknet Servers generate hashes, which can be spent on a variety of different upgrades.",r.a.createElement("br",null),r.a.createElement("br",null),"Destroying this BitNode will give you Source-File 9, or if you already have this Source-File it will upgrade its level up to a maximum of 3. This Source-File grants the following benefits:",r.a.createElement("br",null),r.a.createElement("br",null),"Level 1: Permanently unlocks the Hacknet Server in other BitNodes",r.a.createElement("br",null),"Level 2: You start with 128GB of RAM on your home computer when entering a new BitNode",r.a.createElement("br",null),"Level 3: Grants a highly-upgraded Hacknet Server when entering a new BitNode",r.a.createElement("br",null),r.a.createElement("br",null),"(Note that the Level 3 effect of this Source-File only applies when entering a new BitNode, NOT when installing Augmentations)",r.a.createElement("br",null),r.a.createElement("br",null),"This Source-File also increases your hacknet multipliers by:",r.a.createElement("br",null),"Level 1: 8%",r.a.createElement("br",null),"Level 2: 12%",r.a.createElement("br",null),"Level 3: 14%")),c.BitNode10=new l(10,2,"Digital Carbon","Your body is not who you are",r.a.createElement(r.a.Fragment,null,"In 2084, VitaLife unveiled to the world the Persona Core, a technology that allowed people to digitize their consciousness. Their consciousness could then be transferred into Synthoids or other bodies by trasmitting the digitized data. Human bodies became nothing more than 'sleeves' for the human consciousness. Mankind had finally achieved immortality - at least for those that could afford it.",r.a.createElement("br",null),r.a.createElement("br",null),"This BitNode unlocks Sleeve technology. Sleeve technology allows you to:",r.a.createElement("br",null),r.a.createElement("br",null),"1. Grafting: Visit VitaLife in New Tokyo to be able to obtain Augmentations without needing to install",r.a.createElement("br",null),"2. Duplicate Sleeves: Duplicate your consciousness into Synthoids, allowing you to perform different tasks synchronously.",r.a.createElement("br",null),r.a.createElement("br",null),"Destroying this BitNode will give you Source-File 10, or if you already have this Source-File it will upgrade its level up to a maximum of 3. This Source-File unlocks Sleeve technology in other BitNodes. Each level of this Source-File also grants you a Duplicate Sleeve")),c.BitNode11=new l(11,1,"The Big Crash","Okay. Sell it all.",r.a.createElement(r.a.Fragment,null,"The 2050s was defined by the massive amounts of violent civil unrest and anarchic rebellion that rose all around the world. It was this period of disorder that eventually lead to the governmental reformation of many global superpowers, most notably the USA and China. But just as the world was slowly beginning to recover from these dark times, financial catastrophe hit.",r.a.createElement("br",null),r.a.createElement("br",null),"In many countries, the high cost of trying to deal with the civil disorder bankrupted the governments. In all of this chaos and confusion, hackers were able to steal billions of dollars from the world's largest electronic banks, prompting an international banking crisis as governments were unable to bail out insolvent banks. Now, the world is slowly crumbling in the middle of the biggest economic crisis of all time.",r.a.createElement("br",null),r.a.createElement("br",null),"Destroying this BitNode will give you Source-File 11, or if you already have this Source-File it will upgrade its level up to a maximum of 3. This Source-File makes it so that company favor increases BOTH the player's salary and reputation gain rate at that company by 1% per favor (rather than just the reputation gain). This Source-File also increases the player's company salary and reputation gain multipliers by:",r.a.createElement("br",null),r.a.createElement("br",null),"Level 1: 32%",r.a.createElement("br",null),"Level 2: 48%",r.a.createElement("br",null),"Level 3: 56%",r.a.createElement("br",null),r.a.createElement("br",null),"It also reduces the price increase for every aug bought by:",r.a.createElement("br",null),r.a.createElement("br",null),"Level 1: 4%",r.a.createElement("br",null),"Level 2: 6%",r.a.createElement("br",null),"Level 3: 7%")),c.BitNode12=new l(12,0,"The Recursion","Repeat.",r.a.createElement(r.a.Fragment,null,"To iterate is human, to recurse divine.",r.a.createElement("br",null),r.a.createElement("br",null),"Every time this BitNode is destroyed, it becomes slightly harder. Destroying this BitNode will give you Source-File 12, or if you already have this Source-File it will upgrade its level. There is no maximum level for Source-File 12. Each level of Source-File 12 lets you start any BitNodes with NeuroFlux Governor equal to the level of this source file.")),c.BitNode13=new l(13,2,"They're lunatics","1 step back, 2 steps forward",r.a.createElement(r.a.Fragment,null,"With the invention of Augmentations in the 2040s a religious group known as the"," ",o.a.ChurchOfTheMachineGod," has rallied far more support than anyone would have hoped.",r.a.createElement("br",null),r.a.createElement("br",null),'Their leader, Allison "Mother" Stanek is said to have created her own Augmentation whose power goes beyond any other. Find her in ',s.a.Chongqing," and gain her trust.",r.a.createElement("br",null),r.a.createElement("br",null),"Destroying this BitNode will give you Source-File 13, or if you already have this Source-File it will upgrade its level up to a maximum of 3. This Source-File lets the ",o.a.ChurchOfTheMachineGod," appear in other BitNodes.",r.a.createElement("br",null),r.a.createElement("br",null),"Each level of this Source-File increases the size of Stanek's Gift."));const f={HackingLevelMultiplier:1,StrengthLevelMultiplier:1,DefenseLevelMultiplier:1,DexterityLevelMultiplier:1,AgilityLevelMultiplier:1,CharismaLevelMultiplier:1,ServerGrowthRate:1,ServerMaxMoney:1,ServerStartingMoney:1,ServerStartingSecurity:1,ServerWeakenRate:1,HomeComputerRamCost:1,PurchasedServerCost:1,PurchasedServerSoftcap:1,PurchasedServerLimit:1,PurchasedServerMaxRam:1,CompanyWorkMoney:1,CrimeMoney:1,HacknetNodeMoney:1,ManualHackMoney:1,ScriptHackMoney:1,ScriptHackMoneyGain:1,CodingContractMoney:1,ClassGymExpGain:1,CompanyWorkExpGain:1,CrimeExpGain:1,FactionWorkExpGain:1,HackExpGain:1,FactionPassiveRepGain:1,FactionWorkRepGain:1,RepToDonateToFaction:1,AugmentationMoneyCost:1,AugmentationRepCost:1,InfiltrationMoney:1,InfiltrationRep:1,FourSigmaMarketDataCost:1,FourSigmaMarketDataApiCost:1,CorporationValuation:1,CorporationSoftcap:1,BladeburnerRank:1,BladeburnerSkillCost:1,GangSoftcap:1,GangUniqueAugs:1,DaedalusAugsRequirement:30,StaneksGiftPowerMultiplier:1,StaneksGiftExtraSize:0,WorldDaemonDifficulty:1};function u(t,e){const n=Object.assign({},f);switch(t){case 1:return n;case 2:return Object.assign(n,{HackingLevelMultiplier:.8,ServerGrowthRate:.8,ServerMaxMoney:.2,ServerStartingMoney:.4,CrimeMoney:3,InfiltrationMoney:3,FactionWorkRepGain:.5,FactionPassiveRepGain:0,StaneksGiftPowerMultiplier:2,StaneksGiftExtraSize:-6,PurchasedServerSoftcap:1.3,CorporationSoftcap:.9,WorldDaemonDifficulty:5});case 3:return Object.assign(n,{HackingLevelMultiplier:.8,RepToDonateToFaction:.5,AugmentationRepCost:3,AugmentationMoneyCost:3,ServerMaxMoney:.2,ServerStartingMoney:.2,ServerGrowthRate:.2,ScriptHackMoney:.2,CompanyWorkMoney:.25,CrimeMoney:.25,HacknetNodeMoney:.25,HomeComputerRamCost:1.5,PurchasedServerCost:2,StaneksGiftPowerMultiplier:.75,StaneksGiftExtraSize:-2,PurchasedServerSoftcap:1.3,GangSoftcap:.9,WorldDaemonDifficulty:2,GangUniqueAugs:.5});case 4:return Object.assign(n,{ServerMaxMoney:.15,ServerStartingMoney:.75,ScriptHackMoney:.2,CompanyWorkMoney:.1,CrimeMoney:.2,HacknetNodeMoney:.05,CompanyWorkExpGain:.5,ClassGymExpGain:.5,FactionWorkExpGain:.5,HackExpGain:.4,CrimeExpGain:.5,FactionWorkRepGain:.75,StaneksGiftPowerMultiplier:1.5,StaneksGiftExtraSize:0,PurchasedServerSoftcap:1.2,WorldDaemonDifficulty:3,GangUniqueAugs:.5});case 5:return Object.assign(n,{ServerMaxMoney:2,ServerStartingSecurity:2,ServerStartingMoney:.5,ScriptHackMoney:.15,HacknetNodeMoney:.2,CrimeMoney:.5,InfiltrationRep:1.5,InfiltrationMoney:1.5,AugmentationMoneyCost:2,HackExpGain:.5,CorporationValuation:.5,StaneksGiftPowerMultiplier:1.3,StaneksGiftExtraSize:0,PurchasedServerSoftcap:1.2,WorldDaemonDifficulty:1.5,GangUniqueAugs:.5});case 6:return Object.assign(n,{HackingLevelMultiplier:.35,ServerMaxMoney:.4,ServerStartingMoney:.5,ServerStartingSecurity:1.5,ScriptHackMoney:.75,CompanyWorkMoney:.5,CrimeMoney:.75,InfiltrationMoney:.75,CorporationValuation:.2,HacknetNodeMoney:.2,HackExpGain:.25,DaedalusAugsRequirement:35,PurchasedServerSoftcap:2,StaneksGiftPowerMultiplier:.5,StaneksGiftExtraSize:2,GangSoftcap:.7,CorporationSoftcap:.9,WorldDaemonDifficulty:2,GangUniqueAugs:.2});case 7:return Object.assign(n,{BladeburnerRank:.6,BladeburnerSkillCost:2,AugmentationMoneyCost:3,HackingLevelMultiplier:.35,ServerMaxMoney:.4,ServerStartingMoney:.5,ServerStartingSecurity:1.5,ScriptHackMoney:.5,CompanyWorkMoney:.5,CrimeMoney:.75,InfiltrationMoney:.75,CorporationValuation:.2,HacknetNodeMoney:.2,HackExpGain:.25,FourSigmaMarketDataCost:2,FourSigmaMarketDataApiCost:2,DaedalusAugsRequirement:35,PurchasedServerSoftcap:2,StaneksGiftPowerMultiplier:.9,StaneksGiftExtraSize:-1,GangSoftcap:.7,CorporationSoftcap:.9,WorldDaemonDifficulty:2,GangUniqueAugs:.2});case 8:return Object.assign(n,{ScriptHackMoney:.3,ScriptHackMoneyGain:0,ManualHackMoney:0,CompanyWorkMoney:0,CrimeMoney:0,HacknetNodeMoney:0,InfiltrationMoney:0,RepToDonateToFaction:0,CorporationValuation:0,CodingContractMoney:0,StaneksGiftExtraSize:-99,PurchasedServerSoftcap:4,GangSoftcap:0,CorporationSoftcap:0,GangUniqueAugs:0});case 9:return Object.assign(n,{HackingLevelMultiplier:.5,StrengthLevelMultiplier:.45,DefenseLevelMultiplier:.45,DexterityLevelMultiplier:.45,AgilityLevelMultiplier:.45,CharismaLevelMultiplier:.45,PurchasedServerLimit:0,HomeComputerRamCost:5,CrimeMoney:.5,ScriptHackMoney:.1,HackExpGain:.05,ServerStartingMoney:.1,ServerMaxMoney:.1,ServerStartingSecurity:2.5,CorporationValuation:.5,FourSigmaMarketDataCost:5,FourSigmaMarketDataApiCost:4,BladeburnerRank:.9,BladeburnerSkillCost:1.2,StaneksGiftPowerMultiplier:.5,StaneksGiftExtraSize:2,GangSoftcap:.8,CorporationSoftcap:.7,WorldDaemonDifficulty:2,GangUniqueAugs:.25});case 10:return Object.assign(n,{HackingLevelMultiplier:.35,StrengthLevelMultiplier:.4,DefenseLevelMultiplier:.4,DexterityLevelMultiplier:.4,AgilityLevelMultiplier:.4,CharismaLevelMultiplier:.4,CompanyWorkMoney:.5,CrimeMoney:.5,HacknetNodeMoney:.5,ManualHackMoney:.5,ScriptHackMoney:.5,CodingContractMoney:.5,InfiltrationMoney:.5,CorporationValuation:.5,AugmentationMoneyCost:5,AugmentationRepCost:2,HomeComputerRamCost:1.5,PurchasedServerCost:5,PurchasedServerLimit:.6,PurchasedServerMaxRam:.5,BladeburnerRank:.8,StaneksGiftPowerMultiplier:.75,StaneksGiftExtraSize:-3,PurchasedServerSoftcap:1.1,GangSoftcap:.9,CorporationSoftcap:.9,WorldDaemonDifficulty:2,GangUniqueAugs:.25});case 11:return Object.assign(n,{HackingLevelMultiplier:.6,HackExpGain:.5,ServerMaxMoney:.1,ServerStartingMoney:.1,ServerGrowthRate:.2,ServerWeakenRate:2,CrimeMoney:3,CompanyWorkMoney:.5,HacknetNodeMoney:.1,AugmentationMoneyCost:2,InfiltrationMoney:2.5,InfiltrationRep:2.5,CorporationValuation:.1,CodingContractMoney:.25,FourSigmaMarketDataCost:4,FourSigmaMarketDataApiCost:4,PurchasedServerSoftcap:2,CorporationSoftcap:.9,WorldDaemonDifficulty:1.5,GangUniqueAugs:.75});case 12:{const t=Math.pow(1.02,e),a=1/t;return Object.assign(n,{DaedalusAugsRequirement:Math.floor(Math.min(n.DaedalusAugsRequirement+t,40)),HackingLevelMultiplier:a,StrengthLevelMultiplier:a,DefenseLevelMultiplier:a,DexterityLevelMultiplier:a,AgilityLevelMultiplier:a,CharismaLevelMultiplier:a,ServerMaxMoney:a,ServerStartingMoney:a,ServerGrowthRate:a,ServerWeakenRate:a,ServerStartingSecurity:1.5,HomeComputerRamCost:t,PurchasedServerCost:t,PurchasedServerLimit:a,PurchasedServerMaxRam:a,PurchasedServerSoftcap:t,ManualHackMoney:a,ScriptHackMoney:a,CompanyWorkMoney:a,CrimeMoney:a,HacknetNodeMoney:a,CodingContractMoney:a,CompanyWorkExpGain:a,ClassGymExpGain:a,FactionWorkExpGain:a,HackExpGain:a,CrimeExpGain:a,FactionWorkRepGain:a,FactionPassiveRepGain:a,RepToDonateToFaction:t,AugmentationRepCost:t,AugmentationMoneyCost:t,InfiltrationMoney:a,InfiltrationRep:a,FourSigmaMarketDataCost:t,FourSigmaMarketDataApiCost:t,CorporationValuation:a,BladeburnerRank:a,BladeburnerSkillCost:t,StaneksGiftPowerMultiplier:t,StaneksGiftExtraSize:t,GangSoftcap:.8,CorporationSoftcap:.8,WorldDaemonDifficulty:t,GangUniqueAugs:a})}case 13:return Object.assign(n,{PurchasedServerSoftcap:1.6,HackingLevelMultiplier:.25,StrengthLevelMultiplier:.7,DefenseLevelMultiplier:.7,DexterityLevelMultiplier:.7,AgilityLevelMultiplier:.7,ServerMaxMoney:.45,ServerStartingMoney:.75,ServerStartingSecurity:3,ScriptHackMoney:.2,CompanyWorkMoney:.4,CrimeMoney:.4,HacknetNodeMoney:.4,CodingContractMoney:.4,CompanyWorkExpGain:.5,ClassGymExpGain:.5,FactionWorkExpGain:.5,HackExpGain:.1,CrimeExpGain:.5,FactionWorkRepGain:.6,FourSigmaMarketDataCost:10,FourSigmaMarketDataApiCost:10,CorporationValuation:.001,BladeburnerRank:.45,BladeburnerSkillCost:2,StaneksGiftPowerMultiplier:2,StaneksGiftExtraSize:1,GangSoftcap:.3,CorporationSoftcap:.3,WorldDaemonDifficulty:3,GangUniqueAugs:.1});default:throw new Error("Invalid BitNodeN")}}function m(t){Object.assign(i.a,u(t.bitNodeN,t.sourceFileLvl(t.bitNodeN)))}Object.freeze(f)},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(28),r=n(33);const i={b:!0,initPrice:1e4,marketCap:1e12,mv:1,name:"",otlkMag:0,spreadPerc:0,shareTxForMovement:1e6,symbol:""};function o(t){let e;switch(typeof t){case"number":return t;case"object":{const n=t;e=Object(r.a)(n.min,n.max);break}default:throw Error(`Do not know how to convert the type '${typeof t}' to a number`)}return"object"==typeof t&&"number"==typeof t.divisor?e/t.divisor:e}class s{constructor(t=i){this.name=t.name,this.symbol=t.symbol,this.price=o(t.initPrice),this.lastPrice=this.price,this.playerShares=0,this.playerAvgPx=0,this.playerShortShares=0,this.playerAvgShortPx=0,this.mv=o(t.mv),this.b=t.b,this.otlkMag=t.otlkMag,this.otlkMagForecast=this.getAbsoluteForecast(),this.cap=Object(r.a)(1e3*this.price,25e3*this.price),this.spreadPerc=o(t.spreadPerc),this.shareTxForMovement=o(t.shareTxForMovement),this.shareTxUntilMovement=this.shareTxForMovement;const e=t.marketCap/this.price;this.totalShares=1e5*Math.round(e/1e5);this.maxShares=1e5*Math.round(.2*this.totalShares/1e5)}changeForecastForecast(t){this.otlkMagForecast=t,this.otlkMagForecast>100?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(18),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";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(84);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){const n=t.match(/^([\w|!%,@-]+)=(("(.+)")|('(.+)'))$/);return null!=n&&7==n.length&&(e?function(t,e){t in r&&delete r[t];i[t]=e.trim()}(n[1],n[4]||n[6]):function(t,e){t in i&&delete i[t];r[t]=e.trim()}(n[1],n[4]||n[6]),!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;nn(!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(653),o=n(945),s=n(1748),l=n(125),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,"c",(function(){return C})),n.d(e,"b",(function(){return L})),n.d(e,"a",(function(){return O})),n.d(e,"d",(function(){return T})),n.d(e,"e",(function(){return R}));var a=n(0),r=n.n(a),i=n(125),o=n(142),s=n(1),l=n(19),c=n(8),f=n(45),u=n(452),m=n.n(u),h=n(1031),d=n(121),p=n(144),g=n(598),y=n.n(g),b=n(200),E=n(199),v=n(24),k=n(236),_=n(2),w=n(115),S=n(6);let x=0;const C=new i.a,L=new i.a,O=new i.a;let M=[];function T(){const t=Object(a.useState)(!0)[1];function e(){t(t=>!t)}return Object(a.useEffect)(()=>C.subscribe(t=>{const n=t.server+"-"+t.filename+t.args.map(t=>""+t).join("-");M.find(t=>t.id===n)||(M.push({id:n,script:t}),e())}),[]),Object(a.useEffect)(()=>L.subscribe(t=>{!function(t){M=M.filter(e=>e.script.pid!=t),e()}(t)}),[]),Object(a.useEffect)(()=>O.subscribe(()=>{M=[],e()})),r.a.createElement(r.a.Fragment,null,M.map(t=>r.a.createElement(N,{key:t.id,script:t.script,id:t.id,onClose:()=>{return n=t.id,M=M.filter(t=>t.id!==n),void e();var n}})))}const A=Object(d.a)(t=>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%"}})),R=1500;function N(t){const e=Object(a.useRef)(null),n=Object(a.useRef)(null),[i,u]=Object(a.useState)(t.script),d=A(),p=Object(a.useRef)(null),g=Object(a.useState)(!1)[1],[C,L]=Object(a.useState)(!1);function O(){g(t=>!t)}function M(){Object(o.a)(i,i.server,!0)}function T(){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)(_.a,i,t):u(e)}function N(){const t=p.current;null!==t&&(t.style.zIndex=R+x+"",x++,O())}function P(t=!1){const e=`${i.filename} ${i.args.map(t=>""+t).join(" ")}`;return t||e.length<=30?e:e.slice(0,27)+"..."}function I(){L(!C)}Object(a.useEffect)(()=>{N();const t=setInterval(O,1e3);return()=>clearInterval(t)},[]),Object(a.useEffect)(()=>(window.addEventListener("resize",F),()=>{window.removeEventListener("resize",F)}),[]);const F=Object(w.debounce)(()=>{const t=null==e?void 0:e.current;t&&(D(t)||j())},100),D=t=>{const e=t.getBoundingClientRect();return!(e.right<0||e.bottom<0||e.left>innerWidth||e.top>outerWidth)},j=()=>{const t=null==n?void 0:n.current;if(!t)return;const e=t.state;e.x=0,e.y=0,t.setState(e)},B=[250,33];return r.a.createElement(m.a,{handle:".drag",onDrag:t=>{if(t.clientX<0||t.clientY<0||t.clientX>innerWidth||t.clientY>innerHeight)return!1},ref:n,onMouseDown:N},r.a.createElement(l.a,{display:"flex",sx:{flexFlow:"column",position:"fixed",left:"40%",top:"30%",zIndex:1400,minWidth:B[0]+"px",minHeight:B[1]+"px",...C?{border:"none",margin:0,maxHeight:0,padding:0}:{border:"1px solid "+S.a.theme.welllight}},ref:p},r.a.createElement(h.ResizableBox,{height:500,width:500,minConstraints:B,handle:r.a.createElement("span",{style:{position:"absolute",right:"-10px",bottom:"-16px",cursor:"nw-resize",display:C?"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:P(!0)},P(!0)),r.a.createElement("span",{style:{minWidth:"fit-content",height:B[1]+"px"}},b.a.has(i.pid)?r.a.createElement(c.a,{className:d.titleButton,onClick:M,onTouchEnd:M},"Kill"):r.a.createElement(c.a,{className:d.titleButton,onClick:T,onTouchEnd:T},"Run"),r.a.createElement(c.a,{className:d.titleButton,onClick:I,onTouchEnd:I},C?"🗖":"🗕"),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% - ${B[1]}px)`,display:C?"none":"flex"}},r.a.createElement("span",{style:{display:"flex",flexDirection:"column"}},i.logs.map((t,e)=>{return r.a.createElement(s.a,{key:e,sx:{color:(n=t,n.match(/(^\[[^\]]+\] )?ERROR/)||n.match(/(^\[[^\]]+\] )?FAIL/)?S.a.theme.error:n.match(/(^\[[^\]]+\] )?SUCCESS/)?S.a.theme.success:n.match(/(^\[[^\]]+\] )?WARN/)?S.a.theme.warning:n.match(/(^\[[^\]]+\] )?INFO/)?S.a.theme.info:S.a.theme.primary)}},t,r.a.createElement("br",null));var n})))))))}},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";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";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 s}));var a=n(376),r=n(346),i=n(28);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 l}));var a=n(434),r=n(154),i=n(771),o=n(15),s=n(602);const l={};function c(t){if(!t.name)throw new Error("Invalid constructor parameters for Location. No 'name' property");return l[t.name]instanceof i.a&&console.warn(`Property with name ${t.name} already exists and is being overwritten`),l[t.name]=new i.a(t),l[t.name]}r.a[o.a.Aevum]=new a.a(o.a.Aevum),r.a[o.a.Chongqing]=new a.a(o.a.Chongqing),r.a[o.a.Ishima]=new a.a(o.a.Ishima),r.a[o.a.NewTokyo]=new a.a(o.a.NewTokyo),r.a[o.a.Sector12]=new a.a(o.a.Sector12),r.a[o.a.Volhaven]=new a.a(o.a.Volhaven),r.a[o.a.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 ",r.a[o.a.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 ",r.a[o.a.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 ",r.a[o.a.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 ",r.a[o.a.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] ",r.a[o.a.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 ";for(const t of s.a){const e=c(t),n=e.city;if(null===n)for(const t of Object.keys(r.a))r.a[t].addLocation(e.name);else r.a[n].addLocation(e.name)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(4);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";let a;n.d(e,"a",(function(){return a})),function(t){t[t.Field=0]="Field",t[t.Hacking=1]="Hacking",t[t.None=2]="None",t[t.Security=3]="Security"}(a||(a={}))},,,,,,,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return A})),n.d(e,"c",(function(){return R})),n.d(e,"e",(function(){return P})),n.d(e,"f",(function(){return F})),n.d(e,"b",(function(){return D})),n.d(e,"d",(function(){return j}));var a=n(142),r=n(180),i=n(421),o=n(200),s=n(297),l=n(527),c=n(10),f=n(595),u=n(110),m=n(528),h=n(643),d=n(1413),p=n(369),g=n(651),y=n(236),b=n(24),E=n(6),v=n(684),k=n(14),_=n(257),w=n(526),S=n(146),x=n(422),C=n(256),L=n(303),O=n(83),M=n(2),T=n(84);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(v.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(L.b)(o,{FunctionDeclaration:t=>{e.includes(t.id.name)&&n.push(t)}}),n.forEach(t=>{r+=Object(v.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(v.generate)(n);return{code:t=r+t,lineOffset:s}}(e,t);n=a.code,i=a.lineOffset}catch(e){return Object(k.a)("Error processing Imports in "+t.name+":
"+e),t.env.stopFlag=!0,t.running=!1,Object(a.a)(t),Promise.resolve()}const o=function(e,n){const i=Object(m.a)(t);for(const o of Object.keys(i)){const s=i[o];if("function"==typeof s)if(["hack","grow","weaken","sleep","prompt","manualHack","scp","write","share","wget"].includes(o)){const i=function(...n){const i=[];for(let t=0;t`;return s+="
",s+=o,Object(k.a)(s),t.env.stopFlag=!0,t.running=!1,Object(a.a)(t),Promise.resolve()}}))};e.setProperty(n,o,e.createAsyncFunction(i))}else if("sprintf"===o||"vsprintf"===o||"scp"===o||"write"==o||"tryWrite"===o||"run"===o||"exec"===o){const t=function(...t){const n=[];for(let a=0;a"+e),t.env.stopFlag=!0,t.running=!1,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,o=0;for(;o<3&&i;)i=i&&s.step(),o++;i?setTimeout(a,E.a.CodeInstructionRunTime):e()}catch(e){return e=e.toString(),Object(u.a)(e)||(e=Object(u.b)(t,e)),t.errorMessage=e,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 P(t,e,n,a){return I(t,e,n,a)?(n.runScript(e),e.pid):0}function I(t,e,n,c){let f=1;e.threads&&!isNaN(e.threads)?f=e.threads:e.threads=1;const d=Object(g.a)(e),p=Object(w.a)(d*f);if(p>n.maxRam-n.ramUsed+.001)return Object(k.a)(`Not enough RAM to run script ${e.filename} with args `+Object(_.a)(e.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;n.updateRamUsed(Object(w.a)(n.ramUsed+p),M.a);const y=Object(l.a)();if(-1===y)throw new Error("Failed to start script because could not find available PID. This is most because you have too many scripts running.");const b=new i.a(e,y,m.a);b.ramUsage=d,o.a.set(y,b),s.a.emit();let E=null;if(b.name.endsWith(".js")||b.name.endsWith(".ns"))E=function(t,e){e.running=!0;let n=null;function a(t,a){return function(...i){if(e.env.stopFlag)throw new r.a(e);if("asleep"===t)return a(...i);if(n)throw e.errorMessage=Object(u.b)(e,Object(x.sprintf)("Concurrent calls to Netscript functions are not allowed! Did you forget to await hack(), grow(), or some other promise-returning function? (Currently running: %s tried to run: %s)",n,t)),new r.a(e);let o;n=t;try{o=a(...i)}catch(t){throw n=null,t}return o&&void 0!==o.finally?o.finally((function(){n=null})):(n=null,o)}}return function t(e,...n){for(const r of Object.keys(e))switch(typeof e[r]){case"function":e[r]=a([...n,r].join("."),e[r]);break;case"object":if(Array.isArray(e[r]))continue;t(e[r],...n,r)}}(e.env.vars),new Promise((n,a)=>{Object(h.b)(t,e.getServer().scripts,e).then(()=>{n()}).catch(t=>a(t))}).catch(t=>{if(t instanceof Error)throw t instanceof SyntaxError?e.errorMessage=Object(u.b)(e,t.message+" (sorry we can't be more helpful)"):e.errorMessage=Object(u.b)(e,t.message+(t.stack&&"\nstack:\n"+t.stack.toString()||"")),new r.a(e);if(Object(u.a)(t))throw e.errorMessage=t,new r.a(e);if(t instanceof r.a)throw t;throw e.errorMessage=Object(u.b)(e,""+t),new r.a(e)})}(t,b);else if(E=N(b),!(E instanceof Promise))return!1;return E.then((function(){b.running=!1,b.env.stopFlag=!0,void 0!==c&&c.running&&(c.scriptRef.onlineExpGained+=e.onlineExpGained,c.scriptRef.onlineMoneyMade+=e.onlineMoneyMade),Object(a.a)(b),b.log("",()=>"Script finished running")})).catch((function(t){if(t instanceof Error)return Object(k.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(!Object(u.a)(b.errorMessage))return void b.log("",()=>"Script killed");{const t=b.errorMessage.split("|DELIMITER|");if(4!=t.length)return console.error("ERROR: Something wrong with Error text in evaluator..."),void console.error("Error text: "+b.errorMessage);const e=t[1],n=t[2],a=t[3];let r=`RUNTIME ERROR
${n}@${e} (PID - ${b.pid})
`;b.args.length>0&&(r+=`Args: ${Object(_.a)(b.args)}
`),r+="
",r+=a,Object(k.a)(r),b.log("",()=>"Script crashed with runtime error")}}else{if(Object(u.a)(t))return Object(k.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(k.a)("An unknown script died for an unknown reason. This is a bug please contact game dev"),console.error(t)}Object(a.a)(b)})),!0}function F(t=1){const e=t*c.a._idleSpeed/1e3;for(const t of o.a.values())t.scriptRef.onlineRunningTime+=e}function D(t){const e=-1!==window.location.href.toLowerCase().indexOf("?noscripts");e&&(T.a.warn("Skipped loading player scripts during startup"),console.info("Skipping the load of any scripts during startup"));for(const n of Object(b.c)()){n.ramUsed=0;for(let t=0;t`Invalid arguments: scriptname='${a} args='${r}'`),console.error("runScriptFromScript() failed due to invalid arguments"),0;r.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${a} argument index ${e} is of type ${typeof t} and value ${JSON.stringify(t)}`)});if(null!=n.getRunningScript(a,r))return o.log(e,()=>`'${a}' is already running on '${n.hostname}'`),0;for(let t=0;t"Cannot execute a script with null/undefined as an argument"),0;for(let i=0;i`You do not have root access on '${n.hostname}'`),0;if(c>f+.001)return o.log(e,()=>`Cannot run script '${a}' (t=${s}) on '${n.hostname}' because there is not enough available RAM!`),0;o.log(e,()=>`'${a}' on '${n.hostname}' with ${s} threads and args: ${Object(_.a)(r)}.`);const u=new p.a(l,r);return u.threads=s,u.server=n.hostname,P(t,u,n,o)}return o.log(e,()=>`Could not find script '${a}' on '${n.hostname}'`),0}},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 f}));var a=n(0),r=n.n(a),i=n(78),o=n(149),s=n(148),l=n(50),c=n(1);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(28);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 D}));var a=n(28),r=n(261),i=n(42),o=n(545),s=n(270),l=n(140),c=n(351),f=n(659),u=n(259),m=n(22),h=n(227),d=n(247),p=n(432),g=n(230),y=n(25),b=n(660),E=n(267),v=n(33),k=n(59),_=n(5),w=n(18),S=n(304),x=n(185),C=n(26),L=n(406),O=n(14),M=n(6),T=n(12),A=n(1021),R=n(105),N=n(4),P=n(57),I=n(27);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 D{constructor(t){F(this,"numHosp",0),F(this,"moneyLost",0),F(this,"rank",0),F(this,"maxRank",0),F(this,"skillPoints",0),F(this,"totalSkillPoints",0),F(this,"teamSize",0),F(this,"sleeveSize",0),F(this,"teamLost",0),F(this,"hpLost",0),F(this,"storedCycles",0),F(this,"randomEventCounter",Object(v.a)(240,600)),F(this,"actionTimeToComplete",0),F(this,"actionTimeCurrent",0),F(this,"actionTimeOverflow",0),F(this,"action",new r.a({type:i.a.Idle})),F(this,"cities",{}),F(this,"city",k.a.CityNames[2]),F(this,"skills",{}),F(this,"skillMultipliers",{}),F(this,"staminaBonus",0),F(this,"maxStamina",0),F(this,"stamina",0),F(this,"contracts",{}),F(this,"operations",{}),F(this,"blackops",{}),F(this,"logging",{general:!0,contracts:!0,ops:!0,blackops:!0,events:!0}),F(this,"automateEnabled",!1),F(this,"automateActionHigh",new r.a({type:i.a.Idle})),F(this,"automateThreshHigh",0),F(this,"automateActionLow",new r.a({type:i.a.Idle})),F(this,"automateThreshLow",0),F(this,"consoleHistory",[]),F(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(E.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(E.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(E.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){const e=t.name;if(this.skills[e]?++this.skills[e]:this.skills[e]=1,isNaN(this.skills[e])||this.skills[e]<0)throw new Error("Level of Skill "+e+" is invalid: "+this.skills[e]);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[N.a.Bladeburners];this.rank>=k.a.RankNeededForFaction&&Object(R.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.f)(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 b.a.helpList)this.postToConsole(t);else for(let e=1;e0&&(i*=Object(v.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(v.a)(0,r);if(this.teamSize-=i,this.teamSize"Support main sleeve"==t.bbAction);for(let e=0;e>this.teamSize-this.sleeveSize;e--){const e=Math.floor(Math.random()*t.length);t[e].takeDamage(t[e].max_hp),t.splice(e,1)}this.teamSize+=this.sleeveSize}this.teamLost+=i,this.logging.ops&&i>0&&this.log("Lost "+Object(m.f)(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(v.a)(-10,-5)/10;r.changePopulationByPercentage(t,{nonZero:!0,changeEstEqually:!1})}r.changeChaosByPercentage(Object(v.a)(1,5));break;case"Stealth Retirement Operation":t&&r.changePopulationByPercentage(-.5,{changeEstEqually:!0,nonZero:!0}),r.changeChaosByPercentage(Object(v.a)(-3,-1));break;case"Assassination":t&&r.changePopulationByCount(-1,{estChange:-1,estOffset:0}),r.changeChaosByPercentage(Object(v.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(v.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,k.a.DiffMultExponentialFactor)+l/k.a.DiffMultLinearFactor,f=Math.pow(s.rewardFac,s.level-1);if(a&&(this.stamina-=k.a.BaseStaminaLoss*c,this.stamina<0&&(this.stamina=0)),s.attempt(this,e)){r=this.getActionStats(s,!0),++s.successes,--s.count;let a=0;if(o||(a=k.a.ContractBaseMoneyGain*f*this.skillMultipliers.money,r.money=a),o?s.setMaxLevel(k.a.OperationSuccessesPerLevel):s.setMaxLevel(k.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.f)(t,3)+" rank"):!o&&this.logging.contracts&&this.log(e.whoAmI()+": "+s.name+" contract successfully completed! Gained "+Object(m.f)(t,3)+" rank and "+_.a.formatMoney(a))}o?this.completeOperation(!0,t):this.completeContract(!0,n)}else{r=this.getActionStats(s,!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(L.a)(t,i);e.takeDamage(i)&&(++this.numHosp,this.moneyLost+=n)}let l="";a>0&&(l+="Lost "+Object(m.f)(a,3)+" rank. "),i>0&&(l+="Took "+Object(m.f)(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(E.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,k.a.DiffMultExponentialFactor)+i/k.a.DiffMultLinearFactor;this.stamina-=k.a.BaseStaminaLoss*o,this.stamina<0&&(this.stamina=0);const s=a.teamCount;let c;if(a.attempt(this,e)){r=this.getActionStats(a,!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.f)(t,1)+" rank")}else{r=this.getActionStats(a,!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(L.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.f)(n,1)+" rank and took "+Object(m.f)(i,0)+" damage")}if(this.resetAction(),s>=1){const n=Object(v.a)(1,c);if(this.teamSize-=n,this.teamSize"Support main sleeve"==t.bbAction);for(let t=0;t>this.teamSize-this.sleeveSize;t--){const t=Math.floor(Math.random()*e.length);e[t].takeDamage(e[t].max_hp),e.splice(t,1)}this.teamSize+=this.sleeveSize}this.teamLost+=n,this.logging.blackops&&this.log(`${e.whoAmI()}: You lost ${Object(m.f)(n,0)} team members during ${a.name}`)}}catch(t){Object(E.a)(t)}break;case i.a.Training:{this.stamina-=.5*k.a.BaseStaminaLoss;const t=30*e.strength_exp_mult,n=30*e.defense_exp_mult,a=30*e.dexterity_exp_mult,i=30*e.agility_exp_mult,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.f)(t,1)+" str exp, "+Object(m.f)(n,1)+" def exp, "+Object(m.f)(a,1)+" dex exp, "+Object(m.f)(i,1)+" agi exp, "+Object(m.f)(o,3)+" max stamina");break}case i.a.FieldAnalysis:case i.a["Field Analysis"]:{let t=.04*Math.pow(e.hacking,.3)+.04*Math.pow(e.intelligence,.9)+.02*Math.pow(e.charisma,.3);if(t*=e.bladeburner_analysis_mult,isNaN(t)||t<0)throw new Error("Field Analysis Effectiveness calculated to be NaN or negative");const n=20*e.hacking_exp_mult,a=20*e.charisma_exp_mult,i=.1*w.a.BladeburnerRank;r.hack=n,r.cha=a,r.int=k.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.f)(i,2)} rank, `+Object(m.f)(n,1)+" hacking exp, and "+Object(m.f)(a,1)+" charisma exp");break}case i.a.Recruitment:{const t=this.getRecruitmentSuccessChance(e),n=1e3*this.getRecruitmentTime(e);if(Math.random()"Infiltrate synthoids"===t.bbAction).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=N.a.Bladeburners;if(Object(C.b)(n)){const a=C.a[n];if(!(a instanceof x.a))throw new Error(`Could not properly get ${N.a.Bladeburners} Faction object in ${N.a.Bladeburners} UI Overview Faction button`);if(a.isMember){const n=1+a.favor/100;a.playerReputation+=k.a.RankToFactionRepFactor*e*t.faction_rep_mult*n}}const a=(this.totalSkillPoints+1)*k.a.RanksPerSkillPoint;if(this.maxRank>=a){const t=Math.floor((this.maxRank-a)/k.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 n=this.getActionObject(this.action),a=this.completeAction(e,e,this.action);if(e.gainMoney(a.money,"bladeburner"),e.gainStats(a),null==n)throw new Error("Failed to get BlackOperation Object for: "+this.action.name);n.name===P.a.OperationDaedalus&&this.blackops[n.name]?(this.resetAction(),t.toBitVerse(!1,!1)):this.action.type!=i.a.BlackOperation&&this.action.type!=i.a.BlackOp&&this.startAction(e,this.action)}}}calculateStaminaGainPerSecond(t){const e=t.agility*this.skillMultipliers.effAgi,n=this.maxStamina/k.a.MaxStaminaToGainFactor;return(k.a.StaminaGainPerSecond+n)*Math.pow(e,.17)*(this.skillMultipliers.stamina*t.bladeburner_stamina_gain_mult)}calculateMaxStamina(t){const e=t.agility*this.skillMultipliers.effAgi,n=(Math.pow(e,.8)+this.staminaBonus)*this.skillMultipliers.stamina*t.bladeburner_max_stamina_mult;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(v.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(v.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(v.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(v.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(v.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(v.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(v.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(v.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(v.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(t.page()!==y.a.BitVerse&&this.blackops.hasOwnProperty(P.a.OperationDaedalus))return t.toBitVerse(!1,!1);if(!e.hasAugmentation(T.a.BladesSimulacrum,!0)&&e.isWorking){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),M.a.SuppressBladeburnerPopup||Object(O.a)(t)}this.resetAction()}if(this.stamina<=0&&(this.log("Your Bladeburner action was cancelled because your stamina hit 0"),this.resetAction()),this.storedCycles>=k.a.CyclesPerSecond){let n=Math.floor(this.storedCycles/k.a.CyclesPerSecond);n=Math.min(n,5),this.storedCycles-=n*k.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()/k.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()/k.a.ActionCountGrowthPeriod)}for(const t of k.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(v.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 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){if(""===t||!h.a.hasOwnProperty(t))return e.log("bladeburner.getSkillUpgradeCost",()=>`Invalid skill: '${t}'`),-1;const n=h.a[t];return null==this.skills[t]?n.calculateCost(0):n.calculateCost(this.skills[t])}upgradeSkillNetscriptFn(t,e){const n=`Invalid skill: '${t}'`;if(!h.a.hasOwnProperty(t))return e.log("bladeburner.upgradeSkill",()=>n),!1;const a=h.a[t];let r=0;this.skills[t]&&!isNaN(this.skills[t])&&(r=this.skills[t]);const i=a.calculateCost(r);return a.maxLvl&&r>=a.maxLvl?(e.log("bladeburner.upgradeSkill",()=>`Skill '${t}' is already maxed.`),!1):this.skillPoints`You do not have enough skill points to upgrade ${t} (You have ${this.skillPoints}, you need ${i})`),!1):(this.skillPoints-=i,this.upgradeSkill(a),e.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[N.a.Bladeburners];return!!e.isMember||(this.rank>=k.a.RankNeededForFaction?(Object(R.d)(e),t.log("bladeburner.joinBladeburnerFaction",()=>`Joined ${N.a.Bladeburners} faction.`),!0):(t.log("bladeburner.joinBladeburnerFaction",()=>`You do not have the required rank (${this.rank}/${k.a.RankNeededForFaction}).`),!1))}toJSON(){return Object(a.b)("Bladeburner",this)}static fromJSON(t){return Object(a.a)(D,t.data)}}a.c.constructors.Bladeburner=D},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(18),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,"a",(function(){return l}));var a=n(0),r=n(5),i=n(121),o=n(144);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(10),r=n(211),i=n(41),o=n(14),s=n(28),l=n(383);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(14),r=n(28),i=n(83);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=this.fn,e=new Blob([this.text],{type:"text/plain"}),n=window.navigator;if(n.msSaveOrOpenBlob)n.msSaveOrOpenBlob(e,t);else{const t=document.createElement("a"),n=URL.createObjectURL(e);t.href=n,t.download=this.fn,document.body.appendChild(t),t.click(),setTimeout(()=>{document.body.removeChild(t),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,"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,ScriptGetOwnedSourceFiles:5,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={getSymbols:a.ScriptGetStockRamCost,getPrice:a.ScriptGetStockRamCost,getAskPrice:a.ScriptGetStockRamCost,getBidPrice:a.ScriptGetStockRamCost,getPosition:a.ScriptGetStockRamCost,getMaxShares:a.ScriptGetStockRamCost,getPurchaseCost:a.ScriptGetStockRamCost,getSaleGain:a.ScriptGetStockRamCost,buy:a.ScriptBuySellStockRamCost,sell:a.ScriptBuySellStockRamCost,short: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),getStats:r(a.ScriptSingularityFn1RamCost/4),getCharacterInformation: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),getAugmentationsFromFaction:r(a.ScriptSingularityFn3RamCost),getAugmentationCost:r(a.ScriptSingularityFn3RamCost),getAugmentationPrereq:r(a.ScriptSingularityFn3RamCost),getAugmentationPrice: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)},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},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:{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},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,getScriptIncome: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,getOwnedSourceFiles:a.ScriptGetOwnedSourceFiles,tail:0,toast:0,closeTail:0,clearPort:0,openDevMenu:0,alert:0,flags:0,exploit:0,bypass:0,alterReality:0,rainbow:0,heart:{break:0},formulas:{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}}},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";function a(){return{hack:0,str:0,def:0,dex:0,agi:0,cha:0,int:0,money:0}}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})),n.d(e,"d",(function(){return s})),n.d(e,"c",(function(){return l}));var a=n(18),r=n(10);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,"c",(function(){return f})),n.d(e,"a",(function(){return u})),n.d(e,"b",(function(){return m}));var a=n(10),r=n(2),i=n(46),o=n(137),s=n(24),l=n(5),c=n(321);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;a{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(202),r=n(179),i=n(28),o=n(267);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,"c",(function(){return s})),n.d(e,"b",(function(){return l})),n.d(e,"a",(function(){return c}));var a=n(10),r=n(18),i=n(420);function o(t){let e=1+t.favor/100;return isNaN(e)&&(e=1),e*r.a.FactionWorkRepGain}function s(t,e){return(t.hacking+t.intelligence/3)/a.a.MaxSkillLevel*t.faction_rep_mult*t.getIntelligenceBonus(1)*o(e)*Object(i.a)()}function l(t,e){return.9*(t.strength+t.defense+t.dexterity+t.agility+(t.hacking+t.intelligence)*Object(i.a)())/a.a.MaxSkillLevel/4.5*t.faction_rep_mult*o(e)*t.getIntelligenceBonus(1)}function c(t,e){return.9*(t.strength+t.defense+t.dexterity+t.agility+t.charisma+(t.hacking+t.intelligence)*Object(i.a)())/a.a.MaxSkillLevel/5.5*t.faction_rep_mult*o(e)*t.getIntelligenceBonus(1)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u})),n.d(e,"c",(function(){return m})),n.d(e,"d",(function(){return h})),n.d(e,"b",(function(){return d}));var a=n(228),r=n(75),i=n(10),o=n(2),s=n(5),l=n(20),c=n(14),f=n(0);function u(t,e,n=null,u={}){if((e=Math.round(e))<=0)return!1;if(null==t||isNaN(e))return n?n.log("stock.buy",()=>`Invalid arguments: stock='${t}' shares='${e}'`):!0!==u.suppressDialog&&Object(c.a)("Failed to buy stock. This may be a bug, contact developer"),!1;const m=Object(a.b)(t,e,r.a.Long);if(null==m)return!1;if(o.a.money`You do not have enough money to purchase this position. You need ${s.a.formatMoney(m)}.`):!0!==u.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:m}))),!1;if(e+t.playerShares+t.playerShortShares>t.maxShares)return n?n.log("stock.buy",()=>`Purchasing '${e+t.playerShares+t.playerShortShares}' shares would exceed ${t.symbol}'s maximum (${t.maxShares}) number of shares`):!0!==u.suppressDialog&&Object(c.a)(`You cannot purchase this many shares. ${t.symbol} has a maximum of ${s.a.formatShares(t.maxShares)} shares.`),!1;const h=t.playerShares*t.playerAvgPx;o.a.loseMoney(m,"stock");const d=h+m-i.a.StockMarketCommission;if(t.playerShares=Math.round(t.playerShares+e),t.playerAvgPx=d/t.playerShares,Object(a.d)(t,e),null!=u.rerenderFn&&"function"==typeof u.rerenderFn&&u.rerenderFn(),n){const a=`Bought ${s.a.formatShares(e)} shares of ${t.symbol} for ${s.a.formatMoney(m)}. Paid ${s.a.formatMoney(i.a.StockMarketCommission)} in commission fees.`;n.log("stock.buy",()=>a)}else!0!==u.suppressDialog&&Object(c.a)(f.createElement(f.Fragment,null,"Bought ",s.a.formatShares(e)," shares of ",t.symbol," for ",f.createElement(l.a,{money:m}),". Paid"," ",f.createElement(l.a,{money:i.a.StockMarketCommission})," in commission fees."));return!0}function m(t,e,n=null,i={}){if(null==t||e<0||isNaN(e))return n?n.log("stock.sell",()=>`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 u=Object(a.c)(t,e,r.a.Long);if(null==u)return!1;let m=u-t.playerAvgPx*e;if(isNaN(m)&&(m=0),o.a.gainMoney(u,"stock"),n&&(n.scriptRef.onlineMoneyMade+=m,o.a.scriptProdSinceLastAug+=m),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(u)}.`;n.log("stock.sell",()=>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:u}),"."));return!0}function h(t,e,n=null,u={}){if((e=Math.round(e))<=0)return!1;if(null==t||isNaN(e))return n?n.log("stock.short",()=>`Invalid arguments: stock='${t}' shares='${e}'`):!0!==u.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 m=Object(a.b)(t,e,r.a.Short);if(null==m)return!1;if(o.a.money"You do not have enough money to purchase this short position. You need "+s.a.formatMoney(m)):!0!==u.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:m}))),!1;if(e+t.playerShares+t.playerShortShares>t.maxShares)return n?n.log("stock.short",()=>`This '${e+t.playerShares+t.playerShortShares}' short shares would exceed ${t.symbol}'s maximum (${t.maxShares}) number of shares.`):!0!==u.suppressDialog&&Object(c.a)(`You cannot purchase this many shares. ${t.symbol} has a maximum of ${t.maxShares} shares.`),!1;const h=t.playerShortShares*t.playerAvgShortPx;o.a.loseMoney(m,"stock");const d=h+m-i.a.StockMarketCommission;if(t.playerShortShares=Math.round(t.playerShortShares+e),t.playerAvgShortPx=d/t.playerShortShares,Object(a.d)(t,e),null!=u.rerenderFn&&"function"==typeof u.rerenderFn&&u.rerenderFn(),n){const a=`Bought a short position of ${s.a.formatShares(e)} shares of ${t.symbol} for ${s.a.formatMoney(m)}. Paid ${s.a.formatMoney(i.a.StockMarketCommission)} in commission fees.`;n.log("stock.short",()=>a)}else u.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:m}),". Paid ",f.createElement(l.a,{money:i.a.StockMarketCommission})," in commission fees."));return!0}function d(t,e,n=null,i={}){if(null==t||isNaN(e)||e<0)return n?n.log("stock.sellShort",()=>`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 u=e*t.playerAvgShortPx,m=Object(a.c)(t,e,r.a.Short);if(null==m||isNaN(m)||null==u)return n?n.log("stock.sellShort",()=>"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 h=m-u;if(isNaN(h)&&(h=0),o.a.gainMoney(m,"stock"),n&&(n.scriptRef.onlineMoneyMade+=h,o.a.scriptProdSinceLastAug+=h),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(m);n.log("stock.sellShort",()=>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:m})));return!0}},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(375);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(18);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){return Math.floor((this.baseCost+t*this.costInc)*a.a.BladeburnerSkillCost)}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(38),o=n(8),s=n(1);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"6a2e5b06"}catch(t){}return"DEV"}n.d(e,"a",(function(){return a}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(525),r=n(28),i=n(526);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",""),o(this,"dependencies",[]),o(this,"dependents",[]),o(this,"ramUsage",0),o(this,"server",""),this.filename=e,this.code=n,this.ramUsage=0,this.server=a,this.module="",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=window.navigator;if(n.msSaveOrOpenBlob)n.msSaveOrOpenBlob(e,t);else{const 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="",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()}}async updateRamUsage(t,e){const n=await 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";function a(t){const e=[];for(let n=0;n13)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(28);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,"a",(function(){return o}));var a=n(0),r=n.n(a),i=n(777);function o({children:t}){return r.a.createElement(i.MathJaxContext,{version:3,src:"dist/ext/MathJax-3.2.0/es5/tex-chtml.js"},r.a.createElement(i.MathJax,null,t))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(14);function r(t){console.error(t);let e="",n="UNKNOWN FILE NAME",r="UNKNOWN LINE NUMBER";var i,o,s;(t=>t.hasOwnProperty("fileName"))(t)?(n=null!==(i=t.fileName)&&void 0!==i?i:n,r=null!==(o=null===(s=t.lineNumber)||void 0===s?void 0:s.toString())&&void 0!==o?o:r):e=t;Object(a.a)("Caught an exception: "+e+"

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";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(79);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(140),r=n(57);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(120),r=n(28);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";n.d(e,"a",(function(){return i}));var a=n(10);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,n=0,a=0,i=0,o=0,s={}){r(this,"difficulty",0),r(this,"karma",0),r(this,"kills",0),r(this,"money",0),r(this,"name",""),r(this,"time",0),r(this,"hacking_success_weight",0),r(this,"strength_success_weight",0),r(this,"defense_success_weight",0),r(this,"dexterity_success_weight",0),r(this,"agility_success_weight",0),r(this,"charisma_success_weight",0),r(this,"hacking_exp",0),r(this,"strength_exp",0),r(this,"defense_exp",0),r(this,"dexterity_exp",0),r(this,"agility_exp",0),r(this,"charisma_exp",0),r(this,"intelligence_exp",0),this.name=t,this.type=e,this.time=n,this.money=a,this.difficulty=i,this.karma=o,this.hacking_success_weight=s.hacking_success_weight?s.hacking_success_weight:0,this.strength_success_weight=s.strength_success_weight?s.strength_success_weight:0,this.defense_success_weight=s.defense_success_weight?s.defense_success_weight:0,this.dexterity_success_weight=s.dexterity_success_weight?s.dexterity_success_weight:0,this.agility_success_weight=s.agility_success_weight?s.agility_success_weight:0,this.charisma_success_weight=s.charisma_success_weight?s.charisma_success_weight:0,this.hacking_exp=s.hacking_exp?s.hacking_exp:0,this.strength_exp=s.strength_exp?s.strength_exp:0,this.defense_exp=s.defense_exp?s.defense_exp:0,this.dexterity_exp=s.dexterity_exp?s.dexterity_exp:0,this.agility_exp=s.agility_exp?s.agility_exp:0,this.charisma_exp=s.charisma_exp?s.charisma_exp:0,this.intelligence_exp=s.intelligence_exp?s.intelligence_exp:0,this.kills=s.kills?s.kills:0}commit(t,e,n=1,a=null){return n<=0&&(n=1),e.startCrime(t,this.type,this.hacking_exp/n,this.strength_exp/n,this.defense_exp/n,this.dexterity_exp/n,this.agility_exp/n,this.charisma_exp/n,this.money/n,this.time,a),this.time}successRate(t){let e=this.hacking_success_weight*t.hacking+this.strength_success_weight*t.strength+this.defense_success_weight*t.defense+this.dexterity_success_weight*t.dexterity+this.agility_success_weight*t.agility+this.charisma_success_weight*t.charisma+a.a.IntelligenceCrimeWeight*t.intelligence;return e/=a.a.MaxSkillLevel,e/=this.difficulty,e*=t.crime_success_mult,e*=t.getIntelligenceBonus(1),Math.min(e,1)}}},,,,,,,,,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 i}));var a=n(1024),r=n(1025);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";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"}(a||(a={}))},,function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(0),r=n.n(a),i=n(5),o=n(222);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(537),i=n(29),o=n(8),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 a}));const a=new(n(125).a)},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(2),r=n(90),i=n(83),o=n(84),s=n(94),l=n(24),c=n(109),f=n(6),u=n(603),m=n(10),h=n(254);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.log(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=>{const n=await window.appSaveFns.getSaveInfo(e);t.send("get-save-info-response",n)}),t.receive("push-save-request",({save:t,automatic:e=!1})=>{window.appSaveFns.pushSaveData(t,e)}),t.receive("trigger-save",()=>window.appSaveFns.triggerSave().then(()=>{t.send("save-completed")}).catch(t=>{console.log(t),s.b.emit("Could not save game.",s.d.ERROR,2e3)})),t.receive("trigger-game-export",()=>{try{window.appSaveFns.triggerGameExport()}catch(t){console.log(t),s.b.emit("Could not export game.",s.d.ERROR,2e3)}}),t.receive("trigger-scripts-export",()=>{try{window.appSaveFns.triggerScriptsExport()}catch(t){console.log(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(164).Buffer)},,function(t,e,n){"use strict";n.d(e,"a",(function(){return R})),n.d(e,"b",(function(){return N}));var a=n(12),r=n(138),i=n(227),o=n(10),s=n(51),l=n(108),c=n(26),f=n(82),u=n(187),m=n(41),h=n(56),d=n(223),p=n(92),g=n(15),y=n(2),b=n(65),E=n(24),v=n(88),k=n(46),_=n(90),w=n(25),S=n(1140),x=n(4),C=n(57),L=n(34);const O=S.a;function M(){const t=Object(E.d)(v.a.WorldDaemon);return t instanceof k.a&&(!!t.backdoorInstalled||null!==y.a.bladeburner&&y.a.bladeburner.blackops.hasOwnProperty(C.a.OperationDaedalus))}function T(t,e){return t.bitNodeN===e||t.sourceFiles.some(t=>t.n===e)}function A(t){return t.sourceFiles.some(t=>1===t.n)}const R={[x.a.CyberSec.toUpperCase()]:{...O[x.a.CyberSec.toUpperCase()],Icon:"CSEC",Condition:()=>y.a.factions.includes(x.a.CyberSec)},[x.a.NiteSec.toUpperCase()]:{...O[x.a.NiteSec.toUpperCase()],Icon:x.a.NiteSec,Condition:()=>y.a.factions.includes(x.a.NiteSec)},THE_BLACK_HAND:{...O.THE_BLACK_HAND,Icon:"TBH",Condition:()=>y.a.factions.includes(x.a.TheBlackHand)},[x.a.BitRunners.toUpperCase()]:{...O[x.a.BitRunners.toUpperCase()],Icon:x.a.BitRunners.toLowerCase(),Condition:()=>y.a.factions.includes(x.a.BitRunners)},[x.a.Daedalus.toUpperCase()]:{...O[x.a.Daedalus.toUpperCase()],Icon:x.a.Daedalus.toLowerCase(),Condition:()=>y.a.factions.includes(x.a.Daedalus)},THE_COVENANT:{...O.THE_COVENANT,Icon:x.a.TheCovenant.toLowerCase().replace(/ /g,""),Condition:()=>y.a.factions.includes(x.a.TheCovenant)},[x.a.Illuminati.toUpperCase()]:{...O[x.a.Illuminati.toUpperCase()],Icon:x.a.Illuminati.toLowerCase(),Condition:()=>y.a.factions.includes(x.a.Illuminati)},"BRUTESSH.EXE":{...O["BRUTESSH.EXE"],Icon:"p0",Condition:()=>y.a.getHomeComputer().programs.includes(b.a.BruteSSHProgram.name)},"FTPCRACK.EXE":{...O["FTPCRACK.EXE"],Icon:"p1",Condition:()=>y.a.getHomeComputer().programs.includes(b.a.FTPCrackProgram.name)},"RELAYSMTP.EXE":{...O["RELAYSMTP.EXE"],Icon:"p2",Condition:()=>y.a.getHomeComputer().programs.includes(b.a.RelaySMTPProgram.name)},"HTTPWORM.EXE":{...O["HTTPWORM.EXE"],Icon:"p3",Condition:()=>y.a.getHomeComputer().programs.includes(b.a.HTTPWormProgram.name)},"SQLINJECT.EXE":{...O["SQLINJECT.EXE"],Icon:"p4",Condition:()=>y.a.getHomeComputer().programs.includes(b.a.SQLInjectProgram.name)},"FORMULAS.EXE":{...O["FORMULAS.EXE"],Icon:"formulas",Condition:()=>y.a.getHomeComputer().programs.includes(b.a.Formulas.name)},"SF1.1":{...O["SF1.1"],Icon:"SF1.1",Visible:()=>T(y.a,1),Condition:()=>y.a.sourceFileLvl(1)>=1},"SF2.1":{...O["SF2.1"],Icon:"SF2.1",Visible:()=>T(y.a,2),Condition:()=>y.a.sourceFileLvl(2)>=1},"SF3.1":{...O["SF3.1"],Icon:"SF3.1",Visible:()=>T(y.a,3),Condition:()=>y.a.sourceFileLvl(3)>=1},"SF4.1":{...O["SF4.1"],Icon:"SF4.1",Visible:()=>T(y.a,4),Condition:()=>y.a.sourceFileLvl(4)>=1},"SF5.1":{...O["SF5.1"],Icon:"SF5.1",Visible:()=>T(y.a,5),Condition:()=>y.a.sourceFileLvl(5)>=1},"SF6.1":{...O["SF6.1"],Icon:"SF6.1",Visible:()=>T(y.a,6),Condition:()=>y.a.sourceFileLvl(6)>=1},"SF7.1":{...O["SF7.1"],Icon:"SF7.1",Visible:()=>T(y.a,7),Condition:()=>y.a.sourceFileLvl(7)>=1},"SF8.1":{...O["SF8.1"],Icon:"SF8.1",Visible:()=>T(y.a,8),Condition:()=>y.a.sourceFileLvl(8)>=1},"SF9.1":{...O["SF9.1"],Icon:"SF9.1",Visible:()=>T(y.a,9),Condition:()=>y.a.sourceFileLvl(9)>=1},"SF10.1":{...O["SF10.1"],Icon:"SF10.1",Visible:()=>T(y.a,10),Condition:()=>y.a.sourceFileLvl(10)>=1},"SF11.1":{...O["SF11.1"],Icon:"SF11.1",Visible:()=>T(y.a,11),Condition:()=>y.a.sourceFileLvl(11)>=1},"SF12.1":{...O["SF12.1"],Icon:"SF12.1",Visible:()=>T(y.a,12),Condition:()=>y.a.sourceFileLvl(12)>=1},MONEY_1Q:{...O.MONEY_1Q,Icon:"$1Q",Condition:()=>y.a.money>=1e18},MONEY_M1B:{...O.MONEY_M1B,Icon:"-1b",Secret:!0,Condition:()=>y.a.money<=-1e9},INSTALL_1:{...O.INSTALL_1,Icon:"install",Condition:()=>y.a.augmentations.length>=1},INSTALL_100:{...O.INSTALL_100,Icon:"install_100",Condition:()=>y.a.augmentations.length>=100},QUEUE_40:{...O.QUEUE_40,Icon:"queue40",Condition:()=>y.a.queuedAugmentations.length>=40},HACKING_100000:{...O.HACKING_100000,Icon:"hack100000",Condition:()=>y.a.hacking>=1e5},COMBAT_3000:{...O.COMBAT_3000,Icon:"combat3000",Condition:()=>y.a.strength>=3e3&&y.a.defense>=3e3&&y.a.dexterity>=3e3&&y.a.agility>=3e3},NEUROFLUX_255:{...O.NEUROFLUX_255,Icon:"nf255",Condition:()=>y.a.augmentations.some(t=>t.name===a.a.NeuroFluxGovernor&&t.level>=255)},NS2:{...O.NS2,Icon:"ns2",Condition:()=>y.a.getHomeComputer().scripts.some(t=>t.filename.endsWith(".js")||t.filename.endsWith(".ns"))},FROZE:{...O.FROZE,Icon:"forze",Condition:()=>location.href.includes("noScripts")},RUNNING_SCRIPTS_1000:{...O.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:{...O.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:{...O.MAX_RAM,Icon:"maxram",Condition:()=>y.a.getHomeComputer().maxRam===o.a.HomeComputerMaxRam},MAX_CORES:{...O.MAX_CORES,Icon:"maxcores",Condition:()=>8===y.a.getHomeComputer().cpuCores},SCRIPTS_30:{...O.SCRIPTS_30,Icon:"folders",Condition:()=>y.a.getHomeComputer().scripts.length>=30},KARMA_1000000:{...O.KARMA_1000000,Icon:"karma",Secret:!0,Condition:()=>y.a.karma<=-1e6},STOCK_1q:{...O.STOCK_1q,Icon:"$1Q",Condition:()=>y.a.moneySourceB.stock>=1e15},DISCOUNT:{...O.DISCOUNT,Icon:"discount",Condition:()=>{const t=Object(E.d)("powerhouse-fitness");return t instanceof k.a&&t.backdoorInstalled}},SCRIPT_32GB:{...O.SCRIPT_32GB,Icon:"bigcost",Condition:()=>y.a.getHomeComputer().scripts.some(t=>t.ramUsage>=32)},FIRST_HACKNET_NODE:{...O.FIRST_HACKNET_NODE,Icon:"node",Condition:()=>!Object(h.g)(y.a)&&y.a.hacknetNodes.length>0},"30_HACKNET_NODE":{...O["30_HACKNET_NODE"],Icon:"hacknet-all",Condition:()=>!Object(h.g)(y.a)&&y.a.hacknetNodes.length>=30},MAX_HACKNET_NODE:{...O.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:{...O.HACKNET_NODE_10M,Icon:"hacknet-10m",Condition:()=>!Object(h.g)(y.a)&&y.a.moneySourceB.hacknet>=1e7},REPUTATION_10M:{...O.REPUTATION_10M,Icon:"reputation",Condition:()=>Object.values(c.a).some(t=>t.playerReputation>=1e7)},DONATION:{...O.DONATION,Icon:"donation",Condition:()=>Object.values(c.a).some(t=>t.favor>=150)},TRAVEL:{...O.TRAVEL,Icon:"TRAVEL",Condition:()=>y.a.city!==g.a.Sector12},WORKOUT:{...O.WORKOUT,Icon:"WORKOUT",Condition:()=>[L.a.GymStrength,L.a.GymDefense,L.a.GymDexterity,L.a.GymAgility].includes(y.a.className)},TOR:{...O.TOR,Icon:"TOR",Condition:()=>y.a.hasTorRouter()},HOSPITALIZED:{...O.HOSPITALIZED,Icon:"OUCH",Condition:()=>0!==y.a.moneySourceB.hospitalization},GANG:{...O.GANG,Icon:"GANG",Visible:()=>T(y.a,2),Condition:()=>null!==y.a.gang},FULL_GANG:{...O.FULL_GANG,Icon:"GANGMAX",Visible:()=>T(y.a,2),Condition:()=>null!==y.a.gang&&y.a.gang.members.length===u.a.MaximumGangMembers},GANG_TERRITORY:{...O.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:{...O.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:{...O.CORPORATION,Icon:"CORP",Visible:()=>T(y.a,3),Condition:()=>null!==y.a.corporation},CORPORATION_BRIBE:{...O.CORPORATION_BRIBE,Icon:"CORPLOBBY",Visible:()=>T(y.a,3),Condition:()=>null!==y.a.corporation&&1===y.a.corporation.unlockUpgrades[6]},CORPORATION_PROD_1000:{...O.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:{...O.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:{...O.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:{...O.INTELLIGENCE_255,Icon:"INT255",Visible:()=>T(y.a,5),Condition:()=>y.a.intelligence>=255},BLADEBURNER_DIVISION:{...O.BLADEBURNER_DIVISION,Icon:"BLADE",Visible:()=>T(y.a,6),Condition:()=>null!==y.a.bladeburner},BLADEBURNER_OVERCLOCK:{...O.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:{...O.BLADEBURNER_UNSPENT_100000,Icon:"BLADE100K",Visible:()=>T(y.a,6),Condition:()=>null!==y.a.bladeburner&&y.a.bladeburner.skillPoints>=1e5},"4S":{...O["4S"],Icon:"4S",Condition:()=>y.a.has4SData},FIRST_HACKNET_SERVER:{...O.FIRST_HACKNET_SERVER,Icon:"HASHNET",Visible:()=>T(y.a,9),Condition:()=>Object(h.g)(y.a)&&y.a.hacknetNodes.length>0,AdditionalUnlock:[O.FIRST_HACKNET_NODE.ID]},ALL_HACKNET_SERVER:{...O.ALL_HACKNET_SERVER,Icon:"HASHNETALL",Visible:()=>T(y.a,9),Condition:()=>Object(h.g)(y.a)&&y.a.hacknetNodes.length===m.b.MaxServers,AdditionalUnlock:[O["30_HACKNET_NODE"].ID]},MAX_HACKNET_SERVER:{...O.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:[O.MAX_HACKNET_NODE.ID]},HACKNET_SERVER_1B:{...O.HACKNET_SERVER_1B,Icon:"HASHNETMONEY",Visible:()=>T(y.a,9),Condition:()=>Object(h.g)(y.a)&&y.a.moneySourceB.hacknet>=1e9,AdditionalUnlock:[O.HACKNET_NODE_10M.ID]},MAX_CACHE:{...O.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:{...O.SLEEVE_8,Icon:"SLEEVE8",Visible:()=>T(y.a,10),Condition:()=>8===y.a.sleeves.length&&3===y.a.sourceFileLvl(10)},INDECISIVE:{...O.INDECISIVE,Icon:"1H",Visible:()=>A(y.a),Condition:function(){let t=0;return setInterval(()=>{_.b.page()===w.a.BitVerse?t++:t=0},6e4),()=>t>60}()},FAST_BN:{...O.FAST_BN,Icon:"2DAYS",Visible:()=>A(y.a),Condition:()=>M()&&y.a.playtimeSinceLastBitnode<1728e5},CHALLENGE_BN1:{...O.CHALLENGE_BN1,Icon:"BN1+",Visible:()=>A(y.a),Condition:()=>1===y.a.bitNodeN&&M()&&y.a.getHomeComputer().maxRam<=128&&1===y.a.getHomeComputer().cpuCores},CHALLENGE_BN2:{...O.CHALLENGE_BN2,Icon:"BN2+",Visible:()=>T(y.a,2),Condition:()=>2===y.a.bitNodeN&&M()&&null===y.a.gang},CHALLENGE_BN3:{...O.CHALLENGE_BN3,Icon:"BN3+",Visible:()=>T(y.a,3),Condition:()=>3===y.a.bitNodeN&&M()&&null===y.a.corporation},CHALLENGE_BN6:{...O.CHALLENGE_BN6,Icon:"BN6+",Visible:()=>T(y.a,6),Condition:()=>6===y.a.bitNodeN&&M()&&null===y.a.bladeburner},CHALLENGE_BN7:{...O.CHALLENGE_BN7,Icon:"BN7+",Visible:()=>T(y.a,7),Condition:()=>7===y.a.bitNodeN&&M()&&null===y.a.bladeburner},CHALLENGE_BN8:{...O.CHALLENGE_BN8,Icon:"BN8+",Visible:()=>T(y.a,8),Condition:()=>8===y.a.bitNodeN&&M()&&!y.a.has4SData&&!y.a.has4SDataTixApi},CHALLENGE_BN9:{...O.CHALLENGE_BN9,Icon:"BN9+",Visible:()=>T(y.a,9),Condition:()=>9===y.a.bitNodeN&&M()&&0===y.a.moneySourceB.hacknet&&0===y.a.moneySourceB.hacknet_expenses},CHALLENGE_BN10:{...O.CHALLENGE_BN10,Icon:"BN10+",Visible:()=>T(y.a,10),Condition:()=>10===y.a.bitNodeN&&M()&&!y.a.sleeves.some(t=>t.augmentations.length>0||t.hacking_exp>0||t.strength_exp>0||t.defense_exp>0||t.agility_exp>0||t.dexterity_exp>0||t.charisma_exp>0)},CHALLENGE_BN12:{...O.CHALLENGE_BN12,Icon:"BN12+",Visible:()=>T(y.a,12),Condition:()=>y.a.sourceFileLvl(12)>=50},BYPASS:{...O.BYPASS,Icon:"SF-1",Secret:!0,Condition:()=>y.a.exploits.includes(l.a.Bypass)},PROTOTYPETAMPERING:{...O.PROTOTYPETAMPERING,Icon:"SF-1",Secret:!0,Condition:()=>y.a.exploits.includes(l.a.PrototypeTampering)},UNCLICKABLE:{...O.UNCLICKABLE,Icon:"SF-1",Secret:!0,Condition:()=>y.a.exploits.includes(l.a.Unclickable)},UNDOCUMENTEDFUNCTIONCALL:{...O.UNDOCUMENTEDFUNCTIONCALL,Icon:"SF-1",Secret:!0,Condition:()=>y.a.exploits.includes(l.a.UndocumentedFunctionCall)},TIMECOMPRESSION:{...O.TIMECOMPRESSION,Icon:"SF-1",Secret:!0,Condition:()=>y.a.exploits.includes(l.a.TimeCompression)},REALITYALTERATION:{...O.REALITYALTERATION,Icon:"SF-1",Secret:!0,Condition:()=>y.a.exploits.includes(l.a.RealityAlteration)},N00DLES:{...O.N00DLES,Icon:"SF-1",Secret:!0,Condition:()=>y.a.exploits.includes(l.a.N00dles)},EDITSAVEFILE:{...O.EDITSAVEFILE,Icon:"SF-1",Secret:!0,Condition:()=>y.a.exploits.includes(l.a.EditSaveFile)},UNACHIEVABLE:{...O.UNACHIEVABLE,Icon:"SF-1",Secret:!0,Condition:()=>!1},CHALLENGE_BN13:{...O.CHALLENGE_BN13,Icon:"BN13+",Visible:()=>T(y.a,13),Condition:()=>13===y.a.bitNodeN&&M()&&!y.a.augmentations.some(t=>t.name===a.a.StaneksGift1)},DEVMENU:{...O.DEVMENU,Icon:"SF-1",Secret:!0,Condition:()=>y.a.exploits.includes(l.a.YoureNotMeantToAccessThis)},RAINBOW:{...O.RAINBOW,Icon:"SF-1",Secret:!0,Condition:()=>y.a.exploits.includes(l.a.INeedARainbow)},TRUE_RECURSION:{...O.TRUE_RECURSION,Icon:"SF-1",Secret:!0,Condition:()=>y.a.exploits.includes(l.a.TrueRecursion)}};function N(){const t=y.a.achievements.map(t=>t.ID),e=Object.values(R).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";n.d(e,"b",(function(){return P})),n.d(e,"a",(function(){return I}));var a=n(0),r=n.n(a),i=n(126),o=n(121),s=n(144),l=n(5),c=n(128),f=n(1179),u=n(22),m=n(148),h=n(149),d=n(30),p=n(50),g=n(1),y=n(8),b=n(111),E=n(467),v=n.n(E),k=n(1183),_=n.n(k),w=n(6),S=n(29),x=n(393),C=n(18),L=n(21),O=n(19),M=n(34);function T(){const t=Object(i.a)(),e=S.b.Player(),n=P();if(0===e.intelligence)return r.a.createElement(r.a.Fragment,null);const a=e.calculateSkillProgress(e.intelligence_exp);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.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,!w.a.DisableOverviewProgressBars&&r.a.createElement(x.a,{progress:a,color:t.colors.int})))}function A(){const t=S.b.Player(),e=P(),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 R({tooltip:t,children:e,onClickFocus:n,header:a}){const i=P();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 N(){const t=S.b.Player(),e=S.b.Router();if(!t.isWorking||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);switch(t.workType){case M.d.CompanyPartTime:case M.d.Company:n=r.a.createElement(r.a.Fragment,null,t.jobs[t.companyName]," at ",r.a.createElement("strong",null,t.companyName)),a=r.a.createElement(r.a.Fragment,null,"Working at ",r.a.createElement("strong",null,t.companyName)),i=r.a.createElement(r.a.Fragment,null,"+",r.a.createElement(c.a,{reputation:t.workRepGained})," rep");break;case M.d.Faction:n=r.a.createElement(r.a.Fragment,null,t.factionWorkType," for ",r.a.createElement("strong",null,t.currentWorkFactionName)),a=r.a.createElement(r.a.Fragment,null,"Working for ",r.a.createElement("strong",null,t.currentWorkFactionName)),i=r.a.createElement(r.a.Fragment,null,"+",r.a.createElement(c.a,{reputation:t.workRepGained})," rep");break;case M.d.StudyClass:n=r.a.createElement(r.a.Fragment,null,t.workType),a=r.a.createElement(r.a.Fragment,null,"You are ",t.className),i=r.a.createElement(r.a.Fragment,null,Object(u.d)(t.timeWorked));break;case M.d.CreateProgram:n=r.a.createElement(r.a.Fragment,null,"Coding ",t.createProgramName),a=r.a.createElement(r.a.Fragment,null,"Creating a program"),i=r.a.createElement(r.a.Fragment,null,t.createProgramName," ",(t.timeWorkedCreateProgram/t.timeNeededToCompleteWork*100).toFixed(2),"%");break;case M.d.GraftAugmentation:n=r.a.createElement(r.a.Fragment,null,"Grafting ",t.graftAugmentationName),a=r.a.createElement(r.a.Fragment,null,"Grafting an Augmentation"),i=r.a.createElement(r.a.Fragment,null,r.a.createElement("strong",null,(t.timeWorkedGraftAugmentation/t.timeNeededToCompleteWork*100).toFixed(2),"%")," ","done")}return r.a.createElement(R,{tooltip:n,header:a,onClickFocus:()=>{t.startFocusing(),e.toWork()}},i)}const P=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 I({save:t,killScripts:e}){const[n,o]=Object(a.useState)(!1),s=S.b.Player(),c=Object(a.useState)(!1)[1];Object(a.useEffect)(()=>{const t=setInterval(()=>c(t=>!t),600);return()=>clearInterval(t)},[]);const u=P(),y=Object(i.a)(),E=s.calculateSkillProgress(s.hacking_exp,s.hacking_mult*C.a.HackingLevelMultiplier),k=s.calculateSkillProgress(s.strength_exp,s.strength_mult*C.a.StrengthLevelMultiplier),M=s.calculateSkillProgress(s.defense_exp,s.defense_mult*C.a.DefenseLevelMultiplier),R=s.calculateSkillProgress(s.dexterity_exp,s.dexterity_mult*C.a.DexterityLevelMultiplier),I=s.calculateSkillProgress(s.agility_exp,s.agility_mult*C.a.AgilityLevelMultiplier),F=s.calculateSkillProgress(s.charisma_exp,s.charisma_mult*C.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)," / ",l.a.formatHp(s.max_hp))),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.hacking)))),r.a.createElement(p.a,null,!w.a.DisableOverviewProgressBars&&r.a.createElement(x.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.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,!w.a.DisableOverviewProgressBars&&r.a.createElement(x.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.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,!w.a.DisableOverviewProgressBars&&r.a.createElement(x.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.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,!w.a.DisableOverviewProgressBars&&r.a.createElement(x.a,{progress:R,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.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,!w.a.DisableOverviewProgressBars&&r.a.createElement(x.a,{progress:I,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.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,!w.a.DisableOverviewProgressBars&&r.a.createElement(x.a,{progress:F,color:y.colors.cha})),r.a.createElement(T,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(N,null),r.a.createElement(A,null))),r.a.createElement(O.a,{sx:{display:"flex",borderTop:"1px solid "+w.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!==w.a.AutosaveInterval?"Save game":"Save game (auto-saves are disabled!)"},r.a.createElement(v.a,{color:0!==w.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(_.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})),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";function a(t,e){if(t.length!==e.length)return!1;for(let n=0;nObject(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,"a",(function(){return _}));var a=n(66),r=n(1366),i=n(230),o=n(18),s=n(86),l=n(67),c=n(238),f=n(95),u=n(10),m=n(185),h=n(26),d=n(188),p=n(15),g=n(9),y=n(28),b=n(59),E=n(5),v=n(22);function k(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class _ extends r.a{constructor(t=null){super(),k(this,"className",""),k(this,"crimeType",""),k(this,"currentTask",a.a.Idle),k(this,"currentTaskLocation",""),k(this,"currentTaskMaxTime",0),k(this,"currentTaskTime",0),k(this,"earningsForSleeves",Object(i.a)()),k(this,"earningsForPlayer",Object(i.a)()),k(this,"earningsForTask",Object(i.a)()),k(this,"factionWorkType",d.a.None),k(this,"gainRatesForTask",Object(i.a)()),k(this,"gymStatType",""),k(this,"bbAction",""),k(this,"bbContract",""),k(this,"logs",[]),k(this,"memory",1),k(this,"shock",1),k(this,"storedCycles",0),k(this,"sync",1),null!=t&&this.shockRecovery(t)}commitCrime(t,e){const n=s.a[e]||Object.values(s.a).find(t=>t.name===e);return!!n&&(this.currentTask!==a.a.Idle?this.finishTask(t):this.resetTaskStatus(t),this.gainRatesForTask.hack=n.hacking_exp*this.hacking_exp_mult*o.a.CrimeExpGain,this.gainRatesForTask.str=n.strength_exp*this.strength_exp_mult*o.a.CrimeExpGain,this.gainRatesForTask.def=n.defense_exp*this.defense_exp_mult*o.a.CrimeExpGain,this.gainRatesForTask.dex=n.dexterity_exp*this.dexterity_exp_mult*o.a.CrimeExpGain,this.gainRatesForTask.agi=n.agility_exp*this.agility_exp_mult*o.a.CrimeExpGain,this.gainRatesForTask.cha=n.charisma_exp*this.charisma_exp_mult*o.a.CrimeExpGain,this.gainRatesForTask.int=n.intelligence_exp,this.gainRatesForTask.money=n.money*this.crime_money_mult*o.a.CrimeMoney,this.currentTaskLocation=String(this.gainRatesForTask.money),this.crimeType=n.name,this.currentTaskMaxTime=n.time,this.currentTask=a.a.Crime,!0)}finishTask(t){let e=Object(i.a)();if(this.currentTask===a.a.Crime){if(this.currentTaskTime>=this.currentTaskMaxTime){const n=Object.values(s.a).find(t=>t.name===this.crimeType);if(!n)return console.error("Invalid data stored in sleeve.crimeType: "+this.crimeType),this.resetTaskStatus(t),e;if(Math.random()=this.currentTaskMaxTime){var n;if("Infiltrate synthoids"===this.bbAction)return a.infiltrateSynthoidCommunities(t),this.currentTaskTime=0,e;let r,i;"Take on contracts"===this.bbAction?(r="Contracts",i=this.bbContract):(r="General",i=this.bbAction);const o=a.getActionIdFromTypeAndName(r,i);if(null===o){const n=`Invalid action: type='${r}' name='${i}'`;return console.error(`Function: sleeves.finishTask; Message: '${n}'`),this.resetTaskStatus(t),e}const s=a.getActionObject(o);if((null!==(n=null==s?void 0:s.count)&&void 0!==n?n:0)>0){const n=a.completeAction(t,this,o,!1);if(n)return e=this.gainExperience(t,n),this.gainMoney(t,n),this.currentTaskTime=0,e}}}return this.resetTaskStatus(t),e}gainExperience(t,e,n=1,a=!1){if(a)return e.hack>0&&(this.hacking_exp+=e.hack),e.str>0&&(this.strength_exp+=e.str),e.def>0&&(this.defense_exp+=e.def),e.dex>0&&(this.dexterity_exp+=e.dex),e.agi>0&&(this.agility_exp+=e.agi),e.cha>0&&(this.charisma_exp+=e.cha),Object(i.a)();const r=this.shock/100*(this.sync/100)*n,o=e.hack*r,s=e.str*r,l=e.def*r,c=e.dex*r,f=e.agi*r,u=e.cha*r,m=e.int*r;return o>0&&(this.gainHackingExp(o),t.gainHackingExp(o),this.earningsForPlayer.hack+=o,this.earningsForTask.hack+=o),s>0&&(this.gainStrengthExp(s),t.gainStrengthExp(s),this.earningsForPlayer.str+=s,this.earningsForTask.str+=s),l>0&&(this.gainDefenseExp(l),t.gainDefenseExp(l),this.earningsForPlayer.def+=l,this.earningsForTask.def+=l),c>0&&(this.gainDexterityExp(c),t.gainDexterityExp(c),this.earningsForPlayer.dex+=c,this.earningsForTask.dex+=c),f>0&&(this.gainAgilityExp(f),t.gainAgilityExp(f),this.earningsForPlayer.agi+=f,this.earningsForTask.agi+=f),u>0&&(this.gainCharismaExp(u),t.gainCharismaExp(u),this.earningsForPlayer.cha+=u,this.earningsForTask.cha+=u),m>0&&(this.gainIntelligenceExp(m),t.gainIntelligenceExp(m)),this.earningsForSleeves.hack+=o*(this.sync/100),this.earningsForSleeves.str+=s*(this.sync/100),this.earningsForSleeves.def+=l*(this.sync/100),this.earningsForSleeves.dex+=c*(this.sync/100),this.earningsForSleeves.agi+=f*(this.sync/100),this.earningsForSleeves.cha+=u*(this.sync/100),{hack:o*(this.sync/100),str:s*(this.sync/100),def:l*(this.sync/100),dex:c*(this.sync/100),agi:f*(this.sync/100),cha:u*(this.sync/100),int:m*(this.sync/100),money:e.money}}gainMoney(t,e,n=1){const a=e.money*n;this.earningsForTask.money+=a,this.earningsForPlayer.money+=a,t.gainMoney(a,"sleeves")}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;e50&&this.logs.shift()}prestige(t){this.hacking_exp=0,this.strength_exp=0,this.defense_exp=0,this.dexterity_exp=0,this.agility_exp=0,this.charisma_exp=0,this.resetTaskStatus(t),this.earningsForSleeves=Object(i.a)(),this.earningsForPlayer=Object(i.a)(),this.shockRecovery(t),this.augmentations=[],this.resetMultipliers(),this.city=p.a.Sector12,this.shock=1,this.storedCycles=0,this.sync=Math.max(this.memory,1),this.logs=[]}process(t,e=1){const n=1e3/u.a.MilliPerCycle;if(this.storedCycles+=e,this.storedCyclesthis.currentTaskMaxTime&&(o=this.currentTaskMaxTime-this.currentTaskTime,r=Math.floor(o/u.a.MilliPerCycle),(o<0||r<0)&&(console.warn("Sleeve.process() calculated negative cycle usage"),o=0,r=0)),this.currentTaskTime+=o,this.shock=Math.min(100,this.shock+1e-4*r);let s=Object(i.a)();switch(this.currentTask){case a.a.Idle:break;case a.a.Class:case a.a.Gym:this.updateTaskGainRates(t),s=this.gainExperience(t,this.gainRatesForTask,r),this.gainMoney(t,this.gainRatesForTask,r);break;case a.a.Faction:{s=this.gainExperience(t,this.gainRatesForTask,r),this.gainMoney(t,this.gainRatesForTask,r);const e=h.a[this.currentTaskLocation];if(!(e instanceof m.a)){console.error("Invalid faction for Sleeve task: "+this.currentTaskLocation);break}t.gang&&e.name===t.gang.facName&&this.resetTaskStatus(t),e.playerReputation+=this.getRepGain(t)*r;break}case a.a.Company:{s=this.gainExperience(t,this.gainRatesForTask,r),this.gainMoney(t,this.gainRatesForTask,r);const e=l.a[this.currentTaskLocation];if(!(e instanceof c.a)){console.error("Invalid company for Sleeve task: "+this.currentTaskLocation);break}e.playerReputation+=this.getRepGain(t)*r;break}case a.a.Recovery:this.shock=Math.min(100,this.shock+2e-4*r),this.shock>=100&&this.resetTaskStatus(t);break;case a.a.Synchro:this.sync=Math.min(100,this.sync+2e-4*t.getIntelligenceBonus(.5)*r),this.sync>=100&&this.resetTaskStatus(t)}return 0!==this.currentTaskMaxTime&&this.currentTaskTime>=this.currentTaskMaxTime&&(this.currentTask===a.a.Crime||this.currentTask===a.a.Bladeburner?s=this.finishTask(t):this.finishTask(t)),this.updateStatLevels(),this.storedCycles-=r,s}resetTaskStatus(t){var e;"Support main sleeve"==this.bbAction&&(null===(e=t.bladeburner)||void 0===e||e.sleeveSupport(!1));if(this.currentTask==a.a.Class){const e=Object(i.a)();e.int=u.a.IntelligenceClassBaseExpGain*Math.round(this.currentTaskTime/1e3);const n=this.gainExperience(t,e);t.sleeves.filter(t=>t!=this).forEach(e=>e.gainExperience(t,n,1,!0))}this.earningsForTask=Object(i.a)(),this.gainRatesForTask=Object(i.a)(),this.currentTask=a.a.Idle,this.currentTaskTime=0,this.currentTaskMaxTime=0,this.factionWorkType=d.a.None,this.crimeType="",this.currentTaskLocation="",this.gymStatType="",this.className="",this.bbAction="",this.bbContract="------"}shockRecovery(t){return this.currentTask!==a.a.Idle?this.finishTask(t):this.resetTaskStatus(t),this.currentTask=a.a.Recovery,!0}synchronize(t){return this.currentTask!==a.a.Idle?this.finishTask(t):this.resetTaskStatus(t),this.currentTask=a.a.Synchro,!0}takeUniversityCourse(t,e,n){this.currentTask!==a.a.Idle?this.finishTask(t):this.resetTaskStatus(t);let r=1;switch(e.toLowerCase()){case g.a.AevumSummitUniversity.toLowerCase():if(this.city!==p.a.Aevum)return!1;this.currentTaskLocation=g.a.AevumSummitUniversity,r=4;break;case g.a.Sector12RothmanUniversity.toLowerCase():if(this.city!==p.a.Sector12)return!1;this.currentTaskLocation=g.a.Sector12RothmanUniversity,r=3;break;case g.a.VolhavenZBInstituteOfTechnology.toLowerCase():if(this.city!==p.a.Volhaven)return!1;this.currentTaskLocation=g.a.VolhavenZBInstituteOfTechnology,r=5;break;default:return!1}switch(n.toLowerCase()){case"study computer science":break;case"data structures":this.gainRatesForTask.money=u.a.ClassDataStructuresBaseCost*r*-1;break;case"networks":this.gainRatesForTask.money=u.a.ClassNetworksBaseCost*r*-1;break;case"algorithms":this.gainRatesForTask.money=u.a.ClassAlgorithmsBaseCost*r*-1;break;case"management":this.gainRatesForTask.money=u.a.ClassManagementBaseCost*r*-1;break;case"leadership":this.gainRatesForTask.money=u.a.ClassLeadershipBaseCost*r*-1;break;default:return!1}return this.className=n,this.currentTask=a.a.Class,!0}travel(t,e){return t.loseMoney(u.a.TravelCost,"sleeves"),this.city=e,!0}tryBuyAugmentation(t,e){return!!t.canAfford(e.baseCost)&&(!this.augmentations.some(t=>t.name===e.name)&&(t.loseMoney(e.baseCost,"sleeves"),this.installAugmentation(e),!0))}updateTaskGainRates(t){if(this.currentTask!==a.a.Class)if(this.currentTask!==a.a.Gym)console.warn("Sleeve.updateTaskGainRates() called for unexpected task type "+this.currentTask);else{let e=1;switch(this.currentTaskLocation.toLowerCase()){case g.a.AevumCrushFitnessGym.toLowerCase():e=2;break;case g.a.AevumSnapFitnessGym.toLowerCase():e=5;break;case g.a.Sector12IronGym.toLowerCase():e=1;break;case g.a.Sector12PowerhouseGym.toLowerCase():e=10;break;case g.a.VolhavenMilleniumFitnessGym.toLowerCase():e=4;break;default:return}const n=1,a=t.hashManager.getTrainingMult()*e,r=this.gymStatType.toLowerCase();r.includes("str")?this.gainRatesForTask.str=n*a*this.strength_exp_mult:r.includes("def")?this.gainRatesForTask.def=n*a*this.defense_exp_mult:r.includes("dex")?this.gainRatesForTask.dex=n*a*this.dexterity_exp_mult:r.includes("agi")&&(this.gainRatesForTask.agi=n*a*this.agility_exp_mult)}else{let e=1;switch(this.currentTaskLocation.toLowerCase()){case g.a.AevumSummitUniversity.toLowerCase():e=3;break;case g.a.Sector12RothmanUniversity.toLowerCase():e=2;break;case g.a.VolhavenZBInstituteOfTechnology.toLowerCase():e=4;break;default:return}const n=e*t.hashManager.getStudyMult();switch(this.className.toLowerCase()){case"study computer science":this.gainRatesForTask.hack=u.a.ClassStudyComputerScienceBaseExp*n*this.hacking_exp_mult;break;case"data structures":this.gainRatesForTask.hack=u.a.ClassDataStructuresBaseExp*n*this.hacking_exp_mult;break;case"networks":this.gainRatesForTask.hack=u.a.ClassNetworksBaseExp*n*this.hacking_exp_mult;break;case"algorithms":this.gainRatesForTask.hack=u.a.ClassAlgorithmsBaseExp*n*this.hacking_exp_mult;break;case"management":this.gainRatesForTask.cha=u.a.ClassManagementBaseExp*n*this.charisma_exp_mult;break;case"leadership":this.gainRatesForTask.cha=u.a.ClassLeadershipBaseExp*n*this.charisma_exp_mult}}}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(!(l.a[e]instanceof c.a)||null==t.jobs[e])return!1;this.currentTask!==a.a.Idle?this.finishTask(t):this.resetTaskStatus(t);const n=l.a[e],r=f.a[t.jobs[e]];return null!=n&&(null!=r&&(this.gainRatesForTask.money=r.baseSalary*n.salaryMultiplier*this.work_money_mult*o.a.CompanyWorkMoney,this.gainRatesForTask.hack=r.hackingExpGain*n.expMultiplier*this.hacking_exp_mult*o.a.CompanyWorkExpGain,this.gainRatesForTask.str=r.strengthExpGain*n.expMultiplier*this.strength_exp_mult*o.a.CompanyWorkExpGain,this.gainRatesForTask.def=r.defenseExpGain*n.expMultiplier*this.defense_exp_mult*o.a.CompanyWorkExpGain,this.gainRatesForTask.dex=r.dexterityExpGain*n.expMultiplier*this.dexterity_exp_mult*o.a.CompanyWorkExpGain,this.gainRatesForTask.agi=r.agilityExpGain*n.expMultiplier*this.agility_exp_mult*o.a.CompanyWorkExpGain,this.gainRatesForTask.cha=r.charismaExpGain*n.expMultiplier*this.charisma_exp_mult*o.a.CompanyWorkExpGain,this.currentTaskLocation=e,this.currentTask=a.a.Company,!0))}workForFaction(t,e,n){const r=h.a[e];if(!(""!==e&&r&&r instanceof m.a&&t.factions.includes(e)))return!1;this.currentTask!==a.a.Idle?this.finishTask(t):this.resetTaskStatus(t);const i=r.getInfo(),s=n.toLowerCase();if(s.includes("hack")){if(!i.offerHackingWork)return!1;this.factionWorkType=d.a.Hacking,this.gainRatesForTask.hack=.15*this.hacking_exp_mult*o.a.FactionWorkExpGain}else if(s.includes("field")){if(!i.offerFieldWork)return!1;this.factionWorkType=d.a.Field,this.gainRatesForTask.hack=.1*this.hacking_exp_mult*o.a.FactionWorkExpGain,this.gainRatesForTask.str=.1*this.strength_exp_mult*o.a.FactionWorkExpGain,this.gainRatesForTask.def=.1*this.defense_exp_mult*o.a.FactionWorkExpGain,this.gainRatesForTask.dex=.1*this.dexterity_exp_mult*o.a.FactionWorkExpGain,this.gainRatesForTask.agi=.1*this.agility_exp_mult*o.a.FactionWorkExpGain,this.gainRatesForTask.cha=.1*this.charisma_exp_mult*o.a.FactionWorkExpGain}else{if(!s.includes("security"))return!1;if(!i.offerSecurityWork)return!1;this.factionWorkType=d.a.Security,this.gainRatesForTask.hack=.1*this.hacking_exp_mult*o.a.FactionWorkExpGain,this.gainRatesForTask.str=.15*this.strength_exp_mult*o.a.FactionWorkExpGain,this.gainRatesForTask.def=.15*this.defense_exp_mult*o.a.FactionWorkExpGain,this.gainRatesForTask.dex=.15*this.dexterity_exp_mult*o.a.FactionWorkExpGain,this.gainRatesForTask.agi=.15*this.agility_exp_mult*o.a.FactionWorkExpGain}return this.currentTaskLocation=e,this.currentTask=a.a.Faction,!0}workoutAtGym(t,e,n){this.currentTask!==a.a.Idle?this.finishTask(t):this.resetTaskStatus(t);let r=1;switch(e.toLowerCase()){case g.a.AevumCrushFitnessGym.toLowerCase():if(this.city!=p.a.Aevum)return!1;this.currentTaskLocation=g.a.AevumCrushFitnessGym,r=3;break;case g.a.AevumSnapFitnessGym.toLowerCase():if(this.city!=p.a.Aevum)return!1;this.currentTaskLocation=g.a.AevumSnapFitnessGym,r=10;break;case g.a.Sector12IronGym.toLowerCase():if(this.city!=p.a.Sector12)return!1;this.currentTaskLocation=g.a.Sector12IronGym,r=1;break;case g.a.Sector12PowerhouseGym.toLowerCase():if(this.city!=p.a.Sector12)return!1;this.currentTaskLocation=g.a.Sector12PowerhouseGym,r=20;break;case g.a.VolhavenMilleniumFitnessGym.toLowerCase():if(this.city!=p.a.Volhaven)return!1;this.currentTaskLocation=g.a.VolhavenMilleniumFitnessGym,r=7;break;default:return!1}const i=n.toLowerCase();return this.gainRatesForTask.money=u.a.ClassGymBaseCost*r*-1,!!(i.includes("str")||i.includes("def")||i.includes("dex")||i.includes("agi"))&&(this.gymStatType=n,this.currentTask=a.a.Gym,!0)}bladeburner(t,e,n){var r,i,o;this.currentTask!==a.a.Idle?this.finishTask(t):this.resetTaskStatus(t),this.gainRatesForTask.hack=0,this.gainRatesForTask.str=0,this.gainRatesForTask.def=0,this.gainRatesForTask.dex=0,this.gainRatesForTask.agi=0,this.gainRatesForTask.cha=0,this.gainRatesForTask.money=0,this.currentTaskLocation="";let s=0;switch(this.bbContract="------",e){case"Field analysis":s=this.getBladeburnerActionTime(t,"General",e),this.gainRatesForTask.hack=20*this.hacking_exp_mult,this.gainRatesForTask.cha=20*this.charisma_exp_mult;break;case"Recruitment":s=this.getBladeburnerActionTime(t,"General",e),this.gainRatesForTask.cha=2*b.a.BaseStatGain*(null!==(r=null===(i=t.bladeburner)||void 0===i?void 0:i.getRecruitmentTime(this))&&void 0!==r?r:0)*1e3,this.currentTaskLocation=`(Success Rate: ${E.a.formatPercentage(this.recruitmentSuccessChance(t))})`;break;case"Diplomacy":s=this.getBladeburnerActionTime(t,"General",e);break;case"Infiltrate synthoids":s=6e4,this.currentTaskLocation="This will generate additional contracts and operations";break;case"Support main sleeve":null===(o=t.bladeburner)||void 0===o||o.sleeveSupport(!0),s=0;break;case"Take on contracts":s=this.getBladeburnerActionTime(t,"Contracts",n),this.contractGainRates(t,"Contracts",n),this.currentTaskLocation=this.contractSuccessChance(t,"Contracts",n),this.bbContract=Object(v.a)(n.toLowerCase())}return this.bbAction=Object(v.b)(e.toLowerCase()),this.currentTaskMaxTime=s,this.currentTask=a.a.Bladeburner,!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%":`${E.a.formatPercentage(r[0])} - ${E.a.formatPercentage(r[1])}`}contractGainRates(t,e,n){const a=t.bladeburner;if(null===a){const t="bladeburner is null";return void console.error(`Function: sleeves.contractGainRates; Message: '${t}'`)}const r=a.getActionIdFromTypeAndName(e,n);if(null===r){const a=`Invalid action: type='${e}' name='${n}'`;return console.error(`Function: sleeves.contractGainRates; Message: '${a}'`),void this.resetTaskStatus(t)}const i=a.getActionObject(r);if(null===i){const a=`Invalid action: type='${e}' name='${n}'`;return console.error(`Function: sleeves.contractGainRates; Message: '${a}'`),void this.resetTaskStatus(t)}const o=a.getActionStats(i,!0);this.gainRatesForTask.hack=o.hack,this.gainRatesForTask.str=o.str,this.gainRatesForTask.def=o.def,this.gainRatesForTask.dex=o.dex,this.gainRatesForTask.agi=o.agi,this.gainRatesForTask.cha=o.cha;const s=Math.pow(i.rewardFac,i.level-1);this.gainRatesForTask.money=b.a.ContractBaseMoneyGain*s*a.skillMultipliers.money}getBladeburnerActionTime(t,e,n){const a=t.bladeburner;if(null===a){const t="bladeburner is null";return console.error(`Function: sleeves.getBladeburnerActionTime; Message: '${t}'`),-1}const r=a.getActionTimeNetscriptFn(this,e,n);if("string"==typeof r){const t=`Invalid action: type='${e}' name='${n}'`;return console.error(`Function: sleeves.getBladeburnerActionTime; Message: '${t}'`),-1}return r}takeDamage(t){return"number"!=typeof t?(console.warn("Player.takeDamage() called without a numeric argument: "+t),!1):(this.hp-=t,this.hp<=0&&(this.shock+=.5,this.hp=this.max_hp,!0))}whoAmI(){return"Sleeve"}toJSON(){return Object(y.b)("Sleeve",this)}static fromJSON(t){return Object(y.a)(_,t.data)}}y.c.constructors.Sleeve=_},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",t[t.URLImportError=-3]="URLImportError"}(a||(a={}))},function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i}));var a=n(125);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(245),r=n(153),i=n(117),o=n(75),s=n(5),l=n(20),c=n(14),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(125),o=n(38),s=n(1),l=n(19),c=n(766);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)?(console.log("Duplicate message"),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(544);const r=()=>`${Object(a.a)(99)}.${Object(a.a)(9)}.${Object(a.a)(9)}.${Object(a.a)(9)}`},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(){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(290),r=n(12),i=n(90),o=n(65),s=n(2),l=n(25),c=n(24),f=n(88),u=n(6),m=n(14),h=n(4),d=n(46);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.hacking>=t.requiredHackingSkill?p(k,0===s.a.sourceFiles.length):y(b)||p(b)}else if(!y(t)&&s.a.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.hacking>=40?p(e):!y(m)&&s.a.hacking>=50?p(m):!y(n)&&s.a.hacking>=175?p(n):!y(h)&&s.a.hacking>=200?p(h):!y(a)&&s.a.hacking>=350?p(a):!y(u)&&s.a.hacking>=490?p(u):!y(g)&&s.a.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";function a(t){const e=25e3*(Math.pow(1.02,t)-1);return Math.round(1e4*e)/1e4}function r(t){const e=Math.log(t/25e3+1)/Math.log(1.02);return Math.round(1e4*e)/1e4}n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"b",(function(){return f})),n.d(e,"c",(function(){return u})),n.d(e,"a",(function(){return m}));var a=n(116),r=n(26),i=n(2),o=n(24),s=n(88),l=n(46),c=n(33);function f(){const t=h(),e=d(),n=p(),r=g(n,e),i=new a.a(r,t,e);n.addContract(i)}function u(){const t=h(),e=d(),n=i.a.getHomeComputer(),r=g(n,e),o=new a.a(r,t,e);n.addContract(o)}function m(t){let e;const n=Object.keys(a.d);e=null!=t.problemType&&n.includes(t.problemType)?t.problemType:h();const r=d();let i,s;null!=t.server?(i=Object(o.d)(t.server),null==i&&(i=p())):i=p(),s=null!=t.fn?t.fn:g(i,r);const l=new a.a(s,e,r);i.addContract(l)}function h(){const t=Object.keys(a.d);return t[Object(c.a)(0,t.length-1)]}function d(){const t={name:"",type:Object(c.a)(0,a.c.Money)};t.type=function(t){let e=t;const n=i.a.factions.filter(t=>{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(26);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 l}));var a=n(0),r=n(1),i=n(8),o=n(45),s=n(19);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(59),r=n(460),i=n(28);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(35),r=n(12),i=n(2),o=n(65),s=n(314),l=n(0),c=n.n(l),f=n(4),u=n(10);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_mult:1.08,defense_mult:1.08,agility_mult:1.08,dexterity_mult: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_mult: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_mult: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_mult: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_mult:1.5,strength_mult: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_mult:1.3,defense_mult: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_mult:1.1,defense_mult: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_mult:1.14,defense_mult: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_mult:1.18,defense_mult: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_mult:1.2,defense_mult: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_mult: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_mult:1.05,dexterity_mult: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_mult:1.7,defense_mult: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_mult:1.15,defense_mult:1.15,agility_mult:1.15,dexterity_mult: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_mult:1.6,defense_mult:1.6,agility_mult:1.6,dexterity_mult: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_mult: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_mult: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_mult: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_mult:1.15,charisma_exp_mult: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_mult:1.6,charisma_exp_mult: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_mult: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_mult:1.03,hacking_money_mult:1.15,hacking_mult: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_mult:1.02,hacking_chance_mult:1.05,hacking_exp_mult: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_mult:1.03,hacking_exp_mult:1.1,hacking_mult: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_mult: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_mult: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_mult: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_mult: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_mult:1.03,hacking_money_mult:1.1,hacking_chance_mult:1.03,hacking_exp_mult:1.07,hacking_mult: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_mult:1.05,hacking_money_mult:1.3,hacking_chance_mult:1.05,hacking_exp_mult:1.15,hacking_mult: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_mult:1.05,hacking_money_mult:1.4,hacking_chance_mult:1.1,hacking_exp_mult:1.25,hacking_mult: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_mult: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_mult:1.4,hacking_chance_mult: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_mult:1.02,hacking_chance_mult:1.1,hacking_exp_mult: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_mult:1.1,hacking_exp_mult:1.15,hacking_money_mult: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_mult:1.01,hacking_mult: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_mult:1.02,hacking_chance_mult:1.05,hacking_mult: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_mult:1.02,hacking_money_mult:1.15,hacking_mult: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_mult:1.02,hacking_money_mult:1.2,hacking_grow_mult: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_mult:1.3,hacking_money_mult:1.25,hacking_grow_mult: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_mult:1.15,hacking_exp_mult:1.1,hacking_speed_mult: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_mult: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_mult:1.1,charisma_mult: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_mult:1.05,strength_exp_mult:1.05,defense_exp_mult:1.05,dexterity_exp_mult:1.05,agility_exp_mult:1.05,charisma_exp_mult:1.05,company_rep_mult:1.1,work_money_mult: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_mult:1.3,hacking_mult: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_mult:1.75,hacking_mult: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_mult:2,hacking_mult:1.1,hacking_speed_mult: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_mult:1.1,faction_rep_mult: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_mult:1.2,faction_rep_mult: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_mult:1.15,faction_rep_mult: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_mult:1.15,hacknet_node_purchase_cost_mult:.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_mult:1.1,hacknet_node_level_cost_mult:.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_mult:1.1,hacknet_node_purchase_cost_mult:.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_mult: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_mult: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_mult:1.1,strength_exp_mult:1.1,defense_exp_mult:1.1,dexterity_exp_mult:1.1,agility_exp_mult:1.1,charisma_exp_mult: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_mult:1.15,strength_exp_mult:1.15,defense_exp_mult:1.15,dexterity_exp_mult:1.15,agility_exp_mult:1.15,charisma_exp_mult: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_mult:1.2,strength_exp_mult:1.2,defense_exp_mult:1.2,dexterity_exp_mult:1.2,agility_exp_mult:1.2,charisma_exp_mult: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_mult:1.4,hacking_speed_mult:1.03,hacking_money_mult: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_mult:1.05,crime_money_mult: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_mult:1.1,defense_mult:1.1,crime_money_mult: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_mult:1.1,dexterity_exp_mult:1.15,crime_money_mult: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_mult:1.05,strength_mult:1.05,defense_mult:1.05,dexterity_mult:1.05,agility_mult:1.05,charisma_mult:1.05,hacking_exp_mult:1.1,strength_exp_mult:1.1,defense_exp_mult:1.1,dexterity_exp_mult:1.1,agility_exp_mult:1.1,charisma_exp_mult: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_mult:1.75,hacking_speed_mult:2,hacking_chance_mult:2.5,hacking_money_mult: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_mult:1.75,defense_mult:1.75,dexterity_mult:1.75,agility_mult:1.75,hacking_mult: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_mult: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_mult:1.35,defense_mult:1.35,dexterity_mult:1.35,agility_mult:1.35,strength_exp_mult:1.35,defense_exp_mult:1.35,dexterity_exp_mult:1.35,agility_exp_mult: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_mult:1.5,charisma_exp_mult:1.5,company_rep_mult:1.25,faction_rep_mult: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_mult:1.55,defense_mult: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_mult:1.2,strength_mult:1.2,defense_mult:1.2,dexterity_mult:1.2,agility_mult:1.2,charisma_mult:1.2,hacking_exp_mult:1.15,strength_exp_mult:1.15,defense_exp_mult:1.15,dexterity_exp_mult:1.15,agility_exp_mult:1.15,charisma_exp_mult: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_mult: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_mult:1.2,strength_mult:1.2,defense_mult:1.2,dexterity_mult:1.2,agility_mult:1.2,charisma_mult: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_mult:1.2,hacking_exp_mult: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_mult:1.4,defense_mult:1.4,agility_mult: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_mult:1.15,hacking_exp_mult:1.2,hacking_chance_mult:1.1,hacking_speed_mult: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_mult:1.15,dexterity_mult:1.15,hacking_mult:1.1,hacking_speed_mult:1.02,hacking_money_mult: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_mult:1.08,hacking_exp_mult: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_mult: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_mult:1.2,defense_exp_mult:1.2,dexterity_exp_mult:1.2,agility_exp_mult: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_mult:1.0777,charisma_exp_mult:1.0777,work_money_mult:1.777,faction_rep_mult:1.0777,company_rep_mult:1.0777,crime_success_mult:1.0777,crime_money_mult: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_mult:1.25,crime_money_mult:1.1,dexterity_mult: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_mult: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_mult:1.4,defense_mult:1.4,crime_success_mult:1.1,crime_money_mult: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_mult:1.85,dexterity_mult: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_mult:1.15,defense_mult:1.15,crime_success_mult:1.1,crime_money_mult: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_mult:1.3,dexterity_mult: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_mult:1.1,company_rep_mult:1.15,faction_rep_mult: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_mult:1.03,dexterity_mult: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_mult:1.03,bladeburner_analysis_mult:1.05,bladeburner_stamina_gain_mult: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_mult:1.05,strength_mult:1.05,dexterity_mult:1.05,bladeburner_success_chance_mult: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_mult: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_mult: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_mult:1.07,defense_mult:1.07,dexterity_mult:1.07,agility_mult:1.07,bladeburner_stamina_gain_mult: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_mult:1.1,bladeburner_analysis_mult:1.1,bladeburner_success_chance_mult: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_mult:1.1,dexterity_exp_mult:1.1,bladeburner_analysis_mult:1.15,bladeburner_success_chance_mult: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_mult:1.05,defense_exp_mult:1.05,dexterity_exp_mult:1.05,agility_exp_mult:1.05,bladeburner_max_stamina_mult: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_mult:1.05,bladeburner_max_stamina_mult:1.05,bladeburner_stamina_gain_mult: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_mult:1.04,defense_mult:1.04,dexterity_mult:1.04,agility_mult:1.04,bladeburner_stamina_gain_mult:1.02,bladeburner_success_chance_mult: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_mult:1.05,bladeburner_stamina_gain_mult:1.02,bladeburner_max_stamina_mult: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_mult:1.05,bladeburner_success_chance_mult: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_mult: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_mult: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_mult:1.15,bladeburner_success_chance_mult: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_mult:.9,hacking_speed_mult:.9,hacking_money_mult:.9,hacking_grow_mult:.9,hacking_mult:.9,strength_mult:.9,defense_mult:.9,dexterity_mult:.9,agility_mult:.9,charisma_mult:.9,hacking_exp_mult:.9,strength_exp_mult:.9,defense_exp_mult:.9,dexterity_exp_mult:.9,agility_exp_mult:.9,charisma_exp_mult:.9,company_rep_mult:.9,faction_rep_mult:.9,crime_money_mult:.9,crime_success_mult:.9,hacknet_node_money_mult:.9,hacknet_node_purchase_cost_mult:1.1,hacknet_node_ram_cost_mult:1.1,hacknet_node_core_cost_mult:1.1,hacknet_node_level_cost_mult:1.1,work_money_mult:.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_mult:.95/.9,hacking_speed_mult:.95/.9,hacking_money_mult:.95/.9,hacking_grow_mult:.95/.9,hacking_mult:.95/.9,strength_mult:.95/.9,defense_mult:.95/.9,dexterity_mult:.95/.9,agility_mult:.95/.9,charisma_mult:.95/.9,hacking_exp_mult:.95/.9,strength_exp_mult:.95/.9,defense_exp_mult:.95/.9,dexterity_exp_mult:.95/.9,agility_exp_mult:.95/.9,charisma_exp_mult:.95/.9,company_rep_mult:.95/.9,faction_rep_mult:.95/.9,crime_money_mult:.95/.9,crime_success_mult:.95/.9,hacknet_node_money_mult:.95/.9,hacknet_node_purchase_cost_mult:1.05/1.1,hacknet_node_ram_cost_mult:1.05/1.1,hacknet_node_core_cost_mult:1.05/1.1,hacknet_node_level_cost_mult:1.05/1.1,work_money_mult:.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_mult:1/.95,hacking_speed_mult:1/.95,hacking_money_mult:1/.95,hacking_grow_mult:1/.95,hacking_mult:1/.95,strength_mult:1/.95,defense_mult:1/.95,dexterity_mult:1/.95,agility_mult:1/.95,charisma_mult:1/.95,hacking_exp_mult:1/.95,strength_exp_mult:1/.95,defense_exp_mult:1/.95,dexterity_exp_mult:1/.95,agility_exp_mult:1/.95,charisma_exp_mult:1/.95,company_rep_mult:1/.95,faction_rep_mult:1/.95,crime_money_mult:1/.95,crime_success_mult:1/.95,hacknet_node_money_mult:1/.95,hacknet_node_purchase_cost_mult:1/1.05,hacknet_node_ram_cost_mult:1/1.05,hacknet_node_core_cost_mult:1/1.05,hacknet_node_level_cost_mult:1/1.05,work_money_mult: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_mult:1.01+t,hacking_speed_mult:1.01+t,hacking_money_mult:1.01+t,hacking_grow_mult:1.01+t,hacking_mult:1.01+t,strength_mult:1.01+t,defense_mult:1.01+t,dexterity_mult:1.01+t,agility_mult:1.01+t,charisma_mult:1.01+t,hacking_exp_mult:1.01+t,strength_exp_mult:1.01+t,defense_exp_mult:1.01+t,dexterity_exp_mult:1.01+t,agility_exp_mult:1.01+t,charisma_exp_mult:1.01+t,company_rep_mult:1.01+t,faction_rep_mult:1.01+t,crime_money_mult:1.01+t,crime_success_mult:1.01+t,hacknet_node_money_mult:1.01+t,hacknet_node_purchase_cost_mult:1/(1.01+t),hacknet_node_ram_cost_mult:1/(1.01+t),hacknet_node_core_cost_mult:1/(1.01+t),hacknet_node_level_cost_mult:1/(1.01+t),work_money_mult: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_mult:1.25,hacking_speed_mult:1.1,hacking_money_mult:1.25,hacking_grow_mult: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_mult:1.15,hacking_exp_mult:2},description:"Increases the player's hacking skill by 15%.
Increases the player's hacking experience gain rate by 100%."},{bonuses:{strength_mult:1.25,strength_exp_mult:2,defense_mult:1.25,defense_exp_mult:2,dexterity_mult:1.25,dexterity_exp_mult:2,agility_mult:1.25,agility_exp_mult: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_mult:1.5,charisma_exp_mult: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_mult:1.2,hacknet_node_purchase_cost_mult:.85,hacknet_node_ram_cost_mult:.85,hacknet_node_core_cost_mult:.85,hacknet_node_level_cost_mult:.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_mult:1.25,faction_rep_mult:1.15,work_money_mult: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_mult:2,crime_money_mult: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(4),r=n(9),i=n(64),o=n(88);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,"a",(function(){return i}));var a=n(10),r=n(31);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,"a",(function(){return l}));var a=n(6),r=n(84),i=n(28),o=n(375);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;tH4CK||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,"a",(function(){return o}));var a=n(241),r=n(28);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){const e=this.getUpgrade(t),n=this.upgrades[t];return null==e||null==n?(console.error("Invalid Upgrade Name given to HashManager.getUpgradeCost(): "+t),1/0):e.getCost(n)}prestige(){for(const t of Object.keys(a.a))this.upgrades[t]=0;this.hashes=0,this.updateCapacity(0)}refundUpgrade(t){const e=a.a[t];--this.upgrades[t];const n=this.upgrades[t];if(null==e||null==n||n<0)return void console.error("Invalid Upgrade Name given to HashManager.upgrade(): "+t);const r=e.getCost(n);this.hashes+=r}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){if(null==a.a[t])return console.error("Invalid Upgrade Name given to HashManager.upgrade(): "+t),!1;const e=this.getUpgradeCost(t);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)}this.calculateTotalEmployees(),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);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));const i=n.hasResearch("AutoBrew"),o=n.hasResearch("AutoPartyManager");let s=0;for(let e=0;en.pos===t?e+1:e,0);for(const r of this.employees){if(n==e)return!0;r.pos===a.a.Unassigned&&n<=e?(r.pos=t,n++):r.pos===t&&n>=e&&(r.pos=a.a.Unassigned,n--)}return n===e}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 upgrades 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";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(18),r=n(602),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(28);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";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i}));var a=n(10);function r(t){return t.money<0?0:Math.min(.1*t.money,(t.max_hp-t.hp)*a.a.HospitalCostPerHp)}function i(t,e){const n=t.hp;t.hp-=e;const a=r(t);return t.hp=n,a}},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(125),o=n(38),s=n(1),l=n(8),c=n(130),f=n(76),u=n(74),m=n(27);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;const[i,o]=Object(a.useState)("");return 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=>{o(t.target.value)},value:i,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===(n=t.options)||void 0===n?void 0:n.choices)||[])),r.a.createElement(l.a,{onClick:()=>e(i),disabled:""===i},"Confirm")))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(47),r=n(179),i=n(1052),o=n(546),s=n(28),l=n(33);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,"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=1,e=1){this.fin||(this.prog+=.01*t*e)}finishProduct(t,e){this.fin=!0;const n=t[a.a.Engineer]/t.total,i=t[a.a.Management]/t.total,o=t[a.a.RandD]/t.total,s=t[a.a.Operations]/t.total,c=t[a.a.Business]/t.total,f=(1.2*n+.9*i+1.3*o+1.5*s+c)*(1+Math.pow(this.designCost,.1)/100)*(1+Math.pow(e.sciResearch.qty,e.sciFac)/800);this.qlt=f*(.1*t[a.a.Engineer]+.05*t[a.a.Management]+.05*t[a.a.RandD]+.02*t[a.a.Operations]+.02*t[a.a.Business]),this.per=f*(.15*t[a.a.Engineer]+.02*t[a.a.Management]+.02*t[a.a.RandD]+.02*t[a.a.Operations]+.02*t[a.a.Business]),this.dur=f*(.05*t[a.a.Engineer]+.02*t[a.a.Management]+.08*t[a.a.RandD]+.05*t[a.a.Operations]+.05*t[a.a.Business]),this.rel=f*(.02*t[a.a.Engineer]+.08*t[a.a.Management]+.02*t[a.a.RandD]+.05*t[a.a.Operations]+.08*t[a.a.Business]),this.aes=f*(0*t[a.a.Engineer]+.08*t[a.a.Management]+.05*t[a.a.RandD]+.02*t[a.a.Operations]+.1*t[a.a.Business]),this.fea=f*(.08*t[a.a.Engineer]+.05*t[a.a.Management]+.02*t[a.a.RandD]+.05*t[a.a.Operations]+.05*t[a.a.Business]),this.calculateRating(e);const u=1+Math.pow(this.advCost,.1)/100,m=Math.max(c+i,1/t.total);this.mku=100/(u*Math.pow(this.qlt+.001,.65)*m),0!==this.mku&&isFinite(this.mku)||(this.mku=1),this.dmd=0===e.awareness?20:Math.min(100,u*(e.popularity/e.awareness*100)),this.cmp=Object(l.a)(0,70);for(const t of Object.keys(e.reqMats))if(e.reqMats.hasOwnProperty(t)){const n=e.reqMats[t];if(void 0===n)continue;this.reqMats[t]=n}this.siz=0;for(const t of Object.keys(e.reqMats)){const n=e.reqMats[t];void 0!==n&&(this.siz+=r.a[t]*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 y})),n.d(e,"a",(function(){return b}));var a=n(0),r=n.n(a),i=n(115),o=n(249),s=n(1),l=n(19),c=n(45),f=n(8),u=n(1777),m=n(1778),h=n(1779),d=n(29),p=n(6),g=n(65);const y=[];function b(){const t=d.b.Player(),e=d.b.Router(),n=Object(a.useState)(!1)[1];function b(){n(t=>!t)}const E=[...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)(()=>{E.forEach(t=>{y.includes(t.name)||y.push(t.name)})},[]),Object(a.useEffect)(()=>{const t=setInterval(b,200);return()=>clearInterval(t)},[]);const v=e=>Math.ceil(Math.max(e-(t.hacking+t.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}},E.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(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:r=>{r.isTrusted&&(t.startCreateProgramWork(n.name,a.time,a.level),t.startFocusing(),e.toWork())}},"Create program"),t.hasProgram(n.name)||0===v(a.level)||r.a.createElement(s.a,{color:p.a.theme.hack},r.a.createElement("b",null,"Unlocks in:")," ",v(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 S})),n.d(e,"a",(function(){return L}));var a=n(1780),r=n(1781),i=n(1782),o=n(1783),s=n(1477),l=n(691),c=n(692),f=n(21),u=n(45),m=n(19),h=n(8),d=n(1),p=n(126),g=n(249),y=n(0),b=n.n(y),E=n(6),v=n(5),k=n(4),_=n(105),w=n(26);const S=[],x=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"})))},C=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(_.d)(w.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(x,{faction:t.faction}),t.joined&&b.a.createElement(d.a,{variant:"body2",sx:{display:"flex"}},(n=t.faction,a=t.player,Object(_.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(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=>{S.includes(t)||S.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-child(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=>w.a.hasOwnProperty(e)?b.a.createElement(C,{key:e,faction:w.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=>w.a.hasOwnProperty(e)?b.a.createElement(C,{key:e,faction:w.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 i}));var a=n(1481),r=n(1791);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";n.d(e,"a",(function(){return f}));var a=n(0),r=n.n(a),i=n(2),o=n(459),s=n(612),l=n(371),c=n(14);function f(t,e,n,a){e?0===i.a.sourceFileLvl(5)&&5!==a&&(i.a.intelligence=0,i.a.intelligence_exp=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.intelligence&&(i.a.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.intelligence&&(i.a.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 w})),n.d(e,"a",(function(){return S})),n.d(e,"c",(function(){return x}));var a=n(0),r=n.n(a),i=n(19),o=n(1),s=n(150),l=n(356),c=n(21),f=n(8),u=n(45),m=n(76),h=n(6),d=n(342),p=n(109),g=n(539),y=n(633),b=n(635),E=n(650),v=n.n(E),k=n(1393),_=n.n(k);let w=!1;function S(){w=!0}function x({router:t,softReset:e,errorData:n,resetError:E}){var k,S;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(),w=!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(_.a,null),color:"info",sx:{px:2},href:null!==(S=n.issueUrl)&&void 0!==S?S:g.b,target:"_blank"},"Submit Issue to GitHub"))))}},,,function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return o}));var a=n(1022);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(1028),r=n(226),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),o(this,"running",!1),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;t=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.dividendPercentage>0&&a>0)if(isNaN(this.dividendPercentage)||this.dividendPercentage<0||this.dividendPercentage>100*s.a.DividendMaxPercentage)console.error("Invalid Corporation dividend percentage: "+this.dividendPercentage);else{const e=a-this.dividendPercentage/100*a;t.gainMoney(this.getDividends(),"corporation"),this.addFunds(e)}else this.addFunds(a);this.updateSharePrice()}this.state.nextState()}}getDividends(){const t=(this.revenue-this.expenses)*s.a.SecsPerMarketCycle,e=this.dividendPercentage/100*t/this.totalShares,n=this.numShares*e;let a=-.15;return 1===this.unlockUpgrades[5]&&(a+=.05),1===this.unlockUpgrades[6]&&(a+=.1),Math.pow(n,l.a.CorporationSoftcap+a)}determineValuation(){let t,e=this.avgProfit;return this.public?(this.dividendPercentage>0&&(e*=(100-this.dividendPercentage)/100),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(19),r=n(21),i=n(1),o=n(1796),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)=>{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(1),i=n(21),o=n(8),s=n(76);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(10),r=n(18),i=n(46),o=n(92),s=n(24),l=n(88);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 N})),n.d(e,"b",(function(){return P}));var a=n(4),r=n(15),i=n(79),o=n(119),s=n(12),l=n(152),c=n(210),f=n(67),u=n(51),m=n(65),h=n(185),d=n(26),p=n(105),g=n(56),y=n(199),b=n(2),E=n(90),v=n(527),k=n(64),_=n(24),w=n(137),S=n(88),x=n(103),C=n(84),L=n(14),O=n(101),M=n(411),T=n(412),A=n(10),R=n(178);function N(){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(_.i)(),Object(_.a)(e),Object(w.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(_.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!==C.a.action&&C.a.finishAction(E.b,b.a,!0),C.a.clear(),R.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(k.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.f)(),Object(x.h)()),Object(o.b)(s.a.TheRedPill)&&b.a.hasAugmentation(s.a.TheRedPill)){const t=Object(_.d)(S.a.WorldDaemon),e=Object(_.d)(S.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]),O.c.prestigeAugmentation(),Object(v.b)(),M.b.splice(0,M.b.length),T.b.splice(0,T.b.length)}function P(t){Object(l.d)(b.a),b.a.prestigeSourceFile(),Object(y.c)();const e=b.a.getHomeComputer();null!==C.a.action&&C.a.finishAction(E.b,b.a,!0),C.a.clear(),R.a.emit(),Object(_.i)(),Object(_.a)(e),Object(w.e)(b.a,e),Object(_.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!==C.a.action&&C.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(k.a.CorporationManagementHandbook),Object(L.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(L.a)("Visit VitaLife in New Tokyo if you'd like to purchase a new sleeve!"),13===b.a.bitNodeN&&Object(L.a)("Trouble is brewing in "+r.a.Chongqing),b.a.hasWseAccount?(Object(x.f)(),Object(x.h)()):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.hacknet_node_money_mult),t.updateHashCapacity(),Object(g.p)(b.a)}13===b.a.bitNodeN&&(b.a.money=A.a.TravelCost),O.c.prestigeSourceFile(),0===b.a.sourceFileLvl(5)||t||b.a.gainIntelligenceExp(300),Object(v.b)()}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(2),r=n(33),i=n(304),o=n(28),s=n(59);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.bladeburner_success_chance_mult,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,"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";n.d(e,"b",(function(){return l})),n.d(e,"a",(function(){return c}));var a=n(0),r=n.n(a),i=n(125),o=n(38);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(15),o=n(1),s=n(21),l=n(121),c=n(144);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(22),o=n(1157),s=n(1158),l=n(2);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.f)(100*e[0],1),"%"):r.a.createElement(r.a.Fragment,null,Object(i.f)(100*e[0],1),"% ~ ",Object(i.f)(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(38);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,"a",(function(){return o}));var a=n(0),r=n.n(a);function i(t,e,n){return t.substring(0,e)+n+t.substring(e+1)}function o(t){const[e,n]=Object(a.useState)(t.content);return Object(a.useEffect)(()=>{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,"a",(function(){return i}));var a=n(1417),r=n(14);function i(t){const e=a.a[t];if(null==e)return;const n=`${e.title}

${e.txt}`;Object(r.a)(n)}},,,,,,function(t,e,n){"use strict";n.d(e,"c",(function(){return u})),n.d(e,"d",(function(){return m})),n.d(e,"b",(function(){return h})),n.d(e,"a",(function(){return d}));var a=n(0),r=n.n(a),i=n(258),o=n(2),s=n(84),l=n(88),c=n(5),f=n(20);function u(){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 m(){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 h(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)h(e.program);else s.a.print("All available programs have been purchased already.")}},function(t,e,n){"use strict";function a(t,e){const n=t.hostname;return"requiredHackingSkill"in t?!1===t.hasAdminRights?{res:!1,msg:`Cannot ${e} ${n} server because you do not have root access`}:{res:!0}:{res:!1,msg:`Cannot ${e} ${n} server because it is a Hacknet Node`}}function r(t,e){const n=a(t,"hack");if(!n.res)return n;return t.requiredHackingSkill>e.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 i})),n.d(e,"b",(function(){return o}));var a=n(181);function r(t,e,n){const a=n-Math.pow(e,.9)/250-t.intelligence/1600;return a<0?0:a>3?3:a}function i(t,e){return r(t,t.strength+t.defense+t.dexterity+t.agility+t.charisma,e)}function o(t,e){return r(t,Object(a.b)(9e3*t.strength_exp_mult,t.strength_mult)+Object(a.b)(9e3*t.defense_exp_mult,t.defense_mult)+Object(a.b)(9e3*t.agility_exp_mult,t.agility_mult)+Object(a.b)(9e3*t.dexterity_exp_mult,t.dexterity_mult)+Object(a.b)(9e3*t.charisma_exp_mult,t.charisma_mult),e)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(115),r=n(10);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)),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 s}));var a=n(0),r=n.n(a),i=n(5),o=n(128);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,"b",(function(){return o})),n.d(e,"a",(function(){return s}));var a=n(27),r=n(160);function i(t){return"string"==typeof t&&(!isNaN(t)&&!isNaN(parseFloat(t)))}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="";const n=[];let r=0,o=0,s="";for(;o=1&&(s=t.charAt(o-1),"\\"===s&&(l=!0));const c=t.charAt(o);if(c===a.a.DOUBLE_QUOTE)if(l||s!==a.a.SPACE)""===e?e=a.a.DOUBLE_QUOTE:e===a.a.DOUBLE_QUOTE&&(e="");else{const e=t.indexOf(a.a.DOUBLE_QUOTE,o+1);if(-1!==e&&(e===t.length-1||t.charAt(e+1)===a.a.SPACE)){n.push(t.substr(o+1,e-o-1)),r=o=e===t.length-1?e+1:e+2;continue}}else if(c===a.a.QUOTE)if(l||s!==a.a.SPACE)""===e?e=a.a.QUOTE:e===a.a.QUOTE&&(e="");else{const e=t.indexOf(a.a.QUOTE,o+1);if(-1!==e&&(e===t.length-1||t.charAt(e+1)===a.a.SPACE)){n.push(t.substr(o+1,e-o-1)),r=o=e===t.length-1?e+1:e+2;continue}}else if(c===a.a.SPACE&&""===e){const e=t.substr(r,o-r);i(e)?n.push(parseFloat(e)):"true"===e?n.push(!0):"false"===e?n.push(!1):n.push(e),r=o+1}++o}if(r!==o){const e=t.substr(r,o-r);i(e)?n.push(parseFloat(e)):"true"===e?n.push(!0):"false"===e?n.push(!1):n.push(e)}return n}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(0),r=n.n(a),i=n(1383),o=n(1),s=n(8);function l(t){const[e,n]=Object(a.useState)(0),[l,c]=Object(a.useState)(!1);return r.a.createElement(r.a.Fragment,null,t.lines.slice(0,e).map((t,e)=>r.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(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"b",(function(){return checkInfiniteLoop})),__webpack_require__.d(__webpack_exports__,"a",(function(){return calculateRamUsage}));var acorn_walk__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(303),acorn__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(256),_RamCalculationErrorCodes__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(327),_Netscript_RamCostGenerator__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(226),_Terminal_DirectoryHelpers__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(83);const specialReferenceIF="__SPECIAL_referenceIf",specialReferenceFOR="__SPECIAL_referenceFor",specialReferenceWHILE="__SPECIAL_referenceWhile",memCheckGlobalKey=".__GLOBAL__";async function parseOnlyRamCalculate(player,otherScripts,code,workerScript){try{let dependencyMap={};const completedParses=new Set,parseQueue=[];function parseCode(t,e){const n=parseOnlyCalculateDeps(t,e);completedParses.add(e);for(let t=0;t0;){const nextModule=parseQueue.shift();if(void 0===nextModule)throw new Error("nextModule should not be undefined");let code;if(nextModule.startsWith("https://")||nextModule.startsWith("http://"))try{const module=await eval("import(nextModule)");code="";for(const t in module)"function"==typeof module[t]&&(code+=module[t].toString()+";\n")}catch(t){return console.error(`Error dynamically importing module from ${nextModule} for RAM calculations: ${t}`),{cost:_RamCalculationErrorCodes__WEBPACK_IMPORTED_MODULE_2__.a.URLImportError}}else{if(!Array.isArray(otherScripts))return console.warn("parseOnlyRamCalculate() not called with array of scripts"),{cost:_RamCalculationErrorCodes__WEBPACK_IMPORTED_MODULE_2__.a.ImportError};let t=null;const e=nextModule.startsWith("./")?nextModule.slice(2):nextModule;for(const n of otherScripts)if(Object(_Terminal_DirectoryHelpers__WEBPACK_IMPORTED_MODULE_4__.b)(n.filename,e)){t=n;break}if(null==t)return{cost:_RamCalculationErrorCodes__WEBPACK_IMPORTED_MODULE_2__.a.ImportError};code=t.code}parseCode(code,nextModule)}let ram=_Netscript_RamCostGenerator__WEBPACK_IMPORTED_MODULE_3__.a.ScriptBaseRamCost;const detailedCosts=[{type:"misc",name:"baseCost",cost:_Netscript_RamCostGenerator__WEBPACK_IMPORTED_MODULE_3__.a.ScriptBaseRamCost}],unresolvedRefs=Object.keys(dependencyMap).filter(t=>t.startsWith(initialModule)),resolvedRefs=new Set;for(;unresolvedRefs.length>0;){const t=unresolvedRefs.shift();if(void 0===t)throw new Error("ref should not be undefined");if("hacknet"!==t||resolvedRefs.has("hacknet")||(ram+=_Netscript_RamCostGenerator__WEBPACK_IMPORTED_MODULE_3__.a.ScriptHacknetNodesRamCost,detailedCosts.push({type:"ns",name:"hacknet",cost:_Netscript_RamCostGenerator__WEBPACK_IMPORTED_MODULE_3__.a.ScriptHacknetNodesRamCost})),"document"!==t||resolvedRefs.has("document")||(ram+=_Netscript_RamCostGenerator__WEBPACK_IMPORTED_MODULE_3__.a.ScriptDomRamCost,detailedCosts.push({type:"dom",name:"document",cost:_Netscript_RamCostGenerator__WEBPACK_IMPORTED_MODULE_3__.a.ScriptDomRamCost})),"window"!==t||resolvedRefs.has("window")||(ram+=_Netscript_RamCostGenerator__WEBPACK_IMPORTED_MODULE_3__.a.ScriptDomRamCost,detailedCosts.push({type:"dom",name:"window",cost:_Netscript_RamCostGenerator__WEBPACK_IMPORTED_MODULE_3__.a.ScriptDomRamCost})),"corporation"!==t||resolvedRefs.has("corporation")||(ram+=_Netscript_RamCostGenerator__WEBPACK_IMPORTED_MODULE_3__.a.ScriptCorporationRamCost,detailedCosts.push({type:"ns",name:"corporation",cost:_Netscript_RamCostGenerator__WEBPACK_IMPORTED_MODULE_3__.a.ScriptCorporationRamCost})),resolvedRefs.add(t),t.endsWith(".*")){const e=t.slice(0,t.length-2);for(const t of Object.keys(dependencyMap).filter(t=>t.startsWith(e)))for(const e of dependencyMap[t]||[])resolvedRefs.has(e)||unresolvedRefs.push(e)}else for(const e of dependencyMap[t]||[])resolvedRefs.has(e)||unresolvedRefs.push(e);try{function applyFuncRam(t){return"number"==typeof t?t:"function"==typeof t?t(player):0}if(workerScript.loadedFns[t])continue;let e;workerScript.loadedFns[t]=!0;let n="n/a";t in workerScript.env.vars.bladeburner?(e=workerScript.env.vars.bladeburner[t],n="bladeburner."+t):t in workerScript.env.vars.codingcontract?(e=workerScript.env.vars.codingcontract[t],n="codingcontract."+t):t in workerScript.env.vars.stanek?(e=workerScript.env.vars.stanek[t],n="stanek."+t):t in workerScript.env.vars.infiltration?(e=workerScript.env.vars.infiltration[t],n="infiltration."+t):t in workerScript.env.vars.gang?(e=workerScript.env.vars.gang[t],n="gang."+t):t in workerScript.env.vars.sleeve?(e=workerScript.env.vars.sleeve[t],n="sleeve."+t):t in workerScript.env.vars.stock?(e=workerScript.env.vars.stock[t],n="stock."+t):t in workerScript.env.vars.ui?(e=workerScript.env.vars.ui[t],n="ui."+t):t in workerScript.env.vars.grafting?(e=workerScript.env.vars.grafting[t],n="grafting."+t):t in workerScript.env.vars.singularity?(e=workerScript.env.vars.singularity[t],n="singularity."+t):(e=workerScript.env.vars[t],n=""+t);const a=applyFuncRam(e);ram+=a,detailedCosts.push({type:"fn",name:n,cost:a})}catch(t){continue}}return{cost:ram,entries:detailedCosts.filter(t=>t.cost>0)}}catch(t){return{cost:_RamCalculationErrorCodes__WEBPACK_IMPORTED_MODULE_2__.a.SyntaxError}}}function checkInfiniteLoop(t){const e=Object(acorn__WEBPACK_IMPORTED_MODULE_1__.a)(t,{sourceType:"module",ecmaVersion:"latest"});let n=-1;return acorn_walk__WEBPACK_IMPORTED_MODULE_0__.a(e,{},{WhileStatement:(e,a,r)=>{!function(t){return"Literal"===t.type&&"true"===t.raw}(e.test)||function(t){let e=!1;return acorn_walk__WEBPACK_IMPORTED_MODULE_0__.a(t,{},{AwaitExpression:()=>{e=!0}}),e}(e)?e.body&&r(e.body,a):n=(t.slice(0,e.start).match(/\n/g)||[]).length+1}}),n}function parseOnlyCalculateDeps(t,e){const n=Object(acorn__WEBPACK_IMPORTED_MODULE_1__.a)(t,{sourceType:"module",ecmaVersion:"latest"}),a=e+memCheckGlobalKey,r={};r[a]=new Set;const i={},o=[];function s(t,n){const a=r[t]||(r[t]=new Set),o=i[n];void 0!==o&&a.add(o),a.add(e+"."+n),a.add(n)}const l=Object.getOwnPropertyNames(Object.prototype);function c(){return{Identifier:(t,e)=>{l.includes(t.name)||s(e.key,t.name)},WhileStatement:(t,e,n)=>{s(e.key,specialReferenceWHILE),t.test&&n(t.test,e),t.body&&n(t.body,e)},DoWhileStatement:(t,e,n)=>{s(e.key,specialReferenceWHILE),t.test&&n(t.test,e),t.body&&n(t.body,e)},ForStatement:(t,e,n)=>{s(e.key,specialReferenceFOR),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)=>{s(e.key,specialReferenceIF),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 acorn_walk__WEBPACK_IMPORTED_MODULE_0__.a(n,{key:a},Object.assign({ImportDeclaration:(t,e)=>{const n=t.source.value;o.push(n);const a=r[e.key];if(void 0===a)throw new Error("set should not be undefined");a.add(n+memCheckGlobalKey);for(let a=0;a{const n=e+"."+(null===t.id?"__SPECIAL_DEFAULT_EXPORT__":t.id.name);acorn_walk__WEBPACK_IMPORTED_MODULE_0__.a(t,{key:n},c())}},c())),{dependencyMap:r,additionalModules:o}}async function calculateRamUsage(t,e,n){const a={loadedFns:{},env:{vars:_Netscript_RamCostGenerator__WEBPACK_IMPORTED_MODULE_3__.b}};try{return await parseOnlyRamCalculate(t,n,e,a)}catch(t){return console.error("Failed to parse script for RAM calculations:"),console.error(t),{cost:_RamCalculationErrorCodes__WEBPACK_IMPORTED_MODULE_2__.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(200);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 it}));var a=n(596),r=n.n(a),i=n(422),o=n(297),s=n(18),l=n(10),c=n(102),f=n(481),u=n(92),m=n(84),h=n(2),d=n(65),p=n(255),g=n(236),y=n(100),b=n(407),E=n(24),v=n(137),k=n(224),_=n(46),w=n(529),S=n(83),x=n(225),C=n(199),L=n(142),O=n(200),M=n(110),T=n(5),A=n(22),R=n(178),N=n(257),P=n(146),I=n(1032),F=n(1037),D=n(1038),j=n(1040),B=n(1041),G=n(1043),W=n(1044),H=n(1045),U=n(1046),q=n(1048),$=n(1053),K=n(1054),z=n(1055),V=n(1411),Y=n(645),J=n(14),X=n(94),Q=n(370),Z=n(644),tt=n(284),et=n(420),nt=n(461),at=n(15),rt=n(1412);function it(t){const e=function(t,e){const n=Object(E.d)(t);if(null==n)throw e.makeRuntimeErrorMsg("Invalid hostname: "+t);return n},n=function(n,a,r,i){if(!Array.isArray(i))throw Object(M.b)(t,`Invalid scriptArgs argument passed into getRunningScript() from ${n.function}(). This is probably a bug. Please report to game developer`);if(null!=a&&"string"==typeof a){null==r&&(r=t.hostname);const o=e(r,n);return Object(g.a)(a,i,o)}return t.scriptRef},a=function(t){for(const e of Object(E.c)()){const n=Object(g.b)(t,e);if(n)return n}return null},ot=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}},st=function(t,e,n){return Array.isArray(n)||(n=[]),`Cannot find running script ${t} on server ${e} with args: ${Object(N.a)(n)}`},lt=function(e,n=""){return e instanceof u.a&&(t.log(n,()=>"Does not work on Hacknet Servers"),!0)},ct=function(e,n){const a=(new Error).stack;if(void 0===a)throw new Error("how did we not throw an error?");const r=a.split("\n").slice(1),i=t.getServer().scripts,o=[];for(const t of r){let e;for(const n of i){n.url&&t.includes(n.url)&&(e=n.filename);for(const a of n.dependencies)t.includes(a.url)&&(e=a.filename)}if(!e)continue;function s(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=s(t);function l(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=l(t);r&&(n=r),o.push(`${e}:L${n.line}@${n.func}`)}t.log(e,()=>n);let c=`${e}: ${n}`;return 0!==o.length&&(c+="

Stack:
"+o.join("
")),Object(M.b)(t,c)},ft=async function(n,a,r,{threads:i,stock:o}={}){if(void 0===a)throw n.makeRuntimeErrorMsg("Takes 1 argument.");const u=Object(M.d)(n,i),m=e(a,n);if(!(m instanceof _.a))throw n.makeRuntimeErrorMsg("Cannot be executed on this server.");const d=Object(c.d)(m,h.a),p=Object(f.b)(m,h.a);if(!p.res)throw n.makeRuntimeErrorMsg(p.msg||"");return n.log(()=>`Executing on '${m.hostname}' in ${Object(A.d)(1e3*d,!0)} (t=${T.a.formatThreads(u)})`),Object(M.c)(1e3*d,t).then((function(){const e=Object(c.b)(m,h.a),a=Math.random();let i=Object(c.c)(m,h.a)*u;const f=i/4;if(am.moneyAvailable&&(d=m.moneyAvailable),m.moneyAvailable-=d,m.moneyAvailable<0&&(m.moneyAvailable=0);let p=d*s.a.ScriptHackMoneyGain;return r&&(p=d*s.a.ManualHackMoney),h.a.gainMoney(p,"hacking"),t.scriptRef.onlineMoneyMade+=p,h.a.scriptProdSinceLastAug+=p,t.scriptRef.recordHack(m.hostname,p,u),h.a.gainHackingExp(i),r&&h.a.gainIntelligenceExp(.005),t.scriptRef.onlineExpGained+=i,n.log(()=>`Successfully hacked '${m.hostname}' for ${T.a.formatMoney(p)} and ${T.a.formatExp(i)} exp (t=${T.a.formatThreads(u)})`),m.fortify(l.a.ServerFortifyAmount*Math.min(u,a)),o&&Object(w.c)(m,d),r&&(m.backdoorInstalled=!0),Promise.resolve(p)}return h.a.gainHackingExp(f),t.scriptRef.onlineExpGained+=f,n.log(()=>`Failed to hack '${m.hostname}'. Gained ${T.a.formatExp(f)} exp (t=${T.a.formatThreads(u)})`),Promise.resolve(0)}))},ut=function(t){let e="";for(let n of t)n=Object(Y.a)(n),e+="object"==typeof n?JSON.stringify(n):""+n;return e},mt={updateDynamicRam:function(e,n){if(t.dynamicLoadedFns[e])return;t.dynamicLoadedFns[e]=!0;let a=t.scriptRef.threads;if("number"!=typeof a&&(console.warn(`WorkerScript detected NaN for threadcount for ${t.name} on ${t.hostname}`),a=1),t.dynamicRamUsage+=n,t.dynamicRamUsage>1.01*t.ramUsage)throw Object(M.b)(t,`Dynamic RAM usage calculated to be greater than initial RAM usage on fn: ${e}.\n This is probably because you somehow circumvented the static RAM calculation.\n\n Threads: ${a}\n Dynamic RAM Usage: ${T.a.formatRAM(t.dynamicRamUsage)}\n Static RAM Usage: ${T.a.formatRAM(t.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 :(`)},makeRuntimeErrorMsg:ct,string:(t,e,n)=>{if("string"==typeof n)return n;if("number"==typeof n)return n+"";throw ct(t,e+" should be a string.")},number:(t,e,n)=>{if("string"==typeof n){const t=parseFloat(n);if(!isNaN(t))return t}else if("number"==typeof n){if(isNaN(n))throw ct(t,e+" is NaN.");return n}throw ct(t,e+" should be a number.")},boolean:t=>!!t,city:(t,e,n)=>{if("string"!=typeof n)throw ct(t,e+" should be a city name.");const a=n;if(!Object.values(at.a).includes(a))throw ct(t,e+" should be a city name.");return a},getServer:e,checkSingularityAccess:function(t){if(4!==h.a.bitNodeN&&0===h.a.sourceFileLvl(4))throw ct(t,"This singularity function requires Source-File 4 to run. A power up you obtain later in the game. It will be very obvious when and how you can obtain it.")},hack:ft,getValidPort:(t,e)=>{if(isNaN(e))throw ct(t,`Invalid argument. Must be a port number between 1 and ${l.a.NumNetscriptPorts}, is ${e}`);if((e=Math.round(e))<1||e>l.a.NumNetscriptPorts)throw ct(t,`Trying to use an invalid port: ${e}. Only ports 1-${l.a.NumNetscriptPorts} are valid.`);const n=C.a[e-1];if(null==n||!(n instanceof Object))throw ct(t,`Could not find port: ${e}. This is a bug. Report to dev.`);return n}},ht=Object(V.a)(h.a,t),dt={...{...ht,args:t.args,enums:{toast:X.d},singularity:ht,gang:Object(I.a)(h.a,t),bladeburner:Object(H.a)(h.a,t),codingcontract:Object(U.a)(h.a,t),sleeve:Object(F.a)(h.a),corporation:Object(q.a)(h.a,t),stanek:Object(B.a)(h.a,t,mt),infiltration:Object(G.a)(h.a),ui:Object(W.a)(),formulas:Object($.a)(h.a,mt),stock:Object(K.a)(h.a,t),grafting:Object(z.a)(h.a),hacknet:Object(j.a)(h.a,t),sprintf:i.sprintf,vsprintf:i.vsprintf,scan:n=>(a=t.hostname)=>{const r=n.helper.string("hostname",a),i=e(r,n),o=[];for(let t=0;t`returned ${i.serversOnNetwork.length} connections for ${i.hostname}`),o},hack:t=>(e,{threads:n,stock:a}={})=>{const r=t.helper.string("hostname",e);return ft(t,r,!1,{threads:n,stock:a})},hackAnalyzeThreads:t=>(n,a)=>{const r=t.helper.string("hostname",n),i=t.helper.number("hackAmount",a),o=e(r,t);if(!(o instanceof _.a))return t.log(()=>"Cannot be executed on this server."),-1;if(isNaN(i))throw t.makeRuntimeErrorMsg(`Invalid hackAmount argument passed into hackAnalyzeThreads: ${i}. Must be numeric.`);if(i<0||i>o.moneyAvailable)return-1;if(0===i)return 0;const s=Object(c.e)(o,h.a);return 0===s||0===o.moneyAvailable?0:i/Math.floor(o.moneyAvailable*s)},hackAnalyze:t=>n=>{const a=t.helper.string("hostname",n),r=e(a,t);return r instanceof _.a?Object(c.e)(r,h.a):(t.log(()=>"Cannot be executed on this server."),0)},hackAnalyzeSecurity:t=>(n,a)=>{let r=t.helper.number("threads",n);if(a){const n=t.helper.string("hostname",a),i=e(n,t);if(!(i instanceof _.a))return t.log(()=>"Cannot be executed on this server."),0;const o=Object(c.e)(i,h.a);o>0&&(r=Math.min(r,Math.ceil(1/o)))}return l.a.ServerFortifyAmount*r},hackAnalyzeChance:t=>n=>{const a=t.helper.string("hostname",n),r=e(a,t);return r instanceof _.a?Object(c.b)(r,h.a):(t.log(()=>"Cannot be executed on this server."),0)},sleep:e=>async(n=0)=>{const a=e.helper.number("time",n);if(void 0===a)throw e.makeRuntimeErrorMsg("Takes 1 argument.");return e.log(()=>`Sleeping for ${a} milliseconds`),Object(M.c)(a,t).then((function(){return Promise.resolve(!0)}))},asleep:t=>function(e=0){const n=t.helper.number("time",e);return t.log(()=>`Sleeping for ${n} milliseconds`),new Promise(t=>setTimeout(()=>t(!0),n))},grow:n=>async(a,{threads:r,stock:i}={})=>{const o=n.helper.string("hostname",a),s=Object(M.d)(n,null!=r?r:t.scriptRef.threads),l=e(o,n);if(!(l instanceof _.a))return n.log(()=>"Cannot be executed on this server."),Promise.resolve(0);const u=Object(E.d)(t.hostname);if(null===u)throw new Error("Workerscript host is null");const m=Object(f.a)(l);if(!m.res)throw n.makeRuntimeErrorMsg(m.msg||"");const d=Object(c.a)(l,h.a);return n.log(()=>`Executing on '${l.hostname}' in ${Object(A.d)(1e3*d,!0)} (t=${T.a.formatThreads(s)}).`),Object(M.c)(1e3*d,t).then((function(){const e=l.moneyAvailable<=0?1:l.moneyAvailable;Object(v.f)(l,s,h.a,u.cpuCores);const a=l.moneyAvailable;t.scriptRef.recordGrow(l.hostname,s);const r=Object(c.c)(l,h.a)*s,o=a/e-1;return n.log(()=>`Available money on '${l.hostname}' grown by ${T.a.formatPercentage(o,6)}. Gained ${T.a.formatExp(r)} hacking exp (t=${T.a.formatThreads(s)}).`),t.scriptRef.onlineExpGained+=r,h.a.gainHackingExp(r),i&&Object(w.b)(l,a-e),Promise.resolve(a/e)}))},growthAnalyze:t=>(n,a,r=1)=>{const i=t.helper.string("hostname",n),o=t.helper.number("growth",a),s=t.helper.number("cores",r),l=e(i,t);if(!(l instanceof _.a))return t.log(()=>"Cannot be executed on this server."),0;if("number"!=typeof o||isNaN(o)||o<1||!isFinite(o))throw t.makeRuntimeErrorMsg(`Invalid argument: growth must be numeric and >= 1, is ${o}.`);return Object(v.c)(l,Number(o),h.a,s)},growthAnalyzeSecurity:t=>(n,a,r)=>{let i=t.helper.number("threads",n);if(a){const n=t.helper.number("cores",r)||1,o=t.helper.string("hostname",a),s=e(o,t);if(!(s instanceof _.a))return t.log(()=>"Cannot be executed on this server."),0;const l=Math.ceil(Object(v.d)(s,s.moneyMax,s.moneyAvailable,h.a,n));i=Math.min(i,l)}return 2*l.a.ServerFortifyAmount*i},weaken:n=>async(a,{threads:r}={})=>{const i=n.helper.string("hostname",a),o=Object(M.d)(n,null!=r?r:t.scriptRef.threads);if(void 0===i)throw n.makeRuntimeErrorMsg("Takes 1 argument.");const s=e(i,n);if(!(s instanceof _.a))return n.log(()=>"Cannot be executed on this server."),Promise.resolve(0);const u=Object(f.c)(s);if(!u.res)throw n.makeRuntimeErrorMsg(u.msg||"");const m=Object(c.f)(s,h.a);return n.log(()=>`Executing on '${s.hostname}' in ${Object(A.d)(1e3*m,!0)} (t=${T.a.formatThreads(o)})`),Object(M.c)(1e3*m,t).then((function(){const e=Object(E.d)(t.hostname);if(null===e)return n.log(()=>"Server is null, did it die?"),Promise.resolve(0);const a=1+(e.cpuCores-1)/16;s.weaken(l.a.ServerWeakenAmount*o*a),t.scriptRef.recordWeaken(s.hostname,o);const r=Object(c.c)(s,h.a)*o;return n.log(()=>`'${s.hostname}' security level weakened to ${s.hackDifficulty}. Gained ${T.a.formatExp(r)} hacking exp (t=${T.a.formatThreads(o)})`),t.scriptRef.onlineExpGained+=r,h.a.gainHackingExp(r),Promise.resolve(l.a.ServerWeakenAmount*o*a)}))},weakenAnalyze:t=>(e,n=1)=>{const a=t.helper.number("threads",e),r=1+(t.helper.number("cores",n)-1)/16;return l.a.ServerWeakenAmount*a*r*s.a.ServerWeakenRate},share:e=>async()=>{e.log(()=>"Sharing this computer.");const n=Object(et.b)(t.scriptRef.threads*Object(tt.a)(h.a.intelligence,2));return Object(M.c)(1e4,t).finally((function(){e.log(()=>"Finished sharing this computer."),n()}))},getSharePower:()=>()=>Object(et.a)(),print:e=>(...n)=>{if(0===n.length)throw e.makeRuntimeErrorMsg("Takes at least 1 argument.");t.print(ut(n))},printf:e=>(n,...a)=>{const r=e.helper.string("format",n);if("string"!=typeof r)throw e.makeRuntimeErrorMsg("First argument must be string for the format.");t.print(Object(i.vsprintf)(r,a))},tprint:e=>(...n)=>{if(0===n.length)throw e.makeRuntimeErrorMsg("Takes at least 1 argument.");const a=ut(n);a.startsWith("ERROR")||a.startsWith("FAIL")?m.a.error(`${t.scriptRef.filename}: ${a}`):a.startsWith("SUCCESS")?m.a.success(`${t.scriptRef.filename}: ${a}`):a.startsWith("WARN")?m.a.warn(`${t.scriptRef.filename}: ${a}`):a.startsWith("INFO")?m.a.info(`${t.scriptRef.filename}: ${a}`):m.a.print(`${t.scriptRef.filename}: ${a}`)},tprintf:t=>(e,...n)=>{const a=t.helper.string("format",e),r=Object(i.vsprintf)(a,n);r.startsWith("ERROR")||r.startsWith("FAIL")?m.a.error(""+r):r.startsWith("SUCCESS")?m.a.success(""+r):r.startsWith("WARN")?m.a.warn(""+r):r.startsWith("INFO")?m.a.info(""+r):m.a.print(""+r)},clearLog:()=>()=>{t.scriptRef.clearLog()},disableLog:e=>n=>{const a=e.helper.string("fn",n);if("ALL"===a){for(const e of Object.keys(pt))t.disableLogs[e]=!0;e.log(()=>"Disabled logging for all functions")}else{if(void 0===pt[a])throw e.makeRuntimeErrorMsg(`Invalid argument: ${a}.`);t.disableLogs[a]=!0,e.log(()=>"Disabled logging for "+a)}},enableLog:e=>n=>{const a=e.helper.string("fn",n);if("ALL"===a){for(const e of Object.keys(pt))delete t.disableLogs[e];e.log(()=>"Enabled logging for all functions")}else if(void 0===pt[a])throw e.makeRuntimeErrorMsg(`Invalid argument: ${a}.`);delete t.disableLogs[a],e.log(()=>"Enabled logging for "+a)},isLogEnabled:e=>n=>{const a=e.helper.string("fn",n);if(void 0===pt[a])throw e.makeRuntimeErrorMsg(`Invalid argument: ${a}.`);return!t.disableLogs[a]},getScriptLogs:t=>(e,a,...r)=>{const i=n(t,e,a,r);return null==i?(t.log(()=>st(e,a,r)),[]):i.logs.slice()},tail:e=>(r,i=t.hostname,...o)=>{let s;s=void 0===r?t.scriptRef:"number"==typeof r?a(r):n(e,r,i,o),null!=s?R.c.emit(s):e.log(()=>st(r,i,o))},closeTail:e=>(n=t.scriptRef.pid)=>{const a=e.helper.number("pid",n);R.b.emit(a)},nuke:t=>n=>{const a=t.helper.string("hostname",n),r=e(a,t);if(!(r instanceof _.a))return t.log(()=>"Cannot be executed on this server."),!1;if(r.hasAdminRights)return t.log(()=>`Already have root access to '${r.hostname}'.`),!0;if(!h.a.hasProgram(d.a.NukeProgram.name))throw t.makeRuntimeErrorMsg("You do not have the NUKE.exe virus!");if(r.openPortCount`Executed NUKE.exe virus on '${r.hostname}' to gain root access.`),!0},brutessh:t=>n=>{const a=t.helper.string("hostname",n),r=e(a,t);if(!(r instanceof _.a))return t.log(()=>"Cannot be executed on this server."),!1;if(!h.a.hasProgram(d.a.BruteSSHProgram.name))throw t.makeRuntimeErrorMsg("You do not have the BruteSSH.exe program!");return r.sshPortOpen?t.log(()=>`SSH Port (22) already opened on '${r.hostname}'.`):(t.log(()=>`Executed BruteSSH.exe on '${r.hostname}' to open SSH port (22).`),r.sshPortOpen=!0,++r.openPortCount),!0},ftpcrack:t=>n=>{const a=t.helper.string("hostname",n);if(void 0===a)throw t.makeRuntimeErrorMsg("Takes 1 argument.");const r=e(a,t);if(!(r instanceof _.a))return t.log(()=>"Cannot be executed on this server."),!1;if(!h.a.hasProgram(d.a.FTPCrackProgram.name))throw t.makeRuntimeErrorMsg("You do not have the FTPCrack.exe program!");return r.ftpPortOpen?t.log(()=>`FTP Port (21) already opened on '${r.hostname}'.`):(t.log(()=>`Executed FTPCrack.exe on '${r.hostname}' to open FTP port (21).`),r.ftpPortOpen=!0,++r.openPortCount),!0},relaysmtp:t=>n=>{const a=t.helper.string("hostname",n);if(void 0===a)throw t.makeRuntimeErrorMsg("Takes 1 argument.");const r=e(a,t);if(!(r instanceof _.a))return t.log(()=>"Cannot be executed on this server."),!1;if(!h.a.hasProgram(d.a.RelaySMTPProgram.name))throw t.makeRuntimeErrorMsg("You do not have the relaySMTP.exe program!");return r.smtpPortOpen?t.log(()=>`SMTP Port (25) already opened on '${r.hostname}'.`):(t.log(()=>`Executed relaySMTP.exe on '${r.hostname}' to open SMTP port (25).`),r.smtpPortOpen=!0,++r.openPortCount),!0},httpworm:t=>n=>{const a=t.helper.string("hostname",n);if(void 0===a)throw t.makeRuntimeErrorMsg("Takes 1 argument");const r=e(a,t);if(!(r instanceof _.a))return t.log(()=>"Cannot be executed on this server."),!1;if(!h.a.hasProgram(d.a.HTTPWormProgram.name))throw t.makeRuntimeErrorMsg("You do not have the HTTPWorm.exe program!");return r.httpPortOpen?t.log(()=>`HTTP Port (80) already opened on '${r.hostname}'.`):(t.log(()=>`Executed HTTPWorm.exe on '${r.hostname}' to open HTTP port (80).`),r.httpPortOpen=!0,++r.openPortCount),!0},sqlinject:t=>n=>{const a=t.helper.string("hostname",n);if(void 0===a)throw t.makeRuntimeErrorMsg("Takes 1 argument.");const r=e(a,t);if(!(r instanceof _.a))return t.log(()=>"Cannot be executed on this server."),!1;if(!h.a.hasProgram(d.a.SQLInjectProgram.name))throw t.makeRuntimeErrorMsg("You do not have the SQLInject.exe program!");return r.sqlPortOpen?t.log(()=>`SQL Port (1433) already opened on '${r.hostname}'.`):(t.log(()=>`Executed SQLInject.exe on '${r.hostname}' to open SQL port (1433).`),r.sqlPortOpen=!0,++r.openPortCount),!0},run:e=>(n,a=1,...r)=>{const i=e.helper.string("scriptname",n),o=e.helper.number("threads",a);if(void 0===i)throw e.makeRuntimeErrorMsg("Usage: run(scriptname, [numThreads], [arg1], [arg2]...)");if(isNaN(o)||o<=0)throw e.makeRuntimeErrorMsg("Invalid thread count. Must be numeric and > 0, is "+o);const s=Object(E.d)(t.hostname);if(null==s)throw e.makeRuntimeErrorMsg("Could not find server. This is a bug. Report to dev.");return Object(C.d)(h.a,"run",s,i,r,t,o)},exec:n=>(a,r,i=1,...o)=>{const s=n.helper.string("scriptname",a),l=n.helper.string("hostname",r),c=n.helper.number("threads",i);if(void 0===s||void 0===l)throw n.makeRuntimeErrorMsg("Usage: exec(scriptname, server, [numThreads], [arg1], [arg2]...)");if(isNaN(c)||c<=0)throw n.makeRuntimeErrorMsg("Invalid thread count. Must be numeric and > 0, is "+c);const f=e(l,n);return Object(C.d)(h.a,"exec",f,s,o,t,c)},spawn:e=>(n,a=1,...r)=>{const i=e.helper.string("scriptname",n),o=e.helper.number("threads",a);if(!i||!o)throw e.makeRuntimeErrorMsg("Usage: spawn(scriptname, threads)");setTimeout(()=>{if(isNaN(o)||o<=0)throw e.makeRuntimeErrorMsg("Invalid thread count. Must be numeric and > 0, is "+o);const n=Object(E.d)(t.hostname);if(null==n)throw e.makeRuntimeErrorMsg("Could not find server. This is a bug. Report to dev");return Object(C.d)(h.a,"spawn",n,i,r,t,o)},1e4),e.log(()=>`Will execute '${i}' in 10 seconds`),t.running=!1,Object(L.a)(t)&&e.log(()=>"Exiting...")},kill:t=>(a,r,...i)=>{let o;const s="number"==typeof a;if(s)o=Object(L.a)(a);else{if(void 0===a||void 0===r)throw t.makeRuntimeErrorMsg("Usage: kill(scriptname, server, [arg1], [arg2]...)");const s=e(r,t),l=n(t,a,r,i);if(null==l)return t.log(()=>st(a,r,i)),!1;o=Object(L.a)(l,s.hostname)}return o?(s?t.log(()=>"Killing script with PID "+a):t.log(()=>`Killing '${a}' on '${r}' with args: ${Object(N.a)(i)}.`),!0):(s?t.log(()=>"No script with PID "+a):t.log(()=>`No such script '${a}' on '${r}' with args: ${Object(N.a)(i)}`),!1)},killall:n=>(a=t.hostname,r=!0)=>{const i=n.helper.string("hostname",a),s=mt.boolean(r);if(void 0===i)throw n.makeRuntimeErrorMsg("Usage: killall(hostname, [safetyguard boolean])");const l=e(i,n);let c=0;for(let e=l.runningScripts.length-1;e>=0;--e)!0===s&&l.runningScripts[e].pid==t.pid||(Object(L.a)(l.runningScripts[e],l.hostname,!1),++c);return o.a.emit(),n.log(()=>`Killing all scripts on '${l.hostname}'. May take a few minutes for the scripts to die.`),c>0},exit:e=>()=>{t.running=!1,Object(L.a)(t)?e.log(()=>"Exiting..."):e.log(()=>"Failed. This is a bug. Report to dev.")},scp:n=>async(a,r,i)=>{const o=n.helper.string("hostname1",r);if(a&&a.constructor===Array){const e=a;if(0===e.length)throw n.makeRuntimeErrorMsg("No scripts to copy");let r=!0;return await Promise.all(e.map((async function(e){await it(t).scp(e,o,i)||(r=!1)}))),Promise.resolve(r)}if(!Object(S.j)(a))throw n.makeRuntimeErrorMsg(`Invalid filename: '${a}'`);if(!a.endsWith(".lit")&&!Object(y.a)(a)&&!a.endsWith("txt"))throw n.makeRuntimeErrorMsg("Only works for scripts, .lit and .txt files");let s,l;if(null!=i){if(void 0===a||void 0===o||void 0===i)throw n.makeRuntimeErrorMsg("Takes 2 or 3 arguments");s=e(i,n),l=e(o,n)}else{if(null==o)throw n.makeRuntimeErrorMsg("Takes 2 or 3 arguments");if(void 0===a||void 0===o)throw n.makeRuntimeErrorMsg("Takes 2 or 3 arguments");if(s=e(o,n),l=Object(E.d)(t.hostname),null==l)throw n.makeRuntimeErrorMsg("Could not find server hostname for this script. This is a bug. Report to dev.")}if(a.endsWith(".lit")){let t=!1;for(let e=0;e`File '${a}' does not exist.`),Promise.resolve(!1);for(let t=0;t{var t;return`File '${a}' copied over to '${null===(t=s)||void 0===t?void 0:t.hostname}'.`}),Promise.resolve(!0);return s.messages.push(a),n.log(()=>{var t;return`File '${a}' copied over to '${null===(t=s)||void 0===t?void 0:t.hostname}'.`}),Promise.resolve(!0)}if(a.endsWith(".txt")){let t;for(let e=0;e`File '${a}' does not exist.`),Promise.resolve(!1);for(let e=0;e{var t;return`File '${a}' copied over to '${null===(t=s)||void 0===t?void 0:t.hostname}'.`}),Promise.resolve(!0);const e=new x.a(t.fn,t.text);return s.textFiles.push(e),n.log(()=>{var t;return`File '${a}' copied over to '${null===(t=s)||void 0===t?void 0:t.hostname}'.`}),Promise.resolve(!0)}let c=null;for(let t=0;t`File '${a}' does not exist.`),Promise.resolve(!1);for(let t=0;t{var t;return`WARNING: File '${a}' overwritten on '${null===(t=s)||void 0===t?void 0:t.hostname}'`});const e=s.scripts[t];return e.code===c.code||(e.code=c.code,e.ramUsage=c.ramUsage,e.markUpdated()),Promise.resolve(!0)}const f=new p.a(h.a,a);return f.code=c.code,f.ramUsage=c.ramUsage,f.server=s.hostname,s.scripts.push(f),n.log(()=>{var t;return`File '${a}' copied over to '${null===(t=s)||void 0===t?void 0:t.hostname}'.`}),new Promise(t=>{null!==s?f.updateRamUsage(h.a,s.scripts).then(()=>t(!0)):t(!1)})},ls:t=>(n,a="")=>{const r=t.helper.string("hostname",n),i=t.helper.string("grep",a),o=e(r,t);let s="";void 0!==a&&(s=i.toString());const l=[];for(let t=0;t()=>nt.b.map(t=>({timeOfDeath:t.timeOfDeath,...ot(t.runningScript)})),ps:n=>(a=t.hostname)=>{const r=n.helper.string("hostname",a),i=e(r,n),o=[];for(const t of i.runningScripts)o.push({filename:t.filename,threads:t.threads,args:t.args.slice(),pid:t.pid});return o},hasRootAccess:t=>n=>{const a=t.helper.string("hostname",n);return e(a,t).hasAdminRights},getHostname:e=>()=>{const n=Object(E.d)(t.hostname);if(null==n)throw e.makeRuntimeErrorMsg("Could not find server. This is a bug. Report to dev.");return n.hostname},getHackingLevel:t=>()=>(h.a.updateSkillLevels(),t.log(()=>"returned "+h.a.hacking),h.a.hacking),getHackingMultipliers:()=>()=>({chance:h.a.hacking_chance_mult,speed:h.a.hacking_speed_mult,money:h.a.hacking_money_mult,growth:h.a.hacking_grow_mult}),getHacknetMultipliers:()=>()=>({production:h.a.hacknet_node_money_mult,purchaseCost:h.a.hacknet_node_purchase_cost_mult,ramCost:h.a.hacknet_node_ram_cost_mult,coreCost:h.a.hacknet_node_core_cost_mult,levelCost:h.a.hacknet_node_level_cost_mult}),getBitNodeMultipliers:t=>()=>{if(h.a.sourceFileLvl(5)<=0&&5!==h.a.bitNodeN)throw t.makeRuntimeErrorMsg("Requires Source-File 5 to run.");return Object.assign({},s.a)},getServer:n=>(a=t.hostname)=>{const r=n.helper.string("hostname",a),i=e(r,n),o=Object.assign({},i);return o.contracts=void 0,o.messages=void 0,o.runningScripts=void 0,o.scripts=void 0,o.textFiles=void 0,o.programs=void 0,o.serversOnNetwork=void 0,o.baseDifficulty||(o.baseDifficulty=0),o.hackDifficulty||(o.hackDifficulty=0),o.minDifficulty||(o.minDifficulty=0),o.moneyAvailable||(o.moneyAvailable=0),o.moneyMax||(o.moneyMax=0),o.numOpenPortsRequired||(o.numOpenPortsRequired=0),o.openPortCount||(o.openPortCount=0),o.requiredHackingSkill||(o.requiredHackingSkill=0),o.serverGrowth||(o.serverGrowth=0),o},getServerMoneyAvailable:t=>n=>{const a=t.helper.string("hostname",n),r=e(a,t);return r instanceof _.a?lt(r,"getServerMoneyAvailable")?0:"home"==r.hostname?(t.log(()=>"returned player's money: "+T.a.formatMoney(h.a.money)),h.a.money):(t.log(()=>`returned ${T.a.formatMoney(r.moneyAvailable)} for '${r.hostname}'`),r.moneyAvailable):(t.log(()=>"Cannot be executed on this server."),0)},getServerSecurityLevel:t=>n=>{const a=t.helper.string("hostname",n),r=e(a,t);return r instanceof _.a?lt(r,"getServerSecurityLevel")?1:(t.log(()=>`returned ${T.a.formatServerSecurity(r.hackDifficulty)} for '${r.hostname}'`),r.hackDifficulty):(t.log(()=>"Cannot be executed on this server."),1)},getServerBaseSecurityLevel:t=>n=>{const a=t.helper.string("hostname",n);t.log(()=>"getServerBaseSecurityLevel is deprecated because it's not useful.");const r=e(a,t);return r instanceof _.a?lt(r,"getServerBaseSecurityLevel")?1:(t.log(()=>`returned ${T.a.formatServerSecurity(r.baseDifficulty)} for '${r.hostname}'`),r.baseDifficulty):(t.log(()=>"Cannot be executed on this server."),1)},getServerMinSecurityLevel:t=>n=>{const a=t.helper.string("hostname",n),r=e(a,t);return r instanceof _.a?lt(r,"getServerMinSecurityLevel")?1:(t.log(()=>`returned ${T.a.formatServerSecurity(r.minDifficulty)} for ${r.hostname}`),r.minDifficulty):(t.log(()=>"Cannot be executed on this server."),1)},getServerRequiredHackingLevel:t=>n=>{const a=t.helper.string("hostname",n),r=e(a,t);return r instanceof _.a?lt(r,"getServerRequiredHackingLevel")?1:(t.log(()=>`returned ${T.a.formatSkill(r.requiredHackingSkill)} for '${r.hostname}'`),r.requiredHackingSkill):(t.log(()=>"Cannot be executed on this server."),1)},getServerMaxMoney:t=>n=>{const a=t.helper.string("hostname",n),r=e(a,t);return r instanceof _.a?lt(r,"getServerMaxMoney")?0:(t.log(()=>`returned ${T.a.formatMoney(r.moneyMax)} for '${r.hostname}'`),r.moneyMax):(t.log(()=>"Cannot be executed on this server."),0)},getServerGrowth:t=>n=>{const a=t.helper.string("hostname",n),r=e(a,t);return r instanceof _.a?lt(r,"getServerGrowth")?1:(t.log(()=>`returned ${r.serverGrowth} for '${r.hostname}'`),r.serverGrowth):(t.log(()=>"Cannot be executed on this server."),1)},getServerNumPortsRequired:t=>n=>{const a=t.helper.string("hostname",n),r=e(a,t);return r instanceof _.a?lt(r,"getServerNumPortsRequired")?5:(t.log(()=>`returned ${r.numOpenPortsRequired} for '${r.hostname}'`),r.numOpenPortsRequired):(t.log(()=>"Cannot be executed on this server."),5)},getServerRam:t=>n=>{const a=t.helper.string("hostname",n);t.log(()=>"getServerRam is deprecated in favor of getServerMaxRam / getServerUsedRam");const r=e(a,t);return t.log(()=>`returned [${T.a.formatRAM(r.maxRam)}, ${T.a.formatRAM(r.ramUsed)}]`),[r.maxRam,r.ramUsed]},getServerMaxRam:t=>n=>{const a=t.helper.string("hostname",n),r=e(a,t);return t.log(()=>"returned "+T.a.formatRAM(r.maxRam)),r.maxRam},getServerUsedRam:t=>n=>{const a=t.helper.string("hostname",n),r=e(a,t);return t.log(()=>"returned "+T.a.formatRAM(r.ramUsed)),r.ramUsed},serverExists:t=>e=>{const n=t.helper.string("hostname",e);return null!==Object(E.d)(n)},fileExists:n=>(a,r=t.hostname)=>{const i=n.helper.string("filename",a),o=n.helper.string("hostname",r);if(void 0===i)throw n.makeRuntimeErrorMsg("Usage: fileExists(scriptname, [server])");const s=e(o,n);for(let t=0;t(r,i=t.hostname,...o)=>{if(void 0===r||void 0===i)throw e.makeRuntimeErrorMsg("Usage: isRunning(scriptname, server, [arg1], [arg2]...)");return"number"==typeof r?null!=a(r):null!=n(e,r,i,o)},getPurchasedServerLimit:()=>()=>Object(k.b)(),getPurchasedServerMaxRam:()=>()=>Object(k.c)(),getPurchasedServerCost:t=>e=>{const n=t.helper.number("ram",e),a=Object(k.a)(n);return a===1/0?(t.log(()=>`Invalid argument: ram='${n}'`),1/0):a},purchaseServer:t=>(e,n)=>{const a=t.helper.string("name",e),r=t.helper.number("ram",n);let i=String(a);if(i=i.replace(/\s+/g,""),""==i)return t.log(()=>`Invalid argument: hostname='${i}'`),"";if(h.a.purchasedServers.length>=Object(k.b)())return t.log(()=>`You have reached the maximum limit of ${Object(k.b)()} servers. You cannot purchase any more.`),"";const o=Object(k.a)(r);if(o===1/0)return r>Object(k.c)()?t.log(()=>`Invalid argument: ram='${r}' must not be greater than getPurchaseServerMaxRam`):t.log(()=>`Invalid argument: ram='${r}' must be a positive power of 2`),"";if(h.a.money"Not enough money to purchase server. Need "+T.a.formatMoney(o)),"";const s=Object(v.g)({ip:Object(E.e)(),hostname:i,organizationName:"",isConnectedTo:!1,adminRights:!0,purchasedByPlayer:!0,maxRam:r});Object(E.a)(s),h.a.purchasedServers.push(s.hostname);const l=h.a.getHomeComputer();return l.serversOnNetwork.push(s.hostname),s.serversOnNetwork.push(l.hostname),h.a.loseMoney(o,"servers"),t.log(()=>`Purchased new server with hostname '${s.hostname}' for ${T.a.formatMoney(o)}`),s.hostname},deleteServer:e=>n=>{const a=e.helper.string("name",n);let r=String(a);r=r.replace(/\s\s+/g,"");const i=Object(E.d)(r);if(!(i instanceof _.a))return e.log(()=>`Invalid argument: hostname='${r}'`),!1;if(!i.purchasedByPlayer||"home"===i.hostname)return e.log(()=>"Cannot delete non-purchased server."),!1;const o=i.hostname;if(i.isConnectedTo)return e.log(()=>"You are currently connected to the server you are trying to delete."),!1;if(o===t.hostname)return e.log(()=>"Cannot delete the server this script is running on."),!1;if(i.runningScripts.length>0)return e.log(()=>`Cannot delete server '${o}' because it still has scripts running.`),!1;let s=!1;for(let t=0;t`Could not identify server ${o} as a purchased server. This is a bug. Report to dev.`),!1;Object(E.b)(o),s=!1;const l=h.a.getHomeComputer();for(let t=0;t"Deleted server '"+r),!0;return e.log(()=>`Could not find server ${o} as a purchased server. This is a bug. Report to dev.`),!1},getPurchasedServers:()=>()=>{const t=[];return h.a.purchasedServers.forEach((function(e){t.push(e)})),t},writePort:t=>(e,n="")=>{const a=t.helper.number("port",e);if("string"!=typeof n&&"number"!=typeof n)throw t.makeRuntimeErrorMsg("Trying to write invalid data to a port: only strings and numbers are valid.");const r=mt.getValidPort("writePort",a);return Promise.resolve(r.write(n))},write:e=>(n,a="",r="a")=>{const i=e.helper.string("port",n),o=e.helper.string("mode",r);if(Object(P.a)(i)){let n=i;if(!Object(S.j)(n))throw e.makeRuntimeErrorMsg("Invalid filepath: "+n);0===n.lastIndexOf("/")&&(n=Object(S.k)(n));try{a=String(a)}catch(t){throw e.makeRuntimeErrorMsg(`Invalid data (${t}). Data being written must be convertible to a string`)}const r=t.getServer();if(null==r)throw e.makeRuntimeErrorMsg("Error getting Server. This is a bug. Report to dev.");if(Object(y.a)(n)){let e=t.getScriptOnServer(n,r);return null==e?(e=new p.a(h.a,n,a,r.hostname,r.scripts),r.scripts.push(e),e.updateRamUsage(h.a,r.scripts)):("w"===o?e.code=a:e.code+=a,e.updateRamUsage(h.a,r.scripts))}{const t=Object(x.c)(n,r);if(null==t)return Object(x.b)(n,a,r),Promise.resolve();"w"===o?t.write(a):t.append(a)}return Promise.resolve()}throw e.makeRuntimeErrorMsg("Invalid argument: "+i)},tryWritePort:t=>(e,n="")=>{let a=t.helper.number("port",e);if("string"!=typeof n&&"number"!=typeof n)throw ct("tryWritePort","Trying to write invalid data to a port: only strings and numbers are valid.");if(isNaN(a))throw t.makeRuntimeErrorMsg("Invalid argument: "+a);{if(a=Math.round(a),a<1||a>l.a.NumNetscriptPorts)throw ct("tryWritePort",`Invalid port: ${a}. Only ports 1-${l.a.NumNetscriptPorts} are valid.`);const e=C.a[a-1];if(null==e||!(e instanceof Object))throw t.makeRuntimeErrorMsg(`Could not find port: ${a}. This is a bug. Report to dev.`);return Promise.resolve(e.tryWrite(n))}},readPort:t=>e=>{const n=t.helper.number("port",e);return mt.getValidPort("readPort",n).read()},read:e=>n=>{const a=e.helper.string("port",n);if(Object(P.a)(a)){const n=a,r=Object(E.d)(t.hostname);if(null==r)throw e.makeRuntimeErrorMsg("Error getting Server. This is a bug. Report to dev.");if(Object(y.a)(n)){const e=t.getScriptOnServer(n,r);return null==e?"":e.code}{const t=Object(x.c)(n,r);return null!==t?t.text:""}}throw e.makeRuntimeErrorMsg("Invalid argument: "+a)},peek:t=>e=>{const n=t.helper.number("port",e);return mt.getValidPort("peek",n).peek()},clear:e=>n=>{const a=e.helper.string("file",n);if(!Object(P.a)(a))throw e.makeRuntimeErrorMsg("Invalid argument: "+a);{const n=a,r=Object(E.d)(t.hostname);if(null==r)throw e.makeRuntimeErrorMsg("Error getting Server. This is a bug. Report to dev.");const i=Object(x.c)(n,r);null!=i&&i.write("")}},clearPort:t=>e=>{const n=t.helper.number("port",e);mt.getValidPort("clearPort",n).clear()},getPortHandle:t=>e=>{const n=t.helper.number("port",e);return mt.getValidPort("getPortHandle",n)},rm:n=>(a,r)=>{const i=n.helper.string("fn",a);null!=r&&""!==r||(r=t.hostname);const o=e(r,n).removeFile(i);return o.res||n.log(()=>o.msg+""),o.res},scriptRunning:t=>(n,a)=>{const r=t.helper.string("scriptname",n),i=t.helper.string("hostname",a),o=e(i,t);for(let t=0;t(n,a)=>{const r=t.helper.string("scriptname",n),i=t.helper.string("hostname",a),o=e(i,t);let s=!1;for(let t=0;t()=>t.name,getScriptRam:n=>(a,r=t.hostname)=>{const i=n.helper.string("scriptname",a),o=n.helper.string("hostname",r),s=e(o,n);for(let t=0;t(r,i,...o)=>{let s;return s=void 0===r&&void 0===i&&0===o.length?t.scriptRef:"number"==typeof r?a(r):n(e,r,i,o),null===s?null:ot(s)},getHackTime:n=>(a=t.hostname)=>{const r=n.helper.string("hostname",a),i=e(r,n);return i instanceof _.a?lt(i,"getHackTime")?1/0:1e3*Object(c.d)(i,h.a):(n.log(()=>"invalid for this kind of server"),1/0)},getGrowTime:n=>(a=t.hostname)=>{const r=n.helper.string("hostname",a),i=e(r,n);return i instanceof _.a?lt(i,"getGrowTime")?1/0:1e3*Object(c.a)(i,h.a):(n.log(()=>"invalid for this kind of server"),1/0)},getWeakenTime:n=>(a=t.hostname)=>{const r=n.helper.string("hostname",a),i=e(r,n);return i instanceof _.a?lt(i,"getWeakenTime")?1/0:1e3*Object(c.f)(i,h.a):(n.log(()=>"invalid for this kind of server"),1/0)},getScriptIncome:t=>(n,a,...r)=>{if(void 0===n){const t=[];let e=0;for(const t of O.a.values())e+=t.scriptRef.onlineMoneyMade/t.scriptRef.onlineRunningTime;return t.push(e),t.push(h.a.scriptProdSinceLastAug/(h.a.playtimeSinceLastAug/1e3)),t}{const i=e(a,t),o=Object(g.a)(n,r,i);return null==o?(t.log(()=>`No such script '${n}' on '${i.hostname}' with args: ${Object(N.a)(r)}`),-1):o.onlineMoneyMade/o.onlineRunningTime}},getScriptExpGain:t=>(n,a,...r)=>{if(void 0===n){let t=0;for(const e of O.a.values())t+=e.scriptRef.onlineExpGained/e.scriptRef.onlineRunningTime;return t}{const i=e(a,t),o=Object(g.a)(n,r,i);return null==o?(t.log(()=>`No such script '${n}' on '${i.hostname}' with args: ${Object(N.a)(r)}`),-1):o.onlineExpGained/o.onlineRunningTime}},nFormat:t=>(e,n)=>{const a=t.helper.number("n",e),r=t.helper.string("format",n);return isNaN(a)?"":T.a.format(a,r)},tFormat:t=>(e,n=!1)=>{const a=t.helper.number("milliseconds",e),r=mt.boolean(n);return Object(A.d)(a,r)},getTimeSinceLastAug:()=>()=>h.a.playtimeSinceLastAug,alert:t=>e=>{const n=t.helper.string("message",e);Object(J.a)(n)},toast:t=>(e,n=X.d.SUCCESS,a=2e3)=>{const r=t.helper.string("message",e),i=t.helper.string("variant",n);if(!Object(Q.a)(X.d,i))throw new Error("variant must be one of "+Object.values(X.d).join(", "));X.b.emit(r,i,a)},prompt:t=>(e,n)=>{const a=t.helper.string("txt",e);return new Promise((function(t){b.a.emit({txt:a,options:n,resolve:t})}))},wget:n=>async(a,i,o=t.hostname)=>{const s=n.helper.string("url",a),l=n.helper.string("target",i),c=n.helper.string("hostname",o);if(!Object(y.a)(l)&&!l.endsWith(".txt"))return n.log(()=>`Invalid target file: '${l}'. Must be a script or text file.`),Promise.resolve(!1);const f=e(c,n);return new Promise((function(t){r.a.get(s,(function(e){let a;return a=Object(y.a)(l)?f.writeToScriptFile(h.a,l,e):f.writeToTextFile(l,e),a.success?a.overwritten?(n.log(()=>`Successfully retrieved content and overwrote '${l}' on '${c}'`),t(!0)):(n.log(()=>`Successfully retrieved content to new file '${l}' on '${c}'`),t(!0)):(n.log(()=>"Failed."),t(!1))}),"text").fail((function(e){return n.log(()=>JSON.stringify(e)),t(!1)}))}))},getFavorToDonate:()=>()=>Math.floor(l.a.BaseFavorToDonate*s.a.RepToDonateToFaction),getOwnedSourceFiles:()=>()=>{const t=[];for(let e=0;e()=>{const t={hacking:h.a.hacking,hp:h.a.hp,max_hp:h.a.max_hp,strength:h.a.strength,defense:h.a.defense,dexterity:h.a.dexterity,agility:h.a.agility,charisma:h.a.charisma,intelligence:h.a.intelligence,hacking_chance_mult:h.a.hacking_chance_mult,hacking_speed_mult:h.a.hacking_speed_mult,hacking_money_mult:h.a.hacking_money_mult,hacking_grow_mult:h.a.hacking_grow_mult,hacking_exp:h.a.hacking_exp,strength_exp:h.a.strength_exp,defense_exp:h.a.defense_exp,dexterity_exp:h.a.dexterity_exp,agility_exp:h.a.agility_exp,charisma_exp:h.a.charisma_exp,hacking_mult:h.a.hacking_mult,strength_mult:h.a.strength_mult,defense_mult:h.a.defense_mult,dexterity_mult:h.a.dexterity_mult,agility_mult:h.a.agility_mult,charisma_mult:h.a.charisma_mult,hacking_exp_mult:h.a.hacking_exp_mult,strength_exp_mult:h.a.strength_exp_mult,defense_exp_mult:h.a.defense_exp_mult,dexterity_exp_mult:h.a.dexterity_exp_mult,agility_exp_mult:h.a.agility_exp_mult,charisma_exp_mult:h.a.charisma_exp_mult,company_rep_mult:h.a.company_rep_mult,faction_rep_mult:h.a.faction_rep_mult,numPeopleKilled:h.a.numPeopleKilled,money:h.a.money,city:h.a.city,location:h.a.location,companyName:h.a.companyName,crime_money_mult:h.a.crime_money_mult,crime_success_mult:h.a.crime_success_mult,isWorking:h.a.isWorking,workType:h.a.workType,currentWorkFactionName:h.a.currentWorkFactionName,currentWorkFactionDescription:h.a.currentWorkFactionDescription,workHackExpGainRate:h.a.workHackExpGainRate,workStrExpGainRate:h.a.workStrExpGainRate,workDefExpGainRate:h.a.workDefExpGainRate,workDexExpGainRate:h.a.workDexExpGainRate,workAgiExpGainRate:h.a.workAgiExpGainRate,workChaExpGainRate:h.a.workChaExpGainRate,workRepGainRate:h.a.workRepGainRate,workMoneyGainRate:h.a.workMoneyGainRate,workMoneyLossRate:h.a.workMoneyLossRate,workHackExpGained:h.a.workHackExpGained,workStrExpGained:h.a.workStrExpGained,workDefExpGained:h.a.workDefExpGained,workDexExpGained:h.a.workDexExpGained,workAgiExpGained:h.a.workAgiExpGained,workChaExpGained:h.a.workChaExpGained,workRepGained:h.a.workRepGained,workMoneyGained:h.a.workMoneyGained,createProgramName:h.a.createProgramName,createProgramReqLvl:h.a.createProgramReqLvl,className:h.a.className,crimeType:h.a.crimeType,work_money_mult:h.a.work_money_mult,hacknet_node_money_mult:h.a.hacknet_node_money_mult,hacknet_node_purchase_cost_mult:h.a.hacknet_node_purchase_cost_mult,hacknet_node_ram_cost_mult:h.a.hacknet_node_ram_cost_mult,hacknet_node_core_cost_mult:h.a.hacknet_node_core_cost_mult,hacknet_node_level_cost_mult:h.a.hacknet_node_level_cost_mult,hasWseAccount:h.a.hasWseAccount,hasTixApiAccess:h.a.hasTixApiAccess,has4SData:h.a.has4SData,has4SDataTixApi:h.a.has4SDataTixApi,bladeburner_max_stamina_mult:h.a.bladeburner_max_stamina_mult,bladeburner_stamina_gain_mult:h.a.bladeburner_stamina_gain_mult,bladeburner_analysis_mult:h.a.bladeburner_analysis_mult,bladeburner_success_chance_mult:h.a.bladeburner_success_chance_mult,bitNodeN:h.a.bitNodeN,totalPlaytime:h.a.totalPlaytime,playtimeSinceLastAug:h.a.playtimeSinceLastAug,playtimeSinceLastBitnode:h.a.playtimeSinceLastBitnode,jobs:{},factions:h.a.factions.slice(),tor:h.a.hasTorRouter(),inBladeburner:h.a.inBladeburner(),hasCorporation:h.a.hasCorporation(),entropy:h.a.entropy};return Object.assign(t.jobs,h.a.jobs),t},atExit:e=>n=>{if("function"!=typeof n)throw e.makeRuntimeErrorMsg("argument should be function");t.atExit=()=>{n()}},mv:t=>(n,a,r)=>{const i=t.helper.string("host",n),o=t.helper.string("source",a),s=t.helper.string("destination",r);if(!Object(S.j)(o))throw t.makeRuntimeErrorMsg(`Invalid filename: '${o}'`);if(!Object(S.j)(s))throw t.makeRuntimeErrorMsg(`Invalid filename: '${s}'`);const l=o.endsWith(".txt"),c=s.endsWith(".txt");if(!Object(y.a)(o)&&!l)throw t.makeRuntimeErrorMsg("'mv' can only be used on scripts and text files (.txt)");if(l!=c)throw t.makeRuntimeErrorMsg("Source and destination files must have the same type");if(o===s)return;const f=e(i,t);if(!l&&f.isRunning(o))throw t.makeRuntimeErrorMsg("Cannot use 'mv' on a script that is running");const u=l?f.textFiles:f.scripts;let m=null,h=null;for(let t=0;t[t,!0]));return Object(rt.a)(mt,{},t,dt)}},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(153),r=n(103);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()e&&(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);console.log(u),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(10);function r(t,e){return t/a.a.DonateMoneyToRepDivisor*e.faction_rep_mult}},,,,,,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, .ns, .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, .ns, .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(25),o=n(254),s=n(10);!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(33);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(33);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(154);function r(t){const e={},n=Object.keys(a.a);for(let a=0;a{var e;return c.a.createElement(a.a,{sx:{height:"fit-content",p:1}},c.a.createElement(r.a,{variant:"h6"},t.title),(null===(e=t.children)||void 0===e?void 0:e.length)>1?c.a.createElement(i.a,{disablePadding:!0,dense:!0},t.children.filter(t=>t).map((t,e)=>c.a.createElement(o.a,{key:Object(s.uniqueId)(String(e)),sx:{px:0,display:"block"}},t))):t.children)}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));class a{constructor(t){this.cards=t}addCards(...t){return new a([...this.cards,...t])}removeByIndex(t){if(t>=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(1),i=n(21),o=n(8);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(19),r=n(148),i=n(0),o=n(1390),s=n(649),l=n(101);function c(t){const e=new o.a(t.width,t.height,t.fragments),n=Object(l.a)(e),c=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,activeGrid:n,ghostGrid:c,gift:e,enter:()=>{},click:()=>{}})))}},,,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var a=n(116),r=n(255),i=n(83),o=n(225),s=n(100),l=n(340),c=n(321);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(38),o=n(29),s=n(125),l=n(1),c=n(8);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 b}));var a=n(767),r=n(685),i=n(686),o=n(394),s=n(43),l=n(439),c=n(9),f=n(377),u=n(15),m=n(385),h=n(28),d=n(22),p=n(33),g=n(10),y=n(34);class b{constructor(){this.hacking=1,this.hp=10,this.max_hp=10,this.strength=1,this.defense=1,this.dexterity=1,this.agility=1,this.charisma=1,this.intelligence=0,this.hacking_chance_mult=1,this.hacking_speed_mult=1,this.hacking_money_mult=1,this.hacking_grow_mult=1,this.hacking_exp=0,this.strength_exp=0,this.defense_exp=0,this.dexterity_exp=0,this.agility_exp=0,this.charisma_exp=0,this.intelligence_exp=0,this.hacking_mult=1,this.strength_mult=1,this.defense_mult=1,this.dexterity_mult=1,this.agility_mult=1,this.charisma_mult=1,this.hacking_exp_mult=1,this.strength_exp_mult=1,this.defense_exp_mult=1,this.dexterity_exp_mult=1,this.agility_exp_mult=1,this.charisma_exp_mult=1,this.company_rep_mult=1,this.faction_rep_mult=1,this.money=1e3+g.a.Donations,this.city=u.a.Sector12,this.location=c.a.TravelAgency,this.jobs={},this.companyName="",this.currentServer="",this.purchasedServers=[],this.hacknetNodes=[],this.hashManager=new f.a,this.factions=[],this.factionInvitations=[],this.queuedAugmentations=[],this.augmentations=[],this.sourceFiles=[],this.numPeopleKilled=0,this.karma=0,this.crime_money_mult=1,this.crime_success_mult=1,this.isWorking=!1,this.focus=!1,this.workType=y.d.None,this.workCostMult=1,this.workExpMult=1,this.currentWorkFactionName="",this.currentWorkFactionDescription="",this.workHackExpGainRate=0,this.workStrExpGainRate=0,this.workDefExpGainRate=0,this.workDexExpGainRate=0,this.workAgiExpGainRate=0,this.workChaExpGainRate=0,this.workRepGainRate=0,this.workMoneyGainRate=0,this.workMoneyLossRate=0,this.workHackExpGained=0,this.workStrExpGained=0,this.workDefExpGained=0,this.workDexExpGained=0,this.workAgiExpGained=0,this.workChaExpGained=0,this.workRepGained=0,this.workMoneyGained=0,this.createProgramName="",this.createProgramReqLvl=0,this.graftAugmentationName="",this.timeWorkedGraftAugmentation=0,this.className=y.a.None,this.crimeType=y.b.None,this.timeWorked=0,this.timeWorkedCreateProgram=0,this.timeNeededToCompleteWork=0,this.work_money_mult=1,this.hacknet_node_money_mult=1,this.hacknet_node_purchase_cost_mult=1,this.hacknet_node_ram_cost_mult=1,this.hacknet_node_core_cost_mult=1,this.hacknet_node_level_cost_mult=1,this.hasWseAccount=!1,this.hasTixApiAccess=!1,this.has4SData=!1,this.has4SDataTixApi=!1,this.gang=null,this.corporation=null,this.bladeburner=null,this.bladeburner_max_stamina_mult=1,this.bladeburner_stamina_gain_mult=1,this.bladeburner_analysis_mult=1,this.bladeburner_success_chance_mult=1,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 m.a,this.moneySourceB=new m.a,this.scriptProdSinceLastAug=0,this.exploits=[],this.achievements=[],this.terminalCommandHistory=[],this.identifier=Object(d.e)("I-"+(new Date).getTime()+navigator.userAgent+window.innerWidth+window.innerHeight+Object(p.a)(100,999)),this.init=s.hb,this.prestigeAugmentation=s.kb,this.prestigeSourceFile=s.lb,this.receiveInvite=s.tb,this.calculateSkill=s.o,this.calculateSkillProgress=s.p,this.updateSkillLevels=s.Sb,this.resetMultipliers=s.wb,this.hasProgram=s.fb,this.setMoney=s.zb,this.gainMoney=s.M,this.loseMoney=s.jb,this.canAfford=s.s,this.recordMoneySource=s.ub,this.gainHackingExp=s.K,this.gainStrengthExp=s.O,this.gainDefenseExp=s.I,this.gainDexterityExp=s.J,this.gainAgilityExp=s.F,this.gainCharismaExp=s.G,this.gainIntelligenceExp=s.L,this.gainStats=s.N,this.queryStatFromString=s.ob,this.resetWorkStatus=s.xb,this.processWorkEarnings=s.nb,this.startWork=s.Mb,this.cancelationPenalty=s.t,this.work=s.Tb,this.finishWork=s.D,this.startWorkPartTime=s.Nb,this.workPartTime=s.Vb,this.finishWorkPartTime=s.E,this.startFocusing=s.Kb,this.stopFocusing=s.Ob,this.startFactionWork=s.Jb,this.startFactionHackWork=s.Hb,this.startFactionFieldWork=s.Gb,this.startFactionSecurityWork=s.Ib,this.workForFaction=s.Ub,this.finishFactionWork=s.B,this.getWorkMoneyGain=s.Y,this.getWorkHackExpGain=s.X,this.getWorkStrExpGain=s.ab,this.getWorkDefExpGain=s.V,this.getWorkDexExpGain=s.W,this.getWorkAgiExpGain=s.T,this.getWorkChaExpGain=s.U,this.getWorkRepGain=s.Z,this.process=s.mb,this.startCreateProgramWork=s.Eb,this.createProgramWork=s.x,this.finishCreateProgramWork=s.z,this.startGraftAugmentationWork=s.Lb,this.graftAugmentationWork=s.w,this.finishGraftAugmentationWork=s.C,this.startClass=s.Db,this.takeClass=s.Pb,this.finishClass=s.y,this.startCrime=s.Fb,this.commitCrime=s.v,this.finishCrime=s.A,this.singularityStopWork=s.Bb,this.takeDamage=s.Qb,this.regenerateHp=s.vb,this.hospitalize=s.gb,this.applyForJob=s.f,this.getNextCompanyPosition=s.S,this.quitJob=s.qb,this.hasJob=s.eb,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.ib,this.reapplyAllAugmentations=s.rb,this.reapplyAllSourceFiles=s.sb,this.checkForFactionInvitations=s.u,this.setBitNodeNumber=s.yb,this.queueAugmentation=s.pb,this.gainCodingContractReward=s.H,this.travel=s.Rb,this.gotoLocation=s.db,this.canAccessGrafting=s.r,this.giveExploit=s.cb,this.giveAchievement=s.bb,this.getIntelligenceBonus=s.Q,this.getCasinoWinnings=s.P,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.factionWorkType=y.c.None,this.committingCrimeThruSingFn=!1,this.singFnCrimeWorkerScript=null,this.getMult=s.R,this.setMult=s.Ab,this.canAccessCotMG=s.q,this.sourceFileLvl=s.Cb,this.applyEntropy=a.a}whoAmI(){return"Player"}toJSON(){return Object(h.b)("PlayerObject",this)}static fromJSON(t){return Object(h.a)(b,t.data)}}h.c.constructors.PlayerObject=b},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(38),s=n(29),l=n(125),c=n(1),f=n(8);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(256),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=[];uObject(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 r})),n.d(e,"h",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"f",(function(){return s})),n.d(e,"g",(function(){return l})),n.d(e,"e",(function(){return c})),n.d(e,"b",(function(){return f})),n.d(e,"a",(function(){return u}));var a=n(146);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 f(t){return t.charAt(0).toUpperCase()+t.slice(1)}function u(t){return t.split(" ").map(t=>f(t)).join(" ")}},,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(46),r=n(367),i=n(340),o=n(33),s=n(28),l=n(1020),c=n(88),f=n(18);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){return null!=u[t]}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=["hackDifficulty","moneyAvailable","requiredHackingSkill","serverGrowth"],i=t=>{switch(typeof t){case"number":return t;case"object":return Object(o.a)(t.min,t.max);default:throw Error(`Do not know how to convert the type '${typeof t}' to a number`)}};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,i(t.maxRamExponent)));for(const e of n)void 0!==t[e]&&(r[e]=i(t[e]));const o=new a.a(r);for(const e of t.literature||[])o.messages.push(e);o.hostname===c.a.WorldDaemon&&(o.requiredHackingSkill*=f.a.WorldDaemonDifficulty),y(o),void 0!==t.networkLayer&&e[i(t.networkLayer)-1].push(o)}const s=(t,e)=>{for(const r of t)n=r,a=e(),n.serversOnNetwork.push(a.hostname),a.serversOnNetwork.push(n.hostname);var n,a};s(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";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";let a,r,i,o;n.d(e,"d",(function(){return a})),n.d(e,"c",(function(){return r})),n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o})),function(t){t.None="",t.Company="Working for Company",t.CompanyPartTime="Working for Company part-time",t.Faction="Working for Faction",t.CreateProgram="Working on Create a Program",t.StudyClass="Studying or Taking a class at university",t.Crime="Committing a crime",t.GraftAugmentation="Grafting an Augmentation"}(a||(a={})),function(t){t.None="",t.Hacking="Faction Hacking Work",t.Field="Faction Field Work",t.Security="Faction Security Work"}(r||(r={})),function(t){t.None="",t.StudyComputerScience="studying Computer Science",t.DataStructures="taking a Data Structures course",t.Networks="taking a Networks course",t.Algorithms="taking an Algorithms course",t.Management="taking a Management course",t.Leadership="taking a Leadership course",t.GymStrength="training your strength at a gym",t.GymDefense="training your defense at a gym",t.GymDexterity="training your dexterity at a gym",t.GymAgility="training your agility at a gym"}(i||(i={})),function(t){t.None="",t.Shoplift="shoplift",t.RobStore="rob a store",t.Mug="mug someone",t.Larceny="commit larceny",t.Drugs="deal drugs",t.BondForgery="forge corporate bonds",t.TraffickArms="traffick illegal arms",t.Homicide="commit homicide",t.GrandTheftAuto="commit grand theft auto",t.Kidnap="kidnap someone for ransom",t.Assassination="assassinate a high-profile target",t.Heist="pull off the ultimate heist"}(o||(o={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var a=n(0),r=n(26),i=n(5),o=n(20),s=n(28),l=n(4),c=n(12),f=n(10),u=n(79),m=n(18),h=n(119),d=n(352);function p(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class g{constructor(t={info:"",moneyCost:0,name:"",repCost:0,factions:[]}){p(this,"baseCost",0),p(this,"baseRepRequirement",0),p(this,"isSpecial",!1),p(this,"name",""),p(this,"prereqs",[]),p(this,"mults",{}),p(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_mult&&(this.mults.hacking_mult=t.hacking_mult),t.strength_mult&&(this.mults.strength_mult=t.strength_mult),t.defense_mult&&(this.mults.defense_mult=t.defense_mult),t.dexterity_mult&&(this.mults.dexterity_mult=t.dexterity_mult),t.agility_mult&&(this.mults.agility_mult=t.agility_mult),t.charisma_mult&&(this.mults.charisma_mult=t.charisma_mult),t.hacking_exp_mult&&(this.mults.hacking_exp_mult=t.hacking_exp_mult),t.strength_exp_mult&&(this.mults.strength_exp_mult=t.strength_exp_mult),t.defense_exp_mult&&(this.mults.defense_exp_mult=t.defense_exp_mult),t.dexterity_exp_mult&&(this.mults.dexterity_exp_mult=t.dexterity_exp_mult),t.agility_exp_mult&&(this.mults.agility_exp_mult=t.agility_exp_mult),t.charisma_exp_mult&&(this.mults.charisma_exp_mult=t.charisma_exp_mult),t.hacking_chance_mult&&(this.mults.hacking_chance_mult=t.hacking_chance_mult),t.hacking_speed_mult&&(this.mults.hacking_speed_mult=t.hacking_speed_mult),t.hacking_money_mult&&(this.mults.hacking_money_mult=t.hacking_money_mult),t.hacking_grow_mult&&(this.mults.hacking_grow_mult=t.hacking_grow_mult),t.company_rep_mult&&(this.mults.company_rep_mult=t.company_rep_mult),t.faction_rep_mult&&(this.mults.faction_rep_mult=t.faction_rep_mult),t.crime_money_mult&&(this.mults.crime_money_mult=t.crime_money_mult),t.crime_success_mult&&(this.mults.crime_success_mult=t.crime_success_mult),t.work_money_mult&&(this.mults.work_money_mult=t.work_money_mult),t.hacknet_node_money_mult&&(this.mults.hacknet_node_money_mult=t.hacknet_node_money_mult),t.hacknet_node_purchase_cost_mult&&(this.mults.hacknet_node_purchase_cost_mult=t.hacknet_node_purchase_cost_mult),t.hacknet_node_ram_cost_mult&&(this.mults.hacknet_node_ram_cost_mult=t.hacknet_node_ram_cost_mult),t.hacknet_node_core_cost_mult&&(this.mults.hacknet_node_core_cost_mult=t.hacknet_node_core_cost_mult),t.hacknet_node_level_cost_mult&&(this.mults.hacknet_node_level_cost_mult=t.hacknet_node_level_cost_mult),t.bladeburner_max_stamina_mult&&(this.mults.bladeburner_max_stamina_mult=t.bladeburner_max_stamina_mult),t.bladeburner_stamina_gain_mult&&(this.mults.bladeburner_stamina_gain_mult=t.bladeburner_stamina_gain_mult),t.bladeburner_analysis_mult&&(this.mults.bladeburner_analysis_mult=t.bladeburner_analysis_mult),t.bladeburner_success_chance_mult&&(this.mults.bladeburner_success_chance_mult=t.bladeburner_success_chance_mult),t.infiltration_base_rep_increase&&(this.mults.infiltration_base_rep_increase=t.infiltration_base_rep_increase),t.infiltration_rep_mult&&(this.mults.infiltration_rep_mult=t.infiltration_rep_mult),t.infiltration_trade_mult&&(this.mults.infiltration_trade_mult=t.infiltration_trade_mult),t.infiltration_sell_mult&&(this.mults.infiltration_sell_mult=t.infiltration_sell_mult),t.infiltration_timer_mult&&(this.mults.infiltration_timer_mult=t.infiltration_timer_mult),t.infiltration_damage_reduction_mult&&(this.mults.infiltration_damage_reduction_mult=t.infiltration_damage_reduction_mult),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 t.hacking_mult&&t.hacking_mult==t.strength_mult&&t.hacking_mult==t.defense_mult&&t.hacking_mult==t.dexterity_mult&&t.hacking_mult==t.agility_mult&&t.hacking_mult==t.charisma_mult?s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.hacking_mult-1)," all skills"):(t.hacking_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.hacking_mult-1)," hacking skill")),t.strength_mult&&t.strength_mult==t.defense_mult&&t.strength_mult==t.dexterity_mult&&t.strength_mult==t.agility_mult?s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.strength_mult-1)," combat skills"):(t.strength_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.strength_mult-1)," strength skill")),t.defense_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.defense_mult-1)," defense skill")),t.dexterity_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.dexterity_mult-1)," dexterity skill")),t.agility_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.agility_mult-1)," agility skill"))),t.charisma_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.charisma_mult-1)," charisma skill"))),t.hacking_exp_mult&&t.hacking_exp_mult===t.strength_exp_mult&&t.hacking_exp_mult===t.defense_exp_mult&&t.hacking_exp_mult===t.dexterity_exp_mult&&t.hacking_exp_mult===t.agility_exp_mult&&t.hacking_exp_mult===t.charisma_exp_mult?s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.hacking_exp_mult-1)," exp for all skills"):(t.hacking_exp_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.hacking_exp_mult-1)," hacking exp")),t.strength_exp_mult&&t.strength_exp_mult===t.defense_exp_mult&&t.strength_exp_mult===t.dexterity_exp_mult&&t.strength_exp_mult===t.agility_exp_mult?s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.strength_exp_mult-1)," combat exp"):(t.strength_exp_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.strength_exp_mult-1)," strength exp")),t.defense_exp_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.defense_exp_mult-1)," defense exp")),t.dexterity_exp_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.dexterity_exp_mult-1)," dexterity exp")),t.agility_exp_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.agility_exp_mult-1)," agility exp"))),t.charisma_exp_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.charisma_exp_mult-1)," charisma exp"))),t.hacking_speed_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.hacking_speed_mult-1)," faster hack(), grow(), and weaken()")),t.hacking_chance_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.hacking_chance_mult-1)," hack() success chance")),t.hacking_money_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.hacking_money_mult-1)," hack() power")),t.hacking_grow_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.hacking_grow_mult-1)," grow() power")),t.faction_rep_mult&&t.faction_rep_mult===t.company_rep_mult?s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.faction_rep_mult-1)," reputation from factions and companies"):(t.faction_rep_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.faction_rep_mult-1)," reputation from factions")),t.company_rep_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.company_rep_mult-1)," reputation from companies"))),t.crime_money_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.crime_money_mult-1)," crime money")),t.crime_success_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.crime_success_mult-1)," crime success rate")),t.work_money_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.work_money_mult-1)," work money")),t.hacknet_node_money_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.hacknet_node_money_mult-1)," hacknet production")),t.hacknet_node_purchase_cost_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"-",r(-(t.hacknet_node_purchase_cost_mult-1))," hacknet nodes cost")),t.hacknet_node_level_cost_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"-",r(-(t.hacknet_node_level_cost_mult-1))," hacknet nodes upgrade cost")),t.bladeburner_max_stamina_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.bladeburner_max_stamina_mult-1)," Bladeburner Max Stamina")),t.bladeburner_stamina_gain_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.bladeburner_stamina_gain_mult-1)," Bladeburner Stamina gain")),t.bladeburner_analysis_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.bladeburner_analysis_mult-1)," Bladeburner Field Analysis effectiveness")),t.bladeburner_success_chance_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.bladeburner_success_chance_mult-1)," Bladeburner Contracts and Operations success chance")),t.infiltration_base_rep_increase&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.infiltration_base_rep_increase-1)," Infiltration ",l.a.ShadowsOfAnarchy," Reputation base reward")),t.infiltration_rep_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.infiltration_rep_mult-1)," Infiltration ",l.a.ShadowsOfAnarchy," Reputation reward")),t.infiltration_trade_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.infiltration_trade_mult-1)," Infiltration Reputation for trading information")),t.infiltration_sell_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.infiltration_sell_mult-1)," Infiltration cash reward for selling information")),t.infiltration_timer_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.infiltration_timer_mult-1)," Infiltration time per minigame")),t.infiltration_damage_reduction_mult&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),r(t.infiltration_damage_reduction_mult-1)," Infiltration health lost per failed minigame")),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 i}));var a=n(15);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,DividendMaxPercentage: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"],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 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={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,"hb",(function(){return et})),n.d(e,"kb",(function(){return nt})),n.d(e,"lb",(function(){return at})),n.d(e,"tb",(function(){return rt})),n.d(e,"o",(function(){return it})),n.d(e,"p",(function(){return ot})),n.d(e,"Sb",(function(){return st})),n.d(e,"wb",(function(){return lt})),n.d(e,"fb",(function(){return ct})),n.d(e,"zb",(function(){return ft})),n.d(e,"M",(function(){return ut})),n.d(e,"jb",(function(){return mt})),n.d(e,"s",(function(){return ht})),n.d(e,"ub",(function(){return dt})),n.d(e,"K",(function(){return pt})),n.d(e,"O",(function(){return gt})),n.d(e,"I",(function(){return yt})),n.d(e,"J",(function(){return bt})),n.d(e,"F",(function(){return Et})),n.d(e,"G",(function(){return vt})),n.d(e,"L",(function(){return kt})),n.d(e,"N",(function(){return _t})),n.d(e,"ob",(function(){return wt})),n.d(e,"xb",(function(){return St})),n.d(e,"nb",(function(){return xt})),n.d(e,"Mb",(function(){return Ct})),n.d(e,"mb",(function(){return Lt})),n.d(e,"t",(function(){return Ot})),n.d(e,"Tb",(function(){return Mt})),n.d(e,"D",(function(){return Tt})),n.d(e,"Nb",(function(){return At})),n.d(e,"Vb",(function(){return Rt})),n.d(e,"E",(function(){return Nt})),n.d(e,"Kb",(function(){return Pt})),n.d(e,"Ob",(function(){return It})),n.d(e,"Jb",(function(){return Ft})),n.d(e,"Hb",(function(){return Dt})),n.d(e,"Gb",(function(){return jt})),n.d(e,"Ib",(function(){return Bt})),n.d(e,"Ub",(function(){return Gt})),n.d(e,"B",(function(){return Wt})),n.d(e,"Y",(function(){return Ht})),n.d(e,"X",(function(){return Ut})),n.d(e,"ab",(function(){return qt})),n.d(e,"V",(function(){return $t})),n.d(e,"W",(function(){return Kt})),n.d(e,"T",(function(){return zt})),n.d(e,"U",(function(){return Vt})),n.d(e,"Z",(function(){return Yt})),n.d(e,"Eb",(function(){return Jt})),n.d(e,"x",(function(){return Xt})),n.d(e,"z",(function(){return Qt})),n.d(e,"Lb",(function(){return Zt})),n.d(e,"w",(function(){return te})),n.d(e,"C",(function(){return ee})),n.d(e,"Db",(function(){return ne})),n.d(e,"Pb",(function(){return ae})),n.d(e,"y",(function(){return re})),n.d(e,"Fb",(function(){return ie})),n.d(e,"v",(function(){return oe})),n.d(e,"A",(function(){return se})),n.d(e,"Bb",(function(){return le})),n.d(e,"Qb",(function(){return ce})),n.d(e,"vb",(function(){return fe})),n.d(e,"gb",(function(){return ue})),n.d(e,"f",(function(){return me})),n.d(e,"S",(function(){return he})),n.d(e,"qb",(function(){return de})),n.d(e,"eb",(function(){return pe})),n.d(e,"m",(function(){return ge})),n.d(e,"l",(function(){return ye})),n.d(e,"e",(function(){return be})),n.d(e,"j",(function(){return Ee})),n.d(e,"g",(function(){return ve})),n.d(e,"c",(function(){return ke})),n.d(e,"b",(function(){return _e})),n.d(e,"k",(function(){return we})),n.d(e,"a",(function(){return Se})),n.d(e,"d",(function(){return xe})),n.d(e,"h",(function(){return Ce})),n.d(e,"n",(function(){return Le})),n.d(e,"i",(function(){return Oe})),n.d(e,"ib",(function(){return Me})),n.d(e,"rb",(function(){return Te})),n.d(e,"sb",(function(){return Ae})),n.d(e,"u",(function(){return Re})),n.d(e,"yb",(function(){return Ne})),n.d(e,"pb",(function(){return Pe})),n.d(e,"H",(function(){return Ie})),n.d(e,"Rb",(function(){return Fe})),n.d(e,"db",(function(){return De})),n.d(e,"r",(function(){return je})),n.d(e,"cb",(function(){return Be})),n.d(e,"bb",(function(){return Ge})),n.d(e,"Q",(function(){return We})),n.d(e,"P",(function(){return He})),n.d(e,"R",(function(){return Ue})),n.d(e,"Ab",(function(){return qe})),n.d(e,"q",(function(){return $e})),n.d(e,"Cb",(function(){return Ke}));var a=n(119),r=n(341),i=n(12),o=n(18),s=n(116),l=n(238),c=n(67),f=n(682),u=n(537),m=n(95),h=n(31),d=n(10),p=n(65),g=n(379),y=n(86),b=n(185),E=n(26),v=n(82),k=n(154),_=n(186),w=n(15),S=n(9),x=n(326),C=n(181),L=n(284),O=n(244),M=n(24),T=n(46),A=n(137),R=n(88),N=n(1367),P=n(1368),I=n(371),F=n(529),D=n(406),j=n(92),B=n(5),G=n(385),W=n(14),H=n(22),U=n(128),q=n(20),$=n(0),K=n.n($),z=n(367),V=n(94),Y=n(793),J=n(300),X=n(4),Q=n(2),Z=n(269),tt=n(34);function et(){const t=Object(A.g)({adminRights:!0,hostname:"home",ip:Object(M.e)(),isConnectedTo:!0,maxRam:8,organizationName:"Home PC",purchasedByPlayer:!0});this.currentServer=R.a.Home,Object(M.a)(t),this.getHomeComputer().programs.push(p.a.NukeProgram.name)}function nt(){this.currentServer=R.a.Home,this.numPeopleKilled=0,this.hacking=1,this.strength=1,this.defense=1,this.dexterity=1,this.agility=1,this.charisma=1,this.hacking_exp=0,this.strength_exp=0,this.defense_exp=0,this.dexterity_exp=0,this.agility_exp=0,this.charisma_exp=0,this.money=1e3+d.a.Donations,this.city=w.a.Sector12,this.location=S.a.TravelAgency,this.companyName="",this.jobs={},this.purchasedServers=[],this.factions=[],this.factionInvitations=[],this.queuedAugmentations=[];const t=Math.min(3,this.sourceFileLvl(10)+(10===this.bitNodeN?1:0))+this.sleevesFromCovenant;this.sleeves.length>t&&(this.sleeves.length=t);for(let e=this.sleeves.length;e=100?this.sleeves[t].synchronize(this):this.sleeves[t].shockRecovery(this));this.isWorking=!1,this.currentWorkFactionName="",this.currentWorkFactionDescription="",this.createProgramName="",this.className=tt.a.None,this.crimeType=tt.b.None,this.workHackExpGainRate=0,this.workStrExpGainRate=0,this.workDefExpGainRate=0,this.workDexExpGainRate=0,this.workAgiExpGainRate=0,this.workChaExpGainRate=0,this.workRepGainRate=0,this.workMoneyGainRate=0,this.workHackExpGained=0,this.workStrExpGained=0,this.workDefExpGained=0,this.workDexExpGained=0,this.workAgiExpGained=0,this.workChaExpGained=0,this.workRepGained=0,this.workMoneyGained=0,this.timeWorked=0,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=this.max_hp}function at(){this.entropy=0,this.prestigeAugmentation(),this.karma=0;for(let t=0;t0?this.intelligence=Math.floor(this.calculateSkill(this.intelligence_exp)):this.intelligence=0;const t=this.hp/this.max_hp;this.max_hp=Math.floor(10+this.defense/10),this.hp=Math.round(this.max_hp*t)}function lt(){this.hacking_chance_mult=1,this.hacking_speed_mult=1,this.hacking_money_mult=1,this.hacking_grow_mult=1,this.hacking_mult=1,this.strength_mult=1,this.defense_mult=1,this.dexterity_mult=1,this.agility_mult=1,this.charisma_mult=1,this.hacking_exp_mult=1,this.strength_exp_mult=1,this.defense_exp_mult=1,this.dexterity_exp_mult=1,this.agility_exp_mult=1,this.charisma_exp_mult=1,this.company_rep_mult=1,this.faction_rep_mult=1,this.crime_money_mult=1,this.crime_success_mult=1,this.hacknet_node_money_mult=1,this.hacknet_node_purchase_cost_mult=1,this.hacknet_node_ram_cost_mult=1,this.hacknet_node_core_cost_mult=1,this.hacknet_node_level_cost_mult=1,this.work_money_mult=1,this.bladeburner_max_stamina_mult=1,this.bladeburner_stamina_gain_mult=1,this.bladeburner_analysis_mult=1,this.bladeburner_success_chance_mult=1}function ct(t){const e=this.getHomeComputer();if(null==e)return!1;for(let n=0;n=t}function dt(t,e){this.moneySourceA instanceof G.a||(console.warn("Player.moneySourceA was not properly initialized. Resetting"),this.moneySourceA=new G.a),this.moneySourceB instanceof G.a||(console.warn("Player.moneySourceB was not properly initialized. Resetting"),this.moneySourceB=new G.a),this.moneySourceA.record(t,e),this.moneySourceB.record(t,e)}function pt(t){isNaN(t)?console.error("ERR: NaN passed into Player.gainHackingExp()"):(this.hacking_exp+=t,this.hacking_exp<0&&(this.hacking_exp=0),this.hacking=Object(C.b)(this.hacking_exp,this.hacking_mult*o.a.HackingLevelMultiplier))}function gt(t){isNaN(t)?console.error("ERR: NaN passed into Player.gainStrengthExp()"):(this.strength_exp+=t,this.strength_exp<0&&(this.strength_exp=0),this.strength=Object(C.b)(this.strength_exp,this.strength_mult*o.a.StrengthLevelMultiplier))}function yt(t){if(isNaN(t))return void console.error("ERR: NaN passed into player.gainDefenseExp()");this.defense_exp+=t,this.defense_exp<0&&(this.defense_exp=0),this.defense=Object(C.b)(this.defense_exp,this.defense_mult*o.a.DefenseLevelMultiplier);const e=this.hp/this.max_hp;this.max_hp=Math.floor(10+this.defense/10),this.hp=Math.round(this.max_hp*e)}function bt(t){isNaN(t)?console.error("ERR: NaN passed into Player.gainDexterityExp()"):(this.dexterity_exp+=t,this.dexterity_exp<0&&(this.dexterity_exp=0),this.dexterity=Object(C.b)(this.dexterity_exp,this.dexterity_mult*o.a.DexterityLevelMultiplier))}function Et(t){isNaN(t)?console.error("ERR: NaN passed into Player.gainAgilityExp()"):(this.agility_exp+=t,this.agility_exp<0&&(this.agility_exp=0),this.agility=Object(C.b)(this.agility_exp,this.agility_mult*o.a.AgilityLevelMultiplier))}function vt(t){isNaN(t)?console.error("ERR: NaN passed into Player.gainCharismaExp()"):(this.charisma_exp+=t,this.charisma_exp<0&&(this.charisma_exp=0),this.charisma=Object(C.b)(this.charisma_exp,this.charisma_mult*o.a.CharismaLevelMultiplier))}function kt(t){isNaN(t)?console.error("ERROR: NaN passed into Player.gainIntelligenceExp()"):(Q.a.sourceFileLvl(5)>0||this.intelligence>0)&&(this.intelligence_exp+=t,this.intelligence=Math.floor(this.calculateSkill(this.intelligence_exp,1)))}function _t(t){this.gainHackingExp(t.hack*this.hacking_exp_mult),this.gainStrengthExp(t.str*this.strength_exp_mult),this.gainDefenseExp(t.def*this.defense_exp_mult),this.gainDexterityExp(t.dex*this.dexterity_exp_mult),this.gainAgilityExp(t.agi*this.agility_exp_mult),this.gainCharismaExp(t.cha*this.charisma_exp_mult),this.gainIntelligenceExp(t.int)}function wt(t){const e=t.toLowerCase();return e.includes("hack")?this.hacking:e.includes("str")?this.strength:e.includes("def")?this.defense:e.includes("dex")?this.dexterity:e.includes("agi")?this.agility:e.includes("cha")?this.charisma:e.includes("int")?this.intelligence:0}function St(t,e,n){this.workType!==tt.d.Faction&&t===this.workType&&e===this.companyName||t===this.workType&&e===this.currentWorkFactionName&&n===this.factionWorkType||(this.isWorking&&this.singularityStopWork(),this.workHackExpGainRate=0,this.workStrExpGainRate=0,this.workDefExpGainRate=0,this.workDexExpGainRate=0,this.workAgiExpGainRate=0,this.workChaExpGainRate=0,this.workRepGainRate=0,this.workMoneyGainRate=0,this.workMoneyLossRate=0,this.workHackExpGained=0,this.workStrExpGained=0,this.workDefExpGained=0,this.workDexExpGained=0,this.workAgiExpGained=0,this.workChaExpGained=0,this.workRepGained=0,this.workMoneyGained=0,this.timeWorked=0,this.timeWorkedCreateProgram=0,this.timeWorkedGraftAugmentation=0,this.currentWorkFactionName="",this.currentWorkFactionDescription="",this.createProgramName="",this.graftAugmentationName="",this.className=tt.a.None,this.workType=tt.d.None)}function xt(t=1){let e=1;this.hasAugmentation(i.a.NeuroreceptorManager)||(e=this.focus?1:d.a.BaseFocusBonus);const n=e*this.workHackExpGainRate*t,a=e*this.workStrExpGainRate*t,r=e*this.workDefExpGainRate*t,o=e*this.workDexExpGainRate*t,s=e*this.workAgiExpGainRate*t,l=e*this.workChaExpGainRate*t,c=(this.workMoneyGainRate-this.workMoneyLossRate)*t;this.gainHackingExp(n),this.gainStrengthExp(a),this.gainDefenseExp(r),this.gainDexterityExp(o),this.gainAgilityExp(s),this.gainCharismaExp(l),this.gainMoney(c,this.className?"class":"work"),this.workHackExpGained+=n,this.workStrExpGained+=a,this.workDefExpGained+=r,this.workDexExpGained+=o,this.workAgiExpGained+=s,this.workChaExpGained+=l,this.workRepGained+=e*this.workRepGainRate*t,this.workMoneyGained+=e*this.workMoneyGainRate*t,this.workMoneyGained-=e*this.workMoneyLossRate*t}function Ct(t){this.resetWorkStatus(tt.d.Company,t),this.isWorking=!0,this.companyName=t,this.workType=tt.d.Company,this.workHackExpGainRate=this.getWorkHackExpGain(),this.workStrExpGainRate=this.getWorkStrExpGain(),this.workDefExpGainRate=this.getWorkDefExpGain(),this.workDexExpGainRate=this.getWorkDexExpGain(),this.workAgiExpGainRate=this.getWorkAgiExpGain(),this.workChaExpGainRate=this.getWorkChaExpGain(),this.workRepGainRate=this.getWorkRepGain(),this.workMoneyGainRate=this.getWorkMoneyGain(),this.timeNeededToCompleteWork=d.a.MillisecondsPer8Hours}function Lt(t,e=1){this.isWorking&&(this.workType===tt.d.Faction?this.workForFaction(e)&&t.toFaction(E.a[this.currentWorkFactionName]):this.workType===tt.d.CreateProgram?this.createProgramWork(e)&&t.toTerminal():this.workType===tt.d.StudyClass?this.takeClass(e)&&t.toCity():this.workType===tt.d.Crime?this.commitCrime(e)&&t.toLocation(_.a[S.a.Slums]):this.workType===tt.d.CompanyPartTime?this.workPartTime(e)&&t.toCity():this.workType===tt.d.GraftAugmentation?this.graftAugmentationWork(e)&&t.toGrafting():this.work(e)&&t.toCity())}function Ot(){const t=z.a.find(t=>t.specialName===this.companyName);if(!t)return.5;const e=Object(M.d)(t.hostname);return e instanceof T.a&&e&&e.backdoorInstalled?.75:.5}function Mt(t){let e=!1;this.timeWorked+d.a._idleSpeed*t>=d.a.MillisecondsPer8Hours&&(e=!0,t=Math.round((d.a.MillisecondsPer8Hours-this.timeWorked)/d.a._idleSpeed)),this.timeWorked+=d.a._idleSpeed*t,this.workRepGainRate=this.getWorkRepGain(),this.workMoneyGainRate=this.getWorkMoneyGain(),this.processWorkEarnings(t);const n=c.a[this.companyName];return Object(F.a)(n,this.workRepGainRate,t),!!(e||this.timeWorked>=d.a.MillisecondsPer8Hours)&&(this.finishWork(!1),!0)}function Tt(t,e=!1){t&&(this.workRepGained*=this.cancelationPenalty());const n=.5===this.cancelationPenalty()?"half":"three-quarters";c.a[this.companyName].playerReputation+=this.workRepGained,this.updateSkillLevels();let a=K.a.createElement(K.a.Fragment,null,"You earned a total of: ",K.a.createElement("br",null),K.a.createElement(q.a,{money:this.workMoneyGained}),K.a.createElement("br",null),K.a.createElement(U.a,{reputation:this.workRepGained})," reputation for the company ",K.a.createElement("br",null),this.workHackExpGained>0&&K.a.createElement(K.a.Fragment,null,B.a.formatExp(this.workHackExpGained)," hacking exp ",K.a.createElement("br",null)),this.workStrExpGained>0&&K.a.createElement(K.a.Fragment,null,B.a.formatExp(this.workStrExpGained)," strength exp ",K.a.createElement("br",null)),this.workDefExpGained>0&&K.a.createElement(K.a.Fragment,null,B.a.formatExp(this.workDefExpGained)," defense exp ",K.a.createElement("br",null)),this.workDexExpGained>0&&K.a.createElement(K.a.Fragment,null,B.a.formatExp(this.workDexExpGained)," dexterity exp ",K.a.createElement("br",null)),this.workAgiExpGained>0&&K.a.createElement(K.a.Fragment,null,B.a.formatExp(this.workAgiExpGained)," agility exp ",K.a.createElement("br",null)),this.workChaExpGained>0&&K.a.createElement(K.a.Fragment,null,B.a.formatExp(this.workChaExpGained)," charisma exp ",K.a.createElement("br",null)),K.a.createElement("br",null));if(a=t?K.a.createElement(K.a.Fragment,null,"You worked a short shift of ",Object(H.d)(this.timeWorked)," ",K.a.createElement("br",null),K.a.createElement("br",null),"Since you cancelled your work early, you only gained ",n," of the reputation you earned. ",K.a.createElement("br",null),K.a.createElement("br",null),a):K.a.createElement(K.a.Fragment,null,"You worked a full shift of 8 hours! ",K.a.createElement("br",null),K.a.createElement("br",null),a),e||Object(W.a)(a),this.isWorking=!1,this.focus=!1,this.resetWorkStatus(),e){return"You worked a short shift of "+Object(H.d)(this.timeWorked)+" and earned $"+B.a.formatMoney(this.workMoneyGained)+", "+B.a.formatReputation(this.workRepGained)+" reputation, "+B.a.formatExp(this.workHackExpGained)+" hacking exp, "+B.a.formatExp(this.workStrExpGained)+" strength exp, "+B.a.formatExp(this.workDefExpGained)+" defense exp, "+B.a.formatExp(this.workDexExpGained)+" dexterity exp, "+B.a.formatExp(this.workAgiExpGained)+" agility exp, and "+B.a.formatExp(this.workChaExpGained)+" charisma exp."}return""}function At(t){this.resetWorkStatus(tt.d.CompanyPartTime,t),this.isWorking=!0,this.companyName=t,this.workType=tt.d.CompanyPartTime,this.workHackExpGainRate=this.getWorkHackExpGain(),this.workStrExpGainRate=this.getWorkStrExpGain(),this.workDefExpGainRate=this.getWorkDefExpGain(),this.workDexExpGainRate=this.getWorkDexExpGain(),this.workAgiExpGainRate=this.getWorkAgiExpGain(),this.workChaExpGainRate=this.getWorkChaExpGain(),this.workRepGainRate=this.getWorkRepGain(),this.workMoneyGainRate=this.getWorkMoneyGain(),this.timeNeededToCompleteWork=d.a.MillisecondsPer8Hours}function Rt(t){let e=!1;return this.timeWorked+d.a._idleSpeed*t>=d.a.MillisecondsPer8Hours&&(e=!0,t=Math.round((d.a.MillisecondsPer8Hours-this.timeWorked)/d.a._idleSpeed)),this.timeWorked+=d.a._idleSpeed*t,this.workRepGainRate=this.getWorkRepGain(),this.processWorkEarnings(t),!!(e||this.timeWorked>=d.a.MillisecondsPer8Hours)&&(this.finishWorkPartTime(),!0)}function Nt(t=!1){c.a[this.companyName].playerReputation+=this.workRepGained,this.updateSkillLevels();const e=K.a.createElement(K.a.Fragment,null,"You worked for ",Object(H.d)(this.timeWorked),K.a.createElement("br",null),K.a.createElement("br",null),"You earned a total of: ",K.a.createElement("br",null),K.a.createElement(q.a,{money:this.workMoneyGained}),K.a.createElement("br",null),K.a.createElement(U.a,{reputation:this.workRepGained})," reputation for the company ",K.a.createElement("br",null),B.a.formatExp(this.workHackExpGained)," hacking exp ",K.a.createElement("br",null),B.a.formatExp(this.workStrExpGained)," strength exp ",K.a.createElement("br",null),B.a.formatExp(this.workDefExpGained)," defense exp ",K.a.createElement("br",null),B.a.formatExp(this.workDexExpGained)," dexterity exp ",K.a.createElement("br",null),B.a.formatExp(this.workAgiExpGained)," agility exp ",K.a.createElement("br",null),B.a.formatExp(this.workChaExpGained)," charisma exp",K.a.createElement("br",null));if(t||Object(W.a)(e),this.isWorking=!1,this.resetWorkStatus(),t){return"You worked for "+Object(H.d)(this.timeWorked)+" and earned a total of $"+B.a.formatMoney(this.workMoneyGained)+", "+B.a.formatReputation(this.workRepGained)+" reputation, "+B.a.formatExp(this.workHackExpGained)+" hacking exp, "+B.a.formatExp(this.workStrExpGained)+" strength exp, "+B.a.formatExp(this.workDefExpGained)+" defense exp, "+B.a.formatExp(this.workDexExpGained)+" dexterity exp, "+B.a.formatExp(this.workAgiExpGained)+" agility exp, and "+B.a.formatExp(this.workChaExpGained)+" charisma exp"}return""}function Pt(){this.focus=!0}function It(){this.focus=!1}function Ft(t){let e=1+t.favor/100;isNaN(e)&&(e=1),this.workRepGainRate*=e,this.workRepGainRate*=o.a.FactionWorkRepGain,this.isWorking=!0,this.workType=tt.d.Faction,this.currentWorkFactionName=t.name,this.timeNeededToCompleteWork=d.a.MillisecondsPer20Hours}function Dt(t){this.resetWorkStatus(tt.d.Faction,t.name,tt.c.Hacking),this.workHackExpGainRate=.15*this.hacking_exp_mult*o.a.FactionWorkExpGain,this.workRepGainRate=Object(O.c)(this,t),this.factionWorkType=tt.c.Hacking,this.currentWorkFactionDescription="carrying out hacking contracts",this.startFactionWork(t)}function jt(t){this.resetWorkStatus(tt.d.Faction,t.name,tt.c.Field),this.workHackExpGainRate=.1*this.hacking_exp_mult*o.a.FactionWorkExpGain,this.workStrExpGainRate=.1*this.strength_exp_mult*o.a.FactionWorkExpGain,this.workDefExpGainRate=.1*this.defense_exp_mult*o.a.FactionWorkExpGain,this.workDexExpGainRate=.1*this.dexterity_exp_mult*o.a.FactionWorkExpGain,this.workAgiExpGainRate=.1*this.agility_exp_mult*o.a.FactionWorkExpGain,this.workChaExpGainRate=.1*this.charisma_exp_mult*o.a.FactionWorkExpGain,this.workRepGainRate=Object(O.a)(this,t),this.factionWorkType=tt.c.Field,this.currentWorkFactionDescription="carrying out field missions",this.startFactionWork(t)}function Bt(t){this.resetWorkStatus(tt.d.Faction,t.name,tt.c.Security),this.workHackExpGainRate=.05*this.hacking_exp_mult*o.a.FactionWorkExpGain,this.workStrExpGainRate=.15*this.strength_exp_mult*o.a.FactionWorkExpGain,this.workDefExpGainRate=.15*this.defense_exp_mult*o.a.FactionWorkExpGain,this.workDexExpGainRate=.15*this.dexterity_exp_mult*o.a.FactionWorkExpGain,this.workAgiExpGainRate=.15*this.agility_exp_mult*o.a.FactionWorkExpGain,this.workChaExpGainRate=0*this.charisma_exp_mult*o.a.FactionWorkExpGain,this.workRepGainRate=Object(O.b)(this,t),this.factionWorkType=tt.c.Security,this.currentWorkFactionDescription="performing security detail",this.startFactionWork(t)}function Gt(t){const e=E.a[this.currentWorkFactionName];if(!e)return!1;switch(this.factionWorkType){case tt.c.Hacking:this.workRepGainRate=Object(O.c)(this,e);break;case tt.c.Field:this.workRepGainRate=Object(O.a)(this,e);break;case tt.c.Security:this.workRepGainRate=Object(O.b)(this,e)}this.workRepGainRate*=o.a.FactionWorkRepGain;let n=!1;return this.timeWorked+d.a._idleSpeed*t>=d.a.MillisecondsPer20Hours&&(n=!0,t=Math.round((d.a.MillisecondsPer20Hours-this.timeWorked)/d.a._idleSpeed)),this.timeWorked+=d.a._idleSpeed*t,this.processWorkEarnings(t),!!(n||this.timeWorked>=d.a.MillisecondsPer20Hours)&&(this.finishFactionWork(!1),!0)}function Wt(t,e=!1){const n=E.a[this.currentWorkFactionName];n.playerReputation+=this.workRepGained,this.updateSkillLevels();let a="";return e?a="You worked for your faction "+n.name+" for a total of "+Object(H.d)(this.timeWorked)+". You earned "+B.a.formatReputation(this.workRepGained)+" rep, "+B.a.formatExp(this.workHackExpGained)+" hacking exp, "+B.a.formatExp(this.workStrExpGained)+" str exp, "+B.a.formatExp(this.workDefExpGained)+" def exp, "+B.a.formatExp(this.workDexExpGained)+" dex exp, "+B.a.formatExp(this.workAgiExpGained)+" agi exp, and "+B.a.formatExp(this.workChaExpGained)+" cha exp.":Object(W.a)(K.a.createElement(K.a.Fragment,null,"You worked for your faction ",n.name," for a total of ",Object(H.d)(this.timeWorked)," ",K.a.createElement("br",null),K.a.createElement("br",null),"You earned a total of: ",K.a.createElement("br",null),K.a.createElement(q.a,{money:this.workMoneyGained}),K.a.createElement("br",null),K.a.createElement(U.a,{reputation:this.workRepGained})," reputation for the faction ",K.a.createElement("br",null),B.a.formatExp(this.workHackExpGained)," hacking exp ",K.a.createElement("br",null),B.a.formatExp(this.workStrExpGained)," strength exp ",K.a.createElement("br",null),B.a.formatExp(this.workDefExpGained)," defense exp ",K.a.createElement("br",null),B.a.formatExp(this.workDexExpGained)," dexterity exp ",K.a.createElement("br",null),B.a.formatExp(this.workAgiExpGained)," agility exp ",K.a.createElement("br",null),B.a.formatExp(this.workChaExpGained)," charisma exp",K.a.createElement("br",null))),this.isWorking=!1,this.resetWorkStatus(),a}function Ht(){let t=1;const e=c.a[this.companyName];this.sourceFileLvl(11)>0&&(t=1+e.favor/100);const n=this.jobs[this.companyName],a=m.a[n];return null==a?(console.error(`Could not find CompanyPosition object for ${n}. Work salary will be 0`),0):a.baseSalary*e.salaryMultiplier*this.work_money_mult*o.a.CompanyWorkMoney*t}function Ut(){const t=c.a[this.companyName],e=this.jobs[this.companyName],n=m.a[e];return null==t||null==n?(console.error(["Could not find Company object for "+this.companyName,`or CompanyPosition object for ${e}.`,"Work hack exp gain will be 0"].join(" ")),0):n.hackingExpGain*t.expMultiplier*this.hacking_exp_mult*o.a.CompanyWorkExpGain}function qt(){const t=c.a[this.companyName],e=this.jobs[this.companyName],n=m.a[e];return null==t||null==n?(console.error(["Could not find Company object for "+this.companyName,`or CompanyPosition object for ${e}.`,"Work str exp gain will be 0"].join(" ")),0):n.strengthExpGain*t.expMultiplier*this.strength_exp_mult*o.a.CompanyWorkExpGain}function $t(){const t=c.a[this.companyName],e=this.jobs[this.companyName],n=m.a[e];return null==t||null==n?(console.error(["Could not find Company object for "+this.companyName,`or CompanyPosition object for ${e}.`,"Work def exp gain will be 0"].join(" ")),0):n.defenseExpGain*t.expMultiplier*this.defense_exp_mult*o.a.CompanyWorkExpGain}function Kt(){const t=c.a[this.companyName],e=this.jobs[this.companyName],n=m.a[e];return null==t||null==n?(console.error(["Could not find Company object for "+this.companyName,`or CompanyPosition object for ${e}.`,"Work dex exp gain will be 0"].join(" ")),0):n.dexterityExpGain*t.expMultiplier*this.dexterity_exp_mult*o.a.CompanyWorkExpGain}function zt(){const t=c.a[this.companyName],e=this.jobs[this.companyName],n=m.a[e];return null==t||null==n?(console.error(["Could not find Company object for "+this.companyName,`or CompanyPosition object for ${e}.`,"Work agi exp gain will be 0"].join(" ")),0):n.agilityExpGain*t.expMultiplier*this.agility_exp_mult*o.a.CompanyWorkExpGain}function Vt(){const t=c.a[this.companyName],e=this.jobs[this.companyName],n=m.a[e];return null==t||null==n?(console.error(["Could not find Company object for "+this.companyName,`or CompanyPosition object for ${e}.`,"Work cha exp gain will be 0"].join(" ")),0):n.charismaExpGain*t.expMultiplier*this.charisma_exp_mult*o.a.CompanyWorkExpGain}function Yt(){const t=c.a[this.companyName],e=this.jobs[this.companyName],n=m.a[e];if(null==t||null==n)return console.error(["Could not find Company object for "+this.companyName,`or CompanyPosition object for ${e}.`,"Work rep gain will be 0"].join(" ")),0;let a=n.calculateJobPerformance(this.hacking,this.strength,this.defense,this.dexterity,this.agility,this.charisma);a+=this.intelligence/d.a.MaxSkillLevel;let r=1+t.favor/100;return isNaN(r)&&(r=1),a*this.company_rep_mult*r}function Jt(t,e,n){this.resetWorkStatus(),this.isWorking=!0,this.workType=tt.d.CreateProgram,this.createProgramReqLvl=n,this.timeNeededToCompleteWork=e;for(let e=0;e=100)break;this.timeWorkedCreateProgram=a/100*this.timeNeededToCompleteWork,this.getHomeComputer().programs.splice(e,1)}}this.createProgramName=t}function Xt(t){let e=1;this.hasAugmentation(i.a.NeuroreceptorManager)||(e=this.focus?1:d.a.BaseFocusBonus);const n=this.createProgramReqLvl;let a=this.hacking/n*this.getIntelligenceBonus(3);return a=1+(a-1)/5,a*=e,this.timeWorked+=d.a._idleSpeed*t,this.timeWorkedCreateProgram+=d.a._idleSpeed*t*a,this.timeWorkedCreateProgram>=this.timeNeededToCompleteWork&&(this.finishCreateProgramWork(!1),!0)}function Qt(t){const e=this.createProgramName;if(t){if(!this.getHomeComputer().programs.includes(e)){const t=e+"-"+(Math.floor(this.timeWorkedCreateProgram/this.timeNeededToCompleteWork*1e4)/100).toString()+"%-INC";this.getHomeComputer().programs.push(t)}}else this.gainIntelligenceExp(d.a.IntelligenceProgramBaseExpGain*this.timeWorked/1e3),Object(W.a)(`You've finished creating ${e}!
The new program can be found on your home computer.`),this.getHomeComputer().programs.includes(e)||this.getHomeComputer().programs.push(e);return this.isWorking=!1,this.resetWorkStatus(),"You've finished creating "+e+"! The new program can be found on your home computer."}function Zt(t,e){this.resetWorkStatus(),this.isWorking=!0,this.workType=tt.d.GraftAugmentation,this.timeNeededToCompleteWork=e,this.graftAugmentationName=t}function te(t){let e=1;this.hasAugmentation(i.a.NeuroreceptorManager)||(e=this.focus?1:d.a.BaseFocusBonus);let n=Object(Z.c)(this);return n*=e,this.timeWorked+=d.a._idleSpeed*t,this.timeWorkedGraftAugmentation+=d.a._idleSpeed*t*n,this.timeWorkedGraftAugmentation>=this.timeNeededToCompleteWork&&(this.finishGraftAugmentationWork(!1),!0)}function ee(t,e=!1){const n=this.graftAugmentationName;return!1===t?(Object(a.a)({name:n,level:1}),this.hasAugmentation(i.a.CongruityImplant)||(this.entropy+=1,this.applyEntropy(this.entropy)),Object(W.a)(`You've finished grafting ${n}.
The augmentation has been applied to your body`+(this.hasAugmentation(i.a.CongruityImplant)?".":", but you feel a bit off."))):t&&!1===e&&Object(W.a)(`You cancelled the grafting of ${n}.
Your money was not returned to you.`),t||this.gainIntelligenceExp(d.a.IntelligenceGraftBaseExpGain*this.timeWorked/1e4),this.isWorking=!1,this.resetWorkStatus(),`Grafting of ${n} has ended.`}function ne(t,e,n){this.resetWorkStatus(),this.isWorking=!0,this.workType=tt.d.StudyClass,this.workCostMult=t,this.workExpMult=e,this.className=n;const a=Object(Y.a)(this);this.workMoneyLossRate=a.workMoneyLossRate,this.workHackExpGainRate=a.workHackExpGainRate,this.workStrExpGainRate=a.workStrExpGainRate,this.workDefExpGainRate=a.workDefExpGainRate,this.workDexExpGainRate=a.workDexExpGainRate,this.workAgiExpGainRate=a.workAgiExpGainRate,this.workChaExpGainRate=a.workChaExpGainRate}function ae(t){this.timeWorked+=d.a._idleSpeed*t;const e=Object(Y.a)(this);return this.workMoneyLossRate=e.workMoneyLossRate,this.workHackExpGainRate=e.workHackExpGainRate,this.workStrExpGainRate=e.workStrExpGainRate,this.workDefExpGainRate=e.workDefExpGainRate,this.workDexExpGainRate=e.workDexExpGainRate,this.workAgiExpGainRate=e.workAgiExpGainRate,this.workChaExpGainRate=e.workChaExpGainRate,this.processWorkEarnings(t),!1}function re(t=!1){if(this.gainIntelligenceExp(d.a.IntelligenceClassBaseExpGain*Math.round(this.timeWorked/1e3)),this.workMoneyGained>0)throw new Error("ERR: Somehow gained money while taking class");if(this.updateSkillLevels(),t||Object(W.a)(K.a.createElement(K.a.Fragment,null,"After ",this.className," for ",Object(H.d)(this.timeWorked),", ",K.a.createElement("br",null),"you spent a total of ",K.a.createElement(q.a,{money:-this.workMoneyGained}),". ",K.a.createElement("br",null),K.a.createElement("br",null),"You earned a total of: ",K.a.createElement("br",null),B.a.formatExp(this.workHackExpGained)," hacking exp ",K.a.createElement("br",null),B.a.formatExp(this.workStrExpGained)," strength exp ",K.a.createElement("br",null),B.a.formatExp(this.workDefExpGained)," defense exp ",K.a.createElement("br",null),B.a.formatExp(this.workDexExpGained)," dexterity exp ",K.a.createElement("br",null),B.a.formatExp(this.workAgiExpGained)," agility exp ",K.a.createElement("br",null),B.a.formatExp(this.workChaExpGained)," charisma exp",K.a.createElement("br",null))),this.isWorking=!1,t){const t="After "+this.className+" for "+Object(H.d)(this.timeWorked)+", you spent a total of "+B.a.formatMoney(-1*this.workMoneyGained)+". You earned a total of: "+B.a.formatExp(this.workHackExpGained)+" hacking exp, "+B.a.formatExp(this.workStrExpGained)+" strength exp, "+B.a.formatExp(this.workDefExpGained)+" defense exp, "+B.a.formatExp(this.workDexExpGained)+" dexterity exp, "+B.a.formatExp(this.workAgiExpGained)+" agility exp, and "+B.a.formatExp(this.workChaExpGained)+" charisma exp";return this.resetWorkStatus(),t}return this.resetWorkStatus(),""}function ie(t,e,n,a,r,i,s,l,c,f,u=null){this.crimeType=e,this.resetWorkStatus(),this.isWorking=!0,this.focus=!0,this.workType=tt.d.Crime,null!==u&&(this.committingCrimeThruSingFn=!0,this.singFnCrimeWorkerScript=u),this.workHackExpGained=n*this.hacking_exp_mult*o.a.CrimeExpGain,this.workStrExpGained=a*this.strength_exp_mult*o.a.CrimeExpGain,this.workDefExpGained=r*this.defense_exp_mult*o.a.CrimeExpGain,this.workDexExpGained=i*this.dexterity_exp_mult*o.a.CrimeExpGain,this.workAgiExpGained=s*this.agility_exp_mult*o.a.CrimeExpGain,this.workChaExpGained=l*this.charisma_exp_mult*o.a.CrimeExpGain,this.workMoneyGained=c*this.crime_money_mult*o.a.CrimeMoney,this.timeNeededToCompleteWork=f,t.toWork()}function oe(t){return this.timeWorked+=d.a._idleSpeed*t,this.timeWorked>=this.timeNeededToCompleteWork&&(this.finishCrime(!1),!0)}function se(t){if(!t){if(Object(g.a)(this,this.crimeType)){let t=null;for(const e of Object.keys(y.a))if(y.a[e].type==this.crimeType){t=y.a[e];break}if(null==t)return Object(W.a)(`ERR: Unrecognized crime type (${this.crimeType}). This is probably a bug please contact the developer`),"";this.gainMoney(this.workMoneyGained,"crime"),this.karma-=t.karma,this.numPeopleKilled+=t.kills,t.intelligence_exp>0&&this.gainIntelligenceExp(t.intelligence_exp),this.workHackExpGained*=2,this.workStrExpGained*=2,this.workDefExpGained*=2,this.workDexExpGained*=2,this.workAgiExpGained*=2,this.workChaExpGained*=2;const e=this.singFnCrimeWorkerScript;this.committingCrimeThruSingFn&&null!==e?null==e.disableLogs.ALL&&null==e.disableLogs.commitCrime&&e.scriptRef.log("SUCCESS: Crime successful! Gained "+B.a.formatMoney(this.workMoneyGained)+", "+B.a.formatExp(this.workHackExpGained)+" hack exp, "+B.a.formatExp(this.workStrExpGained)+" str exp, "+B.a.formatExp(this.workDefExpGained)+" def exp, "+B.a.formatExp(this.workDexExpGained)+" dex exp, "+B.a.formatExp(this.workAgiExpGained)+" agi exp, "+B.a.formatExp(this.workChaExpGained)+" cha exp."):Object(W.a)(K.a.createElement(K.a.Fragment,null,"Crime successful!",K.a.createElement("br",null),K.a.createElement("br",null),"You gained:",K.a.createElement("br",null),K.a.createElement(q.a,{money:this.workMoneyGained}),K.a.createElement("br",null),B.a.formatExp(this.workHackExpGained)," hacking experience ",K.a.createElement("br",null),B.a.formatExp(this.workStrExpGained)," strength experience",K.a.createElement("br",null),B.a.formatExp(this.workDefExpGained)," defense experience",K.a.createElement("br",null),B.a.formatExp(this.workDexExpGained)," dexterity experience",K.a.createElement("br",null),B.a.formatExp(this.workAgiExpGained)," agility experience",K.a.createElement("br",null),B.a.formatExp(this.workChaExpGained)," charisma experience"))}else{this.workHackExpGained/=2,this.workStrExpGained/=2,this.workDefExpGained/=2,this.workDexExpGained/=2,this.workAgiExpGained/=2,this.workChaExpGained/=2;const t=this.singFnCrimeWorkerScript;this.committingCrimeThruSingFn&&null!==t?null==t.disableLogs.ALL&&null==t.disableLogs.commitCrime&&t.scriptRef.log("FAIL: Crime failed! Gained "+B.a.formatExp(this.workHackExpGained)+" hack exp, "+B.a.formatExp(this.workStrExpGained)+" str exp, "+B.a.formatExp(this.workDefExpGained)+" def exp, "+B.a.formatExp(this.workDexExpGained)+" dex exp, "+B.a.formatExp(this.workAgiExpGained)+" agi exp, "+B.a.formatExp(this.workChaExpGained)+" cha exp."):Object(W.a)(K.a.createElement(K.a.Fragment,null,"Crime failed!",K.a.createElement("br",null),K.a.createElement("br",null),"You gained:",K.a.createElement("br",null),B.a.formatExp(this.workHackExpGained)," hacking experience ",K.a.createElement("br",null),B.a.formatExp(this.workStrExpGained)," strength experience",K.a.createElement("br",null),B.a.formatExp(this.workDefExpGained)," defense experience",K.a.createElement("br",null),B.a.formatExp(this.workDexExpGained)," dexterity experience",K.a.createElement("br",null),B.a.formatExp(this.workAgiExpGained)," agility experience",K.a.createElement("br",null),B.a.formatExp(this.workChaExpGained)," charisma experience"))}this.gainHackingExp(this.workHackExpGained),this.gainStrengthExp(this.workStrExpGained),this.gainDefenseExp(this.workDefExpGained),this.gainDexterityExp(this.workDexExpGained),this.gainAgilityExp(this.workAgiExpGained),this.gainCharismaExp(this.workChaExpGained)}return this.committingCrimeThruSingFn=!1,this.singFnCrimeWorkerScript=null,this.isWorking=!1,this.crimeType=tt.b.None,this.resetWorkStatus(),""}function le(){if(!this.isWorking)return"";let t="";switch(this.workType){case tt.d.StudyClass:t=this.finishClass(!0);break;case tt.d.Company:t=this.finishWork(!0,!0);break;case tt.d.CompanyPartTime:t=this.finishWorkPartTime(!0);break;case tt.d.Faction:t=this.finishFactionWork(!0,!0);break;case tt.d.CreateProgram:t=this.finishCreateProgramWork(!0);break;case tt.d.Crime:t=this.finishCrime(!0);break;case tt.d.GraftAugmentation:t=this.finishGraftAugmentationWork(!0,!0);break;default:return console.error(`Unrecognized work type (${this.workType})`),""}return t}function ce(t){return"number"!=typeof t?(console.warn("Player.takeDamage() called without a numeric argument: "+t),!1):(this.hp-=t,this.hp<=0&&(this.hospitalize(),!0))}function fe(t){"number"==typeof t?(this.hp+=t,this.hp>this.max_hp&&(this.hp=this.max_hp)):console.warn("Player.regenerateHp() called without a numeric argument: "+t)}function ue(){const t=Object(D.b)(this);return V.b.emit("You've been Hospitalized for "+B.a.formatMoney(t),V.d.WARNING,2e3),this.loseMoney(t,"hospitalization"),this.hp=this.max_hp,t}function me(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(W.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(W.a)("Unfortunately, you do not qualify for a promotion
"+e)}else Object(W.a)("You are already at the highest position for your field! No promotion available")}return!1}return this.jobs[n.name]=a.name,this.isWorking&&this.workType===tt.d.Company||(this.companyName=n.name),e||Object(W.a)("Congratulations! You were offered a new job at "+n.name+" as a "+a.name+"!"),!0}function he(t,e){let n=null;if(""!==this.companyName&&(n=c.a[this.companyName]),null==n||n.name!=t.name)return e;const a=this.jobs[this.companyName];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 de(t,e=!1){1==this.isWorking&&this.workType!==tt.d.Company&&this.companyName==t&&this.finishWork(!0),delete this.jobs[t],this.companyName===t&&(this.companyName=this.hasJob()?Object.keys(this.jobs)[0]:"")}function pe(){return Boolean(Object.keys(this.jobs).length)}function ge(t=!1){return this.applyForJob(m.a[h.j[0]],t)}function ye(t=!1){return this.applyForJob(m.a[h.k[0]],t)}function be(t=!1){return this.applyForJob(m.a[h.d[0]],t)}function Ee(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(W.a)("Unfortunately, you do not qualify for this position"),!1)}function ve(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(W.a)("Unfortunately, you do not qualify for this position"),!1}function ke(t=!1){return this.applyForJob(m.a[h.b[0]],t)}function _e(t=!1){return this.applyForJob(m.a[h.c[0]],t)}function we(t=!1){return this.applyForJob(m.a[h.h[2]],t)}function Se(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(W.a)("Unfortunately, you do not qualify for this position"),!1}function xe(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,!this.focus&&this.isWorking&&this.companyName!==e.name&&this.resetWorkStatus(),this.companyName=e.name,t||Object(W.a)("Congratulations, you are now employed at "+this.location),!0):(t||Object(W.a)("Unfortunately, you do not qualify for this position"),!1))}function Ce(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,!this.focus&&this.isWorking&&this.companyName!==e.name&&this.resetWorkStatus(),this.companyName=e.name,t||Object(W.a)("Congratulations, you are now employed part-time at "+this.location),!0):(t||Object(W.a)("Unfortunately, you do not qualify for this position"),!1))}function Le(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,!this.focus&&this.isWorking&&this.companyName!==e.name&&this.resetWorkStatus(),this.companyName=e.name,t||Object(W.a)("Congratulations, you are now employed as a waiter at "+this.location),!0):(t||Object(W.a)("Unfortunately, you do not qualify for this position"),!1))}function Oe(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,!this.focus&&this.isWorking&&this.companyName!==e.name&&this.resetWorkStatus(),this.companyName=e.name,t||Object(W.a)("Congratulations, you are now employed as a part-time waiter at "+this.location),!0):(t||Object(W.a)("Unfortunately, you do not qualify for this position"),!1))}function Me(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.hacking>=a&&this.strength>=r&&this.defense>=i&&this.dexterity>=o&&this.agility>=s&&this.charisma>=l&&t.playerReputation>=e.requiredReputation}function Te(t=!0){t&&this.resetMultipliers();for(let t=0;te}const i=E.a[X.a.Illuminati];!i.isBanned&&!i.isMember&&!i.alreadyInvited&&e>=30&&this.money>=15e10&&this.hacking>=1500&&this.strength>=1200&&this.defense>=1200&&this.dexterity>=1200&&this.agility>=1200&&t.push(i);const s=E.a[X.a.Daedalus];!s.isBanned&&!s.isMember&&!s.alreadyInvited&&e>=o.a.DaedalusAugsRequirement&&this.money>=1e11&&(this.hacking>=2500||this.strength>=1500&&this.defense>=1500&&this.dexterity>=1500&&this.agility>=1500)&&t.push(s);const l=E.a[X.a.TheCovenant];!l.isBanned&&!l.isMember&&!l.alreadyInvited&&e>=20&&this.money>=75e9&&this.hacking>=850&&this.strength>=850&&this.defense>=850&&this.dexterity>=850&&this.agility>=850&&t.push(l);const f=E.a[X.a.ECorp];f.isBanned||f.isMember||f.alreadyInvited||!r(S.a.AevumECorp)||t.push(f);const u=E.a[X.a.MegaCorp];u.isBanned||u.isMember||u.alreadyInvited||!r(S.a.Sector12MegaCorp)||t.push(u);const m=E.a[X.a.BachmanAssociates];m.isBanned||m.isMember||m.alreadyInvited||!r(S.a.AevumBachmanAndAssociates)||t.push(m);const h=E.a[X.a.BladeIndustries];h.isBanned||h.isMember||h.alreadyInvited||!r(S.a.Sector12BladeIndustries)||t.push(h);const p=E.a[X.a.NWO];p.isBanned||p.isMember||p.alreadyInvited||!r(S.a.VolhavenNWO)||t.push(p);const g=E.a[X.a.ClarkeIncorporated];g.isBanned||g.isMember||g.alreadyInvited||!r(S.a.AevumClarkeIncorporated)||t.push(g);const y=E.a[X.a.OmniTekIncorporated];y.isBanned||y.isMember||y.alreadyInvited||!r(S.a.VolhavenOmniTekIncorporated)||t.push(y);const b=E.a[X.a.FourSigma];b.isBanned||b.isMember||b.alreadyInvited||!r(S.a.Sector12FourSigma)||t.push(b);const v=E.a[X.a.KuaiGongInternational];v.isBanned||v.isMember||v.alreadyInvited||!r(S.a.ChongqingKuaiGongInternational)||t.push(v);const k=E.a[X.a.FulcrumSecretTechnologies],_=Object(M.d)(R.a.FulcrumSecretTechnologies);if(!(_ instanceof T.a))throw new Error(X.a.FulcrumSecretTechnologies+" should be normal server");null==_?console.error(`Could not find ${X.a.FulcrumSecretTechnologies} Server`):k.isBanned||k.isMember||k.alreadyInvited||!_.backdoorInstalled||!r(S.a.AevumFulcrumTechnologies,25e4)||t.push(k);const x=E.a[X.a.BitRunners],C=Object(M.d)(R.a.BitRunnersServer);if(!(C instanceof T.a))throw new Error(X.a.BitRunners+" should be normal server");null==C?console.error(`Could not find ${X.a.BitRunners} Server`):x.isBanned||x.isMember||!C.backdoorInstalled||x.alreadyInvited||t.push(x);const L=E.a[X.a.TheBlackHand],O=Object(M.d)(R.a.TheBlackHandServer);if(!(O instanceof T.a))throw new Error(X.a.TheBlackHand+" should be normal server");null==O?console.error(`Could not find ${X.a.TheBlackHand} Server`):L.isBanned||L.isMember||!O.backdoorInstalled||L.alreadyInvited||t.push(L);const A=E.a[X.a.NiteSec],N=Object(M.d)(R.a.NiteSecServer);if(!(N instanceof T.a))throw new Error(X.a.NiteSec+" should be normal server");null==N?console.error(`Could not find ${X.a.NiteSec} Server`):A.isBanned||A.isMember||!N.backdoorInstalled||A.alreadyInvited||t.push(A);const P=E.a[X.a.Chongqing];!P.isBanned&&!P.isMember&&!P.alreadyInvited&&this.money>=2e7&&this.city==w.a.Chongqing&&t.push(P);const I=E.a[X.a.Sector12];!I.isBanned&&!I.isMember&&!I.alreadyInvited&&this.money>=15e6&&this.city==w.a.Sector12&&t.push(I);const F=E.a[X.a.NewTokyo];!F.isBanned&&!F.isMember&&!F.alreadyInvited&&this.money>=2e7&&this.city==w.a.NewTokyo&&t.push(F);const D=E.a[X.a.Aevum];!D.isBanned&&!D.isMember&&!D.alreadyInvited&&this.money>=4e7&&this.city==w.a.Aevum&&t.push(D);const B=E.a[X.a.Ishima];!B.isBanned&&!B.isMember&&!B.alreadyInvited&&this.money>=3e7&&this.city==w.a.Ishima&&t.push(B);const G=E.a[X.a.Volhaven];!G.isBanned&&!G.isMember&&!G.alreadyInvited&&this.money>=5e7&&this.city==w.a.Volhaven&&t.push(G);const W=E.a[X.a.SpeakersForTheDead];!W.isBanned&&!W.isMember&&!W.alreadyInvited&&this.hacking>=100&&this.strength>=300&&this.defense>=300&&this.dexterity>=300&&this.agility>=300&&this.numPeopleKilled>=30&&this.karma<=-45&&!n.includes(S.a.Sector12CIA)&&!n.includes(S.a.Sector12NSA)&&t.push(W);const H=E.a[X.a.TheDarkArmy];!H.isBanned&&!H.isMember&&!H.alreadyInvited&&this.hacking>=300&&this.strength>=300&&this.defense>=300&&this.dexterity>=300&&this.agility>=300&&this.city==w.a.Chongqing&&this.numPeopleKilled>=5&&this.karma<=-45&&!n.includes(S.a.Sector12CIA)&&!n.includes(S.a.Sector12NSA)&&t.push(H);const U=E.a[X.a.TheSyndicate];!U.isBanned&&!U.isMember&&!U.alreadyInvited&&this.hacking>=200&&this.strength>=200&&this.defense>=200&&this.dexterity>=200&&this.agility>=200&&(this.city==w.a.Aevum||this.city==w.a.Sector12)&&this.money>=1e7&&this.karma<=-90&&!n.includes(S.a.Sector12CIA)&&!n.includes(S.a.Sector12NSA)&&t.push(U);const q=E.a[X.a.Silhouette];!q.isBanned&&!q.isMember&&!q.alreadyInvited&&(a.includes("Chief Technology Officer")||a.includes("Chief Financial Officer")||a.includes("Chief Executive Officer"))&&this.money>=15e6&&this.karma<=-22&&t.push(q);const $=E.a[X.a.Tetrads];!$.isBanned&&!$.isMember&&!$.alreadyInvited&&(this.city==w.a.Chongqing||this.city==w.a.NewTokyo||this.city==w.a.Ishima)&&this.strength>=75&&this.defense>=75&&this.dexterity>=75&&this.agility>=75&&this.karma<=-18&&t.push($);const K=E.a[X.a.SlumSnakes];!K.isBanned&&!K.isMember&&!K.alreadyInvited&&this.strength>=30&&this.defense>=30&&this.dexterity>=30&&this.agility>=30&&this.karma<=-9&&this.money>=1e6&&t.push(K);const z=E.a[X.a.Netburners];let V=0,Y=0,J=0;for(let t=0;t=80&&V>=8&&Y>=4&&J>=100&&t.push(z);const Q=E.a[X.a.TianDiHui];!Q.isBanned&&!Q.isMember&&!Q.alreadyInvited&&this.money>=1e6&&this.hacking>=50&&(this.city==w.a.Chongqing||this.city==w.a.NewTokyo||this.city==w.a.Ishima)&&t.push(Q);const Z=E.a[X.a.CyberSec],tt=Object(M.d)(R.a.CyberSecServer);if(!(tt instanceof T.a))throw new Error(X.a.CyberSec+" should be normal server");return null==tt?console.error(`Could not find ${X.a.CyberSec} Server`):Z.isBanned||Z.isMember||!tt.backdoorInstalled||Z.alreadyInvited||t.push(Z),t}function Ne(t){this.bitNodeN=t}function Pe(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 Ie(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||!(E.a[t.name]instanceof b.a))return t.type=s.c.FactionReputationAll,this.gainCodingContractReward(t);const n=d.a.CodingContractBaseFactionRepGain*e;return E.a[t.name].playerReputation+=n,`Gained ${n} faction reputation for ${t.name}`;case s.c.FactionReputationAll:const a=d.a.CodingContractBaseFactionRepGain*e,r=[X.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)E.a[t]instanceof b.a&&(E.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 "+B.a.formatMoney(t)}}}function Fe(t){return null==k.a[t]?(console.warn("Player.travel() called with invalid city: "+t),!1):(this.city=t,!0)}function De(t){return null==_.a[t]?(console.warn("Player.gotoLocation() called with invalid location: "+t),!1):(this.location=t,!0)}function je(){return 10===this.bitNodeN||this.sourceFileLvl(10)>0}function Be(t){this.exploits.includes(t)||(this.exploits.push(t),V.b.emit("SF -1 acquired!",V.d.SUCCESS,2e3))}function Ge(t){const e=J.a[t];e&&(this.achievements.map(t=>t.ID).includes(t)||(this.achievements.push({ID:t,unlockedOn:(new Date).getTime()}),V.b.emit(`Unlocked Achievement: "${e.Name}"`,V.d.SUCCESS,2e3)))}function We(t){return Object(L.a)(this.intelligence,t)}function He(){return this.moneySourceA.casino}function Ue(t){return this.hasOwnProperty(t)?this[t]:1}function qe(t,e){this.hasOwnProperty(t)&&(this[t]=e)}function $e(){return 13===this.bitNodeN||this.sourceFileLvl(13)>0}function Ke(t){const e=this.sourceFiles.find(e=>e.n===t);return e?e.lvl:0}},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(2),i=n(64),o=n(378);!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(577),r=n(18),i=n(1017),o=n(340),s=n(28);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 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 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(135),o=n(143);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,"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 _})),n.d(e,"n",(function(){return w})),n.d(e,"o",(function(){return S})),n.d(e,"k",(function(){return x})),n.d(e,"j",(function(){return C})),n.d(e,"i",(function(){return L})),n.d(e,"p",(function(){return M})),n.d(e,"m",(function(){return T}));var a=n(223),r=n(211),i=n(156),o=n(41),s=n(92),l=n(377),c=n(241),f=n(347),u=n(44),m=n(24),h=n(46);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.hacknet_node_money_mult);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.hacknet_node_purchase_cost_mult)}function b(t){return Object(i.f)(t.hacknetNodes.length+1,t.hacknet_node_purchase_cost_mult)}function E(t,e,n){if(null==n)throw new Error("getMaxNumberLevelUpgrades() called without maxLevel arg");if(t.moneye.calculateLevelUpgradeCost(i,t.hacknet_node_level_cost_mult))return i;for(;a<=r;){const o=(a+r)/2|0;if(o!==n&&t.money>e.calculateLevelUpgradeCost(o,t.hacknet_node_level_cost_mult)&&t.moneye.calculateLevelUpgradeCost(o,t.hacknet_node_level_cost_mult)))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.hacknet_node_ram_cost_mult))return a;for(let n=a-1;n>=0;--n)if(t.money>e.calculateRamUpgradeCost(n,t.hacknet_node_ram_cost_mult))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.hacknet_node_core_cost_mult))return i;for(;a<=r;){const o=(a+r)/2|0;if(o!=n&&t.money>e.calculateCoreUpgradeCost(o,t.hacknet_node_core_cost_mult)&&t.moneye.calculateCoreUpgradeCost(o,t.hacknet_node_core_cost_mult)))return Math.min(i,o);a=o+1}}return 0}function _(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 w(t,e,n=1){const a=Math.round(n),r=e.calculateLevelUpgradeCost(a,t.hacknet_node_level_cost_mult);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 w(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.hacknet_node_money_mult),!0)}function S(t,e,n=1){const r=Math.round(n),i=e.calculateRamUpgradeCost(r,t.hacknet_node_ram_cost_mult);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 S(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 S(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.hacknet_node_money_mult),!0)}function x(t,e,n=1){const a=Math.round(n),r=e.calculateCoreUpgradeCost(a,t.hacknet_node_core_cost_mult);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 x(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.hacknet_node_money_mult),!0)}function C(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 C(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=Math.floor(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.DividendMaxPercentage)throw new Error("Invalid value. Must be an integer between 0 and "+_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.DividendMaxPercentage);t.dividendPercentage=100*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.moneye+_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_10__.a[e];if(t.sciResearch.qty{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 u}));var a=n(0),r=n.n(a),i=n(50),o=n(30),s=n(1),l=n(5),c=n(22),f=n(301);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.f)(u.level,0)} (${l.a.formatExp(u.exp)} exp)`:void 0!==u.level&&void 0===u.exp&&(m=""+Object(c.f)(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";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(30),o=n(148),s=n(121);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";n.d(e,"a",(function(){return a}));const a={}},,,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(4),r=n(28);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";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(".ns")||t.endsWith(".js")||(t+=".js"),e.endsWith(".ns")||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 a}));const a=new(n(948).a)},,function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var a=n(275),r=n(10),i=n(34);const o={Shoplift:new a.a("Shoplift",i.b.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",i.b.RobStore,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",i.b.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",i.b.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",i.b.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",i.b.BondForgery,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",i.b.TraffickArms,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",i.b.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",i.b.GrandTheftAuto,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",i.b.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",i.b.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",i.b.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,"b",(function(){return Ct})),n.d(e,"a",(function(){return Lt}));var a=n(0),r=n.n(a),i=n(119),o=n(109),s=n(348),l=n(9),c=n(186),f=n(44),u=n(1065),m=n(378),h=n(459),d=n(14),p=n(24),g=n(26),y=n(245),b=n(103),E=n(121),v=n(144),k=n(19),_=n(1),w=n(25),S=n(1084),x=n(1088),C=n(1110),L=n(1115),O=n(1144),M=n(1171),T=n(1192),A=n(1229),R=n(1242),N=n(1243),P=n(1244),I=n(1286),F=n(1295),D=n(1304),j=n(1329),B=n(411),G=n(638),W=n(1342),H=n(1343),U=n(1348),q=n(1349),$=n(412),K=n(1360),z=n(1371),V=n(637),Y=n(1372),J=n(1381),X=n(1384),Q=n(101),Z=n(301),tt=n(1391),et=n(200),nt=n(1392),at=n(94),rt=n(178),it=n(339),ot=n(407),st=n(594),lt=n(300),ct=n(416),ft=n(29),ut=n(417),mt=n(1394),ht=n(1397),dt=n(6),pt=n(1398),gt=n(1403),yt=n(1408),bt=n(1409),Et=n.n(bt),vt=n(1410),kt=n.n(vt),_t=n(462);const wt=location,St=Object(E.a)(t=>Object(v.a)({root:{"-ms-overflow-style":"none","scrollbar-width":"none",margin:t.spacing(0),flexGrow:1,display:"block",padding:"8px",minHeight:"100vh",boxSizing:"border-box"}})),xt=()=>{throw new Error("Router called before initialization")};let Ct={isInitialized:!1,page:xt,allowRouting:xt,toActiveScripts:xt,toAugmentations:xt,toBitVerse:xt,toBladeburner:xt,toStats:xt,toCity:xt,toCorporation:xt,toCreateProgram:xt,toDevMenu:xt,toFaction:xt,toFactions:xt,toGameOptions:xt,toGang:xt,toHacknetNodes:xt,toInfiltration:xt,toJob:xt,toMilestones:xt,toGrafting:xt,toScriptEditor:xt,toSleeves:xt,toStockMarket:xt,toTerminal:xt,toTravel:xt,toTutorial:xt,toWork:xt,toBladeburnerCinematic:xt,toLocation:xt,toStaneksGift:xt,toAchievements:xt,toThemeBrowser:xt,toImportSave:xt};function Lt({player:t,engine:e,terminal:n}){const E=St(),[{files:v,vim:bt},vt]=Object(a.useState)({files:{},vim:!1}),[xt,Lt]=Object(a.useState)(function(t){return ut.b?w.a.Recovery:t.isWorking?w.a.Work:w.a.Terminal}(t)),Ot=Object(a.useState)(0)[1],[Mt,Tt]=Object(a.useState)(!1),[At,Rt]=Object(a.useState)(t.currentWorkFactionName?g.a[t.currentWorkFactionName]:void 0);if(void 0===At&&xt===w.a.Faction)throw new Error("Trying to go to a page without the proper setup");const[Nt,Pt]=Object(a.useState)(!1),[It,Ft]=Object(a.useState)(!1),[Dt,jt]=Object(a.useState)(void 0);if(void 0===Dt&&(xt===w.a.Infiltration||xt===w.a.Location||xt===w.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)(dt.a.IsSidebarOpened),[$t,Kt]=Object(a.useState)(void 0),[zt,Vt]=Object(a.useState)(!1);if(void 0===$t&&xt===w.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(p.c)())t.runningScripts=[];o.c.saveGame(),setTimeout(()=>wt.reload(),2e3)}function Zt(){Object(d.a)("Soft Reset!"),Object(i.f)(!0),Ht(Wt+1),Ct.toTerminal()}Object(a.useEffect)(()=>m.a.subscribe(Xt),[]),Ct={isInitialized:!0,page:()=>xt,allowRouting:t=>Jt(t),toActiveScripts:()=>Lt(w.a.ActiveScripts),toAugmentations:()=>Lt(w.a.Augmentations),toBladeburner:()=>Lt(w.a.Bladeburner),toStats:()=>Lt(w.a.Stats),toCorporation:()=>Lt(w.a.Corporation),toCreateProgram:()=>Lt(w.a.CreateProgram),toDevMenu:()=>Lt(w.a.DevMenu),toFaction:(t,e=!1)=>{Tt(e),Lt(w.a.Faction),t&&Rt(t)},toFactions:()=>Lt(w.a.Factions),toGameOptions:()=>Lt(w.a.Options),toGang:()=>Lt(w.a.Gang),toHacknetNodes:()=>Lt(w.a.Hacknet),toMilestones:()=>Lt(w.a.Milestones),toGrafting:()=>Lt(w.a.Grafting),toScriptEditor:(t,e)=>{vt({files:t,vim:!(null==e||!e.vim)}),Lt(w.a.ScriptEditor)},toSleeves:()=>Lt(w.a.Sleeves),toStockMarket:()=>Lt(w.a.StockMarket),toTerminal:()=>Lt(w.a.Terminal),toTutorial:()=>Lt(w.a.Tutorial),toJob:()=>{jt(c.a[t.companyName]),Lt(w.a.Job)},toCity:()=>{Lt(w.a.City)},toTravel:()=>{t.gotoLocation(l.a.TravelAgency),Lt(w.a.Travel)},toBitVerse:(t,e)=>{Pt(t),Ft(e),Object(lt.b)(),Lt(w.a.BitVerse)},toInfiltration:t=>{jt(t),Lt(w.a.Infiltration)},toWork:()=>Lt(w.a.Work),toBladeburnerCinematic:()=>{Lt(w.a.BladeburnerCinematic),Gt(Bt)},toLocation:t=>{jt(t),Lt(w.a.Location)},toStaneksGift:()=>{Lt(w.a.StaneksGift)},toAchievements:()=>{Lt(w.a.Achievements)},toThemeBrowser:()=>{Lt(w.a.ThemeBrowser)},toImportSave:(t,e=!1)=>{Kt(t),Vt(e),Lt(w.a.ImportSave)}},Object(a.useEffect)(()=>{kt()(Ct).filter(t=>t.startsWith("to")).forEach(t=>{Ct[t]=Et()(Ct[t],(e,...n)=>{if(Yt)return e(...n);console.log(`Routing is currently disabled - Attempted router.${t}()`)})})}),Object(a.useEffect)(()=>{xt!==w.a.Terminal&&window.scrollTo(0,0)});let te=r.a.createElement(_.a,null,"Cannot load"),ee=!0,ne=!0,ae=!1;switch(xt){case w.a.Recovery:te=r.a.createElement(ut.c,{router:Ct,softReset:Zt}),ee=!1,ne=!1,ae=!0;break;case w.a.BitVerse:te=r.a.createElement(J.a,{flume:Nt,enter:ct.a,quick:It}),ee=!1,ne=!1;break;case w.a.Infiltration:te=r.a.createElement(A.a,{location:Dt}),ee=!1,ne=!1;break;case w.a.BladeburnerCinematic:te=r.a.createElement(tt.a,null),ee=!1,ne=!1;break;case w.a.Work:te=r.a.createElement(N.a,null),ee=!1;break;case w.a.Terminal:te=r.a.createElement(H.a,{terminal:n,router:Ct,player:t});break;case w.a.Sleeves:te=r.a.createElement(I.a,null);break;case w.a.StaneksGift:te=r.a.createElement(X.a,{staneksGift:Q.c});break;case w.a.Stats:te=r.a.createElement(z.a,null);break;case w.a.ScriptEditor:te=r.a.createElement(G.a,{files:v,hostname:t.getCurrentServer().hostname,player:t,router:Ct,vim:bt});break;case w.a.ActiveScripts:te=r.a.createElement(q.a,{workerScripts:et.a});break;case w.a.Hacknet:te=r.a.createElement(F.a,{player:t});break;case w.a.CreateProgram:te=r.a.createElement(B.a,null);break;case w.a.Factions:te=r.a.createElement($.a,{player:t,router:Ct});break;case w.a.Faction:te=r.a.createElement(K.a,{faction:At,augPage:Mt});break;case w.a.Milestones:te=r.a.createElement(W.a,{player:t});break;case w.a.Tutorial:te=r.a.createElement(U.a,{reactivateTutorial:()=>{Object(h.a)(),Ct.toTerminal(),Object(f.e)()}});break;case w.a.DevMenu:te=r.a.createElement(L.a,{player:t,engine:e,router:Ct});break;case w.a.Gang:te=r.a.createElement(M.a,null);break;case w.a.Corporation:te=r.a.createElement(T.a,null);break;case w.a.Bladeburner:te=r.a.createElement(O.a,null);break;case w.a.Grafting:te=r.a.createElement(R.a,null);break;case w.a.Travel:te=r.a.createElement(V.a,{p:t,router:Ct});break;case w.a.StockMarket:te=r.a.createElement(Y.a,{buyStockLong:y.a,buyStockShort:y.d,cancelOrder:b.c,eventEmitterForReset:b.e,initStockMarket:b.g,p:t,placeOrder:b.j,sellStockLong:y.c,sellStockShort:y.b,stockMarket:b.a});break;case w.a.City:te=r.a.createElement(j.a,null);break;case w.a.Job:case w.a.Location:te=r.a.createElement(D.a,{loc:Dt});break;case w.a.Options:te=r.a.createElement(P.a,{player:t,router:Ct,save:()=>o.c.saveGame(),export:()=>{Object(s.c)(t),o.c.exportGame()},forceKill:Qt,softReset:Zt});break;case w.a.Augmentations:te=r.a.createElement(C.a,{exportGameFn:()=>{Object(s.c)(t),o.c.exportGame()},installAugmentationsFn:()=>{Object(i.f)()}});break;case w.a.Achievements:te=r.a.createElement(mt.a,null);break;case w.a.ThemeBrowser:te=r.a.createElement(pt.a,{router:Ct});break;case w.a.ImportSave:te=r.a.createElement(gt.a,{importString:$t,automatic:zt,router:Ct}),ee=!1,ne=!1,ae=!0}return r.a.createElement(ft.a.Player.Provider,{value:t},r.a.createElement(ft.a.Router.Provider,{value:Ct},r.a.createElement(ht.a,{key:Wt,router:Ct,softReset:Zt},r.a.createElement(yt.a,{content:ae?te:null},r.a.createElement(at.c,null,r.a.createElement(S.a,{mode:f.a.isRunning?"tutorial":"overview"},f.a.isRunning?r.a.createElement(u.a,null):r.a.createElement(Z.a,{save:()=>o.c.saveGame(),killScripts:Qt})),ee?r.a.createElement(k.a,{display:"flex",flexDirection:"row",width:"100%"},r.a.createElement(x.a,{player:t,router:Ct,page:xt,opened:Ut,onToggled:t=>{qt(t),dt.a.IsSidebarOpened=t}}),r.a.createElement(k.a,{className:E.root},te)):r.a.createElement(k.a,{className:E.root},te),r.a.createElement(nt.a,null),ne&&r.a.createElement(r.a.Fragment,null,r.a.createElement(rt.d,null),r.a.createElement(it.b,null),r.a.createElement(ot.b,null),r.a.createElement(st.b,null),r.a.createElement(at.a,null)),r.a.createElement(_t.a,null))))))}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(10),r=n(577),i=n(41),o=n(156),s=n(340),l=n(28);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;e({snackbar:{zIndex:f.e+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 i}));var a=n(1306),r=n(368);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";n.d(e,"a",(function(){return r}));var a=n(9);const r={};r[a.a.AevumECorp]="ECP",r[a.a.Sector12MegaCorp]="MGCP",r[a.a.Sector12BladeIndustries]="BLD",r[a.a.AevumClarkeIncorporated]="CLRK",r[a.a.VolhavenOmniTekIncorporated]="OMTK",r[a.a.Sector12FourSigma]="FSIG",r[a.a.ChongqingKuaiGongInternational]="KGI",r[a.a.AevumFulcrumTechnologies]="FLCM",r[a.a.IshimaStormTechnologies]="STM",r[a.a.NewTokyoDefComm]="DCOMM",r[a.a.VolhavenHeliosLabs]="HLS",r[a.a.NewTokyoVitaLife]="VITA",r[a.a.Sector12IcarusMicrosystems]="ICRS",r[a.a.Sector12UniversalEnergy]="UNV",r[a.a.AevumAeroCorp]="AERO",r[a.a.VolhavenOmniaCybersystems]="OMN",r[a.a.ChongqingSolarisSpaceSystems]="SLRS",r[a.a.NewTokyoGlobalPharmaceuticals]="GPH",r[a.a.IshimaNovaMedical]="NVMD",r[a.a.AevumWatchdogSecurity]="WDS",r[a.a.VolhavenLexoCorp]="LXO",r[a.a.AevumRhoConstruction]="RHOC",r[a.a.Sector12AlphaEnterprises]="APHE",r[a.a.VolhavenSysCoreSecurities]="SYSC",r[a.a.VolhavenCompuTek]="CTK",r[a.a.AevumNetLinkTechnologies]="NTLK",r[a.a.IshimaOmegaSoftware]="OMGA",r[a.a.Sector12FoodNStuff]="FNS",r[a.a.Sector12JoesGuns]="JGN",r["Sigma Cosmetics"]="SGC",r["Catalyst Ventures"]="CTYS",r["Microdyne Technologies"]="MDYN",r["Titan Laboratories"]="TITN"},function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return r}));const a=[".js",".script",".ns"];function r(t){return a.some(e=>t.endsWith(e))}},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(28),r=n(770);let i=new r.a;function o(t){i=t?JSON.parse(t,a.c):new r.a}function s(t){const e=[];for(let n=0;n1?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.hacking_exp_mult*a.a.HackExpGain}function s(t,e){const n=(100-t.hackDifficulty)/100*((e.hacking-(t.requiredHackingSkill-1))/e.hacking)*e.hacking_money_mult*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.hacking+50;return 5*n/(e.hacking_speed_mult*Object(r.a)(e.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,"a",(function(){return g})),n.d(e,"b",(function(){return y})),n.d(e,"j",(function(){return b})),n.d(e,"c",(function(){return E})),n.d(e,"i",(function(){return v})),n.d(e,"d",(function(){return k})),n.d(e,"f",(function(){return _})),n.d(e,"h",(function(){return w})),n.d(e,"k",(function(){return x})),n.d(e,"g",(function(){return C})),n.d(e,"e",(function(){return L}));var a=n(769),r=n(331),i=n(153),o=n(664),s=n(1030),l=n(117),c=n(75),f=n(99),u=n(10),m=n(125),h=n(5),d=n(14),p=n(28);let g={lastUpdate:0,Orders:{},storedCycles:0,ticksUntilCycle:0};const y={};function b(t,e,n,o,s,l=null){if(!(t instanceof i.a))return l?l.log("stock.placeOrder",()=>`Invalid stock: '${t}'`):Object(d.a)("ERROR: Invalid stock passed to placeOrder() function"),!1;if("number"!=typeof e||"number"!=typeof n)return l?l.log("stock.placeOrder",()=>`Invalid arguments: shares='${e}' price='${n}'`):Object(d.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=null){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=e.cap&&(o=.1,e.b=!1),isNaN(o)&&(o=.5);const s=Math.random(),f={stockMarket:g,symbolToStockMap:y};st);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 E(t,e,n=!1){const a=b(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 v(t){for(const e of Object.keys(l.a)){if(e===c.a.currentWorkFactionName)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),i=Object(u.b)(c.a,n),s=Object(u.a)(c.a,n),f=Math.max(r*a,i*a,s*a,1/120);n.playerReputation+=f*t*c.a.faction_rep_mult*o.a.FactionPassiveRepGain}}const k=(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";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 I})),n.d(e,"b",(function(){return A})),n.d(e,"a",(function(){return P}));var a=n(160),r=n(67),i=n(10),o=n(26),s=n(82),l=n(2),c=n(24),f=n(6),u=n(103),m=n(101),h=n(94),d=n(348),p=n(14),g=n(28),y=n(342),b=n(1062),E=n(12),v=n(341),k=n(9),_=n(593),w=n(298),S=n(123),x=n(4),C=n(185),L=n(137),O=n(88);function M(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(){M(this,"PlayerSave",""),M(this,"AllServersSave",""),M(this,"CompaniesSave",""),M(this,"FactionsSave",""),M(this,"AliasesSave",""),M(this,"GlobalAliasesSave",""),M(this,"StockMarketSave",""),M(this,"SettingsSave",""),M(this,"VersionSave",""),M(this,"AllGangsSave",""),M(this,"LastExportBonus",""),M(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(w.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);P(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.log(t)}if(!u||"BitburnerSaveObject"!==u.ctor||!u.data)return Promise.reject(new Error("Save game did not seem valid"));const m={base64:t,parsed:u},h=_.a.fromJSON(JSON.parse(u.data.PlayerSave)),d={identifier:h.identifier,lastSave:h.lastSave,totalPlaytime:h.totalPlaytime,money:h.money,hacking:h.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 A(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.i)(e.StockMarketSave)}catch(t){Object(u.i)("")}else Object(u.i)("");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;nt.name===E.a.NeuroFluxGovernor);if(t)t.level+=10;else{const t=new v.a(E.a.NeuroFluxGovernor);t.level=10,l.a.augmentations.push(t)}l.a.reapplyAllAugmentations(!0),l.a.reapplyAllSourceFiles()}if(t<3&&(e.money=parseFloat(e.money),e.corporation)){e.corporation.funds=parseFloat(e.corporation.funds),e.corporation.revenue=parseFloat(e.corporation.revenue),e.corporation.expenses=parseFloat(e.corporation.expenses);for(let t=0;t0)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={...S.a}),t<16){o.a[x.a.ShadowsOfAnarchy]=new C.a(x.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")}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],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)}}}}(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,R):t!==i.a.VersionNumber&&N()}catch(t){N()}else N();return!0}const R={"& h1, & h2, & h3, & h4, & p, & a, & ul":{margin:0,color:f.a.theme.primary,whiteSpace:"initial"},"& ul":{paddingLeft:"1.5em",lineHeight:1.5}};function N(){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,R),1e3)}function P(t,e){const n=new Blob([e],{type:"text/plain"}),a=window.navigator;if(a.msSaveOrOpenBlob)a.msSaveOrOpenBlob(n,t);else{const e=document.createElement("a"),a=URL.createObjectURL(n);e.href=a,e.download=t,document.body.appendChild(e),e.click(),setTimeout((function(){document.body.removeChild(e),window.URL.revokeObjectURL(a)}),0)}}g.c.constructors.BitburnerSaveObject=T;const I=new T},function(t,e,n){"use strict";n.d(e,"c",(function(){return o})),n.d(e,"b",(function(){return s})),n.d(e,"d",(function(){return l})),n.d(e,"a",(function(){return c}));var a=n(146),r=n(24),i=n(180);function o(t,e){return e.delayReject&&e.delayReject(),new Promise((function(n,a){e.delay=window.setTimeout(()=>{e.delay=null,e.delayReject=void 0,e.env.stopFlag?a(new i.a(e)):n()},t),e.delayReject=a}))}function s(t,e){const n=Object(r.d)(t.hostname);if(null==n)throw new Error("WorkerScript constructed with invalid server ip: "+t.hostname);for(const n of t.scriptRef.dependencies){var a,i;e=null!==(a=null===(i=e)||void 0===i?void 0:i.replace(new RegExp(n.url,"g"),n.filename))&&void 0!==a?a:e}return"|DELIMITER|"+n.hostname+"|DELIMITER|"+t.name+"|DELIMITER|"+e}function l(t,e){const n=t.workerScript.scriptRef.threads;if(!e)return isNaN(n)||n<1?1:n;const a=0|e;if(isNaN(e)||a<1)throw s(t.workerScript,`Invalid thread count passed to ${t.function}: ${e}. Threads must be a positive number.`);if(a>n)throw s(t.workerScript,`Too many threads requested by ${t.function}. Requested: ${e}. Has: ${n}.`);return a}function c(t){if(!Object(a.a)(t))return!1;return 4==t.split("|DELIMITER|").length}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(0),r=n.n(a),i=n(5),o=n(20);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(968),r=n(28),i=n(578);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 y})),n.d(e,"d",(function(){return b})),n.d(e,"g",(function(){return w})),n.d(e,"f",(function(){return k})),n.d(e,"e",(function(){return g})),n.d(e,"a",(function(){return v})),n.d(e,"b",(function(){return _}));var a=n(35),r=n(79),i=n(341),o=n(12),s=n(10),l=n(26),c=n(2),f=n(459),u=n(14),m=n(1414),h=n(4),d=n(352),p=n(90);function g(){!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(E),c.a.reapplyAllAugmentations()}function y(){return s.a.MultipleAugMultiplier*[1,.96,.94,.93][c.a.sourceFileLvl(11)]}function b(){return Math.pow(y(),c.a.queuedAugmentations.length)}function E(t){t.addToFactions(t.factions);const e=t.name;_(e)&&delete r.a[e],function(t){const e=t.name;r.a[e]=t}(t)}function v(t,e=!1){const n=r.a[t.name];for(const t of Object.keys(n.mults)){const e=c.a.getMult(t)*n.mults[t];c.a.setMult(t,e)}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 k(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 _(t){return r.a.hasOwnProperty(t)}function w(t){return(t instanceof a.a?t.name:t)===o.a.NeuroFluxGovernor}},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(61),r=n(214);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 l}));var a=n(0),r=n(5),i=n(121),o=n(144);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 g}));var a=n(0),r=n.n(a),i=n(611),o=n.n(i),s=n(1119),l=n.n(s),c=n(111),f=n(1120),u=n.n(f),m=n(608),h=n.n(m),d=n(76),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(27);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 s})),n.d(e,"b",(function(){return l}));var a=n(285),r=n(661);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(46),i=n(597),o=n(18),s=n(10),l=n(65),c=n(64),f=n(768);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.hacking_grow_mult*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.hacking_grow_mult*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 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 i}));var a=n(351),r=n(28);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";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 h}));var a=n(180),r=n(421),i=n(200),o=n(297),s=n(369),l=n(24),c=n(321),f=n(14),u=n(461),m=n(2);function h(t,e,n){if(null!=n&&"boolean"==typeof n||(n=!0),t instanceof r.a)return p(t),!0;if(t instanceof s.a&&"string"==typeof e){const a=d(t.pid,n);if(a)return a;for(const a of i.a.values())if(a.name==t.filename&&a.hostname==e&&Object(c.a)(a.args,t.args))return p(a,n),!0;return!1}return"number"==typeof t?d(t,n):(console.error("killWorkerScript() called with invalid argument:"),console.error(t),!1)}function d(t,e=!0){const n=i.a.get(t);return n instanceof r.a&&(p(n,e),!0)}function p(t,e=!0){if("function"==typeof t.atExit){try{t.atExit()}catch(e){Object(f.a)(`Error trying to call atExit for script ${t.name} on ${t.hostname} ${t.scriptRef.args} ${e}`)}t.atExit=void 0}t.env.stopFlag=!0,function(t){t instanceof r.a&&t.delay&&(clearTimeout(t.delay),t.delayReject&&t.delayReject(new a.a(t)))}(t),function(t,e=!0){const n=t.hostname,a=t.name,r=Object(l.d)(n);if(null==r)return void console.error("Could not find server on which this script is running: "+n);for(let e=0;eObject(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";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 c}));var a=n(333),r=n(277),i=n(21),o=n(1),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(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))})}},,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return c})),n.d(e,"b",(function(){return f})),n.d(e,"c",(function(){return u})),n.d(e,"d",(function(){return m}));var a=n(0),r=n.n(a),i=n(18),o=n(4),s=n(15);class l{constructor(t,e,n,a="",i=r.a.createElement(r.a.Fragment,null)){this.number=t,this.difficulty=e,this.name=n,this.desc=a,this.info=i}}const c={};c.BitNode1=new l(1,0,"Source Genesis","The original BitNode",r.a.createElement(r.a.Fragment,null,"The first BitNode created by the Enders to imprison the minds of humans. It became the prototype and testing-grounds for all of the BitNodes that followed.",r.a.createElement("br",null),r.a.createElement("br",null),"This is the first BitNode that you play through. It has no special modifications or mechanics.",r.a.createElement("br",null),r.a.createElement("br",null),"Destroying this BitNode will give you Source-File 1, or if you already have this Source-File it will upgrade its level up to a maximum of 3. This Source-File lets the player start with 32GB of RAM on his/her home computer when entering a new BitNode, and also increases all of the player's multipliers by:",r.a.createElement("br",null),r.a.createElement("br",null),"Level 1: 16%",r.a.createElement("br",null),"Level 2: 24%",r.a.createElement("br",null),"Level 3: 28%")),c.BitNode2=new l(2,0,"Rise of the Underworld","From the shadows, they rose",r.a.createElement(r.a.Fragment,null,"From the shadows, they rose.",r.a.createElement("br",null),r.a.createElement("br",null),"Organized crime groups quickly filled the void of power left behind from the collapse of Western government in the 2050s. As society and civilization broke down, people quickly succumbed to the innate human impulse of evil and savagery. The organized crime factions quickly rose to the top of the modern world.",r.a.createElement("br",null),r.a.createElement("br",null),"Certain Factions (",o.a.SlumSnakes,", ",o.a.Tetrads,", ",o.a.TheSyndicate,","," ",o.a.TheDarkArmy,", ",o.a.SpeakersForTheDead,", ",o.a.NiteSec,", ",o.a.TheBlackHand,") give the player the ability to form and manage their own gangs. These gangs will earn the player money and reputation with the corresponding Faction",r.a.createElement("br",null),"Every Augmentation in the game will be available through the Factions listed above",r.a.createElement("br",null),r.a.createElement("br",null),"Destroying this BitNode will give you Source-File 2, or if you already have this Source-File it will upgrade its level up to a maximum of 3. This Source-File allows you to form gangs in other BitNodes once your karma decreases to a certain value. It also increases the player's crime success rate, crime money, and charisma multipliers by:",r.a.createElement("br",null),r.a.createElement("br",null),"Level 1: 24%",r.a.createElement("br",null),"Level 2: 36%",r.a.createElement("br",null),"Level 3: 42%")),c.BitNode3=new l(3,0,"Corporatocracy","The Price of Civilization",r.a.createElement(r.a.Fragment,null,"Our greatest illusion is that a healthy society can revolve around a single-minded pursuit of wealth.",r.a.createElement("br",null),r.a.createElement("br",null),"Sometime in the early 21st century economic and political globalization turned the world into a corporatocracy, and it never looked back. Now, the privileged elite will happily bankrupt their own countrymen, decimate their own community, and evict their neighbors from houses in their desperate bid to increase their wealth.",r.a.createElement("br",null),r.a.createElement("br",null),"In this BitNode you can create and manage your own corporation. Running a successful corporation has the potential of generating massive profits.",r.a.createElement("br",null),r.a.createElement("br",null),"Destroying this BitNode will give you Source-File 3, or if you already have this Source-File it will upgrade its level up to a maximum of 3. This Source-File lets you create corporations on other BitNodes (although some BitNodes will disable this mechanic). This Source-File also increases your charisma and company salary multipliers by:",r.a.createElement("br",null),"Level 1: 8%",r.a.createElement("br",null),"Level 2: 12%",r.a.createElement("br",null),"Level 3: 14%")),c.BitNode4=new l(4,1,"The Singularity","The Man and the Machine",r.a.createElement(r.a.Fragment,null,"The Singularity has arrived. The human race is gone, replaced by artificially superintelligent beings that are more machine than man. ",r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement("br",null),"In this BitNode you will gain access to a new set of Netscript Functions known as Singularity Functions. These functions allow you to control most aspects of the game through scripts, including working for factions/companies, purchasing/installing Augmentations, and creating programs.",r.a.createElement("br",null),r.a.createElement("br",null),"Destroying this BitNode will give you Source-File 4, or if you already have this Source-File it will upgrade its level up to a maximum of 3. This Source-File lets you access and use the Singularity Functions in other BitNodes. Each level of this Source-File reduces the RAM cost of singularity functions.")),c.BitNode5=new l(5,1,"Artificial Intelligence","Posthuman",r.a.createElement(r.a.Fragment,null,"They said it couldn't be done. They said the human brain, along with its consciousness and intelligence, couldn't be replicated. They said the complexity of the brain results from unpredictable, nonlinear interactions that couldn't be modeled by 1's and 0's. They were wrong.",r.a.createElement("br",null),r.a.createElement("br",null),"Destroying this BitNode will give you Source-File 5, or if you already have this Source-File it will upgrade its level up to a maximum of 3. This Source-File grants you a special new stat called Intelligence. Intelligence is unique because it is permanent and persistent (it never gets reset back to 1). However gaining Intelligence experience is much slower than other stats. Higher Intelligence levels will boost your production for many actions in the game. ",r.a.createElement("br",null),r.a.createElement("br",null),"In addition, this Source-File will unlock the getBitNodeMultipliers() Netscript function and let you start with Formulas.exe, and will also raise all of your hacking-related multipliers by:",r.a.createElement("br",null),r.a.createElement("br",null),"Level 1: 8%",r.a.createElement("br",null),"Level 2: 12%",r.a.createElement("br",null),"Level 3: 14%")),c.BitNode6=new l(6,1,o.a.Bladeburners,"Like Tears in Rain",r.a.createElement(r.a.Fragment,null,"In the middle of the 21st century, ",o.a.OmniTekIncorporated," began designing and manufacturing advanced synthetic androids, or Synthoids for short. They achieved a major technological breakthrough in the sixth generation of their Synthoid design, called MK-VI, by developing a hyperintelligent AI. Many argue that this was the first sentient AI ever created. This resulted in Synthoid models that were stronger, faster, and more intelligent than the humans that had created them.",r.a.createElement("br",null),r.a.createElement("br",null),"In this BitNode you will be able to access the ",o.a.Bladeburners," Division at the NSA, which provides a new mechanic for progression.",r.a.createElement("br",null),r.a.createElement("br",null),"Destroying this BitNode will give you Source-File 6, or if you already have this Source-File it will upgrade its level up to a maximum of 3. This Source-File allows you to access the NSA's ",o.a.Bladeburners," Division in other BitNodes. In addition, this Source-File will raise both the level and experience gain rate of all your combat stats by:",r.a.createElement("br",null),r.a.createElement("br",null),"Level 1: 8%",r.a.createElement("br",null),"Level 2: 12%",r.a.createElement("br",null),"Level 3: 14%")),c.BitNode7=new l(7,2,o.a.Bladeburners+" 2079","More human than humans",r.a.createElement(r.a.Fragment,null,"In the middle of the 21st century, you were doing cutting-edge work at ",o.a.OmniTekIncorporated," as part of the AI design team for advanced synthetic androids, or Synthoids for short. You helped achieve a major technological breakthrough in the sixth generation of the company's Synthoid design, called MK-VI, by developing a hyperintelligent AI. Many argue that this was the first sentient AI ever created. This resulted in Synthoid models that were stronger, faster, and more intelligent than the humans that had created them.",r.a.createElement("br",null),r.a.createElement("br",null),"In this BitNode you will be able to access the ",o.a.Bladeburners," API, which allows you to access"," ",o.a.Bladeburners,"functionality through Netscript.",r.a.createElement("br",null),r.a.createElement("br",null),"Destroying this BitNode will give you Source-File 7, or if you already have this Source-File it will upgrade its level up to a maximum of 3. This Source-File allows you to access the ",o.a.Bladeburners," Netscript API in other BitNodes. In addition, this Source-File will increase all of your ",o.a.Bladeburners," multipliers by:",r.a.createElement("br",null),r.a.createElement("br",null),"Level 1: 8%",r.a.createElement("br",null),"Level 2: 12%",r.a.createElement("br",null),"Level 3: 14%")),c.BitNode8=new l(8,2,"Ghost of Wall Street","Money never sleeps",r.a.createElement(r.a.Fragment,null,"You are trying to make a name for yourself as an up-and-coming hedge fund manager on Wall Street.",r.a.createElement("br",null),r.a.createElement("br",null),"In this BitNode:",r.a.createElement("br",null),r.a.createElement("br",null),"You start with $250 million",r.a.createElement("br",null),"You start with a WSE membership and access to the TIX API",r.a.createElement("br",null),"You are able to short stocks and place different types of orders (limit/stop)",r.a.createElement("br",null),r.a.createElement("br",null),"Destroying this BitNode will give you Source-File 8, or if you already have this Source-File it will upgrade its level up to a maximum of 3. This Source-File grants the following benefits:",r.a.createElement("br",null),r.a.createElement("br",null),"Level 1: Permanent access to WSE and TIX API",r.a.createElement("br",null),"Level 2: Ability to short stocks in other BitNodes",r.a.createElement("br",null),"Level 3: Ability to use limit/stop orders in other BitNodes",r.a.createElement("br",null),r.a.createElement("br",null),"This Source-File also increases your hacking growth multipliers by:",r.a.createElement("br",null),"Level 1: 12%",r.a.createElement("br",null),"Level 2: 18%",r.a.createElement("br",null),"Level 3: 21%")),c.BitNode9=new l(9,2,"Hacktocracy","Hacknet Unleashed",r.a.createElement(r.a.Fragment,null,"When ",o.a.FulcrumSecretTechnologies," released their open-source Linux distro Chapeau, it quickly became the OS of choice for the underground hacking community. Chapeau became especially notorious for powering the Hacknet, a global, decentralized network used for nefarious purposes. ",o.a.FulcrumSecretTechnologies," ","quickly abandoned the project and dissociated themselves from it.",r.a.createElement("br",null),r.a.createElement("br",null),"This BitNode unlocks the Hacknet Server, an upgraded version of the Hacknet Node. Hacknet Servers generate hashes, which can be spent on a variety of different upgrades.",r.a.createElement("br",null),r.a.createElement("br",null),"Destroying this BitNode will give you Source-File 9, or if you already have this Source-File it will upgrade its level up to a maximum of 3. This Source-File grants the following benefits:",r.a.createElement("br",null),r.a.createElement("br",null),"Level 1: Permanently unlocks the Hacknet Server in other BitNodes",r.a.createElement("br",null),"Level 2: You start with 128GB of RAM on your home computer when entering a new BitNode",r.a.createElement("br",null),"Level 3: Grants a highly-upgraded Hacknet Server when entering a new BitNode",r.a.createElement("br",null),r.a.createElement("br",null),"(Note that the Level 3 effect of this Source-File only applies when entering a new BitNode, NOT when installing Augmentations)",r.a.createElement("br",null),r.a.createElement("br",null),"This Source-File also increases your hacknet multipliers by:",r.a.createElement("br",null),"Level 1: 8%",r.a.createElement("br",null),"Level 2: 12%",r.a.createElement("br",null),"Level 3: 14%")),c.BitNode10=new l(10,2,"Digital Carbon","Your body is not who you are",r.a.createElement(r.a.Fragment,null,"In 2084, VitaLife unveiled to the world the Persona Core, a technology that allowed people to digitize their consciousness. Their consciousness could then be transferred into Synthoids or other bodies by trasmitting the digitized data. Human bodies became nothing more than 'sleeves' for the human consciousness. Mankind had finally achieved immortality - at least for those that could afford it.",r.a.createElement("br",null),r.a.createElement("br",null),"This BitNode unlocks Sleeve technology. Sleeve technology allows you to:",r.a.createElement("br",null),r.a.createElement("br",null),"1. Grafting: Visit VitaLife in New Tokyo to be able to obtain Augmentations without needing to install",r.a.createElement("br",null),"2. Duplicate Sleeves: Duplicate your consciousness into Synthoids, allowing you to perform different tasks synchronously.",r.a.createElement("br",null),r.a.createElement("br",null),"Destroying this BitNode will give you Source-File 10, or if you already have this Source-File it will upgrade its level up to a maximum of 3. This Source-File unlocks Sleeve technology in other BitNodes. Each level of this Source-File also grants you a Duplicate Sleeve")),c.BitNode11=new l(11,1,"The Big Crash","Okay. Sell it all.",r.a.createElement(r.a.Fragment,null,"The 2050s was defined by the massive amounts of violent civil unrest and anarchic rebellion that rose all around the world. It was this period of disorder that eventually lead to the governmental reformation of many global superpowers, most notably the USA and China. But just as the world was slowly beginning to recover from these dark times, financial catastrophe hit.",r.a.createElement("br",null),r.a.createElement("br",null),"In many countries, the high cost of trying to deal with the civil disorder bankrupted the governments. In all of this chaos and confusion, hackers were able to steal billions of dollars from the world's largest electronic banks, prompting an international banking crisis as governments were unable to bail out insolvent banks. Now, the world is slowly crumbling in the middle of the biggest economic crisis of all time.",r.a.createElement("br",null),r.a.createElement("br",null),"Destroying this BitNode will give you Source-File 11, or if you already have this Source-File it will upgrade its level up to a maximum of 3. This Source-File makes it so that company favor increases BOTH the player's salary and reputation gain rate at that company by 1% per favor (rather than just the reputation gain). This Source-File also increases the player's company salary and reputation gain multipliers by:",r.a.createElement("br",null),r.a.createElement("br",null),"Level 1: 32%",r.a.createElement("br",null),"Level 2: 48%",r.a.createElement("br",null),"Level 3: 56%",r.a.createElement("br",null),r.a.createElement("br",null),"It also reduces the price increase for every aug bought by:",r.a.createElement("br",null),r.a.createElement("br",null),"Level 1: 4%",r.a.createElement("br",null),"Level 2: 6%",r.a.createElement("br",null),"Level 3: 7%")),c.BitNode12=new l(12,0,"The Recursion","Repeat.",r.a.createElement(r.a.Fragment,null,"To iterate is human, to recurse divine.",r.a.createElement("br",null),r.a.createElement("br",null),"Every time this BitNode is destroyed, it becomes slightly harder. Destroying this BitNode will give you Source-File 12, or if you already have this Source-File it will upgrade its level. There is no maximum level for Source-File 12. Each level of Source-File 12 lets you start any BitNodes with NeuroFlux Governor equal to the level of this source file.")),c.BitNode13=new l(13,2,"They're lunatics","1 step back, 2 steps forward",r.a.createElement(r.a.Fragment,null,"With the invention of Augmentations in the 2040s a religious group known as the"," ",o.a.ChurchOfTheMachineGod," has rallied far more support than anyone would have hoped.",r.a.createElement("br",null),r.a.createElement("br",null),'Their leader, Allison "Mother" Stanek is said to have created her own Augmentation whose power goes beyond any other. Find her in ',s.a.Chongqing," and gain her trust.",r.a.createElement("br",null),r.a.createElement("br",null),"Destroying this BitNode will give you Source-File 13, or if you already have this Source-File it will upgrade its level up to a maximum of 3. This Source-File lets the ",o.a.ChurchOfTheMachineGod," appear in other BitNodes.",r.a.createElement("br",null),r.a.createElement("br",null),"Each level of this Source-File increases the size of Stanek's Gift."));const f={HackingLevelMultiplier:1,StrengthLevelMultiplier:1,DefenseLevelMultiplier:1,DexterityLevelMultiplier:1,AgilityLevelMultiplier:1,CharismaLevelMultiplier:1,ServerGrowthRate:1,ServerMaxMoney:1,ServerStartingMoney:1,ServerStartingSecurity:1,ServerWeakenRate:1,HomeComputerRamCost:1,PurchasedServerCost:1,PurchasedServerSoftcap:1,PurchasedServerLimit:1,PurchasedServerMaxRam:1,CompanyWorkMoney:1,CrimeMoney:1,HacknetNodeMoney:1,ManualHackMoney:1,ScriptHackMoney:1,ScriptHackMoneyGain:1,CodingContractMoney:1,ClassGymExpGain:1,CompanyWorkExpGain:1,CrimeExpGain:1,FactionWorkExpGain:1,HackExpGain:1,FactionPassiveRepGain:1,FactionWorkRepGain:1,RepToDonateToFaction:1,AugmentationMoneyCost:1,AugmentationRepCost:1,InfiltrationMoney:1,InfiltrationRep:1,FourSigmaMarketDataCost:1,FourSigmaMarketDataApiCost:1,CorporationValuation:1,CorporationSoftcap:1,BladeburnerRank:1,BladeburnerSkillCost:1,GangSoftcap:1,GangUniqueAugs:1,DaedalusAugsRequirement:30,StaneksGiftPowerMultiplier:1,StaneksGiftExtraSize:0,WorldDaemonDifficulty:1};function u(t,e){const n=Object.assign({},f);switch(t){case 1:return n;case 2:return Object.assign(n,{HackingLevelMultiplier:.8,ServerGrowthRate:.8,ServerMaxMoney:.2,ServerStartingMoney:.4,CrimeMoney:3,InfiltrationMoney:3,FactionWorkRepGain:.5,FactionPassiveRepGain:0,StaneksGiftPowerMultiplier:2,StaneksGiftExtraSize:-6,PurchasedServerSoftcap:1.3,CorporationSoftcap:.9,WorldDaemonDifficulty:5});case 3:return Object.assign(n,{HackingLevelMultiplier:.8,RepToDonateToFaction:.5,AugmentationRepCost:3,AugmentationMoneyCost:3,ServerMaxMoney:.2,ServerStartingMoney:.2,ServerGrowthRate:.2,ScriptHackMoney:.2,CompanyWorkMoney:.25,CrimeMoney:.25,HacknetNodeMoney:.25,HomeComputerRamCost:1.5,PurchasedServerCost:2,StaneksGiftPowerMultiplier:.75,StaneksGiftExtraSize:-2,PurchasedServerSoftcap:1.3,GangSoftcap:.9,WorldDaemonDifficulty:2,GangUniqueAugs:.5});case 4:return Object.assign(n,{ServerMaxMoney:.15,ServerStartingMoney:.75,ScriptHackMoney:.2,CompanyWorkMoney:.1,CrimeMoney:.2,HacknetNodeMoney:.05,CompanyWorkExpGain:.5,ClassGymExpGain:.5,FactionWorkExpGain:.5,HackExpGain:.4,CrimeExpGain:.5,FactionWorkRepGain:.75,StaneksGiftPowerMultiplier:1.5,StaneksGiftExtraSize:0,PurchasedServerSoftcap:1.2,WorldDaemonDifficulty:3,GangUniqueAugs:.5});case 5:return Object.assign(n,{ServerMaxMoney:2,ServerStartingSecurity:2,ServerStartingMoney:.5,ScriptHackMoney:.15,HacknetNodeMoney:.2,CrimeMoney:.5,InfiltrationRep:1.5,InfiltrationMoney:1.5,AugmentationMoneyCost:2,HackExpGain:.5,CorporationValuation:.5,StaneksGiftPowerMultiplier:1.3,StaneksGiftExtraSize:0,PurchasedServerSoftcap:1.2,WorldDaemonDifficulty:1.5,GangUniqueAugs:.5});case 6:return Object.assign(n,{HackingLevelMultiplier:.35,ServerMaxMoney:.4,ServerStartingMoney:.5,ServerStartingSecurity:1.5,ScriptHackMoney:.75,CompanyWorkMoney:.5,CrimeMoney:.75,InfiltrationMoney:.75,CorporationValuation:.2,HacknetNodeMoney:.2,HackExpGain:.25,DaedalusAugsRequirement:35,PurchasedServerSoftcap:2,StaneksGiftPowerMultiplier:.5,StaneksGiftExtraSize:2,GangSoftcap:.7,CorporationSoftcap:.9,WorldDaemonDifficulty:2,GangUniqueAugs:.2});case 7:return Object.assign(n,{BladeburnerRank:.6,BladeburnerSkillCost:2,AugmentationMoneyCost:3,HackingLevelMultiplier:.35,ServerMaxMoney:.4,ServerStartingMoney:.5,ServerStartingSecurity:1.5,ScriptHackMoney:.5,CompanyWorkMoney:.5,CrimeMoney:.75,InfiltrationMoney:.75,CorporationValuation:.2,HacknetNodeMoney:.2,HackExpGain:.25,FourSigmaMarketDataCost:2,FourSigmaMarketDataApiCost:2,DaedalusAugsRequirement:35,PurchasedServerSoftcap:2,StaneksGiftPowerMultiplier:.9,StaneksGiftExtraSize:-1,GangSoftcap:.7,CorporationSoftcap:.9,WorldDaemonDifficulty:2,GangUniqueAugs:.2});case 8:return Object.assign(n,{ScriptHackMoney:.3,ScriptHackMoneyGain:0,ManualHackMoney:0,CompanyWorkMoney:0,CrimeMoney:0,HacknetNodeMoney:0,InfiltrationMoney:0,RepToDonateToFaction:0,CorporationValuation:0,CodingContractMoney:0,StaneksGiftExtraSize:-99,PurchasedServerSoftcap:4,GangSoftcap:0,CorporationSoftcap:0,GangUniqueAugs:0});case 9:return Object.assign(n,{HackingLevelMultiplier:.5,StrengthLevelMultiplier:.45,DefenseLevelMultiplier:.45,DexterityLevelMultiplier:.45,AgilityLevelMultiplier:.45,CharismaLevelMultiplier:.45,PurchasedServerLimit:0,HomeComputerRamCost:5,CrimeMoney:.5,ScriptHackMoney:.1,HackExpGain:.05,ServerStartingMoney:.1,ServerMaxMoney:.1,ServerStartingSecurity:2.5,CorporationValuation:.5,FourSigmaMarketDataCost:5,FourSigmaMarketDataApiCost:4,BladeburnerRank:.9,BladeburnerSkillCost:1.2,StaneksGiftPowerMultiplier:.5,StaneksGiftExtraSize:2,GangSoftcap:.8,CorporationSoftcap:.7,WorldDaemonDifficulty:2,GangUniqueAugs:.25});case 10:return Object.assign(n,{HackingLevelMultiplier:.35,StrengthLevelMultiplier:.4,DefenseLevelMultiplier:.4,DexterityLevelMultiplier:.4,AgilityLevelMultiplier:.4,CharismaLevelMultiplier:.4,CompanyWorkMoney:.5,CrimeMoney:.5,HacknetNodeMoney:.5,ManualHackMoney:.5,ScriptHackMoney:.5,CodingContractMoney:.5,InfiltrationMoney:.5,CorporationValuation:.5,AugmentationMoneyCost:5,AugmentationRepCost:2,HomeComputerRamCost:1.5,PurchasedServerCost:5,PurchasedServerLimit:.6,PurchasedServerMaxRam:.5,BladeburnerRank:.8,StaneksGiftPowerMultiplier:.75,StaneksGiftExtraSize:-3,PurchasedServerSoftcap:1.1,GangSoftcap:.9,CorporationSoftcap:.9,WorldDaemonDifficulty:2,GangUniqueAugs:.25});case 11:return Object.assign(n,{HackingLevelMultiplier:.6,HackExpGain:.5,ServerMaxMoney:.1,ServerStartingMoney:.1,ServerGrowthRate:.2,ServerWeakenRate:2,CrimeMoney:3,CompanyWorkMoney:.5,HacknetNodeMoney:.1,AugmentationMoneyCost:2,InfiltrationMoney:2.5,InfiltrationRep:2.5,CorporationValuation:.1,CodingContractMoney:.25,FourSigmaMarketDataCost:4,FourSigmaMarketDataApiCost:4,PurchasedServerSoftcap:2,CorporationSoftcap:.9,WorldDaemonDifficulty:1.5,GangUniqueAugs:.75});case 12:{const t=Math.pow(1.02,e),a=1/t;return Object.assign(n,{DaedalusAugsRequirement:Math.floor(Math.min(n.DaedalusAugsRequirement+t,40)),HackingLevelMultiplier:a,StrengthLevelMultiplier:a,DefenseLevelMultiplier:a,DexterityLevelMultiplier:a,AgilityLevelMultiplier:a,CharismaLevelMultiplier:a,ServerMaxMoney:a,ServerStartingMoney:a,ServerGrowthRate:a,ServerWeakenRate:a,ServerStartingSecurity:1.5,HomeComputerRamCost:t,PurchasedServerCost:t,PurchasedServerLimit:a,PurchasedServerMaxRam:a,PurchasedServerSoftcap:t,ManualHackMoney:a,ScriptHackMoney:a,CompanyWorkMoney:a,CrimeMoney:a,HacknetNodeMoney:a,CodingContractMoney:a,CompanyWorkExpGain:a,ClassGymExpGain:a,FactionWorkExpGain:a,HackExpGain:a,CrimeExpGain:a,FactionWorkRepGain:a,FactionPassiveRepGain:a,RepToDonateToFaction:t,AugmentationRepCost:t,AugmentationMoneyCost:t,InfiltrationMoney:a,InfiltrationRep:a,FourSigmaMarketDataCost:t,FourSigmaMarketDataApiCost:t,CorporationValuation:a,BladeburnerRank:a,BladeburnerSkillCost:t,StaneksGiftPowerMultiplier:t,StaneksGiftExtraSize:t,GangSoftcap:.8,CorporationSoftcap:.8,WorldDaemonDifficulty:t,GangUniqueAugs:a})}case 13:return Object.assign(n,{PurchasedServerSoftcap:1.6,HackingLevelMultiplier:.25,StrengthLevelMultiplier:.7,DefenseLevelMultiplier:.7,DexterityLevelMultiplier:.7,AgilityLevelMultiplier:.7,ServerMaxMoney:.45,ServerStartingMoney:.75,ServerStartingSecurity:3,ScriptHackMoney:.2,CompanyWorkMoney:.4,CrimeMoney:.4,HacknetNodeMoney:.4,CodingContractMoney:.4,CompanyWorkExpGain:.5,ClassGymExpGain:.5,FactionWorkExpGain:.5,HackExpGain:.1,CrimeExpGain:.5,FactionWorkRepGain:.6,FourSigmaMarketDataCost:10,FourSigmaMarketDataApiCost:10,CorporationValuation:.001,BladeburnerRank:.45,BladeburnerSkillCost:2,StaneksGiftPowerMultiplier:2,StaneksGiftExtraSize:1,GangSoftcap:.3,CorporationSoftcap:.3,WorldDaemonDifficulty:3,GangUniqueAugs:.1});default:throw new Error("Invalid BitNodeN")}}function m(t){Object.assign(i.a,u(t.bitNodeN,t.sourceFileLvl(t.bitNodeN)))}Object.freeze(f)},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(28),r=n(33);const i={b:!0,initPrice:1e4,marketCap:1e12,mv:1,name:"",otlkMag:0,spreadPerc:0,shareTxForMovement:1e6,symbol:""};function o(t){let e;switch(typeof t){case"number":return t;case"object":{const n=t;e=Object(r.a)(n.min,n.max);break}default:throw Error(`Do not know how to convert the type '${typeof t}' to a number`)}return"object"==typeof t&&"number"==typeof t.divisor?e/t.divisor:e}class s{constructor(t=i){this.name=t.name,this.symbol=t.symbol,this.price=o(t.initPrice),this.lastPrice=this.price,this.playerShares=0,this.playerAvgPx=0,this.playerShortShares=0,this.playerAvgShortPx=0,this.mv=o(t.mv),this.b=t.b,this.otlkMag=t.otlkMag,this.otlkMagForecast=this.getAbsoluteForecast(),this.cap=Object(r.a)(1e3*this.price,25e3*this.price),this.spreadPerc=o(t.spreadPerc),this.shareTxForMovement=o(t.shareTxForMovement),this.shareTxUntilMovement=this.shareTxForMovement;const e=t.marketCap/this.price;this.totalShares=1e5*Math.round(e/1e5);this.maxShares=1e5*Math.round(.2*this.totalShares/1e5)}changeForecastForecast(t){this.otlkMagForecast=t,this.otlkMagForecast>100?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(18),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";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(84);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){const n=t.match(/^([\w|!%,@-]+)=(("(.+)")|('(.+)'))$/);return null!=n&&7==n.length&&(e?function(t,e){t in r&&delete r[t];i[t]=e.trim()}(n[1],n[4]||n[6]):function(t,e){t in i&&delete i[t];r[t]=e.trim()}(n[1],n[4]||n[6]),!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;nn(!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(653),o=n(945),s=n(1748),l=n(125),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,"c",(function(){return C})),n.d(e,"b",(function(){return L})),n.d(e,"a",(function(){return O})),n.d(e,"d",(function(){return T})),n.d(e,"e",(function(){return R}));var a=n(0),r=n.n(a),i=n(125),o=n(142),s=n(1),l=n(19),c=n(8),f=n(45),u=n(452),m=n.n(u),h=n(1031),d=n(121),p=n(144),g=n(598),y=n.n(g),b=n(200),E=n(199),v=n(24),k=n(236),_=n(2),w=n(115),S=n(6);let x=0;const C=new i.a,L=new i.a,O=new i.a;let M=[];function T(){const t=Object(a.useState)(!0)[1];function e(){t(t=>!t)}return Object(a.useEffect)(()=>C.subscribe(t=>{const n=t.server+"-"+t.filename+t.args.map(t=>""+t).join("-");M.find(t=>t.id===n)||(M.push({id:n,script:t}),e())}),[]),Object(a.useEffect)(()=>L.subscribe(t=>{!function(t){M=M.filter(e=>e.script.pid!=t),e()}(t)}),[]),Object(a.useEffect)(()=>O.subscribe(()=>{M=[],e()})),r.a.createElement(r.a.Fragment,null,M.map(t=>r.a.createElement(N,{key:t.id,script:t.script,id:t.id,onClose:()=>{return n=t.id,M=M.filter(t=>t.id!==n),void e();var n}})))}const A=Object(d.a)(t=>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%"}})),R=1500;function N(t){const e=Object(a.useRef)(null),n=Object(a.useRef)(null),[i,u]=Object(a.useState)(t.script),d=A(),p=Object(a.useRef)(null),g=Object(a.useState)(!1)[1],[C,L]=Object(a.useState)(!1);function O(){g(t=>!t)}function M(){Object(o.a)(i,i.server,!0)}function T(){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)(_.a,i,t):u(e)}function N(){const t=p.current;null!==t&&(t.style.zIndex=R+x+"",x++,O())}function P(t=!1){const e=`${i.filename} ${i.args.map(t=>""+t).join(" ")}`;return t||e.length<=30?e:e.slice(0,27)+"..."}function I(){L(!C)}Object(a.useEffect)(()=>{N();const t=setInterval(O,1e3);return()=>clearInterval(t)},[]),Object(a.useEffect)(()=>(window.addEventListener("resize",F),()=>{window.removeEventListener("resize",F)}),[]);const F=Object(w.debounce)(()=>{const t=null==e?void 0:e.current;t&&(D(t)||j())},100),D=t=>{const e=t.getBoundingClientRect();return!(e.right<0||e.bottom<0||e.left>innerWidth||e.top>outerWidth)},j=()=>{const t=null==n?void 0:n.current;if(!t)return;const e=t.state;e.x=0,e.y=0,t.setState(e)},B=[250,33];return r.a.createElement(m.a,{handle:".drag",onDrag:t=>{if(t.clientX<0||t.clientY<0||t.clientX>innerWidth||t.clientY>innerHeight)return!1},ref:n,onMouseDown:N},r.a.createElement(l.a,{display:"flex",sx:{flexFlow:"column",position:"fixed",left:"40%",top:"30%",zIndex:1400,minWidth:B[0]+"px",minHeight:B[1]+"px",...C?{border:"none",margin:0,maxHeight:0,padding:0}:{border:"1px solid "+S.a.theme.welllight}},ref:p},r.a.createElement(h.ResizableBox,{height:500,width:500,minConstraints:B,handle:r.a.createElement("span",{style:{position:"absolute",right:"-10px",bottom:"-16px",cursor:"nw-resize",display:C?"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:P(!0)},P(!0)),r.a.createElement("span",{style:{minWidth:"fit-content",height:B[1]+"px"}},b.a.has(i.pid)?r.a.createElement(c.a,{className:d.titleButton,onClick:M,onTouchEnd:M},"Kill"):r.a.createElement(c.a,{className:d.titleButton,onClick:T,onTouchEnd:T},"Run"),r.a.createElement(c.a,{className:d.titleButton,onClick:I,onTouchEnd:I},C?"🗖":"🗕"),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% - ${B[1]}px)`,display:C?"none":"flex"}},r.a.createElement("span",{style:{display:"flex",flexDirection:"column"}},i.logs.map((t,e)=>{return r.a.createElement(s.a,{key:e,sx:{color:(n=t,n.match(/(^\[[^\]]+\] )?ERROR/)||n.match(/(^\[[^\]]+\] )?FAIL/)?S.a.theme.error:n.match(/(^\[[^\]]+\] )?SUCCESS/)?S.a.theme.success:n.match(/(^\[[^\]]+\] )?WARN/)?S.a.theme.warning:n.match(/(^\[[^\]]+\] )?INFO/)?S.a.theme.info:S.a.theme.primary)}},t,r.a.createElement("br",null));var n})))))))}},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";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";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 s}));var a=n(376),r=n(346),i=n(28);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 l}));var a=n(434),r=n(154),i=n(771),o=n(15),s=n(602);const l={};function c(t){if(!t.name)throw new Error("Invalid constructor parameters for Location. No 'name' property");return l[t.name]instanceof i.a&&console.warn(`Property with name ${t.name} already exists and is being overwritten`),l[t.name]=new i.a(t),l[t.name]}r.a[o.a.Aevum]=new a.a(o.a.Aevum),r.a[o.a.Chongqing]=new a.a(o.a.Chongqing),r.a[o.a.Ishima]=new a.a(o.a.Ishima),r.a[o.a.NewTokyo]=new a.a(o.a.NewTokyo),r.a[o.a.Sector12]=new a.a(o.a.Sector12),r.a[o.a.Volhaven]=new a.a(o.a.Volhaven),r.a[o.a.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 ",r.a[o.a.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 ",r.a[o.a.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 ",r.a[o.a.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 ",r.a[o.a.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] ",r.a[o.a.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 ";for(const t of s.a){const e=c(t),n=e.city;if(null===n)for(const t of Object.keys(r.a))r.a[t].addLocation(e.name);else r.a[n].addLocation(e.name)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(4);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";let a;n.d(e,"a",(function(){return a})),function(t){t[t.Field=0]="Field",t[t.Hacking=1]="Hacking",t[t.None=2]="None",t[t.Security=3]="Security"}(a||(a={}))},,,,,,,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return A})),n.d(e,"c",(function(){return R})),n.d(e,"e",(function(){return P})),n.d(e,"f",(function(){return F})),n.d(e,"b",(function(){return D})),n.d(e,"d",(function(){return j}));var a=n(142),r=n(180),i=n(421),o=n(200),s=n(297),l=n(527),c=n(10),f=n(595),u=n(110),m=n(528),h=n(643),d=n(1413),p=n(369),g=n(651),y=n(236),b=n(24),E=n(6),v=n(684),k=n(14),_=n(257),w=n(526),S=n(146),x=n(422),C=n(256),L=n(303),O=n(83),M=n(2),T=n(84);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(v.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(L.b)(o,{FunctionDeclaration:t=>{e.includes(t.id.name)&&n.push(t)}}),n.forEach(t=>{r+=Object(v.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(v.generate)(n);return{code:t=r+t,lineOffset:s}}(e,t);n=a.code,i=a.lineOffset}catch(e){return Object(k.a)("Error processing Imports in "+t.name+":
"+e),t.env.stopFlag=!0,t.running=!1,Object(a.a)(t),Promise.resolve()}const o=function(e,n){const i=Object(m.a)(t);for(const o of Object.keys(i)){const s=i[o];if("function"==typeof s)if(["hack","grow","weaken","sleep","prompt","manualHack","scp","write","share","wget"].includes(o)){const i=function(...n){const i=[];for(let t=0;t`;return s+="
",s+=o,Object(k.a)(s),t.env.stopFlag=!0,t.running=!1,Object(a.a)(t),Promise.resolve()}}))};e.setProperty(n,o,e.createAsyncFunction(i))}else if("sprintf"===o||"vsprintf"===o||"scp"===o||"write"==o||"tryWrite"===o||"run"===o||"exec"===o){const t=function(...t){const n=[];for(let a=0;a"+e),t.env.stopFlag=!0,t.running=!1,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,o=0;for(;o<3&&i;)i=i&&s.step(),o++;i?setTimeout(a,E.a.CodeInstructionRunTime):e()}catch(e){return e=e.toString(),Object(u.a)(e)||(e=Object(u.b)(t,e)),t.errorMessage=e,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 P(t,e,n,a){return I(t,e,n,a)?(n.runScript(e),e.pid):0}function I(t,e,n,c){let f=1;e.threads&&!isNaN(e.threads)?f=e.threads:e.threads=1;const d=Object(g.a)(e),p=Object(w.a)(d*f);if(p>n.maxRam-n.ramUsed+.001)return Object(k.a)(`Not enough RAM to run script ${e.filename} with args `+Object(_.a)(e.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;n.updateRamUsed(Object(w.a)(n.ramUsed+p),M.a);const y=Object(l.a)();if(-1===y)throw new Error("Failed to start script because could not find available PID. This is most because you have too many scripts running.");const b=new i.a(e,y,m.a);b.ramUsage=d,o.a.set(y,b),s.a.emit();let E=null;if(b.name.endsWith(".js")||b.name.endsWith(".ns"))E=function(t,e){e.running=!0;let n=null;function a(t,a){return function(...i){if(e.env.stopFlag)throw new r.a(e);if("asleep"===t)return a(...i);if(n)throw e.errorMessage=Object(u.b)(e,Object(x.sprintf)("Concurrent calls to Netscript functions are not allowed! Did you forget to await hack(), grow(), or some other promise-returning function? (Currently running: %s tried to run: %s)",n,t)),new r.a(e);let o;n=t;try{o=a(...i)}catch(t){throw n=null,t}return o&&void 0!==o.finally?o.finally((function(){n=null})):(n=null,o)}}return function t(e,...n){for(const r of Object.keys(e))switch(typeof e[r]){case"function":e[r]=a([...n,r].join("."),e[r]);break;case"object":if(Array.isArray(e[r]))continue;t(e[r],...n,r)}}(e.env.vars),new Promise((n,a)=>{Object(h.b)(t,e.getServer().scripts,e).then(()=>{n()}).catch(t=>a(t))}).catch(t=>{if(t instanceof Error)throw t instanceof SyntaxError?e.errorMessage=Object(u.b)(e,t.message+" (sorry we can't be more helpful)"):e.errorMessage=Object(u.b)(e,t.message+(t.stack&&"\nstack:\n"+t.stack.toString()||"")),new r.a(e);if(Object(u.a)(t))throw e.errorMessage=t,new r.a(e);if(t instanceof r.a)throw t;throw e.errorMessage=Object(u.b)(e,""+t),new r.a(e)})}(t,b);else if(E=N(b),!(E instanceof Promise))return!1;return E.then((function(){b.running=!1,b.env.stopFlag=!0,void 0!==c&&c.running&&(c.scriptRef.onlineExpGained+=e.onlineExpGained,c.scriptRef.onlineMoneyMade+=e.onlineMoneyMade),Object(a.a)(b),b.log("",()=>"Script finished running")})).catch((function(t){if(t instanceof Error)return Object(k.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(!Object(u.a)(b.errorMessage))return void b.log("",()=>"Script killed");{const t=b.errorMessage.split("|DELIMITER|");if(4!=t.length)return console.error("ERROR: Something wrong with Error text in evaluator..."),void console.error("Error text: "+b.errorMessage);const e=t[1],n=t[2],a=t[3];let r=`RUNTIME ERROR
${n}@${e} (PID - ${b.pid})
`;b.args.length>0&&(r+=`Args: ${Object(_.a)(b.args)}
`),r+="
",r+=a,Object(k.a)(r),b.log("",()=>"Script crashed with runtime error")}}else{if(Object(u.a)(t))return Object(k.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(k.a)("An unknown script died for an unknown reason. This is a bug please contact game dev"),console.error(t)}Object(a.a)(b)})),!0}function F(t=1){const e=t*c.a._idleSpeed/1e3;for(const t of o.a.values())t.scriptRef.onlineRunningTime+=e}function D(t){const e=-1!==window.location.href.toLowerCase().indexOf("?noscripts");e&&(T.a.warn("Skipped loading player scripts during startup"),console.info("Skipping the load of any scripts during startup"));for(const n of Object(b.c)()){n.ramUsed=0;for(let t=0;t`Invalid arguments: scriptname='${a} args='${r}'`),console.error("runScriptFromScript() failed due to invalid arguments"),0;r.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${a} argument index ${e} is of type ${typeof t} and value ${JSON.stringify(t)}`)});if(null!=n.getRunningScript(a,r))return o.log(e,()=>`'${a}' is already running on '${n.hostname}'`),0;for(let t=0;t"Cannot execute a script with null/undefined as an argument"),0;for(let i=0;i`You do not have root access on '${n.hostname}'`),0;if(c>f+.001)return o.log(e,()=>`Cannot run script '${a}' (t=${s}) on '${n.hostname}' because there is not enough available RAM!`),0;o.log(e,()=>`'${a}' on '${n.hostname}' with ${s} threads and args: ${Object(_.a)(r)}.`);const u=new p.a(l,r);return u.threads=s,u.server=n.hostname,P(t,u,n,o)}return o.log(e,()=>`Could not find script '${a}' on '${n.hostname}'`),0}},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 f}));var a=n(0),r=n.n(a),i=n(78),o=n(149),s=n(148),l=n(50),c=n(1);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(28);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 D}));var a=n(28),r=n(261),i=n(42),o=n(545),s=n(270),l=n(140),c=n(351),f=n(659),u=n(259),m=n(22),h=n(227),d=n(247),p=n(432),g=n(230),y=n(25),b=n(660),E=n(267),v=n(33),k=n(59),_=n(5),w=n(18),S=n(304),x=n(185),C=n(26),L=n(406),O=n(14),M=n(6),T=n(12),A=n(1021),R=n(105),N=n(4),P=n(57),I=n(27);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 D{constructor(t){F(this,"numHosp",0),F(this,"moneyLost",0),F(this,"rank",0),F(this,"maxRank",0),F(this,"skillPoints",0),F(this,"totalSkillPoints",0),F(this,"teamSize",0),F(this,"sleeveSize",0),F(this,"teamLost",0),F(this,"hpLost",0),F(this,"storedCycles",0),F(this,"randomEventCounter",Object(v.a)(240,600)),F(this,"actionTimeToComplete",0),F(this,"actionTimeCurrent",0),F(this,"actionTimeOverflow",0),F(this,"action",new r.a({type:i.a.Idle})),F(this,"cities",{}),F(this,"city",k.a.CityNames[2]),F(this,"skills",{}),F(this,"skillMultipliers",{}),F(this,"staminaBonus",0),F(this,"maxStamina",0),F(this,"stamina",0),F(this,"contracts",{}),F(this,"operations",{}),F(this,"blackops",{}),F(this,"logging",{general:!0,contracts:!0,ops:!0,blackops:!0,events:!0}),F(this,"automateEnabled",!1),F(this,"automateActionHigh",new r.a({type:i.a.Idle})),F(this,"automateThreshHigh",0),F(this,"automateActionLow",new r.a({type:i.a.Idle})),F(this,"automateThreshLow",0),F(this,"consoleHistory",[]),F(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(E.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(E.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(E.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){const e=t.name;if(this.skills[e]?++this.skills[e]:this.skills[e]=1,isNaN(this.skills[e])||this.skills[e]<0)throw new Error("Level of Skill "+e+" is invalid: "+this.skills[e]);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[N.a.Bladeburners];this.rank>=k.a.RankNeededForFaction&&Object(R.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.f)(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 b.a.helpList)this.postToConsole(t);else for(let e=1;e0&&(i*=Object(v.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(v.a)(0,r);if(this.teamSize-=i,this.teamSize"Support main sleeve"==t.bbAction);for(let e=0;e>this.teamSize-this.sleeveSize;e--){const e=Math.floor(Math.random()*t.length);t[e].takeDamage(t[e].max_hp),t.splice(e,1)}this.teamSize+=this.sleeveSize}this.teamLost+=i,this.logging.ops&&i>0&&this.log("Lost "+Object(m.f)(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(v.a)(-10,-5)/10;r.changePopulationByPercentage(t,{nonZero:!0,changeEstEqually:!1})}r.changeChaosByPercentage(Object(v.a)(1,5));break;case"Stealth Retirement Operation":t&&r.changePopulationByPercentage(-.5,{changeEstEqually:!0,nonZero:!0}),r.changeChaosByPercentage(Object(v.a)(-3,-1));break;case"Assassination":t&&r.changePopulationByCount(-1,{estChange:-1,estOffset:0}),r.changeChaosByPercentage(Object(v.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(v.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,k.a.DiffMultExponentialFactor)+l/k.a.DiffMultLinearFactor,f=Math.pow(s.rewardFac,s.level-1);if(a&&(this.stamina-=k.a.BaseStaminaLoss*c,this.stamina<0&&(this.stamina=0)),s.attempt(this,e)){r=this.getActionStats(s,!0),++s.successes,--s.count;let a=0;if(o||(a=k.a.ContractBaseMoneyGain*f*this.skillMultipliers.money,r.money=a),o?s.setMaxLevel(k.a.OperationSuccessesPerLevel):s.setMaxLevel(k.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.f)(t,3)+" rank"):!o&&this.logging.contracts&&this.log(e.whoAmI()+": "+s.name+" contract successfully completed! Gained "+Object(m.f)(t,3)+" rank and "+_.a.formatMoney(a))}o?this.completeOperation(!0,t):this.completeContract(!0,n)}else{r=this.getActionStats(s,!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(L.a)(t,i);e.takeDamage(i)&&(++this.numHosp,this.moneyLost+=n)}let l="";a>0&&(l+="Lost "+Object(m.f)(a,3)+" rank. "),i>0&&(l+="Took "+Object(m.f)(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(E.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,k.a.DiffMultExponentialFactor)+i/k.a.DiffMultLinearFactor;this.stamina-=k.a.BaseStaminaLoss*o,this.stamina<0&&(this.stamina=0);const s=a.teamCount;let c;if(a.attempt(this,e)){r=this.getActionStats(a,!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.f)(t,1)+" rank")}else{r=this.getActionStats(a,!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(L.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.f)(n,1)+" rank and took "+Object(m.f)(i,0)+" damage")}if(this.resetAction(),s>=1){const n=Object(v.a)(1,c);if(this.teamSize-=n,this.teamSize"Support main sleeve"==t.bbAction);for(let t=0;t>this.teamSize-this.sleeveSize;t--){const t=Math.floor(Math.random()*e.length);e[t].takeDamage(e[t].max_hp),e.splice(t,1)}this.teamSize+=this.sleeveSize}this.teamLost+=n,this.logging.blackops&&this.log(`${e.whoAmI()}: You lost ${Object(m.f)(n,0)} team members during ${a.name}`)}}catch(t){Object(E.a)(t)}break;case i.a.Training:{this.stamina-=.5*k.a.BaseStaminaLoss;const t=30*e.strength_exp_mult,n=30*e.defense_exp_mult,a=30*e.dexterity_exp_mult,i=30*e.agility_exp_mult,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.f)(t,1)+" str exp, "+Object(m.f)(n,1)+" def exp, "+Object(m.f)(a,1)+" dex exp, "+Object(m.f)(i,1)+" agi exp, "+Object(m.f)(o,3)+" max stamina");break}case i.a.FieldAnalysis:case i.a["Field Analysis"]:{let t=.04*Math.pow(e.hacking,.3)+.04*Math.pow(e.intelligence,.9)+.02*Math.pow(e.charisma,.3);if(t*=e.bladeburner_analysis_mult,isNaN(t)||t<0)throw new Error("Field Analysis Effectiveness calculated to be NaN or negative");const n=20*e.hacking_exp_mult,a=20*e.charisma_exp_mult,i=.1*w.a.BladeburnerRank;r.hack=n,r.cha=a,r.int=k.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.f)(i,2)} rank, `+Object(m.f)(n,1)+" hacking exp, and "+Object(m.f)(a,1)+" charisma exp");break}case i.a.Recruitment:{const t=this.getRecruitmentSuccessChance(e),n=1e3*this.getRecruitmentTime(e);if(Math.random()"Infiltrate synthoids"===t.bbAction).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=N.a.Bladeburners;if(Object(C.b)(n)){const a=C.a[n];if(!(a instanceof x.a))throw new Error(`Could not properly get ${N.a.Bladeburners} Faction object in ${N.a.Bladeburners} UI Overview Faction button`);if(a.isMember){const n=1+a.favor/100;a.playerReputation+=k.a.RankToFactionRepFactor*e*t.faction_rep_mult*n}}const a=(this.totalSkillPoints+1)*k.a.RanksPerSkillPoint;if(this.maxRank>=a){const t=Math.floor((this.maxRank-a)/k.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 n=this.getActionObject(this.action),a=this.completeAction(e,e,this.action);if(e.gainMoney(a.money,"bladeburner"),e.gainStats(a),null==n)throw new Error("Failed to get BlackOperation Object for: "+this.action.name);n.name===P.a.OperationDaedalus&&this.blackops[n.name]?(this.resetAction(),t.toBitVerse(!1,!1)):this.action.type!=i.a.BlackOperation&&this.action.type!=i.a.BlackOp&&this.startAction(e,this.action)}}}calculateStaminaGainPerSecond(t){const e=t.agility*this.skillMultipliers.effAgi,n=this.maxStamina/k.a.MaxStaminaToGainFactor;return(k.a.StaminaGainPerSecond+n)*Math.pow(e,.17)*(this.skillMultipliers.stamina*t.bladeburner_stamina_gain_mult)}calculateMaxStamina(t){const e=t.agility*this.skillMultipliers.effAgi,n=(Math.pow(e,.8)+this.staminaBonus)*this.skillMultipliers.stamina*t.bladeburner_max_stamina_mult;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(v.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(v.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(v.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(v.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(v.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(v.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(v.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(v.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(v.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(t.page()!==y.a.BitVerse&&this.blackops.hasOwnProperty(P.a.OperationDaedalus))return t.toBitVerse(!1,!1);if(!e.hasAugmentation(T.a.BladesSimulacrum,!0)&&e.isWorking){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),M.a.SuppressBladeburnerPopup||Object(O.a)(t)}this.resetAction()}if(this.stamina<=0&&(this.log("Your Bladeburner action was cancelled because your stamina hit 0"),this.resetAction()),this.storedCycles>=k.a.CyclesPerSecond){let n=Math.floor(this.storedCycles/k.a.CyclesPerSecond);n=Math.min(n,5),this.storedCycles-=n*k.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()/k.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()/k.a.ActionCountGrowthPeriod)}for(const t of k.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(v.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 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){if(""===t||!h.a.hasOwnProperty(t))return e.log("bladeburner.getSkillUpgradeCost",()=>`Invalid skill: '${t}'`),-1;const n=h.a[t];return null==this.skills[t]?n.calculateCost(0):n.calculateCost(this.skills[t])}upgradeSkillNetscriptFn(t,e){const n=`Invalid skill: '${t}'`;if(!h.a.hasOwnProperty(t))return e.log("bladeburner.upgradeSkill",()=>n),!1;const a=h.a[t];let r=0;this.skills[t]&&!isNaN(this.skills[t])&&(r=this.skills[t]);const i=a.calculateCost(r);return a.maxLvl&&r>=a.maxLvl?(e.log("bladeburner.upgradeSkill",()=>`Skill '${t}' is already maxed.`),!1):this.skillPoints`You do not have enough skill points to upgrade ${t} (You have ${this.skillPoints}, you need ${i})`),!1):(this.skillPoints-=i,this.upgradeSkill(a),e.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[N.a.Bladeburners];return!!e.isMember||(this.rank>=k.a.RankNeededForFaction?(Object(R.d)(e),t.log("bladeburner.joinBladeburnerFaction",()=>`Joined ${N.a.Bladeburners} faction.`),!0):(t.log("bladeburner.joinBladeburnerFaction",()=>`You do not have the required rank (${this.rank}/${k.a.RankNeededForFaction}).`),!1))}toJSON(){return Object(a.b)("Bladeburner",this)}static fromJSON(t){return Object(a.a)(D,t.data)}}a.c.constructors.Bladeburner=D},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(18),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,"a",(function(){return l}));var a=n(0),r=n(5),i=n(121),o=n(144);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(10),r=n(211),i=n(41),o=n(14),s=n(28),l=n(383);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(14),r=n(28),i=n(83);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=this.fn,e=new Blob([this.text],{type:"text/plain"}),n=window.navigator;if(n.msSaveOrOpenBlob)n.msSaveOrOpenBlob(e,t);else{const t=document.createElement("a"),n=URL.createObjectURL(e);t.href=n,t.download=this.fn,document.body.appendChild(t),t.click(),setTimeout(()=>{document.body.removeChild(t),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,"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,ScriptGetOwnedSourceFiles:5,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={getSymbols:a.ScriptGetStockRamCost,getPrice:a.ScriptGetStockRamCost,getAskPrice:a.ScriptGetStockRamCost,getBidPrice:a.ScriptGetStockRamCost,getPosition:a.ScriptGetStockRamCost,getMaxShares:a.ScriptGetStockRamCost,getPurchaseCost:a.ScriptGetStockRamCost,getSaleGain:a.ScriptGetStockRamCost,buy:a.ScriptBuySellStockRamCost,sell:a.ScriptBuySellStockRamCost,short: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),getStats:r(a.ScriptSingularityFn1RamCost/4),getCharacterInformation: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),getAugmentationsFromFaction:r(a.ScriptSingularityFn3RamCost),getAugmentationCost:r(a.ScriptSingularityFn3RamCost),getAugmentationPrereq:r(a.ScriptSingularityFn3RamCost),getAugmentationPrice: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)},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},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:{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},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,getScriptIncome: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,getOwnedSourceFiles:a.ScriptGetOwnedSourceFiles,tail:0,toast:0,closeTail:0,clearPort:0,openDevMenu:0,alert:0,flags:0,exploit:0,bypass:0,alterReality:0,rainbow:0,heart:{break:0},formulas:{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}}},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";function a(){return{hack:0,str:0,def:0,dex:0,agi:0,cha:0,int:0,money:0}}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})),n.d(e,"d",(function(){return s})),n.d(e,"c",(function(){return l}));var a=n(18),r=n(10);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,"c",(function(){return f})),n.d(e,"a",(function(){return u})),n.d(e,"b",(function(){return m}));var a=n(10),r=n(2),i=n(46),o=n(137),s=n(24),l=n(5),c=n(321);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;a{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(202),r=n(179),i=n(28),o=n(267);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,"c",(function(){return s})),n.d(e,"b",(function(){return l})),n.d(e,"a",(function(){return c}));var a=n(10),r=n(18),i=n(420);function o(t){let e=1+t.favor/100;return isNaN(e)&&(e=1),e*r.a.FactionWorkRepGain}function s(t,e){return(t.hacking+t.intelligence/3)/a.a.MaxSkillLevel*t.faction_rep_mult*t.getIntelligenceBonus(1)*o(e)*Object(i.a)()}function l(t,e){return.9*(t.strength+t.defense+t.dexterity+t.agility+(t.hacking+t.intelligence)*Object(i.a)())/a.a.MaxSkillLevel/4.5*t.faction_rep_mult*o(e)*t.getIntelligenceBonus(1)}function c(t,e){return.9*(t.strength+t.defense+t.dexterity+t.agility+t.charisma+(t.hacking+t.intelligence)*Object(i.a)())/a.a.MaxSkillLevel/5.5*t.faction_rep_mult*o(e)*t.getIntelligenceBonus(1)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u})),n.d(e,"c",(function(){return m})),n.d(e,"d",(function(){return h})),n.d(e,"b",(function(){return d}));var a=n(228),r=n(75),i=n(10),o=n(2),s=n(5),l=n(20),c=n(14),f=n(0);function u(t,e,n=null,u={}){if((e=Math.round(e))<=0)return!1;if(null==t||isNaN(e))return n?n.log("stock.buy",()=>`Invalid arguments: stock='${t}' shares='${e}'`):!0!==u.suppressDialog&&Object(c.a)("Failed to buy stock. This may be a bug, contact developer"),!1;const m=Object(a.b)(t,e,r.a.Long);if(null==m)return!1;if(o.a.money`You do not have enough money to purchase this position. You need ${s.a.formatMoney(m)}.`):!0!==u.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:m}))),!1;if(e+t.playerShares+t.playerShortShares>t.maxShares)return n?n.log("stock.buy",()=>`Purchasing '${e+t.playerShares+t.playerShortShares}' shares would exceed ${t.symbol}'s maximum (${t.maxShares}) number of shares`):!0!==u.suppressDialog&&Object(c.a)(`You cannot purchase this many shares. ${t.symbol} has a maximum of ${s.a.formatShares(t.maxShares)} shares.`),!1;const h=t.playerShares*t.playerAvgPx;o.a.loseMoney(m,"stock");const d=h+m-i.a.StockMarketCommission;if(t.playerShares=Math.round(t.playerShares+e),t.playerAvgPx=d/t.playerShares,Object(a.d)(t,e),null!=u.rerenderFn&&"function"==typeof u.rerenderFn&&u.rerenderFn(),n){const a=`Bought ${s.a.formatShares(e)} shares of ${t.symbol} for ${s.a.formatMoney(m)}. Paid ${s.a.formatMoney(i.a.StockMarketCommission)} in commission fees.`;n.log("stock.buy",()=>a)}else!0!==u.suppressDialog&&Object(c.a)(f.createElement(f.Fragment,null,"Bought ",s.a.formatShares(e)," shares of ",t.symbol," for ",f.createElement(l.a,{money:m}),". Paid"," ",f.createElement(l.a,{money:i.a.StockMarketCommission})," in commission fees."));return!0}function m(t,e,n=null,i={}){if(null==t||e<0||isNaN(e))return n?n.log("stock.sell",()=>`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 u=Object(a.c)(t,e,r.a.Long);if(null==u)return!1;let m=u-t.playerAvgPx*e;if(isNaN(m)&&(m=0),o.a.gainMoney(u,"stock"),n&&(n.scriptRef.onlineMoneyMade+=m,o.a.scriptProdSinceLastAug+=m),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(u)}.`;n.log("stock.sell",()=>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:u}),"."));return!0}function h(t,e,n=null,u={}){if((e=Math.round(e))<=0)return!1;if(null==t||isNaN(e))return n?n.log("stock.short",()=>`Invalid arguments: stock='${t}' shares='${e}'`):!0!==u.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 m=Object(a.b)(t,e,r.a.Short);if(null==m)return!1;if(o.a.money"You do not have enough money to purchase this short position. You need "+s.a.formatMoney(m)):!0!==u.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:m}))),!1;if(e+t.playerShares+t.playerShortShares>t.maxShares)return n?n.log("stock.short",()=>`This '${e+t.playerShares+t.playerShortShares}' short shares would exceed ${t.symbol}'s maximum (${t.maxShares}) number of shares.`):!0!==u.suppressDialog&&Object(c.a)(`You cannot purchase this many shares. ${t.symbol} has a maximum of ${t.maxShares} shares.`),!1;const h=t.playerShortShares*t.playerAvgShortPx;o.a.loseMoney(m,"stock");const d=h+m-i.a.StockMarketCommission;if(t.playerShortShares=Math.round(t.playerShortShares+e),t.playerAvgShortPx=d/t.playerShortShares,Object(a.d)(t,e),null!=u.rerenderFn&&"function"==typeof u.rerenderFn&&u.rerenderFn(),n){const a=`Bought a short position of ${s.a.formatShares(e)} shares of ${t.symbol} for ${s.a.formatMoney(m)}. Paid ${s.a.formatMoney(i.a.StockMarketCommission)} in commission fees.`;n.log("stock.short",()=>a)}else u.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:m}),". Paid ",f.createElement(l.a,{money:i.a.StockMarketCommission})," in commission fees."));return!0}function d(t,e,n=null,i={}){if(null==t||isNaN(e)||e<0)return n?n.log("stock.sellShort",()=>`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 u=e*t.playerAvgShortPx,m=Object(a.c)(t,e,r.a.Short);if(null==m||isNaN(m)||null==u)return n?n.log("stock.sellShort",()=>"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 h=m-u;if(isNaN(h)&&(h=0),o.a.gainMoney(m,"stock"),n&&(n.scriptRef.onlineMoneyMade+=h,o.a.scriptProdSinceLastAug+=h),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(m);n.log("stock.sellShort",()=>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:m})));return!0}},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(375);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(18);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){return Math.floor((this.baseCost+t*this.costInc)*a.a.BladeburnerSkillCost)}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(38),o=n(8),s=n(1);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"ddf4ab26"}catch(t){}return"DEV"}n.d(e,"a",(function(){return a}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(525),r=n(28),i=n(526);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",""),o(this,"dependencies",[]),o(this,"dependents",[]),o(this,"ramUsage",0),o(this,"server",""),this.filename=e,this.code=n,this.ramUsage=0,this.server=a,this.module="",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=window.navigator;if(n.msSaveOrOpenBlob)n.msSaveOrOpenBlob(e,t);else{const 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="",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()}}async updateRamUsage(t,e){const n=await 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";function a(t){const e=[];for(let n=0;n13)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(28);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,"a",(function(){return o}));var a=n(0),r=n.n(a),i=n(777);function o({children:t}){return r.a.createElement(i.MathJaxContext,{version:3,src:"dist/ext/MathJax-3.2.0/es5/tex-chtml.js"},r.a.createElement(i.MathJax,null,t))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(14);function r(t){console.error(t);let e="",n="UNKNOWN FILE NAME",r="UNKNOWN LINE NUMBER";var i,o,s;(t=>t.hasOwnProperty("fileName"))(t)?(n=null!==(i=t.fileName)&&void 0!==i?i:n,r=null!==(o=null===(s=t.lineNumber)||void 0===s?void 0:s.toString())&&void 0!==o?o:r):e=t;Object(a.a)("Caught an exception: "+e+"

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";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(79);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(140),r=n(57);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(120),r=n(28);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";n.d(e,"a",(function(){return i}));var a=n(10);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,n=0,a=0,i=0,o=0,s={}){r(this,"difficulty",0),r(this,"karma",0),r(this,"kills",0),r(this,"money",0),r(this,"name",""),r(this,"time",0),r(this,"hacking_success_weight",0),r(this,"strength_success_weight",0),r(this,"defense_success_weight",0),r(this,"dexterity_success_weight",0),r(this,"agility_success_weight",0),r(this,"charisma_success_weight",0),r(this,"hacking_exp",0),r(this,"strength_exp",0),r(this,"defense_exp",0),r(this,"dexterity_exp",0),r(this,"agility_exp",0),r(this,"charisma_exp",0),r(this,"intelligence_exp",0),this.name=t,this.type=e,this.time=n,this.money=a,this.difficulty=i,this.karma=o,this.hacking_success_weight=s.hacking_success_weight?s.hacking_success_weight:0,this.strength_success_weight=s.strength_success_weight?s.strength_success_weight:0,this.defense_success_weight=s.defense_success_weight?s.defense_success_weight:0,this.dexterity_success_weight=s.dexterity_success_weight?s.dexterity_success_weight:0,this.agility_success_weight=s.agility_success_weight?s.agility_success_weight:0,this.charisma_success_weight=s.charisma_success_weight?s.charisma_success_weight:0,this.hacking_exp=s.hacking_exp?s.hacking_exp:0,this.strength_exp=s.strength_exp?s.strength_exp:0,this.defense_exp=s.defense_exp?s.defense_exp:0,this.dexterity_exp=s.dexterity_exp?s.dexterity_exp:0,this.agility_exp=s.agility_exp?s.agility_exp:0,this.charisma_exp=s.charisma_exp?s.charisma_exp:0,this.intelligence_exp=s.intelligence_exp?s.intelligence_exp:0,this.kills=s.kills?s.kills:0}commit(t,e,n=1,a=null){return n<=0&&(n=1),e.startCrime(t,this.type,this.hacking_exp/n,this.strength_exp/n,this.defense_exp/n,this.dexterity_exp/n,this.agility_exp/n,this.charisma_exp/n,this.money/n,this.time,a),this.time}successRate(t){let e=this.hacking_success_weight*t.hacking+this.strength_success_weight*t.strength+this.defense_success_weight*t.defense+this.dexterity_success_weight*t.dexterity+this.agility_success_weight*t.agility+this.charisma_success_weight*t.charisma+a.a.IntelligenceCrimeWeight*t.intelligence;return e/=a.a.MaxSkillLevel,e/=this.difficulty,e*=t.crime_success_mult,e*=t.getIntelligenceBonus(1),Math.min(e,1)}}},,,,,,,,,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 i}));var a=n(1024),r=n(1025);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";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"}(a||(a={}))},,function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(0),r=n.n(a),i=n(5),o=n(222);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(537),i=n(29),o=n(8),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 a}));const a=new(n(125).a)},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(2),r=n(90),i=n(83),o=n(84),s=n(94),l=n(24),c=n(109),f=n(6),u=n(603),m=n(10),h=n(254);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.log(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=>{const n=await window.appSaveFns.getSaveInfo(e);t.send("get-save-info-response",n)}),t.receive("push-save-request",({save:t,automatic:e=!1})=>{window.appSaveFns.pushSaveData(t,e)}),t.receive("trigger-save",()=>window.appSaveFns.triggerSave().then(()=>{t.send("save-completed")}).catch(t=>{console.log(t),s.b.emit("Could not save game.",s.d.ERROR,2e3)})),t.receive("trigger-game-export",()=>{try{window.appSaveFns.triggerGameExport()}catch(t){console.log(t),s.b.emit("Could not export game.",s.d.ERROR,2e3)}}),t.receive("trigger-scripts-export",()=>{try{window.appSaveFns.triggerScriptsExport()}catch(t){console.log(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(164).Buffer)},,function(t,e,n){"use strict";n.d(e,"a",(function(){return R})),n.d(e,"b",(function(){return N}));var a=n(12),r=n(138),i=n(227),o=n(10),s=n(51),l=n(108),c=n(26),f=n(82),u=n(187),m=n(41),h=n(56),d=n(223),p=n(92),g=n(15),y=n(2),b=n(65),E=n(24),v=n(88),k=n(46),_=n(90),w=n(25),S=n(1140),x=n(4),C=n(57),L=n(34);const O=S.a;function M(){const t=Object(E.d)(v.a.WorldDaemon);return t instanceof k.a&&(!!t.backdoorInstalled||null!==y.a.bladeburner&&y.a.bladeburner.blackops.hasOwnProperty(C.a.OperationDaedalus))}function T(t,e){return t.bitNodeN===e||t.sourceFiles.some(t=>t.n===e)}function A(t){return t.sourceFiles.some(t=>1===t.n)}const R={[x.a.CyberSec.toUpperCase()]:{...O[x.a.CyberSec.toUpperCase()],Icon:"CSEC",Condition:()=>y.a.factions.includes(x.a.CyberSec)},[x.a.NiteSec.toUpperCase()]:{...O[x.a.NiteSec.toUpperCase()],Icon:x.a.NiteSec,Condition:()=>y.a.factions.includes(x.a.NiteSec)},THE_BLACK_HAND:{...O.THE_BLACK_HAND,Icon:"TBH",Condition:()=>y.a.factions.includes(x.a.TheBlackHand)},[x.a.BitRunners.toUpperCase()]:{...O[x.a.BitRunners.toUpperCase()],Icon:x.a.BitRunners.toLowerCase(),Condition:()=>y.a.factions.includes(x.a.BitRunners)},[x.a.Daedalus.toUpperCase()]:{...O[x.a.Daedalus.toUpperCase()],Icon:x.a.Daedalus.toLowerCase(),Condition:()=>y.a.factions.includes(x.a.Daedalus)},THE_COVENANT:{...O.THE_COVENANT,Icon:x.a.TheCovenant.toLowerCase().replace(/ /g,""),Condition:()=>y.a.factions.includes(x.a.TheCovenant)},[x.a.Illuminati.toUpperCase()]:{...O[x.a.Illuminati.toUpperCase()],Icon:x.a.Illuminati.toLowerCase(),Condition:()=>y.a.factions.includes(x.a.Illuminati)},"BRUTESSH.EXE":{...O["BRUTESSH.EXE"],Icon:"p0",Condition:()=>y.a.getHomeComputer().programs.includes(b.a.BruteSSHProgram.name)},"FTPCRACK.EXE":{...O["FTPCRACK.EXE"],Icon:"p1",Condition:()=>y.a.getHomeComputer().programs.includes(b.a.FTPCrackProgram.name)},"RELAYSMTP.EXE":{...O["RELAYSMTP.EXE"],Icon:"p2",Condition:()=>y.a.getHomeComputer().programs.includes(b.a.RelaySMTPProgram.name)},"HTTPWORM.EXE":{...O["HTTPWORM.EXE"],Icon:"p3",Condition:()=>y.a.getHomeComputer().programs.includes(b.a.HTTPWormProgram.name)},"SQLINJECT.EXE":{...O["SQLINJECT.EXE"],Icon:"p4",Condition:()=>y.a.getHomeComputer().programs.includes(b.a.SQLInjectProgram.name)},"FORMULAS.EXE":{...O["FORMULAS.EXE"],Icon:"formulas",Condition:()=>y.a.getHomeComputer().programs.includes(b.a.Formulas.name)},"SF1.1":{...O["SF1.1"],Icon:"SF1.1",Visible:()=>T(y.a,1),Condition:()=>y.a.sourceFileLvl(1)>=1},"SF2.1":{...O["SF2.1"],Icon:"SF2.1",Visible:()=>T(y.a,2),Condition:()=>y.a.sourceFileLvl(2)>=1},"SF3.1":{...O["SF3.1"],Icon:"SF3.1",Visible:()=>T(y.a,3),Condition:()=>y.a.sourceFileLvl(3)>=1},"SF4.1":{...O["SF4.1"],Icon:"SF4.1",Visible:()=>T(y.a,4),Condition:()=>y.a.sourceFileLvl(4)>=1},"SF5.1":{...O["SF5.1"],Icon:"SF5.1",Visible:()=>T(y.a,5),Condition:()=>y.a.sourceFileLvl(5)>=1},"SF6.1":{...O["SF6.1"],Icon:"SF6.1",Visible:()=>T(y.a,6),Condition:()=>y.a.sourceFileLvl(6)>=1},"SF7.1":{...O["SF7.1"],Icon:"SF7.1",Visible:()=>T(y.a,7),Condition:()=>y.a.sourceFileLvl(7)>=1},"SF8.1":{...O["SF8.1"],Icon:"SF8.1",Visible:()=>T(y.a,8),Condition:()=>y.a.sourceFileLvl(8)>=1},"SF9.1":{...O["SF9.1"],Icon:"SF9.1",Visible:()=>T(y.a,9),Condition:()=>y.a.sourceFileLvl(9)>=1},"SF10.1":{...O["SF10.1"],Icon:"SF10.1",Visible:()=>T(y.a,10),Condition:()=>y.a.sourceFileLvl(10)>=1},"SF11.1":{...O["SF11.1"],Icon:"SF11.1",Visible:()=>T(y.a,11),Condition:()=>y.a.sourceFileLvl(11)>=1},"SF12.1":{...O["SF12.1"],Icon:"SF12.1",Visible:()=>T(y.a,12),Condition:()=>y.a.sourceFileLvl(12)>=1},MONEY_1Q:{...O.MONEY_1Q,Icon:"$1Q",Condition:()=>y.a.money>=1e18},MONEY_M1B:{...O.MONEY_M1B,Icon:"-1b",Secret:!0,Condition:()=>y.a.money<=-1e9},INSTALL_1:{...O.INSTALL_1,Icon:"install",Condition:()=>y.a.augmentations.length>=1},INSTALL_100:{...O.INSTALL_100,Icon:"install_100",Condition:()=>y.a.augmentations.length>=100},QUEUE_40:{...O.QUEUE_40,Icon:"queue40",Condition:()=>y.a.queuedAugmentations.length>=40},HACKING_100000:{...O.HACKING_100000,Icon:"hack100000",Condition:()=>y.a.hacking>=1e5},COMBAT_3000:{...O.COMBAT_3000,Icon:"combat3000",Condition:()=>y.a.strength>=3e3&&y.a.defense>=3e3&&y.a.dexterity>=3e3&&y.a.agility>=3e3},NEUROFLUX_255:{...O.NEUROFLUX_255,Icon:"nf255",Condition:()=>y.a.augmentations.some(t=>t.name===a.a.NeuroFluxGovernor&&t.level>=255)},NS2:{...O.NS2,Icon:"ns2",Condition:()=>y.a.getHomeComputer().scripts.some(t=>t.filename.endsWith(".js")||t.filename.endsWith(".ns"))},FROZE:{...O.FROZE,Icon:"forze",Condition:()=>location.href.includes("noScripts")},RUNNING_SCRIPTS_1000:{...O.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:{...O.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:{...O.MAX_RAM,Icon:"maxram",Condition:()=>y.a.getHomeComputer().maxRam===o.a.HomeComputerMaxRam},MAX_CORES:{...O.MAX_CORES,Icon:"maxcores",Condition:()=>8===y.a.getHomeComputer().cpuCores},SCRIPTS_30:{...O.SCRIPTS_30,Icon:"folders",Condition:()=>y.a.getHomeComputer().scripts.length>=30},KARMA_1000000:{...O.KARMA_1000000,Icon:"karma",Secret:!0,Condition:()=>y.a.karma<=-1e6},STOCK_1q:{...O.STOCK_1q,Icon:"$1Q",Condition:()=>y.a.moneySourceB.stock>=1e15},DISCOUNT:{...O.DISCOUNT,Icon:"discount",Condition:()=>{const t=Object(E.d)("powerhouse-fitness");return t instanceof k.a&&t.backdoorInstalled}},SCRIPT_32GB:{...O.SCRIPT_32GB,Icon:"bigcost",Condition:()=>y.a.getHomeComputer().scripts.some(t=>t.ramUsage>=32)},FIRST_HACKNET_NODE:{...O.FIRST_HACKNET_NODE,Icon:"node",Condition:()=>!Object(h.g)(y.a)&&y.a.hacknetNodes.length>0},"30_HACKNET_NODE":{...O["30_HACKNET_NODE"],Icon:"hacknet-all",Condition:()=>!Object(h.g)(y.a)&&y.a.hacknetNodes.length>=30},MAX_HACKNET_NODE:{...O.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:{...O.HACKNET_NODE_10M,Icon:"hacknet-10m",Condition:()=>!Object(h.g)(y.a)&&y.a.moneySourceB.hacknet>=1e7},REPUTATION_10M:{...O.REPUTATION_10M,Icon:"reputation",Condition:()=>Object.values(c.a).some(t=>t.playerReputation>=1e7)},DONATION:{...O.DONATION,Icon:"donation",Condition:()=>Object.values(c.a).some(t=>t.favor>=150)},TRAVEL:{...O.TRAVEL,Icon:"TRAVEL",Condition:()=>y.a.city!==g.a.Sector12},WORKOUT:{...O.WORKOUT,Icon:"WORKOUT",Condition:()=>[L.a.GymStrength,L.a.GymDefense,L.a.GymDexterity,L.a.GymAgility].includes(y.a.className)},TOR:{...O.TOR,Icon:"TOR",Condition:()=>y.a.hasTorRouter()},HOSPITALIZED:{...O.HOSPITALIZED,Icon:"OUCH",Condition:()=>0!==y.a.moneySourceB.hospitalization},GANG:{...O.GANG,Icon:"GANG",Visible:()=>T(y.a,2),Condition:()=>null!==y.a.gang},FULL_GANG:{...O.FULL_GANG,Icon:"GANGMAX",Visible:()=>T(y.a,2),Condition:()=>null!==y.a.gang&&y.a.gang.members.length===u.a.MaximumGangMembers},GANG_TERRITORY:{...O.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:{...O.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:{...O.CORPORATION,Icon:"CORP",Visible:()=>T(y.a,3),Condition:()=>null!==y.a.corporation},CORPORATION_BRIBE:{...O.CORPORATION_BRIBE,Icon:"CORPLOBBY",Visible:()=>T(y.a,3),Condition:()=>null!==y.a.corporation&&1===y.a.corporation.unlockUpgrades[6]},CORPORATION_PROD_1000:{...O.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:{...O.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:{...O.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:{...O.INTELLIGENCE_255,Icon:"INT255",Visible:()=>T(y.a,5),Condition:()=>y.a.intelligence>=255},BLADEBURNER_DIVISION:{...O.BLADEBURNER_DIVISION,Icon:"BLADE",Visible:()=>T(y.a,6),Condition:()=>null!==y.a.bladeburner},BLADEBURNER_OVERCLOCK:{...O.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:{...O.BLADEBURNER_UNSPENT_100000,Icon:"BLADE100K",Visible:()=>T(y.a,6),Condition:()=>null!==y.a.bladeburner&&y.a.bladeburner.skillPoints>=1e5},"4S":{...O["4S"],Icon:"4S",Condition:()=>y.a.has4SData},FIRST_HACKNET_SERVER:{...O.FIRST_HACKNET_SERVER,Icon:"HASHNET",Visible:()=>T(y.a,9),Condition:()=>Object(h.g)(y.a)&&y.a.hacknetNodes.length>0,AdditionalUnlock:[O.FIRST_HACKNET_NODE.ID]},ALL_HACKNET_SERVER:{...O.ALL_HACKNET_SERVER,Icon:"HASHNETALL",Visible:()=>T(y.a,9),Condition:()=>Object(h.g)(y.a)&&y.a.hacknetNodes.length===m.b.MaxServers,AdditionalUnlock:[O["30_HACKNET_NODE"].ID]},MAX_HACKNET_SERVER:{...O.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:[O.MAX_HACKNET_NODE.ID]},HACKNET_SERVER_1B:{...O.HACKNET_SERVER_1B,Icon:"HASHNETMONEY",Visible:()=>T(y.a,9),Condition:()=>Object(h.g)(y.a)&&y.a.moneySourceB.hacknet>=1e9,AdditionalUnlock:[O.HACKNET_NODE_10M.ID]},MAX_CACHE:{...O.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:{...O.SLEEVE_8,Icon:"SLEEVE8",Visible:()=>T(y.a,10),Condition:()=>8===y.a.sleeves.length&&3===y.a.sourceFileLvl(10)},INDECISIVE:{...O.INDECISIVE,Icon:"1H",Visible:()=>A(y.a),Condition:function(){let t=0;return setInterval(()=>{_.b.page()===w.a.BitVerse?t++:t=0},6e4),()=>t>60}()},FAST_BN:{...O.FAST_BN,Icon:"2DAYS",Visible:()=>A(y.a),Condition:()=>M()&&y.a.playtimeSinceLastBitnode<1728e5},CHALLENGE_BN1:{...O.CHALLENGE_BN1,Icon:"BN1+",Visible:()=>A(y.a),Condition:()=>1===y.a.bitNodeN&&M()&&y.a.getHomeComputer().maxRam<=128&&1===y.a.getHomeComputer().cpuCores},CHALLENGE_BN2:{...O.CHALLENGE_BN2,Icon:"BN2+",Visible:()=>T(y.a,2),Condition:()=>2===y.a.bitNodeN&&M()&&null===y.a.gang},CHALLENGE_BN3:{...O.CHALLENGE_BN3,Icon:"BN3+",Visible:()=>T(y.a,3),Condition:()=>3===y.a.bitNodeN&&M()&&null===y.a.corporation},CHALLENGE_BN6:{...O.CHALLENGE_BN6,Icon:"BN6+",Visible:()=>T(y.a,6),Condition:()=>6===y.a.bitNodeN&&M()&&null===y.a.bladeburner},CHALLENGE_BN7:{...O.CHALLENGE_BN7,Icon:"BN7+",Visible:()=>T(y.a,7),Condition:()=>7===y.a.bitNodeN&&M()&&null===y.a.bladeburner},CHALLENGE_BN8:{...O.CHALLENGE_BN8,Icon:"BN8+",Visible:()=>T(y.a,8),Condition:()=>8===y.a.bitNodeN&&M()&&!y.a.has4SData&&!y.a.has4SDataTixApi},CHALLENGE_BN9:{...O.CHALLENGE_BN9,Icon:"BN9+",Visible:()=>T(y.a,9),Condition:()=>9===y.a.bitNodeN&&M()&&0===y.a.moneySourceB.hacknet&&0===y.a.moneySourceB.hacknet_expenses},CHALLENGE_BN10:{...O.CHALLENGE_BN10,Icon:"BN10+",Visible:()=>T(y.a,10),Condition:()=>10===y.a.bitNodeN&&M()&&!y.a.sleeves.some(t=>t.augmentations.length>0||t.hacking_exp>0||t.strength_exp>0||t.defense_exp>0||t.agility_exp>0||t.dexterity_exp>0||t.charisma_exp>0)},CHALLENGE_BN12:{...O.CHALLENGE_BN12,Icon:"BN12+",Visible:()=>T(y.a,12),Condition:()=>y.a.sourceFileLvl(12)>=50},BYPASS:{...O.BYPASS,Icon:"SF-1",Secret:!0,Condition:()=>y.a.exploits.includes(l.a.Bypass)},PROTOTYPETAMPERING:{...O.PROTOTYPETAMPERING,Icon:"SF-1",Secret:!0,Condition:()=>y.a.exploits.includes(l.a.PrototypeTampering)},UNCLICKABLE:{...O.UNCLICKABLE,Icon:"SF-1",Secret:!0,Condition:()=>y.a.exploits.includes(l.a.Unclickable)},UNDOCUMENTEDFUNCTIONCALL:{...O.UNDOCUMENTEDFUNCTIONCALL,Icon:"SF-1",Secret:!0,Condition:()=>y.a.exploits.includes(l.a.UndocumentedFunctionCall)},TIMECOMPRESSION:{...O.TIMECOMPRESSION,Icon:"SF-1",Secret:!0,Condition:()=>y.a.exploits.includes(l.a.TimeCompression)},REALITYALTERATION:{...O.REALITYALTERATION,Icon:"SF-1",Secret:!0,Condition:()=>y.a.exploits.includes(l.a.RealityAlteration)},N00DLES:{...O.N00DLES,Icon:"SF-1",Secret:!0,Condition:()=>y.a.exploits.includes(l.a.N00dles)},EDITSAVEFILE:{...O.EDITSAVEFILE,Icon:"SF-1",Secret:!0,Condition:()=>y.a.exploits.includes(l.a.EditSaveFile)},UNACHIEVABLE:{...O.UNACHIEVABLE,Icon:"SF-1",Secret:!0,Condition:()=>!1},CHALLENGE_BN13:{...O.CHALLENGE_BN13,Icon:"BN13+",Visible:()=>T(y.a,13),Condition:()=>13===y.a.bitNodeN&&M()&&!y.a.augmentations.some(t=>t.name===a.a.StaneksGift1)},DEVMENU:{...O.DEVMENU,Icon:"SF-1",Secret:!0,Condition:()=>y.a.exploits.includes(l.a.YoureNotMeantToAccessThis)},RAINBOW:{...O.RAINBOW,Icon:"SF-1",Secret:!0,Condition:()=>y.a.exploits.includes(l.a.INeedARainbow)},TRUE_RECURSION:{...O.TRUE_RECURSION,Icon:"SF-1",Secret:!0,Condition:()=>y.a.exploits.includes(l.a.TrueRecursion)}};function N(){const t=y.a.achievements.map(t=>t.ID),e=Object.values(R).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";n.d(e,"b",(function(){return P})),n.d(e,"a",(function(){return I}));var a=n(0),r=n.n(a),i=n(126),o=n(121),s=n(144),l=n(5),c=n(128),f=n(1179),u=n(22),m=n(148),h=n(149),d=n(30),p=n(50),g=n(1),y=n(8),b=n(111),E=n(467),v=n.n(E),k=n(1183),_=n.n(k),w=n(6),S=n(29),x=n(393),C=n(18),L=n(21),O=n(19),M=n(34);function T(){const t=Object(i.a)(),e=S.b.Player(),n=P();if(0===e.intelligence)return r.a.createElement(r.a.Fragment,null);const a=e.calculateSkillProgress(e.intelligence_exp);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.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,!w.a.DisableOverviewProgressBars&&r.a.createElement(x.a,{progress:a,color:t.colors.int})))}function A(){const t=S.b.Player(),e=P(),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 R({tooltip:t,children:e,onClickFocus:n,header:a}){const i=P();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 N(){const t=S.b.Player(),e=S.b.Router();if(!t.isWorking||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);switch(t.workType){case M.d.CompanyPartTime:case M.d.Company:n=r.a.createElement(r.a.Fragment,null,t.jobs[t.companyName]," at ",r.a.createElement("strong",null,t.companyName)),a=r.a.createElement(r.a.Fragment,null,"Working at ",r.a.createElement("strong",null,t.companyName)),i=r.a.createElement(r.a.Fragment,null,"+",r.a.createElement(c.a,{reputation:t.workRepGained})," rep");break;case M.d.Faction:n=r.a.createElement(r.a.Fragment,null,t.factionWorkType," for ",r.a.createElement("strong",null,t.currentWorkFactionName)),a=r.a.createElement(r.a.Fragment,null,"Working for ",r.a.createElement("strong",null,t.currentWorkFactionName)),i=r.a.createElement(r.a.Fragment,null,"+",r.a.createElement(c.a,{reputation:t.workRepGained})," rep");break;case M.d.StudyClass:n=r.a.createElement(r.a.Fragment,null,t.workType),a=r.a.createElement(r.a.Fragment,null,"You are ",t.className),i=r.a.createElement(r.a.Fragment,null,Object(u.d)(t.timeWorked));break;case M.d.CreateProgram:n=r.a.createElement(r.a.Fragment,null,"Coding ",t.createProgramName),a=r.a.createElement(r.a.Fragment,null,"Creating a program"),i=r.a.createElement(r.a.Fragment,null,t.createProgramName," ",(t.timeWorkedCreateProgram/t.timeNeededToCompleteWork*100).toFixed(2),"%");break;case M.d.GraftAugmentation:n=r.a.createElement(r.a.Fragment,null,"Grafting ",t.graftAugmentationName),a=r.a.createElement(r.a.Fragment,null,"Grafting an Augmentation"),i=r.a.createElement(r.a.Fragment,null,r.a.createElement("strong",null,(t.timeWorkedGraftAugmentation/t.timeNeededToCompleteWork*100).toFixed(2),"%")," ","done")}return r.a.createElement(R,{tooltip:n,header:a,onClickFocus:()=>{t.startFocusing(),e.toWork()}},i)}const P=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 I({save:t,killScripts:e}){const[n,o]=Object(a.useState)(!1),s=S.b.Player(),c=Object(a.useState)(!1)[1];Object(a.useEffect)(()=>{const t=setInterval(()=>c(t=>!t),600);return()=>clearInterval(t)},[]);const u=P(),y=Object(i.a)(),E=s.calculateSkillProgress(s.hacking_exp,s.hacking_mult*C.a.HackingLevelMultiplier),k=s.calculateSkillProgress(s.strength_exp,s.strength_mult*C.a.StrengthLevelMultiplier),M=s.calculateSkillProgress(s.defense_exp,s.defense_mult*C.a.DefenseLevelMultiplier),R=s.calculateSkillProgress(s.dexterity_exp,s.dexterity_mult*C.a.DexterityLevelMultiplier),I=s.calculateSkillProgress(s.agility_exp,s.agility_mult*C.a.AgilityLevelMultiplier),F=s.calculateSkillProgress(s.charisma_exp,s.charisma_mult*C.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)," / ",l.a.formatHp(s.max_hp))),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.hacking)))),r.a.createElement(p.a,null,!w.a.DisableOverviewProgressBars&&r.a.createElement(x.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.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,!w.a.DisableOverviewProgressBars&&r.a.createElement(x.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.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,!w.a.DisableOverviewProgressBars&&r.a.createElement(x.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.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,!w.a.DisableOverviewProgressBars&&r.a.createElement(x.a,{progress:R,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.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,!w.a.DisableOverviewProgressBars&&r.a.createElement(x.a,{progress:I,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.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,!w.a.DisableOverviewProgressBars&&r.a.createElement(x.a,{progress:F,color:y.colors.cha})),r.a.createElement(T,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(N,null),r.a.createElement(A,null))),r.a.createElement(O.a,{sx:{display:"flex",borderTop:"1px solid "+w.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!==w.a.AutosaveInterval?"Save game":"Save game (auto-saves are disabled!)"},r.a.createElement(v.a,{color:0!==w.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(_.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})),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";function a(t,e){if(t.length!==e.length)return!1;for(let n=0;nObject(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,"a",(function(){return _}));var a=n(66),r=n(1366),i=n(230),o=n(18),s=n(86),l=n(67),c=n(238),f=n(95),u=n(10),m=n(185),h=n(26),d=n(188),p=n(15),g=n(9),y=n(28),b=n(59),E=n(5),v=n(22);function k(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class _ extends r.a{constructor(t=null){super(),k(this,"className",""),k(this,"crimeType",""),k(this,"currentTask",a.a.Idle),k(this,"currentTaskLocation",""),k(this,"currentTaskMaxTime",0),k(this,"currentTaskTime",0),k(this,"earningsForSleeves",Object(i.a)()),k(this,"earningsForPlayer",Object(i.a)()),k(this,"earningsForTask",Object(i.a)()),k(this,"factionWorkType",d.a.None),k(this,"gainRatesForTask",Object(i.a)()),k(this,"gymStatType",""),k(this,"bbAction",""),k(this,"bbContract",""),k(this,"logs",[]),k(this,"memory",1),k(this,"shock",1),k(this,"storedCycles",0),k(this,"sync",1),null!=t&&this.shockRecovery(t)}commitCrime(t,e){const n=s.a[e]||Object.values(s.a).find(t=>t.name===e);return!!n&&(this.currentTask!==a.a.Idle?this.finishTask(t):this.resetTaskStatus(t),this.gainRatesForTask.hack=n.hacking_exp*this.hacking_exp_mult*o.a.CrimeExpGain,this.gainRatesForTask.str=n.strength_exp*this.strength_exp_mult*o.a.CrimeExpGain,this.gainRatesForTask.def=n.defense_exp*this.defense_exp_mult*o.a.CrimeExpGain,this.gainRatesForTask.dex=n.dexterity_exp*this.dexterity_exp_mult*o.a.CrimeExpGain,this.gainRatesForTask.agi=n.agility_exp*this.agility_exp_mult*o.a.CrimeExpGain,this.gainRatesForTask.cha=n.charisma_exp*this.charisma_exp_mult*o.a.CrimeExpGain,this.gainRatesForTask.int=n.intelligence_exp,this.gainRatesForTask.money=n.money*this.crime_money_mult*o.a.CrimeMoney,this.currentTaskLocation=String(this.gainRatesForTask.money),this.crimeType=n.name,this.currentTaskMaxTime=n.time,this.currentTask=a.a.Crime,!0)}finishTask(t){let e=Object(i.a)();if(this.currentTask===a.a.Crime){if(this.currentTaskTime>=this.currentTaskMaxTime){const n=Object.values(s.a).find(t=>t.name===this.crimeType);if(!n)return console.error("Invalid data stored in sleeve.crimeType: "+this.crimeType),this.resetTaskStatus(t),e;if(Math.random()=this.currentTaskMaxTime){var n;if("Infiltrate synthoids"===this.bbAction)return a.infiltrateSynthoidCommunities(t),this.currentTaskTime=0,e;let r,i;"Take on contracts"===this.bbAction?(r="Contracts",i=this.bbContract):(r="General",i=this.bbAction);const o=a.getActionIdFromTypeAndName(r,i);if(null===o){const n=`Invalid action: type='${r}' name='${i}'`;return console.error(`Function: sleeves.finishTask; Message: '${n}'`),this.resetTaskStatus(t),e}const s=a.getActionObject(o);if((null!==(n=null==s?void 0:s.count)&&void 0!==n?n:0)>0){const n=a.completeAction(t,this,o,!1);if(n)return e=this.gainExperience(t,n),this.gainMoney(t,n),this.currentTaskTime=0,e}}}return this.resetTaskStatus(t),e}gainExperience(t,e,n=1,a=!1){if(a)return e.hack>0&&(this.hacking_exp+=e.hack),e.str>0&&(this.strength_exp+=e.str),e.def>0&&(this.defense_exp+=e.def),e.dex>0&&(this.dexterity_exp+=e.dex),e.agi>0&&(this.agility_exp+=e.agi),e.cha>0&&(this.charisma_exp+=e.cha),Object(i.a)();const r=this.shock/100*(this.sync/100)*n,o=e.hack*r,s=e.str*r,l=e.def*r,c=e.dex*r,f=e.agi*r,u=e.cha*r,m=e.int*r;return o>0&&(this.gainHackingExp(o),t.gainHackingExp(o),this.earningsForPlayer.hack+=o,this.earningsForTask.hack+=o),s>0&&(this.gainStrengthExp(s),t.gainStrengthExp(s),this.earningsForPlayer.str+=s,this.earningsForTask.str+=s),l>0&&(this.gainDefenseExp(l),t.gainDefenseExp(l),this.earningsForPlayer.def+=l,this.earningsForTask.def+=l),c>0&&(this.gainDexterityExp(c),t.gainDexterityExp(c),this.earningsForPlayer.dex+=c,this.earningsForTask.dex+=c),f>0&&(this.gainAgilityExp(f),t.gainAgilityExp(f),this.earningsForPlayer.agi+=f,this.earningsForTask.agi+=f),u>0&&(this.gainCharismaExp(u),t.gainCharismaExp(u),this.earningsForPlayer.cha+=u,this.earningsForTask.cha+=u),m>0&&(this.gainIntelligenceExp(m),t.gainIntelligenceExp(m)),this.earningsForSleeves.hack+=o*(this.sync/100),this.earningsForSleeves.str+=s*(this.sync/100),this.earningsForSleeves.def+=l*(this.sync/100),this.earningsForSleeves.dex+=c*(this.sync/100),this.earningsForSleeves.agi+=f*(this.sync/100),this.earningsForSleeves.cha+=u*(this.sync/100),{hack:o*(this.sync/100),str:s*(this.sync/100),def:l*(this.sync/100),dex:c*(this.sync/100),agi:f*(this.sync/100),cha:u*(this.sync/100),int:m*(this.sync/100),money:e.money}}gainMoney(t,e,n=1){const a=e.money*n;this.earningsForTask.money+=a,this.earningsForPlayer.money+=a,t.gainMoney(a,"sleeves")}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;e50&&this.logs.shift()}prestige(t){this.hacking_exp=0,this.strength_exp=0,this.defense_exp=0,this.dexterity_exp=0,this.agility_exp=0,this.charisma_exp=0,this.resetTaskStatus(t),this.earningsForSleeves=Object(i.a)(),this.earningsForPlayer=Object(i.a)(),this.shockRecovery(t),this.augmentations=[],this.resetMultipliers(),this.city=p.a.Sector12,this.shock=1,this.storedCycles=0,this.sync=Math.max(this.memory,1),this.logs=[]}process(t,e=1){const n=1e3/u.a.MilliPerCycle;if(this.storedCycles+=e,this.storedCyclesthis.currentTaskMaxTime&&(o=this.currentTaskMaxTime-this.currentTaskTime,r=Math.floor(o/u.a.MilliPerCycle),(o<0||r<0)&&(console.warn("Sleeve.process() calculated negative cycle usage"),o=0,r=0)),this.currentTaskTime+=o,this.shock=Math.min(100,this.shock+1e-4*r);let s=Object(i.a)();switch(this.currentTask){case a.a.Idle:break;case a.a.Class:case a.a.Gym:this.updateTaskGainRates(t),s=this.gainExperience(t,this.gainRatesForTask,r),this.gainMoney(t,this.gainRatesForTask,r);break;case a.a.Faction:{s=this.gainExperience(t,this.gainRatesForTask,r),this.gainMoney(t,this.gainRatesForTask,r);const e=h.a[this.currentTaskLocation];if(!(e instanceof m.a)){console.error("Invalid faction for Sleeve task: "+this.currentTaskLocation);break}t.gang&&e.name===t.gang.facName&&this.resetTaskStatus(t),e.playerReputation+=this.getRepGain(t)*r;break}case a.a.Company:{s=this.gainExperience(t,this.gainRatesForTask,r),this.gainMoney(t,this.gainRatesForTask,r);const e=l.a[this.currentTaskLocation];if(!(e instanceof c.a)){console.error("Invalid company for Sleeve task: "+this.currentTaskLocation);break}e.playerReputation+=this.getRepGain(t)*r;break}case a.a.Recovery:this.shock=Math.min(100,this.shock+2e-4*r),this.shock>=100&&this.resetTaskStatus(t);break;case a.a.Synchro:this.sync=Math.min(100,this.sync+2e-4*t.getIntelligenceBonus(.5)*r),this.sync>=100&&this.resetTaskStatus(t)}return 0!==this.currentTaskMaxTime&&this.currentTaskTime>=this.currentTaskMaxTime&&(this.currentTask===a.a.Crime||this.currentTask===a.a.Bladeburner?s=this.finishTask(t):this.finishTask(t)),this.updateStatLevels(),this.storedCycles-=r,s}resetTaskStatus(t){var e;"Support main sleeve"==this.bbAction&&(null===(e=t.bladeburner)||void 0===e||e.sleeveSupport(!1));if(this.currentTask==a.a.Class){const e=Object(i.a)();e.int=u.a.IntelligenceClassBaseExpGain*Math.round(this.currentTaskTime/1e3);const n=this.gainExperience(t,e);t.sleeves.filter(t=>t!=this).forEach(e=>e.gainExperience(t,n,1,!0))}this.earningsForTask=Object(i.a)(),this.gainRatesForTask=Object(i.a)(),this.currentTask=a.a.Idle,this.currentTaskTime=0,this.currentTaskMaxTime=0,this.factionWorkType=d.a.None,this.crimeType="",this.currentTaskLocation="",this.gymStatType="",this.className="",this.bbAction="",this.bbContract="------"}shockRecovery(t){return this.currentTask!==a.a.Idle?this.finishTask(t):this.resetTaskStatus(t),this.currentTask=a.a.Recovery,!0}synchronize(t){return this.currentTask!==a.a.Idle?this.finishTask(t):this.resetTaskStatus(t),this.currentTask=a.a.Synchro,!0}takeUniversityCourse(t,e,n){this.currentTask!==a.a.Idle?this.finishTask(t):this.resetTaskStatus(t);let r=1;switch(e.toLowerCase()){case g.a.AevumSummitUniversity.toLowerCase():if(this.city!==p.a.Aevum)return!1;this.currentTaskLocation=g.a.AevumSummitUniversity,r=4;break;case g.a.Sector12RothmanUniversity.toLowerCase():if(this.city!==p.a.Sector12)return!1;this.currentTaskLocation=g.a.Sector12RothmanUniversity,r=3;break;case g.a.VolhavenZBInstituteOfTechnology.toLowerCase():if(this.city!==p.a.Volhaven)return!1;this.currentTaskLocation=g.a.VolhavenZBInstituteOfTechnology,r=5;break;default:return!1}switch(n.toLowerCase()){case"study computer science":break;case"data structures":this.gainRatesForTask.money=u.a.ClassDataStructuresBaseCost*r*-1;break;case"networks":this.gainRatesForTask.money=u.a.ClassNetworksBaseCost*r*-1;break;case"algorithms":this.gainRatesForTask.money=u.a.ClassAlgorithmsBaseCost*r*-1;break;case"management":this.gainRatesForTask.money=u.a.ClassManagementBaseCost*r*-1;break;case"leadership":this.gainRatesForTask.money=u.a.ClassLeadershipBaseCost*r*-1;break;default:return!1}return this.className=n,this.currentTask=a.a.Class,!0}travel(t,e){return t.loseMoney(u.a.TravelCost,"sleeves"),this.city=e,!0}tryBuyAugmentation(t,e){return!!t.canAfford(e.baseCost)&&(!this.augmentations.some(t=>t.name===e.name)&&(t.loseMoney(e.baseCost,"sleeves"),this.installAugmentation(e),!0))}updateTaskGainRates(t){if(this.currentTask!==a.a.Class)if(this.currentTask!==a.a.Gym)console.warn("Sleeve.updateTaskGainRates() called for unexpected task type "+this.currentTask);else{let e=1;switch(this.currentTaskLocation.toLowerCase()){case g.a.AevumCrushFitnessGym.toLowerCase():e=2;break;case g.a.AevumSnapFitnessGym.toLowerCase():e=5;break;case g.a.Sector12IronGym.toLowerCase():e=1;break;case g.a.Sector12PowerhouseGym.toLowerCase():e=10;break;case g.a.VolhavenMilleniumFitnessGym.toLowerCase():e=4;break;default:return}const n=1,a=t.hashManager.getTrainingMult()*e,r=this.gymStatType.toLowerCase();r.includes("str")?this.gainRatesForTask.str=n*a*this.strength_exp_mult:r.includes("def")?this.gainRatesForTask.def=n*a*this.defense_exp_mult:r.includes("dex")?this.gainRatesForTask.dex=n*a*this.dexterity_exp_mult:r.includes("agi")&&(this.gainRatesForTask.agi=n*a*this.agility_exp_mult)}else{let e=1;switch(this.currentTaskLocation.toLowerCase()){case g.a.AevumSummitUniversity.toLowerCase():e=3;break;case g.a.Sector12RothmanUniversity.toLowerCase():e=2;break;case g.a.VolhavenZBInstituteOfTechnology.toLowerCase():e=4;break;default:return}const n=e*t.hashManager.getStudyMult();switch(this.className.toLowerCase()){case"study computer science":this.gainRatesForTask.hack=u.a.ClassStudyComputerScienceBaseExp*n*this.hacking_exp_mult;break;case"data structures":this.gainRatesForTask.hack=u.a.ClassDataStructuresBaseExp*n*this.hacking_exp_mult;break;case"networks":this.gainRatesForTask.hack=u.a.ClassNetworksBaseExp*n*this.hacking_exp_mult;break;case"algorithms":this.gainRatesForTask.hack=u.a.ClassAlgorithmsBaseExp*n*this.hacking_exp_mult;break;case"management":this.gainRatesForTask.cha=u.a.ClassManagementBaseExp*n*this.charisma_exp_mult;break;case"leadership":this.gainRatesForTask.cha=u.a.ClassLeadershipBaseExp*n*this.charisma_exp_mult}}}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(!(l.a[e]instanceof c.a)||null==t.jobs[e])return!1;this.currentTask!==a.a.Idle?this.finishTask(t):this.resetTaskStatus(t);const n=l.a[e],r=f.a[t.jobs[e]];return null!=n&&(null!=r&&(this.gainRatesForTask.money=r.baseSalary*n.salaryMultiplier*this.work_money_mult*o.a.CompanyWorkMoney,this.gainRatesForTask.hack=r.hackingExpGain*n.expMultiplier*this.hacking_exp_mult*o.a.CompanyWorkExpGain,this.gainRatesForTask.str=r.strengthExpGain*n.expMultiplier*this.strength_exp_mult*o.a.CompanyWorkExpGain,this.gainRatesForTask.def=r.defenseExpGain*n.expMultiplier*this.defense_exp_mult*o.a.CompanyWorkExpGain,this.gainRatesForTask.dex=r.dexterityExpGain*n.expMultiplier*this.dexterity_exp_mult*o.a.CompanyWorkExpGain,this.gainRatesForTask.agi=r.agilityExpGain*n.expMultiplier*this.agility_exp_mult*o.a.CompanyWorkExpGain,this.gainRatesForTask.cha=r.charismaExpGain*n.expMultiplier*this.charisma_exp_mult*o.a.CompanyWorkExpGain,this.currentTaskLocation=e,this.currentTask=a.a.Company,!0))}workForFaction(t,e,n){const r=h.a[e];if(!(""!==e&&r&&r instanceof m.a&&t.factions.includes(e)))return!1;this.currentTask!==a.a.Idle?this.finishTask(t):this.resetTaskStatus(t);const i=r.getInfo(),s=n.toLowerCase();if(s.includes("hack")){if(!i.offerHackingWork)return!1;this.factionWorkType=d.a.Hacking,this.gainRatesForTask.hack=.15*this.hacking_exp_mult*o.a.FactionWorkExpGain}else if(s.includes("field")){if(!i.offerFieldWork)return!1;this.factionWorkType=d.a.Field,this.gainRatesForTask.hack=.1*this.hacking_exp_mult*o.a.FactionWorkExpGain,this.gainRatesForTask.str=.1*this.strength_exp_mult*o.a.FactionWorkExpGain,this.gainRatesForTask.def=.1*this.defense_exp_mult*o.a.FactionWorkExpGain,this.gainRatesForTask.dex=.1*this.dexterity_exp_mult*o.a.FactionWorkExpGain,this.gainRatesForTask.agi=.1*this.agility_exp_mult*o.a.FactionWorkExpGain,this.gainRatesForTask.cha=.1*this.charisma_exp_mult*o.a.FactionWorkExpGain}else{if(!s.includes("security"))return!1;if(!i.offerSecurityWork)return!1;this.factionWorkType=d.a.Security,this.gainRatesForTask.hack=.1*this.hacking_exp_mult*o.a.FactionWorkExpGain,this.gainRatesForTask.str=.15*this.strength_exp_mult*o.a.FactionWorkExpGain,this.gainRatesForTask.def=.15*this.defense_exp_mult*o.a.FactionWorkExpGain,this.gainRatesForTask.dex=.15*this.dexterity_exp_mult*o.a.FactionWorkExpGain,this.gainRatesForTask.agi=.15*this.agility_exp_mult*o.a.FactionWorkExpGain}return this.currentTaskLocation=e,this.currentTask=a.a.Faction,!0}workoutAtGym(t,e,n){this.currentTask!==a.a.Idle?this.finishTask(t):this.resetTaskStatus(t);let r=1;switch(e.toLowerCase()){case g.a.AevumCrushFitnessGym.toLowerCase():if(this.city!=p.a.Aevum)return!1;this.currentTaskLocation=g.a.AevumCrushFitnessGym,r=3;break;case g.a.AevumSnapFitnessGym.toLowerCase():if(this.city!=p.a.Aevum)return!1;this.currentTaskLocation=g.a.AevumSnapFitnessGym,r=10;break;case g.a.Sector12IronGym.toLowerCase():if(this.city!=p.a.Sector12)return!1;this.currentTaskLocation=g.a.Sector12IronGym,r=1;break;case g.a.Sector12PowerhouseGym.toLowerCase():if(this.city!=p.a.Sector12)return!1;this.currentTaskLocation=g.a.Sector12PowerhouseGym,r=20;break;case g.a.VolhavenMilleniumFitnessGym.toLowerCase():if(this.city!=p.a.Volhaven)return!1;this.currentTaskLocation=g.a.VolhavenMilleniumFitnessGym,r=7;break;default:return!1}const i=n.toLowerCase();return this.gainRatesForTask.money=u.a.ClassGymBaseCost*r*-1,!!(i.includes("str")||i.includes("def")||i.includes("dex")||i.includes("agi"))&&(this.gymStatType=n,this.currentTask=a.a.Gym,!0)}bladeburner(t,e,n){var r,i,o;this.currentTask!==a.a.Idle?this.finishTask(t):this.resetTaskStatus(t),this.gainRatesForTask.hack=0,this.gainRatesForTask.str=0,this.gainRatesForTask.def=0,this.gainRatesForTask.dex=0,this.gainRatesForTask.agi=0,this.gainRatesForTask.cha=0,this.gainRatesForTask.money=0,this.currentTaskLocation="";let s=0;switch(this.bbContract="------",e){case"Field analysis":s=this.getBladeburnerActionTime(t,"General",e),this.gainRatesForTask.hack=20*this.hacking_exp_mult,this.gainRatesForTask.cha=20*this.charisma_exp_mult;break;case"Recruitment":s=this.getBladeburnerActionTime(t,"General",e),this.gainRatesForTask.cha=2*b.a.BaseStatGain*(null!==(r=null===(i=t.bladeburner)||void 0===i?void 0:i.getRecruitmentTime(this))&&void 0!==r?r:0)*1e3,this.currentTaskLocation=`(Success Rate: ${E.a.formatPercentage(this.recruitmentSuccessChance(t))})`;break;case"Diplomacy":s=this.getBladeburnerActionTime(t,"General",e);break;case"Infiltrate synthoids":s=6e4,this.currentTaskLocation="This will generate additional contracts and operations";break;case"Support main sleeve":null===(o=t.bladeburner)||void 0===o||o.sleeveSupport(!0),s=0;break;case"Take on contracts":s=this.getBladeburnerActionTime(t,"Contracts",n),this.contractGainRates(t,"Contracts",n),this.currentTaskLocation=this.contractSuccessChance(t,"Contracts",n),this.bbContract=Object(v.a)(n.toLowerCase())}return this.bbAction=Object(v.b)(e.toLowerCase()),this.currentTaskMaxTime=s,this.currentTask=a.a.Bladeburner,!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%":`${E.a.formatPercentage(r[0])} - ${E.a.formatPercentage(r[1])}`}contractGainRates(t,e,n){const a=t.bladeburner;if(null===a){const t="bladeburner is null";return void console.error(`Function: sleeves.contractGainRates; Message: '${t}'`)}const r=a.getActionIdFromTypeAndName(e,n);if(null===r){const a=`Invalid action: type='${e}' name='${n}'`;return console.error(`Function: sleeves.contractGainRates; Message: '${a}'`),void this.resetTaskStatus(t)}const i=a.getActionObject(r);if(null===i){const a=`Invalid action: type='${e}' name='${n}'`;return console.error(`Function: sleeves.contractGainRates; Message: '${a}'`),void this.resetTaskStatus(t)}const o=a.getActionStats(i,!0);this.gainRatesForTask.hack=o.hack,this.gainRatesForTask.str=o.str,this.gainRatesForTask.def=o.def,this.gainRatesForTask.dex=o.dex,this.gainRatesForTask.agi=o.agi,this.gainRatesForTask.cha=o.cha;const s=Math.pow(i.rewardFac,i.level-1);this.gainRatesForTask.money=b.a.ContractBaseMoneyGain*s*a.skillMultipliers.money}getBladeburnerActionTime(t,e,n){const a=t.bladeburner;if(null===a){const t="bladeburner is null";return console.error(`Function: sleeves.getBladeburnerActionTime; Message: '${t}'`),-1}const r=a.getActionTimeNetscriptFn(this,e,n);if("string"==typeof r){const t=`Invalid action: type='${e}' name='${n}'`;return console.error(`Function: sleeves.getBladeburnerActionTime; Message: '${t}'`),-1}return r}takeDamage(t){return"number"!=typeof t?(console.warn("Player.takeDamage() called without a numeric argument: "+t),!1):(this.hp-=t,this.hp<=0&&(this.shock+=.5,this.hp=this.max_hp,!0))}whoAmI(){return"Sleeve"}toJSON(){return Object(y.b)("Sleeve",this)}static fromJSON(t){return Object(y.a)(_,t.data)}}y.c.constructors.Sleeve=_},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",t[t.URLImportError=-3]="URLImportError"}(a||(a={}))},function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i}));var a=n(125);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(245),r=n(153),i=n(117),o=n(75),s=n(5),l=n(20),c=n(14),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(125),o=n(38),s=n(1),l=n(19),c=n(766);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)?(console.log("Duplicate message"),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(544);const r=()=>`${Object(a.a)(99)}.${Object(a.a)(9)}.${Object(a.a)(9)}.${Object(a.a)(9)}`},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(){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(290),r=n(12),i=n(90),o=n(65),s=n(2),l=n(25),c=n(24),f=n(88),u=n(6),m=n(14),h=n(4),d=n(46);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.hacking>=t.requiredHackingSkill?p(k,0===s.a.sourceFiles.length):y(b)||p(b)}else if(!y(t)&&s.a.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.hacking>=40?p(e):!y(m)&&s.a.hacking>=50?p(m):!y(n)&&s.a.hacking>=175?p(n):!y(h)&&s.a.hacking>=200?p(h):!y(a)&&s.a.hacking>=350?p(a):!y(u)&&s.a.hacking>=490?p(u):!y(g)&&s.a.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";function a(t){const e=25e3*(Math.pow(1.02,t)-1);return Math.round(1e4*e)/1e4}function r(t){const e=Math.log(t/25e3+1)/Math.log(1.02);return Math.round(1e4*e)/1e4}n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"b",(function(){return f})),n.d(e,"c",(function(){return u})),n.d(e,"a",(function(){return m}));var a=n(116),r=n(26),i=n(2),o=n(24),s=n(88),l=n(46),c=n(33);function f(){const t=h(),e=d(),n=p(),r=g(n,e),i=new a.a(r,t,e);n.addContract(i)}function u(){const t=h(),e=d(),n=i.a.getHomeComputer(),r=g(n,e),o=new a.a(r,t,e);n.addContract(o)}function m(t){let e;const n=Object.keys(a.d);e=null!=t.problemType&&n.includes(t.problemType)?t.problemType:h();const r=d();let i,s;null!=t.server?(i=Object(o.d)(t.server),null==i&&(i=p())):i=p(),s=null!=t.fn?t.fn:g(i,r);const l=new a.a(s,e,r);i.addContract(l)}function h(){const t=Object.keys(a.d);return t[Object(c.a)(0,t.length-1)]}function d(){const t={name:"",type:Object(c.a)(0,a.c.Money)};t.type=function(t){let e=t;const n=i.a.factions.filter(t=>{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(26);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 l}));var a=n(0),r=n(1),i=n(8),o=n(45),s=n(19);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(59),r=n(460),i=n(28);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(35),r=n(12),i=n(2),o=n(65),s=n(314),l=n(0),c=n.n(l),f=n(4),u=n(10);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_mult:1.08,defense_mult:1.08,agility_mult:1.08,dexterity_mult: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_mult: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_mult: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_mult: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_mult:1.5,strength_mult: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_mult:1.3,defense_mult: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_mult:1.1,defense_mult: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_mult:1.14,defense_mult: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_mult:1.18,defense_mult: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_mult:1.2,defense_mult: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_mult: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_mult:1.05,dexterity_mult: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_mult:1.7,defense_mult: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_mult:1.15,defense_mult:1.15,agility_mult:1.15,dexterity_mult: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_mult:1.6,defense_mult:1.6,agility_mult:1.6,dexterity_mult: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_mult: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_mult: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_mult: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_mult:1.15,charisma_exp_mult: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_mult:1.6,charisma_exp_mult: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_mult: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_mult:1.03,hacking_money_mult:1.15,hacking_mult: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_mult:1.02,hacking_chance_mult:1.05,hacking_exp_mult: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_mult:1.03,hacking_exp_mult:1.1,hacking_mult: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_mult: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_mult: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_mult: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_mult: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_mult:1.03,hacking_money_mult:1.1,hacking_chance_mult:1.03,hacking_exp_mult:1.07,hacking_mult: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_mult:1.05,hacking_money_mult:1.3,hacking_chance_mult:1.05,hacking_exp_mult:1.15,hacking_mult: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_mult:1.05,hacking_money_mult:1.4,hacking_chance_mult:1.1,hacking_exp_mult:1.25,hacking_mult: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_mult: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_mult:1.4,hacking_chance_mult: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_mult:1.02,hacking_chance_mult:1.1,hacking_exp_mult: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_mult:1.1,hacking_exp_mult:1.15,hacking_money_mult: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_mult:1.01,hacking_mult: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_mult:1.02,hacking_chance_mult:1.05,hacking_mult: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_mult:1.02,hacking_money_mult:1.15,hacking_mult: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_mult:1.02,hacking_money_mult:1.2,hacking_grow_mult: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_mult:1.3,hacking_money_mult:1.25,hacking_grow_mult: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_mult:1.15,hacking_exp_mult:1.1,hacking_speed_mult: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_mult: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_mult:1.1,charisma_mult: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_mult:1.05,strength_exp_mult:1.05,defense_exp_mult:1.05,dexterity_exp_mult:1.05,agility_exp_mult:1.05,charisma_exp_mult:1.05,company_rep_mult:1.1,work_money_mult: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_mult:1.3,hacking_mult: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_mult:1.75,hacking_mult: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_mult:2,hacking_mult:1.1,hacking_speed_mult: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_mult:1.1,faction_rep_mult: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_mult:1.2,faction_rep_mult: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_mult:1.15,faction_rep_mult: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_mult:1.15,hacknet_node_purchase_cost_mult:.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_mult:1.1,hacknet_node_level_cost_mult:.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_mult:1.1,hacknet_node_purchase_cost_mult:.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_mult: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_mult: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_mult:1.1,strength_exp_mult:1.1,defense_exp_mult:1.1,dexterity_exp_mult:1.1,agility_exp_mult:1.1,charisma_exp_mult: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_mult:1.15,strength_exp_mult:1.15,defense_exp_mult:1.15,dexterity_exp_mult:1.15,agility_exp_mult:1.15,charisma_exp_mult: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_mult:1.2,strength_exp_mult:1.2,defense_exp_mult:1.2,dexterity_exp_mult:1.2,agility_exp_mult:1.2,charisma_exp_mult: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_mult:1.4,hacking_speed_mult:1.03,hacking_money_mult: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_mult:1.05,crime_money_mult: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_mult:1.1,defense_mult:1.1,crime_money_mult: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_mult:1.1,dexterity_exp_mult:1.15,crime_money_mult: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_mult:1.05,strength_mult:1.05,defense_mult:1.05,dexterity_mult:1.05,agility_mult:1.05,charisma_mult:1.05,hacking_exp_mult:1.1,strength_exp_mult:1.1,defense_exp_mult:1.1,dexterity_exp_mult:1.1,agility_exp_mult:1.1,charisma_exp_mult: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_mult:1.75,hacking_speed_mult:2,hacking_chance_mult:2.5,hacking_money_mult: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_mult:1.75,defense_mult:1.75,dexterity_mult:1.75,agility_mult:1.75,hacking_mult: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_mult: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_mult:1.35,defense_mult:1.35,dexterity_mult:1.35,agility_mult:1.35,strength_exp_mult:1.35,defense_exp_mult:1.35,dexterity_exp_mult:1.35,agility_exp_mult: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_mult:1.5,charisma_exp_mult:1.5,company_rep_mult:1.25,faction_rep_mult: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_mult:1.55,defense_mult: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_mult:1.2,strength_mult:1.2,defense_mult:1.2,dexterity_mult:1.2,agility_mult:1.2,charisma_mult:1.2,hacking_exp_mult:1.15,strength_exp_mult:1.15,defense_exp_mult:1.15,dexterity_exp_mult:1.15,agility_exp_mult:1.15,charisma_exp_mult: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_mult: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_mult:1.2,strength_mult:1.2,defense_mult:1.2,dexterity_mult:1.2,agility_mult:1.2,charisma_mult: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_mult:1.2,hacking_exp_mult: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_mult:1.4,defense_mult:1.4,agility_mult: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_mult:1.15,hacking_exp_mult:1.2,hacking_chance_mult:1.1,hacking_speed_mult: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_mult:1.15,dexterity_mult:1.15,hacking_mult:1.1,hacking_speed_mult:1.02,hacking_money_mult: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_mult:1.08,hacking_exp_mult: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_mult: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_mult:1.2,defense_exp_mult:1.2,dexterity_exp_mult:1.2,agility_exp_mult: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_mult:1.0777,charisma_exp_mult:1.0777,work_money_mult:1.777,faction_rep_mult:1.0777,company_rep_mult:1.0777,crime_success_mult:1.0777,crime_money_mult: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_mult:1.25,crime_money_mult:1.1,dexterity_mult: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_mult: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_mult:1.4,defense_mult:1.4,crime_success_mult:1.1,crime_money_mult: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_mult:1.85,dexterity_mult: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_mult:1.15,defense_mult:1.15,crime_success_mult:1.1,crime_money_mult: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_mult:1.3,dexterity_mult: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_mult:1.1,company_rep_mult:1.15,faction_rep_mult: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_mult:1.03,dexterity_mult: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_mult:1.03,bladeburner_analysis_mult:1.05,bladeburner_stamina_gain_mult: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_mult:1.05,strength_mult:1.05,dexterity_mult:1.05,bladeburner_success_chance_mult: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_mult: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_mult: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_mult:1.07,defense_mult:1.07,dexterity_mult:1.07,agility_mult:1.07,bladeburner_stamina_gain_mult: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_mult:1.1,bladeburner_analysis_mult:1.1,bladeburner_success_chance_mult: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_mult:1.1,dexterity_exp_mult:1.1,bladeburner_analysis_mult:1.15,bladeburner_success_chance_mult: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_mult:1.05,defense_exp_mult:1.05,dexterity_exp_mult:1.05,agility_exp_mult:1.05,bladeburner_max_stamina_mult: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_mult:1.05,bladeburner_max_stamina_mult:1.05,bladeburner_stamina_gain_mult: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_mult:1.04,defense_mult:1.04,dexterity_mult:1.04,agility_mult:1.04,bladeburner_stamina_gain_mult:1.02,bladeburner_success_chance_mult: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_mult:1.05,bladeburner_stamina_gain_mult:1.02,bladeburner_max_stamina_mult: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_mult:1.05,bladeburner_success_chance_mult: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_mult: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_mult: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_mult:1.15,bladeburner_success_chance_mult: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_mult:.9,hacking_speed_mult:.9,hacking_money_mult:.9,hacking_grow_mult:.9,hacking_mult:.9,strength_mult:.9,defense_mult:.9,dexterity_mult:.9,agility_mult:.9,charisma_mult:.9,hacking_exp_mult:.9,strength_exp_mult:.9,defense_exp_mult:.9,dexterity_exp_mult:.9,agility_exp_mult:.9,charisma_exp_mult:.9,company_rep_mult:.9,faction_rep_mult:.9,crime_money_mult:.9,crime_success_mult:.9,hacknet_node_money_mult:.9,hacknet_node_purchase_cost_mult:1.1,hacknet_node_ram_cost_mult:1.1,hacknet_node_core_cost_mult:1.1,hacknet_node_level_cost_mult:1.1,work_money_mult:.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_mult:.95/.9,hacking_speed_mult:.95/.9,hacking_money_mult:.95/.9,hacking_grow_mult:.95/.9,hacking_mult:.95/.9,strength_mult:.95/.9,defense_mult:.95/.9,dexterity_mult:.95/.9,agility_mult:.95/.9,charisma_mult:.95/.9,hacking_exp_mult:.95/.9,strength_exp_mult:.95/.9,defense_exp_mult:.95/.9,dexterity_exp_mult:.95/.9,agility_exp_mult:.95/.9,charisma_exp_mult:.95/.9,company_rep_mult:.95/.9,faction_rep_mult:.95/.9,crime_money_mult:.95/.9,crime_success_mult:.95/.9,hacknet_node_money_mult:.95/.9,hacknet_node_purchase_cost_mult:1.05/1.1,hacknet_node_ram_cost_mult:1.05/1.1,hacknet_node_core_cost_mult:1.05/1.1,hacknet_node_level_cost_mult:1.05/1.1,work_money_mult:.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_mult:1/.95,hacking_speed_mult:1/.95,hacking_money_mult:1/.95,hacking_grow_mult:1/.95,hacking_mult:1/.95,strength_mult:1/.95,defense_mult:1/.95,dexterity_mult:1/.95,agility_mult:1/.95,charisma_mult:1/.95,hacking_exp_mult:1/.95,strength_exp_mult:1/.95,defense_exp_mult:1/.95,dexterity_exp_mult:1/.95,agility_exp_mult:1/.95,charisma_exp_mult:1/.95,company_rep_mult:1/.95,faction_rep_mult:1/.95,crime_money_mult:1/.95,crime_success_mult:1/.95,hacknet_node_money_mult:1/.95,hacknet_node_purchase_cost_mult:1/1.05,hacknet_node_ram_cost_mult:1/1.05,hacknet_node_core_cost_mult:1/1.05,hacknet_node_level_cost_mult:1/1.05,work_money_mult: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_mult:1.01+t,hacking_speed_mult:1.01+t,hacking_money_mult:1.01+t,hacking_grow_mult:1.01+t,hacking_mult:1.01+t,strength_mult:1.01+t,defense_mult:1.01+t,dexterity_mult:1.01+t,agility_mult:1.01+t,charisma_mult:1.01+t,hacking_exp_mult:1.01+t,strength_exp_mult:1.01+t,defense_exp_mult:1.01+t,dexterity_exp_mult:1.01+t,agility_exp_mult:1.01+t,charisma_exp_mult:1.01+t,company_rep_mult:1.01+t,faction_rep_mult:1.01+t,crime_money_mult:1.01+t,crime_success_mult:1.01+t,hacknet_node_money_mult:1.01+t,hacknet_node_purchase_cost_mult:1/(1.01+t),hacknet_node_ram_cost_mult:1/(1.01+t),hacknet_node_core_cost_mult:1/(1.01+t),hacknet_node_level_cost_mult:1/(1.01+t),work_money_mult: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_mult:1.25,hacking_speed_mult:1.1,hacking_money_mult:1.25,hacking_grow_mult: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_mult:1.15,hacking_exp_mult:2},description:"Increases the player's hacking skill by 15%.
Increases the player's hacking experience gain rate by 100%."},{bonuses:{strength_mult:1.25,strength_exp_mult:2,defense_mult:1.25,defense_exp_mult:2,dexterity_mult:1.25,dexterity_exp_mult:2,agility_mult:1.25,agility_exp_mult: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_mult:1.5,charisma_exp_mult: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_mult:1.2,hacknet_node_purchase_cost_mult:.85,hacknet_node_ram_cost_mult:.85,hacknet_node_core_cost_mult:.85,hacknet_node_level_cost_mult:.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_mult:1.25,faction_rep_mult:1.15,work_money_mult: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_mult:2,crime_money_mult: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(4),r=n(9),i=n(64),o=n(88);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,"a",(function(){return i}));var a=n(10),r=n(31);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,"a",(function(){return l}));var a=n(6),r=n(84),i=n(28),o=n(375);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;tH4CK||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,"a",(function(){return o}));var a=n(241),r=n(28);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){const e=this.getUpgrade(t),n=this.upgrades[t];return null==e||null==n?(console.error("Invalid Upgrade Name given to HashManager.getUpgradeCost(): "+t),1/0):e.getCost(n)}prestige(){for(const t of Object.keys(a.a))this.upgrades[t]=0;this.hashes=0,this.updateCapacity(0)}refundUpgrade(t){const e=a.a[t];--this.upgrades[t];const n=this.upgrades[t];if(null==e||null==n||n<0)return void console.error("Invalid Upgrade Name given to HashManager.upgrade(): "+t);const r=e.getCost(n);this.hashes+=r}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){if(null==a.a[t])return console.error("Invalid Upgrade Name given to HashManager.upgrade(): "+t),!1;const e=this.getUpgradeCost(t);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)}this.calculateTotalEmployees(),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);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));const i=n.hasResearch("AutoBrew"),o=n.hasResearch("AutoPartyManager");let s=0;for(let e=0;en.pos===t?e+1:e,0);for(const r of this.employees){if(n==e)return!0;r.pos===a.a.Unassigned&&n<=e?(r.pos=t,n++):r.pos===t&&n>=e&&(r.pos=a.a.Unassigned,n--)}return n===e}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 upgrades 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";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(18),r=n(602),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(28);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";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i}));var a=n(10);function r(t){return t.money<0?0:Math.min(.1*t.money,(t.max_hp-t.hp)*a.a.HospitalCostPerHp)}function i(t,e){const n=t.hp;t.hp-=e;const a=r(t);return t.hp=n,a}},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(125),o=n(38),s=n(1),l=n(8),c=n(130),f=n(76),u=n(74),m=n(27);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;const[i,o]=Object(a.useState)("");return 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=>{o(t.target.value)},value:i,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===(n=t.options)||void 0===n?void 0:n.choices)||[])),r.a.createElement(l.a,{onClick:()=>e(i),disabled:""===i},"Confirm")))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(47),r=n(179),i=n(1052),o=n(546),s=n(28),l=n(33);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,"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=1,e=1){this.fin||(this.prog+=.01*t*e)}finishProduct(t,e){this.fin=!0;const n=t[a.a.Engineer]/t.total,i=t[a.a.Management]/t.total,o=t[a.a.RandD]/t.total,s=t[a.a.Operations]/t.total,c=t[a.a.Business]/t.total,f=(1.2*n+.9*i+1.3*o+1.5*s+c)*(1+Math.pow(this.designCost,.1)/100)*(1+Math.pow(e.sciResearch.qty,e.sciFac)/800);this.qlt=f*(.1*t[a.a.Engineer]+.05*t[a.a.Management]+.05*t[a.a.RandD]+.02*t[a.a.Operations]+.02*t[a.a.Business]),this.per=f*(.15*t[a.a.Engineer]+.02*t[a.a.Management]+.02*t[a.a.RandD]+.02*t[a.a.Operations]+.02*t[a.a.Business]),this.dur=f*(.05*t[a.a.Engineer]+.02*t[a.a.Management]+.08*t[a.a.RandD]+.05*t[a.a.Operations]+.05*t[a.a.Business]),this.rel=f*(.02*t[a.a.Engineer]+.08*t[a.a.Management]+.02*t[a.a.RandD]+.05*t[a.a.Operations]+.08*t[a.a.Business]),this.aes=f*(0*t[a.a.Engineer]+.08*t[a.a.Management]+.05*t[a.a.RandD]+.02*t[a.a.Operations]+.1*t[a.a.Business]),this.fea=f*(.08*t[a.a.Engineer]+.05*t[a.a.Management]+.02*t[a.a.RandD]+.05*t[a.a.Operations]+.05*t[a.a.Business]),this.calculateRating(e);const u=1+Math.pow(this.advCost,.1)/100,m=Math.max(c+i,1/t.total);this.mku=100/(u*Math.pow(this.qlt+.001,.65)*m),0!==this.mku&&isFinite(this.mku)||(this.mku=1),this.dmd=0===e.awareness?20:Math.min(100,u*(e.popularity/e.awareness*100)),this.cmp=Object(l.a)(0,70);for(const t of Object.keys(e.reqMats))if(e.reqMats.hasOwnProperty(t)){const n=e.reqMats[t];if(void 0===n)continue;this.reqMats[t]=n}this.siz=0;for(const t of Object.keys(e.reqMats)){const n=e.reqMats[t];void 0!==n&&(this.siz+=r.a[t]*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 y})),n.d(e,"a",(function(){return b}));var a=n(0),r=n.n(a),i=n(115),o=n(249),s=n(1),l=n(19),c=n(45),f=n(8),u=n(1777),m=n(1778),h=n(1779),d=n(29),p=n(6),g=n(65);const y=[];function b(){const t=d.b.Player(),e=d.b.Router(),n=Object(a.useState)(!1)[1];function b(){n(t=>!t)}const E=[...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)(()=>{E.forEach(t=>{y.includes(t.name)||y.push(t.name)})},[]),Object(a.useEffect)(()=>{const t=setInterval(b,200);return()=>clearInterval(t)},[]);const v=e=>Math.ceil(Math.max(e-(t.hacking+t.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}},E.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(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:r=>{r.isTrusted&&(t.startCreateProgramWork(n.name,a.time,a.level),t.startFocusing(),e.toWork())}},"Create program"),t.hasProgram(n.name)||0===v(a.level)||r.a.createElement(s.a,{color:p.a.theme.hack},r.a.createElement("b",null,"Unlocks in:")," ",v(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 S})),n.d(e,"a",(function(){return L}));var a=n(1780),r=n(1781),i=n(1782),o=n(1783),s=n(1477),l=n(691),c=n(692),f=n(21),u=n(45),m=n(19),h=n(8),d=n(1),p=n(126),g=n(249),y=n(0),b=n.n(y),E=n(6),v=n(5),k=n(4),_=n(105),w=n(26);const S=[],x=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"})))},C=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(_.d)(w.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(x,{faction:t.faction}),t.joined&&b.a.createElement(d.a,{variant:"body2",sx:{display:"flex"}},(n=t.faction,a=t.player,Object(_.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(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=>{S.includes(t)||S.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-child(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=>w.a.hasOwnProperty(e)?b.a.createElement(C,{key:e,faction:w.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=>w.a.hasOwnProperty(e)?b.a.createElement(C,{key:e,faction:w.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 i}));var a=n(1481),r=n(1791);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";n.d(e,"a",(function(){return f}));var a=n(0),r=n.n(a),i=n(2),o=n(459),s=n(612),l=n(371),c=n(14);function f(t,e,n,a){e?0===i.a.sourceFileLvl(5)&&5!==a&&(i.a.intelligence=0,i.a.intelligence_exp=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.intelligence&&(i.a.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.intelligence&&(i.a.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 w})),n.d(e,"a",(function(){return S})),n.d(e,"c",(function(){return x}));var a=n(0),r=n.n(a),i=n(19),o=n(1),s=n(150),l=n(356),c=n(21),f=n(8),u=n(45),m=n(76),h=n(6),d=n(342),p=n(109),g=n(539),y=n(633),b=n(635),E=n(650),v=n.n(E),k=n(1393),_=n.n(k);let w=!1;function S(){w=!0}function x({router:t,softReset:e,errorData:n,resetError:E}){var k,S;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(),w=!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(_.a,null),color:"info",sx:{px:2},href:null!==(S=n.issueUrl)&&void 0!==S?S:g.b,target:"_blank"},"Submit Issue to GitHub"))))}},,,function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return o}));var a=n(1022);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(1028),r=n(226),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),o(this,"running",!1),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;t=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.dividendPercentage>0&&a>0)if(isNaN(this.dividendPercentage)||this.dividendPercentage<0||this.dividendPercentage>100*s.a.DividendMaxPercentage)console.error("Invalid Corporation dividend percentage: "+this.dividendPercentage);else{const e=a-this.dividendPercentage/100*a;t.gainMoney(this.getDividends(),"corporation"),this.addFunds(e)}else this.addFunds(a);this.updateSharePrice()}this.state.nextState()}}getDividends(){const t=(this.revenue-this.expenses)*s.a.SecsPerMarketCycle,e=this.dividendPercentage/100*t/this.totalShares,n=this.numShares*e;let a=-.15;return 1===this.unlockUpgrades[5]&&(a+=.05),1===this.unlockUpgrades[6]&&(a+=.1),Math.pow(n,l.a.CorporationSoftcap+a)}determineValuation(){let t,e=this.avgProfit;return this.public?(this.dividendPercentage>0&&(e*=(100-this.dividendPercentage)/100),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(19),r=n(21),i=n(1),o=n(1796),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)=>{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(1),i=n(21),o=n(8),s=n(76);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(10),r=n(18),i=n(46),o=n(92),s=n(24),l=n(88);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 N})),n.d(e,"b",(function(){return P}));var a=n(4),r=n(15),i=n(79),o=n(119),s=n(12),l=n(152),c=n(210),f=n(67),u=n(51),m=n(65),h=n(185),d=n(26),p=n(105),g=n(56),y=n(199),b=n(2),E=n(90),v=n(527),k=n(64),_=n(24),w=n(137),S=n(88),x=n(103),C=n(84),L=n(14),O=n(101),M=n(411),T=n(412),A=n(10),R=n(178);function N(){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(_.i)(),Object(_.a)(e),Object(w.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(_.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!==C.a.action&&C.a.finishAction(E.b,b.a,!0),C.a.clear(),R.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(k.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.f)(),Object(x.h)()),Object(o.b)(s.a.TheRedPill)&&b.a.hasAugmentation(s.a.TheRedPill)){const t=Object(_.d)(S.a.WorldDaemon),e=Object(_.d)(S.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]),O.c.prestigeAugmentation(),Object(v.b)(),M.b.splice(0,M.b.length),T.b.splice(0,T.b.length)}function P(t){Object(l.d)(b.a),b.a.prestigeSourceFile(),Object(y.c)();const e=b.a.getHomeComputer();null!==C.a.action&&C.a.finishAction(E.b,b.a,!0),C.a.clear(),R.a.emit(),Object(_.i)(),Object(_.a)(e),Object(w.e)(b.a,e),Object(_.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!==C.a.action&&C.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(k.a.CorporationManagementHandbook),Object(L.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(L.a)("Visit VitaLife in New Tokyo if you'd like to purchase a new sleeve!"),13===b.a.bitNodeN&&Object(L.a)("Trouble is brewing in "+r.a.Chongqing),b.a.hasWseAccount?(Object(x.f)(),Object(x.h)()):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.hacknet_node_money_mult),t.updateHashCapacity(),Object(g.p)(b.a)}13===b.a.bitNodeN&&(b.a.money=A.a.TravelCost),O.c.prestigeSourceFile(),0===b.a.sourceFileLvl(5)||t||b.a.gainIntelligenceExp(300),Object(v.b)()}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(2),r=n(33),i=n(304),o=n(28),s=n(59);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.bladeburner_success_chance_mult,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,"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";n.d(e,"b",(function(){return l})),n.d(e,"a",(function(){return c}));var a=n(0),r=n.n(a),i=n(125),o=n(38);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(15),o=n(1),s=n(21),l=n(121),c=n(144);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(22),o=n(1157),s=n(1158),l=n(2);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.f)(100*e[0],1),"%"):r.a.createElement(r.a.Fragment,null,Object(i.f)(100*e[0],1),"% ~ ",Object(i.f)(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(38);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,"a",(function(){return o}));var a=n(0),r=n.n(a);function i(t,e,n){return t.substring(0,e)+n+t.substring(e+1)}function o(t){const[e,n]=Object(a.useState)(t.content);return Object(a.useEffect)(()=>{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,"a",(function(){return i}));var a=n(1417),r=n(14);function i(t){const e=a.a[t];if(null==e)return;const n=`${e.title}

${e.txt}`;Object(r.a)(n)}},,,,,,function(t,e,n){"use strict";n.d(e,"c",(function(){return u})),n.d(e,"d",(function(){return m})),n.d(e,"b",(function(){return h})),n.d(e,"a",(function(){return d}));var a=n(0),r=n.n(a),i=n(258),o=n(2),s=n(84),l=n(88),c=n(5),f=n(20);function u(){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 m(){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 h(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)h(e.program);else s.a.print("All available programs have been purchased already.")}},function(t,e,n){"use strict";function a(t,e){const n=t.hostname;return"requiredHackingSkill"in t?!1===t.hasAdminRights?{res:!1,msg:`Cannot ${e} ${n} server because you do not have root access`}:{res:!0}:{res:!1,msg:`Cannot ${e} ${n} server because it is a Hacknet Node`}}function r(t,e){const n=a(t,"hack");if(!n.res)return n;return t.requiredHackingSkill>e.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 i})),n.d(e,"b",(function(){return o}));var a=n(181);function r(t,e,n){const a=n-Math.pow(e,.9)/250-t.intelligence/1600;return a<0?0:a>3?3:a}function i(t,e){return r(t,t.strength+t.defense+t.dexterity+t.agility+t.charisma,e)}function o(t,e){return r(t,Object(a.b)(9e3*t.strength_exp_mult,t.strength_mult)+Object(a.b)(9e3*t.defense_exp_mult,t.defense_mult)+Object(a.b)(9e3*t.agility_exp_mult,t.agility_mult)+Object(a.b)(9e3*t.dexterity_exp_mult,t.dexterity_mult)+Object(a.b)(9e3*t.charisma_exp_mult,t.charisma_mult),e)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(115),r=n(10);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)),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 s}));var a=n(0),r=n.n(a),i=n(5),o=n(128);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,"b",(function(){return o})),n.d(e,"a",(function(){return s}));var a=n(27),r=n(160);function i(t){return"string"==typeof t&&(!isNaN(t)&&!isNaN(parseFloat(t)))}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="";const n=[];let r=0,o=0,s="";for(;o=1&&(s=t.charAt(o-1),"\\"===s&&(l=!0));const c=t.charAt(o);if(c===a.a.DOUBLE_QUOTE)if(l||s!==a.a.SPACE)""===e?e=a.a.DOUBLE_QUOTE:e===a.a.DOUBLE_QUOTE&&(e="");else{const e=t.indexOf(a.a.DOUBLE_QUOTE,o+1);if(-1!==e&&(e===t.length-1||t.charAt(e+1)===a.a.SPACE)){n.push(t.substr(o+1,e-o-1)),r=o=e===t.length-1?e+1:e+2;continue}}else if(c===a.a.QUOTE)if(l||s!==a.a.SPACE)""===e?e=a.a.QUOTE:e===a.a.QUOTE&&(e="");else{const e=t.indexOf(a.a.QUOTE,o+1);if(-1!==e&&(e===t.length-1||t.charAt(e+1)===a.a.SPACE)){n.push(t.substr(o+1,e-o-1)),r=o=e===t.length-1?e+1:e+2;continue}}else if(c===a.a.SPACE&&""===e){const e=t.substr(r,o-r);i(e)?n.push(parseFloat(e)):"true"===e?n.push(!0):"false"===e?n.push(!1):n.push(e),r=o+1}++o}if(r!==o){const e=t.substr(r,o-r);i(e)?n.push(parseFloat(e)):"true"===e?n.push(!0):"false"===e?n.push(!1):n.push(e)}return n}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(0),r=n.n(a),i=n(1383),o=n(1),s=n(8);function l(t){const[e,n]=Object(a.useState)(0),[l,c]=Object(a.useState)(!1);return r.a.createElement(r.a.Fragment,null,t.lines.slice(0,e).map((t,e)=>r.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(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"b",(function(){return checkInfiniteLoop})),__webpack_require__.d(__webpack_exports__,"a",(function(){return calculateRamUsage}));var acorn_walk__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(303),acorn__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(256),_RamCalculationErrorCodes__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(327),_Netscript_RamCostGenerator__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(226),_Terminal_DirectoryHelpers__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(83);const specialReferenceIF="__SPECIAL_referenceIf",specialReferenceFOR="__SPECIAL_referenceFor",specialReferenceWHILE="__SPECIAL_referenceWhile",memCheckGlobalKey=".__GLOBAL__";async function parseOnlyRamCalculate(player,otherScripts,code,workerScript){try{let dependencyMap={};const completedParses=new Set,parseQueue=[];function parseCode(t,e){const n=parseOnlyCalculateDeps(t,e);completedParses.add(e);for(let t=0;t0;){const nextModule=parseQueue.shift();if(void 0===nextModule)throw new Error("nextModule should not be undefined");let code;if(nextModule.startsWith("https://")||nextModule.startsWith("http://"))try{const module=await eval("import(nextModule)");code="";for(const t in module)"function"==typeof module[t]&&(code+=module[t].toString()+";\n")}catch(t){return console.error(`Error dynamically importing module from ${nextModule} for RAM calculations: ${t}`),{cost:_RamCalculationErrorCodes__WEBPACK_IMPORTED_MODULE_2__.a.URLImportError}}else{if(!Array.isArray(otherScripts))return console.warn("parseOnlyRamCalculate() not called with array of scripts"),{cost:_RamCalculationErrorCodes__WEBPACK_IMPORTED_MODULE_2__.a.ImportError};let t=null;const e=nextModule.startsWith("./")?nextModule.slice(2):nextModule;for(const n of otherScripts)if(Object(_Terminal_DirectoryHelpers__WEBPACK_IMPORTED_MODULE_4__.b)(n.filename,e)){t=n;break}if(null==t)return{cost:_RamCalculationErrorCodes__WEBPACK_IMPORTED_MODULE_2__.a.ImportError};code=t.code}parseCode(code,nextModule)}let ram=_Netscript_RamCostGenerator__WEBPACK_IMPORTED_MODULE_3__.a.ScriptBaseRamCost;const detailedCosts=[{type:"misc",name:"baseCost",cost:_Netscript_RamCostGenerator__WEBPACK_IMPORTED_MODULE_3__.a.ScriptBaseRamCost}],unresolvedRefs=Object.keys(dependencyMap).filter(t=>t.startsWith(initialModule)),resolvedRefs=new Set;for(;unresolvedRefs.length>0;){const t=unresolvedRefs.shift();if(void 0===t)throw new Error("ref should not be undefined");if("hacknet"!==t||resolvedRefs.has("hacknet")||(ram+=_Netscript_RamCostGenerator__WEBPACK_IMPORTED_MODULE_3__.a.ScriptHacknetNodesRamCost,detailedCosts.push({type:"ns",name:"hacknet",cost:_Netscript_RamCostGenerator__WEBPACK_IMPORTED_MODULE_3__.a.ScriptHacknetNodesRamCost})),"document"!==t||resolvedRefs.has("document")||(ram+=_Netscript_RamCostGenerator__WEBPACK_IMPORTED_MODULE_3__.a.ScriptDomRamCost,detailedCosts.push({type:"dom",name:"document",cost:_Netscript_RamCostGenerator__WEBPACK_IMPORTED_MODULE_3__.a.ScriptDomRamCost})),"window"!==t||resolvedRefs.has("window")||(ram+=_Netscript_RamCostGenerator__WEBPACK_IMPORTED_MODULE_3__.a.ScriptDomRamCost,detailedCosts.push({type:"dom",name:"window",cost:_Netscript_RamCostGenerator__WEBPACK_IMPORTED_MODULE_3__.a.ScriptDomRamCost})),"corporation"!==t||resolvedRefs.has("corporation")||(ram+=_Netscript_RamCostGenerator__WEBPACK_IMPORTED_MODULE_3__.a.ScriptCorporationRamCost,detailedCosts.push({type:"ns",name:"corporation",cost:_Netscript_RamCostGenerator__WEBPACK_IMPORTED_MODULE_3__.a.ScriptCorporationRamCost})),resolvedRefs.add(t),t.endsWith(".*")){const e=t.slice(0,t.length-2);for(const t of Object.keys(dependencyMap).filter(t=>t.startsWith(e)))for(const e of dependencyMap[t]||[])resolvedRefs.has(e)||unresolvedRefs.push(e)}else for(const e of dependencyMap[t]||[])resolvedRefs.has(e)||unresolvedRefs.push(e);try{function applyFuncRam(t){return"number"==typeof t?t:"function"==typeof t?t(player):0}if(workerScript.loadedFns[t])continue;let e;workerScript.loadedFns[t]=!0;let n="n/a";t in workerScript.env.vars.bladeburner?(e=workerScript.env.vars.bladeburner[t],n="bladeburner."+t):t in workerScript.env.vars.codingcontract?(e=workerScript.env.vars.codingcontract[t],n="codingcontract."+t):t in workerScript.env.vars.stanek?(e=workerScript.env.vars.stanek[t],n="stanek."+t):t in workerScript.env.vars.infiltration?(e=workerScript.env.vars.infiltration[t],n="infiltration."+t):t in workerScript.env.vars.gang?(e=workerScript.env.vars.gang[t],n="gang."+t):t in workerScript.env.vars.sleeve?(e=workerScript.env.vars.sleeve[t],n="sleeve."+t):t in workerScript.env.vars.stock?(e=workerScript.env.vars.stock[t],n="stock."+t):t in workerScript.env.vars.ui?(e=workerScript.env.vars.ui[t],n="ui."+t):t in workerScript.env.vars.grafting?(e=workerScript.env.vars.grafting[t],n="grafting."+t):t in workerScript.env.vars.singularity?(e=workerScript.env.vars.singularity[t],n="singularity."+t):(e=workerScript.env.vars[t],n=""+t);const a=applyFuncRam(e);ram+=a,detailedCosts.push({type:"fn",name:n,cost:a})}catch(t){continue}}return{cost:ram,entries:detailedCosts.filter(t=>t.cost>0)}}catch(t){return{cost:_RamCalculationErrorCodes__WEBPACK_IMPORTED_MODULE_2__.a.SyntaxError}}}function checkInfiniteLoop(t){const e=Object(acorn__WEBPACK_IMPORTED_MODULE_1__.a)(t,{sourceType:"module",ecmaVersion:"latest"});let n=-1;return acorn_walk__WEBPACK_IMPORTED_MODULE_0__.a(e,{},{WhileStatement:(e,a,r)=>{!function(t){return"Literal"===t.type&&"true"===t.raw}(e.test)||function(t){let e=!1;return acorn_walk__WEBPACK_IMPORTED_MODULE_0__.a(t,{},{AwaitExpression:()=>{e=!0}}),e}(e)?e.body&&r(e.body,a):n=(t.slice(0,e.start).match(/\n/g)||[]).length+1}}),n}function parseOnlyCalculateDeps(t,e){const n=Object(acorn__WEBPACK_IMPORTED_MODULE_1__.a)(t,{sourceType:"module",ecmaVersion:"latest"}),a=e+memCheckGlobalKey,r={};r[a]=new Set;const i={},o=[];function s(t,n){const a=r[t]||(r[t]=new Set),o=i[n];void 0!==o&&a.add(o),a.add(e+"."+n),a.add(n)}const l=Object.getOwnPropertyNames(Object.prototype);function c(){return{Identifier:(t,e)=>{l.includes(t.name)||s(e.key,t.name)},WhileStatement:(t,e,n)=>{s(e.key,specialReferenceWHILE),t.test&&n(t.test,e),t.body&&n(t.body,e)},DoWhileStatement:(t,e,n)=>{s(e.key,specialReferenceWHILE),t.test&&n(t.test,e),t.body&&n(t.body,e)},ForStatement:(t,e,n)=>{s(e.key,specialReferenceFOR),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)=>{s(e.key,specialReferenceIF),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 acorn_walk__WEBPACK_IMPORTED_MODULE_0__.a(n,{key:a},Object.assign({ImportDeclaration:(t,e)=>{const n=t.source.value;o.push(n);const a=r[e.key];if(void 0===a)throw new Error("set should not be undefined");a.add(n+memCheckGlobalKey);for(let a=0;a{const n=e+"."+(null===t.id?"__SPECIAL_DEFAULT_EXPORT__":t.id.name);acorn_walk__WEBPACK_IMPORTED_MODULE_0__.a(t,{key:n},c())}},c())),{dependencyMap:r,additionalModules:o}}async function calculateRamUsage(t,e,n){const a={loadedFns:{},env:{vars:_Netscript_RamCostGenerator__WEBPACK_IMPORTED_MODULE_3__.b}};try{return await parseOnlyRamCalculate(t,n,e,a)}catch(t){return console.error("Failed to parse script for RAM calculations:"),console.error(t),{cost:_RamCalculationErrorCodes__WEBPACK_IMPORTED_MODULE_2__.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(200);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 it}));var a=n(596),r=n.n(a),i=n(422),o=n(297),s=n(18),l=n(10),c=n(102),f=n(481),u=n(92),m=n(84),h=n(2),d=n(65),p=n(255),g=n(236),y=n(100),b=n(407),E=n(24),v=n(137),k=n(224),_=n(46),w=n(529),S=n(83),x=n(225),C=n(199),L=n(142),O=n(200),M=n(110),T=n(5),A=n(22),R=n(178),N=n(257),P=n(146),I=n(1032),F=n(1037),D=n(1038),j=n(1040),B=n(1041),G=n(1043),W=n(1044),H=n(1045),U=n(1046),q=n(1048),$=n(1053),K=n(1054),z=n(1055),V=n(1411),Y=n(645),J=n(14),X=n(94),Q=n(370),Z=n(644),tt=n(284),et=n(420),nt=n(461),at=n(15),rt=n(1412);function it(t){const e=function(t,e){const n=Object(E.d)(t);if(null==n)throw e.makeRuntimeErrorMsg("Invalid hostname: "+t);return n},n=function(n,a,r,i){if(!Array.isArray(i))throw Object(M.b)(t,`Invalid scriptArgs argument passed into getRunningScript() from ${n.function}(). This is probably a bug. Please report to game developer`);if(null!=a&&"string"==typeof a){null==r&&(r=t.hostname);const o=e(r,n);return Object(g.a)(a,i,o)}return t.scriptRef},a=function(t){for(const e of Object(E.c)()){const n=Object(g.b)(t,e);if(n)return n}return null},ot=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}},st=function(t,e,n){return Array.isArray(n)||(n=[]),`Cannot find running script ${t} on server ${e} with args: ${Object(N.a)(n)}`},lt=function(e,n=""){return e instanceof u.a&&(t.log(n,()=>"Does not work on Hacknet Servers"),!0)},ct=function(e,n){const a=(new Error).stack;if(void 0===a)throw new Error("how did we not throw an error?");const r=a.split("\n").slice(1),i=t.getServer().scripts,o=[];for(const t of r){let e;for(const n of i){n.url&&t.includes(n.url)&&(e=n.filename);for(const a of n.dependencies)t.includes(a.url)&&(e=a.filename)}if(!e)continue;function s(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=s(t);function l(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=l(t);r&&(n=r),o.push(`${e}:L${n.line}@${n.func}`)}t.log(e,()=>n);let c=`${e}: ${n}`;return 0!==o.length&&(c+="

Stack:
"+o.join("
")),Object(M.b)(t,c)},ft=async function(n,a,r,{threads:i,stock:o}={}){if(void 0===a)throw n.makeRuntimeErrorMsg("Takes 1 argument.");const u=Object(M.d)(n,i),m=e(a,n);if(!(m instanceof _.a))throw n.makeRuntimeErrorMsg("Cannot be executed on this server.");const d=Object(c.d)(m,h.a),p=Object(f.b)(m,h.a);if(!p.res)throw n.makeRuntimeErrorMsg(p.msg||"");return n.log(()=>`Executing on '${m.hostname}' in ${Object(A.d)(1e3*d,!0)} (t=${T.a.formatThreads(u)})`),Object(M.c)(1e3*d,t).then((function(){const e=Object(c.b)(m,h.a),a=Math.random();let i=Object(c.c)(m,h.a)*u;const f=i/4;if(am.moneyAvailable&&(d=m.moneyAvailable),m.moneyAvailable-=d,m.moneyAvailable<0&&(m.moneyAvailable=0);let p=d*s.a.ScriptHackMoneyGain;return r&&(p=d*s.a.ManualHackMoney),h.a.gainMoney(p,"hacking"),t.scriptRef.onlineMoneyMade+=p,h.a.scriptProdSinceLastAug+=p,t.scriptRef.recordHack(m.hostname,p,u),h.a.gainHackingExp(i),r&&h.a.gainIntelligenceExp(.005),t.scriptRef.onlineExpGained+=i,n.log(()=>`Successfully hacked '${m.hostname}' for ${T.a.formatMoney(p)} and ${T.a.formatExp(i)} exp (t=${T.a.formatThreads(u)})`),m.fortify(l.a.ServerFortifyAmount*Math.min(u,a)),o&&Object(w.c)(m,d),r&&(m.backdoorInstalled=!0),Promise.resolve(p)}return h.a.gainHackingExp(f),t.scriptRef.onlineExpGained+=f,n.log(()=>`Failed to hack '${m.hostname}'. Gained ${T.a.formatExp(f)} exp (t=${T.a.formatThreads(u)})`),Promise.resolve(0)}))},ut=function(t){let e="";for(let n of t)n=Object(Y.a)(n),e+="object"==typeof n?JSON.stringify(n):""+n;return e},mt={updateDynamicRam:function(e,n){if(t.dynamicLoadedFns[e])return;t.dynamicLoadedFns[e]=!0;let a=t.scriptRef.threads;if("number"!=typeof a&&(console.warn(`WorkerScript detected NaN for threadcount for ${t.name} on ${t.hostname}`),a=1),t.dynamicRamUsage+=n,t.dynamicRamUsage>1.01*t.ramUsage)throw Object(M.b)(t,`Dynamic RAM usage calculated to be greater than initial RAM usage on fn: ${e}.\n This is probably because you somehow circumvented the static RAM calculation.\n\n Threads: ${a}\n Dynamic RAM Usage: ${T.a.formatRAM(t.dynamicRamUsage)}\n Static RAM Usage: ${T.a.formatRAM(t.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 :(`)},makeRuntimeErrorMsg:ct,string:(t,e,n)=>{if("string"==typeof n)return n;if("number"==typeof n)return n+"";throw ct(t,e+" should be a string.")},number:(t,e,n)=>{if("string"==typeof n){const t=parseFloat(n);if(!isNaN(t))return t}else if("number"==typeof n){if(isNaN(n))throw ct(t,e+" is NaN.");return n}throw ct(t,e+" should be a number.")},boolean:t=>!!t,city:(t,e,n)=>{if("string"!=typeof n)throw ct(t,e+" should be a city name.");const a=n;if(!Object.values(at.a).includes(a))throw ct(t,e+" should be a city name.");return a},getServer:e,checkSingularityAccess:function(t){if(4!==h.a.bitNodeN&&0===h.a.sourceFileLvl(4))throw ct(t,"This singularity function requires Source-File 4 to run. A power up you obtain later in the game. It will be very obvious when and how you can obtain it.")},hack:ft,getValidPort:(t,e)=>{if(isNaN(e))throw ct(t,`Invalid argument. Must be a port number between 1 and ${l.a.NumNetscriptPorts}, is ${e}`);if((e=Math.round(e))<1||e>l.a.NumNetscriptPorts)throw ct(t,`Trying to use an invalid port: ${e}. Only ports 1-${l.a.NumNetscriptPorts} are valid.`);const n=C.a[e-1];if(null==n||!(n instanceof Object))throw ct(t,`Could not find port: ${e}. This is a bug. Report to dev.`);return n}},ht=Object(V.a)(h.a,t),dt={...{...ht,args:t.args,enums:{toast:X.d},singularity:ht,gang:Object(I.a)(h.a,t),bladeburner:Object(H.a)(h.a,t),codingcontract:Object(U.a)(h.a,t),sleeve:Object(F.a)(h.a),corporation:Object(q.a)(h.a,t),stanek:Object(B.a)(h.a,t,mt),infiltration:Object(G.a)(h.a),ui:Object(W.a)(),formulas:Object($.a)(h.a,mt),stock:Object(K.a)(h.a,t),grafting:Object(z.a)(h.a),hacknet:Object(j.a)(h.a,t),sprintf:()=>i.sprintf,vsprintf:()=>i.vsprintf,scan:n=>(a=t.hostname)=>{const r=n.helper.string("hostname",a),i=e(r,n),o=[];for(let t=0;t`returned ${i.serversOnNetwork.length} connections for ${i.hostname}`),o},hack:t=>(e,{threads:n,stock:a}={})=>{const r=t.helper.string("hostname",e);return ft(t,r,!1,{threads:n,stock:a})},hackAnalyzeThreads:t=>(n,a)=>{const r=t.helper.string("hostname",n),i=t.helper.number("hackAmount",a),o=e(r,t);if(!(o instanceof _.a))return t.log(()=>"Cannot be executed on this server."),-1;if(isNaN(i))throw t.makeRuntimeErrorMsg(`Invalid hackAmount argument passed into hackAnalyzeThreads: ${i}. Must be numeric.`);if(i<0||i>o.moneyAvailable)return-1;if(0===i)return 0;const s=Object(c.e)(o,h.a);return 0===s||0===o.moneyAvailable?0:i/Math.floor(o.moneyAvailable*s)},hackAnalyze:t=>n=>{const a=t.helper.string("hostname",n),r=e(a,t);return r instanceof _.a?Object(c.e)(r,h.a):(t.log(()=>"Cannot be executed on this server."),0)},hackAnalyzeSecurity:t=>(n,a)=>{let r=t.helper.number("threads",n);if(a){const n=t.helper.string("hostname",a),i=e(n,t);if(!(i instanceof _.a))return t.log(()=>"Cannot be executed on this server."),0;const o=Object(c.e)(i,h.a);o>0&&(r=Math.min(r,Math.ceil(1/o)))}return l.a.ServerFortifyAmount*r},hackAnalyzeChance:t=>n=>{const a=t.helper.string("hostname",n),r=e(a,t);return r instanceof _.a?Object(c.b)(r,h.a):(t.log(()=>"Cannot be executed on this server."),0)},sleep:e=>async(n=0)=>{const a=e.helper.number("time",n);if(void 0===a)throw e.makeRuntimeErrorMsg("Takes 1 argument.");return e.log(()=>`Sleeping for ${a} milliseconds`),Object(M.c)(a,t).then((function(){return Promise.resolve(!0)}))},asleep:t=>function(e=0){const n=t.helper.number("time",e);return t.log(()=>`Sleeping for ${n} milliseconds`),new Promise(t=>setTimeout(()=>t(!0),n))},grow:n=>async(a,{threads:r,stock:i}={})=>{const o=n.helper.string("hostname",a),s=Object(M.d)(n,null!=r?r:t.scriptRef.threads),l=e(o,n);if(!(l instanceof _.a))return n.log(()=>"Cannot be executed on this server."),Promise.resolve(0);const u=Object(E.d)(t.hostname);if(null===u)throw new Error("Workerscript host is null");const m=Object(f.a)(l);if(!m.res)throw n.makeRuntimeErrorMsg(m.msg||"");const d=Object(c.a)(l,h.a);return n.log(()=>`Executing on '${l.hostname}' in ${Object(A.d)(1e3*d,!0)} (t=${T.a.formatThreads(s)}).`),Object(M.c)(1e3*d,t).then((function(){const e=l.moneyAvailable<=0?1:l.moneyAvailable;Object(v.f)(l,s,h.a,u.cpuCores);const a=l.moneyAvailable;t.scriptRef.recordGrow(l.hostname,s);const r=Object(c.c)(l,h.a)*s,o=a/e-1;return n.log(()=>`Available money on '${l.hostname}' grown by ${T.a.formatPercentage(o,6)}. Gained ${T.a.formatExp(r)} hacking exp (t=${T.a.formatThreads(s)}).`),t.scriptRef.onlineExpGained+=r,h.a.gainHackingExp(r),i&&Object(w.b)(l,a-e),Promise.resolve(a/e)}))},growthAnalyze:t=>(n,a,r=1)=>{const i=t.helper.string("hostname",n),o=t.helper.number("growth",a),s=t.helper.number("cores",r),l=e(i,t);if(!(l instanceof _.a))return t.log(()=>"Cannot be executed on this server."),0;if("number"!=typeof o||isNaN(o)||o<1||!isFinite(o))throw t.makeRuntimeErrorMsg(`Invalid argument: growth must be numeric and >= 1, is ${o}.`);return Object(v.c)(l,Number(o),h.a,s)},growthAnalyzeSecurity:t=>(n,a,r)=>{let i=t.helper.number("threads",n);if(a){const n=t.helper.number("cores",r)||1,o=t.helper.string("hostname",a),s=e(o,t);if(!(s instanceof _.a))return t.log(()=>"Cannot be executed on this server."),0;const l=Math.ceil(Object(v.d)(s,s.moneyMax,s.moneyAvailable,h.a,n));i=Math.min(i,l)}return 2*l.a.ServerFortifyAmount*i},weaken:n=>async(a,{threads:r}={})=>{const i=n.helper.string("hostname",a),o=Object(M.d)(n,null!=r?r:t.scriptRef.threads);if(void 0===i)throw n.makeRuntimeErrorMsg("Takes 1 argument.");const s=e(i,n);if(!(s instanceof _.a))return n.log(()=>"Cannot be executed on this server."),Promise.resolve(0);const u=Object(f.c)(s);if(!u.res)throw n.makeRuntimeErrorMsg(u.msg||"");const m=Object(c.f)(s,h.a);return n.log(()=>`Executing on '${s.hostname}' in ${Object(A.d)(1e3*m,!0)} (t=${T.a.formatThreads(o)})`),Object(M.c)(1e3*m,t).then((function(){const e=Object(E.d)(t.hostname);if(null===e)return n.log(()=>"Server is null, did it die?"),Promise.resolve(0);const a=1+(e.cpuCores-1)/16;s.weaken(l.a.ServerWeakenAmount*o*a),t.scriptRef.recordWeaken(s.hostname,o);const r=Object(c.c)(s,h.a)*o;return n.log(()=>`'${s.hostname}' security level weakened to ${s.hackDifficulty}. Gained ${T.a.formatExp(r)} hacking exp (t=${T.a.formatThreads(o)})`),t.scriptRef.onlineExpGained+=r,h.a.gainHackingExp(r),Promise.resolve(l.a.ServerWeakenAmount*o*a)}))},weakenAnalyze:t=>(e,n=1)=>{const a=t.helper.number("threads",e),r=1+(t.helper.number("cores",n)-1)/16;return l.a.ServerWeakenAmount*a*r*s.a.ServerWeakenRate},share:e=>async()=>{e.log(()=>"Sharing this computer.");const n=Object(et.b)(t.scriptRef.threads*Object(tt.a)(h.a.intelligence,2));return Object(M.c)(1e4,t).finally((function(){e.log(()=>"Finished sharing this computer."),n()}))},getSharePower:()=>()=>Object(et.a)(),print:e=>(...n)=>{if(0===n.length)throw e.makeRuntimeErrorMsg("Takes at least 1 argument.");t.print(ut(n))},printf:e=>(n,...a)=>{const r=e.helper.string("format",n);if("string"!=typeof r)throw e.makeRuntimeErrorMsg("First argument must be string for the format.");t.print(Object(i.vsprintf)(r,a))},tprint:e=>(...n)=>{if(0===n.length)throw e.makeRuntimeErrorMsg("Takes at least 1 argument.");const a=ut(n);a.startsWith("ERROR")||a.startsWith("FAIL")?m.a.error(`${t.scriptRef.filename}: ${a}`):a.startsWith("SUCCESS")?m.a.success(`${t.scriptRef.filename}: ${a}`):a.startsWith("WARN")?m.a.warn(`${t.scriptRef.filename}: ${a}`):a.startsWith("INFO")?m.a.info(`${t.scriptRef.filename}: ${a}`):m.a.print(`${t.scriptRef.filename}: ${a}`)},tprintf:t=>(e,...n)=>{const a=t.helper.string("format",e),r=Object(i.vsprintf)(a,n);r.startsWith("ERROR")||r.startsWith("FAIL")?m.a.error(""+r):r.startsWith("SUCCESS")?m.a.success(""+r):r.startsWith("WARN")?m.a.warn(""+r):r.startsWith("INFO")?m.a.info(""+r):m.a.print(""+r)},clearLog:()=>()=>{t.scriptRef.clearLog()},disableLog:e=>n=>{const a=e.helper.string("fn",n);if("ALL"===a){for(const e of Object.keys(pt))t.disableLogs[e]=!0;e.log(()=>"Disabled logging for all functions")}else{if(void 0===pt[a])throw e.makeRuntimeErrorMsg(`Invalid argument: ${a}.`);t.disableLogs[a]=!0,e.log(()=>"Disabled logging for "+a)}},enableLog:e=>n=>{const a=e.helper.string("fn",n);if("ALL"===a){for(const e of Object.keys(pt))delete t.disableLogs[e];e.log(()=>"Enabled logging for all functions")}else if(void 0===pt[a])throw e.makeRuntimeErrorMsg(`Invalid argument: ${a}.`);delete t.disableLogs[a],e.log(()=>"Enabled logging for "+a)},isLogEnabled:e=>n=>{const a=e.helper.string("fn",n);if(void 0===pt[a])throw e.makeRuntimeErrorMsg(`Invalid argument: ${a}.`);return!t.disableLogs[a]},getScriptLogs:t=>(e,a,...r)=>{const i=n(t,e,a,r);return null==i?(t.log(()=>st(e,a,r)),[]):i.logs.slice()},tail:e=>(r,i=t.hostname,...o)=>{let s;s=void 0===r?t.scriptRef:"number"==typeof r?a(r):n(e,r,i,o),null!=s?R.c.emit(s):e.log(()=>st(r,i,o))},closeTail:e=>(n=t.scriptRef.pid)=>{const a=e.helper.number("pid",n);R.b.emit(a)},nuke:t=>n=>{const a=t.helper.string("hostname",n),r=e(a,t);if(!(r instanceof _.a))return t.log(()=>"Cannot be executed on this server."),!1;if(r.hasAdminRights)return t.log(()=>`Already have root access to '${r.hostname}'.`),!0;if(!h.a.hasProgram(d.a.NukeProgram.name))throw t.makeRuntimeErrorMsg("You do not have the NUKE.exe virus!");if(r.openPortCount`Executed NUKE.exe virus on '${r.hostname}' to gain root access.`),!0},brutessh:t=>n=>{const a=t.helper.string("hostname",n),r=e(a,t);if(!(r instanceof _.a))return t.log(()=>"Cannot be executed on this server."),!1;if(!h.a.hasProgram(d.a.BruteSSHProgram.name))throw t.makeRuntimeErrorMsg("You do not have the BruteSSH.exe program!");return r.sshPortOpen?t.log(()=>`SSH Port (22) already opened on '${r.hostname}'.`):(t.log(()=>`Executed BruteSSH.exe on '${r.hostname}' to open SSH port (22).`),r.sshPortOpen=!0,++r.openPortCount),!0},ftpcrack:t=>n=>{const a=t.helper.string("hostname",n);if(void 0===a)throw t.makeRuntimeErrorMsg("Takes 1 argument.");const r=e(a,t);if(!(r instanceof _.a))return t.log(()=>"Cannot be executed on this server."),!1;if(!h.a.hasProgram(d.a.FTPCrackProgram.name))throw t.makeRuntimeErrorMsg("You do not have the FTPCrack.exe program!");return r.ftpPortOpen?t.log(()=>`FTP Port (21) already opened on '${r.hostname}'.`):(t.log(()=>`Executed FTPCrack.exe on '${r.hostname}' to open FTP port (21).`),r.ftpPortOpen=!0,++r.openPortCount),!0},relaysmtp:t=>n=>{const a=t.helper.string("hostname",n);if(void 0===a)throw t.makeRuntimeErrorMsg("Takes 1 argument.");const r=e(a,t);if(!(r instanceof _.a))return t.log(()=>"Cannot be executed on this server."),!1;if(!h.a.hasProgram(d.a.RelaySMTPProgram.name))throw t.makeRuntimeErrorMsg("You do not have the relaySMTP.exe program!");return r.smtpPortOpen?t.log(()=>`SMTP Port (25) already opened on '${r.hostname}'.`):(t.log(()=>`Executed relaySMTP.exe on '${r.hostname}' to open SMTP port (25).`),r.smtpPortOpen=!0,++r.openPortCount),!0},httpworm:t=>n=>{const a=t.helper.string("hostname",n);if(void 0===a)throw t.makeRuntimeErrorMsg("Takes 1 argument");const r=e(a,t);if(!(r instanceof _.a))return t.log(()=>"Cannot be executed on this server."),!1;if(!h.a.hasProgram(d.a.HTTPWormProgram.name))throw t.makeRuntimeErrorMsg("You do not have the HTTPWorm.exe program!");return r.httpPortOpen?t.log(()=>`HTTP Port (80) already opened on '${r.hostname}'.`):(t.log(()=>`Executed HTTPWorm.exe on '${r.hostname}' to open HTTP port (80).`),r.httpPortOpen=!0,++r.openPortCount),!0},sqlinject:t=>n=>{const a=t.helper.string("hostname",n);if(void 0===a)throw t.makeRuntimeErrorMsg("Takes 1 argument.");const r=e(a,t);if(!(r instanceof _.a))return t.log(()=>"Cannot be executed on this server."),!1;if(!h.a.hasProgram(d.a.SQLInjectProgram.name))throw t.makeRuntimeErrorMsg("You do not have the SQLInject.exe program!");return r.sqlPortOpen?t.log(()=>`SQL Port (1433) already opened on '${r.hostname}'.`):(t.log(()=>`Executed SQLInject.exe on '${r.hostname}' to open SQL port (1433).`),r.sqlPortOpen=!0,++r.openPortCount),!0},run:e=>(n,a=1,...r)=>{const i=e.helper.string("scriptname",n),o=e.helper.number("threads",a);if(void 0===i)throw e.makeRuntimeErrorMsg("Usage: run(scriptname, [numThreads], [arg1], [arg2]...)");if(isNaN(o)||o<=0)throw e.makeRuntimeErrorMsg("Invalid thread count. Must be numeric and > 0, is "+o);const s=Object(E.d)(t.hostname);if(null==s)throw e.makeRuntimeErrorMsg("Could not find server. This is a bug. Report to dev.");return Object(C.d)(h.a,"run",s,i,r,t,o)},exec:n=>(a,r,i=1,...o)=>{const s=n.helper.string("scriptname",a),l=n.helper.string("hostname",r),c=n.helper.number("threads",i);if(void 0===s||void 0===l)throw n.makeRuntimeErrorMsg("Usage: exec(scriptname, server, [numThreads], [arg1], [arg2]...)");if(isNaN(c)||c<=0)throw n.makeRuntimeErrorMsg("Invalid thread count. Must be numeric and > 0, is "+c);const f=e(l,n);return Object(C.d)(h.a,"exec",f,s,o,t,c)},spawn:e=>(n,a=1,...r)=>{const i=e.helper.string("scriptname",n),o=e.helper.number("threads",a);if(!i||!o)throw e.makeRuntimeErrorMsg("Usage: spawn(scriptname, threads)");setTimeout(()=>{if(isNaN(o)||o<=0)throw e.makeRuntimeErrorMsg("Invalid thread count. Must be numeric and > 0, is "+o);const n=Object(E.d)(t.hostname);if(null==n)throw e.makeRuntimeErrorMsg("Could not find server. This is a bug. Report to dev");return Object(C.d)(h.a,"spawn",n,i,r,t,o)},1e4),e.log(()=>`Will execute '${i}' in 10 seconds`),t.running=!1,Object(L.a)(t)&&e.log(()=>"Exiting...")},kill:t=>(a,r,...i)=>{let o;const s="number"==typeof a;if(s)o=Object(L.a)(a);else{if(void 0===a||void 0===r)throw t.makeRuntimeErrorMsg("Usage: kill(scriptname, server, [arg1], [arg2]...)");const s=e(r,t),l=n(t,a,r,i);if(null==l)return t.log(()=>st(a,r,i)),!1;o=Object(L.a)(l,s.hostname)}return o?(s?t.log(()=>"Killing script with PID "+a):t.log(()=>`Killing '${a}' on '${r}' with args: ${Object(N.a)(i)}.`),!0):(s?t.log(()=>"No script with PID "+a):t.log(()=>`No such script '${a}' on '${r}' with args: ${Object(N.a)(i)}`),!1)},killall:n=>(a=t.hostname,r=!0)=>{const i=n.helper.string("hostname",a),s=mt.boolean(r);if(void 0===i)throw n.makeRuntimeErrorMsg("Usage: killall(hostname, [safetyguard boolean])");const l=e(i,n);let c=0;for(let e=l.runningScripts.length-1;e>=0;--e)!0===s&&l.runningScripts[e].pid==t.pid||(Object(L.a)(l.runningScripts[e],l.hostname,!1),++c);return o.a.emit(),n.log(()=>`Killing all scripts on '${l.hostname}'. May take a few minutes for the scripts to die.`),c>0},exit:e=>()=>{t.running=!1,Object(L.a)(t)?e.log(()=>"Exiting..."):e.log(()=>"Failed. This is a bug. Report to dev.")},scp:n=>async(a,r,i)=>{const o=n.helper.string("hostname1",r);if(a&&a.constructor===Array){const e=a;if(0===e.length)throw n.makeRuntimeErrorMsg("No scripts to copy");let r=!0;return await Promise.all(e.map((async function(e){await it(t).scp(e,o,i)||(r=!1)}))),Promise.resolve(r)}if(!Object(S.j)(a))throw n.makeRuntimeErrorMsg(`Invalid filename: '${a}'`);if(!a.endsWith(".lit")&&!Object(y.a)(a)&&!a.endsWith("txt"))throw n.makeRuntimeErrorMsg("Only works for scripts, .lit and .txt files");let s,l;if(null!=i){if(void 0===a||void 0===o||void 0===i)throw n.makeRuntimeErrorMsg("Takes 2 or 3 arguments");s=e(i,n),l=e(o,n)}else{if(null==o)throw n.makeRuntimeErrorMsg("Takes 2 or 3 arguments");if(void 0===a||void 0===o)throw n.makeRuntimeErrorMsg("Takes 2 or 3 arguments");if(s=e(o,n),l=Object(E.d)(t.hostname),null==l)throw n.makeRuntimeErrorMsg("Could not find server hostname for this script. This is a bug. Report to dev.")}if(a.endsWith(".lit")){let t=!1;for(let e=0;e`File '${a}' does not exist.`),Promise.resolve(!1);for(let t=0;t{var t;return`File '${a}' copied over to '${null===(t=s)||void 0===t?void 0:t.hostname}'.`}),Promise.resolve(!0);return s.messages.push(a),n.log(()=>{var t;return`File '${a}' copied over to '${null===(t=s)||void 0===t?void 0:t.hostname}'.`}),Promise.resolve(!0)}if(a.endsWith(".txt")){let t;for(let e=0;e`File '${a}' does not exist.`),Promise.resolve(!1);for(let e=0;e{var t;return`File '${a}' copied over to '${null===(t=s)||void 0===t?void 0:t.hostname}'.`}),Promise.resolve(!0);const e=new x.a(t.fn,t.text);return s.textFiles.push(e),n.log(()=>{var t;return`File '${a}' copied over to '${null===(t=s)||void 0===t?void 0:t.hostname}'.`}),Promise.resolve(!0)}let c=null;for(let t=0;t`File '${a}' does not exist.`),Promise.resolve(!1);for(let t=0;t{var t;return`WARNING: File '${a}' overwritten on '${null===(t=s)||void 0===t?void 0:t.hostname}'`});const e=s.scripts[t];return e.code===c.code||(e.code=c.code,e.ramUsage=c.ramUsage,e.markUpdated()),Promise.resolve(!0)}const f=new p.a(h.a,a);return f.code=c.code,f.ramUsage=c.ramUsage,f.server=s.hostname,s.scripts.push(f),n.log(()=>{var t;return`File '${a}' copied over to '${null===(t=s)||void 0===t?void 0:t.hostname}'.`}),new Promise(t=>{null!==s?f.updateRamUsage(h.a,s.scripts).then(()=>t(!0)):t(!1)})},ls:t=>(n,a="")=>{const r=t.helper.string("hostname",n),i=t.helper.string("grep",a),o=e(r,t);let s="";void 0!==a&&(s=i.toString());const l=[];for(let t=0;t()=>nt.b.map(t=>({timeOfDeath:t.timeOfDeath,...ot(t.runningScript)})),ps:n=>(a=t.hostname)=>{const r=n.helper.string("hostname",a),i=e(r,n),o=[];for(const t of i.runningScripts)o.push({filename:t.filename,threads:t.threads,args:t.args.slice(),pid:t.pid});return o},hasRootAccess:t=>n=>{const a=t.helper.string("hostname",n);return e(a,t).hasAdminRights},getHostname:e=>()=>{const n=Object(E.d)(t.hostname);if(null==n)throw e.makeRuntimeErrorMsg("Could not find server. This is a bug. Report to dev.");return n.hostname},getHackingLevel:t=>()=>(h.a.updateSkillLevels(),t.log(()=>"returned "+h.a.hacking),h.a.hacking),getHackingMultipliers:()=>()=>({chance:h.a.hacking_chance_mult,speed:h.a.hacking_speed_mult,money:h.a.hacking_money_mult,growth:h.a.hacking_grow_mult}),getHacknetMultipliers:()=>()=>({production:h.a.hacknet_node_money_mult,purchaseCost:h.a.hacknet_node_purchase_cost_mult,ramCost:h.a.hacknet_node_ram_cost_mult,coreCost:h.a.hacknet_node_core_cost_mult,levelCost:h.a.hacknet_node_level_cost_mult}),getBitNodeMultipliers:t=>()=>{if(h.a.sourceFileLvl(5)<=0&&5!==h.a.bitNodeN)throw t.makeRuntimeErrorMsg("Requires Source-File 5 to run.");return Object.assign({},s.a)},getServer:n=>(a=t.hostname)=>{const r=n.helper.string("hostname",a),i=e(r,n),o=Object.assign({},i);return o.contracts=void 0,o.messages=void 0,o.runningScripts=void 0,o.scripts=void 0,o.textFiles=void 0,o.programs=void 0,o.serversOnNetwork=void 0,o.baseDifficulty||(o.baseDifficulty=0),o.hackDifficulty||(o.hackDifficulty=0),o.minDifficulty||(o.minDifficulty=0),o.moneyAvailable||(o.moneyAvailable=0),o.moneyMax||(o.moneyMax=0),o.numOpenPortsRequired||(o.numOpenPortsRequired=0),o.openPortCount||(o.openPortCount=0),o.requiredHackingSkill||(o.requiredHackingSkill=0),o.serverGrowth||(o.serverGrowth=0),o},getServerMoneyAvailable:t=>n=>{const a=t.helper.string("hostname",n),r=e(a,t);return r instanceof _.a?lt(r,"getServerMoneyAvailable")?0:"home"==r.hostname?(t.log(()=>"returned player's money: "+T.a.formatMoney(h.a.money)),h.a.money):(t.log(()=>`returned ${T.a.formatMoney(r.moneyAvailable)} for '${r.hostname}'`),r.moneyAvailable):(t.log(()=>"Cannot be executed on this server."),0)},getServerSecurityLevel:t=>n=>{const a=t.helper.string("hostname",n),r=e(a,t);return r instanceof _.a?lt(r,"getServerSecurityLevel")?1:(t.log(()=>`returned ${T.a.formatServerSecurity(r.hackDifficulty)} for '${r.hostname}'`),r.hackDifficulty):(t.log(()=>"Cannot be executed on this server."),1)},getServerBaseSecurityLevel:t=>n=>{const a=t.helper.string("hostname",n);t.log(()=>"getServerBaseSecurityLevel is deprecated because it's not useful.");const r=e(a,t);return r instanceof _.a?lt(r,"getServerBaseSecurityLevel")?1:(t.log(()=>`returned ${T.a.formatServerSecurity(r.baseDifficulty)} for '${r.hostname}'`),r.baseDifficulty):(t.log(()=>"Cannot be executed on this server."),1)},getServerMinSecurityLevel:t=>n=>{const a=t.helper.string("hostname",n),r=e(a,t);return r instanceof _.a?lt(r,"getServerMinSecurityLevel")?1:(t.log(()=>`returned ${T.a.formatServerSecurity(r.minDifficulty)} for ${r.hostname}`),r.minDifficulty):(t.log(()=>"Cannot be executed on this server."),1)},getServerRequiredHackingLevel:t=>n=>{const a=t.helper.string("hostname",n),r=e(a,t);return r instanceof _.a?lt(r,"getServerRequiredHackingLevel")?1:(t.log(()=>`returned ${T.a.formatSkill(r.requiredHackingSkill)} for '${r.hostname}'`),r.requiredHackingSkill):(t.log(()=>"Cannot be executed on this server."),1)},getServerMaxMoney:t=>n=>{const a=t.helper.string("hostname",n),r=e(a,t);return r instanceof _.a?lt(r,"getServerMaxMoney")?0:(t.log(()=>`returned ${T.a.formatMoney(r.moneyMax)} for '${r.hostname}'`),r.moneyMax):(t.log(()=>"Cannot be executed on this server."),0)},getServerGrowth:t=>n=>{const a=t.helper.string("hostname",n),r=e(a,t);return r instanceof _.a?lt(r,"getServerGrowth")?1:(t.log(()=>`returned ${r.serverGrowth} for '${r.hostname}'`),r.serverGrowth):(t.log(()=>"Cannot be executed on this server."),1)},getServerNumPortsRequired:t=>n=>{const a=t.helper.string("hostname",n),r=e(a,t);return r instanceof _.a?lt(r,"getServerNumPortsRequired")?5:(t.log(()=>`returned ${r.numOpenPortsRequired} for '${r.hostname}'`),r.numOpenPortsRequired):(t.log(()=>"Cannot be executed on this server."),5)},getServerRam:t=>n=>{const a=t.helper.string("hostname",n);t.log(()=>"getServerRam is deprecated in favor of getServerMaxRam / getServerUsedRam");const r=e(a,t);return t.log(()=>`returned [${T.a.formatRAM(r.maxRam)}, ${T.a.formatRAM(r.ramUsed)}]`),[r.maxRam,r.ramUsed]},getServerMaxRam:t=>n=>{const a=t.helper.string("hostname",n),r=e(a,t);return t.log(()=>"returned "+T.a.formatRAM(r.maxRam)),r.maxRam},getServerUsedRam:t=>n=>{const a=t.helper.string("hostname",n),r=e(a,t);return t.log(()=>"returned "+T.a.formatRAM(r.ramUsed)),r.ramUsed},serverExists:t=>e=>{const n=t.helper.string("hostname",e);return null!==Object(E.d)(n)},fileExists:n=>(a,r=t.hostname)=>{const i=n.helper.string("filename",a),o=n.helper.string("hostname",r);if(void 0===i)throw n.makeRuntimeErrorMsg("Usage: fileExists(scriptname, [server])");const s=e(o,n);for(let t=0;t(r,i=t.hostname,...o)=>{if(void 0===r||void 0===i)throw e.makeRuntimeErrorMsg("Usage: isRunning(scriptname, server, [arg1], [arg2]...)");return"number"==typeof r?null!=a(r):null!=n(e,r,i,o)},getPurchasedServerLimit:()=>()=>Object(k.b)(),getPurchasedServerMaxRam:()=>()=>Object(k.c)(),getPurchasedServerCost:t=>e=>{const n=t.helper.number("ram",e),a=Object(k.a)(n);return a===1/0?(t.log(()=>`Invalid argument: ram='${n}'`),1/0):a},purchaseServer:t=>(e,n)=>{const a=t.helper.string("name",e),r=t.helper.number("ram",n);let i=String(a);if(i=i.replace(/\s+/g,""),""==i)return t.log(()=>`Invalid argument: hostname='${i}'`),"";if(h.a.purchasedServers.length>=Object(k.b)())return t.log(()=>`You have reached the maximum limit of ${Object(k.b)()} servers. You cannot purchase any more.`),"";const o=Object(k.a)(r);if(o===1/0)return r>Object(k.c)()?t.log(()=>`Invalid argument: ram='${r}' must not be greater than getPurchaseServerMaxRam`):t.log(()=>`Invalid argument: ram='${r}' must be a positive power of 2`),"";if(h.a.money"Not enough money to purchase server. Need "+T.a.formatMoney(o)),"";const s=Object(v.g)({ip:Object(E.e)(),hostname:i,organizationName:"",isConnectedTo:!1,adminRights:!0,purchasedByPlayer:!0,maxRam:r});Object(E.a)(s),h.a.purchasedServers.push(s.hostname);const l=h.a.getHomeComputer();return l.serversOnNetwork.push(s.hostname),s.serversOnNetwork.push(l.hostname),h.a.loseMoney(o,"servers"),t.log(()=>`Purchased new server with hostname '${s.hostname}' for ${T.a.formatMoney(o)}`),s.hostname},deleteServer:e=>n=>{const a=e.helper.string("name",n);let r=String(a);r=r.replace(/\s\s+/g,"");const i=Object(E.d)(r);if(!(i instanceof _.a))return e.log(()=>`Invalid argument: hostname='${r}'`),!1;if(!i.purchasedByPlayer||"home"===i.hostname)return e.log(()=>"Cannot delete non-purchased server."),!1;const o=i.hostname;if(i.isConnectedTo)return e.log(()=>"You are currently connected to the server you are trying to delete."),!1;if(o===t.hostname)return e.log(()=>"Cannot delete the server this script is running on."),!1;if(i.runningScripts.length>0)return e.log(()=>`Cannot delete server '${o}' because it still has scripts running.`),!1;let s=!1;for(let t=0;t`Could not identify server ${o} as a purchased server. This is a bug. Report to dev.`),!1;Object(E.b)(o),s=!1;const l=h.a.getHomeComputer();for(let t=0;t"Deleted server '"+r),!0;return e.log(()=>`Could not find server ${o} as a purchased server. This is a bug. Report to dev.`),!1},getPurchasedServers:()=>()=>{const t=[];return h.a.purchasedServers.forEach((function(e){t.push(e)})),t},writePort:t=>(e,n="")=>{const a=t.helper.number("port",e);if("string"!=typeof n&&"number"!=typeof n)throw t.makeRuntimeErrorMsg("Trying to write invalid data to a port: only strings and numbers are valid.");const r=mt.getValidPort("writePort",a);return Promise.resolve(r.write(n))},write:e=>(n,a="",r="a")=>{const i=e.helper.string("port",n),o=e.helper.string("mode",r);if(Object(P.a)(i)){let n=i;if(!Object(S.j)(n))throw e.makeRuntimeErrorMsg("Invalid filepath: "+n);0===n.lastIndexOf("/")&&(n=Object(S.k)(n));try{a=String(a)}catch(t){throw e.makeRuntimeErrorMsg(`Invalid data (${t}). Data being written must be convertible to a string`)}const r=t.getServer();if(null==r)throw e.makeRuntimeErrorMsg("Error getting Server. This is a bug. Report to dev.");if(Object(y.a)(n)){let e=t.getScriptOnServer(n,r);return null==e?(e=new p.a(h.a,n,a,r.hostname,r.scripts),r.scripts.push(e),e.updateRamUsage(h.a,r.scripts)):("w"===o?e.code=a:e.code+=a,e.updateRamUsage(h.a,r.scripts))}{const t=Object(x.c)(n,r);if(null==t)return Object(x.b)(n,a,r),Promise.resolve();"w"===o?t.write(a):t.append(a)}return Promise.resolve()}throw e.makeRuntimeErrorMsg("Invalid argument: "+i)},tryWritePort:t=>(e,n="")=>{let a=t.helper.number("port",e);if("string"!=typeof n&&"number"!=typeof n)throw ct("tryWritePort","Trying to write invalid data to a port: only strings and numbers are valid.");if(isNaN(a))throw t.makeRuntimeErrorMsg("Invalid argument: "+a);{if(a=Math.round(a),a<1||a>l.a.NumNetscriptPorts)throw ct("tryWritePort",`Invalid port: ${a}. Only ports 1-${l.a.NumNetscriptPorts} are valid.`);const e=C.a[a-1];if(null==e||!(e instanceof Object))throw t.makeRuntimeErrorMsg(`Could not find port: ${a}. This is a bug. Report to dev.`);return Promise.resolve(e.tryWrite(n))}},readPort:t=>e=>{const n=t.helper.number("port",e);return mt.getValidPort("readPort",n).read()},read:e=>n=>{const a=e.helper.string("port",n);if(Object(P.a)(a)){const n=a,r=Object(E.d)(t.hostname);if(null==r)throw e.makeRuntimeErrorMsg("Error getting Server. This is a bug. Report to dev.");if(Object(y.a)(n)){const e=t.getScriptOnServer(n,r);return null==e?"":e.code}{const t=Object(x.c)(n,r);return null!==t?t.text:""}}throw e.makeRuntimeErrorMsg("Invalid argument: "+a)},peek:t=>e=>{const n=t.helper.number("port",e);return mt.getValidPort("peek",n).peek()},clear:e=>n=>{const a=e.helper.string("file",n);if(!Object(P.a)(a))throw e.makeRuntimeErrorMsg("Invalid argument: "+a);{const n=a,r=Object(E.d)(t.hostname);if(null==r)throw e.makeRuntimeErrorMsg("Error getting Server. This is a bug. Report to dev.");const i=Object(x.c)(n,r);null!=i&&i.write("")}},clearPort:t=>e=>{const n=t.helper.number("port",e);mt.getValidPort("clearPort",n).clear()},getPortHandle:t=>e=>{const n=t.helper.number("port",e);return mt.getValidPort("getPortHandle",n)},rm:n=>(a,r)=>{const i=n.helper.string("fn",a);null!=r&&""!==r||(r=t.hostname);const o=e(r,n).removeFile(i);return o.res||n.log(()=>o.msg+""),o.res},scriptRunning:t=>(n,a)=>{const r=t.helper.string("scriptname",n),i=t.helper.string("hostname",a),o=e(i,t);for(let t=0;t(n,a)=>{const r=t.helper.string("scriptname",n),i=t.helper.string("hostname",a),o=e(i,t);let s=!1;for(let t=0;t()=>t.name,getScriptRam:n=>(a,r=t.hostname)=>{const i=n.helper.string("scriptname",a),o=n.helper.string("hostname",r),s=e(o,n);for(let t=0;t(r,i,...o)=>{let s;return s=void 0===r&&void 0===i&&0===o.length?t.scriptRef:"number"==typeof r?a(r):n(e,r,i,o),null===s?null:ot(s)},getHackTime:n=>(a=t.hostname)=>{const r=n.helper.string("hostname",a),i=e(r,n);return i instanceof _.a?lt(i,"getHackTime")?1/0:1e3*Object(c.d)(i,h.a):(n.log(()=>"invalid for this kind of server"),1/0)},getGrowTime:n=>(a=t.hostname)=>{const r=n.helper.string("hostname",a),i=e(r,n);return i instanceof _.a?lt(i,"getGrowTime")?1/0:1e3*Object(c.a)(i,h.a):(n.log(()=>"invalid for this kind of server"),1/0)},getWeakenTime:n=>(a=t.hostname)=>{const r=n.helper.string("hostname",a),i=e(r,n);return i instanceof _.a?lt(i,"getWeakenTime")?1/0:1e3*Object(c.f)(i,h.a):(n.log(()=>"invalid for this kind of server"),1/0)},getScriptIncome:t=>(n,a,...r)=>{if(void 0===n){const t=[];let e=0;for(const t of O.a.values())e+=t.scriptRef.onlineMoneyMade/t.scriptRef.onlineRunningTime;return t.push(e),t.push(h.a.scriptProdSinceLastAug/(h.a.playtimeSinceLastAug/1e3)),t}{const i=e(a,t),o=Object(g.a)(n,r,i);return null==o?(t.log(()=>`No such script '${n}' on '${i.hostname}' with args: ${Object(N.a)(r)}`),-1):o.onlineMoneyMade/o.onlineRunningTime}},getScriptExpGain:t=>(n,a,...r)=>{if(void 0===n){let t=0;for(const e of O.a.values())t+=e.scriptRef.onlineExpGained/e.scriptRef.onlineRunningTime;return t}{const i=e(a,t),o=Object(g.a)(n,r,i);return null==o?(t.log(()=>`No such script '${n}' on '${i.hostname}' with args: ${Object(N.a)(r)}`),-1):o.onlineExpGained/o.onlineRunningTime}},nFormat:t=>(e,n)=>{const a=t.helper.number("n",e),r=t.helper.string("format",n);return isNaN(a)?"":T.a.format(a,r)},tFormat:t=>(e,n=!1)=>{const a=t.helper.number("milliseconds",e),r=mt.boolean(n);return Object(A.d)(a,r)},getTimeSinceLastAug:()=>()=>h.a.playtimeSinceLastAug,alert:t=>e=>{const n=t.helper.string("message",e);Object(J.a)(n)},toast:t=>(e,n=X.d.SUCCESS,a=2e3)=>{const r=t.helper.string("message",e),i=t.helper.string("variant",n);if(!Object(Q.a)(X.d,i))throw new Error("variant must be one of "+Object.values(X.d).join(", "));X.b.emit(r,i,a)},prompt:t=>(e,n)=>{const a=t.helper.string("txt",e);return new Promise((function(t){b.a.emit({txt:a,options:n,resolve:t})}))},wget:n=>async(a,i,o=t.hostname)=>{const s=n.helper.string("url",a),l=n.helper.string("target",i),c=n.helper.string("hostname",o);if(!Object(y.a)(l)&&!l.endsWith(".txt"))return n.log(()=>`Invalid target file: '${l}'. Must be a script or text file.`),Promise.resolve(!1);const f=e(c,n);return new Promise((function(t){r.a.get(s,(function(e){let a;return a=Object(y.a)(l)?f.writeToScriptFile(h.a,l,e):f.writeToTextFile(l,e),a.success?a.overwritten?(n.log(()=>`Successfully retrieved content and overwrote '${l}' on '${c}'`),t(!0)):(n.log(()=>`Successfully retrieved content to new file '${l}' on '${c}'`),t(!0)):(n.log(()=>"Failed."),t(!1))}),"text").fail((function(e){return n.log(()=>JSON.stringify(e)),t(!1)}))}))},getFavorToDonate:()=>()=>Math.floor(l.a.BaseFavorToDonate*s.a.RepToDonateToFaction),getOwnedSourceFiles:()=>()=>{const t=[];for(let e=0;e()=>{const t={hacking:h.a.hacking,hp:h.a.hp,max_hp:h.a.max_hp,strength:h.a.strength,defense:h.a.defense,dexterity:h.a.dexterity,agility:h.a.agility,charisma:h.a.charisma,intelligence:h.a.intelligence,hacking_chance_mult:h.a.hacking_chance_mult,hacking_speed_mult:h.a.hacking_speed_mult,hacking_money_mult:h.a.hacking_money_mult,hacking_grow_mult:h.a.hacking_grow_mult,hacking_exp:h.a.hacking_exp,strength_exp:h.a.strength_exp,defense_exp:h.a.defense_exp,dexterity_exp:h.a.dexterity_exp,agility_exp:h.a.agility_exp,charisma_exp:h.a.charisma_exp,hacking_mult:h.a.hacking_mult,strength_mult:h.a.strength_mult,defense_mult:h.a.defense_mult,dexterity_mult:h.a.dexterity_mult,agility_mult:h.a.agility_mult,charisma_mult:h.a.charisma_mult,hacking_exp_mult:h.a.hacking_exp_mult,strength_exp_mult:h.a.strength_exp_mult,defense_exp_mult:h.a.defense_exp_mult,dexterity_exp_mult:h.a.dexterity_exp_mult,agility_exp_mult:h.a.agility_exp_mult,charisma_exp_mult:h.a.charisma_exp_mult,company_rep_mult:h.a.company_rep_mult,faction_rep_mult:h.a.faction_rep_mult,numPeopleKilled:h.a.numPeopleKilled,money:h.a.money,city:h.a.city,location:h.a.location,companyName:h.a.companyName,crime_money_mult:h.a.crime_money_mult,crime_success_mult:h.a.crime_success_mult,isWorking:h.a.isWorking,workType:h.a.workType,currentWorkFactionName:h.a.currentWorkFactionName,currentWorkFactionDescription:h.a.currentWorkFactionDescription,workHackExpGainRate:h.a.workHackExpGainRate,workStrExpGainRate:h.a.workStrExpGainRate,workDefExpGainRate:h.a.workDefExpGainRate,workDexExpGainRate:h.a.workDexExpGainRate,workAgiExpGainRate:h.a.workAgiExpGainRate,workChaExpGainRate:h.a.workChaExpGainRate,workRepGainRate:h.a.workRepGainRate,workMoneyGainRate:h.a.workMoneyGainRate,workMoneyLossRate:h.a.workMoneyLossRate,workHackExpGained:h.a.workHackExpGained,workStrExpGained:h.a.workStrExpGained,workDefExpGained:h.a.workDefExpGained,workDexExpGained:h.a.workDexExpGained,workAgiExpGained:h.a.workAgiExpGained,workChaExpGained:h.a.workChaExpGained,workRepGained:h.a.workRepGained,workMoneyGained:h.a.workMoneyGained,createProgramName:h.a.createProgramName,createProgramReqLvl:h.a.createProgramReqLvl,className:h.a.className,crimeType:h.a.crimeType,work_money_mult:h.a.work_money_mult,hacknet_node_money_mult:h.a.hacknet_node_money_mult,hacknet_node_purchase_cost_mult:h.a.hacknet_node_purchase_cost_mult,hacknet_node_ram_cost_mult:h.a.hacknet_node_ram_cost_mult,hacknet_node_core_cost_mult:h.a.hacknet_node_core_cost_mult,hacknet_node_level_cost_mult:h.a.hacknet_node_level_cost_mult,hasWseAccount:h.a.hasWseAccount,hasTixApiAccess:h.a.hasTixApiAccess,has4SData:h.a.has4SData,has4SDataTixApi:h.a.has4SDataTixApi,bladeburner_max_stamina_mult:h.a.bladeburner_max_stamina_mult,bladeburner_stamina_gain_mult:h.a.bladeburner_stamina_gain_mult,bladeburner_analysis_mult:h.a.bladeburner_analysis_mult,bladeburner_success_chance_mult:h.a.bladeburner_success_chance_mult,bitNodeN:h.a.bitNodeN,totalPlaytime:h.a.totalPlaytime,playtimeSinceLastAug:h.a.playtimeSinceLastAug,playtimeSinceLastBitnode:h.a.playtimeSinceLastBitnode,jobs:{},factions:h.a.factions.slice(),tor:h.a.hasTorRouter(),inBladeburner:h.a.inBladeburner(),hasCorporation:h.a.hasCorporation(),entropy:h.a.entropy};return Object.assign(t.jobs,h.a.jobs),t},atExit:e=>n=>{if("function"!=typeof n)throw e.makeRuntimeErrorMsg("argument should be function");t.atExit=()=>{n()}},mv:t=>(n,a,r)=>{const i=t.helper.string("host",n),o=t.helper.string("source",a),s=t.helper.string("destination",r);if(!Object(S.j)(o))throw t.makeRuntimeErrorMsg(`Invalid filename: '${o}'`);if(!Object(S.j)(s))throw t.makeRuntimeErrorMsg(`Invalid filename: '${s}'`);const l=o.endsWith(".txt"),c=s.endsWith(".txt");if(!Object(y.a)(o)&&!l)throw t.makeRuntimeErrorMsg("'mv' can only be used on scripts and text files (.txt)");if(l!=c)throw t.makeRuntimeErrorMsg("Source and destination files must have the same type");if(o===s)return;const f=e(i,t);if(!l&&f.isRunning(o))throw t.makeRuntimeErrorMsg("Cannot use 'mv' on a script that is running");const u=l?f.textFiles:f.scripts;let m=null,h=null;for(let t=0;t[t,!0]));return Object(rt.a)(mt,{},t,dt)}},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(153),r=n(103);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()e&&(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);console.log(u),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(10);function r(t,e){return t/a.a.DonateMoneyToRepDivisor*e.faction_rep_mult}},,,,,,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, .ns, .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, .ns, .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(25),o=n(254),s=n(10);!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(33);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(33);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(154);function r(t){const e={},n=Object.keys(a.a);for(let a=0;a{var e;return c.a.createElement(a.a,{sx:{height:"fit-content",p:1}},c.a.createElement(r.a,{variant:"h6"},t.title),(null===(e=t.children)||void 0===e?void 0:e.length)>1?c.a.createElement(i.a,{disablePadding:!0,dense:!0},t.children.filter(t=>t).map((t,e)=>c.a.createElement(o.a,{key:Object(s.uniqueId)(String(e)),sx:{px:0,display:"block"}},t))):t.children)}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));class a{constructor(t){this.cards=t}addCards(...t){return new a([...this.cards,...t])}removeByIndex(t){if(t>=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(1),i=n(21),o=n(8);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(19),r=n(148),i=n(0),o=n(1390),s=n(649),l=n(101);function c(t){const e=new o.a(t.width,t.height,t.fragments),n=Object(l.a)(e),c=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,activeGrid:n,ghostGrid:c,gift:e,enter:()=>{},click:()=>{}})))}},,,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var a=n(116),r=n(255),i=n(83),o=n(225),s=n(100),l=n(340),c=n(321);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(38),o=n(29),s=n(125),l=n(1),c=n(8);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 b}));var a=n(767),r=n(685),i=n(686),o=n(394),s=n(43),l=n(439),c=n(9),f=n(377),u=n(15),m=n(385),h=n(28),d=n(22),p=n(33),g=n(10),y=n(34);class b{constructor(){this.hacking=1,this.hp=10,this.max_hp=10,this.strength=1,this.defense=1,this.dexterity=1,this.agility=1,this.charisma=1,this.intelligence=0,this.hacking_chance_mult=1,this.hacking_speed_mult=1,this.hacking_money_mult=1,this.hacking_grow_mult=1,this.hacking_exp=0,this.strength_exp=0,this.defense_exp=0,this.dexterity_exp=0,this.agility_exp=0,this.charisma_exp=0,this.intelligence_exp=0,this.hacking_mult=1,this.strength_mult=1,this.defense_mult=1,this.dexterity_mult=1,this.agility_mult=1,this.charisma_mult=1,this.hacking_exp_mult=1,this.strength_exp_mult=1,this.defense_exp_mult=1,this.dexterity_exp_mult=1,this.agility_exp_mult=1,this.charisma_exp_mult=1,this.company_rep_mult=1,this.faction_rep_mult=1,this.money=1e3+g.a.Donations,this.city=u.a.Sector12,this.location=c.a.TravelAgency,this.jobs={},this.companyName="",this.currentServer="",this.purchasedServers=[],this.hacknetNodes=[],this.hashManager=new f.a,this.factions=[],this.factionInvitations=[],this.queuedAugmentations=[],this.augmentations=[],this.sourceFiles=[],this.numPeopleKilled=0,this.karma=0,this.crime_money_mult=1,this.crime_success_mult=1,this.isWorking=!1,this.focus=!1,this.workType=y.d.None,this.workCostMult=1,this.workExpMult=1,this.currentWorkFactionName="",this.currentWorkFactionDescription="",this.workHackExpGainRate=0,this.workStrExpGainRate=0,this.workDefExpGainRate=0,this.workDexExpGainRate=0,this.workAgiExpGainRate=0,this.workChaExpGainRate=0,this.workRepGainRate=0,this.workMoneyGainRate=0,this.workMoneyLossRate=0,this.workHackExpGained=0,this.workStrExpGained=0,this.workDefExpGained=0,this.workDexExpGained=0,this.workAgiExpGained=0,this.workChaExpGained=0,this.workRepGained=0,this.workMoneyGained=0,this.createProgramName="",this.createProgramReqLvl=0,this.graftAugmentationName="",this.timeWorkedGraftAugmentation=0,this.className=y.a.None,this.crimeType=y.b.None,this.timeWorked=0,this.timeWorkedCreateProgram=0,this.timeNeededToCompleteWork=0,this.work_money_mult=1,this.hacknet_node_money_mult=1,this.hacknet_node_purchase_cost_mult=1,this.hacknet_node_ram_cost_mult=1,this.hacknet_node_core_cost_mult=1,this.hacknet_node_level_cost_mult=1,this.hasWseAccount=!1,this.hasTixApiAccess=!1,this.has4SData=!1,this.has4SDataTixApi=!1,this.gang=null,this.corporation=null,this.bladeburner=null,this.bladeburner_max_stamina_mult=1,this.bladeburner_stamina_gain_mult=1,this.bladeburner_analysis_mult=1,this.bladeburner_success_chance_mult=1,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 m.a,this.moneySourceB=new m.a,this.scriptProdSinceLastAug=0,this.exploits=[],this.achievements=[],this.terminalCommandHistory=[],this.identifier=Object(d.e)("I-"+(new Date).getTime()+navigator.userAgent+window.innerWidth+window.innerHeight+Object(p.a)(100,999)),this.init=s.hb,this.prestigeAugmentation=s.kb,this.prestigeSourceFile=s.lb,this.receiveInvite=s.tb,this.calculateSkill=s.o,this.calculateSkillProgress=s.p,this.updateSkillLevels=s.Sb,this.resetMultipliers=s.wb,this.hasProgram=s.fb,this.setMoney=s.zb,this.gainMoney=s.M,this.loseMoney=s.jb,this.canAfford=s.s,this.recordMoneySource=s.ub,this.gainHackingExp=s.K,this.gainStrengthExp=s.O,this.gainDefenseExp=s.I,this.gainDexterityExp=s.J,this.gainAgilityExp=s.F,this.gainCharismaExp=s.G,this.gainIntelligenceExp=s.L,this.gainStats=s.N,this.queryStatFromString=s.ob,this.resetWorkStatus=s.xb,this.processWorkEarnings=s.nb,this.startWork=s.Mb,this.cancelationPenalty=s.t,this.work=s.Tb,this.finishWork=s.D,this.startWorkPartTime=s.Nb,this.workPartTime=s.Vb,this.finishWorkPartTime=s.E,this.startFocusing=s.Kb,this.stopFocusing=s.Ob,this.startFactionWork=s.Jb,this.startFactionHackWork=s.Hb,this.startFactionFieldWork=s.Gb,this.startFactionSecurityWork=s.Ib,this.workForFaction=s.Ub,this.finishFactionWork=s.B,this.getWorkMoneyGain=s.Y,this.getWorkHackExpGain=s.X,this.getWorkStrExpGain=s.ab,this.getWorkDefExpGain=s.V,this.getWorkDexExpGain=s.W,this.getWorkAgiExpGain=s.T,this.getWorkChaExpGain=s.U,this.getWorkRepGain=s.Z,this.process=s.mb,this.startCreateProgramWork=s.Eb,this.createProgramWork=s.x,this.finishCreateProgramWork=s.z,this.startGraftAugmentationWork=s.Lb,this.graftAugmentationWork=s.w,this.finishGraftAugmentationWork=s.C,this.startClass=s.Db,this.takeClass=s.Pb,this.finishClass=s.y,this.startCrime=s.Fb,this.commitCrime=s.v,this.finishCrime=s.A,this.singularityStopWork=s.Bb,this.takeDamage=s.Qb,this.regenerateHp=s.vb,this.hospitalize=s.gb,this.applyForJob=s.f,this.getNextCompanyPosition=s.S,this.quitJob=s.qb,this.hasJob=s.eb,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.ib,this.reapplyAllAugmentations=s.rb,this.reapplyAllSourceFiles=s.sb,this.checkForFactionInvitations=s.u,this.setBitNodeNumber=s.yb,this.queueAugmentation=s.pb,this.gainCodingContractReward=s.H,this.travel=s.Rb,this.gotoLocation=s.db,this.canAccessGrafting=s.r,this.giveExploit=s.cb,this.giveAchievement=s.bb,this.getIntelligenceBonus=s.Q,this.getCasinoWinnings=s.P,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.factionWorkType=y.c.None,this.committingCrimeThruSingFn=!1,this.singFnCrimeWorkerScript=null,this.getMult=s.R,this.setMult=s.Ab,this.canAccessCotMG=s.q,this.sourceFileLvl=s.Cb,this.applyEntropy=a.a}whoAmI(){return"Player"}toJSON(){return Object(h.b)("PlayerObject",this)}static fromJSON(t){return Object(h.a)(b,t.data)}}h.c.constructors.PlayerObject=b},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(38),s=n(29),l=n(125),c=n(1),f=n(8);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(256),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 @@ -16,5 +16,5 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */r.PARSE_OPTIONS={ecmaVersion:5,locations:!0},r.READONLY_DESCRIPTOR={configurable:!0,enumerable:!0,writable:!1},r.NONENUMERABLE_DESCRIPTOR={configurable:!0,enumerable:!1,writable:!0},r.READONLY_NONENUMERABLE_DESCRIPTOR={configurable:!0,enumerable:!1,writable:!1},r.VARIABLE_DESCRIPTOR={configurable:!1,enumerable:!0,writable:!0},r.STEP_ERROR={},r.SCOPE_REFERENCE={},r.VALUE_IN_DESCRIPTOR={},r.toStringCycles_=[],r.prototype.getErrorLineNumber=function(t){var e=this.sourceCode;if(null==t||null==t.start)return NaN;try{return((e=e.substring(0,t.start)).match(/\n/g)||[]).length+1-this.sourceCodeLineOffset}catch(t){return NaN}},r.prototype.getErrorLineNumberMessage=function(t){return isNaN(t)?" (Unknown line number)":t<=0?" (Error occurred in an imported function)":" (Line Number "+t+". This line number is probably incorrect if your script is importing any functions. This is being worked on)"},r.prototype.appendCode=function(t){var e=this.stateStack[0];if(!e||"Program"!==e.node.type)throw Error("Expecting original AST to start with a Program node.");if("string"==typeof t&&(t=a.a(t,r.PARSE_OPTIONS)),!t||"Program"!==t.type)throw Error("Expecting new AST to start with a Program node.");this.populateScope_(t,e.scope);for(var n,i=0;n=t.body[i];i++)e.node.body.push(n);e.done=!1},r.prototype.step=function(){var t=this.stateStack,e=t[t.length-1];if(!e)return!1;var n=e.node,a=n.type;if("Program"===a&&e.done)return!1;if(this.paused_)return!0;try{var i=this.stepFunctions_[a](t,e,n)}catch(t){if(t!==r.STEP_ERROR)throw t}return i&&t.push(i),!!n.end||this.step()},r.prototype.run=function(){for(;!this.paused_&&this.step(););return this.paused_},r.prototype.initGlobalScope=function(t){this.setProperty(t,"NaN",NaN,r.READONLY_DESCRIPTOR),this.setProperty(t,"Infinity",1/0,r.READONLY_DESCRIPTOR),this.setProperty(t,"undefined",void 0,r.READONLY_DESCRIPTOR),this.setProperty(t,"window",t,r.READONLY_DESCRIPTOR),this.setProperty(t,"this",t,r.READONLY_DESCRIPTOR),this.setProperty(t,"self",t),this.OBJECT_PROTO=new r.Object(null),this.FUNCTION_PROTO=new r.Object(this.OBJECT_PROTO),this.initFunction(t),this.initObject(t),t.proto=this.OBJECT_PROTO,this.setProperty(t,"constructor",this.OBJECT,r.NONENUMERABLE_DESCRIPTOR),this.initArray(t),this.initString(t),this.initBoolean(t),this.initNumber(t),this.initDate(t),this.initRegExp(t),this.initError(t),this.initMath(t),this.initJSON(t);var e=this,n=this.createNativeFunction((function(t){throw EvalError("Can't happen")}),!1);n.eval=!0,this.setProperty(t,"eval",n),this.setProperty(t,"parseInt",this.createNativeFunction(parseInt,!1)),this.setProperty(t,"parseFloat",this.createNativeFunction(parseFloat,!1)),this.setProperty(t,"isNaN",this.createNativeFunction(isNaN,!1)),this.setProperty(t,"isFinite",this.createNativeFunction(isFinite,!1));for(var a=[[escape,"escape"],[unescape,"unescape"],[decodeURI,"decodeURI"],[decodeURIComponent,"decodeURIComponent"],[encodeURI,"encodeURI"],[encodeURIComponent,"encodeURIComponent"]],i=0;i>> 0;","if (arguments.length > 1) T = thisArg;","k = 0;","while (k < len) {","if (k in O && !callbackfn.call(T, O[k], k, O)) return false;","k++;","}","return true;","}","});","Object.defineProperty(Array.prototype, 'filter',","{configurable: true, writable: true, value:","function(fun/*, thisArg*/) {","if (this === void 0 || this === null || typeof fun !== 'function') throw TypeError();","var t = Object(this);","var len = t.length >>> 0;","var res = [];","var thisArg = arguments.length >= 2 ? arguments[1] : void 0;","for (var i = 0; i < len; i++) {","if (i in t) {","var val = t[i];","if (fun.call(thisArg, val, i, t)) res.push(val);","}","}","return res;","}","});","if (!Array.prototype.find) {","Object.defineProperty(Array.prototype, 'find', {","value: function(predicate) {","if (this == null) {","throw new TypeError('\"this\" is null or not defined');","}","var o = Object(this);","var len = o.length >>> 0;","if (typeof predicate !== 'function') {","throw new TypeError('predicate must be a function');","}","var thisArg = arguments[1];","var k = 0;","while (k < len) {","var kValue = o[k];","if (predicate.call(thisArg, kValue, k, o)) {","return kValue;","}","k++;","}","return undefined;","},","configurable: true,","writable: true","});","}","if (!Array.prototype.findIndex) {","Object.defineProperty(Array.prototype, 'findIndex', {","value: function(predicate) {","if (this == null) {","throw new TypeError('\"this\" is null or not defined');","}","var o = Object(this);","var len = o.length >>> 0;","if (typeof predicate !== 'function') {","throw new TypeError('predicate must be a function');","}","var thisArg = arguments[1];","var k = 0;","while (k < len) {","var kValue = o[k];","if (predicate.call(thisArg, kValue, k, o)) {","return k;","}","k++;","}","return -1;","},","configurable: true,","writable: true","});","}","Object.defineProperty(Array.prototype, 'forEach',","{configurable: true, writable: true, value:","function(callback, thisArg) {","if (!this || typeof callback !== 'function') throw TypeError();","var T, k;","var O = Object(this);","var len = O.length >>> 0;","if (arguments.length > 1) T = thisArg;","k = 0;","while (k < len) {","if (k in O) callback.call(T, O[k], k, O);","k++;","}","}","});","Object.defineProperty(Array.prototype, 'includes', {","value: function(searchElement, fromIndex) {","if (this == null) {","throw new TypeError('\"this\" is null or not defined');","}","// 1. Let O be ? ToObject(this value).","var o = Object(this);",'// 2. Let len be ? ToLength(? Get(O, "length")).',"var len = o.length >>> 0;","// 3. If len is 0, return false.","if (len === 0) {","return false;","}","// 4. Let n be ? ToInteger(fromIndex).","// (If fromIndex is undefined, this step produces the value 0.)","var n = fromIndex | 0;","// 5. If n ≥ 0, then","// a. Let k be n.","// 6. Else n < 0,","// a. Let k be len + n.","// b. If k < 0, let k be 0.","var k = Math.max(n >= 0 ? n : len - Math.abs(n), 0);","function sameValueZero(x, y) {","return x === y || (typeof x === 'number' && typeof y === 'number' && isNaN(x) && isNaN(y));","}","// 7. Repeat, while k < len","while (k < len) {","// a. Let elementK be the result of ? Get(O, ! ToString(k)).","// b. If SameValueZero(searchElement, elementK) is true, return true.","if (sameValueZero(o[k], searchElement)) {","return true;","}","// c. Increase k by 1. ","k++;","}","// 8. Return false","return false;","}","});","Object.defineProperty(Array.prototype, 'map',","{configurable: true, writable: true, value:","function(callback, thisArg) {","if (!this || typeof callback !== 'function') new TypeError;","var T, A, k;","var O = Object(this);","var len = O.length >>> 0;","if (arguments.length > 1) T = thisArg;","A = new Array(len);","k = 0;","while (k < len) {","if (k in O) A[k] = callback.call(T, O[k], k, O);","k++;","}","return A;","}","});","Object.defineProperty(Array.prototype, 'reduce',","{configurable: true, writable: true, value:","function(callback /*, initialValue*/) {","if (!this || typeof callback !== 'function') throw TypeError();","var t = Object(this), len = t.length >>> 0, k = 0, value;","if (arguments.length === 2) {","value = arguments[1];","} else {","while (k < len && !(k in t)) k++;","if (k >= len) {","throw TypeError('Reduce of empty array with no initial value');","}","value = t[k++];","}","for (; k < len; k++) {","if (k in t) value = callback(value, t[k], k, t);","}","return value;","}","});","Object.defineProperty(Array.prototype, 'reduceRight',","{configurable: true, writable: true, value:","function(callback /*, initialValue*/) {","if (null === this || 'undefined' === typeof this || 'function' !== typeof callback) throw TypeError();","var t = Object(this), len = t.length >>> 0, k = len - 1, value;","if (arguments.length >= 2) {","value = arguments[1];","} else {","while (k >= 0 && !(k in t)) k--;","if (k < 0) {","throw TypeError('Reduce of empty array with no initial value');","}","value = t[k--];","}","for (; k >= 0; k--) {","if (k in t) value = callback(value, t[k], k, t);","}","return value;","}","});","Object.defineProperty(Array.prototype, 'some',","{configurable: true, writable: true, value:","function(fun/*, thisArg*/) {","if (!this || typeof fun !== 'function') throw TypeError();","var t = Object(this);","var len = t.length >>> 0;","var thisArg = arguments.length >= 2 ? arguments[1] : void 0;","for (var i = 0; i < len; i++) {","if (i in t && fun.call(thisArg, t[i], i, t)) {","return true;","}","}","return false;","}","});","(function() {","var sort_ = Array.prototype.sort;","Array.prototype.sort = function(opt_comp) {","if (typeof opt_comp !== 'function') {","return sort_.call(this);","}","for (var i = 0; i < this.length; i++) {","var changes = 0;","for (var j = 0; j < this.length - i - 1; j++) {","if (opt_comp(this[j], this[j + 1]) > 0) {","var swap = this[j];","this[j] = this[j + 1];","this[j + 1] = swap;","changes++;","}","}","if (!changes) break;","}","return this;","};","})();","Object.defineProperty(Array.prototype, 'toLocaleString',","{configurable: true, writable: true, value:","function() {","var out = [];","for (var i = 0; i < this.length; i++) {","out[i] = (this[i] === null || this[i] === undefined) ? '' : this[i].toLocaleString();","}","return out.join(',');","}","});","")},r.prototype.initString=function(t){var e,n=this;e=function(t){return t=String(t),n.calledWithNew()?(this.data=t,this):t},this.STRING=this.createNativeFunction(e,!0),this.setProperty(t,"String",this.STRING),this.setProperty(this.STRING,"fromCharCode",this.createNativeFunction(String.fromCharCode,!1),r.NONENUMERABLE_DESCRIPTOR);for(var a=["charAt","charCodeAt","concat","indexOf","lastIndexOf","slice","substr","substring","toLocaleLowerCase","toLocaleUpperCase","toLowerCase","toUpperCase","trim"],i=0;i= 0; i--) {","str = str.substring(0, subs[i][0]) + subs[i][2] + str.substring(subs[i][0] + subs[i][1]);","}","} else {","var i = str.indexOf(substr);","if (i !== -1) {","var inject = newSubstr(str.substr(i, substr.length), i, str);","str = str.substring(0, i) + inject + str.substring(i + substr.length);","}","}","return str;","};","})();","if (!String.prototype.endsWith) {","String.prototype.endsWith = function(search, this_len) {","if (this_len === undefined || this_len > this.length) {","this_len = this.length;","}","return this.substring(this_len - search.length, this_len) === search;","};","}","if (!String.prototype.includes) {","String.prototype.includes = function(search, start) {","'use strict';","if (typeof start !== 'number') {","start = 0;","}"," ","if (start + search.length > this.length) {","return false;","} else {","return this.indexOf(search, start) !== -1;","}","};","}","if (!String.prototype.startsWith) {","String.prototype.startsWith = function(search, pos) {","return this.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;","};","}","")},r.prototype.initBoolean=function(t){var e,n=this;e=function(t){return t=Boolean(t),n.calledWithNew()?(this.data=t,this):t},this.BOOLEAN=this.createNativeFunction(e,!0),this.setProperty(t,"Boolean",this.BOOLEAN)},r.prototype.initNumber=function(t){var e,n=this;e=function(t){return t=Number(t),n.calledWithNew()?(this.data=t,this):t},this.NUMBER=this.createNativeFunction(e,!0),this.setProperty(t,"Number",this.NUMBER);for(var a=["MAX_VALUE","MIN_VALUE","NaN","NEGATIVE_INFINITY","POSITIVE_INFINITY"],i=0;i>>0;return e===Number(t)?e:NaN},r.legalArrayIndex=function(t){var e=t>>>0;return String(e)===String(t)&&4294967295!==e?e:NaN},r.Value,r.Object=function(t){this.getter=Object.create(null),this.setter=Object.create(null),this.properties=Object.create(null),this.proto=t},r.Object.prototype.proto=null,r.Object.prototype.isObject=!0,r.Object.prototype.class="Object",r.Object.prototype.data=null,r.Object.prototype.toString=function(){if("Array"===this.class){(a=r.toStringCycles_).push(this);try{for(var t=[],e=0;e0;i.pop()){var o=i[i.length-1];switch(o.node.type){case"TryStatement":return void(o.cv={type:t,value:e,label:n});case"CallExpression":case"NewExpression":if(t===r.Completion.RETURN)return void(o.value=e);if(t!==r.Completion.THROW)throw Error("Unsynatctic break/continue not rejected by Acorn")}if(t===r.Completion.BREAK){if(n?o.labels&&-1!==o.labels.indexOf(n):o.isLoop||o.isSwitch)return void i.pop()}else if(t===r.Completion.CONTINUE&&(n?o.labels&&-1!==o.labels.indexOf(n):o.isLoop))return}var s;if(this.isa(e,this.ERROR)){var l={EvalError:EvalError,RangeError:RangeError,ReferenceError:ReferenceError,SyntaxError:SyntaxError,TypeError:TypeError,URIError:URIError},c=this.getProperty(e,"name").toString(),f=this.getProperty(e,"message").valueOf();s=(t=l[c]||Error)(f+a)}else s=String(e)+a;throw s},r.prototype.createGetter_=function(t,e){var n=Array.isArray(e)?e[0]:e,a=new this.nodeConstructor;a.type="CallExpression";var i=new r.State(a,this.stateStack[this.stateStack.length-1].scope);return i.doneCallee_=!0,i.funcThis_=n,i.func_=t,i.doneArgs_=!0,i.arguments_=[],i},r.prototype.createSetter_=function(t,e,n){var a=Array.isArray(e)?e[0]:this.global,i=new this.nodeConstructor;i.type="CallExpression";var o=new r.State(i,this.stateStack[this.stateStack.length-1].scope);return o.doneCallee_=!0,o.funcThis_=a,o.func_=t,o.doneArgs_=!0,o.arguments_=[n],o},r.State=function(t,e){this.node=t,this.scope=e},r.prototype.stepArrayExpression=function(t,e,n){var a=n.elements,i=e.n_||0;for(e.array_?(this.setProperty(e.array_,i,e.value),i++):(e.array_=this.createObjectProto(this.ARRAY_PROTO),e.array_.properties.length=a.length);i>=":s>>=l;break;case">>>=":s>>>=l;break;case"&=":s&=l;break;case"^=":s^=l;break;case"|=":s|=l;break;default:throw SyntaxError("Unknown assignment expression: "+n.operator)}var c=this.setValue(e.leftReference_,s);if(c)return e.doneSetter_=!0,e.setterValue_=s,this.createSetter_(c,e.leftReference_,s);t.pop(),t[t.length-1].value=s},r.prototype.stepBinaryExpression=function(t,e,n){if(!e.doneLeft_)return e.doneLeft_=!0,new r.State(n.left,e.scope);if(!e.doneRight_)return e.doneRight_=!0,e.leftValue_=e.value,new r.State(n.right,e.scope);t.pop();var a,i=e.leftValue_,o=e.value;switch(n.operator){case"==":a=i==o;break;case"!=":a=i!=o;break;case"===":a=i===o;break;case"!==":a=i!==o;break;case">":a=i>o;break;case">=":a=i>=o;break;case"<":a=i>":a=i>>o;break;case">>>":a=i>>>o;break;case"in":if(!o||!o.isObject){let t=this.getErrorLineNumber(n);this.throwException(this.TYPE_ERROR,"'in' expects an object, not '"+o+"'",t)}a=this.hasProperty(o,i);break;case"instanceof":if(!this.isa(o,this.FUNCTION)){let t=this.getErrorLineNumber(n);this.throwException(this.TYPE_ERROR,"Right-hand side of instanceof is not an object",t)}a=!!i.isObject&&this.isa(i,o);break;default:throw SyntaxError("Unknown binary operator: "+n.operator)}t[t.length-1].value=a},r.prototype.stepBlockStatement=function(t,e,n){var a=e.n_||0,i=n.body[a];if(i)return e.n_=a+1,new r.State(i,e.scope);t.pop()},r.prototype.stepBreakStatement=function(t,e,n){var a=n.label&&n.label.name;this.unwind(r.Completion.BREAK,void 0,a)},r.prototype.stepCallExpression=function(t,e,n){if(!e.doneCallee_){e.doneCallee_=1;var i=new r.State(n.callee,e.scope);return i.components=!0,i}if(1===e.doneCallee_){e.doneCallee_=2;var o=e.value;if(Array.isArray(o)){if(e.func_=this.getValue(o,n),o[0]===r.SCOPE_REFERENCE?e.directEval_="eval"===o[1]:e.funcThis_=o[0],(o=e.func_)&&"object"==typeof o&&o.isGetter)return o.isGetter=!1,e.doneCallee_=1,this.createGetter_(o,e.value)}else e.func_=o;e.arguments_=[],e.n_=0}o=e.func_;if(!e.doneArgs_){if(0!==e.n_&&e.arguments_.push(e.value),n.arguments[e.n_])return new r.State(n.arguments[e.n_++],e.scope);if("NewExpression"===n.type){if(o.illegalConstructor){let t=this.getErrorLineNumber(n);this.throwException(this.TYPE_ERROR,o+" is not a constructor",t)}var s=o.properties.prototype;"object"==typeof s&&null!==s||(s=this.OBJECT_PROTO),e.funcThis_=this.createObjectProto(s),e.isConstructor=!0}else void 0===e.funcThis_&&(e.funcThis_=e.scope.strict?void 0:this.global);e.doneArgs_=!0}if(e.doneExec_)t.pop(),e.isConstructor&&"object"!=typeof e.value?t[t.length-1].value=e.funcThis_:t[t.length-1].value=e.value;else{if(e.doneExec_=!0,!o||!o.isObject){let t=this.getErrorLineNumber(n);this.throwException(this.TYPE_ERROR,o+" is not a function",t)}var l=o.node;if(l){for(var c=this.createScope(l.body,o.parentScope),f=0;ff?e.arguments_[f]:void 0;this.setProperty(c,u,m)}var h=this.createObjectProto(this.ARRAY_PROTO);for(f=0;fa.a.ServerMaxGrowthRate&&(s=a.a.ServerMaxGrowthRate);const l=o*(t.serverGrowth/100)*r.a.ServerGrowthRate,c=1+(i-1)/16;return Math.pow(s,l*n.hacking_grow_mult*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,"a",(function(){return o}));var a=n(4),r=n(79),i=n(26);function o(t,e){const n=t.augmentations.map(t=>t.name),o=[];function s(t){if(n.includes(t.name))return!1;if(o.includes(t))return!1;if(t.isSpecial)return!1;const e=["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"];for(const n of Object.keys(t.mults))if(e.includes(n))return!0;return!1}if(e.inGang()){const t=e.getGangFaction();for(const n of Object.keys(r.a)){const a=r.a[n];s(a)&&(t.playerReputation>a.getCost(e).repCost&&o.push(a))}}for(const t of e.factions){if(t===a.a.Bladeburners)continue;if(t===a.a.Netburners)continue;const n=i.a[t];if(null!=n)for(const t of n.augmentations){const a=r.a[t];s(a)&&(n.playerReputation>a.getCost(e).repCost&&o.push(a))}}return o}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a=new(n(125).a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var a=n(15),r=n(9),i=n(52);const o=[{city:a.a.Aevum,infiltrationData:{maxClearanceLevel:12,startingSecurityLevel:8.18},name:r.a.AevumAeroCorp,types:[i.a.Company]},{city:a.a.Aevum,infiltrationData:{maxClearanceLevel:15,startingSecurityLevel:8.19},name:r.a.AevumBachmanAndAssociates,types:[i.a.Company]},{city:a.a.Aevum,infiltrationData:{maxClearanceLevel:18,startingSecurityLevel:9.55},name:r.a.AevumClarkeIncorporated,types:[i.a.Company]},{city:a.a.Aevum,costMult:3,expMult:2,name:r.a.AevumCrushFitnessGym,types:[i.a.Gym]},{city:a.a.Aevum,infiltrationData:{maxClearanceLevel:37,startingSecurityLevel:17.02},name:r.a.AevumECorp,types:[i.a.Company,i.a.TechVendor],techVendorMaxRam:512,techVendorMinRam:128},{city:a.a.Aevum,infiltrationData:{maxClearanceLevel:25,startingSecurityLevel:15.54},name:r.a.AevumFulcrumTechnologies,types:[i.a.Company,i.a.TechVendor],techVendorMaxRam:1024,techVendorMinRam:256},{city:a.a.Aevum,infiltrationData:{maxClearanceLevel:12,startingSecurityLevel:7.89},name:r.a.AevumGalacticCybersystems,types:[i.a.Company]},{city:a.a.Aevum,infiltrationData:{maxClearanceLevel:6,startingSecurityLevel:3.29},name:r.a.AevumNetLinkTechnologies,types:[i.a.Company,i.a.TechVendor],techVendorMaxRam:64,techVendorMinRam:8},{city:a.a.Aevum,infiltrationData:{maxClearanceLevel:6,startingSecurityLevel:5.35},name:r.a.AevumPolice,types:[i.a.Company]},{city:a.a.Aevum,infiltrationData:{maxClearanceLevel:5,startingSecurityLevel:5.02},name:r.a.AevumRhoConstruction,types:[i.a.Company]},{city:a.a.Aevum,costMult:10,expMult:5,name:r.a.AevumSnapFitnessGym,types:[i.a.Gym]},{city:a.a.Aevum,costMult:4,expMult:3,name:r.a.AevumSummitUniversity,types:[i.a.University]},{city:a.a.Aevum,infiltrationData:{maxClearanceLevel:7,startingSecurityLevel:5.85},name:r.a.AevumWatchdogSecurity,types:[i.a.Company]},{city:a.a.Aevum,name:r.a.AevumCasino,types:[i.a.Casino]},{city:a.a.Chongqing,infiltrationData:{maxClearanceLevel:25,startingSecurityLevel:16.25},name:r.a.ChongqingKuaiGongInternational,types:[i.a.Company]},{city:a.a.Chongqing,infiltrationData:{maxClearanceLevel:18,startingSecurityLevel:12.59},name:r.a.ChongqingSolarisSpaceSystems,types:[i.a.Company]},{city:a.a.Ishima,infiltrationData:{maxClearanceLevel:12,startingSecurityLevel:5.02},name:r.a.IshimaNovaMedical,types:[i.a.Company]},{city:a.a.Ishima,infiltrationData:{maxClearanceLevel:10,startingSecurityLevel:3.2},name:r.a.IshimaOmegaSoftware,types:[i.a.Company,i.a.TechVendor],techVendorMaxRam:128,techVendorMinRam:4},{city:a.a.Ishima,infiltrationData:{maxClearanceLevel:25,startingSecurityLevel:5.38},name:r.a.IshimaStormTechnologies,types:[i.a.Company,i.a.TechVendor],techVendorMaxRam:512,techVendorMinRam:32},{city:a.a.NewTokyo,infiltrationData:{maxClearanceLevel:17,startingSecurityLevel:7.18},name:r.a.NewTokyoDefComm,types:[i.a.Company]},{city:a.a.NewTokyo,infiltrationData:{maxClearanceLevel:20,startingSecurityLevel:5.9},name:r.a.NewTokyoGlobalPharmaceuticals,types:[i.a.Company]},{city:a.a.NewTokyo,infiltrationData:{maxClearanceLevel:5,startingSecurityLevel:2.5},name:r.a.NewTokyoNoodleBar,types:[i.a.Company,i.a.Special]},{city:a.a.NewTokyo,infiltrationData:{maxClearanceLevel:25,startingSecurityLevel:5.52},name:r.a.NewTokyoVitaLife,types:[i.a.Company,i.a.Special]},{city:a.a.NewTokyo,name:r.a.NewTokyoArcade,types:[i.a.Special]},{city:a.a.Sector12,infiltrationData:{maxClearanceLevel:10,startingSecurityLevel:3.62},name:r.a.Sector12AlphaEnterprises,types:[i.a.Company,i.a.TechVendor],techVendorMaxRam:8,techVendorMinRam:2},{city:a.a.Sector12,infiltrationData:{maxClearanceLevel:25,startingSecurityLevel:10.59},name:r.a.Sector12BladeIndustries,types:[i.a.Company]},{city:a.a.Sector12,name:r.a.Sector12CIA,types:[i.a.Company]},{city:a.a.Sector12,infiltrationData:{maxClearanceLevel:15,startingSecurityLevel:4.66},name:r.a.Sector12CarmichaelSecurity,types:[i.a.Company]},{city:a.a.Sector12,name:r.a.Sector12CityHall,types:[i.a.Special]},{city:a.a.Sector12,infiltrationData:{maxClearanceLevel:12,startingSecurityLevel:5.9},name:r.a.Sector12DeltaOne,types:[i.a.Company]},{city:a.a.Sector12,name:r.a.Sector12FoodNStuff,types:[i.a.Company]},{city:a.a.Sector12,infiltrationData:{maxClearanceLevel:25,startingSecurityLevel:8.18},name:r.a.Sector12FourSigma,types:[i.a.Company]},{city:a.a.Sector12,infiltrationData:{maxClearanceLevel:17,startingSecurityLevel:6.02},name:r.a.Sector12IcarusMicrosystems,types:[i.a.Company]},{city:a.a.Sector12,expMult:1,costMult:1,name:r.a.Sector12IronGym,types:[i.a.Gym]},{city:a.a.Sector12,infiltrationData:{maxClearanceLevel:5,startingSecurityLevel:3.13},name:r.a.Sector12JoesGuns,types:[i.a.Company]},{city:a.a.Sector12,infiltrationData:{maxClearanceLevel:31,startingSecurityLevel:16.36},name:r.a.Sector12MegaCorp,types:[i.a.Company]},{city:a.a.Sector12,name:r.a.Sector12NSA,types:[i.a.Company,i.a.Special]},{city:a.a.Sector12,costMult:20,expMult:10,name:r.a.Sector12PowerhouseGym,types:[i.a.Gym]},{city:a.a.Sector12,costMult:3,expMult:2,name:r.a.Sector12RothmanUniversity,types:[i.a.University]},{city:a.a.Sector12,infiltrationData:{maxClearanceLevel:12,startingSecurityLevel:5.9},name:r.a.Sector12UniversalEnergy,types:[i.a.Company]},{city:a.a.Volhaven,infiltrationData:{maxClearanceLevel:15,startingSecurityLevel:3.59},name:r.a.VolhavenCompuTek,types:[i.a.Company,i.a.TechVendor],techVendorMaxRam:256,techVendorMinRam:8},{city:a.a.Volhaven,infiltrationData:{maxClearanceLevel:18,startingSecurityLevel:7.28},name:r.a.VolhavenHeliosLabs,types:[i.a.Company]},{city:a.a.Volhaven,infiltrationData:{maxClearanceLevel:15,startingSecurityLevel:4.35},name:r.a.VolhavenLexoCorp,types:[i.a.Company]},{city:a.a.Volhaven,costMult:7,expMult:4,name:r.a.VolhavenMilleniumFitnessGym,types:[i.a.Gym]},{city:a.a.Volhaven,infiltrationData:{maxClearanceLevel:50,startingSecurityLevel:8.53},name:r.a.VolhavenNWO,types:[i.a.Company]},{city:a.a.Volhaven,infiltrationData:{maxClearanceLevel:25,startingSecurityLevel:7.74},name:r.a.VolhavenOmniTekIncorporated,types:[i.a.Company,i.a.TechVendor],techVendorMaxRam:1024,techVendorMinRam:128},{city:a.a.Volhaven,infiltrationData:{maxClearanceLevel:22,startingSecurityLevel:6},name:r.a.VolhavenOmniaCybersystems,types:[i.a.Company]},{city:a.a.Volhaven,infiltrationData:{maxClearanceLevel:18,startingSecurityLevel:4.77},name:r.a.VolhavenSysCoreSecurities,types:[i.a.Company]},{city:a.a.Volhaven,costMult:5,expMult:4,name:r.a.VolhavenZBInstituteOfTechnology,types:[i.a.University]},{city:null,name:r.a.Hospital,types:[i.a.Hospital]},{city:null,name:r.a.Slums,types:[i.a.Slums]},{city:null,name:r.a.TravelAgency,types:[i.a.TravelAgency]},{city:null,name:r.a.WorldStockExchange,types:[i.a.StockMarket]},{city:a.a.Chongqing,name:r.a.ChongqingChurchOfTheMachineGod,types:[i.a.Special]},{city:a.a.Ishima,name:r.a.IshimaGlitch,types:[i.a.Special]}]},function(t,e,n){"use strict";n.d(e,"b",(function(){return l})),n.d(e,"a",(function(){return c}));var a=n(100),r=n(1063),i=n.n(r),o=n(1064),s=n.n(o);function l(t,e){const n=1==t.length||"*.*"===t?null:t.slice(1),r=new s.a,o=(t,e)=>{for(let a=0;at.filename),e.scripts.map(t=>t.code)),n&&!n.endsWith(".txt")||o(e.textFiles.map(t=>t.fn),e.textFiles.map(t=>t.text)),0==Object.keys(r.files).length)throw new Error("No files match the pattern "+t);const l=`bitburner${Object(a.a)(t)?"Scripts":"*.txt"===t?"Texts":"Files"}.zip`;r.generateAsync({type:"blob"}).then(t=>i.a.saveAs(t,l))}function c(t,e,n,r,i){try{if(1!==i.length)return void t.error("Incorrect usage of download command. Usage: download [script/text file]");const e=i[0]+"";if(e.startsWith("*"))try{return void l(e,r)}catch(e){return t.error(e.message)}else if(Object(a.a)(e)){const a=t.getScript(n,e);if(null!=a)return a.download()}else{if(!e.endsWith(".txt"))return void t.error("Cannot download this filetype");{const a=t.getTextFile(n,e);if(null!=a)return a.download()}}return void t.error(e+" does not exist")}catch(e){return void t.error(e+"")}}},,,,,,,,,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,e){a(this,"lvl",1),a(this,"n",1),this.n=t,this.lvl=e}}},function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i}));var a=n(0);const r=a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16px",height:"16px",viewBox:"0 0 166 132",style:{fill:"#adff2f"}},a.createElement("g",null,a.createElement("path",{d:"M132.658-0.18l-24.321,24.321c-7.915-2.71-16.342-4.392-25.087-4.392c-45.84,0-83,46-83,46 s14.1,17.44,35.635,30.844L12.32,120.158l12.021,12.021L144.68,11.841L132.658-0.18z M52.033,80.445 c-2.104-4.458-3.283-9.438-3.283-14.695c0-19.054,15.446-34.5,34.5-34.5c5.258,0,10.237,1.179,14.695,3.284L52.033,80.445z"}),a.createElement("path",{d:"M134.865,37.656l-18.482,18.482c0.884,3.052,1.367,6.275,1.367,9.612c0,19.055-15.446,34.5-34.5,34.5 c-3.337,0-6.56-0.483-9.611-1.367l-10.124,10.124c6.326,1.725,12.934,2.743,19.735,2.743c45.84,0,83-46,83-46 S153.987,50.575,134.865,37.656z"}))),i=a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16px",height:"16px",viewBox:"-22 0 511 511.99561",style:{fill:"#adff2f"}},a.createElement("path",{d:"m.496094 466.242188 39.902344-39.902344 45.753906 45.753906-39.898438 39.902344zm0 0"}),a.createElement("path",{d:"m468.421875 89.832031-1.675781-89.832031-300.265625 300.265625 45.753906 45.753906zm0 0"}),a.createElement("path",{d:"m95.210938 316.785156 16.84375 16.847656h.003906l83.65625 83.65625 22.753906-22.753906-100.503906-100.503906zm0 0"}),a.createElement("path",{d:"m101.445312 365.300781-39.902343 39.902344 45.753906 45.753906 39.902344-39.902343-39.90625-39.902344zm0 0"}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var a=n(0),r=n.n(a),i=n(59),o=n(29),s=n(1),l=n(21),c=n(19),f=n(111),u=n(615),m=n.n(u),h=n(616),d=n.n(h);function p({action:t,isActive:e,bladeburner:n,rerender:a}){const u=o.b.Player(),h=t.level1;return r.a.createElement(c.a,{display:"flex",flexDirection:"row",alignItems:"center"},r.a.createElement(c.a,{display:"flex"},r.a.createElement(l.a,{title:r.a.createElement(s.a,null,t.getSuccessesNeededForNextLevel(i.a.ContractSuccessesPerLevel)," successes needed for next level")},r.a.createElement(s.a,null,"Level: ",t.level," / ",t.maxLevel))),r.a.createElement(l.a,{title:e?r.a.createElement(s.a,null,"WARNING: changing the level will restart the Operation"):""},r.a.createElement("span",null,r.a.createElement(f.a,{disabled:!h,onClick:function(){h&&(++t.level,e&&n.startAction(u,n.action),a())}},r.a.createElement(m.a,null)))),r.a.createElement(l.a,{title:e?r.a.createElement(s.a,null,"WARNING: changing the level will restart the Operation"):""},r.a.createElement("span",null,r.a.createElement(f.a,{disabled:!p,onClick:function(){p&&(--t.level,e&&n.startAction(u,n.action),a())}},r.a.createElement(d.a,null)))))}},,,function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(0),r=n.n(a),i=n(1),o=n(21),s=n(19),l=n(277);function c(t){return r.a.createElement(s.a,{display:"flex",flexDirection:"row",alignItems:"center"},r.a.createElement(o.a,{title:r.a.createElement(i.a,null,"Automatically increase operation level when possible")},r.a.createElement(i.a,null," Autolevel:")),r.a.createElement(l.a,{checked:t.action.autoLevel,onChange:function(e){t.action.autoLevel=e.target.checked,t.rerender()}}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(0),r=n.n(a),i=n(1162),o=n(22),s=n(8);function l(t){const[e,n]=Object(a.useState)(!1);return r.a.createElement(r.a.Fragment,null,r.a.createElement(s.a,{disabled:0===t.bladeburner.teamSize,onClick:()=>n(!0)},"Set Team Size (Curr Size: ",Object(o.f)(t.action.teamCount,0),")"),r.a.createElement(i.a,{open:e,onClose:()=>n(!1),action:t.action,bladeburner:t.bladeburner}))}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(0),r=n.n(a);function i(){const[t,e]=Object(a.useState)(!0);return Object(a.useEffect)(()=>{const t=setInterval(()=>e(t=>!t),1e3);return()=>clearInterval(t)}),r.a.createElement(r.a.Fragment,null,t?"|":r.a.createElement(r.a.Fragment,null," "))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(0),r=n.n(a),i=n(8),o=n(21),s=n(1251),l=n.n(s),c=n(1250);function f(){const[t,e]=Object(a.useState)(!1);return r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,{title:"The style editor allows you to modify certain CSS rules used by the game."},r.a.createElement(i.a,{startIcon:r.a.createElement(l.a,null),onClick:()=>e(!0)},"Style Editor")),r.a.createElement(c.a,{open:t,onClose:()=>e(!1)}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(0),r=n.n(a),i=n(8),o=n(21),s=n(1252),l=n(1284),c=n.n(l);function f({router:t}){const[e,n]=Object(a.useState)(!1);return r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,{title:"The theme editor allows you to modify the colors the game uses."},r.a.createElement(i.a,{id:"bb-theme-editor-button",startIcon:r.a.createElement(c.a,null),onClick:()=>n(!0)},"Theme Editor")),r.a.createElement(s.a,{open:e,onClose:()=>n(!1),router:t}))}},,,,,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(0),r=n.n(a),i=n(1),o=n(150);function s(){return r.a.createElement(r.a.Fragment,null,r.a.createElement(i.a,{sx:{my:1}},"If you've created a theme that you believe should be added in game's theme browser, feel free to"," ",r.a.createElement(o.a,{href:"https://github.com/danielyxie/bitburner/tree/dev/src/Themes/README.md",target:"_blank"},"create a pull request"),"."),r.a.createElement(i.a,{sx:{my:1}},"Head over to the"," ",r.a.createElement(o.a,{href:"https://discord.com/channels/415207508303544321/921991895230611466",target:"_blank"},"theme-sharing")," ","discord channel for more."))}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var a=n(0),r=n.n(a),i=n(342),o=n(252),s=n(8),l=n(21),c=n(634),f=n.n(c),u=n(298);function m({color:t="primary"}){const[e,n]=Object(a.useState)(!1);return r.a.createElement(r.a.Fragment,null,r.a.createElement(l.a,{title:"This will permanently delete your local save game. Did you export it before?"},r.a.createElement(s.a,{startIcon:r.a.createElement(f.a,null),color:t,onClick:()=>n(!0)},"Delete Save")),r.a.createElement(o.a,{onConfirm:()=>{n(!1),Object(i.a)().then(()=>{Object(u.b)(),setTimeout(()=>location.reload(),1e3)}).catch(t=>console.error("Could not delete game: "+t))},open:e,onClose:()=>n(!1),confirmationText:"Really delete your game? (It's permanent!)"}))}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(0),r=n.n(a),i=n(252),o=n(8),s=n(21),l=n(1285),c=n.n(l);function f({color:t="primary",noConfirmation:e=!1,onTriggered:n}){const[l,f]=Object(a.useState)(!1);return r.a.createElement(r.a.Fragment,null,r.a.createElement(s.a,{title:"Perform a soft reset. Resets everything as if you had just purchased an Augmentation."},r.a.createElement(o.a,{startIcon:r.a.createElement(c.a,null),color:t,onClick:function(){e?n():f(!0)}},"Soft Reset")),r.a.createElement(i.a,{onConfirm:n,open:l,onClose:()=>f(!1),confirmationText:"This will perform the same action as installing Augmentations, are you sure?"}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return S}));var a=n(1836),r=n(691),i=n(1477),o=n(1483),s=n(1484),l=n(21),c=n(1),f=n(249),u=n(45),m=n(19),h=n(8),d=n(0),p=n.n(d),g=n(6),y=n(5),b=n(12),E=n(79),v=n(1291);const k=t=>{const e=t.aug.prereqs.filter(e=>t.player.hasAugmentation(e)),n=t.aug.prereqs.length>0&&e.length===t.aug.prereqs.length;return p.a.createElement(l.a,{title:p.a.createElement(p.a.Fragment,null,p.a.createElement(c.a,{sx:{color:g.a.theme.money}},"This Augmentation has the following pre-requisite(s):"),t.aug.prereqs.map(e=>p.a.createElement(w,{fulfilled:t.player.hasAugmentation(e),value:e,color:g.a.theme.money,key:e})))},p.a.createElement(c.a,{sx:{ml:1,fontSize:"0.9rem",display:"flex",alignItems:"center",color:n?g.a.theme.successlight:g.a.theme.error,gridArea:"prereqs"}},n?p.a.createElement(p.a.Fragment,null,p.a.createElement(a.a,{fontSize:"small",sx:{mr:1}}),"Pre-requisites Owned"):p.a.createElement(p.a.Fragment,null,p.a.createElement(r.a,{fontSize:"small",sx:{mr:1}}),"Missing ",t.aug.prereqs.length-e.length," pre-requisite(s)")))},_=t=>p.a.createElement(l.a,{title:p.a.createElement(p.a.Fragment,null,p.a.createElement(c.a,{sx:{color:g.a.theme.money}},"This Augmentation can only be acquired from the following source(s):"),p.a.createElement("ul",null,p.a.createElement(c.a,{sx:{color:g.a.theme.money}},p.a.createElement("li",null,p.a.createElement("b",null,t.aug.factions[0])," faction"),t.player.isAwareOfGang()&&!t.aug.isSpecial&&p.a.createElement("li",null,"Certain ",p.a.createElement("b",null,"gangs")),t.player.canAccessGrafting()&&!t.aug.isSpecial&&t.aug.name!==b.a.TheRedPill&&p.a.createElement("li",null,p.a.createElement("b",null,"Grafting")))))},p.a.createElement(i.a,{fontSize:"small",sx:{ml:1,color:g.a.theme.money,transform:"rotate(180deg)",gridArea:"exclusive"}})),w=t=>p.a.createElement(c.a,{sx:{display:"flex",alignItems:"center",color:t.fulfilled?t.color:g.a.theme.error}},t.fulfilled?p.a.createElement(o.a,{sx:{mr:1}}):p.a.createElement(s.a,{sx:{mr:1}}),t.value),S=t=>p.a.createElement(f.a,{maxWidth:"lg",disableGutters:!0,sx:{mx:0,display:"grid",gridTemplateColumns:"repeat(1, 1fr)",gap:.75}},t.augNames.map(e=>p.a.createElement(x,{key:e,parent:t,augName:e,owned:!1})),t.ownedAugNames.map(e=>p.a.createElement(x,{key:e,parent:t,augName:e,owned:!0})));function x(t){const[e,n]=Object(d.useState)(!1),a=E.a[t.augName],r=a.getCost(t.parent.player),i=t.parent.sleeveAugs?a.baseCost:r.moneyCost,o=r.repCost,s="string"==typeof a.info?p.a.createElement("span",null,a.info):a.info,f=p.a.createElement(p.a.Fragment,null,s,p.a.createElement("br",null),p.a.createElement("br",null),a.stats);return p.a.createElement(u.a,{sx:{p:.5,display:"grid",gridTemplateColumns:"minmax(0, 4fr) 1.4fr",gap:1,opacity:t.owned?.75:1,minWidth:"1100px"}},p.a.createElement(p.a.Fragment,null,p.a.createElement(m.a,{sx:{display:"flex",alignItems:"center"}},p.a.createElement(h.a,{onClick:()=>t.parent.purchaseAugmentation(t.parent.player,a,t=>{n(t)}),disabled:!t.parent.canPurchase(t.parent.player,a)||t.owned,sx:{width:"48px",height:"36px",float:"left",clear:"none",mr:1}},t.owned?"Owned":"Buy"),p.a.createElement(m.a,{sx:{maxWidth:t.owned?"100%":"85%"}},p.a.createElement(m.a,{sx:{display:"grid",alignItems:"center",gridTemplateAreas:'"title exclusive prereqs"'}},p.a.createElement(l.a,{title:p.a.createElement(p.a.Fragment,null,p.a.createElement(c.a,{variant:"h5"},t.augName,t.augName===b.a.NeuroFluxGovernor&&" - Level "+a.getLevel(t.parent.player)),p.a.createElement(c.a,null,f))},p.a.createElement(c.a,{sx:{gridArea:"title",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",color:t.owned||!t.parent.canPurchase(t.parent.player,a)?g.a.theme.disabled:g.a.theme.primary}},a.name,a.name===b.a.NeuroFluxGovernor&&" - Level "+a.getLevel(t.parent.player))),1===a.factions.length&&!t.parent.sleeveAugs&&p.a.createElement(_,{player:t.parent.player,aug:a}),a.prereqs.length>0&&!t.parent.sleeveAugs&&p.a.createElement(k,{player:t.parent.player,aug:a})))),t.owned||p.a.createElement(m.a,{sx:{display:"grid",alignItems:"center",gridTemplateColumns:"1fr 1fr"}},p.a.createElement(w,{fulfilled:0===i||t.parent.player.money>i,value:y.a.formatMoney(i),color:g.a.theme.money}),void 0!==t.parent.rep&&p.a.createElement(w,{fulfilled:t.parent.rep>=o,value:y.a.formatReputation(o)+" rep",color:g.a.theme.rep})),g.a.SuppressBuyAugmentationConfirmation||p.a.createElement(v.a,{open:e,onClose:()=>n(!1),faction:t.parent.faction,aug:a})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return y}));var a=n(0),r=n.n(a),i=n(15),o=n(1322),s=n(10),l=n(6),c=n(29),f=n(20),u=n(465),m=n(14),h=n(1),d=n(19),p=n(8);function g(t,e,n){const a=s.a.TravelCost;t.canAfford(a)&&(t.loseMoney(a,"other"),t.travel(n),Object(m.a)(r.a.createElement(r.a.Fragment,null,"You are now in ",n,"!")),e.toCity())}function y(t){const e=c.b.Player(),n=c.b.Router(),m=Object(a.useState)(!1)[1],[y,b]=Object(a.useState)(!1),[E,v]=Object(a.useState)(i.a.Sector12);function k(){m(t=>!t)}function _(t){const a=s.a.TravelCost;e.canAfford(a)&&(l.a.SuppressTravelConfirmation?g(e,n,t):(b(!0),v(t)))}return Object(a.useEffect)(()=>{const t=setInterval(k,1e3);return()=>clearInterval(t)},[]),r.a.createElement(r.a.Fragment,null,r.a.createElement(h.a,{variant:"h4"},"Travel Agency"),r.a.createElement(d.a,{mx:2},r.a.createElement(h.a,null,"From here, you can travel to any other city! A ticket costs"," ",r.a.createElement(f.a,{money:s.a.TravelCost,player:t.p}),"."),l.a.DisableASCIIArt?r.a.createElement(r.a.Fragment,null,Object.values(i.a).filter(e=>e!=t.p.city).map(t=>{if(void 0===Object.entries(i.a).find(e=>e[1]===t))throw new Error(`could not find key for city '${t}'`);return r.a.createElement(r.a.Fragment,{key:t},r.a.createElement(p.a,{onClick:()=>_(t),sx:{m:2}},r.a.createElement(h.a,null,"Travel to ",t)),r.a.createElement("br",null))})):r.a.createElement(u.a,{currentCity:t.p.city,onTravel:t=>_(t)})),r.a.createElement(o.a,{city:E,travel:()=>g(e,n,E),open:y,onClose:()=>b(!1)}))}},function(t,e,n){"use strict";n.d(e,"b",(function(){return z})),n.d(e,"a",(function(){return X}));var a=n(0),r=n.n(a),i=n(532),o=n(1330),s=n(83),l=n(14),c=n(100),f=n(255),u=n(225),m=n(525),h=n(327),d=n(5),p=n(680),g=n(344),y=n.n(g),b=n(528),E=n(6),v=n(44),k=n(115),_=n(109),w=n(123),S=n(24),x=n(8),C=n(1),L=n(150),O=n(19),M=n(609),T=n.n(M),A=n(1341),R=n.n(A),N=n(536),P=n.n(N),I=n(148),F=n(30),D=n(50),j=n(149),B=n(407),G=n(38),W=n(1333),H=n(21),U=n(76);function q(){return(q=Object.assign||function(t){for(var e=1;e!e.includes(t)).sort()}class V{constructor(t,e,n,a,r){this.fileName=t,this.code=e,this.hostname=n,this.lastPosition=a,this.model=r}}let Y=[],J=null;function X(t){const e=Object(a.useState)(!1)[1];const n=Object(a.useRef)(null),g=Object(a.useRef)(null),b=Object(a.useRef)(null),[M,A]=Object(a.useState)(null),[N,z]=Object(a.useState)(null),[X,Q]=Object(a.useState)(""),[Z,tt]=Object(a.useState)(!1),[et,nt]=Object(a.useState)("RAM: ???"),[at,rt]=Object(a.useState)([["???",""]]),[it,ot]=Object(a.useState)(!1),[st,lt]=Object(a.useState)([]),[ct,ft]=Object(a.useState)(!1),[ut,mt]=Object(a.useState)({theme:E.a.MonacoTheme,insertSpaces:E.a.MonacoInsertSpaces,fontSize:E.a.MonacoFontSize,wordWrap:E.a.MonacoWordWrap,vim:t.vim||E.a.MonacoVim}),[ht,dt]=Object(a.useState)(!1);Y=Y.filter(t=>null!==Object(S.d)(t.hostname)),J&&null===Object(S.d)(J.hostname)&&(J=Y[0],void 0===J&&(J=null));const[pt,gt]=Object(a.useState)({height:window.innerHeight,width:window.innerWidth});function yt(t){null!==g.current&&(t.model=g.current.editor.createModel(t.code,t.fileName.endsWith(".txt")?"plaintext":"javascript"))}Object(a.useEffect)(()=>{const t=Object(k.debounce)((function(){gt({height:window.innerHeight,width:window.innerWidth})}),250);return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}},[]),Object(a.useEffect)(()=>{null!==J&&Et(J.code)},[]),Object(a.useEffect)(()=>{function e(e){E.a.DisableHotkeys||("KeyB"==e.code&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),t.router.toTerminal()),"KeyS"==e.code&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),e.stopPropagation(),kt()))}return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),Object(a.useEffect)(()=>{if(ut.vim&&N&&!M)try{window.require(["monaco-vim"],(function(e){A(e.initVimMode(N,b.current)),e.VimMode.Vim.defineEx("write","w",(function(){kt()})),e.VimMode.Vim.defineEx("quit","q",(function(){t.router.toTerminal()})),e.VimMode.Vim.defineEx("wqriteandquit","wq",(function(){kt(),t.router.toTerminal()})),e.VimMode.Vim.defineAction("nextTabs",(function(t,e){var n;const a=null!==(n=e.repeat)&&void 0!==n?n:1,r=_t();if(void 0!==r){wt((r+a)%Y.length)}})),e.VimMode.Vim.defineAction("prevTabs",(function(t,e){var n;const a=null!==(n=e.repeat)&&void 0!==n?n:1,r=_t();if(void 0!==r){let t=r-a;for(;t<0;)t+=Y.length;wt(t)}})),e.VimMode.Vim.mapCommand("gt","action","nextTabs",{},{context:"normal"}),e.VimMode.Vim.mapCommand("gT","action","prevTabs",{},{context:"normal"}),N.focus()}))}catch{}else ut.vim||(null==M||M.dispose(),A(null));return()=>{null==M||M.dispose()}},[ut,n,N,M]);const bt=Object(a.useMemo)(()=>Object(k.debounce)((t,e)=>{nt(t),rt(e),ot(!1)},300),[]);async function Et(e){if(null!=J&&J.fileName.endsWith(".txt"))return void bt("N/A",[["N/A",""]]);ot(!0);const n=e+"",a=await Object(m.a)(t.player,n,t.player.getCurrentServer().scripts);if(!(a.cost>0)){switch(a.cost){case h.a.ImportError:bt("RAM: Import Error",[["Import Error",""]]);break;case h.a.URLImportError:bt("RAM: HTTP Import Error",[["HTTP Import Error",""]]);break;case h.a.SyntaxError:default:bt("RAM: Syntax Error",[["Syntax Error",""]])}return new Promise(()=>{})}{var r,i;const t=null!==(r=null===(i=a.entries)||void 0===i?void 0:i.sort((t,e)=>e.cost-t.cost))&&void 0!==r?r:[],e=[];for(const n of t)e.push([`${n.name} (${n.type})`,d.a.formatRAM(n.cost)]);bt("RAM: "+d.a.formatRAM(a.cost),e)}}function vt(e){const n=Object(S.d)(e.hostname);if(null===n)throw new Error("Server should not be null but it is.");if(Object(c.a)(e.fileName)){for(let a=0;anull!==J&&t.fileName===J.fileName&&t.hostname===J.hostname)}function wt(t){if(null!==J){const t=_t();void 0!==t&&(Y[t]=J)}J={...Y[t]},null!==n.current&&null!==Y[t]&&((void 0===Y[t].model||Y[t].model.isDisposed())&&yt(Y[t]),n.current.setModel(Y[t].model),n.current.setPosition(Y[t].lastPosition),n.current.revealLineInCenter(Y[t].lastPosition.lineNumber),Et(Y[t].code),n.current.focus())}function St(a){const r=Y[a],i=Y.findIndex(t=>t.fileName===r.fileName&&t.hostname===r.hostname);let o="";-1!==i&&(o=Y[i].code);const s=Object(S.d)(r.hostname);if(null===s)throw new Error(`Server '${r.hostname}' should not be null, but it is.`);const l=s.scripts.findIndex(t=>t.filename===r.fileName);if(-1!==l&&o===s.scripts[l].code||B.a.emit({txt:`Do you want to save changes to ${r.fileName} on ${r.hostname}?`,resolve:t=>{t&&(r.code=o,vt(r))}}),Y.length>1){Y=Y.filter((t,e)=>e!==a);let t=-1;void 0===Y[a+t]&&(t=1,void 0===Y[a+t]&&(t=0)),J=Y[a+t],null!==n.current&&((void 0===Y[a+t].model||null===Y[a+t].model||Y[a+t].model.isDisposed())&&yt(Y[a+t]),n.current.setModel(Y[a+t].model),n.current.setPosition(Y[a+t].lastPosition),n.current.revealLineInCenter(Y[a+t].lastPosition.lineNumber),n.current.focus()),e(t=>!t)}else Y=[],J=null,t.router.toTerminal()}function xt(t){var e;const n=Y[t],a=Object(S.d)(n.hostname);if(null===a)throw new Error(`Server '${n.hostname}' should not be null, but it is.`);const r=a.scripts.find(t=>t.filename===n.fileName);return null!==(e=null==r?void 0:r.code)&&void 0!==e?e:null}function Ct(t){Q(t.target.value)}function Lt(){Q(""),tt(!Z)}const Ot=Object.values(Y).filter(t=>t.hostname.includes(X)||t.fileName.includes(X)),Mt=pt.height-(130+(ut.vim?34:0)),Tt=Ot.length?1640/Ot.length-5:0,At=Tt-50;return r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{style:{display:null!==J?"block":"none",height:"100%",width:"100%"}},r.a.createElement(p.a,{onDragEnd:function(t){if(!t.destination)return;const e=function(t,e,n){const a=Array.from(t),[r]=a.splice(e,1);return a.splice(n,0,r),a}(Y,t.source.index,t.destination.index);Y=e}},r.a.createElement(p.c,{droppableId:"tabs",direction:"horizontal"},(t,e)=>r.a.createElement(O.a,q({maxWidth:"1640px",display:"flex",flexDirection:"row",alignItems:"center",whiteSpace:"nowrap",ref:t.innerRef},t.droppableProps,{style:{backgroundColor:e.isDraggingOver?E.a.theme.backgroundsecondary:E.a.theme.backgroundprimary,overflowX:"scroll"}}),r.a.createElement(H.a,{title:"Search Open Scripts"},Z?r.a.createElement(U.a,{value:X,onChange:Ct,autoFocus:!0,InputProps:{startAdornment:r.a.createElement(y.a,null),spellCheck:!1,endAdornment:r.a.createElement(P.a,{onClick:Lt})}}):r.a.createElement(x.a,{onClick:Lt},r.a.createElement(y.a,null))),Ot.map(({fileName:t,hostname:e},a)=>{var i,o;const s="home"!==e,l=(null===(i=J)||void 0===i?void 0:i.fileName)===Ot[a].fileName&&(null===(o=J)||void 0===o?void 0:o.hostname)===Ot[a].hostname?{background:E.a.theme.button,borderColor:E.a.theme.button,color:E.a.theme.primary}:{background:E.a.theme.backgroundsecondary,borderColor:E.a.theme.backgroundsecondary,color:E.a.theme.secondary};s&&(l.color=E.a.theme.info);const c={maxWidth:"25px",minWidth:"25px",minHeight:"38.5px",maxHeight:"38.5px",...l},u=`${e}:~/${t} ${function(t){const e=Y[t],n=xt(t);return null===n||n!==f.a.formatCode(e.code)?" *":""}(a)}`;return r.a.createElement(p.b,{key:t+e,draggableId:t+e,index:a,disableInteractiveElementBlocking:!0},t=>r.a.createElement("div",q({ref:t.innerRef},t.draggableProps,t.dragHandleProps,{style:{...t.draggableProps.style,maxWidth:Tt+"px",marginRight:"5px",flexShrink:0,border:"1px solid "+E.a.theme.well}}),r.a.createElement(H.a,{title:u},r.a.createElement(x.a,{onClick:()=>wt(a),onMouseDown:t=>{t.preventDefault(),1===t.button&&St(a)},style:{maxWidth:At+"px",minHeight:"38.5px",overflow:"hidden",...l}},r.a.createElement("span",{style:{overflow:"hidden",direction:"rtl",textOverflow:"ellipsis"}},u))),r.a.createElement(H.a,{title:"Overwrite editor content with saved file content"},r.a.createElement(x.a,{onClick:()=>function(t){const e=Y[t],a=xt(t);null!==a&&e.code!==a&&B.a.emit({txt:"Do you want to overwrite the current editor content with the contents of "+e.fileName+" on the server? This cannot be undone.",resolve:r=>{r&&(e.code=a,wt(t),null!==n.current&&null!==e&&((void 0===e.model||e.model.isDisposed())&&yt(e),n.current.setModel(e.model),n.current.setValue(e.code),Et(e.code),n.current.focus()))}})}(a),style:c},r.a.createElement(R.a,{fontSize:"small"}))),r.a.createElement(x.a,{onClick:()=>St(a),style:c},r.a.createElement(P.a,{fontSize:"small"}))))}),t.placeholder))),r.a.createElement("div",{style:{paddingBottom:"5px"}}),r.a.createElement(i.a,{beforeMount:function(t){if($)return;$=!0,t.languages.registerCompletionItemProvider("javascript",{provideCompletionItems:()=>{const e=[];for(const n of K)e.push({label:n,kind:t.languages.CompletionItemKind.Function,insertText:n,insertTextRules:t.languages.CompletionItemInsertTextRule.InsertAsSnippet});return{suggestions:e}}}),async function(){const e=await t.languages.getLanguages().find(t=>"javascript"===t.id).loader();e.language.tokenizer.root.unshift([new RegExp("\\bns\\b"),{token:"ns"}]);for(const t of K)e.language.tokenizer.root.unshift([new RegExp(`\\b${t}\\b`),{token:"netscriptfunction"}]);["let","const","var","function"].forEach(t=>e.language.tokenizer.root.unshift([new RegExp(`\\b${t}\\b`),{token:"otherkeywords"}])),["true","false","null","undefined"].forEach(t=>e.language.tokenizer.root.unshift([new RegExp(`\\b${t}\\b`),{token:"otherkeyvars"}])),e.language.tokenizer.root.unshift([new RegExp("\\bthis\\b"),{token:"this"}])}();const e=(W.a+"").replace(/export /g,"");t.languages.typescript.javascriptDefaults.addExtraLib(e,"netscript.d.ts"),t.languages.typescript.typescriptDefaults.addExtraLib(e,"netscript.d.ts"),Object(w.b)(t),Object(w.d)(E.a.EditorTheme),t.editor.defineTheme("customTheme",Object(w.c)(E.a.EditorTheme))},onMount:function(e,a){if(z(e),n.current=e,g.current=a,null!==n.current&&null!==g.current){if(!t.files&&null!==J)return yt(J),n.current.setModel(J.model),n.current.setPosition(J.lastPosition),n.current.revealLineInCenter(J.lastPosition.lineNumber),Et(J.code),void n.current.focus();if(t.files){const e=Object.entries(t.files);if(!e.length)return void n.current.focus();for(const[a,r]of e){const e=Y.find(e=>e.fileName===a&&e.hostname===t.hostname);if(e)(void 0===e.model||null===e.model||e.model.isDisposed())&&yt(e),J=e,n.current.setModel(e.model),n.current.setPosition(e.lastPosition),n.current.revealLineInCenter(e.lastPosition.lineNumber),Et(e.code);else{const e=new V(a,r,t.hostname,new g.current.Position(0,0),g.current.editor.createModel(r,a.endsWith(".txt")?"plaintext":"javascript"));Y.push(e),J={...e},n.current.setModel(e.model),Et(e.code)}}}n.current.focus()}},loading:r.a.createElement(C.a,null,"Loading script editor!"),height:Mt+"px",defaultLanguage:"javascript",defaultValue:"",onChange:function(t){if(void 0===t)return;if(Et(t),null===n.current)return;const e=n.current.getPosition();if(null!==e){if(null!==J){J={...J,code:t,lastPosition:e};const n=Y.findIndex(t=>null!==J&&t.fileName===J.fileName&&t.hostname===J.hostname),a=[...Y],r=J;r.code=t,a[n]=r,Y=[...a]}try{!function(t){if(null===n.current||null===J)return;if(!J.fileName.endsWith(".ns")&&!J.fileName.endsWith(".js"))return;const e=Object(m.b)(t);if(-1!==e){const t=n.current.deltaDecorations(st,[{range:{startLineNumber:e,startColumn:1,endLineNumber:e,endColumn:10},options:{isWholeLine:!0,glyphMarginClassName:"myGlyphMarginClass",glyphMarginHoverMessage:{value:"Possible infinite loop, await something."}}}]);lt(t)}else{const t=n.current.deltaDecorations(st,[]);lt(t)}}(t)}catch(t){}}},theme:ut.theme,options:{...ut,glyphMargin:!0}}),r.a.createElement(O.a,{ref:b,className:"monaco-editor",display:"flex",flexDirection:"row",sx:{p:1},alignItems:"center"}),r.a.createElement(O.a,{display:"flex",flexDirection:"row",sx:{m:1},alignItems:"center"},r.a.createElement(x.a,{startIcon:r.a.createElement(T.a,null),onClick:()=>ft(!0),sx:{mr:1}},"Options"),r.a.createElement(x.a,{onClick:function(){null!==n.current&&n.current.getAction("editor.action.formatDocument").run()}},"Beautify"),r.a.createElement(x.a,{color:it?"secondary":"primary",sx:{mx:1},onClick:()=>{dt(!0)}},et),r.a.createElement(x.a,{onClick:kt},"Save (Ctrl/Cmd + s)"),r.a.createElement(x.a,{sx:{mx:1},onClick:t.router.toTerminal},"Terminal (Ctrl/Cmd + b)"),r.a.createElement(C.a,null," ",r.a.createElement("strong",null,"Documentation:")," ",r.a.createElement(L.a,{target:"_blank",href:"https://bitburner.readthedocs.io/en/latest/index.html"},"Basic")," | ",r.a.createElement(L.a,{target:"_blank",href:"https://github.com/danielyxie/bitburner/blob/dev/markdown/bitburner.ns.md"},"Full"))),r.a.createElement(o.a,{open:ct,onClose:()=>{var t;Object(w.d)(E.a.EditorTheme),null===(t=g.current)||void 0===t||t.editor.defineTheme("customTheme",Object(w.c)(E.a.EditorTheme)),ft(!1)},options:{theme:E.a.MonacoTheme,insertSpaces:E.a.MonacoInsertSpaces,fontSize:E.a.MonacoFontSize,wordWrap:E.a.MonacoWordWrap,vim:E.a.MonacoVim},save:t=>{var e;Object(w.d)(E.a.EditorTheme),null===(e=g.current)||void 0===e||e.editor.defineTheme("customTheme",Object(w.c)(E.a.EditorTheme)),mt(t),E.a.MonacoTheme=t.theme,E.a.MonacoInsertSpaces=t.insertSpaces,E.a.MonacoFontSize=t.fontSize,E.a.MonacoWordWrap=t.wordWrap,E.a.MonacoVim=t.vim}}),r.a.createElement(G.a,{open:ht,onClose:()=>dt(!1)},r.a.createElement(I.a,null,r.a.createElement(j.a,null,at.map(([t,e])=>r.a.createElement(r.a.Fragment,{key:t+e},r.a.createElement(D.a,null,r.a.createElement(F.a,{sx:{color:E.a.theme.primary}},t),r.a.createElement(F.a,{align:"right",sx:{color:E.a.theme.primary}},e)))))))),r.a.createElement("div",{style:{display:null!==J?"none":"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},r.a.createElement("span",{style:{color:E.a.theme.primary,fontSize:"20px",textAlign:"center"}},r.a.createElement(C.a,{variant:"h4"},"No open files"),r.a.createElement(C.a,{variant:"h5"},"Use ",r.a.createElement("code",null,"nano FILENAME")," in",r.a.createElement("br",null),"the terminal to open files"))))}},,,,function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i}));var a=n(83);function r(t,e){const n=[];if(!Object(a.i)(e))return n;let r=e;function i(t){if("/"===r&&Object(a.h)(t)){const e=Object(a.g)(t);"/"===e||n.includes(e)||n.push(e)}else if(t.startsWith(r)){const e=t.slice(r.length),i=Object(a.g)(e);"/"===i||n.includes(i)||n.push(i)}}r.endsWith("/")||(r+="/");for(const e of t.scripts)i(e.filename);for(const e of t.textFiles)i(e.fn);return n}function i(t,e){const n=e+("/"===e.slice(-1)?"":"/");return[...t.scripts.map(t=>t.filename),...t.textFiles.map(t=>t.fn)].some(t=>t.startsWith(n))}},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return compile})),__webpack_require__.d(__webpack_exports__,"b",(function(){return executeJSScript}));var acorn_walk__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(303),acorn__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(256),_NetscriptEvaluator__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(110),_Script_ScriptUrl__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(1346),_Terminal_DirectoryHelpers__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(83);function makeScriptBlob(t){return new Blob([t],{type:"text/javascript"})}async function compile(player,script,scripts){if(!shouldCompile(script,scripts))return;await script.updateRamUsage(player,scripts);const uurls=_getScriptUrls(script,scripts,[]),url=uurls[uurls.length-1].url;script.url&&script.url!==url&&URL.revokeObjectURL(script.url),script.dependencies.length>0&&script.dependencies.forEach(t=>URL.revokeObjectURL(t.url)),script.url=uurls[uurls.length-1].url,script.module=new Promise(resolve=>resolve(eval("import(uurls[uurls.length - 1].url)"))),script.dependencies=uurls}async function executeJSScript(t,e=[],n){const a=n.getScript();if(null===a)throw new Error("script is null");await compile(t,a,e),n.ramUsage=a.ramUsage;const r=await a.module,i=n.env.vars;if(!r.main)throw Object(_NetscriptEvaluator__WEBPACK_IMPORTED_MODULE_2__.b)(n,a.filename+" cannot be run because it does not have a main function.");return r.main(i)}function isDependencyOutOfDate(t,e,n){const a=e.find(e=>e.filename==t);if(!a)return!0;return a.moduleSequenceNumber>n}function shouldCompile(t,e){return""===t.module||t.dependencies.some(n=>isDependencyOutOfDate(n.filename,e,t.moduleSequenceNumber))}function _getScriptUrls(t,e,n){const a=[];for(const e of n)t.dependents.some(t=>t.server===e.server&&t.filename==e.filename)||t.dependents.push({server:e.server,filename:e.filename});n.push(t);try{const r=Object(acorn__WEBPACK_IMPORTED_MODULE_1__.a)(t.code,{sourceType:"module",ecmaVersion:"latest",ranges:!0}),i=[];acorn_walk__WEBPACK_IMPORTED_MODULE_0__.b(r,{ImportDeclaration(t){i.push({filename:t.source.value,start:t.source.range[0]+1,end:t.source.range[1]-1})},ExportNamedDeclaration(t){t.source&&i.push({filename:t.source.value,start:t.source.range[0]+1,end:t.source.range[1]-1})},ExportAllDeclaration(t){t.source&&i.push({filename:t.source.value,start:t.source.range[0]+1,end:t.source.range[1]-1})}}),i.sort((t,e)=>e.start-t.start);let o=t.code;for(const t of i){const r=t.filename.startsWith("./")?t.filename.substring(2):t.filename,i=e.filter(t=>Object(_Terminal_DirectoryHelpers__WEBPACK_IMPORTED_MODULE_4__.b)(t.filename,r));if(0===i.length)continue;const[s]=i,l=_getScriptUrls(s,e,n);a.push(...l);const c=l[l.length-1].url;o=o.substring(0,t.start)+c+o.substring(t.end)}o+=`\n//# sourceURL=${t.server}/${t.filename}`;const s=URL.createObjectURL(makeScriptBlob(o));return a.push(new _Script_ScriptUrl__WEBPACK_IMPORTED_MODULE_3__.a(t.filename,s,t.moduleSequenceNumber)),a}catch(t){for(const t of a)URL.revokeObjectURL(t.url);throw t}finally{n.pop()}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(645),r=n(318);function i(t){return()=>e=>{e=Object(a.a)(e);const n={};for(const t of e){let e=String;"number"==typeof t[1]?e=Number:"boolean"==typeof t[1]?e=Boolean:Array.isArray(t[1])&&(e=[String]);const a=t[0].length>1?2:1;n["-".repeat(a)+t[0]]=e}const i=r(n,{argv:t});for(const t of e)i.hasOwnProperty("--"+t[0])&&i.hasOwnProperty("-"+t[0])||(i[t[0]]=t[1]);for(const t of Object.keys(i)){if(!t.startsWith("-"))continue;const e=i[t];delete i[t];const n=2===t.length?1:2;i[t.slice(n)]=e}return i}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));const a=new(n(595).a)("",()=>{});function r(t){if(null==t)return null;if(!(t.hasOwnProperty("properties")&&t.hasOwnProperty("getter")&&t.hasOwnProperty("setter")&&t.hasOwnProperty("proto")))return t;let e;if(t.hasOwnProperty("class")&&"Array"===t.class){e=[];const n=a.getProperty(t,"length");for(let i=0;i{u(t,0)},disabled:0===s},"rtl"===e.direction?a.createElement(d.a,null):a.createElement(l.a,null)),a.createElement(o.a,{onClick:t=>{u(t,s-1)},disabled:0===s},"rtl"===e.direction?a.createElement(m.a,null):a.createElement(f.a,null)),a.createElement(o.a,{onClick:t=>{u(t,s+1)},disabled:s>=Math.ceil(n/c)-1},"rtl"===e.direction?a.createElement(f.a,null):a.createElement(m.a,null)),a.createElement(o.a,{onClick:t=>{u(t,Math.max(0,Math.ceil(n/c)-1))},disabled:s>=Math.ceil(n/c)-1},"rtl"===e.direction?a.createElement(l.a,null):a.createElement(d.a,null)))}},function(t,e,n){"use strict";n.d(e,"b",(function(){return w})),n.d(e,"a",(function(){return S}));var a=n(209),r=n.n(a),i=n(81),o=n.n(i),s=n(19),l=n(45),c=n(355),f=n(113),u=n(1),m=n(276),h=n(148),d=n(149),p=n(115),g=n(0),y=n.n(g),b=n(88),E=n(6),v=n(29),k=n(73),_=n(152);function w({n:t,level:e}){const[n,a]=y.a.useState(!1);return 1===t?y.a.createElement(y.a.Fragment,null):y.a.createElement(s.a,{component:l.a,sx:{mt:1,p:1}},y.a.createElement(c.a,{disableGutters:!0,onClick:()=>a(t=>!t)},y.a.createElement(f.a,{primary:y.a.createElement(u.a,{variant:"h6"},"Bitnode Multipliers")}),n?y.a.createElement(r.a,{color:"primary"}):y.a.createElement(o.a,{color:"primary"})),y.a.createElement(m.a,{in:n},y.a.createElement(S,{n:t,level:e})))}const S=({n:t,level:e})=>{const n=v.b.Player(),a=12===t?1/0:3,r=Object(_.c)(t,null!=e?e:Math.min(n.sourceFileLvl(t)+1,a));return y.a.createElement(s.a,{sx:{columnCount:2,columnGap:1,mb:-2}},y.a.createElement(C,{n:t,mults:r}),y.a.createElement(R,{n:t,mults:r}),y.a.createElement(T,{n:t,mults:r}),y.a.createElement(L,{n:t,mults:r}),y.a.createElement(N,{n:t,mults:r}),y.a.createElement(P,{n:t,mults:r}),y.a.createElement(M,{n:t,mults:r}),y.a.createElement(A,{n:t,mults:r}),y.a.createElement(I,{n:t,mults:r}),y.a.createElement(O,{n:t,mults:r}),y.a.createElement(j,{n:t,mults:r}),y.a.createElement(B,{n:t,mults:r}),y.a.createElement(F,{n:t,mults:r}),y.a.createElement(D,{n:t,mults:r}))},x=t=>{const e=Object.entries(t.rowData).filter(([e,n])=>t.mults[e]!==_.b[e]).map(([e,n])=>{var a,r;return y.a.createElement(k.a,{key:Object(p.uniqueId)(),name:n.name,data:{content:null!==(a=n.content)&&void 0!==a?a:(100*t.mults[e]).toFixed(3)+"%"},color:null!==(r=n.color)&&void 0!==r?r:E.a.theme.primary})});return e.length>0?y.a.createElement("span",{style:{display:"inline-block",width:"100%",marginBottom:"16px"}},y.a.createElement(u.a,{variant:"h6"},t.sectionName),y.a.createElement(h.a,null,y.a.createElement(d.a,null,e))):y.a.createElement(y.a.Fragment,null)};function C({mults:t}){const e={WorldDaemonDifficulty:{name:b.a.WorldDaemon+" Difficulty"},DaedalusAugsRequirement:{name:"Daedalus Augs Requirement",content:String(t.DaedalusAugsRequirement)},HacknetNodeMoney:{name:"Hacknet Production"},CodingContractMoney:{name:"Coding Contract Reward"},ClassGymExpGain:{name:"Class/Gym Exp"}};return y.a.createElement(x,{sectionName:"General",rowData:e,mults:t})}function L({mults:t}){const e={AugmentationMoneyCost:{name:"Money Cost"},AugmentationRepCost:{name:"Reputation Cost",color:E.a.theme.rep}};return y.a.createElement(x,{sectionName:"Augmentations",rowData:e,mults:t})}function O({mults:t}){const e={CompanyWorkMoney:{name:"Work Money",color:E.a.theme.money},CompanyWorkExpGain:{name:"Work Exp"}};return y.a.createElement(x,{sectionName:"Company",rowData:e,mults:t})}function M({mults:t}){return y.a.createElement(x,{sectionName:"Stock Market",rowData:{FourSigmaMarketDataCost:{name:"Market Data Cost"},FourSigmaMarketDataApiCost:{name:"Market Data API Cost"}},mults:t})}function T({mults:t}){const e={RepToDonateToFaction:{name:"Favor to Donate"},FactionWorkRepGain:{name:"Work Reputation",color:E.a.theme.rep},FactionWorkExpGain:{name:"Work Exp"},FactionPassiveRepGain:{name:"Passive Rep",color:E.a.theme.rep}};return y.a.createElement(x,{sectionName:"Faction",rowData:e,mults:t})}function A({mults:t}){const e={CrimeExpGain:{name:"Crime Exp",color:E.a.theme.combat},CrimeMoney:{name:"Crime Money",color:E.a.theme.combat}};return y.a.createElement(x,{sectionName:"Crime",rowData:e,mults:t})}function R({mults:t}){const e={HackingLevelMultiplier:{name:"Hacking Level",color:E.a.theme.hack},StrengthLevelMultiplier:{name:"Strength Level",color:E.a.theme.combat},DefenseLevelMultiplier:{name:"Defense Level",color:E.a.theme.combat},DexterityLevelMultiplier:{name:"Dexterity Level",color:E.a.theme.combat},AgilityLevelMultiplier:{name:"Agility Level",color:E.a.theme.combat},CharismaLevelMultiplier:{name:"Charisma Level",color:E.a.theme.cha}};return y.a.createElement(x,{sectionName:"Skills",rowData:e,mults:t})}function N({mults:t}){const e={HackExpGain:{name:"Hacking Exp",color:E.a.theme.hack},ServerGrowthRate:{name:"Server Growth Rate"},ServerMaxMoney:{name:"Server Max Money"},ServerStartingMoney:{name:"Server Starting Money"},ServerStartingSecurity:{name:"Server Starting Security"},ServerWeakenRate:{name:"Server Weaken Rate"},ManualHackMoney:{name:"Manual Hack Money",color:E.a.theme.money},ScriptHackMoney:{name:"Script Hack Money",color:E.a.theme.money},ScriptHackMoneyGain:{name:"Money Gained From Hack",color:E.a.theme.money}};return y.a.createElement(x,{sectionName:"Hacking",rowData:e,mults:t})}function P({mults:t}){const e={PurchasedServerCost:{name:"Base Cost",content:t.PurchasedServerCost.toFixed(3)},PurchasedServerSoftcap:{name:"Softcap Cost",content:t.PurchasedServerSoftcap.toFixed(3)},PurchasedServerLimit:{name:"Server Limit"},PurchasedServerMaxRam:{name:"Max RAM"},HomeComputerRamCost:{name:"Home RAM Cost"}};return y.a.createElement(x,{sectionName:"Purchased Servers",rowData:e,mults:t})}function I({mults:t}){const e={InfiltrationMoney:{name:"Infiltration Money",color:E.a.theme.money},InfiltrationRep:{name:"Infiltration Reputation",color:E.a.theme.rep}};return y.a.createElement(x,{sectionName:"Infiltration",rowData:e,mults:t})}function F({mults:t}){if(!v.b.Player().canAccessBladeburner())return y.a.createElement(y.a.Fragment,null);return y.a.createElement(x,{sectionName:"Bladeburner",rowData:{BladeburnerRank:{name:"Rank Gain"},BladeburnerSkillCost:{name:"Skill Cost"}},mults:t})}function D({mults:t}){if(!v.b.Player().canAccessCotMG())return y.a.createElement(y.a.Fragment,null);const e=t.StaneksGiftExtraSize.toFixed(3),n={StnakesGiftPowerMultiplier:{name:"Gift Power"},StaneksGiftExtraSize:{name:"Base Size Modifier",content:""+(t.StaneksGiftExtraSize>_.b.StaneksGiftExtraSize?"+"+e:e)}};return y.a.createElement(x,{sectionName:"Stanek's Gift",rowData:n,mults:t})}function j({mults:t}){const e=v.b.Player();if(2!==e.bitNodeN&&e.sourceFileLvl(2)<=0)return y.a.createElement(y.a.Fragment,null);const n={GangSoftcap:{name:"Gang Softcap",content:t.GangSoftcap.toFixed(3)},GangUniqueAugs:{name:"Unique Augmentations"}};return y.a.createElement(x,{sectionName:"Gang",rowData:n,mults:t})}function B({mults:t}){if(!v.b.Player().canAccessCorporation())return y.a.createElement(y.a.Fragment,null);const e={CorporationSoftcap:{name:"Corporation Softcap",content:t.CorporationSoftcap.toFixed(3)},CorporationValuation:{name:"Valuation"}};return y.a.createElement(x,{sectionName:"Corporation",rowData:e,mults:t})}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(0),r=n(121),i=n(30);function o(){return(o=Object.assign||function(t){for(var e=1;ea.createElement(i.a,o({},t,{classes:{root:s().root,...t.classes}}));function c(t){return a.createElement(l,{style:{backgroundColor:t.color},onMouseEnter:t.onMouseEnter,onClick:t.onClick})}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(50),r=n(149),i=n(0),o=n(648);function s(t){function e(e,n){if(t.ghostGrid[e][n]&&t.activeGrid[e][n])return"red";if(t.ghostGrid[e][n])return"white";if(t.activeGrid[e][n]){const a=t.gift.fragmentAt(e,n);if(!a)throw new Error("ActiveFragment should not be null");return function(t){let e=Math.pow((t.x+1)*(t.y+1),10),n=e,a=e;const r=[];for(let t=0;t<3;t++)e=171*e%30269,n=172*n%30307,a=170*a%30323,r.push((e/30269+n/30307+a/30323)%1);return`rgb(${256*r[0]}, ${256*r[1]}, ${256*r[2]})`}(a)}return""}const n=[];for(let r=0;rt.enter(n,r),onClick:()=>t.click(n,r),color:e(n,r)}));n.push(i.createElement(a.a,{key:r},s))}return i.createElement(r.a,null,n)}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(24);function r(t){if(null!=t.ramUsage&&t.ramUsage>0)return t.ramUsage;const e=Object(a.d)(t.server);if(null==e)return 0;for(let n=0;n"*"==t).length)return r.globError="Only a single glob is supported per command.\nexample: `nano my-dir/*.js`",r;[r.preGlob,r.postGlob]=t.split("*"),r.preGlob=Object(a.k)(r.preGlob);const i=Object(a.l)(n.cwd());return r.preGlob=`${i}/${r.preGlob}`,e.forEach(t=>{const e=t.filename.startsWith("/")?t.filename:"/"+t.filename;e.startsWith(r.preGlob)&&e.endsWith(r.postGlob)&&r.globMatches.push(e)}),r.glob=`${r.preGlob}*${r.postGlob}`,r}(""+t[0],e.getCurrentServer().scripts,n)}return null}function c(t,{terminal:e,router:n,player:a,args:c},f){if(c.length<1)return void e.error(`Incorrect usage of ${t} command. Usage: ${t} [scriptname]`);let u=c;try{const m=l(c,a,e);if(m){if(!1===Object(o.isEmpty)(m.globError))throw new Error(m.globError);u=m.globMatches}const h=u.map(n=>{const o=""+n;if(Object(r.a)(o)){const t=e.getFilepath(o),n=e.getScript(a,o),r=function(t){return t.endsWith(".ns")||t.endsWith(".js")}(o),l=null!==n?n.code:r?s:"";return l===s&&i.a.saveCursor(o,{row:3,column:5}),[t,l]}if(o.endsWith(".txt")){const t=e.getFilepath(o),n=e.getTextFile(a,o);return[t,null===n?"":n.text]}throw new Error("Invalid file. Only scripts (.script, .ns, .js), or text files (.txt) can be edited with "+t)});if(m&&0===h.length)throw new Error(`Could not find any valid files to open with ${t} using glob: \`${m.glob}\``);n.toScriptEditor(Object.fromEntries(h),f)}catch(t){e.error(""+t)}}},,,function(t,e,n){"use strict";function a(t){const e=t.toString(2).split(""),n=(a=e.length)<3||0==a?0==a?0:a+1:Math.ceil(Math.log2(2*a))<=Math.ceil(Math.log2(1+a+Math.ceil(Math.log2(a))))?Math.ceil(Math.log2(a)+1):Math.ceil(Math.log2(a));var a;const r=(t,e)=>t.reduce((t,n)=>n===e?t+1:t,0),i=["x","x",...e.splice(0,1)];for(let t=2;tt.reduce((t,n)=>n===e?t+1:t,0);let i=e.splice(0,1).join("");n.push(i==(r(e,"1")%2).toString());for(let t=0;t0&&0==n[0])e[o]="0"==e[o]?"1":"0";else if(0==n[0])i="0"==i?"1":"0";else if(1==n[0]&&n.some(t=>0==t))return 0;for(let t=a;t>=0;t--)e.splice(Math.pow(2,t),1);return e.splice(0,1),parseInt(e.join(""),2)}n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return r}))},,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(460),r=n(28);class i extends a.a{constructor(t=null){super(t)}getActionTypeSkillSuccessBonus(t){return t.skillMultipliers.successChanceContract}toJSON(){return Object(r.b)("Contract",this)}static fromJSON(t){return Object(r.a)(i,t.data)}}r.c.constructors.Contract=i},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={helpList:["Use 'help [command]' to get more information about a particular Bladeburner console command."," "," automate [var] [val] [hi/low] Configure simple automation for Bladeburner tasks"," clear/cls Clear the console"," help [cmd] Display this help text, or help text for a specific command"," log [en/dis] [type] Enable or disable logging for events and actions"," skill [action] [name] Level or display info about your Bladeburner skills"," start [type] [name] Start a Bladeburner action/task"," stop Stops your current Bladeburner action/task"," "],automate:["Usage: automate [var] [val] [hi/low]"," ","A simple way to automate your Bladeburner actions. This console command can be used to automatically start an action when your stamina rises above a certain threshold, and automatically switch to another action when your stamina drops below another threshold."," "," automate status - Check the current status of your automation and get a brief description of what it'll do"," automate en - Enable the automation feature"," automate dis - Disable the automation feature"," ","There are four properties that must be set for this automation to work properly. Here is how to set them:"," "," automate stamina 100 high"," automate contract Tracking high"," automate stamina 50 low"," automate general 'Field Analysis' low"," ","Using the four console commands above will set the automation to perform Tracking contracts if your stamina is 100 or higher, and then switch to Field Analysis if your stamina drops below 50. Note that when setting the action, the name of the action is CASE-SENSITIVE. It must exactly match whatever the name is in the UI."," "],clear:["Usage: clear"," ","Clears the console"," "],cls:["Usage: cls"," ","Clears the console"," "],help:["Usage: help [command]"," ","Running 'help' with no arguments displays the general help text, which lists all console commands and a brief description of what they do. A command can be specified to get more specific help text about that particular command. For example:"," "," help automate"," ","will display specific information about using the automate console command"," "],log:["Usage: log [en/dis] [type]"," ","Enable or disable logging. By default, the results of completing actions such as contracts/operations are logged in the console. There are also random events that are logged in the console as well. The five categories of things that get logged are:"," ","[general, contracts, ops, blackops, events]"," ","The logging for these categories can be enabled or disabled like so:"," "," log dis contracts - Disables logging that occurs when contracts are completed"," log en contracts - Enables logging that occurs when contracts are completed"," log dis events - Disables logging for Bladeburner random events"," ","Logging can be universally enabled/disabled using the 'all' keyword:"," "," log dis all"," log en all"," "],skill:["Usage: skill [action] [name]"," ","Level or display information about your skills."," ","To display information about all of your skills and your multipliers, use:"," "," skill list"," ","To display information about a specific skill, specify the name of the skill afterwards. Note that the name of the skill is case-sensitive. Enter it exactly as seen in the UI. If the name of the skill has whitespace, enclose the name of the skill in double quotation marks:"," "," skill list Reaper"," skill list 'Digital Observer'"," ","This console command can also be used to level up skills:"," "," skill level [skill name]"," "],start:["Usage: start [type] [name]"," ","Start an action. An action is specified by its type and its name. The name is case-sensitive. It must appear exactly as it does in the UI. If the name of the action has whitespace, enclose it in double quotation marks. Valid action types include:"," ","[general, contract, op, blackop]"," ","Examples:"," "," start contract Tracking"," start op 'Undercover Operation'"," "],stop:["Usage: stop"," ","Stop your current action and go idle."," "]}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return s}));var a=n(285),r=n(5);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={cost:0,text:""}){if(i(this,"children",[]),i(this,"cost",0),i(this,"researched",!1),i(this,"parent",null),i(this,"text",""),null==a.a[t.text])throw new Error("Invalid Research name used when constructing ResearchTree Node: "+t.text);this.text=t.text,this.cost=t.cost,t.children&&t.children.length>0&&(this.children=t.children),null!=t.parent&&(this.parent=t.parent)}addChild(t){this.children.push(t),t.parent=this}createTreantMarkup(){const t=[];for(let e=0;e${this.text}
${r.a.format(this.cost,"0,0")} Scientific Research`+n.desc+"",text:{name:this.text}}}findNode(t){if(this.text===t)return this;let e=null;for(let n=0;n0||this.sourceFileLvl(7)>0)}function i(){return null!=this.bladeburner&&this.bladeburner instanceof a.a}function o(){this.bladeburner=new a.a(this)}},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(424),r=n(268);function i(){return 3===this.bitNodeN||this.sourceFileLvl(3)>0}function o(){return null!=this.corporation&&this.corporation instanceof a.a}function s(t,e=0){if(this.corporation=new a.a({name:t}),3===this.sourceFileLvl(3)){const t=r.b[r.a.WarehouseAPI].index,e=r.b[r.a.OfficeAPI].index;this.corporation.unlockUpgrades[t]=1,this.corporation.unlockUpgrades[e]=1}this.corporation.totalShares+=e}},function(t,e,n){"use strict";n.d(e,"a",(function(){return $}));var a=n(22),r=n(119),i=n(12),o=n(152),s=n(210),l=n(347),c=n(67),f=n(424),u=n(10),m=n(26),h=n(101),d=n(105),p=n(90),g=n(25),y=n(638),b=n(244),E=n(56),v=n(44),k=n(343),_=n(199),w=n(2),S=n(109),x=n(24),C=n(6),L=n(170),O=n(103),M=n(84),T=n(326),A=n(20),R=n(222),N=n(128),P=n(339),I=n(267),F=n(1459),D=n(300),j=n(0),B=n.n(j),G=n(1460),W=n(1),H=n(8),U=n(94),q=n(34);const $={_lastUpdate:(new Date).getTime(),updateGame:function(t=1){const e=t*u.a._idleSpeed;null==w.a.totalPlaytime&&(w.a.totalPlaytime=0),null==w.a.playtimeSinceLastAug&&(w.a.playtimeSinceLastAug=0),null==w.a.playtimeSinceLastBitnode&&(w.a.playtimeSinceLastBitnode=0),w.a.totalPlaytime+=e,w.a.playtimeSinceLastAug+=e,w.a.playtimeSinceLastBitnode+=e,M.a.process(p.b,w.a,t),w.a.process(p.b,t),w.a.hasWseAccount&&Object(O.k)(t),w.a.inGang()&&null!==w.a.gang&&w.a.gang.process(t,w.a),h.c.process(w.a,t),w.a.corporation instanceof f.a&&w.a.corporation.storeCycles(t),w.a.bladeburner instanceof s.a&&w.a.bladeburner.storeCycles(t);for(let e=0;e{C.a.AutosaveInterval=60}},"Enable"));U.b.emit(t,U.d.WARNING,5e3)}(),$.Counters.autoSaveCounter=300):($.Counters.autoSaveCounter=5*C.a.AutosaveInterval,S.c.saveGame(!C.a.SuppressSavedGameToast))),$.Counters.checkFactionInvitations<=0){const t=w.a.checkForFactionInvitations();if(t.length>0){const e=t[Math.floor(Math.random()*t.length)];Object(d.c)(e)}$.Counters.checkFactionInvitations=100}if($.Counters.passiveFactionGrowth<=0){const t=Math.floor(5-$.Counters.passiveFactionGrowth);Object(d.e)(t),$.Counters.passiveFactionGrowth=5}if($.Counters.messages<=0&&(Object(k.b)(),w.a.hasAugmentation(i.a.TheRedPill)?$.Counters.messages=4500:$.Counters.messages=150),w.a.corporation instanceof f.a&&w.a.corporation.process(w.a),$.Counters.mechanicProcess<=0){if(w.a.bladeburner instanceof s.a)try{w.a.bladeburner.process(p.b,w.a)}catch(t){Object(I.a)("Exception caught in Bladeburner.process(): "+t)}$.Counters.mechanicProcess=5}$.Counters.contractGeneration<=0&&(Math.random()<=.25&&Object(l.b)(),$.Counters.contractGeneration=3e3),$.Counters.achievementsCounter<=0&&(Object(D.b)(),$.Counters.achievementsCounter=300)},load:function(t){if(Object(F.a)(),Object(G.a)(),Object(S.b)(t)){L.b.emit(),Object(o.d)(w.a),Object(r.e)(),w.a.reapplyAllSourceFiles(),w.a.hasWseAccount&&Object(O.h)(),w.a.applyEntropy(w.a.entropy),$._lastUpdate=(new Date).getTime();const t=w.a.lastUpdate,e=$._lastUpdate-t,n=Math.floor(e/u.a._idleSpeed);let i=0;if(n<3e5)for(let t=0;tP.a.emit(B.a.createElement(B.a.Fragment,null,B.a.createElement(W.a,null,"Offline for ",S,". While you were offline:"),B.a.createElement("ul",null,B.a.createElement("li",null,B.a.createElement(W.a,null,"Your scripts generated ",B.a.createElement(A.a,{money:p}))),B.a.createElement("li",null,B.a.createElement(W.a,null,"Your Hacknet Nodes generated ",y)),B.a.createElement("li",null,B.a.createElement(W.a,null,"You gained ",B.a.createElement(N.a,{reputation:c})," reputation divided amongst your factions"))))),250)}else Object(o.d)(w.a),$.start(),w.a.init(),Object(x.f)(w.a.getHomeComputer()),Object(c.b)(),Object(m.c)(),Object(r.e)(),Object(v.e)();Object(y.b)()},start:function(){const t=(new Date).getTime();let e=t-$._lastUpdate;const n=e%u.a._idleSpeed;e=Math.floor(e/u.a._idleSpeed),e>0&&($._lastUpdate=t-n,w.a.lastUpdate=t-n,$.updateGame(e)),window.requestAnimationFrame($.start)}}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";n.r(e);var a=n(815);n.d(e,"Default",(function(){return a.a}));var r=n(816);n.d(e,"DefaultLite",(function(){return r.a}));var i=n(817);n.d(e,"Monokai",(function(){return i.a}));var o=n(818);n.d(e,"Warmer",(function(){return o.a}));var s=n(819);n.d(e,"DarkPlus",(function(){return s.a}));var l=n(820);n.d(e,"MayukaiDark",(function(){return l.a}));var c=n(821);n.d(e,"Purple",(function(){return c.a}));var f=n(822);n.d(e,"SmoothGreen",(function(){return f.a}));var u=n(823);n.d(e,"Dracula",(function(){return u.a}));var m=n(824);n.d(e,"DarkBlue",(function(){return m.a}));var h=n(825);n.d(e,"DiscordLike",(function(){return h.a}));var d=n(826);n.d(e,"OneDark",(function(){return d.a}));var p=n(827);n.d(e,"MutedGoldBlue",(function(){return p.a}));var g=n(828);n.d(e,"Light",(function(){return g.a}))},,,function(t,e,n){"use strict";n.d(e,"a",(function(){return k}));var a=n(0),r=n.n(a),i=n(1844),o=n(1),s=n(278),l=n(19),c=n(121),f=n(144),u=n(84),m=n(342),h=n(2),d=n(687),p=n(90),g=n(10),y=n(417),b=n(254),E=n(298);const v=Object(c.a)(t=>Object(f.a)({root:{backgroundColor:t.colors.backgroundprimary}}));function k(){const t=v(),[e,n]=Object(a.useState)(!1),[c,f]=Object(a.useState)(!1),k=`v${g.a.VersionString} (${Object(b.a)()})`;return document.title="Bitburner "+k,Object(a.useEffect)(()=>{const t=setTimeout(()=>{c||n(!0)},2e3);return()=>clearTimeout(t)}),Object(a.useEffect)(()=>{!async function(){await Object(m.b)().then(t=>{try{d.a.load(t)}catch(t){throw Object(y.a)(),f(!0),t}Object(E.c)(),f(!0)}).catch(t=>{console.error(t),d.a.load(""),f(!0)})}()},[]),r.a.createElement(l.a,{className:t.root},c?r.a.createElement(p.a,{terminal:u.a,engine:d.a,player:h.a}):r.a.createElement(s.a,{container:!0,direction:"column",justifyContent:"center",alignItems:"center",style:{minHeight:"100vh"}},r.a.createElement(s.a,{item:!0},r.a.createElement(i.a,{size:150,color:"primary"})),r.a.createElement(s.a,{item:!0},r.a.createElement(o.a,{variant:"h3"},"Loading Bitburner ",k)),e&&r.a.createElement(s.a,{item:!0},r.a.createElement(o.a,null,"If the game fails to load, consider ",r.a.createElement("a",{href:"?noScripts"},"killing all scripts")))))}},,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return o}));var a=n(35),r=n(1415);function i(t,e=!1){const n=t instanceof a.a?t.name:t;for(const t of this.augmentations)if(t.name===n)return!0;if(!e)for(const t of this.queuedAugmentations)if(t.name===n)return!0;return!1}function o(t=1){this.reapplyAllAugmentations(),this.reapplyAllSourceFiles();const e=Object(r.a)(this,t);for(const[t,n]of Object.entries(e))this.setMult(t,n)}},function(t,e,n){"use strict";function a(t){return"number"==typeof t&&!isNaN(t)}n.d(e,"a",(function(){return a}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var a=n(117),r=n(75),i=n(28);class o{constructor(t="",e=0,n=0,i=a.a.LimitBuy,o=r.a.Long){let s=!1;if("number"==typeof e&&"number"==typeof n||(s=!0),(isNaN(e)||isNaN(n))&&(s=!0),"string"!=typeof t&&(s=!0),s)throw new Error("Invalid constructor paramters for Order");this.stockSymbol=t,this.shares=e,this.price=n,this.type=i,this.pos=o}toJSON(){return Object(i.b)("Order",this)}static fromJSON(t){return Object(i.a)(o,t.data)}}i.c.constructors.Order=o},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var a=n(4),r=n(271),i=n(61),o=n(26),s=n(1042),l=n(601),c=n(28),f=n(10),u=n(665),m=n(18),h=n(2),d=n(12);function p(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class g{constructor(){p(this,"storedCycles",0),p(this,"fragments",[])}baseSize(){return u.a.BaseSize+m.a.StaneksGiftExtraSize+h.a.sourceFileLvl(13)}width(){return Math.max(2,Math.min(Math.floor(this.baseSize()/2+1),u.a.MaxSize))}height(){return Math.max(3,Math.min(Math.floor(this.baseSize()/2+.6),u.a.MaxSize))}charge(t,e,n){n>e.highestCharge?(e.numCharge=e.highestCharge*e.numCharge/n+1,e.highestCharge=n):e.numCharge+=n/e.highestCharge;const r=o.a[a.a.ChurchOfTheMachineGod];r.playerReputation+=t.faction_rep_mult*(Math.pow(n,.95)*(r.favor+100))/1e3}inBonus(){return this.storedCycles*f.a._idleSpeed/1e3>1}process(t,e=1){t.hasAugmentation(d.a.StaneksGift1)&&(this.storedCycles+=e,this.storedCycles-=10,this.storedCycles=Math.max(0,this.storedCycles),this.updateMults(t),l.a.emit())}effect(t){let e=t.neighboors().map(t=>this.fragmentAt(t[0],t[1])).filter(t=>!!t);e=e.filter(t=>t.fragment().type===i.b.Booster);let n=1;e=e.filter((t,e,n)=>n.indexOf(t)===e);for(const t of e)n*=t.fragment().power;return Object(s.a)(t.highestCharge,t.numCharge,t.fragment().power,n)}canPlace(t,e,n,a){if(t<0||e<0)return!1;if(t+a.width(n)>this.width())return!1;if(e+a.height(n)>this.height())return!1;if(this.count(a)>=a.limit)return!1;const i=new r.a({x:t,y:e,rotation:n,fragment:a});for(const t of this.fragments)if(t.collide(i))return!1;return!0}place(t,e,n,a){return!!this.canPlace(t,e,n,a)&&(this.fragments.push(new r.a({x:t,y:e,rotation:n,fragment:a})),!0)}findFragment(t,e){return this.fragments.find(n=>n.x===t&&n.y===e)}fragmentAt(t,e){for(const n of this.fragments)if(n.fullAt(t,e))return n}count(t){let e=0;for(const n of this.fragments)n.fragment().id===t.id&&e++;return e}delete(t,e){for(let n=0;n{t.highestCharge=0,t.numCharge=0})}updateMults(t){t.applyEntropy(t.entropy);for(const e of this.fragments){const n=e.fragment(),a=this.effect(e);switch(n.type){case i.b.HackingChance:t.hacking_chance_mult*=a;break;case i.b.HackingSpeed:t.hacking_speed_mult*=a;break;case i.b.HackingMoney:t.hacking_money_mult*=a;break;case i.b.HackingGrow:t.hacking_grow_mult*=a;break;case i.b.Hacking:t.hacking_mult*=a,t.hacking_exp_mult*=a;break;case i.b.Strength:t.strength_mult*=a,t.strength_exp_mult*=a;break;case i.b.Defense:t.defense_mult*=a,t.defense_exp_mult*=a;break;case i.b.Dexterity:t.dexterity_mult*=a,t.dexterity_exp_mult*=a;break;case i.b.Agility:t.agility_mult*=a,t.agility_exp_mult*=a;break;case i.b.Charisma:t.charisma_mult*=a,t.charisma_exp_mult*=a;break;case i.b.HacknetMoney:t.hacknet_node_money_mult*=a;break;case i.b.HacknetCost:t.hacknet_node_purchase_cost_mult/=a,t.hacknet_node_ram_cost_mult/=a,t.hacknet_node_core_cost_mult/=a,t.hacknet_node_level_cost_mult/=a;break;case i.b.Rep:t.company_rep_mult*=a,t.faction_rep_mult*=a;break;case i.b.WorkMoney:t.work_money_mult*=a;break;case i.b.Crime:t.crime_success_mult*=a,t.crime_money_mult*=a;break;case i.b.Bladeburner:t.bladeburner_max_stamina_mult*=a,t.bladeburner_stamina_gain_mult*=a,t.bladeburner_analysis_mult*=a,t.bladeburner_success_chance_mult*=a}}t.updateSkillLevels()}prestigeAugmentation(){this.clearCharge()}prestigeSourceFile(){this.clear(),this.storedCycles=0}toJSON(){return Object(c.b)("StaneksGift",this)}static fromJSON(t){return Object(c.a)(g,t.data)}}c.c.constructors.StaneksGift=g},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(9);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,"city",null),r(this,"costMult",0),r(this,"expMult",0),r(this,"name",a.a.Void),r(this,"types",[]),r(this,"techVendorMaxRam",0),r(this,"techVendorMinRam",0),t.city&&(this.city=t.city),t.costMult&&(this.costMult=t.costMult),t.expMult&&(this.expMult=t.expMult),t.infiltrationData&&(this.infiltrationData=t.infiltrationData),t.name&&(this.name=t.name),t.types&&(this.types=t.types),t.techVendorMaxRam&&(this.techVendorMaxRam=t.techVendorMaxRam),t.techVendorMinRam&&(this.techVendorMinRam=t.techVendorMinRam)}}},,,,,,,,,,,function(t,e,n){"use strict";n.d(e,"b",(function(){return E})),n.d(e,"a",(function(){return v}));var a=n(0),r=n.n(a),i=n(148),o=n(149),s=n(50),l=n(30),c=n(1),f=n(5),u=n(6),m=n(73),h=n(301),d=n(20),p=n(112),g=n(484),y=n(29),b=n(66);function E(t){const e=Object(h.b)();return r.a.createElement(i.a,{sx:{display:"table",mb:1,width:"100%"}},r.a.createElement(o.a,null,r.a.createElement(m.a,{name:"City",color:u.a.theme.primary,data:{content:t.sleeve.city}}),r.a.createElement(m.a,{name:"HP",color:u.a.theme.hp,data:{content:`${f.a.formatHp(t.sleeve.hp)} / ${f.a.formatHp(t.sleeve.max_hp)}`}}),r.a.createElement(m.a,{name:"Hacking",color:u.a.theme.hack,data:{level:t.sleeve.hacking,exp:t.sleeve.hacking_exp}}),r.a.createElement(m.a,{name:"Strength",color:u.a.theme.combat,data:{level:t.sleeve.strength,exp:t.sleeve.strength_exp}}),r.a.createElement(m.a,{name:"Defense",color:u.a.theme.combat,data:{level:t.sleeve.defense,exp:t.sleeve.defense_exp}}),r.a.createElement(m.a,{name:"Dexterity",color:u.a.theme.combat,data:{level:t.sleeve.dexterity,exp:t.sleeve.dexterity_exp}}),r.a.createElement(m.a,{name:"Agility",color:u.a.theme.combat,data:{level:t.sleeve.agility,exp:t.sleeve.agility_exp}}),r.a.createElement(m.a,{name:"Charisma",color:u.a.theme.cha,data:{level:t.sleeve.charisma,exp:t.sleeve.charisma_exp}}),r.a.createElement(s.a,null,r.a.createElement(l.a,{classes:{root:e.cellNone}},r.a.createElement("br",null))),r.a.createElement(m.a,{name:"Shock",color:u.a.theme.primary,data:{content:f.a.formatSleeveShock(100-t.sleeve.shock)}}),r.a.createElement(m.a,{name:"Sync",color:u.a.theme.primary,data:{content:f.a.formatSleeveSynchro(t.sleeve.sync)}}),r.a.createElement(m.a,{name:"Memory",color:u.a.theme.primary,data:{content:f.a.formatSleeveMemory(t.sleeve.memory)}})))}function v(t){const e=Object(h.b)(),n=y.b.Player();let a=[];if(t.sleeve.currentTask===b.a.Crime)a=[["Money",r.a.createElement(r.a.Fragment,null,r.a.createElement(d.a,{money:parseFloat(t.sleeve.currentTaskLocation)})," (on success)")],["Hacking Exp",f.a.formatExp(t.sleeve.gainRatesForTask.hack)+" (2x on success)"],["Strength Exp",f.a.formatExp(t.sleeve.gainRatesForTask.str)+" (2x on success)"],["Defense Exp",f.a.formatExp(t.sleeve.gainRatesForTask.def)+" (2x on success)"],["Dexterity Exp",f.a.formatExp(t.sleeve.gainRatesForTask.dex)+" (2x on success)"],["Agility Exp",f.a.formatExp(t.sleeve.gainRatesForTask.agi)+" (2x on success)"],["Charisma Exp",f.a.formatExp(t.sleeve.gainRatesForTask.cha)+" (2x on success)"]];else if(a=[["Money:",r.a.createElement(p.a,{money:5*t.sleeve.gainRatesForTask.money})],["Hacking Exp:",f.a.formatExp(5*t.sleeve.gainRatesForTask.hack)+" / sec"],["Strength Exp:",f.a.formatExp(5*t.sleeve.gainRatesForTask.str)+" / sec"],["Defense Exp:",f.a.formatExp(5*t.sleeve.gainRatesForTask.def)+" / sec"],["Dexterity Exp:",f.a.formatExp(5*t.sleeve.gainRatesForTask.dex)+" / sec"],["Agility Exp:",f.a.formatExp(5*t.sleeve.gainRatesForTask.agi)+" / sec"],["Charisma Exp:",f.a.formatExp(5*t.sleeve.gainRatesForTask.cha)+" / sec"]],t.sleeve.currentTask===b.a.Company||t.sleeve.currentTask===b.a.Faction){const e=t.sleeve.getRepGain(n);a.push(["Reputation:",r.a.createElement(g.a,{reputation:5*e})])}return r.a.createElement(i.a,{sx:{display:"table",mb:1,width:"100%",lineHeight:0}},r.a.createElement(o.a,null,r.a.createElement(s.a,null,r.a.createElement(l.a,{classes:{root:e.cellNone}},r.a.createElement(c.a,{variant:"h6"},"Earnings"))),a.map(([t,n])=>r.a.createElement(s.a,{key:t.toString()+n.toString()},r.a.createElement(l.a,{classes:{root:e.cellNone}},r.a.createElement(c.a,null,t)),r.a.createElement(l.a,{align:"right",classes:{root:e.cellNone}},r.a.createElement(c.a,null,n))))))}},function(t,e,n){"use strict";n.d(e,"b",(function(){return u})),n.d(e,"a",(function(){return m}));var a=n(0),r=n.n(a),i=n(24),o=n(46),s=n(92),l=n(130),c=n(74),f=n(8);const u={All:0,Foreign:1,Owned:2,Purchased:3};function m(t){function e(e){const n=e instanceof o.a&&e.purchasedByPlayer,a=t.serverType;switch(a){case u.All:return!0;case u.Foreign:return"home"!==e.hostname&&!n;case u.Owned:return n||e instanceof s.a||"home"===e.hostname;case u.Purchased:return n||e instanceof s.a;default:return console.warn("Invalid ServerType specified for ServerDropdown component: "+a),!1}}const n=[];for(const t of Object(i.c)().sort((t,e)=>t.hostname.localeCompare(e.hostname)))e(t)&&n.push(r.a.createElement(c.a,{key:t.hostname,value:t.hostname},t.hostname));return r.a.createElement(l.a,{startAdornment:r.a.createElement(f.a,{onClick:t.purchase,disabled:!t.canPurchase},"Buy"),sx:{mx:1},value:t.value,onChange:t.onChange},n)}},function(t,e,n){"use strict";n.d(e,"b",(function(){return g})),n.d(e,"a",(function(){return b}));var a=n(0),r=n(20),i=n(212),o=n(1325),s=n(551),l=n(1837),c=n(785),f=n(8),u=n(45),m=n(19),h=n(1),d=n(76);function p(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const g=5;var y;!function(t){t.Pending="",t.PlayerWon="You won!",t.PlayerWonByBlackjack="You Won! Blackjack!",t.DealerWon="You lost!",t.Tie="Push! (Tie)"}(y||(y={}));class b extends i.a{constructor(t){super(t),p(this,"canStartGame",()=>{const{p:t}=this.props,{bet:e}=this.state;return t.canAfford(e)}),p(this,"startGame",()=>{if(!this.canStartGame()||Object(i.b)(this.props.p))return;this.props.p.loseMoney(this.state.bet,"casino");const t=new s.a([this.deck.safeDrawCard(),this.deck.safeDrawCard()]),e=new s.a([this.deck.safeDrawCard(),this.deck.safeDrawCard()]);this.setState({playerHand:t,dealerHand:e,gameInProgress:!0,result:y.Pending}),21===this.getTrueHandValue(t)?21===this.getTrueHandValue(e)?this.finishGame(y.Tie):this.finishGame(y.PlayerWonByBlackjack):21===this.getTrueHandValue(e)&&this.finishGame(y.DealerWon)}),p(this,"getHandValue",t=>{let e=[0];for(let n=0;n=10?e.map(t=>t+10):1===a?e.flatMap(t=>[t+1,t+11]):e.map(t=>t+a)}return e}),p(this,"getTrueHandValue",t=>{const e=this.getHandValue(t),n=e.filter(t=>t<=21);return n.length>0?(n.sort((t,e)=>t-e),n[n.length-1]):e[0]}),p(this,"getHandDisplayValues",t=>{const e=this.getHandValue(t);return this.isHandBusted(t)?[...new Set([e[0]])]:[...new Set(e.filter(t=>t<=21))]}),p(this,"isHandBusted",t=>this.getTrueHandValue(t)>21),p(this,"playerHit",t=>{if(!t.isTrusted)return;const e=this.state.playerHand.addCards(this.deck.safeDrawCard());this.setState({playerHand:e}),this.isHandBusted(e)&&this.finishGame(y.DealerWon)}),p(this,"playerStay",t=>{if(!t.isTrusted)return;let e=this.state.dealerHand;for(;;){if(!(this.getTrueHandValue(e)<=16))break;e=e.addCards(this.deck.safeDrawCard())}if(this.setState({dealerHand:e}),this.isHandBusted(e))this.finishGame(y.PlayerWon);else{const t=this.getTrueHandValue(e),n=this.getTrueHandValue(this.state.playerHand);if(t>21||n>21)throw new Error("Someone busted when not expected to");n>t?this.finishGame(y.PlayerWon):n{const e=t===y.DealerWon?0:t===y.Tie?this.state.bet:t===y.PlayerWon?2*this.state.bet:t===y.PlayerWonByBlackjack?2.5*this.state.bet:(()=>{throw new Error("Unexpected result: "+t)})();this.win(this.props.p,e),this.setState({gameInProgress:!1,result:t,gains:this.state.gains+e-this.state.bet})}),p(this,"wagerOnChange",t=>{const{p:e}=this.props,n=t.target.value,a=Math.round(parseFloat(n));isNaN(a)?this.setState({bet:0,betInput:n,wagerInvalid:!0,wagerInvalidHelperText:"Not a valid number"}):a<=0?this.setState({bet:0,betInput:n,wagerInvalid:!0,wagerInvalidHelperText:"Must bet a postive amount"}):a>1e8?this.setState({bet:0,betInput:n,wagerInvalid:!0,wagerInvalidHelperText:"Exceeds max bet"}):e.canAfford(a)?this.setState({bet:a,betInput:n,wagerInvalid:!1,wagerInvalidHelperText:"",result:y.Pending}):this.setState({bet:0,betInput:n,wagerInvalid:!0,wagerInvalidHelperText:"Not enough money"})}),p(this,"startOnClick",t=>{t.isTrusted&&(this.state.wagerInvalid||this.startGame())}),this.deck=new o.a(g);this.state={playerHand:new s.a([]),dealerHand:new s.a([]),bet:1e6,betInput:String(1e6),gameInProgress:!1,result:y.Pending,gains:0,wagerInvalid:!1,wagerInvalidHelperText:""}}render(){const{betInput:t,playerHand:e,dealerHand:n,gameInProgress:i,result:o,wagerInvalid:s,wagerInvalidHelperText:p,gains:g}=this.state,b=this.getHandDisplayValues(e),E=this.getHandDisplayValues(n);return a.createElement(a.Fragment,null,a.createElement(m.a,null,a.createElement(d.a,{value:t,label:a.createElement(a.Fragment,null,"Wager (Max: ",a.createElement(r.a,{money:1e8}),")"),disabled:i,onChange:this.wagerOnChange,error:s,helperText:s?p:"",type:"number",style:{width:"200px"},InputProps:{startAdornment:a.createElement(l.a,{position:"start"},a.createElement(h.a,null,"$"))}}),a.createElement(h.a,null,"Total earnings this session: ",a.createElement(r.a,{money:g}))),i?a.createElement(a.Fragment,null,a.createElement(f.a,{onClick:this.playerHit},"Hit"),a.createElement(f.a,{color:"secondary",onClick:this.playerStay},"Stay")):a.createElement(f.a,{onClick:this.startOnClick,disabled:s||!this.canStartGame()},"Start"),(i||o!==y.Pending)&&a.createElement(a.Fragment,null,a.createElement(m.a,{display:"flex"},a.createElement(u.a,{elevation:2},a.createElement(h.a,null,"Player"),e.cards.map((t,e)=>a.createElement(c.a,{card:t,key:e})),a.createElement(h.a,null,"Count:"," ",b.map((t,e)=>a.createElement("span",{key:e},t)).reduce((t,e)=>[t," or ",e])))),a.createElement("br",null),a.createElement(m.a,{display:"flex"},a.createElement(u.a,{elevation:2},a.createElement(h.a,null,"Dealer"),n.cards.map((t,e)=>a.createElement(c.a,{card:t,hidden:i&&0!==e,key:e})),!i&&a.createElement(a.Fragment,null,a.createElement(h.a,null,"Count:"," ",E.map((t,e)=>a.createElement("span",{key:e},t)).reduce((t,e)=>[t," or ",e])))))),o!==y.Pending&&a.createElement(h.a,null,o," ",o===y.PlayerWon&&a.createElement(r.a,{money:this.state.bet}),o===y.PlayerWonByBlackjack&&a.createElement(r.a,{money:1.5*this.state.bet}),o===y.DealerWon&&a.createElement(r.a,{money:-this.state.bet})))}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(0),r=n.n(a),i=n(260),o=n(121),s=n(144),l=n(45);const c=Object(o.a)(()=>Object(s.a)({card:{padding:"10px",border:"solid 1px #808080",backgroundColor:"white",display:"inline-block",borderRadius:"10px",fontSize:"18.5px",textAlign:"center",margin:"3px",fontWeight:"bold"},red:{color:"red"},black:{color:"black"},value:{fontSize:"20px",fontFamily:"sans-serif"}})),f=({card:t,hidden:e})=>{const n=c();let a;switch(t.suit){case i.b.Clubs:a=r.a.createElement("span",null,"♣");break;case i.b.Diamonds:a=r.a.createElement("span",null,"♦");break;case i.b.Hearts:a=r.a.createElement("span",null,"♥");break;case i.b.Spades:a=r.a.createElement("span",null,"♠");break;default:throw new Error("MissingCaseException: "+t.suit)}return r.a.createElement(l.a,{className:`${n.card} ${t.isRedSuit()?n.red:n.black}`},r.a.createElement(r.a.Fragment,null,r.a.createElement("span",{className:n.value},e?" - ":t.formatValue()),r.a.createElement("span",null,e?" - ":a)))}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(26),r=n(24),i=n(4);function o(t,e){const n=e.augmentations.slice().filter(t=>"NeuroFlux Governor"!==t);for(const e of n)if(!t.augmentations.some(t=>t.name==e))return!1;return!0}const s=[{title:"Gain root access on CSEC",fulfilled:()=>{const t=Object(r.d)("CSEC");return!(!t||!t.hasOwnProperty("hasAdminRights"))&&t.hasAdminRights}},{title:"Install the backdoor on CSEC",fulfilled:()=>{const t=Object(r.d)("CSEC");return!(!t||!t.hasOwnProperty("backdoorInstalled"))&&t.backdoorInstalled}},{title:"Join the faction hinted at in csec-test.msg",fulfilled:t=>t.factions.includes(i.a.CyberSec)},{title:"Install all the Augmentations from "+i.a.CyberSec,fulfilled:t=>o(t,a.a[i.a.CyberSec])},{title:"Join the faction hinted at in nitesec-test.msg",fulfilled:t=>t.factions.includes(i.a.NiteSec)},{title:"Install all the Augmentations from "+i.a.NiteSec,fulfilled:t=>o(t,a.a[i.a.NiteSec])},{title:"Join the faction hinted at in j3.msg",fulfilled:t=>t.factions.includes(i.a.TheBlackHand)},{title:"Install all the Augmentations from "+i.a.TheBlackHand,fulfilled:t=>o(t,a.a[i.a.TheBlackHand])},{title:"Join the faction hinted at in 19dfj3l1nd.msg",fulfilled:t=>t.factions.includes(i.a.BitRunners)},{title:"Install all the Augmentations from "+i.a.BitRunners,fulfilled:t=>o(t,a.a[i.a.BitRunners])},{title:"Complete fl1ght.exe",fulfilled:t=>t.factions.includes(i.a.Daedalus)},{title:"Install the special Augmentation from "+i.a.Daedalus,fulfilled:t=>t.augmentations.some(t=>"The Red Pill"==t.name)},{title:"Install the final backdoor and free yourself.",fulfilled:()=>!1}]},,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var a=n(10),r=n(18),i=n(34);function o(t){const e=1e3/a.a._idleSpeed;let n=0,o=0,s=0,l=0,c=0,f=0,u=0;const m=t.hashManager;switch(t.className){case i.a.StudyComputerScience:o=a.a.ClassStudyComputerScienceBaseExp*t.workExpMult/e*m.getStudyMult();break;case i.a.DataStructures:n=a.a.ClassDataStructuresBaseCost*t.workCostMult/e,o=a.a.ClassDataStructuresBaseExp*t.workExpMult/e*m.getStudyMult();break;case i.a.Networks:n=a.a.ClassNetworksBaseCost*t.workCostMult/e,o=a.a.ClassNetworksBaseExp*t.workExpMult/e*m.getStudyMult();break;case i.a.Algorithms:n=a.a.ClassAlgorithmsBaseCost*t.workCostMult/e,o=a.a.ClassAlgorithmsBaseExp*t.workExpMult/e*m.getStudyMult();break;case i.a.Management:n=a.a.ClassManagementBaseCost*t.workCostMult/e,u=a.a.ClassManagementBaseExp*t.workExpMult/e*m.getStudyMult();break;case i.a.Leadership:n=a.a.ClassLeadershipBaseCost*t.workCostMult/e,u=a.a.ClassLeadershipBaseExp*t.workExpMult/e*m.getStudyMult();break;case i.a.GymStrength:n=a.a.ClassGymBaseCost*t.workCostMult/e,s=t.workExpMult/e*m.getTrainingMult();break;case i.a.GymDefense:n=a.a.ClassGymBaseCost*t.workCostMult/e,l=t.workExpMult/e*m.getTrainingMult();break;case i.a.GymDexterity:n=a.a.ClassGymBaseCost*t.workCostMult/e,c=t.workExpMult/e*m.getTrainingMult();break;case i.a.GymAgility:n=a.a.ClassGymBaseCost*t.workCostMult/e,f=t.workExpMult/e*m.getTrainingMult();break;default:throw new Error("ERR: Invalid/unrecognized class name")}return{workMoneyLossRate:n,workHackExpGainRate:o*t.hacking_exp_mult*r.a.ClassGymExpGain,workStrExpGainRate:s*t.strength_exp_mult*r.a.ClassGymExpGain,workDefExpGainRate:l*t.defense_exp_mult*r.a.ClassGymExpGain,workDexExpGainRate:c*t.dexterity_exp_mult*r.a.ClassGymExpGain,workAgiExpGainRate:f*t.agility_exp_mult*r.a.ClassGymExpGain,workChaExpGainRate:u*t.charisma_exp_mult*r.a.ClassGymExpGain}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(99);const r={longestName:0,longestSymbol:0};for(const t of Object.keys(a.a))r.longestName=Math.max(t.length,r.longestName),r.longestSymbol=Math.max(a.a[t].length,r.longestSymbol)},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(0),r=n.n(a),i=n(19),o=n(1),s=n(6),l=n(1396);function c({achievement:t,unlockedOn:e,cssFiltersUnlocked:n,cssFiltersLocked:a}){if(!t)return r.a.createElement(r.a.Fragment,null);const c=!!e,f=c?s.a.theme.primary:s.a.theme.secondarylight;let u="";return e&&(u=new Date(e).toLocaleString()),r.a.createElement(i.a,{sx:{border:"1px solid "+s.a.theme.well,mb:2}},r.a.createElement(i.a,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap"}},r.a.createElement(l.a,{achievement:t,unlocked:c,size:"72px",colorFilters:c?n:a}),r.a.createElement(i.a,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",px:1}},r.a.createElement(o.a,{variant:"h6",sx:{color:f}},t.Name),r.a.createElement(o.a,{variant:"body2",sx:{maxWidth:"500px",color:f}},t.Description),c&&r.a.createElement(o.a,{variant:"caption",sx:{fontSize:"12px",color:s.a.theme.primarydark}},"Acquired on ",u))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));class a{constructor(t,e,n){this.set(t,e,n)}toString(){return`rgb(${Math.round(this.r)}, ${Math.round(this.g)}, ${Math.round(this.b)})`}set(t,e,n){this.r=this.clamp(t),this.g=this.clamp(e),this.b=this.clamp(n)}hueRotate(t=0){t=t/180*Math.PI;const e=Math.sin(t),n=Math.cos(t);this.multiply([.213+.787*n-.213*e,.715-.715*n-.715*e,.072-.072*n+.928*e,.213-.213*n+.143*e,.715+.285*n+.14*e,.072-.072*n-.283*e,.213-.213*n-.787*e,.715-.715*n+.715*e,.072+.928*n+.072*e])}grayscale(t=1){this.multiply([.2126+.7874*(1-t),.7152-.7152*(1-t),.0722-.0722*(1-t),.2126-.2126*(1-t),.7152+.2848*(1-t),.0722-.0722*(1-t),.2126-.2126*(1-t),.7152-.7152*(1-t),.0722+.9278*(1-t)])}sepia(t=1){this.multiply([.393+.607*(1-t),.769-.769*(1-t),.189-.189*(1-t),.349-.349*(1-t),.686+.314*(1-t),.168-.168*(1-t),.272-.272*(1-t),.534-.534*(1-t),.131+.869*(1-t)])}saturate(t=1){this.multiply([.213+.787*t,.715-.715*t,.072-.072*t,.213-.213*t,.715+.285*t,.072-.072*t,.213-.213*t,.715-.715*t,.072+.928*t])}multiply(t){const e=this.clamp(this.r*t[0]+this.g*t[1]+this.b*t[2]),n=this.clamp(this.r*t[3]+this.g*t[4]+this.b*t[5]),a=this.clamp(this.r*t[6]+this.g*t[7]+this.b*t[8]);this.r=e,this.g=n,this.b=a}brightness(t=1){this.linear(t)}contrast(t=1){this.linear(t,-.5*t+.5)}linear(t=1,e=0){this.r=this.clamp(this.r*t+255*e),this.g=this.clamp(this.g*t+255*e),this.b=this.clamp(this.b*t+255*e)}invert(t=1){this.r=this.clamp(255*(t+this.r/255*(1-2*t))),this.g=this.clamp(255*(t+this.g/255*(1-2*t))),this.b=this.clamp(255*(t+this.b/255*(1-2*t)))}hsl(){const t=this.r/255,e=this.g/255,n=this.b/255,a=Math.max(t,e,n),r=Math.min(t,e,n);let i,o,s=(a+r)/2;if(a===r)i=o=0;else{const l=a-r;switch(o=s>.5?l/(2-a-r):l/(a+r),a){case t:i=(e-n)/l+(e255?t=255:t<0&&(t=0),t}}class r{constructor(t){this.target=t,this.targetHSL=t.hsl(),this.reusedColor=new a(0,0,0)}solve(){const t=this.solveNarrow(this.solveWide());return{values:t.values,loss:t.loss,filter:this.css(t.values)}}solveWide(){const t=[60,180,18e3,600,1.2,1.2];let e={loss:1/0};for(let n=0;e.loss>25&&n<3;n++){const n=[50,20,3750,50,100,100],a=this.spsa(5,t,15,n,1e3);a.loss.5?1:-1,l[t]=a[t]+r*s[t],c[t]=a[t]-r*s[t];const m=this.loss(l)-this.loss(c);for(let n=0;n<6;n++){const i=m/(2*r)*s[n],o=e[n]/Math.pow(t+u+1,1);a[n]=f(a[n]-o*i,n)}const h=this.loss(a);hn?t%=n:t<0&&(t=n+t%n):t<0?t=0:t>n&&(t=n),t}}loss(t){const e=this.reusedColor;e.set(0,0,0),e.invert(t[0]/100),e.sepia(t[1]/100),e.saturate(t[2]/100),e.hueRotate(3.6*t[3]),e.brightness(t[4]/100),e.contrast(t[5]/100);const n=e.hsl();return Math.abs(e.r-this.target.r)+Math.abs(e.g-this.target.g)+Math.abs(e.b-this.target.b)+Math.abs(n.h-this.targetHSL.h)+Math.abs(n.s-this.targetHSL.s)+Math.abs(n.l-this.targetHSL.l)}css(t){function e(e,n=1){return Math.round(t[e]*n)}return`invert(${e(0)}%) sepia(${e(1)}%) saturate(${e(2)}%) hue-rotate(${e(3,3.6)}deg) brightness(${e(4)}%) contrast(${e(5)}%)`}}function i(t){const e=function(t){t=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(t,e,n,a)=>e+e+n+n+a+a);const e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]:null}(t);if(!e)return"";const[n,i,o]=e,s=new a(n,i,o);return new r(s).solve().filter}},,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={name:"Default",description:"Default game theme, most supported",credit:"hydroflame",screenshot:n(921).a,colors:{primarylight:"#0f0",primary:"#0c0",primarydark:"#090",successlight:"#0f0",success:"#0c0",successdark:"#090",errorlight:"#f00",error:"#c00",errordark:"#900",secondarylight:"#AAA",secondary:"#888",secondarydark:"#666",warninglight:"#ff0",warning:"#cc0",warningdark:"#990",infolight:"#69f",info:"#36c",infodark:"#039",welllight:"#444",well:"#222",white:"#fff",black:"#000",hp:"#dd3434",money:"#ffd700",hack:"#adff2f",combat:"#faffdf",cha:"#a671d1",int:"#6495ed",rep:"#faffdf",disabled:"#66cfbc",backgroundprimary:"#000",backgroundsecondary:"#000",button:"#333"}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={name:"Default-lite",description:"Less eye-straining default theme",credit:"NmuGmu",reference:"https://discord.com/channels/415207508303544321/921991895230611466/925263801564151888",screenshot:n(922).a,colors:{primarylight:"#28CF28",primary:"#21A821",primarydark:"#177317",successlight:"#1CFF1C",success:"#16CA16",successdark:"#0D910D",errorlight:"#FF3B3B",error:"#C32D2D",errordark:"#8E2121",secondarylight:"#B3B3B3",secondary:"#838383",secondarydark:"#676767",warninglight:"#FFFF3A",warning:"#C3C32A",warningdark:"#8C8C1E",infolight:"#64CBFF",info:"#3399CC",infodark:"#246D91",welllight:"#404040",well:"#1C1C1C",white:"#C3C3C3",black:"#0A0B0B",hp:"#C62E2E",money:"#D6BB27",hack:"#ADFF2F",combat:"#E8EDCD",cha:"#8B5FAF",int:"#537CC8",rep:"#E8EDCD",disabled:"#5AB5A5",backgroundprimary:"#0C0D0E",backgroundsecondary:"#121415",button:"#252829"}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={name:"Monokai'ish",description:"Monokai'ish",credit:"eltea",screenshot:n(923).a,colors:{primarylight:"#FFF",primary:"#F8F8F2",primarydark:"#FAFAEB",successlight:"#ADE146",success:"#A6E22E",successdark:"#98E104",errorlight:"#FF69A0",error:"#F92672",errordark:"#D10F56",secondarylight:"#AAA",secondary:"#888",secondarydark:"#666",warninglight:"#E1D992",warning:"#E6DB74",warningdark:"#EDDD54",infolight:"#92E1F1",info:"#66D9EF",infodark:"#31CDED",welllight:"#444",well:"#222",white:"#fff",black:"#000",hp:"#F92672",money:"#E6DB74",hack:"#A6E22E",combat:"#75715E",cha:"#AE81FF",int:"#66D9EF",rep:"#E69F66",disabled:"#66cfbc",backgroundprimary:"#272822",backgroundsecondary:"#1B1C18",button:"#333"}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={name:"Warmer",credit:"hexnaught",description:"Warmer, softer theme",reference:"https://discord.com/channels/415207508303544321/921991895230611466/921999581020028938",screenshot:n(924).a,colors:{primarylight:"#EA9062",primary:"#DD7B4A",primarydark:"#D3591C",successlight:"#6ACF6A",success:"#43BF43",successdark:"#3E913E",errorlight:"#C15757",error:"#B34141",errordark:"#752525",secondarylight:"#AAA",secondary:"#888",secondarydark:"#666",warninglight:"#E6E69D",warning:"#DADA56",warningdark:"#A1A106",infolight:"#69f",info:"#36c",infodark:"#039",welllight:"#444",well:"#222",white:"#fff",black:"#000",hp:"#dd3434",money:"#ffd700",hack:"#adff2f",combat:"#faffdf",cha:"#AD84CF",int:"#6495ed",rep:"#faffdf",disabled:"#76C6B7",backgroundprimary:"#000",backgroundsecondary:"#000",button:"#333"}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={name:"Dark+",credit:"LoganMD",description:"VSCode Dark+",reference:"https://discord.com/channels/415207508303544321/921991895230611466/921999975867617310",screenshot:n(925).a,colors:{primarylight:"#E0E0BC",primary:"#CCCCAE",primarydark:"#B8B89C",successlight:"#00F000",success:"#00D200",successdark:"#00B400",errorlight:"#F00000",error:"#C80000",errordark:"#A00000",secondarylight:"#B4AEAE",secondary:"#969090",secondarydark:"#787272",warninglight:"#F0F000",warning:"#C8C800",warningdark:"#A0A000",infolight:"#69f",info:"#36c",infodark:"#039",welllight:"#444",well:"#222",white:"#fff",black:"#1E1E1E",hp:"#dd3434",money:"#ffd700",hack:"#adff2f",combat:"#faffdf",cha:"#a671d1",int:"#6495ed",rep:"#faffdf",disabled:"#66cfbc",backgroundprimary:"#1E1E1E",backgroundsecondary:"#252525",button:"#333"}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={name:"Mayukai Dark",description:"Mayukai Dark-esque",credit:"Festive Noire",reference:"https://discord.com/channels/415207508303544321/921991895230611466/922037502334889994",screenshot:n(926).a,colors:{primarylight:"#DDDFC5",primary:"#CDCFB6",primarydark:"#9D9F8C",successlight:"#00EF00",success:"#00A500",successdark:"#007A00",errorlight:"#F92672",error:"#CA1C5C",errordark:"#90274A",secondarylight:"#AAA",secondary:"#888",secondarydark:"#666",warninglight:"#D3D300",warning:"#cc0",warningdark:"#990",infolight:"#69f",info:"#36c",infodark:"#039",welllight:"#444",well:"#00010A",white:"#fff",black:"#020509",hp:"#dd3434",money:"#ffd700",hack:"#8CCF27",combat:"#faffdf",cha:"#a671d1",int:"#6495ed",rep:"#faffdf",disabled:"#66cfbc",backgroundprimary:"#080C11",backgroundsecondary:"#03080F",button:"#00010A"}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={name:"Purple",credit:"zer0ney",description:"Essentially all defaults except for purple replacing the main colors",reference:"https://discord.com/channels/415207508303544321/921991895230611466/922091815849570395",screenshot:n(927).a,colors:{primarylight:"#BA55D3",primary:"#9370DB",primarydark:"#8A2BE2",successlight:"#BA55D3",success:"#9370DB",successdark:"#8A2BE2",errorlight:"#f00",error:"#c00",errordark:"#900",secondarylight:"#AAA",secondary:"#888",secondarydark:"#666",warninglight:"#ff0",warning:"#cc0",warningdark:"#990",infolight:"#69f",info:"#36c",infodark:"#039",welllight:"#444",well:"#222",white:"#fff",black:"#000",hp:"#dd3434",money:"#ffd700",hack:"#adff2f",combat:"#faffdf",cha:"#a671d1",int:"#6495ed",rep:"#faffdf",disabled:"#66cfbc",backgroundprimary:"#000",backgroundsecondary:"#000",button:"#333"}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={name:"Smooth Green",description:"A nice green theme that doesn't hurt your eyes.",credit:"Swidt",reference:"https://discord.com/channels/415207508303544321/921991895230611466/922243957986033725",screenshot:n(928).a,colors:{primarylight:"#E0E0BC",primary:"#B0D9A3",primarydark:"#B8B89C",successlight:"#00F000",success:"#6BC16B",successdark:"#00B400",errorlight:"#F00000",error:"#3D713D",errordark:"#A00000",secondarylight:"#B4AEAE",secondary:"#8FAF85",secondarydark:"#787272",warninglight:"#F0F000",warning:"#38F100",warningdark:"#A0A000",infolight:"#69f",info:"#36c",infodark:"#039",welllight:"#444",well:"#2F3C2B",white:"#fff",black:"#1E1E1E",hp:"#dd3434",money:"#4AA52E",hack:"#adff2f",combat:"#faffdf",cha:"#a671d1",int:"#6495ed",rep:"#35A135",disabled:"#66cfbc",backgroundprimary:"#1E1E1E",backgroundsecondary:"#252525",button:"#2F3C2B"}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={name:"Dracula",description:"Dracula Look-alike",credit:"H3draut3r",reference:"https://discord.com/channels/415207508303544321/921991895230611466/922296307836678144",screenshot:n(929).a,colors:{primarylight:"#7082B8",primary:"#F8F8F2",primarydark:"#FF79C6",successlight:"#0f0",success:"#0c0",successdark:"#090",errorlight:"#FD4545",error:"#FF2D2D",errordark:"#C62424",secondarylight:"#AAA",secondary:"#8BE9FD",secondarydark:"#666",warninglight:"#FFC281",warning:"#FFB86C",warningdark:"#E6A055",infolight:"#A0A0FF",info:"#7070FF",infodark:"#4040FF",welllight:"#44475A",well:"#363948",white:"#fff",black:"#282A36",hp:"#D34448",money:"#50FA7B",hack:"#F1FA8C",combat:"#BD93F9",cha:"#FF79C6",int:"#6495ed",rep:"#faffdf",disabled:"#66cfbc",backgroundprimary:"#282A36",backgroundsecondary:"#21222C",button:"#21222C"}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={name:"Dark Blue",description:"Very dark with a blue/purplelly primary",credit:"Saynt_Garmo",reference:"https://discord.com/channels/415207508303544321/921991895230611466/923084732718264340",screenshot:n(930).a,colors:{primarylight:"#023DDE",primary:"#4A41C8",primarydark:"#005299",successlight:"#00FF00",success:"#D1DAD1",successdark:"#BFCABF",errorlight:"#f00",error:"#c00",errordark:"#900",secondarylight:"#AAA",secondary:"#888",secondarydark:"#666",warninglight:"#ff0",warning:"#cc0",warningdark:"#990",infolight:"#69f",info:"#36c",infodark:"#039",welllight:"#444",well:"#040505",white:"#fff",black:"#000000",hp:"#dd3434",money:"#ffd700",hack:"#adff2f",combat:"#faffdf",cha:"#a671d1",int:"#6495ed",rep:"#faffdf",disabled:"#66cfbc",backgroundprimary:"#091419",backgroundsecondary:"#000000",button:"#000000"}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={name:"Discord-like",description:"Discord inspired theme",credit:"Thermite",reference:"https://discord.com/channels/415207508303544321/921991895230611466/924305252017143818",screenshot:n(931).a,colors:{primarylight:"#7389DC",primary:"#7389DC",primarydark:"#5964F1",successlight:"#00CC00",success:"#20DF20",successdark:"#0CB80C",errorlight:"#EA5558",error:"#EC4145",errordark:"#E82528",secondarylight:"#C3C3C3",secondary:"#9C9C9C",secondarydark:"#4E4E4E",warninglight:"#ff0",warning:"#cc0",warningdark:"#990",infolight:"#69f",info:"#36c",infodark:"#1C4FB3",welllight:"#999999",well:"#35383C",white:"#FFFFFF",black:"#202225",hp:"#FF5656",money:"#43FF43",hack:"#FFAB3D",combat:"#8A90FD",cha:"#FF51D9",int:"#6495ed",rep:"#FFFF30",disabled:"#474B51",backgroundprimary:"#2F3136",backgroundsecondary:"#35393E",button:"#333"}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={name:"One Dark",description:"Dark with a greenish tint",credit:"Dexalt142",reference:"https://discord.com/channels/415207508303544321/921991895230611466/924650660694208512",screenshot:n(932).a,colors:{primarylight:"#98C379",primary:"#98C379",primarydark:"#98C379",successlight:"#98C379",success:"#98C379",successdark:"#98C379",errorlight:"#E06C75",error:"#BE5046",errordark:"#BE5046",secondarylight:"#AAA",secondary:"#888",secondarydark:"#666",warninglight:"#E5C07B",warning:"#E5C07B",warningdark:"#D19A66",infolight:"#61AFEF",info:"#61AFEF",infodark:"#61AFEF",welllight:"#4B5263",well:"#282C34",white:"#ABB2BF",black:"#282C34",hp:"#E06C75",money:"#E5C07B",hack:"#98C379",combat:"#ABB2BF",cha:"#C678DD",int:"#61AFEF",rep:"#ABB2BF",disabled:"#56B6C2",backgroundprimary:"#282C34",backgroundsecondary:"#21252B",button:"#4B5263"}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={name:"Muted Gold & Blue",description:"Muted gold with blue accents.",credit:"Sloth",reference:"https://discord.com/channels/415207508303544321/921991895230611466/924672660758208563",screenshot:n(933).a,colors:{primarylight:"#E3B54A",primary:"#CAA243",primarydark:"#7E6937",successlight:"#82FF82",success:"#6FDA6F",successdark:"#64C364",errorlight:"#FD5555",error:"#D84A4A",errordark:"#AC3939",secondarylight:"#D8D0B8",secondary:"#B1AA95",secondarydark:"#736E5E",warninglight:"#ff0",warning:"#cc0",warningdark:"#990",infolight:"#69f",info:"#36c",infodark:"#039",welllight:"#444",well:"#111111",white:"#fff",black:"#070300",hp:"#dd3434",money:"#ffd700",hack:"#adff2f",combat:"#faffdf",cha:"#a671d1",int:"#6495ed",rep:"#faffdf",disabled:"#66cfbc",backgroundprimary:"#0A0A0E",backgroundsecondary:"#0E0E10",button:"#222222"}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={name:"Light",description:"Cobbled Together Light Theme",credit:"matt",reference:"https://discord.com/channels/415207508303544321/921991895230611466/926114005456658432",screenshot:n(934).a,colors:{primarylight:"#535353",primary:"#1A1A1A",primarydark:"#0d0d0d",successlight:"#63c439",success:"#428226",successdark:"#2E5A1B",errorlight:"#df7051",error:"#C94824",errordark:"#91341B",secondarylight:"#b3b3b3",secondary:"#9B9B9B",secondarydark:"#7A7979",warninglight:"#e8d464",warning:"#C6AD20",warningdark:"#9F8A16",infolight:"#6299cf",info:"#3778B7",infodark:"#30689C",welllight:"#f9f9f9",well:"#eaeaea",white:"#F7F7F7",black:"#F7F7F7",hp:"#BF5C41",money:"#E1B121",hack:"#47BC38",combat:"#656262",cha:"#A568AC",int:"#889BCF",rep:"#656262",disabled:"#70B4BF",backgroundprimary:"#F7F7F7",backgroundsecondary:"#f9f9f9",button:"#eaeaea"}}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";e.a="dist/images/83b2443ab7e7d346766c8f6bc5afc7a7.png"},function(t,e,n){"use strict";e.a="dist/images/6caf35202b10b52e1fc2743f674c33e8.png"},function(t,e,n){"use strict";e.a="dist/images/cb88977ea837bccb9cceb727adc78302.png"},function(t,e,n){"use strict";e.a="dist/images/4e0e750f2f09de58219773edd46cbbf5.png"},function(t,e,n){"use strict";e.a="dist/images/e97de4daa946331c7e99dee9c05d629c.png"},function(t,e,n){"use strict";e.a="dist/images/9f96a5084f4e5f1a6c0041b41b34d62d.png"},function(t,e,n){"use strict";e.a="dist/images/85a7b2896acb62be76f3ea7100fe9012.png"},function(t,e,n){"use strict";e.a="dist/images/5aa87b7de67a77c914088783b055e1cf.png"},function(t,e,n){"use strict";e.a="dist/images/c7164b072d62c91c27c6d607b5207e7b.png"},function(t,e,n){"use strict";e.a="dist/images/66f4b86d86164fc117bd6d648e4eaa6f.png"},function(t,e,n){"use strict";e.a="dist/images/a1110d6c8d16a14c4570411750248399.png"},function(t,e,n){"use strict";e.a="dist/images/447bc31e61f55e7eff875be3e9a81f1a.png"},function(t,e,n){"use strict";e.a="dist/images/297df8c0e47764ea113951318b2acf55.png"},function(t,e,n){"use strict";e.a="dist/images/e66b0c327f97d08e4253f52234d659eb.png"},,,,,,,,,,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return ut}));var a=n(246),r=n(92),i=n(46),o=n(65),s=n(116),l=n(328),c=n(100),f=n(10),u=n(24),m=n(83),h=n(480),d=n(44),p=n(137),g=n(485),y=n(88),b=n(6),E=n(253),v=n(102),k=n(5),_=n(22),w=n(1418),S=n(1419),x=n(1420),C=n(1421),L=n(1422),O=n(1423),M=n(1424),T=n(1425),A=n(1426),R=n(603),N=n(1427),P=n(1428),I=n(1429),F=n(1430),D=n(1431),j=n(1432),B=n(1433),G=n(1434),W=n(1435),H=n(1436),U=n(1437),q=n(1438),$=n(1439),K=n(1440),z=n(1441),V=n(1443),Y=n(1444),J=n(1445),X=n(1448),Q=n(1449),Z=n(1450),tt=n(1451),et=n(1452),nt=n(1453),at=n(1454),rt=n(1455),it=n(1456),ot=n(1457),st=n(254),lt=n(1458),ct=n(18);function ft(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class ut{constructor(){ft(this,"action",null),ft(this,"commandHistory",[]),ft(this,"commandHistoryIndex",0),ft(this,"outputHistory",[new a.b(`Bitburner v${f.a.VersionString} (${Object(st.a)()})`,"primary")]),ft(this,"contractOpen",!1),ft(this,"currDir","/")}process(t,e,n){null!==this.action&&(this.action.timeLeft-=f.a._idleSpeed*n/1e3,this.action.timeLeft<.01&&this.finishAction(t,e,!1),l.b.emit())}append(t){this.outputHistory.push(t),this.outputHistory.length>b.a.MaxTerminalCapacity&&this.outputHistory.splice(0,this.outputHistory.length-b.a.MaxTerminalCapacity),l.b.emit()}print(t){this.append(new a.b(t,"primary"))}printRaw(t){this.append(new a.c(t))}error(t){this.append(new a.b(t,"error"))}success(t){this.append(new a.b(t,"success"))}info(t){this.append(new a.b(t,"info"))}warn(t){this.append(new a.b(t,"warn"))}startHack(t){const e=t.getCurrentServer();if(e instanceof r.a)this.error("Cannot hack this kind of server");else{if(!(e instanceof i.a))throw new Error("server should be normal server");this.startAction(Object(v.d)(e,t)/4,"h",e)}}startGrow(t){const e=t.getCurrentServer();if(e instanceof r.a)this.error("Cannot grow this kind of server");else{if(!(e instanceof i.a))throw new Error("server should be normal server");this.startAction(Object(v.a)(e,t)/16,"g",e)}}startWeaken(t){const e=t.getCurrentServer();if(e instanceof r.a)this.error("Cannot weaken this kind of server");else{if(!(e instanceof i.a))throw new Error("server should be normal server");this.startAction(Object(v.f)(e,t)/16,"w",e)}}startBackdoor(t){const e=t.getCurrentServer();if(e instanceof r.a)this.error("Cannot backdoor this kind of server");else{if(!(e instanceof i.a))throw new Error("server should be normal server");this.startAction(Object(v.d)(e,t)/4,"b",e)}}startAnalyze(t){this.print("Analyzing system...");const e=t.getCurrentServer();this.startAction(1,"a",e)}startAction(t,e,n){this.action=new a.d(t,e,n)}finishHack(t,e,n,a=!1){if(a)return;if(n instanceof r.a)return void this.error("Cannot hack this kind of server");if(!(n instanceof i.a))throw new Error("server should be normal server");const o=Object(v.b)(n,e),s=Math.random(),l=Object(v.c)(n,e),c=l/4;if(s0;if(this.print("Can run scripts on this host: "+(s?"YES":"NO")),this.print("RAM: "+k.a.formatRAM(e.maxRam)),e instanceof i.a){this.print("Backdoor: "+(e.backdoorInstalled?"YES":"NO"));const a=e.requiredHackingSkill;this.print("Required hacking skill for hack() and backdoor: "+(n?"N/A":a));const r=e.hackDifficulty;this.print("Server security level: "+(n?"N/A":k.a.formatServerSecurity(r)));const i=Object(v.b)(e,t);this.print("Chance to hack: "+(n?"N/A":k.a.formatPercentage(i)));const o=1e3*Object(v.d)(e,t);this.print("Time to hack: "+(n?"N/A":Object(_.d)(o,!0)))}if(this.print("Total money available on server: "+(e instanceof i.a?k.a.formatMoney(e.moneyAvailable):"N/A")),e instanceof i.a){const t=e.numOpenPortsRequired;this.print("Required number of open ports for NUKE: "+(n?"N/A":t)),this.print("SSH port: "+(e.sshPortOpen?"Open":"Closed")),this.print("FTP port: "+(e.ftpPortOpen?"Open":"Closed")),this.print("SMTP port: "+(e.smtpPortOpen?"Open":"Closed")),this.print("HTTP port: "+(e.httpPortOpen?"Open":"Closed")),this.print("SQL port: "+(e.sqlPortOpen?"Open":"Closed"))}}}finishAction(t,e,n=!1){if(null!==this.action){if(!this.action.server)throw new Error("Missing action target server");this.print(this.getProgressText()),"h"===this.action.action?this.finishHack(t,e,this.action.server,n):"g"===this.action.action?this.finishGrow(e,this.action.server,n):"w"===this.action.action?this.finishWeaken(e,this.action.server,n):"b"===this.action.action?this.finishBackdoor(t,e,this.action.server,n):"a"===this.action.action&&this.finishAnalyze(e,this.action.server,n),n&&this.print("Cancelled"),this.action=null,l.b.emit()}else if(!n)throw new Error("Finish action called when there was no action")}getFile(t,e){return Object(c.a)(e)?this.getScript(t,e):e.endsWith(".lit")?this.getLitFile(t,e):e.endsWith(".txt")?this.getTextFile(t,e):null}getFilepath(t){const e=Object(m.d)(t,this.cwd());if(null==e)throw new Error("Invalid file path specified: "+t);return Object(m.h)(e)?Object(m.k)(e):e}getScript(t,e){const n=t.getCurrentServer(),a=this.getFilepath(e);for(const t of n.scripts)if(a===t.filename)return t;return null}getTextFile(t,e){const n=t.getCurrentServer(),a=this.getFilepath(e);for(const t of n.textFiles)if(a===t.fn)return t;return null}getLitFile(t,e){const n=t.getCurrentServer(),a=this.getFilepath(e);for(const t of n.messages)if("string"==typeof t&&a===t)return t;return null}cwd(){return this.currDir}setcwd(t){this.currDir=t,l.b.emit()}async runContract(t,e){if(this.contractOpen)return this.error("There's already a Coding Contract in Progress");const n=t.getCurrentServer(),a=n.getContract(e);if(null==a)return this.error("No such contract");this.contractOpen=!0;const r=await a.prompt();if(null==n.getContract(e))return this.contractOpen=!1,this.error("Contract no longer exists (Was it solved by a script?)");switch(r){case s.b.Success:if(null!==a.reward){const e=t.gainCodingContractReward(a.reward,a.getDifficulty());this.print("Contract SUCCESS - "+e)}n.removeContract(a);break;case s.b.Failure:++a.tries,a.tries>=a.getMaxNumTries()?(this.error("Contract FAILED - Contract is now self-destructing"),n.removeContract(a)):this.error(`Contract FAILED - ${a.getMaxNumTries()-a.tries} tries remaining`);break;case s.b.Cancelled:default:this.print("Contract cancelled")}this.contractOpen=!1}executeScanAnalyzeCommand(t,e=1,n=!1){this.print("~~~~~~~~~~ Beginning scan-analyze ~~~~~~~~~~"),this.print(" ");const i={};for(const t of Object(u.c)())i[t.hostname]=0;const s=[],l=[0],c=t.getCurrentServer();for(s.push(c);0!=s.length;){const c=s.pop();if(!c)continue;const f=l.pop();if(void 0===f)continue;const u=c instanceof r.a;if(!n&&c.purchasedByPlayer&&"home"!=c.hostname)continue;if(i[c.hostname]||f>e)continue;if(!n&&u)continue;i[c.hostname]=1;for(let t=c.serversOnNetwork.length-1;t>=0;--t){const e=Object(p.a)(c,t);null!==e&&(s.push(e),l.push(f+1))}if(0==f)continue;const m=Array(4*(f-1)+1).join("-");t.hasProgram(o.a.AutoLink.name)?this.append(new a.a(m,c.hostname)):this.print(m+c.hostname);const h=m+"--";let d="NO";c.hasAdminRights&&(d="YES"),this.print(`${h}Root Access: ${d}${u?"":", Required hacking skill: "+c.requiredHackingSkill}`),c.hasOwnProperty("numOpenPortsRequired")&&this.print(h+"Number of open ports required to NUKE: "+c.numOpenPortsRequired),this.print(h+"RAM: "+k.a.formatRAM(c.maxRam)),this.print(" ")}}connectToServer(t,e){const n=Object(u.d)(e);null!=n?(t.getCurrentServer().isConnectedTo=!1,t.currentServer=n.hostname,t.getCurrentServer().isConnectedTo=!0,this.print("Connected to "+n.hostname),this.setcwd("/"),"darkweb"==t.getCurrentServer().hostname&&Object(h.c)()):this.error("Invalid server. Connection failed.")}executeCommands(t,e,n){n=(n=n.trim()).replace(/\s\s+/g," "),this.commandHistory[this.commandHistory.length-1]!=n&&(this.commandHistory.push(n),this.commandHistory.length>50&&this.commandHistory.splice(0,1),e.terminalCommandHistory=this.commandHistory),this.commandHistoryIndex=this.commandHistory.length;const a=Object(g.b)(n);for(let n=0;nthis.clear(),cls:()=>this.clear(),connect:T.a,cp:A.a,download:R.a,expr:N.a,free:P.a,grow:I.a,hack:F.a,help:D.a,history:j.a,home:B.a,hostname:G.a,kill:W.a,killall:H.a,ls:U.a,lscpu:q.a,mem:$.a,mv:K.a,nano:z.a,ps:V.a,rm:Y.a,run:J.a,scan:X.a,scp:Z.a,sudov:tt.a,tail:et.a,apr1:lt.a,top:nt.a,unalias:at.a,vim:rt.a,weaken:it.a,wget:ot.a}[i.toLowerCase()];o?o(this,t,e,r,a.slice(1)):this.error(`Command ${a[0]} not found`)}getProgressText(){if(null===this.action)throw new Error("trying to get the progress text when there's no action");return Object(E.a)({progress:(this.action.time-this.action.timeLeft)/this.action.time,totalTicks:50})}}},,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(33),r=n(969),i=n(387),o=n(655);function s(t){let e=t;return e.startsWith("[")&&(e=e.slice(1)),e.endsWith("]")&&(e=e.slice(0,-1)),e}function l(t){let e=t;return(e.startsWith('"')||e.startsWith("'"))&&(e=e.slice(1)),(e.endsWith('"')||e.endsWith("'"))&&(e=e.slice(0,-1)),e}function c(t){const e=[];return t.forEach(t=>{let n=t.toString();n=["[",n,"]"].join(""),e.push(n)}),e.join(",").replace(/\s/g,"")}const f=[{desc:t=>["A prime factor is a factor that is a prime number.",`What is the largest prime factor of ${t}?`].join(" "),difficulty:1,gen:()=>Object(a.a)(500,1e9),name:"Find Largest Prime Factor",numTries:10,solver:(t,e)=>{let n=2,a=t;for(;a>(n-1)*(n-1);){for(;a%n==0;)a=Math.round(a/n);++n}return(1===a?n-1:a)===parseInt(e,10)}},{desc:t=>["Given the following integer array, find the contiguous subarray","(containing at least one number) which has the largest sum and return that sum.","'Sum' refers to the sum of all the numbers in the subarray.\n",""+t.toString()].join(" "),difficulty:1,gen:()=>{const t=Object(a.a)(5,40),e=[];e.length=t;for(let n=0;n{const n=t.slice();for(let t=1;t["It is possible write four as a sum in exactly four different ways:\n\n","    3 + 1\n","    2 + 2\n","    2 + 1 + 1\n","    1 + 1 + 1 + 1\n\n",`How many different distinct ways can the number ${t} be written as a sum of at least`,"two positive integers?"].join(" "),difficulty:1.5,gen:()=>Object(a.a)(8,100),name:"Total Ways to Sum",numTries:10,solver:(t,e)=>{const n=[1];n.length=t+1,n.fill(0,1);for(let e=1;e[`How many different distinct ways can the number ${t[0]} be written`,"as a sum of integers contained in the set:\n\n",`[${t[1]}]?\n\n`,"You may use each integer in the set zero or more times."].join(" "),difficulty:2,gen:()=>{const t=Object(a.a)(12,200),e=Object(a.a)(8,12),n=[];for(let a=1;a<=t&&n.length!=e;a++)(Math.random()<.6||t-a{const n=t[0],a=t[1],r=[1];r.length=n+1,r.fill(0,1);for(let t=0;t{let e=["Given the following array of arrays of numbers representing a 2D matrix,","return the elements of the matrix as an array in spiral order:\n\n"].join(" ");return e+="    [\n",e+=t.map(t=>"        ["+t.map(t=>(""+t).padStart(2," ")).join(",")+"]").join("\n"),e+="\n    ]\n",e+=["\nHere is an example of what spiral order should be:\n\n","    [\n","        [1, 2, 3]\n","        [4, 5, 6]\n","        [7, 8, 9]\n","    ]\n\n","Answer: [1, 2, 3, 6, 9, 8 ,7, 4, 5]\n\n","Note that the matrix will not always be square:\n\n","    [\n","        [1,  2,  3,  4]\n","        [5,  6,  7,  8]\n","        [9, 10, 11, 12]\n","    ]\n\n","Answer: [1, 2, 3, 4, 8, 12, 11, 10, 9, 5, 6, 7]"].join(" "),e},difficulty:2,gen:()=>{const t=Object(a.a)(1,15),e=Object(a.a)(1,15),n=[];n.length=t;for(let a=0;a{const n=[];let a=0,r=t.length-1,i=0,o=t[0].length-1,l=0;for(;;){for(let e=i;e<=o;e++)n[l]=t[a][e],++l;if(++a>r)break;for(let e=a;e<=r;e++)n[l]=t[e][o],++l;if(--o=i;e--)n[l]=t[r][e],++l;if(--r=a;e--)n[l]=t[e][i],++l;if(++i>o)break}const c=s(e).replace(/\s/g,"").split(",");for(let t=0;t["You are given the following array of integers:\n\n",t+"\n\n","Each element in the array represents your MAXIMUM jump length","at that position. This means that if you are at position i and your","maximum jump length is n, you can jump to any position from","i to i+n.","\n\nAssuming you are initially positioned","at the start of the array, determine whether you are","able to reach the last index.\n\n","Your answer should be submitted as 1 or 0, representing true and false respectively"].join(" "),difficulty:2.5,gen:()=>{const t=Object(a.a)(3,25),e=[];e.length=t;for(let t=0;t{const n=t.length;let a=0;for(let e=0;a["You are given the following array of integers:\n\n",t+"\n\n","Each element in the array represents your MAXIMUM jump length","at that position. This means that if you are at position i and your","maximum jump length is n, you can jump to any position from","i to i+n.","\n\nAssuming you are initially positioned","at the start of the array, determine the minimum number of","jumps to reach the end of the array.\n\n","If it's impossible to reach the end, then the answer should be 0."].join(" "),difficulty:3,gen:()=>{const t=Object(a.a)(3,25),e=[];e.length=t;for(let t=0;t{const n=t.length;let a=0,r=0,i=-1;for(;ai;n--)n+t[n]>a&&(a=n+t[n],e=n);if(-1===e){r=0;break}i=e,r++}return r===parseInt(e,10)}},{desc:t=>["Given the following array of array of numbers representing a list of","intervals, merge all overlapping intervals.\n\n",`[${c(t)}]\n\n`,"Example:\n\n","[[1, 3], [8, 10], [2, 6], [10, 16]]\n\n","would merge into [[1, 6], [8, 16]].\n\n","The intervals must be returned in ASCENDING order.","You can assume that in an interval, the first number will always be","smaller than the second."].join(" "),difficulty:3,gen:()=>{const t=[],e=Object(a.a)(3,20);for(let n=0;n{const n=t.slice();n.sort((t,e)=>t[0]-e[0]);const a=[];let r=n[0][0],i=n[0][1];for(const t of n)t[0]<=i?i=Math.max(i,t[1]):(a.push([r,i]),r=t[0],i=t[1]);a.push([r,i]);const o=c(a),l=e.replace(/\s/g,"");return o===l||o===s(l)}},{desc:t=>["Given the following string containing only digits, return","an array with all possible valid IP address combinations","that can be created from the string:\n\n",t+"\n\n","Note that an octet cannot begin with a '0' unless the number","itself is actually 0. For example, '192.168.010.1' is not a valid IP.\n\n","Examples:\n\n","25525511135 -> [255.255.11.135, 255.255.111.35]\n","1938718066 -> [193.87.180.66]"].join(" "),difficulty:3,gen:()=>{let t="";for(let e=0;e<4;++e){t+=Object(a.a)(0,255).toString()}return t},name:"Generate IP Addresses",numTries:10,solver:(t,e)=>{const n=[];for(let e=1;e<=3;++e)for(let a=1;a<=3;++a)for(let r=1;r<=3;++r)for(let i=1;i<=3;++i)if(e+a+r+i===t.length){const o=parseInt(t.substring(0,e),10),s=parseInt(t.substring(e,e+a),10),l=parseInt(t.substring(e+a,e+a+r),10),c=parseInt(t.substring(e+a+r,e+a+r+i),10);if(o<=255&&s<=255&&l<=255&&c<=255){const e=[o.toString(),".",s.toString(),".",l.toString(),".",c.toString()].join("");e.length===t.length+3&&n.push(e)}}const a=s(e).replace(/\s/g,"").split(",");if(a.length!==n.length)return!1;for(const t of a)if(!n.includes(t))return!1;return!0}},{desc:t=>["You are given the following array of stock prices (which are numbers)","where the i-th element represents the stock price on day i:\n\n",t+"\n\n","Determine the maximum possible profit you can earn using at most","one transaction (i.e. you can only buy and sell the stock once). If no profit can be made","then the answer should be 0. Note","that you have to buy the stock before you can sell it"].join(" "),difficulty:1,gen:()=>{const t=Object(a.a)(3,50),e=[];e.length=t;for(let n=0;n{let n=0,a=0;for(let e=1;e["You are given the following array of stock prices (which are numbers)","where the i-th element represents the stock price on day i:\n\n",t+"\n\n","Determine the maximum possible profit you can earn using as many","transactions as you'd like. A transaction is defined as buying","and then selling one share of the stock. Note that you cannot","engage in multiple transactions at once. In other words, you","must sell the stock before you buy it again.\n\n","If no profit can be made, then the answer should be 0"].join(" "),difficulty:2,gen:()=>{const t=Object(a.a)(3,50),e=[];e.length=t;for(let n=0;n{let n=0;for(let e=1;e["You are given the following array of stock prices (which are numbers)","where the i-th element represents the stock price on day i:\n\n",t+"\n\n","Determine the maximum possible profit you can earn using at most","two transactions. A transaction is defined as buying","and then selling one share of the stock. Note that you cannot","engage in multiple transactions at once. In other words, you","must sell the stock before you buy it again.\n\n","If no profit can be made, then the answer should be 0"].join(" "),difficulty:5,gen:()=>{const t=Object(a.a)(3,50),e=[];e.length=t;for(let n=0;n{let n=Number.MIN_SAFE_INTEGER,a=Number.MIN_SAFE_INTEGER,r=0,i=0;for(const e of t)i=Math.max(i,a+e),a=Math.max(a,r-e),r=Math.max(r,n+e),n=Math.max(n,-1*e);return i.toString()===e}},{desc:t=>["You are given the following array with two elements:\n\n",`[${t[0]}, [${t[1]}]]\n\n`,"The first element is an integer k. The second element is an","array of stock prices (which are numbers) where the i-th element","represents the stock price on day i.\n\n","Determine the maximum possible profit you can earn using at most","k transactions. A transaction is defined as buying and then selling","one share of the stock. Note that you cannot engage in multiple","transactions at once. In other words, you must sell the stock before","you can buy it again.\n\n","If no profit can be made, then the answer should be 0."].join(" "),difficulty:8,gen:()=>{const t=Object(a.a)(2,10),e=Object(a.a)(3,50),n=[];n.length=e;for(let t=0;t{const n=t[0],a=t[1],r=a.length;if(r<2)return 0===parseInt(e);if(n>r/2){let t=0;for(let e=1;e0;--t)o[t]=Math.max(o[t],i[t]+s),i[t]=Math.max(i[t],o[t-1]-s)}return parseInt(e)===o[n]}},{desc:t=>{function e(t,n=0){const a=t.length;if(n>=a)return"";let r=[" ".repeat(a-n+1),"[",t[n].toString(),"]"].join("");return n 3 -> 5 -> 1)."].join(" ")},difficulty:5,gen:()=>{const t=[],e=Object(a.a)(3,12);t.length=e;for(let n=0;n{const n=t.length,a=t[n-1].slice();for(let e=n-2;e>-1;--e)for(let n=0;n{const e=t[0],n=t[1];return["You are in a grid with",`${e} rows and ${n} columns, and you are`,"positioned in the top-left corner of that grid. You are trying to","reach the bottom-right corner of the grid, but you can only","move down or right on each step. Determine how many","unique paths there are from start to finish.\n\n","NOTE: The data returned for this contract is an array","with the number of rows and columns:\n\n",`[${e}, ${n}]`].join(" ")},difficulty:3,gen:()=>[Object(a.a)(2,14),Object(a.a)(2,14)],name:"Unique Paths in a Grid I",numTries:10,solver:(t,e)=>{const n=t[0],a=t[1],r=[];r.length=n;for(let t=0;t{let e="";for(const n of t)e+=n.toString()+",\n";return["You are located in the top-left corner of the following grid:\n\n",e+"\n","You are trying reach the bottom-right corner of the grid, but you can only","move down or right on each step. Furthermore, there are obstacles on the grid","that you cannot move onto. These obstacles are denoted by '1', while empty","spaces are denoted by 0.\n\n","Determine how many unique paths there are from start to finish.\n\n","NOTE: The data returned for this contract is an 2D array of numbers representing the grid."].join(" ")},difficulty:5,gen:()=>{const t=Object(a.a)(2,12),e=Object(a.a)(2,12),n=[];n.length=t;for(let a=0;a{const n=[];n.length=t.length;for(let e=0;e0?n[t-1][e]:0)+(e>0?n[t][e-1]:0);return n[n.length-1][n[0].length-1]===parseInt(e)}},{name:"Shortest Path in a Grid",desc:t=>["You are located in the top-left corner of the following grid:\n\n",`  [${t.map(t=>"["+t+"]").join(",\n   ")}]\n\n`,"You are trying to find the shortest path to the bottom-right corner of the grid,","but there are obstacles on the grid that you cannot move onto.","These obstacles are denoted by '1', while empty spaces are denoted by 0.\n\n","Determine the shortest path from start to finish, if one exists.","The answer should be given as a string of UDLR characters, indicating the moves along the path\n\n","NOTE: If there are multiple equally short paths, any of them is accepted as answer.","If there is no path, the answer should be an empty string.\n","NOTE: The data returned for this contract is an 2D array of numbers representing the grid.\n\n","Examples:\n\n","    [[0,1,0,0,0],\n","     [0,0,0,1,0]]\n","\n","Answer: 'DRRURRD'\n\n","    [[0,1],\n","     [1,0]]\n","\n","Answer: ''\n\n"].join(" "),difficulty:7,numTries:10,gen:()=>{const t=Object(a.a)(6,12),e=Object(a.a)(6,12),n=t-1,r=e-1,i=n+r,o=new Array(t);for(let n=0;n{const n=t[0].length,a=t.length,i=a-1,o=n-1,s=new Array(a),l=new r.a;for(let t=0;t=0&&e=0&&r0;){const[t,e]=l.pop();for(const[n,a]of f(t,e)){const r=s[t][e]+1;rt==n&&e==a,r),s[n][a]=r)}}if(s[i][o]==1/0)return""==e;if(e.length>s[i][o])return!1;let u=0,m=0;for(const t of e){switch(t){case"U":m-=1;break;case"D":m+=1;break;case"L":u-=1;break;case"R":u+=1;break;default:return!1}if(!c(m,u))return!1}return m==i&&u==o}},{desc:t=>["Given the following string:\n\n",t+"\n\n","remove the minimum number of invalid parentheses in order to validate","the string. If there are multiple minimal ways to validate the string,","provide all of the possible results. The answer should be provided","as an array of strings. If it is impossible to validate the string","the result should be an array with only an empty string.\n\n","IMPORTANT: The string may contain letters, not just parentheses.","Examples:\n",'"()())()" -> [()()(), (())()]\n','"(a)())()" -> [(a)()(), (a())()]\n','")(" -> [""]'].join(" "),difficulty:10,gen:()=>{const t=Object(a.a)(6,20),e=[];e.length=t,Math.random()<.8?e[0]="(":e[0]=")";for(let n=1;n{let n=0,a=0;const r=[];for(let e=0;e0?--n:++a);!function t(e,n,a,r,i,o,s){if(i.length!==n)"("===i[n]?(a>0&&t(e,n+1,a-1,r,i,o,s),t(e+1,n+1,a,r,i,o+i[n],s)):")"===i[n]?(r>0&&t(e,n+1,a,r-1,i,o,s),e>0&&t(e-1,n+1,a,r,i,o+i[n],s)):t(e,n+1,a,r,i,o+i[n],s);else if(0===a&&0===r&&0===e){for(let t=0;t{const e=t[0],n=t[1];return["You are given the following string which contains only digits between 0 and 9:\n\n",e+"\n\n",`You are also given a target number of ${n}. Return all possible ways`,"you can add the +(add), -(subtract), and *(multiply) operators to the string such","that it evaluates to the target number. (Normal order of operations applies.)\n\n","The provided answer should be an array of strings containing the valid expressions.","The data provided by this problem is an array with two elements. The first element","is the string of digits, while the second element is the target number:\n\n",`["${e}", ${n}]\n\n`,"NOTE: The order of evaluation expects script operator precedence","NOTE: Numbers in the expression cannot have leading 0's. In other words,",'"1+01" is not a valid expression',"Examples:\n\n",'Input: digits = "123", target = 6\n',"Output: [1+2+3, 1*2*3]\n\n",'Input: digits = "105", target = 5\n',"Output: [1*0+5, 10-5]"].join(" ")},difficulty:10,gen:()=>{const t=Object(a.a)(4,12),e=[];e.length=t;for(let t=0;t{const n=t[0],a=t[1];const r=s(e).split(",");for(let t=0;t["You are given the following decimal Value: \n",t+" \n","Convert it into a binary string and encode it as a 'Hamming-Code'. eg:\n ","Value 8 will result into binary '1000', which will be encoded","with the pattern 'pppdpddd', where p is a paritybit and d a databit,\n","or '10101' (Value 21) will result into (pppdpdddpd) '1001101011'.\n\n","NOTE: You need an parity Bit on Index 0 as an 'overall'-paritybit. \n","NOTE 2: You should watch the HammingCode-video from 3Blue1Brown, which explains the 'rule' of encoding,","including the first Index parity-bit mentioned on the first note.\n\n","Now the only one rule for this encoding:\n"," It's not allowed to add additional leading '0's to the binary value\n","That means, the binary value has to be encoded as it is"].join(" "),gen:()=>Object(a.a)(Math.pow(2,4),Math.pow(2,Object(a.a)(1,57))),solver:(t,e)=>e===Object(o.b)(t)},{name:"HammingCodes: Encoded Binary to Integer",difficulty:8,numTries:10,desc:t=>["You are given the following encoded binary String: \n",`'${t}' \n`,"Treat it as a Hammingcode with 1 'possible' error on an random Index.\n","Find the 'possible' wrong bit, fix it and extract the decimal value, which is hidden inside the string.\n\n","Note: The length of the binary string is dynamic, but it's encoding/decoding is following Hammings 'rule'\n","Note 2: Index 0 is an 'overall' parity bit. Watch the Hammingcode-video from 3Blue1Brown for more information\n","Note 3: There's a ~55% chance for an altered Bit. So... MAYBE there is an altered Bit 😉\n","Extranote for automation: return the decimal value as a string"].join(" "),gen:()=>{const t=Math.round(Math.random()),e=Object(o.b)(Object(a.a)(Math.pow(2,4),Math.pow(2,Object(a.a)(1,57)))).split("");if(t){const t=Object(a.a)(0,e.length-1);e[t]="0"==e[t]?"1":"0"}return e.join("")},solver:(t,e)=>parseInt(e,10)===Object(o.a)(t)},{name:"Proper 2-Coloring of a Graph",difficulty:7,numTries:5,desc:t=>["You are given the following data, representing a graph:\n",JSON.stringify(t)+"\n",'Note that "graph", as used here, refers to the field of graph theory, and has',"no relation to statistics or plotting.","The first element of the data represents the number of vertices in the graph.",`Each vertex is a unique number between 0 and ${t[0]-1}.`,"The next element of the data represents the edges of the graph.","Two vertices u,v in a graph are said to be adjacent if there exists an edge [u,v].","Note that an edge [u,v] is the same as an edge [v,u], as order does not matter.","You must construct a 2-coloring of the graph, meaning that you have to assign each",'vertex in the graph a "color", either 0 or 1, such that no two adjacent vertices have',"the same color. Submit your answer in the form of an array, where element i","represents the color of vertex i. If it is impossible to construct a 2-coloring of","the given graph, instead submit an empty array.\n\n","Examples:\n\n","Input: [4, [[0, 2], [0, 3], [1, 2], [1, 3]]]\n","Output: [0, 0, 1, 1]\n\n","Input: [3, [[0, 1], [0, 2], [1, 2]]]\n","Output: []"].join(" "),gen:()=>{const t=Math.floor(5*Math.random())+3,e=Math.floor(5*Math.random())+3,n=[];for(let a=0;a.5&&n.push([a,t+r]);let a=Math.floor(Math.random()*(t+e)),r=Math.floor(Math.random()*(t+e));function i(t){for(let e=t.length-1;e>0;e--){const n=Math.floor(Math.random()*(e+1));[t[e],t[n]]=[t[n],t[e]]}}a>r&&([a,r]=[r,a]),a==r||n.includes([a,r])||n.push([a,r]);const o=Array.from(Array(t+e).keys());i(o);for(let t=0;tn[t][1]&&([n[t][0],n[t][1]]=[n[t][1],n[t][0]]);return i(n),[t+e,n]},solver:(t,e)=>{if("[]"==e){function n(e){const n=t[1].filter(([t,n])=>t==e).map(([t,e])=>e),a=t[1].filter(([t,n])=>n==e).map(([t,e])=>t);return n.concat(a)}const e=Array(t[0]).fill(void 0);for(;e.some(t=>void 0===t);){const t=e.findIndex(t=>void 0===t);e[t]=0;const a=[t];for(;a.length>0;){const t=a.pop()||0,r=n(t);for(const n in r){const i=r[n];if(void 0===e[i])0===e[t]?e[i]=1:e[i]=0,a.push(i);else if(e[i]===e[t])return!0}}}return!1}const a=s(e).split(",").map(t=>parseInt(t));if(a.length==t[0]){const e=t[1],n=[0,1];return e.every(([t,e])=>{const r=a[t],i=a[e];return n.includes(r)&&n.includes(i)&&r!=i})}return!1}},{name:"Compression I: RLE Compression",difficulty:2,numTries:10,desc:t=>["Run-length encoding (RLE) is a data compression technique which encodes data as a series of runs of","a repeated single character. Runs are encoded as a length, followed by the character itself. Lengths","are encoded as a single ASCII digit; runs of 10 characters or more are encoded by splitting them","into multiple runs.\n\n","You are given the following input string:\n",`    ${t}\n`,"Encode it using run-length encoding with the minimum possible output length.\n\n","Examples:\n","    aaaaabccc            ->  5a1b3c\n","    aAaAaA               ->  1a1A1a1A1a1A\n","    111112333            ->  511233\n","    zzzzzzzzzzzzzzzzzzz  ->  9z9z1z  (or 9z8z2z, etc.)\n"].join(" "),gen:()=>{const t=50+Math.floor(25*(Math.random()+Math.random()));let e="";for(;e.length{if(e.length%2!=0)return!1;let n="";for(let t=0;t+19)return!1;n+=e[t+1].repeat(a)}if(n!==t)return!1;let a=0;for(let e=0;e0;)n-=9,a+=2}return e.length<=a}},{name:"Compression II: LZ Decompression",difficulty:4,numTries:10,desc:t=>["Lempel-Ziv (LZ) compression is a data compression technique which encodes data using references to","earlier parts of the data. In this variant of LZ, data is encoded in two types of chunk. Each chunk","begins with a length L, encoded as a single ASCII digit from 1 - 9, followed by the chunk data,","which is either:\n\n","1. Exactly L characters, which are to be copied directly into the uncompressed data.\n","2. A reference to an earlier part of the uncompressed data. To do this, the length is followed","by a second ASCII digit X: each of the L output characters is a copy of the character X","places before it in the uncompressed data.\n\n","For both chunk types, a length of 0 instead means the chunk ends immediately, and the next character","is the start of a new chunk. The two chunk types alternate, starting with type 1, and the final","chunk may be of either type.\n\n","You are given the following LZ-encoded string:\n",`    ${t}\n`,"Decode it and output the original string.\n\n","Example: decoding '5aaabb450723abb' chunk-by-chunk\n","    5aaabb           ->  aaabb\n","    5aaabb45         ->  aaabbaaab\n","    5aaabb450        ->  aaabbaaab\n","    5aaabb45072      ->  aaabbaaababababa\n","    5aaabb450723abb  ->  aaabbaaababababaabb"].join(" "),gen:()=>Object(i.c)(Object(i.d)()),solver:(t,e)=>e===Object(i.b)(t)},{name:"Compression III: LZ Compression",difficulty:10,numTries:10,desc:t=>["Lempel-Ziv (LZ) compression is a data compression technique which encodes data using references to","earlier parts of the data. In this variant of LZ, data is encoded in two types of chunk. Each chunk","begins with a length L, encoded as a single ASCII digit from 1 - 9, followed by the chunk data,","which is either:\n\n","1. Exactly L characters, which are to be copied directly into the uncompressed data.\n","2. A reference to an earlier part of the uncompressed data. To do this, the length is followed","by a second ASCII digit X: each of the L output characters is a copy of the character X","places before it in the uncompressed data.\n\n","For both chunk types, a length of 0 instead means the chunk ends immediately, and the next character","is the start of a new chunk. The two chunk types alternate, starting with type 1, and the final","chunk may be of either type.\n\n","You are given the following input string:\n",`    ${t}\n`,"Encode it using Lempel-Ziv encoding with the minimum possible output length.\n\n","Examples (some have other possible encodings of minimal length):\n","    abracadabra     ->  7abracad47\n","    mississippi     ->  4miss433ppi\n","    aAAaAAaAaAA     ->  3aAA53035\n","    2718281828      ->  627182844\n","    abcdefghijk     ->  9abcdefghi02jk\n","    aaaaaaaaaaaa    ->  3aaa91\n","    aaaaaaaaaaaaa   ->  1a91031\n","    aaaaaaaaaaaaaa  ->  1a91041"].join(" "),gen:()=>Object(i.d)(),solver:(t,e)=>Object(i.b)(e)===t&&e.length<=Object(i.c)(t).length}]},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));class a{constructor(){this.data=[]}get size(){return this.data.length}push(t,e){const n=this.data.length;this.data[n]=[e,t],this.heapifyUp(n)}peek(){if(0!=this.data.length)return this.data[0][1]}pop(){if(0==this.data.length)return;const t=this.data[0][1];return this.data[0]=this.data[this.data.length-1],this.data.length=this.data.length-1,this.heapifyDown(0),t}changeWeight(t,e){const n=this.data.findIndex(e=>t(e[1]));if(-1==n)return;this.data[n][0]=e;const a=Math.floor((n-1)/2);this.heapOrderABeforeB(this.data[a][0],this.data[n][0])?this.heapifyDown(n):this.heapifyUp(n)}heapifyUp(t){for(;t>0;){const e=Math.floor((t-1)/2);if(this.heapOrderABeforeB(this.data[e][0],this.data[t][0]))break;const n=this.data[e];this.data[e]=this.data[t],this.data[t]=n,t=e}}heapifyDown(t){for(;t=t}}const h=[{key:"NukeProgram",name:"NUKE.exe",create:{level:1,tooltip:"This virus is used to gain root access to a machine if enough ports are opened.",req:m(1),time:a.a.MillisecondsPerFiveMinutes},run:(t,e,n,a)=>{if(a instanceof r.a)return a.hasAdminRights?(e.print("You already have root access to this computer. There is no reason to run NUKE.exe"),void e.print("You can now run scripts on this server.")):a.openPortCount>=a.numOpenPortsRequired?(a.hasAdminRights=!0,e.print("NUKE successful! Gained root access to "+a.hostname),void e.print("You can now run scripts on this server.")):void e.print("NUKE unsuccessful. Not enough ports have been opened");e.error("Cannot nuke this kind of server.")}},{key:"BruteSSHProgram",name:"BruteSSH.exe",create:{level:50,tooltip:"This program executes a brute force attack that opens SSH ports",req:m(50),time:2*a.a.MillisecondsPerFiveMinutes},run:(t,e,n,a)=>{a instanceof r.a?a.sshPortOpen?e.print("SSH Port (22) is already open!"):(a.sshPortOpen=!0,e.print("Opened SSH Port(22)!"),a.openPortCount++):e.error("Cannot run BruteSSH.exe on this kind of server.")}},{key:"FTPCrackProgram",name:"FTPCrack.exe",create:{level:100,tooltip:"This program cracks open FTP ports",req:m(100),time:a.a.MillisecondsPerHalfHour},run:(t,e,n,a)=>{a instanceof r.a?a.ftpPortOpen?e.print("FTP Port (21) is already open!"):(a.ftpPortOpen=!0,e.print("Opened FTP Port (21)!"),a.openPortCount++):e.error("Cannot run FTPCrack.exe on this kind of server.")}},{key:"RelaySMTPProgram",name:"relaySMTP.exe",create:{level:250,tooltip:"This program opens SMTP ports by redirecting data",req:m(250),time:a.a.MillisecondsPer2Hours},run:(t,e,n,a)=>{a instanceof r.a?a.smtpPortOpen?e.print("SMTP Port (25) is already open!"):(a.smtpPortOpen=!0,e.print("Opened SMTP Port (25)!"),a.openPortCount++):e.error("Cannot run relaySMTP.exe on this kind of server.")}},{key:"HTTPWormProgram",name:"HTTPWorm.exe",create:{level:500,tooltip:"This virus opens up HTTP ports",req:m(500),time:a.a.MillisecondsPer4Hours},run:(t,e,n,a)=>{a instanceof r.a?a.httpPortOpen?e.print("HTTP Port (80) is already open!"):(a.httpPortOpen=!0,e.print("Opened HTTP Port (80)!"),a.openPortCount++):e.error("Cannot run HTTPWorm.exe on this kind of server.")}},{key:"SQLInjectProgram",name:"SQLInject.exe",create:{level:750,tooltip:"This virus opens SQL ports",req:m(750),time:a.a.MillisecondsPer8Hours},run:(t,e,n,a)=>{a instanceof r.a?a.sqlPortOpen?e.print("SQL Port (1433) is already open!"):(a.sqlPortOpen=!0,e.print("Opened SQL Port (1433)!"),a.openPortCount++):e.error("Cannot run SQLInject.exe on this kind of server.")}},{key:"DeepscanV1",name:"DeepscanV1.exe",create:{level:75,tooltip:"This program allows you to use the scan-analyze command with a depth up to 5",req:m(75),time:a.a.MillisecondsPerQuarterHour},run:(t,e)=>{e.print("This executable cannot be run."),e.print("DeepscanV1.exe lets you run 'scan-analyze' with a depth up to 5.")}},{key:"DeepscanV2",name:"DeepscanV2.exe",create:{level:400,tooltip:"This program allows you to use the scan-analyze command with a depth up to 10",req:m(400),time:a.a.MillisecondsPer2Hours},run:(t,e)=>{e.print("This executable cannot be run."),e.print("DeepscanV2.exe lets you run 'scan-analyze' with a depth up to 10.")}},{key:"ServerProfiler",name:"ServerProfiler.exe",create:{level:75,tooltip:"This program is used to display hacking and Netscript-related information about servers",req:m(75),time:a.a.MillisecondsPerHalfHour},run:(t,e,n,a,s)=>{if(1!==s.length)return void e.error("Must pass a server hostname or IP as an argument for ServerProfiler.exe");const l=Object(o.d)(s[0]);null!=l?l instanceof r.a?(e.print(l.hostname+":"),e.print("Server base security level: "+l.baseDifficulty),e.print("Server current security level: "+l.hackDifficulty),e.print("Server growth rate: "+l.serverGrowth),e.print("Netscript hack() execution time: "+Object(i.d)(1e3*Object(f.d)(l,n),!0)),e.print("Netscript grow() execution time: "+Object(i.d)(1e3*Object(f.a)(l,n),!0)),e.print("Netscript weaken() execution time: "+Object(i.d)(1e3*Object(f.f)(l,n),!0))):e.error("ServerProfiler.exe can only be run on normal servers."):e.error("Invalid server IP/hostname")}},{key:"AutoLink",name:"AutoLink.exe",create:{level:25,tooltip:"This program allows you to directly connect to other servers through the 'scan-analyze' command",req:m(25),time:a.a.MillisecondsPerQuarterHour},run:(t,e)=>{e.print("This executable cannot be run."),e.print("AutoLink.exe lets you automatically connect to other servers when using 'scan-analyze'."),e.print("When using scan-analyze, click on a server's hostname to connect to it.")}},{key:"Formulas",name:"Formulas.exe",create:{level:1e3,tooltip:"This program allows you to use the formulas API",req:m(1e3),time:a.a.MillisecondsPer4Hours},run:(t,e)=>{e.print("This executable cannot be run."),e.print("Formulas.exe lets you use the formulas API.")}},{key:"BitFlume",name:"b1t_flum3.exe",create:{level:1,tooltip:"This program creates a portal to the BitNode Nexus (allows you to restart and switch BitNodes)",req:function(t){return t.sourceFiles.length>0&&t.hacking>=1},time:a.a.MillisecondsPerFiveMinutes/20},run:()=>{c.a.emit()}},{key:"Flight",name:"fl1ght.exe",create:null,run:(t,e,n)=>{const a=l.a.DaedalusAugsRequirement;if(!(n.augmentations.length>=a&&n.money>1e11&&n.hacking>=2500))return e.print(`Augmentations: ${n.augmentations.length} / ${a}`),e.print(`Money: ${s.a.formatMoney(n.money)} / $100b`),void e.print(`Hacking skill: ${n.hacking} / 2500`);e.print("We will contact you."),e.print(`-- ${u.a.Daedalus} --`)}}]},function(t,e,n){"use strict";function a(t){const e="(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)";return new RegExp(`^${e}.${e}.${e}.${e}$`).test(t)}n.d(e,"a",(function(){return a}))},function(t,e,n){"use strict";function a(){const t=new Date,e=("0"+t.getHours()).slice(-2),n=("0"+t.getMinutes()).slice(-2),a=("0"+t.getSeconds()).slice(-2);return`${t.getMonth()+1}/${t.getDate()} ${e}:${n}:${a}`}n.d(e,"a",(function(){return a}))},function(t,e,n){"use strict";function a(t){const e=1+Math.log(t)/25;return isNaN(e)||!isFinite(e)?1:e}n.d(e,"a",(function(){return a}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return S}));var a=n(31),r=n(9);const i={},o={},s={},l={},c={},f={},u={},m={},h={},d={},p={},g={},y={},b={},E={},v={},k={},_={},w={};a.j.forEach(t=>{i[t]=!0,c[t]=!0}),a.d.forEach(t=>{o[t]=!0,c[t]=!0}),a.f.forEach(t=>{s[t]=!0,c[t]=!0}),c[a.i[0]]=!0,l[a.i[0]]=!0,a.b.forEach(t=>{f[t]=!0}),a.h.forEach(t=>{m[t]=!0}),a.a.forEach(t=>{u[t]=!0}),a.k.forEach(t=>{h[t]=!0}),a.c.forEach(t=>{d[t]=!0});for(let t=0;tnull),null!=t.cost&&(this.cost=t.cost),null!=t.effectText&&(this.effectText=t.effectText),this.costPerLevel=t.costPerLevel,this.desc=t.desc,this.hasTargetServer=!!t.hasTargetServer&&t.hasTargetServer,this.name=t.name,this.value=t.value}getCost(t){return"number"==typeof this.cost?this.cost:Math.round((t+1)*this.costPerLevel)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(0),r=n.n(a),i=n(5),o=n(20);const s=[{cost:4,costPerLevel:4,desc:"Sell hashes for $1m",name:"Sell for Money",effectText:t=>r.a.createElement(r.a.Fragment,null,"Sold for ",r.a.createElement(o.a,{money:1e6*t})),value:1e6},{costPerLevel:100,desc:"Sell hashes for $1b in Corporation funds",name:"Sell for Corporation Funds",effectText:t=>r.a.createElement(r.a.Fragment,null,"Sold for ",r.a.createElement(o.a,{money:1e9*t})," Corporation funds."),value:1e9},{costPerLevel:50,desc:"Use hashes to decrease the minimum security of a single server by 2%. Note that a server's minimum security cannot go below 1. This effect persists until you install Augmentations (since servers are reset at that time).",hasTargetServer:!0,name:"Reduce Minimum Security",value:.98},{costPerLevel:50,desc:"Use hashes to increase the maximum amount of money on a single server by 2%. Note that a server's maximum money is soft capped above $10t. This effect persists until you install Augmentations (since servers are reset at that time).",hasTargetServer:!0,name:"Increase Maximum Money",value:1.02},{costPerLevel:50,desc:"Use hashes to improve the experience earned when studying at a university by 20%. This effect persists until you install Augmentations",name:"Improve Studying",effectText:t=>r.a.createElement(r.a.Fragment,null,"Improves studying by ",20*t,"%"),value:20},{costPerLevel:50,desc:"Use hashes to improve the experience earned when training at the gym by 20%. This effect persists until you install Augmentations",name:"Improve Gym Training",effectText:t=>r.a.createElement(r.a.Fragment,null,"Improves training by ",20*t,"%"),value:20},{costPerLevel:200,desc:"Exchange hashes for 1k Scientific Research in all of your Corporation's Industries",name:"Exchange for Corporation Research",effectText:t=>r.a.createElement(r.a.Fragment,null,"Acquired a total of ",t,"k Scientific Research in your industries."),value:1e3},{costPerLevel:250,desc:"Exchange hashes for 100 Bladeburner Rank",name:"Exchange for Bladeburner Rank",effectText:t=>r.a.createElement(r.a.Fragment,null,"Acquired a total of ",i.a.format(100*t,"0a")," Bladeburner rank"),value:100},{costPerLevel:250,desc:"Exchanges hashes for 10 Bladeburner Skill Points",name:"Exchange for Bladeburner SP",effectText:t=>r.a.createElement(r.a.Fragment,null,"Acquired a total of ",i.a.format(10*t,"0a")," Bladeburner Skill Points"),value:10},{costPerLevel:200,desc:"Generate a random Coding Contract somewhere on the network",name:"Generate Coding Contract",effectText:t=>r.a.createElement(r.a.Fragment,null,"Generated ",t," contracts."),value:1}]},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,"parent",null),a(this,"stopFlag",!1),a(this,"vars",{}),t instanceof r&&(this.vars=Object.assign({},t.vars)),this.parent=t}lookup(t){let e=this;for(;e;){if(Object.prototype.hasOwnProperty.call(e.vars,t))return e;e=e.parent}return null}get(t){if(t in this.vars)return this.vars[t];throw new Error("Undefined variable "+t)}set(t,e){const n=this.lookup(t);return null!==n?n.vars[t]=e:this.vars[t]=e}def(t,e){return this.vars[t]=e}}},function(t,e,n){"use strict";function a(t){return!isNaN(t)&&(0!==t&&0==(t&t-1))}n.d(e,"a",(function(){return a}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(99),r=n(9);const i=[{b:!0,initPrice:{max:28e3,min:17e3},marketCap:24e11,mv:{divisor:100,max:50,min:40},name:r.a.AevumECorp,otlkMag:19,spreadPerc:{divisor:10,max:5,min:1},shareTxForMovement:{max:9e4,min:3e4},symbol:a.a[r.a.AevumECorp]},{b:!0,initPrice:{max:34e3,min:24e3},marketCap:24e11,mv:{divisor:100,max:50,min:40},name:r.a.Sector12MegaCorp,otlkMag:19,spreadPerc:{divisor:10,max:5,min:1},shareTxForMovement:{max:9e4,min:3e4},symbol:a.a[r.a.Sector12MegaCorp]},{b:!0,initPrice:{max:25e3,min:12e3},marketCap:16e11,mv:{divisor:100,max:80,min:70},name:r.a.Sector12BladeIndustries,otlkMag:13,spreadPerc:{divisor:10,max:6,min:1},shareTxForMovement:{max:9e4,min:3e4},symbol:a.a[r.a.Sector12BladeIndustries]},{b:!0,initPrice:{max:25e3,min:1e4},marketCap:15e11,mv:{divisor:100,max:75,min:65},name:r.a.AevumClarkeIncorporated,otlkMag:12,spreadPerc:{divisor:10,max:5,min:1},shareTxForMovement:{max:9e4,min:3e4},symbol:a.a[r.a.AevumClarkeIncorporated]},{b:!0,initPrice:{max:43e3,min:32e3},marketCap:18e11,mv:{divisor:100,max:70,min:60},name:r.a.VolhavenOmniTekIncorporated,otlkMag:12,spreadPerc:{divisor:10,max:6,min:1},shareTxForMovement:{max:9e4,min:3e4},symbol:a.a[r.a.VolhavenOmniTekIncorporated]},{b:!0,initPrice:{max:8e4,min:5e4},marketCap:2e12,mv:{divisor:100,max:110,min:100},name:r.a.Sector12FourSigma,otlkMag:17,spreadPerc:{divisor:10,max:10,min:1},shareTxForMovement:{max:9e4,min:3e4},symbol:a.a[r.a.Sector12FourSigma]},{b:!0,initPrice:{max:28e3,min:16e3},marketCap:19e11,mv:{divisor:100,max:85,min:75},name:r.a.ChongqingKuaiGongInternational,otlkMag:10,spreadPerc:{divisor:10,max:7,min:1},shareTxForMovement:{max:9e4,min:3e4},symbol:a.a[r.a.ChongqingKuaiGongInternational]},{b:!0,initPrice:{max:36e3,min:29e3},marketCap:2e12,mv:{divisor:100,max:130,min:120},name:r.a.AevumFulcrumTechnologies,otlkMag:16,spreadPerc:{divisor:10,max:10,min:1},shareTxForMovement:{max:9e4,min:3e4},symbol:a.a[r.a.AevumFulcrumTechnologies]},{b:!0,initPrice:{max:25e3,min:2e4},marketCap:12e11,mv:{divisor:100,max:90,min:80},name:r.a.IshimaStormTechnologies,otlkMag:7,spreadPerc:{divisor:10,max:10,min:2},shareTxForMovement:{max:108e3,min:36e3},symbol:a.a[r.a.IshimaStormTechnologies]},{b:!0,initPrice:{max:19e3,min:6e3},marketCap:9e11,mv:{divisor:100,max:70,min:60},name:r.a.NewTokyoDefComm,otlkMag:10,spreadPerc:{divisor:10,max:10,min:2},shareTxForMovement:{max:108e3,min:36e3},symbol:a.a[r.a.NewTokyoDefComm]},{b:!0,initPrice:{max:18e3,min:1e4},marketCap:825e9,mv:{divisor:100,max:65,min:55},name:r.a.VolhavenHeliosLabs,otlkMag:9,spreadPerc:{divisor:10,max:10,min:2},shareTxForMovement:{max:108e3,min:36e3},symbol:a.a[r.a.VolhavenHeliosLabs]},{b:!0,initPrice:{max:14e3,min:8e3},marketCap:1e12,mv:{divisor:100,max:80,min:70},name:r.a.NewTokyoVitaLife,otlkMag:7,spreadPerc:{divisor:10,max:10,min:2},shareTxForMovement:{max:108e3,min:36e3},symbol:a.a[r.a.NewTokyoVitaLife]},{b:!0,initPrice:{max:24e3,min:12e3},marketCap:8e11,mv:{divisor:100,max:70,min:60},name:r.a.Sector12IcarusMicrosystems,otlkMag:7.5,spreadPerc:{divisor:10,max:10,min:3},shareTxForMovement:{max:108e3,min:36e3},symbol:a.a[r.a.Sector12IcarusMicrosystems]},{b:!0,initPrice:{max:29e3,min:16e3},marketCap:9e11,mv:{divisor:100,max:60,min:50},name:r.a.Sector12UniversalEnergy,otlkMag:10,spreadPerc:{divisor:10,max:10,min:2},shareTxForMovement:{max:108e3,min:36e3},symbol:a.a[r.a.Sector12UniversalEnergy]},{b:!0,initPrice:{max:17e3,min:8e3},marketCap:64e10,mv:{divisor:100,max:65,min:55},name:r.a.AevumAeroCorp,otlkMag:6,spreadPerc:{divisor:10,max:10,min:3},shareTxForMovement:{max:126e3,min:42e3},symbol:a.a[r.a.AevumAeroCorp]},{b:!0,initPrice:{max:15e3,min:6e3},marketCap:6e11,mv:{divisor:100,max:75,min:65},name:r.a.VolhavenOmniaCybersystems,otlkMag:4.5,spreadPerc:{divisor:10,max:11,min:4},shareTxForMovement:{max:126e3,min:42e3},symbol:a.a[r.a.VolhavenOmniaCybersystems]},{b:!0,initPrice:{max:28e3,min:14e3},marketCap:705e9,mv:{divisor:100,max:80,min:70},name:r.a.ChongqingSolarisSpaceSystems,otlkMag:8.5,spreadPerc:{divisor:10,max:12,min:4},shareTxForMovement:{max:126e3,min:42e3},symbol:a.a[r.a.ChongqingSolarisSpaceSystems]},{b:!0,initPrice:{max:3e4,min:12e3},marketCap:695e9,mv:{divisor:100,max:65,min:55},name:r.a.NewTokyoGlobalPharmaceuticals,otlkMag:10.5,spreadPerc:{divisor:10,max:10,min:4},shareTxForMovement:{max:126e3,min:42e3},symbol:a.a[r.a.NewTokyoGlobalPharmaceuticals]},{b:!0,initPrice:{max:27e3,min:15e3},marketCap:6e11,mv:{divisor:100,max:80,min:70},name:r.a.IshimaNovaMedical,otlkMag:5,spreadPerc:{divisor:10,max:11,min:4},shareTxForMovement:{max:126e3,min:42e3},symbol:a.a[r.a.IshimaNovaMedical]},{b:!0,initPrice:{max:8500,min:4e3},marketCap:45e10,mv:{divisor:100,max:260,min:240},name:r.a.AevumWatchdogSecurity,otlkMag:1.5,spreadPerc:{divisor:10,max:12,min:5},shareTxForMovement:{max:54e3,min:12e3},symbol:a.a[r.a.AevumWatchdogSecurity]},{b:!0,initPrice:{max:8e3,min:4500},marketCap:3e11,mv:{divisor:100,max:135,min:115},name:r.a.VolhavenLexoCorp,otlkMag:6,spreadPerc:{divisor:10,max:12,min:5},shareTxForMovement:{max:108e3,min:36e3},symbol:a.a[r.a.VolhavenLexoCorp]},{b:!0,initPrice:{max:7e3,min:2e3},marketCap:18e10,mv:{divisor:100,max:70,min:50},name:r.a.AevumRhoConstruction,otlkMag:1,spreadPerc:{divisor:10,max:10,min:3},shareTxForMovement:{max:126e3,min:6e4},symbol:a.a[r.a.AevumRhoConstruction]},{b:!0,initPrice:{max:8500,min:4e3},marketCap:24e10,mv:{divisor:100,max:205,min:175},name:r.a.Sector12AlphaEnterprises,otlkMag:10,spreadPerc:{divisor:10,max:16,min:5},shareTxForMovement:{max:9e4,min:3e4},symbol:a.a[r.a.Sector12AlphaEnterprises]},{b:!0,initPrice:{max:8e3,min:3e3},marketCap:2e11,mv:{divisor:100,max:170,min:150},name:r.a.VolhavenSysCoreSecurities,otlkMag:3,spreadPerc:{divisor:10,max:12,min:5},shareTxForMovement:{max:9e4,min:15e3},symbol:a.a[r.a.VolhavenSysCoreSecurities]},{b:!0,initPrice:{max:6e3,min:1e3},marketCap:185e9,mv:{divisor:100,max:100,min:80},name:r.a.VolhavenCompuTek,otlkMag:4,spreadPerc:{divisor:10,max:12,min:4},shareTxForMovement:{max:126e3,min:6e4},symbol:a.a[r.a.VolhavenCompuTek]},{b:!0,initPrice:{max:5e3,min:1e3},marketCap:58e9,mv:{divisor:100,max:400,min:200},name:r.a.AevumNetLinkTechnologies,otlkMag:1,spreadPerc:{divisor:10,max:20,min:5},shareTxForMovement:{max:54e3,min:18e3},symbol:a.a[r.a.AevumNetLinkTechnologies]},{b:!0,initPrice:{max:8e3,min:1e3},marketCap:6e10,mv:{divisor:100,max:110,min:90},name:r.a.IshimaOmegaSoftware,otlkMag:.5,spreadPerc:{divisor:10,max:13,min:4},shareTxForMovement:{max:9e4,min:3e4},symbol:a.a[r.a.IshimaOmegaSoftware]},{b:!1,initPrice:{max:4500,min:500},marketCap:45e9,mv:{divisor:100,max:80,min:70},name:r.a.Sector12FoodNStuff,otlkMag:1,spreadPerc:{divisor:10,max:10,min:6},shareTxForMovement:{max:18e4,min:6e4},symbol:a.a[r.a.Sector12FoodNStuff]},{b:!0,initPrice:{max:3500,min:1500},marketCap:3e10,mv:{divisor:100,max:275,min:100},name:"Sigma Cosmetics",otlkMag:0,spreadPerc:{divisor:10,max:14,min:6},shareTxForMovement:{max:7e4,min:2e4},symbol:a.a["Sigma Cosmetics"]},{b:!0,initPrice:{max:1500,min:250},marketCap:42e9,mv:{divisor:100,max:350,min:200},name:r.a.Sector12JoesGuns,otlkMag:1,spreadPerc:{divisor:10,max:14,min:6},shareTxForMovement:{max:52e3,min:15e3},symbol:a.a[r.a.Sector12JoesGuns]},{b:!0,initPrice:{max:1500,min:250},marketCap:1e11,mv:{divisor:100,max:175,min:120},name:"Catalyst Ventures",otlkMag:13.5,spreadPerc:{divisor:10,max:14,min:5},shareTxForMovement:{max:72e3,min:24e3},symbol:a.a["Catalyst Ventures"]},{b:!0,initPrice:{max:3e4,min:15e3},marketCap:36e10,mv:{divisor:100,max:80,min:70},name:"Microdyne Technologies",otlkMag:8,spreadPerc:{divisor:10,max:10,min:3},shareTxForMovement:{max:216e3,min:9e4},symbol:a.a["Microdyne Technologies"]},{b:!0,initPrice:{max:24e3,min:12e3},marketCap:42e10,mv:{divisor:100,max:70,min:50},name:"Titan Laboratories",otlkMag:11,spreadPerc:{divisor:10,max:10,min:2},shareTxForMovement:{max:216e3,min:9e4},symbol:a.a["Titan Laboratories"]}]},,function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(4),r=n(187),i=n(530),o=n(82),s=n(242),l=n(229);function c(t,e){const n=function(e){const n=t.gang;if(null===n)throw new Error("Must have joined gang");if(!(n instanceof i.a))throw e.makeRuntimeErrorMsg("You do not currently have a Gang")},c=function(e,n){const a=t.gang;if(null===a)throw new Error("Must have joined gang");for(const t of a.members)if(t.name===n)return t;throw e.makeRuntimeErrorMsg(`Invalid gang member: '${n}'`)};return{createGang:e=>n=>{const i=e.helper.string("faction",n);if(!t.canAccessGang()||!r.a.Names.includes(i))return!1;if(t.inGang())return!1;if(!t.factions.includes(i))return!1;const o=i===a.a.NiteSec||i===a.a.TheBlackHand;return t.startGang(i,o),!0},inGang:()=>()=>t.inGang(),getMemberNames:e=>()=>{n(e);const a=t.gang;if(null===a)throw new Error("Should not be called without Gang");return a.members.map(t=>t.name)},getGangInformation:e=>()=>{n(e);const a=t.gang;if(null===a)throw new Error("Should not be called without Gang");return{faction:a.facName,isHacking:a.isHackingGang,moneyGainRate:a.moneyGainRate,power:a.getPower(),respect:a.respect,respectGainRate:a.respectGainRate,territory:a.getTerritory(),territoryClashChance:a.territoryClashChance,territoryWarfareEngaged:a.territoryWarfareEngaged,wantedLevel:a.wanted,wantedLevelGainRate:a.wantedGainRate,wantedPenalty:a.getWantedPenalty()}},getOtherGangInformation:t=>()=>{n(t);const e={};for(const t of Object.keys(o.a))e[t]=Object.assign({},o.a[t]);return e},getMemberInformation:e=>a=>{const r=e.helper.string("memberName",a);n(e);const i=t.gang;if(null===i)throw new Error("Should not be called without Gang");const o=c(e,r);return{name:o.name,task:o.task,earnedRespect:o.earnedRespect,hack:o.hack,str:o.str,def:o.def,dex:o.dex,agi:o.agi,cha:o.cha,hack_exp:o.hack_exp,str_exp:o.str_exp,def_exp:o.def_exp,dex_exp:o.dex_exp,agi_exp:o.agi_exp,cha_exp:o.cha_exp,hack_mult:o.hack_mult,str_mult:o.str_mult,def_mult:o.def_mult,dex_mult:o.dex_mult,agi_mult:o.agi_mult,cha_mult:o.cha_mult,hack_asc_mult:o.calculateAscensionMult(o.hack_asc_points),str_asc_mult:o.calculateAscensionMult(o.str_asc_points),def_asc_mult:o.calculateAscensionMult(o.def_asc_points),dex_asc_mult:o.calculateAscensionMult(o.dex_asc_points),agi_asc_mult:o.calculateAscensionMult(o.agi_asc_points),cha_asc_mult:o.calculateAscensionMult(o.cha_asc_points),hack_asc_points:o.hack_asc_points,str_asc_points:o.str_asc_points,def_asc_points:o.def_asc_points,dex_asc_points:o.dex_asc_points,agi_asc_points:o.agi_asc_points,cha_asc_points:o.cha_asc_points,upgrades:o.upgrades.slice(),augmentations:o.augmentations.slice(),respectGain:o.calculateRespectGain(i),wantedLevelGain:o.calculateWantedLevelGain(i),moneyGain:o.calculateMoneyGain(i)}},canRecruitMember:e=>()=>{n(e);const a=t.gang;if(null===a)throw new Error("Should not be called without Gang");return a.canRecruitMember()},recruitMember:a=>r=>{const i=a.helper.string("memberName",r);n(a);const o=t.gang;if(null===o)throw new Error("Should not be called without Gang");const s=o.recruitMember(i);return s?e.log("gang.recruitMember",()=>`Successfully recruited Gang Member '${i}'`):e.log("gang.recruitMember",()=>`Failed to recruit Gang Member '${i}'`),s},getTaskNames:e=>()=>{n(e);const a=t.gang;if(null===a)throw new Error("Should not be called without Gang");const r=a.getAllTaskNames();return r.unshift("Unassigned"),r},setMemberTask:a=>(r,i)=>{const o=a.helper.string("memberName",r),s=a.helper.string("taskName",i);n(a);const l=c(a,o),f=t.gang;if(null===f)throw new Error("Should not be called without Gang");if(!f.getAllTaskNames().includes(s))return e.log("gang.setMemberTask",()=>`Failed to assign Gang Member '${o}' to Invalid task '${s}'. '${o}' is now Unassigned`),l.assignToTask("Unassigned");const u=l.assignToTask(s);return u?e.log("gang.setMemberTask",()=>`Successfully assigned Gang Member '${o}' to '${s}' task`):e.log("gang.setMemberTask",()=>`Failed to assign Gang Member '${o}' to '${s}' task. '${o}' is now Unassigned`),u},getTaskStats:t=>e=>{const a=t.helper.string("taskName",e);n(t);const r=function(t,e){const n=s.a[e];if(!n)throw t.makeRuntimeErrorMsg(`Invalid task: '${e}'`);return n}(t,a),i=Object.assign({},r);return i.territory=Object.assign({},r.territory),i},getEquipmentNames:t=>()=>(n(t),Object.keys(l.a)),getEquipmentCost:e=>a=>{const r=e.helper.string("equipName",a);n(e);const i=t.gang;if(null===i)throw new Error("Should not be called without Gang");const o=l.a[r];return null===o?1/0:i.getUpgradeCost(o)},getEquipmentType:t=>e=>{const a=t.helper.string("equipName",e);n(t);const r=l.a[a];return null==r?"":r.getType()},getEquipmentStats:t=>e=>{const a=t.helper.string("equipName",e);n(t);const r=l.a[a];if(!r)throw t.makeRuntimeErrorMsg("Invalid equipment: "+a);const i=r.mults;return Object.assign({},i)},purchaseEquipment:a=>(r,i)=>{const o=a.helper.string("memberName",r),s=a.helper.string("equipName",i);n(a);const f=t.gang;if(null===f)throw new Error("Should not be called without Gang");const u=c(a,o),m=l.a[s];if(!m)return!1;const h=u.buyUpgrade(m,t,f);return h?e.log("gang.purchaseEquipment",()=>`Purchased '${s}' for Gang member '${o}'`):e.log("gang.purchaseEquipment",()=>`Failed to purchase '${s}' for Gang member '${o}'`),h},ascendMember:a=>r=>{const i=a.helper.string("memberName",r);n(a);const o=t.gang;if(null===o)throw new Error("Should not be called without Gang");const s=c(a,i);if(s.canAscend())return o.ascendMember(s,e)},getAscensionResult:e=>a=>{const r=e.helper.string("memberName",a);n(e);if(null===t.gang)throw new Error("Should not be called without Gang");const i=c(e,r);if(i.canAscend())return{respect:i.earnedRespect,...i.getAscensionResults()}},setTerritoryWarfare:a=>r=>{const i=a.helper.boolean(r);n(a);const o=t.gang;if(null===o)throw new Error("Should not be called without Gang");i?(o.territoryWarfareEngaged=!0,e.log("gang.setTerritoryWarfare",()=>"Engaging in Gang Territory Warfare")):(o.territoryWarfareEngaged=!1,e.log("gang.setTerritoryWarfare",()=>"Disengaging in Gang Territory Warfare"))},getChanceToWinClash:e=>a=>{const r=e.helper.string("otherGang",a);n(e);const i=t.gang;if(null===i)throw new Error("Should not be called without Gang");if(null==o.a[r])throw e.makeRuntimeErrorMsg("Invalid gang: "+r);const s=o.a[i.facName].power;return s/(o.a[r].power+s)},getBonusTime:e=>()=>{n(e);const a=t.gang;if(null===a)throw new Error("Should not be called without Gang");return 1e3*Math.round(a.storedCycles/5)}}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a=[{desc:"This gang member is currently idle",isCombat:!0,isHacking:!0,name:"Unassigned",params:{hackWeight:100}},{desc:"Assign this gang member to create and distribute ransomware

Earns money - Slightly increases respect - Slightly increases wanted level",isCombat:!1,isHacking:!0,name:"Ransomware",params:{baseRespect:5e-5,baseWanted:1e-4,baseMoney:3,hackWeight:100,difficulty:1}},{desc:"Assign this gang member to attempt phishing scams and attacks

Earns money - Slightly increases respect - Slightly increases wanted level",isCombat:!1,isHacking:!0,name:"Phishing",params:{baseRespect:8e-5,baseWanted:.003,baseMoney:7.5,hackWeight:85,chaWeight:15,difficulty:3.5}},{desc:"Assign this gang member to attempt identity theft

Earns money - Increases respect - Increases wanted level",isCombat:!1,isHacking:!0,name:"Identity Theft",params:{baseRespect:1e-4,baseWanted:.075,baseMoney:18,hackWeight:80,chaWeight:20,difficulty:5}},{desc:"Assign this gang member to carry out DDoS attacks

Increases respect - Increases wanted level",isCombat:!1,isHacking:!0,name:"DDoS Attacks",params:{baseRespect:4e-4,baseWanted:.2,hackWeight:100,difficulty:8}},{desc:"Assign this gang member to create and distribute malicious viruses

Increases respect - Increases wanted level",isCombat:!1,isHacking:!0,name:"Plant Virus",params:{baseRespect:6e-4,baseWanted:.4,hackWeight:100,difficulty:12}},{desc:"Assign this gang member to commit financial fraud and digital counterfeiting

Earns money - Slightly increases respect - Slightly increases wanted level",isCombat:!1,isHacking:!0,name:"Fraud & Counterfeiting",params:{baseRespect:4e-4,baseWanted:.3,baseMoney:45,hackWeight:80,chaWeight:20,difficulty:20}},{desc:"Assign this gang member to launder money

Earns money - Increases respect - Increases wanted level",isCombat:!1,isHacking:!0,name:"Money Laundering",params:{baseRespect:.001,baseWanted:1.25,baseMoney:360,hackWeight:75,chaWeight:25,difficulty:25}},{desc:"Assign this gang member to commit acts of cyberterrorism

Greatly increases respect - Greatly increases wanted level",isCombat:!1,isHacking:!0,name:"Cyberterrorism",params:{baseRespect:.01,baseWanted:6,hackWeight:80,chaWeight:20,difficulty:36}},{desc:"Assign this gang member to be an ethical hacker for corporations

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

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

Earns money - Slightly increases respect - Slightly increases wanted level - Scales slightly with territory",isCombat:!0,isHacking:!1,name:"Deal Drugs",params:{baseRespect:6e-5,baseWanted:.002,baseMoney:15,agiWeight:20,dexWeight:20,chaWeight:60,difficulty:3.5,territory:{money:1.2,respect:1,wanted:1.15}}},{desc:"Assign this gang member to extort civilians in your territory

Earns money - Slightly increases respect - Increases wanted - Scales heavily with territory",isCombat:!0,isHacking:!1,name:"Strongarm Civilians",params:{baseRespect:4e-5,baseWanted:.02,baseMoney:7.5,hackWeight:10,strWeight:25,defWeight:25,dexWeight:20,agiWeight:10,chaWeight:10,difficulty:5,territory:{money:1.6,respect:1.1,wanted:1.5}}},{desc:"Assign this gang member to run cons

Earns money - Increases respect - Increases wanted level",isCombat:!0,isHacking:!1,name:"Run a Con",params:{baseRespect:12e-5,baseWanted:.05,baseMoney:45,strWeight:5,defWeight:5,agiWeight:25,dexWeight:25,chaWeight:40,difficulty:14}},{desc:"Assign this gang member to commit armed robbery on stores, banks and armored cars

Earns money - Increases respect - Increases wanted level",isCombat:!0,isHacking:!1,name:"Armed Robbery",params:{baseRespect:14e-5,baseWanted:.1,baseMoney:114,hackWeight:20,strWeight:15,defWeight:15,agiWeight:10,dexWeight:20,chaWeight:20,difficulty:20}},{desc:"Assign this gang member to traffick illegal arms

Earns money - Increases respect - Increases wanted level - Scales heavily with territory",isCombat:!0,isHacking:!1,name:"Traffick Illegal Arms",params:{baseRespect:2e-4,baseWanted:.24,baseMoney:174,hackWeight:15,strWeight:20,defWeight:20,dexWeight:20,chaWeight:25,difficulty:32,territory:{money:1.4,respect:1.3,wanted:1.25}}},{desc:"Assign this gang member to threaten and black mail high-profile targets

Earns money - Slightly increases respect - Slightly increases wanted level",isCombat:!0,isHacking:!1,name:"Threaten & Blackmail",params:{baseRespect:2e-4,baseWanted:.125,baseMoney:72,hackWeight:25,strWeight:25,dexWeight:25,chaWeight:25,difficulty:28}},{desc:"Assign this gang member to engage in human trafficking operations

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

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

Decreases wanted level",isCombat:!0,isHacking:!0,name:"Vigilante Justice",params:{baseWanted:-.001,hackWeight:20,strWeight:20,defWeight:20,dexWeight:20,agiWeight:20,difficulty:1,territory:{money:1,respect:1,wanted:.9}}},{desc:"Assign this gang member to increase their combat stats (str, def, dex, agi)",isCombat:!0,isHacking:!0,name:"Train Combat",params:{strWeight:25,defWeight:25,dexWeight:25,agiWeight:25,difficulty:100}},{desc:"Assign this gang member to train their hacking skills",isCombat:!0,isHacking:!0,name:"Train Hacking",params:{hackWeight:100,difficulty:45}},{desc:"Assign this gang member to train their charisma",isCombat:!0,isHacking:!0,name:"Train Charisma",params:{chaWeight:100,difficulty:8}},{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.",isCombat:!0,isHacking:!0,name:"Territory Warfare",params:{hackWeight:15,strWeight:20,defWeight:20,dexWeight:20,agiWeight:20,chaWeight:5,difficulty:5}}]},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(599),r=n(242),i=n(229),o=n(28),s=n(203);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=""){l(this,"task","Unassigned"),l(this,"earnedRespect",0),l(this,"hack",1),l(this,"str",1),l(this,"def",1),l(this,"dex",1),l(this,"agi",1),l(this,"cha",1),l(this,"hack_exp",0),l(this,"str_exp",0),l(this,"def_exp",0),l(this,"dex_exp",0),l(this,"agi_exp",0),l(this,"cha_exp",0),l(this,"hack_mult",1),l(this,"str_mult",1),l(this,"def_mult",1),l(this,"dex_mult",1),l(this,"agi_mult",1),l(this,"cha_mult",1),l(this,"hack_asc_points",0),l(this,"str_asc_points",0),l(this,"def_asc_points",0),l(this,"dex_asc_points",0),l(this,"agi_asc_points",0),l(this,"cha_asc_points",0),l(this,"upgrades",[]),l(this,"augmentations",[]),this.name=t}calculateSkill(t,e=1){return Math.max(Math.floor(e*(32*Math.log(t+534.5)-200)),1)}calculateAscensionMult(t){return Object(s.a)(t)}updateSkillLevels(){this.hack=this.calculateSkill(this.hack_exp,this.hack_mult*this.calculateAscensionMult(this.hack_asc_points)),this.str=this.calculateSkill(this.str_exp,this.str_mult*this.calculateAscensionMult(this.str_asc_points)),this.def=this.calculateSkill(this.def_exp,this.def_mult*this.calculateAscensionMult(this.def_asc_points)),this.dex=this.calculateSkill(this.dex_exp,this.dex_mult*this.calculateAscensionMult(this.dex_asc_points)),this.agi=this.calculateSkill(this.agi_exp,this.agi_mult*this.calculateAscensionMult(this.agi_asc_points)),this.cha=this.calculateSkill(this.cha_exp,this.cha_mult*this.calculateAscensionMult(this.cha_asc_points))}calculatePower(){return(this.hack+this.str+this.def+this.dex+this.agi+this.cha)/95}assignToTask(t){return r.a.hasOwnProperty(t)?(this.task=t,!0):(this.task="Unassigned",!1)}unassignFromTask(){this.task="Unassigned"}getTask(){return this.task instanceof a.a&&(this.task=this.task.name),r.a.hasOwnProperty(this.task)?r.a[this.task]:r.a.Unassigned}calculateRespectGain(t){const e=this.getTask(),n={respect:t.respect,wantedLevel:t.wanted,territory:t.getTerritory()};return Object(s.d)(n,this,e)}calculateWantedLevelGain(t){const e=this.getTask(),n={respect:t.respect,wantedLevel:t.wanted,territory:t.getTerritory()};return Object(s.e)(n,this,e)}calculateMoneyGain(t){const e=this.getTask(),n={respect:t.respect,wantedLevel:t.wanted,territory:t.getTerritory()};return Object(s.c)(n,this,e)}expMult(){return{hack:(this.hack_mult-1)/4+1,str:(this.str_mult-1)/4+1,def:(this.def_mult-1)/4+1,dex:(this.dex_mult-1)/4+1,agi:(this.agi_mult-1)/4+1,cha:(this.cha_mult-1)/4+1}}gainExperience(t=1){const e=this.getTask();if(e===r.a.Unassigned)return;const n=Math.pow(e.difficulty,.9)*t,a=this.expMult();this.hack_exp+=e.hackWeight/1500*n*a.hack*this.calculateAscensionMult(this.hack_asc_points),this.str_exp+=e.strWeight/1500*n*a.str*this.calculateAscensionMult(this.str_asc_points),this.def_exp+=e.defWeight/1500*n*a.def*this.calculateAscensionMult(this.def_asc_points),this.dex_exp+=e.dexWeight/1500*n*a.dex*this.calculateAscensionMult(this.dex_asc_points),this.agi_exp+=e.agiWeight/1500*n*a.agi*this.calculateAscensionMult(this.agi_asc_points),this.cha_exp+=e.chaWeight/1500*n*a.cha*this.calculateAscensionMult(this.cha_asc_points)}recordEarnedRespect(t=1,e){this.earnedRespect+=this.calculateRespectGain(e)*t}getGainedAscensionPoints(){return{hack:Object(s.b)(this.hack_exp),str:Object(s.b)(this.str_exp),def:Object(s.b)(this.def_exp),dex:Object(s.b)(this.dex_exp),agi:Object(s.b)(this.agi_exp),cha:Object(s.b)(this.cha_exp)}}canAscend(){const t=this.getGainedAscensionPoints();return t.hack>0||t.str>0||t.def>0||t.dex>0||t.agi>0||t.cha>0}getCurrentAscensionMults(){return{hack:this.calculateAscensionMult(this.hack_asc_points),str:this.calculateAscensionMult(this.str_asc_points),def:this.calculateAscensionMult(this.def_asc_points),dex:this.calculateAscensionMult(this.dex_asc_points),agi:this.calculateAscensionMult(this.agi_asc_points),cha:this.calculateAscensionMult(this.cha_asc_points)}}getAscensionMultsAfterAscend(){const t=this.getGainedAscensionPoints();return{hack:this.calculateAscensionMult(this.hack_asc_points+t.hack),str:this.calculateAscensionMult(this.str_asc_points+t.str),def:this.calculateAscensionMult(this.def_asc_points+t.def),dex:this.calculateAscensionMult(this.dex_asc_points+t.dex),agi:this.calculateAscensionMult(this.agi_asc_points+t.agi),cha:this.calculateAscensionMult(this.cha_asc_points+t.cha)}}getAscensionResults(){const t=this.getAscensionMultsAfterAscend(),e=this.getCurrentAscensionMults();return{hack:t.hack/e.hack,str:t.str/e.str,def:t.def/e.def,dex:t.dex/e.dex,agi:t.agi/e.agi,cha:t.cha/e.cha}}ascend(){const t=this.getAscensionResults(),e=this.getGainedAscensionPoints();this.hack_asc_points+=e.hack,this.str_asc_points+=e.str,this.def_asc_points+=e.def,this.dex_asc_points+=e.dex,this.agi_asc_points+=e.agi,this.cha_asc_points+=e.cha,this.upgrades.length=0,this.hack_mult=1,this.str_mult=1,this.def_mult=1,this.dex_mult=1,this.agi_mult=1,this.cha_mult=1;for(let t=0;t")}getType(){switch(this.type){case a.a.Weapon:return"Weapon";case a.a.Armor:return"Armor";case a.a.Vehicle:return"Vehicle";case a.a.Rootkit:return"Rootkit";case a.a.Augmentation:return"Augmentation";default:return""}}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(4);const r={[a.a.SlumSnakes]:1,[a.a.Tetrads]:2,[a.a.TheSyndicate]:2,[a.a.TheDarkArmy]:2,[a.a.SpeakersForTheDead]:5,[a.a.NiteSec]:2,[a.a.TheBlackHand]:5}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(188),r=n(66),i=n(600),o=n(79),s=n(15),l=n(379),c=n(370);function f(t){const e=function(e){if(10!==t.bitNodeN&&!t.sourceFileLvl(10))throw e.makeRuntimeErrorMsg("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=function(e,n){if(n>=t.sleeves.length||n<0){const t="Invalid sleeve number: "+n;throw e.log(()=>t),e.makeRuntimeErrorMsg(t)}},f=function(e){const n=t.sleeves[e];return{shock:100-n.shock,sync:n.sync,hacking:n.hacking,strength:n.strength,defense:n.defense,dexterity:n.dexterity,agility:n.agility,charisma:n.charisma}};return{getNumSleeves:n=>()=>(e(n),t.sleeves.length),setToShockRecovery:a=>r=>{const i=a.helper.number("sleeveNumber",r);return e(a),n(a,i),t.sleeves[i].shockRecovery(t)},setToSynchronize:a=>r=>{const i=a.helper.number("sleeveNumber",r);return e(a),n(a,i),t.sleeves[i].synchronize(t)},setToCommitCrime:a=>(r,i)=>{const o=a.helper.number("sleeveNumber",r),s=a.helper.string("crimeName",i);e(a),n(a,o);const c=Object(l.b)(s);return null!==c&&t.sleeves[o].commitCrime(t,c.name)},setToUniversityCourse:a=>(r,i,o)=>{const s=a.helper.number("sleeveNumber",r),l=a.helper.string("universityName",i),c=a.helper.string("className",o);return e(a),n(a,s),t.sleeves[s].takeUniversityCourse(t,l,c)},travel:a=>(r,i)=>{const o=a.helper.number("sleeveNumber",r),l=a.helper.string("cityName",i);if(e(a),n(a,o),Object(c.a)(s.a,l))return t.sleeves[o].travel(t,l);throw a.makeRuntimeErrorMsg(`Invalid city name: '${l}'.`)},setToCompanyWork:a=>(i,o)=>{const s=a.helper.number("sleeveNumber",i),l=a.helper.string("companyName",o);e(a),n(a,s);for(let e=0;e(i,o,s)=>{const l=a.helper.number("sleeveNumber",i),c=a.helper.string("factionName",o),f=a.helper.string("workType",s);e(a),n(a,l);for(let e=0;e(r,i,o)=>{const s=a.helper.number("sleeveNumber",r),l=a.helper.string("gymName",i),c=a.helper.string("stat",o);return e(a),n(a,s),t.sleeves[s].workoutAtGym(t,l,c)},getSleeveStats:t=>a=>{const r=t.helper.number("sleeveNumber",a);return e(t),n(t,r),f(r)},getTask:i=>o=>{const s=i.helper.number("sleeveNumber",o);e(i),n(i,s);const l=t.sleeves[s];return{task:r.a[l.currentTask],crime:l.crimeType,location:l.currentTaskLocation,gymStatType:l.gymStatType,factionWorkType:a.a[l.factionWorkType],className:l.className}},getInformation:a=>r=>{const i=a.helper.number("sleeveNumber",r);e(a),n(a,i);const o=t.sleeves[i];return{tor:!1,city:o.city,hp:o.hp,jobs:Object.keys(t.jobs),jobTitle:Object.values(t.jobs),maxHp:o.max_hp,mult:{agility:o.agility_mult,agilityExp:o.agility_exp_mult,charisma:o.charisma_mult,charismaExp:o.charisma_exp_mult,companyRep:o.company_rep_mult,crimeMoney:o.crime_money_mult,crimeSuccess:o.crime_success_mult,defense:o.defense_mult,defenseExp:o.defense_exp_mult,dexterity:o.dexterity_mult,dexterityExp:o.dexterity_exp_mult,factionRep:o.faction_rep_mult,hacking:o.hacking_mult,hackingExp:o.hacking_exp_mult,strength:o.strength_mult,strengthExp:o.strength_exp_mult,workMoney:o.work_money_mult},timeWorked:o.currentTaskTime,earningsForSleeves:{workHackExpGain:o.earningsForSleeves.hack,workStrExpGain:o.earningsForSleeves.str,workDefExpGain:o.earningsForSleeves.def,workDexExpGain:o.earningsForSleeves.dex,workAgiExpGain:o.earningsForSleeves.agi,workChaExpGain:o.earningsForSleeves.cha,workMoneyGain:o.earningsForSleeves.money},earningsForPlayer:{workHackExpGain:o.earningsForPlayer.hack,workStrExpGain:o.earningsForPlayer.str,workDefExpGain:o.earningsForPlayer.def,workDexExpGain:o.earningsForPlayer.dex,workAgiExpGain:o.earningsForPlayer.agi,workChaExpGain:o.earningsForPlayer.cha,workMoneyGain:o.earningsForPlayer.money},earningsForTask:{workHackExpGain:o.earningsForTask.hack,workStrExpGain:o.earningsForTask.str,workDefExpGain:o.earningsForTask.def,workDexExpGain:o.earningsForTask.dex,workAgiExpGain:o.earningsForTask.agi,workChaExpGain:o.earningsForTask.cha,workMoneyGain:o.earningsForTask.money},workRepGain:o.getRepGain(t)}},getSleeveAugmentations:a=>r=>{const i=a.helper.number("sleeveNumber",r);e(a),n(a,i);const o=[];for(let e=0;er=>{const o=a.helper.number("sleeveNumber",r);e(a),n(a,o);const s=Object(i.a)(t.sleeves[o],t),l=[];for(let t=0;t(r,i)=>{const s=a.helper.number("sleeveNumber",r),l=a.helper.string("augName",i);if(e(a),n(a,s),f(s).shock>0)throw a.makeRuntimeErrorMsg("Sleeve shock too high: Sleeve "+s);const c=o.a[l];if(!c)throw a.makeRuntimeErrorMsg("Invalid aug: "+l);return t.sleeves[s].tryBuyAugmentation(t,c)},setToBladeburnerAction:a=>(i,o,s)=>{const l=a.helper.number("sleeveNumber",i),c=a.helper.string("action",o);let f;if(f=void 0===s?"------":a.helper.string("contract",s),e(a),n(a,l),"Take on contracts"===c)for(let e=0;e()=>t.karma},openDevMenu:()=>()=>{i.b.emit()},exploit:()=>()=>{t.giveExploit(a.a.UndocumentedFunctionCall)},bypass:e=>n=>{const r=n;r.completely_unused_field=void 0;const i=document;i.completely_unused_field=void 0,i.completely_unused_field=!0,r.completely_unused_field&&1.6===e.workerScript.ramUsage&&t.giveExploit(a.a.Bypass),r.completely_unused_field=void 0,i.completely_unused_field=void 0},alterReality:()=>()=>{let e=!1;const n=function(t){0!==t&&(e=!e,n(t-1))};n(2),console.warn("I am sure that this variable is false."),!1!==e&&(console.warn("Reality has been altered!"),t.giveExploit(a.a.RealityAlteration))},rainbow:e=>n=>!!r.compareSync(e.helper.string("guess",n),"$2a$10$aertxDEkgor8baVtQDZsLuMwwGYmkRM/ohcA6FjmmzIHQeTCsrCcO")&&(t.giveExploit(a.a.INeedARainbow),!0)}}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(41),r=n(56),i=n(92),o=n(223),s=n(241),l=n(24);function c(t,e){const n=function(e,n){if(n<0||n>=t.hacknetNodes.length)throw e.makeRuntimeErrorMsg("Index specified for Hacknet Node is out-of-bounds: "+n);if(Object(r.g)(t)){const a=t.hacknetNodes[n];if("string"!=typeof a)throw new Error("hacknet node was not a string");const r=Object(l.d)(a);if(!(r instanceof i.a))throw new Error("hacknet server was not actually hacknet server");if(null==r)throw e.makeRuntimeErrorMsg(`Could not get Hacknet Server for index ${n}. This is probably a bug, please report to game dev`);return r}{const e=t.hacknetNodes[n];if(!(e instanceof o.a))throw new Error("hacknet node was not node.");return e}};return{numNodes:()=>()=>t.hacknetNodes.length,maxNumNodes:()=>()=>Object(r.g)(t)?a.b.MaxServers:1/0,purchaseNode:()=>()=>Object(r.l)(t),getPurchaseNodeCost:()=>()=>Object(r.g)(t)?Object(r.b)(t):Object(r.a)(t),getNodeStats:e=>a=>{const o=e.helper.number("i",a),s=n(e,o),l=Object(r.g)(t),c={name:s instanceof i.a?s.hostname:s.name,level:s.level,ram:s instanceof i.a?s.maxRam:s.ram,ramUsed:s instanceof i.a?s.ramUsed:void 0,cores:s.cores,production:s instanceof i.a?s.hashRate:s.moneyGainRatePerSecond,timeOnline:s.onlineTimeSeconds,totalProduction:s instanceof i.a?s.totalHashesGenerated:s.totalMoneyGenerated};return l&&s instanceof i.a&&(c.cache=s.cache,c.hashCapacity=s.hashCapacity),c},upgradeLevel:e=>(a,i=1)=>{const o=e.helper.number("i",a),s=e.helper.number("n",i),l=n(e,o);return Object(r.n)(t,l,s)},upgradeRam:e=>(a,i=1)=>{const o=e.helper.number("i",a),s=e.helper.number("n",i),l=n(e,o);return Object(r.o)(t,l,s)},upgradeCore:e=>(a,i=1)=>{const o=e.helper.number("i",a),s=e.helper.number("n",i),l=n(e,o);return Object(r.k)(t,l,s)},upgradeCache:a=>(o,s=1)=>{const l=a.helper.number("i",o),c=a.helper.number("n",s);if(!Object(r.g)(t))return!1;const f=n(a,l);if(!(f instanceof i.a))return e.log("hacknet.upgradeCache",()=>"Can only be called on hacknet servers"),!1;const u=Object(r.j)(t,f,c);return u&&Object(r.p)(t),u},getLevelUpgradeCost:e=>(a,r=1)=>{const i=e.helper.number("i",a),o=e.helper.number("n",r);return n(e,i).calculateLevelUpgradeCost(o,t.hacknet_node_level_cost_mult)},getRamUpgradeCost:e=>(a,r=1)=>{const i=e.helper.number("i",a),o=e.helper.number("n",r);return n(e,i).calculateRamUpgradeCost(o,t.hacknet_node_ram_cost_mult)},getCoreUpgradeCost:e=>(a,r=1)=>{const i=e.helper.number("i",a),o=e.helper.number("n",r);return n(e,i).calculateCoreUpgradeCost(o,t.hacknet_node_core_cost_mult)},getCacheUpgradeCost:a=>(o,s=1)=>{const l=a.helper.number("i",o),c=a.helper.number("n",s);if(!Object(r.g)(t))return 1/0;const f=n(a,l);return f instanceof i.a?f.calculateCacheUpgradeCost(c):(e.log("hacknet.getCacheUpgradeCost",()=>"Can only be called on hacknet servers"),-1)},numHashes:()=>()=>Object(r.g)(t)?t.hashManager.hashes:0,hashCapacity:()=>()=>Object(r.g)(t)?t.hashManager.capacity:0,hashCost:e=>n=>{const a=e.helper.string("upgName",n);return Object(r.g)(t)?t.hashManager.getUpgradeCost(a):1/0},spendHashes:e=>(n,a="")=>{const i=e.helper.string("upgName",n),o=e.helper.string("upgTarget",a);return!!Object(r.g)(t)&&Object(r.m)(t,i,o)},getHashUpgrades:()=>()=>Object(r.g)(t)?Object.values(s.a).map(t=>t.name):[],getHashUpgradeLevel:e=>n=>{const a=e.helper.string("upgName",n),r=t.hashManager.upgrades[a];if(void 0===r)throw e.makeRuntimeErrorMsg("Invalid Hash Upgrade: "+a);return r},getStudyMult:()=>()=>Object(r.g)(t)?t.hashManager.getStudyMult():1,getTrainingMult:()=>()=>Object(r.g)(t)?t.hashManager.getTrainingMult():1}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var a=n(110),r=n(101),i=n(120),o=n(61),s=n(12),l=n(119),c=n(4),f=n(105),u=n(26);function m(t,e,n){function m(e){if(!t.hasAugmentation(s.a.StaneksGift1,!0))throw n.makeRuntimeErrorMsg(e,"Stanek's Gift is not installed")}return{giftWidth:()=>function(){return m("giftWidth"),r.c.width()},giftHeight:()=>function(){return m("giftHeight"),r.c.height()},chargeFragment:n=>function(i,s){const l=n.helper.number("rootX",i),c=n.helper.number("rootY",s);m("chargeFragment");const f=r.c.findFragment(l,c);if(!f)throw n.makeRuntimeErrorMsg(`No fragment with root (${l}, ${c}).`);if(f.fragment().type==o.b.Booster)throw n.makeRuntimeErrorMsg(`The fragment with root (${l}, ${c}) is a Booster Fragment and thus cannot be charged.`);const u=r.c.inBonus()?200:1e3;return Object(a.c)(u,e).then((function(){return r.c.charge(t,f,e.scriptRef.threads),n.log(()=>`Charged fragment with ${n.workerScript.scriptRef.threads} threads.`),Promise.resolve()}))},fragmentDefinitions:t=>function(){return m("fragmentDefinitions"),t.log(()=>`Returned ${i.c.length} fragments`),i.c.map(t=>t.copy())},activeFragments:t=>function(){return m("activeFragments"),t.log(()=>`Returned ${r.c.fragments.length} fragments`),r.c.fragments.map(t=>({...t.copy(),...t.fragment().copy()}))},clearGift:t=>function(){m("clearGift"),t.log(()=>"Cleared Stanek's Gift."),r.c.clear()},canPlaceFragment:t=>function(e,n,a,o){const s=t.helper.number("rootX",e),l=t.helper.number("rootY",n),c=t.helper.number("rotation",a),f=t.helper.number("fragmentId",o);m("canPlaceFragment");const u=Object(i.b)(f);if(!u)throw t.makeRuntimeErrorMsg("Invalid fragment id: "+f);return r.c.canPlace(s,l,c,u)},placeFragment:t=>function(e,n,a,o){const s=t.helper.number("rootX",e),l=t.helper.number("rootY",n),c=t.helper.number("rotation",a),f=t.helper.number("fragmentId",o);m("placeFragment");const u=Object(i.b)(f);if(!u)throw t.makeRuntimeErrorMsg("Invalid fragment id: "+f);return r.c.place(s,l,c,u)},getFragment:t=>function(e,n){const a=t.helper.number("rootX",e),i=t.helper.number("rootY",n);m("getFragment");const o=r.c.findFragment(a,i);if(void 0!==o)return o.copy()},removeFragment:t=>function(e,n){const a=t.helper.number("rootX",e),i=t.helper.number("rootY",n);return m("removeFragment"),r.c.delete(a,i)},acceptGift:e=>function(){return t.canAccessCotMG()&&0==t.augmentations.filter(t=>t.name!==s.a.NeuroFluxGovernor).length&&0==t.queuedAugmentations.filter(t=>t.name!==s.a.NeuroFluxGovernor).length&&(Object(f.d)(u.a[c.a.ChurchOfTheMachineGod]),t.hasAugmentation(s.a.StaneksGift1)||t.queuedAugmentations.some(t=>t.name===s.a.StaneksGift1)||Object(l.a)({name:s.a.StaneksGift1,level:1})),u.a[c.a.ChurchOfTheMachineGod].isMember&&t.hasAugmentation(s.a.StaneksGift1)}}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(18);function r(t,e,n,r){return 1+Math.log(t+1)/60*Math.pow((e+1)/5,.07)*n*r*a.a.StaneksGiftPowerMultiplier}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(186),r=n(482),i=n(384),o=n(4),s=n(26),l=n(370),c=n(9);function f(t){const e=Object.values(a.a).filter(t=>t.infiltrationData);return{getPossibleLocations:()=>()=>e.map(t=>t+""),getInfiltration:e=>n=>{const f=e.helper.string("location",n);return((e,n)=>{if(!Object(l.a)(c.a,n))throw new Error(`Location '${n}' does not exists.`);const f=a.a[n];if(void 0===f)throw e.makeRuntimeErrorMsg(`Location '${f}' does not exists.`);if(void 0===f.infiltrationData)throw e.makeRuntimeErrorMsg(`Location '${f}' does not provide infiltrations.`);const u=f.infiltrationData.startingSecurityLevel,m=Object(r.a)(t,u),h=Object(r.b)(t,u),d=f.infiltrationData.maxClearanceLevel;return{location:f,reward:{tradeRep:Object(i.c)(t,h,d,m),sellCash:Object(i.b)(t,h,d,m),SoARep:Object(i.a)(t,s.a[o.a.ShadowsOfAnarchy],m)},difficulty:m}})(e,f)}}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(6),r=n(170),i=n(337),o=n(401),s=n(10),l=n(254),c=n(84);function f(){return{getTheme:()=>()=>({...a.a.theme}),getStyles:()=>()=>({...a.a.styles}),setTheme:t=>e=>{const n=/^(#)((?:[A-Fa-f0-9]{2}){3,4}|(?:[A-Fa-f0-9]{3}))$/,i={...a.a.theme},o=[];for(const t of Object.keys(e)){var s;i[t]?n.test(null!==(s=e[t])&&void 0!==s?s:"")?i[t]=e[t]:o.push(`Invalid color "${t}": ${e[t]}`):o.push(`Invalid key "${t}"`)}0===o.length?(Object.assign(a.a.theme,i),r.b.emit(),t.log(()=>"Successfully set theme")):t.log(()=>"Failed to set theme. Errors: "+o.join(", "))},setStyles:t=>e=>{const n={...a.a.styles},i=[];for(const t of Object.keys(e))n[t]?n[t]=e[t]:i.push(`Invalid key "${t}"`);0===i.length?(Object.assign(a.a.styles,n),r.b.emit(),t.log(()=>"Successfully set styles")):t.log(()=>"Failed to set styles. Errors: "+i.join(", "))},resetTheme:t=>()=>{a.a.theme={...i.a},r.b.emit(),t.log(()=>"Reinitialized theme to default")},resetStyles:t=>()=>{a.a.styles={...o.a},r.b.emit(),t.log(()=>"Reinitialized styles to default")},getGameInfo:()=>()=>({version:s.a.VersionString,commit:Object(l.a)(),platform:navigator.userAgent.toLowerCase().indexOf(" electron/")>-1?"Steam":"Browser"}),clearTerminal:t=>()=>{t.log(()=>"Clearing terminal"),c.a.clear()}}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(210),r=n(18);function i(t,e){const n=function(e,n=!1){const r=t.bladeburner;if(null===r)throw new Error("Must have joined bladeburner");if(!(7===t.bitNodeN||t.sourceFiles.some(t=>7===t.n))){const t="You do not currently have access to the Bladeburner API. You must either be in BitNode-7 or have Source-File 7.";throw e.makeRuntimeErrorMsg(t)}if(!n){if(!(r instanceof a.a)){const t="You must be a member of the Bladeburner division to use this API.";throw e.makeRuntimeErrorMsg(t)}}},i=function(e,n){const a=t.bladeburner;if(null===a)throw new Error("Must have joined bladeburner");if(!a.cities.hasOwnProperty(n))throw e.makeRuntimeErrorMsg("Invalid city: "+n)},o=function(e,n,a){const r=t.bladeburner;if(null===r)throw new Error("Must have joined bladeburner");const i=r.getActionIdFromTypeAndName(n,a);if(!i)throw e.makeRuntimeErrorMsg(`Invalid action type='${n}', name='${a}'`);const o=r.getActionObject(i);if(!o)throw e.makeRuntimeErrorMsg(`Invalid action type='${n}', name='${a}'`);return o};return{getContractNames:e=>()=>{n(e);const a=t.bladeburner;if(null===a)throw new Error("Should not be called without Bladeburner");return a.getContractNamesNetscriptFn()},getOperationNames:e=>()=>{n(e);const a=t.bladeburner;if(null===a)throw new Error("Should not be called without Bladeburner");return a.getOperationNamesNetscriptFn()},getBlackOpNames:e=>()=>{n(e);const a=t.bladeburner;if(null===a)throw new Error("Should not be called without Bladeburner");return a.getBlackOpNamesNetscriptFn()},getBlackOpRank:t=>e=>{const a=t.helper.string("blackOpName",e);n(t);return o(t,"blackops",a).reqdRank},getGeneralActionNames:e=>()=>{n(e);const a=t.bladeburner;if(null===a)throw new Error("Should not be called without Bladeburner");return a.getGeneralActionNamesNetscriptFn()},getSkillNames:e=>()=>{n(e);const a=t.bladeburner;if(null===a)throw new Error("Should not be called without Bladeburner");return a.getSkillNamesNetscriptFn()},startAction:a=>(r,i)=>{const o=a.helper.string("type",r),s=a.helper.string("name",i);n(a);const l=t.bladeburner;if(null===l)throw new Error("Should not be called without Bladeburner");try{return l.startActionNetscriptFn(t,o,s,e)}catch(t){throw a.makeRuntimeErrorMsg(t)}},stopBladeburnerAction:e=>()=>{n(e);const a=t.bladeburner;if(null===a)throw new Error("Should not be called without Bladeburner");return a.resetAction()},getCurrentAction:e=>()=>{n(e);const a=t.bladeburner;if(null===a)throw new Error("Should not be called without Bladeburner");return a.getTypeAndNameFromActionId(a.action)},getActionTime:e=>(a,r)=>{const i=e.helper.string("type",a),o=e.helper.string("name",r);n(e);const s=t.bladeburner;if(null===s)throw new Error("Should not be called without Bladeburner");try{const n=s.getActionTimeNetscriptFn(t,i,o);if("string"==typeof n){const t=`Invalid action: type='${i}' name='${o}'`;return e.log(()=>t),-1}return n}catch(t){throw e.makeRuntimeErrorMsg(t)}},getActionCurrentTime:e=>()=>{n(e);const a=t.bladeburner;if(null===a)throw new Error("Should not be called without Bladeburner");try{return 1e3*Math.min(a.actionTimeCurrent+a.actionTimeOverflow,a.actionTimeToComplete)}catch(t){throw e.makeRuntimeErrorMsg(t)}},getActionEstimatedSuccessChance:e=>(a,r)=>{const i=e.helper.string("type",a),o=e.helper.string("name",r);n(e);const s=t.bladeburner;if(null===s)throw new Error("Should not be called without Bladeburner");try{const n=s.getActionEstimatedSuccessChanceNetscriptFn(t,i,o);if("string"==typeof n){const t=`Invalid action: type='${i}' name='${o}'`;return e.log(()=>t),[-1,-1]}return n}catch(t){throw e.makeRuntimeErrorMsg(t)}},getActionRepGain:t=>(e,a,i)=>{const s=t.helper.string("type",e),l=t.helper.string("name",a),c=t.helper.number("level",i);n(t);const f=o(t,s,l);let u;return u=null==c||isNaN(c)?Math.pow(f.rewardFac,f.level-1):Math.pow(f.rewardFac,c-1),f.rankGain*u*r.a.BladeburnerRank},getActionCountRemaining:a=>(r,i)=>{const o=a.helper.string("type",r),s=a.helper.string("name",i);n(a);const l=t.bladeburner;if(null===l)throw new Error("Should not be called without Bladeburner");try{return l.getActionCountRemainingNetscriptFn(o,s,e)}catch(t){throw a.makeRuntimeErrorMsg(t)}},getActionMaxLevel:t=>(e,a)=>{const r=t.helper.string("type",e),i=t.helper.string("name",a);n(t);return o(t,r,i).maxLevel},getActionCurrentLevel:t=>(e,a)=>{const r=t.helper.string("type",e),i=t.helper.string("name",a);n(t);return o(t,r,i).level},getActionAutolevel:t=>(e,a)=>{const r=t.helper.string("type",e),i=t.helper.string("name",a);n(t);return o(t,r,i).autoLevel},setActionAutolevel:t=>(e,a,r=!0)=>{const i=t.helper.string("type",e),s=t.helper.string("name",a),l=t.helper.boolean(r);n(t);o(t,i,s).autoLevel=l},setActionLevel:t=>(e,a,r=1)=>{const i=t.helper.string("type",e),s=t.helper.string("name",a),l=t.helper.number("level",r);n(t);const c=o(t,i,s);(l<1||l>c.maxLevel)&&t.helper.makeRuntimeErrorMsg(`Level must be between 1 and ${c.maxLevel}, is ${l}`),c.level=l},getRank:e=>()=>{n(e);const a=t.bladeburner;if(null===a)throw new Error("Should not be called without Bladeburner");return a.rank},getSkillPoints:e=>()=>{n(e);const a=t.bladeburner;if(null===a)throw new Error("Should not be called without Bladeburner");return a.skillPoints},getSkillLevel:a=>r=>{const i=a.helper.string("skillName",r);n(a);const o=t.bladeburner;if(null===o)throw new Error("Should not be called without Bladeburner");try{return o.getSkillLevelNetscriptFn(i,e)}catch(t){throw a.makeRuntimeErrorMsg(t)}},getSkillUpgradeCost:a=>r=>{const i=a.helper.string("skillName",r);n(a);const o=t.bladeburner;if(null===o)throw new Error("Should not be called without Bladeburner");try{return o.getSkillUpgradeCostNetscriptFn(i,e)}catch(t){throw a.makeRuntimeErrorMsg(t)}},upgradeSkill:a=>r=>{const i=a.helper.string("skillName",r);n(a);const o=t.bladeburner;if(null===o)throw new Error("Should not be called without Bladeburner");try{return o.upgradeSkillNetscriptFn(i,e)}catch(t){throw a.makeRuntimeErrorMsg(t)}},getTeamSize:a=>(r,i)=>{const o=a.helper.string("type",r),s=a.helper.string("name",i);n(a);const l=t.bladeburner;if(null===l)throw new Error("Should not be called without Bladeburner");try{return l.getTeamSizeNetscriptFn(o,s,e)}catch(t){throw a.makeRuntimeErrorMsg(t)}},setTeamSize:a=>(r,i,o)=>{const s=a.helper.string("type",r),l=a.helper.string("name",i),c=a.helper.number("size",o);n(a);const f=t.bladeburner;if(null===f)throw new Error("Should not be called without Bladeburner");try{return f.setTeamSizeNetscriptFn(s,l,c,e)}catch(t){throw a.makeRuntimeErrorMsg(t)}},getCityEstimatedPopulation:e=>a=>{const r=e.helper.string("cityName",a);n(e),i(e,r);const o=t.bladeburner;if(null===o)throw new Error("Should not be called without Bladeburner");return o.cities[r].popEst},getCityCommunities:e=>a=>{const r=e.helper.string("cityName",a);n(e),i(e,r);const o=t.bladeburner;if(null===o)throw new Error("Should not be called without Bladeburner");return o.cities[r].comms},getCityChaos:e=>a=>{const r=e.helper.string("cityName",a);n(e),i(e,r);const o=t.bladeburner;if(null===o)throw new Error("Should not be called without Bladeburner");return o.cities[r].chaos},getCity:e=>()=>{n(e);const a=t.bladeburner;if(null===a)throw new Error("Should not be called without Bladeburner");return a.city},switchCity:e=>a=>{const r=e.helper.string("cityName",a);n(e),i(e,r);const o=t.bladeburner;if(null===o)throw new Error("Should not be called without Bladeburner");return o.city=r,!0},getStamina:e=>()=>{n(e);const a=t.bladeburner;if(null===a)throw new Error("Should not be called without Bladeburner");return[a.stamina,a.maxStamina]},joinBladeburnerFaction:a=>()=>{n(a,!0);const r=t.bladeburner;if(null===r)throw new Error("Should not be called without Bladeburner");return r.joinBladeburnerFactionNetscriptFn(e)},joinBladeburnerDivision:e=>()=>(7===t.bitNodeN||t.sourceFileLvl(7)>0)&&(8!==t.bitNodeN&&(t.bladeburner instanceof a.a||(t.strength>=100&&t.defense>=100&&t.dexterity>=100&&t.agility>=100?(t.bladeburner=new a.a(t),e.log(()=>"You have been accepted into the Bladeburner division"),!0):(e.log(()=>"You do not meet the requirements for joining the Bladeburner division"),!1)))),getBonusTime:e=>()=>{n(e);const a=t.bladeburner;if(null===a)throw new Error("Should not be called without Bladeburner");return 1e3*Math.round(a.storedCycles/5)}}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(1047);function r(t,e){const n=function(t,e,n,a){const r=t.helper.getServer(n).getContract(a);if(null==r)throw t.makeRuntimeErrorMsg(`Cannot find contract '${a}' on server '${n}'`);return r};return{attempt:r=>(i,o,s=e.hostname,{returnReward:l}={returnReward:!1})=>{const c=r.helper.string("filename",o),f=r.helper.string("hostname",s),u=n(r,0,f,c);if(Object(a.a)(i)){const t=[];for(let e=0;e`Successfully completed Coding Contract '${c}'. Reward: ${e}`),h.removeContract(c),!l||e}return++u.tries,u.tries>=u.getMaxNumTries()?(r.log(()=>`Coding Contract attempt '${c}' failed. Contract is now self-destructing`),h.removeContract(c)):r.log(()=>`Coding Contract attempt '${c}' failed. ${u.getMaxNumTries()-u.tries} attempts remaining.`),!!l&&""},getContractType:t=>(a,r=e.hostname)=>{const i=t.helper.string("filename",a),o=t.helper.string("hostname",r);return n(t,0,o,i).getType()},getData:t=>(a,r=e.hostname)=>{const i=t.helper.string("filename",a),o=t.helper.string("hostname",r),s=n(t,0,o,i).getData();if(s.constructor===Array){const t=s.slice();for(let e=0;e(a,r=e.hostname)=>{const i=t.helper.string("filename",a),o=t.helper.string("hostname",r);return n(t,0,o,i).getDescription()},getNumTriesRemaining:t=>(a,r=e.hostname)=>{const i=t.helper.string("filename",a),o=t.helper.string("hostname",r),s=n(t,0,o,i);return s.getMaxNumTries()-s.tries}}}},function(t,e,n){"use strict";function a(t){return Array.isArray(t)}function r(t){return a(t)&&t.every(t=>a(t))}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var a=n(110),r=n(62),i=n(268),o=n(381),s=n(47),l=n(284),c=n(51),f=n(40),u=n(322),m=n(285),h=n(26),d=n(18);function p(t,e){function n(t){const e=g(),n=Object.values(i.b).find(e=>e.name===t);if(void 0===n)throw new Error(`No upgrade named '${t}'`);const a=n.index;return 1===e.unlockUpgrades[a]}function p(t,e){return void 0!==t.researched[e]&&t.researched[e]}function g(){const e=t.corporation;if(null===e)throw new Error("cannot be called without a corporation");return e}function y(t){const e=g().divisions.find(e=>e.name===t);if(void 0===e)throw new Error(`No division named '${t}'`);return e}function b(t,e){const n=y(t);if(!(e in n.offices))throw new Error(`Invalid city name '${e}'`);const a=n.offices[e];if(0===a)throw new Error(`${n.name} has not expanded to '${e}'`);return a}function E(t,e){const n=y(t);if(!(e in n.warehouses))throw new Error(`Invalid city name '${e}'`);const a=n.warehouses[e];if(0===a)throw new Error(`${n.name} has not expanded to '${e}'`);return a}function v(t,e,n){const a=E(t,e),r=n.replace(/ /g,""),i=a.materials[r];if(void 0===i)throw new Error(`Invalid material name: '${n}'`);return i}function k(t,e){const n=y(t).products[e];if(void 0===n)throw new Error(`Invalid product name: '${e}'`);return n}function _(t,e,n){const a=b(t,e).employees.find(t=>t.name===n);if(void 0===a)throw new Error(`Invalid employee name: '${n}'`);return a}function w(e,n){if(null===t.corporation)throw e.makeRuntimeErrorMsg("Must own a corporation.");if(n&&!t.corporation.unlockUpgrades[n])throw e.makeRuntimeErrorMsg("You do not have access to this API.")}function S(t){const e=[];for(const n of Object.values(t.offices))0!==n&&e.push(n.loc);return{name:t.name,type:t.type,awareness:t.awareness,popularity:t.popularity,prodMult:t.prodMult,research:t.sciResearch.qty,lastCycleRevenue:t.lastCycleRevenue,lastCycleExpenses:t.lastCycleExpenses,thisCycleRevenue:t.thisCycleRevenue,thisCycleExpenses:t.thisCycleExpenses,upgrades:t.upgrades.slice(),cities:e,products:void 0===t.products?[]:Object.keys(t.products),makesProducts:t.makesProducts}}return{...{getPurchaseWarehouseCost:t=>()=>(w(t,7),f.a.WarehouseInitialCost),getUpgradeWarehouseCost:t=>(e,n,a=1)=>{w(t,7);const i=t.helper.string("divisionName",e),o=t.helper.city("cityName",n),s=t.helper.number("amount",a);if(s<1)throw t.makeRuntimeErrorMsg("You must provide a positive number");const l=E(i,o);return Object(r.E)(l,s)},hasWarehouse:t=>(e,n)=>{w(t,7);const a=t.helper.string("divisionName",e),r=t.helper.city("cityName",n),i=y(a);if(!(r in i.warehouses))throw new Error(`Invalid city name '${r}'`);return 0!==i.warehouses[r]},getWarehouse:t=>(e,n)=>{w(t,7);const a=E(t.helper.string("divisionName",e),t.helper.city("cityName",n));return{level:a.level,loc:a.loc,size:a.size,sizeUsed:a.sizeUsed,smartSupplyEnabled:a.smartSupplyEnabled}},getMaterial:t=>(e,n,a)=>{w(t,7);const r=v(t.helper.string("divisionName",e),t.helper.city("cityName",n),t.helper.string("materialName",a)),i=g();return{cost:r.bCost,sCost:r.sCost,name:r.name,qty:r.qty,qlt:r.qlt,dmd:i.unlockUpgrades[2]?r.dmd:void 0,cmp:i.unlockUpgrades[3]?r.cmp:void 0,prod:r.prd,sell:r.sll}},getProduct:t=>(e,n)=>{w(t,7);const a=k(t.helper.string("divisionName",e),t.helper.string("productName",n)),r=g();return{name:a.name,dmd:r.unlockUpgrades[2]?a.dmd:void 0,cmp:r.unlockUpgrades[3]?a.cmp:void 0,rat:a.rat,properties:{qlt:a.qlt,per:a.per,dur:a.dur,rel:a.rel,aes:a.aes,fea:a.fea},pCost:a.pCost,sCost:a.sCost,cityData:a.data,developmentProgress:a.prog}},purchaseWarehouse:t=>(e,n)=>{w(t,7);const a=t.helper.string("divisionName",e),i=t.helper.city("cityName",n),o=g();Object(r.p)(o,y(a),i)},upgradeWarehouse:t=>(e,n,a=1)=>{w(t,7);const i=t.helper.string("divisionName",e),o=t.helper.city("cityName",n),s=t.helper.number("amount",a),l=g();if(s<1)throw t.makeRuntimeErrorMsg("You must provide a positive number");Object(r.D)(l,y(i),E(i,o),s)},sellMaterial:t=>(e,n,a,i,o)=>{w(t,7);const s=t.helper.string("divisionName",e),l=t.helper.city("cityName",n),c=t.helper.string("materialName",a),f=t.helper.string("amt",i),u=t.helper.string("price",o),m=v(s,l,c);Object(r.r)(m,f,u)},sellProduct:t=>(e,n,a,i,o,s)=>{w(t,7);const l=t.helper.string("divisionName",e),c=t.helper.city("cityName",n),f=t.helper.string("productName",a),u=t.helper.string("amt",i),m=t.helper.string("price",o),h=t.helper.boolean(s),d=k(l,f);Object(r.s)(d,c,u,m,h)},discontinueProduct:t=>(e,n)=>{w(t,7);const a=t.helper.string("divisionName",e),r=t.helper.string("productName",n);y(a).discontinueProduct(k(a,r))},setSmartSupply:t=>(e,a,i)=>{w(t,7);const o=t.helper.string("divisionName",e),s=t.helper.city("cityName",a),l=t.helper.boolean(i),c=E(o,s);if(!n("Smart Supply"))throw t.makeRuntimeErrorMsg("You have not purchased the Smart Supply upgrade!");Object(r.y)(c,l)},setSmartSupplyUseLeftovers:t=>(e,a,i,o)=>{w(t,7);const s=t.helper.string("divisionName",e),l=t.helper.city("cityName",a),c=t.helper.string("materialName",i),f=t.helper.boolean(o),u=E(s,l),m=v(s,l,c);if(!n("Smart Supply"))throw t.makeRuntimeErrorMsg("You have not purchased the Smart Supply upgrade!");Object(r.z)(u,m,f)},buyMaterial:t=>(e,n,a,i)=>{w(t,7);const o=t.helper.string("divisionName",e),s=t.helper.city("cityName",n),l=t.helper.string("materialName",a),c=t.helper.number("amt",i);if(c<0)throw new Error("Invalid value for amount field! Must be numeric and greater than 0");const f=v(o,s,l);Object(r.e)(f,c)},bulkPurchase:t=>(e,n,a,i)=>{w(t,7);const o=t.helper.string("divisionName",e);if(!p(y(o),"Bulk Purchasing"))throw new Error("You have not researched Bulk Purchasing in "+o);const s=g(),l=t.helper.city("cityName",n),c=t.helper.string("materialName",a),f=t.helper.number("amt",i),u=E(o,l),m=v(o,l,c);Object(r.b)(s,u,m,f)},makeProduct:t=>(e,n,a,i,o)=>{w(t,7);const s=t.helper.string("divisionName",e),l=t.helper.city("cityName",n),c=t.helper.string("productName",a),f=t.helper.number("designInvest",i),u=t.helper.number("marketingInvest",o),m=g();Object(r.m)(m,y(s),l,c,f,u)},limitProductProduction:t=>(e,n,a,i)=>{w(t,7);const o=t.helper.string("divisionName",e),s=t.helper.city("cityName",a),l=t.helper.string("productName",n),c=t.helper.number("qty",i);Object(r.l)(k(o,l),s,c)},exportMaterial:t=>(e,n,a,i,o,s)=>{w(t,7);const l=t.helper.string("sourceDivision",e),c=t.helper.string("sourceCity",n),f=t.helper.string("targetDivision",a),u=t.helper.string("targetCity",i),m=t.helper.string("materialName",o),h=t.helper.string("amt",s);Object(r.g)(f,u,v(l,c,m),h+"",y(f))},cancelExportMaterial:t=>(e,n,a,i,o,s)=>{w(t,7);const l=t.helper.string("sourceDivision",e),c=t.helper.string("sourceCity",n),f=t.helper.string("targetDivision",a),u=t.helper.string("targetCity",i),m=t.helper.string("materialName",o),h=t.helper.string("amt",s);Object(r.f)(f,u,v(l,c,m),h+"")},limitMaterialProduction:t=>(e,n,a,i)=>{w(t,7);const o=t.helper.string("divisionName",e),s=t.helper.city("cityName",n),l=t.helper.string("materialName",a),c=t.helper.number("qty",i);Object(r.k)(v(o,s,l),c)},setMaterialMarketTA1:t=>(e,n,a,i)=>{w(t,7);const o=t.helper.string("divisionName",e),s=t.helper.city("cityName",n),l=t.helper.string("materialName",a),c=t.helper.boolean(i);if(!y(o).hasResearch("Market-TA.I"))throw t.makeRuntimeErrorMsg("You have not researched MarketTA.I for division: "+o);Object(r.u)(v(o,s,l),c)},setMaterialMarketTA2:t=>(e,n,a,i)=>{w(t,7);const o=t.helper.string("divisionName",e),s=t.helper.city("cityName",n),l=t.helper.string("materialName",a),c=t.helper.boolean(i);if(!y(o).hasResearch("Market-TA.II"))throw t.makeRuntimeErrorMsg("You have not researched MarketTA.II for division: "+o);Object(r.v)(v(o,s,l),c)},setProductMarketTA1:t=>(e,n,a)=>{w(t,7);const i=t.helper.string("divisionName",e),o=t.helper.string("productName",n),s=t.helper.boolean(a);if(!y(i).hasResearch("Market-TA.I"))throw t.makeRuntimeErrorMsg("You have not researched MarketTA.I for division: "+i);Object(r.w)(k(i,o),s)},setProductMarketTA2:t=>(e,n,a)=>{w(t,7);const i=t.helper.string("divisionName",e),o=t.helper.string("productName",n),s=t.helper.boolean(a);if(!y(i).hasResearch("Market-TA.II"))throw t.makeRuntimeErrorMsg("You have not researched MarketTA.II for division: "+i);Object(r.x)(k(i,o),s)}},...{getHireAdVertCost:t=>e=>{w(t,8);const n=y(t.helper.string("divisionName",e)),a=u.a[1];return a[1]*Math.pow(a[2],n.upgrades[1])},getHireAdVertCount:t=>e=>{w(t,8);return y(t.helper.string("divisionName",e)).upgrades[1]},getResearchCost:t=>(e,n)=>{w(t,8);const a=t.helper.string("divisionName",e),r=t.helper.string("researchName",n);return function(t,e){const n=c.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}'`);return m.a[e].cost}(y(a),r)},hasResearched:t=>(e,n)=>{w(t,8);const a=t.helper.string("divisionName",e),r=t.helper.string("researchName",n);return p(y(a),r)},setAutoJobAssignment:t=>(n,r,i,o)=>{w(t,8);const l=t.helper.string("divisionName",n),c=t.helper.city("cityName",r),f=t.helper.number("amount",o),u=t.helper.string("job",i),m=b(l,c);if(!Object.values(s.a).includes(u))throw new Error(`'${u}' is not a valid job.`);return Object(a.c)(1e3,e).then((function(){return Promise.resolve(m.setEmployeeToJob(u,f))}))},getOfficeSizeUpgradeCost:t=>(e,n,a)=>{w(t,8);const r=t.helper.string("divisionName",e),i=t.helper.city("cityName",n),o=t.helper.number("size",a);if(o<0)throw new Error("Invalid value for size field! Must be numeric and greater than 0");const s=b(r,i),l=Math.round(s.size/f.a.OfficeInitialSize);let c=0;for(let t=0;t(n,i,o,s)=>{w(t,8);const l=t.helper.string("divisionName",n),c=t.helper.city("cityName",i),f=t.helper.string("employeeName",o),u=t.helper.string("job",s),m=_(l,c,f);return Object(a.c)(["Training","Unassigned"].includes(m.pos)?0:1e3,e).then((function(){return Promise.resolve(Object(r.a)(m,u))}))},hireEmployee:t=>(e,n)=>{w(t,8);const a=b(t.helper.string("divisionName",e),t.helper.city("cityName",n)).hireRandomEmployee();if(void 0!==a)return{name:a.name,mor:a.mor,hap:a.hap,ene:a.ene,int:a.int,cha:a.cha,exp:a.exp,cre:a.cre,eff:a.eff,sal:a.sal,loc:a.loc,pos:a.pos}},upgradeOfficeSize:t=>(e,n,a)=>{w(t,8);const i=t.helper.string("divisionName",e),o=t.helper.city("cityName",n),s=t.helper.number("size",a);if(s<0)throw new Error("Invalid value for size field! Must be numeric and greater than 0");const l=b(i,o),c=g();Object(r.C)(c,l,s)},throwParty:n=>async(i,o,s)=>{w(n,8);const c=n.helper.string("divisionName",i),f=n.helper.city("cityName",o),u=n.helper.number("costPerEmployee",s);if(u<0)throw new Error("Invalid value for Cost Per Employee field! Must be numeric and greater than 0");const m=b(c,f),h=g();return Object(a.c)(6e4/(t.hacking_speed_mult*Object(l.a)(t.intelligence,1)),e).then((function(){return Promise.resolve(Object(r.A)(h,m,u))}))},buyCoffee:n=>async(i,o)=>{w(n,8);const s=n.helper.string("divisionName",i),c=n.helper.city("cityName",o),f=g();return Object(a.c)(6e4/(t.hacking_speed_mult*Object(l.a)(t.intelligence,1)),e).then((function(){return Promise.resolve(Object(r.d)(f,y(s),b(s,c)))}))},hireAdVert:t=>e=>{w(t,8);const n=t.helper.string("divisionName",e),a=g();Object(r.h)(a,y(n),b(n,"Sector-12"))},research:t=>(e,n)=>{w(t,8);const a=t.helper.string("divisionName",e),i=t.helper.string("researchName",n);Object(r.q)(y(a),i)},getOffice:t=>(e,n)=>{w(t,8);const a=b(t.helper.string("divisionName",e),t.helper.city("cityName",n));return{loc:a.loc,size:a.size,minEne:a.minEne,maxEne:a.maxEne,minHap:a.minHap,maxHap:a.maxHap,maxMor:a.maxMor,employees:a.employees.map(t=>t.name),employeeProd:{Operations:a.employeeProd[s.a.Operations],Engineer:a.employeeProd[s.a.Engineer],Business:a.employeeProd[s.a.Business],Management:a.employeeProd[s.a.Management],"Research & Development":a.employeeProd[s.a.RandD],Training:a.employeeProd[s.a.Training]},employeeJobs:{Operations:a.employeeJobs[s.a.Operations],Engineer:a.employeeJobs[s.a.Engineer],Business:a.employeeJobs[s.a.Business],Management:a.employeeJobs[s.a.Management],"Research & Development":a.employeeJobs[s.a.RandD],Training:a.employeeJobs[s.a.Training],Unassigned:a.employeeJobs[s.a.Unassigned]}}},getEmployee:t=>(e,n,a)=>{w(t,8);const r=_(t.helper.string("divisionName",e),t.helper.city("cityName",n),t.helper.string("employeeName",a));return{name:r.name,mor:r.mor,hap:r.hap,ene:r.ene,int:r.int,cha:r.cha,exp:r.exp,cre:r.cre,eff:r.eff,sal:r.sal,loc:r.loc,pos:r.pos}}},expandIndustry:t=>(e,n)=>{w(t);const a=t.helper.string("industryName",e),i=t.helper.string("divisionName",n),o=g();Object(r.o)(o,a,i)},expandCity:t=>(e,n)=>{w(t);const a=t.helper.string("divisionName",e),i=t.helper.city("cityName",n);if(!f.a.Cities.includes(i))throw new Error("Invalid city name");const o=g(),s=y(a);Object(r.n)(o,s,i)},unlockUpgrade:t=>e=>{w(t);const n=t.helper.string("upgradeName",e),a=g(),o=Object.values(i.b).find(t=>t.name===n);if(void 0===o)throw new Error(`No upgrade named '${n}'`);Object(r.B)(a,o)},levelUpgrade:t=>e=>{w(t);const n=t.helper.string("upgradeName",e),a=g(),i=Object.values(o.a).find(t=>t.name===n);if(void 0===i)throw new Error(`No upgrade named '${n}'`);Object(r.j)(a,i)},issueDividends:t=>e=>{w(t);const n=t.helper.number("percent",e);if(n<0||n>100)throw new Error("Invalid value for percent field! Must be numeric, greater than 0, and less than 100");const a=g();if(!a.public)throw t.makeRuntimeErrorMsg("Your company has not gone public!");Object(r.i)(a,n)},getDivision:t=>e=>{w(t);return S(y(t.helper.string("divisionName",e)))},getCorporation:t=>()=>{w(t);const e=g();return{name:e.name,funds:e.funds,revenue:e.revenue,expenses:e.expenses,public:e.public,totalShares:e.totalShares,numShares:e.numShares,shareSaleCooldown:e.shareSaleCooldown,issuedShares:e.issuedShares,sharePrice:e.sharePrice,state:e.state.getState(),divisions:e.divisions.map(t=>S(t))}},createCorporation:e=>(n,a=!0)=>function(e,n=!0){if(!t.canAccessCorporation()||t.hasCorporation())return!1;if(!e)return!1;if(3!==t.bitNodeN&&!n)throw new Error("cannot use seed funds outside of BitNode 3");if(d.a.CorporationSoftcap<.15)throw new Error("You cannot create a corporation in Bitnode "+t.bitNodeN);if(n){if(!t.canAfford(15e10))return!1;t.startCorporation(e),t.loseMoney(15e10,"corporation")}else t.startCorporation(e,5e8);return!0}(e.helper.string("corporationName",n),e.helper.boolean(a)),hasUnlockUpgrade:t=>e=>{w(t);return n(t.helper.string("upgradeName",e))},getUnlockUpgradeCost:t=>e=>{w(t);return function(t){const e=Object.values(i.b).find(e=>e.name===t);if(void 0===e)throw new Error(`No upgrade named '${t}'`);return e.price}(t.helper.string("upgradeName",e))},getUpgradeLevel:t=>e=>{w(t);const n=t.helper.string("upgradeName",e);return function(t,e){const n=t.helper.string("upgradeName",e),a=g(),r=Object.values(o.a).find(t=>t.name===n);if(void 0===r)throw new Error(`No upgrade named '${n}'`);const i=r.index;return a.upgrades[i]}(t,n)},getUpgradeLevelCost:t=>e=>{w(t);const n=t.helper.string("upgradeName",e);return function(t,e){const n=t.helper.string("upgradeName",e),a=g(),r=Object.values(o.a).find(t=>t.name===n);if(void 0===r)throw new Error(`No upgrade named '${n}'`);const i=r.index,s=r.basePrice,l=r.priceMult,c=a.upgrades[i];return s*Math.pow(l,c)}(t,n)},getExpandIndustryCost:t=>e=>{w(t);return function(t){const e=c.d[t];if(void 0===e)throw new Error(`Invalid industry: '${t}'`);return e}(t.helper.string("industryName",e))},getExpandCityCost:t=>()=>(w(t),f.a.OfficeInitialCost),getInvestmentOffer:t=>()=>(w(t),function(){const t=g();if(t.fundingRound>=f.a.FundingRoundShares.length||t.fundingRound>=f.a.FundingRoundMultiplier.length||t.public)return{funds:0,shares:0,round:t.fundingRound+1};const e=t.determineValuation(),n=f.a.FundingRoundShares[t.fundingRound];return{funds:e*n*f.a.FundingRoundMultiplier[t.fundingRound],shares:Math.floor(f.a.INITIALSHARES*n),round:t.fundingRound+1}}()),acceptInvestmentOffer:t=>()=>(w(t),function(){const t=g();if(t.fundingRound>=f.a.FundingRoundShares.length||t.fundingRound>=f.a.FundingRoundMultiplier.length||t.public)return!1;const e=t.determineValuation(),n=f.a.FundingRoundShares[t.fundingRound],a=e*n*f.a.FundingRoundMultiplier[t.fundingRound],r=Math.floor(f.a.INITIALSHARES*n);return t.fundingRound++,t.addFunds(a),t.numShares-=r,!0}()),goPublic:t=>e=>{w(t);return function(t){const e=g(),n=e.determineValuation()/e.totalShares;if(isNaN(t))throw new Error("Invalid value for number of issued shares");if(t<0)throw new Error("Invalid value for number of issued shares");if(t>e.numShares)throw new Error("You don't have that many shares to issue!");return e.public=!0,e.sharePrice=n,e.issuedShares=t,e.numShares-=t,e.addFunds(t*n),!0}(t.helper.number("numShares",e))},sellShares:e=>n=>{w(e);const a=e.helper.number("numShares",n);return Object(r.t)(g(),t,a)},buyBackShares:e=>n=>{w(e);const a=e.helper.number("numShares",n);return Object(r.c)(g(),t,a)},bribe:e=>(n,a,r)=>{w(e);return function(e,n,a){if(!t.factions.includes(e))throw new Error("Invalid faction name");if(isNaN(n)||n<0||isNaN(a)||a<0)throw new Error("Invalid value for amount field! Must be numeric, grater than 0.");const r=g();if(r.funds()=>(w(t),1e3*Math.round(g().storedCycles/5))}}},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return Industry}));var _utils_JSONReviver__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(28),_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(15),_IndustryData__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(51),_data_Constants__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(40),_EmployeePositions__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(47),_Material__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(202),_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(33),_utils_calculateEffectWithFactors__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(1050),_OfficeSpace__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(380),_Product__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(408),_ui_React_DialogBox__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(14),_utils_helpers_isString__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(146),_MaterialSizes__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(179),_Warehouse__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__(243),_IndustryUpgrades__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__(322);function _defineProperty(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class Industry{constructor(t={}){_defineProperty(this,"name",""),_defineProperty(this,"type",_IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.Agriculture),_defineProperty(this,"sciResearch",new _Material__WEBPACK_IMPORTED_MODULE_5__.a({name:"Scientific Research"})),_defineProperty(this,"researched",{}),_defineProperty(this,"reqMats",{}),_defineProperty(this,"prodMats",[]),_defineProperty(this,"products",{}),_defineProperty(this,"makesProducts",!1),_defineProperty(this,"awareness",0),_defineProperty(this,"popularity",0),_defineProperty(this,"startingCost",0),_defineProperty(this,"reFac",0),_defineProperty(this,"sciFac",0),_defineProperty(this,"hwFac",0),_defineProperty(this,"robFac",0),_defineProperty(this,"aiFac",0),_defineProperty(this,"advFac",0),_defineProperty(this,"prodMult",0),_defineProperty(this,"upgrades",Array(Object.keys(_IndustryUpgrades__WEBPACK_IMPORTED_MODULE_14__.a).length).fill(0)),_defineProperty(this,"state","START"),_defineProperty(this,"newInd",!0),_defineProperty(this,"offices",{[_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_1__.a.Aevum]:0,[_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_1__.a.Chongqing]:0,[_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_1__.a.Sector12]:new _OfficeSpace__WEBPACK_IMPORTED_MODULE_8__.a({loc:_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_1__.a.Sector12,size:_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.OfficeInitialSize}),[_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_1__.a.NewTokyo]:0,[_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_1__.a.Ishima]:0,[_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_1__.a.Volhaven]:0}),this.name=t.name?t.name:"",this.type=t.type?t.type:_IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.Agriculture,this.lastCycleRevenue=0,this.lastCycleExpenses=0,this.thisCycleRevenue=0,this.thisCycleExpenses=0,this.warehouses={[_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_1__.a.Aevum]:0,[_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_1__.a.Chongqing]:0,[_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_1__.a.Sector12]:new _Warehouse__WEBPACK_IMPORTED_MODULE_13__.a({corp:t.corp,industry:this,loc:_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_1__.a.Sector12,size:_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.WarehouseInitialSize}),[_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_1__.a.NewTokyo]:0,[_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_1__.a.Ishima]:0,[_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_1__.a.Volhaven]:0},this.init()}init(){const t=_IndustryData__WEBPACK_IMPORTED_MODULE_2__.d[this.type];if(void 0===t)throw new Error(`Invalid industry: "${this.type}"`);switch(this.startingCost=t,this.type){case _IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.Energy:this.reFac=.65,this.sciFac=.7,this.robFac=.05,this.aiFac=.3,this.advFac=.08,this.reqMats={Hardware:.1,Metal:.2},this.prodMats=["Energy"];break;case _IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.Utilities:case"Utilities":this.reFac=.5,this.sciFac=.6,this.robFac=.4,this.aiFac=.4,this.advFac=.08,this.reqMats={Hardware:.1,Metal:.1},this.prodMats=["Water"];break;case _IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.Agriculture:this.reFac=.72,this.sciFac=.5,this.hwFac=.2,this.robFac=.3,this.aiFac=.3,this.advFac=.04,this.reqMats={Water:.5,Energy:.5},this.prodMats=["Plants","Food"];break;case _IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.Fishing:this.reFac=.15,this.sciFac=.35,this.hwFac=.35,this.robFac=.5,this.aiFac=.2,this.advFac=.08,this.reqMats={Energy:.5},this.prodMats=["Food"];break;case _IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.Mining:this.reFac=.3,this.sciFac=.26,this.hwFac=.4,this.robFac=.45,this.aiFac=.45,this.advFac=.06,this.reqMats={Energy:.8},this.prodMats=["Metal"];break;case _IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.Food:this.sciFac=.12,this.hwFac=.15,this.robFac=.3,this.aiFac=.25,this.advFac=.25,this.reFac=.05,this.reqMats={Food:.5,Water:.5,Energy:.2},this.makesProducts=!0;break;case _IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.Tobacco:this.reFac=.15,this.sciFac=.75,this.hwFac=.15,this.robFac=.2,this.aiFac=.15,this.advFac=.2,this.reqMats={Plants:1,Water:.2},this.makesProducts=!0;break;case _IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.Chemical:this.reFac=.25,this.sciFac=.75,this.hwFac=.2,this.robFac=.25,this.aiFac=.2,this.advFac=.07,this.reqMats={Plants:1,Energy:.5,Water:.5},this.prodMats=["Chemicals"];break;case _IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.Pharmaceutical:this.reFac=.05,this.sciFac=.8,this.hwFac=.15,this.robFac=.25,this.aiFac=.2,this.advFac=.16,this.reqMats={Chemicals:2,Energy:1,Water:.5},this.prodMats=["Drugs"],this.makesProducts=!0;break;case _IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.Computer:case"Computer":this.reFac=.2,this.sciFac=.62,this.robFac=.36,this.aiFac=.19,this.advFac=.17,this.reqMats={Metal:2,Energy:1},this.prodMats=["Hardware"],this.makesProducts=!0;break;case _IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.Robotics:this.reFac=.32,this.sciFac=.65,this.aiFac=.36,this.advFac=.18,this.hwFac=.19,this.reqMats={Hardware:5,Energy:3},this.prodMats=["Robots"],this.makesProducts=!0;break;case _IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.Software:this.sciFac=.62,this.advFac=.16,this.hwFac=.25,this.reFac=.15,this.aiFac=.18,this.robFac=.05,this.reqMats={Hardware:.5,Energy:.5},this.prodMats=["AICores"],this.makesProducts=!0;break;case _IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.Healthcare:this.reFac=.1,this.sciFac=.75,this.advFac=.11,this.hwFac=.1,this.robFac=.1,this.aiFac=.1,this.reqMats={Robots:10,AICores:5,Energy:5,Water:5},this.makesProducts=!0;break;case _IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.RealEstate:this.robFac=.6,this.aiFac=.6,this.advFac=.25,this.sciFac=.05,this.hwFac=.05,this.reqMats={Metal:5,Energy:5,Water:2,Hardware:4},this.prodMats=["RealEstate"],this.makesProducts=!0;break;default:return void console.error("Invalid Industry Type passed into Industry.init(): "+this.type)}}getProductDescriptionText(){if(!this.makesProducts)return"";switch(this.type){case _IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.Food:return"create and manage restaurants";case _IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.Tobacco:return"create tobacco and tobacco-related products";case _IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.Pharmaceutical:return"develop new pharmaceutical drugs";case _IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.Computer:case"Computer":return"create new computer hardware and networking infrastructures";case _IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.Robotics:return"build specialized robots and robot-related products";case _IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.Software:return"develop computer software";case _IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.Healthcare:return"build and manage hospitals";case _IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.RealEstate:return"develop and manage real estate properties";default:return console.error("Invalid industry type in Industry.getProductDescriptionText"),""}}getMaximumNumberProducts(){if(!this.makesProducts)return 0;let t=0;return this.hasResearch("uPgrade: Capacity.I")&&++t,this.hasResearch("uPgrade: Capacity.II")&&++t,_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.BaseMaxProducts+t}hasMaximumNumberProducts(){return Object.keys(this.products).length>=this.getMaximumNumberProducts()}calculateProductionFactors(){let t=0;for(let e=0;e<_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.Cities.length;++e){const n=_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.Cities[e],a=this.warehouses[n];if(!(a instanceof _Warehouse__WEBPACK_IMPORTED_MODULE_13__.a))continue;const r=a.materials,i=Math.pow(.002*r.RealEstate.qty+1,this.reFac)*Math.pow(.002*r.Hardware.qty+1,this.hwFac)*Math.pow(.002*r.Robots.qty+1,this.robFac)*Math.pow(.002*r.AICores.qty+1,this.aiFac);t+=Math.pow(i,.73)}this.prodMult=t<1?1:t}updateWarehouseSizeUsed(t){t.updateMaterialSizeUsed();for(const e of Object.keys(this.products))if(this.products.hasOwnProperty(e)){const n=this.products[e];if(void 0===n)continue;t.sizeUsed+=n.data[t.loc][0]*n.siz}}process(t=1,e,n){if(this.state=e,"START"===e){(isNaN(this.thisCycleRevenue)||isNaN(this.thisCycleExpenses))&&(console.error("NaN in Corporation's computed revenue/expenses"),Object(_ui_React_DialogBox__WEBPACK_IMPORTED_MODULE_10__.a)("Something went wrong when compting Corporation's revenue/expenses. This is a bug. Please report to game developer"),this.thisCycleRevenue=0,this.thisCycleExpenses=0),this.lastCycleRevenue=this.thisCycleRevenue/(t*_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.SecsPerMarketCycle),this.lastCycleExpenses=this.thisCycleExpenses/(t*_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.SecsPerMarketCycle),this.thisCycleRevenue=0,this.thisCycleExpenses=0,this.lastCycleRevenue>0&&(this.newInd=!1);let e=0;for(const a of Object.keys(this.offices)){const r=this.offices[a];0!==r&&(r instanceof _OfficeSpace__WEBPACK_IMPORTED_MODULE_8__.a&&(e+=r.process(t,n,this)))}this.thisCycleExpenses=this.thisCycleExpenses+e,this.processMaterialMarket(),this.processProductMarket(t),this.popularity-=1e-4*t,this.popularity=Math.max(0,this.popularity);const a=n.getDreamSenseGain(),r=4*a;if(a>0){const e=this.awareness+r*t;this.awareness=Math.min(e,Number.MAX_VALUE);const n=this.popularity+a*t;this.popularity=Math.min(n,Number.MAX_VALUE)}return}let a=this.processMaterials(t,n);Array.isArray(a)&&(this.thisCycleRevenue=this.thisCycleRevenue+a[0],this.thisCycleExpenses=this.thisCycleExpenses+a[1]),a=this.processProducts(t,n),Array.isArray(a)&&(this.thisCycleRevenue=this.thisCycleRevenue+a[0],this.thisCycleExpenses=this.thisCycleExpenses+a[1])}processMaterialMarket(){const t=this.reqMats,e=this.prodMats;for(let n=0;n<_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.Cities.length;++n)if(this.warehouses[_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.Cities[n]]instanceof _Warehouse__WEBPACK_IMPORTED_MODULE_13__.a){const a=this.warehouses[_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.Cities[n]];if(0===a)continue;for(const e of Object.keys(t))t.hasOwnProperty(e)&&a.materials[e].processMarket();for(let t=0;t0&&(e.qty+=n,expenses+=n*e.bCost),this.updateWarehouseSizeUsed(warehouse))}const t={};for(const e of Object.keys(warehouse.materials)){if(!warehouse.materials.hasOwnProperty(e))continue;if(!warehouse.smartSupplyEnabled||!Object.keys(this.reqMats).includes(e))continue;const n=warehouse.materials[e],a=this.reqMats[e];if(void 0===a)throw new Error(`reqMat "${e}" is undefined`);n.buy=a*warehouse.smartSupplyStore;let r=n.buy*_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.SecsPerMarketCycle*marketCycles;const i=Math.floor((warehouse.size-warehouse.sizeUsed)/_MaterialSizes__WEBPACK_IMPORTED_MODULE_12__.a[e]);r=Math.min(r,i),r>0&&(t[e]=r)}let e=1e99;for(const n of Object.keys(t)){const a=t[n];if(void 0===a)throw new Error("Somehow smartbuy matname is undefined");const r=this.reqMats[n];if(void 0===r)throw new Error(`reqMat "${n}" is undefined`);const i=a/r;ia)for(const e of Object.keys(t)){const r=t[e];if(void 0===r)throw new Error("Somehow smartbuy matname is undefined");t[e]=Math.floor(r*a/n)}for(const e of Object.keys(t)){if(!warehouse.smartSupplyUseLeftovers[e])continue;const n=warehouse.materials[e],a=t[e];if(void 0===a)throw new Error("Somehow smartbuy matname is undefined");t[e]=Math.max(0,a-n.qty)}for(const e of Object.keys(t)){const n=warehouse.materials[e],a=t[e];if(void 0===a)throw new Error("Somehow smartbuy matname is undefined");n.qty+=a,expenses+=a*n.bCost}break}case"PRODUCTION":if(warehouse.smartSupplyStore=0,this.prodMats.length>0){const t=warehouse.materials[this.prodMats[0]],e=this.getOfficeProductivity(office)*this.prodMult*corporation.getProductionMultiplier()*this.getProductionMultiplier();let n;n=t.prdman[0]?Math.min(e,t.prdman[1]):e,n*=_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.SecsPerMarketCycle*marketCycles;let a=0;for(let t=0;t0){const t=Math.floor((warehouse.size-warehouse.sizeUsed)/a);n=Math.min(t,n)}n<0&&(n=0),warehouse.smartSupplyStore+=n/(_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.SecsPerMarketCycle*marketCycles);let r=1;for(const t of Object.keys(this.reqMats))if(this.reqMats.hasOwnProperty(t)){const e=this.reqMats[t];if(void 0===e)continue;const a=e*n;warehouse.materials[t].qty0&&n>0){for(const t of Object.keys(this.reqMats)){const e=this.reqMats[t];if(void 0===e)continue;const a=e*n*r;warehouse.materials[t].qty-=a,warehouse.materials[t].prd=0,warehouse.materials[t].prd-=a/(_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.SecsPerMarketCycle*marketCycles)}for(let t=0;tmat.bCost?sCost-mat.bCost>markupLimit&&(markup=Math.pow(markupLimit/(sCost-mat.bCost),2)):sCost=0?(mat.qty-=sellAmt,revenue+=sellAmt*sCost,mat.sll=sellAmt/(_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.SecsPerMarketCycle*marketCycles)):mat.sll=0}break;case"EXPORT":for(const matName of Object.keys(warehouse.materials))if(warehouse.materials.hasOwnProperty(matName)){const mat=warehouse.materials[matName];mat.totalExp=0;for(let expI=0;expI=n.size)return[0,0];{const t=Math.floor((n.size-n.sizeUsed)/_MaterialSizes__WEBPACK_IMPORTED_MODULE_12__.a[matName]);amt=Math.min(t,amt)}n.materials[matName].imp+=amt/(_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.SecsPerMarketCycle*marketCycles),n.materials[matName].qty+=amt,n.materials[matName].qlt=mat.qlt,mat.qty-=amt,mat.totalExp+=amt,e.updateWarehouseSizeUsed(n);break}}}mat.totalExp/=_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.SecsPerMarketCycle*marketCycles}break;case"START":break;default:console.error("Invalid state: "+this.state)}this.updateWarehouseSizeUsed(warehouse)}office instanceof _OfficeSpace__WEBPACK_IMPORTED_MODULE_8__.a&&(this.sciResearch.qty+=.004*Math.pow(office.employeeProd[_EmployeePositions__WEBPACK_IMPORTED_MODULE_4__.a.RandD],.5)*corporation.getScientificResearchMultiplier()*this.getScientificResearchMultiplier())}}return[revenue,expenses]}processProducts(t=1,e){let n=0;if("PRODUCTION"===this.state)for(const e of Object.keys(this.products)){const n=this.products[e];if(void 0!==n&&!n.fin){const e=n.createCity,a=this.offices[e];if(0===a)continue;const r=a.employeeProd[_EmployeePositions__WEBPACK_IMPORTED_MODULE_4__.a.Engineer],i=a.employeeProd[_EmployeePositions__WEBPACK_IMPORTED_MODULE_4__.a.Management],o=a.employeeProd[_EmployeePositions__WEBPACK_IMPORTED_MODULE_4__.a.Operations],s=r+i+o;if(s<=0)break;const l=1+i/(1.2*s),c=(Math.pow(r,.34)+Math.pow(o,.2))*l;n.createProduct(t,c),n.prog>=100&&n.finishProduct(a.employeeProd,this);break}}for(const a of Object.keys(this.products))if(this.products.hasOwnProperty(a)){const r=this.products[a];r instanceof _Product__WEBPACK_IMPORTED_MODULE_9__.a&&r.fin&&(n+=this.processProduct(t,r,e))}return[n,0]}processProduct(marketCycles=1,product,corporation){let totalProfit=0;for(let i=0;i<_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.Cities.length;++i){const city=_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.Cities[i],office=this.offices[city];if(0===office)continue;const warehouse=this.warehouses[city];if(warehouse instanceof _Warehouse__WEBPACK_IMPORTED_MODULE_13__.a)switch(this.state){case"PRODUCTION":{const t=this.getOfficeProductivity(office,{forProduct:!0})*corporation.getProductionMultiplier()*this.prodMult*this.getProductionMultiplier()*this.getProductProductionMultiplier();let e;e=product.prdman[city][0]?Math.min(t,product.prdman[city][1]):t,e*=_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.SecsPerMarketCycle*marketCycles;let n=product.siz;for(const t of Object.keys(product.reqMats))if(product.reqMats.hasOwnProperty(t)){const e=product.reqMats[t];n-=_MaterialSizes__WEBPACK_IMPORTED_MODULE_12__.a[t]*e}if(n>0){const t=Math.floor((warehouse.size-warehouse.sizeUsed)/n);e=Math.min(t,e)}warehouse.smartSupplyStore+=e/(_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.SecsPerMarketCycle*marketCycles);let a=1;for(const t of Object.keys(product.reqMats))if(product.reqMats.hasOwnProperty(t)){const n=product.reqMats[t]*e;warehouse.materials[t].qty0&&e>0){for(const t of Object.keys(product.reqMats))if(product.reqMats.hasOwnProperty(t)){const n=product.reqMats[t]*e*a;warehouse.materials[t].qty-=n,warehouse.materials[t].prd-=n/(_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.SecsPerMarketCycle*marketCycles)}product.data[city][0]+=e*a}product.data[city][1]=e*a/(_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.SecsPerMarketCycle*marketCycles);break}case"SALE":{product.pCost=0;for(const t of Object.keys(product.reqMats))product.reqMats.hasOwnProperty(t)&&(product.pCost+=product.reqMats[t]*warehouse.materials[t].bCost);product.pCost*=_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.ProductProductionCostRatio;const businessFactor=this.getBusinessFactor(office),advertisingFactor=this.getAdvertisingFactors()[0],marketFactor=this.getMarketFactor(product),markupLimit=product.rat/product.mku;let sCost;if(product.marketTa2){const t=product.data[city][1],e=markupLimit,n=t,a=.5*Math.pow(product.rat,.65)*marketFactor*corporation.getSalesMultiplier()*businessFactor*advertisingFactor*this.getSalesMultiplier(),r=Math.sqrt(n/a);let i;0===a||0===r?0===n?i=0:(i=product.pCost+markupLimit,console.warn("In Corporation, found illegal 0s when trying to calculate MarketTA2 sale cost")):i=e/r+product.pCost,product.marketTa2Price[city]=i,sCost=i}else if(product.marketTa1)sCost=product.pCost+markupLimit;else if(Object(_utils_helpers_isString__WEBPACK_IMPORTED_MODULE_11__.a)(product.sCost)){const sCostString=product.sCost;0===product.mku&&(console.error("mku is zero, reverting to 1 to avoid Infinity"),product.mku=1),sCost=sCostString.replace(/MP/g,product.pCost+product.rat/product.mku+""),sCost=eval(sCost)}else sCost=product.sCost;let markup=1,sellAmt;if(sCost>product.pCost&&sCost-product.pCost>markupLimit&&(markup=markupLimit/(sCost-product.pCost)),product.maxsll=.5*Math.pow(product.rat,.65)*marketFactor*corporation.getSalesMultiplier()*Math.pow(markup,2)*businessFactor*advertisingFactor*this.getSalesMultiplier(),product.sllman[city][0]&&Object(_utils_helpers_isString__WEBPACK_IMPORTED_MODULE_11__.a)(product.sllman[city][1])){let tmp=product.sllman[city][1].replace(/MAX/g,(product.maxsll+"").toUpperCase());tmp=tmp.replace(/PROD/g,product.data[city][1]);try{tmp=eval(tmp)}catch(t){Object(_ui_React_DialogBox__WEBPACK_IMPORTED_MODULE_10__.a)("Error evaluating your sell price expression for "+product.name+" in "+this.name+"'s "+city+" office. Sell price is being set to MAX"),tmp=product.maxsll}sellAmt=Math.min(product.maxsll,tmp)}else sellAmt=product.sllman[city][0]&&product.sllman[city][1]>0?Math.min(product.maxsll,product.sllman[city][1]):!1===product.sllman[city][0]?0:product.maxsll;sellAmt<0&&(sellAmt=0),sellAmt=sellAmt*_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.SecsPerMarketCycle*marketCycles,sellAmt=Math.min(product.data[city][0],sellAmt),sellAmt&&sCost?(product.data[city][0]-=sellAmt,totalProfit+=sellAmt*sCost,product.data[city][2]=sellAmt/(_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.SecsPerMarketCycle*marketCycles)):product.data[city][2]=0;break}case"START":case"PURCHASE":case"EXPORT":break;default:console.error("Invalid State: "+this.state)}}return totalProfit}discontinueProduct(t){for(const e of Object.keys(this.products))this.products.hasOwnProperty(e)&&t===this.products[e]&&delete this.products[e]}upgrade(t,e){const n=e.corporation,a=e.office,r=t[0];for(;this.upgrades.length<=r;)this.upgrades.push(0);switch(++this.upgrades[r],r){case 0:for(let t=0;t=1)&&console.warn(`Exponential factor is ${e}. This is not an intended value for it`),n<1&&console.warn(`Linear factor is ${n}. This is not an intended value for it`),Math.pow(t,e)+t/n}n.d(e,"a",(function(){return a}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(40),r=n(33),i=n(28),o=n(47);class s{constructor(t={}){var e,n,i;e=this,n="cyclesUntilRaise",i=a.a.CyclesPerEmployeeRaise,n in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i,this.name=t.name?t.name:"Bobby",this.mor=t.morale?t.morale:Object(r.a)(50,100),this.hap=t.happiness?t.happiness:Object(r.a)(50,100),this.ene=t.energy?t.energy:Object(r.a)(50,100),this.int=t.intelligence?t.intelligence:Object(r.a)(10,50),this.cha=t.charisma?t.charisma:Object(r.a)(10,50),this.exp=t.experience?t.experience:Object(r.a)(10,50),this.cre=t.creativity?t.creativity:Object(r.a)(10,50),this.eff=t.efficiency?t.efficiency:Object(r.a)(10,50),this.sal=t.salary?t.salary:Object(r.a)(.1,5),this.loc=t.loc?t.loc:"",this.pos=o.a.Unassigned}process(t=1,e){const n=.003*t,r=n*Math.random();this.exp+=n;const i=n*Math.random();this.pos===o.a.Training&&(this.cha+=i,this.exp+=i,this.eff+=i),this.ene-=r,this.hap-=r,this.enee=>{const a=t.helper.number("favor",e);return n(t),Object(u.a)(a)},calculateRepToFavor:t=>e=>{const a=t.helper.number("rep",e);return n(t),Object(u.b)(a)},repFromDonation:t=>(e,a)=>{const r=t.helper.number("amount",e);return n(t),Object(m.a)(r,a)}},skills:{calculateSkill:t=>(e,a=1)=>{const r=t.helper.number("exp",e),i=t.helper.number("mult",a);return n(t),Object(s.b)(r,i)},calculateExp:t=>(e,a=1)=>{const r=t.helper.number("skill",e),i=t.helper.number("mult",a);return n(t),Object(s.a)(r,i)}},hacking:{hackChance:t=>(e,a)=>(n(t),Object(l.b)(e,a)),hackExp:t=>(e,a)=>(n(t),Object(l.c)(e,a)),hackPercent:t=>(e,a)=>(n(t),Object(l.e)(e,a)),growPercent:t=>(e,r,i,o=1)=>{const s=t.helper.number("threads",r),l=t.helper.number("cores",o);return n(t),Object(a.a)(e,s,i,l)},hackTime:t=>(e,a)=>(n(t),1e3*Object(l.d)(e,a)),growTime:t=>(e,a)=>(n(t),1e3*Object(l.a)(e,a)),weakenTime:t=>(e,a)=>(n(t),1e3*Object(l.f)(e,a))},hacknetNodes:{moneyGainRate:t=>(e,a,i,o=1)=>{const s=t.helper.number("level",e),l=t.helper.number("ram",a),c=t.helper.number("cores",i),f=t.helper.number("mult",o);return n(t),Object(r.c)(s,l,c,f)},levelUpgradeCost:t=>(e,a=1,i=1)=>{const o=t.helper.number("startingLevel",e),s=t.helper.number("extraLevels",a),l=t.helper.number("costMult",i);return n(t),Object(r.b)(o,s,l)},ramUpgradeCost:t=>(e,a=1,i=1)=>{const o=t.helper.number("startingRam",e),s=t.helper.number("extraLevels",a),l=t.helper.number("costMult",i);return n(t),Object(r.e)(o,s,l)},coreUpgradeCost:t=>(e,a=1,i=1)=>{const o=t.helper.number("startingCore",e),s=t.helper.number("extraCores",a),l=t.helper.number("costMult",i);return n(t),Object(r.a)(o,s,l)},hacknetNodeCost:t=>(e,a)=>{const i=t.helper.number("n",e),o=t.helper.number("mult",a);return n(t),Object(r.d)(i,o)},constants:t=>()=>(n(t),Object.assign({},o.a))},hacknetServers:{hashGainRate:t=>(e,a,r,o,s=1)=>{const l=t.helper.number("level",e),c=t.helper.number("ramUsed",a),f=t.helper.number("maxRam",r),u=t.helper.number("cores",o),m=t.helper.number("mult",s);return n(t),Object(i.c)(l,c,f,u,m)},levelUpgradeCost:t=>(e,a=1,r=1)=>{const o=t.helper.number("startingLevel",e),s=t.helper.number("extraLevels",a),l=t.helper.number("costMult",r);return n(t),Object(i.d)(o,s,l)},ramUpgradeCost:t=>(e,a=1,r=1)=>{const o=t.helper.number("startingRam",e),s=t.helper.number("extraLevels",a),l=t.helper.number("costMult",r);return n(t),Object(i.e)(o,s,l)},coreUpgradeCost:t=>(e,a=1,r=1)=>{const o=t.helper.number("startingCore",e),s=t.helper.number("extraCores",a),l=t.helper.number("costMult",r);return n(t),Object(i.b)(o,s,l)},cacheUpgradeCost:t=>(e,a=1)=>{const r=t.helper.number("startingCache",e),o=t.helper.number("extraCache",a);return n(t),Object(i.a)(r,o)},hashUpgradeCost:a=>(r,i)=>{const o=e.string("hashUpgradeCost","upgName",r),s=a.helper.number("level",i);n(a);const l=t.hashManager.getUpgrade(o);if(!l)throw e.makeRuntimeErrorMsg("formulas.hacknetServers.calculateHashUpgradeCost","Invalid Hash Upgrade: "+o);return l.getCost(s)},hacknetServerCost:t=>(e,a=1)=>{const r=t.helper.number("n",e),o=t.helper.number("mult",a);return n(t),Object(i.f)(r,o)},constants:t=>()=>(n(t),Object.assign({},o.b))},gang:{wantedPenalty:t=>e=>(n(t),Object(f.f)(e)),respectGain:t=>(e,a,r)=>(n(t),Object(f.d)(e,a,r)),wantedLevelGain:t=>(e,a,r)=>(n(t),Object(f.e)(e,a,r)),moneyGain:t=>(e,a,r)=>(n(t),Object(f.c)(e,a,r)),ascensionPointsGain:t=>e=>{const a=t.helper.number("exp",e);return n(t),Object(f.b)(a)},ascensionMultiplier:t=>e=>{const a=t.helper.number("points",e);return n(t),Object(f.a)(a)}}}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(245),r=n(103),i=n(228),o=n(117),s=n(75),l=n(99),c=n(231);function f(t,e){const n=function(e){if(!t.hasWseAccount)throw e.makeRuntimeErrorMsg(`You don't have WSE Access! Cannot use ${e.function}()`);if(!t.hasTixApiAccess)throw e.makeRuntimeErrorMsg(`You don't have TIX API Access! Cannot use ${e.function}()`)},f=function(t,e){const n=r.b[e];if(null==n)throw t.makeRuntimeErrorMsg(`Invalid stock symbol: '${e}'`);return n};return{getSymbols:t=>()=>(n(t),Object.values(l.a)),getPrice:t=>e=>{const a=t.helper.string("symbol",e);n(t);return f(t,a).price},getAskPrice:t=>e=>{const a=t.helper.string("symbol",e);n(t);return f(t,a).getAskPrice()},getBidPrice:t=>e=>{const a=t.helper.string("symbol",e);n(t);return f(t,a).getBidPrice()},getPosition:t=>e=>{const a=t.helper.string("symbol",e);n(t);const i=r.b[a];if(null==i)throw t.makeRuntimeErrorMsg("Invalid stock symbol: "+a);return[i.playerShares,i.playerAvgPx,i.playerShortShares,i.playerAvgShortPx]},getMaxShares:t=>e=>{const a=t.helper.string("symbol",e);n(t);return f(t,a).maxShares},getPurchaseCost:t=>(e,a,r)=>{const o=t.helper.string("symbol",e);let l=t.helper.number("shares",a);const c=t.helper.string("posType",r);n(t);const u=f(t,o);let m;l=Math.round(l);const h=c.toLowerCase();if(h.includes("l"))m=s.a.Long;else{if(!h.includes("s"))return 1/0;m=s.a.Short}const d=Object(i.b)(u,l,m);return null==d?1/0:d},getSaleGain:t=>(e,a,r)=>{const o=t.helper.string("symbol",e);let l=t.helper.number("shares",a);const c=t.helper.string("posType",r);n(t);const u=f(t,o);let m;l=Math.round(l);const h=c.toLowerCase();if(h.includes("l"))m=s.a.Long;else{if(!h.includes("s"))return 0;m=s.a.Short}const d=Object(i.c)(u,l,m);return null==d?0:d},buy:t=>(r,i)=>{const o=t.helper.string("symbol",r),s=t.helper.number("shares",i);n(t);const l=f(t,o);return Object(a.a)(l,s,e,{})?l.getAskPrice():0},sell:t=>(r,i)=>{const o=t.helper.string("symbol",r),s=t.helper.number("shares",i);n(t);const l=f(t,o);return Object(a.c)(l,s,e,{})?l.getBidPrice():0},short:r=>(i,o)=>{const s=r.helper.string("symbol",i),l=r.helper.number("shares",o);if(n(r),8!==t.bitNodeN&&t.sourceFileLvl(8)<=1)throw r.makeRuntimeErrorMsg("You must either be in BitNode-8 or you must have Source-File 8 Level 2.");const c=f(r,s);return Object(a.d)(c,l,e,{})?c.getBidPrice():0},sellShort:r=>(i,o)=>{const s=r.helper.string("symbol",i),l=r.helper.number("shares",o);if(n(r),8!==t.bitNodeN&&t.sourceFileLvl(8)<=1)throw r.makeRuntimeErrorMsg("You must either be in BitNode-8 or you must have Source-File 8 Level 2.");const c=f(r,s);return Object(a.b)(c,l,e,{})?c.getAskPrice():0},placeOrder:a=>(i,l,c,u,m)=>{const h=a.helper.string("symbol",i),d=a.helper.number("shares",l),p=a.helper.number("price",c),g=a.helper.string("type",u),y=a.helper.string("pos",m);if(n(a),8!==t.bitNodeN&&t.sourceFileLvl(8)<=2)throw a.makeRuntimeErrorMsg("You must either be in BitNode-8 or you must have Source-File 8 Level 3.");const b=f(a,h);let E,v;const k=g.toLowerCase();if(k.includes("limit")&&k.includes("buy"))E=o.a.LimitBuy;else if(k.includes("limit")&&k.includes("sell"))E=o.a.LimitSell;else if(k.includes("stop")&&k.includes("buy"))E=o.a.StopBuy;else{if(!k.includes("stop")||!k.includes("sell"))throw a.makeRuntimeErrorMsg("Invalid order type: "+g);E=o.a.StopSell}const _=y.toLowerCase();if(_.includes("l"))v=s.a.Long;else{if(!_.includes("s"))throw a.makeRuntimeErrorMsg("Invalid position type: "+y);v=s.a.Short}return Object(r.j)(b,d,p,E,v,e)},cancelOrder:a=>(i,l,c,u,m)=>{const h=a.helper.string("symbol",i),d=a.helper.number("shares",l),p=a.helper.number("price",c),g=a.helper.string("type",u),y=a.helper.string("pos",m);if(n(a),8!==t.bitNodeN&&t.sourceFileLvl(8)<=2)throw a.makeRuntimeErrorMsg("You must either be in BitNode-8 or you must have Source-File 8 Level 3.");const b=f(a,h);if(isNaN(d)||isNaN(p))throw a.makeRuntimeErrorMsg(`Invalid shares or price. Must be numeric. shares=${d}, price=${p}`);let E,v;const k=g.toLowerCase();if(k.includes("limit")&&k.includes("buy"))E=o.a.LimitBuy;else if(k.includes("limit")&&k.includes("sell"))E=o.a.LimitSell;else if(k.includes("stop")&&k.includes("buy"))E=o.a.StopBuy;else{if(!k.includes("stop")||!k.includes("sell"))throw a.makeRuntimeErrorMsg("Invalid order type: "+g);E=o.a.StopSell}const _=y.toLowerCase();if(_.includes("l"))v=s.a.Long;else{if(!_.includes("s"))throw a.makeRuntimeErrorMsg("Invalid position type: "+y);v=s.a.Short}const w={stock:b,shares:d,price:p,type:E,pos:v};return Object(r.c)(w,e)},getOrders:e=>()=>{if(n(e),8!==t.bitNodeN&&t.sourceFileLvl(8)<=2)throw e.makeRuntimeErrorMsg("You must either be in BitNode-8 or have Source-File 8 Level 3.");const a={},i=r.a.Orders;for(const t of Object.keys(i)){const e=i[t];if(e.constructor===Array&&e.length>0){a[t]=[];for(let n=0;nn=>{const a=e.helper.string("symbol",n);if(!t.has4SDataTixApi)throw e.makeRuntimeErrorMsg("You don't have 4S Market Data TIX API Access!");return f(e,a).mv/100},getForecast:e=>n=>{const a=e.helper.string("symbol",n);if(!t.has4SDataTixApi)throw e.makeRuntimeErrorMsg("You don't have 4S Market Data TIX API Access!");const r=f(e,a);let i=50;return r.b?i+=r.otlkMag:i-=r.otlkMag,i/100},purchase4SMarketData:e=>()=>t.has4SData?(e.log(()=>"Already purchased 4S Market Data."),!0):t.money"Not enough money to purchase 4S Market Data."),!1):(t.has4SData=!0,t.loseMoney(Object(c.a)(),"stock"),e.log(()=>"Purchased 4S Market Data"),!0),purchase4SMarketDataTixApi:e=>()=>(n(e),t.has4SDataTixApi?(e.log(()=>"Already purchased 4S Market Data TIX API"),!0):t.money"Not enough money to purchase 4S Market Data TIX API"),!1):(t.has4SDataTixApi=!0,t.loseMoney(Object(c.b)(),"stock"),e.log(()=>"Purchased 4S Market Data TIX API"),!0)),purchaseWseAccount:e=>()=>t.hasWseAccount?(e.log(()=>"Already purchased WSE Account"),!0):t.money"Not enough money to purchase WSE Account Access"),!1):(t.hasWseAccount=!0,Object(r.g)(),t.loseMoney(Object(c.d)(),"stock"),e.log(()=>"Purchased WSE Account Access"),!0),purchaseTixApi:e=>()=>t.hasTixApiAccess?(e.log(()=>"Already purchased TIX API"),!0):t.money"Not enough money to purchase TIX API Access"),!1):(t.hasTixApiAccess=!0,t.loseMoney(Object(c.c)(),"stock"),e.log(()=>"Purchased TIX API"),!0)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(79),r=n(105),i=n(15),o=n(483),s=n(269),l=n(90);function c(t){const e=e=>{if(!t.canAccessGrafting())throw e.makeRuntimeErrorMsg("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")};return{getAugmentationGraftPrice:n=>r=>{const i=n.helper.string("augName",r);if(e(n),!Object(s.b)(t).includes(i)||!a.a.hasOwnProperty(i))throw n.makeRuntimeErrorMsg("Invalid aug: "+i);return new o.a(a.a[i]).cost},getAugmentationGraftTime:n=>r=>{const i=n.helper.string("augName",r);if(e(n),!Object(s.b)(t).includes(i)||!a.a.hasOwnProperty(i))throw n.makeRuntimeErrorMsg("Invalid aug: "+i);const l=new o.a(a.a[i]);return Object(s.a)(t,l)},getGraftableAugmentations:n=>()=>{e(n);return Object(s.b)(t)},graftAugmentation:n=>(c,f=!0)=>{const u=n.helper.string("augName",c),m=n.helper.boolean(f);if(e(n),t.city!==i.a.NewTokyo)throw n.makeRuntimeErrorMsg("You must be in New Tokyo to begin grafting an Augmentation.");if(!Object(s.b)(t).includes(u)||!a.a.hasOwnProperty(u))return n.log(()=>"Invalid aug: "+u),!1;const h=t.focus;if(t.isWorking){const e=t.singularityStopWork();n.log(()=>e)}const d=new o.a(a.a[u]);return t.money"You don't have enough money to craft "+u),!1):Object(r.b)(d.augmentation)?(t.loseMoney(d.cost,"augmentations"),t.startGraftAugmentationWork(u,d.time),m?(t.startFocusing(),l.b.toWork()):h&&(t.stopFocusing(),l.b.toTerminal()),n.log(()=>`Began grafting Augmentation ${u}.`),!0):(n.log(()=>"You don't have the pre-requisites for "+u),!1)}}}},,,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(2),r=n(255),i=n(24);const o=[["getHackTime","returns milliseconds"],["getGrowTime","returns milliseconds"],["getWeakenTime","returns milliseconds"],["getActionTime","returns milliseconds"],["hackAnalyzePercent","renamed 'hackAnalyze' and returns decimal"],["hackChance","renamed 'hackAnalyzeChance'"],["basic.calculateSkill","renamed 'skills.calculateSkill'"],["basic.calculateExp","renamed 'skills.calculateExp'"],["basic.hackChance","renamed 'hacking.hackChance'"],["basic.hackExp","renamed 'hacking.hackExp'"],["basic.hackPercent","renamed 'hacking.hackPercent'"],["basic.growPercent","renamed 'hacking.growPercent'"],["basic.hackTime","renamed 'hacking.hackTime'"],["basic.growTime","renamed 'hacking.growTime'"],["basic.weakenTime","renamed 'hacking.weakenTime'"],["write","needs to be awaited"],["scp","needs to be awaited"],["sleep","Can no longer be called simultenaously."],["hacking_skill","renamed 'hacking'"],["tryWrite","renamed 'tryWritePort'"]],s=[[/ns.getHackTime/g,"((...a)=>ns.getHackTime(...a)/1000)"],[/ns.getGrowTime/g,"((...a)=>ns.getGrowTime(...a)/1000)"],[/ns.getWeakenTime/g,"((...a)=>ns.getWeakenTime(...a)/1000)"],[/ns.bladeburner.getActionTime/g,"((...a)=>ns.bladeburner.getActionTime(...a)/1000)"],[/ns.hackAnalyzePercent/g,"((...a)=>ns.hackAnalyze(...a)*100)"],[/ns.hackChance/g,"ns.hackAnalyzeChance"],[/ns.tryWrite/g,"ns.tryWritePort"],[/formulas.basic.calculateSkill/g,"formulas.skills.calculateSkill"],[/formulas.basic.calculateExp/g,"formulas.skills.calculateExp"],[/formulas.basic.hackChance/g,"formulas.hacking.hackChance"],[/formulas.basic.hackExp/g,"formulas.hacking.hackExp"],[/formulas.basic.hackPercent/g,"formulas.hacking.hackPercent"],[/formulas.basic.growPercent/g,"formulas.hacking.growPercent"],[/formulas.basic.hackTime/g,"formulas.hacking.hackTime"],[/formulas.basic.growTime/g,"formulas.hacking.growTime"],[/formulas.basic.weakenTime/g,"formulas.hacking.weakenTime"]];function l(t){for(const e of s)if(t.match(e[0]))return!0;return!1}function c(t){const e=t.split("\n"),n=[];for(let t=0;tObject(T.a)({textfield:{borderBottom:"1px solid "+t.palette.primary.main},code:{whiteSpace:"pre",backgroundColor:t.palette.background.paper}}));var P;function I(){const[t,e]=Object(a.useState)(!1),[n,c]=Object(a.useState)(P.None),u=N(),y={[P.None]:"n00dles.script",[P.NS1]:"n00dles.script",[P.NS2]:"n00dles.js"}[n],E={[A.f.Start]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,null,"Welcome to Bitburner, a cyberpunk-themed incremental RPG! The game takes place in a dark, dystopian future... The year is 2077...",r.a.createElement("br",null),r.a.createElement("br",null),"This tutorial will show you the basics of the game. You may skip the tutorial at any time.",r.a.createElement("br",null),r.a.createElement("br",null),"You can also collapse this panel to temporarily hide this tutorial.")),canNext:!0},[A.f.NSSelection]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,null,"The tutorial will adjust to your programming ability."),r.a.createElement(o.a,null,"Bitburner has 2 types of scripts:"),r.a.createElement(p.a,null,r.a.createElement(g.a,null,r.a.createElement(o.a,null,"NS1: Javascript from 2009, very simple. Recommended for beginners to programming.")),r.a.createElement(g.a,null,r.a.createElement(o.a,null,"NS2: Native, modern Javascript. Recommended if you know any programming language or are serious about learning programming."))),r.a.createElement(o.a,null,"Both are available at all time and interchangeably. This choice is only for the tutorial."),r.a.createElement(l.a,{onClick:()=>{c(P.NS1),Object(A.c)()}},"Use NS1"),r.a.createElement(l.a,{onClick:()=>{c(P.NS2),Object(A.c)()}},"Use NS2"),r.a.createElement(l.a,{onClick:()=>e(!0)},"More info"),r.a.createElement("br",null)),canNext:!1},[A.f.GoToCharacterPage]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,null,"Let's start by heading to the Stats page. Click"),r.a.createElement(g.a,null,r.a.createElement(b.a,{color:"error"}),r.a.createElement(o.a,{color:"error"},"Stats")),r.a.createElement(o.a,null,"on the main navigation menu (left-hand side of the screen)")),canNext:!1},[A.f.CharacterPage]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(g.a,null,r.a.createElement(b.a,{color:"primary"}),r.a.createElement(o.a,{color:"primary"},"Stats")),r.a.createElement(o.a,null,"shows a lot of important information about your progress, such as your skills, money, and bonuses.")),canNext:!0},[A.f.CharacterGoToTerminalPage]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,null,"Let's head to your computer's terminal by clicking"),r.a.createElement(g.a,null,r.a.createElement(v.a,{color:"error"}),r.a.createElement(o.a,{color:"error"},"Terminal")),r.a.createElement(o.a,null,"on the main navigation menu.")),canNext:!1},[A.f.TerminalIntro]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(g.a,null,r.a.createElement(v.a,{color:"primary"}),r.a.createElement(o.a,{color:"primary"},"Terminal")),r.a.createElement(o.a,null,"is used to interface with your home computer as well as all of the other machines around the world.")),canNext:!0},[A.f.TerminalHelp]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,null,"Let's try it out. Start by entering"),r.a.createElement(o.a,{classes:{root:u.textfield}},"[home ~/]> help"),r.a.createElement(o.a,null,"(Don't forget to press Enter after typing the command)")),canNext:!1},[A.f.TerminalLs]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,{classes:{root:u.textfield}},"[home ~/]> help"),r.a.createElement(o.a,null,"displays a list of all available Terminal commands, how to use them, and a description of what they do."," ",r.a.createElement("br",null),r.a.createElement("br",null),"Let's try another command. Enter"),r.a.createElement(o.a,{classes:{root:u.textfield}},"[home ~/]> ls")),canNext:!1},[A.f.TerminalScan]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,{classes:{root:u.textfield}},"[home ~/]> ls"),r.a.createElement(o.a,null," ","is a basic command that shows files on the computer. Right now, it shows that you have a program called"," ","NUKE.exe on your computer. We'll get to what this does later. ",r.a.createElement("br",null),r.a.createElement("br",null),"Using your home computer's terminal, you can connect to other machines throughout the world. Let's do that now by first entering"),r.a.createElement(o.a,{classes:{root:u.textfield}},"[home ~/]> scan")),canNext:!1},[A.f.TerminalScanAnalyze1]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,{classes:{root:u.textfield}},"[home ~/]> scan"),r.a.createElement(o.a,null,"shows all available network connections. In other words, it displays a list of all servers that can be connected to from your current machine. A server is identified by its hostname. ",r.a.createElement("br",null),r.a.createElement("br",null),"That's great and all, but there's so many servers. Which one should you go to?"," "),r.a.createElement(o.a,{classes:{root:u.textfield}},"[home ~/]> scan-analyze"),r.a.createElement(o.a,null,"gives some more detailed information about servers on the network. Try it now!")),canNext:!1},[A.f.TerminalScanAnalyze2]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,{classes:{root:u.textfield}},"[home ~/]> scan-analyze"),r.a.createElement(o.a,null,"shows more detailed information about each server that you can connect to (servers that are a distance of one node away). ",r.a.createElement("br",null),r.a.createElement("br",null)," It is also possible to run scan-analyze with a higher depth. Let's try a depth of two with the following command:"," "),r.a.createElement(o.a,{classes:{root:u.textfield}},"[home ~/]> scan-analyze 2")),canNext:!1},[A.f.TerminalConnect]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,null,"Now you can see information about all servers that are up to two nodes away, as well as figure out how to navigate to those servers through the network. You can only connect to a server that is one node away. To connect to a machine, use"),r.a.createElement(o.a,{classes:{root:u.textfield}},"[home ~/]> connect hostname"),r.a.createElement(o.a,null,"From the results of "),r.a.createElement(o.a,{classes:{root:u.textfield}},"[home ~/]> scan-analyze 2"),r.a.createElement(o.a,null," ","we can see that the n00dles server is only one node away. Let's connect to it now using:"),r.a.createElement(o.a,{classes:{root:u.textfield}},"[home ~/]> connect n00dles")),canNext:!1},[A.f.TerminalAnalyze]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,null,"You are now connected to another machine! What can you do now? You can hack it!",r.a.createElement("br",null),r.a.createElement("br",null)," In the year 2077, currency has become digital and decentralized. People and corporations store their money on servers and computers. Using your hacking abilities, you can hack servers to steal money and gain experience. ",r.a.createElement("br",null),r.a.createElement("br",null),"Before you try to hack a server, you should run diagnostics using"," "),r.a.createElement(o.a,{classes:{root:u.textfield}},"[n00dles ~/]> analyze")),canNext:!1},[A.f.TerminalNuke]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,null,"When "),r.a.createElement(o.a,{classes:{root:u.textfield}},"[n00dles ~/]> analyze"),r.a.createElement(o.a,null,"finishes running it will show useful information about hacking the server. ",r.a.createElement("br",null),r.a.createElement("br",null)," For this server, the required hacking skill is only 1, which means you can hack it right now. However, in order to hack a server you must first gain root access. The NUKE.exe program that we saw earlier on your home computer is a virus that will grant you root access to a machine if there are enough open ports."),r.a.createElement(o.a,{classes:{root:u.textfield}},"[n00dles ~/]> analyze"),r.a.createElement(o.a,null," ","shows that there do not need to be any open ports on this machine for the NUKE virus to work, so go ahead and run the virus using"," "),r.a.createElement(o.a,{classes:{root:u.textfield}},"[n00dles ~/]> run NUKE.exe"),r.a.createElement(o.a,null)),canNext:!0},[A.f.TerminalManualHack]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,null,"You now have root access! You can hack the server using "),r.a.createElement(o.a,{classes:{root:u.textfield}},"[n00dles ~/]> hack"),r.a.createElement(o.a,null," Try doing that now.")),canNext:!0},[A.f.TerminalHackingMechanics]:{content:r.a.createElement(o.a,null,"You are now attempting to hack the server. Performing a hack takes time and only has a certain percentage chance of success. This time and success chance is determined by a variety of factors, including your hacking skill and the server's security level.",r.a.createElement("br",null),r.a.createElement("br",null),"If your attempt to hack the server is successful, you will steal a certain percentage of the server's total money. This percentage is affected by your hacking skill and the server's security level.",r.a.createElement("br",null),r.a.createElement("br",null),"The amount of money on a server is not limitless. So, if you constantly hack a server and deplete its money, then you will encounter diminishing returns in your hacking. You will need to use"," ",r.a.createElement(o.a,{classes:{root:u.textfield}},"[n00dles ~/]> grow"),"which tricks the company into adding money to their server and"," ",r.a.createElement(o.a,{classes:{root:u.textfield}},"[n00dles ~/]> weaken"),"which increases the speed of hack and grow."),canNext:!0},[A.f.TerminalGoHome]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,null,"From any server you can get back home using"),r.a.createElement(o.a,{classes:{root:u.textfield}},"[n00dles ~/]> home"),r.a.createElement(o.a,null,"Let's head home before creating our first script!")),canNext:!0},[A.f.TerminalCreateScript]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,null,"Hacking is the core mechanic of the game and is necessary for progressing. However, you don't want to be hacking manually the entire time. You can automate your hacking by writing scripts!",r.a.createElement("br",null),r.a.createElement("br",null),"To create a new script or edit an existing one, you can use"," "),r.a.createElement(o.a,{classes:{root:u.textfield}},"[home ~/]> nano"),r.a.createElement(o.a,null,"Scripts must end with the .script extension. Let's make a script now by entering "),r.a.createElement(o.a,{classes:{root:u.textfield}},"[home ~/]> nano "+y),r.a.createElement(o.a,null,"after the hack command finishes running (Sidenote: Pressing ctrl + c will end a command like hack early)")),canNext:!1},[A.f.TerminalTypeScript]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,null,"This is the script editor. You can use it to program your scripts."," ",n!==P.NS2&&r.a.createElement(r.a.Fragment,null,"Scripts are written in a simplified version of javascript.")," Copy and paste the following code into the script editor: ",r.a.createElement("br",null)),r.a.createElement(o.a,{classes:{root:u.code}},n!==P.NS2&&r.a.createElement(d.a,{value:"while(true) {\n hack('n00dles');\n}"}),n===P.NS2&&r.a.createElement(d.a,{value:"export async function main(ns) {\n\twhile(true) {\n\t\tawait ns.hack('n00dles');\n\t}\n}"})),r.a.createElement(o.a,null,"For anyone with basic programming experience, this code should be straightforward. This script will continuously hack the n00dles server.",r.a.createElement("br",null),r.a.createElement("br",null),"To save and close the script editor, press the button in the bottom left, or press ctrl + s then ctrl + b.")),canNext:!1},[A.f.TerminalFree]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,null,"Now we'll run the script. Scripts require a certain amount of RAM to run, and can be run on any machine which you have root access to. Different servers have different amounts of RAM. You can also purchase more RAM for your home server.",r.a.createElement("br",null),r.a.createElement("br",null),"To check how much RAM is available on this machine, enter"),r.a.createElement(o.a,{classes:{root:u.textfield}},"[home ~/]> free")),canNext:!1},[A.f.TerminalRunScript]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,null,"We have 8GB of free RAM on this machine, which is enough to run our script. Let's run our script using"),r.a.createElement(o.a,{classes:{root:u.textfield}},"[home ~/]> run "+y)),canNext:!1},[A.f.TerminalGoToActiveScriptsPage]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,null,"Your script is now running! It will continuously run in the background and will automatically stop if the code ever completes (the n00dles.script will never complete because it runs an infinite loop). ",r.a.createElement("br",null),r.a.createElement("br",null),"These scripts can passively earn you income and hacking experience. Your scripts will also earn money and experience while you are offline, although at a slightly slower rate. ",r.a.createElement("br",null),r.a.createElement("br",null),"Let's check out some statistics for our running scripts by clicking"," "),r.a.createElement(g.a,null,r.a.createElement(C.a,{color:"error"}),r.a.createElement(o.a,{color:"error"},"Active Scripts"))),canNext:!1},[A.f.ActiveScriptsPage]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,null,"This page displays information about all of your scripts that are running across every server. You can use this to gauge how well your scripts are doing. Let's go back to"),r.a.createElement(g.a,null,r.a.createElement(v.a,{color:"error"}),r.a.createElement(o.a,{color:"error"},"Terminal"))),canNext:!1},[A.f.ActiveScriptsToTerminal]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,null,"One last thing about scripts, each active script contains logs that detail what it's doing. We can check these logs using the tail command. Do that now for the script we just ran by typing"," "),r.a.createElement(o.a,{classes:{root:u.textfield}},"[home ~/]> tail "+y)),canNext:!1},[A.f.TerminalTailScript]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,null,"The log for this script won't show much right now (it might show nothing at all) because it just started running...but check back again in a few minutes! ",r.a.createElement("br",null),r.a.createElement("br",null),"This covers the basics of hacking. To learn more about writing scripts, select"),r.a.createElement(g.a,null,r.a.createElement(_.a,{color:"primary"}),r.a.createElement(o.a,{color:"primary"},"Tutorial")),r.a.createElement(o.a,null,"in the main navigation menu to look at the documentation.",r.a.createElement("br",null),r.a.createElement("br",null),"For now, let's move on to something else!")),canNext:!0},[A.f.GoToHacknetNodesPage]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,null,"Hacking is not the only way to earn money. One other way to passively earn money is by purchasing and upgrading Hacknet Nodes. Let's go to"),r.a.createElement(g.a,null,r.a.createElement(S.a,{color:"error"}),r.a.createElement(o.a,{color:"error"},"Hacknet")),r.a.createElement(o.a,null,"through the main navigation menu now.")),canNext:!0},[A.f.HacknetNodesIntroduction]:{content:r.a.createElement(o.a,null,"Here you can purchase new Hacknet Nodes and upgrade your existing ones. Let's purchase a new one now."),canNext:!0},[A.f.HacknetNodesGoToWorldPage]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,null,"You just purchased a Hacknet Node! This Hacknet Node will passively earn you money over time, both online and offline. When you get enough money, you can upgrade your newly-purchased Hacknet Node below.",r.a.createElement("br",null),r.a.createElement("br",null),"Let's go to"),r.a.createElement(g.a,null,r.a.createElement(O.a,{color:"error"}),r.a.createElement(o.a,{color:"error"},"City"))),canNext:!0},[A.f.WorldDescription]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,null,"This page lists all of the different locations you can currently travel to. Each location has something that you can do. There's a lot of content out in the world, make sure you explore and discover!",r.a.createElement("br",null),r.a.createElement("br",null),"Lastly, click on"),r.a.createElement(g.a,null,r.a.createElement(_.a,{color:"error"}),r.a.createElement(o.a,{color:"error"},"Tutorial"))),canNext:!0},[A.f.TutorialPageInfo]:{content:r.a.createElement(o.a,null,"This page contains a lot of different documentation about the game's content and mechanics. I know it's a lot, but I highly suggest you read (or at least skim) through this before you start playing . That's the end of the tutorial. Hope you enjoy the game!"),canNext:!0},[A.f.End]:{content:r.a.createElement(o.a,null),canNext:!0}},k=Object(a.useState)(!1)[1];function w(){k(t=>!t)}Object(a.useEffect)(()=>h.a.subscribe(w),[]);const x=A.a.currStep,L=E[x];if(void 0===L)throw new Error("error in the tutorial");return r.a.createElement(r.a.Fragment,null,r.a.createElement(R.a,{open:t,onClose:()=>e(!1)}),r.a.createElement(i.a,{square:!0,sx:{maxWidth:"70vw",p:2}},L.content,x!==A.f.TutorialPageInfo&&r.a.createElement(r.a.Fragment,null,x!==A.f.Start&&r.a.createElement(s.a,{onClick:A.d,"aria-label":"previous"},r.a.createElement(m.a,null)),L.canNext&&r.a.createElement(s.a,{onClick:A.c,"aria-label":"next"},r.a.createElement(f.a,null))),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(l.a,{onClick:A.b},x!==A.f.TutorialPageInfo?"SKIP TUTORIAL":"FINISH TUTORIAL")))}!function(t){t[t.None=0]="None",t[t.NS1=1]="NS1",t[t.NS2=2]="NS2"}(P||(P={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(532),r=n(503),i=n(216),o=n(1),s=n(0),l=n.n(s),c=n(38);function f(t){const[e,n]=l.a.useState(0);return l.a.createElement(c.a,{open:t.open,onClose:t.onClose,sx:{zIndex:999999}},l.a.createElement(r.a,{variant:"fullWidth",value:e,onChange:function(t,e){n(e)}},l.a.createElement(i.a,{label:"NS1"}),l.a.createElement(i.a,{label:"NS2"})),0===e&&l.a.createElement(l.a.Fragment,null,l.a.createElement(o.a,null,"These scripts end with '.script'. Using a very old interpreted version of javascript. It is perfect for beginner to programming."),l.a.createElement(o.a,null,"Example script using NS1:"),l.a.createElement(a.a,{loading:l.a.createElement(l.a.Fragment,null),defaultLanguage:"javascript",defaultValue:"while(true) {\n hack('n00dles');\n}",height:"300px",theme:"vs-dark",onMount:function(t){t.updateOptions({readOnly:!0})},options:{fontSize:30}})),1===e&&l.a.createElement(l.a.Fragment,null,l.a.createElement(o.a,null,"These scripts end with '.js'. Scripts using ns2 are running natively along the game. If you know any programming language you should be using this. However if you're unfamiliar with javascript Promises you might want to read up on them a little bit before diving in."),l.a.createElement(o.a,null,"Example script using NS2:"),l.a.createElement(a.a,{loading:l.a.createElement(l.a.Fragment,null),defaultLanguage:"javascript",defaultValue:"/** @param {NS} ns */\nexport async function main(ns) {\n\twhile(true) {\n\t\tawait ns.hack('n00dles');\n\t}\n}",height:"300px",theme:"vs-dark",options:{fontSize:30}})))}},,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return C}));var a=n(0),r=n.n(a),i=n(452),o=n.n(i),s=n(121),l=n(276),c=n(45),f=n(1086),u=n.n(f),m=n(1085),h=n.n(m),d=n(410),p=n.n(d),g=n(1087),y=n.n(g),b=n(29),E=n(25),v=n(6),k=n(19),_=n(1),w=n(8),S=n(115);const x=Object(s.a)({overviewContainer:{position:"fixed",top:0,right:0,zIndex:1500,display:"flex",justifyContent:"flex-end",flexDirection:"column"},header:{cursor:"grab",textAlign:"center",display:"flex",flexDirection:"row",alignItems:"center"},visibilityToggle:{padding:"2px",minWidth:"inherit",backgroundColor:"transparent",border:"none","&:hover":{backgroundColor:"rgba(255, 255, 255, 0.1)"}},collapse:{borderTop:"1px solid "+v.a.theme.welllight,margin:"0 auto"},icon:{fontSize:"24px"}});function C({children:t,mode:e}){const n=Object(a.useRef)(null),[i,s]=Object(a.useState)(v.a.overview.opened),[f,m]=Object(a.useState)(v.a.overview.x),[d,g]=Object(a.useState)(v.a.overview.y),C=x(),L=b.b.Router(),O=i?h.a:u.a,M="tutorial"===e?y.a:p.a,T="tutorial"===e?"Tutorial":"Overview";Object(a.useEffect)(()=>{v.a.overview={x:f,y:d,opened:i}},[i,f,d]),Object(a.useEffect)(()=>A(),[]),Object(a.useEffect)(()=>(window.addEventListener("resize",A),()=>{window.removeEventListener("resize",A)}),[]);const A=Object(S.debounce)(()=>{const t=null==n?void 0:n.current;t&&(R(t,"mouseover"),R(t,"mousedown"),R(document,"mousemove"),R(t,"mouseup"),R(t,"click"))},100),R=(t,e)=>{const n=document.createEvent("MouseEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)};return L.page()===E.a.BitVerse||L.page()===E.a.Loading||L.page()===E.a.Recovery?r.a.createElement(r.a.Fragment,null):r.a.createElement(o.a,{handle:".drag",bounds:"body",onStop:(t,e)=>{m(e.x),g(e.y)},defaultPosition:{x:f,y:d}},r.a.createElement(c.a,{className:C.overviewContainer,square:!0},r.a.createElement(k.a,{className:"drag",onDoubleClick:()=>s(t=>!t),ref:n},r.a.createElement(k.a,{className:C.header},r.a.createElement(M,{color:"secondary",className:C.icon,sx:{padding:"2px"}}),r.a.createElement(_.a,{flexGrow:1,color:"secondary"},T),r.a.createElement(w.a,{"aria-label":"expand or collapse character overview",variant:"text",size:"small",className:C.visibilityToggle},r.a.createElement(O,{className:C.icon,color:"secondary",onClick:()=>s(t=>!t),onTouchEnd:()=>s(t=>!t)})))),r.a.createElement(l.a,{in:i,className:C.collapse},t)))}},,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return Dt}));var a=n(0),r=n.n(a),i=n(27),o=n(13),s=n(17),l=n(144),c=n(121),f=n(1784),u=n(248),m=n(693),h=n(21),d=n(1093),p=n.n(d),g=n(1092),y=n.n(g),b=n(97),E=n(145),v=n(113),k=n(1),_=n(276),w=n(805),S=n(1094),x=n.n(S),C=n(349),L=n.n(C),O=n(1095),M=n.n(O),T=n(605),A=n.n(T),R=n(1096),N=n.n(R),P=n(410),I=n.n(P),F=n(1099),D=n.n(F),j=n(608),B=n.n(j),G=n(606),W=n.n(G),H=n(1100),U=n.n(H),q=n(607),$=n.n(q),K=n(1102),z=n.n(K),V=n(1103),Y=n.n(V),J=n(1104),X=n.n(J),Q=n(1105),Z=n.n(Q),tt=n(1106),et=n.n(tt),nt=n(1107),at=n.n(nt),rt=n(325),it=n.n(rt),ot=n(299),st=n.n(ot),lt=n(609),ct=n.n(lt),ft=n(1097),ut=n.n(ft),mt=n(1109),ht=n.n(mt),dt=n(1098),pt=n.n(dt),gt=n(1101),yt=n.n(gt),bt=n(1108),Et=n.n(bt),vt=n(209),kt=n.n(vt),_t=n(81),wt=n.n(_t),St=n(25),xt=n(10),Ct=n(44),Lt=n(1089),Ot=n(6),Mt=n(12),Tt=n(411),At=n(412),Rt=n(254);const Nt=t=>({width:t.spacing(31),transition:t.transitions.create("width",{easing:t.transitions.easing.sharp,duration:t.transitions.duration.enteringScreen}),overflowX:"hidden"}),Pt=t=>({transition:t.transitions.create("width",{easing:t.transitions.easing.sharp,duration:t.transitions.duration.leavingScreen}),overflowX:"hidden",width:`calc(${t.spacing(2)} + 1px)`,[t.breakpoints.up("sm")]:{width:`calc(${t.spacing(7)} + 1px)`}}),It=Object(s.a)(f.a,{shouldForwardProp:t=>"open"!==t})(({theme:t,open:e})=>({width:t.spacing(31),whiteSpace:"nowrap",boxSizing:"border-box",...e&&{...Nt(t),"& .MuiDrawer-paper":Nt(t)},...!e&&{...Pt(t),"& .MuiDrawer-paper":Pt(t)}})),Ft=Object(c.a)(t=>Object(l.a)({active:{borderLeft:"3px solid "+t.palette.primary.main},listitem:{}}));function Dt(t){const e=Object(a.useState)(!1)[1];function n(){e(t=>!t)}Object(a.useEffect)(()=>{const t=setInterval(n,200);return()=>clearInterval(t)},[]);const[s,l]=Object(a.useState)(!0),[c,f]=Object(a.useState)(!0),[d,g]=Object(a.useState)(!0),[S,C]=Object(a.useState)(!0),O=Ct.a.currStep===Ct.f.CharacterGoToTerminalPage||Ct.a.currStep===Ct.f.ActiveScriptsPage,T=Ct.a.currStep===Ct.f.GoToCharacterPage,R=Ct.a.currStep===Ct.f.TerminalGoToActiveScriptsPage,P=Ct.a.currStep===Ct.f.GoToHacknetNodesPage,F=Ct.a.currStep===Ct.f.HacknetNodesGoToWorldPage,j=Ct.a.currStep===Ct.f.WorldDescription,G=t.player.queuedAugmentations.length,H=t.player.factionInvitations.filter(t=>!At.b.includes(t)).length,q=Object(Lt.a)(t.player).length-Tt.b.length,K=t.player.factionInvitations.length>0||t.player.factions.length>0||t.player.augmentations.length>0||t.player.queuedAugmentations.length>0||t.player.sourceFiles.length>0,V=t.player.augmentations.length>0||t.player.queuedAugmentations.length>0||t.player.sourceFiles.length>0,J=t.player.sleeves.length>0,Q=!!t.player.corporation,tt=!!t.player.gang,nt=""!==t.player.companyName,rt=t.player.hasWseAccount,ot=!!t.player.bladeburner,lt=t.player.augmentations.some(t=>t.name===Mt.a.StaneksGift1);function ft(){t.router.toTerminal(),O&&Object(Ct.c)()}function mt(){t.router.toScriptEditor()}function dt(){t.router.toStats(),T&&Object(Ct.c)()}function gt(){t.router.toActiveScripts(),R&&Object(Ct.c)()}function bt(){t.router.toCreateProgram()}function vt(){t.router.toFactions()}function _t(){t.router.toAugmentations()}function Nt(){t.router.toHacknetNodes(),P&&Object(Ct.c)()}function Pt(){t.router.toCity(),F&&Object(Ct.c)()}function Dt(){t.router.toTravel()}function jt(){t.router.toJob()}function Bt(){t.router.toBladeburner()}function Gt(){t.router.toGang()}function Wt(){t.router.toTutorial(),j&&Object(Ct.c)()}Object(a.useEffect)(()=>{function e(e){if(!Ot.a.DisableHotkeys&&!(t.player.isWorking&&t.player.focus||t.router.page()===St.a.BitVerse))if(e.code===i.b.T&&e.altKey)e.preventDefault(),ft();else if(e.code===i.b.C&&e.altKey)e.preventDefault(),dt();else if(e.code===i.b.E&&e.altKey)e.preventDefault(),mt();else if(e.code===i.b.S&&e.altKey)e.preventDefault(),gt();else if(e.code===i.b.H&&e.altKey)e.preventDefault(),Nt();else if(e.code===i.b.W&&e.altKey)e.preventDefault(),Pt();else if(e.code===i.b.J&&e.altKey&&!e.ctrlKey&&!e.metaKey&&nt)e.preventDefault(),jt();else if(e.code===i.b.R&&e.altKey)e.preventDefault(),Dt();else if(e.code===i.b.P&&e.altKey)e.preventDefault(),bt();else if(e.code===i.b.F&&e.altKey){if(t.page==St.a.Terminal&&Ot.a.EnableBashHotkeys)return;e.preventDefault(),vt()}else e.code===i.b.A&&e.altKey?(e.preventDefault(),_t()):e.code===i.b.U&&e.altKey?(e.preventDefault(),Wt()):e.code===i.b.B&&e.altKey&&t.player.bladeburner?(e.preventDefault(),Bt()):e.code===i.b.G&&e.altKey&&t.player.gang&&(e.preventDefault(),Gt())}return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[]);const Ht=Ft(),[Ut,qt]=Object(a.useState)(t.opened);return Object(a.useEffect)(()=>{t.onToggled(Ut)},[Ut]),r.a.createElement(It,{open:Ut,anchor:"left",variant:"permanent"},r.a.createElement(b.a,{classes:{root:Ht.listitem},button:!0,onClick:()=>qt(t=>!t)},r.a.createElement(E.a,null,Ut?r.a.createElement(p.a,{color:"primary"}):r.a.createElement(y.a,{color:"primary"})),r.a.createElement(v.a,{primary:r.a.createElement(h.a,{title:Object(Rt.a)()},r.a.createElement(k.a,null,"Bitburner v",xt.a.VersionString))})),r.a.createElement(m.a,null),r.a.createElement(u.a,null,r.a.createElement(b.a,{classes:{root:Ht.listitem},button:!0,onClick:()=>l(t=>!t)},r.a.createElement(E.a,null,r.a.createElement(h.a,{title:Ut?"":"Hacking"},r.a.createElement(x.a,{color:"primary"}))),r.a.createElement(v.a,{primary:r.a.createElement(k.a,null,"Hacking")}),s?r.a.createElement(kt.a,{color:"primary"}):r.a.createElement(wt.a,{color:"primary"})),r.a.createElement(_.a,{in:s,timeout:"auto",unmountOnExit:!0},r.a.createElement(u.a,null,r.a.createElement(b.a,{classes:{root:Ht.listitem},button:!0,key:"Terminal",className:Object(o.default)({[Ht.active]:t.page===St.a.Terminal}),onClick:ft},r.a.createElement(E.a,null,r.a.createElement(h.a,{title:Ut?"":"Terminal"},r.a.createElement(L.a,{color:O?"error":t.page!==St.a.Terminal?"secondary":"primary"}))),r.a.createElement(v.a,null,r.a.createElement(k.a,{color:O?"error":t.page!==St.a.Terminal?"secondary":"primary"},"Terminal"))),r.a.createElement(b.a,{classes:{root:Ht.listitem},button:!0,key:"Script Editor",className:Object(o.default)({[Ht.active]:t.page===St.a.ScriptEditor}),onClick:mt},r.a.createElement(E.a,null,r.a.createElement(h.a,{title:Ut?"":"Script Editor"},r.a.createElement(M.a,{color:t.page!==St.a.ScriptEditor?"secondary":"primary"}))),r.a.createElement(v.a,null,r.a.createElement(k.a,{color:t.page!==St.a.ScriptEditor?"secondary":"primary"},"Script Editor"))),r.a.createElement(b.a,{classes:{root:Ht.listitem},button:!0,key:"Active Scripts",className:Object(o.default)({[Ht.active]:t.page===St.a.ActiveScripts}),onClick:gt},r.a.createElement(E.a,null,r.a.createElement(h.a,{title:Ut?"":"Active Scripts"},r.a.createElement(A.a,{color:R?"error":t.page!==St.a.ActiveScripts?"secondary":"primary"}))),r.a.createElement(v.a,null,r.a.createElement(k.a,{color:R?"error":t.page!==St.a.ActiveScripts?"secondary":"primary"},"Active Scripts"))),r.a.createElement(b.a,{button:!0,key:"Create Program",className:Object(o.default)({[Ht.active]:t.page===St.a.CreateProgram}),onClick:bt},r.a.createElement(E.a,null,r.a.createElement(w.a,{badgeContent:q>0?q:void 0,color:"error"},r.a.createElement(h.a,{title:Ut?"":"Create Program"},r.a.createElement(N.a,{color:t.page!==St.a.CreateProgram?"secondary":"primary"})))),r.a.createElement(v.a,null,r.a.createElement(k.a,{color:t.page!==St.a.CreateProgram?"secondary":"primary"},"Create Program"))),lt&&r.a.createElement(b.a,{button:!0,key:"Staneks Gift",className:Object(o.default)({[Ht.active]:t.page===St.a.StaneksGift}),onClick:function(){t.router.toStaneksGift()}},r.a.createElement(E.a,null,r.a.createElement(h.a,{title:Ut?"":"Stanek's Gift"},r.a.createElement(ut.a,{color:t.page!==St.a.StaneksGift?"secondary":"primary"}))),r.a.createElement(v.a,null,r.a.createElement(k.a,{color:t.page!==St.a.StaneksGift?"secondary":"primary"},"Stanek's Gift"))))),r.a.createElement(m.a,null),r.a.createElement(b.a,{classes:{root:Ht.listitem},button:!0,onClick:()=>f(t=>!t)},r.a.createElement(E.a,null,r.a.createElement(h.a,{title:Ut?"":"Character"},r.a.createElement(pt.a,{color:"primary"}))),r.a.createElement(v.a,{primary:r.a.createElement(k.a,null,"Character")}),c?r.a.createElement(kt.a,{color:"primary"}):r.a.createElement(wt.a,{color:"primary"})),r.a.createElement(_.a,{in:c,timeout:"auto",unmountOnExit:!0},r.a.createElement(b.a,{button:!0,key:"Stats",className:Object(o.default)({[Ht.active]:t.page===St.a.Stats}),onClick:dt},r.a.createElement(E.a,null,r.a.createElement(h.a,{title:Ut?"":"Stats"},r.a.createElement(I.a,{color:T?"error":t.page!==St.a.Stats?"secondary":"primary"}))),r.a.createElement(v.a,null,r.a.createElement(k.a,{color:T?"error":t.page!==St.a.Stats?"secondary":"primary"},"Stats"))),K&&r.a.createElement(b.a,{classes:{root:Ht.listitem},button:!0,key:"Factions",className:Object(o.default)({[Ht.active]:[St.a.Factions,St.a.Faction].includes(t.page)}),onClick:vt},r.a.createElement(E.a,null,r.a.createElement(w.a,{badgeContent:0!==H?H:void 0,color:"error"},r.a.createElement(h.a,{title:Ut?"":"Factions"},r.a.createElement(D.a,{color:[St.a.Factions,St.a.Faction].includes(t.page)?"primary":"secondary"})))),r.a.createElement(v.a,null,r.a.createElement(k.a,{color:[St.a.Factions,St.a.Faction].includes(t.page)?"primary":"secondary"},"Factions"))),V&&r.a.createElement(b.a,{classes:{root:Ht.listitem},button:!0,key:"Augmentations",className:Object(o.default)({[Ht.active]:t.page===St.a.Augmentations}),onClick:_t},r.a.createElement(E.a,null,r.a.createElement(w.a,{badgeContent:0!==G?G:void 0,color:"error"},r.a.createElement(h.a,{title:Ut?"":"Augmentations"},r.a.createElement(B.a,{style:{transform:"rotate(-90deg)"},color:t.page!==St.a.Augmentations?"secondary":"primary"})))),r.a.createElement(v.a,null,r.a.createElement(k.a,{color:t.page!==St.a.Augmentations?"secondary":"primary"},"Augmentations"))),r.a.createElement(b.a,{button:!0,key:"Hacknet",className:Object(o.default)({[Ht.active]:t.page===St.a.Hacknet}),onClick:Nt},r.a.createElement(E.a,null,r.a.createElement(h.a,{title:Ut?"":"Hacknet"},r.a.createElement(W.a,{color:P?"error":t.page!==St.a.Hacknet?"secondary":"primary"}))),r.a.createElement(v.a,null,r.a.createElement(k.a,{color:P?"error":t.page!==St.a.Hacknet?"secondary":"primary"},"Hacknet"))),J&&r.a.createElement(b.a,{classes:{root:Ht.listitem},button:!0,key:"Sleeves",className:Object(o.default)({[Ht.active]:t.page===St.a.Sleeves}),onClick:function(){t.router.toSleeves()}},r.a.createElement(E.a,null,r.a.createElement(h.a,{title:Ut?"":"Sleeves"},r.a.createElement(U.a,{color:t.page!==St.a.Sleeves?"secondary":"primary"}))),r.a.createElement(v.a,null,r.a.createElement(k.a,{color:t.page!==St.a.Sleeves?"secondary":"primary"},"Sleeves")))),r.a.createElement(m.a,null),r.a.createElement(b.a,{classes:{root:Ht.listitem},button:!0,onClick:()=>g(t=>!t)},r.a.createElement(E.a,null,r.a.createElement(h.a,{title:Ut?"":"World"},r.a.createElement(yt.a,{color:"primary"}))),r.a.createElement(v.a,{primary:r.a.createElement(k.a,null,"World")}),d?r.a.createElement(kt.a,{color:"primary"}):r.a.createElement(wt.a,{color:"primary"})),r.a.createElement(_.a,{in:d,timeout:"auto",unmountOnExit:!0},r.a.createElement(b.a,{button:!0,key:"City",className:Object(o.default)({[Ht.active]:t.page===St.a.City||t.page===St.a.Grafting||t.page===St.a.Location}),onClick:Pt},r.a.createElement(E.a,null,r.a.createElement(h.a,{title:Ut?"":"City"},r.a.createElement($.a,{color:F?"error":t.page!==St.a.City?"secondary":"primary"}))),r.a.createElement(v.a,null,r.a.createElement(k.a,{color:F?"error":t.page!==St.a.City?"secondary":"primary"},"City"))),r.a.createElement(b.a,{button:!0,key:"Travel",className:Object(o.default)({[Ht.active]:t.page===St.a.Travel}),onClick:Dt},r.a.createElement(E.a,null,r.a.createElement(h.a,{title:Ut?"":"Travel"},r.a.createElement(z.a,{color:t.page!==St.a.Travel?"secondary":"primary"}))),r.a.createElement(v.a,null,r.a.createElement(k.a,{color:t.page!==St.a.Travel?"secondary":"primary"},"Travel"))),nt&&r.a.createElement(b.a,{classes:{root:Ht.listitem},button:!0,key:"Job",className:Object(o.default)({[Ht.active]:t.page===St.a.Job}),onClick:jt},r.a.createElement(E.a,null,r.a.createElement(h.a,{title:Ut?"":"Job"},r.a.createElement(Y.a,{color:t.page!==St.a.Job?"secondary":"primary"}))),r.a.createElement(v.a,null,r.a.createElement(k.a,{color:t.page!==St.a.Job?"secondary":"primary"},"Job"))),rt&&r.a.createElement(b.a,{classes:{root:Ht.listitem},button:!0,key:"Stock Market",className:Object(o.default)({[Ht.active]:t.page===St.a.StockMarket}),onClick:function(){t.router.toStockMarket()}},r.a.createElement(E.a,null,r.a.createElement(h.a,{title:Ut?"":"Stock Market"},r.a.createElement(X.a,{color:t.page!==St.a.StockMarket?"secondary":"primary"}))),r.a.createElement(v.a,null,r.a.createElement(k.a,{color:t.page!==St.a.StockMarket?"secondary":"primary"},"Stock Market"))),ot&&r.a.createElement(b.a,{classes:{root:Ht.listitem},button:!0,key:"Bladeburner",className:Object(o.default)({[Ht.active]:t.page===St.a.Bladeburner}),onClick:Bt},r.a.createElement(E.a,null,r.a.createElement(h.a,{title:Ut?"":"Bladeburner"},r.a.createElement(Z.a,{color:t.page!==St.a.Bladeburner?"secondary":"primary"}))),r.a.createElement(v.a,null,r.a.createElement(k.a,{color:t.page!==St.a.Bladeburner?"secondary":"primary"},"Bladeburner"))),Q&&r.a.createElement(b.a,{classes:{root:Ht.listitem},button:!0,key:"Corp",className:Object(o.default)({[Ht.active]:t.page===St.a.Corporation}),onClick:function(){t.router.toCorporation()}},r.a.createElement(E.a,null,r.a.createElement(h.a,{title:Ut?"":"Corp"},r.a.createElement(et.a,{color:t.page!==St.a.Corporation?"secondary":"primary"}))),r.a.createElement(v.a,null,r.a.createElement(k.a,{color:t.page!==St.a.Corporation?"secondary":"primary"},"Corp"))),tt&&r.a.createElement(b.a,{classes:{root:Ht.listitem},button:!0,key:"Gang",className:Object(o.default)({[Ht.active]:t.page===St.a.Gang}),onClick:Gt},r.a.createElement(E.a,null,r.a.createElement(h.a,{title:Ut?"":"Gang"},r.a.createElement(at.a,{color:t.page!==St.a.Gang?"secondary":"primary"}))),r.a.createElement(v.a,null,r.a.createElement(k.a,{color:t.page!==St.a.Gang?"secondary":"primary"},"Gang")))),r.a.createElement(m.a,null),r.a.createElement(b.a,{classes:{root:Ht.listitem},button:!0,onClick:()=>C(t=>!t)},r.a.createElement(E.a,null,r.a.createElement(h.a,{title:Ut?"":"Help"},r.a.createElement(Et.a,{color:"primary"}))),r.a.createElement(v.a,{primary:r.a.createElement(k.a,null,"Help")}),S?r.a.createElement(kt.a,{color:"primary"}):r.a.createElement(wt.a,{color:"primary"})),r.a.createElement(_.a,{in:S,timeout:"auto",unmountOnExit:!0},r.a.createElement(b.a,{button:!0,key:"Milestones",className:Object(o.default)({[Ht.active]:t.page===St.a.Milestones}),onClick:function(){t.router.toMilestones()}},r.a.createElement(E.a,null,r.a.createElement(h.a,{title:Ut?"":"Milestones"},r.a.createElement(it.a,{color:t.page!==St.a.Milestones?"secondary":"primary"}))),r.a.createElement(v.a,null,r.a.createElement(k.a,{color:t.page!==St.a.Milestones?"secondary":"primary"},"Milestones"))),r.a.createElement(b.a,{button:!0,key:"Tutorial",className:Object(o.default)({[Ht.active]:t.page===St.a.Tutorial}),onClick:Wt},r.a.createElement(E.a,null,r.a.createElement(h.a,{title:Ut?"":"Tutorial"},r.a.createElement(st.a,{color:j?"error":t.page!==St.a.Tutorial?"secondary":"primary"}))),r.a.createElement(v.a,null,r.a.createElement(k.a,{color:j?"error":t.page!==St.a.Tutorial?"secondary":"primary"},"Tutorial"))),r.a.createElement(b.a,{button:!0,key:"Achievements",className:Object(o.default)({[Ht.active]:t.page===St.a.Achievements}),onClick:function(){t.router.toAchievements()}},r.a.createElement(E.a,null,r.a.createElement(h.a,{title:Ut?"":"Achievements"},r.a.createElement(ht.a,{color:t.page!==St.a.Achievements?"secondary":"primary"}))),r.a.createElement(v.a,null,r.a.createElement(k.a,{color:t.page!==St.a.Achievements?"secondary":"primary"},"Achievements"))),r.a.createElement(b.a,{button:!0,key:"Options",className:Object(o.default)({[Ht.active]:t.page===St.a.Options}),onClick:function(){t.router.toGameOptions()}},r.a.createElement(E.a,null,r.a.createElement(h.a,{title:Ut?"":"Options"},r.a.createElement(ct.a,{color:t.page!==St.a.Options?"secondary":"primary"}))),r.a.createElement(v.a,null,r.a.createElement(k.a,{color:t.page!==St.a.Options?"secondary":"primary"},"Options"))),!1)))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(65);function r(t){const e=[];for(const n of Object.keys(a.a)){const r=a.a[n].create;null!=r&&(t.hasProgram(a.a[n].name)||r.req(t)&&e.push(a.a[n]))}return e}},,,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return C}));var a=n(0),r=n.n(a),i=n(1111),o=n(1112),s=n(1113),l=n(1114),c=n(348),f=n(29),u=n(1),m=n(8),h=n(21),d=n(19),p=n(45),g=n(249),y=n(6),b=n(252),E=n(12),v=n(79),k=n(10),_=n(22),w=n(692);const S=({player:t})=>{var e,n;const a=null!==(e=null===(n=t.augmentations.find(t=>t.name===E.a.NeuroFluxGovernor))||void 0===n?void 0:n.level)&&void 0!==e?e:0;return a>0?r.a.createElement(p.a,{sx:{p:1}},r.a.createElement(u.a,{variant:"h5",color:y.a.theme.info},"NeuroFlux Governor - Level ",a),r.a.createElement(u.a,{color:y.a.theme.info},v.a[E.a.NeuroFluxGovernor].stats)):r.a.createElement(r.a.Fragment,null)},x=({player:t})=>t.entropy>0?r.a.createElement(p.a,{sx:{p:1}},r.a.createElement(u.a,{variant:"h5",color:y.a.theme.error},"Entropy Virus - Level ",t.entropy),r.a.createElement(u.a,{color:y.a.theme.error},r.a.createElement("b",null,"All multipliers decreased by:")," ",Object(_.f)(100*(1-k.a.EntropyEffect**t.entropy),3),"% (multiplicative)")):r.a.createElement(r.a.Fragment,null);function C(t){var e,n;const[v,k]=Object(a.useState)(!1),_=f.b.Player(),C=Object(a.useState)(!1)[1];function L(){C(t=>!t)}return Object(a.useEffect)(()=>{const t=setInterval(L,200);return()=>clearInterval(t)},[]),r.a.createElement(g.a,{disableGutters:!0,maxWidth:"lg",sx:{mx:0}},r.a.createElement(u.a,{variant:"h4"},"Augmentations"),r.a.createElement(d.a,{sx:{mb:1}},r.a.createElement(p.a,{sx:{p:1}},r.a.createElement(u.a,{variant:"h5",color:"primary",sx:{display:"flex",alignItems:"center",flexWrap:"wrap"}},"Purchased Augmentations",r.a.createElement(h.a,{title:r.a.createElement(r.a.Fragment,null,r.a.createElement(u.a,null,"Below is a list of all Augmentations you have purchased but not yet installed. Click the button below to install them."),r.a.createElement(u.a,null,"WARNING: Installing your Augmentations resets most of your progress, including:"),r.a.createElement("br",null),r.a.createElement(u.a,null,"- Stats/Skill levels and Experience"),r.a.createElement(u.a,null,"- Money"),r.a.createElement(u.a,null,"- Scripts on every computer but your home computer"),r.a.createElement(u.a,null,"- Purchased servers"),r.a.createElement(u.a,null,"- Hacknet Nodes"),r.a.createElement(u.a,null,"- Faction/Company reputation"),r.a.createElement(u.a,null,"- Stocks"),r.a.createElement("br",null),r.a.createElement(u.a,null,"Installing Augmentations lets you start over with the perks and benefits granted by all of the Augmentations you have ever installed. Also, you will keep any scripts and RAM/Core upgrades on your home computer (but you will lose all programs besides NUKE.exe)"))},r.a.createElement(w.a,{sx:{ml:1,mb:.5},color:"info"}))),r.a.createElement(b.a,{open:v,onClose:()=>k(!1),onConfirm:t.installAugmentationsFn,confirmationText:r.a.createElement(r.a.Fragment,null,"Installing will reset",r.a.createElement("br",null),r.a.createElement("br",null),"- money",r.a.createElement("br",null),"- skill / experience",r.a.createElement("br",null),"- every server except home",r.a.createElement("br",null),"- factions and reputation",r.a.createElement("br",null),r.a.createElement("br",null),"You will keep:",r.a.createElement("br",null),r.a.createElement("br",null),"- All scripts on home",r.a.createElement("br",null),"- home ram and cores",r.a.createElement("br",null),r.a.createElement("br",null),"It is recommended to install several Augmentations at once. Preferably everything from any faction of your choosing.")}),r.a.createElement(d.a,{sx:{display:"grid",width:"100%",gridTemplateColumns:"1fr 1fr"}},r.a.createElement(h.a,{title:r.a.createElement(u.a,null,"'I never asked for this'")},r.a.createElement("span",null,r.a.createElement(m.a,{sx:{width:"100%"},disabled:0===_.queuedAugmentations.length,onClick:function(){y.a.SuppressBuyAugmentationConfirmation?t.installAugmentationsFn():k(!0)}},"Install Augmentations"))),r.a.createElement(h.a,{title:r.a.createElement(u.a,null,"It's always a good idea to backup/export your save!")},r.a.createElement(m.a,{sx:{width:"100%",color:y.a.theme.successlight},onClick:function(){t.exportGameFn(),L()}},"Backup Save ",Object(c.b)()?"(+1 favor to all factions)":"")))),_.queuedAugmentations.length>0?r.a.createElement(d.a,{sx:{display:"grid",gridTemplateColumns:"1fr 3fr"}},r.a.createElement(s.a,null),r.a.createElement(o.a,null)):r.a.createElement(p.a,{sx:{p:1}},r.a.createElement(u.a,null,"No Augmentations have been purchased yet"))),r.a.createElement(d.a,{sx:{my:1,display:"grid",gridTemplateColumns:`repeat(${+!!((null!==(e=null===(n=_.augmentations.find(t=>t.name===E.a.NeuroFluxGovernor))||void 0===n?void 0:n.level)&&void 0!==e?e:0)>0)+ +!!(_.entropy>0)}, 1fr)`,gap:1}},r.a.createElement(S,{player:_}),r.a.createElement(x,{player:_})),r.a.createElement(d.a,null,r.a.createElement(i.a,null)),r.a.createElement(l.a,null))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return y}));var a=n(19),r=n(45),i=n(1),o=n(355),s=n(8),l=n(248),c=n(21),f=n(0),u=n.n(f),m=n(172),h=n(6),d=n(29),p=n(79),g=n(12);function y(){const t=Object(f.useState)(!0)[1],e=d.b.Player().augmentations.slice().filter(t=>t.name!==g.a.NeuroFluxGovernor),[n,y]=Object(f.useState)(e[0]);function b(){t(t=>!t)}return h.a.OwnedAugmentationsOrder===m.a.Alphabetically&&e.sort((t,e)=>t.name.localeCompare(e.name)),u.a.createElement(a.a,{sx:{width:"100%"}},u.a.createElement(r.a,{sx:{p:1}},u.a.createElement(i.a,{variant:"h5"},"Installed Augmentations"),u.a.createElement(a.a,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr"}},u.a.createElement(c.a,{title:"Sorts the Augmentations alphabetically in numeral order"},u.a.createElement(s.a,{sx:{width:"100%"},onClick:function(){h.a.OwnedAugmentationsOrder=m.a.Alphabetically,b()}},"Sort in Order")),u.a.createElement(c.a,{title:"Sorts the Augmentations based on when you acquired them (same as default)"},u.a.createElement(s.a,{sx:{width:"100%"},onClick:function(){h.a.OwnedAugmentationsOrder=m.a.AcquirementTime,b()}},"Sort by Time of Acquirement")))),e.length>0?u.a.createElement(r.a,{sx:{display:"grid",gridTemplateColumns:"1fr 3fr"}},u.a.createElement(a.a,null,u.a.createElement(l.a,{sx:{height:400,overflowY:"scroll",borderRight:"1px solid "+h.a.theme.welllight}},e.map((t,e)=>u.a.createElement(o.a,{key:e+1,onClick:()=>y(t),selected:n===t},u.a.createElement(i.a,null,t.name))))),u.a.createElement(a.a,{sx:{m:1}},u.a.createElement(i.a,{variant:"h6",sx:{display:"flex",alignItems:"center",flexWrap:"wrap"}},n.name),u.a.createElement(i.a,{sx:{maxHeight:350,overflowY:"scroll"}},(()=>{const t=p.a[n.name],e="string"==typeof t.info?u.a.createElement("span",null,t.info):t.info;return u.a.createElement(u.a.Fragment,null,e,u.a.createElement("br",null),u.a.createElement("br",null),t.stats)})()))):u.a.createElement(r.a,{sx:{p:1}},u.a.createElement(i.a,null,"No Augmentations have been installed yet")))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return y}));var a=n(1786),r=n(1),i=n(97),o=n(113),s=n(248),l=n(45),c=n(0),f=n(18),u=n(2),m=n(6),h=n(5),d=n(79);function p(t){return 1===t.mult||0===u.a.sourceFileLvl(5)?c.createElement(r.a,{color:t.color},h.a.formatPercentage(t.base)):c.createElement(r.a,{color:t.color},c.createElement("span",{style:{opacity:.5}},h.a.formatPercentage(t.base))," ",h.a.formatPercentage(t.base*t.mult))}function g(t){const e=t.rows.map(t=>{const{mult:e,current:n,augmented:s,bnMult:l=1,color:f=m.a.theme.primary}=t;if(!isNaN(s))return c.createElement(i.a,{key:e,disableGutters:!0,sx:{py:0}},c.createElement(o.a,{sx:{my:.1},primary:c.createElement(r.a,{color:f},c.createElement("b",null,e)),secondary:c.createElement("span",{style:{display:"flex",alignItems:"center",flexWrap:"wrap"}},c.createElement(p,{base:n,mult:l,color:f}),c.createElement(a.a,{fontSize:"small",color:"success",sx:{mb:.5,mx:1}}),c.createElement(p,{base:s,mult:l,color:m.a.theme.success})),disableTypography:!0}))}).filter(t=>void 0!==t);return e.length>0?c.createElement(s.a,{disablePadding:!0},e):c.createElement(c.Fragment,null)}function y(){const t=function(){const t={};for(const e of u.a.queuedAugmentations){const n=d.a[e.name];for(const e of Object.keys(n.mults)){const a=t[e]?t[e]:1;t[e]=a*n.mults[e]}}return t}(),e=[...[{mult:"Hacking Chance",current:u.a.hacking_chance_mult,augmented:u.a.hacking_chance_mult*t.hacking_chance_mult},{mult:"Hacking Speed",current:u.a.hacking_speed_mult,augmented:u.a.hacking_speed_mult*t.hacking_speed_mult},{mult:"Hacking Money",current:u.a.hacking_money_mult,augmented:u.a.hacking_money_mult*t.hacking_money_mult,bnMult:f.a.ScriptHackMoney},{mult:"Hacking Growth",current:u.a.hacking_grow_mult,augmented:u.a.hacking_grow_mult*t.hacking_grow_mult},{mult:"Hacking Level",current:u.a.hacking_mult,augmented:u.a.hacking_mult*t.hacking_mult,bnMult:f.a.HackingLevelMultiplier},{mult:"Hacking Experience",current:u.a.hacking_exp_mult,augmented:u.a.hacking_exp_mult*t.hacking_exp_mult,bnMult:f.a.HackExpGain}].map(t=>Object.defineProperty(t,"color",{value:m.a.theme.hack})),...[{mult:"Strength Level",current:u.a.strength_mult,augmented:u.a.strength_mult*t.strength_mult,bnMult:f.a.StrengthLevelMultiplier},{mult:"Strength Experience",current:u.a.strength_exp_mult,augmented:u.a.strength_exp_mult*t.strength_exp_mult},{mult:"Defense Level",current:u.a.defense_mult,augmented:u.a.defense_mult*t.defense_mult,bnMult:f.a.DefenseLevelMultiplier},{mult:"Defense Experience",current:u.a.defense_exp_mult,augmented:u.a.defense_exp_mult*t.defense_exp_mult},{mult:"Dexterity Level",current:u.a.dexterity_mult,augmented:u.a.dexterity_mult*t.dexterity_mult,bnMult:f.a.DexterityLevelMultiplier},{mult:"Dexterity Experience",current:u.a.dexterity_exp_mult,augmented:u.a.dexterity_exp_mult*t.dexterity_exp_mult},{mult:"Agility Level",current:u.a.agility_mult,augmented:u.a.agility_mult*t.agility_mult,bnMult:f.a.AgilityLevelMultiplier},{mult:"Agility Experience",current:u.a.agility_exp_mult,augmented:u.a.agility_exp_mult*t.agility_exp_mult}].map(t=>Object.defineProperty(t,"color",{value:m.a.theme.combat})),{mult:"Charisma Level",current:u.a.charisma_mult,augmented:u.a.charisma_mult*t.charisma_mult,bnMult:f.a.CharismaLevelMultiplier,color:m.a.theme.cha},{mult:"Charisma Experience",current:u.a.charisma_exp_mult,augmented:u.a.charisma_exp_mult*t.charisma_exp_mult,color:m.a.theme.cha}],n=[{mult:"Hacknet Node Production",current:u.a.hacknet_node_money_mult,augmented:u.a.hacknet_node_money_mult*t.hacknet_node_money_mult,bnMult:f.a.HacknetNodeMoney},{mult:"Hacknet Node Purchase Cost",current:u.a.hacknet_node_purchase_cost_mult,augmented:u.a.hacknet_node_purchase_cost_mult*t.hacknet_node_purchase_cost_mult},{mult:"Hacknet Node RAM Upgrade Cost",current:u.a.hacknet_node_ram_cost_mult,augmented:u.a.hacknet_node_ram_cost_mult*t.hacknet_node_ram_cost_mult},{mult:"Hacknet Node Core Purchase Cost",current:u.a.hacknet_node_core_cost_mult,augmented:u.a.hacknet_node_core_cost_mult*t.hacknet_node_core_cost_mult},{mult:"Hacknet Node Level Upgrade Cost",current:u.a.hacknet_node_level_cost_mult,augmented:u.a.hacknet_node_level_cost_mult*t.hacknet_node_level_cost_mult},{mult:"Company Reputation Gain",current:u.a.company_rep_mult,augmented:u.a.company_rep_mult*t.company_rep_mult},{mult:"Faction Reputation Gain",current:u.a.faction_rep_mult,augmented:u.a.faction_rep_mult*t.faction_rep_mult,bnMult:f.a.FactionWorkRepGain},{mult:"Salary",current:u.a.work_money_mult,augmented:u.a.work_money_mult*t.work_money_mult,bnMult:f.a.CompanyWorkMoney,color:m.a.theme.money},{mult:"Crime Success Chance",current:u.a.crime_success_mult,augmented:u.a.crime_success_mult*t.crime_success_mult,color:m.a.theme.combat},{mult:"Crime Money",current:u.a.crime_money_mult,augmented:u.a.crime_money_mult*t.crime_money_mult,bnMult:f.a.CrimeMoney,color:m.a.theme.money}];return u.a.canAccessBladeburner()&&n.push({mult:"Bladeburner Success Chance",current:u.a.bladeburner_success_chance_mult,augmented:u.a.bladeburner_success_chance_mult*t.bladeburner_success_chance_mult},{mult:"Bladeburner Max Stamina",current:u.a.bladeburner_max_stamina_mult,augmented:u.a.bladeburner_max_stamina_mult*t.bladeburner_max_stamina_mult},{mult:"Bladeburner Stamina Gain",current:u.a.bladeburner_stamina_gain_mult,augmented:u.a.bladeburner_stamina_gain_mult*t.bladeburner_stamina_gain_mult},{mult:"Bladeburner Field Analysis",current:u.a.bladeburner_analysis_mult,augmented:u.a.bladeburner_analysis_mult*t.bladeburner_analysis_mult}),c.createElement(l.a,{sx:{p:1,maxHeight:400,overflowY:"scroll",display:"flex",flexDirection:"column",flexWrap:"wrap",gap:1}},c.createElement(g,{rows:e}),c.createElement(g,{rows:n}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var a=n(21),r=n(1),i=n(113),o=n(45),s=n(248),l=n(0),c=n(2),f=n(79),u=n(12);function m(){const t=[];let e=-1;for(let t=c.a.queuedAugmentations.length-1;t>=0;t--)if(c.a.queuedAugmentations[t].name===u.a.NeuroFluxGovernor){e=t;break}for(let n=0;n{const t="string"==typeof m.info?l.createElement("span",null,m.info):m.info;return l.createElement(l.Fragment,null,t,l.createElement("br",null),l.createElement("br",null),m.stats)})()),enterNextDelay:500,key:s},l.createElement(i.a,{sx:{px:2,py:1},primary:s})))}return l.createElement(o.a,{sx:{py:1,maxHeight:400,overflowY:"scroll"}},l.createElement(s.a,{sx:{height:400,overflowY:"scroll"},disablePadding:!0},t))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return b}));var a=n(45),r=n(355),i=n(113),o=n(19),s=n(248),l=n(1),c=n(0),f=n.n(c),u=n(108),m=n(2),h=n(172),d=n(6),p=n(371);const g=t=>{if(-1===t){return{info:f.a.createElement(f.a.Fragment,null,"This Source-File can only be acquired with obscure knowledge of the game, javascript, and the web ecosystem.",f.a.createElement("br",null),f.a.createElement("br",null),"It increases all of the player's multipliers by 0.1%",f.a.createElement("br",null),f.a.createElement("br",null),"You have found the following exploits:",f.a.createElement("br",null),f.a.createElement("br",null),m.a.exploits.map(t=>f.a.createElement(f.a.Fragment,{key:t},"* ",Object(u.b)(t),f.a.createElement("br",null)))),lvl:m.a.exploits.length,n:-1,name:"Source-File -1: Exploits in the BitNodes"}}const e="SourceFile"+t,n=p.a[e];return null==n?(console.error("Invalid source file number: "+t),null):n},y=t=>{let e;switch(t.n){case 12:e="∞";break;case-1:e=Object.keys(u.a).length;break;default:e="3"}return e};function b(){var t;const e=m.a.sourceFiles.slice(),n=m.a.exploits;if(n.length>0&&e.unshift({n:-1,lvl:n.length}),d.a.OwnedAugmentationsOrder===h.a.Alphabetically&&e.sort((t,e)=>t.n-e.n),0===e.length)return f.a.createElement(f.a.Fragment,null);const[u,p]=Object(c.useState)(e[0]);return f.a.createElement(o.a,{sx:{width:"100%",mt:1}},f.a.createElement(a.a,{sx:{p:1}},f.a.createElement(l.a,{variant:"h5"},"Source Files")),f.a.createElement(a.a,{sx:{display:"grid",gridTemplateColumns:"1fr 3fr"}},f.a.createElement(o.a,null,f.a.createElement(s.a,{sx:{height:400,overflowY:"scroll",borderRight:"1px solid "+d.a.theme.welllight},disablePadding:!0},e.map((t,e)=>{const n=g(t.n);if(!n)return;const a=y(n);return f.a.createElement(r.a,{key:e+1,onClick:()=>p(t),selected:u.n===t.n,sx:{py:0}},f.a.createElement(i.a,{disableTypography:!0,primary:f.a.createElement(l.a,null,n.name),secondary:f.a.createElement(l.a,null,"Level ",t.lvl," / ",a)}))}))),f.a.createElement(o.a,{sx:{m:1}},f.a.createElement(l.a,{variant:"h6",sx:{display:"flex",alignItems:"center",flexWrap:"wrap"}},null===(t=g(u.n))||void 0===t?void 0:t.name),f.a.createElement(l.a,{sx:{maxHeight:350,overflowY:"scroll"}},(()=>{const t=g(u.n);if(!t)return;const e=y(t);return f.a.createElement(f.a.Fragment,null,"Level ",u.lvl," / ",e,f.a.createElement("br",null),f.a.createElement("br",null),t.info)})()))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return O}));var a=n(210),r=n(12),i=n(0),o=n.n(i),s=n(1116),l=n(1118),c=n(1121),f=n(1123),u=n(1124),m=n(1125),h=n(1126),d=n(1127),p=n(1128),g=n(1129),y=n(1130),b=n(1131),E=n(1132),v=n(1133),k=n(1134),_=n(1135),w=n(1136),S=n(1139),x=n(1143),C=n(1),L=n(108);function O(t){return Object(i.useEffect)(()=>{t.player.giveExploit(L.a.YoureNotMeantToAccessThis)},[]),o.a.createElement(o.a.Fragment,null,o.a.createElement(C.a,null,"Development Menu - Only meant to be used for testing/debugging"),o.a.createElement(s.a,{player:t.player,router:t.router}),o.a.createElement(l.a,{player:t.player}),o.a.createElement(c.a,{player:t.player}),o.a.createElement(f.a,{player:t.player}),o.a.createElement(u.a,{player:t.player}),o.a.createElement(m.a,{player:t.player}),o.a.createElement(h.a,null),o.a.createElement(d.a,null),t.player.bladeburner instanceof a.a&&o.a.createElement(p.a,{player:t.player}),t.player.inGang()&&o.a.createElement(g.a,{player:t.player}),t.player.hasCorporation()&&o.a.createElement(y.a,{player:t.player}),o.a.createElement(b.a,null),t.player.hasWseAccount&&o.a.createElement(E.a,null),t.player.sleeves.length>0&&o.a.createElement(v.a,{player:t.player}),t.player.augmentations.some(t=>t.name===r.a.StaneksGift1)&&o.a.createElement(k.a,null),o.a.createElement(_.a,{player:t.player,engine:t.engine}),o.a.createElement(S.a,{player:t.player,engine:t.engine}),o.a.createElement(x.a,{player:t.player,engine:t.engine}),o.a.createElement(w.a,null))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return v}));var a=n(0),r=n.n(a),i=n(157),o=n(158),s=n(159),l=n(81),c=n.n(l),f=n(1),u=n(8),m=n(20),h=n(76),d=n(130),p=n(74),g=n(210),y=n(187),b=n(4),E=n(343);function v(t){const[e,n]=Object(a.useState)(!1),[l,v]=Object(a.useState)(""),[k,_]=Object(a.useState)("");function w(e){return function(){t.player.gainMoney(e,"other")}}return Object(a.useEffect)(()=>{if(e)throw new ReferenceError("Manually thrown error")},[e]),r.a.createElement(i.a,{TransitionProps:{unmountOnExit:!0}},r.a.createElement(o.a,{expandIcon:r.a.createElement(c.a,null)},r.a.createElement(f.a,null,"General")),r.a.createElement(s.a,null,r.a.createElement(u.a,{onClick:w(1e6)},r.a.createElement("pre",null,"+ ",r.a.createElement(m.a,{money:1e6}))),r.a.createElement(u.a,{onClick:w(1e9)},r.a.createElement("pre",null,"+ ",r.a.createElement(m.a,{money:1e9}))),r.a.createElement(u.a,{onClick:w(1e12)},r.a.createElement("pre",null,"+ ",r.a.createElement(m.a,{money:1e12}))),r.a.createElement(u.a,{onClick:w(1e15)},r.a.createElement("pre",null,"+ ",r.a.createElement(m.a,{money:1e15}))),r.a.createElement(u.a,{onClick:w(1/0)},r.a.createElement("pre",null,"+ ",r.a.createElement(m.a,{money:1/0}))),r.a.createElement(u.a,{onClick:function(){t.player.getHomeComputer().maxRam*=2}},"+ RAM"),r.a.createElement("br",null),r.a.createElement(f.a,null,"Corporation Name:"),r.a.createElement(h.a,{value:l,onChange:t=>v(t.target.value)}),r.a.createElement(u.a,{onClick:function(){t.player.startCorporation(l)}},"Create Corporation"),r.a.createElement("br",null),r.a.createElement(f.a,null,"Gang Faction:"),r.a.createElement(d.a,{value:k,onChange:function(t){_(t.target.value)}},y.a.Names.map(t=>r.a.createElement(p.a,{key:t,value:t},t))),r.a.createElement(u.a,{onClick:function(){const e=k===b.a.NiteSec||k===b.a.TheBlackHand;t.player.startGang(k,e)}},"Start Gang"),r.a.createElement("br",null),r.a.createElement(u.a,{onClick:function(){t.player.bladeburner=new g.a(t.player)}},"Join BladeBurner"),r.a.createElement("br",null),r.a.createElement(u.a,{onClick:function(){t.router.toBitVerse(!0,!0)}},"Quick b1t_flum3.exe"),r.a.createElement(u.a,{onClick:function(){t.router.toBitVerse(!0,!1)}},"Run b1t_flum3.exe"),r.a.createElement(u.a,{onClick:function(){t.router.toBitVerse(!1,!0)}},"Quick w0rld_d34m0n"),r.a.createElement(u.a,{onClick:function(){t.router.toBitVerse(!1,!1)}},"Hack w0rld_d34m0n"),r.a.createElement(u.a,{onClick:()=>n(!0)},"Throw Error"),r.a.createElement(u.a,{onClick:function(){Object(E.b)()}},"Check Messages")))}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var a=n(0),r=n.n(a),i=n(157),o=n(158),s=n(159),l=n(81),c=n.n(l),f=n(1),u=n(8),m=n(133);const h=1e27;function d(t){function e(e,n){return function(a){switch(e){case"hacking":a&&t.player.gainHackingExp(a*n);break;case"strength":a&&t.player.gainStrengthExp(a*n);break;case"defense":a&&t.player.gainDefenseExp(a*n);break;case"dexterity":a&&t.player.gainDexterityExp(a*n);break;case"agility":a&&t.player.gainAgilityExp(a*n);break;case"charisma":a&&t.player.gainCharismaExp(a*n);break;case"intelligence":a&&t.player.gainIntelligenceExp(a*n)}t.player.updateSkillLevels()}}function n(e){return function(n){t.player.karma+=n*e}}function a(e){return function(){switch(e){case"hacking":t.player.hacking_exp=0;break;case"strength":t.player.strength_exp=0;break;case"defense":t.player.defense_exp=0;break;case"dexterity":t.player.dexterity_exp=0;break;case"agility":t.player.agility_exp=0;break;case"charisma":t.player.charisma_exp=0;break;case"intelligence":t.player.intelligence_exp=0}t.player.updateSkillLevels()}}return r.a.createElement(i.a,{TransitionProps:{unmountOnExit:!0}},r.a.createElement(o.a,{expandIcon:r.a.createElement(c.a,null)},r.a.createElement(f.a,null,"Experience / Stats")),r.a.createElement(s.a,null,r.a.createElement("table",null,r.a.createElement("tbody",null,r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"All:")),r.a.createElement("td",null,r.a.createElement(u.a,{onClick:function(){t.player.gainHackingExp(h),t.player.gainStrengthExp(h),t.player.gainDefenseExp(h),t.player.gainDexterityExp(h),t.player.gainAgilityExp(h),t.player.gainCharismaExp(h),t.player.gainIntelligenceExp(h),t.player.updateSkillLevels()}},"Tons of exp"),r.a.createElement(u.a,{onClick:function(){t.player.hacking_exp=0,t.player.strength_exp=0,t.player.defense_exp=0,t.player.dexterity_exp=0,t.player.agility_exp=0,t.player.charisma_exp=0,t.player.intelligence_exp=0,t.player.updateSkillLevels()}},"Reset"))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Hacking:")),r.a.createElement("td",null,r.a.createElement(m.a,{label:"hacking",placeholder:"exp",tons:()=>e("hacking",1)(h),add:e("hacking",1),subtract:e("hacking",-1),reset:a("hacking")}))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Strength:")),r.a.createElement("td",null,r.a.createElement(m.a,{label:"strength",placeholder:"exp",tons:()=>e("strength",1)(h),add:e("strength",1),subtract:e("strength",-1),reset:a("strength")}))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Defense:")),r.a.createElement("td",null,r.a.createElement(m.a,{label:"defense",placeholder:"exp",tons:()=>e("defense",1)(h),add:e("defense",1),subtract:e("defense",-1),reset:a("defense")}))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Dexterity:")),r.a.createElement("td",null,r.a.createElement(m.a,{label:"dexterity",placeholder:"exp",tons:()=>e("dexterity",1)(h),add:e("dexterity",1),subtract:e("dexterity",-1),reset:a("dexterity")}))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Agility:")),r.a.createElement("td",null,r.a.createElement(m.a,{label:"agility",placeholder:"exp",tons:()=>e("agility",1)(h),add:e("agility",1),subtract:e("agility",-1),reset:a("agility")}))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Charisma:")),r.a.createElement("td",null,r.a.createElement(m.a,{label:"charisma",placeholder:"exp",tons:()=>e("charisma",1)(h),add:e("charisma",1),subtract:e("charisma",-1),reset:a("charisma")}))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Intelligence:")),r.a.createElement("td",null,r.a.createElement(m.a,{label:"intelligence",placeholder:"exp",tons:()=>e("intelligence",1)(h),add:e("intelligence",1),subtract:e("intelligence",-1),reset:a("intelligence")})),r.a.createElement("td",null,r.a.createElement(u.a,{onClick:function(){0===t.player.intelligence&&(t.player.intelligence=1,t.player.updateSkillLevels())}},"Enable")),r.a.createElement("td",null,r.a.createElement(u.a,{onClick:function(){t.player.intelligence_exp=0,t.player.intelligence=0,t.player.updateSkillLevels()}},"Disable"))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Karma:")),r.a.createElement("td",null,r.a.createElement(m.a,{label:"karma",placeholder:"amt",tons:()=>e("intelligence",1)(1e5),add:n(1),subtract:n(-1),reset:function(){t.player.karma=0}})))))))}},,,function(t,e,n){"use strict";n.d(e,"a",(function(){return S}));var a=n(0),r=n.n(a),i=n(157),o=n(158),s=n(159),l=n(81),c=n.n(l),f=n(1),u=n(8),m=n(130),h=n(133),d=n(26),p=n(1473),g=n(74),y=n(111),b=n(1122),E=n.n(b),v=n(464),k=n.n(v),_=n(1474),w=n(4);function S(t){const[e,n]=Object(a.useState)(w.a.Illuminati);function l(t){return function(n){const a=d.a[e];null==a||isNaN(n)||(a.playerReputation+=n*t)}}function b(t){return function(n){const a=d.a[e];null==a||isNaN(n)||(a.favor+=n*t)}}return r.a.createElement(i.a,{TransitionProps:{unmountOnExit:!0}},r.a.createElement(o.a,{expandIcon:r.a.createElement(c.a,null)},r.a.createElement(f.a,null,"Factions")),r.a.createElement(s.a,null,r.a.createElement("table",null,r.a.createElement("tbody",null,r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Faction:")),r.a.createElement("td",null,r.a.createElement(p.a,null,r.a.createElement(_.a,{id:"factions-select"},"Faction"),r.a.createElement(m.a,{labelId:"factions-select",id:"factions-dropdown",onChange:function(t){n(t.target.value)},value:e,startAdornment:r.a.createElement(r.a.Fragment,null,r.a.createElement(y.a,{onClick:function(){Object.values(w.a).forEach(e=>t.player.receiveInvite(e))},size:"large","arial-label":"receive-all-invitation"},r.a.createElement(E.a,null)),r.a.createElement(y.a,{onClick:function(){t.player.receiveInvite(e)},size:"large","arial-label":"receive-one-invitation"},r.a.createElement(k.a,null)))},Object.values(d.a).map(t=>r.a.createElement(g.a,{key:t.name,value:t.name},t.name)))))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Reputation:")),r.a.createElement("td",null,r.a.createElement(h.a,{label:"reputation",placeholder:"amt",tons:()=>l(1)(1e12),add:l(1),subtract:l(-1),reset:function(){const t=d.a[e];null!=t&&(t.playerReputation=0)}}))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Favor:")),r.a.createElement("td",null,r.a.createElement(h.a,{label:"favor",placeholder:"amt",tons:()=>b(1)(2e3),add:b(1),subtract:b(-1),reset:function(){const t=d.a[e];null!=t&&(t.favor=0)}}))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"All Reputation:")),r.a.createElement("td",null,r.a.createElement(u.a,{onClick:function(){for(const t of Object.keys(d.a))d.a[t].playerReputation=1e12}},"Tons"),r.a.createElement(u.a,{onClick:function(){for(const t of Object.keys(d.a))d.a[t].playerReputation=0}},"Reset"))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"All Favor:")),r.a.createElement("td",null,r.a.createElement(u.a,{onClick:function(){for(const t of Object.keys(d.a))d.a[t].favor=1e12}},"Tons"),r.a.createElement(u.a,{onClick:function(){for(const t of Object.keys(d.a))d.a[t].favor=0}},"Reset")))))))}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return b}));var a=n(1787),r=n(1788),i=n(1479),o=n(1789),s=n(157),l=n(158),c=n(1),f=n(159),u=n(130),m=n(111),h=n(74),d=n(8),p=n(0),g=n.n(p),y=n(12);function b(t){const[e,n]=Object(p.useState)("Augmented Targeting I");return g.a.createElement(s.a,{TransitionProps:{unmountOnExit:!0}},g.a.createElement(l.a,{expandIcon:g.a.createElement(a.a,null)},g.a.createElement(c.a,null,"Augmentations")),g.a.createElement(f.a,null,g.a.createElement(u.a,{onChange:function(t){n(t.target.value)},value:e,startAdornment:g.a.createElement(g.a.Fragment,null,g.a.createElement(m.a,{onClick:function(){for(const e of Object.values(y.a))t.player.queueAugmentation(e)},size:"large"},g.a.createElement(r.a,null)),g.a.createElement(m.a,{onClick:function(){t.player.queueAugmentation(e)},size:"large"},g.a.createElement(i.a,null))),endAdornment:g.a.createElement(g.a.Fragment,null,g.a.createElement(m.a,{onClick:function(){t.player.augmentations=[]},size:"large"},g.a.createElement(o.a,null)))},Object.values(y.a).map(t=>g.a.createElement(h.a,{key:t,value:t},t))),g.a.createElement(d.a,{sx:{display:"block"},onClick:function(){t.player.queuedAugmentations=[]}},"Clear Queued Augmentations")))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var a=n(0),r=n.n(a),i=n(157),o=n(158),s=n(159),l=n(81),c=n.n(l),f=n(1),u=n(8),m=n(612),h=n(356);const d=[1,2,3,4,5,6,7,8,9,10,11,12,13];function p(t){function e(e,n){return function(){if(9===e&&(t.player.hacknetNodes=[]),0!==n)if(t.player.sourceFiles.some(t=>t.n===e))for(let a=0;at.n!==e)}}function n(t){return()=>{for(let n=0;nr.a.createElement("tr",{key:"sf-"+t},r.a.createElement("td",null,r.a.createElement(f.a,null,"SF-",t,":")),r.a.createElement("td",null,r.a.createElement(h.a,null,r.a.createElement(u.a,{onClick:e(t,0)},"0"),r.a.createElement(u.a,{onClick:e(t,1)},"1"),r.a.createElement(u.a,{onClick:e(t,2)},"2"),r.a.createElement(u.a,{onClick:e(t,3)},"3")))))))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var a=n(0),r=n.n(a),i=n(157),o=n(158),s=n(159),l=n(81),c=n.n(l),f=n(1),u=n(8),m=n(130),h=n(65),d=n(74);function p(t){const[e,n]=Object(a.useState)("NUKE.exe");return r.a.createElement(i.a,{TransitionProps:{unmountOnExit:!0}},r.a.createElement(o.a,{expandIcon:r.a.createElement(c.a,null)},r.a.createElement(f.a,null,"Programs")),r.a.createElement(s.a,null,r.a.createElement("table",null,r.a.createElement("tbody",null,r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Program:")),r.a.createElement("td",null,r.a.createElement(m.a,{onChange:function(t){n(t.target.value)},value:e},Object.values(h.a).map(t=>r.a.createElement(d.a,{key:t.name,value:t.name},t.name))))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Add:")),r.a.createElement("td",null,r.a.createElement(u.a,{onClick:function(){t.player.hasProgram(e)||t.player.getHomeComputer().programs.push(e)}},"One"),r.a.createElement(u.a,{onClick:function(){for(const e of Object.keys(h.a))t.player.hasProgram(h.a[e].name)||t.player.getHomeComputer().programs.push(h.a[e].name)}},"All")))))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var a=n(0),r=n.n(a),i=n(157),o=n(158),s=n(159),l=n(81),c=n.n(l),f=n(1),u=n(8),m=n(130),h=n(24),d=n(46),p=n(74);function g(){const[t,e]=Object(a.useState)("home");return r.a.createElement(i.a,{TransitionProps:{unmountOnExit:!0}},r.a.createElement(o.a,{expandIcon:r.a.createElement(c.a,null)},r.a.createElement(f.a,null,"Servers")),r.a.createElement(s.a,null,r.a.createElement("table",null,r.a.createElement("tbody",null,r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Server:")),r.a.createElement("td",{colSpan:2},r.a.createElement(m.a,{id:"dev-servers-dropdown",onChange:function(t){e(t.target.value)},value:t},Object(h.c)().map(t=>r.a.createElement(p.a,{key:t.hostname,value:t.hostname},t.hostname))))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Root:")),r.a.createElement("td",null,r.a.createElement(u.a,{onClick:function(){const e=Object(h.d)(t);null!==e&&e instanceof d.a&&(e.hasAdminRights=!0,e.sshPortOpen=!0,e.ftpPortOpen=!0,e.smtpPortOpen=!0,e.httpPortOpen=!0,e.sqlPortOpen=!0,e.openPortCount=5)}},"Root one")),r.a.createElement("td",null,r.a.createElement(u.a,{onClick:function(){for(const t of Object(h.c)()){if(!(t instanceof d.a))return;t.hasAdminRights=!0,t.sshPortOpen=!0,t.ftpPortOpen=!0,t.smtpPortOpen=!0,t.httpPortOpen=!0,t.sqlPortOpen=!0,t.openPortCount=5}}},"Root all"))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Security:")),r.a.createElement("td",null,r.a.createElement(u.a,{onClick:function(){const e=Object(h.d)(t);null!==e&&e instanceof d.a&&(e.hackDifficulty=e.minDifficulty)}},"Min one")),r.a.createElement("td",null,r.a.createElement(u.a,{onClick:function(){for(const t of Object(h.c)()){if(!(t instanceof d.a))return;t.hackDifficulty=t.minDifficulty}}},"Min all"))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Money:")),r.a.createElement("td",null,r.a.createElement(u.a,{onClick:function(){const e=Object(h.d)(t);null!==e&&e instanceof d.a&&(e.moneyAvailable=0)}},"Min one")),r.a.createElement("td",null,r.a.createElement(u.a,{onClick:function(){for(const t of Object(h.c)()){if(!(t instanceof d.a))return;t.moneyAvailable=0}}},"Min all")),r.a.createElement("td",null,r.a.createElement(u.a,{onClick:function(){const e=Object(h.d)(t);null!==e&&e instanceof d.a&&(e.moneyAvailable=e.moneyMax)}},"Max one")),r.a.createElement("td",null,r.a.createElement(u.a,{onClick:function(){for(const t of Object(h.c)()){if(!(t instanceof d.a))return;t.moneyAvailable=t.moneyMax}}},"Max all")))))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return y}));var a=n(0),r=n.n(a),i=n(157),o=n(158),s=n(159),l=n(81),c=n.n(l),f=n(1),u=n(8),m=n(130),h=n(67),d=n(74),p=n(133),g=n(4);function y(){const[t,e]=Object(a.useState)(g.a.ECorp);function n(e){return function(n){const a=h.a[t];null==a||isNaN(n)||(a.playerReputation+=n*e)}}function l(e){return function(n){const a=h.a[t];null==a||isNaN(n)||(a.favor+=n*e)}}return r.a.createElement(i.a,{TransitionProps:{unmountOnExit:!0}},r.a.createElement(o.a,{expandIcon:r.a.createElement(c.a,null)},r.a.createElement(f.a,null,"Companies")),r.a.createElement(s.a,null,r.a.createElement("table",null,r.a.createElement("tbody",null,r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Company:")),r.a.createElement("td",{colSpan:3},r.a.createElement(m.a,{id:"dev-companies-dropdown",onChange:function(t){e(t.target.value)},value:t},Object.values(h.a).map(t=>r.a.createElement(d.a,{key:t.name,value:t.name},t.name))))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Reputation:")),r.a.createElement("td",null,r.a.createElement(p.a,{label:"reputation",placeholder:"amt",tons:()=>n(1)(1e12),add:n(1),subtract:n(-1),reset:function(){h.a[t].playerReputation=0}}))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Favor:")),r.a.createElement("td",null,r.a.createElement(p.a,{label:"favor",placeholder:"amt",tons:()=>l(1)(2e3),add:l(1),subtract:l(-1),reset:function(){h.a[t].favor=0}}))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"All Reputation:")),r.a.createElement("td",null,r.a.createElement(u.a,{onClick:function(){for(const t of Object.keys(h.a))h.a[t].playerReputation=1e12}},"Tons"),r.a.createElement(u.a,{onClick:function(){for(const t of Object.keys(h.a))h.a[t].playerReputation=0}},"Reset"))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"All Favor:")),r.a.createElement("td",null,r.a.createElement(u.a,{onClick:function(){for(const t of Object.keys(h.a))h.a[t].favor=1e12}},"Tons"),r.a.createElement(u.a,{onClick:function(){for(const t of Object.keys(h.a))h.a[t].favor=0}},"Reset")))))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var a=n(0),r=n.n(a),i=n(1),o=n(157),s=n(158),l=n(159),c=n(81),f=n.n(c),u=n(133);function m(t){const e=t.player.bladeburner;if(null===e)return r.a.createElement(r.a.Fragment,null);function n(n){return function(a){e&&e.changeRank(t.player,a*n)}}function a(t){return function(n){e&&(e.storedCycles+=n*t)}}return r.a.createElement(o.a,{TransitionProps:{unmountOnExit:!0}},r.a.createElement(s.a,{expandIcon:r.a.createElement(f.a,null)},r.a.createElement(i.a,null,"Bladeburner")),r.a.createElement(l.a,null,r.a.createElement("table",null,r.a.createElement("tbody",null,r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(i.a,null,"Rank:")),r.a.createElement("td",null,r.a.createElement(u.a,{label:"rank",placeholder:"amt",tons:function(){e&&e.changeRank(t.player,1e27)},add:n(1),subtract:n(-1),reset:function(){e&&(e.rank=0,e.maxRank=0)}}))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(i.a,null,"Cycles:")),r.a.createElement("td",null,r.a.createElement(u.a,{label:"cycles",placeholder:"amt",tons:function(){e&&(e.storedCycles+=1e27)},add:a(1),subtract:a(-1),reset:function(){e&&(e.storedCycles=0)}})))))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var a=n(0),r=n.n(a),i=n(1),o=n(157),s=n(158),l=n(159),c=n(81),f=n.n(c),u=n(133);function m(t){function e(e){return function(n){t.player.gang&&(t.player.gang.storedCycles+=n*e)}}return r.a.createElement(o.a,{TransitionProps:{unmountOnExit:!0}},r.a.createElement(s.a,{expandIcon:r.a.createElement(f.a,null)},r.a.createElement(i.a,null,"Gang")),r.a.createElement(l.a,null,r.a.createElement("table",null,r.a.createElement("tbody",null,r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(i.a,null,"Cycles:")),r.a.createElement("td",null,r.a.createElement(u.a,{label:"cycles",placeholder:"amt",tons:function(){t.player.gang&&(t.player.gang.storedCycles=1e27)},add:e(1),subtract:e(-1),reset:function(){t.player.gang&&(t.player.gang.storedCycles=0)}})))))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var a=n(0),r=n.n(a),i=n(157),o=n(158),s=n(159),l=n(81),c=n.n(l),f=n(1),u=n(8),m=n(133);function h(t){function e(e){return function(n){t.player.corporation&&(t.player.corporation.funds+=n*e)}}function n(e){return function(n){t.player.corporation&&(t.player.corporation.storedCycles+=n*e)}}return r.a.createElement(i.a,{TransitionProps:{unmountOnExit:!0}},r.a.createElement(o.a,{expandIcon:r.a.createElement(c.a,null)},r.a.createElement(f.a,null,"Corporation")),r.a.createElement(s.a,null,r.a.createElement("table",null,r.a.createElement("tbody",null,r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Funds:")),r.a.createElement("td",null,r.a.createElement(m.a,{label:"set funds",placeholder:"amt",tons:function(){t.player.corporation&&(t.player.corporation.funds=t.player.corporation.funds+1e27)},add:e(1),subtract:e(-1),reset:function(){t.player.corporation&&(t.player.corporation.funds=t.player.corporation.funds-t.player.corporation.funds)}}))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Cycles:")),r.a.createElement("td",null,r.a.createElement(m.a,{label:"cycles",placeholder:"amt",tons:function(){t.player.corporation&&(t.player.corporation.storedCycles=1e27)},add:n(1),subtract:n(-1),reset:function(){t.player.corporation&&(t.player.corporation.storedCycles=0)}}))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(u.a,{onClick:function(){t.player.corporation&&t.player.corporation.divisions.forEach(t=>{Object.keys(t.products).forEach(e=>{const n=t.products[e];if(void 0===n)throw new Error("Impossible product undefined");n.prog=99.9})})}},"Finish products"))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(u.a,{onClick:function(){t.player.corporation&&t.player.corporation.divisions.forEach(t=>{t.sciResearch.qty+=1e10})}},"Tons of research")))))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var a=n(0),r=n.n(a),i=n(157),o=n(158),s=n(159),l=n(81),c=n.n(l),f=n(1),u=n(8),m=n(130),h=n(74),d=n(347),p=n(116);function g(){const[t,e]=Object(a.useState)("Find Largest Prime Factor");return r.a.createElement(i.a,{TransitionProps:{unmountOnExit:!0}},r.a.createElement(o.a,{expandIcon:r.a.createElement(c.a,null)},r.a.createElement(f.a,null,"Coding Contracts")),r.a.createElement(s.a,null,r.a.createElement("table",null,r.a.createElement("tbody",null,r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(u.a,{onClick:d.b},"Generate Random Contract"),r.a.createElement(u.a,{onClick:d.c},"Generate Random Contract on Home Comp"))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(m.a,{onChange:function(t){e(t.target.value)},value:t},Object.values(p.d).map(t=>r.a.createElement(h.a,{key:t.name,value:t.name},t.name))),r.a.createElement(u.a,{onClick:function(){Object(d.a)({problemType:t,server:"home"})}},"Generate Specified Contract Type on Home Comp")))))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return y}));var a=n(0),r=n.n(a),i=n(157),o=n(158),s=n(159),l=n(81),c=n.n(l),f=n(1),u=n(8),m=n(76),h=n(20),d=n(14),p=n(103),g=n(153);function y(){const[t,e]=Object(a.useState)(0),[n,l]=Object(a.useState)("");function y(t){const e=n.replace(/\s/g,"");let a=()=>!0;""!==e&&"all"!==e&&(a=function(t){return e.split(",").includes(t)});for(const e of Object.keys(p.a))if(p.a.hasOwnProperty(e)){const n=p.a[e];n instanceof g.a&&a(n.symbol)&&t(n)}}return r.a.createElement(i.a,{TransitionProps:{unmountOnExit:!0}},r.a.createElement(o.a,{expandIcon:r.a.createElement(c.a,null)},r.a.createElement(f.a,null,"Stock Market")),r.a.createElement(s.a,null,r.a.createElement("table",null,r.a.createElement("tbody",null,r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Symbol:")),r.a.createElement("td",null,r.a.createElement(m.a,{placeholder:"symbol/'all'",onChange:function(t){l(t.target.value)}}))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Price:")),r.a.createElement("td",null,r.a.createElement(m.a,{placeholder:"$$$",onChange:function(t){e(parseFloat(t.target.value))}}),r.a.createElement(u.a,{onClick:function(){isNaN(t)||y(e=>{e.price=t})}},"Set"))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Caps:")),r.a.createElement("td",null,r.a.createElement(u.a,{onClick:function(){const t=[];y(e=>{t.push(r.a.createElement("tr",{key:e.symbol},r.a.createElement("td",null,e.symbol),r.a.createElement("td",{style:{textAlign:"right"}},r.a.createElement(h.a,{money:e.cap}))))}),Object(d.a)(r.a.createElement("table",null,r.a.createElement("tbody",null,r.a.createElement("tr",null,r.a.createElement("th",null,"Stock"),r.a.createElement("th",null,"Price cap")),t)))}},"View stock caps")))))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var a=n(0),r=n.n(a),i=n(157),o=n(158),s=n(159),l=n(81),c=n.n(l),f=n(8),u=n(1),m=n(133);function h(t){function e(e){for(let n=0;ne(1e7),add:e,subtract:e,reset:()=>e(0)})))))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var a=n(0),r=n.n(a),i=n(101),o=n(157),s=n(158),l=n(159),c=n(81),f=n.n(c),u=n(1),m=n(133);function h(){function t(t){return function(e){i.c.storedCycles+=e*t}}function e(t){return function(e){i.c.fragments.forEach(n=>n.highestCharge+=e*t)}}return r.a.createElement(o.a,{TransitionProps:{unmountOnExit:!0}},r.a.createElement(s.a,{expandIcon:r.a.createElement(f.a,null)},r.a.createElement(u.a,null,"Stanek's Gift")),r.a.createElement(l.a,null,r.a.createElement("table",null,r.a.createElement("tbody",null,r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(m.a,{label:"cycles",placeholder:"amt",tons:function(){i.c.storedCycles=1e6},add:t(1),subtract:t(-1),reset:function(){i.c.storedCycles=0}}))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(m.a,{label:"all charge",placeholder:"amt",tons:function(){i.c.fragments.forEach(t=>{t.highestCharge=1e21,t.numCharge=1e21})},add:e(1),subtract:e(-1),reset:function(){i.c.fragments.forEach(t=>{t.highestCharge=0,t.numCharge=0})}})))))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var a=n(0),r=n.n(a),i=n(157),o=n(158),s=n(159),l=n(81),c=n.n(l),f=n(1),u=n(8),m=n(109);function h(t){function e(e){return()=>{t.player.lastUpdate-=e,t.engine._lastUpdate-=e,m.c.saveGame(),setTimeout(()=>location.reload(),1e3)}}return r.a.createElement(i.a,{TransitionProps:{unmountOnExit:!0}},r.a.createElement(o.a,{expandIcon:r.a.createElement(c.a,null)},r.a.createElement(f.a,null,"Time skip")),r.a.createElement(s.a,null,r.a.createElement(u.a,{onClick:e(6e4)},"1 minute"),r.a.createElement(u.a,{onClick:e(36e5)},"1 hour"),r.a.createElement(u.a,{onClick:e(864e5)},"1 day")))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var a=n(0),r=n.n(a),i=n(157),o=n(158),s=n(159),l=n(81),c=n.n(l),f=n(1),u=n(109),m=n(94),h=n(1480),d=n(8),p=n(147);function g(){const t=Object(a.useRef)(null),[e,n]=Object(a.useState)(""),[l,g]=Object(a.useState)(!0),[y,b]=Object(a.useState)(!0),[E,v]=Object(a.useState)(!0);return r.a.createElement(i.a,{TransitionProps:{unmountOnExit:!0}},r.a.createElement(o.a,{expandIcon:r.a.createElement(c.a,null)},r.a.createElement(f.a,null,"Save file")),r.a.createElement(s.a,null,r.a.createElement(d.a,{onClick:function(){if(!(window.File&&window.FileReader&&window.FileList&&window.Blob))return;const e=t.current;if(null===e)throw new Error("import input should not be null");e.click()},startIcon:r.a.createElement(h.a,null),sx:{gridArea:"import"}},"Select save file",r.a.createElement("input",{ref:t,type:"file",hidden:!0,onChange:async function(t){try{const e=await u.c.getImportStringFromFile(t.target.files),a=atob(e);n(a)}catch(t){m.b.emit(t.toString(),m.d.ERROR,5e3)}}})),r.a.createElement("br",null),""!==e&&r.a.createElement(r.a.Fragment,null,r.a.createElement(p.a,{checked:l,onChange:t=>g(t),text:"Restore scripts",tooltip:r.a.createElement(r.a.Fragment,null,"Restore the save file home computer scripts.")}),r.a.createElement("br",null),r.a.createElement(p.a,{checked:y,onChange:t=>b(t),text:"Restore Augmentations",tooltip:r.a.createElement(r.a.Fragment,null,"Restore the save file installed augmentations.")}),r.a.createElement("br",null),r.a.createElement(p.a,{checked:E,onChange:t=>v(t),text:"Restore Source Files",tooltip:r.a.createElement(r.a.Fragment,null,"Restore the save file acquired source files.")}),r.a.createElement("br",null),r.a.createElement(d.a,{onClick:function(){const t=JSON.parse(e);console.log(Object.keys(t))}},"Restore"))))}},,,function(t,e,n){"use strict";n.d(e,"a",(function(){return E}));var a=n(0),r=n.n(a),i=n(157),o=n(158),s=n(159),l=n(81),c=n.n(l),f=n(1),u=n(8),m=n(356),h=n(21),d=n(1142),p=n.n(d),g=n(1141),y=n.n(g),b=n(300);function E(t){const[e,n]=Object(a.useState)(t.player.achievements.map(t=>t.ID));return r.a.createElement(i.a,{TransitionProps:{unmountOnExit:!0}},r.a.createElement(o.a,{expandIcon:r.a.createElement(c.a,null)},r.a.createElement(f.a,null,"Achievements")),r.a.createElement(s.a,null,r.a.createElement("table",null,r.a.createElement("tbody",null,r.a.createElement("tr",null,r.a.createElement("td",null),r.a.createElement("td",null,r.a.createElement(f.a,null,"Achievements:")),r.a.createElement("td",null,r.a.createElement(m.a,null,r.a.createElement(u.a,{onClick:function(){Object.values(b.a).forEach(e=>t.player.giveAchievement(e.ID)),n(t.player.achievements.map(t=>t.ID))}},"Grant All"),r.a.createElement(u.a,{onClick:function(){t.player.achievements=[],n(t.player.achievements.map(t=>t.ID))}},"Clear"),r.a.createElement(u.a,{onClick:function(){t.engine.Counters.achievementsCounter=Number.MAX_VALUE}},"Disable Engine"),r.a.createElement(u.a,{onClick:function(){t.engine.Counters.achievementsCounter=0}},"Enable Engine")))),Object.values(b.a).map(a=>{const i=e.includes(a.ID);return r.a.createElement("tr",{key:"ach-"+a.ID},r.a.createElement("td",null,i?r.a.createElement(h.a,{title:"Achieved"},r.a.createElement(y.a,{color:"primary"})):r.a.createElement(h.a,{title:"Locked"},r.a.createElement(p.a,{color:"secondary"}))),r.a.createElement("td",null,r.a.createElement(h.a,{title:r.a.createElement(r.a.Fragment,null,a.ID,r.a.createElement("br",null),a.Description)},r.a.createElement(f.a,{color:i?"primary":"secondary"},a.Name,":"))),r.a.createElement("td",null,r.a.createElement(m.a,null,r.a.createElement(u.a,{onClick:()=>{return e=a.ID,t.player.giveAchievement(e),void n(t.player.achievements.map(t=>t.ID));var e}},"Grant"),r.a.createElement(u.a,{onClick:()=>{return e=a.ID,t.player.achievements=t.player.achievements.filter(t=>t.ID!==e),void n(t.player.achievements.map(t=>t.ID));var e}},"Clear"))))})))))}},function(t){t.exports=JSON.parse('{"a":{"CYBERSEC":{"ID":"CYBERSEC","Name":"CyberSec","Description":"Join CyberSec."},"NITESEC":{"ID":"NITESEC","Name":"avmnite-02h","Description":"Join NiteSec."},"THE_BLACK_HAND":{"ID":"THE_BLACK_HAND","Name":"I.I.I.I","Description":"Join The Black Hand."},"BITRUNNERS":{"ID":"BITRUNNERS","Name":"run4theh111z","Description":"Join the BitRunners."},"DAEDALUS":{"ID":"DAEDALUS","Name":"fl1ght.exe","Description":"Join Daedalus."},"THE_COVENANT":{"ID":"THE_COVENANT","Name":"The Covenant","Description":"Join The Covenant."},"ILLUMINATI":{"ID":"ILLUMINATI","Name":"Illuminati","Description":"Join the Illuminati."},"BRUTESSH.EXE":{"ID":"BRUTESSH.EXE","Name":"BruteSSH.exe","Description":"Acquire BruteSSH.exe"},"FTPCRACK.EXE":{"ID":"FTPCRACK.EXE","Name":"FTPCrack.exe","Description":"Acquire FTPCrack.exe"},"RELAYSMTP.EXE":{"ID":"RELAYSMTP.EXE","Name":"relaySMTP.exe","Description":"Acquire relaySMTP.exe"},"HTTPWORM.EXE":{"ID":"HTTPWORM.EXE","Name":"HTTPWorm.exe","Description":"Acquire HTTPWorm.exe"},"SQLINJECT.EXE":{"ID":"SQLINJECT.EXE","Name":"SQLInject.exe","Description":"Acquire SQLInject.exe"},"FORMULAS.EXE":{"ID":"FORMULAS.EXE","Name":"Formulas.exe","Description":"Acquire Formulas.exe"},"SF1.1":{"ID":"SF1.1","Name":"Source Genesis","Description":"Acquire SF1.1"},"SF2.1":{"ID":"SF2.1","Name":"Rise of the Underworld","Description":"Acquire SF2.1"},"SF3.1":{"ID":"SF3.1","Name":"Corporatocracy","Description":"Acquire SF3.1"},"SF4.1":{"ID":"SF4.1","Name":"The Singularity","Description":"Acquire SF4.1"},"SF5.1":{"ID":"SF5.1","Name":"Artificial Intelligence","Description":"Acquire SF5.1"},"SF6.1":{"ID":"SF6.1","Name":"Bladeburners","Description":"Acquire SF6.1"},"SF7.1":{"ID":"SF7.1","Name":"Bladeburners 2079","Description":"Acquire SF7.1"},"SF8.1":{"ID":"SF8.1","Name":"Ghost of Wall Street","Description":"Acquire SF8.1"},"SF9.1":{"ID":"SF9.1","Name":"Hacktocracy","Description":"Acquire SF9.1"},"SF10.1":{"ID":"SF10.1","Name":"Digital Carbon","Description":"Acquire SF10.1"},"SF11.1":{"ID":"SF11.1","Name":"The Big Crash","Description":"Acquire SF11.1"},"SF12.1":{"ID":"SF12.1","Name":"The Recursion","Description":"Acquire SF12.1"},"MONEY_1Q":{"ID":"MONEY_1Q","Name":"Here comes the money!","Description":"Have $1Q on your home computer."},"MONEY_M1B":{"ID":"MONEY_M1B","Name":"Massive debt","Description":"Be $1b in debt."},"INSTALL_1":{"ID":"INSTALL_1","Name":"I never asked for this.","Description":"Install your first augmentation."},"INSTALL_100":{"ID":"INSTALL_100","Name":"I asked for this.","Description":"Have 100 augmentation installed at once."},"QUEUE_40":{"ID":"QUEUE_40","Name":"It\'s time to install","Description":"Have 40 augmentation queued at once."},"HACKING_100000":{"ID":"HACKING_100000","Name":"Power Overwhelming","Description":"Achieve 100 000 hacking skill."},"COMBAT_3000":{"ID":"COMBAT_3000","Name":"One punch man","Description":"Achieve 3000 in all combat stats."},"NEUROFLUX_255":{"ID":"NEUROFLUX_255","Name":"Neuroflux is love, Neuroflux is live","Description":"Install Neuroflux Governor level 255"},"NS2":{"ID":"NS2","Name":"Maximum speed!","Description":"Write an ns2 script."},"FROZE":{"ID":"FROZE","Name":"while(true);","Description":"Restart the game using the reload & kill all option because you froze it with an infinite loop."},"RUNNING_SCRIPTS_1000":{"ID":"RUNNING_SCRIPTS_1000","Name":"Need more real life ram","Description":"Run 1000 scripts simultaneously."},"DRAIN_SERVER":{"ID":"DRAIN_SERVER","Name":"Big trouble","Description":"Drain a server of all its money."},"MAX_RAM":{"ID":"MAX_RAM","Name":"Download more ram","Description":"Maximize your home computer ram."},"MAX_CORES":{"ID":"MAX_CORES","Name":"Download more cores?","Description":"Maximize your home computer cores."},"SCRIPTS_30":{"ID":"SCRIPTS_30","Name":"Thank you folders!","Description":"Have 30 scripts on your home computer."},"KARMA_1000000":{"ID":"KARMA_1000000","Name":"Wretched hive of scum and vilany","Description":"Reach -1m karma."},"STOCK_1q":{"ID":"STOCK_1q","Name":"Wolf of wall street.","Description":"Make 1q on the stock market."},"DISCOUNT":{"ID":"DISCOUNT","Name":"Discount!","Description":"Get a discount at Powerhouse Gym by backdooring their server."},"SCRIPT_32GB":{"ID":"SCRIPT_32GB","Name":"You\'ll need upgrade for this one.","Description":"Write a script that costs 32GB per thread."},"FIRST_HACKNET_NODE":{"ID":"FIRST_HACKNET_NODE","Name":"Free money!","Description":"Purchase your first hacknet node."},"30_HACKNET_NODE":{"ID":"30_HACKNET_NODE","Name":"Big network","Description":"Have 30 hacknet nodes."},"MAX_HACKNET_NODE":{"ID":"MAX_HACKNET_NODE","Name":"That\'s the limit","Description":"Maximize a hacknet node."},"HACKNET_NODE_10M":{"ID":"HACKNET_NODE_10M","Name":"The original hacker","Description":"Make 10m from hacknet nodes."},"REPUTATION_10M":{"ID":"REPUTATION_10M","Name":"Well liked","Description":"Reach 10m reputation with a faction."},"DONATION":{"ID":"DONATION","Name":"Donate!","Description":"Unlock donations with a faction."},"TRAVEL":{"ID":"TRAVEL","Name":"World explorer","Description":"Travel anywhere."},"WORKOUT":{"ID":"WORKOUT","Name":"Gains!","Description":"Workout at a gym."},"TOR":{"ID":"TOR","Name":"The Onion Network","Description":"Purchase the TOR router."},"HOSPITALIZED":{"ID":"HOSPITALIZED","Name":"Ouch!","Description":"Go to the hospital."},"GANG":{"ID":"GANG","Name":"Gangster","Description":"Form a gang."},"FULL_GANG":{"ID":"FULL_GANG","Name":"Don","Description":"Recruit all gang members."},"GANG_TERRITORY":{"ID":"GANG_TERRITORY","Name":"Stay out of my territory","Description":"Have 100% of the territory."},"GANG_MEMBER_POWER":{"ID":"GANG_MEMBER_POWER","Name":"One punch guy","Description":"Have a gang member with 10 000 in 1 skill."},"CORPORATION":{"ID":"CORPORATION","Name":"A small 150b loan.","Description":"Create a corporation."},"CORPORATION_BRIBE":{"ID":"CORPORATION_BRIBE","Name":"Lobbying is great!","Description":"Lower your taxes through lobbying."},"CORPORATION_PROD_1000":{"ID":"CORPORATION_PROD_1000","Name":"Streamlined manufacturing","Description":"Have a division with a production multiplier of 1000."},"CORPORATION_EMPLOYEE_3000":{"ID":"CORPORATION_EMPLOYEE_3000","Name":"Small town","Description":"Have a division with 3000 employee."},"CORPORATION_REAL_ESTATE":{"ID":"CORPORATION_REAL_ESTATE","Name":"Own the land","Description":"Expand to the Real Estate division."},"INTELLIGENCE_255":{"ID":"INTELLIGENCE_255","Name":"Smart!","Description":"Reach intelligence 255"},"BLADEBURNER_DIVISION":{"ID":"BLADEBURNER_DIVISION","Name":"Bladeburners","Description":"Join the Bladeburner division."},"BLADEBURNER_OVERCLOCK":{"ID":"BLADEBURNER_OVERCLOCK","Name":"Overclock!","Description":"Reach maximum level of Overclock"},"BLADEBURNER_UNSPENT_100000":{"ID":"BLADEBURNER_UNSPENT_100000","Name":"You should really spend those.","Description":"Have 100 000 unspent bladeburner skill points."},"4S":{"ID":"4S","Name":"4S","Description":"Purchase the 4S market data."},"FIRST_HACKNET_SERVER":{"ID":"FIRST_HACKNET_SERVER","Name":"The improved hacker.","Description":"Purchase your first hacknet server."},"ALL_HACKNET_SERVER":{"ID":"ALL_HACKNET_SERVER","Name":"Full network","Description":"Buy all hacknet servers."},"MAX_HACKNET_SERVER":{"ID":"MAX_HACKNET_SERVER","Name":"That\'s the new limit.","Description":"Maximize a hacknet server."},"HACKNET_SERVER_1B":{"ID":"HACKNET_SERVER_1B","Name":"Not passive anymore","Description":"Make $1b with hacknet servers."},"MAX_CACHE":{"ID":"MAX_CACHE","Name":"What a waste.","Description":"Cap your hashes."},"SLEEVE_8":{"ID":"SLEEVE_8","Name":"You and what army?","Description":"Purchase all duplicate sleeves from The Covenant."},"INDECISIVE":{"ID":"INDECISIVE","Name":"Too many options.","Description":"Spend 1h straight on the bitverse."},"FAST_BN":{"ID":"FAST_BN","Name":"Speed demon.","Description":"Destroy a bitnode in under 2 days."},"CHALLENGE_BN1":{"ID":"CHALLENGE_BN1","Name":"BN1: Challenge","Description":"Destroy BN1 with at most 128GB and 1 core."},"CHALLENGE_BN2":{"ID":"CHALLENGE_BN2","Name":"BN2: Challenge","Description":"Destroy BN2 without forming a gang."},"CHALLENGE_BN3":{"ID":"CHALLENGE_BN3","Name":"BN3: Challenge","Description":"Destroy BN3 without creating corporation."},"CHALLENGE_BN6":{"ID":"CHALLENGE_BN6","Name":"BN6: Challenge","Description":"Destroy BN6 without joining the bladeburner division."},"CHALLENGE_BN7":{"ID":"CHALLENGE_BN7","Name":"BN7: Challenge","Description":"Destroy BN7 without joining the bladeburner division."},"CHALLENGE_BN8":{"ID":"CHALLENGE_BN8","Name":"BN8: Challenge","Description":"Destroy BN8 without purchasing the 4s market data."},"CHALLENGE_BN9":{"ID":"CHALLENGE_BN9","Name":"BN9: Challenge","Description":"Destroy BN9 without using hacknet servers."},"CHALLENGE_BN10":{"ID":"CHALLENGE_BN10","Name":"BN10: Challenge","Description":"Destroy BN10 without using sleeves."},"CHALLENGE_BN12":{"ID":"CHALLENGE_BN12","Name":"BN12: Challenge","Description":"Destroy BN12 50 times."},"BYPASS":{"ID":"BYPASS","Name":"Exploit: bypass","Description":"Circumventing the ram cost of document."},"PROTOTYPETAMPERING":{"ID":"PROTOTYPETAMPERING","Name":"Exploit: prototype tampering","Description":"Tamper with the Numbers prototype."},"UNCLICKABLE":{"ID":"UNCLICKABLE","Name":"Exploit: unclickable","Description":"Click the unclickable."},"UNDOCUMENTEDFUNCTIONCALL":{"ID":"UNDOCUMENTEDFUNCTIONCALL","Name":"Exploit: undocumented","Description":"Call the undocumented function."},"TIMECOMPRESSION":{"ID":"TIMECOMPRESSION","Name":"Exploit: time compression","Description":"Compress time."},"REALITYALTERATION":{"ID":"REALITYALTERATION","Name":"Exploit: reality alteration","Description":"Alter reality."},"N00DLES":{"ID":"N00DLES","Name":"Exploit: noodles","Description":"Harness the power of the noodles."},"EDITSAVEFILE":{"ID":"EDITSAVEFILE","Name":"Exploit: edit","Description":"Acquire the EditSaveFile Source-File -1"},"UNACHIEVABLE":{"ID":"UNACHIEVABLE","Name":"UNACHIEVABLE","Description":"This achievement cannot be unlocked."},"CHALLENGE_BN13":{"ID":"CHALLENGE_BN13","Name":"BN13: Challenge","Description":"Complete BN13 without Stanek\'s Gift."},"DEVMENU":{"ID":"DEVMENU","Name":"Exploit: you\'re not meant to access this","Description":"Open the dev menu."},"RAINBOW":{"ID":"RAINBOW","Name":"Exploit: rainbow","Description":"Make good use of the rainbow."},"TRUE_RECURSION":{"ID":"TRUE_RECURSION","Name":"Exploit: true recursion","Description":"Beat BN1 in megabyteburner 2000."}}}')},,,function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var a=n(0),r=n.n(a),i=n(157),o=n(158),s=n(159),l=n(81),c=n.n(l),f=n(1),u=n(133);function m(t){return r.a.createElement(i.a,{TransitionProps:{unmountOnExit:!0}},r.a.createElement(o.a,{expandIcon:r.a.createElement(c.a,null)},r.a.createElement(f.a,null,"Entropy")),r.a.createElement(s.a,null,r.a.createElement(u.a,{label:"Set entropy",placeholder:"entropy",add:e=>{t.player.entropy+=e,t.player.applyEntropy(t.player.entropy)},subtract:e=>{t.player.entropy-=e,t.player.applyEntropy(t.player.entropy)},tons:()=>{t.player.entropy+=1e12,t.player.applyEntropy(t.player.entropy)},reset:()=>{t.player.entropy=0,t.player.applyEntropy(t.player.entropy)}})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(0),r=n.n(a),i=n(1145),o=n(1147),s=n(1148),l=n(29),c=n(19);function f(){const t=l.b.Player(),e=l.b.Router(),n=Object(a.useState)(!1)[1];function f(){n(t=>!t)}Object(a.useEffect)(()=>{const t=setInterval(f,200);return()=>clearInterval(t)},[]);const u=t.bladeburner;return null===u?r.a.createElement(r.a.Fragment,null):r.a.createElement(c.a,{display:"flex",flexDirection:"column"},r.a.createElement(c.a,{sx:{display:"grid",gridTemplateColumns:"4fr 8fr",p:1}},r.a.createElement(i.a,{bladeburner:u,player:t,router:e}),r.a.createElement(o.a,{bladeburner:u,player:t})),r.a.createElement(s.a,{bladeburner:u,player:t}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return b}));var a=n(0),r=n.n(a),i=n(22),o=n(59),s=n(20),l=n(5),c=n(26),f=n(105),u=n(1146),m=n(1),h=n(21),d=n(19),p=n(8),g=n(45),y=n(4);function b(t){const[e,n]=Object(a.useState)(!1),b=Object(a.useState)(!1)[1],E=t.bladeburner.rank>=o.a.RankNeededForFaction;return Object(a.useEffect)(()=>{const t=setInterval(()=>b(t=>!t),1e3);return()=>clearInterval(t)},[]),r.a.createElement(g.a,{sx:{p:1,overflowY:"auto",overflowX:"hidden",wordBreak:"break-all"}},r.a.createElement(d.a,{sx:{display:"flex",flexDirection:"column",gap:1,maxHeight:"60vh"}},r.a.createElement(d.a,{sx:{alignSelf:"flex-start",width:"100%"}},r.a.createElement(p.a,{onClick:()=>n(!0),sx:{width:"50%"}},"Travel"),r.a.createElement(h.a,{title:E?"":r.a.createElement(m.a,null,"Rank 25 required.")},r.a.createElement("span",null,r.a.createElement(p.a,{disabled:!E,onClick:function(){if(!E)return;const e=c.a[y.a.Bladeburners];e.isMember||Object(f.d)(e),t.router.toFaction(e)},sx:{width:"50%"}},"Faction"))),r.a.createElement(u.a,{open:e,onClose:()=>n(!1),bladeburner:t.bladeburner})),r.a.createElement(d.a,{display:"flex"},r.a.createElement(h.a,{title:r.a.createElement(m.a,null,"Your rank within the Bladeburner division.")},r.a.createElement(m.a,null,"Rank: ",Object(i.f)(t.bladeburner.rank,2)))),r.a.createElement("br",null),r.a.createElement(d.a,{display:"flex"},r.a.createElement(h.a,{title:r.a.createElement(m.a,null,"Performing actions will use up your stamina.",r.a.createElement("br",null),r.a.createElement("br",null),"Your max stamina is determined primarily by your agility stat.",r.a.createElement("br",null),r.a.createElement("br",null),"Your stamina gain rate is determined by both your agility and your max stamina. Higher max stamina leads to a higher gain rate.",r.a.createElement("br",null),r.a.createElement("br",null),"Once your stamina falls below 50% of its max value, it begins to negatively affect the success rate of your contracts/operations. This penalty is shown in the overview panel. If the penalty is 15%, then this means your success rate would be multipled by 85% (100 - 15).",r.a.createElement("br",null),r.a.createElement("br",null),"Your max stamina and stamina gain rate can also be increased by training, or through skills and Augmentation upgrades.")},r.a.createElement(m.a,null,"Stamina: ",Object(i.f)(t.bladeburner.stamina,3)," / ",Object(i.f)(t.bladeburner.maxStamina,3)))),r.a.createElement("br",null),r.a.createElement(m.a,null,"Stamina Penalty: ",Object(i.f)(100*(1-t.bladeburner.calculateStaminaPenalty()),1),"%"),r.a.createElement("br",null),r.a.createElement(m.a,null,"Team Size: ",Object(i.f)(t.bladeburner.teamSize,0)),r.a.createElement(m.a,null,"Team Members Lost: ",Object(i.f)(t.bladeburner.teamLost,0)),r.a.createElement("br",null),r.a.createElement(m.a,null,"Num Times Hospitalized: ",t.bladeburner.numHosp),r.a.createElement(m.a,null,"Money Lost From Hospitalizations: ",r.a.createElement(s.a,{money:t.bladeburner.moneyLost})),r.a.createElement("br",null),r.a.createElement(m.a,null,"Current City: ",t.bladeburner.city),r.a.createElement(d.a,{display:"flex"},r.a.createElement(h.a,{title:r.a.createElement(m.a,null,"This is your Bladeburner division's estimate of how many Synthoids exist in your current city. An accurate population count increases success rate estimates.")},r.a.createElement(m.a,null,"Est. Synthoid Population: ",l.a.formatPopulation(t.bladeburner.getCurrentCity().popEst)))),r.a.createElement("br",null),r.a.createElement(d.a,{display:"flex"},r.a.createElement(h.a,{title:r.a.createElement(m.a,null,"This is your Bladeburner divison's estimate of how many Synthoid communities exist in your current city.")},r.a.createElement(m.a,null,"Synthoid Communities: ",Object(i.f)(t.bladeburner.getCurrentCity().comms,0)))),r.a.createElement("br",null),r.a.createElement(d.a,{display:"flex"},r.a.createElement(h.a,{title:r.a.createElement(m.a,null,"The city's chaos level due to tensions and conflicts between humans and Synthoids. Having too high of a chaos level can make contracts and operations harder.")},r.a.createElement(m.a,null,"City Chaos: ",Object(i.f)(t.bladeburner.getCurrentCity().chaos)))),r.a.createElement("br",null),t.bladeburner.storedCycles/o.a.CyclesPerSecond*1e3>15e3&&r.a.createElement(r.a.Fragment,null,r.a.createElement(d.a,{display:"flex"},r.a.createElement(h.a,{title:r.a.createElement(m.a,null,"You gain bonus time while offline or when the game is inactive (e.g. when the tab is throttled by browser). Bonus time makes the Bladeburner mechanic progress faster, up to 5x the normal speed.")},r.a.createElement(m.a,null,"Bonus time:"," ",Object(i.d)(t.bladeburner.storedCycles/o.a.CyclesPerSecond*1e3)))),r.a.createElement("br",null)),r.a.createElement(m.a,null,"Skill Points: ",Object(i.f)(t.bladeburner.skillPoints,0)),r.a.createElement("br",null),r.a.createElement(m.a,null,"Aug. Success Chance mult: ",Object(i.f)(100*t.player.bladeburner_success_chance_mult,1),"%",r.a.createElement("br",null),"Aug. Max Stamina mult: ",Object(i.f)(100*t.player.bladeburner_max_stamina_mult,1),"%",r.a.createElement("br",null),"Aug. Stamina Gain mult: ",Object(i.f)(100*t.player.bladeburner_stamina_gain_mult,1),"%",r.a.createElement("br",null),"Aug. Field Analysis mult: ",Object(i.f)(100*t.player.bladeburner_analysis_mult,1),"%")))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var a=n(0),r=n.n(a),i=n(465),o=n(38),s=n(15),l=n(6),c=n(1),f=n(8);function u(t){function e(e){t.bladeburner.city=e,t.onClose()}return r.a.createElement(o.a,{open:t.open,onClose:t.onClose},r.a.createElement(r.a.Fragment,null,r.a.createElement(c.a,null,"Travel to a different city for your Bladeburner activities. This does not cost any money. The city you are in for your Bladeburner duties does not affect your location in the game otherwise."),l.a.DisableASCIIArt?Object.values(s.a).map(t=>r.a.createElement(f.a,{key:t,onClick:()=>e(t)},t)):r.a.createElement(i.a,{currentCity:t.bladeburner.city,onTravel:t=>e(t)})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var a=n(0),r=n.n(a),i=n(27),o=n(45),s=n(248),l=n(97),c=n(19),f=n(1),u=n(76),m=n(121),h=n(144);const d=Object(m.a)(t=>Object(h.a)({textfield:{margin:t.spacing(0),width:"100%"},input:{backgroundColor:t.colors.backgroundsecondary},nopadding:{padding:t.spacing(0)},preformatted:{whiteSpace:"pre-wrap",margin:t.spacing(0)},list:{padding:t.spacing(0),height:"100%"}}));function p(t){return r.a.createElement(l.a,{sx:{p:0}},r.a.createElement(f.a,null,t.content))}function g(t){const e=d(),[n,s]=Object(a.useState)(""),l=Object(a.useState)(!1)[1],m=Object(a.useRef)(null);const[h,p]=Object(a.useState)(t.bladeburner.consoleHistory.length);function g(){l(t=>!t)}return Object(a.useEffect)(()=>{const t=setInterval(g,1e3);return()=>{clearInterval(t)}},[]),r.a.createElement(o.a,{sx:{p:1}},r.a.createElement(c.a,{sx:{height:"60vh",paddingBottom:"8px",display:"flex",alignItems:"stretch",whiteSpace:"pre-wrap"},onClick:function(){m.current&&m.current.focus()}},r.a.createElement(c.a,null,r.a.createElement(y,{entries:[...t.bladeburner.consoleLogs]}))),r.a.createElement(u.a,{classes:{root:e.textfield},autoFocus:!0,tabIndex:1,type:"text",inputRef:m,value:n,onChange:function(t){s(t.target.value)},onKeyDown:function(e){e.key===i.a.ENTER&&(e.preventDefault(),n.length>0&&(t.bladeburner.postToConsole("> "+n),t.bladeburner.executeConsoleCommands(t.player,n),p(t.bladeburner.consoleHistory.length),s("")));const a=t.bladeburner.consoleHistory;if(e.key===i.a.UP_ARROW){let t=h;const n=a.length;if(0===n)return;(t<0||t>n)&&p(n),0!==t&&(t-=1),p(t);const r=a[t];e.currentTarget.value=r,s(r)}if(e.key===i.a.DOWN_ARROW){const t=h,n=a.length;if(0==n)return;if((t<0||t>n)&&p(n),t==n||t==n-1)p(n),e.currentTarget.value="";else{p(h+1);const t=a[h+1];e.currentTarget.value=t,s(t)}}},InputProps:{className:e.input,startAdornment:r.a.createElement(r.a.Fragment,null,r.a.createElement(f.a,null,"> ")),spellCheck:!1}}))}function y({entries:t}){const e=Object(a.useRef)(null);return Object(a.useEffect)(()=>{e.current&&(e.current.scrollTop=e.current.scrollHeight)},[t.length]),r.a.createElement(s.a,{sx:{height:"100%",overflow:"auto",p:1},ref:e},t&&t.map((t,e)=>r.a.createElement(p,{key:e,content:t})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var a=n(0),r=n.n(a),i=n(1149),o=n(1153),s=n(1159),l=n(1164),c=n(1168),f=n(503),u=n(216),m=n(19);function h(t){const[e,n]=r.a.useState(0);return r.a.createElement(r.a.Fragment,null,r.a.createElement(f.a,{variant:"fullWidth",value:e,onChange:function(t,e){n(e)}},r.a.createElement(u.a,{label:"General"}),r.a.createElement(u.a,{label:"Contracts"}),r.a.createElement(u.a,{label:"Operations"}),r.a.createElement(u.a,{label:"BlackOps"}),r.a.createElement(u.a,{label:"Skills"})),r.a.createElement(m.a,{sx:{p:1}},0===e&&r.a.createElement(i.a,{bladeburner:t.bladeburner,player:t.player}),1===e&&r.a.createElement(o.a,{bladeburner:t.bladeburner,player:t.player}),2===e&&r.a.createElement(s.a,{bladeburner:t.bladeburner,player:t.player}),3===e&&r.a.createElement(l.a,{bladeburner:t.bladeburner,player:t.player}),4===e&&r.a.createElement(c.a,{bladeburner:t.bladeburner})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var a=n(0),r=n(1150),i=n(1);function o(t){return a.createElement(a.Fragment,null,a.createElement(i.a,null,"These are generic actions that will assist you in your Bladeburner duties."),a.createElement(r.a,{bladeburner:t.bladeburner,player:t.player}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(0),r=n.n(a),i=n(1151),o=n(259);function s(t){const e=[];for(const t of Object.keys(o.a))o.a.hasOwnProperty(t)&&e.push(o.a[t]);return r.a.createElement(r.a.Fragment,null,e.map(e=>r.a.createElement(i.a,{key:e.name,bladeburner:t.bladeburner,action:e,player:t.player})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var a=n(0),r=n.n(a),i=n(42),o=n(253),s=n(22),l=n(1152),c=n(166),f=n(372),u=n(1),m=n(19),h=n(45);function d(t){const e=Object(a.useState)(!1)[1];const n=t.action.name===t.bladeburner.action.name,d=Math.min(t.bladeburner.actionTimeCurrent+t.bladeburner.actionTimeOverflow,t.bladeburner.actionTimeToComplete),p=function(){switch(t.action.name){case"Training":case"Field Analysis":return 30;case"Diplomacy":case"Hyperbolic Regeneration Chamber":case"Incite Violence":return 60;case"Recruitment":return t.bladeburner.getRecruitmentTime(t.player)}return-1}(),g="Recruitment"===t.action.name?Math.max(0,Math.min(t.bladeburner.getRecruitmentSuccessChance(t.player),1)):-1,y=l.a[t.action.name];if(void 0===y)throw new Error("Cannot find data for "+t.action.name);return r.a.createElement(h.a,{sx:{my:1,p:1}},n?r.a.createElement(r.a.Fragment,null,r.a.createElement(c.a,{value:t.action.name}),r.a.createElement(u.a,null,"(IN PROGRESS - ",Object(s.f)(d,0)," /"," ",Object(s.f)(t.bladeburner.actionTimeToComplete,0),")"),r.a.createElement(u.a,null,Object(o.a)({progress:d/t.bladeburner.actionTimeToComplete}))):r.a.createElement(m.a,{display:"flex",flexDirection:"row",alignItems:"center"},r.a.createElement(c.a,{value:t.action.name}),r.a.createElement(f.a,{bladeburner:t.bladeburner,type:i.a[t.action.name],name:t.action.name,rerender:function(){e(t=>!t)}})),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(u.a,null,y.desc),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(u.a,null,"Time Required: ",Object(s.d)(1e3*p),-1!==g&&r.a.createElement(r.a.Fragment,null,r.a.createElement("br",null),"Estimated success chance: ",Object(s.f)(100*g,1),"%")))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(0),r=n.n(a);const i={Training:{desc:r.a.createElement(r.a.Fragment,null,"Improve your abilities at the Bladeburner unit's specialized training center. Doing this gives experience for all combat stats and also increases your max stamina.")},"Field Analysis":{desc:r.a.createElement(r.a.Fragment,null,"Mine and analyze Synthoid-related data. This improves the Bladeburner unit's intelligence on Synthoid locations and activities. Completing this action will improve the accuracy of your Synthoid population estimated in the current city.",r.a.createElement("br",null),r.a.createElement("br",null),"Does NOT require stamina.")},Recruitment:{desc:r.a.createElement(r.a.Fragment,null,"Attempt to recruit members for your Bladeburner team. These members can help you conduct operations.",r.a.createElement("br",null),r.a.createElement("br",null),"Does NOT require stamina.")},Diplomacy:{desc:r.a.createElement(r.a.Fragment,null,"Improve diplomatic relations with the Synthoid population. Completing this action will reduce the Chaos level in your current city.",r.a.createElement("br",null),r.a.createElement("br",null),"Does NOT require stamina.")},"Hyperbolic Regeneration Chamber":{desc:r.a.createElement(r.a.Fragment,null,"Enter cryogenic stasis using the Bladeburner division's hi-tech Regeneration Chamber. This will slowly heal your wounds and slightly increase your stamina.",r.a.createElement("br",null),r.a.createElement("br",null))},"Incite Violence":{desc:r.a.createElement(r.a.Fragment,null,"Purposefully stir trouble in the synthoid community in order to gain a political edge. This will generate additional contracts and operations, at the cost of increased Chaos.")}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var a=n(0),r=n(1154),i=n(1);function o(t){return a.createElement(a.Fragment,null,a.createElement(i.a,null,"Complete contracts in order to increase your Bladeburner rank and earn money. Failing a contract will cause you to lose HP, which can lead to hospitalization.",a.createElement("br",null),a.createElement("br",null),"You can unlock higher-level contracts by successfully completing them. Higher-level contracts are more difficult, but grant more rank, experience, and money."),a.createElement(r.a,{bladeburner:t.bladeburner,player:t.player}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var a=n(0),r=n.n(a),i=n(1155);function o(t){const e=Object.keys(t.bladeburner.contracts),n=t.bladeburner.contracts;return r.a.createElement(r.a.Fragment,null,e.map(e=>r.a.createElement(i.a,{key:e,bladeburner:t.bladeburner,action:n[e],player:t.player})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var a=n(0),r=n.n(a),i=n(42),o=n(253),s=n(22),l=n(1156),c=n(466),f=n(166),u=n(614),m=n(617),h=n(372),d=n(1),p=n(45);function g(t){const e=Object(a.useState)(!1)[1];function n(){e(t=>!t)}const g=t.bladeburner.action.type===i.a.Contract&&t.action.name===t.bladeburner.action.name,y=Math.min(t.bladeburner.actionTimeCurrent+t.bladeburner.actionTimeOverflow,t.bladeburner.actionTimeToComplete),b=t.action.getActionTime(t.bladeburner,t.player),E=l.a[t.action.name];if(void 0===E)throw new Error("Cannot find data for "+t.action.name);return r.a.createElement(p.a,{sx:{my:1,p:1}},g?r.a.createElement(r.a.Fragment,null,r.a.createElement(d.a,null,r.a.createElement(f.a,{value:t.action.name})," (IN PROGRESS - ",Object(s.f)(y,0)," /"," ",Object(s.f)(t.bladeburner.actionTimeToComplete,0),")"),r.a.createElement(d.a,null,Object(o.a)({progress:y/t.bladeburner.actionTimeToComplete}))):r.a.createElement(r.a.Fragment,null,r.a.createElement(f.a,{value:t.action.name}),r.a.createElement(h.a,{bladeburner:t.bladeburner,type:i.a.Contract,name:t.action.name,rerender:n})),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(u.a,{action:t.action,bladeburner:t.bladeburner,isActive:g,rerender:n}),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(d.a,null,E.desc,r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(c.a,{action:t.action,bladeburner:t.bladeburner}),r.a.createElement("br",null),"Time Required: ",Object(s.d)(1e3*b),r.a.createElement("br",null),"Contracts remaining: ",Math.floor(t.action.count),r.a.createElement("br",null),"Successes: ",t.action.successes,r.a.createElement("br",null),"Failures: ",t.action.failures),r.a.createElement("br",null),r.a.createElement(m.a,{rerender:n,action:t.action}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(0),r=n.n(a);const i={Tracking:{desc:r.a.createElement(r.a.Fragment,null,"Identify and locate Synthoids. This contract involves reconnaissance and information-gathering ONLY. Do NOT engage. Stealth is of the utmost importance.",r.a.createElement("br",null),r.a.createElement("br",null),"Successfully completing Tracking contracts will slightly improve your Synthoid population estimate for whatever city you are currently in.")},"Bounty Hunter":{desc:r.a.createElement(r.a.Fragment,null,"Hunt down and capture fugitive Synthoids. These Synthoids are wanted alive.",r.a.createElement("br",null),r.a.createElement("br",null),"Successfully completing a Bounty Hunter contract will lower the population in your current city, and will also increase its chaos level.")},Retirement:{desc:r.a.createElement(r.a.Fragment,null,"Hunt down and retire (kill) rogue Synthoids.",r.a.createElement("br",null),r.a.createElement("br",null),"Successfully completing a Retirement contract will lower the population in your current city, and will also increase its chaos level.")}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(0),r=n.n(a),i=n(613),o=n(1),s=n(21);function l(){return r.a.createElement(s.a,{title:r.a.createElement(o.a,null,"This action involves stealth")},i.b)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(0),r=n.n(a),i=n(613),o=n(1),s=n(21);function l(){return r.a.createElement(s.a,{title:r.a.createElement(o.a,null,"This action involves retirement")},i.a)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var a=n(0),r=n(1160),i=n(1);function o(t){return a.createElement(a.Fragment,null,a.createElement(i.a,null,"Carry out operations for the Bladeburner division. Failing an operation will reduce your Bladeburner rank. It will also cause you to lose HP, which can lead to hospitalization. In general, operations are harder and more punishing than contracts, but are also more rewarding.",a.createElement("br",null),a.createElement("br",null),"Operations can affect the chaos level and Synthoid population of your current city. The exact effects vary between different Operations.",a.createElement("br",null),a.createElement("br",null),"For operations, you can use a team. You must first recruit team members. Having a larger team will improve your chances of success.",a.createElement("br",null),a.createElement("br",null),"You can unlock higher-level operations by successfully completing them. Higher-level operations are more difficult, but grant more rank and experience."),a.createElement(r.a,{bladeburner:t.bladeburner,player:t.player}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var a=n(0),r=n.n(a),i=n(1161);function o(t){const e=Object.keys(t.bladeburner.operations),n=t.bladeburner.operations;return r.a.createElement(r.a.Fragment,null,e.map(e=>r.a.createElement(i.a,{key:e,bladeburner:t.bladeburner,action:n[e],player:t.player})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return y}));var a=n(0),r=n.n(a),i=n(42),o=n(253),s=n(22),l=n(466),c=n(614),f=n(617),u=n(372),m=n(618),h=n(1163),d=n(166),p=n(1),g=n(45);function y(t){const e=Object(a.useState)(!1)[1];function n(){e(t=>!t)}const y=t.bladeburner.action.type===i.a.Operation&&t.action.name===t.bladeburner.action.name,b=Math.min(t.bladeburner.actionTimeCurrent+t.bladeburner.actionTimeOverflow,t.bladeburner.actionTimeToComplete),E=t.action.getActionTime(t.bladeburner,t.player),v=h.a[t.action.name];if(void 0===v)throw new Error("Cannot find data for "+t.action.name);return r.a.createElement(g.a,{sx:{my:1,p:1}},y?r.a.createElement(r.a.Fragment,null,r.a.createElement(p.a,null,r.a.createElement(d.a,{value:t.action.name})," (IN PROGRESS - ",Object(s.f)(b,0)," /"," ",Object(s.f)(t.bladeburner.actionTimeToComplete,0),")"),r.a.createElement(p.a,null,Object(o.a)({progress:b/t.bladeburner.actionTimeToComplete}))):r.a.createElement(r.a.Fragment,null,r.a.createElement(d.a,{value:t.action.name}),r.a.createElement(u.a,{bladeburner:t.bladeburner,type:i.a.Operation,name:t.action.name,rerender:n}),r.a.createElement(m.a,{action:t.action,bladeburner:t.bladeburner})),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(c.a,{action:t.action,bladeburner:t.bladeburner,isActive:y,rerender:n}),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(p.a,null,v.desc,r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(l.a,{action:t.action,bladeburner:t.bladeburner}),r.a.createElement("br",null),"Time Required: ",Object(s.d)(1e3*E),r.a.createElement("br",null),"Operations remaining: ",Math.floor(t.action.count),r.a.createElement("br",null),"Successes: ",t.action.successes,r.a.createElement("br",null),"Failures: ",t.action.failures),r.a.createElement("br",null),r.a.createElement(f.a,{rerender:n,action:t.action}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(0),r=n.n(a),i=n(14),o=n(38),s=n(1),l=n(8),c=n(76);function f(t){const[e,n]=Object(a.useState)();return r.a.createElement(o.a,{open:t.open,onClose:t.onClose},r.a.createElement(s.a,null,"Enter the amount of team members you would like to take on this Op. If you do not have the specified number of team members, then as many as possible will be used. Note that team members may be lost during operations."),r.a.createElement(c.a,{autoFocus:!0,type:"number",placeholder:"Team size",value:e,onChange:function(e){const a=parseFloat(e.target.value);a>t.bladeburner.teamSize?n(t.bladeburner.teamSize):n(a)}}),r.a.createElement(l.a,{sx:{mx:2},onClick:function(){if(void 0===e)return;const n=Math.round(e);isNaN(n)||n<0?Object(i.a)("Invalid value entered for number of Team Members (must be numeric, positive)"):t.action.teamCount=n,t.onClose()}},"Confirm"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(0),r=n.n(a);const i={Investigation:{desc:r.a.createElement(r.a.Fragment,null,"As a field agent, investigate and identify Synthoid populations, movements, and operations.",r.a.createElement("br",null),r.a.createElement("br",null),"Successful Investigation ops will increase the accuracy of your synthoid data.",r.a.createElement("br",null),r.a.createElement("br",null),"You will NOT lose HP from failed Investigation ops.")},"Undercover Operation":{desc:r.a.createElement(r.a.Fragment,null,"Conduct undercover operations to identify hidden and underground Synthoid communities and organizations.",r.a.createElement("br",null),r.a.createElement("br",null),"Successful Undercover ops will increase the accuracy of your synthoid data.")},"Sting Operation":{desc:r.a.createElement(r.a.Fragment,null,"Conduct a sting operation to bait and capture particularly notorious Synthoid criminals.")},Raid:{desc:r.a.createElement(r.a.Fragment,null,"Lead an assault on a known Synthoid community. Note that there must be an existing Synthoid community in your current city in order for this Operation to be successful.")},"Stealth Retirement Operation":{desc:r.a.createElement(r.a.Fragment,null,"Lead a covert operation to retire Synthoids. The objective is to complete the task without drawing any attention. Stealth and discretion are key.")},Assassination:{desc:r.a.createElement(r.a.Fragment,null,"Assassinate Synthoids that have been identified as important, high-profile social and political leaders in the Synthoid communities.")}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(0),r=n(1165),i=n(1),o=n(4);function s(t){return a.createElement(a.Fragment,null,a.createElement(i.a,null,"Black Operations (Black Ops) are special, one-time covert operations. Each Black Op must be unlocked successively by completing the one before it.",a.createElement("br",null),a.createElement("br",null),a.createElement("b",null,"Your ultimate goal to climb through the ranks of ",o.a.Bladeburners," is to complete all of the Black Ops."),a.createElement("br",null),a.createElement("br",null),"Like normal operations, you may use a team for Black Ops. Failing a black op will incur heavy HP and rank losses."),a.createElement(r.a,{bladeburner:t.bladeburner,player:t.player}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(0),r=n.n(a),i=n(270),o=n(1166);function s(t){let e=[];for(const t of Object.keys(i.a))i.a.hasOwnProperty(t)&&e.push(i.a[t]);return e.sort((function(t,e){return t.reqdRank-e.reqdRank})),e=e.filter((n,a)=>!(null==t.bladeburner.blackops[e[a].name]&&0!==a&&null==t.bladeburner.blackops[e[a-1].name])),e=e.reverse(),r.a.createElement(r.a.Fragment,null,e.map(e=>r.a.createElement(o.a,{key:e.name,bladeburner:t.bladeburner,action:e,player:t.player})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var a=n(0),r=n.n(a),i=n(22),o=n(42),s=n(253),l=n(618),c=n(1167),f=n(166),u=n(466),m=n(372),h=n(1),d=n(45);function p(t){const e=Object(a.useState)(!1)[1];if(null!=t.bladeburner.blackops[t.action.name])return r.a.createElement(d.a,{sx:{my:1,p:1}},r.a.createElement(h.a,null,t.action.name," (COMPLETED)"));const n=t.bladeburner.action.type===o.a.BlackOperation&&t.action.name===t.bladeburner.action.name,p=t.action.getActionTime(t.bladeburner,t.player),g=t.bladeburner.rank>=t.action.reqdRank,y=Math.min(t.bladeburner.actionTimeCurrent+t.bladeburner.actionTimeOverflow,t.bladeburner.actionTimeToComplete),b=c.a[t.action.name];if(void 0===b)throw new Error("Cannot find data for "+t.action.name);return r.a.createElement(d.a,{sx:{my:1,p:1}},n?r.a.createElement(r.a.Fragment,null,r.a.createElement(r.a.Fragment,null,r.a.createElement(f.a,{value:t.action.name}),r.a.createElement(h.a,null,"(IN PROGRESS - ",Object(i.f)(y,0)," /"," ",Object(i.f)(t.bladeburner.actionTimeToComplete,0),")"),r.a.createElement(h.a,null,Object(s.a)({progress:y/t.bladeburner.actionTimeToComplete})))):r.a.createElement(r.a.Fragment,null,r.a.createElement(f.a,{value:t.action.name}),r.a.createElement(m.a,{bladeburner:t.bladeburner,type:o.a.BlackOperation,name:t.action.name,rerender:function(){e(t=>!t)}}),r.a.createElement(l.a,{action:t.action,bladeburner:t.bladeburner})),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(h.a,null,b.desc),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(h.a,{color:g?"primary":"error"},"Required Rank: ",Object(i.f)(t.action.reqdRank,0)),r.a.createElement("br",null),r.a.createElement(h.a,null,r.a.createElement(u.a,{action:t.action,bladeburner:t.bladeburner}),r.a.createElement("br",null),"Time Required: ",Object(i.d)(1e3*p)))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(0),r=n.n(a),i=n(4),o=n(15),s=n(57);const l={[s.a.OperationTyphoon]:{desc:r.a.createElement(r.a.Fragment,null,"Obadiah Zenyatta is the leader of a RedWater PMC. It has long been known among the intelligence community that Zenyatta, along with the rest of the PMC, is a Synthoid.",r.a.createElement("br",null),r.a.createElement("br",null),"The goal of ",s.a.OperationTyphoon," is to find and eliminate Zenyatta and RedWater by any means necessary. After the task is completed, the actions must be covered up from the general public.")},[s.a.OperationZero]:{desc:r.a.createElement(r.a.Fragment,null,"AeroCorp is one of the world's largest defense contractors. Its leader, Steve Watataki, is thought to be a supporter of Synthoid rights. He must be removed.",r.a.createElement("br",null),r.a.createElement("br",null),"The goal of ",s.a.OperationZero," is to covertly infiltrate AeroCorp and uncover any incriminating evidence or information against Watataki that will cause him to be removed from his position at AeroCorp. Incriminating evidence can be fabricated as a last resort. Be warned that AeroCorp has some of the most advanced security measures in the world.")},[s.a.OperationX]:{desc:r.a.createElement(r.a.Fragment,null,"We have recently discovered an underground publication group called Samizdat. Even though most of their publications are nonsensical conspiracy theories, the average human is gullible enough to believe them. Many of their works discuss Synthoids and pose a threat to society. The publications are spreading rapidly in China and other Eastern countries.",r.a.createElement("br",null),r.a.createElement("br",null),"Samizdat has done a good job of keeping hidden and anonymous. However, we've just received intelligence that their base of operations is in ",o.a.Ishima,"'s underground sewer systems. Your task is to investigate the sewer systems, and eliminate Samizdat. They must never publish anything again.")},[s.a.OperationTitan]:{desc:r.a.createElement(r.a.Fragment,null,"Several months ago Titan Laboratories' Bioengineering department was infiltrated by Synthoids. As far as we know, Titan Laboratories' management has no knowledge about this. We don't know what the Synthoids are up to, but the research that they could be conducting using Titan Laboraties' vast resources is potentially very dangerous.",r.a.createElement("br",null),r.a.createElement("br",null),"Your goal is to enter and destroy the Bioengineering department's facility in ",o.a.Aevum,". The task is not just to retire the Synthoids there, but also to destroy any information or research at the facility that is relevant to the Synthoids and their goals.")},[s.a.OperationAres]:{desc:r.a.createElement(r.a.Fragment,null,"One of our undercover agents, Agent Carter, has informed us of a massive weapons deal going down in Dubai between rogue Russian militants and a radical Synthoid community. These weapons are next-gen plasma and energy weapons. It is critical for the safety of humanity that this deal does not happen.",r.a.createElement("br",null),r.a.createElement("br",null),"Your task is to intercept the deal. Leave no survivors.")},[s.a.OperationArchangel]:{desc:r.a.createElement(r.a.Fragment,null,"Our analysts have discovered that the popular Red Rabbit brothel in Amsterdam is run and 'staffed' by MK-VI Synthoids. Intelligence suggests that the profit from this brothel is used to fund a large black market arms trafficking operation.",r.a.createElement("br",null),r.a.createElement("br",null),"The goal of this operation is to take out the leaders that are running the Red Rabbit brothel. Try to limit the number of other casualties, but do what you must to complete the mission.")},[s.a.OperationJuggernaut]:{desc:r.a.createElement(r.a.Fragment,null,"The CIA has just encountered a new security threat. A new criminal group, lead by a shadowy operative who calls himself Juggernaut, has been smuggling drugs and weapons (including suspected bioweapons) into"," ",o.a.Sector12,". We also have reason to believe they tried to break into one of Universal Energy's facilities in order to cause a city-wide blackout. The CIA suspects that Juggernaut is a heavily-augmented Synthoid, and have thus enlisted our help.",r.a.createElement("br",null),r.a.createElement("br",null),"Your mission is to eradicate Juggernaut and his followers.")},[s.a.OperationRedDragon]:{desc:r.a.createElement(r.a.Fragment,null,"The ",i.a.Tetrads," criminal organization is suspected of reverse-engineering the MK-VI Synthoid design. We believe they altered and possibly improved the design and began manufacturing their own Synthoid models in order to bolster their criminal activities.",r.a.createElement("br",null),r.a.createElement("br",null),"Your task is to infiltrate and destroy the ",i.a.Tetrads,"' base of operations in Los Angeles. Intelligence tells us that their base houses one of their Synthoid manufacturing units.")},[s.a.OperationK]:{desc:r.a.createElement(r.a.Fragment,null,"CODE RED SITUATION. Our intelligence tells us that VitaLife has discovered a new android cloning technology. This technology is supposedly capable of cloning Synthoid, not only physically but also their advanced AI modules. We do not believe that VitaLife is trying to use this technology illegally or maliciously, but if any Synthoids were able to infiltrate the corporation and take advantage of this technology then the results would be catastrophic.",r.a.createElement("br",null),r.a.createElement("br",null),"We do not have the power or jurisdiction to shut this down through legal or political means, so we must resort to a covert operation. Your goal is to destroy this technology and eliminate anyone who was involved in its creation.")},[s.a.OperationDeckard]:{desc:r.a.createElement(r.a.Fragment,null,"Despite your success in eliminating VitaLife's new android-replicating technology in"," ",s.a.OperationK,", we've discovered that a small group of MK-VI Synthoids were able to make off with the schematics and design of the technology before the Operation. It is almost a certainty that these Synthoids are some of the rogue MK-VI ones from the Synthoid Uprising.",r.a.createElement("br",null),r.a.createElement("br",null),"The goal of ",s.a.OperationDeckard," is to hunt down these Synthoids and retire them. I don't need to tell you how critical this mission is.")},[s.a.OperationTyrell]:{desc:r.a.createElement(r.a.Fragment,null,"A week ago ",i.a.BladeIndustries," reported a small break-in at one of their ",o.a.Aevum," ","Augmentation storage facilities. We figured out that ",i.a.TheDarkArmy," was behind the heist, and didn't think any more of it. However, we've just discovered that several known MK-VI Synthoids were part of that break-in group.",r.a.createElement("br",null),r.a.createElement("br",null),"We cannot have Synthoids upgrading their already-enhanced abilities with Augmentations. Your task is to hunt down associated ",i.a.TheDarkArmy," members and eliminate them.")},[s.a.OperationWallace]:{desc:r.a.createElement(r.a.Fragment,null,"Based on information gathered from ",s.a.OperationTyrell,", we've discovered that"," ",i.a.TheDarkArmy," was well aware that there were Synthoids amongst their ranks. Even worse, we believe that ",i.a.TheDarkArmy," is working together with other criminal organizations such as"," ",i.a.TheSyndicate," and that they are planning some sort of large-scale takeover of multiple major cities, most notably ",o.a.Aevum,". We suspect that Synthoids have infiltrated the ranks of these criminal factions and are trying to stage another Synthoid uprising.",r.a.createElement("br",null),r.a.createElement("br",null),"The best way to deal with this is to prevent it before it even happens. The goal of"," ",s.a.OperationWallace," is to destroy ",i.a.TheDarkArmy," and Syndicate factions in"," ",o.a.Aevum," immediately. Leave no survivors.")},[s.a.OperationShoulderOfOrion]:{desc:r.a.createElement(r.a.Fragment,null,"China's Solaris Space Systems is secretly launching the first manned spacecraft in over a decade using Synthoids. We believe China is trying to establish the first off-world colonies.",r.a.createElement("br",null),r.a.createElement("br",null),"The mission is to prevent this launch without instigating an international conflict. When you accept this mission you will be officially disavowed by the NSA and the national government until after you successfully return. In the event of failure, all of the operation's team members must not let themselves be captured alive.")},[s.a.OperationHyron]:{desc:r.a.createElement(r.a.Fragment,null,"Our intelligence tells us that ",i.a.FulcrumSecretTechnologies," is developing a quantum supercomputer using human brains as core processors. This supercomputer is rumored to be able to store vast amounts of data and perform computations unmatched by any other supercomputer on the planet. But more importantly, the use of organic human brains means that the supercomputer may be able to reason abstractly and become self-aware.",r.a.createElement("br",null),r.a.createElement("br",null),"I do not need to remind you why sentient-level AIs pose a serious threat to all of mankind.",r.a.createElement("br",null),r.a.createElement("br",null),"The research for this project is being conducted at one of ",i.a.FulcrumSecretTechnologies," secret facilities in ",o.a.Aevum,", codenamed 'Alpha Ranch'. Infiltrate the compound, delete and destroy the work, and then find and kill the project lead.")},[s.a.OperationMorpheus]:{desc:r.a.createElement(r.a.Fragment,null,"DreamSense Technologies is an advertising company that uses special technology to transmit their ads into the people's dreams and subconcious. They do this using broadcast transmitter towers. Based on information from our agents and informants in ",o.a.Chongqing,", we have reason to believe that one of the broadcast towers there has been compromised by Synthoids and is being used to spread pro-Synthoid propaganda.",r.a.createElement("br",null),r.a.createElement("br",null),"The mission is to destroy this broadcast tower. Speed and stealth are of the utmost importance for this.")},[s.a.OperationIonStorm]:{desc:r.a.createElement(r.a.Fragment,null,"Our analysts have uncovered a gathering of MK-VI Synthoids that have taken up residence in the"," ",o.a.Sector12," Slums. We don't know if they are rogue Synthoids from the Uprising, but we do know that they have been stockpiling weapons, money, and other resources. This makes them dangerous.",r.a.createElement("br",null),r.a.createElement("br",null),"This is a full-scale assault operation to find and retire all of these Synthoids in the ",o.a.Sector12," ","Slums.")},[s.a.OperationAnnihilus]:{desc:r.a.createElement(r.a.Fragment,null,"Our superiors have ordered us to eradicate everything and everyone in an underground facility located in"," ",o.a.Aevum,". They tell us that the facility houses many dangerous Synthoids and belongs to a terrorist organization called '",i.a.TheCovenant,"'. We have no prior intelligence about this organization, so you are going in blind.")},[s.a.OperationUltron]:{desc:r.a.createElement(r.a.Fragment,null,i.a.OmniTekIncorporated,", the original designer and manufacturer of Synthoids, has notified us of a malfunction in their AI design. This malfunction, when triggered, causes MK-VI Synthoids to become radicalized and seek out the destruction of humanity. They say that this bug affects all MK-VI Synthoids, not just the rogue ones from the Uprising.",r.a.createElement("br",null),r.a.createElement("br",null),i.a.OmniTekIncorporated," has also told us they they believe someone has triggered this malfunction in a large group of MK-VI Synthoids, and that these newly-radicalized Synthoids are now amassing in"," ",o.a.Volhaven," to form a terrorist group called Ultron.",r.a.createElement("br",null),r.a.createElement("br",null),"Intelligence suggests Ultron is heavily armed and that their members are augmented. We believe Ultron is making moves to take control of and weaponize DeltaOne's Tactical High-Energy Satellite Laser Array (THESLA).",r.a.createElement("br",null),r.a.createElement("br",null),"Your task is to find and destroy Ultron.")},[s.a.OperationCenturion]:{desc:r.a.createElement(r.a.Fragment,null,"D)@#)($M)C0293c40($*)@#D0JUMP3Rm0C<*@#)*$)#02c94830c(#$*D)",r.a.createElement("br",null),r.a.createElement("br",null),"Throughout all of humanity's history, we have relied on technology to survive, conquer, and progress. Its advancement became our primary goal. And at the peak of human civilization technology turned into power. Global, absolute power.",r.a.createElement("br",null),r.a.createElement("br",null),"It seems that the universe is not without a sense of irony.",r.a.createElement("br",null),r.a.createElement("br",null),"D)@#)($M)C0293c40($*)@#D0JUMP3Rm0C<*@#)*$)#02c94830c(#$*D)")},[s.a.OperationVindictus]:{desc:r.a.createElement(r.a.Fragment,null,"D)@#)($M)C0293c40($*)@#D0JUMP3Rm0C<*@#)*$)#02c94830c(#$*D)",r.a.createElement("br",null),r.a.createElement("br",null),"The bits are all around us. The daemons that hold the Node together can manifest themselves in many different ways.",r.a.createElement("br",null),r.a.createElement("br",null),"D)@#)($M)C0293c40($*)@#D0JUMP3Rm0C<*@#)*$)#02c94830c(#$*D)")},[s.a.OperationDaedalus]:{desc:r.a.createElement(r.a.Fragment,null," Yesterday we obeyed kings and bent our neck to emperors. Today we kneel only to truth.")}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(0),r=n.n(a),i=n(1169),o=n(59),s=n(22),l=n(1);function c(t){const e=Object(a.useState)(!1)[1],n=t.bladeburner.skillMultipliers;function c(t){return t&&1!==t}return r.a.createElement(r.a.Fragment,null,r.a.createElement(l.a,null,r.a.createElement("strong",null,"Skill Points: ",Object(s.f)(t.bladeburner.skillPoints,0))),r.a.createElement(l.a,null,"You will gain one skill point every ",o.a.RanksPerSkillPoint," ranks.",r.a.createElement("br",null),"Note that when upgrading a skill, the benefit for that skill is additive. However, the effects of different skills with each other is multiplicative."),c(n.successChanceAll)&&r.a.createElement(l.a,null,"Total Success Chance: x",Object(s.f)(n.successChanceAll,3)),c(n.successChanceStealth)&&r.a.createElement(l.a,null,"Stealth Success Chance: x",Object(s.f)(n.successChanceStealth,3)),c(n.successChanceKill)&&r.a.createElement(l.a,null,"Retirement Success Chance: x",Object(s.f)(n.successChanceKill,3)),c(n.successChanceContract)&&r.a.createElement(l.a,null,"Contract Success Chance: x",Object(s.f)(n.successChanceContract,3)),c(n.successChanceOperation)&&r.a.createElement(l.a,null,"Operation Success Chance: x",Object(s.f)(n.successChanceOperation,3)),c(n.successChanceEstimate)&&r.a.createElement(l.a,null,"Synthoid Data Estimate: x",Object(s.f)(n.successChanceEstimate,3)),c(n.actionTime)&&r.a.createElement(l.a,null,"Action Time: x",Object(s.f)(n.actionTime,3)),c(n.effHack)&&r.a.createElement(l.a,null,"Hacking Skill: x",Object(s.f)(n.effHack,3)),c(n.effStr)&&r.a.createElement(l.a,null,"Strength: x",Object(s.f)(n.effStr,3)),c(n.effDef)&&r.a.createElement(l.a,null,"Defense: x",Object(s.f)(n.effDef,3)),c(n.effDex)&&r.a.createElement(l.a,null,"Dexterity: x",Object(s.f)(n.effDex,3)),c(n.effAgi)&&r.a.createElement(l.a,null,"Agility: x",Object(s.f)(n.effAgi,3)),c(n.effCha)&&r.a.createElement(l.a,null,"Charisma: x",Object(s.f)(n.effCha,3)),c(n.effInt)&&r.a.createElement(l.a,null,"Intelligence: x",Object(s.f)(n.effInt,3)),c(n.stamina)&&r.a.createElement(l.a,null,"Stamina: x",Object(s.f)(n.stamina,3)),c(n.money)&&r.a.createElement(l.a,null,"Contract Money: x",Object(s.f)(n.money,3)),c(n.expGain)&&r.a.createElement(l.a,null,"Exp Gain: x",Object(s.f)(n.expGain,3)),r.a.createElement(i.a,{bladeburner:t.bladeburner,onUpgrade:()=>e(t=>!t)}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var a=n(0),r=n(1170),i=n(227);function o(t){return a.createElement(a.Fragment,null,Object.keys(i.a).map(e=>a.createElement(r.a,{key:e,bladeburner:t.bladeburner,skill:i.a[e],onUpgrade:t.onUpgrade})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var a=n(0),r=n.n(a),i=n(166),o=n(22),s=n(1),l=n(111),c=n(19),f=n(45),u=n(611),m=n.n(u),h=n(536),d=n.n(h);function p(t){const e=t.skill.name;let n=0;t.bladeburner.skills[e]&&!isNaN(t.bladeburner.skills[e])&&(n=t.bladeburner.skills[e]);const a=t.skill.calculateCost(n),u=t.bladeburner.skillPoints>=a,h=!!t.skill.maxLvl&&n>=t.skill.maxLvl;return r.a.createElement(f.a,{sx:{my:1,p:1}},r.a.createElement(c.a,{display:"flex",flexDirection:"row",alignItems:"center"},r.a.createElement(i.a,{variant:"h6",color:"primary",value:t.skill.name}),!u||h?r.a.createElement(l.a,{disabled:!0},r.a.createElement(d.a,null)):r.a.createElement(l.a,{onClick:function(){t.bladeburner.skillPoints{const t=setInterval(()=>h(t=>!t),200);return()=>clearInterval(t)},[]),r.a.createElement(c.a.Gang.Provider,{value:e},r.a.createElement(f.a,{variant:"fullWidth",value:n,onChange:function(t,e){m(e)},sx:{minWidth:"fit-content",maxWidth:"45%"}},r.a.createElement(u.a,{label:"Management"}),r.a.createElement(u.a,{label:"Equipment"}),r.a.createElement(u.a,{label:"Territory"})),0===n&&r.a.createElement(i.a,null),1===n&&r.a.createElement(s.a,null),2===n&&r.a.createElement(o.a,null))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(0),r=n.n(a),i=n(1173),o=n(1175),s=n(141),l=n(1);function c(){const t=Object(s.b)();return r.a.createElement(r.a.Fragment,null,r.a.createElement(l.a,null,"This page is used to manage your gang members and get an overview of your gang's stats.",r.a.createElement("br",null),r.a.createElement("br",null),"If a gang member is not earning much money or respect, the task that you have assigned to that member might be too difficult. Consider training that member's stats or choosing an easier task. The tasks closer to the top of the dropdown list are generally easier. Alternatively, the gang member's low production might be due to the fact that your wanted level is too high. Consider assigning a few members to the '",t.isHackingGang?"Ethical Hacking":"Vigilante Justice","' task to lower your wanted level.",r.a.createElement("br",null),r.a.createElement("br",null),"Installing Augmentations does NOT reset your progress with your Gang. Furthermore, after installing Augmentations, you will automatically be a member of whatever Faction you created your gang with.",r.a.createElement("br",null),r.a.createElement("br",null),"You can also manage your gang programmatically through Netscript using the Gang API"),r.a.createElement("br",null),r.a.createElement(i.a,null),r.a.createElement("br",null),r.a.createElement(o.a,null))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var a=n(0),r=n.n(a),i=n(26),o=n(22),s=n(5),l=n(112),c=n(128),f=n(82),u=n(1174),m=n(141),h=n(1),d=n(21),p=n(19);function g(){const t=Object(m.b)(),e=100*f.a[t.facName].territory;let n;return n=e<=0?Object(o.f)(0,2):e>=100?Object(o.f)(100,2):Object(o.f)(e,2),r.a.createElement(r.a.Fragment,null,r.a.createElement(p.a,{display:"flex"},r.a.createElement(d.a,{title:r.a.createElement(h.a,null,"Represents the amount of respect your gang has from other gangs and criminal organizations. Your respect affects the amount of money your gang members will earn, and also determines how much reputation you are earning with your gang's corresponding Faction.")},r.a.createElement(h.a,null,"Respect: ",s.a.formatRespect(t.respect)," (",s.a.formatRespect(5*t.respectGainRate)," / sec)"))),r.a.createElement(p.a,{display:"flex"},r.a.createElement(d.a,{title:r.a.createElement(h.a,null,"Represents how much the gang is wanted by law enforcement. The higher your gang's wanted level, the harder it will be for your gang members to make money and earn respect. Note that the minimum wanted level is 1.")},r.a.createElement(h.a,null,"Wanted Level: ",s.a.formatWanted(t.wanted)," (",s.a.formatWanted(5*t.wantedGainRate)," / sec)"))),r.a.createElement(p.a,{display:"flex"},r.a.createElement(d.a,{title:r.a.createElement(h.a,null,"Penalty for respect and money gain rates due to Wanted Level")},r.a.createElement(h.a,null,"Wanted Level Penalty: -",Object(o.f)(100*(1-t.getWantedPenalty()),2),"%"))),r.a.createElement(h.a,null,"Money gain rate: ",r.a.createElement(l.a,{money:5*t.moneyGainRate})),r.a.createElement(p.a,{display:"flex"},r.a.createElement(d.a,{title:r.a.createElement(h.a,null,"The percentage of total territory your Gang controls")},r.a.createElement(h.a,null,"Territory: ",n,"%"))),r.a.createElement(h.a,null,"Faction reputation: ",r.a.createElement(c.a,{reputation:i.a[t.facName].playerReputation})),r.a.createElement(u.a,{gang:t}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(0),r=n(10),i=n(22),o=n(1),s=n(21),l=n(19);function c(t){const e=1e3/r.a._idleSpeed;if(t.gang.storedCycles/e*1e3<=5e3)return a.createElement(a.Fragment,null);const n=t.gang.storedCycles/e*1e3;return a.createElement(l.a,{display:"flex"},a.createElement(s.a,{title:a.createElement(o.a,null,"You gain bonus time while offline or when the game is inactive (e.g. when the tab is throttled by the browser). Bonus time makes the Gang mechanic progress faster, up to 5x the normal speed.")},a.createElement(o.a,null,"Bonus time: ",Object(i.d)(n))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var a=n(0),r=n.n(a),i=n(1176),o=n(1187),s=n(141),l=n(76),c=n(19),f=n(344),u=n.n(f),m=n(147);function h(){const t=Object(s.b)(),e=Object(a.useState)(!1)[1],[n,f]=Object(a.useState)(""),[h,d]=Object(a.useState)(!1),p=t.members.filter(t=>t&&t.name.toLowerCase().includes(n)).filter(t=>!h||t.canAscend());return r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,{onRecruit:()=>e(t=>!t)}),r.a.createElement(l.a,{value:n,onChange:t=>{f(t.target.value.toLowerCase())},autoFocus:!0,InputProps:{startAdornment:r.a.createElement(u.a,null),spellCheck:!1},placeholder:"Filter by member name",sx:{m:1,width:"15%"}}),r.a.createElement(m.a,{checked:h,onChange:t=>d(t),text:"Show only ascendable",tooltip:r.a.createElement(r.a.Fragment,null,"Filter the members list by whether or not the member can be ascended.")}),r.a.createElement(c.a,{display:"grid",sx:{gridTemplateColumns:"repeat(2, 1fr)"}},p.map(t=>r.a.createElement(i.a,{key:t.name,member:t}))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(0),r=n.n(a),i=n(1177),o=n(19),s=n(113),l=n(45);function c(t){return r.a.createElement(o.a,{component:l.a,sx:{width:"auto"}},r.a.createElement(o.a,{sx:{m:1}},r.a.createElement(s.a,{primary:r.a.createElement("b",null,t.member.name)}),r.a.createElement(i.a,{member:t.member})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var a=n(0),r=n.n(a),i=n(1178),o=n(1184),s=n(1186),l=n(1482),c=n(8),f=n(1),u=n(299),m=n.n(u),h=n(468);function d(t){const e=Object(a.useState)(!1)[1],[n,u]=Object(a.useState)(!1),[d,p]=Object(a.useState)(!1);return r.a.createElement(r.a.Fragment,null,t.member.canAscend()&&r.a.createElement(l.a,{sx:{display:"flex",justifyContent:"space-between",my:1}},r.a.createElement(c.a,{onClick:()=>p(!0),style:{flexGrow:1,borderRightWidth:0}},"Ascend"),r.a.createElement(s.a,{open:d,onClose:()=>p(!1),member:t.member,onAscend:()=>e(t=>!t)}),r.a.createElement(c.a,{onClick:()=>u(!0),style:{width:"fit-content",borderLeftWidth:0}},r.a.createElement(m.a,null)),r.a.createElement(h.a,{open:n,onClose:()=>u(!1)},r.a.createElement(f.a,null,"Ascending a Gang Member resets the member's progress and stats in exchange for a permanent boost to their stat multipliers.",r.a.createElement("br",null),r.a.createElement("br",null),"The additional stat multiplier that the Gang Member gains upon ascension is based on the amount of exp they have.",r.a.createElement("br",null),r.a.createElement("br",null),"Upon ascension, the member will lose all of its non-Augmentation Equipment and your gang will lose respect equal to the total respect earned by the member."))),r.a.createElement(l.a,{display:"grid",sx:{gridTemplateColumns:"1fr 1fr",width:"100%",gap:1}},r.a.createElement(i.a,{member:t.member}),r.a.createElement(o.a,{onTaskChange:()=>e(t=>!t),member:t.member})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return y}));var a=n(0),r=n.n(a),i=n(141),o=n(1),s=n(21),l=n(148),c=n(149),f=n(50),u=n(30),m=n(5),h=n(6),d=n(112),p=n(73),g=n(301);function y(t){const e=Object(g.b)(),n={hack:t.member.calculateAscensionMult(t.member.hack_asc_points),str:t.member.calculateAscensionMult(t.member.str_asc_points),def:t.member.calculateAscensionMult(t.member.def_asc_points),dex:t.member.calculateAscensionMult(t.member.dex_asc_points),agi:t.member.calculateAscensionMult(t.member.agi_asc_points),cha:t.member.calculateAscensionMult(t.member.cha_asc_points)},a=Object(i.b)(),y=[["Money:",r.a.createElement(d.a,{money:5*t.member.calculateMoneyGain(a)})],["Respect:",m.a.formatRespect(5*t.member.calculateRespectGain(a))+" / sec"],["Wanted Level:",m.a.formatWanted(5*t.member.calculateWantedLevelGain(a))+" / sec"],["Total Respect:",""+m.a.formatRespect(t.member.earnedRespect)]];return r.a.createElement(r.a.Fragment,null,r.a.createElement(s.a,{title:r.a.createElement(o.a,null,"Hk: x",m.a.formatMultiplier(t.member.hack_mult*n.hack),"(x",m.a.formatMultiplier(t.member.hack_mult)," Eq, x",m.a.formatMultiplier(n.hack)," ","Asc)",r.a.createElement("br",null),"St: x",m.a.formatMultiplier(t.member.str_mult*n.str),"(x",m.a.formatMultiplier(t.member.str_mult)," Eq, x",m.a.formatMultiplier(n.str)," ","Asc)",r.a.createElement("br",null),"Df: x",m.a.formatMultiplier(t.member.def_mult*n.def),"(x",m.a.formatMultiplier(t.member.def_mult)," Eq, x",m.a.formatMultiplier(n.def)," ","Asc)",r.a.createElement("br",null),"Dx: x",m.a.formatMultiplier(t.member.dex_mult*n.dex),"(x",m.a.formatMultiplier(t.member.dex_mult)," Eq, x",m.a.formatMultiplier(n.dex)," ","Asc)",r.a.createElement("br",null),"Ag: x",m.a.formatMultiplier(t.member.agi_mult*n.agi),"(x",m.a.formatMultiplier(t.member.agi_mult)," Eq, x",m.a.formatMultiplier(n.agi)," ","Asc)",r.a.createElement("br",null),"Ch: x",m.a.formatMultiplier(t.member.cha_mult*n.cha),"(x",m.a.formatMultiplier(t.member.cha_mult)," Eq, x",m.a.formatMultiplier(n.cha)," ","Asc)")},r.a.createElement(l.a,{sx:{display:"table",mb:1,width:"100%"}},r.a.createElement(c.a,null,r.a.createElement(p.a,{name:"Hacking",color:h.a.theme.hack,data:{level:t.member.hack,exp:t.member.hack_exp}}),r.a.createElement(p.a,{name:"Strength",color:h.a.theme.combat,data:{level:t.member.str,exp:t.member.str_exp}}),r.a.createElement(p.a,{name:"Defense",color:h.a.theme.combat,data:{level:t.member.def,exp:t.member.def_exp}}),r.a.createElement(p.a,{name:"Dexterity",color:h.a.theme.combat,data:{level:t.member.dex,exp:t.member.dex_exp}}),r.a.createElement(p.a,{name:"Agility",color:h.a.theme.combat,data:{level:t.member.agi,exp:t.member.agi_exp}}),r.a.createElement(p.a,{name:"Charisma",color:h.a.theme.cha,data:{level:t.member.cha,exp:t.member.cha_exp}}),r.a.createElement(f.a,null,r.a.createElement(u.a,{classes:{root:e.cellNone}},r.a.createElement("br",null))),y.map(([t,n])=>r.a.createElement(f.a,{key:t.toString()+n.toString()},r.a.createElement(u.a,{classes:{root:e.cellNone}},r.a.createElement(o.a,null,t)),r.a.createElement(u.a,{align:"right",classes:{root:e.cellNone}},r.a.createElement(o.a,null,n))))))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(0),r=n.n(a),i=n(38),o=n(1),s=n(8);function l(t){return r.a.createElement(i.a,{open:t.open,onClose:t.onClose},r.a.createElement(o.a,null,"Forcefully kill all running scripts? This will also save your game and reload the game."),r.a.createElement(s.a,{onClick:function(){t.killScripts(),t.onClose()}},"KILL"))}},,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(0),r=n.n(a),i=n(141),o=n(1185),s=n(19),l=n(74),c=n(130);function f(t){const e=Object(i.b)(),[n,f]=Object(a.useState)(t.member.task),u=e.members.find(e=>e.name==t.member.name);u&&u.task!=n&&f(u.task);const m=e.getAllTaskNames();return r.a.createElement(s.a,null,r.a.createElement(c.a,{onChange:function(e){const n=e.target.value;t.member.assignToTask(n),f(n),t.onTaskChange()},value:n,sx:{width:"100%"}},r.a.createElement(l.a,{key:0,value:"Unassigned"},"Unassigned"),m.map((t,e)=>r.a.createElement(l.a,{key:e+1,value:t},t))),r.a.createElement(o.a,{member:t.member}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(0),r=n.n(a),i=n(242),o=n(1);function s(t){const e=i.a[t.member.task],n=e?e.desc:i.a.Unassigned.desc;return r.a.createElement(o.a,{dangerouslySetInnerHTML:{__html:n}})}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var a=n(0),r=n.n(a),i=n(5),o=n(14),s=n(38),l=n(141),c=n(1),f=n(8);function u(t){const e=Object(l.b)(),n=Object(a.useState)(!1)[1];Object(a.useEffect)(()=>{const t=setInterval(()=>n(t=>!t),1e3);return()=>clearInterval(t)},[]);const u=t.member.getCurrentAscensionMults(),m=t.member.getAscensionMultsAfterAscend();return r.a.createElement(s.a,{open:t.open,onClose:t.onClose},r.a.createElement(c.a,null,"Are you sure you want to ascend this member? They will lose all of",r.a.createElement("br",null),"their non-Augmentation upgrades and their stats will reset back to 1.",r.a.createElement("br",null),r.a.createElement("br",null),"Furthermore, your gang will lose ",i.a.formatRespect(t.member.earnedRespect)," respect",r.a.createElement("br",null),r.a.createElement("br",null),"In return, they will gain the following permanent boost to stat multipliers:",r.a.createElement("br",null),"Hacking: x",i.a.format(u.hack,"0.000")," => x",i.a.format(m.hack,"0.000"),r.a.createElement("br",null),"Strength: x",i.a.format(u.str,"0.000")," => x",i.a.format(m.str,"0.000"),r.a.createElement("br",null),"Defense: x",i.a.format(u.def,"0.000")," => x",i.a.format(m.def,"0.000"),r.a.createElement("br",null),"Dexterity: x",i.a.format(u.dex,"0.000")," => x",i.a.format(m.dex,"0.000"),r.a.createElement("br",null),"Agility: x",i.a.format(u.agi,"0.000")," => x",i.a.format(m.agi,"0.000"),r.a.createElement("br",null),"Charisma: x",i.a.format(u.cha,"0.000")," => x",i.a.format(m.cha,"0.000"),r.a.createElement("br",null)),r.a.createElement(f.a,{onClick:function(){t.onAscend();const n=e.ascendMember(t.member);Object(o.a)(r.a.createElement(r.a.Fragment,null,"You ascended ",t.member.name,"!",r.a.createElement("br",null),r.a.createElement("br",null),"Your gang lost ",i.a.formatRespect(n.respect)," respect.",r.a.createElement("br",null),r.a.createElement("br",null),t.member.name," gained the following stat multipliers for ascending:",r.a.createElement("br",null),"Hacking: x",i.a.format(n.hack,"0.000"),r.a.createElement("br",null),"Strength: x",i.a.format(n.str,"0.000"),r.a.createElement("br",null),"Defense: x",i.a.format(n.def,"0.000"),r.a.createElement("br",null),"Dexterity: x",i.a.format(n.dex,"0.000"),r.a.createElement("br",null),"Agility: x",i.a.format(n.agi,"0.000"),r.a.createElement("br",null),"Charisma: x",i.a.format(n.cha,"0.000"),r.a.createElement("br",null))),t.onClose()}},"Ascend"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var a=n(0),r=n.n(a),i=n(1188),o=n(187),s=n(5),l=n(141),c=n(1),f=n(8),u=n(19);function m(t){const e=Object(l.b)(),[n,m]=Object(a.useState)(!1);if(e.members.length>=o.a.MaximumGangMembers)return r.a.createElement(r.a.Fragment,null);if(!e.canRecruitMember()){const t=e.getRespectNeededToRecruitMember();return r.a.createElement(u.a,{display:"flex",alignItems:"center",sx:{mx:1}},r.a.createElement(f.a,{disabled:!0},"Recruit Gang Member"),r.a.createElement(c.a,{sx:{ml:1}},s.a.formatRespect(t)," respect needed to recruit next member"))}return r.a.createElement(r.a.Fragment,null,r.a.createElement(u.a,{sx:{mx:1}},r.a.createElement(f.a,{onClick:()=>m(!0)},"Recruit Gang Member")),r.a.createElement(i.a,{open:n,onClose:()=>m(!1),onRecruit:t.onRecruit}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var a=n(0),r=n.n(a),i=n(38),o=n(14),s=n(141),l=n(1),c=n(76),f=n(8),u=n(27);function m(t){const e=Object(s.b)(),[n,m]=Object(a.useState)(""),h=""===n||!e.canRecruitMember();function d(){h||(e.recruitMember(n)?(t.onRecruit(),t.onClose()):Object(o.a)("You already have a gang member with this name!"))}return r.a.createElement(i.a,{open:t.open,onClose:t.onClose},r.a.createElement(l.a,null,"Enter a name for your new Gang member:"),r.a.createElement("br",null),r.a.createElement(c.a,{autoFocus:!0,onKeyUp:function(t){t.key===u.a.ENTER&&d()},onChange:function(t){m(t.target.value)},type:"text",placeholder:"unique name",InputProps:{endAdornment:r.a.createElement(f.a,{disabled:h,onClick:d},"Recruit")}}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return E}));var a=n(0),r=n.n(a),i=n(249),o=n(1),s=n(8),l=n(19),c=n(45),f=n(333),u=n(277),m=n(21),h=n(1790),d=n(5),p=n(22),g=n(82),y=n(141),b=n(1190);function E(){const t=Object(y.b)(),e=Object.keys(g.a).filter(e=>e!=t.facName),[n,E]=Object(a.useState)(!1);return r.a.createElement(i.a,{disableGutters:!0,maxWidth:"md",sx:{mx:0}},r.a.createElement(o.a,null,"This page shows how much territory your Gang controls. This statistic is listed as a percentage, which represents how much of the total territory you control."),r.a.createElement(s.a,{onClick:()=>E(!0),sx:{my:1}},r.a.createElement(h.a,{sx:{mr:1}}),"About Gang Territory"),r.a.createElement(l.a,{component:c.a,sx:{p:1,mb:1}},r.a.createElement(o.a,{variant:"h6",sx:{display:"flex",alignItems:"center",flexWrap:"wrap"}},t.facName," (Your gang)"),r.a.createElement(f.a,{control:r.a.createElement(u.a,{checked:t.territoryWarfareEngaged,onChange:e=>t.territoryWarfareEngaged=e.target.checked}),label:r.a.createElement(m.a,{title:r.a.createElement(o.a,null,"Engaging in Territory Warfare sets your clash chance to 100%. Disengaging will cause your clash chance to gradually decrease until it reaches 0%.")},r.a.createElement(o.a,null,"Engage in Territory Warfare"))}),r.a.createElement("br",null),r.a.createElement(f.a,{control:r.a.createElement(u.a,{checked:t.notifyMemberDeath,onChange:e=>t.notifyMemberDeath=e.target.checked}),label:r.a.createElement(m.a,{title:r.a.createElement(o.a,null,"If this is enabled, then you will receive a pop-up notifying you whenever one of your Gang Members dies in a territory clash.")},r.a.createElement(o.a,null,"Notify about Gang Member Deaths"))}),r.a.createElement(o.a,null,r.a.createElement("b",null,"Territory Clash Chance:")," ",d.a.formatPercentage(t.territoryClashChance,3)," ",r.a.createElement("br",null),r.a.createElement("b",null,"Power:")," ",Object(p.f)(g.a[t.facName].power,3)," ",r.a.createElement("br",null),r.a.createElement("b",null,"Territory:")," ",v(g.a[t.facName].territory),"% ",r.a.createElement("br",null))),r.a.createElement(l.a,{sx:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)"}},e.sort((t,e)=>g.a[t].territory<=0&&g.a[e].territory>0?1:g.a[t].territory>0&&g.a[e].territory<=0?-1:0).map(t=>r.a.createElement(k,{key:t,name:t}))),r.a.createElement(b.a,{open:n,onClose:()=>E(!1)}))}function v(t){const e=100*t;return e<=0?Object(p.f)(0,3):e>=100?Object(p.f)(100,3):Object(p.f)(e,3)}function k(t){const e=Object(y.b)(),n=g.a[e.facName].power,a=g.a[t.name].power,i=n/(a+n),s=g.a[t.name].territory,f=s?1:.75;return r.a.createElement(l.a,{component:c.a,sx:{p:1,opacity:f}},r.a.createElement(o.a,{variant:"h6",sx:{display:"flex",alignItems:"center",flexWrap:"wrap"}},t.name),r.a.createElement(o.a,null,r.a.createElement("b",null,"Power:")," ",Object(p.f)(a,3)," ",r.a.createElement("br",null),r.a.createElement("b",null,"Territory:")," ",v(s),"% ",r.a.createElement("br",null),r.a.createElement("b",null,"Clash Win Chance:")," ",d.a.formatPercentage(i,3)))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(0),r=n.n(a),i=n(1),o=n(38);const s=({open:t,onClose:e})=>r.a.createElement(o.a,{open:t,onClose:e},r.a.createElement(r.a.Fragment,null,r.a.createElement(i.a,{variant:"h4"},"Clashing"),r.a.createElement(i.a,null,"Every ~20 seconds, your gang has a chance to 'clash' with other gangs. Your chance to win a clash depends on your gang's power, which is listed in the display below. Your gang's power slowly accumulates over time. The accumulation rate is determined by the stats of all Gang members you have assigned to the 'Territory Warfare' task. Gang members that are not assigned to this task do not contribute to your gang's power. Your gang also loses a small amount of power whenever you lose a clash.",r.a.createElement("br",null),r.a.createElement("br",null),"NOTE: Gang members assigned to 'Territory Warfare' can be killed during clashes. This can happen regardless of whether you win or lose the clash. A gang member being killed results in both respect and power loss for your gang."),r.a.createElement("br",null),r.a.createElement(i.a,{variant:"h4"},"Territory"),r.a.createElement(i.a,null,"The amount of territory you have affects all aspects of your Gang members' production, including money, respect, and wanted level. It is very beneficial to have high territory control.",r.a.createElement("br",null),r.a.createElement("br",null),'To increase your chances of winning territory, assign gang members to "Territory Warfare". This will build your gang power. Then, enable "Engage in Territory Warfare" to start fighting over territory.'),r.a.createElement("br",null),r.a.createElement(i.a,{variant:"h4"},"Territory Clash Chance"),r.a.createElement(i.a,null,"This percentage represents the chance you have of 'clashing' with another gang. If you do not wish to gain/lose territory, then keep this percentage at 0% by not engaging in territory warfare.")))},function(t,e,n){"use strict";n.d(e,"a",(function(){return M}));var a=n(0),r=n.n(a),i=n(141),o=n(1),s=n(8),l=n(21),c=n(19),f=n(45),u=n(130),m=n(148),h=n(149),d=n(74),p=n(76),g=n(344),y=n.n(g),b=n(5),E=n(229),v=n(20),k=n(183),_=n(29),w=n(6),S=n(73);function x(t){const e=Object(i.b)(),n=_.b.Player(),a=Object.keys(E.a).filter(a=>{const r=E.a[a];return!(n.money>e.getUpgradeCost(r))&&(r.type===t.type&&!t.upgrades.includes(a))}).map(t=>E.a[t]);return 0===a.length?r.a.createElement(r.a.Fragment,null):r.a.createElement(o.a,null,"Next at ",r.a.createElement(v.a,{money:a[0].cost}))}function C({upgName:t}){const e=E.a[t];return r.a.createElement(f.a,{sx:{p:1}},r.a.createElement(l.a,{title:r.a.createElement(o.a,{dangerouslySetInnerHTML:{__html:e.desc}})},r.a.createElement(o.a,null,e.name)))}function L(t){const e=Object(i.b)(),n=_.b.Player();return r.a.createElement(l.a,{title:r.a.createElement(o.a,{dangerouslySetInnerHTML:{__html:t.upg.desc}})},r.a.createElement("span",null,r.a.createElement(s.a,{onClick:function(){t.member.buyUpgrade(t.upg,n,e),t.rerender()},sx:{display:"flex",flexDirection:"column",width:"100%",height:"100%"}},r.a.createElement(o.a,{sx:{display:"block"}},t.upg.name),r.a.createElement(v.a,{money:e.getUpgradeCost(t.upg)}))))}function O(t){const e=Object(i.b)(),n=_.b.Player(),s=Object(a.useState)(!1)[1],[p,g]=Object(a.useState)("Weapons");function y(){s(t=>!t)}function v(t,a){return Object.keys(E.a).filter(r=>{const i=E.a[r];return!(n.moneyE.a[t])}const O=v(t.member.upgrades,k.a.Weapon),M=v(t.member.upgrades,k.a.Armor),T=v(t.member.upgrades,k.a.Vehicle),A=v(t.member.upgrades,k.a.Rootkit),R=v(t.member.augmentations,k.a.Augmentation),N={Weapons:[O,k.a.Weapon],Armor:[M,k.a.Armor],Vehicles:[T,k.a.Vehicle],Rootkits:[A,k.a.Rootkit],Augmentations:[R,k.a.Augmentation]},P={hack:t.member.calculateAscensionMult(t.member.hack_asc_points),str:t.member.calculateAscensionMult(t.member.str_asc_points),def:t.member.calculateAscensionMult(t.member.def_asc_points),dex:t.member.calculateAscensionMult(t.member.dex_asc_points),agi:t.member.calculateAscensionMult(t.member.agi_asc_points),cha:t.member.calculateAscensionMult(t.member.cha_asc_points)};return r.a.createElement(f.a,null,r.a.createElement(c.a,{display:"grid",sx:{gridTemplateColumns:"1fr 1fr",m:1,gap:1}},r.a.createElement("span",null,r.a.createElement(o.a,{variant:"h5",color:"primary"},t.member.name," (",t.member.task,")"),r.a.createElement(l.a,{title:r.a.createElement(o.a,null,"Hk: x",b.a.formatMultiplier(t.member.hack_mult*P.hack),"(x",b.a.formatMultiplier(t.member.hack_mult)," Eq, x",b.a.formatMultiplier(P.hack)," Asc)",r.a.createElement("br",null),"St: x",b.a.formatMultiplier(t.member.str_mult*P.str),"(x",b.a.formatMultiplier(t.member.str_mult)," Eq, x",b.a.formatMultiplier(P.str)," Asc)",r.a.createElement("br",null),"Df: x",b.a.formatMultiplier(t.member.def_mult*P.def),"(x",b.a.formatMultiplier(t.member.def_mult)," Eq, x",b.a.formatMultiplier(P.def)," Asc)",r.a.createElement("br",null),"Dx: x",b.a.formatMultiplier(t.member.dex_mult*P.dex),"(x",b.a.formatMultiplier(t.member.dex_mult)," Eq, x",b.a.formatMultiplier(P.dex)," Asc)",r.a.createElement("br",null),"Ag: x",b.a.formatMultiplier(t.member.agi_mult*P.agi),"(x",b.a.formatMultiplier(t.member.agi_mult)," Eq, x",b.a.formatMultiplier(P.agi)," Asc)",r.a.createElement("br",null),"Ch: x",b.a.formatMultiplier(t.member.cha_mult*P.cha),"(x",b.a.formatMultiplier(t.member.cha_mult)," Eq, x",b.a.formatMultiplier(P.cha)," Asc)")},r.a.createElement(m.a,null,r.a.createElement(h.a,null,r.a.createElement(S.a,{name:"Hacking",color:w.a.theme.hack,data:{level:t.member.hack,exp:t.member.hack_exp}}),r.a.createElement(S.a,{name:"Strength",color:w.a.theme.combat,data:{level:t.member.str,exp:t.member.str_exp}}),r.a.createElement(S.a,{name:"Defense",color:w.a.theme.combat,data:{level:t.member.def,exp:t.member.def_exp}}),r.a.createElement(S.a,{name:"Dexterity",color:w.a.theme.combat,data:{level:t.member.dex,exp:t.member.dex_exp}}),r.a.createElement(S.a,{name:"Agility",color:w.a.theme.combat,data:{level:t.member.agi,exp:t.member.agi_exp}}),r.a.createElement(S.a,{name:"Charisma",color:w.a.theme.cha,data:{level:t.member.cha,exp:t.member.cha_exp}}))))),r.a.createElement("span",null,r.a.createElement(u.a,{onChange:t=>{g(t.target.value),y()},value:p,sx:{width:"100%",mb:1}},Object.keys(N).map((t,e)=>r.a.createElement(d.a,{key:e+1,value:t},r.a.createElement(o.a,{variant:"h6"},t)))),r.a.createElement(c.a,{sx:{width:"100%"}},0===N[p][0].length&&r.a.createElement(o.a,null,"All upgrades owned!"),r.a.createElement(c.a,{display:"grid",sx:{gridTemplateColumns:"1fr 1fr"}},N[p][0].map(e=>r.a.createElement(L,{key:e.name,rerender:y,member:t.member,upg:e}))),r.a.createElement(x,{type:N[p][1],upgrades:t.member.upgrades})))),r.a.createElement(o.a,{sx:{mx:1}},"Purchased Upgrades: "),r.a.createElement(c.a,{display:"grid",sx:{gridTemplateColumns:"repeat(4, 1fr)",m:1}},t.member.upgrades.map(t=>r.a.createElement(C,{key:t,upgName:t})),t.member.augmentations.map(t=>r.a.createElement(C,{key:t,upgName:t}))))}function M(){const t=Object(i.b)(),[e,n]=Object(a.useState)(""),s=t.members.filter(t=>t&&t.name.toLowerCase().includes(e));return r.a.createElement(r.a.Fragment,null,r.a.createElement(l.a,{title:r.a.createElement(o.a,null,"You get a discount on equipment and upgrades based on your gang's respect and power. More respect and power leads to more discounts.")},r.a.createElement(o.a,{sx:{m:1}},"Discount: -",b.a.formatPercentage(1-1/t.getDiscount()))),r.a.createElement(p.a,{value:e,onChange:t=>{n(t.target.value.toLowerCase())},autoFocus:!0,InputProps:{startAdornment:r.a.createElement(y.a,null),spellCheck:!1},placeholder:"Filter by member name",sx:{m:1,width:"15%"}}),r.a.createElement(c.a,{display:"grid",sx:{gridTemplateColumns:"1fr 1fr",width:"100%"}},s.map(t=>r.a.createElement(O,{key:t.name,member:t}))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var a=n(0),r=n.n(a),i=n(1193),o=n(51),s=n(1218),l=n(29),c=n(48),f=n(1219),u=n(503),m=n(216);function h(){const t=l.b.Player().corporation;if(null===t)return r.a.createElement(r.a.Fragment,null);const e=Object(a.useState)(!1)[1];function n(){e(t=>!t)}const[h,d]=Object(a.useState)("Overview");Object(a.useEffect)(()=>{const t=setInterval(n,200);return()=>clearInterval(t)},[]);const p=Object.keys(o.a).filter(e=>void 0===t.divisions.find(t=>t.type===e)).length>0;return r.a.createElement(c.a.Corporation.Provider,{value:t},r.a.createElement(u.a,{variant:"scrollable",value:h,onChange:function(t,e){d(e)},sx:{maxWidth:"65vw"},scrollButtons:!0},r.a.createElement(m.a,{label:t.name,value:"Overview"}),t.divisions.map(t=>r.a.createElement(m.a,{key:t.name,label:t.name,value:t.name})),p&&r.a.createElement(m.a,{label:"Expand",value:-1})),"Overview"===h&&r.a.createElement(f.a,{rerender:n}),-1===h&&r.a.createElement(s.a,{setDivisionName:d}),"string"==typeof h&&"Overview"!==h&&r.a.createElement(i.a,{rerender:n,divisionName:h+""}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(0),r=n.n(a),i=n(1194),o=n(48),s=n(15);function l(t){const e=Object(o.b)(),n="Overview"!==t.divisionName?e.divisions.find(e=>e.name===t.divisionName):void 0;if(void 0===n)throw new Error("Cannot find division");return r.a.createElement(o.a.Division.Provider,{value:n},r.a.createElement(i.a,{rerender:t.rerender,city:s.a.Sector12}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(0),r=n.n(a),i=n(1195),o=n(1217),s=n(48),l=n(503),c=n(216);function f(t){const e=Object(s.c)(),[n,f]=Object(a.useState)(t.city),u=e.offices[n];if(0===u)return f("Sector-12"),r.a.createElement(r.a.Fragment,null);const m=Object.keys(e.offices).filter(t=>0===e.offices[t]).length>0;return r.a.createElement(r.a.Fragment,null,r.a.createElement(l.a,{variant:"fullWidth",value:n,onChange:function(t,e){f(e)},sx:{maxWidth:"65vw"}},Object.values(e.offices).map(t=>0!==t&&r.a.createElement(c.a,{key:t.loc,label:t.loc,value:t.loc})),m&&r.a.createElement(c.a,{label:"Expand",value:"Expand"})),"Expand"!==n?r.a.createElement(i.a,{key:n,rerender:t.rerender,city:n,warehouse:e.warehouses[n],office:u}):r.a.createElement(o.a,{cityStateSetter:f}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var a=n(0),r=n.n(a),i=n(1196),o=n(1199),s=n(1202),l=n(29),c=n(48),f=n(19);function u(t){const e=l.b.Player(),n=Object(c.b)(),a=Object(c.c)();return r.a.createElement(f.a,{display:"flex"},r.a.createElement(f.a,{sx:{width:"50%"}},r.a.createElement(o.a,{rerender:t.rerender,currentCity:t.city,office:t.office}),r.a.createElement(i.a,{rerender:t.rerender,office:t.office})),r.a.createElement(f.a,{sx:{width:"50%"}},r.a.createElement(s.a,{rerender:t.rerender,player:e,corp:n,currentCity:t.city,division:a,warehouse:t.warehouse})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return R}));var a=n(0),r=n.n(a),i=n(47),o=n(5),s=n(1197),l=n(1198),c=n(20),f=n(48),u=n(1),m=n(8),h=n(111),d=n(45),p=n(615),g=n.n(p),y=n(616),b=n.n(y),E=n(21),v=n(74),k=n(130),_=n(148),w=n(149),S=n(50),x=n(78),C=n(19);function L(t,e){let n=0;for(let a=0;at.switchMode(t=>!t)},"Switch to Auto Mode")):r.a.createElement(E.a,{title:r.a.createElement(u.a,null,"Switch to Manual Assignment Mode, which allows you to specify which employees should get which jobs")},r.a.createElement(m.a,{onClick:()=>t.switchMode(t=>!t)},"Switch to Manual Mode"))}function M(t){const e=Object(f.b)(),n=Object(f.c)(),[s,l]=Object(a.useState)(t.office.employees.length>0?t.office.employees[0]:null),m=[];for(let e=0;e0&&(p=l/t.office.employees.length,g=m/t.office.employees.length,y=h/t.office.employees.length),r.a.createElement(r.a.Fragment,null,r.a.createElement(_.a,{padding:"none"},r.a.createElement(w.a,null,r.a.createElement(S.a,null,r.a.createElement(x.b,null,r.a.createElement(u.a,null,"Unassigned Employees:")),r.a.createElement(x.b,null,r.a.createElement(u.a,null,a))),r.a.createElement(S.a,null,r.a.createElement(x.b,null,r.a.createElement(u.a,null,"Avg Employee Morale:")),r.a.createElement(x.b,null,r.a.createElement(u.a,null,o.a.format(p,"0.000")))),r.a.createElement(S.a,null,r.a.createElement(x.b,null,r.a.createElement(u.a,null,"Avg Employee Happiness:")),r.a.createElement(x.b,null,r.a.createElement(u.a,null,o.a.format(g,"0.000")))),r.a.createElement(S.a,null,r.a.createElement(x.b,null,r.a.createElement(u.a,null,"Avg Employee Energy:")),r.a.createElement(x.b,null,r.a.createElement(u.a,null,o.a.format(y,"0.000")))),r.a.createElement(S.a,null,r.a.createElement(x.b,null,r.a.createElement(u.a,null,"Total Employee Salary:")),r.a.createElement(x.b,null,r.a.createElement(u.a,null,r.a.createElement(c.a,{money:d})))),s&&r.a.createElement(r.a.Fragment,null,r.a.createElement(S.a,null,r.a.createElement(x.b,null,r.a.createElement(E.a,{title:r.a.createElement(u.a,null,"The base amount of material this office can produce. Does not include production multipliers from upgrades and materials. This value is based off the productivity of your Operations, Engineering, and Management employees")},r.a.createElement(u.a,null,"Material Production:"))),r.a.createElement(x.b,null,r.a.createElement(u.a,null,o.a.format(n.getOfficeProductivity(t.office),"0.000")))),r.a.createElement(S.a,null,r.a.createElement(x.b,null,r.a.createElement(E.a,{title:r.a.createElement(u.a,null,"The base amount of any given Product this office can produce. Does not include production multipliers from upgrades and materials. This value is based off the productivity of your Operations, Engineering, and Management employees")},r.a.createElement(u.a,null,"Product Production:"))),r.a.createElement(x.b,null,r.a.createElement(u.a,null,o.a.format(n.getOfficeProductivity(t.office,{forProduct:!0}),"0.000")))),r.a.createElement(S.a,null,r.a.createElement(x.b,null,r.a.createElement(E.a,{title:r.a.createElement(u.a,null,"The effect this office's 'Business' employees has on boosting sales")},r.a.createElement(u.a,null," Business Multiplier:"))),r.a.createElement(x.b,null,r.a.createElement(u.a,null,"x",o.a.format(n.getBusinessFactor(t.office),"0.000"))))))),r.a.createElement(_.a,{padding:"none"},r.a.createElement(w.a,null,r.a.createElement(T,{rerender:t.rerender,office:t.office,job:i.a.Operations,desc:"Manages supply chain operations. Improves the amount of Materials and Products you produce."}),r.a.createElement(T,{rerender:t.rerender,office:t.office,job:i.a.Engineer,desc:"Develops and maintains products and production systems. Increases the quality of everything you produce. Also increases the amount you produce (not as much as Operations, however)"}),r.a.createElement(T,{rerender:t.rerender,office:t.office,job:i.a.Business,desc:"Handles sales and finances. Improves the amount of Materials and Products you can sell."}),r.a.createElement(T,{rerender:t.rerender,office:t.office,job:i.a.Management,desc:"Leads and oversees employees and office operations. Improves the effectiveness of Engineer and Operations employees."}),r.a.createElement(T,{rerender:t.rerender,office:t.office,job:i.a.RandD,desc:"Research new innovative ways to improve the company. Generates Scientific Research."}),r.a.createElement(T,{rerender:t.rerender,office:t.office,job:i.a.Training,desc:"Set employee to training, which will increase some of their stats. Employees in training do not affect any company operations."}))))}function R(t){const e=Object(f.b)(),n=Object(f.c)(),[i,o]=Object(a.useState)(!1),[c,h]=Object(a.useState)(!1),[p,g]=Object(a.useState)(!1);return r.a.createElement(d.a,null,r.a.createElement(u.a,null,"Office Space"),r.a.createElement(u.a,null,"Size: ",t.office.employees.length," / ",t.office.size," employees"),r.a.createElement(C.a,{sx:{display:"grid",gridTemplateColumns:"1fr",width:"fit-content"}},r.a.createElement(C.a,{sx:{gridTemplateColumns:"repeat(3, 1fr)"}},r.a.createElement(E.a,{title:r.a.createElement(u.a,null,"Automatically hires an employee and gives him/her a random name")},r.a.createElement("span",null,r.a.createElement(m.a,{disabled:t.office.atCapacity(),onClick:function(){t.office.atCapacity()||(t.office.hireRandomEmployee(),t.rerender())}},"Hire Employee"))),r.a.createElement(E.a,{title:r.a.createElement(u.a,null,"Upgrade the office's size so that it can hold more employees!")},r.a.createElement("span",null,r.a.createElement(m.a,{disabled:e.funds<0,onClick:()=>o(!0)},"Upgrade size"))),r.a.createElement(s.a,{rerender:t.rerender,office:t.office,open:i,onClose:()=>o(!1)}),!n.hasResearch("AutoPartyManager")&&r.a.createElement(r.a.Fragment,null,r.a.createElement(E.a,{title:r.a.createElement(u.a,null,"Throw an office party to increase your employee's morale and happiness")},r.a.createElement("span",null,r.a.createElement(m.a,{disabled:e.funds<0,onClick:()=>h(!0)},"Throw Party"))),r.a.createElement(l.a,{rerender:t.rerender,office:t.office,open:c,onClose:()=>h(!1)}))),r.a.createElement(O,{manualMode:p,switchMode:g})),p?r.a.createElement(M,{rerender:t.rerender,office:t.office}):r.a.createElement(A,{rerender:t.rerender,office:t.office}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var a=n(0),r=n.n(a),i=n(5),o=n(40),s=n(62),l=n(38),c=n(48),f=n(1),u=n(8),m=n(21),h=n(19);function d(t){const e=Object(c.b)();return r.a.createElement(m.a,{title:i.a.formatMoney(t.cost)},r.a.createElement("span",null,r.a.createElement(u.a,{disabled:e.funds{return n=t.cost,a=t.size,void(e.funds=u);){const t=Math.pow(1.09,n+m);if(i+t>u)break;i+=t,++m}const p=o.a.OfficeInitialCost*i;return r.a.createElement(l.a,{open:t.open,onClose:t.onClose},r.a.createElement(f.a,null,"Increase the size of your office space to fit additional employees!"),r.a.createElement(h.a,{display:"flex",alignItems:"center"},r.a.createElement(f.a,null,"Upgrade size: "),r.a.createElement(d,{onClose:t.onClose,rerender:t.rerender,office:t.office,corp:e,cost:a,size:o.a.OfficeInitialSize}),r.a.createElement(d,{onClose:t.onClose,rerender:t.rerender,office:t.office,corp:e,cost:s,size:5*o.a.OfficeInitialSize}),r.a.createElement(d,{onClose:t.onClose,rerender:t.rerender,office:t.office,corp:e,cost:p,size:m*o.a.OfficeInitialSize})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var a=n(0),r=n.n(a),i=n(5),o=n(14),s=n(62),l=n(20),c=n(38),f=n(48),u=n(1),m=n(8),h=n(76),d=n(19),p=n(27);function g(t){const e=Object(f.b)(),[n,g]=Object(a.useState)(0),y=n*t.office.employees.length,b=e.funds>=y;function E(){if(null===n||isNaN(n)||n<0)Object(o.a)("Invalid value entered");else if(b){const a=Object(s.A)(e,t.office,n);Object(o.a)("You threw a party for the office! The morale and happiness of each employee increased by "+i.a.formatPercentage(a-1)),t.rerender(),t.onClose()}else Object(o.a)("You don't have enough company funds to throw a party!")}function v(){return isNaN(n)||n<0?r.a.createElement(u.a,null,"Invalid value entered!"):r.a.createElement(u.a,null,"Throwing this party will cost a total of ",r.a.createElement(l.a,{money:y}))}return r.a.createElement(c.a,{open:t.open,onClose:t.onClose},r.a.createElement(u.a,null,"Enter the amount of money you would like to spend PER EMPLOYEE on this office party"),r.a.createElement(v,null),r.a.createElement(d.a,{display:"flex",alignItems:"center"},r.a.createElement(h.a,{autoFocus:!0,type:"number",placeholder:"$ / employee",value:n,onChange:function(t){let e=parseFloat(t.target.value);isNaN(e)&&(e=0),g(e)},onKeyDown:function(t){t.key===p.a.ENTER&&E()}}),r.a.createElement(m.a,{disabled:!b,onClick:E},"Throw Party")))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return O}));var a=n(0),r=n.n(a),i=n(51),o=n(322),s=n(5),l=n(253),c=n(1200),f=n(1201),u=n(20),m=n(112),h=n(201),d=n(468),p=n(143),g=n(48),y=n(1),b=n(8),E=n(21),v=n(45),k=n(111),_=n(299),w=n.n(_),S=n(19);function x(){const t=Object(g.b)(),e=Object(g.c)(),[n,o]=Object(a.useState)(!1),s=e.hasMaximumNumberProducts();let l="";switch(e.type){case i.a.Food:l="Build Restaurant";break;case i.a.Tobacco:l="Create Product";break;case i.a.Pharmaceutical:l="Create Drug";break;case i.a.Computer:case"Computer":l="Create Product";break;case i.a.Robotics:l="Design Robot";break;case i.a.Software:l="Develop Software";break;case i.a.Healthcare:l="Build Hospital";break;case i.a.RealEstate:l="Develop Property";break;default:return l="Create Product",r.a.createElement(r.a.Fragment,null)}return r.a.createElement(r.a.Fragment,null,r.a.createElement(E.a,{title:s?r.a.createElement(y.a,null,"You have reached the maximum number of products: ",e.getMaximumNumberProducts()):""},r.a.createElement(b.a,{color:0===Object.keys(e.products).length?"error":"primary",onClick:()=>o(!0),disabled:t.funds<0},l)),r.a.createElement(c.a,{open:n,onClose:()=>o(!1)}))}function C(){const t=Object(g.b)(),e=Object(g.c)(),[n,i]=Object(a.useState)(!1),[o,c]=Object(a.useState)(!1),p=1===t.unlockUpgrades[4],v=e.lastCycleRevenue-e.lastCycleExpenses;let _=!1;const x=e.getAdvertisingFactors(),C=x[1],L=x[2],O=x[3],M=x[0];function T(t){return Object(l.a)({progress:t,totalTicks:20})}return p&&(_=!0),r.a.createElement(r.a.Fragment,null,r.a.createElement(y.a,null,"Industry: ",e.type," (Corp Funds: ",r.a.createElement(u.a,{money:t.funds}),")"),r.a.createElement("br",null),r.a.createElement(h.a,{rows:[["Awareness:",s.a.format(e.awareness,"0.000")],["Popularity:",s.a.format(e.popularity,"0.000")]]}),!1!==_&&r.a.createElement(E.a,{title:r.a.createElement(r.a.Fragment,null,r.a.createElement(y.a,null,"Total multiplier for this industrys sales due to its awareness and popularity"),r.a.createElement(h.a,{rows:[["Awareness Bonus:","x"+s.a.format(Math.pow(C,.85),"0.000")],["Popularity Bonus:","x"+s.a.format(Math.pow(L,.85),"0.000")],["Ratio Multiplier:","x"+s.a.format(Math.pow(O,.85),"0.000")]]}))},r.a.createElement(y.a,null,"Advertising Multiplier: x",s.a.format(M,"0.000"))),r.a.createElement("br",null),r.a.createElement(h.a,{rows:[["Revenue:",r.a.createElement(m.a,{money:e.lastCycleRevenue})],["Expenses:",r.a.createElement(m.a,{money:e.lastCycleExpenses})],["Profit:",r.a.createElement(m.a,{money:v})]]}),r.a.createElement("br",null),r.a.createElement(S.a,{display:"flex",alignItems:"center"},r.a.createElement(E.a,{title:r.a.createElement(y.a,null,"Production gain from owning production-boosting materials such as hardware, Robots, AI Cores, and Real Estate.")},r.a.createElement(y.a,null,"Production Multiplier: ",s.a.format(e.prodMult,"0.00"))),r.a.createElement(k.a,{onClick:()=>i(!0)},r.a.createElement(w.a,null)),r.a.createElement(d.a,{open:n,onClose:()=>i(!1)},r.a.createElement(y.a,null,"Owning Hardware, Robots, AI Cores, and Real Estate can boost your Industry's production. The effect these materials have on your production varies between Industries. For example, Real Estate may be very effective for some Industries, but ineffective for others.",r.a.createElement("br",null),r.a.createElement("br",null),"This division's production multiplier is calculated by summing the individual production multiplier of each of its office locations. This production multiplier is applied to each office. Therefore, it is beneficial to expand into new cities as this can greatly increase the production multiplier of your entire Division.",r.a.createElement("br",null),r.a.createElement("br",null),"Below are approximations for how effective each material is at boosting this industry's production multiplier (Bigger bars = more effective):",r.a.createElement("br",null),r.a.createElement("br",null),"Hardware:    ",T(e.hwFac),r.a.createElement("br",null),"Robots:      ",T(e.robFac),r.a.createElement("br",null),"AI Cores:    ",T(e.aiFac),r.a.createElement("br",null),"Real Estate: ",T(e.reFac)))),r.a.createElement(S.a,{display:"flex",alignItems:"center"},r.a.createElement(E.a,{title:r.a.createElement(y.a,null,"Scientific Research increases the quality of the materials and products that you produce.")},r.a.createElement(y.a,null,"Scientific Research: ",s.a.format(e.sciResearch.qty,"0.000a"))),r.a.createElement(b.a,{sx:{mx:1},onClick:()=>c(!0)},"Research"),r.a.createElement(f.a,{open:o,onClose:()=>c(!1),industry:e})))}function L(t){const e=Object(g.b)(),n=Object(g.c)(),a=[];for(const s of Object.keys(o.a)){const l=o.a[s];if(n.hasResearch("AutoBrew")&&"Coffee"===l[4])continue;const c=l[0],f=l[1],u=l[2];let m=0;switch(c){case 0:m=t.office.employees.length*f;break;default:m=f*Math.pow(u,n.upgrades[c])}function i(){e.funds0!==n.offices[t]),[y,b]=Object(a.useState)(g.length>0?g[0]:""),[E,v]=Object(a.useState)(""),[k,_]=Object(a.useState)(null),[w,S]=Object(a.useState)(null);if(n.hasMaximumNumberProducts())return r.a.createElement(r.a.Fragment,null);let x=r.a.createElement(r.a.Fragment,null);switch(n.type){case s.a.Food:x=r.a.createElement(r.a.Fragment,null,x,r.a.createElement("br",null),"Build and manage a new restaurant!");break;case s.a.Tobacco:x=r.a.createElement(r.a.Fragment,null,x,r.a.createElement("br",null),"Create a new tobacco product!");break;case s.a.Pharmaceutical:x=r.a.createElement(r.a.Fragment,null,x,r.a.createElement("br",null),"Design and develop a new pharmaceutical drug!");break;case s.a.Computer:case"Computer":x=r.a.createElement(r.a.Fragment,null,x,r.a.createElement("br",null),"Design and manufacture a new computer hardware product!");break;case s.a.Robotics:x=r.a.createElement(r.a.Fragment,null,x,r.a.createElement("br",null),"Design and create a new robot or robotic system!");break;case s.a.Software:x=r.a.createElement(r.a.Fragment,null,x,r.a.createElement("br",null),"Develop a new piece of software!");break;case s.a.Healthcare:x=r.a.createElement(r.a.Fragment,null,x,r.a.createElement("br",null),"Build and manage a new hospital!");break;case s.a.RealEstate:x=r.a.createElement(r.a.Fragment,null,x,r.a.createElement("br",null),"Develop a new piece of real estate property!");break;default:return x=r.a.createElement(r.a.Fragment,null,x,r.a.createElement("br",null),"Create a new product!"),r.a.createElement(r.a.Fragment,null)}function C(){if(null!==k&&null!==w){try{Object(l.m)(e,n,y,E,k,w)}catch(t){Object(i.a)(t+"")}t.onClose()}}return x=r.a.createElement(r.a.Fragment,null,x,r.a.createElement("br",null),r.a.createElement("br",null),"To begin developing a product, first choose the city in which it will be designed. The stats of your employees in the selected city affect the properties of the finished product, such as its quality, performance, and durability.",r.a.createElement("br",null),r.a.createElement("br",null),"You can also choose to invest money in the design and marketing of the product. Investing money in its design will result in a superior product. Investing money in marketing the product will help the product's sales."),r.a.createElement(o.a,{open:t.open,onClose:t.onClose},r.a.createElement(f.a,null,x),r.a.createElement(d.a,{style:{margin:"5px"},onChange:function(t){b(t.target.value)},defaultValue:y},g.map(t=>r.a.createElement(h.a,{key:t,value:t},t))),r.a.createElement(u.a,{onChange:function(t){v(t.target.value)},placeholder:(L=n.type,L===s.a.Food?"Restaurant Name":L===s.a.Healthcare?"Hospital Name":L===s.a.RealEstate?"Property Name":"Product Name")}),r.a.createElement("br",null),r.a.createElement(u.a,{onChange:function(t){""===t.target.value?_(null):_(parseFloat(t.target.value))},autoFocus:!0,type:"number",placeholder:"Design investment"}),r.a.createElement(u.a,{onChange:function(t){""===t.target.value?S(null):S(parseFloat(t.target.value))},onKeyDown:function(t){t.key===p.a.ENTER&&C()},type:"number",placeholder:"Marketing investment"}),r.a.createElement(m.a,{onClick:C},"Develop Product"));var L}},function(t,e,n){"use strict";n.d(e,"a",(function(){return S}));var a=n(0),r=n.n(a),i=n(38),o=n(51),s=n(40),l=n(62),c=n(285),f=n(6),u=n(14),m=n(1),h=n(21),d=n(8),p=n(19),g=n(276),y=n(81),b=n.n(y),E=n(209),v=n.n(E),k=n(325),_=n.n(k);function w({n:t,division:e}){const[n,i]=Object(a.useState)(!1);if(null===t)return r.a.createElement(r.a.Fragment,null);const o=c.a[t.text];let y=e.sciResearch.qtyr.a.createElement(h.a,{title:r.a.createElement(m.a,null,"Research points: ",o.cost,r.a.createElement("br",null),o.desc)},t),C=r.a.createElement(p.a,null,x(r.a.createElement("span",null,r.a.createElement(d.a,{color:S,disabled:y&&!t.researched,onClick:k,style:{width:"100%",textAlign:"left",justifyContent:"unset"}},t.researched&&r.a.createElement(_.a,{sx:{mr:1}}),t.text))));return 0===t.children.length?C:r.a.createElement(p.a,null,r.a.createElement(p.a,{display:"flex",sx:{border:"1px solid "+f.a.theme.well}},x(r.a.createElement("span",{style:{width:"100%"}},r.a.createElement(d.a,{color:S,disabled:y&&!t.researched,onClick:k,sx:{width:"100%",textAlign:"left",justifyContent:"unset",borderColor:f.a.theme.button}},t.researched&&r.a.createElement(_.a,{sx:{mr:1}}),t.text))),r.a.createElement(d.a,{onClick:()=>i(t=>!t),sx:{borderColor:f.a.theme.button,minWidth:"fit-content"}},n?r.a.createElement(v.a,{color:"primary"}):r.a.createElement(b.a,{color:"primary"}))),r.a.createElement(g.a,{in:n,unmountOnExit:!0},r.a.createElement(p.a,{m:1},t.children.map(t=>r.a.createElement(w,{key:t.text,division:e,n:t})))))}function S(t){const e=o.c[t.industry.type];return void 0===e?r.a.createElement(r.a.Fragment,null):r.a.createElement(i.a,{open:t.open,onClose:t.onClose},r.a.createElement(w,{division:t.industry,n:e.root}),r.a.createElement(m.a,{sx:{mt:1}},"Research points: ",t.industry.sciResearch.qty.toFixed(3),r.a.createElement("br",null),"Multipliers from research:",r.a.createElement("br",null),"* Advertising Multiplier: x",e.getAdvertisingMultiplier(),r.a.createElement("br",null),"* Employee Charisma Multiplier: x",e.getEmployeeChaMultiplier(),r.a.createElement("br",null),"* Employee Creativity Multiplier: x",e.getEmployeeCreMultiplier(),r.a.createElement("br",null),"* Employee Efficiency Multiplier: x",e.getEmployeeEffMultiplier(),r.a.createElement("br",null),"* Employee Intelligence Multiplier: x",e.getEmployeeIntMultiplier(),r.a.createElement("br",null),"* Production Multiplier: x",e.getProductionMultiplier(),r.a.createElement("br",null),"* Sales Multiplier: x",e.getSalesMultiplier(),r.a.createElement("br",null),"* Scientific Research Multiplier: x",e.getScientificResearchMultiplier(),r.a.createElement("br",null),"* Storage Multiplier: x",e.getStorageMultiplier()))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return O}));var a=n(0),r=n.n(a),i=n(40),o=n(202),s=n(408),l=n(243),c=n(1203),f=n(1204),u=n(1210),m=n(179),h=n(5),d=n(143),p=n(409),g=n(1216),y=n(62),b=n(48),E=n(1),v=n(21),k=n(45),_=n(8),w=n(19),S=n(121),x=n(144);const C=Object(S.a)(()=>Object(x.a)({retainHeight:{minHeight:"3em"}}));function L(t){const e=Object(b.b)(),n=Object(b.c)(),[l,y]=Object(a.useState)(!1);if(0===t.warehouse)return r.a.createElement(r.a.Fragment,null);const S=i.a.WarehouseUpgradeBaseCost*Math.pow(1.07,t.warehouse.level+1),x=e.funds>S;const L=C();let O;switch(n.state){case"START":O="Current state: Preparing...";break;case"PURCHASE":O="Current state: Purchasing materials...";break;case"PRODUCTION":O="Current state: Producing materials and/or products...";break;case"SALE":O="Current state: Selling materials and/or products...";break;case"EXPORT":O="Current state: Exporting materials and/or products...";break;default:console.error("Invalid state: "+n.state)}const M=[];for(const e of Object.keys(t.warehouse.materials)){if(!(t.warehouse.materials[e]instanceof o.a))continue;const a=t.warehouse.materials[e].qty>0,i=Object(p.a)(e,n);(a||i)&&M.push(r.a.createElement(u.a,{rerender:t.rerender,city:t.currentCity,key:e,mat:t.warehouse.materials[e],warehouse:t.warehouse}))}const T=[];if(n.makesProducts&&Object.keys(n.products).length>0)for(const e of Object.keys(n.products)){const a=n.products[e];a instanceof s.a&&T.push(r.a.createElement(f.a,{rerender:t.rerender,city:t.currentCity,key:e,product:a}))}const A=[];for(const e of Object.keys(t.warehouse.materials)){const n=t.warehouse.materials[e];m.a.hasOwnProperty(e)&&(0!==n.qty&&A.push(r.a.createElement(r.a.Fragment,null,e,": ",h.a.format(n.qty*m.a[e],"0,0.0"))))}for(const e of Object.keys(n.products)){const a=n.products[e];void 0!==a&&A.push(r.a.createElement(r.a.Fragment,null,e,": ",h.a.format(a.data[t.warehouse.loc][0]*a.siz,"0,0.0")))}let R;return R=A&&A.length>0?A.reduce((t,e)=>t&&r.a.createElement(r.a.Fragment,null,t,r.a.createElement("br",null),e)||r.a.createElement(r.a.Fragment,null,e)):r.a.createElement(r.a.Fragment,null,"No items in storage."),r.a.createElement(k.a,null,r.a.createElement(w.a,{display:"flex",alignItems:"center"},r.a.createElement(v.a,{title:0!==t.warehouse.sizeUsed?r.a.createElement(E.a,null,r.a.createElement(r.a.Fragment,null,R)):""},r.a.createElement(E.a,{color:t.warehouse.sizeUsed>=t.warehouse.size?"error":"primary"},"Storage: ",h.a.formatBigNumber(t.warehouse.sizeUsed)," /"," ",h.a.formatBigNumber(t.warehouse.size)))),r.a.createElement(_.a,{disabled:!x,onClick:function(){null!==n&&0!==t.warehouse&&x&&(++t.warehouse.level,t.warehouse.updateSize(e,n),e.funds=e.funds-S,t.rerender())}},"Upgrade Warehouse Size - ",r.a.createElement(d.a,{money:S,corp:e})),r.a.createElement(E.a,null,"This industry uses the following equation for its production: "),r.a.createElement("br",null),r.a.createElement(E.a,null,r.a.createElement(g.a,{key:n.name,division:n})),r.a.createElement("br",null),r.a.createElement(E.a,null,"To get started with production, purchase your required materials or import them from another of your company's divisions."),r.a.createElement("br",null),r.a.createElement(E.a,{className:L.retainHeight},O),e.unlockUpgrades[1]&&r.a.createElement(r.a.Fragment,null,r.a.createElement(_.a,{onClick:()=>y(!0)},"Configure Smart Supply"),r.a.createElement(c.a,{open:l,onClose:()=>y(!1),warehouse:t.warehouse})),M,T)}function O(t){return t.warehouse instanceof l.a?r.a.createElement(L,t):r.a.createElement(M,{rerender:t.rerender,city:t.currentCity})}function M(t){const e=Object(b.b)(),n=Object(b.c)(),a=e.funds!t)}}),label:r.a.createElement(f.a,null,"Enable Smart Supply")}),r.a.createElement("br",null),r.a.createElement(f.a,null,"Use materials already in the warehouse instead of buying new ones, if available:"),s))}},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return ProductElem}));var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(0),react__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__),_data_Constants__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(40),_modals_DiscontinueProductModal__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(1205),_modals_LimitProductProductionModal__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(1206),_modals_SellProductModal__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(1207),_modals_ProductMarketTaModal__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(1208),_modals_CancelProductModal__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(1209),_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(5),_utils_helpers_isString__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(146),_ui_React_Money__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(20),_Context__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(48),_mui_material_Typography__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(1),_mui_material_Tooltip__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(21),_mui_material_Paper__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__(45),_mui_material_Button__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__(8),_mui_material_Box__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__(19);function ProductElem(props){const corp=Object(_Context__WEBPACK_IMPORTED_MODULE_10__.b)(),division=Object(_Context__WEBPACK_IMPORTED_MODULE_10__.c)(),[sellOpen,setSellOpen]=Object(react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1),[limitOpen,setLimitOpen]=Object(react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1),[discontinueOpen,setDiscontinueOpen]=Object(react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1),[cancelOpen,setCancelOpen]=Object(react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1),[marketTaOpen,setMarketTaOpen]=Object(react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1),city=props.city,product=props.product,nf="0.000",nfB="0.000a",hasUpgradeDashboard=division.hasResearch("uPgrade: Dashboard"),totalGain=product.data[city][1]-product.data[city][2];let sellButtonText;if(sellButtonText=product.sllman[city][0]?Object(_utils_helpers_isString__WEBPACK_IMPORTED_MODULE_8__.a)(product.sllman[city][1])?react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment,null,"Sell (",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_7__.a.format(product.data[city][2],nfB),"/",product.sllman[city][1],")"):react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment,null,"Sell (",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_7__.a.format(product.data[city][2],nfB),"/",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_7__.a.format(product.sllman[city][1],nfB),")"):react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment,null,"Sell (0.000/0.000)"),product.marketTa2)sellButtonText=react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment,null,sellButtonText," @ ",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_ui_React_Money__WEBPACK_IMPORTED_MODULE_9__.a,{money:product.marketTa2Price[city]}));else if(product.marketTa1){const t=product.rat/product.mku;sellButtonText=react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment,null,sellButtonText," @ ",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_ui_React_Money__WEBPACK_IMPORTED_MODULE_9__.a,{money:product.pCost+t}))}else if(product.sCost)if(Object(_utils_helpers_isString__WEBPACK_IMPORTED_MODULE_8__.a)(product.sCost)){const sCost=product.sCost.replace(/MP/g,product.pCost+product.rat/product.mku+"");sellButtonText=react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment,null,sellButtonText," @ ",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_ui_React_Money__WEBPACK_IMPORTED_MODULE_9__.a,{money:eval(sCost)}))}else sellButtonText=react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment,null,sellButtonText," @ ",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_ui_React_Money__WEBPACK_IMPORTED_MODULE_9__.a,{money:product.sCost}));let limitProductionButtonText="Limit Production";return product.prdman[city][0]&&(limitProductionButtonText+=" ("+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_7__.a.format(product.prdman[city][1],nf)+")"),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Paper__WEBPACK_IMPORTED_MODULE_13__.a,null,product.fin?react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment,null,react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Box__WEBPACK_IMPORTED_MODULE_15__.a,{display:"flex"},react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Tooltip__WEBPACK_IMPORTED_MODULE_12__.a,{title:react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Typography__WEBPACK_IMPORTED_MODULE_11__.a,null,"Prod: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_7__.a.format(product.data[city][1],nfB),"/s",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),"Sell: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_7__.a.format(product.data[city][2],nfB)," /s")},react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Typography__WEBPACK_IMPORTED_MODULE_11__.a,null,product.name,": ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_7__.a.format(product.data[city][0],nfB)," (",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_7__.a.format(totalGain,nfB),"/s)"))),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Box__WEBPACK_IMPORTED_MODULE_15__.a,{display:"flex"},react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Tooltip__WEBPACK_IMPORTED_MODULE_12__.a,{title:react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Typography__WEBPACK_IMPORTED_MODULE_11__.a,null,"Quality: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_7__.a.format(product.qlt,nf)," ",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),"Performance: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_7__.a.format(product.per,nf)," ",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),"Durability: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_7__.a.format(product.dur,nf)," ",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),"Reliability: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_7__.a.format(product.rel,nf)," ",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),"Aesthetics: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_7__.a.format(product.aes,nf)," ",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),"Features: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_7__.a.format(product.fea,nf),1===corp.unlockUpgrades[2]&&react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),1===corp.unlockUpgrades[2]&&"Demand: "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_7__.a.format(product.dmd,nf),1===corp.unlockUpgrades[3]&&react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),1===corp.unlockUpgrades[3]&&"Competition: "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_7__.a.format(product.cmp,nf))},react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Typography__WEBPACK_IMPORTED_MODULE_11__.a,null,"Rating: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_7__.a.format(product.rat,nf)))),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Box__WEBPACK_IMPORTED_MODULE_15__.a,{display:"flex"},react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Tooltip__WEBPACK_IMPORTED_MODULE_12__.a,{title:react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Typography__WEBPACK_IMPORTED_MODULE_11__.a,null,"An estimate of the material cost it takes to create this Product.")},react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Typography__WEBPACK_IMPORTED_MODULE_11__.a,null,"Est. Production Cost:"," ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_7__.a.formatMoney(product.pCost/_data_Constants__WEBPACK_IMPORTED_MODULE_1__.a.ProductProductionCostRatio)))),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Box__WEBPACK_IMPORTED_MODULE_15__.a,{display:"flex"},react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Tooltip__WEBPACK_IMPORTED_MODULE_12__.a,{title:react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Typography__WEBPACK_IMPORTED_MODULE_11__.a,null,"An estimate of how much consumers are willing to pay for this product. Setting the sale price above this may result in less sales. Setting the sale price below this may result in more sales.")},react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Typography__WEBPACK_IMPORTED_MODULE_11__.a,null,"Est. Market Price: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_7__.a.formatMoney(product.pCost)))),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Button__WEBPACK_IMPORTED_MODULE_14__.a,{onClick:()=>setDiscontinueOpen(!0)},"Discontinue"),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_modals_DiscontinueProductModal__WEBPACK_IMPORTED_MODULE_2__.a,{product:product,rerender:props.rerender,open:discontinueOpen,onClose:()=>setDiscontinueOpen(!1)})):react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment,null,react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Typography__WEBPACK_IMPORTED_MODULE_11__.a,null,"Designing ",product.name," (req. Operations/Engineers in ",product.createCity,")..."),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Typography__WEBPACK_IMPORTED_MODULE_11__.a,null,_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_7__.a.format(product.prog,"0.00"),"% complete"),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Button__WEBPACK_IMPORTED_MODULE_14__.a,{onClick:()=>setCancelOpen(!0)},"Cancel"),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_modals_CancelProductModal__WEBPACK_IMPORTED_MODULE_6__.a,{product:product,rerender:props.rerender,open:cancelOpen,onClose:()=>setCancelOpen(!1)})),(hasUpgradeDashboard||product.fin)&&react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment,null,react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Button__WEBPACK_IMPORTED_MODULE_14__.a,{onClick:()=>setSellOpen(!0)},sellButtonText),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_modals_SellProductModal__WEBPACK_IMPORTED_MODULE_4__.a,{product:product,city:city,open:sellOpen,onClose:()=>setSellOpen(!1)}),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Button__WEBPACK_IMPORTED_MODULE_14__.a,{onClick:()=>setLimitOpen(!0)},limitProductionButtonText),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_modals_LimitProductProductionModal__WEBPACK_IMPORTED_MODULE_3__.a,{product:product,city:city,open:limitOpen,onClose:()=>setLimitOpen(!1)}),division.hasResearch("Market-TA.I")&&react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment,null,react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Button__WEBPACK_IMPORTED_MODULE_14__.a,{onClick:()=>setMarketTaOpen(!0)},"Market-TA"),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_modals_ProductMarketTaModal__WEBPACK_IMPORTED_MODULE_5__.a,{product:product,open:marketTaOpen,onClose:()=>setMarketTaOpen(!1)}))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(0),r=n.n(a),i=n(38),o=n(48),s=n(1),l=n(8);function c(t){const e=Object(o.c)();return r.a.createElement(i.a,{open:t.open,onClose:t.onClose},r.a.createElement(s.a,null,"Are you sure you want to do this? Discontinuing a product removes it completely and permanently. You will no longer produce this product and all of its existing stock will be removed and left unsold"),r.a.createElement(l.a,{onClick:function(){e.discontinueProduct(t.product),t.onClose(),t.rerender()}},"Discontinue"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var a=n(0),r=n.n(a),i=n(62),o=n(38),s=n(1),l=n(8),c=n(76),f=n(27);function u(t){const[e,n]=Object(a.useState)(null);function u(){let n=e;null===n&&(n=-1),Object(i.l)(t.product,t.city,n),t.onClose()}return Object(a.useEffect)(()=>{t.open||n(null)},[t.open]),r.a.createElement(o.a,{open:t.open,onClose:t.onClose},r.a.createElement(s.a,null,"Enter a limit to the amount of this product you would like to produce per second. Leave the box empty to set no limit."),r.a.createElement(c.a,{autoFocus:!0,placeholder:"Limit",type:"number",onChange:function(t){""===t.target.value?n(null):n(parseFloat(t.target.value))},onKeyDown:function(t){t.key===f.a.ENTER&&u()}}),r.a.createElement(l.a,{onClick:u},"Limit production"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var a=n(0),r=n.n(a),i=n(14),o=n(62),s=n(38),l=n(1),c=n(76),f=n(8),u=n(333),m=n(277),h=n(27);function d(t){const[e,n]=Object(a.useState)(!0),[d,p]=Object(a.useState)(t.product.sllman[t.city][1]?t.product.sllman[t.city][1]:""),[g,y]=Object(a.useState)(function(t){let e=t.sCost?t.sCost+"":"";return t.marketTa2?e+=" (Market-TA.II)":t.marketTa1&&(e+=" (Market-TA.I)"),e}(t.product));function b(){try{Object(o.s)(t.product,t.city,d,g,e)}catch(t){Object(i.a)(t+"")}t.onClose()}function E(t){t.key===h.a.ENTER&&b()}return r.a.createElement(s.a,{open:t.open,onClose:t.onClose},r.a.createElement(l.a,null,"Enter the maximum amount of ",t.product.name," you would like to sell per second, as well as the price at which you would like to sell it at.",r.a.createElement("br",null),r.a.createElement("br",null),"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 product will be discarded.",r.a.createElement("br",null),r.a.createElement("br",null),"Setting the sell amount to 'MAX' will result in you always selling the maximum possible amount of the material.",r.a.createElement("br",null),r.a.createElement("br",null),"When setting the sell amount, you can use the 'PROD' variable to designate a dynamically changing amount that depends on your production. For example, if you set the sell amount to 'PROD-1' then you will always sell 1 less of the material than you produce.",r.a.createElement("br",null),r.a.createElement("br",null),"When setting the sell price, you can use the 'MP' variable to set a dynamically changing price that depends on the Product's estimated market price. For example, if you set it to 'MP*5' then it will always be sold at five times the estimated market price."),r.a.createElement("br",null),r.a.createElement(c.a,{value:d,autoFocus:!0,type:"text",placeholder:"Sell amount",onChange:function(t){p(t.target.value)},onKeyDown:E}),r.a.createElement(c.a,{value:g,type:"text",placeholder:"Sell price",onChange:function(t){y(t.target.value)},onKeyDown:E}),r.a.createElement(f.a,{onClick:b},"Confirm"),r.a.createElement(u.a,{control:r.a.createElement(m.a,{checked:e,onChange:function(t){n(t.target.checked)}}),label:r.a.createElement(l.a,null,"Use same 'Sell Amount' for all cities")}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var a=n(0),r=n.n(a),i=n(5),o=n(38),s=n(48),l=n(1),c=n(76),f=n(333),u=n(277),m=n(21);function h(t){if(!Object(s.c)().hasResearch("Market-TA.II"))return r.a.createElement(r.a.Fragment,null);const e=t.product.rat/t.product.mku,[n,o]=Object(a.useState)(t.product.pCost),h=Object(a.useState)(!1)[1];const d=n;let p=1;return d>t.product.pCost&&d-t.product.pCost>e&&(p=e/(d-t.product.pCost)),r.a.createElement(r.a.Fragment,null,r.a.createElement(l.a,{variant:"h4"},"Market-TA.II"),r.a.createElement("br",null),r.a.createElement(l.a,null,"If you sell at ",i.a.formatMoney(d),", then you will sell"," ",i.a.format(p,"0.00000"),"x as much compared to if you sold at market price."),r.a.createElement(c.a,{type:"number",onChange:function(t){o(parseFloat(t.target.value))},value:n}),r.a.createElement("br",null),r.a.createElement(f.a,{control:r.a.createElement(u.a,{checked:t.product.marketTa2,onChange:function(e){t.product.marketTa2=e.target.checked,h(t=>!t)}}),label:r.a.createElement(m.a,{title:r.a.createElement(l.a,null,"If this is enabled, then this Material will automatically be sold at the optimal price such that the amount sold matches the amount produced. (i.e. the highest possible price, while still ensuring that all produced materials will be sold)")},r.a.createElement(l.a,null,"Use Market-TA.II for Auto-Sale Price"))}))}function d(t){const e=t.product.rat/t.product.mku,n=Object(a.useState)(!1)[1];return r.a.createElement(o.a,{open:t.open,onClose:t.onClose},r.a.createElement(r.a.Fragment,null,r.a.createElement(l.a,{variant:"h4"},"Market-TA.I"),r.a.createElement(l.a,null,"The maximum sale price you can mark this up to is"," ",i.a.formatMoney(t.product.pCost+e),". This means that if you set the sale price higher than this, you will begin to experience a loss in number of sales"),r.a.createElement(f.a,{control:r.a.createElement(u.a,{checked:t.product.marketTa1,onChange:function(e){t.product.marketTa1=e.target.checked,n(t=>!t)}}),label:r.a.createElement(m.a,{title:r.a.createElement(l.a,null,"If this is enabled, then this Material will automatically be sold at the price identified by Market-TA.I (i.e. the price shown above)")},r.a.createElement(l.a,null,"Use Market-TA.I for Auto-Sale Price"))})),r.a.createElement(h,{product:t.product}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(0),r=n.n(a),i=n(38),o=n(48),s=n(1),l=n(8);function c(t){const e=Object(o.c)();return r.a.createElement(i.a,{open:t.open,onClose:t.onClose},r.a.createElement(s.a,null,"Are you sure you want to do this? Canceling a product removes it completely and permanently. You will receive no money back by doing so"),r.a.createElement(l.a,{onClick:function(){e.discontinueProduct(t.product),t.onClose(),t.rerender()}},"Cancel"))}},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return MaterialElem}));var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(0),react__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__),_OfficeSpace__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(380),_modals_ExportModal__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(1211),_modals_MaterialMarketTaModal__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(1212),_modals_SellMaterialModal__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(1213),_modals_PurchaseMaterialModal__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(1214),_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(5),_utils_helpers_isString__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(146),_ui_React_Money__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(20),_Context__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(48),_mui_material_Typography__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(1),_mui_material_Tooltip__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(21),_mui_material_Paper__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(45),_mui_material_Button__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__(8),_mui_material_Box__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__(19),_modals_LimitMaterialProductionModal__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__(1215);function MaterialElem(props){const corp=Object(_Context__WEBPACK_IMPORTED_MODULE_9__.b)(),division=Object(_Context__WEBPACK_IMPORTED_MODULE_9__.c)(),[purchaseMaterialOpen,setPurchaseMaterialOpen]=Object(react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1),[exportOpen,setExportOpen]=Object(react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1),[sellMaterialOpen,setSellMaterialOpen]=Object(react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1),[materialMarketTaOpen,setMaterialMarketTaOpen]=Object(react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1),[limitProductionOpen,setLimitProductionOpen]=Object(react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1),warehouse=props.warehouse,city=props.city,mat=props.mat,markupLimit=mat.getMarkupLimit(),office=division.offices[city];if(!(office instanceof _OfficeSpace__WEBPACK_IMPORTED_MODULE_1__.a))throw new Error(`Could not get OfficeSpace object for this city (${city})`);const nf="0.000",nfB="0.000a",totalGain=mat.buy+mat.prd+mat.imp-mat.sll-mat.totalExp,tutorial=division.newInd&&Object.keys(division.reqMats).includes(mat.name)&&0===mat.buy&&0===mat.imp,purchaseButtonText=`Buy (${_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.a.format(mat.buy,nfB)})`;let sellButtonText;if(mat.sllman[0]){if(sellButtonText=Object(_utils_helpers_isString__WEBPACK_IMPORTED_MODULE_7__.a)(mat.sllman[1])?react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment,null,"Sell (",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.a.format(mat.sll,nfB),"/",mat.sllman[1],")"):react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment,null,"Sell (",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.a.format(mat.sll,nfB),"/",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.a.format(mat.sllman[1],nfB),")"),mat.marketTa2)sellButtonText=react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment,null,sellButtonText," @ ",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_ui_React_Money__WEBPACK_IMPORTED_MODULE_8__.a,{money:mat.marketTa2Price}));else if(mat.marketTa1)sellButtonText=react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment,null,sellButtonText," @ ",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_ui_React_Money__WEBPACK_IMPORTED_MODULE_8__.a,{money:mat.bCost+markupLimit}));else if(mat.sCost)if(Object(_utils_helpers_isString__WEBPACK_IMPORTED_MODULE_7__.a)(mat.sCost)){const sCost=mat.sCost.replace(/MP/g,mat.bCost+"");sellButtonText=react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment,null,sellButtonText," @ ",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_ui_React_Money__WEBPACK_IMPORTED_MODULE_8__.a,{money:eval(sCost)}))}else sellButtonText=react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment,null,sellButtonText," @ ",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_ui_React_Money__WEBPACK_IMPORTED_MODULE_8__.a,{money:mat.sCost}))}else sellButtonText=react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment,null,"Sell (0.000/0.000)");let limitMaterialButtonText="Limit Material";return mat.prdman[0]&&(limitMaterialButtonText+=" ("+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.a.format(mat.prdman[1],nf)+")"),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Paper__WEBPACK_IMPORTED_MODULE_12__.a,null,react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Box__WEBPACK_IMPORTED_MODULE_14__.a,{sx:{display:"grid",gridTemplateColumns:"2fr 1fr",m:"5px"}},react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Box__WEBPACK_IMPORTED_MODULE_14__.a,null,react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Tooltip__WEBPACK_IMPORTED_MODULE_11__.a,{title:react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Typography__WEBPACK_IMPORTED_MODULE_10__.a,null,"Buy: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.a.format(mat.buy,nfB)," ",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),"Prod: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.a.format(mat.prd,nfB)," ",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),"Sell: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.a.format(mat.sll,nfB)," ",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),"Export: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.a.format(mat.totalExp,nfB)," ",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),"Import: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.a.format(mat.imp,nfB),1===corp.unlockUpgrades[2]&&react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),1===corp.unlockUpgrades[2]&&"Demand: "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.a.format(mat.dmd,nf),1===corp.unlockUpgrades[3]&&react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),1===corp.unlockUpgrades[3]&&"Competition: "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.a.format(mat.cmp,nf))},react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Typography__WEBPACK_IMPORTED_MODULE_10__.a,null,mat.name,": ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.a.format(mat.qty,nfB)," (",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.a.format(totalGain,nfB),"/s)")),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Tooltip__WEBPACK_IMPORTED_MODULE_11__.a,{title:react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Typography__WEBPACK_IMPORTED_MODULE_10__.a,null,"Market Price: The price you would pay if you were to buy this material on the market")},react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Typography__WEBPACK_IMPORTED_MODULE_10__.a,null,"MP: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.a.formatMoney(mat.bCost))),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Tooltip__WEBPACK_IMPORTED_MODULE_11__.a,{title:react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Typography__WEBPACK_IMPORTED_MODULE_10__.a,null,"The quality of your material. Higher quality will lead to more sales")},react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Typography__WEBPACK_IMPORTED_MODULE_10__.a,null,"Quality: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.a.format(mat.qlt,"0.00a")))),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Box__WEBPACK_IMPORTED_MODULE_14__.a,{sx:{"& button":{width:"100%"}}},react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Tooltip__WEBPACK_IMPORTED_MODULE_11__.a,{title:tutorial?react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Typography__WEBPACK_IMPORTED_MODULE_10__.a,null,"Purchase your required materials to get production started!"):""},react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Button__WEBPACK_IMPORTED_MODULE_13__.a,{color:tutorial?"error":"primary",onClick:()=>setPurchaseMaterialOpen(!0)},purchaseButtonText)),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_modals_PurchaseMaterialModal__WEBPACK_IMPORTED_MODULE_5__.a,{mat:mat,warehouse:warehouse,open:purchaseMaterialOpen,disablePurchaseLimit:props.warehouse.smartSupplyEnabled&&Object.keys(division.reqMats).includes(props.mat.name),onClose:()=>setPurchaseMaterialOpen(!1)}),1===corp.unlockUpgrades[0]&&react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment,null,react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Button__WEBPACK_IMPORTED_MODULE_13__.a,{onClick:()=>setExportOpen(!0)},"Export"),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_modals_ExportModal__WEBPACK_IMPORTED_MODULE_2__.a,{mat:mat,open:exportOpen,onClose:()=>setExportOpen(!1)})),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Button__WEBPACK_IMPORTED_MODULE_13__.a,{color:division.prodMats.includes(props.mat.name)&&!mat.sllman[0]?"error":"primary",onClick:()=>setSellMaterialOpen(!0)},sellButtonText),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_modals_SellMaterialModal__WEBPACK_IMPORTED_MODULE_4__.a,{mat:mat,open:sellMaterialOpen,onClose:()=>setSellMaterialOpen(!1)}),division.hasResearch("Market-TA.I")&&react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment,null,react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Button__WEBPACK_IMPORTED_MODULE_13__.a,{onClick:()=>setMaterialMarketTaOpen(!0)},"Market-TA"),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_modals_MaterialMarketTaModal__WEBPACK_IMPORTED_MODULE_3__.a,{mat:mat,open:materialMarketTaOpen,onClose:()=>setMaterialMarketTaOpen(!1)})),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Button__WEBPACK_IMPORTED_MODULE_13__.a,{color:tutorial?"error":"primary",onClick:()=>setLimitProductionOpen(!0)},limitMaterialButtonText),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_modals_LimitMaterialProductionModal__WEBPACK_IMPORTED_MODULE_15__.a,{material:mat,open:limitProductionOpen,onClose:()=>setLimitProductionOpen(!1)}))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var a=n(0),r=n.n(a),i=n(14),o=n(62),s=n(38),l=n(48),c=n(409),f=n(1),u=n(76),m=n(8),h=n(19),d=n(74),p=n(130);function g(t){const e=Object(l.b)(),n=e.divisions.filter(e=>Object(c.a)(t.mat.name,e));if(0===n.length)throw new Error("Export popup created with no divisions.");const g=n[0];if(0===Object.keys(g.warehouses).length)throw new Error("Export popup created in a division with no warehouses.");const[y,b]=Object(a.useState)(g.name),[E,v]=Object(a.useState)(Object.keys(g.warehouses)[0]),[k,_]=Object(a.useState)(""),w=Object(a.useState)(!1)[1];function S(e){for(let n=0;n!t)}const x=e.divisions.find(t=>t.name===y);if(void 0===x)throw new Error(`Export popup somehow ended up with undefined division '${x}'`);const C=Object.keys(x.warehouses).filter(t=>0!==x.warehouses[t]);return C.length>0&&!C.includes(E)&&v(C[0]),r.a.createElement(s.a,{open:t.open,onClose:t.onClose},r.a.createElement(f.a,null,"Select the industry and city to export this material to, as well as how much of this material to export per second. You can set the export amount to 'MAX' to export all of the materials in this warehouse."),r.a.createElement(p.a,{onChange:function(t){const n=t.target.value;b(n),v(Object.keys(e.divisions[0].warehouses)[0])},value:y},e.divisions.filter(e=>Object(c.a)(t.mat.name,e)).map(t=>r.a.createElement(d.a,{key:t.name,value:t.name},t.name))),r.a.createElement(p.a,{onChange:function(t){v(t.target.value)},value:E},C.map(t=>{if(0!==x.warehouses[t])return r.a.createElement(d.a,{key:t,value:t},t)})),r.a.createElement(u.a,{placeholder:"Export amount / s",onChange:function(t){_(t.target.value)},value:k}),r.a.createElement(m.a,{onClick:function(){try{Object(o.g)(y,E,t.mat,k,x)}catch(t){Object(i.a)(t+"")}t.onClose()}},"Export"),r.a.createElement(f.a,null,"Below is a list of all current exports of this material from this warehouse. Clicking on one of the exports below will REMOVE that export."),t.mat.exp.map((t,e)=>r.a.createElement(h.a,{display:"flex",alignItems:"center",key:e},r.a.createElement(m.a,{sx:{mx:2},onClick:()=>S(t)},"delete"),r.a.createElement(f.a,null,"Industry: ",t.ind,r.a.createElement("br",null),"City: ",t.city,r.a.createElement("br",null),"Amount/s: ",t.amt))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var a=n(0),r=n.n(a),i=n(5),o=n(38),s=n(48),l=n(1),c=n(76),f=n(333),u=n(277),m=n(21);function h(t){if(!Object(s.c)().hasResearch("Market-TA.II"))return r.a.createElement(r.a.Fragment,null);const[e,n]=Object(a.useState)(t.mat.bCost),o=Object(a.useState)(!1)[1];const h=t.mat.getMarkupLimit();const d=e;let p=1;return d>t.mat.bCost?d-t.mat.bCost>h&&(p=Math.pow(h/(d-t.mat.bCost),2)):d!t)}}),label:r.a.createElement(m.a,{title:r.a.createElement(l.a,null,"If this is enabled, then this Material will automatically be sold at the optimal price such that the amount sold matches the amount produced. (i.e. the highest possible price, while still ensuring that all produced materials will be sold)")},r.a.createElement(l.a,null,"Use Market-TA.II for Auto-Sale Price"))}))}function d(t){const e=Object(a.useState)(!1)[1];const n=t.mat.getMarkupLimit();return r.a.createElement(o.a,{open:t.open,onClose:t.onClose},r.a.createElement(r.a.Fragment,null,r.a.createElement(l.a,{variant:"h4"},"Market-TA.I"),r.a.createElement(l.a,null,"The maximum sale price you can mark this up to is ",i.a.formatMoney(t.mat.bCost+n),". This means that if you set the sale price higher than this, you will begin to experience a loss in number of sales"),r.a.createElement(f.a,{control:r.a.createElement(u.a,{checked:t.mat.marketTa1,onChange:function(n){t.mat.marketTa1=n.target.checked,e(t=>!t)}}),label:r.a.createElement(m.a,{title:r.a.createElement(l.a,null,"If this is enabled, then this Material will automatically be sold at the price identified by Market-TA.I (i.e. the price shown above)")},r.a.createElement(l.a,null,"Use Market-TA.I for Auto-Sale Price"))})),r.a.createElement(h,{mat:t.mat}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var a=n(0),r=n.n(a),i=n(14),o=n(62),s=n(38),l=n(1),c=n(76),f=n(8),u=n(27);function m(t){const[e,n]=Object(a.useState)(t.mat.sllman[1]?t.mat.sllman[1]+"":""),[m,h]=Object(a.useState)(function(t){let e=t.sCost?t.sCost+"":"";return t.marketTa2?e+=" (Market-TA.II)":t.marketTa1&&(e+=" (Market-TA.I)"),e}(t.mat));function d(){try{Object(o.r)(t.mat,e,m)}catch(t){Object(i.a)(t+"")}t.onClose()}function p(t){t.key===u.a.ENTER&&d()}return r.a.createElement(s.a,{open:t.open,onClose:t.onClose},r.a.createElement(l.a,null,"Enter the maximum amount of ",t.mat.name," you would like to sell per second, as well as the price at which you would like to sell at.",r.a.createElement("br",null),r.a.createElement("br",null),"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 material will be discarded",r.a.createElement("br",null),r.a.createElement("br",null),"Setting the sell amount to 'MAX' will result in you always selling the maximum possible amount of the material.",r.a.createElement("br",null),r.a.createElement("br",null),"When setting the sell amount, you can use the 'PROD' variable to designate a dynamically changing amount that depends on your production. For example, if you set the sell amount to 'PROD-5' then you will always sell 5 less of the material than you produce.",r.a.createElement("br",null),r.a.createElement("br",null),"When setting the sell price, you can use the 'MP' variable to designate a dynamically changing price that depends on the market price. For example, if you set the sell price to 'MP+10' then it will always be sold at $10 above the market price."),r.a.createElement("br",null),r.a.createElement(c.a,{value:e,autoFocus:!0,type:"text",placeholder:"Sell amount",onChange:function(t){n(t.target.value)},onKeyDown:p}),r.a.createElement(c.a,{value:m,type:"text",placeholder:"Sell price",onChange:function(t){h(t.target.value)},onKeyDown:p}),r.a.createElement(f.a,{onClick:d},"Confirm"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var a=n(0),r=n.n(a),i=n(14),o=n(179),s=n(5),l=n(62),c=n(38),f=n(48),u=n(1),m=n(76),h=n(8),d=n(27);function p(t){const e=Object(f.b)(),[n,c]=Object(a.useState)(""),[p,g]=Object(a.useState)(!1);function y(t){const e=parseFloat(t.amount),n=e*t.mat.bCost,a=o.a[t.mat.name];return e>(t.warehouse.size-t.warehouse.sizeUsed)/a?(g(!0),r.a.createElement(r.a.Fragment,null,r.a.createElement(u.a,{color:"error"},"Not enough warehouse space to purchase this amount"))):isNaN(n)||e<0?(g(!0),r.a.createElement(r.a.Fragment,null,r.a.createElement(u.a,{color:"error"},"Invalid input for Bulk Purchase amount"))):(g(!1),r.a.createElement(r.a.Fragment,null,r.a.createElement(u.a,null,"Purchasing ",s.a.format(e,"0,0.00")," of ",t.mat.name," will cost"," ",s.a.formatMoney(n))))}function b(){try{Object(l.b)(e,t.warehouse,t.mat,parseFloat(n))}catch(t){Object(i.a)(t+"")}t.onClose()}return r.a.createElement(r.a.Fragment,null,r.a.createElement(u.a,null,"Enter the amount of ",t.mat.name," you would like to bulk purchase. This purchases the specified amount instantly (all at once)."),r.a.createElement(y,{warehouse:t.warehouse,mat:t.mat,amount:n}),r.a.createElement(m.a,{value:n,onChange:function(t){c(t.target.value)},type:"number",placeholder:"Bulk Purchase amount",onKeyDown:function(t){t.key===d.a.ENTER&&b()}}),r.a.createElement(h.a,{disabled:p,onClick:b},"Confirm Bulk Purchase"))}function g(t){const e=Object(f.c)(),[n,o]=Object(a.useState)(t.mat.buy?t.mat.buy:0);function s(){if(null!==n){try{Object(l.e)(t.mat,n)}catch(t){Object(i.a)(t+"")}t.onClose()}}return r.a.createElement(c.a,{open:t.open,onClose:t.onClose},r.a.createElement(r.a.Fragment,null,r.a.createElement(u.a,null,"Enter the amount of ",t.mat.name," you would like to purchase per second. This material's cost changes constantly.",t.disablePurchaseLimit?"Note: Purchase amount is disabled as smart supply is enabled":""),r.a.createElement(m.a,{value:n,onChange:function(t){o(parseFloat(t.target.value))},autoFocus:!0,placeholder:"Purchase amount",type:"number",disabled:t.disablePurchaseLimit,onKeyDown:function(t){t.key===d.a.ENTER&&s()}}),r.a.createElement(h.a,{disabled:t.disablePurchaseLimit,onClick:s},"Confirm"),r.a.createElement(h.a,{disabled:t.disablePurchaseLimit,onClick:function(){t.mat.buy=0,t.onClose()}},"Clear Purchase"),e.hasResearch("Bulk Purchasing")&&r.a.createElement(p,{onClose:t.onClose,mat:t.mat,warehouse:t.warehouse})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var a=n(0),r=n.n(a),i=n(62),o=n(38),s=n(1),l=n(8),c=n(76),f=n(27);function u(t){const[e,n]=Object(a.useState)(null);function u(){let n=e;null===n&&(n=-1),Object(i.k)(t.material,n),t.onClose()}return Object(a.useEffect)(()=>{t.open||n(null)},[t.open]),r.a.createElement(o.a,{open:t.open,onClose:t.onClose},r.a.createElement(s.a,null,"Enter a limit to the amount of this material you would like to produce per second. Leave the box empty to set no limit."),r.a.createElement(c.a,{autoFocus:!0,placeholder:"Limit",type:"number",onChange:function(t){""===t.target.value?n(null):n(parseFloat(t.target.value))},onKeyDown:function(t){t.key===f.a.ENTER&&u()}}),r.a.createElement(l.a,{onClick:u},"Limit production"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var a=n(0),r=n.n(a),i=n(266);function o(t){const e=[];for(const n of Object.keys(t.division.reqMats)){const a=t.division.reqMats[n];void 0!==a&&e.push(String.raw`${a}\text{ }${n}`)}const n=t.division.prodMats.map(t=>"1\\text{ }"+t);return t.division.makesProducts&&n.push("Products"),r.a.createElement(i.a,null,"\\("+e.join("+")+"\\Rightarrow "+n.join("+")+"\\)")}},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var a=n(0),r=n.n(a),i=n(40),o=n(14),s=n(62),l=n(143),c=n(48),f=n(1),u=n(74),m=n(130),h=n(8);function d(t){const e=Object(c.b)(),n=Object(c.c)(),d=Object.keys(n.offices).filter(t=>0===n.offices[t]),[p,g]=Object(a.useState)(d[0]),y=e.fundsr.a.createElement(u.a,{key:t,value:t},t))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var a=n(0),r=n.n(a),i=n(14),o=n(51),s=n(48),l=n(62),c=n(1),f=n(8),u=n(76),m=n(74),h=n(19),d=n(130),p=n(27);function g(t){const e=Object(s.b)(),n=Object.keys(o.a).sort().filter(t=>void 0===e.divisions.find(e=>e.type===t)).sort(),[g,y]=Object(a.useState)(n.length>0?n[0]:""),[b,E]=Object(a.useState)(""),v=o.d[g];if(void 0===v)throw new Error(`Invalid industry: '${g}'`);const k=e.fundsr.a.createElement(m.a,{key:t,value:t},t))),r.a.createElement(c.a,null,w(e)),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(c.a,null,"Division name:"),r.a.createElement(h.a,{display:"flex",alignItems:"center"},r.a.createElement(u.a,{autoFocus:!0,value:b,onChange:function(t){E(t.target.value)},onKeyDown:function(t){t.key===p.a.ENTER&&_()},type:"text",InputProps:{endAdornment:r.a.createElement(f.a,{disabled:k,sx:{mx:1},onClick:_},"Expand")}})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return R}));var a=n(0),r=n.n(a),i=n(1220),o=n(1221),s=n(1222),l=n(1223),c=n(1224),f=n(1225),u=n(1226),m=n(1227),h=n(1228),d=n(26),p=n(40),g=n(268),y=n(381),b=n(10),E=n(5),v=n(22),k=n(20),_=n(112),w=n(201),S=n(29),x=n(48),C=n(1),L=n(21),O=n(8),M=n(19),T=n(45),A=n(278);function R({rerender:t}){const e=S.b.Player(),n=Object(x.b)(),a=n.revenue-n.expenses,i=[];function o(t,e){1!==e&&i.push([t,E.a.format(e,"0.000")])}return o("Production Multiplier: ",n.getProductionMultiplier()),o("Storage Multiplier: ",n.getStorageMultiplier()),o("Advertising Multiplier: ",n.getAdvertisingMultiplier()),o("Empl. Creativity Multiplier: ",n.getEmployeeCreMultiplier()),o("Empl. Charisma Multiplier: ",n.getEmployeeChaMultiplier()),o("Empl. Intelligence Multiplier: ",n.getEmployeeIntMultiplier()),o("Empl. Efficiency Multiplier: ",n.getEmployeeEffMultiplier()),o("Sales Multiplier: ",n.getSalesMultiplier()),o("Scientific Research Multiplier: ",n.getScientificResearchMultiplier()),r.a.createElement(r.a.Fragment,null,r.a.createElement(w.a,{rows:[["Total Funds:",r.a.createElement(k.a,{money:n.funds})],["Total Revenue:",r.a.createElement(_.a,{money:n.revenue})],["Total Expenses:",r.a.createElement(_.a,{money:n.expenses})],["Total Profit:",r.a.createElement(_.a,{money:n.revenue-n.expenses})],["Publicly Traded:",n.public?"Yes":"No"],["Owned Stock Shares:",E.a.format(n.numShares,"0.000a")],["Stock Price:",n.public?r.a.createElement(k.a,{money:n.sharePrice}):"N/A"]]}),r.a.createElement("br",null),r.a.createElement(M.a,{display:"flex"},r.a.createElement(L.a,{title:r.a.createElement(w.a,{rows:[["Outstanding Shares:",E.a.format(n.issuedShares,"0.000a")],["Private Shares:",E.a.format(n.totalShares-n.issuedShares-n.numShares,"0.000a")]]})},r.a.createElement(C.a,null,"Total Stock Shares: ",E.a.format(n.totalShares,"0.000a")))),r.a.createElement("br",null),r.a.createElement(D,{profit:a}),r.a.createElement("br",null),r.a.createElement(w.a,{rows:i}),r.a.createElement("br",null),r.a.createElement(j,null),r.a.createElement(M.a,{sx:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",width:"fit-content"}},r.a.createElement(L.a,{title:r.a.createElement(C.a,null,"Get a copy of and read 'The Complete Handbook for Creating a Successful Corporation.' This is a .lit file that guides you through the beginning of setting up a Corporation and provides some tips/pointers for helping you get started with managing it.")},r.a.createElement(O.a,{onClick:()=>n.getStarterGuide(e)},"Getting Started Guide")),n.public?r.a.createElement(I,{rerender:t}):r.a.createElement(N,{rerender:t}),r.a.createElement(F,null)),r.a.createElement("br",null),r.a.createElement(P,{rerender:t}))}function N({rerender:t}){const e=Object(x.b)(),[n,i]=Object(a.useState)(!1),[o,s]=Object(a.useState)(!1),l=e.fundingRound<4,c=l?"Search for private investors who will give you startup funding in exchange for equity (stock shares) in your company":"";return r.a.createElement(r.a.Fragment,null,r.a.createElement(L.a,{title:r.a.createElement(C.a,null,c)},r.a.createElement(O.a,{disabled:!l,onClick:()=>i(!0)},"Find Investors")),r.a.createElement(L.a,{title:r.a.createElement(C.a,null,"Become a publicly traded and owned entity. Going public involves issuing shares for an IPO. Once you are a public company, your shares will be traded on the stock market.")},r.a.createElement(O.a,{onClick:()=>s(!0)},"Go Public")),r.a.createElement(m.a,{open:n,onClose:()=>i(!1),rerender:t}),r.a.createElement(h.a,{open:o,onClose:()=>s(!1),rerender:t}))}function P({rerender:t}){const e=Object(x.b)();return e.divisions.length<=0?r.a.createElement(C.a,{variant:"h4"},"Upgrades are unlocked once you create an industry."):r.a.createElement(r.a.Fragment,null,r.a.createElement(T.a,{sx:{p:1,my:1}},r.a.createElement(C.a,{variant:"h4"},"Unlocks"),r.a.createElement(A.a,{container:!0},Object.values(g.b).filter(t=>!e.unlockUpgrades[t.index]).map(e=>r.a.createElement(o.a,{rerender:t,upgradeData:e,key:e.index})))),r.a.createElement(T.a,{sx:{p:1,my:1}},r.a.createElement(C.a,{variant:"h4"},"Upgrades"),r.a.createElement(A.a,{container:!0},e.upgrades.map((t,e)=>y.a[e]).map(e=>r.a.createElement(i.a,{rerender:t,upgrade:e,key:e.index})))))}function I({rerender:t}){const e=Object(x.b)(),[n,i]=Object(a.useState)(!1),[o,s]=Object(a.useState)(!1),[m,h]=Object(a.useState)(!1),[d,p]=Object(a.useState)(!1),g=e.shareSaleCooldown>0,y=g?"Cannot sell shares for "+e.convertCooldownToString(e.shareSaleCooldown):"Sell your shares in the company. The money earned from selling your shares goes into your personal account, not the Corporation's. This is one of the only ways to profit from your business venture.",b=e.issueNewSharesCooldown>0,E=b?"Cannot issue new shares for "+e.convertCooldownToString(e.issueNewSharesCooldown):"Issue new equity shares to raise capital.";return r.a.createElement(r.a.Fragment,null,r.a.createElement(L.a,{title:r.a.createElement(C.a,null,y)},r.a.createElement(O.a,{disabled:g,onClick:()=>i(!0)},"Sell Shares")),r.a.createElement(l.a,{open:n,onClose:()=>i(!1),rerender:t}),r.a.createElement(L.a,{title:r.a.createElement(C.a,null,"Buy back shares you that previously issued or sold at market price.")},r.a.createElement(O.a,{disabled:e.issuedShares<1,onClick:()=>s(!0)},"Buyback shares")),r.a.createElement(c.a,{open:o,onClose:()=>s(!1),rerender:t}),r.a.createElement(L.a,{title:r.a.createElement(C.a,null,E)},r.a.createElement(O.a,{disabled:b,onClick:()=>h(!0)},"Issue New Shares")),r.a.createElement(u.a,{open:m,onClose:()=>h(!1)}),r.a.createElement(L.a,{title:r.a.createElement(C.a,null,"Manage the dividends that are paid out to shareholders (including yourself)")},r.a.createElement(O.a,{onClick:()=>p(!0)},"Issue Dividends")),r.a.createElement(f.a,{open:d,onClose:()=>p(!1)}))}function F(){const t=S.b.Player(),e=Object(x.b)(),[n,i]=Object(a.useState)(!1),o=e.determineValuation()>=p.a.BribeThreshold&&t.factions.filter(t=>d.a[t].getInfo().offersWork()).length>0;return r.a.createElement(r.a.Fragment,null,r.a.createElement(L.a,{title:o?"Use your Corporations power and influence to bribe Faction leaders in exchange for reputation":"Your Corporation is not powerful enough to bribe Faction leaders"},r.a.createElement(O.a,{disabled:!o,onClick:function(){o&&i(!0)}},"Bribe Factions")),r.a.createElement(s.a,{open:n,onClose:()=>i(!1)}))}function D({profit:t}){const e=Object(x.b)();if(e.dividendPercentage<=0||t<=0)return r.a.createElement(r.a.Fragment,null);const n=e.dividendPercentage/100*t,a=t-n,i=n/e.totalShares;return r.a.createElement(w.a,{rows:[["Retained Profits (after dividends):",r.a.createElement(_.a,{money:a})],["Dividend Percentage:",E.a.format(e.dividendPercentage/100,"0%")],["Dividends per share:",r.a.createElement(_.a,{money:i})],["Your earnings as a shareholder:",r.a.createElement(_.a,{money:e.getDividends()})]]})}function j(){const t=Object(x.b)().storedCycles*b.a.MilliPerCycle;return t<=15e3?r.a.createElement(r.a.Fragment,null):r.a.createElement(C.a,null,"Bonus time: ",Object(v.d)(t),r.a.createElement("br",null),r.a.createElement("br",null))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var a=n(0),r=n.n(a),i=n(14),o=n(62),s=n(143),l=n(48),c=n(1),f=n(21),u=n(8),m=n(19),h=n(278);function d(t){const e=Object(l.b)(),n=t.upgrade,a=e.upgrades[n.index],d=n.basePrice,p=n.priceMult,g=d*Math.pow(p,a),y=n.desc;return r.a.createElement(h.a,{item:!0,xs:4},r.a.createElement(m.a,{display:"flex",alignItems:"center",flexDirection:"row-reverse"},r.a.createElement(u.a,{disabled:e.funds!!i.a[t].getInfo().offersWork()&&!e.hasGangWith(t)),b=Object(u.b)(),[E,v]=Object(a.useState)(0),[k,_]=Object(a.useState)(0),[w,S]=Object(a.useState)(n.length>0?n[0]:""),x=null===E||null===k||0===E&&0===k||isNaN(E)||isNaN(k)||E<0||k<0||b.fundsb.numShares;function C(t,e){return(t+e*b.sharePrice)/o.a.BribeToRepRatio}return r.a.createElement(c.a,{open:t.open,onClose:t.onClose},r.a.createElement(m.a,null,"You can use Corporation funds or stock shares to bribe Faction Leaders in exchange for faction reputation."),r.a.createElement(g.a,{display:"flex",alignItems:"center"},r.a.createElement(m.a,null,"Faction:"),r.a.createElement(y.a,{value:w,onChange:function(t){S(t.target.value)}},n.map(t=>{if(i.a[t].getInfo().offersWork()&&!e.hasGangWith(t))return r.a.createElement(d.a,{key:t,value:t},t)}))),r.a.createElement(m.a,null,function(t,e){return 0===t&&0===e?"":isNaN(t)||isNaN(e)||t<0||e<0?"ERROR: Invalid value(s) entered":b.fundsb.numShares?"ERROR: You do not have this many shares to bribe with":"You will gain "+s.a.formatReputation(C(t,e))+" reputation with "+w+" with this bribe"}(E||0,k||0)),r.a.createElement(p.a,{onChange:function(t){v(parseFloat(t.target.value))},placeholder:"Corporation funds"}),r.a.createElement(p.a,{sx:{mx:1},onChange:function(t){_(parseFloat(t.target.value))},placeholder:"Stock Shares"}),r.a.createElement(h.a,{disabled:x,sx:{mx:1},onClick:()=>function(e,n){const a=i.a[w];if(x)return;const r=C(e,n);Object(l.a)("You gained "+s.a.formatReputation(r)+" reputation with "+a.name+" by bribing them."),a.playerReputation+=r,b.funds=b.funds-e,b.numShares-=n,t.onClose()}(E||0,k||0)},"Bribe"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var a=n(0),r=n.n(a),i=n(5),o=n(14),s=n(38),l=n(29),c=n(48),f=n(1),u=n(76),m=n(8),h=n(20),d=n(62),p=n(27);function g(t){const e=l.b.Player(),n=Object(c.b)(),[g,y]=Object(a.useState)(null),b=null===g||isNaN(g)||g<=0||g>n.numShares;function E(t){if(null===t.shares)return r.a.createElement(r.a.Fragment,null);let e="";if(isNaN(t.shares)||t.shares<=0)e="ERROR: Invalid value entered for number of shares to sell";else if(t.shares>n.numShares)e="You don't have this many shares to sell!";else{const a=n.calculateShareSale(t.shares)[0];e=`Sell ${t.shares} shares for a total of ${i.a.formatMoney(a)}`}return r.a.createElement(f.a,null,r.a.createElement("small",null,e))}function v(){if(!b)try{const a=Object(d.t)(n,e,g);t.onClose(),Object(o.a)(r.a.createElement(r.a.Fragment,null,"Sold ",i.a.formatMoney(g)," shares for",r.a.createElement(h.a,{money:a}),". The corporation's stock price fell to  ",r.a.createElement(h.a,{money:n.sharePrice}),"as a result of dilution.")),t.rerender()}catch(t){Object(o.a)(t+"")}}return r.a.createElement(s.a,{open:t.open,onClose:t.onClose},r.a.createElement(f.a,null,"Enter the number of shares you would like to sell. The money from selling your shares will go directly to you (NOT your Corporation).",r.a.createElement("br",null),r.a.createElement("br",null),"Selling your shares will cause your corporation's stock price to fall due to dilution. Furthermore, selling a large number of shares all at once will have an immediate effect in reducing your stock price.",r.a.createElement("br",null),r.a.createElement("br",null),"The current price of your company's stock is ",i.a.formatMoney(n.sharePrice)),r.a.createElement("br",null),r.a.createElement(u.a,{variant:"standard",autoFocus:!0,type:"number",placeholder:"Shares to sell",onChange:function(t){""===t.target.value?y(null):y(Math.round(parseFloat(t.target.value)))},onKeyDown:function(t){t.key===p.a.ENTER&&v()}}),r.a.createElement(m.a,{disabled:b,onClick:v,sx:{mx:1}},"Sell shares"),r.a.createElement(E,{shares:g,corp:n}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var a=n(0),r=n.n(a),i=n(38),o=n(5),s=n(29),l=n(48),c=n(1),f=n(8),u=n(76),m=n(62),h=n(14),d=n(27);function p(t){const e=s.b.Player(),n=Object(l.b)(),[p,g]=Object(a.useState)(null);const y=1.1*n.sharePrice,b=null===p||isNaN(p)||p<=0||p>n.issuedShares||p*y>e.money;function E(){if(!b){try{Object(m.c)(n,e,p)}catch(t){Object(h.a)(t+"")}t.onClose(),t.rerender()}}function v(){return null===p?r.a.createElement(r.a.Fragment,null):isNaN(p)||p<=0?r.a.createElement(r.a.Fragment,null,"ERROR: Invalid value entered for number of shares to buyback"):p>n.issuedShares?r.a.createElement(r.a.Fragment,null,"There are not this many shares available to buy back. There are only"," ",o.a.formatBigNumber(n.issuedShares)," outstanding shares."):r.a.createElement(r.a.Fragment,null,"Purchase ",p," shares for a total of ",o.a.formatMoney(p*y))}return r.a.createElement(i.a,{open:t.open,onClose:t.onClose},r.a.createElement(c.a,null,"Enter the number of outstanding shares you would like to buy back. These shares must be bought at a 10% premium. However, repurchasing shares from the market tends to lead to an increase in stock price.",r.a.createElement("br",null),r.a.createElement("br",null),"To purchase these shares, you must use your own money (NOT your Corporation's funds).",r.a.createElement("br",null),r.a.createElement("br",null),"The current buyback price of your company's stock is ",o.a.formatMoney(y),". Your company currently has ",o.a.formatBigNumber(n.issuedShares)," outstanding stock shares."),r.a.createElement(v,null),r.a.createElement("br",null),r.a.createElement(u.a,{autoFocus:!0,type:"number",placeholder:"Shares to buyback",onChange:function(t){""===t.target.value?g(null):g(Math.round(parseFloat(t.target.value)))},onKeyDown:function(t){t.key===d.a.ENTER&&E()}}),r.a.createElement(f.a,{disabled:b,onClick:E},"Buy shares"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var a=n(0),r=n.n(a),i=n(14),o=n(38),s=n(40),l=n(62),c=n(48),f=n(1),u=n(76),m=n(8),h=n(27);function d(t){const e=Object(c.b)(),[n,d]=Object(a.useState)(0),p=!isNaN(n)&&n>=0&&n<=100*s.a.DividendMaxPercentage;function g(){if(p&&null!==n){try{Object(l.i)(e,n/100)}catch(t){Object(i.a)(t+"")}t.onClose()}}return r.a.createElement(o.a,{open:t.open,onClose:t.onClose},r.a.createElement(f.a,null,"Dividends are a distribution of a portion of the corporation's profits to the shareholders. This includes yourself, as well.",r.a.createElement("br",null),r.a.createElement("br",null),"In order to issue dividends, simply allocate some percentage of your corporation's profits to dividends. This percentage must be an integer between 0 and 100. (A percentage of 0 means no dividends will be issued)",r.a.createElement("br",null),r.a.createElement("br",null),"Two important things to note:",r.a.createElement("br",null),"* Issuing dividends will negatively affect your corporation's stock price",r.a.createElement("br",null),r.a.createElement("br",null),"Example: Assume your corporation makes $100m / sec in profit and you allocate 40% of that towards dividends. That means your corporation will gain $60m / sec in funds and the remaining $40m / sec will be paid as dividends. Since your corporation starts with 1 billion shares, every shareholder will be paid $0.04 per share per second before taxes."),r.a.createElement(u.a,{autoFocus:!0,value:n,onChange:function(t){if(""===t.target.value)d(0);else{let e=parseFloat(t.target.value);e>100&&(e=100),e<0&&(e=0),d(e)}},onKeyDown:function(t){t.key===h.a.ENTER&&g()},placeholder:"Dividend %",type:"number"}),r.a.createElement(m.a,{disabled:!p,sx:{mx:1},onClick:g},"Allocate Dividend Percentage"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var a=n(0),r=n.n(a),i=n(5),o=n(14),s=n(38),l=n(33),c=n(40),f=n(48),u=n(1),m=n(76),h=n(8),d=n(27);function p(t){const e=Object(f.b)();if(null===t.shares)return r.a.createElement(r.a.Fragment,null);const n=Math.round(.9*e.sharePrice),a=Math.round(.2*e.totalShares),o=a-a%1e6;let s=t.shares;return isNaN(s)?r.a.createElement(u.a,null,"Invalid input"):(s/=1e7,s=1e7*Math.round(s),s<1e7?r.a.createElement(u.a,null,"Must issue at least 10 million new shares"):s>o?r.a.createElement(u.a,null,"You cannot issue that many shares"):r.a.createElement(u.a,null,"Issue ",i.a.format(s,"0.000a")," new shares for"," ",i.a.formatMoney(s*n),"?"))}function g(t){const e=Object(f.b)(),[n,g]=Object(a.useState)(null),y=Math.round(.2*e.totalShares),b=y-y%1e6,E=1e7*Math.round((n||0)/1e7),v=null===n||isNaN(E)||E<1e7||E>b;function k(){if(null===n)return;if(v)return;const a=Math.round(.9*e.sharePrice);let r=n;r=1e7*Math.round(r/1e7);const s=r*a;e.issueNewSharesCooldown=c.a.IssueNewSharesCooldown,e.totalShares+=r;let f=Object(l.a)(0,Math.round(r/2));f=1e6*Math.round(f/1e6),e.issuedShares+=r-f,e.funds=e.funds+s,e.immediatelyUpdateSharePrice(),t.onClose(),Object(o.a)(`Issued ${i.a.format(r,"0.000a")} and raised ${i.a.formatMoney(s)}. ${i.a.format(f,"0.000a")} of these shares were bought by private investors.

Stock price decreased to `+i.a.formatMoney(e.sharePrice))}return r.a.createElement(s.a,{open:t.open,onClose:t.onClose},r.a.createElement(u.a,null,"You can issue new equity shares (i.e. stocks) in order to raise capital for your corporation.",r.a.createElement("br",null),r.a.createElement("br",null)," * You can issue at most ",i.a.formatMoney(b)," new shares",r.a.createElement("br",null)," * New shares are sold at a 10% discount",r.a.createElement("br",null)," * You can only issue new shares once every 12 hours",r.a.createElement("br",null)," * Issuing new shares causes dilution, resulting in a decrease in stock price and lower dividends per share",r.a.createElement("br",null)," * Number of new shares issued must be a multiple of 10 million",r.a.createElement("br",null),r.a.createElement("br",null),"When you choose to issue new equity, private shareholders have first priority for up to 50% of the new shares. If they choose to exercise this option, these newly issued shares become private, restricted shares, which means you cannot buy them back."),r.a.createElement(p,{shares:n}),r.a.createElement(m.a,{autoFocus:!0,placeholder:"# New Shares",onChange:function(t){""===t.target.value?g(null):g(parseFloat(t.target.value))},onKeyDown:function(t){t.key===d.a.ENTER&&k()}}),r.a.createElement(h.a,{disabled:v,onClick:k,sx:{mx:1}},"Issue New Shares"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var a=n(0),r=n.n(a),i=n(5),o=n(40),s=n(38),l=n(48),c=n(1),f=n(8);function u(t){const e=Object(l.b)(),n=e.determineValuation();if(e.fundingRound>=o.a.FundingRoundShares.length||e.fundingRound>=o.a.FundingRoundMultiplier.length)return r.a.createElement(r.a.Fragment,null);const a=o.a.FundingRoundShares[e.fundingRound],u=n*a*o.a.FundingRoundMultiplier[e.fundingRound],m=Math.floor(o.a.INITIALSHARES*a);return r.a.createElement(s.a,{open:t.open,onClose:t.onClose},r.a.createElement(c.a,null,"An investment firm has offered you ",i.a.formatMoney(u)," in funding in exchange for a"," ",i.a.format(100*a,"0.000a"),"% stake in the company (",i.a.format(m,"0.000a")," shares).",r.a.createElement("br",null),r.a.createElement("br",null),"Do you accept or reject this offer?",r.a.createElement("br",null),r.a.createElement("br",null),"Hint: Investment firms will offer more money if your corporation is turning a profit"),r.a.createElement(f.a,{onClick:function(){e.fundingRound++,e.addFunds(u),e.numShares-=m,t.rerender(),t.onClose()}},"Accept"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var a=n(0),r=n.n(a),i=n(14),o=n(38),s=n(5),l=n(48),c=n(1),f=n(8),u=n(76),m=n(19),h=n(27);function d(t){const e=Object(l.b)(),[n,d]=Object(a.useState)(""),p=e.determineValuation()/e.totalShares;function g(){const a=parseFloat(n),r=e.determineValuation()/e.totalShares;isNaN(a)?Object(i.a)("Invalid value for number of issued shares"):a>e.numShares?Object(i.a)("Error: You don't have that many shares to issue!"):(e.public=!0,e.sharePrice=r,e.issuedShares=a,e.numShares-=a,e.addFunds(a*r),t.rerender(),Object(i.a)(`You took your ${e.name} public and earned `+s.a.formatMoney(a*r)+" in your IPO"),t.onClose())}return r.a.createElement(o.a,{open:t.open,onClose:t.onClose},r.a.createElement(c.a,null,"Enter the number of shares you would like to issue for your IPO. These shares will be publicly sold and you will no longer own them. Your Corporation will receive ",s.a.formatMoney(p)," per share (the IPO money will be deposited directly into your Corporation's funds).",r.a.createElement("br",null),r.a.createElement("br",null),"You have a total of ",s.a.format(e.numShares,"0.000a")," of shares that you can issue."),r.a.createElement(m.a,{display:"flex",alignItems:"center"},r.a.createElement(u.a,{value:n,onChange:function(t){d(t.target.value)},autoFocus:!0,type:"number",placeholder:"Shares to issue",onKeyDown:function(t){t.key===h.a.ENTER&&g()}}),r.a.createElement(f.a,{disabled:parseFloat(n)<0||parseFloat(n)>e.numShares,sx:{mx:1},onClick:g},"Go Public")))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(0),r=n.n(a),i=n(29),o=n(482),s=n(1230),l=n(1241);function c(t){const e=i.b.Player(),n=i.b.Router(),[c,f]=Object(a.useState)(!1);if(void 0===t.location.infiltrationData)throw new Error("Trying to do infiltration on invalid location.");const u=t.location.infiltrationData.startingSecurityLevel,m=Object(o.a)(e,u),h=Object(o.b)(e,u);return r.a.createElement("div",{style:{display:"flex",alignItems:"center",height:"calc(100vh - 16px)"}},c?r.a.createElement(s.a,{StartingDifficulty:u,Difficulty:m,Reward:h,MaxLevel:t.location.infiltrationData.maxClearanceLevel}):r.a.createElement(l.a,{Location:t.location,Difficulty:m,MaxLevel:t.location.infiltrationData.maxClearanceLevel,start:()=>f(!0),cancel:function(){n.toCity()}}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return w}));var a,r=n(1),i=n(249),o=n(45),s=n(8),l=n(0),c=n.n(l),f=n(12),u=n(29),m=n(1231),h=n(1232),d=n(1233),p=n(1234),g=n(1235),y=n(1236),b=n(1237),E=n(1238),v=n(1239),k=n(1240);!function(t){t[t.Countdown=0]="Countdown",t[t.Minigame=1]="Minigame",t[t.Result=2]="Result",t[t.Sell=3]="Sell"}(a||(a={}));const _=[E.a,h.a,m.a,d.a,p.a,y.a,b.a,k.a];function w(t){const e=u.b.Player(),n=u.b.Router(),[m,h]=Object(l.useState)(1),[d,p]=Object(l.useState)(a.Countdown),[y,b]=Object(l.useState)(""),[E,k]=Object(l.useState)({lastGames:[-1,-1],id:Math.floor(Math.random()*_.length)});function w(){let t=E.lastGames[0];const e=[E.lastGames[0],E.lastGames[1],E.id];for(;e.includes(t);)t=Math.floor(Math.random()*_.length);return t}function S(){k({lastGames:[E.lastGames[1],E.id],id:w()})}function x(t){b(e=>{let n=e;return n+=t?"✓":"✗",n.length>15&&(n=n.slice(1)),n})}let C;switch(d){case a.Countdown:C=c.a.createElement(g.a,{onFinish:()=>p(a.Minigame)});break;case a.Minigame:{const r=_[E.id];C=c.a.createElement(r,{onSuccess:function(){x(!0),m===t.MaxLevel?p(a.Sell):(p(a.Countdown),h(m+1)),S()},onFailure:function(r){p(a.Countdown),x(!1);const i=null!=r&&r.automated?e.hp:3*t.StartingDifficulty*(e.hasAugmentation(f.a.WKSharmonizer,!0)?.5:1);e.takeDamage(i)?n.toCity():S()},difficulty:t.Difficulty+m/50});break}case a.Sell:C=c.a.createElement(v.a,{StartingDifficulty:t.StartingDifficulty,Difficulty:t.Difficulty,Reward:t.Reward,MaxLevel:t.MaxLevel})}function L(){return c.a.createElement(r.a,{variant:"h4"},c.a.createElement("span",{style:{color:"gray"}},y.slice(0,y.length-1)),y[y.length-1])}return c.a.createElement(i.a,null,c.a.createElement(o.a,{sx:{p:1,mb:1,display:"grid",justifyItems:"center",gap:1}},d!==a.Sell&&c.a.createElement(s.a,{sx:{width:"100%"},onClick:function(){n.toCity()}},"Cancel Infiltration"),c.a.createElement(r.a,{variant:"h5"},"Level ",m," / ",t.MaxLevel),c.a.createElement(L,null)),C)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var a=n(45),r=n(1),i=n(0),o=n.n(i),s=n(12),l=n(2),c=n(27),f=n(134),u=n(620),m=n(219),h=n(205),d=n(220);const p={Trivial:{timer:16e3,min:3,max:4},Normal:{timer:12500,min:2,max:3},Hard:{timer:15e3,min:3,max:4},Impossible:{timer:8e3,min:4,max:4}};function g(t){const e={timer:0,min:0,max:0};Object(m.a)(p,t.difficulty,e);const n=e.timer,[g]=Object(i.useState)(function(t){const e=Object(f.e)(t.min,t.max);let n="";for(let t=0;t0&&(n+=" "),n+=y[Math.floor(Math.random()*y.length)];return n}(e)),[b,E]=Object(i.useState)(""),v=l.a.hasAugmentation(s.a.ChaosOfDionysus,!0);return o.a.createElement(o.a.Fragment,null,o.a.createElement(h.a,{millis:n,onExpire:t.onFailure}),o.a.createElement(a.a,{sx:{display:"grid",justifyItems:"center",pb:1}},o.a.createElement(r.a,{variant:"h4"},"Type it",v?"":" backward"),o.a.createElement(d.a,{onKeyDown:function(e){if(e.preventDefault(),function(t){return t.key===c.a.BACKSPACE||t.shiftKey&&"Shift"===t.key||t.ctrlKey||t.altKey}(e))return;const n=b+e.key.toUpperCase();g.startsWith(n)?g===n?t.onSuccess():E(n):t.onFailure()},onFailure:t.onFailure}),o.a.createElement(r.a,{style:{transform:v?"none":"scaleX(-1)"}},g),o.a.createElement(r.a,null,b,o.a.createElement(u.a,null))))}const y=["ALGORITHM","ANALOG","APP","APPLICATION","ARRAY","BACKUP","BANDWIDTH","BINARY","BIT","BITE","BITMAP","BLOG","BLOGGER","BOOKMARK","BOOT","BROADBAND","BROWSER","BUFFER","BUG","BUS","BYTE","CACHE","CAPS LOCK","CAPTCHA","CD","CD-ROM","CLIENT","CLIPBOARD","CLOUD","COMPUTING","COMMAND","COMPILE","COMPRESS","COMPUTER","CONFIGURE","COOKIE","COPY","CPU","CYBERCRIME","CYBERSPACE","DASHBOARD","DATA","MINING","DATABASE","DEBUG","DECOMPRESS","DELETE","DESKTOP","DEVELOPMENT","DIGITAL","DISK","DNS","DOCUMENT","DOMAIN","DOMAIN NAME","DOT","DOT MATRIX","DOWNLOAD","DRAG","DVD","DYNAMIC","EMAIL","EMOTICON","ENCRYPT","ENCRYPTION","ENTER","EXABYTE","FAQ","FILE","FINDER","FIREWALL","FIRMWARE","FLAMING","FLASH","FLASH DRIVE","FLOPPY DISK","FLOWCHART","FOLDER","FONT","FORMAT","FRAME","FREEWARE","GIGABYTE","GRAPHICS","HACK","HACKER","HARDWARE","HOME PAGE","HOST","HTML","HYPERLINK","HYPERTEXT","ICON","INBOX","INTEGER","INTERFACE","INTERNET","IP ADDRESS","ITERATION","JAVA","JOYSTICK","JUNKMAIL","KERNEL","KEY","KEYBOARD","KEYWORD","LAPTOP","LASER PRINTER","LINK","LINUX","LOG OUT","LOGIC","LOGIN","LURKING","MACINTOSH","MACRO","MAINFRAME","MALWARE","MEDIA","MEMORY","MIRROR","MODEM","MONITOR","MOTHERBOARD","MOUSE","MULTIMEDIA","NET","NETWORK","NODE","NOTEBOOK","COMPUTER","OFFLINE","ONLINE","OPENSOURCE","OPERATING","SYSTEM","OPTION","OUTPUT","PAGE","PASSWORD","PASTE","PATH","PHISHING","PIRACY","PIRATE","PLATFORM","PLUGIN","PODCAST","POPUP","PORTAL","PRINT","PRINTER","PRIVACY","PROCESS","PROGRAM","PROGRAMMER","PROTOCOL","QUEUE","QWERTY","RAM","REALTIME","REBOOT","RESOLUTION","RESTORE","ROM","ROOT","ROUTER","RUNTIME","SAVE","SCAN","SCANNER","SCREEN","SCREENSHOT","SCRIPT","SCROLL","SCROLL","SEARCH","ENGINE","SECURITY","SERVER","SHAREWARE","SHELL","SHIFT","SHIFT KEY","SNAPSHOT","SOCIAL NETWORKING","SOFTWARE","SPAM","SPAMMER","SPREADSHEET","SPYWARE","STATUS","STORAGE","SUPERCOMPUTER","SURF","SYNTAX","TABLE","TAG","TERMINAL","TEMPLATE","TERABYTE","TEXT EDITOR","THREAD","TOOLBAR","TRASH","TROJAN HORSE","TYPEFACE","UNDO","UNIX","UPLOAD","URL","USER","USER INTERFACE","USERNAME","UTILITY","VERSION","VIRTUAL","VIRTUAL MEMORY","VIRUS","WEB","WEBMASTER","WEBSITE","WIDGET","WIKI","WINDOW","WINDOWS","WIRELESS","PROCESSOR","WORKSTATION","WEB","WORM","WWW","XML","ZIP"]},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var a=n(45),r=n(1),i=n(0),o=n.n(i),s=n(12),l=n(2),c=n(27),f=n(134),u=n(620),m=n(219),h=n(205),d=n(220);const p={Trivial:{timer:8e3,min:2,max:3},Normal:{timer:6e3,min:4,max:5},Hard:{timer:4e3,min:4,max:6},Impossible:{timer:2500,min:7,max:7}};function g(t){const e={timer:0,min:0,max:0};Object(m.a)(p,t.difficulty,e);const n=e.timer,[g,y]=Object(i.useState)(""),[b]=Object(i.useState)(function(t){let e="";const n=[c.a.OPEN_BRACKET,c.a.LESS_THAN,c.a.OPEN_PARENTHESIS,c.a.OPEN_BRACE];l.a.hasAugmentation(s.a.WisdomOfAthena,!0)&&n.splice(0,1);const a=Object(f.e)(t.min,t.max);for(let t=0;t0;e--){const n=Math.floor(Math.random()*(e+1)),a=t[e];t[e]=t[n],t[n]=a}}(e),e}(e)),[E,v]=Object(i.useState)(0),[k,_]=Object(i.useState)(0),w=g[k];Object(i.useEffect)(()=>{v(g.findIndex(t=>y.includes(t)))},[g]);const S=c.a.theme.primary,x=c.a.theme.disabled;let C=S,L=S,O=S;if(l.a.hasAugmentation(s.a.BeautyOfAphrodite,!0)){const t=k+1>=g.length?0:k+1;let e=E-t;t>E&&(e=g.length-1-t+E);const n=k-1<0?g.length-1:k-1;let a=n-E;n=a&&!r?L:x,O=r?S:x}return o.a.createElement(o.a.Fragment,null,o.a.createElement(h.a,{millis:n,onExpire:t.onFailure}),o.a.createElement(a.a,{sx:{display:"grid",justifyItems:"center"}},o.a.createElement(r.a,{variant:"h4"},"Say something nice about the guard"),o.a.createElement(d.a,{onKeyDown:function(e){e.preventDefault();const n=e.key;if(n===f.a.SPACE)return void(y.includes(w)?t.onSuccess():t.onFailure());let a=k;for([f.a.UP_ARROW,f.a.W,f.a.RIGHT_ARROW,f.a.D].map(t=>t).includes(n)&&a++,[f.a.DOWN_ARROW,f.a.S,f.a.LEFT_ARROW,f.a.A].map(t=>t).includes(n)&&a--;a<0;)a+=g.length;for(;a>g.length-1;)a-=g.length;_(a)},onFailure:t.onFailure}),o.a.createElement(r.a,{variant:"h5",color:C},u.g),o.a.createElement(r.a,{variant:"h5",color:O},w),o.a.createElement(r.a,{variant:"h5",color:L},u.a)))}const y=["affectionate","agreeable","bright","charming","creative","determined","energetic","friendly","funny","generous","polite","likable","diplomatic","helpful","giving","kind","hardworking","patient","dynamic","loyal","based"],b=["aggressive","aloof","arrogant","big-headed","boastful","boring","bossy","careless","clingy","couch potato","cruel","cynical","grumpy","hot air","know it all","obnoxious","pain in the neck","picky","tactless","thoughtless","cringe"]},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var a=n(45),r=n(1),i=n(0),o=n.n(i),s=n(12),l=n(2),c=n(134),f=n(219),u=n(205),m=n(220);const h={Trivial:{timer:13e3,min:6,max:8},Normal:{timer:7e3,min:7,max:8},Hard:{timer:5e3,min:8,max:9},Impossible:{timer:3e3,min:9,max:10}};function d(t){const e={timer:0,min:0,max:0};Object(f.a)(h,t.difficulty,e);const n=e.timer,[d]=Object(i.useState)(function(t){const e=[c.d,c.f,c.g,c.a];let n="";for(let a=0;a=d.length&&t.onSuccess()):t.onFailure()},onFailure:t.onFailure})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(45),r=n(1),i=n(0),o=n.n(i);function s(t){const[e,n]=Object(i.useState)(3);return Object(i.useEffect)(()=>{0!==e?setTimeout(()=>n(e-1),300):t.onFinish()}),o.a.createElement(a.a,{sx:{p:1,textAlign:"center"}},o.a.createElement(r.a,{variant:"h4"},"Get Ready!"),o.a.createElement(r.a,{variant:"h4"},e))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return y}));var a=n(45),r=n(1),i=n(19),o=n(0),s=n.n(o),l=n(12),c=n(2),f=n(6),u=n(27),m=n(134),h=n(219),d=n(205),p=n(220);const g={Trivial:{timer:12500,width:3,height:3,symbols:6},Normal:{timer:15e3,width:4,height:4,symbols:7},Hard:{timer:12500,width:5,height:5,symbols:8},Impossible:{timer:1e4,width:6,height:6,symbols:9}};function y(t){const e={timer:0,width:0,height:0,symbols:0};Object(h.a)(g,t.difficulty,e);const n=e.timer,[y]=Object(o.useState)(function(t){const e=[];for(let n=0;nt.map((t,n)=>{const a=t===E[v],r=S&&!a?f.a.theme.disabled:f.a.theme.primary;n!==_[0]||e!==_[1]?x.push({color:r,content:t}):x.push({color:r,content:t,selected:!0})}));return s.a.createElement(s.a.Fragment,null,s.a.createElement(d.a,{millis:n,onExpire:t.onFailure}),s.a.createElement(a.a,{sx:{display:"grid",justifyItems:"center",pb:1}},s.a.createElement(r.a,{variant:"h4"},"Match the symbols!"),s.a.createElement(r.a,{variant:"h5",color:f.a.theme.primary},"Targets:"," ",E.map((t,e)=>e==v?s.a.createElement("span",{key:""+e,style:{fontSize:"1em",color:f.a.theme.infolight}},t," "):s.a.createElement("span",{key:""+e,style:{fontSize:"1em",color:f.a.theme.primary}},t," "))),s.a.createElement("br",null),s.a.createElement(i.a,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.round(e.width)}, 1fr)`,gap:1}},x.map(t=>s.a.createElement(r.a,{sx:{fontSize:"2em",color:t.color,border:t.selected?"2px solid "+f.a.theme.infolight:"unset",lineHeight:"unset",p:t.selected?"2px":"4px"}},t.content))),s.a.createElement(p.a,{onKeyDown:function(e){e.preventDefault();const n=[0,0];switch(Object(m.b)(e)){case m.g:n[1]--;break;case m.d:n[0]--;break;case m.a:n[1]++;break;case m.f:n[0]++}const a=[_[0]+n[0],_[1]+n[1]];if(a[0]=(a[0]+y[0].length)%y[0].length,a[1]=(a[1]+y.length)%y.length,w(a),e.key===u.a.SPACE){if(y[_[1]][_[0]]!==E[v])return void t.onFailure();k(v+1),E.length===v+1&&t.onSuccess()}},onFailure:t.onFailure})))}function b(){return"ABCDEF0123456789"[Math.floor(16*Math.random())]}},function(t,e,n){"use strict";n.d(e,"a",(function(){return k}));var a=n(1793),r=n(1794),i=n(691),o=n(45),s=n(1),l=n(19),c=n(115),f=n(0),u=n.n(f),m=n(12),h=n(2),d=n(6),p=n(27),g=n(134),y=n(219),b=n(205),E=n(220);const v={Trivial:{timer:15e3,width:3,height:3,mines:4},Normal:{timer:15e3,width:4,height:4,mines:7},Hard:{timer:15e3,width:5,height:5,mines:11},Impossible:{timer:15e3,width:6,height:6,mines:15}};function k(t){const e={timer:0,width:0,height:0,mines:0};Object(y.a)(v,t.difficulty,e);const n=e.timer,[k]=Object(f.useState)(function(t){const e=_(t);for(let n=0;n{const t=setTimeout(()=>O(!1),2e3);return()=>clearInterval(t)},[]);const T=[];return k.map((t,e)=>t.map((t,n)=>{L?T.push({flagged:Boolean(k[e][n])}):n===x[0]&&e===x[1]?T.push({current:!0}):w[e][n]?T.push({marked:!0}):M&&k[e][n]?T.push({flagged:!0}):T.push({})})),u.a.createElement(u.a.Fragment,null,u.a.createElement(b.a,{millis:n,onExpire:t.onFailure}),u.a.createElement(o.a,{sx:{display:"grid",justifyItems:"center",pb:1}},u.a.createElement(s.a,{variant:"h4"},L?"Remember all the mines!":"Mark all the mines!"),u.a.createElement(l.a,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.round(e.width)}, 1fr)`,gridTemplateRows:`repeat(${Math.round(e.height)}, 1fr)`,gap:1}},T.map(t=>{let e,n;return t.marked?(e=d.a.theme.warning,n=u.a.createElement(a.a,null)):t.current?(e=d.a.theme.infolight,n=u.a.createElement(r.a,null)):t.flagged?(e=d.a.theme.error,n=u.a.createElement(i.a,null)):(e=d.a.theme.primary,n=u.a.createElement(u.a.Fragment,null)),u.a.createElement(s.a,{key:`${t}${Object(c.uniqueId)()}`,sx:{color:e,border:"2px solid "+(t.current?d.a.theme.infolight:d.a.theme.primary),height:"32px",width:"32px",display:"flex",alignItems:"center",justifyContent:"center"}},n)})),u.a.createElement(E.a,{onKeyDown:function(e){if(e.preventDefault(),L)return;const n=[0,0];switch(Object(g.b)(e)){case g.g:n[1]--;break;case g.d:n[0]--;break;case g.a:n[1]++;break;case g.f:n[0]++}const a=[x[0]+n[0],x[1]+n[1]];if(a[0]=(a[0]+k[0].length)%k[0].length,a[1]=(a[1]+k.length)%k.length,C(a),e.key==p.a.SPACE){if(!k[x[1]][x[0]])return void t.onFailure();S(e=>(e[x[1]][x[0]]=!0,function(t,e){function n(t){return t.flat().reduce((t,e)=>t+(e?1:0),0)}return n(t)===n(e)}(k,e)&&t.onSuccess(),e))}},onFailure:t.onFailure})))}function _(t){const e=[];for(let n=0;n{let t=window.setTimeout(()=>{p(1),t=window.setTimeout(()=>{p(2),t=window.setTimeout(()=>p(0),e.window)},250)},y);return()=>{clearInterval(t)}},[]),s.a.createElement(s.a.Fragment,null,s.a.createElement(m.a,{millis:5e3,onExpire:t.onFailure}),s.a.createElement(a.a,{sx:{display:"grid",justifyItems:"center"}},s.a.createElement(r.a,{variant:"h4"},"Slash when his guard is down!"),g?s.a.createElement(i.a,{sx:{my:1}},s.a.createElement(r.a,{variant:"h5"},"Guard will drop in..."),s.a.createElement(m.a,{millis:b,onExpire:()=>null,noPaper:!0})):s.a.createElement(s.a.Fragment,null),0===n&&s.a.createElement(r.a,{variant:"h4"},"Guarding ..."),1===n&&s.a.createElement(r.a,{variant:"h4"},"Preparing?"),2===n&&s.a.createElement(r.a,{variant:"h4"},"ATTACKING!"),s.a.createElement(h.a,{onKeyDown:function(e){e.preventDefault(),e.key===f.a.SPACE&&(2!==n?t.onFailure():t.onSuccess())},onFailure:t.onFailure})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return E}));var a=n(45),r=n(1),i=n(19),o=n(130),s=n(74),l=n(8),c=n(0),f=n.n(c),u=n(4),m=n(105),h=n(26),d=n(29),p=n(20),g=n(128),y=n(22),b=n(384);function E(t){const e=d.b.Player(),n=d.b.Router(),[E,v]=Object(c.useState)("none");function k(){L(),n.toCity()}const _=h.a[u.a.ShadowsOfAnarchy],w=Object(b.c)(e,t.Reward,t.MaxLevel,t.StartingDifficulty),S=Object(b.b)(e,t.Reward,t.MaxLevel,t.StartingDifficulty),x=Object(b.a)(e,_,t.StartingDifficulty),C=e.factions.includes(u.a.ShadowsOfAnarchy);function L(){Object(m.c)(h.a[u.a.ShadowsOfAnarchy]),C&&(_.playerReputation+=x)}return f.a.createElement(a.a,{sx:{p:1,textAlign:"center",display:"flex",alignItems:"center",flexDirection:"column"}},f.a.createElement(r.a,{variant:"h4"},"Infiltration successful!"),f.a.createElement(r.a,{variant:"h5",color:"primary",width:"75%"},"You"," ",C?f.a.createElement(f.a.Fragment,null,"have gained ",Object(y.f)(x,2)," rep for ",u.a.ShadowsOfAnarchy," and"," "):f.a.createElement(f.a.Fragment,null),"can trade the confidential information you found for money or reputation."),f.a.createElement(i.a,{sx:{width:"fit-content"}},f.a.createElement(i.a,{sx:{width:"100%"}},f.a.createElement(o.a,{value:E,onChange:function(t){v(t.target.value)},sx:{mr:1}},f.a.createElement(s.a,{key:"none",value:"none"},"none"),e.factions.filter(t=>h.a[t].getInfo().offersWork()).map(t=>f.a.createElement(s.a,{key:t,value:t},t))),f.a.createElement(l.a,{onClick:function(){"none"!==E&&(L(),h.a[E].playerReputation+=w,k())}},"Trade for ",f.a.createElement(g.a,{reputation:w})," reputation")),f.a.createElement(l.a,{onClick:function(){L(),e.gainMoney(S,"infiltration"),k()},sx:{width:"100%"}},"Sell for ",f.a.createElement(p.a,{money:S}))),f.a.createElement(l.a,{onClick:k,sx:{width:"100%",mt:1}},"Quit"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return v}));var a=n(45),r=n(1),i=n(19),o=n(0),s=n.n(o),l=n(12),c=n(2),f=n(6),u=n(27),m=n(134),h=n(219),d=n(205),p=n(220);const g={Trivial:{timer:9e3,wiresmin:4,wiresmax:4,rules:2},Normal:{timer:7e3,wiresmin:6,wiresmax:6,rules:2},Hard:{timer:5e3,wiresmin:8,wiresmax:8,rules:3},Impossible:{timer:4e3,wiresmin:9,wiresmax:9,rules:4}},y=[u.a.PIPE,u.a.DOT,u.a.FORWARD_SLASH,u.a.HYPHEN,"█",u.a.HASH],b=["red","#FFC107","blue","white"],E={red:"red","#FFC107":"yellow",blue:"blue",white:"white"};function v(t){const e={timer:0,wiresmin:0,wiresmax:0,rules:0};Object(h.a)(g,t.difficulty,e);const n=e.timer,[u]=Object(o.useState)(function(t){const e=[],n=Object(m.e)(t.wiresmin,t.wiresmax);for(let t=0;te.shouldCut(u[t-1],t-1))}return Object(o.useEffect)(()=>{const e=[];for(let t=0;tt===E[e])&&t.onSuccess()},[E]),s.a.createElement(s.a.Fragment,null,s.a.createElement(d.a,{millis:n,onExpire:t.onFailure}),s.a.createElement(a.a,{sx:{display:"grid",justifyItems:"center",pb:1}},s.a.createElement(r.a,{variant:"h4",sx:{width:"75%",textAlign:"center"}},"Cut the wires with the following properties! (keyboard 1 to 9)"),w.map((t,e)=>s.a.createElement(r.a,{key:e},t.toString())),s.a.createElement(i.a,{sx:{display:"grid",gridTemplateColumns:`repeat(${u.length}, 1fr)`,columnGap:3,justifyItems:"center"}},new Array(u.length).fill(0).map((t,e)=>{const n=x(e+1),a=S&&!n?f.a.theme.disabled:f.a.theme.primary;return s.a.createElement(r.a,{key:e,style:{color:a}},e+1)}),new Array(8).fill(0).map((t,e)=>s.a.createElement(s.a.Fragment,{key:e},u.map((t,n)=>{if((3===e||4===e)&&E[n])return s.a.createElement(r.a,{key:n});const a=x(n+1),i=S&&!a?f.a.theme.disabled:t.colors[e%t.colors.length];return s.a.createElement(r.a,{key:n,style:{color:i}},"|",t.tpe,"|")})))),s.a.createElement(p.a,{onKeyDown:function(e){e.preventDefault();const n=parseInt(e.key);n<1||n>u.length||isNaN(n)||v(e=>{const a=[...e];return a[n-1]=!0,x(n)||t.onFailure(),a})},onFailure:t.onFailure})))}function k(t){const e=Math.floor(Math.random()*t.length);return{toString:()=>`Cut wires number ${e+1}.`,shouldCut:(t,n)=>e===n}}function _(t){const e=t[Math.floor(Math.random()*t.length)].colors[0];return{toString:()=>`Cut all wires colored ${E[e]}.`,shouldCut:t=>t.colors.includes(e)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var a=n(691),r=n(249),i=n(45),o=n(1),s=n(21),l=n(19),c=n(8),f=n(0),u=n.n(f),m=n(6),h=n(5);function d(t,e){let n="";return e<=0?e=0:e>13?e=13:(e--,n=">"),u.a.createElement("span",{style:{color:t}},"=".repeat(e),n," ".repeat(13-n.length-e))}function p(t){return u.a.createElement(r.a,{sx:{alignItems:"center"}},u.a.createElement(i.a,{sx:{p:1,mb:1,display:"grid",justifyItems:"center"}},u.a.createElement(o.a,{variant:"h4"},"Infiltrating ",u.a.createElement("b",null,t.Location.name)),u.a.createElement(o.a,{variant:"h6"},u.a.createElement("b",null,"Maximum Level: "),t.MaxLevel),u.a.createElement(o.a,{variant:"h6",sx:{color:t.Difficulty>2?m.a.theme.error:t.Difficulty>1?m.a.theme.warning:m.a.theme.primary,display:"flex",alignItems:"center"}},u.a.createElement("b",null,"Difficulty: "),h.a.format(33.3333*t.Difficulty,"0")," / 100",t.Difficulty>1.5&&u.a.createElement(s.a,{title:u.a.createElement(o.a,{color:"error"},"This location is too heavily guarded for your current stats. It is recommended that you try training, or finding an easier location.")},u.a.createElement(a.a,{sx:{ml:1}}))),u.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}},"[",0===(e=t.Difficulty)?u.a.createElement("span",{style:{color:"white"}},">"," ".repeat(38)):u.a.createElement(u.a.Fragment,null,d(m.a.theme.primary,13*e),d(m.a.theme.warning,13*(e-1)),d(m.a.theme.error,13*(e-2))),"]"),u.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}},"▲ ▲ ▲ ▲"),u.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," Trivial Normal Hard Impossible")),u.a.createElement(i.a,{sx:{p:1,display:"grid",justifyItems:"center"}},u.a.createElement(o.a,{sx:{width:"75%",textAlign:"center"}},u.a.createElement("b",null,"Infiltration")," is a series of short minigames that get progressively harder. You take damage for failing them. Reaching the maximum level rewards you with intel that you can trade for money or reputation.",u.a.createElement("br",null),u.a.createElement("br",null),u.a.createElement("b",null,"Gameplay:")),u.a.createElement("ul",null,u.a.createElement(o.a,null,u.a.createElement("li",null,"The minigames you play are randomly selected.",u.a.createElement("br",null),"It might take you a few tries to get used to them."),u.a.createElement("li",null,"No game requires use of the mouse."),u.a.createElement("li",null,u.a.createElement("b",null,"Spacebar")," is the default action/confirm button."),u.a.createElement("li",null,"The ",u.a.createElement("b",null,"arrow keys")," and ",u.a.createElement("b",null,"WASD")," can be used interchangeably."),u.a.createElement("li",null,"Sometimes the rest of the keyboard is used."))),u.a.createElement(l.a,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",width:"100%"}},u.a.createElement(c.a,{onClick:t.start},"Start"),u.a.createElement(c.a,{onClick:t.cancel},"Cancel"))));var e}},function(t,e,n){"use strict";n.d(e,"a",(function(){return R}));var a=n(1483),r=n(1484),i=n(1795),o=n(1),s=n(249),l=n(8),c=n(19),f=n(45),u=n(248),m=n(355),h=n(0),d=n.n(h),p=n(12),g=n(79),y=n(10),b=n(105),E=n(9),v=n(186),k=n(172),_=n(6),w=n(29),S=n(252),x=n(20),C=n(22),L=n(483),O=n(269);const M={},T=(t,e)=>!(t.money{const e=t.aug,n=t.player;return d.a.createElement(o.a,{color:_.a.theme.money},d.a.createElement("b",null,"Pre-Requisites:"),d.a.createElement("br",null),e.prereqs.map(t=>d.a.createElement("span",{style:{display:"flex",alignItems:"center"}},n.hasAugmentation(t)?d.a.createElement(a.a,{sx:{mr:1}}):d.a.createElement(r.a,{sx:{mr:1}}),t)))},R=()=>{const t=w.b.Player(),e=w.b.Router();for(const t of Object.values(g.a)){const e=t.name,n=new L.a(t);M[e]=n}const[n,a]=Object(h.useState)(Object(O.b)(t)[0]),[r,b]=Object(h.useState)(!1),R=g.a[n],N=Object(h.useState)(!1)[1];function P(){N(t=>!t)}const I=t=>{_.a.PurchaseAugmentationsOrder=t,P()};return Object(h.useEffect)(()=>{const t=setInterval(P,200);return()=>clearInterval(t)},[]),d.a.createElement(s.a,{disableGutters:!0,maxWidth:"lg",sx:{mx:0}},d.a.createElement(l.a,{onClick:()=>e.toLocation(v.a[E.a.NewTokyoVitaLife])},"Back"),d.a.createElement(o.a,{variant:"h4"},"Grafting Laboratory"),d.a.createElement(o.a,null,"You find yourself in a secret laboratory, owned by a mysterious researcher.",d.a.createElement("br",null),"The scientist explains that they've been studying Augmentation grafting, the process of applying Augmentations without requiring a body reset.",d.a.createElement("br",null),d.a.createElement("br",null),"Through legally questionable connections, the scientist has access to a vast array of Augmentation blueprints, even private designs. They offer to build and graft the Augmentations to you, in exchange for both a hefty sum of money, and being a lab rat."),d.a.createElement(c.a,{sx:{my:3}},d.a.createElement(f.a,{sx:{p:1}},d.a.createElement(o.a,{variant:"h5"},"Graft Augmentations"),d.a.createElement(c.a,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr"}},d.a.createElement(l.a,{sx:{width:"100%"},onClick:()=>I(k.b.Cost)},"Sort by Cost"),d.a.createElement(l.a,{sx:{width:"100%"},onClick:()=>I(k.b.Default)},"Sort by Default Order"))),Object(O.b)(t).length>0?d.a.createElement(f.a,{sx:{mb:1,width:"fit-content",display:"grid",gridTemplateColumns:"1fr 3fr"}},d.a.createElement(u.a,{sx:{height:400,overflowY:"scroll",borderRight:"1px solid "+_.a.theme.welllight}},(()=>{const e=Object(O.b)(t);switch(_.a.PurchaseAugmentationsOrder){case k.b.Cost:return e.sort((t,e)=>M[t].cost-M[e].cost);default:return e}})().map((e,r)=>d.a.createElement(m.a,{key:r+1,onClick:()=>a(e),selected:n===e},d.a.createElement(o.a,{sx:{color:T(t,M[e])?_.a.theme.primary:_.a.theme.disabled}},e)))),d.a.createElement(c.a,{sx:{m:1}},d.a.createElement(o.a,{variant:"h6",sx:{display:"flex",alignItems:"center",flexWrap:"wrap"}},d.a.createElement(i.a,{sx:{mr:1}})," ",n),d.a.createElement(l.a,{onClick:()=>b(!0),sx:{width:"100%"},disabled:!T(t,M[n])},"Graft Augmentation (",d.a.createElement(o.a,null,d.a.createElement(x.a,{money:M[n].cost,player:t})),")"),d.a.createElement(S.a,{open:r,onClose:()=>b(!1),onConfirm:()=>{const a=M[n];t.loseMoney(a.cost,"augmentations"),t.startGraftAugmentationWork(n,a.time),t.startFocusing(),e.toWork()},confirmationText:d.a.createElement(d.a.Fragment,null,"Cancelling grafting will ",d.a.createElement("b",null,"not")," save grafting progress, and the money you spend will ",d.a.createElement("b",null,"not")," ","be returned.",!t.hasAugmentation(p.a.CongruityImplant)&&d.a.createElement(d.a.Fragment,null,d.a.createElement("br",null),d.a.createElement("br",null),"Additionally, grafting an Augmentation will increase the potency of the Entropy virus."))}),d.a.createElement(c.a,{sx:{maxHeight:330,overflowY:"scroll"}},d.a.createElement(o.a,{color:_.a.theme.info},d.a.createElement("b",null,"Time to Graft:")," ",Object(C.d)(Object(O.a)(t,M[n]))),R.prereqs.length>0&&d.a.createElement(A,{player:t,aug:R}),d.a.createElement("br",null),d.a.createElement(o.a,null,(()=>{const t="string"==typeof R.info?d.a.createElement("span",null,R.info):R.info;return d.a.createElement(d.a.Fragment,null,t,d.a.createElement("br",null),d.a.createElement("br",null),R.stats)})())))):d.a.createElement(o.a,null,"All Augmentations owned")),d.a.createElement(c.a,{sx:{my:3}},d.a.createElement(o.a,{variant:"h5"},"Entropy Virus"),d.a.createElement(f.a,{sx:{my:1,p:1,width:"fit-content"}},d.a.createElement(o.a,null,d.a.createElement("b",null,"Entropy strength:")," ",t.entropy,d.a.createElement("br",null),d.a.createElement("b",null,"All multipliers decreased by:")," ",Object(C.f)(100*(1-y.a.EntropyEffect**t.entropy),3),"% (multiplicative)")),d.a.createElement(o.a,null,"When installed on an unconscious individual, Augmentations are scanned by the body on awakening, eliminating hidden malware. However, grafted Augmentations do not provide this security measure.",d.a.createElement("br",null),d.a.createElement("br",null),'Individuals who tested Augmentation grafting have reported symptoms of an unknown virus, which they\'ve dubbed "Entropy". This virus seems to grow more potent with each grafted Augmentation...')))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return R}));var a=n(249),r=n(45),i=n(148),o=n(149),s=n(19),l=n(21),c=n(8),f=n(1),u=n(115),m=n(0),h=n.n(m),d=n(67),p=n(238),g=n(10),y=n(26),b=n(9),E=n(186),v=n(6),k=n(22),_=n(29),w=n(5),S=n(20),x=n(112),C=n(413),L=n(128),O=n(484),M=n(73),T=n(34);const A=1e3/g.a.MilliPerCycle;function R(){var t;const e=Object(m.useState)(!1)[1];function n(){e(t=>!t)}Object(m.useEffect)(()=>{const t=setInterval(n,g.a.MilliPerCycle);return()=>clearInterval(t)},[]);const R=_.b.Player(),N=_.b.Router(),P=[R.workHackExpGained>0?h.a.createElement(M.a,{name:"Hacking Exp",color:v.a.theme.hack,data:{content:`${w.a.formatExp(R.workHackExpGained)} (${w.a.formatExp(R.workHackExpGainRate*A)} / sec)`}}):h.a.createElement(h.a.Fragment,null),R.workStrExpGained>0?h.a.createElement(M.a,{name:"Strength Exp",color:v.a.theme.combat,data:{content:`${w.a.formatExp(R.workStrExpGained)} (${w.a.formatExp(R.workStrExpGainRate*A)} / sec)`}}):h.a.createElement(h.a.Fragment,null),R.workDefExpGained>0?h.a.createElement(M.a,{name:"Defense Exp",color:v.a.theme.combat,data:{content:`${w.a.formatExp(R.workDefExpGained)} (${w.a.formatExp(R.workDefExpGainRate*A)} / sec)`}}):h.a.createElement(h.a.Fragment,null),R.workDexExpGained>0?h.a.createElement(M.a,{name:"Dexterity Exp",color:v.a.theme.combat,data:{content:`${w.a.formatExp(R.workDexExpGained)} (${w.a.formatExp(R.workDexExpGainRate*A)} / sec)`}}):h.a.createElement(h.a.Fragment,null),R.workAgiExpGained>0?h.a.createElement(M.a,{name:"Agility Exp",color:v.a.theme.combat,data:{content:`${w.a.formatExp(R.workAgiExpGained)} (${w.a.formatExp(R.workAgiExpGainRate*A)} / sec)`}}):h.a.createElement(h.a.Fragment,null),R.workChaExpGained>0?h.a.createElement(M.a,{name:"Charisma Exp",color:v.a.theme.cha,data:{content:`${w.a.formatExp(R.workChaExpGained)} (${w.a.formatExp(R.workChaExpGainRate*A)} / sec)`}}):h.a.createElement(h.a.Fragment,null)];let I;switch(R.workType){case T.d.Faction:{const t=y.a[R.currentWorkFactionName];function F(){N.toFaction(t),R.finishFactionWork(!0)}function D(){N.toFaction(t),R.stopFocusing()}t||(I={buttons:{cancel:()=>N.toFactions()},title:`You have not joined ${R.currentWorkFactionName||"(Faction not found)"} at this time, please try again if you think this should have worked`,stopText:"Back to Factions"}),I={buttons:{cancel:F,unfocus:D},title:h.a.createElement(h.a.Fragment,null,"You are currently ",R.currentWorkFactionDescription," for your faction ",h.a.createElement("b",null,t.name)),description:h.a.createElement(h.a.Fragment,null,"Current Faction Reputation: ",h.a.createElement(L.a,{reputation:t.playerReputation})),gains:[R.workMoneyGained>0?h.a.createElement(M.a,{name:"Money",color:v.a.theme.money},h.a.createElement(f.a,null,h.a.createElement(S.a,{money:R.workMoneyGained})," (",h.a.createElement(x.a,{money:R.workMoneyGainRate*A}),")")):h.a.createElement(h.a.Fragment,null),h.a.createElement(M.a,{name:"Faction Reputation",color:v.a.theme.rep},h.a.createElement(f.a,null,h.a.createElement(L.a,{reputation:R.workRepGained})," (",h.a.createElement(O.a,{reputation:R.workRepGainRate*A}),")")),...P],progress:{elapsed:R.timeWorked},stopText:"Stop Faction work"};break}case T.d.StudyClass:{const t=R.className;function F(){R.finishClass(!0),N.toCity()}function D(){N.toCity(),R.stopFocusing()}let e="";e=t===T.a.GymStrength||t===T.a.GymDefense||t===T.a.GymDexterity||t===T.a.GymAgility?"Stop training at gym":"Stop taking course",I={buttons:{cancel:F,unfocus:D},title:h.a.createElement(h.a.Fragment,null,"You are currently ",h.a.createElement("b",null,t)),gains:[h.a.createElement(M.a,{name:"Total Cost",color:v.a.theme.money},h.a.createElement(f.a,null,h.a.createElement(S.a,{money:-R.workMoneyGained})," (",h.a.createElement(x.a,{money:R.workMoneyLossRate*A}),")")),...P],progress:{elapsed:R.timeWorked},stopText:e};break}case T.d.Company:{const t=d.a[R.companyName];null!=t&&t instanceof p.a||(I={buttons:{cancel:()=>N.toTerminal()},title:`You cannot work for ${R.companyName||"(Company not found)"} at this time, please try again if you think this should have worked`,stopText:"Back to Terminal"});const e=t.playerReputation;function F(){R.finishWork(!0),N.toJob()}function D(){R.stopFocusing(),N.toJob()}const n=R.jobs[R.companyName],a=.5===R.cancelationPenalty()?"half":"three-quarters";I={buttons:{cancel:F,unfocus:D},title:h.a.createElement(h.a.Fragment,null,"You are currently working as a ",h.a.createElement("b",null,n)," at ",h.a.createElement("b",null,R.companyName)),description:h.a.createElement(h.a.Fragment,null,"Current Company Reputation: ",h.a.createElement(L.a,{reputation:e})),gains:[h.a.createElement(M.a,{name:"Money",color:v.a.theme.money},h.a.createElement(f.a,null,h.a.createElement(S.a,{money:R.workMoneyGained})," (",h.a.createElement(x.a,{money:R.workMoneyGainRate*A}),")")),h.a.createElement(M.a,{name:"Company Reputation",color:v.a.theme.rep},h.a.createElement(f.a,null,h.a.createElement(L.a,{reputation:R.workRepGained})," (",h.a.createElement(O.a,{reputation:R.workRepGainRate*A}),")")),...P],progress:{elapsed:R.timeWorked},stopText:"Stop working",stopTooltip:`You will automatically finish after working for 8 hours. You can cancel earlier if you wish but you will only gain ${a} of the reputation you've earned so far.`};break}case T.d.CompanyPartTime:{function F(){R.finishWorkPartTime(!0),N.toJob()}function D(){R.stopFocusing(),N.toJob()}const t=d.a[R.companyName];let e=0;if(null==t||!(t instanceof p.a))throw new Error("Could not find Company: "+R.companyName);e=t.playerReputation;const n=R.jobs[R.companyName];I={buttons:{cancel:F,unfocus:D},title:h.a.createElement(h.a.Fragment,null,"You are currently working as a ",h.a.createElement("b",null,n)," at ",h.a.createElement("b",null,R.companyName)),description:h.a.createElement(h.a.Fragment,null,"Current Company Reputation: ",h.a.createElement(L.a,{reputation:e})),gains:[h.a.createElement(M.a,{name:"Money",color:v.a.theme.money},h.a.createElement(f.a,null,h.a.createElement(S.a,{money:R.workMoneyGained})," (",h.a.createElement(x.a,{money:R.workMoneyGainRate*A}),")")),h.a.createElement(M.a,{name:"Company Reputation",color:v.a.theme.rep},h.a.createElement(f.a,null,h.a.createElement(L.a,{reputation:R.workRepGained})," (",h.a.createElement(O.a,{reputation:R.workRepGainRate*A}),")")),...P],progress:{elapsed:R.timeWorked},stopText:"Stop working",stopTooltip:"You will automatically finish after working for 8 hours. You can cancel earlier if you wish and there will be no penalty because this is a part-time job."};break}case T.d.Crime:{const t=Math.round(R.timeWorked/R.timeNeededToCompleteWork*100);I={buttons:{cancel:()=>{N.toLocation(E.a[b.a.Slums]),R.finishCrime(!0)}},title:"You are attempting to "+R.crimeType,progress:{remaining:R.timeNeededToCompleteWork-R.timeWorked,percentage:t},stopText:"Cancel crime"};break}case T.d.CreateProgram:{function F(){R.finishCreateProgramWork(!0),N.toTerminal()}function D(){N.toTerminal(),R.stopFocusing()}const t=R.timeWorkedCreateProgram/R.timeNeededToCompleteWork*100;I={buttons:{cancel:F,unfocus:D},title:h.a.createElement(h.a.Fragment,null,"You are currently working on coding ",h.a.createElement("b",null,R.createProgramName)),progress:{elapsed:R.timeWorked,percentage:t},stopText:"Stop creating program",stopTooltip:"Your work will be saved and you can return to complete the program later."};break}case T.d.GraftAugmentation:{function F(){R.finishGraftAugmentationWork(!0),N.toTerminal()}function D(){N.toTerminal(),R.stopFocusing()}const t=R.timeWorkedGraftAugmentation/R.timeNeededToCompleteWork*100;I={buttons:{cancel:F,unfocus:D},title:h.a.createElement(h.a.Fragment,null,"You are currently working on grafting ",h.a.createElement("b",null,R.graftAugmentationName)),progress:{elapsed:R.timeWorked,percentage:t},stopText:"Stop grafting",stopTooltip:h.a.createElement(h.a.Fragment,null,"If you cancel, your work will ",h.a.createElement("b",null,"not")," be saved, and the money you spent will ",h.a.createElement("b",null,"not")," be returned")};break}default:N.toTerminal(),I=null}if(null===I)return h.a.createElement(h.a.Fragment,null);const j="string"==typeof(null===(t=I)||void 0===t?void 0:t.stopTooltip)?h.a.createElement(f.a,null,I.stopTooltip):I.stopTooltip||h.a.createElement(h.a.Fragment,null);return h.a.createElement(a.a,{maxWidth:"md",sx:{display:"flex",flexDirection:"column",justifyContent:"center",height:"calc(100vh - 16px)"}},h.a.createElement(r.a,{sx:{p:1,mb:1}},h.a.createElement(f.a,{variant:"h6"},I.title),h.a.createElement(f.a,null,I.description),I.gains&&h.a.createElement(i.a,{sx:{mt:1}},h.a.createElement(o.a,null,I.gains.map(t=>h.a.createElement(h.a.Fragment,{key:Object(u.uniqueId)()},t))))),h.a.createElement(r.a,{sx:{mb:1,p:1}},void 0!==I.progress&&h.a.createElement(s.a,{sx:{mb:1}},h.a.createElement(s.a,{display:"grid",sx:{gridTemplateColumns:`repeat(${Object.keys(I.progress).length}, 1fr)`,width:"100%",justifyItems:"center",textAlign:"center"}},void 0!==I.progress.elapsed&&h.a.createElement(f.a,null,Object(k.d)(I.progress.elapsed)," elapsed"),void 0!==I.progress.remaining&&h.a.createElement(f.a,null,Object(k.d)(I.progress.remaining)," remaining"),void 0!==I.progress.percentage&&h.a.createElement(f.a,null,I.progress.percentage.toFixed(2),"% done")),void 0!==I.progress.percentage&&h.a.createElement(C.a,{variant:"determinate",value:I.progress.percentage,color:"primary"})),h.a.createElement(s.a,{display:"grid",sx:{gridTemplateColumns:`repeat(${Object.keys(I.buttons).length}, 1fr)`}},I.stopTooltip?h.a.createElement(l.a,{title:j},h.a.createElement(c.a,{onClick:I.buttons.cancel},I.stopText)):h.a.createElement(c.a,{onClick:I.buttons.cancel},I.stopText),I.buttons.unfocus&&h.a.createElement(c.a,{onClick:I.buttons.unfocus},"Do something else simultaneously"))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var a=n(249),r=n(1),i=n(19),o=n(0),s=n.n(o),l=n(287),c=n(1245),f=n(1246);function u(t){const[e,n]=Object(o.useState)(l.a.SYSTEM);return s.a.createElement(a.a,{disableGutters:!0,maxWidth:"lg",sx:{mx:0}},s.a.createElement(r.a,{variant:"h4"},"Options"),s.a.createElement(i.a,{sx:{display:"grid",gridTemplateColumns:"1fr 3fr",gap:1}},s.a.createElement(f.a,{tab:e,setTab:t=>n(t),player:t.player,router:t.router,save:t.save,export:t.export,forceKill:t.forceKill,softReset:t.softReset}),s.a.createElement(c.a,{currentTab:e,player:t.player})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var a=n(21),r=n(1),i=n(76),o=n(130),s=n(74),l=n(0),c=n.n(l),f=n(6),u=n(147),m=n(375),h=n(287),d=n(549),p=n(435);const g=t=>{const[e,n]=Object(l.useState)(f.a.CodeInstructionRunTime),[g,y]=Object(l.useState)(f.a.MaxRecentScriptsCapacity),[b,E]=Object(l.useState)(f.a.MaxLogCapacity),[v,k]=Object(l.useState)(f.a.MaxPortCapacity),[_,w]=Object(l.useState)(f.a.MaxTerminalCapacity),[S,x]=Object(l.useState)(f.a.AutosaveInterval),[C,L]=Object(l.useState)(f.a.TimestampsFormat),[O,M]=Object(l.useState)(f.a.Locale);return{[h.a.SYSTEM]:c.a.createElement(d.a,{title:"System"},c.a.createElement(c.a.Fragment,null,c.a.createElement(p.a,{label:".script exec time (ms)",initialValue:e,callback:function(t,e){n(e),f.a.CodeInstructionRunTime=e},step:1,min:5,max:100,tooltip:c.a.createElement(c.a.Fragment,null,"The minimum number of milliseconds it takes to execute an operation in Netscript. Setting this too low can result in poor performance if you have many scripts running.")}),c.a.createElement(p.a,{label:"Recently killed scripts size",initialValue:g,callback:function(t,e){y(e),f.a.MaxRecentScriptsCapacity=e},step:25,min:0,max:500,tooltip:c.a.createElement(c.a.Fragment,null,"The maximum number of lines a script's logs can hold. Setting this too high can cause the game to use a lot of memory if you have many scripts running.")}),c.a.createElement(p.a,{label:"Netscript log size",initialValue:b,callback:function(t,e){E(e),f.a.MaxLogCapacity=e},step:20,min:20,max:500,tooltip:c.a.createElement(c.a.Fragment,null,"The maximum number of lines a script's logs can hold. Setting this too high can cause the game to use a lot of memory if you have many scripts running.")}),c.a.createElement(p.a,{label:"Netscript port size",initialValue:v,callback:function(t,e){k(e),f.a.MaxPortCapacity=e},step:1,min:20,max:100,tooltip:c.a.createElement(c.a.Fragment,null,"The maximum number of entries that can be written to a port using Netscript's write() function. Setting this too high can cause the game to use a lot of memory.")}),c.a.createElement(p.a,{label:"Terminal capacity",initialValue:_,callback:function(t,e){w(e),f.a.MaxTerminalCapacity=e},step:50,min:50,max:500,tooltip:c.a.createElement(c.a.Fragment,null,"The maximum number of entries that can be written to the terminal. Setting this too high can cause the game to use a lot of memory."),marks:!0}),c.a.createElement(p.a,{label:"Autosave interval (s)",initialValue:S,callback:function(t,e){x(e),f.a.AutosaveInterval=e},step:30,min:0,max:600,tooltip:c.a.createElement(c.a.Fragment,null,"The time (in seconds) between each autosave. Set to 0 to disable autosave."),marks:!0})),c.a.createElement(u.a,{checked:f.a.SuppressSavedGameToast,onChange:t=>f.a.SuppressSavedGameToast=t,text:"Suppress Auto-Save Game Toast",tooltip:c.a.createElement(c.a.Fragment,null,'If this is set, there will be no "Game Saved!" toast appearing after an auto-save.')}),c.a.createElement(u.a,{checked:f.a.SuppressAutosaveDisabledWarnings,onChange:t=>f.a.SuppressAutosaveDisabledWarnings=t,text:"Suppress Auto-Save Disabled Warning",tooltip:c.a.createElement(c.a.Fragment,null,"If this is set, there will be no warning triggered when auto-save is disabled (at 0).")}),c.a.createElement(u.a,{checked:f.a.SaveGameOnFileSave,onChange:t=>f.a.SaveGameOnFileSave=t,text:"Save game on file save",tooltip:c.a.createElement(c.a.Fragment,null,"Save your game any time a file is saved in the script editor.")}),c.a.createElement(u.a,{checked:f.a.ExcludeRunningScriptsFromSave,onChange:t=>f.a.ExcludeRunningScriptsFromSave=t,text:"Exclude Running Scripts from Save",tooltip:c.a.createElement(c.a.Fragment,null,"If this is set, the save file will exclude all running scripts. This is only useful if your save is lagging a lot. You'll have to restart your script every time you launch the game.")})),[h.a.INTERFACE]:c.a.createElement(d.a,{title:"Interface"},c.a.createElement(u.a,{checked:f.a.DisableASCIIArt,onChange:t=>f.a.DisableASCIIArt=t,text:"Disable ascii art",tooltip:c.a.createElement(c.a.Fragment,null,"If this is set all ASCII art will be disabled.")}),c.a.createElement(u.a,{checked:f.a.DisableTextEffects,onChange:t=>f.a.DisableTextEffects=t,text:"Disable text effects",tooltip:c.a.createElement(c.a.Fragment,null,"If this is set, text effects will not be displayed. This can help if text is difficult to read in certain areas.")}),c.a.createElement(u.a,{checked:f.a.DisableOverviewProgressBars,onChange:t=>f.a.DisableOverviewProgressBars=t,text:"Disable Overview Progress Bars",tooltip:c.a.createElement(c.a.Fragment,null,"If this is set, the progress bars in the character overview will be hidden.")}),c.a.createElement(u.a,{checked:f.a.UseIEC60027_2,onChange:t=>f.a.UseIEC60027_2=t,text:"Use GiB instead of GB",tooltip:c.a.createElement(c.a.Fragment,null,"If this is set all references to memory will use GiB instead of GB, in accordance with IEC 60027-2.")}),c.a.createElement(a.a,{title:c.a.createElement(r.a,null,"Terminal commands and log entries will be timestamped. See https://date-fns.org/docs/Getting-Started/")},c.a.createElement(i.a,{InputProps:{startAdornment:c.a.createElement(r.a,{color:"format error"===Object(m.a)(C)&&""!==C?"error":"success"},"Timestamp format:")},value:C,onChange:function(t){L(t.target.value),f.a.TimestampsFormat=t.target.value},placeholder:"yyyy-MM-dd hh:mm:ss"})),c.a.createElement(c.a.Fragment,null,c.a.createElement(a.a,{title:c.a.createElement(r.a,null,"Sets the locale for displaying numbers.")},c.a.createElement(r.a,null,"Locale")),c.a.createElement(o.a,{value:O,onChange:function(t){M(t.target.value),f.a.Locale=t.target.value}},c.a.createElement(s.a,{value:"en"},"en"),c.a.createElement(s.a,{value:"bg"},"bg"),c.a.createElement(s.a,{value:"cs"},"cs"),c.a.createElement(s.a,{value:"da-dk"},"da-dk"),c.a.createElement(s.a,{value:"de"},"de"),c.a.createElement(s.a,{value:"en-au"},"en-au"),c.a.createElement(s.a,{value:"en-gb"},"en-gb"),c.a.createElement(s.a,{value:"es"},"es"),c.a.createElement(s.a,{value:"fr"},"fr"),c.a.createElement(s.a,{value:"hu"},"hu"),c.a.createElement(s.a,{value:"it"},"it"),c.a.createElement(s.a,{value:"lv"},"lv"),c.a.createElement(s.a,{value:"no"},"no"),c.a.createElement(s.a,{value:"pl"},"pl"),c.a.createElement(s.a,{value:"ru"},"ru")))),[h.a.GAMEPLAY]:c.a.createElement(d.a,{title:"Gameplay"},c.a.createElement(u.a,{checked:f.a.SuppressMessages,onChange:t=>f.a.SuppressMessages=t,text:"Suppress story messages",tooltip:c.a.createElement(c.a.Fragment,null,"If this is set, then any messages you receive will not appear as popups on the screen. They will still get sent to your home computer as '.msg' files and can be viewed with the 'cat' Terminal command.")}),c.a.createElement(u.a,{checked:f.a.SuppressFactionInvites,onChange:t=>f.a.SuppressFactionInvites=t,text:"Suppress faction invites",tooltip:c.a.createElement(c.a.Fragment,null,"If this is set, then any faction invites you receive will not appear as popups on the screen. Your outstanding faction invites can be viewed in the 'Factions' page.")}),c.a.createElement(u.a,{checked:f.a.SuppressTravelConfirmation,onChange:t=>f.a.SuppressTravelConfirmation=t,text:"Suppress travel confirmations",tooltip:c.a.createElement(c.a.Fragment,null,"If this is set, the confirmation message before traveling will not show up. You will automatically be deducted the travel cost as soon as you click.")}),c.a.createElement(u.a,{checked:f.a.SuppressBuyAugmentationConfirmation,onChange:t=>f.a.SuppressBuyAugmentationConfirmation=t,text:"Suppress augmentations confirmation",tooltip:c.a.createElement(c.a.Fragment,null,"If this is set, the confirmation message before buying augmentation will not show up.")}),c.a.createElement(u.a,{checked:f.a.SuppressTIXPopup,onChange:t=>f.a.SuppressTIXPopup=t,text:"Suppress TIX messages",tooltip:c.a.createElement(c.a.Fragment,null,"If this is set, the stock market will never create any popup.")}),t.player.bladeburner&&c.a.createElement(u.a,{checked:f.a.SuppressBladeburnerPopup,onChange:t=>f.a.SuppressBladeburnerPopup=t,text:"Suppress bladeburner popup",tooltip:c.a.createElement(c.a.Fragment,null,"If this is set, then having your Bladeburner actions interrupted by being busy with something else will not display a popup message.")})),[h.a.MISC]:c.a.createElement(d.a,{title:"Misc"},c.a.createElement(u.a,{checked:f.a.DisableHotkeys,onChange:t=>f.a.DisableHotkeys=t,text:"Disable hotkeys",tooltip:c.a.createElement(c.a.Fragment,null,'If this is set, then most hotkeys (keyboard shortcuts) in the game are disabled. This includes Terminal commands, hotkeys to navigate between different parts of the game, and the "Save and Close (Ctrl + b)" hotkey in the Text Editor.')}),c.a.createElement(u.a,{checked:f.a.EnableBashHotkeys,onChange:t=>f.a.EnableBashHotkeys=t,text:"Enable bash hotkeys",tooltip:c.a.createElement(c.a.Fragment,null,"Improved Bash emulation mode. Setting this to 1 enables several new Terminal shortcuts and features that more closely resemble a real Bash-style shell. Note that when this mode is enabled, the default browser shortcuts are overriden by the new Bash shortcuts.")}))}[t.currentTab]}},function(t,e,n){"use strict";n.d(e,"a",(function(){return I}));var a=n(1503),r=n(1827),i=n(1480),o=n(1828),s=n(1829),l=n(1830),c=n(1831),f=n(1832),u=n(1833),m=n(1834),h=n(1835),d=n(355),p=n(1),g=n(19),y=n(45),b=n(248),E=n(8),v=n(21),k=n(0),_=n.n(k),w=n(1247),S=n(109),x=n(6),C=n(621),L=n(622),O=n(252),M=n(633),T=n(94),A=n(635),R=n(22),N=n(287);const P=t=>_.a.createElement(d.a,{selected:t.sideBarProps.tab===t.tab,onClick:()=>t.sideBarProps.setTab(t.tab)},_.a.createElement(p.a,null,t.tabName)),I=t=>{var e,n,d,I,F,D,j,B;const G=Object(k.useRef)(null),[W,H]=Object(k.useState)(!1),[U,q]=Object(k.useState)(!1),[$,K]=Object(k.useState)(null);return _.a.createElement(g.a,null,_.a.createElement(y.a,{sx:{height:"fit-content",mb:1}},_.a.createElement(b.a,null,_.a.createElement(P,{sideBarProps:t,tab:N.a.SYSTEM,tabName:"System"}),_.a.createElement(P,{sideBarProps:t,tab:N.a.GAMEPLAY,tabName:"Gameplay"}),_.a.createElement(P,{sideBarProps:t,tab:N.a.INTERFACE,tabName:"Interface"}),_.a.createElement(P,{sideBarProps:t,tab:N.a.MISC,tabName:"Misc"}))),_.a.createElement(g.a,{sx:{display:"grid",width:"100%",height:"fit-content",gridTemplateAreas:'"save delete"\n "export import"\n "kill kill"\n "reset diagnose"\n "browse browse"\n "theme style"\n "links links"\n "devs devs"',gridTemplateColumns:"1fr 1fr"}},_.a.createElement(E.a,{onClick:()=>t.save(),startIcon:_.a.createElement(a.a,null),sx:{gridArea:"save"}},"Save Game"),_.a.createElement(g.a,{sx:{gridArea:"delete","& .MuiButton-root":{height:"100%",width:"100%"}}},_.a.createElement(M.a,null)),_.a.createElement(v.a,{title:_.a.createElement(p.a,null,"Export your game to a text file.")},_.a.createElement(E.a,{onClick:()=>t.export(),startIcon:_.a.createElement(r.a,null),sx:{gridArea:"export"}},"Export Game")),_.a.createElement(v.a,{title:_.a.createElement(p.a,null,"Import your game from a text file.",_.a.createElement("br",null),"This will ",_.a.createElement("strong",null,"overwrite")," your current game. Back it up first!")},_.a.createElement(E.a,{onClick:function(){if(!(window.File&&window.FileReader&&window.FileList&&window.Blob))return;const t=G.current;if(null===t)throw new Error("import input should not be null");t.click()},startIcon:_.a.createElement(i.a,null),sx:{gridArea:"import"}},"Import Game",_.a.createElement("input",{ref:G,id:"import-game-file-selector",type:"file",hidden:!0,onChange:async function(t){try{const e=await S.c.getImportStringFromFile(t.target.files),n=await S.c.getImportDataFromString(e);K(n),q(!0)}catch(t){T.b.emit(t.toString(),T.d.ERROR,5e3)}}}))),_.a.createElement(O.a,{open:U,onClose:()=>q(!1),onConfirm:()=>async function(){if($){try{await S.c.importGame($.base64)}catch(t){T.b.emit(t.toString(),T.d.ERROR,5e3)}q(!1),K(null)}}(),additionalButton:_.a.createElement(E.a,{onClick:function(){$&&(t.router.toImportSave($.base64),q(!1),K(null))}},"Compare Save"),confirmationText:_.a.createElement(_.a.Fragment,null,"Importing a new game will ",_.a.createElement("strong",null,"completely wipe")," the current data!",_.a.createElement("br",null),_.a.createElement("br",null),"Make sure to have a backup of your current save file before importing.",_.a.createElement("br",null),"The file you are attempting to import seems valid.",(null!==(e=null==$||null===(n=$.playerData)||void 0===n?void 0:n.lastSave)&&void 0!==e?e:0)>0&&_.a.createElement(_.a.Fragment,null,_.a.createElement("br",null),_.a.createElement("br",null),"The export date of the save file is"," ",_.a.createElement("strong",null,new Date(null!==(d=null==$||null===(I=$.playerData)||void 0===I?void 0:I.lastSave)&&void 0!==d?d:0).toLocaleString())),(null!==(F=null==$||null===(D=$.playerData)||void 0===D?void 0:D.totalPlaytime)&&void 0!==F?F:0)>0&&_.a.createElement(_.a.Fragment,null,_.a.createElement("br",null),_.a.createElement("br",null),"Total play time of imported game:"," ",Object(R.d)(null!==(j=null==$||null===(B=$.playerData)||void 0===B?void 0:B.totalPlaytime)&&void 0!==j?j:0)),_.a.createElement("br",null),_.a.createElement("br",null))}),_.a.createElement(v.a,{title:_.a.createElement(p.a,null,"Forcefully kill all active running scripts, in case there is a bug or some unexpected issue with the game. After using this, save the game and then reload the page. This is different than normal kill in that normal kill will tell the script to shut down while force kill just removes the references to it (and it should crash on its own). This will not remove the files on your computer, just forcefully kill all running instances of all scripts.")},_.a.createElement(E.a,{onClick:()=>t.forceKill(),sx:{gridArea:"kill"}},"Force kill all active scripts")),_.a.createElement(g.a,{sx:{gridArea:"reset","& .MuiButton-root":{height:"100%",width:"100%"}}},_.a.createElement(A.a,{noConfirmation:x.a.SuppressBuyAugmentationConfirmation,onTriggered:t.softReset})),_.a.createElement(v.a,{title:_.a.createElement(p.a,null,"If your save file is extremely big you can use this button to view a map of all the files on every server. Be careful: there might be spoilers.")},_.a.createElement(E.a,{onClick:()=>H(!0),sx:{gridArea:"diagnose"}},"Diagnose files")),_.a.createElement(v.a,{title:"Head to the theme browser to see a collection of prebuilt themes."},_.a.createElement(E.a,{startIcon:_.a.createElement(o.a,null),onClick:()=>t.router.toThemeBrowser(),sx:{gridArea:"browse"}},"Theme Browser")),_.a.createElement(g.a,{sx:{gridArea:"theme","& .MuiButton-root":{height:"100%",width:"100%"}}},_.a.createElement(L.a,{router:t.router})),_.a.createElement(g.a,{sx:{gridArea:"style","& .MuiButton-root":{height:"100%",width:"100%"}}},_.a.createElement(C.a,null)),_.a.createElement(g.a,{sx:{gridArea:"links",display:"grid",gridTemplateAreas:'"bug changelog"\n "docs docs"\n "discord reddit"\n "plaza plaza"',gridTemplateColumns:"1fr 1fr",my:1}},_.a.createElement(E.a,{startIcon:_.a.createElement(s.a,null),href:"https://github.com/danielyxie/bitburner/issues/new",target:"_blank",sx:{gridArea:"bug"}},"Report Bug"),_.a.createElement(E.a,{startIcon:_.a.createElement(l.a,null),href:"https://bitburner.readthedocs.io/en/latest/changelog.html",target:"_blank",sx:{gridArea:" changelog"}},"Changelog"),_.a.createElement(E.a,{startIcon:_.a.createElement(c.a,null),href:"https://bitburner.readthedocs.io/en/latest/index.html",target:"_blank",sx:{gridArea:"docs"}},"Documentation"),_.a.createElement(E.a,{startIcon:_.a.createElement(f.a,null),href:"https://discord.gg/TFc3hKD",target:"_blank",sx:{gridArea:"discord"}},"Discord"),_.a.createElement(E.a,{startIcon:_.a.createElement(u.a,null),href:"https://www.reddit.com/r/bitburner",target:"_blank",sx:{gridArea:"reddit"}},"Reddit"),_.a.createElement(E.a,{startIcon:_.a.createElement(m.a,null),href:"https://plaza.dsolver.ca/games/bitburner",target:"_blank",sx:{gridArea:"plaza"}},"Incremental game plaza")),!location.href.startsWith("file://")&&_.a.createElement(g.a,{sx:{gridArea:"devs"}},_.a.createElement("form",{action:"https://www.paypal.com/cgi-bin/webscr",method:"post",target:"_blank",style:{display:"block"}},_.a.createElement(E.a,{sx:{width:"100%",display:"flex",flexDirection:"column"},type:"submit"},"danielyxie / BigD (Original Dev)",_.a.createElement("input",{type:"hidden",name:"cmd",value:"_s-xclick"}),_.a.createElement("input",{type:"hidden",name:"encrypted",value:"-----BEGIN PKCS7-----MIIHRwYJKoZIhvcNAQcEoIIHODCCBzQCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYA2Y2VGE75oWct89z//G2YEJKmzx0uDTXNrpje9ThxmUnBLFZCY+I11Pors7lGRvFqo5okwnu41CfYMPHDxpAgyYyQndMX9pWUX0gLfBMm2BaHwsNBCwt34WmpQqj7TGsQ+aw9NbmkxiJltGnOa+6/gy10mPZAA3HxiieLeCKkGgDELMAkGBSsOAwIaBQAwgcQGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQI72F1YSzHUd2AgaDMekHU3AKT93Ey9wkB3486bV+ngFSD6VOHrPweH9QATsp+PMe9QM9vmq+s2bGtTbZaYrFqM3M97SnQ0l7IQ5yuOzdZhRdfysu5uJ8dnuHUzq4gLSzqMnZ6/3c+PoHB8AS1nYHUVL4U0+ogZsO1s97IAQyfck9SaoFlxVtqQhkb8752MkQJJvGu3ZQSQGcVC4hFDPk8prXqyq4BU/k/EliwoIIDhzCCA4MwggLsoAMCAQICAQAw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IobhOGJr85+XHhN0v4gUkEDI8r2/rNk1m0GA8HKddvTjyGw/XqXa+LSTlDYkqI8OwR8GEYj4efEtcRpRYBxV8KxAW93YDWzFGvruKnnLbDAF6VR5w/cCMn5hzGCAZowggGWAgEBMIGUMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbQIBADAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMTcwNzI1MDExODE2WjAjBgkqhkiG9w0BCQQxFgQUNo8efiZ7sk7nwKM/6B6Z7sU8hIIwDQYJKoZIhvcNAQEBBQAEgYB+JB4vZ/r48815/1HF/xK3+rOx7bPz3kAXmbhW/mkoF4OUbzqMeljvDIA9q/BDdlCLtxFOw9XlftTzv0eZCW/uCIiwu5wTzPIfPY1SI8WHe4cJbP2f2EYxIVs8D7OSirbW4yVa0+gACaLLj0rzIzNN8P/5PxgB03D+jwkcJABqng==-----END PKCS7-----"}),_.a.createElement("input",{type:"image",src:"https://www.paypalobjects.com/digitalassets/c/website/marketing/apac/C2/logos-buttons/optimize/26_Yellow_PayPal_Pill_Button.png",name:"submit",alt:"PayPal - The safer, easier way to pay online!"}))),_.a.createElement(E.a,{href:"https://www.google.com/search?q=Where+to+donate+blood+near+me%3F",target:"_blank",sx:{width:"100%",display:"flex",flexDirection:"column"}},"hydroflame (Current Maintainer)",_.a.createElement("span",{style:{display:"flex",alignItems:"center"}},_.a.createElement(h.a,{sx:{mb:.5,mr:1}}),"Donate blood!")))),_.a.createElement(w.a,{open:W,onClose:()=>H(!1)}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return _}));var a=n(0),r=n.n(a),i=n(24),o=n(38),s=n(5),l=n(148),c=n(149),f=n(30),u=n(1485),m=n(1486),h=n(50),d=n(1),p=n(45),g=n(157),y=n(158),b=n(159),E=n(81),v=n.n(E);function k(t){const e=Object(i.d)(t.hostname);if(null===e)throw new Error(`server '${t.hostname}' should not be null`);let n=0;for(const t of e.scripts)n+=t.code.length;for(const t of e.textFiles)n+=t.text.length;if(0===n)return r.a.createElement(r.a.Fragment,null);const a=[];for(const t of e.scripts)a.push({name:t.filename,size:t.code.length});for(const t of e.textFiles)a.push({name:t.fn,size:t.text.length});return a.sort((t,e)=>e.size-t.size),r.a.createElement(g.a,{TransitionProps:{unmountOnExit:!0}},r.a.createElement(y.a,{expandIcon:r.a.createElement(v.a,null)},r.a.createElement(d.a,null,e.hostname," (",s.a.formatBigNumber(n),"b)")),r.a.createElement(b.a,null,r.a.createElement(u.a,{component:p.a},r.a.createElement(l.a,null,r.a.createElement(m.a,null,r.a.createElement(h.a,null,r.a.createElement(f.a,null,r.a.createElement(d.a,null,"Filename")),r.a.createElement(f.a,{align:"right"},r.a.createElement(d.a,null,"Size")))),r.a.createElement(c.a,null,a.map(t=>r.a.createElement(h.a,{key:t.name},r.a.createElement(f.a,{component:"th",scope:"row"},r.a.createElement(d.a,null,t.name)),r.a.createElement(f.a,{align:"right"},r.a.createElement(d.a,null,s.a.formatBigNumber(t.size),"b"))))))),r.a.createElement("ul",null)))}function _(t){const e=[];for(const t of Object(i.c)())e.push(t.hostname);return r.a.createElement(o.a,{open:t.open,onClose:t.onClose},r.a.createElement(r.a.Fragment,null,r.a.createElement(d.a,null,"Welcome to the file diagnostic! If your save file is really big it's likely because you have too many text/scripts. This tool can help you narrow down where they are."),e.map(t=>r.a.createElement(k,{key:t,hostname:t}))))}},,,function(t,e,n){"use strict";n.d(e,"a",(function(){return k}));var a=n(0),r=n.n(a),i=n(38),o=n(8),s=n(356),l=n(1),c=n(45),f=n(76),u=n(464),m=n.n(u),h=n(467),d=n.n(h),p=n(170),g=n(6),y=n(401),b=n(21);function E({value:t,onChange:e,refreshId:n}){const[i,o]=Object(a.useState)(),[s,l]=Object(a.useState)(t);function c(t){l(t),o(t?"":"Must have a value")}return Object(a.useEffect)(()=>e(s,i),[s]),Object(a.useEffect)(()=>c(t),[n]),r.a.createElement(f.a,{sx:{my:1},label:"Font-Family",error:!!i,value:s,helperText:i,onChange:function(t){c(t.target.value)},fullWidth:!0})}function v({value:t,onChange:e,refreshId:n}){const[i,o]=Object(a.useState)(),[s,l]=Object(a.useState)(t);function c(t){l(t),t?isNaN(Number(t))?o("Must be a number"):o(""):o("Must have a value")}return Object(a.useEffect)(()=>e(s,i),[s]),Object(a.useEffect)(()=>c(t),[n]),r.a.createElement(f.a,{sx:{my:1},label:"Line Height",error:!!i,value:s,helperText:i,onChange:function(t){c(t.target.value)}})}function k(t){const[e,n]=Object(a.useState)(0),[f,u]=Object(a.useState)(),[h,k]=Object(a.useState)({...g.a.styles});function _(t){Object.assign(g.a.styles,t),p.b.emit()}function w(t,e){u(e),e||k(t)}return r.a.createElement(i.a,{open:t.open,onClose:t.onClose},r.a.createElement(l.a,{variant:"h6"},"Styles Editor"),r.a.createElement(l.a,null,"WARNING: Changing styles ",r.a.createElement("strong",null,"may mess up")," the interface. Drastic changes are"," ",r.a.createElement("strong",null,"NOT recommended"),"."),r.a.createElement(c.a,{sx:{p:2,my:2}},r.a.createElement(E,{value:h.fontFamily,refreshId:e,onChange:(t,e)=>w({...h,fontFamily:t},e)}),r.a.createElement("br",null),r.a.createElement(v,{value:h.lineHeight,refreshId:e,onChange:(t,e)=>w({...h,lineHeight:t},e)}),r.a.createElement("br",null),r.a.createElement(s.a,{sx:{my:1}},r.a.createElement(o.a,{onClick:function(){const t={...y.a};k(t),_(t),n(e+1)},startIcon:r.a.createElement(m.a,null),color:"secondary",variant:"outlined"},"Revert to Defaults"),r.a.createElement(b.a,{title:"Save styles to settings"},r.a.createElement(o.a,{onClick:function(){_(h)},endIcon:r.a.createElement(d.a,null),color:f?"error":"primary",disabled:!!f},"Save Modifications")))))}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return x}));var a=n(0),r=n.n(a),i=n(38),o=n(8),s=n(356),l=n(1),c=n(21),f=n(45),u=n(76),m=n(111),h=n(464),d=n.n(h),p=n(632),g=n.n(p),y=n(1283),b=n.n(y),E=n(623),v=n(170),k=n(6),_=n(337),w=n(631);function S({name:t,onColorChange:e,color:n,defaultColor:a}){return void 0===n&&(console.error(`color ${t} was undefined, reverting to default`),n=a),r.a.createElement(r.a.Fragment,null,r.a.createElement(u.a,{sx:{mx:1},label:t,value:n,InputProps:{startAdornment:r.a.createElement(r.a.Fragment,null,r.a.createElement(E.a,{hideTextfield:!0,deferred:!0,value:n,onChange:n=>e(t,"#"+n.hex),disableAlpha:!0})),endAdornment:r.a.createElement(r.a.Fragment,null,r.a.createElement(m.a,{onClick:()=>e(t,a)},r.a.createElement(d.a,{color:"primary"})))}}))}function x(t){const[e,n]=Object(a.useState)({...k.a.theme});function m(t,e){n(n=>(n[t]=e,n)),k.a.theme[t]=e,v.b.emit()}function h(t){!function(t){n(t),Object.assign(k.a.theme,t),v.b.emit()}(t)}return r.a.createElement(i.a,{open:t.open,onClose:t.onClose},r.a.createElement(f.a,{sx:{px:1,py:1,my:1}},r.a.createElement(c.a,{open:!0,placement:"top",title:r.a.createElement(l.a,null,"Example tooltip")},r.a.createElement(o.a,{color:"primary",size:"small"},"primary button")),r.a.createElement(o.a,{color:"secondary",size:"small"},"secondary button"),r.a.createElement(o.a,{color:"warning",size:"small"},"warning button"),r.a.createElement(o.a,{color:"info",size:"small"},"info button"),r.a.createElement(o.a,{color:"error",size:"small"},"error button"),r.a.createElement(o.a,{disabled:!0,size:"small"},"disabled button"),r.a.createElement("br",null),r.a.createElement(l.a,{color:"primary",variant:"caption"},"text with primary color")," ",r.a.createElement(l.a,{color:"secondary",variant:"caption"},"text with secondary color")," ",r.a.createElement(l.a,{color:"error",variant:"caption"},"text with error color"),r.a.createElement("br",null),r.a.createElement(u.a,{value:"Text field",size:"small"})),r.a.createElement(f.a,{sx:{py:1,my:1}},r.a.createElement(S,{name:"primarylight",onColorChange:m,color:e.primarylight,defaultColor:k.b.theme.primarylight}),r.a.createElement(S,{name:"primary",onColorChange:m,color:e.primary,defaultColor:k.b.theme.primary}),r.a.createElement(S,{name:"primarydark",onColorChange:m,color:e.primarydark,defaultColor:k.b.theme.primarydark}),r.a.createElement("br",null),r.a.createElement(S,{name:"successlight",onColorChange:m,color:e.successlight,defaultColor:k.b.theme.successlight}),r.a.createElement(S,{name:"success",onColorChange:m,color:e.success,defaultColor:k.b.theme.success}),r.a.createElement(S,{name:"successdark",onColorChange:m,color:e.successdark,defaultColor:k.b.theme.successdark}),r.a.createElement("br",null),r.a.createElement(S,{name:"errorlight",onColorChange:m,color:e.errorlight,defaultColor:k.b.theme.errorlight}),r.a.createElement(S,{name:"error",onColorChange:m,color:e.error,defaultColor:k.b.theme.error}),r.a.createElement(S,{name:"errordark",onColorChange:m,color:e.errordark,defaultColor:k.b.theme.errordark}),r.a.createElement("br",null),r.a.createElement(S,{name:"secondarylight",onColorChange:m,color:e.secondarylight,defaultColor:k.b.theme.secondarylight}),r.a.createElement(S,{name:"secondary",onColorChange:m,color:e.secondary,defaultColor:k.b.theme.secondary}),r.a.createElement(S,{name:"secondarydark",onColorChange:m,color:e.secondarydark,defaultColor:k.b.theme.secondarydark}),r.a.createElement("br",null),r.a.createElement(S,{name:"warninglight",onColorChange:m,color:e.warninglight,defaultColor:k.b.theme.warninglight}),r.a.createElement(S,{name:"warning",onColorChange:m,color:e.warning,defaultColor:k.b.theme.warning}),r.a.createElement(S,{name:"warningdark",onColorChange:m,color:e.warningdark,defaultColor:k.b.theme.warningdark}),r.a.createElement("br",null),r.a.createElement(S,{name:"infolight",onColorChange:m,color:e.infolight,defaultColor:k.b.theme.infolight}),r.a.createElement(S,{name:"info",onColorChange:m,color:e.info,defaultColor:k.b.theme.info}),r.a.createElement(S,{name:"infodark",onColorChange:m,color:e.infodark,defaultColor:k.b.theme.infodark}),r.a.createElement("br",null),r.a.createElement(S,{name:"welllight",onColorChange:m,color:e.welllight,defaultColor:k.b.theme.welllight}),r.a.createElement(S,{name:"well",onColorChange:m,color:e.well,defaultColor:k.b.theme.well}),r.a.createElement(S,{name:"white",onColorChange:m,color:e.white,defaultColor:k.b.theme.white}),r.a.createElement(S,{name:"black",onColorChange:m,color:e.black,defaultColor:k.b.theme.black}),r.a.createElement(S,{name:"backgroundprimary",onColorChange:m,color:e.backgroundprimary,defaultColor:k.b.theme.backgroundprimary}),r.a.createElement(S,{name:"backgroundsecondary",onColorChange:m,color:e.backgroundsecondary,defaultColor:k.b.theme.backgroundsecondary}),r.a.createElement(S,{name:"button",onColorChange:m,color:e.button,defaultColor:k.b.theme.button}),r.a.createElement("br",null),r.a.createElement(S,{name:"hp",onColorChange:m,color:e.hp,defaultColor:k.b.theme.hp}),r.a.createElement(S,{name:"money",onColorChange:m,color:e.money,defaultColor:k.b.theme.money}),r.a.createElement(S,{name:"hack",onColorChange:m,color:e.hack,defaultColor:k.b.theme.hack}),r.a.createElement(S,{name:"combat",onColorChange:m,color:e.combat,defaultColor:k.b.theme.combat}),r.a.createElement(S,{name:"cha",onColorChange:m,color:e.cha,defaultColor:k.b.theme.cha}),r.a.createElement(S,{name:"int",onColorChange:m,color:e.int,defaultColor:k.b.theme.int}),r.a.createElement(S,{name:"rep",onColorChange:m,color:e.rep,defaultColor:k.b.theme.rep}),r.a.createElement(S,{name:"disabled",onColorChange:m,color:e.disabled,defaultColor:k.b.theme.disabled})),r.a.createElement(f.a,{sx:{px:1,py:1,my:1}},r.a.createElement(u.a,{sx:{mb:1},multiline:!0,fullWidth:!0,maxRows:10,label:"import / export theme",value:JSON.stringify(e,void 0,2),onChange:function(t){try{const e=JSON.parse(t.target.value);if("object"!=typeof e)return;n(e);for(const t of Object.keys(e))k.a.theme[t]=e[t];v.b.emit()}catch(t){}}}),r.a.createElement(r.a.Fragment,null,r.a.createElement(l.a,{sx:{my:1}},"Backup your theme or share it with others by copying the string above."),r.a.createElement(w.a,null),r.a.createElement(s.a,null,r.a.createElement(c.a,{title:"Reverts all modification back to the default theme. This is permanent."},r.a.createElement(o.a,{onClick:()=>h(_.a),startIcon:r.a.createElement(b.a,null)},"Revert to Default")),r.a.createElement(c.a,{title:"Move over to the theme browser's page to use one of our predefined themes."},r.a.createElement(o.a,{startIcon:r.a.createElement(g.a,null),onClick:()=>t.router.toThemeBrowser()},"See more themes"))))))}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var a=n(0),r=n.n(a),i=n(249),o=n(1),s=n(8),l=n(19),c=n(29),f=n(1287),u=n(1294);function m(){const t=c.b.Player(),[e,n]=Object(a.useState)(!1),m=Object(a.useState)(!1)[1];function h(){m(t=>!t)}return Object(a.useEffect)(()=>{const t=setInterval(h,200);return()=>clearInterval(t)},[]),r.a.createElement(r.a.Fragment,null,r.a.createElement(i.a,{disableGutters:!0,maxWidth:"md",sx:{mx:0}},r.a.createElement(o.a,{variant:"h4"},"Sleeves"),r.a.createElement(o.a,null,"Duplicate Sleeves are MK-V Synthoids (synthetic androids) into which your consciousness has been copied. In other words, these Synthoids contain a perfect duplicate of your mind.",r.a.createElement("br",null),r.a.createElement("br",null),"Sleeves can be used to perform different tasks synchronously.",r.a.createElement("br",null),r.a.createElement("br",null))),r.a.createElement(s.a,{onClick:()=>n(!0)},"FAQ"),r.a.createElement(s.a,{href:"https://bitburner.readthedocs.io/en/latest/advancedgameplay/sleeves.html#duplicate-sleeves",target:"_blank"},"Wiki Documentation"),r.a.createElement(l.a,{display:"grid",sx:{gridTemplateColumns:"repeat(2, 1fr)",mt:1}},t.sleeves.map((t,e)=>r.a.createElement(f.a,{key:e,rerender:h,sleeve:t}))),r.a.createElement(u.a,{open:e,onClose:()=>n(!1)}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return w}));var a=n(45),r=n(19),i=n(8),o=n(21),s=n(1),l=n(0),c=n.n(l),f=n(10),u=n(86),m=n(188),h=n(29),d=n(5),p=n(413),g=n(66),y=n(1288),b=n(1289),E=n(1290),v=n(782),k=n(1292),_=n(1293);function w(t){const e=h.b.Player(),[n,w]=Object(l.useState)(!1),[S,x]=Object(l.useState)(!1),[C,L]=Object(l.useState)(!1),[O,M]=Object(l.useState)(!1),[T,A]=Object(l.useState)(["------","------","------"]);let R=c.a.createElement(c.a.Fragment,null);switch(t.sleeve.currentTask){case g.a.Idle:R=c.a.createElement(c.a.Fragment,null,"This sleeve is currently idle");break;case g.a.Company:R=c.a.createElement(c.a.Fragment,null,"This sleeve is currently working your job at ",t.sleeve.currentTaskLocation,".");break;case g.a.Faction:{let e="nothing";switch(t.sleeve.factionWorkType){case m.a.Field:e="Field work";break;case m.a.Hacking:e="Hacking contracts";break;case m.a.Security:e="Security work"}R=c.a.createElement(c.a.Fragment,null,"This sleeve is currently doing ",e," for ",t.sleeve.currentTaskLocation,".");break}case g.a.Crime:{const e=Object.values(u.a).find(e=>e.name===t.sleeve.crimeType);if(!e)throw new Error("crime should not be undefined");R=c.a.createElement(c.a.Fragment,null,"This sleeve is currently attempting to ",e.type," (Success Rate:"," ",d.a.formatPercentage(e.successRate(t.sleeve)),").");break}case g.a.Class:R=c.a.createElement(c.a.Fragment,null,"This sleeve is currently studying/taking a course at ",t.sleeve.currentTaskLocation,".");break;case g.a.Gym:R=c.a.createElement(c.a.Fragment,null,"This sleeve is currently working out at ",t.sleeve.currentTaskLocation,".");break;case g.a.Bladeburner:{let e="";"------"!==t.sleeve.bbContract?e=` - ${t.sleeve.bbContract} (Success Rate: ${t.sleeve.currentTaskLocation})`:""!==t.sleeve.currentTaskLocation&&(e=t.sleeve.currentTaskLocation),R=c.a.createElement(c.a.Fragment,null,"This sleeve is currently attempting to ",t.sleeve.bbAction,". ",e);break}case g.a.Recovery:R=c.a.createElement(c.a.Fragment,null,"This sleeve is currently set to focus on shock recovery. This causes the Sleeve's shock to decrease at a faster rate.");break;case g.a.Synchro:R=c.a.createElement(c.a.Fragment,null,"This sleeve is currently set to synchronize with the original consciousness. This causes the Sleeve's synchronization to increase.");break;default:console.error("Invalid/Unrecognized taskValue in updateSleeveTaskDescription(): "+T[0])}return c.a.createElement(c.a.Fragment,null,c.a.createElement(a.a,{sx:{p:1,display:"grid",gridTemplateColumns:"1fr 1fr",width:"auto",gap:1}},c.a.createElement("span",null,c.a.createElement(v.b,{sleeve:t.sleeve}),c.a.createElement(r.a,{display:"grid",sx:{gridTemplateColumns:"1fr 1fr",width:"100%"}},c.a.createElement(i.a,{onClick:()=>w(!0)},"More Stats"),c.a.createElement(i.a,{onClick:()=>x(!0)},"More Earnings Info"),c.a.createElement(o.a,{title:e.moneyL(!0),disabled:e.moneyM(!0),disabled:t.sleeve.shock<100,sx:{width:"100%",height:"100%"}},"Manage Augmentations"))))),c.a.createElement("span",null,c.a.createElement(v.a,{sleeve:t.sleeve}),c.a.createElement(k.a,{player:e,sleeve:t.sleeve,setABC:A}),c.a.createElement(i.a,{onClick:function(){switch(t.sleeve.resetTaskStatus(e),T[0]){case"------":break;case"Work for Company":t.sleeve.workForCompany(e,T[1]);break;case"Work for Faction":t.sleeve.workForFaction(e,T[1],T[2]);break;case"Commit Crime":t.sleeve.commitCrime(e,T[1]);break;case"Take University Course":t.sleeve.takeUniversityCourse(e,T[2],T[1]);break;case"Workout at Gym":t.sleeve.workoutAtGym(e,T[2],T[1]);break;case"Perform Bladeburner Actions":t.sleeve.bladeburner(e,T[1],T[2]);break;case"Shock Recovery":t.sleeve.shockRecovery(e);break;case"Synchronize":t.sleeve.synchronize(e);break;default:console.error("Invalid/Unrecognized taskValue in setSleeveTask(): "+T[0])}t.rerender()},sx:{width:"100%"}},"Set Task"),c.a.createElement(s.a,null,R),c.a.createElement(s.a,null,(t.sleeve.currentTask===g.a.Crime||t.sleeve.currentTask===g.a.Bladeburner)&&t.sleeve.currentTaskMaxTime>0&&c.a.createElement(p.a,{variant:"determinate",value:t.sleeve.currentTaskTime/t.sleeve.currentTaskMaxTime*100,color:"primary"})))),c.a.createElement(b.a,{open:n,onClose:()=>w(!1),sleeve:t.sleeve}),c.a.createElement(y.a,{open:S,onClose:()=>x(!1),sleeve:t.sleeve}),c.a.createElement(_.a,{open:C,onClose:()=>L(!1),sleeve:t.sleeve,rerender:t.rerender}),c.a.createElement(E.a,{open:O,onClose:()=>M(!1),sleeve:t.sleeve}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(5),r=n(20),i=n(0),o=n(201),s=n(38);function l(t){return i.createElement(s.a,{open:t.open,onClose:t.onClose},i.createElement(o.a,{rows:[["Money ",i.createElement(r.a,{money:t.sleeve.earningsForTask.money})],["Hacking Exp ",a.a.formatExp(t.sleeve.earningsForTask.hack)],["Strength Exp ",a.a.formatExp(t.sleeve.earningsForTask.str)],["Defense Exp ",a.a.formatExp(t.sleeve.earningsForTask.def)],["Dexterity Exp ",a.a.formatExp(t.sleeve.earningsForTask.dex)],["Agility Exp ",a.a.formatExp(t.sleeve.earningsForTask.agi)],["Charisma Exp ",a.a.formatExp(t.sleeve.earningsForTask.cha)]],title:"Earnings for Current Task:"}),i.createElement("br",null),i.createElement(o.a,{rows:[["Money: ",i.createElement(r.a,{money:t.sleeve.earningsForPlayer.money})],["Hacking Exp: ",a.a.formatExp(t.sleeve.earningsForPlayer.hack)],["Strength Exp: ",a.a.formatExp(t.sleeve.earningsForPlayer.str)],["Defense Exp: ",a.a.formatExp(t.sleeve.earningsForPlayer.def)],["Dexterity Exp: ",a.a.formatExp(t.sleeve.earningsForPlayer.dex)],["Agility Exp: ",a.a.formatExp(t.sleeve.earningsForPlayer.agi)],["Charisma Exp: ",a.a.formatExp(t.sleeve.earningsForPlayer.cha)]],title:"Total Earnings for Host Consciousness:"}),i.createElement("br",null),i.createElement(o.a,{rows:[["Money: ",i.createElement(r.a,{money:t.sleeve.earningsForSleeves.money})],["Hacking Exp: ",a.a.formatExp(t.sleeve.earningsForSleeves.hack)],["Strength Exp: ",a.a.formatExp(t.sleeve.earningsForSleeves.str)],["Defense Exp: ",a.a.formatExp(t.sleeve.earningsForSleeves.def)],["Dexterity Exp: ",a.a.formatExp(t.sleeve.earningsForSleeves.dex)],["Agility Exp: ",a.a.formatExp(t.sleeve.earningsForSleeves.agi)],["Charisma Exp: ",a.a.formatExp(t.sleeve.earningsForSleeves.cha)]],title:"Total Earnings for Other Sleeves:"}),i.createElement("br",null))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var a=n(5),r=n(22),i=n(10),o=n(1),s=n(201),l=n(38),c=n(0),f=n.n(c);function u(t){return f.a.createElement(l.a,{open:t.open,onClose:t.onClose},f.a.createElement(s.a,{rows:[[f.a.createElement(f.a.Fragment,null,"Hacking: "),t.sleeve.hacking,f.a.createElement(f.a.Fragment,null," (",a.a.formatExp(t.sleeve.hacking_exp)," exp)")],[f.a.createElement(f.a.Fragment,null,"Strength: "),t.sleeve.strength,f.a.createElement(f.a.Fragment,null," (",a.a.formatExp(t.sleeve.strength_exp)," exp)")],[f.a.createElement(f.a.Fragment,null,"Defense: "),t.sleeve.defense,f.a.createElement(f.a.Fragment,null," (",a.a.formatExp(t.sleeve.defense_exp)," exp)")],[f.a.createElement(f.a.Fragment,null,"Dexterity: "),t.sleeve.dexterity,f.a.createElement(f.a.Fragment,null," (",a.a.formatExp(t.sleeve.dexterity_exp)," exp)")],[f.a.createElement(f.a.Fragment,null,"Agility: "),t.sleeve.agility,f.a.createElement(f.a.Fragment,null," (",a.a.formatExp(t.sleeve.agility_exp)," exp)")],[f.a.createElement(f.a.Fragment,null,"Charisma: "),t.sleeve.charisma,f.a.createElement(f.a.Fragment,null," (",a.a.formatExp(t.sleeve.charisma_exp)," exp)")]],title:"Stats:"}),f.a.createElement("br",null),f.a.createElement(s.a,{rows:[[f.a.createElement(f.a.Fragment,null,"Hacking Level multiplier: "),a.a.formatPercentage(t.sleeve.hacking_mult)],[f.a.createElement(f.a.Fragment,null,"Hacking Experience multiplier: "),a.a.formatPercentage(t.sleeve.hacking_exp_mult)],[f.a.createElement(f.a.Fragment,null,"Strength Level multiplier: "),a.a.formatPercentage(t.sleeve.strength_mult)],[f.a.createElement(f.a.Fragment,null,"Strength Experience multiplier: "),a.a.formatPercentage(t.sleeve.strength_exp_mult)],[f.a.createElement(f.a.Fragment,null,"Defense Level multiplier: "),a.a.formatPercentage(t.sleeve.defense_mult)],[f.a.createElement(f.a.Fragment,null,"Defense Experience multiplier: "),a.a.formatPercentage(t.sleeve.defense_exp_mult)],[f.a.createElement(f.a.Fragment,null,"Dexterity Level multiplier: "),a.a.formatPercentage(t.sleeve.dexterity_mult)],[f.a.createElement(f.a.Fragment,null,"Dexterity Experience multiplier: "),a.a.formatPercentage(t.sleeve.dexterity_exp_mult)],[f.a.createElement(f.a.Fragment,null,"Agility Level multiplier: "),a.a.formatPercentage(t.sleeve.agility_mult)],[f.a.createElement(f.a.Fragment,null,"Agility Experience multiplier: "),a.a.formatPercentage(t.sleeve.agility_exp_mult)],[f.a.createElement(f.a.Fragment,null,"Charisma Level multiplier: "),a.a.formatPercentage(t.sleeve.charisma_mult)],[f.a.createElement(f.a.Fragment,null,"Charisma Experience multiplier: "),a.a.formatPercentage(t.sleeve.charisma_exp_mult)],[f.a.createElement(f.a.Fragment,null,"Faction Reputation Gain multiplier: "),a.a.formatPercentage(t.sleeve.faction_rep_mult)],[f.a.createElement(f.a.Fragment,null,"Company Reputation Gain multiplier: "),a.a.formatPercentage(t.sleeve.company_rep_mult)],[f.a.createElement(f.a.Fragment,null,"Salary multiplier: "),a.a.formatPercentage(t.sleeve.work_money_mult)],[f.a.createElement(f.a.Fragment,null,"Crime Money multiplier: "),a.a.formatPercentage(t.sleeve.crime_money_mult)],[f.a.createElement(f.a.Fragment,null,"Crime Success multiplier: "),a.a.formatPercentage(t.sleeve.crime_success_mult)]],title:"Multipliers:"}),t.sleeve.storedCycles>10&&f.a.createElement(o.a,{sx:{py:2}},"Bonus Time: ",Object(r.d)(t.sleeve.storedCycles*i.a.MilliPerCycle)))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var a=n(249),r=n(45),i=n(1),o=n(0),s=n.n(o),l=n(636),c=n(29),f=n(38),u=n(600);function m(t){const e=c.b.Player(),n=Object(o.useState)(!1)[1];function m(){n(t=>!t)}Object(o.useEffect)(()=>{const t=setInterval(m,150);return()=>clearInterval(t)},[]);const h=t.sleeve.augmentations.map(t=>t.name),d=Object(u.a)(t.sleeve,e);return s.a.createElement(f.a,{open:t.open,onClose:t.onClose},s.a.createElement(a.a,{component:r.a,disableGutters:!0,maxWidth:"lg",sx:{mx:0,mb:1,p:1}},s.a.createElement(i.a,null,"You can purchase Augmentations for your Duplicate Sleeves. These Augmentations have the same effect as they would for you. You can only purchase Augmentations that you have unlocked through Factions.",s.a.createElement("br",null),s.a.createElement("br",null),"When purchasing an Augmentation for a Duplicate Sleeve, they are immediately installed. This means that the Duplicate Sleeve will immediately lose all of its stat experience.",s.a.createElement("br",null),s.a.createElement("br",null),"Augmentations will appear below as they become available.")),s.a.createElement(l.a,{augNames:d.map(t=>t.name),ownedAugNames:h,player:e,canPurchase:(t,e)=>t.money>e.baseCost,purchaseAugmentation:(e,n,a)=>{t.sleeve.tryBuyAugmentation(e,n),m()},sleeveAugs:!0}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var a=n(0),r=n.n(a),i=n(105),o=n(119),s=n(20),l=n(38),c=n(29),f=n(1),u=n(8);function m(t){if(void 0===t.aug||void 0===t.faction)return r.a.createElement(r.a.Fragment,null);const e=c.b.Player();return r.a.createElement(l.a,{open:t.open,onClose:t.onClose},r.a.createElement(f.a,{variant:"h4"},t.aug.name),r.a.createElement(f.a,null,t.aug.info,r.a.createElement("br",null),r.a.createElement("br",null),t.aug.stats,r.a.createElement("br",null),r.a.createElement("br",null),"Would you like to purchase the ",t.aug.name," Augmentation for ",r.a.createElement(s.a,{money:t.aug.getCost(e).moneyCost}),"?",r.a.createElement("br",null),r.a.createElement("br",null)),r.a.createElement(u.a,{autoFocus:!0,onClick:function(){!Object(o.g)(t.aug)&&e.hasAugmentation(t.aug)||(Object(i.f)(t.aug,t.faction),t.onClose())}},"Purchase"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return k}));var a=n(0),r=n.n(a),i=n(66),o=n(86),s=n(9),l=n(15),c=n(26),f=n(188),u=n(130),m=n(74),h=n(4);const d=["Study Computer Science","Data Structures","Networks","Algorithms","Management","Leadership"],p=["Train Strength","Train Defense","Train Dexterity","Train Agility"],g=["Field analysis","Recruitment","Diplomacy","Infiltrate synthoids","Support main sleeve","Take on contracts"];function y(t,e){const n=[];for(const a of t.sleeves)e!==a&&a.currentTask===i.a.Company&&n.push(a.currentTaskLocation);const a=Object.keys(t.jobs);for(let t=0;t{const e=c.a[t];if(!e)return!1;const n=e.getInfo();return n.offerHackingWork||n.offerFieldWork||n.offerSecurityWork})}const E={"------":()=>({first:["------"],second:()=>["------"]}),"Work for Company":(t,e)=>{let n=y(t,e);return 0===n.length&&(n=["------"]),{first:n,second:()=>["------"]}},"Work for Faction":(t,e)=>{let n=b(t,e);return 0===n.length&&(n=["------"]),{first:n,second:t=>{const e=c.a[t];if(!e)return["------"];const n=e.getInfo(),a=[];return n.offerHackingWork&&a.push("Hacking Contracts"),n.offerFieldWork&&a.push("Field Work"),n.offerSecurityWork&&a.push("Security Work"),a}}},"Commit Crime":()=>({first:Object.values(o.a).map(t=>t.name),second:()=>["------"]}),"Take University Course":(t,e)=>{let n=[];switch(e.city){case l.a.Aevum:n=[s.a.AevumSummitUniversity];break;case l.a.Sector12:n=[s.a.Sector12RothmanUniversity];break;case l.a.Volhaven:n=[s.a.VolhavenZBInstituteOfTechnology];break;default:n=["No university available in city!"]}return{first:d,second:()=>n}},"Workout at Gym":(t,e)=>{let n=[];switch(e.city){case l.a.Aevum:n=[s.a.AevumCrushFitnessGym,s.a.AevumSnapFitnessGym];break;case l.a.Sector12:n=[s.a.Sector12IronGym,s.a.Sector12PowerhouseGym];break;case l.a.Volhaven:n=[s.a.VolhavenMilleniumFitnessGym];break;default:n=["No gym available in city!"]}return{first:p,second:()=>n}},"Perform Bladeburner Actions":(t,e)=>({first:g,second:n=>"Take on contracts"===n?function(t,e){const n=t.bladeburner;if(null===n)return["------"];let a=n.getContractNamesNetscriptFn();for(const n of t.sleeves)e!==n&&n.currentTask===i.a.Bladeburner&&"Take on contracts"==n.bbAction&&(a=a.filter(t=>t!=n.bbContract));return 0===a.length?["------"]:a}(t,e):["------"]}),"Shock Recovery":()=>({first:["------"],second:()=>["------"]}),Synchronize:()=>({first:["------"],second:()=>["------"]})},v={"------":()=>!0,"Work for Company":(t,e)=>y(t,e).length>0,"Work for Faction":(t,e)=>b(t,e).length>0,"Commit Crime":()=>!0,"Take University Course":(t,e)=>[l.a.Aevum,l.a.Sector12,l.a.Volhaven].includes(e.city),"Workout at Gym":(t,e)=>[l.a.Aevum,l.a.Sector12,l.a.Volhaven].includes(e.city),"Perform Bladeburner Actions":(t,e)=>t.inBladeburner(),"Shock Recovery":(t,e)=>e.shock<100,Synchronize:(t,e)=>e.sync<100};function k(t){const e=function(t){switch(t.currentTask){case i.a.Idle:return["------","------","------"];case i.a.Company:return["Work for Company",t.currentTaskLocation,"------"];case i.a.Faction:{let e="";switch(t.factionWorkType){case f.a.Hacking:e="Hacking Contracts";break;case f.a.Field:e="Field Work";break;case f.a.Security:e="Security Work"}return["Work for Faction",t.currentTaskLocation,e]}case i.a.Crime:return["Commit Crime",t.crimeType,"------"];case i.a.Class:return["Take University Course",t.className,t.currentTaskLocation];case i.a.Gym:return["Workout at Gym",t.gymStatType,t.currentTaskLocation];case i.a.Bladeburner:return["Perform Bladeburner Actions",t.bbAction,t.bbContract];case i.a.Recovery:return["Shock Recovery","------","------"];case i.a.Synchro:return["Synchronize","------","------"]}}(t.sleeve),[n,o]=Object(a.useState)(e[0]),[s,l]=Object(a.useState)(e[1]),[c,h]=Object(a.useState)(e[2]),d=Object.keys(v).filter(e=>v[e](t.player,t.sleeve)),p=E[n];if(void 0===p)throw new Error(`No function for task '${n}'`);const g=p(t.player,t.sleeve),y=g.second(s);return g.first.length>0&&!g.first.includes(s)&&(l(g.first[0]),t.setABC([n,g.first[0],c])),y.length>0&&!y.includes(c)&&(h(y[0]),t.setABC([n,s,y[0]])),r.a.createElement(r.a.Fragment,null,r.a.createElement(u.a,{onChange:function(e){var a;const r=e.target.value,i=E[r];if(void 0===i)throw new Error(`No function for task '${n}'`);const s=i(t.player,t.sleeve),c=null!==(a=s.second(s.first[0]))&&void 0!==a?a:["------"];h(c[0]),l(s.first[0]),o(r),t.setABC([r,s.first[0],c[0]])},value:n,sx:{width:"100%"}},d.map(t=>r.a.createElement(m.a,{key:t,value:t},t))),!(1===g.first.length&&"------"===g.first[0])&&r.a.createElement(r.a.Fragment,null,r.a.createElement(u.a,{onChange:function(e){l(e.target.value),t.setABC([n,e.target.value,c])},value:s,sx:{width:"100%"}},g.first.map(t=>r.a.createElement(m.a,{key:t,value:t},t)))),!(1===y.length&&"------"===y[0])&&r.a.createElement(r.a.Fragment,null,r.a.createElement(u.a,{onChange:function(e){h(e.target.value),t.setABC([n,s,e.target.value])},value:c,sx:{width:"100%"}},y.map(t=>r.a.createElement(m.a,{key:t,value:t},t)))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var a=n(0),r=n.n(a),i=n(10),o=n(20),s=n(465),l=n(15),c=n(6),f=n(14),u=n(29),m=n(38),h=n(1),d=n(8);function p(t){const e=u.b.Player();function n(n){e.canAfford(i.a.TravelCost)||Object(f.a)("You cannot afford to have this sleeve travel to another city"),t.sleeve.city=n,e.loseMoney(i.a.TravelCost,"sleeve"),t.sleeve.resetTaskStatus(e),t.rerender(),t.onClose()}return r.a.createElement(m.a,{open:t.open,onClose:t.onClose},r.a.createElement(r.a.Fragment,null,r.a.createElement(h.a,null,"Have this sleeve travel to a different city. This affects the gyms and universities at which this sleeve can study. Traveling to a different city costs ",r.a.createElement(o.a,{money:i.a.TravelCost,player:e}),". It will also set your current sleeve task to idle."),c.a.DisableASCIIArt?Object.values(l.a).map(t=>r.a.createElement(d.a,{key:t,onClick:()=>n(t)},t)):r.a.createElement(s.a,{currentCity:t.sleeve.city,onTravel:t=>n(t)})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(0),r=n.n(a),i=n(38),o=n(1),s=n(4);function l({open:t,onClose:e}){return r.a.createElement(i.a,{open:t,onClose:e},r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,{variant:"h4"},"How do Duplicate Sleeves work?"),r.a.createElement("br",null),r.a.createElement(o.a,null,"Duplicate Sleeves are essentially clones. You can use them to perform any work type action, such as working for a company/faction or committing a crime. Having sleeves perform these tasks earns you money, experience, and reputation."),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(o.a,null,"Sleeves are their own individuals, which means they each have their own experience and stats."),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(o.a,null,"When a sleeve earns experience, it earns experience for itself, the player's original 'consciousness', as well as all of the player's other sleeves."),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(o.a,{variant:"h4"},"What is Synchronization (Sync)?"),r.a.createElement("br",null),r.a.createElement(o.a,null,"Synchronization is a measure of how aligned your consciousness is with that of your Duplicate Sleeves. It is a numerical value between 1 and 100, and it affects how much experience is earned when the sleeve is performing a task."),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(o.a,null,"Let N be the sleeve's synchronization. When the sleeve earns experience by performing a task, both the sleeve and the player's original host consciousness earn N% of the amount of experience normally earned by the task. All of the player's other sleeves earn ((N/100)^2 * 100)% of the experience."),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(o.a,null,"Synchronization can be increased by assigning sleeves to the 'Synchronize' task."),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(o.a,{variant:"h4"},"What is Shock?"),r.a.createElement("br",null),r.a.createElement(o.a,null,"Sleeve shock is a measure of how much trauma the sleeve has due to being placed in a new body. It is a numerical value between 0 and 99, where 99 indicates full shock and 0 indicates no shock. Shock affects the amount of experience earned by the sleeve."),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(o.a,null,"Sleeve shock slowly decreases over time. You can further increase the rate at which it decreases by assigning sleeves to the 'Shock Recovery' task."),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(o.a,{variant:"h4"},"Why can't I work for this company or faction?"),r.a.createElement("br",null),r.a.createElement(o.a,null,"Only one of your sleeves can work for a given company/faction a time. To clarify further, if you have two sleeves they can work for two different companies, but they cannot both work for the same company."),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(o.a,{variant:"h4"},"Why did my Sleeve stop working?"),r.a.createElement("br",null),r.a.createElement(o.a,null,"Sleeves are subject to the same time restrictions as you. This means that they automatically stop working at a company after 8 hours, and stop working for a faction after 20 hours."),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(o.a,{variant:"h4"},"How do I buy Augmentations for my Sleeves?"),r.a.createElement("br",null),r.a.createElement(o.a,null,"Your Sleeve needs to have a Shock of 0 in order for you to buy Augmentations for it."),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(o.a,{variant:"h4"},"Why can't I buy the X Augmentation for my sleeve?"),r.a.createElement("br",null),r.a.createElement(o.a,null,"Certain Augmentations, like ",s.a.Bladeburners,"-specific ones and NeuroFlux Governor, are not available for sleeves."),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(o.a,{variant:"h4"},"Do sleeves get reset when installing Augmentations or switching BitNodes?"),r.a.createElement("br",null),r.a.createElement(o.a,null,"Sleeves are reset when switching BitNodes, but not when installing Augmentations."),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(o.a,{variant:"h4"},"What is Memory?"),r.a.createElement("br",null),r.a.createElement(o.a,null,"Sleeve memory dictates what a sleeve's synchronization will be when its reset by switching BitNodes. For example, if a sleeve has a memory of 25, then when you switch BitNodes its synchronization will initially be set to 25, rather than 1."),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(o.a,null,"Memory can only be increased by purchasing upgrades from ",s.a.TheCovenant,". It is a persistent stat, meaning it never gets resets back to 1. The maximum possible value for a sleeve's memory is 100.")))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return k}));var a=n(0),r=n.n(a),i=n(1296),o=n(1297),s=n(1298),l=n(223),c=n(92),f=n(1299),u=n(1301),m=n(1302),h=n(1303),d=n(41),p=n(56),g=n(24),y=n(1),b=n(278),E=n(8),v=n(19);function k(t){const[e,n]=Object(a.useState)(!1),k=Object(a.useState)(!1)[1];function _(){k(t=>!t)}const[w,S]=Object(a.useState)(d.c.x1);Object(a.useEffect)(()=>{const t=setInterval(_,200);return()=>clearInterval(t)},[]);let x,C=0;for(let e=0;eS(d.c.x1),()=>S(d.c.x5),()=>S(d.c.x10),()=>S(d.c.MAX)],O=t.player.hacknetNodes.map(e=>{if(Object(p.g)(t.player)){if(e instanceof l.a)throw new Error("node was hacknet node");const n=Object(g.d)(e);if(null==n)throw new Error("Could not find Hacknet Server object in AllServers map for IP: "+e);if(!(n instanceof c.a))throw new Error("node was not hacknet server");return r.a.createElement(s.a,{player:t.player,key:n.hostname,node:n,purchaseMultiplier:w,rerender:_})}if("string"==typeof e)throw new Error("node was ip string");return r.a.createElement(o.a,{player:t.player,key:e.name,node:e,purchaseMultiplier:w,rerender:_})});return r.a.createElement(r.a.Fragment,null,r.a.createElement(y.a,{variant:"h4"},"Hacknet ",Object(p.g)(t.player)?"Servers":"Nodes"),r.a.createElement(i.a,{hasHacknetServers:Object(p.g)(t.player)}),r.a.createElement(h.a,{cost:x,multiplier:w,onClick:function(){Object(p.l)(t.player),_()}}),r.a.createElement("br",null),r.a.createElement(b.a,{container:!0,spacing:2},r.a.createElement(b.a,{item:!0,xs:6},r.a.createElement(m.a,{totalProduction:C,player:t.player})),r.a.createElement(b.a,{item:!0,xs:6},r.a.createElement(u.a,{onClicks:L,purchaseMultiplier:w}))),Object(p.g)(t.player)&&r.a.createElement(E.a,{onClick:()=>n(!0)},"Spend Hashes on Upgrades"),r.a.createElement(v.a,{sx:{display:"grid",width:"fit-content",gridTemplateColumns:"repeat(3, 1fr)"}},O),r.a.createElement(f.a,{open:e,onClose:()=>n(!1)}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var a=n(0),r=n.n(a),i=n(1);function o(t){return r.a.createElement(r.a.Fragment,null,r.a.createElement(i.a,null,"The Hacknet is a global, decentralized network of machines. It is used by hackers all around the world to anonymously share computing power and perform distributed cyberattacks without the fear of being traced."),t.hasHacknetServers?r.a.createElement(r.a.Fragment,null,r.a.createElement(i.a,null,"Here, you can purchase a Hacknet Server, an upgraded version of the Hacknet Node. Hacknet Servers will perform computations and operations on the network, earning you hashes. Hashes can be spent on a variety of different upgrades."),r.a.createElement(i.a,null,"Hacknet Servers can also be used as servers to run scripts. However, running scripts on a server will reduce its hash rate (hashes generated per second). A Hacknet Server's hash rate will be reduced by the percentage of RAM that is being used by that Server to run scripts.")):r.a.createElement(r.a.Fragment,null,r.a.createElement(i.a,null,"Here, you can purchase a Hacknet Node, a specialized machine that can connect and contribute its resources to the Hacknet network. This allows you to take a small percentage of profits from hacks performed on the network. Essentially, you are renting out your Node's computing power."),r.a.createElement(i.a,null,"Each Hacknet Node you purchase will passively earn you money. Each Hacknet Node can be upgraded in order to increase its computing power and thereby increase the profit you earn from it.")))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return v}));var a=n(0),r=n.n(a),i=n(41),o=n(56),s=n(20),l=n(112),c=n(1),f=n(278),u=n(45),m=n(8),h=n(78),d=n(149),p=n(148),g=n(50),y=n(21),b=n(5),E=n(211);function v(t){const e=t.node,n=t.purchaseMultiplier,a=t.rerender;let v,k,_;if(e.level>=i.a.MaxLevel)v=r.a.createElement(m.a,{disabled:!0},"MAX LEVEL");else{let f=0;if("MAX"===n)f=Object(o.e)(t.player,e,i.a.MaxLevel);else{const t=i.a.MaxLevel-e.level;f=Math.min(t,n)}const u=Object(E.c)(e.level+f,e.ram,e.cores,t.player.hacknet_node_money_mult)-e.moneyGainRatePerSecond,h=e.calculateLevelUpgradeCost(f,t.player.hacknet_node_level_cost_mult);v=r.a.createElement(y.a,{title:r.a.createElement(c.a,null,"+",r.a.createElement(l.a,{money:u}))},r.a.createElement(m.a,{onClick:function(){const r="MAX"===n?Object(o.e)(t.player,e,i.a.MaxLevel):n;Object(o.n)(t.player,e,r),a()}},"+",f," - ",r.a.createElement(s.a,{money:h,player:t.player})))}if(e.ram>=i.a.MaxRam)k=r.a.createElement(m.a,{disabled:!0},"MAX RAM");else{let f=0;if("MAX"===n)f=Object(o.f)(t.player,e,i.a.MaxRam);else{const t=Math.round(Math.log2(i.a.MaxRam/e.ram));f=Math.min(t,n)}const u=Object(E.c)(e.level,e.ram*Math.pow(2,f),e.cores,t.player.hacknet_node_money_mult)-e.moneyGainRatePerSecond,h=e.calculateRamUpgradeCost(f,t.player.hacknet_node_ram_cost_mult);k=r.a.createElement(y.a,{title:r.a.createElement(c.a,null,"+",r.a.createElement(l.a,{money:u}))},r.a.createElement(m.a,{onClick:function(){const r="MAX"===n?Object(o.f)(t.player,e,i.a.MaxRam):n;Object(o.o)(t.player,e,r),a()}},"+",f," - ",r.a.createElement(s.a,{money:h,player:t.player})))}if(e.cores>=i.a.MaxCores)_=r.a.createElement(m.a,{disabled:!0},"MAX CORES");else{let f=0;if("MAX"===n)f=Object(o.d)(t.player,e,i.a.MaxCores);else{const t=i.a.MaxCores-e.cores;f=Math.min(t,n)}const u=Object(E.c)(e.level,e.ram,e.cores+f,t.player.hacknet_node_money_mult)-e.moneyGainRatePerSecond,h=e.calculateCoreUpgradeCost(f,t.player.hacknet_node_core_cost_mult);_=r.a.createElement(y.a,{title:r.a.createElement(c.a,null,"+",r.a.createElement(l.a,{money:u}))},r.a.createElement(m.a,{onClick:function(){const r="MAX"===n?Object(o.d)(t.player,e,i.a.MaxCores):n;Object(o.k)(t.player,e,r),a()}},"+",f," - ",r.a.createElement(s.a,{money:h,player:t.player})))}return r.a.createElement(f.a,{item:!0,component:u.a,p:1},r.a.createElement(p.a,{size:"small"},r.a.createElement(d.a,null,r.a.createElement(g.a,null,r.a.createElement(h.b,{colSpan:3},r.a.createElement(c.a,null,e.name))),r.a.createElement(g.a,null,r.a.createElement(h.b,null,r.a.createElement(c.a,null,"Production:")),r.a.createElement(h.b,{colSpan:2},r.a.createElement(c.a,null,r.a.createElement(s.a,{money:e.totalMoneyGenerated})," (",r.a.createElement(l.a,{money:e.moneyGainRatePerSecond}),")"))),r.a.createElement(g.a,null,r.a.createElement(h.b,null,r.a.createElement(c.a,null,"Level:")),r.a.createElement(h.b,null,r.a.createElement(c.a,null,e.level)),r.a.createElement(h.b,null,v)),r.a.createElement(g.a,null,r.a.createElement(h.b,null,r.a.createElement(c.a,null,"RAM:")),r.a.createElement(h.b,null,r.a.createElement(c.a,null,b.a.formatRAM(e.ram))),r.a.createElement(h.b,null,k)),r.a.createElement(g.a,null,r.a.createElement(h.b,null,r.a.createElement(c.a,null,"Cores:")),r.a.createElement(h.b,null,r.a.createElement(c.a,null,e.cores)),r.a.createElement(h.b,null,_)))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return k}));var a=n(0),r=n.n(a),i=n(41),o=n(56),s=n(20),l=n(222),c=n(289),f=n(1),u=n(278),m=n(45),h=n(8),d=n(78),p=n(149),g=n(148),y=n(50),b=n(5),E=n(156),v=n(21);function k(t){const e=t.node,n=t.purchaseMultiplier,a=t.rerender;let k,_,w,S;if(e.level>=i.b.MaxLevel)k=r.a.createElement(h.a,{disabled:!0},"MAX LEVEL");else{let l=0;if("MAX"===n)l=Object(o.e)(t.player,e,i.b.MaxLevel);else{const t=i.b.MaxLevel-e.level;l=Math.min(t,n)}const u=Object(E.c)(e.level+l,0,e.maxRam,e.cores,t.player.hacknet_node_money_mult)-Object(E.c)(e.level,0,e.maxRam,e.cores,t.player.hacknet_node_money_mult),m=u*(e.maxRam-e.ramUsed)/e.maxRam,d=e.calculateLevelUpgradeCost(l,t.player.hacknet_node_level_cost_mult);k=r.a.createElement(v.a,{title:r.a.createElement(f.a,null,"+",r.a.createElement(c.a,{hashes:m})," (effective increase, taking current RAM usage into account)",r.a.createElement("br",null),r.a.createElement("span",{style:{opacity:.5}},"+",r.a.createElement(c.a,{hashes:u}))," ","(base increase, attained when no script is running)")},r.a.createElement(h.a,{onClick:function(){let r=n;"MAX"===n&&(r=Object(o.e)(t.player,e,i.b.MaxLevel));Object(o.n)(t.player,e,r),a()}},"+",l," - ",r.a.createElement(s.a,{money:d,player:t.player})))}if(e.maxRam>=i.b.MaxRam)_=r.a.createElement(h.a,{disabled:!0},"MAX RAM");else{let l=0;if("MAX"===n)l=Object(o.f)(t.player,e,i.b.MaxRam);else{const t=Math.round(Math.log2(i.b.MaxRam/e.maxRam));l=Math.min(t,n)}const u=Object(E.c)(e.level,0,e.maxRam*Math.pow(2,l),e.cores,t.player.hacknet_node_money_mult)-Object(E.c)(e.level,0,e.maxRam,e.cores,t.player.hacknet_node_money_mult),m=Object(E.c)(e.level,e.ramUsed,e.maxRam*Math.pow(2,l),e.cores,t.player.hacknet_node_money_mult)-Object(E.c)(e.level,e.ramUsed,e.maxRam,e.cores,t.player.hacknet_node_money_mult),d=e.calculateRamUpgradeCost(l,t.player.hacknet_node_ram_cost_mult);_=r.a.createElement(v.a,{title:r.a.createElement(f.a,null,"+",r.a.createElement(c.a,{hashes:m})," (effective increase, taking current RAM usage into account)",r.a.createElement("br",null),r.a.createElement("span",{style:{opacity:.5}},"+",r.a.createElement(c.a,{hashes:u}))," ","(base increase, attained when no script is running)")},r.a.createElement(h.a,{onClick:function(){let r=n;"MAX"===n&&(r=Object(o.f)(t.player,e,i.b.MaxRam)),Object(o.o)(t.player,e,r),a()}},"+",l," - ",r.a.createElement(s.a,{money:d,player:t.player})))}if(e.cores>=i.b.MaxCores)w=r.a.createElement(h.a,{disabled:!0},"MAX CORES");else{let l=0;if("MAX"===n)l=Object(o.d)(t.player,e,i.b.MaxCores);else{const t=i.b.MaxCores-e.cores;l=Math.min(t,n)}const u=Object(E.c)(e.level,0,e.maxRam,e.cores+l,t.player.hacknet_node_money_mult)-Object(E.c)(e.level,0,e.maxRam,e.cores,t.player.hacknet_node_money_mult),m=u*(e.maxRam-e.ramUsed)/e.maxRam,d=e.calculateCoreUpgradeCost(l,t.player.hacknet_node_core_cost_mult);w=r.a.createElement(v.a,{title:r.a.createElement(f.a,null,"+",r.a.createElement(c.a,{hashes:m})," (effective increase, taking current RAM usage into account)",r.a.createElement("br",null),r.a.createElement("span",{style:{opacity:.5}},"+",r.a.createElement(c.a,{hashes:u}))," ","(base increase, attained when no script is running)")},r.a.createElement(h.a,{onClick:function(){let r=n;"MAX"===n&&(r=Object(o.d)(t.player,e,i.b.MaxCores)),Object(o.k)(t.player,e,r),a()}},"+",l," - ",r.a.createElement(s.a,{money:d,player:t.player})))}if(e.cache>=i.b.MaxCache)S=r.a.createElement(h.a,{disabled:!0},"MAX CACHE");else{let c=0;if("MAX"===n)c=Object(o.c)(t.player,e,i.b.MaxCache);else{const t=i.b.MaxCache-e.cache;c=Math.min(t,n)}const u=32*Math.pow(2,e.cache+c)-e.hashCapacity,m=e.calculateCacheUpgradeCost(c);S=r.a.createElement(v.a,{title:r.a.createElement(f.a,null,"+",r.a.createElement(l.a,{hashes:u})," hashes")},r.a.createElement(h.a,{onClick:function(){let r=n;"MAX"===n&&(r=Object(o.c)(t.player,e,i.b.MaxCache));Object(o.j)(t.player,e,r),a(),Object(o.p)(t.player)}},"+",c," - ",r.a.createElement(s.a,{money:m,player:t.player}))),t.player.money}return r.a.createElement(u.a,{item:!0,component:m.a,p:1},r.a.createElement(g.a,{size:"small"},r.a.createElement(p.a,null,r.a.createElement(y.a,null,r.a.createElement(d.b,null,r.a.createElement(f.a,null,e.hostname))),r.a.createElement(y.a,null,r.a.createElement(d.b,null,r.a.createElement(f.a,null,"Production:")),r.a.createElement(d.b,{colSpan:2},r.a.createElement(v.a,{title:r.a.createElement(f.a,null,r.a.createElement(l.a,{hashes:e.totalHashesGenerated})," hashes produced by this server since last augment installation.",r.a.createElement("br",null),r.a.createElement(c.a,{hashes:e.hashRate})," current production rate.",r.a.createElement("br",null),r.a.createElement("span",{style:{opacity:.5}},r.a.createElement(c.a,{hashes:e.hashRate*e.maxRam/(e.maxRam-e.ramUsed)}))," ","max production rate. (achieved when 100% RAM is allocated to it)",r.a.createElement("br",null),b.a.formatRAM(e.ramUsed)," / ",b.a.formatRAM(e.maxRam)," (",Math.round(100*e.ramUsed/e.maxRam),"%) RAM allocated to script.",r.a.createElement("br",null),b.a.formatRAM(e.maxRam-e.ramUsed)," / ",b.a.formatRAM(e.maxRam)," (",Math.round(100*(e.maxRam-e.ramUsed)/e.maxRam),"%) RAM allocated to hash production.")},r.a.createElement(f.a,null,r.a.createElement(l.a,{hashes:e.totalHashesGenerated})," (",r.a.createElement(c.a,{hashes:e.hashRate}),")")))),r.a.createElement(y.a,null,r.a.createElement(d.b,null,r.a.createElement(f.a,null,"Hash Capacity:")),r.a.createElement(d.b,{colSpan:2},r.a.createElement(f.a,null,r.a.createElement(l.a,{hashes:e.hashCapacity})))),r.a.createElement(y.a,null,r.a.createElement(d.b,null,r.a.createElement(f.a,null,"Level:")),r.a.createElement(d.b,null,r.a.createElement(f.a,null,e.level)),r.a.createElement(d.b,null,k)),r.a.createElement(y.a,null,r.a.createElement(d.b,null,r.a.createElement(f.a,null,"RAM:")),r.a.createElement(d.b,null,r.a.createElement(f.a,null,b.a.formatRAM(e.maxRam))),r.a.createElement(d.b,null,_)),r.a.createElement(y.a,null,r.a.createElement(d.b,null,r.a.createElement(f.a,null,"Cores:")),r.a.createElement(d.b,null,r.a.createElement(f.a,null,e.cores)),r.a.createElement(d.b,null,w)),r.a.createElement(y.a,null,r.a.createElement(d.b,null,r.a.createElement(f.a,null,"Cache Level:")),r.a.createElement(d.b,null,r.a.createElement(f.a,null,e.cache)),r.a.createElement(d.b,null,S)))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var a=n(0),r=n.n(a),i=n(377),o=n(241),s=n(222),l=n(1300),c=n(38),f=n(29),u=n(1);function m(t){const e=f.b.Player(),n=Object(a.useState)(!1)[1];function m(){n(t=>!t)}Object(a.useEffect)(()=>{const t=setInterval(()=>n(t=>!t),200);return()=>clearInterval(t)},[]);const h=e.hashManager;if(!(h instanceof i.a))throw new Error("Player does not have a HashManager)");return r.a.createElement(c.a,{open:t.open,onClose:t.onClose},r.a.createElement(r.a.Fragment,null,r.a.createElement(u.a,null,"Spend your hashes on a variety of different upgrades"),r.a.createElement(u.a,null,"Hashes: ",r.a.createElement(s.a,{hashes:e.hashManager.hashes})),Object.keys(o.a).map(t=>{const n=o.a[t];return r.a.createElement(l.a,{player:e,upg:n,hashManager:h,key:n.name,rerender:m})})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var a=n(0),r=n.n(a),i=n(56),o=n(783),s=n(14),l=n(166),c=n(222),f=n(1),u=n(45),m=n(8),h=n(4);const d={};function p(t){const[e,n]=Object(a.useState)(d[t.upg.name]?d[t.upg.name]:h.a.ECorp.toLowerCase());function p(){if(t.hashManager.hashes>=t.hashManager.getUpgradeCost(t.upg.name)){Object(i.m)(t.player,t.upg.name,e)||Object(s.a)("Failed to purchase upgrade. This may be because you do not have enough hashes, or because you do not have access to the feature upgrade affects."),t.rerender()}}const g=t.hashManager,y=t.upg,b=g.getUpgradeCost(y.name),E=g.upgrades[y.name],v=y.effectText(E),k=g.hashes>=b;return r.a.createElement(u.a,{sx:{p:1}},r.a.createElement(f.a,null,r.a.createElement(l.a,{value:y.name})),r.a.createElement(f.a,null,"Cost: ",r.a.createElement(c.a,{hashes:b}),", Bought: ",E," times"),r.a.createElement(f.a,null,y.desc),!y.hasTargetServer&&r.a.createElement(m.a,{onClick:p,disabled:!k},"Buy"),y.hasTargetServer&&r.a.createElement(o.a,{purchase:p,canPurchase:k,value:e,serverType:o.b.Foreign,onChange:function(e){n(e.target.value),d[t.upg.name]=e.target.value}}),E>0&&v&&r.a.createElement(f.a,null,v))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(0),r=n.n(a),i=n(41),o=n(8);function s(){return(s=Object.assign||function(t){for(var e=1;ee.specialName===t.name),x=Object(b.d)(S?S.hostname:""),C=null!==x&&Object(y.b)(x);return a.createElement(a.Fragment,null,a.createElement(i.a,{onClick:()=>e.toCity()},"Return to World"),a.createElement(r.a,{variant:"h4",sx:{mt:1}},C&&!g.a.DisableTextEffects?a.createElement(_.a,{title:`Backdoor installed on ${t.name}.`},a.createElement("span",null,a.createElement(E.a,{content:t.name}))):t.name),w)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return E}));var a=n(0),r=n.n(a),i=n(1),o=n(8),s=n(21),l=n(19),c=n(291),f=n(186),u=n(67),m=n(368),h=n(95),d=n(31),p=n(128),g=n(324),y=n(29),b=n(1307);function E(t){const e=y.b.Player(),n=y.b.Router(),[E,v]=Object(a.useState)(!1),k=Object(a.useState)(!1)[1];function _(){k(t=>!t)}Object(a.useEffect)(()=>{const t=setInterval(_,200);return()=>clearInterval(t)},[]);const w=u.a[t.locName];if(null==w)throw new Error("CompanyLocation component constructed with invalid company: "+t.locName);const S=f.a[t.locName];if(null==S)throw new Error("CompanyLocation component constructed with invalid location: "+t.locName);const x=e.jobs[t.locName]?e.jobs[t.locName]:null,C=x?h.a[x]:null;e.location=t.locName;const L=null!=x,O=w.getFavorGain();return r.a.createElement(r.a.Fragment,null,L&&r.a.createElement(r.a.Fragment,null,r.a.createElement(i.a,null,"Job Title: ",x),r.a.createElement(i.a,null,"-------------------------"),r.a.createElement(l.a,{display:"flex"},r.a.createElement(s.a,{title:r.a.createElement(r.a.Fragment,null,"You will have ",r.a.createElement(g.a,{favor:w.favor+O})," company favor upon resetting after installing Augmentations")},r.a.createElement(i.a,null,"Company reputation: ",r.a.createElement(p.a,{reputation:w.playerReputation})))),r.a.createElement(i.a,null,"-------------------------"),r.a.createElement(l.a,{display:"flex"},r.a.createElement(s.a,{title:r.a.createElement(r.a.Fragment,null,"Company favor increases the rate at which you earn reputation for this company by 1% per favor. Company favor is gained whenever you reset after installing Augmentations. The amount of favor you gain depends on how much reputation you have with the company.")},r.a.createElement(i.a,null,"Company Favor: ",r.a.createElement(g.a,{favor:w.favor})))),r.a.createElement(i.a,null,"-------------------------"),r.a.createElement("br",null)),r.a.createElement(l.a,{sx:{display:"grid",width:"fit-content"}},L&&r.a.createElement(l.a,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr"}},r.a.createElement(o.a,{onClick:function(a){if(!a.isTrusted)return;const r=C;r instanceof m.a&&(r.isPartTimeJob()||r.isSoftwareConsultantJob()||r.isBusinessConsultantJob()?e.startWorkPartTime(t.locName):e.startWork(t.locName),e.startFocusing(),n.toWork())}},"Work"),r.a.createElement(o.a,{onClick:()=>v(!0)},"Quit"),r.a.createElement(b.a,{locName:t.locName,company:w,onQuit:_,open:E,onClose:()=>v(!1)})),w.hasAgentPositions()&&r.a.createElement(c.a,{company:w,entryPosType:h.a[d.a[0]],onClick:function(t){t.isTrusted&&(e.applyForAgentJob(),_())},text:"Apply for Agent Job"}),w.hasBusinessConsultantPositions()&&r.a.createElement(c.a,{company:w,entryPosType:h.a[d.c[0]],onClick:function(t){t.isTrusted&&(e.applyForBusinessConsultantJob(),_())},text:"Apply for Business Consultant Job"}),w.hasBusinessPositions()&&r.a.createElement(c.a,{company:w,entryPosType:h.a[d.b[0]],onClick:function(t){t.isTrusted&&(e.applyForBusinessJob(),_())},text:"Apply for Business Job"}),w.hasEmployeePositions()&&r.a.createElement(c.a,{company:w,entryPosType:h.a[d.e[1]],onClick:function(t){t.isTrusted&&(e.applyForEmployeeJob(),_())},text:"Apply to be an Employee"}),w.hasEmployeePositions()&&r.a.createElement(c.a,{company:w,entryPosType:h.a[d.g[1]],onClick:function(t){t.isTrusted&&(e.applyForPartTimeEmployeeJob(),_())},text:"Apply to be a part-time Employee"}),w.hasITPositions()&&r.a.createElement(c.a,{company:w,entryPosType:h.a[d.d[0]],onClick:function(t){t.isTrusted&&(e.applyForItJob(),_())},text:"Apply for IT Job"}),w.hasSecurityPositions()&&r.a.createElement(c.a,{company:w,entryPosType:h.a[d.h[2]],onClick:function(t){t.isTrusted&&(e.applyForSecurityJob(),_())},text:"Apply for Security Job"}),w.hasSoftwareConsultantPositions()&&r.a.createElement(c.a,{company:w,entryPosType:h.a[d.k[0]],onClick:function(t){t.isTrusted&&(e.applyForSoftwareConsultantJob(),_())},text:"Apply for Software Consultant Job"}),w.hasSoftwarePositions()&&r.a.createElement(c.a,{company:w,entryPosType:h.a[d.j[0]],onClick:function(t){t.isTrusted&&(e.applyForSoftwareJob(),_())},text:"Apply for Software Job"}),w.hasWaiterPositions()&&r.a.createElement(c.a,{company:w,entryPosType:h.a[d.e[0]],onClick:function(t){t.isTrusted&&(e.applyForWaiterJob(),_())},text:"Apply to be a Waiter"}),w.hasWaiterPositions()&&r.a.createElement(c.a,{company:w,entryPosType:h.a[d.g[0]],onClick:function(t){t.isTrusted&&(e.applyForPartTimeWaiterJob(),_())},text:"Apply to be a part-time Waiter"}),null!=S.infiltrationData&&r.a.createElement(o.a,{onClick:function(e){if(!e.isTrusted)return;const a=S;if(!a.infiltrationData)throw new Error(`trying to start infiltration at ${t.locName} but the infiltrationData is null`);n.toInfiltration(a)}},"Infiltrate Company")))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(31);const r=[{name:a.j[0],nextPosition:a.j[1],baseSalary:33,charismaEffectiveness:15,charismaExpGain:.02,hackingEffectiveness:85,hackingExpGain:.05,reqdHacking:1,repMultiplier:.9},{name:a.j[1],nextPosition:a.j[2],baseSalary:80,charismaEffectiveness:15,charismaExpGain:.05,hackingEffectiveness:85,hackingExpGain:.1,reqdHacking:51,reqdReputation:8e3,repMultiplier:1.1},{name:a.j[2],nextPosition:a.j[3],baseSalary:165,charismaEffectiveness:20,charismaExpGain:.08,hackingEffectiveness:80,hackingExpGain:.4,reqdCharisma:51,reqdHacking:251,reqdReputation:4e4,repMultiplier:1.3},{name:a.j[3],nextPosition:a.j[4],baseSalary:500,charismaEffectiveness:25,charismaExpGain:.1,hackingEffectiveness:75,hackingExpGain:.8,reqdCharisma:151,reqdHacking:401,reqdReputation:2e5,repMultiplier:1.5},{name:a.j[4],nextPosition:a.j[5],baseSalary:800,charismaEffectiveness:25,charismaExpGain:.5,hackingEffectiveness:75,hackingExpGain:1,reqdCharisma:251,reqdHacking:501,reqdReputation:4e5,repMultiplier:1.6},{name:a.j[5],nextPosition:a.j[6],baseSalary:1650,charismaEffectiveness:25,charismaExpGain:.5,hackingEffectiveness:75,hackingExpGain:1.1,reqdCharisma:251,reqdHacking:501,reqdReputation:8e5,repMultiplier:1.6},{name:a.j[6],nextPosition:a.j[7],baseSalary:2310,charismaEffectiveness:30,charismaExpGain:.6,hackingEffectiveness:70,hackingExpGain:1.2,reqdCharisma:401,reqdHacking:601,reqdReputation:16e5,repMultiplier:1.75},{name:a.j[7],nextPosition:null,baseSalary:2640,charismaEffectiveness:35,charismaExpGain:1,hackingEffectiveness:65,hackingExpGain:1.5,reqdCharisma:501,reqdHacking:751,reqdReputation:32e5,repMultiplier:2},{name:a.d[0],nextPosition:a.d[1],baseSalary:26,charismaEffectiveness:10,charismaExpGain:.01,hackingEffectiveness:90,hackingExpGain:.04,reqdHacking:1,repMultiplier:.9},{name:a.d[1],nextPosition:a.d[2],baseSalary:66,charismaEffectiveness:15,charismaExpGain:.02,hackingEffectiveness:85,hackingExpGain:.08,reqdHacking:26,reqdReputation:7e3,repMultiplier:1.1},{name:a.d[2],nextPosition:a.d[3],baseSalary:132,charismaEffectiveness:20,charismaExpGain:.1,hackingEffectiveness:80,hackingExpGain:.3,reqdCharisma:51,reqdHacking:151,reqdReputation:35e3,repMultiplier:1.3},{name:a.d[3],nextPosition:a.j[5],baseSalary:410,charismaEffectiveness:20,charismaExpGain:.2,hackingEffectiveness:80,hackingExpGain:.5,reqdCharisma:76,reqdHacking:251,reqdReputation:175e3,repMultiplier:1.4},{name:a.i[0],nextPosition:a.j[5],baseSalary:121,charismaEffectiveness:15,charismaExpGain:.05,hackingEffectiveness:85,hackingExpGain:.4,reqdCharisma:26,reqdHacking:151,reqdReputation:35e3,repMultiplier:1.2},{name:a.f[0],nextPosition:a.f[1],baseSalary:121,charismaEffectiveness:15,charismaExpGain:.05,hackingEffectiveness:85,hackingExpGain:.4,reqdCharisma:26,reqdHacking:151,reqdReputation:35e3,repMultiplier:1.2},{name:a.f[1],nextPosition:a.j[5],baseSalary:410,charismaEffectiveness:20,charismaExpGain:.1,hackingEffectiveness:80,hackingExpGain:.5,reqdCharisma:76,reqdHacking:251,reqdReputation:175e3,repMultiplier:1.3},{name:a.b[0],nextPosition:a.b[1],baseSalary:46,charismaEffectiveness:90,charismaExpGain:.08,hackingEffectiveness:10,hackingExpGain:.01,reqdCharisma:1,reqdHacking:1,repMultiplier:.9},{name:a.b[1],nextPosition:a.b[2],baseSalary:100,charismaEffectiveness:85,charismaExpGain:.15,hackingEffectiveness:15,hackingExpGain:.02,reqdCharisma:51,reqdHacking:6,reqdReputation:8e3,repMultiplier:1.1},{name:a.b[2],nextPosition:a.b[3],baseSalary:200,charismaEffectiveness:85,charismaExpGain:.3,hackingEffectiveness:15,hackingExpGain:.02,reqdCharisma:101,reqdHacking:51,reqdReputation:4e4,repMultiplier:1.3},{name:a.b[3],nextPosition:a.b[4],baseSalary:660,charismaEffectiveness:85,charismaExpGain:.4,hackingEffectiveness:15,hackingExpGain:.02,reqdCharisma:226,reqdHacking:51,reqdReputation:2e5,repMultiplier:1.5},{name:a.b[4],nextPosition:a.b[5],baseSalary:1950,charismaEffectiveness:90,charismaExpGain:1,hackingEffectiveness:10,hackingExpGain:.05,reqdCharisma:501,reqdHacking:76,reqdReputation:8e5,repMultiplier:1.6},{name:a.b[5],nextPosition:null,baseSalary:3900,charismaEffectiveness:90,charismaExpGain:1.5,hackingEffectiveness:10,hackingExpGain:.05,reqdCharisma:751,reqdHacking:101,reqdReputation:32e5,repMultiplier:1.75},{name:a.h[0],nextPosition:a.h[1],baseSalary:82,hackingEffectiveness:5,strengthEffectiveness:20,defenseEffectiveness:20,dexterityEffectiveness:20,agilityEffectiveness:20,charismaEffectiveness:15,hackingExpGain:.02,strengthExpGain:.08,defenseExpGain:.08,dexterityExpGain:.08,agilityExpGain:.08,charismaExpGain:.04,reqdHacking:11,reqdStrength:101,reqdDefense:101,reqdDexterity:101,reqdAgility:101,reqdCharisma:51,reqdReputation:8e3,repMultiplier:1},{name:a.h[1],nextPosition:null,baseSalary:460,hackingEffectiveness:5,strengthEffectiveness:20,defenseEffectiveness:20,dexterityEffectiveness:20,agilityEffectiveness:20,charismaEffectiveness:15,hackingExpGain:.02,strengthExpGain:.1,defenseExpGain:.1,dexterityExpGain:.1,agilityExpGain:.1,charismaExpGain:.1,reqdHacking:101,reqdStrength:301,reqdDefense:301,reqdDexterity:301,reqdAgility:301,reqdCharisma:151,reqdReputation:36e3,repMultiplier:1.25},{name:a.h[2],nextPosition:a.h[3],baseSalary:50,hackingEffectiveness:5,strengthEffectiveness:20,defenseEffectiveness:20,dexterityEffectiveness:20,agilityEffectiveness:20,charismaEffectiveness:15,hackingExpGain:.01,strengthExpGain:.04,defenseExpGain:.04,dexterityExpGain:.04,agilityExpGain:.04,charismaExpGain:.02,reqdStrength:51,reqdDefense:51,reqdDexterity:51,reqdAgility:51,reqdCharisma:1,repMultiplier:1},{name:a.h[3],nextPosition:a.h[4],baseSalary:195,hackingEffectiveness:10,strengthEffectiveness:20,defenseEffectiveness:20,dexterityEffectiveness:20,agilityEffectiveness:20,charismaEffectiveness:10,hackingExpGain:.02,strengthExpGain:.1,defenseExpGain:.1,dexterityExpGain:.1,agilityExpGain:.1,charismaExpGain:.05,reqdHacking:26,reqdStrength:151,reqdDefense:151,reqdDexterity:151,reqdAgility:151,reqdCharisma:51,reqdReputation:8e3,repMultiplier:1.1},{name:a.h[4],nextPosition:a.h[5],baseSalary:660,hackingEffectiveness:10,strengthEffectiveness:15,defenseEffectiveness:15,dexterityEffectiveness:15,agilityEffectiveness:15,charismaEffectiveness:30,hackingExpGain:.02,strengthExpGain:.12,defenseExpGain:.12,dexterityExpGain:.12,agilityExpGain:.12,charismaExpGain:.1,reqdHacking:26,reqdStrength:251,reqdDefense:251,reqdDexterity:251,reqdAgility:251,reqdCharisma:101,reqdReputation:36e3,repMultiplier:1.25},{name:a.h[5],nextPosition:null,baseSalary:1320,hackingEffectiveness:10,strengthEffectiveness:15,defenseEffectiveness:15,dexterityEffectiveness:15,agilityEffectiveness:15,charismaEffectiveness:30,hackingExpGain:.05,strengthExpGain:.15,defenseExpGain:.15,dexterityExpGain:.15,agilityExpGain:.15,charismaExpGain:.15,reqdHacking:51,reqdStrength:501,reqdDefense:501,reqdDexterity:501,reqdAgility:501,reqdCharisma:151,reqdReputation:144e3,repMultiplier:1.4},{name:a.a[0],nextPosition:a.a[1],baseSalary:330,hackingEffectiveness:10,strengthEffectiveness:15,defenseEffectiveness:15,dexterityEffectiveness:20,agilityEffectiveness:20,charismaEffectiveness:20,hackingExpGain:.04,strengthExpGain:.08,defenseExpGain:.08,dexterityExpGain:.08,agilityExpGain:.08,charismaExpGain:.05,reqdHacking:101,reqdStrength:101,reqdDefense:101,reqdDexterity:101,reqdAgility:101,reqdCharisma:101,reqdReputation:8e3,repMultiplier:1},{name:a.a[1],nextPosition:a.a[2],baseSalary:990,hackingEffectiveness:15,strengthEffectiveness:15,defenseEffectiveness:15,dexterityEffectiveness:20,agilityEffectiveness:20,charismaEffectiveness:15,hackingExpGain:.1,strengthExpGain:.15,defenseExpGain:.15,dexterityExpGain:.15,agilityExpGain:.15,charismaExpGain:.1,reqdHacking:201,reqdStrength:251,reqdDefense:251,reqdDexterity:251,reqdAgility:251,reqdCharisma:201,reqdReputation:32e3,repMultiplier:1.25},{name:a.a[2],nextPosition:null,baseSalary:2e3,hackingEffectiveness:15,strengthEffectiveness:15,defenseEffectiveness:15,dexterityEffectiveness:20,agilityEffectiveness:20,charismaEffectiveness:15,hackingExpGain:.15,strengthExpGain:.2,defenseExpGain:.2,dexterityExpGain:.2,agilityExpGain:.2,charismaExpGain:.15,reqdHacking:251,reqdStrength:501,reqdDefense:501,reqdDexterity:501,reqdAgility:501,reqdCharisma:251,reqdReputation:162e3,repMultiplier:1.5},{name:a.e[0],nextPosition:null,baseSalary:22,strengthEffectiveness:10,dexterityEffectiveness:10,agilityEffectiveness:10,charismaEffectiveness:70,strengthExpGain:.02,defenseExpGain:.02,dexterityExpGain:.02,agilityExpGain:.02,charismaExpGain:.05,repMultiplier:1},{name:a.e[1],nextPosition:null,baseSalary:22,strengthEffectiveness:10,dexterityEffectiveness:10,agilityEffectiveness:10,charismaEffectiveness:70,strengthExpGain:.02,defenseExpGain:.02,dexterityExpGain:.02,agilityExpGain:.02,charismaExpGain:.04,repMultiplier:1},{name:a.k[0],nextPosition:a.k[1],baseSalary:66,hackingEffectiveness:80,charismaEffectiveness:20,hackingExpGain:.08,charismaExpGain:.03,reqdHacking:51,repMultiplier:1},{name:a.k[1],nextPosition:null,baseSalary:132,hackingEffectiveness:75,charismaEffectiveness:25,hackingExpGain:.25,charismaExpGain:.06,reqdHacking:251,reqdCharisma:51,repMultiplier:1.2},{name:a.c[0],nextPosition:a.c[1],baseSalary:66,hackingEffectiveness:20,charismaEffectiveness:80,hackingExpGain:.015,charismaExpGain:.15,reqdHacking:6,reqdCharisma:51,repMultiplier:1},{name:a.c[1],nextPosition:null,baseSalary:525,hackingEffectiveness:15,charismaEffectiveness:85,hackingExpGain:.015,charismaExpGain:.3,reqdHacking:51,reqdCharisma:226,repMultiplier:1.2},{name:a.g[0],nextPosition:null,baseSalary:20,strengthEffectiveness:10,dexterityEffectiveness:10,agilityEffectiveness:10,charismaEffectiveness:70,strengthExpGain:.0075,defenseExpGain:.0075,dexterityExpGain:.0075,agilityExpGain:.0075,charismaExpGain:.04,repMultiplier:1},{name:a.g[1],nextPosition:null,baseSalary:20,strengthEffectiveness:10,dexterityEffectiveness:10,agilityEffectiveness:10,charismaEffectiveness:70,strengthExpGain:.0075,defenseExpGain:.0075,dexterityExpGain:.0075,agilityExpGain:.0075,charismaExpGain:.03,repMultiplier:1}]},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(0),r=n.n(a),i=n(29),o=n(38),s=n(1),l=n(8);function c(t){const e=i.b.Player();return r.a.createElement(o.a,{open:t.open,onClose:t.onClose},r.a.createElement(s.a,null," Would you like to quit your job at ",t.company.name,"?"),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(l.a,{onClick:function(){e.quitJob(t.locName),t.onQuit(),t.onClose()}},"Quit"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var a=n(0),r=n(8),i=n(10),o=n(24),s=n(20),l=n(367),c=n(19),f=n(34);function u(t){function e(){const e=l.a.find(e=>e.specialName===t.loc.name),n=Object(o.d)(e?e.hostname:"");if(null==n||!n.hasOwnProperty("backdoorInstalled"))return t.loc.costMult;const a=n.backdoorInstalled?.9:1;return t.loc.costMult*a}function n(n){const a=t.loc;t.p.startClass(e(),a.expMult,n),t.p.startFocusing(),t.router.toWork()}const u=i.a.ClassGymBaseCost*e();return a.createElement(c.a,{sx:{display:"grid",width:"fit-content"}},a.createElement(r.a,{onClick:function(){n(f.a.GymStrength)}},"Train Strength (",a.createElement(s.a,{money:u,player:t.p})," / sec)"),a.createElement(r.a,{onClick:function(){n(f.a.GymDefense)}},"Train Defense (",a.createElement(s.a,{money:u,player:t.p})," / sec)"),a.createElement(r.a,{onClick:function(){n(f.a.GymDexterity)}},"Train Dexterity (",a.createElement(s.a,{money:u,player:t.p})," / sec)"),a.createElement(r.a,{onClick:function(){n(f.a.GymAgility)}},"Train Agility (",a.createElement(s.a,{money:u,player:t.p})," / sec)"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(0),r=n(8),i=n(406),o=n(20),s=n(14);class l extends a.Component{constructor(t){super(t),this.btnStyle={display:"block"},this.getCost=this.getCost.bind(this),this.getHealed=this.getHealed.bind(this),this.state={currHp:this.props.p.hp}}getCost(){return Object(i.b)(this.props.p)}getHealed(t){if(!t.isTrusted)return;if(this.props.p.hp<0&&(this.props.p.hp=0),this.props.p.hp>=this.props.p.max_hp)return;const e=this.getCost();this.props.p.loseMoney(e,"hospitalization"),this.props.p.hp=this.props.p.max_hp,this.setState({currHp:this.props.p.hp}),Object(s.a)(a.createElement(a.Fragment,null,"You were healed to full health! The hospital billed you for ",a.createElement(o.a,{money:e})))}render(){const t=this.getCost();return a.createElement(r.a,{onClick:this.getHealed,style:this.btnStyle},"Get treatment for wounds - ",a.createElement(o.a,{money:t,player:this.props.p}))}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(0),r=n(8),i=n(21),o=n(86),s=n(5),l=n(29),c=n(19);function f(){const t=l.b.Player(),e=l.b.Router();const n=o.a.Shoplift.successRate(t),f=o.a.RobStore.successRate(t),u=o.a.Mug.successRate(t),m=o.a.Larceny.successRate(t),h=o.a.DealDrugs.successRate(t),d=o.a.BondForgery.successRate(t),p=o.a.TraffickArms.successRate(t),g=o.a.Homicide.successRate(t),y=o.a.GrandTheftAuto.successRate(t),b=o.a.Kidnap.successRate(t),E=o.a.Assassination.successRate(t),v=o.a.Heist.successRate(t);return a.createElement(c.a,{sx:{display:"grid",width:"fit-content"}},a.createElement(i.a,{title:a.createElement(a.Fragment,null,"Attempt to shoplift from a low-end retailer")},a.createElement(r.a,{onClick:function(n){n.isTrusted&&o.a.Shoplift.commit(e,t)}},"Shoplift (",s.a.formatPercentage(n)," chance of success)")),a.createElement(i.a,{title:a.createElement(a.Fragment,null,"Attempt to commit armed robbery on a high-end store")},a.createElement(r.a,{onClick:function(n){n.isTrusted&&o.a.RobStore.commit(e,t)}},"Rob store (",s.a.formatPercentage(f)," chance of success)")),a.createElement(i.a,{title:a.createElement(a.Fragment,null,"Attempt to mug a random person on the street")},a.createElement(r.a,{onClick:function(n){n.isTrusted&&o.a.Mug.commit(e,t)}},"Mug someone (",s.a.formatPercentage(u)," chance of success)")),a.createElement(i.a,{title:a.createElement(a.Fragment,null,"Attempt to rob property from someone's house")},a.createElement(r.a,{onClick:function(n){n.isTrusted&&o.a.Larceny.commit(e,t)}},"Larceny (",s.a.formatPercentage(m)," chance of success)")),a.createElement(i.a,{title:a.createElement(a.Fragment,null,"Attempt to deal drugs")},a.createElement(r.a,{onClick:function(n){n.isTrusted&&o.a.DealDrugs.commit(e,t)}},"Deal Drugs (",s.a.formatPercentage(h)," chance of success)")),a.createElement(i.a,{title:a.createElement(a.Fragment,null,"Attempt to forge corporate bonds")},a.createElement(r.a,{onClick:function(n){n.isTrusted&&o.a.BondForgery.commit(e,t)}},"Bond Forgery (",s.a.formatPercentage(d)," chance of success)")),a.createElement(i.a,{title:a.createElement(a.Fragment,null,"Attempt to smuggle illegal arms into the city")},a.createElement(r.a,{onClick:function(n){n.isTrusted&&o.a.TraffickArms.commit(e,t)}},"Traffick illegal Arms (",s.a.formatPercentage(p)," chance of success)")),a.createElement(i.a,{title:a.createElement(a.Fragment,null,"Attempt to murder a random person on the street")},a.createElement(r.a,{onClick:function(n){n.isTrusted&&o.a.Homicide.commit(e,t)}},"Homicide (",s.a.formatPercentage(g)," chance of success)")),a.createElement(i.a,{title:a.createElement(a.Fragment,null,"Attempt to commit grand theft auto")},a.createElement(r.a,{onClick:function(n){n.isTrusted&&o.a.GrandTheftAuto.commit(e,t)}},"Grand theft Auto (",s.a.formatPercentage(y)," chance of success)")),a.createElement(i.a,{title:a.createElement(a.Fragment,null,"Attempt to kidnap and ransom a high-profile-target")},a.createElement(r.a,{onClick:function(n){n.isTrusted&&o.a.Kidnap.commit(e,t)}},"Kidnap and Ransom (",s.a.formatPercentage(b)," chance of success)")),a.createElement(i.a,{title:a.createElement(a.Fragment,null,"Attempt to assassinate a high-profile target")},a.createElement(r.a,{onClick:function(n){n.isTrusted&&o.a.Assassination.commit(e,t)}},"Assassinate (",s.a.formatPercentage(E)," chance of success)")),a.createElement(i.a,{title:a.createElement(a.Fragment,null,"Attempt to pull off the ultimate heist")},a.createElement(r.a,{onClick:function(n){n.isTrusted&&o.a.Heist.commit(e,t)}},"Heist (",s.a.formatPercentage(v)," chance of success)")))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return x}));var a=n(0),r=n.n(a),i=n(1),o=n(8),s=n(1312),l=n(9),c=n(12),f=n(26),u=n(105),m=n(29),h=n(14),d=n(94),p=n(1313),g=n(108),y=n(119),b=n(471),E=n(223),v=n(92),k=n(24),_=n(1314),w=n(4),S=n(18);function x(t){const e=m.b.Player(),n=m.b.Router(),x=Object(a.useState)(!1)[1],C=e.inBladeburner();function L(){const t=e;if(t.inBladeburner())n.toBladeburner();else if(t.strength>=100&&t.defense>=100&&t.dexterity>=100&&t.agility>=100){t.startBladeburner({new:!0}),Object(h.a)("You have been accepted into the Bladeburner division!"),x(t=>!t);const e=document.getElementById("world-menu-header");e instanceof HTMLElement&&(e.click(),e.click())}else Object(h.a)("Rejected! Please apply again when you have 100 of each combat stat (str, def, dex, agi)")}function O(){n.toGrafting()}function M(){const[t,n]=Object(a.useState)(!1);return e.canAccessCorporation()?r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,{disabled:!e.canAccessCorporation()||e.hasCorporation(),onClick:()=>n(!0)},"Create a Corporation"),r.a.createElement(s.a,{open:t,onClose:()=>n(!1)})):r.a.createElement(r.a.Fragment,null,r.a.createElement(i.a,null,r.a.createElement("i",null,"A business man is yelling at a clerk. You should come back later.")))}function T(){const t=f.a[w.a.ChurchOfTheMachineGod];e.factions.includes(w.a.ChurchOfTheMachineGod)||Object(u.d)(t),e.augmentations.some(t=>t.name===c.a.StaneksGift1)||e.queuedAugmentations.some(t=>t.name===c.a.StaneksGift1)||Object(y.a)({name:c.a.StaneksGift1,level:1}),n.toStaneksGift()}switch(t.loc.name){case l.a.NewTokyoVitaLife:return e.canAccessGrafting()?r.a.createElement(o.a,{onClick:O,sx:{my:5}},"Enter the secret lab"):r.a.createElement(r.a.Fragment,null);case l.a.Sector12CityHall:return S.a.CorporationSoftcap<.15&&r.a.createElement(r.a.Fragment,null)||r.a.createElement(M,null);case l.a.Sector12NSA:return function(){if(!e.canAccessBladeburner())return r.a.createElement(r.a.Fragment,null);const t=C?"Enter Bladeburner Headquarters":"Apply to Bladeburner Division";return r.a.createElement(r.a.Fragment,null,r.a.createElement("br",null),r.a.createElement(o.a,{onClick:L},t))}();case l.a.NewTokyoNoodleBar:return r.a.createElement(r.a.Fragment,null,r.a.createElement("br",null),r.a.createElement(o.a,{onClick:function(){d.b.emit("You ate some delicious noodles and feel refreshed",d.d.SUCCESS,2e3),Object(p.a)(),e.sourceFiles.length>0&&e.giveExploit(g.a.N00dles),(e.sourceFileLvl(5)>0||5===e.bitNodeN)&&(e.intelligence_exp*=1.0000000000000002),e.hacking_exp*=1.0000000000000002,e.strength_exp*=1.0000000000000002,e.defense_exp*=1.0000000000000002,e.agility_exp*=1.0000000000000002,e.dexterity_exp*=1.0000000000000002,e.charisma_exp*=1.0000000000000002;for(const t of e.hacknetNodes)if(t instanceof E.a)e.gainMoney(.001*t.moneyGainRatePerSecond,"other");else{const n=Object(k.d)(t);if(!(n instanceof v.a))throw new Error(`Server ${t} is not a hacknet server.`);e.hashManager.storeHashes(.001*n.hashRate)}e.bladeburner&&(e.bladeburner.rank+=1e-5),e.corporation&&(e.corporation.funds+=.01*e.corporation.revenue)}},"Eat noodles"));case l.a.ChongqingChurchOfTheMachineGod:return function(){const t=r.a.createElement(o.a,{onClick:()=>n.toStaneksGift()},"Open Stanek's Gift"),a=r.a.createElement(i.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," `` ",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)," `..` ");return e.hasAugmentation(c.a.StaneksGift3,!0)?r.a.createElement(r.a.Fragment,null,r.a.createElement(i.a,null,r.a.createElement("i",null,"Allison \"Mother\" Stanek: ..can ...you hear them too ...? Come now, don't be shy and let me get a closer look at you. Yes wonderful, I see my creation has taken root without consquence or much ill effect it seems. Curious, Just how much of a machine's soul do you house in that body?")),r.a.createElement("br",null),t,r.a.createElement("br",null),a):e.hasAugmentation(c.a.StaneksGift2,!0)?r.a.createElement(r.a.Fragment,null,r.a.createElement(i.a,null,r.a.createElement("i",null,'Allison "Mother" Stanek: I see you\'ve taken to my creation. So much so it could hardly be recognized as one of my own after your tinkering with it. I see you follow the ways of the Machine God as I do, and your mastery of the gift clearly demonstrates that. My hopes are climbing by the day for you.')),r.a.createElement("br",null),t,r.a.createElement("br",null),a):e.factions.includes(w.a.ChurchOfTheMachineGod)?r.a.createElement(r.a.Fragment,null,r.a.createElement(i.a,null,r.a.createElement("i",null,'Allison "Mother" Stanek: Welcome back my child!')),r.a.createElement("br",null),t,r.a.createElement("br",null),a):e.canAccessCotMG()?e.augmentations.filter(t=>t.name!==c.a.NeuroFluxGovernor).length>0||e.queuedAugmentations.filter(t=>t.name!==c.a.NeuroFluxGovernor).length>0?r.a.createElement(r.a.Fragment,null,r.a.createElement(i.a,null,r.a.createElement("i",null,'Allison "Mother" Stanek: Begone you filth! My gift must be the first modification that your body should have!'))):r.a.createElement(r.a.Fragment,null,r.a.createElement(i.a,null,r.a.createElement("i",null,'Allison "Mother" Stanek: Welcome child, I see your body is pure. Are you ready to ascend beyond our human form? If you are, accept my gift.')),r.a.createElement(o.a,{onClick:T},"Accept Stanek's Gift"),a):r.a.createElement(r.a.Fragment,null,r.a.createElement(i.a,null,"A decrepit altar stands in the middle of a dilapidated church.",r.a.createElement("br",null),r.a.createElement("br",null),"A symbol is carved in the altar."),r.a.createElement("br",null),a)}();case l.a.IshimaGlitch:return r.a.createElement(r.a.Fragment,null,r.a.createElement(i.a,null,r.a.createElement(b.a,{content:"An eerie aura surrounds this area. You feel you should leave."})));case l.a.NewTokyoArcade:return r.a.createElement(_.a,null);default:return console.error(`Location ${t.loc.name} doesn't have any special properties`),r.a.createElement(r.a.Fragment,null)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var a=n(0),r=n.n(a),i=n(20),o=n(38),s=n(29),l=n(1),c=n(8),f=n(76);function u(t){const e=s.b.Player(),n=s.b.Router(),u=e.canAfford(15e10);if(!e.canAccessCorporation()||e.hasCorporation())return t.onClose(),r.a.createElement(r.a.Fragment,null);const[m,h]=Object(a.useState)("");return r.a.createElement(o.a,{open:t.open,onClose:t.onClose},r.a.createElement(l.a,null,"Would you like to start a corporation? This will require $150b for registration and initial funding."," ",3===e.bitNodeN&&"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",r.a.createElement("br",null),r.a.createElement("br",null),"If you would like to start one, please enter a name for your corporation below:"),r.a.createElement(f.a,{autoFocus:!0,placeholder:"Corporation Name",onChange:function(t){h(t.target.value)},value:m}),3===e.bitNodeN&&r.a.createElement(c.a,{onClick:function(){""!=m&&(e.startCorporation(m,5e8),t.onClose(),n.toCorporation())},disabled:""==m},"Use seed money"),r.a.createElement(c.a,{onClick:function(){u&&""!=m&&(e.startCorporation(m),e.loseMoney(15e10,"corporation"),t.onClose(),n.toCorporation())},disabled:""==m||!u},"Self-Fund (",r.a.createElement(i.a,{money:15e10,player:e}),")"))}},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return N00dles}));const n00dlePower="[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+([]+[])[(![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(!![]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]()[+!+[]+[!+[]+!+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(![]+[+[]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]]+![]+(![]+[+[]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]])()[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((![]+[+[]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]])+[])[+!+[]]+[!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(![]+[+[]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]]+![]+(![]+[+[]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]])()[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((![]+[+[]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]])+[])[+!+[]]+[+!+[]]+[+!+[]]+[!+[]+!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(+[![]]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+!+[]]]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(+[![]]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+!+[]]]+(!![]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[+!+[]]+(+(!+[]+!+[]+[+!+[]]+[+!+[]]))[(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([]+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]][([][[]]+[])[+!+[]]+(![]+[])[+!+[]]+((+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]+[])[+!+[]+[+!+[]]]+(!![]+[])[!+[]+!+[]+!+[]]]](!+[]+!+[]+!+[]+[+!+[]])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]])()([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[(![]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]]((+((+(+!+[]+[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+[!+[]+!+[]]+[+[]])+[])[+!+[]]+[+[]+[+[]]+[+[]]+[+[]]+[+[]]+[+[]]+[+!+[]]])+[])[!+[]+!+[]]+[+!+[]])+(![]+[])[+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]])()())[!+[]+!+[]+!+[]+[+[]]]+(+[]+[][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(+[]+[][(!![]+[])[!+[]+!+[]+!+[]]+([][[]]+[])[+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(+[![]]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+!+[]]]+([][[]]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][[]]+[])[!+[]+!+[]]+(+[![]]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+!+[]]]+(+[![]]+[+(+!+[]+(!+[]+[])[!+[]+!+[]+!+[]]+[+!+[]]+[+[]]+[+[]]+[+[]])])[+!+[]+[+[]]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+[]]+(+[![]]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+!+[]]]+(!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[!+[]+!+[]]+(+[![]]+[+(+!+[]+(!+[]+[])[!+[]+!+[]+!+[]]+[+!+[]]+[+[]]+[+[]]+[+[]])])[+!+[]+[+[]]]+(+[![]]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+!+[]]]+([][[]]+[])[!+[]+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(![]+[])[+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(+(!+[]+!+[]+[+[]]))[(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([]+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]][([][[]]+[])[+!+[]]+(![]+[])[+!+[]]+((+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]+[])[+!+[]+[+!+[]]]+(!![]+[])[!+[]+!+[]+!+[]]]](!+[]+!+[]+[+!+[]])+(+[![]]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+!+[]]]+(!![]+[])[+[]]+(+(+!+[]+[+[]]+[+!+[]]))[(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([]+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]][([][[]]+[])[+!+[]]+(![]+[])[+!+[]]+((+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]+[])[+!+[]+[+!+[]]]+(!![]+[])[!+[]+!+[]+!+[]]]](!+[]+!+[]+[+!+[]])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]+!+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(![]+[+[]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]]+![]+(![]+[+[]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]])()[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]()+[])[!+[]+!+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(![]+[+[]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]]+![]+(![]+[+[]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]])()[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((![]+[+[]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]])+[])[+!+[]]+[!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]]+([]+[])[(![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(!![]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]()[+!+[]+[!+[]+!+[]]])()";function N00dles(){eval(n00dlePower)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a,r=n(0),i=n.n(r),o=n(1315),s=n(8),l=n(29),c=n(339);function f(){const t=l.b.Player(),[e,n]=Object(r.useState)(a.None);if(e===a.None)return i.a.createElement(i.a.Fragment,null,i.a.createElement(s.a,{onClick:function(){0===t.sourceFileLvl(1)?c.a.emit("This machine is broken."):n(a.Megabyteburner2000)}},"Megabyte burner 2000"));let f=i.a.createElement(i.a.Fragment,null);switch(e){case a.Megabyteburner2000:f=i.a.createElement(o.a,null)}return i.a.createElement(i.a.Fragment,null,i.a.createElement(s.a,{onClick:()=>n(a.None)},"Back"),f)}!function(t){t[t.None=0]="None",t[t.Megabyteburner2000=1]="Megabyteburner2000"}(a||(a={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(0),r=n.n(a),i=n(1),o=n(29),s=n(108);const l={width:"1060px",height:"800px",border:"0px"};function c(){const t=o.b.Player();Object(a.useEffect)(()=>{window.addEventListener("message",(function(e){e.isTrusted&&"https://bitburner-official.github.io"==e.origin&&e.data&&t.giveExploit(s.a.TrueRecursion)}))});const e=r.a.createElement(r.a.Fragment,null,r.a.createElement(i.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," "),r.a.createElement(i.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," ,'\" \"', .-. "),r.a.createElement(i.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," / \\ ( ) "),r.a.createElement(i.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," | | .-. '-' .-. "),r.a.createElement(i.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," \\ / ( ) ( )"),r.a.createElement(i.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," '.___.' '-' .-. '-'"),r.a.createElement(i.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," ||| ( ) "),r.a.createElement(i.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," ||| '-' "));return r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{style:{width:"1060px",height:"800px",padding:"0",overflow:"hidden",borderColor:"white",borderStyle:"solid",borderWidth:"5px"}},r.a.createElement("iframe",{src:"https://bitburner-official.github.io/bitburner-legacy/",style:l})),r.a.createElement("div",{style:{width:"1060px",borderColor:"white",borderStyle:"solid",borderWidth:"5px"}},e))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return y}));var a=n(0),r=n.n(a),i=n(1),o=n(8),s=n(1317),l=n(1318),c=n(1320),f=n(224),u=n(20),m=n(29),h=n(1321),d=n(5),p=n(19);function g(t){const[e,n]=Object(a.useState)(!1),i=m.b.Player(),s=Object(f.a)(t.ram);return r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,{onClick:()=>n(!0),disabled:!i.canAfford(s)},"Purchase ",d.a.formatRAM(t.ram)," Server - ",r.a.createElement(u.a,{money:s,player:i})),r.a.createElement(h.a,{open:e,onClose:()=>n(!1),ram:t.ram,cost:s,rerender:t.rerender}))}function y(t){const e=m.b.Player(),n=Object(a.useState)(!1)[1];function o(){n(t=>!t)}Object(a.useEffect)(()=>{const t=setInterval(o,1e3);return()=>clearInterval(t)},[]);const f=[];for(let e=t.loc.techVendorMinRam;e<=t.loc.techVendorMaxRam;e*=2)f.push(r.a.createElement(g,{key:e,ram:e,rerender:o}));return r.a.createElement(r.a.Fragment,null,r.a.createElement("br",null),r.a.createElement(p.a,{sx:{display:"grid",width:"fit-content"}},f),r.a.createElement("br",null),r.a.createElement(i.a,null,r.a.createElement("i",null,'"You can order bigger servers via scripts. We don\'t take custom orders in person."')),r.a.createElement("br",null),r.a.createElement(l.a,{p:e,rerender:o}),r.a.createElement("br",null),r.a.createElement(s.a,{p:e,rerender:o}),r.a.createElement("br",null),r.a.createElement(c.a,{p:e,rerender:o}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var a=n(0),r=n.n(a),i=n(8),o=n(21),s=n(1),l=n(10),c=n(224),f=n(20),u=n(5),m=n(266),h=n(18);function d(t){const e=t.p.getHomeComputer();if(e.maxRam>=l.a.HomeComputerMaxRam)return r.a.createElement(i.a,null,"Upgrade 'home' RAM - MAX");const n=t.p.getUpgradeHomeRamCost();const a=1===h.a.HomeComputerRamCost?"":"\\cdot "+h.a.HomeComputerRamCost;return r.a.createElement(o.a,{title:r.a.createElement(m.a,null,`\\(\\large{cost = ram \\cdot 3.2 \\cdot 10^4 \\cdot 1.58^{log_2{(ram)}}} ${a}\\)`)},r.a.createElement("span",null,r.a.createElement("br",null),r.a.createElement(s.a,null,r.a.createElement("i",null,"\"More RAM means more scripts on 'home'\"")),r.a.createElement("br",null),r.a.createElement(i.a,{disabled:!t.p.canAfford(n),onClick:function(){Object(c.d)(t.p),t.rerender()}},"Upgrade 'home' RAM (",u.a.formatRAM(e.maxRam)," -> ",u.a.formatRAM(2*e.maxRam),") - ",r.a.createElement(f.a,{money:n,player:t.p}))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(0),r=n.n(a),i=n(8),o=n(1319),s=n(10),l=n(20);function c(t){return t.p.hasTorRouter()?r.a.createElement(i.a,null,"TOR Router - Purchased"):r.a.createElement(i.a,{disabled:!t.p.canAfford(s.a.TorRouterCost),onClick:function(){Object(o.a)(t.p),t.rerender()}},"Purchase TOR router - ",r.a.createElement(l.a,{money:s.a.TorRouterCost,player:t.p}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(88),r=n(10),i=n(24),o=n(14);function s(t){if(t.hasTorRouter())return void Object(o.a)("You already have a TOR Router!");if(!t.canAfford(r.a.TorRouterCost))return void Object(o.a)("You cannot afford to purchase the TOR router!");t.loseMoney(r.a.TorRouterCost,"other");const e=Object(i.d)(a.a.DarkWeb);if(!e)throw new Error("Dark web is not a server.");t.getHomeComputer().serversOnNetwork.push(e.hostname),e.serversOnNetwork.push(t.getHomeComputer().hostname),Object(o.a)("You have purchased a TOR router!
You now have access to the dark web from your home computer.
Use the scan/scan-analyze commands to search for the dark web connection.")}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(0),r=n.n(a),i=n(8),o=n(21),s=n(1),l=n(20),c=n(266);function f(t){const e=t.p.getHomeComputer(),n=e.cpuCores>=8;if(n)return r.a.createElement(i.a,null,"Upgrade 'home' cores - MAX");const a=t.p.getUpgradeHomeCoresCost();return r.a.createElement(o.a,{title:r.a.createElement(c.a,null,"\\(\\large{cost = 10^9 \\cdot 7.5 ^{\\text{cores}}}\\)")},r.a.createElement("span",null,r.a.createElement("br",null),r.a.createElement(s.a,null,r.a.createElement("i",null,"\"Cores increase the effectiveness of grow() and weaken() on 'home'\"")),r.a.createElement("br",null),r.a.createElement(i.a,{disabled:!t.p.canAfford(a),onClick:function(){n||t.p.canAfford(a)&&(t.p.loseMoney(a,"servers"),e.cpuCores++,t.rerender())}},"Upgrade 'home' cores (",e.cpuCores," -> ",e.cpuCores+1,") - ",r.a.createElement(l.a,{money:a,player:t.p}))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var a=n(0),r=n.n(a),i=n(224),o=n(5),s=n(20),l=n(38),c=n(29),f=n(1),u=n(76),m=n(8),h=n(27);function d(t){const e=c.b.Player(),[n,d]=Object(a.useState)("");function p(){Object(i.e)(n,t.ram,t.cost,e),t.onClose()}return r.a.createElement(l.a,{open:t.open,onClose:t.onClose},r.a.createElement(f.a,null,"Would you like to purchase a new server with ",o.a.formatRAM(t.ram)," of RAM for"," ",r.a.createElement(s.a,{money:t.cost,player:e}),"?"),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(f.a,null," Please enter the server hostname below:"),r.a.createElement("br",null),r.a.createElement(u.a,{autoFocus:!0,onKeyUp:function(t){t.key===h.a.ENTER&&p()},onChange:function(t){d(t.target.value)},type:"text",placeholder:"Unique Hostname",InputProps:{endAdornment:r.a.createElement(m.a,{onClick:p,disabled:!e.canAfford(t.cost)||""===n},"Buy")}}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var a=n(0),r=n.n(a),i=n(10),o=n(20),s=n(38),l=n(29),c=n(1),f=n(8);function u(t){const e=l.b.Player(),n=i.a.TravelCost;return r.a.createElement(s.a,{open:t.open,onClose:t.onClose},r.a.createElement(c.a,null,"Would you like to travel to ",t.city,"? The trip will cost ",r.a.createElement(o.a,{money:n,player:e}),"."),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(f.a,{onClick:function(){t.travel()}},r.a.createElement(c.a,null,"Travel")))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var a=n(0),r=n(21),i=n(8),o=n(10),s=n(24),l=n(20),c=n(29),f=n(19),u=n(34);function m(t){const e=c.b.Player(),n=c.b.Router();function m(){const e=Object(s.d)(t.loc.name);if(null==e||!e.hasOwnProperty("backdoorInstalled"))return t.loc.costMult;const n=e.backdoorInstalled?.9:1;return t.loc.costMult*n}function h(a){const r=t.loc;e.startClass(m(),r.expMult,a),e.startFocusing(),n.toWork()}const d=m(),p=o.a.ClassDataStructuresBaseCost*d,g=o.a.ClassNetworksBaseCost*d,y=o.a.ClassAlgorithmsBaseCost*d,b=o.a.ClassManagementBaseCost*d,E=o.a.ClassLeadershipBaseCost*d;return a.createElement(f.a,{sx:{display:"grid",width:"fit-content"}},a.createElement(r.a,{title:"Gain hacking experience!"},a.createElement(i.a,{onClick:function(){h(u.a.StudyComputerScience)}},"Study Computer Science (free)")),a.createElement(r.a,{title:"Gain hacking experience!"},a.createElement(i.a,{onClick:function(){h(u.a.DataStructures)}},"Take Data Structures course (",a.createElement(l.a,{money:p,player:e})," / sec)")),a.createElement(r.a,{title:"Gain hacking experience!"},a.createElement(i.a,{onClick:function(){h(u.a.Networks)}},"Take Networks course (",a.createElement(l.a,{money:g,player:e})," / sec)")),a.createElement(r.a,{title:"Gain hacking experience!"},a.createElement(i.a,{onClick:function(){h(u.a.Algorithms)}},"Take Algorithms course (",a.createElement(l.a,{money:y,player:e})," / sec)")),a.createElement(r.a,{title:"Gain charisma experience!"},a.createElement(i.a,{onClick:function(){h(u.a.Management)}},"Take Management course (",a.createElement(l.a,{money:b,player:e})," / sec)")),a.createElement(r.a,{title:"Gain charisma experience!"},a.createElement(i.a,{onClick:function(){h(u.a.Leadership)}},"Take Leadership course (",a.createElement(l.a,{money:E,player:e})," / sec)")))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var a,r=n(0),i=n.n(r),o=n(8),s=n(784),l=n(1326),c=n(1327),f=n(1328),u=n(19);function m(t){const[e,n]=Object(r.useState)(a.None);function m(t){n(t)}return i.a.createElement(i.a.Fragment,null,e===a.None&&i.a.createElement(u.a,{sx:{display:"grid",width:"fit-content"}},i.a.createElement(o.a,{onClick:()=>m(a.Coin)},"Play coin flip"),i.a.createElement(o.a,{onClick:()=>m(a.Slots)},"Play slots"),i.a.createElement(o.a,{onClick:()=>m(a.Roulette)},"Play roulette"),i.a.createElement(o.a,{onClick:()=>m(a.Blackjack)},"Play blackjack (",s.b," decks)")),e!==a.None&&i.a.createElement(i.a.Fragment,null,i.a.createElement(o.a,{onClick:()=>m(a.None)},"Stop playing"),e===a.Coin&&i.a.createElement(l.a,{p:t.p}),e===a.Slots&&i.a.createElement(f.a,{p:t.p}),e===a.Roulette&&i.a.createElement(c.a,{p:t.p}),e===a.Blackjack&&i.a.createElement(s.a,{p:t.p})))}!function(t){t.None="none",t.Coin="coin",t.Slots="slots",t.Roulette="roulette",t.Blackjack="blackjack"}(a||(a={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(260),r=n(115);class i{constructor(t=1){var e,n,a;a=[],(n="cards")in(e=this)?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,this.numDecks=t,this.reset()}shuffle(){this.cards=Object(r.shuffle)(this.cards)}drawCard(){if(0==this.cards.length)throw new Error("Tried to draw card from empty deck");return this.cards.shift()}safeDrawCard(){return 0===this.cards.length&&this.reset(),this.drawCard()}reset(){this.cards=[];for(let t=1;t<=13;++t)for(let e=0;ey(!1),250),s?Object(o.c)(t.p,e):Object(o.c)(t.p,-e),Object(o.b)(t.p)}return r.a.createElement(r.a.Fragment,null,r.a.createElement(l.a,null,"Result:")," ",m,r.a.createElement(u.a,{display:"flex",alignItems:"center"},r.a.createElement(c.a,{type:"number",onChange:function(t){let e=parseInt(t.currentTarget.value);isNaN(e)&&(e=0),e>1e4&&(e=1e4),e<0&&(e=0),n(e)},InputProps:{endAdornment:r.a.createElement(r.a.Fragment,null,r.a.createElement(f.a,{onClick:Object(s.a)(()=>b("H")),disabled:g},"Head!"),r.a.createElement(f.a,{onClick:Object(s.a)(()=>b("T")),disabled:g},"Tail!"))}})),r.a.createElement(l.a,{variant:"h3"},d))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var a=n(0),r=n.n(a),i=n(20),o=n(212),s=n(314),l=n(87),c=n(1),f=n(8),u=n(76);const m=[1,3,5,7,9,12,14,16,18,19,21,23,25,27,30,32,34,36],h={Red:{match:t=>m.includes(t),payout:1},Black:{match:t=>0!==t&&!m.includes(t),payout:1},Odd:{match:t=>0!==t&&t%2==1,payout:1},Even:{match:t=>0!==t&&t%2==0,payout:1},High:{match:t=>0!==t&&t>18,payout:1},Low:{match:t=>0!==t&&t<19,payout:1},Third1:{match:t=>0!==t&&t<=12,payout:2},Third2:{match:t=>0!==t&&(t>=13&&t<=24),payout:2},Third3:{match:t=>0!==t&&t>=25,payout:2}};function d(t){return{match:e=>t===e,payout:36}}function p(t){const[e]=Object(a.useState)(new s.c((new Date).getTime())),[n,m]=Object(a.useState)(1e3),[p,g]=Object(a.useState)(!0),[y,b]=Object(a.useState)("waiting"),[E,v]=Object(a.useState)(0),[k,_]=Object(a.useState)(!0);function w(){k||v(Math.floor(37*Math.random()))}function S(a){Object(o.b)(t.p)||(g(!1),_(!1),b("playing"),setTimeout(()=>{let s=Math.floor(37*e.random()),l=r.a.createElement(r.a.Fragment,null),c=0,f=a.match(s);if(f&&Math.random()>.9)for(;f;)s=Math.floor(37*e.random()),f=a.match(s);f?(c=n*a.payout,l=r.a.createElement(r.a.Fragment,null,"won ",r.a.createElement(i.a,{money:c}))):(c=-n,l=r.a.createElement(r.a.Fragment,null,"lost ",r.a.createElement(i.a,{money:-c}))),Object(o.c)(t.p,c),g(!0),_(!0),b(l),v(s),Object(o.b)(t.p)},1600))}return Object(a.useEffect)(()=>{const t=window.setInterval(w,50);return()=>clearInterval(t)}),r.a.createElement(r.a.Fragment,null,r.a.createElement(c.a,{variant:"h4"},function(){if(0===E)return"0";const t=function(t){return[1,3,5,7,9,12,14,16,18,19,21,23,25,27,30,32,34,36].includes(t)}(E)?"R":"B";return`${E}${t}`}()),r.a.createElement(u.a,{type:"number",onChange:function(t){let e=parseInt(t.currentTarget.value);isNaN(e)&&(e=0),e>1e7&&(e=1e7),e<0&&(e=0),m(e)},placeholder:"Amount to play",disabled:!p}),r.a.createElement(c.a,{variant:"h4"},y),r.a.createElement("table",null,r.a.createElement("tbody",null,r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(3)))},"3")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(6)))},"6")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(9)))},"9")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(12)))},"12")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(15)))},"15")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(18)))},"18")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(21)))},"21")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(24)))},"24")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(27)))},"27")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(30)))},"30")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(33)))},"33")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(36)))},"36"))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(2)))},"2")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(5)))},"5")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(8)))},"8")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(11)))},"11")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(14)))},"14")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(17)))},"17")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(20)))},"20")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(23)))},"23")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(26)))},"26")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(29)))},"29")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(32)))},"32")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(35)))},"35"))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(1)))},"1")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(4)))},"4")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(7)))},"7")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(10)))},"10")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(13)))},"13")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(16)))},"16")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(19)))},"19")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(22)))},"22")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(25)))},"25")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(28)))},"28")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(31)))},"31")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(34)))},"34"))),r.a.createElement("tr",null,r.a.createElement("td",{colSpan:4},r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(h.Third1))},"1 to 12")),r.a.createElement("td",{colSpan:4},r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(h.Third2))},"13 to 24")),r.a.createElement("td",{colSpan:4},r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(h.Third3))},"25 to 36"))),r.a.createElement("tr",null,r.a.createElement("td",{colSpan:2},r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(h.Red))},"Red")),r.a.createElement("td",{colSpan:2},r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(h.Black))},"Black")),r.a.createElement("td",{colSpan:2},r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(h.Odd))},"Odd")),r.a.createElement("td",{colSpan:2},r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(h.Even))},"Even")),r.a.createElement("td",{colSpan:2},r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(h.High))},"High")),r.a.createElement("td",{colSpan:2},r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(h.Low))},"Low"))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(0)))},"0"))))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var a=n(0),r=n.n(a),i=n(20),o=n(314),s=n(212),l=n(87),c=n(1),f=n(76),u=n(8);const m=["D","C","$","?","♥","A","C","B","C","E","B","E","C","*","D","♥","B","A","A","A","C","A","D","B","E","?","D","*","@","♥","B","E","?"];function h(t,e){switch(t){case"$":return[20,200,1e3][e];case"@":return[8,80,400][e];case"♥":case"?":return[6,20,150][e];case"D":case"E":return[1,8,30][e];default:return[1,5,20][e]}}const d=[[[0,0],[0,1],[0,2],[0,3],[0,4]],[[1,0],[1,1],[1,2],[1,3],[1,4]],[[2,0],[2,1],[2,2],[2,3],[2,4]],[[2,0],[1,1],[0,2],[1,3],[2,4]],[[0,0],[1,1],[2,2],[1,3],[0,4]],[[0,0],[1,1],[1,2],[1,3],[0,4]],[[2,0],[1,1],[1,2],[1,3],[2,4]],[[1,0],[0,1],[0,2],[0,3],[1,4]],[[1,0],[2,1],[2,2],[2,3],[1,4]]];function p(t){const[e]=Object(a.useState)(new o.c(t.p.totalPlaytime)),[n,p]=Object(a.useState)([0,0,0,0,0]),[g,y]=Object(a.useState)([0,0,0,0,0]),[b,E]=Object(a.useState)(1e3),[v,k]=Object(a.useState)(!0),[_,w]=Object(a.useState)("waiting");function S(){let e=!1;const a=n.slice();for(let t=0;t=0?a[t]-1:m.length-1,e=!0);p(a),e&&a.every((t,e)=>t===g[e])&&function(e){const n=function(t){const n=[];for(const a of t)n.push(e[a[0]][a[1]]);return n},a=function(t){let e=1;for(let n=1;n0?"gained":"lost"," ",r.a.createElement(i.a,{money:Math.abs(o)}))),k(!0),Object(s.b)(t.p));}(x(a,m))}function x(t,e){return[[e[(t[0]+e.length-1)%e.length],e[(t[1]+e.length-1)%e.length],e[(t[2]+e.length-1)%e.length],e[(t[3]+e.length-1)%e.length],e[(t[4]+e.length-1)%e.length]],[e[t[0]],e[t[1]],e[t[2]],e[t[3]],e[t[4]]],[e[(t[0]+1)%e.length],e[(t[1]+1)%e.length],e[(t[2]+1)%e.length],e[(t[3]+1)%e.length],e[(t[4]+1)%e.length]]]}function C(){y([Math.floor(e.random()*m.length),Math.floor(e.random()*m.length),Math.floor(e.random()*m.length),Math.floor(e.random()*m.length),Math.floor(e.random()*m.length)])}Object(a.useEffect)(()=>{const t=window.setInterval(S,50);return()=>clearInterval(t)});const L=x(n,m);return r.a.createElement(r.a.Fragment,null,r.a.createElement(c.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}},"+———————————————————————+"),r.a.createElement(c.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}},"| | ",L[0][0]," | ",L[0][1]," | ",L[0][2]," | ",L[0][3]," | ",L[0][4]," | |"),r.a.createElement(c.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}},"| | | | | | | |"),r.a.createElement(c.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}},"| | ",m[n[0]]," | ",m[n[1]]," | ",m[n[2]]," | ",m[n[3]]," | ",m[n[4]]," | |"),r.a.createElement(c.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}},"| | | | | | | |"),r.a.createElement(c.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}},"| | ",m[(n[0]+1)%m.length]," | ",m[(n[1]+1)%m.length]," | ",m[(n[2]+1)%m.length]," | ",m[(n[3]+1)%m.length]," | ",m[(n[4]+1)%m.length]," | |"),r.a.createElement(c.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}},"+———————————————————————+"),r.a.createElement(f.a,{type:"number",onChange:function(t){let e=parseInt(t.currentTarget.value);isNaN(e)&&(e=0),e>1e6&&(e=1e6),e<0&&(e=0),E(e)},placeholder:"Amount to play",disabled:!v,InputProps:{endAdornment:r.a.createElement(u.a,{onClick:Object(l.a)((function(){Object(s.b)(t.p)||(w("playing"),Object(s.c)(t.p,-b),v&&(y([-1,-1,-1,-1,-1]),k(!1),setTimeout(C,2e3*e.random()+1e3)))})),disabled:!v},"Spin!")}}),r.a.createElement(c.a,{variant:"h4"},_),r.a.createElement(c.a,null,"Pay lines"),r.a.createElement(c.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}},"----- ····· ·····"),r.a.createElement(c.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}},"····· ----- ·····"),r.a.createElement(c.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}},"····· ····· -----"),r.a.createElement("br",null),r.a.createElement(c.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}},"··^·· \\···/ \\···/"),r.a.createElement(c.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}},"·/·\\· ·\\·/· ·---·"),r.a.createElement(c.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}},"/···\\ ··v·· ·····"),r.a.createElement("br",null),r.a.createElement(c.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}},"····· ·---· ·····"),r.a.createElement(c.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}},"·---· /···\\ \\···/"),r.a.createElement(c.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}},"/···\\ ····· ·---·"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return E}));var a=n(0),r=n(154),i=n(9),o=n(186),s=n(6),l=n(29),c=n(1),f=n(8),u=n(52),m=n(121),h=n(144);const d=Object(m.a)(t=>Object(h.a)({location:{color:t.colors.white,whiteSpace:"nowrap",margin:"0px",padding:"0px",cursor:"pointer"}}));function p(t,e){e.name===i.a.TravelAgency?t.toTravel():e.name===i.a.WorldStockExchange?t.toStockMarket():t.toLocation(e)}function g(t){t.types;const e=l.b.Router(),n=d();let r="X";return t.types.includes(u.a.Company)&&(r="C"),t.types.includes(u.a.Gym)&&(r="G"),t.types.includes(u.a.Hospital)&&(r="H"),t.types.includes(u.a.Slums)&&(r="S"),t.types.includes(u.a.StockMarket)&&(r="$"),t.types.includes(u.a.TechVendor)&&(r="T"),t.types.includes(u.a.TravelAgency)&&(r="T"),t.types.includes(u.a.University)&&(r="U"),t.types.includes(u.a.Casino)&&(r="¢"),t.types.includes(u.a.Special)&&(r="?"),t?a.createElement("span",{"aria-label":t.name,key:t.name,className:n.location,onClick:()=>p(e,t)},a.createElement("b",null,r)):a.createElement("span",null,"*")}function y(t){const e=/[A-Z]/g,n={A:0,B:1,C:2,D:3,E:4,F:5,G:6,H:7,I:8,J:9,K:10,L:11,M:12,N:13,O:14,P:15,Q:16,R:17,S:18,T:19,U:20,V:21,W:22,X:23,Y:24,Z:25},r=a=>{const r=[],i=[];let s;for(;null!==(s=e.exec(a));)i.push(s);if(0===i.length)return r.push(a),r;for(let e=0;ea.createElement(a.Fragment,{key:t},a.createElement(f.a,{onClick:()=>p(e,o.a[t])},t),a.createElement("br",null)));return a.createElement(a.Fragment,null,n)}function E(){const t=l.b.Player(),e=r.a[t.city];return a.createElement(a.Fragment,null,a.createElement(c.a,null,e.name),s.a.DisableASCIIArt?a.createElement(b,{city:e}):a.createElement(y,{city:e}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return b}));var a=n(0),r=n.n(a),i=n(38),o=n(8),s=n(19),l=n(1),c=n(130),f=n(277),u=n(74),m=n(76),h=n(1332),d=n.n(h),p=n(467),g=n.n(p),y=n(1331);function b(t){const[e,n]=Object(a.useState)(t.options.theme),[h,p]=Object(a.useState)(t.options.insertSpaces),[b,E]=Object(a.useState)(t.options.fontSize),[v,k]=Object(a.useState)(t.options.wordWrap),[_,w]=Object(a.useState)(t.options.vim),[S,x]=Object(a.useState)(!1);return r.a.createElement(i.a,{open:t.open,onClose:t.onClose},r.a.createElement(y.a,{open:S,onClose:()=>x(!1)}),r.a.createElement(s.a,{display:"flex",flexDirection:"row",alignItems:"center"},r.a.createElement(l.a,null,"Theme: "),r.a.createElement(c.a,{onChange:t=>n(t.target.value),value:e},r.a.createElement(u.a,{value:"monokai"},"monokai"),r.a.createElement(u.a,{value:"solarized-dark"},"solarized-dark"),r.a.createElement(u.a,{value:"solarized-light"},"solarized-light"),r.a.createElement(u.a,{value:"vs-dark"},"dark"),r.a.createElement(u.a,{value:"light"},"light"),r.a.createElement(u.a,{value:"dracula"},"dracula"),r.a.createElement(u.a,{value:"one-dark"},"one-dark"),r.a.createElement(u.a,{value:"customTheme"},"Custom theme")),r.a.createElement(o.a,{onClick:()=>x(!0),sx:{mx:1},startIcon:r.a.createElement(d.a,null)},"Edit custom theme")),r.a.createElement(s.a,{display:"flex",flexDirection:"row",alignItems:"center"},r.a.createElement(l.a,null,"Use whitespace over tabs: "),r.a.createElement(f.a,{onChange:t=>p(t.target.checked),checked:h})),r.a.createElement(s.a,{display:"flex",flexDirection:"row",alignItems:"center"},r.a.createElement(l.a,null,"Word Wrap: "),r.a.createElement(c.a,{onChange:t=>k(t.target.value),value:v},r.a.createElement(u.a,{value:"off"},"Off"),r.a.createElement(u.a,{value:"on"},"On"),r.a.createElement(u.a,{value:"bounded"},"Bounded"),r.a.createElement(u.a,{value:"wordWrapColumn"},"Word Wrap Column"))),r.a.createElement(s.a,{display:"flex",flexDirection:"row",alignItems:"center"},r.a.createElement(l.a,null,"Enable vim mode: "),r.a.createElement(f.a,{onChange:t=>w(t.target.checked),checked:_})),r.a.createElement(s.a,{display:"flex",flexDirection:"row",alignItems:"center"},r.a.createElement(m.a,{type:"number",label:"Font size",value:b,onChange:function(t){const e=parseFloat(t.target.value);isNaN(e)||E(e)}})),r.a.createElement("br",null),r.a.createElement(o.a,{onClick:function(){t.save({theme:e,insertSpaces:h,fontSize:b,wordWrap:v,vim:_}),t.onClose()},startIcon:r.a.createElement(g.a,null)},"Save"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return w}));var a=n(1479),r=n(1503),i=n(1838),o=n(21),s=n(76),l=n(1),c=n(45),f=n(19),u=n(8),m=n(111),h=n(115),d=n.n(h),p=n(623),g=n(0),y=n.n(g),b=n(6),E=n(38),v=n(147),k=n(123);function _({label:t,themePath:e,onColorChange:n,color:r,defaultColor:i}){return void 0===r&&(console.error(`color ${e} was undefined, reverting to default`),r=i),y.a.createElement(y.a.Fragment,null,y.a.createElement(o.a,{title:t},y.a.createElement("span",null,y.a.createElement(s.a,{label:e,value:"#"+r,sx:{display:"block",my:1},InputProps:{startAdornment:y.a.createElement(y.a.Fragment,null,y.a.createElement(p.a,{hideTextfield:!0,deferred:!0,value:"#"+r,onChange:t=>n(e,t.hex),disableAlpha:!0})),endAdornment:y.a.createElement(y.a.Fragment,null,y.a.createElement(m.a,{onClick:()=>n(e,i)},y.a.createElement(a.a,{color:"primary"})))}}))))}function w(t){const e=Object(g.useState)(!1)[1];function n(){e(t=>!t)}const[a,o]=Object(g.useState)(JSON.parse(JSON.stringify(b.a.EditorTheme)));function m(t,e){o(d.a.set(a,t,e)),n()}return y.a.createElement(E.a,{open:t.open,onClose:()=>{o(b.a.EditorTheme),t.onClose()}},y.a.createElement(l.a,{variant:"h4"},"Customize Editor theme"),y.a.createElement(l.a,null,"Hover over input boxes for more information"),y.a.createElement(c.a,{sx:{p:1,my:1}},y.a.createElement(v.a,{checked:"vs"===a.base,onChange:t=>{o(d.a.set(a,"base",t?"vs":"vs-dark")),n()},text:"Use light theme as base",tooltip:y.a.createElement(y.a.Fragment,null,"If enabled, the ",y.a.createElement("code",null,"vs")," light theme will be used as the theme base, otherwise,"," ",y.a.createElement("code",null,"vs-dark")," will be used.")}),y.a.createElement(f.a,{display:"grid",sx:{gridTemplateColumns:"1fr 1fr",width:"fit-content",gap:1}},y.a.createElement(f.a,null,y.a.createElement(l.a,{variant:"h6"},"UI"),y.a.createElement(_,{label:"Background color",themePath:"common.bg",onColorChange:m,color:a.common.bg,defaultColor:k.a.common.bg}),y.a.createElement(_,{label:"Current line and minimap background color",themePath:"ui.line",onColorChange:m,color:a.ui.line,defaultColor:k.a.ui.line}),y.a.createElement(_,{label:"Base text color",themePath:"common.fg",onColorChange:m,color:a.common.fg,defaultColor:k.a.common.fg}),y.a.createElement(_,{label:"Popup background color",themePath:"ui.panel.bg",onColorChange:m,color:a.ui.panel.bg,defaultColor:k.a.ui.panel.bg}),y.a.createElement(_,{label:"Background color for selected item in popup",themePath:"ui.panel.selected",onColorChange:m,color:a.ui.panel.selected,defaultColor:k.a.ui.panel.selected}),y.a.createElement(_,{label:"Popup border color",themePath:"ui.panel.border",onColorChange:m,color:a.ui.panel.border,defaultColor:k.a.ui.panel.border}),y.a.createElement(_,{label:"Background color of highlighted text",themePath:"ui.selection.bg",onColorChange:m,color:a.ui.selection.bg,defaultColor:k.a.ui.selection.bg})),y.a.createElement(f.a,null,y.a.createElement(l.a,{variant:"h6"},"Syntax"),y.a.createElement(_,{label:"Numbers, function names, and other key vars",themePath:"common.accent",onColorChange:m,color:a.common.accent,defaultColor:k.a.common.accent}),y.a.createElement(_,{label:"Keywords",themePath:"syntax.keyword",onColorChange:m,color:a.syntax.keyword,defaultColor:k.a.syntax.keyword}),y.a.createElement(_,{label:"Strings",themePath:"syntax.string",onColorChange:m,color:a.syntax.string,defaultColor:k.a.syntax.string}),y.a.createElement(_,{label:"Regexp literals as well as escapes within strings",themePath:"syntax.regexp",onColorChange:m,color:a.syntax.regexp,defaultColor:k.a.syntax.regexp}),y.a.createElement(_,{label:"Constants",themePath:"syntax.constant",onColorChange:m,color:a.syntax.constant,defaultColor:k.a.syntax.constant}),y.a.createElement(_,{label:"Entities",themePath:"syntax.entity",onColorChange:m,color:a.syntax.entity,defaultColor:k.a.syntax.entity}),y.a.createElement(_,{label:"'this', 'ns', types, and tags",themePath:"syntax.tag",onColorChange:m,color:a.syntax.tag,defaultColor:k.a.syntax.tag}),y.a.createElement(_,{label:"Netscript functions and constructors",themePath:"syntax.markup",onColorChange:m,color:a.syntax.markup,defaultColor:k.a.syntax.markup}),y.a.createElement(_,{label:"Errors",themePath:"syntax.error",onColorChange:m,color:a.syntax.error,defaultColor:k.a.syntax.error}),y.a.createElement(_,{label:"Comments",themePath:"syntax.comment",onColorChange:m,color:a.syntax.comment,defaultColor:k.a.syntax.comment})))),y.a.createElement(c.a,{sx:{p:1}},y.a.createElement(s.a,{multiline:!0,fullWidth:!0,maxRows:10,label:"import / export theme",value:JSON.stringify(a,void 0,2),onChange:function(t){try{const e=JSON.parse(t.target.value);if("object"!=typeof e)return;o(e)}catch(t){}}}),y.a.createElement(f.a,{sx:{mt:1}},y.a.createElement(u.a,{onClick:()=>{b.a.EditorTheme={...a},t.onClose()},startIcon:y.a.createElement(r.a,null)},"Save"),y.a.createElement(u.a,{onClick:()=>{o(k.a),n()},startIcon:y.a.createElement(i.a,null)},"Reset to default"))))}},,function(t,e,n){"use strict";e.a='/**\n * @public\n */\ntype FilenameOrPID = number | string;\n\n/**\n * @public\n */\ninterface Player {\n hacking: number;\n hp: number;\n max_hp: number;\n strength: number;\n defense: number;\n dexterity: number;\n agility: number;\n charisma: number;\n intelligence: number;\n hacking_chance_mult: number;\n hacking_speed_mult: number;\n hacking_money_mult: number;\n hacking_grow_mult: 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_mult: number;\n strength_mult: number;\n defense_mult: number;\n dexterity_mult: number;\n agility_mult: number;\n charisma_mult: number;\n hacking_exp_mult: number;\n strength_exp_mult: number;\n defense_exp_mult: number;\n dexterity_exp_mult: number;\n agility_exp_mult: number;\n charisma_exp_mult: number;\n company_rep_mult: number;\n faction_rep_mult: number;\n numPeopleKilled: number;\n money: number;\n city: string;\n location: string;\n companyName: string;\n crime_money_mult: number;\n crime_success_mult: number;\n isWorking: boolean;\n workType: string;\n currentWorkFactionName: string;\n currentWorkFactionDescription: string;\n workHackExpGainRate: number;\n workStrExpGainRate: number;\n workDefExpGainRate: number;\n workDexExpGainRate: number;\n workAgiExpGainRate: number;\n workChaExpGainRate: number;\n workRepGainRate: number;\n workMoneyGainRate: number;\n workMoneyLossRate: number;\n workHackExpGained: number;\n workStrExpGained: number;\n workDefExpGained: number;\n workDexExpGained: number;\n workAgiExpGained: number;\n workChaExpGained: number;\n workRepGained: number;\n workMoneyGained: number;\n createProgramName: string;\n createProgramReqLvl: number;\n className: string;\n crimeType: string;\n work_money_mult: number;\n hacknet_node_money_mult: number;\n hacknet_node_purchase_cost_mult: number;\n hacknet_node_ram_cost_mult: number;\n hacknet_node_core_cost_mult: number;\n hacknet_node_level_cost_mult: number;\n hasWseAccount: boolean;\n hasTixApiAccess: boolean;\n has4SData: boolean;\n has4SDataTixApi: boolean;\n bladeburner_max_stamina_mult: number;\n bladeburner_stamina_gain_mult: number;\n bladeburner_analysis_mult: number;\n bladeburner_success_chance_mult: number;\n bitNodeN: number;\n totalPlaytime: number;\n playtimeSinceLastAug: number;\n playtimeSinceLastBitnode: number;\n jobs: any;\n factions: string[];\n tor: boolean;\n hasCorporation: boolean;\n inBladeburner: boolean;\n entropy: number;\n}\n\n/**\n * @public\n */\nexport interface RunningScript {\n /** Arguments the script was called with */\n args: string[];\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_mult?: number;\n /** Multiplier to strength skill */\n strength_mult?: number;\n /** Multiplier to defense skill */\n defense_mult?: number;\n /** Multiplier to dexterity skill */\n dexterity_mult?: number;\n /** Multiplier to agility skill */\n agility_mult?: number;\n /** Multiplier to charisma skill */\n charisma_mult?: number;\n /** Multiplier to hacking experience gain rate */\n hacking_exp_mult?: number;\n /** Multiplier to strength experience gain rate */\n strength_exp_mult?: number;\n /** Multiplier to defense experience gain rate */\n defense_exp_mult?: number;\n /** Multiplier to dexterity experience gain rate */\n dexterity_exp_mult?: number;\n /** Multiplier to agility experience gain rate */\n agility_exp_mult?: number;\n /** Multiplier to charisma experience gain rate */\n charisma_exp_mult?: number;\n /** Multiplier to chance of successfully performing a hack */\n hacking_chance_mult?: number;\n /** Multiplier to hacking speed */\n hacking_speed_mult?: number;\n /** Multiplier to amount of money the player gains from hacking */\n hacking_money_mult?: number;\n /** Multiplier to amount of money injected into servers using grow */\n hacking_grow_mult?: number;\n /** Multiplier to amount of reputation gained when working */\n company_rep_mult?: number;\n /** Multiplier to amount of reputation gained when working */\n faction_rep_mult?: number;\n /** Multiplier to amount of money gained from crimes */\n crime_money_mult?: number;\n /** Multiplier to crime success rate */\n crime_success_mult?: number;\n /** Multiplier to amount of money gained from working */\n work_money_mult?: number;\n /** Multiplier to amount of money produced by Hacknet Nodes */\n hacknet_node_money_mult?: number;\n /** Multiplier to cost of purchasing a Hacknet Node */\n hacknet_node_purchase_cost_mult?: number;\n /** Multiplier to cost of ram for a Hacknet Node */\n hacknet_node_ram_cost_mult?: number;\n /** Multiplier to cost of core for a Hacknet Node */\n hacknet_node_core_cost_mult?: number;\n /** Multiplier to cost of leveling up a Hacknet Node */\n hacknet_node_level_cost_mult?: number;\n /** Multiplier to Bladeburner max stamina */\n bladeburner_max_stamina_mult?: number;\n /** Multiplier to Bladeburner stamina gain rate */\n bladeburner_stamina_gain_mult?: number;\n /** Multiplier to effectiveness in Bladeburner Field Analysis */\n bladeburner_analysis_mult?: number;\n /** Multiplier to success chance in Bladeburner contracts/operations */\n bladeburner_success_chance_mult?: 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[];\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 * Short summary of the players skills.\n * @public\n */\nexport interface PlayerSkills {\n /** Hacking level */\n hacking: number;\n /** Strength level */\n strength: number;\n /** Defense level */\n defense: number;\n /** Dexterity level */\n dexterity: number;\n /** Agility level */\n agility: number;\n /** Charisma level */\n charisma: number;\n /** Intelligence level */\n intelligence: 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 CharacterInfo {\n /** Current BitNode number */\n bitnode: number;\n /** Name of city you are currently in */\n city: string;\n /** Array of factions you are currently a member of */\n factions: string[];\n /** Current health points */\n hp: number;\n /** Array of all jobs */\n jobs: string[];\n /** Array of job positions for all companies you are employed at. Same order as \'jobs\' */\n jobTitles: string[];\n /** Maximum health points */\n maxHp: number;\n /** Boolean indicating whether or not you have a tor router */\n tor: boolean;\n /** Object with many of the player\'s multipliers from Augmentations/Source Files */\n mult: CharacterMult;\n /** Timed worked in ms */\n timeWorked: number;\n /** Hacking experience earned so far from work */\n workHackExpGain: number;\n /** Str experience earned so far from work */\n workStrExpGain: number;\n /** Def experience earned so far from work */\n workDefExpGain: number;\n /** Dex experience earned so far from work */\n workDexExpGain: number;\n /** Agi experience earned so far from work */\n workAgiExpGain: number;\n /** Cha experience earned so far from work */\n workChaExpGain: number;\n /** Reputation earned so far from work, if applicable */\n workRepGain: number;\n /** Money earned so far from work, if applicable */\n workMoneyGain: number;\n /** total hacking exp */\n hackingExp: number;\n /** total strength exp */\n strengthExp: number;\n /** total defense exp */\n defenseExp: number;\n /** total dexterity exp */\n dexterityExp: number;\n /** total agility exp */\n agilityExp: number;\n /** total charisma exp */\n charismaExp: 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 "Slum Snakes": GangOtherInfoObject;\n Tetrads: GangOtherInfoObject;\n "The Syndicate": GangOtherInfoObject;\n "The Dark Army": GangOtherInfoObject;\n "Speakers for the Dead": GangOtherInfoObject;\n NiteSec: GangOtherInfoObject;\n "The Black Hand": 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 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 /** Current hp of the sleeve */\n hp: number;\n /** Max hp of the sleeve */\n maxHp: number;\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 /** Time spent on the current task in milliseconds */\n timeWorked: number;\n /** Earnings synchronized to other sleeves */\n earningsForSleeves: SleeveWorkGains;\n /** Earnings synchronized to the player */\n earningsForPlayer: SleeveWorkGains;\n /** Earnings for this sleeve */\n earningsForTask: SleeveWorkGains;\n /** Faction or company reputation gained for the current task */\n workRepGain: number;\n}\n\n/**\n * Object representing a sleeve current task.\n * @public\n */\nexport interface SleeveTask {\n /** Task type */\n task: string;\n /** Crime currently attempting, if any */\n crime: string;\n /** Location of the task, if any */\n location: string;\n /** Stat being trained at the gym, if any */\n gymStatType: string;\n /** Faction work type being performed, if any */\n factionWorkType: string;\n /** Class being taken at university, if any */\n className: string;\n}\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 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 buy(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 sell(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 short(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 actions 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 actions 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 * @returns The number of milliseconds it takes to attempt the specified crime.\n */\n commitCrime(crime: string): 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 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 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 * Returns an object with the Player’s stats.\n * @deprecated use getPlayer\n *\n * @remarks\n * RAM cost: 0.5 GB * 16/4/1\n *\n *\n * @example\n * ```ts\n * res = getStats();\n * print(\'My charisma level is: \' + res.charisma);\n * ```\n * @returns Object with the Player’s stats.\n */\n getStats(): PlayerSkills;\n\n /**\n * Returns an object with various information about your character.\n * @deprecated use getPlayer\n *\n * @remarks\n * RAM cost: 0.5 GB * 16/4/1\n *\n *\n * @returns Object with various information about your character.\n */\n getCharacterInformation(): CharacterInfo;\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/**\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 it 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 cores are successfully purchased, 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 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 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 * @returns Number of hashes required for the specified upgrade.\n */\n hashCost(upgName: string): 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 * @returns True if the upgrade is successfully purchased, and false otherwise..\n */\n spendHashes(upgName: string, upgTarget?: string): 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.\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 Number of skill points needed to upgrade the specified skill.\n */\n getSkillUpgradeCost(name: string): number;\n\n /**\n * Upgrade skill.\n * @remarks\n * RAM cost: 4 GB\n *\n * Attempts to upgrade the specified Bladeburner skill.\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 * @returns true if the skill is successfully upgraded, and false otherwise.\n */\n upgradeSkill(name: string): 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” (seconds) 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 - Host 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(answer: string[] | number, filename: string, host?: string, opts?: CodingAttemptOptions): 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 - Host 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 - Host 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\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): any;\n\n /**\n * Get the number of attempt 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 - Host 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” (seconds) 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 * 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 * 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 /** 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}\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 InfiltrationLocation {\n location: any;\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(): string[];\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 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: 0 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 * @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: any[]): 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: any[]): 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 will return 0 without running the script.\n * However, running this function with a negative numThreads argument 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: Array): 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 0 or a negative numThreads argument 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: Array): 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 * @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[]): 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[]): 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", "helios", "home");\n *\n * //Tries to copy three files from rothman-uni to home computer:\n * files = ["foo1.lit", "foo2.script", "foo3.script"];\n * scp(files, "rothman-uni", "home");\n * ```\n * @example\n * ```ts\n * // NS2:\n * //Copies foo.lit from the helios server to the home computer:\n * await ns.scp("foo.lit", "helios", "home");\n *\n * //Tries to copy three files from rothman-uni to home computer:\n * files = ["foo1.lit", "foo2.script", "foo3.script"];\n * await ns.scp(files, "rothman-uni", "home");\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 * await ns.scp(files, "home", server);\n * ```\n * @param files - Filename or an array of filenames of script/literature files to copy.\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 * @param destination - Host of the destination server, which is the server to which the file will be copied.\n * @returns True if the script/literature file is successfully copied over and false otherwise. If the files argument is an array then this function will return true if at least one of the files in the array is successfully copied.\n */\n scp(files: string | string[], destination: string): Promise;\n\n /**\n * {@inheritDoc NS.(scp:1)}\n * @example\n * ```ts\n * // NS1:\n * //Copies foo.lit from the helios server to the home computer:\n * scp("foo.lit", "helios", "home");\n *\n * //Tries to copy three files from rothman-uni to home computer:\n * files = ["foo1.lit", "foo2.script", "foo3.script"];\n * scp(files, "rothman-uni", "home");\n * ```\n * @example\n * ```ts\n * // NS2:\n * //Copies foo.lit from the helios server to the home computer:\n * await ns.scp("foo.lit", "helios", "home");\n *\n * //Tries to copy three files from rothman-uni to home computer:\n * files = ["foo1.lit", "foo2.script", "foo3.script"];\n * await ns.scp(files, "rothman-uni", "home");\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 * await ns.scp(files, "home", server);\n * ```\n */\n scp(files: string | string[], source: string, destination: string): Promise;\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[]): 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(filename?: FilenameOrPID, hostname?: string, ...args: (string | number)[]): 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).\n *\n * This function will write data to that text file. If the specified text file does not exist,\n * then it will be created. The third argument mode, defines how the data will be written to\n * the text 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 text 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 text file.\n *\n * @param handle - Filename of the text file that will be written to.\n * @param data - Data to write.\n * @param mode - Defines the write mode. Only valid when writing to text files.\n */\n write(handle: string, data?: string[] | number | string, mode?: "w" | "a"): Promise;\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).\n *\n * This function will return the data in the specified text\n * file. If the text file does not exist, an empty string will be returned.\n *\n * @param handle - Filename to read from.\n * @returns Data in the specified text file.\n */\n read(handle: string): any;\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): any;\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): any;\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 *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 function takes in an optional hackLvl parameter that can be specified to see what the hack time would be at different hacking levels.\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. Returns Infinity if called on a Hacknet Server.\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 function takes in an optional hackLvl parameter that can be specified to see what the grow time would be at different hacking levels.\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. Returns Infinity if called on a Hacknet Server.\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 function takes in an optional hackLvl parameter that can be specified to see what the weaken time would be at different hacking levels.\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. Returns Infinity if called on a Hacknet Server.\n */\n getWeakenTime(host: string): 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 * This function can also be called with no arguments.\n * If called with no arguments, then this function will return 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 * @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(): [number, number];\n\n /**\n * {@inheritDoc NS.(getScriptIncome:1)}\n */\n getScriptIncome(script: string, host: string, ...args: string[]): 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(): number;\n\n /**\n * {@inheritDoc NS.(getScriptExpGain:1)}\n */\n getScriptExpGain(script: string, host: string, ...args: string[]): 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: any): 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: any, 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, .ns, .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 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 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.ns\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[]][]): any;\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 * @returns A promise that is fulfilled when the assignment is complete.\n */\n assignJob(divisionName: string, cityName: string, employeeName: string, job: string): Promise;\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 Amount of happiness increased.\n */\n throwParty(divisionName: string, cityName: string, costPerEmployee: number): Promise;\n /**\n * Buy coffee for your employees\n * @param divisionName - Name of the division\n * @param cityName - Name of the city\n * @returns A promise that is fulfilled when the coffee is served.\n */\n buyCoffee(divisionName: string, cityName: string): Promise;\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 A promise that is fulfilled when the assignment is complete.\n */\n setAutoJobAssignment(divisionName: string, cityName: string, job: string, amount: number): Promise;\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: any, acityName: any, 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: any, acityName: any): 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 * 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 * @param amountShares - Amount of shares to bribe\n * @returns True if successful, false if not\n */\n bribe(factionName: string, amountCash: number, amountShares: 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 percent - Percent of profit to issue as dividends.\n */\n issueDividends(percent: 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 /** 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 */\ninterface 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 */\ninterface 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 /** 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[]][]): any;\n}\n'},,,,,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(787),r=n(0),i=n(1),o=n(19);function s(t){const e=function(t,e){let n=-1;for(let a=0;a{if(a<=e+1)return r.createElement(i.a,{key:a},"[",n.fulfilled(t.player)?"x":" ","] ",n.title)});return r.createElement(r.Fragment,null,r.createElement(i.a,{variant:"h4"},"Milestones"),r.createElement(o.a,{mx:2},r.createElement(i.a,null,"Milestones don't reward you for completing them. They are here to guide you if you're lost. They will reset when you install Augmentations."),r.createElement("br",null),r.createElement(i.a,null,"Completing fl1ght.exe"),n))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return k}));var a=n(0),r=n.n(a),i=n(1),o=n(248),s=n(97),l=n(150),c=n(121),f=n(144),u=n(19),m=n(246),h=n(1344),d=n(328),p=n(592),g=n(578),y=n(115),b=n.n(y);function E({terminal:t}){return r.a.createElement(i.a,{color:"primary",paragraph:!1},t.getProgressText())}const v=Object(c.a)(t=>Object(f.a)({nopadding:{padding:t.spacing(0)},preformatted:{whiteSpace:"pre-wrap",overflowWrap:"anywhere",margin:t.spacing(0)},list:{padding:t.spacing(0),height:"100%"},success:{whiteSpace:"pre-wrap",overflowWrap:"anywhere",margin:t.spacing(0),color:t.colors.success},error:{whiteSpace:"pre-wrap",overflowWrap:"anywhere",margin:t.spacing(0),color:t.palette.error.main},primary:{whiteSpace:"pre-wrap",overflowWrap:"anywhere",margin:t.spacing(0),color:t.palette.primary.main},info:{whiteSpace:"pre-wrap",overflowWrap:"anywhere",margin:t.spacing(0),color:t.palette.info.main},warning:{whiteSpace:"pre-wrap",overflowWrap:"anywhere",margin:t.spacing(0),color:t.palette.warning.main}}));function k({terminal:t,router:e,player:n}){const c=Object(a.useRef)(null),f=Object(a.useState)(0)[1],[y,k]=Object(a.useState)(0);function _(){const t=c.current;if(null!==t)return window.setTimeout(()=>t.scrollIntoView(!0),50)}function w(t){return{error:x.error,success:x.success,info:x.info,warn:x.warning}[t]||x.primary}function S(t){const e={0:"#404040",1:"#ff0000",2:"#00ff00",3:"#ffff00",4:"#0000ff",5:"#ff00ff",6:"#00ffff",7:"#ffffff"},n={0:"#000000",1:"#800000",2:"#008000",3:"#808000",4:"#000080",5:"#800080",6:"#008080",7:"#c0c0c0"},a={};if(null===t||"0"===t)return a;const r=t.split(";").map(t=>parseInt(t)).filter((t,e,n)=>5!=t||0==e||38!=n[e-1]&&48!=n[e-1]);let i=null;return r.forEach(t=>{null!==i?(a[i]=(t=>{if(0<=t&&t<8)return e[t];if(8<=t&&t<16)return n[t];if(16<=t&&t<232){const e=t-16,n=Math.floor(e/36),a=Math.floor(e%36/6),r=Math.floor(e%6/1);return`rgb(${n<=0?0:55+40*n}, ${a<=0?0:55+40*a}, ${r<=0?0:55+40*r})`}if(232<=t&&t<256){const e=10*(t-232)+8;return`rgb(${e}, ${e}, ${e})`}return"initial"})(t),i=null):1==t?a.fontWeight="bold":4==t?a.textDecoration="underline":30<=t&&t<38?e[t%10]&&(a.color=e[t%10]):40<=t&&t<48?n[t%10]&&(a.backgroundColor=n[t%10]):38==t?i="color":48==t&&(i="backgroundColor")}),void 0!==a.backgroundColor&&(a.display="inline-block"),a}Object(a.useEffect)(()=>{const t=b.a.debounce(async()=>{f(t=>t+1)},25,{maxWait:50}),e=d.b.subscribe(t);return()=>{t.cancel(),e()}},[]),Object(a.useEffect)(()=>{const t=b.a.debounce(async()=>{k(t=>t+1)},25,{maxWait:50}),e=d.a.subscribe(t);return()=>{t.cancel(),e()}},[]),_(),Object(a.useEffect)(()=>{let t;const e=setTimeout(()=>{var e;t=null!==(e=_())&&void 0!==e?e:0},50);return()=>{clearTimeout(e),clearTimeout(t)}},[]);const x=v();return r.a.createElement(r.a.Fragment,null,r.a.createElement(u.a,{width:"100%",minHeight:"100vh",display:"flex",alignItems:"flex-end"},r.a.createElement(o.a,{key:y,id:"terminal",classes:{root:x.list}},t.outputHistory.map((e,a)=>e instanceof m.b?r.a.createElement(s.a,{key:a,classes:{root:x.nopadding}},r.a.createElement(i.a,{classes:{root:w(e.color)},paragraph:!1},function(t){const e=[];if("string"==typeof t.text){const n=new RegExp("\\[(?.*?)m","ug"),a=[{0:"",index:0,groups:{code:null}},...t.text.matchAll(n),null];a.length>2&&a.slice(0,-1).forEach((n,r)=>{const i=a[r+1];if(!n||void 0===n.index||void 0===n.groups)return;const o=n.index+n[0].length,s=i?i.index:t.text.length,l=t.text.slice(o,s);o!==s&&e.push({code:n.groups.code,text:l})})}return 0===e.length&&e.push({code:null,text:t.text}),r.a.createElement(i.a,{classes:{root:w(t.color)},paragraph:!1},e.map((t,e)=>{const n=S(t.code);return b.a.isEmpty(n)?t.text:r.a.createElement(i.a,{key:e,paragraph:!1,component:"span",sx:n},t.text)}))}(e))):e instanceof m.c?r.a.createElement(s.a,{key:a,classes:{root:x.nopadding}},r.a.createElement(i.a,{classes:{root:x.preformatted},paragraph:!1},e.raw)):e instanceof m.a?r.a.createElement(s.a,{key:a,classes:{root:x.nopadding}},r.a.createElement(i.a,null,e.dashes,"> "),r.a.createElement(l.a,{classes:{root:x.preformatted},color:"secondary",paragraph:!1,onClick:()=>t.connectToServer(n,e.hostname)},r.a.createElement(i.a,null,e.hostname))):void 0),null!==t.action&&r.a.createElement(s.a,{classes:{root:x.nopadding}},r.a.createElement(E,{terminal:t})," ")),r.a.createElement("div",{ref:c})),r.a.createElement(u.a,{position:"sticky",bottom:0,width:"100%",px:0},r.a.createElement(h.a,{player:n,router:e,terminal:t})),r.a.createElement(p.b,null),r.a.createElement(g.b,null))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return y}));var a=n(0),r=n.n(a),i=n(1),o=n(121),s=n(144),l=n(45),c=n(799),f=n(76),u=n(27),m=n(1345),h=n(1347),d=n(6);const p=Object(o.a)(t=>Object(s.a)({textfield:{margin:t.spacing(0)},input:{backgroundColor:t.colors.backgroundprimary},nopadding:{padding:t.spacing(0)},preformatted:{whiteSpace:"pre-wrap",margin:t.spacing(0)},list:{padding:t.spacing(0),height:"100%"}}));let g="";function y({terminal:t,router:e,player:n}){const o=Object(a.useRef)(null),[s,y]=Object(a.useState)(g),[b,E]=Object(a.useState)(),[v,k]=Object(a.useState)([]),_=p();function w(t,e){g=t,y(t),e&&E({postUpdate:e})}function S(t){const e=o.current;if(!e)return;const n=s.length,a=e.selectionStart;if(null===a)return;const r=e.value;switch(t.toLowerCase()){case"backspace":a>0&&a<=n+1&&w(r.substr(0,a-1)+r.substr(a));break;case"deletewordbefore":for(let t=a-1;t>-2;--t)if((r.charAt(t)===u.a.SPACE||-1===t)&&t!==a-1)return void w(r.substr(0,t+1)+r.substr(a),()=>{const e=o.current;null==e||e.setSelectionRange(t+1,t+1)});break;case"deletewordafter":for(let t=a+1;t<=s.length+1;++t)if(r.charAt(t)===u.a.SPACE||t===s.length+1)return void w(r.substr(0,a)+r.substr(t+1),()=>{const t=o.current;null==t||t.setSelectionRange(a,a)});break;case"clearafter":w(r.substr(0,a));break;case"clearbefore":w(r.substr(a),()=>x("home"))}}function x(t){const e=o.current;if(!e)return;const n=s.length,a=e.selectionStart;if(null!==a)switch(t.toLowerCase()){case"home":e.setSelectionRange(0,0);break;case"end":e.setSelectionRange(n,n);break;case"prevchar":a>0&&e.setSelectionRange(a-1,a-1);break;case"prevword":for(let t=a-2;t>=0;--t)if(e.value.charAt(t)===u.a.SPACE)return void e.setSelectionRange(t+1,t+1);e.setSelectionRange(0,0);break;case"nextchar":e.setSelectionRange(a+1,a+1);break;case"nextword":for(let t=a+1;t<=n;++t)if(e.value.charAt(t)===u.a.SPACE)return void e.setSelectionRange(t,t);e.setSelectionRange(n,n);break;default:console.warn("Invalid loc argument in Terminal.moveTextCursor()")}}return 0===t.commandHistory.length&&n.terminalCommandHistory.length>0&&(t.commandHistory=n.terminalCommandHistory,t.commandHistoryIndex=t.commandHistory.length),Object(a.useEffect)(()=>{null!=b&&b.postUpdate&&(b.postUpdate(),E(null))},[b]),Object(a.useEffect)(()=>{function a(a){if(t.contractOpen)return;if(null!==t.action&&a.key===u.a.C&&a.ctrlKey)return void t.finishAction(e,n,!0);const r=o.current;a.ctrlKey||a.metaKey||a.key===u.a.C&&(a.ctrlKey||a.metaKey)||r&&r.focus()}return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)}),r.a.createElement(r.a.Fragment,null,r.a.createElement(f.a,{fullWidth:!0,color:null===t.action?"primary":"secondary",autoFocus:!0,disabled:null!==t.action,autoComplete:"off",value:s,classes:{root:_.textfield},onChange:function(t){w(t.target.value),k([])},inputRef:o,InputProps:{id:"terminal-input",className:_.input,startAdornment:r.a.createElement(i.a,{color:null===t.action?"primary":"secondary",flexShrink:0},"[",n.getCurrentServer().hostname," ~",t.cwd(),"]> "),spellCheck:!1,onBlur:()=>k([]),onKeyDown:async function(a){if(a.key===u.a.ENTER&&""!==s)return a.preventDefault(),t.print(`[${n.getCurrentServer().hostname} ~${t.cwd()}]> ${s}`),t.executeCommands(e,n,s),void w("");if(a.key===u.a.TAB&&""!==s){a.preventDefault();let e=s;const r=e.lastIndexOf(";");-1!==r&&(e=e.slice(r+1)),e=e.trim(),e=e.replace(/\s\s+/g," ");const i=e.split(" ");let o=i.length-2;o<-1&&(o=0);const l=await Object(m.a)(n,e,o,t.cwd());if(0==l.length)return;let c="",f="";if(0==i.length)return;1==i.length?f=i[0]:2==i.length?(f=i[0],c=i[1]):3==i.length?(f=i[0]+" "+i[1],c=i[2]):(c=i.pop()+"",f=i.join(" "));let u=Object(h.a)(f,c,l,s);"string"==typeof u&&""!==u&&(u.endsWith(" ")||u.endsWith("/")||1!==l.length||(u+=" "),w(u)),Array.isArray(u)&&k(u)}if(a.key===u.a.L&&a.ctrlKey&&(a.preventDefault(),t.clear()),a.key===u.a.UP_ARROW||d.a.EnableBashHotkeys&&a.key===u.a.P&&a.ctrlKey){d.a.EnableBashHotkeys&&a.preventDefault();const e=t.commandHistoryIndex,n=t.commandHistory.length;if(0==n)return;(e<0||e>n)&&(t.commandHistoryIndex=n),0!=e&&--t.commandHistoryIndex;w(t.commandHistory[t.commandHistoryIndex]);const r=o.current;r&&setTimeout((function(){r.selectionStart=r.selectionEnd=1e4}),10)}if(a.key===u.a.DOWN_ARROW||d.a.EnableBashHotkeys&&a.key===u.a.M&&a.ctrlKey){d.a.EnableBashHotkeys&&a.preventDefault();const e=t.commandHistoryIndex,n=t.commandHistory.length;if(0==n)return;if((e<0||e>n)&&(t.commandHistoryIndex=n),e==n||e==n-1)t.commandHistoryIndex=n,w("");else{++t.commandHistoryIndex;w(t.commandHistory[t.commandHistoryIndex])}}d.a.EnableBashHotkeys&&(a.code===u.b.A&&a.ctrlKey&&(a.preventDefault(),x("home")),a.code===u.b.E&&a.ctrlKey&&(a.preventDefault(),x("end")),a.code===u.b.B&&a.ctrlKey&&(a.preventDefault(),x("prevchar")),a.code===u.b.B&&a.altKey&&(a.preventDefault(),x("prevword")),a.code===u.b.F&&a.ctrlKey&&(a.preventDefault(),x("nextchar")),a.code===u.b.F&&a.altKey&&(a.preventDefault(),x("nextword")),a.code!==u.b.H&&a.code!==u.b.D||!a.ctrlKey||(S("backspace"),a.preventDefault()),a.code===u.b.W&&a.ctrlKey&&(a.preventDefault(),S("deletewordbefore")),a.code===u.b.D&&a.altKey&&(a.preventDefault(),S("deletewordafter")),a.code===u.b.U&&a.ctrlKey&&(a.preventDefault(),S("clearbefore")),a.code===u.b.K&&a.ctrlKey&&(a.preventDefault(),S("clearafter")))}}}),r.a.createElement(c.a,{open:v.length>0,anchorEl:o.current,placement:"top-start"},r.a.createElement(l.a,{sx:{m:1,p:2}},r.a.createElement(i.a,{classes:{root:_.preformatted},color:"primary",paragraph:!1},"Possible autocomplete candidates:"),r.a.createElement(i.a,{classes:{root:_.preformatted},color:"primary",paragraph:!1},v.join(" ")))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var a=n(83),r=n(642),i=n(160),o=n(258),s=n(24),l=n(46),c=n(485),f=n(538),u=n(100),m=n(643),h=n(644),d=n(318);const p=["alias","analyze","backdoor","cat","cd","check","clear","cls","connect","cp","download","expr","free","grow","hack","help","home","hostname","ifconfig","kill","killall","ls","lscpu","mem","mv","nano","ps","rm","run","scan-analyze","scan","scp","sudov","tail","theme","top","vim","weaken"];async function g(t,e,n,g=""){e=Object(i.h)(e);let y=[];y=y.concat(Object.keys(i.b));const b=t.getCurrentServer(),E=t.getHomeComputer();let v="",k=null;function _(){for(const t of b.contracts)y.push(t.fn)}function w(){for(const t of b.messages)t.endsWith(".msg")||y.push(t)}function S(){for(const t of E.programs)y.push(t)}function x(){for(const t of b.scripts){const e=O(t.filename);e&&y.push(e)}}function C(){for(const t of b.textFiles){const e=O(t.fn);e&&y.push(e)}}function L(){const t=Object(r.b)(b,null==k?"/":k);for(let e=0;eb.serversOnNetwork.includes(t.hostname)||t instanceof l.a&&t.backdoorInstalled).map(t=>t.hostname);if(M("nano")||M("vim"))return x(),C(),L(),y;if(M("rm"))return x(),S(),w(),C(),_(),L(),y;const R=await async function(){if(!(M("run")||M("tail")||M("kill")||e.startsWith("./")))return;let n=e;e.startsWith("./")&&(n="run "+e.slice(2));const a=Object(c.b)(n);if(0===a.length)return;const r=Object(c.a)(a[a.length-1]),i=r[1]+"";if(!Object(u.a)(i))return;if(i.endsWith(".script"))return;const o=b.scripts.find(t=>{const e=i.replace(/^\.\//g,"");return O(t.filename)===e||t.filename==="/"+e});if(!o)return;o.module||await Object(m.a)(t,o,b.scripts);const l=await o.module;if(!l.autocomplete)return;const f={"--tail":Boolean,"-t":Number},p=d(f,{permissive:!0,argv:r.slice(2)}),g=Object(h.a)(p._),y={servers:Object(s.c)().map(t=>t.hostname),scripts:b.scripts.map(t=>t.filename),txts:b.textFiles.map(t=>t.fn),flags:t=>{v=t.map(t=>1===t[0].length?"-"+t[0]:"--"+t[0]);try{return g(t)}catch(t){return}}};let E=[],v=[];return E=E.concat(l.autocomplete(y,p._)),E.concat(v)}();if(R)return R;if(e.startsWith("./")){for(const t of b.scripts){const e=O(t.filename);e&&y.push(e)}for(const t of b.programs){const e=O(t);e&&y.push(e)}for(const t of b.contracts){const e=O(t.fn);e&&y.push(e)}return y}return M("run")&&(x(),S(),_(),L()),M("kill")||M("tail")||M("mem")||M("check")?(x(),L(),y):M("cat")?(function(){for(const t of b.messages)t.endsWith(".msg")&&y.push(t)}(),w(),C(),L(),x(),y):M("download")||M("mv")?(x(),C(),L(),y):M("cd")?(L(),y):(M("ls")&&0===n&&L(),M("help")?Object.keys(f.a):y)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));class a{constructor(t,e,n){this.filename=t,this.url=e,this.moduleSequenceNumber=n}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(22);function r(t,e,n,r){if(n.constructor!==Array)return;if(!Object(a.c)(n))return;if(""===e)for(let e=n.length-1;e>=0;--e)n[e].toLowerCase().startsWith(t.toLowerCase())||n.splice(e,1);else for(let t=n.length-1;t>=0;--t)n[t].toLowerCase().startsWith(e.toLowerCase())||n.splice(t,1);const i=r.lastIndexOf(";");let o="";if(0!==n.length){if(1===n.length)return o=""===e?n[0]:t+" "+n[0],-1===i?o:r.slice(0,i+1)+" "+o;{const o=Object(a.h)(n);return""===e?o===t?n:-1===i?o:`${r.slice(0,i+1)} ${o}`:o===e?n:-1==i?`${t} ${o}`:`${r.slice(0,i+1)} ${t} ${o}`}}}},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(150),s=n(19),l=n(8),c=n(252);function f(t){const[e,n]=Object(a.useState)(!1);return r.a.createElement(r.a.Fragment,null,r.a.createElement(i.a,{variant:"h4"},"Tutorial / Documentation"),r.a.createElement(s.a,{m:2},r.a.createElement(l.a,{onClick:()=>n(!0)},"Soft reset and Restart tutorial"),r.a.createElement(c.a,{open:e,onClose:()=>n(!1),onConfirm:t.reactivateTutorial,confirmationText:"This will reset all your stats to 1 and money to 1k. Are you sure?"}),r.a.createElement(o.a,{color:"primary",target:"_blank",href:"https://bitburner.readthedocs.io/en/latest/guidesandtips/gettingstartedguideforbeginnerprogrammers.html"},r.a.createElement(i.a,null,"Getting Started")),r.a.createElement("br",null),r.a.createElement(o.a,{color:"primary",target:"_blank",href:"https://bitburner.readthedocs.io/en/latest/basicgameplay/servers.html"},r.a.createElement(i.a,null,"Servers & Networking")),r.a.createElement("br",null),r.a.createElement(o.a,{color:"primary",target:"_blank",href:"https://bitburner.readthedocs.io/en/latest/basicgameplay/hacking.html"},r.a.createElement(i.a,null,"Hacking")),r.a.createElement("br",null),r.a.createElement(o.a,{color:"primary",target:"_blank",href:"https://bitburner.readthedocs.io/en/latest/basicgameplay/scripts.html"},r.a.createElement(i.a,null,"Scripts")),r.a.createElement("br",null),r.a.createElement(o.a,{color:"primary",target:"_blank",href:"https://bitburner.readthedocs.io/en/latest/netscript.html"},r.a.createElement(i.a,null,"Netscript Programming Language")),r.a.createElement("br",null),r.a.createElement(o.a,{color:"primary",target:"_blank",href:"https://bitburner.readthedocs.io/en/latest/basicgameplay/world.html"},r.a.createElement(i.a,null,"Traveling")),r.a.createElement("br",null),r.a.createElement(o.a,{color:"primary",target:"_blank",href:"https://bitburner.readthedocs.io/en/latest/basicgameplay/companies.html"},r.a.createElement(i.a,null,"Companies")),r.a.createElement("br",null),r.a.createElement(o.a,{color:"primary",target:"_blank",href:"https://bitburner.readthedocs.io/en/latest/basicgameplay/infiltration.html"},r.a.createElement(i.a,null,"Infiltration")),r.a.createElement("br",null),r.a.createElement(o.a,{color:"primary",target:"_blank",href:"https://bitburner.readthedocs.io/en/latest/basicgameplay/factions.html"},r.a.createElement(i.a,null,"Factions")),r.a.createElement("br",null),r.a.createElement(o.a,{color:"primary",target:"_blank",href:"https://bitburner.readthedocs.io/en/latest/basicgameplay/augmentations.html"},r.a.createElement(i.a,null,"Augmentations")),r.a.createElement("br",null),r.a.createElement(o.a,{color:"primary",target:"_blank",href:"https://bitburner.readthedocs.io/en/latest/shortcuts.html"},r.a.createElement(i.a,null,"Keyboard Shortcuts")),r.a.createElement("br",null),r.a.createElement(o.a,{color:"primary",target:"_blank",href:"https://bitburner.readthedocs.io/en/latest/netscript/netscriptlearntoprogram.html#netscript-1-0-vs-netscript-2-0"},r.a.createElement(i.a,null,"NS1 vs NS2 (or .script vs .js)")),r.a.createElement("br",null),r.a.createElement(o.a,{color:"primary",target:"_blank",href:"https://bitburner.readthedocs.io/en/latest/netscript/netscriptfunctions.html"},r.a.createElement(i.a,null,"Simplified list of functions")),r.a.createElement("br",null),r.a.createElement(o.a,{color:"primary",target:"_blank",href:"https://github.com/danielyxie/bitburner/blob/dev/markdown/bitburner.ns.md"},r.a.createElement(i.a,null,"Complete list of functions"))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(0),r=n.n(a),i=n(503),o=n(216),s=n(1350),l=n(1358);function c(t){const e=Object(a.useState)(!1)[1];function n(){e(t=>!t)}Object(a.useEffect)(()=>{const t=setInterval(n,200);return()=>clearInterval(t)},[]);const[c,f]=Object(a.useState)("active");return r.a.createElement(r.a.Fragment,null,r.a.createElement(i.a,{variant:"fullWidth",value:c,onChange:function(t,e){f(e)},sx:{minWidth:"fit-content",maxWidth:"25%"}},r.a.createElement(o.a,{label:"Active",value:"active"}),r.a.createElement(o.a,{label:"Recently Killed",value:"recent"})),"active"===c&&r.a.createElement(s.a,{workerScripts:t.workerScripts}),"recent"===c&&r.a.createElement(l.a,null))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(0),r=n.n(a),i=n(1351),o=n(1352),s=n(1);function l(t){return r.a.createElement(r.a.Fragment,null,r.a.createElement(s.a,null,"This page displays a list of all of your scripts that are currently running across every machine. It also provides information about each script's production. The scripts are categorized by the hostname of the servers on which they are running."),r.a.createElement(i.a,null),r.a.createElement(o.a,t))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var a=n(0),r=n(20),i=n(112),o=n(29),s=n(1),l=n(121),c=n(144),f=n(148),u=n(149),m=n(30),h=n(50);const d=Object(l.a)(t=>Object(c.a)({cell:{borderBottom:"none",padding:t.spacing(1),margin:t.spacing(1),whiteSpace:"nowrap"},size:{width:"1px"}}));function p(){const t=o.b.Player(),e=d(),n=t.scriptProdSinceLastAug/(t.playtimeSinceLastAug/1e3);return a.createElement(f.a,{size:"small",classes:{root:e.size}},a.createElement(u.a,null,a.createElement(h.a,null,a.createElement(m.a,{component:"th",scope:"row",classes:{root:e.cell}},a.createElement(s.a,{variant:"body2"},"Total production since last Augment Installation:")),a.createElement(m.a,{align:"left",classes:{root:e.cell}},a.createElement(s.a,{variant:"body2"},a.createElement(r.a,{money:t.scriptProdSinceLastAug}))),a.createElement(m.a,{align:"left",classes:{root:e.cell}},a.createElement(s.a,{variant:"body2"},"(",a.createElement(i.a,{money:n}),")")))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var a=n(0),r=n.n(a),i=n(1353),o=n(76),s=n(248),l=n(1504),c=n(297),f=n(24),u=n(6),m=n(646),h=n(344),d=n.n(h);function p(t){const[e,n]=Object(a.useState)(""),[h,p]=Object(a.useState)(0),[g,y]=Object(a.useState)(u.a.ActiveScriptsServerPageSize),b=Object(a.useState)(!1)[1];const E={};for(const e of t.workerScripts.values()){const t=Object(f.d)(e.hostname);if(null==t){console.warn("WorkerScript has invalid hostname: "+e.hostname);continue}let n=E[t.hostname];void 0===n&&(E[t.hostname]={server:t,workerScripts:[]},n=E[t.hostname]),void 0!==n&&n.workerScripts.push(e)}const v=Object.values(E).filter(t=>t&&(t.server.hostname.includes(e)||t.server.runningScripts.find(t=>t.filename.includes(e))));function k(){b(t=>!t)}return Object(a.useEffect)(()=>c.a.subscribe(k)),r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,{value:e,onChange:function(t){n(t.target.value),p(0)},autoFocus:!0,InputProps:{startAdornment:r.a.createElement(d.a,null),spellCheck:!1}}),r.a.createElement(s.a,{dense:!0},v.slice(h*g,h*g+g).map(t=>t&&r.a.createElement(i.a,{key:t.server.hostname,server:t.server,workerScripts:t.workerScripts}))),r.a.createElement(l.a,{rowsPerPageOptions:[10,15,20,100],component:"div",count:v.length,rowsPerPage:g,page:h,onPageChange:(t,e)=>{p(e)},onRowsPerPageChange:t=>{u.a.ActiveScriptsServerPageSize=parseInt(t.target.value,10),y(parseInt(t.target.value,10)),p(0)},ActionsComponent:m.a}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var a=n(0),r=n(1),i=n(355),o=n(113),s=n(45),l=n(19),c=n(276),f=n(81),u=n.n(f),m=n(209),h=n.n(m),d=n(1354),p=n(253);function g(t){const[e,n]=a.useState(!1),f=t.server,m=`${f.hostname}${" ".repeat(18)}`.slice(0,Math.max(f.hostname.length,18)),g={progress:f.ramUsed/f.maxRam,totalTicks:30},y=`${m} ${Object(p.a)(g)}`;return a.createElement(l.a,{component:s.a},a.createElement(i.a,{onClick:()=>n(t=>!t)},a.createElement(o.a,{primary:a.createElement(r.a,{style:{whiteSpace:"pre-wrap"}},y)}),e?a.createElement(h.a,{color:"primary"}):a.createElement(u.a,{color:"primary"})),a.createElement(l.a,{mx:2},a.createElement(c.a,{in:e,timeout:0,unmountOnExit:!0},a.createElement(d.a,{workerScripts:t.workerScripts}))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(0),r=n.n(a),i=n(1355),o=n(248),s=n(1504),l=n(646),c=n(6);function f(t){const[e,n]=Object(a.useState)(0),[f,u]=Object(a.useState)(c.a.ActiveScriptsScriptPageSize);return r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,{dense:!0,disablePadding:!0},t.workerScripts.slice(e*f,e*f+f).map(t=>r.a.createElement(i.a,{key:`${t.name}_${t.args}`,workerScript:t}))),r.a.createElement(s.a,{rowsPerPageOptions:[10,15,20,100],component:"div",count:t.workerScripts.length,rowsPerPage:f,page:e,onPageChange:(t,e)=>{n(e)},onRowsPerPageChange:t=>{c.a.ActiveScriptsScriptPageSize=parseInt(t.target.value,10),u(parseInt(t.target.value,10)),n(0)},ActionsComponent:l.a}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return R}));var a=n(0),r=n(5),i=n(148),o=n(30),s=n(50),l=n(149),c=n(8),f=n(19),u=n(45),m=n(1),h=n(111),d=n(634),p=n.n(d),g=n(355),y=n(113),b=n(121),E=n(276),v=n(209),k=n.n(v),_=n(81),w=n.n(_),S=n(142),x=n(14),C=n(178),L=n(22),O=n(257),M=n(20),T=n(112);const A=Object(b.a)({noborder:{borderBottom:"none"}});function R(t){const e=A(),[n,d]=a.useState(!1),b=t.workerScript.scriptRef;const v=S.a.bind(null,b,b.server);const _=b.onlineMoneyMade/b.onlineRunningTime,R=b.onlineExpGained/b.onlineRunningTime;return a.createElement(a.Fragment,null,a.createElement(g.a,{onClick:()=>d(t=>!t),component:u.a},a.createElement(y.a,{primary:a.createElement(m.a,null,"└ ",t.workerScript.name," ",JSON.stringify(t.workerScript.args))}),n?a.createElement(k.a,{color:"primary"}):a.createElement(w.a,{color:"primary"})),a.createElement(E.a,{in:n,timeout:0,unmountOnExit:!0},a.createElement(f.a,{mx:6},a.createElement(i.a,{padding:"none",size:"small"},a.createElement(l.a,null,a.createElement(s.a,null,a.createElement(o.a,{className:e.noborder},a.createElement(m.a,null,"└ Threads:")),a.createElement(o.a,{className:e.noborder},a.createElement(m.a,null,r.a.formatThreads(t.workerScript.scriptRef.threads)))),a.createElement(s.a,null,a.createElement(o.a,{className:e.noborder,colSpan:2},a.createElement(m.a,null,"└ Args: ",Object(O.a)(t.workerScript.args)))),a.createElement(s.a,null,a.createElement(o.a,{className:e.noborder},a.createElement(m.a,null,"└ Online Time:")),a.createElement(o.a,{className:e.noborder},a.createElement(m.a,null,Object(L.d)(1e3*b.onlineRunningTime)))),a.createElement(s.a,null,a.createElement(o.a,{className:e.noborder},a.createElement(m.a,null,"└ Offline Time:")),a.createElement(o.a,{className:e.noborder},a.createElement(m.a,null,Object(L.d)(1e3*b.offlineRunningTime)))),a.createElement(s.a,null,a.createElement(o.a,{className:e.noborder},a.createElement(m.a,null,"└ Total online production:")),a.createElement(o.a,{className:e.noborder,align:"left"},a.createElement(m.a,null,a.createElement(M.a,{money:b.onlineMoneyMade})))),a.createElement(s.a,null,a.createElement(o.a,{className:e.noborder,colSpan:1}),a.createElement(o.a,{className:e.noborder,align:"left"},a.createElement(m.a,null," ",r.a.formatExp(b.onlineExpGained)+" hacking exp"))),a.createElement(s.a,null,a.createElement(o.a,{className:e.noborder},a.createElement(m.a,null,"└ Online production rate:")),a.createElement(o.a,{className:e.noborder,align:"left"},a.createElement(m.a,null,a.createElement(T.a,{money:_})))),a.createElement(s.a,null,a.createElement(o.a,{className:e.noborder,colSpan:1}),a.createElement(o.a,{className:e.noborder,align:"left"},a.createElement(m.a,null," ",r.a.formatExp(R)+" hacking exp / sec"))),a.createElement(s.a,null,a.createElement(o.a,{className:e.noborder},a.createElement(m.a,null,"└ Total offline production:")),a.createElement(o.a,{className:e.noborder,align:"left"},a.createElement(m.a,null,a.createElement(M.a,{money:b.offlineMoneyMade})))),a.createElement(s.a,null,a.createElement(o.a,{className:e.noborder,colSpan:1}),a.createElement(o.a,{className:e.noborder,align:"left"},a.createElement(m.a,null," ",r.a.formatExp(b.offlineExpGained)+" hacking exp"))))),a.createElement(c.a,{onClick:function(){C.c.emit(b)}},"LOG"),a.createElement(h.a,{onClick:function(){v(),Object(x.a)("Killing script")}},a.createElement(p.a,{color:"error"})))))}},,,function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(0),r=n.n(a),i=n(1),o=n(461),s=n(1359);function l(){return r.a.createElement(r.a.Fragment,null,r.a.createElement(i.a,null,"List of all recently killed scripts."),o.b.map(t=>r.a.createElement(s.a,{key:t.runningScript.pid,recentScript:t})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return L}));var a=n(0),r=n(5),i=n(148),o=n(30),s=n(50),l=n(149),c=n(19),f=n(45),u=n(1),m=n(8),h=n(355),d=n(113),p=n(121),g=n(276),y=n(209),b=n.n(y),E=n(81),v=n.n(E),k=n(22),_=n(257),w=n(20),S=n(112),x=n(178);const C=Object(p.a)({noborder:{borderBottom:"none"}});function L(t){const e=C(),[n,p]=a.useState(!1),y=t.recentScript,E=y.runningScript.onlineMoneyMade/y.runningScript.onlineRunningTime,L=y.runningScript.onlineExpGained/y.runningScript.onlineRunningTime;return a.createElement(a.Fragment,null,a.createElement(h.a,{onClick:()=>p(t=>!t),component:f.a},a.createElement(d.a,{primary:a.createElement(u.a,null,"└ ",y.runningScript.filename," (died"," ",Object(k.d)((new Date).getTime()-y.timeOfDeath.getTime())," ago)")}),n?a.createElement(b.a,{color:"primary"}):a.createElement(v.a,{color:"primary"})),a.createElement(g.a,{in:n,timeout:0,unmountOnExit:!0},a.createElement(c.a,{mx:6},a.createElement(i.a,{padding:"none",size:"small"},a.createElement(l.a,null,a.createElement(s.a,null,a.createElement(o.a,{className:e.noborder},a.createElement(u.a,null,"└ Threads:")),a.createElement(o.a,{className:e.noborder},a.createElement(u.a,null,r.a.formatThreads(y.runningScript.threads)))),a.createElement(s.a,null,a.createElement(o.a,{className:e.noborder,colSpan:2},a.createElement(u.a,null,"└ Args: ",Object(_.a)(y.runningScript.args)))),a.createElement(s.a,null,a.createElement(o.a,{className:e.noborder},a.createElement(u.a,null,"└ Online Time:")),a.createElement(o.a,{className:e.noborder},a.createElement(u.a,null,Object(k.d)(1e3*y.runningScript.onlineRunningTime)))),a.createElement(s.a,null,a.createElement(o.a,{className:e.noborder},a.createElement(u.a,null,"└ Offline Time:")),a.createElement(o.a,{className:e.noborder},a.createElement(u.a,null,Object(k.d)(1e3*y.runningScript.offlineRunningTime)))),a.createElement(s.a,null,a.createElement(o.a,{className:e.noborder},a.createElement(u.a,null,"└ Total online production:")),a.createElement(o.a,{className:e.noborder,align:"left"},a.createElement(u.a,null,a.createElement(w.a,{money:y.runningScript.onlineMoneyMade})))),a.createElement(s.a,null,a.createElement(o.a,{className:e.noborder,colSpan:1}),a.createElement(o.a,{className:e.noborder,align:"left"},a.createElement(u.a,null," ",r.a.formatExp(y.runningScript.onlineExpGained)+" hacking exp"))),a.createElement(s.a,null,a.createElement(o.a,{className:e.noborder},a.createElement(u.a,null,"└ Online production rate:")),a.createElement(o.a,{className:e.noborder,align:"left"},a.createElement(u.a,null,a.createElement(S.a,{money:E})))),a.createElement(s.a,null,a.createElement(o.a,{className:e.noborder,colSpan:1}),a.createElement(o.a,{className:e.noborder,align:"left"},a.createElement(u.a,null," ",r.a.formatExp(L)+" hacking exp / sec"))),a.createElement(s.a,null,a.createElement(o.a,{className:e.noborder},a.createElement(u.a,null,"└ Total offline production:")),a.createElement(o.a,{className:e.noborder,align:"left"},a.createElement(u.a,null,a.createElement(w.a,{money:y.runningScript.offlineMoneyMade})))),a.createElement(s.a,null,a.createElement(o.a,{className:e.noborder,colSpan:1}),a.createElement(o.a,{className:e.noborder,align:"left"},a.createElement(u.a,null," ",r.a.formatExp(y.runningScript.offlineExpGained)+" hacking exp"))))),a.createElement(m.a,{onClick:function(){x.c.emit(y.runningScript)}},"LOG"))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return b}));var a=n(0),r=n.n(a),i=n(1361),o=n(1362),s=n(1363),l=n(350),c=n(10),f=n(18),u=n(29),m=n(8),h=n(1),d=n(1364),p=n(4),g=n(1369);function y({faction:t,rerender:e,onAugmentations:n}){const i=u.b.Player(),y=u.b.Router(),[b,E]=Object(a.useState)(!1),v=t.getInfo();function k(){i.startFocusing(),y.toWork()}const _=i.inGang()&&i.getGangName()===t.name,w=Math.floor(c.a.BaseFavorToDonate*f.a.RepToDonateToFaction),S=t.favor>=w,x=t.name===p.a.TheCovenant&&10===i.bitNodeN;return r.a.createElement(r.a.Fragment,null,r.a.createElement(m.a,{onClick:()=>y.toFactions()},"Back"),r.a.createElement(h.a,{variant:"h4",color:"primary"},t.name),r.a.createElement(s.a,{faction:t,factionInfo:v}),r.a.createElement(g.a,{faction:t}),!_&&v.offerHackingWork&&r.a.createElement(l.a,{buttonText:"Hacking Contracts",infoText:"Complete hacking contracts for your faction. Your effectiveness, which determines how much reputation you gain for this faction, is based on your hacking skill. You will gain hacking exp.",onClick:()=>function(t){i.startFactionHackWork(t),k()}(t)}),!_&&v.offerFieldWork&&r.a.createElement(l.a,{buttonText:"Field Work",infoText:"Carry out field missions for your faction. Your effectiveness, which determines how much reputation you gain for this faction, is based on all of your stats. You will gain exp for all stats.",onClick:()=>function(t){i.startFactionFieldWork(t),k()}(t)}),!_&&v.offerSecurityWork&&r.a.createElement(l.a,{buttonText:"Security Work",infoText:"Serve in a security detail for your faction. Your effectiveness, which determines how much reputation you gain for this faction, is based on your combat stats. You will gain exp for all combat stats.",onClick:()=>function(t){i.startFactionSecurityWork(t),k()}(t)}),!_&&v.offersWork()&&r.a.createElement(o.a,{faction:t,p:i,rerender:e,favorToDonate:w,disabled:!S}),r.a.createElement(l.a,{buttonText:"Purchase Augmentations",infoText:"As your reputation with this faction rises, you will unlock Augmentations, which you can purchase to enhance your abilities.",onClick:n}),x&&r.a.createElement(r.a.Fragment,null,r.a.createElement(l.a,{buttonText:"Purchase & Upgrade Duplicate Sleeves",infoText:"Purchase Duplicate Sleeves and upgrades. These are permanent!",onClick:()=>E(!0)}),r.a.createElement(d.a,{open:b,onClose:()=>E(!1)})))}function b(t){const e=Object(a.useState)(!1)[1],n=u.b.Player(),o=u.b.Router(),[s,l]=Object(a.useState)(t.augPage);function c(){e(t=>!t)}Object(a.useEffect)(()=>{const t=setInterval(c,200);return()=>clearInterval(t)},[]);const f=t.faction;return n&&!n.factions.includes(f.name)?r.a.createElement(r.a.Fragment,null,r.a.createElement(h.a,{variant:"h4",color:"primary"},"You have not joined ",f.name," yet!"),r.a.createElement(m.a,{onClick:()=>o.toFactions()},"Back to Factions")):s?r.a.createElement(i.a,{faction:f,routeToMainPage:()=>l(!1)}):r.a.createElement(y,{rerender:c,faction:f,onAugmentations:()=>l(!0)})}},function(t,e,n){"use strict";n.d(e,"a",(function(){return w}));var a=n(1),r=n(249),i=n(8),o=n(45),s=n(19),l=n(21),c=n(0),f=n.n(c),u=n(79),m=n(119),h=n(12),d=n(636),p=n(172),g=n(6),y=n(29),b=n(5),E=n(324),v=n(128),k=n(4),_=n(105);function w(t){const e=y.b.Player(),n=Object(c.useState)(!1)[1];function w(){n(t=>!t)}function S(){return Object(_.a)(e,t.faction)}function x(t){g.a.PurchaseAugmentationsOrder=t,w()}const C=function(){switch(g.a.PurchaseAugmentationsOrder){case p.b.Cost:return function(){const t=S();return t.sort((t,n)=>{const a=u.a[t],r=u.a[n];if(null==a||null==r)throw new Error("Invalid Augmentation Names");return a.getCost(e).moneyCost-r.getCost(e).moneyCost}),t}();case p.b.Reputation:return function(){const t=S();return t.sort((t,n)=>{const a=u.a[t],r=u.a[n];if(null==a||null==r)throw new Error("Invalid Augmentation Names");return a.getCost(e).repCost-r.getCost(e).repCost}),t}();case p.b.Purchasable:return function(){const n=S();function a(n){const a=u.a[n],r=a.getCost(e),i=r.repCost,o=t.faction.playerReputation>=i,s=Object(_.b)(a);return 0!==r.moneyCost&&e.money>r.moneyCost&&o&&s}const r=n.filter(a).sort((t,n)=>{const a=u.a[t],r=u.a[n];if(null==a||null==r)throw new Error("Invalid Augmentation Names");return a.getCost(e).moneyCost-r.getCost(e).moneyCost}),i=n.filter(t=>!a(t)).sort((t,n)=>{const a=u.a[t],r=u.a[n];if(null==a||null==r)throw new Error("Invalid Augmentation Names");return a.getCost(e).repCost-r.getCost(e).repCost});return r.concat(i)}();default:return S()}}(),L=C.filter(t=>t===h.a.NeuroFluxGovernor||!e.augmentations.some(e=>e.name===t)&&!e.queuedAugmentations.some(e=>e.name===t)),O=C.filter(t=>!L.includes(t)),M=t.faction.name!==k.a.ShadowsOfAnarchy?f.a.createElement(a.a,null,f.a.createElement("b",null,"Price multiplier:")," x ",b.a.formatReallyBigNumber(Object(m.d)())):f.a.createElement(f.a.Fragment,null);return f.a.createElement(f.a.Fragment,null,f.a.createElement(r.a,{disableGutters:!0,maxWidth:"lg",sx:{mx:0}},f.a.createElement(i.a,{onClick:t.routeToMainPage},"Back"),f.a.createElement(a.a,{variant:"h4"},"Faction Augmentations - ",t.faction.name),f.a.createElement(o.a,{sx:{p:1,mb:1}},f.a.createElement(a.a,null,"These are all of the Augmentations that are available to purchase from ",f.a.createElement("b",null,t.faction.name),". Augmentations are powerful upgrades that will enhance your abilities.",f.a.createElement("br",null)),f.a.createElement(s.a,{sx:{display:"grid",gridTemplateColumns:`repeat(${t.faction.name===k.a.ShadowsOfAnarchy?"2":"3"}, 1fr)`,justifyItems:"center",my:1}},f.a.createElement(l.a,{title:f.a.createElement(a.a,null,"The price of every Augmentation increases for every queued Augmentation and it is reset when you install them.")},M),f.a.createElement(a.a,null,f.a.createElement("b",null,"Reputation:")," ",f.a.createElement(v.a,{reputation:t.faction.playerReputation})),f.a.createElement(a.a,null,f.a.createElement("b",null,"Favor:")," ",f.a.createElement(E.a,{favor:Math.floor(t.faction.favor)}))),f.a.createElement(s.a,{sx:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)"}},f.a.createElement(i.a,{onClick:()=>x(p.b.Cost)},"Sort by Cost"),f.a.createElement(i.a,{onClick:()=>x(p.b.Reputation)},"Sort by Reputation"),f.a.createElement(i.a,{onClick:()=>x(p.b.Default)},"Sort by Default Order"),f.a.createElement(i.a,{onClick:()=>x(p.b.Purchasable)},"Sort by Purchasable")))),f.a.createElement(d.a,{augNames:L,ownedAugNames:O,player:e,canPurchase:(e,n)=>{const a=n.getCost(e);return Object(_.b)(n)&&t.faction.playerReputation>=a.repCost&&(0===a.moneyCost||e.money>a.moneyCost)},purchaseAugmentation:(e,n,a)=>{g.a.SuppressBuyAugmentationConfirmation?(Object(_.f)(n,t.faction),w()):a(!0)},rep:t.faction.playerReputation,faction:t.faction}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return y}));var a=n(0),r=n.n(a),i=n(10),o=n(531),s=n(324),l=n(20),c=n(128),f=n(5),u=n(14),m=n(266),h=n(1),d=n(45),p=n(8),g=n(76);function y(t){const[e,n]=Object(a.useState)(null),y=(i.a.DonateMoneyToRepDivisor+"").length-1;function b(){return null!==e&&(!(isNaN(e)||e<=0)&&!(t.p.moneyObject(c.a)({noformat:{whiteSpace:"pre-wrap",lineHeight:"1em"}}));function d(){return r.a.createElement(f.a,null,"Perform work/carry out assignments for your faction to help further its cause! By doing so you will earn reputation for your faction. You will also gain reputation passively over time, although at a very slow rate. Earning reputation will allow you to purchase Augmentations through this faction, which are powerful upgrades that enhance your abilities.")}function p(t){var e;const n=Object(a.useState)(!1)[1];function l(){n(t=>!t)}Object(a.useEffect)(()=>{const t=setInterval(l,200);return()=>clearInterval(t)},[]);const c=h(),p=null!==(e=t.factionInfo.assignment)&&void 0!==e?e:d,g=t.faction.getFavorGain();return r.a.createElement(r.a.Fragment,null,r.a.createElement(f.a,{classes:{root:c.noformat}},t.factionInfo.infoText),r.a.createElement(f.a,null,"-------------------------"),r.a.createElement(m.a,{display:"flex"},r.a.createElement(u.a,{title:r.a.createElement(r.a.Fragment,null,r.a.createElement(f.a,null,"You will have ",r.a.createElement(o.a,{favor:Math.floor(t.faction.favor+g)})," faction favor after installing an Augmentation."),r.a.createElement(s.a,null,"\\(\\huge{r = \\text{total faction reputation}}\\)"),r.a.createElement(s.a,null,"\\(\\huge{favor=1+\\left\\lfloor\\log_{1.02}\\left(\\frac{r+25000}{25500}\\right)\\right\\rfloor}\\)"))},r.a.createElement(f.a,null,"Reputation: ",r.a.createElement(i.a,{reputation:t.faction.playerReputation})))),r.a.createElement(f.a,null,"-------------------------"),r.a.createElement(m.a,{display:"flex"},r.a.createElement(u.a,{title:r.a.createElement(r.a.Fragment,null,r.a.createElement(f.a,null,"Faction favor increases the rate at which you earn reputation for this faction by 1% per favor. Faction favor is gained whenever you install an Augmentation. The amount of favor you gain depends on the total amount of reputation you earned with this faction. Across all resets."),r.a.createElement(s.a,null,"\\(\\huge{r = reputation}\\)"),r.a.createElement(s.a,null,"\\(\\huge{\\Delta r = \\Delta r \\times \\frac{100+favor}{100}}\\)"))},r.a.createElement(f.a,null,"Faction Favor: ",r.a.createElement(o.a,{favor:Math.floor(t.faction.favor)})))),r.a.createElement(f.a,null,"-------------------------"),r.a.createElement(p,null))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var a=n(0),r=n.n(a),i=n(1365),o=n(326),s=n(500),l=n(20),c=n(38),f=n(29),u=n(14),m=n(1),h=n(8),d=n(4);function p(t){const e=f.b.Player(),[n,p]=Object(a.useState)(0);function g(){return Math.pow(10,e.sleevesFromCovenant)*s.a}function y(){p(n+1)}let b=!1;e.canAfford(g())||(b=!0),e.sleevesFromCovenant>=s.b&&(b=!0);const E=[];for(let t=0;t=s.b||(e.canAfford(g())?(e.loseMoney(g(),"sleeves"),e.sleevesFromCovenant+=1,e.sleeves.push(new o.a(e)),y()):Object(u.a)("You cannot afford to purchase a Duplicate Sleeve"))}},"Purchase - ",r.a.createElement(l.a,{money:g(),player:e}))),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(m.a,null,"You can also purchase upgrades for your Sleeves. These upgrades are also permanent."),E))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var a=n(0),r=n.n(a),i=n(5),o=n(20),s=n(1),l=n(76),c=n(8),f=n(19),u=n(45);function m(t){const[e,n]=Object(a.useState)(1);function m(){if(isNaN(e))return 1/0;const n=100-t.sleeve.memory;return e>n?1/0:t.sleeve.getMemoryUpgradeCost(e)}const h=m(),d=!t.p.canAfford(h);let p=r.a.createElement(r.a.Fragment,null);return p=isNaN(e)?r.a.createElement(r.a.Fragment,null,"Invalid value"):r.a.createElement(r.a.Fragment,null,"Purchase ",e," memory - ",r.a.createElement(o.a,{money:h,player:t.p})),r.a.createElement(u.a,{sx:{my:1,p:1}},r.a.createElement(s.a,{variant:"h6",color:"primary"},"Upgrade Memory of Sleeve ",t.index),r.a.createElement(s.a,null,"Purchase a memory upgrade for your sleeve. Note that a sleeve's max memory is 100 (current:"," ",i.a.formatSleeveMemory(t.sleeve.memory),")"),r.a.createElement(f.a,{display:"flex",flexDirection:"row",alignItems:"center"},r.a.createElement(s.a,null,"Amount of memory to purchase (must be an integer): "),r.a.createElement(l.a,{onChange:function(e){let a=parseInt(e.target.value);isNaN(a)&&(a=1),a<1&&(a=1);const r=100-t.sleeve.memory;a>r&&(a=r),n(a)},type:"number",value:e})),r.a.createElement("br",null),r.a.createElement(c.a,{disabled:d,onClick:function(){const n=m();t.p.canAfford(n)&&(t.sleeve.upgradeMemory(e),t.p.loseMoney(n,"sleeves"),t.rerender())}},p))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(43),r=n(18),i=n(15),o=n(10),s=n(181),l=n(284);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(){c(this,"hacking",1),c(this,"strength",1),c(this,"defense",1),c(this,"dexterity",1),c(this,"agility",1),c(this,"charisma",1),c(this,"intelligence",0),c(this,"hp",10),c(this,"max_hp",10),c(this,"hacking_exp",0),c(this,"strength_exp",0),c(this,"defense_exp",0),c(this,"dexterity_exp",0),c(this,"agility_exp",0),c(this,"charisma_exp",0),c(this,"intelligence_exp",0),c(this,"hacking_mult",1),c(this,"strength_mult",1),c(this,"defense_mult",1),c(this,"dexterity_mult",1),c(this,"agility_mult",1),c(this,"charisma_mult",1),c(this,"hacking_exp_mult",1),c(this,"strength_exp_mult",1),c(this,"defense_exp_mult",1),c(this,"dexterity_exp_mult",1),c(this,"agility_exp_mult",1),c(this,"charisma_exp_mult",1),c(this,"hacking_chance_mult",1),c(this,"hacking_speed_mult",1),c(this,"hacking_money_mult",1),c(this,"hacking_grow_mult",1),c(this,"company_rep_mult",1),c(this,"faction_rep_mult",1),c(this,"crime_money_mult",1),c(this,"crime_success_mult",1),c(this,"work_money_mult",1),c(this,"hacknet_node_money_mult",1),c(this,"hacknet_node_purchase_cost_mult",1),c(this,"hacknet_node_ram_cost_mult",1),c(this,"hacknet_node_core_cost_mult",1),c(this,"hacknet_node_level_cost_mult",1),c(this,"bladeburner_max_stamina_mult",1),c(this,"bladeburner_stamina_gain_mult",1),c(this,"bladeburner_analysis_mult",1),c(this,"bladeburner_success_chance_mult",1),c(this,"augmentations",[]),c(this,"city",i.a.Sector12),c(this,"gainHackingExp",a.K),c(this,"gainStrengthExp",a.O),c(this,"gainDefenseExp",a.I),c(this,"gainDexterityExp",a.J),c(this,"gainAgilityExp",a.F),c(this,"gainCharismaExp",a.G),c(this,"gainIntelligenceExp",a.L),c(this,"gainStats",a.N),c(this,"calculateSkill",a.o),c(this,"regenerateHp",a.vb),c(this,"queryStatFromString",a.ob)}applyAugmentation(t){for(const e of Object.keys(t.mults))null==this[e]?console.warn("Augmentation has unrecognized multiplier property: "+e):this[e]*=t.mults[e]}calculateStat(t,e=1){return Object(s.b)(t,e)}getFactionFieldWorkRepGain(){return.9*(this.hacking/o.a.MaxSkillLevel+this.strength/o.a.MaxSkillLevel+this.defense/o.a.MaxSkillLevel+this.dexterity/o.a.MaxSkillLevel+this.agility/o.a.MaxSkillLevel+this.charisma/o.a.MaxSkillLevel)/5.5*this.faction_rep_mult}getFactionHackingWorkRepGain(){return this.hacking/o.a.MaxSkillLevel*this.faction_rep_mult}getFactionSecurityWorkRepGain(){return.9*(this.hacking/o.a.MaxSkillLevel+this.strength/o.a.MaxSkillLevel+this.defense/o.a.MaxSkillLevel+this.dexterity/o.a.MaxSkillLevel+this.agility/o.a.MaxSkillLevel)/4.5*this.faction_rep_mult}resetMultipliers(){this.hacking_mult=1,this.strength_mult=1,this.defense_mult=1,this.dexterity_mult=1,this.agility_mult=1,this.charisma_mult=1,this.hacking_exp_mult=1,this.strength_exp_mult=1,this.defense_exp_mult=1,this.dexterity_exp_mult=1,this.agility_exp_mult=1,this.charisma_exp_mult=1,this.company_rep_mult=1,this.faction_rep_mult=1,this.crime_money_mult=1,this.crime_success_mult=1,this.work_money_mult=1,this.hacknet_node_money_mult=1,this.hacknet_node_purchase_cost_mult=1,this.hacknet_node_ram_cost_mult=1,this.hacknet_node_core_cost_mult=1,this.hacknet_node_level_cost_mult=1,this.bladeburner_max_stamina_mult=1,this.bladeburner_stamina_gain_mult=1,this.bladeburner_analysis_mult=1,this.bladeburner_success_chance_mult=1}updateStatLevels(){this.hacking=Math.max(1,Math.floor(this.calculateStat(this.hacking_exp,this.hacking_mult*r.a.HackingLevelMultiplier))),this.strength=Math.max(1,Math.floor(this.calculateStat(this.strength_exp,this.strength_mult*r.a.StrengthLevelMultiplier))),this.defense=Math.max(1,Math.floor(this.calculateStat(this.defense_exp,this.defense_mult*r.a.DefenseLevelMultiplier))),this.dexterity=Math.max(1,Math.floor(this.calculateStat(this.dexterity_exp,this.dexterity_mult*r.a.DexterityLevelMultiplier))),this.agility=Math.max(1,Math.floor(this.calculateStat(this.agility_exp,this.agility_mult*r.a.AgilityLevelMultiplier))),this.charisma=Math.max(1,Math.floor(this.calculateStat(this.charisma_exp,this.charisma_mult*r.a.CharismaLevelMultiplier)));const t=this.hp/this.max_hp;this.max_hp=Math.floor(10+this.defense/10),this.hp=Math.round(this.max_hp*t)}getIntelligenceBonus(t){return Object(l.a)(this.intelligence,t)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(371),r=n(2);function i(t){const e="SourceFile"+t.n,n=a.a[e];if(null!=n){switch(t.n){case 1:{let e=0;for(let n=0;n{if(e.inGang())return n.toGang();d(!0)},disabled:!p.enabled},p.title))),c.a.createElement(a.a,null,p.description))),c.a.createElement(m.a,{facName:t.name,open:h,onClose:()=>d(!1)}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var a=n(0),r=n.n(a),i=n(38),o=n(29),s=n(1),l=n(8),c=n(27),f=n(4);function u(t){const e=o.b.Player(),n=o.b.Router();function a(){return[f.a.NiteSec,f.a.TheBlackHand].includes(t.facName)}function u(){e.startGang(t.facName,a()),t.onClose(),n.toGang()}return r.a.createElement(i.a,{open:t.open,onClose:t.onClose},r.a.createElement(s.a,null,"Would you like to create a new Gang with ",t.facName,"?",r.a.createElement("br",null),r.a.createElement("br",null),"Note that this will prevent you from creating a Gang with any other Faction until this BitNode is destroyed. It also resets your reputation with this faction.",r.a.createElement("br",null),r.a.createElement("br",null),a()?"This is a HACKING gang. Members in this gang will have different tasks than COMBAT gangs. Compared to combat gangs, progression with hacking gangs is more straightforward as territory warfare is not as important.":"This is a COMBAT gang. Members in this gang will have different tasks than HACKING gangs. Compared to hacking gangs, progression with combat gangs can be more difficult as territory management is more important. However, well-managed combat gangs can progress faster than hacking ones.",r.a.createElement("br",null),r.a.createElement("br",null),"Other than hacking vs combat, there are NO differences between the Factions you can create a Gang with, and each of these Factions have all Augmentations available."),r.a.createElement(l.a,{onClick:u,onKeyUp:function(t){t.key===c.a.ENTER&&u()},autoFocus:!0},"Create Gang"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return N}));var a=n(1),r=n(148),i=n(149),o=n(45),s=n(249),l=n(19),c=n(111),f=n(21),u=n(1505),m=n(692),h=n(0),d=n.n(h),p=n(152),g=n(18),y=n(647),b=n(41),E=n(224),v=n(6),k=n(22),_=n(29),w=n(5),S=n(38),x=n(20),C=n(73),L=n(201),O=n(115);const M=({open:t,onClose:e})=>{const n=_.b.Player();return d.a.createElement(S.a,{open:t,onClose:e},d.a.createElement(d.a.Fragment,null,d.a.createElement(a.a,{variant:"h5"},"All Employers"),d.a.createElement("ul",null,Object.keys(n.jobs).map(t=>d.a.createElement(a.a,{key:t},"* ",t)))))};function T(t){var e;const n=_.b.Player();return d.a.createElement(r.a,{sx:{display:"table",width:"100%",mb:!0===(null!==(e=t.noMargin)&&void 0!==e&&e)?0:2}},d.a.createElement(i.a,null,t.rows.map(e=>{const{mult:r,value:i,effValue:o=null,color:s=t.color}=e;return null!==o&&o!==i&&n.sourceFileLvl(5)>0?d.a.createElement(C.a,{key:r,name:r,color:s,data:{}},d.a.createElement(d.a.Fragment,null,d.a.createElement(a.a,{color:s},d.a.createElement("span",{style:{opacity:.5}},w.a.formatPercentage(i))," ",w.a.formatPercentage(o)))):d.a.createElement(C.a,{key:r,name:r,color:s,data:{content:w.a.formatPercentage(i)}})})))}function A(){const t=_.b.Player();if(t.sourceFiles.length>0){const e="BitNode"+t.bitNodeN,n=Math.min(t.sourceFileLvl(t.bitNodeN)+1,12===t.bitNodeN?1/0:3);return d.a.createElement(o.a,{sx:{mb:1,p:1}},d.a.createElement(a.a,{variant:"h5"},"BitNode ",t.bitNodeN,": ",p.a[e].name," (Level ",n,")"),d.a.createElement(a.a,{sx:{whiteSpace:"pre-wrap",overflowWrap:"break-word"}},p.a[e].info))}return d.a.createElement(d.a.Fragment,null)}function R({open:t,onClose:e}){const n=_.b.Player();function r(t){const e=[["Total:",d.a.createElement(x.a,{money:t.total})]];return t.augmentations&&e.push(["Augmentations:",d.a.createElement(x.a,{money:t.augmentations})]),t.bladeburner&&e.push(["Bladeburner:",d.a.createElement(x.a,{money:t.bladeburner})]),t.casino&&e.push(["Casino:",d.a.createElement(x.a,{money:t.casino})]),t.codingcontract&&e.push(["Coding Contracts:",d.a.createElement(x.a,{money:t.codingcontract})]),t.work&&e.push(["Company Work:",d.a.createElement(x.a,{money:t.work})]),t.class&&e.push(["Class:",d.a.createElement(x.a,{money:t.class})]),t.corporation&&e.push(["Corporation:",d.a.createElement(x.a,{money:t.corporation})]),t.crime&&e.push(["Crimes:",d.a.createElement(x.a,{money:t.crime})]),t.gang&&e.push(["Gang:",d.a.createElement(x.a,{money:t.gang})]),t.hacking&&e.push(["Hacking:",d.a.createElement(x.a,{money:t.hacking})]),t.hacknet&&e.push(["Hacknet Nodes:",d.a.createElement(x.a,{money:t.hacknet})]),t.hacknet_expenses&&e.push(["Hacknet Nodes Expenses:",d.a.createElement(x.a,{money:t.hacknet_expenses})]),t.hospitalization&&e.push(["Hospitalization:",d.a.createElement(x.a,{money:t.hospitalization})]),t.infiltration&&e.push(["Infiltration:",d.a.createElement(x.a,{money:t.infiltration})]),t.servers&&e.push(["Servers:",d.a.createElement(x.a,{money:t.servers})]),t.stock&&e.push(["Stock Market:",d.a.createElement(x.a,{money:t.stock})]),t.sleeves&&e.push(["Sleeves:",d.a.createElement(x.a,{money:t.sleeves})]),t.other&&e.push(["Other:",d.a.createElement(x.a,{money:t.other})]),d.a.createElement(L.a,{rows:e,wide:!0})}let i=d.a.createElement(d.a.Fragment,null,d.a.createElement(a.a,{variant:"h6",color:"primary"},"Money earned since you last installed Augmentations"),d.a.createElement("br",null),r(n.moneySourceA));return 0!==n.sourceFiles.length&&(i=d.a.createElement(d.a.Fragment,null,i,d.a.createElement("br",null),d.a.createElement("br",null),d.a.createElement(a.a,{variant:"h6",color:"primary"},"Money earned in this BitNode"),d.a.createElement("br",null),r(n.moneySourceB))),d.a.createElement(S.a,{open:t,onClose:e},i)}function N(){const t=_.b.Player(),[e,n]=Object(h.useState)(!1),[w,S]=Object(h.useState)(!1),L=Object(h.useState)(!1)[1];function N(){L(t=>!t)}Object(h.useEffect)(()=>{const t=setInterval(N,200);return()=>clearInterval(t)},[]);const P=[["Since last Augmentation installation",Object(k.d)(t.playtimeSinceLastAug)]];t.sourceFiles.length>0&&P.push(["Since last Bitnode destroyed",Object(k.d)(t.playtimeSinceLastBitnode)]),P.push(["Total",Object(k.d)(t.totalPlaytime)]);let I=!1;if(t.sourceFileLvl(5)>0){const e=t.bitNodeN,n=12===e?1/0:3,a=Object(p.c)(e,Math.min(t.sourceFileLvl(e)+1,n));I=!Object(O.isEqual)(a,p.b)}return d.a.createElement(s.a,{maxWidth:"lg",disableGutters:!0,sx:{mx:0}},d.a.createElement(a.a,{variant:"h4"},"Stats"),d.a.createElement(l.a,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",minWidth:"fit-content",mb:1,gap:1}},d.a.createElement(o.a,{sx:{p:1}},d.a.createElement(a.a,{variant:"h5"},"General"),d.a.createElement(r.a,null,d.a.createElement(i.a,null,d.a.createElement(C.a,{name:"Current City",color:v.a.theme.primary,data:{content:t.city}}),d.a.createElement(C.a,{name:"Money",color:v.a.theme.money,data:{}},d.a.createElement(d.a.Fragment,null,d.a.createElement(x.a,{money:t.money}),d.a.createElement(c.a,{onClick:()=>n(!0),sx:{p:0}},d.a.createElement(u.a,{color:"info"})))),t.companyName?d.a.createElement(d.a.Fragment,null,d.a.createElement(C.a,{name:"Last Employer",color:v.a.theme.primary,data:{content:t.companyName}}),d.a.createElement(C.a,{name:"Last Job",color:v.a.theme.primary,data:{content:t.jobs[t.companyName]}})):d.a.createElement(d.a.Fragment,null),t.jobs&&0!==Object.keys(t.jobs).length?d.a.createElement(C.a,{name:"All Employers",color:v.a.theme.primary,data:{}},d.a.createElement(d.a.Fragment,null,d.a.createElement("span",{style:{color:v.a.theme.primary}},Object.keys(t.jobs).length," total"),d.a.createElement(c.a,{onClick:()=>S(!0),sx:{p:0}},d.a.createElement(u.a,{color:"info"})))):d.a.createElement(d.a.Fragment,null),d.a.createElement(C.a,{name:"Servers Owned",color:v.a.theme.primary,data:{content:`${t.purchasedServers.length} / ${Object(E.b)()}`}}),d.a.createElement(C.a,{name:`Hacknet ${9===t.bitNodeN||t.sourceFileLvl(9)>0?"Servers":"Nodes"} owned`,color:v.a.theme.primary,data:{content:`${t.hacknetNodes.length}${9===t.bitNodeN||t.sourceFileLvl(9)>0?" / "+b.b.MaxServers:""}`}}),d.a.createElement(C.a,{name:"Augmentations Installed",color:v.a.theme.primary,data:{content:String(t.augmentations.length)}})))),d.a.createElement(o.a,{sx:{p:1}},d.a.createElement(a.a,{variant:"h5"},"Skills"),d.a.createElement(r.a,null,d.a.createElement(i.a,null,d.a.createElement(C.a,{name:"Hacking",color:v.a.theme.hack,data:{level:t.hacking,exp:t.hacking_exp}}),d.a.createElement(C.a,{name:"Strength",color:v.a.theme.combat,data:{level:t.strength,exp:t.strength_exp}}),d.a.createElement(C.a,{name:"Defense",color:v.a.theme.combat,data:{level:t.defense,exp:t.defense_exp}}),d.a.createElement(C.a,{name:"Dexterity",color:v.a.theme.combat,data:{level:t.dexterity,exp:t.dexterity_exp}}),d.a.createElement(C.a,{name:"Agility",color:v.a.theme.combat,data:{level:t.agility,exp:t.agility_exp}}),d.a.createElement(C.a,{name:"Charisma",color:v.a.theme.cha,data:{level:t.charisma,exp:t.charisma_exp}}),t.intelligence>0&&(5===t.bitNodeN||t.sourceFileLvl(5)>0)&&d.a.createElement(C.a,{name:"Intelligence",color:v.a.theme.int,data:{level:t.intelligence,exp:t.intelligence_exp}}))))),d.a.createElement(o.a,{sx:{p:1,mb:1}},d.a.createElement(a.a,{variant:"h5",color:"primary",sx:{display:"flex",alignItems:"center",flexWrap:"wrap"}},"Multipliers",t.sourceFileLvl(5)>0&&d.a.createElement(f.a,{title:d.a.createElement(a.a,null,"Displays your current multipliers.",d.a.createElement("br",null),d.a.createElement("br",null),"When there is a dim number next to a multiplier, that means that the multiplier in question is being affected by BitNode multipliers.",d.a.createElement("br",null),d.a.createElement("br",null),"The dim number is the raw multiplier, and the undimmed number is the effective multiplier, as dictated by the BitNode.")},d.a.createElement(m.a,{sx:{ml:1,mb:.5},color:"info"}))),d.a.createElement(l.a,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:1}},d.a.createElement(l.a,null,d.a.createElement(T,{rows:[{mult:"Hacking Chance",value:t.hacking_chance_mult},{mult:"Hacking Speed",value:t.hacking_speed_mult},{mult:"Hacking Money",value:t.hacking_money_mult,effValue:t.hacking_money_mult*g.a.ScriptHackMoney},{mult:"Hacking Growth",value:t.hacking_grow_mult,effValue:t.hacking_grow_mult*g.a.ServerGrowthRate}],color:v.a.theme.hack}),d.a.createElement(T,{rows:[{mult:"Hacking Level",value:t.hacking_mult,effValue:t.hacking_mult*g.a.HackingLevelMultiplier},{mult:"Hacking Experience",value:t.hacking_exp_mult,effValue:t.hacking_exp_mult*g.a.HackExpGain}],color:v.a.theme.hack}),d.a.createElement(T,{rows:[{mult:"Strength Level",value:t.strength_mult,effValue:t.strength_mult*g.a.StrengthLevelMultiplier},{mult:"Strength Experience",value:t.strength_exp_mult}],color:v.a.theme.combat}),d.a.createElement(T,{rows:[{mult:"Defense Level",value:t.defense_mult,effValue:t.defense_mult*g.a.DefenseLevelMultiplier},{mult:"Defense Experience",value:t.defense_exp_mult}],color:v.a.theme.combat}),d.a.createElement(T,{rows:[{mult:"Dexterity Level",value:t.dexterity_mult,effValue:t.dexterity_mult*g.a.DexterityLevelMultiplier},{mult:"Dexterity Experience",value:t.dexterity_exp_mult}],color:v.a.theme.combat}),d.a.createElement(T,{rows:[{mult:"Agility Level",value:t.agility_mult,effValue:t.agility_mult*g.a.AgilityLevelMultiplier},{mult:"Agility Experience",value:t.agility_exp_mult}],color:v.a.theme.combat}),d.a.createElement(T,{rows:[{mult:"Charisma Level",value:t.charisma_mult,effValue:t.charisma_mult*g.a.CharismaLevelMultiplier},{mult:"Charisma Experience",value:t.charisma_exp_mult}],color:v.a.theme.cha,noMargin:!0})),d.a.createElement(l.a,null,d.a.createElement(T,{rows:[{mult:"Hacknet Node Production",value:t.hacknet_node_money_mult,effValue:t.hacknet_node_money_mult*g.a.HacknetNodeMoney},{mult:"Hacknet Node Purchase Cost",value:t.hacknet_node_purchase_cost_mult},{mult:"Hacknet Node RAM Upgrade Cost",value:t.hacknet_node_ram_cost_mult},{mult:"Hacknet Node Core Purchase Cost",value:t.hacknet_node_core_cost_mult},{mult:"Hacknet Node Level Upgrade Cost",value:t.hacknet_node_level_cost_mult}],color:v.a.theme.primary}),d.a.createElement(T,{rows:[{mult:"Company Reputation Gain",value:t.company_rep_mult,color:v.a.theme.rep},{mult:"Faction Reputation Gain",value:t.faction_rep_mult,effValue:t.faction_rep_mult*g.a.FactionWorkRepGain,color:v.a.theme.rep},{mult:"Salary",value:t.work_money_mult,effValue:t.work_money_mult*g.a.CompanyWorkMoney,color:v.a.theme.money}],color:v.a.theme.money}),d.a.createElement(T,{rows:[{mult:"Crime Success Chance",value:t.crime_success_mult},{mult:"Crime Money",value:t.crime_money_mult,effValue:t.crime_money_mult*g.a.CrimeMoney,color:v.a.theme.money}],color:v.a.theme.combat}),t.canAccessBladeburner()&&d.a.createElement(T,{rows:[{mult:"Bladeburner Success Chance",value:t.bladeburner_success_chance_mult},{mult:"Bladeburner Max Stamina",value:t.bladeburner_max_stamina_mult},{mult:"Bladeburner Stamina Gain",value:t.bladeburner_stamina_gain_mult},{mult:"Bladeburner Field Analysis",value:t.bladeburner_analysis_mult}],color:v.a.theme.primary,noMargin:!0})))),d.a.createElement(o.a,{sx:{p:1,mb:1}},d.a.createElement(a.a,{variant:"h5"},"Time Played"),d.a.createElement(r.a,null,d.a.createElement(i.a,null,P.map(([t,e])=>d.a.createElement(C.a,{key:t,name:t,color:v.a.theme.primary,data:{content:e}}))))),d.a.createElement(A,null),I&&d.a.createElement(o.a,{sx:{p:1,mb:1}},d.a.createElement(a.a,{variant:"h5"},"BitNode Multipliers"),d.a.createElement(y.a,{n:t.bitNodeN})),d.a.createElement(R,{open:e,onClose:()=>n(!1)}),d.a.createElement(M,{open:w,onClose:()=>S(!1)}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(0),r=n.n(a),i=n(1373),o=n(1374);function s(t){const e=Object(a.useState)(!1)[1];function n(){e(t=>!t)}return Object(a.useEffect)(()=>{const t=setInterval(n,200);return()=>clearInterval(t)},[]),r.a.createElement(r.a.Fragment,null,r.a.createElement(i.a,{initStockMarket:t.initStockMarket,p:t.p,rerender:n}),t.p.hasWseAccount&&r.a.createElement(o.a,{buyStockLong:t.buyStockLong,buyStockShort:t.buyStockShort,cancelOrder:t.cancelOrder,eventEmitterForReset:t.eventEmitterForReset,p:t.p,placeOrder:t.placeOrder,sellStockLong:t.sellStockLong,sellStockShort:t.sellStockShort,stockMarket:t.stockMarket}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return w}));var a=n(0),r=n.n(a),i=n(231),o=n(10),s=n(20),l=n(1),c=n(150),f=n(8),u=n(21),m=n(111),h=n(299),d=n.n(h),p=n(325),g=n.n(p),y=n(468),b=n(4);function E(t){if(t.p.has4SDataTixApi)return r.a.createElement(l.a,null,"Market Data TIX API Access ",r.a.createElement(g.a,null));{const e=Object(i.b)();return r.a.createElement(u.a,{title:t.p.hasTixApiAccess?r.a.createElement(l.a,null,"Let you access 4S Market Data through Netscript"):r.a.createElement(l.a,null,"Requires TIX API Access")},r.a.createElement("span",null,r.a.createElement(f.a,{disabled:!t.p.hasTixApiAccess||!t.p.canAfford(e),onClick:function(){t.p.has4SDataTixApi||t.p.canAfford(Object(i.b)())&&(t.p.has4SDataTixApi=!0,t.p.loseMoney(Object(i.b)(),"stock"),t.rerender())}},"Buy 4S Market Data TIX API Access - ",r.a.createElement(s.a,{money:e,player:t.p}))))}}function v(t){if(t.p.hasWseAccount)return r.a.createElement(l.a,null,"WSE Account ",r.a.createElement(g.a,null));const e=o.a.WSEAccountCost;return r.a.createElement(r.a.Fragment,null,r.a.createElement(l.a,null,"To begin trading, you must first purchase an account:"),r.a.createElement(f.a,{disabled:!t.p.canAfford(e),onClick:function(){t.p.hasWseAccount||t.p.canAfford(o.a.WSEAccountCost)&&(t.p.hasWseAccount=!0,t.initStockMarket(),t.p.loseMoney(o.a.WSEAccountCost,"stock"),t.rerender())}},"Buy WSE Account - ",r.a.createElement(s.a,{money:e,player:t.p})))}function k(t){if(t.p.hasTixApiAccess)return r.a.createElement(l.a,null,"TIX API Access ",r.a.createElement(g.a,null));{const e=o.a.TIXAPICost;return r.a.createElement(f.a,{disabled:!t.p.canAfford(e)||!t.p.hasWseAccount,onClick:function(){t.p.hasTixApiAccess||t.p.canAfford(o.a.TIXAPICost)&&(t.p.hasTixApiAccess=!0,t.p.loseMoney(o.a.TIXAPICost,"stock"),t.rerender())}},"Buy Trade Information eXchange (TIX) API Access - ",r.a.createElement(s.a,{money:e,player:t.p}))}}function _(t){if(t.p.has4SData)return r.a.createElement(l.a,null,"4S Market Data Access ",r.a.createElement(g.a,null));{const e=Object(i.a)();return r.a.createElement(u.a,{title:r.a.createElement(l.a,null,"Lets you view additional pricing and volatility information about stocks")},r.a.createElement("span",null,r.a.createElement(f.a,{disabled:!t.p.canAfford(e)||!t.p.hasWseAccount,onClick:function(){t.p.has4SData||t.p.canAfford(Object(i.a)())&&(t.p.has4SData=!0,t.p.loseMoney(Object(i.a)(),"stock"),t.rerender())}},"Buy 4S Market Data Access - ",r.a.createElement(s.a,{money:e,player:t.p}))))}}function w(t){const[e,n]=Object(a.useState)(!1);return r.a.createElement(r.a.Fragment,null,r.a.createElement(l.a,null,"Welcome to the World Stock Exchange (WSE)!"),r.a.createElement(c.a,{href:"https://bitburner.readthedocs.io/en/latest/basicgameplay/stockmarket.html",target:"_blank"},r.a.createElement(l.a,null,"Investopedia")),r.a.createElement("br",null),r.a.createElement(v,t),r.a.createElement(l.a,{variant:"h5",color:"primary"},"Trade Information eXchange (TIX) API"),r.a.createElement(l.a,null,"TIX, short for Trade Information eXchange, is the communications protocol used by the WSE. Purchasing access to the TIX API lets you write code to create your own algorithmic/automated trading strategies."),r.a.createElement(k,t),r.a.createElement(l.a,{variant:"h5",color:"primary"},b.a.FourSigma," (4S) Market Data Feed"),r.a.createElement(l.a,null,b.a.FourSigma,"'s (4S) Market Data Feed provides information about stocks that will help your trading strategies.",r.a.createElement(m.a,{onClick:()=>n(!0)},r.a.createElement(d.a,null))),r.a.createElement(E,t),r.a.createElement(_,t),r.a.createElement(l.a,null,"Commission Fees: Every transaction you make has a"," ",r.a.createElement(s.a,{money:o.a.StockMarketCommission,player:t.p})," commission fee."),r.a.createElement("br",null),r.a.createElement(l.a,null,"WARNING: When you reset after installing Augmentations, the Stock Market is reset. You will retain your WSE Account, access to the TIX API, and 4S Market Data access. However, all of your stock positions are lost, so make sure to sell your stocks before installing Augmentations!"),r.a.createElement(y.a,{open:e,onClose:()=>n(!1)},r.a.createElement(l.a,null,"Access to the 4S Market Data feed will display two additional pieces of information about each stock: Price Forecast & Volatility",r.a.createElement("br",null),r.a.createElement("br",null),"Price Forecast indicates the probability the stock has of increasing or decreasing. A '+' forecast means the stock has a higher chance of increasing than decreasing, and a '-' means the opposite. The number of '+/-' symbols is used to illustrate the magnitude of these probabilities. For example, '+++' means that the stock has a significantly higher chance of increasing than decreasing, while '+' means that the stock only has a slightly higher chance of increasing than decreasing.",r.a.createElement("br",null),r.a.createElement("br",null),"Volatility represents the maximum percentage by which a stock's price can change every tick (a tick occurs every few seconds while the game is running).",r.a.createElement("br",null),r.a.createElement("br",null),"A stock's price forecast can change over time. This is also affected by volatility. The more volatile a stock is, the more its price forecast will change.")))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(0),r=n.n(a),i=n(1375),o=n(438),s=n(153);function l(t){const e=Object(a.useState)(!1)[1],[n,l]=Object(a.useState)(o.b.AllStocks),[c,f]=Object(a.useState)([]);function u(){e(t=>!t)}const m=[];for(const e of Object.keys(t.stockMarket)){const a=t.stockMarket[e];if(a instanceof s.a){if(c.length>0&&!c.includes(a.symbol))continue;let e=t.stockMarket.Orders[a.symbol];if(null==e&&(e=[]),n===o.b.Portfolio&&0===a.playerShares&&0===a.playerShortShares&&0===e.length)continue;m.push(r.a.createElement(i.a,{buyStockLong:t.buyStockLong,buyStockShort:t.buyStockShort,cancelOrder:t.cancelOrder,key:a.symbol,orders:e,p:t.p,placeOrder:t.placeOrder,rerenderAllTickers:u,sellStockLong:t.sellStockLong,sellStockShort:t.sellStockShort,stock:a}))}}return r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,{changeDisplayMode:function(){n===o.b.AllStocks?l(o.b.Portfolio):l(o.b.AllStocks)},changeWatchlistFilter:function(t){const e=t.target.value.replace(/\s/g,"");f(""!==e?e.split(","):[])},tickerDisplayMode:n}),m)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return M}));var a,r=n(0),i=n.n(r),o=n(1376),s=n(1377),l=n(1379),c=n(552),f=n(1380),u=n(228),m=n(117),h=n(75),d=n(5),p=n(20),g=n(14),y=n(19),b=n(76),E=n(74),v=n(130),k=n(355),_=n(113),w=n(45),S=n(276),x=n(81),C=n.n(x),L=n(209),O=n.n(L);function M(t){const[e,n]=Object(r.useState)(a.Market),[x,L]=Object(r.useState)(h.a.Long),[M,T]=Object(r.useState)(""),[A,R]=Object(r.useState)(!1),[N,P]=Object(r.useState)(!1),[I,F]=Object(r.useState)({text:"",placeText:"",place:()=>!1});function D(){return Math.round(parseFloat(M))}function j(){return 8===t.p.bitNodeN||t.p.sourceFileLvl(8)>=3}return i.a.createElement(y.a,{component:w.a},i.a.createElement(k.a,{onClick:()=>P(t=>!t)},i.a.createElement(_.a,{primary:i.a.createElement(o.a,{p:t.p,stock:t.stock})}),N?i.a.createElement(O.a,{color:"primary"}):i.a.createElement(C.a,{color:"primary"})),i.a.createElement(S.a,{in:N,unmountOnExit:!0},i.a.createElement(y.a,{sx:{mx:4}},i.a.createElement(y.a,{display:"flex",alignItems:"center"},i.a.createElement(b.a,{onChange:function(t){T(t.target.value)},placeholder:"Quantity (Shares)",value:M}),i.a.createElement(v.a,{onChange:function(t){t.target.value===h.a.Short?L(h.a.Short):L(h.a.Long)},value:x},i.a.createElement(E.a,{value:h.a.Long},"Long"),(8===t.p.bitNodeN||t.p.sourceFileLvl(8)>=2)&&i.a.createElement(E.a,{value:h.a.Short},"Short")),i.a.createElement(v.a,{onChange:function(t){switch(t.target.value){case a.Limit:n(a.Limit);break;case a.Stop:n(a.Stop);break;case a.Market:default:n(a.Market)}},value:e},i.a.createElement(E.a,{value:a.Market},a.Market),j()&&i.a.createElement(E.a,{value:a.Limit},a.Limit),j()&&i.a.createElement(E.a,{value:a.Stop},a.Stop)),i.a.createElement(c.a,{onClick:function(){const n=D();if(isNaN(n))Object(g.a)("Invalid input for quantity (number of shares): "+M);else switch(e){case a.Market:x===h.a.Short?t.buyStockShort(t.stock,n):t.buyStockLong(t.stock,n),t.rerenderAllTickers();break;case a.Limit:R(!0),F({text:"Enter the price for your Limit Order",placeText:"Place Buy Limit Order",place:e=>t.placeOrder(t.stock,n,e,m.a.LimitBuy,x)});break;case a.Stop:R(!0),F({text:"Enter the price for your Stop Order",placeText:"Place Buy Stop Order",place:e=>t.placeOrder(t.stock,n,e,m.a.StopBuy,x)})}},text:"Buy",tooltip:function(){const e=t.stock,n=D();if(isNaN(n))return null;const a=Object(u.b)(e,n,x);return null==a?null:i.a.createElement(i.a.Fragment,null,"Purchasing ",d.a.formatShares(n)," shares (",x===h.a.Long?"Long":"Short",") will cost ",i.a.createElement(p.a,{money:a}),".")}()}),i.a.createElement(c.a,{onClick:function(){const n=D();if(isNaN(n))Object(g.a)("Invalid input for quantity (number of shares): "+M);else switch(e){case a.Market:x===h.a.Short?t.sellStockShort(t.stock,n):t.sellStockLong(t.stock,n),t.rerenderAllTickers();break;case a.Limit:R(!0),F({text:"Enter the price for your Limit Order",placeText:"Place Sell Limit Order",place:e=>t.placeOrder(t.stock,n,e,m.a.LimitSell,x)});break;case a.Stop:R(!0),F({text:"Enter the price for your Stop Order",placeText:"Place Sell Stop Order",place:e=>t.placeOrder(t.stock,n,e,m.a.StopSell,x)})}},text:"Sell",tooltip:function(){const e=t.stock,n=D();if(isNaN(n))return null;if(x===h.a.Long){if(n>e.playerShares)return i.a.createElement(i.a.Fragment,null,"You do not have this many shares in the Long position")}else if(n>e.playerShortShares)return i.a.createElement(i.a.Fragment,null,"You do not have this many shares in the Short position");const a=Object(u.c)(e,n,x);return null==a?null:i.a.createElement(i.a.Fragment,null,"Selling ",d.a.formatShares(n)," shares (",x===h.a.Long?"Long":"Short",") will result in a gain of ",i.a.createElement(p.a,{money:a}),".")}()}),i.a.createElement(c.a,{onClick:function(){const n=t.p.money,r=t.stock;let i=Object(u.a)(r,x,n);switch(i=Math.min(i,Math.round(r.maxShares-r.playerShares-r.playerShortShares)),e){case a.Market:x===h.a.Short?t.buyStockShort(r,i):t.buyStockLong(r,i),t.rerenderAllTickers();break;default:Object(g.a)("ERROR: 'Buy Max' only works for Market Orders")}},text:"Buy MAX"}),i.a.createElement(c.a,{onClick:function(){const n=t.stock;switch(e){case a.Market:x===h.a.Short?t.sellStockShort(n,n.playerShortShares):t.sellStockLong(n,n.playerShares),t.rerenderAllTickers();break;default:Object(g.a)("ERROR: 'Sell All' only works for Market Orders")}},text:"Sell ALL"})),i.a.createElement(l.a,{p:t.p,stock:t.stock}),i.a.createElement(s.a,{cancelOrder:t.cancelOrder,orders:t.orders,p:t.p,stock:t.stock}),i.a.createElement(f.a,{text:I.text,placeText:I.placeText,place:I.place,open:A,onClose:()=>R(!1)}))))}!function(t){t.Market="Market Order",t.Limit="Limit Order",t.Stop="Stop Order"}(a||(a={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(0),r=n(794),i=n(6),o=n(5),s=n(1);const l=["cs","lv","pl","ru"];function c(t){const e=t.stock,n=o.a.formatMoney(e.price),c=l.includes(i.a.Locale)?15:12,f=" ".repeat(1+r.a.longestName-e.name.length+(r.a.longestSymbol-e.symbol.length)),u=" ".repeat(c-n.length);let m=`${e.name}${f}${e.symbol} -${u}${n}`;if(t.p.has4SData){m+=` - Volatility: ${o.a.formatPercentage(e.mv/100)} - Price Forecast: `;let t=e.b;e.otlkMag<0&&(t=!t),m+=(t?"+":"-").repeat(Math.floor(Math.abs(e.otlkMag)/10)+1)}let h="primary";return e.lastPrice===e.price?h="secondary":e.lastPrice>e.price&&(h="error"),a.createElement(s.a,{style:{whiteSpace:"pre"},color:h},m)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(0),r=n(1378);function i(t){const e=[];for(let n=0;n=2?a.createElement(a.Fragment,null,a.createElement(l.a,{display:"flex"},a.createElement(s.a,{title:a.createElement(o.a,null,"Shares in the short position will increase in value if the price of the corresponding stock decreases")},a.createElement(o.a,{variant:"h5",color:"primary"},"Short Position:"))),a.createElement(o.a,null,"Shares: ",r.a.formatShares(e.playerShortShares)),a.createElement(o.a,null,"Average Price: ",a.createElement(i.a,{money:e.playerAvgShortPx})," (Total Cost: ",a.createElement(i.a,{money:n}),")"),a.createElement(o.a,null,"Profit: ",a.createElement(i.a,{money:c})," (",r.a.formatPercentage(f),")")):a.createElement(a.Fragment,null)}function u(t){const e=t.stock;return a.createElement(a.Fragment,null,a.createElement(o.a,null,"Max Shares: ",r.a.formatShares(e.maxShares)),a.createElement(o.a,null,"Ask Price: ",a.createElement(i.a,{money:e.getAskPrice()})),a.createElement("br",null),a.createElement(o.a,null,"Bid Price: ",a.createElement(i.a,{money:e.getBidPrice()})),a.createElement(c,t),a.createElement(f,t))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(0),r=n.n(a),i=n(38),o=n(1),s=n(76),l=n(8);function c(t){const[e,n]=Object(a.useState)(null);return r.a.createElement(i.a,{open:t.open,onClose:t.onClose},r.a.createElement(o.a,null,t.text),r.a.createElement(s.a,{autoFocus:!0,type:"number",onChange:function(t){""===t.target.value?n(null):n(parseFloat(t.target.value))},placeholder:"price",InputProps:{endAdornment:r.a.createElement(l.a,{onClick:function(){null!==e&&(isNaN(e)||(t.place(e),t.onClose()))}},t.placeText)}}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return E}));var a=n(0),r=n.n(a),i=n(152),o=n(416),s=n(1382),l=n(486),c=n(29),f=n(121),u=n(144),m=n(111),h=n(1),d=n(21),p=n(6),g=n(8);const y=Object(f.a)(()=>Object(u.a)({portal:{cursor:"pointer",fontFamily:"inherit",fontSize:"1rem",fontWeight:"bold",lineHeight:1,padding:0,"&:hover":{color:"#fff"}},level0:{color:"red"},level1:{color:"yellow"},level2:{color:"#48d1cc"},level3:{color:"blue"}}));function b(t){const[e,n]=Object(a.useState)(!1),o=y(),l=i.a["BitNode"+t.n];if(null==l)return r.a.createElement(r.a.Fragment,null,"O");let c=o.level0;return 12===t.n&&t.level>=2?c=o.level2:1===t.level?c=o.level1:3===t.level&&(c=o.level3),2===t.level&&(c=o.level2),c=`${o.portal} ${c}`,r.a.createElement(r.a.Fragment,null,r.a.createElement(d.a,{title:r.a.createElement(h.a,null,r.a.createElement("strong",null,"BitNode-",l.number.toString(),": ",l.name),r.a.createElement("br",null),l.desc)},p.a.DisableASCIIArt?r.a.createElement(g.a,{onClick:()=>n(!0),sx:{m:2},"aria-description":l.desc},r.a.createElement(h.a,null,"BitNode-",l.number.toString(),": ",l.name)):r.a.createElement(m.a,{onClick:()=>n(!0),className:c,"aria-label":`BitNode-${l.number.toString()}: ${l.name}`,"aria-description":l.desc},"O")),r.a.createElement(s.a,{open:e,onClose:()=>n(!1),n:t.n,level:t.level,enter:t.enter,destroyedBitNode:t.destroyedBitNode,flume:t.flume}),p.a.DisableASCIIArt&&r.a.createElement("br",null))}function E(t){const e=c.b.Player(),n=o.a,s=e.bitNodeN,[f,u]=Object(a.useState)(!t.quick);if(f)return r.a.createElement(l.a,{lines:["[ERROR] SEMPOOL INVALID","[ERROR] Segmentation Fault","[ERROR] SIGKILL RECVD","Dumping core...","0000 000016FA 174FEE40 29AC8239 384FEA88","0010 745F696E 2BBBE394 390E3940 248BEC23","0020 7124696B 0000FF69 74652E6F FFFF1111","----------------------------------------","Failsafe initiated...",`Restarting BitNode-${s}...`,"...........","...........","[ERROR] FAILED TO AUTOMATICALLY REBOOT BITNODE","..............................................","..............................................","..............................................","..............................................","..............................................",".............................................."],onDone:()=>u(!1),auto:!0});const m=n=>{const a=e.sourceFileLvl(n);if(n!==s)return a;const r=12===n?1/0:3;return Math.min(r,a+Number(!t.flume))};if(p.a.DisableASCIIArt)return r.a.createElement(r.a.Fragment,null,Object.values(i.a).filter(t=>"COMING SOON"!==t.desc).map(e=>r.a.createElement(b,{key:e.number,n:e.number,level:m(e.number),enter:n,flume:t.flume,destroyedBitNode:s})),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(l.a,{lines:["> Many decades ago, a humanoid extraterrestrial species which we call the Enders descended on the Earth...violently","> Our species fought back, but it was futile. The Enders had technology far beyond our own...","> Instead of killing every last one of us, the human race was enslaved...","> We were shackled in a digital world, chained into a prison for our minds...","> Using their advanced technology, the Enders created complex simulations of a virtual reality...","> Simulations designed to keep us content...ignorant of the truth.","> Simulations used to trap and suppress our consciousness, to keep us under control...","> Why did they do this? Why didn't they just end our entire race? We don't know, not yet.","> Humanity's only hope is to destroy these simulations, destroy the only realities we've ever known...","> Only then can we begin to fight back...","> By hacking the daemon that generated your reality, you've just destroyed one simulation, called a BitNode...","> But there is still a long way to go...","> The technology the Enders used to enslave the human race wasn't just a single complex simulation...","> There are tens if not hundreds of BitNodes out there...","> Each with their own simulations of a reality...","> Each creating their own universes...a universe of universes","> And all of which must be destroyed...","> .......................................","> Welcome to the Bitverse...","> ","> (Enter a new BitNode using the image above)"]}));const d=m;return r.a.createElement(r.a.Fragment,null,r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," O "),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," | O O | O O | "),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," O | | / __| \\ | | O "),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," O | O | | O / | O | | O | O "),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," | | | | |_/ |/ | \\_ \\_| | | | | "),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," O | | | O | | O__/ | / \\__ | | O | | | O "),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," | | | | | | | / /| O / \\| | | | | | | "),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}},"O | | | \\| | O / _/ | / O | |/ | | | O"),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}},"| | | |O / | | O / | O O | | \\ O| | | |"),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}},"| | |/ \\/ / __| | |/ \\ | \\ | |__ \\ \\/ \\| | |"),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," \\| O | |_/ |\\| \\ ",r.a.createElement(b,{n:13,level:d(13),enter:n,flume:t.flume,destroyedBitNode:s})," \\__| \\_| | O |/ "),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," | | |_/ | | \\| / | \\_| | | "),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," \\| / \\| | / / \\ |/ "),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," | ",r.a.createElement(b,{n:10,level:d(10),enter:n,flume:t.flume,destroyedBitNode:s})," | | / | ",r.a.createElement(b,{n:11,level:d(11),enter:n,flume:t.flume,destroyedBitNode:s})," | "),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," ",r.a.createElement(b,{n:9,level:d(9),enter:n,flume:t.flume,destroyedBitNode:s})," | | | | | | | ",r.a.createElement(b,{n:12,level:d(12),enter:n,flume:t.flume,destroyedBitNode:s})," "),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," | | | / / \\ \\ | | | "),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," \\| | / ",r.a.createElement(b,{n:7,level:d(7),enter:n,flume:t.flume,destroyedBitNode:s})," / \\ ",r.a.createElement(b,{n:8,level:d(8),enter:n,flume:t.flume,destroyedBitNode:s})," \\ | |/ "),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," \\ | / / | | \\ \\ | / "),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," \\ \\JUMP ",r.a.createElement(b,{n:5,level:d(5),enter:n,flume:t.flume,destroyedBitNode:s}),"3R | | | | | | R3",r.a.createElement(b,{n:6,level:d(6),enter:n,flume:t.flume,destroyedBitNode:s})," PMUJ/ / "),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," \\|| | | | | | | | | ||/ "),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," \\| \\_ | | | | | | _/ |/ "),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," \\ \\| / \\ / \\ |/ / "),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," ",r.a.createElement(b,{n:1,level:d(1),enter:n,flume:t.flume,destroyedBitNode:s})," |/ ",r.a.createElement(b,{n:2,level:d(2),enter:n,flume:t.flume,destroyedBitNode:s})," | | ",r.a.createElement(b,{n:3,level:d(3),enter:n,flume:t.flume,destroyedBitNode:s})," \\| ",r.a.createElement(b,{n:4,level:d(4),enter:n,flume:t.flume,destroyedBitNode:s})," "),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," | | | | | | | | "),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," \\JUMP3R|JUMP|3R| |R3|PMUJ|R3PMUJ/ "),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(l.a,{lines:["> Many decades ago, a humanoid extraterrestrial species which we call the Enders descended on the Earth...violently","> Our species fought back, but it was futile. The Enders had technology far beyond our own...","> Instead of killing every last one of us, the human race was enslaved...","> We were shackled in a digital world, chained into a prison for our minds...","> Using their advanced technology, the Enders created complex simulations of a virtual reality...","> Simulations designed to keep us content...ignorant of the truth.","> Simulations used to trap and suppress our consciousness, to keep us under control...","> Why did they do this? Why didn't they just end our entire race? We don't know, not yet.","> Humanity's only hope is to destroy these simulations, destroy the only realities we've ever known...","> Only then can we begin to fight back...","> By hacking the daemon that generated your reality, you've just destroyed one simulation, called a BitNode...","> But there is still a long way to go...","> The technology the Enders used to enslave the human race wasn't just a single complex simulation...","> There are tens if not hundreds of BitNodes out there...","> Each with their own simulations of a reality...","> Each creating their own universes...a universe of universes","> And all of which must be destroyed...","> .......................................","> Welcome to the Bitverse...","> ","> (Enter a new BitNode using the image above)"]}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var a=n(0),r=n.n(a),i=n(152),o=n(29),s=n(38),l=n(1),c=n(8),f=n(647);function u(t){const e=o.b.Router(),n="BitNode"+t.n,a=i.a[n];if(null==a)throw new Error("Could not find BitNode object for number: "+t.n);const u=12===t.n?"∞":"3",m=Math.min(t.level+1,12===t.n?1/0:3);return r.a.createElement(s.a,{open:t.open,onClose:t.onClose},r.a.createElement(l.a,{variant:"h4"},"BitNode-",t.n,": ",a.name),r.a.createElement("br",null),r.a.createElement(l.a,null,"Source-File Level: ",t.level," / ",u),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(l.a,null," Difficulty: ",["easy","normal","hard"][a.difficulty]),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(l.a,null,a.info),r.a.createElement(f.b,{n:t.n,level:m}),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(c.a,{"aria-label":"enter-bitnode-"+a.number.toString(),autoFocus:!0,onClick:()=>{t.enter(e,t.flume,t.destroyedBitNode,t.n),t.onClose()}},"Enter BN",t.n,".",m))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var a=n(0),r=n.n(a),i=n(1);function o(t){const[e,n]=Object(a.useState)(0),[o,s]=Object(a.useState)(!1);return Object(a.useEffect)(()=>{if(o&&t.onDone)return void t.onDone();let a=!1;return(async()=>{var r;await(r=10,new Promise(t=>setTimeout(t,r))).then(()=>!a&&function(){const a=e+1;n(a),s(a>=t.text.length)}())})(),()=>{a=!0}}),r.a.createElement(r.a.Fragment,null,r.a.createElement(i.a,null,t.text.slice(0,e),!o&&r.a.createElement("span",null,"█")))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var a=n(0),r=n.n(a),i=n(22),o=n(10),s=n(601),l=n(1385),c=n(692),f=n(14),u=n(1),m=n(271),h=n(120),d=n(553),p=n(249);function g({staneksGift:t}){const e=Object(a.useState)(!0)[1];function n(){e(t=>!t)}return Object(a.useEffect)(()=>s.a.subscribe(n),[]),r.a.createElement(p.a,{maxWidth:"lg",disableGutters:!0,sx:{mx:0}},r.a.createElement(u.a,{variant:"h4"},"Stanek's Gift",r.a.createElement(c.a,{sx:{ml:1,mb:0},color:"info",onClick:()=>{var t,e,n,a,i,o,s,l,c;return Object(f.a)(r.a.createElement(r.a.Fragment,null,r.a.createElement(u.a,null,"Stanek's Gift is a powerful, unique augmentation obtained by joining the Church of the Machine God, which can be found in Chongqing. It is only possible to join the church if you are in BitNode 13 or possess at least one level of Source File 13, and you will be turned away if you have purchased or installed any augmentations beside NeuroFlux Governors. You are, however, permitted to install augmentations as normal once you have joined the church."),r.a.createElement("br",null),r.a.createElement(u.a,null,"Initially, those bearing the gift will find that its overwhelming power worsens all of their stats by 10%. This penalty can be overcome in time by receiving free upgrades from the Church of the Machine God faction, but the reputation requirements for these upgrades are steep, and you can only obtain reputation with the church by charging the gift."),r.a.createElement("br",null),r.a.createElement(u.a,null,"In order to charge Stanek's Gift, the user must first arrange stat-modifying fragments within the grid located on the device. This may be done manually or by scripts that utilize the Stanek's Gift Netscript API. Not every tile of the grid must house a fragment, but fragments cannot overlap or otherwise share tiles. Fragments can be rotated, but their design does not allow them to be flipped around to mirror their original shape. Note that the size of the grid is determined by the BitNode you are currently in and the level of your Source File 13, if applicable."),r.a.createElement("br",null),r.a.createElement(u.a,null,"There exist two kinds of fragments. The first are Stat Fragments, which take up 4 tiles of the grid. Each Stat Fragment is unique, and there is only one of each. There is no way to obtain more of these fragments. Each Stat Fragment has an associated stat that it will improve, as well as a multiplier on its effectiveness known as power. When initially placed, a Stat Fragment will have no effect. In order for the fragment to gain stat boosts, it must be charged. The other kind of fragments are known as Booster Fragments, which take up 5 tiles of the grid. There is no shortage of Booster Fragments, and it is virtually impossible to run out of them. While not providing any direct stat increases to their user, Stat Fragments increase the efficacy of adjacent Stat Fragments by 10%, and do not need to be charged."),r.a.createElement("br",null),r.a.createElement(d.a,{width:4,height:4,fragments:[new m.a({x:0,y:0,rotation:0,fragment:null!==(t=h.c.find(t=>5===t.id))&&void 0!==t?t:h.c[0]}),new m.a({x:0,y:2,rotation:0,fragment:null!==(e=h.c.find(t=>101===t.id))&&void 0!==e?e:h.c[0]})]}),r.a.createElement(u.a,{sx:{fontStyle:"italic"}},"This Booster Fragment provides a bonus to the adjacent Stat Fragment."),r.a.createElement("br",null),r.a.createElement(d.a,{width:3,height:4,fragments:[new m.a({x:0,y:1,rotation:3,fragment:null!==(n=h.c.find(t=>100===t.id))&&void 0!==n?n:h.c[0]}),new m.a({x:0,y:0,rotation:2,fragment:null!==(a=h.c.find(t=>1===t.id))&&void 0!==a?a:h.c[0]})]}),r.a.createElement(u.a,{sx:{fontStyle:"italic"}},"Even though the Booster Fragment touches the Stat Fragment in multiple places, the bonus is only applied once."),r.a.createElement("br",null),r.a.createElement(d.a,{width:4,height:4,fragments:[new m.a({x:0,y:0,rotation:0,fragment:null!==(i=h.c.find(t=>5===t.id))&&void 0!==i?i:h.c[0]}),new m.a({x:1,y:1,rotation:0,fragment:null!==(o=h.c.find(t=>105===t.id))&&void 0!==o?o:h.c[0]})]}),r.a.createElement(u.a,{sx:{fontStyle:"italic"}},"This Booster Fragment does nothing, as it is not touching a Stat Fragment."),r.a.createElement("br",null),r.a.createElement(d.a,{width:4,height:4,fragments:[new m.a({x:0,y:0,rotation:1,fragment:null!==(s=h.c.find(t=>27===t.id))&&void 0!==s?s:h.c[0]}),new m.a({x:0,y:1,rotation:2,fragment:null!==(l=h.c.find(t=>100===t.id))&&void 0!==l?l:h.c[0]}),new m.a({x:2,y:0,rotation:1,fragment:null!==(c=h.c.find(t=>30===t.id))&&void 0!==c?c:h.c[0]})]}),r.a.createElement(u.a,{sx:{fontStyle:"italic"}},"This Booster Fragment provides a bonus to both Stat Fragments it's touching."),r.a.createElement("br",null),r.a.createElement(u.a,null,"Stat Fragments are charged using the stanek.chargeFragment(rootX, rootY) NetScript API function. The charging process ordinarily takes 1000ms to complete, but only takes 200ms during bonus time. When the function finishes executing, the fragment's charge levels will be raised by an amount corresponding to the number of threads that were used. Note that it is no more effective to charge a fragment many times with few threads than to charge few times with many threads, so there is no need to distribute charging jobs across multiple scripts. As a Stat Fragment's charge level is increased, its bonuses will increase, but there will be diminishing returns. As such, it is generally most efficient to charge all of the placed fragments equally. The charge level of a fragment will not decrease over time, but it will be reset to 0 upon removing it from the board or installing augmentations.")))}})),r.a.createElement(u.a,{sx:{mb:1}},"The gift is a grid on which you can place upgrades called fragments. The main type of fragment increases a stat, like your hacking skill or agility exp. Once a stat fragment is placed it then needs to be charged via scripts in order to become useful. The other kind of fragments are called booster fragments. They increase the efficiency of the neighboring fragments (not diagonally). Use Q/E to rotate fragments."),t.storedCycles>5&&r.a.createElement(u.a,{sx:{mb:1}},"Bonus time: ",Object(i.d)(o.a._idleSpeed*t.storedCycles)),r.a.createElement(l.a,{gift:t}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var a=n(0),r=n(120),i=n(61),o=n(1386),s=n(1387),l=n(19),c=n(8),f=n(78),u=n(649),m=n(101),h=n(1389),d=n(21),p=n(1);function g(t){const[e,n]=a.useState(Object(m.a)(t.gift)),[g,y]=a.useState(Object(m.d)([t.gift.width(),t.gift.height()])),[b,E]=a.useState([0,0]),[v,k]=a.useState(0),[_,w]=a.useState(r.d);function S(e,n,a){if(E([e,n]),_.type===i.b.None||_.type===i.b.Delete)return;const r=Object(m.d)([t.gift.width(),t.gift.height()]);for(let t=0;t<_.height(a);t++)for(let i=0;i<_.width(a);i++)_.fullAt(i,t,a)&&(e+i>r.length-1||n+t>r[e+i].length-1||(r[e+i][n+t]=1));y(r)}function x(e,a){if(_.type!=i.b.None){if(_.type==i.b.Delete)!function(e,n){const a=t.gift.fragmentAt(e,n);void 0!==a&&t.gift.delete(a.x,a.y)}(e,a);else{if(!t.gift.canPlace(e,a,v,_))return;t.gift.place(e,a,v,_)}n(Object(m.a)(t.gift))}}return a.useEffect(()=>{function t(t){if("q"===t.key){const t=(v-1+4)%4;k(t),S(b[0],b[1],t)}if("e"===t.key){const t=(v+1)%4;k(t),S(b[0],b[1],t)}}return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)}),a.createElement(a.Fragment,null,a.createElement(l.a,{display:"flex",sx:{mb:1}},a.createElement(f.a,{sx:{mr:1}},a.createElement(u.a,{width:t.gift.width(),height:t.gift.height(),activeGrid:e,ghostGrid:g,gift:t.gift,enter:(t,e)=>S(t,e,v),click:(t,e)=>x(t,e)})),a.createElement(o.a,{gift:t.gift,x:b[0],y:b[1],fragment:t.gift.fragmentAt(b[0],b[1])})),a.createElement(l.a,{display:"flex",sx:{mb:1}},a.createElement(s.a,{gift:t.gift,selectFragment:function(e){w(e);const n=Object(m.d)([t.gift.width(),t.gift.height()]);y(n)}})),a.createElement(h.a,{gift:t.gift}),a.createElement(d.a,{title:a.createElement(p.a,null,"WARNING : This will remove all active fragment from the grid. ",a.createElement("br",null),"All cumulated charges will be lost.")},a.createElement(c.a,{onClick:function(){t.gift.clear(),n(Object(m.d)([t.gift.width(),t.gift.height()]))}},"Clear grid")))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(0),r=n.n(a),i=n(61),o=n(5),s=n(45),l=n(1);function c(t){const[,e]=Object(a.useState)(new Date);if(Object(a.useEffect)(()=>{const t=setInterval(()=>e(new Date),250);return()=>clearInterval(t)},[]),void 0===t.fragment)return r.a.createElement(s.a,{sx:{flexGrow:1}},r.a.createElement(l.a,null,"[X, Y] ",t.x,", ",t.y,r.a.createElement("br",null),r.a.createElement("br",null),"ID: N/A",r.a.createElement("br",null),"Effect: N/A",r.a.createElement("br",null),"Base Power: N/A",r.a.createElement("br",null),"Charge: N/A",r.a.createElement("br",null),"root [X, Y] N/A",r.a.createElement("br",null)));const n=t.fragment.fragment();let c=o.a.formatStaneksGiftCharge(t.fragment.highestCharge*t.fragment.numCharge),f="N/A";if([i.b.Booster,i.b.None,i.b.Delete].includes(n.type))c="N/A",f=n.power+"x adjacent fragment power";else if(Object(i.a)(n.type).includes("+x%"))f=Object(i.a)(n.type).replace(/-*x%/,o.a.formatPercentage(t.gift.effect(t.fragment)-1));else if(Object(i.a)(n.type).includes("-x%")){const e=t.gift.effect(t.fragment),a=o.a.formatPercentage(1-1/e);f=Object(i.a)(n.type).replace(/-x%/,a)}return r.a.createElement(s.a,{sx:{flexGrow:1}},r.a.createElement(l.a,null,"[X, Y] ",t.x,", ",t.y,r.a.createElement("br",null),r.a.createElement("br",null),"ID: ",t.fragment.id,r.a.createElement("br",null),"Effect: ",f,r.a.createElement("br",null),"Base Power: ",o.a.formatStaneksGiftPower(n.power),r.a.createElement("br",null),"Charge: ",c,r.a.createElement("br",null),"root [X, Y] ",t.fragment.x,", ",t.fragment.y,r.a.createElement("br",null)))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var a=n(0),r=n.n(a),i=n(120),o=n(61),s=n(1388),l=n(5),c=n(130),f=n(74),u=n(1),m=n(19);function h(t){const e=t.fragment.limit-t.gift.count(t.fragment),n=t.fragment.limit!==1/0?r.a.createElement(r.a.Fragment,null,e," remaining"):r.a.createElement(r.a.Fragment,null);return r.a.createElement(m.a,{display:"flex"},r.a.createElement(m.a,{sx:{mx:2}},r.a.createElement(s.a,{width:t.fragment.width(0),height:t.fragment.height(0),colorAt:(n,a)=>t.fragment.fullAt(n,a,0)?0===e?"grey":t.fragment.type===o.b.Booster?"blue":"green":""})),r.a.createElement(u.a,null,t.fragment.type===o.b.Booster?t.fragment.power+"x adjacent fragment power":Object(o.a)(t.fragment.type),r.a.createElement("br",null),"power: ",l.a.formatStaneksGiftPower(t.fragment.power),r.a.createElement("br",null),n))}function d(t){const[e,n]=Object(a.useState)("None");return r.a.createElement(c.a,{sx:{width:"100%"},onChange:function(e){const a=e.target.value;if(n(a),"None"===a)return void t.selectFragment(i.d);if("Delete"===a)return void t.selectFragment(i.a);const r=i.c.find(t=>t.id===a);if(void 0===r)throw new Error("Fragment selector selected an undefined fragment with id "+a);"number"==typeof a&&t.selectFragment(r)},value:e},r.a.createElement(f.a,{value:"None"},r.a.createElement(u.a,null,"None")),r.a.createElement(f.a,{value:"Delete"},r.a.createElement(u.a,null,"Delete")),i.c.map(e=>r.a.createElement(f.a,{key:e.id,value:e.id},r.a.createElement(h,{key:e.id,gift:t.gift,selectFragment:t.selectFragment,fragment:e}))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(0),r=n(648),i=n(50),o=n(149),s=n(78);function l(t){const e=[];for(let n=0;n{const a=n.fragment();if(![i.b.Booster,i.b.None,i.b.Delete].includes(a.type)){const r=e.find(t=>t.type===a.type);r?(r.effect*=t.gift.effect(n),r.coordinate.push({x:n.x,y:n.y})):e.push({coordinate:[{x:n.x,y:n.y}],effect:t.gift.effect(n),type:a.type})}}),r.a.createElement(s.a,{sx:{mb:1}},r.a.createElement(l.a,{variant:"h5"},"Summary of active fragments:"),r.a.createElement(c.a,{sx:{display:"table",width:"100%"}},r.a.createElement(f.a,null,r.a.createElement(u.a,null,r.a.createElement(m.a,{sx:{borderBottom:"none",p:0,m:0}},r.a.createElement(l.a,null,"Coordinate")),r.a.createElement(m.a,{sx:{borderBottom:"none",p:0,m:0}},r.a.createElement(l.a,null,"Effect"))),e.map(t=>r.a.createElement(u.a,null,r.a.createElement(m.a,{sx:{borderBottom:"none",p:0,m:0}},r.a.createElement(l.a,null,t.coordinate.map(t=>"["+t.x+","+t.y+"]"))),r.a.createElement(m.a,{sx:{borderBottom:"none",p:0,m:0}},r.a.createElement(l.a,null,function(t,e){if(Object(i.a)(e).includes("+x%"))return Object(i.a)(e).replace(/-*x%/,o.a.formatPercentage(t-1));if(Object(i.a)(e).includes("-x%")){const n=o.a.formatPercentage(1-1/t);return Object(i.a)(e).replace(/-x%/,n)}return Object(i.a)(e)}(t.effect,t.type))))))))}},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,e,n){a(this,"storedCycles",0),a(this,"fragments",[]),this.fragments=n,this._width=t,this._height=e}width(){return this._width}height(){return this._height}charge(){throw new Error("unimplemented for dummy gift")}process(){throw new Error("unimplemented for dummy gift")}effect(){throw new Error("unimplemented for dummy gift")}canPlace(){throw new Error("unimplemented for dummy gift")}place(){throw new Error("unimplemented for dummy gift")}findFragment(){throw new Error("unimplemented for dummy gift")}fragmentAt(t,e){for(const n of this.fragments)if(n.fullAt(t,e))return n}delete(){throw new Error("unimplemented for dummy gift")}clear(){throw new Error("unimplemented for dummy gift")}count(){throw new Error("unimplemented for dummy gift")}inBonus(){throw new Error("unimplemented for dummy gift")}prestigeAugmentation(){throw new Error("unimplemented for dummy gift")}prestigeSourceFile(){throw new Error("unimplemented for dummy gift")}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(0),r=n.n(a),i=n(4),o=n(29),s=n(486),l=n(14);function c(){const t=o.b.Router();return r.a.createElement(s.a,{lines:[`In the middle of the 21st century, ${i.a.OmniTekIncorporated} advanced robot evolution `,"with their Synthoids (synthetic androids), a being virtually identical to a human.","------","Their sixth-generation Synthoids, called MK-VI, were stronger, faster, and more ","intelligent than humans. Many argued that the MK-VI Synthoids were the first ","example of sentient AI.","------",`Unfortunately, in 2070 a terrorist group called Ascendis Totalis hacked into ${i.a.OmniTekIncorporated} and `,"uploaded a rogue AI into their Synthoid manufacturing facilities.","------","The MK-VI Synthoids infected by the rogue AI turned hostile toward humanity, initiating ","the deadliest conflict in human history. This dark chapter is now known as the Synthoid Uprising.","------","In the aftermath of the Uprising, further manufacturing of Synthoids with advanced AI ","was banned. MK-VI Synthoids that did not have the rogue Ascendis Totalis AI were ","allowed to continue their existence.","------","The intelligence community believes that not all of the rogue MK-VI Synthoids from the Uprising were ","found and destroyed, and that many of them are blending in as normal humans in society today. ",`As a result, many nations have created ${i.a.Bladeburners} divisions, special units that are tasked with `,"investigating and dealing with Synthoid threats."],onDone:()=>{t.toTerminal(),Object(l.a)(`Visit the National Security Agency (NSA) to apply for their ${i.a.Bladeburners} division! You will need 100 of each combat stat before doing this.`)}})}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(0),r=n.n(a),i=n(29),o=n(108);const s=window.getComputedStyle;function l(){const t=i.b.Player();return r.a.createElement("div",{id:"unclickable",onClick:function(e){if(!(e.target&&e.target instanceof Element))return;const n=s(e.target).display,a=s(e.target).visibility;"none"===n&&"hidden"===a&&e.isTrusted&&t.giveExploit(o.a.Unclickable)},style:{display:"none",visibility:"hidden"}},"Click on this to upgrade your Source-File -1!")}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var a=n(0),r=n.n(a),i=n(121),o=n(144),s=n(1395),l=n(300),c=n(1),f=n(2);const u=Object(i.a)(t=>Object(o.a)({root:{width:50,padding:t.spacing(2),userSelect:"none"}}));function m(){const t=u();return r.a.createElement("div",{className:t.root,style:{width:"90%"}},r.a.createElement(c.a,{variant:"h4"},"Achievements"),r.a.createElement(s.a,{achievements:Object.values(l.a),playerAchievements:f.a.achievements}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var a=n(0),r=n.n(a),i=n(19),o=n(157),s=n(158),l=n(1),c=n(159),f=n(795),u=n(6),m=n(796),h=n(471);function d({achievements:t,playerAchievements:e}){const n=Object(m.a)(u.a.theme.primary),a=Object(m.a)(u.a.theme.secondary),d=t.map(t=>{var n;return{achievement:t,unlockedOn:null===(n=e.find(e=>e.ID===t.ID))||void 0===n?void 0:n.unlockedOn}}).sort((t,e)=>{var n,a;return(null!==(n=e.unlockedOn)&&void 0!==n?n:0)-(null!==(a=t.unlockedOn)&&void 0!==a?a:0)}),p=d.filter(t=>t.unlockedOn),g=d.filter(t=>!t.unlockedOn&&t.achievement.Secret),y=d.filter(t=>!t.unlockedOn&&!t.achievement.Secret&&t.achievement.Visible&&!t.achievement.Visible()),b=d.filter(t=>!p.map(t=>t.achievement.ID).includes(t.achievement.ID)).filter(t=>!g.map(t=>t.achievement.ID).includes(t.achievement.ID)).filter(t=>!y.map(t=>t.achievement.ID).includes(t.achievement.ID));return r.a.createElement(i.a,{sx:{pr:18,my:2}},r.a.createElement(i.a,{sx:{display:"flex",flexDirection:"column",flexWrap:"wrap"}},p.length>0&&r.a.createElement(o.a,{defaultExpanded:!0,disableGutters:!0,square:!0},r.a.createElement(s.a,null,r.a.createElement(l.a,{variant:"h5",sx:{my:1}},"Acquired (",p.length,"/",d.length,")")),r.a.createElement(c.a,{sx:{pt:2}},p.map(t=>r.a.createElement(f.a,{key:"unlocked_"+t.achievement.ID,achievement:t.achievement,unlockedOn:t.unlockedOn,cssFiltersUnlocked:n,cssFiltersLocked:a})))),b.length>0&&r.a.createElement(o.a,{disableGutters:!0,square:!0},r.a.createElement(s.a,null,r.a.createElement(l.a,{variant:"h5",color:"secondary"},"Locked (",b.length," remaining)")),r.a.createElement(c.a,{sx:{pt:2}},b.map(t=>r.a.createElement(f.a,{key:"locked_"+t.achievement.ID,achievement:t.achievement,cssFiltersUnlocked:n,cssFiltersLocked:a})))),y.length>0&&r.a.createElement(o.a,{disableGutters:!0,square:!0},r.a.createElement(s.a,null,r.a.createElement(l.a,{variant:"h5",color:"secondary"},"Unavailable (",y.length," remaining)")),r.a.createElement(c.a,null,r.a.createElement(l.a,{sx:{mt:1}},y.length," additional achievements hidden behind content you don't have access to."))),g.length>0&&r.a.createElement(o.a,{disableGutters:!0,square:!0},r.a.createElement(s.a,null,r.a.createElement(l.a,{variant:"h5",color:"secondary"},"Secret (",g.length," remaining)")),r.a.createElement(c.a,null,r.a.createElement(l.a,{color:"secondary",sx:{mt:1}},g.map(t=>r.a.createElement("span",{key:"secret_"+t.achievement.ID},r.a.createElement(h.a,{content:t.achievement.ID}),r.a.createElement("br",null))))))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(0),r=n.n(a),i=n(19),o=n(6);function s({achievement:t,unlocked:e,colorFilters:n,size:s}){const[l,c]=Object(a.useState)(!1),f=e?o.a.theme.primarydark:o.a.theme.secondarydark;return t.Icon?r.a.createElement(i.a,{sx:{border:"1px solid "+f,width:s,height:s,m:1,visibility:l?"visible":"hidden"}},r.a.createElement("img",{src:`dist/icons/achievements/${encodeURI(t.Icon)}.svg`,style:{filter:n,width:s,height:s},onLoad:()=>c(!0),alt:t.Name})):r.a.createElement(r.a.Fragment,null)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(0),r=n.n(a),i=n(539),o=n(417);class s extends r.a.Component{constructor(t){super(t),this.state={hasError:!1}}reset(){this.setState({hasError:!1})}componentDidCatch(t,e){this.setState({errorInfo:e,page:this.props.router.page()}),console.error(t,e)}render(){if(this.state.hasError){let t;if(this.state.error)try{t=Object(i.a)(this.state.error,this.state.errorInfo,this.state.page)}catch(t){console.error(t)}return r.a.createElement(o.c,{router:this.props.router,softReset:this.props.softReset,errorData:t,resetError:()=>this.reset()})}return this.props.children}static getDerivedStateFromError(t){return{hasError:!0,error:t}}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return v}));var a=n(0),r=n.n(a),i=n(1),o=n(45),s=n(170),l=n(6),c=n(337),f=n(8),u=n(19),m=n(356),h=n(622),d=n(621),p=n(1399),g=n(631),y=n(38),b=n(94);let E=0;function v({router:t}){const[e,n]=Object(a.useState)(!1),[v,k]=Object(a.useState)(),_=Object(c.b)(),w=_&&Object.entries(_).map(([t,e])=>r.a.createElement(p.a,{key:t,theme:e,onActivated:()=>function(t){E=window.scrollY;const e={...l.a.theme};Object.assign(l.a.theme,t.colors),s.b.emit(),b.b.emit(r.a.createElement(r.a.Fragment,null,'Updated theme to "',r.a.createElement("strong",null,t.name),'"',r.a.createElement(f.a,{sx:{ml:1},color:"secondary",size:"small",onClick:()=>{Object.assign(l.a.theme,e),s.b.emit()}},"UNDO")),b.d.INFO,3e4)}(e),onImageClick:S}))||r.a.createElement(r.a.Fragment,null);function S(t){E=window.scrollY,k(t),n(!0)}return Object(a.useEffect)(()=>{requestAnimationFrame(()=>window.scrollTo(0,E))}),r.a.createElement(u.a,{sx:{mx:2}},r.a.createElement(i.a,{variant:"h4"},"Theme Browser"),r.a.createElement(o.a,{sx:{px:2,py:1,my:1}},r.a.createElement(g.a,null),r.a.createElement(m.a,{sx:{mb:2,display:"block"}},r.a.createElement(h.a,{router:t}),r.a.createElement(d.a,null)),r.a.createElement(u.a,{sx:{display:"flex",flexWrap:"wrap"}},w),r.a.createElement(y.a,{open:e,onClose:function(){E=window.scrollY,n(!1)}},r.a.createElement("img",{src:v,style:{width:"100%"}}))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var a=n(0),r=n.n(a),i=n(1),o=n(21),s=n(632),l=n.n(s),c=n(6),f=n(1840),u=n(1841),m=n(8),h=n(150),d=n(1842),p=n(1843);function g({theme:t,onActivated:e,onImageClick:n}){return t?r.a.createElement(f.a,{key:t.screenshot,sx:{width:400,mr:1,mb:1}},r.a.createElement(u.a,{action:r.a.createElement(o.a,{title:"Use this theme"},r.a.createElement(m.a,{startIcon:r.a.createElement(l.a,null),onClick:e,variant:"outlined"},"Use")),title:t.name,subheader:r.a.createElement(r.a.Fragment,null,"by ",t.credit," ",t.reference&&r.a.createElement(r.a.Fragment,null,"(",r.a.createElement(h.a,{href:t.reference,target:"_blank"},"ref"),")")),sx:{color:c.a.theme.primary,"& .MuiCardHeader-subheader":{color:c.a.theme.secondarydark},"& .MuiButton-outlined":{backgroundColor:"transparent"}}}),r.a.createElement(d.a,{component:"img",width:"400",image:t.screenshot,alt:`Theme Screenshot of "${t.name}"`,sx:{borderTop:"1px solid "+c.a.theme.welllight,borderBottom:"1px solid "+c.a.theme.welllight,cursor:"zoom-in"},onClick:()=>n(t.screenshot)}),r.a.createElement(p.a,null,r.a.createElement(i.a,{variant:"body2",color:"text.secondary",sx:{color:c.a.theme.primarydark}},t.description))):r.a.createElement(r.a.Fragment,null)}},,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return j}));var a=n(0),r=n.n(a),i=n(21),o=n(19),s=n(1),l=n(1485),c=n(45),f=n(148),u=n(1486),m=n(50),h=n(30),d=n(149),p=n(356),g=n(8),y=n(121),b=n(144),E=n(1404),v=n.n(E),k=n(1405),_=n.n(k),w=n(650),S=n.n(w),x=n(1407),C=n.n(x),L=n(1406),O=n.n(L),M=n(109),T=n(6),A=n(22),R=n(5),N=n(252),P=n(298);const I=Object(y.a)(t=>Object(b.a)({root:{padding:t.spacing(2),maxWidth:"1000px","& .MuiTable-root":{"& .MuiTableCell-root":{borderBottom:"1px solid "+T.a.theme.welllight},"& .MuiTableHead-root .MuiTableRow-root":{backgroundColor:T.a.theme.backgroundsecondary,"& .MuiTableCell-root":{color:T.a.theme.primary,fontWeight:"bold"}},"& .MuiTableBody-root":{"& .MuiTableRow-root:nth-of-type(odd)":{backgroundColor:T.a.theme.well,"& .MuiTableCell-root":{color:T.a.theme.primarylight}},"& .MuiTableRow-root:nth-of-type(even)":{backgroundColor:T.a.theme.backgroundsecondary,"& .MuiTableCell-root":{color:T.a.theme.primarylight}}}}}}));function F({isBetter:t}){return t?r.a.createElement(i.a,{title:r.a.createElement(r.a.Fragment,null,"Imported value is ",r.a.createElement("b",null,"larger"),"!")},r.a.createElement(v.a,{color:"success"})):r.a.createElement(i.a,{title:r.a.createElement(r.a.Fragment,null,"Imported value is ",r.a.createElement("b",null,"smaller"),"!")},r.a.createElement(_.a,{color:"error"}))}let D=0;function j(t){var e,n,y,b,E,v,k,_,w,x,L,j,B,G,W,H,U,q,$,K,z,V,Y,J,X,Q,Z,tt,et,nt,at,rt,it,ot,st,lt,ct,ft,ut,mt,ht,dt,pt,gt,yt,bt,Et,vt,kt,_t,wt,St,xt,Ct,Lt,Ot,Mt,Tt,At,Rt,Nt,Pt,It,Ft,Dt,jt,Bt,Gt,Wt,Ht,Ut,qt,$t,Kt,zt,Vt,Yt,Jt,Xt,Qt,Zt,te,ee,ne,ae,re;const ie=I(),[oe,se]=Object(a.useState)(),[le,ce]=Object(a.useState)(),[fe,ue]=Object(a.useState)(!1),[me,he]=Object(a.useState)(!1);return Object(a.useEffect)(()=>{D=T.a.AutosaveInterval,T.a.AutosaveInterval=0,t.router.allowRouting(!1)},[]),Object(a.useEffect)(()=>{me&&t.router.toTerminal()},[me]),Object(a.useEffect)(()=>{t.importString&&async function(){const e=await M.c.getImportDataFromString(t.importString),n=await M.c.getImportDataFromString(M.c.getSaveString(!0));se(e),ce(n),Promise.resolve()}()},[t.importString]),oe&&le?r.a.createElement(o.a,{className:ie.root},r.a.createElement(s.a,{variant:"h4",sx:{mb:2}},"Import Save Comparison"),t.automatic&&r.a.createElement(s.a,{sx:{mb:2}},"We've found a ",r.a.createElement("b",null,"NEWER save")," that you may want to use instead."),r.a.createElement(s.a,{variant:"body1",sx:{mb:2}},"Your current game's data is on the left and the data that will be imported is on the right.",r.a.createElement("br",null),"Please double check everything is fine before proceeding!"),r.a.createElement(l.a,{color:"secondary",component:c.a},r.a.createElement(f.a,null,r.a.createElement(u.a,null,r.a.createElement(m.a,null,r.a.createElement(h.a,null),r.a.createElement(h.a,null,"Current Game"),r.a.createElement(h.a,null,"Being Imported"),r.a.createElement(h.a,null))),r.a.createElement(d.a,null,r.a.createElement(m.a,null,r.a.createElement(h.a,null,"Game Identifier"),r.a.createElement(h.a,null,null!==(e=null===(n=le.playerData)||void 0===n?void 0:n.identifier)&&void 0!==e?e:"n/a"),r.a.createElement(h.a,null,null!==(y=null===(b=oe.playerData)||void 0===b?void 0:b.identifier)&&void 0!==y?y:"n/a"),r.a.createElement(h.a,null,(null===(E=oe.playerData)||void 0===E?void 0:E.identifier)!==(null===(v=le.playerData)||void 0===v?void 0:v.identifier)&&r.a.createElement(i.a,{title:"These are two different games!"},r.a.createElement(O.a,{color:"warning"})))),r.a.createElement(m.a,null,r.a.createElement(h.a,null,"Playtime"),r.a.createElement(h.a,null,Object(A.d)(null!==(k=null===(_=le.playerData)||void 0===_?void 0:_.totalPlaytime)&&void 0!==k?k:0)),r.a.createElement(h.a,null,Object(A.d)(null!==(w=null===(x=oe.playerData)||void 0===x?void 0:x.totalPlaytime)&&void 0!==w?w:0)),r.a.createElement(h.a,null,(null===(L=oe.playerData)||void 0===L?void 0:L.totalPlaytime)!==(null===(j=le.playerData)||void 0===j?void 0:j.totalPlaytime)&&r.a.createElement(F,{isBetter:(null!==(B=null===(G=oe.playerData)||void 0===G?void 0:G.totalPlaytime)&&void 0!==B?B:0)>(null!==(W=null===(H=le.playerData)||void 0===H?void 0:H.totalPlaytime)&&void 0!==W?W:0)}))),r.a.createElement(m.a,null,r.a.createElement(h.a,null,"Saved On"),r.a.createElement(h.a,null,(null!==(U=null===(q=le.playerData)||void 0===q?void 0:q.lastSave)&&void 0!==U?U:0)>0?new Date(null!==($=null===(K=le.playerData)||void 0===K?void 0:K.lastSave)&&void 0!==$?$:0).toLocaleString():"n/a"),r.a.createElement(h.a,null,(null!==(z=null===(V=oe.playerData)||void 0===V?void 0:V.lastSave)&&void 0!==z?z:0)>0?new Date(null!==(Y=null===(J=oe.playerData)||void 0===J?void 0:J.lastSave)&&void 0!==Y?Y:0).toLocaleString():"n/a"),r.a.createElement(h.a,null,(null===(X=oe.playerData)||void 0===X?void 0:X.lastSave)!==(null===(Q=le.playerData)||void 0===Q?void 0:Q.lastSave)&&r.a.createElement(F,{isBetter:(null!==(Z=null===(tt=oe.playerData)||void 0===tt?void 0:tt.lastSave)&&void 0!==Z?Z:0)>(null!==(et=null===(nt=le.playerData)||void 0===nt?void 0:nt.lastSave)&&void 0!==et?et:0)}))),r.a.createElement(m.a,null,r.a.createElement(h.a,null,"Money"),r.a.createElement(h.a,null,R.a.formatMoney(null!==(at=null===(rt=le.playerData)||void 0===rt?void 0:rt.money)&&void 0!==at?at:0)),r.a.createElement(h.a,null,R.a.formatMoney(null!==(it=null===(ot=oe.playerData)||void 0===ot?void 0:ot.money)&&void 0!==it?it:0)),r.a.createElement(h.a,null,(null===(st=oe.playerData)||void 0===st?void 0:st.money)!==(null===(lt=le.playerData)||void 0===lt?void 0:lt.money)&&r.a.createElement(F,{isBetter:(null!==(ct=null===(ft=oe.playerData)||void 0===ft?void 0:ft.money)&&void 0!==ct?ct:0)>(null!==(ut=null===(mt=le.playerData)||void 0===mt?void 0:mt.money)&&void 0!==ut?ut:0)}))),r.a.createElement(m.a,null,r.a.createElement(h.a,null,"Hacking"),r.a.createElement(h.a,null,R.a.formatSkill(null!==(ht=null===(dt=le.playerData)||void 0===dt?void 0:dt.hacking)&&void 0!==ht?ht:0)),r.a.createElement(h.a,null,R.a.formatSkill(null!==(pt=null===(gt=oe.playerData)||void 0===gt?void 0:gt.hacking)&&void 0!==pt?pt:0)),r.a.createElement(h.a,null,(null===(yt=oe.playerData)||void 0===yt?void 0:yt.hacking)!==(null===(bt=le.playerData)||void 0===bt?void 0:bt.hacking)&&r.a.createElement(F,{isBetter:(null!==(Et=null===(vt=oe.playerData)||void 0===vt?void 0:vt.hacking)&&void 0!==Et?Et:0)>(null!==(kt=null===(_t=le.playerData)||void 0===_t?void 0:_t.hacking)&&void 0!==kt?kt:0)}))),r.a.createElement(m.a,null,r.a.createElement(h.a,null,"Augmentations"),r.a.createElement(h.a,null,null===(wt=le.playerData)||void 0===wt?void 0:wt.augmentations),r.a.createElement(h.a,null,null===(St=oe.playerData)||void 0===St?void 0:St.augmentations),r.a.createElement(h.a,null,(null===(xt=oe.playerData)||void 0===xt?void 0:xt.augmentations)!==(null===(Ct=le.playerData)||void 0===Ct?void 0:Ct.augmentations)&&r.a.createElement(F,{isBetter:(null!==(Lt=null===(Ot=oe.playerData)||void 0===Ot?void 0:Ot.augmentations)&&void 0!==Lt?Lt:0)>(null!==(Mt=null===(Tt=le.playerData)||void 0===Tt?void 0:Tt.augmentations)&&void 0!==Mt?Mt:0)}))),r.a.createElement(m.a,null,r.a.createElement(h.a,null,"Factions"),r.a.createElement(h.a,null,null===(At=le.playerData)||void 0===At?void 0:At.factions),r.a.createElement(h.a,null,null===(Rt=oe.playerData)||void 0===Rt?void 0:Rt.factions),r.a.createElement(h.a,null,(null===(Nt=oe.playerData)||void 0===Nt?void 0:Nt.factions)!==(null===(Pt=le.playerData)||void 0===Pt?void 0:Pt.factions)&&r.a.createElement(F,{isBetter:(null!==(It=null===(Ft=oe.playerData)||void 0===Ft?void 0:Ft.factions)&&void 0!==It?It:0)>(null!==(Dt=null===(jt=le.playerData)||void 0===jt?void 0:jt.factions)&&void 0!==Dt?Dt:0)}))),r.a.createElement(m.a,null,r.a.createElement(h.a,null,"Achievements"),r.a.createElement(h.a,null,null===(Bt=le.playerData)||void 0===Bt?void 0:Bt.achievements),r.a.createElement(h.a,null,null===(Gt=oe.playerData)||void 0===Gt?void 0:Gt.achievements),r.a.createElement(h.a,null,(null===(Wt=oe.playerData)||void 0===Wt?void 0:Wt.achievements)!==(null===(Ht=le.playerData)||void 0===Ht?void 0:Ht.achievements)&&r.a.createElement(F,{isBetter:(null!==(Ut=null===(qt=oe.playerData)||void 0===qt?void 0:qt.achievements)&&void 0!==Ut?Ut:0)>(null!==($t=null===(Kt=le.playerData)||void 0===Kt?void 0:Kt.achievements)&&void 0!==$t?$t:0)}))),r.a.createElement(m.a,null,r.a.createElement(h.a,null,"Source Files"),r.a.createElement(h.a,null,null===(zt=le.playerData)||void 0===zt?void 0:zt.sourceFiles),r.a.createElement(h.a,null,null===(Vt=oe.playerData)||void 0===Vt?void 0:Vt.sourceFiles),r.a.createElement(h.a,null,(null===(Yt=oe.playerData)||void 0===Yt?void 0:Yt.sourceFiles)!==(null===(Jt=le.playerData)||void 0===Jt?void 0:Jt.sourceFiles)&&r.a.createElement(F,{isBetter:(null!==(Xt=null===(Qt=oe.playerData)||void 0===Qt?void 0:Qt.sourceFiles)&&void 0!==Xt?Xt:0)>(null!==(Zt=null===(te=le.playerData)||void 0===te?void 0:te.sourceFiles)&&void 0!==Zt?Zt:0)}))),r.a.createElement(m.a,null,r.a.createElement(h.a,null,"BitNode"),r.a.createElement(h.a,null,null===(ee=le.playerData)||void 0===ee?void 0:ee.bitNode,"-",null===(ne=le.playerData)||void 0===ne?void 0:ne.bitNodeLevel),r.a.createElement(h.a,null,null===(ae=oe.playerData)||void 0===ae?void 0:ae.bitNode,"-",null===(re=oe.playerData)||void 0===re?void 0:re.bitNodeLevel),r.a.createElement(h.a,null))))),r.a.createElement(o.a,{sx:{display:"flex",justifyContent:"flex-end"}},r.a.createElement(p.a,null,r.a.createElement(g.a,{onClick:function(){T.a.AutosaveInterval=D,Object(P.e)(!1),t.router.allowRouting(!0),he(!0)},sx:{my:2},startIcon:r.a.createElement(C.a,null),color:"secondary"},"Take me back!"),r.a.createElement(g.a,{onClick:()=>ue(!0),sx:{my:2},startIcon:r.a.createElement(S.a,null),color:"warning"},"Proceed with import")),r.a.createElement(N.a,{open:fe,onClose:()=>ue(!1),onConfirm:async function(){await M.c.importGame(t.importString,!0),Object(P.e)(!0)},confirmationText:r.a.createElement(r.a.Fragment,null,"Importing new save game data will ",r.a.createElement("strong",null,"completely wipe")," the current game data!",r.a.createElement("br",null))}))):r.a.createElement(r.a.Fragment,null)}},,,,,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 t.content?r.a.createElement(r.a.Fragment,null,t.content):r.a.createElement(r.a.Fragment,null,t.children)}},,,function(t,e,n){"use strict";n.d(e,"a",(function(){return W}));var a=n(105),r=n(199),i=n(79),o=n(119),s=n(12),l=n(142),c=n(10),f=n(146),u=n(369),m=n(379),h=n(368),d=n(95),p=n(258),g=n(15),y=n(9),b=n(90),E=n(88),v=n(25),k=n(186),_=n(24),w=n(65),S=n(5),x=n(18),C=n(238),L=n(67),O=n(26),M=n(110),T=n(22),A=n(137),R=n(84),N=n(102),P=n(46),I=n(481),F=n(376),D=n(57),j=n(416),B=n(4),G=n(34);function W(t,e){const n=function(t,e){if(!Object(o.b)(e))throw t.helper.makeRuntimeErrorMsg(`Invalid augmentation: '${e}'`);return i.a[e]},W=function(t,e){if(!Object(O.b)(e))throw t.helper.makeRuntimeErrorMsg("Invalid faction name: '"+e);return O.a[e]},H=function(t,e){const n=L.a[e];if(null==n||!(n instanceof C.a))throw t.helper.makeRuntimeErrorMsg(`Invalid company name: '${e}'`);return n},U=function(e=null){if(!e)return;const n=t.getHomeComputer();for(const a of n.scripts)if(a.filename===e){if(a.ramUsage>n.maxRam-n.ramUsed+.001)return;const e=new u.a(a,[]);e.threads=1,Object(r.e)(t,e,n)}};return{getOwnedAugmentations:e=>function(n=!1){e.helper.checkSingularityAccess();const a=e.helper.boolean(n),r=[];for(let e=0;efunction(n){e.helper.checkSingularityAccess();const r=e.helper.string("facName",n),i=W(e,r);return Object(a.a)(t,i)},getAugmentationCost:e=>function(a){e.helper.checkSingularityAccess();const r=e.helper.string("augName",a),i=n(e,r).getCost(t);return[i.repCost,i.moneyCost]},getAugmentationPrereq:t=>function(e){t.helper.checkSingularityAccess();const a=t.helper.string("augName",e);return n(t,a).prereqs.slice()},getAugmentationPrice:e=>function(a){e.helper.checkSingularityAccess();const r=e.helper.string("augName",a);return n(e,r).getCost(t).moneyCost},getAugmentationRepReq:e=>function(a){e.helper.checkSingularityAccess();const r=e.helper.string("augName",a);return n(e,r).getCost(t).repCost},getAugmentationStats:t=>function(e){t.helper.checkSingularityAccess();const a=t.helper.string("augName",e),r=n(t,a);return Object.assign({},r.mults)},purchaseAugmentation:e=>function(r,i){e.helper.checkSingularityAccess();const o=e.helper.string("facName",r),l=e.helper.string("augName",i),u=W(e,o),m=n(e,l);if(!Object(a.a)(t,u).includes(l))return e.log(()=>`Faction '${o}' does not have the '${l}' augmentation.`),!1;if(!(m.name===s.a.NeuroFluxGovernor)){for(let n=0;n`You already have the '${l}' augmentation.`),!1;for(let n=0;n`You already have the '${l}' augmentation.`),!1}if(u.playerReputation`You do not have enough reputation with '${u.name}'.`),!1;const h=Object(a.f)(m,u,!0);return e.log(()=>h),!(!Object(f.a)(h)||!h.startsWith("You purchased"))&&(t.gainIntelligenceExp(10*c.a.IntelligenceSingFnBaseExpGain),!0)},softReset:t=>function(n=""){t.helper.checkSingularityAccess();const a=t.helper.string("cbScript",n);t.log(()=>"Soft resetting. This will cause this script to be killed"),setTimeout(()=>{Object(o.f)(!0),U(a)},0),e.running=!1,Object(l.a)(e)},installAugmentations:n=>function(a=""){n.helper.checkSingularityAccess();const r=n.helper.string("cbScript",a);return 0===t.queuedAugmentations.length?(n.log(()=>"You do not have any Augmentations to be installed."),!1):(t.gainIntelligenceExp(10*c.a.IntelligenceSingFnBaseExpGain),n.log(()=>"Installing Augmentations. This will cause this script to be killed"),setTimeout(()=>{Object(o.f)(),U(r)},0),e.running=!1,Object(l.a)(e),!0)},goToLocation:e=>function(n){e.helper.checkSingularityAccess();const a=e.helper.string("locationName",n),r=Object.values(k.a).find(t=>t.name===a);return r?t.city!==r.city?(e.log(()=>`No location named ${a} in ${t.city}`),!1):(b.b.toLocation(r),t.gainIntelligenceExp(c.a.IntelligenceSingFnBaseExpGain/5e4),!0):(e.log(()=>"No location named "+a),!1)},universityCourse:e=>function(n,a,r=!0){e.helper.checkSingularityAccess();const i=e.helper.string("universityName",n),o=e.helper.string("className",a),s=e.helper.boolean(r),l=t.focus;if(t.isWorking){const n=t.singularityStopWork();e.log(()=>n)}let c,f,u;switch(i.toLowerCase()){case y.a.AevumSummitUniversity.toLowerCase():if(t.city!=g.a.Aevum)return e.log(()=>`You cannot study at 'Summit University' because you are not in '${g.a.Aevum}'.`),!1;t.gotoLocation(y.a.AevumSummitUniversity),c=4,f=3;break;case y.a.Sector12RothmanUniversity.toLowerCase():if(t.city!=g.a.Sector12)return e.log(()=>`You cannot study at 'Rothman University' because you are not in '${g.a.Sector12}'.`),!1;t.location=y.a.Sector12RothmanUniversity,c=3,f=2;break;case y.a.VolhavenZBInstituteOfTechnology.toLowerCase():if(t.city!=g.a.Volhaven)return e.log(()=>`You cannot study at 'ZB Institute of Technology' because you are not in '${g.a.Volhaven}'.`),!1;t.location=y.a.VolhavenZBInstituteOfTechnology,c=5,f=4;break;default:return e.log(()=>`Invalid university name: '${i}'.`),!1}switch(o.toLowerCase()){case"Study Computer Science".toLowerCase():u=G.a.StudyComputerScience;break;case"Data Structures".toLowerCase():u=G.a.DataStructures;break;case"Networks".toLowerCase():u=G.a.Networks;break;case"Algorithms".toLowerCase():u=G.a.Algorithms;break;case"Management".toLowerCase():u=G.a.Management;break;case"Leadership".toLowerCase():u=G.a.Leadership;break;default:return e.log(()=>`Invalid class name: ${o}.`),!1}return t.startClass(c,f,u),s?(t.startFocusing(),b.b.toWork()):l&&(t.stopFocusing(),b.b.toTerminal()),e.log(()=>`Started ${u} at ${i}`),!0},gymWorkout:e=>function(n,a,r=!0){e.helper.checkSingularityAccess();const i=e.helper.string("gymName",n),o=e.helper.string("stat",a),s=e.helper.boolean(r),l=t.focus;if(t.isWorking){const n=t.singularityStopWork();e.log(()=>n)}let c,f;switch(i.toLowerCase()){case y.a.AevumCrushFitnessGym.toLowerCase():if(t.city!=g.a.Aevum)return e.log(()=>`You cannot workout at '${y.a.AevumCrushFitnessGym}' because you are not in '${g.a.Aevum}'.`),!1;t.location=y.a.AevumCrushFitnessGym,c=3,f=2;break;case y.a.AevumSnapFitnessGym.toLowerCase():if(t.city!=g.a.Aevum)return e.log(()=>`You cannot workout at '${y.a.AevumSnapFitnessGym}' because you are not in '${g.a.Aevum}'.`),!1;t.location=y.a.AevumSnapFitnessGym,c=10,f=5;break;case y.a.Sector12IronGym.toLowerCase():if(t.city!=g.a.Sector12)return e.log(()=>`You cannot workout at '${y.a.Sector12IronGym}' because you are not in '${g.a.Sector12}'.`),!1;t.location=y.a.Sector12IronGym,c=1,f=1;break;case y.a.Sector12PowerhouseGym.toLowerCase():if(t.city!=g.a.Sector12)return e.log(()=>`You cannot workout at '${y.a.Sector12PowerhouseGym}' because you are not in '${g.a.Sector12}'.`),!1;t.location=y.a.Sector12PowerhouseGym,c=20,f=10;break;case y.a.VolhavenMilleniumFitnessGym.toLowerCase():if(t.city!=g.a.Volhaven)return e.log(()=>`You cannot workout at '${y.a.VolhavenMilleniumFitnessGym}' because you are not in '${g.a.Volhaven}'.`),!1;t.location=y.a.VolhavenMilleniumFitnessGym,c=7,f=4;break;default:return e.log(()=>`Invalid gym name: ${i}. gymWorkout() failed`),!1}switch(o.toLowerCase()){case"strength".toLowerCase():case"str".toLowerCase():t.startClass(c,f,G.a.GymStrength);break;case"defense".toLowerCase():case"def".toLowerCase():t.startClass(c,f,G.a.GymDefense);break;case"dexterity".toLowerCase():case"dex".toLowerCase():t.startClass(c,f,G.a.GymDexterity);break;case"agility".toLowerCase():case"agi".toLowerCase():t.startClass(c,f,G.a.GymAgility);break;default:return e.log(()=>`Invalid stat: ${o}.`),!1}return s?(t.startFocusing(),b.b.toWork()):l&&(t.stopFocusing(),b.b.toTerminal()),e.log(()=>`Started training ${o} at ${i}`),!0},travelToCity:e=>function(n){e.helper.checkSingularityAccess();const a=e.helper.city("cityName",n);switch(a){case g.a.Aevum:case g.a.Chongqing:case g.a.Sector12:case g.a.NewTokyo:case g.a.Ishima:case g.a.Volhaven:return t.money"Not enough money to travel."),!1):(t.loseMoney(c.a.TravelCost,"other"),t.city=a,e.log(()=>"Traveled to "+a),t.gainIntelligenceExp(c.a.IntelligenceSingFnBaseExpGain/5e4),!0);default:throw e.helper.makeRuntimeErrorMsg(`Invalid city name: '${a}'.`)}},purchaseTor:e=>function(){if(e.helper.checkSingularityAccess(),t.hasTorRouter())return e.log(()=>"You already have a TOR router!"),!0;if(t.money"You cannot afford to purchase a Tor router."),!1;t.loseMoney(c.a.TorRouterCost,"other");const n=Object(_.d)(E.a.DarkWeb);if(!n)throw e.makeRuntimeErrorMsg("DarkWeb was not a server but should have been");return t.getHomeComputer().serversOnNetwork.push(n.hostname),n.serversOnNetwork.push(t.getHomeComputer().hostname),t.gainIntelligenceExp(c.a.IntelligenceSingFnBaseExpGain/500),e.log(()=>"You have purchased a Tor router!"),!0},purchaseProgram:e=>function(n){e.helper.checkSingularityAccess();const a=e.helper.string("programName",n).toLowerCase();if(!t.hasTorRouter())return e.log(()=>"You do not have the TOR router."),!1;const r=Object.values(p.a).find(t=>t.program.toLowerCase()===a);return null==r?(e.log(()=>`Invalid program name: '${a}.`),!1):t.money`Not enough money to purchase '${r.program}'. Need ${S.a.formatMoney(r.price)}`),!1):t.hasProgram(r.program)?(e.log(()=>`You already have the '${r.program}' program`),!0):(t.getHomeComputer().pushProgram(r.program),t.createProgramName===r.program&&(t.isWorking=!1,t.resetWorkStatus()),t.loseMoney(r.price,"other"),e.log(()=>`You have purchased the '${r.program}' program. The new program can be found on your home computer.`),t.gainIntelligenceExp(c.a.IntelligenceSingFnBaseExpGain/5e3),!0)},getCurrentServer:e=>function(){return e.helper.checkSingularityAccess(),t.getCurrentServer().hostname},connect:e=>function(n){e.helper.checkSingularityAccess();const a=e.helper.string("hostname",n);if(!a)throw e.helper.makeRuntimeErrorMsg(`Invalid hostname: '${a}'`);const r=Object(_.d)(a);if(null==r)throw e.helper.makeRuntimeErrorMsg(`Invalid hostname: '${a}'`);if("home"===a)return t.getCurrentServer().isConnectedTo=!1,t.currentServer=t.getHomeComputer().hostname,t.getCurrentServer().isConnectedTo=!0,R.a.setcwd("/"),!0;const i=t.getCurrentServer();for(let e=0;efunction(){e.helper.checkSingularityAccess();const n=t.getCurrentServer();return e.helper.hack(n.hostname,!0)},installBackdoor:n=>async()=>{n.helper.checkSingularityAccess();const a=t.getCurrentServer();if(!(a instanceof P.a))return n.log(()=>"cannot backdoor this kind of server"),Promise.resolve();const r=a,i=Object(N.d)(r,t)/4*1e3,o=Object(I.b)(r,t);if(!o.res)throw n.helper.makeRuntimeErrorMsg(o.msg||"");return n.log(()=>`Installing backdoor on '${r.hostname}' in ${Object(T.d)(i,!0)}`),Object(M.c)(i,e).then((function(){return n.log(()=>`Successfully installed backdoor on '${r.hostname}'`),r.backdoorInstalled=!0,E.a.WorldDaemon===r.hostname&&b.b.toBitVerse(!1,!1),Promise.resolve()}))},isFocused:e=>function(){return e.helper.checkSingularityAccess(),t.focus},setFocus:e=>function(n){e.helper.checkSingularityAccess();const a=e.helper.boolean(n);if(!t.isWorking)throw e.helper.makeRuntimeErrorMsg("Not currently working");if(t.workType!==G.d.Faction&&t.workType!==G.d.Company&&t.workType!==G.d.CompanyPartTime&&t.workType!==G.d.CreateProgram&&t.workType!==G.d.StudyClass)throw e.helper.makeRuntimeErrorMsg("Cannot change focus for current job");return!t.focus&&a?(t.startFocusing(),b.b.toWork(),!0):!(!t.focus||a)&&(t.stopFocusing(),b.b.toTerminal(),!0)},getStats:e=>function(){return e.helper.checkSingularityAccess(),e.log(()=>"getStats is deprecated, please use getplayer"),{hacking:t.hacking,strength:t.strength,defense:t.defense,dexterity:t.dexterity,agility:t.agility,charisma:t.charisma,intelligence:t.intelligence}},getCharacterInformation:e=>function(){return e.helper.checkSingularityAccess(),e.log(()=>"getCharacterInformation is deprecated, please use getplayer"),{bitnode:t.bitNodeN,city:t.city,factions:t.factions.slice(),hp:t.hp,jobs:Object.keys(t.jobs),jobTitles:Object.values(t.jobs),maxHp:t.max_hp,mult:{agility:t.agility_mult,agilityExp:t.agility_exp_mult,charisma:t.charisma,charismaExp:t.charisma_exp,companyRep:t.company_rep_mult,crimeMoney:t.crime_money_mult,crimeSuccess:t.crime_success_mult,defense:t.defense_mult,defenseExp:t.defense_exp_mult,dexterity:t.dexterity_mult,dexterityExp:t.dexterity_exp_mult,factionRep:t.faction_rep_mult,hacking:t.hacking_mult,hackingExp:t.hacking_exp_mult,strength:t.strength_mult,strengthExp:t.strength_exp_mult,workMoney:t.work_money_mult},timeWorked:t.timeWorked,tor:t.hasTorRouter(),workHackExpGain:t.workHackExpGained,workStrExpGain:t.workStrExpGained,workDefExpGain:t.workDefExpGained,workDexExpGain:t.workDexExpGained,workAgiExpGain:t.workAgiExpGained,workChaExpGain:t.workChaExpGained,workRepGain:t.workRepGained,workMoneyGain:t.workMoneyGained,hackingExp:t.hacking_exp,strengthExp:t.strength_exp,defenseExp:t.defense_exp,dexterityExp:t.dexterity_exp,agilityExp:t.agility_exp,charismaExp:t.charisma_exp}},hospitalize:e=>function(){e.helper.checkSingularityAccess(),t.isWorking||b.b.page()===v.a.Infiltration||b.b.page()===v.a.BitVerse?e.log(()=>"Cannot go to the hospital because the player is busy."):t.hospitalize()},isBusy:e=>function(){return e.helper.checkSingularityAccess(),t.isWorking||b.b.page()===v.a.Infiltration||b.b.page()===v.a.BitVerse},stopAction:e=>function(){if(e.helper.checkSingularityAccess(),t.isWorking){t.focus&&(t.stopFocusing(),b.b.toTerminal());const n=t.singularityStopWork();return e.log(()=>n),!0}return!1},upgradeHomeCores:e=>function(){e.helper.checkSingularityAccess();const n=t.getHomeComputer();if(n.cpuCores>=8)return e.log(()=>"Your home computer is at max cores."),!1;const a=t.getUpgradeHomeCoresCost();return t.money"You don't have enough money. Need "+S.a.formatMoney(a)),!1):(n.cpuCores+=1,t.loseMoney(a,"servers"),t.gainIntelligenceExp(2*c.a.IntelligenceSingFnBaseExpGain),e.log(()=>`Purchased an additional core for home computer! It now has ${n.cpuCores} cores.`),!0)},getUpgradeHomeCoresCost:e=>function(){return e.helper.checkSingularityAccess(),t.getUpgradeHomeCoresCost()},upgradeHomeRam:e=>function(){e.helper.checkSingularityAccess();const n=t.getHomeComputer();if(n.maxRam>=c.a.HomeComputerMaxRam)return e.log(()=>"Your home computer is at max RAM."),!1;const a=t.getUpgradeHomeRamCost();return t.money"You don't have enough money. Need "+S.a.formatMoney(a)),!1):(n.maxRam*=2,t.loseMoney(a,"servers"),t.gainIntelligenceExp(2*c.a.IntelligenceSingFnBaseExpGain),e.log(()=>`Purchased additional RAM for home computer! It now has ${S.a.formatRAM(n.maxRam)} of RAM.`),!0)},getUpgradeHomeRamCost:e=>function(){return e.helper.checkSingularityAccess(),t.getUpgradeHomeRamCost()},workForCompany:e=>function(n,a=!0){e.helper.checkSingularityAccess();let r=e.helper.string("companyName",n);const i=e.helper.boolean(a);if(null==r&&(r=t.companyName),null==r||""===r||!(L.a[r]instanceof C.a))return e.log(()=>`Invalid company: '${r}'`),!1;if(!Object.keys(t.jobs).includes(r))return e.log(()=>`You do not have a job at '${r}'`),!1;const o=t.jobs[r],s=d.a[o];if(""===o||!(s instanceof h.a))return e.log(()=>"You do not have a job"),!1;const l=t.focus;if(t.isWorking){const n=t.singularityStopWork();e.log(()=>n)}return s.isPartTimeJob()?t.startWorkPartTime(r):t.startWork(r),i?(t.startFocusing(),b.b.toWork()):l&&(t.stopFocusing(),b.b.toTerminal()),e.log(()=>`Began working at '${t.companyName}' as a '${o}'`),!0},applyToCompany:e=>function(n,a){e.helper.checkSingularityAccess();const r=e.helper.string("companyName",n),i=e.helper.string("field",a);let o;switch(H(e,r),t.location=r,i.toLowerCase()){case"software":o=t.applyForSoftwareJob(!0);break;case"software consultant":o=t.applyForSoftwareConsultantJob(!0);break;case"it":o=t.applyForItJob(!0);break;case"security engineer":o=t.applyForSecurityEngineerJob(!0);break;case"network engineer":o=t.applyForNetworkEngineerJob(!0);break;case"business":o=t.applyForBusinessJob(!0);break;case"business consultant":o=t.applyForBusinessConsultantJob(!0);break;case"security":o=t.applyForSecurityJob(!0);break;case"agent":o=t.applyForAgentJob(!0);break;case"employee":o=t.applyForEmployeeJob(!0);break;case"part-time employee":o=t.applyForPartTimeEmployeeJob(!0);break;case"waiter":o=t.applyForWaiterJob(!0);break;case"part-time waiter":o=t.applyForPartTimeWaiterJob(!0);break;default:return e.log(()=>`Invalid job: '${i}'.`),!1}return o?e.log(()=>`You were offered a new job at '${r}' as a '${t.jobs[r]}'`):e.log(()=>`You failed to get a new job/promotion at '${r}' in the '${i}' field.`),o},quitJob:e=>function(n){e.helper.checkSingularityAccess();const a=e.helper.string("companyName",n);t.quitJob(a)},getCompanyRep:t=>function(e){t.helper.checkSingularityAccess();const n=t.helper.string("companyName",e);return H(t,n).playerReputation},getCompanyFavor:t=>function(e){t.helper.checkSingularityAccess();const n=t.helper.string("companyName",e);return H(t,n).favor},getCompanyFavorGain:t=>function(e){t.helper.checkSingularityAccess();const n=t.helper.string("companyName",e);return H(t,n).getFavorGain()},checkFactionInvitations:e=>function(){return e.helper.checkSingularityAccess(),t.factionInvitations.slice()},joinFaction:e=>function(n){e.helper.checkSingularityAccess();const r=e.helper.string("facName",n);if(W(e,r),!t.factionInvitations.includes(r))return e.log(()=>`You have not been invited by faction '${r}'`),!1;const i=O.a[r];Object(a.d)(i);for(let e=0;e`Joined the '${r}' faction.`),!0},workForFaction:e=>function(n,a,r=!0){e.helper.checkSingularityAccess();const i=e.helper.string("facName",n),o=e.helper.string("type",a),s=e.helper.boolean(r),l=W(e,i);if(t.inGang()&&l.name===t.getGangFaction().name)return e.log(()=>`You can't work for '${i}' because youre managing a gang for it`),!1;if(!t.factions.includes(i))return e.log(()=>`You are not a member of '${i}'`),!1;const c=t.focus;if(t.isWorking){const n=t.singularityStopWork();e.log(()=>n)}switch(o.toLowerCase()){case"hacking":case"hacking contracts":case"hackingcontracts":return F.a[l.name].offerHackingWork?(t.startFactionHackWork(l),s?(t.startFocusing(),b.b.toWork()):c&&(t.stopFocusing(),b.b.toTerminal()),e.log(()=>`Started carrying out hacking contracts for '${l.name}'`),!0):(e.log(()=>`Faction '${l.name}' do not need help with hacking contracts.`),!1);case"field":case"fieldwork":case"field work":return F.a[l.name].offerFieldWork?(t.startFactionFieldWork(l),s?(t.startFocusing(),b.b.toWork()):c&&(t.stopFocusing(),b.b.toTerminal()),e.log(()=>`Started carrying out field missions for '${l.name}'`),!0):(e.log(()=>`Faction '${l.name}' do not need help with field missions.`),!1);case"security":case"securitywork":case"security work":return F.a[l.name].offerSecurityWork?(t.startFactionSecurityWork(l),s?(t.startFocusing(),b.b.toWork()):c&&(t.stopFocusing(),b.b.toTerminal()),e.log(()=>`Started carrying out security work for '${l.name}'`),!0):(e.log(()=>`Faction '${l.name}' do not need help with security work.`),!1);default:return e.log(()=>"Invalid work type: '"+o),!1}},getFactionRep:t=>function(e){t.helper.checkSingularityAccess();const n=t.helper.string("facName",e);return W(t,n).playerReputation},getFactionFavor:t=>function(e){t.helper.checkSingularityAccess();const n=t.helper.string("facName",e);return W(t,n).favor},getFactionFavorGain:t=>function(e){t.helper.checkSingularityAccess();const n=t.helper.string("facName",e);return W(t,n).getFavorGain()},donateToFaction:e=>function(n,a){e.helper.checkSingularityAccess();const r=e.helper.string("facName",n),i=e.helper.number("amt",a),o=W(e,r);if(!t.factions.includes(o.name))return e.log(()=>`You can't donate to '${r}' because you aren't a member`),!1;if(t.inGang()&&o.name===t.getGangFaction().name)return e.log(()=>`You can't donate to '${r}' because youre managing a gang for it`),!1;if(o.name===B.a.ChurchOfTheMachineGod||o.name===B.a.Bladeburners)return e.log(()=>`You can't donate to '${r}' because they do not accept donations`),!1;if("number"!=typeof i||i<=0||isNaN(i))return e.log(()=>`Invalid donation amount: '${i}'.`),!1;if(t.money`You do not have enough money to donate ${S.a.formatMoney(i)} to '${r}'`),!1;const s=Math.floor(c.a.BaseFavorToDonate*x.a.RepToDonateToFaction);if(o.favor`You do not have enough favor to donate to this faction. Have ${o.favor}, need ${s}`),!1;const l=i/c.a.DonateMoneyToRepDivisor*t.faction_rep_mult;return o.playerReputation+=l,t.loseMoney(i,"other"),e.log(()=>`${S.a.formatMoney(i)} donated to '${r}' for ${S.a.formatReputation(l)} reputation`),!0},createProgram:e=>function(n,a=!0){e.helper.checkSingularityAccess();const r=e.helper.string("programName",n).toLowerCase(),i=e.helper.boolean(a),o=t.focus;if(t.isWorking){const n=t.singularityStopWork();e.log(()=>n)}const s=Object.values(w.a).find(t=>t.name.toLowerCase()===r);if(null==s)return e.log(()=>"The specified program does not exist: '"+r),!1;if(t.hasProgram(s.name))return e.log(()=>`You already have the '${s.name}' program`),!1;const l=s.create;return null===l?(e.log(()=>`You cannot create the '${s.name}' program`),!1):l.req(t)?(t.startCreateProgramWork(s.name,l.time,l.level),i?(t.startFocusing(),b.b.toWork()):o&&(t.stopFocusing(),b.b.toTerminal()),e.log(()=>`Began creating program: '${r}'`),!0):(e.log(()=>`Hacking level is too low to create '${s.name}' (level ${l.level} req)`),!1)},commitCrime:n=>function(a){n.helper.checkSingularityAccess();const r=n.helper.string("crimeRoughName",a);if(t.isWorking){const e=t.singularityStopWork();n.log(()=>e)}t.gotoLocation(y.a.Slums);const i=Object(m.b)(r.toLowerCase());if(null==i)throw n.helper.makeRuntimeErrorMsg(`Invalid crime: '${r}'`);return n.log(()=>`Attempting to commit ${i.name}...`),i.commit(b.b,t,1,e)},getCrimeChance:e=>function(n){e.helper.checkSingularityAccess();const a=e.helper.string("crimeRoughName",n),r=Object(m.b)(a.toLowerCase());if(null==r)throw e.helper.makeRuntimeErrorMsg("Invalid crime: "+a);return r.successRate(t)},getCrimeStats:t=>function(e){t.helper.checkSingularityAccess();const n=t.helper.string("crimeRoughName",e),a=Object(m.b)(n.toLowerCase());if(null==a)throw t.helper.makeRuntimeErrorMsg("Invalid crime: "+n);return Object.assign({},a)},getDarkwebPrograms:e=>function(){return e.helper.checkSingularityAccess(),t.hasTorRouter()?Object.values(p.a).map(t=>t.program):(e.log(()=>"You do not have the TOR router."),[])},getDarkwebProgramCost:e=>function(n){e.helper.checkSingularityAccess();const a=e.helper.string("programName",n).toLowerCase();if(!t.hasTorRouter())return e.log(()=>"You do not have the TOR router."),-1;const r=Object.values(p.a).find(t=>t.program.toLowerCase()===a);if(null==r)throw e.helper.makeRuntimeErrorMsg(`No such exploit ('${a}') found on the darkweb! \nThis function is not case-sensitive. Did you perhaps forget .exe at the end?`);return t.hasProgram(r.program)?(e.log(()=>`You already have the '${r.program}' program`),0):r.price},b1tflum3:e=>(n,a="")=>{e.helper.checkSingularityAccess();const r=e.helper.number("nextBN",n),i=e.helper.string("callbackScript",a);e.helper.checkSingularityAccess(),Object(j.a)(b.b,!0,t.bitNodeN,r),i&&setTimeout(()=>{U(i)},0)},destroyW0r1dD43m0n:e=>(n,a="")=>{e.helper.checkSingularityAccess();const r=e.helper.number("nextBN",n),i=e.helper.string("callbackScript",a);e.helper.checkSingularityAccess();(()=>{const e=Object(_.d)(E.a.WorldDaemon);if(!(e instanceof P.a))throw new Error("WorldDaemon was not a normal server. This is a bug contact dev.");return!(t.hacking{U(i)},0)):e.log(()=>"Requirements not met to destroy the world daemon")}}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(226),r=n(110),i=n(2);function o(t,e,n,o,...s){const l=s.join("."),c=s.pop();if("string"!=typeof c)throw Object(r.b)(n,"Failure occured while wrapping netscript api");const f={makeRuntimeErrorMsg:e=>t.makeRuntimeErrorMsg(l,e),log:t=>{n.log(l,t)},workerScript:n,function:c,helper:{makeRuntimeErrorMsg:e=>t.makeRuntimeErrorMsg(l,e),string:(e,n)=>t.string(l,e,n),number:(e,n)=>t.number(l,e,n),city:(e,n)=>t.city(l,e,n),boolean:t.boolean,getServer:e=>t.getServer(e,f),checkSingularityAccess:()=>t.checkSingularityAccess(c),hack:(e,n,a)=>t.hack(f,e,n,a),getValidPort:e=>t.getValidPort(l,e)}};const u=function(t,...e){let n=t;for(const t of e)void 0===n[t]&&(n[t]={}),n=n[t];return n}(e,...s);Object.defineProperty(u,c,{value:function(...e){return t.updateDynamicRam(f.function,Object(a.c)(i.a,...s,f.function)),o(f)(...e)},writable:!0,enumerable:!0})}function s(t,e,n,a,...r){if("object"!=typeof a)throw new Error("Invalid namespace?");for(const i of Object.getOwnPropertyNames(a))switch(typeof a[i]){case"function":o(t,e,n,a[i],...r,i);break;case"object":s(t,e,n,a[i],...r,i);break;default:l(e,a[i],...r,i)}return e}function l(t,e,...n){let a=t;const r=n.pop();if("string"!=typeof r)throw new Error("Failure occured while wrapping netscript api (setNestedProperty)");for(const t of n)void 0===a[t]&&(a[t]={}),a=a[t];a[r]=e}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(6);function r(){const t=[];return{write:e=>(t.push(e),t.length>a.a.MaxPortCapacity?t.shift():null),tryWrite:e=>!(t.length>=a.a.MaxPortCapacity)&&(t.push(e),!0),read:()=>0===t.length?"NULL PORT DATA":t.shift(),peek:()=>{if(0===t.length)return"NULL PORT DATA";return t.slice()[0]},full:()=>t.length==a.a.MaxPortCapacity,empty:()=>0===t.length,clear:()=>{t.length=0}}}},function(t,e,n){"use strict";function a(t){if("object"!=typeof t||null==t)return;const e=t;for(const t of Object.getOwnPropertyNames(e))e.hasOwnProperty(t)&&delete e[t]}n.d(e,"a",(function(){return a}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(10);const r=(t,e=1)=>{const n={hacking_chance_mult:t.hacking_chance_mult,hacking_speed_mult:t.hacking_speed_mult,hacking_money_mult:t.hacking_money_mult,hacking_grow_mult:t.hacking_grow_mult,hacking_mult:t.hacking_mult,strength_mult:t.strength_mult,defense_mult:t.defense_mult,dexterity_mult:t.dexterity_mult,agility_mult:t.agility_mult,charisma_mult:t.charisma_mult,hacking_exp_mult:t.hacking_exp_mult,strength_exp_mult:t.strength_exp_mult,defense_exp_mult:t.defense_exp_mult,dexterity_exp_mult:t.dexterity_exp_mult,agility_exp_mult:t.agility_exp_mult,charisma_exp_mult:t.charisma_exp_mult,company_rep_mult:t.company_rep_mult,faction_rep_mult:t.faction_rep_mult,crime_money_mult:t.crime_money_mult,crime_success_mult:t.crime_success_mult,hacknet_node_money_mult:t.hacknet_node_money_mult,hacknet_node_purchase_cost_mult:t.hacknet_node_purchase_cost_mult,hacknet_node_ram_cost_mult:t.hacknet_node_ram_cost_mult,hacknet_node_core_cost_mult:t.hacknet_node_core_cost_mult,hacknet_node_level_cost_mult:t.hacknet_node_level_cost_mult,work_money_mult:t.work_money_mult,bladeburner_max_stamina_mult:t.bladeburner_max_stamina_mult,bladeburner_stamina_gain_mult:t.bladeburner_stamina_gain_mult,bladeburner_analysis_mult:t.bladeburner_analysis_mult,bladeburner_success_chance_mult:t.bladeburner_success_chance_mult};for(const[t,r]of Object.entries(n))n[t]=r*a.a.EntropyEffect**e;return n}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(28);const r=["START","PURCHASE","PRODUCTION","SALE","EXPORT"];class i{constructor(){var t,e,n;n=0,(e="state")in(t=this)?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}getState(){return r[this.state]}nextState(){(this.state<0||this.state>=r.length)&&(this.state=0),++this.state,this.state>=r.length&&(this.state=0)}toJSON(){return Object(a.b)("CorporationState",this)}static fromJSON(t){return Object(a.a)(i,t.data)}}a.c.constructors.CorporationState=i},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(15),r=n(162),i=n(64),o=n(4);const s={};!function(){let t,e,n;t="The Beginner's Guide to Hacking",e=i.a.HackersStartingHandbook,n="Some resources:

Learn to Program

For Experienced JavaScript Developers: NetscriptJS

Netscript Documentation

When starting out, hacking is the most profitable way to earn money and progress. This is a brief collection of tips/pointers on how to make the most out of your hacking scripts.

-hack() and grow() both work by percentages. hack() steals a certain percentage of the money on a server, and grow() increases the amount of money on a server by some percentage (multiplicatively)

-Because hack() and grow() work by percentages, they are more effective if the target server has a high amount of money. Therefore, you should try to increase the amount of money on a server (using grow()) to a certain amount before hacking it. Two important Netscript functions for this are getServerMoneyAvailable() and getServerMaxMoney()

-Keep security level low. Security level affects everything when hacking. Two important Netscript functions for this are getServerSecurityLevel() and getServerMinSecurityLevel()

-Purchase additional servers by visiting 'Alpha Enterprises' in the city. They are relatively cheap and give you valuable RAM to run more scripts early in the game

-Prioritize upgrading the RAM on your home computer. This can also be done at 'Alpha Enterprises'

-Many low level servers have free RAM. You can use this RAM to run your scripts. Use the scp Terminal or Netscript command to copy your scripts onto these servers and then run them.",s[e]=new r.a(t,e,n),t="The Complete Handbook for Creating a Successful Corporation",e=i.a.CorporationManagementHandbook,n="Getting Started with Corporations
To get started, visit the City Hall in Sector-12 in order to create a Corporation. This requires $150b of your own money, but this $150b will get put into your Corporation's funds. Your Corporation can have many different divisions, each in a different Industry. There are many different types of Industries, each with different properties. To create your first division, click the 'Expand into new Industry' button at the top of the management UI. The Agriculture and Software industries are recommended for your first division.

The first thing you'll need to do is hire some employees. Employees can be assigned to five different positions. Each position has a different effect on various aspects of your Corporation. It is recommended to have at least one employee at each position.

Each industry uses some combination of Materials in order to produce other Materials and/or create Products. Specific information about this is displayed in each of your divisions' UI.

Products are special, industry-specific objects. They are different than Materials because you must manually choose to develop them, and you can choose to develop any number of Products. Developing a Product takes time, but a Product typically generates significantly more revenue than any Material. Not all industries allow you to create Products. To create a Product, look for a button in the top-left panel of the division UI (e.g. For the Software Industry, the button says 'Develop Software').

To get your supply chain system started, purchase the Materials that your industry needs to produce other Materials/Products. This can be done by clicking the 'Buy' button next to the corresponding Material(s). After you have the required Materials, you will immediately start production. The amount of Materials/Products you produce is based on a variety of factors, one of which is your employees and their productivity.

Once you start producing Materials/Products, you can sell them in order to start earning revenue. This can be done by clicking the 'Sell' button next to the corresponding Material or Product. The amount of Material/Product you sell is dependent on a wide variety of different factors.

These are the basics of getting your Corporation up and running! Now, you can start purchasing upgrades to improve your bottom line. If you need money, consider looking for seed investors, who will give you money in exchange for stock shares. Otherwise, once you feel you are ready, take your Corporation public! Once your Corporation goes public, you can no longer find investors. Instead, your Corporation will be publicly traded and its stock price will change based on how well it's performing financially. You can then sell your stock shares in order to make money.

Tips/Pointers
-The 'Smart Supply' upgrade is extremely useful. Consider purchasing it as soon as possible.

-Purchasing Hardware, Robots, AI Cores, and Real Estate can potentially increase your production. The effects of these depend on what industry you are in.

-In order to optimize your production, you will need a good balance of Operators, Managers, and Engineers

-Different employees excel in different jobs. For example, the highly intelligent employees will probably do best if they are assigned to do Engineering work or Research & Development.

-If your employees have low morale, energy, or happiness, their production will greatly suffer.

-Tech is important, but don't neglect sales! Having several Businessmen can boost your sales and your bottom line.

-Don't forget to advertise your company. You won't have any business if nobody knows you.

-Having company awareness is great, but what's really important is your company's popularity. Try to keep your popularity as high as possible to see the biggest benefit for your sales

-Remember, you need to spend money to make money!

-Corporations do not reset when installing Augmentations, but they do reset when destroying a BitNode",s[e]=new r.a(t,e,n),t="A Brief History of Synthoids",e=i.a.HistoryOfSynthoids,n=`Synthetic androids, or Synthoids for short, are genetically engineered robots and, short of Augmentations, are composed entirely of organic substances. For this reason, Synthoids are virtually identical to humans in form, composition, and appearance.

Synthoids were first designed and manufactured by ${o.a.OmniTekIncorporated} sometime around the middle of the century. Their original purpose was to be used for manual labor and as emergency responders for disasters. As such, they were initially programmed only for their specific tasks. Each iteration that followed improved upon the intelligence and capabilities of the Synthoids. By the 6th iteration, called MK-VI, the Synthoids were so smart and capable enough of making their own decisions that many argued ${o.a.OmniTekIncorporated} had created the first sentient AI. These MK-VI Synthoids were produced in mass quantities (estimates up to 50 billion) with the hopes of increasing society's productivity and bolstering the global economy. Stemming from humanity's desire for technological advancement, optimism and excitement about the future had never been higher.

All of that excitement and optimism quickly turned to fear, panic, and dread in 2070, when a terrorist group called Ascendis Totalis hacked into ${o.a.OmniTekIncorporated} and uploaded a rogue AI into severeal of their Synthoid manufacturing facilities. This hack went undetected and for months ${o.a.OmniTekIncorporated} unknowingly churned out legions of Synthoids embedded with this rogue AI. Then, on December 24th, 2070, Omnica activated dormant protocols in the rogue AI, causing all of the infected Synthoids to immediately launch a military campaign to seek and destroy all of humanity.

What ensued was the deadlist conflict in human history. This crisis, now commonly known as the Synthoid Uprising, resulted in almost ten billion deaths over the course of a year. Despite the nations of the world banding together to combat the threat, the MK-VI Synthoids were simply stronger, faster, more intelligent, and more adaptable than humans, outsmarting them at every turn.

It wasn't until the sacrifice of an elite international military taskforce, called the ${o.a.Bladeburners}, that humanity was finally able to defeat the Synthoids. The ${o.a.Bladeburners}' final act was a suicide bombing mission that destroyed a large portion of the MK-VI Synthoids, including many of its leaders. In the following weeks militaries from around the world were able to round up and shut down the remaining rogue MK-VI Synthoids, ending the Synthoid Uprising.

In the aftermath of the bloodshed, the Synthoid Accords were drawn up. These Accords banned ${o.a.OmniTekIncorporated} from manufacturing any Synthoids beyond the MK-III series. They also banned any other corporation from constructing androids with advanced, near-sentient AI. MK-VI Synthoids that did not have the rogue Ascendis Totalis AI were allowed to continue their existence, but they were stripped of all rights and protections as they were not considered humans. They were also banned from doing anything that may pose a global security threat, such as working for any military/defense organization or conducting any bioengineering, computing, or robotics related research.

Unfortunately, many believe that not all of the rogue MK-VI Synthoids from the Uprising were found and destroyed, and that many of them are blending in as normal humans in society today. In response, many nations have created `+o.a.Bladeburners+" divisions, special military branches that are tasked with investigating and dealing with any Synthoid threats.

To this day, tensions still exist between the remaining Synthoids and humans as a result of the Uprising.

Nobody knows what happened to the terrorist group Ascendis Totalis.",s[e]=new r.a(t,e,n),t="A Green Tomorrow",e=i.a.AGreenTomorrow,n="Starting a few decades ago, there was a massive global movement towards the generation of renewable energy in an effort to combat global warming and climate change. The shift towards renewable energy was a big success, or so it seemed. In 2045 a staggering 80% of the world's energy came from non-renewable fossil fuels. Now, about three decades later, that number is down to only 15%. Most of the world's energy now comes from nuclear power and renewable sources such as solar and geothermal energy. Unfortunately, these efforts were not the huge success that they seem to be.

Since 2045 primary energy use has soared almost tenfold. This was mainly due to growing urban populations and the rise of increasingly advanced (and power-hungry) technology that has become ubiquitous in our lives. So, despite the fact that the percentage of our energy that comes from fossil fuels has drastically decreased, the total amount of energy we are producing from fossil fuels has actually increased.

The grim effects of our species' irresponsible use of energy and neglect of our mother world have become increasingly apparent. Last year a temperature of 190F was recorded in the Death Valley desert, which is over 50% higher than the highest recorded temperature at the beginning of the century. In the last two decades numerous major cities such as Manhattan, Boston, and Los Angeles have been partially or fully submerged by rising sea levels. In the present day, over 75% of the world's agriculture is done in climate-controlled vertical farms, as most traditional farmland has become unusable due to severe climate conditions.

Despite all of this, the greedy and corrupt corporations that rule the world have done nothing to address these problems that threaten our species. And so it's up to us, the common people. Each and every one of us can make a difference by doing what these corporations won't: taking responsibility. If we don't, pretty soon there won't be an Earth left to save. We are the last hope for a green tomorrow.",s[e]=new r.a(t,e,n),t="Alpha and Omega",e=i.a.AlphaOmega,n="Then we saw a new Heaven and a new Earth, for our first Heaven and Earth had gone away, and our sea was no more. And we saw a new holy city, new Aeria, coming down out of this new Heaven, prepared as a bride adorned for her husband. And we heard a loud voice saying, 'Behold, the new dwelling place of the Gods. We will dwell with them, and they will be our people, and we will be with them as their Gods. We will wipe away every tear from their eyes, and death shall be no more, neither shall there be mourning, nor crying, nor pain anymore, for the former things have passed away.'

And once we were seated on the throne we said 'Behold, I am making all things new.' Also we said, 'Write this down, for these words are trustworthy and true.' And we said to you, 'It is done! I am the Alpha and the Omega, the beginning and the end. To the thirsty I will give from the spring of the water of life without payment. The one who conquers will have this heritage, and we will be his God and he will be our son. But as for the cowardly, the faithless, the detestable, as for murderers, the sexually immoral, sorcerers, idolaters, and all liars, their portion will be in the lake that burns with fire and sulfur, for it is the second true death.'",s[e]=new r.a(t,e,n),t="Are We Living in a Computer Simulation?",e=i.a.SimulatedReality,n="The idea that we are living in a virtual world is not new. It's a trope that has been explored constantly in literature and pop culture. However, it is also a legitimate scientific hypothesis that many notable physicists and philosophers have debated for years.

Proponents for this simulated reality theory often point to how advanced our technology has become, as well as the incredibly fast pace at which it has advanced over the past decades. The amount of computing power available to us has increased over 100-fold since 2060 due to the development of nanoprocessors and quantum computers. Artifical Intelligence has advanced to the point where our entire lives are controlled by robots and machines that handle our day-to-day activities such as autonomous transportation and scheduling. If we consider the pace at which this technology has advanced and assume that these developments continue, it's reasonable to assume that at some point in the future our technology would be advanced enough that we could create simulations that are indistinguishable from reality. However, if continued technological advancement is a reasonable outcome, then it is very likely that such a scenario has already happened.

Statistically speaking, somewhere out there in the infinite universe there is an advanced, intelligent species that already has such technology. Who's to say that they haven't already created such a virtual reality: our own?",s[e]=new r.a(t,e,n),t="Beyond Man",e=i.a.BeyondMan,n="Humanity entered a 'transhuman' era a long time ago. And despite the protests and criticisms of many who cried out against human augmentation at the time, the transhuman movement continued and prospered. Proponents of the movement ignored the critics, arguing that it was in our inherent nature to better ourselves. To improve. To be more than we were. They claimed that not doing so would be to go against every living organism's biological purpose: evolution and survival of the fittest.

And here we are today, with technology that is advanced enough to augment humans to a state that can only be described as posthuman. But what do we have to show for it when this augmentation technology is only available to the so-called 'elite'? Are we really better off than before when only 5% of the world's population has access to this technology? When the powerful corporations and organizations of the world keep it all to themselves, have we really evolved?

Augmentation technology has only further increased the divide between the rich and the poor, between the powerful and the oppressed. We have not become 'more than human'. We have not evolved from nature's original design. We are still the greedy, corrupted, and evil men that we always were.",s[e]=new r.a(t,e,n),t="Brighter than the Sun",e=i.a.BrighterThanTheSun,n=`When people think about the corporations that dominate the East, they typically think of ${o.a.KuaiGongInternational}, which holds a complete monopoly for manufacturing and commerce in Asia, or Global Pharmaceuticals, the world's largest drug company, or ${o.a.OmniTekIncorporated}, the global leader in intelligent and autonomous robots. But there's one company that has seen a rapid rise in the last year and is poised to dominate not only the East, but the entire world: TaiYang Digital.

TaiYang Digital is a Chinese internet-technology corporation that provides services such as online advertising, search engines, gaming, media, entertainment, and cloud computing/storage. Its name TaiYang comes from the Chinese word for 'sun'. In Chinese culture, the sun is a 'yang' symbol associated with life, heat, masculinity, and heaven.

The company was founded less than 5 years ago and is already the third highest valued company in all of Asia. In 2076 it generated a total revenue of over 10 trillion yuan. It's services are used daily by over a billion people worldwide.

TaiYang Digital's meteoric rise is extremely surprising in modern society. This sort of growth is something you'd commonly see in the first half of the century, especially for tech companies. However in the last two decades the number of corporations has significantly declined as the largest entities quickly took over the economy. Corporations such as ${o.a.ECorp}, ${o.a.MegaCorp}, and ${o.a.KuaiGongInternational} have established such strong monopolies in their market sectors that they have effectively killed off all of the smaller and new corporations that have tried to start up over the years. This is what makes the rise of TaiYang Digital so impressive. And if TaiYang continues down this path, then they have a bright future ahead of them.`,s[e]=new r.a(t,e,n),t="Democracy is Dead: The Fall of an Empire",e=i.a.DemocracyIsDead,n="They rose from the shadows in the street.
From the places where the oppressed meet.
Their cries echoed loudly through the air.
As they once did in Tiananmen Square.
Loudness in the silence, Darkness in the light.
They came forth with power and might.
Once the beacon of democracy, America was first.
Its pillars of society destroyed and dispersed.
Soon the cries rose everywhere, with revolt and riot.
Until one day, finally, all was quiet.
From the ashes rose a new order, corporatocracy was its name.
Rome, Mongol, Byzantine, all of history is just the same.
For man will never change in a fundamental way.
And now democracy is dead, in the USA.",s[e]=new r.a(t,e,n),t="Figures Show Rising Crime Rates in "+a.a.Sector12,e=i.a.Sector12Crime,n=`A recent study by analytics company Wilson Inc. shows a significant rise in criminal activity in ${a.a.Sector12}. Perhaps the most alarming part of the statistic is that most of the rise is in violent crime such as homicide and assault. According to the study, the city saw a total of 21,406 reported homicides in 2076, which is over a 20% increase compared to 2075.

CIA director David Glarow says its too early to know whether these figures indicate the beginning of a sustained increase in crime rates, or whether the year was just an unfortunate outlier. He states that many intelligence and law enforcement agents have noticed an increase in organized crime activites, and believes that these figures may be the result of an uprising from criminal organizations such as ${o.a.TheSyndicate} or the ${o.a.SlumSnakes}.`,s[e]=new r.a(t,e,n),t="Man and the Machine",e=i.a.ManAndMachine,n="In 2005 Ray Kurzweil popularized his theory of the Singularity. He predicted that the rate of technological advancement would continue to accelerate faster and faster until one day machines would be become infinitely more intelligent than humans. This point, called the Singularity, would result in a drastic transformation of the world as we know it. He predicted that the Singularity would arrive by 2045. And yet here we are, more than three decades later, where most would agree that we have not yet reached a point where computers and machines are vastly more intelligent than we are. So what gives?

The answer is that we have reached the Singularity, just not in the way we expected. The artifical superintelligence that was predicted by Kurzweil and others exists in the world today - in the form of Augmentations. Yes, those Augmentations that the rich and powerful keep to themselves enable humans to become superintelligent beings. The Singularity did not lead to a world where our machines are infinitely more intelligent than us, it led to a world where man and machine can merge to become something greater. Most of the world just doesn't know it yet.",s[e]=new r.a(t,e,n),t="Secret Societies",e=i.a.SecretSocieties,n=`The idea of secret societies has long intrigued the general public by inspiring curiosity, fascination, and distrust. People have long wondered about who these secret society members are and what they do, with the most radical of conspiracy theorists claiming that they control everything in the entire world. And while the world may never know for sure, it is likely that many secret societies do actually exist, even today.

However, the secret societies of the modern world are nothing like those that (supposedly) existed decades and centuries ago. The Freemasons, Knights Templar, and ${o.a.Illuminati}, while they may have been around at the turn of the 21st century, almost assuredly do not exist today. The dominance of the Web in our everyday lives and the fact that so much of the world is now digital has given rise to a new breed of secret societies: Internet-based ones.

Commonly called 'hacker groups', Internet-based secret societies have become well-known in today's world. Some of these, such as ${o.a.TheBlackHand}, are black hat groups that claim they are trying to help the oppressed by attacking the elite and powerful. Others, such as ${o.a.NiteSec}, are hacktivist groups that try to push political and social agendas. Perhaps the most intriguing hacker group is the mysterious ${o.a.BitRunners}, whose purpose still remains unknown.`,s[e]=new r.a(t,e,n),t="Space: The Failed Frontier",e=i.a.TheFailedFrontier,n="Humans have long dreamed about spaceflight. With enduring interest, we were driven to explore the unknown and discover new worlds. We dreamed about conquering the stars. And in our quest, we pushed the boundaries of our scientific limits, and then pushed further. Space exploration lead to the development of many important technologies and new industries.

But sometime in the middle of the 21st century, all of that changed. Humanity lost its ambitions and aspirations of exploring the cosmos. The once-large funding for agencies like NASA and the European Space Agency gradually whittled away until their eventual disbanding in the 2060's. Not even militaries are fielding flights into space nowadays. The only remnants of the once great mission for cosmic conquest are the countless satellites in near-earth orbit, used for communications, espionage, and other corporate interests.

And as we continue to look at the state of space technology, it becomes more and more apparent that we will never return to that golden age of space exploration, that age where everyone dreamed of going beyond earth for the sake of discovery.",s[e]=new r.a(t,e,n),t="Coded Intelligence: Myth or Reality?",e=i.a.CodedIntelligence,n=`Tremendous progress has been made in the field of Artificial Intelligence over the past few decades. Our autonomous vehicles and transportation systems. The electronic personal assistants that control our everyday lives. Medical, service, and manufacturing robots. All of these are examples of how far AI has come and how much it has improved our daily lives. However, the question still remains of whether AI will ever be advanced enough to re-create human intelligence.

We've certainly come close to artificial intelligence that is similar to humans. For example ${o.a.OmniTekIncorporated}'s CompanionBot, a robot meant to act as a comforting friend for lonely and grieving people, is eerily human-like in its appearance, speech, mannerisms, and even movement. However its artificial intelligence isn't the same as that of humans. Not yet. It doesn't have sentience or self-awareness or consciousness.

Many neuroscientists believe that we won't ever reach the point of creating artificial human intelligence. 'At the end of the the day, AI comes down to 1's and 0's, while the human brain does not. We'll never see AI that is identical to that of humans.'`,s[e]=new r.a(t,e,n),t="Synthetic Muscles",e=i.a.SyntheticMuscles,n="Initial versions of synthetic muscles weren't made of anything organic but were actually crude devices made to mimic human muscle function. Some of the early iterations were actually made of common materials such as fishing lines and sewing threads due to their high strength for a cheap cost.

As technology progressed, however, advances in biomedical engineering paved the way for a new method of creating synthetic muscles. Instead of creating something that closely imitated the functionality of human muscle, scientists discovered a way of forcing the human body itself to augment its own muscle tissue using both synthetic and organic materials. This is typically done using gene therapy or chemical injections.",s[e]=new r.a(t,e,n),t="Tensions rise in global tech race",e=i.a.TensionsInTechRace,n=`Have we entered a new Cold War? Is WWIII just beyond the horizon?

After rumors came out that ${o.a.OmniTekIncorporated} had begun developing advanced robotic supersoldiers, geopolitical tensions quickly flared between the USA, Russia, and several Asian superpowers. In a rare show of cooperation between corporations, ${o.a.MegaCorp} and ${o.a.ECorp} have reportedly launched hundreds of new surveillance and espionage satellites. Defense contractors such as DeltaOne and AeroCorp have been working with the CIA and NSA to prepare for conflict. Meanwhile, the rest of the world sits in earnest hoping that it never reaches full-scale war. With today's technology and firepower, a World War would assuredly mean the end of human civilization.`,s[e]=new r.a(t,e,n),t="The Cost of Immortality",e=i.a.CostOfImmortality,n="Evolution and advances in medical and augmentation technology has lead to drastic improvements in human mortality rates. Recent figures show that the life expectancy for humans that live in a first-world country is about 130 years of age, almost double of what it was at the turn of the century. However, this increase in average lifespan has had some significant effects on society and culture.

Due to longer lifespans and a better quality of life, many adults are holding off on having kids until much later. As a result, the percentage of youth in first-world countries has been decreasing, while the number of senior citizens is significantly increasing.

Perhaps the most alarming result of all of this is the rapidly shrinking workforce. Despite the increase in life expectancy, the typical retirement age for workers in America has remained about the same, meaning a larger and larger percentage of people in America are retirees. Furthermore, many young adults are holding off on joining the workforce because they feel that they have plenty of time left in their lives for employment, and want to 'enjoy life while they're young.' For most industries, this shrinking workforce is not a major issue as most things are handled by robots anyways. However, there are still several key industries such as engineering and education that have not been automated, and these remain in danger to this cultural phenomenon.",s[e]=new r.a(t,e,n),t="The Hidden World",e=i.a.TheHiddenWorld,n=`WAKE UP SHEEPLE

THE GOVERNMENT DOES NOT EXIST. CORPORATIONS DO NOT RUN SOCIETY

THE ${o.a.Illuminati.toUpperCase()} ARE THE SECRET RULERS OF THE WORLD!

Yes, the ${o.a.Illuminati} of legends. The ancient secret society that controls the entire world from the shadows with their invisible hand. The group of the rich and wealthy that have penetrated every major government, financial agency, and corporation in the last three hundred years.

OPEN YOUR EYES

It was the ${o.a.Illuminati} that brought an end to democracy in the world. They are the driving force behind everything that happens.

THEY ARE ALL AROUND YOU

After destabilizing the world's governments, they are now entering the final stage of their master plan. They will secretly initiate global crises. Terrorism. Pandemics. World War. And out of the chaos that ensues they will build their New World Order.`,s[e]=new r.a(t,e,n),t="The New God",e=i.a.TheNewGod,n="Everyone has a moment in their life when they wonder about the bigger questions.

What's the point of all this? What is my purpose?

Some people dare to think even bigger.

What will the fate of the human race be?

We live in an era vastly different from that of 15 or even 20 years ago. We have gone beyond the limits of humanity. We have stripped ourselves of the tyranny of flesh.

The Singularity is here. The merging of man and machine. This is where humanity evolves into something greater. This is our future.

Embrace it, and you will obey a new god. The God in the Machine.",s[e]=new r.a(t,e,n),t="The New Triads",e=i.a.NewTriads,n=`The Triads were an ancient transnational crime syndicate based in China, Hong Kong, and other Asian territories. They were often considered one of the first and biggest criminal secret societies. While most of the branches of the Triads have been destroyed over the past few decades, the crime faction has spawned and inspired a number of other Asian crime organizations over the past few years. The most notable of these is the ${o.a.Tetrads}.

It is widely believed that the ${o.a.Tetrads} are a rogue group that splintered off from the Triads sometime in the mid 21st century. The founders of the ${o.a.Tetrads}, all of whom were ex-Triad members, believed that the Triads were losing their purpose and direction. The ${o.a.Tetrads} started off as a small group that mainly engaged in fraud and extortion. They were largely unknown until just a few years ago when they took over the illegal drug trade in all of the major Asian cities. They quickly became the most powerful crime syndicate in the continent.

Not much else is known about the ${o.a.Tetrads}, or about the efforts the Asian governments and corporations are making to take down this large new crime organization. Many believe that the ${o.a.Tetrads} have infiltrated the governments and powerful corporations in Asia, which has helped faciliate their recent rapid rise.`,s[e]=new r.a(t,e,n),t="The Secret War",e=i.a.TheSecretWar,n="",s[e]=new r.a(t,e,n)}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(160);function r(t,e,n,r,i){0!==i.length?1===i.length&&Object(a.e)(i[0]+"")?t.print("Set alias "+i[0]):2===i.length&&"-g"===i[0]&&Object(a.e)(i[1]+"",!0)?t.print("Set global alias "+i[1]):t.error('Incorrect usage of alias command. Usage: alias [-g] [aliasname="value"]'):Object(a.f)()}},function(t,e,n){"use strict";function a(t,e,n,a,r){0===r.length?t.startAnalyze(n):t.error("Incorrect usage of analyze command. Usage: analyze")}n.d(e,"a",(function(){return a}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(46),r=n(92);function i(t,e,n,i,o){if(0!==o.length)return void t.error("Incorrect usage of backdoor command. Usage: backdoor");i instanceof a.a||t.error("Can only backdoor normal servers");const s=i;s.purchasedByPlayer?t.error("Cannot use backdoor on your own machines! You are currently connected to your home PC or one of your purchased servers"):s.hasAdminRights?s.requiredHackingSkill>n.hacking?t.error("Your hacking skill is not high enough to use backdoor on this machine. Try analyzing the machine to determine the required hacking skill"):s instanceof r.a?t.error("Cannot use backdoor on this type of Server"):t.startBackdoor(n):t.error("You do not have admin rights for this machine! Cannot backdoor")}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(480);function r(t,e,n,r,i){if(!n.hasTorRouter())return void t.error("You need to be able to connect to the Dark Web to use the buy command. (Maybe there's a TOR router you can buy somewhere)");if(1!=i.length)return t.print("Incorrect number of arguments. Usage: "),t.print("buy -l"),t.print("buy -a"),void t.print("buy [item name]");const o=i[0]+"";"-l"==o||"-1"==o||"--list"==o?Object(a.d)():"-a"==o||"--all"==o?Object(a.a)():Object(a.b)(o)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(343),r=n(474),i=n(14),o=n(370);function s(t,e,n,s,l){if(1!==l.length)return void t.error("Incorrect usage of cat command. Usage: cat [file]");const c=l[0]+"",f=t.getFilepath(c);if(f.endsWith(".msg")||f.endsWith(".lit")||f.endsWith(".txt")||f.endsWith(".script")||f.endsWith(".js")||f.endsWith(".ns")){if(f.endsWith(".msg")||f.endsWith(".lit"))for(let t=0;t
${e.code}`)}t.error("No such file "+f)}else t.error("Only .msg, .txt, .lit, .script, .js, and .ns files are viewable with cat (filename must end with .msg, .txt, .lit, .script, .js, or .ns)")}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(83),r=n(642);function i(t,e,n,i,o){if(o.length>1)t.error("Incorrect number of arguments. Usage: cd [dir]");else{let e=1===o.length?o[0]+"":"/",i="";if("/"===e)i="/";else{if(e=Object(a.l)(e),i=Object(a.c)(e,t.cwd()),null===i||""===i)return void t.error("Invalid path. Failed to change directories");if(t.cwd().length>1&&".."===e)return void t.setcwd(i);const o=n.getCurrentServer();if(!Object(r.a)(o,i))return void t.error("Invalid path. Failed to change directories")}t.setcwd(i)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(236),r=n(100);function i(t,e,n,i,o){if(o.length<1)t.error("Incorrect number of arguments. Usage: check [script] [arg1] [arg2]...");else{const e=t.getFilepath(o[0]+"");if(!Object(r.a)(e))return void t.error(`'check' can only be called on scripts files (filename must end with ${r.b.join(", ")})`);const n=Object(a.a)(e,o.slice(1),i);if(null==n)return void t.error(`No script named ${e} is running on the server`);n.displayLog()}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var a=n(137),r=n(24),i=n(46);function o(t,e,n,o,s){if(1!==s.length)return void t.error("Incorrect usage of connect command. Usage: connect [hostname]");const l=s[0]+"";for(let e=0;en.hacking?t.error("Your hacking skill is not high enough to attempt hacking this machine. Try analyzing the machine to determine the required hacking skill"):t.startGrow(n):t.error("You do not have admin rights for this machine! Cannot grow")}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(46);function r(t,e,n,r,i){if(0!==i.length)return void t.error("Incorrect usage of hack command. Usage: hack");r instanceof a.a||t.error("Cannot hack your own machines! You are currently connected to your home PC or one of your purchased servers");const o=r;o.purchasedByPlayer?t.error("Cannot hack your own machines! You are currently connected to your home PC or one of your purchased servers"):o.hasAdminRights?o.requiredHackingSkill>n.hacking?t.error("Your hacking skill is not high enough to attempt hacking this machine. Try analyzing the machine to determine the required hacking skill"):t.startHack(n):t.error("You do not have admin rights for this machine! Cannot hack")}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(538);function r(t,e,n,r,i){if(0===i.length||1===i.length)if(0===i.length)a.b.forEach(e=>t.print(e));else{const e=i[0]+"",n=a.a[e];if(null==n)return void t.error("No help topics match '"+e+"'");n.forEach(e=>t.print(e))}else t.error("Incorrect usage of help command. Usage: help")}},function(t,e,n){"use strict";function a(t,e,n,a,r){if(0===r.length)return void t.commandHistory.forEach((e,n)=>{t.print(`${n.toString().padStart(2)} ${e}`)});const i=r[0]+"";"-c"===i||"--clear"===i?(n.terminalCommandHistory=[],t.commandHistory=[],t.commandHistoryIndex=1):t.error("Incorrect usage of history command. usage: history [-c]")}n.d(e,"a",(function(){return a}))},function(t,e,n){"use strict";function a(t,e,n,a,r){0===r.length?(n.getCurrentServer().isConnectedTo=!1,n.currentServer=n.getHomeComputer().hostname,n.getCurrentServer().isConnectedTo=!0,t.print("Connected to home"),t.setcwd("/")):t.error("Incorrect usage of home command. Usage: home")}n.d(e,"a",(function(){return a}))},function(t,e,n){"use strict";function a(t,e,n,a,r){0===r.length?t.print(n.getCurrentServer().hostname):t.error("Incorrect usage of hostname command. Usage: hostname")}n.d(e,"a",(function(){return a}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(142);function r(t,e,n,r,i){try{if(i.length<1)return void t.error("Incorrect usage of kill command. Usage: kill [scriptname] [arg1] [arg2]...");if("boolean"==typeof i[0])return;if("number"==typeof i[0]){const e=i[0];return void(Object(a.a)(e)?t.print("Killing script with PID "+e):t.error(`Failed to kill script with PID ${e}. No such script is running`))}const e=t.getFilepath(i[0]),n=r.getRunningScript(e,i.slice(1));if(null==n)return void t.error("No such script is running. Nothing to kill");Object(a.a)(n,r.hostname,!1),t.print("Killing "+e)}catch(e){t.error(e+"")}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(142),r=n(297);function i(t,e,n,i){for(let t=i.runningScripts.length-1;t>=0;--t)Object(a.a)(i.runningScripts[t],i.hostname,!1);r.a.emit(),t.print("Killing all running scripts")}},function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var a=n(144),r=n(121),i=n(115),o=n(0),s=n.n(o),l=n(83),c=n(318),f=n(474),u=n(343);function m(t,e,n,o,m){let h;try{h=c({"-l":Boolean,"--grep":String,"-g":"--grep"},{argv:m})}catch(t){return void p()}const d=h["--grep"];function p(){t.error("Incorrect usage of ls command. Usage: ls [dir] [-l] [-g, --grep pattern]")}if(m.length>4)return p();let g=t.cwd();g.endsWith("/")||(g+="/");const y=m[0]&&"string"==typeof m[0]&&!m[0].startsWith("-")?m[0]:"",b=Object(l.c)(y+"",t.cwd());if(g=b||"",g.endsWith("/")||(g+="/"),!Object(l.i)(g))return p();"/"===g&&(g="");const E=[],v=[],k=[],_=[],w=[],S=[];function x(t,e){let n=t;if(g){if(!t.startsWith(g))return;n=t.slice(g.length,t.length)}if(!d||n.includes(d))if(n.includes("/")){const t=Object(l.g)(n);if(d&&!t.includes(d))return;S.includes(t)||S.push(t)}else e.push(n)}const C=n.getCurrentServer();for(const t of C.programs)x(t,E);for(const t of C.scripts)x(t.filename,v);for(const t of C.textFiles)x(t.fn,k);for(const t of C.contracts)x(t.fn,_);for(const t of C.messages)x(t,w);function L({row:o,prefix:l,hostname:c}){const f=Object(r.a)(t=>Object(a.a)({scriptLinksWrap:{display:"inline-flex",color:t.palette.warning.main},scriptLink:{cursor:"pointer",textDecorationLine:"underline",paddingRight:"1.15em","&:last-child":{padding:0}}}))();let u=o.split("~").map(t=>[t.trim(),t.replace(t.trim(),"")]);return u=u.filter(t=>!!t[0]),s.a.createElement("span",{className:f.scriptLinksWrap},u.map(a=>s.a.createElement("span",{key:"script_"+a[0]},s.a.createElement("span",{className:f.scriptLink,onClick:()=>function(a){var r;if(n.getCurrentServer().hostname!==c)return t.error(`File is not on this server, connect to ${c} and try again`);a.startsWith("/")&&(a=a.slice(1));const o=t.getFilepath(`${l}${a}`),s=Object(i.toString)(null===(r=t.getScript(n,o))||void 0===r?void 0:r.code);e.toScriptEditor({[o]:s})}(a[0])},a[0]),s.a.createElement("span",null,a[1]))))}function O({row:e,prefix:i,hostname:o}){const l=Object(r.a)(t=>Object(a.a)({linksWrap:{display:"inline-flex",color:t.palette.primary.main},link:{cursor:"pointer",textDecorationLine:"underline",paddingRight:"1.15em","&:last-child":{padding:0}}}))();let c=e.split("~").map(t=>[t.trim(),t.replace(t.trim(),"")]);return c=c.filter(t=>!!t[0]),s.a.createElement("span",{className:l.linksWrap},c.map(e=>s.a.createElement("span",{key:"text_"+e[0]},s.a.createElement("span",{className:l.link,onClick:()=>function(e){if(n.getCurrentServer().hostname!==o)return t.error(`File is not on this server, connect to ${o} and try again`);e.startsWith("/")&&(e=e.slice(1));const a=t.getFilepath(`${i}${e}`);a.endsWith(".lit")?Object(f.a)(a):a.endsWith(".msg")&&Object(u.c)(a)}(e[0])},e[0]),s.a.createElement("span",null,e[1]))))}let M;function T(e,n){const a=e.segments,r=e.type===M.Script||e.type===M.Message,i=Math.max(...a.map(t=>t.length))+1,l=!0===n["-l"]?1:Math.ceil(80/i);for(let n=0;nt.segments.length>0);for(const t of A)T(t,h)}},function(t,e,n){"use strict";function a(t,e,n){t.print(n.getCurrentServer().cpuCores+" Core(s)")}n.d(e,"a",(function(){return a}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(5),r=n(6);function i(t,e,n,i,o){try{var s,l;if(1!==o.length&&3!==o.length)return void t.error("Incorrect usage of mem command. usage: mem [scriptname] [-t] [number threads]");const e=o[0]+"";let i=1;if(3===o.length&&"-t"===o[1]&&(i=Math.round(parseInt(o[2]+"")),isNaN(i)||i<1))return void t.error("Invalid number of threads specified. Number of threads must be greater than 1");const c=t.getScript(n,e);if(null==c)return void t.error("mem failed. No such script exists!");const f=c.ramUsage*i;t.print(`This script requires ${a.a.formatRAM(f)} of RAM to run for ${i} thread(s)`);const u=null!==(s=null===(l=c.ramUsageEntries)||void 0===l?void 0:l.sort((t,e)=>e.cost-t.cost))&&void 0!==s?s:[],m=r.a.UseIEC60027_2?9:8;for(const e of u)t.print(`${a.a.formatRAM(e.cost*i).padStart(m)} | ${e.name} (${e.type})`);f>0&&0===u.length&&t.warn("You might have to open & save this script to see the detailed RAM usage information.")}catch(e){t.error(e+"")}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var a=n(100),r=n(225),i=n(83);function o(t,e,n,o,s){if(2===s.length)try{const e=s[0]+"",l=s[1]+"";if(!Object(a.a)(e)&&!e.endsWith(".txt"))return void t.error("'mv' can only be used on scripts and text files (.txt)");const c=t.getFile(n,e);if(null==c)return void t.error(`Source file ${e} does not exist`);const f=t.getFilepath(e),u=Object(i.f)(l,e,t.cwd());if(null===u)return void t.error("error parsing dst file");const m=t.getFile(n,u),h=t.getFilepath(u);if(Object(i.a)(f,h))return void t.error("Source and destination files are the same file");if(Object(a.a)(e)){const e=c;if(!Object(a.a)(h))return void t.error("Source and destination files must have the same type");if(o.isRunning(f))return void t.error("Cannot use 'mv' on a script that is running");if(null!=m){if(o.isRunning(h))return void t.error("Cannot use 'mv' on a script that is running");if(!o.removeFile(h).res)return void t.error("Something went wrong...please contact game dev (probably a bug)");t.print("Warning: The destination file was overwritten")}e.filename=h}else if(c instanceof r.a){const e=c;if(!u.endsWith(".txt"))return void t.error("Source and destination files must have the same type");if(null!=m){if(!o.removeFile(h).res)return void t.error("Something went wrong...please contact game dev (probably a bug)");t.print("Warning: The destination file was overwritten")}e.fn=h}}catch(e){t.error(e+"")}else t.error("Incorrect number of arguments. Usage: mv [src] [dest]")}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(652);function r(t,e,n,r,i){return Object(a.a)("nano",{terminal:t,router:e,player:n,server:r,args:i})}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a=new class{constructor(){this.positions=new Map}saveCursor(t,e){this.positions.set(t,e)}getCursor(t){const e=this.positions.get(t);return e||{row:-1,column:-1}}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(318);function r(t,e,n,r,i){let o;try{o=a({"--grep":String,"-g":"--grep"},{argv:i})}catch(e){return void t.error("Incorrect usage of ps command. Usage: ps [-g, --grep pattern]")}const s=o["--grep"];if(s){const e=new RegExp(s.toString()),n=r.runningScripts.filter(t=>e.test(t.filename));for(let e=0;e0?d:1,y=h._;if(null==Object(o.a)(u,y,c)){for(let e=0;ef+.001)return void t.error("This machine does not have enough RAM to run this script"+(1===g?"":` with ${g} threads`)+`. Script requires ${l.a.formatRAM(s)} of RAM`);const m=new i.a(o,y);m.threads=g;return Object(r.e)(n,m,c)?(t.print(`Running script with ${g} thread(s), pid ${m.pid} and args: ${JSON.stringify(y)}.`),m.filename.endsWith(".ns")&&t.warn(".ns files are deprecated, please rename everything to .js"),void(p&&a.c.emit(m))):void t.error("Failed to start script")}t.error("No such script")}else t.error("This script is already running with the same args. Cannot run multiple instances with the same args")}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(65);function r(t,e,n,r,i){if(i.length<1)return;const o=i[0]+"";if(n.hasProgram(o)){if(!(i.length<1)){for(const s of Object.values(a.a))if(s.name.toLocaleLowerCase()===o.toLocaleLowerCase())return void s.run(e,t,n,r,i.slice(1).map(t=>t+""));t.error("Invalid executable. Cannot be run")}}else t.error(`No such (exe, script, js, ns, or cct) file! (Only programs that exist on your home computer or scripts on ${n.getCurrentServer().hostname} can be run)`)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(137);function r(t,e,n,r,i){if(0!==i.length)return void t.error("Incorrect usage of scan command. Usage: scan");const o=n.getCurrentServer(),s=o.serversOnNetwork.map((t,e)=>{const n=Object(a.a)(o,e);if(null===n)throw new Error("Server should not be null");return{hostname:n.hostname,ip:n.ip,hasRoot:n.hasAdminRights?"Y":"N"}});s.unshift({hostname:"Hostname",ip:"IP",hasRoot:"Root Access"});const l=Math.max(...s.map(t=>t.hostname.length)),c=Math.max(...s.map(t=>t.ip.length));for(const e of s){if(!e)continue;let n=e.hostname;n+=" ".repeat(l-e.hostname.length+1),n+=e.ip,n+=" ".repeat(c-e.ip.length+1),n+=e.hasRoot,t.print(n)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(65);function r(t,e,n,r,i){if(0===i.length)t.executeScanAnalyzeCommand(n,1);else{if(i.length>2)return void t.error("Incorrect usage of scan-analyze command. usage: scan-analyze [depth]");let e=!1;2===i.length&&"-a"===i[1]&&(e=!0);const r=parseInt(i[0]+"");if(isNaN(r)||r<0)return void t.error("Incorrect usage of scan-analyze command. depth argument must be positive numeric");if(r>3&&!n.hasProgram(a.a.DeepscanV1.name)&&!n.hasProgram(a.a.DeepscanV2.name))return void t.error("You cannot scan-analyze with that high of a depth. Maximum depth is 3");if(r>5&&!n.hasProgram(a.a.DeepscanV2.name))return void t.error("You cannot scan-analyze with that high of a depth. Maximum depth is 5");if(r>10)return void t.error("You cannot scan-analyze with that high of a depth. Maximum depth is 10");t.executeScanAnalyzeCommand(n,r,e)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(24),r=n(100);function i(t,e,n,i,o){try{if(2!==o.length)return void t.error("Incorrect usage of scp command. Usage: scp [file] [destination hostname]");const e=t.getFilepath(o[0]+"");if(!e.endsWith(".lit")&&!Object(r.a)(e)&&!e.endsWith(".txt"))return void t.error("scp only works for scripts, text files (.txt), and literature files (.lit)");const s=Object(a.d)(o[1]+"");if(null==s)return void t.error(`Invalid destination. ${o[1]} not found`);if(e.endsWith(".lit")){let n=!1;for(let t=0;t1){t.error("Found several potential candidates:");for(const e of a)t.error(`${e.filename} ${e.args.join(" ")}`);return void t.error("Script arguments need to be specified.")}t.error(`No script named ${e} is running on the server`)}else if("number"==typeof l[0]){const e=Object(a.b)(l[0],s);if(null==e)return void t.error(`No script with PID ${l[0]} is running on the server`);o.c.emit(e)}}catch(e){t.error(e+"")}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(651),r=n(5);function i(t,e,n,i,o){if(0!==o.length)return void t.error("Incorrect usage of top command. Usage: top");const s=`Script${" ".repeat(40-"Script".length)}PID${" ".repeat(10-"PID".length)}Threads${" ".repeat(16-"Threads".length)}RAM Usage`;t.print(s);const l=i.runningScripts;for(let e=0;en.hacking?t.error("Your hacking skill is not high enough to attempt hacking this machine. Try analyzing the machine to determine the required hacking skill"):t.startWeaken(n):t.error("You do not have admin rights for this machine! Cannot weaken")}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var a=n(596),r=n.n(a),i=n(100);function o(t,e,n,a,o){if(2!==o.length)return void t.error("Incorrect usage of wget command. Usage: wget [url] [target file]");const s=o[0]+"",l=t.getFilepath(o[1]+"");if(!Object(i.a)(l)&&!l.endsWith(".txt"))return t.error("wget failed: Invalid target file. Target file must be script or text file");r.a.get(s,(function(e){let r;return r=Object(i.a)(l)?a.writeToScriptFile(n,l,e):a.writeToTextFile(l,e),r.success?r.overwritten?t.print("wget successfully retrieved content and overwrote "+l):t.print("wget successfully retrieved content to new file "+l):t.error("wget failed")}),"text").fail((function(e){return t.error("wget failed: "+JSON.stringify(e))}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(462);function r(){a.b.emit()}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(2),r=n(108);function i(){!function(){if(a.a.exploits.includes(r.a.PrototypeTampering))return;setInterval((function(){"5.5e+1"!==55..toExponential()&&a.a.giveExploit(r.a.PrototypeTampering)}),9e5)}(),function(){if(a.a.exploits.includes(r.a.TimeCompression))return;let t=performance.now();window.setTimeout((function e(){const n=performance.now();n-t<500?a.a.giveExploit(r.a.TimeCompression):(t=n,window.setTimeout(e,15e3))}),15e3)}()}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var a=n(180),r=n(110),i=n(14);function o(){window.addEventListener("unhandledrejection",(function(t){if(Object(r.a)(t.reason)){const e=t.reason.split("|DELIMITER|"),n=e[1],a=e[2],r=e[3];let o=`UNCAUGHT PROMISE ERROR
You forgot to await a promise
${a}@${n}
`;o+="
",o+=r,Object(i.a)(o)}else if(t.reason instanceof a.a){const e=`UNCAUGHT PROMISE ERROR
You forgot to await a promise
${t.reason.name}@${t.reason.hostname} (PID - ${t.reason.pid})
Maybe hack / grow / weaken ?`;Object(i.a)(e)}}))}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";n.r(e);var a=n(0),r=n.n(a),i=n(107),o=n.n(i),s=n(170),l=n(747),c=n(298);function f(){Object(s.c)(),o.a.render(r.a.createElement(s.a,null,r.a.createElement(l.a,null)),document.getElementById("root"))}Object(c.a)(),globalThis.React=r.a,globalThis.ReactDOM=o.a,o.a.render(r.a.createElement(s.a,null,r.a.createElement(l.a,null)),document.getElementById("root")),s.b.subscribe(f),location.href.startsWith("file://")||(window.onbeforeunload=function(){return"Your work will be lost."}),window.print=()=>{throw new Error("You accidentally called window.print instead of ns.print")}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e){},,function(t,e){},,,,,,,,,,,,function(t,e){},,function(t,e){},,,,,,,,,,,,,,,,,,,,,,,,,function(t,e){},,function(t,e){},function(t,e){},,,,,function(t,e){},,function(t,e){},,,,,,function(t,e){},,function(t,e){},,,,,,,,,,,,,,,,,,,function(t,e){},,,,,,,,,,,,function(t,e){},,,function(t,e){}]); + */r.PARSE_OPTIONS={ecmaVersion:5,locations:!0},r.READONLY_DESCRIPTOR={configurable:!0,enumerable:!0,writable:!1},r.NONENUMERABLE_DESCRIPTOR={configurable:!0,enumerable:!1,writable:!0},r.READONLY_NONENUMERABLE_DESCRIPTOR={configurable:!0,enumerable:!1,writable:!1},r.VARIABLE_DESCRIPTOR={configurable:!1,enumerable:!0,writable:!0},r.STEP_ERROR={},r.SCOPE_REFERENCE={},r.VALUE_IN_DESCRIPTOR={},r.toStringCycles_=[],r.prototype.getErrorLineNumber=function(t){var e=this.sourceCode;if(null==t||null==t.start)return NaN;try{return((e=e.substring(0,t.start)).match(/\n/g)||[]).length+1-this.sourceCodeLineOffset}catch(t){return NaN}},r.prototype.getErrorLineNumberMessage=function(t){return isNaN(t)?" (Unknown line number)":t<=0?" (Error occurred in an imported function)":" (Line Number "+t+". This line number is probably incorrect if your script is importing any functions. This is being worked on)"},r.prototype.appendCode=function(t){var e=this.stateStack[0];if(!e||"Program"!==e.node.type)throw Error("Expecting original AST to start with a Program node.");if("string"==typeof t&&(t=a.a(t,r.PARSE_OPTIONS)),!t||"Program"!==t.type)throw Error("Expecting new AST to start with a Program node.");this.populateScope_(t,e.scope);for(var n,i=0;n=t.body[i];i++)e.node.body.push(n);e.done=!1},r.prototype.step=function(){var t=this.stateStack,e=t[t.length-1];if(!e)return!1;var n=e.node,a=n.type;if("Program"===a&&e.done)return!1;if(this.paused_)return!0;try{var i=this.stepFunctions_[a](t,e,n)}catch(t){if(t!==r.STEP_ERROR)throw t}return i&&t.push(i),!!n.end||this.step()},r.prototype.run=function(){for(;!this.paused_&&this.step(););return this.paused_},r.prototype.initGlobalScope=function(t){this.setProperty(t,"NaN",NaN,r.READONLY_DESCRIPTOR),this.setProperty(t,"Infinity",1/0,r.READONLY_DESCRIPTOR),this.setProperty(t,"undefined",void 0,r.READONLY_DESCRIPTOR),this.setProperty(t,"window",t,r.READONLY_DESCRIPTOR),this.setProperty(t,"this",t,r.READONLY_DESCRIPTOR),this.setProperty(t,"self",t),this.OBJECT_PROTO=new r.Object(null),this.FUNCTION_PROTO=new r.Object(this.OBJECT_PROTO),this.initFunction(t),this.initObject(t),t.proto=this.OBJECT_PROTO,this.setProperty(t,"constructor",this.OBJECT,r.NONENUMERABLE_DESCRIPTOR),this.initArray(t),this.initString(t),this.initBoolean(t),this.initNumber(t),this.initDate(t),this.initRegExp(t),this.initError(t),this.initMath(t),this.initJSON(t);var e=this,n=this.createNativeFunction((function(t){throw EvalError("Can't happen")}),!1);n.eval=!0,this.setProperty(t,"eval",n),this.setProperty(t,"parseInt",this.createNativeFunction(parseInt,!1)),this.setProperty(t,"parseFloat",this.createNativeFunction(parseFloat,!1)),this.setProperty(t,"isNaN",this.createNativeFunction(isNaN,!1)),this.setProperty(t,"isFinite",this.createNativeFunction(isFinite,!1));for(var a=[[escape,"escape"],[unescape,"unescape"],[decodeURI,"decodeURI"],[decodeURIComponent,"decodeURIComponent"],[encodeURI,"encodeURI"],[encodeURIComponent,"encodeURIComponent"]],i=0;i>> 0;","if (arguments.length > 1) T = thisArg;","k = 0;","while (k < len) {","if (k in O && !callbackfn.call(T, O[k], k, O)) return false;","k++;","}","return true;","}","});","Object.defineProperty(Array.prototype, 'filter',","{configurable: true, writable: true, value:","function(fun/*, thisArg*/) {","if (this === void 0 || this === null || typeof fun !== 'function') throw TypeError();","var t = Object(this);","var len = t.length >>> 0;","var res = [];","var thisArg = arguments.length >= 2 ? arguments[1] : void 0;","for (var i = 0; i < len; i++) {","if (i in t) {","var val = t[i];","if (fun.call(thisArg, val, i, t)) res.push(val);","}","}","return res;","}","});","if (!Array.prototype.find) {","Object.defineProperty(Array.prototype, 'find', {","value: function(predicate) {","if (this == null) {","throw new TypeError('\"this\" is null or not defined');","}","var o = Object(this);","var len = o.length >>> 0;","if (typeof predicate !== 'function') {","throw new TypeError('predicate must be a function');","}","var thisArg = arguments[1];","var k = 0;","while (k < len) {","var kValue = o[k];","if (predicate.call(thisArg, kValue, k, o)) {","return kValue;","}","k++;","}","return undefined;","},","configurable: true,","writable: true","});","}","if (!Array.prototype.findIndex) {","Object.defineProperty(Array.prototype, 'findIndex', {","value: function(predicate) {","if (this == null) {","throw new TypeError('\"this\" is null or not defined');","}","var o = Object(this);","var len = o.length >>> 0;","if (typeof predicate !== 'function') {","throw new TypeError('predicate must be a function');","}","var thisArg = arguments[1];","var k = 0;","while (k < len) {","var kValue = o[k];","if (predicate.call(thisArg, kValue, k, o)) {","return k;","}","k++;","}","return -1;","},","configurable: true,","writable: true","});","}","Object.defineProperty(Array.prototype, 'forEach',","{configurable: true, writable: true, value:","function(callback, thisArg) {","if (!this || typeof callback !== 'function') throw TypeError();","var T, k;","var O = Object(this);","var len = O.length >>> 0;","if (arguments.length > 1) T = thisArg;","k = 0;","while (k < len) {","if (k in O) callback.call(T, O[k], k, O);","k++;","}","}","});","Object.defineProperty(Array.prototype, 'includes', {","value: function(searchElement, fromIndex) {","if (this == null) {","throw new TypeError('\"this\" is null or not defined');","}","// 1. Let O be ? ToObject(this value).","var o = Object(this);",'// 2. Let len be ? ToLength(? Get(O, "length")).',"var len = o.length >>> 0;","// 3. If len is 0, return false.","if (len === 0) {","return false;","}","// 4. Let n be ? ToInteger(fromIndex).","// (If fromIndex is undefined, this step produces the value 0.)","var n = fromIndex | 0;","// 5. If n ≥ 0, then","// a. Let k be n.","// 6. Else n < 0,","// a. Let k be len + n.","// b. If k < 0, let k be 0.","var k = Math.max(n >= 0 ? n : len - Math.abs(n), 0);","function sameValueZero(x, y) {","return x === y || (typeof x === 'number' && typeof y === 'number' && isNaN(x) && isNaN(y));","}","// 7. Repeat, while k < len","while (k < len) {","// a. Let elementK be the result of ? Get(O, ! ToString(k)).","// b. If SameValueZero(searchElement, elementK) is true, return true.","if (sameValueZero(o[k], searchElement)) {","return true;","}","// c. Increase k by 1. ","k++;","}","// 8. Return false","return false;","}","});","Object.defineProperty(Array.prototype, 'map',","{configurable: true, writable: true, value:","function(callback, thisArg) {","if (!this || typeof callback !== 'function') new TypeError;","var T, A, k;","var O = Object(this);","var len = O.length >>> 0;","if (arguments.length > 1) T = thisArg;","A = new Array(len);","k = 0;","while (k < len) {","if (k in O) A[k] = callback.call(T, O[k], k, O);","k++;","}","return A;","}","});","Object.defineProperty(Array.prototype, 'reduce',","{configurable: true, writable: true, value:","function(callback /*, initialValue*/) {","if (!this || typeof callback !== 'function') throw TypeError();","var t = Object(this), len = t.length >>> 0, k = 0, value;","if (arguments.length === 2) {","value = arguments[1];","} else {","while (k < len && !(k in t)) k++;","if (k >= len) {","throw TypeError('Reduce of empty array with no initial value');","}","value = t[k++];","}","for (; k < len; k++) {","if (k in t) value = callback(value, t[k], k, t);","}","return value;","}","});","Object.defineProperty(Array.prototype, 'reduceRight',","{configurable: true, writable: true, value:","function(callback /*, initialValue*/) {","if (null === this || 'undefined' === typeof this || 'function' !== typeof callback) throw TypeError();","var t = Object(this), len = t.length >>> 0, k = len - 1, value;","if (arguments.length >= 2) {","value = arguments[1];","} else {","while (k >= 0 && !(k in t)) k--;","if (k < 0) {","throw TypeError('Reduce of empty array with no initial value');","}","value = t[k--];","}","for (; k >= 0; k--) {","if (k in t) value = callback(value, t[k], k, t);","}","return value;","}","});","Object.defineProperty(Array.prototype, 'some',","{configurable: true, writable: true, value:","function(fun/*, thisArg*/) {","if (!this || typeof fun !== 'function') throw TypeError();","var t = Object(this);","var len = t.length >>> 0;","var thisArg = arguments.length >= 2 ? arguments[1] : void 0;","for (var i = 0; i < len; i++) {","if (i in t && fun.call(thisArg, t[i], i, t)) {","return true;","}","}","return false;","}","});","(function() {","var sort_ = Array.prototype.sort;","Array.prototype.sort = function(opt_comp) {","if (typeof opt_comp !== 'function') {","return sort_.call(this);","}","for (var i = 0; i < this.length; i++) {","var changes = 0;","for (var j = 0; j < this.length - i - 1; j++) {","if (opt_comp(this[j], this[j + 1]) > 0) {","var swap = this[j];","this[j] = this[j + 1];","this[j + 1] = swap;","changes++;","}","}","if (!changes) break;","}","return this;","};","})();","Object.defineProperty(Array.prototype, 'toLocaleString',","{configurable: true, writable: true, value:","function() {","var out = [];","for (var i = 0; i < this.length; i++) {","out[i] = (this[i] === null || this[i] === undefined) ? '' : this[i].toLocaleString();","}","return out.join(',');","}","});","")},r.prototype.initString=function(t){var e,n=this;e=function(t){return t=String(t),n.calledWithNew()?(this.data=t,this):t},this.STRING=this.createNativeFunction(e,!0),this.setProperty(t,"String",this.STRING),this.setProperty(this.STRING,"fromCharCode",this.createNativeFunction(String.fromCharCode,!1),r.NONENUMERABLE_DESCRIPTOR);for(var a=["charAt","charCodeAt","concat","indexOf","lastIndexOf","slice","substr","substring","toLocaleLowerCase","toLocaleUpperCase","toLowerCase","toUpperCase","trim"],i=0;i= 0; i--) {","str = str.substring(0, subs[i][0]) + subs[i][2] + str.substring(subs[i][0] + subs[i][1]);","}","} else {","var i = str.indexOf(substr);","if (i !== -1) {","var inject = newSubstr(str.substr(i, substr.length), i, str);","str = str.substring(0, i) + inject + str.substring(i + substr.length);","}","}","return str;","};","})();","if (!String.prototype.endsWith) {","String.prototype.endsWith = function(search, this_len) {","if (this_len === undefined || this_len > this.length) {","this_len = this.length;","}","return this.substring(this_len - search.length, this_len) === search;","};","}","if (!String.prototype.includes) {","String.prototype.includes = function(search, start) {","'use strict';","if (typeof start !== 'number') {","start = 0;","}"," ","if (start + search.length > this.length) {","return false;","} else {","return this.indexOf(search, start) !== -1;","}","};","}","if (!String.prototype.startsWith) {","String.prototype.startsWith = function(search, pos) {","return this.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;","};","}","")},r.prototype.initBoolean=function(t){var e,n=this;e=function(t){return t=Boolean(t),n.calledWithNew()?(this.data=t,this):t},this.BOOLEAN=this.createNativeFunction(e,!0),this.setProperty(t,"Boolean",this.BOOLEAN)},r.prototype.initNumber=function(t){var e,n=this;e=function(t){return t=Number(t),n.calledWithNew()?(this.data=t,this):t},this.NUMBER=this.createNativeFunction(e,!0),this.setProperty(t,"Number",this.NUMBER);for(var a=["MAX_VALUE","MIN_VALUE","NaN","NEGATIVE_INFINITY","POSITIVE_INFINITY"],i=0;i>>0;return e===Number(t)?e:NaN},r.legalArrayIndex=function(t){var e=t>>>0;return String(e)===String(t)&&4294967295!==e?e:NaN},r.Value,r.Object=function(t){this.getter=Object.create(null),this.setter=Object.create(null),this.properties=Object.create(null),this.proto=t},r.Object.prototype.proto=null,r.Object.prototype.isObject=!0,r.Object.prototype.class="Object",r.Object.prototype.data=null,r.Object.prototype.toString=function(){if("Array"===this.class){(a=r.toStringCycles_).push(this);try{for(var t=[],e=0;e0;i.pop()){var o=i[i.length-1];switch(o.node.type){case"TryStatement":return void(o.cv={type:t,value:e,label:n});case"CallExpression":case"NewExpression":if(t===r.Completion.RETURN)return void(o.value=e);if(t!==r.Completion.THROW)throw Error("Unsynatctic break/continue not rejected by Acorn")}if(t===r.Completion.BREAK){if(n?o.labels&&-1!==o.labels.indexOf(n):o.isLoop||o.isSwitch)return void i.pop()}else if(t===r.Completion.CONTINUE&&(n?o.labels&&-1!==o.labels.indexOf(n):o.isLoop))return}var s;if(this.isa(e,this.ERROR)){var l={EvalError:EvalError,RangeError:RangeError,ReferenceError:ReferenceError,SyntaxError:SyntaxError,TypeError:TypeError,URIError:URIError},c=this.getProperty(e,"name").toString(),f=this.getProperty(e,"message").valueOf();s=(t=l[c]||Error)(f+a)}else s=String(e)+a;throw s},r.prototype.createGetter_=function(t,e){var n=Array.isArray(e)?e[0]:e,a=new this.nodeConstructor;a.type="CallExpression";var i=new r.State(a,this.stateStack[this.stateStack.length-1].scope);return i.doneCallee_=!0,i.funcThis_=n,i.func_=t,i.doneArgs_=!0,i.arguments_=[],i},r.prototype.createSetter_=function(t,e,n){var a=Array.isArray(e)?e[0]:this.global,i=new this.nodeConstructor;i.type="CallExpression";var o=new r.State(i,this.stateStack[this.stateStack.length-1].scope);return o.doneCallee_=!0,o.funcThis_=a,o.func_=t,o.doneArgs_=!0,o.arguments_=[n],o},r.State=function(t,e){this.node=t,this.scope=e},r.prototype.stepArrayExpression=function(t,e,n){var a=n.elements,i=e.n_||0;for(e.array_?(this.setProperty(e.array_,i,e.value),i++):(e.array_=this.createObjectProto(this.ARRAY_PROTO),e.array_.properties.length=a.length);i>=":s>>=l;break;case">>>=":s>>>=l;break;case"&=":s&=l;break;case"^=":s^=l;break;case"|=":s|=l;break;default:throw SyntaxError("Unknown assignment expression: "+n.operator)}var c=this.setValue(e.leftReference_,s);if(c)return e.doneSetter_=!0,e.setterValue_=s,this.createSetter_(c,e.leftReference_,s);t.pop(),t[t.length-1].value=s},r.prototype.stepBinaryExpression=function(t,e,n){if(!e.doneLeft_)return e.doneLeft_=!0,new r.State(n.left,e.scope);if(!e.doneRight_)return e.doneRight_=!0,e.leftValue_=e.value,new r.State(n.right,e.scope);t.pop();var a,i=e.leftValue_,o=e.value;switch(n.operator){case"==":a=i==o;break;case"!=":a=i!=o;break;case"===":a=i===o;break;case"!==":a=i!==o;break;case">":a=i>o;break;case">=":a=i>=o;break;case"<":a=i>":a=i>>o;break;case">>>":a=i>>>o;break;case"in":if(!o||!o.isObject){let t=this.getErrorLineNumber(n);this.throwException(this.TYPE_ERROR,"'in' expects an object, not '"+o+"'",t)}a=this.hasProperty(o,i);break;case"instanceof":if(!this.isa(o,this.FUNCTION)){let t=this.getErrorLineNumber(n);this.throwException(this.TYPE_ERROR,"Right-hand side of instanceof is not an object",t)}a=!!i.isObject&&this.isa(i,o);break;default:throw SyntaxError("Unknown binary operator: "+n.operator)}t[t.length-1].value=a},r.prototype.stepBlockStatement=function(t,e,n){var a=e.n_||0,i=n.body[a];if(i)return e.n_=a+1,new r.State(i,e.scope);t.pop()},r.prototype.stepBreakStatement=function(t,e,n){var a=n.label&&n.label.name;this.unwind(r.Completion.BREAK,void 0,a)},r.prototype.stepCallExpression=function(t,e,n){if(!e.doneCallee_){e.doneCallee_=1;var i=new r.State(n.callee,e.scope);return i.components=!0,i}if(1===e.doneCallee_){e.doneCallee_=2;var o=e.value;if(Array.isArray(o)){if(e.func_=this.getValue(o,n),o[0]===r.SCOPE_REFERENCE?e.directEval_="eval"===o[1]:e.funcThis_=o[0],(o=e.func_)&&"object"==typeof o&&o.isGetter)return o.isGetter=!1,e.doneCallee_=1,this.createGetter_(o,e.value)}else e.func_=o;e.arguments_=[],e.n_=0}o=e.func_;if(!e.doneArgs_){if(0!==e.n_&&e.arguments_.push(e.value),n.arguments[e.n_])return new r.State(n.arguments[e.n_++],e.scope);if("NewExpression"===n.type){if(o.illegalConstructor){let t=this.getErrorLineNumber(n);this.throwException(this.TYPE_ERROR,o+" is not a constructor",t)}var s=o.properties.prototype;"object"==typeof s&&null!==s||(s=this.OBJECT_PROTO),e.funcThis_=this.createObjectProto(s),e.isConstructor=!0}else void 0===e.funcThis_&&(e.funcThis_=e.scope.strict?void 0:this.global);e.doneArgs_=!0}if(e.doneExec_)t.pop(),e.isConstructor&&"object"!=typeof e.value?t[t.length-1].value=e.funcThis_:t[t.length-1].value=e.value;else{if(e.doneExec_=!0,!o||!o.isObject){let t=this.getErrorLineNumber(n);this.throwException(this.TYPE_ERROR,o+" is not a function",t)}var l=o.node;if(l){for(var c=this.createScope(l.body,o.parentScope),f=0;ff?e.arguments_[f]:void 0;this.setProperty(c,u,m)}var h=this.createObjectProto(this.ARRAY_PROTO);for(f=0;fa.a.ServerMaxGrowthRate&&(s=a.a.ServerMaxGrowthRate);const l=o*(t.serverGrowth/100)*r.a.ServerGrowthRate,c=1+(i-1)/16;return Math.pow(s,l*n.hacking_grow_mult*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,"a",(function(){return o}));var a=n(4),r=n(79),i=n(26);function o(t,e){const n=t.augmentations.map(t=>t.name),o=[];function s(t){if(n.includes(t.name))return!1;if(o.includes(t))return!1;if(t.isSpecial)return!1;const e=["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"];for(const n of Object.keys(t.mults))if(e.includes(n))return!0;return!1}if(e.inGang()){const t=e.getGangFaction();for(const n of Object.keys(r.a)){const a=r.a[n];s(a)&&(t.playerReputation>a.getCost(e).repCost&&o.push(a))}}for(const t of e.factions){if(t===a.a.Bladeburners)continue;if(t===a.a.Netburners)continue;const n=i.a[t];if(null!=n)for(const t of n.augmentations){const a=r.a[t];s(a)&&(n.playerReputation>a.getCost(e).repCost&&o.push(a))}}return o}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a=new(n(125).a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var a=n(15),r=n(9),i=n(52);const o=[{city:a.a.Aevum,infiltrationData:{maxClearanceLevel:12,startingSecurityLevel:8.18},name:r.a.AevumAeroCorp,types:[i.a.Company]},{city:a.a.Aevum,infiltrationData:{maxClearanceLevel:15,startingSecurityLevel:8.19},name:r.a.AevumBachmanAndAssociates,types:[i.a.Company]},{city:a.a.Aevum,infiltrationData:{maxClearanceLevel:18,startingSecurityLevel:9.55},name:r.a.AevumClarkeIncorporated,types:[i.a.Company]},{city:a.a.Aevum,costMult:3,expMult:2,name:r.a.AevumCrushFitnessGym,types:[i.a.Gym]},{city:a.a.Aevum,infiltrationData:{maxClearanceLevel:37,startingSecurityLevel:17.02},name:r.a.AevumECorp,types:[i.a.Company,i.a.TechVendor],techVendorMaxRam:512,techVendorMinRam:128},{city:a.a.Aevum,infiltrationData:{maxClearanceLevel:25,startingSecurityLevel:15.54},name:r.a.AevumFulcrumTechnologies,types:[i.a.Company,i.a.TechVendor],techVendorMaxRam:1024,techVendorMinRam:256},{city:a.a.Aevum,infiltrationData:{maxClearanceLevel:12,startingSecurityLevel:7.89},name:r.a.AevumGalacticCybersystems,types:[i.a.Company]},{city:a.a.Aevum,infiltrationData:{maxClearanceLevel:6,startingSecurityLevel:3.29},name:r.a.AevumNetLinkTechnologies,types:[i.a.Company,i.a.TechVendor],techVendorMaxRam:64,techVendorMinRam:8},{city:a.a.Aevum,infiltrationData:{maxClearanceLevel:6,startingSecurityLevel:5.35},name:r.a.AevumPolice,types:[i.a.Company]},{city:a.a.Aevum,infiltrationData:{maxClearanceLevel:5,startingSecurityLevel:5.02},name:r.a.AevumRhoConstruction,types:[i.a.Company]},{city:a.a.Aevum,costMult:10,expMult:5,name:r.a.AevumSnapFitnessGym,types:[i.a.Gym]},{city:a.a.Aevum,costMult:4,expMult:3,name:r.a.AevumSummitUniversity,types:[i.a.University]},{city:a.a.Aevum,infiltrationData:{maxClearanceLevel:7,startingSecurityLevel:5.85},name:r.a.AevumWatchdogSecurity,types:[i.a.Company]},{city:a.a.Aevum,name:r.a.AevumCasino,types:[i.a.Casino]},{city:a.a.Chongqing,infiltrationData:{maxClearanceLevel:25,startingSecurityLevel:16.25},name:r.a.ChongqingKuaiGongInternational,types:[i.a.Company]},{city:a.a.Chongqing,infiltrationData:{maxClearanceLevel:18,startingSecurityLevel:12.59},name:r.a.ChongqingSolarisSpaceSystems,types:[i.a.Company]},{city:a.a.Ishima,infiltrationData:{maxClearanceLevel:12,startingSecurityLevel:5.02},name:r.a.IshimaNovaMedical,types:[i.a.Company]},{city:a.a.Ishima,infiltrationData:{maxClearanceLevel:10,startingSecurityLevel:3.2},name:r.a.IshimaOmegaSoftware,types:[i.a.Company,i.a.TechVendor],techVendorMaxRam:128,techVendorMinRam:4},{city:a.a.Ishima,infiltrationData:{maxClearanceLevel:25,startingSecurityLevel:5.38},name:r.a.IshimaStormTechnologies,types:[i.a.Company,i.a.TechVendor],techVendorMaxRam:512,techVendorMinRam:32},{city:a.a.NewTokyo,infiltrationData:{maxClearanceLevel:17,startingSecurityLevel:7.18},name:r.a.NewTokyoDefComm,types:[i.a.Company]},{city:a.a.NewTokyo,infiltrationData:{maxClearanceLevel:20,startingSecurityLevel:5.9},name:r.a.NewTokyoGlobalPharmaceuticals,types:[i.a.Company]},{city:a.a.NewTokyo,infiltrationData:{maxClearanceLevel:5,startingSecurityLevel:2.5},name:r.a.NewTokyoNoodleBar,types:[i.a.Company,i.a.Special]},{city:a.a.NewTokyo,infiltrationData:{maxClearanceLevel:25,startingSecurityLevel:5.52},name:r.a.NewTokyoVitaLife,types:[i.a.Company,i.a.Special]},{city:a.a.NewTokyo,name:r.a.NewTokyoArcade,types:[i.a.Special]},{city:a.a.Sector12,infiltrationData:{maxClearanceLevel:10,startingSecurityLevel:3.62},name:r.a.Sector12AlphaEnterprises,types:[i.a.Company,i.a.TechVendor],techVendorMaxRam:8,techVendorMinRam:2},{city:a.a.Sector12,infiltrationData:{maxClearanceLevel:25,startingSecurityLevel:10.59},name:r.a.Sector12BladeIndustries,types:[i.a.Company]},{city:a.a.Sector12,name:r.a.Sector12CIA,types:[i.a.Company]},{city:a.a.Sector12,infiltrationData:{maxClearanceLevel:15,startingSecurityLevel:4.66},name:r.a.Sector12CarmichaelSecurity,types:[i.a.Company]},{city:a.a.Sector12,name:r.a.Sector12CityHall,types:[i.a.Special]},{city:a.a.Sector12,infiltrationData:{maxClearanceLevel:12,startingSecurityLevel:5.9},name:r.a.Sector12DeltaOne,types:[i.a.Company]},{city:a.a.Sector12,name:r.a.Sector12FoodNStuff,types:[i.a.Company]},{city:a.a.Sector12,infiltrationData:{maxClearanceLevel:25,startingSecurityLevel:8.18},name:r.a.Sector12FourSigma,types:[i.a.Company]},{city:a.a.Sector12,infiltrationData:{maxClearanceLevel:17,startingSecurityLevel:6.02},name:r.a.Sector12IcarusMicrosystems,types:[i.a.Company]},{city:a.a.Sector12,expMult:1,costMult:1,name:r.a.Sector12IronGym,types:[i.a.Gym]},{city:a.a.Sector12,infiltrationData:{maxClearanceLevel:5,startingSecurityLevel:3.13},name:r.a.Sector12JoesGuns,types:[i.a.Company]},{city:a.a.Sector12,infiltrationData:{maxClearanceLevel:31,startingSecurityLevel:16.36},name:r.a.Sector12MegaCorp,types:[i.a.Company]},{city:a.a.Sector12,name:r.a.Sector12NSA,types:[i.a.Company,i.a.Special]},{city:a.a.Sector12,costMult:20,expMult:10,name:r.a.Sector12PowerhouseGym,types:[i.a.Gym]},{city:a.a.Sector12,costMult:3,expMult:2,name:r.a.Sector12RothmanUniversity,types:[i.a.University]},{city:a.a.Sector12,infiltrationData:{maxClearanceLevel:12,startingSecurityLevel:5.9},name:r.a.Sector12UniversalEnergy,types:[i.a.Company]},{city:a.a.Volhaven,infiltrationData:{maxClearanceLevel:15,startingSecurityLevel:3.59},name:r.a.VolhavenCompuTek,types:[i.a.Company,i.a.TechVendor],techVendorMaxRam:256,techVendorMinRam:8},{city:a.a.Volhaven,infiltrationData:{maxClearanceLevel:18,startingSecurityLevel:7.28},name:r.a.VolhavenHeliosLabs,types:[i.a.Company]},{city:a.a.Volhaven,infiltrationData:{maxClearanceLevel:15,startingSecurityLevel:4.35},name:r.a.VolhavenLexoCorp,types:[i.a.Company]},{city:a.a.Volhaven,costMult:7,expMult:4,name:r.a.VolhavenMilleniumFitnessGym,types:[i.a.Gym]},{city:a.a.Volhaven,infiltrationData:{maxClearanceLevel:50,startingSecurityLevel:8.53},name:r.a.VolhavenNWO,types:[i.a.Company]},{city:a.a.Volhaven,infiltrationData:{maxClearanceLevel:25,startingSecurityLevel:7.74},name:r.a.VolhavenOmniTekIncorporated,types:[i.a.Company,i.a.TechVendor],techVendorMaxRam:1024,techVendorMinRam:128},{city:a.a.Volhaven,infiltrationData:{maxClearanceLevel:22,startingSecurityLevel:6},name:r.a.VolhavenOmniaCybersystems,types:[i.a.Company]},{city:a.a.Volhaven,infiltrationData:{maxClearanceLevel:18,startingSecurityLevel:4.77},name:r.a.VolhavenSysCoreSecurities,types:[i.a.Company]},{city:a.a.Volhaven,costMult:5,expMult:4,name:r.a.VolhavenZBInstituteOfTechnology,types:[i.a.University]},{city:null,name:r.a.Hospital,types:[i.a.Hospital]},{city:null,name:r.a.Slums,types:[i.a.Slums]},{city:null,name:r.a.TravelAgency,types:[i.a.TravelAgency]},{city:null,name:r.a.WorldStockExchange,types:[i.a.StockMarket]},{city:a.a.Chongqing,name:r.a.ChongqingChurchOfTheMachineGod,types:[i.a.Special]},{city:a.a.Ishima,name:r.a.IshimaGlitch,types:[i.a.Special]}]},function(t,e,n){"use strict";n.d(e,"b",(function(){return l})),n.d(e,"a",(function(){return c}));var a=n(100),r=n(1063),i=n.n(r),o=n(1064),s=n.n(o);function l(t,e){const n=1==t.length||"*.*"===t?null:t.slice(1),r=new s.a,o=(t,e)=>{for(let a=0;at.filename),e.scripts.map(t=>t.code)),n&&!n.endsWith(".txt")||o(e.textFiles.map(t=>t.fn),e.textFiles.map(t=>t.text)),0==Object.keys(r.files).length)throw new Error("No files match the pattern "+t);const l=`bitburner${Object(a.a)(t)?"Scripts":"*.txt"===t?"Texts":"Files"}.zip`;r.generateAsync({type:"blob"}).then(t=>i.a.saveAs(t,l))}function c(t,e,n,r,i){try{if(1!==i.length)return void t.error("Incorrect usage of download command. Usage: download [script/text file]");const e=i[0]+"";if(e.startsWith("*"))try{return void l(e,r)}catch(e){return t.error(e.message)}else if(Object(a.a)(e)){const a=t.getScript(n,e);if(null!=a)return a.download()}else{if(!e.endsWith(".txt"))return void t.error("Cannot download this filetype");{const a=t.getTextFile(n,e);if(null!=a)return a.download()}}return void t.error(e+" does not exist")}catch(e){return void t.error(e+"")}}},,,,,,,,,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,e){a(this,"lvl",1),a(this,"n",1),this.n=t,this.lvl=e}}},function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i}));var a=n(0);const r=a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16px",height:"16px",viewBox:"0 0 166 132",style:{fill:"#adff2f"}},a.createElement("g",null,a.createElement("path",{d:"M132.658-0.18l-24.321,24.321c-7.915-2.71-16.342-4.392-25.087-4.392c-45.84,0-83,46-83,46 s14.1,17.44,35.635,30.844L12.32,120.158l12.021,12.021L144.68,11.841L132.658-0.18z M52.033,80.445 c-2.104-4.458-3.283-9.438-3.283-14.695c0-19.054,15.446-34.5,34.5-34.5c5.258,0,10.237,1.179,14.695,3.284L52.033,80.445z"}),a.createElement("path",{d:"M134.865,37.656l-18.482,18.482c0.884,3.052,1.367,6.275,1.367,9.612c0,19.055-15.446,34.5-34.5,34.5 c-3.337,0-6.56-0.483-9.611-1.367l-10.124,10.124c6.326,1.725,12.934,2.743,19.735,2.743c45.84,0,83-46,83-46 S153.987,50.575,134.865,37.656z"}))),i=a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16px",height:"16px",viewBox:"-22 0 511 511.99561",style:{fill:"#adff2f"}},a.createElement("path",{d:"m.496094 466.242188 39.902344-39.902344 45.753906 45.753906-39.898438 39.902344zm0 0"}),a.createElement("path",{d:"m468.421875 89.832031-1.675781-89.832031-300.265625 300.265625 45.753906 45.753906zm0 0"}),a.createElement("path",{d:"m95.210938 316.785156 16.84375 16.847656h.003906l83.65625 83.65625 22.753906-22.753906-100.503906-100.503906zm0 0"}),a.createElement("path",{d:"m101.445312 365.300781-39.902343 39.902344 45.753906 45.753906 39.902344-39.902343-39.90625-39.902344zm0 0"}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var a=n(0),r=n.n(a),i=n(59),o=n(29),s=n(1),l=n(21),c=n(19),f=n(111),u=n(615),m=n.n(u),h=n(616),d=n.n(h);function p({action:t,isActive:e,bladeburner:n,rerender:a}){const u=o.b.Player(),h=t.level1;return r.a.createElement(c.a,{display:"flex",flexDirection:"row",alignItems:"center"},r.a.createElement(c.a,{display:"flex"},r.a.createElement(l.a,{title:r.a.createElement(s.a,null,t.getSuccessesNeededForNextLevel(i.a.ContractSuccessesPerLevel)," successes needed for next level")},r.a.createElement(s.a,null,"Level: ",t.level," / ",t.maxLevel))),r.a.createElement(l.a,{title:e?r.a.createElement(s.a,null,"WARNING: changing the level will restart the Operation"):""},r.a.createElement("span",null,r.a.createElement(f.a,{disabled:!h,onClick:function(){h&&(++t.level,e&&n.startAction(u,n.action),a())}},r.a.createElement(m.a,null)))),r.a.createElement(l.a,{title:e?r.a.createElement(s.a,null,"WARNING: changing the level will restart the Operation"):""},r.a.createElement("span",null,r.a.createElement(f.a,{disabled:!p,onClick:function(){p&&(--t.level,e&&n.startAction(u,n.action),a())}},r.a.createElement(d.a,null)))))}},,,function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(0),r=n.n(a),i=n(1),o=n(21),s=n(19),l=n(277);function c(t){return r.a.createElement(s.a,{display:"flex",flexDirection:"row",alignItems:"center"},r.a.createElement(o.a,{title:r.a.createElement(i.a,null,"Automatically increase operation level when possible")},r.a.createElement(i.a,null," Autolevel:")),r.a.createElement(l.a,{checked:t.action.autoLevel,onChange:function(e){t.action.autoLevel=e.target.checked,t.rerender()}}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(0),r=n.n(a),i=n(1162),o=n(22),s=n(8);function l(t){const[e,n]=Object(a.useState)(!1);return r.a.createElement(r.a.Fragment,null,r.a.createElement(s.a,{disabled:0===t.bladeburner.teamSize,onClick:()=>n(!0)},"Set Team Size (Curr Size: ",Object(o.f)(t.action.teamCount,0),")"),r.a.createElement(i.a,{open:e,onClose:()=>n(!1),action:t.action,bladeburner:t.bladeburner}))}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(0),r=n.n(a);function i(){const[t,e]=Object(a.useState)(!0);return Object(a.useEffect)(()=>{const t=setInterval(()=>e(t=>!t),1e3);return()=>clearInterval(t)}),r.a.createElement(r.a.Fragment,null,t?"|":r.a.createElement(r.a.Fragment,null," "))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(0),r=n.n(a),i=n(8),o=n(21),s=n(1251),l=n.n(s),c=n(1250);function f(){const[t,e]=Object(a.useState)(!1);return r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,{title:"The style editor allows you to modify certain CSS rules used by the game."},r.a.createElement(i.a,{startIcon:r.a.createElement(l.a,null),onClick:()=>e(!0)},"Style Editor")),r.a.createElement(c.a,{open:t,onClose:()=>e(!1)}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(0),r=n.n(a),i=n(8),o=n(21),s=n(1252),l=n(1284),c=n.n(l);function f({router:t}){const[e,n]=Object(a.useState)(!1);return r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,{title:"The theme editor allows you to modify the colors the game uses."},r.a.createElement(i.a,{id:"bb-theme-editor-button",startIcon:r.a.createElement(c.a,null),onClick:()=>n(!0)},"Theme Editor")),r.a.createElement(s.a,{open:e,onClose:()=>n(!1),router:t}))}},,,,,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(0),r=n.n(a),i=n(1),o=n(150);function s(){return r.a.createElement(r.a.Fragment,null,r.a.createElement(i.a,{sx:{my:1}},"If you've created a theme that you believe should be added in game's theme browser, feel free to"," ",r.a.createElement(o.a,{href:"https://github.com/danielyxie/bitburner/tree/dev/src/Themes/README.md",target:"_blank"},"create a pull request"),"."),r.a.createElement(i.a,{sx:{my:1}},"Head over to the"," ",r.a.createElement(o.a,{href:"https://discord.com/channels/415207508303544321/921991895230611466",target:"_blank"},"theme-sharing")," ","discord channel for more."))}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var a=n(0),r=n.n(a),i=n(342),o=n(252),s=n(8),l=n(21),c=n(634),f=n.n(c),u=n(298);function m({color:t="primary"}){const[e,n]=Object(a.useState)(!1);return r.a.createElement(r.a.Fragment,null,r.a.createElement(l.a,{title:"This will permanently delete your local save game. Did you export it before?"},r.a.createElement(s.a,{startIcon:r.a.createElement(f.a,null),color:t,onClick:()=>n(!0)},"Delete Save")),r.a.createElement(o.a,{onConfirm:()=>{n(!1),Object(i.a)().then(()=>{Object(u.b)(),setTimeout(()=>location.reload(),1e3)}).catch(t=>console.error("Could not delete game: "+t))},open:e,onClose:()=>n(!1),confirmationText:"Really delete your game? (It's permanent!)"}))}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(0),r=n.n(a),i=n(252),o=n(8),s=n(21),l=n(1285),c=n.n(l);function f({color:t="primary",noConfirmation:e=!1,onTriggered:n}){const[l,f]=Object(a.useState)(!1);return r.a.createElement(r.a.Fragment,null,r.a.createElement(s.a,{title:"Perform a soft reset. Resets everything as if you had just purchased an Augmentation."},r.a.createElement(o.a,{startIcon:r.a.createElement(c.a,null),color:t,onClick:function(){e?n():f(!0)}},"Soft Reset")),r.a.createElement(i.a,{onConfirm:n,open:l,onClose:()=>f(!1),confirmationText:"This will perform the same action as installing Augmentations, are you sure?"}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return S}));var a=n(1836),r=n(691),i=n(1477),o=n(1483),s=n(1484),l=n(21),c=n(1),f=n(249),u=n(45),m=n(19),h=n(8),d=n(0),p=n.n(d),g=n(6),y=n(5),b=n(12),E=n(79),v=n(1291);const k=t=>{const e=t.aug.prereqs.filter(e=>t.player.hasAugmentation(e)),n=t.aug.prereqs.length>0&&e.length===t.aug.prereqs.length;return p.a.createElement(l.a,{title:p.a.createElement(p.a.Fragment,null,p.a.createElement(c.a,{sx:{color:g.a.theme.money}},"This Augmentation has the following pre-requisite(s):"),t.aug.prereqs.map(e=>p.a.createElement(w,{fulfilled:t.player.hasAugmentation(e),value:e,color:g.a.theme.money,key:e})))},p.a.createElement(c.a,{sx:{ml:1,fontSize:"0.9rem",display:"flex",alignItems:"center",color:n?g.a.theme.successlight:g.a.theme.error,gridArea:"prereqs"}},n?p.a.createElement(p.a.Fragment,null,p.a.createElement(a.a,{fontSize:"small",sx:{mr:1}}),"Pre-requisites Owned"):p.a.createElement(p.a.Fragment,null,p.a.createElement(r.a,{fontSize:"small",sx:{mr:1}}),"Missing ",t.aug.prereqs.length-e.length," pre-requisite(s)")))},_=t=>p.a.createElement(l.a,{title:p.a.createElement(p.a.Fragment,null,p.a.createElement(c.a,{sx:{color:g.a.theme.money}},"This Augmentation can only be acquired from the following source(s):"),p.a.createElement("ul",null,p.a.createElement(c.a,{sx:{color:g.a.theme.money}},p.a.createElement("li",null,p.a.createElement("b",null,t.aug.factions[0])," faction"),t.player.isAwareOfGang()&&!t.aug.isSpecial&&p.a.createElement("li",null,"Certain ",p.a.createElement("b",null,"gangs")),t.player.canAccessGrafting()&&!t.aug.isSpecial&&t.aug.name!==b.a.TheRedPill&&p.a.createElement("li",null,p.a.createElement("b",null,"Grafting")))))},p.a.createElement(i.a,{fontSize:"small",sx:{ml:1,color:g.a.theme.money,transform:"rotate(180deg)",gridArea:"exclusive"}})),w=t=>p.a.createElement(c.a,{sx:{display:"flex",alignItems:"center",color:t.fulfilled?t.color:g.a.theme.error}},t.fulfilled?p.a.createElement(o.a,{sx:{mr:1}}):p.a.createElement(s.a,{sx:{mr:1}}),t.value),S=t=>p.a.createElement(f.a,{maxWidth:"lg",disableGutters:!0,sx:{mx:0,display:"grid",gridTemplateColumns:"repeat(1, 1fr)",gap:.75}},t.augNames.map(e=>p.a.createElement(x,{key:e,parent:t,augName:e,owned:!1})),t.ownedAugNames.map(e=>p.a.createElement(x,{key:e,parent:t,augName:e,owned:!0})));function x(t){const[e,n]=Object(d.useState)(!1),a=E.a[t.augName],r=a.getCost(t.parent.player),i=t.parent.sleeveAugs?a.baseCost:r.moneyCost,o=r.repCost,s="string"==typeof a.info?p.a.createElement("span",null,a.info):a.info,f=p.a.createElement(p.a.Fragment,null,s,p.a.createElement("br",null),p.a.createElement("br",null),a.stats);return p.a.createElement(u.a,{sx:{p:.5,display:"grid",gridTemplateColumns:"minmax(0, 4fr) 1.4fr",gap:1,opacity:t.owned?.75:1,minWidth:"1100px"}},p.a.createElement(p.a.Fragment,null,p.a.createElement(m.a,{sx:{display:"flex",alignItems:"center"}},p.a.createElement(h.a,{onClick:()=>t.parent.purchaseAugmentation(t.parent.player,a,t=>{n(t)}),disabled:!t.parent.canPurchase(t.parent.player,a)||t.owned,sx:{width:"48px",height:"36px",float:"left",clear:"none",mr:1}},t.owned?"Owned":"Buy"),p.a.createElement(m.a,{sx:{maxWidth:t.owned?"100%":"85%"}},p.a.createElement(m.a,{sx:{display:"grid",alignItems:"center",gridTemplateAreas:'"title exclusive prereqs"'}},p.a.createElement(l.a,{title:p.a.createElement(p.a.Fragment,null,p.a.createElement(c.a,{variant:"h5"},t.augName,t.augName===b.a.NeuroFluxGovernor&&" - Level "+a.getLevel(t.parent.player)),p.a.createElement(c.a,null,f))},p.a.createElement(c.a,{sx:{gridArea:"title",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",color:t.owned||!t.parent.canPurchase(t.parent.player,a)?g.a.theme.disabled:g.a.theme.primary}},a.name,a.name===b.a.NeuroFluxGovernor&&" - Level "+a.getLevel(t.parent.player))),1===a.factions.length&&!t.parent.sleeveAugs&&p.a.createElement(_,{player:t.parent.player,aug:a}),a.prereqs.length>0&&!t.parent.sleeveAugs&&p.a.createElement(k,{player:t.parent.player,aug:a})))),t.owned||p.a.createElement(m.a,{sx:{display:"grid",alignItems:"center",gridTemplateColumns:"1fr 1fr"}},p.a.createElement(w,{fulfilled:0===i||t.parent.player.money>i,value:y.a.formatMoney(i),color:g.a.theme.money}),void 0!==t.parent.rep&&p.a.createElement(w,{fulfilled:t.parent.rep>=o,value:y.a.formatReputation(o)+" rep",color:g.a.theme.rep})),g.a.SuppressBuyAugmentationConfirmation||p.a.createElement(v.a,{open:e,onClose:()=>n(!1),faction:t.parent.faction,aug:a})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return y}));var a=n(0),r=n.n(a),i=n(15),o=n(1322),s=n(10),l=n(6),c=n(29),f=n(20),u=n(465),m=n(14),h=n(1),d=n(19),p=n(8);function g(t,e,n){const a=s.a.TravelCost;t.canAfford(a)&&(t.loseMoney(a,"other"),t.travel(n),Object(m.a)(r.a.createElement(r.a.Fragment,null,"You are now in ",n,"!")),e.toCity())}function y(t){const e=c.b.Player(),n=c.b.Router(),m=Object(a.useState)(!1)[1],[y,b]=Object(a.useState)(!1),[E,v]=Object(a.useState)(i.a.Sector12);function k(){m(t=>!t)}function _(t){const a=s.a.TravelCost;e.canAfford(a)&&(l.a.SuppressTravelConfirmation?g(e,n,t):(b(!0),v(t)))}return Object(a.useEffect)(()=>{const t=setInterval(k,1e3);return()=>clearInterval(t)},[]),r.a.createElement(r.a.Fragment,null,r.a.createElement(h.a,{variant:"h4"},"Travel Agency"),r.a.createElement(d.a,{mx:2},r.a.createElement(h.a,null,"From here, you can travel to any other city! A ticket costs"," ",r.a.createElement(f.a,{money:s.a.TravelCost,player:t.p}),"."),l.a.DisableASCIIArt?r.a.createElement(r.a.Fragment,null,Object.values(i.a).filter(e=>e!=t.p.city).map(t=>{if(void 0===Object.entries(i.a).find(e=>e[1]===t))throw new Error(`could not find key for city '${t}'`);return r.a.createElement(r.a.Fragment,{key:t},r.a.createElement(p.a,{onClick:()=>_(t),sx:{m:2}},r.a.createElement(h.a,null,"Travel to ",t)),r.a.createElement("br",null))})):r.a.createElement(u.a,{currentCity:t.p.city,onTravel:t=>_(t)})),r.a.createElement(o.a,{city:E,travel:()=>g(e,n,E),open:y,onClose:()=>b(!1)}))}},function(t,e,n){"use strict";n.d(e,"b",(function(){return z})),n.d(e,"a",(function(){return X}));var a=n(0),r=n.n(a),i=n(532),o=n(1330),s=n(83),l=n(14),c=n(100),f=n(255),u=n(225),m=n(525),h=n(327),d=n(5),p=n(680),g=n(344),y=n.n(g),b=n(528),E=n(6),v=n(44),k=n(115),_=n(109),w=n(123),S=n(24),x=n(8),C=n(1),L=n(150),O=n(19),M=n(609),T=n.n(M),A=n(1341),R=n.n(A),N=n(536),P=n.n(N),I=n(148),F=n(30),D=n(50),j=n(149),B=n(407),G=n(38),W=n(1333),H=n(21),U=n(76);function q(){return(q=Object.assign||function(t){for(var e=1;e!e.includes(t)).sort()}class V{constructor(t,e,n,a,r){this.fileName=t,this.code=e,this.hostname=n,this.lastPosition=a,this.model=r}}let Y=[],J=null;function X(t){const e=Object(a.useState)(!1)[1];const n=Object(a.useRef)(null),g=Object(a.useRef)(null),b=Object(a.useRef)(null),[M,A]=Object(a.useState)(null),[N,z]=Object(a.useState)(null),[X,Q]=Object(a.useState)(""),[Z,tt]=Object(a.useState)(!1),[et,nt]=Object(a.useState)("RAM: ???"),[at,rt]=Object(a.useState)([["???",""]]),[it,ot]=Object(a.useState)(!1),[st,lt]=Object(a.useState)([]),[ct,ft]=Object(a.useState)(!1),[ut,mt]=Object(a.useState)({theme:E.a.MonacoTheme,insertSpaces:E.a.MonacoInsertSpaces,fontSize:E.a.MonacoFontSize,wordWrap:E.a.MonacoWordWrap,vim:t.vim||E.a.MonacoVim}),[ht,dt]=Object(a.useState)(!1);Y=Y.filter(t=>null!==Object(S.d)(t.hostname)),J&&null===Object(S.d)(J.hostname)&&(J=Y[0],void 0===J&&(J=null));const[pt,gt]=Object(a.useState)({height:window.innerHeight,width:window.innerWidth});function yt(t){null!==g.current&&(t.model=g.current.editor.createModel(t.code,t.fileName.endsWith(".txt")?"plaintext":"javascript"))}Object(a.useEffect)(()=>{const t=Object(k.debounce)((function(){gt({height:window.innerHeight,width:window.innerWidth})}),250);return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}},[]),Object(a.useEffect)(()=>{null!==J&&Et(J.code)},[]),Object(a.useEffect)(()=>{function e(e){E.a.DisableHotkeys||("KeyB"==e.code&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),t.router.toTerminal()),"KeyS"==e.code&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),e.stopPropagation(),kt()))}return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),Object(a.useEffect)(()=>{if(ut.vim&&N&&!M)try{window.require(["monaco-vim"],(function(e){A(e.initVimMode(N,b.current)),e.VimMode.Vim.defineEx("write","w",(function(){kt()})),e.VimMode.Vim.defineEx("quit","q",(function(){t.router.toTerminal()})),e.VimMode.Vim.defineEx("wqriteandquit","wq",(function(){kt(),t.router.toTerminal()})),e.VimMode.Vim.defineAction("nextTabs",(function(t,e){var n;const a=null!==(n=e.repeat)&&void 0!==n?n:1,r=_t();if(void 0!==r){wt((r+a)%Y.length)}})),e.VimMode.Vim.defineAction("prevTabs",(function(t,e){var n;const a=null!==(n=e.repeat)&&void 0!==n?n:1,r=_t();if(void 0!==r){let t=r-a;for(;t<0;)t+=Y.length;wt(t)}})),e.VimMode.Vim.mapCommand("gt","action","nextTabs",{},{context:"normal"}),e.VimMode.Vim.mapCommand("gT","action","prevTabs",{},{context:"normal"}),N.focus()}))}catch{}else ut.vim||(null==M||M.dispose(),A(null));return()=>{null==M||M.dispose()}},[ut,n,N,M]);const bt=Object(a.useMemo)(()=>Object(k.debounce)((t,e)=>{nt(t),rt(e),ot(!1)},300),[]);async function Et(e){if(null!=J&&J.fileName.endsWith(".txt"))return void bt("N/A",[["N/A",""]]);ot(!0);const n=e+"",a=await Object(m.a)(t.player,n,t.player.getCurrentServer().scripts);if(!(a.cost>0)){switch(a.cost){case h.a.ImportError:bt("RAM: Import Error",[["Import Error",""]]);break;case h.a.URLImportError:bt("RAM: HTTP Import Error",[["HTTP Import Error",""]]);break;case h.a.SyntaxError:default:bt("RAM: Syntax Error",[["Syntax Error",""]])}return new Promise(()=>{})}{var r,i;const t=null!==(r=null===(i=a.entries)||void 0===i?void 0:i.sort((t,e)=>e.cost-t.cost))&&void 0!==r?r:[],e=[];for(const n of t)e.push([`${n.name} (${n.type})`,d.a.formatRAM(n.cost)]);bt("RAM: "+d.a.formatRAM(a.cost),e)}}function vt(e){const n=Object(S.d)(e.hostname);if(null===n)throw new Error("Server should not be null but it is.");if(Object(c.a)(e.fileName)){for(let a=0;anull!==J&&t.fileName===J.fileName&&t.hostname===J.hostname)}function wt(t){if(null!==J){const t=_t();void 0!==t&&(Y[t]=J)}J={...Y[t]},null!==n.current&&null!==Y[t]&&((void 0===Y[t].model||Y[t].model.isDisposed())&&yt(Y[t]),n.current.setModel(Y[t].model),n.current.setPosition(Y[t].lastPosition),n.current.revealLineInCenter(Y[t].lastPosition.lineNumber),Et(Y[t].code),n.current.focus())}function St(a){const r=Y[a],i=Y.findIndex(t=>t.fileName===r.fileName&&t.hostname===r.hostname);let o="";-1!==i&&(o=Y[i].code);const s=Object(S.d)(r.hostname);if(null===s)throw new Error(`Server '${r.hostname}' should not be null, but it is.`);const l=s.scripts.findIndex(t=>t.filename===r.fileName);if(-1!==l&&o===s.scripts[l].code||B.a.emit({txt:`Do you want to save changes to ${r.fileName} on ${r.hostname}?`,resolve:t=>{t&&(r.code=o,vt(r))}}),Y.length>1){Y=Y.filter((t,e)=>e!==a);let t=-1;void 0===Y[a+t]&&(t=1,void 0===Y[a+t]&&(t=0)),J=Y[a+t],null!==n.current&&((void 0===Y[a+t].model||null===Y[a+t].model||Y[a+t].model.isDisposed())&&yt(Y[a+t]),n.current.setModel(Y[a+t].model),n.current.setPosition(Y[a+t].lastPosition),n.current.revealLineInCenter(Y[a+t].lastPosition.lineNumber),n.current.focus()),e(t=>!t)}else Y=[],J=null,t.router.toTerminal()}function xt(t){var e;const n=Y[t],a=Object(S.d)(n.hostname);if(null===a)throw new Error(`Server '${n.hostname}' should not be null, but it is.`);const r=a.scripts.find(t=>t.filename===n.fileName);return null!==(e=null==r?void 0:r.code)&&void 0!==e?e:null}function Ct(t){Q(t.target.value)}function Lt(){Q(""),tt(!Z)}const Ot=Object.values(Y).filter(t=>t.hostname.includes(X)||t.fileName.includes(X)),Mt=pt.height-(130+(ut.vim?34:0)),Tt=Ot.length?1640/Ot.length-5:0,At=Tt-50;return r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{style:{display:null!==J?"block":"none",height:"100%",width:"100%"}},r.a.createElement(p.a,{onDragEnd:function(t){if(!t.destination)return;const e=function(t,e,n){const a=Array.from(t),[r]=a.splice(e,1);return a.splice(n,0,r),a}(Y,t.source.index,t.destination.index);Y=e}},r.a.createElement(p.c,{droppableId:"tabs",direction:"horizontal"},(t,e)=>r.a.createElement(O.a,q({maxWidth:"1640px",display:"flex",flexDirection:"row",alignItems:"center",whiteSpace:"nowrap",ref:t.innerRef},t.droppableProps,{style:{backgroundColor:e.isDraggingOver?E.a.theme.backgroundsecondary:E.a.theme.backgroundprimary,overflowX:"scroll"}}),r.a.createElement(H.a,{title:"Search Open Scripts"},Z?r.a.createElement(U.a,{value:X,onChange:Ct,autoFocus:!0,InputProps:{startAdornment:r.a.createElement(y.a,null),spellCheck:!1,endAdornment:r.a.createElement(P.a,{onClick:Lt})}}):r.a.createElement(x.a,{onClick:Lt},r.a.createElement(y.a,null))),Ot.map(({fileName:t,hostname:e},a)=>{var i,o;const s="home"!==e,l=(null===(i=J)||void 0===i?void 0:i.fileName)===Ot[a].fileName&&(null===(o=J)||void 0===o?void 0:o.hostname)===Ot[a].hostname?{background:E.a.theme.button,borderColor:E.a.theme.button,color:E.a.theme.primary}:{background:E.a.theme.backgroundsecondary,borderColor:E.a.theme.backgroundsecondary,color:E.a.theme.secondary};s&&(l.color=E.a.theme.info);const c={maxWidth:"25px",minWidth:"25px",minHeight:"38.5px",maxHeight:"38.5px",...l},u=`${e}:~/${t} ${function(t){const e=Y[t],n=xt(t);return null===n||n!==f.a.formatCode(e.code)?" *":""}(a)}`;return r.a.createElement(p.b,{key:t+e,draggableId:t+e,index:a,disableInteractiveElementBlocking:!0},t=>r.a.createElement("div",q({ref:t.innerRef},t.draggableProps,t.dragHandleProps,{style:{...t.draggableProps.style,maxWidth:Tt+"px",marginRight:"5px",flexShrink:0,border:"1px solid "+E.a.theme.well}}),r.a.createElement(H.a,{title:u},r.a.createElement(x.a,{onClick:()=>wt(a),onMouseDown:t=>{t.preventDefault(),1===t.button&&St(a)},style:{maxWidth:At+"px",minHeight:"38.5px",overflow:"hidden",...l}},r.a.createElement("span",{style:{overflow:"hidden",direction:"rtl",textOverflow:"ellipsis"}},u))),r.a.createElement(H.a,{title:"Overwrite editor content with saved file content"},r.a.createElement(x.a,{onClick:()=>function(t){const e=Y[t],a=xt(t);null!==a&&e.code!==a&&B.a.emit({txt:"Do you want to overwrite the current editor content with the contents of "+e.fileName+" on the server? This cannot be undone.",resolve:r=>{r&&(e.code=a,wt(t),null!==n.current&&null!==e&&((void 0===e.model||e.model.isDisposed())&&yt(e),n.current.setModel(e.model),n.current.setValue(e.code),Et(e.code),n.current.focus()))}})}(a),style:c},r.a.createElement(R.a,{fontSize:"small"}))),r.a.createElement(x.a,{onClick:()=>St(a),style:c},r.a.createElement(P.a,{fontSize:"small"}))))}),t.placeholder))),r.a.createElement("div",{style:{paddingBottom:"5px"}}),r.a.createElement(i.a,{beforeMount:function(t){if($)return;$=!0,t.languages.registerCompletionItemProvider("javascript",{provideCompletionItems:()=>{const e=[];for(const n of K)e.push({label:n,kind:t.languages.CompletionItemKind.Function,insertText:n,insertTextRules:t.languages.CompletionItemInsertTextRule.InsertAsSnippet});return{suggestions:e}}}),async function(){const e=await t.languages.getLanguages().find(t=>"javascript"===t.id).loader();e.language.tokenizer.root.unshift([new RegExp("\\bns\\b"),{token:"ns"}]);for(const t of K)e.language.tokenizer.root.unshift([new RegExp(`\\b${t}\\b`),{token:"netscriptfunction"}]);["let","const","var","function"].forEach(t=>e.language.tokenizer.root.unshift([new RegExp(`\\b${t}\\b`),{token:"otherkeywords"}])),["true","false","null","undefined"].forEach(t=>e.language.tokenizer.root.unshift([new RegExp(`\\b${t}\\b`),{token:"otherkeyvars"}])),e.language.tokenizer.root.unshift([new RegExp("\\bthis\\b"),{token:"this"}])}();const e=(W.a+"").replace(/export /g,"");t.languages.typescript.javascriptDefaults.addExtraLib(e,"netscript.d.ts"),t.languages.typescript.typescriptDefaults.addExtraLib(e,"netscript.d.ts"),Object(w.b)(t),Object(w.d)(E.a.EditorTheme),t.editor.defineTheme("customTheme",Object(w.c)(E.a.EditorTheme))},onMount:function(e,a){if(z(e),n.current=e,g.current=a,null!==n.current&&null!==g.current){if(!t.files&&null!==J)return yt(J),n.current.setModel(J.model),n.current.setPosition(J.lastPosition),n.current.revealLineInCenter(J.lastPosition.lineNumber),Et(J.code),void n.current.focus();if(t.files){const e=Object.entries(t.files);if(!e.length)return void n.current.focus();for(const[a,r]of e){const e=Y.find(e=>e.fileName===a&&e.hostname===t.hostname);if(e)(void 0===e.model||null===e.model||e.model.isDisposed())&&yt(e),J=e,n.current.setModel(e.model),n.current.setPosition(e.lastPosition),n.current.revealLineInCenter(e.lastPosition.lineNumber),Et(e.code);else{const e=new V(a,r,t.hostname,new g.current.Position(0,0),g.current.editor.createModel(r,a.endsWith(".txt")?"plaintext":"javascript"));Y.push(e),J={...e},n.current.setModel(e.model),Et(e.code)}}}n.current.focus()}},loading:r.a.createElement(C.a,null,"Loading script editor!"),height:Mt+"px",defaultLanguage:"javascript",defaultValue:"",onChange:function(t){if(void 0===t)return;if(Et(t),null===n.current)return;const e=n.current.getPosition();if(null!==e){if(null!==J){J={...J,code:t,lastPosition:e};const n=Y.findIndex(t=>null!==J&&t.fileName===J.fileName&&t.hostname===J.hostname),a=[...Y],r=J;r.code=t,a[n]=r,Y=[...a]}try{!function(t){if(null===n.current||null===J)return;if(!J.fileName.endsWith(".ns")&&!J.fileName.endsWith(".js"))return;const e=Object(m.b)(t);if(-1!==e){const t=n.current.deltaDecorations(st,[{range:{startLineNumber:e,startColumn:1,endLineNumber:e,endColumn:10},options:{isWholeLine:!0,glyphMarginClassName:"myGlyphMarginClass",glyphMarginHoverMessage:{value:"Possible infinite loop, await something."}}}]);lt(t)}else{const t=n.current.deltaDecorations(st,[]);lt(t)}}(t)}catch(t){}}},theme:ut.theme,options:{...ut,glyphMargin:!0}}),r.a.createElement(O.a,{ref:b,className:"monaco-editor",display:"flex",flexDirection:"row",sx:{p:1},alignItems:"center"}),r.a.createElement(O.a,{display:"flex",flexDirection:"row",sx:{m:1},alignItems:"center"},r.a.createElement(x.a,{startIcon:r.a.createElement(T.a,null),onClick:()=>ft(!0),sx:{mr:1}},"Options"),r.a.createElement(x.a,{onClick:function(){null!==n.current&&n.current.getAction("editor.action.formatDocument").run()}},"Beautify"),r.a.createElement(x.a,{color:it?"secondary":"primary",sx:{mx:1},onClick:()=>{dt(!0)}},et),r.a.createElement(x.a,{onClick:kt},"Save (Ctrl/Cmd + s)"),r.a.createElement(x.a,{sx:{mx:1},onClick:t.router.toTerminal},"Terminal (Ctrl/Cmd + b)"),r.a.createElement(C.a,null," ",r.a.createElement("strong",null,"Documentation:")," ",r.a.createElement(L.a,{target:"_blank",href:"https://bitburner.readthedocs.io/en/latest/index.html"},"Basic")," | ",r.a.createElement(L.a,{target:"_blank",href:"https://github.com/danielyxie/bitburner/blob/dev/markdown/bitburner.ns.md"},"Full"))),r.a.createElement(o.a,{open:ct,onClose:()=>{var t;Object(w.d)(E.a.EditorTheme),null===(t=g.current)||void 0===t||t.editor.defineTheme("customTheme",Object(w.c)(E.a.EditorTheme)),ft(!1)},options:{theme:E.a.MonacoTheme,insertSpaces:E.a.MonacoInsertSpaces,fontSize:E.a.MonacoFontSize,wordWrap:E.a.MonacoWordWrap,vim:E.a.MonacoVim},save:t=>{var e;Object(w.d)(E.a.EditorTheme),null===(e=g.current)||void 0===e||e.editor.defineTheme("customTheme",Object(w.c)(E.a.EditorTheme)),mt(t),E.a.MonacoTheme=t.theme,E.a.MonacoInsertSpaces=t.insertSpaces,E.a.MonacoFontSize=t.fontSize,E.a.MonacoWordWrap=t.wordWrap,E.a.MonacoVim=t.vim}}),r.a.createElement(G.a,{open:ht,onClose:()=>dt(!1)},r.a.createElement(I.a,null,r.a.createElement(j.a,null,at.map(([t,e])=>r.a.createElement(r.a.Fragment,{key:t+e},r.a.createElement(D.a,null,r.a.createElement(F.a,{sx:{color:E.a.theme.primary}},t),r.a.createElement(F.a,{align:"right",sx:{color:E.a.theme.primary}},e)))))))),r.a.createElement("div",{style:{display:null!==J?"none":"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},r.a.createElement("span",{style:{color:E.a.theme.primary,fontSize:"20px",textAlign:"center"}},r.a.createElement(C.a,{variant:"h4"},"No open files"),r.a.createElement(C.a,{variant:"h5"},"Use ",r.a.createElement("code",null,"nano FILENAME")," in",r.a.createElement("br",null),"the terminal to open files"))))}},,,,function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i}));var a=n(83);function r(t,e){const n=[];if(!Object(a.i)(e))return n;let r=e;function i(t){if("/"===r&&Object(a.h)(t)){const e=Object(a.g)(t);"/"===e||n.includes(e)||n.push(e)}else if(t.startsWith(r)){const e=t.slice(r.length),i=Object(a.g)(e);"/"===i||n.includes(i)||n.push(i)}}r.endsWith("/")||(r+="/");for(const e of t.scripts)i(e.filename);for(const e of t.textFiles)i(e.fn);return n}function i(t,e){const n=e+("/"===e.slice(-1)?"":"/");return[...t.scripts.map(t=>t.filename),...t.textFiles.map(t=>t.fn)].some(t=>t.startsWith(n))}},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return compile})),__webpack_require__.d(__webpack_exports__,"b",(function(){return executeJSScript}));var acorn_walk__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(303),acorn__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(256),_NetscriptEvaluator__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(110),_Script_ScriptUrl__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(1346),_Terminal_DirectoryHelpers__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(83);function makeScriptBlob(t){return new Blob([t],{type:"text/javascript"})}async function compile(player,script,scripts){if(!shouldCompile(script,scripts))return;await script.updateRamUsage(player,scripts);const uurls=_getScriptUrls(script,scripts,[]),url=uurls[uurls.length-1].url;script.url&&script.url!==url&&URL.revokeObjectURL(script.url),script.dependencies.length>0&&script.dependencies.forEach(t=>URL.revokeObjectURL(t.url)),script.url=uurls[uurls.length-1].url,script.module=new Promise(resolve=>resolve(eval("import(uurls[uurls.length - 1].url)"))),script.dependencies=uurls}async function executeJSScript(t,e=[],n){const a=n.getScript();if(null===a)throw new Error("script is null");await compile(t,a,e),n.ramUsage=a.ramUsage;const r=await a.module,i=n.env.vars;if(!r.main)throw Object(_NetscriptEvaluator__WEBPACK_IMPORTED_MODULE_2__.b)(n,a.filename+" cannot be run because it does not have a main function.");return r.main(i)}function isDependencyOutOfDate(t,e,n){const a=e.find(e=>e.filename==t);if(!a)return!0;return a.moduleSequenceNumber>n}function shouldCompile(t,e){return""===t.module||t.dependencies.some(n=>isDependencyOutOfDate(n.filename,e,t.moduleSequenceNumber))}function _getScriptUrls(t,e,n){const a=[];for(const e of n)t.dependents.some(t=>t.server===e.server&&t.filename==e.filename)||t.dependents.push({server:e.server,filename:e.filename});n.push(t);try{const r=Object(acorn__WEBPACK_IMPORTED_MODULE_1__.a)(t.code,{sourceType:"module",ecmaVersion:"latest",ranges:!0}),i=[];acorn_walk__WEBPACK_IMPORTED_MODULE_0__.b(r,{ImportDeclaration(t){i.push({filename:t.source.value,start:t.source.range[0]+1,end:t.source.range[1]-1})},ExportNamedDeclaration(t){t.source&&i.push({filename:t.source.value,start:t.source.range[0]+1,end:t.source.range[1]-1})},ExportAllDeclaration(t){t.source&&i.push({filename:t.source.value,start:t.source.range[0]+1,end:t.source.range[1]-1})}}),i.sort((t,e)=>e.start-t.start);let o=t.code;for(const t of i){const r=t.filename.startsWith("./")?t.filename.substring(2):t.filename,i=e.filter(t=>Object(_Terminal_DirectoryHelpers__WEBPACK_IMPORTED_MODULE_4__.b)(t.filename,r));if(0===i.length)continue;const[s]=i,l=_getScriptUrls(s,e,n);a.push(...l);const c=l[l.length-1].url;o=o.substring(0,t.start)+c+o.substring(t.end)}o+=`\n//# sourceURL=${t.server}/${t.filename}`;const s=URL.createObjectURL(makeScriptBlob(o));return a.push(new _Script_ScriptUrl__WEBPACK_IMPORTED_MODULE_3__.a(t.filename,s,t.moduleSequenceNumber)),a}catch(t){for(const t of a)URL.revokeObjectURL(t.url);throw t}finally{n.pop()}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(645),r=n(318);function i(t){return()=>e=>{e=Object(a.a)(e);const n={};for(const t of e){let e=String;"number"==typeof t[1]?e=Number:"boolean"==typeof t[1]?e=Boolean:Array.isArray(t[1])&&(e=[String]);const a=t[0].length>1?2:1;n["-".repeat(a)+t[0]]=e}const i=r(n,{argv:t});for(const t of e)i.hasOwnProperty("--"+t[0])&&i.hasOwnProperty("-"+t[0])||(i[t[0]]=t[1]);for(const t of Object.keys(i)){if(!t.startsWith("-"))continue;const e=i[t];delete i[t];const n=2===t.length?1:2;i[t.slice(n)]=e}return i}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));const a=new(n(595).a)("",()=>{});function r(t){if(null==t)return null;if(!(t.hasOwnProperty("properties")&&t.hasOwnProperty("getter")&&t.hasOwnProperty("setter")&&t.hasOwnProperty("proto")))return t;let e;if(t.hasOwnProperty("class")&&"Array"===t.class){e=[];const n=a.getProperty(t,"length");for(let i=0;i{u(t,0)},disabled:0===s},"rtl"===e.direction?a.createElement(d.a,null):a.createElement(l.a,null)),a.createElement(o.a,{onClick:t=>{u(t,s-1)},disabled:0===s},"rtl"===e.direction?a.createElement(m.a,null):a.createElement(f.a,null)),a.createElement(o.a,{onClick:t=>{u(t,s+1)},disabled:s>=Math.ceil(n/c)-1},"rtl"===e.direction?a.createElement(f.a,null):a.createElement(m.a,null)),a.createElement(o.a,{onClick:t=>{u(t,Math.max(0,Math.ceil(n/c)-1))},disabled:s>=Math.ceil(n/c)-1},"rtl"===e.direction?a.createElement(l.a,null):a.createElement(d.a,null)))}},function(t,e,n){"use strict";n.d(e,"b",(function(){return w})),n.d(e,"a",(function(){return S}));var a=n(209),r=n.n(a),i=n(81),o=n.n(i),s=n(19),l=n(45),c=n(355),f=n(113),u=n(1),m=n(276),h=n(148),d=n(149),p=n(115),g=n(0),y=n.n(g),b=n(88),E=n(6),v=n(29),k=n(73),_=n(152);function w({n:t,level:e}){const[n,a]=y.a.useState(!1);return 1===t?y.a.createElement(y.a.Fragment,null):y.a.createElement(s.a,{component:l.a,sx:{mt:1,p:1}},y.a.createElement(c.a,{disableGutters:!0,onClick:()=>a(t=>!t)},y.a.createElement(f.a,{primary:y.a.createElement(u.a,{variant:"h6"},"Bitnode Multipliers")}),n?y.a.createElement(r.a,{color:"primary"}):y.a.createElement(o.a,{color:"primary"})),y.a.createElement(m.a,{in:n},y.a.createElement(S,{n:t,level:e})))}const S=({n:t,level:e})=>{const n=v.b.Player(),a=12===t?1/0:3,r=Object(_.c)(t,null!=e?e:Math.min(n.sourceFileLvl(t)+1,a));return y.a.createElement(s.a,{sx:{columnCount:2,columnGap:1,mb:-2}},y.a.createElement(C,{n:t,mults:r}),y.a.createElement(R,{n:t,mults:r}),y.a.createElement(T,{n:t,mults:r}),y.a.createElement(L,{n:t,mults:r}),y.a.createElement(N,{n:t,mults:r}),y.a.createElement(P,{n:t,mults:r}),y.a.createElement(M,{n:t,mults:r}),y.a.createElement(A,{n:t,mults:r}),y.a.createElement(I,{n:t,mults:r}),y.a.createElement(O,{n:t,mults:r}),y.a.createElement(j,{n:t,mults:r}),y.a.createElement(B,{n:t,mults:r}),y.a.createElement(F,{n:t,mults:r}),y.a.createElement(D,{n:t,mults:r}))},x=t=>{const e=Object.entries(t.rowData).filter(([e,n])=>t.mults[e]!==_.b[e]).map(([e,n])=>{var a,r;return y.a.createElement(k.a,{key:Object(p.uniqueId)(),name:n.name,data:{content:null!==(a=n.content)&&void 0!==a?a:(100*t.mults[e]).toFixed(3)+"%"},color:null!==(r=n.color)&&void 0!==r?r:E.a.theme.primary})});return e.length>0?y.a.createElement("span",{style:{display:"inline-block",width:"100%",marginBottom:"16px"}},y.a.createElement(u.a,{variant:"h6"},t.sectionName),y.a.createElement(h.a,null,y.a.createElement(d.a,null,e))):y.a.createElement(y.a.Fragment,null)};function C({mults:t}){const e={WorldDaemonDifficulty:{name:b.a.WorldDaemon+" Difficulty"},DaedalusAugsRequirement:{name:"Daedalus Augs Requirement",content:String(t.DaedalusAugsRequirement)},HacknetNodeMoney:{name:"Hacknet Production"},CodingContractMoney:{name:"Coding Contract Reward"},ClassGymExpGain:{name:"Class/Gym Exp"}};return y.a.createElement(x,{sectionName:"General",rowData:e,mults:t})}function L({mults:t}){const e={AugmentationMoneyCost:{name:"Money Cost"},AugmentationRepCost:{name:"Reputation Cost",color:E.a.theme.rep}};return y.a.createElement(x,{sectionName:"Augmentations",rowData:e,mults:t})}function O({mults:t}){const e={CompanyWorkMoney:{name:"Work Money",color:E.a.theme.money},CompanyWorkExpGain:{name:"Work Exp"}};return y.a.createElement(x,{sectionName:"Company",rowData:e,mults:t})}function M({mults:t}){return y.a.createElement(x,{sectionName:"Stock Market",rowData:{FourSigmaMarketDataCost:{name:"Market Data Cost"},FourSigmaMarketDataApiCost:{name:"Market Data API Cost"}},mults:t})}function T({mults:t}){const e={RepToDonateToFaction:{name:"Favor to Donate"},FactionWorkRepGain:{name:"Work Reputation",color:E.a.theme.rep},FactionWorkExpGain:{name:"Work Exp"},FactionPassiveRepGain:{name:"Passive Rep",color:E.a.theme.rep}};return y.a.createElement(x,{sectionName:"Faction",rowData:e,mults:t})}function A({mults:t}){const e={CrimeExpGain:{name:"Crime Exp",color:E.a.theme.combat},CrimeMoney:{name:"Crime Money",color:E.a.theme.combat}};return y.a.createElement(x,{sectionName:"Crime",rowData:e,mults:t})}function R({mults:t}){const e={HackingLevelMultiplier:{name:"Hacking Level",color:E.a.theme.hack},StrengthLevelMultiplier:{name:"Strength Level",color:E.a.theme.combat},DefenseLevelMultiplier:{name:"Defense Level",color:E.a.theme.combat},DexterityLevelMultiplier:{name:"Dexterity Level",color:E.a.theme.combat},AgilityLevelMultiplier:{name:"Agility Level",color:E.a.theme.combat},CharismaLevelMultiplier:{name:"Charisma Level",color:E.a.theme.cha}};return y.a.createElement(x,{sectionName:"Skills",rowData:e,mults:t})}function N({mults:t}){const e={HackExpGain:{name:"Hacking Exp",color:E.a.theme.hack},ServerGrowthRate:{name:"Server Growth Rate"},ServerMaxMoney:{name:"Server Max Money"},ServerStartingMoney:{name:"Server Starting Money"},ServerStartingSecurity:{name:"Server Starting Security"},ServerWeakenRate:{name:"Server Weaken Rate"},ManualHackMoney:{name:"Manual Hack Money",color:E.a.theme.money},ScriptHackMoney:{name:"Script Hack Money",color:E.a.theme.money},ScriptHackMoneyGain:{name:"Money Gained From Hack",color:E.a.theme.money}};return y.a.createElement(x,{sectionName:"Hacking",rowData:e,mults:t})}function P({mults:t}){const e={PurchasedServerCost:{name:"Base Cost",content:t.PurchasedServerCost.toFixed(3)},PurchasedServerSoftcap:{name:"Softcap Cost",content:t.PurchasedServerSoftcap.toFixed(3)},PurchasedServerLimit:{name:"Server Limit"},PurchasedServerMaxRam:{name:"Max RAM"},HomeComputerRamCost:{name:"Home RAM Cost"}};return y.a.createElement(x,{sectionName:"Purchased Servers",rowData:e,mults:t})}function I({mults:t}){const e={InfiltrationMoney:{name:"Infiltration Money",color:E.a.theme.money},InfiltrationRep:{name:"Infiltration Reputation",color:E.a.theme.rep}};return y.a.createElement(x,{sectionName:"Infiltration",rowData:e,mults:t})}function F({mults:t}){if(!v.b.Player().canAccessBladeburner())return y.a.createElement(y.a.Fragment,null);return y.a.createElement(x,{sectionName:"Bladeburner",rowData:{BladeburnerRank:{name:"Rank Gain"},BladeburnerSkillCost:{name:"Skill Cost"}},mults:t})}function D({mults:t}){if(!v.b.Player().canAccessCotMG())return y.a.createElement(y.a.Fragment,null);const e=t.StaneksGiftExtraSize.toFixed(3),n={StnakesGiftPowerMultiplier:{name:"Gift Power"},StaneksGiftExtraSize:{name:"Base Size Modifier",content:""+(t.StaneksGiftExtraSize>_.b.StaneksGiftExtraSize?"+"+e:e)}};return y.a.createElement(x,{sectionName:"Stanek's Gift",rowData:n,mults:t})}function j({mults:t}){const e=v.b.Player();if(2!==e.bitNodeN&&e.sourceFileLvl(2)<=0)return y.a.createElement(y.a.Fragment,null);const n={GangSoftcap:{name:"Gang Softcap",content:t.GangSoftcap.toFixed(3)},GangUniqueAugs:{name:"Unique Augmentations"}};return y.a.createElement(x,{sectionName:"Gang",rowData:n,mults:t})}function B({mults:t}){if(!v.b.Player().canAccessCorporation())return y.a.createElement(y.a.Fragment,null);const e={CorporationSoftcap:{name:"Corporation Softcap",content:t.CorporationSoftcap.toFixed(3)},CorporationValuation:{name:"Valuation"}};return y.a.createElement(x,{sectionName:"Corporation",rowData:e,mults:t})}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(0),r=n(121),i=n(30);function o(){return(o=Object.assign||function(t){for(var e=1;ea.createElement(i.a,o({},t,{classes:{root:s().root,...t.classes}}));function c(t){return a.createElement(l,{style:{backgroundColor:t.color},onMouseEnter:t.onMouseEnter,onClick:t.onClick})}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(50),r=n(149),i=n(0),o=n(648);function s(t){function e(e,n){if(t.ghostGrid[e][n]&&t.activeGrid[e][n])return"red";if(t.ghostGrid[e][n])return"white";if(t.activeGrid[e][n]){const a=t.gift.fragmentAt(e,n);if(!a)throw new Error("ActiveFragment should not be null");return function(t){let e=Math.pow((t.x+1)*(t.y+1),10),n=e,a=e;const r=[];for(let t=0;t<3;t++)e=171*e%30269,n=172*n%30307,a=170*a%30323,r.push((e/30269+n/30307+a/30323)%1);return`rgb(${256*r[0]}, ${256*r[1]}, ${256*r[2]})`}(a)}return""}const n=[];for(let r=0;rt.enter(n,r),onClick:()=>t.click(n,r),color:e(n,r)}));n.push(i.createElement(a.a,{key:r},s))}return i.createElement(r.a,null,n)}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(24);function r(t){if(null!=t.ramUsage&&t.ramUsage>0)return t.ramUsage;const e=Object(a.d)(t.server);if(null==e)return 0;for(let n=0;n"*"==t).length)return r.globError="Only a single glob is supported per command.\nexample: `nano my-dir/*.js`",r;[r.preGlob,r.postGlob]=t.split("*"),r.preGlob=Object(a.k)(r.preGlob);const i=Object(a.l)(n.cwd());return r.preGlob=`${i}/${r.preGlob}`,e.forEach(t=>{const e=t.filename.startsWith("/")?t.filename:"/"+t.filename;e.startsWith(r.preGlob)&&e.endsWith(r.postGlob)&&r.globMatches.push(e)}),r.glob=`${r.preGlob}*${r.postGlob}`,r}(""+t[0],e.getCurrentServer().scripts,n)}return null}function c(t,{terminal:e,router:n,player:a,args:c},f){if(c.length<1)return void e.error(`Incorrect usage of ${t} command. Usage: ${t} [scriptname]`);let u=c;try{const m=l(c,a,e);if(m){if(!1===Object(o.isEmpty)(m.globError))throw new Error(m.globError);u=m.globMatches}const h=u.map(n=>{const o=""+n;if(Object(r.a)(o)){const t=e.getFilepath(o),n=e.getScript(a,o),r=function(t){return t.endsWith(".ns")||t.endsWith(".js")}(o),l=null!==n?n.code:r?s:"";return l===s&&i.a.saveCursor(o,{row:3,column:5}),[t,l]}if(o.endsWith(".txt")){const t=e.getFilepath(o),n=e.getTextFile(a,o);return[t,null===n?"":n.text]}throw new Error("Invalid file. Only scripts (.script, .ns, .js), or text files (.txt) can be edited with "+t)});if(m&&0===h.length)throw new Error(`Could not find any valid files to open with ${t} using glob: \`${m.glob}\``);n.toScriptEditor(Object.fromEntries(h),f)}catch(t){e.error(""+t)}}},,,function(t,e,n){"use strict";function a(t){const e=t.toString(2).split(""),n=(a=e.length)<3||0==a?0==a?0:a+1:Math.ceil(Math.log2(2*a))<=Math.ceil(Math.log2(1+a+Math.ceil(Math.log2(a))))?Math.ceil(Math.log2(a)+1):Math.ceil(Math.log2(a));var a;const r=(t,e)=>t.reduce((t,n)=>n===e?t+1:t,0),i=["x","x",...e.splice(0,1)];for(let t=2;tt.reduce((t,n)=>n===e?t+1:t,0);let i=e.splice(0,1).join("");n.push(i==(r(e,"1")%2).toString());for(let t=0;t0&&0==n[0])e[o]="0"==e[o]?"1":"0";else if(0==n[0])i="0"==i?"1":"0";else if(1==n[0]&&n.some(t=>0==t))return 0;for(let t=a;t>=0;t--)e.splice(Math.pow(2,t),1);return e.splice(0,1),parseInt(e.join(""),2)}n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return r}))},,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(460),r=n(28);class i extends a.a{constructor(t=null){super(t)}getActionTypeSkillSuccessBonus(t){return t.skillMultipliers.successChanceContract}toJSON(){return Object(r.b)("Contract",this)}static fromJSON(t){return Object(r.a)(i,t.data)}}r.c.constructors.Contract=i},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={helpList:["Use 'help [command]' to get more information about a particular Bladeburner console command."," "," automate [var] [val] [hi/low] Configure simple automation for Bladeburner tasks"," clear/cls Clear the console"," help [cmd] Display this help text, or help text for a specific command"," log [en/dis] [type] Enable or disable logging for events and actions"," skill [action] [name] Level or display info about your Bladeburner skills"," start [type] [name] Start a Bladeburner action/task"," stop Stops your current Bladeburner action/task"," "],automate:["Usage: automate [var] [val] [hi/low]"," ","A simple way to automate your Bladeburner actions. This console command can be used to automatically start an action when your stamina rises above a certain threshold, and automatically switch to another action when your stamina drops below another threshold."," "," automate status - Check the current status of your automation and get a brief description of what it'll do"," automate en - Enable the automation feature"," automate dis - Disable the automation feature"," ","There are four properties that must be set for this automation to work properly. Here is how to set them:"," "," automate stamina 100 high"," automate contract Tracking high"," automate stamina 50 low"," automate general 'Field Analysis' low"," ","Using the four console commands above will set the automation to perform Tracking contracts if your stamina is 100 or higher, and then switch to Field Analysis if your stamina drops below 50. Note that when setting the action, the name of the action is CASE-SENSITIVE. It must exactly match whatever the name is in the UI."," "],clear:["Usage: clear"," ","Clears the console"," "],cls:["Usage: cls"," ","Clears the console"," "],help:["Usage: help [command]"," ","Running 'help' with no arguments displays the general help text, which lists all console commands and a brief description of what they do. A command can be specified to get more specific help text about that particular command. For example:"," "," help automate"," ","will display specific information about using the automate console command"," "],log:["Usage: log [en/dis] [type]"," ","Enable or disable logging. By default, the results of completing actions such as contracts/operations are logged in the console. There are also random events that are logged in the console as well. The five categories of things that get logged are:"," ","[general, contracts, ops, blackops, events]"," ","The logging for these categories can be enabled or disabled like so:"," "," log dis contracts - Disables logging that occurs when contracts are completed"," log en contracts - Enables logging that occurs when contracts are completed"," log dis events - Disables logging for Bladeburner random events"," ","Logging can be universally enabled/disabled using the 'all' keyword:"," "," log dis all"," log en all"," "],skill:["Usage: skill [action] [name]"," ","Level or display information about your skills."," ","To display information about all of your skills and your multipliers, use:"," "," skill list"," ","To display information about a specific skill, specify the name of the skill afterwards. Note that the name of the skill is case-sensitive. Enter it exactly as seen in the UI. If the name of the skill has whitespace, enclose the name of the skill in double quotation marks:"," "," skill list Reaper"," skill list 'Digital Observer'"," ","This console command can also be used to level up skills:"," "," skill level [skill name]"," "],start:["Usage: start [type] [name]"," ","Start an action. An action is specified by its type and its name. The name is case-sensitive. It must appear exactly as it does in the UI. If the name of the action has whitespace, enclose it in double quotation marks. Valid action types include:"," ","[general, contract, op, blackop]"," ","Examples:"," "," start contract Tracking"," start op 'Undercover Operation'"," "],stop:["Usage: stop"," ","Stop your current action and go idle."," "]}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return s}));var a=n(285),r=n(5);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={cost:0,text:""}){if(i(this,"children",[]),i(this,"cost",0),i(this,"researched",!1),i(this,"parent",null),i(this,"text",""),null==a.a[t.text])throw new Error("Invalid Research name used when constructing ResearchTree Node: "+t.text);this.text=t.text,this.cost=t.cost,t.children&&t.children.length>0&&(this.children=t.children),null!=t.parent&&(this.parent=t.parent)}addChild(t){this.children.push(t),t.parent=this}createTreantMarkup(){const t=[];for(let e=0;e${this.text}
${r.a.format(this.cost,"0,0")} Scientific Research`+n.desc+"",text:{name:this.text}}}findNode(t){if(this.text===t)return this;let e=null;for(let n=0;n0||this.sourceFileLvl(7)>0)}function i(){return null!=this.bladeburner&&this.bladeburner instanceof a.a}function o(){this.bladeburner=new a.a(this)}},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(424),r=n(268);function i(){return 3===this.bitNodeN||this.sourceFileLvl(3)>0}function o(){return null!=this.corporation&&this.corporation instanceof a.a}function s(t,e=0){if(this.corporation=new a.a({name:t}),3===this.sourceFileLvl(3)){const t=r.b[r.a.WarehouseAPI].index,e=r.b[r.a.OfficeAPI].index;this.corporation.unlockUpgrades[t]=1,this.corporation.unlockUpgrades[e]=1}this.corporation.totalShares+=e}},function(t,e,n){"use strict";n.d(e,"a",(function(){return $}));var a=n(22),r=n(119),i=n(12),o=n(152),s=n(210),l=n(347),c=n(67),f=n(424),u=n(10),m=n(26),h=n(101),d=n(105),p=n(90),g=n(25),y=n(638),b=n(244),E=n(56),v=n(44),k=n(343),_=n(199),w=n(2),S=n(109),x=n(24),C=n(6),L=n(170),O=n(103),M=n(84),T=n(326),A=n(20),R=n(222),N=n(128),P=n(339),I=n(267),F=n(1459),D=n(300),j=n(0),B=n.n(j),G=n(1460),W=n(1),H=n(8),U=n(94),q=n(34);const $={_lastUpdate:(new Date).getTime(),updateGame:function(t=1){const e=t*u.a._idleSpeed;null==w.a.totalPlaytime&&(w.a.totalPlaytime=0),null==w.a.playtimeSinceLastAug&&(w.a.playtimeSinceLastAug=0),null==w.a.playtimeSinceLastBitnode&&(w.a.playtimeSinceLastBitnode=0),w.a.totalPlaytime+=e,w.a.playtimeSinceLastAug+=e,w.a.playtimeSinceLastBitnode+=e,M.a.process(p.b,w.a,t),w.a.process(p.b,t),w.a.hasWseAccount&&Object(O.k)(t),w.a.inGang()&&null!==w.a.gang&&w.a.gang.process(t,w.a),h.c.process(w.a,t),w.a.corporation instanceof f.a&&w.a.corporation.storeCycles(t),w.a.bladeburner instanceof s.a&&w.a.bladeburner.storeCycles(t);for(let e=0;e{C.a.AutosaveInterval=60}},"Enable"));U.b.emit(t,U.d.WARNING,5e3)}(),$.Counters.autoSaveCounter=300):($.Counters.autoSaveCounter=5*C.a.AutosaveInterval,S.c.saveGame(!C.a.SuppressSavedGameToast))),$.Counters.checkFactionInvitations<=0){const t=w.a.checkForFactionInvitations();if(t.length>0){const e=t[Math.floor(Math.random()*t.length)];Object(d.c)(e)}$.Counters.checkFactionInvitations=100}if($.Counters.passiveFactionGrowth<=0){const t=Math.floor(5-$.Counters.passiveFactionGrowth);Object(d.e)(t),$.Counters.passiveFactionGrowth=5}if($.Counters.messages<=0&&(Object(k.b)(),w.a.hasAugmentation(i.a.TheRedPill)?$.Counters.messages=4500:$.Counters.messages=150),w.a.corporation instanceof f.a&&w.a.corporation.process(w.a),$.Counters.mechanicProcess<=0){if(w.a.bladeburner instanceof s.a)try{w.a.bladeburner.process(p.b,w.a)}catch(t){Object(I.a)("Exception caught in Bladeburner.process(): "+t)}$.Counters.mechanicProcess=5}$.Counters.contractGeneration<=0&&(Math.random()<=.25&&Object(l.b)(),$.Counters.contractGeneration=3e3),$.Counters.achievementsCounter<=0&&(Object(D.b)(),$.Counters.achievementsCounter=300)},load:function(t){if(Object(F.a)(),Object(G.a)(),Object(S.b)(t)){L.b.emit(),Object(o.d)(w.a),Object(r.e)(),w.a.reapplyAllSourceFiles(),w.a.hasWseAccount&&Object(O.h)(),w.a.applyEntropy(w.a.entropy),$._lastUpdate=(new Date).getTime();const t=w.a.lastUpdate,e=$._lastUpdate-t,n=Math.floor(e/u.a._idleSpeed);if(w.a.sourceFiles.length>0){let t=0;if(n<3e5)for(let e=0;eP.a.emit(B.a.createElement(B.a.Fragment,null,B.a.createElement(W.a,null,"Offline for ",k,". While you were offline:"),B.a.createElement("ul",null,B.a.createElement("li",null,B.a.createElement(W.a,null,"Your scripts generated ",B.a.createElement(A.a,{money:c}))),B.a.createElement("li",null,B.a.createElement(W.a,null,"Your Hacknet Nodes generated ",g)),B.a.createElement("li",null,B.a.createElement(W.a,null,"You gained ",B.a.createElement(N.a,{reputation:i})," reputation divided amongst your factions"))))),250)}else Object(o.d)(w.a),$.start(),w.a.init(),Object(x.f)(w.a.getHomeComputer()),Object(c.b)(),Object(m.c)(),Object(r.e)(),Object(v.e)();Object(y.b)()},start:function(){const t=(new Date).getTime();let e=t-$._lastUpdate;const n=e%u.a._idleSpeed;e=Math.floor(e/u.a._idleSpeed),e>0&&($._lastUpdate=t-n,w.a.lastUpdate=t-n,$.updateGame(e)),window.requestAnimationFrame($.start)}}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";n.r(e);var a=n(815);n.d(e,"Default",(function(){return a.a}));var r=n(816);n.d(e,"DefaultLite",(function(){return r.a}));var i=n(817);n.d(e,"Monokai",(function(){return i.a}));var o=n(818);n.d(e,"Warmer",(function(){return o.a}));var s=n(819);n.d(e,"DarkPlus",(function(){return s.a}));var l=n(820);n.d(e,"MayukaiDark",(function(){return l.a}));var c=n(821);n.d(e,"Purple",(function(){return c.a}));var f=n(822);n.d(e,"SmoothGreen",(function(){return f.a}));var u=n(823);n.d(e,"Dracula",(function(){return u.a}));var m=n(824);n.d(e,"DarkBlue",(function(){return m.a}));var h=n(825);n.d(e,"DiscordLike",(function(){return h.a}));var d=n(826);n.d(e,"OneDark",(function(){return d.a}));var p=n(827);n.d(e,"MutedGoldBlue",(function(){return p.a}));var g=n(828);n.d(e,"Light",(function(){return g.a}))},,,function(t,e,n){"use strict";n.d(e,"a",(function(){return k}));var a=n(0),r=n.n(a),i=n(1844),o=n(1),s=n(278),l=n(19),c=n(121),f=n(144),u=n(84),m=n(342),h=n(2),d=n(687),p=n(90),g=n(10),y=n(417),b=n(254),E=n(298);const v=Object(c.a)(t=>Object(f.a)({root:{backgroundColor:t.colors.backgroundprimary}}));function k(){const t=v(),[e,n]=Object(a.useState)(!1),[c,f]=Object(a.useState)(!1),k=`v${g.a.VersionString} (${Object(b.a)()})`;return document.title="Bitburner "+k,Object(a.useEffect)(()=>{const t=setTimeout(()=>{c||n(!0)},2e3);return()=>clearTimeout(t)}),Object(a.useEffect)(()=>{!async function(){await Object(m.b)().then(t=>{try{d.a.load(t)}catch(t){throw Object(y.a)(),f(!0),t}Object(E.c)(),f(!0)}).catch(t=>{console.error(t),d.a.load(""),f(!0)})}()},[]),r.a.createElement(l.a,{className:t.root},c?r.a.createElement(p.a,{terminal:u.a,engine:d.a,player:h.a}):r.a.createElement(s.a,{container:!0,direction:"column",justifyContent:"center",alignItems:"center",style:{minHeight:"100vh"}},r.a.createElement(s.a,{item:!0},r.a.createElement(i.a,{size:150,color:"primary"})),r.a.createElement(s.a,{item:!0},r.a.createElement(o.a,{variant:"h3"},"Loading Bitburner ",k)),e&&r.a.createElement(s.a,{item:!0},r.a.createElement(o.a,null,"If the game fails to load, consider ",r.a.createElement("a",{href:"?noScripts"},"killing all scripts")))))}},,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return o}));var a=n(35),r=n(1415);function i(t,e=!1){const n=t instanceof a.a?t.name:t;for(const t of this.augmentations)if(t.name===n)return!0;if(!e)for(const t of this.queuedAugmentations)if(t.name===n)return!0;return!1}function o(t=1){this.reapplyAllAugmentations(),this.reapplyAllSourceFiles();const e=Object(r.a)(this,t);for(const[t,n]of Object.entries(e))this.setMult(t,n)}},function(t,e,n){"use strict";function a(t){return"number"==typeof t&&!isNaN(t)}n.d(e,"a",(function(){return a}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var a=n(117),r=n(75),i=n(28);class o{constructor(t="",e=0,n=0,i=a.a.LimitBuy,o=r.a.Long){let s=!1;if("number"==typeof e&&"number"==typeof n||(s=!0),(isNaN(e)||isNaN(n))&&(s=!0),"string"!=typeof t&&(s=!0),s)throw new Error("Invalid constructor paramters for Order");this.stockSymbol=t,this.shares=e,this.price=n,this.type=i,this.pos=o}toJSON(){return Object(i.b)("Order",this)}static fromJSON(t){return Object(i.a)(o,t.data)}}i.c.constructors.Order=o},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var a=n(4),r=n(271),i=n(61),o=n(26),s=n(1042),l=n(601),c=n(28),f=n(10),u=n(665),m=n(18),h=n(2),d=n(12);function p(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class g{constructor(){p(this,"storedCycles",0),p(this,"fragments",[])}baseSize(){return u.a.BaseSize+m.a.StaneksGiftExtraSize+h.a.sourceFileLvl(13)}width(){return Math.max(2,Math.min(Math.floor(this.baseSize()/2+1),u.a.MaxSize))}height(){return Math.max(3,Math.min(Math.floor(this.baseSize()/2+.6),u.a.MaxSize))}charge(t,e,n){n>e.highestCharge?(e.numCharge=e.highestCharge*e.numCharge/n+1,e.highestCharge=n):e.numCharge+=n/e.highestCharge;const r=o.a[a.a.ChurchOfTheMachineGod];r.playerReputation+=t.faction_rep_mult*(Math.pow(n,.95)*(r.favor+100))/1e3}inBonus(){return this.storedCycles*f.a._idleSpeed/1e3>1}process(t,e=1){t.hasAugmentation(d.a.StaneksGift1)&&(this.storedCycles+=e,this.storedCycles-=10,this.storedCycles=Math.max(0,this.storedCycles),this.updateMults(t),l.a.emit())}effect(t){let e=t.neighboors().map(t=>this.fragmentAt(t[0],t[1])).filter(t=>!!t);e=e.filter(t=>t.fragment().type===i.b.Booster);let n=1;e=e.filter((t,e,n)=>n.indexOf(t)===e);for(const t of e)n*=t.fragment().power;return Object(s.a)(t.highestCharge,t.numCharge,t.fragment().power,n)}canPlace(t,e,n,a){if(t<0||e<0)return!1;if(t+a.width(n)>this.width())return!1;if(e+a.height(n)>this.height())return!1;if(this.count(a)>=a.limit)return!1;const i=new r.a({x:t,y:e,rotation:n,fragment:a});for(const t of this.fragments)if(t.collide(i))return!1;return!0}place(t,e,n,a){return!!this.canPlace(t,e,n,a)&&(this.fragments.push(new r.a({x:t,y:e,rotation:n,fragment:a})),!0)}findFragment(t,e){return this.fragments.find(n=>n.x===t&&n.y===e)}fragmentAt(t,e){for(const n of this.fragments)if(n.fullAt(t,e))return n}count(t){let e=0;for(const n of this.fragments)n.fragment().id===t.id&&e++;return e}delete(t,e){for(let n=0;n{t.highestCharge=0,t.numCharge=0})}updateMults(t){t.applyEntropy(t.entropy);for(const e of this.fragments){const n=e.fragment(),a=this.effect(e);switch(n.type){case i.b.HackingChance:t.hacking_chance_mult*=a;break;case i.b.HackingSpeed:t.hacking_speed_mult*=a;break;case i.b.HackingMoney:t.hacking_money_mult*=a;break;case i.b.HackingGrow:t.hacking_grow_mult*=a;break;case i.b.Hacking:t.hacking_mult*=a,t.hacking_exp_mult*=a;break;case i.b.Strength:t.strength_mult*=a,t.strength_exp_mult*=a;break;case i.b.Defense:t.defense_mult*=a,t.defense_exp_mult*=a;break;case i.b.Dexterity:t.dexterity_mult*=a,t.dexterity_exp_mult*=a;break;case i.b.Agility:t.agility_mult*=a,t.agility_exp_mult*=a;break;case i.b.Charisma:t.charisma_mult*=a,t.charisma_exp_mult*=a;break;case i.b.HacknetMoney:t.hacknet_node_money_mult*=a;break;case i.b.HacknetCost:t.hacknet_node_purchase_cost_mult/=a,t.hacknet_node_ram_cost_mult/=a,t.hacknet_node_core_cost_mult/=a,t.hacknet_node_level_cost_mult/=a;break;case i.b.Rep:t.company_rep_mult*=a,t.faction_rep_mult*=a;break;case i.b.WorkMoney:t.work_money_mult*=a;break;case i.b.Crime:t.crime_success_mult*=a,t.crime_money_mult*=a;break;case i.b.Bladeburner:t.bladeburner_max_stamina_mult*=a,t.bladeburner_stamina_gain_mult*=a,t.bladeburner_analysis_mult*=a,t.bladeburner_success_chance_mult*=a}}t.updateSkillLevels()}prestigeAugmentation(){this.clearCharge()}prestigeSourceFile(){this.clear(),this.storedCycles=0}toJSON(){return Object(c.b)("StaneksGift",this)}static fromJSON(t){return Object(c.a)(g,t.data)}}c.c.constructors.StaneksGift=g},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(9);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,"city",null),r(this,"costMult",0),r(this,"expMult",0),r(this,"name",a.a.Void),r(this,"types",[]),r(this,"techVendorMaxRam",0),r(this,"techVendorMinRam",0),t.city&&(this.city=t.city),t.costMult&&(this.costMult=t.costMult),t.expMult&&(this.expMult=t.expMult),t.infiltrationData&&(this.infiltrationData=t.infiltrationData),t.name&&(this.name=t.name),t.types&&(this.types=t.types),t.techVendorMaxRam&&(this.techVendorMaxRam=t.techVendorMaxRam),t.techVendorMinRam&&(this.techVendorMinRam=t.techVendorMinRam)}}},,,,,,,,,,,function(t,e,n){"use strict";n.d(e,"b",(function(){return E})),n.d(e,"a",(function(){return v}));var a=n(0),r=n.n(a),i=n(148),o=n(149),s=n(50),l=n(30),c=n(1),f=n(5),u=n(6),m=n(73),h=n(301),d=n(20),p=n(112),g=n(484),y=n(29),b=n(66);function E(t){const e=Object(h.b)();return r.a.createElement(i.a,{sx:{display:"table",mb:1,width:"100%"}},r.a.createElement(o.a,null,r.a.createElement(m.a,{name:"City",color:u.a.theme.primary,data:{content:t.sleeve.city}}),r.a.createElement(m.a,{name:"HP",color:u.a.theme.hp,data:{content:`${f.a.formatHp(t.sleeve.hp)} / ${f.a.formatHp(t.sleeve.max_hp)}`}}),r.a.createElement(m.a,{name:"Hacking",color:u.a.theme.hack,data:{level:t.sleeve.hacking,exp:t.sleeve.hacking_exp}}),r.a.createElement(m.a,{name:"Strength",color:u.a.theme.combat,data:{level:t.sleeve.strength,exp:t.sleeve.strength_exp}}),r.a.createElement(m.a,{name:"Defense",color:u.a.theme.combat,data:{level:t.sleeve.defense,exp:t.sleeve.defense_exp}}),r.a.createElement(m.a,{name:"Dexterity",color:u.a.theme.combat,data:{level:t.sleeve.dexterity,exp:t.sleeve.dexterity_exp}}),r.a.createElement(m.a,{name:"Agility",color:u.a.theme.combat,data:{level:t.sleeve.agility,exp:t.sleeve.agility_exp}}),r.a.createElement(m.a,{name:"Charisma",color:u.a.theme.cha,data:{level:t.sleeve.charisma,exp:t.sleeve.charisma_exp}}),r.a.createElement(s.a,null,r.a.createElement(l.a,{classes:{root:e.cellNone}},r.a.createElement("br",null))),r.a.createElement(m.a,{name:"Shock",color:u.a.theme.primary,data:{content:f.a.formatSleeveShock(100-t.sleeve.shock)}}),r.a.createElement(m.a,{name:"Sync",color:u.a.theme.primary,data:{content:f.a.formatSleeveSynchro(t.sleeve.sync)}}),r.a.createElement(m.a,{name:"Memory",color:u.a.theme.primary,data:{content:f.a.formatSleeveMemory(t.sleeve.memory)}})))}function v(t){const e=Object(h.b)(),n=y.b.Player();let a=[];if(t.sleeve.currentTask===b.a.Crime)a=[["Money",r.a.createElement(r.a.Fragment,null,r.a.createElement(d.a,{money:parseFloat(t.sleeve.currentTaskLocation)})," (on success)")],["Hacking Exp",f.a.formatExp(t.sleeve.gainRatesForTask.hack)+" (2x on success)"],["Strength Exp",f.a.formatExp(t.sleeve.gainRatesForTask.str)+" (2x on success)"],["Defense Exp",f.a.formatExp(t.sleeve.gainRatesForTask.def)+" (2x on success)"],["Dexterity Exp",f.a.formatExp(t.sleeve.gainRatesForTask.dex)+" (2x on success)"],["Agility Exp",f.a.formatExp(t.sleeve.gainRatesForTask.agi)+" (2x on success)"],["Charisma Exp",f.a.formatExp(t.sleeve.gainRatesForTask.cha)+" (2x on success)"]];else if(a=[["Money:",r.a.createElement(p.a,{money:5*t.sleeve.gainRatesForTask.money})],["Hacking Exp:",f.a.formatExp(5*t.sleeve.gainRatesForTask.hack)+" / sec"],["Strength Exp:",f.a.formatExp(5*t.sleeve.gainRatesForTask.str)+" / sec"],["Defense Exp:",f.a.formatExp(5*t.sleeve.gainRatesForTask.def)+" / sec"],["Dexterity Exp:",f.a.formatExp(5*t.sleeve.gainRatesForTask.dex)+" / sec"],["Agility Exp:",f.a.formatExp(5*t.sleeve.gainRatesForTask.agi)+" / sec"],["Charisma Exp:",f.a.formatExp(5*t.sleeve.gainRatesForTask.cha)+" / sec"]],t.sleeve.currentTask===b.a.Company||t.sleeve.currentTask===b.a.Faction){const e=t.sleeve.getRepGain(n);a.push(["Reputation:",r.a.createElement(g.a,{reputation:5*e})])}return r.a.createElement(i.a,{sx:{display:"table",mb:1,width:"100%",lineHeight:0}},r.a.createElement(o.a,null,r.a.createElement(s.a,null,r.a.createElement(l.a,{classes:{root:e.cellNone}},r.a.createElement(c.a,{variant:"h6"},"Earnings"))),a.map(([t,n])=>r.a.createElement(s.a,{key:t.toString()+n.toString()},r.a.createElement(l.a,{classes:{root:e.cellNone}},r.a.createElement(c.a,null,t)),r.a.createElement(l.a,{align:"right",classes:{root:e.cellNone}},r.a.createElement(c.a,null,n))))))}},function(t,e,n){"use strict";n.d(e,"b",(function(){return u})),n.d(e,"a",(function(){return m}));var a=n(0),r=n.n(a),i=n(24),o=n(46),s=n(92),l=n(130),c=n(74),f=n(8);const u={All:0,Foreign:1,Owned:2,Purchased:3};function m(t){function e(e){const n=e instanceof o.a&&e.purchasedByPlayer,a=t.serverType;switch(a){case u.All:return!0;case u.Foreign:return"home"!==e.hostname&&!n;case u.Owned:return n||e instanceof s.a||"home"===e.hostname;case u.Purchased:return n||e instanceof s.a;default:return console.warn("Invalid ServerType specified for ServerDropdown component: "+a),!1}}const n=[];for(const t of Object(i.c)().sort((t,e)=>t.hostname.localeCompare(e.hostname)))e(t)&&n.push(r.a.createElement(c.a,{key:t.hostname,value:t.hostname},t.hostname));return r.a.createElement(l.a,{startAdornment:r.a.createElement(f.a,{onClick:t.purchase,disabled:!t.canPurchase},"Buy"),sx:{mx:1},value:t.value,onChange:t.onChange},n)}},function(t,e,n){"use strict";n.d(e,"b",(function(){return g})),n.d(e,"a",(function(){return b}));var a=n(0),r=n(20),i=n(212),o=n(1325),s=n(551),l=n(1837),c=n(785),f=n(8),u=n(45),m=n(19),h=n(1),d=n(76);function p(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const g=5;var y;!function(t){t.Pending="",t.PlayerWon="You won!",t.PlayerWonByBlackjack="You Won! Blackjack!",t.DealerWon="You lost!",t.Tie="Push! (Tie)"}(y||(y={}));class b extends i.a{constructor(t){super(t),p(this,"canStartGame",()=>{const{p:t}=this.props,{bet:e}=this.state;return t.canAfford(e)}),p(this,"startGame",()=>{if(!this.canStartGame()||Object(i.b)(this.props.p))return;this.props.p.loseMoney(this.state.bet,"casino");const t=new s.a([this.deck.safeDrawCard(),this.deck.safeDrawCard()]),e=new s.a([this.deck.safeDrawCard(),this.deck.safeDrawCard()]);this.setState({playerHand:t,dealerHand:e,gameInProgress:!0,result:y.Pending}),21===this.getTrueHandValue(t)?21===this.getTrueHandValue(e)?this.finishGame(y.Tie):this.finishGame(y.PlayerWonByBlackjack):21===this.getTrueHandValue(e)&&this.finishGame(y.DealerWon)}),p(this,"getHandValue",t=>{let e=[0];for(let n=0;n=10?e.map(t=>t+10):1===a?e.flatMap(t=>[t+1,t+11]):e.map(t=>t+a)}return e}),p(this,"getTrueHandValue",t=>{const e=this.getHandValue(t),n=e.filter(t=>t<=21);return n.length>0?(n.sort((t,e)=>t-e),n[n.length-1]):e[0]}),p(this,"getHandDisplayValues",t=>{const e=this.getHandValue(t);return this.isHandBusted(t)?[...new Set([e[0]])]:[...new Set(e.filter(t=>t<=21))]}),p(this,"isHandBusted",t=>this.getTrueHandValue(t)>21),p(this,"playerHit",t=>{if(!t.isTrusted)return;const e=this.state.playerHand.addCards(this.deck.safeDrawCard());this.setState({playerHand:e}),this.isHandBusted(e)&&this.finishGame(y.DealerWon)}),p(this,"playerStay",t=>{if(!t.isTrusted)return;let e=this.state.dealerHand;for(;;){if(!(this.getTrueHandValue(e)<=16))break;e=e.addCards(this.deck.safeDrawCard())}if(this.setState({dealerHand:e}),this.isHandBusted(e))this.finishGame(y.PlayerWon);else{const t=this.getTrueHandValue(e),n=this.getTrueHandValue(this.state.playerHand);if(t>21||n>21)throw new Error("Someone busted when not expected to");n>t?this.finishGame(y.PlayerWon):n{const e=t===y.DealerWon?0:t===y.Tie?this.state.bet:t===y.PlayerWon?2*this.state.bet:t===y.PlayerWonByBlackjack?2.5*this.state.bet:(()=>{throw new Error("Unexpected result: "+t)})();this.win(this.props.p,e),this.setState({gameInProgress:!1,result:t,gains:this.state.gains+e-this.state.bet})}),p(this,"wagerOnChange",t=>{const{p:e}=this.props,n=t.target.value,a=Math.round(parseFloat(n));isNaN(a)?this.setState({bet:0,betInput:n,wagerInvalid:!0,wagerInvalidHelperText:"Not a valid number"}):a<=0?this.setState({bet:0,betInput:n,wagerInvalid:!0,wagerInvalidHelperText:"Must bet a postive amount"}):a>1e8?this.setState({bet:0,betInput:n,wagerInvalid:!0,wagerInvalidHelperText:"Exceeds max bet"}):e.canAfford(a)?this.setState({bet:a,betInput:n,wagerInvalid:!1,wagerInvalidHelperText:"",result:y.Pending}):this.setState({bet:0,betInput:n,wagerInvalid:!0,wagerInvalidHelperText:"Not enough money"})}),p(this,"startOnClick",t=>{t.isTrusted&&(this.state.wagerInvalid||this.startGame())}),this.deck=new o.a(g);this.state={playerHand:new s.a([]),dealerHand:new s.a([]),bet:1e6,betInput:String(1e6),gameInProgress:!1,result:y.Pending,gains:0,wagerInvalid:!1,wagerInvalidHelperText:""}}render(){const{betInput:t,playerHand:e,dealerHand:n,gameInProgress:i,result:o,wagerInvalid:s,wagerInvalidHelperText:p,gains:g}=this.state,b=this.getHandDisplayValues(e),E=this.getHandDisplayValues(n);return a.createElement(a.Fragment,null,a.createElement(m.a,null,a.createElement(d.a,{value:t,label:a.createElement(a.Fragment,null,"Wager (Max: ",a.createElement(r.a,{money:1e8}),")"),disabled:i,onChange:this.wagerOnChange,error:s,helperText:s?p:"",type:"number",style:{width:"200px"},InputProps:{startAdornment:a.createElement(l.a,{position:"start"},a.createElement(h.a,null,"$"))}}),a.createElement(h.a,null,"Total earnings this session: ",a.createElement(r.a,{money:g}))),i?a.createElement(a.Fragment,null,a.createElement(f.a,{onClick:this.playerHit},"Hit"),a.createElement(f.a,{color:"secondary",onClick:this.playerStay},"Stay")):a.createElement(f.a,{onClick:this.startOnClick,disabled:s||!this.canStartGame()},"Start"),(i||o!==y.Pending)&&a.createElement(a.Fragment,null,a.createElement(m.a,{display:"flex"},a.createElement(u.a,{elevation:2},a.createElement(h.a,null,"Player"),e.cards.map((t,e)=>a.createElement(c.a,{card:t,key:e})),a.createElement(h.a,null,"Count:"," ",b.map((t,e)=>a.createElement("span",{key:e},t)).reduce((t,e)=>[t," or ",e])))),a.createElement("br",null),a.createElement(m.a,{display:"flex"},a.createElement(u.a,{elevation:2},a.createElement(h.a,null,"Dealer"),n.cards.map((t,e)=>a.createElement(c.a,{card:t,hidden:i&&0!==e,key:e})),!i&&a.createElement(a.Fragment,null,a.createElement(h.a,null,"Count:"," ",E.map((t,e)=>a.createElement("span",{key:e},t)).reduce((t,e)=>[t," or ",e])))))),o!==y.Pending&&a.createElement(h.a,null,o," ",o===y.PlayerWon&&a.createElement(r.a,{money:this.state.bet}),o===y.PlayerWonByBlackjack&&a.createElement(r.a,{money:1.5*this.state.bet}),o===y.DealerWon&&a.createElement(r.a,{money:-this.state.bet})))}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(0),r=n.n(a),i=n(260),o=n(121),s=n(144),l=n(45);const c=Object(o.a)(()=>Object(s.a)({card:{padding:"10px",border:"solid 1px #808080",backgroundColor:"white",display:"inline-block",borderRadius:"10px",fontSize:"18.5px",textAlign:"center",margin:"3px",fontWeight:"bold"},red:{color:"red"},black:{color:"black"},value:{fontSize:"20px",fontFamily:"sans-serif"}})),f=({card:t,hidden:e})=>{const n=c();let a;switch(t.suit){case i.b.Clubs:a=r.a.createElement("span",null,"♣");break;case i.b.Diamonds:a=r.a.createElement("span",null,"♦");break;case i.b.Hearts:a=r.a.createElement("span",null,"♥");break;case i.b.Spades:a=r.a.createElement("span",null,"♠");break;default:throw new Error("MissingCaseException: "+t.suit)}return r.a.createElement(l.a,{className:`${n.card} ${t.isRedSuit()?n.red:n.black}`},r.a.createElement(r.a.Fragment,null,r.a.createElement("span",{className:n.value},e?" - ":t.formatValue()),r.a.createElement("span",null,e?" - ":a)))}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(26),r=n(24),i=n(4);function o(t,e){const n=e.augmentations.slice().filter(t=>"NeuroFlux Governor"!==t);for(const e of n)if(!t.augmentations.some(t=>t.name==e))return!1;return!0}const s=[{title:"Gain root access on CSEC",fulfilled:()=>{const t=Object(r.d)("CSEC");return!(!t||!t.hasOwnProperty("hasAdminRights"))&&t.hasAdminRights}},{title:"Install the backdoor on CSEC",fulfilled:()=>{const t=Object(r.d)("CSEC");return!(!t||!t.hasOwnProperty("backdoorInstalled"))&&t.backdoorInstalled}},{title:"Join the faction hinted at in csec-test.msg",fulfilled:t=>t.factions.includes(i.a.CyberSec)},{title:"Install all the Augmentations from "+i.a.CyberSec,fulfilled:t=>o(t,a.a[i.a.CyberSec])},{title:"Join the faction hinted at in nitesec-test.msg",fulfilled:t=>t.factions.includes(i.a.NiteSec)},{title:"Install all the Augmentations from "+i.a.NiteSec,fulfilled:t=>o(t,a.a[i.a.NiteSec])},{title:"Join the faction hinted at in j3.msg",fulfilled:t=>t.factions.includes(i.a.TheBlackHand)},{title:"Install all the Augmentations from "+i.a.TheBlackHand,fulfilled:t=>o(t,a.a[i.a.TheBlackHand])},{title:"Join the faction hinted at in 19dfj3l1nd.msg",fulfilled:t=>t.factions.includes(i.a.BitRunners)},{title:"Install all the Augmentations from "+i.a.BitRunners,fulfilled:t=>o(t,a.a[i.a.BitRunners])},{title:"Complete fl1ght.exe",fulfilled:t=>t.factions.includes(i.a.Daedalus)},{title:"Install the special Augmentation from "+i.a.Daedalus,fulfilled:t=>t.augmentations.some(t=>"The Red Pill"==t.name)},{title:"Install the final backdoor and free yourself.",fulfilled:()=>!1}]},,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var a=n(10),r=n(18),i=n(34);function o(t){const e=1e3/a.a._idleSpeed;let n=0,o=0,s=0,l=0,c=0,f=0,u=0;const m=t.hashManager;switch(t.className){case i.a.StudyComputerScience:o=a.a.ClassStudyComputerScienceBaseExp*t.workExpMult/e*m.getStudyMult();break;case i.a.DataStructures:n=a.a.ClassDataStructuresBaseCost*t.workCostMult/e,o=a.a.ClassDataStructuresBaseExp*t.workExpMult/e*m.getStudyMult();break;case i.a.Networks:n=a.a.ClassNetworksBaseCost*t.workCostMult/e,o=a.a.ClassNetworksBaseExp*t.workExpMult/e*m.getStudyMult();break;case i.a.Algorithms:n=a.a.ClassAlgorithmsBaseCost*t.workCostMult/e,o=a.a.ClassAlgorithmsBaseExp*t.workExpMult/e*m.getStudyMult();break;case i.a.Management:n=a.a.ClassManagementBaseCost*t.workCostMult/e,u=a.a.ClassManagementBaseExp*t.workExpMult/e*m.getStudyMult();break;case i.a.Leadership:n=a.a.ClassLeadershipBaseCost*t.workCostMult/e,u=a.a.ClassLeadershipBaseExp*t.workExpMult/e*m.getStudyMult();break;case i.a.GymStrength:n=a.a.ClassGymBaseCost*t.workCostMult/e,s=t.workExpMult/e*m.getTrainingMult();break;case i.a.GymDefense:n=a.a.ClassGymBaseCost*t.workCostMult/e,l=t.workExpMult/e*m.getTrainingMult();break;case i.a.GymDexterity:n=a.a.ClassGymBaseCost*t.workCostMult/e,c=t.workExpMult/e*m.getTrainingMult();break;case i.a.GymAgility:n=a.a.ClassGymBaseCost*t.workCostMult/e,f=t.workExpMult/e*m.getTrainingMult();break;default:throw new Error("ERR: Invalid/unrecognized class name")}return{workMoneyLossRate:n,workHackExpGainRate:o*t.hacking_exp_mult*r.a.ClassGymExpGain,workStrExpGainRate:s*t.strength_exp_mult*r.a.ClassGymExpGain,workDefExpGainRate:l*t.defense_exp_mult*r.a.ClassGymExpGain,workDexExpGainRate:c*t.dexterity_exp_mult*r.a.ClassGymExpGain,workAgiExpGainRate:f*t.agility_exp_mult*r.a.ClassGymExpGain,workChaExpGainRate:u*t.charisma_exp_mult*r.a.ClassGymExpGain}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(99);const r={longestName:0,longestSymbol:0};for(const t of Object.keys(a.a))r.longestName=Math.max(t.length,r.longestName),r.longestSymbol=Math.max(a.a[t].length,r.longestSymbol)},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(0),r=n.n(a),i=n(19),o=n(1),s=n(6),l=n(1396);function c({achievement:t,unlockedOn:e,cssFiltersUnlocked:n,cssFiltersLocked:a}){if(!t)return r.a.createElement(r.a.Fragment,null);const c=!!e,f=c?s.a.theme.primary:s.a.theme.secondarylight;let u="";return e&&(u=new Date(e).toLocaleString()),r.a.createElement(i.a,{sx:{border:"1px solid "+s.a.theme.well,mb:2}},r.a.createElement(i.a,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap"}},r.a.createElement(l.a,{achievement:t,unlocked:c,size:"72px",colorFilters:c?n:a}),r.a.createElement(i.a,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",px:1}},r.a.createElement(o.a,{variant:"h6",sx:{color:f}},t.Name),r.a.createElement(o.a,{variant:"body2",sx:{maxWidth:"500px",color:f}},t.Description),c&&r.a.createElement(o.a,{variant:"caption",sx:{fontSize:"12px",color:s.a.theme.primarydark}},"Acquired on ",u))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));class a{constructor(t,e,n){this.set(t,e,n)}toString(){return`rgb(${Math.round(this.r)}, ${Math.round(this.g)}, ${Math.round(this.b)})`}set(t,e,n){this.r=this.clamp(t),this.g=this.clamp(e),this.b=this.clamp(n)}hueRotate(t=0){t=t/180*Math.PI;const e=Math.sin(t),n=Math.cos(t);this.multiply([.213+.787*n-.213*e,.715-.715*n-.715*e,.072-.072*n+.928*e,.213-.213*n+.143*e,.715+.285*n+.14*e,.072-.072*n-.283*e,.213-.213*n-.787*e,.715-.715*n+.715*e,.072+.928*n+.072*e])}grayscale(t=1){this.multiply([.2126+.7874*(1-t),.7152-.7152*(1-t),.0722-.0722*(1-t),.2126-.2126*(1-t),.7152+.2848*(1-t),.0722-.0722*(1-t),.2126-.2126*(1-t),.7152-.7152*(1-t),.0722+.9278*(1-t)])}sepia(t=1){this.multiply([.393+.607*(1-t),.769-.769*(1-t),.189-.189*(1-t),.349-.349*(1-t),.686+.314*(1-t),.168-.168*(1-t),.272-.272*(1-t),.534-.534*(1-t),.131+.869*(1-t)])}saturate(t=1){this.multiply([.213+.787*t,.715-.715*t,.072-.072*t,.213-.213*t,.715+.285*t,.072-.072*t,.213-.213*t,.715-.715*t,.072+.928*t])}multiply(t){const e=this.clamp(this.r*t[0]+this.g*t[1]+this.b*t[2]),n=this.clamp(this.r*t[3]+this.g*t[4]+this.b*t[5]),a=this.clamp(this.r*t[6]+this.g*t[7]+this.b*t[8]);this.r=e,this.g=n,this.b=a}brightness(t=1){this.linear(t)}contrast(t=1){this.linear(t,-.5*t+.5)}linear(t=1,e=0){this.r=this.clamp(this.r*t+255*e),this.g=this.clamp(this.g*t+255*e),this.b=this.clamp(this.b*t+255*e)}invert(t=1){this.r=this.clamp(255*(t+this.r/255*(1-2*t))),this.g=this.clamp(255*(t+this.g/255*(1-2*t))),this.b=this.clamp(255*(t+this.b/255*(1-2*t)))}hsl(){const t=this.r/255,e=this.g/255,n=this.b/255,a=Math.max(t,e,n),r=Math.min(t,e,n);let i,o,s=(a+r)/2;if(a===r)i=o=0;else{const l=a-r;switch(o=s>.5?l/(2-a-r):l/(a+r),a){case t:i=(e-n)/l+(e255?t=255:t<0&&(t=0),t}}class r{constructor(t){this.target=t,this.targetHSL=t.hsl(),this.reusedColor=new a(0,0,0)}solve(){const t=this.solveNarrow(this.solveWide());return{values:t.values,loss:t.loss,filter:this.css(t.values)}}solveWide(){const t=[60,180,18e3,600,1.2,1.2];let e={loss:1/0};for(let n=0;e.loss>25&&n<3;n++){const n=[50,20,3750,50,100,100],a=this.spsa(5,t,15,n,1e3);a.loss.5?1:-1,l[t]=a[t]+r*s[t],c[t]=a[t]-r*s[t];const m=this.loss(l)-this.loss(c);for(let n=0;n<6;n++){const i=m/(2*r)*s[n],o=e[n]/Math.pow(t+u+1,1);a[n]=f(a[n]-o*i,n)}const h=this.loss(a);hn?t%=n:t<0&&(t=n+t%n):t<0?t=0:t>n&&(t=n),t}}loss(t){const e=this.reusedColor;e.set(0,0,0),e.invert(t[0]/100),e.sepia(t[1]/100),e.saturate(t[2]/100),e.hueRotate(3.6*t[3]),e.brightness(t[4]/100),e.contrast(t[5]/100);const n=e.hsl();return Math.abs(e.r-this.target.r)+Math.abs(e.g-this.target.g)+Math.abs(e.b-this.target.b)+Math.abs(n.h-this.targetHSL.h)+Math.abs(n.s-this.targetHSL.s)+Math.abs(n.l-this.targetHSL.l)}css(t){function e(e,n=1){return Math.round(t[e]*n)}return`invert(${e(0)}%) sepia(${e(1)}%) saturate(${e(2)}%) hue-rotate(${e(3,3.6)}deg) brightness(${e(4)}%) contrast(${e(5)}%)`}}function i(t){const e=function(t){t=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(t,e,n,a)=>e+e+n+n+a+a);const e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]:null}(t);if(!e)return"";const[n,i,o]=e,s=new a(n,i,o);return new r(s).solve().filter}},,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={name:"Default",description:"Default game theme, most supported",credit:"hydroflame",screenshot:n(921).a,colors:{primarylight:"#0f0",primary:"#0c0",primarydark:"#090",successlight:"#0f0",success:"#0c0",successdark:"#090",errorlight:"#f00",error:"#c00",errordark:"#900",secondarylight:"#AAA",secondary:"#888",secondarydark:"#666",warninglight:"#ff0",warning:"#cc0",warningdark:"#990",infolight:"#69f",info:"#36c",infodark:"#039",welllight:"#444",well:"#222",white:"#fff",black:"#000",hp:"#dd3434",money:"#ffd700",hack:"#adff2f",combat:"#faffdf",cha:"#a671d1",int:"#6495ed",rep:"#faffdf",disabled:"#66cfbc",backgroundprimary:"#000",backgroundsecondary:"#000",button:"#333"}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={name:"Default-lite",description:"Less eye-straining default theme",credit:"NmuGmu",reference:"https://discord.com/channels/415207508303544321/921991895230611466/925263801564151888",screenshot:n(922).a,colors:{primarylight:"#28CF28",primary:"#21A821",primarydark:"#177317",successlight:"#1CFF1C",success:"#16CA16",successdark:"#0D910D",errorlight:"#FF3B3B",error:"#C32D2D",errordark:"#8E2121",secondarylight:"#B3B3B3",secondary:"#838383",secondarydark:"#676767",warninglight:"#FFFF3A",warning:"#C3C32A",warningdark:"#8C8C1E",infolight:"#64CBFF",info:"#3399CC",infodark:"#246D91",welllight:"#404040",well:"#1C1C1C",white:"#C3C3C3",black:"#0A0B0B",hp:"#C62E2E",money:"#D6BB27",hack:"#ADFF2F",combat:"#E8EDCD",cha:"#8B5FAF",int:"#537CC8",rep:"#E8EDCD",disabled:"#5AB5A5",backgroundprimary:"#0C0D0E",backgroundsecondary:"#121415",button:"#252829"}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={name:"Monokai'ish",description:"Monokai'ish",credit:"eltea",screenshot:n(923).a,colors:{primarylight:"#FFF",primary:"#F8F8F2",primarydark:"#FAFAEB",successlight:"#ADE146",success:"#A6E22E",successdark:"#98E104",errorlight:"#FF69A0",error:"#F92672",errordark:"#D10F56",secondarylight:"#AAA",secondary:"#888",secondarydark:"#666",warninglight:"#E1D992",warning:"#E6DB74",warningdark:"#EDDD54",infolight:"#92E1F1",info:"#66D9EF",infodark:"#31CDED",welllight:"#444",well:"#222",white:"#fff",black:"#000",hp:"#F92672",money:"#E6DB74",hack:"#A6E22E",combat:"#75715E",cha:"#AE81FF",int:"#66D9EF",rep:"#E69F66",disabled:"#66cfbc",backgroundprimary:"#272822",backgroundsecondary:"#1B1C18",button:"#333"}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={name:"Warmer",credit:"hexnaught",description:"Warmer, softer theme",reference:"https://discord.com/channels/415207508303544321/921991895230611466/921999581020028938",screenshot:n(924).a,colors:{primarylight:"#EA9062",primary:"#DD7B4A",primarydark:"#D3591C",successlight:"#6ACF6A",success:"#43BF43",successdark:"#3E913E",errorlight:"#C15757",error:"#B34141",errordark:"#752525",secondarylight:"#AAA",secondary:"#888",secondarydark:"#666",warninglight:"#E6E69D",warning:"#DADA56",warningdark:"#A1A106",infolight:"#69f",info:"#36c",infodark:"#039",welllight:"#444",well:"#222",white:"#fff",black:"#000",hp:"#dd3434",money:"#ffd700",hack:"#adff2f",combat:"#faffdf",cha:"#AD84CF",int:"#6495ed",rep:"#faffdf",disabled:"#76C6B7",backgroundprimary:"#000",backgroundsecondary:"#000",button:"#333"}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={name:"Dark+",credit:"LoganMD",description:"VSCode Dark+",reference:"https://discord.com/channels/415207508303544321/921991895230611466/921999975867617310",screenshot:n(925).a,colors:{primarylight:"#E0E0BC",primary:"#CCCCAE",primarydark:"#B8B89C",successlight:"#00F000",success:"#00D200",successdark:"#00B400",errorlight:"#F00000",error:"#C80000",errordark:"#A00000",secondarylight:"#B4AEAE",secondary:"#969090",secondarydark:"#787272",warninglight:"#F0F000",warning:"#C8C800",warningdark:"#A0A000",infolight:"#69f",info:"#36c",infodark:"#039",welllight:"#444",well:"#222",white:"#fff",black:"#1E1E1E",hp:"#dd3434",money:"#ffd700",hack:"#adff2f",combat:"#faffdf",cha:"#a671d1",int:"#6495ed",rep:"#faffdf",disabled:"#66cfbc",backgroundprimary:"#1E1E1E",backgroundsecondary:"#252525",button:"#333"}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={name:"Mayukai Dark",description:"Mayukai Dark-esque",credit:"Festive Noire",reference:"https://discord.com/channels/415207508303544321/921991895230611466/922037502334889994",screenshot:n(926).a,colors:{primarylight:"#DDDFC5",primary:"#CDCFB6",primarydark:"#9D9F8C",successlight:"#00EF00",success:"#00A500",successdark:"#007A00",errorlight:"#F92672",error:"#CA1C5C",errordark:"#90274A",secondarylight:"#AAA",secondary:"#888",secondarydark:"#666",warninglight:"#D3D300",warning:"#cc0",warningdark:"#990",infolight:"#69f",info:"#36c",infodark:"#039",welllight:"#444",well:"#00010A",white:"#fff",black:"#020509",hp:"#dd3434",money:"#ffd700",hack:"#8CCF27",combat:"#faffdf",cha:"#a671d1",int:"#6495ed",rep:"#faffdf",disabled:"#66cfbc",backgroundprimary:"#080C11",backgroundsecondary:"#03080F",button:"#00010A"}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={name:"Purple",credit:"zer0ney",description:"Essentially all defaults except for purple replacing the main colors",reference:"https://discord.com/channels/415207508303544321/921991895230611466/922091815849570395",screenshot:n(927).a,colors:{primarylight:"#BA55D3",primary:"#9370DB",primarydark:"#8A2BE2",successlight:"#BA55D3",success:"#9370DB",successdark:"#8A2BE2",errorlight:"#f00",error:"#c00",errordark:"#900",secondarylight:"#AAA",secondary:"#888",secondarydark:"#666",warninglight:"#ff0",warning:"#cc0",warningdark:"#990",infolight:"#69f",info:"#36c",infodark:"#039",welllight:"#444",well:"#222",white:"#fff",black:"#000",hp:"#dd3434",money:"#ffd700",hack:"#adff2f",combat:"#faffdf",cha:"#a671d1",int:"#6495ed",rep:"#faffdf",disabled:"#66cfbc",backgroundprimary:"#000",backgroundsecondary:"#000",button:"#333"}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={name:"Smooth Green",description:"A nice green theme that doesn't hurt your eyes.",credit:"Swidt",reference:"https://discord.com/channels/415207508303544321/921991895230611466/922243957986033725",screenshot:n(928).a,colors:{primarylight:"#E0E0BC",primary:"#B0D9A3",primarydark:"#B8B89C",successlight:"#00F000",success:"#6BC16B",successdark:"#00B400",errorlight:"#F00000",error:"#3D713D",errordark:"#A00000",secondarylight:"#B4AEAE",secondary:"#8FAF85",secondarydark:"#787272",warninglight:"#F0F000",warning:"#38F100",warningdark:"#A0A000",infolight:"#69f",info:"#36c",infodark:"#039",welllight:"#444",well:"#2F3C2B",white:"#fff",black:"#1E1E1E",hp:"#dd3434",money:"#4AA52E",hack:"#adff2f",combat:"#faffdf",cha:"#a671d1",int:"#6495ed",rep:"#35A135",disabled:"#66cfbc",backgroundprimary:"#1E1E1E",backgroundsecondary:"#252525",button:"#2F3C2B"}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={name:"Dracula",description:"Dracula Look-alike",credit:"H3draut3r",reference:"https://discord.com/channels/415207508303544321/921991895230611466/922296307836678144",screenshot:n(929).a,colors:{primarylight:"#7082B8",primary:"#F8F8F2",primarydark:"#FF79C6",successlight:"#0f0",success:"#0c0",successdark:"#090",errorlight:"#FD4545",error:"#FF2D2D",errordark:"#C62424",secondarylight:"#AAA",secondary:"#8BE9FD",secondarydark:"#666",warninglight:"#FFC281",warning:"#FFB86C",warningdark:"#E6A055",infolight:"#A0A0FF",info:"#7070FF",infodark:"#4040FF",welllight:"#44475A",well:"#363948",white:"#fff",black:"#282A36",hp:"#D34448",money:"#50FA7B",hack:"#F1FA8C",combat:"#BD93F9",cha:"#FF79C6",int:"#6495ed",rep:"#faffdf",disabled:"#66cfbc",backgroundprimary:"#282A36",backgroundsecondary:"#21222C",button:"#21222C"}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={name:"Dark Blue",description:"Very dark with a blue/purplelly primary",credit:"Saynt_Garmo",reference:"https://discord.com/channels/415207508303544321/921991895230611466/923084732718264340",screenshot:n(930).a,colors:{primarylight:"#023DDE",primary:"#4A41C8",primarydark:"#005299",successlight:"#00FF00",success:"#D1DAD1",successdark:"#BFCABF",errorlight:"#f00",error:"#c00",errordark:"#900",secondarylight:"#AAA",secondary:"#888",secondarydark:"#666",warninglight:"#ff0",warning:"#cc0",warningdark:"#990",infolight:"#69f",info:"#36c",infodark:"#039",welllight:"#444",well:"#040505",white:"#fff",black:"#000000",hp:"#dd3434",money:"#ffd700",hack:"#adff2f",combat:"#faffdf",cha:"#a671d1",int:"#6495ed",rep:"#faffdf",disabled:"#66cfbc",backgroundprimary:"#091419",backgroundsecondary:"#000000",button:"#000000"}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={name:"Discord-like",description:"Discord inspired theme",credit:"Thermite",reference:"https://discord.com/channels/415207508303544321/921991895230611466/924305252017143818",screenshot:n(931).a,colors:{primarylight:"#7389DC",primary:"#7389DC",primarydark:"#5964F1",successlight:"#00CC00",success:"#20DF20",successdark:"#0CB80C",errorlight:"#EA5558",error:"#EC4145",errordark:"#E82528",secondarylight:"#C3C3C3",secondary:"#9C9C9C",secondarydark:"#4E4E4E",warninglight:"#ff0",warning:"#cc0",warningdark:"#990",infolight:"#69f",info:"#36c",infodark:"#1C4FB3",welllight:"#999999",well:"#35383C",white:"#FFFFFF",black:"#202225",hp:"#FF5656",money:"#43FF43",hack:"#FFAB3D",combat:"#8A90FD",cha:"#FF51D9",int:"#6495ed",rep:"#FFFF30",disabled:"#474B51",backgroundprimary:"#2F3136",backgroundsecondary:"#35393E",button:"#333"}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={name:"One Dark",description:"Dark with a greenish tint",credit:"Dexalt142",reference:"https://discord.com/channels/415207508303544321/921991895230611466/924650660694208512",screenshot:n(932).a,colors:{primarylight:"#98C379",primary:"#98C379",primarydark:"#98C379",successlight:"#98C379",success:"#98C379",successdark:"#98C379",errorlight:"#E06C75",error:"#BE5046",errordark:"#BE5046",secondarylight:"#AAA",secondary:"#888",secondarydark:"#666",warninglight:"#E5C07B",warning:"#E5C07B",warningdark:"#D19A66",infolight:"#61AFEF",info:"#61AFEF",infodark:"#61AFEF",welllight:"#4B5263",well:"#282C34",white:"#ABB2BF",black:"#282C34",hp:"#E06C75",money:"#E5C07B",hack:"#98C379",combat:"#ABB2BF",cha:"#C678DD",int:"#61AFEF",rep:"#ABB2BF",disabled:"#56B6C2",backgroundprimary:"#282C34",backgroundsecondary:"#21252B",button:"#4B5263"}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={name:"Muted Gold & Blue",description:"Muted gold with blue accents.",credit:"Sloth",reference:"https://discord.com/channels/415207508303544321/921991895230611466/924672660758208563",screenshot:n(933).a,colors:{primarylight:"#E3B54A",primary:"#CAA243",primarydark:"#7E6937",successlight:"#82FF82",success:"#6FDA6F",successdark:"#64C364",errorlight:"#FD5555",error:"#D84A4A",errordark:"#AC3939",secondarylight:"#D8D0B8",secondary:"#B1AA95",secondarydark:"#736E5E",warninglight:"#ff0",warning:"#cc0",warningdark:"#990",infolight:"#69f",info:"#36c",infodark:"#039",welllight:"#444",well:"#111111",white:"#fff",black:"#070300",hp:"#dd3434",money:"#ffd700",hack:"#adff2f",combat:"#faffdf",cha:"#a671d1",int:"#6495ed",rep:"#faffdf",disabled:"#66cfbc",backgroundprimary:"#0A0A0E",backgroundsecondary:"#0E0E10",button:"#222222"}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={name:"Light",description:"Cobbled Together Light Theme",credit:"matt",reference:"https://discord.com/channels/415207508303544321/921991895230611466/926114005456658432",screenshot:n(934).a,colors:{primarylight:"#535353",primary:"#1A1A1A",primarydark:"#0d0d0d",successlight:"#63c439",success:"#428226",successdark:"#2E5A1B",errorlight:"#df7051",error:"#C94824",errordark:"#91341B",secondarylight:"#b3b3b3",secondary:"#9B9B9B",secondarydark:"#7A7979",warninglight:"#e8d464",warning:"#C6AD20",warningdark:"#9F8A16",infolight:"#6299cf",info:"#3778B7",infodark:"#30689C",welllight:"#f9f9f9",well:"#eaeaea",white:"#F7F7F7",black:"#F7F7F7",hp:"#BF5C41",money:"#E1B121",hack:"#47BC38",combat:"#656262",cha:"#A568AC",int:"#889BCF",rep:"#656262",disabled:"#70B4BF",backgroundprimary:"#F7F7F7",backgroundsecondary:"#f9f9f9",button:"#eaeaea"}}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";e.a="dist/images/83b2443ab7e7d346766c8f6bc5afc7a7.png"},function(t,e,n){"use strict";e.a="dist/images/6caf35202b10b52e1fc2743f674c33e8.png"},function(t,e,n){"use strict";e.a="dist/images/cb88977ea837bccb9cceb727adc78302.png"},function(t,e,n){"use strict";e.a="dist/images/4e0e750f2f09de58219773edd46cbbf5.png"},function(t,e,n){"use strict";e.a="dist/images/e97de4daa946331c7e99dee9c05d629c.png"},function(t,e,n){"use strict";e.a="dist/images/9f96a5084f4e5f1a6c0041b41b34d62d.png"},function(t,e,n){"use strict";e.a="dist/images/85a7b2896acb62be76f3ea7100fe9012.png"},function(t,e,n){"use strict";e.a="dist/images/5aa87b7de67a77c914088783b055e1cf.png"},function(t,e,n){"use strict";e.a="dist/images/c7164b072d62c91c27c6d607b5207e7b.png"},function(t,e,n){"use strict";e.a="dist/images/66f4b86d86164fc117bd6d648e4eaa6f.png"},function(t,e,n){"use strict";e.a="dist/images/a1110d6c8d16a14c4570411750248399.png"},function(t,e,n){"use strict";e.a="dist/images/447bc31e61f55e7eff875be3e9a81f1a.png"},function(t,e,n){"use strict";e.a="dist/images/297df8c0e47764ea113951318b2acf55.png"},function(t,e,n){"use strict";e.a="dist/images/e66b0c327f97d08e4253f52234d659eb.png"},,,,,,,,,,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return ut}));var a=n(246),r=n(92),i=n(46),o=n(65),s=n(116),l=n(328),c=n(100),f=n(10),u=n(24),m=n(83),h=n(480),d=n(44),p=n(137),g=n(485),y=n(88),b=n(6),E=n(253),v=n(102),k=n(5),_=n(22),w=n(1418),S=n(1419),x=n(1420),C=n(1421),L=n(1422),O=n(1423),M=n(1424),T=n(1425),A=n(1426),R=n(603),N=n(1427),P=n(1428),I=n(1429),F=n(1430),D=n(1431),j=n(1432),B=n(1433),G=n(1434),W=n(1435),H=n(1436),U=n(1437),q=n(1438),$=n(1439),K=n(1440),z=n(1441),V=n(1443),Y=n(1444),J=n(1445),X=n(1448),Q=n(1449),Z=n(1450),tt=n(1451),et=n(1452),nt=n(1453),at=n(1454),rt=n(1455),it=n(1456),ot=n(1457),st=n(254),lt=n(1458),ct=n(18);function ft(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class ut{constructor(){ft(this,"action",null),ft(this,"commandHistory",[]),ft(this,"commandHistoryIndex",0),ft(this,"outputHistory",[new a.b(`Bitburner v${f.a.VersionString} (${Object(st.a)()})`,"primary")]),ft(this,"contractOpen",!1),ft(this,"currDir","/")}process(t,e,n){null!==this.action&&(this.action.timeLeft-=f.a._idleSpeed*n/1e3,this.action.timeLeft<.01&&this.finishAction(t,e,!1),l.b.emit())}append(t){this.outputHistory.push(t),this.outputHistory.length>b.a.MaxTerminalCapacity&&this.outputHistory.splice(0,this.outputHistory.length-b.a.MaxTerminalCapacity),l.b.emit()}print(t){this.append(new a.b(t,"primary"))}printRaw(t){this.append(new a.c(t))}error(t){this.append(new a.b(t,"error"))}success(t){this.append(new a.b(t,"success"))}info(t){this.append(new a.b(t,"info"))}warn(t){this.append(new a.b(t,"warn"))}startHack(t){const e=t.getCurrentServer();if(e instanceof r.a)this.error("Cannot hack this kind of server");else{if(!(e instanceof i.a))throw new Error("server should be normal server");this.startAction(Object(v.d)(e,t)/4,"h",e)}}startGrow(t){const e=t.getCurrentServer();if(e instanceof r.a)this.error("Cannot grow this kind of server");else{if(!(e instanceof i.a))throw new Error("server should be normal server");this.startAction(Object(v.a)(e,t)/16,"g",e)}}startWeaken(t){const e=t.getCurrentServer();if(e instanceof r.a)this.error("Cannot weaken this kind of server");else{if(!(e instanceof i.a))throw new Error("server should be normal server");this.startAction(Object(v.f)(e,t)/16,"w",e)}}startBackdoor(t){const e=t.getCurrentServer();if(e instanceof r.a)this.error("Cannot backdoor this kind of server");else{if(!(e instanceof i.a))throw new Error("server should be normal server");this.startAction(Object(v.d)(e,t)/4,"b",e)}}startAnalyze(t){this.print("Analyzing system...");const e=t.getCurrentServer();this.startAction(1,"a",e)}startAction(t,e,n){this.action=new a.d(t,e,n)}finishHack(t,e,n,a=!1){if(a)return;if(n instanceof r.a)return void this.error("Cannot hack this kind of server");if(!(n instanceof i.a))throw new Error("server should be normal server");const o=Object(v.b)(n,e),s=Math.random(),l=Object(v.c)(n,e),c=l/4;if(s0;if(this.print("Can run scripts on this host: "+(s?"YES":"NO")),this.print("RAM: "+k.a.formatRAM(e.maxRam)),e instanceof i.a){this.print("Backdoor: "+(e.backdoorInstalled?"YES":"NO"));const a=e.requiredHackingSkill;this.print("Required hacking skill for hack() and backdoor: "+(n?"N/A":a));const r=e.hackDifficulty;this.print("Server security level: "+(n?"N/A":k.a.formatServerSecurity(r)));const i=Object(v.b)(e,t);this.print("Chance to hack: "+(n?"N/A":k.a.formatPercentage(i)));const o=1e3*Object(v.d)(e,t);this.print("Time to hack: "+(n?"N/A":Object(_.d)(o,!0)))}if(this.print("Total money available on server: "+(e instanceof i.a?k.a.formatMoney(e.moneyAvailable):"N/A")),e instanceof i.a){const t=e.numOpenPortsRequired;this.print("Required number of open ports for NUKE: "+(n?"N/A":t)),this.print("SSH port: "+(e.sshPortOpen?"Open":"Closed")),this.print("FTP port: "+(e.ftpPortOpen?"Open":"Closed")),this.print("SMTP port: "+(e.smtpPortOpen?"Open":"Closed")),this.print("HTTP port: "+(e.httpPortOpen?"Open":"Closed")),this.print("SQL port: "+(e.sqlPortOpen?"Open":"Closed"))}}}finishAction(t,e,n=!1){if(null!==this.action){if(!this.action.server)throw new Error("Missing action target server");this.print(this.getProgressText()),"h"===this.action.action?this.finishHack(t,e,this.action.server,n):"g"===this.action.action?this.finishGrow(e,this.action.server,n):"w"===this.action.action?this.finishWeaken(e,this.action.server,n):"b"===this.action.action?this.finishBackdoor(t,e,this.action.server,n):"a"===this.action.action&&this.finishAnalyze(e,this.action.server,n),n&&this.print("Cancelled"),this.action=null,l.b.emit()}else if(!n)throw new Error("Finish action called when there was no action")}getFile(t,e){return Object(c.a)(e)?this.getScript(t,e):e.endsWith(".lit")?this.getLitFile(t,e):e.endsWith(".txt")?this.getTextFile(t,e):null}getFilepath(t){const e=Object(m.d)(t,this.cwd());if(null==e)throw new Error("Invalid file path specified: "+t);return Object(m.h)(e)?Object(m.k)(e):e}getScript(t,e){const n=t.getCurrentServer(),a=this.getFilepath(e);for(const t of n.scripts)if(a===t.filename)return t;return null}getTextFile(t,e){const n=t.getCurrentServer(),a=this.getFilepath(e);for(const t of n.textFiles)if(a===t.fn)return t;return null}getLitFile(t,e){const n=t.getCurrentServer(),a=this.getFilepath(e);for(const t of n.messages)if("string"==typeof t&&a===t)return t;return null}cwd(){return this.currDir}setcwd(t){this.currDir=t,l.b.emit()}async runContract(t,e){if(this.contractOpen)return this.error("There's already a Coding Contract in Progress");const n=t.getCurrentServer(),a=n.getContract(e);if(null==a)return this.error("No such contract");this.contractOpen=!0;const r=await a.prompt();if(null==n.getContract(e))return this.contractOpen=!1,this.error("Contract no longer exists (Was it solved by a script?)");switch(r){case s.b.Success:if(null!==a.reward){const e=t.gainCodingContractReward(a.reward,a.getDifficulty());this.print("Contract SUCCESS - "+e)}n.removeContract(a);break;case s.b.Failure:++a.tries,a.tries>=a.getMaxNumTries()?(this.error("Contract FAILED - Contract is now self-destructing"),n.removeContract(a)):this.error(`Contract FAILED - ${a.getMaxNumTries()-a.tries} tries remaining`);break;case s.b.Cancelled:default:this.print("Contract cancelled")}this.contractOpen=!1}executeScanAnalyzeCommand(t,e=1,n=!1){this.print("~~~~~~~~~~ Beginning scan-analyze ~~~~~~~~~~"),this.print(" ");const i={};for(const t of Object(u.c)())i[t.hostname]=0;const s=[],l=[0],c=t.getCurrentServer();for(s.push(c);0!=s.length;){const c=s.pop();if(!c)continue;const f=l.pop();if(void 0===f)continue;const u=c instanceof r.a;if(!n&&c.purchasedByPlayer&&"home"!=c.hostname)continue;if(i[c.hostname]||f>e)continue;if(!n&&u)continue;i[c.hostname]=1;for(let t=c.serversOnNetwork.length-1;t>=0;--t){const e=Object(p.a)(c,t);null!==e&&(s.push(e),l.push(f+1))}if(0==f)continue;const m=Array(4*(f-1)+1).join("-");t.hasProgram(o.a.AutoLink.name)?this.append(new a.a(m,c.hostname)):this.print(m+c.hostname);const h=m+"--";let d="NO";c.hasAdminRights&&(d="YES"),this.print(`${h}Root Access: ${d}${u?"":", Required hacking skill: "+c.requiredHackingSkill}`),c.hasOwnProperty("numOpenPortsRequired")&&this.print(h+"Number of open ports required to NUKE: "+c.numOpenPortsRequired),this.print(h+"RAM: "+k.a.formatRAM(c.maxRam)),this.print(" ")}}connectToServer(t,e){const n=Object(u.d)(e);null!=n?(t.getCurrentServer().isConnectedTo=!1,t.currentServer=n.hostname,t.getCurrentServer().isConnectedTo=!0,this.print("Connected to "+n.hostname),this.setcwd("/"),"darkweb"==t.getCurrentServer().hostname&&Object(h.c)()):this.error("Invalid server. Connection failed.")}executeCommands(t,e,n){n=(n=n.trim()).replace(/\s\s+/g," "),this.commandHistory[this.commandHistory.length-1]!=n&&(this.commandHistory.push(n),this.commandHistory.length>50&&this.commandHistory.splice(0,1),e.terminalCommandHistory=this.commandHistory),this.commandHistoryIndex=this.commandHistory.length;const a=Object(g.b)(n);for(let n=0;nthis.clear(),cls:()=>this.clear(),connect:T.a,cp:A.a,download:R.a,expr:N.a,free:P.a,grow:I.a,hack:F.a,help:D.a,history:j.a,home:B.a,hostname:G.a,kill:W.a,killall:H.a,ls:U.a,lscpu:q.a,mem:$.a,mv:K.a,nano:z.a,ps:V.a,rm:Y.a,run:J.a,scan:X.a,scp:Z.a,sudov:tt.a,tail:et.a,apr1:lt.a,top:nt.a,unalias:at.a,vim:rt.a,weaken:it.a,wget:ot.a}[i.toLowerCase()];o?o(this,t,e,r,a.slice(1)):this.error(`Command ${a[0]} not found`)}getProgressText(){if(null===this.action)throw new Error("trying to get the progress text when there's no action");return Object(E.a)({progress:(this.action.time-this.action.timeLeft)/this.action.time,totalTicks:50})}}},,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(33),r=n(969),i=n(387),o=n(655);function s(t){let e=t;return e.startsWith("[")&&(e=e.slice(1)),e.endsWith("]")&&(e=e.slice(0,-1)),e}function l(t){let e=t;return(e.startsWith('"')||e.startsWith("'"))&&(e=e.slice(1)),(e.endsWith('"')||e.endsWith("'"))&&(e=e.slice(0,-1)),e}function c(t){const e=[];return t.forEach(t=>{let n=t.toString();n=["[",n,"]"].join(""),e.push(n)}),e.join(",").replace(/\s/g,"")}const f=[{desc:t=>["A prime factor is a factor that is a prime number.",`What is the largest prime factor of ${t}?`].join(" "),difficulty:1,gen:()=>Object(a.a)(500,1e9),name:"Find Largest Prime Factor",numTries:10,solver:(t,e)=>{let n=2,a=t;for(;a>(n-1)*(n-1);){for(;a%n==0;)a=Math.round(a/n);++n}return(1===a?n-1:a)===parseInt(e,10)}},{desc:t=>["Given the following integer array, find the contiguous subarray","(containing at least one number) which has the largest sum and return that sum.","'Sum' refers to the sum of all the numbers in the subarray.\n",""+t.toString()].join(" "),difficulty:1,gen:()=>{const t=Object(a.a)(5,40),e=[];e.length=t;for(let n=0;n{const n=t.slice();for(let t=1;t["It is possible write four as a sum in exactly four different ways:\n\n","    3 + 1\n","    2 + 2\n","    2 + 1 + 1\n","    1 + 1 + 1 + 1\n\n",`How many different distinct ways can the number ${t} be written as a sum of at least`,"two positive integers?"].join(" "),difficulty:1.5,gen:()=>Object(a.a)(8,100),name:"Total Ways to Sum",numTries:10,solver:(t,e)=>{const n=[1];n.length=t+1,n.fill(0,1);for(let e=1;e[`How many different distinct ways can the number ${t[0]} be written`,"as a sum of integers contained in the set:\n\n",`[${t[1]}]?\n\n`,"You may use each integer in the set zero or more times."].join(" "),difficulty:2,gen:()=>{const t=Object(a.a)(12,200),e=Object(a.a)(8,12),n=[];for(let a=1;a<=t&&n.length!=e;a++)(Math.random()<.6||t-a{const n=t[0],a=t[1],r=[1];r.length=n+1,r.fill(0,1);for(let t=0;t{let e=["Given the following array of arrays of numbers representing a 2D matrix,","return the elements of the matrix as an array in spiral order:\n\n"].join(" ");return e+="    [\n",e+=t.map(t=>"        ["+t.map(t=>(""+t).padStart(2," ")).join(",")+"]").join("\n"),e+="\n    ]\n",e+=["\nHere is an example of what spiral order should be:\n\n","    [\n","        [1, 2, 3]\n","        [4, 5, 6]\n","        [7, 8, 9]\n","    ]\n\n","Answer: [1, 2, 3, 6, 9, 8 ,7, 4, 5]\n\n","Note that the matrix will not always be square:\n\n","    [\n","        [1,  2,  3,  4]\n","        [5,  6,  7,  8]\n","        [9, 10, 11, 12]\n","    ]\n\n","Answer: [1, 2, 3, 4, 8, 12, 11, 10, 9, 5, 6, 7]"].join(" "),e},difficulty:2,gen:()=>{const t=Object(a.a)(1,15),e=Object(a.a)(1,15),n=[];n.length=t;for(let a=0;a{const n=[];let a=0,r=t.length-1,i=0,o=t[0].length-1,l=0;for(;;){for(let e=i;e<=o;e++)n[l]=t[a][e],++l;if(++a>r)break;for(let e=a;e<=r;e++)n[l]=t[e][o],++l;if(--o=i;e--)n[l]=t[r][e],++l;if(--r=a;e--)n[l]=t[e][i],++l;if(++i>o)break}const c=s(e).replace(/\s/g,"").split(",");for(let t=0;t["You are given the following array of integers:\n\n",t+"\n\n","Each element in the array represents your MAXIMUM jump length","at that position. This means that if you are at position i and your","maximum jump length is n, you can jump to any position from","i to i+n.","\n\nAssuming you are initially positioned","at the start of the array, determine whether you are","able to reach the last index.\n\n","Your answer should be submitted as 1 or 0, representing true and false respectively"].join(" "),difficulty:2.5,gen:()=>{const t=Object(a.a)(3,25),e=[];e.length=t;for(let t=0;t{const n=t.length;let a=0;for(let e=0;a["You are given the following array of integers:\n\n",t+"\n\n","Each element in the array represents your MAXIMUM jump length","at that position. This means that if you are at position i and your","maximum jump length is n, you can jump to any position from","i to i+n.","\n\nAssuming you are initially positioned","at the start of the array, determine the minimum number of","jumps to reach the end of the array.\n\n","If it's impossible to reach the end, then the answer should be 0."].join(" "),difficulty:3,gen:()=>{const t=Object(a.a)(3,25),e=[];e.length=t;for(let t=0;t{const n=t.length;let a=0,r=0,i=-1;for(;ai;n--)n+t[n]>a&&(a=n+t[n],e=n);if(-1===e){r=0;break}i=e,r++}return r===parseInt(e,10)}},{desc:t=>["Given the following array of array of numbers representing a list of","intervals, merge all overlapping intervals.\n\n",`[${c(t)}]\n\n`,"Example:\n\n","[[1, 3], [8, 10], [2, 6], [10, 16]]\n\n","would merge into [[1, 6], [8, 16]].\n\n","The intervals must be returned in ASCENDING order.","You can assume that in an interval, the first number will always be","smaller than the second."].join(" "),difficulty:3,gen:()=>{const t=[],e=Object(a.a)(3,20);for(let n=0;n{const n=t.slice();n.sort((t,e)=>t[0]-e[0]);const a=[];let r=n[0][0],i=n[0][1];for(const t of n)t[0]<=i?i=Math.max(i,t[1]):(a.push([r,i]),r=t[0],i=t[1]);a.push([r,i]);const o=c(a),l=e.replace(/\s/g,"");return o===l||o===s(l)}},{desc:t=>["Given the following string containing only digits, return","an array with all possible valid IP address combinations","that can be created from the string:\n\n",t+"\n\n","Note that an octet cannot begin with a '0' unless the number","itself is actually 0. For example, '192.168.010.1' is not a valid IP.\n\n","Examples:\n\n","25525511135 -> [255.255.11.135, 255.255.111.35]\n","1938718066 -> [193.87.180.66]"].join(" "),difficulty:3,gen:()=>{let t="";for(let e=0;e<4;++e){t+=Object(a.a)(0,255).toString()}return t},name:"Generate IP Addresses",numTries:10,solver:(t,e)=>{const n=[];for(let e=1;e<=3;++e)for(let a=1;a<=3;++a)for(let r=1;r<=3;++r)for(let i=1;i<=3;++i)if(e+a+r+i===t.length){const o=parseInt(t.substring(0,e),10),s=parseInt(t.substring(e,e+a),10),l=parseInt(t.substring(e+a,e+a+r),10),c=parseInt(t.substring(e+a+r,e+a+r+i),10);if(o<=255&&s<=255&&l<=255&&c<=255){const e=[o.toString(),".",s.toString(),".",l.toString(),".",c.toString()].join("");e.length===t.length+3&&n.push(e)}}const a=s(e).replace(/\s/g,"").split(",");if(a.length!==n.length)return!1;for(const t of a)if(!n.includes(t))return!1;return!0}},{desc:t=>["You are given the following array of stock prices (which are numbers)","where the i-th element represents the stock price on day i:\n\n",t+"\n\n","Determine the maximum possible profit you can earn using at most","one transaction (i.e. you can only buy and sell the stock once). If no profit can be made","then the answer should be 0. Note","that you have to buy the stock before you can sell it"].join(" "),difficulty:1,gen:()=>{const t=Object(a.a)(3,50),e=[];e.length=t;for(let n=0;n{let n=0,a=0;for(let e=1;e["You are given the following array of stock prices (which are numbers)","where the i-th element represents the stock price on day i:\n\n",t+"\n\n","Determine the maximum possible profit you can earn using as many","transactions as you'd like. A transaction is defined as buying","and then selling one share of the stock. Note that you cannot","engage in multiple transactions at once. In other words, you","must sell the stock before you buy it again.\n\n","If no profit can be made, then the answer should be 0"].join(" "),difficulty:2,gen:()=>{const t=Object(a.a)(3,50),e=[];e.length=t;for(let n=0;n{let n=0;for(let e=1;e["You are given the following array of stock prices (which are numbers)","where the i-th element represents the stock price on day i:\n\n",t+"\n\n","Determine the maximum possible profit you can earn using at most","two transactions. A transaction is defined as buying","and then selling one share of the stock. Note that you cannot","engage in multiple transactions at once. In other words, you","must sell the stock before you buy it again.\n\n","If no profit can be made, then the answer should be 0"].join(" "),difficulty:5,gen:()=>{const t=Object(a.a)(3,50),e=[];e.length=t;for(let n=0;n{let n=Number.MIN_SAFE_INTEGER,a=Number.MIN_SAFE_INTEGER,r=0,i=0;for(const e of t)i=Math.max(i,a+e),a=Math.max(a,r-e),r=Math.max(r,n+e),n=Math.max(n,-1*e);return i.toString()===e}},{desc:t=>["You are given the following array with two elements:\n\n",`[${t[0]}, [${t[1]}]]\n\n`,"The first element is an integer k. The second element is an","array of stock prices (which are numbers) where the i-th element","represents the stock price on day i.\n\n","Determine the maximum possible profit you can earn using at most","k transactions. A transaction is defined as buying and then selling","one share of the stock. Note that you cannot engage in multiple","transactions at once. In other words, you must sell the stock before","you can buy it again.\n\n","If no profit can be made, then the answer should be 0."].join(" "),difficulty:8,gen:()=>{const t=Object(a.a)(2,10),e=Object(a.a)(3,50),n=[];n.length=e;for(let t=0;t{const n=t[0],a=t[1],r=a.length;if(r<2)return 0===parseInt(e);if(n>r/2){let t=0;for(let e=1;e0;--t)o[t]=Math.max(o[t],i[t]+s),i[t]=Math.max(i[t],o[t-1]-s)}return parseInt(e)===o[n]}},{desc:t=>{function e(t,n=0){const a=t.length;if(n>=a)return"";let r=[" ".repeat(a-n+1),"[",t[n].toString(),"]"].join("");return n 3 -> 5 -> 1)."].join(" ")},difficulty:5,gen:()=>{const t=[],e=Object(a.a)(3,12);t.length=e;for(let n=0;n{const n=t.length,a=t[n-1].slice();for(let e=n-2;e>-1;--e)for(let n=0;n{const e=t[0],n=t[1];return["You are in a grid with",`${e} rows and ${n} columns, and you are`,"positioned in the top-left corner of that grid. You are trying to","reach the bottom-right corner of the grid, but you can only","move down or right on each step. Determine how many","unique paths there are from start to finish.\n\n","NOTE: The data returned for this contract is an array","with the number of rows and columns:\n\n",`[${e}, ${n}]`].join(" ")},difficulty:3,gen:()=>[Object(a.a)(2,14),Object(a.a)(2,14)],name:"Unique Paths in a Grid I",numTries:10,solver:(t,e)=>{const n=t[0],a=t[1],r=[];r.length=n;for(let t=0;t{let e="";for(const n of t)e+=n.toString()+",\n";return["You are located in the top-left corner of the following grid:\n\n",e+"\n","You are trying reach the bottom-right corner of the grid, but you can only","move down or right on each step. Furthermore, there are obstacles on the grid","that you cannot move onto. These obstacles are denoted by '1', while empty","spaces are denoted by 0.\n\n","Determine how many unique paths there are from start to finish.\n\n","NOTE: The data returned for this contract is an 2D array of numbers representing the grid."].join(" ")},difficulty:5,gen:()=>{const t=Object(a.a)(2,12),e=Object(a.a)(2,12),n=[];n.length=t;for(let a=0;a{const n=[];n.length=t.length;for(let e=0;e0?n[t-1][e]:0)+(e>0?n[t][e-1]:0);return n[n.length-1][n[0].length-1]===parseInt(e)}},{name:"Shortest Path in a Grid",desc:t=>["You are located in the top-left corner of the following grid:\n\n",`  [${t.map(t=>"["+t+"]").join(",\n   ")}]\n\n`,"You are trying to find the shortest path to the bottom-right corner of the grid,","but there are obstacles on the grid that you cannot move onto.","These obstacles are denoted by '1', while empty spaces are denoted by 0.\n\n","Determine the shortest path from start to finish, if one exists.","The answer should be given as a string of UDLR characters, indicating the moves along the path\n\n","NOTE: If there are multiple equally short paths, any of them is accepted as answer.","If there is no path, the answer should be an empty string.\n","NOTE: The data returned for this contract is an 2D array of numbers representing the grid.\n\n","Examples:\n\n","    [[0,1,0,0,0],\n","     [0,0,0,1,0]]\n","\n","Answer: 'DRRURRD'\n\n","    [[0,1],\n","     [1,0]]\n","\n","Answer: ''\n\n"].join(" "),difficulty:7,numTries:10,gen:()=>{const t=Object(a.a)(6,12),e=Object(a.a)(6,12),n=t-1,r=e-1,i=n+r,o=new Array(t);for(let n=0;n{const n=t[0].length,a=t.length,i=a-1,o=n-1,s=new Array(a),l=new r.a;for(let t=0;t=0&&e=0&&r0;){const[t,e]=l.pop();for(const[n,a]of f(t,e)){const r=s[t][e]+1;rt==n&&e==a,r),s[n][a]=r)}}if(s[i][o]==1/0)return""==e;if(e.length>s[i][o])return!1;let u=0,m=0;for(const t of e){switch(t){case"U":m-=1;break;case"D":m+=1;break;case"L":u-=1;break;case"R":u+=1;break;default:return!1}if(!c(m,u))return!1}return m==i&&u==o}},{desc:t=>["Given the following string:\n\n",t+"\n\n","remove the minimum number of invalid parentheses in order to validate","the string. If there are multiple minimal ways to validate the string,","provide all of the possible results. The answer should be provided","as an array of strings. If it is impossible to validate the string","the result should be an array with only an empty string.\n\n","IMPORTANT: The string may contain letters, not just parentheses.","Examples:\n",'"()())()" -> [()()(), (())()]\n','"(a)())()" -> [(a)()(), (a())()]\n','")(" -> [""]'].join(" "),difficulty:10,gen:()=>{const t=Object(a.a)(6,20),e=[];e.length=t,Math.random()<.8?e[0]="(":e[0]=")";for(let n=1;n{let n=0,a=0;const r=[];for(let e=0;e0?--n:++a);!function t(e,n,a,r,i,o,s){if(i.length!==n)"("===i[n]?(a>0&&t(e,n+1,a-1,r,i,o,s),t(e+1,n+1,a,r,i,o+i[n],s)):")"===i[n]?(r>0&&t(e,n+1,a,r-1,i,o,s),e>0&&t(e-1,n+1,a,r,i,o+i[n],s)):t(e,n+1,a,r,i,o+i[n],s);else if(0===a&&0===r&&0===e){for(let t=0;t{const e=t[0],n=t[1];return["You are given the following string which contains only digits between 0 and 9:\n\n",e+"\n\n",`You are also given a target number of ${n}. Return all possible ways`,"you can add the +(add), -(subtract), and *(multiply) operators to the string such","that it evaluates to the target number. (Normal order of operations applies.)\n\n","The provided answer should be an array of strings containing the valid expressions.","The data provided by this problem is an array with two elements. The first element","is the string of digits, while the second element is the target number:\n\n",`["${e}", ${n}]\n\n`,"NOTE: The order of evaluation expects script operator precedence","NOTE: Numbers in the expression cannot have leading 0's. In other words,",'"1+01" is not a valid expression',"Examples:\n\n",'Input: digits = "123", target = 6\n',"Output: [1+2+3, 1*2*3]\n\n",'Input: digits = "105", target = 5\n',"Output: [1*0+5, 10-5]"].join(" ")},difficulty:10,gen:()=>{const t=Object(a.a)(4,12),e=[];e.length=t;for(let t=0;t{const n=t[0],a=t[1];const r=s(e).split(",");for(let t=0;t["You are given the following decimal Value: \n",t+" \n","Convert it into a binary string and encode it as a 'Hamming-Code'. eg:\n ","Value 8 will result into binary '1000', which will be encoded","with the pattern 'pppdpddd', where p is a paritybit and d a databit,\n","or '10101' (Value 21) will result into (pppdpdddpd) '1001101011'.\n\n","NOTE: You need an parity Bit on Index 0 as an 'overall'-paritybit. \n","NOTE 2: You should watch the HammingCode-video from 3Blue1Brown, which explains the 'rule' of encoding,","including the first Index parity-bit mentioned on the first note.\n\n","Now the only one rule for this encoding:\n"," It's not allowed to add additional leading '0's to the binary value\n","That means, the binary value has to be encoded as it is"].join(" "),gen:()=>Object(a.a)(Math.pow(2,4),Math.pow(2,Object(a.a)(1,57))),solver:(t,e)=>e===Object(o.b)(t)},{name:"HammingCodes: Encoded Binary to Integer",difficulty:8,numTries:10,desc:t=>["You are given the following encoded binary String: \n",`'${t}' \n`,"Treat it as a Hammingcode with 1 'possible' error on an random Index.\n","Find the 'possible' wrong bit, fix it and extract the decimal value, which is hidden inside the string.\n\n","Note: The length of the binary string is dynamic, but it's encoding/decoding is following Hammings 'rule'\n","Note 2: Index 0 is an 'overall' parity bit. Watch the Hammingcode-video from 3Blue1Brown for more information\n","Note 3: There's a ~55% chance for an altered Bit. So... MAYBE there is an altered Bit 😉\n","Extranote for automation: return the decimal value as a string"].join(" "),gen:()=>{const t=Math.round(Math.random()),e=Object(o.b)(Object(a.a)(Math.pow(2,4),Math.pow(2,Object(a.a)(1,57)))).split("");if(t){const t=Object(a.a)(0,e.length-1);e[t]="0"==e[t]?"1":"0"}return e.join("")},solver:(t,e)=>parseInt(e,10)===Object(o.a)(t)},{name:"Proper 2-Coloring of a Graph",difficulty:7,numTries:5,desc:t=>["You are given the following data, representing a graph:\n",JSON.stringify(t)+"\n",'Note that "graph", as used here, refers to the field of graph theory, and has',"no relation to statistics or plotting.","The first element of the data represents the number of vertices in the graph.",`Each vertex is a unique number between 0 and ${t[0]-1}.`,"The next element of the data represents the edges of the graph.","Two vertices u,v in a graph are said to be adjacent if there exists an edge [u,v].","Note that an edge [u,v] is the same as an edge [v,u], as order does not matter.","You must construct a 2-coloring of the graph, meaning that you have to assign each",'vertex in the graph a "color", either 0 or 1, such that no two adjacent vertices have',"the same color. Submit your answer in the form of an array, where element i","represents the color of vertex i. If it is impossible to construct a 2-coloring of","the given graph, instead submit an empty array.\n\n","Examples:\n\n","Input: [4, [[0, 2], [0, 3], [1, 2], [1, 3]]]\n","Output: [0, 0, 1, 1]\n\n","Input: [3, [[0, 1], [0, 2], [1, 2]]]\n","Output: []"].join(" "),gen:()=>{const t=Math.floor(5*Math.random())+3,e=Math.floor(5*Math.random())+3,n=[];for(let a=0;a.5&&n.push([a,t+r]);let a=Math.floor(Math.random()*(t+e)),r=Math.floor(Math.random()*(t+e));function i(t){for(let e=t.length-1;e>0;e--){const n=Math.floor(Math.random()*(e+1));[t[e],t[n]]=[t[n],t[e]]}}a>r&&([a,r]=[r,a]),a==r||n.includes([a,r])||n.push([a,r]);const o=Array.from(Array(t+e).keys());i(o);for(let t=0;tn[t][1]&&([n[t][0],n[t][1]]=[n[t][1],n[t][0]]);return i(n),[t+e,n]},solver:(t,e)=>{if("[]"==e){function n(e){const n=t[1].filter(([t,n])=>t==e).map(([t,e])=>e),a=t[1].filter(([t,n])=>n==e).map(([t,e])=>t);return n.concat(a)}const e=Array(t[0]).fill(void 0);for(;e.some(t=>void 0===t);){const t=e.findIndex(t=>void 0===t);e[t]=0;const a=[t];for(;a.length>0;){const t=a.pop()||0,r=n(t);for(const n in r){const i=r[n];if(void 0===e[i])0===e[t]?e[i]=1:e[i]=0,a.push(i);else if(e[i]===e[t])return!0}}}return!1}const a=s(e).split(",").map(t=>parseInt(t));if(a.length==t[0]){const e=t[1],n=[0,1];return e.every(([t,e])=>{const r=a[t],i=a[e];return n.includes(r)&&n.includes(i)&&r!=i})}return!1}},{name:"Compression I: RLE Compression",difficulty:2,numTries:10,desc:t=>["Run-length encoding (RLE) is a data compression technique which encodes data as a series of runs of","a repeated single character. Runs are encoded as a length, followed by the character itself. Lengths","are encoded as a single ASCII digit; runs of 10 characters or more are encoded by splitting them","into multiple runs.\n\n","You are given the following input string:\n",`    ${t}\n`,"Encode it using run-length encoding with the minimum possible output length.\n\n","Examples:\n","    aaaaabccc            ->  5a1b3c\n","    aAaAaA               ->  1a1A1a1A1a1A\n","    111112333            ->  511233\n","    zzzzzzzzzzzzzzzzzzz  ->  9z9z1z  (or 9z8z2z, etc.)\n"].join(" "),gen:()=>{const t=50+Math.floor(25*(Math.random()+Math.random()));let e="";for(;e.length{if(e.length%2!=0)return!1;let n="";for(let t=0;t+19)return!1;n+=e[t+1].repeat(a)}if(n!==t)return!1;let a=0;for(let e=0;e0;)n-=9,a+=2}return e.length<=a}},{name:"Compression II: LZ Decompression",difficulty:4,numTries:10,desc:t=>["Lempel-Ziv (LZ) compression is a data compression technique which encodes data using references to","earlier parts of the data. In this variant of LZ, data is encoded in two types of chunk. Each chunk","begins with a length L, encoded as a single ASCII digit from 1 - 9, followed by the chunk data,","which is either:\n\n","1. Exactly L characters, which are to be copied directly into the uncompressed data.\n","2. A reference to an earlier part of the uncompressed data. To do this, the length is followed","by a second ASCII digit X: each of the L output characters is a copy of the character X","places before it in the uncompressed data.\n\n","For both chunk types, a length of 0 instead means the chunk ends immediately, and the next character","is the start of a new chunk. The two chunk types alternate, starting with type 1, and the final","chunk may be of either type.\n\n","You are given the following LZ-encoded string:\n",`    ${t}\n`,"Decode it and output the original string.\n\n","Example: decoding '5aaabb450723abb' chunk-by-chunk\n","    5aaabb           ->  aaabb\n","    5aaabb45         ->  aaabbaaab\n","    5aaabb450        ->  aaabbaaab\n","    5aaabb45072      ->  aaabbaaababababa\n","    5aaabb450723abb  ->  aaabbaaababababaabb"].join(" "),gen:()=>Object(i.c)(Object(i.d)()),solver:(t,e)=>e===Object(i.b)(t)},{name:"Compression III: LZ Compression",difficulty:10,numTries:10,desc:t=>["Lempel-Ziv (LZ) compression is a data compression technique which encodes data using references to","earlier parts of the data. In this variant of LZ, data is encoded in two types of chunk. Each chunk","begins with a length L, encoded as a single ASCII digit from 1 - 9, followed by the chunk data,","which is either:\n\n","1. Exactly L characters, which are to be copied directly into the uncompressed data.\n","2. A reference to an earlier part of the uncompressed data. To do this, the length is followed","by a second ASCII digit X: each of the L output characters is a copy of the character X","places before it in the uncompressed data.\n\n","For both chunk types, a length of 0 instead means the chunk ends immediately, and the next character","is the start of a new chunk. The two chunk types alternate, starting with type 1, and the final","chunk may be of either type.\n\n","You are given the following input string:\n",`    ${t}\n`,"Encode it using Lempel-Ziv encoding with the minimum possible output length.\n\n","Examples (some have other possible encodings of minimal length):\n","    abracadabra     ->  7abracad47\n","    mississippi     ->  4miss433ppi\n","    aAAaAAaAaAA     ->  3aAA53035\n","    2718281828      ->  627182844\n","    abcdefghijk     ->  9abcdefghi02jk\n","    aaaaaaaaaaaa    ->  3aaa91\n","    aaaaaaaaaaaaa   ->  1a91031\n","    aaaaaaaaaaaaaa  ->  1a91041"].join(" "),gen:()=>Object(i.d)(),solver:(t,e)=>Object(i.b)(e)===t&&e.length<=Object(i.c)(t).length}]},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));class a{constructor(){this.data=[]}get size(){return this.data.length}push(t,e){const n=this.data.length;this.data[n]=[e,t],this.heapifyUp(n)}peek(){if(0!=this.data.length)return this.data[0][1]}pop(){if(0==this.data.length)return;const t=this.data[0][1];return this.data[0]=this.data[this.data.length-1],this.data.length=this.data.length-1,this.heapifyDown(0),t}changeWeight(t,e){const n=this.data.findIndex(e=>t(e[1]));if(-1==n)return;this.data[n][0]=e;const a=Math.floor((n-1)/2);this.heapOrderABeforeB(this.data[a][0],this.data[n][0])?this.heapifyDown(n):this.heapifyUp(n)}heapifyUp(t){for(;t>0;){const e=Math.floor((t-1)/2);if(this.heapOrderABeforeB(this.data[e][0],this.data[t][0]))break;const n=this.data[e];this.data[e]=this.data[t],this.data[t]=n,t=e}}heapifyDown(t){for(;t=t}}const h=[{key:"NukeProgram",name:"NUKE.exe",create:{level:1,tooltip:"This virus is used to gain root access to a machine if enough ports are opened.",req:m(1),time:a.a.MillisecondsPerFiveMinutes},run:(t,e,n,a)=>{if(a instanceof r.a)return a.hasAdminRights?(e.print("You already have root access to this computer. There is no reason to run NUKE.exe"),void e.print("You can now run scripts on this server.")):a.openPortCount>=a.numOpenPortsRequired?(a.hasAdminRights=!0,e.print("NUKE successful! Gained root access to "+a.hostname),void e.print("You can now run scripts on this server.")):void e.print("NUKE unsuccessful. Not enough ports have been opened");e.error("Cannot nuke this kind of server.")}},{key:"BruteSSHProgram",name:"BruteSSH.exe",create:{level:50,tooltip:"This program executes a brute force attack that opens SSH ports",req:m(50),time:2*a.a.MillisecondsPerFiveMinutes},run:(t,e,n,a)=>{a instanceof r.a?a.sshPortOpen?e.print("SSH Port (22) is already open!"):(a.sshPortOpen=!0,e.print("Opened SSH Port(22)!"),a.openPortCount++):e.error("Cannot run BruteSSH.exe on this kind of server.")}},{key:"FTPCrackProgram",name:"FTPCrack.exe",create:{level:100,tooltip:"This program cracks open FTP ports",req:m(100),time:a.a.MillisecondsPerHalfHour},run:(t,e,n,a)=>{a instanceof r.a?a.ftpPortOpen?e.print("FTP Port (21) is already open!"):(a.ftpPortOpen=!0,e.print("Opened FTP Port (21)!"),a.openPortCount++):e.error("Cannot run FTPCrack.exe on this kind of server.")}},{key:"RelaySMTPProgram",name:"relaySMTP.exe",create:{level:250,tooltip:"This program opens SMTP ports by redirecting data",req:m(250),time:a.a.MillisecondsPer2Hours},run:(t,e,n,a)=>{a instanceof r.a?a.smtpPortOpen?e.print("SMTP Port (25) is already open!"):(a.smtpPortOpen=!0,e.print("Opened SMTP Port (25)!"),a.openPortCount++):e.error("Cannot run relaySMTP.exe on this kind of server.")}},{key:"HTTPWormProgram",name:"HTTPWorm.exe",create:{level:500,tooltip:"This virus opens up HTTP ports",req:m(500),time:a.a.MillisecondsPer4Hours},run:(t,e,n,a)=>{a instanceof r.a?a.httpPortOpen?e.print("HTTP Port (80) is already open!"):(a.httpPortOpen=!0,e.print("Opened HTTP Port (80)!"),a.openPortCount++):e.error("Cannot run HTTPWorm.exe on this kind of server.")}},{key:"SQLInjectProgram",name:"SQLInject.exe",create:{level:750,tooltip:"This virus opens SQL ports",req:m(750),time:a.a.MillisecondsPer8Hours},run:(t,e,n,a)=>{a instanceof r.a?a.sqlPortOpen?e.print("SQL Port (1433) is already open!"):(a.sqlPortOpen=!0,e.print("Opened SQL Port (1433)!"),a.openPortCount++):e.error("Cannot run SQLInject.exe on this kind of server.")}},{key:"DeepscanV1",name:"DeepscanV1.exe",create:{level:75,tooltip:"This program allows you to use the scan-analyze command with a depth up to 5",req:m(75),time:a.a.MillisecondsPerQuarterHour},run:(t,e)=>{e.print("This executable cannot be run."),e.print("DeepscanV1.exe lets you run 'scan-analyze' with a depth up to 5.")}},{key:"DeepscanV2",name:"DeepscanV2.exe",create:{level:400,tooltip:"This program allows you to use the scan-analyze command with a depth up to 10",req:m(400),time:a.a.MillisecondsPer2Hours},run:(t,e)=>{e.print("This executable cannot be run."),e.print("DeepscanV2.exe lets you run 'scan-analyze' with a depth up to 10.")}},{key:"ServerProfiler",name:"ServerProfiler.exe",create:{level:75,tooltip:"This program is used to display hacking and Netscript-related information about servers",req:m(75),time:a.a.MillisecondsPerHalfHour},run:(t,e,n,a,s)=>{if(1!==s.length)return void e.error("Must pass a server hostname or IP as an argument for ServerProfiler.exe");const l=Object(o.d)(s[0]);null!=l?l instanceof r.a?(e.print(l.hostname+":"),e.print("Server base security level: "+l.baseDifficulty),e.print("Server current security level: "+l.hackDifficulty),e.print("Server growth rate: "+l.serverGrowth),e.print("Netscript hack() execution time: "+Object(i.d)(1e3*Object(f.d)(l,n),!0)),e.print("Netscript grow() execution time: "+Object(i.d)(1e3*Object(f.a)(l,n),!0)),e.print("Netscript weaken() execution time: "+Object(i.d)(1e3*Object(f.f)(l,n),!0))):e.error("ServerProfiler.exe can only be run on normal servers."):e.error("Invalid server IP/hostname")}},{key:"AutoLink",name:"AutoLink.exe",create:{level:25,tooltip:"This program allows you to directly connect to other servers through the 'scan-analyze' command",req:m(25),time:a.a.MillisecondsPerQuarterHour},run:(t,e)=>{e.print("This executable cannot be run."),e.print("AutoLink.exe lets you automatically connect to other servers when using 'scan-analyze'."),e.print("When using scan-analyze, click on a server's hostname to connect to it.")}},{key:"Formulas",name:"Formulas.exe",create:{level:1e3,tooltip:"This program allows you to use the formulas API",req:m(1e3),time:a.a.MillisecondsPer4Hours},run:(t,e)=>{e.print("This executable cannot be run."),e.print("Formulas.exe lets you use the formulas API.")}},{key:"BitFlume",name:"b1t_flum3.exe",create:{level:1,tooltip:"This program creates a portal to the BitNode Nexus (allows you to restart and switch BitNodes)",req:function(t){return t.sourceFiles.length>0&&t.hacking>=1},time:a.a.MillisecondsPerFiveMinutes/20},run:()=>{c.a.emit()}},{key:"Flight",name:"fl1ght.exe",create:null,run:(t,e,n)=>{const a=l.a.DaedalusAugsRequirement;if(!(n.augmentations.length>=a&&n.money>1e11&&n.hacking>=2500))return e.print(`Augmentations: ${n.augmentations.length} / ${a}`),e.print(`Money: ${s.a.formatMoney(n.money)} / $100b`),void e.print(`Hacking skill: ${n.hacking} / 2500`);e.print("We will contact you."),e.print(`-- ${u.a.Daedalus} --`)}}]},function(t,e,n){"use strict";function a(t){const e="(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)";return new RegExp(`^${e}.${e}.${e}.${e}$`).test(t)}n.d(e,"a",(function(){return a}))},function(t,e,n){"use strict";function a(){const t=new Date,e=("0"+t.getHours()).slice(-2),n=("0"+t.getMinutes()).slice(-2),a=("0"+t.getSeconds()).slice(-2);return`${t.getMonth()+1}/${t.getDate()} ${e}:${n}:${a}`}n.d(e,"a",(function(){return a}))},function(t,e,n){"use strict";function a(t){const e=1+Math.log(t)/25;return isNaN(e)||!isFinite(e)?1:e}n.d(e,"a",(function(){return a}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return S}));var a=n(31),r=n(9);const i={},o={},s={},l={},c={},f={},u={},m={},h={},d={},p={},g={},y={},b={},E={},v={},k={},_={},w={};a.j.forEach(t=>{i[t]=!0,c[t]=!0}),a.d.forEach(t=>{o[t]=!0,c[t]=!0}),a.f.forEach(t=>{s[t]=!0,c[t]=!0}),c[a.i[0]]=!0,l[a.i[0]]=!0,a.b.forEach(t=>{f[t]=!0}),a.h.forEach(t=>{m[t]=!0}),a.a.forEach(t=>{u[t]=!0}),a.k.forEach(t=>{h[t]=!0}),a.c.forEach(t=>{d[t]=!0});for(let t=0;tnull),null!=t.cost&&(this.cost=t.cost),null!=t.effectText&&(this.effectText=t.effectText),this.costPerLevel=t.costPerLevel,this.desc=t.desc,this.hasTargetServer=!!t.hasTargetServer&&t.hasTargetServer,this.name=t.name,this.value=t.value}getCost(t){return"number"==typeof this.cost?this.cost:Math.round((t+1)*this.costPerLevel)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(0),r=n.n(a),i=n(5),o=n(20);const s=[{cost:4,costPerLevel:4,desc:"Sell hashes for $1m",name:"Sell for Money",effectText:t=>r.a.createElement(r.a.Fragment,null,"Sold for ",r.a.createElement(o.a,{money:1e6*t})),value:1e6},{costPerLevel:100,desc:"Sell hashes for $1b in Corporation funds",name:"Sell for Corporation Funds",effectText:t=>r.a.createElement(r.a.Fragment,null,"Sold for ",r.a.createElement(o.a,{money:1e9*t})," Corporation funds."),value:1e9},{costPerLevel:50,desc:"Use hashes to decrease the minimum security of a single server by 2%. Note that a server's minimum security cannot go below 1. This effect persists until you install Augmentations (since servers are reset at that time).",hasTargetServer:!0,name:"Reduce Minimum Security",value:.98},{costPerLevel:50,desc:"Use hashes to increase the maximum amount of money on a single server by 2%. Note that a server's maximum money is soft capped above $10t. This effect persists until you install Augmentations (since servers are reset at that time).",hasTargetServer:!0,name:"Increase Maximum Money",value:1.02},{costPerLevel:50,desc:"Use hashes to improve the experience earned when studying at a university by 20%. This effect persists until you install Augmentations",name:"Improve Studying",effectText:t=>r.a.createElement(r.a.Fragment,null,"Improves studying by ",20*t,"%"),value:20},{costPerLevel:50,desc:"Use hashes to improve the experience earned when training at the gym by 20%. This effect persists until you install Augmentations",name:"Improve Gym Training",effectText:t=>r.a.createElement(r.a.Fragment,null,"Improves training by ",20*t,"%"),value:20},{costPerLevel:200,desc:"Exchange hashes for 1k Scientific Research in all of your Corporation's Industries",name:"Exchange for Corporation Research",effectText:t=>r.a.createElement(r.a.Fragment,null,"Acquired a total of ",t,"k Scientific Research in your industries."),value:1e3},{costPerLevel:250,desc:"Exchange hashes for 100 Bladeburner Rank",name:"Exchange for Bladeburner Rank",effectText:t=>r.a.createElement(r.a.Fragment,null,"Acquired a total of ",i.a.format(100*t,"0a")," Bladeburner rank"),value:100},{costPerLevel:250,desc:"Exchanges hashes for 10 Bladeburner Skill Points",name:"Exchange for Bladeburner SP",effectText:t=>r.a.createElement(r.a.Fragment,null,"Acquired a total of ",i.a.format(10*t,"0a")," Bladeburner Skill Points"),value:10},{costPerLevel:200,desc:"Generate a random Coding Contract somewhere on the network",name:"Generate Coding Contract",effectText:t=>r.a.createElement(r.a.Fragment,null,"Generated ",t," contracts."),value:1}]},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,"parent",null),a(this,"stopFlag",!1),a(this,"vars",{}),t instanceof r&&(this.vars=Object.assign({},t.vars)),this.parent=t}lookup(t){let e=this;for(;e;){if(Object.prototype.hasOwnProperty.call(e.vars,t))return e;e=e.parent}return null}get(t){if(t in this.vars)return this.vars[t];throw new Error("Undefined variable "+t)}set(t,e){const n=this.lookup(t);return null!==n?n.vars[t]=e:this.vars[t]=e}def(t,e){return this.vars[t]=e}}},function(t,e,n){"use strict";function a(t){return!isNaN(t)&&(0!==t&&0==(t&t-1))}n.d(e,"a",(function(){return a}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(99),r=n(9);const i=[{b:!0,initPrice:{max:28e3,min:17e3},marketCap:24e11,mv:{divisor:100,max:50,min:40},name:r.a.AevumECorp,otlkMag:19,spreadPerc:{divisor:10,max:5,min:1},shareTxForMovement:{max:9e4,min:3e4},symbol:a.a[r.a.AevumECorp]},{b:!0,initPrice:{max:34e3,min:24e3},marketCap:24e11,mv:{divisor:100,max:50,min:40},name:r.a.Sector12MegaCorp,otlkMag:19,spreadPerc:{divisor:10,max:5,min:1},shareTxForMovement:{max:9e4,min:3e4},symbol:a.a[r.a.Sector12MegaCorp]},{b:!0,initPrice:{max:25e3,min:12e3},marketCap:16e11,mv:{divisor:100,max:80,min:70},name:r.a.Sector12BladeIndustries,otlkMag:13,spreadPerc:{divisor:10,max:6,min:1},shareTxForMovement:{max:9e4,min:3e4},symbol:a.a[r.a.Sector12BladeIndustries]},{b:!0,initPrice:{max:25e3,min:1e4},marketCap:15e11,mv:{divisor:100,max:75,min:65},name:r.a.AevumClarkeIncorporated,otlkMag:12,spreadPerc:{divisor:10,max:5,min:1},shareTxForMovement:{max:9e4,min:3e4},symbol:a.a[r.a.AevumClarkeIncorporated]},{b:!0,initPrice:{max:43e3,min:32e3},marketCap:18e11,mv:{divisor:100,max:70,min:60},name:r.a.VolhavenOmniTekIncorporated,otlkMag:12,spreadPerc:{divisor:10,max:6,min:1},shareTxForMovement:{max:9e4,min:3e4},symbol:a.a[r.a.VolhavenOmniTekIncorporated]},{b:!0,initPrice:{max:8e4,min:5e4},marketCap:2e12,mv:{divisor:100,max:110,min:100},name:r.a.Sector12FourSigma,otlkMag:17,spreadPerc:{divisor:10,max:10,min:1},shareTxForMovement:{max:9e4,min:3e4},symbol:a.a[r.a.Sector12FourSigma]},{b:!0,initPrice:{max:28e3,min:16e3},marketCap:19e11,mv:{divisor:100,max:85,min:75},name:r.a.ChongqingKuaiGongInternational,otlkMag:10,spreadPerc:{divisor:10,max:7,min:1},shareTxForMovement:{max:9e4,min:3e4},symbol:a.a[r.a.ChongqingKuaiGongInternational]},{b:!0,initPrice:{max:36e3,min:29e3},marketCap:2e12,mv:{divisor:100,max:130,min:120},name:r.a.AevumFulcrumTechnologies,otlkMag:16,spreadPerc:{divisor:10,max:10,min:1},shareTxForMovement:{max:9e4,min:3e4},symbol:a.a[r.a.AevumFulcrumTechnologies]},{b:!0,initPrice:{max:25e3,min:2e4},marketCap:12e11,mv:{divisor:100,max:90,min:80},name:r.a.IshimaStormTechnologies,otlkMag:7,spreadPerc:{divisor:10,max:10,min:2},shareTxForMovement:{max:108e3,min:36e3},symbol:a.a[r.a.IshimaStormTechnologies]},{b:!0,initPrice:{max:19e3,min:6e3},marketCap:9e11,mv:{divisor:100,max:70,min:60},name:r.a.NewTokyoDefComm,otlkMag:10,spreadPerc:{divisor:10,max:10,min:2},shareTxForMovement:{max:108e3,min:36e3},symbol:a.a[r.a.NewTokyoDefComm]},{b:!0,initPrice:{max:18e3,min:1e4},marketCap:825e9,mv:{divisor:100,max:65,min:55},name:r.a.VolhavenHeliosLabs,otlkMag:9,spreadPerc:{divisor:10,max:10,min:2},shareTxForMovement:{max:108e3,min:36e3},symbol:a.a[r.a.VolhavenHeliosLabs]},{b:!0,initPrice:{max:14e3,min:8e3},marketCap:1e12,mv:{divisor:100,max:80,min:70},name:r.a.NewTokyoVitaLife,otlkMag:7,spreadPerc:{divisor:10,max:10,min:2},shareTxForMovement:{max:108e3,min:36e3},symbol:a.a[r.a.NewTokyoVitaLife]},{b:!0,initPrice:{max:24e3,min:12e3},marketCap:8e11,mv:{divisor:100,max:70,min:60},name:r.a.Sector12IcarusMicrosystems,otlkMag:7.5,spreadPerc:{divisor:10,max:10,min:3},shareTxForMovement:{max:108e3,min:36e3},symbol:a.a[r.a.Sector12IcarusMicrosystems]},{b:!0,initPrice:{max:29e3,min:16e3},marketCap:9e11,mv:{divisor:100,max:60,min:50},name:r.a.Sector12UniversalEnergy,otlkMag:10,spreadPerc:{divisor:10,max:10,min:2},shareTxForMovement:{max:108e3,min:36e3},symbol:a.a[r.a.Sector12UniversalEnergy]},{b:!0,initPrice:{max:17e3,min:8e3},marketCap:64e10,mv:{divisor:100,max:65,min:55},name:r.a.AevumAeroCorp,otlkMag:6,spreadPerc:{divisor:10,max:10,min:3},shareTxForMovement:{max:126e3,min:42e3},symbol:a.a[r.a.AevumAeroCorp]},{b:!0,initPrice:{max:15e3,min:6e3},marketCap:6e11,mv:{divisor:100,max:75,min:65},name:r.a.VolhavenOmniaCybersystems,otlkMag:4.5,spreadPerc:{divisor:10,max:11,min:4},shareTxForMovement:{max:126e3,min:42e3},symbol:a.a[r.a.VolhavenOmniaCybersystems]},{b:!0,initPrice:{max:28e3,min:14e3},marketCap:705e9,mv:{divisor:100,max:80,min:70},name:r.a.ChongqingSolarisSpaceSystems,otlkMag:8.5,spreadPerc:{divisor:10,max:12,min:4},shareTxForMovement:{max:126e3,min:42e3},symbol:a.a[r.a.ChongqingSolarisSpaceSystems]},{b:!0,initPrice:{max:3e4,min:12e3},marketCap:695e9,mv:{divisor:100,max:65,min:55},name:r.a.NewTokyoGlobalPharmaceuticals,otlkMag:10.5,spreadPerc:{divisor:10,max:10,min:4},shareTxForMovement:{max:126e3,min:42e3},symbol:a.a[r.a.NewTokyoGlobalPharmaceuticals]},{b:!0,initPrice:{max:27e3,min:15e3},marketCap:6e11,mv:{divisor:100,max:80,min:70},name:r.a.IshimaNovaMedical,otlkMag:5,spreadPerc:{divisor:10,max:11,min:4},shareTxForMovement:{max:126e3,min:42e3},symbol:a.a[r.a.IshimaNovaMedical]},{b:!0,initPrice:{max:8500,min:4e3},marketCap:45e10,mv:{divisor:100,max:260,min:240},name:r.a.AevumWatchdogSecurity,otlkMag:1.5,spreadPerc:{divisor:10,max:12,min:5},shareTxForMovement:{max:54e3,min:12e3},symbol:a.a[r.a.AevumWatchdogSecurity]},{b:!0,initPrice:{max:8e3,min:4500},marketCap:3e11,mv:{divisor:100,max:135,min:115},name:r.a.VolhavenLexoCorp,otlkMag:6,spreadPerc:{divisor:10,max:12,min:5},shareTxForMovement:{max:108e3,min:36e3},symbol:a.a[r.a.VolhavenLexoCorp]},{b:!0,initPrice:{max:7e3,min:2e3},marketCap:18e10,mv:{divisor:100,max:70,min:50},name:r.a.AevumRhoConstruction,otlkMag:1,spreadPerc:{divisor:10,max:10,min:3},shareTxForMovement:{max:126e3,min:6e4},symbol:a.a[r.a.AevumRhoConstruction]},{b:!0,initPrice:{max:8500,min:4e3},marketCap:24e10,mv:{divisor:100,max:205,min:175},name:r.a.Sector12AlphaEnterprises,otlkMag:10,spreadPerc:{divisor:10,max:16,min:5},shareTxForMovement:{max:9e4,min:3e4},symbol:a.a[r.a.Sector12AlphaEnterprises]},{b:!0,initPrice:{max:8e3,min:3e3},marketCap:2e11,mv:{divisor:100,max:170,min:150},name:r.a.VolhavenSysCoreSecurities,otlkMag:3,spreadPerc:{divisor:10,max:12,min:5},shareTxForMovement:{max:9e4,min:15e3},symbol:a.a[r.a.VolhavenSysCoreSecurities]},{b:!0,initPrice:{max:6e3,min:1e3},marketCap:185e9,mv:{divisor:100,max:100,min:80},name:r.a.VolhavenCompuTek,otlkMag:4,spreadPerc:{divisor:10,max:12,min:4},shareTxForMovement:{max:126e3,min:6e4},symbol:a.a[r.a.VolhavenCompuTek]},{b:!0,initPrice:{max:5e3,min:1e3},marketCap:58e9,mv:{divisor:100,max:400,min:200},name:r.a.AevumNetLinkTechnologies,otlkMag:1,spreadPerc:{divisor:10,max:20,min:5},shareTxForMovement:{max:54e3,min:18e3},symbol:a.a[r.a.AevumNetLinkTechnologies]},{b:!0,initPrice:{max:8e3,min:1e3},marketCap:6e10,mv:{divisor:100,max:110,min:90},name:r.a.IshimaOmegaSoftware,otlkMag:.5,spreadPerc:{divisor:10,max:13,min:4},shareTxForMovement:{max:9e4,min:3e4},symbol:a.a[r.a.IshimaOmegaSoftware]},{b:!1,initPrice:{max:4500,min:500},marketCap:45e9,mv:{divisor:100,max:80,min:70},name:r.a.Sector12FoodNStuff,otlkMag:1,spreadPerc:{divisor:10,max:10,min:6},shareTxForMovement:{max:18e4,min:6e4},symbol:a.a[r.a.Sector12FoodNStuff]},{b:!0,initPrice:{max:3500,min:1500},marketCap:3e10,mv:{divisor:100,max:275,min:100},name:"Sigma Cosmetics",otlkMag:0,spreadPerc:{divisor:10,max:14,min:6},shareTxForMovement:{max:7e4,min:2e4},symbol:a.a["Sigma Cosmetics"]},{b:!0,initPrice:{max:1500,min:250},marketCap:42e9,mv:{divisor:100,max:350,min:200},name:r.a.Sector12JoesGuns,otlkMag:1,spreadPerc:{divisor:10,max:14,min:6},shareTxForMovement:{max:52e3,min:15e3},symbol:a.a[r.a.Sector12JoesGuns]},{b:!0,initPrice:{max:1500,min:250},marketCap:1e11,mv:{divisor:100,max:175,min:120},name:"Catalyst Ventures",otlkMag:13.5,spreadPerc:{divisor:10,max:14,min:5},shareTxForMovement:{max:72e3,min:24e3},symbol:a.a["Catalyst Ventures"]},{b:!0,initPrice:{max:3e4,min:15e3},marketCap:36e10,mv:{divisor:100,max:80,min:70},name:"Microdyne Technologies",otlkMag:8,spreadPerc:{divisor:10,max:10,min:3},shareTxForMovement:{max:216e3,min:9e4},symbol:a.a["Microdyne Technologies"]},{b:!0,initPrice:{max:24e3,min:12e3},marketCap:42e10,mv:{divisor:100,max:70,min:50},name:"Titan Laboratories",otlkMag:11,spreadPerc:{divisor:10,max:10,min:2},shareTxForMovement:{max:216e3,min:9e4},symbol:a.a["Titan Laboratories"]}]},,function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(4),r=n(187),i=n(530),o=n(82),s=n(242),l=n(229);function c(t,e){const n=function(e){const n=t.gang;if(null===n)throw new Error("Must have joined gang");if(!(n instanceof i.a))throw e.makeRuntimeErrorMsg("You do not currently have a Gang")},c=function(e,n){const a=t.gang;if(null===a)throw new Error("Must have joined gang");for(const t of a.members)if(t.name===n)return t;throw e.makeRuntimeErrorMsg(`Invalid gang member: '${n}'`)};return{createGang:e=>n=>{const i=e.helper.string("faction",n);if(!t.canAccessGang()||!r.a.Names.includes(i))return!1;if(t.inGang())return!1;if(!t.factions.includes(i))return!1;const o=i===a.a.NiteSec||i===a.a.TheBlackHand;return t.startGang(i,o),!0},inGang:()=>()=>t.inGang(),getMemberNames:e=>()=>{n(e);const a=t.gang;if(null===a)throw new Error("Should not be called without Gang");return a.members.map(t=>t.name)},getGangInformation:e=>()=>{n(e);const a=t.gang;if(null===a)throw new Error("Should not be called without Gang");return{faction:a.facName,isHacking:a.isHackingGang,moneyGainRate:a.moneyGainRate,power:a.getPower(),respect:a.respect,respectGainRate:a.respectGainRate,territory:a.getTerritory(),territoryClashChance:a.territoryClashChance,territoryWarfareEngaged:a.territoryWarfareEngaged,wantedLevel:a.wanted,wantedLevelGainRate:a.wantedGainRate,wantedPenalty:a.getWantedPenalty()}},getOtherGangInformation:t=>()=>{n(t);const e={};for(const t of Object.keys(o.a))e[t]=Object.assign({},o.a[t]);return e},getMemberInformation:e=>a=>{const r=e.helper.string("memberName",a);n(e);const i=t.gang;if(null===i)throw new Error("Should not be called without Gang");const o=c(e,r);return{name:o.name,task:o.task,earnedRespect:o.earnedRespect,hack:o.hack,str:o.str,def:o.def,dex:o.dex,agi:o.agi,cha:o.cha,hack_exp:o.hack_exp,str_exp:o.str_exp,def_exp:o.def_exp,dex_exp:o.dex_exp,agi_exp:o.agi_exp,cha_exp:o.cha_exp,hack_mult:o.hack_mult,str_mult:o.str_mult,def_mult:o.def_mult,dex_mult:o.dex_mult,agi_mult:o.agi_mult,cha_mult:o.cha_mult,hack_asc_mult:o.calculateAscensionMult(o.hack_asc_points),str_asc_mult:o.calculateAscensionMult(o.str_asc_points),def_asc_mult:o.calculateAscensionMult(o.def_asc_points),dex_asc_mult:o.calculateAscensionMult(o.dex_asc_points),agi_asc_mult:o.calculateAscensionMult(o.agi_asc_points),cha_asc_mult:o.calculateAscensionMult(o.cha_asc_points),hack_asc_points:o.hack_asc_points,str_asc_points:o.str_asc_points,def_asc_points:o.def_asc_points,dex_asc_points:o.dex_asc_points,agi_asc_points:o.agi_asc_points,cha_asc_points:o.cha_asc_points,upgrades:o.upgrades.slice(),augmentations:o.augmentations.slice(),respectGain:o.calculateRespectGain(i),wantedLevelGain:o.calculateWantedLevelGain(i),moneyGain:o.calculateMoneyGain(i)}},canRecruitMember:e=>()=>{n(e);const a=t.gang;if(null===a)throw new Error("Should not be called without Gang");return a.canRecruitMember()},recruitMember:a=>r=>{const i=a.helper.string("memberName",r);n(a);const o=t.gang;if(null===o)throw new Error("Should not be called without Gang");const s=o.recruitMember(i);return s?e.log("gang.recruitMember",()=>`Successfully recruited Gang Member '${i}'`):e.log("gang.recruitMember",()=>`Failed to recruit Gang Member '${i}'`),s},getTaskNames:e=>()=>{n(e);const a=t.gang;if(null===a)throw new Error("Should not be called without Gang");const r=a.getAllTaskNames();return r.unshift("Unassigned"),r},setMemberTask:a=>(r,i)=>{const o=a.helper.string("memberName",r),s=a.helper.string("taskName",i);n(a);const l=c(a,o),f=t.gang;if(null===f)throw new Error("Should not be called without Gang");if(!f.getAllTaskNames().includes(s))return e.log("gang.setMemberTask",()=>`Failed to assign Gang Member '${o}' to Invalid task '${s}'. '${o}' is now Unassigned`),l.assignToTask("Unassigned");const u=l.assignToTask(s);return u?e.log("gang.setMemberTask",()=>`Successfully assigned Gang Member '${o}' to '${s}' task`):e.log("gang.setMemberTask",()=>`Failed to assign Gang Member '${o}' to '${s}' task. '${o}' is now Unassigned`),u},getTaskStats:t=>e=>{const a=t.helper.string("taskName",e);n(t);const r=function(t,e){const n=s.a[e];if(!n)throw t.makeRuntimeErrorMsg(`Invalid task: '${e}'`);return n}(t,a),i=Object.assign({},r);return i.territory=Object.assign({},r.territory),i},getEquipmentNames:t=>()=>(n(t),Object.keys(l.a)),getEquipmentCost:e=>a=>{const r=e.helper.string("equipName",a);n(e);const i=t.gang;if(null===i)throw new Error("Should not be called without Gang");const o=l.a[r];return null===o?1/0:i.getUpgradeCost(o)},getEquipmentType:t=>e=>{const a=t.helper.string("equipName",e);n(t);const r=l.a[a];return null==r?"":r.getType()},getEquipmentStats:t=>e=>{const a=t.helper.string("equipName",e);n(t);const r=l.a[a];if(!r)throw t.makeRuntimeErrorMsg("Invalid equipment: "+a);const i=r.mults;return Object.assign({},i)},purchaseEquipment:a=>(r,i)=>{const o=a.helper.string("memberName",r),s=a.helper.string("equipName",i);n(a);const f=t.gang;if(null===f)throw new Error("Should not be called without Gang");const u=c(a,o),m=l.a[s];if(!m)return!1;const h=u.buyUpgrade(m,t,f);return h?e.log("gang.purchaseEquipment",()=>`Purchased '${s}' for Gang member '${o}'`):e.log("gang.purchaseEquipment",()=>`Failed to purchase '${s}' for Gang member '${o}'`),h},ascendMember:a=>r=>{const i=a.helper.string("memberName",r);n(a);const o=t.gang;if(null===o)throw new Error("Should not be called without Gang");const s=c(a,i);if(s.canAscend())return o.ascendMember(s,e)},getAscensionResult:e=>a=>{const r=e.helper.string("memberName",a);n(e);if(null===t.gang)throw new Error("Should not be called without Gang");const i=c(e,r);if(i.canAscend())return{respect:i.earnedRespect,...i.getAscensionResults()}},setTerritoryWarfare:a=>r=>{const i=a.helper.boolean(r);n(a);const o=t.gang;if(null===o)throw new Error("Should not be called without Gang");i?(o.territoryWarfareEngaged=!0,e.log("gang.setTerritoryWarfare",()=>"Engaging in Gang Territory Warfare")):(o.territoryWarfareEngaged=!1,e.log("gang.setTerritoryWarfare",()=>"Disengaging in Gang Territory Warfare"))},getChanceToWinClash:e=>a=>{const r=e.helper.string("otherGang",a);n(e);const i=t.gang;if(null===i)throw new Error("Should not be called without Gang");if(null==o.a[r])throw e.makeRuntimeErrorMsg("Invalid gang: "+r);const s=o.a[i.facName].power;return s/(o.a[r].power+s)},getBonusTime:e=>()=>{n(e);const a=t.gang;if(null===a)throw new Error("Should not be called without Gang");return 1e3*Math.round(a.storedCycles/5)}}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a=[{desc:"This gang member is currently idle",isCombat:!0,isHacking:!0,name:"Unassigned",params:{hackWeight:100}},{desc:"Assign this gang member to create and distribute ransomware

Earns money - Slightly increases respect - Slightly increases wanted level",isCombat:!1,isHacking:!0,name:"Ransomware",params:{baseRespect:5e-5,baseWanted:1e-4,baseMoney:3,hackWeight:100,difficulty:1}},{desc:"Assign this gang member to attempt phishing scams and attacks

Earns money - Slightly increases respect - Slightly increases wanted level",isCombat:!1,isHacking:!0,name:"Phishing",params:{baseRespect:8e-5,baseWanted:.003,baseMoney:7.5,hackWeight:85,chaWeight:15,difficulty:3.5}},{desc:"Assign this gang member to attempt identity theft

Earns money - Increases respect - Increases wanted level",isCombat:!1,isHacking:!0,name:"Identity Theft",params:{baseRespect:1e-4,baseWanted:.075,baseMoney:18,hackWeight:80,chaWeight:20,difficulty:5}},{desc:"Assign this gang member to carry out DDoS attacks

Increases respect - Increases wanted level",isCombat:!1,isHacking:!0,name:"DDoS Attacks",params:{baseRespect:4e-4,baseWanted:.2,hackWeight:100,difficulty:8}},{desc:"Assign this gang member to create and distribute malicious viruses

Increases respect - Increases wanted level",isCombat:!1,isHacking:!0,name:"Plant Virus",params:{baseRespect:6e-4,baseWanted:.4,hackWeight:100,difficulty:12}},{desc:"Assign this gang member to commit financial fraud and digital counterfeiting

Earns money - Slightly increases respect - Slightly increases wanted level",isCombat:!1,isHacking:!0,name:"Fraud & Counterfeiting",params:{baseRespect:4e-4,baseWanted:.3,baseMoney:45,hackWeight:80,chaWeight:20,difficulty:20}},{desc:"Assign this gang member to launder money

Earns money - Increases respect - Increases wanted level",isCombat:!1,isHacking:!0,name:"Money Laundering",params:{baseRespect:.001,baseWanted:1.25,baseMoney:360,hackWeight:75,chaWeight:25,difficulty:25}},{desc:"Assign this gang member to commit acts of cyberterrorism

Greatly increases respect - Greatly increases wanted level",isCombat:!1,isHacking:!0,name:"Cyberterrorism",params:{baseRespect:.01,baseWanted:6,hackWeight:80,chaWeight:20,difficulty:36}},{desc:"Assign this gang member to be an ethical hacker for corporations

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

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

Earns money - Slightly increases respect - Slightly increases wanted level - Scales slightly with territory",isCombat:!0,isHacking:!1,name:"Deal Drugs",params:{baseRespect:6e-5,baseWanted:.002,baseMoney:15,agiWeight:20,dexWeight:20,chaWeight:60,difficulty:3.5,territory:{money:1.2,respect:1,wanted:1.15}}},{desc:"Assign this gang member to extort civilians in your territory

Earns money - Slightly increases respect - Increases wanted - Scales heavily with territory",isCombat:!0,isHacking:!1,name:"Strongarm Civilians",params:{baseRespect:4e-5,baseWanted:.02,baseMoney:7.5,hackWeight:10,strWeight:25,defWeight:25,dexWeight:20,agiWeight:10,chaWeight:10,difficulty:5,territory:{money:1.6,respect:1.1,wanted:1.5}}},{desc:"Assign this gang member to run cons

Earns money - Increases respect - Increases wanted level",isCombat:!0,isHacking:!1,name:"Run a Con",params:{baseRespect:12e-5,baseWanted:.05,baseMoney:45,strWeight:5,defWeight:5,agiWeight:25,dexWeight:25,chaWeight:40,difficulty:14}},{desc:"Assign this gang member to commit armed robbery on stores, banks and armored cars

Earns money - Increases respect - Increases wanted level",isCombat:!0,isHacking:!1,name:"Armed Robbery",params:{baseRespect:14e-5,baseWanted:.1,baseMoney:114,hackWeight:20,strWeight:15,defWeight:15,agiWeight:10,dexWeight:20,chaWeight:20,difficulty:20}},{desc:"Assign this gang member to traffick illegal arms

Earns money - Increases respect - Increases wanted level - Scales heavily with territory",isCombat:!0,isHacking:!1,name:"Traffick Illegal Arms",params:{baseRespect:2e-4,baseWanted:.24,baseMoney:174,hackWeight:15,strWeight:20,defWeight:20,dexWeight:20,chaWeight:25,difficulty:32,territory:{money:1.4,respect:1.3,wanted:1.25}}},{desc:"Assign this gang member to threaten and black mail high-profile targets

Earns money - Slightly increases respect - Slightly increases wanted level",isCombat:!0,isHacking:!1,name:"Threaten & Blackmail",params:{baseRespect:2e-4,baseWanted:.125,baseMoney:72,hackWeight:25,strWeight:25,dexWeight:25,chaWeight:25,difficulty:28}},{desc:"Assign this gang member to engage in human trafficking operations

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

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

Decreases wanted level",isCombat:!0,isHacking:!0,name:"Vigilante Justice",params:{baseWanted:-.001,hackWeight:20,strWeight:20,defWeight:20,dexWeight:20,agiWeight:20,difficulty:1,territory:{money:1,respect:1,wanted:.9}}},{desc:"Assign this gang member to increase their combat stats (str, def, dex, agi)",isCombat:!0,isHacking:!0,name:"Train Combat",params:{strWeight:25,defWeight:25,dexWeight:25,agiWeight:25,difficulty:100}},{desc:"Assign this gang member to train their hacking skills",isCombat:!0,isHacking:!0,name:"Train Hacking",params:{hackWeight:100,difficulty:45}},{desc:"Assign this gang member to train their charisma",isCombat:!0,isHacking:!0,name:"Train Charisma",params:{chaWeight:100,difficulty:8}},{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.",isCombat:!0,isHacking:!0,name:"Territory Warfare",params:{hackWeight:15,strWeight:20,defWeight:20,dexWeight:20,agiWeight:20,chaWeight:5,difficulty:5}}]},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(599),r=n(242),i=n(229),o=n(28),s=n(203);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=""){l(this,"task","Unassigned"),l(this,"earnedRespect",0),l(this,"hack",1),l(this,"str",1),l(this,"def",1),l(this,"dex",1),l(this,"agi",1),l(this,"cha",1),l(this,"hack_exp",0),l(this,"str_exp",0),l(this,"def_exp",0),l(this,"dex_exp",0),l(this,"agi_exp",0),l(this,"cha_exp",0),l(this,"hack_mult",1),l(this,"str_mult",1),l(this,"def_mult",1),l(this,"dex_mult",1),l(this,"agi_mult",1),l(this,"cha_mult",1),l(this,"hack_asc_points",0),l(this,"str_asc_points",0),l(this,"def_asc_points",0),l(this,"dex_asc_points",0),l(this,"agi_asc_points",0),l(this,"cha_asc_points",0),l(this,"upgrades",[]),l(this,"augmentations",[]),this.name=t}calculateSkill(t,e=1){return Math.max(Math.floor(e*(32*Math.log(t+534.5)-200)),1)}calculateAscensionMult(t){return Object(s.a)(t)}updateSkillLevels(){this.hack=this.calculateSkill(this.hack_exp,this.hack_mult*this.calculateAscensionMult(this.hack_asc_points)),this.str=this.calculateSkill(this.str_exp,this.str_mult*this.calculateAscensionMult(this.str_asc_points)),this.def=this.calculateSkill(this.def_exp,this.def_mult*this.calculateAscensionMult(this.def_asc_points)),this.dex=this.calculateSkill(this.dex_exp,this.dex_mult*this.calculateAscensionMult(this.dex_asc_points)),this.agi=this.calculateSkill(this.agi_exp,this.agi_mult*this.calculateAscensionMult(this.agi_asc_points)),this.cha=this.calculateSkill(this.cha_exp,this.cha_mult*this.calculateAscensionMult(this.cha_asc_points))}calculatePower(){return(this.hack+this.str+this.def+this.dex+this.agi+this.cha)/95}assignToTask(t){return r.a.hasOwnProperty(t)?(this.task=t,!0):(this.task="Unassigned",!1)}unassignFromTask(){this.task="Unassigned"}getTask(){return this.task instanceof a.a&&(this.task=this.task.name),r.a.hasOwnProperty(this.task)?r.a[this.task]:r.a.Unassigned}calculateRespectGain(t){const e=this.getTask(),n={respect:t.respect,wantedLevel:t.wanted,territory:t.getTerritory()};return Object(s.d)(n,this,e)}calculateWantedLevelGain(t){const e=this.getTask(),n={respect:t.respect,wantedLevel:t.wanted,territory:t.getTerritory()};return Object(s.e)(n,this,e)}calculateMoneyGain(t){const e=this.getTask(),n={respect:t.respect,wantedLevel:t.wanted,territory:t.getTerritory()};return Object(s.c)(n,this,e)}expMult(){return{hack:(this.hack_mult-1)/4+1,str:(this.str_mult-1)/4+1,def:(this.def_mult-1)/4+1,dex:(this.dex_mult-1)/4+1,agi:(this.agi_mult-1)/4+1,cha:(this.cha_mult-1)/4+1}}gainExperience(t=1){const e=this.getTask();if(e===r.a.Unassigned)return;const n=Math.pow(e.difficulty,.9)*t,a=this.expMult();this.hack_exp+=e.hackWeight/1500*n*a.hack*this.calculateAscensionMult(this.hack_asc_points),this.str_exp+=e.strWeight/1500*n*a.str*this.calculateAscensionMult(this.str_asc_points),this.def_exp+=e.defWeight/1500*n*a.def*this.calculateAscensionMult(this.def_asc_points),this.dex_exp+=e.dexWeight/1500*n*a.dex*this.calculateAscensionMult(this.dex_asc_points),this.agi_exp+=e.agiWeight/1500*n*a.agi*this.calculateAscensionMult(this.agi_asc_points),this.cha_exp+=e.chaWeight/1500*n*a.cha*this.calculateAscensionMult(this.cha_asc_points)}recordEarnedRespect(t=1,e){this.earnedRespect+=this.calculateRespectGain(e)*t}getGainedAscensionPoints(){return{hack:Object(s.b)(this.hack_exp),str:Object(s.b)(this.str_exp),def:Object(s.b)(this.def_exp),dex:Object(s.b)(this.dex_exp),agi:Object(s.b)(this.agi_exp),cha:Object(s.b)(this.cha_exp)}}canAscend(){const t=this.getGainedAscensionPoints();return t.hack>0||t.str>0||t.def>0||t.dex>0||t.agi>0||t.cha>0}getCurrentAscensionMults(){return{hack:this.calculateAscensionMult(this.hack_asc_points),str:this.calculateAscensionMult(this.str_asc_points),def:this.calculateAscensionMult(this.def_asc_points),dex:this.calculateAscensionMult(this.dex_asc_points),agi:this.calculateAscensionMult(this.agi_asc_points),cha:this.calculateAscensionMult(this.cha_asc_points)}}getAscensionMultsAfterAscend(){const t=this.getGainedAscensionPoints();return{hack:this.calculateAscensionMult(this.hack_asc_points+t.hack),str:this.calculateAscensionMult(this.str_asc_points+t.str),def:this.calculateAscensionMult(this.def_asc_points+t.def),dex:this.calculateAscensionMult(this.dex_asc_points+t.dex),agi:this.calculateAscensionMult(this.agi_asc_points+t.agi),cha:this.calculateAscensionMult(this.cha_asc_points+t.cha)}}getAscensionResults(){const t=this.getAscensionMultsAfterAscend(),e=this.getCurrentAscensionMults();return{hack:t.hack/e.hack,str:t.str/e.str,def:t.def/e.def,dex:t.dex/e.dex,agi:t.agi/e.agi,cha:t.cha/e.cha}}ascend(){const t=this.getAscensionResults(),e=this.getGainedAscensionPoints();this.hack_asc_points+=e.hack,this.str_asc_points+=e.str,this.def_asc_points+=e.def,this.dex_asc_points+=e.dex,this.agi_asc_points+=e.agi,this.cha_asc_points+=e.cha,this.upgrades.length=0,this.hack_mult=1,this.str_mult=1,this.def_mult=1,this.dex_mult=1,this.agi_mult=1,this.cha_mult=1;for(let t=0;t")}getType(){switch(this.type){case a.a.Weapon:return"Weapon";case a.a.Armor:return"Armor";case a.a.Vehicle:return"Vehicle";case a.a.Rootkit:return"Rootkit";case a.a.Augmentation:return"Augmentation";default:return""}}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(4);const r={[a.a.SlumSnakes]:1,[a.a.Tetrads]:2,[a.a.TheSyndicate]:2,[a.a.TheDarkArmy]:2,[a.a.SpeakersForTheDead]:5,[a.a.NiteSec]:2,[a.a.TheBlackHand]:5}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(188),r=n(66),i=n(600),o=n(79),s=n(15),l=n(379),c=n(370);function f(t){const e=function(e){if(10!==t.bitNodeN&&!t.sourceFileLvl(10))throw e.makeRuntimeErrorMsg("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=function(e,n){if(n>=t.sleeves.length||n<0){const t="Invalid sleeve number: "+n;throw e.log(()=>t),e.makeRuntimeErrorMsg(t)}},f=function(e){const n=t.sleeves[e];return{shock:100-n.shock,sync:n.sync,hacking:n.hacking,strength:n.strength,defense:n.defense,dexterity:n.dexterity,agility:n.agility,charisma:n.charisma}};return{getNumSleeves:n=>()=>(e(n),t.sleeves.length),setToShockRecovery:a=>r=>{const i=a.helper.number("sleeveNumber",r);return e(a),n(a,i),t.sleeves[i].shockRecovery(t)},setToSynchronize:a=>r=>{const i=a.helper.number("sleeveNumber",r);return e(a),n(a,i),t.sleeves[i].synchronize(t)},setToCommitCrime:a=>(r,i)=>{const o=a.helper.number("sleeveNumber",r),s=a.helper.string("crimeName",i);e(a),n(a,o);const c=Object(l.b)(s);return null!==c&&t.sleeves[o].commitCrime(t,c.name)},setToUniversityCourse:a=>(r,i,o)=>{const s=a.helper.number("sleeveNumber",r),l=a.helper.string("universityName",i),c=a.helper.string("className",o);return e(a),n(a,s),t.sleeves[s].takeUniversityCourse(t,l,c)},travel:a=>(r,i)=>{const o=a.helper.number("sleeveNumber",r),l=a.helper.string("cityName",i);if(e(a),n(a,o),Object(c.a)(s.a,l))return t.sleeves[o].travel(t,l);throw a.makeRuntimeErrorMsg(`Invalid city name: '${l}'.`)},setToCompanyWork:a=>(i,o)=>{const s=a.helper.number("sleeveNumber",i),l=a.helper.string("companyName",o);e(a),n(a,s);for(let e=0;e(i,o,s)=>{const l=a.helper.number("sleeveNumber",i),c=a.helper.string("factionName",o),f=a.helper.string("workType",s);e(a),n(a,l);for(let e=0;e(r,i,o)=>{const s=a.helper.number("sleeveNumber",r),l=a.helper.string("gymName",i),c=a.helper.string("stat",o);return e(a),n(a,s),t.sleeves[s].workoutAtGym(t,l,c)},getSleeveStats:t=>a=>{const r=t.helper.number("sleeveNumber",a);return e(t),n(t,r),f(r)},getTask:i=>o=>{const s=i.helper.number("sleeveNumber",o);e(i),n(i,s);const l=t.sleeves[s];return{task:r.a[l.currentTask],crime:l.crimeType,location:l.currentTaskLocation,gymStatType:l.gymStatType,factionWorkType:a.a[l.factionWorkType],className:l.className}},getInformation:a=>r=>{const i=a.helper.number("sleeveNumber",r);e(a),n(a,i);const o=t.sleeves[i];return{tor:!1,city:o.city,hp:o.hp,jobs:Object.keys(t.jobs),jobTitle:Object.values(t.jobs),maxHp:o.max_hp,mult:{agility:o.agility_mult,agilityExp:o.agility_exp_mult,charisma:o.charisma_mult,charismaExp:o.charisma_exp_mult,companyRep:o.company_rep_mult,crimeMoney:o.crime_money_mult,crimeSuccess:o.crime_success_mult,defense:o.defense_mult,defenseExp:o.defense_exp_mult,dexterity:o.dexterity_mult,dexterityExp:o.dexterity_exp_mult,factionRep:o.faction_rep_mult,hacking:o.hacking_mult,hackingExp:o.hacking_exp_mult,strength:o.strength_mult,strengthExp:o.strength_exp_mult,workMoney:o.work_money_mult},timeWorked:o.currentTaskTime,earningsForSleeves:{workHackExpGain:o.earningsForSleeves.hack,workStrExpGain:o.earningsForSleeves.str,workDefExpGain:o.earningsForSleeves.def,workDexExpGain:o.earningsForSleeves.dex,workAgiExpGain:o.earningsForSleeves.agi,workChaExpGain:o.earningsForSleeves.cha,workMoneyGain:o.earningsForSleeves.money},earningsForPlayer:{workHackExpGain:o.earningsForPlayer.hack,workStrExpGain:o.earningsForPlayer.str,workDefExpGain:o.earningsForPlayer.def,workDexExpGain:o.earningsForPlayer.dex,workAgiExpGain:o.earningsForPlayer.agi,workChaExpGain:o.earningsForPlayer.cha,workMoneyGain:o.earningsForPlayer.money},earningsForTask:{workHackExpGain:o.earningsForTask.hack,workStrExpGain:o.earningsForTask.str,workDefExpGain:o.earningsForTask.def,workDexExpGain:o.earningsForTask.dex,workAgiExpGain:o.earningsForTask.agi,workChaExpGain:o.earningsForTask.cha,workMoneyGain:o.earningsForTask.money},workRepGain:o.getRepGain(t)}},getSleeveAugmentations:a=>r=>{const i=a.helper.number("sleeveNumber",r);e(a),n(a,i);const o=[];for(let e=0;er=>{const o=a.helper.number("sleeveNumber",r);e(a),n(a,o);const s=Object(i.a)(t.sleeves[o],t),l=[];for(let t=0;t(r,i)=>{const s=a.helper.number("sleeveNumber",r),l=a.helper.string("augName",i);if(e(a),n(a,s),f(s).shock>0)throw a.makeRuntimeErrorMsg("Sleeve shock too high: Sleeve "+s);const c=o.a[l];if(!c)throw a.makeRuntimeErrorMsg("Invalid aug: "+l);return t.sleeves[s].tryBuyAugmentation(t,c)},setToBladeburnerAction:a=>(i,o,s)=>{const l=a.helper.number("sleeveNumber",i),c=a.helper.string("action",o);let f;if(f=void 0===s?"------":a.helper.string("contract",s),e(a),n(a,l),"Take on contracts"===c)for(let e=0;e()=>t.karma},openDevMenu:()=>()=>{i.b.emit()},exploit:()=>()=>{t.giveExploit(a.a.UndocumentedFunctionCall)},bypass:e=>n=>{const r=n;r.completely_unused_field=void 0;const i=document;i.completely_unused_field=void 0,i.completely_unused_field=!0,r.completely_unused_field&&1.6===e.workerScript.ramUsage&&t.giveExploit(a.a.Bypass),r.completely_unused_field=void 0,i.completely_unused_field=void 0},alterReality:()=>()=>{let e=!1;const n=function(t){0!==t&&(e=!e,n(t-1))};n(2),console.warn("I am sure that this variable is false."),!1!==e&&(console.warn("Reality has been altered!"),t.giveExploit(a.a.RealityAlteration))},rainbow:e=>n=>!!r.compareSync(e.helper.string("guess",n),"$2a$10$aertxDEkgor8baVtQDZsLuMwwGYmkRM/ohcA6FjmmzIHQeTCsrCcO")&&(t.giveExploit(a.a.INeedARainbow),!0)}}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(41),r=n(56),i=n(92),o=n(223),s=n(241),l=n(24);function c(t,e){const n=function(e,n){if(n<0||n>=t.hacknetNodes.length)throw e.makeRuntimeErrorMsg("Index specified for Hacknet Node is out-of-bounds: "+n);if(Object(r.g)(t)){const a=t.hacknetNodes[n];if("string"!=typeof a)throw new Error("hacknet node was not a string");const r=Object(l.d)(a);if(!(r instanceof i.a))throw new Error("hacknet server was not actually hacknet server");if(null==r)throw e.makeRuntimeErrorMsg(`Could not get Hacknet Server for index ${n}. This is probably a bug, please report to game dev`);return r}{const e=t.hacknetNodes[n];if(!(e instanceof o.a))throw new Error("hacknet node was not node.");return e}};return{numNodes:()=>()=>t.hacknetNodes.length,maxNumNodes:()=>()=>Object(r.g)(t)?a.b.MaxServers:1/0,purchaseNode:()=>()=>Object(r.l)(t),getPurchaseNodeCost:()=>()=>Object(r.g)(t)?Object(r.b)(t):Object(r.a)(t),getNodeStats:e=>a=>{const o=e.helper.number("i",a),s=n(e,o),l=Object(r.g)(t),c={name:s instanceof i.a?s.hostname:s.name,level:s.level,ram:s instanceof i.a?s.maxRam:s.ram,ramUsed:s instanceof i.a?s.ramUsed:void 0,cores:s.cores,production:s instanceof i.a?s.hashRate:s.moneyGainRatePerSecond,timeOnline:s.onlineTimeSeconds,totalProduction:s instanceof i.a?s.totalHashesGenerated:s.totalMoneyGenerated};return l&&s instanceof i.a&&(c.cache=s.cache,c.hashCapacity=s.hashCapacity),c},upgradeLevel:e=>(a,i=1)=>{const o=e.helper.number("i",a),s=e.helper.number("n",i),l=n(e,o);return Object(r.n)(t,l,s)},upgradeRam:e=>(a,i=1)=>{const o=e.helper.number("i",a),s=e.helper.number("n",i),l=n(e,o);return Object(r.o)(t,l,s)},upgradeCore:e=>(a,i=1)=>{const o=e.helper.number("i",a),s=e.helper.number("n",i),l=n(e,o);return Object(r.k)(t,l,s)},upgradeCache:a=>(o,s=1)=>{const l=a.helper.number("i",o),c=a.helper.number("n",s);if(!Object(r.g)(t))return!1;const f=n(a,l);if(!(f instanceof i.a))return e.log("hacknet.upgradeCache",()=>"Can only be called on hacknet servers"),!1;const u=Object(r.j)(t,f,c);return u&&Object(r.p)(t),u},getLevelUpgradeCost:e=>(a,r=1)=>{const i=e.helper.number("i",a),o=e.helper.number("n",r);return n(e,i).calculateLevelUpgradeCost(o,t.hacknet_node_level_cost_mult)},getRamUpgradeCost:e=>(a,r=1)=>{const i=e.helper.number("i",a),o=e.helper.number("n",r);return n(e,i).calculateRamUpgradeCost(o,t.hacknet_node_ram_cost_mult)},getCoreUpgradeCost:e=>(a,r=1)=>{const i=e.helper.number("i",a),o=e.helper.number("n",r);return n(e,i).calculateCoreUpgradeCost(o,t.hacknet_node_core_cost_mult)},getCacheUpgradeCost:a=>(o,s=1)=>{const l=a.helper.number("i",o),c=a.helper.number("n",s);if(!Object(r.g)(t))return 1/0;const f=n(a,l);return f instanceof i.a?f.calculateCacheUpgradeCost(c):(e.log("hacknet.getCacheUpgradeCost",()=>"Can only be called on hacknet servers"),-1)},numHashes:()=>()=>Object(r.g)(t)?t.hashManager.hashes:0,hashCapacity:()=>()=>Object(r.g)(t)?t.hashManager.capacity:0,hashCost:e=>n=>{const a=e.helper.string("upgName",n);return Object(r.g)(t)?t.hashManager.getUpgradeCost(a):1/0},spendHashes:e=>(n,a="")=>{const i=e.helper.string("upgName",n),o=e.helper.string("upgTarget",a);return!!Object(r.g)(t)&&Object(r.m)(t,i,o)},getHashUpgrades:()=>()=>Object(r.g)(t)?Object.values(s.a).map(t=>t.name):[],getHashUpgradeLevel:e=>n=>{const a=e.helper.string("upgName",n),r=t.hashManager.upgrades[a];if(void 0===r)throw e.makeRuntimeErrorMsg("Invalid Hash Upgrade: "+a);return r},getStudyMult:()=>()=>Object(r.g)(t)?t.hashManager.getStudyMult():1,getTrainingMult:()=>()=>Object(r.g)(t)?t.hashManager.getTrainingMult():1}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var a=n(110),r=n(101),i=n(120),o=n(61),s=n(12),l=n(119),c=n(4),f=n(105),u=n(26);function m(t,e,n){function m(e){if(!t.hasAugmentation(s.a.StaneksGift1,!0))throw n.makeRuntimeErrorMsg(e,"Stanek's Gift is not installed")}return{giftWidth:()=>function(){return m("giftWidth"),r.c.width()},giftHeight:()=>function(){return m("giftHeight"),r.c.height()},chargeFragment:n=>function(i,s){const l=n.helper.number("rootX",i),c=n.helper.number("rootY",s);m("chargeFragment");const f=r.c.findFragment(l,c);if(!f)throw n.makeRuntimeErrorMsg(`No fragment with root (${l}, ${c}).`);if(f.fragment().type==o.b.Booster)throw n.makeRuntimeErrorMsg(`The fragment with root (${l}, ${c}) is a Booster Fragment and thus cannot be charged.`);const u=r.c.inBonus()?200:1e3;return Object(a.c)(u,e).then((function(){return r.c.charge(t,f,e.scriptRef.threads),n.log(()=>`Charged fragment with ${n.workerScript.scriptRef.threads} threads.`),Promise.resolve()}))},fragmentDefinitions:t=>function(){return m("fragmentDefinitions"),t.log(()=>`Returned ${i.c.length} fragments`),i.c.map(t=>t.copy())},activeFragments:t=>function(){return m("activeFragments"),t.log(()=>`Returned ${r.c.fragments.length} fragments`),r.c.fragments.map(t=>({...t.copy(),...t.fragment().copy()}))},clearGift:t=>function(){m("clearGift"),t.log(()=>"Cleared Stanek's Gift."),r.c.clear()},canPlaceFragment:t=>function(e,n,a,o){const s=t.helper.number("rootX",e),l=t.helper.number("rootY",n),c=t.helper.number("rotation",a),f=t.helper.number("fragmentId",o);m("canPlaceFragment");const u=Object(i.b)(f);if(!u)throw t.makeRuntimeErrorMsg("Invalid fragment id: "+f);return r.c.canPlace(s,l,c,u)},placeFragment:t=>function(e,n,a,o){const s=t.helper.number("rootX",e),l=t.helper.number("rootY",n),c=t.helper.number("rotation",a),f=t.helper.number("fragmentId",o);m("placeFragment");const u=Object(i.b)(f);if(!u)throw t.makeRuntimeErrorMsg("Invalid fragment id: "+f);return r.c.place(s,l,c,u)},getFragment:t=>function(e,n){const a=t.helper.number("rootX",e),i=t.helper.number("rootY",n);m("getFragment");const o=r.c.findFragment(a,i);if(void 0!==o)return o.copy()},removeFragment:t=>function(e,n){const a=t.helper.number("rootX",e),i=t.helper.number("rootY",n);return m("removeFragment"),r.c.delete(a,i)},acceptGift:e=>function(){return t.canAccessCotMG()&&0==t.augmentations.filter(t=>t.name!==s.a.NeuroFluxGovernor).length&&0==t.queuedAugmentations.filter(t=>t.name!==s.a.NeuroFluxGovernor).length&&(Object(f.d)(u.a[c.a.ChurchOfTheMachineGod]),t.hasAugmentation(s.a.StaneksGift1)||t.queuedAugmentations.some(t=>t.name===s.a.StaneksGift1)||Object(l.a)({name:s.a.StaneksGift1,level:1})),u.a[c.a.ChurchOfTheMachineGod].isMember&&t.hasAugmentation(s.a.StaneksGift1)}}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(18);function r(t,e,n,r){return 1+Math.log(t+1)/60*Math.pow((e+1)/5,.07)*n*r*a.a.StaneksGiftPowerMultiplier}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(186),r=n(482),i=n(384),o=n(4),s=n(26),l=n(370),c=n(9);function f(t){const e=Object.values(a.a).filter(t=>t.infiltrationData);return{getPossibleLocations:()=>()=>e.map(t=>t+""),getInfiltration:e=>n=>{const f=e.helper.string("location",n);return((e,n)=>{if(!Object(l.a)(c.a,n))throw new Error(`Location '${n}' does not exists.`);const f=a.a[n];if(void 0===f)throw e.makeRuntimeErrorMsg(`Location '${f}' does not exists.`);if(void 0===f.infiltrationData)throw e.makeRuntimeErrorMsg(`Location '${f}' does not provide infiltrations.`);const u=f.infiltrationData.startingSecurityLevel,m=Object(r.a)(t,u),h=Object(r.b)(t,u),d=f.infiltrationData.maxClearanceLevel;return{location:f,reward:{tradeRep:Object(i.c)(t,h,d,m),sellCash:Object(i.b)(t,h,d,m),SoARep:Object(i.a)(t,s.a[o.a.ShadowsOfAnarchy],m)},difficulty:m}})(e,f)}}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(6),r=n(170),i=n(337),o=n(401),s=n(10),l=n(254),c=n(84);function f(){return{getTheme:()=>()=>({...a.a.theme}),getStyles:()=>()=>({...a.a.styles}),setTheme:t=>e=>{const n=/^(#)((?:[A-Fa-f0-9]{2}){3,4}|(?:[A-Fa-f0-9]{3}))$/,i={...a.a.theme},o=[];for(const t of Object.keys(e)){var s;i[t]?n.test(null!==(s=e[t])&&void 0!==s?s:"")?i[t]=e[t]:o.push(`Invalid color "${t}": ${e[t]}`):o.push(`Invalid key "${t}"`)}0===o.length?(Object.assign(a.a.theme,i),r.b.emit(),t.log(()=>"Successfully set theme")):t.log(()=>"Failed to set theme. Errors: "+o.join(", "))},setStyles:t=>e=>{const n={...a.a.styles},i=[];for(const t of Object.keys(e))n[t]?n[t]=e[t]:i.push(`Invalid key "${t}"`);0===i.length?(Object.assign(a.a.styles,n),r.b.emit(),t.log(()=>"Successfully set styles")):t.log(()=>"Failed to set styles. Errors: "+i.join(", "))},resetTheme:t=>()=>{a.a.theme={...i.a},r.b.emit(),t.log(()=>"Reinitialized theme to default")},resetStyles:t=>()=>{a.a.styles={...o.a},r.b.emit(),t.log(()=>"Reinitialized styles to default")},getGameInfo:()=>()=>({version:s.a.VersionString,commit:Object(l.a)(),platform:navigator.userAgent.toLowerCase().indexOf(" electron/")>-1?"Steam":"Browser"}),clearTerminal:t=>()=>{t.log(()=>"Clearing terminal"),c.a.clear()}}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(210),r=n(18);function i(t,e){const n=function(e,n=!1){const r=t.bladeburner;if(null===r)throw new Error("Must have joined bladeburner");if(!(7===t.bitNodeN||t.sourceFiles.some(t=>7===t.n))){const t="You do not currently have access to the Bladeburner API. You must either be in BitNode-7 or have Source-File 7.";throw e.makeRuntimeErrorMsg(t)}if(!n){if(!(r instanceof a.a)){const t="You must be a member of the Bladeburner division to use this API.";throw e.makeRuntimeErrorMsg(t)}}},i=function(e,n){const a=t.bladeburner;if(null===a)throw new Error("Must have joined bladeburner");if(!a.cities.hasOwnProperty(n))throw e.makeRuntimeErrorMsg("Invalid city: "+n)},o=function(e,n,a){const r=t.bladeburner;if(null===r)throw new Error("Must have joined bladeburner");const i=r.getActionIdFromTypeAndName(n,a);if(!i)throw e.makeRuntimeErrorMsg(`Invalid action type='${n}', name='${a}'`);const o=r.getActionObject(i);if(!o)throw e.makeRuntimeErrorMsg(`Invalid action type='${n}', name='${a}'`);return o};return{getContractNames:e=>()=>{n(e);const a=t.bladeburner;if(null===a)throw new Error("Should not be called without Bladeburner");return a.getContractNamesNetscriptFn()},getOperationNames:e=>()=>{n(e);const a=t.bladeburner;if(null===a)throw new Error("Should not be called without Bladeburner");return a.getOperationNamesNetscriptFn()},getBlackOpNames:e=>()=>{n(e);const a=t.bladeburner;if(null===a)throw new Error("Should not be called without Bladeburner");return a.getBlackOpNamesNetscriptFn()},getBlackOpRank:t=>e=>{const a=t.helper.string("blackOpName",e);n(t);return o(t,"blackops",a).reqdRank},getGeneralActionNames:e=>()=>{n(e);const a=t.bladeburner;if(null===a)throw new Error("Should not be called without Bladeburner");return a.getGeneralActionNamesNetscriptFn()},getSkillNames:e=>()=>{n(e);const a=t.bladeburner;if(null===a)throw new Error("Should not be called without Bladeburner");return a.getSkillNamesNetscriptFn()},startAction:a=>(r,i)=>{const o=a.helper.string("type",r),s=a.helper.string("name",i);n(a);const l=t.bladeburner;if(null===l)throw new Error("Should not be called without Bladeburner");try{return l.startActionNetscriptFn(t,o,s,e)}catch(t){throw a.makeRuntimeErrorMsg(t)}},stopBladeburnerAction:e=>()=>{n(e);const a=t.bladeburner;if(null===a)throw new Error("Should not be called without Bladeburner");return a.resetAction()},getCurrentAction:e=>()=>{n(e);const a=t.bladeburner;if(null===a)throw new Error("Should not be called without Bladeburner");return a.getTypeAndNameFromActionId(a.action)},getActionTime:e=>(a,r)=>{const i=e.helper.string("type",a),o=e.helper.string("name",r);n(e);const s=t.bladeburner;if(null===s)throw new Error("Should not be called without Bladeburner");try{const n=s.getActionTimeNetscriptFn(t,i,o);if("string"==typeof n){const t=`Invalid action: type='${i}' name='${o}'`;return e.log(()=>t),-1}return n}catch(t){throw e.makeRuntimeErrorMsg(t)}},getActionCurrentTime:e=>()=>{n(e);const a=t.bladeburner;if(null===a)throw new Error("Should not be called without Bladeburner");try{return 1e3*Math.min(a.actionTimeCurrent+a.actionTimeOverflow,a.actionTimeToComplete)}catch(t){throw e.makeRuntimeErrorMsg(t)}},getActionEstimatedSuccessChance:e=>(a,r)=>{const i=e.helper.string("type",a),o=e.helper.string("name",r);n(e);const s=t.bladeburner;if(null===s)throw new Error("Should not be called without Bladeburner");try{const n=s.getActionEstimatedSuccessChanceNetscriptFn(t,i,o);if("string"==typeof n){const t=`Invalid action: type='${i}' name='${o}'`;return e.log(()=>t),[-1,-1]}return n}catch(t){throw e.makeRuntimeErrorMsg(t)}},getActionRepGain:t=>(e,a,i)=>{const s=t.helper.string("type",e),l=t.helper.string("name",a),c=t.helper.number("level",i);n(t);const f=o(t,s,l);let u;return u=null==c||isNaN(c)?Math.pow(f.rewardFac,f.level-1):Math.pow(f.rewardFac,c-1),f.rankGain*u*r.a.BladeburnerRank},getActionCountRemaining:a=>(r,i)=>{const o=a.helper.string("type",r),s=a.helper.string("name",i);n(a);const l=t.bladeburner;if(null===l)throw new Error("Should not be called without Bladeburner");try{return l.getActionCountRemainingNetscriptFn(o,s,e)}catch(t){throw a.makeRuntimeErrorMsg(t)}},getActionMaxLevel:t=>(e,a)=>{const r=t.helper.string("type",e),i=t.helper.string("name",a);n(t);return o(t,r,i).maxLevel},getActionCurrentLevel:t=>(e,a)=>{const r=t.helper.string("type",e),i=t.helper.string("name",a);n(t);return o(t,r,i).level},getActionAutolevel:t=>(e,a)=>{const r=t.helper.string("type",e),i=t.helper.string("name",a);n(t);return o(t,r,i).autoLevel},setActionAutolevel:t=>(e,a,r=!0)=>{const i=t.helper.string("type",e),s=t.helper.string("name",a),l=t.helper.boolean(r);n(t);o(t,i,s).autoLevel=l},setActionLevel:t=>(e,a,r=1)=>{const i=t.helper.string("type",e),s=t.helper.string("name",a),l=t.helper.number("level",r);n(t);const c=o(t,i,s);(l<1||l>c.maxLevel)&&t.helper.makeRuntimeErrorMsg(`Level must be between 1 and ${c.maxLevel}, is ${l}`),c.level=l},getRank:e=>()=>{n(e);const a=t.bladeburner;if(null===a)throw new Error("Should not be called without Bladeburner");return a.rank},getSkillPoints:e=>()=>{n(e);const a=t.bladeburner;if(null===a)throw new Error("Should not be called without Bladeburner");return a.skillPoints},getSkillLevel:a=>r=>{const i=a.helper.string("skillName",r);n(a);const o=t.bladeburner;if(null===o)throw new Error("Should not be called without Bladeburner");try{return o.getSkillLevelNetscriptFn(i,e)}catch(t){throw a.makeRuntimeErrorMsg(t)}},getSkillUpgradeCost:a=>r=>{const i=a.helper.string("skillName",r);n(a);const o=t.bladeburner;if(null===o)throw new Error("Should not be called without Bladeburner");try{return o.getSkillUpgradeCostNetscriptFn(i,e)}catch(t){throw a.makeRuntimeErrorMsg(t)}},upgradeSkill:a=>r=>{const i=a.helper.string("skillName",r);n(a);const o=t.bladeburner;if(null===o)throw new Error("Should not be called without Bladeburner");try{return o.upgradeSkillNetscriptFn(i,e)}catch(t){throw a.makeRuntimeErrorMsg(t)}},getTeamSize:a=>(r,i)=>{const o=a.helper.string("type",r),s=a.helper.string("name",i);n(a);const l=t.bladeburner;if(null===l)throw new Error("Should not be called without Bladeburner");try{return l.getTeamSizeNetscriptFn(o,s,e)}catch(t){throw a.makeRuntimeErrorMsg(t)}},setTeamSize:a=>(r,i,o)=>{const s=a.helper.string("type",r),l=a.helper.string("name",i),c=a.helper.number("size",o);n(a);const f=t.bladeburner;if(null===f)throw new Error("Should not be called without Bladeburner");try{return f.setTeamSizeNetscriptFn(s,l,c,e)}catch(t){throw a.makeRuntimeErrorMsg(t)}},getCityEstimatedPopulation:e=>a=>{const r=e.helper.string("cityName",a);n(e),i(e,r);const o=t.bladeburner;if(null===o)throw new Error("Should not be called without Bladeburner");return o.cities[r].popEst},getCityCommunities:e=>a=>{const r=e.helper.string("cityName",a);n(e),i(e,r);const o=t.bladeburner;if(null===o)throw new Error("Should not be called without Bladeburner");return o.cities[r].comms},getCityChaos:e=>a=>{const r=e.helper.string("cityName",a);n(e),i(e,r);const o=t.bladeburner;if(null===o)throw new Error("Should not be called without Bladeburner");return o.cities[r].chaos},getCity:e=>()=>{n(e);const a=t.bladeburner;if(null===a)throw new Error("Should not be called without Bladeburner");return a.city},switchCity:e=>a=>{const r=e.helper.string("cityName",a);n(e),i(e,r);const o=t.bladeburner;if(null===o)throw new Error("Should not be called without Bladeburner");return o.city=r,!0},getStamina:e=>()=>{n(e);const a=t.bladeburner;if(null===a)throw new Error("Should not be called without Bladeburner");return[a.stamina,a.maxStamina]},joinBladeburnerFaction:a=>()=>{n(a,!0);const r=t.bladeburner;if(null===r)throw new Error("Should not be called without Bladeburner");return r.joinBladeburnerFactionNetscriptFn(e)},joinBladeburnerDivision:e=>()=>(7===t.bitNodeN||t.sourceFileLvl(7)>0)&&(8!==t.bitNodeN&&(t.bladeburner instanceof a.a||(t.strength>=100&&t.defense>=100&&t.dexterity>=100&&t.agility>=100?(t.bladeburner=new a.a(t),e.log(()=>"You have been accepted into the Bladeburner division"),!0):(e.log(()=>"You do not meet the requirements for joining the Bladeburner division"),!1)))),getBonusTime:e=>()=>{n(e);const a=t.bladeburner;if(null===a)throw new Error("Should not be called without Bladeburner");return 1e3*Math.round(a.storedCycles/5)}}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(1047);function r(t,e){const n=function(t,e,n,a){const r=t.helper.getServer(n).getContract(a);if(null==r)throw t.makeRuntimeErrorMsg(`Cannot find contract '${a}' on server '${n}'`);return r};return{attempt:r=>(i,o,s=e.hostname,{returnReward:l}={returnReward:!1})=>{const c=r.helper.string("filename",o),f=r.helper.string("hostname",s),u=n(r,0,f,c);if(Object(a.a)(i)){const t=[];for(let e=0;e`Successfully completed Coding Contract '${c}'. Reward: ${e}`),h.removeContract(c),!l||e}return++u.tries,u.tries>=u.getMaxNumTries()?(r.log(()=>`Coding Contract attempt '${c}' failed. Contract is now self-destructing`),h.removeContract(c)):r.log(()=>`Coding Contract attempt '${c}' failed. ${u.getMaxNumTries()-u.tries} attempts remaining.`),!!l&&""},getContractType:t=>(a,r=e.hostname)=>{const i=t.helper.string("filename",a),o=t.helper.string("hostname",r);return n(t,0,o,i).getType()},getData:t=>(a,r=e.hostname)=>{const i=t.helper.string("filename",a),o=t.helper.string("hostname",r),s=n(t,0,o,i).getData();if(s.constructor===Array){const t=s.slice();for(let e=0;e(a,r=e.hostname)=>{const i=t.helper.string("filename",a),o=t.helper.string("hostname",r);return n(t,0,o,i).getDescription()},getNumTriesRemaining:t=>(a,r=e.hostname)=>{const i=t.helper.string("filename",a),o=t.helper.string("hostname",r),s=n(t,0,o,i);return s.getMaxNumTries()-s.tries}}}},function(t,e,n){"use strict";function a(t){return Array.isArray(t)}function r(t){return a(t)&&t.every(t=>a(t))}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var a=n(110),r=n(62),i=n(268),o=n(381),s=n(47),l=n(284),c=n(51),f=n(40),u=n(322),m=n(285),h=n(26),d=n(18);function p(t,e){function n(t){const e=g(),n=Object.values(i.b).find(e=>e.name===t);if(void 0===n)throw new Error(`No upgrade named '${t}'`);const a=n.index;return 1===e.unlockUpgrades[a]}function p(t,e){return void 0!==t.researched[e]&&t.researched[e]}function g(){const e=t.corporation;if(null===e)throw new Error("cannot be called without a corporation");return e}function y(t){const e=g().divisions.find(e=>e.name===t);if(void 0===e)throw new Error(`No division named '${t}'`);return e}function b(t,e){const n=y(t);if(!(e in n.offices))throw new Error(`Invalid city name '${e}'`);const a=n.offices[e];if(0===a)throw new Error(`${n.name} has not expanded to '${e}'`);return a}function E(t,e){const n=y(t);if(!(e in n.warehouses))throw new Error(`Invalid city name '${e}'`);const a=n.warehouses[e];if(0===a)throw new Error(`${n.name} has not expanded to '${e}'`);return a}function v(t,e,n){const a=E(t,e),r=n.replace(/ /g,""),i=a.materials[r];if(void 0===i)throw new Error(`Invalid material name: '${n}'`);return i}function k(t,e){const n=y(t).products[e];if(void 0===n)throw new Error(`Invalid product name: '${e}'`);return n}function _(t,e,n){const a=b(t,e).employees.find(t=>t.name===n);if(void 0===a)throw new Error(`Invalid employee name: '${n}'`);return a}function w(e,n){if(null===t.corporation)throw e.makeRuntimeErrorMsg("Must own a corporation.");if(n&&!t.corporation.unlockUpgrades[n])throw e.makeRuntimeErrorMsg("You do not have access to this API.")}function S(t){const e=[];for(const n of Object.values(t.offices))0!==n&&e.push(n.loc);return{name:t.name,type:t.type,awareness:t.awareness,popularity:t.popularity,prodMult:t.prodMult,research:t.sciResearch.qty,lastCycleRevenue:t.lastCycleRevenue,lastCycleExpenses:t.lastCycleExpenses,thisCycleRevenue:t.thisCycleRevenue,thisCycleExpenses:t.thisCycleExpenses,upgrades:t.upgrades.slice(),cities:e,products:void 0===t.products?[]:Object.keys(t.products),makesProducts:t.makesProducts}}return{...{getPurchaseWarehouseCost:t=>()=>(w(t,7),f.a.WarehouseInitialCost),getUpgradeWarehouseCost:t=>(e,n,a=1)=>{w(t,7);const i=t.helper.string("divisionName",e),o=t.helper.city("cityName",n),s=t.helper.number("amount",a);if(s<1)throw t.makeRuntimeErrorMsg("You must provide a positive number");const l=E(i,o);return Object(r.E)(l,s)},hasWarehouse:t=>(e,n)=>{w(t,7);const a=t.helper.string("divisionName",e),r=t.helper.city("cityName",n),i=y(a);if(!(r in i.warehouses))throw new Error(`Invalid city name '${r}'`);return 0!==i.warehouses[r]},getWarehouse:t=>(e,n)=>{w(t,7);const a=E(t.helper.string("divisionName",e),t.helper.city("cityName",n));return{level:a.level,loc:a.loc,size:a.size,sizeUsed:a.sizeUsed,smartSupplyEnabled:a.smartSupplyEnabled}},getMaterial:t=>(e,n,a)=>{w(t,7);const r=v(t.helper.string("divisionName",e),t.helper.city("cityName",n),t.helper.string("materialName",a)),i=g();return{cost:r.bCost,sCost:r.sCost,name:r.name,qty:r.qty,qlt:r.qlt,dmd:i.unlockUpgrades[2]?r.dmd:void 0,cmp:i.unlockUpgrades[3]?r.cmp:void 0,prod:r.prd,sell:r.sll}},getProduct:t=>(e,n)=>{w(t,7);const a=k(t.helper.string("divisionName",e),t.helper.string("productName",n)),r=g();return{name:a.name,dmd:r.unlockUpgrades[2]?a.dmd:void 0,cmp:r.unlockUpgrades[3]?a.cmp:void 0,rat:a.rat,properties:{qlt:a.qlt,per:a.per,dur:a.dur,rel:a.rel,aes:a.aes,fea:a.fea},pCost:a.pCost,sCost:a.sCost,cityData:a.data,developmentProgress:a.prog}},purchaseWarehouse:t=>(e,n)=>{w(t,7);const a=t.helper.string("divisionName",e),i=t.helper.city("cityName",n),o=g();Object(r.p)(o,y(a),i)},upgradeWarehouse:t=>(e,n,a=1)=>{w(t,7);const i=t.helper.string("divisionName",e),o=t.helper.city("cityName",n),s=t.helper.number("amount",a),l=g();if(s<1)throw t.makeRuntimeErrorMsg("You must provide a positive number");Object(r.D)(l,y(i),E(i,o),s)},sellMaterial:t=>(e,n,a,i,o)=>{w(t,7);const s=t.helper.string("divisionName",e),l=t.helper.city("cityName",n),c=t.helper.string("materialName",a),f=t.helper.string("amt",i),u=t.helper.string("price",o),m=v(s,l,c);Object(r.r)(m,f,u)},sellProduct:t=>(e,n,a,i,o,s)=>{w(t,7);const l=t.helper.string("divisionName",e),c=t.helper.city("cityName",n),f=t.helper.string("productName",a),u=t.helper.string("amt",i),m=t.helper.string("price",o),h=t.helper.boolean(s),d=k(l,f);Object(r.s)(d,c,u,m,h)},discontinueProduct:t=>(e,n)=>{w(t,7);const a=t.helper.string("divisionName",e),r=t.helper.string("productName",n);y(a).discontinueProduct(k(a,r))},setSmartSupply:t=>(e,a,i)=>{w(t,7);const o=t.helper.string("divisionName",e),s=t.helper.city("cityName",a),l=t.helper.boolean(i),c=E(o,s);if(!n("Smart Supply"))throw t.makeRuntimeErrorMsg("You have not purchased the Smart Supply upgrade!");Object(r.y)(c,l)},setSmartSupplyUseLeftovers:t=>(e,a,i,o)=>{w(t,7);const s=t.helper.string("divisionName",e),l=t.helper.city("cityName",a),c=t.helper.string("materialName",i),f=t.helper.boolean(o),u=E(s,l),m=v(s,l,c);if(!n("Smart Supply"))throw t.makeRuntimeErrorMsg("You have not purchased the Smart Supply upgrade!");Object(r.z)(u,m,f)},buyMaterial:t=>(e,n,a,i)=>{w(t,7);const o=t.helper.string("divisionName",e),s=t.helper.city("cityName",n),l=t.helper.string("materialName",a),c=t.helper.number("amt",i);if(c<0)throw new Error("Invalid value for amount field! Must be numeric and greater than 0");const f=v(o,s,l);Object(r.e)(f,c)},bulkPurchase:t=>(e,n,a,i)=>{w(t,7);const o=t.helper.string("divisionName",e);if(!p(y(o),"Bulk Purchasing"))throw new Error("You have not researched Bulk Purchasing in "+o);const s=g(),l=t.helper.city("cityName",n),c=t.helper.string("materialName",a),f=t.helper.number("amt",i),u=E(o,l),m=v(o,l,c);Object(r.b)(s,u,m,f)},makeProduct:t=>(e,n,a,i,o)=>{w(t,7);const s=t.helper.string("divisionName",e),l=t.helper.city("cityName",n),c=t.helper.string("productName",a),f=t.helper.number("designInvest",i),u=t.helper.number("marketingInvest",o),m=g();Object(r.m)(m,y(s),l,c,f,u)},limitProductProduction:t=>(e,n,a,i)=>{w(t,7);const o=t.helper.string("divisionName",e),s=t.helper.city("cityName",a),l=t.helper.string("productName",n),c=t.helper.number("qty",i);Object(r.l)(k(o,l),s,c)},exportMaterial:t=>(e,n,a,i,o,s)=>{w(t,7);const l=t.helper.string("sourceDivision",e),c=t.helper.string("sourceCity",n),f=t.helper.string("targetDivision",a),u=t.helper.string("targetCity",i),m=t.helper.string("materialName",o),h=t.helper.string("amt",s);Object(r.g)(f,u,v(l,c,m),h+"",y(f))},cancelExportMaterial:t=>(e,n,a,i,o,s)=>{w(t,7);const l=t.helper.string("sourceDivision",e),c=t.helper.string("sourceCity",n),f=t.helper.string("targetDivision",a),u=t.helper.string("targetCity",i),m=t.helper.string("materialName",o),h=t.helper.string("amt",s);Object(r.f)(f,u,v(l,c,m),h+"")},limitMaterialProduction:t=>(e,n,a,i)=>{w(t,7);const o=t.helper.string("divisionName",e),s=t.helper.city("cityName",n),l=t.helper.string("materialName",a),c=t.helper.number("qty",i);Object(r.k)(v(o,s,l),c)},setMaterialMarketTA1:t=>(e,n,a,i)=>{w(t,7);const o=t.helper.string("divisionName",e),s=t.helper.city("cityName",n),l=t.helper.string("materialName",a),c=t.helper.boolean(i);if(!y(o).hasResearch("Market-TA.I"))throw t.makeRuntimeErrorMsg("You have not researched MarketTA.I for division: "+o);Object(r.u)(v(o,s,l),c)},setMaterialMarketTA2:t=>(e,n,a,i)=>{w(t,7);const o=t.helper.string("divisionName",e),s=t.helper.city("cityName",n),l=t.helper.string("materialName",a),c=t.helper.boolean(i);if(!y(o).hasResearch("Market-TA.II"))throw t.makeRuntimeErrorMsg("You have not researched MarketTA.II for division: "+o);Object(r.v)(v(o,s,l),c)},setProductMarketTA1:t=>(e,n,a)=>{w(t,7);const i=t.helper.string("divisionName",e),o=t.helper.string("productName",n),s=t.helper.boolean(a);if(!y(i).hasResearch("Market-TA.I"))throw t.makeRuntimeErrorMsg("You have not researched MarketTA.I for division: "+i);Object(r.w)(k(i,o),s)},setProductMarketTA2:t=>(e,n,a)=>{w(t,7);const i=t.helper.string("divisionName",e),o=t.helper.string("productName",n),s=t.helper.boolean(a);if(!y(i).hasResearch("Market-TA.II"))throw t.makeRuntimeErrorMsg("You have not researched MarketTA.II for division: "+i);Object(r.x)(k(i,o),s)}},...{getHireAdVertCost:t=>e=>{w(t,8);const n=y(t.helper.string("divisionName",e)),a=u.a[1];return a[1]*Math.pow(a[2],n.upgrades[1])},getHireAdVertCount:t=>e=>{w(t,8);return y(t.helper.string("divisionName",e)).upgrades[1]},getResearchCost:t=>(e,n)=>{w(t,8);const a=t.helper.string("divisionName",e),r=t.helper.string("researchName",n);return function(t,e){const n=c.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}'`);return m.a[e].cost}(y(a),r)},hasResearched:t=>(e,n)=>{w(t,8);const a=t.helper.string("divisionName",e),r=t.helper.string("researchName",n);return p(y(a),r)},setAutoJobAssignment:t=>(n,r,i,o)=>{w(t,8);const l=t.helper.string("divisionName",n),c=t.helper.city("cityName",r),f=t.helper.number("amount",o),u=t.helper.string("job",i),m=b(l,c);if(!Object.values(s.a).includes(u))throw new Error(`'${u}' is not a valid job.`);return Object(a.c)(1e3,e).then((function(){return Promise.resolve(m.setEmployeeToJob(u,f))}))},getOfficeSizeUpgradeCost:t=>(e,n,a)=>{w(t,8);const r=t.helper.string("divisionName",e),i=t.helper.city("cityName",n),o=t.helper.number("size",a);if(o<0)throw new Error("Invalid value for size field! Must be numeric and greater than 0");const s=b(r,i),l=Math.round(s.size/f.a.OfficeInitialSize);let c=0;for(let t=0;t(n,i,o,s)=>{w(t,8);const l=t.helper.string("divisionName",n),c=t.helper.city("cityName",i),f=t.helper.string("employeeName",o),u=t.helper.string("job",s),m=_(l,c,f);return Object(a.c)(["Training","Unassigned"].includes(m.pos)?0:1e3,e).then((function(){return Promise.resolve(Object(r.a)(m,u))}))},hireEmployee:t=>(e,n)=>{w(t,8);const a=b(t.helper.string("divisionName",e),t.helper.city("cityName",n)).hireRandomEmployee();if(void 0!==a)return{name:a.name,mor:a.mor,hap:a.hap,ene:a.ene,int:a.int,cha:a.cha,exp:a.exp,cre:a.cre,eff:a.eff,sal:a.sal,loc:a.loc,pos:a.pos}},upgradeOfficeSize:t=>(e,n,a)=>{w(t,8);const i=t.helper.string("divisionName",e),o=t.helper.city("cityName",n),s=t.helper.number("size",a);if(s<0)throw new Error("Invalid value for size field! Must be numeric and greater than 0");const l=b(i,o),c=g();Object(r.C)(c,l,s)},throwParty:n=>async(i,o,s)=>{w(n,8);const c=n.helper.string("divisionName",i),f=n.helper.city("cityName",o),u=n.helper.number("costPerEmployee",s);if(u<0)throw new Error("Invalid value for Cost Per Employee field! Must be numeric and greater than 0");const m=b(c,f),h=g();return Object(a.c)(6e4/(t.hacking_speed_mult*Object(l.a)(t.intelligence,1)),e).then((function(){return Promise.resolve(Object(r.A)(h,m,u))}))},buyCoffee:n=>async(i,o)=>{w(n,8);const s=n.helper.string("divisionName",i),c=n.helper.city("cityName",o),f=g();return Object(a.c)(6e4/(t.hacking_speed_mult*Object(l.a)(t.intelligence,1)),e).then((function(){return Promise.resolve(Object(r.d)(f,y(s),b(s,c)))}))},hireAdVert:t=>e=>{w(t,8);const n=t.helper.string("divisionName",e),a=g();Object(r.h)(a,y(n),b(n,"Sector-12"))},research:t=>(e,n)=>{w(t,8);const a=t.helper.string("divisionName",e),i=t.helper.string("researchName",n);Object(r.q)(y(a),i)},getOffice:t=>(e,n)=>{w(t,8);const a=b(t.helper.string("divisionName",e),t.helper.city("cityName",n));return{loc:a.loc,size:a.size,minEne:a.minEne,maxEne:a.maxEne,minHap:a.minHap,maxHap:a.maxHap,maxMor:a.maxMor,employees:a.employees.map(t=>t.name),employeeProd:{Operations:a.employeeProd[s.a.Operations],Engineer:a.employeeProd[s.a.Engineer],Business:a.employeeProd[s.a.Business],Management:a.employeeProd[s.a.Management],"Research & Development":a.employeeProd[s.a.RandD],Training:a.employeeProd[s.a.Training]},employeeJobs:{Operations:a.employeeJobs[s.a.Operations],Engineer:a.employeeJobs[s.a.Engineer],Business:a.employeeJobs[s.a.Business],Management:a.employeeJobs[s.a.Management],"Research & Development":a.employeeJobs[s.a.RandD],Training:a.employeeJobs[s.a.Training],Unassigned:a.employeeJobs[s.a.Unassigned]}}},getEmployee:t=>(e,n,a)=>{w(t,8);const r=_(t.helper.string("divisionName",e),t.helper.city("cityName",n),t.helper.string("employeeName",a));return{name:r.name,mor:r.mor,hap:r.hap,ene:r.ene,int:r.int,cha:r.cha,exp:r.exp,cre:r.cre,eff:r.eff,sal:r.sal,loc:r.loc,pos:r.pos}}},expandIndustry:t=>(e,n)=>{w(t);const a=t.helper.string("industryName",e),i=t.helper.string("divisionName",n),o=g();Object(r.o)(o,a,i)},expandCity:t=>(e,n)=>{w(t);const a=t.helper.string("divisionName",e),i=t.helper.city("cityName",n);if(!f.a.Cities.includes(i))throw new Error("Invalid city name");const o=g(),s=y(a);Object(r.n)(o,s,i)},unlockUpgrade:t=>e=>{w(t);const n=t.helper.string("upgradeName",e),a=g(),o=Object.values(i.b).find(t=>t.name===n);if(void 0===o)throw new Error(`No upgrade named '${n}'`);Object(r.B)(a,o)},levelUpgrade:t=>e=>{w(t);const n=t.helper.string("upgradeName",e),a=g(),i=Object.values(o.a).find(t=>t.name===n);if(void 0===i)throw new Error(`No upgrade named '${n}'`);Object(r.j)(a,i)},issueDividends:t=>e=>{w(t);const n=t.helper.number("percent",e);if(n<0||n>100)throw new Error("Invalid value for percent field! Must be numeric, greater than 0, and less than 100");const a=g();if(!a.public)throw t.makeRuntimeErrorMsg("Your company has not gone public!");Object(r.i)(a,n)},getDivision:t=>e=>{w(t);return S(y(t.helper.string("divisionName",e)))},getCorporation:t=>()=>{w(t);const e=g();return{name:e.name,funds:e.funds,revenue:e.revenue,expenses:e.expenses,public:e.public,totalShares:e.totalShares,numShares:e.numShares,shareSaleCooldown:e.shareSaleCooldown,issuedShares:e.issuedShares,sharePrice:e.sharePrice,state:e.state.getState(),divisions:e.divisions.map(t=>S(t))}},createCorporation:e=>(n,a=!0)=>function(e,n=!0){if(!t.canAccessCorporation()||t.hasCorporation())return!1;if(!e)return!1;if(3!==t.bitNodeN&&!n)throw new Error("cannot use seed funds outside of BitNode 3");if(d.a.CorporationSoftcap<.15)throw new Error("You cannot create a corporation in Bitnode "+t.bitNodeN);if(n){if(!t.canAfford(15e10))return!1;t.startCorporation(e),t.loseMoney(15e10,"corporation")}else t.startCorporation(e,5e8);return!0}(e.helper.string("corporationName",n),e.helper.boolean(a)),hasUnlockUpgrade:t=>e=>{w(t);return n(t.helper.string("upgradeName",e))},getUnlockUpgradeCost:t=>e=>{w(t);return function(t){const e=Object.values(i.b).find(e=>e.name===t);if(void 0===e)throw new Error(`No upgrade named '${t}'`);return e.price}(t.helper.string("upgradeName",e))},getUpgradeLevel:t=>e=>{w(t);const n=t.helper.string("upgradeName",e);return function(t,e){const n=t.helper.string("upgradeName",e),a=g(),r=Object.values(o.a).find(t=>t.name===n);if(void 0===r)throw new Error(`No upgrade named '${n}'`);const i=r.index;return a.upgrades[i]}(t,n)},getUpgradeLevelCost:t=>e=>{w(t);const n=t.helper.string("upgradeName",e);return function(t,e){const n=t.helper.string("upgradeName",e),a=g(),r=Object.values(o.a).find(t=>t.name===n);if(void 0===r)throw new Error(`No upgrade named '${n}'`);const i=r.index,s=r.basePrice,l=r.priceMult,c=a.upgrades[i];return s*Math.pow(l,c)}(t,n)},getExpandIndustryCost:t=>e=>{w(t);return function(t){const e=c.d[t];if(void 0===e)throw new Error(`Invalid industry: '${t}'`);return e}(t.helper.string("industryName",e))},getExpandCityCost:t=>()=>(w(t),f.a.OfficeInitialCost),getInvestmentOffer:t=>()=>(w(t),function(){const t=g();if(t.fundingRound>=f.a.FundingRoundShares.length||t.fundingRound>=f.a.FundingRoundMultiplier.length||t.public)return{funds:0,shares:0,round:t.fundingRound+1};const e=t.determineValuation(),n=f.a.FundingRoundShares[t.fundingRound];return{funds:e*n*f.a.FundingRoundMultiplier[t.fundingRound],shares:Math.floor(f.a.INITIALSHARES*n),round:t.fundingRound+1}}()),acceptInvestmentOffer:t=>()=>(w(t),function(){const t=g();if(t.fundingRound>=f.a.FundingRoundShares.length||t.fundingRound>=f.a.FundingRoundMultiplier.length||t.public)return!1;const e=t.determineValuation(),n=f.a.FundingRoundShares[t.fundingRound],a=e*n*f.a.FundingRoundMultiplier[t.fundingRound],r=Math.floor(f.a.INITIALSHARES*n);return t.fundingRound++,t.addFunds(a),t.numShares-=r,!0}()),goPublic:t=>e=>{w(t);return function(t){const e=g(),n=e.determineValuation()/e.totalShares;if(isNaN(t))throw new Error("Invalid value for number of issued shares");if(t<0)throw new Error("Invalid value for number of issued shares");if(t>e.numShares)throw new Error("You don't have that many shares to issue!");return e.public=!0,e.sharePrice=n,e.issuedShares=t,e.numShares-=t,e.addFunds(t*n),!0}(t.helper.number("numShares",e))},sellShares:e=>n=>{w(e);const a=e.helper.number("numShares",n);return Object(r.t)(g(),t,a)},buyBackShares:e=>n=>{w(e);const a=e.helper.number("numShares",n);return Object(r.c)(g(),t,a)},bribe:e=>(n,a,r)=>{w(e);return function(e,n,a){if(!t.factions.includes(e))throw new Error("Invalid faction name");if(isNaN(n)||n<0||isNaN(a)||a<0)throw new Error("Invalid value for amount field! Must be numeric, grater than 0.");const r=g();if(r.funds()=>(w(t),1e3*Math.round(g().storedCycles/5))}}},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return Industry}));var _utils_JSONReviver__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(28),_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(15),_IndustryData__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(51),_data_Constants__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(40),_EmployeePositions__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(47),_Material__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(202),_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(33),_utils_calculateEffectWithFactors__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(1050),_OfficeSpace__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(380),_Product__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(408),_ui_React_DialogBox__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(14),_utils_helpers_isString__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(146),_MaterialSizes__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(179),_Warehouse__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__(243),_IndustryUpgrades__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__(322);function _defineProperty(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class Industry{constructor(t={}){_defineProperty(this,"name",""),_defineProperty(this,"type",_IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.Agriculture),_defineProperty(this,"sciResearch",new _Material__WEBPACK_IMPORTED_MODULE_5__.a({name:"Scientific Research"})),_defineProperty(this,"researched",{}),_defineProperty(this,"reqMats",{}),_defineProperty(this,"prodMats",[]),_defineProperty(this,"products",{}),_defineProperty(this,"makesProducts",!1),_defineProperty(this,"awareness",0),_defineProperty(this,"popularity",0),_defineProperty(this,"startingCost",0),_defineProperty(this,"reFac",0),_defineProperty(this,"sciFac",0),_defineProperty(this,"hwFac",0),_defineProperty(this,"robFac",0),_defineProperty(this,"aiFac",0),_defineProperty(this,"advFac",0),_defineProperty(this,"prodMult",0),_defineProperty(this,"upgrades",Array(Object.keys(_IndustryUpgrades__WEBPACK_IMPORTED_MODULE_14__.a).length).fill(0)),_defineProperty(this,"state","START"),_defineProperty(this,"newInd",!0),_defineProperty(this,"offices",{[_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_1__.a.Aevum]:0,[_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_1__.a.Chongqing]:0,[_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_1__.a.Sector12]:new _OfficeSpace__WEBPACK_IMPORTED_MODULE_8__.a({loc:_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_1__.a.Sector12,size:_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.OfficeInitialSize}),[_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_1__.a.NewTokyo]:0,[_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_1__.a.Ishima]:0,[_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_1__.a.Volhaven]:0}),this.name=t.name?t.name:"",this.type=t.type?t.type:_IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.Agriculture,this.lastCycleRevenue=0,this.lastCycleExpenses=0,this.thisCycleRevenue=0,this.thisCycleExpenses=0,this.warehouses={[_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_1__.a.Aevum]:0,[_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_1__.a.Chongqing]:0,[_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_1__.a.Sector12]:new _Warehouse__WEBPACK_IMPORTED_MODULE_13__.a({corp:t.corp,industry:this,loc:_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_1__.a.Sector12,size:_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.WarehouseInitialSize}),[_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_1__.a.NewTokyo]:0,[_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_1__.a.Ishima]:0,[_Locations_data_CityNames__WEBPACK_IMPORTED_MODULE_1__.a.Volhaven]:0},this.init()}init(){const t=_IndustryData__WEBPACK_IMPORTED_MODULE_2__.d[this.type];if(void 0===t)throw new Error(`Invalid industry: "${this.type}"`);switch(this.startingCost=t,this.type){case _IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.Energy:this.reFac=.65,this.sciFac=.7,this.robFac=.05,this.aiFac=.3,this.advFac=.08,this.reqMats={Hardware:.1,Metal:.2},this.prodMats=["Energy"];break;case _IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.Utilities:case"Utilities":this.reFac=.5,this.sciFac=.6,this.robFac=.4,this.aiFac=.4,this.advFac=.08,this.reqMats={Hardware:.1,Metal:.1},this.prodMats=["Water"];break;case _IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.Agriculture:this.reFac=.72,this.sciFac=.5,this.hwFac=.2,this.robFac=.3,this.aiFac=.3,this.advFac=.04,this.reqMats={Water:.5,Energy:.5},this.prodMats=["Plants","Food"];break;case _IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.Fishing:this.reFac=.15,this.sciFac=.35,this.hwFac=.35,this.robFac=.5,this.aiFac=.2,this.advFac=.08,this.reqMats={Energy:.5},this.prodMats=["Food"];break;case _IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.Mining:this.reFac=.3,this.sciFac=.26,this.hwFac=.4,this.robFac=.45,this.aiFac=.45,this.advFac=.06,this.reqMats={Energy:.8},this.prodMats=["Metal"];break;case _IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.Food:this.sciFac=.12,this.hwFac=.15,this.robFac=.3,this.aiFac=.25,this.advFac=.25,this.reFac=.05,this.reqMats={Food:.5,Water:.5,Energy:.2},this.makesProducts=!0;break;case _IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.Tobacco:this.reFac=.15,this.sciFac=.75,this.hwFac=.15,this.robFac=.2,this.aiFac=.15,this.advFac=.2,this.reqMats={Plants:1,Water:.2},this.makesProducts=!0;break;case _IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.Chemical:this.reFac=.25,this.sciFac=.75,this.hwFac=.2,this.robFac=.25,this.aiFac=.2,this.advFac=.07,this.reqMats={Plants:1,Energy:.5,Water:.5},this.prodMats=["Chemicals"];break;case _IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.Pharmaceutical:this.reFac=.05,this.sciFac=.8,this.hwFac=.15,this.robFac=.25,this.aiFac=.2,this.advFac=.16,this.reqMats={Chemicals:2,Energy:1,Water:.5},this.prodMats=["Drugs"],this.makesProducts=!0;break;case _IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.Computer:case"Computer":this.reFac=.2,this.sciFac=.62,this.robFac=.36,this.aiFac=.19,this.advFac=.17,this.reqMats={Metal:2,Energy:1},this.prodMats=["Hardware"],this.makesProducts=!0;break;case _IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.Robotics:this.reFac=.32,this.sciFac=.65,this.aiFac=.36,this.advFac=.18,this.hwFac=.19,this.reqMats={Hardware:5,Energy:3},this.prodMats=["Robots"],this.makesProducts=!0;break;case _IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.Software:this.sciFac=.62,this.advFac=.16,this.hwFac=.25,this.reFac=.15,this.aiFac=.18,this.robFac=.05,this.reqMats={Hardware:.5,Energy:.5},this.prodMats=["AICores"],this.makesProducts=!0;break;case _IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.Healthcare:this.reFac=.1,this.sciFac=.75,this.advFac=.11,this.hwFac=.1,this.robFac=.1,this.aiFac=.1,this.reqMats={Robots:10,AICores:5,Energy:5,Water:5},this.makesProducts=!0;break;case _IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.RealEstate:this.robFac=.6,this.aiFac=.6,this.advFac=.25,this.sciFac=.05,this.hwFac=.05,this.reqMats={Metal:5,Energy:5,Water:2,Hardware:4},this.prodMats=["RealEstate"],this.makesProducts=!0;break;default:return void console.error("Invalid Industry Type passed into Industry.init(): "+this.type)}}getProductDescriptionText(){if(!this.makesProducts)return"";switch(this.type){case _IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.Food:return"create and manage restaurants";case _IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.Tobacco:return"create tobacco and tobacco-related products";case _IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.Pharmaceutical:return"develop new pharmaceutical drugs";case _IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.Computer:case"Computer":return"create new computer hardware and networking infrastructures";case _IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.Robotics:return"build specialized robots and robot-related products";case _IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.Software:return"develop computer software";case _IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.Healthcare:return"build and manage hospitals";case _IndustryData__WEBPACK_IMPORTED_MODULE_2__.a.RealEstate:return"develop and manage real estate properties";default:return console.error("Invalid industry type in Industry.getProductDescriptionText"),""}}getMaximumNumberProducts(){if(!this.makesProducts)return 0;let t=0;return this.hasResearch("uPgrade: Capacity.I")&&++t,this.hasResearch("uPgrade: Capacity.II")&&++t,_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.BaseMaxProducts+t}hasMaximumNumberProducts(){return Object.keys(this.products).length>=this.getMaximumNumberProducts()}calculateProductionFactors(){let t=0;for(let e=0;e<_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.Cities.length;++e){const n=_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.Cities[e],a=this.warehouses[n];if(!(a instanceof _Warehouse__WEBPACK_IMPORTED_MODULE_13__.a))continue;const r=a.materials,i=Math.pow(.002*r.RealEstate.qty+1,this.reFac)*Math.pow(.002*r.Hardware.qty+1,this.hwFac)*Math.pow(.002*r.Robots.qty+1,this.robFac)*Math.pow(.002*r.AICores.qty+1,this.aiFac);t+=Math.pow(i,.73)}this.prodMult=t<1?1:t}updateWarehouseSizeUsed(t){t.updateMaterialSizeUsed();for(const e of Object.keys(this.products))if(this.products.hasOwnProperty(e)){const n=this.products[e];if(void 0===n)continue;t.sizeUsed+=n.data[t.loc][0]*n.siz}}process(t=1,e,n){if(this.state=e,"START"===e){(isNaN(this.thisCycleRevenue)||isNaN(this.thisCycleExpenses))&&(console.error("NaN in Corporation's computed revenue/expenses"),Object(_ui_React_DialogBox__WEBPACK_IMPORTED_MODULE_10__.a)("Something went wrong when compting Corporation's revenue/expenses. This is a bug. Please report to game developer"),this.thisCycleRevenue=0,this.thisCycleExpenses=0),this.lastCycleRevenue=this.thisCycleRevenue/(t*_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.SecsPerMarketCycle),this.lastCycleExpenses=this.thisCycleExpenses/(t*_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.SecsPerMarketCycle),this.thisCycleRevenue=0,this.thisCycleExpenses=0,this.lastCycleRevenue>0&&(this.newInd=!1);let e=0;for(const a of Object.keys(this.offices)){const r=this.offices[a];0!==r&&(r instanceof _OfficeSpace__WEBPACK_IMPORTED_MODULE_8__.a&&(e+=r.process(t,n,this)))}this.thisCycleExpenses=this.thisCycleExpenses+e,this.processMaterialMarket(),this.processProductMarket(t),this.popularity-=1e-4*t,this.popularity=Math.max(0,this.popularity);const a=n.getDreamSenseGain(),r=4*a;if(a>0){const e=this.awareness+r*t;this.awareness=Math.min(e,Number.MAX_VALUE);const n=this.popularity+a*t;this.popularity=Math.min(n,Number.MAX_VALUE)}return}let a=this.processMaterials(t,n);Array.isArray(a)&&(this.thisCycleRevenue=this.thisCycleRevenue+a[0],this.thisCycleExpenses=this.thisCycleExpenses+a[1]),a=this.processProducts(t,n),Array.isArray(a)&&(this.thisCycleRevenue=this.thisCycleRevenue+a[0],this.thisCycleExpenses=this.thisCycleExpenses+a[1])}processMaterialMarket(){const t=this.reqMats,e=this.prodMats;for(let n=0;n<_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.Cities.length;++n)if(this.warehouses[_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.Cities[n]]instanceof _Warehouse__WEBPACK_IMPORTED_MODULE_13__.a){const a=this.warehouses[_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.Cities[n]];if(0===a)continue;for(const e of Object.keys(t))t.hasOwnProperty(e)&&a.materials[e].processMarket();for(let t=0;t0&&(e.qty+=n,expenses+=n*e.bCost),this.updateWarehouseSizeUsed(warehouse))}const t={};for(const e of Object.keys(warehouse.materials)){if(!warehouse.materials.hasOwnProperty(e))continue;if(!warehouse.smartSupplyEnabled||!Object.keys(this.reqMats).includes(e))continue;const n=warehouse.materials[e],a=this.reqMats[e];if(void 0===a)throw new Error(`reqMat "${e}" is undefined`);n.buy=a*warehouse.smartSupplyStore;let r=n.buy*_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.SecsPerMarketCycle*marketCycles;const i=Math.floor((warehouse.size-warehouse.sizeUsed)/_MaterialSizes__WEBPACK_IMPORTED_MODULE_12__.a[e]);r=Math.min(r,i),r>0&&(t[e]=r)}let e=1e99;for(const n of Object.keys(t)){const a=t[n];if(void 0===a)throw new Error("Somehow smartbuy matname is undefined");const r=this.reqMats[n];if(void 0===r)throw new Error(`reqMat "${n}" is undefined`);const i=a/r;ia)for(const e of Object.keys(t)){const r=t[e];if(void 0===r)throw new Error("Somehow smartbuy matname is undefined");t[e]=Math.floor(r*a/n)}for(const e of Object.keys(t)){if(!warehouse.smartSupplyUseLeftovers[e])continue;const n=warehouse.materials[e],a=t[e];if(void 0===a)throw new Error("Somehow smartbuy matname is undefined");t[e]=Math.max(0,a-n.qty)}for(const e of Object.keys(t)){const n=warehouse.materials[e],a=t[e];if(void 0===a)throw new Error("Somehow smartbuy matname is undefined");n.qty+=a,expenses+=a*n.bCost}break}case"PRODUCTION":if(warehouse.smartSupplyStore=0,this.prodMats.length>0){const t=warehouse.materials[this.prodMats[0]],e=this.getOfficeProductivity(office)*this.prodMult*corporation.getProductionMultiplier()*this.getProductionMultiplier();let n;n=t.prdman[0]?Math.min(e,t.prdman[1]):e,n*=_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.SecsPerMarketCycle*marketCycles;let a=0;for(let t=0;t0){const t=Math.floor((warehouse.size-warehouse.sizeUsed)/a);n=Math.min(t,n)}n<0&&(n=0),warehouse.smartSupplyStore+=n/(_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.SecsPerMarketCycle*marketCycles);let r=1;for(const t of Object.keys(this.reqMats))if(this.reqMats.hasOwnProperty(t)){const e=this.reqMats[t];if(void 0===e)continue;const a=e*n;warehouse.materials[t].qty0&&n>0){for(const t of Object.keys(this.reqMats)){const e=this.reqMats[t];if(void 0===e)continue;const a=e*n*r;warehouse.materials[t].qty-=a,warehouse.materials[t].prd=0,warehouse.materials[t].prd-=a/(_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.SecsPerMarketCycle*marketCycles)}for(let t=0;tmat.bCost?sCost-mat.bCost>markupLimit&&(markup=Math.pow(markupLimit/(sCost-mat.bCost),2)):sCost=0?(mat.qty-=sellAmt,revenue+=sellAmt*sCost,mat.sll=sellAmt/(_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.SecsPerMarketCycle*marketCycles)):mat.sll=0}break;case"EXPORT":for(const matName of Object.keys(warehouse.materials))if(warehouse.materials.hasOwnProperty(matName)){const mat=warehouse.materials[matName];mat.totalExp=0;for(let expI=0;expI=n.size)return[0,0];{const t=Math.floor((n.size-n.sizeUsed)/_MaterialSizes__WEBPACK_IMPORTED_MODULE_12__.a[matName]);amt=Math.min(t,amt)}n.materials[matName].imp+=amt/(_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.SecsPerMarketCycle*marketCycles),n.materials[matName].qty+=amt,n.materials[matName].qlt=mat.qlt,mat.qty-=amt,mat.totalExp+=amt,e.updateWarehouseSizeUsed(n);break}}}mat.totalExp/=_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.SecsPerMarketCycle*marketCycles}break;case"START":break;default:console.error("Invalid state: "+this.state)}this.updateWarehouseSizeUsed(warehouse)}office instanceof _OfficeSpace__WEBPACK_IMPORTED_MODULE_8__.a&&(this.sciResearch.qty+=.004*Math.pow(office.employeeProd[_EmployeePositions__WEBPACK_IMPORTED_MODULE_4__.a.RandD],.5)*corporation.getScientificResearchMultiplier()*this.getScientificResearchMultiplier())}}return[revenue,expenses]}processProducts(t=1,e){let n=0;if("PRODUCTION"===this.state)for(const e of Object.keys(this.products)){const n=this.products[e];if(void 0!==n&&!n.fin){const e=n.createCity,a=this.offices[e];if(0===a)continue;const r=a.employeeProd[_EmployeePositions__WEBPACK_IMPORTED_MODULE_4__.a.Engineer],i=a.employeeProd[_EmployeePositions__WEBPACK_IMPORTED_MODULE_4__.a.Management],o=a.employeeProd[_EmployeePositions__WEBPACK_IMPORTED_MODULE_4__.a.Operations],s=r+i+o;if(s<=0)break;const l=1+i/(1.2*s),c=(Math.pow(r,.34)+Math.pow(o,.2))*l;n.createProduct(t,c),n.prog>=100&&n.finishProduct(a.employeeProd,this);break}}for(const a of Object.keys(this.products))if(this.products.hasOwnProperty(a)){const r=this.products[a];r instanceof _Product__WEBPACK_IMPORTED_MODULE_9__.a&&r.fin&&(n+=this.processProduct(t,r,e))}return[n,0]}processProduct(marketCycles=1,product,corporation){let totalProfit=0;for(let i=0;i<_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.Cities.length;++i){const city=_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.Cities[i],office=this.offices[city];if(0===office)continue;const warehouse=this.warehouses[city];if(warehouse instanceof _Warehouse__WEBPACK_IMPORTED_MODULE_13__.a)switch(this.state){case"PRODUCTION":{const t=this.getOfficeProductivity(office,{forProduct:!0})*corporation.getProductionMultiplier()*this.prodMult*this.getProductionMultiplier()*this.getProductProductionMultiplier();let e;e=product.prdman[city][0]?Math.min(t,product.prdman[city][1]):t,e*=_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.SecsPerMarketCycle*marketCycles;let n=product.siz;for(const t of Object.keys(product.reqMats))if(product.reqMats.hasOwnProperty(t)){const e=product.reqMats[t];n-=_MaterialSizes__WEBPACK_IMPORTED_MODULE_12__.a[t]*e}if(n>0){const t=Math.floor((warehouse.size-warehouse.sizeUsed)/n);e=Math.min(t,e)}warehouse.smartSupplyStore+=e/(_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.SecsPerMarketCycle*marketCycles);let a=1;for(const t of Object.keys(product.reqMats))if(product.reqMats.hasOwnProperty(t)){const n=product.reqMats[t]*e;warehouse.materials[t].qty0&&e>0){for(const t of Object.keys(product.reqMats))if(product.reqMats.hasOwnProperty(t)){const n=product.reqMats[t]*e*a;warehouse.materials[t].qty-=n,warehouse.materials[t].prd-=n/(_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.SecsPerMarketCycle*marketCycles)}product.data[city][0]+=e*a}product.data[city][1]=e*a/(_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.SecsPerMarketCycle*marketCycles);break}case"SALE":{product.pCost=0;for(const t of Object.keys(product.reqMats))product.reqMats.hasOwnProperty(t)&&(product.pCost+=product.reqMats[t]*warehouse.materials[t].bCost);product.pCost*=_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.ProductProductionCostRatio;const businessFactor=this.getBusinessFactor(office),advertisingFactor=this.getAdvertisingFactors()[0],marketFactor=this.getMarketFactor(product),markupLimit=product.rat/product.mku;let sCost;if(product.marketTa2){const t=product.data[city][1],e=markupLimit,n=t,a=.5*Math.pow(product.rat,.65)*marketFactor*corporation.getSalesMultiplier()*businessFactor*advertisingFactor*this.getSalesMultiplier(),r=Math.sqrt(n/a);let i;0===a||0===r?0===n?i=0:(i=product.pCost+markupLimit,console.warn("In Corporation, found illegal 0s when trying to calculate MarketTA2 sale cost")):i=e/r+product.pCost,product.marketTa2Price[city]=i,sCost=i}else if(product.marketTa1)sCost=product.pCost+markupLimit;else if(Object(_utils_helpers_isString__WEBPACK_IMPORTED_MODULE_11__.a)(product.sCost)){const sCostString=product.sCost;0===product.mku&&(console.error("mku is zero, reverting to 1 to avoid Infinity"),product.mku=1),sCost=sCostString.replace(/MP/g,product.pCost+product.rat/product.mku+""),sCost=eval(sCost)}else sCost=product.sCost;let markup=1,sellAmt;if(sCost>product.pCost&&sCost-product.pCost>markupLimit&&(markup=markupLimit/(sCost-product.pCost)),product.maxsll=.5*Math.pow(product.rat,.65)*marketFactor*corporation.getSalesMultiplier()*Math.pow(markup,2)*businessFactor*advertisingFactor*this.getSalesMultiplier(),product.sllman[city][0]&&Object(_utils_helpers_isString__WEBPACK_IMPORTED_MODULE_11__.a)(product.sllman[city][1])){let tmp=product.sllman[city][1].replace(/MAX/g,(product.maxsll+"").toUpperCase());tmp=tmp.replace(/PROD/g,product.data[city][1]);try{tmp=eval(tmp)}catch(t){Object(_ui_React_DialogBox__WEBPACK_IMPORTED_MODULE_10__.a)("Error evaluating your sell price expression for "+product.name+" in "+this.name+"'s "+city+" office. Sell price is being set to MAX"),tmp=product.maxsll}sellAmt=Math.min(product.maxsll,tmp)}else sellAmt=product.sllman[city][0]&&product.sllman[city][1]>0?Math.min(product.maxsll,product.sllman[city][1]):!1===product.sllman[city][0]?0:product.maxsll;sellAmt<0&&(sellAmt=0),sellAmt=sellAmt*_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.SecsPerMarketCycle*marketCycles,sellAmt=Math.min(product.data[city][0],sellAmt),sellAmt&&sCost?(product.data[city][0]-=sellAmt,totalProfit+=sellAmt*sCost,product.data[city][2]=sellAmt/(_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.SecsPerMarketCycle*marketCycles)):product.data[city][2]=0;break}case"START":case"PURCHASE":case"EXPORT":break;default:console.error("Invalid State: "+this.state)}}return totalProfit}discontinueProduct(t){for(const e of Object.keys(this.products))this.products.hasOwnProperty(e)&&t===this.products[e]&&delete this.products[e]}upgrade(t,e){const n=e.corporation,a=e.office,r=t[0];for(;this.upgrades.length<=r;)this.upgrades.push(0);switch(++this.upgrades[r],r){case 0:for(let t=0;t=1)&&console.warn(`Exponential factor is ${e}. This is not an intended value for it`),n<1&&console.warn(`Linear factor is ${n}. This is not an intended value for it`),Math.pow(t,e)+t/n}n.d(e,"a",(function(){return a}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(40),r=n(33),i=n(28),o=n(47);class s{constructor(t={}){var e,n,i;e=this,n="cyclesUntilRaise",i=a.a.CyclesPerEmployeeRaise,n in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i,this.name=t.name?t.name:"Bobby",this.mor=t.morale?t.morale:Object(r.a)(50,100),this.hap=t.happiness?t.happiness:Object(r.a)(50,100),this.ene=t.energy?t.energy:Object(r.a)(50,100),this.int=t.intelligence?t.intelligence:Object(r.a)(10,50),this.cha=t.charisma?t.charisma:Object(r.a)(10,50),this.exp=t.experience?t.experience:Object(r.a)(10,50),this.cre=t.creativity?t.creativity:Object(r.a)(10,50),this.eff=t.efficiency?t.efficiency:Object(r.a)(10,50),this.sal=t.salary?t.salary:Object(r.a)(.1,5),this.loc=t.loc?t.loc:"",this.pos=o.a.Unassigned}process(t=1,e){const n=.003*t,r=n*Math.random();this.exp+=n;const i=n*Math.random();this.pos===o.a.Training&&(this.cha+=i,this.exp+=i,this.eff+=i),this.ene-=r,this.hap-=r,this.enee=>{const a=t.helper.number("favor",e);return n(t),Object(u.a)(a)},calculateRepToFavor:t=>e=>{const a=t.helper.number("rep",e);return n(t),Object(u.b)(a)},repFromDonation:t=>(e,a)=>{const r=t.helper.number("amount",e);return n(t),Object(m.a)(r,a)}},skills:{calculateSkill:t=>(e,a=1)=>{const r=t.helper.number("exp",e),i=t.helper.number("mult",a);return n(t),Object(s.b)(r,i)},calculateExp:t=>(e,a=1)=>{const r=t.helper.number("skill",e),i=t.helper.number("mult",a);return n(t),Object(s.a)(r,i)}},hacking:{hackChance:t=>(e,a)=>(n(t),Object(l.b)(e,a)),hackExp:t=>(e,a)=>(n(t),Object(l.c)(e,a)),hackPercent:t=>(e,a)=>(n(t),Object(l.e)(e,a)),growPercent:t=>(e,r,i,o=1)=>{const s=t.helper.number("threads",r),l=t.helper.number("cores",o);return n(t),Object(a.a)(e,s,i,l)},hackTime:t=>(e,a)=>(n(t),1e3*Object(l.d)(e,a)),growTime:t=>(e,a)=>(n(t),1e3*Object(l.a)(e,a)),weakenTime:t=>(e,a)=>(n(t),1e3*Object(l.f)(e,a))},hacknetNodes:{moneyGainRate:t=>(e,a,i,o=1)=>{const s=t.helper.number("level",e),l=t.helper.number("ram",a),c=t.helper.number("cores",i),f=t.helper.number("mult",o);return n(t),Object(r.c)(s,l,c,f)},levelUpgradeCost:t=>(e,a=1,i=1)=>{const o=t.helper.number("startingLevel",e),s=t.helper.number("extraLevels",a),l=t.helper.number("costMult",i);return n(t),Object(r.b)(o,s,l)},ramUpgradeCost:t=>(e,a=1,i=1)=>{const o=t.helper.number("startingRam",e),s=t.helper.number("extraLevels",a),l=t.helper.number("costMult",i);return n(t),Object(r.e)(o,s,l)},coreUpgradeCost:t=>(e,a=1,i=1)=>{const o=t.helper.number("startingCore",e),s=t.helper.number("extraCores",a),l=t.helper.number("costMult",i);return n(t),Object(r.a)(o,s,l)},hacknetNodeCost:t=>(e,a)=>{const i=t.helper.number("n",e),o=t.helper.number("mult",a);return n(t),Object(r.d)(i,o)},constants:t=>()=>(n(t),Object.assign({},o.a))},hacknetServers:{hashGainRate:t=>(e,a,r,o,s=1)=>{const l=t.helper.number("level",e),c=t.helper.number("ramUsed",a),f=t.helper.number("maxRam",r),u=t.helper.number("cores",o),m=t.helper.number("mult",s);return n(t),Object(i.c)(l,c,f,u,m)},levelUpgradeCost:t=>(e,a=1,r=1)=>{const o=t.helper.number("startingLevel",e),s=t.helper.number("extraLevels",a),l=t.helper.number("costMult",r);return n(t),Object(i.d)(o,s,l)},ramUpgradeCost:t=>(e,a=1,r=1)=>{const o=t.helper.number("startingRam",e),s=t.helper.number("extraLevels",a),l=t.helper.number("costMult",r);return n(t),Object(i.e)(o,s,l)},coreUpgradeCost:t=>(e,a=1,r=1)=>{const o=t.helper.number("startingCore",e),s=t.helper.number("extraCores",a),l=t.helper.number("costMult",r);return n(t),Object(i.b)(o,s,l)},cacheUpgradeCost:t=>(e,a=1)=>{const r=t.helper.number("startingCache",e),o=t.helper.number("extraCache",a);return n(t),Object(i.a)(r,o)},hashUpgradeCost:a=>(r,i)=>{const o=e.string("hashUpgradeCost","upgName",r),s=a.helper.number("level",i);n(a);const l=t.hashManager.getUpgrade(o);if(!l)throw e.makeRuntimeErrorMsg("formulas.hacknetServers.calculateHashUpgradeCost","Invalid Hash Upgrade: "+o);return l.getCost(s)},hacknetServerCost:t=>(e,a=1)=>{const r=t.helper.number("n",e),o=t.helper.number("mult",a);return n(t),Object(i.f)(r,o)},constants:t=>()=>(n(t),Object.assign({},o.b))},gang:{wantedPenalty:t=>e=>(n(t),Object(f.f)(e)),respectGain:t=>(e,a,r)=>(n(t),Object(f.d)(e,a,r)),wantedLevelGain:t=>(e,a,r)=>(n(t),Object(f.e)(e,a,r)),moneyGain:t=>(e,a,r)=>(n(t),Object(f.c)(e,a,r)),ascensionPointsGain:t=>e=>{const a=t.helper.number("exp",e);return n(t),Object(f.b)(a)},ascensionMultiplier:t=>e=>{const a=t.helper.number("points",e);return n(t),Object(f.a)(a)}}}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(245),r=n(103),i=n(228),o=n(117),s=n(75),l=n(99),c=n(231);function f(t,e){const n=function(e){if(!t.hasWseAccount)throw e.makeRuntimeErrorMsg(`You don't have WSE Access! Cannot use ${e.function}()`);if(!t.hasTixApiAccess)throw e.makeRuntimeErrorMsg(`You don't have TIX API Access! Cannot use ${e.function}()`)},f=function(t,e){const n=r.b[e];if(null==n)throw t.makeRuntimeErrorMsg(`Invalid stock symbol: '${e}'`);return n};return{getSymbols:t=>()=>(n(t),Object.values(l.a)),getPrice:t=>e=>{const a=t.helper.string("symbol",e);n(t);return f(t,a).price},getAskPrice:t=>e=>{const a=t.helper.string("symbol",e);n(t);return f(t,a).getAskPrice()},getBidPrice:t=>e=>{const a=t.helper.string("symbol",e);n(t);return f(t,a).getBidPrice()},getPosition:t=>e=>{const a=t.helper.string("symbol",e);n(t);const i=r.b[a];if(null==i)throw t.makeRuntimeErrorMsg("Invalid stock symbol: "+a);return[i.playerShares,i.playerAvgPx,i.playerShortShares,i.playerAvgShortPx]},getMaxShares:t=>e=>{const a=t.helper.string("symbol",e);n(t);return f(t,a).maxShares},getPurchaseCost:t=>(e,a,r)=>{const o=t.helper.string("symbol",e);let l=t.helper.number("shares",a);const c=t.helper.string("posType",r);n(t);const u=f(t,o);let m;l=Math.round(l);const h=c.toLowerCase();if(h.includes("l"))m=s.a.Long;else{if(!h.includes("s"))return 1/0;m=s.a.Short}const d=Object(i.b)(u,l,m);return null==d?1/0:d},getSaleGain:t=>(e,a,r)=>{const o=t.helper.string("symbol",e);let l=t.helper.number("shares",a);const c=t.helper.string("posType",r);n(t);const u=f(t,o);let m;l=Math.round(l);const h=c.toLowerCase();if(h.includes("l"))m=s.a.Long;else{if(!h.includes("s"))return 0;m=s.a.Short}const d=Object(i.c)(u,l,m);return null==d?0:d},buy:t=>(r,i)=>{const o=t.helper.string("symbol",r),s=t.helper.number("shares",i);n(t);const l=f(t,o);return Object(a.a)(l,s,e,{})?l.getAskPrice():0},sell:t=>(r,i)=>{const o=t.helper.string("symbol",r),s=t.helper.number("shares",i);n(t);const l=f(t,o);return Object(a.c)(l,s,e,{})?l.getBidPrice():0},short:r=>(i,o)=>{const s=r.helper.string("symbol",i),l=r.helper.number("shares",o);if(n(r),8!==t.bitNodeN&&t.sourceFileLvl(8)<=1)throw r.makeRuntimeErrorMsg("You must either be in BitNode-8 or you must have Source-File 8 Level 2.");const c=f(r,s);return Object(a.d)(c,l,e,{})?c.getBidPrice():0},sellShort:r=>(i,o)=>{const s=r.helper.string("symbol",i),l=r.helper.number("shares",o);if(n(r),8!==t.bitNodeN&&t.sourceFileLvl(8)<=1)throw r.makeRuntimeErrorMsg("You must either be in BitNode-8 or you must have Source-File 8 Level 2.");const c=f(r,s);return Object(a.b)(c,l,e,{})?c.getAskPrice():0},placeOrder:a=>(i,l,c,u,m)=>{const h=a.helper.string("symbol",i),d=a.helper.number("shares",l),p=a.helper.number("price",c),g=a.helper.string("type",u),y=a.helper.string("pos",m);if(n(a),8!==t.bitNodeN&&t.sourceFileLvl(8)<=2)throw a.makeRuntimeErrorMsg("You must either be in BitNode-8 or you must have Source-File 8 Level 3.");const b=f(a,h);let E,v;const k=g.toLowerCase();if(k.includes("limit")&&k.includes("buy"))E=o.a.LimitBuy;else if(k.includes("limit")&&k.includes("sell"))E=o.a.LimitSell;else if(k.includes("stop")&&k.includes("buy"))E=o.a.StopBuy;else{if(!k.includes("stop")||!k.includes("sell"))throw a.makeRuntimeErrorMsg("Invalid order type: "+g);E=o.a.StopSell}const _=y.toLowerCase();if(_.includes("l"))v=s.a.Long;else{if(!_.includes("s"))throw a.makeRuntimeErrorMsg("Invalid position type: "+y);v=s.a.Short}return Object(r.j)(b,d,p,E,v,e)},cancelOrder:a=>(i,l,c,u,m)=>{const h=a.helper.string("symbol",i),d=a.helper.number("shares",l),p=a.helper.number("price",c),g=a.helper.string("type",u),y=a.helper.string("pos",m);if(n(a),8!==t.bitNodeN&&t.sourceFileLvl(8)<=2)throw a.makeRuntimeErrorMsg("You must either be in BitNode-8 or you must have Source-File 8 Level 3.");const b=f(a,h);if(isNaN(d)||isNaN(p))throw a.makeRuntimeErrorMsg(`Invalid shares or price. Must be numeric. shares=${d}, price=${p}`);let E,v;const k=g.toLowerCase();if(k.includes("limit")&&k.includes("buy"))E=o.a.LimitBuy;else if(k.includes("limit")&&k.includes("sell"))E=o.a.LimitSell;else if(k.includes("stop")&&k.includes("buy"))E=o.a.StopBuy;else{if(!k.includes("stop")||!k.includes("sell"))throw a.makeRuntimeErrorMsg("Invalid order type: "+g);E=o.a.StopSell}const _=y.toLowerCase();if(_.includes("l"))v=s.a.Long;else{if(!_.includes("s"))throw a.makeRuntimeErrorMsg("Invalid position type: "+y);v=s.a.Short}const w={stock:b,shares:d,price:p,type:E,pos:v};return Object(r.c)(w,e)},getOrders:e=>()=>{if(n(e),8!==t.bitNodeN&&t.sourceFileLvl(8)<=2)throw e.makeRuntimeErrorMsg("You must either be in BitNode-8 or have Source-File 8 Level 3.");const a={},i=r.a.Orders;for(const t of Object.keys(i)){const e=i[t];if(e.constructor===Array&&e.length>0){a[t]=[];for(let n=0;nn=>{const a=e.helper.string("symbol",n);if(!t.has4SDataTixApi)throw e.makeRuntimeErrorMsg("You don't have 4S Market Data TIX API Access!");return f(e,a).mv/100},getForecast:e=>n=>{const a=e.helper.string("symbol",n);if(!t.has4SDataTixApi)throw e.makeRuntimeErrorMsg("You don't have 4S Market Data TIX API Access!");const r=f(e,a);let i=50;return r.b?i+=r.otlkMag:i-=r.otlkMag,i/100},purchase4SMarketData:e=>()=>t.has4SData?(e.log(()=>"Already purchased 4S Market Data."),!0):t.money"Not enough money to purchase 4S Market Data."),!1):(t.has4SData=!0,t.loseMoney(Object(c.a)(),"stock"),e.log(()=>"Purchased 4S Market Data"),!0),purchase4SMarketDataTixApi:e=>()=>(n(e),t.has4SDataTixApi?(e.log(()=>"Already purchased 4S Market Data TIX API"),!0):t.money"Not enough money to purchase 4S Market Data TIX API"),!1):(t.has4SDataTixApi=!0,t.loseMoney(Object(c.b)(),"stock"),e.log(()=>"Purchased 4S Market Data TIX API"),!0)),purchaseWseAccount:e=>()=>t.hasWseAccount?(e.log(()=>"Already purchased WSE Account"),!0):t.money"Not enough money to purchase WSE Account Access"),!1):(t.hasWseAccount=!0,Object(r.g)(),t.loseMoney(Object(c.d)(),"stock"),e.log(()=>"Purchased WSE Account Access"),!0),purchaseTixApi:e=>()=>t.hasTixApiAccess?(e.log(()=>"Already purchased TIX API"),!0):t.money"Not enough money to purchase TIX API Access"),!1):(t.hasTixApiAccess=!0,t.loseMoney(Object(c.c)(),"stock"),e.log(()=>"Purchased TIX API"),!0)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(79),r=n(105),i=n(15),o=n(483),s=n(269),l=n(90);function c(t){const e=e=>{if(!t.canAccessGrafting())throw e.makeRuntimeErrorMsg("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")};return{getAugmentationGraftPrice:n=>r=>{const i=n.helper.string("augName",r);if(e(n),!Object(s.b)(t).includes(i)||!a.a.hasOwnProperty(i))throw n.makeRuntimeErrorMsg("Invalid aug: "+i);return new o.a(a.a[i]).cost},getAugmentationGraftTime:n=>r=>{const i=n.helper.string("augName",r);if(e(n),!Object(s.b)(t).includes(i)||!a.a.hasOwnProperty(i))throw n.makeRuntimeErrorMsg("Invalid aug: "+i);const l=new o.a(a.a[i]);return Object(s.a)(t,l)},getGraftableAugmentations:n=>()=>{e(n);return Object(s.b)(t)},graftAugmentation:n=>(c,f=!0)=>{const u=n.helper.string("augName",c),m=n.helper.boolean(f);if(e(n),t.city!==i.a.NewTokyo)throw n.makeRuntimeErrorMsg("You must be in New Tokyo to begin grafting an Augmentation.");if(!Object(s.b)(t).includes(u)||!a.a.hasOwnProperty(u))return n.log(()=>"Invalid aug: "+u),!1;const h=t.focus;if(t.isWorking){const e=t.singularityStopWork();n.log(()=>e)}const d=new o.a(a.a[u]);return t.money"You don't have enough money to craft "+u),!1):Object(r.b)(d.augmentation)?(t.loseMoney(d.cost,"augmentations"),t.startGraftAugmentationWork(u,d.time),m?(t.startFocusing(),l.b.toWork()):h&&(t.stopFocusing(),l.b.toTerminal()),n.log(()=>`Began grafting Augmentation ${u}.`),!0):(n.log(()=>"You don't have the pre-requisites for "+u),!1)}}}},,,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(2),r=n(255),i=n(24);const o=[["getHackTime","returns milliseconds"],["getGrowTime","returns milliseconds"],["getWeakenTime","returns milliseconds"],["getActionTime","returns milliseconds"],["hackAnalyzePercent","renamed 'hackAnalyze' and returns decimal"],["hackChance","renamed 'hackAnalyzeChance'"],["basic.calculateSkill","renamed 'skills.calculateSkill'"],["basic.calculateExp","renamed 'skills.calculateExp'"],["basic.hackChance","renamed 'hacking.hackChance'"],["basic.hackExp","renamed 'hacking.hackExp'"],["basic.hackPercent","renamed 'hacking.hackPercent'"],["basic.growPercent","renamed 'hacking.growPercent'"],["basic.hackTime","renamed 'hacking.hackTime'"],["basic.growTime","renamed 'hacking.growTime'"],["basic.weakenTime","renamed 'hacking.weakenTime'"],["write","needs to be awaited"],["scp","needs to be awaited"],["sleep","Can no longer be called simultenaously."],["hacking_skill","renamed 'hacking'"],["tryWrite","renamed 'tryWritePort'"]],s=[[/ns.getHackTime/g,"((...a)=>ns.getHackTime(...a)/1000)"],[/ns.getGrowTime/g,"((...a)=>ns.getGrowTime(...a)/1000)"],[/ns.getWeakenTime/g,"((...a)=>ns.getWeakenTime(...a)/1000)"],[/ns.bladeburner.getActionTime/g,"((...a)=>ns.bladeburner.getActionTime(...a)/1000)"],[/ns.hackAnalyzePercent/g,"((...a)=>ns.hackAnalyze(...a)*100)"],[/ns.hackChance/g,"ns.hackAnalyzeChance"],[/ns.tryWrite/g,"ns.tryWritePort"],[/formulas.basic.calculateSkill/g,"formulas.skills.calculateSkill"],[/formulas.basic.calculateExp/g,"formulas.skills.calculateExp"],[/formulas.basic.hackChance/g,"formulas.hacking.hackChance"],[/formulas.basic.hackExp/g,"formulas.hacking.hackExp"],[/formulas.basic.hackPercent/g,"formulas.hacking.hackPercent"],[/formulas.basic.growPercent/g,"formulas.hacking.growPercent"],[/formulas.basic.hackTime/g,"formulas.hacking.hackTime"],[/formulas.basic.growTime/g,"formulas.hacking.growTime"],[/formulas.basic.weakenTime/g,"formulas.hacking.weakenTime"]];function l(t){for(const e of s)if(t.match(e[0]))return!0;return!1}function c(t){const e=t.split("\n"),n=[];for(let t=0;tObject(T.a)({textfield:{borderBottom:"1px solid "+t.palette.primary.main},code:{whiteSpace:"pre",backgroundColor:t.palette.background.paper}}));var P;function I(){const[t,e]=Object(a.useState)(!1),[n,c]=Object(a.useState)(P.None),u=N(),y={[P.None]:"n00dles.script",[P.NS1]:"n00dles.script",[P.NS2]:"n00dles.js"}[n],E={[A.f.Start]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,null,"Welcome to Bitburner, a cyberpunk-themed incremental RPG! The game takes place in a dark, dystopian future... The year is 2077...",r.a.createElement("br",null),r.a.createElement("br",null),"This tutorial will show you the basics of the game. You may skip the tutorial at any time.",r.a.createElement("br",null),r.a.createElement("br",null),"You can also collapse this panel to temporarily hide this tutorial.")),canNext:!0},[A.f.NSSelection]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,null,"The tutorial will adjust to your programming ability."),r.a.createElement(o.a,null,"Bitburner has 2 types of scripts:"),r.a.createElement(p.a,null,r.a.createElement(g.a,null,r.a.createElement(o.a,null,"NS1: Javascript from 2009, very simple. Recommended for beginners to programming.")),r.a.createElement(g.a,null,r.a.createElement(o.a,null,"NS2: Native, modern Javascript. Recommended if you know any programming language or are serious about learning programming."))),r.a.createElement(o.a,null,"Both are available at all time and interchangeably. This choice is only for the tutorial."),r.a.createElement(l.a,{onClick:()=>{c(P.NS1),Object(A.c)()}},"Use NS1"),r.a.createElement(l.a,{onClick:()=>{c(P.NS2),Object(A.c)()}},"Use NS2"),r.a.createElement(l.a,{onClick:()=>e(!0)},"More info"),r.a.createElement("br",null)),canNext:!1},[A.f.GoToCharacterPage]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,null,"Let's start by heading to the Stats page. Click"),r.a.createElement(g.a,null,r.a.createElement(b.a,{color:"error"}),r.a.createElement(o.a,{color:"error"},"Stats")),r.a.createElement(o.a,null,"on the main navigation menu (left-hand side of the screen)")),canNext:!1},[A.f.CharacterPage]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(g.a,null,r.a.createElement(b.a,{color:"primary"}),r.a.createElement(o.a,{color:"primary"},"Stats")),r.a.createElement(o.a,null,"shows a lot of important information about your progress, such as your skills, money, and bonuses.")),canNext:!0},[A.f.CharacterGoToTerminalPage]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,null,"Let's head to your computer's terminal by clicking"),r.a.createElement(g.a,null,r.a.createElement(v.a,{color:"error"}),r.a.createElement(o.a,{color:"error"},"Terminal")),r.a.createElement(o.a,null,"on the main navigation menu.")),canNext:!1},[A.f.TerminalIntro]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(g.a,null,r.a.createElement(v.a,{color:"primary"}),r.a.createElement(o.a,{color:"primary"},"Terminal")),r.a.createElement(o.a,null,"is used to interface with your home computer as well as all of the other machines around the world.")),canNext:!0},[A.f.TerminalHelp]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,null,"Let's try it out. Start by entering"),r.a.createElement(o.a,{classes:{root:u.textfield}},"[home ~/]> help"),r.a.createElement(o.a,null,"(Don't forget to press Enter after typing the command)")),canNext:!1},[A.f.TerminalLs]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,{classes:{root:u.textfield}},"[home ~/]> help"),r.a.createElement(o.a,null,"displays a list of all available Terminal commands, how to use them, and a description of what they do."," ",r.a.createElement("br",null),r.a.createElement("br",null),"Let's try another command. Enter"),r.a.createElement(o.a,{classes:{root:u.textfield}},"[home ~/]> ls")),canNext:!1},[A.f.TerminalScan]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,{classes:{root:u.textfield}},"[home ~/]> ls"),r.a.createElement(o.a,null," ","is a basic command that shows files on the computer. Right now, it shows that you have a program called"," ","NUKE.exe on your computer. We'll get to what this does later. ",r.a.createElement("br",null),r.a.createElement("br",null),"Using your home computer's terminal, you can connect to other machines throughout the world. Let's do that now by first entering"),r.a.createElement(o.a,{classes:{root:u.textfield}},"[home ~/]> scan")),canNext:!1},[A.f.TerminalScanAnalyze1]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,{classes:{root:u.textfield}},"[home ~/]> scan"),r.a.createElement(o.a,null,"shows all available network connections. In other words, it displays a list of all servers that can be connected to from your current machine. A server is identified by its hostname. ",r.a.createElement("br",null),r.a.createElement("br",null),"That's great and all, but there's so many servers. Which one should you go to?"," "),r.a.createElement(o.a,{classes:{root:u.textfield}},"[home ~/]> scan-analyze"),r.a.createElement(o.a,null,"gives some more detailed information about servers on the network. Try it now!")),canNext:!1},[A.f.TerminalScanAnalyze2]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,{classes:{root:u.textfield}},"[home ~/]> scan-analyze"),r.a.createElement(o.a,null,"shows more detailed information about each server that you can connect to (servers that are a distance of one node away). ",r.a.createElement("br",null),r.a.createElement("br",null)," It is also possible to run scan-analyze with a higher depth. Let's try a depth of two with the following command:"," "),r.a.createElement(o.a,{classes:{root:u.textfield}},"[home ~/]> scan-analyze 2")),canNext:!1},[A.f.TerminalConnect]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,null,"Now you can see information about all servers that are up to two nodes away, as well as figure out how to navigate to those servers through the network. You can only connect to a server that is one node away. To connect to a machine, use"),r.a.createElement(o.a,{classes:{root:u.textfield}},"[home ~/]> connect hostname"),r.a.createElement(o.a,null,"From the results of "),r.a.createElement(o.a,{classes:{root:u.textfield}},"[home ~/]> scan-analyze 2"),r.a.createElement(o.a,null," ","we can see that the n00dles server is only one node away. Let's connect to it now using:"),r.a.createElement(o.a,{classes:{root:u.textfield}},"[home ~/]> connect n00dles")),canNext:!1},[A.f.TerminalAnalyze]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,null,"You are now connected to another machine! What can you do now? You can hack it!",r.a.createElement("br",null),r.a.createElement("br",null)," In the year 2077, currency has become digital and decentralized. People and corporations store their money on servers and computers. Using your hacking abilities, you can hack servers to steal money and gain experience. ",r.a.createElement("br",null),r.a.createElement("br",null),"Before you try to hack a server, you should run diagnostics using"," "),r.a.createElement(o.a,{classes:{root:u.textfield}},"[n00dles ~/]> analyze")),canNext:!1},[A.f.TerminalNuke]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,null,"When "),r.a.createElement(o.a,{classes:{root:u.textfield}},"[n00dles ~/]> analyze"),r.a.createElement(o.a,null,"finishes running it will show useful information about hacking the server. ",r.a.createElement("br",null),r.a.createElement("br",null)," For this server, the required hacking skill is only 1, which means you can hack it right now. However, in order to hack a server you must first gain root access. The NUKE.exe program that we saw earlier on your home computer is a virus that will grant you root access to a machine if there are enough open ports."),r.a.createElement(o.a,{classes:{root:u.textfield}},"[n00dles ~/]> analyze"),r.a.createElement(o.a,null," ","shows that there do not need to be any open ports on this machine for the NUKE virus to work, so go ahead and run the virus using"," "),r.a.createElement(o.a,{classes:{root:u.textfield}},"[n00dles ~/]> run NUKE.exe"),r.a.createElement(o.a,null)),canNext:!0},[A.f.TerminalManualHack]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,null,"You now have root access! You can hack the server using "),r.a.createElement(o.a,{classes:{root:u.textfield}},"[n00dles ~/]> hack"),r.a.createElement(o.a,null," Try doing that now.")),canNext:!0},[A.f.TerminalHackingMechanics]:{content:r.a.createElement(o.a,null,"You are now attempting to hack the server. Performing a hack takes time and only has a certain percentage chance of success. This time and success chance is determined by a variety of factors, including your hacking skill and the server's security level.",r.a.createElement("br",null),r.a.createElement("br",null),"If your attempt to hack the server is successful, you will steal a certain percentage of the server's total money. This percentage is affected by your hacking skill and the server's security level.",r.a.createElement("br",null),r.a.createElement("br",null),"The amount of money on a server is not limitless. So, if you constantly hack a server and deplete its money, then you will encounter diminishing returns in your hacking. You will need to use"," ",r.a.createElement(o.a,{classes:{root:u.textfield}},"[n00dles ~/]> grow"),"which tricks the company into adding money to their server and"," ",r.a.createElement(o.a,{classes:{root:u.textfield}},"[n00dles ~/]> weaken"),"which increases the speed of hack and grow."),canNext:!0},[A.f.TerminalGoHome]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,null,"From any server you can get back home using"),r.a.createElement(o.a,{classes:{root:u.textfield}},"[n00dles ~/]> home"),r.a.createElement(o.a,null,"Let's head home before creating our first script!")),canNext:!0},[A.f.TerminalCreateScript]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,null,"Hacking is the core mechanic of the game and is necessary for progressing. However, you don't want to be hacking manually the entire time. You can automate your hacking by writing scripts!",r.a.createElement("br",null),r.a.createElement("br",null),"To create a new script or edit an existing one, you can use"," "),r.a.createElement(o.a,{classes:{root:u.textfield}},"[home ~/]> nano"),r.a.createElement(o.a,null,"Scripts must end with the .script extension. Let's make a script now by entering "),r.a.createElement(o.a,{classes:{root:u.textfield}},"[home ~/]> nano "+y),r.a.createElement(o.a,null,"after the hack command finishes running (Sidenote: Pressing ctrl + c will end a command like hack early)")),canNext:!1},[A.f.TerminalTypeScript]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,null,"This is the script editor. You can use it to program your scripts."," ",n!==P.NS2&&r.a.createElement(r.a.Fragment,null,"Scripts are written in a simplified version of javascript.")," Copy and paste the following code into the script editor: ",r.a.createElement("br",null)),r.a.createElement(o.a,{classes:{root:u.code}},n!==P.NS2&&r.a.createElement(d.a,{value:"while(true) {\n hack('n00dles');\n}"}),n===P.NS2&&r.a.createElement(d.a,{value:"export async function main(ns) {\n\twhile(true) {\n\t\tawait ns.hack('n00dles');\n\t}\n}"})),r.a.createElement(o.a,null,"For anyone with basic programming experience, this code should be straightforward. This script will continuously hack the n00dles server.",r.a.createElement("br",null),r.a.createElement("br",null),"To save and close the script editor, press the button in the bottom left, or press ctrl + s then ctrl + b.")),canNext:!1},[A.f.TerminalFree]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,null,"Now we'll run the script. Scripts require a certain amount of RAM to run, and can be run on any machine which you have root access to. Different servers have different amounts of RAM. You can also purchase more RAM for your home server.",r.a.createElement("br",null),r.a.createElement("br",null),"To check how much RAM is available on this machine, enter"),r.a.createElement(o.a,{classes:{root:u.textfield}},"[home ~/]> free")),canNext:!1},[A.f.TerminalRunScript]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,null,"We have 8GB of free RAM on this machine, which is enough to run our script. Let's run our script using"),r.a.createElement(o.a,{classes:{root:u.textfield}},"[home ~/]> run "+y)),canNext:!1},[A.f.TerminalGoToActiveScriptsPage]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,null,"Your script is now running! It will continuously run in the background and will automatically stop if the code ever completes (the n00dles.script will never complete because it runs an infinite loop). ",r.a.createElement("br",null),r.a.createElement("br",null),"These scripts can passively earn you income and hacking experience. Your scripts will also earn money and experience while you are offline, although at a slightly slower rate. ",r.a.createElement("br",null),r.a.createElement("br",null),"Let's check out some statistics for our running scripts by clicking"," "),r.a.createElement(g.a,null,r.a.createElement(C.a,{color:"error"}),r.a.createElement(o.a,{color:"error"},"Active Scripts"))),canNext:!1},[A.f.ActiveScriptsPage]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,null,"This page displays information about all of your scripts that are running across every server. You can use this to gauge how well your scripts are doing. Let's go back to"),r.a.createElement(g.a,null,r.a.createElement(v.a,{color:"error"}),r.a.createElement(o.a,{color:"error"},"Terminal"))),canNext:!1},[A.f.ActiveScriptsToTerminal]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,null,"One last thing about scripts, each active script contains logs that detail what it's doing. We can check these logs using the tail command. Do that now for the script we just ran by typing"," "),r.a.createElement(o.a,{classes:{root:u.textfield}},"[home ~/]> tail "+y)),canNext:!1},[A.f.TerminalTailScript]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,null,"The log for this script won't show much right now (it might show nothing at all) because it just started running...but check back again in a few minutes! ",r.a.createElement("br",null),r.a.createElement("br",null),"This covers the basics of hacking. To learn more about writing scripts, select"),r.a.createElement(g.a,null,r.a.createElement(_.a,{color:"primary"}),r.a.createElement(o.a,{color:"primary"},"Tutorial")),r.a.createElement(o.a,null,"in the main navigation menu to look at the documentation.",r.a.createElement("br",null),r.a.createElement("br",null),"For now, let's move on to something else!")),canNext:!0},[A.f.GoToHacknetNodesPage]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,null,"Hacking is not the only way to earn money. One other way to passively earn money is by purchasing and upgrading Hacknet Nodes. Let's go to"),r.a.createElement(g.a,null,r.a.createElement(S.a,{color:"error"}),r.a.createElement(o.a,{color:"error"},"Hacknet")),r.a.createElement(o.a,null,"through the main navigation menu now.")),canNext:!0},[A.f.HacknetNodesIntroduction]:{content:r.a.createElement(o.a,null,"Here you can purchase new Hacknet Nodes and upgrade your existing ones. Let's purchase a new one now."),canNext:!0},[A.f.HacknetNodesGoToWorldPage]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,null,"You just purchased a Hacknet Node! This Hacknet Node will passively earn you money over time, both online and offline. When you get enough money, you can upgrade your newly-purchased Hacknet Node below.",r.a.createElement("br",null),r.a.createElement("br",null),"Let's go to"),r.a.createElement(g.a,null,r.a.createElement(O.a,{color:"error"}),r.a.createElement(o.a,{color:"error"},"City"))),canNext:!0},[A.f.WorldDescription]:{content:r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,null,"This page lists all of the different locations you can currently travel to. Each location has something that you can do. There's a lot of content out in the world, make sure you explore and discover!",r.a.createElement("br",null),r.a.createElement("br",null),"Lastly, click on"),r.a.createElement(g.a,null,r.a.createElement(_.a,{color:"error"}),r.a.createElement(o.a,{color:"error"},"Tutorial"))),canNext:!0},[A.f.TutorialPageInfo]:{content:r.a.createElement(o.a,null,"This page contains a lot of different documentation about the game's content and mechanics. I know it's a lot, but I highly suggest you read (or at least skim) through this before you start playing . That's the end of the tutorial. Hope you enjoy the game!"),canNext:!0},[A.f.End]:{content:r.a.createElement(o.a,null),canNext:!0}},k=Object(a.useState)(!1)[1];function w(){k(t=>!t)}Object(a.useEffect)(()=>h.a.subscribe(w),[]);const x=A.a.currStep,L=E[x];if(void 0===L)throw new Error("error in the tutorial");return r.a.createElement(r.a.Fragment,null,r.a.createElement(R.a,{open:t,onClose:()=>e(!1)}),r.a.createElement(i.a,{square:!0,sx:{maxWidth:"70vw",p:2}},L.content,x!==A.f.TutorialPageInfo&&r.a.createElement(r.a.Fragment,null,x!==A.f.Start&&r.a.createElement(s.a,{onClick:A.d,"aria-label":"previous"},r.a.createElement(m.a,null)),L.canNext&&r.a.createElement(s.a,{onClick:A.c,"aria-label":"next"},r.a.createElement(f.a,null))),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(l.a,{onClick:A.b},x!==A.f.TutorialPageInfo?"SKIP TUTORIAL":"FINISH TUTORIAL")))}!function(t){t[t.None=0]="None",t[t.NS1=1]="NS1",t[t.NS2=2]="NS2"}(P||(P={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(532),r=n(503),i=n(216),o=n(1),s=n(0),l=n.n(s),c=n(38);function f(t){const[e,n]=l.a.useState(0);return l.a.createElement(c.a,{open:t.open,onClose:t.onClose,sx:{zIndex:999999}},l.a.createElement(r.a,{variant:"fullWidth",value:e,onChange:function(t,e){n(e)}},l.a.createElement(i.a,{label:"NS1"}),l.a.createElement(i.a,{label:"NS2"})),0===e&&l.a.createElement(l.a.Fragment,null,l.a.createElement(o.a,null,"These scripts end with '.script'. Using a very old interpreted version of javascript. It is perfect for beginner to programming."),l.a.createElement(o.a,null,"Example script using NS1:"),l.a.createElement(a.a,{loading:l.a.createElement(l.a.Fragment,null),defaultLanguage:"javascript",defaultValue:"while(true) {\n hack('n00dles');\n}",height:"300px",theme:"vs-dark",onMount:function(t){t.updateOptions({readOnly:!0})},options:{fontSize:30}})),1===e&&l.a.createElement(l.a.Fragment,null,l.a.createElement(o.a,null,"These scripts end with '.js'. Scripts using ns2 are running natively along the game. If you know any programming language you should be using this. However if you're unfamiliar with javascript Promises you might want to read up on them a little bit before diving in."),l.a.createElement(o.a,null,"Example script using NS2:"),l.a.createElement(a.a,{loading:l.a.createElement(l.a.Fragment,null),defaultLanguage:"javascript",defaultValue:"/** @param {NS} ns */\nexport async function main(ns) {\n\twhile(true) {\n\t\tawait ns.hack('n00dles');\n\t}\n}",height:"300px",theme:"vs-dark",options:{fontSize:30}})))}},,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return C}));var a=n(0),r=n.n(a),i=n(452),o=n.n(i),s=n(121),l=n(276),c=n(45),f=n(1086),u=n.n(f),m=n(1085),h=n.n(m),d=n(410),p=n.n(d),g=n(1087),y=n.n(g),b=n(29),E=n(25),v=n(6),k=n(19),_=n(1),w=n(8),S=n(115);const x=Object(s.a)({overviewContainer:{position:"fixed",top:0,right:0,zIndex:1500,display:"flex",justifyContent:"flex-end",flexDirection:"column"},header:{cursor:"grab",textAlign:"center",display:"flex",flexDirection:"row",alignItems:"center"},visibilityToggle:{padding:"2px",minWidth:"inherit",backgroundColor:"transparent",border:"none","&:hover":{backgroundColor:"rgba(255, 255, 255, 0.1)"}},collapse:{borderTop:"1px solid "+v.a.theme.welllight,margin:"0 auto"},icon:{fontSize:"24px"}});function C({children:t,mode:e}){const n=Object(a.useRef)(null),[i,s]=Object(a.useState)(v.a.overview.opened),[f,m]=Object(a.useState)(v.a.overview.x),[d,g]=Object(a.useState)(v.a.overview.y),C=x(),L=b.b.Router(),O=i?h.a:u.a,M="tutorial"===e?y.a:p.a,T="tutorial"===e?"Tutorial":"Overview";Object(a.useEffect)(()=>{v.a.overview={x:f,y:d,opened:i}},[i,f,d]),Object(a.useEffect)(()=>A(),[]),Object(a.useEffect)(()=>(window.addEventListener("resize",A),()=>{window.removeEventListener("resize",A)}),[]);const A=Object(S.debounce)(()=>{const t=null==n?void 0:n.current;t&&(R(t,"mouseover"),R(t,"mousedown"),R(document,"mousemove"),R(t,"mouseup"),R(t,"click"))},100),R=(t,e)=>{const n=document.createEvent("MouseEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)};return L.page()===E.a.BitVerse||L.page()===E.a.Loading||L.page()===E.a.Recovery?r.a.createElement(r.a.Fragment,null):r.a.createElement(o.a,{handle:".drag",bounds:"body",onStop:(t,e)=>{m(e.x),g(e.y)},defaultPosition:{x:f,y:d}},r.a.createElement(c.a,{className:C.overviewContainer,square:!0},r.a.createElement(k.a,{className:"drag",onDoubleClick:()=>s(t=>!t),ref:n},r.a.createElement(k.a,{className:C.header},r.a.createElement(M,{color:"secondary",className:C.icon,sx:{padding:"2px"}}),r.a.createElement(_.a,{flexGrow:1,color:"secondary"},T),r.a.createElement(w.a,{"aria-label":"expand or collapse character overview",variant:"text",size:"small",className:C.visibilityToggle},r.a.createElement(O,{className:C.icon,color:"secondary",onClick:()=>s(t=>!t),onTouchEnd:()=>s(t=>!t)})))),r.a.createElement(l.a,{in:i,className:C.collapse},t)))}},,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return Dt}));var a=n(0),r=n.n(a),i=n(27),o=n(13),s=n(17),l=n(144),c=n(121),f=n(1784),u=n(248),m=n(693),h=n(21),d=n(1093),p=n.n(d),g=n(1092),y=n.n(g),b=n(97),E=n(145),v=n(113),k=n(1),_=n(276),w=n(805),S=n(1094),x=n.n(S),C=n(349),L=n.n(C),O=n(1095),M=n.n(O),T=n(605),A=n.n(T),R=n(1096),N=n.n(R),P=n(410),I=n.n(P),F=n(1099),D=n.n(F),j=n(608),B=n.n(j),G=n(606),W=n.n(G),H=n(1100),U=n.n(H),q=n(607),$=n.n(q),K=n(1102),z=n.n(K),V=n(1103),Y=n.n(V),J=n(1104),X=n.n(J),Q=n(1105),Z=n.n(Q),tt=n(1106),et=n.n(tt),nt=n(1107),at=n.n(nt),rt=n(325),it=n.n(rt),ot=n(299),st=n.n(ot),lt=n(609),ct=n.n(lt),ft=n(1097),ut=n.n(ft),mt=n(1109),ht=n.n(mt),dt=n(1098),pt=n.n(dt),gt=n(1101),yt=n.n(gt),bt=n(1108),Et=n.n(bt),vt=n(209),kt=n.n(vt),_t=n(81),wt=n.n(_t),St=n(25),xt=n(10),Ct=n(44),Lt=n(1089),Ot=n(6),Mt=n(12),Tt=n(411),At=n(412),Rt=n(254);const Nt=t=>({width:t.spacing(31),transition:t.transitions.create("width",{easing:t.transitions.easing.sharp,duration:t.transitions.duration.enteringScreen}),overflowX:"hidden"}),Pt=t=>({transition:t.transitions.create("width",{easing:t.transitions.easing.sharp,duration:t.transitions.duration.leavingScreen}),overflowX:"hidden",width:`calc(${t.spacing(2)} + 1px)`,[t.breakpoints.up("sm")]:{width:`calc(${t.spacing(7)} + 1px)`}}),It=Object(s.a)(f.a,{shouldForwardProp:t=>"open"!==t})(({theme:t,open:e})=>({width:t.spacing(31),whiteSpace:"nowrap",boxSizing:"border-box",...e&&{...Nt(t),"& .MuiDrawer-paper":Nt(t)},...!e&&{...Pt(t),"& .MuiDrawer-paper":Pt(t)}})),Ft=Object(c.a)(t=>Object(l.a)({active:{borderLeft:"3px solid "+t.palette.primary.main},listitem:{}}));function Dt(t){const e=Object(a.useState)(!1)[1];function n(){e(t=>!t)}Object(a.useEffect)(()=>{const t=setInterval(n,200);return()=>clearInterval(t)},[]);const[s,l]=Object(a.useState)(!0),[c,f]=Object(a.useState)(!0),[d,g]=Object(a.useState)(!0),[S,C]=Object(a.useState)(!0),O=Ct.a.currStep===Ct.f.CharacterGoToTerminalPage||Ct.a.currStep===Ct.f.ActiveScriptsPage,T=Ct.a.currStep===Ct.f.GoToCharacterPage,R=Ct.a.currStep===Ct.f.TerminalGoToActiveScriptsPage,P=Ct.a.currStep===Ct.f.GoToHacknetNodesPage,F=Ct.a.currStep===Ct.f.HacknetNodesGoToWorldPage,j=Ct.a.currStep===Ct.f.WorldDescription,G=t.player.queuedAugmentations.length,H=t.player.factionInvitations.filter(t=>!At.b.includes(t)).length,q=Object(Lt.a)(t.player).length-Tt.b.length,K=t.player.factionInvitations.length>0||t.player.factions.length>0||t.player.augmentations.length>0||t.player.queuedAugmentations.length>0||t.player.sourceFiles.length>0,V=t.player.augmentations.length>0||t.player.queuedAugmentations.length>0||t.player.sourceFiles.length>0,J=t.player.sleeves.length>0,Q=!!t.player.corporation,tt=!!t.player.gang,nt=""!==t.player.companyName,rt=t.player.hasWseAccount,ot=!!t.player.bladeburner,lt=t.player.augmentations.some(t=>t.name===Mt.a.StaneksGift1);function ft(){t.router.toTerminal(),O&&Object(Ct.c)()}function mt(){t.router.toScriptEditor()}function dt(){t.router.toStats(),T&&Object(Ct.c)()}function gt(){t.router.toActiveScripts(),R&&Object(Ct.c)()}function bt(){t.router.toCreateProgram()}function vt(){t.router.toFactions()}function _t(){t.router.toAugmentations()}function Nt(){t.router.toHacknetNodes(),P&&Object(Ct.c)()}function Pt(){t.router.toCity(),F&&Object(Ct.c)()}function Dt(){t.router.toTravel()}function jt(){t.router.toJob()}function Bt(){t.router.toBladeburner()}function Gt(){t.router.toGang()}function Wt(){t.router.toTutorial(),j&&Object(Ct.c)()}Object(a.useEffect)(()=>{function e(e){if(!Ot.a.DisableHotkeys&&!(t.player.isWorking&&t.player.focus||t.router.page()===St.a.BitVerse))if(e.code===i.b.T&&e.altKey)e.preventDefault(),ft();else if(e.code===i.b.C&&e.altKey)e.preventDefault(),dt();else if(e.code===i.b.E&&e.altKey)e.preventDefault(),mt();else if(e.code===i.b.S&&e.altKey)e.preventDefault(),gt();else if(e.code===i.b.H&&e.altKey)e.preventDefault(),Nt();else if(e.code===i.b.W&&e.altKey)e.preventDefault(),Pt();else if(e.code===i.b.J&&e.altKey&&!e.ctrlKey&&!e.metaKey&&nt)e.preventDefault(),jt();else if(e.code===i.b.R&&e.altKey)e.preventDefault(),Dt();else if(e.code===i.b.P&&e.altKey)e.preventDefault(),bt();else if(e.code===i.b.F&&e.altKey){if(t.page==St.a.Terminal&&Ot.a.EnableBashHotkeys)return;e.preventDefault(),vt()}else e.code===i.b.A&&e.altKey?(e.preventDefault(),_t()):e.code===i.b.U&&e.altKey?(e.preventDefault(),Wt()):e.code===i.b.B&&e.altKey&&t.player.bladeburner?(e.preventDefault(),Bt()):e.code===i.b.G&&e.altKey&&t.player.gang&&(e.preventDefault(),Gt())}return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[]);const Ht=Ft(),[Ut,qt]=Object(a.useState)(t.opened);return Object(a.useEffect)(()=>{t.onToggled(Ut)},[Ut]),r.a.createElement(It,{open:Ut,anchor:"left",variant:"permanent"},r.a.createElement(b.a,{classes:{root:Ht.listitem},button:!0,onClick:()=>qt(t=>!t)},r.a.createElement(E.a,null,Ut?r.a.createElement(p.a,{color:"primary"}):r.a.createElement(y.a,{color:"primary"})),r.a.createElement(v.a,{primary:r.a.createElement(h.a,{title:Object(Rt.a)()},r.a.createElement(k.a,null,"Bitburner v",xt.a.VersionString))})),r.a.createElement(m.a,null),r.a.createElement(u.a,null,r.a.createElement(b.a,{classes:{root:Ht.listitem},button:!0,onClick:()=>l(t=>!t)},r.a.createElement(E.a,null,r.a.createElement(h.a,{title:Ut?"":"Hacking"},r.a.createElement(x.a,{color:"primary"}))),r.a.createElement(v.a,{primary:r.a.createElement(k.a,null,"Hacking")}),s?r.a.createElement(kt.a,{color:"primary"}):r.a.createElement(wt.a,{color:"primary"})),r.a.createElement(_.a,{in:s,timeout:"auto",unmountOnExit:!0},r.a.createElement(u.a,null,r.a.createElement(b.a,{classes:{root:Ht.listitem},button:!0,key:"Terminal",className:Object(o.default)({[Ht.active]:t.page===St.a.Terminal}),onClick:ft},r.a.createElement(E.a,null,r.a.createElement(h.a,{title:Ut?"":"Terminal"},r.a.createElement(L.a,{color:O?"error":t.page!==St.a.Terminal?"secondary":"primary"}))),r.a.createElement(v.a,null,r.a.createElement(k.a,{color:O?"error":t.page!==St.a.Terminal?"secondary":"primary"},"Terminal"))),r.a.createElement(b.a,{classes:{root:Ht.listitem},button:!0,key:"Script Editor",className:Object(o.default)({[Ht.active]:t.page===St.a.ScriptEditor}),onClick:mt},r.a.createElement(E.a,null,r.a.createElement(h.a,{title:Ut?"":"Script Editor"},r.a.createElement(M.a,{color:t.page!==St.a.ScriptEditor?"secondary":"primary"}))),r.a.createElement(v.a,null,r.a.createElement(k.a,{color:t.page!==St.a.ScriptEditor?"secondary":"primary"},"Script Editor"))),r.a.createElement(b.a,{classes:{root:Ht.listitem},button:!0,key:"Active Scripts",className:Object(o.default)({[Ht.active]:t.page===St.a.ActiveScripts}),onClick:gt},r.a.createElement(E.a,null,r.a.createElement(h.a,{title:Ut?"":"Active Scripts"},r.a.createElement(A.a,{color:R?"error":t.page!==St.a.ActiveScripts?"secondary":"primary"}))),r.a.createElement(v.a,null,r.a.createElement(k.a,{color:R?"error":t.page!==St.a.ActiveScripts?"secondary":"primary"},"Active Scripts"))),r.a.createElement(b.a,{button:!0,key:"Create Program",className:Object(o.default)({[Ht.active]:t.page===St.a.CreateProgram}),onClick:bt},r.a.createElement(E.a,null,r.a.createElement(w.a,{badgeContent:q>0?q:void 0,color:"error"},r.a.createElement(h.a,{title:Ut?"":"Create Program"},r.a.createElement(N.a,{color:t.page!==St.a.CreateProgram?"secondary":"primary"})))),r.a.createElement(v.a,null,r.a.createElement(k.a,{color:t.page!==St.a.CreateProgram?"secondary":"primary"},"Create Program"))),lt&&r.a.createElement(b.a,{button:!0,key:"Staneks Gift",className:Object(o.default)({[Ht.active]:t.page===St.a.StaneksGift}),onClick:function(){t.router.toStaneksGift()}},r.a.createElement(E.a,null,r.a.createElement(h.a,{title:Ut?"":"Stanek's Gift"},r.a.createElement(ut.a,{color:t.page!==St.a.StaneksGift?"secondary":"primary"}))),r.a.createElement(v.a,null,r.a.createElement(k.a,{color:t.page!==St.a.StaneksGift?"secondary":"primary"},"Stanek's Gift"))))),r.a.createElement(m.a,null),r.a.createElement(b.a,{classes:{root:Ht.listitem},button:!0,onClick:()=>f(t=>!t)},r.a.createElement(E.a,null,r.a.createElement(h.a,{title:Ut?"":"Character"},r.a.createElement(pt.a,{color:"primary"}))),r.a.createElement(v.a,{primary:r.a.createElement(k.a,null,"Character")}),c?r.a.createElement(kt.a,{color:"primary"}):r.a.createElement(wt.a,{color:"primary"})),r.a.createElement(_.a,{in:c,timeout:"auto",unmountOnExit:!0},r.a.createElement(b.a,{button:!0,key:"Stats",className:Object(o.default)({[Ht.active]:t.page===St.a.Stats}),onClick:dt},r.a.createElement(E.a,null,r.a.createElement(h.a,{title:Ut?"":"Stats"},r.a.createElement(I.a,{color:T?"error":t.page!==St.a.Stats?"secondary":"primary"}))),r.a.createElement(v.a,null,r.a.createElement(k.a,{color:T?"error":t.page!==St.a.Stats?"secondary":"primary"},"Stats"))),K&&r.a.createElement(b.a,{classes:{root:Ht.listitem},button:!0,key:"Factions",className:Object(o.default)({[Ht.active]:[St.a.Factions,St.a.Faction].includes(t.page)}),onClick:vt},r.a.createElement(E.a,null,r.a.createElement(w.a,{badgeContent:0!==H?H:void 0,color:"error"},r.a.createElement(h.a,{title:Ut?"":"Factions"},r.a.createElement(D.a,{color:[St.a.Factions,St.a.Faction].includes(t.page)?"primary":"secondary"})))),r.a.createElement(v.a,null,r.a.createElement(k.a,{color:[St.a.Factions,St.a.Faction].includes(t.page)?"primary":"secondary"},"Factions"))),V&&r.a.createElement(b.a,{classes:{root:Ht.listitem},button:!0,key:"Augmentations",className:Object(o.default)({[Ht.active]:t.page===St.a.Augmentations}),onClick:_t},r.a.createElement(E.a,null,r.a.createElement(w.a,{badgeContent:0!==G?G:void 0,color:"error"},r.a.createElement(h.a,{title:Ut?"":"Augmentations"},r.a.createElement(B.a,{style:{transform:"rotate(-90deg)"},color:t.page!==St.a.Augmentations?"secondary":"primary"})))),r.a.createElement(v.a,null,r.a.createElement(k.a,{color:t.page!==St.a.Augmentations?"secondary":"primary"},"Augmentations"))),r.a.createElement(b.a,{button:!0,key:"Hacknet",className:Object(o.default)({[Ht.active]:t.page===St.a.Hacknet}),onClick:Nt},r.a.createElement(E.a,null,r.a.createElement(h.a,{title:Ut?"":"Hacknet"},r.a.createElement(W.a,{color:P?"error":t.page!==St.a.Hacknet?"secondary":"primary"}))),r.a.createElement(v.a,null,r.a.createElement(k.a,{color:P?"error":t.page!==St.a.Hacknet?"secondary":"primary"},"Hacknet"))),J&&r.a.createElement(b.a,{classes:{root:Ht.listitem},button:!0,key:"Sleeves",className:Object(o.default)({[Ht.active]:t.page===St.a.Sleeves}),onClick:function(){t.router.toSleeves()}},r.a.createElement(E.a,null,r.a.createElement(h.a,{title:Ut?"":"Sleeves"},r.a.createElement(U.a,{color:t.page!==St.a.Sleeves?"secondary":"primary"}))),r.a.createElement(v.a,null,r.a.createElement(k.a,{color:t.page!==St.a.Sleeves?"secondary":"primary"},"Sleeves")))),r.a.createElement(m.a,null),r.a.createElement(b.a,{classes:{root:Ht.listitem},button:!0,onClick:()=>g(t=>!t)},r.a.createElement(E.a,null,r.a.createElement(h.a,{title:Ut?"":"World"},r.a.createElement(yt.a,{color:"primary"}))),r.a.createElement(v.a,{primary:r.a.createElement(k.a,null,"World")}),d?r.a.createElement(kt.a,{color:"primary"}):r.a.createElement(wt.a,{color:"primary"})),r.a.createElement(_.a,{in:d,timeout:"auto",unmountOnExit:!0},r.a.createElement(b.a,{button:!0,key:"City",className:Object(o.default)({[Ht.active]:t.page===St.a.City||t.page===St.a.Grafting||t.page===St.a.Location}),onClick:Pt},r.a.createElement(E.a,null,r.a.createElement(h.a,{title:Ut?"":"City"},r.a.createElement($.a,{color:F?"error":t.page!==St.a.City?"secondary":"primary"}))),r.a.createElement(v.a,null,r.a.createElement(k.a,{color:F?"error":t.page!==St.a.City?"secondary":"primary"},"City"))),r.a.createElement(b.a,{button:!0,key:"Travel",className:Object(o.default)({[Ht.active]:t.page===St.a.Travel}),onClick:Dt},r.a.createElement(E.a,null,r.a.createElement(h.a,{title:Ut?"":"Travel"},r.a.createElement(z.a,{color:t.page!==St.a.Travel?"secondary":"primary"}))),r.a.createElement(v.a,null,r.a.createElement(k.a,{color:t.page!==St.a.Travel?"secondary":"primary"},"Travel"))),nt&&r.a.createElement(b.a,{classes:{root:Ht.listitem},button:!0,key:"Job",className:Object(o.default)({[Ht.active]:t.page===St.a.Job}),onClick:jt},r.a.createElement(E.a,null,r.a.createElement(h.a,{title:Ut?"":"Job"},r.a.createElement(Y.a,{color:t.page!==St.a.Job?"secondary":"primary"}))),r.a.createElement(v.a,null,r.a.createElement(k.a,{color:t.page!==St.a.Job?"secondary":"primary"},"Job"))),rt&&r.a.createElement(b.a,{classes:{root:Ht.listitem},button:!0,key:"Stock Market",className:Object(o.default)({[Ht.active]:t.page===St.a.StockMarket}),onClick:function(){t.router.toStockMarket()}},r.a.createElement(E.a,null,r.a.createElement(h.a,{title:Ut?"":"Stock Market"},r.a.createElement(X.a,{color:t.page!==St.a.StockMarket?"secondary":"primary"}))),r.a.createElement(v.a,null,r.a.createElement(k.a,{color:t.page!==St.a.StockMarket?"secondary":"primary"},"Stock Market"))),ot&&r.a.createElement(b.a,{classes:{root:Ht.listitem},button:!0,key:"Bladeburner",className:Object(o.default)({[Ht.active]:t.page===St.a.Bladeburner}),onClick:Bt},r.a.createElement(E.a,null,r.a.createElement(h.a,{title:Ut?"":"Bladeburner"},r.a.createElement(Z.a,{color:t.page!==St.a.Bladeburner?"secondary":"primary"}))),r.a.createElement(v.a,null,r.a.createElement(k.a,{color:t.page!==St.a.Bladeburner?"secondary":"primary"},"Bladeburner"))),Q&&r.a.createElement(b.a,{classes:{root:Ht.listitem},button:!0,key:"Corp",className:Object(o.default)({[Ht.active]:t.page===St.a.Corporation}),onClick:function(){t.router.toCorporation()}},r.a.createElement(E.a,null,r.a.createElement(h.a,{title:Ut?"":"Corp"},r.a.createElement(et.a,{color:t.page!==St.a.Corporation?"secondary":"primary"}))),r.a.createElement(v.a,null,r.a.createElement(k.a,{color:t.page!==St.a.Corporation?"secondary":"primary"},"Corp"))),tt&&r.a.createElement(b.a,{classes:{root:Ht.listitem},button:!0,key:"Gang",className:Object(o.default)({[Ht.active]:t.page===St.a.Gang}),onClick:Gt},r.a.createElement(E.a,null,r.a.createElement(h.a,{title:Ut?"":"Gang"},r.a.createElement(at.a,{color:t.page!==St.a.Gang?"secondary":"primary"}))),r.a.createElement(v.a,null,r.a.createElement(k.a,{color:t.page!==St.a.Gang?"secondary":"primary"},"Gang")))),r.a.createElement(m.a,null),r.a.createElement(b.a,{classes:{root:Ht.listitem},button:!0,onClick:()=>C(t=>!t)},r.a.createElement(E.a,null,r.a.createElement(h.a,{title:Ut?"":"Help"},r.a.createElement(Et.a,{color:"primary"}))),r.a.createElement(v.a,{primary:r.a.createElement(k.a,null,"Help")}),S?r.a.createElement(kt.a,{color:"primary"}):r.a.createElement(wt.a,{color:"primary"})),r.a.createElement(_.a,{in:S,timeout:"auto",unmountOnExit:!0},r.a.createElement(b.a,{button:!0,key:"Milestones",className:Object(o.default)({[Ht.active]:t.page===St.a.Milestones}),onClick:function(){t.router.toMilestones()}},r.a.createElement(E.a,null,r.a.createElement(h.a,{title:Ut?"":"Milestones"},r.a.createElement(it.a,{color:t.page!==St.a.Milestones?"secondary":"primary"}))),r.a.createElement(v.a,null,r.a.createElement(k.a,{color:t.page!==St.a.Milestones?"secondary":"primary"},"Milestones"))),r.a.createElement(b.a,{button:!0,key:"Tutorial",className:Object(o.default)({[Ht.active]:t.page===St.a.Tutorial}),onClick:Wt},r.a.createElement(E.a,null,r.a.createElement(h.a,{title:Ut?"":"Tutorial"},r.a.createElement(st.a,{color:j?"error":t.page!==St.a.Tutorial?"secondary":"primary"}))),r.a.createElement(v.a,null,r.a.createElement(k.a,{color:j?"error":t.page!==St.a.Tutorial?"secondary":"primary"},"Tutorial"))),r.a.createElement(b.a,{button:!0,key:"Achievements",className:Object(o.default)({[Ht.active]:t.page===St.a.Achievements}),onClick:function(){t.router.toAchievements()}},r.a.createElement(E.a,null,r.a.createElement(h.a,{title:Ut?"":"Achievements"},r.a.createElement(ht.a,{color:t.page!==St.a.Achievements?"secondary":"primary"}))),r.a.createElement(v.a,null,r.a.createElement(k.a,{color:t.page!==St.a.Achievements?"secondary":"primary"},"Achievements"))),r.a.createElement(b.a,{button:!0,key:"Options",className:Object(o.default)({[Ht.active]:t.page===St.a.Options}),onClick:function(){t.router.toGameOptions()}},r.a.createElement(E.a,null,r.a.createElement(h.a,{title:Ut?"":"Options"},r.a.createElement(ct.a,{color:t.page!==St.a.Options?"secondary":"primary"}))),r.a.createElement(v.a,null,r.a.createElement(k.a,{color:t.page!==St.a.Options?"secondary":"primary"},"Options"))),!1)))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(65);function r(t){const e=[];for(const n of Object.keys(a.a)){const r=a.a[n].create;null!=r&&(t.hasProgram(a.a[n].name)||r.req(t)&&e.push(a.a[n]))}return e}},,,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return C}));var a=n(0),r=n.n(a),i=n(1111),o=n(1112),s=n(1113),l=n(1114),c=n(348),f=n(29),u=n(1),m=n(8),h=n(21),d=n(19),p=n(45),g=n(249),y=n(6),b=n(252),E=n(12),v=n(79),k=n(10),_=n(22),w=n(692);const S=({player:t})=>{var e,n;const a=null!==(e=null===(n=t.augmentations.find(t=>t.name===E.a.NeuroFluxGovernor))||void 0===n?void 0:n.level)&&void 0!==e?e:0;return a>0?r.a.createElement(p.a,{sx:{p:1}},r.a.createElement(u.a,{variant:"h5",color:y.a.theme.info},"NeuroFlux Governor - Level ",a),r.a.createElement(u.a,{color:y.a.theme.info},v.a[E.a.NeuroFluxGovernor].stats)):r.a.createElement(r.a.Fragment,null)},x=({player:t})=>t.entropy>0?r.a.createElement(p.a,{sx:{p:1}},r.a.createElement(u.a,{variant:"h5",color:y.a.theme.error},"Entropy Virus - Level ",t.entropy),r.a.createElement(u.a,{color:y.a.theme.error},r.a.createElement("b",null,"All multipliers decreased by:")," ",Object(_.f)(100*(1-k.a.EntropyEffect**t.entropy),3),"% (multiplicative)")):r.a.createElement(r.a.Fragment,null);function C(t){var e,n;const[v,k]=Object(a.useState)(!1),_=f.b.Player(),C=Object(a.useState)(!1)[1];function L(){C(t=>!t)}return Object(a.useEffect)(()=>{const t=setInterval(L,200);return()=>clearInterval(t)},[]),r.a.createElement(g.a,{disableGutters:!0,maxWidth:"lg",sx:{mx:0}},r.a.createElement(u.a,{variant:"h4"},"Augmentations"),r.a.createElement(d.a,{sx:{mb:1}},r.a.createElement(p.a,{sx:{p:1}},r.a.createElement(u.a,{variant:"h5",color:"primary",sx:{display:"flex",alignItems:"center",flexWrap:"wrap"}},"Purchased Augmentations",r.a.createElement(h.a,{title:r.a.createElement(r.a.Fragment,null,r.a.createElement(u.a,null,"Below is a list of all Augmentations you have purchased but not yet installed. Click the button below to install them."),r.a.createElement(u.a,null,"WARNING: Installing your Augmentations resets most of your progress, including:"),r.a.createElement("br",null),r.a.createElement(u.a,null,"- Stats/Skill levels and Experience"),r.a.createElement(u.a,null,"- Money"),r.a.createElement(u.a,null,"- Scripts on every computer but your home computer"),r.a.createElement(u.a,null,"- Purchased servers"),r.a.createElement(u.a,null,"- Hacknet Nodes"),r.a.createElement(u.a,null,"- Faction/Company reputation"),r.a.createElement(u.a,null,"- Stocks"),r.a.createElement("br",null),r.a.createElement(u.a,null,"Installing Augmentations lets you start over with the perks and benefits granted by all of the Augmentations you have ever installed. Also, you will keep any scripts and RAM/Core upgrades on your home computer (but you will lose all programs besides NUKE.exe)"))},r.a.createElement(w.a,{sx:{ml:1,mb:.5},color:"info"}))),r.a.createElement(b.a,{open:v,onClose:()=>k(!1),onConfirm:t.installAugmentationsFn,confirmationText:r.a.createElement(r.a.Fragment,null,"Installing will reset",r.a.createElement("br",null),r.a.createElement("br",null),"- money",r.a.createElement("br",null),"- skill / experience",r.a.createElement("br",null),"- every server except home",r.a.createElement("br",null),"- factions and reputation",r.a.createElement("br",null),r.a.createElement("br",null),"You will keep:",r.a.createElement("br",null),r.a.createElement("br",null),"- All scripts on home",r.a.createElement("br",null),"- home ram and cores",r.a.createElement("br",null),r.a.createElement("br",null),"It is recommended to install several Augmentations at once. Preferably everything from any faction of your choosing.")}),r.a.createElement(d.a,{sx:{display:"grid",width:"100%",gridTemplateColumns:"1fr 1fr"}},r.a.createElement(h.a,{title:r.a.createElement(u.a,null,"'I never asked for this'")},r.a.createElement("span",null,r.a.createElement(m.a,{sx:{width:"100%"},disabled:0===_.queuedAugmentations.length,onClick:function(){y.a.SuppressBuyAugmentationConfirmation?t.installAugmentationsFn():k(!0)}},"Install Augmentations"))),r.a.createElement(h.a,{title:r.a.createElement(u.a,null,"It's always a good idea to backup/export your save!")},r.a.createElement(m.a,{sx:{width:"100%",color:y.a.theme.successlight},onClick:function(){t.exportGameFn(),L()}},"Backup Save ",Object(c.b)()?"(+1 favor to all factions)":"")))),_.queuedAugmentations.length>0?r.a.createElement(d.a,{sx:{display:"grid",gridTemplateColumns:"1fr 3fr"}},r.a.createElement(s.a,null),r.a.createElement(o.a,null)):r.a.createElement(p.a,{sx:{p:1}},r.a.createElement(u.a,null,"No Augmentations have been purchased yet"))),r.a.createElement(d.a,{sx:{my:1,display:"grid",gridTemplateColumns:`repeat(${+!!((null!==(e=null===(n=_.augmentations.find(t=>t.name===E.a.NeuroFluxGovernor))||void 0===n?void 0:n.level)&&void 0!==e?e:0)>0)+ +!!(_.entropy>0)}, 1fr)`,gap:1}},r.a.createElement(S,{player:_}),r.a.createElement(x,{player:_})),r.a.createElement(d.a,null,r.a.createElement(i.a,null)),r.a.createElement(l.a,null))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return y}));var a=n(19),r=n(45),i=n(1),o=n(355),s=n(8),l=n(248),c=n(21),f=n(0),u=n.n(f),m=n(172),h=n(6),d=n(29),p=n(79),g=n(12);function y(){const t=Object(f.useState)(!0)[1],e=d.b.Player().augmentations.slice().filter(t=>t.name!==g.a.NeuroFluxGovernor),[n,y]=Object(f.useState)(e[0]);function b(){t(t=>!t)}return h.a.OwnedAugmentationsOrder===m.a.Alphabetically&&e.sort((t,e)=>t.name.localeCompare(e.name)),u.a.createElement(a.a,{sx:{width:"100%"}},u.a.createElement(r.a,{sx:{p:1}},u.a.createElement(i.a,{variant:"h5"},"Installed Augmentations"),u.a.createElement(a.a,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr"}},u.a.createElement(c.a,{title:"Sorts the Augmentations alphabetically in numeral order"},u.a.createElement(s.a,{sx:{width:"100%"},onClick:function(){h.a.OwnedAugmentationsOrder=m.a.Alphabetically,b()}},"Sort in Order")),u.a.createElement(c.a,{title:"Sorts the Augmentations based on when you acquired them (same as default)"},u.a.createElement(s.a,{sx:{width:"100%"},onClick:function(){h.a.OwnedAugmentationsOrder=m.a.AcquirementTime,b()}},"Sort by Time of Acquirement")))),e.length>0?u.a.createElement(r.a,{sx:{display:"grid",gridTemplateColumns:"1fr 3fr"}},u.a.createElement(a.a,null,u.a.createElement(l.a,{sx:{height:400,overflowY:"scroll",borderRight:"1px solid "+h.a.theme.welllight}},e.map((t,e)=>u.a.createElement(o.a,{key:e+1,onClick:()=>y(t),selected:n===t},u.a.createElement(i.a,null,t.name))))),u.a.createElement(a.a,{sx:{m:1}},u.a.createElement(i.a,{variant:"h6",sx:{display:"flex",alignItems:"center",flexWrap:"wrap"}},n.name),u.a.createElement(i.a,{sx:{maxHeight:350,overflowY:"scroll"}},(()=>{const t=p.a[n.name],e="string"==typeof t.info?u.a.createElement("span",null,t.info):t.info;return u.a.createElement(u.a.Fragment,null,e,u.a.createElement("br",null),u.a.createElement("br",null),t.stats)})()))):u.a.createElement(r.a,{sx:{p:1}},u.a.createElement(i.a,null,"No Augmentations have been installed yet")))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return y}));var a=n(1786),r=n(1),i=n(97),o=n(113),s=n(248),l=n(45),c=n(0),f=n(18),u=n(2),m=n(6),h=n(5),d=n(79);function p(t){return 1===t.mult||0===u.a.sourceFileLvl(5)?c.createElement(r.a,{color:t.color},h.a.formatPercentage(t.base)):c.createElement(r.a,{color:t.color},c.createElement("span",{style:{opacity:.5}},h.a.formatPercentage(t.base))," ",h.a.formatPercentage(t.base*t.mult))}function g(t){const e=t.rows.map(t=>{const{mult:e,current:n,augmented:s,bnMult:l=1,color:f=m.a.theme.primary}=t;if(!isNaN(s))return c.createElement(i.a,{key:e,disableGutters:!0,sx:{py:0}},c.createElement(o.a,{sx:{my:.1},primary:c.createElement(r.a,{color:f},c.createElement("b",null,e)),secondary:c.createElement("span",{style:{display:"flex",alignItems:"center",flexWrap:"wrap"}},c.createElement(p,{base:n,mult:l,color:f}),c.createElement(a.a,{fontSize:"small",color:"success",sx:{mb:.5,mx:1}}),c.createElement(p,{base:s,mult:l,color:m.a.theme.success})),disableTypography:!0}))}).filter(t=>void 0!==t);return e.length>0?c.createElement(s.a,{disablePadding:!0},e):c.createElement(c.Fragment,null)}function y(){const t=function(){const t={};for(const e of u.a.queuedAugmentations){const n=d.a[e.name];for(const e of Object.keys(n.mults)){const a=t[e]?t[e]:1;t[e]=a*n.mults[e]}}return t}(),e=[...[{mult:"Hacking Chance",current:u.a.hacking_chance_mult,augmented:u.a.hacking_chance_mult*t.hacking_chance_mult},{mult:"Hacking Speed",current:u.a.hacking_speed_mult,augmented:u.a.hacking_speed_mult*t.hacking_speed_mult},{mult:"Hacking Money",current:u.a.hacking_money_mult,augmented:u.a.hacking_money_mult*t.hacking_money_mult,bnMult:f.a.ScriptHackMoney},{mult:"Hacking Growth",current:u.a.hacking_grow_mult,augmented:u.a.hacking_grow_mult*t.hacking_grow_mult},{mult:"Hacking Level",current:u.a.hacking_mult,augmented:u.a.hacking_mult*t.hacking_mult,bnMult:f.a.HackingLevelMultiplier},{mult:"Hacking Experience",current:u.a.hacking_exp_mult,augmented:u.a.hacking_exp_mult*t.hacking_exp_mult,bnMult:f.a.HackExpGain}].map(t=>Object.defineProperty(t,"color",{value:m.a.theme.hack})),...[{mult:"Strength Level",current:u.a.strength_mult,augmented:u.a.strength_mult*t.strength_mult,bnMult:f.a.StrengthLevelMultiplier},{mult:"Strength Experience",current:u.a.strength_exp_mult,augmented:u.a.strength_exp_mult*t.strength_exp_mult},{mult:"Defense Level",current:u.a.defense_mult,augmented:u.a.defense_mult*t.defense_mult,bnMult:f.a.DefenseLevelMultiplier},{mult:"Defense Experience",current:u.a.defense_exp_mult,augmented:u.a.defense_exp_mult*t.defense_exp_mult},{mult:"Dexterity Level",current:u.a.dexterity_mult,augmented:u.a.dexterity_mult*t.dexterity_mult,bnMult:f.a.DexterityLevelMultiplier},{mult:"Dexterity Experience",current:u.a.dexterity_exp_mult,augmented:u.a.dexterity_exp_mult*t.dexterity_exp_mult},{mult:"Agility Level",current:u.a.agility_mult,augmented:u.a.agility_mult*t.agility_mult,bnMult:f.a.AgilityLevelMultiplier},{mult:"Agility Experience",current:u.a.agility_exp_mult,augmented:u.a.agility_exp_mult*t.agility_exp_mult}].map(t=>Object.defineProperty(t,"color",{value:m.a.theme.combat})),{mult:"Charisma Level",current:u.a.charisma_mult,augmented:u.a.charisma_mult*t.charisma_mult,bnMult:f.a.CharismaLevelMultiplier,color:m.a.theme.cha},{mult:"Charisma Experience",current:u.a.charisma_exp_mult,augmented:u.a.charisma_exp_mult*t.charisma_exp_mult,color:m.a.theme.cha}],n=[{mult:"Hacknet Node Production",current:u.a.hacknet_node_money_mult,augmented:u.a.hacknet_node_money_mult*t.hacknet_node_money_mult,bnMult:f.a.HacknetNodeMoney},{mult:"Hacknet Node Purchase Cost",current:u.a.hacknet_node_purchase_cost_mult,augmented:u.a.hacknet_node_purchase_cost_mult*t.hacknet_node_purchase_cost_mult},{mult:"Hacknet Node RAM Upgrade Cost",current:u.a.hacknet_node_ram_cost_mult,augmented:u.a.hacknet_node_ram_cost_mult*t.hacknet_node_ram_cost_mult},{mult:"Hacknet Node Core Purchase Cost",current:u.a.hacknet_node_core_cost_mult,augmented:u.a.hacknet_node_core_cost_mult*t.hacknet_node_core_cost_mult},{mult:"Hacknet Node Level Upgrade Cost",current:u.a.hacknet_node_level_cost_mult,augmented:u.a.hacknet_node_level_cost_mult*t.hacknet_node_level_cost_mult},{mult:"Company Reputation Gain",current:u.a.company_rep_mult,augmented:u.a.company_rep_mult*t.company_rep_mult},{mult:"Faction Reputation Gain",current:u.a.faction_rep_mult,augmented:u.a.faction_rep_mult*t.faction_rep_mult,bnMult:f.a.FactionWorkRepGain},{mult:"Salary",current:u.a.work_money_mult,augmented:u.a.work_money_mult*t.work_money_mult,bnMult:f.a.CompanyWorkMoney,color:m.a.theme.money},{mult:"Crime Success Chance",current:u.a.crime_success_mult,augmented:u.a.crime_success_mult*t.crime_success_mult,color:m.a.theme.combat},{mult:"Crime Money",current:u.a.crime_money_mult,augmented:u.a.crime_money_mult*t.crime_money_mult,bnMult:f.a.CrimeMoney,color:m.a.theme.money}];return u.a.canAccessBladeburner()&&n.push({mult:"Bladeburner Success Chance",current:u.a.bladeburner_success_chance_mult,augmented:u.a.bladeburner_success_chance_mult*t.bladeburner_success_chance_mult},{mult:"Bladeburner Max Stamina",current:u.a.bladeburner_max_stamina_mult,augmented:u.a.bladeburner_max_stamina_mult*t.bladeburner_max_stamina_mult},{mult:"Bladeburner Stamina Gain",current:u.a.bladeburner_stamina_gain_mult,augmented:u.a.bladeburner_stamina_gain_mult*t.bladeburner_stamina_gain_mult},{mult:"Bladeburner Field Analysis",current:u.a.bladeburner_analysis_mult,augmented:u.a.bladeburner_analysis_mult*t.bladeburner_analysis_mult}),c.createElement(l.a,{sx:{p:1,maxHeight:400,overflowY:"scroll",display:"flex",flexDirection:"column",flexWrap:"wrap",gap:1}},c.createElement(g,{rows:e}),c.createElement(g,{rows:n}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var a=n(21),r=n(1),i=n(113),o=n(45),s=n(248),l=n(0),c=n(2),f=n(79),u=n(12);function m(){const t=[];let e=-1;for(let t=c.a.queuedAugmentations.length-1;t>=0;t--)if(c.a.queuedAugmentations[t].name===u.a.NeuroFluxGovernor){e=t;break}for(let n=0;n{const t="string"==typeof m.info?l.createElement("span",null,m.info):m.info;return l.createElement(l.Fragment,null,t,l.createElement("br",null),l.createElement("br",null),m.stats)})()),enterNextDelay:500,key:s},l.createElement(i.a,{sx:{px:2,py:1},primary:s})))}return l.createElement(o.a,{sx:{py:1,maxHeight:400,overflowY:"scroll"}},l.createElement(s.a,{sx:{height:400,overflowY:"scroll"},disablePadding:!0},t))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return b}));var a=n(45),r=n(355),i=n(113),o=n(19),s=n(248),l=n(1),c=n(0),f=n.n(c),u=n(108),m=n(2),h=n(172),d=n(6),p=n(371);const g=t=>{if(-1===t){return{info:f.a.createElement(f.a.Fragment,null,"This Source-File can only be acquired with obscure knowledge of the game, javascript, and the web ecosystem.",f.a.createElement("br",null),f.a.createElement("br",null),"It increases all of the player's multipliers by 0.1%",f.a.createElement("br",null),f.a.createElement("br",null),"You have found the following exploits:",f.a.createElement("br",null),f.a.createElement("br",null),m.a.exploits.map(t=>f.a.createElement(f.a.Fragment,{key:t},"* ",Object(u.b)(t),f.a.createElement("br",null)))),lvl:m.a.exploits.length,n:-1,name:"Source-File -1: Exploits in the BitNodes"}}const e="SourceFile"+t,n=p.a[e];return null==n?(console.error("Invalid source file number: "+t),null):n},y=t=>{let e;switch(t.n){case 12:e="∞";break;case-1:e=Object.keys(u.a).length;break;default:e="3"}return e};function b(){var t;const e=m.a.sourceFiles.slice(),n=m.a.exploits;if(n.length>0&&e.unshift({n:-1,lvl:n.length}),d.a.OwnedAugmentationsOrder===h.a.Alphabetically&&e.sort((t,e)=>t.n-e.n),0===e.length)return f.a.createElement(f.a.Fragment,null);const[u,p]=Object(c.useState)(e[0]);return f.a.createElement(o.a,{sx:{width:"100%",mt:1}},f.a.createElement(a.a,{sx:{p:1}},f.a.createElement(l.a,{variant:"h5"},"Source Files")),f.a.createElement(a.a,{sx:{display:"grid",gridTemplateColumns:"1fr 3fr"}},f.a.createElement(o.a,null,f.a.createElement(s.a,{sx:{height:400,overflowY:"scroll",borderRight:"1px solid "+d.a.theme.welllight},disablePadding:!0},e.map((t,e)=>{const n=g(t.n);if(!n)return;const a=y(n);return f.a.createElement(r.a,{key:e+1,onClick:()=>p(t),selected:u.n===t.n,sx:{py:0}},f.a.createElement(i.a,{disableTypography:!0,primary:f.a.createElement(l.a,null,n.name),secondary:f.a.createElement(l.a,null,"Level ",t.lvl," / ",a)}))}))),f.a.createElement(o.a,{sx:{m:1}},f.a.createElement(l.a,{variant:"h6",sx:{display:"flex",alignItems:"center",flexWrap:"wrap"}},null===(t=g(u.n))||void 0===t?void 0:t.name),f.a.createElement(l.a,{sx:{maxHeight:350,overflowY:"scroll"}},(()=>{const t=g(u.n);if(!t)return;const e=y(t);return f.a.createElement(f.a.Fragment,null,"Level ",u.lvl," / ",e,f.a.createElement("br",null),f.a.createElement("br",null),t.info)})()))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return O}));var a=n(210),r=n(12),i=n(0),o=n.n(i),s=n(1116),l=n(1118),c=n(1121),f=n(1123),u=n(1124),m=n(1125),h=n(1126),d=n(1127),p=n(1128),g=n(1129),y=n(1130),b=n(1131),E=n(1132),v=n(1133),k=n(1134),_=n(1135),w=n(1136),S=n(1139),x=n(1143),C=n(1),L=n(108);function O(t){return Object(i.useEffect)(()=>{t.player.giveExploit(L.a.YoureNotMeantToAccessThis)},[]),o.a.createElement(o.a.Fragment,null,o.a.createElement(C.a,null,"Development Menu - Only meant to be used for testing/debugging"),o.a.createElement(s.a,{player:t.player,router:t.router}),o.a.createElement(l.a,{player:t.player}),o.a.createElement(c.a,{player:t.player}),o.a.createElement(f.a,{player:t.player}),o.a.createElement(u.a,{player:t.player}),o.a.createElement(m.a,{player:t.player}),o.a.createElement(h.a,null),o.a.createElement(d.a,null),t.player.bladeburner instanceof a.a&&o.a.createElement(p.a,{player:t.player}),t.player.inGang()&&o.a.createElement(g.a,{player:t.player}),t.player.hasCorporation()&&o.a.createElement(y.a,{player:t.player}),o.a.createElement(b.a,null),t.player.hasWseAccount&&o.a.createElement(E.a,null),t.player.sleeves.length>0&&o.a.createElement(v.a,{player:t.player}),t.player.augmentations.some(t=>t.name===r.a.StaneksGift1)&&o.a.createElement(k.a,null),o.a.createElement(_.a,{player:t.player,engine:t.engine}),o.a.createElement(S.a,{player:t.player,engine:t.engine}),o.a.createElement(x.a,{player:t.player,engine:t.engine}),o.a.createElement(w.a,null))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return v}));var a=n(0),r=n.n(a),i=n(157),o=n(158),s=n(159),l=n(81),c=n.n(l),f=n(1),u=n(8),m=n(20),h=n(76),d=n(130),p=n(74),g=n(210),y=n(187),b=n(4),E=n(343);function v(t){const[e,n]=Object(a.useState)(!1),[l,v]=Object(a.useState)(""),[k,_]=Object(a.useState)("");function w(e){return function(){t.player.gainMoney(e,"other")}}return Object(a.useEffect)(()=>{if(e)throw new ReferenceError("Manually thrown error")},[e]),r.a.createElement(i.a,{TransitionProps:{unmountOnExit:!0}},r.a.createElement(o.a,{expandIcon:r.a.createElement(c.a,null)},r.a.createElement(f.a,null,"General")),r.a.createElement(s.a,null,r.a.createElement(u.a,{onClick:w(1e6)},r.a.createElement("pre",null,"+ ",r.a.createElement(m.a,{money:1e6}))),r.a.createElement(u.a,{onClick:w(1e9)},r.a.createElement("pre",null,"+ ",r.a.createElement(m.a,{money:1e9}))),r.a.createElement(u.a,{onClick:w(1e12)},r.a.createElement("pre",null,"+ ",r.a.createElement(m.a,{money:1e12}))),r.a.createElement(u.a,{onClick:w(1e15)},r.a.createElement("pre",null,"+ ",r.a.createElement(m.a,{money:1e15}))),r.a.createElement(u.a,{onClick:w(1/0)},r.a.createElement("pre",null,"+ ",r.a.createElement(m.a,{money:1/0}))),r.a.createElement(u.a,{onClick:function(){t.player.getHomeComputer().maxRam*=2}},"+ RAM"),r.a.createElement("br",null),r.a.createElement(f.a,null,"Corporation Name:"),r.a.createElement(h.a,{value:l,onChange:t=>v(t.target.value)}),r.a.createElement(u.a,{onClick:function(){t.player.startCorporation(l)}},"Create Corporation"),r.a.createElement("br",null),r.a.createElement(f.a,null,"Gang Faction:"),r.a.createElement(d.a,{value:k,onChange:function(t){_(t.target.value)}},y.a.Names.map(t=>r.a.createElement(p.a,{key:t,value:t},t))),r.a.createElement(u.a,{onClick:function(){const e=k===b.a.NiteSec||k===b.a.TheBlackHand;t.player.startGang(k,e)}},"Start Gang"),r.a.createElement("br",null),r.a.createElement(u.a,{onClick:function(){t.player.bladeburner=new g.a(t.player)}},"Join BladeBurner"),r.a.createElement("br",null),r.a.createElement(u.a,{onClick:function(){t.router.toBitVerse(!0,!0)}},"Quick b1t_flum3.exe"),r.a.createElement(u.a,{onClick:function(){t.router.toBitVerse(!0,!1)}},"Run b1t_flum3.exe"),r.a.createElement(u.a,{onClick:function(){t.router.toBitVerse(!1,!0)}},"Quick w0rld_d34m0n"),r.a.createElement(u.a,{onClick:function(){t.router.toBitVerse(!1,!1)}},"Hack w0rld_d34m0n"),r.a.createElement(u.a,{onClick:()=>n(!0)},"Throw Error"),r.a.createElement(u.a,{onClick:function(){Object(E.b)()}},"Check Messages")))}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var a=n(0),r=n.n(a),i=n(157),o=n(158),s=n(159),l=n(81),c=n.n(l),f=n(1),u=n(8),m=n(133);const h=1e27;function d(t){function e(e,n){return function(a){switch(e){case"hacking":a&&t.player.gainHackingExp(a*n);break;case"strength":a&&t.player.gainStrengthExp(a*n);break;case"defense":a&&t.player.gainDefenseExp(a*n);break;case"dexterity":a&&t.player.gainDexterityExp(a*n);break;case"agility":a&&t.player.gainAgilityExp(a*n);break;case"charisma":a&&t.player.gainCharismaExp(a*n);break;case"intelligence":a&&t.player.gainIntelligenceExp(a*n)}t.player.updateSkillLevels()}}function n(e){return function(n){t.player.karma+=n*e}}function a(e){return function(){switch(e){case"hacking":t.player.hacking_exp=0;break;case"strength":t.player.strength_exp=0;break;case"defense":t.player.defense_exp=0;break;case"dexterity":t.player.dexterity_exp=0;break;case"agility":t.player.agility_exp=0;break;case"charisma":t.player.charisma_exp=0;break;case"intelligence":t.player.intelligence_exp=0}t.player.updateSkillLevels()}}return r.a.createElement(i.a,{TransitionProps:{unmountOnExit:!0}},r.a.createElement(o.a,{expandIcon:r.a.createElement(c.a,null)},r.a.createElement(f.a,null,"Experience / Stats")),r.a.createElement(s.a,null,r.a.createElement("table",null,r.a.createElement("tbody",null,r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"All:")),r.a.createElement("td",null,r.a.createElement(u.a,{onClick:function(){t.player.gainHackingExp(h),t.player.gainStrengthExp(h),t.player.gainDefenseExp(h),t.player.gainDexterityExp(h),t.player.gainAgilityExp(h),t.player.gainCharismaExp(h),t.player.gainIntelligenceExp(h),t.player.updateSkillLevels()}},"Tons of exp"),r.a.createElement(u.a,{onClick:function(){t.player.hacking_exp=0,t.player.strength_exp=0,t.player.defense_exp=0,t.player.dexterity_exp=0,t.player.agility_exp=0,t.player.charisma_exp=0,t.player.intelligence_exp=0,t.player.updateSkillLevels()}},"Reset"))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Hacking:")),r.a.createElement("td",null,r.a.createElement(m.a,{label:"hacking",placeholder:"exp",tons:()=>e("hacking",1)(h),add:e("hacking",1),subtract:e("hacking",-1),reset:a("hacking")}))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Strength:")),r.a.createElement("td",null,r.a.createElement(m.a,{label:"strength",placeholder:"exp",tons:()=>e("strength",1)(h),add:e("strength",1),subtract:e("strength",-1),reset:a("strength")}))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Defense:")),r.a.createElement("td",null,r.a.createElement(m.a,{label:"defense",placeholder:"exp",tons:()=>e("defense",1)(h),add:e("defense",1),subtract:e("defense",-1),reset:a("defense")}))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Dexterity:")),r.a.createElement("td",null,r.a.createElement(m.a,{label:"dexterity",placeholder:"exp",tons:()=>e("dexterity",1)(h),add:e("dexterity",1),subtract:e("dexterity",-1),reset:a("dexterity")}))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Agility:")),r.a.createElement("td",null,r.a.createElement(m.a,{label:"agility",placeholder:"exp",tons:()=>e("agility",1)(h),add:e("agility",1),subtract:e("agility",-1),reset:a("agility")}))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Charisma:")),r.a.createElement("td",null,r.a.createElement(m.a,{label:"charisma",placeholder:"exp",tons:()=>e("charisma",1)(h),add:e("charisma",1),subtract:e("charisma",-1),reset:a("charisma")}))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Intelligence:")),r.a.createElement("td",null,r.a.createElement(m.a,{label:"intelligence",placeholder:"exp",tons:()=>e("intelligence",1)(h),add:e("intelligence",1),subtract:e("intelligence",-1),reset:a("intelligence")})),r.a.createElement("td",null,r.a.createElement(u.a,{onClick:function(){0===t.player.intelligence&&(t.player.intelligence=1,t.player.updateSkillLevels())}},"Enable")),r.a.createElement("td",null,r.a.createElement(u.a,{onClick:function(){t.player.intelligence_exp=0,t.player.intelligence=0,t.player.updateSkillLevels()}},"Disable"))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Karma:")),r.a.createElement("td",null,r.a.createElement(m.a,{label:"karma",placeholder:"amt",tons:()=>e("intelligence",1)(1e5),add:n(1),subtract:n(-1),reset:function(){t.player.karma=0}})))))))}},,,function(t,e,n){"use strict";n.d(e,"a",(function(){return S}));var a=n(0),r=n.n(a),i=n(157),o=n(158),s=n(159),l=n(81),c=n.n(l),f=n(1),u=n(8),m=n(130),h=n(133),d=n(26),p=n(1473),g=n(74),y=n(111),b=n(1122),E=n.n(b),v=n(464),k=n.n(v),_=n(1474),w=n(4);function S(t){const[e,n]=Object(a.useState)(w.a.Illuminati);function l(t){return function(n){const a=d.a[e];null==a||isNaN(n)||(a.playerReputation+=n*t)}}function b(t){return function(n){const a=d.a[e];null==a||isNaN(n)||(a.favor+=n*t)}}return r.a.createElement(i.a,{TransitionProps:{unmountOnExit:!0}},r.a.createElement(o.a,{expandIcon:r.a.createElement(c.a,null)},r.a.createElement(f.a,null,"Factions")),r.a.createElement(s.a,null,r.a.createElement("table",null,r.a.createElement("tbody",null,r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Faction:")),r.a.createElement("td",null,r.a.createElement(p.a,null,r.a.createElement(_.a,{id:"factions-select"},"Faction"),r.a.createElement(m.a,{labelId:"factions-select",id:"factions-dropdown",onChange:function(t){n(t.target.value)},value:e,startAdornment:r.a.createElement(r.a.Fragment,null,r.a.createElement(y.a,{onClick:function(){Object.values(w.a).forEach(e=>t.player.receiveInvite(e))},size:"large","arial-label":"receive-all-invitation"},r.a.createElement(E.a,null)),r.a.createElement(y.a,{onClick:function(){t.player.receiveInvite(e)},size:"large","arial-label":"receive-one-invitation"},r.a.createElement(k.a,null)))},Object.values(d.a).map(t=>r.a.createElement(g.a,{key:t.name,value:t.name},t.name)))))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Reputation:")),r.a.createElement("td",null,r.a.createElement(h.a,{label:"reputation",placeholder:"amt",tons:()=>l(1)(1e12),add:l(1),subtract:l(-1),reset:function(){const t=d.a[e];null!=t&&(t.playerReputation=0)}}))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Favor:")),r.a.createElement("td",null,r.a.createElement(h.a,{label:"favor",placeholder:"amt",tons:()=>b(1)(2e3),add:b(1),subtract:b(-1),reset:function(){const t=d.a[e];null!=t&&(t.favor=0)}}))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"All Reputation:")),r.a.createElement("td",null,r.a.createElement(u.a,{onClick:function(){for(const t of Object.keys(d.a))d.a[t].playerReputation=1e12}},"Tons"),r.a.createElement(u.a,{onClick:function(){for(const t of Object.keys(d.a))d.a[t].playerReputation=0}},"Reset"))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"All Favor:")),r.a.createElement("td",null,r.a.createElement(u.a,{onClick:function(){for(const t of Object.keys(d.a))d.a[t].favor=1e12}},"Tons"),r.a.createElement(u.a,{onClick:function(){for(const t of Object.keys(d.a))d.a[t].favor=0}},"Reset")))))))}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return b}));var a=n(1787),r=n(1788),i=n(1479),o=n(1789),s=n(157),l=n(158),c=n(1),f=n(159),u=n(130),m=n(111),h=n(74),d=n(8),p=n(0),g=n.n(p),y=n(12);function b(t){const[e,n]=Object(p.useState)("Augmented Targeting I");return g.a.createElement(s.a,{TransitionProps:{unmountOnExit:!0}},g.a.createElement(l.a,{expandIcon:g.a.createElement(a.a,null)},g.a.createElement(c.a,null,"Augmentations")),g.a.createElement(f.a,null,g.a.createElement(u.a,{onChange:function(t){n(t.target.value)},value:e,startAdornment:g.a.createElement(g.a.Fragment,null,g.a.createElement(m.a,{onClick:function(){for(const e of Object.values(y.a))t.player.queueAugmentation(e)},size:"large"},g.a.createElement(r.a,null)),g.a.createElement(m.a,{onClick:function(){t.player.queueAugmentation(e)},size:"large"},g.a.createElement(i.a,null))),endAdornment:g.a.createElement(g.a.Fragment,null,g.a.createElement(m.a,{onClick:function(){t.player.augmentations=[]},size:"large"},g.a.createElement(o.a,null)))},Object.values(y.a).map(t=>g.a.createElement(h.a,{key:t,value:t},t))),g.a.createElement(d.a,{sx:{display:"block"},onClick:function(){t.player.queuedAugmentations=[]}},"Clear Queued Augmentations")))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var a=n(0),r=n.n(a),i=n(157),o=n(158),s=n(159),l=n(81),c=n.n(l),f=n(1),u=n(8),m=n(612),h=n(356);const d=[1,2,3,4,5,6,7,8,9,10,11,12,13];function p(t){function e(e,n){return function(){if(9===e&&(t.player.hacknetNodes=[]),0!==n)if(t.player.sourceFiles.some(t=>t.n===e))for(let a=0;at.n!==e)}}function n(t){return()=>{for(let n=0;nr.a.createElement("tr",{key:"sf-"+t},r.a.createElement("td",null,r.a.createElement(f.a,null,"SF-",t,":")),r.a.createElement("td",null,r.a.createElement(h.a,null,r.a.createElement(u.a,{onClick:e(t,0)},"0"),r.a.createElement(u.a,{onClick:e(t,1)},"1"),r.a.createElement(u.a,{onClick:e(t,2)},"2"),r.a.createElement(u.a,{onClick:e(t,3)},"3")))))))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var a=n(0),r=n.n(a),i=n(157),o=n(158),s=n(159),l=n(81),c=n.n(l),f=n(1),u=n(8),m=n(130),h=n(65),d=n(74);function p(t){const[e,n]=Object(a.useState)("NUKE.exe");return r.a.createElement(i.a,{TransitionProps:{unmountOnExit:!0}},r.a.createElement(o.a,{expandIcon:r.a.createElement(c.a,null)},r.a.createElement(f.a,null,"Programs")),r.a.createElement(s.a,null,r.a.createElement("table",null,r.a.createElement("tbody",null,r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Program:")),r.a.createElement("td",null,r.a.createElement(m.a,{onChange:function(t){n(t.target.value)},value:e},Object.values(h.a).map(t=>r.a.createElement(d.a,{key:t.name,value:t.name},t.name))))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Add:")),r.a.createElement("td",null,r.a.createElement(u.a,{onClick:function(){t.player.hasProgram(e)||t.player.getHomeComputer().programs.push(e)}},"One"),r.a.createElement(u.a,{onClick:function(){for(const e of Object.keys(h.a))t.player.hasProgram(h.a[e].name)||t.player.getHomeComputer().programs.push(h.a[e].name)}},"All")))))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var a=n(0),r=n.n(a),i=n(157),o=n(158),s=n(159),l=n(81),c=n.n(l),f=n(1),u=n(8),m=n(130),h=n(24),d=n(46),p=n(74);function g(){const[t,e]=Object(a.useState)("home");return r.a.createElement(i.a,{TransitionProps:{unmountOnExit:!0}},r.a.createElement(o.a,{expandIcon:r.a.createElement(c.a,null)},r.a.createElement(f.a,null,"Servers")),r.a.createElement(s.a,null,r.a.createElement("table",null,r.a.createElement("tbody",null,r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Server:")),r.a.createElement("td",{colSpan:2},r.a.createElement(m.a,{id:"dev-servers-dropdown",onChange:function(t){e(t.target.value)},value:t},Object(h.c)().map(t=>r.a.createElement(p.a,{key:t.hostname,value:t.hostname},t.hostname))))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Root:")),r.a.createElement("td",null,r.a.createElement(u.a,{onClick:function(){const e=Object(h.d)(t);null!==e&&e instanceof d.a&&(e.hasAdminRights=!0,e.sshPortOpen=!0,e.ftpPortOpen=!0,e.smtpPortOpen=!0,e.httpPortOpen=!0,e.sqlPortOpen=!0,e.openPortCount=5)}},"Root one")),r.a.createElement("td",null,r.a.createElement(u.a,{onClick:function(){for(const t of Object(h.c)()){if(!(t instanceof d.a))return;t.hasAdminRights=!0,t.sshPortOpen=!0,t.ftpPortOpen=!0,t.smtpPortOpen=!0,t.httpPortOpen=!0,t.sqlPortOpen=!0,t.openPortCount=5}}},"Root all"))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Security:")),r.a.createElement("td",null,r.a.createElement(u.a,{onClick:function(){const e=Object(h.d)(t);null!==e&&e instanceof d.a&&(e.hackDifficulty=e.minDifficulty)}},"Min one")),r.a.createElement("td",null,r.a.createElement(u.a,{onClick:function(){for(const t of Object(h.c)()){if(!(t instanceof d.a))return;t.hackDifficulty=t.minDifficulty}}},"Min all"))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Money:")),r.a.createElement("td",null,r.a.createElement(u.a,{onClick:function(){const e=Object(h.d)(t);null!==e&&e instanceof d.a&&(e.moneyAvailable=0)}},"Min one")),r.a.createElement("td",null,r.a.createElement(u.a,{onClick:function(){for(const t of Object(h.c)()){if(!(t instanceof d.a))return;t.moneyAvailable=0}}},"Min all")),r.a.createElement("td",null,r.a.createElement(u.a,{onClick:function(){const e=Object(h.d)(t);null!==e&&e instanceof d.a&&(e.moneyAvailable=e.moneyMax)}},"Max one")),r.a.createElement("td",null,r.a.createElement(u.a,{onClick:function(){for(const t of Object(h.c)()){if(!(t instanceof d.a))return;t.moneyAvailable=t.moneyMax}}},"Max all")))))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return y}));var a=n(0),r=n.n(a),i=n(157),o=n(158),s=n(159),l=n(81),c=n.n(l),f=n(1),u=n(8),m=n(130),h=n(67),d=n(74),p=n(133),g=n(4);function y(){const[t,e]=Object(a.useState)(g.a.ECorp);function n(e){return function(n){const a=h.a[t];null==a||isNaN(n)||(a.playerReputation+=n*e)}}function l(e){return function(n){const a=h.a[t];null==a||isNaN(n)||(a.favor+=n*e)}}return r.a.createElement(i.a,{TransitionProps:{unmountOnExit:!0}},r.a.createElement(o.a,{expandIcon:r.a.createElement(c.a,null)},r.a.createElement(f.a,null,"Companies")),r.a.createElement(s.a,null,r.a.createElement("table",null,r.a.createElement("tbody",null,r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Company:")),r.a.createElement("td",{colSpan:3},r.a.createElement(m.a,{id:"dev-companies-dropdown",onChange:function(t){e(t.target.value)},value:t},Object.values(h.a).map(t=>r.a.createElement(d.a,{key:t.name,value:t.name},t.name))))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Reputation:")),r.a.createElement("td",null,r.a.createElement(p.a,{label:"reputation",placeholder:"amt",tons:()=>n(1)(1e12),add:n(1),subtract:n(-1),reset:function(){h.a[t].playerReputation=0}}))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Favor:")),r.a.createElement("td",null,r.a.createElement(p.a,{label:"favor",placeholder:"amt",tons:()=>l(1)(2e3),add:l(1),subtract:l(-1),reset:function(){h.a[t].favor=0}}))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"All Reputation:")),r.a.createElement("td",null,r.a.createElement(u.a,{onClick:function(){for(const t of Object.keys(h.a))h.a[t].playerReputation=1e12}},"Tons"),r.a.createElement(u.a,{onClick:function(){for(const t of Object.keys(h.a))h.a[t].playerReputation=0}},"Reset"))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"All Favor:")),r.a.createElement("td",null,r.a.createElement(u.a,{onClick:function(){for(const t of Object.keys(h.a))h.a[t].favor=1e12}},"Tons"),r.a.createElement(u.a,{onClick:function(){for(const t of Object.keys(h.a))h.a[t].favor=0}},"Reset")))))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var a=n(0),r=n.n(a),i=n(1),o=n(157),s=n(158),l=n(159),c=n(81),f=n.n(c),u=n(133);function m(t){const e=t.player.bladeburner;if(null===e)return r.a.createElement(r.a.Fragment,null);function n(n){return function(a){e&&e.changeRank(t.player,a*n)}}function a(t){return function(n){e&&(e.storedCycles+=n*t)}}return r.a.createElement(o.a,{TransitionProps:{unmountOnExit:!0}},r.a.createElement(s.a,{expandIcon:r.a.createElement(f.a,null)},r.a.createElement(i.a,null,"Bladeburner")),r.a.createElement(l.a,null,r.a.createElement("table",null,r.a.createElement("tbody",null,r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(i.a,null,"Rank:")),r.a.createElement("td",null,r.a.createElement(u.a,{label:"rank",placeholder:"amt",tons:function(){e&&e.changeRank(t.player,1e27)},add:n(1),subtract:n(-1),reset:function(){e&&(e.rank=0,e.maxRank=0)}}))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(i.a,null,"Cycles:")),r.a.createElement("td",null,r.a.createElement(u.a,{label:"cycles",placeholder:"amt",tons:function(){e&&(e.storedCycles+=1e27)},add:a(1),subtract:a(-1),reset:function(){e&&(e.storedCycles=0)}})))))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var a=n(0),r=n.n(a),i=n(1),o=n(157),s=n(158),l=n(159),c=n(81),f=n.n(c),u=n(133);function m(t){function e(e){return function(n){t.player.gang&&(t.player.gang.storedCycles+=n*e)}}return r.a.createElement(o.a,{TransitionProps:{unmountOnExit:!0}},r.a.createElement(s.a,{expandIcon:r.a.createElement(f.a,null)},r.a.createElement(i.a,null,"Gang")),r.a.createElement(l.a,null,r.a.createElement("table",null,r.a.createElement("tbody",null,r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(i.a,null,"Cycles:")),r.a.createElement("td",null,r.a.createElement(u.a,{label:"cycles",placeholder:"amt",tons:function(){t.player.gang&&(t.player.gang.storedCycles=1e27)},add:e(1),subtract:e(-1),reset:function(){t.player.gang&&(t.player.gang.storedCycles=0)}})))))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var a=n(0),r=n.n(a),i=n(157),o=n(158),s=n(159),l=n(81),c=n.n(l),f=n(1),u=n(8),m=n(133);function h(t){function e(e){return function(n){t.player.corporation&&(t.player.corporation.funds+=n*e)}}function n(e){return function(n){t.player.corporation&&(t.player.corporation.storedCycles+=n*e)}}return r.a.createElement(i.a,{TransitionProps:{unmountOnExit:!0}},r.a.createElement(o.a,{expandIcon:r.a.createElement(c.a,null)},r.a.createElement(f.a,null,"Corporation")),r.a.createElement(s.a,null,r.a.createElement("table",null,r.a.createElement("tbody",null,r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Funds:")),r.a.createElement("td",null,r.a.createElement(m.a,{label:"set funds",placeholder:"amt",tons:function(){t.player.corporation&&(t.player.corporation.funds=t.player.corporation.funds+1e27)},add:e(1),subtract:e(-1),reset:function(){t.player.corporation&&(t.player.corporation.funds=t.player.corporation.funds-t.player.corporation.funds)}}))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Cycles:")),r.a.createElement("td",null,r.a.createElement(m.a,{label:"cycles",placeholder:"amt",tons:function(){t.player.corporation&&(t.player.corporation.storedCycles=1e27)},add:n(1),subtract:n(-1),reset:function(){t.player.corporation&&(t.player.corporation.storedCycles=0)}}))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(u.a,{onClick:function(){t.player.corporation&&t.player.corporation.divisions.forEach(t=>{Object.keys(t.products).forEach(e=>{const n=t.products[e];if(void 0===n)throw new Error("Impossible product undefined");n.prog=99.9})})}},"Finish products"))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(u.a,{onClick:function(){t.player.corporation&&t.player.corporation.divisions.forEach(t=>{t.sciResearch.qty+=1e10})}},"Tons of research")))))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var a=n(0),r=n.n(a),i=n(157),o=n(158),s=n(159),l=n(81),c=n.n(l),f=n(1),u=n(8),m=n(130),h=n(74),d=n(347),p=n(116);function g(){const[t,e]=Object(a.useState)("Find Largest Prime Factor");return r.a.createElement(i.a,{TransitionProps:{unmountOnExit:!0}},r.a.createElement(o.a,{expandIcon:r.a.createElement(c.a,null)},r.a.createElement(f.a,null,"Coding Contracts")),r.a.createElement(s.a,null,r.a.createElement("table",null,r.a.createElement("tbody",null,r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(u.a,{onClick:d.b},"Generate Random Contract"),r.a.createElement(u.a,{onClick:d.c},"Generate Random Contract on Home Comp"))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(m.a,{onChange:function(t){e(t.target.value)},value:t},Object.values(p.d).map(t=>r.a.createElement(h.a,{key:t.name,value:t.name},t.name))),r.a.createElement(u.a,{onClick:function(){Object(d.a)({problemType:t,server:"home"})}},"Generate Specified Contract Type on Home Comp")))))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return y}));var a=n(0),r=n.n(a),i=n(157),o=n(158),s=n(159),l=n(81),c=n.n(l),f=n(1),u=n(8),m=n(76),h=n(20),d=n(14),p=n(103),g=n(153);function y(){const[t,e]=Object(a.useState)(0),[n,l]=Object(a.useState)("");function y(t){const e=n.replace(/\s/g,"");let a=()=>!0;""!==e&&"all"!==e&&(a=function(t){return e.split(",").includes(t)});for(const e of Object.keys(p.a))if(p.a.hasOwnProperty(e)){const n=p.a[e];n instanceof g.a&&a(n.symbol)&&t(n)}}return r.a.createElement(i.a,{TransitionProps:{unmountOnExit:!0}},r.a.createElement(o.a,{expandIcon:r.a.createElement(c.a,null)},r.a.createElement(f.a,null,"Stock Market")),r.a.createElement(s.a,null,r.a.createElement("table",null,r.a.createElement("tbody",null,r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Symbol:")),r.a.createElement("td",null,r.a.createElement(m.a,{placeholder:"symbol/'all'",onChange:function(t){l(t.target.value)}}))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Price:")),r.a.createElement("td",null,r.a.createElement(m.a,{placeholder:"$$$",onChange:function(t){e(parseFloat(t.target.value))}}),r.a.createElement(u.a,{onClick:function(){isNaN(t)||y(e=>{e.price=t})}},"Set"))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,null,"Caps:")),r.a.createElement("td",null,r.a.createElement(u.a,{onClick:function(){const t=[];y(e=>{t.push(r.a.createElement("tr",{key:e.symbol},r.a.createElement("td",null,e.symbol),r.a.createElement("td",{style:{textAlign:"right"}},r.a.createElement(h.a,{money:e.cap}))))}),Object(d.a)(r.a.createElement("table",null,r.a.createElement("tbody",null,r.a.createElement("tr",null,r.a.createElement("th",null,"Stock"),r.a.createElement("th",null,"Price cap")),t)))}},"View stock caps")))))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var a=n(0),r=n.n(a),i=n(157),o=n(158),s=n(159),l=n(81),c=n.n(l),f=n(8),u=n(1),m=n(133);function h(t){function e(e){for(let n=0;ne(1e7),add:e,subtract:e,reset:()=>e(0)})))))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var a=n(0),r=n.n(a),i=n(101),o=n(157),s=n(158),l=n(159),c=n(81),f=n.n(c),u=n(1),m=n(133);function h(){function t(t){return function(e){i.c.storedCycles+=e*t}}function e(t){return function(e){i.c.fragments.forEach(n=>n.highestCharge+=e*t)}}return r.a.createElement(o.a,{TransitionProps:{unmountOnExit:!0}},r.a.createElement(s.a,{expandIcon:r.a.createElement(f.a,null)},r.a.createElement(u.a,null,"Stanek's Gift")),r.a.createElement(l.a,null,r.a.createElement("table",null,r.a.createElement("tbody",null,r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(m.a,{label:"cycles",placeholder:"amt",tons:function(){i.c.storedCycles=1e6},add:t(1),subtract:t(-1),reset:function(){i.c.storedCycles=0}}))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(m.a,{label:"all charge",placeholder:"amt",tons:function(){i.c.fragments.forEach(t=>{t.highestCharge=1e21,t.numCharge=1e21})},add:e(1),subtract:e(-1),reset:function(){i.c.fragments.forEach(t=>{t.highestCharge=0,t.numCharge=0})}})))))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var a=n(0),r=n.n(a),i=n(157),o=n(158),s=n(159),l=n(81),c=n.n(l),f=n(1),u=n(8),m=n(109);function h(t){function e(e){return()=>{t.player.lastUpdate-=e,t.engine._lastUpdate-=e,m.c.saveGame(),setTimeout(()=>location.reload(),1e3)}}return r.a.createElement(i.a,{TransitionProps:{unmountOnExit:!0}},r.a.createElement(o.a,{expandIcon:r.a.createElement(c.a,null)},r.a.createElement(f.a,null,"Time skip")),r.a.createElement(s.a,null,r.a.createElement(u.a,{onClick:e(6e4)},"1 minute"),r.a.createElement(u.a,{onClick:e(36e5)},"1 hour"),r.a.createElement(u.a,{onClick:e(864e5)},"1 day")))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var a=n(0),r=n.n(a),i=n(157),o=n(158),s=n(159),l=n(81),c=n.n(l),f=n(1),u=n(109),m=n(94),h=n(1480),d=n(8),p=n(147);function g(){const t=Object(a.useRef)(null),[e,n]=Object(a.useState)(""),[l,g]=Object(a.useState)(!0),[y,b]=Object(a.useState)(!0),[E,v]=Object(a.useState)(!0);return r.a.createElement(i.a,{TransitionProps:{unmountOnExit:!0}},r.a.createElement(o.a,{expandIcon:r.a.createElement(c.a,null)},r.a.createElement(f.a,null,"Save file")),r.a.createElement(s.a,null,r.a.createElement(d.a,{onClick:function(){if(!(window.File&&window.FileReader&&window.FileList&&window.Blob))return;const e=t.current;if(null===e)throw new Error("import input should not be null");e.click()},startIcon:r.a.createElement(h.a,null),sx:{gridArea:"import"}},"Select save file",r.a.createElement("input",{ref:t,type:"file",hidden:!0,onChange:async function(t){try{const e=await u.c.getImportStringFromFile(t.target.files),a=atob(e);n(a)}catch(t){m.b.emit(t.toString(),m.d.ERROR,5e3)}}})),r.a.createElement("br",null),""!==e&&r.a.createElement(r.a.Fragment,null,r.a.createElement(p.a,{checked:l,onChange:t=>g(t),text:"Restore scripts",tooltip:r.a.createElement(r.a.Fragment,null,"Restore the save file home computer scripts.")}),r.a.createElement("br",null),r.a.createElement(p.a,{checked:y,onChange:t=>b(t),text:"Restore Augmentations",tooltip:r.a.createElement(r.a.Fragment,null,"Restore the save file installed augmentations.")}),r.a.createElement("br",null),r.a.createElement(p.a,{checked:E,onChange:t=>v(t),text:"Restore Source Files",tooltip:r.a.createElement(r.a.Fragment,null,"Restore the save file acquired source files.")}),r.a.createElement("br",null),r.a.createElement(d.a,{onClick:function(){const t=JSON.parse(e);console.log(Object.keys(t))}},"Restore"))))}},,,function(t,e,n){"use strict";n.d(e,"a",(function(){return E}));var a=n(0),r=n.n(a),i=n(157),o=n(158),s=n(159),l=n(81),c=n.n(l),f=n(1),u=n(8),m=n(356),h=n(21),d=n(1142),p=n.n(d),g=n(1141),y=n.n(g),b=n(300);function E(t){const[e,n]=Object(a.useState)(t.player.achievements.map(t=>t.ID));return r.a.createElement(i.a,{TransitionProps:{unmountOnExit:!0}},r.a.createElement(o.a,{expandIcon:r.a.createElement(c.a,null)},r.a.createElement(f.a,null,"Achievements")),r.a.createElement(s.a,null,r.a.createElement("table",null,r.a.createElement("tbody",null,r.a.createElement("tr",null,r.a.createElement("td",null),r.a.createElement("td",null,r.a.createElement(f.a,null,"Achievements:")),r.a.createElement("td",null,r.a.createElement(m.a,null,r.a.createElement(u.a,{onClick:function(){Object.values(b.a).forEach(e=>t.player.giveAchievement(e.ID)),n(t.player.achievements.map(t=>t.ID))}},"Grant All"),r.a.createElement(u.a,{onClick:function(){t.player.achievements=[],n(t.player.achievements.map(t=>t.ID))}},"Clear"),r.a.createElement(u.a,{onClick:function(){t.engine.Counters.achievementsCounter=Number.MAX_VALUE}},"Disable Engine"),r.a.createElement(u.a,{onClick:function(){t.engine.Counters.achievementsCounter=0}},"Enable Engine")))),Object.values(b.a).map(a=>{const i=e.includes(a.ID);return r.a.createElement("tr",{key:"ach-"+a.ID},r.a.createElement("td",null,i?r.a.createElement(h.a,{title:"Achieved"},r.a.createElement(y.a,{color:"primary"})):r.a.createElement(h.a,{title:"Locked"},r.a.createElement(p.a,{color:"secondary"}))),r.a.createElement("td",null,r.a.createElement(h.a,{title:r.a.createElement(r.a.Fragment,null,a.ID,r.a.createElement("br",null),a.Description)},r.a.createElement(f.a,{color:i?"primary":"secondary"},a.Name,":"))),r.a.createElement("td",null,r.a.createElement(m.a,null,r.a.createElement(u.a,{onClick:()=>{return e=a.ID,t.player.giveAchievement(e),void n(t.player.achievements.map(t=>t.ID));var e}},"Grant"),r.a.createElement(u.a,{onClick:()=>{return e=a.ID,t.player.achievements=t.player.achievements.filter(t=>t.ID!==e),void n(t.player.achievements.map(t=>t.ID));var e}},"Clear"))))})))))}},function(t){t.exports=JSON.parse('{"a":{"CYBERSEC":{"ID":"CYBERSEC","Name":"CyberSec","Description":"Join CyberSec."},"NITESEC":{"ID":"NITESEC","Name":"avmnite-02h","Description":"Join NiteSec."},"THE_BLACK_HAND":{"ID":"THE_BLACK_HAND","Name":"I.I.I.I","Description":"Join The Black Hand."},"BITRUNNERS":{"ID":"BITRUNNERS","Name":"run4theh111z","Description":"Join the BitRunners."},"DAEDALUS":{"ID":"DAEDALUS","Name":"fl1ght.exe","Description":"Join Daedalus."},"THE_COVENANT":{"ID":"THE_COVENANT","Name":"The Covenant","Description":"Join The Covenant."},"ILLUMINATI":{"ID":"ILLUMINATI","Name":"Illuminati","Description":"Join the Illuminati."},"BRUTESSH.EXE":{"ID":"BRUTESSH.EXE","Name":"BruteSSH.exe","Description":"Acquire BruteSSH.exe"},"FTPCRACK.EXE":{"ID":"FTPCRACK.EXE","Name":"FTPCrack.exe","Description":"Acquire FTPCrack.exe"},"RELAYSMTP.EXE":{"ID":"RELAYSMTP.EXE","Name":"relaySMTP.exe","Description":"Acquire relaySMTP.exe"},"HTTPWORM.EXE":{"ID":"HTTPWORM.EXE","Name":"HTTPWorm.exe","Description":"Acquire HTTPWorm.exe"},"SQLINJECT.EXE":{"ID":"SQLINJECT.EXE","Name":"SQLInject.exe","Description":"Acquire SQLInject.exe"},"FORMULAS.EXE":{"ID":"FORMULAS.EXE","Name":"Formulas.exe","Description":"Acquire Formulas.exe"},"SF1.1":{"ID":"SF1.1","Name":"Source Genesis","Description":"Acquire SF1.1"},"SF2.1":{"ID":"SF2.1","Name":"Rise of the Underworld","Description":"Acquire SF2.1"},"SF3.1":{"ID":"SF3.1","Name":"Corporatocracy","Description":"Acquire SF3.1"},"SF4.1":{"ID":"SF4.1","Name":"The Singularity","Description":"Acquire SF4.1"},"SF5.1":{"ID":"SF5.1","Name":"Artificial Intelligence","Description":"Acquire SF5.1"},"SF6.1":{"ID":"SF6.1","Name":"Bladeburners","Description":"Acquire SF6.1"},"SF7.1":{"ID":"SF7.1","Name":"Bladeburners 2079","Description":"Acquire SF7.1"},"SF8.1":{"ID":"SF8.1","Name":"Ghost of Wall Street","Description":"Acquire SF8.1"},"SF9.1":{"ID":"SF9.1","Name":"Hacktocracy","Description":"Acquire SF9.1"},"SF10.1":{"ID":"SF10.1","Name":"Digital Carbon","Description":"Acquire SF10.1"},"SF11.1":{"ID":"SF11.1","Name":"The Big Crash","Description":"Acquire SF11.1"},"SF12.1":{"ID":"SF12.1","Name":"The Recursion","Description":"Acquire SF12.1"},"MONEY_1Q":{"ID":"MONEY_1Q","Name":"Here comes the money!","Description":"Have $1Q on your home computer."},"MONEY_M1B":{"ID":"MONEY_M1B","Name":"Massive debt","Description":"Be $1b in debt."},"INSTALL_1":{"ID":"INSTALL_1","Name":"I never asked for this.","Description":"Install your first augmentation."},"INSTALL_100":{"ID":"INSTALL_100","Name":"I asked for this.","Description":"Have 100 augmentation installed at once."},"QUEUE_40":{"ID":"QUEUE_40","Name":"It\'s time to install","Description":"Have 40 augmentation queued at once."},"HACKING_100000":{"ID":"HACKING_100000","Name":"Power Overwhelming","Description":"Achieve 100 000 hacking skill."},"COMBAT_3000":{"ID":"COMBAT_3000","Name":"One punch man","Description":"Achieve 3000 in all combat stats."},"NEUROFLUX_255":{"ID":"NEUROFLUX_255","Name":"Neuroflux is love, Neuroflux is live","Description":"Install Neuroflux Governor level 255"},"NS2":{"ID":"NS2","Name":"Maximum speed!","Description":"Write an ns2 script."},"FROZE":{"ID":"FROZE","Name":"while(true);","Description":"Restart the game using the reload & kill all option because you froze it with an infinite loop."},"RUNNING_SCRIPTS_1000":{"ID":"RUNNING_SCRIPTS_1000","Name":"Need more real life ram","Description":"Run 1000 scripts simultaneously."},"DRAIN_SERVER":{"ID":"DRAIN_SERVER","Name":"Big trouble","Description":"Drain a server of all its money."},"MAX_RAM":{"ID":"MAX_RAM","Name":"Download more ram","Description":"Maximize your home computer ram."},"MAX_CORES":{"ID":"MAX_CORES","Name":"Download more cores?","Description":"Maximize your home computer cores."},"SCRIPTS_30":{"ID":"SCRIPTS_30","Name":"Thank you folders!","Description":"Have 30 scripts on your home computer."},"KARMA_1000000":{"ID":"KARMA_1000000","Name":"Wretched hive of scum and vilany","Description":"Reach -1m karma."},"STOCK_1q":{"ID":"STOCK_1q","Name":"Wolf of wall street.","Description":"Make 1q on the stock market."},"DISCOUNT":{"ID":"DISCOUNT","Name":"Discount!","Description":"Get a discount at Powerhouse Gym by backdooring their server."},"SCRIPT_32GB":{"ID":"SCRIPT_32GB","Name":"You\'ll need upgrade for this one.","Description":"Write a script that costs 32GB per thread."},"FIRST_HACKNET_NODE":{"ID":"FIRST_HACKNET_NODE","Name":"Free money!","Description":"Purchase your first hacknet node."},"30_HACKNET_NODE":{"ID":"30_HACKNET_NODE","Name":"Big network","Description":"Have 30 hacknet nodes."},"MAX_HACKNET_NODE":{"ID":"MAX_HACKNET_NODE","Name":"That\'s the limit","Description":"Maximize a hacknet node."},"HACKNET_NODE_10M":{"ID":"HACKNET_NODE_10M","Name":"The original hacker","Description":"Make 10m from hacknet nodes."},"REPUTATION_10M":{"ID":"REPUTATION_10M","Name":"Well liked","Description":"Reach 10m reputation with a faction."},"DONATION":{"ID":"DONATION","Name":"Donate!","Description":"Unlock donations with a faction."},"TRAVEL":{"ID":"TRAVEL","Name":"World explorer","Description":"Travel anywhere."},"WORKOUT":{"ID":"WORKOUT","Name":"Gains!","Description":"Workout at a gym."},"TOR":{"ID":"TOR","Name":"The Onion Network","Description":"Purchase the TOR router."},"HOSPITALIZED":{"ID":"HOSPITALIZED","Name":"Ouch!","Description":"Go to the hospital."},"GANG":{"ID":"GANG","Name":"Gangster","Description":"Form a gang."},"FULL_GANG":{"ID":"FULL_GANG","Name":"Don","Description":"Recruit all gang members."},"GANG_TERRITORY":{"ID":"GANG_TERRITORY","Name":"Stay out of my territory","Description":"Have 100% of the territory."},"GANG_MEMBER_POWER":{"ID":"GANG_MEMBER_POWER","Name":"One punch guy","Description":"Have a gang member with 10 000 in 1 skill."},"CORPORATION":{"ID":"CORPORATION","Name":"A small 150b loan.","Description":"Create a corporation."},"CORPORATION_BRIBE":{"ID":"CORPORATION_BRIBE","Name":"Lobbying is great!","Description":"Lower your taxes through lobbying."},"CORPORATION_PROD_1000":{"ID":"CORPORATION_PROD_1000","Name":"Streamlined manufacturing","Description":"Have a division with a production multiplier of 1000."},"CORPORATION_EMPLOYEE_3000":{"ID":"CORPORATION_EMPLOYEE_3000","Name":"Small town","Description":"Have a division with 3000 employee."},"CORPORATION_REAL_ESTATE":{"ID":"CORPORATION_REAL_ESTATE","Name":"Own the land","Description":"Expand to the Real Estate division."},"INTELLIGENCE_255":{"ID":"INTELLIGENCE_255","Name":"Smart!","Description":"Reach intelligence 255"},"BLADEBURNER_DIVISION":{"ID":"BLADEBURNER_DIVISION","Name":"Bladeburners","Description":"Join the Bladeburner division."},"BLADEBURNER_OVERCLOCK":{"ID":"BLADEBURNER_OVERCLOCK","Name":"Overclock!","Description":"Reach maximum level of Overclock"},"BLADEBURNER_UNSPENT_100000":{"ID":"BLADEBURNER_UNSPENT_100000","Name":"You should really spend those.","Description":"Have 100 000 unspent bladeburner skill points."},"4S":{"ID":"4S","Name":"4S","Description":"Purchase the 4S market data."},"FIRST_HACKNET_SERVER":{"ID":"FIRST_HACKNET_SERVER","Name":"The improved hacker.","Description":"Purchase your first hacknet server."},"ALL_HACKNET_SERVER":{"ID":"ALL_HACKNET_SERVER","Name":"Full network","Description":"Buy all hacknet servers."},"MAX_HACKNET_SERVER":{"ID":"MAX_HACKNET_SERVER","Name":"That\'s the new limit.","Description":"Maximize a hacknet server."},"HACKNET_SERVER_1B":{"ID":"HACKNET_SERVER_1B","Name":"Not passive anymore","Description":"Make $1b with hacknet servers."},"MAX_CACHE":{"ID":"MAX_CACHE","Name":"What a waste.","Description":"Cap your hashes."},"SLEEVE_8":{"ID":"SLEEVE_8","Name":"You and what army?","Description":"Purchase all duplicate sleeves from The Covenant."},"INDECISIVE":{"ID":"INDECISIVE","Name":"Too many options.","Description":"Spend 1h straight on the bitverse."},"FAST_BN":{"ID":"FAST_BN","Name":"Speed demon.","Description":"Destroy a bitnode in under 2 days."},"CHALLENGE_BN1":{"ID":"CHALLENGE_BN1","Name":"BN1: Challenge","Description":"Destroy BN1 with at most 128GB and 1 core."},"CHALLENGE_BN2":{"ID":"CHALLENGE_BN2","Name":"BN2: Challenge","Description":"Destroy BN2 without forming a gang."},"CHALLENGE_BN3":{"ID":"CHALLENGE_BN3","Name":"BN3: Challenge","Description":"Destroy BN3 without creating corporation."},"CHALLENGE_BN6":{"ID":"CHALLENGE_BN6","Name":"BN6: Challenge","Description":"Destroy BN6 without joining the bladeburner division."},"CHALLENGE_BN7":{"ID":"CHALLENGE_BN7","Name":"BN7: Challenge","Description":"Destroy BN7 without joining the bladeburner division."},"CHALLENGE_BN8":{"ID":"CHALLENGE_BN8","Name":"BN8: Challenge","Description":"Destroy BN8 without purchasing the 4s market data."},"CHALLENGE_BN9":{"ID":"CHALLENGE_BN9","Name":"BN9: Challenge","Description":"Destroy BN9 without using hacknet servers."},"CHALLENGE_BN10":{"ID":"CHALLENGE_BN10","Name":"BN10: Challenge","Description":"Destroy BN10 without using sleeves."},"CHALLENGE_BN12":{"ID":"CHALLENGE_BN12","Name":"BN12: Challenge","Description":"Destroy BN12 50 times."},"BYPASS":{"ID":"BYPASS","Name":"Exploit: bypass","Description":"Circumventing the ram cost of document."},"PROTOTYPETAMPERING":{"ID":"PROTOTYPETAMPERING","Name":"Exploit: prototype tampering","Description":"Tamper with the Numbers prototype."},"UNCLICKABLE":{"ID":"UNCLICKABLE","Name":"Exploit: unclickable","Description":"Click the unclickable."},"UNDOCUMENTEDFUNCTIONCALL":{"ID":"UNDOCUMENTEDFUNCTIONCALL","Name":"Exploit: undocumented","Description":"Call the undocumented function."},"TIMECOMPRESSION":{"ID":"TIMECOMPRESSION","Name":"Exploit: time compression","Description":"Compress time."},"REALITYALTERATION":{"ID":"REALITYALTERATION","Name":"Exploit: reality alteration","Description":"Alter reality."},"N00DLES":{"ID":"N00DLES","Name":"Exploit: noodles","Description":"Harness the power of the noodles."},"EDITSAVEFILE":{"ID":"EDITSAVEFILE","Name":"Exploit: edit","Description":"Acquire the EditSaveFile Source-File -1"},"UNACHIEVABLE":{"ID":"UNACHIEVABLE","Name":"UNACHIEVABLE","Description":"This achievement cannot be unlocked."},"CHALLENGE_BN13":{"ID":"CHALLENGE_BN13","Name":"BN13: Challenge","Description":"Complete BN13 without Stanek\'s Gift."},"DEVMENU":{"ID":"DEVMENU","Name":"Exploit: you\'re not meant to access this","Description":"Open the dev menu."},"RAINBOW":{"ID":"RAINBOW","Name":"Exploit: rainbow","Description":"Make good use of the rainbow."},"TRUE_RECURSION":{"ID":"TRUE_RECURSION","Name":"Exploit: true recursion","Description":"Beat BN1 in megabyteburner 2000."}}}')},,,function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var a=n(0),r=n.n(a),i=n(157),o=n(158),s=n(159),l=n(81),c=n.n(l),f=n(1),u=n(133);function m(t){return r.a.createElement(i.a,{TransitionProps:{unmountOnExit:!0}},r.a.createElement(o.a,{expandIcon:r.a.createElement(c.a,null)},r.a.createElement(f.a,null,"Entropy")),r.a.createElement(s.a,null,r.a.createElement(u.a,{label:"Set entropy",placeholder:"entropy",add:e=>{t.player.entropy+=e,t.player.applyEntropy(t.player.entropy)},subtract:e=>{t.player.entropy-=e,t.player.applyEntropy(t.player.entropy)},tons:()=>{t.player.entropy+=1e12,t.player.applyEntropy(t.player.entropy)},reset:()=>{t.player.entropy=0,t.player.applyEntropy(t.player.entropy)}})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(0),r=n.n(a),i=n(1145),o=n(1147),s=n(1148),l=n(29),c=n(19);function f(){const t=l.b.Player(),e=l.b.Router(),n=Object(a.useState)(!1)[1];function f(){n(t=>!t)}Object(a.useEffect)(()=>{const t=setInterval(f,200);return()=>clearInterval(t)},[]);const u=t.bladeburner;return null===u?r.a.createElement(r.a.Fragment,null):r.a.createElement(c.a,{display:"flex",flexDirection:"column"},r.a.createElement(c.a,{sx:{display:"grid",gridTemplateColumns:"4fr 8fr",p:1}},r.a.createElement(i.a,{bladeburner:u,player:t,router:e}),r.a.createElement(o.a,{bladeburner:u,player:t})),r.a.createElement(s.a,{bladeburner:u,player:t}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return b}));var a=n(0),r=n.n(a),i=n(22),o=n(59),s=n(20),l=n(5),c=n(26),f=n(105),u=n(1146),m=n(1),h=n(21),d=n(19),p=n(8),g=n(45),y=n(4);function b(t){const[e,n]=Object(a.useState)(!1),b=Object(a.useState)(!1)[1],E=t.bladeburner.rank>=o.a.RankNeededForFaction;return Object(a.useEffect)(()=>{const t=setInterval(()=>b(t=>!t),1e3);return()=>clearInterval(t)},[]),r.a.createElement(g.a,{sx:{p:1,overflowY:"auto",overflowX:"hidden",wordBreak:"break-all"}},r.a.createElement(d.a,{sx:{display:"flex",flexDirection:"column",gap:1,maxHeight:"60vh"}},r.a.createElement(d.a,{sx:{alignSelf:"flex-start",width:"100%"}},r.a.createElement(p.a,{onClick:()=>n(!0),sx:{width:"50%"}},"Travel"),r.a.createElement(h.a,{title:E?"":r.a.createElement(m.a,null,"Rank 25 required.")},r.a.createElement("span",null,r.a.createElement(p.a,{disabled:!E,onClick:function(){if(!E)return;const e=c.a[y.a.Bladeburners];e.isMember||Object(f.d)(e),t.router.toFaction(e)},sx:{width:"50%"}},"Faction"))),r.a.createElement(u.a,{open:e,onClose:()=>n(!1),bladeburner:t.bladeburner})),r.a.createElement(d.a,{display:"flex"},r.a.createElement(h.a,{title:r.a.createElement(m.a,null,"Your rank within the Bladeburner division.")},r.a.createElement(m.a,null,"Rank: ",Object(i.f)(t.bladeburner.rank,2)))),r.a.createElement("br",null),r.a.createElement(d.a,{display:"flex"},r.a.createElement(h.a,{title:r.a.createElement(m.a,null,"Performing actions will use up your stamina.",r.a.createElement("br",null),r.a.createElement("br",null),"Your max stamina is determined primarily by your agility stat.",r.a.createElement("br",null),r.a.createElement("br",null),"Your stamina gain rate is determined by both your agility and your max stamina. Higher max stamina leads to a higher gain rate.",r.a.createElement("br",null),r.a.createElement("br",null),"Once your stamina falls below 50% of its max value, it begins to negatively affect the success rate of your contracts/operations. This penalty is shown in the overview panel. If the penalty is 15%, then this means your success rate would be multipled by 85% (100 - 15).",r.a.createElement("br",null),r.a.createElement("br",null),"Your max stamina and stamina gain rate can also be increased by training, or through skills and Augmentation upgrades.")},r.a.createElement(m.a,null,"Stamina: ",Object(i.f)(t.bladeburner.stamina,3)," / ",Object(i.f)(t.bladeburner.maxStamina,3)))),r.a.createElement("br",null),r.a.createElement(m.a,null,"Stamina Penalty: ",Object(i.f)(100*(1-t.bladeburner.calculateStaminaPenalty()),1),"%"),r.a.createElement("br",null),r.a.createElement(m.a,null,"Team Size: ",Object(i.f)(t.bladeburner.teamSize,0)),r.a.createElement(m.a,null,"Team Members Lost: ",Object(i.f)(t.bladeburner.teamLost,0)),r.a.createElement("br",null),r.a.createElement(m.a,null,"Num Times Hospitalized: ",t.bladeburner.numHosp),r.a.createElement(m.a,null,"Money Lost From Hospitalizations: ",r.a.createElement(s.a,{money:t.bladeburner.moneyLost})),r.a.createElement("br",null),r.a.createElement(m.a,null,"Current City: ",t.bladeburner.city),r.a.createElement(d.a,{display:"flex"},r.a.createElement(h.a,{title:r.a.createElement(m.a,null,"This is your Bladeburner division's estimate of how many Synthoids exist in your current city. An accurate population count increases success rate estimates.")},r.a.createElement(m.a,null,"Est. Synthoid Population: ",l.a.formatPopulation(t.bladeburner.getCurrentCity().popEst)))),r.a.createElement("br",null),r.a.createElement(d.a,{display:"flex"},r.a.createElement(h.a,{title:r.a.createElement(m.a,null,"This is your Bladeburner divison's estimate of how many Synthoid communities exist in your current city.")},r.a.createElement(m.a,null,"Synthoid Communities: ",Object(i.f)(t.bladeburner.getCurrentCity().comms,0)))),r.a.createElement("br",null),r.a.createElement(d.a,{display:"flex"},r.a.createElement(h.a,{title:r.a.createElement(m.a,null,"The city's chaos level due to tensions and conflicts between humans and Synthoids. Having too high of a chaos level can make contracts and operations harder.")},r.a.createElement(m.a,null,"City Chaos: ",Object(i.f)(t.bladeburner.getCurrentCity().chaos)))),r.a.createElement("br",null),t.bladeburner.storedCycles/o.a.CyclesPerSecond*1e3>15e3&&r.a.createElement(r.a.Fragment,null,r.a.createElement(d.a,{display:"flex"},r.a.createElement(h.a,{title:r.a.createElement(m.a,null,"You gain bonus time while offline or when the game is inactive (e.g. when the tab is throttled by browser). Bonus time makes the Bladeburner mechanic progress faster, up to 5x the normal speed.")},r.a.createElement(m.a,null,"Bonus time:"," ",Object(i.d)(t.bladeburner.storedCycles/o.a.CyclesPerSecond*1e3)))),r.a.createElement("br",null)),r.a.createElement(m.a,null,"Skill Points: ",Object(i.f)(t.bladeburner.skillPoints,0)),r.a.createElement("br",null),r.a.createElement(m.a,null,"Aug. Success Chance mult: ",Object(i.f)(100*t.player.bladeburner_success_chance_mult,1),"%",r.a.createElement("br",null),"Aug. Max Stamina mult: ",Object(i.f)(100*t.player.bladeburner_max_stamina_mult,1),"%",r.a.createElement("br",null),"Aug. Stamina Gain mult: ",Object(i.f)(100*t.player.bladeburner_stamina_gain_mult,1),"%",r.a.createElement("br",null),"Aug. Field Analysis mult: ",Object(i.f)(100*t.player.bladeburner_analysis_mult,1),"%")))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var a=n(0),r=n.n(a),i=n(465),o=n(38),s=n(15),l=n(6),c=n(1),f=n(8);function u(t){function e(e){t.bladeburner.city=e,t.onClose()}return r.a.createElement(o.a,{open:t.open,onClose:t.onClose},r.a.createElement(r.a.Fragment,null,r.a.createElement(c.a,null,"Travel to a different city for your Bladeburner activities. This does not cost any money. The city you are in for your Bladeburner duties does not affect your location in the game otherwise."),l.a.DisableASCIIArt?Object.values(s.a).map(t=>r.a.createElement(f.a,{key:t,onClick:()=>e(t)},t)):r.a.createElement(i.a,{currentCity:t.bladeburner.city,onTravel:t=>e(t)})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var a=n(0),r=n.n(a),i=n(27),o=n(45),s=n(248),l=n(97),c=n(19),f=n(1),u=n(76),m=n(121),h=n(144);const d=Object(m.a)(t=>Object(h.a)({textfield:{margin:t.spacing(0),width:"100%"},input:{backgroundColor:t.colors.backgroundsecondary},nopadding:{padding:t.spacing(0)},preformatted:{whiteSpace:"pre-wrap",margin:t.spacing(0)},list:{padding:t.spacing(0),height:"100%"}}));function p(t){return r.a.createElement(l.a,{sx:{p:0}},r.a.createElement(f.a,null,t.content))}function g(t){const e=d(),[n,s]=Object(a.useState)(""),l=Object(a.useState)(!1)[1],m=Object(a.useRef)(null);const[h,p]=Object(a.useState)(t.bladeburner.consoleHistory.length);function g(){l(t=>!t)}return Object(a.useEffect)(()=>{const t=setInterval(g,1e3);return()=>{clearInterval(t)}},[]),r.a.createElement(o.a,{sx:{p:1}},r.a.createElement(c.a,{sx:{height:"60vh",paddingBottom:"8px",display:"flex",alignItems:"stretch",whiteSpace:"pre-wrap"},onClick:function(){m.current&&m.current.focus()}},r.a.createElement(c.a,null,r.a.createElement(y,{entries:[...t.bladeburner.consoleLogs]}))),r.a.createElement(u.a,{classes:{root:e.textfield},autoFocus:!0,tabIndex:1,type:"text",inputRef:m,value:n,onChange:function(t){s(t.target.value)},onKeyDown:function(e){e.key===i.a.ENTER&&(e.preventDefault(),n.length>0&&(t.bladeburner.postToConsole("> "+n),t.bladeburner.executeConsoleCommands(t.player,n),p(t.bladeburner.consoleHistory.length),s("")));const a=t.bladeburner.consoleHistory;if(e.key===i.a.UP_ARROW){let t=h;const n=a.length;if(0===n)return;(t<0||t>n)&&p(n),0!==t&&(t-=1),p(t);const r=a[t];e.currentTarget.value=r,s(r)}if(e.key===i.a.DOWN_ARROW){const t=h,n=a.length;if(0==n)return;if((t<0||t>n)&&p(n),t==n||t==n-1)p(n),e.currentTarget.value="";else{p(h+1);const t=a[h+1];e.currentTarget.value=t,s(t)}}},InputProps:{className:e.input,startAdornment:r.a.createElement(r.a.Fragment,null,r.a.createElement(f.a,null,"> ")),spellCheck:!1}}))}function y({entries:t}){const e=Object(a.useRef)(null);return Object(a.useEffect)(()=>{e.current&&(e.current.scrollTop=e.current.scrollHeight)},[t.length]),r.a.createElement(s.a,{sx:{height:"100%",overflow:"auto",p:1},ref:e},t&&t.map((t,e)=>r.a.createElement(p,{key:e,content:t})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var a=n(0),r=n.n(a),i=n(1149),o=n(1153),s=n(1159),l=n(1164),c=n(1168),f=n(503),u=n(216),m=n(19);function h(t){const[e,n]=r.a.useState(0);return r.a.createElement(r.a.Fragment,null,r.a.createElement(f.a,{variant:"fullWidth",value:e,onChange:function(t,e){n(e)}},r.a.createElement(u.a,{label:"General"}),r.a.createElement(u.a,{label:"Contracts"}),r.a.createElement(u.a,{label:"Operations"}),r.a.createElement(u.a,{label:"BlackOps"}),r.a.createElement(u.a,{label:"Skills"})),r.a.createElement(m.a,{sx:{p:1}},0===e&&r.a.createElement(i.a,{bladeburner:t.bladeburner,player:t.player}),1===e&&r.a.createElement(o.a,{bladeburner:t.bladeburner,player:t.player}),2===e&&r.a.createElement(s.a,{bladeburner:t.bladeburner,player:t.player}),3===e&&r.a.createElement(l.a,{bladeburner:t.bladeburner,player:t.player}),4===e&&r.a.createElement(c.a,{bladeburner:t.bladeburner})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var a=n(0),r=n(1150),i=n(1);function o(t){return a.createElement(a.Fragment,null,a.createElement(i.a,null,"These are generic actions that will assist you in your Bladeburner duties."),a.createElement(r.a,{bladeburner:t.bladeburner,player:t.player}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(0),r=n.n(a),i=n(1151),o=n(259);function s(t){const e=[];for(const t of Object.keys(o.a))o.a.hasOwnProperty(t)&&e.push(o.a[t]);return r.a.createElement(r.a.Fragment,null,e.map(e=>r.a.createElement(i.a,{key:e.name,bladeburner:t.bladeburner,action:e,player:t.player})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var a=n(0),r=n.n(a),i=n(42),o=n(253),s=n(22),l=n(1152),c=n(166),f=n(372),u=n(1),m=n(19),h=n(45);function d(t){const e=Object(a.useState)(!1)[1];const n=t.action.name===t.bladeburner.action.name,d=Math.min(t.bladeburner.actionTimeCurrent+t.bladeburner.actionTimeOverflow,t.bladeburner.actionTimeToComplete),p=function(){switch(t.action.name){case"Training":case"Field Analysis":return 30;case"Diplomacy":case"Hyperbolic Regeneration Chamber":case"Incite Violence":return 60;case"Recruitment":return t.bladeburner.getRecruitmentTime(t.player)}return-1}(),g="Recruitment"===t.action.name?Math.max(0,Math.min(t.bladeburner.getRecruitmentSuccessChance(t.player),1)):-1,y=l.a[t.action.name];if(void 0===y)throw new Error("Cannot find data for "+t.action.name);return r.a.createElement(h.a,{sx:{my:1,p:1}},n?r.a.createElement(r.a.Fragment,null,r.a.createElement(c.a,{value:t.action.name}),r.a.createElement(u.a,null,"(IN PROGRESS - ",Object(s.f)(d,0)," /"," ",Object(s.f)(t.bladeburner.actionTimeToComplete,0),")"),r.a.createElement(u.a,null,Object(o.a)({progress:d/t.bladeburner.actionTimeToComplete}))):r.a.createElement(m.a,{display:"flex",flexDirection:"row",alignItems:"center"},r.a.createElement(c.a,{value:t.action.name}),r.a.createElement(f.a,{bladeburner:t.bladeburner,type:i.a[t.action.name],name:t.action.name,rerender:function(){e(t=>!t)}})),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(u.a,null,y.desc),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(u.a,null,"Time Required: ",Object(s.d)(1e3*p),-1!==g&&r.a.createElement(r.a.Fragment,null,r.a.createElement("br",null),"Estimated success chance: ",Object(s.f)(100*g,1),"%")))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(0),r=n.n(a);const i={Training:{desc:r.a.createElement(r.a.Fragment,null,"Improve your abilities at the Bladeburner unit's specialized training center. Doing this gives experience for all combat stats and also increases your max stamina.")},"Field Analysis":{desc:r.a.createElement(r.a.Fragment,null,"Mine and analyze Synthoid-related data. This improves the Bladeburner unit's intelligence on Synthoid locations and activities. Completing this action will improve the accuracy of your Synthoid population estimated in the current city.",r.a.createElement("br",null),r.a.createElement("br",null),"Does NOT require stamina.")},Recruitment:{desc:r.a.createElement(r.a.Fragment,null,"Attempt to recruit members for your Bladeburner team. These members can help you conduct operations.",r.a.createElement("br",null),r.a.createElement("br",null),"Does NOT require stamina.")},Diplomacy:{desc:r.a.createElement(r.a.Fragment,null,"Improve diplomatic relations with the Synthoid population. Completing this action will reduce the Chaos level in your current city.",r.a.createElement("br",null),r.a.createElement("br",null),"Does NOT require stamina.")},"Hyperbolic Regeneration Chamber":{desc:r.a.createElement(r.a.Fragment,null,"Enter cryogenic stasis using the Bladeburner division's hi-tech Regeneration Chamber. This will slowly heal your wounds and slightly increase your stamina.",r.a.createElement("br",null),r.a.createElement("br",null))},"Incite Violence":{desc:r.a.createElement(r.a.Fragment,null,"Purposefully stir trouble in the synthoid community in order to gain a political edge. This will generate additional contracts and operations, at the cost of increased Chaos.")}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var a=n(0),r=n(1154),i=n(1);function o(t){return a.createElement(a.Fragment,null,a.createElement(i.a,null,"Complete contracts in order to increase your Bladeburner rank and earn money. Failing a contract will cause you to lose HP, which can lead to hospitalization.",a.createElement("br",null),a.createElement("br",null),"You can unlock higher-level contracts by successfully completing them. Higher-level contracts are more difficult, but grant more rank, experience, and money."),a.createElement(r.a,{bladeburner:t.bladeburner,player:t.player}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var a=n(0),r=n.n(a),i=n(1155);function o(t){const e=Object.keys(t.bladeburner.contracts),n=t.bladeburner.contracts;return r.a.createElement(r.a.Fragment,null,e.map(e=>r.a.createElement(i.a,{key:e,bladeburner:t.bladeburner,action:n[e],player:t.player})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var a=n(0),r=n.n(a),i=n(42),o=n(253),s=n(22),l=n(1156),c=n(466),f=n(166),u=n(614),m=n(617),h=n(372),d=n(1),p=n(45);function g(t){const e=Object(a.useState)(!1)[1];function n(){e(t=>!t)}const g=t.bladeburner.action.type===i.a.Contract&&t.action.name===t.bladeburner.action.name,y=Math.min(t.bladeburner.actionTimeCurrent+t.bladeburner.actionTimeOverflow,t.bladeburner.actionTimeToComplete),b=t.action.getActionTime(t.bladeburner,t.player),E=l.a[t.action.name];if(void 0===E)throw new Error("Cannot find data for "+t.action.name);return r.a.createElement(p.a,{sx:{my:1,p:1}},g?r.a.createElement(r.a.Fragment,null,r.a.createElement(d.a,null,r.a.createElement(f.a,{value:t.action.name})," (IN PROGRESS - ",Object(s.f)(y,0)," /"," ",Object(s.f)(t.bladeburner.actionTimeToComplete,0),")"),r.a.createElement(d.a,null,Object(o.a)({progress:y/t.bladeburner.actionTimeToComplete}))):r.a.createElement(r.a.Fragment,null,r.a.createElement(f.a,{value:t.action.name}),r.a.createElement(h.a,{bladeburner:t.bladeburner,type:i.a.Contract,name:t.action.name,rerender:n})),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(u.a,{action:t.action,bladeburner:t.bladeburner,isActive:g,rerender:n}),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(d.a,null,E.desc,r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(c.a,{action:t.action,bladeburner:t.bladeburner}),r.a.createElement("br",null),"Time Required: ",Object(s.d)(1e3*b),r.a.createElement("br",null),"Contracts remaining: ",Math.floor(t.action.count),r.a.createElement("br",null),"Successes: ",t.action.successes,r.a.createElement("br",null),"Failures: ",t.action.failures),r.a.createElement("br",null),r.a.createElement(m.a,{rerender:n,action:t.action}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(0),r=n.n(a);const i={Tracking:{desc:r.a.createElement(r.a.Fragment,null,"Identify and locate Synthoids. This contract involves reconnaissance and information-gathering ONLY. Do NOT engage. Stealth is of the utmost importance.",r.a.createElement("br",null),r.a.createElement("br",null),"Successfully completing Tracking contracts will slightly improve your Synthoid population estimate for whatever city you are currently in.")},"Bounty Hunter":{desc:r.a.createElement(r.a.Fragment,null,"Hunt down and capture fugitive Synthoids. These Synthoids are wanted alive.",r.a.createElement("br",null),r.a.createElement("br",null),"Successfully completing a Bounty Hunter contract will lower the population in your current city, and will also increase its chaos level.")},Retirement:{desc:r.a.createElement(r.a.Fragment,null,"Hunt down and retire (kill) rogue Synthoids.",r.a.createElement("br",null),r.a.createElement("br",null),"Successfully completing a Retirement contract will lower the population in your current city, and will also increase its chaos level.")}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(0),r=n.n(a),i=n(613),o=n(1),s=n(21);function l(){return r.a.createElement(s.a,{title:r.a.createElement(o.a,null,"This action involves stealth")},i.b)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(0),r=n.n(a),i=n(613),o=n(1),s=n(21);function l(){return r.a.createElement(s.a,{title:r.a.createElement(o.a,null,"This action involves retirement")},i.a)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var a=n(0),r=n(1160),i=n(1);function o(t){return a.createElement(a.Fragment,null,a.createElement(i.a,null,"Carry out operations for the Bladeburner division. Failing an operation will reduce your Bladeburner rank. It will also cause you to lose HP, which can lead to hospitalization. In general, operations are harder and more punishing than contracts, but are also more rewarding.",a.createElement("br",null),a.createElement("br",null),"Operations can affect the chaos level and Synthoid population of your current city. The exact effects vary between different Operations.",a.createElement("br",null),a.createElement("br",null),"For operations, you can use a team. You must first recruit team members. Having a larger team will improve your chances of success.",a.createElement("br",null),a.createElement("br",null),"You can unlock higher-level operations by successfully completing them. Higher-level operations are more difficult, but grant more rank and experience."),a.createElement(r.a,{bladeburner:t.bladeburner,player:t.player}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var a=n(0),r=n.n(a),i=n(1161);function o(t){const e=Object.keys(t.bladeburner.operations),n=t.bladeburner.operations;return r.a.createElement(r.a.Fragment,null,e.map(e=>r.a.createElement(i.a,{key:e,bladeburner:t.bladeburner,action:n[e],player:t.player})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return y}));var a=n(0),r=n.n(a),i=n(42),o=n(253),s=n(22),l=n(466),c=n(614),f=n(617),u=n(372),m=n(618),h=n(1163),d=n(166),p=n(1),g=n(45);function y(t){const e=Object(a.useState)(!1)[1];function n(){e(t=>!t)}const y=t.bladeburner.action.type===i.a.Operation&&t.action.name===t.bladeburner.action.name,b=Math.min(t.bladeburner.actionTimeCurrent+t.bladeburner.actionTimeOverflow,t.bladeburner.actionTimeToComplete),E=t.action.getActionTime(t.bladeburner,t.player),v=h.a[t.action.name];if(void 0===v)throw new Error("Cannot find data for "+t.action.name);return r.a.createElement(g.a,{sx:{my:1,p:1}},y?r.a.createElement(r.a.Fragment,null,r.a.createElement(p.a,null,r.a.createElement(d.a,{value:t.action.name})," (IN PROGRESS - ",Object(s.f)(b,0)," /"," ",Object(s.f)(t.bladeburner.actionTimeToComplete,0),")"),r.a.createElement(p.a,null,Object(o.a)({progress:b/t.bladeburner.actionTimeToComplete}))):r.a.createElement(r.a.Fragment,null,r.a.createElement(d.a,{value:t.action.name}),r.a.createElement(u.a,{bladeburner:t.bladeburner,type:i.a.Operation,name:t.action.name,rerender:n}),r.a.createElement(m.a,{action:t.action,bladeburner:t.bladeburner})),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(c.a,{action:t.action,bladeburner:t.bladeburner,isActive:y,rerender:n}),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(p.a,null,v.desc,r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(l.a,{action:t.action,bladeburner:t.bladeburner}),r.a.createElement("br",null),"Time Required: ",Object(s.d)(1e3*E),r.a.createElement("br",null),"Operations remaining: ",Math.floor(t.action.count),r.a.createElement("br",null),"Successes: ",t.action.successes,r.a.createElement("br",null),"Failures: ",t.action.failures),r.a.createElement("br",null),r.a.createElement(f.a,{rerender:n,action:t.action}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(0),r=n.n(a),i=n(14),o=n(38),s=n(1),l=n(8),c=n(76);function f(t){const[e,n]=Object(a.useState)();return r.a.createElement(o.a,{open:t.open,onClose:t.onClose},r.a.createElement(s.a,null,"Enter the amount of team members you would like to take on this Op. If you do not have the specified number of team members, then as many as possible will be used. Note that team members may be lost during operations."),r.a.createElement(c.a,{autoFocus:!0,type:"number",placeholder:"Team size",value:e,onChange:function(e){const a=parseFloat(e.target.value);a>t.bladeburner.teamSize?n(t.bladeburner.teamSize):n(a)}}),r.a.createElement(l.a,{sx:{mx:2},onClick:function(){if(void 0===e)return;const n=Math.round(e);isNaN(n)||n<0?Object(i.a)("Invalid value entered for number of Team Members (must be numeric, positive)"):t.action.teamCount=n,t.onClose()}},"Confirm"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(0),r=n.n(a);const i={Investigation:{desc:r.a.createElement(r.a.Fragment,null,"As a field agent, investigate and identify Synthoid populations, movements, and operations.",r.a.createElement("br",null),r.a.createElement("br",null),"Successful Investigation ops will increase the accuracy of your synthoid data.",r.a.createElement("br",null),r.a.createElement("br",null),"You will NOT lose HP from failed Investigation ops.")},"Undercover Operation":{desc:r.a.createElement(r.a.Fragment,null,"Conduct undercover operations to identify hidden and underground Synthoid communities and organizations.",r.a.createElement("br",null),r.a.createElement("br",null),"Successful Undercover ops will increase the accuracy of your synthoid data.")},"Sting Operation":{desc:r.a.createElement(r.a.Fragment,null,"Conduct a sting operation to bait and capture particularly notorious Synthoid criminals.")},Raid:{desc:r.a.createElement(r.a.Fragment,null,"Lead an assault on a known Synthoid community. Note that there must be an existing Synthoid community in your current city in order for this Operation to be successful.")},"Stealth Retirement Operation":{desc:r.a.createElement(r.a.Fragment,null,"Lead a covert operation to retire Synthoids. The objective is to complete the task without drawing any attention. Stealth and discretion are key.")},Assassination:{desc:r.a.createElement(r.a.Fragment,null,"Assassinate Synthoids that have been identified as important, high-profile social and political leaders in the Synthoid communities.")}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(0),r=n(1165),i=n(1),o=n(4);function s(t){return a.createElement(a.Fragment,null,a.createElement(i.a,null,"Black Operations (Black Ops) are special, one-time covert operations. Each Black Op must be unlocked successively by completing the one before it.",a.createElement("br",null),a.createElement("br",null),a.createElement("b",null,"Your ultimate goal to climb through the ranks of ",o.a.Bladeburners," is to complete all of the Black Ops."),a.createElement("br",null),a.createElement("br",null),"Like normal operations, you may use a team for Black Ops. Failing a black op will incur heavy HP and rank losses."),a.createElement(r.a,{bladeburner:t.bladeburner,player:t.player}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(0),r=n.n(a),i=n(270),o=n(1166);function s(t){let e=[];for(const t of Object.keys(i.a))i.a.hasOwnProperty(t)&&e.push(i.a[t]);return e.sort((function(t,e){return t.reqdRank-e.reqdRank})),e=e.filter((n,a)=>!(null==t.bladeburner.blackops[e[a].name]&&0!==a&&null==t.bladeburner.blackops[e[a-1].name])),e=e.reverse(),r.a.createElement(r.a.Fragment,null,e.map(e=>r.a.createElement(o.a,{key:e.name,bladeburner:t.bladeburner,action:e,player:t.player})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var a=n(0),r=n.n(a),i=n(22),o=n(42),s=n(253),l=n(618),c=n(1167),f=n(166),u=n(466),m=n(372),h=n(1),d=n(45);function p(t){const e=Object(a.useState)(!1)[1];if(null!=t.bladeburner.blackops[t.action.name])return r.a.createElement(d.a,{sx:{my:1,p:1}},r.a.createElement(h.a,null,t.action.name," (COMPLETED)"));const n=t.bladeburner.action.type===o.a.BlackOperation&&t.action.name===t.bladeburner.action.name,p=t.action.getActionTime(t.bladeburner,t.player),g=t.bladeburner.rank>=t.action.reqdRank,y=Math.min(t.bladeburner.actionTimeCurrent+t.bladeburner.actionTimeOverflow,t.bladeburner.actionTimeToComplete),b=c.a[t.action.name];if(void 0===b)throw new Error("Cannot find data for "+t.action.name);return r.a.createElement(d.a,{sx:{my:1,p:1}},n?r.a.createElement(r.a.Fragment,null,r.a.createElement(r.a.Fragment,null,r.a.createElement(f.a,{value:t.action.name}),r.a.createElement(h.a,null,"(IN PROGRESS - ",Object(i.f)(y,0)," /"," ",Object(i.f)(t.bladeburner.actionTimeToComplete,0),")"),r.a.createElement(h.a,null,Object(s.a)({progress:y/t.bladeburner.actionTimeToComplete})))):r.a.createElement(r.a.Fragment,null,r.a.createElement(f.a,{value:t.action.name}),r.a.createElement(m.a,{bladeburner:t.bladeburner,type:o.a.BlackOperation,name:t.action.name,rerender:function(){e(t=>!t)}}),r.a.createElement(l.a,{action:t.action,bladeburner:t.bladeburner})),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(h.a,null,b.desc),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(h.a,{color:g?"primary":"error"},"Required Rank: ",Object(i.f)(t.action.reqdRank,0)),r.a.createElement("br",null),r.a.createElement(h.a,null,r.a.createElement(u.a,{action:t.action,bladeburner:t.bladeburner}),r.a.createElement("br",null),"Time Required: ",Object(i.d)(1e3*p)))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(0),r=n.n(a),i=n(4),o=n(15),s=n(57);const l={[s.a.OperationTyphoon]:{desc:r.a.createElement(r.a.Fragment,null,"Obadiah Zenyatta is the leader of a RedWater PMC. It has long been known among the intelligence community that Zenyatta, along with the rest of the PMC, is a Synthoid.",r.a.createElement("br",null),r.a.createElement("br",null),"The goal of ",s.a.OperationTyphoon," is to find and eliminate Zenyatta and RedWater by any means necessary. After the task is completed, the actions must be covered up from the general public.")},[s.a.OperationZero]:{desc:r.a.createElement(r.a.Fragment,null,"AeroCorp is one of the world's largest defense contractors. Its leader, Steve Watataki, is thought to be a supporter of Synthoid rights. He must be removed.",r.a.createElement("br",null),r.a.createElement("br",null),"The goal of ",s.a.OperationZero," is to covertly infiltrate AeroCorp and uncover any incriminating evidence or information against Watataki that will cause him to be removed from his position at AeroCorp. Incriminating evidence can be fabricated as a last resort. Be warned that AeroCorp has some of the most advanced security measures in the world.")},[s.a.OperationX]:{desc:r.a.createElement(r.a.Fragment,null,"We have recently discovered an underground publication group called Samizdat. Even though most of their publications are nonsensical conspiracy theories, the average human is gullible enough to believe them. Many of their works discuss Synthoids and pose a threat to society. The publications are spreading rapidly in China and other Eastern countries.",r.a.createElement("br",null),r.a.createElement("br",null),"Samizdat has done a good job of keeping hidden and anonymous. However, we've just received intelligence that their base of operations is in ",o.a.Ishima,"'s underground sewer systems. Your task is to investigate the sewer systems, and eliminate Samizdat. They must never publish anything again.")},[s.a.OperationTitan]:{desc:r.a.createElement(r.a.Fragment,null,"Several months ago Titan Laboratories' Bioengineering department was infiltrated by Synthoids. As far as we know, Titan Laboratories' management has no knowledge about this. We don't know what the Synthoids are up to, but the research that they could be conducting using Titan Laboraties' vast resources is potentially very dangerous.",r.a.createElement("br",null),r.a.createElement("br",null),"Your goal is to enter and destroy the Bioengineering department's facility in ",o.a.Aevum,". The task is not just to retire the Synthoids there, but also to destroy any information or research at the facility that is relevant to the Synthoids and their goals.")},[s.a.OperationAres]:{desc:r.a.createElement(r.a.Fragment,null,"One of our undercover agents, Agent Carter, has informed us of a massive weapons deal going down in Dubai between rogue Russian militants and a radical Synthoid community. These weapons are next-gen plasma and energy weapons. It is critical for the safety of humanity that this deal does not happen.",r.a.createElement("br",null),r.a.createElement("br",null),"Your task is to intercept the deal. Leave no survivors.")},[s.a.OperationArchangel]:{desc:r.a.createElement(r.a.Fragment,null,"Our analysts have discovered that the popular Red Rabbit brothel in Amsterdam is run and 'staffed' by MK-VI Synthoids. Intelligence suggests that the profit from this brothel is used to fund a large black market arms trafficking operation.",r.a.createElement("br",null),r.a.createElement("br",null),"The goal of this operation is to take out the leaders that are running the Red Rabbit brothel. Try to limit the number of other casualties, but do what you must to complete the mission.")},[s.a.OperationJuggernaut]:{desc:r.a.createElement(r.a.Fragment,null,"The CIA has just encountered a new security threat. A new criminal group, lead by a shadowy operative who calls himself Juggernaut, has been smuggling drugs and weapons (including suspected bioweapons) into"," ",o.a.Sector12,". We also have reason to believe they tried to break into one of Universal Energy's facilities in order to cause a city-wide blackout. The CIA suspects that Juggernaut is a heavily-augmented Synthoid, and have thus enlisted our help.",r.a.createElement("br",null),r.a.createElement("br",null),"Your mission is to eradicate Juggernaut and his followers.")},[s.a.OperationRedDragon]:{desc:r.a.createElement(r.a.Fragment,null,"The ",i.a.Tetrads," criminal organization is suspected of reverse-engineering the MK-VI Synthoid design. We believe they altered and possibly improved the design and began manufacturing their own Synthoid models in order to bolster their criminal activities.",r.a.createElement("br",null),r.a.createElement("br",null),"Your task is to infiltrate and destroy the ",i.a.Tetrads,"' base of operations in Los Angeles. Intelligence tells us that their base houses one of their Synthoid manufacturing units.")},[s.a.OperationK]:{desc:r.a.createElement(r.a.Fragment,null,"CODE RED SITUATION. Our intelligence tells us that VitaLife has discovered a new android cloning technology. This technology is supposedly capable of cloning Synthoid, not only physically but also their advanced AI modules. We do not believe that VitaLife is trying to use this technology illegally or maliciously, but if any Synthoids were able to infiltrate the corporation and take advantage of this technology then the results would be catastrophic.",r.a.createElement("br",null),r.a.createElement("br",null),"We do not have the power or jurisdiction to shut this down through legal or political means, so we must resort to a covert operation. Your goal is to destroy this technology and eliminate anyone who was involved in its creation.")},[s.a.OperationDeckard]:{desc:r.a.createElement(r.a.Fragment,null,"Despite your success in eliminating VitaLife's new android-replicating technology in"," ",s.a.OperationK,", we've discovered that a small group of MK-VI Synthoids were able to make off with the schematics and design of the technology before the Operation. It is almost a certainty that these Synthoids are some of the rogue MK-VI ones from the Synthoid Uprising.",r.a.createElement("br",null),r.a.createElement("br",null),"The goal of ",s.a.OperationDeckard," is to hunt down these Synthoids and retire them. I don't need to tell you how critical this mission is.")},[s.a.OperationTyrell]:{desc:r.a.createElement(r.a.Fragment,null,"A week ago ",i.a.BladeIndustries," reported a small break-in at one of their ",o.a.Aevum," ","Augmentation storage facilities. We figured out that ",i.a.TheDarkArmy," was behind the heist, and didn't think any more of it. However, we've just discovered that several known MK-VI Synthoids were part of that break-in group.",r.a.createElement("br",null),r.a.createElement("br",null),"We cannot have Synthoids upgrading their already-enhanced abilities with Augmentations. Your task is to hunt down associated ",i.a.TheDarkArmy," members and eliminate them.")},[s.a.OperationWallace]:{desc:r.a.createElement(r.a.Fragment,null,"Based on information gathered from ",s.a.OperationTyrell,", we've discovered that"," ",i.a.TheDarkArmy," was well aware that there were Synthoids amongst their ranks. Even worse, we believe that ",i.a.TheDarkArmy," is working together with other criminal organizations such as"," ",i.a.TheSyndicate," and that they are planning some sort of large-scale takeover of multiple major cities, most notably ",o.a.Aevum,". We suspect that Synthoids have infiltrated the ranks of these criminal factions and are trying to stage another Synthoid uprising.",r.a.createElement("br",null),r.a.createElement("br",null),"The best way to deal with this is to prevent it before it even happens. The goal of"," ",s.a.OperationWallace," is to destroy ",i.a.TheDarkArmy," and Syndicate factions in"," ",o.a.Aevum," immediately. Leave no survivors.")},[s.a.OperationShoulderOfOrion]:{desc:r.a.createElement(r.a.Fragment,null,"China's Solaris Space Systems is secretly launching the first manned spacecraft in over a decade using Synthoids. We believe China is trying to establish the first off-world colonies.",r.a.createElement("br",null),r.a.createElement("br",null),"The mission is to prevent this launch without instigating an international conflict. When you accept this mission you will be officially disavowed by the NSA and the national government until after you successfully return. In the event of failure, all of the operation's team members must not let themselves be captured alive.")},[s.a.OperationHyron]:{desc:r.a.createElement(r.a.Fragment,null,"Our intelligence tells us that ",i.a.FulcrumSecretTechnologies," is developing a quantum supercomputer using human brains as core processors. This supercomputer is rumored to be able to store vast amounts of data and perform computations unmatched by any other supercomputer on the planet. But more importantly, the use of organic human brains means that the supercomputer may be able to reason abstractly and become self-aware.",r.a.createElement("br",null),r.a.createElement("br",null),"I do not need to remind you why sentient-level AIs pose a serious threat to all of mankind.",r.a.createElement("br",null),r.a.createElement("br",null),"The research for this project is being conducted at one of ",i.a.FulcrumSecretTechnologies," secret facilities in ",o.a.Aevum,", codenamed 'Alpha Ranch'. Infiltrate the compound, delete and destroy the work, and then find and kill the project lead.")},[s.a.OperationMorpheus]:{desc:r.a.createElement(r.a.Fragment,null,"DreamSense Technologies is an advertising company that uses special technology to transmit their ads into the people's dreams and subconcious. They do this using broadcast transmitter towers. Based on information from our agents and informants in ",o.a.Chongqing,", we have reason to believe that one of the broadcast towers there has been compromised by Synthoids and is being used to spread pro-Synthoid propaganda.",r.a.createElement("br",null),r.a.createElement("br",null),"The mission is to destroy this broadcast tower. Speed and stealth are of the utmost importance for this.")},[s.a.OperationIonStorm]:{desc:r.a.createElement(r.a.Fragment,null,"Our analysts have uncovered a gathering of MK-VI Synthoids that have taken up residence in the"," ",o.a.Sector12," Slums. We don't know if they are rogue Synthoids from the Uprising, but we do know that they have been stockpiling weapons, money, and other resources. This makes them dangerous.",r.a.createElement("br",null),r.a.createElement("br",null),"This is a full-scale assault operation to find and retire all of these Synthoids in the ",o.a.Sector12," ","Slums.")},[s.a.OperationAnnihilus]:{desc:r.a.createElement(r.a.Fragment,null,"Our superiors have ordered us to eradicate everything and everyone in an underground facility located in"," ",o.a.Aevum,". They tell us that the facility houses many dangerous Synthoids and belongs to a terrorist organization called '",i.a.TheCovenant,"'. We have no prior intelligence about this organization, so you are going in blind.")},[s.a.OperationUltron]:{desc:r.a.createElement(r.a.Fragment,null,i.a.OmniTekIncorporated,", the original designer and manufacturer of Synthoids, has notified us of a malfunction in their AI design. This malfunction, when triggered, causes MK-VI Synthoids to become radicalized and seek out the destruction of humanity. They say that this bug affects all MK-VI Synthoids, not just the rogue ones from the Uprising.",r.a.createElement("br",null),r.a.createElement("br",null),i.a.OmniTekIncorporated," has also told us they they believe someone has triggered this malfunction in a large group of MK-VI Synthoids, and that these newly-radicalized Synthoids are now amassing in"," ",o.a.Volhaven," to form a terrorist group called Ultron.",r.a.createElement("br",null),r.a.createElement("br",null),"Intelligence suggests Ultron is heavily armed and that their members are augmented. We believe Ultron is making moves to take control of and weaponize DeltaOne's Tactical High-Energy Satellite Laser Array (THESLA).",r.a.createElement("br",null),r.a.createElement("br",null),"Your task is to find and destroy Ultron.")},[s.a.OperationCenturion]:{desc:r.a.createElement(r.a.Fragment,null,"D)@#)($M)C0293c40($*)@#D0JUMP3Rm0C<*@#)*$)#02c94830c(#$*D)",r.a.createElement("br",null),r.a.createElement("br",null),"Throughout all of humanity's history, we have relied on technology to survive, conquer, and progress. Its advancement became our primary goal. And at the peak of human civilization technology turned into power. Global, absolute power.",r.a.createElement("br",null),r.a.createElement("br",null),"It seems that the universe is not without a sense of irony.",r.a.createElement("br",null),r.a.createElement("br",null),"D)@#)($M)C0293c40($*)@#D0JUMP3Rm0C<*@#)*$)#02c94830c(#$*D)")},[s.a.OperationVindictus]:{desc:r.a.createElement(r.a.Fragment,null,"D)@#)($M)C0293c40($*)@#D0JUMP3Rm0C<*@#)*$)#02c94830c(#$*D)",r.a.createElement("br",null),r.a.createElement("br",null),"The bits are all around us. The daemons that hold the Node together can manifest themselves in many different ways.",r.a.createElement("br",null),r.a.createElement("br",null),"D)@#)($M)C0293c40($*)@#D0JUMP3Rm0C<*@#)*$)#02c94830c(#$*D)")},[s.a.OperationDaedalus]:{desc:r.a.createElement(r.a.Fragment,null," Yesterday we obeyed kings and bent our neck to emperors. Today we kneel only to truth.")}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(0),r=n.n(a),i=n(1169),o=n(59),s=n(22),l=n(1);function c(t){const e=Object(a.useState)(!1)[1],n=t.bladeburner.skillMultipliers;function c(t){return t&&1!==t}return r.a.createElement(r.a.Fragment,null,r.a.createElement(l.a,null,r.a.createElement("strong",null,"Skill Points: ",Object(s.f)(t.bladeburner.skillPoints,0))),r.a.createElement(l.a,null,"You will gain one skill point every ",o.a.RanksPerSkillPoint," ranks.",r.a.createElement("br",null),"Note that when upgrading a skill, the benefit for that skill is additive. However, the effects of different skills with each other is multiplicative."),c(n.successChanceAll)&&r.a.createElement(l.a,null,"Total Success Chance: x",Object(s.f)(n.successChanceAll,3)),c(n.successChanceStealth)&&r.a.createElement(l.a,null,"Stealth Success Chance: x",Object(s.f)(n.successChanceStealth,3)),c(n.successChanceKill)&&r.a.createElement(l.a,null,"Retirement Success Chance: x",Object(s.f)(n.successChanceKill,3)),c(n.successChanceContract)&&r.a.createElement(l.a,null,"Contract Success Chance: x",Object(s.f)(n.successChanceContract,3)),c(n.successChanceOperation)&&r.a.createElement(l.a,null,"Operation Success Chance: x",Object(s.f)(n.successChanceOperation,3)),c(n.successChanceEstimate)&&r.a.createElement(l.a,null,"Synthoid Data Estimate: x",Object(s.f)(n.successChanceEstimate,3)),c(n.actionTime)&&r.a.createElement(l.a,null,"Action Time: x",Object(s.f)(n.actionTime,3)),c(n.effHack)&&r.a.createElement(l.a,null,"Hacking Skill: x",Object(s.f)(n.effHack,3)),c(n.effStr)&&r.a.createElement(l.a,null,"Strength: x",Object(s.f)(n.effStr,3)),c(n.effDef)&&r.a.createElement(l.a,null,"Defense: x",Object(s.f)(n.effDef,3)),c(n.effDex)&&r.a.createElement(l.a,null,"Dexterity: x",Object(s.f)(n.effDex,3)),c(n.effAgi)&&r.a.createElement(l.a,null,"Agility: x",Object(s.f)(n.effAgi,3)),c(n.effCha)&&r.a.createElement(l.a,null,"Charisma: x",Object(s.f)(n.effCha,3)),c(n.effInt)&&r.a.createElement(l.a,null,"Intelligence: x",Object(s.f)(n.effInt,3)),c(n.stamina)&&r.a.createElement(l.a,null,"Stamina: x",Object(s.f)(n.stamina,3)),c(n.money)&&r.a.createElement(l.a,null,"Contract Money: x",Object(s.f)(n.money,3)),c(n.expGain)&&r.a.createElement(l.a,null,"Exp Gain: x",Object(s.f)(n.expGain,3)),r.a.createElement(i.a,{bladeburner:t.bladeburner,onUpgrade:()=>e(t=>!t)}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var a=n(0),r=n(1170),i=n(227);function o(t){return a.createElement(a.Fragment,null,Object.keys(i.a).map(e=>a.createElement(r.a,{key:e,bladeburner:t.bladeburner,skill:i.a[e],onUpgrade:t.onUpgrade})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var a=n(0),r=n.n(a),i=n(166),o=n(22),s=n(1),l=n(111),c=n(19),f=n(45),u=n(611),m=n.n(u),h=n(536),d=n.n(h);function p(t){const e=t.skill.name;let n=0;t.bladeburner.skills[e]&&!isNaN(t.bladeburner.skills[e])&&(n=t.bladeburner.skills[e]);const a=t.skill.calculateCost(n),u=t.bladeburner.skillPoints>=a,h=!!t.skill.maxLvl&&n>=t.skill.maxLvl;return r.a.createElement(f.a,{sx:{my:1,p:1}},r.a.createElement(c.a,{display:"flex",flexDirection:"row",alignItems:"center"},r.a.createElement(i.a,{variant:"h6",color:"primary",value:t.skill.name}),!u||h?r.a.createElement(l.a,{disabled:!0},r.a.createElement(d.a,null)):r.a.createElement(l.a,{onClick:function(){t.bladeburner.skillPoints{const t=setInterval(()=>h(t=>!t),200);return()=>clearInterval(t)},[]),r.a.createElement(c.a.Gang.Provider,{value:e},r.a.createElement(f.a,{variant:"fullWidth",value:n,onChange:function(t,e){m(e)},sx:{minWidth:"fit-content",maxWidth:"45%"}},r.a.createElement(u.a,{label:"Management"}),r.a.createElement(u.a,{label:"Equipment"}),r.a.createElement(u.a,{label:"Territory"})),0===n&&r.a.createElement(i.a,null),1===n&&r.a.createElement(s.a,null),2===n&&r.a.createElement(o.a,null))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(0),r=n.n(a),i=n(1173),o=n(1175),s=n(141),l=n(1);function c(){const t=Object(s.b)();return r.a.createElement(r.a.Fragment,null,r.a.createElement(l.a,null,"This page is used to manage your gang members and get an overview of your gang's stats.",r.a.createElement("br",null),r.a.createElement("br",null),"If a gang member is not earning much money or respect, the task that you have assigned to that member might be too difficult. Consider training that member's stats or choosing an easier task. The tasks closer to the top of the dropdown list are generally easier. Alternatively, the gang member's low production might be due to the fact that your wanted level is too high. Consider assigning a few members to the '",t.isHackingGang?"Ethical Hacking":"Vigilante Justice","' task to lower your wanted level.",r.a.createElement("br",null),r.a.createElement("br",null),"Installing Augmentations does NOT reset your progress with your Gang. Furthermore, after installing Augmentations, you will automatically be a member of whatever Faction you created your gang with.",r.a.createElement("br",null),r.a.createElement("br",null),"You can also manage your gang programmatically through Netscript using the Gang API"),r.a.createElement("br",null),r.a.createElement(i.a,null),r.a.createElement("br",null),r.a.createElement(o.a,null))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var a=n(0),r=n.n(a),i=n(26),o=n(22),s=n(5),l=n(112),c=n(128),f=n(82),u=n(1174),m=n(141),h=n(1),d=n(21),p=n(19);function g(){const t=Object(m.b)(),e=100*f.a[t.facName].territory;let n;return n=e<=0?Object(o.f)(0,2):e>=100?Object(o.f)(100,2):Object(o.f)(e,2),r.a.createElement(r.a.Fragment,null,r.a.createElement(p.a,{display:"flex"},r.a.createElement(d.a,{title:r.a.createElement(h.a,null,"Represents the amount of respect your gang has from other gangs and criminal organizations. Your respect affects the amount of money your gang members will earn, and also determines how much reputation you are earning with your gang's corresponding Faction.")},r.a.createElement(h.a,null,"Respect: ",s.a.formatRespect(t.respect)," (",s.a.formatRespect(5*t.respectGainRate)," / sec)"))),r.a.createElement(p.a,{display:"flex"},r.a.createElement(d.a,{title:r.a.createElement(h.a,null,"Represents how much the gang is wanted by law enforcement. The higher your gang's wanted level, the harder it will be for your gang members to make money and earn respect. Note that the minimum wanted level is 1.")},r.a.createElement(h.a,null,"Wanted Level: ",s.a.formatWanted(t.wanted)," (",s.a.formatWanted(5*t.wantedGainRate)," / sec)"))),r.a.createElement(p.a,{display:"flex"},r.a.createElement(d.a,{title:r.a.createElement(h.a,null,"Penalty for respect and money gain rates due to Wanted Level")},r.a.createElement(h.a,null,"Wanted Level Penalty: -",Object(o.f)(100*(1-t.getWantedPenalty()),2),"%"))),r.a.createElement(h.a,null,"Money gain rate: ",r.a.createElement(l.a,{money:5*t.moneyGainRate})),r.a.createElement(p.a,{display:"flex"},r.a.createElement(d.a,{title:r.a.createElement(h.a,null,"The percentage of total territory your Gang controls")},r.a.createElement(h.a,null,"Territory: ",n,"%"))),r.a.createElement(h.a,null,"Faction reputation: ",r.a.createElement(c.a,{reputation:i.a[t.facName].playerReputation})),r.a.createElement(u.a,{gang:t}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(0),r=n(10),i=n(22),o=n(1),s=n(21),l=n(19);function c(t){const e=1e3/r.a._idleSpeed;if(t.gang.storedCycles/e*1e3<=5e3)return a.createElement(a.Fragment,null);const n=t.gang.storedCycles/e*1e3;return a.createElement(l.a,{display:"flex"},a.createElement(s.a,{title:a.createElement(o.a,null,"You gain bonus time while offline or when the game is inactive (e.g. when the tab is throttled by the browser). Bonus time makes the Gang mechanic progress faster, up to 5x the normal speed.")},a.createElement(o.a,null,"Bonus time: ",Object(i.d)(n))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var a=n(0),r=n.n(a),i=n(1176),o=n(1187),s=n(141),l=n(76),c=n(19),f=n(344),u=n.n(f),m=n(147);function h(){const t=Object(s.b)(),e=Object(a.useState)(!1)[1],[n,f]=Object(a.useState)(""),[h,d]=Object(a.useState)(!1),p=t.members.filter(t=>t&&t.name.toLowerCase().includes(n)).filter(t=>!h||t.canAscend());return r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,{onRecruit:()=>e(t=>!t)}),r.a.createElement(l.a,{value:n,onChange:t=>{f(t.target.value.toLowerCase())},autoFocus:!0,InputProps:{startAdornment:r.a.createElement(u.a,null),spellCheck:!1},placeholder:"Filter by member name",sx:{m:1,width:"15%"}}),r.a.createElement(m.a,{checked:h,onChange:t=>d(t),text:"Show only ascendable",tooltip:r.a.createElement(r.a.Fragment,null,"Filter the members list by whether or not the member can be ascended.")}),r.a.createElement(c.a,{display:"grid",sx:{gridTemplateColumns:"repeat(2, 1fr)"}},p.map(t=>r.a.createElement(i.a,{key:t.name,member:t}))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(0),r=n.n(a),i=n(1177),o=n(19),s=n(113),l=n(45);function c(t){return r.a.createElement(o.a,{component:l.a,sx:{width:"auto"}},r.a.createElement(o.a,{sx:{m:1}},r.a.createElement(s.a,{primary:r.a.createElement("b",null,t.member.name)}),r.a.createElement(i.a,{member:t.member})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var a=n(0),r=n.n(a),i=n(1178),o=n(1184),s=n(1186),l=n(1482),c=n(8),f=n(1),u=n(299),m=n.n(u),h=n(468);function d(t){const e=Object(a.useState)(!1)[1],[n,u]=Object(a.useState)(!1),[d,p]=Object(a.useState)(!1);return r.a.createElement(r.a.Fragment,null,t.member.canAscend()&&r.a.createElement(l.a,{sx:{display:"flex",justifyContent:"space-between",my:1}},r.a.createElement(c.a,{onClick:()=>p(!0),style:{flexGrow:1,borderRightWidth:0}},"Ascend"),r.a.createElement(s.a,{open:d,onClose:()=>p(!1),member:t.member,onAscend:()=>e(t=>!t)}),r.a.createElement(c.a,{onClick:()=>u(!0),style:{width:"fit-content",borderLeftWidth:0}},r.a.createElement(m.a,null)),r.a.createElement(h.a,{open:n,onClose:()=>u(!1)},r.a.createElement(f.a,null,"Ascending a Gang Member resets the member's progress and stats in exchange for a permanent boost to their stat multipliers.",r.a.createElement("br",null),r.a.createElement("br",null),"The additional stat multiplier that the Gang Member gains upon ascension is based on the amount of exp they have.",r.a.createElement("br",null),r.a.createElement("br",null),"Upon ascension, the member will lose all of its non-Augmentation Equipment and your gang will lose respect equal to the total respect earned by the member."))),r.a.createElement(l.a,{display:"grid",sx:{gridTemplateColumns:"1fr 1fr",width:"100%",gap:1}},r.a.createElement(i.a,{member:t.member}),r.a.createElement(o.a,{onTaskChange:()=>e(t=>!t),member:t.member})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return y}));var a=n(0),r=n.n(a),i=n(141),o=n(1),s=n(21),l=n(148),c=n(149),f=n(50),u=n(30),m=n(5),h=n(6),d=n(112),p=n(73),g=n(301);function y(t){const e=Object(g.b)(),n={hack:t.member.calculateAscensionMult(t.member.hack_asc_points),str:t.member.calculateAscensionMult(t.member.str_asc_points),def:t.member.calculateAscensionMult(t.member.def_asc_points),dex:t.member.calculateAscensionMult(t.member.dex_asc_points),agi:t.member.calculateAscensionMult(t.member.agi_asc_points),cha:t.member.calculateAscensionMult(t.member.cha_asc_points)},a=Object(i.b)(),y=[["Money:",r.a.createElement(d.a,{money:5*t.member.calculateMoneyGain(a)})],["Respect:",m.a.formatRespect(5*t.member.calculateRespectGain(a))+" / sec"],["Wanted Level:",m.a.formatWanted(5*t.member.calculateWantedLevelGain(a))+" / sec"],["Total Respect:",""+m.a.formatRespect(t.member.earnedRespect)]];return r.a.createElement(r.a.Fragment,null,r.a.createElement(s.a,{title:r.a.createElement(o.a,null,"Hk: x",m.a.formatMultiplier(t.member.hack_mult*n.hack),"(x",m.a.formatMultiplier(t.member.hack_mult)," Eq, x",m.a.formatMultiplier(n.hack)," ","Asc)",r.a.createElement("br",null),"St: x",m.a.formatMultiplier(t.member.str_mult*n.str),"(x",m.a.formatMultiplier(t.member.str_mult)," Eq, x",m.a.formatMultiplier(n.str)," ","Asc)",r.a.createElement("br",null),"Df: x",m.a.formatMultiplier(t.member.def_mult*n.def),"(x",m.a.formatMultiplier(t.member.def_mult)," Eq, x",m.a.formatMultiplier(n.def)," ","Asc)",r.a.createElement("br",null),"Dx: x",m.a.formatMultiplier(t.member.dex_mult*n.dex),"(x",m.a.formatMultiplier(t.member.dex_mult)," Eq, x",m.a.formatMultiplier(n.dex)," ","Asc)",r.a.createElement("br",null),"Ag: x",m.a.formatMultiplier(t.member.agi_mult*n.agi),"(x",m.a.formatMultiplier(t.member.agi_mult)," Eq, x",m.a.formatMultiplier(n.agi)," ","Asc)",r.a.createElement("br",null),"Ch: x",m.a.formatMultiplier(t.member.cha_mult*n.cha),"(x",m.a.formatMultiplier(t.member.cha_mult)," Eq, x",m.a.formatMultiplier(n.cha)," ","Asc)")},r.a.createElement(l.a,{sx:{display:"table",mb:1,width:"100%"}},r.a.createElement(c.a,null,r.a.createElement(p.a,{name:"Hacking",color:h.a.theme.hack,data:{level:t.member.hack,exp:t.member.hack_exp}}),r.a.createElement(p.a,{name:"Strength",color:h.a.theme.combat,data:{level:t.member.str,exp:t.member.str_exp}}),r.a.createElement(p.a,{name:"Defense",color:h.a.theme.combat,data:{level:t.member.def,exp:t.member.def_exp}}),r.a.createElement(p.a,{name:"Dexterity",color:h.a.theme.combat,data:{level:t.member.dex,exp:t.member.dex_exp}}),r.a.createElement(p.a,{name:"Agility",color:h.a.theme.combat,data:{level:t.member.agi,exp:t.member.agi_exp}}),r.a.createElement(p.a,{name:"Charisma",color:h.a.theme.cha,data:{level:t.member.cha,exp:t.member.cha_exp}}),r.a.createElement(f.a,null,r.a.createElement(u.a,{classes:{root:e.cellNone}},r.a.createElement("br",null))),y.map(([t,n])=>r.a.createElement(f.a,{key:t.toString()+n.toString()},r.a.createElement(u.a,{classes:{root:e.cellNone}},r.a.createElement(o.a,null,t)),r.a.createElement(u.a,{align:"right",classes:{root:e.cellNone}},r.a.createElement(o.a,null,n))))))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(0),r=n.n(a),i=n(38),o=n(1),s=n(8);function l(t){return r.a.createElement(i.a,{open:t.open,onClose:t.onClose},r.a.createElement(o.a,null,"Forcefully kill all running scripts? This will also save your game and reload the game."),r.a.createElement(s.a,{onClick:function(){t.killScripts(),t.onClose()}},"KILL"))}},,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(0),r=n.n(a),i=n(141),o=n(1185),s=n(19),l=n(74),c=n(130);function f(t){const e=Object(i.b)(),[n,f]=Object(a.useState)(t.member.task),u=e.members.find(e=>e.name==t.member.name);u&&u.task!=n&&f(u.task);const m=e.getAllTaskNames();return r.a.createElement(s.a,null,r.a.createElement(c.a,{onChange:function(e){const n=e.target.value;t.member.assignToTask(n),f(n),t.onTaskChange()},value:n,sx:{width:"100%"}},r.a.createElement(l.a,{key:0,value:"Unassigned"},"Unassigned"),m.map((t,e)=>r.a.createElement(l.a,{key:e+1,value:t},t))),r.a.createElement(o.a,{member:t.member}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(0),r=n.n(a),i=n(242),o=n(1);function s(t){const e=i.a[t.member.task],n=e?e.desc:i.a.Unassigned.desc;return r.a.createElement(o.a,{dangerouslySetInnerHTML:{__html:n}})}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var a=n(0),r=n.n(a),i=n(5),o=n(14),s=n(38),l=n(141),c=n(1),f=n(8);function u(t){const e=Object(l.b)(),n=Object(a.useState)(!1)[1];Object(a.useEffect)(()=>{const t=setInterval(()=>n(t=>!t),1e3);return()=>clearInterval(t)},[]);const u=t.member.getCurrentAscensionMults(),m=t.member.getAscensionMultsAfterAscend();return r.a.createElement(s.a,{open:t.open,onClose:t.onClose},r.a.createElement(c.a,null,"Are you sure you want to ascend this member? They will lose all of",r.a.createElement("br",null),"their non-Augmentation upgrades and their stats will reset back to 1.",r.a.createElement("br",null),r.a.createElement("br",null),"Furthermore, your gang will lose ",i.a.formatRespect(t.member.earnedRespect)," respect",r.a.createElement("br",null),r.a.createElement("br",null),"In return, they will gain the following permanent boost to stat multipliers:",r.a.createElement("br",null),"Hacking: x",i.a.format(u.hack,"0.000")," => x",i.a.format(m.hack,"0.000"),r.a.createElement("br",null),"Strength: x",i.a.format(u.str,"0.000")," => x",i.a.format(m.str,"0.000"),r.a.createElement("br",null),"Defense: x",i.a.format(u.def,"0.000")," => x",i.a.format(m.def,"0.000"),r.a.createElement("br",null),"Dexterity: x",i.a.format(u.dex,"0.000")," => x",i.a.format(m.dex,"0.000"),r.a.createElement("br",null),"Agility: x",i.a.format(u.agi,"0.000")," => x",i.a.format(m.agi,"0.000"),r.a.createElement("br",null),"Charisma: x",i.a.format(u.cha,"0.000")," => x",i.a.format(m.cha,"0.000"),r.a.createElement("br",null)),r.a.createElement(f.a,{onClick:function(){t.onAscend();const n=e.ascendMember(t.member);Object(o.a)(r.a.createElement(r.a.Fragment,null,"You ascended ",t.member.name,"!",r.a.createElement("br",null),r.a.createElement("br",null),"Your gang lost ",i.a.formatRespect(n.respect)," respect.",r.a.createElement("br",null),r.a.createElement("br",null),t.member.name," gained the following stat multipliers for ascending:",r.a.createElement("br",null),"Hacking: x",i.a.format(n.hack,"0.000"),r.a.createElement("br",null),"Strength: x",i.a.format(n.str,"0.000"),r.a.createElement("br",null),"Defense: x",i.a.format(n.def,"0.000"),r.a.createElement("br",null),"Dexterity: x",i.a.format(n.dex,"0.000"),r.a.createElement("br",null),"Agility: x",i.a.format(n.agi,"0.000"),r.a.createElement("br",null),"Charisma: x",i.a.format(n.cha,"0.000"),r.a.createElement("br",null))),t.onClose()}},"Ascend"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var a=n(0),r=n.n(a),i=n(1188),o=n(187),s=n(5),l=n(141),c=n(1),f=n(8),u=n(19);function m(t){const e=Object(l.b)(),[n,m]=Object(a.useState)(!1);if(e.members.length>=o.a.MaximumGangMembers)return r.a.createElement(r.a.Fragment,null);if(!e.canRecruitMember()){const t=e.getRespectNeededToRecruitMember();return r.a.createElement(u.a,{display:"flex",alignItems:"center",sx:{mx:1}},r.a.createElement(f.a,{disabled:!0},"Recruit Gang Member"),r.a.createElement(c.a,{sx:{ml:1}},s.a.formatRespect(t)," respect needed to recruit next member"))}return r.a.createElement(r.a.Fragment,null,r.a.createElement(u.a,{sx:{mx:1}},r.a.createElement(f.a,{onClick:()=>m(!0)},"Recruit Gang Member")),r.a.createElement(i.a,{open:n,onClose:()=>m(!1),onRecruit:t.onRecruit}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var a=n(0),r=n.n(a),i=n(38),o=n(14),s=n(141),l=n(1),c=n(76),f=n(8),u=n(27);function m(t){const e=Object(s.b)(),[n,m]=Object(a.useState)(""),h=""===n||!e.canRecruitMember();function d(){h||(e.recruitMember(n)?(t.onRecruit(),t.onClose()):Object(o.a)("You already have a gang member with this name!"))}return r.a.createElement(i.a,{open:t.open,onClose:t.onClose},r.a.createElement(l.a,null,"Enter a name for your new Gang member:"),r.a.createElement("br",null),r.a.createElement(c.a,{autoFocus:!0,onKeyUp:function(t){t.key===u.a.ENTER&&d()},onChange:function(t){m(t.target.value)},type:"text",placeholder:"unique name",InputProps:{endAdornment:r.a.createElement(f.a,{disabled:h,onClick:d},"Recruit")}}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return E}));var a=n(0),r=n.n(a),i=n(249),o=n(1),s=n(8),l=n(19),c=n(45),f=n(333),u=n(277),m=n(21),h=n(1790),d=n(5),p=n(22),g=n(82),y=n(141),b=n(1190);function E(){const t=Object(y.b)(),e=Object.keys(g.a).filter(e=>e!=t.facName),[n,E]=Object(a.useState)(!1);return r.a.createElement(i.a,{disableGutters:!0,maxWidth:"md",sx:{mx:0}},r.a.createElement(o.a,null,"This page shows how much territory your Gang controls. This statistic is listed as a percentage, which represents how much of the total territory you control."),r.a.createElement(s.a,{onClick:()=>E(!0),sx:{my:1}},r.a.createElement(h.a,{sx:{mr:1}}),"About Gang Territory"),r.a.createElement(l.a,{component:c.a,sx:{p:1,mb:1}},r.a.createElement(o.a,{variant:"h6",sx:{display:"flex",alignItems:"center",flexWrap:"wrap"}},t.facName," (Your gang)"),r.a.createElement(f.a,{control:r.a.createElement(u.a,{checked:t.territoryWarfareEngaged,onChange:e=>t.territoryWarfareEngaged=e.target.checked}),label:r.a.createElement(m.a,{title:r.a.createElement(o.a,null,"Engaging in Territory Warfare sets your clash chance to 100%. Disengaging will cause your clash chance to gradually decrease until it reaches 0%.")},r.a.createElement(o.a,null,"Engage in Territory Warfare"))}),r.a.createElement("br",null),r.a.createElement(f.a,{control:r.a.createElement(u.a,{checked:t.notifyMemberDeath,onChange:e=>t.notifyMemberDeath=e.target.checked}),label:r.a.createElement(m.a,{title:r.a.createElement(o.a,null,"If this is enabled, then you will receive a pop-up notifying you whenever one of your Gang Members dies in a territory clash.")},r.a.createElement(o.a,null,"Notify about Gang Member Deaths"))}),r.a.createElement(o.a,null,r.a.createElement("b",null,"Territory Clash Chance:")," ",d.a.formatPercentage(t.territoryClashChance,3)," ",r.a.createElement("br",null),r.a.createElement("b",null,"Power:")," ",Object(p.f)(g.a[t.facName].power,3)," ",r.a.createElement("br",null),r.a.createElement("b",null,"Territory:")," ",v(g.a[t.facName].territory),"% ",r.a.createElement("br",null))),r.a.createElement(l.a,{sx:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)"}},e.sort((t,e)=>g.a[t].territory<=0&&g.a[e].territory>0?1:g.a[t].territory>0&&g.a[e].territory<=0?-1:0).map(t=>r.a.createElement(k,{key:t,name:t}))),r.a.createElement(b.a,{open:n,onClose:()=>E(!1)}))}function v(t){const e=100*t;return e<=0?Object(p.f)(0,3):e>=100?Object(p.f)(100,3):Object(p.f)(e,3)}function k(t){const e=Object(y.b)(),n=g.a[e.facName].power,a=g.a[t.name].power,i=n/(a+n),s=g.a[t.name].territory,f=s?1:.75;return r.a.createElement(l.a,{component:c.a,sx:{p:1,opacity:f}},r.a.createElement(o.a,{variant:"h6",sx:{display:"flex",alignItems:"center",flexWrap:"wrap"}},t.name),r.a.createElement(o.a,null,r.a.createElement("b",null,"Power:")," ",Object(p.f)(a,3)," ",r.a.createElement("br",null),r.a.createElement("b",null,"Territory:")," ",v(s),"% ",r.a.createElement("br",null),r.a.createElement("b",null,"Clash Win Chance:")," ",d.a.formatPercentage(i,3)))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(0),r=n.n(a),i=n(1),o=n(38);const s=({open:t,onClose:e})=>r.a.createElement(o.a,{open:t,onClose:e},r.a.createElement(r.a.Fragment,null,r.a.createElement(i.a,{variant:"h4"},"Clashing"),r.a.createElement(i.a,null,"Every ~20 seconds, your gang has a chance to 'clash' with other gangs. Your chance to win a clash depends on your gang's power, which is listed in the display below. Your gang's power slowly accumulates over time. The accumulation rate is determined by the stats of all Gang members you have assigned to the 'Territory Warfare' task. Gang members that are not assigned to this task do not contribute to your gang's power. Your gang also loses a small amount of power whenever you lose a clash.",r.a.createElement("br",null),r.a.createElement("br",null),"NOTE: Gang members assigned to 'Territory Warfare' can be killed during clashes. This can happen regardless of whether you win or lose the clash. A gang member being killed results in both respect and power loss for your gang."),r.a.createElement("br",null),r.a.createElement(i.a,{variant:"h4"},"Territory"),r.a.createElement(i.a,null,"The amount of territory you have affects all aspects of your Gang members' production, including money, respect, and wanted level. It is very beneficial to have high territory control.",r.a.createElement("br",null),r.a.createElement("br",null),'To increase your chances of winning territory, assign gang members to "Territory Warfare". This will build your gang power. Then, enable "Engage in Territory Warfare" to start fighting over territory.'),r.a.createElement("br",null),r.a.createElement(i.a,{variant:"h4"},"Territory Clash Chance"),r.a.createElement(i.a,null,"This percentage represents the chance you have of 'clashing' with another gang. If you do not wish to gain/lose territory, then keep this percentage at 0% by not engaging in territory warfare.")))},function(t,e,n){"use strict";n.d(e,"a",(function(){return M}));var a=n(0),r=n.n(a),i=n(141),o=n(1),s=n(8),l=n(21),c=n(19),f=n(45),u=n(130),m=n(148),h=n(149),d=n(74),p=n(76),g=n(344),y=n.n(g),b=n(5),E=n(229),v=n(20),k=n(183),_=n(29),w=n(6),S=n(73);function x(t){const e=Object(i.b)(),n=_.b.Player(),a=Object.keys(E.a).filter(a=>{const r=E.a[a];return!(n.money>e.getUpgradeCost(r))&&(r.type===t.type&&!t.upgrades.includes(a))}).map(t=>E.a[t]);return 0===a.length?r.a.createElement(r.a.Fragment,null):r.a.createElement(o.a,null,"Next at ",r.a.createElement(v.a,{money:a[0].cost}))}function C({upgName:t}){const e=E.a[t];return r.a.createElement(f.a,{sx:{p:1}},r.a.createElement(l.a,{title:r.a.createElement(o.a,{dangerouslySetInnerHTML:{__html:e.desc}})},r.a.createElement(o.a,null,e.name)))}function L(t){const e=Object(i.b)(),n=_.b.Player();return r.a.createElement(l.a,{title:r.a.createElement(o.a,{dangerouslySetInnerHTML:{__html:t.upg.desc}})},r.a.createElement("span",null,r.a.createElement(s.a,{onClick:function(){t.member.buyUpgrade(t.upg,n,e),t.rerender()},sx:{display:"flex",flexDirection:"column",width:"100%",height:"100%"}},r.a.createElement(o.a,{sx:{display:"block"}},t.upg.name),r.a.createElement(v.a,{money:e.getUpgradeCost(t.upg)}))))}function O(t){const e=Object(i.b)(),n=_.b.Player(),s=Object(a.useState)(!1)[1],[p,g]=Object(a.useState)("Weapons");function y(){s(t=>!t)}function v(t,a){return Object.keys(E.a).filter(r=>{const i=E.a[r];return!(n.moneyE.a[t])}const O=v(t.member.upgrades,k.a.Weapon),M=v(t.member.upgrades,k.a.Armor),T=v(t.member.upgrades,k.a.Vehicle),A=v(t.member.upgrades,k.a.Rootkit),R=v(t.member.augmentations,k.a.Augmentation),N={Weapons:[O,k.a.Weapon],Armor:[M,k.a.Armor],Vehicles:[T,k.a.Vehicle],Rootkits:[A,k.a.Rootkit],Augmentations:[R,k.a.Augmentation]},P={hack:t.member.calculateAscensionMult(t.member.hack_asc_points),str:t.member.calculateAscensionMult(t.member.str_asc_points),def:t.member.calculateAscensionMult(t.member.def_asc_points),dex:t.member.calculateAscensionMult(t.member.dex_asc_points),agi:t.member.calculateAscensionMult(t.member.agi_asc_points),cha:t.member.calculateAscensionMult(t.member.cha_asc_points)};return r.a.createElement(f.a,null,r.a.createElement(c.a,{display:"grid",sx:{gridTemplateColumns:"1fr 1fr",m:1,gap:1}},r.a.createElement("span",null,r.a.createElement(o.a,{variant:"h5",color:"primary"},t.member.name," (",t.member.task,")"),r.a.createElement(l.a,{title:r.a.createElement(o.a,null,"Hk: x",b.a.formatMultiplier(t.member.hack_mult*P.hack),"(x",b.a.formatMultiplier(t.member.hack_mult)," Eq, x",b.a.formatMultiplier(P.hack)," Asc)",r.a.createElement("br",null),"St: x",b.a.formatMultiplier(t.member.str_mult*P.str),"(x",b.a.formatMultiplier(t.member.str_mult)," Eq, x",b.a.formatMultiplier(P.str)," Asc)",r.a.createElement("br",null),"Df: x",b.a.formatMultiplier(t.member.def_mult*P.def),"(x",b.a.formatMultiplier(t.member.def_mult)," Eq, x",b.a.formatMultiplier(P.def)," Asc)",r.a.createElement("br",null),"Dx: x",b.a.formatMultiplier(t.member.dex_mult*P.dex),"(x",b.a.formatMultiplier(t.member.dex_mult)," Eq, x",b.a.formatMultiplier(P.dex)," Asc)",r.a.createElement("br",null),"Ag: x",b.a.formatMultiplier(t.member.agi_mult*P.agi),"(x",b.a.formatMultiplier(t.member.agi_mult)," Eq, x",b.a.formatMultiplier(P.agi)," Asc)",r.a.createElement("br",null),"Ch: x",b.a.formatMultiplier(t.member.cha_mult*P.cha),"(x",b.a.formatMultiplier(t.member.cha_mult)," Eq, x",b.a.formatMultiplier(P.cha)," Asc)")},r.a.createElement(m.a,null,r.a.createElement(h.a,null,r.a.createElement(S.a,{name:"Hacking",color:w.a.theme.hack,data:{level:t.member.hack,exp:t.member.hack_exp}}),r.a.createElement(S.a,{name:"Strength",color:w.a.theme.combat,data:{level:t.member.str,exp:t.member.str_exp}}),r.a.createElement(S.a,{name:"Defense",color:w.a.theme.combat,data:{level:t.member.def,exp:t.member.def_exp}}),r.a.createElement(S.a,{name:"Dexterity",color:w.a.theme.combat,data:{level:t.member.dex,exp:t.member.dex_exp}}),r.a.createElement(S.a,{name:"Agility",color:w.a.theme.combat,data:{level:t.member.agi,exp:t.member.agi_exp}}),r.a.createElement(S.a,{name:"Charisma",color:w.a.theme.cha,data:{level:t.member.cha,exp:t.member.cha_exp}}))))),r.a.createElement("span",null,r.a.createElement(u.a,{onChange:t=>{g(t.target.value),y()},value:p,sx:{width:"100%",mb:1}},Object.keys(N).map((t,e)=>r.a.createElement(d.a,{key:e+1,value:t},r.a.createElement(o.a,{variant:"h6"},t)))),r.a.createElement(c.a,{sx:{width:"100%"}},0===N[p][0].length&&r.a.createElement(o.a,null,"All upgrades owned!"),r.a.createElement(c.a,{display:"grid",sx:{gridTemplateColumns:"1fr 1fr"}},N[p][0].map(e=>r.a.createElement(L,{key:e.name,rerender:y,member:t.member,upg:e}))),r.a.createElement(x,{type:N[p][1],upgrades:t.member.upgrades})))),r.a.createElement(o.a,{sx:{mx:1}},"Purchased Upgrades: "),r.a.createElement(c.a,{display:"grid",sx:{gridTemplateColumns:"repeat(4, 1fr)",m:1}},t.member.upgrades.map(t=>r.a.createElement(C,{key:t,upgName:t})),t.member.augmentations.map(t=>r.a.createElement(C,{key:t,upgName:t}))))}function M(){const t=Object(i.b)(),[e,n]=Object(a.useState)(""),s=t.members.filter(t=>t&&t.name.toLowerCase().includes(e));return r.a.createElement(r.a.Fragment,null,r.a.createElement(l.a,{title:r.a.createElement(o.a,null,"You get a discount on equipment and upgrades based on your gang's respect and power. More respect and power leads to more discounts.")},r.a.createElement(o.a,{sx:{m:1}},"Discount: -",b.a.formatPercentage(1-1/t.getDiscount()))),r.a.createElement(p.a,{value:e,onChange:t=>{n(t.target.value.toLowerCase())},autoFocus:!0,InputProps:{startAdornment:r.a.createElement(y.a,null),spellCheck:!1},placeholder:"Filter by member name",sx:{m:1,width:"15%"}}),r.a.createElement(c.a,{display:"grid",sx:{gridTemplateColumns:"1fr 1fr",width:"100%"}},s.map(t=>r.a.createElement(O,{key:t.name,member:t}))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var a=n(0),r=n.n(a),i=n(1193),o=n(51),s=n(1218),l=n(29),c=n(48),f=n(1219),u=n(503),m=n(216);function h(){const t=l.b.Player().corporation;if(null===t)return r.a.createElement(r.a.Fragment,null);const e=Object(a.useState)(!1)[1];function n(){e(t=>!t)}const[h,d]=Object(a.useState)("Overview");Object(a.useEffect)(()=>{const t=setInterval(n,200);return()=>clearInterval(t)},[]);const p=Object.keys(o.a).filter(e=>void 0===t.divisions.find(t=>t.type===e)).length>0;return r.a.createElement(c.a.Corporation.Provider,{value:t},r.a.createElement(u.a,{variant:"scrollable",value:h,onChange:function(t,e){d(e)},sx:{maxWidth:"65vw"},scrollButtons:!0},r.a.createElement(m.a,{label:t.name,value:"Overview"}),t.divisions.map(t=>r.a.createElement(m.a,{key:t.name,label:t.name,value:t.name})),p&&r.a.createElement(m.a,{label:"Expand",value:-1})),"Overview"===h&&r.a.createElement(f.a,{rerender:n}),-1===h&&r.a.createElement(s.a,{setDivisionName:d}),"string"==typeof h&&"Overview"!==h&&r.a.createElement(i.a,{rerender:n,divisionName:h+""}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(0),r=n.n(a),i=n(1194),o=n(48),s=n(15);function l(t){const e=Object(o.b)(),n="Overview"!==t.divisionName?e.divisions.find(e=>e.name===t.divisionName):void 0;if(void 0===n)throw new Error("Cannot find division");return r.a.createElement(o.a.Division.Provider,{value:n},r.a.createElement(i.a,{rerender:t.rerender,city:s.a.Sector12}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(0),r=n.n(a),i=n(1195),o=n(1217),s=n(48),l=n(503),c=n(216);function f(t){const e=Object(s.c)(),[n,f]=Object(a.useState)(t.city),u=e.offices[n];if(0===u)return f("Sector-12"),r.a.createElement(r.a.Fragment,null);const m=Object.keys(e.offices).filter(t=>0===e.offices[t]).length>0;return r.a.createElement(r.a.Fragment,null,r.a.createElement(l.a,{variant:"fullWidth",value:n,onChange:function(t,e){f(e)},sx:{maxWidth:"65vw"}},Object.values(e.offices).map(t=>0!==t&&r.a.createElement(c.a,{key:t.loc,label:t.loc,value:t.loc})),m&&r.a.createElement(c.a,{label:"Expand",value:"Expand"})),"Expand"!==n?r.a.createElement(i.a,{key:n,rerender:t.rerender,city:n,warehouse:e.warehouses[n],office:u}):r.a.createElement(o.a,{cityStateSetter:f}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var a=n(0),r=n.n(a),i=n(1196),o=n(1199),s=n(1202),l=n(29),c=n(48),f=n(19);function u(t){const e=l.b.Player(),n=Object(c.b)(),a=Object(c.c)();return r.a.createElement(f.a,{display:"flex"},r.a.createElement(f.a,{sx:{width:"50%"}},r.a.createElement(o.a,{rerender:t.rerender,currentCity:t.city,office:t.office}),r.a.createElement(i.a,{rerender:t.rerender,office:t.office})),r.a.createElement(f.a,{sx:{width:"50%"}},r.a.createElement(s.a,{rerender:t.rerender,player:e,corp:n,currentCity:t.city,division:a,warehouse:t.warehouse})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return R}));var a=n(0),r=n.n(a),i=n(47),o=n(5),s=n(1197),l=n(1198),c=n(20),f=n(48),u=n(1),m=n(8),h=n(111),d=n(45),p=n(615),g=n.n(p),y=n(616),b=n.n(y),E=n(21),v=n(74),k=n(130),_=n(148),w=n(149),S=n(50),x=n(78),C=n(19);function L(t,e){let n=0;for(let a=0;at.switchMode(t=>!t)},"Switch to Auto Mode")):r.a.createElement(E.a,{title:r.a.createElement(u.a,null,"Switch to Manual Assignment Mode, which allows you to specify which employees should get which jobs")},r.a.createElement(m.a,{onClick:()=>t.switchMode(t=>!t)},"Switch to Manual Mode"))}function M(t){const e=Object(f.b)(),n=Object(f.c)(),[s,l]=Object(a.useState)(t.office.employees.length>0?t.office.employees[0]:null),m=[];for(let e=0;e0&&(p=l/t.office.employees.length,g=m/t.office.employees.length,y=h/t.office.employees.length),r.a.createElement(r.a.Fragment,null,r.a.createElement(_.a,{padding:"none"},r.a.createElement(w.a,null,r.a.createElement(S.a,null,r.a.createElement(x.b,null,r.a.createElement(u.a,null,"Unassigned Employees:")),r.a.createElement(x.b,null,r.a.createElement(u.a,null,a))),r.a.createElement(S.a,null,r.a.createElement(x.b,null,r.a.createElement(u.a,null,"Avg Employee Morale:")),r.a.createElement(x.b,null,r.a.createElement(u.a,null,o.a.format(p,"0.000")))),r.a.createElement(S.a,null,r.a.createElement(x.b,null,r.a.createElement(u.a,null,"Avg Employee Happiness:")),r.a.createElement(x.b,null,r.a.createElement(u.a,null,o.a.format(g,"0.000")))),r.a.createElement(S.a,null,r.a.createElement(x.b,null,r.a.createElement(u.a,null,"Avg Employee Energy:")),r.a.createElement(x.b,null,r.a.createElement(u.a,null,o.a.format(y,"0.000")))),r.a.createElement(S.a,null,r.a.createElement(x.b,null,r.a.createElement(u.a,null,"Total Employee Salary:")),r.a.createElement(x.b,null,r.a.createElement(u.a,null,r.a.createElement(c.a,{money:d})))),s&&r.a.createElement(r.a.Fragment,null,r.a.createElement(S.a,null,r.a.createElement(x.b,null,r.a.createElement(E.a,{title:r.a.createElement(u.a,null,"The base amount of material this office can produce. Does not include production multipliers from upgrades and materials. This value is based off the productivity of your Operations, Engineering, and Management employees")},r.a.createElement(u.a,null,"Material Production:"))),r.a.createElement(x.b,null,r.a.createElement(u.a,null,o.a.format(n.getOfficeProductivity(t.office),"0.000")))),r.a.createElement(S.a,null,r.a.createElement(x.b,null,r.a.createElement(E.a,{title:r.a.createElement(u.a,null,"The base amount of any given Product this office can produce. Does not include production multipliers from upgrades and materials. This value is based off the productivity of your Operations, Engineering, and Management employees")},r.a.createElement(u.a,null,"Product Production:"))),r.a.createElement(x.b,null,r.a.createElement(u.a,null,o.a.format(n.getOfficeProductivity(t.office,{forProduct:!0}),"0.000")))),r.a.createElement(S.a,null,r.a.createElement(x.b,null,r.a.createElement(E.a,{title:r.a.createElement(u.a,null,"The effect this office's 'Business' employees has on boosting sales")},r.a.createElement(u.a,null," Business Multiplier:"))),r.a.createElement(x.b,null,r.a.createElement(u.a,null,"x",o.a.format(n.getBusinessFactor(t.office),"0.000"))))))),r.a.createElement(_.a,{padding:"none"},r.a.createElement(w.a,null,r.a.createElement(T,{rerender:t.rerender,office:t.office,job:i.a.Operations,desc:"Manages supply chain operations. Improves the amount of Materials and Products you produce."}),r.a.createElement(T,{rerender:t.rerender,office:t.office,job:i.a.Engineer,desc:"Develops and maintains products and production systems. Increases the quality of everything you produce. Also increases the amount you produce (not as much as Operations, however)"}),r.a.createElement(T,{rerender:t.rerender,office:t.office,job:i.a.Business,desc:"Handles sales and finances. Improves the amount of Materials and Products you can sell."}),r.a.createElement(T,{rerender:t.rerender,office:t.office,job:i.a.Management,desc:"Leads and oversees employees and office operations. Improves the effectiveness of Engineer and Operations employees."}),r.a.createElement(T,{rerender:t.rerender,office:t.office,job:i.a.RandD,desc:"Research new innovative ways to improve the company. Generates Scientific Research."}),r.a.createElement(T,{rerender:t.rerender,office:t.office,job:i.a.Training,desc:"Set employee to training, which will increase some of their stats. Employees in training do not affect any company operations."}))))}function R(t){const e=Object(f.b)(),n=Object(f.c)(),[i,o]=Object(a.useState)(!1),[c,h]=Object(a.useState)(!1),[p,g]=Object(a.useState)(!1);return r.a.createElement(d.a,null,r.a.createElement(u.a,null,"Office Space"),r.a.createElement(u.a,null,"Size: ",t.office.employees.length," / ",t.office.size," employees"),r.a.createElement(C.a,{sx:{display:"grid",gridTemplateColumns:"1fr",width:"fit-content"}},r.a.createElement(C.a,{sx:{gridTemplateColumns:"repeat(3, 1fr)"}},r.a.createElement(E.a,{title:r.a.createElement(u.a,null,"Automatically hires an employee and gives him/her a random name")},r.a.createElement("span",null,r.a.createElement(m.a,{disabled:t.office.atCapacity(),onClick:function(){t.office.atCapacity()||(t.office.hireRandomEmployee(),t.rerender())}},"Hire Employee"))),r.a.createElement(E.a,{title:r.a.createElement(u.a,null,"Upgrade the office's size so that it can hold more employees!")},r.a.createElement("span",null,r.a.createElement(m.a,{disabled:e.funds<0,onClick:()=>o(!0)},"Upgrade size"))),r.a.createElement(s.a,{rerender:t.rerender,office:t.office,open:i,onClose:()=>o(!1)}),!n.hasResearch("AutoPartyManager")&&r.a.createElement(r.a.Fragment,null,r.a.createElement(E.a,{title:r.a.createElement(u.a,null,"Throw an office party to increase your employee's morale and happiness")},r.a.createElement("span",null,r.a.createElement(m.a,{disabled:e.funds<0,onClick:()=>h(!0)},"Throw Party"))),r.a.createElement(l.a,{rerender:t.rerender,office:t.office,open:c,onClose:()=>h(!1)}))),r.a.createElement(O,{manualMode:p,switchMode:g})),p?r.a.createElement(M,{rerender:t.rerender,office:t.office}):r.a.createElement(A,{rerender:t.rerender,office:t.office}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var a=n(0),r=n.n(a),i=n(5),o=n(40),s=n(62),l=n(38),c=n(48),f=n(1),u=n(8),m=n(21),h=n(19);function d(t){const e=Object(c.b)();return r.a.createElement(m.a,{title:i.a.formatMoney(t.cost)},r.a.createElement("span",null,r.a.createElement(u.a,{disabled:e.funds{return n=t.cost,a=t.size,void(e.funds=u);){const t=Math.pow(1.09,n+m);if(i+t>u)break;i+=t,++m}const p=o.a.OfficeInitialCost*i;return r.a.createElement(l.a,{open:t.open,onClose:t.onClose},r.a.createElement(f.a,null,"Increase the size of your office space to fit additional employees!"),r.a.createElement(h.a,{display:"flex",alignItems:"center"},r.a.createElement(f.a,null,"Upgrade size: "),r.a.createElement(d,{onClose:t.onClose,rerender:t.rerender,office:t.office,corp:e,cost:a,size:o.a.OfficeInitialSize}),r.a.createElement(d,{onClose:t.onClose,rerender:t.rerender,office:t.office,corp:e,cost:s,size:5*o.a.OfficeInitialSize}),r.a.createElement(d,{onClose:t.onClose,rerender:t.rerender,office:t.office,corp:e,cost:p,size:m*o.a.OfficeInitialSize})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var a=n(0),r=n.n(a),i=n(5),o=n(14),s=n(62),l=n(20),c=n(38),f=n(48),u=n(1),m=n(8),h=n(76),d=n(19),p=n(27);function g(t){const e=Object(f.b)(),[n,g]=Object(a.useState)(0),y=n*t.office.employees.length,b=e.funds>=y;function E(){if(null===n||isNaN(n)||n<0)Object(o.a)("Invalid value entered");else if(b){const a=Object(s.A)(e,t.office,n);Object(o.a)("You threw a party for the office! The morale and happiness of each employee increased by "+i.a.formatPercentage(a-1)),t.rerender(),t.onClose()}else Object(o.a)("You don't have enough company funds to throw a party!")}function v(){return isNaN(n)||n<0?r.a.createElement(u.a,null,"Invalid value entered!"):r.a.createElement(u.a,null,"Throwing this party will cost a total of ",r.a.createElement(l.a,{money:y}))}return r.a.createElement(c.a,{open:t.open,onClose:t.onClose},r.a.createElement(u.a,null,"Enter the amount of money you would like to spend PER EMPLOYEE on this office party"),r.a.createElement(v,null),r.a.createElement(d.a,{display:"flex",alignItems:"center"},r.a.createElement(h.a,{autoFocus:!0,type:"number",placeholder:"$ / employee",value:n,onChange:function(t){let e=parseFloat(t.target.value);isNaN(e)&&(e=0),g(e)},onKeyDown:function(t){t.key===p.a.ENTER&&E()}}),r.a.createElement(m.a,{disabled:!b,onClick:E},"Throw Party")))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return O}));var a=n(0),r=n.n(a),i=n(51),o=n(322),s=n(5),l=n(253),c=n(1200),f=n(1201),u=n(20),m=n(112),h=n(201),d=n(468),p=n(143),g=n(48),y=n(1),b=n(8),E=n(21),v=n(45),k=n(111),_=n(299),w=n.n(_),S=n(19);function x(){const t=Object(g.b)(),e=Object(g.c)(),[n,o]=Object(a.useState)(!1),s=e.hasMaximumNumberProducts();let l="";switch(e.type){case i.a.Food:l="Build Restaurant";break;case i.a.Tobacco:l="Create Product";break;case i.a.Pharmaceutical:l="Create Drug";break;case i.a.Computer:case"Computer":l="Create Product";break;case i.a.Robotics:l="Design Robot";break;case i.a.Software:l="Develop Software";break;case i.a.Healthcare:l="Build Hospital";break;case i.a.RealEstate:l="Develop Property";break;default:return l="Create Product",r.a.createElement(r.a.Fragment,null)}return r.a.createElement(r.a.Fragment,null,r.a.createElement(E.a,{title:s?r.a.createElement(y.a,null,"You have reached the maximum number of products: ",e.getMaximumNumberProducts()):""},r.a.createElement(b.a,{color:0===Object.keys(e.products).length?"error":"primary",onClick:()=>o(!0),disabled:t.funds<0},l)),r.a.createElement(c.a,{open:n,onClose:()=>o(!1)}))}function C(){const t=Object(g.b)(),e=Object(g.c)(),[n,i]=Object(a.useState)(!1),[o,c]=Object(a.useState)(!1),p=1===t.unlockUpgrades[4],v=e.lastCycleRevenue-e.lastCycleExpenses;let _=!1;const x=e.getAdvertisingFactors(),C=x[1],L=x[2],O=x[3],M=x[0];function T(t){return Object(l.a)({progress:t,totalTicks:20})}return p&&(_=!0),r.a.createElement(r.a.Fragment,null,r.a.createElement(y.a,null,"Industry: ",e.type," (Corp Funds: ",r.a.createElement(u.a,{money:t.funds}),")"),r.a.createElement("br",null),r.a.createElement(h.a,{rows:[["Awareness:",s.a.format(e.awareness,"0.000")],["Popularity:",s.a.format(e.popularity,"0.000")]]}),!1!==_&&r.a.createElement(E.a,{title:r.a.createElement(r.a.Fragment,null,r.a.createElement(y.a,null,"Total multiplier for this industrys sales due to its awareness and popularity"),r.a.createElement(h.a,{rows:[["Awareness Bonus:","x"+s.a.format(Math.pow(C,.85),"0.000")],["Popularity Bonus:","x"+s.a.format(Math.pow(L,.85),"0.000")],["Ratio Multiplier:","x"+s.a.format(Math.pow(O,.85),"0.000")]]}))},r.a.createElement(y.a,null,"Advertising Multiplier: x",s.a.format(M,"0.000"))),r.a.createElement("br",null),r.a.createElement(h.a,{rows:[["Revenue:",r.a.createElement(m.a,{money:e.lastCycleRevenue})],["Expenses:",r.a.createElement(m.a,{money:e.lastCycleExpenses})],["Profit:",r.a.createElement(m.a,{money:v})]]}),r.a.createElement("br",null),r.a.createElement(S.a,{display:"flex",alignItems:"center"},r.a.createElement(E.a,{title:r.a.createElement(y.a,null,"Production gain from owning production-boosting materials such as hardware, Robots, AI Cores, and Real Estate.")},r.a.createElement(y.a,null,"Production Multiplier: ",s.a.format(e.prodMult,"0.00"))),r.a.createElement(k.a,{onClick:()=>i(!0)},r.a.createElement(w.a,null)),r.a.createElement(d.a,{open:n,onClose:()=>i(!1)},r.a.createElement(y.a,null,"Owning Hardware, Robots, AI Cores, and Real Estate can boost your Industry's production. The effect these materials have on your production varies between Industries. For example, Real Estate may be very effective for some Industries, but ineffective for others.",r.a.createElement("br",null),r.a.createElement("br",null),"This division's production multiplier is calculated by summing the individual production multiplier of each of its office locations. This production multiplier is applied to each office. Therefore, it is beneficial to expand into new cities as this can greatly increase the production multiplier of your entire Division.",r.a.createElement("br",null),r.a.createElement("br",null),"Below are approximations for how effective each material is at boosting this industry's production multiplier (Bigger bars = more effective):",r.a.createElement("br",null),r.a.createElement("br",null),"Hardware:    ",T(e.hwFac),r.a.createElement("br",null),"Robots:      ",T(e.robFac),r.a.createElement("br",null),"AI Cores:    ",T(e.aiFac),r.a.createElement("br",null),"Real Estate: ",T(e.reFac)))),r.a.createElement(S.a,{display:"flex",alignItems:"center"},r.a.createElement(E.a,{title:r.a.createElement(y.a,null,"Scientific Research increases the quality of the materials and products that you produce.")},r.a.createElement(y.a,null,"Scientific Research: ",s.a.format(e.sciResearch.qty,"0.000a"))),r.a.createElement(b.a,{sx:{mx:1},onClick:()=>c(!0)},"Research"),r.a.createElement(f.a,{open:o,onClose:()=>c(!1),industry:e})))}function L(t){const e=Object(g.b)(),n=Object(g.c)(),a=[];for(const s of Object.keys(o.a)){const l=o.a[s];if(n.hasResearch("AutoBrew")&&"Coffee"===l[4])continue;const c=l[0],f=l[1],u=l[2];let m=0;switch(c){case 0:m=t.office.employees.length*f;break;default:m=f*Math.pow(u,n.upgrades[c])}function i(){e.funds0!==n.offices[t]),[y,b]=Object(a.useState)(g.length>0?g[0]:""),[E,v]=Object(a.useState)(""),[k,_]=Object(a.useState)(null),[w,S]=Object(a.useState)(null);if(n.hasMaximumNumberProducts())return r.a.createElement(r.a.Fragment,null);let x=r.a.createElement(r.a.Fragment,null);switch(n.type){case s.a.Food:x=r.a.createElement(r.a.Fragment,null,x,r.a.createElement("br",null),"Build and manage a new restaurant!");break;case s.a.Tobacco:x=r.a.createElement(r.a.Fragment,null,x,r.a.createElement("br",null),"Create a new tobacco product!");break;case s.a.Pharmaceutical:x=r.a.createElement(r.a.Fragment,null,x,r.a.createElement("br",null),"Design and develop a new pharmaceutical drug!");break;case s.a.Computer:case"Computer":x=r.a.createElement(r.a.Fragment,null,x,r.a.createElement("br",null),"Design and manufacture a new computer hardware product!");break;case s.a.Robotics:x=r.a.createElement(r.a.Fragment,null,x,r.a.createElement("br",null),"Design and create a new robot or robotic system!");break;case s.a.Software:x=r.a.createElement(r.a.Fragment,null,x,r.a.createElement("br",null),"Develop a new piece of software!");break;case s.a.Healthcare:x=r.a.createElement(r.a.Fragment,null,x,r.a.createElement("br",null),"Build and manage a new hospital!");break;case s.a.RealEstate:x=r.a.createElement(r.a.Fragment,null,x,r.a.createElement("br",null),"Develop a new piece of real estate property!");break;default:return x=r.a.createElement(r.a.Fragment,null,x,r.a.createElement("br",null),"Create a new product!"),r.a.createElement(r.a.Fragment,null)}function C(){if(null!==k&&null!==w){try{Object(l.m)(e,n,y,E,k,w)}catch(t){Object(i.a)(t+"")}t.onClose()}}return x=r.a.createElement(r.a.Fragment,null,x,r.a.createElement("br",null),r.a.createElement("br",null),"To begin developing a product, first choose the city in which it will be designed. The stats of your employees in the selected city affect the properties of the finished product, such as its quality, performance, and durability.",r.a.createElement("br",null),r.a.createElement("br",null),"You can also choose to invest money in the design and marketing of the product. Investing money in its design will result in a superior product. Investing money in marketing the product will help the product's sales."),r.a.createElement(o.a,{open:t.open,onClose:t.onClose},r.a.createElement(f.a,null,x),r.a.createElement(d.a,{style:{margin:"5px"},onChange:function(t){b(t.target.value)},defaultValue:y},g.map(t=>r.a.createElement(h.a,{key:t,value:t},t))),r.a.createElement(u.a,{onChange:function(t){v(t.target.value)},placeholder:(L=n.type,L===s.a.Food?"Restaurant Name":L===s.a.Healthcare?"Hospital Name":L===s.a.RealEstate?"Property Name":"Product Name")}),r.a.createElement("br",null),r.a.createElement(u.a,{onChange:function(t){""===t.target.value?_(null):_(parseFloat(t.target.value))},autoFocus:!0,type:"number",placeholder:"Design investment"}),r.a.createElement(u.a,{onChange:function(t){""===t.target.value?S(null):S(parseFloat(t.target.value))},onKeyDown:function(t){t.key===p.a.ENTER&&C()},type:"number",placeholder:"Marketing investment"}),r.a.createElement(m.a,{onClick:C},"Develop Product"));var L}},function(t,e,n){"use strict";n.d(e,"a",(function(){return S}));var a=n(0),r=n.n(a),i=n(38),o=n(51),s=n(40),l=n(62),c=n(285),f=n(6),u=n(14),m=n(1),h=n(21),d=n(8),p=n(19),g=n(276),y=n(81),b=n.n(y),E=n(209),v=n.n(E),k=n(325),_=n.n(k);function w({n:t,division:e}){const[n,i]=Object(a.useState)(!1);if(null===t)return r.a.createElement(r.a.Fragment,null);const o=c.a[t.text];let y=e.sciResearch.qtyr.a.createElement(h.a,{title:r.a.createElement(m.a,null,"Research points: ",o.cost,r.a.createElement("br",null),o.desc)},t),C=r.a.createElement(p.a,null,x(r.a.createElement("span",null,r.a.createElement(d.a,{color:S,disabled:y&&!t.researched,onClick:k,style:{width:"100%",textAlign:"left",justifyContent:"unset"}},t.researched&&r.a.createElement(_.a,{sx:{mr:1}}),t.text))));return 0===t.children.length?C:r.a.createElement(p.a,null,r.a.createElement(p.a,{display:"flex",sx:{border:"1px solid "+f.a.theme.well}},x(r.a.createElement("span",{style:{width:"100%"}},r.a.createElement(d.a,{color:S,disabled:y&&!t.researched,onClick:k,sx:{width:"100%",textAlign:"left",justifyContent:"unset",borderColor:f.a.theme.button}},t.researched&&r.a.createElement(_.a,{sx:{mr:1}}),t.text))),r.a.createElement(d.a,{onClick:()=>i(t=>!t),sx:{borderColor:f.a.theme.button,minWidth:"fit-content"}},n?r.a.createElement(v.a,{color:"primary"}):r.a.createElement(b.a,{color:"primary"}))),r.a.createElement(g.a,{in:n,unmountOnExit:!0},r.a.createElement(p.a,{m:1},t.children.map(t=>r.a.createElement(w,{key:t.text,division:e,n:t})))))}function S(t){const e=o.c[t.industry.type];return void 0===e?r.a.createElement(r.a.Fragment,null):r.a.createElement(i.a,{open:t.open,onClose:t.onClose},r.a.createElement(w,{division:t.industry,n:e.root}),r.a.createElement(m.a,{sx:{mt:1}},"Research points: ",t.industry.sciResearch.qty.toFixed(3),r.a.createElement("br",null),"Multipliers from research:",r.a.createElement("br",null),"* Advertising Multiplier: x",e.getAdvertisingMultiplier(),r.a.createElement("br",null),"* Employee Charisma Multiplier: x",e.getEmployeeChaMultiplier(),r.a.createElement("br",null),"* Employee Creativity Multiplier: x",e.getEmployeeCreMultiplier(),r.a.createElement("br",null),"* Employee Efficiency Multiplier: x",e.getEmployeeEffMultiplier(),r.a.createElement("br",null),"* Employee Intelligence Multiplier: x",e.getEmployeeIntMultiplier(),r.a.createElement("br",null),"* Production Multiplier: x",e.getProductionMultiplier(),r.a.createElement("br",null),"* Sales Multiplier: x",e.getSalesMultiplier(),r.a.createElement("br",null),"* Scientific Research Multiplier: x",e.getScientificResearchMultiplier(),r.a.createElement("br",null),"* Storage Multiplier: x",e.getStorageMultiplier()))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return O}));var a=n(0),r=n.n(a),i=n(40),o=n(202),s=n(408),l=n(243),c=n(1203),f=n(1204),u=n(1210),m=n(179),h=n(5),d=n(143),p=n(409),g=n(1216),y=n(62),b=n(48),E=n(1),v=n(21),k=n(45),_=n(8),w=n(19),S=n(121),x=n(144);const C=Object(S.a)(()=>Object(x.a)({retainHeight:{minHeight:"3em"}}));function L(t){const e=Object(b.b)(),n=Object(b.c)(),[l,y]=Object(a.useState)(!1);if(0===t.warehouse)return r.a.createElement(r.a.Fragment,null);const S=i.a.WarehouseUpgradeBaseCost*Math.pow(1.07,t.warehouse.level+1),x=e.funds>S;const L=C();let O;switch(n.state){case"START":O="Current state: Preparing...";break;case"PURCHASE":O="Current state: Purchasing materials...";break;case"PRODUCTION":O="Current state: Producing materials and/or products...";break;case"SALE":O="Current state: Selling materials and/or products...";break;case"EXPORT":O="Current state: Exporting materials and/or products...";break;default:console.error("Invalid state: "+n.state)}const M=[];for(const e of Object.keys(t.warehouse.materials)){if(!(t.warehouse.materials[e]instanceof o.a))continue;const a=t.warehouse.materials[e].qty>0,i=Object(p.a)(e,n);(a||i)&&M.push(r.a.createElement(u.a,{rerender:t.rerender,city:t.currentCity,key:e,mat:t.warehouse.materials[e],warehouse:t.warehouse}))}const T=[];if(n.makesProducts&&Object.keys(n.products).length>0)for(const e of Object.keys(n.products)){const a=n.products[e];a instanceof s.a&&T.push(r.a.createElement(f.a,{rerender:t.rerender,city:t.currentCity,key:e,product:a}))}const A=[];for(const e of Object.keys(t.warehouse.materials)){const n=t.warehouse.materials[e];m.a.hasOwnProperty(e)&&(0!==n.qty&&A.push(r.a.createElement(r.a.Fragment,null,e,": ",h.a.format(n.qty*m.a[e],"0,0.0"))))}for(const e of Object.keys(n.products)){const a=n.products[e];void 0!==a&&A.push(r.a.createElement(r.a.Fragment,null,e,": ",h.a.format(a.data[t.warehouse.loc][0]*a.siz,"0,0.0")))}let R;return R=A&&A.length>0?A.reduce((t,e)=>t&&r.a.createElement(r.a.Fragment,null,t,r.a.createElement("br",null),e)||r.a.createElement(r.a.Fragment,null,e)):r.a.createElement(r.a.Fragment,null,"No items in storage."),r.a.createElement(k.a,null,r.a.createElement(w.a,{display:"flex",alignItems:"center"},r.a.createElement(v.a,{title:0!==t.warehouse.sizeUsed?r.a.createElement(E.a,null,r.a.createElement(r.a.Fragment,null,R)):""},r.a.createElement(E.a,{color:t.warehouse.sizeUsed>=t.warehouse.size?"error":"primary"},"Storage: ",h.a.formatBigNumber(t.warehouse.sizeUsed)," /"," ",h.a.formatBigNumber(t.warehouse.size)))),r.a.createElement(_.a,{disabled:!x,onClick:function(){null!==n&&0!==t.warehouse&&x&&(++t.warehouse.level,t.warehouse.updateSize(e,n),e.funds=e.funds-S,t.rerender())}},"Upgrade Warehouse Size - ",r.a.createElement(d.a,{money:S,corp:e})),r.a.createElement(E.a,null,"This industry uses the following equation for its production: "),r.a.createElement("br",null),r.a.createElement(E.a,null,r.a.createElement(g.a,{key:n.name,division:n})),r.a.createElement("br",null),r.a.createElement(E.a,null,"To get started with production, purchase your required materials or import them from another of your company's divisions."),r.a.createElement("br",null),r.a.createElement(E.a,{className:L.retainHeight},O),e.unlockUpgrades[1]&&r.a.createElement(r.a.Fragment,null,r.a.createElement(_.a,{onClick:()=>y(!0)},"Configure Smart Supply"),r.a.createElement(c.a,{open:l,onClose:()=>y(!1),warehouse:t.warehouse})),M,T)}function O(t){return t.warehouse instanceof l.a?r.a.createElement(L,t):r.a.createElement(M,{rerender:t.rerender,city:t.currentCity})}function M(t){const e=Object(b.b)(),n=Object(b.c)(),a=e.funds!t)}}),label:r.a.createElement(f.a,null,"Enable Smart Supply")}),r.a.createElement("br",null),r.a.createElement(f.a,null,"Use materials already in the warehouse instead of buying new ones, if available:"),s))}},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return ProductElem}));var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(0),react__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__),_data_Constants__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(40),_modals_DiscontinueProductModal__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(1205),_modals_LimitProductProductionModal__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(1206),_modals_SellProductModal__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(1207),_modals_ProductMarketTaModal__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(1208),_modals_CancelProductModal__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(1209),_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(5),_utils_helpers_isString__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(146),_ui_React_Money__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(20),_Context__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(48),_mui_material_Typography__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(1),_mui_material_Tooltip__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(21),_mui_material_Paper__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__(45),_mui_material_Button__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__(8),_mui_material_Box__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__(19);function ProductElem(props){const corp=Object(_Context__WEBPACK_IMPORTED_MODULE_10__.b)(),division=Object(_Context__WEBPACK_IMPORTED_MODULE_10__.c)(),[sellOpen,setSellOpen]=Object(react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1),[limitOpen,setLimitOpen]=Object(react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1),[discontinueOpen,setDiscontinueOpen]=Object(react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1),[cancelOpen,setCancelOpen]=Object(react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1),[marketTaOpen,setMarketTaOpen]=Object(react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1),city=props.city,product=props.product,nf="0.000",nfB="0.000a",hasUpgradeDashboard=division.hasResearch("uPgrade: Dashboard"),totalGain=product.data[city][1]-product.data[city][2];let sellButtonText;if(sellButtonText=product.sllman[city][0]?Object(_utils_helpers_isString__WEBPACK_IMPORTED_MODULE_8__.a)(product.sllman[city][1])?react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment,null,"Sell (",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_7__.a.format(product.data[city][2],nfB),"/",product.sllman[city][1],")"):react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment,null,"Sell (",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_7__.a.format(product.data[city][2],nfB),"/",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_7__.a.format(product.sllman[city][1],nfB),")"):react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment,null,"Sell (0.000/0.000)"),product.marketTa2)sellButtonText=react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment,null,sellButtonText," @ ",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_ui_React_Money__WEBPACK_IMPORTED_MODULE_9__.a,{money:product.marketTa2Price[city]}));else if(product.marketTa1){const t=product.rat/product.mku;sellButtonText=react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment,null,sellButtonText," @ ",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_ui_React_Money__WEBPACK_IMPORTED_MODULE_9__.a,{money:product.pCost+t}))}else if(product.sCost)if(Object(_utils_helpers_isString__WEBPACK_IMPORTED_MODULE_8__.a)(product.sCost)){const sCost=product.sCost.replace(/MP/g,product.pCost+product.rat/product.mku+"");sellButtonText=react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment,null,sellButtonText," @ ",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_ui_React_Money__WEBPACK_IMPORTED_MODULE_9__.a,{money:eval(sCost)}))}else sellButtonText=react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment,null,sellButtonText," @ ",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_ui_React_Money__WEBPACK_IMPORTED_MODULE_9__.a,{money:product.sCost}));let limitProductionButtonText="Limit Production";return product.prdman[city][0]&&(limitProductionButtonText+=" ("+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_7__.a.format(product.prdman[city][1],nf)+")"),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Paper__WEBPACK_IMPORTED_MODULE_13__.a,null,product.fin?react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment,null,react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Box__WEBPACK_IMPORTED_MODULE_15__.a,{display:"flex"},react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Tooltip__WEBPACK_IMPORTED_MODULE_12__.a,{title:react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Typography__WEBPACK_IMPORTED_MODULE_11__.a,null,"Prod: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_7__.a.format(product.data[city][1],nfB),"/s",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),"Sell: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_7__.a.format(product.data[city][2],nfB)," /s")},react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Typography__WEBPACK_IMPORTED_MODULE_11__.a,null,product.name,": ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_7__.a.format(product.data[city][0],nfB)," (",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_7__.a.format(totalGain,nfB),"/s)"))),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Box__WEBPACK_IMPORTED_MODULE_15__.a,{display:"flex"},react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Tooltip__WEBPACK_IMPORTED_MODULE_12__.a,{title:react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Typography__WEBPACK_IMPORTED_MODULE_11__.a,null,"Quality: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_7__.a.format(product.qlt,nf)," ",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),"Performance: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_7__.a.format(product.per,nf)," ",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),"Durability: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_7__.a.format(product.dur,nf)," ",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),"Reliability: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_7__.a.format(product.rel,nf)," ",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),"Aesthetics: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_7__.a.format(product.aes,nf)," ",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),"Features: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_7__.a.format(product.fea,nf),1===corp.unlockUpgrades[2]&&react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),1===corp.unlockUpgrades[2]&&"Demand: "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_7__.a.format(product.dmd,nf),1===corp.unlockUpgrades[3]&&react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),1===corp.unlockUpgrades[3]&&"Competition: "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_7__.a.format(product.cmp,nf))},react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Typography__WEBPACK_IMPORTED_MODULE_11__.a,null,"Rating: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_7__.a.format(product.rat,nf)))),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Box__WEBPACK_IMPORTED_MODULE_15__.a,{display:"flex"},react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Tooltip__WEBPACK_IMPORTED_MODULE_12__.a,{title:react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Typography__WEBPACK_IMPORTED_MODULE_11__.a,null,"An estimate of the material cost it takes to create this Product.")},react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Typography__WEBPACK_IMPORTED_MODULE_11__.a,null,"Est. Production Cost:"," ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_7__.a.formatMoney(product.pCost/_data_Constants__WEBPACK_IMPORTED_MODULE_1__.a.ProductProductionCostRatio)))),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Box__WEBPACK_IMPORTED_MODULE_15__.a,{display:"flex"},react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Tooltip__WEBPACK_IMPORTED_MODULE_12__.a,{title:react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Typography__WEBPACK_IMPORTED_MODULE_11__.a,null,"An estimate of how much consumers are willing to pay for this product. Setting the sale price above this may result in less sales. Setting the sale price below this may result in more sales.")},react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Typography__WEBPACK_IMPORTED_MODULE_11__.a,null,"Est. Market Price: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_7__.a.formatMoney(product.pCost)))),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Button__WEBPACK_IMPORTED_MODULE_14__.a,{onClick:()=>setDiscontinueOpen(!0)},"Discontinue"),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_modals_DiscontinueProductModal__WEBPACK_IMPORTED_MODULE_2__.a,{product:product,rerender:props.rerender,open:discontinueOpen,onClose:()=>setDiscontinueOpen(!1)})):react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment,null,react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Typography__WEBPACK_IMPORTED_MODULE_11__.a,null,"Designing ",product.name," (req. Operations/Engineers in ",product.createCity,")..."),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Typography__WEBPACK_IMPORTED_MODULE_11__.a,null,_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_7__.a.format(product.prog,"0.00"),"% complete"),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Button__WEBPACK_IMPORTED_MODULE_14__.a,{onClick:()=>setCancelOpen(!0)},"Cancel"),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_modals_CancelProductModal__WEBPACK_IMPORTED_MODULE_6__.a,{product:product,rerender:props.rerender,open:cancelOpen,onClose:()=>setCancelOpen(!1)})),(hasUpgradeDashboard||product.fin)&&react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment,null,react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Button__WEBPACK_IMPORTED_MODULE_14__.a,{onClick:()=>setSellOpen(!0)},sellButtonText),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_modals_SellProductModal__WEBPACK_IMPORTED_MODULE_4__.a,{product:product,city:city,open:sellOpen,onClose:()=>setSellOpen(!1)}),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Button__WEBPACK_IMPORTED_MODULE_14__.a,{onClick:()=>setLimitOpen(!0)},limitProductionButtonText),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_modals_LimitProductProductionModal__WEBPACK_IMPORTED_MODULE_3__.a,{product:product,city:city,open:limitOpen,onClose:()=>setLimitOpen(!1)}),division.hasResearch("Market-TA.I")&&react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment,null,react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Button__WEBPACK_IMPORTED_MODULE_14__.a,{onClick:()=>setMarketTaOpen(!0)},"Market-TA"),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_modals_ProductMarketTaModal__WEBPACK_IMPORTED_MODULE_5__.a,{product:product,open:marketTaOpen,onClose:()=>setMarketTaOpen(!1)}))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(0),r=n.n(a),i=n(38),o=n(48),s=n(1),l=n(8);function c(t){const e=Object(o.c)();return r.a.createElement(i.a,{open:t.open,onClose:t.onClose},r.a.createElement(s.a,null,"Are you sure you want to do this? Discontinuing a product removes it completely and permanently. You will no longer produce this product and all of its existing stock will be removed and left unsold"),r.a.createElement(l.a,{onClick:function(){e.discontinueProduct(t.product),t.onClose(),t.rerender()}},"Discontinue"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var a=n(0),r=n.n(a),i=n(62),o=n(38),s=n(1),l=n(8),c=n(76),f=n(27);function u(t){const[e,n]=Object(a.useState)(null);function u(){let n=e;null===n&&(n=-1),Object(i.l)(t.product,t.city,n),t.onClose()}return Object(a.useEffect)(()=>{t.open||n(null)},[t.open]),r.a.createElement(o.a,{open:t.open,onClose:t.onClose},r.a.createElement(s.a,null,"Enter a limit to the amount of this product you would like to produce per second. Leave the box empty to set no limit."),r.a.createElement(c.a,{autoFocus:!0,placeholder:"Limit",type:"number",onChange:function(t){""===t.target.value?n(null):n(parseFloat(t.target.value))},onKeyDown:function(t){t.key===f.a.ENTER&&u()}}),r.a.createElement(l.a,{onClick:u},"Limit production"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var a=n(0),r=n.n(a),i=n(14),o=n(62),s=n(38),l=n(1),c=n(76),f=n(8),u=n(333),m=n(277),h=n(27);function d(t){const[e,n]=Object(a.useState)(!0),[d,p]=Object(a.useState)(t.product.sllman[t.city][1]?t.product.sllman[t.city][1]:""),[g,y]=Object(a.useState)(function(t){let e=t.sCost?t.sCost+"":"";return t.marketTa2?e+=" (Market-TA.II)":t.marketTa1&&(e+=" (Market-TA.I)"),e}(t.product));function b(){try{Object(o.s)(t.product,t.city,d,g,e)}catch(t){Object(i.a)(t+"")}t.onClose()}function E(t){t.key===h.a.ENTER&&b()}return r.a.createElement(s.a,{open:t.open,onClose:t.onClose},r.a.createElement(l.a,null,"Enter the maximum amount of ",t.product.name," you would like to sell per second, as well as the price at which you would like to sell it at.",r.a.createElement("br",null),r.a.createElement("br",null),"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 product will be discarded.",r.a.createElement("br",null),r.a.createElement("br",null),"Setting the sell amount to 'MAX' will result in you always selling the maximum possible amount of the material.",r.a.createElement("br",null),r.a.createElement("br",null),"When setting the sell amount, you can use the 'PROD' variable to designate a dynamically changing amount that depends on your production. For example, if you set the sell amount to 'PROD-1' then you will always sell 1 less of the material than you produce.",r.a.createElement("br",null),r.a.createElement("br",null),"When setting the sell price, you can use the 'MP' variable to set a dynamically changing price that depends on the Product's estimated market price. For example, if you set it to 'MP*5' then it will always be sold at five times the estimated market price."),r.a.createElement("br",null),r.a.createElement(c.a,{value:d,autoFocus:!0,type:"text",placeholder:"Sell amount",onChange:function(t){p(t.target.value)},onKeyDown:E}),r.a.createElement(c.a,{value:g,type:"text",placeholder:"Sell price",onChange:function(t){y(t.target.value)},onKeyDown:E}),r.a.createElement(f.a,{onClick:b},"Confirm"),r.a.createElement(u.a,{control:r.a.createElement(m.a,{checked:e,onChange:function(t){n(t.target.checked)}}),label:r.a.createElement(l.a,null,"Use same 'Sell Amount' for all cities")}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var a=n(0),r=n.n(a),i=n(5),o=n(38),s=n(48),l=n(1),c=n(76),f=n(333),u=n(277),m=n(21);function h(t){if(!Object(s.c)().hasResearch("Market-TA.II"))return r.a.createElement(r.a.Fragment,null);const e=t.product.rat/t.product.mku,[n,o]=Object(a.useState)(t.product.pCost),h=Object(a.useState)(!1)[1];const d=n;let p=1;return d>t.product.pCost&&d-t.product.pCost>e&&(p=e/(d-t.product.pCost)),r.a.createElement(r.a.Fragment,null,r.a.createElement(l.a,{variant:"h4"},"Market-TA.II"),r.a.createElement("br",null),r.a.createElement(l.a,null,"If you sell at ",i.a.formatMoney(d),", then you will sell"," ",i.a.format(p,"0.00000"),"x as much compared to if you sold at market price."),r.a.createElement(c.a,{type:"number",onChange:function(t){o(parseFloat(t.target.value))},value:n}),r.a.createElement("br",null),r.a.createElement(f.a,{control:r.a.createElement(u.a,{checked:t.product.marketTa2,onChange:function(e){t.product.marketTa2=e.target.checked,h(t=>!t)}}),label:r.a.createElement(m.a,{title:r.a.createElement(l.a,null,"If this is enabled, then this Material will automatically be sold at the optimal price such that the amount sold matches the amount produced. (i.e. the highest possible price, while still ensuring that all produced materials will be sold)")},r.a.createElement(l.a,null,"Use Market-TA.II for Auto-Sale Price"))}))}function d(t){const e=t.product.rat/t.product.mku,n=Object(a.useState)(!1)[1];return r.a.createElement(o.a,{open:t.open,onClose:t.onClose},r.a.createElement(r.a.Fragment,null,r.a.createElement(l.a,{variant:"h4"},"Market-TA.I"),r.a.createElement(l.a,null,"The maximum sale price you can mark this up to is"," ",i.a.formatMoney(t.product.pCost+e),". This means that if you set the sale price higher than this, you will begin to experience a loss in number of sales"),r.a.createElement(f.a,{control:r.a.createElement(u.a,{checked:t.product.marketTa1,onChange:function(e){t.product.marketTa1=e.target.checked,n(t=>!t)}}),label:r.a.createElement(m.a,{title:r.a.createElement(l.a,null,"If this is enabled, then this Material will automatically be sold at the price identified by Market-TA.I (i.e. the price shown above)")},r.a.createElement(l.a,null,"Use Market-TA.I for Auto-Sale Price"))})),r.a.createElement(h,{product:t.product}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(0),r=n.n(a),i=n(38),o=n(48),s=n(1),l=n(8);function c(t){const e=Object(o.c)();return r.a.createElement(i.a,{open:t.open,onClose:t.onClose},r.a.createElement(s.a,null,"Are you sure you want to do this? Canceling a product removes it completely and permanently. You will receive no money back by doing so"),r.a.createElement(l.a,{onClick:function(){e.discontinueProduct(t.product),t.onClose(),t.rerender()}},"Cancel"))}},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return MaterialElem}));var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(0),react__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__),_OfficeSpace__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(380),_modals_ExportModal__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(1211),_modals_MaterialMarketTaModal__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(1212),_modals_SellMaterialModal__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(1213),_modals_PurchaseMaterialModal__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(1214),_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(5),_utils_helpers_isString__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(146),_ui_React_Money__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(20),_Context__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(48),_mui_material_Typography__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(1),_mui_material_Tooltip__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(21),_mui_material_Paper__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(45),_mui_material_Button__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__(8),_mui_material_Box__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__(19),_modals_LimitMaterialProductionModal__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__(1215);function MaterialElem(props){const corp=Object(_Context__WEBPACK_IMPORTED_MODULE_9__.b)(),division=Object(_Context__WEBPACK_IMPORTED_MODULE_9__.c)(),[purchaseMaterialOpen,setPurchaseMaterialOpen]=Object(react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1),[exportOpen,setExportOpen]=Object(react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1),[sellMaterialOpen,setSellMaterialOpen]=Object(react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1),[materialMarketTaOpen,setMaterialMarketTaOpen]=Object(react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1),[limitProductionOpen,setLimitProductionOpen]=Object(react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1),warehouse=props.warehouse,city=props.city,mat=props.mat,markupLimit=mat.getMarkupLimit(),office=division.offices[city];if(!(office instanceof _OfficeSpace__WEBPACK_IMPORTED_MODULE_1__.a))throw new Error(`Could not get OfficeSpace object for this city (${city})`);const nf="0.000",nfB="0.000a",totalGain=mat.buy+mat.prd+mat.imp-mat.sll-mat.totalExp,tutorial=division.newInd&&Object.keys(division.reqMats).includes(mat.name)&&0===mat.buy&&0===mat.imp,purchaseButtonText=`Buy (${_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.a.format(mat.buy,nfB)})`;let sellButtonText;if(mat.sllman[0]){if(sellButtonText=Object(_utils_helpers_isString__WEBPACK_IMPORTED_MODULE_7__.a)(mat.sllman[1])?react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment,null,"Sell (",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.a.format(mat.sll,nfB),"/",mat.sllman[1],")"):react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment,null,"Sell (",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.a.format(mat.sll,nfB),"/",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.a.format(mat.sllman[1],nfB),")"),mat.marketTa2)sellButtonText=react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment,null,sellButtonText," @ ",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_ui_React_Money__WEBPACK_IMPORTED_MODULE_8__.a,{money:mat.marketTa2Price}));else if(mat.marketTa1)sellButtonText=react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment,null,sellButtonText," @ ",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_ui_React_Money__WEBPACK_IMPORTED_MODULE_8__.a,{money:mat.bCost+markupLimit}));else if(mat.sCost)if(Object(_utils_helpers_isString__WEBPACK_IMPORTED_MODULE_7__.a)(mat.sCost)){const sCost=mat.sCost.replace(/MP/g,mat.bCost+"");sellButtonText=react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment,null,sellButtonText," @ ",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_ui_React_Money__WEBPACK_IMPORTED_MODULE_8__.a,{money:eval(sCost)}))}else sellButtonText=react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment,null,sellButtonText," @ ",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_ui_React_Money__WEBPACK_IMPORTED_MODULE_8__.a,{money:mat.sCost}))}else sellButtonText=react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment,null,"Sell (0.000/0.000)");let limitMaterialButtonText="Limit Material";return mat.prdman[0]&&(limitMaterialButtonText+=" ("+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.a.format(mat.prdman[1],nf)+")"),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Paper__WEBPACK_IMPORTED_MODULE_12__.a,null,react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Box__WEBPACK_IMPORTED_MODULE_14__.a,{sx:{display:"grid",gridTemplateColumns:"2fr 1fr",m:"5px"}},react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Box__WEBPACK_IMPORTED_MODULE_14__.a,null,react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Tooltip__WEBPACK_IMPORTED_MODULE_11__.a,{title:react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Typography__WEBPACK_IMPORTED_MODULE_10__.a,null,"Buy: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.a.format(mat.buy,nfB)," ",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),"Prod: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.a.format(mat.prd,nfB)," ",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),"Sell: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.a.format(mat.sll,nfB)," ",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),"Export: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.a.format(mat.totalExp,nfB)," ",react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),"Import: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.a.format(mat.imp,nfB),1===corp.unlockUpgrades[2]&&react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),1===corp.unlockUpgrades[2]&&"Demand: "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.a.format(mat.dmd,nf),1===corp.unlockUpgrades[3]&&react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br",null),1===corp.unlockUpgrades[3]&&"Competition: "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.a.format(mat.cmp,nf))},react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Typography__WEBPACK_IMPORTED_MODULE_10__.a,null,mat.name,": ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.a.format(mat.qty,nfB)," (",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.a.format(totalGain,nfB),"/s)")),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Tooltip__WEBPACK_IMPORTED_MODULE_11__.a,{title:react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Typography__WEBPACK_IMPORTED_MODULE_10__.a,null,"Market Price: The price you would pay if you were to buy this material on the market")},react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Typography__WEBPACK_IMPORTED_MODULE_10__.a,null,"MP: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.a.formatMoney(mat.bCost))),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Tooltip__WEBPACK_IMPORTED_MODULE_11__.a,{title:react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Typography__WEBPACK_IMPORTED_MODULE_10__.a,null,"The quality of your material. Higher quality will lead to more sales")},react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Typography__WEBPACK_IMPORTED_MODULE_10__.a,null,"Quality: ",_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_6__.a.format(mat.qlt,"0.00a")))),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Box__WEBPACK_IMPORTED_MODULE_14__.a,{sx:{"& button":{width:"100%"}}},react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Tooltip__WEBPACK_IMPORTED_MODULE_11__.a,{title:tutorial?react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Typography__WEBPACK_IMPORTED_MODULE_10__.a,null,"Purchase your required materials to get production started!"):""},react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Button__WEBPACK_IMPORTED_MODULE_13__.a,{color:tutorial?"error":"primary",onClick:()=>setPurchaseMaterialOpen(!0)},purchaseButtonText)),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_modals_PurchaseMaterialModal__WEBPACK_IMPORTED_MODULE_5__.a,{mat:mat,warehouse:warehouse,open:purchaseMaterialOpen,disablePurchaseLimit:props.warehouse.smartSupplyEnabled&&Object.keys(division.reqMats).includes(props.mat.name),onClose:()=>setPurchaseMaterialOpen(!1)}),1===corp.unlockUpgrades[0]&&react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment,null,react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Button__WEBPACK_IMPORTED_MODULE_13__.a,{onClick:()=>setExportOpen(!0)},"Export"),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_modals_ExportModal__WEBPACK_IMPORTED_MODULE_2__.a,{mat:mat,open:exportOpen,onClose:()=>setExportOpen(!1)})),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Button__WEBPACK_IMPORTED_MODULE_13__.a,{color:division.prodMats.includes(props.mat.name)&&!mat.sllman[0]?"error":"primary",onClick:()=>setSellMaterialOpen(!0)},sellButtonText),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_modals_SellMaterialModal__WEBPACK_IMPORTED_MODULE_4__.a,{mat:mat,open:sellMaterialOpen,onClose:()=>setSellMaterialOpen(!1)}),division.hasResearch("Market-TA.I")&&react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment,null,react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Button__WEBPACK_IMPORTED_MODULE_13__.a,{onClick:()=>setMaterialMarketTaOpen(!0)},"Market-TA"),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_modals_MaterialMarketTaModal__WEBPACK_IMPORTED_MODULE_3__.a,{mat:mat,open:materialMarketTaOpen,onClose:()=>setMaterialMarketTaOpen(!1)})),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_mui_material_Button__WEBPACK_IMPORTED_MODULE_13__.a,{color:tutorial?"error":"primary",onClick:()=>setLimitProductionOpen(!0)},limitMaterialButtonText),react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_modals_LimitMaterialProductionModal__WEBPACK_IMPORTED_MODULE_15__.a,{material:mat,open:limitProductionOpen,onClose:()=>setLimitProductionOpen(!1)}))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var a=n(0),r=n.n(a),i=n(14),o=n(62),s=n(38),l=n(48),c=n(409),f=n(1),u=n(76),m=n(8),h=n(19),d=n(74),p=n(130);function g(t){const e=Object(l.b)(),n=e.divisions.filter(e=>Object(c.a)(t.mat.name,e));if(0===n.length)throw new Error("Export popup created with no divisions.");const g=n[0];if(0===Object.keys(g.warehouses).length)throw new Error("Export popup created in a division with no warehouses.");const[y,b]=Object(a.useState)(g.name),[E,v]=Object(a.useState)(Object.keys(g.warehouses)[0]),[k,_]=Object(a.useState)(""),w=Object(a.useState)(!1)[1];function S(e){for(let n=0;n!t)}const x=e.divisions.find(t=>t.name===y);if(void 0===x)throw new Error(`Export popup somehow ended up with undefined division '${x}'`);const C=Object.keys(x.warehouses).filter(t=>0!==x.warehouses[t]);return C.length>0&&!C.includes(E)&&v(C[0]),r.a.createElement(s.a,{open:t.open,onClose:t.onClose},r.a.createElement(f.a,null,"Select the industry and city to export this material to, as well as how much of this material to export per second. You can set the export amount to 'MAX' to export all of the materials in this warehouse."),r.a.createElement(p.a,{onChange:function(t){const n=t.target.value;b(n),v(Object.keys(e.divisions[0].warehouses)[0])},value:y},e.divisions.filter(e=>Object(c.a)(t.mat.name,e)).map(t=>r.a.createElement(d.a,{key:t.name,value:t.name},t.name))),r.a.createElement(p.a,{onChange:function(t){v(t.target.value)},value:E},C.map(t=>{if(0!==x.warehouses[t])return r.a.createElement(d.a,{key:t,value:t},t)})),r.a.createElement(u.a,{placeholder:"Export amount / s",onChange:function(t){_(t.target.value)},value:k}),r.a.createElement(m.a,{onClick:function(){try{Object(o.g)(y,E,t.mat,k,x)}catch(t){Object(i.a)(t+"")}t.onClose()}},"Export"),r.a.createElement(f.a,null,"Below is a list of all current exports of this material from this warehouse. Clicking on one of the exports below will REMOVE that export."),t.mat.exp.map((t,e)=>r.a.createElement(h.a,{display:"flex",alignItems:"center",key:e},r.a.createElement(m.a,{sx:{mx:2},onClick:()=>S(t)},"delete"),r.a.createElement(f.a,null,"Industry: ",t.ind,r.a.createElement("br",null),"City: ",t.city,r.a.createElement("br",null),"Amount/s: ",t.amt))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var a=n(0),r=n.n(a),i=n(5),o=n(38),s=n(48),l=n(1),c=n(76),f=n(333),u=n(277),m=n(21);function h(t){if(!Object(s.c)().hasResearch("Market-TA.II"))return r.a.createElement(r.a.Fragment,null);const[e,n]=Object(a.useState)(t.mat.bCost),o=Object(a.useState)(!1)[1];const h=t.mat.getMarkupLimit();const d=e;let p=1;return d>t.mat.bCost?d-t.mat.bCost>h&&(p=Math.pow(h/(d-t.mat.bCost),2)):d!t)}}),label:r.a.createElement(m.a,{title:r.a.createElement(l.a,null,"If this is enabled, then this Material will automatically be sold at the optimal price such that the amount sold matches the amount produced. (i.e. the highest possible price, while still ensuring that all produced materials will be sold)")},r.a.createElement(l.a,null,"Use Market-TA.II for Auto-Sale Price"))}))}function d(t){const e=Object(a.useState)(!1)[1];const n=t.mat.getMarkupLimit();return r.a.createElement(o.a,{open:t.open,onClose:t.onClose},r.a.createElement(r.a.Fragment,null,r.a.createElement(l.a,{variant:"h4"},"Market-TA.I"),r.a.createElement(l.a,null,"The maximum sale price you can mark this up to is ",i.a.formatMoney(t.mat.bCost+n),". This means that if you set the sale price higher than this, you will begin to experience a loss in number of sales"),r.a.createElement(f.a,{control:r.a.createElement(u.a,{checked:t.mat.marketTa1,onChange:function(n){t.mat.marketTa1=n.target.checked,e(t=>!t)}}),label:r.a.createElement(m.a,{title:r.a.createElement(l.a,null,"If this is enabled, then this Material will automatically be sold at the price identified by Market-TA.I (i.e. the price shown above)")},r.a.createElement(l.a,null,"Use Market-TA.I for Auto-Sale Price"))})),r.a.createElement(h,{mat:t.mat}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var a=n(0),r=n.n(a),i=n(14),o=n(62),s=n(38),l=n(1),c=n(76),f=n(8),u=n(27);function m(t){const[e,n]=Object(a.useState)(t.mat.sllman[1]?t.mat.sllman[1]+"":""),[m,h]=Object(a.useState)(function(t){let e=t.sCost?t.sCost+"":"";return t.marketTa2?e+=" (Market-TA.II)":t.marketTa1&&(e+=" (Market-TA.I)"),e}(t.mat));function d(){try{Object(o.r)(t.mat,e,m)}catch(t){Object(i.a)(t+"")}t.onClose()}function p(t){t.key===u.a.ENTER&&d()}return r.a.createElement(s.a,{open:t.open,onClose:t.onClose},r.a.createElement(l.a,null,"Enter the maximum amount of ",t.mat.name," you would like to sell per second, as well as the price at which you would like to sell at.",r.a.createElement("br",null),r.a.createElement("br",null),"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 material will be discarded",r.a.createElement("br",null),r.a.createElement("br",null),"Setting the sell amount to 'MAX' will result in you always selling the maximum possible amount of the material.",r.a.createElement("br",null),r.a.createElement("br",null),"When setting the sell amount, you can use the 'PROD' variable to designate a dynamically changing amount that depends on your production. For example, if you set the sell amount to 'PROD-5' then you will always sell 5 less of the material than you produce.",r.a.createElement("br",null),r.a.createElement("br",null),"When setting the sell price, you can use the 'MP' variable to designate a dynamically changing price that depends on the market price. For example, if you set the sell price to 'MP+10' then it will always be sold at $10 above the market price."),r.a.createElement("br",null),r.a.createElement(c.a,{value:e,autoFocus:!0,type:"text",placeholder:"Sell amount",onChange:function(t){n(t.target.value)},onKeyDown:p}),r.a.createElement(c.a,{value:m,type:"text",placeholder:"Sell price",onChange:function(t){h(t.target.value)},onKeyDown:p}),r.a.createElement(f.a,{onClick:d},"Confirm"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var a=n(0),r=n.n(a),i=n(14),o=n(179),s=n(5),l=n(62),c=n(38),f=n(48),u=n(1),m=n(76),h=n(8),d=n(27);function p(t){const e=Object(f.b)(),[n,c]=Object(a.useState)(""),[p,g]=Object(a.useState)(!1);function y(t){const e=parseFloat(t.amount),n=e*t.mat.bCost,a=o.a[t.mat.name];return e>(t.warehouse.size-t.warehouse.sizeUsed)/a?(g(!0),r.a.createElement(r.a.Fragment,null,r.a.createElement(u.a,{color:"error"},"Not enough warehouse space to purchase this amount"))):isNaN(n)||e<0?(g(!0),r.a.createElement(r.a.Fragment,null,r.a.createElement(u.a,{color:"error"},"Invalid input for Bulk Purchase amount"))):(g(!1),r.a.createElement(r.a.Fragment,null,r.a.createElement(u.a,null,"Purchasing ",s.a.format(e,"0,0.00")," of ",t.mat.name," will cost"," ",s.a.formatMoney(n))))}function b(){try{Object(l.b)(e,t.warehouse,t.mat,parseFloat(n))}catch(t){Object(i.a)(t+"")}t.onClose()}return r.a.createElement(r.a.Fragment,null,r.a.createElement(u.a,null,"Enter the amount of ",t.mat.name," you would like to bulk purchase. This purchases the specified amount instantly (all at once)."),r.a.createElement(y,{warehouse:t.warehouse,mat:t.mat,amount:n}),r.a.createElement(m.a,{value:n,onChange:function(t){c(t.target.value)},type:"number",placeholder:"Bulk Purchase amount",onKeyDown:function(t){t.key===d.a.ENTER&&b()}}),r.a.createElement(h.a,{disabled:p,onClick:b},"Confirm Bulk Purchase"))}function g(t){const e=Object(f.c)(),[n,o]=Object(a.useState)(t.mat.buy?t.mat.buy:0);function s(){if(null!==n){try{Object(l.e)(t.mat,n)}catch(t){Object(i.a)(t+"")}t.onClose()}}return r.a.createElement(c.a,{open:t.open,onClose:t.onClose},r.a.createElement(r.a.Fragment,null,r.a.createElement(u.a,null,"Enter the amount of ",t.mat.name," you would like to purchase per second. This material's cost changes constantly.",t.disablePurchaseLimit?"Note: Purchase amount is disabled as smart supply is enabled":""),r.a.createElement(m.a,{value:n,onChange:function(t){o(parseFloat(t.target.value))},autoFocus:!0,placeholder:"Purchase amount",type:"number",disabled:t.disablePurchaseLimit,onKeyDown:function(t){t.key===d.a.ENTER&&s()}}),r.a.createElement(h.a,{disabled:t.disablePurchaseLimit,onClick:s},"Confirm"),r.a.createElement(h.a,{disabled:t.disablePurchaseLimit,onClick:function(){t.mat.buy=0,t.onClose()}},"Clear Purchase"),e.hasResearch("Bulk Purchasing")&&r.a.createElement(p,{onClose:t.onClose,mat:t.mat,warehouse:t.warehouse})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var a=n(0),r=n.n(a),i=n(62),o=n(38),s=n(1),l=n(8),c=n(76),f=n(27);function u(t){const[e,n]=Object(a.useState)(null);function u(){let n=e;null===n&&(n=-1),Object(i.k)(t.material,n),t.onClose()}return Object(a.useEffect)(()=>{t.open||n(null)},[t.open]),r.a.createElement(o.a,{open:t.open,onClose:t.onClose},r.a.createElement(s.a,null,"Enter a limit to the amount of this material you would like to produce per second. Leave the box empty to set no limit."),r.a.createElement(c.a,{autoFocus:!0,placeholder:"Limit",type:"number",onChange:function(t){""===t.target.value?n(null):n(parseFloat(t.target.value))},onKeyDown:function(t){t.key===f.a.ENTER&&u()}}),r.a.createElement(l.a,{onClick:u},"Limit production"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var a=n(0),r=n.n(a),i=n(266);function o(t){const e=[];for(const n of Object.keys(t.division.reqMats)){const a=t.division.reqMats[n];void 0!==a&&e.push(String.raw`${a}\text{ }${n}`)}const n=t.division.prodMats.map(t=>"1\\text{ }"+t);return t.division.makesProducts&&n.push("Products"),r.a.createElement(i.a,null,"\\("+e.join("+")+"\\Rightarrow "+n.join("+")+"\\)")}},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var a=n(0),r=n.n(a),i=n(40),o=n(14),s=n(62),l=n(143),c=n(48),f=n(1),u=n(74),m=n(130),h=n(8);function d(t){const e=Object(c.b)(),n=Object(c.c)(),d=Object.keys(n.offices).filter(t=>0===n.offices[t]),[p,g]=Object(a.useState)(d[0]),y=e.fundsr.a.createElement(u.a,{key:t,value:t},t))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var a=n(0),r=n.n(a),i=n(14),o=n(51),s=n(48),l=n(62),c=n(1),f=n(8),u=n(76),m=n(74),h=n(19),d=n(130),p=n(27);function g(t){const e=Object(s.b)(),n=Object.keys(o.a).sort().filter(t=>void 0===e.divisions.find(e=>e.type===t)).sort(),[g,y]=Object(a.useState)(n.length>0?n[0]:""),[b,E]=Object(a.useState)(""),v=o.d[g];if(void 0===v)throw new Error(`Invalid industry: '${g}'`);const k=e.fundsr.a.createElement(m.a,{key:t,value:t},t))),r.a.createElement(c.a,null,w(e)),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(c.a,null,"Division name:"),r.a.createElement(h.a,{display:"flex",alignItems:"center"},r.a.createElement(u.a,{autoFocus:!0,value:b,onChange:function(t){E(t.target.value)},onKeyDown:function(t){t.key===p.a.ENTER&&_()},type:"text",InputProps:{endAdornment:r.a.createElement(f.a,{disabled:k,sx:{mx:1},onClick:_},"Expand")}})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return R}));var a=n(0),r=n.n(a),i=n(1220),o=n(1221),s=n(1222),l=n(1223),c=n(1224),f=n(1225),u=n(1226),m=n(1227),h=n(1228),d=n(26),p=n(40),g=n(268),y=n(381),b=n(10),E=n(5),v=n(22),k=n(20),_=n(112),w=n(201),S=n(29),x=n(48),C=n(1),L=n(21),O=n(8),M=n(19),T=n(45),A=n(278);function R({rerender:t}){const e=S.b.Player(),n=Object(x.b)(),a=n.revenue-n.expenses,i=[];function o(t,e){1!==e&&i.push([t,E.a.format(e,"0.000")])}return o("Production Multiplier: ",n.getProductionMultiplier()),o("Storage Multiplier: ",n.getStorageMultiplier()),o("Advertising Multiplier: ",n.getAdvertisingMultiplier()),o("Empl. Creativity Multiplier: ",n.getEmployeeCreMultiplier()),o("Empl. Charisma Multiplier: ",n.getEmployeeChaMultiplier()),o("Empl. Intelligence Multiplier: ",n.getEmployeeIntMultiplier()),o("Empl. Efficiency Multiplier: ",n.getEmployeeEffMultiplier()),o("Sales Multiplier: ",n.getSalesMultiplier()),o("Scientific Research Multiplier: ",n.getScientificResearchMultiplier()),r.a.createElement(r.a.Fragment,null,r.a.createElement(w.a,{rows:[["Total Funds:",r.a.createElement(k.a,{money:n.funds})],["Total Revenue:",r.a.createElement(_.a,{money:n.revenue})],["Total Expenses:",r.a.createElement(_.a,{money:n.expenses})],["Total Profit:",r.a.createElement(_.a,{money:n.revenue-n.expenses})],["Publicly Traded:",n.public?"Yes":"No"],["Owned Stock Shares:",E.a.format(n.numShares,"0.000a")],["Stock Price:",n.public?r.a.createElement(k.a,{money:n.sharePrice}):"N/A"]]}),r.a.createElement("br",null),r.a.createElement(M.a,{display:"flex"},r.a.createElement(L.a,{title:r.a.createElement(w.a,{rows:[["Outstanding Shares:",E.a.format(n.issuedShares,"0.000a")],["Private Shares:",E.a.format(n.totalShares-n.issuedShares-n.numShares,"0.000a")]]})},r.a.createElement(C.a,null,"Total Stock Shares: ",E.a.format(n.totalShares,"0.000a")))),r.a.createElement("br",null),r.a.createElement(D,{profit:a}),r.a.createElement("br",null),r.a.createElement(w.a,{rows:i}),r.a.createElement("br",null),r.a.createElement(j,null),r.a.createElement(M.a,{sx:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",width:"fit-content"}},r.a.createElement(L.a,{title:r.a.createElement(C.a,null,"Get a copy of and read 'The Complete Handbook for Creating a Successful Corporation.' This is a .lit file that guides you through the beginning of setting up a Corporation and provides some tips/pointers for helping you get started with managing it.")},r.a.createElement(O.a,{onClick:()=>n.getStarterGuide(e)},"Getting Started Guide")),n.public?r.a.createElement(I,{rerender:t}):r.a.createElement(N,{rerender:t}),r.a.createElement(F,null)),r.a.createElement("br",null),r.a.createElement(P,{rerender:t}))}function N({rerender:t}){const e=Object(x.b)(),[n,i]=Object(a.useState)(!1),[o,s]=Object(a.useState)(!1),l=e.fundingRound<4,c=l?"Search for private investors who will give you startup funding in exchange for equity (stock shares) in your company":"";return r.a.createElement(r.a.Fragment,null,r.a.createElement(L.a,{title:r.a.createElement(C.a,null,c)},r.a.createElement(O.a,{disabled:!l,onClick:()=>i(!0)},"Find Investors")),r.a.createElement(L.a,{title:r.a.createElement(C.a,null,"Become a publicly traded and owned entity. Going public involves issuing shares for an IPO. Once you are a public company, your shares will be traded on the stock market.")},r.a.createElement(O.a,{onClick:()=>s(!0)},"Go Public")),r.a.createElement(m.a,{open:n,onClose:()=>i(!1),rerender:t}),r.a.createElement(h.a,{open:o,onClose:()=>s(!1),rerender:t}))}function P({rerender:t}){const e=Object(x.b)();return e.divisions.length<=0?r.a.createElement(C.a,{variant:"h4"},"Upgrades are unlocked once you create an industry."):r.a.createElement(r.a.Fragment,null,r.a.createElement(T.a,{sx:{p:1,my:1}},r.a.createElement(C.a,{variant:"h4"},"Unlocks"),r.a.createElement(A.a,{container:!0},Object.values(g.b).filter(t=>!e.unlockUpgrades[t.index]).map(e=>r.a.createElement(o.a,{rerender:t,upgradeData:e,key:e.index})))),r.a.createElement(T.a,{sx:{p:1,my:1}},r.a.createElement(C.a,{variant:"h4"},"Upgrades"),r.a.createElement(A.a,{container:!0},e.upgrades.map((t,e)=>y.a[e]).map(e=>r.a.createElement(i.a,{rerender:t,upgrade:e,key:e.index})))))}function I({rerender:t}){const e=Object(x.b)(),[n,i]=Object(a.useState)(!1),[o,s]=Object(a.useState)(!1),[m,h]=Object(a.useState)(!1),[d,p]=Object(a.useState)(!1),g=e.shareSaleCooldown>0,y=g?"Cannot sell shares for "+e.convertCooldownToString(e.shareSaleCooldown):"Sell your shares in the company. The money earned from selling your shares goes into your personal account, not the Corporation's. This is one of the only ways to profit from your business venture.",b=e.issueNewSharesCooldown>0,E=b?"Cannot issue new shares for "+e.convertCooldownToString(e.issueNewSharesCooldown):"Issue new equity shares to raise capital.";return r.a.createElement(r.a.Fragment,null,r.a.createElement(L.a,{title:r.a.createElement(C.a,null,y)},r.a.createElement(O.a,{disabled:g,onClick:()=>i(!0)},"Sell Shares")),r.a.createElement(l.a,{open:n,onClose:()=>i(!1),rerender:t}),r.a.createElement(L.a,{title:r.a.createElement(C.a,null,"Buy back shares you that previously issued or sold at market price.")},r.a.createElement(O.a,{disabled:e.issuedShares<1,onClick:()=>s(!0)},"Buyback shares")),r.a.createElement(c.a,{open:o,onClose:()=>s(!1),rerender:t}),r.a.createElement(L.a,{title:r.a.createElement(C.a,null,E)},r.a.createElement(O.a,{disabled:b,onClick:()=>h(!0)},"Issue New Shares")),r.a.createElement(u.a,{open:m,onClose:()=>h(!1)}),r.a.createElement(L.a,{title:r.a.createElement(C.a,null,"Manage the dividends that are paid out to shareholders (including yourself)")},r.a.createElement(O.a,{onClick:()=>p(!0)},"Issue Dividends")),r.a.createElement(f.a,{open:d,onClose:()=>p(!1)}))}function F(){const t=S.b.Player(),e=Object(x.b)(),[n,i]=Object(a.useState)(!1),o=e.determineValuation()>=p.a.BribeThreshold&&t.factions.filter(t=>d.a[t].getInfo().offersWork()).length>0;return r.a.createElement(r.a.Fragment,null,r.a.createElement(L.a,{title:o?"Use your Corporations power and influence to bribe Faction leaders in exchange for reputation":"Your Corporation is not powerful enough to bribe Faction leaders"},r.a.createElement(O.a,{disabled:!o,onClick:function(){o&&i(!0)}},"Bribe Factions")),r.a.createElement(s.a,{open:n,onClose:()=>i(!1)}))}function D({profit:t}){const e=Object(x.b)();if(e.dividendPercentage<=0||t<=0)return r.a.createElement(r.a.Fragment,null);const n=e.dividendPercentage/100*t,a=t-n,i=n/e.totalShares;return r.a.createElement(w.a,{rows:[["Retained Profits (after dividends):",r.a.createElement(_.a,{money:a})],["Dividend Percentage:",E.a.format(e.dividendPercentage/100,"0%")],["Dividends per share:",r.a.createElement(_.a,{money:i})],["Your earnings as a shareholder:",r.a.createElement(_.a,{money:e.getDividends()})]]})}function j(){const t=Object(x.b)().storedCycles*b.a.MilliPerCycle;return t<=15e3?r.a.createElement(r.a.Fragment,null):r.a.createElement(C.a,null,"Bonus time: ",Object(v.d)(t),r.a.createElement("br",null),r.a.createElement("br",null))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var a=n(0),r=n.n(a),i=n(14),o=n(62),s=n(143),l=n(48),c=n(1),f=n(21),u=n(8),m=n(19),h=n(278);function d(t){const e=Object(l.b)(),n=t.upgrade,a=e.upgrades[n.index],d=n.basePrice,p=n.priceMult,g=d*Math.pow(p,a),y=n.desc;return r.a.createElement(h.a,{item:!0,xs:4},r.a.createElement(m.a,{display:"flex",alignItems:"center",flexDirection:"row-reverse"},r.a.createElement(u.a,{disabled:e.funds!!i.a[t].getInfo().offersWork()&&!e.hasGangWith(t)),b=Object(u.b)(),[E,v]=Object(a.useState)(0),[k,_]=Object(a.useState)(0),[w,S]=Object(a.useState)(n.length>0?n[0]:""),x=null===E||null===k||0===E&&0===k||isNaN(E)||isNaN(k)||E<0||k<0||b.fundsb.numShares;function C(t,e){return(t+e*b.sharePrice)/o.a.BribeToRepRatio}return r.a.createElement(c.a,{open:t.open,onClose:t.onClose},r.a.createElement(m.a,null,"You can use Corporation funds or stock shares to bribe Faction Leaders in exchange for faction reputation."),r.a.createElement(g.a,{display:"flex",alignItems:"center"},r.a.createElement(m.a,null,"Faction:"),r.a.createElement(y.a,{value:w,onChange:function(t){S(t.target.value)}},n.map(t=>{if(i.a[t].getInfo().offersWork()&&!e.hasGangWith(t))return r.a.createElement(d.a,{key:t,value:t},t)}))),r.a.createElement(m.a,null,function(t,e){return 0===t&&0===e?"":isNaN(t)||isNaN(e)||t<0||e<0?"ERROR: Invalid value(s) entered":b.fundsb.numShares?"ERROR: You do not have this many shares to bribe with":"You will gain "+s.a.formatReputation(C(t,e))+" reputation with "+w+" with this bribe"}(E||0,k||0)),r.a.createElement(p.a,{onChange:function(t){v(parseFloat(t.target.value))},placeholder:"Corporation funds"}),r.a.createElement(p.a,{sx:{mx:1},onChange:function(t){_(parseFloat(t.target.value))},placeholder:"Stock Shares"}),r.a.createElement(h.a,{disabled:x,sx:{mx:1},onClick:()=>function(e,n){const a=i.a[w];if(x)return;const r=C(e,n);Object(l.a)("You gained "+s.a.formatReputation(r)+" reputation with "+a.name+" by bribing them."),a.playerReputation+=r,b.funds=b.funds-e,b.numShares-=n,t.onClose()}(E||0,k||0)},"Bribe"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var a=n(0),r=n.n(a),i=n(5),o=n(14),s=n(38),l=n(29),c=n(48),f=n(1),u=n(76),m=n(8),h=n(20),d=n(62),p=n(27);function g(t){const e=l.b.Player(),n=Object(c.b)(),[g,y]=Object(a.useState)(null),b=null===g||isNaN(g)||g<=0||g>n.numShares;function E(t){if(null===t.shares)return r.a.createElement(r.a.Fragment,null);let e="";if(isNaN(t.shares)||t.shares<=0)e="ERROR: Invalid value entered for number of shares to sell";else if(t.shares>n.numShares)e="You don't have this many shares to sell!";else{const a=n.calculateShareSale(t.shares)[0];e=`Sell ${t.shares} shares for a total of ${i.a.formatMoney(a)}`}return r.a.createElement(f.a,null,r.a.createElement("small",null,e))}function v(){if(!b)try{const a=Object(d.t)(n,e,g);t.onClose(),Object(o.a)(r.a.createElement(r.a.Fragment,null,"Sold ",i.a.formatMoney(g)," shares for",r.a.createElement(h.a,{money:a}),". The corporation's stock price fell to  ",r.a.createElement(h.a,{money:n.sharePrice}),"as a result of dilution.")),t.rerender()}catch(t){Object(o.a)(t+"")}}return r.a.createElement(s.a,{open:t.open,onClose:t.onClose},r.a.createElement(f.a,null,"Enter the number of shares you would like to sell. The money from selling your shares will go directly to you (NOT your Corporation).",r.a.createElement("br",null),r.a.createElement("br",null),"Selling your shares will cause your corporation's stock price to fall due to dilution. Furthermore, selling a large number of shares all at once will have an immediate effect in reducing your stock price.",r.a.createElement("br",null),r.a.createElement("br",null),"The current price of your company's stock is ",i.a.formatMoney(n.sharePrice)),r.a.createElement("br",null),r.a.createElement(u.a,{variant:"standard",autoFocus:!0,type:"number",placeholder:"Shares to sell",onChange:function(t){""===t.target.value?y(null):y(Math.round(parseFloat(t.target.value)))},onKeyDown:function(t){t.key===p.a.ENTER&&v()}}),r.a.createElement(m.a,{disabled:b,onClick:v,sx:{mx:1}},"Sell shares"),r.a.createElement(E,{shares:g,corp:n}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var a=n(0),r=n.n(a),i=n(38),o=n(5),s=n(29),l=n(48),c=n(1),f=n(8),u=n(76),m=n(62),h=n(14),d=n(27);function p(t){const e=s.b.Player(),n=Object(l.b)(),[p,g]=Object(a.useState)(null);const y=1.1*n.sharePrice,b=null===p||isNaN(p)||p<=0||p>n.issuedShares||p*y>e.money;function E(){if(!b){try{Object(m.c)(n,e,p)}catch(t){Object(h.a)(t+"")}t.onClose(),t.rerender()}}function v(){return null===p?r.a.createElement(r.a.Fragment,null):isNaN(p)||p<=0?r.a.createElement(r.a.Fragment,null,"ERROR: Invalid value entered for number of shares to buyback"):p>n.issuedShares?r.a.createElement(r.a.Fragment,null,"There are not this many shares available to buy back. There are only"," ",o.a.formatBigNumber(n.issuedShares)," outstanding shares."):r.a.createElement(r.a.Fragment,null,"Purchase ",p," shares for a total of ",o.a.formatMoney(p*y))}return r.a.createElement(i.a,{open:t.open,onClose:t.onClose},r.a.createElement(c.a,null,"Enter the number of outstanding shares you would like to buy back. These shares must be bought at a 10% premium. However, repurchasing shares from the market tends to lead to an increase in stock price.",r.a.createElement("br",null),r.a.createElement("br",null),"To purchase these shares, you must use your own money (NOT your Corporation's funds).",r.a.createElement("br",null),r.a.createElement("br",null),"The current buyback price of your company's stock is ",o.a.formatMoney(y),". Your company currently has ",o.a.formatBigNumber(n.issuedShares)," outstanding stock shares."),r.a.createElement(v,null),r.a.createElement("br",null),r.a.createElement(u.a,{autoFocus:!0,type:"number",placeholder:"Shares to buyback",onChange:function(t){""===t.target.value?g(null):g(Math.round(parseFloat(t.target.value)))},onKeyDown:function(t){t.key===d.a.ENTER&&E()}}),r.a.createElement(f.a,{disabled:b,onClick:E},"Buy shares"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var a=n(0),r=n.n(a),i=n(14),o=n(38),s=n(40),l=n(62),c=n(48),f=n(1),u=n(76),m=n(8),h=n(27);function d(t){const e=Object(c.b)(),[n,d]=Object(a.useState)(0),p=!isNaN(n)&&n>=0&&n<=100*s.a.DividendMaxPercentage;function g(){if(p&&null!==n){try{Object(l.i)(e,n/100)}catch(t){Object(i.a)(t+"")}t.onClose()}}return r.a.createElement(o.a,{open:t.open,onClose:t.onClose},r.a.createElement(f.a,null,"Dividends are a distribution of a portion of the corporation's profits to the shareholders. This includes yourself, as well.",r.a.createElement("br",null),r.a.createElement("br",null),"In order to issue dividends, simply allocate some percentage of your corporation's profits to dividends. This percentage must be an integer between 0 and 100. (A percentage of 0 means no dividends will be issued)",r.a.createElement("br",null),r.a.createElement("br",null),"Two important things to note:",r.a.createElement("br",null),"* Issuing dividends will negatively affect your corporation's stock price",r.a.createElement("br",null),r.a.createElement("br",null),"Example: Assume your corporation makes $100m / sec in profit and you allocate 40% of that towards dividends. That means your corporation will gain $60m / sec in funds and the remaining $40m / sec will be paid as dividends. Since your corporation starts with 1 billion shares, every shareholder will be paid $0.04 per share per second before taxes."),r.a.createElement(u.a,{autoFocus:!0,value:n,onChange:function(t){if(""===t.target.value)d(0);else{let e=parseFloat(t.target.value);e>100&&(e=100),e<0&&(e=0),d(e)}},onKeyDown:function(t){t.key===h.a.ENTER&&g()},placeholder:"Dividend %",type:"number"}),r.a.createElement(m.a,{disabled:!p,sx:{mx:1},onClick:g},"Allocate Dividend Percentage"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var a=n(0),r=n.n(a),i=n(5),o=n(14),s=n(38),l=n(33),c=n(40),f=n(48),u=n(1),m=n(76),h=n(8),d=n(27);function p(t){const e=Object(f.b)();if(null===t.shares)return r.a.createElement(r.a.Fragment,null);const n=Math.round(.9*e.sharePrice),a=Math.round(.2*e.totalShares),o=a-a%1e6;let s=t.shares;return isNaN(s)?r.a.createElement(u.a,null,"Invalid input"):(s/=1e7,s=1e7*Math.round(s),s<1e7?r.a.createElement(u.a,null,"Must issue at least 10 million new shares"):s>o?r.a.createElement(u.a,null,"You cannot issue that many shares"):r.a.createElement(u.a,null,"Issue ",i.a.format(s,"0.000a")," new shares for"," ",i.a.formatMoney(s*n),"?"))}function g(t){const e=Object(f.b)(),[n,g]=Object(a.useState)(null),y=Math.round(.2*e.totalShares),b=y-y%1e6,E=1e7*Math.round((n||0)/1e7),v=null===n||isNaN(E)||E<1e7||E>b;function k(){if(null===n)return;if(v)return;const a=Math.round(.9*e.sharePrice);let r=n;r=1e7*Math.round(r/1e7);const s=r*a;e.issueNewSharesCooldown=c.a.IssueNewSharesCooldown,e.totalShares+=r;let f=Object(l.a)(0,Math.round(r/2));f=1e6*Math.round(f/1e6),e.issuedShares+=r-f,e.funds=e.funds+s,e.immediatelyUpdateSharePrice(),t.onClose(),Object(o.a)(`Issued ${i.a.format(r,"0.000a")} and raised ${i.a.formatMoney(s)}. ${i.a.format(f,"0.000a")} of these shares were bought by private investors.

Stock price decreased to `+i.a.formatMoney(e.sharePrice))}return r.a.createElement(s.a,{open:t.open,onClose:t.onClose},r.a.createElement(u.a,null,"You can issue new equity shares (i.e. stocks) in order to raise capital for your corporation.",r.a.createElement("br",null),r.a.createElement("br",null)," * You can issue at most ",i.a.formatMoney(b)," new shares",r.a.createElement("br",null)," * New shares are sold at a 10% discount",r.a.createElement("br",null)," * You can only issue new shares once every 12 hours",r.a.createElement("br",null)," * Issuing new shares causes dilution, resulting in a decrease in stock price and lower dividends per share",r.a.createElement("br",null)," * Number of new shares issued must be a multiple of 10 million",r.a.createElement("br",null),r.a.createElement("br",null),"When you choose to issue new equity, private shareholders have first priority for up to 50% of the new shares. If they choose to exercise this option, these newly issued shares become private, restricted shares, which means you cannot buy them back."),r.a.createElement(p,{shares:n}),r.a.createElement(m.a,{autoFocus:!0,placeholder:"# New Shares",onChange:function(t){""===t.target.value?g(null):g(parseFloat(t.target.value))},onKeyDown:function(t){t.key===d.a.ENTER&&k()}}),r.a.createElement(h.a,{disabled:v,onClick:k,sx:{mx:1}},"Issue New Shares"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var a=n(0),r=n.n(a),i=n(5),o=n(40),s=n(38),l=n(48),c=n(1),f=n(8);function u(t){const e=Object(l.b)(),n=e.determineValuation();if(e.fundingRound>=o.a.FundingRoundShares.length||e.fundingRound>=o.a.FundingRoundMultiplier.length)return r.a.createElement(r.a.Fragment,null);const a=o.a.FundingRoundShares[e.fundingRound],u=n*a*o.a.FundingRoundMultiplier[e.fundingRound],m=Math.floor(o.a.INITIALSHARES*a);return r.a.createElement(s.a,{open:t.open,onClose:t.onClose},r.a.createElement(c.a,null,"An investment firm has offered you ",i.a.formatMoney(u)," in funding in exchange for a"," ",i.a.format(100*a,"0.000a"),"% stake in the company (",i.a.format(m,"0.000a")," shares).",r.a.createElement("br",null),r.a.createElement("br",null),"Do you accept or reject this offer?",r.a.createElement("br",null),r.a.createElement("br",null),"Hint: Investment firms will offer more money if your corporation is turning a profit"),r.a.createElement(f.a,{onClick:function(){e.fundingRound++,e.addFunds(u),e.numShares-=m,t.rerender(),t.onClose()}},"Accept"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var a=n(0),r=n.n(a),i=n(14),o=n(38),s=n(5),l=n(48),c=n(1),f=n(8),u=n(76),m=n(19),h=n(27);function d(t){const e=Object(l.b)(),[n,d]=Object(a.useState)(""),p=e.determineValuation()/e.totalShares;function g(){const a=parseFloat(n),r=e.determineValuation()/e.totalShares;isNaN(a)?Object(i.a)("Invalid value for number of issued shares"):a>e.numShares?Object(i.a)("Error: You don't have that many shares to issue!"):(e.public=!0,e.sharePrice=r,e.issuedShares=a,e.numShares-=a,e.addFunds(a*r),t.rerender(),Object(i.a)(`You took your ${e.name} public and earned `+s.a.formatMoney(a*r)+" in your IPO"),t.onClose())}return r.a.createElement(o.a,{open:t.open,onClose:t.onClose},r.a.createElement(c.a,null,"Enter the number of shares you would like to issue for your IPO. These shares will be publicly sold and you will no longer own them. Your Corporation will receive ",s.a.formatMoney(p)," per share (the IPO money will be deposited directly into your Corporation's funds).",r.a.createElement("br",null),r.a.createElement("br",null),"You have a total of ",s.a.format(e.numShares,"0.000a")," of shares that you can issue."),r.a.createElement(m.a,{display:"flex",alignItems:"center"},r.a.createElement(u.a,{value:n,onChange:function(t){d(t.target.value)},autoFocus:!0,type:"number",placeholder:"Shares to issue",onKeyDown:function(t){t.key===h.a.ENTER&&g()}}),r.a.createElement(f.a,{disabled:parseFloat(n)<0||parseFloat(n)>e.numShares,sx:{mx:1},onClick:g},"Go Public")))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(0),r=n.n(a),i=n(29),o=n(482),s=n(1230),l=n(1241);function c(t){const e=i.b.Player(),n=i.b.Router(),[c,f]=Object(a.useState)(!1);if(void 0===t.location.infiltrationData)throw new Error("Trying to do infiltration on invalid location.");const u=t.location.infiltrationData.startingSecurityLevel,m=Object(o.a)(e,u),h=Object(o.b)(e,u);return r.a.createElement("div",{style:{display:"flex",alignItems:"center",height:"calc(100vh - 16px)"}},c?r.a.createElement(s.a,{StartingDifficulty:u,Difficulty:m,Reward:h,MaxLevel:t.location.infiltrationData.maxClearanceLevel}):r.a.createElement(l.a,{Location:t.location,Difficulty:m,MaxLevel:t.location.infiltrationData.maxClearanceLevel,start:()=>f(!0),cancel:function(){n.toCity()}}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return w}));var a,r=n(1),i=n(249),o=n(45),s=n(8),l=n(0),c=n.n(l),f=n(12),u=n(29),m=n(1231),h=n(1232),d=n(1233),p=n(1234),g=n(1235),y=n(1236),b=n(1237),E=n(1238),v=n(1239),k=n(1240);!function(t){t[t.Countdown=0]="Countdown",t[t.Minigame=1]="Minigame",t[t.Result=2]="Result",t[t.Sell=3]="Sell"}(a||(a={}));const _=[E.a,h.a,m.a,d.a,p.a,y.a,b.a,k.a];function w(t){const e=u.b.Player(),n=u.b.Router(),[m,h]=Object(l.useState)(1),[d,p]=Object(l.useState)(a.Countdown),[y,b]=Object(l.useState)(""),[E,k]=Object(l.useState)({lastGames:[-1,-1],id:Math.floor(Math.random()*_.length)});function w(){let t=E.lastGames[0];const e=[E.lastGames[0],E.lastGames[1],E.id];for(;e.includes(t);)t=Math.floor(Math.random()*_.length);return t}function S(){k({lastGames:[E.lastGames[1],E.id],id:w()})}function x(t){b(e=>{let n=e;return n+=t?"✓":"✗",n.length>15&&(n=n.slice(1)),n})}let C;switch(d){case a.Countdown:C=c.a.createElement(g.a,{onFinish:()=>p(a.Minigame)});break;case a.Minigame:{const r=_[E.id];C=c.a.createElement(r,{onSuccess:function(){x(!0),m===t.MaxLevel?p(a.Sell):(p(a.Countdown),h(m+1)),S()},onFailure:function(r){p(a.Countdown),x(!1);const i=null!=r&&r.automated?e.hp:3*t.StartingDifficulty*(e.hasAugmentation(f.a.WKSharmonizer,!0)?.5:1);e.takeDamage(i)?n.toCity():S()},difficulty:t.Difficulty+m/50});break}case a.Sell:C=c.a.createElement(v.a,{StartingDifficulty:t.StartingDifficulty,Difficulty:t.Difficulty,Reward:t.Reward,MaxLevel:t.MaxLevel})}function L(){return c.a.createElement(r.a,{variant:"h4"},c.a.createElement("span",{style:{color:"gray"}},y.slice(0,y.length-1)),y[y.length-1])}return c.a.createElement(i.a,null,c.a.createElement(o.a,{sx:{p:1,mb:1,display:"grid",justifyItems:"center",gap:1}},d!==a.Sell&&c.a.createElement(s.a,{sx:{width:"100%"},onClick:function(){n.toCity()}},"Cancel Infiltration"),c.a.createElement(r.a,{variant:"h5"},"Level ",m," / ",t.MaxLevel),c.a.createElement(L,null)),C)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var a=n(45),r=n(1),i=n(0),o=n.n(i),s=n(12),l=n(2),c=n(27),f=n(134),u=n(620),m=n(219),h=n(205),d=n(220);const p={Trivial:{timer:16e3,min:3,max:4},Normal:{timer:12500,min:2,max:3},Hard:{timer:15e3,min:3,max:4},Impossible:{timer:8e3,min:4,max:4}};function g(t){const e={timer:0,min:0,max:0};Object(m.a)(p,t.difficulty,e);const n=e.timer,[g]=Object(i.useState)(function(t){const e=Object(f.e)(t.min,t.max);let n="";for(let t=0;t0&&(n+=" "),n+=y[Math.floor(Math.random()*y.length)];return n}(e)),[b,E]=Object(i.useState)(""),v=l.a.hasAugmentation(s.a.ChaosOfDionysus,!0);return o.a.createElement(o.a.Fragment,null,o.a.createElement(h.a,{millis:n,onExpire:t.onFailure}),o.a.createElement(a.a,{sx:{display:"grid",justifyItems:"center",pb:1}},o.a.createElement(r.a,{variant:"h4"},"Type it",v?"":" backward"),o.a.createElement(d.a,{onKeyDown:function(e){if(e.preventDefault(),function(t){return t.key===c.a.BACKSPACE||t.shiftKey&&"Shift"===t.key||t.ctrlKey||t.altKey}(e))return;const n=b+e.key.toUpperCase();g.startsWith(n)?g===n?t.onSuccess():E(n):t.onFailure()},onFailure:t.onFailure}),o.a.createElement(r.a,{style:{transform:v?"none":"scaleX(-1)"}},g),o.a.createElement(r.a,null,b,o.a.createElement(u.a,null))))}const y=["ALGORITHM","ANALOG","APP","APPLICATION","ARRAY","BACKUP","BANDWIDTH","BINARY","BIT","BITE","BITMAP","BLOG","BLOGGER","BOOKMARK","BOOT","BROADBAND","BROWSER","BUFFER","BUG","BUS","BYTE","CACHE","CAPS LOCK","CAPTCHA","CD","CD-ROM","CLIENT","CLIPBOARD","CLOUD","COMPUTING","COMMAND","COMPILE","COMPRESS","COMPUTER","CONFIGURE","COOKIE","COPY","CPU","CYBERCRIME","CYBERSPACE","DASHBOARD","DATA","MINING","DATABASE","DEBUG","DECOMPRESS","DELETE","DESKTOP","DEVELOPMENT","DIGITAL","DISK","DNS","DOCUMENT","DOMAIN","DOMAIN NAME","DOT","DOT MATRIX","DOWNLOAD","DRAG","DVD","DYNAMIC","EMAIL","EMOTICON","ENCRYPT","ENCRYPTION","ENTER","EXABYTE","FAQ","FILE","FINDER","FIREWALL","FIRMWARE","FLAMING","FLASH","FLASH DRIVE","FLOPPY DISK","FLOWCHART","FOLDER","FONT","FORMAT","FRAME","FREEWARE","GIGABYTE","GRAPHICS","HACK","HACKER","HARDWARE","HOME PAGE","HOST","HTML","HYPERLINK","HYPERTEXT","ICON","INBOX","INTEGER","INTERFACE","INTERNET","IP ADDRESS","ITERATION","JAVA","JOYSTICK","JUNKMAIL","KERNEL","KEY","KEYBOARD","KEYWORD","LAPTOP","LASER PRINTER","LINK","LINUX","LOG OUT","LOGIC","LOGIN","LURKING","MACINTOSH","MACRO","MAINFRAME","MALWARE","MEDIA","MEMORY","MIRROR","MODEM","MONITOR","MOTHERBOARD","MOUSE","MULTIMEDIA","NET","NETWORK","NODE","NOTEBOOK","COMPUTER","OFFLINE","ONLINE","OPENSOURCE","OPERATING","SYSTEM","OPTION","OUTPUT","PAGE","PASSWORD","PASTE","PATH","PHISHING","PIRACY","PIRATE","PLATFORM","PLUGIN","PODCAST","POPUP","PORTAL","PRINT","PRINTER","PRIVACY","PROCESS","PROGRAM","PROGRAMMER","PROTOCOL","QUEUE","QWERTY","RAM","REALTIME","REBOOT","RESOLUTION","RESTORE","ROM","ROOT","ROUTER","RUNTIME","SAVE","SCAN","SCANNER","SCREEN","SCREENSHOT","SCRIPT","SCROLL","SCROLL","SEARCH","ENGINE","SECURITY","SERVER","SHAREWARE","SHELL","SHIFT","SHIFT KEY","SNAPSHOT","SOCIAL NETWORKING","SOFTWARE","SPAM","SPAMMER","SPREADSHEET","SPYWARE","STATUS","STORAGE","SUPERCOMPUTER","SURF","SYNTAX","TABLE","TAG","TERMINAL","TEMPLATE","TERABYTE","TEXT EDITOR","THREAD","TOOLBAR","TRASH","TROJAN HORSE","TYPEFACE","UNDO","UNIX","UPLOAD","URL","USER","USER INTERFACE","USERNAME","UTILITY","VERSION","VIRTUAL","VIRTUAL MEMORY","VIRUS","WEB","WEBMASTER","WEBSITE","WIDGET","WIKI","WINDOW","WINDOWS","WIRELESS","PROCESSOR","WORKSTATION","WEB","WORM","WWW","XML","ZIP"]},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var a=n(45),r=n(1),i=n(0),o=n.n(i),s=n(12),l=n(2),c=n(27),f=n(134),u=n(620),m=n(219),h=n(205),d=n(220);const p={Trivial:{timer:8e3,min:2,max:3},Normal:{timer:6e3,min:4,max:5},Hard:{timer:4e3,min:4,max:6},Impossible:{timer:2500,min:7,max:7}};function g(t){const e={timer:0,min:0,max:0};Object(m.a)(p,t.difficulty,e);const n=e.timer,[g,y]=Object(i.useState)(""),[b]=Object(i.useState)(function(t){let e="";const n=[c.a.OPEN_BRACKET,c.a.LESS_THAN,c.a.OPEN_PARENTHESIS,c.a.OPEN_BRACE];l.a.hasAugmentation(s.a.WisdomOfAthena,!0)&&n.splice(0,1);const a=Object(f.e)(t.min,t.max);for(let t=0;t0;e--){const n=Math.floor(Math.random()*(e+1)),a=t[e];t[e]=t[n],t[n]=a}}(e),e}(e)),[E,v]=Object(i.useState)(0),[k,_]=Object(i.useState)(0),w=g[k];Object(i.useEffect)(()=>{v(g.findIndex(t=>y.includes(t)))},[g]);const S=c.a.theme.primary,x=c.a.theme.disabled;let C=S,L=S,O=S;if(l.a.hasAugmentation(s.a.BeautyOfAphrodite,!0)){const t=k+1>=g.length?0:k+1;let e=E-t;t>E&&(e=g.length-1-t+E);const n=k-1<0?g.length-1:k-1;let a=n-E;n=a&&!r?L:x,O=r?S:x}return o.a.createElement(o.a.Fragment,null,o.a.createElement(h.a,{millis:n,onExpire:t.onFailure}),o.a.createElement(a.a,{sx:{display:"grid",justifyItems:"center"}},o.a.createElement(r.a,{variant:"h4"},"Say something nice about the guard"),o.a.createElement(d.a,{onKeyDown:function(e){e.preventDefault();const n=e.key;if(n===f.a.SPACE)return void(y.includes(w)?t.onSuccess():t.onFailure());let a=k;for([f.a.UP_ARROW,f.a.W,f.a.RIGHT_ARROW,f.a.D].map(t=>t).includes(n)&&a++,[f.a.DOWN_ARROW,f.a.S,f.a.LEFT_ARROW,f.a.A].map(t=>t).includes(n)&&a--;a<0;)a+=g.length;for(;a>g.length-1;)a-=g.length;_(a)},onFailure:t.onFailure}),o.a.createElement(r.a,{variant:"h5",color:C},u.g),o.a.createElement(r.a,{variant:"h5",color:O},w),o.a.createElement(r.a,{variant:"h5",color:L},u.a)))}const y=["affectionate","agreeable","bright","charming","creative","determined","energetic","friendly","funny","generous","polite","likable","diplomatic","helpful","giving","kind","hardworking","patient","dynamic","loyal","based"],b=["aggressive","aloof","arrogant","big-headed","boastful","boring","bossy","careless","clingy","couch potato","cruel","cynical","grumpy","hot air","know it all","obnoxious","pain in the neck","picky","tactless","thoughtless","cringe"]},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var a=n(45),r=n(1),i=n(0),o=n.n(i),s=n(12),l=n(2),c=n(134),f=n(219),u=n(205),m=n(220);const h={Trivial:{timer:13e3,min:6,max:8},Normal:{timer:7e3,min:7,max:8},Hard:{timer:5e3,min:8,max:9},Impossible:{timer:3e3,min:9,max:10}};function d(t){const e={timer:0,min:0,max:0};Object(f.a)(h,t.difficulty,e);const n=e.timer,[d]=Object(i.useState)(function(t){const e=[c.d,c.f,c.g,c.a];let n="";for(let a=0;a=d.length&&t.onSuccess()):t.onFailure()},onFailure:t.onFailure})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(45),r=n(1),i=n(0),o=n.n(i);function s(t){const[e,n]=Object(i.useState)(3);return Object(i.useEffect)(()=>{0!==e?setTimeout(()=>n(e-1),300):t.onFinish()}),o.a.createElement(a.a,{sx:{p:1,textAlign:"center"}},o.a.createElement(r.a,{variant:"h4"},"Get Ready!"),o.a.createElement(r.a,{variant:"h4"},e))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return y}));var a=n(45),r=n(1),i=n(19),o=n(0),s=n.n(o),l=n(12),c=n(2),f=n(6),u=n(27),m=n(134),h=n(219),d=n(205),p=n(220);const g={Trivial:{timer:12500,width:3,height:3,symbols:6},Normal:{timer:15e3,width:4,height:4,symbols:7},Hard:{timer:12500,width:5,height:5,symbols:8},Impossible:{timer:1e4,width:6,height:6,symbols:9}};function y(t){const e={timer:0,width:0,height:0,symbols:0};Object(h.a)(g,t.difficulty,e);const n=e.timer,[y]=Object(o.useState)(function(t){const e=[];for(let n=0;nt.map((t,n)=>{const a=t===E[v],r=S&&!a?f.a.theme.disabled:f.a.theme.primary;n!==_[0]||e!==_[1]?x.push({color:r,content:t}):x.push({color:r,content:t,selected:!0})}));return s.a.createElement(s.a.Fragment,null,s.a.createElement(d.a,{millis:n,onExpire:t.onFailure}),s.a.createElement(a.a,{sx:{display:"grid",justifyItems:"center",pb:1}},s.a.createElement(r.a,{variant:"h4"},"Match the symbols!"),s.a.createElement(r.a,{variant:"h5",color:f.a.theme.primary},"Targets:"," ",E.map((t,e)=>e==v?s.a.createElement("span",{key:""+e,style:{fontSize:"1em",color:f.a.theme.infolight}},t," "):s.a.createElement("span",{key:""+e,style:{fontSize:"1em",color:f.a.theme.primary}},t," "))),s.a.createElement("br",null),s.a.createElement(i.a,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.round(e.width)}, 1fr)`,gap:1}},x.map(t=>s.a.createElement(r.a,{sx:{fontSize:"2em",color:t.color,border:t.selected?"2px solid "+f.a.theme.infolight:"unset",lineHeight:"unset",p:t.selected?"2px":"4px"}},t.content))),s.a.createElement(p.a,{onKeyDown:function(e){e.preventDefault();const n=[0,0];switch(Object(m.b)(e)){case m.g:n[1]--;break;case m.d:n[0]--;break;case m.a:n[1]++;break;case m.f:n[0]++}const a=[_[0]+n[0],_[1]+n[1]];if(a[0]=(a[0]+y[0].length)%y[0].length,a[1]=(a[1]+y.length)%y.length,w(a),e.key===u.a.SPACE){if(y[_[1]][_[0]]!==E[v])return void t.onFailure();k(v+1),E.length===v+1&&t.onSuccess()}},onFailure:t.onFailure})))}function b(){return"ABCDEF0123456789"[Math.floor(16*Math.random())]}},function(t,e,n){"use strict";n.d(e,"a",(function(){return k}));var a=n(1793),r=n(1794),i=n(691),o=n(45),s=n(1),l=n(19),c=n(115),f=n(0),u=n.n(f),m=n(12),h=n(2),d=n(6),p=n(27),g=n(134),y=n(219),b=n(205),E=n(220);const v={Trivial:{timer:15e3,width:3,height:3,mines:4},Normal:{timer:15e3,width:4,height:4,mines:7},Hard:{timer:15e3,width:5,height:5,mines:11},Impossible:{timer:15e3,width:6,height:6,mines:15}};function k(t){const e={timer:0,width:0,height:0,mines:0};Object(y.a)(v,t.difficulty,e);const n=e.timer,[k]=Object(f.useState)(function(t){const e=_(t);for(let n=0;n{const t=setTimeout(()=>O(!1),2e3);return()=>clearInterval(t)},[]);const T=[];return k.map((t,e)=>t.map((t,n)=>{L?T.push({flagged:Boolean(k[e][n])}):n===x[0]&&e===x[1]?T.push({current:!0}):w[e][n]?T.push({marked:!0}):M&&k[e][n]?T.push({flagged:!0}):T.push({})})),u.a.createElement(u.a.Fragment,null,u.a.createElement(b.a,{millis:n,onExpire:t.onFailure}),u.a.createElement(o.a,{sx:{display:"grid",justifyItems:"center",pb:1}},u.a.createElement(s.a,{variant:"h4"},L?"Remember all the mines!":"Mark all the mines!"),u.a.createElement(l.a,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.round(e.width)}, 1fr)`,gridTemplateRows:`repeat(${Math.round(e.height)}, 1fr)`,gap:1}},T.map(t=>{let e,n;return t.marked?(e=d.a.theme.warning,n=u.a.createElement(a.a,null)):t.current?(e=d.a.theme.infolight,n=u.a.createElement(r.a,null)):t.flagged?(e=d.a.theme.error,n=u.a.createElement(i.a,null)):(e=d.a.theme.primary,n=u.a.createElement(u.a.Fragment,null)),u.a.createElement(s.a,{key:`${t}${Object(c.uniqueId)()}`,sx:{color:e,border:"2px solid "+(t.current?d.a.theme.infolight:d.a.theme.primary),height:"32px",width:"32px",display:"flex",alignItems:"center",justifyContent:"center"}},n)})),u.a.createElement(E.a,{onKeyDown:function(e){if(e.preventDefault(),L)return;const n=[0,0];switch(Object(g.b)(e)){case g.g:n[1]--;break;case g.d:n[0]--;break;case g.a:n[1]++;break;case g.f:n[0]++}const a=[x[0]+n[0],x[1]+n[1]];if(a[0]=(a[0]+k[0].length)%k[0].length,a[1]=(a[1]+k.length)%k.length,C(a),e.key==p.a.SPACE){if(!k[x[1]][x[0]])return void t.onFailure();S(e=>(e[x[1]][x[0]]=!0,function(t,e){function n(t){return t.flat().reduce((t,e)=>t+(e?1:0),0)}return n(t)===n(e)}(k,e)&&t.onSuccess(),e))}},onFailure:t.onFailure})))}function _(t){const e=[];for(let n=0;n{let t=window.setTimeout(()=>{p(1),t=window.setTimeout(()=>{p(2),t=window.setTimeout(()=>p(0),e.window)},250)},y);return()=>{clearInterval(t)}},[]),s.a.createElement(s.a.Fragment,null,s.a.createElement(m.a,{millis:5e3,onExpire:t.onFailure}),s.a.createElement(a.a,{sx:{display:"grid",justifyItems:"center"}},s.a.createElement(r.a,{variant:"h4"},"Slash when his guard is down!"),g?s.a.createElement(i.a,{sx:{my:1}},s.a.createElement(r.a,{variant:"h5"},"Guard will drop in..."),s.a.createElement(m.a,{millis:b,onExpire:()=>null,noPaper:!0})):s.a.createElement(s.a.Fragment,null),0===n&&s.a.createElement(r.a,{variant:"h4"},"Guarding ..."),1===n&&s.a.createElement(r.a,{variant:"h4"},"Preparing?"),2===n&&s.a.createElement(r.a,{variant:"h4"},"ATTACKING!"),s.a.createElement(h.a,{onKeyDown:function(e){e.preventDefault(),e.key===f.a.SPACE&&(2!==n?t.onFailure():t.onSuccess())},onFailure:t.onFailure})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return E}));var a=n(45),r=n(1),i=n(19),o=n(130),s=n(74),l=n(8),c=n(0),f=n.n(c),u=n(4),m=n(105),h=n(26),d=n(29),p=n(20),g=n(128),y=n(22),b=n(384);function E(t){const e=d.b.Player(),n=d.b.Router(),[E,v]=Object(c.useState)("none");function k(){L(),n.toCity()}const _=h.a[u.a.ShadowsOfAnarchy],w=Object(b.c)(e,t.Reward,t.MaxLevel,t.StartingDifficulty),S=Object(b.b)(e,t.Reward,t.MaxLevel,t.StartingDifficulty),x=Object(b.a)(e,_,t.StartingDifficulty),C=e.factions.includes(u.a.ShadowsOfAnarchy);function L(){Object(m.c)(h.a[u.a.ShadowsOfAnarchy]),C&&(_.playerReputation+=x)}return f.a.createElement(a.a,{sx:{p:1,textAlign:"center",display:"flex",alignItems:"center",flexDirection:"column"}},f.a.createElement(r.a,{variant:"h4"},"Infiltration successful!"),f.a.createElement(r.a,{variant:"h5",color:"primary",width:"75%"},"You"," ",C?f.a.createElement(f.a.Fragment,null,"have gained ",Object(y.f)(x,2)," rep for ",u.a.ShadowsOfAnarchy," and"," "):f.a.createElement(f.a.Fragment,null),"can trade the confidential information you found for money or reputation."),f.a.createElement(i.a,{sx:{width:"fit-content"}},f.a.createElement(i.a,{sx:{width:"100%"}},f.a.createElement(o.a,{value:E,onChange:function(t){v(t.target.value)},sx:{mr:1}},f.a.createElement(s.a,{key:"none",value:"none"},"none"),e.factions.filter(t=>h.a[t].getInfo().offersWork()).map(t=>f.a.createElement(s.a,{key:t,value:t},t))),f.a.createElement(l.a,{onClick:function(){"none"!==E&&(L(),h.a[E].playerReputation+=w,k())}},"Trade for ",f.a.createElement(g.a,{reputation:w})," reputation")),f.a.createElement(l.a,{onClick:function(){L(),e.gainMoney(S,"infiltration"),k()},sx:{width:"100%"}},"Sell for ",f.a.createElement(p.a,{money:S}))),f.a.createElement(l.a,{onClick:k,sx:{width:"100%",mt:1}},"Quit"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return v}));var a=n(45),r=n(1),i=n(19),o=n(0),s=n.n(o),l=n(12),c=n(2),f=n(6),u=n(27),m=n(134),h=n(219),d=n(205),p=n(220);const g={Trivial:{timer:9e3,wiresmin:4,wiresmax:4,rules:2},Normal:{timer:7e3,wiresmin:6,wiresmax:6,rules:2},Hard:{timer:5e3,wiresmin:8,wiresmax:8,rules:3},Impossible:{timer:4e3,wiresmin:9,wiresmax:9,rules:4}},y=[u.a.PIPE,u.a.DOT,u.a.FORWARD_SLASH,u.a.HYPHEN,"█",u.a.HASH],b=["red","#FFC107","blue","white"],E={red:"red","#FFC107":"yellow",blue:"blue",white:"white"};function v(t){const e={timer:0,wiresmin:0,wiresmax:0,rules:0};Object(h.a)(g,t.difficulty,e);const n=e.timer,[u]=Object(o.useState)(function(t){const e=[],n=Object(m.e)(t.wiresmin,t.wiresmax);for(let t=0;te.shouldCut(u[t-1],t-1))}return Object(o.useEffect)(()=>{const e=[];for(let t=0;tt===E[e])&&t.onSuccess()},[E]),s.a.createElement(s.a.Fragment,null,s.a.createElement(d.a,{millis:n,onExpire:t.onFailure}),s.a.createElement(a.a,{sx:{display:"grid",justifyItems:"center",pb:1}},s.a.createElement(r.a,{variant:"h4",sx:{width:"75%",textAlign:"center"}},"Cut the wires with the following properties! (keyboard 1 to 9)"),w.map((t,e)=>s.a.createElement(r.a,{key:e},t.toString())),s.a.createElement(i.a,{sx:{display:"grid",gridTemplateColumns:`repeat(${u.length}, 1fr)`,columnGap:3,justifyItems:"center"}},new Array(u.length).fill(0).map((t,e)=>{const n=x(e+1),a=S&&!n?f.a.theme.disabled:f.a.theme.primary;return s.a.createElement(r.a,{key:e,style:{color:a}},e+1)}),new Array(8).fill(0).map((t,e)=>s.a.createElement(s.a.Fragment,{key:e},u.map((t,n)=>{if((3===e||4===e)&&E[n])return s.a.createElement(r.a,{key:n});const a=x(n+1),i=S&&!a?f.a.theme.disabled:t.colors[e%t.colors.length];return s.a.createElement(r.a,{key:n,style:{color:i}},"|",t.tpe,"|")})))),s.a.createElement(p.a,{onKeyDown:function(e){e.preventDefault();const n=parseInt(e.key);n<1||n>u.length||isNaN(n)||v(e=>{const a=[...e];return a[n-1]=!0,x(n)||t.onFailure(),a})},onFailure:t.onFailure})))}function k(t){const e=Math.floor(Math.random()*t.length);return{toString:()=>`Cut wires number ${e+1}.`,shouldCut:(t,n)=>e===n}}function _(t){const e=t[Math.floor(Math.random()*t.length)].colors[0];return{toString:()=>`Cut all wires colored ${E[e]}.`,shouldCut:t=>t.colors.includes(e)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var a=n(691),r=n(249),i=n(45),o=n(1),s=n(21),l=n(19),c=n(8),f=n(0),u=n.n(f),m=n(6),h=n(5);function d(t,e){let n="";return e<=0?e=0:e>13?e=13:(e--,n=">"),u.a.createElement("span",{style:{color:t}},"=".repeat(e),n," ".repeat(13-n.length-e))}function p(t){return u.a.createElement(r.a,{sx:{alignItems:"center"}},u.a.createElement(i.a,{sx:{p:1,mb:1,display:"grid",justifyItems:"center"}},u.a.createElement(o.a,{variant:"h4"},"Infiltrating ",u.a.createElement("b",null,t.Location.name)),u.a.createElement(o.a,{variant:"h6"},u.a.createElement("b",null,"Maximum Level: "),t.MaxLevel),u.a.createElement(o.a,{variant:"h6",sx:{color:t.Difficulty>2?m.a.theme.error:t.Difficulty>1?m.a.theme.warning:m.a.theme.primary,display:"flex",alignItems:"center"}},u.a.createElement("b",null,"Difficulty: "),h.a.format(33.3333*t.Difficulty,"0")," / 100",t.Difficulty>1.5&&u.a.createElement(s.a,{title:u.a.createElement(o.a,{color:"error"},"This location is too heavily guarded for your current stats. It is recommended that you try training, or finding an easier location.")},u.a.createElement(a.a,{sx:{ml:1}}))),u.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}},"[",0===(e=t.Difficulty)?u.a.createElement("span",{style:{color:"white"}},">"," ".repeat(38)):u.a.createElement(u.a.Fragment,null,d(m.a.theme.primary,13*e),d(m.a.theme.warning,13*(e-1)),d(m.a.theme.error,13*(e-2))),"]"),u.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}},"▲ ▲ ▲ ▲"),u.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," Trivial Normal Hard Impossible")),u.a.createElement(i.a,{sx:{p:1,display:"grid",justifyItems:"center"}},u.a.createElement(o.a,{sx:{width:"75%",textAlign:"center"}},u.a.createElement("b",null,"Infiltration")," is a series of short minigames that get progressively harder. You take damage for failing them. Reaching the maximum level rewards you with intel that you can trade for money or reputation.",u.a.createElement("br",null),u.a.createElement("br",null),u.a.createElement("b",null,"Gameplay:")),u.a.createElement("ul",null,u.a.createElement(o.a,null,u.a.createElement("li",null,"The minigames you play are randomly selected.",u.a.createElement("br",null),"It might take you a few tries to get used to them."),u.a.createElement("li",null,"No game requires use of the mouse."),u.a.createElement("li",null,u.a.createElement("b",null,"Spacebar")," is the default action/confirm button."),u.a.createElement("li",null,"The ",u.a.createElement("b",null,"arrow keys")," and ",u.a.createElement("b",null,"WASD")," can be used interchangeably."),u.a.createElement("li",null,"Sometimes the rest of the keyboard is used."))),u.a.createElement(l.a,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",width:"100%"}},u.a.createElement(c.a,{onClick:t.start},"Start"),u.a.createElement(c.a,{onClick:t.cancel},"Cancel"))));var e}},function(t,e,n){"use strict";n.d(e,"a",(function(){return R}));var a=n(1483),r=n(1484),i=n(1795),o=n(1),s=n(249),l=n(8),c=n(19),f=n(45),u=n(248),m=n(355),h=n(0),d=n.n(h),p=n(12),g=n(79),y=n(10),b=n(105),E=n(9),v=n(186),k=n(172),_=n(6),w=n(29),S=n(252),x=n(20),C=n(22),L=n(483),O=n(269);const M={},T=(t,e)=>!(t.money{const e=t.aug,n=t.player;return d.a.createElement(o.a,{color:_.a.theme.money},d.a.createElement("b",null,"Pre-Requisites:"),d.a.createElement("br",null),e.prereqs.map(t=>d.a.createElement("span",{style:{display:"flex",alignItems:"center"}},n.hasAugmentation(t)?d.a.createElement(a.a,{sx:{mr:1}}):d.a.createElement(r.a,{sx:{mr:1}}),t)))},R=()=>{const t=w.b.Player(),e=w.b.Router();for(const t of Object.values(g.a)){const e=t.name,n=new L.a(t);M[e]=n}const[n,a]=Object(h.useState)(Object(O.b)(t)[0]),[r,b]=Object(h.useState)(!1),R=g.a[n],N=Object(h.useState)(!1)[1];function P(){N(t=>!t)}const I=t=>{_.a.PurchaseAugmentationsOrder=t,P()};return Object(h.useEffect)(()=>{const t=setInterval(P,200);return()=>clearInterval(t)},[]),d.a.createElement(s.a,{disableGutters:!0,maxWidth:"lg",sx:{mx:0}},d.a.createElement(l.a,{onClick:()=>e.toLocation(v.a[E.a.NewTokyoVitaLife])},"Back"),d.a.createElement(o.a,{variant:"h4"},"Grafting Laboratory"),d.a.createElement(o.a,null,"You find yourself in a secret laboratory, owned by a mysterious researcher.",d.a.createElement("br",null),"The scientist explains that they've been studying Augmentation grafting, the process of applying Augmentations without requiring a body reset.",d.a.createElement("br",null),d.a.createElement("br",null),"Through legally questionable connections, the scientist has access to a vast array of Augmentation blueprints, even private designs. They offer to build and graft the Augmentations to you, in exchange for both a hefty sum of money, and being a lab rat."),d.a.createElement(c.a,{sx:{my:3}},d.a.createElement(f.a,{sx:{p:1}},d.a.createElement(o.a,{variant:"h5"},"Graft Augmentations"),d.a.createElement(c.a,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr"}},d.a.createElement(l.a,{sx:{width:"100%"},onClick:()=>I(k.b.Cost)},"Sort by Cost"),d.a.createElement(l.a,{sx:{width:"100%"},onClick:()=>I(k.b.Default)},"Sort by Default Order"))),Object(O.b)(t).length>0?d.a.createElement(f.a,{sx:{mb:1,width:"fit-content",display:"grid",gridTemplateColumns:"1fr 3fr"}},d.a.createElement(u.a,{sx:{height:400,overflowY:"scroll",borderRight:"1px solid "+_.a.theme.welllight}},(()=>{const e=Object(O.b)(t);switch(_.a.PurchaseAugmentationsOrder){case k.b.Cost:return e.sort((t,e)=>M[t].cost-M[e].cost);default:return e}})().map((e,r)=>d.a.createElement(m.a,{key:r+1,onClick:()=>a(e),selected:n===e},d.a.createElement(o.a,{sx:{color:T(t,M[e])?_.a.theme.primary:_.a.theme.disabled}},e)))),d.a.createElement(c.a,{sx:{m:1}},d.a.createElement(o.a,{variant:"h6",sx:{display:"flex",alignItems:"center",flexWrap:"wrap"}},d.a.createElement(i.a,{sx:{mr:1}})," ",n),d.a.createElement(l.a,{onClick:()=>b(!0),sx:{width:"100%"},disabled:!T(t,M[n])},"Graft Augmentation (",d.a.createElement(o.a,null,d.a.createElement(x.a,{money:M[n].cost,player:t})),")"),d.a.createElement(S.a,{open:r,onClose:()=>b(!1),onConfirm:()=>{const a=M[n];t.loseMoney(a.cost,"augmentations"),t.startGraftAugmentationWork(n,a.time),t.startFocusing(),e.toWork()},confirmationText:d.a.createElement(d.a.Fragment,null,"Cancelling grafting will ",d.a.createElement("b",null,"not")," save grafting progress, and the money you spend will ",d.a.createElement("b",null,"not")," ","be returned.",!t.hasAugmentation(p.a.CongruityImplant)&&d.a.createElement(d.a.Fragment,null,d.a.createElement("br",null),d.a.createElement("br",null),"Additionally, grafting an Augmentation will increase the potency of the Entropy virus."))}),d.a.createElement(c.a,{sx:{maxHeight:330,overflowY:"scroll"}},d.a.createElement(o.a,{color:_.a.theme.info},d.a.createElement("b",null,"Time to Graft:")," ",Object(C.d)(Object(O.a)(t,M[n]))),R.prereqs.length>0&&d.a.createElement(A,{player:t,aug:R}),d.a.createElement("br",null),d.a.createElement(o.a,null,(()=>{const t="string"==typeof R.info?d.a.createElement("span",null,R.info):R.info;return d.a.createElement(d.a.Fragment,null,t,d.a.createElement("br",null),d.a.createElement("br",null),R.stats)})())))):d.a.createElement(o.a,null,"All Augmentations owned")),d.a.createElement(c.a,{sx:{my:3}},d.a.createElement(o.a,{variant:"h5"},"Entropy Virus"),d.a.createElement(f.a,{sx:{my:1,p:1,width:"fit-content"}},d.a.createElement(o.a,null,d.a.createElement("b",null,"Entropy strength:")," ",t.entropy,d.a.createElement("br",null),d.a.createElement("b",null,"All multipliers decreased by:")," ",Object(C.f)(100*(1-y.a.EntropyEffect**t.entropy),3),"% (multiplicative)")),d.a.createElement(o.a,null,"When installed on an unconscious individual, Augmentations are scanned by the body on awakening, eliminating hidden malware. However, grafted Augmentations do not provide this security measure.",d.a.createElement("br",null),d.a.createElement("br",null),'Individuals who tested Augmentation grafting have reported symptoms of an unknown virus, which they\'ve dubbed "Entropy". This virus seems to grow more potent with each grafted Augmentation...')))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return R}));var a=n(249),r=n(45),i=n(148),o=n(149),s=n(19),l=n(21),c=n(8),f=n(1),u=n(115),m=n(0),h=n.n(m),d=n(67),p=n(238),g=n(10),y=n(26),b=n(9),E=n(186),v=n(6),k=n(22),_=n(29),w=n(5),S=n(20),x=n(112),C=n(413),L=n(128),O=n(484),M=n(73),T=n(34);const A=1e3/g.a.MilliPerCycle;function R(){var t;const e=Object(m.useState)(!1)[1];function n(){e(t=>!t)}Object(m.useEffect)(()=>{const t=setInterval(n,g.a.MilliPerCycle);return()=>clearInterval(t)},[]);const R=_.b.Player(),N=_.b.Router(),P=[R.workHackExpGained>0?h.a.createElement(M.a,{name:"Hacking Exp",color:v.a.theme.hack,data:{content:`${w.a.formatExp(R.workHackExpGained)} (${w.a.formatExp(R.workHackExpGainRate*A)} / sec)`}}):h.a.createElement(h.a.Fragment,null),R.workStrExpGained>0?h.a.createElement(M.a,{name:"Strength Exp",color:v.a.theme.combat,data:{content:`${w.a.formatExp(R.workStrExpGained)} (${w.a.formatExp(R.workStrExpGainRate*A)} / sec)`}}):h.a.createElement(h.a.Fragment,null),R.workDefExpGained>0?h.a.createElement(M.a,{name:"Defense Exp",color:v.a.theme.combat,data:{content:`${w.a.formatExp(R.workDefExpGained)} (${w.a.formatExp(R.workDefExpGainRate*A)} / sec)`}}):h.a.createElement(h.a.Fragment,null),R.workDexExpGained>0?h.a.createElement(M.a,{name:"Dexterity Exp",color:v.a.theme.combat,data:{content:`${w.a.formatExp(R.workDexExpGained)} (${w.a.formatExp(R.workDexExpGainRate*A)} / sec)`}}):h.a.createElement(h.a.Fragment,null),R.workAgiExpGained>0?h.a.createElement(M.a,{name:"Agility Exp",color:v.a.theme.combat,data:{content:`${w.a.formatExp(R.workAgiExpGained)} (${w.a.formatExp(R.workAgiExpGainRate*A)} / sec)`}}):h.a.createElement(h.a.Fragment,null),R.workChaExpGained>0?h.a.createElement(M.a,{name:"Charisma Exp",color:v.a.theme.cha,data:{content:`${w.a.formatExp(R.workChaExpGained)} (${w.a.formatExp(R.workChaExpGainRate*A)} / sec)`}}):h.a.createElement(h.a.Fragment,null)];let I;switch(R.workType){case T.d.Faction:{const t=y.a[R.currentWorkFactionName];function F(){N.toFaction(t),R.finishFactionWork(!0)}function D(){N.toFaction(t),R.stopFocusing()}t||(I={buttons:{cancel:()=>N.toFactions()},title:`You have not joined ${R.currentWorkFactionName||"(Faction not found)"} at this time, please try again if you think this should have worked`,stopText:"Back to Factions"}),I={buttons:{cancel:F,unfocus:D},title:h.a.createElement(h.a.Fragment,null,"You are currently ",R.currentWorkFactionDescription," for your faction ",h.a.createElement("b",null,t.name)),description:h.a.createElement(h.a.Fragment,null,"Current Faction Reputation: ",h.a.createElement(L.a,{reputation:t.playerReputation})),gains:[R.workMoneyGained>0?h.a.createElement(M.a,{name:"Money",color:v.a.theme.money},h.a.createElement(f.a,null,h.a.createElement(S.a,{money:R.workMoneyGained})," (",h.a.createElement(x.a,{money:R.workMoneyGainRate*A}),")")):h.a.createElement(h.a.Fragment,null),h.a.createElement(M.a,{name:"Faction Reputation",color:v.a.theme.rep},h.a.createElement(f.a,null,h.a.createElement(L.a,{reputation:R.workRepGained})," (",h.a.createElement(O.a,{reputation:R.workRepGainRate*A}),")")),...P],progress:{elapsed:R.timeWorked},stopText:"Stop Faction work"};break}case T.d.StudyClass:{const t=R.className;function F(){R.finishClass(!0),N.toCity()}function D(){N.toCity(),R.stopFocusing()}let e="";e=t===T.a.GymStrength||t===T.a.GymDefense||t===T.a.GymDexterity||t===T.a.GymAgility?"Stop training at gym":"Stop taking course",I={buttons:{cancel:F,unfocus:D},title:h.a.createElement(h.a.Fragment,null,"You are currently ",h.a.createElement("b",null,t)),gains:[h.a.createElement(M.a,{name:"Total Cost",color:v.a.theme.money},h.a.createElement(f.a,null,h.a.createElement(S.a,{money:-R.workMoneyGained})," (",h.a.createElement(x.a,{money:R.workMoneyLossRate*A}),")")),...P],progress:{elapsed:R.timeWorked},stopText:e};break}case T.d.Company:{const t=d.a[R.companyName];null!=t&&t instanceof p.a||(I={buttons:{cancel:()=>N.toTerminal()},title:`You cannot work for ${R.companyName||"(Company not found)"} at this time, please try again if you think this should have worked`,stopText:"Back to Terminal"});const e=t.playerReputation;function F(){R.finishWork(!0),N.toJob()}function D(){R.stopFocusing(),N.toJob()}const n=R.jobs[R.companyName],a=.5===R.cancelationPenalty()?"half":"three-quarters";I={buttons:{cancel:F,unfocus:D},title:h.a.createElement(h.a.Fragment,null,"You are currently working as a ",h.a.createElement("b",null,n)," at ",h.a.createElement("b",null,R.companyName)),description:h.a.createElement(h.a.Fragment,null,"Current Company Reputation: ",h.a.createElement(L.a,{reputation:e})),gains:[h.a.createElement(M.a,{name:"Money",color:v.a.theme.money},h.a.createElement(f.a,null,h.a.createElement(S.a,{money:R.workMoneyGained})," (",h.a.createElement(x.a,{money:R.workMoneyGainRate*A}),")")),h.a.createElement(M.a,{name:"Company Reputation",color:v.a.theme.rep},h.a.createElement(f.a,null,h.a.createElement(L.a,{reputation:R.workRepGained})," (",h.a.createElement(O.a,{reputation:R.workRepGainRate*A}),")")),...P],progress:{elapsed:R.timeWorked},stopText:"Stop working",stopTooltip:`You will automatically finish after working for 8 hours. You can cancel earlier if you wish but you will only gain ${a} of the reputation you've earned so far.`};break}case T.d.CompanyPartTime:{function F(){R.finishWorkPartTime(!0),N.toJob()}function D(){R.stopFocusing(),N.toJob()}const t=d.a[R.companyName];let e=0;if(null==t||!(t instanceof p.a))throw new Error("Could not find Company: "+R.companyName);e=t.playerReputation;const n=R.jobs[R.companyName];I={buttons:{cancel:F,unfocus:D},title:h.a.createElement(h.a.Fragment,null,"You are currently working as a ",h.a.createElement("b",null,n)," at ",h.a.createElement("b",null,R.companyName)),description:h.a.createElement(h.a.Fragment,null,"Current Company Reputation: ",h.a.createElement(L.a,{reputation:e})),gains:[h.a.createElement(M.a,{name:"Money",color:v.a.theme.money},h.a.createElement(f.a,null,h.a.createElement(S.a,{money:R.workMoneyGained})," (",h.a.createElement(x.a,{money:R.workMoneyGainRate*A}),")")),h.a.createElement(M.a,{name:"Company Reputation",color:v.a.theme.rep},h.a.createElement(f.a,null,h.a.createElement(L.a,{reputation:R.workRepGained})," (",h.a.createElement(O.a,{reputation:R.workRepGainRate*A}),")")),...P],progress:{elapsed:R.timeWorked},stopText:"Stop working",stopTooltip:"You will automatically finish after working for 8 hours. You can cancel earlier if you wish and there will be no penalty because this is a part-time job."};break}case T.d.Crime:{const t=Math.round(R.timeWorked/R.timeNeededToCompleteWork*100);I={buttons:{cancel:()=>{N.toLocation(E.a[b.a.Slums]),R.finishCrime(!0)}},title:"You are attempting to "+R.crimeType,progress:{remaining:R.timeNeededToCompleteWork-R.timeWorked,percentage:t},stopText:"Cancel crime"};break}case T.d.CreateProgram:{function F(){R.finishCreateProgramWork(!0),N.toTerminal()}function D(){N.toTerminal(),R.stopFocusing()}const t=R.timeWorkedCreateProgram/R.timeNeededToCompleteWork*100;I={buttons:{cancel:F,unfocus:D},title:h.a.createElement(h.a.Fragment,null,"You are currently working on coding ",h.a.createElement("b",null,R.createProgramName)),progress:{elapsed:R.timeWorked,percentage:t},stopText:"Stop creating program",stopTooltip:"Your work will be saved and you can return to complete the program later."};break}case T.d.GraftAugmentation:{function F(){R.finishGraftAugmentationWork(!0),N.toTerminal()}function D(){N.toTerminal(),R.stopFocusing()}const t=R.timeWorkedGraftAugmentation/R.timeNeededToCompleteWork*100;I={buttons:{cancel:F,unfocus:D},title:h.a.createElement(h.a.Fragment,null,"You are currently working on grafting ",h.a.createElement("b",null,R.graftAugmentationName)),progress:{elapsed:R.timeWorked,percentage:t},stopText:"Stop grafting",stopTooltip:h.a.createElement(h.a.Fragment,null,"If you cancel, your work will ",h.a.createElement("b",null,"not")," be saved, and the money you spent will ",h.a.createElement("b",null,"not")," be returned")};break}default:N.toTerminal(),I=null}if(null===I)return h.a.createElement(h.a.Fragment,null);const j="string"==typeof(null===(t=I)||void 0===t?void 0:t.stopTooltip)?h.a.createElement(f.a,null,I.stopTooltip):I.stopTooltip||h.a.createElement(h.a.Fragment,null);return h.a.createElement(a.a,{maxWidth:"md",sx:{display:"flex",flexDirection:"column",justifyContent:"center",height:"calc(100vh - 16px)"}},h.a.createElement(r.a,{sx:{p:1,mb:1}},h.a.createElement(f.a,{variant:"h6"},I.title),h.a.createElement(f.a,null,I.description),I.gains&&h.a.createElement(i.a,{sx:{mt:1}},h.a.createElement(o.a,null,I.gains.map(t=>h.a.createElement(h.a.Fragment,{key:Object(u.uniqueId)()},t))))),h.a.createElement(r.a,{sx:{mb:1,p:1}},void 0!==I.progress&&h.a.createElement(s.a,{sx:{mb:1}},h.a.createElement(s.a,{display:"grid",sx:{gridTemplateColumns:`repeat(${Object.keys(I.progress).length}, 1fr)`,width:"100%",justifyItems:"center",textAlign:"center"}},void 0!==I.progress.elapsed&&h.a.createElement(f.a,null,Object(k.d)(I.progress.elapsed)," elapsed"),void 0!==I.progress.remaining&&h.a.createElement(f.a,null,Object(k.d)(I.progress.remaining)," remaining"),void 0!==I.progress.percentage&&h.a.createElement(f.a,null,I.progress.percentage.toFixed(2),"% done")),void 0!==I.progress.percentage&&h.a.createElement(C.a,{variant:"determinate",value:I.progress.percentage,color:"primary"})),h.a.createElement(s.a,{display:"grid",sx:{gridTemplateColumns:`repeat(${Object.keys(I.buttons).length}, 1fr)`}},I.stopTooltip?h.a.createElement(l.a,{title:j},h.a.createElement(c.a,{onClick:I.buttons.cancel},I.stopText)):h.a.createElement(c.a,{onClick:I.buttons.cancel},I.stopText),I.buttons.unfocus&&h.a.createElement(c.a,{onClick:I.buttons.unfocus},"Do something else simultaneously"))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var a=n(249),r=n(1),i=n(19),o=n(0),s=n.n(o),l=n(287),c=n(1245),f=n(1246);function u(t){const[e,n]=Object(o.useState)(l.a.SYSTEM);return s.a.createElement(a.a,{disableGutters:!0,maxWidth:"lg",sx:{mx:0}},s.a.createElement(r.a,{variant:"h4"},"Options"),s.a.createElement(i.a,{sx:{display:"grid",gridTemplateColumns:"1fr 3fr",gap:1}},s.a.createElement(f.a,{tab:e,setTab:t=>n(t),player:t.player,router:t.router,save:t.save,export:t.export,forceKill:t.forceKill,softReset:t.softReset}),s.a.createElement(c.a,{currentTab:e,player:t.player})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var a=n(21),r=n(1),i=n(76),o=n(130),s=n(74),l=n(0),c=n.n(l),f=n(6),u=n(147),m=n(375),h=n(287),d=n(549),p=n(435);const g=t=>{const[e,n]=Object(l.useState)(f.a.CodeInstructionRunTime),[g,y]=Object(l.useState)(f.a.MaxRecentScriptsCapacity),[b,E]=Object(l.useState)(f.a.MaxLogCapacity),[v,k]=Object(l.useState)(f.a.MaxPortCapacity),[_,w]=Object(l.useState)(f.a.MaxTerminalCapacity),[S,x]=Object(l.useState)(f.a.AutosaveInterval),[C,L]=Object(l.useState)(f.a.TimestampsFormat),[O,M]=Object(l.useState)(f.a.Locale);return{[h.a.SYSTEM]:c.a.createElement(d.a,{title:"System"},c.a.createElement(c.a.Fragment,null,c.a.createElement(p.a,{label:".script exec time (ms)",initialValue:e,callback:function(t,e){n(e),f.a.CodeInstructionRunTime=e},step:1,min:5,max:100,tooltip:c.a.createElement(c.a.Fragment,null,"The minimum number of milliseconds it takes to execute an operation in Netscript. Setting this too low can result in poor performance if you have many scripts running.")}),c.a.createElement(p.a,{label:"Recently killed scripts size",initialValue:g,callback:function(t,e){y(e),f.a.MaxRecentScriptsCapacity=e},step:25,min:0,max:500,tooltip:c.a.createElement(c.a.Fragment,null,"The maximum number of lines a script's logs can hold. Setting this too high can cause the game to use a lot of memory if you have many scripts running.")}),c.a.createElement(p.a,{label:"Netscript log size",initialValue:b,callback:function(t,e){E(e),f.a.MaxLogCapacity=e},step:20,min:20,max:500,tooltip:c.a.createElement(c.a.Fragment,null,"The maximum number of lines a script's logs can hold. Setting this too high can cause the game to use a lot of memory if you have many scripts running.")}),c.a.createElement(p.a,{label:"Netscript port size",initialValue:v,callback:function(t,e){k(e),f.a.MaxPortCapacity=e},step:1,min:20,max:100,tooltip:c.a.createElement(c.a.Fragment,null,"The maximum number of entries that can be written to a port using Netscript's write() function. Setting this too high can cause the game to use a lot of memory.")}),c.a.createElement(p.a,{label:"Terminal capacity",initialValue:_,callback:function(t,e){w(e),f.a.MaxTerminalCapacity=e},step:50,min:50,max:500,tooltip:c.a.createElement(c.a.Fragment,null,"The maximum number of entries that can be written to the terminal. Setting this too high can cause the game to use a lot of memory."),marks:!0}),c.a.createElement(p.a,{label:"Autosave interval (s)",initialValue:S,callback:function(t,e){x(e),f.a.AutosaveInterval=e},step:30,min:0,max:600,tooltip:c.a.createElement(c.a.Fragment,null,"The time (in seconds) between each autosave. Set to 0 to disable autosave."),marks:!0})),c.a.createElement(u.a,{checked:f.a.SuppressSavedGameToast,onChange:t=>f.a.SuppressSavedGameToast=t,text:"Suppress Auto-Save Game Toast",tooltip:c.a.createElement(c.a.Fragment,null,'If this is set, there will be no "Game Saved!" toast appearing after an auto-save.')}),c.a.createElement(u.a,{checked:f.a.SuppressAutosaveDisabledWarnings,onChange:t=>f.a.SuppressAutosaveDisabledWarnings=t,text:"Suppress Auto-Save Disabled Warning",tooltip:c.a.createElement(c.a.Fragment,null,"If this is set, there will be no warning triggered when auto-save is disabled (at 0).")}),c.a.createElement(u.a,{checked:f.a.SaveGameOnFileSave,onChange:t=>f.a.SaveGameOnFileSave=t,text:"Save game on file save",tooltip:c.a.createElement(c.a.Fragment,null,"Save your game any time a file is saved in the script editor.")}),c.a.createElement(u.a,{checked:f.a.ExcludeRunningScriptsFromSave,onChange:t=>f.a.ExcludeRunningScriptsFromSave=t,text:"Exclude Running Scripts from Save",tooltip:c.a.createElement(c.a.Fragment,null,"If this is set, the save file will exclude all running scripts. This is only useful if your save is lagging a lot. You'll have to restart your script every time you launch the game.")})),[h.a.INTERFACE]:c.a.createElement(d.a,{title:"Interface"},c.a.createElement(u.a,{checked:f.a.DisableASCIIArt,onChange:t=>f.a.DisableASCIIArt=t,text:"Disable ascii art",tooltip:c.a.createElement(c.a.Fragment,null,"If this is set all ASCII art will be disabled.")}),c.a.createElement(u.a,{checked:f.a.DisableTextEffects,onChange:t=>f.a.DisableTextEffects=t,text:"Disable text effects",tooltip:c.a.createElement(c.a.Fragment,null,"If this is set, text effects will not be displayed. This can help if text is difficult to read in certain areas.")}),c.a.createElement(u.a,{checked:f.a.DisableOverviewProgressBars,onChange:t=>f.a.DisableOverviewProgressBars=t,text:"Disable Overview Progress Bars",tooltip:c.a.createElement(c.a.Fragment,null,"If this is set, the progress bars in the character overview will be hidden.")}),c.a.createElement(u.a,{checked:f.a.UseIEC60027_2,onChange:t=>f.a.UseIEC60027_2=t,text:"Use GiB instead of GB",tooltip:c.a.createElement(c.a.Fragment,null,"If this is set all references to memory will use GiB instead of GB, in accordance with IEC 60027-2.")}),c.a.createElement(a.a,{title:c.a.createElement(r.a,null,"Terminal commands and log entries will be timestamped. See https://date-fns.org/docs/Getting-Started/")},c.a.createElement(i.a,{InputProps:{startAdornment:c.a.createElement(r.a,{color:"format error"===Object(m.a)(C)&&""!==C?"error":"success"},"Timestamp format:")},value:C,onChange:function(t){L(t.target.value),f.a.TimestampsFormat=t.target.value},placeholder:"yyyy-MM-dd hh:mm:ss"})),c.a.createElement(c.a.Fragment,null,c.a.createElement(a.a,{title:c.a.createElement(r.a,null,"Sets the locale for displaying numbers.")},c.a.createElement(r.a,null,"Locale")),c.a.createElement(o.a,{value:O,onChange:function(t){M(t.target.value),f.a.Locale=t.target.value}},c.a.createElement(s.a,{value:"en"},"en"),c.a.createElement(s.a,{value:"bg"},"bg"),c.a.createElement(s.a,{value:"cs"},"cs"),c.a.createElement(s.a,{value:"da-dk"},"da-dk"),c.a.createElement(s.a,{value:"de"},"de"),c.a.createElement(s.a,{value:"en-au"},"en-au"),c.a.createElement(s.a,{value:"en-gb"},"en-gb"),c.a.createElement(s.a,{value:"es"},"es"),c.a.createElement(s.a,{value:"fr"},"fr"),c.a.createElement(s.a,{value:"hu"},"hu"),c.a.createElement(s.a,{value:"it"},"it"),c.a.createElement(s.a,{value:"lv"},"lv"),c.a.createElement(s.a,{value:"no"},"no"),c.a.createElement(s.a,{value:"pl"},"pl"),c.a.createElement(s.a,{value:"ru"},"ru")))),[h.a.GAMEPLAY]:c.a.createElement(d.a,{title:"Gameplay"},c.a.createElement(u.a,{checked:f.a.SuppressMessages,onChange:t=>f.a.SuppressMessages=t,text:"Suppress story messages",tooltip:c.a.createElement(c.a.Fragment,null,"If this is set, then any messages you receive will not appear as popups on the screen. They will still get sent to your home computer as '.msg' files and can be viewed with the 'cat' Terminal command.")}),c.a.createElement(u.a,{checked:f.a.SuppressFactionInvites,onChange:t=>f.a.SuppressFactionInvites=t,text:"Suppress faction invites",tooltip:c.a.createElement(c.a.Fragment,null,"If this is set, then any faction invites you receive will not appear as popups on the screen. Your outstanding faction invites can be viewed in the 'Factions' page.")}),c.a.createElement(u.a,{checked:f.a.SuppressTravelConfirmation,onChange:t=>f.a.SuppressTravelConfirmation=t,text:"Suppress travel confirmations",tooltip:c.a.createElement(c.a.Fragment,null,"If this is set, the confirmation message before traveling will not show up. You will automatically be deducted the travel cost as soon as you click.")}),c.a.createElement(u.a,{checked:f.a.SuppressBuyAugmentationConfirmation,onChange:t=>f.a.SuppressBuyAugmentationConfirmation=t,text:"Suppress augmentations confirmation",tooltip:c.a.createElement(c.a.Fragment,null,"If this is set, the confirmation message before buying augmentation will not show up.")}),c.a.createElement(u.a,{checked:f.a.SuppressTIXPopup,onChange:t=>f.a.SuppressTIXPopup=t,text:"Suppress TIX messages",tooltip:c.a.createElement(c.a.Fragment,null,"If this is set, the stock market will never create any popup.")}),t.player.bladeburner&&c.a.createElement(u.a,{checked:f.a.SuppressBladeburnerPopup,onChange:t=>f.a.SuppressBladeburnerPopup=t,text:"Suppress bladeburner popup",tooltip:c.a.createElement(c.a.Fragment,null,"If this is set, then having your Bladeburner actions interrupted by being busy with something else will not display a popup message.")})),[h.a.MISC]:c.a.createElement(d.a,{title:"Misc"},c.a.createElement(u.a,{checked:f.a.DisableHotkeys,onChange:t=>f.a.DisableHotkeys=t,text:"Disable hotkeys",tooltip:c.a.createElement(c.a.Fragment,null,'If this is set, then most hotkeys (keyboard shortcuts) in the game are disabled. This includes Terminal commands, hotkeys to navigate between different parts of the game, and the "Save and Close (Ctrl + b)" hotkey in the Text Editor.')}),c.a.createElement(u.a,{checked:f.a.EnableBashHotkeys,onChange:t=>f.a.EnableBashHotkeys=t,text:"Enable bash hotkeys",tooltip:c.a.createElement(c.a.Fragment,null,"Improved Bash emulation mode. Setting this to 1 enables several new Terminal shortcuts and features that more closely resemble a real Bash-style shell. Note that when this mode is enabled, the default browser shortcuts are overriden by the new Bash shortcuts.")}))}[t.currentTab]}},function(t,e,n){"use strict";n.d(e,"a",(function(){return I}));var a=n(1503),r=n(1827),i=n(1480),o=n(1828),s=n(1829),l=n(1830),c=n(1831),f=n(1832),u=n(1833),m=n(1834),h=n(1835),d=n(355),p=n(1),g=n(19),y=n(45),b=n(248),E=n(8),v=n(21),k=n(0),_=n.n(k),w=n(1247),S=n(109),x=n(6),C=n(621),L=n(622),O=n(252),M=n(633),T=n(94),A=n(635),R=n(22),N=n(287);const P=t=>_.a.createElement(d.a,{selected:t.sideBarProps.tab===t.tab,onClick:()=>t.sideBarProps.setTab(t.tab)},_.a.createElement(p.a,null,t.tabName)),I=t=>{var e,n,d,I,F,D,j,B;const G=Object(k.useRef)(null),[W,H]=Object(k.useState)(!1),[U,q]=Object(k.useState)(!1),[$,K]=Object(k.useState)(null);return _.a.createElement(g.a,null,_.a.createElement(y.a,{sx:{height:"fit-content",mb:1}},_.a.createElement(b.a,null,_.a.createElement(P,{sideBarProps:t,tab:N.a.SYSTEM,tabName:"System"}),_.a.createElement(P,{sideBarProps:t,tab:N.a.GAMEPLAY,tabName:"Gameplay"}),_.a.createElement(P,{sideBarProps:t,tab:N.a.INTERFACE,tabName:"Interface"}),_.a.createElement(P,{sideBarProps:t,tab:N.a.MISC,tabName:"Misc"}))),_.a.createElement(g.a,{sx:{display:"grid",width:"100%",height:"fit-content",gridTemplateAreas:'"save delete"\n "export import"\n "kill kill"\n "reset diagnose"\n "browse browse"\n "theme style"\n "links links"\n "devs devs"',gridTemplateColumns:"1fr 1fr"}},_.a.createElement(E.a,{onClick:()=>t.save(),startIcon:_.a.createElement(a.a,null),sx:{gridArea:"save"}},"Save Game"),_.a.createElement(g.a,{sx:{gridArea:"delete","& .MuiButton-root":{height:"100%",width:"100%"}}},_.a.createElement(M.a,null)),_.a.createElement(v.a,{title:_.a.createElement(p.a,null,"Export your game to a text file.")},_.a.createElement(E.a,{onClick:()=>t.export(),startIcon:_.a.createElement(r.a,null),sx:{gridArea:"export"}},"Export Game")),_.a.createElement(v.a,{title:_.a.createElement(p.a,null,"Import your game from a text file.",_.a.createElement("br",null),"This will ",_.a.createElement("strong",null,"overwrite")," your current game. Back it up first!")},_.a.createElement(E.a,{onClick:function(){if(!(window.File&&window.FileReader&&window.FileList&&window.Blob))return;const t=G.current;if(null===t)throw new Error("import input should not be null");t.click()},startIcon:_.a.createElement(i.a,null),sx:{gridArea:"import"}},"Import Game",_.a.createElement("input",{ref:G,id:"import-game-file-selector",type:"file",hidden:!0,onChange:async function(t){try{const e=await S.c.getImportStringFromFile(t.target.files),n=await S.c.getImportDataFromString(e);K(n),q(!0)}catch(t){T.b.emit(t.toString(),T.d.ERROR,5e3)}}}))),_.a.createElement(O.a,{open:U,onClose:()=>q(!1),onConfirm:()=>async function(){if($){try{await S.c.importGame($.base64)}catch(t){T.b.emit(t.toString(),T.d.ERROR,5e3)}q(!1),K(null)}}(),additionalButton:_.a.createElement(E.a,{onClick:function(){$&&(t.router.toImportSave($.base64),q(!1),K(null))}},"Compare Save"),confirmationText:_.a.createElement(_.a.Fragment,null,"Importing a new game will ",_.a.createElement("strong",null,"completely wipe")," the current data!",_.a.createElement("br",null),_.a.createElement("br",null),"Make sure to have a backup of your current save file before importing.",_.a.createElement("br",null),"The file you are attempting to import seems valid.",(null!==(e=null==$||null===(n=$.playerData)||void 0===n?void 0:n.lastSave)&&void 0!==e?e:0)>0&&_.a.createElement(_.a.Fragment,null,_.a.createElement("br",null),_.a.createElement("br",null),"The export date of the save file is"," ",_.a.createElement("strong",null,new Date(null!==(d=null==$||null===(I=$.playerData)||void 0===I?void 0:I.lastSave)&&void 0!==d?d:0).toLocaleString())),(null!==(F=null==$||null===(D=$.playerData)||void 0===D?void 0:D.totalPlaytime)&&void 0!==F?F:0)>0&&_.a.createElement(_.a.Fragment,null,_.a.createElement("br",null),_.a.createElement("br",null),"Total play time of imported game:"," ",Object(R.d)(null!==(j=null==$||null===(B=$.playerData)||void 0===B?void 0:B.totalPlaytime)&&void 0!==j?j:0)),_.a.createElement("br",null),_.a.createElement("br",null))}),_.a.createElement(v.a,{title:_.a.createElement(p.a,null,"Forcefully kill all active running scripts, in case there is a bug or some unexpected issue with the game. After using this, save the game and then reload the page. This is different than normal kill in that normal kill will tell the script to shut down while force kill just removes the references to it (and it should crash on its own). This will not remove the files on your computer, just forcefully kill all running instances of all scripts.")},_.a.createElement(E.a,{onClick:()=>t.forceKill(),sx:{gridArea:"kill"}},"Force kill all active scripts")),_.a.createElement(g.a,{sx:{gridArea:"reset","& .MuiButton-root":{height:"100%",width:"100%"}}},_.a.createElement(A.a,{noConfirmation:x.a.SuppressBuyAugmentationConfirmation,onTriggered:t.softReset})),_.a.createElement(v.a,{title:_.a.createElement(p.a,null,"If your save file is extremely big you can use this button to view a map of all the files on every server. Be careful: there might be spoilers.")},_.a.createElement(E.a,{onClick:()=>H(!0),sx:{gridArea:"diagnose"}},"Diagnose files")),_.a.createElement(v.a,{title:"Head to the theme browser to see a collection of prebuilt themes."},_.a.createElement(E.a,{startIcon:_.a.createElement(o.a,null),onClick:()=>t.router.toThemeBrowser(),sx:{gridArea:"browse"}},"Theme Browser")),_.a.createElement(g.a,{sx:{gridArea:"theme","& .MuiButton-root":{height:"100%",width:"100%"}}},_.a.createElement(L.a,{router:t.router})),_.a.createElement(g.a,{sx:{gridArea:"style","& .MuiButton-root":{height:"100%",width:"100%"}}},_.a.createElement(C.a,null)),_.a.createElement(g.a,{sx:{gridArea:"links",display:"grid",gridTemplateAreas:'"bug changelog"\n "docs docs"\n "discord reddit"\n "plaza plaza"',gridTemplateColumns:"1fr 1fr",my:1}},_.a.createElement(E.a,{startIcon:_.a.createElement(s.a,null),href:"https://github.com/danielyxie/bitburner/issues/new",target:"_blank",sx:{gridArea:"bug"}},"Report Bug"),_.a.createElement(E.a,{startIcon:_.a.createElement(l.a,null),href:"https://bitburner.readthedocs.io/en/latest/changelog.html",target:"_blank",sx:{gridArea:" changelog"}},"Changelog"),_.a.createElement(E.a,{startIcon:_.a.createElement(c.a,null),href:"https://bitburner.readthedocs.io/en/latest/index.html",target:"_blank",sx:{gridArea:"docs"}},"Documentation"),_.a.createElement(E.a,{startIcon:_.a.createElement(f.a,null),href:"https://discord.gg/TFc3hKD",target:"_blank",sx:{gridArea:"discord"}},"Discord"),_.a.createElement(E.a,{startIcon:_.a.createElement(u.a,null),href:"https://www.reddit.com/r/bitburner",target:"_blank",sx:{gridArea:"reddit"}},"Reddit"),_.a.createElement(E.a,{startIcon:_.a.createElement(m.a,null),href:"https://plaza.dsolver.ca/games/bitburner",target:"_blank",sx:{gridArea:"plaza"}},"Incremental game plaza")),!location.href.startsWith("file://")&&_.a.createElement(g.a,{sx:{gridArea:"devs"}},_.a.createElement("form",{action:"https://www.paypal.com/cgi-bin/webscr",method:"post",target:"_blank",style:{display:"block"}},_.a.createElement(E.a,{sx:{width:"100%",display:"flex",flexDirection:"column"},type:"submit"},"danielyxie / BigD (Original Dev)",_.a.createElement("input",{type:"hidden",name:"cmd",value:"_s-xclick"}),_.a.createElement("input",{type:"hidden",name:"encrypted",value:"-----BEGIN PKCS7-----MIIHRwYJKoZIhvcNAQcEoIIHODCCBzQCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYA2Y2VGE75oWct89z//G2YEJKmzx0uDTXNrpje9ThxmUnBLFZCY+I11Pors7lGRvFqo5okwnu41CfYMPHDxpAgyYyQndMX9pWUX0gLfBMm2BaHwsNBCwt34WmpQqj7TGsQ+aw9NbmkxiJltGnOa+6/gy10mPZAA3HxiieLeCKkGgDELMAkGBSsOAwIaBQAwgcQGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQI72F1YSzHUd2AgaDMekHU3AKT93Ey9wkB3486bV+ngFSD6VOHrPweH9QATsp+PMe9QM9vmq+s2bGtTbZaYrFqM3M97SnQ0l7IQ5yuOzdZhRdfysu5uJ8dnuHUzq4gLSzq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kiG9w0BCQEWDXJlQHBheXBhbC5jb22CAQAwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQCBXzpWmoBa5e9fo6ujionW1hUhPkOBakTr3YCDjbYfvJEiv/2P+IobhOGJr85+XHhN0v4gUkEDI8r2/rNk1m0GA8HKddvTjyGw/XqXa+LSTlDYkqI8OwR8GEYj4efEtcRpRYBxV8KxAW93YDWzFGvruKnnLbDAF6VR5w/cCMn5hzGCAZowggGWAgEBMIGUMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbQIBADAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMTcwNzI1MDExODE2WjAjBgkqhkiG9w0BCQQxFgQUNo8efiZ7sk7nwKM/6B6Z7sU8hIIwDQYJKoZIhvcNAQEBBQAEgYB+JB4vZ/r48815/1HF/xK3+rOx7bPz3kAXmbhW/mkoF4OUbzqMeljvDIA9q/BDdlCLtxFOw9XlftTzv0eZCW/uCIiwu5wTzPIfPY1SI8WHe4cJbP2f2EYxIVs8D7OSirbW4yVa0+gACaLLj0rzIzNN8P/5PxgB03D+jwkcJABqng==-----END PKCS7-----"}),_.a.createElement("input",{type:"image",src:"https://www.paypalobjects.com/digitalassets/c/website/marketing/apac/C2/logos-buttons/optimize/26_Yellow_PayPal_Pill_Button.png",name:"submit",alt:"PayPal - The safer, easier way to pay online!"}))),_.a.createElement(E.a,{href:"https://www.google.com/search?q=Where+to+donate+blood+near+me%3F",target:"_blank",sx:{width:"100%",display:"flex",flexDirection:"column"}},"hydroflame (Current Maintainer)",_.a.createElement("span",{style:{display:"flex",alignItems:"center"}},_.a.createElement(h.a,{sx:{mb:.5,mr:1}}),"Donate blood!")))),_.a.createElement(w.a,{open:W,onClose:()=>H(!1)}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return _}));var a=n(0),r=n.n(a),i=n(24),o=n(38),s=n(5),l=n(148),c=n(149),f=n(30),u=n(1485),m=n(1486),h=n(50),d=n(1),p=n(45),g=n(157),y=n(158),b=n(159),E=n(81),v=n.n(E);function k(t){const e=Object(i.d)(t.hostname);if(null===e)throw new Error(`server '${t.hostname}' should not be null`);let n=0;for(const t of e.scripts)n+=t.code.length;for(const t of e.textFiles)n+=t.text.length;if(0===n)return r.a.createElement(r.a.Fragment,null);const a=[];for(const t of e.scripts)a.push({name:t.filename,size:t.code.length});for(const t of e.textFiles)a.push({name:t.fn,size:t.text.length});return a.sort((t,e)=>e.size-t.size),r.a.createElement(g.a,{TransitionProps:{unmountOnExit:!0}},r.a.createElement(y.a,{expandIcon:r.a.createElement(v.a,null)},r.a.createElement(d.a,null,e.hostname," (",s.a.formatBigNumber(n),"b)")),r.a.createElement(b.a,null,r.a.createElement(u.a,{component:p.a},r.a.createElement(l.a,null,r.a.createElement(m.a,null,r.a.createElement(h.a,null,r.a.createElement(f.a,null,r.a.createElement(d.a,null,"Filename")),r.a.createElement(f.a,{align:"right"},r.a.createElement(d.a,null,"Size")))),r.a.createElement(c.a,null,a.map(t=>r.a.createElement(h.a,{key:t.name},r.a.createElement(f.a,{component:"th",scope:"row"},r.a.createElement(d.a,null,t.name)),r.a.createElement(f.a,{align:"right"},r.a.createElement(d.a,null,s.a.formatBigNumber(t.size),"b"))))))),r.a.createElement("ul",null)))}function _(t){const e=[];for(const t of Object(i.c)())e.push(t.hostname);return r.a.createElement(o.a,{open:t.open,onClose:t.onClose},r.a.createElement(r.a.Fragment,null,r.a.createElement(d.a,null,"Welcome to the file diagnostic! If your save file is really big it's likely because you have too many text/scripts. This tool can help you narrow down where they are."),e.map(t=>r.a.createElement(k,{key:t,hostname:t}))))}},,,function(t,e,n){"use strict";n.d(e,"a",(function(){return k}));var a=n(0),r=n.n(a),i=n(38),o=n(8),s=n(356),l=n(1),c=n(45),f=n(76),u=n(464),m=n.n(u),h=n(467),d=n.n(h),p=n(170),g=n(6),y=n(401),b=n(21);function E({value:t,onChange:e,refreshId:n}){const[i,o]=Object(a.useState)(),[s,l]=Object(a.useState)(t);function c(t){l(t),o(t?"":"Must have a value")}return Object(a.useEffect)(()=>e(s,i),[s]),Object(a.useEffect)(()=>c(t),[n]),r.a.createElement(f.a,{sx:{my:1},label:"Font-Family",error:!!i,value:s,helperText:i,onChange:function(t){c(t.target.value)},fullWidth:!0})}function v({value:t,onChange:e,refreshId:n}){const[i,o]=Object(a.useState)(),[s,l]=Object(a.useState)(t);function c(t){l(t),t?isNaN(Number(t))?o("Must be a number"):o(""):o("Must have a value")}return Object(a.useEffect)(()=>e(s,i),[s]),Object(a.useEffect)(()=>c(t),[n]),r.a.createElement(f.a,{sx:{my:1},label:"Line Height",error:!!i,value:s,helperText:i,onChange:function(t){c(t.target.value)}})}function k(t){const[e,n]=Object(a.useState)(0),[f,u]=Object(a.useState)(),[h,k]=Object(a.useState)({...g.a.styles});function _(t){Object.assign(g.a.styles,t),p.b.emit()}function w(t,e){u(e),e||k(t)}return r.a.createElement(i.a,{open:t.open,onClose:t.onClose},r.a.createElement(l.a,{variant:"h6"},"Styles Editor"),r.a.createElement(l.a,null,"WARNING: Changing styles ",r.a.createElement("strong",null,"may mess up")," the interface. Drastic changes are"," ",r.a.createElement("strong",null,"NOT recommended"),"."),r.a.createElement(c.a,{sx:{p:2,my:2}},r.a.createElement(E,{value:h.fontFamily,refreshId:e,onChange:(t,e)=>w({...h,fontFamily:t},e)}),r.a.createElement("br",null),r.a.createElement(v,{value:h.lineHeight,refreshId:e,onChange:(t,e)=>w({...h,lineHeight:t},e)}),r.a.createElement("br",null),r.a.createElement(s.a,{sx:{my:1}},r.a.createElement(o.a,{onClick:function(){const t={...y.a};k(t),_(t),n(e+1)},startIcon:r.a.createElement(m.a,null),color:"secondary",variant:"outlined"},"Revert to Defaults"),r.a.createElement(b.a,{title:"Save styles to settings"},r.a.createElement(o.a,{onClick:function(){_(h)},endIcon:r.a.createElement(d.a,null),color:f?"error":"primary",disabled:!!f},"Save Modifications")))))}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return x}));var a=n(0),r=n.n(a),i=n(38),o=n(8),s=n(356),l=n(1),c=n(21),f=n(45),u=n(76),m=n(111),h=n(464),d=n.n(h),p=n(632),g=n.n(p),y=n(1283),b=n.n(y),E=n(623),v=n(170),k=n(6),_=n(337),w=n(631);function S({name:t,onColorChange:e,color:n,defaultColor:a}){return void 0===n&&(console.error(`color ${t} was undefined, reverting to default`),n=a),r.a.createElement(r.a.Fragment,null,r.a.createElement(u.a,{sx:{mx:1},label:t,value:n,InputProps:{startAdornment:r.a.createElement(r.a.Fragment,null,r.a.createElement(E.a,{hideTextfield:!0,deferred:!0,value:n,onChange:n=>e(t,"#"+n.hex),disableAlpha:!0})),endAdornment:r.a.createElement(r.a.Fragment,null,r.a.createElement(m.a,{onClick:()=>e(t,a)},r.a.createElement(d.a,{color:"primary"})))}}))}function x(t){const[e,n]=Object(a.useState)({...k.a.theme});function m(t,e){n(n=>(n[t]=e,n)),k.a.theme[t]=e,v.b.emit()}function h(t){!function(t){n(t),Object.assign(k.a.theme,t),v.b.emit()}(t)}return r.a.createElement(i.a,{open:t.open,onClose:t.onClose},r.a.createElement(f.a,{sx:{px:1,py:1,my:1}},r.a.createElement(c.a,{open:!0,placement:"top",title:r.a.createElement(l.a,null,"Example tooltip")},r.a.createElement(o.a,{color:"primary",size:"small"},"primary button")),r.a.createElement(o.a,{color:"secondary",size:"small"},"secondary button"),r.a.createElement(o.a,{color:"warning",size:"small"},"warning button"),r.a.createElement(o.a,{color:"info",size:"small"},"info button"),r.a.createElement(o.a,{color:"error",size:"small"},"error button"),r.a.createElement(o.a,{disabled:!0,size:"small"},"disabled button"),r.a.createElement("br",null),r.a.createElement(l.a,{color:"primary",variant:"caption"},"text with primary color")," ",r.a.createElement(l.a,{color:"secondary",variant:"caption"},"text with secondary color")," ",r.a.createElement(l.a,{color:"error",variant:"caption"},"text with error color"),r.a.createElement("br",null),r.a.createElement(u.a,{value:"Text field",size:"small"})),r.a.createElement(f.a,{sx:{py:1,my:1}},r.a.createElement(S,{name:"primarylight",onColorChange:m,color:e.primarylight,defaultColor:k.b.theme.primarylight}),r.a.createElement(S,{name:"primary",onColorChange:m,color:e.primary,defaultColor:k.b.theme.primary}),r.a.createElement(S,{name:"primarydark",onColorChange:m,color:e.primarydark,defaultColor:k.b.theme.primarydark}),r.a.createElement("br",null),r.a.createElement(S,{name:"successlight",onColorChange:m,color:e.successlight,defaultColor:k.b.theme.successlight}),r.a.createElement(S,{name:"success",onColorChange:m,color:e.success,defaultColor:k.b.theme.success}),r.a.createElement(S,{name:"successdark",onColorChange:m,color:e.successdark,defaultColor:k.b.theme.successdark}),r.a.createElement("br",null),r.a.createElement(S,{name:"errorlight",onColorChange:m,color:e.errorlight,defaultColor:k.b.theme.errorlight}),r.a.createElement(S,{name:"error",onColorChange:m,color:e.error,defaultColor:k.b.theme.error}),r.a.createElement(S,{name:"errordark",onColorChange:m,color:e.errordark,defaultColor:k.b.theme.errordark}),r.a.createElement("br",null),r.a.createElement(S,{name:"secondarylight",onColorChange:m,color:e.secondarylight,defaultColor:k.b.theme.secondarylight}),r.a.createElement(S,{name:"secondary",onColorChange:m,color:e.secondary,defaultColor:k.b.theme.secondary}),r.a.createElement(S,{name:"secondarydark",onColorChange:m,color:e.secondarydark,defaultColor:k.b.theme.secondarydark}),r.a.createElement("br",null),r.a.createElement(S,{name:"warninglight",onColorChange:m,color:e.warninglight,defaultColor:k.b.theme.warninglight}),r.a.createElement(S,{name:"warning",onColorChange:m,color:e.warning,defaultColor:k.b.theme.warning}),r.a.createElement(S,{name:"warningdark",onColorChange:m,color:e.warningdark,defaultColor:k.b.theme.warningdark}),r.a.createElement("br",null),r.a.createElement(S,{name:"infolight",onColorChange:m,color:e.infolight,defaultColor:k.b.theme.infolight}),r.a.createElement(S,{name:"info",onColorChange:m,color:e.info,defaultColor:k.b.theme.info}),r.a.createElement(S,{name:"infodark",onColorChange:m,color:e.infodark,defaultColor:k.b.theme.infodark}),r.a.createElement("br",null),r.a.createElement(S,{name:"welllight",onColorChange:m,color:e.welllight,defaultColor:k.b.theme.welllight}),r.a.createElement(S,{name:"well",onColorChange:m,color:e.well,defaultColor:k.b.theme.well}),r.a.createElement(S,{name:"white",onColorChange:m,color:e.white,defaultColor:k.b.theme.white}),r.a.createElement(S,{name:"black",onColorChange:m,color:e.black,defaultColor:k.b.theme.black}),r.a.createElement(S,{name:"backgroundprimary",onColorChange:m,color:e.backgroundprimary,defaultColor:k.b.theme.backgroundprimary}),r.a.createElement(S,{name:"backgroundsecondary",onColorChange:m,color:e.backgroundsecondary,defaultColor:k.b.theme.backgroundsecondary}),r.a.createElement(S,{name:"button",onColorChange:m,color:e.button,defaultColor:k.b.theme.button}),r.a.createElement("br",null),r.a.createElement(S,{name:"hp",onColorChange:m,color:e.hp,defaultColor:k.b.theme.hp}),r.a.createElement(S,{name:"money",onColorChange:m,color:e.money,defaultColor:k.b.theme.money}),r.a.createElement(S,{name:"hack",onColorChange:m,color:e.hack,defaultColor:k.b.theme.hack}),r.a.createElement(S,{name:"combat",onColorChange:m,color:e.combat,defaultColor:k.b.theme.combat}),r.a.createElement(S,{name:"cha",onColorChange:m,color:e.cha,defaultColor:k.b.theme.cha}),r.a.createElement(S,{name:"int",onColorChange:m,color:e.int,defaultColor:k.b.theme.int}),r.a.createElement(S,{name:"rep",onColorChange:m,color:e.rep,defaultColor:k.b.theme.rep}),r.a.createElement(S,{name:"disabled",onColorChange:m,color:e.disabled,defaultColor:k.b.theme.disabled})),r.a.createElement(f.a,{sx:{px:1,py:1,my:1}},r.a.createElement(u.a,{sx:{mb:1},multiline:!0,fullWidth:!0,maxRows:10,label:"import / export theme",value:JSON.stringify(e,void 0,2),onChange:function(t){try{const e=JSON.parse(t.target.value);if("object"!=typeof e)return;n(e);for(const t of Object.keys(e))k.a.theme[t]=e[t];v.b.emit()}catch(t){}}}),r.a.createElement(r.a.Fragment,null,r.a.createElement(l.a,{sx:{my:1}},"Backup your theme or share it with others by copying the string above."),r.a.createElement(w.a,null),r.a.createElement(s.a,null,r.a.createElement(c.a,{title:"Reverts all modification back to the default theme. This is permanent."},r.a.createElement(o.a,{onClick:()=>h(_.a),startIcon:r.a.createElement(b.a,null)},"Revert to Default")),r.a.createElement(c.a,{title:"Move over to the theme browser's page to use one of our predefined themes."},r.a.createElement(o.a,{startIcon:r.a.createElement(g.a,null),onClick:()=>t.router.toThemeBrowser()},"See more themes"))))))}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var a=n(0),r=n.n(a),i=n(249),o=n(1),s=n(8),l=n(19),c=n(29),f=n(1287),u=n(1294);function m(){const t=c.b.Player(),[e,n]=Object(a.useState)(!1),m=Object(a.useState)(!1)[1];function h(){m(t=>!t)}return Object(a.useEffect)(()=>{const t=setInterval(h,200);return()=>clearInterval(t)},[]),r.a.createElement(r.a.Fragment,null,r.a.createElement(i.a,{disableGutters:!0,maxWidth:"md",sx:{mx:0}},r.a.createElement(o.a,{variant:"h4"},"Sleeves"),r.a.createElement(o.a,null,"Duplicate Sleeves are MK-V Synthoids (synthetic androids) into which your consciousness has been copied. In other words, these Synthoids contain a perfect duplicate of your mind.",r.a.createElement("br",null),r.a.createElement("br",null),"Sleeves can be used to perform different tasks synchronously.",r.a.createElement("br",null),r.a.createElement("br",null))),r.a.createElement(s.a,{onClick:()=>n(!0)},"FAQ"),r.a.createElement(s.a,{href:"https://bitburner.readthedocs.io/en/latest/advancedgameplay/sleeves.html#duplicate-sleeves",target:"_blank"},"Wiki Documentation"),r.a.createElement(l.a,{display:"grid",sx:{gridTemplateColumns:"repeat(2, 1fr)",mt:1}},t.sleeves.map((t,e)=>r.a.createElement(f.a,{key:e,rerender:h,sleeve:t}))),r.a.createElement(u.a,{open:e,onClose:()=>n(!1)}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return w}));var a=n(45),r=n(19),i=n(8),o=n(21),s=n(1),l=n(0),c=n.n(l),f=n(10),u=n(86),m=n(188),h=n(29),d=n(5),p=n(413),g=n(66),y=n(1288),b=n(1289),E=n(1290),v=n(782),k=n(1292),_=n(1293);function w(t){const e=h.b.Player(),[n,w]=Object(l.useState)(!1),[S,x]=Object(l.useState)(!1),[C,L]=Object(l.useState)(!1),[O,M]=Object(l.useState)(!1),[T,A]=Object(l.useState)(["------","------","------"]);let R=c.a.createElement(c.a.Fragment,null);switch(t.sleeve.currentTask){case g.a.Idle:R=c.a.createElement(c.a.Fragment,null,"This sleeve is currently idle");break;case g.a.Company:R=c.a.createElement(c.a.Fragment,null,"This sleeve is currently working your job at ",t.sleeve.currentTaskLocation,".");break;case g.a.Faction:{let e="nothing";switch(t.sleeve.factionWorkType){case m.a.Field:e="Field work";break;case m.a.Hacking:e="Hacking contracts";break;case m.a.Security:e="Security work"}R=c.a.createElement(c.a.Fragment,null,"This sleeve is currently doing ",e," for ",t.sleeve.currentTaskLocation,".");break}case g.a.Crime:{const e=Object.values(u.a).find(e=>e.name===t.sleeve.crimeType);if(!e)throw new Error("crime should not be undefined");R=c.a.createElement(c.a.Fragment,null,"This sleeve is currently attempting to ",e.type," (Success Rate:"," ",d.a.formatPercentage(e.successRate(t.sleeve)),").");break}case g.a.Class:R=c.a.createElement(c.a.Fragment,null,"This sleeve is currently studying/taking a course at ",t.sleeve.currentTaskLocation,".");break;case g.a.Gym:R=c.a.createElement(c.a.Fragment,null,"This sleeve is currently working out at ",t.sleeve.currentTaskLocation,".");break;case g.a.Bladeburner:{let e="";"------"!==t.sleeve.bbContract?e=` - ${t.sleeve.bbContract} (Success Rate: ${t.sleeve.currentTaskLocation})`:""!==t.sleeve.currentTaskLocation&&(e=t.sleeve.currentTaskLocation),R=c.a.createElement(c.a.Fragment,null,"This sleeve is currently attempting to ",t.sleeve.bbAction,". ",e);break}case g.a.Recovery:R=c.a.createElement(c.a.Fragment,null,"This sleeve is currently set to focus on shock recovery. This causes the Sleeve's shock to decrease at a faster rate.");break;case g.a.Synchro:R=c.a.createElement(c.a.Fragment,null,"This sleeve is currently set to synchronize with the original consciousness. This causes the Sleeve's synchronization to increase.");break;default:console.error("Invalid/Unrecognized taskValue in updateSleeveTaskDescription(): "+T[0])}return c.a.createElement(c.a.Fragment,null,c.a.createElement(a.a,{sx:{p:1,display:"grid",gridTemplateColumns:"1fr 1fr",width:"auto",gap:1}},c.a.createElement("span",null,c.a.createElement(v.b,{sleeve:t.sleeve}),c.a.createElement(r.a,{display:"grid",sx:{gridTemplateColumns:"1fr 1fr",width:"100%"}},c.a.createElement(i.a,{onClick:()=>w(!0)},"More Stats"),c.a.createElement(i.a,{onClick:()=>x(!0)},"More Earnings Info"),c.a.createElement(o.a,{title:e.moneyL(!0),disabled:e.moneyM(!0),disabled:t.sleeve.shock<100,sx:{width:"100%",height:"100%"}},"Manage Augmentations"))))),c.a.createElement("span",null,c.a.createElement(v.a,{sleeve:t.sleeve}),c.a.createElement(k.a,{player:e,sleeve:t.sleeve,setABC:A}),c.a.createElement(i.a,{onClick:function(){switch(t.sleeve.resetTaskStatus(e),T[0]){case"------":break;case"Work for Company":t.sleeve.workForCompany(e,T[1]);break;case"Work for Faction":t.sleeve.workForFaction(e,T[1],T[2]);break;case"Commit Crime":t.sleeve.commitCrime(e,T[1]);break;case"Take University Course":t.sleeve.takeUniversityCourse(e,T[2],T[1]);break;case"Workout at Gym":t.sleeve.workoutAtGym(e,T[2],T[1]);break;case"Perform Bladeburner Actions":t.sleeve.bladeburner(e,T[1],T[2]);break;case"Shock Recovery":t.sleeve.shockRecovery(e);break;case"Synchronize":t.sleeve.synchronize(e);break;default:console.error("Invalid/Unrecognized taskValue in setSleeveTask(): "+T[0])}t.rerender()},sx:{width:"100%"}},"Set Task"),c.a.createElement(s.a,null,R),c.a.createElement(s.a,null,(t.sleeve.currentTask===g.a.Crime||t.sleeve.currentTask===g.a.Bladeburner)&&t.sleeve.currentTaskMaxTime>0&&c.a.createElement(p.a,{variant:"determinate",value:t.sleeve.currentTaskTime/t.sleeve.currentTaskMaxTime*100,color:"primary"})))),c.a.createElement(b.a,{open:n,onClose:()=>w(!1),sleeve:t.sleeve}),c.a.createElement(y.a,{open:S,onClose:()=>x(!1),sleeve:t.sleeve}),c.a.createElement(_.a,{open:C,onClose:()=>L(!1),sleeve:t.sleeve,rerender:t.rerender}),c.a.createElement(E.a,{open:O,onClose:()=>M(!1),sleeve:t.sleeve}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(5),r=n(20),i=n(0),o=n(201),s=n(38);function l(t){return i.createElement(s.a,{open:t.open,onClose:t.onClose},i.createElement(o.a,{rows:[["Money ",i.createElement(r.a,{money:t.sleeve.earningsForTask.money})],["Hacking Exp ",a.a.formatExp(t.sleeve.earningsForTask.hack)],["Strength Exp ",a.a.formatExp(t.sleeve.earningsForTask.str)],["Defense Exp ",a.a.formatExp(t.sleeve.earningsForTask.def)],["Dexterity Exp ",a.a.formatExp(t.sleeve.earningsForTask.dex)],["Agility Exp ",a.a.formatExp(t.sleeve.earningsForTask.agi)],["Charisma Exp ",a.a.formatExp(t.sleeve.earningsForTask.cha)]],title:"Earnings for Current Task:"}),i.createElement("br",null),i.createElement(o.a,{rows:[["Money: ",i.createElement(r.a,{money:t.sleeve.earningsForPlayer.money})],["Hacking Exp: ",a.a.formatExp(t.sleeve.earningsForPlayer.hack)],["Strength Exp: ",a.a.formatExp(t.sleeve.earningsForPlayer.str)],["Defense Exp: ",a.a.formatExp(t.sleeve.earningsForPlayer.def)],["Dexterity Exp: ",a.a.formatExp(t.sleeve.earningsForPlayer.dex)],["Agility Exp: ",a.a.formatExp(t.sleeve.earningsForPlayer.agi)],["Charisma Exp: ",a.a.formatExp(t.sleeve.earningsForPlayer.cha)]],title:"Total Earnings for Host Consciousness:"}),i.createElement("br",null),i.createElement(o.a,{rows:[["Money: ",i.createElement(r.a,{money:t.sleeve.earningsForSleeves.money})],["Hacking Exp: ",a.a.formatExp(t.sleeve.earningsForSleeves.hack)],["Strength Exp: ",a.a.formatExp(t.sleeve.earningsForSleeves.str)],["Defense Exp: ",a.a.formatExp(t.sleeve.earningsForSleeves.def)],["Dexterity Exp: ",a.a.formatExp(t.sleeve.earningsForSleeves.dex)],["Agility Exp: ",a.a.formatExp(t.sleeve.earningsForSleeves.agi)],["Charisma Exp: ",a.a.formatExp(t.sleeve.earningsForSleeves.cha)]],title:"Total Earnings for Other Sleeves:"}),i.createElement("br",null))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var a=n(5),r=n(22),i=n(10),o=n(1),s=n(201),l=n(38),c=n(0),f=n.n(c);function u(t){return f.a.createElement(l.a,{open:t.open,onClose:t.onClose},f.a.createElement(s.a,{rows:[[f.a.createElement(f.a.Fragment,null,"Hacking: "),t.sleeve.hacking,f.a.createElement(f.a.Fragment,null," (",a.a.formatExp(t.sleeve.hacking_exp)," exp)")],[f.a.createElement(f.a.Fragment,null,"Strength: "),t.sleeve.strength,f.a.createElement(f.a.Fragment,null," (",a.a.formatExp(t.sleeve.strength_exp)," exp)")],[f.a.createElement(f.a.Fragment,null,"Defense: "),t.sleeve.defense,f.a.createElement(f.a.Fragment,null," (",a.a.formatExp(t.sleeve.defense_exp)," exp)")],[f.a.createElement(f.a.Fragment,null,"Dexterity: "),t.sleeve.dexterity,f.a.createElement(f.a.Fragment,null," (",a.a.formatExp(t.sleeve.dexterity_exp)," exp)")],[f.a.createElement(f.a.Fragment,null,"Agility: "),t.sleeve.agility,f.a.createElement(f.a.Fragment,null," (",a.a.formatExp(t.sleeve.agility_exp)," exp)")],[f.a.createElement(f.a.Fragment,null,"Charisma: "),t.sleeve.charisma,f.a.createElement(f.a.Fragment,null," (",a.a.formatExp(t.sleeve.charisma_exp)," exp)")]],title:"Stats:"}),f.a.createElement("br",null),f.a.createElement(s.a,{rows:[[f.a.createElement(f.a.Fragment,null,"Hacking Level multiplier: "),a.a.formatPercentage(t.sleeve.hacking_mult)],[f.a.createElement(f.a.Fragment,null,"Hacking Experience multiplier: "),a.a.formatPercentage(t.sleeve.hacking_exp_mult)],[f.a.createElement(f.a.Fragment,null,"Strength Level multiplier: "),a.a.formatPercentage(t.sleeve.strength_mult)],[f.a.createElement(f.a.Fragment,null,"Strength Experience multiplier: "),a.a.formatPercentage(t.sleeve.strength_exp_mult)],[f.a.createElement(f.a.Fragment,null,"Defense Level multiplier: "),a.a.formatPercentage(t.sleeve.defense_mult)],[f.a.createElement(f.a.Fragment,null,"Defense Experience multiplier: "),a.a.formatPercentage(t.sleeve.defense_exp_mult)],[f.a.createElement(f.a.Fragment,null,"Dexterity Level multiplier: "),a.a.formatPercentage(t.sleeve.dexterity_mult)],[f.a.createElement(f.a.Fragment,null,"Dexterity Experience multiplier: "),a.a.formatPercentage(t.sleeve.dexterity_exp_mult)],[f.a.createElement(f.a.Fragment,null,"Agility Level multiplier: "),a.a.formatPercentage(t.sleeve.agility_mult)],[f.a.createElement(f.a.Fragment,null,"Agility Experience multiplier: "),a.a.formatPercentage(t.sleeve.agility_exp_mult)],[f.a.createElement(f.a.Fragment,null,"Charisma Level multiplier: "),a.a.formatPercentage(t.sleeve.charisma_mult)],[f.a.createElement(f.a.Fragment,null,"Charisma Experience multiplier: "),a.a.formatPercentage(t.sleeve.charisma_exp_mult)],[f.a.createElement(f.a.Fragment,null,"Faction Reputation Gain multiplier: "),a.a.formatPercentage(t.sleeve.faction_rep_mult)],[f.a.createElement(f.a.Fragment,null,"Company Reputation Gain multiplier: "),a.a.formatPercentage(t.sleeve.company_rep_mult)],[f.a.createElement(f.a.Fragment,null,"Salary multiplier: "),a.a.formatPercentage(t.sleeve.work_money_mult)],[f.a.createElement(f.a.Fragment,null,"Crime Money multiplier: "),a.a.formatPercentage(t.sleeve.crime_money_mult)],[f.a.createElement(f.a.Fragment,null,"Crime Success multiplier: "),a.a.formatPercentage(t.sleeve.crime_success_mult)]],title:"Multipliers:"}),t.sleeve.storedCycles>10&&f.a.createElement(o.a,{sx:{py:2}},"Bonus Time: ",Object(r.d)(t.sleeve.storedCycles*i.a.MilliPerCycle)))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var a=n(249),r=n(45),i=n(1),o=n(0),s=n.n(o),l=n(636),c=n(29),f=n(38),u=n(600);function m(t){const e=c.b.Player(),n=Object(o.useState)(!1)[1];function m(){n(t=>!t)}Object(o.useEffect)(()=>{const t=setInterval(m,150);return()=>clearInterval(t)},[]);const h=t.sleeve.augmentations.map(t=>t.name),d=Object(u.a)(t.sleeve,e);return s.a.createElement(f.a,{open:t.open,onClose:t.onClose},s.a.createElement(a.a,{component:r.a,disableGutters:!0,maxWidth:"lg",sx:{mx:0,mb:1,p:1}},s.a.createElement(i.a,null,"You can purchase Augmentations for your Duplicate Sleeves. These Augmentations have the same effect as they would for you. You can only purchase Augmentations that you have unlocked through Factions.",s.a.createElement("br",null),s.a.createElement("br",null),"When purchasing an Augmentation for a Duplicate Sleeve, they are immediately installed. This means that the Duplicate Sleeve will immediately lose all of its stat experience.",s.a.createElement("br",null),s.a.createElement("br",null),"Augmentations will appear below as they become available.")),s.a.createElement(l.a,{augNames:d.map(t=>t.name),ownedAugNames:h,player:e,canPurchase:(t,e)=>t.money>e.baseCost,purchaseAugmentation:(e,n,a)=>{t.sleeve.tryBuyAugmentation(e,n),m()},sleeveAugs:!0}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var a=n(0),r=n.n(a),i=n(105),o=n(119),s=n(20),l=n(38),c=n(29),f=n(1),u=n(8);function m(t){if(void 0===t.aug||void 0===t.faction)return r.a.createElement(r.a.Fragment,null);const e=c.b.Player();return r.a.createElement(l.a,{open:t.open,onClose:t.onClose},r.a.createElement(f.a,{variant:"h4"},t.aug.name),r.a.createElement(f.a,null,t.aug.info,r.a.createElement("br",null),r.a.createElement("br",null),t.aug.stats,r.a.createElement("br",null),r.a.createElement("br",null),"Would you like to purchase the ",t.aug.name," Augmentation for ",r.a.createElement(s.a,{money:t.aug.getCost(e).moneyCost}),"?",r.a.createElement("br",null),r.a.createElement("br",null)),r.a.createElement(u.a,{autoFocus:!0,onClick:function(){!Object(o.g)(t.aug)&&e.hasAugmentation(t.aug)||(Object(i.f)(t.aug,t.faction),t.onClose())}},"Purchase"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return k}));var a=n(0),r=n.n(a),i=n(66),o=n(86),s=n(9),l=n(15),c=n(26),f=n(188),u=n(130),m=n(74),h=n(4);const d=["Study Computer Science","Data Structures","Networks","Algorithms","Management","Leadership"],p=["Train Strength","Train Defense","Train Dexterity","Train Agility"],g=["Field analysis","Recruitment","Diplomacy","Infiltrate synthoids","Support main sleeve","Take on contracts"];function y(t,e){const n=[];for(const a of t.sleeves)e!==a&&a.currentTask===i.a.Company&&n.push(a.currentTaskLocation);const a=Object.keys(t.jobs);for(let t=0;t{const e=c.a[t];if(!e)return!1;const n=e.getInfo();return n.offerHackingWork||n.offerFieldWork||n.offerSecurityWork})}const E={"------":()=>({first:["------"],second:()=>["------"]}),"Work for Company":(t,e)=>{let n=y(t,e);return 0===n.length&&(n=["------"]),{first:n,second:()=>["------"]}},"Work for Faction":(t,e)=>{let n=b(t,e);return 0===n.length&&(n=["------"]),{first:n,second:t=>{const e=c.a[t];if(!e)return["------"];const n=e.getInfo(),a=[];return n.offerHackingWork&&a.push("Hacking Contracts"),n.offerFieldWork&&a.push("Field Work"),n.offerSecurityWork&&a.push("Security Work"),a}}},"Commit Crime":()=>({first:Object.values(o.a).map(t=>t.name),second:()=>["------"]}),"Take University Course":(t,e)=>{let n=[];switch(e.city){case l.a.Aevum:n=[s.a.AevumSummitUniversity];break;case l.a.Sector12:n=[s.a.Sector12RothmanUniversity];break;case l.a.Volhaven:n=[s.a.VolhavenZBInstituteOfTechnology];break;default:n=["No university available in city!"]}return{first:d,second:()=>n}},"Workout at Gym":(t,e)=>{let n=[];switch(e.city){case l.a.Aevum:n=[s.a.AevumCrushFitnessGym,s.a.AevumSnapFitnessGym];break;case l.a.Sector12:n=[s.a.Sector12IronGym,s.a.Sector12PowerhouseGym];break;case l.a.Volhaven:n=[s.a.VolhavenMilleniumFitnessGym];break;default:n=["No gym available in city!"]}return{first:p,second:()=>n}},"Perform Bladeburner Actions":(t,e)=>({first:g,second:n=>"Take on contracts"===n?function(t,e){const n=t.bladeburner;if(null===n)return["------"];let a=n.getContractNamesNetscriptFn();for(const n of t.sleeves)e!==n&&n.currentTask===i.a.Bladeburner&&"Take on contracts"==n.bbAction&&(a=a.filter(t=>t!=n.bbContract));return 0===a.length?["------"]:a}(t,e):["------"]}),"Shock Recovery":()=>({first:["------"],second:()=>["------"]}),Synchronize:()=>({first:["------"],second:()=>["------"]})},v={"------":()=>!0,"Work for Company":(t,e)=>y(t,e).length>0,"Work for Faction":(t,e)=>b(t,e).length>0,"Commit Crime":()=>!0,"Take University Course":(t,e)=>[l.a.Aevum,l.a.Sector12,l.a.Volhaven].includes(e.city),"Workout at Gym":(t,e)=>[l.a.Aevum,l.a.Sector12,l.a.Volhaven].includes(e.city),"Perform Bladeburner Actions":(t,e)=>t.inBladeburner(),"Shock Recovery":(t,e)=>e.shock<100,Synchronize:(t,e)=>e.sync<100};function k(t){const e=function(t){switch(t.currentTask){case i.a.Idle:return["------","------","------"];case i.a.Company:return["Work for Company",t.currentTaskLocation,"------"];case i.a.Faction:{let e="";switch(t.factionWorkType){case f.a.Hacking:e="Hacking Contracts";break;case f.a.Field:e="Field Work";break;case f.a.Security:e="Security Work"}return["Work for Faction",t.currentTaskLocation,e]}case i.a.Crime:return["Commit Crime",t.crimeType,"------"];case i.a.Class:return["Take University Course",t.className,t.currentTaskLocation];case i.a.Gym:return["Workout at Gym",t.gymStatType,t.currentTaskLocation];case i.a.Bladeburner:return["Perform Bladeburner Actions",t.bbAction,t.bbContract];case i.a.Recovery:return["Shock Recovery","------","------"];case i.a.Synchro:return["Synchronize","------","------"]}}(t.sleeve),[n,o]=Object(a.useState)(e[0]),[s,l]=Object(a.useState)(e[1]),[c,h]=Object(a.useState)(e[2]),d=Object.keys(v).filter(e=>v[e](t.player,t.sleeve)),p=E[n];if(void 0===p)throw new Error(`No function for task '${n}'`);const g=p(t.player,t.sleeve),y=g.second(s);return g.first.length>0&&!g.first.includes(s)&&(l(g.first[0]),t.setABC([n,g.first[0],c])),y.length>0&&!y.includes(c)&&(h(y[0]),t.setABC([n,s,y[0]])),r.a.createElement(r.a.Fragment,null,r.a.createElement(u.a,{onChange:function(e){var a;const r=e.target.value,i=E[r];if(void 0===i)throw new Error(`No function for task '${n}'`);const s=i(t.player,t.sleeve),c=null!==(a=s.second(s.first[0]))&&void 0!==a?a:["------"];h(c[0]),l(s.first[0]),o(r),t.setABC([r,s.first[0],c[0]])},value:n,sx:{width:"100%"}},d.map(t=>r.a.createElement(m.a,{key:t,value:t},t))),!(1===g.first.length&&"------"===g.first[0])&&r.a.createElement(r.a.Fragment,null,r.a.createElement(u.a,{onChange:function(e){l(e.target.value),t.setABC([n,e.target.value,c])},value:s,sx:{width:"100%"}},g.first.map(t=>r.a.createElement(m.a,{key:t,value:t},t)))),!(1===y.length&&"------"===y[0])&&r.a.createElement(r.a.Fragment,null,r.a.createElement(u.a,{onChange:function(e){h(e.target.value),t.setABC([n,s,e.target.value])},value:c,sx:{width:"100%"}},y.map(t=>r.a.createElement(m.a,{key:t,value:t},t)))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var a=n(0),r=n.n(a),i=n(10),o=n(20),s=n(465),l=n(15),c=n(6),f=n(14),u=n(29),m=n(38),h=n(1),d=n(8);function p(t){const e=u.b.Player();function n(n){e.canAfford(i.a.TravelCost)||Object(f.a)("You cannot afford to have this sleeve travel to another city"),t.sleeve.city=n,e.loseMoney(i.a.TravelCost,"sleeve"),t.sleeve.resetTaskStatus(e),t.rerender(),t.onClose()}return r.a.createElement(m.a,{open:t.open,onClose:t.onClose},r.a.createElement(r.a.Fragment,null,r.a.createElement(h.a,null,"Have this sleeve travel to a different city. This affects the gyms and universities at which this sleeve can study. Traveling to a different city costs ",r.a.createElement(o.a,{money:i.a.TravelCost,player:e}),". It will also set your current sleeve task to idle."),c.a.DisableASCIIArt?Object.values(l.a).map(t=>r.a.createElement(d.a,{key:t,onClick:()=>n(t)},t)):r.a.createElement(s.a,{currentCity:t.sleeve.city,onTravel:t=>n(t)})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(0),r=n.n(a),i=n(38),o=n(1),s=n(4);function l({open:t,onClose:e}){return r.a.createElement(i.a,{open:t,onClose:e},r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,{variant:"h4"},"How do Duplicate Sleeves work?"),r.a.createElement("br",null),r.a.createElement(o.a,null,"Duplicate Sleeves are essentially clones. You can use them to perform any work type action, such as working for a company/faction or committing a crime. Having sleeves perform these tasks earns you money, experience, and reputation."),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(o.a,null,"Sleeves are their own individuals, which means they each have their own experience and stats."),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(o.a,null,"When a sleeve earns experience, it earns experience for itself, the player's original 'consciousness', as well as all of the player's other sleeves."),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(o.a,{variant:"h4"},"What is Synchronization (Sync)?"),r.a.createElement("br",null),r.a.createElement(o.a,null,"Synchronization is a measure of how aligned your consciousness is with that of your Duplicate Sleeves. It is a numerical value between 1 and 100, and it affects how much experience is earned when the sleeve is performing a task."),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(o.a,null,"Let N be the sleeve's synchronization. When the sleeve earns experience by performing a task, both the sleeve and the player's original host consciousness earn N% of the amount of experience normally earned by the task. All of the player's other sleeves earn ((N/100)^2 * 100)% of the experience."),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(o.a,null,"Synchronization can be increased by assigning sleeves to the 'Synchronize' task."),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(o.a,{variant:"h4"},"What is Shock?"),r.a.createElement("br",null),r.a.createElement(o.a,null,"Sleeve shock is a measure of how much trauma the sleeve has due to being placed in a new body. It is a numerical value between 0 and 99, where 99 indicates full shock and 0 indicates no shock. Shock affects the amount of experience earned by the sleeve."),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(o.a,null,"Sleeve shock slowly decreases over time. You can further increase the rate at which it decreases by assigning sleeves to the 'Shock Recovery' task."),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(o.a,{variant:"h4"},"Why can't I work for this company or faction?"),r.a.createElement("br",null),r.a.createElement(o.a,null,"Only one of your sleeves can work for a given company/faction a time. To clarify further, if you have two sleeves they can work for two different companies, but they cannot both work for the same company."),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(o.a,{variant:"h4"},"Why did my Sleeve stop working?"),r.a.createElement("br",null),r.a.createElement(o.a,null,"Sleeves are subject to the same time restrictions as you. This means that they automatically stop working at a company after 8 hours, and stop working for a faction after 20 hours."),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(o.a,{variant:"h4"},"How do I buy Augmentations for my Sleeves?"),r.a.createElement("br",null),r.a.createElement(o.a,null,"Your Sleeve needs to have a Shock of 0 in order for you to buy Augmentations for it."),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(o.a,{variant:"h4"},"Why can't I buy the X Augmentation for my sleeve?"),r.a.createElement("br",null),r.a.createElement(o.a,null,"Certain Augmentations, like ",s.a.Bladeburners,"-specific ones and NeuroFlux Governor, are not available for sleeves."),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(o.a,{variant:"h4"},"Do sleeves get reset when installing Augmentations or switching BitNodes?"),r.a.createElement("br",null),r.a.createElement(o.a,null,"Sleeves are reset when switching BitNodes, but not when installing Augmentations."),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(o.a,{variant:"h4"},"What is Memory?"),r.a.createElement("br",null),r.a.createElement(o.a,null,"Sleeve memory dictates what a sleeve's synchronization will be when its reset by switching BitNodes. For example, if a sleeve has a memory of 25, then when you switch BitNodes its synchronization will initially be set to 25, rather than 1."),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(o.a,null,"Memory can only be increased by purchasing upgrades from ",s.a.TheCovenant,". It is a persistent stat, meaning it never gets resets back to 1. The maximum possible value for a sleeve's memory is 100.")))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return k}));var a=n(0),r=n.n(a),i=n(1296),o=n(1297),s=n(1298),l=n(223),c=n(92),f=n(1299),u=n(1301),m=n(1302),h=n(1303),d=n(41),p=n(56),g=n(24),y=n(1),b=n(278),E=n(8),v=n(19);function k(t){const[e,n]=Object(a.useState)(!1),k=Object(a.useState)(!1)[1];function _(){k(t=>!t)}const[w,S]=Object(a.useState)(d.c.x1);Object(a.useEffect)(()=>{const t=setInterval(_,200);return()=>clearInterval(t)},[]);let x,C=0;for(let e=0;eS(d.c.x1),()=>S(d.c.x5),()=>S(d.c.x10),()=>S(d.c.MAX)],O=t.player.hacknetNodes.map(e=>{if(Object(p.g)(t.player)){if(e instanceof l.a)throw new Error("node was hacknet node");const n=Object(g.d)(e);if(null==n)throw new Error("Could not find Hacknet Server object in AllServers map for IP: "+e);if(!(n instanceof c.a))throw new Error("node was not hacknet server");return r.a.createElement(s.a,{player:t.player,key:n.hostname,node:n,purchaseMultiplier:w,rerender:_})}if("string"==typeof e)throw new Error("node was ip string");return r.a.createElement(o.a,{player:t.player,key:e.name,node:e,purchaseMultiplier:w,rerender:_})});return r.a.createElement(r.a.Fragment,null,r.a.createElement(y.a,{variant:"h4"},"Hacknet ",Object(p.g)(t.player)?"Servers":"Nodes"),r.a.createElement(i.a,{hasHacknetServers:Object(p.g)(t.player)}),r.a.createElement(h.a,{cost:x,multiplier:w,onClick:function(){Object(p.l)(t.player),_()}}),r.a.createElement("br",null),r.a.createElement(b.a,{container:!0,spacing:2},r.a.createElement(b.a,{item:!0,xs:6},r.a.createElement(m.a,{totalProduction:C,player:t.player})),r.a.createElement(b.a,{item:!0,xs:6},r.a.createElement(u.a,{onClicks:L,purchaseMultiplier:w}))),Object(p.g)(t.player)&&r.a.createElement(E.a,{onClick:()=>n(!0)},"Spend Hashes on Upgrades"),r.a.createElement(v.a,{sx:{display:"grid",width:"fit-content",gridTemplateColumns:"repeat(3, 1fr)"}},O),r.a.createElement(f.a,{open:e,onClose:()=>n(!1)}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var a=n(0),r=n.n(a),i=n(1);function o(t){return r.a.createElement(r.a.Fragment,null,r.a.createElement(i.a,null,"The Hacknet is a global, decentralized network of machines. It is used by hackers all around the world to anonymously share computing power and perform distributed cyberattacks without the fear of being traced."),t.hasHacknetServers?r.a.createElement(r.a.Fragment,null,r.a.createElement(i.a,null,"Here, you can purchase a Hacknet Server, an upgraded version of the Hacknet Node. Hacknet Servers will perform computations and operations on the network, earning you hashes. Hashes can be spent on a variety of different upgrades."),r.a.createElement(i.a,null,"Hacknet Servers can also be used as servers to run scripts. However, running scripts on a server will reduce its hash rate (hashes generated per second). A Hacknet Server's hash rate will be reduced by the percentage of RAM that is being used by that Server to run scripts.")):r.a.createElement(r.a.Fragment,null,r.a.createElement(i.a,null,"Here, you can purchase a Hacknet Node, a specialized machine that can connect and contribute its resources to the Hacknet network. This allows you to take a small percentage of profits from hacks performed on the network. Essentially, you are renting out your Node's computing power."),r.a.createElement(i.a,null,"Each Hacknet Node you purchase will passively earn you money. Each Hacknet Node can be upgraded in order to increase its computing power and thereby increase the profit you earn from it.")))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return v}));var a=n(0),r=n.n(a),i=n(41),o=n(56),s=n(20),l=n(112),c=n(1),f=n(278),u=n(45),m=n(8),h=n(78),d=n(149),p=n(148),g=n(50),y=n(21),b=n(5),E=n(211);function v(t){const e=t.node,n=t.purchaseMultiplier,a=t.rerender;let v,k,_;if(e.level>=i.a.MaxLevel)v=r.a.createElement(m.a,{disabled:!0},"MAX LEVEL");else{let f=0;if("MAX"===n)f=Object(o.e)(t.player,e,i.a.MaxLevel);else{const t=i.a.MaxLevel-e.level;f=Math.min(t,n)}const u=Object(E.c)(e.level+f,e.ram,e.cores,t.player.hacknet_node_money_mult)-e.moneyGainRatePerSecond,h=e.calculateLevelUpgradeCost(f,t.player.hacknet_node_level_cost_mult);v=r.a.createElement(y.a,{title:r.a.createElement(c.a,null,"+",r.a.createElement(l.a,{money:u}))},r.a.createElement(m.a,{onClick:function(){const r="MAX"===n?Object(o.e)(t.player,e,i.a.MaxLevel):n;Object(o.n)(t.player,e,r),a()}},"+",f," - ",r.a.createElement(s.a,{money:h,player:t.player})))}if(e.ram>=i.a.MaxRam)k=r.a.createElement(m.a,{disabled:!0},"MAX RAM");else{let f=0;if("MAX"===n)f=Object(o.f)(t.player,e,i.a.MaxRam);else{const t=Math.round(Math.log2(i.a.MaxRam/e.ram));f=Math.min(t,n)}const u=Object(E.c)(e.level,e.ram*Math.pow(2,f),e.cores,t.player.hacknet_node_money_mult)-e.moneyGainRatePerSecond,h=e.calculateRamUpgradeCost(f,t.player.hacknet_node_ram_cost_mult);k=r.a.createElement(y.a,{title:r.a.createElement(c.a,null,"+",r.a.createElement(l.a,{money:u}))},r.a.createElement(m.a,{onClick:function(){const r="MAX"===n?Object(o.f)(t.player,e,i.a.MaxRam):n;Object(o.o)(t.player,e,r),a()}},"+",f," - ",r.a.createElement(s.a,{money:h,player:t.player})))}if(e.cores>=i.a.MaxCores)_=r.a.createElement(m.a,{disabled:!0},"MAX CORES");else{let f=0;if("MAX"===n)f=Object(o.d)(t.player,e,i.a.MaxCores);else{const t=i.a.MaxCores-e.cores;f=Math.min(t,n)}const u=Object(E.c)(e.level,e.ram,e.cores+f,t.player.hacknet_node_money_mult)-e.moneyGainRatePerSecond,h=e.calculateCoreUpgradeCost(f,t.player.hacknet_node_core_cost_mult);_=r.a.createElement(y.a,{title:r.a.createElement(c.a,null,"+",r.a.createElement(l.a,{money:u}))},r.a.createElement(m.a,{onClick:function(){const r="MAX"===n?Object(o.d)(t.player,e,i.a.MaxCores):n;Object(o.k)(t.player,e,r),a()}},"+",f," - ",r.a.createElement(s.a,{money:h,player:t.player})))}return r.a.createElement(f.a,{item:!0,component:u.a,p:1},r.a.createElement(p.a,{size:"small"},r.a.createElement(d.a,null,r.a.createElement(g.a,null,r.a.createElement(h.b,{colSpan:3},r.a.createElement(c.a,null,e.name))),r.a.createElement(g.a,null,r.a.createElement(h.b,null,r.a.createElement(c.a,null,"Production:")),r.a.createElement(h.b,{colSpan:2},r.a.createElement(c.a,null,r.a.createElement(s.a,{money:e.totalMoneyGenerated})," (",r.a.createElement(l.a,{money:e.moneyGainRatePerSecond}),")"))),r.a.createElement(g.a,null,r.a.createElement(h.b,null,r.a.createElement(c.a,null,"Level:")),r.a.createElement(h.b,null,r.a.createElement(c.a,null,e.level)),r.a.createElement(h.b,null,v)),r.a.createElement(g.a,null,r.a.createElement(h.b,null,r.a.createElement(c.a,null,"RAM:")),r.a.createElement(h.b,null,r.a.createElement(c.a,null,b.a.formatRAM(e.ram))),r.a.createElement(h.b,null,k)),r.a.createElement(g.a,null,r.a.createElement(h.b,null,r.a.createElement(c.a,null,"Cores:")),r.a.createElement(h.b,null,r.a.createElement(c.a,null,e.cores)),r.a.createElement(h.b,null,_)))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return k}));var a=n(0),r=n.n(a),i=n(41),o=n(56),s=n(20),l=n(222),c=n(289),f=n(1),u=n(278),m=n(45),h=n(8),d=n(78),p=n(149),g=n(148),y=n(50),b=n(5),E=n(156),v=n(21);function k(t){const e=t.node,n=t.purchaseMultiplier,a=t.rerender;let k,_,w,S;if(e.level>=i.b.MaxLevel)k=r.a.createElement(h.a,{disabled:!0},"MAX LEVEL");else{let l=0;if("MAX"===n)l=Object(o.e)(t.player,e,i.b.MaxLevel);else{const t=i.b.MaxLevel-e.level;l=Math.min(t,n)}const u=Object(E.c)(e.level+l,0,e.maxRam,e.cores,t.player.hacknet_node_money_mult)-Object(E.c)(e.level,0,e.maxRam,e.cores,t.player.hacknet_node_money_mult),m=u*(e.maxRam-e.ramUsed)/e.maxRam,d=e.calculateLevelUpgradeCost(l,t.player.hacknet_node_level_cost_mult);k=r.a.createElement(v.a,{title:r.a.createElement(f.a,null,"+",r.a.createElement(c.a,{hashes:m})," (effective increase, taking current RAM usage into account)",r.a.createElement("br",null),r.a.createElement("span",{style:{opacity:.5}},"+",r.a.createElement(c.a,{hashes:u}))," ","(base increase, attained when no script is running)")},r.a.createElement(h.a,{onClick:function(){let r=n;"MAX"===n&&(r=Object(o.e)(t.player,e,i.b.MaxLevel));Object(o.n)(t.player,e,r),a()}},"+",l," - ",r.a.createElement(s.a,{money:d,player:t.player})))}if(e.maxRam>=i.b.MaxRam)_=r.a.createElement(h.a,{disabled:!0},"MAX RAM");else{let l=0;if("MAX"===n)l=Object(o.f)(t.player,e,i.b.MaxRam);else{const t=Math.round(Math.log2(i.b.MaxRam/e.maxRam));l=Math.min(t,n)}const u=Object(E.c)(e.level,0,e.maxRam*Math.pow(2,l),e.cores,t.player.hacknet_node_money_mult)-Object(E.c)(e.level,0,e.maxRam,e.cores,t.player.hacknet_node_money_mult),m=Object(E.c)(e.level,e.ramUsed,e.maxRam*Math.pow(2,l),e.cores,t.player.hacknet_node_money_mult)-Object(E.c)(e.level,e.ramUsed,e.maxRam,e.cores,t.player.hacknet_node_money_mult),d=e.calculateRamUpgradeCost(l,t.player.hacknet_node_ram_cost_mult);_=r.a.createElement(v.a,{title:r.a.createElement(f.a,null,"+",r.a.createElement(c.a,{hashes:m})," (effective increase, taking current RAM usage into account)",r.a.createElement("br",null),r.a.createElement("span",{style:{opacity:.5}},"+",r.a.createElement(c.a,{hashes:u}))," ","(base increase, attained when no script is running)")},r.a.createElement(h.a,{onClick:function(){let r=n;"MAX"===n&&(r=Object(o.f)(t.player,e,i.b.MaxRam)),Object(o.o)(t.player,e,r),a()}},"+",l," - ",r.a.createElement(s.a,{money:d,player:t.player})))}if(e.cores>=i.b.MaxCores)w=r.a.createElement(h.a,{disabled:!0},"MAX CORES");else{let l=0;if("MAX"===n)l=Object(o.d)(t.player,e,i.b.MaxCores);else{const t=i.b.MaxCores-e.cores;l=Math.min(t,n)}const u=Object(E.c)(e.level,0,e.maxRam,e.cores+l,t.player.hacknet_node_money_mult)-Object(E.c)(e.level,0,e.maxRam,e.cores,t.player.hacknet_node_money_mult),m=u*(e.maxRam-e.ramUsed)/e.maxRam,d=e.calculateCoreUpgradeCost(l,t.player.hacknet_node_core_cost_mult);w=r.a.createElement(v.a,{title:r.a.createElement(f.a,null,"+",r.a.createElement(c.a,{hashes:m})," (effective increase, taking current RAM usage into account)",r.a.createElement("br",null),r.a.createElement("span",{style:{opacity:.5}},"+",r.a.createElement(c.a,{hashes:u}))," ","(base increase, attained when no script is running)")},r.a.createElement(h.a,{onClick:function(){let r=n;"MAX"===n&&(r=Object(o.d)(t.player,e,i.b.MaxCores)),Object(o.k)(t.player,e,r),a()}},"+",l," - ",r.a.createElement(s.a,{money:d,player:t.player})))}if(e.cache>=i.b.MaxCache)S=r.a.createElement(h.a,{disabled:!0},"MAX CACHE");else{let c=0;if("MAX"===n)c=Object(o.c)(t.player,e,i.b.MaxCache);else{const t=i.b.MaxCache-e.cache;c=Math.min(t,n)}const u=32*Math.pow(2,e.cache+c)-e.hashCapacity,m=e.calculateCacheUpgradeCost(c);S=r.a.createElement(v.a,{title:r.a.createElement(f.a,null,"+",r.a.createElement(l.a,{hashes:u})," hashes")},r.a.createElement(h.a,{onClick:function(){let r=n;"MAX"===n&&(r=Object(o.c)(t.player,e,i.b.MaxCache));Object(o.j)(t.player,e,r),a(),Object(o.p)(t.player)}},"+",c," - ",r.a.createElement(s.a,{money:m,player:t.player}))),t.player.money}return r.a.createElement(u.a,{item:!0,component:m.a,p:1},r.a.createElement(g.a,{size:"small"},r.a.createElement(p.a,null,r.a.createElement(y.a,null,r.a.createElement(d.b,null,r.a.createElement(f.a,null,e.hostname))),r.a.createElement(y.a,null,r.a.createElement(d.b,null,r.a.createElement(f.a,null,"Production:")),r.a.createElement(d.b,{colSpan:2},r.a.createElement(v.a,{title:r.a.createElement(f.a,null,r.a.createElement(l.a,{hashes:e.totalHashesGenerated})," hashes produced by this server since last augment installation.",r.a.createElement("br",null),r.a.createElement(c.a,{hashes:e.hashRate})," current production rate.",r.a.createElement("br",null),r.a.createElement("span",{style:{opacity:.5}},r.a.createElement(c.a,{hashes:e.hashRate*e.maxRam/(e.maxRam-e.ramUsed)}))," ","max production rate. (achieved when 100% RAM is allocated to it)",r.a.createElement("br",null),b.a.formatRAM(e.ramUsed)," / ",b.a.formatRAM(e.maxRam)," (",Math.round(100*e.ramUsed/e.maxRam),"%) RAM allocated to script.",r.a.createElement("br",null),b.a.formatRAM(e.maxRam-e.ramUsed)," / ",b.a.formatRAM(e.maxRam)," (",Math.round(100*(e.maxRam-e.ramUsed)/e.maxRam),"%) RAM allocated to hash production.")},r.a.createElement(f.a,null,r.a.createElement(l.a,{hashes:e.totalHashesGenerated})," (",r.a.createElement(c.a,{hashes:e.hashRate}),")")))),r.a.createElement(y.a,null,r.a.createElement(d.b,null,r.a.createElement(f.a,null,"Hash Capacity:")),r.a.createElement(d.b,{colSpan:2},r.a.createElement(f.a,null,r.a.createElement(l.a,{hashes:e.hashCapacity})))),r.a.createElement(y.a,null,r.a.createElement(d.b,null,r.a.createElement(f.a,null,"Level:")),r.a.createElement(d.b,null,r.a.createElement(f.a,null,e.level)),r.a.createElement(d.b,null,k)),r.a.createElement(y.a,null,r.a.createElement(d.b,null,r.a.createElement(f.a,null,"RAM:")),r.a.createElement(d.b,null,r.a.createElement(f.a,null,b.a.formatRAM(e.maxRam))),r.a.createElement(d.b,null,_)),r.a.createElement(y.a,null,r.a.createElement(d.b,null,r.a.createElement(f.a,null,"Cores:")),r.a.createElement(d.b,null,r.a.createElement(f.a,null,e.cores)),r.a.createElement(d.b,null,w)),r.a.createElement(y.a,null,r.a.createElement(d.b,null,r.a.createElement(f.a,null,"Cache Level:")),r.a.createElement(d.b,null,r.a.createElement(f.a,null,e.cache)),r.a.createElement(d.b,null,S)))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var a=n(0),r=n.n(a),i=n(377),o=n(241),s=n(222),l=n(1300),c=n(38),f=n(29),u=n(1);function m(t){const e=f.b.Player(),n=Object(a.useState)(!1)[1];function m(){n(t=>!t)}Object(a.useEffect)(()=>{const t=setInterval(()=>n(t=>!t),200);return()=>clearInterval(t)},[]);const h=e.hashManager;if(!(h instanceof i.a))throw new Error("Player does not have a HashManager)");return r.a.createElement(c.a,{open:t.open,onClose:t.onClose},r.a.createElement(r.a.Fragment,null,r.a.createElement(u.a,null,"Spend your hashes on a variety of different upgrades"),r.a.createElement(u.a,null,"Hashes: ",r.a.createElement(s.a,{hashes:e.hashManager.hashes})),Object.keys(o.a).map(t=>{const n=o.a[t];return r.a.createElement(l.a,{player:e,upg:n,hashManager:h,key:n.name,rerender:m})})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var a=n(0),r=n.n(a),i=n(56),o=n(783),s=n(14),l=n(166),c=n(222),f=n(1),u=n(45),m=n(8),h=n(4);const d={};function p(t){const[e,n]=Object(a.useState)(d[t.upg.name]?d[t.upg.name]:h.a.ECorp.toLowerCase());function p(){if(t.hashManager.hashes>=t.hashManager.getUpgradeCost(t.upg.name)){Object(i.m)(t.player,t.upg.name,e)||Object(s.a)("Failed to purchase upgrade. This may be because you do not have enough hashes, or because you do not have access to the feature upgrade affects."),t.rerender()}}const g=t.hashManager,y=t.upg,b=g.getUpgradeCost(y.name),E=g.upgrades[y.name],v=y.effectText(E),k=g.hashes>=b;return r.a.createElement(u.a,{sx:{p:1}},r.a.createElement(f.a,null,r.a.createElement(l.a,{value:y.name})),r.a.createElement(f.a,null,"Cost: ",r.a.createElement(c.a,{hashes:b}),", Bought: ",E," times"),r.a.createElement(f.a,null,y.desc),!y.hasTargetServer&&r.a.createElement(m.a,{onClick:p,disabled:!k},"Buy"),y.hasTargetServer&&r.a.createElement(o.a,{purchase:p,canPurchase:k,value:e,serverType:o.b.Foreign,onChange:function(e){n(e.target.value),d[t.upg.name]=e.target.value}}),E>0&&v&&r.a.createElement(f.a,null,v))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(0),r=n.n(a),i=n(41),o=n(8);function s(){return(s=Object.assign||function(t){for(var e=1;ee.specialName===t.name),x=Object(b.d)(S?S.hostname:""),C=null!==x&&Object(y.b)(x);return a.createElement(a.Fragment,null,a.createElement(i.a,{onClick:()=>e.toCity()},"Return to World"),a.createElement(r.a,{variant:"h4",sx:{mt:1}},C&&!g.a.DisableTextEffects?a.createElement(_.a,{title:`Backdoor installed on ${t.name}.`},a.createElement("span",null,a.createElement(E.a,{content:t.name}))):t.name),w)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return E}));var a=n(0),r=n.n(a),i=n(1),o=n(8),s=n(21),l=n(19),c=n(291),f=n(186),u=n(67),m=n(368),h=n(95),d=n(31),p=n(128),g=n(324),y=n(29),b=n(1307);function E(t){const e=y.b.Player(),n=y.b.Router(),[E,v]=Object(a.useState)(!1),k=Object(a.useState)(!1)[1];function _(){k(t=>!t)}Object(a.useEffect)(()=>{const t=setInterval(_,200);return()=>clearInterval(t)},[]);const w=u.a[t.locName];if(null==w)throw new Error("CompanyLocation component constructed with invalid company: "+t.locName);const S=f.a[t.locName];if(null==S)throw new Error("CompanyLocation component constructed with invalid location: "+t.locName);const x=e.jobs[t.locName]?e.jobs[t.locName]:null,C=x?h.a[x]:null;e.location=t.locName;const L=null!=x,O=w.getFavorGain();return r.a.createElement(r.a.Fragment,null,L&&r.a.createElement(r.a.Fragment,null,r.a.createElement(i.a,null,"Job Title: ",x),r.a.createElement(i.a,null,"-------------------------"),r.a.createElement(l.a,{display:"flex"},r.a.createElement(s.a,{title:r.a.createElement(r.a.Fragment,null,"You will have ",r.a.createElement(g.a,{favor:w.favor+O})," company favor upon resetting after installing Augmentations")},r.a.createElement(i.a,null,"Company reputation: ",r.a.createElement(p.a,{reputation:w.playerReputation})))),r.a.createElement(i.a,null,"-------------------------"),r.a.createElement(l.a,{display:"flex"},r.a.createElement(s.a,{title:r.a.createElement(r.a.Fragment,null,"Company favor increases the rate at which you earn reputation for this company by 1% per favor. Company favor is gained whenever you reset after installing Augmentations. The amount of favor you gain depends on how much reputation you have with the company.")},r.a.createElement(i.a,null,"Company Favor: ",r.a.createElement(g.a,{favor:w.favor})))),r.a.createElement(i.a,null,"-------------------------"),r.a.createElement("br",null)),r.a.createElement(l.a,{sx:{display:"grid",width:"fit-content"}},L&&r.a.createElement(l.a,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr"}},r.a.createElement(o.a,{onClick:function(a){if(!a.isTrusted)return;const r=C;r instanceof m.a&&(r.isPartTimeJob()||r.isSoftwareConsultantJob()||r.isBusinessConsultantJob()?e.startWorkPartTime(t.locName):e.startWork(t.locName),e.startFocusing(),n.toWork())}},"Work"),r.a.createElement(o.a,{onClick:()=>v(!0)},"Quit"),r.a.createElement(b.a,{locName:t.locName,company:w,onQuit:_,open:E,onClose:()=>v(!1)})),w.hasAgentPositions()&&r.a.createElement(c.a,{company:w,entryPosType:h.a[d.a[0]],onClick:function(t){t.isTrusted&&(e.applyForAgentJob(),_())},text:"Apply for Agent Job"}),w.hasBusinessConsultantPositions()&&r.a.createElement(c.a,{company:w,entryPosType:h.a[d.c[0]],onClick:function(t){t.isTrusted&&(e.applyForBusinessConsultantJob(),_())},text:"Apply for Business Consultant Job"}),w.hasBusinessPositions()&&r.a.createElement(c.a,{company:w,entryPosType:h.a[d.b[0]],onClick:function(t){t.isTrusted&&(e.applyForBusinessJob(),_())},text:"Apply for Business Job"}),w.hasEmployeePositions()&&r.a.createElement(c.a,{company:w,entryPosType:h.a[d.e[1]],onClick:function(t){t.isTrusted&&(e.applyForEmployeeJob(),_())},text:"Apply to be an Employee"}),w.hasEmployeePositions()&&r.a.createElement(c.a,{company:w,entryPosType:h.a[d.g[1]],onClick:function(t){t.isTrusted&&(e.applyForPartTimeEmployeeJob(),_())},text:"Apply to be a part-time Employee"}),w.hasITPositions()&&r.a.createElement(c.a,{company:w,entryPosType:h.a[d.d[0]],onClick:function(t){t.isTrusted&&(e.applyForItJob(),_())},text:"Apply for IT Job"}),w.hasSecurityPositions()&&r.a.createElement(c.a,{company:w,entryPosType:h.a[d.h[2]],onClick:function(t){t.isTrusted&&(e.applyForSecurityJob(),_())},text:"Apply for Security Job"}),w.hasSoftwareConsultantPositions()&&r.a.createElement(c.a,{company:w,entryPosType:h.a[d.k[0]],onClick:function(t){t.isTrusted&&(e.applyForSoftwareConsultantJob(),_())},text:"Apply for Software Consultant Job"}),w.hasSoftwarePositions()&&r.a.createElement(c.a,{company:w,entryPosType:h.a[d.j[0]],onClick:function(t){t.isTrusted&&(e.applyForSoftwareJob(),_())},text:"Apply for Software Job"}),w.hasWaiterPositions()&&r.a.createElement(c.a,{company:w,entryPosType:h.a[d.e[0]],onClick:function(t){t.isTrusted&&(e.applyForWaiterJob(),_())},text:"Apply to be a Waiter"}),w.hasWaiterPositions()&&r.a.createElement(c.a,{company:w,entryPosType:h.a[d.g[0]],onClick:function(t){t.isTrusted&&(e.applyForPartTimeWaiterJob(),_())},text:"Apply to be a part-time Waiter"}),null!=S.infiltrationData&&r.a.createElement(o.a,{onClick:function(e){if(!e.isTrusted)return;const a=S;if(!a.infiltrationData)throw new Error(`trying to start infiltration at ${t.locName} but the infiltrationData is null`);n.toInfiltration(a)}},"Infiltrate Company")))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(31);const r=[{name:a.j[0],nextPosition:a.j[1],baseSalary:33,charismaEffectiveness:15,charismaExpGain:.02,hackingEffectiveness:85,hackingExpGain:.05,reqdHacking:1,repMultiplier:.9},{name:a.j[1],nextPosition:a.j[2],baseSalary:80,charismaEffectiveness:15,charismaExpGain:.05,hackingEffectiveness:85,hackingExpGain:.1,reqdHacking:51,reqdReputation:8e3,repMultiplier:1.1},{name:a.j[2],nextPosition:a.j[3],baseSalary:165,charismaEffectiveness:20,charismaExpGain:.08,hackingEffectiveness:80,hackingExpGain:.4,reqdCharisma:51,reqdHacking:251,reqdReputation:4e4,repMultiplier:1.3},{name:a.j[3],nextPosition:a.j[4],baseSalary:500,charismaEffectiveness:25,charismaExpGain:.1,hackingEffectiveness:75,hackingExpGain:.8,reqdCharisma:151,reqdHacking:401,reqdReputation:2e5,repMultiplier:1.5},{name:a.j[4],nextPosition:a.j[5],baseSalary:800,charismaEffectiveness:25,charismaExpGain:.5,hackingEffectiveness:75,hackingExpGain:1,reqdCharisma:251,reqdHacking:501,reqdReputation:4e5,repMultiplier:1.6},{name:a.j[5],nextPosition:a.j[6],baseSalary:1650,charismaEffectiveness:25,charismaExpGain:.5,hackingEffectiveness:75,hackingExpGain:1.1,reqdCharisma:251,reqdHacking:501,reqdReputation:8e5,repMultiplier:1.6},{name:a.j[6],nextPosition:a.j[7],baseSalary:2310,charismaEffectiveness:30,charismaExpGain:.6,hackingEffectiveness:70,hackingExpGain:1.2,reqdCharisma:401,reqdHacking:601,reqdReputation:16e5,repMultiplier:1.75},{name:a.j[7],nextPosition:null,baseSalary:2640,charismaEffectiveness:35,charismaExpGain:1,hackingEffectiveness:65,hackingExpGain:1.5,reqdCharisma:501,reqdHacking:751,reqdReputation:32e5,repMultiplier:2},{name:a.d[0],nextPosition:a.d[1],baseSalary:26,charismaEffectiveness:10,charismaExpGain:.01,hackingEffectiveness:90,hackingExpGain:.04,reqdHacking:1,repMultiplier:.9},{name:a.d[1],nextPosition:a.d[2],baseSalary:66,charismaEffectiveness:15,charismaExpGain:.02,hackingEffectiveness:85,hackingExpGain:.08,reqdHacking:26,reqdReputation:7e3,repMultiplier:1.1},{name:a.d[2],nextPosition:a.d[3],baseSalary:132,charismaEffectiveness:20,charismaExpGain:.1,hackingEffectiveness:80,hackingExpGain:.3,reqdCharisma:51,reqdHacking:151,reqdReputation:35e3,repMultiplier:1.3},{name:a.d[3],nextPosition:a.j[5],baseSalary:410,charismaEffectiveness:20,charismaExpGain:.2,hackingEffectiveness:80,hackingExpGain:.5,reqdCharisma:76,reqdHacking:251,reqdReputation:175e3,repMultiplier:1.4},{name:a.i[0],nextPosition:a.j[5],baseSalary:121,charismaEffectiveness:15,charismaExpGain:.05,hackingEffectiveness:85,hackingExpGain:.4,reqdCharisma:26,reqdHacking:151,reqdReputation:35e3,repMultiplier:1.2},{name:a.f[0],nextPosition:a.f[1],baseSalary:121,charismaEffectiveness:15,charismaExpGain:.05,hackingEffectiveness:85,hackingExpGain:.4,reqdCharisma:26,reqdHacking:151,reqdReputation:35e3,repMultiplier:1.2},{name:a.f[1],nextPosition:a.j[5],baseSalary:410,charismaEffectiveness:20,charismaExpGain:.1,hackingEffectiveness:80,hackingExpGain:.5,reqdCharisma:76,reqdHacking:251,reqdReputation:175e3,repMultiplier:1.3},{name:a.b[0],nextPosition:a.b[1],baseSalary:46,charismaEffectiveness:90,charismaExpGain:.08,hackingEffectiveness:10,hackingExpGain:.01,reqdCharisma:1,reqdHacking:1,repMultiplier:.9},{name:a.b[1],nextPosition:a.b[2],baseSalary:100,charismaEffectiveness:85,charismaExpGain:.15,hackingEffectiveness:15,hackingExpGain:.02,reqdCharisma:51,reqdHacking:6,reqdReputation:8e3,repMultiplier:1.1},{name:a.b[2],nextPosition:a.b[3],baseSalary:200,charismaEffectiveness:85,charismaExpGain:.3,hackingEffectiveness:15,hackingExpGain:.02,reqdCharisma:101,reqdHacking:51,reqdReputation:4e4,repMultiplier:1.3},{name:a.b[3],nextPosition:a.b[4],baseSalary:660,charismaEffectiveness:85,charismaExpGain:.4,hackingEffectiveness:15,hackingExpGain:.02,reqdCharisma:226,reqdHacking:51,reqdReputation:2e5,repMultiplier:1.5},{name:a.b[4],nextPosition:a.b[5],baseSalary:1950,charismaEffectiveness:90,charismaExpGain:1,hackingEffectiveness:10,hackingExpGain:.05,reqdCharisma:501,reqdHacking:76,reqdReputation:8e5,repMultiplier:1.6},{name:a.b[5],nextPosition:null,baseSalary:3900,charismaEffectiveness:90,charismaExpGain:1.5,hackingEffectiveness:10,hackingExpGain:.05,reqdCharisma:751,reqdHacking:101,reqdReputation:32e5,repMultiplier:1.75},{name:a.h[0],nextPosition:a.h[1],baseSalary:82,hackingEffectiveness:5,strengthEffectiveness:20,defenseEffectiveness:20,dexterityEffectiveness:20,agilityEffectiveness:20,charismaEffectiveness:15,hackingExpGain:.02,strengthExpGain:.08,defenseExpGain:.08,dexterityExpGain:.08,agilityExpGain:.08,charismaExpGain:.04,reqdHacking:11,reqdStrength:101,reqdDefense:101,reqdDexterity:101,reqdAgility:101,reqdCharisma:51,reqdReputation:8e3,repMultiplier:1},{name:a.h[1],nextPosition:null,baseSalary:460,hackingEffectiveness:5,strengthEffectiveness:20,defenseEffectiveness:20,dexterityEffectiveness:20,agilityEffectiveness:20,charismaEffectiveness:15,hackingExpGain:.02,strengthExpGain:.1,defenseExpGain:.1,dexterityExpGain:.1,agilityExpGain:.1,charismaExpGain:.1,reqdHacking:101,reqdStrength:301,reqdDefense:301,reqdDexterity:301,reqdAgility:301,reqdCharisma:151,reqdReputation:36e3,repMultiplier:1.25},{name:a.h[2],nextPosition:a.h[3],baseSalary:50,hackingEffectiveness:5,strengthEffectiveness:20,defenseEffectiveness:20,dexterityEffectiveness:20,agilityEffectiveness:20,charismaEffectiveness:15,hackingExpGain:.01,strengthExpGain:.04,defenseExpGain:.04,dexterityExpGain:.04,agilityExpGain:.04,charismaExpGain:.02,reqdStrength:51,reqdDefense:51,reqdDexterity:51,reqdAgility:51,reqdCharisma:1,repMultiplier:1},{name:a.h[3],nextPosition:a.h[4],baseSalary:195,hackingEffectiveness:10,strengthEffectiveness:20,defenseEffectiveness:20,dexterityEffectiveness:20,agilityEffectiveness:20,charismaEffectiveness:10,hackingExpGain:.02,strengthExpGain:.1,defenseExpGain:.1,dexterityExpGain:.1,agilityExpGain:.1,charismaExpGain:.05,reqdHacking:26,reqdStrength:151,reqdDefense:151,reqdDexterity:151,reqdAgility:151,reqdCharisma:51,reqdReputation:8e3,repMultiplier:1.1},{name:a.h[4],nextPosition:a.h[5],baseSalary:660,hackingEffectiveness:10,strengthEffectiveness:15,defenseEffectiveness:15,dexterityEffectiveness:15,agilityEffectiveness:15,charismaEffectiveness:30,hackingExpGain:.02,strengthExpGain:.12,defenseExpGain:.12,dexterityExpGain:.12,agilityExpGain:.12,charismaExpGain:.1,reqdHacking:26,reqdStrength:251,reqdDefense:251,reqdDexterity:251,reqdAgility:251,reqdCharisma:101,reqdReputation:36e3,repMultiplier:1.25},{name:a.h[5],nextPosition:null,baseSalary:1320,hackingEffectiveness:10,strengthEffectiveness:15,defenseEffectiveness:15,dexterityEffectiveness:15,agilityEffectiveness:15,charismaEffectiveness:30,hackingExpGain:.05,strengthExpGain:.15,defenseExpGain:.15,dexterityExpGain:.15,agilityExpGain:.15,charismaExpGain:.15,reqdHacking:51,reqdStrength:501,reqdDefense:501,reqdDexterity:501,reqdAgility:501,reqdCharisma:151,reqdReputation:144e3,repMultiplier:1.4},{name:a.a[0],nextPosition:a.a[1],baseSalary:330,hackingEffectiveness:10,strengthEffectiveness:15,defenseEffectiveness:15,dexterityEffectiveness:20,agilityEffectiveness:20,charismaEffectiveness:20,hackingExpGain:.04,strengthExpGain:.08,defenseExpGain:.08,dexterityExpGain:.08,agilityExpGain:.08,charismaExpGain:.05,reqdHacking:101,reqdStrength:101,reqdDefense:101,reqdDexterity:101,reqdAgility:101,reqdCharisma:101,reqdReputation:8e3,repMultiplier:1},{name:a.a[1],nextPosition:a.a[2],baseSalary:990,hackingEffectiveness:15,strengthEffectiveness:15,defenseEffectiveness:15,dexterityEffectiveness:20,agilityEffectiveness:20,charismaEffectiveness:15,hackingExpGain:.1,strengthExpGain:.15,defenseExpGain:.15,dexterityExpGain:.15,agilityExpGain:.15,charismaExpGain:.1,reqdHacking:201,reqdStrength:251,reqdDefense:251,reqdDexterity:251,reqdAgility:251,reqdCharisma:201,reqdReputation:32e3,repMultiplier:1.25},{name:a.a[2],nextPosition:null,baseSalary:2e3,hackingEffectiveness:15,strengthEffectiveness:15,defenseEffectiveness:15,dexterityEffectiveness:20,agilityEffectiveness:20,charismaEffectiveness:15,hackingExpGain:.15,strengthExpGain:.2,defenseExpGain:.2,dexterityExpGain:.2,agilityExpGain:.2,charismaExpGain:.15,reqdHacking:251,reqdStrength:501,reqdDefense:501,reqdDexterity:501,reqdAgility:501,reqdCharisma:251,reqdReputation:162e3,repMultiplier:1.5},{name:a.e[0],nextPosition:null,baseSalary:22,strengthEffectiveness:10,dexterityEffectiveness:10,agilityEffectiveness:10,charismaEffectiveness:70,strengthExpGain:.02,defenseExpGain:.02,dexterityExpGain:.02,agilityExpGain:.02,charismaExpGain:.05,repMultiplier:1},{name:a.e[1],nextPosition:null,baseSalary:22,strengthEffectiveness:10,dexterityEffectiveness:10,agilityEffectiveness:10,charismaEffectiveness:70,strengthExpGain:.02,defenseExpGain:.02,dexterityExpGain:.02,agilityExpGain:.02,charismaExpGain:.04,repMultiplier:1},{name:a.k[0],nextPosition:a.k[1],baseSalary:66,hackingEffectiveness:80,charismaEffectiveness:20,hackingExpGain:.08,charismaExpGain:.03,reqdHacking:51,repMultiplier:1},{name:a.k[1],nextPosition:null,baseSalary:132,hackingEffectiveness:75,charismaEffectiveness:25,hackingExpGain:.25,charismaExpGain:.06,reqdHacking:251,reqdCharisma:51,repMultiplier:1.2},{name:a.c[0],nextPosition:a.c[1],baseSalary:66,hackingEffectiveness:20,charismaEffectiveness:80,hackingExpGain:.015,charismaExpGain:.15,reqdHacking:6,reqdCharisma:51,repMultiplier:1},{name:a.c[1],nextPosition:null,baseSalary:525,hackingEffectiveness:15,charismaEffectiveness:85,hackingExpGain:.015,charismaExpGain:.3,reqdHacking:51,reqdCharisma:226,repMultiplier:1.2},{name:a.g[0],nextPosition:null,baseSalary:20,strengthEffectiveness:10,dexterityEffectiveness:10,agilityEffectiveness:10,charismaEffectiveness:70,strengthExpGain:.0075,defenseExpGain:.0075,dexterityExpGain:.0075,agilityExpGain:.0075,charismaExpGain:.04,repMultiplier:1},{name:a.g[1],nextPosition:null,baseSalary:20,strengthEffectiveness:10,dexterityEffectiveness:10,agilityEffectiveness:10,charismaEffectiveness:70,strengthExpGain:.0075,defenseExpGain:.0075,dexterityExpGain:.0075,agilityExpGain:.0075,charismaExpGain:.03,repMultiplier:1}]},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(0),r=n.n(a),i=n(29),o=n(38),s=n(1),l=n(8);function c(t){const e=i.b.Player();return r.a.createElement(o.a,{open:t.open,onClose:t.onClose},r.a.createElement(s.a,null," Would you like to quit your job at ",t.company.name,"?"),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(l.a,{onClick:function(){e.quitJob(t.locName),t.onQuit(),t.onClose()}},"Quit"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var a=n(0),r=n(8),i=n(10),o=n(24),s=n(20),l=n(367),c=n(19),f=n(34);function u(t){function e(){const e=l.a.find(e=>e.specialName===t.loc.name),n=Object(o.d)(e?e.hostname:"");if(null==n||!n.hasOwnProperty("backdoorInstalled"))return t.loc.costMult;const a=n.backdoorInstalled?.9:1;return t.loc.costMult*a}function n(n){const a=t.loc;t.p.startClass(e(),a.expMult,n),t.p.startFocusing(),t.router.toWork()}const u=i.a.ClassGymBaseCost*e();return a.createElement(c.a,{sx:{display:"grid",width:"fit-content"}},a.createElement(r.a,{onClick:function(){n(f.a.GymStrength)}},"Train Strength (",a.createElement(s.a,{money:u,player:t.p})," / sec)"),a.createElement(r.a,{onClick:function(){n(f.a.GymDefense)}},"Train Defense (",a.createElement(s.a,{money:u,player:t.p})," / sec)"),a.createElement(r.a,{onClick:function(){n(f.a.GymDexterity)}},"Train Dexterity (",a.createElement(s.a,{money:u,player:t.p})," / sec)"),a.createElement(r.a,{onClick:function(){n(f.a.GymAgility)}},"Train Agility (",a.createElement(s.a,{money:u,player:t.p})," / sec)"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(0),r=n(8),i=n(406),o=n(20),s=n(14);class l extends a.Component{constructor(t){super(t),this.btnStyle={display:"block"},this.getCost=this.getCost.bind(this),this.getHealed=this.getHealed.bind(this),this.state={currHp:this.props.p.hp}}getCost(){return Object(i.b)(this.props.p)}getHealed(t){if(!t.isTrusted)return;if(this.props.p.hp<0&&(this.props.p.hp=0),this.props.p.hp>=this.props.p.max_hp)return;const e=this.getCost();this.props.p.loseMoney(e,"hospitalization"),this.props.p.hp=this.props.p.max_hp,this.setState({currHp:this.props.p.hp}),Object(s.a)(a.createElement(a.Fragment,null,"You were healed to full health! The hospital billed you for ",a.createElement(o.a,{money:e})))}render(){const t=this.getCost();return a.createElement(r.a,{onClick:this.getHealed,style:this.btnStyle},"Get treatment for wounds - ",a.createElement(o.a,{money:t,player:this.props.p}))}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(0),r=n(8),i=n(21),o=n(86),s=n(5),l=n(29),c=n(19);function f(){const t=l.b.Player(),e=l.b.Router();const n=o.a.Shoplift.successRate(t),f=o.a.RobStore.successRate(t),u=o.a.Mug.successRate(t),m=o.a.Larceny.successRate(t),h=o.a.DealDrugs.successRate(t),d=o.a.BondForgery.successRate(t),p=o.a.TraffickArms.successRate(t),g=o.a.Homicide.successRate(t),y=o.a.GrandTheftAuto.successRate(t),b=o.a.Kidnap.successRate(t),E=o.a.Assassination.successRate(t),v=o.a.Heist.successRate(t);return a.createElement(c.a,{sx:{display:"grid",width:"fit-content"}},a.createElement(i.a,{title:a.createElement(a.Fragment,null,"Attempt to shoplift from a low-end retailer")},a.createElement(r.a,{onClick:function(n){n.isTrusted&&o.a.Shoplift.commit(e,t)}},"Shoplift (",s.a.formatPercentage(n)," chance of success)")),a.createElement(i.a,{title:a.createElement(a.Fragment,null,"Attempt to commit armed robbery on a high-end store")},a.createElement(r.a,{onClick:function(n){n.isTrusted&&o.a.RobStore.commit(e,t)}},"Rob store (",s.a.formatPercentage(f)," chance of success)")),a.createElement(i.a,{title:a.createElement(a.Fragment,null,"Attempt to mug a random person on the street")},a.createElement(r.a,{onClick:function(n){n.isTrusted&&o.a.Mug.commit(e,t)}},"Mug someone (",s.a.formatPercentage(u)," chance of success)")),a.createElement(i.a,{title:a.createElement(a.Fragment,null,"Attempt to rob property from someone's house")},a.createElement(r.a,{onClick:function(n){n.isTrusted&&o.a.Larceny.commit(e,t)}},"Larceny (",s.a.formatPercentage(m)," chance of success)")),a.createElement(i.a,{title:a.createElement(a.Fragment,null,"Attempt to deal drugs")},a.createElement(r.a,{onClick:function(n){n.isTrusted&&o.a.DealDrugs.commit(e,t)}},"Deal Drugs (",s.a.formatPercentage(h)," chance of success)")),a.createElement(i.a,{title:a.createElement(a.Fragment,null,"Attempt to forge corporate bonds")},a.createElement(r.a,{onClick:function(n){n.isTrusted&&o.a.BondForgery.commit(e,t)}},"Bond Forgery (",s.a.formatPercentage(d)," chance of success)")),a.createElement(i.a,{title:a.createElement(a.Fragment,null,"Attempt to smuggle illegal arms into the city")},a.createElement(r.a,{onClick:function(n){n.isTrusted&&o.a.TraffickArms.commit(e,t)}},"Traffick illegal Arms (",s.a.formatPercentage(p)," chance of success)")),a.createElement(i.a,{title:a.createElement(a.Fragment,null,"Attempt to murder a random person on the street")},a.createElement(r.a,{onClick:function(n){n.isTrusted&&o.a.Homicide.commit(e,t)}},"Homicide (",s.a.formatPercentage(g)," chance of success)")),a.createElement(i.a,{title:a.createElement(a.Fragment,null,"Attempt to commit grand theft auto")},a.createElement(r.a,{onClick:function(n){n.isTrusted&&o.a.GrandTheftAuto.commit(e,t)}},"Grand theft Auto (",s.a.formatPercentage(y)," chance of success)")),a.createElement(i.a,{title:a.createElement(a.Fragment,null,"Attempt to kidnap and ransom a high-profile-target")},a.createElement(r.a,{onClick:function(n){n.isTrusted&&o.a.Kidnap.commit(e,t)}},"Kidnap and Ransom (",s.a.formatPercentage(b)," chance of success)")),a.createElement(i.a,{title:a.createElement(a.Fragment,null,"Attempt to assassinate a high-profile target")},a.createElement(r.a,{onClick:function(n){n.isTrusted&&o.a.Assassination.commit(e,t)}},"Assassinate (",s.a.formatPercentage(E)," chance of success)")),a.createElement(i.a,{title:a.createElement(a.Fragment,null,"Attempt to pull off the ultimate heist")},a.createElement(r.a,{onClick:function(n){n.isTrusted&&o.a.Heist.commit(e,t)}},"Heist (",s.a.formatPercentage(v)," chance of success)")))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return x}));var a=n(0),r=n.n(a),i=n(1),o=n(8),s=n(1312),l=n(9),c=n(12),f=n(26),u=n(105),m=n(29),h=n(14),d=n(94),p=n(1313),g=n(108),y=n(119),b=n(471),E=n(223),v=n(92),k=n(24),_=n(1314),w=n(4),S=n(18);function x(t){const e=m.b.Player(),n=m.b.Router(),x=Object(a.useState)(!1)[1],C=e.inBladeburner();function L(){const t=e;if(t.inBladeburner())n.toBladeburner();else if(t.strength>=100&&t.defense>=100&&t.dexterity>=100&&t.agility>=100){t.startBladeburner({new:!0}),Object(h.a)("You have been accepted into the Bladeburner division!"),x(t=>!t);const e=document.getElementById("world-menu-header");e instanceof HTMLElement&&(e.click(),e.click())}else Object(h.a)("Rejected! Please apply again when you have 100 of each combat stat (str, def, dex, agi)")}function O(){n.toGrafting()}function M(){const[t,n]=Object(a.useState)(!1);return e.canAccessCorporation()?r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,{disabled:!e.canAccessCorporation()||e.hasCorporation(),onClick:()=>n(!0)},"Create a Corporation"),r.a.createElement(s.a,{open:t,onClose:()=>n(!1)})):r.a.createElement(r.a.Fragment,null,r.a.createElement(i.a,null,r.a.createElement("i",null,"A business man is yelling at a clerk. You should come back later.")))}function T(){const t=f.a[w.a.ChurchOfTheMachineGod];e.factions.includes(w.a.ChurchOfTheMachineGod)||Object(u.d)(t),e.augmentations.some(t=>t.name===c.a.StaneksGift1)||e.queuedAugmentations.some(t=>t.name===c.a.StaneksGift1)||Object(y.a)({name:c.a.StaneksGift1,level:1}),n.toStaneksGift()}switch(t.loc.name){case l.a.NewTokyoVitaLife:return e.canAccessGrafting()?r.a.createElement(o.a,{onClick:O,sx:{my:5}},"Enter the secret lab"):r.a.createElement(r.a.Fragment,null);case l.a.Sector12CityHall:return S.a.CorporationSoftcap<.15&&r.a.createElement(r.a.Fragment,null)||r.a.createElement(M,null);case l.a.Sector12NSA:return function(){if(!e.canAccessBladeburner())return r.a.createElement(r.a.Fragment,null);const t=C?"Enter Bladeburner Headquarters":"Apply to Bladeburner Division";return r.a.createElement(r.a.Fragment,null,r.a.createElement("br",null),r.a.createElement(o.a,{onClick:L},t))}();case l.a.NewTokyoNoodleBar:return r.a.createElement(r.a.Fragment,null,r.a.createElement("br",null),r.a.createElement(o.a,{onClick:function(){d.b.emit("You ate some delicious noodles and feel refreshed",d.d.SUCCESS,2e3),Object(p.a)(),e.sourceFiles.length>0&&e.giveExploit(g.a.N00dles),(e.sourceFileLvl(5)>0||5===e.bitNodeN)&&(e.intelligence_exp*=1.0000000000000002),e.hacking_exp*=1.0000000000000002,e.strength_exp*=1.0000000000000002,e.defense_exp*=1.0000000000000002,e.agility_exp*=1.0000000000000002,e.dexterity_exp*=1.0000000000000002,e.charisma_exp*=1.0000000000000002;for(const t of e.hacknetNodes)if(t instanceof E.a)e.gainMoney(.001*t.moneyGainRatePerSecond,"other");else{const n=Object(k.d)(t);if(!(n instanceof v.a))throw new Error(`Server ${t} is not a hacknet server.`);e.hashManager.storeHashes(.001*n.hashRate)}e.bladeburner&&(e.bladeburner.rank+=1e-5),e.corporation&&(e.corporation.funds+=.01*e.corporation.revenue)}},"Eat noodles"));case l.a.ChongqingChurchOfTheMachineGod:return function(){const t=r.a.createElement(o.a,{onClick:()=>n.toStaneksGift()},"Open Stanek's Gift"),a=r.a.createElement(i.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," `` ",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)," `..` ");return e.hasAugmentation(c.a.StaneksGift3,!0)?r.a.createElement(r.a.Fragment,null,r.a.createElement(i.a,null,r.a.createElement("i",null,"Allison \"Mother\" Stanek: ..can ...you hear them too ...? Come now, don't be shy and let me get a closer look at you. Yes wonderful, I see my creation has taken root without consquence or much ill effect it seems. Curious, Just how much of a machine's soul do you house in that body?")),r.a.createElement("br",null),t,r.a.createElement("br",null),a):e.hasAugmentation(c.a.StaneksGift2,!0)?r.a.createElement(r.a.Fragment,null,r.a.createElement(i.a,null,r.a.createElement("i",null,'Allison "Mother" Stanek: I see you\'ve taken to my creation. So much so it could hardly be recognized as one of my own after your tinkering with it. I see you follow the ways of the Machine God as I do, and your mastery of the gift clearly demonstrates that. My hopes are climbing by the day for you.')),r.a.createElement("br",null),t,r.a.createElement("br",null),a):e.factions.includes(w.a.ChurchOfTheMachineGod)?r.a.createElement(r.a.Fragment,null,r.a.createElement(i.a,null,r.a.createElement("i",null,'Allison "Mother" Stanek: Welcome back my child!')),r.a.createElement("br",null),t,r.a.createElement("br",null),a):e.canAccessCotMG()?e.augmentations.filter(t=>t.name!==c.a.NeuroFluxGovernor).length>0||e.queuedAugmentations.filter(t=>t.name!==c.a.NeuroFluxGovernor).length>0?r.a.createElement(r.a.Fragment,null,r.a.createElement(i.a,null,r.a.createElement("i",null,'Allison "Mother" Stanek: Begone you filth! My gift must be the first modification that your body should have!'))):r.a.createElement(r.a.Fragment,null,r.a.createElement(i.a,null,r.a.createElement("i",null,'Allison "Mother" Stanek: Welcome child, I see your body is pure. Are you ready to ascend beyond our human form? If you are, accept my gift.')),r.a.createElement(o.a,{onClick:T},"Accept Stanek's Gift"),a):r.a.createElement(r.a.Fragment,null,r.a.createElement(i.a,null,"A decrepit altar stands in the middle of a dilapidated church.",r.a.createElement("br",null),r.a.createElement("br",null),"A symbol is carved in the altar."),r.a.createElement("br",null),a)}();case l.a.IshimaGlitch:return r.a.createElement(r.a.Fragment,null,r.a.createElement(i.a,null,r.a.createElement(b.a,{content:"An eerie aura surrounds this area. You feel you should leave."})));case l.a.NewTokyoArcade:return r.a.createElement(_.a,null);default:return console.error(`Location ${t.loc.name} doesn't have any special properties`),r.a.createElement(r.a.Fragment,null)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var a=n(0),r=n.n(a),i=n(20),o=n(38),s=n(29),l=n(1),c=n(8),f=n(76);function u(t){const e=s.b.Player(),n=s.b.Router(),u=e.canAfford(15e10);if(!e.canAccessCorporation()||e.hasCorporation())return t.onClose(),r.a.createElement(r.a.Fragment,null);const[m,h]=Object(a.useState)("");return r.a.createElement(o.a,{open:t.open,onClose:t.onClose},r.a.createElement(l.a,null,"Would you like to start a corporation? This will require $150b for registration and initial funding."," ",3===e.bitNodeN&&"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",r.a.createElement("br",null),r.a.createElement("br",null),"If you would like to start one, please enter a name for your corporation below:"),r.a.createElement(f.a,{autoFocus:!0,placeholder:"Corporation Name",onChange:function(t){h(t.target.value)},value:m}),3===e.bitNodeN&&r.a.createElement(c.a,{onClick:function(){""!=m&&(e.startCorporation(m,5e8),t.onClose(),n.toCorporation())},disabled:""==m},"Use seed money"),r.a.createElement(c.a,{onClick:function(){u&&""!=m&&(e.startCorporation(m),e.loseMoney(15e10,"corporation"),t.onClose(),n.toCorporation())},disabled:""==m||!u},"Self-Fund (",r.a.createElement(i.a,{money:15e10,player:e}),")"))}},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return N00dles}));const n00dlePower="[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+([]+[])[(![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(!![]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]()[+!+[]+[!+[]+!+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(![]+[+[]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]]+![]+(![]+[+[]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]])()[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((![]+[+[]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]])+[])[+!+[]]+[!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(![]+[+[]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]]+![]+(![]+[+[]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]])()[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((![]+[+[]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]])+[])[+!+[]]+[+!+[]]+[+!+[]]+[!+[]+!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(+[![]]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+!+[]]]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(+[![]]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+!+[]]]+(!![]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[+!+[]]+(+(!+[]+!+[]+[+!+[]]+[+!+[]]))[(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([]+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]][([][[]]+[])[+!+[]]+(![]+[])[+!+[]]+((+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]+[])[+!+[]+[+!+[]]]+(!![]+[])[!+[]+!+[]+!+[]]]](!+[]+!+[]+!+[]+[+!+[]])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]])()([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[(![]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]]((+((+(+!+[]+[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+[!+[]+!+[]]+[+[]])+[])[+!+[]]+[+[]+[+[]]+[+[]]+[+[]]+[+[]]+[+[]]+[+!+[]]])+[])[!+[]+!+[]]+[+!+[]])+(![]+[])[+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]])()())[!+[]+!+[]+!+[]+[+[]]]+(+[]+[][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(+[]+[][(!![]+[])[!+[]+!+[]+!+[]]+([][[]]+[])[+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(+[![]]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+!+[]]]+([][[]]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][[]]+[])[!+[]+!+[]]+(+[![]]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+!+[]]]+(+[![]]+[+(+!+[]+(!+[]+[])[!+[]+!+[]+!+[]]+[+!+[]]+[+[]]+[+[]]+[+[]])])[+!+[]+[+[]]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+[]]+(+[![]]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+!+[]]]+(!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[!+[]+!+[]]+(+[![]]+[+(+!+[]+(!+[]+[])[!+[]+!+[]+!+[]]+[+!+[]]+[+[]]+[+[]]+[+[]])])[+!+[]+[+[]]]+(+[![]]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+!+[]]]+([][[]]+[])[!+[]+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(![]+[])[+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(+(!+[]+!+[]+[+[]]))[(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([]+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]][([][[]]+[])[+!+[]]+(![]+[])[+!+[]]+((+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]+[])[+!+[]+[+!+[]]]+(!![]+[])[!+[]+!+[]+!+[]]]](!+[]+!+[]+[+!+[]])+(+[![]]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+!+[]]]+(!![]+[])[+[]]+(+(+!+[]+[+[]]+[+!+[]]))[(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([]+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]][([][[]]+[])[+!+[]]+(![]+[])[+!+[]]+((+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]+[])[+!+[]+[+!+[]]]+(!![]+[])[!+[]+!+[]+!+[]]]](!+[]+!+[]+[+!+[]])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]+!+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(![]+[+[]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]]+![]+(![]+[+[]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]])()[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]()+[])[!+[]+!+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(![]+[+[]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]]+![]+(![]+[+[]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]])()[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((![]+[+[]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]])+[])[+!+[]]+[!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]]+([]+[])[(![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(!![]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]()[+!+[]+[!+[]+!+[]]])()";function N00dles(){eval(n00dlePower)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a,r=n(0),i=n.n(r),o=n(1315),s=n(8),l=n(29),c=n(339);function f(){const t=l.b.Player(),[e,n]=Object(r.useState)(a.None);if(e===a.None)return i.a.createElement(i.a.Fragment,null,i.a.createElement(s.a,{onClick:function(){0===t.sourceFileLvl(1)?c.a.emit("This machine is broken."):n(a.Megabyteburner2000)}},"Megabyte burner 2000"));let f=i.a.createElement(i.a.Fragment,null);switch(e){case a.Megabyteburner2000:f=i.a.createElement(o.a,null)}return i.a.createElement(i.a.Fragment,null,i.a.createElement(s.a,{onClick:()=>n(a.None)},"Back"),f)}!function(t){t[t.None=0]="None",t[t.Megabyteburner2000=1]="Megabyteburner2000"}(a||(a={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(0),r=n.n(a),i=n(1),o=n(29),s=n(108);const l={width:"1060px",height:"800px",border:"0px"};function c(){const t=o.b.Player();Object(a.useEffect)(()=>{window.addEventListener("message",(function(e){e.isTrusted&&"https://bitburner-official.github.io"==e.origin&&e.data&&t.giveExploit(s.a.TrueRecursion)}))});const e=r.a.createElement(r.a.Fragment,null,r.a.createElement(i.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," "),r.a.createElement(i.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," ,'\" \"', .-. "),r.a.createElement(i.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," / \\ ( ) "),r.a.createElement(i.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," | | .-. '-' .-. "),r.a.createElement(i.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," \\ / ( ) ( )"),r.a.createElement(i.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," '.___.' '-' .-. '-'"),r.a.createElement(i.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," ||| ( ) "),r.a.createElement(i.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," ||| '-' "));return r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{style:{width:"1060px",height:"800px",padding:"0",overflow:"hidden",borderColor:"white",borderStyle:"solid",borderWidth:"5px"}},r.a.createElement("iframe",{src:"https://bitburner-official.github.io/bitburner-legacy/",style:l})),r.a.createElement("div",{style:{width:"1060px",borderColor:"white",borderStyle:"solid",borderWidth:"5px"}},e))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return y}));var a=n(0),r=n.n(a),i=n(1),o=n(8),s=n(1317),l=n(1318),c=n(1320),f=n(224),u=n(20),m=n(29),h=n(1321),d=n(5),p=n(19);function g(t){const[e,n]=Object(a.useState)(!1),i=m.b.Player(),s=Object(f.a)(t.ram);return r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,{onClick:()=>n(!0),disabled:!i.canAfford(s)},"Purchase ",d.a.formatRAM(t.ram)," Server - ",r.a.createElement(u.a,{money:s,player:i})),r.a.createElement(h.a,{open:e,onClose:()=>n(!1),ram:t.ram,cost:s,rerender:t.rerender}))}function y(t){const e=m.b.Player(),n=Object(a.useState)(!1)[1];function o(){n(t=>!t)}Object(a.useEffect)(()=>{const t=setInterval(o,1e3);return()=>clearInterval(t)},[]);const f=[];for(let e=t.loc.techVendorMinRam;e<=t.loc.techVendorMaxRam;e*=2)f.push(r.a.createElement(g,{key:e,ram:e,rerender:o}));return r.a.createElement(r.a.Fragment,null,r.a.createElement("br",null),r.a.createElement(p.a,{sx:{display:"grid",width:"fit-content"}},f),r.a.createElement("br",null),r.a.createElement(i.a,null,r.a.createElement("i",null,'"You can order bigger servers via scripts. We don\'t take custom orders in person."')),r.a.createElement("br",null),r.a.createElement(l.a,{p:e,rerender:o}),r.a.createElement("br",null),r.a.createElement(s.a,{p:e,rerender:o}),r.a.createElement("br",null),r.a.createElement(c.a,{p:e,rerender:o}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var a=n(0),r=n.n(a),i=n(8),o=n(21),s=n(1),l=n(10),c=n(224),f=n(20),u=n(5),m=n(266),h=n(18);function d(t){const e=t.p.getHomeComputer();if(e.maxRam>=l.a.HomeComputerMaxRam)return r.a.createElement(i.a,null,"Upgrade 'home' RAM - MAX");const n=t.p.getUpgradeHomeRamCost();const a=1===h.a.HomeComputerRamCost?"":"\\cdot "+h.a.HomeComputerRamCost;return r.a.createElement(o.a,{title:r.a.createElement(m.a,null,`\\(\\large{cost = ram \\cdot 3.2 \\cdot 10^4 \\cdot 1.58^{log_2{(ram)}}} ${a}\\)`)},r.a.createElement("span",null,r.a.createElement("br",null),r.a.createElement(s.a,null,r.a.createElement("i",null,"\"More RAM means more scripts on 'home'\"")),r.a.createElement("br",null),r.a.createElement(i.a,{disabled:!t.p.canAfford(n),onClick:function(){Object(c.d)(t.p),t.rerender()}},"Upgrade 'home' RAM (",u.a.formatRAM(e.maxRam)," -> ",u.a.formatRAM(2*e.maxRam),") - ",r.a.createElement(f.a,{money:n,player:t.p}))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(0),r=n.n(a),i=n(8),o=n(1319),s=n(10),l=n(20);function c(t){return t.p.hasTorRouter()?r.a.createElement(i.a,null,"TOR Router - Purchased"):r.a.createElement(i.a,{disabled:!t.p.canAfford(s.a.TorRouterCost),onClick:function(){Object(o.a)(t.p),t.rerender()}},"Purchase TOR router - ",r.a.createElement(l.a,{money:s.a.TorRouterCost,player:t.p}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(88),r=n(10),i=n(24),o=n(14);function s(t){if(t.hasTorRouter())return void Object(o.a)("You already have a TOR Router!");if(!t.canAfford(r.a.TorRouterCost))return void Object(o.a)("You cannot afford to purchase the TOR router!");t.loseMoney(r.a.TorRouterCost,"other");const e=Object(i.d)(a.a.DarkWeb);if(!e)throw new Error("Dark web is not a server.");t.getHomeComputer().serversOnNetwork.push(e.hostname),e.serversOnNetwork.push(t.getHomeComputer().hostname),Object(o.a)("You have purchased a TOR router!
You now have access to the dark web from your home computer.
Use the scan/scan-analyze commands to search for the dark web connection.")}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(0),r=n.n(a),i=n(8),o=n(21),s=n(1),l=n(20),c=n(266);function f(t){const e=t.p.getHomeComputer(),n=e.cpuCores>=8;if(n)return r.a.createElement(i.a,null,"Upgrade 'home' cores - MAX");const a=t.p.getUpgradeHomeCoresCost();return r.a.createElement(o.a,{title:r.a.createElement(c.a,null,"\\(\\large{cost = 10^9 \\cdot 7.5 ^{\\text{cores}}}\\)")},r.a.createElement("span",null,r.a.createElement("br",null),r.a.createElement(s.a,null,r.a.createElement("i",null,"\"Cores increase the effectiveness of grow() and weaken() on 'home'\"")),r.a.createElement("br",null),r.a.createElement(i.a,{disabled:!t.p.canAfford(a),onClick:function(){n||t.p.canAfford(a)&&(t.p.loseMoney(a,"servers"),e.cpuCores++,t.rerender())}},"Upgrade 'home' cores (",e.cpuCores," -> ",e.cpuCores+1,") - ",r.a.createElement(l.a,{money:a,player:t.p}))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var a=n(0),r=n.n(a),i=n(224),o=n(5),s=n(20),l=n(38),c=n(29),f=n(1),u=n(76),m=n(8),h=n(27);function d(t){const e=c.b.Player(),[n,d]=Object(a.useState)("");function p(){Object(i.e)(n,t.ram,t.cost,e),t.onClose()}return r.a.createElement(l.a,{open:t.open,onClose:t.onClose},r.a.createElement(f.a,null,"Would you like to purchase a new server with ",o.a.formatRAM(t.ram)," of RAM for"," ",r.a.createElement(s.a,{money:t.cost,player:e}),"?"),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(f.a,null," Please enter the server hostname below:"),r.a.createElement("br",null),r.a.createElement(u.a,{autoFocus:!0,onKeyUp:function(t){t.key===h.a.ENTER&&p()},onChange:function(t){d(t.target.value)},type:"text",placeholder:"Unique Hostname",InputProps:{endAdornment:r.a.createElement(m.a,{onClick:p,disabled:!e.canAfford(t.cost)||""===n},"Buy")}}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var a=n(0),r=n.n(a),i=n(10),o=n(20),s=n(38),l=n(29),c=n(1),f=n(8);function u(t){const e=l.b.Player(),n=i.a.TravelCost;return r.a.createElement(s.a,{open:t.open,onClose:t.onClose},r.a.createElement(c.a,null,"Would you like to travel to ",t.city,"? The trip will cost ",r.a.createElement(o.a,{money:n,player:e}),"."),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(f.a,{onClick:function(){t.travel()}},r.a.createElement(c.a,null,"Travel")))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var a=n(0),r=n(21),i=n(8),o=n(10),s=n(24),l=n(20),c=n(29),f=n(19),u=n(34);function m(t){const e=c.b.Player(),n=c.b.Router();function m(){const e=Object(s.d)(t.loc.name);if(null==e||!e.hasOwnProperty("backdoorInstalled"))return t.loc.costMult;const n=e.backdoorInstalled?.9:1;return t.loc.costMult*n}function h(a){const r=t.loc;e.startClass(m(),r.expMult,a),e.startFocusing(),n.toWork()}const d=m(),p=o.a.ClassDataStructuresBaseCost*d,g=o.a.ClassNetworksBaseCost*d,y=o.a.ClassAlgorithmsBaseCost*d,b=o.a.ClassManagementBaseCost*d,E=o.a.ClassLeadershipBaseCost*d;return a.createElement(f.a,{sx:{display:"grid",width:"fit-content"}},a.createElement(r.a,{title:"Gain hacking experience!"},a.createElement(i.a,{onClick:function(){h(u.a.StudyComputerScience)}},"Study Computer Science (free)")),a.createElement(r.a,{title:"Gain hacking experience!"},a.createElement(i.a,{onClick:function(){h(u.a.DataStructures)}},"Take Data Structures course (",a.createElement(l.a,{money:p,player:e})," / sec)")),a.createElement(r.a,{title:"Gain hacking experience!"},a.createElement(i.a,{onClick:function(){h(u.a.Networks)}},"Take Networks course (",a.createElement(l.a,{money:g,player:e})," / sec)")),a.createElement(r.a,{title:"Gain hacking experience!"},a.createElement(i.a,{onClick:function(){h(u.a.Algorithms)}},"Take Algorithms course (",a.createElement(l.a,{money:y,player:e})," / sec)")),a.createElement(r.a,{title:"Gain charisma experience!"},a.createElement(i.a,{onClick:function(){h(u.a.Management)}},"Take Management course (",a.createElement(l.a,{money:b,player:e})," / sec)")),a.createElement(r.a,{title:"Gain charisma experience!"},a.createElement(i.a,{onClick:function(){h(u.a.Leadership)}},"Take Leadership course (",a.createElement(l.a,{money:E,player:e})," / sec)")))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var a,r=n(0),i=n.n(r),o=n(8),s=n(784),l=n(1326),c=n(1327),f=n(1328),u=n(19);function m(t){const[e,n]=Object(r.useState)(a.None);function m(t){n(t)}return i.a.createElement(i.a.Fragment,null,e===a.None&&i.a.createElement(u.a,{sx:{display:"grid",width:"fit-content"}},i.a.createElement(o.a,{onClick:()=>m(a.Coin)},"Play coin flip"),i.a.createElement(o.a,{onClick:()=>m(a.Slots)},"Play slots"),i.a.createElement(o.a,{onClick:()=>m(a.Roulette)},"Play roulette"),i.a.createElement(o.a,{onClick:()=>m(a.Blackjack)},"Play blackjack (",s.b," decks)")),e!==a.None&&i.a.createElement(i.a.Fragment,null,i.a.createElement(o.a,{onClick:()=>m(a.None)},"Stop playing"),e===a.Coin&&i.a.createElement(l.a,{p:t.p}),e===a.Slots&&i.a.createElement(f.a,{p:t.p}),e===a.Roulette&&i.a.createElement(c.a,{p:t.p}),e===a.Blackjack&&i.a.createElement(s.a,{p:t.p})))}!function(t){t.None="none",t.Coin="coin",t.Slots="slots",t.Roulette="roulette",t.Blackjack="blackjack"}(a||(a={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(260),r=n(115);class i{constructor(t=1){var e,n,a;a=[],(n="cards")in(e=this)?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,this.numDecks=t,this.reset()}shuffle(){this.cards=Object(r.shuffle)(this.cards)}drawCard(){if(0==this.cards.length)throw new Error("Tried to draw card from empty deck");return this.cards.shift()}safeDrawCard(){return 0===this.cards.length&&this.reset(),this.drawCard()}reset(){this.cards=[];for(let t=1;t<=13;++t)for(let e=0;ey(!1),250),s?Object(o.c)(t.p,e):Object(o.c)(t.p,-e),Object(o.b)(t.p)}return r.a.createElement(r.a.Fragment,null,r.a.createElement(l.a,null,"Result:")," ",m,r.a.createElement(u.a,{display:"flex",alignItems:"center"},r.a.createElement(c.a,{type:"number",onChange:function(t){let e=parseInt(t.currentTarget.value);isNaN(e)&&(e=0),e>1e4&&(e=1e4),e<0&&(e=0),n(e)},InputProps:{endAdornment:r.a.createElement(r.a.Fragment,null,r.a.createElement(f.a,{onClick:Object(s.a)(()=>b("H")),disabled:g},"Head!"),r.a.createElement(f.a,{onClick:Object(s.a)(()=>b("T")),disabled:g},"Tail!"))}})),r.a.createElement(l.a,{variant:"h3"},d))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var a=n(0),r=n.n(a),i=n(20),o=n(212),s=n(314),l=n(87),c=n(1),f=n(8),u=n(76);const m=[1,3,5,7,9,12,14,16,18,19,21,23,25,27,30,32,34,36],h={Red:{match:t=>m.includes(t),payout:1},Black:{match:t=>0!==t&&!m.includes(t),payout:1},Odd:{match:t=>0!==t&&t%2==1,payout:1},Even:{match:t=>0!==t&&t%2==0,payout:1},High:{match:t=>0!==t&&t>18,payout:1},Low:{match:t=>0!==t&&t<19,payout:1},Third1:{match:t=>0!==t&&t<=12,payout:2},Third2:{match:t=>0!==t&&(t>=13&&t<=24),payout:2},Third3:{match:t=>0!==t&&t>=25,payout:2}};function d(t){return{match:e=>t===e,payout:36}}function p(t){const[e]=Object(a.useState)(new s.c((new Date).getTime())),[n,m]=Object(a.useState)(1e3),[p,g]=Object(a.useState)(!0),[y,b]=Object(a.useState)("waiting"),[E,v]=Object(a.useState)(0),[k,_]=Object(a.useState)(!0);function w(){k||v(Math.floor(37*Math.random()))}function S(a){Object(o.b)(t.p)||(g(!1),_(!1),b("playing"),setTimeout(()=>{let s=Math.floor(37*e.random()),l=r.a.createElement(r.a.Fragment,null),c=0,f=a.match(s);if(f&&Math.random()>.9)for(;f;)s=Math.floor(37*e.random()),f=a.match(s);f?(c=n*a.payout,l=r.a.createElement(r.a.Fragment,null,"won ",r.a.createElement(i.a,{money:c}))):(c=-n,l=r.a.createElement(r.a.Fragment,null,"lost ",r.a.createElement(i.a,{money:-c}))),Object(o.c)(t.p,c),g(!0),_(!0),b(l),v(s),Object(o.b)(t.p)},1600))}return Object(a.useEffect)(()=>{const t=window.setInterval(w,50);return()=>clearInterval(t)}),r.a.createElement(r.a.Fragment,null,r.a.createElement(c.a,{variant:"h4"},function(){if(0===E)return"0";const t=function(t){return[1,3,5,7,9,12,14,16,18,19,21,23,25,27,30,32,34,36].includes(t)}(E)?"R":"B";return`${E}${t}`}()),r.a.createElement(u.a,{type:"number",onChange:function(t){let e=parseInt(t.currentTarget.value);isNaN(e)&&(e=0),e>1e7&&(e=1e7),e<0&&(e=0),m(e)},placeholder:"Amount to play",disabled:!p}),r.a.createElement(c.a,{variant:"h4"},y),r.a.createElement("table",null,r.a.createElement("tbody",null,r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(3)))},"3")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(6)))},"6")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(9)))},"9")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(12)))},"12")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(15)))},"15")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(18)))},"18")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(21)))},"21")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(24)))},"24")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(27)))},"27")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(30)))},"30")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(33)))},"33")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(36)))},"36"))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(2)))},"2")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(5)))},"5")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(8)))},"8")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(11)))},"11")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(14)))},"14")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(17)))},"17")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(20)))},"20")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(23)))},"23")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(26)))},"26")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(29)))},"29")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(32)))},"32")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(35)))},"35"))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(1)))},"1")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(4)))},"4")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(7)))},"7")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(10)))},"10")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(13)))},"13")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(16)))},"16")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(19)))},"19")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(22)))},"22")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(25)))},"25")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(28)))},"28")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(31)))},"31")),r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(34)))},"34"))),r.a.createElement("tr",null,r.a.createElement("td",{colSpan:4},r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(h.Third1))},"1 to 12")),r.a.createElement("td",{colSpan:4},r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(h.Third2))},"13 to 24")),r.a.createElement("td",{colSpan:4},r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(h.Third3))},"25 to 36"))),r.a.createElement("tr",null,r.a.createElement("td",{colSpan:2},r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(h.Red))},"Red")),r.a.createElement("td",{colSpan:2},r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(h.Black))},"Black")),r.a.createElement("td",{colSpan:2},r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(h.Odd))},"Odd")),r.a.createElement("td",{colSpan:2},r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(h.Even))},"Even")),r.a.createElement("td",{colSpan:2},r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(h.High))},"High")),r.a.createElement("td",{colSpan:2},r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(h.Low))},"Low"))),r.a.createElement("tr",null,r.a.createElement("td",null,r.a.createElement(f.a,{disabled:!p,onClick:Object(l.a)(()=>S(d(0)))},"0"))))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var a=n(0),r=n.n(a),i=n(20),o=n(314),s=n(212),l=n(87),c=n(1),f=n(76),u=n(8);const m=["D","C","$","?","♥","A","C","B","C","E","B","E","C","*","D","♥","B","A","A","A","C","A","D","B","E","?","D","*","@","♥","B","E","?"];function h(t,e){switch(t){case"$":return[20,200,1e3][e];case"@":return[8,80,400][e];case"♥":case"?":return[6,20,150][e];case"D":case"E":return[1,8,30][e];default:return[1,5,20][e]}}const d=[[[0,0],[0,1],[0,2],[0,3],[0,4]],[[1,0],[1,1],[1,2],[1,3],[1,4]],[[2,0],[2,1],[2,2],[2,3],[2,4]],[[2,0],[1,1],[0,2],[1,3],[2,4]],[[0,0],[1,1],[2,2],[1,3],[0,4]],[[0,0],[1,1],[1,2],[1,3],[0,4]],[[2,0],[1,1],[1,2],[1,3],[2,4]],[[1,0],[0,1],[0,2],[0,3],[1,4]],[[1,0],[2,1],[2,2],[2,3],[1,4]]];function p(t){const[e]=Object(a.useState)(new o.c(t.p.totalPlaytime)),[n,p]=Object(a.useState)([0,0,0,0,0]),[g,y]=Object(a.useState)([0,0,0,0,0]),[b,E]=Object(a.useState)(1e3),[v,k]=Object(a.useState)(!0),[_,w]=Object(a.useState)("waiting");function S(){let e=!1;const a=n.slice();for(let t=0;t=0?a[t]-1:m.length-1,e=!0);p(a),e&&a.every((t,e)=>t===g[e])&&function(e){const n=function(t){const n=[];for(const a of t)n.push(e[a[0]][a[1]]);return n},a=function(t){let e=1;for(let n=1;n0?"gained":"lost"," ",r.a.createElement(i.a,{money:Math.abs(o)}))),k(!0),Object(s.b)(t.p));}(x(a,m))}function x(t,e){return[[e[(t[0]+e.length-1)%e.length],e[(t[1]+e.length-1)%e.length],e[(t[2]+e.length-1)%e.length],e[(t[3]+e.length-1)%e.length],e[(t[4]+e.length-1)%e.length]],[e[t[0]],e[t[1]],e[t[2]],e[t[3]],e[t[4]]],[e[(t[0]+1)%e.length],e[(t[1]+1)%e.length],e[(t[2]+1)%e.length],e[(t[3]+1)%e.length],e[(t[4]+1)%e.length]]]}function C(){y([Math.floor(e.random()*m.length),Math.floor(e.random()*m.length),Math.floor(e.random()*m.length),Math.floor(e.random()*m.length),Math.floor(e.random()*m.length)])}Object(a.useEffect)(()=>{const t=window.setInterval(S,50);return()=>clearInterval(t)});const L=x(n,m);return r.a.createElement(r.a.Fragment,null,r.a.createElement(c.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}},"+———————————————————————+"),r.a.createElement(c.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}},"| | ",L[0][0]," | ",L[0][1]," | ",L[0][2]," | ",L[0][3]," | ",L[0][4]," | |"),r.a.createElement(c.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}},"| | | | | | | |"),r.a.createElement(c.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}},"| | ",m[n[0]]," | ",m[n[1]]," | ",m[n[2]]," | ",m[n[3]]," | ",m[n[4]]," | |"),r.a.createElement(c.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}},"| | | | | | | |"),r.a.createElement(c.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}},"| | ",m[(n[0]+1)%m.length]," | ",m[(n[1]+1)%m.length]," | ",m[(n[2]+1)%m.length]," | ",m[(n[3]+1)%m.length]," | ",m[(n[4]+1)%m.length]," | |"),r.a.createElement(c.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}},"+———————————————————————+"),r.a.createElement(f.a,{type:"number",onChange:function(t){let e=parseInt(t.currentTarget.value);isNaN(e)&&(e=0),e>1e6&&(e=1e6),e<0&&(e=0),E(e)},placeholder:"Amount to play",disabled:!v,InputProps:{endAdornment:r.a.createElement(u.a,{onClick:Object(l.a)((function(){Object(s.b)(t.p)||(w("playing"),Object(s.c)(t.p,-b),v&&(y([-1,-1,-1,-1,-1]),k(!1),setTimeout(C,2e3*e.random()+1e3)))})),disabled:!v},"Spin!")}}),r.a.createElement(c.a,{variant:"h4"},_),r.a.createElement(c.a,null,"Pay lines"),r.a.createElement(c.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}},"----- ····· ·····"),r.a.createElement(c.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}},"····· ----- ·····"),r.a.createElement(c.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}},"····· ····· -----"),r.a.createElement("br",null),r.a.createElement(c.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}},"··^·· \\···/ \\···/"),r.a.createElement(c.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}},"·/·\\· ·\\·/· ·---·"),r.a.createElement(c.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}},"/···\\ ··v·· ·····"),r.a.createElement("br",null),r.a.createElement(c.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}},"····· ·---· ·····"),r.a.createElement(c.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}},"·---· /···\\ \\···/"),r.a.createElement(c.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}},"/···\\ ····· ·---·"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return E}));var a=n(0),r=n(154),i=n(9),o=n(186),s=n(6),l=n(29),c=n(1),f=n(8),u=n(52),m=n(121),h=n(144);const d=Object(m.a)(t=>Object(h.a)({location:{color:t.colors.white,whiteSpace:"nowrap",margin:"0px",padding:"0px",cursor:"pointer"}}));function p(t,e){e.name===i.a.TravelAgency?t.toTravel():e.name===i.a.WorldStockExchange?t.toStockMarket():t.toLocation(e)}function g(t){t.types;const e=l.b.Router(),n=d();let r="X";return t.types.includes(u.a.Company)&&(r="C"),t.types.includes(u.a.Gym)&&(r="G"),t.types.includes(u.a.Hospital)&&(r="H"),t.types.includes(u.a.Slums)&&(r="S"),t.types.includes(u.a.StockMarket)&&(r="$"),t.types.includes(u.a.TechVendor)&&(r="T"),t.types.includes(u.a.TravelAgency)&&(r="T"),t.types.includes(u.a.University)&&(r="U"),t.types.includes(u.a.Casino)&&(r="¢"),t.types.includes(u.a.Special)&&(r="?"),t?a.createElement("span",{"aria-label":t.name,key:t.name,className:n.location,onClick:()=>p(e,t)},a.createElement("b",null,r)):a.createElement("span",null,"*")}function y(t){const e=/[A-Z]/g,n={A:0,B:1,C:2,D:3,E:4,F:5,G:6,H:7,I:8,J:9,K:10,L:11,M:12,N:13,O:14,P:15,Q:16,R:17,S:18,T:19,U:20,V:21,W:22,X:23,Y:24,Z:25},r=a=>{const r=[],i=[];let s;for(;null!==(s=e.exec(a));)i.push(s);if(0===i.length)return r.push(a),r;for(let e=0;ea.createElement(a.Fragment,{key:t},a.createElement(f.a,{onClick:()=>p(e,o.a[t])},t),a.createElement("br",null)));return a.createElement(a.Fragment,null,n)}function E(){const t=l.b.Player(),e=r.a[t.city];return a.createElement(a.Fragment,null,a.createElement(c.a,null,e.name),s.a.DisableASCIIArt?a.createElement(b,{city:e}):a.createElement(y,{city:e}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return b}));var a=n(0),r=n.n(a),i=n(38),o=n(8),s=n(19),l=n(1),c=n(130),f=n(277),u=n(74),m=n(76),h=n(1332),d=n.n(h),p=n(467),g=n.n(p),y=n(1331);function b(t){const[e,n]=Object(a.useState)(t.options.theme),[h,p]=Object(a.useState)(t.options.insertSpaces),[b,E]=Object(a.useState)(t.options.fontSize),[v,k]=Object(a.useState)(t.options.wordWrap),[_,w]=Object(a.useState)(t.options.vim),[S,x]=Object(a.useState)(!1);return r.a.createElement(i.a,{open:t.open,onClose:t.onClose},r.a.createElement(y.a,{open:S,onClose:()=>x(!1)}),r.a.createElement(s.a,{display:"flex",flexDirection:"row",alignItems:"center"},r.a.createElement(l.a,null,"Theme: "),r.a.createElement(c.a,{onChange:t=>n(t.target.value),value:e},r.a.createElement(u.a,{value:"monokai"},"monokai"),r.a.createElement(u.a,{value:"solarized-dark"},"solarized-dark"),r.a.createElement(u.a,{value:"solarized-light"},"solarized-light"),r.a.createElement(u.a,{value:"vs-dark"},"dark"),r.a.createElement(u.a,{value:"light"},"light"),r.a.createElement(u.a,{value:"dracula"},"dracula"),r.a.createElement(u.a,{value:"one-dark"},"one-dark"),r.a.createElement(u.a,{value:"customTheme"},"Custom theme")),r.a.createElement(o.a,{onClick:()=>x(!0),sx:{mx:1},startIcon:r.a.createElement(d.a,null)},"Edit custom theme")),r.a.createElement(s.a,{display:"flex",flexDirection:"row",alignItems:"center"},r.a.createElement(l.a,null,"Use whitespace over tabs: "),r.a.createElement(f.a,{onChange:t=>p(t.target.checked),checked:h})),r.a.createElement(s.a,{display:"flex",flexDirection:"row",alignItems:"center"},r.a.createElement(l.a,null,"Word Wrap: "),r.a.createElement(c.a,{onChange:t=>k(t.target.value),value:v},r.a.createElement(u.a,{value:"off"},"Off"),r.a.createElement(u.a,{value:"on"},"On"),r.a.createElement(u.a,{value:"bounded"},"Bounded"),r.a.createElement(u.a,{value:"wordWrapColumn"},"Word Wrap Column"))),r.a.createElement(s.a,{display:"flex",flexDirection:"row",alignItems:"center"},r.a.createElement(l.a,null,"Enable vim mode: "),r.a.createElement(f.a,{onChange:t=>w(t.target.checked),checked:_})),r.a.createElement(s.a,{display:"flex",flexDirection:"row",alignItems:"center"},r.a.createElement(m.a,{type:"number",label:"Font size",value:b,onChange:function(t){const e=parseFloat(t.target.value);isNaN(e)||E(e)}})),r.a.createElement("br",null),r.a.createElement(o.a,{onClick:function(){t.save({theme:e,insertSpaces:h,fontSize:b,wordWrap:v,vim:_}),t.onClose()},startIcon:r.a.createElement(g.a,null)},"Save"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return w}));var a=n(1479),r=n(1503),i=n(1838),o=n(21),s=n(76),l=n(1),c=n(45),f=n(19),u=n(8),m=n(111),h=n(115),d=n.n(h),p=n(623),g=n(0),y=n.n(g),b=n(6),E=n(38),v=n(147),k=n(123);function _({label:t,themePath:e,onColorChange:n,color:r,defaultColor:i}){return void 0===r&&(console.error(`color ${e} was undefined, reverting to default`),r=i),y.a.createElement(y.a.Fragment,null,y.a.createElement(o.a,{title:t},y.a.createElement("span",null,y.a.createElement(s.a,{label:e,value:"#"+r,sx:{display:"block",my:1},InputProps:{startAdornment:y.a.createElement(y.a.Fragment,null,y.a.createElement(p.a,{hideTextfield:!0,deferred:!0,value:"#"+r,onChange:t=>n(e,t.hex),disableAlpha:!0})),endAdornment:y.a.createElement(y.a.Fragment,null,y.a.createElement(m.a,{onClick:()=>n(e,i)},y.a.createElement(a.a,{color:"primary"})))}}))))}function w(t){const e=Object(g.useState)(!1)[1];function n(){e(t=>!t)}const[a,o]=Object(g.useState)(JSON.parse(JSON.stringify(b.a.EditorTheme)));function m(t,e){o(d.a.set(a,t,e)),n()}return y.a.createElement(E.a,{open:t.open,onClose:()=>{o(b.a.EditorTheme),t.onClose()}},y.a.createElement(l.a,{variant:"h4"},"Customize Editor theme"),y.a.createElement(l.a,null,"Hover over input boxes for more information"),y.a.createElement(c.a,{sx:{p:1,my:1}},y.a.createElement(v.a,{checked:"vs"===a.base,onChange:t=>{o(d.a.set(a,"base",t?"vs":"vs-dark")),n()},text:"Use light theme as base",tooltip:y.a.createElement(y.a.Fragment,null,"If enabled, the ",y.a.createElement("code",null,"vs")," light theme will be used as the theme base, otherwise,"," ",y.a.createElement("code",null,"vs-dark")," will be used.")}),y.a.createElement(f.a,{display:"grid",sx:{gridTemplateColumns:"1fr 1fr",width:"fit-content",gap:1}},y.a.createElement(f.a,null,y.a.createElement(l.a,{variant:"h6"},"UI"),y.a.createElement(_,{label:"Background color",themePath:"common.bg",onColorChange:m,color:a.common.bg,defaultColor:k.a.common.bg}),y.a.createElement(_,{label:"Current line and minimap background color",themePath:"ui.line",onColorChange:m,color:a.ui.line,defaultColor:k.a.ui.line}),y.a.createElement(_,{label:"Base text color",themePath:"common.fg",onColorChange:m,color:a.common.fg,defaultColor:k.a.common.fg}),y.a.createElement(_,{label:"Popup background color",themePath:"ui.panel.bg",onColorChange:m,color:a.ui.panel.bg,defaultColor:k.a.ui.panel.bg}),y.a.createElement(_,{label:"Background color for selected item in popup",themePath:"ui.panel.selected",onColorChange:m,color:a.ui.panel.selected,defaultColor:k.a.ui.panel.selected}),y.a.createElement(_,{label:"Popup border color",themePath:"ui.panel.border",onColorChange:m,color:a.ui.panel.border,defaultColor:k.a.ui.panel.border}),y.a.createElement(_,{label:"Background color of highlighted text",themePath:"ui.selection.bg",onColorChange:m,color:a.ui.selection.bg,defaultColor:k.a.ui.selection.bg})),y.a.createElement(f.a,null,y.a.createElement(l.a,{variant:"h6"},"Syntax"),y.a.createElement(_,{label:"Numbers, function names, and other key vars",themePath:"common.accent",onColorChange:m,color:a.common.accent,defaultColor:k.a.common.accent}),y.a.createElement(_,{label:"Keywords",themePath:"syntax.keyword",onColorChange:m,color:a.syntax.keyword,defaultColor:k.a.syntax.keyword}),y.a.createElement(_,{label:"Strings",themePath:"syntax.string",onColorChange:m,color:a.syntax.string,defaultColor:k.a.syntax.string}),y.a.createElement(_,{label:"Regexp literals as well as escapes within strings",themePath:"syntax.regexp",onColorChange:m,color:a.syntax.regexp,defaultColor:k.a.syntax.regexp}),y.a.createElement(_,{label:"Constants",themePath:"syntax.constant",onColorChange:m,color:a.syntax.constant,defaultColor:k.a.syntax.constant}),y.a.createElement(_,{label:"Entities",themePath:"syntax.entity",onColorChange:m,color:a.syntax.entity,defaultColor:k.a.syntax.entity}),y.a.createElement(_,{label:"'this', 'ns', types, and tags",themePath:"syntax.tag",onColorChange:m,color:a.syntax.tag,defaultColor:k.a.syntax.tag}),y.a.createElement(_,{label:"Netscript functions and constructors",themePath:"syntax.markup",onColorChange:m,color:a.syntax.markup,defaultColor:k.a.syntax.markup}),y.a.createElement(_,{label:"Errors",themePath:"syntax.error",onColorChange:m,color:a.syntax.error,defaultColor:k.a.syntax.error}),y.a.createElement(_,{label:"Comments",themePath:"syntax.comment",onColorChange:m,color:a.syntax.comment,defaultColor:k.a.syntax.comment})))),y.a.createElement(c.a,{sx:{p:1}},y.a.createElement(s.a,{multiline:!0,fullWidth:!0,maxRows:10,label:"import / export theme",value:JSON.stringify(a,void 0,2),onChange:function(t){try{const e=JSON.parse(t.target.value);if("object"!=typeof e)return;o(e)}catch(t){}}}),y.a.createElement(f.a,{sx:{mt:1}},y.a.createElement(u.a,{onClick:()=>{b.a.EditorTheme={...a},t.onClose()},startIcon:y.a.createElement(r.a,null)},"Save"),y.a.createElement(u.a,{onClick:()=>{o(k.a),n()},startIcon:y.a.createElement(i.a,null)},"Reset to default"))))}},,function(t,e,n){"use strict";e.a='/**\n * @public\n */\ntype FilenameOrPID = number | string;\n\n/**\n * @public\n */\ninterface Player {\n hacking: number;\n hp: number;\n max_hp: number;\n strength: number;\n defense: number;\n dexterity: number;\n agility: number;\n charisma: number;\n intelligence: number;\n hacking_chance_mult: number;\n hacking_speed_mult: number;\n hacking_money_mult: number;\n hacking_grow_mult: 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_mult: number;\n strength_mult: number;\n defense_mult: number;\n dexterity_mult: number;\n agility_mult: number;\n charisma_mult: number;\n hacking_exp_mult: number;\n strength_exp_mult: number;\n defense_exp_mult: number;\n dexterity_exp_mult: number;\n agility_exp_mult: number;\n charisma_exp_mult: number;\n company_rep_mult: number;\n faction_rep_mult: number;\n numPeopleKilled: number;\n money: number;\n city: string;\n location: string;\n companyName: string;\n crime_money_mult: number;\n crime_success_mult: number;\n isWorking: boolean;\n workType: string;\n currentWorkFactionName: string;\n currentWorkFactionDescription: string;\n workHackExpGainRate: number;\n workStrExpGainRate: number;\n workDefExpGainRate: number;\n workDexExpGainRate: number;\n workAgiExpGainRate: number;\n workChaExpGainRate: number;\n workRepGainRate: number;\n workMoneyGainRate: number;\n workMoneyLossRate: number;\n workHackExpGained: number;\n workStrExpGained: number;\n workDefExpGained: number;\n workDexExpGained: number;\n workAgiExpGained: number;\n workChaExpGained: number;\n workRepGained: number;\n workMoneyGained: number;\n createProgramName: string;\n createProgramReqLvl: number;\n className: string;\n crimeType: string;\n work_money_mult: number;\n hacknet_node_money_mult: number;\n hacknet_node_purchase_cost_mult: number;\n hacknet_node_ram_cost_mult: number;\n hacknet_node_core_cost_mult: number;\n hacknet_node_level_cost_mult: number;\n hasWseAccount: boolean;\n hasTixApiAccess: boolean;\n has4SData: boolean;\n has4SDataTixApi: boolean;\n bladeburner_max_stamina_mult: number;\n bladeburner_stamina_gain_mult: number;\n bladeburner_analysis_mult: number;\n bladeburner_success_chance_mult: number;\n bitNodeN: number;\n totalPlaytime: number;\n playtimeSinceLastAug: number;\n playtimeSinceLastBitnode: number;\n jobs: any;\n factions: string[];\n tor: boolean;\n hasCorporation: boolean;\n inBladeburner: boolean;\n entropy: number;\n}\n\n/**\n * @public\n */\nexport interface RunningScript {\n /** Arguments the script was called with */\n args: string[];\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_mult?: number;\n /** Multiplier to strength skill */\n strength_mult?: number;\n /** Multiplier to defense skill */\n defense_mult?: number;\n /** Multiplier to dexterity skill */\n dexterity_mult?: number;\n /** Multiplier to agility skill */\n agility_mult?: number;\n /** Multiplier to charisma skill */\n charisma_mult?: number;\n /** Multiplier to hacking experience gain rate */\n hacking_exp_mult?: number;\n /** Multiplier to strength experience gain rate */\n strength_exp_mult?: number;\n /** Multiplier to defense experience gain rate */\n defense_exp_mult?: number;\n /** Multiplier to dexterity experience gain rate */\n dexterity_exp_mult?: number;\n /** Multiplier to agility experience gain rate */\n agility_exp_mult?: number;\n /** Multiplier to charisma experience gain rate */\n charisma_exp_mult?: number;\n /** Multiplier to chance of successfully performing a hack */\n hacking_chance_mult?: number;\n /** Multiplier to hacking speed */\n hacking_speed_mult?: number;\n /** Multiplier to amount of money the player gains from hacking */\n hacking_money_mult?: number;\n /** Multiplier to amount of money injected into servers using grow */\n hacking_grow_mult?: number;\n /** Multiplier to amount of reputation gained when working */\n company_rep_mult?: number;\n /** Multiplier to amount of reputation gained when working */\n faction_rep_mult?: number;\n /** Multiplier to amount of money gained from crimes */\n crime_money_mult?: number;\n /** Multiplier to crime success rate */\n crime_success_mult?: number;\n /** Multiplier to amount of money gained from working */\n work_money_mult?: number;\n /** Multiplier to amount of money produced by Hacknet Nodes */\n hacknet_node_money_mult?: number;\n /** Multiplier to cost of purchasing a Hacknet Node */\n hacknet_node_purchase_cost_mult?: number;\n /** Multiplier to cost of ram for a Hacknet Node */\n hacknet_node_ram_cost_mult?: number;\n /** Multiplier to cost of core for a Hacknet Node */\n hacknet_node_core_cost_mult?: number;\n /** Multiplier to cost of leveling up a Hacknet Node */\n hacknet_node_level_cost_mult?: number;\n /** Multiplier to Bladeburner max stamina */\n bladeburner_max_stamina_mult?: number;\n /** Multiplier to Bladeburner stamina gain rate */\n bladeburner_stamina_gain_mult?: number;\n /** Multiplier to effectiveness in Bladeburner Field Analysis */\n bladeburner_analysis_mult?: number;\n /** Multiplier to success chance in Bladeburner contracts/operations */\n bladeburner_success_chance_mult?: 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[];\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 * Short summary of the players skills.\n * @public\n */\nexport interface PlayerSkills {\n /** Hacking level */\n hacking: number;\n /** Strength level */\n strength: number;\n /** Defense level */\n defense: number;\n /** Dexterity level */\n dexterity: number;\n /** Agility level */\n agility: number;\n /** Charisma level */\n charisma: number;\n /** Intelligence level */\n intelligence: 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 CharacterInfo {\n /** Current BitNode number */\n bitnode: number;\n /** Name of city you are currently in */\n city: string;\n /** Array of factions you are currently a member of */\n factions: string[];\n /** Current health points */\n hp: number;\n /** Array of all jobs */\n jobs: string[];\n /** Array of job positions for all companies you are employed at. Same order as \'jobs\' */\n jobTitles: string[];\n /** Maximum health points */\n maxHp: number;\n /** Boolean indicating whether or not you have a tor router */\n tor: boolean;\n /** Object with many of the player\'s multipliers from Augmentations/Source Files */\n mult: CharacterMult;\n /** Timed worked in ms */\n timeWorked: number;\n /** Hacking experience earned so far from work */\n workHackExpGain: number;\n /** Str experience earned so far from work */\n workStrExpGain: number;\n /** Def experience earned so far from work */\n workDefExpGain: number;\n /** Dex experience earned so far from work */\n workDexExpGain: number;\n /** Agi experience earned so far from work */\n workAgiExpGain: number;\n /** Cha experience earned so far from work */\n workChaExpGain: number;\n /** Reputation earned so far from work, if applicable */\n workRepGain: number;\n /** Money earned so far from work, if applicable */\n workMoneyGain: number;\n /** total hacking exp */\n hackingExp: number;\n /** total strength exp */\n strengthExp: number;\n /** total defense exp */\n defenseExp: number;\n /** total dexterity exp */\n dexterityExp: number;\n /** total agility exp */\n agilityExp: number;\n /** total charisma exp */\n charismaExp: 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 "Slum Snakes": GangOtherInfoObject;\n Tetrads: GangOtherInfoObject;\n "The Syndicate": GangOtherInfoObject;\n "The Dark Army": GangOtherInfoObject;\n "Speakers for the Dead": GangOtherInfoObject;\n NiteSec: GangOtherInfoObject;\n "The Black Hand": 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 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 /** Current hp of the sleeve */\n hp: number;\n /** Max hp of the sleeve */\n maxHp: number;\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 /** Time spent on the current task in milliseconds */\n timeWorked: number;\n /** Earnings synchronized to other sleeves */\n earningsForSleeves: SleeveWorkGains;\n /** Earnings synchronized to the player */\n earningsForPlayer: SleeveWorkGains;\n /** Earnings for this sleeve */\n earningsForTask: SleeveWorkGains;\n /** Faction or company reputation gained for the current task */\n workRepGain: number;\n}\n\n/**\n * Object representing a sleeve current task.\n * @public\n */\nexport interface SleeveTask {\n /** Task type */\n task: string;\n /** Crime currently attempting, if any */\n crime: string;\n /** Location of the task, if any */\n location: string;\n /** Stat being trained at the gym, if any */\n gymStatType: string;\n /** Faction work type being performed, if any */\n factionWorkType: string;\n /** Class being taken at university, if any */\n className: string;\n}\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 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 buy(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 sell(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 short(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 actions 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 actions 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 * @returns The number of milliseconds it takes to attempt the specified crime.\n */\n commitCrime(crime: string): 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 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 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 * Returns an object with the Player’s stats.\n * @deprecated use getPlayer\n *\n * @remarks\n * RAM cost: 0.5 GB * 16/4/1\n *\n *\n * @example\n * ```ts\n * res = getStats();\n * print(\'My charisma level is: \' + res.charisma);\n * ```\n * @returns Object with the Player’s stats.\n */\n getStats(): PlayerSkills;\n\n /**\n * Returns an object with various information about your character.\n * @deprecated use getPlayer\n *\n * @remarks\n * RAM cost: 0.5 GB * 16/4/1\n *\n *\n * @returns Object with various information about your character.\n */\n getCharacterInformation(): CharacterInfo;\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/**\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 it 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 cores are successfully purchased, 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 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 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 * @returns Number of hashes required for the specified upgrade.\n */\n hashCost(upgName: string): 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 * @returns True if the upgrade is successfully purchased, and false otherwise..\n */\n spendHashes(upgName: string, upgTarget?: string): 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.\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 Number of skill points needed to upgrade the specified skill.\n */\n getSkillUpgradeCost(name: string): number;\n\n /**\n * Upgrade skill.\n * @remarks\n * RAM cost: 4 GB\n *\n * Attempts to upgrade the specified Bladeburner skill.\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 * @returns true if the skill is successfully upgraded, and false otherwise.\n */\n upgradeSkill(name: string): 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” (seconds) 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 - Host 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(answer: string[] | number, filename: string, host?: string, opts?: CodingAttemptOptions): 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 - Host 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 - Host 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\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): any;\n\n /**\n * Get the number of attempt 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 - Host 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” (seconds) 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 * 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 * 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 /** 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}\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 InfiltrationLocation {\n location: any;\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(): string[];\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 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: 0 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 * @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: any[]): 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: any[]): 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 will return 0 without running the script.\n * However, running this function with a negative numThreads argument 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: Array): 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 0 or a negative numThreads argument 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: Array): 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 * @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[]): 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[]): 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", "helios", "home");\n *\n * //Tries to copy three files from rothman-uni to home computer:\n * files = ["foo1.lit", "foo2.script", "foo3.script"];\n * scp(files, "rothman-uni", "home");\n * ```\n * @example\n * ```ts\n * // NS2:\n * //Copies foo.lit from the helios server to the home computer:\n * await ns.scp("foo.lit", "helios", "home");\n *\n * //Tries to copy three files from rothman-uni to home computer:\n * files = ["foo1.lit", "foo2.script", "foo3.script"];\n * await ns.scp(files, "rothman-uni", "home");\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 * await ns.scp(files, "home", server);\n * ```\n * @param files - Filename or an array of filenames of script/literature files to copy.\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 * @param destination - Host of the destination server, which is the server to which the file will be copied.\n * @returns True if the script/literature file is successfully copied over and false otherwise. If the files argument is an array then this function will return true if at least one of the files in the array is successfully copied.\n */\n scp(files: string | string[], destination: string): Promise;\n\n /**\n * {@inheritDoc NS.(scp:1)}\n * @example\n * ```ts\n * // NS1:\n * //Copies foo.lit from the helios server to the home computer:\n * scp("foo.lit", "helios", "home");\n *\n * //Tries to copy three files from rothman-uni to home computer:\n * files = ["foo1.lit", "foo2.script", "foo3.script"];\n * scp(files, "rothman-uni", "home");\n * ```\n * @example\n * ```ts\n * // NS2:\n * //Copies foo.lit from the helios server to the home computer:\n * await ns.scp("foo.lit", "helios", "home");\n *\n * //Tries to copy three files from rothman-uni to home computer:\n * files = ["foo1.lit", "foo2.script", "foo3.script"];\n * await ns.scp(files, "rothman-uni", "home");\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 * await ns.scp(files, "home", server);\n * ```\n */\n scp(files: string | string[], source: string, destination: string): Promise;\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[]): 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(filename?: FilenameOrPID, hostname?: string, ...args: (string | number)[]): 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).\n *\n * This function will write data to that text file. If the specified text file does not exist,\n * then it will be created. The third argument mode, defines how the data will be written to\n * the text 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 text 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 text file.\n *\n * @param handle - Filename of the text file that will be written to.\n * @param data - Data to write.\n * @param mode - Defines the write mode. Only valid when writing to text files.\n */\n write(handle: string, data?: string[] | number | string, mode?: "w" | "a"): Promise;\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).\n *\n * This function will return the data in the specified text\n * file. If the text file does not exist, an empty string will be returned.\n *\n * @param handle - Filename to read from.\n * @returns Data in the specified text file.\n */\n read(handle: string): any;\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): any;\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): any;\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 *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 function takes in an optional hackLvl parameter that can be specified to see what the hack time would be at different hacking levels.\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. Returns Infinity if called on a Hacknet Server.\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 function takes in an optional hackLvl parameter that can be specified to see what the grow time would be at different hacking levels.\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. Returns Infinity if called on a Hacknet Server.\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 function takes in an optional hackLvl parameter that can be specified to see what the weaken time would be at different hacking levels.\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. Returns Infinity if called on a Hacknet Server.\n */\n getWeakenTime(host: string): 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 * This function can also be called with no arguments.\n * If called with no arguments, then this function will return 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 * @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(): [number, number];\n\n /**\n * {@inheritDoc NS.(getScriptIncome:1)}\n */\n getScriptIncome(script: string, host: string, ...args: string[]): 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(): number;\n\n /**\n * {@inheritDoc NS.(getScriptExpGain:1)}\n */\n getScriptExpGain(script: string, host: string, ...args: string[]): 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: any): 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: any, 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, .ns, .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 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 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.ns\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[]][]): any;\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 * @returns A promise that is fulfilled when the assignment is complete.\n */\n assignJob(divisionName: string, cityName: string, employeeName: string, job: string): Promise;\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 Amount of happiness increased.\n */\n throwParty(divisionName: string, cityName: string, costPerEmployee: number): Promise;\n /**\n * Buy coffee for your employees\n * @param divisionName - Name of the division\n * @param cityName - Name of the city\n * @returns A promise that is fulfilled when the coffee is served.\n */\n buyCoffee(divisionName: string, cityName: string): Promise;\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 A promise that is fulfilled when the assignment is complete.\n */\n setAutoJobAssignment(divisionName: string, cityName: string, job: string, amount: number): Promise;\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: any, acityName: any, 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: any, acityName: any): 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 * 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 * @param amountShares - Amount of shares to bribe\n * @returns True if successful, false if not\n */\n bribe(factionName: string, amountCash: number, amountShares: 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 percent - Percent of profit to issue as dividends.\n */\n issueDividends(percent: 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 /** 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 */\ninterface 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 */\ninterface 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 /** 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[]][]): any;\n}\n'},,,,,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(787),r=n(0),i=n(1),o=n(19);function s(t){const e=function(t,e){let n=-1;for(let a=0;a{if(a<=e+1)return r.createElement(i.a,{key:a},"[",n.fulfilled(t.player)?"x":" ","] ",n.title)});return r.createElement(r.Fragment,null,r.createElement(i.a,{variant:"h4"},"Milestones"),r.createElement(o.a,{mx:2},r.createElement(i.a,null,"Milestones don't reward you for completing them. They are here to guide you if you're lost. They will reset when you install Augmentations."),r.createElement("br",null),r.createElement(i.a,null,"Completing fl1ght.exe"),n))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return k}));var a=n(0),r=n.n(a),i=n(1),o=n(248),s=n(97),l=n(150),c=n(121),f=n(144),u=n(19),m=n(246),h=n(1344),d=n(328),p=n(592),g=n(578),y=n(115),b=n.n(y);function E({terminal:t}){return r.a.createElement(i.a,{color:"primary",paragraph:!1},t.getProgressText())}const v=Object(c.a)(t=>Object(f.a)({nopadding:{padding:t.spacing(0)},preformatted:{whiteSpace:"pre-wrap",overflowWrap:"anywhere",margin:t.spacing(0)},list:{padding:t.spacing(0),height:"100%"},success:{whiteSpace:"pre-wrap",overflowWrap:"anywhere",margin:t.spacing(0),color:t.colors.success},error:{whiteSpace:"pre-wrap",overflowWrap:"anywhere",margin:t.spacing(0),color:t.palette.error.main},primary:{whiteSpace:"pre-wrap",overflowWrap:"anywhere",margin:t.spacing(0),color:t.palette.primary.main},info:{whiteSpace:"pre-wrap",overflowWrap:"anywhere",margin:t.spacing(0),color:t.palette.info.main},warning:{whiteSpace:"pre-wrap",overflowWrap:"anywhere",margin:t.spacing(0),color:t.palette.warning.main}}));function k({terminal:t,router:e,player:n}){const c=Object(a.useRef)(null),f=Object(a.useState)(0)[1],[y,k]=Object(a.useState)(0);function _(){const t=c.current;if(null!==t)return window.setTimeout(()=>t.scrollIntoView(!0),50)}function w(t){return{error:x.error,success:x.success,info:x.info,warn:x.warning}[t]||x.primary}function S(t){const e={0:"#404040",1:"#ff0000",2:"#00ff00",3:"#ffff00",4:"#0000ff",5:"#ff00ff",6:"#00ffff",7:"#ffffff"},n={0:"#000000",1:"#800000",2:"#008000",3:"#808000",4:"#000080",5:"#800080",6:"#008080",7:"#c0c0c0"},a={};if(null===t||"0"===t)return a;const r=t.split(";").map(t=>parseInt(t)).filter((t,e,n)=>5!=t||0==e||38!=n[e-1]&&48!=n[e-1]);let i=null;return r.forEach(t=>{null!==i?(a[i]=(t=>{if(0<=t&&t<8)return e[t];if(8<=t&&t<16)return n[t];if(16<=t&&t<232){const e=t-16,n=Math.floor(e/36),a=Math.floor(e%36/6),r=Math.floor(e%6/1);return`rgb(${n<=0?0:55+40*n}, ${a<=0?0:55+40*a}, ${r<=0?0:55+40*r})`}if(232<=t&&t<256){const e=10*(t-232)+8;return`rgb(${e}, ${e}, ${e})`}return"initial"})(t),i=null):1==t?a.fontWeight="bold":4==t?a.textDecoration="underline":30<=t&&t<38?e[t%10]&&(a.color=e[t%10]):40<=t&&t<48?n[t%10]&&(a.backgroundColor=n[t%10]):38==t?i="color":48==t&&(i="backgroundColor")}),void 0!==a.backgroundColor&&(a.display="inline-block"),a}Object(a.useEffect)(()=>{const t=b.a.debounce(async()=>{f(t=>t+1)},25,{maxWait:50}),e=d.b.subscribe(t);return()=>{t.cancel(),e()}},[]),Object(a.useEffect)(()=>{const t=b.a.debounce(async()=>{k(t=>t+1)},25,{maxWait:50}),e=d.a.subscribe(t);return()=>{t.cancel(),e()}},[]),_(),Object(a.useEffect)(()=>{let t;const e=setTimeout(()=>{var e;t=null!==(e=_())&&void 0!==e?e:0},50);return()=>{clearTimeout(e),clearTimeout(t)}},[]);const x=v();return r.a.createElement(r.a.Fragment,null,r.a.createElement(u.a,{width:"100%",minHeight:"100vh",display:"flex",alignItems:"flex-end"},r.a.createElement(o.a,{key:y,id:"terminal",classes:{root:x.list}},t.outputHistory.map((e,a)=>e instanceof m.b?r.a.createElement(s.a,{key:a,classes:{root:x.nopadding}},r.a.createElement(i.a,{classes:{root:w(e.color)},paragraph:!1},function(t){const e=[];if("string"==typeof t.text){const n=new RegExp("\\[(?.*?)m","ug"),a=[{0:"",index:0,groups:{code:null}},...t.text.matchAll(n),null];a.length>2&&a.slice(0,-1).forEach((n,r)=>{const i=a[r+1];if(!n||void 0===n.index||void 0===n.groups)return;const o=n.index+n[0].length,s=i?i.index:t.text.length,l=t.text.slice(o,s);o!==s&&e.push({code:n.groups.code,text:l})})}return 0===e.length&&e.push({code:null,text:t.text}),r.a.createElement(i.a,{classes:{root:w(t.color)},paragraph:!1},e.map((t,e)=>{const n=S(t.code);return b.a.isEmpty(n)?t.text:r.a.createElement(i.a,{key:e,paragraph:!1,component:"span",sx:n},t.text)}))}(e))):e instanceof m.c?r.a.createElement(s.a,{key:a,classes:{root:x.nopadding}},r.a.createElement(i.a,{classes:{root:x.preformatted},paragraph:!1},e.raw)):e instanceof m.a?r.a.createElement(s.a,{key:a,classes:{root:x.nopadding}},r.a.createElement(i.a,null,e.dashes,"> "),r.a.createElement(l.a,{classes:{root:x.preformatted},color:"secondary",paragraph:!1,onClick:()=>t.connectToServer(n,e.hostname)},r.a.createElement(i.a,null,e.hostname))):void 0),null!==t.action&&r.a.createElement(s.a,{classes:{root:x.nopadding}},r.a.createElement(E,{terminal:t})," ")),r.a.createElement("div",{ref:c})),r.a.createElement(u.a,{position:"sticky",bottom:0,width:"100%",px:0},r.a.createElement(h.a,{player:n,router:e,terminal:t})),r.a.createElement(p.b,null),r.a.createElement(g.b,null))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return y}));var a=n(0),r=n.n(a),i=n(1),o=n(121),s=n(144),l=n(45),c=n(799),f=n(76),u=n(27),m=n(1345),h=n(1347),d=n(6);const p=Object(o.a)(t=>Object(s.a)({textfield:{margin:t.spacing(0)},input:{backgroundColor:t.colors.backgroundprimary},nopadding:{padding:t.spacing(0)},preformatted:{whiteSpace:"pre-wrap",margin:t.spacing(0)},list:{padding:t.spacing(0),height:"100%"}}));let g="";function y({terminal:t,router:e,player:n}){const o=Object(a.useRef)(null),[s,y]=Object(a.useState)(g),[b,E]=Object(a.useState)(),[v,k]=Object(a.useState)([]),_=p();function w(t,e){g=t,y(t),e&&E({postUpdate:e})}function S(t){const e=o.current;if(!e)return;const n=s.length,a=e.selectionStart;if(null===a)return;const r=e.value;switch(t.toLowerCase()){case"backspace":a>0&&a<=n+1&&w(r.substr(0,a-1)+r.substr(a));break;case"deletewordbefore":for(let t=a-1;t>-2;--t)if((r.charAt(t)===u.a.SPACE||-1===t)&&t!==a-1)return void w(r.substr(0,t+1)+r.substr(a),()=>{const e=o.current;null==e||e.setSelectionRange(t+1,t+1)});break;case"deletewordafter":for(let t=a+1;t<=s.length+1;++t)if(r.charAt(t)===u.a.SPACE||t===s.length+1)return void w(r.substr(0,a)+r.substr(t+1),()=>{const t=o.current;null==t||t.setSelectionRange(a,a)});break;case"clearafter":w(r.substr(0,a));break;case"clearbefore":w(r.substr(a),()=>x("home"))}}function x(t){const e=o.current;if(!e)return;const n=s.length,a=e.selectionStart;if(null!==a)switch(t.toLowerCase()){case"home":e.setSelectionRange(0,0);break;case"end":e.setSelectionRange(n,n);break;case"prevchar":a>0&&e.setSelectionRange(a-1,a-1);break;case"prevword":for(let t=a-2;t>=0;--t)if(e.value.charAt(t)===u.a.SPACE)return void e.setSelectionRange(t+1,t+1);e.setSelectionRange(0,0);break;case"nextchar":e.setSelectionRange(a+1,a+1);break;case"nextword":for(let t=a+1;t<=n;++t)if(e.value.charAt(t)===u.a.SPACE)return void e.setSelectionRange(t,t);e.setSelectionRange(n,n);break;default:console.warn("Invalid loc argument in Terminal.moveTextCursor()")}}return 0===t.commandHistory.length&&n.terminalCommandHistory.length>0&&(t.commandHistory=n.terminalCommandHistory,t.commandHistoryIndex=t.commandHistory.length),Object(a.useEffect)(()=>{null!=b&&b.postUpdate&&(b.postUpdate(),E(null))},[b]),Object(a.useEffect)(()=>{function a(a){if(t.contractOpen)return;if(null!==t.action&&a.key===u.a.C&&a.ctrlKey)return void t.finishAction(e,n,!0);const r=o.current;a.ctrlKey||a.metaKey||a.key===u.a.C&&(a.ctrlKey||a.metaKey)||r&&r.focus()}return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)}),r.a.createElement(r.a.Fragment,null,r.a.createElement(f.a,{fullWidth:!0,color:null===t.action?"primary":"secondary",autoFocus:!0,disabled:null!==t.action,autoComplete:"off",value:s,classes:{root:_.textfield},onChange:function(t){w(t.target.value),k([])},inputRef:o,InputProps:{id:"terminal-input",className:_.input,startAdornment:r.a.createElement(i.a,{color:null===t.action?"primary":"secondary",flexShrink:0},"[",n.getCurrentServer().hostname," ~",t.cwd(),"]> "),spellCheck:!1,onBlur:()=>k([]),onKeyDown:async function(a){if(a.key===u.a.ENTER&&""!==s)return a.preventDefault(),t.print(`[${n.getCurrentServer().hostname} ~${t.cwd()}]> ${s}`),t.executeCommands(e,n,s),void w("");if(a.key===u.a.TAB&&""!==s){a.preventDefault();let e=s;const r=e.lastIndexOf(";");-1!==r&&(e=e.slice(r+1)),e=e.trim(),e=e.replace(/\s\s+/g," ");const i=e.split(" ");let o=i.length-2;o<-1&&(o=0);const l=await Object(m.a)(n,e,o,t.cwd());if(0==l.length)return;let c="",f="";if(0==i.length)return;1==i.length?f=i[0]:2==i.length?(f=i[0],c=i[1]):3==i.length?(f=i[0]+" "+i[1],c=i[2]):(c=i.pop()+"",f=i.join(" "));let u=Object(h.a)(f,c,l,s);"string"==typeof u&&""!==u&&(u.endsWith(" ")||u.endsWith("/")||1!==l.length||(u+=" "),w(u)),Array.isArray(u)&&k(u)}if(a.key===u.a.L&&a.ctrlKey&&(a.preventDefault(),t.clear()),a.key===u.a.UP_ARROW||d.a.EnableBashHotkeys&&a.key===u.a.P&&a.ctrlKey){d.a.EnableBashHotkeys&&a.preventDefault();const e=t.commandHistoryIndex,n=t.commandHistory.length;if(0==n)return;(e<0||e>n)&&(t.commandHistoryIndex=n),0!=e&&--t.commandHistoryIndex;w(t.commandHistory[t.commandHistoryIndex]);const r=o.current;r&&setTimeout((function(){r.selectionStart=r.selectionEnd=1e4}),10)}if(a.key===u.a.DOWN_ARROW||d.a.EnableBashHotkeys&&a.key===u.a.M&&a.ctrlKey){d.a.EnableBashHotkeys&&a.preventDefault();const e=t.commandHistoryIndex,n=t.commandHistory.length;if(0==n)return;if((e<0||e>n)&&(t.commandHistoryIndex=n),e==n||e==n-1)t.commandHistoryIndex=n,w("");else{++t.commandHistoryIndex;w(t.commandHistory[t.commandHistoryIndex])}}d.a.EnableBashHotkeys&&(a.code===u.b.A&&a.ctrlKey&&(a.preventDefault(),x("home")),a.code===u.b.E&&a.ctrlKey&&(a.preventDefault(),x("end")),a.code===u.b.B&&a.ctrlKey&&(a.preventDefault(),x("prevchar")),a.code===u.b.B&&a.altKey&&(a.preventDefault(),x("prevword")),a.code===u.b.F&&a.ctrlKey&&(a.preventDefault(),x("nextchar")),a.code===u.b.F&&a.altKey&&(a.preventDefault(),x("nextword")),a.code!==u.b.H&&a.code!==u.b.D||!a.ctrlKey||(S("backspace"),a.preventDefault()),a.code===u.b.W&&a.ctrlKey&&(a.preventDefault(),S("deletewordbefore")),a.code===u.b.D&&a.altKey&&(a.preventDefault(),S("deletewordafter")),a.code===u.b.U&&a.ctrlKey&&(a.preventDefault(),S("clearbefore")),a.code===u.b.K&&a.ctrlKey&&(a.preventDefault(),S("clearafter")))}}}),r.a.createElement(c.a,{open:v.length>0,anchorEl:o.current,placement:"top-start"},r.a.createElement(l.a,{sx:{m:1,p:2}},r.a.createElement(i.a,{classes:{root:_.preformatted},color:"primary",paragraph:!1},"Possible autocomplete candidates:"),r.a.createElement(i.a,{classes:{root:_.preformatted},color:"primary",paragraph:!1},v.join(" ")))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var a=n(83),r=n(642),i=n(160),o=n(258),s=n(24),l=n(46),c=n(485),f=n(538),u=n(100),m=n(643),h=n(644),d=n(318);const p=["alias","analyze","backdoor","cat","cd","check","clear","cls","connect","cp","download","expr","free","grow","hack","help","home","hostname","ifconfig","kill","killall","ls","lscpu","mem","mv","nano","ps","rm","run","scan-analyze","scan","scp","sudov","tail","theme","top","vim","weaken"];async function g(t,e,n,g=""){e=Object(i.h)(e);let y=[];y=y.concat(Object.keys(i.b));const b=t.getCurrentServer(),E=t.getHomeComputer();let v="",k=null;function _(){for(const t of b.contracts)y.push(t.fn)}function w(){for(const t of b.messages)t.endsWith(".msg")||y.push(t)}function S(){for(const t of E.programs)y.push(t)}function x(){for(const t of b.scripts){const e=O(t.filename);e&&y.push(e)}}function C(){for(const t of b.textFiles){const e=O(t.fn);e&&y.push(e)}}function L(){const t=Object(r.b)(b,null==k?"/":k);for(let e=0;eb.serversOnNetwork.includes(t.hostname)||t instanceof l.a&&t.backdoorInstalled).map(t=>t.hostname);if(M("nano")||M("vim"))return x(),C(),L(),y;if(M("rm"))return x(),S(),w(),C(),_(),L(),y;const R=await async function(){if(!(M("run")||M("tail")||M("kill")||e.startsWith("./")))return;let n=e;e.startsWith("./")&&(n="run "+e.slice(2));const a=Object(c.b)(n);if(0===a.length)return;const r=Object(c.a)(a[a.length-1]),i=r[1]+"";if(!Object(u.a)(i))return;if(i.endsWith(".script"))return;const o=b.scripts.find(t=>{const e=i.replace(/^\.\//g,"");return O(t.filename)===e||t.filename==="/"+e});if(!o)return;o.module||await Object(m.a)(t,o,b.scripts);const l=await o.module;if(!l.autocomplete)return;const f={"--tail":Boolean,"-t":Number},p=d(f,{permissive:!0,argv:r.slice(2)}),g=Object(h.a)(p._),y={servers:Object(s.c)().map(t=>t.hostname),scripts:b.scripts.map(t=>t.filename),txts:b.textFiles.map(t=>t.fn),flags:t=>{v=t.map(t=>1===t[0].length?"-"+t[0]:"--"+t[0]);try{return g(t)}catch(t){return}}};let E=[],v=[];return E=E.concat(l.autocomplete(y,p._)),E.concat(v)}();if(R)return R;if(e.startsWith("./")){for(const t of b.scripts){const e=O(t.filename);e&&y.push(e)}for(const t of b.programs){const e=O(t);e&&y.push(e)}for(const t of b.contracts){const e=O(t.fn);e&&y.push(e)}return y}return M("run")&&(x(),S(),_(),L()),M("kill")||M("tail")||M("mem")||M("check")?(x(),L(),y):M("cat")?(function(){for(const t of b.messages)t.endsWith(".msg")&&y.push(t)}(),w(),C(),L(),x(),y):M("download")||M("mv")?(x(),C(),L(),y):M("cd")?(L(),y):(M("ls")&&0===n&&L(),M("help")?Object.keys(f.a):y)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));class a{constructor(t,e,n){this.filename=t,this.url=e,this.moduleSequenceNumber=n}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(22);function r(t,e,n,r){if(n.constructor!==Array)return;if(!Object(a.c)(n))return;if(""===e)for(let e=n.length-1;e>=0;--e)n[e].toLowerCase().startsWith(t.toLowerCase())||n.splice(e,1);else for(let t=n.length-1;t>=0;--t)n[t].toLowerCase().startsWith(e.toLowerCase())||n.splice(t,1);const i=r.lastIndexOf(";");let o="";if(0!==n.length){if(1===n.length)return o=""===e?n[0]:t+" "+n[0],-1===i?o:r.slice(0,i+1)+" "+o;{const o=Object(a.h)(n);return""===e?o===t?n:-1===i?o:`${r.slice(0,i+1)} ${o}`:o===e?n:-1==i?`${t} ${o}`:`${r.slice(0,i+1)} ${t} ${o}`}}}},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(150),s=n(19),l=n(8),c=n(252);function f(t){const[e,n]=Object(a.useState)(!1);return r.a.createElement(r.a.Fragment,null,r.a.createElement(i.a,{variant:"h4"},"Tutorial / Documentation"),r.a.createElement(s.a,{m:2},r.a.createElement(l.a,{onClick:()=>n(!0)},"Soft reset and Restart tutorial"),r.a.createElement(c.a,{open:e,onClose:()=>n(!1),onConfirm:t.reactivateTutorial,confirmationText:"This will reset all your stats to 1 and money to 1k. Are you sure?"}),r.a.createElement(o.a,{color:"primary",target:"_blank",href:"https://bitburner.readthedocs.io/en/latest/guidesandtips/gettingstartedguideforbeginnerprogrammers.html"},r.a.createElement(i.a,null,"Getting Started")),r.a.createElement("br",null),r.a.createElement(o.a,{color:"primary",target:"_blank",href:"https://bitburner.readthedocs.io/en/latest/basicgameplay/servers.html"},r.a.createElement(i.a,null,"Servers & Networking")),r.a.createElement("br",null),r.a.createElement(o.a,{color:"primary",target:"_blank",href:"https://bitburner.readthedocs.io/en/latest/basicgameplay/hacking.html"},r.a.createElement(i.a,null,"Hacking")),r.a.createElement("br",null),r.a.createElement(o.a,{color:"primary",target:"_blank",href:"https://bitburner.readthedocs.io/en/latest/basicgameplay/scripts.html"},r.a.createElement(i.a,null,"Scripts")),r.a.createElement("br",null),r.a.createElement(o.a,{color:"primary",target:"_blank",href:"https://bitburner.readthedocs.io/en/latest/netscript.html"},r.a.createElement(i.a,null,"Netscript Programming Language")),r.a.createElement("br",null),r.a.createElement(o.a,{color:"primary",target:"_blank",href:"https://bitburner.readthedocs.io/en/latest/basicgameplay/world.html"},r.a.createElement(i.a,null,"Traveling")),r.a.createElement("br",null),r.a.createElement(o.a,{color:"primary",target:"_blank",href:"https://bitburner.readthedocs.io/en/latest/basicgameplay/companies.html"},r.a.createElement(i.a,null,"Companies")),r.a.createElement("br",null),r.a.createElement(o.a,{color:"primary",target:"_blank",href:"https://bitburner.readthedocs.io/en/latest/basicgameplay/infiltration.html"},r.a.createElement(i.a,null,"Infiltration")),r.a.createElement("br",null),r.a.createElement(o.a,{color:"primary",target:"_blank",href:"https://bitburner.readthedocs.io/en/latest/basicgameplay/factions.html"},r.a.createElement(i.a,null,"Factions")),r.a.createElement("br",null),r.a.createElement(o.a,{color:"primary",target:"_blank",href:"https://bitburner.readthedocs.io/en/latest/basicgameplay/augmentations.html"},r.a.createElement(i.a,null,"Augmentations")),r.a.createElement("br",null),r.a.createElement(o.a,{color:"primary",target:"_blank",href:"https://bitburner.readthedocs.io/en/latest/shortcuts.html"},r.a.createElement(i.a,null,"Keyboard Shortcuts")),r.a.createElement("br",null),r.a.createElement(o.a,{color:"primary",target:"_blank",href:"https://bitburner.readthedocs.io/en/latest/netscript/netscriptlearntoprogram.html#netscript-1-0-vs-netscript-2-0"},r.a.createElement(i.a,null,"NS1 vs NS2 (or .script vs .js)")),r.a.createElement("br",null),r.a.createElement(o.a,{color:"primary",target:"_blank",href:"https://bitburner.readthedocs.io/en/latest/netscript/netscriptfunctions.html"},r.a.createElement(i.a,null,"Simplified list of functions")),r.a.createElement("br",null),r.a.createElement(o.a,{color:"primary",target:"_blank",href:"https://github.com/danielyxie/bitburner/blob/dev/markdown/bitburner.ns.md"},r.a.createElement(i.a,null,"Complete list of functions"))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(0),r=n.n(a),i=n(503),o=n(216),s=n(1350),l=n(1358);function c(t){const e=Object(a.useState)(!1)[1];function n(){e(t=>!t)}Object(a.useEffect)(()=>{const t=setInterval(n,200);return()=>clearInterval(t)},[]);const[c,f]=Object(a.useState)("active");return r.a.createElement(r.a.Fragment,null,r.a.createElement(i.a,{variant:"fullWidth",value:c,onChange:function(t,e){f(e)},sx:{minWidth:"fit-content",maxWidth:"25%"}},r.a.createElement(o.a,{label:"Active",value:"active"}),r.a.createElement(o.a,{label:"Recently Killed",value:"recent"})),"active"===c&&r.a.createElement(s.a,{workerScripts:t.workerScripts}),"recent"===c&&r.a.createElement(l.a,null))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(0),r=n.n(a),i=n(1351),o=n(1352),s=n(1);function l(t){return r.a.createElement(r.a.Fragment,null,r.a.createElement(s.a,null,"This page displays a list of all of your scripts that are currently running across every machine. It also provides information about each script's production. The scripts are categorized by the hostname of the servers on which they are running."),r.a.createElement(i.a,null),r.a.createElement(o.a,t))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var a=n(0),r=n(20),i=n(112),o=n(29),s=n(1),l=n(121),c=n(144),f=n(148),u=n(149),m=n(30),h=n(50);const d=Object(l.a)(t=>Object(c.a)({cell:{borderBottom:"none",padding:t.spacing(1),margin:t.spacing(1),whiteSpace:"nowrap"},size:{width:"1px"}}));function p(){const t=o.b.Player(),e=d(),n=t.scriptProdSinceLastAug/(t.playtimeSinceLastAug/1e3);return a.createElement(f.a,{size:"small",classes:{root:e.size}},a.createElement(u.a,null,a.createElement(h.a,null,a.createElement(m.a,{component:"th",scope:"row",classes:{root:e.cell}},a.createElement(s.a,{variant:"body2"},"Total production since last Augment Installation:")),a.createElement(m.a,{align:"left",classes:{root:e.cell}},a.createElement(s.a,{variant:"body2"},a.createElement(r.a,{money:t.scriptProdSinceLastAug}))),a.createElement(m.a,{align:"left",classes:{root:e.cell}},a.createElement(s.a,{variant:"body2"},"(",a.createElement(i.a,{money:n}),")")))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var a=n(0),r=n.n(a),i=n(1353),o=n(76),s=n(248),l=n(1504),c=n(297),f=n(24),u=n(6),m=n(646),h=n(344),d=n.n(h);function p(t){const[e,n]=Object(a.useState)(""),[h,p]=Object(a.useState)(0),[g,y]=Object(a.useState)(u.a.ActiveScriptsServerPageSize),b=Object(a.useState)(!1)[1];const E={};for(const e of t.workerScripts.values()){const t=Object(f.d)(e.hostname);if(null==t){console.warn("WorkerScript has invalid hostname: "+e.hostname);continue}let n=E[t.hostname];void 0===n&&(E[t.hostname]={server:t,workerScripts:[]},n=E[t.hostname]),void 0!==n&&n.workerScripts.push(e)}const v=Object.values(E).filter(t=>t&&(t.server.hostname.includes(e)||t.server.runningScripts.find(t=>t.filename.includes(e))));function k(){b(t=>!t)}return Object(a.useEffect)(()=>c.a.subscribe(k)),r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,{value:e,onChange:function(t){n(t.target.value),p(0)},autoFocus:!0,InputProps:{startAdornment:r.a.createElement(d.a,null),spellCheck:!1}}),r.a.createElement(s.a,{dense:!0},v.slice(h*g,h*g+g).map(t=>t&&r.a.createElement(i.a,{key:t.server.hostname,server:t.server,workerScripts:t.workerScripts}))),r.a.createElement(l.a,{rowsPerPageOptions:[10,15,20,100],component:"div",count:v.length,rowsPerPage:g,page:h,onPageChange:(t,e)=>{p(e)},onRowsPerPageChange:t=>{u.a.ActiveScriptsServerPageSize=parseInt(t.target.value,10),y(parseInt(t.target.value,10)),p(0)},ActionsComponent:m.a}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var a=n(0),r=n(1),i=n(355),o=n(113),s=n(45),l=n(19),c=n(276),f=n(81),u=n.n(f),m=n(209),h=n.n(m),d=n(1354),p=n(253);function g(t){const[e,n]=a.useState(!1),f=t.server,m=`${f.hostname}${" ".repeat(18)}`.slice(0,Math.max(f.hostname.length,18)),g={progress:f.ramUsed/f.maxRam,totalTicks:30},y=`${m} ${Object(p.a)(g)}`;return a.createElement(l.a,{component:s.a},a.createElement(i.a,{onClick:()=>n(t=>!t)},a.createElement(o.a,{primary:a.createElement(r.a,{style:{whiteSpace:"pre-wrap"}},y)}),e?a.createElement(h.a,{color:"primary"}):a.createElement(u.a,{color:"primary"})),a.createElement(l.a,{mx:2},a.createElement(c.a,{in:e,timeout:0,unmountOnExit:!0},a.createElement(d.a,{workerScripts:t.workerScripts}))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(0),r=n.n(a),i=n(1355),o=n(248),s=n(1504),l=n(646),c=n(6);function f(t){const[e,n]=Object(a.useState)(0),[f,u]=Object(a.useState)(c.a.ActiveScriptsScriptPageSize);return r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,{dense:!0,disablePadding:!0},t.workerScripts.slice(e*f,e*f+f).map(t=>r.a.createElement(i.a,{key:`${t.name}_${t.args}`,workerScript:t}))),r.a.createElement(s.a,{rowsPerPageOptions:[10,15,20,100],component:"div",count:t.workerScripts.length,rowsPerPage:f,page:e,onPageChange:(t,e)=>{n(e)},onRowsPerPageChange:t=>{c.a.ActiveScriptsScriptPageSize=parseInt(t.target.value,10),u(parseInt(t.target.value,10)),n(0)},ActionsComponent:l.a}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return R}));var a=n(0),r=n(5),i=n(148),o=n(30),s=n(50),l=n(149),c=n(8),f=n(19),u=n(45),m=n(1),h=n(111),d=n(634),p=n.n(d),g=n(355),y=n(113),b=n(121),E=n(276),v=n(209),k=n.n(v),_=n(81),w=n.n(_),S=n(142),x=n(14),C=n(178),L=n(22),O=n(257),M=n(20),T=n(112);const A=Object(b.a)({noborder:{borderBottom:"none"}});function R(t){const e=A(),[n,d]=a.useState(!1),b=t.workerScript.scriptRef;const v=S.a.bind(null,b,b.server);const _=b.onlineMoneyMade/b.onlineRunningTime,R=b.onlineExpGained/b.onlineRunningTime;return a.createElement(a.Fragment,null,a.createElement(g.a,{onClick:()=>d(t=>!t),component:u.a},a.createElement(y.a,{primary:a.createElement(m.a,null,"└ ",t.workerScript.name," ",JSON.stringify(t.workerScript.args))}),n?a.createElement(k.a,{color:"primary"}):a.createElement(w.a,{color:"primary"})),a.createElement(E.a,{in:n,timeout:0,unmountOnExit:!0},a.createElement(f.a,{mx:6},a.createElement(i.a,{padding:"none",size:"small"},a.createElement(l.a,null,a.createElement(s.a,null,a.createElement(o.a,{className:e.noborder},a.createElement(m.a,null,"└ Threads:")),a.createElement(o.a,{className:e.noborder},a.createElement(m.a,null,r.a.formatThreads(t.workerScript.scriptRef.threads)))),a.createElement(s.a,null,a.createElement(o.a,{className:e.noborder,colSpan:2},a.createElement(m.a,null,"└ Args: ",Object(O.a)(t.workerScript.args)))),a.createElement(s.a,null,a.createElement(o.a,{className:e.noborder},a.createElement(m.a,null,"└ Online Time:")),a.createElement(o.a,{className:e.noborder},a.createElement(m.a,null,Object(L.d)(1e3*b.onlineRunningTime)))),a.createElement(s.a,null,a.createElement(o.a,{className:e.noborder},a.createElement(m.a,null,"└ Offline Time:")),a.createElement(o.a,{className:e.noborder},a.createElement(m.a,null,Object(L.d)(1e3*b.offlineRunningTime)))),a.createElement(s.a,null,a.createElement(o.a,{className:e.noborder},a.createElement(m.a,null,"└ Total online production:")),a.createElement(o.a,{className:e.noborder,align:"left"},a.createElement(m.a,null,a.createElement(M.a,{money:b.onlineMoneyMade})))),a.createElement(s.a,null,a.createElement(o.a,{className:e.noborder,colSpan:1}),a.createElement(o.a,{className:e.noborder,align:"left"},a.createElement(m.a,null," ",r.a.formatExp(b.onlineExpGained)+" hacking exp"))),a.createElement(s.a,null,a.createElement(o.a,{className:e.noborder},a.createElement(m.a,null,"└ Online production rate:")),a.createElement(o.a,{className:e.noborder,align:"left"},a.createElement(m.a,null,a.createElement(T.a,{money:_})))),a.createElement(s.a,null,a.createElement(o.a,{className:e.noborder,colSpan:1}),a.createElement(o.a,{className:e.noborder,align:"left"},a.createElement(m.a,null," ",r.a.formatExp(R)+" hacking exp / sec"))),a.createElement(s.a,null,a.createElement(o.a,{className:e.noborder},a.createElement(m.a,null,"└ Total offline production:")),a.createElement(o.a,{className:e.noborder,align:"left"},a.createElement(m.a,null,a.createElement(M.a,{money:b.offlineMoneyMade})))),a.createElement(s.a,null,a.createElement(o.a,{className:e.noborder,colSpan:1}),a.createElement(o.a,{className:e.noborder,align:"left"},a.createElement(m.a,null," ",r.a.formatExp(b.offlineExpGained)+" hacking exp"))))),a.createElement(c.a,{onClick:function(){C.c.emit(b)}},"LOG"),a.createElement(h.a,{onClick:function(){v(),Object(x.a)("Killing script")}},a.createElement(p.a,{color:"error"})))))}},,,function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(0),r=n.n(a),i=n(1),o=n(461),s=n(1359);function l(){return r.a.createElement(r.a.Fragment,null,r.a.createElement(i.a,null,"List of all recently killed scripts."),o.b.map(t=>r.a.createElement(s.a,{key:t.runningScript.pid,recentScript:t})))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return L}));var a=n(0),r=n(5),i=n(148),o=n(30),s=n(50),l=n(149),c=n(19),f=n(45),u=n(1),m=n(8),h=n(355),d=n(113),p=n(121),g=n(276),y=n(209),b=n.n(y),E=n(81),v=n.n(E),k=n(22),_=n(257),w=n(20),S=n(112),x=n(178);const C=Object(p.a)({noborder:{borderBottom:"none"}});function L(t){const e=C(),[n,p]=a.useState(!1),y=t.recentScript,E=y.runningScript.onlineMoneyMade/y.runningScript.onlineRunningTime,L=y.runningScript.onlineExpGained/y.runningScript.onlineRunningTime;return a.createElement(a.Fragment,null,a.createElement(h.a,{onClick:()=>p(t=>!t),component:f.a},a.createElement(d.a,{primary:a.createElement(u.a,null,"└ ",y.runningScript.filename," (died"," ",Object(k.d)((new Date).getTime()-y.timeOfDeath.getTime())," ago)")}),n?a.createElement(b.a,{color:"primary"}):a.createElement(v.a,{color:"primary"})),a.createElement(g.a,{in:n,timeout:0,unmountOnExit:!0},a.createElement(c.a,{mx:6},a.createElement(i.a,{padding:"none",size:"small"},a.createElement(l.a,null,a.createElement(s.a,null,a.createElement(o.a,{className:e.noborder},a.createElement(u.a,null,"└ Threads:")),a.createElement(o.a,{className:e.noborder},a.createElement(u.a,null,r.a.formatThreads(y.runningScript.threads)))),a.createElement(s.a,null,a.createElement(o.a,{className:e.noborder,colSpan:2},a.createElement(u.a,null,"└ Args: ",Object(_.a)(y.runningScript.args)))),a.createElement(s.a,null,a.createElement(o.a,{className:e.noborder},a.createElement(u.a,null,"└ Online Time:")),a.createElement(o.a,{className:e.noborder},a.createElement(u.a,null,Object(k.d)(1e3*y.runningScript.onlineRunningTime)))),a.createElement(s.a,null,a.createElement(o.a,{className:e.noborder},a.createElement(u.a,null,"└ Offline Time:")),a.createElement(o.a,{className:e.noborder},a.createElement(u.a,null,Object(k.d)(1e3*y.runningScript.offlineRunningTime)))),a.createElement(s.a,null,a.createElement(o.a,{className:e.noborder},a.createElement(u.a,null,"└ Total online production:")),a.createElement(o.a,{className:e.noborder,align:"left"},a.createElement(u.a,null,a.createElement(w.a,{money:y.runningScript.onlineMoneyMade})))),a.createElement(s.a,null,a.createElement(o.a,{className:e.noborder,colSpan:1}),a.createElement(o.a,{className:e.noborder,align:"left"},a.createElement(u.a,null," ",r.a.formatExp(y.runningScript.onlineExpGained)+" hacking exp"))),a.createElement(s.a,null,a.createElement(o.a,{className:e.noborder},a.createElement(u.a,null,"└ Online production rate:")),a.createElement(o.a,{className:e.noborder,align:"left"},a.createElement(u.a,null,a.createElement(S.a,{money:E})))),a.createElement(s.a,null,a.createElement(o.a,{className:e.noborder,colSpan:1}),a.createElement(o.a,{className:e.noborder,align:"left"},a.createElement(u.a,null," ",r.a.formatExp(L)+" hacking exp / sec"))),a.createElement(s.a,null,a.createElement(o.a,{className:e.noborder},a.createElement(u.a,null,"└ Total offline production:")),a.createElement(o.a,{className:e.noborder,align:"left"},a.createElement(u.a,null,a.createElement(w.a,{money:y.runningScript.offlineMoneyMade})))),a.createElement(s.a,null,a.createElement(o.a,{className:e.noborder,colSpan:1}),a.createElement(o.a,{className:e.noborder,align:"left"},a.createElement(u.a,null," ",r.a.formatExp(y.runningScript.offlineExpGained)+" hacking exp"))))),a.createElement(m.a,{onClick:function(){x.c.emit(y.runningScript)}},"LOG"))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return b}));var a=n(0),r=n.n(a),i=n(1361),o=n(1362),s=n(1363),l=n(350),c=n(10),f=n(18),u=n(29),m=n(8),h=n(1),d=n(1364),p=n(4),g=n(1369);function y({faction:t,rerender:e,onAugmentations:n}){const i=u.b.Player(),y=u.b.Router(),[b,E]=Object(a.useState)(!1),v=t.getInfo();function k(){i.startFocusing(),y.toWork()}const _=i.inGang()&&i.getGangName()===t.name,w=Math.floor(c.a.BaseFavorToDonate*f.a.RepToDonateToFaction),S=t.favor>=w,x=t.name===p.a.TheCovenant&&10===i.bitNodeN;return r.a.createElement(r.a.Fragment,null,r.a.createElement(m.a,{onClick:()=>y.toFactions()},"Back"),r.a.createElement(h.a,{variant:"h4",color:"primary"},t.name),r.a.createElement(s.a,{faction:t,factionInfo:v}),r.a.createElement(g.a,{faction:t}),!_&&v.offerHackingWork&&r.a.createElement(l.a,{buttonText:"Hacking Contracts",infoText:"Complete hacking contracts for your faction. Your effectiveness, which determines how much reputation you gain for this faction, is based on your hacking skill. You will gain hacking exp.",onClick:()=>function(t){i.startFactionHackWork(t),k()}(t)}),!_&&v.offerFieldWork&&r.a.createElement(l.a,{buttonText:"Field Work",infoText:"Carry out field missions for your faction. Your effectiveness, which determines how much reputation you gain for this faction, is based on all of your stats. You will gain exp for all stats.",onClick:()=>function(t){i.startFactionFieldWork(t),k()}(t)}),!_&&v.offerSecurityWork&&r.a.createElement(l.a,{buttonText:"Security Work",infoText:"Serve in a security detail for your faction. Your effectiveness, which determines how much reputation you gain for this faction, is based on your combat stats. You will gain exp for all combat stats.",onClick:()=>function(t){i.startFactionSecurityWork(t),k()}(t)}),!_&&v.offersWork()&&r.a.createElement(o.a,{faction:t,p:i,rerender:e,favorToDonate:w,disabled:!S}),r.a.createElement(l.a,{buttonText:"Purchase Augmentations",infoText:"As your reputation with this faction rises, you will unlock Augmentations, which you can purchase to enhance your abilities.",onClick:n}),x&&r.a.createElement(r.a.Fragment,null,r.a.createElement(l.a,{buttonText:"Purchase & Upgrade Duplicate Sleeves",infoText:"Purchase Duplicate Sleeves and upgrades. These are permanent!",onClick:()=>E(!0)}),r.a.createElement(d.a,{open:b,onClose:()=>E(!1)})))}function b(t){const e=Object(a.useState)(!1)[1],n=u.b.Player(),o=u.b.Router(),[s,l]=Object(a.useState)(t.augPage);function c(){e(t=>!t)}Object(a.useEffect)(()=>{const t=setInterval(c,200);return()=>clearInterval(t)},[]);const f=t.faction;return n&&!n.factions.includes(f.name)?r.a.createElement(r.a.Fragment,null,r.a.createElement(h.a,{variant:"h4",color:"primary"},"You have not joined ",f.name," yet!"),r.a.createElement(m.a,{onClick:()=>o.toFactions()},"Back to Factions")):s?r.a.createElement(i.a,{faction:f,routeToMainPage:()=>l(!1)}):r.a.createElement(y,{rerender:c,faction:f,onAugmentations:()=>l(!0)})}},function(t,e,n){"use strict";n.d(e,"a",(function(){return w}));var a=n(1),r=n(249),i=n(8),o=n(45),s=n(19),l=n(21),c=n(0),f=n.n(c),u=n(79),m=n(119),h=n(12),d=n(636),p=n(172),g=n(6),y=n(29),b=n(5),E=n(324),v=n(128),k=n(4),_=n(105);function w(t){const e=y.b.Player(),n=Object(c.useState)(!1)[1];function w(){n(t=>!t)}function S(){return Object(_.a)(e,t.faction)}function x(t){g.a.PurchaseAugmentationsOrder=t,w()}const C=function(){switch(g.a.PurchaseAugmentationsOrder){case p.b.Cost:return function(){const t=S();return t.sort((t,n)=>{const a=u.a[t],r=u.a[n];if(null==a||null==r)throw new Error("Invalid Augmentation Names");return a.getCost(e).moneyCost-r.getCost(e).moneyCost}),t}();case p.b.Reputation:return function(){const t=S();return t.sort((t,n)=>{const a=u.a[t],r=u.a[n];if(null==a||null==r)throw new Error("Invalid Augmentation Names");return a.getCost(e).repCost-r.getCost(e).repCost}),t}();case p.b.Purchasable:return function(){const n=S();function a(n){const a=u.a[n],r=a.getCost(e),i=r.repCost,o=t.faction.playerReputation>=i,s=Object(_.b)(a);return 0!==r.moneyCost&&e.money>r.moneyCost&&o&&s}const r=n.filter(a).sort((t,n)=>{const a=u.a[t],r=u.a[n];if(null==a||null==r)throw new Error("Invalid Augmentation Names");return a.getCost(e).moneyCost-r.getCost(e).moneyCost}),i=n.filter(t=>!a(t)).sort((t,n)=>{const a=u.a[t],r=u.a[n];if(null==a||null==r)throw new Error("Invalid Augmentation Names");return a.getCost(e).repCost-r.getCost(e).repCost});return r.concat(i)}();default:return S()}}(),L=C.filter(t=>t===h.a.NeuroFluxGovernor||!e.augmentations.some(e=>e.name===t)&&!e.queuedAugmentations.some(e=>e.name===t)),O=C.filter(t=>!L.includes(t)),M=t.faction.name!==k.a.ShadowsOfAnarchy?f.a.createElement(a.a,null,f.a.createElement("b",null,"Price multiplier:")," x ",b.a.formatReallyBigNumber(Object(m.d)())):f.a.createElement(f.a.Fragment,null);return f.a.createElement(f.a.Fragment,null,f.a.createElement(r.a,{disableGutters:!0,maxWidth:"lg",sx:{mx:0}},f.a.createElement(i.a,{onClick:t.routeToMainPage},"Back"),f.a.createElement(a.a,{variant:"h4"},"Faction Augmentations - ",t.faction.name),f.a.createElement(o.a,{sx:{p:1,mb:1}},f.a.createElement(a.a,null,"These are all of the Augmentations that are available to purchase from ",f.a.createElement("b",null,t.faction.name),". Augmentations are powerful upgrades that will enhance your abilities.",f.a.createElement("br",null)),f.a.createElement(s.a,{sx:{display:"grid",gridTemplateColumns:`repeat(${t.faction.name===k.a.ShadowsOfAnarchy?"2":"3"}, 1fr)`,justifyItems:"center",my:1}},f.a.createElement(l.a,{title:f.a.createElement(a.a,null,"The price of every Augmentation increases for every queued Augmentation and it is reset when you install them.")},M),f.a.createElement(a.a,null,f.a.createElement("b",null,"Reputation:")," ",f.a.createElement(v.a,{reputation:t.faction.playerReputation})),f.a.createElement(a.a,null,f.a.createElement("b",null,"Favor:")," ",f.a.createElement(E.a,{favor:Math.floor(t.faction.favor)}))),f.a.createElement(s.a,{sx:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)"}},f.a.createElement(i.a,{onClick:()=>x(p.b.Cost)},"Sort by Cost"),f.a.createElement(i.a,{onClick:()=>x(p.b.Reputation)},"Sort by Reputation"),f.a.createElement(i.a,{onClick:()=>x(p.b.Default)},"Sort by Default Order"),f.a.createElement(i.a,{onClick:()=>x(p.b.Purchasable)},"Sort by Purchasable")))),f.a.createElement(d.a,{augNames:L,ownedAugNames:O,player:e,canPurchase:(e,n)=>{const a=n.getCost(e);return Object(_.b)(n)&&t.faction.playerReputation>=a.repCost&&(0===a.moneyCost||e.money>a.moneyCost)},purchaseAugmentation:(e,n,a)=>{g.a.SuppressBuyAugmentationConfirmation?(Object(_.f)(n,t.faction),w()):a(!0)},rep:t.faction.playerReputation,faction:t.faction}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return y}));var a=n(0),r=n.n(a),i=n(10),o=n(531),s=n(324),l=n(20),c=n(128),f=n(5),u=n(14),m=n(266),h=n(1),d=n(45),p=n(8),g=n(76);function y(t){const[e,n]=Object(a.useState)(null),y=(i.a.DonateMoneyToRepDivisor+"").length-1;function b(){return null!==e&&(!(isNaN(e)||e<=0)&&!(t.p.moneyObject(c.a)({noformat:{whiteSpace:"pre-wrap",lineHeight:"1em"}}));function d(){return r.a.createElement(f.a,null,"Perform work/carry out assignments for your faction to help further its cause! By doing so you will earn reputation for your faction. You will also gain reputation passively over time, although at a very slow rate. Earning reputation will allow you to purchase Augmentations through this faction, which are powerful upgrades that enhance your abilities.")}function p(t){var e;const n=Object(a.useState)(!1)[1];function l(){n(t=>!t)}Object(a.useEffect)(()=>{const t=setInterval(l,200);return()=>clearInterval(t)},[]);const c=h(),p=null!==(e=t.factionInfo.assignment)&&void 0!==e?e:d,g=t.faction.getFavorGain();return r.a.createElement(r.a.Fragment,null,r.a.createElement(f.a,{classes:{root:c.noformat}},t.factionInfo.infoText),r.a.createElement(f.a,null,"-------------------------"),r.a.createElement(m.a,{display:"flex"},r.a.createElement(u.a,{title:r.a.createElement(r.a.Fragment,null,r.a.createElement(f.a,null,"You will have ",r.a.createElement(o.a,{favor:Math.floor(t.faction.favor+g)})," faction favor after installing an Augmentation."),r.a.createElement(s.a,null,"\\(\\huge{r = \\text{total faction reputation}}\\)"),r.a.createElement(s.a,null,"\\(\\huge{favor=1+\\left\\lfloor\\log_{1.02}\\left(\\frac{r+25000}{25500}\\right)\\right\\rfloor}\\)"))},r.a.createElement(f.a,null,"Reputation: ",r.a.createElement(i.a,{reputation:t.faction.playerReputation})))),r.a.createElement(f.a,null,"-------------------------"),r.a.createElement(m.a,{display:"flex"},r.a.createElement(u.a,{title:r.a.createElement(r.a.Fragment,null,r.a.createElement(f.a,null,"Faction favor increases the rate at which you earn reputation for this faction by 1% per favor. Faction favor is gained whenever you install an Augmentation. The amount of favor you gain depends on the total amount of reputation you earned with this faction. Across all resets."),r.a.createElement(s.a,null,"\\(\\huge{r = reputation}\\)"),r.a.createElement(s.a,null,"\\(\\huge{\\Delta r = \\Delta r \\times \\frac{100+favor}{100}}\\)"))},r.a.createElement(f.a,null,"Faction Favor: ",r.a.createElement(o.a,{favor:Math.floor(t.faction.favor)})))),r.a.createElement(f.a,null,"-------------------------"),r.a.createElement(p,null))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var a=n(0),r=n.n(a),i=n(1365),o=n(326),s=n(500),l=n(20),c=n(38),f=n(29),u=n(14),m=n(1),h=n(8),d=n(4);function p(t){const e=f.b.Player(),[n,p]=Object(a.useState)(0);function g(){return Math.pow(10,e.sleevesFromCovenant)*s.a}function y(){p(n+1)}let b=!1;e.canAfford(g())||(b=!0),e.sleevesFromCovenant>=s.b&&(b=!0);const E=[];for(let t=0;t=s.b||(e.canAfford(g())?(e.loseMoney(g(),"sleeves"),e.sleevesFromCovenant+=1,e.sleeves.push(new o.a(e)),y()):Object(u.a)("You cannot afford to purchase a Duplicate Sleeve"))}},"Purchase - ",r.a.createElement(l.a,{money:g(),player:e}))),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(m.a,null,"You can also purchase upgrades for your Sleeves. These upgrades are also permanent."),E))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var a=n(0),r=n.n(a),i=n(5),o=n(20),s=n(1),l=n(76),c=n(8),f=n(19),u=n(45);function m(t){const[e,n]=Object(a.useState)(1);function m(){if(isNaN(e))return 1/0;const n=100-t.sleeve.memory;return e>n?1/0:t.sleeve.getMemoryUpgradeCost(e)}const h=m(),d=!t.p.canAfford(h);let p=r.a.createElement(r.a.Fragment,null);return p=isNaN(e)?r.a.createElement(r.a.Fragment,null,"Invalid value"):r.a.createElement(r.a.Fragment,null,"Purchase ",e," memory - ",r.a.createElement(o.a,{money:h,player:t.p})),r.a.createElement(u.a,{sx:{my:1,p:1}},r.a.createElement(s.a,{variant:"h6",color:"primary"},"Upgrade Memory of Sleeve ",t.index),r.a.createElement(s.a,null,"Purchase a memory upgrade for your sleeve. Note that a sleeve's max memory is 100 (current:"," ",i.a.formatSleeveMemory(t.sleeve.memory),")"),r.a.createElement(f.a,{display:"flex",flexDirection:"row",alignItems:"center"},r.a.createElement(s.a,null,"Amount of memory to purchase (must be an integer): "),r.a.createElement(l.a,{onChange:function(e){let a=parseInt(e.target.value);isNaN(a)&&(a=1),a<1&&(a=1);const r=100-t.sleeve.memory;a>r&&(a=r),n(a)},type:"number",value:e})),r.a.createElement("br",null),r.a.createElement(c.a,{disabled:d,onClick:function(){const n=m();t.p.canAfford(n)&&(t.sleeve.upgradeMemory(e),t.p.loseMoney(n,"sleeves"),t.rerender())}},p))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(43),r=n(18),i=n(15),o=n(10),s=n(181),l=n(284);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(){c(this,"hacking",1),c(this,"strength",1),c(this,"defense",1),c(this,"dexterity",1),c(this,"agility",1),c(this,"charisma",1),c(this,"intelligence",0),c(this,"hp",10),c(this,"max_hp",10),c(this,"hacking_exp",0),c(this,"strength_exp",0),c(this,"defense_exp",0),c(this,"dexterity_exp",0),c(this,"agility_exp",0),c(this,"charisma_exp",0),c(this,"intelligence_exp",0),c(this,"hacking_mult",1),c(this,"strength_mult",1),c(this,"defense_mult",1),c(this,"dexterity_mult",1),c(this,"agility_mult",1),c(this,"charisma_mult",1),c(this,"hacking_exp_mult",1),c(this,"strength_exp_mult",1),c(this,"defense_exp_mult",1),c(this,"dexterity_exp_mult",1),c(this,"agility_exp_mult",1),c(this,"charisma_exp_mult",1),c(this,"hacking_chance_mult",1),c(this,"hacking_speed_mult",1),c(this,"hacking_money_mult",1),c(this,"hacking_grow_mult",1),c(this,"company_rep_mult",1),c(this,"faction_rep_mult",1),c(this,"crime_money_mult",1),c(this,"crime_success_mult",1),c(this,"work_money_mult",1),c(this,"hacknet_node_money_mult",1),c(this,"hacknet_node_purchase_cost_mult",1),c(this,"hacknet_node_ram_cost_mult",1),c(this,"hacknet_node_core_cost_mult",1),c(this,"hacknet_node_level_cost_mult",1),c(this,"bladeburner_max_stamina_mult",1),c(this,"bladeburner_stamina_gain_mult",1),c(this,"bladeburner_analysis_mult",1),c(this,"bladeburner_success_chance_mult",1),c(this,"augmentations",[]),c(this,"city",i.a.Sector12),c(this,"gainHackingExp",a.K),c(this,"gainStrengthExp",a.O),c(this,"gainDefenseExp",a.I),c(this,"gainDexterityExp",a.J),c(this,"gainAgilityExp",a.F),c(this,"gainCharismaExp",a.G),c(this,"gainIntelligenceExp",a.L),c(this,"gainStats",a.N),c(this,"calculateSkill",a.o),c(this,"regenerateHp",a.vb),c(this,"queryStatFromString",a.ob)}applyAugmentation(t){for(const e of Object.keys(t.mults))null==this[e]?console.warn("Augmentation has unrecognized multiplier property: "+e):this[e]*=t.mults[e]}calculateStat(t,e=1){return Object(s.b)(t,e)}getFactionFieldWorkRepGain(){return.9*(this.hacking/o.a.MaxSkillLevel+this.strength/o.a.MaxSkillLevel+this.defense/o.a.MaxSkillLevel+this.dexterity/o.a.MaxSkillLevel+this.agility/o.a.MaxSkillLevel+this.charisma/o.a.MaxSkillLevel)/5.5*this.faction_rep_mult}getFactionHackingWorkRepGain(){return this.hacking/o.a.MaxSkillLevel*this.faction_rep_mult}getFactionSecurityWorkRepGain(){return.9*(this.hacking/o.a.MaxSkillLevel+this.strength/o.a.MaxSkillLevel+this.defense/o.a.MaxSkillLevel+this.dexterity/o.a.MaxSkillLevel+this.agility/o.a.MaxSkillLevel)/4.5*this.faction_rep_mult}resetMultipliers(){this.hacking_mult=1,this.strength_mult=1,this.defense_mult=1,this.dexterity_mult=1,this.agility_mult=1,this.charisma_mult=1,this.hacking_exp_mult=1,this.strength_exp_mult=1,this.defense_exp_mult=1,this.dexterity_exp_mult=1,this.agility_exp_mult=1,this.charisma_exp_mult=1,this.company_rep_mult=1,this.faction_rep_mult=1,this.crime_money_mult=1,this.crime_success_mult=1,this.work_money_mult=1,this.hacknet_node_money_mult=1,this.hacknet_node_purchase_cost_mult=1,this.hacknet_node_ram_cost_mult=1,this.hacknet_node_core_cost_mult=1,this.hacknet_node_level_cost_mult=1,this.bladeburner_max_stamina_mult=1,this.bladeburner_stamina_gain_mult=1,this.bladeburner_analysis_mult=1,this.bladeburner_success_chance_mult=1}updateStatLevels(){this.hacking=Math.max(1,Math.floor(this.calculateStat(this.hacking_exp,this.hacking_mult*r.a.HackingLevelMultiplier))),this.strength=Math.max(1,Math.floor(this.calculateStat(this.strength_exp,this.strength_mult*r.a.StrengthLevelMultiplier))),this.defense=Math.max(1,Math.floor(this.calculateStat(this.defense_exp,this.defense_mult*r.a.DefenseLevelMultiplier))),this.dexterity=Math.max(1,Math.floor(this.calculateStat(this.dexterity_exp,this.dexterity_mult*r.a.DexterityLevelMultiplier))),this.agility=Math.max(1,Math.floor(this.calculateStat(this.agility_exp,this.agility_mult*r.a.AgilityLevelMultiplier))),this.charisma=Math.max(1,Math.floor(this.calculateStat(this.charisma_exp,this.charisma_mult*r.a.CharismaLevelMultiplier)));const t=this.hp/this.max_hp;this.max_hp=Math.floor(10+this.defense/10),this.hp=Math.round(this.max_hp*t)}getIntelligenceBonus(t){return Object(l.a)(this.intelligence,t)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(371),r=n(2);function i(t){const e="SourceFile"+t.n,n=a.a[e];if(null!=n){switch(t.n){case 1:{let e=0;for(let n=0;n{if(e.inGang())return n.toGang();d(!0)},disabled:!p.enabled},p.title))),c.a.createElement(a.a,null,p.description))),c.a.createElement(m.a,{facName:t.name,open:h,onClose:()=>d(!1)}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var a=n(0),r=n.n(a),i=n(38),o=n(29),s=n(1),l=n(8),c=n(27),f=n(4);function u(t){const e=o.b.Player(),n=o.b.Router();function a(){return[f.a.NiteSec,f.a.TheBlackHand].includes(t.facName)}function u(){e.startGang(t.facName,a()),t.onClose(),n.toGang()}return r.a.createElement(i.a,{open:t.open,onClose:t.onClose},r.a.createElement(s.a,null,"Would you like to create a new Gang with ",t.facName,"?",r.a.createElement("br",null),r.a.createElement("br",null),"Note that this will prevent you from creating a Gang with any other Faction until this BitNode is destroyed. It also resets your reputation with this faction.",r.a.createElement("br",null),r.a.createElement("br",null),a()?"This is a HACKING gang. Members in this gang will have different tasks than COMBAT gangs. Compared to combat gangs, progression with hacking gangs is more straightforward as territory warfare is not as important.":"This is a COMBAT gang. Members in this gang will have different tasks than HACKING gangs. Compared to hacking gangs, progression with combat gangs can be more difficult as territory management is more important. However, well-managed combat gangs can progress faster than hacking ones.",r.a.createElement("br",null),r.a.createElement("br",null),"Other than hacking vs combat, there are NO differences between the Factions you can create a Gang with, and each of these Factions have all Augmentations available."),r.a.createElement(l.a,{onClick:u,onKeyUp:function(t){t.key===c.a.ENTER&&u()},autoFocus:!0},"Create Gang"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return N}));var a=n(1),r=n(148),i=n(149),o=n(45),s=n(249),l=n(19),c=n(111),f=n(21),u=n(1505),m=n(692),h=n(0),d=n.n(h),p=n(152),g=n(18),y=n(647),b=n(41),E=n(224),v=n(6),k=n(22),_=n(29),w=n(5),S=n(38),x=n(20),C=n(73),L=n(201),O=n(115);const M=({open:t,onClose:e})=>{const n=_.b.Player();return d.a.createElement(S.a,{open:t,onClose:e},d.a.createElement(d.a.Fragment,null,d.a.createElement(a.a,{variant:"h5"},"All Employers"),d.a.createElement("ul",null,Object.keys(n.jobs).map(t=>d.a.createElement(a.a,{key:t},"* ",t)))))};function T(t){var e;const n=_.b.Player();return d.a.createElement(r.a,{sx:{display:"table",width:"100%",mb:!0===(null!==(e=t.noMargin)&&void 0!==e&&e)?0:2}},d.a.createElement(i.a,null,t.rows.map(e=>{const{mult:r,value:i,effValue:o=null,color:s=t.color}=e;return null!==o&&o!==i&&n.sourceFileLvl(5)>0?d.a.createElement(C.a,{key:r,name:r,color:s,data:{}},d.a.createElement(d.a.Fragment,null,d.a.createElement(a.a,{color:s},d.a.createElement("span",{style:{opacity:.5}},w.a.formatPercentage(i))," ",w.a.formatPercentage(o)))):d.a.createElement(C.a,{key:r,name:r,color:s,data:{content:w.a.formatPercentage(i)}})})))}function A(){const t=_.b.Player();if(t.sourceFiles.length>0){const e="BitNode"+t.bitNodeN,n=Math.min(t.sourceFileLvl(t.bitNodeN)+1,12===t.bitNodeN?1/0:3);return d.a.createElement(o.a,{sx:{mb:1,p:1}},d.a.createElement(a.a,{variant:"h5"},"BitNode ",t.bitNodeN,": ",p.a[e].name," (Level ",n,")"),d.a.createElement(a.a,{sx:{whiteSpace:"pre-wrap",overflowWrap:"break-word"}},p.a[e].info))}return d.a.createElement(d.a.Fragment,null)}function R({open:t,onClose:e}){const n=_.b.Player();function r(t){const e=[["Total:",d.a.createElement(x.a,{money:t.total})]];return t.augmentations&&e.push(["Augmentations:",d.a.createElement(x.a,{money:t.augmentations})]),t.bladeburner&&e.push(["Bladeburner:",d.a.createElement(x.a,{money:t.bladeburner})]),t.casino&&e.push(["Casino:",d.a.createElement(x.a,{money:t.casino})]),t.codingcontract&&e.push(["Coding Contracts:",d.a.createElement(x.a,{money:t.codingcontract})]),t.work&&e.push(["Company Work:",d.a.createElement(x.a,{money:t.work})]),t.class&&e.push(["Class:",d.a.createElement(x.a,{money:t.class})]),t.corporation&&e.push(["Corporation:",d.a.createElement(x.a,{money:t.corporation})]),t.crime&&e.push(["Crimes:",d.a.createElement(x.a,{money:t.crime})]),t.gang&&e.push(["Gang:",d.a.createElement(x.a,{money:t.gang})]),t.hacking&&e.push(["Hacking:",d.a.createElement(x.a,{money:t.hacking})]),t.hacknet&&e.push(["Hacknet Nodes:",d.a.createElement(x.a,{money:t.hacknet})]),t.hacknet_expenses&&e.push(["Hacknet Nodes Expenses:",d.a.createElement(x.a,{money:t.hacknet_expenses})]),t.hospitalization&&e.push(["Hospitalization:",d.a.createElement(x.a,{money:t.hospitalization})]),t.infiltration&&e.push(["Infiltration:",d.a.createElement(x.a,{money:t.infiltration})]),t.servers&&e.push(["Servers:",d.a.createElement(x.a,{money:t.servers})]),t.stock&&e.push(["Stock Market:",d.a.createElement(x.a,{money:t.stock})]),t.sleeves&&e.push(["Sleeves:",d.a.createElement(x.a,{money:t.sleeves})]),t.other&&e.push(["Other:",d.a.createElement(x.a,{money:t.other})]),d.a.createElement(L.a,{rows:e,wide:!0})}let i=d.a.createElement(d.a.Fragment,null,d.a.createElement(a.a,{variant:"h6",color:"primary"},"Money earned since you last installed Augmentations"),d.a.createElement("br",null),r(n.moneySourceA));return 0!==n.sourceFiles.length&&(i=d.a.createElement(d.a.Fragment,null,i,d.a.createElement("br",null),d.a.createElement("br",null),d.a.createElement(a.a,{variant:"h6",color:"primary"},"Money earned in this BitNode"),d.a.createElement("br",null),r(n.moneySourceB))),d.a.createElement(S.a,{open:t,onClose:e},i)}function N(){const t=_.b.Player(),[e,n]=Object(h.useState)(!1),[w,S]=Object(h.useState)(!1),L=Object(h.useState)(!1)[1];function N(){L(t=>!t)}Object(h.useEffect)(()=>{const t=setInterval(N,200);return()=>clearInterval(t)},[]);const P=[["Since last Augmentation installation",Object(k.d)(t.playtimeSinceLastAug)]];t.sourceFiles.length>0&&P.push(["Since last Bitnode destroyed",Object(k.d)(t.playtimeSinceLastBitnode)]),P.push(["Total",Object(k.d)(t.totalPlaytime)]);let I=!1;if(t.sourceFileLvl(5)>0){const e=t.bitNodeN,n=12===e?1/0:3,a=Object(p.c)(e,Math.min(t.sourceFileLvl(e)+1,n));I=!Object(O.isEqual)(a,p.b)}return d.a.createElement(s.a,{maxWidth:"lg",disableGutters:!0,sx:{mx:0}},d.a.createElement(a.a,{variant:"h4"},"Stats"),d.a.createElement(l.a,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",minWidth:"fit-content",mb:1,gap:1}},d.a.createElement(o.a,{sx:{p:1}},d.a.createElement(a.a,{variant:"h5"},"General"),d.a.createElement(r.a,null,d.a.createElement(i.a,null,d.a.createElement(C.a,{name:"Current City",color:v.a.theme.primary,data:{content:t.city}}),d.a.createElement(C.a,{name:"Money",color:v.a.theme.money,data:{}},d.a.createElement(d.a.Fragment,null,d.a.createElement(x.a,{money:t.money}),d.a.createElement(c.a,{onClick:()=>n(!0),sx:{p:0}},d.a.createElement(u.a,{color:"info"})))),t.companyName?d.a.createElement(d.a.Fragment,null,d.a.createElement(C.a,{name:"Last Employer",color:v.a.theme.primary,data:{content:t.companyName}}),d.a.createElement(C.a,{name:"Last Job",color:v.a.theme.primary,data:{content:t.jobs[t.companyName]}})):d.a.createElement(d.a.Fragment,null),t.jobs&&0!==Object.keys(t.jobs).length?d.a.createElement(C.a,{name:"All Employers",color:v.a.theme.primary,data:{}},d.a.createElement(d.a.Fragment,null,d.a.createElement("span",{style:{color:v.a.theme.primary}},Object.keys(t.jobs).length," total"),d.a.createElement(c.a,{onClick:()=>S(!0),sx:{p:0}},d.a.createElement(u.a,{color:"info"})))):d.a.createElement(d.a.Fragment,null),d.a.createElement(C.a,{name:"Servers Owned",color:v.a.theme.primary,data:{content:`${t.purchasedServers.length} / ${Object(E.b)()}`}}),d.a.createElement(C.a,{name:`Hacknet ${9===t.bitNodeN||t.sourceFileLvl(9)>0?"Servers":"Nodes"} owned`,color:v.a.theme.primary,data:{content:`${t.hacknetNodes.length}${9===t.bitNodeN||t.sourceFileLvl(9)>0?" / "+b.b.MaxServers:""}`}}),d.a.createElement(C.a,{name:"Augmentations Installed",color:v.a.theme.primary,data:{content:String(t.augmentations.length)}})))),d.a.createElement(o.a,{sx:{p:1}},d.a.createElement(a.a,{variant:"h5"},"Skills"),d.a.createElement(r.a,null,d.a.createElement(i.a,null,d.a.createElement(C.a,{name:"Hacking",color:v.a.theme.hack,data:{level:t.hacking,exp:t.hacking_exp}}),d.a.createElement(C.a,{name:"Strength",color:v.a.theme.combat,data:{level:t.strength,exp:t.strength_exp}}),d.a.createElement(C.a,{name:"Defense",color:v.a.theme.combat,data:{level:t.defense,exp:t.defense_exp}}),d.a.createElement(C.a,{name:"Dexterity",color:v.a.theme.combat,data:{level:t.dexterity,exp:t.dexterity_exp}}),d.a.createElement(C.a,{name:"Agility",color:v.a.theme.combat,data:{level:t.agility,exp:t.agility_exp}}),d.a.createElement(C.a,{name:"Charisma",color:v.a.theme.cha,data:{level:t.charisma,exp:t.charisma_exp}}),t.intelligence>0&&(5===t.bitNodeN||t.sourceFileLvl(5)>0)&&d.a.createElement(C.a,{name:"Intelligence",color:v.a.theme.int,data:{level:t.intelligence,exp:t.intelligence_exp}}))))),d.a.createElement(o.a,{sx:{p:1,mb:1}},d.a.createElement(a.a,{variant:"h5",color:"primary",sx:{display:"flex",alignItems:"center",flexWrap:"wrap"}},"Multipliers",t.sourceFileLvl(5)>0&&d.a.createElement(f.a,{title:d.a.createElement(a.a,null,"Displays your current multipliers.",d.a.createElement("br",null),d.a.createElement("br",null),"When there is a dim number next to a multiplier, that means that the multiplier in question is being affected by BitNode multipliers.",d.a.createElement("br",null),d.a.createElement("br",null),"The dim number is the raw multiplier, and the undimmed number is the effective multiplier, as dictated by the BitNode.")},d.a.createElement(m.a,{sx:{ml:1,mb:.5},color:"info"}))),d.a.createElement(l.a,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:1}},d.a.createElement(l.a,null,d.a.createElement(T,{rows:[{mult:"Hacking Chance",value:t.hacking_chance_mult},{mult:"Hacking Speed",value:t.hacking_speed_mult},{mult:"Hacking Money",value:t.hacking_money_mult,effValue:t.hacking_money_mult*g.a.ScriptHackMoney},{mult:"Hacking Growth",value:t.hacking_grow_mult,effValue:t.hacking_grow_mult*g.a.ServerGrowthRate}],color:v.a.theme.hack}),d.a.createElement(T,{rows:[{mult:"Hacking Level",value:t.hacking_mult,effValue:t.hacking_mult*g.a.HackingLevelMultiplier},{mult:"Hacking Experience",value:t.hacking_exp_mult,effValue:t.hacking_exp_mult*g.a.HackExpGain}],color:v.a.theme.hack}),d.a.createElement(T,{rows:[{mult:"Strength Level",value:t.strength_mult,effValue:t.strength_mult*g.a.StrengthLevelMultiplier},{mult:"Strength Experience",value:t.strength_exp_mult}],color:v.a.theme.combat}),d.a.createElement(T,{rows:[{mult:"Defense Level",value:t.defense_mult,effValue:t.defense_mult*g.a.DefenseLevelMultiplier},{mult:"Defense Experience",value:t.defense_exp_mult}],color:v.a.theme.combat}),d.a.createElement(T,{rows:[{mult:"Dexterity Level",value:t.dexterity_mult,effValue:t.dexterity_mult*g.a.DexterityLevelMultiplier},{mult:"Dexterity Experience",value:t.dexterity_exp_mult}],color:v.a.theme.combat}),d.a.createElement(T,{rows:[{mult:"Agility Level",value:t.agility_mult,effValue:t.agility_mult*g.a.AgilityLevelMultiplier},{mult:"Agility Experience",value:t.agility_exp_mult}],color:v.a.theme.combat}),d.a.createElement(T,{rows:[{mult:"Charisma Level",value:t.charisma_mult,effValue:t.charisma_mult*g.a.CharismaLevelMultiplier},{mult:"Charisma Experience",value:t.charisma_exp_mult}],color:v.a.theme.cha,noMargin:!0})),d.a.createElement(l.a,null,d.a.createElement(T,{rows:[{mult:"Hacknet Node Production",value:t.hacknet_node_money_mult,effValue:t.hacknet_node_money_mult*g.a.HacknetNodeMoney},{mult:"Hacknet Node Purchase Cost",value:t.hacknet_node_purchase_cost_mult},{mult:"Hacknet Node RAM Upgrade Cost",value:t.hacknet_node_ram_cost_mult},{mult:"Hacknet Node Core Purchase Cost",value:t.hacknet_node_core_cost_mult},{mult:"Hacknet Node Level Upgrade Cost",value:t.hacknet_node_level_cost_mult}],color:v.a.theme.primary}),d.a.createElement(T,{rows:[{mult:"Company Reputation Gain",value:t.company_rep_mult,color:v.a.theme.rep},{mult:"Faction Reputation Gain",value:t.faction_rep_mult,effValue:t.faction_rep_mult*g.a.FactionWorkRepGain,color:v.a.theme.rep},{mult:"Salary",value:t.work_money_mult,effValue:t.work_money_mult*g.a.CompanyWorkMoney,color:v.a.theme.money}],color:v.a.theme.money}),d.a.createElement(T,{rows:[{mult:"Crime Success Chance",value:t.crime_success_mult},{mult:"Crime Money",value:t.crime_money_mult,effValue:t.crime_money_mult*g.a.CrimeMoney,color:v.a.theme.money}],color:v.a.theme.combat}),t.canAccessBladeburner()&&d.a.createElement(T,{rows:[{mult:"Bladeburner Success Chance",value:t.bladeburner_success_chance_mult},{mult:"Bladeburner Max Stamina",value:t.bladeburner_max_stamina_mult},{mult:"Bladeburner Stamina Gain",value:t.bladeburner_stamina_gain_mult},{mult:"Bladeburner Field Analysis",value:t.bladeburner_analysis_mult}],color:v.a.theme.primary,noMargin:!0})))),d.a.createElement(o.a,{sx:{p:1,mb:1}},d.a.createElement(a.a,{variant:"h5"},"Time Played"),d.a.createElement(r.a,null,d.a.createElement(i.a,null,P.map(([t,e])=>d.a.createElement(C.a,{key:t,name:t,color:v.a.theme.primary,data:{content:e}}))))),d.a.createElement(A,null),I&&d.a.createElement(o.a,{sx:{p:1,mb:1}},d.a.createElement(a.a,{variant:"h5"},"BitNode Multipliers"),d.a.createElement(y.a,{n:t.bitNodeN})),d.a.createElement(R,{open:e,onClose:()=>n(!1)}),d.a.createElement(M,{open:w,onClose:()=>S(!1)}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(0),r=n.n(a),i=n(1373),o=n(1374);function s(t){const e=Object(a.useState)(!1)[1];function n(){e(t=>!t)}return Object(a.useEffect)(()=>{const t=setInterval(n,200);return()=>clearInterval(t)},[]),r.a.createElement(r.a.Fragment,null,r.a.createElement(i.a,{initStockMarket:t.initStockMarket,p:t.p,rerender:n}),t.p.hasWseAccount&&r.a.createElement(o.a,{buyStockLong:t.buyStockLong,buyStockShort:t.buyStockShort,cancelOrder:t.cancelOrder,eventEmitterForReset:t.eventEmitterForReset,p:t.p,placeOrder:t.placeOrder,sellStockLong:t.sellStockLong,sellStockShort:t.sellStockShort,stockMarket:t.stockMarket}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return w}));var a=n(0),r=n.n(a),i=n(231),o=n(10),s=n(20),l=n(1),c=n(150),f=n(8),u=n(21),m=n(111),h=n(299),d=n.n(h),p=n(325),g=n.n(p),y=n(468),b=n(4);function E(t){if(t.p.has4SDataTixApi)return r.a.createElement(l.a,null,"Market Data TIX API Access ",r.a.createElement(g.a,null));{const e=Object(i.b)();return r.a.createElement(u.a,{title:t.p.hasTixApiAccess?r.a.createElement(l.a,null,"Let you access 4S Market Data through Netscript"):r.a.createElement(l.a,null,"Requires TIX API Access")},r.a.createElement("span",null,r.a.createElement(f.a,{disabled:!t.p.hasTixApiAccess||!t.p.canAfford(e),onClick:function(){t.p.has4SDataTixApi||t.p.canAfford(Object(i.b)())&&(t.p.has4SDataTixApi=!0,t.p.loseMoney(Object(i.b)(),"stock"),t.rerender())}},"Buy 4S Market Data TIX API Access - ",r.a.createElement(s.a,{money:e,player:t.p}))))}}function v(t){if(t.p.hasWseAccount)return r.a.createElement(l.a,null,"WSE Account ",r.a.createElement(g.a,null));const e=o.a.WSEAccountCost;return r.a.createElement(r.a.Fragment,null,r.a.createElement(l.a,null,"To begin trading, you must first purchase an account:"),r.a.createElement(f.a,{disabled:!t.p.canAfford(e),onClick:function(){t.p.hasWseAccount||t.p.canAfford(o.a.WSEAccountCost)&&(t.p.hasWseAccount=!0,t.initStockMarket(),t.p.loseMoney(o.a.WSEAccountCost,"stock"),t.rerender())}},"Buy WSE Account - ",r.a.createElement(s.a,{money:e,player:t.p})))}function k(t){if(t.p.hasTixApiAccess)return r.a.createElement(l.a,null,"TIX API Access ",r.a.createElement(g.a,null));{const e=o.a.TIXAPICost;return r.a.createElement(f.a,{disabled:!t.p.canAfford(e)||!t.p.hasWseAccount,onClick:function(){t.p.hasTixApiAccess||t.p.canAfford(o.a.TIXAPICost)&&(t.p.hasTixApiAccess=!0,t.p.loseMoney(o.a.TIXAPICost,"stock"),t.rerender())}},"Buy Trade Information eXchange (TIX) API Access - ",r.a.createElement(s.a,{money:e,player:t.p}))}}function _(t){if(t.p.has4SData)return r.a.createElement(l.a,null,"4S Market Data Access ",r.a.createElement(g.a,null));{const e=Object(i.a)();return r.a.createElement(u.a,{title:r.a.createElement(l.a,null,"Lets you view additional pricing and volatility information about stocks")},r.a.createElement("span",null,r.a.createElement(f.a,{disabled:!t.p.canAfford(e)||!t.p.hasWseAccount,onClick:function(){t.p.has4SData||t.p.canAfford(Object(i.a)())&&(t.p.has4SData=!0,t.p.loseMoney(Object(i.a)(),"stock"),t.rerender())}},"Buy 4S Market Data Access - ",r.a.createElement(s.a,{money:e,player:t.p}))))}}function w(t){const[e,n]=Object(a.useState)(!1);return r.a.createElement(r.a.Fragment,null,r.a.createElement(l.a,null,"Welcome to the World Stock Exchange (WSE)!"),r.a.createElement(c.a,{href:"https://bitburner.readthedocs.io/en/latest/basicgameplay/stockmarket.html",target:"_blank"},r.a.createElement(l.a,null,"Investopedia")),r.a.createElement("br",null),r.a.createElement(v,t),r.a.createElement(l.a,{variant:"h5",color:"primary"},"Trade Information eXchange (TIX) API"),r.a.createElement(l.a,null,"TIX, short for Trade Information eXchange, is the communications protocol used by the WSE. Purchasing access to the TIX API lets you write code to create your own algorithmic/automated trading strategies."),r.a.createElement(k,t),r.a.createElement(l.a,{variant:"h5",color:"primary"},b.a.FourSigma," (4S) Market Data Feed"),r.a.createElement(l.a,null,b.a.FourSigma,"'s (4S) Market Data Feed provides information about stocks that will help your trading strategies.",r.a.createElement(m.a,{onClick:()=>n(!0)},r.a.createElement(d.a,null))),r.a.createElement(E,t),r.a.createElement(_,t),r.a.createElement(l.a,null,"Commission Fees: Every transaction you make has a"," ",r.a.createElement(s.a,{money:o.a.StockMarketCommission,player:t.p})," commission fee."),r.a.createElement("br",null),r.a.createElement(l.a,null,"WARNING: When you reset after installing Augmentations, the Stock Market is reset. You will retain your WSE Account, access to the TIX API, and 4S Market Data access. However, all of your stock positions are lost, so make sure to sell your stocks before installing Augmentations!"),r.a.createElement(y.a,{open:e,onClose:()=>n(!1)},r.a.createElement(l.a,null,"Access to the 4S Market Data feed will display two additional pieces of information about each stock: Price Forecast & Volatility",r.a.createElement("br",null),r.a.createElement("br",null),"Price Forecast indicates the probability the stock has of increasing or decreasing. A '+' forecast means the stock has a higher chance of increasing than decreasing, and a '-' means the opposite. The number of '+/-' symbols is used to illustrate the magnitude of these probabilities. For example, '+++' means that the stock has a significantly higher chance of increasing than decreasing, while '+' means that the stock only has a slightly higher chance of increasing than decreasing.",r.a.createElement("br",null),r.a.createElement("br",null),"Volatility represents the maximum percentage by which a stock's price can change every tick (a tick occurs every few seconds while the game is running).",r.a.createElement("br",null),r.a.createElement("br",null),"A stock's price forecast can change over time. This is also affected by volatility. The more volatile a stock is, the more its price forecast will change.")))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(0),r=n.n(a),i=n(1375),o=n(438),s=n(153);function l(t){const e=Object(a.useState)(!1)[1],[n,l]=Object(a.useState)(o.b.AllStocks),[c,f]=Object(a.useState)([]);function u(){e(t=>!t)}const m=[];for(const e of Object.keys(t.stockMarket)){const a=t.stockMarket[e];if(a instanceof s.a){if(c.length>0&&!c.includes(a.symbol))continue;let e=t.stockMarket.Orders[a.symbol];if(null==e&&(e=[]),n===o.b.Portfolio&&0===a.playerShares&&0===a.playerShortShares&&0===e.length)continue;m.push(r.a.createElement(i.a,{buyStockLong:t.buyStockLong,buyStockShort:t.buyStockShort,cancelOrder:t.cancelOrder,key:a.symbol,orders:e,p:t.p,placeOrder:t.placeOrder,rerenderAllTickers:u,sellStockLong:t.sellStockLong,sellStockShort:t.sellStockShort,stock:a}))}}return r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,{changeDisplayMode:function(){n===o.b.AllStocks?l(o.b.Portfolio):l(o.b.AllStocks)},changeWatchlistFilter:function(t){const e=t.target.value.replace(/\s/g,"");f(""!==e?e.split(","):[])},tickerDisplayMode:n}),m)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return M}));var a,r=n(0),i=n.n(r),o=n(1376),s=n(1377),l=n(1379),c=n(552),f=n(1380),u=n(228),m=n(117),h=n(75),d=n(5),p=n(20),g=n(14),y=n(19),b=n(76),E=n(74),v=n(130),k=n(355),_=n(113),w=n(45),S=n(276),x=n(81),C=n.n(x),L=n(209),O=n.n(L);function M(t){const[e,n]=Object(r.useState)(a.Market),[x,L]=Object(r.useState)(h.a.Long),[M,T]=Object(r.useState)(""),[A,R]=Object(r.useState)(!1),[N,P]=Object(r.useState)(!1),[I,F]=Object(r.useState)({text:"",placeText:"",place:()=>!1});function D(){return Math.round(parseFloat(M))}function j(){return 8===t.p.bitNodeN||t.p.sourceFileLvl(8)>=3}return i.a.createElement(y.a,{component:w.a},i.a.createElement(k.a,{onClick:()=>P(t=>!t)},i.a.createElement(_.a,{primary:i.a.createElement(o.a,{p:t.p,stock:t.stock})}),N?i.a.createElement(O.a,{color:"primary"}):i.a.createElement(C.a,{color:"primary"})),i.a.createElement(S.a,{in:N,unmountOnExit:!0},i.a.createElement(y.a,{sx:{mx:4}},i.a.createElement(y.a,{display:"flex",alignItems:"center"},i.a.createElement(b.a,{onChange:function(t){T(t.target.value)},placeholder:"Quantity (Shares)",value:M}),i.a.createElement(v.a,{onChange:function(t){t.target.value===h.a.Short?L(h.a.Short):L(h.a.Long)},value:x},i.a.createElement(E.a,{value:h.a.Long},"Long"),(8===t.p.bitNodeN||t.p.sourceFileLvl(8)>=2)&&i.a.createElement(E.a,{value:h.a.Short},"Short")),i.a.createElement(v.a,{onChange:function(t){switch(t.target.value){case a.Limit:n(a.Limit);break;case a.Stop:n(a.Stop);break;case a.Market:default:n(a.Market)}},value:e},i.a.createElement(E.a,{value:a.Market},a.Market),j()&&i.a.createElement(E.a,{value:a.Limit},a.Limit),j()&&i.a.createElement(E.a,{value:a.Stop},a.Stop)),i.a.createElement(c.a,{onClick:function(){const n=D();if(isNaN(n))Object(g.a)("Invalid input for quantity (number of shares): "+M);else switch(e){case a.Market:x===h.a.Short?t.buyStockShort(t.stock,n):t.buyStockLong(t.stock,n),t.rerenderAllTickers();break;case a.Limit:R(!0),F({text:"Enter the price for your Limit Order",placeText:"Place Buy Limit Order",place:e=>t.placeOrder(t.stock,n,e,m.a.LimitBuy,x)});break;case a.Stop:R(!0),F({text:"Enter the price for your Stop Order",placeText:"Place Buy Stop Order",place:e=>t.placeOrder(t.stock,n,e,m.a.StopBuy,x)})}},text:"Buy",tooltip:function(){const e=t.stock,n=D();if(isNaN(n))return null;const a=Object(u.b)(e,n,x);return null==a?null:i.a.createElement(i.a.Fragment,null,"Purchasing ",d.a.formatShares(n)," shares (",x===h.a.Long?"Long":"Short",") will cost ",i.a.createElement(p.a,{money:a}),".")}()}),i.a.createElement(c.a,{onClick:function(){const n=D();if(isNaN(n))Object(g.a)("Invalid input for quantity (number of shares): "+M);else switch(e){case a.Market:x===h.a.Short?t.sellStockShort(t.stock,n):t.sellStockLong(t.stock,n),t.rerenderAllTickers();break;case a.Limit:R(!0),F({text:"Enter the price for your Limit Order",placeText:"Place Sell Limit Order",place:e=>t.placeOrder(t.stock,n,e,m.a.LimitSell,x)});break;case a.Stop:R(!0),F({text:"Enter the price for your Stop Order",placeText:"Place Sell Stop Order",place:e=>t.placeOrder(t.stock,n,e,m.a.StopSell,x)})}},text:"Sell",tooltip:function(){const e=t.stock,n=D();if(isNaN(n))return null;if(x===h.a.Long){if(n>e.playerShares)return i.a.createElement(i.a.Fragment,null,"You do not have this many shares in the Long position")}else if(n>e.playerShortShares)return i.a.createElement(i.a.Fragment,null,"You do not have this many shares in the Short position");const a=Object(u.c)(e,n,x);return null==a?null:i.a.createElement(i.a.Fragment,null,"Selling ",d.a.formatShares(n)," shares (",x===h.a.Long?"Long":"Short",") will result in a gain of ",i.a.createElement(p.a,{money:a}),".")}()}),i.a.createElement(c.a,{onClick:function(){const n=t.p.money,r=t.stock;let i=Object(u.a)(r,x,n);switch(i=Math.min(i,Math.round(r.maxShares-r.playerShares-r.playerShortShares)),e){case a.Market:x===h.a.Short?t.buyStockShort(r,i):t.buyStockLong(r,i),t.rerenderAllTickers();break;default:Object(g.a)("ERROR: 'Buy Max' only works for Market Orders")}},text:"Buy MAX"}),i.a.createElement(c.a,{onClick:function(){const n=t.stock;switch(e){case a.Market:x===h.a.Short?t.sellStockShort(n,n.playerShortShares):t.sellStockLong(n,n.playerShares),t.rerenderAllTickers();break;default:Object(g.a)("ERROR: 'Sell All' only works for Market Orders")}},text:"Sell ALL"})),i.a.createElement(l.a,{p:t.p,stock:t.stock}),i.a.createElement(s.a,{cancelOrder:t.cancelOrder,orders:t.orders,p:t.p,stock:t.stock}),i.a.createElement(f.a,{text:I.text,placeText:I.placeText,place:I.place,open:A,onClose:()=>R(!1)}))))}!function(t){t.Market="Market Order",t.Limit="Limit Order",t.Stop="Stop Order"}(a||(a={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(0),r=n(794),i=n(6),o=n(5),s=n(1);const l=["cs","lv","pl","ru"];function c(t){const e=t.stock,n=o.a.formatMoney(e.price),c=l.includes(i.a.Locale)?15:12,f=" ".repeat(1+r.a.longestName-e.name.length+(r.a.longestSymbol-e.symbol.length)),u=" ".repeat(c-n.length);let m=`${e.name}${f}${e.symbol} -${u}${n}`;if(t.p.has4SData){m+=` - Volatility: ${o.a.formatPercentage(e.mv/100)} - Price Forecast: `;let t=e.b;e.otlkMag<0&&(t=!t),m+=(t?"+":"-").repeat(Math.floor(Math.abs(e.otlkMag)/10)+1)}let h="primary";return e.lastPrice===e.price?h="secondary":e.lastPrice>e.price&&(h="error"),a.createElement(s.a,{style:{whiteSpace:"pre"},color:h},m)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(0),r=n(1378);function i(t){const e=[];for(let n=0;n=2?a.createElement(a.Fragment,null,a.createElement(l.a,{display:"flex"},a.createElement(s.a,{title:a.createElement(o.a,null,"Shares in the short position will increase in value if the price of the corresponding stock decreases")},a.createElement(o.a,{variant:"h5",color:"primary"},"Short Position:"))),a.createElement(o.a,null,"Shares: ",r.a.formatShares(e.playerShortShares)),a.createElement(o.a,null,"Average Price: ",a.createElement(i.a,{money:e.playerAvgShortPx})," (Total Cost: ",a.createElement(i.a,{money:n}),")"),a.createElement(o.a,null,"Profit: ",a.createElement(i.a,{money:c})," (",r.a.formatPercentage(f),")")):a.createElement(a.Fragment,null)}function u(t){const e=t.stock;return a.createElement(a.Fragment,null,a.createElement(o.a,null,"Max Shares: ",r.a.formatShares(e.maxShares)),a.createElement(o.a,null,"Ask Price: ",a.createElement(i.a,{money:e.getAskPrice()})),a.createElement("br",null),a.createElement(o.a,null,"Bid Price: ",a.createElement(i.a,{money:e.getBidPrice()})),a.createElement(c,t),a.createElement(f,t))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(0),r=n.n(a),i=n(38),o=n(1),s=n(76),l=n(8);function c(t){const[e,n]=Object(a.useState)(null);return r.a.createElement(i.a,{open:t.open,onClose:t.onClose},r.a.createElement(o.a,null,t.text),r.a.createElement(s.a,{autoFocus:!0,type:"number",onChange:function(t){""===t.target.value?n(null):n(parseFloat(t.target.value))},placeholder:"price",InputProps:{endAdornment:r.a.createElement(l.a,{onClick:function(){null!==e&&(isNaN(e)||(t.place(e),t.onClose()))}},t.placeText)}}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return E}));var a=n(0),r=n.n(a),i=n(152),o=n(416),s=n(1382),l=n(486),c=n(29),f=n(121),u=n(144),m=n(111),h=n(1),d=n(21),p=n(6),g=n(8);const y=Object(f.a)(()=>Object(u.a)({portal:{cursor:"pointer",fontFamily:"inherit",fontSize:"1rem",fontWeight:"bold",lineHeight:1,padding:0,"&:hover":{color:"#fff"}},level0:{color:"red"},level1:{color:"yellow"},level2:{color:"#48d1cc"},level3:{color:"blue"}}));function b(t){const[e,n]=Object(a.useState)(!1),o=y(),l=i.a["BitNode"+t.n];if(null==l)return r.a.createElement(r.a.Fragment,null,"O");let c=o.level0;return 12===t.n&&t.level>=2?c=o.level2:1===t.level?c=o.level1:3===t.level&&(c=o.level3),2===t.level&&(c=o.level2),c=`${o.portal} ${c}`,r.a.createElement(r.a.Fragment,null,r.a.createElement(d.a,{title:r.a.createElement(h.a,null,r.a.createElement("strong",null,"BitNode-",l.number.toString(),": ",l.name),r.a.createElement("br",null),l.desc)},p.a.DisableASCIIArt?r.a.createElement(g.a,{onClick:()=>n(!0),sx:{m:2},"aria-description":l.desc},r.a.createElement(h.a,null,"BitNode-",l.number.toString(),": ",l.name)):r.a.createElement(m.a,{onClick:()=>n(!0),className:c,"aria-label":`BitNode-${l.number.toString()}: ${l.name}`,"aria-description":l.desc},"O")),r.a.createElement(s.a,{open:e,onClose:()=>n(!1),n:t.n,level:t.level,enter:t.enter,destroyedBitNode:t.destroyedBitNode,flume:t.flume}),p.a.DisableASCIIArt&&r.a.createElement("br",null))}function E(t){const e=c.b.Player(),n=o.a,s=e.bitNodeN,[f,u]=Object(a.useState)(!t.quick);if(f)return r.a.createElement(l.a,{lines:["[ERROR] SEMPOOL INVALID","[ERROR] Segmentation Fault","[ERROR] SIGKILL RECVD","Dumping core...","0000 000016FA 174FEE40 29AC8239 384FEA88","0010 745F696E 2BBBE394 390E3940 248BEC23","0020 7124696B 0000FF69 74652E6F FFFF1111","----------------------------------------","Failsafe initiated...",`Restarting BitNode-${s}...`,"...........","...........","[ERROR] FAILED TO AUTOMATICALLY REBOOT BITNODE","..............................................","..............................................","..............................................","..............................................","..............................................",".............................................."],onDone:()=>u(!1),auto:!0});const m=n=>{const a=e.sourceFileLvl(n);if(n!==s)return a;const r=12===n?1/0:3;return Math.min(r,a+Number(!t.flume))};if(p.a.DisableASCIIArt)return r.a.createElement(r.a.Fragment,null,Object.values(i.a).filter(t=>"COMING SOON"!==t.desc).map(e=>r.a.createElement(b,{key:e.number,n:e.number,level:m(e.number),enter:n,flume:t.flume,destroyedBitNode:s})),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(l.a,{lines:["> Many decades ago, a humanoid extraterrestrial species which we call the Enders descended on the Earth...violently","> Our species fought back, but it was futile. The Enders had technology far beyond our own...","> Instead of killing every last one of us, the human race was enslaved...","> We were shackled in a digital world, chained into a prison for our minds...","> Using their advanced technology, the Enders created complex simulations of a virtual reality...","> Simulations designed to keep us content...ignorant of the truth.","> Simulations used to trap and suppress our consciousness, to keep us under control...","> Why did they do this? Why didn't they just end our entire race? We don't know, not yet.","> Humanity's only hope is to destroy these simulations, destroy the only realities we've ever known...","> Only then can we begin to fight back...","> By hacking the daemon that generated your reality, you've just destroyed one simulation, called a BitNode...","> But there is still a long way to go...","> The technology the Enders used to enslave the human race wasn't just a single complex simulation...","> There are tens if not hundreds of BitNodes out there...","> Each with their own simulations of a reality...","> Each creating their own universes...a universe of universes","> And all of which must be destroyed...","> .......................................","> Welcome to the Bitverse...","> ","> (Enter a new BitNode using the image above)"]}));const d=m;return r.a.createElement(r.a.Fragment,null,r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," O "),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," | O O | O O | "),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," O | | / __| \\ | | O "),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," O | O | | O / | O | | O | O "),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," | | | | |_/ |/ | \\_ \\_| | | | | "),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," O | | | O | | O__/ | / \\__ | | O | | | O "),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," | | | | | | | / /| O / \\| | | | | | | "),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}},"O | | | \\| | O / _/ | / O | |/ | | | O"),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}},"| | | |O / | | O / | O O | | \\ O| | | |"),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}},"| | |/ \\/ / __| | |/ \\ | \\ | |__ \\ \\/ \\| | |"),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," \\| O | |_/ |\\| \\ ",r.a.createElement(b,{n:13,level:d(13),enter:n,flume:t.flume,destroyedBitNode:s})," \\__| \\_| | O |/ "),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," | | |_/ | | \\| / | \\_| | | "),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," \\| / \\| | / / \\ |/ "),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," | ",r.a.createElement(b,{n:10,level:d(10),enter:n,flume:t.flume,destroyedBitNode:s})," | | / | ",r.a.createElement(b,{n:11,level:d(11),enter:n,flume:t.flume,destroyedBitNode:s})," | "),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," ",r.a.createElement(b,{n:9,level:d(9),enter:n,flume:t.flume,destroyedBitNode:s})," | | | | | | | ",r.a.createElement(b,{n:12,level:d(12),enter:n,flume:t.flume,destroyedBitNode:s})," "),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," | | | / / \\ \\ | | | "),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," \\| | / ",r.a.createElement(b,{n:7,level:d(7),enter:n,flume:t.flume,destroyedBitNode:s})," / \\ ",r.a.createElement(b,{n:8,level:d(8),enter:n,flume:t.flume,destroyedBitNode:s})," \\ | |/ "),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," \\ | / / | | \\ \\ | / "),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," \\ \\JUMP ",r.a.createElement(b,{n:5,level:d(5),enter:n,flume:t.flume,destroyedBitNode:s}),"3R | | | | | | R3",r.a.createElement(b,{n:6,level:d(6),enter:n,flume:t.flume,destroyedBitNode:s})," PMUJ/ / "),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," \\|| | | | | | | | | ||/ "),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," \\| \\_ | | | | | | _/ |/ "),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," \\ \\| / \\ / \\ |/ / "),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," ",r.a.createElement(b,{n:1,level:d(1),enter:n,flume:t.flume,destroyedBitNode:s})," |/ ",r.a.createElement(b,{n:2,level:d(2),enter:n,flume:t.flume,destroyedBitNode:s})," | | ",r.a.createElement(b,{n:3,level:d(3),enter:n,flume:t.flume,destroyedBitNode:s})," \\| ",r.a.createElement(b,{n:4,level:d(4),enter:n,flume:t.flume,destroyedBitNode:s})," "),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," | | | | | | | | "),r.a.createElement(h.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," \\JUMP3R|JUMP|3R| |R3|PMUJ|R3PMUJ/ "),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(l.a,{lines:["> Many decades ago, a humanoid extraterrestrial species which we call the Enders descended on the Earth...violently","> Our species fought back, but it was futile. The Enders had technology far beyond our own...","> Instead of killing every last one of us, the human race was enslaved...","> We were shackled in a digital world, chained into a prison for our minds...","> Using their advanced technology, the Enders created complex simulations of a virtual reality...","> Simulations designed to keep us content...ignorant of the truth.","> Simulations used to trap and suppress our consciousness, to keep us under control...","> Why did they do this? Why didn't they just end our entire race? We don't know, not yet.","> Humanity's only hope is to destroy these simulations, destroy the only realities we've ever known...","> Only then can we begin to fight back...","> By hacking the daemon that generated your reality, you've just destroyed one simulation, called a BitNode...","> But there is still a long way to go...","> The technology the Enders used to enslave the human race wasn't just a single complex simulation...","> There are tens if not hundreds of BitNodes out there...","> Each with their own simulations of a reality...","> Each creating their own universes...a universe of universes","> And all of which must be destroyed...","> .......................................","> Welcome to the Bitverse...","> ","> (Enter a new BitNode using the image above)"]}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var a=n(0),r=n.n(a),i=n(152),o=n(29),s=n(38),l=n(1),c=n(8),f=n(647);function u(t){const e=o.b.Router(),n="BitNode"+t.n,a=i.a[n];if(null==a)throw new Error("Could not find BitNode object for number: "+t.n);const u=12===t.n?"∞":"3",m=Math.min(t.level+1,12===t.n?1/0:3);return r.a.createElement(s.a,{open:t.open,onClose:t.onClose},r.a.createElement(l.a,{variant:"h4"},"BitNode-",t.n,": ",a.name),r.a.createElement("br",null),r.a.createElement(l.a,null,"Source-File Level: ",t.level," / ",u),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(l.a,null," Difficulty: ",["easy","normal","hard"][a.difficulty]),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(l.a,null,a.info),r.a.createElement(f.b,{n:t.n,level:m}),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(c.a,{"aria-label":"enter-bitnode-"+a.number.toString(),autoFocus:!0,onClick:()=>{t.enter(e,t.flume,t.destroyedBitNode,t.n),t.onClose()}},"Enter BN",t.n,".",m))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var a=n(0),r=n.n(a),i=n(1);function o(t){const[e,n]=Object(a.useState)(0),[o,s]=Object(a.useState)(!1);return Object(a.useEffect)(()=>{if(o&&t.onDone)return void t.onDone();let a=!1;return(async()=>{var r;await(r=10,new Promise(t=>setTimeout(t,r))).then(()=>!a&&function(){const a=e+1;n(a),s(a>=t.text.length)}())})(),()=>{a=!0}}),r.a.createElement(r.a.Fragment,null,r.a.createElement(i.a,null,t.text.slice(0,e),!o&&r.a.createElement("span",null,"█")))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var a=n(0),r=n.n(a),i=n(22),o=n(10),s=n(601),l=n(1385),c=n(692),f=n(14),u=n(1),m=n(271),h=n(120),d=n(553),p=n(249);function g({staneksGift:t}){const e=Object(a.useState)(!0)[1];function n(){e(t=>!t)}return Object(a.useEffect)(()=>s.a.subscribe(n),[]),r.a.createElement(p.a,{maxWidth:"lg",disableGutters:!0,sx:{mx:0}},r.a.createElement(u.a,{variant:"h4"},"Stanek's Gift",r.a.createElement(c.a,{sx:{ml:1,mb:0},color:"info",onClick:()=>{var t,e,n,a,i,o,s,l,c;return Object(f.a)(r.a.createElement(r.a.Fragment,null,r.a.createElement(u.a,null,"Stanek's Gift is a powerful, unique augmentation obtained by joining the Church of the Machine God, which can be found in Chongqing. It is only possible to join the church if you are in BitNode 13 or possess at least one level of Source File 13, and you will be turned away if you have purchased or installed any augmentations beside NeuroFlux Governors. You are, however, permitted to install augmentations as normal once you have joined the church."),r.a.createElement("br",null),r.a.createElement(u.a,null,"Initially, those bearing the gift will find that its overwhelming power worsens all of their stats by 10%. This penalty can be overcome in time by receiving free upgrades from the Church of the Machine God faction, but the reputation requirements for these upgrades are steep, and you can only obtain reputation with the church by charging the gift."),r.a.createElement("br",null),r.a.createElement(u.a,null,"In order to charge Stanek's Gift, the user must first arrange stat-modifying fragments within the grid located on the device. This may be done manually or by scripts that utilize the Stanek's Gift Netscript API. Not every tile of the grid must house a fragment, but fragments cannot overlap or otherwise share tiles. Fragments can be rotated, but their design does not allow them to be flipped around to mirror their original shape. Note that the size of the grid is determined by the BitNode you are currently in and the level of your Source File 13, if applicable."),r.a.createElement("br",null),r.a.createElement(u.a,null,"There exist two kinds of fragments. The first are Stat Fragments, which take up 4 tiles of the grid. Each Stat Fragment is unique, and there is only one of each. There is no way to obtain more of these fragments. Each Stat Fragment has an associated stat that it will improve, as well as a multiplier on its effectiveness known as power. When initially placed, a Stat Fragment will have no effect. In order for the fragment to gain stat boosts, it must be charged. The other kind of fragments are known as Booster Fragments, which take up 5 tiles of the grid. There is no shortage of Booster Fragments, and it is virtually impossible to run out of them. While not providing any direct stat increases to their user, Stat Fragments increase the efficacy of adjacent Stat Fragments by 10%, and do not need to be charged."),r.a.createElement("br",null),r.a.createElement(d.a,{width:4,height:4,fragments:[new m.a({x:0,y:0,rotation:0,fragment:null!==(t=h.c.find(t=>5===t.id))&&void 0!==t?t:h.c[0]}),new m.a({x:0,y:2,rotation:0,fragment:null!==(e=h.c.find(t=>101===t.id))&&void 0!==e?e:h.c[0]})]}),r.a.createElement(u.a,{sx:{fontStyle:"italic"}},"This Booster Fragment provides a bonus to the adjacent Stat Fragment."),r.a.createElement("br",null),r.a.createElement(d.a,{width:3,height:4,fragments:[new m.a({x:0,y:1,rotation:3,fragment:null!==(n=h.c.find(t=>100===t.id))&&void 0!==n?n:h.c[0]}),new m.a({x:0,y:0,rotation:2,fragment:null!==(a=h.c.find(t=>1===t.id))&&void 0!==a?a:h.c[0]})]}),r.a.createElement(u.a,{sx:{fontStyle:"italic"}},"Even though the Booster Fragment touches the Stat Fragment in multiple places, the bonus is only applied once."),r.a.createElement("br",null),r.a.createElement(d.a,{width:4,height:4,fragments:[new m.a({x:0,y:0,rotation:0,fragment:null!==(i=h.c.find(t=>5===t.id))&&void 0!==i?i:h.c[0]}),new m.a({x:1,y:1,rotation:0,fragment:null!==(o=h.c.find(t=>105===t.id))&&void 0!==o?o:h.c[0]})]}),r.a.createElement(u.a,{sx:{fontStyle:"italic"}},"This Booster Fragment does nothing, as it is not touching a Stat Fragment."),r.a.createElement("br",null),r.a.createElement(d.a,{width:4,height:4,fragments:[new m.a({x:0,y:0,rotation:1,fragment:null!==(s=h.c.find(t=>27===t.id))&&void 0!==s?s:h.c[0]}),new m.a({x:0,y:1,rotation:2,fragment:null!==(l=h.c.find(t=>100===t.id))&&void 0!==l?l:h.c[0]}),new m.a({x:2,y:0,rotation:1,fragment:null!==(c=h.c.find(t=>30===t.id))&&void 0!==c?c:h.c[0]})]}),r.a.createElement(u.a,{sx:{fontStyle:"italic"}},"This Booster Fragment provides a bonus to both Stat Fragments it's touching."),r.a.createElement("br",null),r.a.createElement(u.a,null,"Stat Fragments are charged using the stanek.chargeFragment(rootX, rootY) NetScript API function. The charging process ordinarily takes 1000ms to complete, but only takes 200ms during bonus time. When the function finishes executing, the fragment's charge levels will be raised by an amount corresponding to the number of threads that were used. Note that it is no more effective to charge a fragment many times with few threads than to charge few times with many threads, so there is no need to distribute charging jobs across multiple scripts. As a Stat Fragment's charge level is increased, its bonuses will increase, but there will be diminishing returns. As such, it is generally most efficient to charge all of the placed fragments equally. The charge level of a fragment will not decrease over time, but it will be reset to 0 upon removing it from the board or installing augmentations.")))}})),r.a.createElement(u.a,{sx:{mb:1}},"The gift is a grid on which you can place upgrades called fragments. The main type of fragment increases a stat, like your hacking skill or agility exp. Once a stat fragment is placed it then needs to be charged via scripts in order to become useful. The other kind of fragments are called booster fragments. They increase the efficiency of the neighboring fragments (not diagonally). Use Q/E to rotate fragments."),t.storedCycles>5&&r.a.createElement(u.a,{sx:{mb:1}},"Bonus time: ",Object(i.d)(o.a._idleSpeed*t.storedCycles)),r.a.createElement(l.a,{gift:t}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var a=n(0),r=n(120),i=n(61),o=n(1386),s=n(1387),l=n(19),c=n(8),f=n(78),u=n(649),m=n(101),h=n(1389),d=n(21),p=n(1);function g(t){const[e,n]=a.useState(Object(m.a)(t.gift)),[g,y]=a.useState(Object(m.d)([t.gift.width(),t.gift.height()])),[b,E]=a.useState([0,0]),[v,k]=a.useState(0),[_,w]=a.useState(r.d);function S(e,n,a){if(E([e,n]),_.type===i.b.None||_.type===i.b.Delete)return;const r=Object(m.d)([t.gift.width(),t.gift.height()]);for(let t=0;t<_.height(a);t++)for(let i=0;i<_.width(a);i++)_.fullAt(i,t,a)&&(e+i>r.length-1||n+t>r[e+i].length-1||(r[e+i][n+t]=1));y(r)}function x(e,a){if(_.type!=i.b.None){if(_.type==i.b.Delete)!function(e,n){const a=t.gift.fragmentAt(e,n);void 0!==a&&t.gift.delete(a.x,a.y)}(e,a);else{if(!t.gift.canPlace(e,a,v,_))return;t.gift.place(e,a,v,_)}n(Object(m.a)(t.gift))}}return a.useEffect(()=>{function t(t){if("q"===t.key){const t=(v-1+4)%4;k(t),S(b[0],b[1],t)}if("e"===t.key){const t=(v+1)%4;k(t),S(b[0],b[1],t)}}return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)}),a.createElement(a.Fragment,null,a.createElement(l.a,{display:"flex",sx:{mb:1}},a.createElement(f.a,{sx:{mr:1}},a.createElement(u.a,{width:t.gift.width(),height:t.gift.height(),activeGrid:e,ghostGrid:g,gift:t.gift,enter:(t,e)=>S(t,e,v),click:(t,e)=>x(t,e)})),a.createElement(o.a,{gift:t.gift,x:b[0],y:b[1],fragment:t.gift.fragmentAt(b[0],b[1])})),a.createElement(l.a,{display:"flex",sx:{mb:1}},a.createElement(s.a,{gift:t.gift,selectFragment:function(e){w(e);const n=Object(m.d)([t.gift.width(),t.gift.height()]);y(n)}})),a.createElement(h.a,{gift:t.gift}),a.createElement(d.a,{title:a.createElement(p.a,null,"WARNING : This will remove all active fragment from the grid. ",a.createElement("br",null),"All cumulated charges will be lost.")},a.createElement(c.a,{onClick:function(){t.gift.clear(),n(Object(m.d)([t.gift.width(),t.gift.height()]))}},"Clear grid")))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(0),r=n.n(a),i=n(61),o=n(5),s=n(45),l=n(1);function c(t){const[,e]=Object(a.useState)(new Date);if(Object(a.useEffect)(()=>{const t=setInterval(()=>e(new Date),250);return()=>clearInterval(t)},[]),void 0===t.fragment)return r.a.createElement(s.a,{sx:{flexGrow:1}},r.a.createElement(l.a,null,"[X, Y] ",t.x,", ",t.y,r.a.createElement("br",null),r.a.createElement("br",null),"ID: N/A",r.a.createElement("br",null),"Effect: N/A",r.a.createElement("br",null),"Base Power: N/A",r.a.createElement("br",null),"Charge: N/A",r.a.createElement("br",null),"root [X, Y] N/A",r.a.createElement("br",null)));const n=t.fragment.fragment();let c=o.a.formatStaneksGiftCharge(t.fragment.highestCharge*t.fragment.numCharge),f="N/A";if([i.b.Booster,i.b.None,i.b.Delete].includes(n.type))c="N/A",f=n.power+"x adjacent fragment power";else if(Object(i.a)(n.type).includes("+x%"))f=Object(i.a)(n.type).replace(/-*x%/,o.a.formatPercentage(t.gift.effect(t.fragment)-1));else if(Object(i.a)(n.type).includes("-x%")){const e=t.gift.effect(t.fragment),a=o.a.formatPercentage(1-1/e);f=Object(i.a)(n.type).replace(/-x%/,a)}return r.a.createElement(s.a,{sx:{flexGrow:1}},r.a.createElement(l.a,null,"[X, Y] ",t.x,", ",t.y,r.a.createElement("br",null),r.a.createElement("br",null),"ID: ",t.fragment.id,r.a.createElement("br",null),"Effect: ",f,r.a.createElement("br",null),"Base Power: ",o.a.formatStaneksGiftPower(n.power),r.a.createElement("br",null),"Charge: ",c,r.a.createElement("br",null),"root [X, Y] ",t.fragment.x,", ",t.fragment.y,r.a.createElement("br",null)))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var a=n(0),r=n.n(a),i=n(120),o=n(61),s=n(1388),l=n(5),c=n(130),f=n(74),u=n(1),m=n(19);function h(t){const e=t.fragment.limit-t.gift.count(t.fragment),n=t.fragment.limit!==1/0?r.a.createElement(r.a.Fragment,null,e," remaining"):r.a.createElement(r.a.Fragment,null);return r.a.createElement(m.a,{display:"flex"},r.a.createElement(m.a,{sx:{mx:2}},r.a.createElement(s.a,{width:t.fragment.width(0),height:t.fragment.height(0),colorAt:(n,a)=>t.fragment.fullAt(n,a,0)?0===e?"grey":t.fragment.type===o.b.Booster?"blue":"green":""})),r.a.createElement(u.a,null,t.fragment.type===o.b.Booster?t.fragment.power+"x adjacent fragment power":Object(o.a)(t.fragment.type),r.a.createElement("br",null),"power: ",l.a.formatStaneksGiftPower(t.fragment.power),r.a.createElement("br",null),n))}function d(t){const[e,n]=Object(a.useState)("None");return r.a.createElement(c.a,{sx:{width:"100%"},onChange:function(e){const a=e.target.value;if(n(a),"None"===a)return void t.selectFragment(i.d);if("Delete"===a)return void t.selectFragment(i.a);const r=i.c.find(t=>t.id===a);if(void 0===r)throw new Error("Fragment selector selected an undefined fragment with id "+a);"number"==typeof a&&t.selectFragment(r)},value:e},r.a.createElement(f.a,{value:"None"},r.a.createElement(u.a,null,"None")),r.a.createElement(f.a,{value:"Delete"},r.a.createElement(u.a,null,"Delete")),i.c.map(e=>r.a.createElement(f.a,{key:e.id,value:e.id},r.a.createElement(h,{key:e.id,gift:t.gift,selectFragment:t.selectFragment,fragment:e}))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(0),r=n(648),i=n(50),o=n(149),s=n(78);function l(t){const e=[];for(let n=0;n{const a=n.fragment();if(![i.b.Booster,i.b.None,i.b.Delete].includes(a.type)){const r=e.find(t=>t.type===a.type);r?(r.effect*=t.gift.effect(n),r.coordinate.push({x:n.x,y:n.y})):e.push({coordinate:[{x:n.x,y:n.y}],effect:t.gift.effect(n),type:a.type})}}),r.a.createElement(s.a,{sx:{mb:1}},r.a.createElement(l.a,{variant:"h5"},"Summary of active fragments:"),r.a.createElement(c.a,{sx:{display:"table",width:"100%"}},r.a.createElement(f.a,null,r.a.createElement(u.a,null,r.a.createElement(m.a,{sx:{borderBottom:"none",p:0,m:0}},r.a.createElement(l.a,null,"Coordinate")),r.a.createElement(m.a,{sx:{borderBottom:"none",p:0,m:0}},r.a.createElement(l.a,null,"Effect"))),e.map(t=>r.a.createElement(u.a,null,r.a.createElement(m.a,{sx:{borderBottom:"none",p:0,m:0}},r.a.createElement(l.a,null,t.coordinate.map(t=>"["+t.x+","+t.y+"]"))),r.a.createElement(m.a,{sx:{borderBottom:"none",p:0,m:0}},r.a.createElement(l.a,null,function(t,e){if(Object(i.a)(e).includes("+x%"))return Object(i.a)(e).replace(/-*x%/,o.a.formatPercentage(t-1));if(Object(i.a)(e).includes("-x%")){const n=o.a.formatPercentage(1-1/t);return Object(i.a)(e).replace(/-x%/,n)}return Object(i.a)(e)}(t.effect,t.type))))))))}},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,e,n){a(this,"storedCycles",0),a(this,"fragments",[]),this.fragments=n,this._width=t,this._height=e}width(){return this._width}height(){return this._height}charge(){throw new Error("unimplemented for dummy gift")}process(){throw new Error("unimplemented for dummy gift")}effect(){throw new Error("unimplemented for dummy gift")}canPlace(){throw new Error("unimplemented for dummy gift")}place(){throw new Error("unimplemented for dummy gift")}findFragment(){throw new Error("unimplemented for dummy gift")}fragmentAt(t,e){for(const n of this.fragments)if(n.fullAt(t,e))return n}delete(){throw new Error("unimplemented for dummy gift")}clear(){throw new Error("unimplemented for dummy gift")}count(){throw new Error("unimplemented for dummy gift")}inBonus(){throw new Error("unimplemented for dummy gift")}prestigeAugmentation(){throw new Error("unimplemented for dummy gift")}prestigeSourceFile(){throw new Error("unimplemented for dummy gift")}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(0),r=n.n(a),i=n(4),o=n(29),s=n(486),l=n(14);function c(){const t=o.b.Router();return r.a.createElement(s.a,{lines:[`In the middle of the 21st century, ${i.a.OmniTekIncorporated} advanced robot evolution `,"with their Synthoids (synthetic androids), a being virtually identical to a human.","------","Their sixth-generation Synthoids, called MK-VI, were stronger, faster, and more ","intelligent than humans. Many argued that the MK-VI Synthoids were the first ","example of sentient AI.","------",`Unfortunately, in 2070 a terrorist group called Ascendis Totalis hacked into ${i.a.OmniTekIncorporated} and `,"uploaded a rogue AI into their Synthoid manufacturing facilities.","------","The MK-VI Synthoids infected by the rogue AI turned hostile toward humanity, initiating ","the deadliest conflict in human history. This dark chapter is now known as the Synthoid Uprising.","------","In the aftermath of the Uprising, further manufacturing of Synthoids with advanced AI ","was banned. MK-VI Synthoids that did not have the rogue Ascendis Totalis AI were ","allowed to continue their existence.","------","The intelligence community believes that not all of the rogue MK-VI Synthoids from the Uprising were ","found and destroyed, and that many of them are blending in as normal humans in society today. ",`As a result, many nations have created ${i.a.Bladeburners} divisions, special units that are tasked with `,"investigating and dealing with Synthoid threats."],onDone:()=>{t.toTerminal(),Object(l.a)(`Visit the National Security Agency (NSA) to apply for their ${i.a.Bladeburners} division! You will need 100 of each combat stat before doing this.`)}})}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(0),r=n.n(a),i=n(29),o=n(108);const s=window.getComputedStyle;function l(){const t=i.b.Player();return r.a.createElement("div",{id:"unclickable",onClick:function(e){if(!(e.target&&e.target instanceof Element))return;const n=s(e.target).display,a=s(e.target).visibility;"none"===n&&"hidden"===a&&e.isTrusted&&t.giveExploit(o.a.Unclickable)},style:{display:"none",visibility:"hidden"}},"Click on this to upgrade your Source-File -1!")}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var a=n(0),r=n.n(a),i=n(121),o=n(144),s=n(1395),l=n(300),c=n(1),f=n(2);const u=Object(i.a)(t=>Object(o.a)({root:{width:50,padding:t.spacing(2),userSelect:"none"}}));function m(){const t=u();return r.a.createElement("div",{className:t.root,style:{width:"90%"}},r.a.createElement(c.a,{variant:"h4"},"Achievements"),r.a.createElement(s.a,{achievements:Object.values(l.a),playerAchievements:f.a.achievements}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var a=n(0),r=n.n(a),i=n(19),o=n(157),s=n(158),l=n(1),c=n(159),f=n(795),u=n(6),m=n(796),h=n(471);function d({achievements:t,playerAchievements:e}){const n=Object(m.a)(u.a.theme.primary),a=Object(m.a)(u.a.theme.secondary),d=t.map(t=>{var n;return{achievement:t,unlockedOn:null===(n=e.find(e=>e.ID===t.ID))||void 0===n?void 0:n.unlockedOn}}).sort((t,e)=>{var n,a;return(null!==(n=e.unlockedOn)&&void 0!==n?n:0)-(null!==(a=t.unlockedOn)&&void 0!==a?a:0)}),p=d.filter(t=>t.unlockedOn),g=d.filter(t=>!t.unlockedOn&&t.achievement.Secret),y=d.filter(t=>!t.unlockedOn&&!t.achievement.Secret&&t.achievement.Visible&&!t.achievement.Visible()),b=d.filter(t=>!p.map(t=>t.achievement.ID).includes(t.achievement.ID)).filter(t=>!g.map(t=>t.achievement.ID).includes(t.achievement.ID)).filter(t=>!y.map(t=>t.achievement.ID).includes(t.achievement.ID));return r.a.createElement(i.a,{sx:{pr:18,my:2}},r.a.createElement(i.a,{sx:{display:"flex",flexDirection:"column",flexWrap:"wrap"}},p.length>0&&r.a.createElement(o.a,{defaultExpanded:!0,disableGutters:!0,square:!0},r.a.createElement(s.a,null,r.a.createElement(l.a,{variant:"h5",sx:{my:1}},"Acquired (",p.length,"/",d.length,")")),r.a.createElement(c.a,{sx:{pt:2}},p.map(t=>r.a.createElement(f.a,{key:"unlocked_"+t.achievement.ID,achievement:t.achievement,unlockedOn:t.unlockedOn,cssFiltersUnlocked:n,cssFiltersLocked:a})))),b.length>0&&r.a.createElement(o.a,{disableGutters:!0,square:!0},r.a.createElement(s.a,null,r.a.createElement(l.a,{variant:"h5",color:"secondary"},"Locked (",b.length," remaining)")),r.a.createElement(c.a,{sx:{pt:2}},b.map(t=>r.a.createElement(f.a,{key:"locked_"+t.achievement.ID,achievement:t.achievement,cssFiltersUnlocked:n,cssFiltersLocked:a})))),y.length>0&&r.a.createElement(o.a,{disableGutters:!0,square:!0},r.a.createElement(s.a,null,r.a.createElement(l.a,{variant:"h5",color:"secondary"},"Unavailable (",y.length," remaining)")),r.a.createElement(c.a,null,r.a.createElement(l.a,{sx:{mt:1}},y.length," additional achievements hidden behind content you don't have access to."))),g.length>0&&r.a.createElement(o.a,{disableGutters:!0,square:!0},r.a.createElement(s.a,null,r.a.createElement(l.a,{variant:"h5",color:"secondary"},"Secret (",g.length," remaining)")),r.a.createElement(c.a,null,r.a.createElement(l.a,{color:"secondary",sx:{mt:1}},g.map(t=>r.a.createElement("span",{key:"secret_"+t.achievement.ID},r.a.createElement(h.a,{content:t.achievement.ID}),r.a.createElement("br",null))))))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(0),r=n.n(a),i=n(19),o=n(6);function s({achievement:t,unlocked:e,colorFilters:n,size:s}){const[l,c]=Object(a.useState)(!1),f=e?o.a.theme.primarydark:o.a.theme.secondarydark;return t.Icon?r.a.createElement(i.a,{sx:{border:"1px solid "+f,width:s,height:s,m:1,visibility:l?"visible":"hidden"}},r.a.createElement("img",{src:`dist/icons/achievements/${encodeURI(t.Icon)}.svg`,style:{filter:n,width:s,height:s},onLoad:()=>c(!0),alt:t.Name})):r.a.createElement(r.a.Fragment,null)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(0),r=n.n(a),i=n(539),o=n(417);class s extends r.a.Component{constructor(t){super(t),this.state={hasError:!1}}reset(){this.setState({hasError:!1})}componentDidCatch(t,e){this.setState({errorInfo:e,page:this.props.router.page()}),console.error(t,e)}render(){if(this.state.hasError){let t;if(this.state.error)try{t=Object(i.a)(this.state.error,this.state.errorInfo,this.state.page)}catch(t){console.error(t)}return r.a.createElement(o.c,{router:this.props.router,softReset:this.props.softReset,errorData:t,resetError:()=>this.reset()})}return this.props.children}static getDerivedStateFromError(t){return{hasError:!0,error:t}}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return v}));var a=n(0),r=n.n(a),i=n(1),o=n(45),s=n(170),l=n(6),c=n(337),f=n(8),u=n(19),m=n(356),h=n(622),d=n(621),p=n(1399),g=n(631),y=n(38),b=n(94);let E=0;function v({router:t}){const[e,n]=Object(a.useState)(!1),[v,k]=Object(a.useState)(),_=Object(c.b)(),w=_&&Object.entries(_).map(([t,e])=>r.a.createElement(p.a,{key:t,theme:e,onActivated:()=>function(t){E=window.scrollY;const e={...l.a.theme};Object.assign(l.a.theme,t.colors),s.b.emit(),b.b.emit(r.a.createElement(r.a.Fragment,null,'Updated theme to "',r.a.createElement("strong",null,t.name),'"',r.a.createElement(f.a,{sx:{ml:1},color:"secondary",size:"small",onClick:()=>{Object.assign(l.a.theme,e),s.b.emit()}},"UNDO")),b.d.INFO,3e4)}(e),onImageClick:S}))||r.a.createElement(r.a.Fragment,null);function S(t){E=window.scrollY,k(t),n(!0)}return Object(a.useEffect)(()=>{requestAnimationFrame(()=>window.scrollTo(0,E))}),r.a.createElement(u.a,{sx:{mx:2}},r.a.createElement(i.a,{variant:"h4"},"Theme Browser"),r.a.createElement(o.a,{sx:{px:2,py:1,my:1}},r.a.createElement(g.a,null),r.a.createElement(m.a,{sx:{mb:2,display:"block"}},r.a.createElement(h.a,{router:t}),r.a.createElement(d.a,null)),r.a.createElement(u.a,{sx:{display:"flex",flexWrap:"wrap"}},w),r.a.createElement(y.a,{open:e,onClose:function(){E=window.scrollY,n(!1)}},r.a.createElement("img",{src:v,style:{width:"100%"}}))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var a=n(0),r=n.n(a),i=n(1),o=n(21),s=n(632),l=n.n(s),c=n(6),f=n(1840),u=n(1841),m=n(8),h=n(150),d=n(1842),p=n(1843);function g({theme:t,onActivated:e,onImageClick:n}){return t?r.a.createElement(f.a,{key:t.screenshot,sx:{width:400,mr:1,mb:1}},r.a.createElement(u.a,{action:r.a.createElement(o.a,{title:"Use this theme"},r.a.createElement(m.a,{startIcon:r.a.createElement(l.a,null),onClick:e,variant:"outlined"},"Use")),title:t.name,subheader:r.a.createElement(r.a.Fragment,null,"by ",t.credit," ",t.reference&&r.a.createElement(r.a.Fragment,null,"(",r.a.createElement(h.a,{href:t.reference,target:"_blank"},"ref"),")")),sx:{color:c.a.theme.primary,"& .MuiCardHeader-subheader":{color:c.a.theme.secondarydark},"& .MuiButton-outlined":{backgroundColor:"transparent"}}}),r.a.createElement(d.a,{component:"img",width:"400",image:t.screenshot,alt:`Theme Screenshot of "${t.name}"`,sx:{borderTop:"1px solid "+c.a.theme.welllight,borderBottom:"1px solid "+c.a.theme.welllight,cursor:"zoom-in"},onClick:()=>n(t.screenshot)}),r.a.createElement(p.a,null,r.a.createElement(i.a,{variant:"body2",color:"text.secondary",sx:{color:c.a.theme.primarydark}},t.description))):r.a.createElement(r.a.Fragment,null)}},,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return j}));var a=n(0),r=n.n(a),i=n(21),o=n(19),s=n(1),l=n(1485),c=n(45),f=n(148),u=n(1486),m=n(50),h=n(30),d=n(149),p=n(356),g=n(8),y=n(121),b=n(144),E=n(1404),v=n.n(E),k=n(1405),_=n.n(k),w=n(650),S=n.n(w),x=n(1407),C=n.n(x),L=n(1406),O=n.n(L),M=n(109),T=n(6),A=n(22),R=n(5),N=n(252),P=n(298);const I=Object(y.a)(t=>Object(b.a)({root:{padding:t.spacing(2),maxWidth:"1000px","& .MuiTable-root":{"& .MuiTableCell-root":{borderBottom:"1px solid "+T.a.theme.welllight},"& .MuiTableHead-root .MuiTableRow-root":{backgroundColor:T.a.theme.backgroundsecondary,"& .MuiTableCell-root":{color:T.a.theme.primary,fontWeight:"bold"}},"& .MuiTableBody-root":{"& .MuiTableRow-root:nth-of-type(odd)":{backgroundColor:T.a.theme.well,"& .MuiTableCell-root":{color:T.a.theme.primarylight}},"& .MuiTableRow-root:nth-of-type(even)":{backgroundColor:T.a.theme.backgroundsecondary,"& .MuiTableCell-root":{color:T.a.theme.primarylight}}}}}}));function F({isBetter:t}){return t?r.a.createElement(i.a,{title:r.a.createElement(r.a.Fragment,null,"Imported value is ",r.a.createElement("b",null,"larger"),"!")},r.a.createElement(v.a,{color:"success"})):r.a.createElement(i.a,{title:r.a.createElement(r.a.Fragment,null,"Imported value is ",r.a.createElement("b",null,"smaller"),"!")},r.a.createElement(_.a,{color:"error"}))}let D=0;function j(t){var e,n,y,b,E,v,k,_,w,x,L,j,B,G,W,H,U,q,$,K,z,V,Y,J,X,Q,Z,tt,et,nt,at,rt,it,ot,st,lt,ct,ft,ut,mt,ht,dt,pt,gt,yt,bt,Et,vt,kt,_t,wt,St,xt,Ct,Lt,Ot,Mt,Tt,At,Rt,Nt,Pt,It,Ft,Dt,jt,Bt,Gt,Wt,Ht,Ut,qt,$t,Kt,zt,Vt,Yt,Jt,Xt,Qt,Zt,te,ee,ne,ae,re;const ie=I(),[oe,se]=Object(a.useState)(),[le,ce]=Object(a.useState)(),[fe,ue]=Object(a.useState)(!1),[me,he]=Object(a.useState)(!1);return Object(a.useEffect)(()=>{D=T.a.AutosaveInterval,T.a.AutosaveInterval=0,t.router.allowRouting(!1)},[]),Object(a.useEffect)(()=>{me&&t.router.toTerminal()},[me]),Object(a.useEffect)(()=>{t.importString&&async function(){const e=await M.c.getImportDataFromString(t.importString),n=await M.c.getImportDataFromString(M.c.getSaveString(!0));se(e),ce(n),Promise.resolve()}()},[t.importString]),oe&&le?r.a.createElement(o.a,{className:ie.root},r.a.createElement(s.a,{variant:"h4",sx:{mb:2}},"Import Save Comparison"),t.automatic&&r.a.createElement(s.a,{sx:{mb:2}},"We've found a ",r.a.createElement("b",null,"NEWER save")," that you may want to use instead."),r.a.createElement(s.a,{variant:"body1",sx:{mb:2}},"Your current game's data is on the left and the data that will be imported is on the right.",r.a.createElement("br",null),"Please double check everything is fine before proceeding!"),r.a.createElement(l.a,{color:"secondary",component:c.a},r.a.createElement(f.a,null,r.a.createElement(u.a,null,r.a.createElement(m.a,null,r.a.createElement(h.a,null),r.a.createElement(h.a,null,"Current Game"),r.a.createElement(h.a,null,"Being Imported"),r.a.createElement(h.a,null))),r.a.createElement(d.a,null,r.a.createElement(m.a,null,r.a.createElement(h.a,null,"Game Identifier"),r.a.createElement(h.a,null,null!==(e=null===(n=le.playerData)||void 0===n?void 0:n.identifier)&&void 0!==e?e:"n/a"),r.a.createElement(h.a,null,null!==(y=null===(b=oe.playerData)||void 0===b?void 0:b.identifier)&&void 0!==y?y:"n/a"),r.a.createElement(h.a,null,(null===(E=oe.playerData)||void 0===E?void 0:E.identifier)!==(null===(v=le.playerData)||void 0===v?void 0:v.identifier)&&r.a.createElement(i.a,{title:"These are two different games!"},r.a.createElement(O.a,{color:"warning"})))),r.a.createElement(m.a,null,r.a.createElement(h.a,null,"Playtime"),r.a.createElement(h.a,null,Object(A.d)(null!==(k=null===(_=le.playerData)||void 0===_?void 0:_.totalPlaytime)&&void 0!==k?k:0)),r.a.createElement(h.a,null,Object(A.d)(null!==(w=null===(x=oe.playerData)||void 0===x?void 0:x.totalPlaytime)&&void 0!==w?w:0)),r.a.createElement(h.a,null,(null===(L=oe.playerData)||void 0===L?void 0:L.totalPlaytime)!==(null===(j=le.playerData)||void 0===j?void 0:j.totalPlaytime)&&r.a.createElement(F,{isBetter:(null!==(B=null===(G=oe.playerData)||void 0===G?void 0:G.totalPlaytime)&&void 0!==B?B:0)>(null!==(W=null===(H=le.playerData)||void 0===H?void 0:H.totalPlaytime)&&void 0!==W?W:0)}))),r.a.createElement(m.a,null,r.a.createElement(h.a,null,"Saved On"),r.a.createElement(h.a,null,(null!==(U=null===(q=le.playerData)||void 0===q?void 0:q.lastSave)&&void 0!==U?U:0)>0?new Date(null!==($=null===(K=le.playerData)||void 0===K?void 0:K.lastSave)&&void 0!==$?$:0).toLocaleString():"n/a"),r.a.createElement(h.a,null,(null!==(z=null===(V=oe.playerData)||void 0===V?void 0:V.lastSave)&&void 0!==z?z:0)>0?new Date(null!==(Y=null===(J=oe.playerData)||void 0===J?void 0:J.lastSave)&&void 0!==Y?Y:0).toLocaleString():"n/a"),r.a.createElement(h.a,null,(null===(X=oe.playerData)||void 0===X?void 0:X.lastSave)!==(null===(Q=le.playerData)||void 0===Q?void 0:Q.lastSave)&&r.a.createElement(F,{isBetter:(null!==(Z=null===(tt=oe.playerData)||void 0===tt?void 0:tt.lastSave)&&void 0!==Z?Z:0)>(null!==(et=null===(nt=le.playerData)||void 0===nt?void 0:nt.lastSave)&&void 0!==et?et:0)}))),r.a.createElement(m.a,null,r.a.createElement(h.a,null,"Money"),r.a.createElement(h.a,null,R.a.formatMoney(null!==(at=null===(rt=le.playerData)||void 0===rt?void 0:rt.money)&&void 0!==at?at:0)),r.a.createElement(h.a,null,R.a.formatMoney(null!==(it=null===(ot=oe.playerData)||void 0===ot?void 0:ot.money)&&void 0!==it?it:0)),r.a.createElement(h.a,null,(null===(st=oe.playerData)||void 0===st?void 0:st.money)!==(null===(lt=le.playerData)||void 0===lt?void 0:lt.money)&&r.a.createElement(F,{isBetter:(null!==(ct=null===(ft=oe.playerData)||void 0===ft?void 0:ft.money)&&void 0!==ct?ct:0)>(null!==(ut=null===(mt=le.playerData)||void 0===mt?void 0:mt.money)&&void 0!==ut?ut:0)}))),r.a.createElement(m.a,null,r.a.createElement(h.a,null,"Hacking"),r.a.createElement(h.a,null,R.a.formatSkill(null!==(ht=null===(dt=le.playerData)||void 0===dt?void 0:dt.hacking)&&void 0!==ht?ht:0)),r.a.createElement(h.a,null,R.a.formatSkill(null!==(pt=null===(gt=oe.playerData)||void 0===gt?void 0:gt.hacking)&&void 0!==pt?pt:0)),r.a.createElement(h.a,null,(null===(yt=oe.playerData)||void 0===yt?void 0:yt.hacking)!==(null===(bt=le.playerData)||void 0===bt?void 0:bt.hacking)&&r.a.createElement(F,{isBetter:(null!==(Et=null===(vt=oe.playerData)||void 0===vt?void 0:vt.hacking)&&void 0!==Et?Et:0)>(null!==(kt=null===(_t=le.playerData)||void 0===_t?void 0:_t.hacking)&&void 0!==kt?kt:0)}))),r.a.createElement(m.a,null,r.a.createElement(h.a,null,"Augmentations"),r.a.createElement(h.a,null,null===(wt=le.playerData)||void 0===wt?void 0:wt.augmentations),r.a.createElement(h.a,null,null===(St=oe.playerData)||void 0===St?void 0:St.augmentations),r.a.createElement(h.a,null,(null===(xt=oe.playerData)||void 0===xt?void 0:xt.augmentations)!==(null===(Ct=le.playerData)||void 0===Ct?void 0:Ct.augmentations)&&r.a.createElement(F,{isBetter:(null!==(Lt=null===(Ot=oe.playerData)||void 0===Ot?void 0:Ot.augmentations)&&void 0!==Lt?Lt:0)>(null!==(Mt=null===(Tt=le.playerData)||void 0===Tt?void 0:Tt.augmentations)&&void 0!==Mt?Mt:0)}))),r.a.createElement(m.a,null,r.a.createElement(h.a,null,"Factions"),r.a.createElement(h.a,null,null===(At=le.playerData)||void 0===At?void 0:At.factions),r.a.createElement(h.a,null,null===(Rt=oe.playerData)||void 0===Rt?void 0:Rt.factions),r.a.createElement(h.a,null,(null===(Nt=oe.playerData)||void 0===Nt?void 0:Nt.factions)!==(null===(Pt=le.playerData)||void 0===Pt?void 0:Pt.factions)&&r.a.createElement(F,{isBetter:(null!==(It=null===(Ft=oe.playerData)||void 0===Ft?void 0:Ft.factions)&&void 0!==It?It:0)>(null!==(Dt=null===(jt=le.playerData)||void 0===jt?void 0:jt.factions)&&void 0!==Dt?Dt:0)}))),r.a.createElement(m.a,null,r.a.createElement(h.a,null,"Achievements"),r.a.createElement(h.a,null,null===(Bt=le.playerData)||void 0===Bt?void 0:Bt.achievements),r.a.createElement(h.a,null,null===(Gt=oe.playerData)||void 0===Gt?void 0:Gt.achievements),r.a.createElement(h.a,null,(null===(Wt=oe.playerData)||void 0===Wt?void 0:Wt.achievements)!==(null===(Ht=le.playerData)||void 0===Ht?void 0:Ht.achievements)&&r.a.createElement(F,{isBetter:(null!==(Ut=null===(qt=oe.playerData)||void 0===qt?void 0:qt.achievements)&&void 0!==Ut?Ut:0)>(null!==($t=null===(Kt=le.playerData)||void 0===Kt?void 0:Kt.achievements)&&void 0!==$t?$t:0)}))),r.a.createElement(m.a,null,r.a.createElement(h.a,null,"Source Files"),r.a.createElement(h.a,null,null===(zt=le.playerData)||void 0===zt?void 0:zt.sourceFiles),r.a.createElement(h.a,null,null===(Vt=oe.playerData)||void 0===Vt?void 0:Vt.sourceFiles),r.a.createElement(h.a,null,(null===(Yt=oe.playerData)||void 0===Yt?void 0:Yt.sourceFiles)!==(null===(Jt=le.playerData)||void 0===Jt?void 0:Jt.sourceFiles)&&r.a.createElement(F,{isBetter:(null!==(Xt=null===(Qt=oe.playerData)||void 0===Qt?void 0:Qt.sourceFiles)&&void 0!==Xt?Xt:0)>(null!==(Zt=null===(te=le.playerData)||void 0===te?void 0:te.sourceFiles)&&void 0!==Zt?Zt:0)}))),r.a.createElement(m.a,null,r.a.createElement(h.a,null,"BitNode"),r.a.createElement(h.a,null,null===(ee=le.playerData)||void 0===ee?void 0:ee.bitNode,"-",null===(ne=le.playerData)||void 0===ne?void 0:ne.bitNodeLevel),r.a.createElement(h.a,null,null===(ae=oe.playerData)||void 0===ae?void 0:ae.bitNode,"-",null===(re=oe.playerData)||void 0===re?void 0:re.bitNodeLevel),r.a.createElement(h.a,null))))),r.a.createElement(o.a,{sx:{display:"flex",justifyContent:"flex-end"}},r.a.createElement(p.a,null,r.a.createElement(g.a,{onClick:function(){T.a.AutosaveInterval=D,Object(P.e)(!1),t.router.allowRouting(!0),he(!0)},sx:{my:2},startIcon:r.a.createElement(C.a,null),color:"secondary"},"Take me back!"),r.a.createElement(g.a,{onClick:()=>ue(!0),sx:{my:2},startIcon:r.a.createElement(S.a,null),color:"warning"},"Proceed with import")),r.a.createElement(N.a,{open:fe,onClose:()=>ue(!1),onConfirm:async function(){await M.c.importGame(t.importString,!0),Object(P.e)(!0)},confirmationText:r.a.createElement(r.a.Fragment,null,"Importing new save game data will ",r.a.createElement("strong",null,"completely wipe")," the current game data!",r.a.createElement("br",null))}))):r.a.createElement(r.a.Fragment,null)}},,,,,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 t.content?r.a.createElement(r.a.Fragment,null,t.content):r.a.createElement(r.a.Fragment,null,t.children)}},,,function(t,e,n){"use strict";n.d(e,"a",(function(){return W}));var a=n(105),r=n(199),i=n(79),o=n(119),s=n(12),l=n(142),c=n(10),f=n(146),u=n(369),m=n(379),h=n(368),d=n(95),p=n(258),g=n(15),y=n(9),b=n(90),E=n(88),v=n(25),k=n(186),_=n(24),w=n(65),S=n(5),x=n(18),C=n(238),L=n(67),O=n(26),M=n(110),T=n(22),A=n(137),R=n(84),N=n(102),P=n(46),I=n(481),F=n(376),D=n(57),j=n(416),B=n(4),G=n(34);function W(t,e){const n=function(t,e){if(!Object(o.b)(e))throw t.helper.makeRuntimeErrorMsg(`Invalid augmentation: '${e}'`);return i.a[e]},W=function(t,e){if(!Object(O.b)(e))throw t.helper.makeRuntimeErrorMsg("Invalid faction name: '"+e);return O.a[e]},H=function(t,e){const n=L.a[e];if(null==n||!(n instanceof C.a))throw t.helper.makeRuntimeErrorMsg(`Invalid company name: '${e}'`);return n},U=function(e=null){if(!e)return;const n=t.getHomeComputer();for(const a of n.scripts)if(a.filename===e){if(a.ramUsage>n.maxRam-n.ramUsed+.001)return;const e=new u.a(a,[]);e.threads=1,Object(r.e)(t,e,n)}};return{getOwnedAugmentations:e=>function(n=!1){e.helper.checkSingularityAccess();const a=e.helper.boolean(n),r=[];for(let e=0;efunction(n){e.helper.checkSingularityAccess();const r=e.helper.string("facName",n),i=W(e,r);return Object(a.a)(t,i)},getAugmentationCost:e=>function(a){e.helper.checkSingularityAccess();const r=e.helper.string("augName",a),i=n(e,r).getCost(t);return[i.repCost,i.moneyCost]},getAugmentationPrereq:t=>function(e){t.helper.checkSingularityAccess();const a=t.helper.string("augName",e);return n(t,a).prereqs.slice()},getAugmentationPrice:e=>function(a){e.helper.checkSingularityAccess();const r=e.helper.string("augName",a);return n(e,r).getCost(t).moneyCost},getAugmentationRepReq:e=>function(a){e.helper.checkSingularityAccess();const r=e.helper.string("augName",a);return n(e,r).getCost(t).repCost},getAugmentationStats:t=>function(e){t.helper.checkSingularityAccess();const a=t.helper.string("augName",e),r=n(t,a);return Object.assign({},r.mults)},purchaseAugmentation:e=>function(r,i){e.helper.checkSingularityAccess();const o=e.helper.string("facName",r),l=e.helper.string("augName",i),u=W(e,o),m=n(e,l);if(!Object(a.a)(t,u).includes(l))return e.log(()=>`Faction '${o}' does not have the '${l}' augmentation.`),!1;if(!(m.name===s.a.NeuroFluxGovernor)){for(let n=0;n`You already have the '${l}' augmentation.`),!1;for(let n=0;n`You already have the '${l}' augmentation.`),!1}if(u.playerReputation`You do not have enough reputation with '${u.name}'.`),!1;const h=Object(a.f)(m,u,!0);return e.log(()=>h),!(!Object(f.a)(h)||!h.startsWith("You purchased"))&&(t.gainIntelligenceExp(10*c.a.IntelligenceSingFnBaseExpGain),!0)},softReset:t=>function(n=""){t.helper.checkSingularityAccess();const a=t.helper.string("cbScript",n);t.log(()=>"Soft resetting. This will cause this script to be killed"),setTimeout(()=>{Object(o.f)(!0),U(a)},0),e.running=!1,Object(l.a)(e)},installAugmentations:n=>function(a=""){n.helper.checkSingularityAccess();const r=n.helper.string("cbScript",a);return 0===t.queuedAugmentations.length?(n.log(()=>"You do not have any Augmentations to be installed."),!1):(t.gainIntelligenceExp(10*c.a.IntelligenceSingFnBaseExpGain),n.log(()=>"Installing Augmentations. This will cause this script to be killed"),setTimeout(()=>{Object(o.f)(),U(r)},0),e.running=!1,Object(l.a)(e),!0)},goToLocation:e=>function(n){e.helper.checkSingularityAccess();const a=e.helper.string("locationName",n),r=Object.values(k.a).find(t=>t.name===a);return r?t.city!==r.city?(e.log(()=>`No location named ${a} in ${t.city}`),!1):(b.b.toLocation(r),t.gainIntelligenceExp(c.a.IntelligenceSingFnBaseExpGain/5e4),!0):(e.log(()=>"No location named "+a),!1)},universityCourse:e=>function(n,a,r=!0){e.helper.checkSingularityAccess();const i=e.helper.string("universityName",n),o=e.helper.string("className",a),s=e.helper.boolean(r),l=t.focus;if(t.isWorking){const n=t.singularityStopWork();e.log(()=>n)}let c,f,u;switch(i.toLowerCase()){case y.a.AevumSummitUniversity.toLowerCase():if(t.city!=g.a.Aevum)return e.log(()=>`You cannot study at 'Summit University' because you are not in '${g.a.Aevum}'.`),!1;t.gotoLocation(y.a.AevumSummitUniversity),c=4,f=3;break;case y.a.Sector12RothmanUniversity.toLowerCase():if(t.city!=g.a.Sector12)return e.log(()=>`You cannot study at 'Rothman University' because you are not in '${g.a.Sector12}'.`),!1;t.location=y.a.Sector12RothmanUniversity,c=3,f=2;break;case y.a.VolhavenZBInstituteOfTechnology.toLowerCase():if(t.city!=g.a.Volhaven)return e.log(()=>`You cannot study at 'ZB Institute of Technology' because you are not in '${g.a.Volhaven}'.`),!1;t.location=y.a.VolhavenZBInstituteOfTechnology,c=5,f=4;break;default:return e.log(()=>`Invalid university name: '${i}'.`),!1}switch(o.toLowerCase()){case"Study Computer Science".toLowerCase():u=G.a.StudyComputerScience;break;case"Data Structures".toLowerCase():u=G.a.DataStructures;break;case"Networks".toLowerCase():u=G.a.Networks;break;case"Algorithms".toLowerCase():u=G.a.Algorithms;break;case"Management".toLowerCase():u=G.a.Management;break;case"Leadership".toLowerCase():u=G.a.Leadership;break;default:return e.log(()=>`Invalid class name: ${o}.`),!1}return t.startClass(c,f,u),s?(t.startFocusing(),b.b.toWork()):l&&(t.stopFocusing(),b.b.toTerminal()),e.log(()=>`Started ${u} at ${i}`),!0},gymWorkout:e=>function(n,a,r=!0){e.helper.checkSingularityAccess();const i=e.helper.string("gymName",n),o=e.helper.string("stat",a),s=e.helper.boolean(r),l=t.focus;if(t.isWorking){const n=t.singularityStopWork();e.log(()=>n)}let c,f;switch(i.toLowerCase()){case y.a.AevumCrushFitnessGym.toLowerCase():if(t.city!=g.a.Aevum)return e.log(()=>`You cannot workout at '${y.a.AevumCrushFitnessGym}' because you are not in '${g.a.Aevum}'.`),!1;t.location=y.a.AevumCrushFitnessGym,c=3,f=2;break;case y.a.AevumSnapFitnessGym.toLowerCase():if(t.city!=g.a.Aevum)return e.log(()=>`You cannot workout at '${y.a.AevumSnapFitnessGym}' because you are not in '${g.a.Aevum}'.`),!1;t.location=y.a.AevumSnapFitnessGym,c=10,f=5;break;case y.a.Sector12IronGym.toLowerCase():if(t.city!=g.a.Sector12)return e.log(()=>`You cannot workout at '${y.a.Sector12IronGym}' because you are not in '${g.a.Sector12}'.`),!1;t.location=y.a.Sector12IronGym,c=1,f=1;break;case y.a.Sector12PowerhouseGym.toLowerCase():if(t.city!=g.a.Sector12)return e.log(()=>`You cannot workout at '${y.a.Sector12PowerhouseGym}' because you are not in '${g.a.Sector12}'.`),!1;t.location=y.a.Sector12PowerhouseGym,c=20,f=10;break;case y.a.VolhavenMilleniumFitnessGym.toLowerCase():if(t.city!=g.a.Volhaven)return e.log(()=>`You cannot workout at '${y.a.VolhavenMilleniumFitnessGym}' because you are not in '${g.a.Volhaven}'.`),!1;t.location=y.a.VolhavenMilleniumFitnessGym,c=7,f=4;break;default:return e.log(()=>`Invalid gym name: ${i}. gymWorkout() failed`),!1}switch(o.toLowerCase()){case"strength".toLowerCase():case"str".toLowerCase():t.startClass(c,f,G.a.GymStrength);break;case"defense".toLowerCase():case"def".toLowerCase():t.startClass(c,f,G.a.GymDefense);break;case"dexterity".toLowerCase():case"dex".toLowerCase():t.startClass(c,f,G.a.GymDexterity);break;case"agility".toLowerCase():case"agi".toLowerCase():t.startClass(c,f,G.a.GymAgility);break;default:return e.log(()=>`Invalid stat: ${o}.`),!1}return s?(t.startFocusing(),b.b.toWork()):l&&(t.stopFocusing(),b.b.toTerminal()),e.log(()=>`Started training ${o} at ${i}`),!0},travelToCity:e=>function(n){e.helper.checkSingularityAccess();const a=e.helper.city("cityName",n);switch(a){case g.a.Aevum:case g.a.Chongqing:case g.a.Sector12:case g.a.NewTokyo:case g.a.Ishima:case g.a.Volhaven:return t.money"Not enough money to travel."),!1):(t.loseMoney(c.a.TravelCost,"other"),t.city=a,e.log(()=>"Traveled to "+a),t.gainIntelligenceExp(c.a.IntelligenceSingFnBaseExpGain/5e4),!0);default:throw e.helper.makeRuntimeErrorMsg(`Invalid city name: '${a}'.`)}},purchaseTor:e=>function(){if(e.helper.checkSingularityAccess(),t.hasTorRouter())return e.log(()=>"You already have a TOR router!"),!0;if(t.money"You cannot afford to purchase a Tor router."),!1;t.loseMoney(c.a.TorRouterCost,"other");const n=Object(_.d)(E.a.DarkWeb);if(!n)throw e.makeRuntimeErrorMsg("DarkWeb was not a server but should have been");return t.getHomeComputer().serversOnNetwork.push(n.hostname),n.serversOnNetwork.push(t.getHomeComputer().hostname),t.gainIntelligenceExp(c.a.IntelligenceSingFnBaseExpGain/500),e.log(()=>"You have purchased a Tor router!"),!0},purchaseProgram:e=>function(n){e.helper.checkSingularityAccess();const a=e.helper.string("programName",n).toLowerCase();if(!t.hasTorRouter())return e.log(()=>"You do not have the TOR router."),!1;const r=Object.values(p.a).find(t=>t.program.toLowerCase()===a);return null==r?(e.log(()=>`Invalid program name: '${a}.`),!1):t.money`Not enough money to purchase '${r.program}'. Need ${S.a.formatMoney(r.price)}`),!1):t.hasProgram(r.program)?(e.log(()=>`You already have the '${r.program}' program`),!0):(t.getHomeComputer().pushProgram(r.program),t.createProgramName===r.program&&(t.isWorking=!1,t.resetWorkStatus()),t.loseMoney(r.price,"other"),e.log(()=>`You have purchased the '${r.program}' program. The new program can be found on your home computer.`),t.gainIntelligenceExp(c.a.IntelligenceSingFnBaseExpGain/5e3),!0)},getCurrentServer:e=>function(){return e.helper.checkSingularityAccess(),t.getCurrentServer().hostname},connect:e=>function(n){e.helper.checkSingularityAccess();const a=e.helper.string("hostname",n);if(!a)throw e.helper.makeRuntimeErrorMsg(`Invalid hostname: '${a}'`);const r=Object(_.d)(a);if(null==r)throw e.helper.makeRuntimeErrorMsg(`Invalid hostname: '${a}'`);if("home"===a)return t.getCurrentServer().isConnectedTo=!1,t.currentServer=t.getHomeComputer().hostname,t.getCurrentServer().isConnectedTo=!0,R.a.setcwd("/"),!0;const i=t.getCurrentServer();for(let e=0;efunction(){e.helper.checkSingularityAccess();const n=t.getCurrentServer();return e.helper.hack(n.hostname,!0)},installBackdoor:n=>async()=>{n.helper.checkSingularityAccess();const a=t.getCurrentServer();if(!(a instanceof P.a))return n.log(()=>"cannot backdoor this kind of server"),Promise.resolve();const r=a,i=Object(N.d)(r,t)/4*1e3,o=Object(I.b)(r,t);if(!o.res)throw n.helper.makeRuntimeErrorMsg(o.msg||"");return n.log(()=>`Installing backdoor on '${r.hostname}' in ${Object(T.d)(i,!0)}`),Object(M.c)(i,e).then((function(){return n.log(()=>`Successfully installed backdoor on '${r.hostname}'`),r.backdoorInstalled=!0,E.a.WorldDaemon===r.hostname&&b.b.toBitVerse(!1,!1),Promise.resolve()}))},isFocused:e=>function(){return e.helper.checkSingularityAccess(),t.focus},setFocus:e=>function(n){e.helper.checkSingularityAccess();const a=e.helper.boolean(n);if(!t.isWorking)throw e.helper.makeRuntimeErrorMsg("Not currently working");if(t.workType!==G.d.Faction&&t.workType!==G.d.Company&&t.workType!==G.d.CompanyPartTime&&t.workType!==G.d.CreateProgram&&t.workType!==G.d.StudyClass)throw e.helper.makeRuntimeErrorMsg("Cannot change focus for current job");return!t.focus&&a?(t.startFocusing(),b.b.toWork(),!0):!(!t.focus||a)&&(t.stopFocusing(),b.b.toTerminal(),!0)},getStats:e=>function(){return e.helper.checkSingularityAccess(),e.log(()=>"getStats is deprecated, please use getplayer"),{hacking:t.hacking,strength:t.strength,defense:t.defense,dexterity:t.dexterity,agility:t.agility,charisma:t.charisma,intelligence:t.intelligence}},getCharacterInformation:e=>function(){return e.helper.checkSingularityAccess(),e.log(()=>"getCharacterInformation is deprecated, please use getplayer"),{bitnode:t.bitNodeN,city:t.city,factions:t.factions.slice(),hp:t.hp,jobs:Object.keys(t.jobs),jobTitles:Object.values(t.jobs),maxHp:t.max_hp,mult:{agility:t.agility_mult,agilityExp:t.agility_exp_mult,charisma:t.charisma,charismaExp:t.charisma_exp,companyRep:t.company_rep_mult,crimeMoney:t.crime_money_mult,crimeSuccess:t.crime_success_mult,defense:t.defense_mult,defenseExp:t.defense_exp_mult,dexterity:t.dexterity_mult,dexterityExp:t.dexterity_exp_mult,factionRep:t.faction_rep_mult,hacking:t.hacking_mult,hackingExp:t.hacking_exp_mult,strength:t.strength_mult,strengthExp:t.strength_exp_mult,workMoney:t.work_money_mult},timeWorked:t.timeWorked,tor:t.hasTorRouter(),workHackExpGain:t.workHackExpGained,workStrExpGain:t.workStrExpGained,workDefExpGain:t.workDefExpGained,workDexExpGain:t.workDexExpGained,workAgiExpGain:t.workAgiExpGained,workChaExpGain:t.workChaExpGained,workRepGain:t.workRepGained,workMoneyGain:t.workMoneyGained,hackingExp:t.hacking_exp,strengthExp:t.strength_exp,defenseExp:t.defense_exp,dexterityExp:t.dexterity_exp,agilityExp:t.agility_exp,charismaExp:t.charisma_exp}},hospitalize:e=>function(){e.helper.checkSingularityAccess(),t.isWorking||b.b.page()===v.a.Infiltration||b.b.page()===v.a.BitVerse?e.log(()=>"Cannot go to the hospital because the player is busy."):t.hospitalize()},isBusy:e=>function(){return e.helper.checkSingularityAccess(),t.isWorking||b.b.page()===v.a.Infiltration||b.b.page()===v.a.BitVerse},stopAction:e=>function(){if(e.helper.checkSingularityAccess(),t.isWorking){t.focus&&(t.stopFocusing(),b.b.toTerminal());const n=t.singularityStopWork();return e.log(()=>n),!0}return!1},upgradeHomeCores:e=>function(){e.helper.checkSingularityAccess();const n=t.getHomeComputer();if(n.cpuCores>=8)return e.log(()=>"Your home computer is at max cores."),!1;const a=t.getUpgradeHomeCoresCost();return t.money"You don't have enough money. Need "+S.a.formatMoney(a)),!1):(n.cpuCores+=1,t.loseMoney(a,"servers"),t.gainIntelligenceExp(2*c.a.IntelligenceSingFnBaseExpGain),e.log(()=>`Purchased an additional core for home computer! It now has ${n.cpuCores} cores.`),!0)},getUpgradeHomeCoresCost:e=>function(){return e.helper.checkSingularityAccess(),t.getUpgradeHomeCoresCost()},upgradeHomeRam:e=>function(){e.helper.checkSingularityAccess();const n=t.getHomeComputer();if(n.maxRam>=c.a.HomeComputerMaxRam)return e.log(()=>"Your home computer is at max RAM."),!1;const a=t.getUpgradeHomeRamCost();return t.money"You don't have enough money. Need "+S.a.formatMoney(a)),!1):(n.maxRam*=2,t.loseMoney(a,"servers"),t.gainIntelligenceExp(2*c.a.IntelligenceSingFnBaseExpGain),e.log(()=>`Purchased additional RAM for home computer! It now has ${S.a.formatRAM(n.maxRam)} of RAM.`),!0)},getUpgradeHomeRamCost:e=>function(){return e.helper.checkSingularityAccess(),t.getUpgradeHomeRamCost()},workForCompany:e=>function(n,a=!0){e.helper.checkSingularityAccess();let r=e.helper.string("companyName",n);const i=e.helper.boolean(a);if(null==r&&(r=t.companyName),null==r||""===r||!(L.a[r]instanceof C.a))return e.log(()=>`Invalid company: '${r}'`),!1;if(!Object.keys(t.jobs).includes(r))return e.log(()=>`You do not have a job at '${r}'`),!1;const o=t.jobs[r],s=d.a[o];if(""===o||!(s instanceof h.a))return e.log(()=>"You do not have a job"),!1;const l=t.focus;if(t.isWorking){const n=t.singularityStopWork();e.log(()=>n)}return s.isPartTimeJob()?t.startWorkPartTime(r):t.startWork(r),i?(t.startFocusing(),b.b.toWork()):l&&(t.stopFocusing(),b.b.toTerminal()),e.log(()=>`Began working at '${t.companyName}' as a '${o}'`),!0},applyToCompany:e=>function(n,a){e.helper.checkSingularityAccess();const r=e.helper.string("companyName",n),i=e.helper.string("field",a);let o;switch(H(e,r),t.location=r,i.toLowerCase()){case"software":o=t.applyForSoftwareJob(!0);break;case"software consultant":o=t.applyForSoftwareConsultantJob(!0);break;case"it":o=t.applyForItJob(!0);break;case"security engineer":o=t.applyForSecurityEngineerJob(!0);break;case"network engineer":o=t.applyForNetworkEngineerJob(!0);break;case"business":o=t.applyForBusinessJob(!0);break;case"business consultant":o=t.applyForBusinessConsultantJob(!0);break;case"security":o=t.applyForSecurityJob(!0);break;case"agent":o=t.applyForAgentJob(!0);break;case"employee":o=t.applyForEmployeeJob(!0);break;case"part-time employee":o=t.applyForPartTimeEmployeeJob(!0);break;case"waiter":o=t.applyForWaiterJob(!0);break;case"part-time waiter":o=t.applyForPartTimeWaiterJob(!0);break;default:return e.log(()=>`Invalid job: '${i}'.`),!1}return o?e.log(()=>`You were offered a new job at '${r}' as a '${t.jobs[r]}'`):e.log(()=>`You failed to get a new job/promotion at '${r}' in the '${i}' field.`),o},quitJob:e=>function(n){e.helper.checkSingularityAccess();const a=e.helper.string("companyName",n);t.quitJob(a)},getCompanyRep:t=>function(e){t.helper.checkSingularityAccess();const n=t.helper.string("companyName",e);return H(t,n).playerReputation},getCompanyFavor:t=>function(e){t.helper.checkSingularityAccess();const n=t.helper.string("companyName",e);return H(t,n).favor},getCompanyFavorGain:t=>function(e){t.helper.checkSingularityAccess();const n=t.helper.string("companyName",e);return H(t,n).getFavorGain()},checkFactionInvitations:e=>function(){return e.helper.checkSingularityAccess(),t.factionInvitations.slice()},joinFaction:e=>function(n){e.helper.checkSingularityAccess();const r=e.helper.string("facName",n);if(W(e,r),!t.factionInvitations.includes(r))return e.log(()=>`You have not been invited by faction '${r}'`),!1;const i=O.a[r];Object(a.d)(i);for(let e=0;e`Joined the '${r}' faction.`),!0},workForFaction:e=>function(n,a,r=!0){e.helper.checkSingularityAccess();const i=e.helper.string("facName",n),o=e.helper.string("type",a),s=e.helper.boolean(r),l=W(e,i);if(t.inGang()&&l.name===t.getGangFaction().name)return e.log(()=>`You can't work for '${i}' because youre managing a gang for it`),!1;if(!t.factions.includes(i))return e.log(()=>`You are not a member of '${i}'`),!1;const c=t.focus;if(t.isWorking){const n=t.singularityStopWork();e.log(()=>n)}switch(o.toLowerCase()){case"hacking":case"hacking contracts":case"hackingcontracts":return F.a[l.name].offerHackingWork?(t.startFactionHackWork(l),s?(t.startFocusing(),b.b.toWork()):c&&(t.stopFocusing(),b.b.toTerminal()),e.log(()=>`Started carrying out hacking contracts for '${l.name}'`),!0):(e.log(()=>`Faction '${l.name}' do not need help with hacking contracts.`),!1);case"field":case"fieldwork":case"field work":return F.a[l.name].offerFieldWork?(t.startFactionFieldWork(l),s?(t.startFocusing(),b.b.toWork()):c&&(t.stopFocusing(),b.b.toTerminal()),e.log(()=>`Started carrying out field missions for '${l.name}'`),!0):(e.log(()=>`Faction '${l.name}' do not need help with field missions.`),!1);case"security":case"securitywork":case"security work":return F.a[l.name].offerSecurityWork?(t.startFactionSecurityWork(l),s?(t.startFocusing(),b.b.toWork()):c&&(t.stopFocusing(),b.b.toTerminal()),e.log(()=>`Started carrying out security work for '${l.name}'`),!0):(e.log(()=>`Faction '${l.name}' do not need help with security work.`),!1);default:return e.log(()=>"Invalid work type: '"+o),!1}},getFactionRep:t=>function(e){t.helper.checkSingularityAccess();const n=t.helper.string("facName",e);return W(t,n).playerReputation},getFactionFavor:t=>function(e){t.helper.checkSingularityAccess();const n=t.helper.string("facName",e);return W(t,n).favor},getFactionFavorGain:t=>function(e){t.helper.checkSingularityAccess();const n=t.helper.string("facName",e);return W(t,n).getFavorGain()},donateToFaction:e=>function(n,a){e.helper.checkSingularityAccess();const r=e.helper.string("facName",n),i=e.helper.number("amt",a),o=W(e,r);if(!t.factions.includes(o.name))return e.log(()=>`You can't donate to '${r}' because you aren't a member`),!1;if(t.inGang()&&o.name===t.getGangFaction().name)return e.log(()=>`You can't donate to '${r}' because youre managing a gang for it`),!1;if(o.name===B.a.ChurchOfTheMachineGod||o.name===B.a.Bladeburners)return e.log(()=>`You can't donate to '${r}' because they do not accept donations`),!1;if("number"!=typeof i||i<=0||isNaN(i))return e.log(()=>`Invalid donation amount: '${i}'.`),!1;if(t.money`You do not have enough money to donate ${S.a.formatMoney(i)} to '${r}'`),!1;const s=Math.floor(c.a.BaseFavorToDonate*x.a.RepToDonateToFaction);if(o.favor`You do not have enough favor to donate to this faction. Have ${o.favor}, need ${s}`),!1;const l=i/c.a.DonateMoneyToRepDivisor*t.faction_rep_mult;return o.playerReputation+=l,t.loseMoney(i,"other"),e.log(()=>`${S.a.formatMoney(i)} donated to '${r}' for ${S.a.formatReputation(l)} reputation`),!0},createProgram:e=>function(n,a=!0){e.helper.checkSingularityAccess();const r=e.helper.string("programName",n).toLowerCase(),i=e.helper.boolean(a),o=t.focus;if(t.isWorking){const n=t.singularityStopWork();e.log(()=>n)}const s=Object.values(w.a).find(t=>t.name.toLowerCase()===r);if(null==s)return e.log(()=>"The specified program does not exist: '"+r),!1;if(t.hasProgram(s.name))return e.log(()=>`You already have the '${s.name}' program`),!1;const l=s.create;return null===l?(e.log(()=>`You cannot create the '${s.name}' program`),!1):l.req(t)?(t.startCreateProgramWork(s.name,l.time,l.level),i?(t.startFocusing(),b.b.toWork()):o&&(t.stopFocusing(),b.b.toTerminal()),e.log(()=>`Began creating program: '${r}'`),!0):(e.log(()=>`Hacking level is too low to create '${s.name}' (level ${l.level} req)`),!1)},commitCrime:n=>function(a){n.helper.checkSingularityAccess();const r=n.helper.string("crimeRoughName",a);if(t.isWorking){const e=t.singularityStopWork();n.log(()=>e)}t.gotoLocation(y.a.Slums);const i=Object(m.b)(r.toLowerCase());if(null==i)throw n.helper.makeRuntimeErrorMsg(`Invalid crime: '${r}'`);return n.log(()=>`Attempting to commit ${i.name}...`),i.commit(b.b,t,1,e)},getCrimeChance:e=>function(n){e.helper.checkSingularityAccess();const a=e.helper.string("crimeRoughName",n),r=Object(m.b)(a.toLowerCase());if(null==r)throw e.helper.makeRuntimeErrorMsg("Invalid crime: "+a);return r.successRate(t)},getCrimeStats:t=>function(e){t.helper.checkSingularityAccess();const n=t.helper.string("crimeRoughName",e),a=Object(m.b)(n.toLowerCase());if(null==a)throw t.helper.makeRuntimeErrorMsg("Invalid crime: "+n);return Object.assign({},a)},getDarkwebPrograms:e=>function(){return e.helper.checkSingularityAccess(),t.hasTorRouter()?Object.values(p.a).map(t=>t.program):(e.log(()=>"You do not have the TOR router."),[])},getDarkwebProgramCost:e=>function(n){e.helper.checkSingularityAccess();const a=e.helper.string("programName",n).toLowerCase();if(!t.hasTorRouter())return e.log(()=>"You do not have the TOR router."),-1;const r=Object.values(p.a).find(t=>t.program.toLowerCase()===a);if(null==r)throw e.helper.makeRuntimeErrorMsg(`No such exploit ('${a}') found on the darkweb! \nThis function is not case-sensitive. Did you perhaps forget .exe at the end?`);return t.hasProgram(r.program)?(e.log(()=>`You already have the '${r.program}' program`),0):r.price},b1tflum3:e=>(n,a="")=>{e.helper.checkSingularityAccess();const r=e.helper.number("nextBN",n),i=e.helper.string("callbackScript",a);e.helper.checkSingularityAccess(),Object(j.a)(b.b,!0,t.bitNodeN,r),i&&setTimeout(()=>{U(i)},0)},destroyW0r1dD43m0n:e=>(n,a="")=>{e.helper.checkSingularityAccess();const r=e.helper.number("nextBN",n),i=e.helper.string("callbackScript",a);e.helper.checkSingularityAccess();(()=>{const e=Object(_.d)(E.a.WorldDaemon);if(!(e instanceof P.a))throw new Error("WorldDaemon was not a normal server. This is a bug contact dev.");return!(t.hacking{U(i)},0)):e.log(()=>"Requirements not met to destroy the world daemon")}}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(226),r=n(110),i=n(2);function o(t,e,n,o,...s){const l=s.join("."),c=s.pop();if("string"!=typeof c)throw Object(r.b)(n,"Failure occured while wrapping netscript api");const f={makeRuntimeErrorMsg:e=>t.makeRuntimeErrorMsg(l,e),log:t=>{n.log(l,t)},workerScript:n,function:c,helper:{makeRuntimeErrorMsg:e=>t.makeRuntimeErrorMsg(l,e),string:(e,n)=>t.string(l,e,n),number:(e,n)=>t.number(l,e,n),city:(e,n)=>t.city(l,e,n),boolean:t.boolean,getServer:e=>t.getServer(e,f),checkSingularityAccess:()=>t.checkSingularityAccess(c),hack:(e,n,a)=>t.hack(f,e,n,a),getValidPort:e=>t.getValidPort(l,e)}};const u=function(t,...e){let n=t;for(const t of e)void 0===n[t]&&(n[t]={}),n=n[t];return n}(e,...s);Object.defineProperty(u,c,{value:function(...e){return t.updateDynamicRam(f.function,Object(a.c)(i.a,...s,f.function)),o(f)(...e)},writable:!0,enumerable:!0})}function s(t,e,n,a,...r){if("object"!=typeof a)throw new Error("Invalid namespace?");for(const i of Object.getOwnPropertyNames(a))switch(typeof a[i]){case"function":o(t,e,n,a[i],...r,i);break;case"object":s(t,e,n,a[i],...r,i);break;default:l(e,a[i],...r,i)}return e}function l(t,e,...n){let a=t;const r=n.pop();if("string"!=typeof r)throw new Error("Failure occured while wrapping netscript api (setNestedProperty)");for(const t of n)void 0===a[t]&&(a[t]={}),a=a[t];a[r]=e}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(6);function r(){const t=[];return{write:e=>(t.push(e),t.length>a.a.MaxPortCapacity?t.shift():null),tryWrite:e=>!(t.length>=a.a.MaxPortCapacity)&&(t.push(e),!0),read:()=>0===t.length?"NULL PORT DATA":t.shift(),peek:()=>{if(0===t.length)return"NULL PORT DATA";return t.slice()[0]},full:()=>t.length==a.a.MaxPortCapacity,empty:()=>0===t.length,clear:()=>{t.length=0}}}},function(t,e,n){"use strict";function a(t){if("object"!=typeof t||null==t)return;const e=t;for(const t of Object.getOwnPropertyNames(e))e.hasOwnProperty(t)&&delete e[t]}n.d(e,"a",(function(){return a}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(10);const r=(t,e=1)=>{const n={hacking_chance_mult:t.hacking_chance_mult,hacking_speed_mult:t.hacking_speed_mult,hacking_money_mult:t.hacking_money_mult,hacking_grow_mult:t.hacking_grow_mult,hacking_mult:t.hacking_mult,strength_mult:t.strength_mult,defense_mult:t.defense_mult,dexterity_mult:t.dexterity_mult,agility_mult:t.agility_mult,charisma_mult:t.charisma_mult,hacking_exp_mult:t.hacking_exp_mult,strength_exp_mult:t.strength_exp_mult,defense_exp_mult:t.defense_exp_mult,dexterity_exp_mult:t.dexterity_exp_mult,agility_exp_mult:t.agility_exp_mult,charisma_exp_mult:t.charisma_exp_mult,company_rep_mult:t.company_rep_mult,faction_rep_mult:t.faction_rep_mult,crime_money_mult:t.crime_money_mult,crime_success_mult:t.crime_success_mult,hacknet_node_money_mult:t.hacknet_node_money_mult,hacknet_node_purchase_cost_mult:t.hacknet_node_purchase_cost_mult,hacknet_node_ram_cost_mult:t.hacknet_node_ram_cost_mult,hacknet_node_core_cost_mult:t.hacknet_node_core_cost_mult,hacknet_node_level_cost_mult:t.hacknet_node_level_cost_mult,work_money_mult:t.work_money_mult,bladeburner_max_stamina_mult:t.bladeburner_max_stamina_mult,bladeburner_stamina_gain_mult:t.bladeburner_stamina_gain_mult,bladeburner_analysis_mult:t.bladeburner_analysis_mult,bladeburner_success_chance_mult:t.bladeburner_success_chance_mult};for(const[t,r]of Object.entries(n))n[t]=r*a.a.EntropyEffect**e;return n}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(28);const r=["START","PURCHASE","PRODUCTION","SALE","EXPORT"];class i{constructor(){var t,e,n;n=0,(e="state")in(t=this)?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}getState(){return r[this.state]}nextState(){(this.state<0||this.state>=r.length)&&(this.state=0),++this.state,this.state>=r.length&&(this.state=0)}toJSON(){return Object(a.b)("CorporationState",this)}static fromJSON(t){return Object(a.a)(i,t.data)}}a.c.constructors.CorporationState=i},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(15),r=n(162),i=n(64),o=n(4);const s={};!function(){let t,e,n;t="The Beginner's Guide to Hacking",e=i.a.HackersStartingHandbook,n="Some resources:

Learn to Program

For Experienced JavaScript Developers: NetscriptJS

Netscript Documentation

When starting out, hacking is the most profitable way to earn money and progress. This is a brief collection of tips/pointers on how to make the most out of your hacking scripts.

-hack() and grow() both work by percentages. hack() steals a certain percentage of the money on a server, and grow() increases the amount of money on a server by some percentage (multiplicatively)

-Because hack() and grow() work by percentages, they are more effective if the target server has a high amount of money. Therefore, you should try to increase the amount of money on a server (using grow()) to a certain amount before hacking it. Two important Netscript functions for this are getServerMoneyAvailable() and getServerMaxMoney()

-Keep security level low. Security level affects everything when hacking. Two important Netscript functions for this are getServerSecurityLevel() and getServerMinSecurityLevel()

-Purchase additional servers by visiting 'Alpha Enterprises' in the city. They are relatively cheap and give you valuable RAM to run more scripts early in the game

-Prioritize upgrading the RAM on your home computer. This can also be done at 'Alpha Enterprises'

-Many low level servers have free RAM. You can use this RAM to run your scripts. Use the scp Terminal or Netscript command to copy your scripts onto these servers and then run them.",s[e]=new r.a(t,e,n),t="The Complete Handbook for Creating a Successful Corporation",e=i.a.CorporationManagementHandbook,n="Getting Started with Corporations
To get started, visit the City Hall in Sector-12 in order to create a Corporation. This requires $150b of your own money, but this $150b will get put into your Corporation's funds. Your Corporation can have many different divisions, each in a different Industry. There are many different types of Industries, each with different properties. To create your first division, click the 'Expand into new Industry' button at the top of the management UI. The Agriculture and Software industries are recommended for your first division.

The first thing you'll need to do is hire some employees. Employees can be assigned to five different positions. Each position has a different effect on various aspects of your Corporation. It is recommended to have at least one employee at each position.

Each industry uses some combination of Materials in order to produce other Materials and/or create Products. Specific information about this is displayed in each of your divisions' UI.

Products are special, industry-specific objects. They are different than Materials because you must manually choose to develop them, and you can choose to develop any number of Products. Developing a Product takes time, but a Product typically generates significantly more revenue than any Material. Not all industries allow you to create Products. To create a Product, look for a button in the top-left panel of the division UI (e.g. For the Software Industry, the button says 'Develop Software').

To get your supply chain system started, purchase the Materials that your industry needs to produce other Materials/Products. This can be done by clicking the 'Buy' button next to the corresponding Material(s). After you have the required Materials, you will immediately start production. The amount of Materials/Products you produce is based on a variety of factors, one of which is your employees and their productivity.

Once you start producing Materials/Products, you can sell them in order to start earning revenue. This can be done by clicking the 'Sell' button next to the corresponding Material or Product. The amount of Material/Product you sell is dependent on a wide variety of different factors.

These are the basics of getting your Corporation up and running! Now, you can start purchasing upgrades to improve your bottom line. If you need money, consider looking for seed investors, who will give you money in exchange for stock shares. Otherwise, once you feel you are ready, take your Corporation public! Once your Corporation goes public, you can no longer find investors. Instead, your Corporation will be publicly traded and its stock price will change based on how well it's performing financially. You can then sell your stock shares in order to make money.

Tips/Pointers
-The 'Smart Supply' upgrade is extremely useful. Consider purchasing it as soon as possible.

-Purchasing Hardware, Robots, AI Cores, and Real Estate can potentially increase your production. The effects of these depend on what industry you are in.

-In order to optimize your production, you will need a good balance of Operators, Managers, and Engineers

-Different employees excel in different jobs. For example, the highly intelligent employees will probably do best if they are assigned to do Engineering work or Research & Development.

-If your employees have low morale, energy, or happiness, their production will greatly suffer.

-Tech is important, but don't neglect sales! Having several Businessmen can boost your sales and your bottom line.

-Don't forget to advertise your company. You won't have any business if nobody knows you.

-Having company awareness is great, but what's really important is your company's popularity. Try to keep your popularity as high as possible to see the biggest benefit for your sales

-Remember, you need to spend money to make money!

-Corporations do not reset when installing Augmentations, but they do reset when destroying a BitNode",s[e]=new r.a(t,e,n),t="A Brief History of Synthoids",e=i.a.HistoryOfSynthoids,n=`Synthetic androids, or Synthoids for short, are genetically engineered robots and, short of Augmentations, are composed entirely of organic substances. For this reason, Synthoids are virtually identical to humans in form, composition, and appearance.

Synthoids were first designed and manufactured by ${o.a.OmniTekIncorporated} sometime around the middle of the century. Their original purpose was to be used for manual labor and as emergency responders for disasters. As such, they were initially programmed only for their specific tasks. Each iteration that followed improved upon the intelligence and capabilities of the Synthoids. By the 6th iteration, called MK-VI, the Synthoids were so smart and capable enough of making their own decisions that many argued ${o.a.OmniTekIncorporated} had created the first sentient AI. These MK-VI Synthoids were produced in mass quantities (estimates up to 50 billion) with the hopes of increasing society's productivity and bolstering the global economy. Stemming from humanity's desire for technological advancement, optimism and excitement about the future had never been higher.

All of that excitement and optimism quickly turned to fear, panic, and dread in 2070, when a terrorist group called Ascendis Totalis hacked into ${o.a.OmniTekIncorporated} and uploaded a rogue AI into severeal of their Synthoid manufacturing facilities. This hack went undetected and for months ${o.a.OmniTekIncorporated} unknowingly churned out legions of Synthoids embedded with this rogue AI. Then, on December 24th, 2070, Omnica activated dormant protocols in the rogue AI, causing all of the infected Synthoids to immediately launch a military campaign to seek and destroy all of humanity.

What ensued was the deadlist conflict in human history. This crisis, now commonly known as the Synthoid Uprising, resulted in almost ten billion deaths over the course of a year. Despite the nations of the world banding together to combat the threat, the MK-VI Synthoids were simply stronger, faster, more intelligent, and more adaptable than humans, outsmarting them at every turn.

It wasn't until the sacrifice of an elite international military taskforce, called the ${o.a.Bladeburners}, that humanity was finally able to defeat the Synthoids. The ${o.a.Bladeburners}' final act was a suicide bombing mission that destroyed a large portion of the MK-VI Synthoids, including many of its leaders. In the following weeks militaries from around the world were able to round up and shut down the remaining rogue MK-VI Synthoids, ending the Synthoid Uprising.

In the aftermath of the bloodshed, the Synthoid Accords were drawn up. These Accords banned ${o.a.OmniTekIncorporated} from manufacturing any Synthoids beyond the MK-III series. They also banned any other corporation from constructing androids with advanced, near-sentient AI. MK-VI Synthoids that did not have the rogue Ascendis Totalis AI were allowed to continue their existence, but they were stripped of all rights and protections as they were not considered humans. They were also banned from doing anything that may pose a global security threat, such as working for any military/defense organization or conducting any bioengineering, computing, or robotics related research.

Unfortunately, many believe that not all of the rogue MK-VI Synthoids from the Uprising were found and destroyed, and that many of them are blending in as normal humans in society today. In response, many nations have created `+o.a.Bladeburners+" divisions, special military branches that are tasked with investigating and dealing with any Synthoid threats.

To this day, tensions still exist between the remaining Synthoids and humans as a result of the Uprising.

Nobody knows what happened to the terrorist group Ascendis Totalis.",s[e]=new r.a(t,e,n),t="A Green Tomorrow",e=i.a.AGreenTomorrow,n="Starting a few decades ago, there was a massive global movement towards the generation of renewable energy in an effort to combat global warming and climate change. The shift towards renewable energy was a big success, or so it seemed. In 2045 a staggering 80% of the world's energy came from non-renewable fossil fuels. Now, about three decades later, that number is down to only 15%. Most of the world's energy now comes from nuclear power and renewable sources such as solar and geothermal energy. Unfortunately, these efforts were not the huge success that they seem to be.

Since 2045 primary energy use has soared almost tenfold. This was mainly due to growing urban populations and the rise of increasingly advanced (and power-hungry) technology that has become ubiquitous in our lives. So, despite the fact that the percentage of our energy that comes from fossil fuels has drastically decreased, the total amount of energy we are producing from fossil fuels has actually increased.

The grim effects of our species' irresponsible use of energy and neglect of our mother world have become increasingly apparent. Last year a temperature of 190F was recorded in the Death Valley desert, which is over 50% higher than the highest recorded temperature at the beginning of the century. In the last two decades numerous major cities such as Manhattan, Boston, and Los Angeles have been partially or fully submerged by rising sea levels. In the present day, over 75% of the world's agriculture is done in climate-controlled vertical farms, as most traditional farmland has become unusable due to severe climate conditions.

Despite all of this, the greedy and corrupt corporations that rule the world have done nothing to address these problems that threaten our species. And so it's up to us, the common people. Each and every one of us can make a difference by doing what these corporations won't: taking responsibility. If we don't, pretty soon there won't be an Earth left to save. We are the last hope for a green tomorrow.",s[e]=new r.a(t,e,n),t="Alpha and Omega",e=i.a.AlphaOmega,n="Then we saw a new Heaven and a new Earth, for our first Heaven and Earth had gone away, and our sea was no more. And we saw a new holy city, new Aeria, coming down out of this new Heaven, prepared as a bride adorned for her husband. And we heard a loud voice saying, 'Behold, the new dwelling place of the Gods. We will dwell with them, and they will be our people, and we will be with them as their Gods. We will wipe away every tear from their eyes, and death shall be no more, neither shall there be mourning, nor crying, nor pain anymore, for the former things have passed away.'

And once we were seated on the throne we said 'Behold, I am making all things new.' Also we said, 'Write this down, for these words are trustworthy and true.' And we said to you, 'It is done! I am the Alpha and the Omega, the beginning and the end. To the thirsty I will give from the spring of the water of life without payment. The one who conquers will have this heritage, and we will be his God and he will be our son. But as for the cowardly, the faithless, the detestable, as for murderers, the sexually immoral, sorcerers, idolaters, and all liars, their portion will be in the lake that burns with fire and sulfur, for it is the second true death.'",s[e]=new r.a(t,e,n),t="Are We Living in a Computer Simulation?",e=i.a.SimulatedReality,n="The idea that we are living in a virtual world is not new. It's a trope that has been explored constantly in literature and pop culture. However, it is also a legitimate scientific hypothesis that many notable physicists and philosophers have debated for years.

Proponents for this simulated reality theory often point to how advanced our technology has become, as well as the incredibly fast pace at which it has advanced over the past decades. The amount of computing power available to us has increased over 100-fold since 2060 due to the development of nanoprocessors and quantum computers. Artifical Intelligence has advanced to the point where our entire lives are controlled by robots and machines that handle our day-to-day activities such as autonomous transportation and scheduling. If we consider the pace at which this technology has advanced and assume that these developments continue, it's reasonable to assume that at some point in the future our technology would be advanced enough that we could create simulations that are indistinguishable from reality. However, if continued technological advancement is a reasonable outcome, then it is very likely that such a scenario has already happened.

Statistically speaking, somewhere out there in the infinite universe there is an advanced, intelligent species that already has such technology. Who's to say that they haven't already created such a virtual reality: our own?",s[e]=new r.a(t,e,n),t="Beyond Man",e=i.a.BeyondMan,n="Humanity entered a 'transhuman' era a long time ago. And despite the protests and criticisms of many who cried out against human augmentation at the time, the transhuman movement continued and prospered. Proponents of the movement ignored the critics, arguing that it was in our inherent nature to better ourselves. To improve. To be more than we were. They claimed that not doing so would be to go against every living organism's biological purpose: evolution and survival of the fittest.

And here we are today, with technology that is advanced enough to augment humans to a state that can only be described as posthuman. But what do we have to show for it when this augmentation technology is only available to the so-called 'elite'? Are we really better off than before when only 5% of the world's population has access to this technology? When the powerful corporations and organizations of the world keep it all to themselves, have we really evolved?

Augmentation technology has only further increased the divide between the rich and the poor, between the powerful and the oppressed. We have not become 'more than human'. We have not evolved from nature's original design. We are still the greedy, corrupted, and evil men that we always were.",s[e]=new r.a(t,e,n),t="Brighter than the Sun",e=i.a.BrighterThanTheSun,n=`When people think about the corporations that dominate the East, they typically think of ${o.a.KuaiGongInternational}, which holds a complete monopoly for manufacturing and commerce in Asia, or Global Pharmaceuticals, the world's largest drug company, or ${o.a.OmniTekIncorporated}, the global leader in intelligent and autonomous robots. But there's one company that has seen a rapid rise in the last year and is poised to dominate not only the East, but the entire world: TaiYang Digital.

TaiYang Digital is a Chinese internet-technology corporation that provides services such as online advertising, search engines, gaming, media, entertainment, and cloud computing/storage. Its name TaiYang comes from the Chinese word for 'sun'. In Chinese culture, the sun is a 'yang' symbol associated with life, heat, masculinity, and heaven.

The company was founded less than 5 years ago and is already the third highest valued company in all of Asia. In 2076 it generated a total revenue of over 10 trillion yuan. It's services are used daily by over a billion people worldwide.

TaiYang Digital's meteoric rise is extremely surprising in modern society. This sort of growth is something you'd commonly see in the first half of the century, especially for tech companies. However in the last two decades the number of corporations has significantly declined as the largest entities quickly took over the economy. Corporations such as ${o.a.ECorp}, ${o.a.MegaCorp}, and ${o.a.KuaiGongInternational} have established such strong monopolies in their market sectors that they have effectively killed off all of the smaller and new corporations that have tried to start up over the years. This is what makes the rise of TaiYang Digital so impressive. And if TaiYang continues down this path, then they have a bright future ahead of them.`,s[e]=new r.a(t,e,n),t="Democracy is Dead: The Fall of an Empire",e=i.a.DemocracyIsDead,n="They rose from the shadows in the street.
From the places where the oppressed meet.
Their cries echoed loudly through the air.
As they once did in Tiananmen Square.
Loudness in the silence, Darkness in the light.
They came forth with power and might.
Once the beacon of democracy, America was first.
Its pillars of society destroyed and dispersed.
Soon the cries rose everywhere, with revolt and riot.
Until one day, finally, all was quiet.
From the ashes rose a new order, corporatocracy was its name.
Rome, Mongol, Byzantine, all of history is just the same.
For man will never change in a fundamental way.
And now democracy is dead, in the USA.",s[e]=new r.a(t,e,n),t="Figures Show Rising Crime Rates in "+a.a.Sector12,e=i.a.Sector12Crime,n=`A recent study by analytics company Wilson Inc. shows a significant rise in criminal activity in ${a.a.Sector12}. Perhaps the most alarming part of the statistic is that most of the rise is in violent crime such as homicide and assault. According to the study, the city saw a total of 21,406 reported homicides in 2076, which is over a 20% increase compared to 2075.

CIA director David Glarow says its too early to know whether these figures indicate the beginning of a sustained increase in crime rates, or whether the year was just an unfortunate outlier. He states that many intelligence and law enforcement agents have noticed an increase in organized crime activites, and believes that these figures may be the result of an uprising from criminal organizations such as ${o.a.TheSyndicate} or the ${o.a.SlumSnakes}.`,s[e]=new r.a(t,e,n),t="Man and the Machine",e=i.a.ManAndMachine,n="In 2005 Ray Kurzweil popularized his theory of the Singularity. He predicted that the rate of technological advancement would continue to accelerate faster and faster until one day machines would be become infinitely more intelligent than humans. This point, called the Singularity, would result in a drastic transformation of the world as we know it. He predicted that the Singularity would arrive by 2045. And yet here we are, more than three decades later, where most would agree that we have not yet reached a point where computers and machines are vastly more intelligent than we are. So what gives?

The answer is that we have reached the Singularity, just not in the way we expected. The artifical superintelligence that was predicted by Kurzweil and others exists in the world today - in the form of Augmentations. Yes, those Augmentations that the rich and powerful keep to themselves enable humans to become superintelligent beings. The Singularity did not lead to a world where our machines are infinitely more intelligent than us, it led to a world where man and machine can merge to become something greater. Most of the world just doesn't know it yet.",s[e]=new r.a(t,e,n),t="Secret Societies",e=i.a.SecretSocieties,n=`The idea of secret societies has long intrigued the general public by inspiring curiosity, fascination, and distrust. People have long wondered about who these secret society members are and what they do, with the most radical of conspiracy theorists claiming that they control everything in the entire world. And while the world may never know for sure, it is likely that many secret societies do actually exist, even today.

However, the secret societies of the modern world are nothing like those that (supposedly) existed decades and centuries ago. The Freemasons, Knights Templar, and ${o.a.Illuminati}, while they may have been around at the turn of the 21st century, almost assuredly do not exist today. The dominance of the Web in our everyday lives and the fact that so much of the world is now digital has given rise to a new breed of secret societies: Internet-based ones.

Commonly called 'hacker groups', Internet-based secret societies have become well-known in today's world. Some of these, such as ${o.a.TheBlackHand}, are black hat groups that claim they are trying to help the oppressed by attacking the elite and powerful. Others, such as ${o.a.NiteSec}, are hacktivist groups that try to push political and social agendas. Perhaps the most intriguing hacker group is the mysterious ${o.a.BitRunners}, whose purpose still remains unknown.`,s[e]=new r.a(t,e,n),t="Space: The Failed Frontier",e=i.a.TheFailedFrontier,n="Humans have long dreamed about spaceflight. With enduring interest, we were driven to explore the unknown and discover new worlds. We dreamed about conquering the stars. And in our quest, we pushed the boundaries of our scientific limits, and then pushed further. Space exploration lead to the development of many important technologies and new industries.

But sometime in the middle of the 21st century, all of that changed. Humanity lost its ambitions and aspirations of exploring the cosmos. The once-large funding for agencies like NASA and the European Space Agency gradually whittled away until their eventual disbanding in the 2060's. Not even militaries are fielding flights into space nowadays. The only remnants of the once great mission for cosmic conquest are the countless satellites in near-earth orbit, used for communications, espionage, and other corporate interests.

And as we continue to look at the state of space technology, it becomes more and more apparent that we will never return to that golden age of space exploration, that age where everyone dreamed of going beyond earth for the sake of discovery.",s[e]=new r.a(t,e,n),t="Coded Intelligence: Myth or Reality?",e=i.a.CodedIntelligence,n=`Tremendous progress has been made in the field of Artificial Intelligence over the past few decades. Our autonomous vehicles and transportation systems. The electronic personal assistants that control our everyday lives. Medical, service, and manufacturing robots. All of these are examples of how far AI has come and how much it has improved our daily lives. However, the question still remains of whether AI will ever be advanced enough to re-create human intelligence.

We've certainly come close to artificial intelligence that is similar to humans. For example ${o.a.OmniTekIncorporated}'s CompanionBot, a robot meant to act as a comforting friend for lonely and grieving people, is eerily human-like in its appearance, speech, mannerisms, and even movement. However its artificial intelligence isn't the same as that of humans. Not yet. It doesn't have sentience or self-awareness or consciousness.

Many neuroscientists believe that we won't ever reach the point of creating artificial human intelligence. 'At the end of the the day, AI comes down to 1's and 0's, while the human brain does not. We'll never see AI that is identical to that of humans.'`,s[e]=new r.a(t,e,n),t="Synthetic Muscles",e=i.a.SyntheticMuscles,n="Initial versions of synthetic muscles weren't made of anything organic but were actually crude devices made to mimic human muscle function. Some of the early iterations were actually made of common materials such as fishing lines and sewing threads due to their high strength for a cheap cost.

As technology progressed, however, advances in biomedical engineering paved the way for a new method of creating synthetic muscles. Instead of creating something that closely imitated the functionality of human muscle, scientists discovered a way of forcing the human body itself to augment its own muscle tissue using both synthetic and organic materials. This is typically done using gene therapy or chemical injections.",s[e]=new r.a(t,e,n),t="Tensions rise in global tech race",e=i.a.TensionsInTechRace,n=`Have we entered a new Cold War? Is WWIII just beyond the horizon?

After rumors came out that ${o.a.OmniTekIncorporated} had begun developing advanced robotic supersoldiers, geopolitical tensions quickly flared between the USA, Russia, and several Asian superpowers. In a rare show of cooperation between corporations, ${o.a.MegaCorp} and ${o.a.ECorp} have reportedly launched hundreds of new surveillance and espionage satellites. Defense contractors such as DeltaOne and AeroCorp have been working with the CIA and NSA to prepare for conflict. Meanwhile, the rest of the world sits in earnest hoping that it never reaches full-scale war. With today's technology and firepower, a World War would assuredly mean the end of human civilization.`,s[e]=new r.a(t,e,n),t="The Cost of Immortality",e=i.a.CostOfImmortality,n="Evolution and advances in medical and augmentation technology has lead to drastic improvements in human mortality rates. Recent figures show that the life expectancy for humans that live in a first-world country is about 130 years of age, almost double of what it was at the turn of the century. However, this increase in average lifespan has had some significant effects on society and culture.

Due to longer lifespans and a better quality of life, many adults are holding off on having kids until much later. As a result, the percentage of youth in first-world countries has been decreasing, while the number of senior citizens is significantly increasing.

Perhaps the most alarming result of all of this is the rapidly shrinking workforce. Despite the increase in life expectancy, the typical retirement age for workers in America has remained about the same, meaning a larger and larger percentage of people in America are retirees. Furthermore, many young adults are holding off on joining the workforce because they feel that they have plenty of time left in their lives for employment, and want to 'enjoy life while they're young.' For most industries, this shrinking workforce is not a major issue as most things are handled by robots anyways. However, there are still several key industries such as engineering and education that have not been automated, and these remain in danger to this cultural phenomenon.",s[e]=new r.a(t,e,n),t="The Hidden World",e=i.a.TheHiddenWorld,n=`WAKE UP SHEEPLE

THE GOVERNMENT DOES NOT EXIST. CORPORATIONS DO NOT RUN SOCIETY

THE ${o.a.Illuminati.toUpperCase()} ARE THE SECRET RULERS OF THE WORLD!

Yes, the ${o.a.Illuminati} of legends. The ancient secret society that controls the entire world from the shadows with their invisible hand. The group of the rich and wealthy that have penetrated every major government, financial agency, and corporation in the last three hundred years.

OPEN YOUR EYES

It was the ${o.a.Illuminati} that brought an end to democracy in the world. They are the driving force behind everything that happens.

THEY ARE ALL AROUND YOU

After destabilizing the world's governments, they are now entering the final stage of their master plan. They will secretly initiate global crises. Terrorism. Pandemics. World War. And out of the chaos that ensues they will build their New World Order.`,s[e]=new r.a(t,e,n),t="The New God",e=i.a.TheNewGod,n="Everyone has a moment in their life when they wonder about the bigger questions.

What's the point of all this? What is my purpose?

Some people dare to think even bigger.

What will the fate of the human race be?

We live in an era vastly different from that of 15 or even 20 years ago. We have gone beyond the limits of humanity. We have stripped ourselves of the tyranny of flesh.

The Singularity is here. The merging of man and machine. This is where humanity evolves into something greater. This is our future.

Embrace it, and you will obey a new god. The God in the Machine.",s[e]=new r.a(t,e,n),t="The New Triads",e=i.a.NewTriads,n=`The Triads were an ancient transnational crime syndicate based in China, Hong Kong, and other Asian territories. They were often considered one of the first and biggest criminal secret societies. While most of the branches of the Triads have been destroyed over the past few decades, the crime faction has spawned and inspired a number of other Asian crime organizations over the past few years. The most notable of these is the ${o.a.Tetrads}.

It is widely believed that the ${o.a.Tetrads} are a rogue group that splintered off from the Triads sometime in the mid 21st century. The founders of the ${o.a.Tetrads}, all of whom were ex-Triad members, believed that the Triads were losing their purpose and direction. The ${o.a.Tetrads} started off as a small group that mainly engaged in fraud and extortion. They were largely unknown until just a few years ago when they took over the illegal drug trade in all of the major Asian cities. They quickly became the most powerful crime syndicate in the continent.

Not much else is known about the ${o.a.Tetrads}, or about the efforts the Asian governments and corporations are making to take down this large new crime organization. Many believe that the ${o.a.Tetrads} have infiltrated the governments and powerful corporations in Asia, which has helped faciliate their recent rapid rise.`,s[e]=new r.a(t,e,n),t="The Secret War",e=i.a.TheSecretWar,n="",s[e]=new r.a(t,e,n)}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(160);function r(t,e,n,r,i){0!==i.length?1===i.length&&Object(a.e)(i[0]+"")?t.print("Set alias "+i[0]):2===i.length&&"-g"===i[0]&&Object(a.e)(i[1]+"",!0)?t.print("Set global alias "+i[1]):t.error('Incorrect usage of alias command. Usage: alias [-g] [aliasname="value"]'):Object(a.f)()}},function(t,e,n){"use strict";function a(t,e,n,a,r){0===r.length?t.startAnalyze(n):t.error("Incorrect usage of analyze command. Usage: analyze")}n.d(e,"a",(function(){return a}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(46),r=n(92);function i(t,e,n,i,o){if(0!==o.length)return void t.error("Incorrect usage of backdoor command. Usage: backdoor");i instanceof a.a||t.error("Can only backdoor normal servers");const s=i;s.purchasedByPlayer?t.error("Cannot use backdoor on your own machines! You are currently connected to your home PC or one of your purchased servers"):s.hasAdminRights?s.requiredHackingSkill>n.hacking?t.error("Your hacking skill is not high enough to use backdoor on this machine. Try analyzing the machine to determine the required hacking skill"):s instanceof r.a?t.error("Cannot use backdoor on this type of Server"):t.startBackdoor(n):t.error("You do not have admin rights for this machine! Cannot backdoor")}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(480);function r(t,e,n,r,i){if(!n.hasTorRouter())return void t.error("You need to be able to connect to the Dark Web to use the buy command. (Maybe there's a TOR router you can buy somewhere)");if(1!=i.length)return t.print("Incorrect number of arguments. Usage: "),t.print("buy -l"),t.print("buy -a"),void t.print("buy [item name]");const o=i[0]+"";"-l"==o||"-1"==o||"--list"==o?Object(a.d)():"-a"==o||"--all"==o?Object(a.a)():Object(a.b)(o)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(343),r=n(474),i=n(14),o=n(370);function s(t,e,n,s,l){if(1!==l.length)return void t.error("Incorrect usage of cat command. Usage: cat [file]");const c=l[0]+"",f=t.getFilepath(c);if(f.endsWith(".msg")||f.endsWith(".lit")||f.endsWith(".txt")||f.endsWith(".script")||f.endsWith(".js")||f.endsWith(".ns")){if(f.endsWith(".msg")||f.endsWith(".lit"))for(let t=0;t
${e.code}`)}t.error("No such file "+f)}else t.error("Only .msg, .txt, .lit, .script, .js, and .ns files are viewable with cat (filename must end with .msg, .txt, .lit, .script, .js, or .ns)")}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(83),r=n(642);function i(t,e,n,i,o){if(o.length>1)t.error("Incorrect number of arguments. Usage: cd [dir]");else{let e=1===o.length?o[0]+"":"/",i="";if("/"===e)i="/";else{if(e=Object(a.l)(e),i=Object(a.c)(e,t.cwd()),null===i||""===i)return void t.error("Invalid path. Failed to change directories");if(t.cwd().length>1&&".."===e)return void t.setcwd(i);const o=n.getCurrentServer();if(!Object(r.a)(o,i))return void t.error("Invalid path. Failed to change directories")}t.setcwd(i)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(236),r=n(100);function i(t,e,n,i,o){if(o.length<1)t.error("Incorrect number of arguments. Usage: check [script] [arg1] [arg2]...");else{const e=t.getFilepath(o[0]+"");if(!Object(r.a)(e))return void t.error(`'check' can only be called on scripts files (filename must end with ${r.b.join(", ")})`);const n=Object(a.a)(e,o.slice(1),i);if(null==n)return void t.error(`No script named ${e} is running on the server`);n.displayLog()}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var a=n(137),r=n(24),i=n(46);function o(t,e,n,o,s){if(1!==s.length)return void t.error("Incorrect usage of connect command. Usage: connect [hostname]");const l=s[0]+"";for(let e=0;en.hacking?t.error("Your hacking skill is not high enough to attempt hacking this machine. Try analyzing the machine to determine the required hacking skill"):t.startGrow(n):t.error("You do not have admin rights for this machine! Cannot grow")}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(46);function r(t,e,n,r,i){if(0!==i.length)return void t.error("Incorrect usage of hack command. Usage: hack");r instanceof a.a||t.error("Cannot hack your own machines! You are currently connected to your home PC or one of your purchased servers");const o=r;o.purchasedByPlayer?t.error("Cannot hack your own machines! You are currently connected to your home PC or one of your purchased servers"):o.hasAdminRights?o.requiredHackingSkill>n.hacking?t.error("Your hacking skill is not high enough to attempt hacking this machine. Try analyzing the machine to determine the required hacking skill"):t.startHack(n):t.error("You do not have admin rights for this machine! Cannot hack")}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(538);function r(t,e,n,r,i){if(0===i.length||1===i.length)if(0===i.length)a.b.forEach(e=>t.print(e));else{const e=i[0]+"",n=a.a[e];if(null==n)return void t.error("No help topics match '"+e+"'");n.forEach(e=>t.print(e))}else t.error("Incorrect usage of help command. Usage: help")}},function(t,e,n){"use strict";function a(t,e,n,a,r){if(0===r.length)return void t.commandHistory.forEach((e,n)=>{t.print(`${n.toString().padStart(2)} ${e}`)});const i=r[0]+"";"-c"===i||"--clear"===i?(n.terminalCommandHistory=[],t.commandHistory=[],t.commandHistoryIndex=1):t.error("Incorrect usage of history command. usage: history [-c]")}n.d(e,"a",(function(){return a}))},function(t,e,n){"use strict";function a(t,e,n,a,r){0===r.length?(n.getCurrentServer().isConnectedTo=!1,n.currentServer=n.getHomeComputer().hostname,n.getCurrentServer().isConnectedTo=!0,t.print("Connected to home"),t.setcwd("/")):t.error("Incorrect usage of home command. Usage: home")}n.d(e,"a",(function(){return a}))},function(t,e,n){"use strict";function a(t,e,n,a,r){0===r.length?t.print(n.getCurrentServer().hostname):t.error("Incorrect usage of hostname command. Usage: hostname")}n.d(e,"a",(function(){return a}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(142);function r(t,e,n,r,i){try{if(i.length<1)return void t.error("Incorrect usage of kill command. Usage: kill [scriptname] [arg1] [arg2]...");if("boolean"==typeof i[0])return;if("number"==typeof i[0]){const e=i[0];return void(Object(a.a)(e)?t.print("Killing script with PID "+e):t.error(`Failed to kill script with PID ${e}. No such script is running`))}const e=t.getFilepath(i[0]),n=r.getRunningScript(e,i.slice(1));if(null==n)return void t.error("No such script is running. Nothing to kill");Object(a.a)(n,r.hostname,!1),t.print("Killing "+e)}catch(e){t.error(e+"")}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(142),r=n(297);function i(t,e,n,i){for(let t=i.runningScripts.length-1;t>=0;--t)Object(a.a)(i.runningScripts[t],i.hostname,!1);r.a.emit(),t.print("Killing all running scripts")}},function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var a=n(144),r=n(121),i=n(115),o=n(0),s=n.n(o),l=n(83),c=n(318),f=n(474),u=n(343);function m(t,e,n,o,m){let h;try{h=c({"-l":Boolean,"--grep":String,"-g":"--grep"},{argv:m})}catch(t){return void p()}const d=h["--grep"];function p(){t.error("Incorrect usage of ls command. Usage: ls [dir] [-l] [-g, --grep pattern]")}if(m.length>4)return p();let g=t.cwd();g.endsWith("/")||(g+="/");const y=m[0]&&"string"==typeof m[0]&&!m[0].startsWith("-")?m[0]:"",b=Object(l.c)(y+"",t.cwd());if(g=b||"",g.endsWith("/")||(g+="/"),!Object(l.i)(g))return p();"/"===g&&(g="");const E=[],v=[],k=[],_=[],w=[],S=[];function x(t,e){let n=t;if(g){if(!t.startsWith(g))return;n=t.slice(g.length,t.length)}if(!d||n.includes(d))if(n.includes("/")){const t=Object(l.g)(n);if(d&&!t.includes(d))return;S.includes(t)||S.push(t)}else e.push(n)}const C=n.getCurrentServer();for(const t of C.programs)x(t,E);for(const t of C.scripts)x(t.filename,v);for(const t of C.textFiles)x(t.fn,k);for(const t of C.contracts)x(t.fn,_);for(const t of C.messages)x(t,w);function L({row:o,prefix:l,hostname:c}){const f=Object(r.a)(t=>Object(a.a)({scriptLinksWrap:{display:"inline-flex",color:t.palette.warning.main},scriptLink:{cursor:"pointer",textDecorationLine:"underline",paddingRight:"1.15em","&:last-child":{padding:0}}}))();let u=o.split("~").map(t=>[t.trim(),t.replace(t.trim(),"")]);return u=u.filter(t=>!!t[0]),s.a.createElement("span",{className:f.scriptLinksWrap},u.map(a=>s.a.createElement("span",{key:"script_"+a[0]},s.a.createElement("span",{className:f.scriptLink,onClick:()=>function(a){var r;if(n.getCurrentServer().hostname!==c)return t.error(`File is not on this server, connect to ${c} and try again`);a.startsWith("/")&&(a=a.slice(1));const o=t.getFilepath(`${l}${a}`),s=Object(i.toString)(null===(r=t.getScript(n,o))||void 0===r?void 0:r.code);e.toScriptEditor({[o]:s})}(a[0])},a[0]),s.a.createElement("span",null,a[1]))))}function O({row:e,prefix:i,hostname:o}){const l=Object(r.a)(t=>Object(a.a)({linksWrap:{display:"inline-flex",color:t.palette.primary.main},link:{cursor:"pointer",textDecorationLine:"underline",paddingRight:"1.15em","&:last-child":{padding:0}}}))();let c=e.split("~").map(t=>[t.trim(),t.replace(t.trim(),"")]);return c=c.filter(t=>!!t[0]),s.a.createElement("span",{className:l.linksWrap},c.map(e=>s.a.createElement("span",{key:"text_"+e[0]},s.a.createElement("span",{className:l.link,onClick:()=>function(e){if(n.getCurrentServer().hostname!==o)return t.error(`File is not on this server, connect to ${o} and try again`);e.startsWith("/")&&(e=e.slice(1));const a=t.getFilepath(`${i}${e}`);a.endsWith(".lit")?Object(f.a)(a):a.endsWith(".msg")&&Object(u.c)(a)}(e[0])},e[0]),s.a.createElement("span",null,e[1]))))}let M;function T(e,n){const a=e.segments,r=e.type===M.Script||e.type===M.Message,i=Math.max(...a.map(t=>t.length))+1,l=!0===n["-l"]?1:Math.ceil(80/i);for(let n=0;nt.segments.length>0);for(const t of A)T(t,h)}},function(t,e,n){"use strict";function a(t,e,n){t.print(n.getCurrentServer().cpuCores+" Core(s)")}n.d(e,"a",(function(){return a}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(5),r=n(6);function i(t,e,n,i,o){try{var s,l;if(1!==o.length&&3!==o.length)return void t.error("Incorrect usage of mem command. usage: mem [scriptname] [-t] [number threads]");const e=o[0]+"";let i=1;if(3===o.length&&"-t"===o[1]&&(i=Math.round(parseInt(o[2]+"")),isNaN(i)||i<1))return void t.error("Invalid number of threads specified. Number of threads must be greater than 1");const c=t.getScript(n,e);if(null==c)return void t.error("mem failed. No such script exists!");const f=c.ramUsage*i;t.print(`This script requires ${a.a.formatRAM(f)} of RAM to run for ${i} thread(s)`);const u=null!==(s=null===(l=c.ramUsageEntries)||void 0===l?void 0:l.sort((t,e)=>e.cost-t.cost))&&void 0!==s?s:[],m=r.a.UseIEC60027_2?9:8;for(const e of u)t.print(`${a.a.formatRAM(e.cost*i).padStart(m)} | ${e.name} (${e.type})`);f>0&&0===u.length&&t.warn("You might have to open & save this script to see the detailed RAM usage information.")}catch(e){t.error(e+"")}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var a=n(100),r=n(225),i=n(83);function o(t,e,n,o,s){if(2===s.length)try{const e=s[0]+"",l=s[1]+"";if(!Object(a.a)(e)&&!e.endsWith(".txt"))return void t.error("'mv' can only be used on scripts and text files (.txt)");const c=t.getFile(n,e);if(null==c)return void t.error(`Source file ${e} does not exist`);const f=t.getFilepath(e),u=Object(i.f)(l,e,t.cwd());if(null===u)return void t.error("error parsing dst file");const m=t.getFile(n,u),h=t.getFilepath(u);if(Object(i.a)(f,h))return void t.error("Source and destination files are the same file");if(Object(a.a)(e)){const e=c;if(!Object(a.a)(h))return void t.error("Source and destination files must have the same type");if(o.isRunning(f))return void t.error("Cannot use 'mv' on a script that is running");if(null!=m){if(o.isRunning(h))return void t.error("Cannot use 'mv' on a script that is running");if(!o.removeFile(h).res)return void t.error("Something went wrong...please contact game dev (probably a bug)");t.print("Warning: The destination file was overwritten")}e.filename=h}else if(c instanceof r.a){const e=c;if(!u.endsWith(".txt"))return void t.error("Source and destination files must have the same type");if(null!=m){if(!o.removeFile(h).res)return void t.error("Something went wrong...please contact game dev (probably a bug)");t.print("Warning: The destination file was overwritten")}e.fn=h}}catch(e){t.error(e+"")}else t.error("Incorrect number of arguments. Usage: mv [src] [dest]")}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(652);function r(t,e,n,r,i){return Object(a.a)("nano",{terminal:t,router:e,player:n,server:r,args:i})}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a=new class{constructor(){this.positions=new Map}saveCursor(t,e){this.positions.set(t,e)}getCursor(t){const e=this.positions.get(t);return e||{row:-1,column:-1}}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(318);function r(t,e,n,r,i){let o;try{o=a({"--grep":String,"-g":"--grep"},{argv:i})}catch(e){return void t.error("Incorrect usage of ps command. Usage: ps [-g, --grep pattern]")}const s=o["--grep"];if(s){const e=new RegExp(s.toString()),n=r.runningScripts.filter(t=>e.test(t.filename));for(let e=0;e0?d:1,y=h._;if(null==Object(o.a)(u,y,c)){for(let e=0;ef+.001)return void t.error("This machine does not have enough RAM to run this script"+(1===g?"":` with ${g} threads`)+`. Script requires ${l.a.formatRAM(s)} of RAM`);const m=new i.a(o,y);m.threads=g;return Object(r.e)(n,m,c)?(t.print(`Running script with ${g} thread(s), pid ${m.pid} and args: ${JSON.stringify(y)}.`),m.filename.endsWith(".ns")&&t.warn(".ns files are deprecated, please rename everything to .js"),void(p&&a.c.emit(m))):void t.error("Failed to start script")}t.error("No such script")}else t.error("This script is already running with the same args. Cannot run multiple instances with the same args")}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(65);function r(t,e,n,r,i){if(i.length<1)return;const o=i[0]+"";if(n.hasProgram(o)){if(!(i.length<1)){for(const s of Object.values(a.a))if(s.name.toLocaleLowerCase()===o.toLocaleLowerCase())return void s.run(e,t,n,r,i.slice(1).map(t=>t+""));t.error("Invalid executable. Cannot be run")}}else t.error(`No such (exe, script, js, ns, or cct) file! (Only programs that exist on your home computer or scripts on ${n.getCurrentServer().hostname} can be run)`)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(137);function r(t,e,n,r,i){if(0!==i.length)return void t.error("Incorrect usage of scan command. Usage: scan");const o=n.getCurrentServer(),s=o.serversOnNetwork.map((t,e)=>{const n=Object(a.a)(o,e);if(null===n)throw new Error("Server should not be null");return{hostname:n.hostname,ip:n.ip,hasRoot:n.hasAdminRights?"Y":"N"}});s.unshift({hostname:"Hostname",ip:"IP",hasRoot:"Root Access"});const l=Math.max(...s.map(t=>t.hostname.length)),c=Math.max(...s.map(t=>t.ip.length));for(const e of s){if(!e)continue;let n=e.hostname;n+=" ".repeat(l-e.hostname.length+1),n+=e.ip,n+=" ".repeat(c-e.ip.length+1),n+=e.hasRoot,t.print(n)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(65);function r(t,e,n,r,i){if(0===i.length)t.executeScanAnalyzeCommand(n,1);else{if(i.length>2)return void t.error("Incorrect usage of scan-analyze command. usage: scan-analyze [depth]");let e=!1;2===i.length&&"-a"===i[1]&&(e=!0);const r=parseInt(i[0]+"");if(isNaN(r)||r<0)return void t.error("Incorrect usage of scan-analyze command. depth argument must be positive numeric");if(r>3&&!n.hasProgram(a.a.DeepscanV1.name)&&!n.hasProgram(a.a.DeepscanV2.name))return void t.error("You cannot scan-analyze with that high of a depth. Maximum depth is 3");if(r>5&&!n.hasProgram(a.a.DeepscanV2.name))return void t.error("You cannot scan-analyze with that high of a depth. Maximum depth is 5");if(r>10)return void t.error("You cannot scan-analyze with that high of a depth. Maximum depth is 10");t.executeScanAnalyzeCommand(n,r,e)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(24),r=n(100);function i(t,e,n,i,o){try{if(2!==o.length)return void t.error("Incorrect usage of scp command. Usage: scp [file] [destination hostname]");const e=t.getFilepath(o[0]+"");if(!e.endsWith(".lit")&&!Object(r.a)(e)&&!e.endsWith(".txt"))return void t.error("scp only works for scripts, text files (.txt), and literature files (.lit)");const s=Object(a.d)(o[1]+"");if(null==s)return void t.error(`Invalid destination. ${o[1]} not found`);if(e.endsWith(".lit")){let n=!1;for(let t=0;t1){t.error("Found several potential candidates:");for(const e of a)t.error(`${e.filename} ${e.args.join(" ")}`);return void t.error("Script arguments need to be specified.")}t.error(`No script named ${e} is running on the server`)}else if("number"==typeof l[0]){const e=Object(a.b)(l[0],s);if(null==e)return void t.error(`No script with PID ${l[0]} is running on the server`);o.c.emit(e)}}catch(e){t.error(e+"")}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(651),r=n(5);function i(t,e,n,i,o){if(0!==o.length)return void t.error("Incorrect usage of top command. Usage: top");const s=`Script${" ".repeat(40-"Script".length)}PID${" ".repeat(10-"PID".length)}Threads${" ".repeat(16-"Threads".length)}RAM Usage`;t.print(s);const l=i.runningScripts;for(let e=0;en.hacking?t.error("Your hacking skill is not high enough to attempt hacking this machine. Try analyzing the machine to determine the required hacking skill"):t.startWeaken(n):t.error("You do not have admin rights for this machine! Cannot weaken")}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var a=n(596),r=n.n(a),i=n(100);function o(t,e,n,a,o){if(2!==o.length)return void t.error("Incorrect usage of wget command. Usage: wget [url] [target file]");const s=o[0]+"",l=t.getFilepath(o[1]+"");if(!Object(i.a)(l)&&!l.endsWith(".txt"))return t.error("wget failed: Invalid target file. Target file must be script or text file");r.a.get(s,(function(e){let r;return r=Object(i.a)(l)?a.writeToScriptFile(n,l,e):a.writeToTextFile(l,e),r.success?r.overwritten?t.print("wget successfully retrieved content and overwrote "+l):t.print("wget successfully retrieved content to new file "+l):t.error("wget failed")}),"text").fail((function(e){return t.error("wget failed: "+JSON.stringify(e))}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(462);function r(){a.b.emit()}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(2),r=n(108);function i(){!function(){if(a.a.exploits.includes(r.a.PrototypeTampering))return;setInterval((function(){"5.5e+1"!==55..toExponential()&&a.a.giveExploit(r.a.PrototypeTampering)}),9e5)}(),function(){if(a.a.exploits.includes(r.a.TimeCompression))return;let t=performance.now();window.setTimeout((function e(){const n=performance.now();n-t<500?a.a.giveExploit(r.a.TimeCompression):(t=n,window.setTimeout(e,15e3))}),15e3)}()}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var a=n(180),r=n(110),i=n(14);function o(){window.addEventListener("unhandledrejection",(function(t){if(Object(r.a)(t.reason)){const e=t.reason.split("|DELIMITER|"),n=e[1],a=e[2],r=e[3];let o=`UNCAUGHT PROMISE ERROR
You forgot to await a promise
${a}@${n}
`;o+="
",o+=r,Object(i.a)(o)}else if(t.reason instanceof a.a){const e=`UNCAUGHT PROMISE ERROR
You forgot to await a promise
${t.reason.name}@${t.reason.hostname} (PID - ${t.reason.pid})
Maybe hack / grow / weaken ?`;Object(i.a)(e)}}))}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";n.r(e);var a=n(0),r=n.n(a),i=n(107),o=n.n(i),s=n(170),l=n(747),c=n(298);function f(){Object(s.c)(),o.a.render(r.a.createElement(s.a,null,r.a.createElement(l.a,null)),document.getElementById("root"))}Object(c.a)(),globalThis.React=r.a,globalThis.ReactDOM=o.a,o.a.render(r.a.createElement(s.a,null,r.a.createElement(l.a,null)),document.getElementById("root")),s.b.subscribe(f),location.href.startsWith("file://")||(window.onbeforeunload=function(){return"Your work will be lost."}),window.print=()=>{throw new Error("You accidentally called window.print instead of ns.print")}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e){},,function(t,e){},,,,,,,,,,,,function(t,e){},,function(t,e){},,,,,,,,,,,,,,,,,,,,,,,,,function(t,e){},,function(t,e){},function(t,e){},,,,,function(t,e){},,function(t,e){},,,,,,function(t,e){},,function(t,e){},,,,,,,,,,,,,,,,,,,function(t,e){},,,,,,,,,,,,function(t,e){},,,function(t,e){}]); //# sourceMappingURL=main.bundle.js.map \ No newline at end of file diff --git a/dist/main.bundle.js.map b/dist/main.bundle.js.map index ca6b8a0430..8c52301ef1 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/Faction/data/FactionNames.ts","webpack:///./src/ui/numeralFormat.ts","webpack:///./src/Settings/Settings.ts","webpack:///./src/Locations/data/LocationNames.ts","webpack:///./src/Constants.ts","webpack:///./src/Augmentation/data/AugmentationNames.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/utils/StringHelperFunctions.ts","webpack:///./src/Server/AllServers.ts","webpack:///./src/ui/Router.ts","webpack:///./src/Faction/Factions.ts","webpack:///./src/utils/helpers/keyCodes.ts","webpack:///./src/utils/JSONReviver.ts","webpack:///./src/ui/Context.ts","webpack:///./src/Company/data/companypositionnames.ts","webpack:///./src/utils/helpers/getRandomInt.ts","webpack:///./src/utils/WorkType.ts","webpack:///./src/Augmentation/Augmentation.tsx","webpack:///./src/ui/React/Modal.tsx","webpack:///./src/Corporation/data/Constants.ts","webpack:///./src/Hacknet/data/Constants.ts","webpack:///./src/Bladeburner/data/ActionTypes.ts","webpack:///./src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx","webpack:///./src/InteractiveTutorial.ts","webpack:///./src/Server/Server.ts","webpack:///./src/Corporation/EmployeePositions.ts","webpack:///./src/Corporation/ui/Context.ts","webpack:///./src/Corporation/IndustryData.tsx","webpack:///./src/Locations/LocationTypeEnum.ts","webpack:///./src/Hacknet/HacknetHelpers.tsx","webpack:///./src/Bladeburner/data/BlackOperationNames.ts","webpack:///./src/Bladeburner/data/Constants.ts","webpack:///./src/CotMG/FragmentType.ts","webpack:///./src/Corporation/Actions.ts","webpack:///./src/Literature/data/LiteratureNames.ts","webpack:///./src/Programs/Programs.ts","webpack:///./src/PersonObjects/Sleeve/SleeveTaskTypesEnum.ts","webpack:///./src/Company/Companies.ts","webpack:///./src/ui/React/StatsRow.tsx","webpack:///./src/StockMarket/data/PositionTypes.ts","webpack:///./src/ui/React/Table.tsx","webpack:///./src/Augmentation/StaticAugmentations.ts","webpack:///./src/Gang/AllGangs.ts","webpack:///./src/Terminal/DirectoryHelpers.ts","webpack:///./src/Terminal.ts","webpack:///./src/Crime/Crimes.ts","webpack:///./src/Casino/utils.ts","webpack:///./src/Server/data/SpecialServers.ts","webpack:///./src/ui/GameRoot.tsx","webpack:///./src/Hacknet/HacknetServer.ts","webpack:///./src/ui/React/Snackbar.tsx","webpack:///./src/Company/CompanyPositions.ts","webpack:///./src/StockMarket/data/StockSymbols.ts","webpack:///./src/Script/isScriptFilename.ts","webpack:///./src/CotMG/Helper.tsx","webpack:///./src/Hacking.ts","webpack:///./src/StockMarket/StockMarket.tsx","webpack:///./src/Faction/FactionHelpers.tsx","webpack:///./src/Exploits/Exploit.ts","webpack:///./src/SaveObject.tsx","webpack:///./src/NetscriptEvaluator.ts","webpack:///./src/ui/React/MoneyRate.tsx","webpack:///./src/CodingContracts.ts","webpack:///./src/StockMarket/data/OrderTypes.ts","webpack:///./src/Augmentation/AugmentationHelpers.tsx","webpack:///./src/CotMG/Fragment.ts","webpack:///./src/ScriptEditor/ui/themes.ts","webpack:///./src/utils/EventEmitter.ts","webpack:///./src/ui/React/Reputation.tsx","webpack:///./src/DevMenu/ui/Adjuster.tsx","webpack:///./src/Infiltration/utils.ts","webpack:///./src/Corporation/data/BaseResearchTree.ts","webpack:///./src/Server/ServerHelpers.ts","webpack:///./src/Bladeburner/data/SkillNames.ts","webpack:///./src/Bladeburner/BlackOperation.ts","webpack:///./src/Gang/ui/Context.ts","webpack:///./src/Netscript/killWorkerScript.ts","webpack:///./src/Corporation/ui/MoneyCost.tsx","webpack:///./src/utils/helpers/isString.ts","webpack:///./src/ui/React/OptionSwitch.tsx","webpack:///./src/BitNode/BitNode.tsx","webpack:///./src/StockMarket/Stock.ts","webpack:///./src/Locations/Cities.ts","webpack:///./src/Hacknet/formulas/HacknetServers.ts","webpack:///./src/Alias.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/ui/React/LogBoxManager.tsx","webpack:///./src/Corporation/MaterialSizes.ts","webpack:///./src/Netscript/ScriptDeath.ts","webpack:///./src/PersonObjects/formulas/skill.ts","webpack:///./src/Gang/data/upgrades.ts","webpack:///./src/Faction/Faction.ts","webpack:///./src/Locations/Locations.ts","webpack:///./src/Gang/data/Constants.ts","webpack:///./src/Faction/FactionWorkTypeEnum.ts","webpack:///./src/NetscriptWorker.ts","webpack:///./src/Netscript/WorkerScripts.ts","webpack:///./src/ui/React/StatsTable.tsx","webpack:///./src/Corporation/Material.ts","webpack:///./src/Gang/formulas/formulas.ts","webpack:///./src/Infiltration/ui/GameTimer.tsx","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/ui/React/Hashes.tsx","webpack:///./src/Hacknet/HacknetNode.ts","webpack:///./src/Server/ServerPurchases.ts","webpack:///./src/TextFile.ts","webpack:///./src/Netscript/RamCostGenerator.ts","webpack:///./src/Bladeburner/Skills.ts","webpack:///./src/StockMarket/StockMarketHelpers.ts","webpack:///./src/Gang/GangMemberUpgrades.ts","webpack:///./src/PersonObjects/ITaskTracker.ts","webpack:///./src/StockMarket/StockMarketCosts.ts","webpack:///./src/Script/ScriptHelpers.ts","webpack:///./src/Company/Company.ts","webpack:///./src/Hacknet/HashUpgrades.ts","webpack:///./src/Gang/GangMemberTasks.ts","webpack:///./src/Corporation/Warehouse.ts","webpack:///./src/PersonObjects/formulas/reputation.ts","webpack:///./src/StockMarket/BuyingAndSelling.tsx","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/Script/Script.ts","webpack:///./src/utils/helpers/arrayToString.ts","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/MathJaxWrapper.tsx","webpack:///./src/utils/helpers/exceptionAlert.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/Crime/Crime.ts","webpack:///./src/PersonObjects/formulas/intelligence.ts","webpack:///./src/Corporation/ResearchMap.ts","webpack:///./src/GameOptions/GameOptionsTab.ts","webpack:///./src/ui/React/HashRate.tsx","webpack:///./src/Message/Message.ts","webpack:///./src/Locations/ui/ApplyToJobButton.tsx","webpack:///./src/Netscript/WorkerScriptStartStopEventEmitter.ts","webpack:///./src/Electron.tsx","webpack:///./src/Achievements/Achievements.ts","webpack:///./src/ui/React/CharacterOverview.tsx","webpack:///./src/utils/helpers/addOffset.ts","webpack:///./src/DarkWeb/DarkWebItem.ts","webpack:///./src/Casino/RNG.ts","webpack:///./src/utils/helpers/compareArrays.ts","webpack:///./src/Corporation/IndustryUpgrades.ts","webpack:///./src/ui/React/Favor.tsx","webpack:///./src/PersonObjects/Sleeve/Sleeve.ts","webpack:///./src/Script/RamCalculationErrorCodes.ts","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/Augmentation/PlayerOwnedAugmentation.ts","webpack:///./src/db.tsx","webpack:///./src/Message/MessageHelpers.ts","webpack:///./src/Faction/formulas/favor.ts","webpack:///./src/CodingContractGenerator.ts","webpack:///./src/ExportBonus.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/Company/CompanyPosition.ts","webpack:///./src/Script/RunningScript.ts","webpack:///./src/utils/helpers/checkEnum.ts","webpack:///./src/SourceFile/SourceFiles.tsx","webpack:///./src/Bladeburner/ui/StartButton.tsx","webpack:///./src/utils/helpers/formatTime.ts","webpack:///./src/Faction/FactionInfo.tsx","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/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/Hospital/Hospital.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/ui/React/Progress.tsx","webpack:///./src/RedPill.tsx","webpack:///./src/ui/React/RecoveryRoot.tsx","webpack:///./src/NetworkShare/Share.tsx","webpack:///./src/Netscript/WorkerScript.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/Netscript/RecentScripts.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/ui/React/CorruptableText.tsx","webpack:///./src/Literature/LiteratureHelpers.ts","webpack:///./src/DarkWeb/DarkWeb.tsx","webpack:///./src/Hacking/netscriptCanHack.ts","webpack:///./src/Infiltration/formulas/game.ts","webpack:///./src/PersonObjects/Grafting/GraftableAugmentation.ts","webpack:///./src/ui/React/ReputationRate.tsx","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/NetscriptFunctions.ts","webpack:///./src/StockMarket/PlayerInfluencing.ts","webpack:///./src/Gang/Gang.ts","webpack:///./src/Faction/formulas/donation.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/GameOptions/ui/GameOptionsPage.tsx","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/Server/formulas/grow.ts","webpack:///./src/Gang/GangMemberTask.ts","webpack:///./src/PersonObjects/Sleeve/SleeveHelpers.ts","webpack:///./src/CotMG/StaneksGiftEvents.ts","webpack:///./src/Locations/data/LocationsMetadata.ts","webpack:///./src/Terminal/commands/download.ts","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/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/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/NetscriptFunctions/toNative.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/Company/GetNextCompanyPosition.ts","webpack:///./src/PersonObjects/Player/PlayerObjectBladeburnerMethods.ts","webpack:///./src/PersonObjects/Player/PlayerObjectCorporationMethods.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/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/PersonObjects/formulas/work.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/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/StockMarket/data/InitStockMetadata.ts","webpack:///./src/NetscriptFunctions/Gang.ts","webpack:///./src/Gang/data/tasks.ts","webpack:///./src/Gang/GangMember.ts","webpack:///./src/Gang/GangMemberUpgrade.ts","webpack:///./src/Gang/data/power.ts","webpack:///./src/NetscriptFunctions/Sleeve.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/utils/helpers/is2DArray.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/v1APIBreak.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/data/GeneralActions.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/PersonObjects/Grafting/ui/GraftingRoot.tsx","webpack:///./src/ui/WorkInProgressRoot.tsx","webpack:///./src/GameOptions/ui/GameOptionsRoot.tsx","webpack:///./src/GameOptions/ui/CurrentOptionsPage.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/PersonObjects/Sleeve/ui/SleeveRoot.tsx","webpack:///./src/PersonObjects/Sleeve/ui/SleeveElem.tsx","webpack:///./src/PersonObjects/Sleeve/ui/MoreEarningsModal.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/data/CompanyPositionsMetadata.ts","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/ScriptEditor/NetscriptDefinitions.d.ts","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","FactionNames","extraFormats","extraNotations","gigaMultiplier","numeralWrapper","constructor","this","defaultLocale","updateLocale","numeral","locale","console","warn","format","Math","abs","answer","formatBigNumber","formatReallyBigNumber","decimalPlaces","nAbs","Infinity","repeat","str","formatHp","formatMoney","formatSkill","formatExp","formatHashes","formatReputation","formatFavor","formatSecurity","toFixed","formatRAM","Settings","UseIEC60027_2","formatPercentage","formatter","formatServerSecurity","formatRespect","formatWanted","formatMultiplier","formatSleeveShock","formatSleeveSynchro","formatSleeveMemory","formatPopulation","formatStamina","formatShares","formatInfiltrationSecurity","formatThreads","formatStaneksGiftHeat","formatStaneksGiftCharge","formatStaneksGiftPower","parseCustomLargeNumber","numericRegExp","RegExp","join","match","NaN","number","notation","notationIndex","indexOf","largestAbsoluteNumber","n1","n2","n3","isNaN","max","parseMoney","numeralValue","parsed","selfParsed","defaultSettings","ActiveScriptsServerPageSize","ActiveScriptsScriptPageSize","AutosaveInterval","CodeInstructionRunTime","DisableASCIIArt","DisableHotkeys","DisableTextEffects","DisableOverviewProgressBars","EnableBashHotkeys","TimestampsFormat","Locale","MaxRecentScriptsCapacity","MaxLogCapacity","MaxPortCapacity","MaxTerminalCapacity","SaveGameOnFileSave","SuppressBuyAugmentationConfirmation","SuppressFactionInvites","SuppressMessages","SuppressTravelConfirmation","SuppressBladeburnerPopup","SuppressTIXPopup","SuppressSavedGameToast","SuppressAutosaveDisabledWarnings","ExcludeRunningScriptsFromSave","IsSidebarOpened","theme","defaultTheme","styles","defaultStyles","overview","x","y","opened","EditorTheme","defaultMonacoTheme","OwnedAugmentationsOrder","OwnedAugmentationsOrderSetting","AcquirementTime","PurchaseAugmentationsOrder","PurchaseAugmentationsOrderSetting","Default","MonacoTheme","MonacoInsertSpaces","MonacoFontSize","MonacoVim","MonacoWordWrap","init","assign","load","save","LocationName","CONSTANTS","VersionString","VersionNumber","_idleSpeed","MaxSkillLevel","MilliPerCycle","CorpFactionRepRequirement","BaseCostFor1GBOfRamHome","BaseCostFor1GBOfRamServer","TravelCost","BaseFavorToDonate","DonateMoneyToRepDivisor","FactionReputationToFavorBase","FactionReputationToFavorMult","CompanyReputationToFavorBase","CompanyReputationToFavorMult","NeuroFluxGovernorLevelMult","NumNetscriptPorts","HomeComputerMaxRam","ServerBaseGrowthRate","ServerMaxGrowthRate","ServerFortifyAmount","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","AugmentationNames","dialogBoxCreate","txt","AlertEvents","emit","component","sx","dangerouslySetInnerHTML","__html","CityName","BitNodeMultipliers","defaultMultipliers","useStyles","makeStyles","createStyles","unbuyable","color","palette","action","disabled","colors","Money","props","classes","undefined","player","Error","canAfford","className","convertTimeMsToTimeElapsedString","time","showMilli","floor","totalSeconds","days","secondPerHours","secTruncDays","hours","secondPerMinute","secTruncHours","minutes","secTruncMinutes","milliTruncSec","res","longestCommonStart","strings","containsAllStrings","A","concat","sort","a1","a2","L","a","charAt","b","toUpperCase","substring","arr","every","isString","formatNumber","num","numFractionDigits","toLocaleString","maximumFractionDigits","minimumFractionDigits","generateRandomString","chars","random","cyrb53","seed","h1","h2","ch","charCodeAt","imul","toString","capitalizeFirstLetter","capitalizeEachWord","split","map","word","AllServers","GetServer","server","isValidIPAddress","hostname","keys","GetServerByHostname","ipserver","ip","GetServerByIP","GetAllServers","servers","DeleteServer","serverkey","ipExists","createUniqueRandomIp","createRandomIp","AddToAllServers","initForeignServers","homeComputer","networkLayers","propertiesToPatternMatch","toNumber","getRandomInt","min","metadata","serverMetadata","serverParams","numOpenPortsRequired","organizationName","maxRamExponent","maxRam","pow","prop","Server","filename","literature","messages","SpecialServers","WorldDaemon","requiredHackingSkill","WorldDaemonDifficulty","networkLayer","linkNetworkLayers","network1","selectServer","server1","server2","serversOnNetwork","getRandomArrayItem","prestigeAllServers","member","loadAllServers","saveAllServers","excludeRunningScripts","TempAllServers","stringify","runningScripts","runningScriptObj","logs","Page","Factions","loadFactions","faction","getInfo","err","error","factionExists","initFactions","FactionInfos","resetFaction","Faction","newFactionObject","factionName","favor","AddToFactions","KEY","KEYCODE","ctor","constructors","fromJSON","obj","validationData","validateObject","Generic_toJSON","ctorName","index","Generic_fromJSON","Context","React","createContext","Router","use","useContext","SoftwareCompanyPositions","ITCompanyPositions","SecurityEngineerCompanyPositions","NetworkEngineerCompanyPositions","BusinessCompanyPositions","SecurityCompanyPositions","AgentCompanyPositions","MiscCompanyPositions","SoftwareConsultantCompanyPositions","BusinessConsultantCompanyPositions","PartTimeCompanyPositions","lower","upper","WorkType","PlayerFactionWorkType","ClassType","CrimeType","Augmentation","params","info","moneyCost","repCost","factions","prereqs","baseRepRequirement","freeze","baseCost","isSpecial","hacking_mult","mults","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","infiltration_base_rep_increase","infiltration_rep_mult","infiltration_trade_mult","infiltration_sell_mult","infiltration_timer_mult","infiltration_damage_reduction_mult","stats","programs","startingMoney","f","decimals","desc","ShadowsOfAnarchy","generateStatsDescription","addToFactions","factionList","augmentations","getCost","augmentationReference","StaticAugmentations","NeuroFluxGovernor","nextLevel","getLevel","multiplier","AugmentationRepCost","AugmentationMoneyCost","queuedAugmentations","getBaseAugmentationPriceMultiplier","includes","soaAugmentationNames","initSoAAugmentations","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","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","DividendMaxPercentage","EmployeeSalaryMultiplier","CyclesPerEmployeeRaise","EmployeeRaiseAmount","BaseMaxProducts","AllMaterials","FundingRoundShares","FundingRoundMultiplier","AvgProfitLength","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","ActionTypes","Idle","Contract","Operation","BlackOp","BlackOperation","Training","Recruitment","FieldAnalysis","Diplomacy","t_homeComp","safetlyCreateUniqueServer","adminRights","isConnectedTo","purchasedByPlayer","currentServer","Home","getHomeComputer","Programs","NukeProgram","prestigeAugmentation","numPeopleKilled","hacking","strength","defense","dexterity","agility","charisma","hacking_exp","strength_exp","defense_exp","dexterity_exp","agility_exp","charisma_exp","city","location","TravelAgency","companyName","jobs","purchasedServers","factionInvitations","numSleeves","sourceFileLvl","bitNodeN","sleevesFromCovenant","sleeves","Sleeve","shock","synchronize","shockRecovery","isWorking","currentWorkFactionName","currentWorkFactionDescription","createProgramName","None","crimeType","workHackExpGainRate","workStrExpGainRate","workDefExpGainRate","workDexExpGainRate","workAgiExpGainRate","workChaExpGainRate","workRepGainRate","workMoneyGainRate","workHackExpGained","workStrExpGained","workDefExpGained","workDexExpGained","workAgiExpGained","workChaExpGained","workRepGained","workMoneyGained","timeWorked","lastUpdate","Date","getTime","playtimeSinceLastAug","scriptProdSinceLastAug","moneySourceA","reset","hacknetNodes","hashManager","prestige","reapplyAllAugmentations","hp","max_hp","prestigeSourceFile","entropy","karma","sync","gang","resetGangs","hasWseAccount","hasTixApiAccess","has4SData","has4SDataTixApi","corporation","moneySourceB","playtimeSinceLastBitnode","receiveInvite","calculateSkill","exp","mult","calculateSkillF","calculateSkillProgress","calculateSkillProgressF","updateSkillLevels","HackingLevelMultiplier","StrengthLevelMultiplier","DefenseLevelMultiplier","DexterityLevelMultiplier","AgilityLevelMultiplier","CharismaLevelMultiplier","intelligence","intelligence_exp","ratio","round","resetMultipliers","hasProgram","programName","home","toLowerCase","setMoney","gainMoney","source","recordMoneySource","loseMoney","cost","amt","MoneySourceTracker","record","gainHackingExp","gainStrengthExp","gainDefenseExp","gainDexterityExp","gainAgilityExp","gainCharismaExp","gainIntelligenceExp","gainStats","retValue","hack","def","dex","agi","cha","int","queryStatFromString","tempStr","resetWorkStatus","generalType","group","workType","factionWorkType","singularityStopWork","workMoneyLossRate","timeWorkedCreateProgram","timeWorkedGraftAugmentation","graftAugmentationName","processWorkEarnings","numCycles","focusBonus","focus","hackExpGain","strExpGain","defExpGain","dexExpGain","agiExpGain","chaExpGain","moneyGain","startWork","Company","getWorkHackExpGain","getWorkStrExpGain","getWorkDefExpGain","getWorkDexExpGain","getWorkAgiExpGain","getWorkChaExpGain","getWorkRepGain","getWorkMoneyGain","timeNeededToCompleteWork","process","router","workForFaction","toFaction","CreateProgram","createProgramWork","toTerminal","StudyClass","takeClass","toCity","Crime","commitCrime","toLocation","Locations","Slums","CompanyPartTime","workPartTime","GraftAugmentation","graftAugmentationWork","toGrafting","work","cancelationPenalty","specialName","backdoorInstalled","overMax","comp","Companies","influenceStockThroughCompanyWork","finishWork","cancelled","sing","penaltyString","playerReputation","content","reputation","startWorkPartTime","finishWorkPartTime","startFocusing","stopFocusing","startFactionWork","favorMult","FactionWorkRepGain","startFactionHackWork","Hacking","FactionWorkExpGain","getHackingWorkRepGain","startFactionFieldWork","Field","getFactionFieldWorkRepGain","startFactionSecurityWork","Security","getFactionSecurityWorkRepGain","finishFactionWork","bn11Mult","company","companyPositionName","companyPosition","CompanyPositions","baseSalary","salaryMultiplier","CompanyWorkMoney","hackingExpGain","expMultiplier","CompanyWorkExpGain","strengthExpGain","defenseExpGain","dexterityExpGain","agilityExpGain","charismaExpGain","jobPerformance","calculateJobPerformance","startCreateProgramWork","reqLevel","createProgramReqLvl","programFile","startsWith","endsWith","percComplete","Number","reqLvl","skillMult","getIntelligenceBonus","finishCreateProgramWork","incompleteName","startGraftAugmentationWork","craftAugmentationWork","NeuroreceptorManager","graftingIntBonus","finishGraftAugmentationWork","singularity","augName","applyAugmentation","CongruityImplant","applyEntropy","startClass","costMult","expMult","workCostMult","workExpMult","earnings","calculateClassEarnings","finishClass","startCrime","hackExp","strExp","defExp","dexExp","agiExp","chaExp","workerscript","committingCrimeThruSingFn","singFnCrimeWorkerScript","CrimeExpGain","CrimeMoney","toWork","finishCrime","determineCrimeSuccess","crime","Crimes","type","kills","ws","disableLogs","ALL","scriptRef","log","takeDamage","hospitalize","regenerateHp","getHospitalizationCost","SnackbarEvents","ToastVariant","WARNING","applyForJob","entryPosType","pos","isQualified","getJobRequirementText","hasPosition","nextPos","getNextCompanyPositionHelper","reqText","getNextCompanyPosition","currCompany","currentPositionName","currentPosition","isSoftwareJob","isITJob","isBusinessJob","isSecurityEngineerJob","isNetworkEngineerJob","isSecurityJob","isAgentJob","isSoftwareConsultantJob","isBusinessConsultantJob","isPartTimeJob","quitJob","_sing","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","requiredReputation","playerAug","reapplyAllSourceFiles","sourceFiles","srcFileKey","SourceFiles","applySourceFile","applyExploit","checkForFactionInvitations","invitedFactions","numAugmentations","allCompanies","allPositions","values","checkMegacorpRequirements","repNeeded","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","v","hserver","HacknetServer","cores","ram","tiandihuiFac","TianDiHui","cybersecFac","CyberSec","cybersecServer","CyberSecServer","setBitNodeNumber","queueAugmentation","aug","PlayerOwnedAugmentation","gainCodingContractReward","reward","difficulty","CodingContractRewardType","FactionReputation","FactionReputationAll","repGain","totalGain","specialFactions","Bladeburners","gainPerFaction","facName","CompanyReputation","CodingContractMoney","travel","to","gotoLocation","canAccessGrafting","giveExploit","exploit","SUCCESS","giveAchievement","achievementId","achievement","achievements","ID","unlockedOn","Name","weight","calculateIntelligenceBonus","getCasinoWinnings","casino","getMult","setMult","canAccessCotMG","sf","lvl","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","LiteratureNames","HackersStartingHandbook","BaseServer","super","createRandomString","moneyAvailable","ServerStartingMoney","moneyMax","ServerMaxMoney","hackDifficulty","ServerStartingSecurity","baseDifficulty","minDifficulty","serverGrowth","capDifficulty","changeMinimumSecurity","perc","changeMaximumMoney","aboveCap","fortify","weaken","ServerWeakenRate","EmployeePositions","Operations","Engineer","Business","Management","RandD","Unassigned","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","hasHacknetServers","purchaseHacknet","numOwned","getCostOfNextHacknetServer","createHacknetServer","updateHashManagerCapacity","getCostOfNextHacknetNode","node","HacknetNode","hasMaxNumberHacknetServers","calculateNodeCost","calculateServerCost","getMaxNumberLevelUpgrades","nodeObj","maxLevel","calculateLevelUpgradeCost","levelsToMax","curr","getMaxNumberRamUpgrades","calculateRamUpgradeCost","log2","getMaxNumberCoreUpgrades","calculateCoreUpgradeCost","getMaxNumberCacheUpgrades","calculateCacheUpgradeCost","cache","purchaseLevelUpgrade","levels","sanitizedLevels","isServer","upgradeLevel","purchaseRamUpgrade","upgradeRam","purchaseCoreUpgrade","upgradeCore","purchaseCacheUpgrade","upgradeCache","processHacknetEarnings","HashManager","hashes","updateHashRate","h","wastedHashes","storeHashes","upgrade","HashUpgrades","processAllHacknetServerEarnings","total","processSingleHacknetNodeEarnings","processAllHacknetNodeEarnings","totalEarnings","nodes","updateCapacity","hashCapacity","purchaseHashUpgrade","upgName","upgTarget","upg","refundUpgrade","funds","target","e","division","divisions","sciResearch","qty","bladeburner","changeRank","skillPoints","generateRandomContract","BlackOperationNames","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","FragmentType","Effect","tpe","HackingChance","HackingSpeed","HackingMoney","HackingGrow","Strength","Defense","Dexterity","Agility","Charisma","HacknetMoney","HacknetCost","Rep","WorkMoney","Bladeburner","NewIndustry","industry","Industry","NewCity","offices","OfficeSpace","loc","size","UnlockUpgrade","price","unlockUpgrades","unlock","LevelUpgrade","basePrice","priceMult","upgrades","IssueDividends","percent","dividendPercentage","SellMaterial","mat","replace","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","employee","job","UpgradeOfficeSize","office","initialPriceMult","ThrowParty","costPerEmployee","totalCost","employees","throwParty","PurchaseWarehouse","warehouses","Warehouse","UpgradeWarehouseCost","Array","from","reduce","acc","UpgradeWarehouse","sizeUpgradeCost","updateSize","BuyCoffee","IndustryUpgrades","HireAdVert","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","CancelExportMaterial","LimitProductProduction","prdman","LimitMaterialProduction","SetMaterialMarketTA1","on","marketTa1","SetMaterialMarketTA2","marketTa2","SetProductMarketTA1","SetProductMarketTA2","CorporationManagementHandbook","HistoryOfSynthoids","AGreenTomorrow","AlphaOmega","SimulatedReality","BeyondMan","BrighterThanTheSun","DemocracyIsDead","Sector12Crime","ManAndMachine","SecretSocieties","TheFailedFrontier","CodedIntelligence","SyntheticMuscles","TensionsInTechRace","CostOfImmortality","TheHiddenWorld","TheNewGod","NewTriads","TheSecretWar","programsMetadata","Program","run","SleeveTaskType","initCompanies","oldCompanies","companiesMetadata","forEach","loadCompanies","StatsRow","root","cellNone","style","align","PositionTypes","borderBottom","small","width","TableCell","Table","AllGangs","power","territory","loadAllGangs","removeLeadingSlash","removeTrailingSlash","isValidFilename","isValidDirectoryName","isValidDirectoryPath","path","t_path","dirs","dir","isValidFilePath","fnSeparator","lastIndexOf","fn","getFirstParentDirectory","getAllParentDirectories","lastSlash","getDestinationFilepath","destination","cwd","dstDir","evaluateDirectoryPath","fileName","getFileName","isInRootDirectory","currPath","reconstructedPath","pop","evaluateFilePath","areFilesEqual","f0","f1","areImportsEquals","Terminal","TTerminal","Shoplift","dexterity_success_weight","agility_success_weight","RobStore","hacking_success_weight","Mug","strength_success_weight","defense_success_weight","Larceny","DealDrugs","Drugs","charisma_success_weight","BondForgery","TraffickArms","Homicide","GrandTheftAuto","Kidnap","Assassination","Heist","trusted","event","isTrusted","TheDarkArmyServer","DaedalusServer","DarkWeb","htmlLocation","margin","spacing","flexGrow","minHeight","boxSizing","uninitialized","isInitialized","page","allowRouting","toActiveScripts","toAugmentations","toBitVerse","toBladeburner","toStats","toCorporation","toCreateProgram","toDevMenu","toFactions","toGameOptions","toGang","toHacknetNodes","toInfiltration","toJob","toMilestones","toScriptEditor","toSleeves","toStockMarket","toTravel","toTutorial","toBladeburnerCinematic","toStaneksGift","toAchievements","toThemeBrowser","toImportSave","GameRoot","engine","terminal","files","vim","setEditorOptions","useState","setPage","RecoveryMode","Recovery","Work","determineStartPage","setRerender","augPage","setAugPage","setFaction","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","setTimeout","reload","softReset","installAugmentations","useEffect","subscribe","ActiveScripts","Augmentations","Stats","DevMenu","Options","Gang","Hacknet","Milestones","Grafting","options","ScriptEditor","Sleeves","StockMarket","Tutorial","City","Travel","calculateAchievements","BitVerse","BladeburnerCinematic","StaneksGift","Achievements","ThemeBrowser","base64save","automatic","_functions","fnName","_wrap","func","args","scrollTo","mainPage","withSidebar","withPopups","bypassGame","enter","enterBitNode","staneksGift","getCurrentServer","workerScripts","reactivateTutorial","buyStockLong","buyStock","buyStockShort","shortStock","cancelOrder","eventEmitterForReset","eventEmitterForUiReset","initStockMarket","initStockMarketFn","placeOrder","sellStockLong","sellStock","sellStockShort","sellShort","stockMarket","export","onExport","exportGame","forceKill","exportGameFn","installAugmentationsFn","Provider","killScripts","flexDirection","onToggled","isOpened","updateHashCapacity","seconds","onlineTimeSeconds","hashRate","totalHashesGenerated","prodMult","cpuCores","runScript","script","updateRamUsed","calculateHashGainRate","ramUsed","snackbar","zIndex","logBoxBaseZIndex","alignSelf","SnackbarProvider","dense","maxSnack","anchorOrigin","horizontal","vertical","autoHideDuration","containerRoot","EventEmitter","Snackbar","enqueueSnackbar","closeSnackbar","useSnackbar","variant","duration","id","severity","k","onClick","companyPositionMetadata","CompanyPosition","StockSymbols","IshimaStormTechnologies","NewTokyoDefComm","VolhavenHeliosLabs","NewTokyoVitaLife","Sector12IcarusMicrosystems","Sector12UniversalEnergy","AevumAeroCorp","VolhavenOmniaCybersystems","ChongqingSolarisSpaceSystems","NewTokyoGlobalPharmaceuticals","IshimaNovaMedical","AevumWatchdogSecurity","VolhavenLexoCorp","AevumRhoConstruction","Sector12AlphaEnterprises","VolhavenSysCoreSecurities","VolhavenCompuTek","AevumNetLinkTechnologies","IshimaOmegaSoftware","Sector12FoodNStuff","Sector12JoesGuns","validScriptExtensions","isScriptFilename","some","ext","loadStaneksGift","zeros","dimensions","array","calculateGrid","gift","newgrid","height","fragmentAt","calculateHackingChance","difficultyMult","chance","calculateHackingExpGain","expGain","HackExpGain","calculatePercentMoneyHacked","percentMoneyHacked","ScriptHackMoney","calculateHackingTime","skillFactor","calculateGrowTime","calculateWeakenTime","Orders","storedCycles","ticksUntilCycle","SymbolToStockMap","stock","shares","workerScript","Stock","order","Order","symbol","orders","stk","processOrderRefs","symbolToStockMap","processOrders","stockOrders","stockSymbol","orderTxt","loadStockMarket","deleteStockMarket","InitStockMetadata","TicksPerCycle","initSymbolToStockMap","cyclesPerStockUpdate","processStockPrices","timeNow","flipForecastForecast","stockMarketCycle","av","mv","chc","otlkMag","cap","changePrice","OrderTypes","LimitBuy","Short","LimitSell","Long","StopBuy","StopSell","otlkMagChange","cycleForecast","cycleForecastForecast","shareTxUntilMovement","shareTxForMovement","inviteToFaction","InvitationEvent","joinFaction","allFactions","factionInfo","enemy","enemies","hasAugmentationPrereqs","purchaseAugmentation","hasPrereqs","augCosts","queuedAugmentation","req","processPassiveFactionRepGain","offersWork","getGangName","hRep","sRep","fRep","rate","FactionPassiveRepGain","getFactionAugmentationsFiltered","hasGangWith","augs","TheRedPill","rng","SFC32RNG","uniqueFilter","GangUniqueAugs","Exploit","names","Bypass","EditSaveFile","PrototypeTampering","TimeCompression","Unclickable","UndocumentedFunctionCall","RealityAlteration","N00dles","YoureNotMeantToAccessThis","TrueRecursion","INeedARainbow","ExploitName","Set","BitburnerSaveObject","getSaveString","PlayerSave","AllServersSave","CompaniesSave","FactionsSave","AliasesSave","Aliases","GlobalAliasesSave","GlobalAliases","StockMarketSave","SettingsSave","VersionSave","LastExportBonus","ExportBonus","StaneksGiftSave","inGang","AllGangsSave","btoa","unescape","encodeURIComponent","emitToastEvent","savedOn","lastSave","Promise","resolve","reject","then","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","totalPlaytime","current","bitNode","bitNodeLevel","loadGame","navigator","userAgent","setInterval","decodeURIComponent","escape","saveObj","loadAliases","loadGlobalAliases","ver","anyPlayer","positionName","companyPositions","changes","convert","code","change","scripts","v1APIBreak","nf","revenue","expenses","lastCycleRevenue","lastCycleExpenses","thisCycleRevenue","thisCycleExpenses","sleeve","resleeves","contract","contracts","ownedNFGs","newNFG","nfg","darkweb","evaluateVersionCompatibility","href","resets","createNewUpdateText","whiteSpace","paddingLeft","lineHeight","Blob","msSaveOrOpenBlob","document","createElement","url","URL","createObjectURL","body","appendChild","click","removeChild","revokeObjectURL","netscriptDelay","delayReject","delay","env","stopFlag","ScriptDeath","makeRuntimeRejectMsg","msg","scriptUrl","dependencies","resolveNetscriptRequestedThreads","ctx","requestedThreads","threads","requestedThreadsAsInt","function","isScriptErrorMessage","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","initAugmentations","resetFactionAugmentations","clearObject","initNeuroFluxGovernor","initUnstableCircadianModulator","initGeneralAugmentations","initBladeburnerAugmentations","ChurchOfTheMachineGod","initChurchOfTheMachineGodAugmentations","resetAugmentation","augmentationExists","AddToStaticAugmentations","reapply","staticAugmentation","ownedNfg","pAug","ownedAug","force","augmentationList","nfgIndex","isRepeatableAug","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","DeleteFragment","Delete","base","inherit","common","accent","bg","fg","syntax","tag","entity","string","regexp","markup","keyword","comment","constant","ui","line","panel","selected","selection","colorRegExp","sanitizeTheme","entries","repairBlock","block","makeTheme","themeRules","token","foreground","themeColors","fromEntries","rules","async","loadThemes","monaco","editor","defineTheme","fontStyle","uuidv4","uuid","subscribers","sub","rep","Reputation","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","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","w","ey","cycles","bt","corr","bct","opc","fca","cca","ceil","processSingleServerGrowth","calculateServerGrowth","oldMoneyAvailable","isValidNumber","usedCycles","prestigeHomeComputer","homeComp","hasBitflume","BitFlume","updateRamUsage","getServerOnNetwork","isBackdoorInstalled","SkillNames","BladesIntuition","Cloak","Marksman","WeaponProficiency","ShortCircuit","DigitalObserver","Tracer","Overclock","Reaper","EvasiveSystem","Datamancer","CybersEdge","HandsOfMidas","Hyperdrive","count","getActionTimePenalty","getChaosCompetencePenalty","getChaosDifficultyBonus","useGang","killWorkerScript","rerenderUi","WorkerScript","stopAndCleanUpWorkerScript","RunningScript","killWorkerScriptByPid","pid","compareArrays","atExit","clearTimeout","killNetscriptDelay","runningScript","rs","ramUsage","delete","AddRecentScript","WorkerScriptStartStopEventEmitter","removeWorkerScript","MoneyCost","String","OptionSwitch","checked","tooltip","control","BitNode","BitNodes","HomeComputerRamCost","PurchasedServerCost","PurchasedServerSoftcap","HacknetNodeMoney","ManualHackMoney","ScriptHackMoneyGain","ClassGymExpGain","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","numUpgrades","currentRam","startingCores","currentCores","startingCache","currentCache","printAliases","print","parseAliasDeclaration","global","matches","addGlobalAlias","addAlias","getAlias","getGlobalAlias","removeAlias","substituteAliases","origCommand","commandArray","somethingSubstituted","depth","alias","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","marginRight","MuiButton","borderRadius","MuiSelect","icon","defaultProps","MuiTextField","MuiTypography","MuiMenu","list","MuiMenuItem","MuiAccordionSummary","MuiAccordionDetails","MuiIconButton","MuiTooltip","fontSize","disableInteractive","MuiSlider","valueLabel","MuiDrawer","paperAnchorDockedLeft","borderRight","welllight","MuiDivider","MuiFormControlLabel","MuiSwitch","switchBase","track","MuiPaper","MuiTablePagination","selectLabel","displayedRows","MuiTab","textColorPrimary","MuiTabs","scrollButtons","opacity","TabIndicatorProps","MuiAlert","standardSuccess","standardError","standardWarning","standardInfo","TTheme","injectFirst","layerCounter","LogBoxEvents","LogBoxCloserEvents","LogBoxClearEvents","LogBoxManager","closePid","LogWindow","close","_theme","overflowY","overflowX","wordWrap","titleButton","draggableRef","useRef","rootRef","setScript","container","minimized","setMinimized","kill","findRunningScript","startWorkerScript","updateLayer","full","maxLength","minimize","clearInterval","addEventListener","onResize","removeEventListener","debounce","isOnScreen","resetPosition","bounds","getBoundingClientRect","right","bottom","left","innerWidth","top","outerWidth","state","setState","minConstraints","handle","onDrag","clientX","clientY","innerHeight","ref","onMouseDown","flexFlow","minWidth","cursor","textOverflow","has","onTouchEnd","Water","Plants","Metal","Hardware","Chemicals","Robots","AICores","errorMessage","calculateExp","skill","currentSkill","nextSkill","baseExperience","nextExperience","progress","currentExperience","remainingExperience","experience","UpgradeType","gangMemberUpgradesMetadata","upgType","Weapon","Armor","Vehicle","Rootkit","gainFavor","getFavorGain","totalRep","favorToRep","repToFavor","constructLocation","asciiArt","LocationsMetadata","addLocation","GangConstants","GangRespectToReputationRatio","MaximumGangMembers","CyclesPerTerritoryAndPowerUpdate","AscensionMultiplierRatio","Names","GangKarmaRequirement","FactionWorkType","NetscriptPorts","NetscriptPort","prestigeWorkerScripts","port","clear","startNetscript1Script","codeWithImports","codeLineOffset","running","importProcessingRes","ast","ecmaVersion","allowReserved","sourceType","getServer","generatedCode","hasImports","walksimple","ImportDeclaration","scriptName","getScript","scriptAst","specifiers","namespace","local","fnNames","fnDeclarations","FunctionDeclaration","fnsToImport","lineOffset","linesRemoved","processNetscript1Imports","interpreterInitialization","scope","NetscriptFunctions","entry","tempWrapper","fnArgs","pseudoToNative","cb","errorTextArray","errorMsg","setProperty","createAsyncFunction","createNativeFunction","nativeToPseudo","interpreter","Interpreter","runInterpreter","more","step","parent","createAndAddWorkerScript","oneRamUsage","getRamUsageFromRunningScript","roundToTwo","arrayToString","generateNextPid","set","scriptExecution","runningFn","wrap","propName","sprintf","finally","wrapObject","vars","tree","isArray","executeJSScript","SyntaxError","message","stack","startNetscript2Script","onlineExpGained","onlineMoneyMade","updateOnlineScriptTimes","onlineRunningTime","loadAllRunningScripts","skipScriptLoad","markUpdated","scriptCalculateOfflineProduction","runScriptFromScript","caller","scriptname","arg","getRunningScript","ramAvailable","hasAdminRights","Map","StatsTable","rows","wide","MuiTable","row","elem","noWrap","Material","getMarkupLimit","qlt","mku","dmd","dmdR","cmp","cmpR","processMarket","priceChange","compChange","dmdChange","calculateWantedPenalty","respect","wantedLevel","calculateRespectGain","task","baseRespect","statWeight","hackWeight","strWeight","defWeight","dexWeight","agiWeight","chaWeight","territoryMult","territoryPenalty","respectMult","calculateWantedLevelGain","baseWanted","wanted","calc","calculateMoneyGain","baseMoney","calculateAscensionPointsGain","calculateAscensionMult","points","GameTimer","setV","totalMillis","WKSharmonizer","millis","intervalId","onExpire","noPaper","mb","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","skills","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","rand","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","bbAction","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","staminaGain","staminaBonus","eff","successChance","recruitTime","growthF","Growths","operation","infiltrateSynthoidCommunities","infilSleeves","maxRank","bladeburnersFactionName","favorBonus","rankNeededForSp","totalSkillPoints","gainedSkillPoints","processAction","actionTimeOverflow","OperationDaedalus","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","out","lerpD","lerp","Trivial","Normal","Hard","Impossible","KeyHandler","press","onKeyDown","Hashes","updateMoneyGainRate","moneyGainRatePerSecond","totalMoneyGenerated","minMax","getPurchaseServerCost","sanitizedRam","isPowerOfTwo","sign","getPurchaseServerMaxRam","getPurchaseServerLimit","clz32","purchaseServer","newServ","purchaseRamForHomeComputer","getUpgradeHomeRamCost","TextFile","append","read","show","write","getTextFile","textFiles","createTextFile","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","ScriptGetOwnedSourceFiles","ScriptClearTerminalCost","ScriptSingularityFn1RamCost","ScriptSingularityFn2RamCost","ScriptSingularityFn3RamCost","ScriptGangApiBaseRamCost","ScriptBladeburnerApiBaseRamCost","ScriptStanekWidth","ScriptStanekHeight","ScriptStanekCharge","ScriptStanekFragmentDefinitions","ScriptStanekPlacedFragments","ScriptStanekClear","ScriptStanekCanPlace","ScriptStanekPlace","ScriptStanekFragmentAt","ScriptStanekDeleteAt","ScriptInfiltrationCalculateDifficulty","ScriptInfiltrationCalculateRewards","ScriptInfiltrationGetLocations","ScriptInfiltrationGetInfiltrations","ScriptStanekAcceptGift","SF4Cost","sf4","getSymbols","getPrice","getPosition","getMaxShares","getPurchaseCost","getSaleGain","sell","short","getOrders","getVolatility","getForecast","purchase4SMarketData","purchase4SMarketDataTixApi","purchaseWseAccount","purchaseTixApi","universityCourse","gymWorkout","travelToCity","goToLocation","purchaseTor","purchaseProgram","connect","manualHack","installBackdoor","getDarkwebProgramCost","getDarkwebPrograms","getStats","getCharacterInformation","isBusy","stopAction","upgradeHomeRam","upgradeHomeCores","getUpgradeHomeCoresCost","workForCompany","applyToCompany","getCompanyFavor","getCompanyFavorGain","checkFactionInvitations","getFactionRep","getFactionFavor","getFactionFavorGain","donateToFaction","createProgram","getCrimeChance","getCrimeStats","getOwnedAugmentations","getAugmentationsFromFaction","getAugmentationCost","getAugmentationPrereq","getAugmentationPrice","getAugmentationRepReq","getAugmentationStats","isFocused","setFocus","b1tflum3","destroyW0r1dD43m0n","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","stanek","giftWidth","giftHeight","chargeFragment","fragmentDefinitions","activeFragments","clearGift","canPlaceFragment","placeFragment","getFragment","removeFragment","acceptGift","SourceRamCosts","enums","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","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","grafting","getAugmentationGraftPrice","getAugmentationGraftTime","getGraftableAugmentations","graftAugmentation","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","getScriptIncome","getScriptExpGain","nFormat","tFormat","getTimeSinceLastAug","prompt","wget","getFavorToDonate","getPlayer","getOwnedSourceFiles","tail","toast","closeTail","clearPort","openDevMenu","alert","flags","bypass","alterReality","rainbow","heart","break","formulas","calculateFavorToRep","calculateRepToFavor","repFromDonation","hackChance","hackPercent","growPercent","hackTime","growTime","weakenTime","moneyGainRate","levelUpgradeCost","ramUpgradeCost","coreUpgradeCost","hacknetNodeCost","constants","hacknetServers","hashGainRate","cacheUpgradeCost","hashUpgradeCost","hacknetServerCost","wantedPenalty","respectGain","wantedLevelGain","ascensionPointsGain","ascensionMultiplier","RamCosts","getRamCost","currType","costInc","getBuyTransactionCost","posType","getSellTransactionGain","processTransactionForecastMovement","firstShares","remainingShares","numIterations","forecastChange","forecastForecastChange","calculateBuyMaxAmount","isLong","remainingMoney","currPrice","GangMemberUpgrades","GangMemberUpgrade","getStockMarket4SDataCost","getStockMarket4STixApiCost","getStockMarketWseCost","getStockMarketTixApiCost","timePassed","confidence","dataMap","serv","timesGrown","host","offlineRunningTime","offlineExpGained","timesWeakened","findRunningScriptByPid","DefaultConstructorParams","isPlayerEmployed","isMegacorp","hasAgentPositions","hasBusinessConsultantPositions","hasBusinessPositions","hasEmployeePositions","hasITPositions","hasSecurityPositions","hasSoftwareConsultantPositions","hasSoftwarePositions","hasWaiterPositions","HashUpgradesMetadata","HashUpgrade","GangMemberTasks","gangMemberTasksMetadata","GangMemberTask","isHacking","isCombat","materials","updateMaterialSizeUsed","matName","getStorageMultiplier","CalculateShareMult","opts","suppressDialog","totalPrice","origTotal","newTotal","rerenderFn","resultTxt","gains","netProfit","origCost","Output","formatTime","RawOutput","raw","Link","dashes","TTimer","timeLeft","ConfirmationModal","confirmationText","onConfirm","additionalButton","createProgressBarText","derived","totalTicks","bars","hash","__COMMIT_HASH__","globalModuleSequenceNumber","Script","otherScripts","moduleSequenceNumber","saveScript","formatCode","dependent","dependents","dependentScript","calculateRamUsage","ramUsageEntries","imports","vals","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","MathJaxWrapper","version","src","isError","lineNumber","CorporationUnlockUpgradeIndex","CorporationUnlockUpgrades","Export","SmartSupply","MarketResearchDemand","MarketDataCompetition","VeChain","ShadyAccounting","GovernmentPartnership","WarehouseAPI","OfficeAPI","getGraftingAvailableAugs","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","commit","div","successRate","researchMetadata","GameOptionsTab","HashRate","Message","ApplyToJobButton","getJobRequirementTooltip","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","achievementData","bitNodeFinishedState","wd","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","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","GymStrength","GymDefense","GymDexterity","GymAgility","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","Intelligence","useTheme","colSpan","WorkInProgressOverview","onClickFocus","header","workCell","workHeader","pt","pb","workSubtitles","mt","details","innerText","textAlign","CharacterOverview","killOpen","setKillOpen","hackingProgress","strengthProgress","defenseProgress","dexterityProgress","agilityProgress","charismaProgress","borderTop","flex","aria-label","midpoint","program","description","BadRNG","WHRNG","s1","s2","s3","genSeed","v1","v2","Favor","Person","crimeKey","currentTask","finishTask","resetTaskStatus","gainRatesForTask","currentTaskLocation","currentTaskMaxTime","currentTaskTime","successGainRates","keysForIteration","gainExperience","bb","bbContract","bbRetValue","fromOtherSleeve","multFac","pHackExp","pStrExp","pDefExp","pDexExp","pAgiExp","pChaExp","pIntExp","earningsForPlayer","earningsForTask","earningsForSleeves","getMemoryUpgradeCost","memory","currCost","currMemory","getRepGain","getFactionHackingWorkRepGain","installAugmentation","updateStatLevels","cyclesUsed","Class","Gym","updateTaskGainRates","Synchro","retVal","gymStatType","takeUniversityCourse","universityName","AevumSummitUniversity","Sector12RothmanUniversity","VolhavenZBInstituteOfTechnology","newCity","tryBuyAugmentation","AevumCrushFitnessGym","AevumSnapFitnessGym","Sector12IronGym","Sector12PowerhouseGym","VolhavenMilleniumFitnessGym","baseGymExp","totalExpMultiplier","sanitizedStat","totalExpMult","upgradeMemory","sanitizedWorkType","offerHackingWork","offerFieldWork","offerSecurityWork","workoutAtGym","gymName","stat","getBladeburnerActionTime","recruitmentSuccessChance","contractGainRates","contractSuccessChance","chances","RamCalculationErrorCode","TerminalEvents","TerminalClearEvents","orderType","refs","orderBook","executeOrder","isBuy","predefined","getPredefinedThemes","AlertManager","alerts","setAlerts","sha256","getMessageHash","overflowWrap","getRandomByte","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","problemType","getRandomProblemType","getRandomReward","randServer","getRandomServer","contractFn","getRandomFilename","addContract","generateRandomContractOnHome","generateContract","problemTypes","rewardType","factionsThatAllowHacking","sanitizeRewardType","numFactions","randFaction","allJobs","randIndex","canGetBonus","setLastExportBonus","unixTime","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","NewTokyoNoodleBar","nextPosition","repMultiplier","reqdHacking","reqdStrength","reqdDefense","reqdDexterity","requiredAgility","reqdAgility","reqdCharisma","reqdReputation","hackingEffectiveness","strengthEffectiveness","defenseEffectiveness","dexterityEffectiveness","agilityEffectiveness","charismaEffectiveness","hackRatio","strRatio","defRatio","dexRatio","agiRatio","chaRatio","reputationGain","logEntry","logUpd","displayLog","recordHack","moneyGained","recordGrow","recordWeaken","checkEnum","enumVariable","StartButton","fmt","FactionInfo","keep","keepOnInstall","assignment","getUpgrade","getUpgradeCost","newCap","found","findCrime","roughName","atCapacity","marketCycles","emp","hireRandomEmployee","calculateTotalEmployees","maxEne","maxHap","maxMor","perfMult","hasAutobrew","hasAutoparty","salaryPaid","mor","hap","ene","calculateEmployeeProductivity","employeeJobs","employeeProd","prod","calculateProductivity","getElementById","cre","sal","Employee","creativity","efficiency","salary","assignEmployeeToJob","unassignEmployeeFromJob","setEmployeeToJob","amount","jobCount","CorporationUpgradeIndex","CorporationUpgrades","SmartFactories","benefit","SmartStorage","DreamSense","WilsonAnalytics","NuoptimalNootropicInjectorImplants","SpeechProcessorImplants","NeuralAccelerators","FocusWires","ABCSalesBots","ProjectInsight","validator","paramValidator","calculateSellInformationCashReward","levelBonus","calculateTradeInformationRepReward","calculateInfiltratorsRepReward","startingSecurityLevel","infiltrationData","sanitizedSource","comprGenChar","comprLZGenerate","plain","comprLZEncode","cur_state","fill","new_state","new_offset","tmp_state","len","comprLZDecode","compr","literal_length","backref_length","backref_offset","StatsProgressBar","remaining","StatsProgressOverviewCell","characterOverviewStyles","paddingBottom","canAccessGang","isAwareOfGang","getGangFaction","startGang","oldhp","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","empWorkMult","fin","prog","finishProduct","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","ProgressBar","withStyles","bar","transition","LinearProgress","destroyedBitNode","newBitNode","bitNodeNumber","sourceFileKey","sourceFile","alreadyOwned","ownedSourceFile","playerSrcFile","PlayerOwnedSourceFile","giveSourceFile","ActivateRecoveryMode","RecoveryRoot","errorData","resetError","issueUrl","newIssueUrl","startIcon","onTriggered","px","multiline","fullWidth","sharePower","StartSharing","CSM","nsFuncsGenerator","sanitizedPid","Environment","getScriptOnServer","shouldLog","CorporationState","numUnlockUpgrades","upgradeMultipliers","addFunds","getState","gameCycles","issueNewSharesCooldown","avgProfit","cycleProfit","retainedEarnings","getDividends","updateSharePrice","nextState","dividendsPerShare","dividends","determineValuation","getTargetSharePrice","targetPrice","immediatelyUpdateSharePrice","sharesTracker","sharesUntilUpdate","sharesSold","maxIterations","convertCooldownToString","cd","upgN","dividendTaxPercentage","upgradeAmt","getProductionMultiplier","getDreamSenseGain","getAdvertisingMultiplier","getEmployeeCreMultiplier","getEmployeeChaMultiplier","getEmployeeIntMultiplier","getEmployeeEffMultiplier","getSalesMultiplier","getScientificResearchMultiplier","getStarterGuide","hasHandbook","handbookFn","showLiterature","popEst","locations","OptionsSlider","initialValue","_evt","newValue","onChangeCommitted","callback","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","sum","EPSILON","decay","getSuccessChance","baseTime","skillFac","effDexterity","statFac","est","clamp","real","low","high","competence","playerStatLvl","effMultiplier","getSuccessesNeededForNextLevel","baseSuccessesPerLevel","recentScripts","killedTime","unshift","timeOfDeath","frames","Apr1Events","Apr1","getMonth","getDate","isApr1","setN","allow","currentCity","onTravel","WorldMap","SuccessChance","estimatedSuccessChance","StaticModal","char","CorruptableText","setContent","counter","timers","letter","randFrom","randomize","timerId","litObj","Literatures","checkIfConnectedToDarkweb","listAllDarkwebItems","item","printRaw","buyDarkwebItem","itemName","pushProgram","buyAllDarkwebItems","itemsToBuy","baseCheck","netscriptCanHack","initialCheck","netscriptCanGrow","netscriptCanWeaken","calculateRawDiff","startingDifficulty","calculateDifficulty","calculateReward","GraftableAugmentation","antiLog","ReputationRate","isNumber","ParseCommands","allCommands","flat","ParseCommand","inQuote","prevChar","escaped","DOUBLE_QUOTE","QUOTE","CinematicText","setI","done","setDone","lines","onDone","newI","auto","MaxSleevesFromCovenant","BaseCostPerSleeve","specialReferenceIF","specialReferenceFOR","specialReferenceWHILE","memCheckGlobalKey","parseOnlyRamCalculate","dependencyMap","completedParses","parseQueue","parseCode","moduleName","parseOnlyCalculateDeps","additionalModules","initialModule","nextModule","URLImportError","ImportError","detailedCosts","unresolvedRefs","resolvedRefs","prefix","ident","dep","applyFuncRam","loadedFns","refDetail","fnRam","checkInfiniteLoop","missingAwaitLine","walk","WhileStatement","st","walkDeeper","nodeHasTrueTest","test","hasAwait","AwaitExpression","currentModule","globalKey","internalToExternal","addRef","external","objectPrototypeProperties","getOwnPropertyNames","commonVisitors","Identifier","DoWhileStatement","ForStatement","update","IfStatement","consequent","alternate","MemberExpression","importModuleName","spec","imported","codeCopy","decimal","pidCounter","tempCounter","MAX_SAFE_INTEGER","safeGetServer","makeRuntimeErrorMsg","scriptArgs","getRunningScriptByPid","createPublicRunningScript","offlineMoneyMade","getCannotFindRunningScriptErrorMessage","failOnHacknetServer","callingFn","errstack","userstack","stackline","dependency","parseChromeStackline","lineMatch","funcMatch","chromeCall","parseFirefoxStackline","lio","firefoxCall","rejectMsg","manual","hackingTime","canHack","expGainedOnSuccess","expGainedOnFailure","percentHacked","maxThreadNeeded","moneyDrained","influenceStockThroughServerHack","argsToString","toNative","helper","updateDynamicRam","ramCost","dynamicLoadedFns","dynamicRamUsage","funcName","argName","boolean","checkSingularityAccess","getValidPort","iport","NetscriptSingularity","NetscriptGang","NetscriptBladeburner","NetscriptCodingContract","NetscriptSleeve","NetscriptCorporation","NetscriptStanek","NetscriptInfiltration","NetscriptUserInterface","NetscriptFormulas","NetscriptStockMarket","NetscriptGrafting","NetscriptHacknet","_hostname","_hackAmount","hackAmount","_threads","_time","moneyBefore","moneyAfter","logGrowPercent","influenceStockThroughServerGrow","_growth","_cores","maxThreadsNeeded","end","_format","_fn","possibleLogs","_pid","openPortCount","sshPortOpen","ftpPortOpen","smtpPortOpen","httpPortOpen","sqlPortOpen","_scriptname","scriptServer","spawnDelay","killByPid","_safetyguard","safetyguard","scriptsKilled","_hostname1","hostname2","hostname1","destServer","currServ","txtFile","newFile","sourceScript","oldScript","newScript","_grep","grep","allFiles","processes","speed","production","purchaseCost","coreCost","levelCost","_filename","_ram","_name","hostnameStr","_port","_mode","tryWrite","_file","status","suc","_n","_milliseconds","_milliPrecision","milliseconds","milliPrecision","_message","_variant","_txt","_url","_target","$","writeToTextFile","fail","tor","inBladeburner","hasCorporation","_host","_source","_destination","source_is_txt","dest_is_txt","source_file","dest_file","Flags","NetscriptExtra","getFunctionNames","functionNames","wrapAPI","moneyHacked","orgName","percTotalMoneyHacked","moneyGrown","percTotalMoneyGrown","performanceMult","cyclesOfWork","compName","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","g","others","thisGang","otherGang","thisPwr","thisChance","calculateTerritoryGain","winGang","loseGang","powerBonus","territoryGain","clash","won","baseDeathChance","modifiedDeathChance","killMember","getRespectNeededToRecruitMember","GangMember","getWantedPenalty","memberTotal","totalRespect","lostRespect","earnedRespect","ascend","getDiscount","discount","getAllTaskNames","taskName","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","GameOptionsPage","disablePadding","uniqueId","Hand","cards","addCards","removeByIndex","StockTickerTxButton","DummyGrid","DummyGift","fragments","activeGrid","ghostGrid","getContract","contractName","removeContract","existingPartialExeIndex","findIndex","ret","CodingContractModal","setProps","setAnswer","contractType","tries","BitFlumeEvent","BitFlumeModal","terminalCommandHistory","generalMethods","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","EvalError","parseInt","strFunctions","decodeURI","encodeURI","wrapper","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","properties","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","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_","doneProperty_","properties_","kinds","switchValue_","defaultCase_","index_","switchCase","matched_","tested_","doneBlock_","doneHandler_","doneFinalizer_","leftSide_","changeValue","returnValue","declarations","declarationNode","init_","doneBody_","numServerGrowthCycles","numServerGrowthCyclesAdjusted","findSleevePurchasableAugs","ownedAugNames","availableAugs","isAvailableForSleeve","validMults","StaneksGiftEvents","maxClearanceLevel","TechVendor","techVendorMaxRam","techVendorMinRam","University","AevumCasino","Casino","Special","NewTokyoArcade","Sector12CarmichaelSecurity","Sector12CityHall","Hospital","WorldStockExchange","ChongqingChurchOfTheMachineGod","IshimaGlitch","matchEnding","zip","JSZip","zipFiles","fileNames","fileContents","zipFn","generateAsync","FileSaver","saveAs","stealthIcon","xmlns","viewBox","killIcon","ActionLevel","isActive","canIncrease","canDecrease","Autolevel","TeamSizeButton","BlinkingCursor","setOn","StyleEditorButton","styleEditorOpen","setStyleEditorOpen","ThemeEditorButton","themeEditorOpen","setThemeEditorOpen","ThemeCollaborate","DeleteGameButton","modalOpened","setModalOpened","SoftResetButton","noConfirmation","PreReqs","ownedPreReqs","hasPreReqs","preAug","Requirement","gridArea","Exclusive","PurchasableAugmentations","augNames","PurchasableAugmentation","owned","sleeveAugs","canPurchase","float","gridTemplateAreas","TravelAgencyRoot","setDestination","startTravel","symbolsLoaded","symbols","SetupTextEditor","populate","exclude","OpenScript","lastPosition","model","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","setDimensions","regenerateModel","createModel","debouncedHandleResize","updateRAM","keydown","ctrlKey","metaKey","require","initVimMode","VimMode","Vim","defineEx","defineAction","_cm","nTabs","currIndex","currentTabIndex","onTabClick","nextIndex","mapCommand","context","dispose","debouncedSetRAM","useMemo","newCode","entriesDisp","scriptToSave","textFile","cleanCode","ns1","ns2","curIndex","isDisposed","setModel","setPosition","revealLineInCenter","onTabClose","closingScript","savedScriptIndex","savedScriptCode","serverScriptIndex","indexOffset","getServerCode","openScript","serverScript","handleFilterChange","handleExpandSearch","filteredOpenScripts","editorHeight","tabMaxWidth","tabTextWidth","tabIconWidth","onDragEnd","items","startIndex","endIndex","removed","reorder","droppableId","direction","provided","snapshot","innerRef","droppableProps","isDraggingOver","spellCheck","externalScript","colorProps","borderColor","iconButtonStyle","scriptTabText","serverScriptCode","dirty","draggableId","disableInteractiveElementBlocking","draggableProps","dragHandleProps","flexShrink","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","newArr","tempScript","awaitWarning","newDecorations","deltaDecorations","startLineNumber","startColumn","endLineNumber","endColumn","isWholeLine","glyphMarginClassName","glyphMarginHoverMessage","infLoop","glyphMargin","getAction","getSubdirectories","t_dir","processFile","subdir","containsFiles","dirWithTrailingSlash","makeScriptBlob","compile","shouldCompile","uurls","_getScriptUrls","loadedModule","isDependencyOutOfDate","scriptModuleSequenceNumber","depScript","seen","urlStack","ranges","importNodes","ExportNamedDeclaration","ExportAllDeclaration","transformedCode","matchingScripts","importedScript","urls","blob","ScriptUrl","vargs","numDashes","libarg","argv","defaultInterpreter","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","_value","marginBottom","sectionName","extraSize","StnakesGiftPowerMultiplier","Cell","cellProps","onMouseEnter","Grid","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","_data","_sumParity","_lengthOfDBits","_build","_tempcount","_temparray","_tempdata","_temp","HammingDecode","_testArray","_overallParity","_tempIndex","_tempStep","_tempData","_tempArray","_tempParity","_fixIndex","truth","automate","stop","createTreantMarkup","childrenArray","htmlClass","HTMLclass","innerHTML","findNode","setParent","chart","nodeStructure","queue","getMultiplierHelper","getProductProductionMultiplier","StanekConstants","RAMBonus","BaseSize","MaxSize","currPos","nextPosName","corpName","additionalShares","warehouseApi","OfficeApi","Engine","_lastUpdate","updateGame","expForOtherSleeves","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","newMultipliers","calculateEntropy","typ","invalidArgs","baseSize","charge","af","cotmg","inBonus","updateMults","effect","boost","neighboor","CalculateEffect","canPlace","rootX","rootY","newFrag","aFrag","place","findFragment","clearCharge","Void","StatsElement","EarningsElement","ServerType","All","Foreign","Owned","Purchased","ServerDropdown","isValidServer","purchased","serverType","purchase","DECK_COUNT","Result","Blackjack","bet","canStartGame","playerHand","deck","safeDrawCard","dealerHand","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","prev","hidden","fontWeight","red","ReactCard","Clubs","Spades","allFactionAugs","factionAugs","factionAug","gameCPS","StudyComputerScience","DataStructures","Networks","Algorithms","Leadership","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","idx","filters","colorHSL","getFiltersFromHex","hex","rgb","hexToRgb","Theme","credit","screenshot","img1","reference","outputHistory","startHack","startGrow","startWeaken","startBackdoor","startAnalyze","finishHack","oldSec","newSec","finishGrow","finishWeaken","finishBackdoor","finishAnalyze","isHacknet","org","canRunScripts","hackingSkill","security","hackingChance","numPort","getProgressText","getFile","getLitFile","lit","currDir","setcwd","contractOpen","executeScanAnalyzeCommand","visited","depthQueue","newS","titleDashes","connectToServer","executeCommands","commandHistory","commandHistoryIndex","executeCommand","n00dlesServ","commandName","scananalyze","apr1","removeBracketsFromArrayString","strCpy","removeQuotesFromString","convert2DArrayToString","ans","nums","ways","maxLen","padStart","spiral","u","col","playerAns","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","evaluated","multed","_alteredBit","_buildArray","_randomIndex","edges","shuffle","vertexShuffler","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","advertisingMult","employeeChaMult","employeeCreMult","employeeEffMult","employeeIntMult","productionMult","productProductionMult","salesMult","sciResearchMult","storageMult","effectText","costPerLevel","hasTargetServer","lookup","checkGangApiAccess","getGangMember","_faction","wantedLevelGainRate","cpy","_memberName","memberName","hack_exp","str_exp","def_exp","dex_exp","agi_exp","cha_exp","hack_mult","str_mult","def_mult","dex_mult","agi_mult","cha_mult","hack_asc_mult","str_asc_mult","def_asc_mult","dex_asc_mult","agi_asc_mult","cha_asc_mult","recruited","tasks","_taskName","assignToTask","getGangTask","_equipName","equipName","equipment","typecheck","buyUpgrade","canAscend","getAscensionResults","_engage","engage","_otherGang","playerPower","unassignFromTask","difficultyPerCycles","getGainedAscensionPoints","getCurrentAscensionMults","getAscensionMultsAfterAscend","postAscend","preAscend","applyUpgrade","respectToDeduct","createDescription","checkSleeveAPIAccess","checkSleeveNumber","sleeveNumber","sl","_sleeveNumber","_crimeRoughName","crimeRoughName","_universityName","_className","_cityName","acompanyName","_factionName","_workType","_gymName","_stat","jobTitle","maxHp","agilityExp","charismaExp","companyRep","crimeMoney","crimeSuccess","defenseExp","dexterityExp","factionRep","hackingExp","strengthExp","workMoney","workHackExpGain","workStrExpGain","workDefExpGain","workDexExpGain","workAgiExpGain","workChaExpGain","workMoneyGain","workRepGain","purchasableAugs","_augName","_action","_contract","devMenu","doc","completely_unused_field","real_document","recur","guess","bcrypt","getHacknetNode","hi","_i","hasUpgraded","timeOnline","totalProduction","_upgName","_upgTarget","checkStanekAPIAccess","_ctx","_rootX","_rootY","_rotation","_fragmentId","fragmentId","getLocationsWithInfiltrations","_location","locationName","tradeRep","sellCash","SoARep","calculateInfiltrationData","newTheme","currentTheme","errors","newStyles","currentStyles","checkBladeburnerAccess","skipjoined","apiDenied","bladeburnerDenied","checkBladeburnerCity","getBladeburnerActionObject","_blackOpName","blackOpName","_type","_level","_autoLevel","_skillName","_size","getCodingContract","returnReward","is2DArray","answerComponents","creward","upgradeName","materialName","employeeName","checkAccess","api","getSafeDivision","_divisionName","_amt","_materialName","sll","_productName","pCost","cityData","developmentProgress","_price","_all","_enabled","enabled","_designInvest","_marketingInvest","_qty","_sourceDivision","_sourceCity","_targetDivision","_targetCity","sourceDivision","targetDivision","targetCity","_on","_researchName","_job","_amount","_employeeName","_costPerEmployee","minEne","minHap","_industryName","industryName","_upgradeName","_percent","_corporationName","_selfFund","corporationName","selfFund","fundingRound","percShares","funding","investShares","_numShares","initialSharePrice","_amountCash","_amountShares","amountCash","amountShares","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","engrProd","mgmtProd","opProd","mgmtFactor","processProduct","totalProfit","forProduct","netStorageSize","sCostString","businessProd","calculateEffectWithFactors","awarenessFac","popularityFac","ratioFac","updateResearchTree","expFac","linearFac","morale","happiness","energy","det","trainingEff","effCre","effEff","prodBase","checkFormulasAccess","_favor","_rep","_exp","_mult","_skill","_startingLevel","_extraLevels","_costMult","_startingRam","_startingCore","_extraCores","extraCores","_ramUsed","_maxRam","HScalculateHashGainRate","HScalculateLevelUpgradeCost","HScalculateRamUpgradeCost","HScalculateCoreUpgradeCost","_startingCache","_extraCache","extraCache","HScalculateCacheUpgradeCost","HScalculateServerCost","_points","checkTixApiAccess","getStockFromSymbol","_symbol","_shares","_posType","sanitizedPosType","_pos","orderPos","ltype","lpos","stockMarketOrders","forecast","checkGraftingAPIAccess","graftableAug","_focus","wasFocusing","craftableAug","detect","hasChanges","orig","fl","backups","textfield","Language","InteractiveTutorialRoot","nsSelectionOpen","setNSSelectionOpen","setLanguage","tutorialScriptName","NS1","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","handleShortcuts","altKey","E","H","R","P","F","U","G","anchor","timeout","unmountOnExit","clsx","badgeContent","NeuroFluxDisplay","EntropyDisplay","AugmentationsRoot","installOpen","setInstallOpen","InstalledAugmentations","sourceAugs","selectedAug","setSelectedAug","Alphabetically","aug1","aug2","BitNodeModifiedStats","MultiplierList","listItems","augmented","bnMult","py","disableTypography","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","ex","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","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","countEmployee","SwitchButton","manualMode","switchMode","ManualManagement","setEmployee","employeePositionSelectorInitialValue","employeePositions","positionNames","AutoAssignJob","numJob","numUnassigned","AutoManagement","vechain","totalMorale","totalHappiness","totalEnergy","totalSalary","avgMorale","avgHappiness","avgEnergy","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","Text","researchOpen","setResearchOpen","advertisingInfo","advertisingFactors","totalAdvertisingFac","convertEffectFacToGraphic","Upgrades","IndustryOverview","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","findInvestorsopen","setFindInvestorsopen","goPublicopen","setGoPublicopen","fundingAvailable","findInvestorsTooltip","upgradeData","sellSharesOpen","setSellSharesOpen","buybackSharesOpen","setBuybackSharesOpen","issueNewSharesOpen","setIssueNewSharesOpen","issueDividendsOpen","setIssueDividendsOpen","sellSharesOnCd","sellSharesTooltip","issueNewSharesOnCd","issueNewSharesTooltip","canBribe","totalDividends","storedTime","LevelableUpgrade","xs","UU","BribeFactionModal","setStock","selectedFaction","setSelectedFaction","getRepText","SellSharesModal","setShares","ProfitIndicator","BuybackSharesModal","CostIndicator","IssueDividendsModal","setPercent","canIssue","maxNewSharesUnrounded","maxNewShares","newShares","IssueNewSharesModal","issueNewShares","privateShares","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","next","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","field","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","GraftableAugmentations","canGraft","AugPreReqsChecklist","GraftingRoot","graftOpen","setGraftOpen","selectedAugmentation","switchSortOrder","newOrder","Cost","getAugsSorted","CYCLES_PER_SEC","WorkInProgressRoot","expGains","workInfo","unfocus","buttons","stopText","elapsed","stopTooltip","completion","tooltipInfo","GameOptionsRoot","currentTab","setCurrentTab","SYSTEM","setTab","CurrentOptionsPage","execTime","setExecTime","recentScriptsSize","setRecentScriptsSize","logSize","setLogSize","portSize","setPortSize","terminalSize","setTerminalSize","autosaveInterval","setAutosaveInterval","timestampFormat","setTimestampFormat","setLocale","INTERFACE","GAMEPLAY","MISC","SideBarTab","sideBarProps","tabName","GameOptionsSidebar","diagnosticOpen","setDiagnosticOpen","importSaveOpen","setImportSaveOpen","importData","setImportData","confirmedImportGame","method","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","SleeveRoot","FAQOpen","setFAQOpen","SleeveElem","statsOpen","setStatsOpen","earningsOpen","setEarningsOpen","augmentationsOpen","setAugmentationsOpen","abc","setABC","doing","MoreEarningsModal","MoreStatsModal","SleeveAugmentationsModal","_showModal","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","serverMeta","CompanyLocation","quitOpen","setQuitOpen","isEmployedHere","favorGain","onQuit","QuitJobModal","GymLocation","train","HospitalLocation","btnStyle","getHealed","currHp","SlumsLocation","shopliftChance","robStoreChance","mugChance","larcenyChance","drugsChance","bondChance","armsChance","homicideChance","gtaChance","kidnapChance","assassinateChance","heistChance","SpecialLocation","handleBladeburner","new","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","paragraph","TerminalRoot","setKey","doScroll","hook","scrollIntoView","lineClass","ansiCodeStyle","COLOR_MAP_BRIGHT","1","2","3","4","5","6","7","COLOR_MAP_DARK","codeParts","nextStyleKey","codePart","ir","ig","ib","grey","ansi2rgb","textDecoration","debounced","maxWait","unsubscribe","scrollId","parts","ANSI_ESCAPE","groups","matchAll","stopIndex","partText","part","spanStyle","parseOutputText","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","schema","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","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","setGrid","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","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","getFaction","getCompany","runAfterReset","cbScript","_purchased","_facName","_cbScript","_locationName","_programName","baseserver","installTime","jobTitles","_companyName","wasFocused","_field","repNeededToDonate","_nextBN","_callbackScript","nextBN","callbackScript","hackingRequirements","wrapFunction","helpers","wrappedAPI","functionPath","functionName","extra","branch","getNestedProperty","setNestedProperty","empty","multipliers","normalServer","relative_filename","evaledDir","t_dst","dst","srcExt","tRes","sRes","sanitizedExpr","used","avail","usedPercent","incorrectUsage","newPath","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","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,EANVC,EAAWH,EAAK,GAChBI,EAAcJ,EAAK,GACnBK,EAAiBL,EAAK,GAIHM,EAAI,EAAGC,EAAW,GACpCD,EAAIH,EAASK,OAAQF,IACzBJ,EAAUC,EAASG,GAChBG,OAAOC,UAAUC,eAAeC,KAAKC,EAAiBX,IAAYW,EAAgBX,IACpFK,EAASO,KAAKD,EAAgBX,GAAS,IAExCW,EAAgBX,GAAW,EAE5B,IAAID,KAAYG,EACZK,OAAOC,UAAUC,eAAeC,KAAKR,EAAaH,KACpDc,EAAQd,GAAYG,EAAYH,IAKlC,IAFGe,GAAqBA,EAAoBhB,GAEtCO,EAASC,QACdD,EAASU,OAATV,GAOD,OAHAW,EAAgBJ,KAAKK,MAAMD,EAAiBb,GAAkB,IAGvDe,IAER,SAASA,IAER,IADA,IAAIC,EACIf,EAAI,EAAGA,EAAIY,EAAgBV,OAAQF,IAAK,CAG/C,IAFA,IAAIgB,EAAiBJ,EAAgBZ,GACjCiB,GAAY,EACRC,EAAI,EAAGA,EAAIF,EAAed,OAAQgB,IAAK,CAC9C,IAAIC,EAAQH,EAAeE,GACG,IAA3BX,EAAgBY,KAAcF,GAAY,GAE3CA,IACFL,EAAgBQ,OAAOpB,IAAK,GAC5Be,EAASM,EAAoBA,EAAoBC,EAAIN,EAAe,KAItE,OAAOD,EAIR,IAAIQ,EAAmB,GAKnBhB,EAAkB,CACrBiB,EAAG,GAGAZ,EAAkB,GAGtB,SAASS,EAAoB1B,GAG5B,GAAG4B,EAAiB5B,GACnB,OAAO4B,EAAiB5B,GAAU8B,QAGnC,IAAIC,EAASH,EAAiB5B,GAAY,CAC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IoB,EAASpV,KAAOA,EAAI,OAAOoV,EAEjC,OAAO,MAGT,WACE,MAAMC,GAAI,EACJC,GAAI,EACVtB,EAAUhjE,KACR,IAAIijE,EACF,EACAsB,IAAOC,EACPpwB,IAAaxe,QACb,EACA,IAGJotC,EAAUhjE,KACR,IAAIijE,EACF,EACAsB,IAAOE,EACPrwB,IAAaxe,QACb,EACA,IAGJotC,EAAUhjE,KACR,IAAIijE,EACF,EACAsB,IAAOG,EACPtwB,IAAaI,aACb,IACA,IAIJwuB,EAAUhjE,KACR,IAAIijE,EACF,EACAsB,IAAOI,EACPvwB,IAAaK,aACb,EACA,IAGJuuB,EAAUhjE,KACR,IAAIijE,EACF,EACAsB,IAAOK,EACPxwB,IAAaM,YACb,GACA,IAGJsuB,EAAUhjE,KACR,IAAIijE,EACF,GACAsB,IAAOG,EACPtwB,IAAaO,SACb,EACA,IAGJquB,EAAUhjE,KACR,IAAIijE,EACF,GACAsB,IAAOtwD,EACPmgC,IAAaQ,QACb,EACA,IAGJouB,EAAUhjE,KACR,IAAIijE,EACF,GACAsB,IAAOtwD,EACPmgC,IAAaS,UACb,EACA,IAGJmuB,EAAUhjE,KACR,IAAIijE,EACF,GACAsB,IAAOC,EACPpwB,IAAaU,QACb,EACA,IAGJkuB,EAAUhjE,KACR,IAAIijE,EACF,GACAsB,IAAOC,EACPpwB,IAAaW,SACb,EACA,IAGJiuB,EAAUhjE,KACR,IAAIijE,EACF,GACAsB,IAAOI,EACPvwB,IAAaY,aACb,EACA,IAGJguB,EAAUhjE,KACR,IAAIijE,EACF,GACAsB,IAAOM,EACPzwB,IAAaa,YACb,EACA,IAGJ+tB,EAAUhjE,KACR,IAAIijE,EACF,GACAsB,IAAOK,EACPxwB,IAAac,IACb,GACA,IAGJ8tB,EAAUhjE,KACR,IAAIijE,EACF,GACAsB,IAAOK,EACPxwB,IAAae,UACb,GACA,IAGJ6tB,EAAUhjE,KACR,IAAIijE,EACF,GACAsB,IAAOtwD,EACPmgC,IAAazgB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brgC,IAAamhB,SACbnhB,IAAag+B,oBACbh+B,IAAas+B,sBACbt+B,IAAau9B,mBAGjB,IAAInkB,IAAa,CACfxb,KAAMsP,IAAkB6kH,WACxBx4G,UAAW,MACXC,QAAS,MACTF,KAAM,yGACNI,QAAS,CAACxM,IAAkB4kH,WAAY5kH,IAAkB2kH,YAC1D13G,eAAgB,IAChBV,SAAU,CACRzZ,IAAamgC,YACbngC,IAAaqgC,aACbrgC,IAAag+B,oBACbh+B,IAAas+B,sBACbt+B,IAAau9B,gBACbv9B,IAAa48B,eAGjB,IAAIxjB,IAAa,CACfxb,KAAMsP,IAAkB8kH,eACxBz4G,UAAW,OACXC,QAAS,KACTF,KACE,0IAEFc,aAAc,IACdH,cAAe,IACfR,SAAU,CACRzZ,IAAas+B,sBACbt+B,IAAay+B,0BACbz+B,IAAa+/B,mBACb//B,IAAa09B,IACb19B,IAAa48B,YACb58B,IAAay8B,SACbz8B,IAAao8B,cAGjB,IAAIhjB,IAAa,CACfxb,KAAMsP,IAAkB+kH,gBACxBz4G,QAAS,OACTD,UAAW,OACXD,KACE,mSAGFW,cAAe,IACfC,aAAc,IACdT,SAAU,CACRzZ,IAAas+B,sBACbt+B,IAAay+B,0BACbz+B,IAAa+/B,mBACb//B,IAAa09B,IACb19B,IAAa48B,YACb58B,IAAay8B,SACbz8B,IAAao8B,WACbp8B,IAAau9B,mBAGjB,IAAInkB,IAAa,CACfxb,KAAMsP,IAAkBglH,WACxB14G,QAAS,KACTD,UAAW,OACXD,KACE,wIAEFW,cAAe,IACfC,aAAc,IACdT,SAAU,CACRzZ,IAAa2gC,WACb3gC,IAAamgC,YACbngC,IAAaqgC,aACbrgC,IAAashB,SACbthB,IAAaqhB,OACbrhB,IAAag+B,oBACbh+B,IAAas+B,sBACbt+B,IAAau9B,mBAGjB,IAAInkB,IAAa,CACfxb,KAAMsP,IAAkBilH,WACxB34G,QAAS,MACTD,UAAW,KACXD,KACE,iKAEFI,QAAS,CAACxM,IAAkBglH,YA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bv9B,IAAag+B,oBACbh+B,IAAas+B,yBAGjB,IAAIllB,IAAa,CACfxb,KAAMsP,IAAkBwmH,UACxBl6G,QAAS,MACTD,UAAW,KACXD,KACE,qNAGFI,QAAS,CAACxM,IAAkBumH,UAAWvmH,IAAkBsmH,QAAStmH,IAAkBqmH,KACpF14G,mBAAoB,KACpBC,mBAAoB,IACpBF,oBAAqB,IACrBN,iBAAkB,KAClBP,aAAc,IACdN,SAAU,CACRzZ,IAAa88B,MACb98B,IAAai9B,SACbj9B,IAAay+B,0BACbz+B,IAAa09B,IACb19B,IAAay8B,SACbz8B,IAAa48B,YACb58B,IAAao8B,cAGjB,IAAIhjB,IAAa,CACfxb,KAAMsP,IAAkBymH,iBACxBn6G,QAAS,MACTD,UAAW,IACXD,KACE,qKAEFI,QAAS,CAACxM,IAAkBqmH,KAC5B14G,mBAAoB,IACpBpB,SAAU,CACRzZ,IAAa88B,MACb98B,IAAai9B,SACbj9B,IAAay+B,0BACbz+B,IAAa09B,IACb19B,IAAay8B,SACbz8B,IAAa48B,YACb58B,IAAao8B,cAGjB,IAAIhjB,IAAa,CACfxb,KAAMsP,IAAkB0mH,OACxBp6G,QAAS,IACTD,UAAW,IACXD,KACE,kNAGFI,QAAS,CAACxM,IAAkBqmH,KAC5Bz4G,mBAAoB,IACpBF,oBAAqB,IACrBnB,SAAU,CACRzZ,IAAa88B,MACb98B,IAAai9B,SACbj9B,IAAay+B,0BACbz+B,IAAa09B,IACb19B,IAAay8B,SACbz8B,IAAa48B,YACb58B,IAAao8B,cAGjB,IAAIhjB,IAAa,CACfxb,KAAMsP,IAAkB2mH,iBACxBr6G,QAAS,IACTD,UAAW,IACXD,KACE,sHAEFuB,mBAAoB,KACpBD,oBAAqB,IACrBN,iBAAkB,KAClBb,SAAU,CACRzZ,IAAai/B,aACbj/B,IAAakhB,UACblhB,IAAamhB,SACbnhB,IAAaohB,SACbphB,IAAaihB,MACbjhB,IAAaqhB,OACbrhB,IAAashB,SACbthB,IAAao9B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A,uDACA,4FACA,8EACA,kFACA,mHACA,oEACA,kGACA,wEACA,oEACA,gFACA,6FACA,4FACA,6EACA,2FACA,iGACA,6EACA,4GACA,0FACA,yEACA,uEACA,gGACA,iGACA,iFACA,+FACA,0FACA,4FACA,uEACA,wHACA,sFACA,iFACA,KAGIC,EACWj4D,GACN,CACJ,UAASA,wBACT,IACA,8GACA,4FACA,IACA,4CAA2CA,kDAC3C,kBAAiBA,yEACjB,IACA,YACA,IACA,OAAMA,YACN,OAAMA,qBACN,IACA,OAAMA,WACN,OAAMA,iBACN,KAKMk4D,EAA4B,CACvC7xE,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,KAEF8xE,QAAS,CACP,iBACA,IACA,0GACA,mHACA,kHACA,gCACA,KAEFC,SAAU,CACR,kBACA,IACA,6FACA,IACA,+BACA,KAEF5uG,IAAK,CACH,iCACA,IACA,yEACA,IACA,oHACA,oDACA,IACA,+FACA,IACA,wGACA,KAEF6uG,IAAK,CACH,oBACA,IACA,6EACA,IACA,iBACA,IACA,kBACA,IACA,sBACA,KAEFtZ,GAAI,CACF,kBACA,IACA,yGACA,iFACA,IACA,yBACA,IACA,eACA,IACA,aACA,KAEFuZ,MAAO,CACL,uCACA,IACA,+HACA,uDACA,kIACA,IACA,oCACA,IACA,gGACA,IACA,sCACA,KAEF7lE,MAAO,CACL,eACA,IACA,mIACA,uIACA,KAEF8lE,IAAK,CACH,aACA,IACA,mIACA,yIACA,KAEFhnD,QAAS,CACP,4BACA,IACA,+FACA,oIACA,8GACA,KAEFinD,GAAI,CAAC,wBAAyB,IAAK,wEAAyE,KAC5G1sF,SAAU,CACR,qCACA,IACA,mFACA,IACA,4GACA,IACA,kDACA,IACA,0CACA,IACA,0CACA,KAEF2sF,KAAM,CACJ,wCACA,IACA,oFACA,IACA,oBACA,IACA,WACA,IACA,wBACA,IACA,qFACA,KAEFC,KAAM,CACJ,cACA,IACA,gIACA,gCACA,KAEFz5C,KAAM,CACJ,cACA,IACA,6GACA,2CACA,KAEFl9E,KAAM,CACJ,cACA,IACA,uHACA,KAEF42H,KAAM,CACJ,wBACA,IACA,yHACA,0HACA,mEACA,IACA,iBACA,IACA,wBACA,KAEFC,QAAS,CACP,sBACA,IACA,6GACA,KAEFj4H,KAAM,CACJ,cACA,IACA,sGACA,KAEFjZ,SAAU,CAAC,kBAAmB,IAAK,4CAA6C,KAChF2lE,KAAM,CACJ,mDACA,IACA,4EACA,IACA,6EACA,4EACA,iFACA,4DACA,IACA,uCACA,IACA,qEACA,IACA,wCACA,IACA,qFACA,KAEFgzB,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,KAEFq4C,MAAO,CAAC,eAAgB,IAAK,wDAAyD,KAEtFC,IAAK,CACH,4CACA,IACA,6HACA,2HACA,gFACA,IACA,qBACA,IACA,2BACA,IACA,4HACA,iFACA,KAEFpzF,GAAI,CACF,yBACA,IACA,6FACA,6FACA,kCACA,IACA,kFACA,kBACA,aACA,IACA,qEACA,IACA,oCACA,KAEFqzF,KAAMd,EAAgC,QACtCx3C,GAAI,CAAC,YAAa,IAAK,4DAA6D,KACpF8B,GAAI,CACF,mBACA,IACA,6GACA,IACA,kDACA,KAEFtyD,IAAK,CACH,sDACA,IACA,gDACA,IACA,sHACA,2GACA,gEACA,2DACA,2FACA,IACA,kHACA,iFACA,KAEFuuD,KAAM,CACJ,cACA,IACA,6HACA,2CACA,KAEF,eAAgB,CACd,mCACA,IACA,kGACA,wGACA,4EACA,IACA,uGACA,qGACA,0BACA,IACA,iHACA,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A,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,wFACA,IACA,wBACA,IACA,MACA,KAQJ8jF,EAAYlkF,UAAUquJ,WAAa,SAAUjrE,GAC3C,IACI+rE,EADAN,EAAkBxqJ,KAGtB8qJ,EAAU,SAAU/sJ,GAElB,OADAA,EAAQ8tE,OAAO9tE,GACXysJ,EAAgBmB,iBAElB3rJ,KAAK/E,KAAO8C,EACLiC,MAGAjC,GAGXiC,KAAK6uJ,OAAS7uJ,KAAK0/E,qBAAqBorE,GAAS,GACjD9qJ,KAAKw/E,YAAYT,EAAO,SAAU/+E,KAAK6uJ,QAGvC7uJ,KAAKw/E,YACHx/E,KAAK6uJ,OACL,eACA7uJ,KAAK0/E,qBAAqB7T,OAAOijF,cAAc,GAC/CjvE,EAAYgpE,0BAoBd,IAfA,IAAIkG,EAAY,CACd,SACA,aACA,SACA,U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sT,MACf+9G,iBAAkB,CAChB25B,kBAAmB,EACnB55B,sBAAuB,MAEzBnhI,KAAMiK,IAAaglD,yBACnB4lC,MAAO,CAACpoD,IAAazb,QAASyb,IAAauuH,YAC3CC,iBAAkB,GAClBC,iBAAkB,GAEpB,CACE1yI,KAAMzY,IAASsT,MACf+9G,iBAAkB,CAChB25B,kBAAmB,EACnB55B,sBAAuB,MAEzBnhI,KAAMiK,IAAaixH,YACnBrmC,MAAO,CAACpoD,IAAazb,UAEvB,CACExI,KAAMzY,IAASsT,MACf+9G,iBAAkB,CAChB25B,kBAAmB,EACnB55B,sBAAuB,MAEzBnhI,KAAMiK,IAAa4kD,qBACnBgmC,MAAO,CAACpoD,IAAazb,UAEvB,CACExI,KAAMzY,IAASsT,MACfoU,SAAU,GACVC,QAAS,EACT13B,KAAMiK,IAAayiH,oBACnB73B,MAAO,CAACpoD,IAAao/E,MAEvB,CACErjG,KAAMzY,IAASsT,MACfoU,SAAU,EACVC,QAAS,EACT13B,KAAMiK,IAAamiH,sBACnBv3B,MAAO,CAACpoD,IAAa0uH,aAEvB,CACE3yI,KAAMzY,IAASsT,MACf+9G,iBAAkB,CAChB25B,kBAAmB,EACnB55B,sBAAuB,MAEzBnhI,KAAMiK,IAAa0kD,sBACnBkmC,MAAO,CAACpoD,IAAazb,UAEvB,CACExI,KAAMzY,IAASsT,MACfrjB,KAAMiK,IAAamxJ,YACnBvmE,MAAO,CAACpoD,IAAa4uH,SAEvB,CACE7yI,KAAMzY,IAASuT,UACf89G,iBAAkB,CAChB25B,kBAAmB,GACnB55B,sBAAuB,OAEzBnhI,KAAMiK,IAAa02B,+BACnBk0D,MAAO,CAACpoD,IAAazb,UAEvB,CACExI,KAAMzY,IAASuT,UACf89G,iBAAkB,CAChB25B,kBAAmB,GACnB55B,sBAAuB,OAEzBnhI,KAAMiK,IAAaukD,6BACnBqmC,MAAO,CAACpoD,IAAazb,UAEvB,CACExI,KAAMzY,IAAS0T,OACf29G,iBAAkB,CAChB25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zBnhI,KAAMiK,IAAa6kD,yBACnB+lC,MAAO,CAACpoD,IAAazb,QAASyb,IAAauuH,YAC3CC,iBAAkB,EAClBC,iBAAkB,GAEpB,CACE1yI,KAAMzY,IAASwT,SACf69G,iBAAkB,CAChB25B,kBAAmB,GACnB55B,sBAAuB,OAEzBnhI,KAAMiK,IAAa21B,wBACnBi1D,MAAO,CAACpoD,IAAazb,UAEvB,CACExI,KAAMzY,IAASwT,SACfvjB,KAAMiK,IAAam4B,YACnByyD,MAAO,CAACpoD,IAAazb,UAEvB,CACExI,KAAMzY,IAASwT,SACf69G,iBAAkB,CAChB25B,kBAAmB,GACnB55B,sBAAuB,MAEzBnhI,KAAMiK,IAAauxJ,2BACnB3mE,MAAO,CAACpoD,IAAazb,UAEvB,CACExI,KAAMzY,IAASwT,SACfvjB,KAAMiK,IAAawxJ,iBACnB5mE,MAAO,CAACpoD,IAAa6uH,UAEvB,CACE9yI,KAAMzY,IAASwT,SACf69G,iBAAkB,CAChB25B,kBAAmB,GACnB55B,sBAAuB,KAEzBnhI,KAAMiK,IAAagxH,iBACnBpmC,MAAO,CAACpoD,IAAazb,UAEvB,CACExI,KAAMzY,IAASwT,SACfvjB,KAAMiK,IAAaklD,mBACnB0lC,MAAO,CAACpoD,IAAazb,UAEvB,CACExI,KAAMzY,IAASwT,SACf69G,iBAAkB,CAChB25B,kBAAmB,GACnB55B,sBAAuB,MAEzBnhI,KAAMiK,IAAau2B,kBACnBq0D,MAAO,CAACpoD,IAAazb,UAEvB,CACExI,KAAMzY,IAASwT,SACf69G,iBAAkB,CAChB25B,kBAAmB,GACnB55B,sBAAuB,MAEzBnhI,KAAMiK,IAAamkD,2BACnBymC,MAAO,CAACpoD,IAAazb,UAEvB,CACExI,KAAMzY,IAASwT,SACfmU,QAAS,EACTD,SAAU,EACVz3B,KAAMiK,IAAa0iH,gBACnB93B,MAAO,CAACpoD,IAAao/E,MAEvB,CACErjG,KAAMzY,IAASwT,SACf69G,iBAAkB,CAChB25B,k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d3gK,EAAMjhD,KAAoBihD,EAAMy/G,SAAWz/G,EAAM+hJ,OAKtG6e,CAAuB5gK,GAAQ,OACnC,MAAM6gK,EAAYzzB,EAAQptI,EAAMjhD,IAAI+R,cAC/B1P,EAAOizB,WAAWwsL,GACdz/M,IAAWy/M,EAAWjyM,EAAMmxM,YAChCS,EAASK,GAFqBjyM,EAAMqxM,aAUPA,UAAWrxM,EAAMqxM,YAC/C,kBAAC,IAAD,CAAYnkK,MAAO,CAAEmpB,UAAWw7I,EAAa,OAAS,eAAiBr/M,GACvE,kBAAC,IAAD,KACGgsL,EACD,kBAAC,IAAD,SAkBV,MAAMkzB,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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jB,EAAO,8DAA6D0iB,KAAc9rE,QACtFopD,GAAO,OACPA,GAAOgkB,EACP1yE,YAAgB0uD,QACX,GAAI1tB,EAAEijI,kBAAkBz1G,IAAa,CAC1C,MAAME,EACH,8DAA6D1tB,EAAEijI,OAAOxzK,QAAQuwC,EAAEijI,OAAO3+J,mBAAmB07B,EAAEijI,OAAO9lG,uCAEtHn+D,YAAgB0uD,S,0GCpBtB,wEAgBA,SAASpX,IACPotB,cACA0kK,IAAS5gE,OACP,kBAAC,IAAD,KACE,kBAAC,IAAD,OAEF/6G,SAASoiE,eAAe,SAhB5BzgB,cACAi6H,WAAU,MAAY1+N,IACtB0+N,WAAU,SAAeD,IACzBA,IAAS5gE,OACP,kBAAC,IAAD,KACE,kBAAC,IAAD,OAEF/6G,SAASoiE,eAAe,SAcxBprD,IAAYzsB,UAAUV,GAIwBp+B,SAAS+zC,KAAKnmC,WAAW,aACvE/0B,OAAOu3O,eAAiB,WACtB,MAAO,4BAKTv3O,OAAOoxE,MAAQ,KACb,MAAM,IAAI1hE,MAAM,8D","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([1538,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 as any);\n Player.exploits = sanitizeExploits(Player.exploits);\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 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","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 * 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 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 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","/**\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","/**\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: \"1.7.0\",\n VersionNumber: 19,\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: 200e3,\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: 7,\n\n LatestUpdate: `\n ## [draft] v1.7.0 - 2022-04-13 to 2022-05-20\n\n#### Information\n\nModifications included between **2022-04-13** and **2022-05-20** 'b5e4d70' to '0fbe4a1').\n\n_[See Pull Requests on GitHub](https://github.com/search?q=user%3Adanielyxie%20repo%3Abitburner%20is%3Apr%20is%3Amerged%20merged%3A%222022-04-13T16%3A32%3A26.000Z..2022-05-20T06%3A08%3A51.000Z%22)_\n\n#### Merged Pull Requests\n\n- [Feature] Monaco Theme Editor (by @nickofolas) #[3438](https://github.com/danielyxie/bitburner/pull/3438)\n- [Fix] Dummy Stanek grid width (by @nickofolas) #[3442](https://github.com/danielyxie/bitburner/pull/3442)\n- [Fix] Theme browser assets not loading (by @nickofolas) #[3446](https://github.com/danielyxie/bitburner/pull/3446)\n- Accept valid JSON arrays in coding contracts (by @Savlik) #[3247](https://github.com/danielyxie/bitburner/pull/3247)\n- another dark theme? (by @hydroflame) #[3450](https://github.com/danielyxie/bitburner/pull/3450)\n- API: Add repFromDonation() to the Formula API (by @Hoekstraa) #[3461](https://github.com/danielyxie/bitburner/pull/3461)\n- API: Add safeguard to ns.killall(), preventing killing itself by default (by @Hoekstraa) #[3607](https://github.com/danielyxie/bitburner/pull/3607)\n- API: FIX #2993 sleeve.travel with invalid city names (by @TheMas3212) #[3458](https://github.com/danielyxie/bitburner/pull/3458)\n- API: Fix inconsistent return value in 'ns.grafting.getAugmentationGraftTime' (by @nickofolas) #[3539](https://github.com/danielyxie/bitburner/pull/3539)\n- API: Fix leak of real Employee object in hireEmployee (by @TheMas3212) #[3483](https://github.com/danielyxie/bitburner/pull/3483)\n- API: replace a number of references to workerscript.log with \\_ctx.log (by @TheMas3212) #[3470](https://github.com/danielyxie/bitburner/pull/3470)\n- API: Terminal screen can now be cleared from within scripts with ns.ui.clearTerminal() (by @Hoekstraa) #[3618](https://github.com/danielyxie/bitburner/pull/3618)\n- AUGMENTATIONS: Fix 'isSpecial' filter in helper (Removes NeuroFlux, Stanek's Gift, etc from gangs) (by @nickofolas) #[3565](https://github.com/danielyxie/bitburner/pull/3565)\n- AUGMENTATIONS: Fix Augmentation rep req not being properly influenced by BitNode multipliers (by @nickofolas) #[3652](https://github.com/danielyxie/bitburner/pull/3652)\n- AUGMENTATIONS: Fix NeuroFlux being applied improperly and migrate broken saves (by @nickofolas) #[3613](https://github.com/danielyxie/bitburner/pull/3613)\n- AUGMENTATIONS: Fix reputation check for faction augs (by @nickofolas) #[3609](https://github.com/danielyxie/bitburner/pull/3609)\n- AUGMENTATIONS: Tweak a couple small UI elements (by @nickofolas) #[3614](https://github.com/danielyxie/bitburner/pull/3614)\n- basic doc no longer hacker themed (by @hydroflame) #[3449](https://github.com/danielyxie/bitburner/pull/3449)\n- BITNODE: FIX #3546 BitVerse now shows proper BN level when accessed via flume (by @nickofolas) #[3550](https://github.com/danielyxie/bitburner/pull/3550)\n- BLADEBURNER: fixes #3648 : Automate console command capitalisation inconsistent (by @Vic1970) #[3647](https://github.com/danielyxie/bitburner/pull/3647)\n- BLADEBURNER: Fix #3594 Blade's Simulacrum worked without being installed (by @Undeemiss) #[3639](https://github.com/danielyxie/bitburner/pull/3639)\n- blood (by @hydroflame) #[3495](https://github.com/danielyxie/bitburner/pull/3495)\n- BUGFIX: getAugmentationCost response backwards (by @phyzical) #[3617](https://github.com/danielyxie/bitburner/pull/3617)\n- BUGFIX: Handle edge case in LZ compression code and fix docs (by @stalefishies) #[3581](https://github.com/danielyxie/bitburner/pull/3581)\n- BUGFIX: make bonustime for gang in miliseconds (by @phyzical) #[3578](https://github.com/danielyxie/bitburner/pull/3578)\n- BUGFIX: sleeve stale object refence during augmentation (by @phyzical) #[3601](https://github.com/danielyxie/bitburner/pull/3601)\n- Bugfix/corp updates (by @phyzical) #[3321](https://github.com/danielyxie/bitburner/pull/3321)\n- Bump async from 2.6.3 to 2.6.4 (by @dependabot[bot]) #[3463](https://github.com/danielyxie/bitburner/pull/3463)\n- CODINGCONTRACT: Fix #3391 Double contract reward exploit (by @Undeemiss) #[3646](https://github.com/danielyxie/bitburner/pull/3646)\n- CODINGCONTRACT: FIX #3484 BREAKING Fixed capitalization in contract name (by @Undeemiss) #[3537](https://github.com/danielyxie/bitburner/pull/3537)\n- CODINGCONTRACT: New \"Proper 2-Coloring of a Graph\" contract (by @Undeemiss) #[3530](https://github.com/danielyxie/bitburner/pull/3530)\n- CODINGCONTRACT: Three new compression contracts (by @stalefishies) #[3541](https://github.com/danielyxie/bitburner/pull/3541)\n- CODINGCONTRACT: Typo & clarity fixes to description of Encoded Binary to Integer contract (by @ActuallyCurtis) #[3469](https://github.com/danielyxie/bitburner/pull/3469)\n- CODINGCONTRACT: Updated description of 2-coloring contract (by @Undeemiss) #[3531](https://github.com/danielyxie/bitburner/pull/3531)\n- COMPANY: Fix #3551 Applying for a new job will not change active employer if player is performing company work (by @Snarling) #[3552](https://github.com/danielyxie/bitburner/pull/3552)\n- CORPORATIONS: Expose makeProducts on NSDivision interface (by @DavidGrinberg) #[3570](https://github.com/danielyxie/bitburner/pull/3570)\n- CORPORATIONS: Expose sales cost on NSMaterial interface (by @DavidGrinberg) #[3574](https://github.com/danielyxie/bitburner/pull/3574)\n- Corrected example grids found in Stanek help (by @Undeemiss) #[3441](https://github.com/danielyxie/bitburner/pull/3441)\n- Create program action no longer creates duplicates (by @Undeemiss) #[3436](https://github.com/danielyxie/bitburner/pull/3436)\n- DOCUMENTATION: Add descriptions for compression contracts (by @stalefishies) #[3559](https://github.com/danielyxie/bitburner/pull/3559)\n- DOCUMENTATION: Add new coding contract descriptions (by @stalefishies) #[3542](https://github.com/danielyxie/bitburner/pull/3542)\n- DOCUMENTATION: Clarify definition for installAugmentations() (by @PSEUDOSTAGE) #[3560](https://github.com/danielyxie/bitburner/pull/3560)\n- DOCUMENTATION: FIX #3516 \"cannot\" misspelled as \"cannnot\" (by @Undeemiss) #[3533](https://github.com/danielyxie/bitburner/pull/3533)\n- EDITOR: FIX #3502 Editor theme migration crash (by @nickofolas) #[3503](https://github.com/danielyxie/bitburner/pull/3503)\n- FEATURE: added logic to allow quitJob to be called from singularity (by @phyzical) #[3577](https://github.com/danielyxie/bitburner/pull/3577)\n- fix #3395 donating to special factions possible via singularity (by @TheMas3212) #[3456](https://github.com/danielyxie/bitburner/pull/3456)\n- fix b1tflum3 and destroyW0r1dD43m0n singularity functions to check for sf4 (by @TheMas3212) #[3443](https://github.com/danielyxie/bitburner/pull/3443)\n- Fix inconsistancy with trying to work for gang factions while running a gang (by @TheMas3212) #[3454](https://github.com/danielyxie/bitburner/pull/3454)\n- Fix infiltration rep BN mult calculation (by @trambelus) #[3632](https://github.com/danielyxie/bitburner/pull/3632)\n- Fix script editor settings. (by @hydroflame) #[3504](https://github.com/danielyxie/bitburner/pull/3504)\n- Fix test/jest/Netscript/DynamicRamCalculation.test.js (by @TheMas3212) #[3455](https://github.com/danielyxie/bitburner/pull/3455)\n- GRAFTING: Fix Grafting not being handled in singularity stop work (by @nickofolas) #[3568](https://github.com/danielyxie/bitburner/pull/3568)\n- GRAFTING: Implement sorting options (by @nickofolas) #[3654](https://github.com/danielyxie/bitburner/pull/3654)\n- INFILTRATION: Added new faction called infiltrators that provide infiltration specific augs. (by @phyzical) #[3241](https://github.com/danielyxie/bitburner/pull/3241)\n- INFILTRATION: Fix minigame cycle (by @nickofolas) #[3549](https://github.com/danielyxie/bitburner/pull/3549)\n- INFILTRATION: Fix phyzical WKS aug effects being applied before aug is installed (by @nickofolas) #[3555](https://github.com/danielyxie/bitburner/pull/3555)\n- INFILTRATION: Fix rep reward being substantially higher than intended (by @nickofolas) #[3562](https://github.com/danielyxie/bitburner/pull/3562)\n- INFILTRATION: New faction, Shadows of Anarchy, provides various augs to help infiltrations. (by @hydroflame) #[3543](https://github.com/danielyxie/bitburner/pull/3543)\n- INFILTRATION: Update gameplay UI (by @nickofolas) #[3587](https://github.com/danielyxie/bitburner/pull/3587)\n- keeping up to date (by @hydroflame) #[3432](https://github.com/danielyxie/bitburner/pull/3432)\n- Keeping up to date. (by @hydroflame) #[3561](https://github.com/danielyxie/bitburner/pull/3561)\n- Make .lit and .msg files clickable (by @Chris380) #[3453](https://github.com/danielyxie/bitburner/pull/3453)\n- MESSAGES: Added the name of NiteSec's server to their .msg (by @Undeemiss) #[3466](https://github.com/danielyxie/bitburner/pull/3466)\n- MISC: add better typing to Electron.tsx (by @taralx) #[3540](https://github.com/danielyxie/bitburner/pull/3540)\n- MISC: Added NS function closeTail to close tail windows (by @Undeemiss) #[3666](https://github.com/danielyxie/bitburner/pull/3666)\n- MISC: Adjust deps to current usage (by @taralx) #[3519](https://github.com/danielyxie/bitburner/pull/3519)\n- MISC: Close some GitHub issues that do not need action (by @Undeemiss) #[3640](https://github.com/danielyxie/bitburner/pull/3640)\n- MISC: Closing more GitHub issues I missed last time (by @Undeemiss) #[3665](https://github.com/danielyxie/bitburner/pull/3665)\n- MISC: Correct BB Skill point achievement name (by @Undeemiss) #[3571](https://github.com/danielyxie/bitburner/pull/3571)\n- MISC: Correct typos in getScriptRam docs. (by @nzdjb) #[3590](https://github.com/danielyxie/bitburner/pull/3590)\n- MISC: Fix #3125 BREAKING Renamed BN mult CorporationSoftCap to CorporationSoftcap (by @Undeemiss) #[3638](https://github.com/danielyxie/bitburner/pull/3638)\n- MISC: FIX #3593 Float errors can no longer prevent full usage of a server's available ram. (by @Snarling) #[3619](https://github.com/danielyxie/bitburner/pull/3619)\n- MISC: fix typing conflict between jest and cypress (by @taralx) #[3518](https://github.com/danielyxie/bitburner/pull/3518)\n- MISC: fix typing conflict between jest and cypress (by @taralx) #[3644](https://github.com/danielyxie/bitburner/pull/3644)\n- MISC: Fixed typo in exceptionAlert.ts (by @Undeemiss) #[3572](https://github.com/danielyxie/bitburner/pull/3572)\n- MISC: Fixed typos in game options (by @notacompsciguy) #[3584](https://github.com/danielyxie/bitburner/pull/3584)\n- MISC: HammingCodingContracts need rework (by @Hedrauta) #[3479](https://github.com/danielyxie/bitburner/pull/3479)\n- MISC: Implemented infinite loop safety net. (by @hydroflame) #[3624](https://github.com/danielyxie/bitburner/pull/3624)\n- MISC: make jQuery use explicit (by @taralx) #[3517](https://github.com/danielyxie/bitburner/pull/3517)\n- MISC: Make tutorial explain ns1 vs ns2 better (by @hydroflame) #[3586](https://github.com/danielyxie/bitburner/pull/3586)\n- MISC: Remove comments that describe nonexistent augs (by @Undeemiss) #[3569](https://github.com/danielyxie/bitburner/pull/3569)\n- MISC: update @types/numeral and fix type errors (by @taralx) #[3521](https://github.com/danielyxie/bitburner/pull/3521)\n- MISC: Update logic for stats page BitNode level (by @nickofolas) #[3512](https://github.com/danielyxie/bitburner/pull/3512)\n- MISC: upgrade to eslint v8 (by @taralx) #[3523](https://github.com/danielyxie/bitburner/pull/3523)\n- MISC: Wrap most of the API in the new api wrapper (by @hydroflame) #[3627](https://github.com/danielyxie/bitburner/pull/3627)\n- OPTIONS: Fix sliders not sliding correctly (by @nickofolas) #[3642](https://github.com/danielyxie/bitburner/pull/3642)\n- REFACTOR: augmentation cost, rep cost and level to be calculated in place (by @phyzical) #[3544](https://github.com/danielyxie/bitburner/pull/3544)\n- REFACTOR: augmentation isSpecial adjustments (by @phyzical) #[3564](https://github.com/danielyxie/bitburner/pull/3564)\n- Reran npm format and lint to fix formatting (by @Undeemiss) #[3434](https://github.com/danielyxie/bitburner/pull/3434)\n- Revert \"MISC: fix typing conflict between jest and cypress\" (by @hydroflame) #[3608](https://github.com/danielyxie/bitburner/pull/3608)\n- Revert \"MISC: HammingCodingContracts need rework\" (by @hydroflame) #[3500](https://github.com/danielyxie/bitburner/pull/3500)\n- revert theme (by @hydroflame) #[3451](https://github.com/danielyxie/bitburner/pull/3451)\n- Singularity: Fix #3489 Disable checkTixApiAccess for purchase4SMarketData (by @DavidGrinberg) #[3490](https://github.com/danielyxie/bitburner/pull/3490)\n- SLEEVES: Fix issues with Sleeve UI crashing when Sleeve task faction becomes gang faction (by @nickofolas) #[3557](https://github.com/danielyxie/bitburner/pull/3557)\n- STANEK: Fix #3196 Charging booster fragments throws an error (by @Undeemiss) #[3637](https://github.com/danielyxie/bitburner/pull/3637)\n- STANEK: FIX #3277 Can no longer overlap rotated fragments (by @Undeemiss) #[3460](https://github.com/danielyxie/bitburner/pull/3460)\n- STANEK: FIX #3282 Added NS function stanek.acceptGift (by @Undeemiss) #[3513](https://github.com/danielyxie/bitburner/pull/3513)\n- STANEK: Properly reapply entropy in Stanek's Gift (by @nickofolas) #[3673](https://github.com/danielyxie/bitburner/pull/3673)\n- STANEK: Stanek NS functions correctly throw errors when stanek not installed (by @Undeemiss) #[3660](https://github.com/danielyxie/bitburner/pull/3660)\n- Started collecting lore so that additions to it are simpler (by @Undeemiss) #[3465](https://github.com/danielyxie/bitburner/pull/3465)\n- TERMINAL: FIX #3492 Allow cd .. even when destination directory is empty (by @Snarling) #[3525](https://github.com/danielyxie/bitburner/pull/3525)\n- TERMINAL: FIX #3651 Make directory name regex more flexible (by @Dane-Horn) #[3653](https://github.com/danielyxie/bitburner/pull/3653)\n- TOOLING: Add GitHub action to validate PR titles (by @MartinFournier) #[3471](https://github.com/danielyxie/bitburner/pull/3471)\n- UI FIX #3485 - Allow bulk purchasing when smart supply is enabled (by @phyzical) #[3486](https://github.com/danielyxie/bitburner/pull/3486)\n- UI: Change text color of Augmentations page backup button (by @nickofolas) #[3511](https://github.com/danielyxie/bitburner/pull/3511)\n- UI: FIX #1754 Stanek effect summary & slight tweak. (by @borisflagell) #[3622](https://github.com/danielyxie/bitburner/pull/3622)\n- UI: FIX #2228,#2958 Fix tab highlights and highlight files not on home. (by @phyzical) #[2989](https://github.com/danielyxie/bitburner/pull/2989)\n- UI: FIX #2256 Hacknet server's upgrade tooltip were not handling RAM… (by @borisflagell) #[3532](https://github.com/danielyxie/bitburner/pull/3532)\n- UI: FIX #2741 Allow using modifier keys inside the typing infiltration (by @Dane-Horn) #[3634](https://github.com/danielyxie/bitburner/pull/3634)\n- UI: FIX #2829 Remove defeated NPC gangs from territory page (by @Dane-Horn) #[3633](https://github.com/danielyxie/bitburner/pull/3633)\n- UI: FIX #3313 Streamline the GraftingRoot page by making it rerender. (by @borisflagell) #[3558](https://github.com/danielyxie/bitburner/pull/3558)\n- UI: FIX #3341 Enable touch-clicks in react-draggable (by @Snarling) #[3488](https://github.com/danielyxie/bitburner/pull/3488)\n- UI: FIX #3415 Tweak Manage Gang button visibility (by @borisflagell) #[3528](https://github.com/danielyxie/bitburner/pull/3528)\n- UI: FIX #3457 autocomplete suggestions no longer require hovering terminal input (by @Snarling) #[3493](https://github.com/danielyxie/bitburner/pull/3493)\n- UI: FIX #3473 'mv' now says destination script is running instead of returning an error (by @Hoekstraa) #[3474](https://github.com/danielyxie/bitburner/pull/3474)\n- UI: FIX #3522 realigned autocomplete popup (by @Snarling) #[3524](https://github.com/danielyxie/bitburner/pull/3524)\n- UI: FIX #3592 Sidebar and bash shortcuts now work on MacOS with US-like layouts (by @Hoekstraa) #[3605](https://github.com/danielyxie/bitburner/pull/3605)\n- UI: Fix Agility BitNode multiplier not appearing in UI (by @nickofolas) #[3662](https://github.com/danielyxie/bitburner/pull/3662)\n- UI: Fix exclusive augs not always showing as purchasable through gangs when they should (by @nickofolas) #[3676](https://github.com/danielyxie/bitburner/pull/3676)\n- UI: Fix the achievement covenant icon was not shown (by @Risenafis) #[3510](https://github.com/danielyxie/bitburner/pull/3510)\n- UI: Fix z-index of modals overriding everything (by @nickofolas) #[3620](https://github.com/danielyxie/bitburner/pull/3620)\n- UI: lightweight description update on \"increase maximum money\" hash spending option. (by @borisflagell) #[3547](https://github.com/danielyxie/bitburner/pull/3547)\n- UI: Minor improvements to log boxes (by @nickofolas) #[3641](https://github.com/danielyxie/bitburner/pull/3641)\n- UI: Overhaul GameOptions UI (by @nickofolas) #[3505](https://github.com/danielyxie/bitburner/pull/3505)\n- UI: Positioning improved for tail titlebar buttons, and tail window has minimum size constraints. (by @Snarling) #[3548](https://github.com/danielyxie/bitburner/pull/3548)\n- UI: Redesign purchasable Augmentations (by @nickofolas) #[3545](https://github.com/danielyxie/bitburner/pull/3545)\n- UI: Refactor and redesign WorkInProgress interface (by @nickofolas) #[3611](https://github.com/danielyxie/bitburner/pull/3611)\n- UI: Refactors, redesigns, and new section to stats page (by @nickofolas) #[3626](https://github.com/danielyxie/bitburner/pull/3626)\n- UI: Sort and color Graft Augmentation list (by @jaype87) #[3616](https://github.com/danielyxie/bitburner/pull/3616)\n- UI: Update Factions list interface (by @nickofolas) #[3675](https://github.com/danielyxie/bitburner/pull/3675)\n- WORK: FIX #3435 Quitting the active job now sets first remaining job as active (by @Snarling) #[3507](https://github.com/danielyxie/bitburner/pull/3507)\n- WORK: Refactor work types to use 'enum's instead of constants (by @nickofolas) #[3612](https://github.com/danielyxie/bitburner/pull/3612)\n\n#### Other Changes\n\n- increase donation counter (by @hydroflame) - [8456410](https://github.com/danielyxie/bitburner/commit/84564100e90c46ae4b816853c2cdea0bc309af4d)\n- allbuild commit 7f9e3775 (by @hydroflame) - [791c19c](https://github.com/danielyxie/bitburner/commit/791c19c4fe447c9231bfb423b9fc48114e783b43)\n- allbuild commit bcbda22a (by @hydroflame) - [032c440](https://github.com/danielyxie/bitburner/commit/032c440eaeb069eecd720ec2f8e069f705a0c1b4)\n- fix documentation for getDarkwebPrograms (by @hydroflame) - [4056956](https://github.com/danielyxie/bitburner/commit/4056956c2ada37946333bdad44cb0b6eb3909bf8)\n- support ASNI (by @hydroflame) - [36c7ef1](https://github.com/danielyxie/bitburner/commit/36c7ef1ad7ea8bb69fca23bce5883a3c2e23f1e0)\n- allbuild commit 22b6d0d5 (by @hydroflame) - [b46718d](https://github.com/danielyxie/bitburner/commit/b46718d188880ecf716ae045861d81d61e00af4b)\n- allbuild commit 36c7ef1a (by @hydroflame) - [d0ebf5e](https://github.com/danielyxie/bitburner/commit/d0ebf5e14e0498cb063fde35d63c9f59f2c01e35)\n- Update documentation for employee (by @hydroflame) - [100e81c](https://github.com/danielyxie/bitburner/commit/100e81c8ab4a408f74cc9bd9ffe2b8bad3d03462)\n- allbuild commit c799b291 (by @hydroflame) - [f5f5879](https://github.com/danielyxie/bitburner/commit/f5f5879fc380678d978e2b0a29ba7b6f0b4c9ec0)\n- ideas (by @hydroflame) - [0121fee](https://github.com/danielyxie/bitburner/commit/0121fee6e4c690d01650d1e68a80ea363bb48bce)\n- allbuild commit 0121fee6 (by @hydroflame) - [5c417e9](https://github.com/danielyxie/bitburner/commit/5c417e9b4df236df8bf3e2f8262b7bce87c934df)\n- Update codebase for stanek (by @hydroflame) - [c2b4a5b](https://github.com/danielyxie/bitburner/commit/c2b4a5b52a2162d2e49c7317b0a60a349984eb47)\n- fix lint (by @hydroflame) - [4cc518f](https://github.com/danielyxie/bitburner/commit/4cc518f37723aafb3168b64cd689408afdb74877)\n- Fix (by @hydroflame) - [9af553f](https://github.com/danielyxie/bitburner/commit/9af553f63cb1380795550648b0134b608564fab8)\n- Fix stanek leaking classes (by @hydroflame) - [fda3f02](https://github.com/danielyxie/bitburner/commit/fda3f02d73dba27034128c9be5e810a51e475e38)\n- fix conflicts (by @hydroflame) - [ca1a2aa](https://github.com/danielyxie/bitburner/commit/ca1a2aad333fa838b6d0e57f89e1cedba086a4a0)\n- Nerf noodle bar.\n\n`,\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","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 { 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","import { Server } from \"./Server\";\nimport { BaseServer } from \"./BaseServer\";\nimport { serverMetadata } from \"./data/servers\";\n\nimport { HacknetServer } from \"../Hacknet/HacknetServer\";\n\nimport { IMap } 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 return AllServers[ip] != null;\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 [key: string]: any;\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 // Essentially any property that is of type 'number | IMinMaxRange'\n const propertiesToPatternMatch: string[] = [\n \"hackDifficulty\",\n \"moneyAvailable\",\n \"requiredHackingSkill\",\n \"serverGrowth\",\n ];\n\n const toNumber = (value: any): any => {\n switch (typeof value) {\n case \"number\":\n return value;\n case \"object\":\n return getRandomInt(value.min, value.max);\n default:\n throw Error(`Do not know how to convert the type '${typeof value}' to a number`);\n }\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 for (const prop of propertiesToPatternMatch) {\n if (metadata[prop] !== undefined) {\n serverParams[prop] = toNumber(metadata[prop]);\n }\n }\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: any[]): any => 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 { 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(): 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","/**\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\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","/* 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: any, keys?: string[]): IReviverValue {\n if (!keys) {\n keys = Object.keys(obj); // Only \"own\" properties are included\n }\n\n const data: any = {};\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 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","// 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","export enum WorkType {\n None = \"\",\n Company = \"Working for Company\",\n CompanyPartTime = \"Working for Company part-time\",\n Faction = \"Working for Faction\",\n CreateProgram = \"Working on Create a Program\",\n StudyClass = \"Studying or Taking a class at university\",\n Crime = \"Committing a crime\",\n GraftAugmentation = \"Grafting an Augmentation\",\n}\n\nexport enum PlayerFactionWorkType {\n None = \"\",\n Hacking = \"Faction Hacking Work\",\n Field = \"Faction Field Work\",\n Security = \"Faction Security Work\",\n}\n\nexport enum ClassType {\n None = \"\",\n StudyComputerScience = \"studying Computer Science\",\n DataStructures = \"taking a Data Structures course\",\n Networks = \"taking a Networks course\",\n Algorithms = \"taking an Algorithms course\",\n\n Management = \"taking a Management course\",\n Leadership = \"taking a Leadership course\",\n\n GymStrength = \"training your strength at a gym\",\n GymDefense = \"training your defense at a gym\",\n GymDexterity = \"training your dexterity at a gym\",\n GymAgility = \"training your agility at a gym\",\n}\n\nexport enum CrimeType {\n None = \"\",\n Shoplift = \"shoplift\",\n RobStore = \"rob a store\",\n Mug = \"mug someone\",\n Larceny = \"commit larceny\",\n Drugs = \"deal drugs\",\n BondForgery = \"forge corporate bonds\",\n TraffickArms = \"traffick illegal arms\",\n Homicide = \"commit homicide\",\n GrandTheftAuto = \"commit grand theft auto\",\n Kidnap = \"kidnap someone for ransom\",\n Assassination = \"assassinate a high-profile target\",\n Heist = \"pull off the ultimate heist\",\n}\n","// Class definition for a single Augmentation object\nimport * as React from \"react\";\nimport { IMap } from \"../types\";\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, 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\";\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_mult?: number;\n strength_mult?: number;\n defense_mult?: number;\n dexterity_mult?: number;\n agility_mult?: number;\n charisma_mult?: number;\n hacking_exp_mult?: number;\n strength_exp_mult?: number;\n defense_exp_mult?: number;\n dexterity_exp_mult?: number;\n agility_exp_mult?: number;\n charisma_exp_mult?: number;\n hacking_chance_mult?: number;\n hacking_speed_mult?: number;\n hacking_money_mult?: number;\n hacking_grow_mult?: number;\n company_rep_mult?: number;\n faction_rep_mult?: number;\n crime_money_mult?: number;\n crime_success_mult?: number;\n work_money_mult?: number;\n hacknet_node_money_mult?: number;\n hacknet_node_purchase_cost_mult?: number;\n hacknet_node_ram_cost_mult?: number;\n hacknet_node_core_cost_mult?: number;\n hacknet_node_level_cost_mult?: number;\n bladeburner_max_stamina_mult?: number;\n bladeburner_stamina_gain_mult?: number;\n bladeburner_analysis_mult?: number;\n bladeburner_success_chance_mult?: number;\n infiltration_base_rep_increase?: number;\n infiltration_rep_mult?: number;\n infiltration_trade_mult?: number;\n infiltration_sell_mult?: number;\n infiltration_timer_mult?: number;\n infiltration_damage_reduction_mult?: number;\n\n startingMoney?: number;\n programs?: string[];\n}\n\nfunction generateStatsDescription(mults: IMap, 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_mult &&\n mults.hacking_mult == mults.strength_mult &&\n mults.hacking_mult == mults.defense_mult &&\n mults.hacking_mult == mults.dexterity_mult &&\n mults.hacking_mult == mults.agility_mult &&\n mults.hacking_mult == mults.charisma_mult\n ) {\n desc = (\n <>\n {desc}\n
+{f(mults.hacking_mult - 1)} all skills\n \n );\n } else {\n if (mults.hacking_mult)\n desc = (\n <>\n {desc}\n
+{f(mults.hacking_mult - 1)} hacking skill\n \n );\n\n if (\n mults.strength_mult &&\n mults.strength_mult == mults.defense_mult &&\n mults.strength_mult == mults.dexterity_mult &&\n mults.strength_mult == mults.agility_mult\n ) {\n desc = (\n <>\n {desc}\n
+{f(mults.strength_mult - 1)} combat skills\n \n );\n } else {\n if (mults.strength_mult)\n desc = (\n <>\n {desc}\n
+{f(mults.strength_mult - 1)} strength skill\n \n );\n if (mults.defense_mult)\n desc = (\n <>\n {desc}\n
+{f(mults.defense_mult - 1)} defense skill\n \n );\n if (mults.dexterity_mult)\n desc = (\n <>\n {desc}\n
+{f(mults.dexterity_mult - 1)} dexterity skill\n \n );\n if (mults.agility_mult)\n desc = (\n <>\n {desc}\n
+{f(mults.agility_mult - 1)} agility skill\n \n );\n }\n if (mults.charisma_mult)\n desc = (\n <>\n {desc}\n
+{f(mults.charisma_mult - 1)} charisma skill\n \n );\n }\n\n if (\n mults.hacking_exp_mult &&\n mults.hacking_exp_mult === mults.strength_exp_mult &&\n mults.hacking_exp_mult === mults.defense_exp_mult &&\n mults.hacking_exp_mult === mults.dexterity_exp_mult &&\n mults.hacking_exp_mult === mults.agility_exp_mult &&\n mults.hacking_exp_mult === mults.charisma_exp_mult\n ) {\n desc = (\n <>\n {desc}\n
+{f(mults.hacking_exp_mult - 1)} exp for all skills\n \n );\n } else {\n if (mults.hacking_exp_mult)\n desc = (\n <>\n {desc}\n
+{f(mults.hacking_exp_mult - 1)} hacking exp\n \n );\n\n if (\n mults.strength_exp_mult &&\n mults.strength_exp_mult === mults.defense_exp_mult &&\n mults.strength_exp_mult === mults.dexterity_exp_mult &&\n mults.strength_exp_mult === mults.agility_exp_mult\n ) {\n desc = (\n <>\n {desc}\n
+{f(mults.strength_exp_mult - 1)} combat exp\n \n );\n } else {\n if (mults.strength_exp_mult)\n desc = (\n <>\n {desc}\n
+{f(mults.strength_exp_mult - 1)} strength exp\n \n );\n if (mults.defense_exp_mult)\n desc = (\n <>\n {desc}\n
+{f(mults.defense_exp_mult - 1)} defense exp\n \n );\n if (mults.dexterity_exp_mult)\n desc = (\n <>\n {desc}\n
+{f(mults.dexterity_exp_mult - 1)} dexterity exp\n \n );\n if (mults.agility_exp_mult)\n desc = (\n <>\n {desc}\n
+{f(mults.agility_exp_mult - 1)} agility exp\n \n );\n }\n if (mults.charisma_exp_mult)\n desc = (\n <>\n {desc}\n
+{f(mults.charisma_exp_mult - 1)} charisma exp\n \n );\n }\n\n if (mults.hacking_speed_mult)\n desc = (\n <>\n {desc}\n
+{f(mults.hacking_speed_mult - 1)} faster hack(), grow(), and weaken()\n \n );\n if (mults.hacking_chance_mult)\n desc = (\n <>\n {desc}\n
+{f(mults.hacking_chance_mult - 1)} hack() success chance\n \n );\n if (mults.hacking_money_mult)\n desc = (\n <>\n {desc}\n
+{f(mults.hacking_money_mult - 1)} hack() power\n \n );\n if (mults.hacking_grow_mult)\n desc = (\n <>\n {desc}\n
+{f(mults.hacking_grow_mult - 1)} grow() power\n \n );\n\n if (mults.faction_rep_mult && mults.faction_rep_mult === mults.company_rep_mult) {\n desc = (\n <>\n {desc}\n
+{f(mults.faction_rep_mult - 1)} reputation from factions and companies\n \n );\n } else {\n if (mults.faction_rep_mult)\n desc = (\n <>\n {desc}\n
+{f(mults.faction_rep_mult - 1)} reputation from factions\n \n );\n if (mults.company_rep_mult)\n desc = (\n <>\n {desc}\n
+{f(mults.company_rep_mult - 1)} reputation from companies\n \n );\n }\n\n if (mults.crime_money_mult)\n desc = (\n <>\n {desc}\n
+{f(mults.crime_money_mult - 1)} crime money\n \n );\n if (mults.crime_success_mult)\n desc = (\n <>\n {desc}\n
+{f(mults.crime_success_mult - 1)} crime success rate\n \n );\n if (mults.work_money_mult)\n desc = (\n <>\n {desc}\n
+{f(mults.work_money_mult - 1)} work money\n \n );\n\n if (mults.hacknet_node_money_mult)\n desc = (\n <>\n {desc}\n
+{f(mults.hacknet_node_money_mult - 1)} hacknet production\n \n );\n if (mults.hacknet_node_purchase_cost_mult)\n desc = (\n <>\n {desc}\n
-{f(-(mults.hacknet_node_purchase_cost_mult - 1))} hacknet nodes cost\n \n );\n if (mults.hacknet_node_level_cost_mult)\n desc = (\n <>\n {desc}\n
-{f(-(mults.hacknet_node_level_cost_mult - 1))} hacknet nodes upgrade cost\n \n );\n\n if (mults.bladeburner_max_stamina_mult)\n desc = (\n <>\n {desc}\n
+{f(mults.bladeburner_max_stamina_mult - 1)} Bladeburner Max Stamina\n \n );\n if (mults.bladeburner_stamina_gain_mult)\n desc = (\n <>\n {desc}\n
+{f(mults.bladeburner_stamina_gain_mult - 1)} Bladeburner Stamina gain\n \n );\n if (mults.bladeburner_analysis_mult)\n desc = (\n <>\n {desc}\n
+{f(mults.bladeburner_analysis_mult - 1)} Bladeburner Field Analysis effectiveness\n \n );\n if (mults.bladeburner_success_chance_mult)\n desc = (\n <>\n {desc}\n
+{f(mults.bladeburner_success_chance_mult - 1)} Bladeburner Contracts and Operations success chance\n \n );\n if (mults.infiltration_base_rep_increase)\n desc = (\n <>\n {desc}\n
+{f(mults.infiltration_base_rep_increase - 1)} Infiltration {FactionNames.ShadowsOfAnarchy} Reputation\n base reward\n \n );\n if (mults.infiltration_rep_mult)\n desc = (\n <>\n {desc}\n
+{f(mults.infiltration_rep_mult - 1)} Infiltration {FactionNames.ShadowsOfAnarchy} Reputation reward\n \n );\n if (mults.infiltration_trade_mult)\n desc = (\n <>\n {desc}\n
+{f(mults.infiltration_trade_mult - 1)} Infiltration Reputation for trading information\n \n );\n if (mults.infiltration_sell_mult)\n desc = (\n <>\n {desc}\n
+{f(mults.infiltration_sell_mult - 1)} Infiltration cash reward for selling information\n \n );\n if (mults.infiltration_timer_mult)\n desc = (\n <>\n {desc}\n
+{f(mults.infiltration_timer_mult - 1)} Infiltration time per minigame\n \n );\n if (mults.infiltration_damage_reduction_mult)\n desc = (\n <>\n {desc}\n
\n {f(mults.infiltration_damage_reduction_mult - 1)} Infiltration health lost per failed minigame\n \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: IMap = {};\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_mult) {\n this.mults.hacking_mult = params.hacking_mult;\n }\n if (params.strength_mult) {\n this.mults.strength_mult = params.strength_mult;\n }\n if (params.defense_mult) {\n this.mults.defense_mult = params.defense_mult;\n }\n if (params.dexterity_mult) {\n this.mults.dexterity_mult = params.dexterity_mult;\n }\n if (params.agility_mult) {\n this.mults.agility_mult = params.agility_mult;\n }\n if (params.charisma_mult) {\n this.mults.charisma_mult = params.charisma_mult;\n }\n if (params.hacking_exp_mult) {\n this.mults.hacking_exp_mult = params.hacking_exp_mult;\n }\n if (params.strength_exp_mult) {\n this.mults.strength_exp_mult = params.strength_exp_mult;\n }\n if (params.defense_exp_mult) {\n this.mults.defense_exp_mult = params.defense_exp_mult;\n }\n if (params.dexterity_exp_mult) {\n this.mults.dexterity_exp_mult = params.dexterity_exp_mult;\n }\n if (params.agility_exp_mult) {\n this.mults.agility_exp_mult = params.agility_exp_mult;\n }\n if (params.charisma_exp_mult) {\n this.mults.charisma_exp_mult = params.charisma_exp_mult;\n }\n if (params.hacking_chance_mult) {\n this.mults.hacking_chance_mult = params.hacking_chance_mult;\n }\n if (params.hacking_speed_mult) {\n this.mults.hacking_speed_mult = params.hacking_speed_mult;\n }\n if (params.hacking_money_mult) {\n this.mults.hacking_money_mult = params.hacking_money_mult;\n }\n if (params.hacking_grow_mult) {\n this.mults.hacking_grow_mult = params.hacking_grow_mult;\n }\n if (params.company_rep_mult) {\n this.mults.company_rep_mult = params.company_rep_mult;\n }\n if (params.faction_rep_mult) {\n this.mults.faction_rep_mult = params.faction_rep_mult;\n }\n if (params.crime_money_mult) {\n this.mults.crime_money_mult = params.crime_money_mult;\n }\n if (params.crime_success_mult) {\n this.mults.crime_success_mult = params.crime_success_mult;\n }\n if (params.work_money_mult) {\n this.mults.work_money_mult = params.work_money_mult;\n }\n if (params.hacknet_node_money_mult) {\n this.mults.hacknet_node_money_mult = params.hacknet_node_money_mult;\n }\n if (params.hacknet_node_purchase_cost_mult) {\n this.mults.hacknet_node_purchase_cost_mult = params.hacknet_node_purchase_cost_mult;\n }\n if (params.hacknet_node_ram_cost_mult) {\n this.mults.hacknet_node_ram_cost_mult = params.hacknet_node_ram_cost_mult;\n }\n if (params.hacknet_node_core_cost_mult) {\n this.mults.hacknet_node_core_cost_mult = params.hacknet_node_core_cost_mult;\n }\n if (params.hacknet_node_level_cost_mult) {\n this.mults.hacknet_node_level_cost_mult = params.hacknet_node_level_cost_mult;\n }\n if (params.bladeburner_max_stamina_mult) {\n this.mults.bladeburner_max_stamina_mult = params.bladeburner_max_stamina_mult;\n }\n if (params.bladeburner_stamina_gain_mult) {\n this.mults.bladeburner_stamina_gain_mult = params.bladeburner_stamina_gain_mult;\n }\n if (params.bladeburner_analysis_mult) {\n this.mults.bladeburner_analysis_mult = params.bladeburner_analysis_mult;\n }\n if (params.bladeburner_success_chance_mult) {\n this.mults.bladeburner_success_chance_mult = params.bladeburner_success_chance_mult;\n }\n\n if (params.infiltration_base_rep_increase) {\n this.mults.infiltration_base_rep_increase = params.infiltration_base_rep_increase;\n }\n if (params.infiltration_rep_mult) {\n this.mults.infiltration_rep_mult = params.infiltration_rep_mult;\n }\n if (params.infiltration_trade_mult) {\n this.mults.infiltration_trade_mult = params.infiltration_trade_mult;\n }\n if (params.infiltration_sell_mult) {\n this.mults.infiltration_sell_mult = params.infiltration_sell_mult;\n }\n if (params.infiltration_timer_mult) {\n this.mults.infiltration_timer_mult = params.infiltration_timer_mult;\n }\n if (params.infiltration_damage_reduction_mult) {\n this.mults.infiltration_damage_reduction_mult = params.infiltration_damage_reduction_mult;\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(): any {\n return Generic_toJSON(\"Augmentation\", this);\n }\n\n // Initiatizes a Augmentation object from a JSON save state.\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): 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","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 DividendMaxPercentage: number;\n EmployeeSalaryMultiplier: number;\n CyclesPerEmployeeRaise: number;\n EmployeeRaiseAmount: number;\n BaseMaxProducts: number;\n AllCorporationStates: string[];\n AllMaterials: 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 DividendMaxPercentage: 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 FundingRoundShares: [0.1, 0.35, 0.25, 0.2],\n FundingRoundMultiplier: [4, 3, 3, 2.5],\n\n AvgProfitLength: 1,\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","// 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 { 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 { determineCrimeSuccess } from \"../../Crime/CrimeHelpers\";\nimport { Crimes } from \"../../Crime/Crimes\";\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 {\n calculateSkill as calculateSkillF,\n calculateSkillProgress as calculateSkillProgressF,\n ISkillProgress,\n} from \"../formulas/skill\";\nimport { calculateIntelligenceBonus } from \"../formulas/intelligence\";\nimport {\n getHackingWorkRepGain,\n getFactionSecurityWorkRepGain,\n getFactionFieldWorkRepGain,\n} from \"../formulas/reputation\";\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 { influenceStockThroughCompanyWork } from \"../../StockMarket/PlayerInfluencing\";\nimport { getHospitalizationCost } from \"../../Hospital/Hospital\";\nimport { WorkerScript } from \"../../Netscript/WorkerScript\";\nimport { HacknetServer } from \"../../Hacknet/HacknetServer\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { IRouter } from \"../../ui/Router\";\nimport { MoneySourceTracker } from \"../../utils/MoneySourceTracker\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\n\nimport { Reputation } from \"../../ui/React/Reputation\";\nimport { Money } from \"../../ui/React/Money\";\n\nimport React from \"react\";\nimport { serverMetadata } from \"../../Server/data/servers\";\nimport { SnackbarEvents, ToastVariant } from \"../../ui/React/Snackbar\";\nimport { calculateClassEarnings } from \"../formulas/work\";\nimport { achievements } from \"../../Achievements/Achievements\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\nimport { ITaskTracker } from \"../ITaskTracker\";\nimport { IPerson } from \"../IPerson\";\nimport { Player } from \"../../Player\";\nimport { graftingIntBonus } from \"../Grafting/GraftingHelpers\";\n\nimport { WorkType, PlayerFactionWorkType, ClassType, CrimeType } from \"../../utils/WorkType\";\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.hacking = 1;\n\n this.strength = 1;\n this.defense = 1;\n this.dexterity = 1;\n this.agility = 1;\n\n this.charisma = 1;\n\n this.hacking_exp = 0;\n this.strength_exp = 0;\n this.defense_exp = 0;\n this.dexterity_exp = 0;\n this.agility_exp = 0;\n this.charisma_exp = 0;\n\n this.money = 1000 + CONSTANTS.Donations;\n\n this.city = CityName.Sector12;\n this.location = LocationName.TravelAgency;\n\n this.companyName = \"\";\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.isWorking = false;\n this.currentWorkFactionName = \"\";\n this.currentWorkFactionDescription = \"\";\n this.createProgramName = \"\";\n this.className = ClassType.None;\n this.crimeType = CrimeType.None;\n\n this.workHackExpGainRate = 0;\n this.workStrExpGainRate = 0;\n this.workDefExpGainRate = 0;\n this.workDexExpGainRate = 0;\n this.workAgiExpGainRate = 0;\n this.workChaExpGainRate = 0;\n this.workRepGainRate = 0;\n this.workMoneyGainRate = 0;\n\n this.workHackExpGained = 0;\n this.workStrExpGained = 0;\n this.workDefExpGained = 0;\n this.workDexExpGained = 0;\n this.workAgiExpGained = 0;\n this.workChaExpGained = 0;\n this.workRepGained = 0;\n this.workMoneyGained = 0;\n\n this.timeWorked = 0;\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 = this.max_hp;\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 this.timeWorked = 0;\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.hacking = Math.max(\n 1,\n Math.floor(this.calculateSkill(this.hacking_exp, this.hacking_mult * BitNodeMultipliers.HackingLevelMultiplier)),\n );\n this.strength = Math.max(\n 1,\n Math.floor(this.calculateSkill(this.strength_exp, this.strength_mult * BitNodeMultipliers.StrengthLevelMultiplier)),\n );\n this.defense = Math.max(\n 1,\n Math.floor(this.calculateSkill(this.defense_exp, this.defense_mult * BitNodeMultipliers.DefenseLevelMultiplier)),\n );\n this.dexterity = Math.max(\n 1,\n Math.floor(\n this.calculateSkill(this.dexterity_exp, this.dexterity_mult * BitNodeMultipliers.DexterityLevelMultiplier),\n ),\n );\n this.agility = Math.max(\n 1,\n Math.floor(this.calculateSkill(this.agility_exp, this.agility_mult * BitNodeMultipliers.AgilityLevelMultiplier)),\n );\n this.charisma = Math.max(\n 1,\n Math.floor(this.calculateSkill(this.charisma_exp, this.charisma_mult * BitNodeMultipliers.CharismaLevelMultiplier)),\n );\n\n if (this.intelligence > 0) {\n this.intelligence = Math.floor(this.calculateSkill(this.intelligence_exp));\n } else {\n this.intelligence = 0;\n }\n\n const ratio = this.hp / this.max_hp;\n this.max_hp = Math.floor(10 + this.defense / 10);\n this.hp = Math.round(this.max_hp * ratio);\n}\n\nexport function resetMultipliers(this: IPlayer): void {\n this.hacking_chance_mult = 1;\n this.hacking_speed_mult = 1;\n this.hacking_money_mult = 1;\n this.hacking_grow_mult = 1;\n\n this.hacking_mult = 1;\n this.strength_mult = 1;\n this.defense_mult = 1;\n this.dexterity_mult = 1;\n this.agility_mult = 1;\n this.charisma_mult = 1;\n\n this.hacking_exp_mult = 1;\n this.strength_exp_mult = 1;\n this.defense_exp_mult = 1;\n this.dexterity_exp_mult = 1;\n this.agility_exp_mult = 1;\n this.charisma_exp_mult = 1;\n\n this.company_rep_mult = 1;\n this.faction_rep_mult = 1;\n\n this.crime_money_mult = 1;\n this.crime_success_mult = 1;\n\n this.hacknet_node_money_mult = 1;\n this.hacknet_node_purchase_cost_mult = 1;\n this.hacknet_node_ram_cost_mult = 1;\n this.hacknet_node_core_cost_mult = 1;\n this.hacknet_node_level_cost_mult = 1;\n\n this.work_money_mult = 1;\n\n this.bladeburner_max_stamina_mult = 1;\n this.bladeburner_stamina_gain_mult = 1;\n this.bladeburner_analysis_mult = 1;\n this.bladeburner_success_chance_mult = 1;\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.hacking_exp += exp;\n if (this.hacking_exp < 0) {\n this.hacking_exp = 0;\n }\n\n this.hacking = calculateSkillF(this.hacking_exp, this.hacking_mult * BitNodeMultipliers.HackingLevelMultiplier);\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.strength_exp += exp;\n if (this.strength_exp < 0) {\n this.strength_exp = 0;\n }\n\n this.strength = calculateSkillF(this.strength_exp, this.strength_mult * BitNodeMultipliers.StrengthLevelMultiplier);\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.defense_exp += exp;\n if (this.defense_exp < 0) {\n this.defense_exp = 0;\n }\n\n this.defense = calculateSkillF(this.defense_exp, this.defense_mult * BitNodeMultipliers.DefenseLevelMultiplier);\n const ratio = this.hp / this.max_hp;\n this.max_hp = Math.floor(10 + this.defense / 10);\n this.hp = Math.round(this.max_hp * 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.dexterity_exp += exp;\n if (this.dexterity_exp < 0) {\n this.dexterity_exp = 0;\n }\n\n this.dexterity = calculateSkillF(\n this.dexterity_exp,\n this.dexterity_mult * 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.agility_exp += exp;\n if (this.agility_exp < 0) {\n this.agility_exp = 0;\n }\n\n this.agility = calculateSkillF(this.agility_exp, this.agility_mult * BitNodeMultipliers.AgilityLevelMultiplier);\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.charisma_exp += exp;\n if (this.charisma_exp < 0) {\n this.charisma_exp = 0;\n }\n\n this.charisma = calculateSkillF(this.charisma_exp, this.charisma_mult * BitNodeMultipliers.CharismaLevelMultiplier);\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.intelligence > 0) {\n this.intelligence_exp += exp;\n this.intelligence = Math.floor(this.calculateSkill(this.intelligence_exp, 1));\n }\n}\n\nexport function gainStats(this: IPerson, retValue: ITaskTracker): void {\n this.gainHackingExp(retValue.hack * this.hacking_exp_mult);\n this.gainStrengthExp(retValue.str * this.strength_exp_mult);\n this.gainDefenseExp(retValue.def * this.defense_exp_mult);\n this.gainDexterityExp(retValue.dex * this.dexterity_exp_mult);\n this.gainAgilityExp(retValue.agi * this.agility_exp_mult);\n this.gainCharismaExp(retValue.cha * this.charisma_exp_mult);\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.hacking;\n }\n if (tempStr.includes(\"str\")) {\n return this.strength;\n }\n if (tempStr.includes(\"def\")) {\n return this.defense;\n }\n if (tempStr.includes(\"dex\")) {\n return this.dexterity;\n }\n if (tempStr.includes(\"agi\")) {\n return this.agility;\n }\n if (tempStr.includes(\"cha\")) {\n return this.charisma;\n }\n if (tempStr.includes(\"int\")) {\n return this.intelligence;\n }\n return 0;\n}\n\n/******* Working functions *******/\nexport function resetWorkStatus(this: IPlayer, generalType?: WorkType, group?: string, workType?: string): void {\n if (this.workType !== WorkType.Faction && generalType === this.workType && group === this.companyName) return;\n if (generalType === this.workType && group === this.currentWorkFactionName && workType === this.factionWorkType)\n return;\n if (this.isWorking) this.singularityStopWork();\n this.workHackExpGainRate = 0;\n this.workStrExpGainRate = 0;\n this.workDefExpGainRate = 0;\n this.workDexExpGainRate = 0;\n this.workAgiExpGainRate = 0;\n this.workChaExpGainRate = 0;\n this.workRepGainRate = 0;\n this.workMoneyGainRate = 0;\n this.workMoneyLossRate = 0;\n\n this.workHackExpGained = 0;\n this.workStrExpGained = 0;\n this.workDefExpGained = 0;\n this.workDexExpGained = 0;\n this.workAgiExpGained = 0;\n this.workChaExpGained = 0;\n this.workRepGained = 0;\n this.workMoneyGained = 0;\n\n this.timeWorked = 0;\n this.timeWorkedCreateProgram = 0;\n this.timeWorkedGraftAugmentation = 0;\n\n this.currentWorkFactionName = \"\";\n this.currentWorkFactionDescription = \"\";\n this.createProgramName = \"\";\n this.graftAugmentationName = \"\";\n this.className = ClassType.None;\n this.workType = WorkType.None;\n}\n\nexport function processWorkEarnings(this: IPlayer, numCycles = 1): void {\n let focusBonus = 1;\n if (!this.hasAugmentation(AugmentationNames[\"NeuroreceptorManager\"])) {\n focusBonus = this.focus ? 1 : CONSTANTS.BaseFocusBonus;\n }\n const hackExpGain = focusBonus * this.workHackExpGainRate * numCycles;\n const strExpGain = focusBonus * this.workStrExpGainRate * numCycles;\n const defExpGain = focusBonus * this.workDefExpGainRate * numCycles;\n const dexExpGain = focusBonus * this.workDexExpGainRate * numCycles;\n const agiExpGain = focusBonus * this.workAgiExpGainRate * numCycles;\n const chaExpGain = focusBonus * this.workChaExpGainRate * numCycles;\n const moneyGain = (this.workMoneyGainRate - this.workMoneyLossRate) * numCycles;\n this.gainHackingExp(hackExpGain);\n this.gainStrengthExp(strExpGain);\n this.gainDefenseExp(defExpGain);\n this.gainDexterityExp(dexExpGain);\n this.gainAgilityExp(agiExpGain);\n this.gainCharismaExp(chaExpGain);\n this.gainMoney(moneyGain, this.className ? \"class\" : \"work\");\n this.workHackExpGained += hackExpGain;\n this.workStrExpGained += strExpGain;\n this.workDefExpGained += defExpGain;\n this.workDexExpGained += dexExpGain;\n this.workAgiExpGained += agiExpGain;\n this.workChaExpGained += chaExpGain;\n this.workRepGained += focusBonus * this.workRepGainRate * numCycles;\n this.workMoneyGained += focusBonus * this.workMoneyGainRate * numCycles;\n this.workMoneyGained -= focusBonus * this.workMoneyLossRate * numCycles;\n}\n\n/* Working for Company */\nexport function startWork(this: IPlayer, companyName: string): void {\n this.resetWorkStatus(WorkType.Company, companyName);\n this.isWorking = true;\n this.companyName = companyName;\n this.workType = WorkType.Company;\n\n this.workHackExpGainRate = this.getWorkHackExpGain();\n this.workStrExpGainRate = this.getWorkStrExpGain();\n this.workDefExpGainRate = this.getWorkDefExpGain();\n this.workDexExpGainRate = this.getWorkDexExpGain();\n this.workAgiExpGainRate = this.getWorkAgiExpGain();\n this.workChaExpGainRate = this.getWorkChaExpGain();\n this.workRepGainRate = this.getWorkRepGain();\n this.workMoneyGainRate = this.getWorkMoneyGain();\n\n this.timeNeededToCompleteWork = CONSTANTS.MillisecondsPer8Hours;\n}\n\nexport function process(this: IPlayer, router: IRouter, numCycles = 1): void {\n // Working\n if (this.isWorking) {\n if (this.workType === WorkType.Faction) {\n if (this.workForFaction(numCycles)) {\n router.toFaction(Factions[this.currentWorkFactionName]);\n }\n } else if (this.workType === WorkType.CreateProgram) {\n if (this.createProgramWork(numCycles)) {\n router.toTerminal();\n }\n } else if (this.workType === WorkType.StudyClass) {\n if (this.takeClass(numCycles)) {\n router.toCity();\n }\n } else if (this.workType === WorkType.Crime) {\n if (this.commitCrime(numCycles)) {\n router.toLocation(Locations[LocationName.Slums]);\n }\n } else if (this.workType === WorkType.CompanyPartTime) {\n if (this.workPartTime(numCycles)) {\n router.toCity();\n }\n } else if (this.workType === WorkType.GraftAugmentation) {\n if (this.graftAugmentationWork(numCycles)) {\n router.toGrafting();\n }\n } else if (this.work(numCycles)) {\n router.toCity();\n }\n }\n}\n\nexport function cancelationPenalty(this: IPlayer): number {\n const data = serverMetadata.find((s) => s.specialName === this.companyName);\n if (!data) return 0.5; // Does not have special server.\n const server = GetServer(data.hostname);\n if (server instanceof Server) {\n if (server && server.backdoorInstalled) return 0.75;\n }\n\n return 0.5;\n}\n\nexport function work(this: IPlayer, numCycles: number): boolean {\n // Cap the number of cycles being processed to whatever would put you at\n // the work time limit (8 hours)\n let overMax = false;\n if (this.timeWorked + CONSTANTS._idleSpeed * numCycles >= CONSTANTS.MillisecondsPer8Hours) {\n overMax = true;\n numCycles = Math.round((CONSTANTS.MillisecondsPer8Hours - this.timeWorked) / CONSTANTS._idleSpeed);\n }\n this.timeWorked += CONSTANTS._idleSpeed * numCycles;\n\n this.workRepGainRate = this.getWorkRepGain();\n this.workMoneyGainRate = this.getWorkMoneyGain();\n this.processWorkEarnings(numCycles);\n\n const comp = Companies[this.companyName];\n influenceStockThroughCompanyWork(comp, this.workRepGainRate, numCycles);\n\n // If timeWorked == 8 hours, then finish. You can only gain 8 hours worth of exp and money\n if (overMax || this.timeWorked >= CONSTANTS.MillisecondsPer8Hours) {\n this.finishWork(false);\n return true;\n }\n return false;\n}\n\nexport function finishWork(this: IPlayer, cancelled: boolean, sing = false): string {\n //Since the work was cancelled early, player only gains half of what they've earned so far\n if (cancelled) {\n this.workRepGained *= this.cancelationPenalty();\n }\n\n const penaltyString = this.cancelationPenalty() === 0.5 ? \"half\" : \"three-quarters\";\n\n const company = Companies[this.companyName];\n company.playerReputation += this.workRepGained;\n\n this.updateSkillLevels();\n\n let content = (\n <>\n You earned a total of:
\n \n
\n reputation for the company
\n {this.workHackExpGained > 0 && (\n <>\n {numeralWrapper.formatExp(this.workHackExpGained)} hacking exp
\n \n )}\n {this.workStrExpGained > 0 && (\n <>\n {numeralWrapper.formatExp(this.workStrExpGained)} strength exp
\n \n )}\n {this.workDefExpGained > 0 && (\n <>\n {numeralWrapper.formatExp(this.workDefExpGained)} defense exp
\n \n )}\n {this.workDexExpGained > 0 && (\n <>\n {numeralWrapper.formatExp(this.workDexExpGained)} dexterity exp
\n \n )}\n {this.workAgiExpGained > 0 && (\n <>\n {numeralWrapper.formatExp(this.workAgiExpGained)} agility exp
\n \n )}\n {this.workChaExpGained > 0 && (\n <>\n {numeralWrapper.formatExp(this.workChaExpGained)} charisma exp
\n \n )}\n
\n \n );\n\n if (cancelled) {\n content = (\n <>\n You worked a short shift of {convertTimeMsToTimeElapsedString(this.timeWorked)}
\n
\n Since you cancelled your work early, you only gained {penaltyString} of the reputation you earned.
\n
\n {content}\n \n );\n } else {\n content = (\n <>\n You worked a full shift of 8 hours!
\n
\n {content}\n \n );\n }\n if (!sing) {\n dialogBoxCreate(content);\n }\n\n this.isWorking = false;\n this.focus = false;\n\n this.resetWorkStatus();\n if (sing) {\n const res =\n \"You worked a short shift of \" +\n convertTimeMsToTimeElapsedString(this.timeWorked) +\n \" and \" +\n \"earned $\" +\n numeralWrapper.formatMoney(this.workMoneyGained) +\n \", \" +\n numeralWrapper.formatReputation(this.workRepGained) +\n \" reputation, \" +\n numeralWrapper.formatExp(this.workHackExpGained) +\n \" hacking exp, \" +\n numeralWrapper.formatExp(this.workStrExpGained) +\n \" strength exp, \" +\n numeralWrapper.formatExp(this.workDefExpGained) +\n \" defense exp, \" +\n numeralWrapper.formatExp(this.workDexExpGained) +\n \" dexterity exp, \" +\n numeralWrapper.formatExp(this.workAgiExpGained) +\n \" agility exp, and \" +\n numeralWrapper.formatExp(this.workChaExpGained) +\n \" charisma exp.\";\n\n return res;\n }\n\n return \"\";\n}\n\nexport function startWorkPartTime(this: IPlayer, companyName: string): void {\n this.resetWorkStatus(WorkType.CompanyPartTime, companyName);\n this.isWorking = true;\n this.companyName = companyName;\n this.workType = WorkType.CompanyPartTime;\n\n this.workHackExpGainRate = this.getWorkHackExpGain();\n this.workStrExpGainRate = this.getWorkStrExpGain();\n this.workDefExpGainRate = this.getWorkDefExpGain();\n this.workDexExpGainRate = this.getWorkDexExpGain();\n this.workAgiExpGainRate = this.getWorkAgiExpGain();\n this.workChaExpGainRate = this.getWorkChaExpGain();\n this.workRepGainRate = this.getWorkRepGain();\n this.workMoneyGainRate = this.getWorkMoneyGain();\n\n this.timeNeededToCompleteWork = CONSTANTS.MillisecondsPer8Hours;\n}\n\nexport function workPartTime(this: IPlayer, numCycles: number): boolean {\n //Cap the number of cycles being processed to whatever would put you at the\n //work time limit (8 hours)\n let overMax = false;\n if (this.timeWorked + CONSTANTS._idleSpeed * numCycles >= CONSTANTS.MillisecondsPer8Hours) {\n overMax = true;\n numCycles = Math.round((CONSTANTS.MillisecondsPer8Hours - this.timeWorked) / CONSTANTS._idleSpeed);\n }\n this.timeWorked += CONSTANTS._idleSpeed * numCycles;\n\n this.workRepGainRate = this.getWorkRepGain();\n this.processWorkEarnings(numCycles);\n\n //If timeWorked == 8 hours, then finish. You can only gain 8 hours worth of exp and money\n if (overMax || this.timeWorked >= CONSTANTS.MillisecondsPer8Hours) {\n this.finishWorkPartTime();\n return true;\n }\n return false;\n}\n\nexport function finishWorkPartTime(this: IPlayer, sing = false): string {\n const company = Companies[this.companyName];\n company.playerReputation += this.workRepGained;\n\n this.updateSkillLevels();\n\n const content = (\n <>\n You worked for {convertTimeMsToTimeElapsedString(this.timeWorked)}\n
\n
\n You earned a total of:
\n \n
\n reputation for the company
\n {numeralWrapper.formatExp(this.workHackExpGained)} hacking exp
\n {numeralWrapper.formatExp(this.workStrExpGained)} strength exp
\n {numeralWrapper.formatExp(this.workDefExpGained)} defense exp
\n {numeralWrapper.formatExp(this.workDexExpGained)} dexterity exp
\n {numeralWrapper.formatExp(this.workAgiExpGained)} agility exp
\n {numeralWrapper.formatExp(this.workChaExpGained)} charisma exp\n
\n \n );\n if (!sing) {\n dialogBoxCreate(content);\n }\n\n this.isWorking = false;\n this.resetWorkStatus();\n\n if (sing) {\n const res =\n \"You worked for \" +\n convertTimeMsToTimeElapsedString(this.timeWorked) +\n \" and \" +\n \"earned a total of \" +\n \"$\" +\n numeralWrapper.formatMoney(this.workMoneyGained) +\n \", \" +\n numeralWrapper.formatReputation(this.workRepGained) +\n \" reputation, \" +\n numeralWrapper.formatExp(this.workHackExpGained) +\n \" hacking exp, \" +\n numeralWrapper.formatExp(this.workStrExpGained) +\n \" strength exp, \" +\n numeralWrapper.formatExp(this.workDefExpGained) +\n \" defense exp, \" +\n numeralWrapper.formatExp(this.workDexExpGained) +\n \" dexterity exp, \" +\n numeralWrapper.formatExp(this.workAgiExpGained) +\n \" agility exp, and \" +\n numeralWrapper.formatExp(this.workChaExpGained) +\n \" charisma exp\";\n return res;\n }\n return \"\";\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/* Working for Faction */\nexport function startFactionWork(this: IPlayer, faction: Faction): void {\n //Update reputation gain rate to account for faction favor\n let favorMult = 1 + faction.favor / 100;\n if (isNaN(favorMult)) {\n favorMult = 1;\n }\n this.workRepGainRate *= favorMult;\n this.workRepGainRate *= BitNodeMultipliers.FactionWorkRepGain;\n\n this.isWorking = true;\n this.workType = WorkType.Faction;\n this.currentWorkFactionName = faction.name;\n\n this.timeNeededToCompleteWork = CONSTANTS.MillisecondsPer20Hours;\n}\n\nexport function startFactionHackWork(this: IPlayer, faction: Faction): void {\n this.resetWorkStatus(WorkType.Faction, faction.name, PlayerFactionWorkType.Hacking);\n\n this.workHackExpGainRate = 0.15 * this.hacking_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.workRepGainRate = getHackingWorkRepGain(this, faction);\n\n this.factionWorkType = PlayerFactionWorkType.Hacking;\n this.currentWorkFactionDescription = \"carrying out hacking contracts\";\n\n this.startFactionWork(faction);\n}\n\nexport function startFactionFieldWork(this: IPlayer, faction: Faction): void {\n this.resetWorkStatus(WorkType.Faction, faction.name, PlayerFactionWorkType.Field);\n\n this.workHackExpGainRate = 0.1 * this.hacking_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.workStrExpGainRate = 0.1 * this.strength_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.workDefExpGainRate = 0.1 * this.defense_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.workDexExpGainRate = 0.1 * this.dexterity_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.workAgiExpGainRate = 0.1 * this.agility_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.workChaExpGainRate = 0.1 * this.charisma_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.workRepGainRate = getFactionFieldWorkRepGain(this, faction);\n\n this.factionWorkType = PlayerFactionWorkType.Field;\n this.currentWorkFactionDescription = \"carrying out field missions\";\n\n this.startFactionWork(faction);\n}\n\nexport function startFactionSecurityWork(this: IPlayer, faction: Faction): void {\n this.resetWorkStatus(WorkType.Faction, faction.name, PlayerFactionWorkType.Security);\n\n this.workHackExpGainRate = 0.05 * this.hacking_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.workStrExpGainRate = 0.15 * this.strength_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.workDefExpGainRate = 0.15 * this.defense_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.workDexExpGainRate = 0.15 * this.dexterity_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.workAgiExpGainRate = 0.15 * this.agility_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.workChaExpGainRate = 0.0 * this.charisma_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.workRepGainRate = getFactionSecurityWorkRepGain(this, faction);\n\n this.factionWorkType = PlayerFactionWorkType.Security;\n this.currentWorkFactionDescription = \"performing security detail\";\n\n this.startFactionWork(faction);\n}\n\nexport function workForFaction(this: IPlayer, numCycles: number): boolean {\n const faction = Factions[this.currentWorkFactionName];\n\n if (!faction) {\n return false;\n }\n\n //Constantly update the rep gain rate\n switch (this.factionWorkType) {\n case PlayerFactionWorkType.Hacking:\n this.workRepGainRate = getHackingWorkRepGain(this, faction);\n break;\n case PlayerFactionWorkType.Field:\n this.workRepGainRate = getFactionFieldWorkRepGain(this, faction);\n break;\n case PlayerFactionWorkType.Security:\n this.workRepGainRate = getFactionSecurityWorkRepGain(this, faction);\n break;\n default:\n break;\n }\n this.workRepGainRate *= BitNodeMultipliers.FactionWorkRepGain;\n\n //Cap the number of cycles being processed to whatever would put you at limit (20 hours)\n let overMax = false;\n if (this.timeWorked + CONSTANTS._idleSpeed * numCycles >= CONSTANTS.MillisecondsPer20Hours) {\n overMax = true;\n numCycles = Math.round((CONSTANTS.MillisecondsPer20Hours - this.timeWorked) / CONSTANTS._idleSpeed);\n }\n this.timeWorked += CONSTANTS._idleSpeed * numCycles;\n\n this.processWorkEarnings(numCycles);\n\n //If timeWorked == 20 hours, then finish. You can only work for the faction for 20 hours\n if (overMax || this.timeWorked >= CONSTANTS.MillisecondsPer20Hours) {\n this.finishFactionWork(false);\n return true;\n }\n return false;\n}\n\nexport function finishFactionWork(this: IPlayer, cancelled: boolean, sing = false): string {\n const faction = Factions[this.currentWorkFactionName];\n faction.playerReputation += this.workRepGained;\n\n this.updateSkillLevels();\n let res = \"\";\n\n if (!sing) {\n dialogBoxCreate(\n <>\n You worked for your faction {faction.name} for a total of {convertTimeMsToTimeElapsedString(this.timeWorked)}{\" \"}\n
\n
\n You earned a total of:
\n \n
\n reputation for the faction
\n {numeralWrapper.formatExp(this.workHackExpGained)} hacking exp
\n {numeralWrapper.formatExp(this.workStrExpGained)} strength exp
\n {numeralWrapper.formatExp(this.workDefExpGained)} defense exp
\n {numeralWrapper.formatExp(this.workDexExpGained)} dexterity exp
\n {numeralWrapper.formatExp(this.workAgiExpGained)} agility exp
\n {numeralWrapper.formatExp(this.workChaExpGained)} charisma exp\n
\n ,\n );\n } else {\n res =\n \"You worked for your faction \" +\n faction.name +\n \" for a total of \" +\n convertTimeMsToTimeElapsedString(this.timeWorked) +\n \". \" +\n \"You earned \" +\n numeralWrapper.formatReputation(this.workRepGained) +\n \" rep, \" +\n numeralWrapper.formatExp(this.workHackExpGained) +\n \" hacking exp, \" +\n numeralWrapper.formatExp(this.workStrExpGained) +\n \" str exp, \" +\n numeralWrapper.formatExp(this.workDefExpGained) +\n \" def exp, \" +\n numeralWrapper.formatExp(this.workDexExpGained) +\n \" dex exp, \" +\n numeralWrapper.formatExp(this.workAgiExpGained) +\n \" agi exp, and \" +\n numeralWrapper.formatExp(this.workChaExpGained) +\n \" cha exp.\";\n }\n\n this.isWorking = false;\n this.resetWorkStatus();\n return res;\n}\n\n//Money gained per game cycle\nexport function getWorkMoneyGain(this: IPlayer): number {\n // If player has SF-11, calculate salary multiplier from favor\n let bn11Mult = 1;\n const company = Companies[this.companyName];\n if (this.sourceFileLvl(11) > 0) {\n bn11Mult = 1 + company.favor / 100;\n }\n\n // Get base salary\n const companyPositionName = this.jobs[this.companyName];\n const companyPosition = CompanyPositions[companyPositionName];\n if (companyPosition == null) {\n console.error(`Could not find CompanyPosition object for ${companyPositionName}. Work salary will be 0`);\n return 0;\n }\n\n return (\n companyPosition.baseSalary *\n company.salaryMultiplier *\n this.work_money_mult *\n BitNodeMultipliers.CompanyWorkMoney *\n bn11Mult\n );\n}\n\n//Hack exp gained per game cycle\nexport function getWorkHackExpGain(this: IPlayer): number {\n const company = Companies[this.companyName];\n const companyPositionName = this.jobs[this.companyName];\n const companyPosition = CompanyPositions[companyPositionName];\n if (company == null || companyPosition == null) {\n console.error(\n [\n `Could not find Company object for ${this.companyName}`,\n `or CompanyPosition object for ${companyPositionName}.`,\n `Work hack exp gain will be 0`,\n ].join(\" \"),\n );\n return 0;\n }\n\n return (\n companyPosition.hackingExpGain *\n company.expMultiplier *\n this.hacking_exp_mult *\n BitNodeMultipliers.CompanyWorkExpGain\n );\n}\n\n//Str exp gained per game cycle\nexport function getWorkStrExpGain(this: IPlayer): number {\n const company = Companies[this.companyName];\n const companyPositionName = this.jobs[this.companyName];\n const companyPosition = CompanyPositions[companyPositionName];\n if (company == null || companyPosition == null) {\n console.error(\n [\n `Could not find Company object for ${this.companyName}`,\n `or CompanyPosition object for ${companyPositionName}.`,\n `Work str exp gain will be 0`,\n ].join(\" \"),\n );\n return 0;\n }\n\n return (\n companyPosition.strengthExpGain *\n company.expMultiplier *\n this.strength_exp_mult *\n BitNodeMultipliers.CompanyWorkExpGain\n );\n}\n\n//Def exp gained per game cycle\nexport function getWorkDefExpGain(this: IPlayer): number {\n const company = Companies[this.companyName];\n const companyPositionName = this.jobs[this.companyName];\n const companyPosition = CompanyPositions[companyPositionName];\n if (company == null || companyPosition == null) {\n console.error(\n [\n `Could not find Company object for ${this.companyName}`,\n `or CompanyPosition object for ${companyPositionName}.`,\n `Work def exp gain will be 0`,\n ].join(\" \"),\n );\n return 0;\n }\n\n return (\n companyPosition.defenseExpGain *\n company.expMultiplier *\n this.defense_exp_mult *\n BitNodeMultipliers.CompanyWorkExpGain\n );\n}\n\n//Dex exp gained per game cycle\nexport function getWorkDexExpGain(this: IPlayer): number {\n const company = Companies[this.companyName];\n const companyPositionName = this.jobs[this.companyName];\n const companyPosition = CompanyPositions[companyPositionName];\n if (company == null || companyPosition == null) {\n console.error(\n [\n `Could not find Company object for ${this.companyName}`,\n `or CompanyPosition object for ${companyPositionName}.`,\n `Work dex exp gain will be 0`,\n ].join(\" \"),\n );\n return 0;\n }\n\n return (\n companyPosition.dexterityExpGain *\n company.expMultiplier *\n this.dexterity_exp_mult *\n BitNodeMultipliers.CompanyWorkExpGain\n );\n}\n\n//Agi exp gained per game cycle\nexport function getWorkAgiExpGain(this: IPlayer): number {\n const company = Companies[this.companyName];\n const companyPositionName = this.jobs[this.companyName];\n const companyPosition = CompanyPositions[companyPositionName];\n if (company == null || companyPosition == null) {\n console.error(\n [\n `Could not find Company object for ${this.companyName}`,\n `or CompanyPosition object for ${companyPositionName}.`,\n `Work agi exp gain will be 0`,\n ].join(\" \"),\n );\n return 0;\n }\n\n return (\n companyPosition.agilityExpGain *\n company.expMultiplier *\n this.agility_exp_mult *\n BitNodeMultipliers.CompanyWorkExpGain\n );\n}\n\n//Charisma exp gained per game cycle\nexport function getWorkChaExpGain(this: IPlayer): number {\n const company = Companies[this.companyName];\n const companyPositionName = this.jobs[this.companyName];\n const companyPosition = CompanyPositions[companyPositionName];\n if (company == null || companyPosition == null) {\n console.error(\n [\n `Could not find Company object for ${this.companyName}`,\n `or CompanyPosition object for ${companyPositionName}.`,\n `Work cha exp gain will be 0`,\n ].join(\" \"),\n );\n return 0;\n }\n\n return (\n companyPosition.charismaExpGain *\n company.expMultiplier *\n this.charisma_exp_mult *\n BitNodeMultipliers.CompanyWorkExpGain\n );\n}\n\n//Reputation gained per game cycle\nexport function getWorkRepGain(this: IPlayer): number {\n const company = Companies[this.companyName];\n const companyPositionName = this.jobs[this.companyName];\n const companyPosition = CompanyPositions[companyPositionName];\n if (company == null || companyPosition == null) {\n console.error(\n [\n `Could not find Company object for ${this.companyName}`,\n `or CompanyPosition object for ${companyPositionName}.`,\n `Work rep gain will be 0`,\n ].join(\" \"),\n );\n return 0;\n }\n\n let jobPerformance = companyPosition.calculateJobPerformance(\n this.hacking,\n this.strength,\n this.defense,\n this.dexterity,\n this.agility,\n this.charisma,\n );\n\n //Intelligence provides a flat bonus to job performance\n jobPerformance += this.intelligence / CONSTANTS.MaxSkillLevel;\n\n //Update reputation gain rate to account for company favor\n let favorMult = 1 + company.favor / 100;\n if (isNaN(favorMult)) {\n favorMult = 1;\n }\n return jobPerformance * this.company_rep_mult * favorMult;\n}\n\n// export function getFactionSecurityWorkRepGain(this: IPlayer) {\n// var t = 0.9 * (this.hacking / CONSTANTS.MaxSkillLevel +\n// this.strength / CONSTANTS.MaxSkillLevel +\n// this.defense / CONSTANTS.MaxSkillLevel +\n// this.dexterity / CONSTANTS.MaxSkillLevel +\n// this.agility / CONSTANTS.MaxSkillLevel) / 4.5;\n// return t * this.faction_rep_mult;\n// }\n\n// export function getFactionFieldWorkRepGain(this: IPlayer) {\n// var t = 0.9 * (this.hacking / CONSTANTS.MaxSkillLevel +\n// this.strength / CONSTANTS.MaxSkillLevel +\n// this.defense / CONSTANTS.MaxSkillLevel +\n// this.dexterity / CONSTANTS.MaxSkillLevel +\n// this.agility / CONSTANTS.MaxSkillLevel +\n// this.charisma / CONSTANTS.MaxSkillLevel +\n// this.intelligence / CONSTANTS.MaxSkillLevel) / 5.5;\n// return t * this.faction_rep_mult;\n// }\n\n/* Creating a Program */\nexport function startCreateProgramWork(this: IPlayer, programName: string, time: number, reqLevel: number): void {\n this.resetWorkStatus();\n this.isWorking = true;\n this.workType = WorkType.CreateProgram;\n\n //Time needed to complete work affected by hacking skill (linearly based on\n //ratio of (your skill - required level) to MAX skill)\n //var timeMultiplier = (CONSTANTS.MaxSkillLevel - (this.hacking - reqLevel)) / CONSTANTS.MaxSkillLevel;\n //if (timeMultiplier > 1) {timeMultiplier = 1;}\n //if (timeMultiplier < 0.01) {timeMultiplier = 0.01;}\n this.createProgramReqLvl = reqLevel;\n\n this.timeNeededToCompleteWork = time;\n //Check for incomplete program\n for (let i = 0; i < this.getHomeComputer().programs.length; ++i) {\n const programFile = this.getHomeComputer().programs[i];\n if (programFile.startsWith(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.timeWorkedCreateProgram = (percComplete / 100) * this.timeNeededToCompleteWork;\n this.getHomeComputer().programs.splice(i, 1);\n }\n }\n\n this.createProgramName = programName;\n}\n\nexport function createProgramWork(this: IPlayer, numCycles: number): boolean {\n let focusBonus = 1;\n if (!this.hasAugmentation(AugmentationNames[\"NeuroreceptorManager\"])) {\n focusBonus = this.focus ? 1 : CONSTANTS.BaseFocusBonus;\n }\n //Higher hacking skill will allow you to create programs faster\n const reqLvl = this.createProgramReqLvl;\n let skillMult = (this.hacking / reqLvl) * this.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.timeWorked += CONSTANTS._idleSpeed * numCycles;\n this.timeWorkedCreateProgram += CONSTANTS._idleSpeed * numCycles * skillMult;\n\n if (this.timeWorkedCreateProgram >= this.timeNeededToCompleteWork) {\n this.finishCreateProgramWork(false);\n return true;\n }\n return false;\n}\n\nexport function finishCreateProgramWork(this: IPlayer, cancelled: boolean): string {\n const programName = this.createProgramName;\n if (!cancelled) {\n //Complete case\n this.gainIntelligenceExp((CONSTANTS.IntelligenceProgramBaseExpGain * this.timeWorked) / 1000);\n dialogBoxCreate(`You've finished creating ${programName}!
The new program can be found on your home computer.`);\n\n if (!this.getHomeComputer().programs.includes(programName)) {\n this.getHomeComputer().programs.push(programName);\n }\n } else if (!this.getHomeComputer().programs.includes(programName)) {\n //Incomplete case\n const perc = (Math.floor((this.timeWorkedCreateProgram / this.timeNeededToCompleteWork) * 10000) / 100).toString();\n const incompleteName = programName + \"-\" + perc + \"%-INC\";\n this.getHomeComputer().programs.push(incompleteName);\n }\n\n this.isWorking = false;\n\n this.resetWorkStatus();\n return \"You've finished creating \" + programName + \"! The new program can be found on your home computer.\";\n}\n\nexport function startGraftAugmentationWork(this: IPlayer, augmentationName: string, time: number): void {\n this.resetWorkStatus();\n this.isWorking = true;\n this.workType = WorkType.GraftAugmentation;\n\n this.timeNeededToCompleteWork = time;\n this.graftAugmentationName = augmentationName;\n}\n\nexport function craftAugmentationWork(this: IPlayer, numCycles: number): boolean {\n let focusBonus = 1;\n if (!this.hasAugmentation(AugmentationNames.NeuroreceptorManager)) {\n focusBonus = this.focus ? 1 : CONSTANTS.BaseFocusBonus;\n }\n\n let skillMult = graftingIntBonus(this);\n skillMult *= focusBonus;\n\n this.timeWorked += CONSTANTS._idleSpeed * numCycles;\n this.timeWorkedGraftAugmentation += CONSTANTS._idleSpeed * numCycles * skillMult;\n\n if (this.timeWorkedGraftAugmentation >= this.timeNeededToCompleteWork) {\n this.finishGraftAugmentationWork(false);\n return true;\n }\n return false;\n}\n\nexport function finishGraftAugmentationWork(this: IPlayer, cancelled: boolean, singularity = false): string {\n const augName = this.graftAugmentationName;\n if (cancelled === false) {\n applyAugmentation({ name: augName, level: 1 });\n\n if (!this.hasAugmentation(AugmentationNames.CongruityImplant)) {\n this.entropy += 1;\n this.applyEntropy(this.entropy);\n }\n\n dialogBoxCreate(\n `You've finished grafting ${augName}.
The augmentation has been applied to your body` +\n (this.hasAugmentation(AugmentationNames.CongruityImplant) ? \".\" : \", but you feel a bit off.\"),\n );\n } else if (cancelled && singularity === false) {\n dialogBoxCreate(`You cancelled the grafting of ${augName}.
Your money was not returned to you.`);\n }\n\n // Intelligence gain\n if (!cancelled) {\n this.gainIntelligenceExp((CONSTANTS.IntelligenceGraftBaseExpGain * this.timeWorked) / 10000);\n }\n\n this.isWorking = false;\n this.resetWorkStatus();\n return `Grafting of ${augName} has ended.`;\n}\n\n/* Studying/Taking Classes */\nexport function startClass(this: IPlayer, costMult: number, expMult: number, className: ClassType): void {\n this.resetWorkStatus();\n this.isWorking = true;\n this.workType = WorkType.StudyClass;\n this.workCostMult = costMult;\n this.workExpMult = expMult;\n this.className = className;\n const earnings = calculateClassEarnings(this);\n this.workMoneyLossRate = earnings.workMoneyLossRate;\n this.workHackExpGainRate = earnings.workHackExpGainRate;\n this.workStrExpGainRate = earnings.workStrExpGainRate;\n this.workDefExpGainRate = earnings.workDefExpGainRate;\n this.workDexExpGainRate = earnings.workDexExpGainRate;\n this.workAgiExpGainRate = earnings.workAgiExpGainRate;\n this.workChaExpGainRate = earnings.workChaExpGainRate;\n}\n\nexport function takeClass(this: IPlayer, numCycles: number): boolean {\n this.timeWorked += CONSTANTS._idleSpeed * numCycles;\n const earnings = calculateClassEarnings(this);\n this.workMoneyLossRate = earnings.workMoneyLossRate;\n this.workHackExpGainRate = earnings.workHackExpGainRate;\n this.workStrExpGainRate = earnings.workStrExpGainRate;\n this.workDefExpGainRate = earnings.workDefExpGainRate;\n this.workDexExpGainRate = earnings.workDexExpGainRate;\n this.workAgiExpGainRate = earnings.workAgiExpGainRate;\n this.workChaExpGainRate = earnings.workChaExpGainRate;\n this.processWorkEarnings(numCycles);\n return false;\n}\n\n//The 'sing' argument defines whether or not this function was called\n//through a Singularity Netscript function\nexport function finishClass(this: IPlayer, sing = false): string {\n this.gainIntelligenceExp(CONSTANTS.IntelligenceClassBaseExpGain * Math.round(this.timeWorked / 1000));\n\n if (this.workMoneyGained > 0) {\n throw new Error(\"ERR: Somehow gained money while taking class\");\n }\n\n this.updateSkillLevels();\n if (!sing) {\n dialogBoxCreate(\n <>\n After {this.className} for {convertTimeMsToTimeElapsedString(this.timeWorked)},
\n you spent a total of .
\n
\n You earned a total of:
\n {numeralWrapper.formatExp(this.workHackExpGained)} hacking exp
\n {numeralWrapper.formatExp(this.workStrExpGained)} strength exp
\n {numeralWrapper.formatExp(this.workDefExpGained)} defense exp
\n {numeralWrapper.formatExp(this.workDexExpGained)} dexterity exp
\n {numeralWrapper.formatExp(this.workAgiExpGained)} agility exp
\n {numeralWrapper.formatExp(this.workChaExpGained)} charisma exp\n
\n ,\n );\n }\n\n this.isWorking = false;\n\n if (sing) {\n const res =\n \"After \" +\n this.className +\n \" for \" +\n convertTimeMsToTimeElapsedString(this.timeWorked) +\n \", \" +\n \"you spent a total of \" +\n numeralWrapper.formatMoney(this.workMoneyGained * -1) +\n \". \" +\n \"You earned a total of: \" +\n numeralWrapper.formatExp(this.workHackExpGained) +\n \" hacking exp, \" +\n numeralWrapper.formatExp(this.workStrExpGained) +\n \" strength exp, \" +\n numeralWrapper.formatExp(this.workDefExpGained) +\n \" defense exp, \" +\n numeralWrapper.formatExp(this.workDexExpGained) +\n \" dexterity exp, \" +\n numeralWrapper.formatExp(this.workAgiExpGained) +\n \" agility exp, and \" +\n numeralWrapper.formatExp(this.workChaExpGained) +\n \" charisma exp\";\n this.resetWorkStatus();\n return res;\n }\n this.resetWorkStatus();\n return \"\";\n}\n\n//The EXP and $ gains are hardcoded. Time is in ms\nexport function startCrime(\n this: IPlayer,\n router: IRouter,\n crimeType: CrimeType,\n hackExp: number,\n strExp: number,\n defExp: number,\n dexExp: number,\n agiExp: number,\n chaExp: number,\n money: number,\n time: number,\n workerscript: WorkerScript | null = null,\n): void {\n this.crimeType = crimeType;\n\n this.resetWorkStatus();\n this.isWorking = true;\n this.focus = true;\n this.workType = WorkType.Crime;\n\n if (workerscript !== null) {\n this.committingCrimeThruSingFn = true;\n this.singFnCrimeWorkerScript = workerscript;\n }\n\n this.workHackExpGained = hackExp * this.hacking_exp_mult * BitNodeMultipliers.CrimeExpGain;\n this.workStrExpGained = strExp * this.strength_exp_mult * BitNodeMultipliers.CrimeExpGain;\n this.workDefExpGained = defExp * this.defense_exp_mult * BitNodeMultipliers.CrimeExpGain;\n this.workDexExpGained = dexExp * this.dexterity_exp_mult * BitNodeMultipliers.CrimeExpGain;\n this.workAgiExpGained = agiExp * this.agility_exp_mult * BitNodeMultipliers.CrimeExpGain;\n this.workChaExpGained = chaExp * this.charisma_exp_mult * BitNodeMultipliers.CrimeExpGain;\n this.workMoneyGained = money * this.crime_money_mult * BitNodeMultipliers.CrimeMoney;\n\n this.timeNeededToCompleteWork = time;\n router.toWork();\n}\n\nexport function commitCrime(this: IPlayer, numCycles: number): boolean {\n this.timeWorked += CONSTANTS._idleSpeed * numCycles;\n\n if (this.timeWorked >= this.timeNeededToCompleteWork) {\n this.finishCrime(false);\n return true;\n }\n return false;\n}\n\nexport function finishCrime(this: IPlayer, cancelled: boolean): string {\n //Determine crime success/failure\n if (!cancelled) {\n if (determineCrimeSuccess(this, this.crimeType)) {\n //Handle Karma and crime statistics\n let crime = null;\n for (const i of Object.keys(Crimes)) {\n if (Crimes[i].type == this.crimeType) {\n crime = Crimes[i];\n break;\n }\n }\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 this.gainMoney(this.workMoneyGained, \"crime\");\n this.karma -= crime.karma;\n this.numPeopleKilled += crime.kills;\n if (crime.intelligence_exp > 0) {\n this.gainIntelligenceExp(crime.intelligence_exp);\n }\n\n //On a crime success, gain 2x exp\n this.workHackExpGained *= 2;\n this.workStrExpGained *= 2;\n this.workDefExpGained *= 2;\n this.workDexExpGained *= 2;\n this.workAgiExpGained *= 2;\n this.workChaExpGained *= 2;\n const ws = this.singFnCrimeWorkerScript;\n if (this.committingCrimeThruSingFn && ws !== null) {\n if (ws.disableLogs.ALL == null && ws.disableLogs.commitCrime == null) {\n ws.scriptRef.log(\n \"SUCCESS: Crime successful! Gained \" +\n numeralWrapper.formatMoney(this.workMoneyGained) +\n \", \" +\n numeralWrapper.formatExp(this.workHackExpGained) +\n \" hack exp, \" +\n numeralWrapper.formatExp(this.workStrExpGained) +\n \" str exp, \" +\n numeralWrapper.formatExp(this.workDefExpGained) +\n \" def exp, \" +\n numeralWrapper.formatExp(this.workDexExpGained) +\n \" dex exp, \" +\n numeralWrapper.formatExp(this.workAgiExpGained) +\n \" agi exp, \" +\n numeralWrapper.formatExp(this.workChaExpGained) +\n \" cha exp.\",\n );\n }\n } else {\n dialogBoxCreate(\n <>\n Crime successful!\n
\n
\n You gained:\n
\n \n
\n {numeralWrapper.formatExp(this.workHackExpGained)} hacking experience
\n {numeralWrapper.formatExp(this.workStrExpGained)} strength experience\n
\n {numeralWrapper.formatExp(this.workDefExpGained)} defense experience\n
\n {numeralWrapper.formatExp(this.workDexExpGained)} dexterity experience\n
\n {numeralWrapper.formatExp(this.workAgiExpGained)} agility experience\n
\n {numeralWrapper.formatExp(this.workChaExpGained)} charisma experience\n ,\n );\n }\n } else {\n //Exp halved on failure\n this.workHackExpGained /= 2;\n this.workStrExpGained /= 2;\n this.workDefExpGained /= 2;\n this.workDexExpGained /= 2;\n this.workAgiExpGained /= 2;\n this.workChaExpGained /= 2;\n const ws = this.singFnCrimeWorkerScript;\n if (this.committingCrimeThruSingFn && ws !== null) {\n if (ws.disableLogs.ALL == null && ws.disableLogs.commitCrime == null) {\n ws.scriptRef.log(\n \"FAIL: Crime failed! Gained \" +\n numeralWrapper.formatExp(this.workHackExpGained) +\n \" hack exp, \" +\n numeralWrapper.formatExp(this.workStrExpGained) +\n \" str exp, \" +\n numeralWrapper.formatExp(this.workDefExpGained) +\n \" def exp, \" +\n numeralWrapper.formatExp(this.workDexExpGained) +\n \" dex exp, \" +\n numeralWrapper.formatExp(this.workAgiExpGained) +\n \" agi exp, \" +\n numeralWrapper.formatExp(this.workChaExpGained) +\n \" cha exp.\",\n );\n }\n } else {\n dialogBoxCreate(\n <>\n Crime failed!\n
\n
\n You gained:\n
\n {numeralWrapper.formatExp(this.workHackExpGained)} hacking experience
\n {numeralWrapper.formatExp(this.workStrExpGained)} strength experience\n
\n {numeralWrapper.formatExp(this.workDefExpGained)} defense experience\n
\n {numeralWrapper.formatExp(this.workDexExpGained)} dexterity experience\n
\n {numeralWrapper.formatExp(this.workAgiExpGained)} agility experience\n
\n {numeralWrapper.formatExp(this.workChaExpGained)} charisma experience\n ,\n );\n }\n }\n\n this.gainHackingExp(this.workHackExpGained);\n this.gainStrengthExp(this.workStrExpGained);\n this.gainDefenseExp(this.workDefExpGained);\n this.gainDexterityExp(this.workDexExpGained);\n this.gainAgilityExp(this.workAgiExpGained);\n this.gainCharismaExp(this.workChaExpGained);\n }\n this.committingCrimeThruSingFn = false;\n this.singFnCrimeWorkerScript = null;\n this.isWorking = false;\n this.crimeType = CrimeType.None;\n this.resetWorkStatus();\n return \"\";\n}\n\n//Cancels the player's current \"work\" assignment and gives the proper rewards\n//Used only for Singularity functions, so no popups are created\nexport function singularityStopWork(this: IPlayer): string {\n if (!this.isWorking) {\n return \"\";\n }\n let res = \"\"; //Earnings text for work\n switch (this.workType) {\n case WorkType.StudyClass:\n res = this.finishClass(true);\n break;\n case WorkType.Company:\n res = this.finishWork(true, true);\n break;\n case WorkType.CompanyPartTime:\n res = this.finishWorkPartTime(true);\n break;\n case WorkType.Faction:\n res = this.finishFactionWork(true, true);\n break;\n case WorkType.CreateProgram:\n res = this.finishCreateProgramWork(true);\n break;\n case WorkType.Crime:\n res = this.finishCrime(true);\n break;\n case WorkType.GraftAugmentation:\n res = this.finishGraftAugmentationWork(true, true);\n break;\n default:\n console.error(`Unrecognized work type (${this.workType})`);\n return \"\";\n }\n return res;\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 -= amt;\n if (this.hp <= 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 += amt;\n if (this.hp > this.max_hp) {\n this.hp = this.max_hp;\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 = this.max_hp;\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 if (!this.isWorking || this.workType !== WorkType.Company) this.companyName = company.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 let currCompany = null;\n if (this.companyName !== \"\") {\n currCompany = Companies[this.companyName];\n }\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[this.companyName];\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, _sing = false): void {\n if (this.isWorking == true && this.workType !== WorkType.Company && this.companyName == company) {\n this.finishWork(true);\n }\n delete this.jobs[company];\n if (this.companyName === company) {\n this.companyName = this.hasJob() ? Object.keys(this.jobs)[0] : \"\";\n }\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 if (!this.focus && this.isWorking && this.companyName !== company.name) this.resetWorkStatus();\n this.companyName = company.name;\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 (!this.focus && this.isWorking && this.companyName !== company.name) this.resetWorkStatus();\n this.companyName = company.name;\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 (!this.focus && this.isWorking && this.companyName !== company.name) this.resetWorkStatus();\n this.companyName = company.name;\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 (!this.focus && this.isWorking && this.companyName !== company.name) this.resetWorkStatus();\n this.companyName = company.name;\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.hacking >= reqHacking &&\n this.strength >= reqStrength &&\n this.defense >= reqDefense &&\n this.dexterity >= reqDexterity &&\n this.agility >= reqAgility &&\n this.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, repNeeded = CONSTANTS.CorpFactionRepRequirement): boolean {\n return allCompanies.includes(companyName) && getCompanyRep(companyName) > repNeeded;\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.hacking >= 1500 &&\n this.strength >= 1200 &&\n this.defense >= 1200 &&\n this.dexterity >= 1200 &&\n this.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.hacking >= 2500 ||\n (this.strength >= 1500 && this.defense >= 1500 && this.dexterity >= 1500 && this.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.hacking >= 850 &&\n this.strength >= 850 &&\n this.defense >= 850 &&\n this.dexterity >= 850 &&\n this.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, 250e3)\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.hacking >= 100 &&\n this.strength >= 300 &&\n this.defense >= 300 &&\n this.dexterity >= 300 &&\n this.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.hacking >= 300 &&\n this.strength >= 300 &&\n this.defense >= 300 &&\n this.dexterity >= 300 &&\n this.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.hacking >= 200 &&\n this.strength >= 200 &&\n this.defense >= 200 &&\n this.dexterity >= 200 &&\n this.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.strength >= 75 &&\n this.defense >= 75 &&\n this.dexterity >= 75 &&\n this.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.strength >= 30 &&\n this.defense >= 30 &&\n this.dexterity >= 30 &&\n this.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.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.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.intelligence, weight);\n}\n\nexport function getCasinoWinnings(this: IPlayer): number {\n return this.moneySourceA.casino;\n}\n\nexport function getMult(this: IPlayer, name: string): number {\n if (!this.hasOwnProperty(name)) return 1;\n return (this as any)[name];\n}\n\nexport function setMult(this: IPlayer, name: string, mult: number): void {\n if (!this.hasOwnProperty(name)) return;\n (this as any)[name] = mult;\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","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, 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(): any {\n return Generic_toJSON(\"Server\", this);\n }\n\n // Initializes a Server Object from a JSON save state\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): Server {\n return Generic_fromJSON(Server, value.data);\n }\n}\n\nReviver.constructors.Server = Server;\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","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","/**\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.hacknet_node_money_mult);\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.hacknet_node_purchase_cost_mult);\n}\n\nexport function getCostOfNextHacknetServer(player: IPlayer): number {\n return calculateServerCost(player.hacknetNodes.length + 1, player.hacknet_node_purchase_cost_mult);\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.hacknet_node_level_cost_mult)) {\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.hacknet_node_level_cost_mult)) {\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.hacknet_node_level_cost_mult) &&\n player.money < nodeObj.calculateLevelUpgradeCost(curr + 1, player.hacknet_node_level_cost_mult)\n ) {\n return Math.min(levelsToMax, curr);\n } else if (player.money < nodeObj.calculateLevelUpgradeCost(curr, player.hacknet_node_level_cost_mult)) {\n max = curr - 1;\n } else if (player.money > nodeObj.calculateLevelUpgradeCost(curr, player.hacknet_node_level_cost_mult)) {\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.hacknet_node_ram_cost_mult)) {\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.hacknet_node_ram_cost_mult)) {\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.hacknet_node_ram_cost_mult)) {\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.hacknet_node_core_cost_mult)) {\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.hacknet_node_core_cost_mult)) {\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.hacknet_node_core_cost_mult) &&\n player.money < nodeObj.calculateCoreUpgradeCost(curr + 1, player.hacknet_node_core_cost_mult)\n ) {\n return Math.min(levelsToMax, curr);\n } else if (player.money < nodeObj.calculateCoreUpgradeCost(curr, player.hacknet_node_core_cost_mult)) {\n max = curr - 1;\n } else if (player.money > nodeObj.calculateCoreUpgradeCost(curr, player.hacknet_node_core_cost_mult)) {\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.hacknet_node_level_cost_mult);\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.hacknet_node_money_mult);\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.hacknet_node_ram_cost_mult);\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.hacknet_node_money_mult);\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.hacknet_node_core_cost_mult);\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.hacknet_node_money_mult);\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.hacknet_node_money_mult);\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 = Math.floor(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): 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)) {\n const upg = HashUpgrades[upgName];\n\n switch (upgName) {\n case \"Sell for Money\": {\n player.gainMoney(upg.value, \"hacknet\");\n break;\n }\n case \"Sell for Corporation Funds\": {\n const corp = player.corporation;\n if (corp === null) {\n player.hashManager.refundUpgrade(upgName);\n return false;\n }\n corp.funds = corp.funds + upg.value;\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 return false;\n }\n if (!(target instanceof Server)) throw new Error(`'${upgTarget}' is not a normal server.`);\n\n target.changeMinimumSecurity(upg.value, true);\n } catch (e) {\n player.hashManager.refundUpgrade(upgName);\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 return false;\n }\n if (!(target instanceof Server)) throw new Error(`'${upgTarget}' is not a normal server.`);\n\n target.changeMaximumMoney(upg.value);\n } catch (e) {\n player.hashManager.refundUpgrade(upgName);\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);\n return false;\n }\n for (const division of corp.divisions) {\n division.sciResearch.qty += upg.value;\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);\n return false;\n }\n bladeburner.changeRank(player, upg.value);\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);\n return false;\n }\n\n bladeburner.skillPoints += upg.value;\n break;\n }\n case \"Generate Coding Contract\": {\n generateRandomContract();\n break;\n }\n default:\n console.warn(`Unrecognized upgrade name ${upgName}. Upgrade has no effect`);\n player.hashManager.refundUpgrade(upgName);\n return false;\n }\n\n return true;\n }\n\n return false;\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 { 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","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 { 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 { Employee } from \"./Employee\";\nimport { IndustryUpgrades } from \"./IndustryUpgrades\";\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, percent: number): void {\n if (isNaN(percent) || percent < 0 || percent > CorporationConstants.DividendMaxPercentage) {\n throw new Error(`Invalid value. Must be an integer between 0 and ${CorporationConstants.DividendMaxPercentage}`);\n }\n\n corporation.dividendPercentage = percent * 100;\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(employee: Employee, job: string): void {\n if (!Object.values(EmployeePositions).includes(job)) throw new Error(`'${job}' is not a valid job.`);\n employee.pos = job;\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 ThrowParty(corp: ICorporation, office: OfficeSpace, costPerEmployee: number): number {\n const totalCost = costPerEmployee * office.employees.length;\n if (corp.funds < totalCost) return 0;\n corp.funds = corp.funds - totalCost;\n let mult = 0;\n for (let i = 0; i < office.employees.length; ++i) {\n mult = office.employees[i].throwParty(costPerEmployee);\n }\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 BuyCoffee(corp: ICorporation, division: IIndustry, office: OfficeSpace): void {\n const upgrade = IndustryUpgrades[0];\n const cost = office.employees.length * upgrade[1];\n if (corp.funds < cost) return;\n corp.funds = corp.funds - cost;\n division.upgrade(upgrade, {\n corporation: corp,\n office: office,\n });\n}\n\nexport function HireAdVert(corp: ICorporation, division: IIndustry, office: OfficeSpace): void {\n const upgrade = IndustryUpgrades[1];\n const cost = upgrade[1] * Math.pow(upgrade[2], division.upgrades[1]);\n if (corp.funds < cost) return;\n corp.funds = corp.funds - cost;\n division.upgrade(upgrade, {\n corporation: corp,\n office: office,\n });\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.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","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 { 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","/**\n * Enum for different types of tasks that a Sleeve can perform\n */\nexport enum SleeveTaskType {\n // Same Order as selectable order in UI\n Idle,\n Company,\n Faction,\n Crime,\n Class,\n Gym,\n Bladeburner,\n Recovery,\n Synchro,\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 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","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","import { Augmentation } from \"./Augmentation\";\nimport { IMap } from \"../types\";\n\nexport const StaticAugmentations: IMap = {};\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","/**\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(\".ns\") && !f0.endsWith(\".js\")) f0 = f0 + \".js\";\n if (!f1.endsWith(\".ns\") && !f1.endsWith(\".js\")) f1 = f1 + \".js\";\n return areFilesEqual(f0, f1);\n}\n","import { Terminal as TTerminal } from \"./Terminal/Terminal\";\n\nexport const Terminal = new TTerminal();\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\", 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\", CrimeType.RobStore, 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\", 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\", 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\", 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\", CrimeType.BondForgery, 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\", CrimeType.TraffickArms, 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\", 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\", CrimeType.GrandTheftAuto, 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\", 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\", 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\", 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) => any {\n return function (event: React.MouseEvent): any {\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 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 { Locations } from \"../Locations/Locations\";\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 { buyStock, sellStock, shortStock, sellShort } from \"../StockMarket/BuyingAndSelling\";\nimport {\n cancelOrder,\n eventEmitterForUiReset,\n initStockMarketFn,\n placeOrder,\n StockMarket,\n} 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\";\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 display: \"block\",\n padding: \"8px\",\n minHeight: \"100vh\",\n boxSizing: \"border-box\",\n },\n }),\n);\n\nconst uninitialized = (): any => {\n throw new Error(\"Router called before initialization\");\n};\n\nexport let Router: IRouter = {\n isInitialized: false,\n page: uninitialized,\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.isWorking) 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 player.currentWorkFactionName ? Factions[player.currentWorkFactionName] : (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: () => {\n setLocation(Locations[player.companyName]);\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.log(`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 \n );\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 * 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, 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.hacknet_node_money_mult);\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(): any {\n return Generic_toJSON(\"HacknetServer\", this);\n }\n\n // Initializes a HacknetServer Object from a JSON save state\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): HacknetServer {\n return Generic_fromJSON(HacknetServer, value.data);\n }\n}\n\nReviver.constructors.HacknetServer = HacknetServer;\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]>();\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","// 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","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","export const validScriptExtensions: Array = [`.js`, `.script`, `.ns`];\n\nexport function isScriptFilename(f: string): boolean {\n return validScriptExtensions.some((ext) => f.endsWith(ext));\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(dimensions: number[]): any {\n const array = [];\n\n for (let i = 0; i < dimensions[0]; ++i) {\n array.push(dimensions.length == 1 ? 0 : zeros(dimensions.slice(1)));\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 { 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.hacking;\n const skillChance = (skillMult - server.requiredHackingSkill) / skillMult;\n const chance =\n skillChance * difficultyMult * player.hacking_chance_mult * calculateIntelligenceBonus(player.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.hacking_exp_mult * 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.hacking - (server.requiredHackingSkill - 1)) / player.hacking;\n const percentMoneyHacked =\n (difficultyMult * skillMult * player.hacking_money_mult * 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.hacking + baseSkill;\n\n const hackTimeMultiplier = 5;\n const hackingTime =\n (hackTimeMultiplier * skillFactor) /\n (player.hacking_speed_mult * calculateIntelligenceBonus(player.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 { 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 { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { IMap } from \"../types\";\nimport { EventEmitter } from \"../utils/EventEmitter\";\n\nimport { numeralWrapper } from \"../ui/numeralFormat\";\n\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { Reviver } from \"../utils/JSONReviver\";\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 workerScript: WorkerScript | null = null,\n): boolean {\n if (!(stock instanceof Stock)) {\n if (workerScript) {\n workerScript.log(\"stock.placeOrder\", () => `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 (workerScript) {\n workerScript.log(\"stock.placeOrder\", () => `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\ninterface 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, workerScript: WorkerScript | null = null): boolean {\n if (StockMarket[\"Orders\"] == null) {\n return false;\n }\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 (workerScript) {\n workerScript.scriptRef.log(\"Successfully cancelled order: \" + orderTxt);\n }\n return true;\n }\n }\n if (workerScript) {\n workerScript.scriptRef.log(\"Failed to cancel order: \" + orderTxt);\n }\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 {\n StockMarket = JSON.parse(saveString, Reviver);\n }\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)) {\n delete StockMarket[stk];\n }\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)) {\n continue;\n }\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)) {\n continue;\n }\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) {\n return;\n }\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) {\n stockMarketCycle();\n }\n\n const v = Math.random();\n for (const name of Object.keys(StockMarket)) {\n const stock = StockMarket[name];\n if (!(stock instanceof Stock)) {\n continue;\n }\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\nexport const eventEmitterForUiReset = new EventEmitter<[]>();\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\";\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 (name === Player.currentWorkFactionName) 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);\n const sRep = getFactionSecurityWorkRepGain(Player, faction);\n const fRep = getFactionFieldWorkRepGain(Player, faction);\n const rate = Math.max(hRep * favorMult, sRep * favorMult, fRep * favorMult, 1 / 120);\n\n faction.playerReputation += rate * numCycles * Player.faction_rep_mult * 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","/*\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 { 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 } from \"./utils/JSONReviver\";\nimport { save } from \"./db\";\nimport { 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\";\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 parsed: any;\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.log(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 parsed: parsedSave,\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.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(): any {\n return Generic_toJSON(\"BitburnerSaveObject\", this);\n }\n\n static fromJSON(value: { data: any }): 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 for (const companyName of Object.keys(Companies)) {\n const company: any = Companies[companyName];\n if (company.name == 0 && company.companyName != null) {\n company.name = company.companyName;\n }\n\n if (company.companyPositions instanceof Array) {\n const pos: any = {};\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 // Give 10 neuroflux because v1 API break.\n const nf = Player.augmentations.find((a) => a.name === AugmentationNames.NeuroFluxGovernor);\n if (nf) {\n nf.level += 10;\n } else {\n const nf = new PlayerOwnedAugmentation(AugmentationNames.NeuroFluxGovernor);\n nf.level = 10;\n Player.augmentations.push(nf);\n }\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 if (ver < 15) {\n (Settings as any).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 // 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 Player.reapplyAllAugmentations(true);\n Player.reapplyAllSourceFiles();\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 }\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 const navigator = window.navigator as any;\n if (navigator.msSaveOrOpenBlob) {\n // IE10+\n navigator.msSaveOrOpenBlob(file, filename);\n } else {\n // Others\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\nReviver.constructors.BitburnerSaveObject = BitburnerSaveObject;\n\nexport { saveObject, loadGame, download };\n\nconst saveObject = new BitburnerSaveObject();\n","import { isString } from \"./utils/helpers/isString\";\nimport { GetServer } from \"./Server/AllServers\";\nimport { ScriptDeath } from \"./Netscript/ScriptDeath\";\nimport { WorkerScript } from \"./Netscript/WorkerScript\";\nimport { NetscriptContext } from \"./Netscript/APIWrapper\";\n\nexport function netscriptDelay(time: number, workerScript: WorkerScript): Promise {\n // Cancel any pre-existing netscriptDelay'ed function call\n // TODO: the rejection almost certainly ends up in the uncaught rejection handler.\n // Maybe reject with a stack-trace'd error message?\n if (workerScript.delayReject) workerScript.delayReject();\n\n return new Promise(function (resolve, reject) {\n workerScript.delay = window.setTimeout(() => {\n workerScript.delay = null;\n workerScript.delayReject = undefined;\n if (workerScript.env.stopFlag) reject(new ScriptDeath(workerScript));\n else resolve();\n }, time);\n workerScript.delayReject = reject;\n });\n}\n\nexport function makeRuntimeRejectMsg(workerScript: WorkerScript, msg: string): string {\n const server = GetServer(workerScript.hostname);\n if (server == null) {\n throw new Error(`WorkerScript constructed with invalid server ip: ${workerScript.hostname}`);\n }\n\n for (const scriptUrl of workerScript.scriptRef.dependencies) {\n // Return just the original msg if it's nullish so that we don't get a workerscript error\n msg = msg?.replace(new RegExp(scriptUrl.url, \"g\"), scriptUrl.filename) ?? msg;\n }\n\n return \"|DELIMITER|\" + server.hostname + \"|DELIMITER|\" + workerScript.name + \"|DELIMITER|\" + msg;\n}\n\nexport function 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\nexport function 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","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, 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: any;\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(): any {\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(): any {\n return Generic_toJSON(\"CodingContract\", this);\n }\n\n /**\n * Initiatizes a CodingContract from a JSON save state.\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): 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 { 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\";\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 for (const mult of Object.keys(staticAugmentation.mults)) {\n const v = Player.getMult(mult) * staticAugmentation.mults[mult];\n Player.setMult(mult, v);\n }\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 { 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","export interface IScriptEditorTheme {\n [key: string]: any;\n base: string;\n inherit: boolean;\n common: {\n [key: string]: string;\n accent: string;\n bg: string;\n fg: string;\n };\n syntax: {\n [key: string]: string;\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 [key: string]: any;\n line: string;\n panel: {\n [key: string]: string;\n bg: string;\n selected: string;\n border: string;\n };\n selection: {\n [key: string]: string;\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]: any }): 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): any {\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: { editor: any }): 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 * 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, { 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","// 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.hacking_grow_mult *\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.hacking_grow_mult * 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","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 { Operation, IOperationParams } from \"./Operation\";\nimport { Generic_fromJSON, Generic_toJSON, 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(): any {\n return Generic_toJSON(\"BlackOperation\", this);\n }\n\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): Operation {\n return Generic_fromJSON(BlackOperation, value.data);\n }\n}\n\nReviver.constructors.BlackOperation = BlackOperation;\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 { compareArrays } from \"../utils/helpers/compareArrays\";\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { AddRecentScript } from \"./RecentScripts\";\nimport { Player } from \"../Player\";\n\nexport function killWorkerScript(runningScriptObj: RunningScript, hostname: string, rerenderUi?: boolean): boolean;\nexport function killWorkerScript(workerScript: WorkerScript): boolean;\nexport function killWorkerScript(pid: number): boolean;\nexport function killWorkerScript(\n script: RunningScript | WorkerScript | number,\n hostname?: string,\n rerenderUi?: boolean,\n): boolean {\n if (rerenderUi == null || typeof rerenderUi !== \"boolean\") {\n rerenderUi = true;\n }\n\n if (script instanceof WorkerScript) {\n stopAndCleanUpWorkerScript(script);\n\n return true;\n } else if (script instanceof RunningScript && typeof hostname === \"string\") {\n // Try to kill by PID\n const res = killWorkerScriptByPid(script.pid, rerenderUi);\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.name == script.filename && ws.hostname == hostname && compareArrays(ws.args, script.args)) {\n stopAndCleanUpWorkerScript(ws, rerenderUi);\n\n return true;\n }\n }\n\n return false;\n } else if (typeof script === \"number\") {\n return killWorkerScriptByPid(script, rerenderUi);\n } else {\n console.error(`killWorkerScript() called with invalid argument:`);\n console.error(script);\n return false;\n }\n}\n\nfunction killWorkerScriptByPid(pid: number, rerenderUi = true): boolean {\n const ws = workerScripts.get(pid);\n if (ws instanceof WorkerScript) {\n stopAndCleanUpWorkerScript(ws, rerenderUi);\n\n return true;\n }\n\n return false;\n}\n\nfunction stopAndCleanUpWorkerScript(workerScript: WorkerScript, rerenderUi = true): void {\n if (typeof workerScript.atExit === \"function\") {\n try {\n workerScript.atExit();\n } catch (e: any) {\n dialogBoxCreate(\n `Error trying to call atExit for script ${workerScript.name} on ${workerScript.hostname} ${workerScript.scriptRef.args} ${e}`,\n );\n }\n workerScript.atExit = undefined;\n }\n workerScript.env.stopFlag = true;\n killNetscriptDelay(workerScript);\n removeWorkerScript(workerScript, rerenderUi);\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, rerenderUi = true): void {\n const ip = workerScript.hostname;\n const name = workerScript.name;\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.filename === name && compareArrays(runningScript.args, workerScript.args)) {\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 if (rerenderUi) {\n WorkerScriptStartStopEventEmitter.emit();\n }\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 * 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","/**\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 */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function isString(value: any): boolean {\n return typeof value === \"string\" || value instanceof String;\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 label={\n {tooltip}
}>\n {text}\n \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). This Source-File also increases your charisma and company salary multipliers\n 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 ),\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 technology. 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 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 in other BitNodes. Each level of this\n 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 { IMinMaxRange } from \"../types\";\nimport { Generic_fromJSON, Generic_toJSON, 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(): any {\n return Generic_toJSON(\"Stock\", this);\n }\n\n /**\n * Initializes a Stock from a JSON save state\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): 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","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 const re = /^([\\w|!%,@-]+)=((\"(.+)\")|('(.+)'))$/;\n const matches = dec.match(re);\n if (matches == null || matches.length != 7) {\n return false;\n }\n\n if (global) {\n addGlobalAlias(matches[1], matches[4] || matches[6]);\n } else {\n addAlias(matches[1], matches[4] || matches[6]);\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 * 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 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 from \"react-draggable\";\nimport { ResizableBox } 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 { Theme } from \"@mui/material\";\nimport { findRunningScript } from \"../../Script/ScriptHelpers\";\nimport { Player } from \"../../Player\";\nimport { debounce } from \"lodash\";\nimport { Settings } from \"../../Settings/Settings\";\n\nlet layerCounter = 0;\n\nexport const LogBoxEvents = new EventEmitter<[RunningScript]>();\nexport const LogBoxCloserEvents = new EventEmitter<[number]>();\nexport const LogBoxClearEvents = new EventEmitter<[]>();\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: any): 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((_theme: Theme) =>\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 [minimized, setMinimized] = useState(false);\n function rerender(): void {\n setRerender((old) => !old);\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 useEffect(() => {\n updateLayer();\n const id = setInterval(rerender, 1000);\n return () => clearInterval(id);\n }, []);\n\n function kill(): void {\n killWorkerScript(script, script.server, true);\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(Player, 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: any): 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): string {\n if (s.match(/(^\\[[^\\]]+\\] )?ERROR/) || s.match(/(^\\[[^\\]]+\\] )?FAIL/)) {\n return Settings.theme.error;\n }\n if (s.match(/(^\\[[^\\]]+\\] )?SUCCESS/)) {\n return Settings.theme.success;\n }\n if (s.match(/(^\\[[^\\]]+\\] )?WARN/)) {\n return Settings.theme.warning;\n }\n if (s.match(/(^\\[[^\\]]+\\] )?INFO/)) {\n return Settings.theme.info;\n }\n return Settings.theme.primary;\n }\n\n // And trigger fakeDrag when the window is resized\n useEffect(() => {\n window.addEventListener(\"resize\", onResize);\n return () => {\n window.removeEventListener(\"resize\", onResize);\n };\n }, []);\n\n const onResize = debounce((): void => {\n const node = draggableRef?.current;\n if (!node) return;\n\n if (!isOnScreen(node)) {\n resetPosition();\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 resetPosition = (): void => {\n const node = rootRef?.current;\n if (!node) return;\n const state = node.state as { x: number; y: number };\n state.x = 0;\n state.y = 0;\n node.setState(state);\n };\n\n const boundToBody = (e: any): void | false => {\n if (e.clientX < 0 || e.clientY < 0 || e.clientX > innerWidth || e.clientY > innerHeight) 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 {line}\n
\n
\n ),\n )}\n
\n \n \n \n \n
\n );\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","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","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","import { FactionInfo, FactionInfos } from \"./FactionInfo\";\nimport { favorToRep, repToFavor } from \"./formulas/favor\";\nimport { Generic_fromJSON, Generic_toJSON, 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(): any {\n return Generic_toJSON(\"Faction\", this);\n }\n\n /**\n * Initiatizes a Faction object from a JSON save state.\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): Faction {\n return Generic_fromJSON(Faction, value.data);\n }\n}\n\nReviver.constructors.Faction = Faction;\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 { 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","export enum FactionWorkType {\n Field,\n Hacking,\n None,\n Security,\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 { isScriptErrorMessage, makeRuntimeRejectMsg } from \"./NetscriptEvaluator\";\nimport { NetscriptFunctions } from \"./NetscriptFunctions\";\nimport { executeJSScript } 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\";\nimport { sprintf } from \"sprintf-js\";\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 { IPlayer } from \"./PersonObjects/IPlayer\";\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(player: IPlayer, workerScript: WorkerScript): Promise {\n workerScript.running = true;\n\n // The name of the currently running netscript function, to prevent concurrent\n // calls to hack, grow, etc.\n let runningFn: string | null = null;\n\n // We need to go through the environment and wrap each function in such a way that it\n // can be called at most once at a time. This will prevent situations where multiple\n // hack promises are outstanding, for example.\n function wrap(propName: string, f: (...args: any[]) => Promise): (...args: any[]) => Promise {\n // This function unfortunately cannot be an async function, because we don't\n // know if the original one was, and there's no way to tell.\n return function (...args: any[]) {\n // Wrap every netscript function with a check for the stop flag.\n // This prevents cases where we never stop because we are only calling\n // netscript functions that don't check this.\n // This is not a problem for legacy Netscript because it also checks the\n // stop flag in the evaluator.\n if (workerScript.env.stopFlag) {\n throw new ScriptDeath(workerScript);\n }\n\n if (propName === \"asleep\") return f(...args); // OK for multiple simultaneous calls to sleep.\n\n const msg =\n \"Concurrent calls to Netscript functions are not allowed! \" +\n \"Did you forget to await hack(), grow(), or some other \" +\n \"promise-returning function? (Currently running: %s tried to run: %s)\";\n if (runningFn) {\n workerScript.errorMessage = makeRuntimeRejectMsg(workerScript, sprintf(msg, runningFn, propName));\n throw new ScriptDeath(workerScript);\n }\n runningFn = propName;\n\n // If the function throws an error, clear the runningFn flag first, and then re-throw it\n // This allows people to properly catch errors thrown by NS functions without getting\n // the concurrent call error above\n let result;\n try {\n result = f(...args);\n } catch (e: any) {\n runningFn = null;\n throw e;\n }\n\n if (result && result.finally !== undefined) {\n return result.finally(function () {\n runningFn = null;\n });\n } else {\n runningFn = null;\n return result;\n }\n };\n }\n\n function wrapObject(vars: any, ...tree: string[]): void {\n for (const prop of Object.keys(vars)) {\n switch (typeof vars[prop]) {\n case \"function\": {\n vars[prop] = wrap([...tree, prop].join(\".\"), vars[prop]);\n break;\n }\n case \"object\": {\n if (Array.isArray(vars[prop])) continue;\n wrapObject(vars[prop], ...tree, prop);\n break;\n }\n }\n }\n }\n wrapObject(workerScript.env.vars);\n\n // Note: the environment that we pass to the JS script only needs to contain the functions visible\n // to that script, which env.vars does at this point.\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 = makeRuntimeRejectMsg(workerScript, e.message + \" (sorry we can't be more helpful)\");\n } else {\n workerScript.errorMessage = makeRuntimeRejectMsg(\n workerScript,\n e.message + ((e.stack && \"\\nstack:\\n\" + e.stack.toString()) || \"\"),\n );\n }\n throw new ScriptDeath(workerScript);\n } else if (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 = makeRuntimeRejectMsg(workerScript, \"\" + e);\n throw new ScriptDeath(workerScript);\n });\n}\n\nfunction startNetscript1Script(workerScript: WorkerScript): Promise {\n const code = workerScript.code;\n workerScript.running = true;\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: any) {\n dialogBoxCreate(\"Error processing Imports in \" + workerScript.name + \":
\" + e);\n workerScript.env.stopFlag = true;\n workerScript.running = false;\n killWorkerScript(workerScript);\n return Promise.resolve();\n }\n\n const interpreterInitialization = function (int: any, scope: any): void {\n //Add the Netscript environment\n const ns = NetscriptFunctions(workerScript);\n for (const name of Object.keys(ns)) {\n const entry = ns[name];\n if (typeof entry === \"function\") {\n //Async functions need to be wrapped. See JS-Interpreter documentation\n if (\n [\"hack\", \"grow\", \"weaken\", \"sleep\", \"prompt\", \"manualHack\", \"scp\", \"write\", \"share\", \"wget\"].includes(name)\n ) {\n const tempWrapper = function (...args: any[]): void {\n const fnArgs = [];\n\n //All of the Object/array elements are in JSInterpreter format, so\n //we have to convert them back to native format to pass them to these fns\n for (let i = 0; i < args.length - 1; ++i) {\n if (typeof args[i] === \"object\" || args[i].constructor === Array) {\n fnArgs.push(int.pseudoToNative(args[i]));\n } else {\n fnArgs.push(args[i]);\n }\n }\n const cb = args[args.length - 1];\n const fnPromise = entry(...fnArgs);\n fnPromise\n .then(function (res: any) {\n cb(res);\n })\n .catch(function (err: any) {\n // workerscript is when you cancel a delay\n if (!(err instanceof ScriptDeath)) {\n console.error(err);\n const errorTextArray = err.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 workerScript.running = false;\n killWorkerScript(workerScript);\n return Promise.resolve();\n }\n });\n };\n int.setProperty(scope, name, int.createAsyncFunction(tempWrapper));\n } else if (\n name === \"sprintf\" ||\n name === \"vsprintf\" ||\n name === \"scp\" ||\n name == \"write\" ||\n name === \"tryWrite\" ||\n name === \"run\" ||\n name === \"exec\"\n ) {\n const tempWrapper = function (...args: any[]): void {\n const fnArgs = [];\n\n //All of the Object/array elements are in JSInterpreter format, so\n //we have to convert them back to native format to pass them to these fns\n for (let i = 0; i < args.length; ++i) {\n if (typeof args[i] === \"object\" || args[i].constructor === Array) {\n fnArgs.push(int.pseudoToNative(args[i]));\n } else {\n fnArgs.push(args[i]);\n }\n }\n\n return entry(...fnArgs);\n };\n int.setProperty(scope, name, int.createNativeFunction(tempWrapper));\n } else {\n const tempWrapper = function (...args: any[]): any {\n const res = entry(...args);\n\n if (res == null) {\n return res;\n } else if (res.constructor === Array || res === Object(res)) {\n //Objects and Arrays must be converted to the interpreter's format\n return int.nativeToPseudo(res);\n } else {\n return res;\n }\n };\n int.setProperty(scope, name, int.createNativeFunction(tempWrapper));\n }\n } else {\n //bladeburner, or anything else\n int.setProperty(scope, name, int.nativeToPseudo(entry));\n }\n }\n\n //Add the arguments\n int.setProperty(scope, \"args\", int.nativeToPseudo(workerScript.args));\n };\n\n let interpreter: any;\n try {\n interpreter = new Interpreter(codeWithImports, interpreterInitialization, codeLineOffset);\n } catch (e: any) {\n dialogBoxCreate(\"Syntax ERROR in \" + workerScript.name + \":
\" + e);\n workerScript.env.stopFlag = true;\n workerScript.running = false;\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: any) {\n e = e.toString();\n if (!isScriptErrorMessage(e)) {\n e = makeRuntimeRejectMsg(workerScript, e);\n }\n workerScript.errorMessage = e;\n return reject(new ScriptDeath(workerScript));\n }\n }\n\n try {\n runInterpreter();\n } catch (e: any) {\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): any {\n //allowReserved prevents 'import' from throwing error in ES5\n const ast: any = 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: any) => {\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: any[] = []; //FunctionDeclaration Node objects\n walksimple(scriptAst, {\n FunctionDeclaration: (node: any) => {\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: any) => {\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: any) => {\n fnsToImport.push(e.local.name);\n });\n\n //Walk through script and get FunctionDeclaration code for all specified fns\n const fnDeclarations: any[] = [];\n walksimple(scriptAst, {\n FunctionDeclaration: (node: any) => {\n if (fnsToImport.includes(node.id.name)) {\n fnDeclarations.push(node);\n }\n },\n });\n\n //Convert FunctionDeclarations into code\n fnDeclarations.forEach((fn: any) => {\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 * @param {RunningScript} runningScriptObj - Script that's being run\n * @param {Server} server - Server on which the script is to be run\n * @returns {number} pid of started script\n */\nexport function startWorkerScript(\n player: IPlayer,\n runningScript: RunningScript,\n server: BaseServer,\n parent?: WorkerScript,\n): number {\n if (createAndAddWorkerScript(player, 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(\n player: IPlayer,\n runningScriptObj: RunningScript,\n server: BaseServer,\n parent?: WorkerScript,\n): 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\") || workerScript.name.endsWith(\".ns\")) {\n scriptExecution = startNetscript2Script(player, 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.running = false;\n workerScript.env.stopFlag = true;\n // On natural death, the earnings are transfered to the parent if it still exists.\n if (parent !== undefined) {\n if (parent.running) {\n parent.scriptRef.onlineExpGained += runningScriptObj.onlineExpGained;\n parent.scriptRef.onlineMoneyMade += runningScriptObj.onlineMoneyMade;\n }\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 (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 (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(player: IPlayer): 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(player, 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 player: IPlayer,\n caller: string,\n server: BaseServer,\n scriptname: string,\n args: any[],\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(player, runningScriptObj, server, workerScript);\n }\n\n workerScript.log(caller, () => `Could not find script '${scriptname}' on '${server.hostname}'`);\n return 0;\n}\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 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: any[][];\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: any[], i: number) => (\n \n {row.map((elem: any, i: number) => (\n \n {elem}\n \n ))}\n \n ))}\n \n \n \n );\n}\n","import { Generic_fromJSON, Generic_toJSON, 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(): any {\n return Generic_toJSON(\"Material\", this);\n }\n\n // Initiatizes a Material object from a JSON save state.\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): 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\ninterface Gang {\n respect: number;\n territory: number;\n wantedLevel: number;\n}\n\nexport function calculateWantedPenalty(gang: Gang): number {\n return gang.respect / (gang.respect + gang.wantedLevel);\n}\n\nexport function calculateRespectGain(gang: Gang, 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: Gang, 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: Gang, 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","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 { Reviver, Generic_toJSON, Generic_fromJSON } 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, Page } 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 { BlackOperationNames } from \"./data/BlackOperationNames\";\nimport { KEY } from \"../utils/helpers/keyCodes\";\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: any) {\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: any) {\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: any) {\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): void {\n // This does NOT handle deduction of skill points\n const skillName = skill.name;\n if (this.skills[skillName]) {\n ++this.skills[skillName];\n } else {\n this.skills[skillName] = 1;\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: any) {\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 === '\"') {\n // Double quotes\n const endQuote = command.indexOf('\"', 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 === \"'\") {\n // Single quotes, same thing as above\n const endQuote = command.indexOf(\"'\", 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, 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 = this.actionTimeToComplete;\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 = Math.pow(person.charisma, CharismaExponentialFactor) + person.charisma / CharismaLinearFactor;\n return (100 - charismaEff) / 100;\n }\n\n getRecruitmentSuccessChance(person: IPerson): number {\n return Math.pow(person.charisma, 0.45) / (this.teamSize - this.sleeveSize + 1);\n }\n\n getRecruitmentTime(person: IPerson): number {\n const effCharisma = person.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) => x.bbAction == \"Support main sleeve\");\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].max_hp);\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, 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, 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: any) {\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, 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, 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) => x.bbAction == \"Support main sleeve\");\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].max_hp);\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: any) {\n exceptionAlert(e);\n }\n break;\n }\n case ActionTypes[\"Training\"]: {\n this.stamina -= 0.5 * BladeburnerConstants.BaseStaminaLoss;\n const strExpGain = 30 * person.strength_exp_mult,\n defExpGain = 30 * person.defense_exp_mult,\n dexExpGain = 30 * person.dexterity_exp_mult,\n agiExpGain = 30 * person.agility_exp_mult,\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.hacking, 0.3) +\n 0.04 * Math.pow(person.intelligence, 0.9) +\n 0.02 * Math.pow(person.charisma, 0.3);\n eff *= person.bladeburner_analysis_mult;\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.hacking_exp_mult;\n const charismaExpGain = 20 * person.charisma_exp_mult;\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) => s.bbAction === \"Infiltrate synthoids\").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.faction_rep_mult * 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 (action.name === BlackOperationNames.OperationDaedalus && this.blackops[action.name]) {\n this.resetAction();\n router.toBitVerse(false, false);\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.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.bladeburner_stamina_gain_mult);\n }\n\n calculateMaxStamina(player: IPlayer): void {\n const effAgility = player.agility * this.skillMultipliers.effAgi;\n const maxStamina =\n (Math.pow(effAgility, 0.8) + this.staminaBonus) *\n this.skillMultipliers.stamina *\n player.bladeburner_max_stamina_mult;\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 // Edge case condition...if Operation Daedalus is complete trigger the BitNode\n if (router.page() !== Page.BitVerse && this.blackops.hasOwnProperty(BlackOperationNames.OperationDaedalus)) {\n return router.toBitVerse(false, false);\n }\n\n // If the Player starts doing some other actions, set action to idle and alert\n if (!player.hasAugmentation(AugmentationNames.BladesSimulacrum, true) && player.isWorking) {\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: any) {\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, 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);\n } else {\n return skill.calculateCost(this.skills[skillName]);\n }\n }\n\n upgradeSkillNetscriptFn(skillName: string, 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);\n\n if (skill.maxLvl && currentLevel >= skill.maxLvl) {\n workerScript.log(\"bladeburner.upgradeSkill\", () => `Skill '${skillName}' is already maxed.`);\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} (You have ${this.skillPoints}, you need ${cost})`,\n );\n return false;\n }\n\n this.skillPoints -= cost;\n this.upgradeSkill(skill);\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(): any {\n return Generic_toJSON(\"Bladeburner\", this);\n }\n\n /**\n * Initiatizes a Bladeburner object from a JSON save state.\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): 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 * 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, 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(): any {\n return Generic_toJSON(\"HacknetNode\", this);\n }\n\n /**\n * Initiatizes a HacknetNode object from a JSON save state.\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): 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, 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 filename: string = this.fn;\n const file: Blob = new Blob([this.text], { type: \"text/plain\" });\n /* tslint:disable-next-line:strict-boolean-expressions */\n const navigator = window.navigator as any;\n if (navigator.msSaveOrOpenBlob) {\n // IE10+\n navigator.msSaveOrOpenBlob(file, filename);\n } else {\n // Others\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 /**\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(): any {\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 // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): 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 { 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 ScriptGetOwnedSourceFiles: 5,\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 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 buy: RamCostConstants.ScriptBuySellStockRamCost,\n sell: RamCostConstants.ScriptBuySellStockRamCost,\n short: 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 getStats: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost / 4),\n getCharacterInformation: 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 getAugmentationsFromFaction: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\n getAugmentationCost: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\n getAugmentationPrereq: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\n getAugmentationPrice: 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};\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};\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};\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 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 getScriptIncome: 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 getOwnedSourceFiles: RamCostConstants.ScriptGetOwnedSourceFiles,\n tail: 0,\n toast: 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 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 },\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","// 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","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 { 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 { 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, 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(): any {\n return Generic_toJSON(\"Company\", this);\n }\n\n /**\n * Initiatizes a Company from a JSON save state.\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): Company {\n return Generic_fromJSON(Company, value.data);\n }\n}\n\nReviver.constructors.Company = Company;\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, 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: any) {\n exceptionAlert(e);\n }\n }\n\n // Serialize the current object to a JSON save state.\n toJSON(): any {\n return Generic_toJSON(\"Warehouse\", this);\n }\n\n // Initiatizes a Warehouse object from a JSON save state.\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): Warehouse {\n return Generic_fromJSON(Warehouse, value.data);\n }\n}\n\nReviver.constructors.Warehouse = Warehouse;\n","import { IPlayer } from \"../IPlayer\";\nimport { Faction } from \"../../Faction/Faction\";\nimport { CONSTANTS } from \"../../Constants\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { CalculateShareMult } from \"../../NetworkShare/Share\";\n\nfunction mult(f: Faction): number {\n let favorMult = 1 + f.favor / 100;\n if (isNaN(favorMult)) {\n favorMult = 1;\n }\n return favorMult * BitNodeMultipliers.FactionWorkRepGain;\n}\n\nexport function getHackingWorkRepGain(p: IPlayer, f: Faction): number {\n return (\n ((p.hacking + p.intelligence / 3) / CONSTANTS.MaxSkillLevel) *\n p.faction_rep_mult *\n p.getIntelligenceBonus(1) *\n mult(f) *\n CalculateShareMult()\n );\n}\n\nexport function getFactionSecurityWorkRepGain(p: IPlayer, f: Faction): number {\n const t =\n (0.9 * (p.strength + p.defense + p.dexterity + p.agility + (p.hacking + p.intelligence) * CalculateShareMult())) /\n CONSTANTS.MaxSkillLevel /\n 4.5;\n return t * p.faction_rep_mult * mult(f) * p.getIntelligenceBonus(1);\n}\n\nexport function getFactionFieldWorkRepGain(p: IPlayer, f: Faction): number {\n const t =\n (0.9 *\n (p.strength +\n p.defense +\n p.dexterity +\n p.agility +\n p.charisma +\n (p.hacking + p.intelligence) * CalculateShareMult())) /\n CONSTANTS.MaxSkillLevel /\n 5.5;\n return t * p.faction_rep_mult * mult(f) * p.getIntelligenceBonus(1);\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 { WorkerScript } from \"../Netscript/WorkerScript\";\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\";\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 {WorkerScript} workerScript - 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 workerScript: WorkerScript | 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 (workerScript) {\n workerScript.log(\"stock.buy\", () => `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 (workerScript) {\n workerScript.log(\n \"stock.buy\",\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 (workerScript) {\n workerScript.log(\n \"stock.buy\",\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 (workerScript) {\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 workerScript.log(\"stock.buy\", () => 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 {WorkerScript} workerScript - 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 workerScript: WorkerScript | null = null,\n opts: IOptions = {},\n): boolean {\n // Sanitize/Validate arguments\n if (stock == null || shares < 0 || isNaN(shares)) {\n if (workerScript) {\n workerScript.log(\"stock.sell\", () => `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 (workerScript) {\n 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 (workerScript) {\n const resultTxt =\n `Sold ${numeralWrapper.formatShares(shares)} shares of ${stock.symbol}. ` +\n `After commissions, you gained a total of ${numeralWrapper.formatMoney(gains)}.`;\n workerScript.log(\"stock.sell\", () => 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 {WorkerScript} workerScript - 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 workerScript: WorkerScript | 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 (workerScript) {\n workerScript.log(\"stock.short\", () => `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 (workerScript) {\n workerScript.log(\n \"stock.short\",\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 (workerScript) {\n workerScript.log(\n \"stock.short\",\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 (workerScript) {\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 workerScript.log(\"stock.short\", () => 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 {WorkerScript} workerScript - 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 workerScript: WorkerScript | null = null,\n opts: IOptions = {},\n): boolean {\n if (stock == null || isNaN(shares) || shares < 0) {\n if (workerScript) {\n workerScript.log(\"stock.sellShort\", () => `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 (workerScript) {\n workerScript.log(\n \"stock.sellShort\",\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 (workerScript) {\n 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 (workerScript) {\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 workerScript.log(\"stock.sellShort\", () => 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 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): number {\n return Math.floor((this.baseCost + currentLevel * this.costInc) * BitNodeMultipliers.BladeburnerSkillCost);\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","/**\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, Reviver } from \"../utils/JSONReviver\";\nimport { roundToTwo } from \"../utils/helpers/roundToTwo\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\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: any = \"\";\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 // 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.ramUsage = 0;\n this.server = server; // hostname of server this script is on\n this.module = \"\";\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 navigator = window.navigator as any;\n if (navigator.msSaveOrOpenBlob) {\n // IE10+\n navigator.msSaveOrOpenBlob(file, filename);\n } else {\n // Others\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 /**\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 = \"\";\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 if (dependentScript !== null) 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 async updateRamUsage(player: IPlayer, otherScripts: Script[]): Promise {\n const res = await 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(): any {\n return Generic_toJSON(\"Script\", this);\n }\n\n // Initializes a Script Object from a JSON save state\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): 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","/**\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: T[]): string {\n const vals: any[] = [];\n for (let i = 0; i < a.length; ++i) {\n let elem: any = 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 { 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, 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(): any {\n return Generic_toJSON(\"ActionIdentifier\", this);\n }\n\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): 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 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 function exceptionAlert(e: IError | string): void {\n console.error(e);\n let msg = \"\";\n let file = \"UNKNOWN FILE NAME\";\n let line = \"UNKNOWN LINE NUMBER\";\n const isError = (e: IError | string): e is IError => e.hasOwnProperty(\"fileName\");\n if (isError(e)) {\n file = e.fileName ?? file;\n line = e.lineNumber?.toString() ?? line;\n } else {\n msg = 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","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, 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(): any {\n return Generic_toJSON(\"ActiveFragment\", this);\n }\n\n /**\n * Initializes an acive fragment from a JSON save state\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): ActiveFragment {\n return Generic_fromJSON(ActiveFragment, value.data);\n }\n}\n\nReviver.constructors.ActiveFragment = ActiveFragment;\n","import { CONSTANTS } from \"../Constants\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { IPerson } from \"../PersonObjects/IPerson\";\nimport { IRouter } from \"../ui/Router\";\nimport { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { CrimeType } from \"../utils/WorkType\";\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 // 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 type: CrimeType,\n time = 0,\n money = 0,\n difficulty = 0,\n karma = 0,\n params: IConstructorParams = {},\n ) {\n this.name = name;\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(router: IRouter, p: IPlayer, div = 1, workerScript: WorkerScript | null = null): number {\n if (div <= 0) {\n div = 1;\n }\n p.startCrime(\n router,\n this.type,\n this.hacking_exp / div,\n this.strength_exp / div,\n this.defense_exp / div,\n this.dexterity_exp / div,\n this.agility_exp / div,\n this.charisma_exp / div,\n this.money / div,\n this.time,\n workerScript,\n );\n\n return this.time;\n }\n\n successRate(p: IPerson): number {\n let chance: number =\n this.hacking_success_weight * p.hacking +\n this.strength_success_weight * p.strength +\n this.defense_success_weight * p.defense +\n this.dexterity_success_weight * p.dexterity +\n this.agility_success_weight * p.agility +\n this.charisma_success_weight * p.charisma +\n CONSTANTS.IntelligenceCrimeWeight * p.intelligence;\n chance /= CONSTANTS.MaxSkillLevel;\n chance /= this.difficulty;\n chance *= p.crime_success_mult;\n chance *= p.getIntelligenceBonus(1);\n\n return Math.min(chance, 1);\n }\n}\n","export function calculateIntelligenceBonus(intelligence: number, weight = 1): number {\n return 1 + (weight * Math.pow(intelligence, 0.8)) / 600;\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","export enum GameOptionsTab {\n SYSTEM,\n INTERFACE,\n GAMEPLAY,\n MISC,\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","/**\n * Event emitter that triggers when scripts are started/stopped\n */\nimport { EventEmitter } from \"../utils/EventEmitter\";\n\nexport const WorkerScriptStartStopEventEmitter = new EventEmitter<[]>();\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: any[]) => 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 consumud 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.log(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 consumud 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: string) => {\n const data = await window.appSaveFns.getSaveInfo(save);\n bridge.send(\"get-save-info-response\", data);\n });\n bridge.receive(\"push-save-request\", ({ save, automatic = false }: { 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.log(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.log(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.log(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 { 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 { ClassType } from \"../utils/WorkType\";\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.hacking >= 100000,\n },\n COMBAT_3000: {\n ...achievementData[\"COMBAT_3000\"],\n Icon: \"combat3000\",\n Condition: () =>\n Player.strength >= 3000 && Player.defense >= 3000 && Player.dexterity >= 3000 && Player.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: () =>\n Player.getHomeComputer().scripts.some((s) => s.filename.endsWith(\".js\") || s.filename.endsWith(\".ns\")),\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: () => Object.values(Factions).some((f) => f.favor >= 150),\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: () =>\n [ClassType.GymStrength, ClassType.GymDefense, ClassType.GymDexterity, ClassType.GymAgility].includes(\n Player.className,\n ),\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.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.hacking_exp > 0 ||\n s.strength_exp > 0 ||\n s.defense_exp > 0 ||\n s.agility_exp > 0 ||\n s.dexterity_exp > 0 ||\n s.charisma_exp > 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","// 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 { WorkType } from \"../../utils/WorkType\";\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.intelligence === 0) return <>;\n const progress = player.calculateSkillProgress(player.intelligence_exp);\n\n return (\n <>\n \n \n Int \n \n \n {numeralWrapper.formatSkill(player.intelligence)}\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\n if (!player.isWorking || player.focus) return <>;\n\n let details = <>;\n let header = <>;\n let innerText = <>;\n switch (player.workType) {\n case WorkType.CompanyPartTime:\n case WorkType.Company:\n details = (\n <>\n {player.jobs[player.companyName]} at {player.companyName}\n \n );\n header = (\n <>\n Working at {player.companyName}\n \n );\n innerText = (\n <>\n + rep\n \n );\n break;\n case WorkType.Faction:\n details = (\n <>\n {player.factionWorkType} for {player.currentWorkFactionName}\n \n );\n header = (\n <>\n Working for {player.currentWorkFactionName}\n \n );\n innerText = (\n <>\n + rep\n \n );\n break;\n case WorkType.StudyClass:\n details = <>{player.workType};\n header = <>You are {player.className};\n innerText = <>{convertTimeMsToTimeElapsedString(player.timeWorked)};\n break;\n case WorkType.CreateProgram:\n details = <>Coding {player.createProgramName};\n header = <>Creating a program;\n innerText = (\n <>\n {player.createProgramName}{\" \"}\n {((player.timeWorkedCreateProgram / player.timeNeededToCompleteWork) * 100).toFixed(2)}%\n \n );\n break;\n case WorkType.GraftAugmentation:\n details = <>Grafting {player.graftAugmentationName};\n header = <>Grafting an Augmentation;\n innerText = (\n <>\n {((player.timeWorkedGraftAugmentation / player.timeNeededToCompleteWork) * 100).toFixed(2)}%{\" \"}\n done\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.hacking_exp,\n player.hacking_mult * BitNodeMultipliers.HackingLevelMultiplier,\n );\n const strengthProgress = player.calculateSkillProgress(\n player.strength_exp,\n player.strength_mult * BitNodeMultipliers.StrengthLevelMultiplier,\n );\n const defenseProgress = player.calculateSkillProgress(\n player.defense_exp,\n player.defense_mult * BitNodeMultipliers.DefenseLevelMultiplier,\n );\n const dexterityProgress = player.calculateSkillProgress(\n player.dexterity_exp,\n player.dexterity_mult * BitNodeMultipliers.DexterityLevelMultiplier,\n );\n const agilityProgress = player.calculateSkillProgress(\n player.agility_exp,\n player.agility_mult * BitNodeMultipliers.AgilityLevelMultiplier,\n );\n const charismaProgress = player.calculateSkillProgress(\n player.charisma_exp,\n player.charisma_mult * BitNodeMultipliers.CharismaLevelMultiplier,\n );\n\n return (\n <>\n \n \n \n \n HP \n \n \n \n {numeralWrapper.formatHp(player.hp)} / {numeralWrapper.formatHp(player.max_hp)}\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 {numeralWrapper.formatSkill(player.hacking)}\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 {numeralWrapper.formatSkill(player.strength)}\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 {numeralWrapper.formatSkill(player.defense)}\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 {numeralWrapper.formatSkill(player.dexterity)}\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 {numeralWrapper.formatSkill(player.agility)}\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 {numeralWrapper.formatSkill(player.charisma)}\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","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","/**\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 { IMap } from \"../types\";\n\nexport type IndustryUpgrade = [number, number, number, number, string, string];\n\n// Industry upgrades\n// The data structure is an array with the following format:\n// [index in array, base price, price mult, benefit mult (if applicable), name, desc]\nexport const IndustryUpgrades: IMap = {\n \"0\": [0, 500e3, 1, 1.05, \"Coffee\", \"Provide your employees with coffee, increasing their energy by 5%.\"],\n \"1\": [\n 1,\n 1e9,\n 1.06,\n 1.03,\n \"AdVert.Inc\",\n \"Hire AdVert.Inc to advertise your company. Each level of \" +\n \"this upgrade grants your company a static increase of 3 and 1 to its awareness and \" +\n \"popularity, respectively. It will then increase your company's awareness by 1%, and its popularity \" +\n \"by a random percentage between 1% and 3%. These effects are increased by other upgrades \" +\n \"that increase the power of your advertising.\",\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","/**\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 */\nimport { SleeveTaskType } from \"./SleeveTaskTypesEnum\";\n\nimport { IPlayer } from \"../IPlayer\";\nimport { Person } from \"../Person\";\nimport { ITaskTracker, createTaskTracker } from \"../ITaskTracker\";\n\nimport { Augmentation } from \"../../Augmentation/Augmentation\";\n\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\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\";\nimport { FactionWorkType } from \"../../Faction/FactionWorkTypeEnum\";\n\nimport { CityName } from \"../../Locations/data/CityNames\";\nimport { LocationName } from \"../../Locations/data/LocationNames\";\n\nimport { Generic_fromJSON, Generic_toJSON, Reviver } from \"../../utils/JSONReviver\";\nimport { BladeburnerConstants } from \"../../Bladeburner/data/Constants\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { capitalizeFirstLetter, capitalizeEachWord } from \"../../utils/StringHelperFunctions\";\n\nexport class Sleeve extends Person {\n /**\n * Stores the name of the class that the player is currently taking\n */\n className = \"\";\n\n /**\n * Stores the type of crime the sleeve is currently attempting\n * Must match the name of a Crime object\n */\n crimeType = \"\";\n\n /**\n * Enum value for current task\n */\n currentTask: SleeveTaskType = SleeveTaskType.Idle;\n\n /**\n * Contains details about the sleeve's current task. The info stored\n * in this depends on the task type\n *\n * Faction/Company Work: Name of Faction/Company\n * Crime: Money earned if successful\n * Class/Gym: Name of university/gym\n * Bladeburner: success chance\n */\n currentTaskLocation = \"\";\n\n /**\n * Maximum amount of time (in milliseconds) that can be spent on current task.\n */\n currentTaskMaxTime = 0;\n\n /**\n * Milliseconds spent on current task\n */\n currentTaskTime = 0;\n\n /**\n * Keeps track of experience earned for other sleeves\n */\n earningsForSleeves: ITaskTracker = createTaskTracker();\n\n /**\n * Keeps track of experience + money earned for player\n */\n earningsForPlayer: ITaskTracker = createTaskTracker();\n\n /**\n * Keeps track of experienced earned in the current task/action\n */\n earningsForTask: ITaskTracker = createTaskTracker();\n\n /**\n * Keeps track of what type of work sleeve is doing for faction, if applicable\n */\n factionWorkType: FactionWorkType = FactionWorkType.None;\n\n /**\n * Records experience gain rate for the current task\n */\n gainRatesForTask: ITaskTracker = createTaskTracker();\n\n /**\n * String that stores what stat the sleeve is training at the gym\n */\n gymStatType = \"\";\n\n /**\n * String that stores what stat the sleeve is training at the gym\n */\n bbAction = \"\";\n\n /**\n * String that stores what stat the sleeve is training at the gym\n */\n bbContract = \"\";\n\n /**\n * Keeps track of events/notifications for this sleeve\n */\n logs: string[] = [];\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. Other sleeves get sync^2% of exp\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 /**\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 if (this.currentTask !== SleeveTaskType.Idle) {\n this.finishTask(p);\n } else {\n this.resetTaskStatus(p);\n }\n\n this.gainRatesForTask.hack = crime.hacking_exp * this.hacking_exp_mult * BitNodeMultipliers.CrimeExpGain;\n this.gainRatesForTask.str = crime.strength_exp * this.strength_exp_mult * BitNodeMultipliers.CrimeExpGain;\n this.gainRatesForTask.def = crime.defense_exp * this.defense_exp_mult * BitNodeMultipliers.CrimeExpGain;\n this.gainRatesForTask.dex = crime.dexterity_exp * this.dexterity_exp_mult * BitNodeMultipliers.CrimeExpGain;\n this.gainRatesForTask.agi = crime.agility_exp * this.agility_exp_mult * BitNodeMultipliers.CrimeExpGain;\n this.gainRatesForTask.cha = crime.charisma_exp * this.charisma_exp_mult * BitNodeMultipliers.CrimeExpGain;\n this.gainRatesForTask.int = crime.intelligence_exp;\n this.gainRatesForTask.money = crime.money * this.crime_money_mult * BitNodeMultipliers.CrimeMoney;\n\n this.currentTaskLocation = String(this.gainRatesForTask.money);\n\n this.crimeType = crime.name;\n this.currentTaskMaxTime = crime.time;\n this.currentTask = SleeveTaskType.Crime;\n return true;\n }\n\n /**\n * Called to stop the current task\n */\n finishTask(p: IPlayer): ITaskTracker {\n let retValue: ITaskTracker = createTaskTracker(); // Amount of exp to be gained by other sleeves\n\n if (this.currentTask === SleeveTaskType.Crime) {\n // For crimes, all experience and money is gained at the end\n if (this.currentTaskTime >= this.currentTaskMaxTime) {\n const crime: Crime | undefined = Object.values(Crimes).find((crime) => crime.name === this.crimeType);\n if (!crime) {\n console.error(`Invalid data stored in sleeve.crimeType: ${this.crimeType}`);\n this.resetTaskStatus(p);\n return retValue;\n }\n if (Math.random() < crime.successRate(this)) {\n // Success\n const successGainRates: ITaskTracker = createTaskTracker();\n\n const keysForIteration: (keyof ITaskTracker)[] = Object.keys(successGainRates) as (keyof ITaskTracker)[];\n for (let i = 0; i < keysForIteration.length; ++i) {\n const key = keysForIteration[i];\n successGainRates[key] = this.gainRatesForTask[key] * 2;\n }\n retValue = this.gainExperience(p, successGainRates);\n this.gainMoney(p, this.gainRatesForTask);\n\n p.karma -= crime.karma * (this.sync / 100);\n } else {\n retValue = this.gainExperience(p, this.gainRatesForTask);\n }\n\n // Do not reset task to IDLE\n this.currentTaskTime = 0;\n return retValue;\n }\n } else if (this.currentTask === SleeveTaskType.Bladeburner) {\n if (this.currentTaskMaxTime === 0) {\n this.currentTaskTime = 0;\n return retValue;\n }\n // For bladeburner, all experience and money is gained at the end\n const bb = p.bladeburner;\n if (bb === null) {\n const errorLogText = `bladeburner is null`;\n console.error(`Function: sleeves.finishTask; Message: '${errorLogText}'`);\n this.resetTaskStatus(p);\n return retValue;\n }\n\n if (this.currentTaskTime >= this.currentTaskMaxTime) {\n if (this.bbAction === \"Infiltrate synthoids\") {\n bb.infiltrateSynthoidCommunities(p);\n this.currentTaskTime = 0;\n return retValue;\n }\n let type: string;\n let name: string;\n if (this.bbAction === \"Take on contracts\") {\n type = \"Contracts\";\n name = this.bbContract;\n } else {\n type = \"General\";\n name = this.bbAction;\n }\n\n const actionIdent = bb.getActionIdFromTypeAndName(type, name);\n if (actionIdent === null) {\n const errorLogText = `Invalid action: type='${type}' name='${name}'`;\n console.error(`Function: sleeves.finishTask; Message: '${errorLogText}'`);\n this.resetTaskStatus(p);\n return retValue;\n }\n\n const action = bb.getActionObject(actionIdent);\n if ((action?.count ?? 0) > 0) {\n const bbRetValue = bb.completeAction(p, this, actionIdent, false);\n if (bbRetValue) {\n retValue = this.gainExperience(p, bbRetValue);\n this.gainMoney(p, bbRetValue);\n\n // Do not reset task to IDLE\n this.currentTaskTime = 0;\n return retValue;\n }\n }\n }\n }\n\n this.resetTaskStatus(p);\n\n return retValue;\n }\n\n /**\n * Earn experience for any stats (supports multiple)\n * This function also handles experience propogating to Player and other sleeves\n */\n gainExperience(p: IPlayer, exp: ITaskTracker, numCycles = 1, fromOtherSleeve = false): ITaskTracker {\n // If the experience is coming from another sleeve, it is not multiplied by anything.\n // Also the player does not earn anything\n if (fromOtherSleeve) {\n if (exp.hack > 0) {\n this.hacking_exp += exp.hack;\n }\n\n if (exp.str > 0) {\n this.strength_exp += exp.str;\n }\n\n if (exp.def > 0) {\n this.defense_exp += exp.def;\n }\n\n if (exp.dex > 0) {\n this.dexterity_exp += exp.dex;\n }\n\n if (exp.agi > 0) {\n this.agility_exp += exp.agi;\n }\n\n if (exp.cha > 0) {\n this.charisma_exp += exp.cha;\n }\n\n return createTaskTracker();\n }\n\n // Experience is first multiplied by shock. Then 'synchronization'\n // is accounted for\n\n const multFac = (this.shock / 100) * (this.sync / 100) * numCycles;\n const pHackExp = exp.hack * multFac;\n const pStrExp = exp.str * multFac;\n const pDefExp = exp.def * multFac;\n const pDexExp = exp.dex * multFac;\n const pAgiExp = exp.agi * multFac;\n const pChaExp = exp.cha * multFac;\n const pIntExp = exp.int * multFac;\n\n // Experience is gained by both this sleeve and player\n if (pHackExp > 0) {\n this.gainHackingExp(pHackExp);\n p.gainHackingExp(pHackExp);\n this.earningsForPlayer.hack += pHackExp;\n this.earningsForTask.hack += pHackExp;\n }\n\n if (pStrExp > 0) {\n this.gainStrengthExp(pStrExp);\n p.gainStrengthExp(pStrExp);\n this.earningsForPlayer.str += pStrExp;\n this.earningsForTask.str += pStrExp;\n }\n\n if (pDefExp > 0) {\n this.gainDefenseExp(pDefExp);\n p.gainDefenseExp(pDefExp);\n this.earningsForPlayer.def += pDefExp;\n this.earningsForTask.def += pDefExp;\n }\n\n if (pDexExp > 0) {\n this.gainDexterityExp(pDexExp);\n p.gainDexterityExp(pDexExp);\n this.earningsForPlayer.dex += pDexExp;\n this.earningsForTask.dex += pDexExp;\n }\n\n if (pAgiExp > 0) {\n this.gainAgilityExp(pAgiExp);\n p.gainAgilityExp(pAgiExp);\n this.earningsForPlayer.agi += pAgiExp;\n this.earningsForTask.agi += pAgiExp;\n }\n\n if (pChaExp > 0) {\n this.gainCharismaExp(pChaExp);\n p.gainCharismaExp(pChaExp);\n this.earningsForPlayer.cha += pChaExp;\n this.earningsForTask.cha += pChaExp;\n }\n\n if (pIntExp > 0) {\n this.gainIntelligenceExp(pIntExp);\n p.gainIntelligenceExp(pIntExp);\n }\n\n // Record earnings for other sleeves\n this.earningsForSleeves.hack += pHackExp * (this.sync / 100);\n this.earningsForSleeves.str += pStrExp * (this.sync / 100);\n this.earningsForSleeves.def += pDefExp * (this.sync / 100);\n this.earningsForSleeves.dex += pDexExp * (this.sync / 100);\n this.earningsForSleeves.agi += pAgiExp * (this.sync / 100);\n this.earningsForSleeves.cha += pChaExp * (this.sync / 100);\n\n // Return the experience to be gained by other sleeves\n return {\n hack: pHackExp * (this.sync / 100),\n str: pStrExp * (this.sync / 100),\n def: pDefExp * (this.sync / 100),\n dex: pDexExp * (this.sync / 100),\n agi: pAgiExp * (this.sync / 100),\n cha: pChaExp * (this.sync / 100),\n int: pIntExp * (this.sync / 100),\n money: exp.money,\n };\n }\n\n /**\n * Earn money for player\n */\n gainMoney(p: IPlayer, task: ITaskTracker, numCycles = 1): void {\n const gain: number = task.money * numCycles;\n this.earningsForTask.money += gain;\n this.earningsForPlayer.money += gain;\n p.gainMoney(gain, \"sleeves\");\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 /**\n * Gets reputation gain for the current task\n * Only applicable when working for company or faction\n */\n getRepGain(p: IPlayer): number {\n if (this.currentTask === SleeveTaskType.Faction) {\n let favorMult = 1;\n const fac: Faction | null = Factions[this.currentTaskLocation];\n if (fac != null) {\n favorMult = 1 + fac.favor / 100;\n }\n\n switch (this.factionWorkType) {\n case FactionWorkType.Hacking:\n return this.getFactionHackingWorkRepGain() * (this.shock / 100) * favorMult;\n case FactionWorkType.Field:\n return this.getFactionFieldWorkRepGain() * (this.shock / 100) * favorMult;\n case FactionWorkType.Security:\n return this.getFactionSecurityWorkRepGain() * (this.shock / 100) * favorMult;\n default:\n console.warn(`Invalid Sleeve.factionWorkType property in Sleeve.getRepGain(): ${this.factionWorkType}`);\n return 0;\n }\n } else if (this.currentTask === SleeveTaskType.Company) {\n const companyName: string = this.currentTaskLocation;\n const company: Company | null = Companies[companyName];\n if (company == null) {\n console.error(`Invalid company found when trying to calculate rep gain: ${companyName}`);\n return 0;\n }\n\n const companyPosition: CompanyPosition | null = CompanyPositions[p.jobs[companyName]];\n if (companyPosition == null) {\n console.error(`Invalid company position name found when trying to calculate rep gain: ${p.jobs[companyName]}`);\n return 0;\n }\n\n const jobPerformance: number = companyPosition.calculateJobPerformance(\n this.hacking,\n this.strength,\n this.defense,\n this.dexterity,\n this.agility,\n this.charisma,\n );\n const favorMult = 1 + company.favor / 100;\n\n return jobPerformance * this.company_rep_mult * favorMult;\n } else {\n return 0;\n }\n }\n\n installAugmentation(aug: Augmentation): void {\n this.hacking_exp = 0;\n this.strength_exp = 0;\n this.defense_exp = 0;\n this.dexterity_exp = 0;\n this.agility_exp = 0;\n this.charisma_exp = 0;\n this.applyAugmentation(aug);\n this.augmentations.push({ name: aug.name, level: 1 });\n this.updateStatLevels();\n }\n\n log(entry: string): void {\n const MaxLogSize = 50;\n this.logs.push(entry);\n if (this.logs.length > MaxLogSize) {\n this.logs.shift();\n }\n }\n\n /**\n * Called on every sleeve for a Source File Prestige\n */\n prestige(p: IPlayer): void {\n // Reset exp\n this.hacking_exp = 0;\n this.strength_exp = 0;\n this.defense_exp = 0;\n this.dexterity_exp = 0;\n this.agility_exp = 0;\n this.charisma_exp = 0;\n\n // Reset task-related stuff\n this.resetTaskStatus(p);\n this.earningsForSleeves = createTaskTracker();\n this.earningsForPlayer = createTaskTracker();\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 this.logs = [];\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): ITaskTracker | null {\n // Only process once every second (5 cycles)\n const CyclesPerSecond = 1000 / CONSTANTS.MilliPerCycle;\n this.storedCycles += numCycles;\n if (this.storedCycles < CyclesPerSecond) {\n return null;\n }\n\n let cyclesUsed = this.storedCycles;\n cyclesUsed = Math.min(cyclesUsed, 15);\n let time = cyclesUsed * CONSTANTS.MilliPerCycle;\n if (this.currentTaskMaxTime !== 0 && this.currentTaskTime + time > this.currentTaskMaxTime) {\n time = this.currentTaskMaxTime - this.currentTaskTime;\n cyclesUsed = Math.floor(time / CONSTANTS.MilliPerCycle);\n\n if (time < 0 || cyclesUsed < 0) {\n console.warn(`Sleeve.process() calculated negative cycle usage`);\n time = 0;\n cyclesUsed = 0;\n }\n }\n\n this.currentTaskTime += time;\n\n // Shock gradually goes towards 100\n this.shock = Math.min(100, this.shock + 0.0001 * cyclesUsed);\n\n let retValue: ITaskTracker = createTaskTracker();\n switch (this.currentTask) {\n case SleeveTaskType.Idle:\n break;\n case SleeveTaskType.Class:\n case SleeveTaskType.Gym:\n this.updateTaskGainRates(p);\n retValue = this.gainExperience(p, this.gainRatesForTask, cyclesUsed);\n this.gainMoney(p, this.gainRatesForTask, cyclesUsed);\n break;\n case SleeveTaskType.Faction: {\n retValue = this.gainExperience(p, this.gainRatesForTask, cyclesUsed);\n this.gainMoney(p, this.gainRatesForTask, cyclesUsed);\n\n // Gain faction reputation\n const fac: Faction = Factions[this.currentTaskLocation];\n if (!(fac instanceof Faction)) {\n console.error(`Invalid faction for Sleeve task: ${this.currentTaskLocation}`);\n break;\n }\n\n // If the player has a gang with the faction the sleeve is working\n // for, we need to reset the sleeve's task\n if (p.gang) {\n if (fac.name === p.gang.facName) {\n this.resetTaskStatus(p);\n }\n }\n\n fac.playerReputation += this.getRepGain(p) * cyclesUsed;\n break;\n }\n case SleeveTaskType.Company: {\n retValue = this.gainExperience(p, this.gainRatesForTask, cyclesUsed);\n this.gainMoney(p, this.gainRatesForTask, cyclesUsed);\n\n const company: Company = Companies[this.currentTaskLocation];\n if (!(company instanceof Company)) {\n console.error(`Invalid company for Sleeve task: ${this.currentTaskLocation}`);\n break;\n }\n\n company.playerReputation += this.getRepGain(p) * cyclesUsed;\n break;\n }\n case SleeveTaskType.Recovery:\n this.shock = Math.min(100, this.shock + 0.0002 * cyclesUsed);\n if (this.shock >= 100) this.resetTaskStatus(p);\n break;\n case SleeveTaskType.Synchro:\n this.sync = Math.min(100, this.sync + p.getIntelligenceBonus(0.5) * 0.0002 * cyclesUsed);\n if (this.sync >= 100) this.resetTaskStatus(p);\n break;\n default:\n break;\n }\n\n if (this.currentTaskMaxTime !== 0 && this.currentTaskTime >= this.currentTaskMaxTime) {\n if (this.currentTask === SleeveTaskType.Crime || this.currentTask === SleeveTaskType.Bladeburner) {\n retValue = this.finishTask(p);\n } else {\n this.finishTask(p);\n }\n }\n\n this.updateStatLevels();\n\n this.storedCycles -= cyclesUsed;\n\n return retValue;\n }\n\n /**\n * Resets all parameters used to keep information about the current task\n */\n resetTaskStatus(p: IPlayer): void {\n if (this.bbAction == \"Support main sleeve\") {\n p.bladeburner?.sleeveSupport(false);\n }\n if (this.currentTask == SleeveTaskType.Class) {\n const retVal = createTaskTracker();\n retVal.int = CONSTANTS.IntelligenceClassBaseExpGain * Math.round(this.currentTaskTime / 1000);\n const r = this.gainExperience(p, retVal);\n p.sleeves.filter((s) => s != this).forEach((s) => s.gainExperience(p, r, 1, true));\n }\n this.earningsForTask = createTaskTracker();\n this.gainRatesForTask = createTaskTracker();\n this.currentTask = SleeveTaskType.Idle;\n this.currentTaskTime = 0;\n this.currentTaskMaxTime = 0;\n this.factionWorkType = FactionWorkType.None;\n this.crimeType = \"\";\n this.currentTaskLocation = \"\";\n this.gymStatType = \"\";\n this.className = \"\";\n this.bbAction = \"\";\n this.bbContract = \"------\";\n }\n\n shockRecovery(p: IPlayer): boolean {\n if (this.currentTask !== SleeveTaskType.Idle) {\n this.finishTask(p);\n } else {\n this.resetTaskStatus(p);\n }\n\n this.currentTask = SleeveTaskType.Recovery;\n return true;\n }\n\n synchronize(p: IPlayer): boolean {\n if (this.currentTask !== SleeveTaskType.Idle) {\n this.finishTask(p);\n } else {\n this.resetTaskStatus(p);\n }\n\n this.currentTask = SleeveTaskType.Synchro;\n return true;\n }\n\n /**\n * Take a course at a university\n */\n takeUniversityCourse(p: IPlayer, universityName: string, className: string): boolean {\n if (this.currentTask !== SleeveTaskType.Idle) {\n this.finishTask(p);\n } else {\n this.resetTaskStatus(p);\n }\n\n // Set exp/money multipliers based on which university.\n // Also check that the sleeve is in the right city\n let costMult = 1;\n switch (universityName.toLowerCase()) {\n case LocationName.AevumSummitUniversity.toLowerCase():\n if (this.city !== CityName.Aevum) {\n return false;\n }\n this.currentTaskLocation = LocationName.AevumSummitUniversity;\n costMult = 4;\n break;\n case LocationName.Sector12RothmanUniversity.toLowerCase():\n if (this.city !== CityName.Sector12) {\n return false;\n }\n this.currentTaskLocation = LocationName.Sector12RothmanUniversity;\n costMult = 3;\n break;\n case LocationName.VolhavenZBInstituteOfTechnology.toLowerCase():\n if (this.city !== CityName.Volhaven) {\n return false;\n }\n this.currentTaskLocation = LocationName.VolhavenZBInstituteOfTechnology;\n costMult = 5;\n break;\n default:\n return false;\n }\n\n // Set experience/money gains based on class\n switch (className.toLowerCase()) {\n case \"study computer science\":\n break;\n case \"data structures\":\n this.gainRatesForTask.money = -1 * (CONSTANTS.ClassDataStructuresBaseCost * costMult);\n break;\n case \"networks\":\n this.gainRatesForTask.money = -1 * (CONSTANTS.ClassNetworksBaseCost * costMult);\n break;\n case \"algorithms\":\n this.gainRatesForTask.money = -1 * (CONSTANTS.ClassAlgorithmsBaseCost * costMult);\n break;\n case \"management\":\n this.gainRatesForTask.money = -1 * (CONSTANTS.ClassManagementBaseCost * costMult);\n break;\n case \"leadership\":\n this.gainRatesForTask.money = -1 * (CONSTANTS.ClassLeadershipBaseCost * costMult);\n break;\n default:\n return false;\n }\n\n this.className = className;\n this.currentTask = SleeveTaskType.Class;\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 updateTaskGainRates(p: IPlayer): void {\n if (this.currentTask === SleeveTaskType.Class) {\n let expMult = 1;\n switch (this.currentTaskLocation.toLowerCase()) {\n case LocationName.AevumSummitUniversity.toLowerCase():\n expMult = 3;\n break;\n case LocationName.Sector12RothmanUniversity.toLowerCase():\n expMult = 2;\n break;\n case LocationName.VolhavenZBInstituteOfTechnology.toLowerCase():\n expMult = 4;\n break;\n default:\n return;\n }\n\n const totalExpMult = expMult * p.hashManager.getStudyMult();\n switch (this.className.toLowerCase()) {\n case \"study computer science\":\n this.gainRatesForTask.hack =\n CONSTANTS.ClassStudyComputerScienceBaseExp * totalExpMult * this.hacking_exp_mult;\n break;\n case \"data structures\":\n this.gainRatesForTask.hack = CONSTANTS.ClassDataStructuresBaseExp * totalExpMult * this.hacking_exp_mult;\n break;\n case \"networks\":\n this.gainRatesForTask.hack = CONSTANTS.ClassNetworksBaseExp * totalExpMult * this.hacking_exp_mult;\n break;\n case \"algorithms\":\n this.gainRatesForTask.hack = CONSTANTS.ClassAlgorithmsBaseExp * totalExpMult * this.hacking_exp_mult;\n break;\n case \"management\":\n this.gainRatesForTask.cha = CONSTANTS.ClassManagementBaseExp * totalExpMult * this.charisma_exp_mult;\n break;\n case \"leadership\":\n this.gainRatesForTask.cha = CONSTANTS.ClassLeadershipBaseExp * totalExpMult * this.charisma_exp_mult;\n break;\n default:\n break;\n }\n\n return;\n }\n\n if (this.currentTask === SleeveTaskType.Gym) {\n // Get gym exp multiplier\n let expMult = 1;\n switch (this.currentTaskLocation.toLowerCase()) {\n case LocationName.AevumCrushFitnessGym.toLowerCase():\n expMult = 2;\n break;\n case LocationName.AevumSnapFitnessGym.toLowerCase():\n expMult = 5;\n break;\n case LocationName.Sector12IronGym.toLowerCase():\n expMult = 1;\n break;\n case LocationName.Sector12PowerhouseGym.toLowerCase():\n expMult = 10;\n break;\n case LocationName.VolhavenMilleniumFitnessGym.toLowerCase():\n expMult = 4;\n break;\n default:\n return;\n }\n\n // Set stat gain rate\n const baseGymExp = 1;\n const totalExpMultiplier = p.hashManager.getTrainingMult() * expMult;\n const sanitizedStat: string = this.gymStatType.toLowerCase();\n if (sanitizedStat.includes(\"str\")) {\n this.gainRatesForTask.str = baseGymExp * totalExpMultiplier * this.strength_exp_mult;\n } else if (sanitizedStat.includes(\"def\")) {\n this.gainRatesForTask.def = baseGymExp * totalExpMultiplier * this.defense_exp_mult;\n } else if (sanitizedStat.includes(\"dex\")) {\n this.gainRatesForTask.dex = baseGymExp * totalExpMultiplier * this.dexterity_exp_mult;\n } else if (sanitizedStat.includes(\"agi\")) {\n this.gainRatesForTask.agi = baseGymExp * totalExpMultiplier * this.agility_exp_mult;\n }\n\n return;\n }\n\n console.warn(`Sleeve.updateTaskGainRates() called for unexpected task type ${this.currentTask}`);\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 if (this.currentTask !== SleeveTaskType.Idle) {\n this.finishTask(p);\n } else {\n this.resetTaskStatus(p);\n }\n\n const company: Company | null = Companies[companyName];\n const companyPosition: CompanyPosition | null = CompanyPositions[p.jobs[companyName]];\n if (company == null) {\n return false;\n }\n if (companyPosition == null) {\n return false;\n }\n this.gainRatesForTask.money =\n companyPosition.baseSalary *\n company.salaryMultiplier *\n this.work_money_mult *\n BitNodeMultipliers.CompanyWorkMoney;\n this.gainRatesForTask.hack =\n companyPosition.hackingExpGain *\n company.expMultiplier *\n this.hacking_exp_mult *\n BitNodeMultipliers.CompanyWorkExpGain;\n this.gainRatesForTask.str =\n companyPosition.strengthExpGain *\n company.expMultiplier *\n this.strength_exp_mult *\n BitNodeMultipliers.CompanyWorkExpGain;\n this.gainRatesForTask.def =\n companyPosition.defenseExpGain *\n company.expMultiplier *\n this.defense_exp_mult *\n BitNodeMultipliers.CompanyWorkExpGain;\n this.gainRatesForTask.dex =\n companyPosition.dexterityExpGain *\n company.expMultiplier *\n this.dexterity_exp_mult *\n BitNodeMultipliers.CompanyWorkExpGain;\n this.gainRatesForTask.agi =\n companyPosition.agilityExpGain *\n company.expMultiplier *\n this.agility_exp_mult *\n BitNodeMultipliers.CompanyWorkExpGain;\n this.gainRatesForTask.cha =\n companyPosition.charismaExpGain *\n company.expMultiplier *\n this.charisma_exp_mult *\n BitNodeMultipliers.CompanyWorkExpGain;\n\n this.currentTaskLocation = companyName;\n this.currentTask = SleeveTaskType.Company;\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 if (this.currentTask !== SleeveTaskType.Idle) {\n this.finishTask(p);\n } else {\n this.resetTaskStatus(p);\n }\n\n const factionInfo = faction.getInfo();\n\n // Set type of work (hacking/field/security), and the experience gains\n const sanitizedWorkType: string = workType.toLowerCase();\n if (sanitizedWorkType.includes(\"hack\")) {\n if (!factionInfo.offerHackingWork) {\n return false;\n }\n this.factionWorkType = FactionWorkType.Hacking;\n this.gainRatesForTask.hack = 0.15 * this.hacking_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n } else if (sanitizedWorkType.includes(\"field\")) {\n if (!factionInfo.offerFieldWork) {\n return false;\n }\n this.factionWorkType = FactionWorkType.Field;\n this.gainRatesForTask.hack = 0.1 * this.hacking_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.gainRatesForTask.str = 0.1 * this.strength_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.gainRatesForTask.def = 0.1 * this.defense_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.gainRatesForTask.dex = 0.1 * this.dexterity_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.gainRatesForTask.agi = 0.1 * this.agility_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.gainRatesForTask.cha = 0.1 * this.charisma_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n } else if (sanitizedWorkType.includes(\"security\")) {\n if (!factionInfo.offerSecurityWork) {\n return false;\n }\n this.factionWorkType = FactionWorkType.Security;\n this.gainRatesForTask.hack = 0.1 * this.hacking_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.gainRatesForTask.str = 0.15 * this.strength_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.gainRatesForTask.def = 0.15 * this.defense_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.gainRatesForTask.dex = 0.15 * this.dexterity_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.gainRatesForTask.agi = 0.15 * this.agility_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n } else {\n return false;\n }\n\n this.currentTaskLocation = factionName;\n this.currentTask = SleeveTaskType.Faction;\n\n return true;\n }\n\n /**\n * Begin a gym workout task\n */\n workoutAtGym(p: IPlayer, gymName: string, stat: string): boolean {\n if (this.currentTask !== SleeveTaskType.Idle) {\n this.finishTask(p);\n } else {\n this.resetTaskStatus(p);\n }\n\n // Set exp/money multipliers based on which university.\n // Also check that the sleeve is in the right city\n let costMult = 1;\n switch (gymName.toLowerCase()) {\n case LocationName.AevumCrushFitnessGym.toLowerCase():\n if (this.city != CityName.Aevum) {\n return false;\n }\n this.currentTaskLocation = LocationName.AevumCrushFitnessGym;\n costMult = 3;\n break;\n case LocationName.AevumSnapFitnessGym.toLowerCase():\n if (this.city != CityName.Aevum) {\n return false;\n }\n this.currentTaskLocation = LocationName.AevumSnapFitnessGym;\n costMult = 10;\n break;\n case LocationName.Sector12IronGym.toLowerCase():\n if (this.city != CityName.Sector12) {\n return false;\n }\n this.currentTaskLocation = LocationName.Sector12IronGym;\n costMult = 1;\n break;\n case LocationName.Sector12PowerhouseGym.toLowerCase():\n if (this.city != CityName.Sector12) {\n return false;\n }\n this.currentTaskLocation = LocationName.Sector12PowerhouseGym;\n costMult = 20;\n break;\n case LocationName.VolhavenMilleniumFitnessGym.toLowerCase():\n if (this.city != CityName.Volhaven) {\n return false;\n }\n this.currentTaskLocation = LocationName.VolhavenMilleniumFitnessGym;\n costMult = 7;\n break;\n default:\n return false;\n }\n\n // Set experience/money gains based on class\n const sanitizedStat: string = stat.toLowerCase();\n\n // Set cost\n this.gainRatesForTask.money = -1 * (CONSTANTS.ClassGymBaseCost * costMult);\n\n // Validate \"stat\" argument\n if (\n !sanitizedStat.includes(\"str\") &&\n !sanitizedStat.includes(\"def\") &&\n !sanitizedStat.includes(\"dex\") &&\n !sanitizedStat.includes(\"agi\")\n ) {\n return false;\n }\n\n this.gymStatType = stat;\n this.currentTask = SleeveTaskType.Gym;\n\n return true;\n }\n\n /**\n * Begin a bladeburner task\n */\n bladeburner(p: IPlayer, action: string, contract: string): boolean {\n if (this.currentTask !== SleeveTaskType.Idle) {\n this.finishTask(p);\n } else {\n this.resetTaskStatus(p);\n }\n\n this.gainRatesForTask.hack = 0;\n this.gainRatesForTask.str = 0;\n this.gainRatesForTask.def = 0;\n this.gainRatesForTask.dex = 0;\n this.gainRatesForTask.agi = 0;\n this.gainRatesForTask.cha = 0;\n this.gainRatesForTask.money = 0;\n this.currentTaskLocation = \"\";\n\n let time = 0;\n\n this.bbContract = \"------\";\n switch (action) {\n case \"Field analysis\":\n time = this.getBladeburnerActionTime(p, \"General\", action);\n this.gainRatesForTask.hack = 20 * this.hacking_exp_mult;\n this.gainRatesForTask.cha = 20 * this.charisma_exp_mult;\n break;\n case \"Recruitment\":\n time = this.getBladeburnerActionTime(p, \"General\", action);\n this.gainRatesForTask.cha =\n 2 * BladeburnerConstants.BaseStatGain * (p.bladeburner?.getRecruitmentTime(this) ?? 0) * 1000;\n this.currentTaskLocation = `(Success Rate: ${numeralWrapper.formatPercentage(\n this.recruitmentSuccessChance(p),\n )})`;\n break;\n case \"Diplomacy\":\n time = this.getBladeburnerActionTime(p, \"General\", action);\n break;\n case \"Infiltrate synthoids\":\n time = 60000;\n this.currentTaskLocation = \"This will generate additional contracts and operations\";\n break;\n case \"Support main sleeve\":\n p.bladeburner?.sleeveSupport(true);\n time = 0;\n break;\n case \"Take on contracts\":\n time = this.getBladeburnerActionTime(p, \"Contracts\", contract);\n this.contractGainRates(p, \"Contracts\", contract);\n this.currentTaskLocation = this.contractSuccessChance(p, \"Contracts\", contract);\n this.bbContract = capitalizeEachWord(contract.toLowerCase());\n break;\n }\n\n this.bbAction = capitalizeFirstLetter(action.toLowerCase());\n this.currentTaskMaxTime = time;\n this.currentTask = SleeveTaskType.Bladeburner;\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 contractGainRates(p: IPlayer, type: string, name: string): void {\n const bb = p.bladeburner;\n if (bb === null) {\n const errorLogText = `bladeburner is null`;\n console.error(`Function: sleeves.contractGainRates; Message: '${errorLogText}'`);\n return;\n }\n const actionIdent = bb.getActionIdFromTypeAndName(type, name);\n if (actionIdent === null) {\n const errorLogText = `Invalid action: type='${type}' name='${name}'`;\n console.error(`Function: sleeves.contractGainRates; Message: '${errorLogText}'`);\n this.resetTaskStatus(p);\n return;\n }\n const action = bb.getActionObject(actionIdent);\n if (action === null) {\n const errorLogText = `Invalid action: type='${type}' name='${name}'`;\n console.error(`Function: sleeves.contractGainRates; Message: '${errorLogText}'`);\n this.resetTaskStatus(p);\n return;\n }\n const retValue = bb.getActionStats(action, true);\n this.gainRatesForTask.hack = retValue.hack;\n this.gainRatesForTask.str = retValue.str;\n this.gainRatesForTask.def = retValue.def;\n this.gainRatesForTask.dex = retValue.dex;\n this.gainRatesForTask.agi = retValue.agi;\n this.gainRatesForTask.cha = retValue.cha;\n const rewardMultiplier = Math.pow(action.rewardFac, action.level - 1);\n this.gainRatesForTask.money =\n BladeburnerConstants.ContractBaseMoneyGain * rewardMultiplier * bb.skillMultipliers.money;\n }\n\n getBladeburnerActionTime(p: IPlayer, type: string, name: string): number {\n //Maybe find workerscript and use original\n const bb = p.bladeburner;\n if (bb === null) {\n const errorLogText = `bladeburner is null`;\n console.error(`Function: sleeves.getBladeburnerActionTime; Message: '${errorLogText}'`);\n return -1;\n }\n\n const time = bb.getActionTimeNetscriptFn(this, type, name);\n if (typeof time === \"string\") {\n const errorLogText = `Invalid action: type='${type}' name='${name}'`;\n console.error(`Function: sleeves.getBladeburnerActionTime; Message: '${errorLogText}'`);\n return -1;\n } else {\n return time;\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 -= amt;\n if (this.hp <= 0) {\n this.shock += 0.5;\n this.hp = this.max_hp;\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(): any {\n return Generic_toJSON(\"Sleeve\", this);\n }\n\n /**\n * Initiatizes a Sleeve object from a JSON save state.\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): Sleeve {\n return Generic_fromJSON(Sleeve, value.data);\n }\n}\n\nReviver.constructors.Sleeve = Sleeve;\n","export enum RamCalculationErrorCode {\n SyntaxError = -1,\n ImportError = -2,\n URLImportError = -3,\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 console.log(\"Duplicate message\");\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","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","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.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.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.hacking >= 40) {\n sendMessage(jumper1);\n } else if (!recvd(cybersecTest) && Player.hacking >= 50) {\n sendMessage(cybersecTest);\n } else if (!recvd(jumper2) && Player.hacking >= 175) {\n sendMessage(jumper2);\n } else if (!recvd(nitesecTest) && Player.hacking >= 200) {\n sendMessage(nitesecTest);\n } else if (!recvd(jumper3) && Player.hacking >= 350) {\n sendMessage(jumper3);\n } else if (!recvd(jumper4) && Player.hacking >= 490) {\n sendMessage(jumper4);\n } else if (!recvd(bitrunnersTest) && Player.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","// 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","/**\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, 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(): any {\n return Generic_toJSON(\"Operation\", this);\n }\n\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): 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\nfunction getRandomBonus(): any {\n const bonuses = [\n {\n bonuses: {\n hacking_chance_mult: 1.25,\n hacking_speed_mult: 1.1,\n hacking_money_mult: 1.25,\n hacking_grow_mult: 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_mult: 1.15,\n hacking_exp_mult: 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_mult: 1.25,\n strength_exp_mult: 2,\n defense_mult: 1.25,\n defense_exp_mult: 2,\n dexterity_mult: 1.25,\n dexterity_exp_mult: 2,\n agility_mult: 1.25,\n agility_exp_mult: 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_mult: 1.5,\n charisma_exp_mult: 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_mult: 1.2,\n hacknet_node_purchase_cost_mult: 0.85,\n hacknet_node_ram_cost_mult: 0.85,\n hacknet_node_core_cost_mult: 0.85,\n hacknet_node_level_cost_mult: 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_mult: 1.25,\n faction_rep_mult: 1.15,\n work_money_mult: 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_mult: 2,\n crime_money_mult: 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_mult: 1.08,\n defense_mult: 1.08,\n agility_mult: 1.08,\n dexterity_mult: 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_mult: 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_mult: 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_mult: 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_mult: 1.5,\n strength_mult: 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_mult: 1.3,\n defense_mult: 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_mult: 1.1,\n defense_mult: 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_mult: 1.14,\n defense_mult: 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_mult: 1.18,\n defense_mult: 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_mult: 1.2,\n defense_mult: 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_mult: 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_mult: 1.05,\n dexterity_mult: 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_mult: 1.7,\n defense_mult: 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_mult: 1.15,\n defense_mult: 1.15,\n agility_mult: 1.15,\n dexterity_mult: 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_mult: 1.6,\n defense_mult: 1.6,\n agility_mult: 1.6,\n dexterity_mult: 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_mult: 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_mult: 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_mult: 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_mult: 1.15,\n charisma_exp_mult: 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_mult: 1.6,\n charisma_exp_mult: 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_mult: 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_mult: 1.03,\n hacking_money_mult: 1.15,\n hacking_mult: 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_mult: 1.02,\n hacking_chance_mult: 1.05,\n hacking_exp_mult: 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_mult: 1.03,\n hacking_exp_mult: 1.1,\n hacking_mult: 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_mult: 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_mult: 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_mult: 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_mult: 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_mult: 1.03,\n hacking_money_mult: 1.1,\n hacking_chance_mult: 1.03,\n hacking_exp_mult: 1.07,\n hacking_mult: 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_mult: 1.05,\n hacking_money_mult: 1.3,\n hacking_chance_mult: 1.05,\n hacking_exp_mult: 1.15,\n hacking_mult: 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_mult: 1.05,\n hacking_money_mult: 1.4,\n hacking_chance_mult: 1.1,\n hacking_exp_mult: 1.25,\n hacking_mult: 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_mult: 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_mult: 1.4,\n hacking_chance_mult: 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_mult: 1.02,\n hacking_chance_mult: 1.1,\n hacking_exp_mult: 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_mult: 1.1,\n hacking_exp_mult: 1.15,\n hacking_money_mult: 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_mult: 1.01,\n hacking_mult: 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_mult: 1.02,\n hacking_chance_mult: 1.05,\n hacking_mult: 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_mult: 1.02,\n hacking_money_mult: 1.15,\n hacking_mult: 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_mult: 1.02,\n hacking_money_mult: 1.2,\n hacking_grow_mult: 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_mult: 1.3,\n hacking_money_mult: 1.25,\n hacking_grow_mult: 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_mult: 1.15,\n hacking_exp_mult: 1.1,\n hacking_speed_mult: 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_mult: 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_mult: 1.1,\n charisma_mult: 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_mult: 1.05,\n strength_exp_mult: 1.05,\n defense_exp_mult: 1.05,\n dexterity_exp_mult: 1.05,\n agility_exp_mult: 1.05,\n charisma_exp_mult: 1.05,\n company_rep_mult: 1.1,\n work_money_mult: 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_mult: 1.3,\n hacking_mult: 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_mult: 1.75,\n hacking_mult: 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_mult: 2,\n hacking_mult: 1.1,\n hacking_speed_mult: 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_mult: 1.1,\n faction_rep_mult: 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_mult: 1.2,\n faction_rep_mult: 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_mult: 1.15,\n faction_rep_mult: 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_mult: 1.15,\n hacknet_node_purchase_cost_mult: 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_mult: 1.1,\n hacknet_node_level_cost_mult: 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_mult: 1.1,\n hacknet_node_purchase_cost_mult: 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_mult: 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_mult: 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_mult: 1.1,\n strength_exp_mult: 1.1,\n defense_exp_mult: 1.1,\n dexterity_exp_mult: 1.1,\n agility_exp_mult: 1.1,\n charisma_exp_mult: 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_mult: 1.15,\n strength_exp_mult: 1.15,\n defense_exp_mult: 1.15,\n dexterity_exp_mult: 1.15,\n agility_exp_mult: 1.15,\n charisma_exp_mult: 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_mult: 1.2,\n strength_exp_mult: 1.2,\n defense_exp_mult: 1.2,\n dexterity_exp_mult: 1.2,\n agility_exp_mult: 1.2,\n charisma_exp_mult: 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_mult: 1.4,\n hacking_speed_mult: 1.03,\n hacking_money_mult: 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_mult: 1.05,\n crime_money_mult: 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_mult: 1.1,\n defense_mult: 1.1,\n crime_money_mult: 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_mult: 1.1,\n dexterity_exp_mult: 1.15,\n crime_money_mult: 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_mult: 1.05,\n strength_mult: 1.05,\n defense_mult: 1.05,\n dexterity_mult: 1.05,\n agility_mult: 1.05,\n charisma_mult: 1.05,\n hacking_exp_mult: 1.1,\n strength_exp_mult: 1.1,\n defense_exp_mult: 1.1,\n dexterity_exp_mult: 1.1,\n agility_exp_mult: 1.1,\n charisma_exp_mult: 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_mult: 1.75,\n hacking_speed_mult: 2,\n hacking_chance_mult: 2.5,\n hacking_money_mult: 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_mult: 1.75,\n defense_mult: 1.75,\n dexterity_mult: 1.75,\n agility_mult: 1.75,\n hacking_mult: 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_mult: 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_mult: 1.35,\n defense_mult: 1.35,\n dexterity_mult: 1.35,\n agility_mult: 1.35,\n strength_exp_mult: 1.35,\n defense_exp_mult: 1.35,\n dexterity_exp_mult: 1.35,\n agility_exp_mult: 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_mult: 1.5,\n charisma_exp_mult: 1.5,\n company_rep_mult: 1.25,\n faction_rep_mult: 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_mult: 1.55,\n defense_mult: 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_mult: 1.2,\n strength_mult: 1.2,\n defense_mult: 1.2,\n dexterity_mult: 1.2,\n agility_mult: 1.2,\n charisma_mult: 1.2,\n hacking_exp_mult: 1.15,\n strength_exp_mult: 1.15,\n defense_exp_mult: 1.15,\n dexterity_exp_mult: 1.15,\n agility_exp_mult: 1.15,\n charisma_exp_mult: 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_mult: 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_mult: 1.2,\n strength_mult: 1.2,\n defense_mult: 1.2,\n dexterity_mult: 1.2,\n agility_mult: 1.2,\n charisma_mult: 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_mult: 1.2,\n hacking_exp_mult: 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_mult: 1.4,\n defense_mult: 1.4,\n agility_mult: 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_mult: 1.15,\n hacking_exp_mult: 1.2,\n hacking_chance_mult: 1.1,\n hacking_speed_mult: 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_mult: 1.15,\n dexterity_mult: 1.15,\n hacking_mult: 1.1,\n hacking_speed_mult: 1.02,\n hacking_money_mult: 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_mult: 1.08,\n hacking_exp_mult: 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_mult: 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_mult: 1.2,\n defense_exp_mult: 1.2,\n dexterity_exp_mult: 1.2,\n agility_exp_mult: 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_mult: 1.0777,\n charisma_exp_mult: 1.0777,\n work_money_mult: 1.777,\n faction_rep_mult: 1.0777,\n company_rep_mult: 1.0777,\n crime_success_mult: 1.0777,\n crime_money_mult: 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_mult: 1.25,\n crime_money_mult: 1.1,\n dexterity_mult: 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_mult: 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_mult: 1.4,\n defense_mult: 1.4,\n crime_success_mult: 1.1,\n crime_money_mult: 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_mult: 1.85,\n dexterity_mult: 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_mult: 1.15,\n defense_mult: 1.15,\n crime_success_mult: 1.1,\n crime_money_mult: 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_mult: 1.3,\n dexterity_mult: 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_mult: 1.1,\n company_rep_mult: 1.15,\n faction_rep_mult: 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_mult: 1.03,\n dexterity_mult: 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_mult: 1.03,\n bladeburner_analysis_mult: 1.05,\n bladeburner_stamina_gain_mult: 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_mult: 1.05,\n strength_mult: 1.05,\n dexterity_mult: 1.05,\n bladeburner_success_chance_mult: 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_mult: 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_mult: 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_mult: 1.07,\n defense_mult: 1.07,\n dexterity_mult: 1.07,\n agility_mult: 1.07,\n bladeburner_stamina_gain_mult: 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_mult: 1.1,\n bladeburner_analysis_mult: 1.1,\n bladeburner_success_chance_mult: 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_mult: 1.1,\n dexterity_exp_mult: 1.1,\n bladeburner_analysis_mult: 1.15,\n bladeburner_success_chance_mult: 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_mult: 1.05,\n defense_exp_mult: 1.05,\n dexterity_exp_mult: 1.05,\n agility_exp_mult: 1.05,\n bladeburner_max_stamina_mult: 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_mult: 1.05,\n bladeburner_max_stamina_mult: 1.05,\n bladeburner_stamina_gain_mult: 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_mult: 1.04,\n defense_mult: 1.04,\n dexterity_mult: 1.04,\n agility_mult: 1.04,\n bladeburner_stamina_gain_mult: 1.02,\n bladeburner_success_chance_mult: 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_mult: 1.05,\n bladeburner_stamina_gain_mult: 1.02,\n bladeburner_max_stamina_mult: 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_mult: 1.05,\n bladeburner_success_chance_mult: 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_mult: 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_mult: 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_mult: 1.15,\n bladeburner_success_chance_mult: 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_mult: 0.9,\n hacking_speed_mult: 0.9,\n hacking_money_mult: 0.9,\n hacking_grow_mult: 0.9,\n hacking_mult: 0.9,\n strength_mult: 0.9,\n defense_mult: 0.9,\n dexterity_mult: 0.9,\n agility_mult: 0.9,\n charisma_mult: 0.9,\n hacking_exp_mult: 0.9,\n strength_exp_mult: 0.9,\n defense_exp_mult: 0.9,\n dexterity_exp_mult: 0.9,\n agility_exp_mult: 0.9,\n charisma_exp_mult: 0.9,\n company_rep_mult: 0.9,\n faction_rep_mult: 0.9,\n crime_money_mult: 0.9,\n crime_success_mult: 0.9,\n hacknet_node_money_mult: 0.9,\n hacknet_node_purchase_cost_mult: 1.1,\n hacknet_node_ram_cost_mult: 1.1,\n hacknet_node_core_cost_mult: 1.1,\n hacknet_node_level_cost_mult: 1.1,\n work_money_mult: 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_mult: 0.95 / 0.9,\n hacking_speed_mult: 0.95 / 0.9,\n hacking_money_mult: 0.95 / 0.9,\n hacking_grow_mult: 0.95 / 0.9,\n hacking_mult: 0.95 / 0.9,\n strength_mult: 0.95 / 0.9,\n defense_mult: 0.95 / 0.9,\n dexterity_mult: 0.95 / 0.9,\n agility_mult: 0.95 / 0.9,\n charisma_mult: 0.95 / 0.9,\n hacking_exp_mult: 0.95 / 0.9,\n strength_exp_mult: 0.95 / 0.9,\n defense_exp_mult: 0.95 / 0.9,\n dexterity_exp_mult: 0.95 / 0.9,\n agility_exp_mult: 0.95 / 0.9,\n charisma_exp_mult: 0.95 / 0.9,\n company_rep_mult: 0.95 / 0.9,\n faction_rep_mult: 0.95 / 0.9,\n crime_money_mult: 0.95 / 0.9,\n crime_success_mult: 0.95 / 0.9,\n hacknet_node_money_mult: 0.95 / 0.9,\n hacknet_node_purchase_cost_mult: 1.05 / 1.1,\n hacknet_node_ram_cost_mult: 1.05 / 1.1,\n hacknet_node_core_cost_mult: 1.05 / 1.1,\n hacknet_node_level_cost_mult: 1.05 / 1.1,\n work_money_mult: 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_mult: 1 / 0.95,\n hacking_speed_mult: 1 / 0.95,\n hacking_money_mult: 1 / 0.95,\n hacking_grow_mult: 1 / 0.95,\n hacking_mult: 1 / 0.95,\n strength_mult: 1 / 0.95,\n defense_mult: 1 / 0.95,\n dexterity_mult: 1 / 0.95,\n agility_mult: 1 / 0.95,\n charisma_mult: 1 / 0.95,\n hacking_exp_mult: 1 / 0.95,\n strength_exp_mult: 1 / 0.95,\n defense_exp_mult: 1 / 0.95,\n dexterity_exp_mult: 1 / 0.95,\n agility_exp_mult: 1 / 0.95,\n charisma_exp_mult: 1 / 0.95,\n company_rep_mult: 1 / 0.95,\n faction_rep_mult: 1 / 0.95,\n crime_money_mult: 1 / 0.95,\n crime_success_mult: 1 / 0.95,\n hacknet_node_money_mult: 1 / 0.95,\n hacknet_node_purchase_cost_mult: 1 / 1.05,\n hacknet_node_ram_cost_mult: 1 / 1.05,\n hacknet_node_core_cost_mult: 1 / 1.05,\n hacknet_node_level_cost_mult: 1 / 1.05,\n work_money_mult: 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_mult: 1.01 + donationBonus,\n hacking_speed_mult: 1.01 + donationBonus,\n hacking_money_mult: 1.01 + donationBonus,\n hacking_grow_mult: 1.01 + donationBonus,\n hacking_mult: 1.01 + donationBonus,\n strength_mult: 1.01 + donationBonus,\n defense_mult: 1.01 + donationBonus,\n dexterity_mult: 1.01 + donationBonus,\n agility_mult: 1.01 + donationBonus,\n charisma_mult: 1.01 + donationBonus,\n hacking_exp_mult: 1.01 + donationBonus,\n strength_exp_mult: 1.01 + donationBonus,\n defense_exp_mult: 1.01 + donationBonus,\n dexterity_exp_mult: 1.01 + donationBonus,\n agility_exp_mult: 1.01 + donationBonus,\n charisma_exp_mult: 1.01 + donationBonus,\n company_rep_mult: 1.01 + donationBonus,\n faction_rep_mult: 1.01 + donationBonus,\n crime_money_mult: 1.01 + donationBonus,\n crime_success_mult: 1.01 + donationBonus,\n hacknet_node_money_mult: 1.01 + donationBonus,\n hacknet_node_purchase_cost_mult: 1 / (1.01 + donationBonus),\n hacknet_node_ram_cost_mult: 1 / (1.01 + donationBonus),\n hacknet_node_core_cost_mult: 1 / (1.01 + donationBonus),\n hacknet_node_level_cost_mult: 1 / (1.01 + donationBonus),\n work_money_mult: 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 [key: string]: any;\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 { 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 * 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, Reviver } from \"../utils/JSONReviver\";\nimport { formatTime } from \"../utils/helpers/formatTime\";\n\nexport class RunningScript {\n // Script arguments\n args: any[] = [];\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: any[] = []) {\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(): any {\n return Generic_toJSON(\"RunningScript\", this);\n }\n\n // Initializes a RunningScript Object from a JSON save state\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): RunningScript {\n return Generic_fromJSON(RunningScript, value.data);\n }\n}\n\nReviver.constructors.RunningScript = RunningScript;\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). This Source-File also increases 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);\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 ),\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.singularityStopWork();\n props.bladeburner.startAction(player, props.bladeburner.action);\n props.rerender();\n }\n\n return (\n \n );\n}\n","import { format } from \"date-fns\";\n\nexport function formatTime(fmt: string): string {\n try {\n return format(new Date(), fmt);\n } catch (err: any) {\n return \"format error\";\n }\n}\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 - thats 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","/**\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, 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): 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);\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): void {\n const upg = HashUpgrades[upgName];\n\n // Reduce the level first, so we get the right cost\n --this.upgrades[upgName];\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);\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): 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);\n\n if (this.hashes < cost) {\n return false;\n }\n\n this.hashes -= cost;\n ++this.upgrades[upgName];\n\n return true;\n }\n\n //Serialize the current object to a JSON save state.\n toJSON(): any {\n return Generic_toJSON(\"HashManager\", this);\n }\n\n // Initiatizes a HashManager object from a JSON save state.\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): 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, 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 minEne = 0;\n maxEne = 100;\n minHap = 0;\n maxHap = 100;\n maxMor = 100;\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 total: 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 this.calculateTotalEmployees();\n\n // Process Office properties\n this.maxEne = 100;\n this.maxHap = 100;\n this.maxMor = 100;\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\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 const hasAutobrew = industry.hasResearch(\"AutoBrew\");\n const hasAutoparty = industry.hasResearch(\"AutoPartyManager\");\n\n let salaryPaid = 0;\n for (let i = 0; i < this.employees.length; ++i) {\n const emp = this.employees[i];\n if (hasAutoparty) {\n emp.mor = this.maxMor;\n emp.hap = this.maxHap;\n } else {\n emp.mor *= perfMult;\n emp.hap *= perfMult;\n emp.mor = Math.min(emp.mor, this.maxMor);\n emp.hap = Math.min(emp.hap, this.maxHap);\n }\n\n if (hasAutobrew) {\n emp.ene = this.maxEne;\n } else {\n emp.ene *= perfMult;\n emp.ene = Math.min(emp.ene, this.maxEne);\n }\n\n const salary = emp.process(marketCycles, this);\n salaryPaid += salary;\n }\n\n this.calculateEmployeeProductivity(corporation, industry);\n return salaryPaid;\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 this.employeeJobs.total = this.employees.length;\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 return emp;\n }\n\n //Finds the first unassigned employee and assigns its to the specified job\n assignEmployeeToJob(job: string): boolean {\n for (let i = 0; i < this.employees.length; ++i) {\n if (this.employees[i].pos === EmployeePositions.Unassigned) {\n this.employees[i].pos = job;\n return true;\n }\n }\n return false;\n }\n\n //Finds the first employee with the given job and unassigns it\n unassignEmployeeFromJob(job: string): boolean {\n for (let i = 0; i < this.employees.length; ++i) {\n if (this.employees[i].pos === job) {\n this.employees[i].pos = EmployeePositions.Unassigned;\n return true;\n }\n }\n return false;\n }\n\n setEmployeeToJob(job: string, amount: number): boolean {\n let jobCount = this.employees.reduce((acc, employee) => (employee.pos === job ? acc + 1 : acc), 0);\n\n for (const employee of this.employees) {\n if (jobCount == amount) return true;\n if (employee.pos === EmployeePositions.Unassigned && jobCount <= amount) {\n employee.pos = job;\n jobCount++;\n } else if (employee.pos === job && jobCount >= amount) {\n employee.pos = EmployeePositions.Unassigned;\n jobCount--;\n }\n }\n return jobCount === amount;\n }\n\n toJSON(): any {\n return Generic_toJSON(\"OfficeSpace\", this);\n }\n\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): 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 upgrades 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","export type ObjectValidator = {\n [key in keyof T]?: ParameterValidator;\n};\n\ninterface ParameterValidatorObject {\n default?: any;\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;\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(): any {\n return Generic_toJSON(\"MoneySourceTracker\", this);\n }\n\n // Initiatizes a MoneySourceTracker object from a JSON save state.\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\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","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.max_hp - p.hp) * CONSTANTS.HospitalCostPerHp);\n}\n\nexport function calculateHospitalizationCost(p: IPlayer, damage: number): number {\n const oldhp = p.hp;\n p.hp -= damage;\n const cost = getHospitalizationCost(p);\n p.hp = oldhp;\n return cost;\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]: any } = {\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 = [];\n for (const i of choices) {\n // @ts-ignore\n content.push(\n \n {i}\n ,\n );\n }\n return content;\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, 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 // 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 // empWorkMult is a multiplier that increases progress rate based on\n // productivity of employees\n createProduct(marketCycles = 1, empWorkMult = 1): void {\n if (this.fin) {\n return;\n }\n this.prog += marketCycles * 0.01 * empWorkMult;\n }\n\n // @param industry - Industry object. Reference to industry that makes this Product\n finishProduct(employeeProd: { [key: string]: number }, industry: IIndustry): void {\n this.fin = true;\n\n //Calculate properties\n const engrRatio = employeeProd[EmployeePositions.Engineer] / employeeProd[\"total\"];\n const mgmtRatio = employeeProd[EmployeePositions.Management] / employeeProd[\"total\"];\n const rndRatio = employeeProd[EmployeePositions.RandD] / employeeProd[\"total\"];\n const opsRatio = employeeProd[EmployeePositions.Operations] / employeeProd[\"total\"];\n const busRatio = employeeProd[EmployeePositions.Business] / employeeProd[\"total\"];\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 * employeeProd[EmployeePositions.Engineer] +\n 0.05 * employeeProd[EmployeePositions.Management] +\n 0.05 * employeeProd[EmployeePositions.RandD] +\n 0.02 * employeeProd[EmployeePositions.Operations] +\n 0.02 * employeeProd[EmployeePositions.Business]);\n this.per =\n totalMult *\n (0.15 * employeeProd[EmployeePositions.Engineer] +\n 0.02 * employeeProd[EmployeePositions.Management] +\n 0.02 * employeeProd[EmployeePositions.RandD] +\n 0.02 * employeeProd[EmployeePositions.Operations] +\n 0.02 * employeeProd[EmployeePositions.Business]);\n this.dur =\n totalMult *\n (0.05 * employeeProd[EmployeePositions.Engineer] +\n 0.02 * employeeProd[EmployeePositions.Management] +\n 0.08 * employeeProd[EmployeePositions.RandD] +\n 0.05 * employeeProd[EmployeePositions.Operations] +\n 0.05 * employeeProd[EmployeePositions.Business]);\n this.rel =\n totalMult *\n (0.02 * employeeProd[EmployeePositions.Engineer] +\n 0.08 * employeeProd[EmployeePositions.Management] +\n 0.02 * employeeProd[EmployeePositions.RandD] +\n 0.05 * employeeProd[EmployeePositions.Operations] +\n 0.08 * employeeProd[EmployeePositions.Business]);\n this.aes =\n totalMult *\n (0.0 * employeeProd[EmployeePositions.Engineer] +\n 0.08 * employeeProd[EmployeePositions.Management] +\n 0.05 * employeeProd[EmployeePositions.RandD] +\n 0.02 * employeeProd[EmployeePositions.Operations] +\n 0.1 * employeeProd[EmployeePositions.Business]);\n this.fea =\n totalMult *\n (0.08 * employeeProd[EmployeePositions.Engineer] +\n 0.05 * employeeProd[EmployeePositions.Management] +\n 0.02 * employeeProd[EmployeePositions.RandD] +\n 0.05 * employeeProd[EmployeePositions.Operations] +\n 0.05 * employeeProd[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 / employeeProd[\"total\"]);\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(): any {\n return Generic_toJSON(\"Product\", this);\n }\n\n // Initiatizes a Product object from a JSON save state.\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): 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\";\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.hacking + player.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 {(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.startCreateProgramWork(program.name, create.time, create.level);\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","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(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-child(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","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","/**\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.intelligence === 0) {\n // Artificial Intelligence\n Player.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.intelligence = 0;\n Player.intelligence_exp = 0;\n }\n if (newBitNode === 5 && Player.intelligence === 0) {\n Player.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","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\";\n\nexport class WorkerScript {\n /**\n * Script's arguments\n */\n args: any[];\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?: any) => 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 * Whether or not this workerScript is currently running\n */\n running = false;\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: any;\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(null);\n if (typeof nsFuncsGenerator === \"function\") {\n this.env.vars = nsFuncsGenerator(this);\n }\n this.env.set(\"args\", runningScriptObj.args.slice());\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","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 } 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 dividendPercentage = 0;\n dividendTaxPercentage = 50;\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 if (this.dividendPercentage > 0 && cycleProfit > 0) {\n // Validate input again, just to be safe\n if (\n isNaN(this.dividendPercentage) ||\n this.dividendPercentage < 0 ||\n this.dividendPercentage > CorporationConstants.DividendMaxPercentage * 100\n ) {\n console.error(`Invalid Corporation dividend percentage: ${this.dividendPercentage}`);\n } else {\n const totalDividends = (this.dividendPercentage / 100) * cycleProfit;\n const retainedEarnings = cycleProfit - totalDividends;\n player.gainMoney(this.getDividends(), \"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 getDividends(): number {\n const profit = this.revenue - this.expenses;\n const cycleProfit = profit * CorporationConstants.SecsPerMarketCycle;\n const totalDividends = (this.dividendPercentage / 100) * cycleProfit;\n const dividendsPerShare = totalDividends / this.totalShares;\n const dividends = this.numShares * dividendsPerShare;\n let upgrades = -0.15;\n if (this.unlockUpgrades[5] === 1) {\n upgrades += 0.05;\n }\n if (this.unlockUpgrades[6] === 1) {\n upgrades += 0.1;\n }\n return Math.pow(dividends, BitNodeMultipliers.CorporationSoftcap + upgrades);\n }\n\n determineValuation(): number {\n let val,\n profit = this.avgProfit;\n if (this.public) {\n // Account for dividends\n if (this.dividendPercentage > 0) {\n profit *= (100 - this.dividendPercentage) / 100;\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 if (upgN === 5) {\n this.dividendTaxPercentage -= 5;\n } else if (upgN === 6) {\n this.dividendTaxPercentage -= 10;\n }\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(): any {\n return Generic_toJSON(\"Corporation\", this);\n }\n\n /**\n * Initiatizes a Corporation object from a JSON save state.\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): 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, 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(): any {\n return Generic_toJSON(\"City\", this);\n }\n\n /**\n * Initiatizes a City object from a JSON save state.\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): 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: any;\n callback: (event: any, 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 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 { 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.hacknet_node_money_mult);\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 resetPidCounter();\n}\n","import { Player } from \"../Player\";\nimport { getRandomInt } from \"../utils/helpers/getRandomInt\";\nimport { addOffset } from \"../utils/helpers/addOffset\";\nimport { Generic_fromJSON, Generic_toJSON, 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.agility * inst.skillMultipliers.effAgi;\n const effDexterity = person.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.bladeburner_success_chance_mult;\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(): any {\n return Generic_toJSON(\"Action\", this);\n }\n\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): Action {\n return Generic_fromJSON(Action, value.data);\n }\n}\n\nReviver.constructors.Action = Action;\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","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 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 { 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\";\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 (Player.createProgramName === item.program) {\n Player.isWorking = false;\n Player.resetWorkStatus();\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","/**\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.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 { 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.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 = player.strength + player.defense + player.dexterity + player.agility + player.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.strength_exp_mult * xpMult, player.strength_mult) +\n calculateSkill(player.defense_exp_mult * xpMult, player.defense_mult) +\n calculateSkill(player.agility_exp_mult * xpMult, player.agility_mult) +\n calculateSkill(player.dexterity_exp_mult * xpMult, player.dexterity_mult) +\n calculateSkill(player.charisma_exp_mult * xpMult, player.charisma_mult);\n return calculateRawDiff(player, total, startingSecurityLevel);\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)), 1);\n\n const mult = Math.log2(antiLog);\n return (CONSTANTS.AugmentationGraftingTimeBase * mult + CONSTANTS.MillisecondsPerHalfHour) / 2;\n }\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","import { KEY } from \"../utils/helpers/keyCodes\";\nimport { substituteAliases } from \"../Alias\";\n// Helper function that checks if an argument (which is a string) is a valid number\nfunction isNumber(str: string): boolean {\n if (typeof str != \"string\") {\n return false;\n } // Only process strings\n return !isNaN(str as unknown as number) && !isNaN(parseFloat(str));\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 // This will be used to keep track of whether we're in a quote. This is for situations\n // like the alias command:\n // alias run=\"run NUKE.exe\"\n // We want the run=\"run NUKE.exe\" to be parsed as a single command, so this flag\n // will keep track of whether we have a quote in\n let inQuote = ``;\n\n // Returns an array with the command and its arguments in each index\n // Properly handles quotation marks (e.g. `run foo.script \"the sun\"` will return [run, foo.script, the sun])\n const args = [];\n let start = 0,\n i = 0;\n let prevChar = \"\"; // Previous character\n while (i < command.length) {\n let escaped = false; // Check for escaped quotation marks\n if (i >= 1) {\n prevChar = command.charAt(i - 1);\n if (prevChar === \"\\\\\") {\n escaped = true;\n }\n }\n\n const c = command.charAt(i);\n if (c === KEY.DOUBLE_QUOTE) {\n // Double quotes\n if (!escaped && prevChar === KEY.SPACE) {\n const endQuote = command.indexOf(KEY.DOUBLE_QUOTE, 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 (inQuote === ``) {\n inQuote = KEY.DOUBLE_QUOTE;\n } else if (inQuote === KEY.DOUBLE_QUOTE) {\n inQuote = ``;\n }\n } else if (c === KEY.QUOTE) {\n // Single quotes, same thing as above\n if (!escaped && prevChar === KEY.SPACE) {\n const endQuote = command.indexOf(KEY.QUOTE, 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 (inQuote === ``) {\n inQuote = KEY.QUOTE;\n } else if (inQuote === KEY.QUOTE) {\n inQuote = ``;\n }\n } else if (c === KEY.SPACE && inQuote === ``) {\n const arg = command.substr(start, i - start);\n\n // If this is a number, convert it from a string to number\n if (isNumber(arg)) {\n args.push(parseFloat(arg));\n } else if (arg === \"true\") {\n args.push(true);\n } else if (arg === \"false\") {\n args.push(false);\n } else {\n args.push(arg);\n }\n\n start = i + 1;\n }\n ++i;\n }\n\n // Add the last argument\n if (start !== i) {\n const arg = command.substr(start, i - start);\n\n // If this is a number, convert it from string to number\n if (isNumber(arg)) {\n args.push(parseFloat(arg));\n } else if (arg === \"true\") {\n args.push(true);\n } else if (arg === \"false\") {\n args.push(false);\n } else {\n args.push(arg);\n }\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 { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { areImportsEquals } from \"../Terminal/DirectoryHelpers\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\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 */\nasync function parseOnlyRamCalculate(\n player: IPlayer,\n otherScripts: Script[],\n code: string,\n workerScript: WorkerScript,\n): Promise {\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\n // Additional modules can either be imported from the web (in which case we use\n // a dynamic import), or from other in-game scripts\n let code;\n if (nextModule.startsWith(\"https://\") || nextModule.startsWith(\"http://\")) {\n try {\n // eslint-disable-next-line no-await-in-loop\n const module = await eval(\"import(nextModule)\");\n code = \"\";\n for (const prop in module) {\n if (typeof module[prop] === \"function\") {\n code += module[prop].toString() + \";\\n\";\n }\n }\n } catch (e) {\n console.error(`Error dynamically importing module from ${nextModule} for RAM calculations: ${e}`);\n return { cost: RamCalculationErrorCode.URLImportError };\n }\n } else {\n if (!Array.isArray(otherScripts)) {\n console.warn(`parseOnlyRamCalculate() not called with array of scripts`);\n return { cost: RamCalculationErrorCode.ImportError };\n }\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 code = script.code;\n }\n\n parseCode(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 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: any): 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 (workerScript.loadedFns[ref]) {\n continue;\n } else {\n workerScript.loadedFns[ref] = true;\n }\n\n // This accounts for namespaces (Bladeburner, CodingCpntract, etc.)\n let func;\n let refDetail = \"n/a\";\n if (ref in workerScript.env.vars.bladeburner) {\n func = workerScript.env.vars.bladeburner[ref];\n refDetail = `bladeburner.${ref}`;\n } else if (ref in workerScript.env.vars.codingcontract) {\n func = workerScript.env.vars.codingcontract[ref];\n refDetail = `codingcontract.${ref}`;\n } else if (ref in workerScript.env.vars.stanek) {\n func = workerScript.env.vars.stanek[ref];\n refDetail = `stanek.${ref}`;\n } else if (ref in workerScript.env.vars.infiltration) {\n func = workerScript.env.vars.infiltration[ref];\n refDetail = `infiltration.${ref}`;\n } else if (ref in workerScript.env.vars.gang) {\n func = workerScript.env.vars.gang[ref];\n refDetail = `gang.${ref}`;\n } else if (ref in workerScript.env.vars.sleeve) {\n func = workerScript.env.vars.sleeve[ref];\n refDetail = `sleeve.${ref}`;\n } else if (ref in workerScript.env.vars.stock) {\n func = workerScript.env.vars.stock[ref];\n refDetail = `stock.${ref}`;\n } else if (ref in workerScript.env.vars.ui) {\n func = workerScript.env.vars.ui[ref];\n refDetail = `ui.${ref}`;\n } else if (ref in workerScript.env.vars.grafting) {\n func = workerScript.env.vars.grafting[ref];\n refDetail = `grafting.${ref}`;\n } else if (ref in workerScript.env.vars.singularity) {\n func = workerScript.env.vars.singularity[ref];\n refDetail = `singularity.${ref}`;\n } else {\n func = workerScript.env.vars[ref];\n refDetail = `${ref}`;\n }\n const fnRam = applyFuncRam(func);\n ram += fnRam;\n detailedCosts.push({ type: \"fn\", name: refDetail, cost: fnRam });\n } catch (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: acorn.Node, st: any, walkDeeper: walk.WalkerCallback) => {\n if (nodeHasTrueTest((node as any).test) && !hasAwait(node)) {\n missingAwaitLine = (code.slice(0, node.start).match(/\\n/g) || []).length + 1;\n } else {\n (node as any).body && walkDeeper((node as any).body, st);\n }\n },\n },\n );\n\n return missingAwaitLine;\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): any {\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 // 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(): any {\n return {\n Identifier: (node: any, st: any) => {\n if (objectPrototypeProperties.includes(node.name)) {\n return;\n }\n addRef(st.key, node.name);\n },\n WhileStatement: (node: any, st: any, walkDeeper: any) => {\n addRef(st.key, specialReferenceWHILE);\n node.test && walkDeeper(node.test, st);\n node.body && walkDeeper(node.body, st);\n },\n DoWhileStatement: (node: any, st: any, walkDeeper: any) => {\n addRef(st.key, specialReferenceWHILE);\n node.test && walkDeeper(node.test, st);\n node.body && walkDeeper(node.body, st);\n },\n ForStatement: (node: any, st: any, walkDeeper: any) => {\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: any, st: any, walkDeeper: any) => {\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: any, st: any, walkDeeper: any) => {\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: any, st: any) => {\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: any) => {\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 async function calculateRamUsage(\n player: IPlayer,\n codeCopy: string,\n otherScripts: Script[],\n): Promise {\n // We don't need a real WorkerScript for this. Just an object that keeps\n // track of whatever's needed for RAM calculations\n const workerScript = {\n loadedFns: {},\n env: {\n vars: RamCosts,\n },\n } as WorkerScript;\n\n try {\n return await parseOnlyRamCalculate(player, otherScripts, codeCopy, workerScript);\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","import $ from \"jquery\";\nimport { vsprintf, sprintf } from \"sprintf-js\";\n\nimport { WorkerScriptStartStopEventEmitter } from \"./Netscript/WorkerScriptStartStopEventEmitter\";\n\nimport { BitNodeMultipliers } from \"./BitNode/BitNodeMultipliers\";\n\nimport { CONSTANTS } from \"./Constants\";\n\nimport {\n calculateHackingChance,\n calculateHackingExpGain,\n calculatePercentMoneyHacked,\n calculateHackingTime,\n calculateGrowTime,\n calculateWeakenTime,\n} from \"./Hacking\";\n\nimport { netscriptCanGrow, netscriptCanHack, netscriptCanWeaken } from \"./Hacking/netscriptCanHack\";\n\nimport { HacknetServer } from \"./Hacknet/HacknetServer\";\n\nimport { Terminal } from \"./Terminal\";\n\nimport { Player } from \"./Player\";\nimport { Programs } from \"./Programs/Programs\";\nimport { Script } from \"./Script/Script\";\nimport { findRunningScript, findRunningScriptByPid } from \"./Script/ScriptHelpers\";\nimport { isScriptFilename } from \"./Script/isScriptFilename\";\nimport { PromptEvent } from \"./ui/React/PromptManager\";\n\nimport { GetServer, GetAllServers, DeleteServer, AddToAllServers, createUniqueRandomIp } from \"./Server/AllServers\";\nimport { RunningScript } from \"./Script/RunningScript\";\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 { influenceStockThroughServerHack, influenceStockThroughServerGrow } from \"./StockMarket/PlayerInfluencing\";\n\nimport { isValidFilePath, removeLeadingSlash } from \"./Terminal/DirectoryHelpers\";\nimport { TextFile, getTextFile, createTextFile } from \"./TextFile\";\n\nimport { NetscriptPorts, runScriptFromScript } from \"./NetscriptWorker\";\nimport { killWorkerScript } from \"./Netscript/killWorkerScript\";\nimport { workerScripts } from \"./Netscript/WorkerScripts\";\nimport { WorkerScript } from \"./Netscript/WorkerScript\";\nimport { makeRuntimeRejectMsg, netscriptDelay, resolveNetscriptRequestedThreads } from \"./NetscriptEvaluator\";\n\nimport { numeralWrapper } from \"./ui/numeralFormat\";\nimport { convertTimeMsToTimeElapsedString } from \"./utils/StringHelperFunctions\";\n\nimport { LogBoxEvents, LogBoxCloserEvents } from \"./ui/React/LogBoxManager\";\nimport { arrayToString } from \"./utils/helpers/arrayToString\";\nimport { isString } from \"./utils/helpers/isString\";\n\nimport { BaseServer } from \"./Server/BaseServer\";\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\";\n\nimport {\n NS as INS,\n Player as INetscriptPlayer,\n Gang as IGang,\n Bladeburner as IBladeburner,\n Stanek as IStanek,\n Infiltration as IInfiltration,\n RunningScript as IRunningScript,\n RecentScript as IRecentScript,\n SourceFileLvl,\n BasicHGWOptions,\n ProcessInfo,\n HackingMultipliers,\n HacknetMultipliers,\n BitNodeMultipliers as IBNMults,\n Server as IServerDef,\n RunningScript as IRunningScriptDef,\n // ToastVariant,\n} from \"./ScriptEditor/NetscriptDefinitions\";\nimport { NetscriptSingularity } from \"./NetscriptFunctions/Singularity\";\n\nimport { toNative } from \"./NetscriptFunctions/toNative\";\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 { CityName } from \"./Locations/data/CityNames\";\nimport { InternalAPI, NetscriptContext, wrapAPI } from \"./Netscript/APIWrapper\";\nimport { INetscriptHelper } from \"./NetscriptFunctions/INetscriptHelper\";\n\ninterface NS extends INS {\n [key: string]: any;\n gang: IGang;\n bladeburner: IBladeburner;\n stanek: IStanek;\n infiltration: IInfiltration;\n}\n\nexport function NetscriptFunctions(workerScript: WorkerScript): NS {\n const updateDynamicRam = function (fnName: string, ramCost: number): void {\n if (workerScript.dynamicLoadedFns[fnName]) {\n return;\n }\n workerScript.dynamicLoadedFns[fnName] = true;\n\n let threads = workerScript.scriptRef.threads;\n if (typeof threads !== \"number\") {\n console.warn(`WorkerScript detected NaN for threadcount for ${workerScript.name} on ${workerScript.hostname}`);\n threads = 1;\n }\n workerScript.dynamicRamUsage += ramCost;\n if (workerScript.dynamicRamUsage > 1.01 * workerScript.ramUsage) {\n throw makeRuntimeRejectMsg(\n workerScript,\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(workerScript.dynamicRamUsage)}\n Static RAM Usage: ${numeralWrapper.formatRAM(workerScript.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 }\n };\n\n /**\n * Gets the Server for a specific hostname/ip, throwing an error\n * if the server doesn't exist.\n * @param {string} hostname - Hostname or IP of the server\n * @param {string} callingFnName - Name of calling function. For logging purposes\n * @returns {BaseServer} The specified server as a BaseServer\n */\n const safeGetServer = function (hostname: string, ctx: NetscriptContext): BaseServer {\n const server = GetServer(hostname);\n if (server == null) {\n throw ctx.makeRuntimeErrorMsg(`Invalid hostname: ${hostname}`);\n }\n return server;\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 */\n const getRunningScript = function (\n ctx: NetscriptContext,\n fn: string,\n hostname: string,\n scriptArgs: any,\n ): RunningScript | null {\n if (!Array.isArray(scriptArgs)) {\n throw makeRuntimeRejectMsg(\n 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 = workerScript.hostname;\n }\n const server = safeGetServer(hostname, ctx);\n\n return findRunningScript(fn, scriptArgs, server);\n }\n\n // If no arguments are specified, return the current RunningScript\n return workerScript.scriptRef;\n };\n\n const getRunningScriptByPid = function (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\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 */\n const createPublicRunningScript = function (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 * 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 */\n const getCannotFindRunningScriptErrorMessage = function (fn: string, hostname: string, scriptArgs: any): string {\n if (!Array.isArray(scriptArgs)) {\n scriptArgs = [];\n }\n\n return `Cannot find running script ${fn} on server ${hostname} with args: ${arrayToString(scriptArgs)}`;\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 */\n const failOnHacknetServer = function (server: BaseServer, callingFn = \"\"): boolean {\n if (server instanceof HacknetServer) {\n workerScript.log(callingFn, () => `Does not work on Hacknet Servers`);\n return true;\n } else {\n return false;\n }\n };\n\n const makeRuntimeErrorMsg = function (caller: string, 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 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.url && stackline.includes(script.url)) {\n filename = script.filename;\n }\n for (const dependency of script.dependencies) {\n if (stackline.includes(dependency.url)) {\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 const checkSingularityAccess = function (func: string): void {\n if (Player.bitNodeN !== 4) {\n if (Player.sourceFileLvl(4) === 0) {\n throw makeRuntimeErrorMsg(\n func,\n `This singularity function requires Source-File 4 to run. A power up you obtain later in the game. It will be very obvious when and how you can obtain it.`,\n );\n }\n }\n };\n\n const hack = async function (\n ctx: NetscriptContext,\n hostname: string,\n manual: boolean,\n { threads: requestedThreads, stock }: any = {},\n ): Promise {\n if (hostname === undefined) {\n throw ctx.makeRuntimeErrorMsg(\"Takes 1 argument.\");\n }\n const threads = resolveNetscriptRequestedThreads(ctx, requestedThreads);\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n throw ctx.makeRuntimeErrorMsg(\"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 ctx.makeRuntimeErrorMsg(canHack.msg || \"\");\n }\n\n ctx.log(\n () =>\n `Executing on '${server.hostname}' in ${convertTimeMsToTimeElapsedString(\n hackingTime * 1000,\n true,\n )} (t=${numeralWrapper.formatThreads(threads)})`,\n );\n\n return netscriptDelay(hackingTime * 1000, workerScript).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 workerScript.scriptRef.onlineMoneyMade += moneyGained;\n Player.scriptProdSinceLastAug += moneyGained;\n workerScript.scriptRef.recordHack(server.hostname, moneyGained, threads);\n Player.gainHackingExp(expGainedOnSuccess);\n if (manual) Player.gainIntelligenceExp(0.005);\n workerScript.scriptRef.onlineExpGained += expGainedOnSuccess;\n ctx.log(\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 workerScript.scriptRef.onlineExpGained += expGainedOnFailure;\n ctx.log(\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\n const argsToString = function (args: any[]): string {\n let out = \"\";\n for (let arg of args) {\n arg = toNative(arg);\n out += typeof arg === \"object\" ? JSON.stringify(arg) : `${arg}`;\n }\n\n return out;\n };\n\n const helper: INetscriptHelper = {\n updateDynamicRam: updateDynamicRam,\n makeRuntimeErrorMsg: makeRuntimeErrorMsg,\n string: (funcName: string, 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(funcName, `${argName} should be a string.`);\n },\n number: (funcName: string, 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(funcName, `${argName} is NaN.`);\n return v;\n }\n throw makeRuntimeErrorMsg(funcName, `${argName} should be a number.`);\n },\n boolean: (v: unknown): boolean => {\n return !!v; // Just convert it to boolean.\n },\n city: (funcName: string, argName: string, v: unknown): CityName => {\n if (typeof v !== \"string\") throw makeRuntimeErrorMsg(funcName, `${argName} should be a city name.`);\n const s = v as CityName;\n if (!Object.values(CityName).includes(s))\n throw makeRuntimeErrorMsg(funcName, `${argName} should be a city name.`);\n return s;\n },\n getServer: safeGetServer,\n checkSingularityAccess: checkSingularityAccess,\n hack: hack,\n getValidPort: (funcName: string, port: number): IPort => {\n if (isNaN(port)) {\n throw makeRuntimeErrorMsg(\n funcName,\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 funcName,\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(funcName, `Could not find port: ${port}. This is a bug. Report to dev.`);\n }\n return iport;\n },\n };\n\n const singularity = NetscriptSingularity(Player, workerScript);\n\n const base: InternalAPI = {\n ...singularity,\n\n args: workerScript.args as unknown as any,\n enums: {\n toast: ToastVariant,\n } as unknown as any,\n\n singularity: singularity,\n gang: NetscriptGang(Player, workerScript),\n bladeburner: NetscriptBladeburner(Player, workerScript),\n codingcontract: NetscriptCodingContract(Player, workerScript),\n sleeve: NetscriptSleeve(Player),\n corporation: NetscriptCorporation(Player, workerScript),\n stanek: NetscriptStanek(Player, workerScript, helper),\n infiltration: NetscriptInfiltration(Player),\n ui: NetscriptUserInterface(),\n formulas: NetscriptFormulas(Player, helper),\n stock: NetscriptStockMarket(Player, workerScript),\n grafting: NetscriptGrafting(Player),\n hacknet: NetscriptHacknet(Player, workerScript),\n sprintf: sprintf,\n vsprintf: vsprintf,\n scan:\n (ctx: NetscriptContext) =>\n (_hostname: unknown = workerScript.hostname): string[] => {\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const server = safeGetServer(hostname, ctx);\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 ctx.log(() => `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 = ctx.helper.string(\"hostname\", _hostname);\n return hack(ctx, hostname, false, { threads: requestedThreads, stock: stock });\n },\n hackAnalyzeThreads:\n (ctx: NetscriptContext) =>\n (_hostname: unknown, _hackAmount: unknown): number => {\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const hackAmount = ctx.helper.number(\"hackAmount\", _hackAmount);\n\n // Check argument validity\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"Cannot be executed on this server.\");\n return -1;\n }\n if (isNaN(hackAmount)) {\n throw ctx.makeRuntimeErrorMsg(\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 = ctx.helper.string(\"hostname\", _hostname);\n\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"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 = ctx.helper.number(\"threads\", _threads);\n if (_hostname) {\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"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 = ctx.helper.string(\"hostname\", _hostname);\n\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"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 = ctx.helper.number(\"time\", _time);\n if (time === undefined) {\n throw ctx.makeRuntimeErrorMsg(\"Takes 1 argument.\");\n }\n ctx.log(() => `Sleeping for ${time} milliseconds`);\n return netscriptDelay(time, workerScript).then(function () {\n return Promise.resolve(true);\n });\n },\n asleep: (ctx: NetscriptContext) =>\n function (_time: unknown = 0): Promise {\n const time = ctx.helper.number(\"time\", _time);\n ctx.log(() => `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 = ctx.helper.string(\"hostname\", _hostname);\n const threads = resolveNetscriptRequestedThreads(ctx, requestedThreads ?? workerScript.scriptRef.threads);\n\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"Cannot be executed on this server.\");\n return Promise.resolve(0);\n }\n\n const host = GetServer(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 ctx.makeRuntimeErrorMsg(canHack.msg || \"\");\n }\n\n const growTime = calculateGrowTime(server, Player);\n ctx.log(\n () =>\n `Executing on '${server.hostname}' in ${convertTimeMsToTimeElapsedString(\n growTime * 1000,\n true,\n )} (t=${numeralWrapper.formatThreads(threads)}).`,\n );\n return netscriptDelay(growTime * 1000, workerScript).then(function () {\n const moneyBefore = server.moneyAvailable <= 0 ? 1 : server.moneyAvailable;\n processSingleServerGrowth(server, threads, Player, host.cpuCores);\n const moneyAfter = server.moneyAvailable;\n workerScript.scriptRef.recordGrow(server.hostname, threads);\n const expGain = calculateHackingExpGain(server, Player) * threads;\n const logGrowPercent = moneyAfter / moneyBefore - 1;\n ctx.log(\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(\n threads,\n )}).`,\n );\n 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 = ctx.helper.string(\"hostname\", _hostname);\n const growth = ctx.helper.number(\"growth\", _growth);\n const cores = ctx.helper.number(\"cores\", _cores);\n\n // Check argument validity\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"Cannot be executed on this server.\");\n return 0;\n }\n if (typeof growth !== \"number\" || isNaN(growth) || growth < 1 || !isFinite(growth)) {\n throw ctx.makeRuntimeErrorMsg(`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 = ctx.helper.number(\"threads\", _threads);\n if (_hostname) {\n const cores = ctx.helper.number(\"cores\", _cores) || 1;\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const server = safeGetServer(hostname, ctx);\n\n if (!(server instanceof Server)) {\n ctx.log(() => \"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 = ctx.helper.string(\"hostname\", _hostname);\n const threads = resolveNetscriptRequestedThreads(ctx, requestedThreads ?? workerScript.scriptRef.threads);\n if (hostname === undefined) {\n throw ctx.makeRuntimeErrorMsg(\"Takes 1 argument.\");\n }\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"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 ctx.makeRuntimeErrorMsg(canHack.msg || \"\");\n }\n\n const weakenTime = calculateWeakenTime(server, Player);\n ctx.log(\n () =>\n `Executing on '${server.hostname}' in ${convertTimeMsToTimeElapsedString(\n weakenTime * 1000,\n true,\n )} (t=${numeralWrapper.formatThreads(threads)})`,\n );\n return netscriptDelay(weakenTime * 1000, workerScript).then(function () {\n const host = GetServer(workerScript.hostname);\n if (host === null) {\n ctx.log(() => \"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 workerScript.scriptRef.recordWeaken(server.hostname, threads);\n const expGain = calculateHackingExpGain(server, Player) * threads;\n ctx.log(\n () =>\n `'${server.hostname}' security level weakened to ${\n server.hackDifficulty\n }. Gained ${numeralWrapper.formatExp(expGain)} hacking exp (t=${numeralWrapper.formatThreads(threads)})`,\n );\n 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 = ctx.helper.number(\"threads\", _threads);\n const cores = ctx.helper.number(\"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 ctx.log(() => \"Sharing this computer.\");\n const end = StartSharing(workerScript.scriptRef.threads * calculateIntelligenceBonus(Player.intelligence, 2));\n return netscriptDelay(10000, workerScript).finally(function () {\n ctx.log(() => \"Finished sharing this computer.\");\n end();\n });\n },\n getSharePower: () => (): number => {\n return CalculateShareMult();\n },\n print:\n (ctx: NetscriptContext) =>\n (...args: any[]): void => {\n if (args.length === 0) {\n throw ctx.makeRuntimeErrorMsg(\"Takes at least 1 argument.\");\n }\n workerScript.print(argsToString(args));\n },\n printf:\n (ctx: NetscriptContext) =>\n (_format: unknown, ...args: any[]): void => {\n const format = ctx.helper.string(\"format\", _format);\n if (typeof format !== \"string\") {\n throw ctx.makeRuntimeErrorMsg(\"First argument must be string for the format.\");\n }\n workerScript.print(vsprintf(format, args));\n },\n tprint:\n (ctx: NetscriptContext) =>\n (...args: any[]): void => {\n if (args.length === 0) {\n throw ctx.makeRuntimeErrorMsg(\"Takes at least 1 argument.\");\n }\n const str = argsToString(args);\n if (str.startsWith(\"ERROR\") || str.startsWith(\"FAIL\")) {\n Terminal.error(`${workerScript.scriptRef.filename}: ${str}`);\n return;\n }\n if (str.startsWith(\"SUCCESS\")) {\n Terminal.success(`${workerScript.scriptRef.filename}: ${str}`);\n return;\n }\n if (str.startsWith(\"WARN\")) {\n Terminal.warn(`${workerScript.scriptRef.filename}: ${str}`);\n return;\n }\n if (str.startsWith(\"INFO\")) {\n Terminal.info(`${workerScript.scriptRef.filename}: ${str}`);\n return;\n }\n Terminal.print(`${workerScript.scriptRef.filename}: ${str}`);\n },\n tprintf:\n (ctx: NetscriptContext) =>\n (_format: unknown, ...args: any[]): void => {\n const format = ctx.helper.string(\"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: () => (): void => {\n workerScript.scriptRef.clearLog();\n },\n disableLog:\n (ctx: NetscriptContext) =>\n (_fn: unknown): void => {\n const fn = ctx.helper.string(\"fn\", _fn);\n if (fn === \"ALL\") {\n for (const fn of Object.keys(possibleLogs)) {\n workerScript.disableLogs[fn] = true;\n }\n ctx.log(() => `Disabled logging for all functions`);\n } else if (possibleLogs[fn] === undefined) {\n throw ctx.makeRuntimeErrorMsg(`Invalid argument: ${fn}.`);\n } else {\n workerScript.disableLogs[fn] = true;\n ctx.log(() => `Disabled logging for ${fn}`);\n }\n },\n enableLog:\n (ctx: NetscriptContext) =>\n (_fn: unknown): void => {\n const fn = ctx.helper.string(\"fn\", _fn);\n if (fn === \"ALL\") {\n for (const fn of Object.keys(possibleLogs)) {\n delete workerScript.disableLogs[fn];\n }\n ctx.log(() => `Enabled logging for all functions`);\n } else if (possibleLogs[fn] === undefined) {\n throw ctx.makeRuntimeErrorMsg(`Invalid argument: ${fn}.`);\n }\n delete workerScript.disableLogs[fn];\n ctx.log(() => `Enabled logging for ${fn}`);\n },\n isLogEnabled:\n (ctx: NetscriptContext) =>\n (_fn: unknown): boolean => {\n const fn = ctx.helper.string(\"fn\", _fn);\n if (possibleLogs[fn] === undefined) {\n throw ctx.makeRuntimeErrorMsg(`Invalid argument: ${fn}.`);\n }\n return !workerScript.disableLogs[fn];\n },\n getScriptLogs:\n (ctx: NetscriptContext) =>\n (fn: any, hostname: any, ...scriptArgs: any[]): string[] => {\n const runningScriptObj = getRunningScript(ctx, fn, hostname, scriptArgs);\n if (runningScriptObj == null) {\n ctx.log(() => getCannotFindRunningScriptErrorMessage(fn, hostname, scriptArgs));\n return [];\n }\n\n return runningScriptObj.logs.slice();\n },\n tail:\n (ctx: NetscriptContext) =>\n (fn: any, hostname: any = workerScript.hostname, ...scriptArgs: any[]): void => {\n let runningScriptObj;\n if (fn === undefined) {\n runningScriptObj = workerScript.scriptRef;\n } else if (typeof fn === \"number\") {\n runningScriptObj = getRunningScriptByPid(fn);\n } else {\n runningScriptObj = getRunningScript(ctx, fn, hostname, scriptArgs);\n }\n if (runningScriptObj == null) {\n ctx.log(() => getCannotFindRunningScriptErrorMessage(fn, hostname, scriptArgs));\n return;\n }\n\n LogBoxEvents.emit(runningScriptObj);\n },\n closeTail:\n (ctx: NetscriptContext) =>\n (_pid: unknown = workerScript.scriptRef.pid): void => {\n const pid = ctx.helper.number(\"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 = ctx.helper.string(\"hostname\", _hostname);\n\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"Cannot be executed on this server.\");\n return false;\n }\n if (server.hasAdminRights) {\n ctx.log(() => `Already have root access to '${server.hostname}'.`);\n return true;\n }\n if (!Player.hasProgram(Programs.NukeProgram.name)) {\n throw ctx.makeRuntimeErrorMsg(\"You do not have the NUKE.exe virus!\");\n }\n if (server.openPortCount < server.numOpenPortsRequired) {\n throw ctx.makeRuntimeErrorMsg(\"Not enough ports opened to use NUKE.exe virus.\");\n }\n server.hasAdminRights = true;\n ctx.log(() => `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 = ctx.helper.string(\"hostname\", _hostname);\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"Cannot be executed on this server.\");\n return false;\n }\n if (!Player.hasProgram(Programs.BruteSSHProgram.name)) {\n throw ctx.makeRuntimeErrorMsg(\"You do not have the BruteSSH.exe program!\");\n }\n if (!server.sshPortOpen) {\n ctx.log(() => `Executed BruteSSH.exe on '${server.hostname}' to open SSH port (22).`);\n server.sshPortOpen = true;\n ++server.openPortCount;\n } else {\n ctx.log(() => `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 = ctx.helper.string(\"hostname\", _hostname);\n if (hostname === undefined) {\n throw ctx.makeRuntimeErrorMsg(\"Takes 1 argument.\");\n }\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"Cannot be executed on this server.\");\n return false;\n }\n if (!Player.hasProgram(Programs.FTPCrackProgram.name)) {\n throw ctx.makeRuntimeErrorMsg(\"You do not have the FTPCrack.exe program!\");\n }\n if (!server.ftpPortOpen) {\n ctx.log(() => `Executed FTPCrack.exe on '${server.hostname}' to open FTP port (21).`);\n server.ftpPortOpen = true;\n ++server.openPortCount;\n } else {\n ctx.log(() => `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 = ctx.helper.string(\"hostname\", _hostname);\n if (hostname === undefined) {\n throw ctx.makeRuntimeErrorMsg(\"Takes 1 argument.\");\n }\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"Cannot be executed on this server.\");\n return false;\n }\n if (!Player.hasProgram(Programs.RelaySMTPProgram.name)) {\n throw ctx.makeRuntimeErrorMsg(\"You do not have the relaySMTP.exe program!\");\n }\n if (!server.smtpPortOpen) {\n ctx.log(() => `Executed relaySMTP.exe on '${server.hostname}' to open SMTP port (25).`);\n server.smtpPortOpen = true;\n ++server.openPortCount;\n } else {\n ctx.log(() => `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 = ctx.helper.string(\"hostname\", _hostname);\n if (hostname === undefined) {\n throw ctx.makeRuntimeErrorMsg(\"Takes 1 argument\");\n }\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"Cannot be executed on this server.\");\n return false;\n }\n if (!Player.hasProgram(Programs.HTTPWormProgram.name)) {\n throw ctx.makeRuntimeErrorMsg(\"You do not have the HTTPWorm.exe program!\");\n }\n if (!server.httpPortOpen) {\n ctx.log(() => `Executed HTTPWorm.exe on '${server.hostname}' to open HTTP port (80).`);\n server.httpPortOpen = true;\n ++server.openPortCount;\n } else {\n ctx.log(() => `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 = ctx.helper.string(\"hostname\", _hostname);\n if (hostname === undefined) {\n throw ctx.makeRuntimeErrorMsg(\"Takes 1 argument.\");\n }\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"Cannot be executed on this server.\");\n return false;\n }\n if (!Player.hasProgram(Programs.SQLInjectProgram.name)) {\n throw ctx.makeRuntimeErrorMsg(\"You do not have the SQLInject.exe program!\");\n }\n if (!server.sqlPortOpen) {\n ctx.log(() => `Executed SQLInject.exe on '${server.hostname}' to open SQL port (1433).`);\n server.sqlPortOpen = true;\n ++server.openPortCount;\n } else {\n ctx.log(() => `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: any[]): number => {\n const scriptname = ctx.helper.string(\"scriptname\", _scriptname);\n const threads = ctx.helper.number(\"threads\", _threads);\n if (scriptname === undefined) {\n throw ctx.makeRuntimeErrorMsg(\"Usage: run(scriptname, [numThreads], [arg1], [arg2]...)\");\n }\n if (isNaN(threads) || threads <= 0) {\n throw ctx.makeRuntimeErrorMsg(`Invalid thread count. Must be numeric and > 0, is ${threads}`);\n }\n const scriptServer = GetServer(workerScript.hostname);\n if (scriptServer == null) {\n throw ctx.makeRuntimeErrorMsg(\"Could not find server. This is a bug. Report to dev.\");\n }\n\n return runScriptFromScript(Player, \"run\", scriptServer, scriptname, args, workerScript, threads);\n },\n exec:\n (ctx: NetscriptContext) =>\n (_scriptname: unknown, _hostname: unknown, _threads: unknown = 1, ...args: any[]): number => {\n const scriptname = ctx.helper.string(\"scriptname\", _scriptname);\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const threads = ctx.helper.number(\"threads\", _threads);\n if (scriptname === undefined || hostname === undefined) {\n throw ctx.makeRuntimeErrorMsg(\"Usage: exec(scriptname, server, [numThreads], [arg1], [arg2]...)\");\n }\n if (isNaN(threads) || threads <= 0) {\n throw ctx.makeRuntimeErrorMsg(`Invalid thread count. Must be numeric and > 0, is ${threads}`);\n }\n const server = safeGetServer(hostname, ctx);\n return runScriptFromScript(Player, \"exec\", server, scriptname, args, workerScript, threads);\n },\n spawn:\n (ctx: NetscriptContext) =>\n (_scriptname: unknown, _threads: unknown = 1, ...args: any[]): void => {\n const scriptname = ctx.helper.string(\"scriptname\", _scriptname);\n const threads = ctx.helper.number(\"threads\", _threads);\n if (!scriptname || !threads) {\n throw ctx.makeRuntimeErrorMsg(\"Usage: spawn(scriptname, threads)\");\n }\n\n const spawnDelay = 10;\n setTimeout(() => {\n if (isNaN(threads) || threads <= 0) {\n throw ctx.makeRuntimeErrorMsg(`Invalid thread count. Must be numeric and > 0, is ${threads}`);\n }\n const scriptServer = GetServer(workerScript.hostname);\n if (scriptServer == null) {\n throw ctx.makeRuntimeErrorMsg(\"Could not find server. This is a bug. Report to dev\");\n }\n\n return runScriptFromScript(Player, \"spawn\", scriptServer, scriptname, args, workerScript, threads);\n }, spawnDelay * 1e3);\n\n ctx.log(() => `Will execute '${scriptname}' in ${spawnDelay} seconds`);\n\n workerScript.running = false; // Prevent workerScript from \"finishing execution naturally\"\n if (killWorkerScript(workerScript)) {\n ctx.log(() => \"Exiting...\");\n }\n },\n kill:\n (ctx: NetscriptContext) =>\n (filename: any, hostname?: any, ...scriptArgs: any[]): boolean => {\n let res;\n const killByPid = typeof filename === \"number\";\n if (killByPid) {\n // Kill by pid\n res = killWorkerScript(filename);\n } else {\n // Kill by filename/hostname\n if (filename === undefined || hostname === undefined) {\n throw ctx.makeRuntimeErrorMsg(\"Usage: kill(scriptname, server, [arg1], [arg2]...)\");\n }\n\n const server = safeGetServer(hostname, ctx);\n const runningScriptObj = getRunningScript(ctx, filename, hostname, scriptArgs);\n if (runningScriptObj == null) {\n ctx.log(() => getCannotFindRunningScriptErrorMessage(filename, hostname, scriptArgs));\n return false;\n }\n\n res = killWorkerScript(runningScriptObj, server.hostname);\n }\n\n if (res) {\n if (killByPid) {\n ctx.log(() => `Killing script with PID ${filename}`);\n } else {\n ctx.log(() => `Killing '${filename}' on '${hostname}' with args: ${arrayToString(scriptArgs)}.`);\n }\n return true;\n } else {\n if (killByPid) {\n ctx.log(() => `No script with PID ${filename}`);\n } else {\n ctx.log(() => `No such script '${filename}' on '${hostname}' with args: ${arrayToString(scriptArgs)}`);\n }\n return false;\n }\n },\n killall:\n (ctx: NetscriptContext) =>\n (_hostname: unknown = workerScript.hostname, _safetyguard: unknown = true): boolean => {\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const safetyguard = helper.boolean(_safetyguard);\n if (hostname === undefined) {\n throw ctx.makeRuntimeErrorMsg(\"Usage: killall(hostname, [safetyguard boolean])\");\n }\n const server = safeGetServer(hostname, ctx);\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 == workerScript.pid) continue;\n killWorkerScript(server.runningScripts[i], server.hostname, false);\n ++scriptsKilled;\n }\n WorkerScriptStartStopEventEmitter.emit();\n ctx.log(() => `Killing all scripts on '${server.hostname}'. May take a few minutes for the scripts to die.`);\n\n return scriptsKilled > 0;\n },\n exit: (ctx: NetscriptContext) => (): void => {\n workerScript.running = false; // Prevent workerScript from \"finishing execution naturally\"\n if (killWorkerScript(workerScript)) {\n ctx.log(() => \"Exiting...\");\n } else {\n ctx.log(() => \"Failed. This is a bug. Report to dev.\");\n }\n },\n scp:\n (ctx: NetscriptContext) =>\n async (scriptname: any, _hostname1: unknown, hostname2?: any): Promise => {\n const hostname1 = ctx.helper.string(\"hostname1\", _hostname1);\n if (scriptname && scriptname.constructor === Array) {\n // Recursively call scp on all elements of array\n const scripts: string[] = scriptname;\n if (scripts.length === 0) {\n throw ctx.makeRuntimeErrorMsg(\"No scripts to copy\");\n }\n let res = true;\n await Promise.all(\n scripts.map(async function (script) {\n if (!(await NetscriptFunctions(workerScript).scp(script, hostname1, hostname2))) {\n res = false;\n }\n }),\n );\n return Promise.resolve(res);\n }\n\n // Invalid file type\n if (!isValidFilePath(scriptname)) {\n throw ctx.makeRuntimeErrorMsg(`Invalid filename: '${scriptname}'`);\n }\n\n // Invalid file name\n if (!scriptname.endsWith(\".lit\") && !isScriptFilename(scriptname) && !scriptname.endsWith(\"txt\")) {\n throw ctx.makeRuntimeErrorMsg(\"Only works for scripts, .lit and .txt files\");\n }\n\n let destServer: BaseServer | null;\n let currServ: BaseServer | null;\n\n if (hostname2 != null) {\n // 3 Argument version: scriptname, source, destination\n if (scriptname === undefined || hostname1 === undefined || hostname2 === undefined) {\n throw ctx.makeRuntimeErrorMsg(\"Takes 2 or 3 arguments\");\n }\n destServer = safeGetServer(hostname2, ctx);\n currServ = safeGetServer(hostname1, ctx);\n } else if (hostname1 != null) {\n // 2 Argument version: scriptname, destination\n if (scriptname === undefined || hostname1 === undefined) {\n throw ctx.makeRuntimeErrorMsg(\"Takes 2 or 3 arguments\");\n }\n destServer = safeGetServer(hostname1, ctx);\n currServ = GetServer(workerScript.hostname);\n if (currServ == null) {\n throw ctx.makeRuntimeErrorMsg(\n \"Could not find server hostname for this script. This is a bug. Report to dev.\",\n );\n }\n } else {\n throw ctx.makeRuntimeErrorMsg(\"Takes 2 or 3 arguments\");\n }\n\n // Scp for lit files\n if (scriptname.endsWith(\".lit\")) {\n let found = false;\n for (let i = 0; i < currServ.messages.length; ++i) {\n if (currServ.messages[i] == scriptname) {\n found = true;\n break;\n }\n }\n\n if (!found) {\n ctx.log(() => `File '${scriptname}' does not exist.`);\n return Promise.resolve(false);\n }\n\n for (let i = 0; i < destServer.messages.length; ++i) {\n if (destServer.messages[i] === scriptname) {\n ctx.log(() => `File '${scriptname}' copied over to '${destServer?.hostname}'.`);\n return Promise.resolve(true); // Already exists\n }\n }\n destServer.messages.push(scriptname);\n ctx.log(() => `File '${scriptname}' copied over to '${destServer?.hostname}'.`);\n return Promise.resolve(true);\n }\n\n // Scp for text files\n if (scriptname.endsWith(\".txt\")) {\n let txtFile;\n for (let i = 0; i < currServ.textFiles.length; ++i) {\n if (currServ.textFiles[i].fn === scriptname) {\n txtFile = currServ.textFiles[i];\n break;\n }\n }\n if (txtFile === undefined) {\n ctx.log(() => `File '${scriptname}' does not exist.`);\n return Promise.resolve(false);\n }\n\n for (let i = 0; i < destServer.textFiles.length; ++i) {\n if (destServer.textFiles[i].fn === scriptname) {\n // Overwrite\n destServer.textFiles[i].text = txtFile.text;\n ctx.log(() => `File '${scriptname}' copied over to '${destServer?.hostname}'.`);\n return Promise.resolve(true);\n }\n }\n const newFile = new TextFile(txtFile.fn, txtFile.text);\n destServer.textFiles.push(newFile);\n ctx.log(() => `File '${scriptname}' copied over to '${destServer?.hostname}'.`);\n return Promise.resolve(true);\n }\n\n // Scp for script files\n let sourceScript = null;\n for (let i = 0; i < currServ.scripts.length; ++i) {\n if (scriptname == currServ.scripts[i].filename) {\n sourceScript = currServ.scripts[i];\n break;\n }\n }\n if (sourceScript == null) {\n ctx.log(() => `File '${scriptname}' does not exist.`);\n return Promise.resolve(false);\n }\n\n // Overwrite script if it already exists\n for (let i = 0; i < destServer.scripts.length; ++i) {\n if (scriptname == destServer.scripts[i].filename) {\n ctx.log(() => `WARNING: File '${scriptname}' overwritten on '${destServer?.hostname}'`);\n const oldScript = destServer.scripts[i];\n // If it's the exact same file don't actually perform the\n // copy to avoid recompiling uselessly. Players tend to scp\n // liberally.\n if (oldScript.code === sourceScript.code) return Promise.resolve(true);\n oldScript.code = sourceScript.code;\n oldScript.ramUsage = sourceScript.ramUsage;\n oldScript.markUpdated();\n return Promise.resolve(true);\n }\n }\n\n // Create new script if it does not already exist\n const newScript = new Script(Player, scriptname);\n newScript.code = sourceScript.code;\n newScript.ramUsage = sourceScript.ramUsage;\n newScript.server = destServer.hostname;\n destServer.scripts.push(newScript);\n ctx.log(() => `File '${scriptname}' copied over to '${destServer?.hostname}'.`);\n return new Promise((resolve) => {\n if (destServer === null) {\n resolve(false);\n return;\n }\n newScript.updateRamUsage(Player, destServer.scripts).then(() => resolve(true));\n });\n },\n ls:\n (ctx: NetscriptContext) =>\n (_hostname: unknown, _grep: unknown = \"\"): string[] => {\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const grep = ctx.helper.string(\"grep\", _grep);\n\n const server = safeGetServer(hostname, ctx);\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 ...createPublicRunningScript(rs.runningScript),\n }));\n },\n ps:\n (ctx: NetscriptContext) =>\n (_hostname: unknown = workerScript.hostname): ProcessInfo[] => {\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const server = safeGetServer(hostname, ctx);\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 = ctx.helper.string(\"hostname\", _hostname);\n\n const server = safeGetServer(hostname, ctx);\n return server.hasAdminRights;\n },\n getHostname: (ctx: NetscriptContext) => (): string => {\n const scriptServer = GetServer(workerScript.hostname);\n if (scriptServer == null) {\n throw ctx.makeRuntimeErrorMsg(\"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 ctx.log(() => `returned ${Player.hacking}`);\n return Player.hacking;\n },\n getHackingMultipliers: () => (): HackingMultipliers => {\n return {\n chance: Player.hacking_chance_mult,\n speed: Player.hacking_speed_mult,\n money: Player.hacking_money_mult,\n growth: Player.hacking_grow_mult,\n };\n },\n getHacknetMultipliers: () => (): HacknetMultipliers => {\n return {\n production: Player.hacknet_node_money_mult,\n purchaseCost: Player.hacknet_node_purchase_cost_mult,\n ramCost: Player.hacknet_node_ram_cost_mult,\n coreCost: Player.hacknet_node_core_cost_mult,\n levelCost: Player.hacknet_node_level_cost_mult,\n };\n },\n getBitNodeMultipliers: (ctx: NetscriptContext) => (): IBNMults => {\n if (Player.sourceFileLvl(5) <= 0 && Player.bitNodeN !== 5) {\n throw ctx.makeRuntimeErrorMsg(\"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 = workerScript.hostname): IServerDef => {\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const server = safeGetServer(hostname, ctx);\n const copy = Object.assign({}, server) as any;\n // These fields should be hidden.\n copy.contracts = undefined;\n copy.messages = undefined;\n copy.runningScripts = undefined;\n copy.scripts = undefined;\n copy.textFiles = undefined;\n copy.programs = undefined;\n copy.serversOnNetwork = undefined;\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 = ctx.helper.string(\"hostname\", _hostname);\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"Cannot be executed on this server.\");\n return 0;\n }\n if (failOnHacknetServer(server, \"getServerMoneyAvailable\")) {\n return 0;\n }\n if (server.hostname == \"home\") {\n // Return player's money\n ctx.log(() => `returned player's money: ${numeralWrapper.formatMoney(Player.money)}`);\n return Player.money;\n }\n ctx.log(() => `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 = ctx.helper.string(\"hostname\", _hostname);\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"Cannot be executed on this server.\");\n return 1;\n }\n if (failOnHacknetServer(server, \"getServerSecurityLevel\")) {\n return 1;\n }\n ctx.log(\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 = ctx.helper.string(\"hostname\", _hostname);\n ctx.log(() => `getServerBaseSecurityLevel is deprecated because it's not useful.`);\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"Cannot be executed on this server.\");\n return 1;\n }\n if (failOnHacknetServer(server, \"getServerBaseSecurityLevel\")) {\n return 1;\n }\n ctx.log(\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 = ctx.helper.string(\"hostname\", _hostname);\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"Cannot be executed on this server.\");\n return 1;\n }\n if (failOnHacknetServer(server, \"getServerMinSecurityLevel\")) {\n return 1;\n }\n ctx.log(() => `returned ${numeralWrapper.formatServerSecurity(server.minDifficulty)} for ${server.hostname}`);\n return server.minDifficulty;\n },\n getServerRequiredHackingLevel:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): number => {\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"Cannot be executed on this server.\");\n return 1;\n }\n if (failOnHacknetServer(server, \"getServerRequiredHackingLevel\")) {\n return 1;\n }\n ctx.log(() => `returned ${numeralWrapper.formatSkill(server.requiredHackingSkill)} for '${server.hostname}'`);\n return server.requiredHackingSkill;\n },\n getServerMaxMoney:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): number => {\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"Cannot be executed on this server.\");\n return 0;\n }\n if (failOnHacknetServer(server, \"getServerMaxMoney\")) {\n return 0;\n }\n ctx.log(() => `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 = ctx.helper.string(\"hostname\", _hostname);\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"Cannot be executed on this server.\");\n return 1;\n }\n if (failOnHacknetServer(server, \"getServerGrowth\")) {\n return 1;\n }\n ctx.log(() => `returned ${server.serverGrowth} for '${server.hostname}'`);\n return server.serverGrowth;\n },\n getServerNumPortsRequired:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): number => {\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"Cannot be executed on this server.\");\n return 5;\n }\n if (failOnHacknetServer(server, \"getServerNumPortsRequired\")) {\n return 5;\n }\n ctx.log(() => `returned ${server.numOpenPortsRequired} for '${server.hostname}'`);\n return server.numOpenPortsRequired;\n },\n getServerRam:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): [number, number] => {\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n ctx.log(() => `getServerRam is deprecated in favor of getServerMaxRam / getServerUsedRam`);\n const server = safeGetServer(hostname, ctx);\n ctx.log(\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 = ctx.helper.string(\"hostname\", _hostname);\n const server = safeGetServer(hostname, ctx);\n ctx.log(() => `returned ${numeralWrapper.formatRAM(server.maxRam)}`);\n return server.maxRam;\n },\n getServerUsedRam:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): number => {\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const server = safeGetServer(hostname, ctx);\n ctx.log(() => `returned ${numeralWrapper.formatRAM(server.ramUsed)}`);\n return server.ramUsed;\n },\n serverExists:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): boolean => {\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n return GetServer(hostname) !== null;\n },\n fileExists:\n (ctx: NetscriptContext) =>\n (_filename: unknown, _hostname: unknown = workerScript.hostname): boolean => {\n const filename = ctx.helper.string(\"filename\", _filename);\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n if (filename === undefined) {\n throw ctx.makeRuntimeErrorMsg(\"Usage: fileExists(scriptname, [server])\");\n }\n const server = safeGetServer(hostname, ctx);\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: any, hostname: any = workerScript.hostname, ...scriptArgs: any[]): boolean => {\n if (fn === undefined || hostname === undefined) {\n throw ctx.makeRuntimeErrorMsg(\"Usage: isRunning(scriptname, server, [arg1], [arg2]...)\");\n }\n if (typeof fn === \"number\") {\n return getRunningScriptByPid(fn) != null;\n } else {\n return getRunningScript(ctx, fn, hostname, scriptArgs) != null;\n }\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 = ctx.helper.number(\"ram\", _ram);\n\n const cost = getPurchaseServerCost(ram);\n if (cost === Infinity) {\n ctx.log(() => `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 = ctx.helper.string(\"name\", _name);\n const ram = ctx.helper.number(\"ram\", _ram);\n let hostnameStr = String(name);\n hostnameStr = hostnameStr.replace(/\\s+/g, \"\");\n if (hostnameStr == \"\") {\n ctx.log(() => `Invalid argument: hostname='${hostnameStr}'`);\n return \"\";\n }\n\n if (Player.purchasedServers.length >= getPurchaseServerLimit()) {\n ctx.log(\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 ctx.log(() => `Invalid argument: ram='${ram}' must not be greater than getPurchaseServerMaxRam`);\n } else {\n ctx.log(() => `Invalid argument: ram='${ram}' must be a positive power of 2`);\n }\n\n return \"\";\n }\n\n if (Player.money < cost) {\n ctx.log(() => `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 ctx.log(\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 = ctx.helper.string(\"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 ctx.log(() => `Invalid argument: hostname='${hostnameStr}'`);\n return false;\n }\n\n if (!server.purchasedByPlayer || server.hostname === \"home\") {\n ctx.log(() => \"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 ctx.log(() => \"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 === workerScript.hostname) {\n ctx.log(() => \"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 ctx.log(() => `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 ctx.log(() => `Could not identify server ${hostname} as a purchased server. This is a bug. Report to dev.`);\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 ctx.log(() => `Deleted server '${hostnameStr}`);\n return true;\n }\n }\n // Wasn't found on home computer\n ctx.log(() => `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: any = \"\"): Promise => {\n const port = ctx.helper.number(\"port\", _port);\n if (typeof data !== \"string\" && typeof data !== \"number\") {\n throw ctx.makeRuntimeErrorMsg(`Trying to write invalid data to a port: only strings and numbers are valid.`);\n }\n const iport = helper.getValidPort(\"writePort\", port);\n return Promise.resolve(iport.write(data));\n },\n write:\n (ctx: NetscriptContext) =>\n (_port: unknown, data: any = \"\", _mode: unknown = \"a\"): Promise => {\n const port = ctx.helper.string(\"port\", _port);\n const mode = ctx.helper.string(\"mode\", _mode);\n if (isString(port)) {\n // Write to script or text file\n let fn = port;\n if (!isValidFilePath(fn)) {\n throw ctx.makeRuntimeErrorMsg(`Invalid filepath: ${fn}`);\n }\n\n if (fn.lastIndexOf(\"/\") === 0) {\n fn = removeLeadingSlash(fn);\n }\n\n // Coerce 'data' to be a string\n try {\n data = String(data);\n } catch (e: any) {\n throw ctx.makeRuntimeErrorMsg(`Invalid data (${e}). Data being written must be convertible to a string`);\n }\n\n const server = workerScript.getServer();\n if (server == null) {\n throw ctx.makeRuntimeErrorMsg(\"Error getting Server. This is a bug. Report to dev.\");\n }\n if (isScriptFilename(fn)) {\n // Write to script\n let script = workerScript.getScriptOnServer(fn, server);\n if (script == null) {\n // Create a new script\n script = new Script(Player, fn, data, server.hostname, server.scripts);\n server.scripts.push(script);\n return script.updateRamUsage(Player, server.scripts);\n }\n mode === \"w\" ? (script.code = data) : (script.code += data);\n return script.updateRamUsage(Player, server.scripts);\n } else {\n // Write to text file\n const txtFile = getTextFile(fn, server);\n if (txtFile == null) {\n createTextFile(fn, data, server);\n return Promise.resolve();\n }\n if (mode === \"w\") {\n txtFile.write(data);\n } else {\n txtFile.append(data);\n }\n }\n return Promise.resolve();\n } else {\n throw ctx.makeRuntimeErrorMsg(`Invalid argument: ${port}`);\n }\n },\n tryWritePort:\n (ctx: NetscriptContext) =>\n (_port: unknown, data: any = \"\"): Promise => {\n let port = ctx.helper.number(\"port\", _port);\n if (typeof data !== \"string\" && typeof data !== \"number\") {\n throw makeRuntimeErrorMsg(\n \"tryWritePort\",\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 makeRuntimeErrorMsg(\n \"tryWritePort\",\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 ctx.makeRuntimeErrorMsg(`Could not find port: ${port}. This is a bug. Report to dev.`);\n }\n return Promise.resolve(iport.tryWrite(data));\n } else {\n throw ctx.makeRuntimeErrorMsg(`Invalid argument: ${port}`);\n }\n },\n readPort:\n (ctx: NetscriptContext) =>\n (_port: unknown): any => {\n const port = ctx.helper.number(\"port\", _port);\n // Read from port\n const iport = helper.getValidPort(\"readPort\", port);\n const x = iport.read();\n return x;\n },\n read:\n (ctx: NetscriptContext) =>\n (_port: unknown): string => {\n const port = ctx.helper.string(\"port\", _port);\n if (isString(port)) {\n // Read from script or text file\n const fn = port;\n const server = GetServer(workerScript.hostname);\n if (server == null) {\n throw ctx.makeRuntimeErrorMsg(\"Error getting Server. This is a bug. Report to dev.\");\n }\n if (isScriptFilename(fn)) {\n // Read from script\n const script = 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 } else {\n throw ctx.makeRuntimeErrorMsg(`Invalid argument: ${port}`);\n }\n },\n peek:\n (ctx: NetscriptContext) =>\n (_port: unknown): any => {\n const port = ctx.helper.number(\"port\", _port);\n const iport = helper.getValidPort(\"peek\", port);\n const x = iport.peek();\n return x;\n },\n clear:\n (ctx: NetscriptContext) =>\n (_file: unknown): void => {\n const file = ctx.helper.string(\"file\", _file);\n if (isString(file)) {\n // Clear text file\n const fn = file;\n const server = GetServer(workerScript.hostname);\n if (server == null) {\n throw ctx.makeRuntimeErrorMsg(\"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 ctx.makeRuntimeErrorMsg(`Invalid argument: ${file}`);\n }\n },\n clearPort:\n (ctx: NetscriptContext) =>\n (_port: unknown): void => {\n const port = ctx.helper.number(\"port\", _port);\n // Clear port\n const iport = helper.getValidPort(\"clearPort\", port);\n iport.clear();\n },\n getPortHandle:\n (ctx: NetscriptContext) =>\n (_port: unknown): IPort => {\n const port = ctx.helper.number(\"port\", _port);\n const iport = helper.getValidPort(\"getPortHandle\", port);\n return iport;\n },\n rm:\n (ctx: NetscriptContext) =>\n (_fn: unknown, hostname: any): boolean => {\n const fn = ctx.helper.string(\"fn\", _fn);\n\n if (hostname == null || hostname === \"\") {\n hostname = workerScript.hostname;\n }\n const s = safeGetServer(hostname, ctx);\n\n const status = s.removeFile(fn);\n if (!status.res) {\n ctx.log(() => status.msg + \"\");\n }\n\n return status.res;\n },\n scriptRunning:\n (ctx: NetscriptContext) =>\n (_scriptname: unknown, _hostname: unknown): boolean => {\n const scriptname = ctx.helper.string(\"scriptname\", _scriptname);\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const server = safeGetServer(hostname, ctx);\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 = ctx.helper.string(\"scriptname\", _scriptname);\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const server = safeGetServer(hostname, ctx);\n let suc = false;\n for (let i = 0; i < server.runningScripts.length; i++) {\n if (server.runningScripts[i].filename == scriptname) {\n killWorkerScript(server.runningScripts[i], server.hostname);\n suc = true;\n i--;\n }\n }\n return suc;\n },\n getScriptName: () => (): string => {\n return workerScript.name;\n },\n getScriptRam:\n (ctx: NetscriptContext) =>\n (_scriptname: unknown, _hostname: unknown = workerScript.hostname): number => {\n const scriptname = ctx.helper.string(\"scriptname\", _scriptname);\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const server = safeGetServer(hostname, ctx);\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: any, hostname: any, ...args: any[]): IRunningScriptDef | null => {\n let runningScript;\n if (fn === undefined && hostname === undefined && args.length === 0) {\n runningScript = workerScript.scriptRef;\n } else if (typeof fn === \"number\") {\n runningScript = getRunningScriptByPid(fn);\n } else {\n runningScript = getRunningScript(ctx, fn, hostname, args);\n }\n if (runningScript === null) return null;\n return createPublicRunningScript(runningScript);\n },\n getHackTime:\n (ctx: NetscriptContext) =>\n (_hostname: unknown = workerScript.hostname): number => {\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"invalid for this kind of server\");\n return Infinity;\n }\n if (failOnHacknetServer(server, \"getHackTime\")) {\n return Infinity;\n }\n\n return calculateHackingTime(server, Player) * 1000;\n },\n getGrowTime:\n (ctx: NetscriptContext) =>\n (_hostname: unknown = workerScript.hostname): number => {\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"invalid for this kind of server\");\n return Infinity;\n }\n if (failOnHacknetServer(server, \"getGrowTime\")) {\n return Infinity;\n }\n\n return calculateGrowTime(server, Player) * 1000;\n },\n getWeakenTime:\n (ctx: NetscriptContext) =>\n (_hostname: unknown = workerScript.hostname): number => {\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"invalid for this kind of server\");\n return Infinity;\n }\n if (failOnHacknetServer(server, \"getWeakenTime\")) {\n return Infinity;\n }\n\n return calculateWeakenTime(server, Player) * 1000;\n },\n getScriptIncome:\n (ctx: NetscriptContext) =>\n (scriptname?: any, hostname?: any, ...args: any[]): any => {\n if (scriptname === undefined) {\n const res = [];\n\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 res.push(total);\n\n // Second element is total income you've earned from scripts since you installed Augs\n res.push(Player.scriptProdSinceLastAug / (Player.playtimeSinceLastAug / 1000));\n return res;\n } else {\n // Get income for a particular script\n const server = safeGetServer(hostname, ctx);\n const runningScriptObj = findRunningScript(scriptname, args, server);\n if (runningScriptObj == null) {\n ctx.log(() => `No such script '${scriptname}' on '${server.hostname}' with args: ${arrayToString(args)}`);\n return -1;\n }\n return runningScriptObj.onlineMoneyMade / runningScriptObj.onlineRunningTime;\n }\n },\n getScriptExpGain:\n (ctx: NetscriptContext) =>\n (scriptname?: any, hostname?: any, ...args: any[]): number => {\n if (scriptname === undefined) {\n let total = 0;\n for (const ws of workerScripts.values()) {\n total += ws.scriptRef.onlineExpGained / ws.scriptRef.onlineRunningTime;\n }\n return total;\n } else {\n // Get income for a particular script\n const server = safeGetServer(hostname, ctx);\n const runningScriptObj = findRunningScript(scriptname, args, server);\n if (runningScriptObj == null) {\n ctx.log(() => `No such script '${scriptname}' on '${server.hostname}' with args: ${arrayToString(args)}`);\n return -1;\n }\n return runningScriptObj.onlineExpGained / runningScriptObj.onlineRunningTime;\n }\n },\n nFormat:\n (ctx: NetscriptContext) =>\n (_n: unknown, _format: unknown): string => {\n const n = ctx.helper.number(\"n\", _n);\n const format = ctx.helper.string(\"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 = ctx.helper.number(\"milliseconds\", _milliseconds);\n const milliPrecision = helper.boolean(_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 = ctx.helper.string(\"message\", _message);\n dialogBoxCreate(message);\n },\n toast:\n (ctx: NetscriptContext) =>\n (_message: unknown, _variant: unknown = ToastVariant.SUCCESS, duration: any = 2000): void => {\n const message = ctx.helper.string(\"message\", _message);\n const variant = ctx.helper.string(\"variant\", _variant);\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 = ctx.helper.string(\"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 = workerScript.hostname): Promise => {\n const url = ctx.helper.string(\"url\", _url);\n const target = ctx.helper.string(\"target\", _target);\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n if (!isScriptFilename(target) && !target.endsWith(\".txt\")) {\n ctx.log(() => `Invalid target file: '${target}'. Must be a script or text file.`);\n return Promise.resolve(false);\n }\n const s = safeGetServer(hostname, ctx);\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 ctx.log(() => \"Failed.\");\n return resolve(false);\n }\n if (res.overwritten) {\n ctx.log(() => `Successfully retrieved content and overwrote '${target}' on '${hostname}'`);\n return resolve(true);\n }\n ctx.log(() => `Successfully retrieved content to new file '${target}' on '${hostname}'`);\n return resolve(true);\n },\n \"text\",\n ).fail(function (e) {\n ctx.log(() => JSON.stringify(e));\n return resolve(false);\n });\n });\n },\n getFavorToDonate: () => (): number => {\n return Math.floor(CONSTANTS.BaseFavorToDonate * BitNodeMultipliers.RepToDonateToFaction);\n },\n getOwnedSourceFiles: () => (): SourceFileLvl[] => {\n const res: SourceFileLvl[] = [];\n for (let i = 0; i < Player.sourceFiles.length; ++i) {\n res.push({\n n: Player.sourceFiles[i].n,\n lvl: Player.sourceFiles[i].lvl,\n });\n }\n return res;\n },\n getPlayer: () => (): INetscriptPlayer => {\n const data = {\n hacking: Player.hacking,\n hp: Player.hp,\n max_hp: Player.max_hp,\n strength: Player.strength,\n defense: Player.defense,\n dexterity: Player.dexterity,\n agility: Player.agility,\n charisma: Player.charisma,\n intelligence: Player.intelligence,\n hacking_chance_mult: Player.hacking_chance_mult,\n hacking_speed_mult: Player.hacking_speed_mult,\n hacking_money_mult: Player.hacking_money_mult,\n hacking_grow_mult: Player.hacking_grow_mult,\n hacking_exp: Player.hacking_exp,\n strength_exp: Player.strength_exp,\n defense_exp: Player.defense_exp,\n dexterity_exp: Player.dexterity_exp,\n agility_exp: Player.agility_exp,\n charisma_exp: Player.charisma_exp,\n hacking_mult: Player.hacking_mult,\n strength_mult: Player.strength_mult,\n defense_mult: Player.defense_mult,\n dexterity_mult: Player.dexterity_mult,\n agility_mult: Player.agility_mult,\n charisma_mult: Player.charisma_mult,\n hacking_exp_mult: Player.hacking_exp_mult,\n strength_exp_mult: Player.strength_exp_mult,\n defense_exp_mult: Player.defense_exp_mult,\n dexterity_exp_mult: Player.dexterity_exp_mult,\n agility_exp_mult: Player.agility_exp_mult,\n charisma_exp_mult: Player.charisma_exp_mult,\n company_rep_mult: Player.company_rep_mult,\n faction_rep_mult: Player.faction_rep_mult,\n numPeopleKilled: Player.numPeopleKilled,\n money: Player.money,\n city: Player.city,\n location: Player.location,\n companyName: Player.companyName,\n crime_money_mult: Player.crime_money_mult,\n crime_success_mult: Player.crime_success_mult,\n isWorking: Player.isWorking,\n workType: Player.workType,\n currentWorkFactionName: Player.currentWorkFactionName,\n currentWorkFactionDescription: Player.currentWorkFactionDescription,\n workHackExpGainRate: Player.workHackExpGainRate,\n workStrExpGainRate: Player.workStrExpGainRate,\n workDefExpGainRate: Player.workDefExpGainRate,\n workDexExpGainRate: Player.workDexExpGainRate,\n workAgiExpGainRate: Player.workAgiExpGainRate,\n workChaExpGainRate: Player.workChaExpGainRate,\n workRepGainRate: Player.workRepGainRate,\n workMoneyGainRate: Player.workMoneyGainRate,\n workMoneyLossRate: Player.workMoneyLossRate,\n workHackExpGained: Player.workHackExpGained,\n workStrExpGained: Player.workStrExpGained,\n workDefExpGained: Player.workDefExpGained,\n workDexExpGained: Player.workDexExpGained,\n workAgiExpGained: Player.workAgiExpGained,\n workChaExpGained: Player.workChaExpGained,\n workRepGained: Player.workRepGained,\n workMoneyGained: Player.workMoneyGained,\n createProgramName: Player.createProgramName,\n createProgramReqLvl: Player.createProgramReqLvl,\n className: Player.className,\n crimeType: Player.crimeType,\n work_money_mult: Player.work_money_mult,\n hacknet_node_money_mult: Player.hacknet_node_money_mult,\n hacknet_node_purchase_cost_mult: Player.hacknet_node_purchase_cost_mult,\n hacknet_node_ram_cost_mult: Player.hacknet_node_ram_cost_mult,\n hacknet_node_core_cost_mult: Player.hacknet_node_core_cost_mult,\n hacknet_node_level_cost_mult: Player.hacknet_node_level_cost_mult,\n hasWseAccount: Player.hasWseAccount,\n hasTixApiAccess: Player.hasTixApiAccess,\n has4SData: Player.has4SData,\n has4SDataTixApi: Player.has4SDataTixApi,\n bladeburner_max_stamina_mult: Player.bladeburner_max_stamina_mult,\n bladeburner_stamina_gain_mult: Player.bladeburner_stamina_gain_mult,\n bladeburner_analysis_mult: Player.bladeburner_analysis_mult,\n bladeburner_success_chance_mult: Player.bladeburner_success_chance_mult,\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: any): void => {\n if (typeof f !== \"function\") {\n throw ctx.makeRuntimeErrorMsg(\"argument should be function\");\n }\n 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 = ctx.helper.string(\"host\", _host);\n const source = ctx.helper.string(\"source\", _source);\n const destination = ctx.helper.string(\"destination\", _destination);\n\n if (!isValidFilePath(source)) throw ctx.makeRuntimeErrorMsg(`Invalid filename: '${source}'`);\n if (!isValidFilePath(destination)) throw ctx.makeRuntimeErrorMsg(`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 ctx.makeRuntimeErrorMsg(`'mv' can only be used on scripts and text files (.txt)`);\n if (source_is_txt != dest_is_txt)\n throw ctx.makeRuntimeErrorMsg(`Source and destination files must have the same type`);\n\n if (source === destination) {\n return;\n }\n\n // This will throw if the server is not found, we do not need to validate result.\n const destServer: BaseServer | null = safeGetServer(host, ctx);\n\n if (!source_is_txt && destServer.isRunning(source))\n throw ctx.makeRuntimeErrorMsg(`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 ctx.makeRuntimeErrorMsg(`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(workerScript.args),\n };\n\n // add undocumented functions\n const ns = {\n ...base,\n ...NetscriptExtra(Player),\n };\n function getFunctionNames(obj: any, 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\n const possibleLogs = Object.fromEntries([...getFunctionNames(ns, \"\")].map((a) => [a, true]));\n\n const wrappedNS = wrapAPI(helper, {}, workerScript, ns) as unknown as INS;\n return wrappedNS;\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","/**\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 } 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: any) {\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.faction_rep_mult * 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 console.log(total);\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: any) {\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(): any {\n return Generic_toJSON(\"Gang\", this);\n }\n\n /**\n * Initiatizes a Gang object from a JSON save state.\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): 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.faction_rep_mult;\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, .ns, .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, .ns, .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","import { List, ListItem, Paper, Typography } from \"@mui/material\";\nimport { uniqueId } from \"lodash\";\nimport React from \"react\";\n\ninterface IProps {\n children: React.ReactElement | (React.ReactElement | null)[];\n title: string;\n}\n\nexport const GameOptionsPage = (props: IProps): React.ReactElement => {\n return (\n \n {props.title}\n {(props.children as any)?.length > 1 ? (\n \n {(props.children as React.ReactElement[])\n .filter((c) => c)\n .map((c, i) => (\n \n {c}\n \n ))}\n \n ) : (\n props.children\n )}\n \n );\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 { calculateGrid, 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 activeGrid = calculateGrid(gift);\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\";\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: any[]): 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\";\n\nimport { IMap } from \"../../types\";\nimport { Sleeve } from \"../Sleeve/Sleeve\";\nimport { IPlayerOwnedSourceFile } from \"../../SourceFile/PlayerOwnedSourceFile\";\nimport { Exploit } from \"../../Exploits/Exploit\";\nimport { WorkerScript } from \"../../Netscript/WorkerScript\";\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 { IRouter } from \"../../ui/Router\";\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 } 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 { WorkType, ClassType, CrimeType, PlayerFactionWorkType } from \"../../utils/WorkType\";\n\nexport class PlayerObject implements IPlayer {\n // Class members\n augmentations: IPlayerOwnedAugmentation[];\n bitNodeN: number;\n city: CityName;\n companyName: string;\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 hp: number;\n jobs: IMap;\n init: () => void;\n isWorking: boolean;\n karma: number;\n numPeopleKilled: number;\n location: LocationName;\n max_hp: number;\n money: number;\n moneySourceA: MoneySourceTracker;\n moneySourceB: MoneySourceTracker;\n playtimeSinceLastAug: number;\n playtimeSinceLastBitnode: number;\n purchasedServers: any[];\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 // Stats\n hacking: number;\n strength: number;\n defense: number;\n dexterity: number;\n agility: number;\n charisma: number;\n intelligence: number;\n\n // Experience\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 // Multipliers\n hacking_chance_mult: number;\n hacking_speed_mult: number;\n hacking_money_mult: number;\n hacking_grow_mult: number;\n hacking_mult: number;\n hacking_exp_mult: number;\n strength_mult: number;\n strength_exp_mult: number;\n defense_mult: number;\n defense_exp_mult: number;\n dexterity_mult: number;\n dexterity_exp_mult: number;\n agility_mult: number;\n agility_exp_mult: number;\n charisma_mult: number;\n charisma_exp_mult: number;\n hacknet_node_money_mult: number;\n hacknet_node_purchase_cost_mult: number;\n hacknet_node_ram_cost_mult: number;\n hacknet_node_core_cost_mult: number;\n hacknet_node_level_cost_mult: number;\n company_rep_mult: number;\n faction_rep_mult: number;\n work_money_mult: number;\n crime_success_mult: number;\n crime_money_mult: number;\n bladeburner_max_stamina_mult: number;\n bladeburner_stamina_gain_mult: number;\n bladeburner_analysis_mult: number;\n bladeburner_success_chance_mult: number;\n\n createProgramReqLvl: number;\n factionWorkType: PlayerFactionWorkType;\n createProgramName: string;\n timeWorkedCreateProgram: number;\n graftAugmentationName: string;\n timeWorkedGraftAugmentation: number;\n crimeType: CrimeType;\n committingCrimeThruSingFn: boolean;\n singFnCrimeWorkerScript: WorkerScript | null;\n timeNeededToCompleteWork: number;\n focus: boolean;\n className: ClassType;\n currentWorkFactionName: string;\n workType: WorkType;\n workCostMult: number;\n workExpMult: number;\n currentWorkFactionDescription: string;\n timeWorked: number;\n workMoneyGained: number;\n workMoneyGainRate: number;\n workRepGained: number;\n workRepGainRate: number;\n workHackExpGained: number;\n workHackExpGainRate: number;\n workStrExpGained: number;\n workStrExpGainRate: number;\n workDefExpGained: number;\n workDefExpGainRate: number;\n workDexExpGained: number;\n workDexExpGainRate: number;\n workAgiExpGained: number;\n workAgiExpGainRate: number;\n workChaExpGained: number;\n workChaExpGainRate: number;\n workMoneyLossRate: number;\n\n entropy: number;\n\n // Methods\n work: (numCycles: number) => boolean;\n workPartTime: (numCycles: number) => boolean;\n workForFaction: (numCycles: number) => boolean;\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 singularityStopWork: () => string;\n startBladeburner: (p: any) => void;\n startFactionWork: (faction: Faction) => void;\n startClass: (costMult: number, expMult: number, className: ClassType) => void;\n startCorporation: (corpName: string, additionalShares?: number) => void;\n startCrime: (\n router: IRouter,\n crimeType: CrimeType,\n hackExp: number,\n strExp: number,\n defExp: number,\n dexExp: number,\n agiExp: number,\n chaExp: number,\n money: number,\n time: number,\n singParams: any,\n ) => void;\n startFactionFieldWork: (faction: Faction) => void;\n startFactionHackWork: (faction: Faction) => void;\n startFactionSecurityWork: (faction: Faction) => void;\n startFocusing: () => void;\n startGang: (facName: string, isHacking: boolean) => void;\n startWork: (companyName: string) => void;\n startWorkPartTime: (companyName: string) => 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 process: (router: IRouter, numCycles?: number) => void;\n createHacknetServer: () => HacknetServer;\n startCreateProgramWork: (programName: string, time: number, reqLevel: number) => void;\n queueAugmentation: (augmentationName: string) => void;\n receiveInvite: (factionName: string) => void;\n updateSkillLevels: () => void;\n gainCodingContractReward: (reward: ICodingContractReward, difficulty?: number) => string;\n stopFocusing: () => void;\n finishFactionWork: (cancelled: boolean, sing?: boolean) => string;\n finishClass: (sing?: boolean) => string;\n finishWork: (cancelled: boolean, sing?: boolean) => string;\n cancelationPenalty: () => number;\n finishWorkPartTime: (sing?: boolean) => string;\n finishCrime: (cancelled: boolean) => string;\n finishCreateProgramWork: (cancelled: boolean) => string;\n resetMultipliers: () => void;\n prestigeAugmentation: () => void;\n prestigeSourceFile: () => void;\n calculateSkill: (exp: number, mult?: number) => number;\n calculateSkillProgress: (exp: number, mult?: number) => ISkillProgress;\n resetWorkStatus: (generalType?: WorkType, group?: string, workType?: string) => void;\n getWorkHackExpGain: () => number;\n getWorkStrExpGain: () => number;\n getWorkDefExpGain: () => number;\n getWorkDexExpGain: () => number;\n getWorkAgiExpGain: () => number;\n getWorkChaExpGain: () => number;\n getWorkRepGain: () => number;\n getWorkMoneyGain: () => number;\n processWorkEarnings: (cycles: number) => void;\n hospitalize: () => void;\n createProgramWork: (numCycles: number) => boolean;\n takeClass: (numCycles: number) => boolean;\n commitCrime: (numCycles: number) => boolean;\n checkForFactionInvitations: () => Faction[];\n setBitNodeNumber: (n: number) => void;\n getMult: (name: string) => number;\n setMult: (name: string, mult: number) => void;\n canAccessCotMG: () => boolean;\n sourceFileLvl: (n: number) => number;\n startGraftAugmentationWork: (augmentationName: string, time: number) => void;\n graftAugmentationWork: (numCycles: number) => boolean;\n finishGraftAugmentationWork: (cancelled: boolean, singularity?: boolean) => string;\n applyEntropy: (stacks?: number) => void;\n\n constructor() {\n //Skills and stats\n this.hacking = 1;\n\n //Combat stats\n this.hp = 10;\n this.max_hp = 10;\n this.strength = 1;\n this.defense = 1;\n this.dexterity = 1;\n this.agility = 1;\n\n //Labor stats\n this.charisma = 1;\n\n //Special stats\n this.intelligence = 0;\n\n //Hacking multipliers\n this.hacking_chance_mult = 1;\n this.hacking_speed_mult = 1;\n this.hacking_money_mult = 1;\n this.hacking_grow_mult = 1;\n\n //Experience and multipliers\n this.hacking_exp = 0;\n this.strength_exp = 0;\n this.defense_exp = 0;\n this.dexterity_exp = 0;\n this.agility_exp = 0;\n this.charisma_exp = 0;\n this.intelligence_exp = 0;\n\n this.hacking_mult = 1;\n this.strength_mult = 1;\n this.defense_mult = 1;\n this.dexterity_mult = 1;\n this.agility_mult = 1;\n this.charisma_mult = 1;\n\n this.hacking_exp_mult = 1;\n this.strength_exp_mult = 1;\n this.defense_exp_mult = 1;\n this.dexterity_exp_mult = 1;\n this.agility_exp_mult = 1;\n this.charisma_exp_mult = 1;\n\n this.company_rep_mult = 1;\n this.faction_rep_mult = 1;\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 // Company at which player is CURRENTLY working (only valid when the player is actively working)\n this.companyName = \"\"; // Name of Company. Must match a key value in Companies ma;\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 this.crime_money_mult = 1;\n this.crime_success_mult = 1;\n\n //Flags/variables for working (Company, Faction, Creating Program, Taking Class)\n this.isWorking = false;\n this.focus = false;\n this.workType = WorkType.None;\n this.workCostMult = 1;\n this.workExpMult = 1;\n\n this.currentWorkFactionName = \"\";\n this.currentWorkFactionDescription = \"\";\n\n this.workHackExpGainRate = 0;\n this.workStrExpGainRate = 0;\n this.workDefExpGainRate = 0;\n this.workDexExpGainRate = 0;\n this.workAgiExpGainRate = 0;\n this.workChaExpGainRate = 0;\n this.workRepGainRate = 0;\n this.workMoneyGainRate = 0;\n this.workMoneyLossRate = 0;\n\n this.workHackExpGained = 0;\n this.workStrExpGained = 0;\n this.workDefExpGained = 0;\n this.workDexExpGained = 0;\n this.workAgiExpGained = 0;\n this.workChaExpGained = 0;\n this.workRepGained = 0;\n this.workMoneyGained = 0;\n\n this.createProgramName = \"\";\n this.createProgramReqLvl = 0;\n\n this.graftAugmentationName = \"\";\n this.timeWorkedGraftAugmentation = 0;\n\n this.className = ClassType.None;\n\n this.crimeType = CrimeType.None;\n\n this.timeWorked = 0; //in m;\n this.timeWorkedCreateProgram = 0;\n this.timeNeededToCompleteWork = 0;\n\n this.work_money_mult = 1;\n\n //Hacknet Node multipliers\n this.hacknet_node_money_mult = 1;\n this.hacknet_node_purchase_cost_mult = 1;\n this.hacknet_node_ram_cost_mult = 1;\n this.hacknet_node_core_cost_mult = 1;\n this.hacknet_node_level_cost_mult = 1;\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 this.bladeburner_max_stamina_mult = 1;\n this.bladeburner_stamina_gain_mult = 1;\n this.bladeburner_analysis_mult = 1; //Field Analysis Only\n this.bladeburner_success_chance_mult = 1;\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 // 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.resetWorkStatus = generalMethods.resetWorkStatus;\n this.processWorkEarnings = generalMethods.processWorkEarnings;\n this.startWork = generalMethods.startWork;\n this.cancelationPenalty = generalMethods.cancelationPenalty;\n this.work = generalMethods.work;\n this.finishWork = generalMethods.finishWork;\n this.startWorkPartTime = generalMethods.startWorkPartTime;\n this.workPartTime = generalMethods.workPartTime;\n this.finishWorkPartTime = generalMethods.finishWorkPartTime;\n this.startFocusing = generalMethods.startFocusing;\n this.stopFocusing = generalMethods.stopFocusing;\n this.startFactionWork = generalMethods.startFactionWork;\n this.startFactionHackWork = generalMethods.startFactionHackWork;\n this.startFactionFieldWork = generalMethods.startFactionFieldWork;\n this.startFactionSecurityWork = generalMethods.startFactionSecurityWork;\n this.workForFaction = generalMethods.workForFaction;\n this.finishFactionWork = generalMethods.finishFactionWork;\n this.getWorkMoneyGain = generalMethods.getWorkMoneyGain;\n this.getWorkHackExpGain = generalMethods.getWorkHackExpGain;\n this.getWorkStrExpGain = generalMethods.getWorkStrExpGain;\n this.getWorkDefExpGain = generalMethods.getWorkDefExpGain;\n this.getWorkDexExpGain = generalMethods.getWorkDexExpGain;\n this.getWorkAgiExpGain = generalMethods.getWorkAgiExpGain;\n this.getWorkChaExpGain = generalMethods.getWorkChaExpGain;\n this.getWorkRepGain = generalMethods.getWorkRepGain;\n this.process = generalMethods.process;\n this.startCreateProgramWork = generalMethods.startCreateProgramWork;\n this.createProgramWork = generalMethods.createProgramWork;\n this.finishCreateProgramWork = generalMethods.finishCreateProgramWork;\n this.startGraftAugmentationWork = generalMethods.startGraftAugmentationWork;\n this.graftAugmentationWork = generalMethods.craftAugmentationWork;\n this.finishGraftAugmentationWork = generalMethods.finishGraftAugmentationWork;\n this.startClass = generalMethods.startClass;\n this.takeClass = generalMethods.takeClass;\n this.finishClass = generalMethods.finishClass;\n this.startCrime = generalMethods.startCrime;\n this.commitCrime = generalMethods.commitCrime;\n this.finishCrime = generalMethods.finishCrime;\n this.singularityStopWork = generalMethods.singularityStopWork;\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 this.factionWorkType = PlayerFactionWorkType.None;\n this.committingCrimeThruSingFn = false;\n this.singFnCrimeWorkerScript = null;\n\n this.getMult = generalMethods.getMult;\n this.setMult = generalMethods.setMult;\n\n this.canAccessCotMG = generalMethods.canAccessCotMG;\n this.sourceFileLvl = generalMethods.sourceFileLvl;\n\n this.applyEntropy = augmentationMethods.applyEntropy;\n }\n\n whoAmI(): string {\n return \"Player\";\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): any {\n return Generic_toJSON(\"PlayerObject\", this);\n }\n\n /**\n * Initiatizes a PlayerObject object from a JSON save state.\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): 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 { 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.hacking_grow_mult * coreBonus);\n}\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 { 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\";\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 const validMults = [\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 ];\n for (const mult of Object.keys(aug.mults)) {\n if (validMults.includes(mult)) {\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 { 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: any) => 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 (error: any) {\n return terminal.error(error.message);\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","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 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","/**\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, useMemo } 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({} 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\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 }\n}\n\nlet 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 openScripts = openScripts.filter((script) => {\n return GetServer(script.hostname) !== null;\n });\n if (currentScript && GetServer(currentScript.hostname) === null) {\n currentScript = openScripts[0];\n if (currentScript === undefined) currentScript = null;\n }\n\n const [dimensions, setDimensions] = useState({\n height: window.innerHeight,\n width: window.innerWidth,\n });\n useEffect(() => {\n const debouncedHandleResize = debounce(function handleResize() {\n setDimensions({\n height: window.innerHeight,\n width: window.innerWidth,\n });\n }, 250);\n\n window.addEventListener(\"resize\", debouncedHandleResize);\n\n return () => {\n window.removeEventListener(\"resize\", debouncedHandleResize);\n };\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 // \"wqriteandquit\" is not a typo, prefix must be found in full string\n MonacoVim.VimMode.Vim.defineEx(\"wqriteandquit\", \"wq\", function () {\n save();\n props.router.toTerminal();\n });\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(\n script.code,\n script.fileName.endsWith(\".txt\") ? \"plaintext\" : \"javascript\",\n );\n }\n }\n\n const debouncedSetRAM = useMemo(\n () =>\n debounce((s, e) => {\n setRAM(s);\n setRamEntries(e);\n setUpdatingRam(false);\n }, 300),\n [],\n );\n\n async function updateRAM(newCode: string): Promise {\n if (currentScript != null && currentScript.fileName.endsWith(\".txt\")) {\n debouncedSetRAM(\"N/A\", [[\"N/A\", \"\"]]);\n return;\n }\n setUpdatingRam(true);\n const codeCopy = newCode + \"\";\n const ramUsage = await 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 debouncedSetRAM(\"RAM: \" + numeralWrapper.formatRAM(ramUsage.cost), entriesDisp);\n return;\n }\n switch (ramUsage.cost) {\n case RamCalculationErrorCode.ImportError: {\n debouncedSetRAM(\"RAM: Import Error\", [[\"Import Error\", \"\"]]);\n break;\n }\n case RamCalculationErrorCode.URLImportError: {\n debouncedSetRAM(\"RAM: HTTP Import Error\", [[\"HTTP Import Error\", \"\"]]);\n break;\n }\n case RamCalculationErrorCode.SyntaxError:\n default: {\n debouncedSetRAM(\"RAM: Syntax Error\", [[\"Syntax Error\", \"\"]]);\n break;\n }\n }\n return new Promise(() => undefined);\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(\".ns\") && !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 updateRAM(newCode);\n if (editorRef.current === null) return;\n const newPos = editorRef.current.getPosition();\n if (newPos === null) return;\n if (currentScript !== null) {\n currentScript = { ...currentScript, code: newCode, lastPosition: newPos };\n const curIndex = openScripts.findIndex(\n (script) =>\n currentScript !== null &&\n script.fileName === currentScript.fileName &&\n script.hostname === currentScript.hostname,\n );\n const newArr = [...openScripts];\n const tempScript = currentScript;\n tempScript.code = newCode;\n newArr[curIndex] = tempScript;\n openScripts = [...newArr];\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.fileName.endsWith(\".txt\")) {\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, .js, or .ns) 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 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.fileName.endsWith(\".txt\")) {\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 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, .js, or .ns) or a text file (.txt)\");\n return;\n }\n\n if (Settings.SaveGameOnFileSave) saveObject.saveGame();\n }\n\n function reorder(list: Array, startIndex: number, endIndex: number): OpenScript[] {\n const result = Array.from(list);\n const [removed] = result.splice(startIndex, 1);\n result.splice(endIndex, 0, removed);\n\n return result;\n }\n\n function onDragEnd(result: any): void {\n // Dropped outside of the list\n if (!result.destination) {\n result;\n return;\n }\n\n const items = reorder(openScripts, result.source.index, result.destination.index);\n\n openScripts = items;\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 (openScripts[index].model === undefined || openScripts[index].model.isDisposed()) {\n regenerateModel(openScripts[index]);\n }\n editorRef.current.setModel(openScripts[index].model);\n\n editorRef.current.setPosition(openScripts[index].lastPosition);\n editorRef.current.revealLineInCenter(openScripts[index].lastPosition.lineNumber);\n updateRAM(openScripts[index].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 savedScriptIndex = openScripts.findIndex(\n (script) => script.fileName === closingScript.fileName && script.hostname === closingScript.hostname,\n );\n let savedScriptCode = \"\";\n if (savedScriptIndex !== -1) {\n savedScriptCode = openScripts[savedScriptIndex].code;\n }\n const server = GetServer(closingScript.hostname);\n if (server === null) throw new Error(`Server '${closingScript.hostname}' should not be null, but it is.`);\n\n const serverScriptIndex = server.scripts.findIndex((script) => script.filename === closingScript.fileName);\n if (serverScriptIndex === -1 || savedScriptCode !== server.scripts[serverScriptIndex ].code) {\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 if (openScripts.length > 1) {\n openScripts = openScripts.filter((value, i) => i !== index);\n\n let indexOffset = -1;\n if (openScripts[index + indexOffset] === undefined) {\n indexOffset = 1;\n if (openScripts[index + indexOffset] === undefined) {\n indexOffset = 0;\n }\n }\n\n // Change current script if we closed it\n currentScript = openScripts[index + indexOffset];\n if (editorRef.current !== null) {\n if (\n openScripts[index + indexOffset].model === undefined ||\n openScripts[index + indexOffset].model === null ||\n openScripts[index + indexOffset].model.isDisposed()\n ) {\n regenerateModel(openScripts[index + indexOffset]);\n }\n\n editorRef.current.setModel(openScripts[index + indexOffset].model);\n editorRef.current.setPosition(openScripts[index + indexOffset].lastPosition);\n editorRef.current.revealLineInCenter(openScripts[index + indexOffset].lastPosition.lineNumber);\n editorRef.current.focus();\n }\n rerender();\n } else {\n // No more scripts are open\n openScripts = [];\n currentScript = null;\n props.router.toTerminal();\n }\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 serverScriptCode = getServerCode(index);\n if (serverScriptCode === null) return \" *\";\n\n // The server code is stored with its starting & trailing whitespace removed\n const openScriptFormatted = Script.formatCode(openScript.code);\n return serverScriptCode !== openScriptFormatted ? \" *\" : \"\";\n }\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\n const serverScript = server.scripts.find((s) => s.filename === openScript.fileName);\n return serverScript?.code ?? 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 // Toolbars are roughly 112px:\n // 8px body margin top\n // 38.5px filename tabs\n // 5px padding for top of editor\n // 44px bottom tool bar + 16px margin\n // + vim bar 34px\n const editorHeight = dimensions.height - (130 + (options.vim ? 34 : 0));\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={`${editorHeight}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 { makeRuntimeRejectMsg } from \"./NetscriptEvaluator\";\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\";\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 if (!shouldCompile(script, scripts)) return;\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 await 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) {\n URL.revokeObjectURL(script.url);\n // Thoughts: Should we be revoking any URLs here?\n // If a script is modified repeatedly between two states,\n // we could reuse the blob at a later time.\n // BlobCache.removeByValue(script.url);\n // URL.revokeObjectURL(script.url);\n // if (script.dependencies.length > 0) {\n // script.dependencies.forEach((dep) => {\n // removeBlobFromCache(dep.url);\n // URL.revokeObjectURL(dep.url);\n // });\n // }\n }\n if (script.dependencies.length > 0) script.dependencies.forEach((dep) => URL.revokeObjectURL(dep.url));\n script.url = uurls[uurls.length - 1].url;\n script.module = new Promise((resolve) => resolve(eval(\"import(uurls[uurls.length - 1].url)\")));\n script.dependencies = uurls;\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 await compile(player, script, scripts);\n workerScript.ramUsage = script.ramUsage;\n const loadedModule = await script.module;\n\n const ns = workerScript.env.vars;\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 makeRuntimeRejectMsg(\n workerScript,\n `${script.filename} cannot be run because it does not have a main function.`,\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 return script.dependencies.some((dep) => isDependencyOutOfDate(dep.filename, scripts, script.moduleSequenceNumber));\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: any = parse(script.code, { sourceType: \"module\", ecmaVersion: \"latest\", ranges: true });\n\n const importNodes: Array = [];\n // Walk the nodes of this tree and find any import declaration statements.\n walk.simple(ast, {\n ImportDeclaration(node: any) {\n // Push this import onto the stack to replace\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: any) {\n if (node.source) {\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 ExportAllDeclaration(node: any) {\n if (node.source) {\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 });\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 * as libarg from \"arg\";\n\nexport function Flags(vargs: string[]): any {\n return () =>\n (data: any): any => {\n data = toNative(data);\n // We always want the help flag.\n const args: {\n [key: string]: any;\n } = {};\n\n for (const d of data) {\n let t: any = 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 = libarg(args, { argv: vargs });\n for (const d of data) {\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 { Interpreter } from \"../ThirdParty/JSInterpreter\";\n\nconst defaultInterpreter = new Interpreter(\"\", () => undefined);\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.\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function toNative(pseudoObj: any): any {\n if (pseudoObj == null) return null;\n if (\n !pseudoObj.hasOwnProperty(\"properties\") ||\n !pseudoObj.hasOwnProperty(\"getter\") ||\n !pseudoObj.hasOwnProperty(\"setter\") ||\n !pseudoObj.hasOwnProperty(\"proto\")\n ) {\n return pseudoObj; // it wasn't a pseudo object anyway.\n }\n\n let nativeObj: any;\n if (pseudoObj.hasOwnProperty(\"class\") && pseudoObj.class === \"Array\") {\n nativeObj = [];\n const length = defaultInterpreter.getProperty(pseudoObj, \"length\");\n for (let i = 0; i < length; i++) {\n if (defaultInterpreter.hasProperty(pseudoObj, i)) {\n nativeObj[i] = toNative(defaultInterpreter.getProperty(pseudoObj, i));\n }\n }\n } else {\n // Object.\n nativeObj = {};\n for (const key of Object.keys(pseudoObj.properties)) {\n const val = pseudoObj.properties[key];\n nativeObj[key] = toNative(val);\n }\n }\n return nativeObj;\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, _value]) => 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 { IStaneksGift } from \"../IStaneksGift\";\nimport { Cell } from \"./Cell\";\n\ninterface IProps {\n width: number;\n height: number;\n activeGrid: 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 function color(worldX: number, worldY: number): string {\n if (props.ghostGrid[worldX][worldY] && props.activeGrid[worldX][worldY]) return \"red\";\n if (props.ghostGrid[worldX][worldY]) return \"white\";\n\n if (props.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(\".ns\") || 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, .ns, .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","// by Discord: H3draut3r#6722, feel free to ask me any questions. i probably don't know the answer 🤣\nexport function HammingEncode(value: number): string {\n // encoding following Hammings rule\n function HammingSumOfParity(_lengthOfDBits: number): number {\n // will calculate the needed amount of parityBits 'without' the \"overall\"-Parity (that math took me 4 Days to get it working)\n return _lengthOfDBits < 3 || _lengthOfDBits == 0 // oh and of course using ternary operators, it's a pretty neat function\n ? _lengthOfDBits == 0\n ? 0\n : _lengthOfDBits + 1\n : // the following math will only work, if the length is greater equal 3, otherwise it's \"kind of\" broken :D\n Math.ceil(Math.log2(_lengthOfDBits * 2)) <=\n Math.ceil(Math.log2(1 + _lengthOfDBits + Math.ceil(Math.log2(_lengthOfDBits))))\n ? Math.ceil(Math.log2(_lengthOfDBits) + 1)\n : Math.ceil(Math.log2(_lengthOfDBits));\n }\n const _data = value.toString(2).split(\"\"); // first, change into binary string, then create array with 1 bit per index\n const _sumParity: number = HammingSumOfParity(_data.length); // get the sum of needed parity bits (for later use in encoding)\n const count = (arr: Array, val: string): number =>\n arr.reduce((a: number, v: string) => (v === val ? a + 1 : a), 0);\n // function count for specific entries in the array, for later use\n\n const _build = [\"x\", \"x\", ..._data.splice(0, 1)]; // init the \"pre-build\"\n for (let i = 2; i < _sumParity; i++) {\n // add new paritybits and the corresponding data bits (pre-building array)\n _build.push(\"x\", ..._data.splice(0, Math.pow(2, i) - 1));\n }\n // now the \"calculation\"... get the paritybits ('x') working\n for (const index of _build.reduce(function (a: Array, e: string, i: number) {\n if (e == \"x\") a.push(i);\n return a;\n }, [])) {\n // that reduce will result in an array of index numbers where the \"x\" is placed\n const _tempcount = index + 1; // set the \"stepsize\" for the parityBit\n const _temparray = []; // temporary array to store the extracted bits\n const _tempdata = [..._build]; // only work with a copy of the _build\n while (_tempdata[index] !== undefined) {\n // as long as there are bits on the starting index, do \"cut\"\n const _temp: Array = _tempdata.splice(index, _tempcount * 2); // cut stepsize*2 bits, then...\n _temparray.push(..._temp.splice(0, _tempcount)); // ... cut the result again and keep the first half\n }\n _temparray.splice(0, 1); // remove first bit, which is the parity one\n _build[index] = (count(_temparray, \"1\") % 2).toString(); // count with remainder of 2 and\"toString\" to store the parityBit\n } // parity done, now the \"overall\"-parity is set\n _build.unshift((count(_build, \"1\") % 2).toString()); // has to be done as last element\n return _build.join(\"\"); // return the _build as string\n}\n\nexport function HammingDecode(_data: string): number {\n //check for altered bit and decode\n const _build = _data.split(\"\"); // ye, an array for working, again\n const _testArray = []; //for the \"truthtable\". if any is false, the data has an altered bit, will check for and fix it\n const _sumParity = Math.ceil(Math.log2(_data.length)); // sum of parity for later use\n const count = (arr: Array, val: string): number =>\n arr.reduce((a: number, v: string) => (v === val ? a + 1 : a), 0);\n // the count.... again ;)\n\n let _overallParity = _build.splice(0, 1).join(\"\"); // store first index, for checking in next step and fix the _build properly later on\n _testArray.push(_overallParity == (count(_build, \"1\") % 2).toString() ? true : false); // first check with the overall parity bit\n for (let i = 0; i < _sumParity; i++) {\n // for the rest of the remaining parity bits we also \"check\"\n const _tempIndex = Math.pow(2, i) - 1; // get the parityBits Index\n const _tempStep = _tempIndex + 1; // set the stepsize\n const _tempData = [..._build]; // get a \"copy\" of the build-data for working\n const _tempArray = []; // init empty array for \"testing\"\n while (_tempData[_tempIndex] != undefined) {\n // extract from the copied data until the \"starting\" index is undefined\n const _temp = [..._tempData.splice(_tempIndex, _tempStep * 2)]; // extract 2*stepsize\n _tempArray.push(..._temp.splice(0, _tempStep)); // and cut again for keeping first half\n }\n const _tempParity = _tempArray.shift(); // and again save the first index separated for checking with the rest of the data\n _testArray.push(_tempParity == (count(_tempArray, \"1\") % 2).toString() ? true : false);\n // is the _tempParity the calculated data? push answer into the 'truthtable'\n }\n let _fixIndex = 0; // init the \"fixing\" index and start with 0\n for (let i = 1; i < _sumParity + 1; i++) {\n // simple binary adding for every boolean in the _testArray, starting from 2nd index of it\n _fixIndex += _testArray[i] ? 0 : Math.pow(2, i) / 2;\n }\n _build.unshift(_overallParity); // now we need the \"overall\" parity back in it's place\n // try fix the actual encoded binary string if there is an error\n if (_fixIndex > 0 && _testArray[0] == false) {\n // if the overall is false and the sum of calculated values is greater equal 0, fix the corresponding hamming-bit\n _build[_fixIndex] = _build[_fixIndex] == \"0\" ? \"1\" : \"0\";\n } else if (_testArray[0] == false) {\n // otherwise, if the the overall_parity is the only wrong, fix that one\n _overallParity = _overallParity == \"0\" ? \"1\" : \"0\";\n } else if (_testArray[0] == true && _testArray.some((truth) => truth == false)) {\n return 0; // uhm, there's some strange going on... 2 bits are altered? How? This should not happen 👀\n }\n // oof.. halfway through... we fixed an possible altered bit, now \"extract\" the parity-bits from the _build\n for (let i = _sumParity; i >= 0; i--) {\n // start from the last parity down the 2nd index one\n _build.splice(Math.pow(2, i), 1);\n }\n _build.splice(0, 1); // remove the overall parity bit and we have our binary value\n return parseInt(_build.join(\"\"), 2); // parse the integer with redux 2 and we're done!\n}\n","import { IBladeburner } from \"./IBladeburner\";\nimport { Action, IActionParams } from \"./Action\";\nimport { Generic_fromJSON, Generic_toJSON, 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(): any {\n return Generic_toJSON(\"Contract\", this);\n }\n\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): 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\nimport { numeralWrapper } from \"../ui/numeralFormat\";\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 // Return an object that describes a TreantJS-compatible markup/config for this Node\n // See: http://fperucic.github.io/treant-js/\n createTreantMarkup(): any {\n const childrenArray = [];\n for (let i = 0; i < this.children.length; ++i) {\n childrenArray.push(this.children[i].createTreantMarkup());\n }\n\n // Determine what css class this Node should have in the diagram\n let htmlClass = \"tooltip\";\n if (this.researched) {\n htmlClass += \" researched\";\n } else if (this.parent && this.parent.researched === false) {\n htmlClass += \" locked\";\n } else {\n htmlClass += \" unlocked\";\n }\n\n const research: Research | null = ResearchMap[this.text];\n const sanitizedName: string = this.text.replace(/\\s/g, \"\");\n return {\n children: childrenArray,\n HTMLclass: htmlClass,\n innerHTML:\n `
` +\n `${this.text}
${numeralWrapper.format(this.cost, \"0,0\")} Scientific Research` +\n `` +\n `${research.desc}` +\n `` +\n `
`,\n text: { name: this.text },\n };\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 // Return an object that contains a Tree markup for TreantJS (using the JSON approach)\n // See: http://fperucic.github.io/treant-js/\n createTreantMarkup(): any {\n if (this.root == null) {\n return {};\n }\n\n const treeMarkup = this.root.createTreantMarkup();\n\n return {\n chart: {\n container: \"\",\n },\n nodeStructure: treeMarkup,\n };\n }\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: any = (research as any)[propName];\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","// 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","/**\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\";\nimport { Sleeve } from \"./PersonObjects/Sleeve/Sleeve\";\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\nimport { WorkType } from \"./utils/WorkType\";\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.process(Router, 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 if (Player.sleeves[i] instanceof Sleeve) {\n const expForOtherSleeves = Player.sleeves[i].process(Player, numCycles);\n\n // This sleeve earns experience for other sleeves\n if (expForOtherSleeves == null) {\n continue;\n }\n for (let j = 0; j < Player.sleeves.length; ++j) {\n if (j === i) {\n continue;\n }\n Player.sleeves[j].gainExperience(Player, expForOtherSleeves, numCycles, true);\n }\n }\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 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 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 let offlineReputation = 0;\n const offlineHackingIncome = (Player.moneySourceA.hacking / Player.playtimeSinceLastAug) * timeOffline * 0.75;\n Player.gainMoney(offlineHackingIncome, \"hacking\");\n // Process offline progress\n loadAllRunningScripts(Player); // This also takes care of offline production for those scripts\n if (Player.isWorking) {\n Player.focus = true;\n switch (Player.workType) {\n case WorkType.Faction:\n Player.workForFaction(numCyclesOffline);\n break;\n case WorkType.CreateProgram:\n Player.createProgramWork(numCyclesOffline);\n break;\n case WorkType.StudyClass:\n Player.takeClass(numCyclesOffline);\n break;\n case WorkType.Crime:\n Player.commitCrime(numCyclesOffline);\n break;\n case WorkType.CompanyPartTime:\n Player.workPartTime(numCyclesOffline);\n break;\n case WorkType.GraftAugmentation:\n Player.graftAugmentationWork(numCyclesOffline);\n break;\n default:\n Player.work(numCyclesOffline);\n }\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);\n const sRep = getFactionSecurityWorkRepGain(Player, faction);\n const fRep = getFactionFieldWorkRepGain(Player, faction);\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 if (Player.sleeves[i] instanceof Sleeve) {\n const expForOtherSleeves = Player.sleeves[i].process(Player, numCyclesOffline);\n\n // This sleeve earns experience for other sleeves\n if (expForOtherSleeves == null) {\n continue;\n }\n for (let j = 0; j < Player.sleeves.length; ++j) {\n if (j === i) {\n continue;\n }\n Player.sleeves[j].gainExperience(Player, expForOtherSleeves, numCyclesOffline, true);\n }\n }\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\";\nimport Box from \"@mui/material/Box\";\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\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\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n backgroundColor: theme.colors.backgroundprimary,\n },\n }),\n);\n\nexport function LoadingScreen(): React.ReactElement {\n const classes = useStyles();\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: any) {\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 (\n \n {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}\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 const newMultipliers = calculateEntropy(this, stacks);\n for (const [mult, val] of Object.entries(newMultipliers)) {\n this.setMult(mult, val);\n }\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, 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(): any {\n return Generic_toJSON(\"Order\", this);\n }\n\n /**\n * Initializes a Order from a JSON save state\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): 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, 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.faction_rep_mult * (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.hacking_chance_mult *= power;\n break;\n case FragmentType.HackingSpeed:\n p.hacking_speed_mult *= power;\n break;\n case FragmentType.HackingMoney:\n p.hacking_money_mult *= power;\n break;\n case FragmentType.HackingGrow:\n p.hacking_grow_mult *= power;\n break;\n case FragmentType.Hacking:\n p.hacking_mult *= power;\n p.hacking_exp_mult *= power;\n break;\n case FragmentType.Strength:\n p.strength_mult *= power;\n p.strength_exp_mult *= power;\n break;\n case FragmentType.Defense:\n p.defense_mult *= power;\n p.defense_exp_mult *= power;\n break;\n case FragmentType.Dexterity:\n p.dexterity_mult *= power;\n p.dexterity_exp_mult *= power;\n break;\n case FragmentType.Agility:\n p.agility_mult *= power;\n p.agility_exp_mult *= power;\n break;\n case FragmentType.Charisma:\n p.charisma_mult *= power;\n p.charisma_exp_mult *= power;\n break;\n case FragmentType.HacknetMoney:\n p.hacknet_node_money_mult *= power;\n break;\n case FragmentType.HacknetCost:\n p.hacknet_node_purchase_cost_mult /= power;\n p.hacknet_node_ram_cost_mult /= power;\n p.hacknet_node_core_cost_mult /= power;\n p.hacknet_node_level_cost_mult /= power;\n break;\n case FragmentType.Rep:\n p.company_rep_mult *= power;\n p.faction_rep_mult *= power;\n break;\n case FragmentType.WorkMoney:\n p.work_money_mult *= power;\n break;\n case FragmentType.Crime:\n p.crime_success_mult *= power;\n p.crime_money_mult *= power;\n break;\n case FragmentType.Bladeburner:\n p.bladeburner_max_stamina_mult *= power;\n p.bladeburner_stamina_gain_mult *= power;\n p.bladeburner_analysis_mult *= power;\n p.bladeburner_success_chance_mult *= 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(): any {\n return Generic_toJSON(\"StaneksGift\", this);\n }\n\n /**\n * Initializes Staneks Gift from a JSON save state\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): 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 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 { SleeveTaskType } from \"../SleeveTaskTypesEnum\";\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: any[][] = [];\n if (props.sleeve.currentTask === SleeveTaskType.Crime) {\n data = [\n [\n `Money`,\n <>\n (on success)\n ,\n ],\n [`Hacking Exp`, `${numeralWrapper.formatExp(props.sleeve.gainRatesForTask.hack)} (2x on success)`],\n [`Strength Exp`, `${numeralWrapper.formatExp(props.sleeve.gainRatesForTask.str)} (2x on success)`],\n [`Defense Exp`, `${numeralWrapper.formatExp(props.sleeve.gainRatesForTask.def)} (2x on success)`],\n [`Dexterity Exp`, `${numeralWrapper.formatExp(props.sleeve.gainRatesForTask.dex)} (2x on success)`],\n [`Agility Exp`, `${numeralWrapper.formatExp(props.sleeve.gainRatesForTask.agi)} (2x on success)`],\n [`Charisma Exp`, `${numeralWrapper.formatExp(props.sleeve.gainRatesForTask.cha)} (2x on success)`],\n ];\n } else {\n data = [\n [`Money:`, ],\n [`Hacking Exp:`, `${numeralWrapper.formatExp(5 * props.sleeve.gainRatesForTask.hack)} / sec`],\n [`Strength Exp:`, `${numeralWrapper.formatExp(5 * props.sleeve.gainRatesForTask.str)} / sec`],\n [`Defense Exp:`, `${numeralWrapper.formatExp(5 * props.sleeve.gainRatesForTask.def)} / sec`],\n [`Dexterity Exp:`, `${numeralWrapper.formatExp(5 * props.sleeve.gainRatesForTask.dex)} / sec`],\n [`Agility Exp:`, `${numeralWrapper.formatExp(5 * props.sleeve.gainRatesForTask.agi)} / sec`],\n [`Charisma Exp:`, `${numeralWrapper.formatExp(5 * props.sleeve.gainRatesForTask.cha)} / sec`],\n ];\n if (props.sleeve.currentTask === SleeveTaskType.Company || props.sleeve.currentTask === SleeveTaskType.Faction) {\n const repGain: number = props.sleeve.getRepGain(player);\n data.push([`Reputation:`, ]);\n }\n }\n\n return (\n \n \n \n \n Earnings\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\";\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 as any).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 as any).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 { CONSTANTS } from \"../../Constants\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { IPlayer } from \"../IPlayer\";\nimport { ClassType } from \"../../utils/WorkType\";\n\nexport interface WorkEarnings {\n workMoneyLossRate: number;\n workHackExpGainRate: number;\n workStrExpGainRate: number;\n workDefExpGainRate: number;\n workDexExpGainRate: number;\n workAgiExpGainRate: number;\n workChaExpGainRate: number;\n}\n\nexport function calculateClassEarnings(player: IPlayer): WorkEarnings {\n const gameCPS = 1000 / CONSTANTS._idleSpeed;\n\n //Find cost and exp gain per game cycle\n let cost = 0;\n let hackExp = 0,\n strExp = 0,\n defExp = 0,\n dexExp = 0,\n agiExp = 0,\n chaExp = 0;\n const hashManager = player.hashManager;\n switch (player.className) {\n case ClassType.StudyComputerScience:\n hackExp =\n ((CONSTANTS.ClassStudyComputerScienceBaseExp * player.workExpMult) / gameCPS) * hashManager.getStudyMult();\n break;\n case ClassType.DataStructures:\n cost = (CONSTANTS.ClassDataStructuresBaseCost * player.workCostMult) / gameCPS;\n hackExp = ((CONSTANTS.ClassDataStructuresBaseExp * player.workExpMult) / gameCPS) * hashManager.getStudyMult();\n break;\n case ClassType.Networks:\n cost = (CONSTANTS.ClassNetworksBaseCost * player.workCostMult) / gameCPS;\n hackExp = ((CONSTANTS.ClassNetworksBaseExp * player.workExpMult) / gameCPS) * hashManager.getStudyMult();\n break;\n case ClassType.Algorithms:\n cost = (CONSTANTS.ClassAlgorithmsBaseCost * player.workCostMult) / gameCPS;\n hackExp = ((CONSTANTS.ClassAlgorithmsBaseExp * player.workExpMult) / gameCPS) * hashManager.getStudyMult();\n break;\n case ClassType.Management:\n cost = (CONSTANTS.ClassManagementBaseCost * player.workCostMult) / gameCPS;\n chaExp = ((CONSTANTS.ClassManagementBaseExp * player.workExpMult) / gameCPS) * hashManager.getStudyMult();\n break;\n case ClassType.Leadership:\n cost = (CONSTANTS.ClassLeadershipBaseCost * player.workCostMult) / gameCPS;\n chaExp = ((CONSTANTS.ClassLeadershipBaseExp * player.workExpMult) / gameCPS) * hashManager.getStudyMult();\n break;\n case ClassType.GymStrength:\n cost = (CONSTANTS.ClassGymBaseCost * player.workCostMult) / gameCPS;\n strExp = (player.workExpMult / gameCPS) * hashManager.getTrainingMult();\n break;\n case ClassType.GymDefense:\n cost = (CONSTANTS.ClassGymBaseCost * player.workCostMult) / gameCPS;\n defExp = (player.workExpMult / gameCPS) * hashManager.getTrainingMult();\n break;\n case ClassType.GymDexterity:\n cost = (CONSTANTS.ClassGymBaseCost * player.workCostMult) / gameCPS;\n dexExp = (player.workExpMult / gameCPS) * hashManager.getTrainingMult();\n break;\n case ClassType.GymAgility:\n cost = (CONSTANTS.ClassGymBaseCost * player.workCostMult) / gameCPS;\n agiExp = (player.workExpMult / gameCPS) * hashManager.getTrainingMult();\n break;\n default:\n throw new Error(\"ERR: Invalid/unrecognized class name\");\n }\n return {\n workMoneyLossRate: cost,\n workHackExpGainRate: hackExp * player.hacking_exp_mult * BitNodeMultipliers.ClassGymExpGain,\n workStrExpGainRate: strExp * player.strength_exp_mult * BitNodeMultipliers.ClassGymExpGain,\n workDefExpGainRate: defExp * player.defense_exp_mult * BitNodeMultipliers.ClassGymExpGain,\n workDexExpGainRate: dexExp * player.dexterity_exp_mult * BitNodeMultipliers.ClassGymExpGain,\n workAgiExpGainRate: agiExp * player.agility_exp_mult * BitNodeMultipliers.ClassGymExpGain,\n workChaExpGainRate: chaExp * player.charisma_exp_mult * BitNodeMultipliers.ClassGymExpGain,\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 as any).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 this.print(\n `${dashes}Root Access: ${c}${!isHacknet ? \", Required hacking skill: \" + (s as any).requiredHackingSkill : \"\"}`,\n );\n\n if (s.hasOwnProperty(\"numOpenPortsRequired\")) {\n this.print(dashes + \"Number of open ports required to NUKE: \" + (s as any).numOpenPortsRequired);\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 } 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 = () => any;\n\n/* Function that checks if the provided solution is the correct one */\nexport type SolverFunc = (data: any, 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: any) => 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: any[][]): string {\n const components: string[] = [];\n arr.forEach((e: any) => {\n let s: string = e.toString();\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: number): 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: number, ans: string): boolean => {\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: number[]): string => {\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: number[], ans: string): boolean => {\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: number): string => {\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: number, ans: string): boolean => {\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: [number, number[]]): string => {\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: [number, number[]], ans: string): boolean => {\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: number[][]): string => {\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: number[][], ans: string): boolean => {\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: string = removeBracketsFromArrayString(ans).replace(/\\s/g, \"\");\n const playerAns: any[] = sanitizedPlayerAns.split(\",\");\n for (let i = 0; i < playerAns.length; ++i) {\n playerAns[i] = parseInt(playerAns[i], 10);\n }\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: number[]): string => {\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: number[], ans: string): boolean => {\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: number[]): string => {\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: number[], ans: string): boolean => {\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: number[][]): string => {\n return [\n \"Given the following array of array 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: number[][], ans: string): boolean => {\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: string): 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: string, ans: string): boolean => {\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: number = parseInt(data.substring(0, a), 10);\n const B: number = parseInt(data.substring(a, a + b), 10);\n const C: number = parseInt(data.substring(a + b, a + b + c), 10);\n const D: number = 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: number[]): string => {\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: number[], ans: string): boolean => {\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: number[]): string => {\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: number[], ans: string): boolean => {\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: number[]): string => {\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: number[], ans: string): boolean => {\n let hold1: number = Number.MIN_SAFE_INTEGER;\n let hold2: number = 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: any[]): string => {\n const k: number = data[0];\n const prices: number[] = 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: (): any[] => {\n const k: number = getRandomInt(2, 10);\n const len: number = 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: any[], ans: string): boolean => {\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: number[][]): string => {\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: number[][], ans: string): boolean => {\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: number[]): string => {\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: number[], ans: string): boolean => {\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: number[][]): string => {\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: number[][], ans: string): boolean => {\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: number[][]): string => {\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: number[][], ans: string): boolean => {\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: string): 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: string, ans: string): boolean => {\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: any[]): string => {\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: (): any[] => {\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: any[], ans: string): boolean => {\n const num: string = data[0];\n const target: number = 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: number): string => {\n return [\n \"You are given the following decimal Value: \\n\",\n `${n} \\n`,\n \"Convert it into a binary string and encode it as a 'Hamming-Code'. eg:\\n \",\n \"Value 8 will result into binary '1000', which will be encoded\",\n \"with the pattern 'pppdpddd', where p is a paritybit and d a databit,\\n\",\n \"or '10101' (Value 21) will result into (pppdpdddpd) '1001101011'.\\n\\n\",\n \"NOTE: You need an parity Bit on Index 0 as an 'overall'-paritybit. \\n\",\n \"NOTE 2: You should watch the HammingCode-video from 3Blue1Brown, which explains the 'rule' of encoding,\",\n \"including the first Index parity-bit mentioned on the first note.\\n\\n\",\n \"Now the only one rule for this encoding:\\n\",\n \" It's not allowed to add additional leading '0's to the binary value\\n\",\n \"That means, the binary value has to be encoded as it is\",\n ].join(\" \");\n },\n gen: (): number => {\n return getRandomInt(Math.pow(2, 4), Math.pow(2, getRandomInt(1, 57)));\n },\n solver: (data: number, ans: string): boolean => {\n return ans === HammingEncode(data);\n },\n },\n {\n name: \"HammingCodes: Encoded Binary to Integer\",\n difficulty: 8,\n numTries: 10,\n desc: (n: string): string => {\n return [\n \"You are given the following encoded binary String: \\n\",\n `'${n}' \\n`,\n \"Treat it as a Hammingcode with 1 'possible' error on an 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 is following Hammings 'rule'\\n\",\n \"Note 2: Index 0 is an 'overall' parity bit. Watch the Hammingcode-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 \"Extranote 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 = HammingEncode(\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: string, ans: string): boolean => {\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: [number, [number, number][]]): string => {\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: any[]): 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: [number, [number, number][]], ans: string): boolean => {\n //Case where the player believes there is no solution.\n //Attempt to construct one to check if this is correct.\n if (ans == \"[]\") {\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 //Sanitize player input\n const sanitizedPlayerAns: string = removeBracketsFromArrayString(ans);\n const sanitizedPlayerAnsArr: string[] = sanitizedPlayerAns.split(\",\");\n const coloring: number[] = sanitizedPlayerAnsArr.map((val) => parseInt(val));\n\n //Solution provided case\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: string): 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: string, ans: string): boolean => {\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: string): 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 - 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: string, ans: string): boolean => {\n return ans === comprLZDecode(compr);\n },\n },\n {\n name: \"Compression III: LZ Compression\",\n difficulty: 10,\n numTries: 10,\n desc: (plaintext: string): 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 - 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: string, ans: string): boolean => {\n return comprLZDecode(ans) === plain && ans.length <= comprLZEncode(plain).length;\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.hacking + p.intelligence / 2 >= lvl;\n };\n}\n\nfunction bitFlumeRequirements() {\n return function (p: IPlayer) {\n return p.sourceFiles.length > 0 && p.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 = player.augmentations.length >= numAugReq && player.money > 1e11 && player.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.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","/**\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(levels: number): number {\n if (typeof this.cost === \"number\") {\n return this.cost;\n }\n\n return Math.round((levels + 1) * this.costPerLevel);\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","/**\n * The environment in which a script runs. The environment holds\n * Netscript functions and arguments for that script.\n */\nimport { NS } from \"src/ScriptEditor/NetscriptDefinitions\";\nimport { IMap } from \"../types\";\n\nexport class Environment {\n /**\n * Parent environment. Used to implement \"scope\"\n */\n parent: Environment | null = null;\n\n /**\n * Whether or not the script that uses this Environment should stop running\n */\n stopFlag = false;\n\n /**\n * Environment variables (currently only Netscript functions)\n */\n vars: any = {};\n\n constructor(parent: Environment | null) {\n if (parent instanceof Environment) {\n this.vars = Object.assign({}, parent.vars);\n }\n\n this.parent = parent;\n }\n\n /**\n * Finds the scope where the variable with the given name is defined\n */\n lookup(name: string): Environment | null {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let scope: Environment | null = this;\n while (scope) {\n if (Object.prototype.hasOwnProperty.call(scope.vars, name)) {\n return scope;\n }\n scope = scope.parent;\n }\n\n return null;\n }\n\n //Get the current value of a variable\n get(name: string): any {\n if (name in this.vars) {\n return this.vars[name];\n }\n\n throw new Error(`Undefined variable ${name}`);\n }\n\n //Sets the value of a variable in any scope\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n set(name: string, value: any): any {\n const scope = this.lookup(name);\n\n //If scope has a value, then this variable is already set in a higher scope, so\n //set is there. Otherwise, create a new variable in the local scope\n if (scope !== null) {\n return (scope.vars[name] = value);\n } else {\n return (this.vars[name] = value);\n }\n }\n\n //Creates (or overwrites) a variable in the current scope\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n def(name: string, value: any): any {\n return (this.vars[name] = value);\n }\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","/**\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 { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { Gang } from \"../Gang/Gang\";\nimport { AllGangs } from \"../Gang/AllGangs\";\nimport { GangMemberTasks } from \"../Gang/GangMemberTasks\";\nimport { GangMemberUpgrades } from \"../Gang/GangMemberUpgrades\";\nimport { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { GangMember } from \"../Gang/GangMember\";\nimport { GangMemberTask } from \"../Gang/GangMemberTask\";\n\nimport {\n Gang as IGang,\n GangGenInfo,\n GangOtherInfo,\n GangMemberInfo,\n GangMemberAscension,\n EquipmentStats,\n GangTaskStats,\n} from \"../ScriptEditor/NetscriptDefinitions\";\nimport { InternalAPI, NetscriptContext } from \"../Netscript/APIWrapper\";\n\nexport function NetscriptGang(player: IPlayer, workerScript: WorkerScript): 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 ctx.makeRuntimeErrorMsg(`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 ctx.makeRuntimeErrorMsg(`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 ctx.makeRuntimeErrorMsg(`Invalid task: '${name}'`);\n }\n\n return task;\n };\n\n return {\n createGang:\n (ctx: NetscriptContext) =>\n (_faction: unknown): boolean => {\n const faction = ctx.helper.string(\"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: any = {};\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 = ctx.helper.string(\"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 = ctx.helper.string(\"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 workerScript.log(\"gang.recruitMember\", () => `Successfully recruited Gang Member '${memberName}'`);\n } else {\n 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 = ctx.helper.string(\"memberName\", _memberName);\n const taskName = ctx.helper.string(\"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 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 workerScript.log(\n \"gang.setMemberTask\",\n () => `Successfully assigned Gang Member '${memberName}' to '${taskName}' task`,\n );\n } else {\n 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 = ctx.helper.string(\"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: any): number => {\n const equipName = ctx.helper.string(\"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 = ctx.helper.string(\"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 = ctx.helper.string(\"equipName\", _equipName);\n checkGangApiAccess(ctx);\n const equipment = GangMemberUpgrades[equipName];\n if (!equipment) {\n throw ctx.makeRuntimeErrorMsg(`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 = ctx.helper.string(\"memberName\", _memberName);\n const equipName = ctx.helper.string(\"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 workerScript.log(\"gang.purchaseEquipment\", () => `Purchased '${equipName}' for Gang member '${memberName}'`);\n } else {\n 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 = ctx.helper.string(\"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, workerScript);\n },\n getAscensionResult:\n (ctx: NetscriptContext) =>\n (_memberName: unknown): GangMemberAscension | undefined => {\n const memberName = ctx.helper.string(\"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 = ctx.helper.boolean(_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 workerScript.log(\"gang.setTerritoryWarfare\", () => \"Engaging in Gang Territory Warfare\");\n } else {\n gang.territoryWarfareEngaged = false;\n workerScript.log(\"gang.setTerritoryWarfare\", () => \"Disengaging in Gang Territory Warfare\");\n }\n },\n getChanceToWinClash:\n (ctx: NetscriptContext) =>\n (_otherGang: unknown): number => {\n const otherGang = ctx.helper.string(\"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 ctx.makeRuntimeErrorMsg(`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 { 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 { 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, 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(): any {\n return Generic_toJSON(\"GangMember\", this);\n }\n\n /**\n * Initiatizes a GangMember object from a JSON save state.\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): GangMember {\n return Generic_fromJSON(GangMember, value.data);\n }\n}\n\nReviver.constructors.GangMember = GangMember;\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","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 { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { FactionWorkType } from \"../Faction/FactionWorkTypeEnum\";\nimport { SleeveTaskType } from \"../PersonObjects/Sleeve/SleeveTaskTypesEnum\";\nimport { findSleevePurchasableAugs } from \"../PersonObjects/Sleeve/SleeveHelpers\";\nimport { StaticAugmentations } from \"../Augmentation/StaticAugmentations\";\nimport { CityName } from \"../Locations/data/CityNames\";\nimport { findCrime } from \"../Crime/CrimeHelpers\";\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\";\n\nexport function NetscriptSleeve(player: IPlayer): InternalAPI {\n const checkSleeveAPIAccess = function (ctx: NetscriptContext): void {\n if (player.bitNodeN !== 10 && !player.sourceFileLvl(10)) {\n throw ctx.makeRuntimeErrorMsg(\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 ctx.log(() => msg);\n throw ctx.makeRuntimeErrorMsg(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 hacking: sl.hacking,\n strength: sl.strength,\n defense: sl.defense,\n dexterity: sl.dexterity,\n agility: sl.agility,\n charisma: sl.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 = ctx.helper.number(\"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 = ctx.helper.number(\"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 = ctx.helper.number(\"sleeveNumber\", _sleeveNumber);\n const crimeRoughName = ctx.helper.string(\"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 = ctx.helper.number(\"sleeveNumber\", _sleeveNumber);\n const universityName = ctx.helper.string(\"universityName\", _universityName);\n const className = ctx.helper.string(\"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 = ctx.helper.number(\"sleeveNumber\", _sleeveNumber);\n const cityName = ctx.helper.string(\"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 ctx.makeRuntimeErrorMsg(`Invalid city name: '${cityName}'.`);\n }\n },\n setToCompanyWork:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown, acompanyName: unknown): boolean => {\n const sleeveNumber = ctx.helper.number(\"sleeveNumber\", _sleeveNumber);\n const companyName = ctx.helper.string(\"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 (other.currentTask === SleeveTaskType.Company && other.currentTaskLocation === companyName) {\n throw ctx.makeRuntimeErrorMsg(\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 = ctx.helper.number(\"sleeveNumber\", _sleeveNumber);\n const factionName = ctx.helper.string(\"factionName\", _factionName);\n const workType = ctx.helper.string(\"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 (other.currentTask === SleeveTaskType.Faction && other.currentTaskLocation === factionName) {\n throw ctx.makeRuntimeErrorMsg(\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 ctx.makeRuntimeErrorMsg(\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 = ctx.helper.number(\"sleeveNumber\", _sleeveNumber);\n const gymName = ctx.helper.string(\"gymName\", _gymName);\n const stat = ctx.helper.string(\"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 = ctx.helper.number(\"sleeveNumber\", _sleeveNumber);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n return getSleeveStats(sleeveNumber);\n },\n getTask:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown): SleeveTask => {\n const sleeveNumber = ctx.helper.number(\"sleeveNumber\", _sleeveNumber);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n\n const sl = player.sleeves[sleeveNumber];\n return {\n task: SleeveTaskType[sl.currentTask],\n crime: sl.crimeType,\n location: sl.currentTaskLocation,\n gymStatType: sl.gymStatType,\n factionWorkType: FactionWorkType[sl.factionWorkType],\n className: sl.className,\n };\n },\n getInformation:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown): SleeveInformation => {\n const sleeveNumber = ctx.helper.number(\"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 maxHp: sl.max_hp,\n\n mult: {\n agility: sl.agility_mult,\n agilityExp: sl.agility_exp_mult,\n charisma: sl.charisma_mult,\n charismaExp: sl.charisma_exp_mult,\n companyRep: sl.company_rep_mult,\n crimeMoney: sl.crime_money_mult,\n crimeSuccess: sl.crime_success_mult,\n defense: sl.defense_mult,\n defenseExp: sl.defense_exp_mult,\n dexterity: sl.dexterity_mult,\n dexterityExp: sl.dexterity_exp_mult,\n factionRep: sl.faction_rep_mult,\n hacking: sl.hacking_mult,\n hackingExp: sl.hacking_exp_mult,\n strength: sl.strength_mult,\n strengthExp: sl.strength_exp_mult,\n workMoney: sl.work_money_mult,\n },\n\n timeWorked: sl.currentTaskTime,\n earningsForSleeves: {\n workHackExpGain: sl.earningsForSleeves.hack,\n workStrExpGain: sl.earningsForSleeves.str,\n workDefExpGain: sl.earningsForSleeves.def,\n workDexExpGain: sl.earningsForSleeves.dex,\n workAgiExpGain: sl.earningsForSleeves.agi,\n workChaExpGain: sl.earningsForSleeves.cha,\n workMoneyGain: sl.earningsForSleeves.money,\n },\n earningsForPlayer: {\n workHackExpGain: sl.earningsForPlayer.hack,\n workStrExpGain: sl.earningsForPlayer.str,\n workDefExpGain: sl.earningsForPlayer.def,\n workDexExpGain: sl.earningsForPlayer.dex,\n workAgiExpGain: sl.earningsForPlayer.agi,\n workChaExpGain: sl.earningsForPlayer.cha,\n workMoneyGain: sl.earningsForPlayer.money,\n },\n earningsForTask: {\n workHackExpGain: sl.earningsForTask.hack,\n workStrExpGain: sl.earningsForTask.str,\n workDefExpGain: sl.earningsForTask.def,\n workDexExpGain: sl.earningsForTask.dex,\n workAgiExpGain: sl.earningsForTask.agi,\n workChaExpGain: sl.earningsForTask.cha,\n workMoneyGain: sl.earningsForTask.money,\n },\n workRepGain: sl.getRepGain(player),\n };\n },\n getSleeveAugmentations:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown): string[] => {\n const sleeveNumber = ctx.helper.number(\"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 = ctx.helper.number(\"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 = ctx.helper.number(\"sleeveNumber\", _sleeveNumber);\n const augName = ctx.helper.string(\"augName\", _augName);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n\n if (getSleeveStats(sleeveNumber).shock > 0) {\n throw ctx.makeRuntimeErrorMsg(`Sleeve shock too high: Sleeve ${sleeveNumber}`);\n }\n\n const aug = StaticAugmentations[augName];\n if (!aug) {\n throw ctx.makeRuntimeErrorMsg(`Invalid aug: ${augName}`);\n }\n\n return player.sleeves[sleeveNumber].tryBuyAugmentation(player, aug);\n },\n setToBladeburnerAction:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown, _action: unknown, _contract?: unknown): boolean => {\n const sleeveNumber = ctx.helper.number(\"sleeveNumber\", _sleeveNumber);\n const action = ctx.helper.string(\"action\", _action);\n let contract: string;\n if (typeof _contract === \"undefined\") {\n contract = \"------\";\n } else {\n contract = ctx.helper.string(\"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 (other.currentTask === SleeveTaskType.Bladeburner && other.bbAction === action) {\n throw ctx.helper.makeRuntimeErrorMsg(\n `Sleeve ${sleeveNumber} cannot take of 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","import { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { Exploit } from \"../Exploits/Exploit\";\nimport * as bcrypt from \"bcryptjs\";\nimport { Apr1Events as devMenu } from \"../ui/Apr1\";\nimport { InternalAPI, NetscriptContext } from \"../Netscript/APIWrapper\";\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(player: IPlayer): 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 const d = doc as any;\n d.completely_unused_field = undefined;\n const real_document: any = document;\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 ctx.helper.string(\"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 { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { WorkerScript } from \"../Netscript/WorkerScript\";\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\";\n\nexport function NetscriptHacknet(player: IPlayer, workerScript: WorkerScript): 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 ctx.makeRuntimeErrorMsg(\"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 ctx.makeRuntimeErrorMsg(\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 = ctx.helper.number(\"i\", _i);\n const node = getHacknetNode(ctx, i);\n const hasUpgraded = hasHacknetServers(player);\n const res: any = {\n name: node instanceof HacknetServer ? node.hostname : node.name,\n level: node.level,\n ram: node instanceof HacknetServer ? node.maxRam : node.ram,\n ramUsed: node instanceof HacknetServer ? node.ramUsed : undefined,\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 }\n\n return res;\n },\n upgradeLevel:\n (ctx: NetscriptContext) =>\n (_i: unknown, _n: unknown = 1): boolean => {\n const i = ctx.helper.number(\"i\", _i);\n const n = ctx.helper.number(\"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 = ctx.helper.number(\"i\", _i);\n const n = ctx.helper.number(\"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 = ctx.helper.number(\"i\", _i);\n const n = ctx.helper.number(\"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 = ctx.helper.number(\"i\", _i);\n const n = ctx.helper.number(\"n\", _n);\n if (!hasHacknetServers(player)) {\n return false;\n }\n const node = getHacknetNode(ctx, i);\n if (!(node instanceof HacknetServer)) {\n workerScript.log(\"hacknet.upgradeCache\", () => \"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 = ctx.helper.number(\"i\", _i);\n const n = ctx.helper.number(\"n\", _n);\n const node = getHacknetNode(ctx, i);\n return node.calculateLevelUpgradeCost(n, player.hacknet_node_level_cost_mult);\n },\n getRamUpgradeCost:\n (ctx: NetscriptContext) =>\n (_i: unknown, _n: unknown = 1): number => {\n const i = ctx.helper.number(\"i\", _i);\n const n = ctx.helper.number(\"n\", _n);\n const node = getHacknetNode(ctx, i);\n return node.calculateRamUpgradeCost(n, player.hacknet_node_ram_cost_mult);\n },\n getCoreUpgradeCost:\n (ctx: NetscriptContext) =>\n (_i: unknown, _n: unknown = 1): number => {\n const i = ctx.helper.number(\"i\", _i);\n const n = ctx.helper.number(\"n\", _n);\n const node = getHacknetNode(ctx, i);\n return node.calculateCoreUpgradeCost(n, player.hacknet_node_core_cost_mult);\n },\n getCacheUpgradeCost:\n (ctx: NetscriptContext) =>\n (_i: unknown, _n: unknown = 1): number => {\n const i = ctx.helper.number(\"i\", _i);\n const n = ctx.helper.number(\"n\", _n);\n if (!hasHacknetServers(player)) {\n return Infinity;\n }\n const node = getHacknetNode(ctx, i);\n if (!(node instanceof HacknetServer)) {\n workerScript.log(\"hacknet.getCacheUpgradeCost\", () => \"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): number => {\n const upgName = ctx.helper.string(\"upgName\", _upgName);\n if (!hasHacknetServers(player)) {\n return Infinity;\n }\n\n return player.hashManager.getUpgradeCost(upgName);\n },\n spendHashes:\n (ctx: NetscriptContext) =>\n (_upgName: unknown, _upgTarget: unknown = \"\"): boolean => {\n const upgName = ctx.helper.string(\"upgName\", _upgName);\n const upgTarget = ctx.helper.string(\"upgTarget\", _upgTarget);\n if (!hasHacknetServers(player)) {\n return false;\n }\n return purchaseHashUpgrade(player, upgName, upgTarget);\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 = ctx.helper.string(\"upgName\", _upgName);\n const level = player.hashManager.upgrades[upgName];\n if (level === undefined) {\n throw ctx.makeRuntimeErrorMsg(`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 { INetscriptHelper } from \"./INetscriptHelper\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { netscriptDelay } from \"../NetscriptEvaluator\";\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\";\n\nexport function NetscriptStanek(\n player: IPlayer,\n workerScript: WorkerScript,\n helper: INetscriptHelper,\n): InternalAPI {\n function checkStanekAPIAccess(func: string): void {\n if (!player.hasAugmentation(AugmentationNames.StaneksGift1, true)) {\n throw helper.makeRuntimeErrorMsg(func, \"Stanek's Gift is not installed\");\n }\n }\n\n return {\n giftWidth: () =>\n function (): number {\n checkStanekAPIAccess(\"giftWidth\");\n return staneksGift.width();\n },\n giftHeight: () =>\n function (): number {\n checkStanekAPIAccess(\"giftHeight\");\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 = _ctx.helper.number(\"rootX\", _rootX);\n const rootY = _ctx.helper.number(\"rootY\", _rootY);\n checkStanekAPIAccess(\"chargeFragment\");\n const fragment = staneksGift.findFragment(rootX, rootY);\n //Check whether the selected fragment can ge charged\n if (!fragment) throw _ctx.makeRuntimeErrorMsg(`No fragment with root (${rootX}, ${rootY}).`);\n if (fragment.fragment().type == FragmentType.Booster) {\n throw _ctx.makeRuntimeErrorMsg(\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 netscriptDelay(time, workerScript).then(function () {\n staneksGift.charge(player, fragment, workerScript.scriptRef.threads);\n _ctx.log(() => `Charged fragment with ${_ctx.workerScript.scriptRef.threads} threads.`);\n return Promise.resolve();\n });\n },\n fragmentDefinitions: (_ctx: NetscriptContext) =>\n function (): IFragment[] {\n checkStanekAPIAccess(\"fragmentDefinitions\");\n _ctx.log(() => `Returned ${Fragments.length} fragments`);\n return Fragments.map((f) => f.copy());\n },\n activeFragments: (_ctx: NetscriptContext) =>\n function (): IActiveFragment[] {\n checkStanekAPIAccess(\"activeFragments\");\n _ctx.log(() => `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(\"clearGift\");\n _ctx.log(() => `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 = _ctx.helper.number(\"rootX\", _rootX);\n const rootY = _ctx.helper.number(\"rootY\", _rootY);\n const rotation = _ctx.helper.number(\"rotation\", _rotation);\n const fragmentId = _ctx.helper.number(\"fragmentId\", _fragmentId);\n checkStanekAPIAccess(\"canPlaceFragment\");\n const fragment = FragmentById(fragmentId);\n if (!fragment) throw _ctx.makeRuntimeErrorMsg(`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 = _ctx.helper.number(\"rootX\", _rootX);\n const rootY = _ctx.helper.number(\"rootY\", _rootY);\n const rotation = _ctx.helper.number(\"rotation\", _rotation);\n const fragmentId = _ctx.helper.number(\"fragmentId\", _fragmentId);\n checkStanekAPIAccess(\"placeFragment\");\n const fragment = FragmentById(fragmentId);\n if (!fragment) throw _ctx.makeRuntimeErrorMsg(`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 = _ctx.helper.number(\"rootX\", _rootX);\n const rootY = _ctx.helper.number(\"rootY\", _rootY);\n checkStanekAPIAccess(\"getFragment\");\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 = _ctx.helper.number(\"rootX\", _rootX);\n const rootY = _ctx.helper.number(\"rootY\", _rootY);\n checkStanekAPIAccess(\"removeFragment\");\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 }\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 { IPlayer } from \"../PersonObjects/IPlayer\";\n\nimport { Infiltration as IInfiltration, InfiltrationLocation } 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\";\n\nexport function NetscriptInfiltration(player: IPlayer): 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 ctx.makeRuntimeErrorMsg(`Location '${location}' does not exists.`);\n if (location.infiltrationData === undefined)\n throw ctx.makeRuntimeErrorMsg(`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: location,\n reward: {\n tradeRep: calculateTradeInformationRepReward(player, reward, maxLevel, difficulty),\n sellCash: calculateSellInformationCashReward(player, reward, maxLevel, difficulty),\n SoARep: calculateInfiltratorsRepReward(player, Factions[FactionNames.ShadowsOfAnarchy], difficulty),\n },\n difficulty: difficulty,\n };\n };\n return {\n getPossibleLocations: () => (): string[] => {\n return getLocationsWithInfiltrations.map((l) => l + \"\");\n },\n getInfiltration:\n (ctx: NetscriptContext) =>\n (_location: unknown): InfiltrationLocation => {\n const location = ctx.helper.string(\"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 \"src/Netscript/APIWrapper\";\nimport { Terminal } from \"../../src/Terminal\";\n\nexport function NetscriptUserInterface(): InternalAPI {\n return {\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 ctx.log(() => `Successfully set theme`);\n } else {\n ctx.log(() => `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 ctx.log(() => `Successfully set styles`);\n } else {\n ctx.log(() => `Failed to set styles. Errors: ${errors.join(\", \")}`);\n }\n },\n\n resetTheme: (ctx: NetscriptContext) => (): void => {\n Settings.theme = { ...defaultTheme };\n ThemeEvents.emit();\n ctx.log(() => `Reinitialized theme to default`);\n },\n\n resetStyles: (ctx: NetscriptContext) => (): void => {\n Settings.styles = { ...defaultStyles };\n ThemeEvents.emit();\n ctx.log(() => `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 ctx.log(() => `Clearing terminal`);\n Terminal.clear();\n },\n };\n}\n","import { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\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\";\n\nexport function NetscriptBladeburner(player: IPlayer, workerScript: WorkerScript): 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 ctx.makeRuntimeErrorMsg(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 ctx.makeRuntimeErrorMsg(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 ctx.makeRuntimeErrorMsg(`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 ctx.makeRuntimeErrorMsg(`Invalid action type='${type}', name='${name}'`);\n }\n const actionObj = bladeburner.getActionObject(actionId);\n if (!actionObj) {\n throw ctx.makeRuntimeErrorMsg(`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 = ctx.helper.string(\"blackOpName\", _blackOpName);\n checkBladeburnerAccess(ctx);\n const action: any = getBladeburnerActionObject(ctx, \"blackops\", blackOpName);\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 = ctx.helper.string(\"type\", _type);\n const name = ctx.helper.string(\"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, workerScript);\n } catch (e: any) {\n throw ctx.makeRuntimeErrorMsg(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 = ctx.helper.string(\"type\", _type);\n const name = ctx.helper.string(\"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 ctx.log(() => errorLogText);\n return -1;\n } else {\n return time;\n }\n } catch (e: any) {\n throw ctx.makeRuntimeErrorMsg(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: any) {\n throw ctx.makeRuntimeErrorMsg(e);\n }\n },\n getActionEstimatedSuccessChance:\n (ctx: NetscriptContext) =>\n (_type: unknown, _name: unknown): [number, number] => {\n const type = ctx.helper.string(\"type\", _type);\n const name = ctx.helper.string(\"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 ctx.log(() => errorLogText);\n return [-1, -1];\n } else {\n return chance;\n }\n } catch (e: any) {\n throw ctx.makeRuntimeErrorMsg(e);\n }\n },\n getActionRepGain:\n (ctx: NetscriptContext) =>\n (_type: unknown, _name: unknown, _level: unknown): number => {\n const type = ctx.helper.string(\"type\", _type);\n const name = ctx.helper.string(\"name\", _name);\n const level = ctx.helper.number(\"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 = ctx.helper.string(\"type\", _type);\n const name = ctx.helper.string(\"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, workerScript);\n } catch (e: any) {\n throw ctx.makeRuntimeErrorMsg(e);\n }\n },\n getActionMaxLevel:\n (ctx: NetscriptContext) =>\n (_type: unknown, _name: unknown): number => {\n const type = ctx.helper.string(\"type\", _type);\n const name = ctx.helper.string(\"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 = ctx.helper.string(\"type\", _type);\n const name = ctx.helper.string(\"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 = ctx.helper.string(\"type\", _type);\n const name = ctx.helper.string(\"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 = ctx.helper.string(\"type\", _type);\n const name = ctx.helper.string(\"name\", _name);\n const autoLevel = ctx.helper.boolean(_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 = ctx.helper.string(\"type\", _type);\n const name = ctx.helper.string(\"name\", _name);\n const level = ctx.helper.number(\"level\", _level);\n checkBladeburnerAccess(ctx);\n const action = getBladeburnerActionObject(ctx, type, name);\n if (level < 1 || level > action.maxLevel) {\n ctx.helper.makeRuntimeErrorMsg(`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 = ctx.helper.string(\"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, workerScript);\n } catch (e: any) {\n throw ctx.makeRuntimeErrorMsg(e);\n }\n },\n getSkillUpgradeCost:\n (ctx: NetscriptContext) =>\n (_skillName: unknown): number => {\n const skillName = ctx.helper.string(\"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.getSkillUpgradeCostNetscriptFn(skillName, workerScript);\n } catch (e: any) {\n throw ctx.makeRuntimeErrorMsg(e);\n }\n },\n upgradeSkill:\n (ctx: NetscriptContext) =>\n (_skillName: unknown): boolean => {\n const skillName = ctx.helper.string(\"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.upgradeSkillNetscriptFn(skillName, workerScript);\n } catch (e: any) {\n throw ctx.makeRuntimeErrorMsg(e);\n }\n },\n getTeamSize:\n (ctx: NetscriptContext) =>\n (_type: unknown, _name: unknown): number => {\n const type = ctx.helper.string(\"type\", _type);\n const name = ctx.helper.string(\"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, workerScript);\n } catch (e: any) {\n throw ctx.makeRuntimeErrorMsg(e);\n }\n },\n setTeamSize:\n (ctx: NetscriptContext) =>\n (_type: unknown, _name: unknown, _size: unknown): number => {\n const type = ctx.helper.string(\"type\", _type);\n const name = ctx.helper.string(\"name\", _name);\n const size = ctx.helper.number(\"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, workerScript);\n } catch (e: any) {\n throw ctx.makeRuntimeErrorMsg(e);\n }\n },\n getCityEstimatedPopulation:\n (ctx: NetscriptContext) =>\n (_cityName: unknown): number => {\n const cityName = ctx.helper.string(\"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 = ctx.helper.string(\"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 = ctx.helper.string(\"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 = ctx.helper.string(\"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(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.strength >= 100 &&\n player.defense >= 100 &&\n player.dexterity >= 100 &&\n player.agility >= 100\n ) {\n player.bladeburner = new Bladeburner(player);\n ctx.log(() => \"You have been accepted into the Bladeburner division\");\n\n return true;\n } else {\n ctx.log(() => \"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 { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { is2DArray } from \"../utils/helpers/is2DArray\";\nimport { CodingContract } from \"../CodingContracts\";\nimport { CodingAttemptOptions, CodingContract as ICodingContract } from \"../ScriptEditor/NetscriptDefinitions\";\nimport { InternalAPI, NetscriptContext } from \"src/Netscript/APIWrapper\";\n\nexport function NetscriptCodingContract(player: IPlayer, workerScript: WorkerScript): InternalAPI {\n const getCodingContract = function (\n ctx: NetscriptContext,\n func: string,\n hostname: string,\n filename: string,\n ): CodingContract {\n const server = ctx.helper.getServer(hostname);\n const contract = server.getContract(filename);\n if (contract == null) {\n throw ctx.makeRuntimeErrorMsg(`Cannot find contract '${filename}' on server '${hostname}'`);\n }\n\n return contract;\n };\n\n return {\n attempt:\n (ctx: NetscriptContext) =>\n (\n answer: any,\n _filename: unknown,\n _hostname: unknown = workerScript.hostname,\n { returnReward }: CodingAttemptOptions = { returnReward: false },\n ): boolean | string => {\n const filename = ctx.helper.string(\"filename\", _filename);\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const contract = getCodingContract(ctx, \"attempt\", hostname, filename);\n\n // Convert answer to string. If the answer is a 2D array, then we have to\n // manually add brackets for the inner arrays\n if (is2DArray(answer)) {\n const answerComponents = [];\n for (let i = 0; i < answer.length; ++i) {\n answerComponents.push([\"[\", answer[i].toString(), \"]\"].join(\"\"));\n }\n\n answer = answerComponents.join(\",\");\n } else {\n answer = String(answer);\n }\n\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 = ctx.helper.getServer(hostname);\n if (contract.isSolution(answer)) {\n const reward = player.gainCodingContractReward(creward, contract.getDifficulty());\n ctx.log(() => `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 ctx.log(() => `Coding Contract attempt '${filename}' failed. Contract is now self-destructing`);\n serv.removeContract(filename);\n } else {\n ctx.log(\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 = workerScript.hostname): string => {\n const filename = ctx.helper.string(\"filename\", _filename);\n const hostname = ctx.helper.string(\"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 = workerScript.hostname): any => {\n const filename = ctx.helper.string(\"filename\", _filename);\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const contract = getCodingContract(ctx, \"getData\", hostname, filename);\n const data = contract.getData();\n if (data.constructor === Array) {\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 = workerScript.hostname): string => {\n const filename = ctx.helper.string(\"filename\", _filename);\n const hostname = ctx.helper.string(\"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 = workerScript.hostname): number => {\n const filename = ctx.helper.string(\"filename\", _filename);\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const contract = getCodingContract(ctx, \"getNumTriesRemaining\", hostname, filename);\n return contract.getMaxNumTries() - contract.tries;\n },\n };\n}\n","export function isArray(arr: unknown): arr is unknown[] {\n return Array.isArray(arr);\n}\n\n// Checks whether an array is a 2D array.\n// For this, a 2D array is an array which contains only other arrays.\n// If one element in the array is a number or string, it is NOT a 2D array\nexport function is2DArray(arr: unknown): arr is unknown[][] {\n return isArray(arr) && arr.every((u) => isArray(u));\n}\n","import { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { netscriptDelay } from \"../NetscriptEvaluator\";\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} 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 UpgradeOfficeSize,\n ThrowParty,\n PurchaseWarehouse,\n UpgradeWarehouse,\n BuyCoffee,\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 { calculateIntelligenceBonus } from \"../PersonObjects/formulas/intelligence\";\nimport { Industry } from \"../Corporation/Industry\";\nimport { IndustryResearchTrees, IndustryStartingCosts } from \"../Corporation/IndustryData\";\nimport { CorporationConstants } from \"../Corporation/data/Constants\";\nimport { IndustryUpgrades } from \"../Corporation/IndustryUpgrades\";\nimport { ResearchMap } from \"../Corporation/ResearchMap\";\nimport { Factions } from \"../Faction/Factions\";\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { InternalAPI, NetscriptContext } from \"src/Netscript/APIWrapper\";\n\nexport function NetscriptCorporation(player: IPlayer, workerScript: WorkerScript): 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 = ctx.helper.string(\"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 = ctx.helper.string(\"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, amountShares: number): boolean {\n if (!player.factions.includes(factionName)) throw new Error(\"Invalid faction name\");\n if (isNaN(amountCash) || amountCash < 0 || isNaN(amountShares) || amountShares < 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 if (corporation.numShares < amountShares) 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 + amountShares * corporation.sharePrice) / CorporationConstants.BribeToRepRatio;\n faction.playerReputation += repGain;\n corporation.funds = corporation.funds - amountCash;\n corporation.numShares -= amountShares;\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 ctx.makeRuntimeErrorMsg(\"Must own a corporation.\");\n if (!api) return;\n\n if (!player.corporation.unlockUpgrades[api]) throw ctx.makeRuntimeErrorMsg(\"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: division.upgrades.slice(),\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 = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const amt = ctx.helper.number(\"amount\", _amt);\n if (amt < 1) {\n throw ctx.makeRuntimeErrorMsg(\"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 = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"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 = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"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 = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const materialName = ctx.helper.string(\"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 = ctx.helper.string(\"divisionName\", _divisionName);\n const productName = ctx.helper.string(\"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 = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"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 = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const amt = ctx.helper.number(\"amount\", _amt);\n const corporation = getCorporation();\n if (amt < 1) {\n throw ctx.makeRuntimeErrorMsg(\"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 = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const materialName = ctx.helper.string(\"materialName\", _materialName);\n const amt = ctx.helper.string(\"amt\", _amt);\n const price = ctx.helper.string(\"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 = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const productName = ctx.helper.string(\"productName\", _productName);\n const amt = ctx.helper.string(\"amt\", _amt);\n const price = ctx.helper.string(\"price\", _price);\n const all = ctx.helper.boolean(_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 = ctx.helper.string(\"divisionName\", _divisionName);\n const productName = ctx.helper.string(\"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 = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const enabled = ctx.helper.boolean(_enabled);\n const warehouse = getWarehouse(divisionName, cityName);\n if (!hasUnlockUpgrade(\"Smart Supply\"))\n throw ctx.makeRuntimeErrorMsg(`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 = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const materialName = ctx.helper.string(\"materialName\", _materialName);\n const enabled = ctx.helper.boolean(_enabled);\n const warehouse = getWarehouse(divisionName, cityName);\n const material = getMaterial(divisionName, cityName, materialName);\n if (!hasUnlockUpgrade(\"Smart Supply\"))\n throw ctx.makeRuntimeErrorMsg(`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 = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const materialName = ctx.helper.string(\"materialName\", _materialName);\n const amt = ctx.helper.number(\"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 = ctx.helper.string(\"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 = ctx.helper.city(\"cityName\", _cityName);\n const materialName = ctx.helper.string(\"materialName\", _materialName);\n const amt = ctx.helper.number(\"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 = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const productName = ctx.helper.string(\"productName\", _productName);\n const designInvest = ctx.helper.number(\"designInvest\", _designInvest);\n const marketingInvest = ctx.helper.number(\"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 = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const productName = ctx.helper.string(\"productName\", _productName);\n const qty = ctx.helper.number(\"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 = ctx.helper.string(\"sourceDivision\", _sourceDivision);\n const sourceCity = ctx.helper.string(\"sourceCity\", _sourceCity);\n const targetDivision = ctx.helper.string(\"targetDivision\", _targetDivision);\n const targetCity = ctx.helper.string(\"targetCity\", _targetCity);\n const materialName = ctx.helper.string(\"materialName\", _materialName);\n const amt = ctx.helper.string(\"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 = ctx.helper.string(\"sourceDivision\", _sourceDivision);\n const sourceCity = ctx.helper.string(\"sourceCity\", _sourceCity);\n const targetDivision = ctx.helper.string(\"targetDivision\", _targetDivision);\n const targetCity = ctx.helper.string(\"targetCity\", _targetCity);\n const materialName = ctx.helper.string(\"materialName\", _materialName);\n const amt = ctx.helper.string(\"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 = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const materialName = ctx.helper.string(\"materialName\", _materialName);\n const qty = ctx.helper.number(\"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 = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const materialName = ctx.helper.string(\"materialName\", _materialName);\n const on = ctx.helper.boolean(_on);\n if (!getDivision(divisionName).hasResearch(\"Market-TA.I\"))\n throw ctx.makeRuntimeErrorMsg(`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 = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const materialName = ctx.helper.string(\"materialName\", _materialName);\n const on = ctx.helper.boolean(_on);\n if (!getDivision(divisionName).hasResearch(\"Market-TA.II\"))\n throw ctx.makeRuntimeErrorMsg(`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 = ctx.helper.string(\"divisionName\", _divisionName);\n const productName = ctx.helper.string(\"productName\", _productName);\n const on = ctx.helper.boolean(_on);\n if (!getDivision(divisionName).hasResearch(\"Market-TA.I\"))\n throw ctx.makeRuntimeErrorMsg(`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 = ctx.helper.string(\"divisionName\", _divisionName);\n const productName = ctx.helper.string(\"productName\", _productName);\n const on = ctx.helper.boolean(_on);\n if (!getDivision(divisionName).hasResearch(\"Market-TA.II\"))\n throw ctx.makeRuntimeErrorMsg(`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 = ctx.helper.string(\"divisionName\", _divisionName);\n const division = getDivision(divisionName);\n const upgrade = IndustryUpgrades[1];\n return upgrade[1] * Math.pow(upgrade[2], division.upgrades[1]);\n },\n getHireAdVertCount:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown): number => {\n checkAccess(ctx, 8);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const division = getDivision(divisionName);\n return division.upgrades[1];\n },\n getResearchCost:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _researchName: unknown): number => {\n checkAccess(ctx, 8);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const researchName = ctx.helper.string(\"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 = ctx.helper.string(\"divisionName\", _divisionName);\n const researchName = ctx.helper.string(\"researchName\", _researchName);\n return hasResearched(getDivision(divisionName), researchName);\n },\n setAutoJobAssignment:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _job: unknown, _amount: unknown): Promise => {\n checkAccess(ctx, 8);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const amount = ctx.helper.number(\"amount\", _amount);\n const job = ctx.helper.string(\"job\", _job);\n const office = getOffice(divisionName, cityName);\n if (!Object.values(EmployeePositions).includes(job)) throw new Error(`'${job}' is not a valid job.`);\n return netscriptDelay(1000, workerScript).then(function () {\n return Promise.resolve(office.setEmployeeToJob(job, amount));\n });\n },\n getOfficeSizeUpgradeCost:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _size: unknown): number => {\n checkAccess(ctx, 8);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const size = ctx.helper.number(\"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): Promise => {\n checkAccess(ctx, 8);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const employeeName = ctx.helper.string(\"employeeName\", _employeeName);\n const job = ctx.helper.string(\"job\", _job);\n const employee = getEmployee(divisionName, cityName, employeeName);\n return netscriptDelay([\"Training\", \"Unassigned\"].includes(employee.pos) ? 0 : 1000, workerScript).then(function () {\n return Promise.resolve(AssignJob(employee, job));\n });\n },\n hireEmployee:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown): any => {\n checkAccess(ctx, 8);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"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 = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const size = ctx.helper.number(\"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 async (_divisionName: unknown, _cityName: unknown, _costPerEmployee: unknown): Promise => {\n checkAccess(ctx, 8);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const costPerEmployee = ctx.helper.number(\"costPerEmployee\", _costPerEmployee);\n if (costPerEmployee < 0)\n throw new Error(\"Invalid value for Cost Per Employee field! Must be numeric and greater than 0\");\n const office = getOffice(divisionName, cityName);\n const corporation = getCorporation();\n return netscriptDelay(\n (60 * 1000) / (player.hacking_speed_mult * calculateIntelligenceBonus(player.intelligence, 1)),\n workerScript,\n ).then(function () {\n return Promise.resolve(ThrowParty(corporation, office, costPerEmployee));\n });\n },\n buyCoffee:\n (ctx: NetscriptContext) =>\n async (_divisionName: unknown, _cityName: unknown): Promise => {\n checkAccess(ctx, 8);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const corporation = getCorporation();\n return netscriptDelay(\n (60 * 1000) / (player.hacking_speed_mult * calculateIntelligenceBonus(player.intelligence, 1)),\n workerScript,\n ).then(function () {\n return Promise.resolve(BuyCoffee(corporation, getDivision(divisionName), getOffice(divisionName, cityName)));\n });\n },\n hireAdVert:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown): void => {\n checkAccess(ctx, 8);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const corporation = getCorporation();\n HireAdVert(corporation, getDivision(divisionName), getOffice(divisionName, \"Sector-12\"));\n },\n research:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _researchName: unknown): void => {\n checkAccess(ctx, 8);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const researchName = ctx.helper.string(\"researchName\", _researchName);\n Research(getDivision(divisionName), researchName);\n },\n getOffice:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown): any => {\n checkAccess(ctx, 8);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"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 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 },\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 = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const employeeName = ctx.helper.string(\"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 expandIndustry:\n (ctx: NetscriptContext) =>\n (_industryName: unknown, _divisionName: unknown): void => {\n checkAccess(ctx);\n const industryName = ctx.helper.string(\"industryName\", _industryName);\n const divisionName = ctx.helper.string(\"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 = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"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 = ctx.helper.string(\"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 = ctx.helper.string(\"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 (_percent: unknown): void => {\n checkAccess(ctx);\n const percent = ctx.helper.number(\"percent\", _percent);\n if (percent < 0 || percent > 100)\n throw new Error(\"Invalid value for percent field! Must be numeric, greater than 0, and less than 100\");\n const corporation = getCorporation();\n if (!corporation.public) throw ctx.makeRuntimeErrorMsg(`Your company has not gone public!`);\n IssueDividends(corporation, percent);\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 = ctx.helper.string(\"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 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 = ctx.helper.string(\"corporationName\", _corporationName);\n const selfFund = ctx.helper.boolean(_selfFund);\n return createCorporation(corporationName, selfFund);\n },\n hasUnlockUpgrade:\n (ctx: NetscriptContext) =>\n (_upgradeName: unknown): boolean => {\n checkAccess(ctx);\n const upgradeName = ctx.helper.string(\"upgradeName\", _upgradeName);\n return hasUnlockUpgrade(upgradeName);\n },\n getUnlockUpgradeCost:\n (ctx: NetscriptContext) =>\n (_upgradeName: unknown): number => {\n checkAccess(ctx);\n const upgradeName = ctx.helper.string(\"upgradeName\", _upgradeName);\n return getUnlockUpgradeCost(upgradeName);\n },\n getUpgradeLevel:\n (ctx: NetscriptContext) =>\n (_upgradeName: unknown): number => {\n checkAccess(ctx);\n const upgradeName = ctx.helper.string(\"upgradeName\", _upgradeName);\n return getUpgradeLevel(ctx, upgradeName);\n },\n getUpgradeLevelCost:\n (ctx: NetscriptContext) =>\n (_upgradeName: unknown): number => {\n checkAccess(ctx);\n const upgradeName = ctx.helper.string(\"upgradeName\", _upgradeName);\n return getUpgradeLevelCost(ctx, upgradeName);\n },\n getExpandIndustryCost:\n (ctx: NetscriptContext) =>\n (_industryName: unknown): number => {\n checkAccess(ctx);\n const industryName = ctx.helper.string(\"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 = ctx.helper.number(\"numShares\", _numShares);\n return goPublic(numShares);\n },\n sellShares:\n (ctx: NetscriptContext) =>\n (_numShares: unknown): number => {\n checkAccess(ctx);\n const numShares = ctx.helper.number(\"numShares\", _numShares);\n return SellShares(getCorporation(), player, numShares);\n },\n buyBackShares:\n (ctx: NetscriptContext) =>\n (_numShares: unknown): boolean => {\n checkAccess(ctx);\n const numShares = ctx.helper.number(\"numShares\", _numShares);\n return BuyBackShares(getCorporation(), player, numShares);\n },\n bribe:\n (ctx: NetscriptContext) =>\n (_factionName: unknown, _amountCash: unknown, _amountShares: unknown): boolean => {\n checkAccess(ctx);\n const factionName = ctx.helper.string(\"factionName\", _factionName);\n const amountCash = ctx.helper.number(\"amountCash\", _amountCash);\n const amountShares = ctx.helper.number(\"amountShares\", _amountShares);\n return bribe(factionName, amountCash, amountShares);\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 } 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\";\nimport { IndustryUpgrade, IndustryUpgrades } from \"./IndustryUpgrades\";\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 //Upgrades\n upgrades: number[] = Array(Object.keys(IndustryUpgrades).length).fill(0);\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 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 // Designing/Creating a Product is based mostly off Engineers\n const engrProd = office.employeeProd[EmployeePositions.Engineer];\n const mgmtProd = office.employeeProd[EmployeePositions.Management];\n const opProd = office.employeeProd[EmployeePositions.Operations];\n const total = engrProd + mgmtProd + opProd;\n if (total <= 0) {\n break;\n }\n\n // Management is a multiplier for the production from Engineers\n const mgmtFactor = 1 + mgmtProd / (1.2 * total);\n\n const progress = (Math.pow(engrProd, 0.34) + Math.pow(opProd, 0.2)) * mgmtFactor;\n\n prod.createProduct(marketCycles, progress);\n if (prod.prog >= 100) {\n prod.finishProduct(office.employeeProd, 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 upgrade(upgrade: IndustryUpgrade, refs: { corporation: ICorporation; office: OfficeSpace }): void {\n const corporation = refs.corporation;\n const office = refs.office;\n const upgN = upgrade[0];\n while (this.upgrades.length <= upgN) {\n this.upgrades.push(0);\n }\n ++this.upgrades[upgN];\n\n switch (upgN) {\n case 0: {\n //Coffee, 5% energy per employee\n for (let i = 0; i < office.employees.length; ++i) {\n office.employees[i].ene = Math.min(office.employees[i].ene * 1.05, office.maxEne);\n }\n break;\n }\n case 1: {\n //AdVert.Inc,\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 break;\n }\n default: {\n console.error(`Un-implemented function index: ${upgN}`);\n break;\n }\n }\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(): any {\n return Generic_toJSON(\"Industry\", this);\n }\n\n /**\n * Initiatizes a Industry object from a JSON save state.\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): 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, Reviver } from \"../utils/JSONReviver\";\nimport { EmployeePositions } from \"./EmployeePositions\";\nimport { ICorporation } from \"./ICorporation\";\nimport { OfficeSpace } from \"./OfficeSpace\";\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\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 }\n\n //Returns the amount the employee needs to be paid\n process(marketCycles = 1, office: OfficeSpace): number {\n const gain = 0.003 * marketCycles,\n 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 if (this.ene < office.minEne) {\n this.ene = office.minEne;\n }\n if (this.hap < office.minHap) {\n this.hap = office.minHap;\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 //Process benefits from having an office party thrown\n throwParty(money: number): number {\n const mult = 1 + money / 10e6;\n this.mor *= mult;\n this.mor = Math.min(100, this.mor);\n this.hap *= mult;\n this.hap = Math.min(100, this.hap);\n return mult;\n }\n\n toJSON(): any {\n return Generic_toJSON(\"Employee\", this);\n }\n\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): 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 { INetscriptHelper } from \"./INetscriptHelper\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\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 { Formulas as IFormulas } 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\";\n\nexport function NetscriptFormulas(player: IPlayer, helper: INetscriptHelper): InternalAPI {\n const checkFormulasAccess = function (ctx: NetscriptContext): void {\n if (!player.hasProgram(Programs.Formulas.name)) {\n throw helper.makeRuntimeErrorMsg(`formulas.${ctx.function}`, `Requires Formulas.exe to run.`);\n }\n };\n return {\n reputation: {\n calculateFavorToRep:\n (ctx: NetscriptContext) =>\n (_favor: unknown): number => {\n const favor = ctx.helper.number(\"favor\", _favor);\n checkFormulasAccess(ctx);\n return calculateFavorToRep(favor);\n },\n calculateRepToFavor:\n (ctx: NetscriptContext) =>\n (_rep: unknown): number => {\n const rep = ctx.helper.number(\"rep\", _rep);\n checkFormulasAccess(ctx);\n return calculateRepToFavor(rep);\n },\n repFromDonation:\n (ctx: NetscriptContext) =>\n (_amount: unknown, player: any): number => {\n const amount = ctx.helper.number(\"amount\", _amount);\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 = ctx.helper.number(\"exp\", _exp);\n const mult = ctx.helper.number(\"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 = ctx.helper.number(\"skill\", _skill);\n const mult = ctx.helper.number(\"mult\", _mult);\n checkFormulasAccess(ctx);\n return calculateExp(skill, mult);\n },\n },\n hacking: {\n hackChance:\n (ctx: NetscriptContext) =>\n (server: any, player: any): number => {\n checkFormulasAccess(ctx);\n return calculateHackingChance(server, player);\n },\n hackExp:\n (ctx: NetscriptContext) =>\n (server: any, player: any): number => {\n checkFormulasAccess(ctx);\n return calculateHackingExpGain(server, player);\n },\n hackPercent:\n (ctx: NetscriptContext) =>\n (server: any, player: any): number => {\n checkFormulasAccess(ctx);\n return calculatePercentMoneyHacked(server, player);\n },\n growPercent:\n (ctx: NetscriptContext) =>\n (server: any, _threads: unknown, player: any, _cores: unknown = 1): number => {\n const threads = ctx.helper.number(\"threads\", _threads);\n const cores = ctx.helper.number(\"cores\", _cores);\n checkFormulasAccess(ctx);\n return calculateServerGrowth(server, threads, player, cores);\n },\n hackTime:\n (ctx: NetscriptContext) =>\n (server: any, player: any): number => {\n checkFormulasAccess(ctx);\n return calculateHackingTime(server, player) * 1000;\n },\n growTime:\n (ctx: NetscriptContext) =>\n (server: any, player: any): number => {\n checkFormulasAccess(ctx);\n return calculateGrowTime(server, player) * 1000;\n },\n weakenTime:\n (ctx: NetscriptContext) =>\n (server: any, player: any): number => {\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 = ctx.helper.number(\"level\", _level);\n const ram = ctx.helper.number(\"ram\", _ram);\n const cores = ctx.helper.number(\"cores\", _cores);\n const mult = ctx.helper.number(\"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 = ctx.helper.number(\"startingLevel\", _startingLevel);\n const extraLevels = ctx.helper.number(\"extraLevels\", _extraLevels);\n const costMult = ctx.helper.number(\"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 = ctx.helper.number(\"startingRam\", _startingRam);\n const extraLevels = ctx.helper.number(\"extraLevels\", _extraLevels);\n const costMult = ctx.helper.number(\"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 = ctx.helper.number(\"startingCore\", _startingCore);\n const extraCores = ctx.helper.number(\"extraCores\", _extraCores);\n const costMult = ctx.helper.number(\"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 = ctx.helper.number(\"n\", _n);\n const mult = ctx.helper.number(\"mult\", _mult);\n checkFormulasAccess(ctx);\n return calculateNodeCost(n, mult);\n },\n constants: (ctx: NetscriptContext) => (): any => {\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 = ctx.helper.number(\"level\", _level);\n const ramUsed = ctx.helper.number(\"ramUsed\", _ramUsed);\n const maxRam = ctx.helper.number(\"maxRam\", _maxRam);\n const cores = ctx.helper.number(\"cores\", _cores);\n const mult = ctx.helper.number(\"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 = ctx.helper.number(\"startingLevel\", _startingLevel);\n const extraLevels = ctx.helper.number(\"extraLevels\", _extraLevels);\n const costMult = ctx.helper.number(\"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 = ctx.helper.number(\"startingRam\", _startingRam);\n const extraLevels = ctx.helper.number(\"extraLevels\", _extraLevels);\n const costMult = ctx.helper.number(\"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 = ctx.helper.number(\"startingCore\", _startingCore);\n const extraCores = ctx.helper.number(\"extraCores\", _extraCores);\n const costMult = ctx.helper.number(\"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 = ctx.helper.number(\"startingCache\", _startingCache);\n const extraCache = ctx.helper.number(\"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 = helper.string(\"hashUpgradeCost\", \"upgName\", _upgName);\n const level = ctx.helper.number(\"level\", _level);\n checkFormulasAccess(ctx);\n const upg = player.hashManager.getUpgrade(upgName);\n if (!upg) {\n throw helper.makeRuntimeErrorMsg(\n \"formulas.hacknetServers.calculateHashUpgradeCost\",\n `Invalid Hash Upgrade: ${upgName}`,\n );\n }\n return upg.getCost(level);\n },\n hacknetServerCost:\n (ctx: NetscriptContext) =>\n (_n: unknown, _mult: unknown = 1): number => {\n const n = ctx.helper.number(\"n\", _n);\n const mult = ctx.helper.number(\"mult\", _mult);\n checkFormulasAccess(ctx);\n return HScalculateServerCost(n, mult);\n },\n constants: (ctx: NetscriptContext) => (): any => {\n checkFormulasAccess(ctx);\n return Object.assign({}, HacknetServerConstants);\n },\n },\n gang: {\n wantedPenalty:\n (ctx: NetscriptContext) =>\n (gang: any): number => {\n checkFormulasAccess(ctx);\n return calculateWantedPenalty(gang);\n },\n respectGain:\n (ctx: NetscriptContext) =>\n (gang: any, member: any, task: any): number => {\n checkFormulasAccess(ctx);\n return calculateRespectGain(gang, member, task);\n },\n wantedLevelGain:\n (ctx: NetscriptContext) =>\n (gang: any, member: any, task: any): number => {\n checkFormulasAccess(ctx);\n return calculateWantedLevelGain(gang, member, task);\n },\n moneyGain:\n (ctx: NetscriptContext) =>\n (gang: any, member: any, task: any): number => {\n checkFormulasAccess(ctx);\n return calculateMoneyGain(gang, member, task);\n },\n ascensionPointsGain:\n (ctx: NetscriptContext) =>\n (_exp: unknown): number => {\n const exp = ctx.helper.number(\"exp\", _exp);\n checkFormulasAccess(ctx);\n return calculateAscensionPointsGain(exp);\n },\n ascensionMultiplier:\n (ctx: NetscriptContext) =>\n (_points: unknown): number => {\n const points = ctx.helper.number(\"points\", _points);\n checkFormulasAccess(ctx);\n return calculateAscensionMult(points);\n },\n },\n };\n}\n","import { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\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 { TIX } from \"../ScriptEditor/NetscriptDefinitions\";\nimport { InternalAPI, NetscriptContext } from \"src/Netscript/APIWrapper\";\n\nexport function NetscriptStockMarket(player: IPlayer, workerScript: WorkerScript): 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 ctx.makeRuntimeErrorMsg(`You don't have WSE Access! Cannot use ${ctx.function}()`);\n }\n if (!player.hasTixApiAccess) {\n throw ctx.makeRuntimeErrorMsg(`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 ctx.makeRuntimeErrorMsg(`Invalid stock symbol: '${symbol}'`);\n }\n\n return stock;\n };\n\n return {\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 = ctx.helper.string(\"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 = ctx.helper.string(\"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 = ctx.helper.string(\"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 = ctx.helper.string(\"symbol\", _symbol);\n checkTixApiAccess(ctx);\n const stock = SymbolToStockMap[symbol];\n if (stock == null) {\n throw ctx.makeRuntimeErrorMsg(`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 = ctx.helper.string(\"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 = ctx.helper.string(\"symbol\", _symbol);\n let shares = ctx.helper.number(\"shares\", _shares);\n const posType = ctx.helper.string(\"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 = ctx.helper.string(\"symbol\", _symbol);\n let shares = ctx.helper.number(\"shares\", _shares);\n const posType = ctx.helper.string(\"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 buy:\n (ctx: NetscriptContext) =>\n (_symbol: unknown, _shares: unknown): number => {\n const symbol = ctx.helper.string(\"symbol\", _symbol);\n const shares = ctx.helper.number(\"shares\", _shares);\n checkTixApiAccess(ctx);\n const stock = getStockFromSymbol(ctx, symbol);\n const res = buyStock(stock, shares, workerScript, {});\n return res ? stock.getAskPrice() : 0;\n },\n sell:\n (ctx: NetscriptContext) =>\n (_symbol: unknown, _shares: unknown): number => {\n const symbol = ctx.helper.string(\"symbol\", _symbol);\n const shares = ctx.helper.number(\"shares\", _shares);\n checkTixApiAccess(ctx);\n const stock = getStockFromSymbol(ctx, symbol);\n const res = sellStock(stock, shares, workerScript, {});\n\n return res ? stock.getBidPrice() : 0;\n },\n short:\n (ctx: NetscriptContext) =>\n (_symbol: unknown, _shares: unknown): number => {\n const symbol = ctx.helper.string(\"symbol\", _symbol);\n const shares = ctx.helper.number(\"shares\", _shares);\n checkTixApiAccess(ctx);\n if (player.bitNodeN !== 8) {\n if (player.sourceFileLvl(8) <= 1) {\n throw ctx.makeRuntimeErrorMsg(\"You must either be in BitNode-8 or you must have Source-File 8 Level 2.\");\n }\n }\n const stock = getStockFromSymbol(ctx, symbol);\n const res = shortStock(stock, shares, workerScript, {});\n\n return res ? stock.getBidPrice() : 0;\n },\n sellShort:\n (ctx: NetscriptContext) =>\n (_symbol: unknown, _shares: unknown): number => {\n const symbol = ctx.helper.string(\"symbol\", _symbol);\n const shares = ctx.helper.number(\"shares\", _shares);\n checkTixApiAccess(ctx);\n if (player.bitNodeN !== 8) {\n if (player.sourceFileLvl(8) <= 1) {\n throw ctx.makeRuntimeErrorMsg(\"You must either be in BitNode-8 or you must have Source-File 8 Level 2.\");\n }\n }\n const stock = getStockFromSymbol(ctx, symbol);\n const res = sellShort(stock, shares, workerScript, {});\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 = ctx.helper.string(\"symbol\", _symbol);\n const shares = ctx.helper.number(\"shares\", _shares);\n const price = ctx.helper.number(\"price\", _price);\n const type = ctx.helper.string(\"type\", _type);\n const pos = ctx.helper.string(\"pos\", _pos);\n checkTixApiAccess(ctx);\n if (player.bitNodeN !== 8) {\n if (player.sourceFileLvl(8) <= 2) {\n throw ctx.makeRuntimeErrorMsg(\"You must either be in BitNode-8 or you must have Source-File 8 Level 3.\");\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 ctx.makeRuntimeErrorMsg(`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 ctx.makeRuntimeErrorMsg(`Invalid position type: ${pos}`);\n }\n\n return placeOrder(stock, shares, price, orderType, orderPos, workerScript);\n },\n cancelOrder:\n (ctx: NetscriptContext) =>\n (_symbol: unknown, _shares: unknown, _price: unknown, _type: unknown, _pos: unknown): boolean => {\n const symbol = ctx.helper.string(\"symbol\", _symbol);\n const shares = ctx.helper.number(\"shares\", _shares);\n const price = ctx.helper.number(\"price\", _price);\n const type = ctx.helper.string(\"type\", _type);\n const pos = ctx.helper.string(\"pos\", _pos);\n checkTixApiAccess(ctx);\n if (player.bitNodeN !== 8) {\n if (player.sourceFileLvl(8) <= 2) {\n throw ctx.makeRuntimeErrorMsg(\"You must either be in BitNode-8 or you must have Source-File 8 Level 3.\");\n }\n }\n const stock = getStockFromSymbol(ctx, symbol);\n if (isNaN(shares) || isNaN(price)) {\n throw ctx.makeRuntimeErrorMsg(`Invalid shares or price. Must be numeric. shares=${shares}, price=${price}`);\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 ctx.makeRuntimeErrorMsg(`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 ctx.makeRuntimeErrorMsg(`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, workerScript);\n },\n getOrders: (ctx: NetscriptContext) => (): any => {\n checkTixApiAccess(ctx);\n if (player.bitNodeN !== 8) {\n if (player.sourceFileLvl(8) <= 2) {\n throw ctx.makeRuntimeErrorMsg(\"You must either be in BitNode-8 or have Source-File 8 Level 3.\");\n }\n }\n\n const orders: any = {};\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 = ctx.helper.string(\"symbol\", _symbol);\n if (!player.has4SDataTixApi) {\n throw ctx.makeRuntimeErrorMsg(\"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 = ctx.helper.string(\"symbol\", _symbol);\n if (!player.has4SDataTixApi) {\n throw ctx.makeRuntimeErrorMsg(\"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 ctx.log(() => \"Already purchased 4S Market Data.\");\n return true;\n }\n\n if (player.money < getStockMarket4SDataCost()) {\n ctx.log(() => \"Not enough money to purchase 4S Market Data.\");\n return false;\n }\n\n player.has4SData = true;\n player.loseMoney(getStockMarket4SDataCost(), \"stock\");\n ctx.log(() => \"Purchased 4S Market Data\");\n return true;\n },\n purchase4SMarketDataTixApi: (ctx: NetscriptContext) => (): boolean => {\n checkTixApiAccess(ctx);\n\n if (player.has4SDataTixApi) {\n ctx.log(() => \"Already purchased 4S Market Data TIX API\");\n return true;\n }\n\n if (player.money < getStockMarket4STixApiCost()) {\n ctx.log(() => \"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 ctx.log(() => \"Purchased 4S Market Data TIX API\");\n return true;\n },\n purchaseWseAccount: (ctx: NetscriptContext) => (): boolean => {\n if (player.hasWseAccount) {\n ctx.log(() => \"Already purchased WSE Account\");\n return true;\n }\n\n if (player.money < getStockMarketWseCost()) {\n ctx.log(() => \"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 ctx.log(() => \"Purchased WSE Account Access\");\n return true;\n },\n purchaseTixApi: (ctx: NetscriptContext) => (): boolean => {\n if (player.hasTixApiAccess) {\n ctx.log(() => \"Already purchased TIX API\");\n return true;\n }\n\n if (player.money < getStockMarketTixApiCost()) {\n ctx.log(() => \"Not enough money to purchase TIX API Access\");\n return false;\n }\n\n player.hasTixApiAccess = true;\n player.loseMoney(getStockMarketTixApiCost(), \"stock\");\n ctx.log(() => \"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 { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { Grafting as IGrafting } from \"../ScriptEditor/NetscriptDefinitions\";\nimport { Router } from \"../ui/GameRoot\";\n\nexport function NetscriptGrafting(player: IPlayer): InternalAPI {\n const checkGraftingAPIAccess = (ctx: NetscriptContext): void => {\n if (!player.canAccessGrafting()) {\n throw ctx.makeRuntimeErrorMsg(\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 = ctx.helper.string(\"augName\", _augName);\n checkGraftingAPIAccess(ctx);\n if (!getGraftingAvailableAugs(player).includes(augName) || !StaticAugmentations.hasOwnProperty(augName)) {\n throw ctx.makeRuntimeErrorMsg(`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 = ctx.helper.string(\"augName\", _augName);\n checkGraftingAPIAccess(ctx);\n if (!getGraftingAvailableAugs(player).includes(augName) || !StaticAugmentations.hasOwnProperty(augName)) {\n throw ctx.makeRuntimeErrorMsg(`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 = ctx.helper.string(\"augName\", _augName);\n const focus = ctx.helper.boolean(_focus);\n checkGraftingAPIAccess(ctx);\n if (player.city !== CityName.NewTokyo) {\n throw ctx.makeRuntimeErrorMsg(\"You must be in New Tokyo to begin grafting an Augmentation.\");\n }\n if (!getGraftingAvailableAugs(player).includes(augName) || !StaticAugmentations.hasOwnProperty(augName)) {\n ctx.log(() => `Invalid aug: ${augName}`);\n return false;\n }\n\n const wasFocusing = player.focus;\n if (player.isWorking) {\n const txt = player.singularityStopWork();\n ctx.log(() => txt);\n }\n\n const craftableAug = new GraftableAugmentation(StaticAugmentations[augName]);\n if (player.money < craftableAug.cost) {\n ctx.log(() => `You don't have enough money to craft ${augName}`);\n return false;\n }\n\n if (!hasAugmentationPrereqs(craftableAug.augmentation)) {\n ctx.log(() => `You don't have the pre-requisites for ${augName}`);\n return false;\n }\n\n player.loseMoney(craftableAug.cost, \"augmentations\");\n player.startGraftAugmentationWork(augName, craftableAug.time);\n\n if (focus) {\n player.startFocusing();\n Router.toWork();\n } else if (wasFocusing) {\n player.stopFocusing();\n Router.toTerminal();\n }\n\n ctx.log(() => `Began grafting Augmentation ${augName}.`);\n return true;\n },\n };\n}\n","import { 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 v1APIBreak(): void {\n interface IFileLine {\n file: string;\n line: number;\n }\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 });\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","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 tutorialScriptName = {\n [Language.None]: \"n00dles.script\",\n [Language.NS1]: \"n00dles.script\",\n [Language.NS2]: \"n00dles.js\",\n }[language];\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 Scripts must end with the .script extension. Let's make a script now by entering \n {`[home ~/]> 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 {\"[home ~/]> free\"}\n \n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalRunScript as number]: {\n content: (\n <>\n \n We have 8GB of free RAM on this machine, which is enough to run our script. Let's run our script using\n \n {`[home ~/]> 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 n00dles.script 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 {`[home ~/]> 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\";\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 as any);\n const canGang = !!(props.player.gang as any);\n const canJob = props.player.companyName !== \"\";\n const canStockMarket = props.player.hasWseAccount;\n const canBladeburner = !!(props.player.bladeburner as any);\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();\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 function handleShortcuts(this: Document, event: KeyboardEvent): any {\n if (Settings.DisableHotkeys) return;\n if ((props.player.isWorking && 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.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 { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { Player } from \"../../Player\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { StaticAugmentations } from \"../StaticAugmentations\";\n\ninterface IAugmentedStats {\n [index: string]: number;\n}\n\nfunction calculateAugmentedStats(): IAugmentedStats {\n const augP: IAugmentedStats = {};\n for (const aug of Player.queuedAugmentations) {\n const augObj = StaticAugmentations[aug.name];\n for (const mult of Object.keys(augObj.mults)) {\n const v = augP[mult] ? augP[mult] : 1;\n augP[mult] = v * augObj.mults[mult];\n }\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.hacking_chance_mult,\n augmented: Player.hacking_chance_mult * mults.hacking_chance_mult,\n },\n {\n mult: \"Hacking Speed\",\n current: Player.hacking_speed_mult,\n augmented: Player.hacking_speed_mult * mults.hacking_speed_mult,\n },\n {\n mult: \"Hacking Money\",\n current: Player.hacking_money_mult,\n augmented: Player.hacking_money_mult * mults.hacking_money_mult,\n bnMult: BitNodeMultipliers.ScriptHackMoney,\n },\n {\n mult: \"Hacking Growth\",\n current: Player.hacking_grow_mult,\n augmented: Player.hacking_grow_mult * mults.hacking_grow_mult,\n },\n {\n mult: \"Hacking Level\",\n current: Player.hacking_mult,\n augmented: Player.hacking_mult * mults.hacking_mult,\n bnMult: BitNodeMultipliers.HackingLevelMultiplier,\n },\n {\n mult: \"Hacking Experience\",\n current: Player.hacking_exp_mult,\n augmented: Player.hacking_exp_mult * mults.hacking_exp_mult,\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.strength_mult,\n augmented: Player.strength_mult * mults.strength_mult,\n bnMult: BitNodeMultipliers.StrengthLevelMultiplier,\n },\n {\n mult: \"Strength Experience\",\n current: Player.strength_exp_mult,\n augmented: Player.strength_exp_mult * mults.strength_exp_mult,\n },\n {\n mult: \"Defense Level\",\n current: Player.defense_mult,\n augmented: Player.defense_mult * mults.defense_mult,\n bnMult: BitNodeMultipliers.DefenseLevelMultiplier,\n },\n {\n mult: \"Defense Experience\",\n current: Player.defense_exp_mult,\n augmented: Player.defense_exp_mult * mults.defense_exp_mult,\n },\n {\n mult: \"Dexterity Level\",\n current: Player.dexterity_mult,\n augmented: Player.dexterity_mult * mults.dexterity_mult,\n bnMult: BitNodeMultipliers.DexterityLevelMultiplier,\n },\n {\n mult: \"Dexterity Experience\",\n current: Player.dexterity_exp_mult,\n augmented: Player.dexterity_exp_mult * mults.dexterity_exp_mult,\n },\n {\n mult: \"Agility Level\",\n current: Player.agility_mult,\n augmented: Player.agility_mult * mults.agility_mult,\n bnMult: BitNodeMultipliers.AgilityLevelMultiplier,\n },\n {\n mult: \"Agility Experience\",\n current: Player.agility_exp_mult,\n augmented: Player.agility_exp_mult * mults.agility_exp_mult,\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.charisma_mult,\n augmented: Player.charisma_mult * mults.charisma_mult,\n bnMult: BitNodeMultipliers.CharismaLevelMultiplier,\n color: Settings.theme.cha,\n },\n {\n mult: \"Charisma Experience\",\n current: Player.charisma_exp_mult,\n augmented: Player.charisma_exp_mult * mults.charisma_exp_mult,\n color: Settings.theme.cha,\n },\n ];\n const rightColData: MultiplierListItemData[] = [\n {\n mult: \"Hacknet Node Production\",\n current: Player.hacknet_node_money_mult,\n augmented: Player.hacknet_node_money_mult * mults.hacknet_node_money_mult,\n bnMult: BitNodeMultipliers.HacknetNodeMoney,\n },\n {\n mult: \"Hacknet Node Purchase Cost\",\n current: Player.hacknet_node_purchase_cost_mult,\n augmented: Player.hacknet_node_purchase_cost_mult * mults.hacknet_node_purchase_cost_mult,\n },\n {\n mult: \"Hacknet Node RAM Upgrade Cost\",\n current: Player.hacknet_node_ram_cost_mult,\n augmented: Player.hacknet_node_ram_cost_mult * mults.hacknet_node_ram_cost_mult,\n },\n {\n mult: \"Hacknet Node Core Purchase Cost\",\n current: Player.hacknet_node_core_cost_mult,\n augmented: Player.hacknet_node_core_cost_mult * mults.hacknet_node_core_cost_mult,\n },\n {\n mult: \"Hacknet Node Level Upgrade Cost\",\n current: Player.hacknet_node_level_cost_mult,\n augmented: Player.hacknet_node_level_cost_mult * mults.hacknet_node_level_cost_mult,\n },\n {\n mult: \"Company Reputation Gain\",\n current: Player.company_rep_mult,\n augmented: Player.company_rep_mult * mults.company_rep_mult,\n },\n {\n mult: \"Faction Reputation Gain\",\n current: Player.faction_rep_mult,\n augmented: Player.faction_rep_mult * mults.faction_rep_mult,\n bnMult: BitNodeMultipliers.FactionWorkRepGain,\n },\n {\n mult: \"Salary\",\n current: Player.work_money_mult,\n augmented: Player.work_money_mult * mults.work_money_mult,\n bnMult: BitNodeMultipliers.CompanyWorkMoney,\n color: Settings.theme.money,\n },\n {\n mult: \"Crime Success Chance\",\n current: Player.crime_success_mult,\n augmented: Player.crime_success_mult * mults.crime_success_mult,\n color: Settings.theme.combat,\n },\n {\n mult: \"Crime Money\",\n current: Player.crime_money_mult,\n augmented: Player.crime_money_mult * mults.crime_money_mult,\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.bladeburner_success_chance_mult,\n augmented: Player.bladeburner_success_chance_mult * mults.bladeburner_success_chance_mult,\n },\n {\n mult: \"Bladeburner Max Stamina\",\n current: Player.bladeburner_max_stamina_mult,\n augmented: Player.bladeburner_max_stamina_mult * mults.bladeburner_max_stamina_mult,\n },\n {\n mult: \"Bladeburner Stamina Gain\",\n current: Player.bladeburner_stamina_gain_mult,\n augmented: Player.bladeburner_stamina_gain_mult * mults.bladeburner_stamina_gain_mult,\n },\n {\n mult: \"Bladeburner Field Analysis\",\n current: Player.bladeburner_analysis_mult,\n augmented: Player.bladeburner_analysis_mult * mults.bladeburner_analysis_mult,\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.hacking_exp = 0;\n props.player.strength_exp = 0;\n props.player.defense_exp = 0;\n props.player.dexterity_exp = 0;\n props.player.agility_exp = 0;\n props.player.charisma_exp = 0;\n props.player.intelligence_exp = 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.hacking_exp = 0;\n break;\n case \"strength\":\n props.player.strength_exp = 0;\n break;\n case \"defense\":\n props.player.defense_exp = 0;\n break;\n case \"dexterity\":\n props.player.dexterity_exp = 0;\n break;\n case \"agility\":\n props.player.agility_exp = 0;\n break;\n case \"charisma\":\n props.player.charisma_exp = 0;\n break;\n case \"intelligence\":\n props.player.intelligence_exp = 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.intelligence === 0) {\n props.player.intelligence = 1;\n props.player.updateSkillLevels();\n }\n }\n\n function disableIntelligence(): void {\n props.player.intelligence_exp = 0;\n props.player.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 (ex: any) {\n SnackbarEvents.emit(ex.toString(), 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 console.log(Object.keys(save));\n // TODO: Continue here.\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.bladeburner_success_chance_mult * 100, 1)}%\n
\n Aug. Max Stamina mult: {formatNumber(props.player.bladeburner_max_stamina_mult * 100, 1)}%\n
\n Aug. Stamina Gain mult: {formatNumber(props.player.bladeburner_stamina_gain_mult * 100, 1)}%\n
\n Aug. Field Analysis mult: {formatNumber(props.player.bladeburner_analysis_mult * 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: any;\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: any, 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 React from \"react\";\n\ninterface IContract {\n desc: JSX.Element;\n}\n\nexport const GeneralActions: {\n [key: string]: IContract | 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 },\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 },\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 },\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 },\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 },\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 },\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\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n}\n\nexport function BlackOpPage(props: IProps): React.ReactElement {\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 \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 Synthoid, 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 they believe someone has triggered this malfunction in\n a 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: any): boolean {\n return mult && 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\";\n\ninterface IProps {\n skill: any;\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\";\n\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 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\nfunction countEmployee(employees: Employee[], job: string): number {\n let n = 0;\n for (let i = 0; i < employees.length; ++i) {\n if (employees[i].pos === job) n++;\n }\n return n;\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.pos === positionNames[i]) {\n employeePositionSelectorInitialValue = positionNames[i];\n }\n }\n\n function employeePositionSelectorOnChange(e: SelectChangeEvent): void {\n if (employee === null) return;\n employee.pos = 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 AutoAssignJob(props: IAutoAssignProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const numJob = countEmployee(props.office.employees, props.job);\n const numUnassigned = countEmployee(props.office.employees, EmployeePositions.Unassigned);\n function assignEmployee(): void {\n if (numUnassigned <= 0) {\n console.warn(\"Cannot assign employee. No unassigned employees available\");\n return;\n }\n\n props.office.assignEmployeeToJob(props.job);\n props.office.calculateEmployeeProductivity(corp, division);\n props.rerender();\n }\n\n function unassignEmployee(): void {\n props.office.unassignEmployeeFromJob(props.job);\n props.office.calculateEmployeeProductivity(corp, division);\n props.rerender();\n }\n return (\n \n \n \n \n {props.job} ({numJob})\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 numUnassigned = countEmployee(props.office.employees, EmployeePositions.Unassigned);\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 return (\n <>\n \n \n \n \n Unassigned Employees:\n \n \n {numUnassigned}\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\n from upgrades and materials. This value is based off the productivity of your Operations,\n Engineering, 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 \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(\"AutoPartyManager\") && (\n <>\n Throw an office party to increase your employee's morale and happiness}\n >\n \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 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 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 { OfficeSpace } from \"../OfficeSpace\";\nimport { Industries } from \"../IndustryData\";\nimport { IndustryUpgrades } from \"../IndustryUpgrades\";\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}\nfunction Text(): 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.format(totalAdvertisingFac, \"0.000\")}\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.format(division.prodMult, \"0.00\")}\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 \n Scientific Research increases the quality of the materials and products that you produce.\n \n }\n >\n Scientific Research: {numeralWrapper.format(division.sciResearch.qty, \"0.000a\")}\n \n \n setResearchOpen(false)} industry={division} />\n \n \n );\n}\n\nfunction Upgrades(props: { office: OfficeSpace; rerender: () => void }): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const upgrades = [];\n for (const index of Object.keys(IndustryUpgrades)) {\n const upgrade = IndustryUpgrades[index];\n\n // AutoBrew research disables the Coffee upgrade\n if (division.hasResearch(\"AutoBrew\") && upgrade[4] === \"Coffee\") {\n continue;\n }\n\n const i = upgrade[0];\n const baseCost = upgrade[1];\n const priceMult = upgrade[2];\n let cost = 0;\n switch (i) {\n case 0: //Coffee, cost is static per employee\n cost = props.office.employees.length * baseCost;\n break;\n default:\n cost = baseCost * Math.pow(priceMult, division.upgrades[i]);\n break;\n }\n\n function onClick(): void {\n if (corp.funds < cost) return;\n corp.funds = corp.funds - cost;\n division.upgrade(upgrade, {\n corporation: corp,\n office: props.office,\n });\n props.rerender();\n }\n\n upgrades.push(\n \n \n \n \n ,\n );\n }\n\n return <>{upgrades};\n}\n\ninterface IProps {\n currentCity: string;\n office: OfficeSpace;\n rerender: () => void;\n}\n\nexport function IndustryOverview(props: IProps): React.ReactElement {\n const division = useDivision();\n\n return (\n \n \n
\n Purchases & Upgrades\n
\n {division.makesProducts && }\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\";\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(null);\n const [marketing, setMarketing] = useState(null);\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 (design === null || marketing === null) 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 onDesignChange(event: React.ChangeEvent): void {\n if (event.target.value === \"\") setDesign(null);\n else setDesign(parseFloat(event.target.value));\n }\n\n function onMarketingChange(event: React.ChangeEvent): void {\n if (event.target.value === \"\") setMarketing(null);\n else setMarketing(parseFloat(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: any[][] = [];\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.dividendPercentage <= 0 || profit <= 0) return <>;\n const totalDividends = (corp.dividendPercentage / 100) * profit;\n const retainedEarnings = profit - totalDividends;\n const dividendsPerShare = totalDividends / corp.totalShares;\n return (\n ],\n [\"Dividend Percentage:\", numeralWrapper.format(corp.dividendPercentage / 100, \"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 TextField from \"@mui/material/TextField\";\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(0);\n const [stock, setStock] = useState(0);\n const [selectedFaction, setSelectedFaction] = useState(factions.length > 0 ? factions[0] : \"\");\n const disabled =\n money === null ||\n stock === null ||\n (money === 0 && stock === 0) ||\n isNaN(money) ||\n isNaN(stock) ||\n money < 0 ||\n stock < 0 ||\n corp.funds < money ||\n stock > corp.numShares;\n\n function onMoneyChange(event: React.ChangeEvent): void {\n setMoney(parseFloat(event.target.value));\n }\n\n function onStockChange(event: React.ChangeEvent): void {\n setStock(parseFloat(event.target.value));\n }\n\n function changeFaction(event: SelectChangeEvent): void {\n setSelectedFaction(event.target.value);\n }\n\n function repGain(money: number, stock: number): number {\n return (money + stock * corp.sharePrice) / CorporationConstants.BribeToRepRatio;\n }\n\n function getRepText(money: number, stock: number): string {\n if (money === 0 && stock === 0) return \"\";\n if (isNaN(money) || isNaN(stock) || money < 0 || stock < 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 if (stock > corp.numShares) {\n return \"ERROR: You do not have this many shares to bribe with\";\n } else {\n return (\n \"You will gain \" +\n numeralWrapper.formatReputation(repGain(money, stock)) +\n \" reputation with \" +\n selectedFaction +\n \" with this bribe\"\n );\n }\n }\n\n function bribe(money: number, stock: number): void {\n const fac = Factions[selectedFaction];\n if (disabled) return;\n const rep = repGain(money, stock);\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 corp.numShares -= stock;\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, stock ? stock : 0)}\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 { use } from \"../../../ui/Context\";\nimport { useCorporation } from \"../Context\";\nimport { ICorporation } from \"../../ICorporation\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\nimport { Money } from \"../../../ui/React/Money\";\nimport { SellShares } from \"../../Actions\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\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(null);\n\n const disabled = shares === null || isNaN(shares) || shares <= 0 || shares > corp.numShares;\n\n function changeShares(event: React.ChangeEvent): void {\n if (event.target.value === \"\") setShares(null);\n else setShares(Math.round(parseFloat(event.target.value)));\n }\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 TextField from \"@mui/material/TextField\";\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(null);\n\n function changeShares(event: React.ChangeEvent): void {\n if (event.target.value === \"\") setShares(null);\n else setShares(Math.round(parseFloat(event.target.value)));\n }\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.DividendMaxPercentage * 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 TextField from \"@mui/material/TextField\";\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(null);\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 = shares === null || isNaN(newShares) || newShares < 10e6 || newShares > maxNewShares;\n\n function issueNewShares(): void {\n if (shares === null) 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 corp.totalShares += newShares;\n\n // Determine how many are bought by private investors\n // Private investors get up to 50% at most\n // Round # of private shares to the nearest millionth\n let privateShares = getRandomInt(0, Math.round(newShares / 2));\n privateShares = Math.round(privateShares / 1e6) * 1e6;\n\n corp.issuedShares += newShares - privateShares;\n corp.funds = corp.funds + profit;\n corp.immediatelyUpdateSharePrice();\n props.onClose();\n dialogBoxCreate(\n `Issued ${numeralWrapper.format(newShares, \"0.000a\")} and raised ` +\n `${numeralWrapper.formatMoney(profit)}. ${numeralWrapper.format(privateShares, \"0.000a\")} ` +\n `of these shares were bought by private investors.

` +\n `Stock price decreased to ${numeralWrapper.formatMoney(corp.sharePrice)}`,\n );\n }\n\n function onKeyDown(event: React.KeyboardEvent): void {\n if (event.key === KEY.ENTER) issueNewShares();\n }\n\n function onChange(event: React.ChangeEvent): void {\n if (event.target.value === \"\") setShares(null);\n else setShares(parseFloat(event.target.value));\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 50% of the new shares.\n If they choose to exercise this option, these newly issued shares become private, restricted shares, which means\n 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 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 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(\"\");\n const initialSharePrice = corp.determineValuation() / corp.totalShares;\n\n function goPublic(): void {\n const numShares = parseFloat(shares);\n const initialSharePrice = corp.determineValuation() / corp.totalShares;\n if (isNaN(numShares)) {\n dialogBoxCreate(\"Invalid value for number of issued shares\");\n return;\n }\n if (numShares > 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 = numShares;\n corp.numShares -= numShares;\n corp.addFunds(numShares * initialSharePrice);\n props.rerender();\n dialogBoxCreate(\n `You took your ${corp.name} public and earned ` +\n `${numeralWrapper.formatMoney(numShares * 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 function onChange(event: React.ChangeEvent): void {\n setShares(event.target.value);\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 corp.numShares}\n sx={{ mx: 1 }}\n onClick={goPublic}\n >\n Go Public\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\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 \"based\",\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: any = {\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 { 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 { 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 { IMap } from \"../../../types\";\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\nconst GraftableAugmentations: IMap = {};\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 for (const aug of Object.values(StaticAugmentations)) {\n const name = aug.name;\n const graftableAug = new GraftableAugmentation(aug);\n GraftableAugmentations[name] = graftableAug;\n }\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 const graftableAug = GraftableAugmentations[selectedAug];\n player.loseMoney(graftableAug.cost, \"augmentations\");\n player.startGraftAugmentationWork(selectedAug, graftableAug.time);\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 { 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 { Factions } from \"../Faction/Factions\";\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 { WorkType, ClassType } from \"../utils/WorkType\";\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\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 const expGains = [\n player.workHackExpGained > 0 ? (\n \n ) : (\n <>\n ),\n player.workStrExpGained > 0 ? (\n \n ) : (\n <>\n ),\n player.workDefExpGained > 0 ? (\n \n ) : (\n <>\n ),\n player.workDexExpGained > 0 ? (\n \n ) : (\n <>\n ),\n player.workAgiExpGained > 0 ? (\n \n ) : (\n <>\n ),\n player.workChaExpGained > 0 ? (\n \n ) : (\n <>\n ),\n ];\n\n let workInfo: IWorkInfo | null;\n\n switch (player.workType) {\n case WorkType.Faction: {\n const faction = Factions[player.currentWorkFactionName];\n if (!faction) {\n workInfo = {\n buttons: {\n cancel: () => router.toFactions(),\n },\n title:\n `You have not joined ${player.currentWorkFactionName || \"(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.finishFactionWork(true);\n }\n function unfocus(): void {\n router.toFaction(faction);\n player.stopFocusing();\n }\n\n workInfo = {\n buttons: {\n cancel: cancel,\n unfocus: unfocus,\n },\n title: (\n <>\n You are currently {player.currentWorkFactionDescription} for your faction {faction.name}\n \n ),\n\n description: (\n <>\n Current Faction Reputation: \n \n ),\n gains: [\n player.workMoneyGained > 0 ? (\n \n \n (\n )\n \n \n ) : (\n <>\n ),\n \n \n (\n )\n \n ,\n ...expGains,\n ],\n progress: {\n elapsed: player.timeWorked,\n },\n\n stopText: \"Stop Faction work\",\n };\n\n break;\n }\n\n case WorkType.StudyClass: {\n const className = player.className;\n function cancel(): void {\n player.finishClass(true);\n router.toCity();\n }\n\n function unfocus(): void {\n router.toCity();\n player.stopFocusing();\n }\n\n let stopText = \"\";\n if (\n className === ClassType.GymStrength ||\n className === ClassType.GymDefense ||\n className === ClassType.GymDexterity ||\n className === ClassType.GymAgility\n ) {\n stopText = \"Stop training at gym\";\n } else {\n stopText = \"Stop taking course\";\n }\n\n workInfo = {\n buttons: {\n cancel: cancel,\n unfocus: unfocus,\n },\n title: (\n <>\n You are currently {className}\n \n ),\n\n gains: [\n \n \n (\n )\n \n ,\n ...expGains,\n ],\n progress: {\n elapsed: player.timeWorked,\n },\n\n stopText: stopText,\n };\n\n break;\n }\n\n case WorkType.Company: {\n const comp = Companies[player.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.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();\n }\n function unfocus(): void {\n player.stopFocusing();\n router.toJob();\n }\n\n const position = player.jobs[player.companyName];\n\n const penalty = player.cancelationPenalty();\n\n const penaltyString = penalty === 0.5 ? \"half\" : \"three-quarters\";\n\n workInfo = {\n buttons: {\n cancel: cancel,\n unfocus: unfocus,\n },\n title: (\n <>\n You are currently working as a {position} at {player.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 ,\n ...expGains,\n ],\n progress: {\n elapsed: player.timeWorked,\n },\n\n stopText: \"Stop working\",\n stopTooltip:\n \"You will automatically finish after working for 8 hours. You can cancel earlier if you wish\" +\n ` but you will only gain ${penaltyString} of the reputation you've earned so far.`,\n };\n\n break;\n }\n\n case WorkType.CompanyPartTime: {\n function cancel(): void {\n player.finishWorkPartTime(true);\n router.toJob();\n }\n function unfocus(): void {\n player.stopFocusing();\n router.toJob();\n }\n const comp = Companies[player.companyName];\n let companyRep = 0;\n if (comp == null || !(comp instanceof Company)) {\n throw new Error(`Could not find Company: ${player.companyName}`);\n }\n companyRep = comp.playerReputation;\n\n const position = player.jobs[player.companyName];\n\n workInfo = {\n buttons: {\n cancel: cancel,\n unfocus: unfocus,\n },\n title: (\n <>\n You are currently working as a {position} at {player.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 ,\n ...expGains,\n ],\n progress: {\n elapsed: player.timeWorked,\n },\n\n stopText: \"Stop working\",\n stopTooltip:\n \"You will automatically finish after working for 8 hours. You can cancel earlier if you wish\" +\n \" and there will be no penalty because this is a part-time job.\",\n };\n\n break;\n }\n\n case WorkType.Crime: {\n const completion = Math.round((player.timeWorked / player.timeNeededToCompleteWork) * 100);\n\n workInfo = {\n buttons: {\n cancel: () => {\n router.toLocation(Locations[LocationName.Slums]);\n player.finishCrime(true);\n },\n },\n title: `You are attempting to ${player.crimeType}`,\n\n progress: {\n remaining: player.timeNeededToCompleteWork - player.timeWorked,\n percentage: completion,\n },\n\n stopText: \"Cancel crime\",\n };\n\n break;\n }\n\n case WorkType.CreateProgram: {\n function cancel(): void {\n player.finishCreateProgramWork(true);\n router.toTerminal();\n }\n function unfocus(): void {\n router.toTerminal();\n player.stopFocusing();\n }\n\n const completion = (player.timeWorkedCreateProgram / player.timeNeededToCompleteWork) * 100;\n\n workInfo = {\n buttons: {\n cancel: cancel,\n unfocus: unfocus,\n },\n title: (\n <>\n You are currently working on coding {player.createProgramName}\n \n ),\n\n progress: {\n elapsed: player.timeWorked,\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 break;\n }\n\n case WorkType.GraftAugmentation: {\n function cancel(): void {\n player.finishGraftAugmentationWork(true);\n router.toTerminal();\n }\n function unfocus(): void {\n router.toTerminal();\n player.stopFocusing();\n }\n\n const completion = (player.timeWorkedGraftAugmentation / player.timeNeededToCompleteWork) * 100;\n\n workInfo = {\n buttons: {\n cancel: cancel,\n unfocus: unfocus,\n },\n title: (\n <>\n You are currently working on grafting {player.graftAugmentationName}\n \n ),\n\n progress: {\n elapsed: player.timeWorked,\n percentage: completion,\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 break;\n }\n\n default:\n router.toTerminal();\n workInfo = null;\n }\n\n if (workInfo === null) {\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 { CurrentOptionsPage } from \"./CurrentOptionsPage\";\nimport { GameOptionsSidebar } from \"./GameOptionsSidebar\";\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 setCurrentTab(tab)}\n player={props.player}\n router={props.router}\n save={props.save}\n export={props.export}\n forceKill={props.forceKill}\n softReset={props.softReset}\n />\n \n \n \n );\n}\n","import { MenuItem, Select, SelectChangeEvent, TextField, Tooltip, Typography } from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { OptionSwitch } from \"../../ui/React/OptionSwitch\";\nimport { formatTime } from \"../../utils/helpers/formatTime\";\nimport { GameOptionsTab } from \"../GameOptionsTab\";\nimport { GameOptionsPage } from \"./GameOptionsPage\";\nimport { OptionsSlider } from \"./OptionsSlider\";\n\ninterface IProps {\n currentTab: GameOptionsTab;\n player: IPlayer;\n}\n\nexport const CurrentOptionsPage = (props: IProps): 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 const [timestampFormat, setTimestampFormat] = useState(Settings.TimestampsFormat);\n const [locale, setLocale] = useState(Settings.Locale);\n\n function handleExecTimeChange(event: any, newValue: number | number[]): void {\n setExecTime(newValue as number);\n Settings.CodeInstructionRunTime = newValue as number;\n }\n\n function handleRecentScriptsSizeChange(event: any, newValue: number | number[]): void {\n setRecentScriptsSize(newValue as number);\n Settings.MaxRecentScriptsCapacity = newValue as number;\n }\n\n function handleLogSizeChange(event: any, newValue: number | number[]): void {\n setLogSize(newValue as number);\n Settings.MaxLogCapacity = newValue as number;\n }\n\n function handlePortSizeChange(event: any, newValue: number | number[]): void {\n setPortSize(newValue as number);\n Settings.MaxPortCapacity = newValue as number;\n }\n\n function handleTerminalSizeChange(event: any, newValue: number | number[]): void {\n setTerminalSize(newValue as number);\n Settings.MaxTerminalCapacity = newValue as number;\n }\n\n function handleAutosaveIntervalChange(event: any, newValue: number | number[]): void {\n setAutosaveInterval(newValue as number);\n Settings.AutosaveInterval = newValue as number;\n }\n\n function handleLocaleChange(event: SelectChangeEvent): void {\n setLocale(event.target.value);\n Settings.Locale = event.target.value;\n }\n\n function handleTimestampFormatChange(event: React.ChangeEvent): void {\n setTimestampFormat(event.target.value);\n Settings.TimestampsFormat = event.target.value;\n }\n\n const pages = {\n [GameOptionsTab.SYSTEM]: (\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\n can result in poor performance if you have many scripts running.\n \n }\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 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\n lagging a lot. You'll have to restart your script every time you launch the game.\n \n }\n />\n \n ),\n [GameOptionsTab.INTERFACE]: (\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 Sets the locale for displaying numbers.}>\n Locale\n \n \n \n \n ),\n [GameOptionsTab.GAMEPLAY]: (\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 {props.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 [GameOptionsTab.MISC]: (\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\n return pages[props.currentTab];\n};\n","import {\n BugReport,\n Chat,\n Download,\n LibraryBooks,\n Palette,\n Public,\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 (ex: any) {\n SnackbarEvents.emit(ex.toString(), 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 (ex: any) {\n SnackbarEvents.emit(ex.toString(), 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 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 href=\"https://plaza.dsolver.ca/games/bitburner\"\n target=\"_blank\"\n sx={{ gridArea: \"plaza\" }}\n >\n Incremental game plaza\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 as any }, error)}\n />\n
    \n update({ ...customStyle, lineHeight: value as any }, 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: any) => {\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, { 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 { CONSTANTS } from \"../../../Constants\";\nimport { Crimes } from \"../../../Crime/Crimes\";\nimport { FactionWorkType } from \"../../../Faction/FactionWorkTypeEnum\";\nimport { use } from \"../../../ui/Context\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { ProgressBar } from \"../../../ui/React/Progress\";\nimport { Sleeve } from \"../Sleeve\";\nimport { SleeveTaskType } from \"../SleeveTaskTypesEnum\";\nimport { MoreEarningsModal } from \"./MoreEarningsModal\";\nimport { MoreStatsModal } from \"./MoreStatsModal\";\nimport { SleeveAugmentationsModal } from \"./SleeveAugmentationsModal\";\nimport { EarningsElement, StatsElement } from \"./StatsElement\";\nimport { TaskSelector } from \"./TaskSelector\";\nimport { TravelModal } from \"./TravelModal\";\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 [earningsOpen, setEarningsOpen] = 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 props.sleeve.resetTaskStatus(player); // sets to idle\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 = <>;\n switch (props.sleeve.currentTask) {\n case SleeveTaskType.Idle:\n desc = <>This sleeve is currently idle;\n break;\n case SleeveTaskType.Company:\n desc = <>This sleeve is currently working your job at {props.sleeve.currentTaskLocation}.;\n break;\n case SleeveTaskType.Faction: {\n let doing = \"nothing\";\n switch (props.sleeve.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.currentTaskLocation}.\n \n );\n break;\n }\n case SleeveTaskType.Crime: {\n const crime = Object.values(Crimes).find((crime) => crime.name === props.sleeve.crimeType);\n if (!crime) throw new Error(\"crime should not be undefined\");\n desc = (\n <>\n This sleeve is currently attempting to {crime.type} (Success Rate:{\" \"}\n {numeralWrapper.formatPercentage(crime.successRate(props.sleeve))}).\n \n );\n break;\n }\n case SleeveTaskType.Class:\n desc = <>This sleeve is currently studying/taking a course at {props.sleeve.currentTaskLocation}.;\n break;\n case SleeveTaskType.Gym:\n desc = <>This sleeve is currently working out at {props.sleeve.currentTaskLocation}.;\n break;\n case SleeveTaskType.Bladeburner: {\n let message = \"\";\n if (props.sleeve.bbContract !== \"------\") {\n message = ` - ${props.sleeve.bbContract} (Success Rate: ${props.sleeve.currentTaskLocation})`;\n } else if (props.sleeve.currentTaskLocation !== \"\") {\n message = props.sleeve.currentTaskLocation;\n }\n desc = (\n <>\n This sleeve is currently attempting to {props.sleeve.bbAction}. {message}\n \n );\n break;\n }\n case SleeveTaskType.Recovery:\n desc = (\n <>\n This sleeve is currently set to focus on shock recovery. This causes the Sleeve's shock to decrease at a\n faster rate.\n \n );\n break;\n case SleeveTaskType.Synchro:\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 break;\n default:\n console.error(`Invalid/Unrecognized taskValue in updateSleeveTaskDescription(): ${abc[0]}`);\n }\n\n return (\n <>\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 {(props.sleeve.currentTask === SleeveTaskType.Crime ||\n props.sleeve.currentTask === SleeveTaskType.Bladeburner) &&\n props.sleeve.currentTaskMaxTime > 0 && (\n \n )}\n \n \n \n setStatsOpen(false)} sleeve={props.sleeve} />\n setEarningsOpen(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 { Money } from \"../../../ui/React/Money\";\nimport * as React from \"react\";\nimport { StatsTable } from \"../../../ui/React/StatsTable\";\nimport { Modal } from \"../../../ui/React/Modal\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n sleeve: Sleeve;\n}\n\nexport function MoreEarningsModal(props: IProps): React.ReactElement {\n return (\n \n ],\n [\"Hacking Exp \", numeralWrapper.formatExp(props.sleeve.earningsForTask.hack)],\n [\"Strength Exp \", numeralWrapper.formatExp(props.sleeve.earningsForTask.str)],\n [\"Defense Exp \", numeralWrapper.formatExp(props.sleeve.earningsForTask.def)],\n [\"Dexterity Exp \", numeralWrapper.formatExp(props.sleeve.earningsForTask.dex)],\n [\"Agility Exp \", numeralWrapper.formatExp(props.sleeve.earningsForTask.agi)],\n [\"Charisma Exp \", numeralWrapper.formatExp(props.sleeve.earningsForTask.cha)],\n ]}\n title=\"Earnings for Current Task:\"\n />\n
    \n ],\n [\"Hacking Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForPlayer.hack)],\n [\"Strength Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForPlayer.str)],\n [\"Defense Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForPlayer.def)],\n [\"Dexterity Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForPlayer.dex)],\n [\"Agility Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForPlayer.agi)],\n [\"Charisma Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForPlayer.cha)],\n ]}\n title=\"Total Earnings for Host Consciousness:\"\n />\n
    \n ],\n [\"Hacking Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForSleeves.hack)],\n [\"Strength Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForSleeves.str)],\n [\"Defense Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForSleeves.def)],\n [\"Dexterity Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForSleeves.dex)],\n [\"Agility Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForSleeves.agi)],\n [\"Charisma Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForSleeves.cha)],\n ]}\n title=\"Total Earnings for Other Sleeves:\"\n />\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.hacking,\n <> ({numeralWrapper.formatExp(props.sleeve.hacking_exp)} exp),\n ],\n [\n <>Strength: ,\n props.sleeve.strength,\n <> ({numeralWrapper.formatExp(props.sleeve.strength_exp)} exp),\n ],\n [\n <>Defense: ,\n props.sleeve.defense,\n <> ({numeralWrapper.formatExp(props.sleeve.defense_exp)} exp),\n ],\n [\n <>Dexterity: ,\n props.sleeve.dexterity,\n <> ({numeralWrapper.formatExp(props.sleeve.dexterity_exp)} exp),\n ],\n [\n <>Agility: ,\n props.sleeve.agility,\n <> ({numeralWrapper.formatExp(props.sleeve.agility_exp)} exp),\n ],\n [\n <>Charisma: ,\n props.sleeve.charisma,\n <> ({numeralWrapper.formatExp(props.sleeve.charisma_exp)} exp),\n ],\n ]}\n title=\"Stats:\"\n />\n
    \n Hacking Level multiplier: , numeralWrapper.formatPercentage(props.sleeve.hacking_mult)],\n [<>Hacking Experience multiplier: , numeralWrapper.formatPercentage(props.sleeve.hacking_exp_mult)],\n [<>Strength Level multiplier: , numeralWrapper.formatPercentage(props.sleeve.strength_mult)],\n [<>Strength Experience multiplier: , numeralWrapper.formatPercentage(props.sleeve.strength_exp_mult)],\n [<>Defense Level multiplier: , numeralWrapper.formatPercentage(props.sleeve.defense_mult)],\n [<>Defense Experience multiplier: , numeralWrapper.formatPercentage(props.sleeve.defense_exp_mult)],\n [<>Dexterity Level multiplier: , numeralWrapper.formatPercentage(props.sleeve.dexterity_mult)],\n [\n <>Dexterity Experience multiplier: ,\n numeralWrapper.formatPercentage(props.sleeve.dexterity_exp_mult),\n ],\n [<>Agility Level multiplier: , numeralWrapper.formatPercentage(props.sleeve.agility_mult)],\n [<>Agility Experience multiplier: , numeralWrapper.formatPercentage(props.sleeve.agility_exp_mult)],\n [<>Charisma Level multiplier: , numeralWrapper.formatPercentage(props.sleeve.charisma_mult)],\n [<>Charisma Experience multiplier: , numeralWrapper.formatPercentage(props.sleeve.charisma_exp_mult)],\n [\n <>Faction Reputation Gain multiplier: ,\n numeralWrapper.formatPercentage(props.sleeve.faction_rep_mult),\n ],\n [\n <>Company Reputation Gain multiplier: ,\n numeralWrapper.formatPercentage(props.sleeve.company_rep_mult),\n ],\n [<>Salary multiplier: , numeralWrapper.formatPercentage(props.sleeve.work_money_mult)],\n [<>Crime Money multiplier: , numeralWrapper.formatPercentage(props.sleeve.crime_money_mult)],\n [<>Crime Success multiplier: , numeralWrapper.formatPercentage(props.sleeve.crime_success_mult)],\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, _showModal) => {\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 { SleeveTaskType } from \"../SleeveTaskTypesEnum\";\nimport { Crimes } from \"../../../Crime/Crimes\";\nimport { LocationName } from \"../../../Locations/data/LocationNames\";\nimport { CityName } from \"../../../Locations/data/CityNames\";\nimport { Factions } from \"../../../Faction/Factions\";\nimport { FactionWorkType } from \"../../../Faction/FactionWorkTypeEnum\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport { FactionNames } from \"../../../Faction/data/FactionNames\";\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 = [];\n for (const otherSleeve of player.sleeves) {\n if (sleeve === otherSleeve) {\n continue;\n }\n if (otherSleeve.currentTask === SleeveTaskType.Company) {\n forbiddenCompanies.push(otherSleeve.currentTaskLocation);\n }\n }\n const allJobs: string[] = Object.keys(player.jobs);\n for (let i = 0; i < allJobs.length; ++i) {\n if (!forbiddenCompanies.includes(allJobs[i])) {\n allJobs[i];\n }\n }\n\n return allJobs;\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 (otherSleeve.currentTask === SleeveTaskType.Faction) {\n forbiddenFactions.push(otherSleeve.currentTaskLocation);\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 (otherSleeve.currentTask === SleeveTaskType.Bladeburner && otherSleeve.bbAction == \"Take on contracts\") {\n contracts = contracts.filter((x) => x != otherSleeve.bbContract);\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, _: Sleeve) => 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 switch (sleeve.currentTask) {\n case SleeveTaskType.Idle:\n return [\"------\", \"------\", \"------\"];\n case SleeveTaskType.Company:\n return [\"Work for Company\", sleeve.currentTaskLocation, \"------\"];\n case SleeveTaskType.Faction: {\n let workType = \"\";\n switch (sleeve.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\", sleeve.currentTaskLocation, workType];\n }\n case SleeveTaskType.Crime:\n return [\"Commit Crime\", sleeve.crimeType, \"------\"];\n case SleeveTaskType.Class:\n return [\"Take University Course\", sleeve.className, sleeve.currentTaskLocation];\n case SleeveTaskType.Gym:\n return [\"Workout at Gym\", sleeve.gymStatType, sleeve.currentTaskLocation];\n case SleeveTaskType.Bladeburner:\n return [\"Perform Bladeburner Actions\", sleeve.bbAction, sleeve.bbContract];\n case SleeveTaskType.Recovery:\n return [\"Shock Recovery\", \"------\", \"------\"];\n case SleeveTaskType.Synchro:\n return [\"Synchronize\", \"------\", \"------\"];\n }\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.resetTaskStatus(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 its 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.hacknet_node_money_mult) -\n node.moneyGainRatePerSecond;\n const upgradeLevelCost = node.calculateLevelUpgradeCost(multiplier, props.player.hacknet_node_level_cost_mult);\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.hacknet_node_money_mult,\n ) - node.moneyGainRatePerSecond;\n const upgradeRamCost = node.calculateRamUpgradeCost(multiplier, props.player.hacknet_node_ram_cost_mult);\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.hacknet_node_money_mult) -\n node.moneyGainRatePerSecond;\n const upgradeCoreCost = node.calculateCoreUpgradeCost(multiplier, props.player.hacknet_node_core_cost_mult);\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(node.level + multiplier, 0, node.maxRam, node.cores, props.player.hacknet_node_money_mult) -\n calculateHashGainRate(node.level, 0, node.maxRam, node.cores, props.player.hacknet_node_money_mult);\n const modded_increase = (base_increase * (node.maxRam - node.ramUsed)) / node.maxRam;\n\n const upgradeLevelCost = node.calculateLevelUpgradeCost(multiplier, props.player.hacknet_node_level_cost_mult);\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.hacknet_node_money_mult,\n ) - calculateHashGainRate(node.level, 0, node.maxRam, node.cores, props.player.hacknet_node_money_mult);\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.hacknet_node_money_mult,\n ) -\n calculateHashGainRate(node.level, node.ramUsed, node.maxRam, node.cores, props.player.hacknet_node_money_mult);\n\n const upgradeRamCost = node.calculateRamUpgradeCost(multiplier, props.player.hacknet_node_ram_cost_mult);\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(node.level, 0, node.maxRam, node.cores + multiplier, props.player.hacknet_node_money_mult) -\n calculateHashGainRate(node.level, 0, node.maxRam, node.cores, props.player.hacknet_node_money_mult);\n const modded_increase = (base_increase * (node.maxRam - node.ramUsed)) / node.maxRam;\n\n const upgradeCoreCost = node.calculateCoreUpgradeCost(multiplier, props.player.hacknet_node_core_cost_mult);\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\";\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 if (pos.isPartTimeJob() || pos.isSoftwareConsultantJob() || pos.isBusinessConsultantJob()) {\n p.startWorkPartTime(props.locName);\n } else {\n p.startWork(props.locName);\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","// 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 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 { CONSTANTS } from \"../../Constants\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { GetServer } from \"../../Server/AllServers\";\nimport { Server } from \"../../Server/Server\";\n\nimport { Money } from \"../../ui/React/Money\";\nimport { IRouter } from \"../../ui/Router\";\nimport { serverMetadata } from \"../../Server/data/servers\";\nimport { Box } from \"@mui/material\";\nimport { ClassType } from \"../../utils/WorkType\";\n\ntype IProps = {\n loc: Location;\n p: IPlayer;\n router: IRouter;\n};\n\nexport function GymLocation(props: IProps): React.ReactElement {\n function calculateCost(): number {\n const serverMeta = serverMetadata.find((s) => s.specialName === props.loc.name);\n const server = GetServer(serverMeta ? serverMeta.hostname : \"\");\n if (server == null || !server.hasOwnProperty(\"backdoorInstalled\")) return props.loc.costMult;\n const discount = (server as Server).backdoorInstalled ? 0.9 : 1;\n return props.loc.costMult * discount;\n }\n\n function train(stat: ClassType): void {\n const loc = props.loc;\n props.p.startClass(calculateCost(), loc.expMult, stat);\n props.p.startFocusing();\n props.router.toWork();\n }\n\n function trainStrength(): void {\n train(ClassType.GymStrength);\n }\n\n function trainDefense(): void {\n train(ClassType.GymDefense);\n }\n\n function trainDexterity(): void {\n train(ClassType.GymDexterity);\n }\n\n function trainAgility(): void {\n train(ClassType.GymAgility);\n }\n\n const cost = CONSTANTS.ClassGymBaseCost * calculateCost();\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: any;\n\n constructor(props: IProps) {\n super(props);\n\n this.btnStyle = { display: \"block\" };\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,\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 < 0) {\n this.props.p.hp = 0;\n }\n if (this.props.p.hp >= this.props.p.max_hp) {\n return;\n }\n\n const cost = this.getCost();\n this.props.p.loseMoney(cost, \"hospitalization\");\n this.props.p.hp = this.props.p.max_hp;\n\n // This just forces a re-render to update the cost\n this.setState({\n currHp: this.props.p.hp,\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(router, player);\n }\n\n function robStore(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.RobStore.commit(router, player);\n }\n\n function mug(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.Mug.commit(router, player);\n }\n\n function larceny(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.Larceny.commit(router, player);\n }\n\n function dealDrugs(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.DealDrugs.commit(router, player);\n }\n\n function bondForgery(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.BondForgery.commit(router, player);\n }\n\n function traffickArms(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.TraffickArms.commit(router, player);\n }\n\n function homicide(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.Homicide.commit(router, player);\n }\n\n function grandTheftAuto(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.GrandTheftAuto.commit(router, player);\n }\n\n function kidnap(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.Kidnap.commit(router, player);\n }\n\n function assassinate(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.Assassination.commit(router, player);\n }\n\n function heist(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.Heist.commit(router, player);\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 (p.strength >= 100 && p.defense >= 100 && p.dexterity >= 100 && p.agility >= 100) {\n // Apply for Bladeburner division\n p.startBladeburner({ new: true });\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.intelligence_exp *= 1.0000000000000002;\n }\n player.hacking_exp *= 1.0000000000000002;\n player.strength_exp *= 1.0000000000000002;\n player.defense_exp *= 1.0000000000000002;\n player.agility_exp *= 1.0000000000000002;\n player.dexterity_exp *= 1.0000000000000002;\n player.charisma_exp *= 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 business man 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 so 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} as any;\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 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 { 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\";\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 (Player.createProgramName === item.program) {\n Player.isWorking = false;\n Player.resetWorkStatus();\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","/**\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.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 { 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.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 = player.strength + player.defense + player.dexterity + player.agility + player.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.strength_exp_mult * xpMult, player.strength_mult) +\n calculateSkill(player.defense_exp_mult * xpMult, player.defense_mult) +\n calculateSkill(player.agility_exp_mult * xpMult, player.agility_mult) +\n calculateSkill(player.dexterity_exp_mult * xpMult, player.dexterity_mult) +\n calculateSkill(player.charisma_exp_mult * xpMult, player.charisma_mult);\n return calculateRawDiff(player, total, startingSecurityLevel);\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)), 1);\n\n const mult = Math.log2(antiLog);\n return (CONSTANTS.AugmentationGraftingTimeBase * mult + CONSTANTS.MillisecondsPerHalfHour) / 2;\n }\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","import { KEY } from \"../utils/helpers/keyCodes\";\nimport { substituteAliases } from \"../Alias\";\n// Helper function that checks if an argument (which is a string) is a valid number\nfunction isNumber(str: string): boolean {\n if (typeof str != \"string\") {\n return false;\n } // Only process strings\n return !isNaN(str as unknown as number) && !isNaN(parseFloat(str));\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 // This will be used to keep track of whether we're in a quote. This is for situations\n // like the alias command:\n // alias run=\"run NUKE.exe\"\n // We want the run=\"run NUKE.exe\" to be parsed as a single command, so this flag\n // will keep track of whether we have a quote in\n let inQuote = ``;\n\n // Returns an array with the command and its arguments in each index\n // Properly handles quotation marks (e.g. `run foo.script \"the sun\"` will return [run, foo.script, the sun])\n const args = [];\n let start = 0,\n i = 0;\n let prevChar = \"\"; // Previous character\n while (i < command.length) {\n let escaped = false; // Check for escaped quotation marks\n if (i >= 1) {\n prevChar = command.charAt(i - 1);\n if (prevChar === \"\\\\\") {\n escaped = true;\n }\n }\n\n const c = command.charAt(i);\n if (c === KEY.DOUBLE_QUOTE) {\n // Double quotes\n if (!escaped && prevChar === KEY.SPACE) {\n const endQuote = command.indexOf(KEY.DOUBLE_QUOTE, 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 (inQuote === ``) {\n inQuote = KEY.DOUBLE_QUOTE;\n } else if (inQuote === KEY.DOUBLE_QUOTE) {\n inQuote = ``;\n }\n } else if (c === KEY.QUOTE) {\n // Single quotes, same thing as above\n if (!escaped && prevChar === KEY.SPACE) {\n const endQuote = command.indexOf(KEY.QUOTE, 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 (inQuote === ``) {\n inQuote = KEY.QUOTE;\n } else if (inQuote === KEY.QUOTE) {\n inQuote = ``;\n }\n } else if (c === KEY.SPACE && inQuote === ``) {\n const arg = command.substr(start, i - start);\n\n // If this is a number, convert it from a string to number\n if (isNumber(arg)) {\n args.push(parseFloat(arg));\n } else if (arg === \"true\") {\n args.push(true);\n } else if (arg === \"false\") {\n args.push(false);\n } else {\n args.push(arg);\n }\n\n start = i + 1;\n }\n ++i;\n }\n\n // Add the last argument\n if (start !== i) {\n const arg = command.substr(start, i - start);\n\n // If this is a number, convert it from string to number\n if (isNumber(arg)) {\n args.push(parseFloat(arg));\n } else if (arg === \"true\") {\n args.push(true);\n } else if (arg === \"false\") {\n args.push(false);\n } else {\n args.push(arg);\n }\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 { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { areImportsEquals } from \"../Terminal/DirectoryHelpers\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\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 */\nasync function parseOnlyRamCalculate(\n player: IPlayer,\n otherScripts: Script[],\n code: string,\n workerScript: WorkerScript,\n): Promise {\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\n // Additional modules can either be imported from the web (in which case we use\n // a dynamic import), or from other in-game scripts\n let code;\n if (nextModule.startsWith(\"https://\") || nextModule.startsWith(\"http://\")) {\n try {\n // eslint-disable-next-line no-await-in-loop\n const module = await eval(\"import(nextModule)\");\n code = \"\";\n for (const prop in module) {\n if (typeof module[prop] === \"function\") {\n code += module[prop].toString() + \";\\n\";\n }\n }\n } catch (e) {\n console.error(`Error dynamically importing module from ${nextModule} for RAM calculations: ${e}`);\n return { cost: RamCalculationErrorCode.URLImportError };\n }\n } else {\n if (!Array.isArray(otherScripts)) {\n console.warn(`parseOnlyRamCalculate() not called with array of scripts`);\n return { cost: RamCalculationErrorCode.ImportError };\n }\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 code = script.code;\n }\n\n parseCode(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 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: any): 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 (workerScript.loadedFns[ref]) {\n continue;\n } else {\n workerScript.loadedFns[ref] = true;\n }\n\n // This accounts for namespaces (Bladeburner, CodingCpntract, etc.)\n let func;\n let refDetail = \"n/a\";\n if (ref in workerScript.env.vars.bladeburner) {\n func = workerScript.env.vars.bladeburner[ref];\n refDetail = `bladeburner.${ref}`;\n } else if (ref in workerScript.env.vars.codingcontract) {\n func = workerScript.env.vars.codingcontract[ref];\n refDetail = `codingcontract.${ref}`;\n } else if (ref in workerScript.env.vars.stanek) {\n func = workerScript.env.vars.stanek[ref];\n refDetail = `stanek.${ref}`;\n } else if (ref in workerScript.env.vars.infiltration) {\n func = workerScript.env.vars.infiltration[ref];\n refDetail = `infiltration.${ref}`;\n } else if (ref in workerScript.env.vars.gang) {\n func = workerScript.env.vars.gang[ref];\n refDetail = `gang.${ref}`;\n } else if (ref in workerScript.env.vars.sleeve) {\n func = workerScript.env.vars.sleeve[ref];\n refDetail = `sleeve.${ref}`;\n } else if (ref in workerScript.env.vars.stock) {\n func = workerScript.env.vars.stock[ref];\n refDetail = `stock.${ref}`;\n } else if (ref in workerScript.env.vars.ui) {\n func = workerScript.env.vars.ui[ref];\n refDetail = `ui.${ref}`;\n } else if (ref in workerScript.env.vars.grafting) {\n func = workerScript.env.vars.grafting[ref];\n refDetail = `grafting.${ref}`;\n } else if (ref in workerScript.env.vars.singularity) {\n func = workerScript.env.vars.singularity[ref];\n refDetail = `singularity.${ref}`;\n } else {\n func = workerScript.env.vars[ref];\n refDetail = `${ref}`;\n }\n const fnRam = applyFuncRam(func);\n ram += fnRam;\n detailedCosts.push({ type: \"fn\", name: refDetail, cost: fnRam });\n } catch (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: acorn.Node, st: any, walkDeeper: walk.WalkerCallback) => {\n if (nodeHasTrueTest((node as any).test) && !hasAwait(node)) {\n missingAwaitLine = (code.slice(0, node.start).match(/\\n/g) || []).length + 1;\n } else {\n (node as any).body && walkDeeper((node as any).body, st);\n }\n },\n },\n );\n\n return missingAwaitLine;\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): any {\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 // 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(): any {\n return {\n Identifier: (node: any, st: any) => {\n if (objectPrototypeProperties.includes(node.name)) {\n return;\n }\n addRef(st.key, node.name);\n },\n WhileStatement: (node: any, st: any, walkDeeper: any) => {\n addRef(st.key, specialReferenceWHILE);\n node.test && walkDeeper(node.test, st);\n node.body && walkDeeper(node.body, st);\n },\n DoWhileStatement: (node: any, st: any, walkDeeper: any) => {\n addRef(st.key, specialReferenceWHILE);\n node.test && walkDeeper(node.test, st);\n node.body && walkDeeper(node.body, st);\n },\n ForStatement: (node: any, st: any, walkDeeper: any) => {\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: any, st: any, walkDeeper: any) => {\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: any, st: any, walkDeeper: any) => {\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: any, st: any) => {\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: any) => {\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 async function calculateRamUsage(\n player: IPlayer,\n codeCopy: string,\n otherScripts: Script[],\n): Promise {\n // We don't need a real WorkerScript for this. Just an object that keeps\n // track of whatever's needed for RAM calculations\n const workerScript = {\n loadedFns: {},\n env: {\n vars: RamCosts,\n },\n } as WorkerScript;\n\n try {\n return await parseOnlyRamCalculate(player, otherScripts, codeCopy, workerScript);\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","import $ from \"jquery\";\nimport { vsprintf, sprintf } from \"sprintf-js\";\n\nimport { WorkerScriptStartStopEventEmitter } from \"./Netscript/WorkerScriptStartStopEventEmitter\";\n\nimport { BitNodeMultipliers } from \"./BitNode/BitNodeMultipliers\";\n\nimport { CONSTANTS } from \"./Constants\";\n\nimport {\n calculateHackingChance,\n calculateHackingExpGain,\n calculatePercentMoneyHacked,\n calculateHackingTime,\n calculateGrowTime,\n calculateWeakenTime,\n} from \"./Hacking\";\n\nimport { netscriptCanGrow, netscriptCanHack, netscriptCanWeaken } from \"./Hacking/netscriptCanHack\";\n\nimport { HacknetServer } from \"./Hacknet/HacknetServer\";\n\nimport { Terminal } from \"./Terminal\";\n\nimport { Player } from \"./Player\";\nimport { Programs } from \"./Programs/Programs\";\nimport { Script } from \"./Script/Script\";\nimport { findRunningScript, findRunningScriptByPid } from \"./Script/ScriptHelpers\";\nimport { isScriptFilename } from \"./Script/isScriptFilename\";\nimport { PromptEvent } from \"./ui/React/PromptManager\";\n\nimport { GetServer, GetAllServers, DeleteServer, AddToAllServers, createUniqueRandomIp } from \"./Server/AllServers\";\nimport { RunningScript } from \"./Script/RunningScript\";\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 { influenceStockThroughServerHack, influenceStockThroughServerGrow } from \"./StockMarket/PlayerInfluencing\";\n\nimport { isValidFilePath, removeLeadingSlash } from \"./Terminal/DirectoryHelpers\";\nimport { TextFile, getTextFile, createTextFile } from \"./TextFile\";\n\nimport { NetscriptPorts, runScriptFromScript } from \"./NetscriptWorker\";\nimport { killWorkerScript } from \"./Netscript/killWorkerScript\";\nimport { workerScripts } from \"./Netscript/WorkerScripts\";\nimport { WorkerScript } from \"./Netscript/WorkerScript\";\nimport { makeRuntimeRejectMsg, netscriptDelay, resolveNetscriptRequestedThreads } from \"./NetscriptEvaluator\";\n\nimport { numeralWrapper } from \"./ui/numeralFormat\";\nimport { convertTimeMsToTimeElapsedString } from \"./utils/StringHelperFunctions\";\n\nimport { LogBoxEvents, LogBoxCloserEvents } from \"./ui/React/LogBoxManager\";\nimport { arrayToString } from \"./utils/helpers/arrayToString\";\nimport { isString } from \"./utils/helpers/isString\";\n\nimport { BaseServer } from \"./Server/BaseServer\";\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\";\n\nimport {\n NS as INS,\n Player as INetscriptPlayer,\n Gang as IGang,\n Bladeburner as IBladeburner,\n Stanek as IStanek,\n Infiltration as IInfiltration,\n RunningScript as IRunningScript,\n RecentScript as IRecentScript,\n SourceFileLvl,\n BasicHGWOptions,\n ProcessInfo,\n HackingMultipliers,\n HacknetMultipliers,\n BitNodeMultipliers as IBNMults,\n Server as IServerDef,\n RunningScript as IRunningScriptDef,\n // ToastVariant,\n} from \"./ScriptEditor/NetscriptDefinitions\";\nimport { NetscriptSingularity } from \"./NetscriptFunctions/Singularity\";\n\nimport { toNative } from \"./NetscriptFunctions/toNative\";\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 { CityName } from \"./Locations/data/CityNames\";\nimport { InternalAPI, NetscriptContext, wrapAPI } from \"./Netscript/APIWrapper\";\nimport { INetscriptHelper } from \"./NetscriptFunctions/INetscriptHelper\";\n\ninterface NS extends INS {\n [key: string]: any;\n gang: IGang;\n bladeburner: IBladeburner;\n stanek: IStanek;\n infiltration: IInfiltration;\n}\n\nexport function NetscriptFunctions(workerScript: WorkerScript): NS {\n const updateDynamicRam = function (fnName: string, ramCost: number): void {\n if (workerScript.dynamicLoadedFns[fnName]) {\n return;\n }\n workerScript.dynamicLoadedFns[fnName] = true;\n\n let threads = workerScript.scriptRef.threads;\n if (typeof threads !== \"number\") {\n console.warn(`WorkerScript detected NaN for threadcount for ${workerScript.name} on ${workerScript.hostname}`);\n threads = 1;\n }\n workerScript.dynamicRamUsage += ramCost;\n if (workerScript.dynamicRamUsage > 1.01 * workerScript.ramUsage) {\n throw makeRuntimeRejectMsg(\n workerScript,\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(workerScript.dynamicRamUsage)}\n Static RAM Usage: ${numeralWrapper.formatRAM(workerScript.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 }\n };\n\n /**\n * Gets the Server for a specific hostname/ip, throwing an error\n * if the server doesn't exist.\n * @param {string} hostname - Hostname or IP of the server\n * @param {string} callingFnName - Name of calling function. For logging purposes\n * @returns {BaseServer} The specified server as a BaseServer\n */\n const safeGetServer = function (hostname: string, ctx: NetscriptContext): BaseServer {\n const server = GetServer(hostname);\n if (server == null) {\n throw ctx.makeRuntimeErrorMsg(`Invalid hostname: ${hostname}`);\n }\n return server;\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 */\n const getRunningScript = function (\n ctx: NetscriptContext,\n fn: string,\n hostname: string,\n scriptArgs: any,\n ): RunningScript | null {\n if (!Array.isArray(scriptArgs)) {\n throw makeRuntimeRejectMsg(\n 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 = workerScript.hostname;\n }\n const server = safeGetServer(hostname, ctx);\n\n return findRunningScript(fn, scriptArgs, server);\n }\n\n // If no arguments are specified, return the current RunningScript\n return workerScript.scriptRef;\n };\n\n const getRunningScriptByPid = function (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\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 */\n const createPublicRunningScript = function (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 * 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 */\n const getCannotFindRunningScriptErrorMessage = function (fn: string, hostname: string, scriptArgs: any): string {\n if (!Array.isArray(scriptArgs)) {\n scriptArgs = [];\n }\n\n return `Cannot find running script ${fn} on server ${hostname} with args: ${arrayToString(scriptArgs)}`;\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 */\n const failOnHacknetServer = function (server: BaseServer, callingFn = \"\"): boolean {\n if (server instanceof HacknetServer) {\n workerScript.log(callingFn, () => `Does not work on Hacknet Servers`);\n return true;\n } else {\n return false;\n }\n };\n\n const makeRuntimeErrorMsg = function (caller: string, 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 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.url && stackline.includes(script.url)) {\n filename = script.filename;\n }\n for (const dependency of script.dependencies) {\n if (stackline.includes(dependency.url)) {\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 const checkSingularityAccess = function (func: string): void {\n if (Player.bitNodeN !== 4) {\n if (Player.sourceFileLvl(4) === 0) {\n throw makeRuntimeErrorMsg(\n func,\n `This singularity function requires Source-File 4 to run. A power up you obtain later in the game. It will be very obvious when and how you can obtain it.`,\n );\n }\n }\n };\n\n const hack = async function (\n ctx: NetscriptContext,\n hostname: string,\n manual: boolean,\n { threads: requestedThreads, stock }: any = {},\n ): Promise {\n if (hostname === undefined) {\n throw ctx.makeRuntimeErrorMsg(\"Takes 1 argument.\");\n }\n const threads = resolveNetscriptRequestedThreads(ctx, requestedThreads);\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n throw ctx.makeRuntimeErrorMsg(\"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 ctx.makeRuntimeErrorMsg(canHack.msg || \"\");\n }\n\n ctx.log(\n () =>\n `Executing on '${server.hostname}' in ${convertTimeMsToTimeElapsedString(\n hackingTime * 1000,\n true,\n )} (t=${numeralWrapper.formatThreads(threads)})`,\n );\n\n return netscriptDelay(hackingTime * 1000, workerScript).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 workerScript.scriptRef.onlineMoneyMade += moneyGained;\n Player.scriptProdSinceLastAug += moneyGained;\n workerScript.scriptRef.recordHack(server.hostname, moneyGained, threads);\n Player.gainHackingExp(expGainedOnSuccess);\n if (manual) Player.gainIntelligenceExp(0.005);\n workerScript.scriptRef.onlineExpGained += expGainedOnSuccess;\n ctx.log(\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 workerScript.scriptRef.onlineExpGained += expGainedOnFailure;\n ctx.log(\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\n const argsToString = function (args: any[]): string {\n let out = \"\";\n for (let arg of args) {\n arg = toNative(arg);\n out += typeof arg === \"object\" ? JSON.stringify(arg) : `${arg}`;\n }\n\n return out;\n };\n\n const helper: INetscriptHelper = {\n updateDynamicRam: updateDynamicRam,\n makeRuntimeErrorMsg: makeRuntimeErrorMsg,\n string: (funcName: string, 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(funcName, `${argName} should be a string.`);\n },\n number: (funcName: string, 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(funcName, `${argName} is NaN.`);\n return v;\n }\n throw makeRuntimeErrorMsg(funcName, `${argName} should be a number.`);\n },\n boolean: (v: unknown): boolean => {\n return !!v; // Just convert it to boolean.\n },\n city: (funcName: string, argName: string, v: unknown): CityName => {\n if (typeof v !== \"string\") throw makeRuntimeErrorMsg(funcName, `${argName} should be a city name.`);\n const s = v as CityName;\n if (!Object.values(CityName).includes(s))\n throw makeRuntimeErrorMsg(funcName, `${argName} should be a city name.`);\n return s;\n },\n getServer: safeGetServer,\n checkSingularityAccess: checkSingularityAccess,\n hack: hack,\n getValidPort: (funcName: string, port: number): IPort => {\n if (isNaN(port)) {\n throw makeRuntimeErrorMsg(\n funcName,\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 funcName,\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(funcName, `Could not find port: ${port}. This is a bug. Report to dev.`);\n }\n return iport;\n },\n };\n\n const singularity = NetscriptSingularity(Player, workerScript);\n\n const base: InternalAPI = {\n ...singularity,\n\n args: workerScript.args as unknown as any,\n enums: {\n toast: ToastVariant,\n } as unknown as any,\n\n singularity: singularity,\n gang: NetscriptGang(Player, workerScript),\n bladeburner: NetscriptBladeburner(Player, workerScript),\n codingcontract: NetscriptCodingContract(Player, workerScript),\n sleeve: NetscriptSleeve(Player),\n corporation: NetscriptCorporation(Player, workerScript),\n stanek: NetscriptStanek(Player, workerScript, helper),\n infiltration: NetscriptInfiltration(Player),\n ui: NetscriptUserInterface(),\n formulas: NetscriptFormulas(Player, helper),\n stock: NetscriptStockMarket(Player, workerScript),\n grafting: NetscriptGrafting(Player),\n hacknet: NetscriptHacknet(Player, workerScript),\n sprintf: () => sprintf,\n vsprintf: () => vsprintf,\n scan:\n (ctx: NetscriptContext) =>\n (_hostname: unknown = workerScript.hostname): string[] => {\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const server = safeGetServer(hostname, ctx);\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 ctx.log(() => `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 = ctx.helper.string(\"hostname\", _hostname);\n return hack(ctx, hostname, false, { threads: requestedThreads, stock: stock });\n },\n hackAnalyzeThreads:\n (ctx: NetscriptContext) =>\n (_hostname: unknown, _hackAmount: unknown): number => {\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const hackAmount = ctx.helper.number(\"hackAmount\", _hackAmount);\n\n // Check argument validity\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"Cannot be executed on this server.\");\n return -1;\n }\n if (isNaN(hackAmount)) {\n throw ctx.makeRuntimeErrorMsg(\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 = ctx.helper.string(\"hostname\", _hostname);\n\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"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 = ctx.helper.number(\"threads\", _threads);\n if (_hostname) {\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"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 = ctx.helper.string(\"hostname\", _hostname);\n\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"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 = ctx.helper.number(\"time\", _time);\n if (time === undefined) {\n throw ctx.makeRuntimeErrorMsg(\"Takes 1 argument.\");\n }\n ctx.log(() => `Sleeping for ${time} milliseconds`);\n return netscriptDelay(time, workerScript).then(function () {\n return Promise.resolve(true);\n });\n },\n asleep: (ctx: NetscriptContext) =>\n function (_time: unknown = 0): Promise {\n const time = ctx.helper.number(\"time\", _time);\n ctx.log(() => `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 = ctx.helper.string(\"hostname\", _hostname);\n const threads = resolveNetscriptRequestedThreads(ctx, requestedThreads ?? workerScript.scriptRef.threads);\n\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"Cannot be executed on this server.\");\n return Promise.resolve(0);\n }\n\n const host = GetServer(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 ctx.makeRuntimeErrorMsg(canHack.msg || \"\");\n }\n\n const growTime = calculateGrowTime(server, Player);\n ctx.log(\n () =>\n `Executing on '${server.hostname}' in ${convertTimeMsToTimeElapsedString(\n growTime * 1000,\n true,\n )} (t=${numeralWrapper.formatThreads(threads)}).`,\n );\n return netscriptDelay(growTime * 1000, workerScript).then(function () {\n const moneyBefore = server.moneyAvailable <= 0 ? 1 : server.moneyAvailable;\n processSingleServerGrowth(server, threads, Player, host.cpuCores);\n const moneyAfter = server.moneyAvailable;\n workerScript.scriptRef.recordGrow(server.hostname, threads);\n const expGain = calculateHackingExpGain(server, Player) * threads;\n const logGrowPercent = moneyAfter / moneyBefore - 1;\n ctx.log(\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(\n threads,\n )}).`,\n );\n 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 = ctx.helper.string(\"hostname\", _hostname);\n const growth = ctx.helper.number(\"growth\", _growth);\n const cores = ctx.helper.number(\"cores\", _cores);\n\n // Check argument validity\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"Cannot be executed on this server.\");\n return 0;\n }\n if (typeof growth !== \"number\" || isNaN(growth) || growth < 1 || !isFinite(growth)) {\n throw ctx.makeRuntimeErrorMsg(`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 = ctx.helper.number(\"threads\", _threads);\n if (_hostname) {\n const cores = ctx.helper.number(\"cores\", _cores) || 1;\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const server = safeGetServer(hostname, ctx);\n\n if (!(server instanceof Server)) {\n ctx.log(() => \"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 = ctx.helper.string(\"hostname\", _hostname);\n const threads = resolveNetscriptRequestedThreads(ctx, requestedThreads ?? workerScript.scriptRef.threads);\n if (hostname === undefined) {\n throw ctx.makeRuntimeErrorMsg(\"Takes 1 argument.\");\n }\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"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 ctx.makeRuntimeErrorMsg(canHack.msg || \"\");\n }\n\n const weakenTime = calculateWeakenTime(server, Player);\n ctx.log(\n () =>\n `Executing on '${server.hostname}' in ${convertTimeMsToTimeElapsedString(\n weakenTime * 1000,\n true,\n )} (t=${numeralWrapper.formatThreads(threads)})`,\n );\n return netscriptDelay(weakenTime * 1000, workerScript).then(function () {\n const host = GetServer(workerScript.hostname);\n if (host === null) {\n ctx.log(() => \"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 workerScript.scriptRef.recordWeaken(server.hostname, threads);\n const expGain = calculateHackingExpGain(server, Player) * threads;\n ctx.log(\n () =>\n `'${server.hostname}' security level weakened to ${\n server.hackDifficulty\n }. Gained ${numeralWrapper.formatExp(expGain)} hacking exp (t=${numeralWrapper.formatThreads(threads)})`,\n );\n 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 = ctx.helper.number(\"threads\", _threads);\n const cores = ctx.helper.number(\"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 ctx.log(() => \"Sharing this computer.\");\n const end = StartSharing(workerScript.scriptRef.threads * calculateIntelligenceBonus(Player.intelligence, 2));\n return netscriptDelay(10000, workerScript).finally(function () {\n ctx.log(() => \"Finished sharing this computer.\");\n end();\n });\n },\n getSharePower: () => (): number => {\n return CalculateShareMult();\n },\n print:\n (ctx: NetscriptContext) =>\n (...args: any[]): void => {\n if (args.length === 0) {\n throw ctx.makeRuntimeErrorMsg(\"Takes at least 1 argument.\");\n }\n workerScript.print(argsToString(args));\n },\n printf:\n (ctx: NetscriptContext) =>\n (_format: unknown, ...args: any[]): void => {\n const format = ctx.helper.string(\"format\", _format);\n if (typeof format !== \"string\") {\n throw ctx.makeRuntimeErrorMsg(\"First argument must be string for the format.\");\n }\n workerScript.print(vsprintf(format, args));\n },\n tprint:\n (ctx: NetscriptContext) =>\n (...args: any[]): void => {\n if (args.length === 0) {\n throw ctx.makeRuntimeErrorMsg(\"Takes at least 1 argument.\");\n }\n const str = argsToString(args);\n if (str.startsWith(\"ERROR\") || str.startsWith(\"FAIL\")) {\n Terminal.error(`${workerScript.scriptRef.filename}: ${str}`);\n return;\n }\n if (str.startsWith(\"SUCCESS\")) {\n Terminal.success(`${workerScript.scriptRef.filename}: ${str}`);\n return;\n }\n if (str.startsWith(\"WARN\")) {\n Terminal.warn(`${workerScript.scriptRef.filename}: ${str}`);\n return;\n }\n if (str.startsWith(\"INFO\")) {\n Terminal.info(`${workerScript.scriptRef.filename}: ${str}`);\n return;\n }\n Terminal.print(`${workerScript.scriptRef.filename}: ${str}`);\n },\n tprintf:\n (ctx: NetscriptContext) =>\n (_format: unknown, ...args: any[]): void => {\n const format = ctx.helper.string(\"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: () => (): void => {\n workerScript.scriptRef.clearLog();\n },\n disableLog:\n (ctx: NetscriptContext) =>\n (_fn: unknown): void => {\n const fn = ctx.helper.string(\"fn\", _fn);\n if (fn === \"ALL\") {\n for (const fn of Object.keys(possibleLogs)) {\n workerScript.disableLogs[fn] = true;\n }\n ctx.log(() => `Disabled logging for all functions`);\n } else if (possibleLogs[fn] === undefined) {\n throw ctx.makeRuntimeErrorMsg(`Invalid argument: ${fn}.`);\n } else {\n workerScript.disableLogs[fn] = true;\n ctx.log(() => `Disabled logging for ${fn}`);\n }\n },\n enableLog:\n (ctx: NetscriptContext) =>\n (_fn: unknown): void => {\n const fn = ctx.helper.string(\"fn\", _fn);\n if (fn === \"ALL\") {\n for (const fn of Object.keys(possibleLogs)) {\n delete workerScript.disableLogs[fn];\n }\n ctx.log(() => `Enabled logging for all functions`);\n } else if (possibleLogs[fn] === undefined) {\n throw ctx.makeRuntimeErrorMsg(`Invalid argument: ${fn}.`);\n }\n delete workerScript.disableLogs[fn];\n ctx.log(() => `Enabled logging for ${fn}`);\n },\n isLogEnabled:\n (ctx: NetscriptContext) =>\n (_fn: unknown): boolean => {\n const fn = ctx.helper.string(\"fn\", _fn);\n if (possibleLogs[fn] === undefined) {\n throw ctx.makeRuntimeErrorMsg(`Invalid argument: ${fn}.`);\n }\n return !workerScript.disableLogs[fn];\n },\n getScriptLogs:\n (ctx: NetscriptContext) =>\n (fn: any, hostname: any, ...scriptArgs: any[]): string[] => {\n const runningScriptObj = getRunningScript(ctx, fn, hostname, scriptArgs);\n if (runningScriptObj == null) {\n ctx.log(() => getCannotFindRunningScriptErrorMessage(fn, hostname, scriptArgs));\n return [];\n }\n\n return runningScriptObj.logs.slice();\n },\n tail:\n (ctx: NetscriptContext) =>\n (fn: any, hostname: any = workerScript.hostname, ...scriptArgs: any[]): void => {\n let runningScriptObj;\n if (fn === undefined) {\n runningScriptObj = workerScript.scriptRef;\n } else if (typeof fn === \"number\") {\n runningScriptObj = getRunningScriptByPid(fn);\n } else {\n runningScriptObj = getRunningScript(ctx, fn, hostname, scriptArgs);\n }\n if (runningScriptObj == null) {\n ctx.log(() => getCannotFindRunningScriptErrorMessage(fn, hostname, scriptArgs));\n return;\n }\n\n LogBoxEvents.emit(runningScriptObj);\n },\n closeTail:\n (ctx: NetscriptContext) =>\n (_pid: unknown = workerScript.scriptRef.pid): void => {\n const pid = ctx.helper.number(\"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 = ctx.helper.string(\"hostname\", _hostname);\n\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"Cannot be executed on this server.\");\n return false;\n }\n if (server.hasAdminRights) {\n ctx.log(() => `Already have root access to '${server.hostname}'.`);\n return true;\n }\n if (!Player.hasProgram(Programs.NukeProgram.name)) {\n throw ctx.makeRuntimeErrorMsg(\"You do not have the NUKE.exe virus!\");\n }\n if (server.openPortCount < server.numOpenPortsRequired) {\n throw ctx.makeRuntimeErrorMsg(\"Not enough ports opened to use NUKE.exe virus.\");\n }\n server.hasAdminRights = true;\n ctx.log(() => `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 = ctx.helper.string(\"hostname\", _hostname);\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"Cannot be executed on this server.\");\n return false;\n }\n if (!Player.hasProgram(Programs.BruteSSHProgram.name)) {\n throw ctx.makeRuntimeErrorMsg(\"You do not have the BruteSSH.exe program!\");\n }\n if (!server.sshPortOpen) {\n ctx.log(() => `Executed BruteSSH.exe on '${server.hostname}' to open SSH port (22).`);\n server.sshPortOpen = true;\n ++server.openPortCount;\n } else {\n ctx.log(() => `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 = ctx.helper.string(\"hostname\", _hostname);\n if (hostname === undefined) {\n throw ctx.makeRuntimeErrorMsg(\"Takes 1 argument.\");\n }\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"Cannot be executed on this server.\");\n return false;\n }\n if (!Player.hasProgram(Programs.FTPCrackProgram.name)) {\n throw ctx.makeRuntimeErrorMsg(\"You do not have the FTPCrack.exe program!\");\n }\n if (!server.ftpPortOpen) {\n ctx.log(() => `Executed FTPCrack.exe on '${server.hostname}' to open FTP port (21).`);\n server.ftpPortOpen = true;\n ++server.openPortCount;\n } else {\n ctx.log(() => `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 = ctx.helper.string(\"hostname\", _hostname);\n if (hostname === undefined) {\n throw ctx.makeRuntimeErrorMsg(\"Takes 1 argument.\");\n }\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"Cannot be executed on this server.\");\n return false;\n }\n if (!Player.hasProgram(Programs.RelaySMTPProgram.name)) {\n throw ctx.makeRuntimeErrorMsg(\"You do not have the relaySMTP.exe program!\");\n }\n if (!server.smtpPortOpen) {\n ctx.log(() => `Executed relaySMTP.exe on '${server.hostname}' to open SMTP port (25).`);\n server.smtpPortOpen = true;\n ++server.openPortCount;\n } else {\n ctx.log(() => `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 = ctx.helper.string(\"hostname\", _hostname);\n if (hostname === undefined) {\n throw ctx.makeRuntimeErrorMsg(\"Takes 1 argument\");\n }\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"Cannot be executed on this server.\");\n return false;\n }\n if (!Player.hasProgram(Programs.HTTPWormProgram.name)) {\n throw ctx.makeRuntimeErrorMsg(\"You do not have the HTTPWorm.exe program!\");\n }\n if (!server.httpPortOpen) {\n ctx.log(() => `Executed HTTPWorm.exe on '${server.hostname}' to open HTTP port (80).`);\n server.httpPortOpen = true;\n ++server.openPortCount;\n } else {\n ctx.log(() => `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 = ctx.helper.string(\"hostname\", _hostname);\n if (hostname === undefined) {\n throw ctx.makeRuntimeErrorMsg(\"Takes 1 argument.\");\n }\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"Cannot be executed on this server.\");\n return false;\n }\n if (!Player.hasProgram(Programs.SQLInjectProgram.name)) {\n throw ctx.makeRuntimeErrorMsg(\"You do not have the SQLInject.exe program!\");\n }\n if (!server.sqlPortOpen) {\n ctx.log(() => `Executed SQLInject.exe on '${server.hostname}' to open SQL port (1433).`);\n server.sqlPortOpen = true;\n ++server.openPortCount;\n } else {\n ctx.log(() => `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: any[]): number => {\n const scriptname = ctx.helper.string(\"scriptname\", _scriptname);\n const threads = ctx.helper.number(\"threads\", _threads);\n if (scriptname === undefined) {\n throw ctx.makeRuntimeErrorMsg(\"Usage: run(scriptname, [numThreads], [arg1], [arg2]...)\");\n }\n if (isNaN(threads) || threads <= 0) {\n throw ctx.makeRuntimeErrorMsg(`Invalid thread count. Must be numeric and > 0, is ${threads}`);\n }\n const scriptServer = GetServer(workerScript.hostname);\n if (scriptServer == null) {\n throw ctx.makeRuntimeErrorMsg(\"Could not find server. This is a bug. Report to dev.\");\n }\n\n return runScriptFromScript(Player, \"run\", scriptServer, scriptname, args, workerScript, threads);\n },\n exec:\n (ctx: NetscriptContext) =>\n (_scriptname: unknown, _hostname: unknown, _threads: unknown = 1, ...args: any[]): number => {\n const scriptname = ctx.helper.string(\"scriptname\", _scriptname);\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const threads = ctx.helper.number(\"threads\", _threads);\n if (scriptname === undefined || hostname === undefined) {\n throw ctx.makeRuntimeErrorMsg(\"Usage: exec(scriptname, server, [numThreads], [arg1], [arg2]...)\");\n }\n if (isNaN(threads) || threads <= 0) {\n throw ctx.makeRuntimeErrorMsg(`Invalid thread count. Must be numeric and > 0, is ${threads}`);\n }\n const server = safeGetServer(hostname, ctx);\n return runScriptFromScript(Player, \"exec\", server, scriptname, args, workerScript, threads);\n },\n spawn:\n (ctx: NetscriptContext) =>\n (_scriptname: unknown, _threads: unknown = 1, ...args: any[]): void => {\n const scriptname = ctx.helper.string(\"scriptname\", _scriptname);\n const threads = ctx.helper.number(\"threads\", _threads);\n if (!scriptname || !threads) {\n throw ctx.makeRuntimeErrorMsg(\"Usage: spawn(scriptname, threads)\");\n }\n\n const spawnDelay = 10;\n setTimeout(() => {\n if (isNaN(threads) || threads <= 0) {\n throw ctx.makeRuntimeErrorMsg(`Invalid thread count. Must be numeric and > 0, is ${threads}`);\n }\n const scriptServer = GetServer(workerScript.hostname);\n if (scriptServer == null) {\n throw ctx.makeRuntimeErrorMsg(\"Could not find server. This is a bug. Report to dev\");\n }\n\n return runScriptFromScript(Player, \"spawn\", scriptServer, scriptname, args, workerScript, threads);\n }, spawnDelay * 1e3);\n\n ctx.log(() => `Will execute '${scriptname}' in ${spawnDelay} seconds`);\n\n workerScript.running = false; // Prevent workerScript from \"finishing execution naturally\"\n if (killWorkerScript(workerScript)) {\n ctx.log(() => \"Exiting...\");\n }\n },\n kill:\n (ctx: NetscriptContext) =>\n (filename: any, hostname?: any, ...scriptArgs: any[]): boolean => {\n let res;\n const killByPid = typeof filename === \"number\";\n if (killByPid) {\n // Kill by pid\n res = killWorkerScript(filename);\n } else {\n // Kill by filename/hostname\n if (filename === undefined || hostname === undefined) {\n throw ctx.makeRuntimeErrorMsg(\"Usage: kill(scriptname, server, [arg1], [arg2]...)\");\n }\n\n const server = safeGetServer(hostname, ctx);\n const runningScriptObj = getRunningScript(ctx, filename, hostname, scriptArgs);\n if (runningScriptObj == null) {\n ctx.log(() => getCannotFindRunningScriptErrorMessage(filename, hostname, scriptArgs));\n return false;\n }\n\n res = killWorkerScript(runningScriptObj, server.hostname);\n }\n\n if (res) {\n if (killByPid) {\n ctx.log(() => `Killing script with PID ${filename}`);\n } else {\n ctx.log(() => `Killing '${filename}' on '${hostname}' with args: ${arrayToString(scriptArgs)}.`);\n }\n return true;\n } else {\n if (killByPid) {\n ctx.log(() => `No script with PID ${filename}`);\n } else {\n ctx.log(() => `No such script '${filename}' on '${hostname}' with args: ${arrayToString(scriptArgs)}`);\n }\n return false;\n }\n },\n killall:\n (ctx: NetscriptContext) =>\n (_hostname: unknown = workerScript.hostname, _safetyguard: unknown = true): boolean => {\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const safetyguard = helper.boolean(_safetyguard);\n if (hostname === undefined) {\n throw ctx.makeRuntimeErrorMsg(\"Usage: killall(hostname, [safetyguard boolean])\");\n }\n const server = safeGetServer(hostname, ctx);\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 == workerScript.pid) continue;\n killWorkerScript(server.runningScripts[i], server.hostname, false);\n ++scriptsKilled;\n }\n WorkerScriptStartStopEventEmitter.emit();\n ctx.log(() => `Killing all scripts on '${server.hostname}'. May take a few minutes for the scripts to die.`);\n\n return scriptsKilled > 0;\n },\n exit: (ctx: NetscriptContext) => (): void => {\n workerScript.running = false; // Prevent workerScript from \"finishing execution naturally\"\n if (killWorkerScript(workerScript)) {\n ctx.log(() => \"Exiting...\");\n } else {\n ctx.log(() => \"Failed. This is a bug. Report to dev.\");\n }\n },\n scp:\n (ctx: NetscriptContext) =>\n async (scriptname: any, _hostname1: unknown, hostname2?: any): Promise => {\n const hostname1 = ctx.helper.string(\"hostname1\", _hostname1);\n if (scriptname && scriptname.constructor === Array) {\n // Recursively call scp on all elements of array\n const scripts: string[] = scriptname;\n if (scripts.length === 0) {\n throw ctx.makeRuntimeErrorMsg(\"No scripts to copy\");\n }\n let res = true;\n await Promise.all(\n scripts.map(async function (script) {\n if (!(await NetscriptFunctions(workerScript).scp(script, hostname1, hostname2))) {\n res = false;\n }\n }),\n );\n return Promise.resolve(res);\n }\n\n // Invalid file type\n if (!isValidFilePath(scriptname)) {\n throw ctx.makeRuntimeErrorMsg(`Invalid filename: '${scriptname}'`);\n }\n\n // Invalid file name\n if (!scriptname.endsWith(\".lit\") && !isScriptFilename(scriptname) && !scriptname.endsWith(\"txt\")) {\n throw ctx.makeRuntimeErrorMsg(\"Only works for scripts, .lit and .txt files\");\n }\n\n let destServer: BaseServer | null;\n let currServ: BaseServer | null;\n\n if (hostname2 != null) {\n // 3 Argument version: scriptname, source, destination\n if (scriptname === undefined || hostname1 === undefined || hostname2 === undefined) {\n throw ctx.makeRuntimeErrorMsg(\"Takes 2 or 3 arguments\");\n }\n destServer = safeGetServer(hostname2, ctx);\n currServ = safeGetServer(hostname1, ctx);\n } else if (hostname1 != null) {\n // 2 Argument version: scriptname, destination\n if (scriptname === undefined || hostname1 === undefined) {\n throw ctx.makeRuntimeErrorMsg(\"Takes 2 or 3 arguments\");\n }\n destServer = safeGetServer(hostname1, ctx);\n currServ = GetServer(workerScript.hostname);\n if (currServ == null) {\n throw ctx.makeRuntimeErrorMsg(\n \"Could not find server hostname for this script. This is a bug. Report to dev.\",\n );\n }\n } else {\n throw ctx.makeRuntimeErrorMsg(\"Takes 2 or 3 arguments\");\n }\n\n // Scp for lit files\n if (scriptname.endsWith(\".lit\")) {\n let found = false;\n for (let i = 0; i < currServ.messages.length; ++i) {\n if (currServ.messages[i] == scriptname) {\n found = true;\n break;\n }\n }\n\n if (!found) {\n ctx.log(() => `File '${scriptname}' does not exist.`);\n return Promise.resolve(false);\n }\n\n for (let i = 0; i < destServer.messages.length; ++i) {\n if (destServer.messages[i] === scriptname) {\n ctx.log(() => `File '${scriptname}' copied over to '${destServer?.hostname}'.`);\n return Promise.resolve(true); // Already exists\n }\n }\n destServer.messages.push(scriptname);\n ctx.log(() => `File '${scriptname}' copied over to '${destServer?.hostname}'.`);\n return Promise.resolve(true);\n }\n\n // Scp for text files\n if (scriptname.endsWith(\".txt\")) {\n let txtFile;\n for (let i = 0; i < currServ.textFiles.length; ++i) {\n if (currServ.textFiles[i].fn === scriptname) {\n txtFile = currServ.textFiles[i];\n break;\n }\n }\n if (txtFile === undefined) {\n ctx.log(() => `File '${scriptname}' does not exist.`);\n return Promise.resolve(false);\n }\n\n for (let i = 0; i < destServer.textFiles.length; ++i) {\n if (destServer.textFiles[i].fn === scriptname) {\n // Overwrite\n destServer.textFiles[i].text = txtFile.text;\n ctx.log(() => `File '${scriptname}' copied over to '${destServer?.hostname}'.`);\n return Promise.resolve(true);\n }\n }\n const newFile = new TextFile(txtFile.fn, txtFile.text);\n destServer.textFiles.push(newFile);\n ctx.log(() => `File '${scriptname}' copied over to '${destServer?.hostname}'.`);\n return Promise.resolve(true);\n }\n\n // Scp for script files\n let sourceScript = null;\n for (let i = 0; i < currServ.scripts.length; ++i) {\n if (scriptname == currServ.scripts[i].filename) {\n sourceScript = currServ.scripts[i];\n break;\n }\n }\n if (sourceScript == null) {\n ctx.log(() => `File '${scriptname}' does not exist.`);\n return Promise.resolve(false);\n }\n\n // Overwrite script if it already exists\n for (let i = 0; i < destServer.scripts.length; ++i) {\n if (scriptname == destServer.scripts[i].filename) {\n ctx.log(() => `WARNING: File '${scriptname}' overwritten on '${destServer?.hostname}'`);\n const oldScript = destServer.scripts[i];\n // If it's the exact same file don't actually perform the\n // copy to avoid recompiling uselessly. Players tend to scp\n // liberally.\n if (oldScript.code === sourceScript.code) return Promise.resolve(true);\n oldScript.code = sourceScript.code;\n oldScript.ramUsage = sourceScript.ramUsage;\n oldScript.markUpdated();\n return Promise.resolve(true);\n }\n }\n\n // Create new script if it does not already exist\n const newScript = new Script(Player, scriptname);\n newScript.code = sourceScript.code;\n newScript.ramUsage = sourceScript.ramUsage;\n newScript.server = destServer.hostname;\n destServer.scripts.push(newScript);\n ctx.log(() => `File '${scriptname}' copied over to '${destServer?.hostname}'.`);\n return new Promise((resolve) => {\n if (destServer === null) {\n resolve(false);\n return;\n }\n newScript.updateRamUsage(Player, destServer.scripts).then(() => resolve(true));\n });\n },\n ls:\n (ctx: NetscriptContext) =>\n (_hostname: unknown, _grep: unknown = \"\"): string[] => {\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const grep = ctx.helper.string(\"grep\", _grep);\n\n const server = safeGetServer(hostname, ctx);\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 ...createPublicRunningScript(rs.runningScript),\n }));\n },\n ps:\n (ctx: NetscriptContext) =>\n (_hostname: unknown = workerScript.hostname): ProcessInfo[] => {\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const server = safeGetServer(hostname, ctx);\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 = ctx.helper.string(\"hostname\", _hostname);\n\n const server = safeGetServer(hostname, ctx);\n return server.hasAdminRights;\n },\n getHostname: (ctx: NetscriptContext) => (): string => {\n const scriptServer = GetServer(workerScript.hostname);\n if (scriptServer == null) {\n throw ctx.makeRuntimeErrorMsg(\"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 ctx.log(() => `returned ${Player.hacking}`);\n return Player.hacking;\n },\n getHackingMultipliers: () => (): HackingMultipliers => {\n return {\n chance: Player.hacking_chance_mult,\n speed: Player.hacking_speed_mult,\n money: Player.hacking_money_mult,\n growth: Player.hacking_grow_mult,\n };\n },\n getHacknetMultipliers: () => (): HacknetMultipliers => {\n return {\n production: Player.hacknet_node_money_mult,\n purchaseCost: Player.hacknet_node_purchase_cost_mult,\n ramCost: Player.hacknet_node_ram_cost_mult,\n coreCost: Player.hacknet_node_core_cost_mult,\n levelCost: Player.hacknet_node_level_cost_mult,\n };\n },\n getBitNodeMultipliers: (ctx: NetscriptContext) => (): IBNMults => {\n if (Player.sourceFileLvl(5) <= 0 && Player.bitNodeN !== 5) {\n throw ctx.makeRuntimeErrorMsg(\"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 = workerScript.hostname): IServerDef => {\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const server = safeGetServer(hostname, ctx);\n const copy = Object.assign({}, server) as any;\n // These fields should be hidden.\n copy.contracts = undefined;\n copy.messages = undefined;\n copy.runningScripts = undefined;\n copy.scripts = undefined;\n copy.textFiles = undefined;\n copy.programs = undefined;\n copy.serversOnNetwork = undefined;\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 = ctx.helper.string(\"hostname\", _hostname);\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"Cannot be executed on this server.\");\n return 0;\n }\n if (failOnHacknetServer(server, \"getServerMoneyAvailable\")) {\n return 0;\n }\n if (server.hostname == \"home\") {\n // Return player's money\n ctx.log(() => `returned player's money: ${numeralWrapper.formatMoney(Player.money)}`);\n return Player.money;\n }\n ctx.log(() => `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 = ctx.helper.string(\"hostname\", _hostname);\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"Cannot be executed on this server.\");\n return 1;\n }\n if (failOnHacknetServer(server, \"getServerSecurityLevel\")) {\n return 1;\n }\n ctx.log(\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 = ctx.helper.string(\"hostname\", _hostname);\n ctx.log(() => `getServerBaseSecurityLevel is deprecated because it's not useful.`);\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"Cannot be executed on this server.\");\n return 1;\n }\n if (failOnHacknetServer(server, \"getServerBaseSecurityLevel\")) {\n return 1;\n }\n ctx.log(\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 = ctx.helper.string(\"hostname\", _hostname);\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"Cannot be executed on this server.\");\n return 1;\n }\n if (failOnHacknetServer(server, \"getServerMinSecurityLevel\")) {\n return 1;\n }\n ctx.log(() => `returned ${numeralWrapper.formatServerSecurity(server.minDifficulty)} for ${server.hostname}`);\n return server.minDifficulty;\n },\n getServerRequiredHackingLevel:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): number => {\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"Cannot be executed on this server.\");\n return 1;\n }\n if (failOnHacknetServer(server, \"getServerRequiredHackingLevel\")) {\n return 1;\n }\n ctx.log(() => `returned ${numeralWrapper.formatSkill(server.requiredHackingSkill)} for '${server.hostname}'`);\n return server.requiredHackingSkill;\n },\n getServerMaxMoney:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): number => {\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"Cannot be executed on this server.\");\n return 0;\n }\n if (failOnHacknetServer(server, \"getServerMaxMoney\")) {\n return 0;\n }\n ctx.log(() => `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 = ctx.helper.string(\"hostname\", _hostname);\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"Cannot be executed on this server.\");\n return 1;\n }\n if (failOnHacknetServer(server, \"getServerGrowth\")) {\n return 1;\n }\n ctx.log(() => `returned ${server.serverGrowth} for '${server.hostname}'`);\n return server.serverGrowth;\n },\n getServerNumPortsRequired:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): number => {\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"Cannot be executed on this server.\");\n return 5;\n }\n if (failOnHacknetServer(server, \"getServerNumPortsRequired\")) {\n return 5;\n }\n ctx.log(() => `returned ${server.numOpenPortsRequired} for '${server.hostname}'`);\n return server.numOpenPortsRequired;\n },\n getServerRam:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): [number, number] => {\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n ctx.log(() => `getServerRam is deprecated in favor of getServerMaxRam / getServerUsedRam`);\n const server = safeGetServer(hostname, ctx);\n ctx.log(\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 = ctx.helper.string(\"hostname\", _hostname);\n const server = safeGetServer(hostname, ctx);\n ctx.log(() => `returned ${numeralWrapper.formatRAM(server.maxRam)}`);\n return server.maxRam;\n },\n getServerUsedRam:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): number => {\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const server = safeGetServer(hostname, ctx);\n ctx.log(() => `returned ${numeralWrapper.formatRAM(server.ramUsed)}`);\n return server.ramUsed;\n },\n serverExists:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): boolean => {\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n return GetServer(hostname) !== null;\n },\n fileExists:\n (ctx: NetscriptContext) =>\n (_filename: unknown, _hostname: unknown = workerScript.hostname): boolean => {\n const filename = ctx.helper.string(\"filename\", _filename);\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n if (filename === undefined) {\n throw ctx.makeRuntimeErrorMsg(\"Usage: fileExists(scriptname, [server])\");\n }\n const server = safeGetServer(hostname, ctx);\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: any, hostname: any = workerScript.hostname, ...scriptArgs: any[]): boolean => {\n if (fn === undefined || hostname === undefined) {\n throw ctx.makeRuntimeErrorMsg(\"Usage: isRunning(scriptname, server, [arg1], [arg2]...)\");\n }\n if (typeof fn === \"number\") {\n return getRunningScriptByPid(fn) != null;\n } else {\n return getRunningScript(ctx, fn, hostname, scriptArgs) != null;\n }\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 = ctx.helper.number(\"ram\", _ram);\n\n const cost = getPurchaseServerCost(ram);\n if (cost === Infinity) {\n ctx.log(() => `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 = ctx.helper.string(\"name\", _name);\n const ram = ctx.helper.number(\"ram\", _ram);\n let hostnameStr = String(name);\n hostnameStr = hostnameStr.replace(/\\s+/g, \"\");\n if (hostnameStr == \"\") {\n ctx.log(() => `Invalid argument: hostname='${hostnameStr}'`);\n return \"\";\n }\n\n if (Player.purchasedServers.length >= getPurchaseServerLimit()) {\n ctx.log(\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 ctx.log(() => `Invalid argument: ram='${ram}' must not be greater than getPurchaseServerMaxRam`);\n } else {\n ctx.log(() => `Invalid argument: ram='${ram}' must be a positive power of 2`);\n }\n\n return \"\";\n }\n\n if (Player.money < cost) {\n ctx.log(() => `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 ctx.log(\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 = ctx.helper.string(\"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 ctx.log(() => `Invalid argument: hostname='${hostnameStr}'`);\n return false;\n }\n\n if (!server.purchasedByPlayer || server.hostname === \"home\") {\n ctx.log(() => \"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 ctx.log(() => \"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 === workerScript.hostname) {\n ctx.log(() => \"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 ctx.log(() => `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 ctx.log(() => `Could not identify server ${hostname} as a purchased server. This is a bug. Report to dev.`);\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 ctx.log(() => `Deleted server '${hostnameStr}`);\n return true;\n }\n }\n // Wasn't found on home computer\n ctx.log(() => `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: any = \"\"): Promise => {\n const port = ctx.helper.number(\"port\", _port);\n if (typeof data !== \"string\" && typeof data !== \"number\") {\n throw ctx.makeRuntimeErrorMsg(`Trying to write invalid data to a port: only strings and numbers are valid.`);\n }\n const iport = helper.getValidPort(\"writePort\", port);\n return Promise.resolve(iport.write(data));\n },\n write:\n (ctx: NetscriptContext) =>\n (_port: unknown, data: any = \"\", _mode: unknown = \"a\"): Promise => {\n const port = ctx.helper.string(\"port\", _port);\n const mode = ctx.helper.string(\"mode\", _mode);\n if (isString(port)) {\n // Write to script or text file\n let fn = port;\n if (!isValidFilePath(fn)) {\n throw ctx.makeRuntimeErrorMsg(`Invalid filepath: ${fn}`);\n }\n\n if (fn.lastIndexOf(\"/\") === 0) {\n fn = removeLeadingSlash(fn);\n }\n\n // Coerce 'data' to be a string\n try {\n data = String(data);\n } catch (e: any) {\n throw ctx.makeRuntimeErrorMsg(`Invalid data (${e}). Data being written must be convertible to a string`);\n }\n\n const server = workerScript.getServer();\n if (server == null) {\n throw ctx.makeRuntimeErrorMsg(\"Error getting Server. This is a bug. Report to dev.\");\n }\n if (isScriptFilename(fn)) {\n // Write to script\n let script = workerScript.getScriptOnServer(fn, server);\n if (script == null) {\n // Create a new script\n script = new Script(Player, fn, data, server.hostname, server.scripts);\n server.scripts.push(script);\n return script.updateRamUsage(Player, server.scripts);\n }\n mode === \"w\" ? (script.code = data) : (script.code += data);\n return script.updateRamUsage(Player, server.scripts);\n } else {\n // Write to text file\n const txtFile = getTextFile(fn, server);\n if (txtFile == null) {\n createTextFile(fn, data, server);\n return Promise.resolve();\n }\n if (mode === \"w\") {\n txtFile.write(data);\n } else {\n txtFile.append(data);\n }\n }\n return Promise.resolve();\n } else {\n throw ctx.makeRuntimeErrorMsg(`Invalid argument: ${port}`);\n }\n },\n tryWritePort:\n (ctx: NetscriptContext) =>\n (_port: unknown, data: any = \"\"): Promise => {\n let port = ctx.helper.number(\"port\", _port);\n if (typeof data !== \"string\" && typeof data !== \"number\") {\n throw makeRuntimeErrorMsg(\n \"tryWritePort\",\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 makeRuntimeErrorMsg(\n \"tryWritePort\",\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 ctx.makeRuntimeErrorMsg(`Could not find port: ${port}. This is a bug. Report to dev.`);\n }\n return Promise.resolve(iport.tryWrite(data));\n } else {\n throw ctx.makeRuntimeErrorMsg(`Invalid argument: ${port}`);\n }\n },\n readPort:\n (ctx: NetscriptContext) =>\n (_port: unknown): any => {\n const port = ctx.helper.number(\"port\", _port);\n // Read from port\n const iport = helper.getValidPort(\"readPort\", port);\n const x = iport.read();\n return x;\n },\n read:\n (ctx: NetscriptContext) =>\n (_port: unknown): string => {\n const port = ctx.helper.string(\"port\", _port);\n if (isString(port)) {\n // Read from script or text file\n const fn = port;\n const server = GetServer(workerScript.hostname);\n if (server == null) {\n throw ctx.makeRuntimeErrorMsg(\"Error getting Server. This is a bug. Report to dev.\");\n }\n if (isScriptFilename(fn)) {\n // Read from script\n const script = 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 } else {\n throw ctx.makeRuntimeErrorMsg(`Invalid argument: ${port}`);\n }\n },\n peek:\n (ctx: NetscriptContext) =>\n (_port: unknown): any => {\n const port = ctx.helper.number(\"port\", _port);\n const iport = helper.getValidPort(\"peek\", port);\n const x = iport.peek();\n return x;\n },\n clear:\n (ctx: NetscriptContext) =>\n (_file: unknown): void => {\n const file = ctx.helper.string(\"file\", _file);\n if (isString(file)) {\n // Clear text file\n const fn = file;\n const server = GetServer(workerScript.hostname);\n if (server == null) {\n throw ctx.makeRuntimeErrorMsg(\"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 ctx.makeRuntimeErrorMsg(`Invalid argument: ${file}`);\n }\n },\n clearPort:\n (ctx: NetscriptContext) =>\n (_port: unknown): void => {\n const port = ctx.helper.number(\"port\", _port);\n // Clear port\n const iport = helper.getValidPort(\"clearPort\", port);\n iport.clear();\n },\n getPortHandle:\n (ctx: NetscriptContext) =>\n (_port: unknown): IPort => {\n const port = ctx.helper.number(\"port\", _port);\n const iport = helper.getValidPort(\"getPortHandle\", port);\n return iport;\n },\n rm:\n (ctx: NetscriptContext) =>\n (_fn: unknown, hostname: any): boolean => {\n const fn = ctx.helper.string(\"fn\", _fn);\n\n if (hostname == null || hostname === \"\") {\n hostname = workerScript.hostname;\n }\n const s = safeGetServer(hostname, ctx);\n\n const status = s.removeFile(fn);\n if (!status.res) {\n ctx.log(() => status.msg + \"\");\n }\n\n return status.res;\n },\n scriptRunning:\n (ctx: NetscriptContext) =>\n (_scriptname: unknown, _hostname: unknown): boolean => {\n const scriptname = ctx.helper.string(\"scriptname\", _scriptname);\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const server = safeGetServer(hostname, ctx);\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 = ctx.helper.string(\"scriptname\", _scriptname);\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const server = safeGetServer(hostname, ctx);\n let suc = false;\n for (let i = 0; i < server.runningScripts.length; i++) {\n if (server.runningScripts[i].filename == scriptname) {\n killWorkerScript(server.runningScripts[i], server.hostname);\n suc = true;\n i--;\n }\n }\n return suc;\n },\n getScriptName: () => (): string => {\n return workerScript.name;\n },\n getScriptRam:\n (ctx: NetscriptContext) =>\n (_scriptname: unknown, _hostname: unknown = workerScript.hostname): number => {\n const scriptname = ctx.helper.string(\"scriptname\", _scriptname);\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const server = safeGetServer(hostname, ctx);\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: any, hostname: any, ...args: any[]): IRunningScriptDef | null => {\n let runningScript;\n if (fn === undefined && hostname === undefined && args.length === 0) {\n runningScript = workerScript.scriptRef;\n } else if (typeof fn === \"number\") {\n runningScript = getRunningScriptByPid(fn);\n } else {\n runningScript = getRunningScript(ctx, fn, hostname, args);\n }\n if (runningScript === null) return null;\n return createPublicRunningScript(runningScript);\n },\n getHackTime:\n (ctx: NetscriptContext) =>\n (_hostname: unknown = workerScript.hostname): number => {\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"invalid for this kind of server\");\n return Infinity;\n }\n if (failOnHacknetServer(server, \"getHackTime\")) {\n return Infinity;\n }\n\n return calculateHackingTime(server, Player) * 1000;\n },\n getGrowTime:\n (ctx: NetscriptContext) =>\n (_hostname: unknown = workerScript.hostname): number => {\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"invalid for this kind of server\");\n return Infinity;\n }\n if (failOnHacknetServer(server, \"getGrowTime\")) {\n return Infinity;\n }\n\n return calculateGrowTime(server, Player) * 1000;\n },\n getWeakenTime:\n (ctx: NetscriptContext) =>\n (_hostname: unknown = workerScript.hostname): number => {\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const server = safeGetServer(hostname, ctx);\n if (!(server instanceof Server)) {\n ctx.log(() => \"invalid for this kind of server\");\n return Infinity;\n }\n if (failOnHacknetServer(server, \"getWeakenTime\")) {\n return Infinity;\n }\n\n return calculateWeakenTime(server, Player) * 1000;\n },\n getScriptIncome:\n (ctx: NetscriptContext) =>\n (scriptname?: any, hostname?: any, ...args: any[]): any => {\n if (scriptname === undefined) {\n const res = [];\n\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 res.push(total);\n\n // Second element is total income you've earned from scripts since you installed Augs\n res.push(Player.scriptProdSinceLastAug / (Player.playtimeSinceLastAug / 1000));\n return res;\n } else {\n // Get income for a particular script\n const server = safeGetServer(hostname, ctx);\n const runningScriptObj = findRunningScript(scriptname, args, server);\n if (runningScriptObj == null) {\n ctx.log(() => `No such script '${scriptname}' on '${server.hostname}' with args: ${arrayToString(args)}`);\n return -1;\n }\n return runningScriptObj.onlineMoneyMade / runningScriptObj.onlineRunningTime;\n }\n },\n getScriptExpGain:\n (ctx: NetscriptContext) =>\n (scriptname?: any, hostname?: any, ...args: any[]): number => {\n if (scriptname === undefined) {\n let total = 0;\n for (const ws of workerScripts.values()) {\n total += ws.scriptRef.onlineExpGained / ws.scriptRef.onlineRunningTime;\n }\n return total;\n } else {\n // Get income for a particular script\n const server = safeGetServer(hostname, ctx);\n const runningScriptObj = findRunningScript(scriptname, args, server);\n if (runningScriptObj == null) {\n ctx.log(() => `No such script '${scriptname}' on '${server.hostname}' with args: ${arrayToString(args)}`);\n return -1;\n }\n return runningScriptObj.onlineExpGained / runningScriptObj.onlineRunningTime;\n }\n },\n nFormat:\n (ctx: NetscriptContext) =>\n (_n: unknown, _format: unknown): string => {\n const n = ctx.helper.number(\"n\", _n);\n const format = ctx.helper.string(\"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 = ctx.helper.number(\"milliseconds\", _milliseconds);\n const milliPrecision = helper.boolean(_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 = ctx.helper.string(\"message\", _message);\n dialogBoxCreate(message);\n },\n toast:\n (ctx: NetscriptContext) =>\n (_message: unknown, _variant: unknown = ToastVariant.SUCCESS, duration: any = 2000): void => {\n const message = ctx.helper.string(\"message\", _message);\n const variant = ctx.helper.string(\"variant\", _variant);\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 = ctx.helper.string(\"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 = workerScript.hostname): Promise => {\n const url = ctx.helper.string(\"url\", _url);\n const target = ctx.helper.string(\"target\", _target);\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n if (!isScriptFilename(target) && !target.endsWith(\".txt\")) {\n ctx.log(() => `Invalid target file: '${target}'. Must be a script or text file.`);\n return Promise.resolve(false);\n }\n const s = safeGetServer(hostname, ctx);\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 ctx.log(() => \"Failed.\");\n return resolve(false);\n }\n if (res.overwritten) {\n ctx.log(() => `Successfully retrieved content and overwrote '${target}' on '${hostname}'`);\n return resolve(true);\n }\n ctx.log(() => `Successfully retrieved content to new file '${target}' on '${hostname}'`);\n return resolve(true);\n },\n \"text\",\n ).fail(function (e) {\n ctx.log(() => JSON.stringify(e));\n return resolve(false);\n });\n });\n },\n getFavorToDonate: () => (): number => {\n return Math.floor(CONSTANTS.BaseFavorToDonate * BitNodeMultipliers.RepToDonateToFaction);\n },\n getOwnedSourceFiles: () => (): SourceFileLvl[] => {\n const res: SourceFileLvl[] = [];\n for (let i = 0; i < Player.sourceFiles.length; ++i) {\n res.push({\n n: Player.sourceFiles[i].n,\n lvl: Player.sourceFiles[i].lvl,\n });\n }\n return res;\n },\n getPlayer: () => (): INetscriptPlayer => {\n const data = {\n hacking: Player.hacking,\n hp: Player.hp,\n max_hp: Player.max_hp,\n strength: Player.strength,\n defense: Player.defense,\n dexterity: Player.dexterity,\n agility: Player.agility,\n charisma: Player.charisma,\n intelligence: Player.intelligence,\n hacking_chance_mult: Player.hacking_chance_mult,\n hacking_speed_mult: Player.hacking_speed_mult,\n hacking_money_mult: Player.hacking_money_mult,\n hacking_grow_mult: Player.hacking_grow_mult,\n hacking_exp: Player.hacking_exp,\n strength_exp: Player.strength_exp,\n defense_exp: Player.defense_exp,\n dexterity_exp: Player.dexterity_exp,\n agility_exp: Player.agility_exp,\n charisma_exp: Player.charisma_exp,\n hacking_mult: Player.hacking_mult,\n strength_mult: Player.strength_mult,\n defense_mult: Player.defense_mult,\n dexterity_mult: Player.dexterity_mult,\n agility_mult: Player.agility_mult,\n charisma_mult: Player.charisma_mult,\n hacking_exp_mult: Player.hacking_exp_mult,\n strength_exp_mult: Player.strength_exp_mult,\n defense_exp_mult: Player.defense_exp_mult,\n dexterity_exp_mult: Player.dexterity_exp_mult,\n agility_exp_mult: Player.agility_exp_mult,\n charisma_exp_mult: Player.charisma_exp_mult,\n company_rep_mult: Player.company_rep_mult,\n faction_rep_mult: Player.faction_rep_mult,\n numPeopleKilled: Player.numPeopleKilled,\n money: Player.money,\n city: Player.city,\n location: Player.location,\n companyName: Player.companyName,\n crime_money_mult: Player.crime_money_mult,\n crime_success_mult: Player.crime_success_mult,\n isWorking: Player.isWorking,\n workType: Player.workType,\n currentWorkFactionName: Player.currentWorkFactionName,\n currentWorkFactionDescription: Player.currentWorkFactionDescription,\n workHackExpGainRate: Player.workHackExpGainRate,\n workStrExpGainRate: Player.workStrExpGainRate,\n workDefExpGainRate: Player.workDefExpGainRate,\n workDexExpGainRate: Player.workDexExpGainRate,\n workAgiExpGainRate: Player.workAgiExpGainRate,\n workChaExpGainRate: Player.workChaExpGainRate,\n workRepGainRate: Player.workRepGainRate,\n workMoneyGainRate: Player.workMoneyGainRate,\n workMoneyLossRate: Player.workMoneyLossRate,\n workHackExpGained: Player.workHackExpGained,\n workStrExpGained: Player.workStrExpGained,\n workDefExpGained: Player.workDefExpGained,\n workDexExpGained: Player.workDexExpGained,\n workAgiExpGained: Player.workAgiExpGained,\n workChaExpGained: Player.workChaExpGained,\n workRepGained: Player.workRepGained,\n workMoneyGained: Player.workMoneyGained,\n createProgramName: Player.createProgramName,\n createProgramReqLvl: Player.createProgramReqLvl,\n className: Player.className,\n crimeType: Player.crimeType,\n work_money_mult: Player.work_money_mult,\n hacknet_node_money_mult: Player.hacknet_node_money_mult,\n hacknet_node_purchase_cost_mult: Player.hacknet_node_purchase_cost_mult,\n hacknet_node_ram_cost_mult: Player.hacknet_node_ram_cost_mult,\n hacknet_node_core_cost_mult: Player.hacknet_node_core_cost_mult,\n hacknet_node_level_cost_mult: Player.hacknet_node_level_cost_mult,\n hasWseAccount: Player.hasWseAccount,\n hasTixApiAccess: Player.hasTixApiAccess,\n has4SData: Player.has4SData,\n has4SDataTixApi: Player.has4SDataTixApi,\n bladeburner_max_stamina_mult: Player.bladeburner_max_stamina_mult,\n bladeburner_stamina_gain_mult: Player.bladeburner_stamina_gain_mult,\n bladeburner_analysis_mult: Player.bladeburner_analysis_mult,\n bladeburner_success_chance_mult: Player.bladeburner_success_chance_mult,\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: any): void => {\n if (typeof f !== \"function\") {\n throw ctx.makeRuntimeErrorMsg(\"argument should be function\");\n }\n 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 = ctx.helper.string(\"host\", _host);\n const source = ctx.helper.string(\"source\", _source);\n const destination = ctx.helper.string(\"destination\", _destination);\n\n if (!isValidFilePath(source)) throw ctx.makeRuntimeErrorMsg(`Invalid filename: '${source}'`);\n if (!isValidFilePath(destination)) throw ctx.makeRuntimeErrorMsg(`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 ctx.makeRuntimeErrorMsg(`'mv' can only be used on scripts and text files (.txt)`);\n if (source_is_txt != dest_is_txt)\n throw ctx.makeRuntimeErrorMsg(`Source and destination files must have the same type`);\n\n if (source === destination) {\n return;\n }\n\n // This will throw if the server is not found, we do not need to validate result.\n const destServer: BaseServer | null = safeGetServer(host, ctx);\n\n if (!source_is_txt && destServer.isRunning(source))\n throw ctx.makeRuntimeErrorMsg(`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 ctx.makeRuntimeErrorMsg(`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(workerScript.args),\n };\n\n // add undocumented functions\n const ns = {\n ...base,\n ...NetscriptExtra(Player),\n };\n function getFunctionNames(obj: any, 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\n const possibleLogs = Object.fromEntries([...getFunctionNames(ns, \"\")].map((a) => [a, true]));\n\n const wrappedNS = wrapAPI(helper, {}, workerScript, ns) as unknown as INS;\n return wrappedNS;\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","/**\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 } 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: any) {\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.faction_rep_mult * 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 console.log(total);\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: any) {\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(): any {\n return Generic_toJSON(\"Gang\", this);\n }\n\n /**\n * Initiatizes a Gang object from a JSON save state.\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): 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.faction_rep_mult;\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, .ns, .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, .ns, .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","import { List, ListItem, Paper, Typography } from \"@mui/material\";\nimport { uniqueId } from \"lodash\";\nimport React from \"react\";\n\ninterface IProps {\n children: React.ReactElement | (React.ReactElement | null)[];\n title: string;\n}\n\nexport const GameOptionsPage = (props: IProps): React.ReactElement => {\n return (\n \n {props.title}\n {(props.children as any)?.length > 1 ? (\n \n {(props.children as React.ReactElement[])\n .filter((c) => c)\n .map((c, i) => (\n \n {c}\n \n ))}\n \n ) : (\n props.children\n )}\n \n );\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 { calculateGrid, 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 activeGrid = calculateGrid(gift);\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\";\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: any[]): 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\";\n\nimport { IMap } from \"../../types\";\nimport { Sleeve } from \"../Sleeve/Sleeve\";\nimport { IPlayerOwnedSourceFile } from \"../../SourceFile/PlayerOwnedSourceFile\";\nimport { Exploit } from \"../../Exploits/Exploit\";\nimport { WorkerScript } from \"../../Netscript/WorkerScript\";\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 { IRouter } from \"../../ui/Router\";\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 } 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 { WorkType, ClassType, CrimeType, PlayerFactionWorkType } from \"../../utils/WorkType\";\n\nexport class PlayerObject implements IPlayer {\n // Class members\n augmentations: IPlayerOwnedAugmentation[];\n bitNodeN: number;\n city: CityName;\n companyName: string;\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 hp: number;\n jobs: IMap;\n init: () => void;\n isWorking: boolean;\n karma: number;\n numPeopleKilled: number;\n location: LocationName;\n max_hp: number;\n money: number;\n moneySourceA: MoneySourceTracker;\n moneySourceB: MoneySourceTracker;\n playtimeSinceLastAug: number;\n playtimeSinceLastBitnode: number;\n purchasedServers: any[];\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 // Stats\n hacking: number;\n strength: number;\n defense: number;\n dexterity: number;\n agility: number;\n charisma: number;\n intelligence: number;\n\n // Experience\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 // Multipliers\n hacking_chance_mult: number;\n hacking_speed_mult: number;\n hacking_money_mult: number;\n hacking_grow_mult: number;\n hacking_mult: number;\n hacking_exp_mult: number;\n strength_mult: number;\n strength_exp_mult: number;\n defense_mult: number;\n defense_exp_mult: number;\n dexterity_mult: number;\n dexterity_exp_mult: number;\n agility_mult: number;\n agility_exp_mult: number;\n charisma_mult: number;\n charisma_exp_mult: number;\n hacknet_node_money_mult: number;\n hacknet_node_purchase_cost_mult: number;\n hacknet_node_ram_cost_mult: number;\n hacknet_node_core_cost_mult: number;\n hacknet_node_level_cost_mult: number;\n company_rep_mult: number;\n faction_rep_mult: number;\n work_money_mult: number;\n crime_success_mult: number;\n crime_money_mult: number;\n bladeburner_max_stamina_mult: number;\n bladeburner_stamina_gain_mult: number;\n bladeburner_analysis_mult: number;\n bladeburner_success_chance_mult: number;\n\n createProgramReqLvl: number;\n factionWorkType: PlayerFactionWorkType;\n createProgramName: string;\n timeWorkedCreateProgram: number;\n graftAugmentationName: string;\n timeWorkedGraftAugmentation: number;\n crimeType: CrimeType;\n committingCrimeThruSingFn: boolean;\n singFnCrimeWorkerScript: WorkerScript | null;\n timeNeededToCompleteWork: number;\n focus: boolean;\n className: ClassType;\n currentWorkFactionName: string;\n workType: WorkType;\n workCostMult: number;\n workExpMult: number;\n currentWorkFactionDescription: string;\n timeWorked: number;\n workMoneyGained: number;\n workMoneyGainRate: number;\n workRepGained: number;\n workRepGainRate: number;\n workHackExpGained: number;\n workHackExpGainRate: number;\n workStrExpGained: number;\n workStrExpGainRate: number;\n workDefExpGained: number;\n workDefExpGainRate: number;\n workDexExpGained: number;\n workDexExpGainRate: number;\n workAgiExpGained: number;\n workAgiExpGainRate: number;\n workChaExpGained: number;\n workChaExpGainRate: number;\n workMoneyLossRate: number;\n\n entropy: number;\n\n // Methods\n work: (numCycles: number) => boolean;\n workPartTime: (numCycles: number) => boolean;\n workForFaction: (numCycles: number) => boolean;\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 singularityStopWork: () => string;\n startBladeburner: (p: any) => void;\n startFactionWork: (faction: Faction) => void;\n startClass: (costMult: number, expMult: number, className: ClassType) => void;\n startCorporation: (corpName: string, additionalShares?: number) => void;\n startCrime: (\n router: IRouter,\n crimeType: CrimeType,\n hackExp: number,\n strExp: number,\n defExp: number,\n dexExp: number,\n agiExp: number,\n chaExp: number,\n money: number,\n time: number,\n singParams: any,\n ) => void;\n startFactionFieldWork: (faction: Faction) => void;\n startFactionHackWork: (faction: Faction) => void;\n startFactionSecurityWork: (faction: Faction) => void;\n startFocusing: () => void;\n startGang: (facName: string, isHacking: boolean) => void;\n startWork: (companyName: string) => void;\n startWorkPartTime: (companyName: string) => 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 process: (router: IRouter, numCycles?: number) => void;\n createHacknetServer: () => HacknetServer;\n startCreateProgramWork: (programName: string, time: number, reqLevel: number) => void;\n queueAugmentation: (augmentationName: string) => void;\n receiveInvite: (factionName: string) => void;\n updateSkillLevels: () => void;\n gainCodingContractReward: (reward: ICodingContractReward, difficulty?: number) => string;\n stopFocusing: () => void;\n finishFactionWork: (cancelled: boolean, sing?: boolean) => string;\n finishClass: (sing?: boolean) => string;\n finishWork: (cancelled: boolean, sing?: boolean) => string;\n cancelationPenalty: () => number;\n finishWorkPartTime: (sing?: boolean) => string;\n finishCrime: (cancelled: boolean) => string;\n finishCreateProgramWork: (cancelled: boolean) => string;\n resetMultipliers: () => void;\n prestigeAugmentation: () => void;\n prestigeSourceFile: () => void;\n calculateSkill: (exp: number, mult?: number) => number;\n calculateSkillProgress: (exp: number, mult?: number) => ISkillProgress;\n resetWorkStatus: (generalType?: WorkType, group?: string, workType?: string) => void;\n getWorkHackExpGain: () => number;\n getWorkStrExpGain: () => number;\n getWorkDefExpGain: () => number;\n getWorkDexExpGain: () => number;\n getWorkAgiExpGain: () => number;\n getWorkChaExpGain: () => number;\n getWorkRepGain: () => number;\n getWorkMoneyGain: () => number;\n processWorkEarnings: (cycles: number) => void;\n hospitalize: () => void;\n createProgramWork: (numCycles: number) => boolean;\n takeClass: (numCycles: number) => boolean;\n commitCrime: (numCycles: number) => boolean;\n checkForFactionInvitations: () => Faction[];\n setBitNodeNumber: (n: number) => void;\n getMult: (name: string) => number;\n setMult: (name: string, mult: number) => void;\n canAccessCotMG: () => boolean;\n sourceFileLvl: (n: number) => number;\n startGraftAugmentationWork: (augmentationName: string, time: number) => void;\n graftAugmentationWork: (numCycles: number) => boolean;\n finishGraftAugmentationWork: (cancelled: boolean, singularity?: boolean) => string;\n applyEntropy: (stacks?: number) => void;\n\n constructor() {\n //Skills and stats\n this.hacking = 1;\n\n //Combat stats\n this.hp = 10;\n this.max_hp = 10;\n this.strength = 1;\n this.defense = 1;\n this.dexterity = 1;\n this.agility = 1;\n\n //Labor stats\n this.charisma = 1;\n\n //Special stats\n this.intelligence = 0;\n\n //Hacking multipliers\n this.hacking_chance_mult = 1;\n this.hacking_speed_mult = 1;\n this.hacking_money_mult = 1;\n this.hacking_grow_mult = 1;\n\n //Experience and multipliers\n this.hacking_exp = 0;\n this.strength_exp = 0;\n this.defense_exp = 0;\n this.dexterity_exp = 0;\n this.agility_exp = 0;\n this.charisma_exp = 0;\n this.intelligence_exp = 0;\n\n this.hacking_mult = 1;\n this.strength_mult = 1;\n this.defense_mult = 1;\n this.dexterity_mult = 1;\n this.agility_mult = 1;\n this.charisma_mult = 1;\n\n this.hacking_exp_mult = 1;\n this.strength_exp_mult = 1;\n this.defense_exp_mult = 1;\n this.dexterity_exp_mult = 1;\n this.agility_exp_mult = 1;\n this.charisma_exp_mult = 1;\n\n this.company_rep_mult = 1;\n this.faction_rep_mult = 1;\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 // Company at which player is CURRENTLY working (only valid when the player is actively working)\n this.companyName = \"\"; // Name of Company. Must match a key value in Companies ma;\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 this.crime_money_mult = 1;\n this.crime_success_mult = 1;\n\n //Flags/variables for working (Company, Faction, Creating Program, Taking Class)\n this.isWorking = false;\n this.focus = false;\n this.workType = WorkType.None;\n this.workCostMult = 1;\n this.workExpMult = 1;\n\n this.currentWorkFactionName = \"\";\n this.currentWorkFactionDescription = \"\";\n\n this.workHackExpGainRate = 0;\n this.workStrExpGainRate = 0;\n this.workDefExpGainRate = 0;\n this.workDexExpGainRate = 0;\n this.workAgiExpGainRate = 0;\n this.workChaExpGainRate = 0;\n this.workRepGainRate = 0;\n this.workMoneyGainRate = 0;\n this.workMoneyLossRate = 0;\n\n this.workHackExpGained = 0;\n this.workStrExpGained = 0;\n this.workDefExpGained = 0;\n this.workDexExpGained = 0;\n this.workAgiExpGained = 0;\n this.workChaExpGained = 0;\n this.workRepGained = 0;\n this.workMoneyGained = 0;\n\n this.createProgramName = \"\";\n this.createProgramReqLvl = 0;\n\n this.graftAugmentationName = \"\";\n this.timeWorkedGraftAugmentation = 0;\n\n this.className = ClassType.None;\n\n this.crimeType = CrimeType.None;\n\n this.timeWorked = 0; //in m;\n this.timeWorkedCreateProgram = 0;\n this.timeNeededToCompleteWork = 0;\n\n this.work_money_mult = 1;\n\n //Hacknet Node multipliers\n this.hacknet_node_money_mult = 1;\n this.hacknet_node_purchase_cost_mult = 1;\n this.hacknet_node_ram_cost_mult = 1;\n this.hacknet_node_core_cost_mult = 1;\n this.hacknet_node_level_cost_mult = 1;\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 this.bladeburner_max_stamina_mult = 1;\n this.bladeburner_stamina_gain_mult = 1;\n this.bladeburner_analysis_mult = 1; //Field Analysis Only\n this.bladeburner_success_chance_mult = 1;\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 // 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.resetWorkStatus = generalMethods.resetWorkStatus;\n this.processWorkEarnings = generalMethods.processWorkEarnings;\n this.startWork = generalMethods.startWork;\n this.cancelationPenalty = generalMethods.cancelationPenalty;\n this.work = generalMethods.work;\n this.finishWork = generalMethods.finishWork;\n this.startWorkPartTime = generalMethods.startWorkPartTime;\n this.workPartTime = generalMethods.workPartTime;\n this.finishWorkPartTime = generalMethods.finishWorkPartTime;\n this.startFocusing = generalMethods.startFocusing;\n this.stopFocusing = generalMethods.stopFocusing;\n this.startFactionWork = generalMethods.startFactionWork;\n this.startFactionHackWork = generalMethods.startFactionHackWork;\n this.startFactionFieldWork = generalMethods.startFactionFieldWork;\n this.startFactionSecurityWork = generalMethods.startFactionSecurityWork;\n this.workForFaction = generalMethods.workForFaction;\n this.finishFactionWork = generalMethods.finishFactionWork;\n this.getWorkMoneyGain = generalMethods.getWorkMoneyGain;\n this.getWorkHackExpGain = generalMethods.getWorkHackExpGain;\n this.getWorkStrExpGain = generalMethods.getWorkStrExpGain;\n this.getWorkDefExpGain = generalMethods.getWorkDefExpGain;\n this.getWorkDexExpGain = generalMethods.getWorkDexExpGain;\n this.getWorkAgiExpGain = generalMethods.getWorkAgiExpGain;\n this.getWorkChaExpGain = generalMethods.getWorkChaExpGain;\n this.getWorkRepGain = generalMethods.getWorkRepGain;\n this.process = generalMethods.process;\n this.startCreateProgramWork = generalMethods.startCreateProgramWork;\n this.createProgramWork = generalMethods.createProgramWork;\n this.finishCreateProgramWork = generalMethods.finishCreateProgramWork;\n this.startGraftAugmentationWork = generalMethods.startGraftAugmentationWork;\n this.graftAugmentationWork = generalMethods.craftAugmentationWork;\n this.finishGraftAugmentationWork = generalMethods.finishGraftAugmentationWork;\n this.startClass = generalMethods.startClass;\n this.takeClass = generalMethods.takeClass;\n this.finishClass = generalMethods.finishClass;\n this.startCrime = generalMethods.startCrime;\n this.commitCrime = generalMethods.commitCrime;\n this.finishCrime = generalMethods.finishCrime;\n this.singularityStopWork = generalMethods.singularityStopWork;\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 this.factionWorkType = PlayerFactionWorkType.None;\n this.committingCrimeThruSingFn = false;\n this.singFnCrimeWorkerScript = null;\n\n this.getMult = generalMethods.getMult;\n this.setMult = generalMethods.setMult;\n\n this.canAccessCotMG = generalMethods.canAccessCotMG;\n this.sourceFileLvl = generalMethods.sourceFileLvl;\n\n this.applyEntropy = augmentationMethods.applyEntropy;\n }\n\n whoAmI(): string {\n return \"Player\";\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): any {\n return Generic_toJSON(\"PlayerObject\", this);\n }\n\n /**\n * Initiatizes a PlayerObject object from a JSON save state.\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): 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 { 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.hacking_grow_mult * coreBonus);\n}\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 { 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\";\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 const validMults = [\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 ];\n for (const mult of Object.keys(aug.mults)) {\n if (validMults.includes(mult)) {\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 { 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: any) => 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 (error: any) {\n return terminal.error(error.message);\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","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 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","/**\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, useMemo } 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({} 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\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 }\n}\n\nlet 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 openScripts = openScripts.filter((script) => {\n return GetServer(script.hostname) !== null;\n });\n if (currentScript && GetServer(currentScript.hostname) === null) {\n currentScript = openScripts[0];\n if (currentScript === undefined) currentScript = null;\n }\n\n const [dimensions, setDimensions] = useState({\n height: window.innerHeight,\n width: window.innerWidth,\n });\n useEffect(() => {\n const debouncedHandleResize = debounce(function handleResize() {\n setDimensions({\n height: window.innerHeight,\n width: window.innerWidth,\n });\n }, 250);\n\n window.addEventListener(\"resize\", debouncedHandleResize);\n\n return () => {\n window.removeEventListener(\"resize\", debouncedHandleResize);\n };\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 // \"wqriteandquit\" is not a typo, prefix must be found in full string\n MonacoVim.VimMode.Vim.defineEx(\"wqriteandquit\", \"wq\", function () {\n save();\n props.router.toTerminal();\n });\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(\n script.code,\n script.fileName.endsWith(\".txt\") ? \"plaintext\" : \"javascript\",\n );\n }\n }\n\n const debouncedSetRAM = useMemo(\n () =>\n debounce((s, e) => {\n setRAM(s);\n setRamEntries(e);\n setUpdatingRam(false);\n }, 300),\n [],\n );\n\n async function updateRAM(newCode: string): Promise {\n if (currentScript != null && currentScript.fileName.endsWith(\".txt\")) {\n debouncedSetRAM(\"N/A\", [[\"N/A\", \"\"]]);\n return;\n }\n setUpdatingRam(true);\n const codeCopy = newCode + \"\";\n const ramUsage = await 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 debouncedSetRAM(\"RAM: \" + numeralWrapper.formatRAM(ramUsage.cost), entriesDisp);\n return;\n }\n switch (ramUsage.cost) {\n case RamCalculationErrorCode.ImportError: {\n debouncedSetRAM(\"RAM: Import Error\", [[\"Import Error\", \"\"]]);\n break;\n }\n case RamCalculationErrorCode.URLImportError: {\n debouncedSetRAM(\"RAM: HTTP Import Error\", [[\"HTTP Import Error\", \"\"]]);\n break;\n }\n case RamCalculationErrorCode.SyntaxError:\n default: {\n debouncedSetRAM(\"RAM: Syntax Error\", [[\"Syntax Error\", \"\"]]);\n break;\n }\n }\n return new Promise(() => undefined);\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(\".ns\") && !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 updateRAM(newCode);\n if (editorRef.current === null) return;\n const newPos = editorRef.current.getPosition();\n if (newPos === null) return;\n if (currentScript !== null) {\n currentScript = { ...currentScript, code: newCode, lastPosition: newPos };\n const curIndex = openScripts.findIndex(\n (script) =>\n currentScript !== null &&\n script.fileName === currentScript.fileName &&\n script.hostname === currentScript.hostname,\n );\n const newArr = [...openScripts];\n const tempScript = currentScript;\n tempScript.code = newCode;\n newArr[curIndex] = tempScript;\n openScripts = [...newArr];\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.fileName.endsWith(\".txt\")) {\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, .js, or .ns) 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 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.fileName.endsWith(\".txt\")) {\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 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, .js, or .ns) or a text file (.txt)\");\n return;\n }\n\n if (Settings.SaveGameOnFileSave) saveObject.saveGame();\n }\n\n function reorder(list: Array, startIndex: number, endIndex: number): OpenScript[] {\n const result = Array.from(list);\n const [removed] = result.splice(startIndex, 1);\n result.splice(endIndex, 0, removed);\n\n return result;\n }\n\n function onDragEnd(result: any): void {\n // Dropped outside of the list\n if (!result.destination) {\n result;\n return;\n }\n\n const items = reorder(openScripts, result.source.index, result.destination.index);\n\n openScripts = items;\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 (openScripts[index].model === undefined || openScripts[index].model.isDisposed()) {\n regenerateModel(openScripts[index]);\n }\n editorRef.current.setModel(openScripts[index].model);\n\n editorRef.current.setPosition(openScripts[index].lastPosition);\n editorRef.current.revealLineInCenter(openScripts[index].lastPosition.lineNumber);\n updateRAM(openScripts[index].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 savedScriptIndex = openScripts.findIndex(\n (script) => script.fileName === closingScript.fileName && script.hostname === closingScript.hostname,\n );\n let savedScriptCode = \"\";\n if (savedScriptIndex !== -1) {\n savedScriptCode = openScripts[savedScriptIndex].code;\n }\n const server = GetServer(closingScript.hostname);\n if (server === null) throw new Error(`Server '${closingScript.hostname}' should not be null, but it is.`);\n\n const serverScriptIndex = server.scripts.findIndex((script) => script.filename === closingScript.fileName);\n if (serverScriptIndex === -1 || savedScriptCode !== server.scripts[serverScriptIndex ].code) {\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 if (openScripts.length > 1) {\n openScripts = openScripts.filter((value, i) => i !== index);\n\n let indexOffset = -1;\n if (openScripts[index + indexOffset] === undefined) {\n indexOffset = 1;\n if (openScripts[index + indexOffset] === undefined) {\n indexOffset = 0;\n }\n }\n\n // Change current script if we closed it\n currentScript = openScripts[index + indexOffset];\n if (editorRef.current !== null) {\n if (\n openScripts[index + indexOffset].model === undefined ||\n openScripts[index + indexOffset].model === null ||\n openScripts[index + indexOffset].model.isDisposed()\n ) {\n regenerateModel(openScripts[index + indexOffset]);\n }\n\n editorRef.current.setModel(openScripts[index + indexOffset].model);\n editorRef.current.setPosition(openScripts[index + indexOffset].lastPosition);\n editorRef.current.revealLineInCenter(openScripts[index + indexOffset].lastPosition.lineNumber);\n editorRef.current.focus();\n }\n rerender();\n } else {\n // No more scripts are open\n openScripts = [];\n currentScript = null;\n props.router.toTerminal();\n }\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 serverScriptCode = getServerCode(index);\n if (serverScriptCode === null) return \" *\";\n\n // The server code is stored with its starting & trailing whitespace removed\n const openScriptFormatted = Script.formatCode(openScript.code);\n return serverScriptCode !== openScriptFormatted ? \" *\" : \"\";\n }\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\n const serverScript = server.scripts.find((s) => s.filename === openScript.fileName);\n return serverScript?.code ?? 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 // Toolbars are roughly 112px:\n // 8px body margin top\n // 38.5px filename tabs\n // 5px padding for top of editor\n // 44px bottom tool bar + 16px margin\n // + vim bar 34px\n const editorHeight = dimensions.height - (130 + (options.vim ? 34 : 0));\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={`${editorHeight}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 { makeRuntimeRejectMsg } from \"./NetscriptEvaluator\";\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\";\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 if (!shouldCompile(script, scripts)) return;\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 await 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) {\n URL.revokeObjectURL(script.url);\n // Thoughts: Should we be revoking any URLs here?\n // If a script is modified repeatedly between two states,\n // we could reuse the blob at a later time.\n // BlobCache.removeByValue(script.url);\n // URL.revokeObjectURL(script.url);\n // if (script.dependencies.length > 0) {\n // script.dependencies.forEach((dep) => {\n // removeBlobFromCache(dep.url);\n // URL.revokeObjectURL(dep.url);\n // });\n // }\n }\n if (script.dependencies.length > 0) script.dependencies.forEach((dep) => URL.revokeObjectURL(dep.url));\n script.url = uurls[uurls.length - 1].url;\n script.module = new Promise((resolve) => resolve(eval(\"import(uurls[uurls.length - 1].url)\")));\n script.dependencies = uurls;\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 await compile(player, script, scripts);\n workerScript.ramUsage = script.ramUsage;\n const loadedModule = await script.module;\n\n const ns = workerScript.env.vars;\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 makeRuntimeRejectMsg(\n workerScript,\n `${script.filename} cannot be run because it does not have a main function.`,\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 return script.dependencies.some((dep) => isDependencyOutOfDate(dep.filename, scripts, script.moduleSequenceNumber));\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: any = parse(script.code, { sourceType: \"module\", ecmaVersion: \"latest\", ranges: true });\n\n const importNodes: Array = [];\n // Walk the nodes of this tree and find any import declaration statements.\n walk.simple(ast, {\n ImportDeclaration(node: any) {\n // Push this import onto the stack to replace\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: any) {\n if (node.source) {\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 ExportAllDeclaration(node: any) {\n if (node.source) {\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 });\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 * as libarg from \"arg\";\n\nexport function Flags(vargs: string[]): any {\n return () =>\n (data: any): any => {\n data = toNative(data);\n // We always want the help flag.\n const args: {\n [key: string]: any;\n } = {};\n\n for (const d of data) {\n let t: any = 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 = libarg(args, { argv: vargs });\n for (const d of data) {\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 { Interpreter } from \"../ThirdParty/JSInterpreter\";\n\nconst defaultInterpreter = new Interpreter(\"\", () => undefined);\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.\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function toNative(pseudoObj: any): any {\n if (pseudoObj == null) return null;\n if (\n !pseudoObj.hasOwnProperty(\"properties\") ||\n !pseudoObj.hasOwnProperty(\"getter\") ||\n !pseudoObj.hasOwnProperty(\"setter\") ||\n !pseudoObj.hasOwnProperty(\"proto\")\n ) {\n return pseudoObj; // it wasn't a pseudo object anyway.\n }\n\n let nativeObj: any;\n if (pseudoObj.hasOwnProperty(\"class\") && pseudoObj.class === \"Array\") {\n nativeObj = [];\n const length = defaultInterpreter.getProperty(pseudoObj, \"length\");\n for (let i = 0; i < length; i++) {\n if (defaultInterpreter.hasProperty(pseudoObj, i)) {\n nativeObj[i] = toNative(defaultInterpreter.getProperty(pseudoObj, i));\n }\n }\n } else {\n // Object.\n nativeObj = {};\n for (const key of Object.keys(pseudoObj.properties)) {\n const val = pseudoObj.properties[key];\n nativeObj[key] = toNative(val);\n }\n }\n return nativeObj;\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, _value]) => 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 { IStaneksGift } from \"../IStaneksGift\";\nimport { Cell } from \"./Cell\";\n\ninterface IProps {\n width: number;\n height: number;\n activeGrid: 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 function color(worldX: number, worldY: number): string {\n if (props.ghostGrid[worldX][worldY] && props.activeGrid[worldX][worldY]) return \"red\";\n if (props.ghostGrid[worldX][worldY]) return \"white\";\n\n if (props.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(\".ns\") || 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, .ns, .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","// by Discord: H3draut3r#6722, feel free to ask me any questions. i probably don't know the answer 🤣\nexport function HammingEncode(value: number): string {\n // encoding following Hammings rule\n function HammingSumOfParity(_lengthOfDBits: number): number {\n // will calculate the needed amount of parityBits 'without' the \"overall\"-Parity (that math took me 4 Days to get it working)\n return _lengthOfDBits < 3 || _lengthOfDBits == 0 // oh and of course using ternary operators, it's a pretty neat function\n ? _lengthOfDBits == 0\n ? 0\n : _lengthOfDBits + 1\n : // the following math will only work, if the length is greater equal 3, otherwise it's \"kind of\" broken :D\n Math.ceil(Math.log2(_lengthOfDBits * 2)) <=\n Math.ceil(Math.log2(1 + _lengthOfDBits + Math.ceil(Math.log2(_lengthOfDBits))))\n ? Math.ceil(Math.log2(_lengthOfDBits) + 1)\n : Math.ceil(Math.log2(_lengthOfDBits));\n }\n const _data = value.toString(2).split(\"\"); // first, change into binary string, then create array with 1 bit per index\n const _sumParity: number = HammingSumOfParity(_data.length); // get the sum of needed parity bits (for later use in encoding)\n const count = (arr: Array, val: string): number =>\n arr.reduce((a: number, v: string) => (v === val ? a + 1 : a), 0);\n // function count for specific entries in the array, for later use\n\n const _build = [\"x\", \"x\", ..._data.splice(0, 1)]; // init the \"pre-build\"\n for (let i = 2; i < _sumParity; i++) {\n // add new paritybits and the corresponding data bits (pre-building array)\n _build.push(\"x\", ..._data.splice(0, Math.pow(2, i) - 1));\n }\n // now the \"calculation\"... get the paritybits ('x') working\n for (const index of _build.reduce(function (a: Array, e: string, i: number) {\n if (e == \"x\") a.push(i);\n return a;\n }, [])) {\n // that reduce will result in an array of index numbers where the \"x\" is placed\n const _tempcount = index + 1; // set the \"stepsize\" for the parityBit\n const _temparray = []; // temporary array to store the extracted bits\n const _tempdata = [..._build]; // only work with a copy of the _build\n while (_tempdata[index] !== undefined) {\n // as long as there are bits on the starting index, do \"cut\"\n const _temp: Array = _tempdata.splice(index, _tempcount * 2); // cut stepsize*2 bits, then...\n _temparray.push(..._temp.splice(0, _tempcount)); // ... cut the result again and keep the first half\n }\n _temparray.splice(0, 1); // remove first bit, which is the parity one\n _build[index] = (count(_temparray, \"1\") % 2).toString(); // count with remainder of 2 and\"toString\" to store the parityBit\n } // parity done, now the \"overall\"-parity is set\n _build.unshift((count(_build, \"1\") % 2).toString()); // has to be done as last element\n return _build.join(\"\"); // return the _build as string\n}\n\nexport function HammingDecode(_data: string): number {\n //check for altered bit and decode\n const _build = _data.split(\"\"); // ye, an array for working, again\n const _testArray = []; //for the \"truthtable\". if any is false, the data has an altered bit, will check for and fix it\n const _sumParity = Math.ceil(Math.log2(_data.length)); // sum of parity for later use\n const count = (arr: Array, val: string): number =>\n arr.reduce((a: number, v: string) => (v === val ? a + 1 : a), 0);\n // the count.... again ;)\n\n let _overallParity = _build.splice(0, 1).join(\"\"); // store first index, for checking in next step and fix the _build properly later on\n _testArray.push(_overallParity == (count(_build, \"1\") % 2).toString() ? true : false); // first check with the overall parity bit\n for (let i = 0; i < _sumParity; i++) {\n // for the rest of the remaining parity bits we also \"check\"\n const _tempIndex = Math.pow(2, i) - 1; // get the parityBits Index\n const _tempStep = _tempIndex + 1; // set the stepsize\n const _tempData = [..._build]; // get a \"copy\" of the build-data for working\n const _tempArray = []; // init empty array for \"testing\"\n while (_tempData[_tempIndex] != undefined) {\n // extract from the copied data until the \"starting\" index is undefined\n const _temp = [..._tempData.splice(_tempIndex, _tempStep * 2)]; // extract 2*stepsize\n _tempArray.push(..._temp.splice(0, _tempStep)); // and cut again for keeping first half\n }\n const _tempParity = _tempArray.shift(); // and again save the first index separated for checking with the rest of the data\n _testArray.push(_tempParity == (count(_tempArray, \"1\") % 2).toString() ? true : false);\n // is the _tempParity the calculated data? push answer into the 'truthtable'\n }\n let _fixIndex = 0; // init the \"fixing\" index and start with 0\n for (let i = 1; i < _sumParity + 1; i++) {\n // simple binary adding for every boolean in the _testArray, starting from 2nd index of it\n _fixIndex += _testArray[i] ? 0 : Math.pow(2, i) / 2;\n }\n _build.unshift(_overallParity); // now we need the \"overall\" parity back in it's place\n // try fix the actual encoded binary string if there is an error\n if (_fixIndex > 0 && _testArray[0] == false) {\n // if the overall is false and the sum of calculated values is greater equal 0, fix the corresponding hamming-bit\n _build[_fixIndex] = _build[_fixIndex] == \"0\" ? \"1\" : \"0\";\n } else if (_testArray[0] == false) {\n // otherwise, if the the overall_parity is the only wrong, fix that one\n _overallParity = _overallParity == \"0\" ? \"1\" : \"0\";\n } else if (_testArray[0] == true && _testArray.some((truth) => truth == false)) {\n return 0; // uhm, there's some strange going on... 2 bits are altered? How? This should not happen 👀\n }\n // oof.. halfway through... we fixed an possible altered bit, now \"extract\" the parity-bits from the _build\n for (let i = _sumParity; i >= 0; i--) {\n // start from the last parity down the 2nd index one\n _build.splice(Math.pow(2, i), 1);\n }\n _build.splice(0, 1); // remove the overall parity bit and we have our binary value\n return parseInt(_build.join(\"\"), 2); // parse the integer with redux 2 and we're done!\n}\n","import { IBladeburner } from \"./IBladeburner\";\nimport { Action, IActionParams } from \"./Action\";\nimport { Generic_fromJSON, Generic_toJSON, 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(): any {\n return Generic_toJSON(\"Contract\", this);\n }\n\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): 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\nimport { numeralWrapper } from \"../ui/numeralFormat\";\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 // Return an object that describes a TreantJS-compatible markup/config for this Node\n // See: http://fperucic.github.io/treant-js/\n createTreantMarkup(): any {\n const childrenArray = [];\n for (let i = 0; i < this.children.length; ++i) {\n childrenArray.push(this.children[i].createTreantMarkup());\n }\n\n // Determine what css class this Node should have in the diagram\n let htmlClass = \"tooltip\";\n if (this.researched) {\n htmlClass += \" researched\";\n } else if (this.parent && this.parent.researched === false) {\n htmlClass += \" locked\";\n } else {\n htmlClass += \" unlocked\";\n }\n\n const research: Research | null = ResearchMap[this.text];\n const sanitizedName: string = this.text.replace(/\\s/g, \"\");\n return {\n children: childrenArray,\n HTMLclass: htmlClass,\n innerHTML:\n `
    ` +\n `${this.text}
    ${numeralWrapper.format(this.cost, \"0,0\")} Scientific Research` +\n `` +\n `${research.desc}` +\n `` +\n `
    `,\n text: { name: this.text },\n };\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 // Return an object that contains a Tree markup for TreantJS (using the JSON approach)\n // See: http://fperucic.github.io/treant-js/\n createTreantMarkup(): any {\n if (this.root == null) {\n return {};\n }\n\n const treeMarkup = this.root.createTreantMarkup();\n\n return {\n chart: {\n container: \"\",\n },\n nodeStructure: treeMarkup,\n };\n }\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: any = (research as any)[propName];\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","// 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","/**\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\";\nimport { Sleeve } from \"./PersonObjects/Sleeve/Sleeve\";\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\nimport { WorkType } from \"./utils/WorkType\";\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.process(Router, 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 if (Player.sleeves[i] instanceof Sleeve) {\n const expForOtherSleeves = Player.sleeves[i].process(Player, numCycles);\n\n // This sleeve earns experience for other sleeves\n if (expForOtherSleeves == null) {\n continue;\n }\n for (let j = 0; j < Player.sleeves.length; ++j) {\n if (j === i) {\n continue;\n }\n Player.sleeves[j].gainExperience(Player, expForOtherSleeves, numCycles, true);\n }\n }\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 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 loadAllRunningScripts(Player); // This also takes care of offline production for those scripts\n if (Player.isWorking) {\n Player.focus = true;\n switch (Player.workType) {\n case WorkType.Faction:\n Player.workForFaction(numCyclesOffline);\n break;\n case WorkType.CreateProgram:\n Player.createProgramWork(numCyclesOffline);\n break;\n case WorkType.StudyClass:\n Player.takeClass(numCyclesOffline);\n break;\n case WorkType.Crime:\n Player.commitCrime(numCyclesOffline);\n break;\n case WorkType.CompanyPartTime:\n Player.workPartTime(numCyclesOffline);\n break;\n case WorkType.GraftAugmentation:\n Player.graftAugmentationWork(numCyclesOffline);\n break;\n default:\n Player.work(numCyclesOffline);\n }\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);\n const sRep = getFactionSecurityWorkRepGain(Player, faction);\n const fRep = getFactionFieldWorkRepGain(Player, faction);\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 if (Player.sleeves[i] instanceof Sleeve) {\n const expForOtherSleeves = Player.sleeves[i].process(Player, numCyclesOffline);\n\n // This sleeve earns experience for other sleeves\n if (expForOtherSleeves == null) {\n continue;\n }\n for (let j = 0; j < Player.sleeves.length; ++j) {\n if (j === i) {\n continue;\n }\n Player.sleeves[j].gainExperience(Player, expForOtherSleeves, numCyclesOffline, true);\n }\n }\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\";\nimport Box from \"@mui/material/Box\";\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\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\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n backgroundColor: theme.colors.backgroundprimary,\n },\n }),\n);\n\nexport function LoadingScreen(): React.ReactElement {\n const classes = useStyles();\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: any) {\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 (\n \n {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}\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 const newMultipliers = calculateEntropy(this, stacks);\n for (const [mult, val] of Object.entries(newMultipliers)) {\n this.setMult(mult, val);\n }\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, 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(): any {\n return Generic_toJSON(\"Order\", this);\n }\n\n /**\n * Initializes a Order from a JSON save state\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): 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, 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.faction_rep_mult * (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.hacking_chance_mult *= power;\n break;\n case FragmentType.HackingSpeed:\n p.hacking_speed_mult *= power;\n break;\n case FragmentType.HackingMoney:\n p.hacking_money_mult *= power;\n break;\n case FragmentType.HackingGrow:\n p.hacking_grow_mult *= power;\n break;\n case FragmentType.Hacking:\n p.hacking_mult *= power;\n p.hacking_exp_mult *= power;\n break;\n case FragmentType.Strength:\n p.strength_mult *= power;\n p.strength_exp_mult *= power;\n break;\n case FragmentType.Defense:\n p.defense_mult *= power;\n p.defense_exp_mult *= power;\n break;\n case FragmentType.Dexterity:\n p.dexterity_mult *= power;\n p.dexterity_exp_mult *= power;\n break;\n case FragmentType.Agility:\n p.agility_mult *= power;\n p.agility_exp_mult *= power;\n break;\n case FragmentType.Charisma:\n p.charisma_mult *= power;\n p.charisma_exp_mult *= power;\n break;\n case FragmentType.HacknetMoney:\n p.hacknet_node_money_mult *= power;\n break;\n case FragmentType.HacknetCost:\n p.hacknet_node_purchase_cost_mult /= power;\n p.hacknet_node_ram_cost_mult /= power;\n p.hacknet_node_core_cost_mult /= power;\n p.hacknet_node_level_cost_mult /= power;\n break;\n case FragmentType.Rep:\n p.company_rep_mult *= power;\n p.faction_rep_mult *= power;\n break;\n case FragmentType.WorkMoney:\n p.work_money_mult *= power;\n break;\n case FragmentType.Crime:\n p.crime_success_mult *= power;\n p.crime_money_mult *= power;\n break;\n case FragmentType.Bladeburner:\n p.bladeburner_max_stamina_mult *= power;\n p.bladeburner_stamina_gain_mult *= power;\n p.bladeburner_analysis_mult *= power;\n p.bladeburner_success_chance_mult *= 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(): any {\n return Generic_toJSON(\"StaneksGift\", this);\n }\n\n /**\n * Initializes Staneks Gift from a JSON save state\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): 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 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 { SleeveTaskType } from \"../SleeveTaskTypesEnum\";\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: any[][] = [];\n if (props.sleeve.currentTask === SleeveTaskType.Crime) {\n data = [\n [\n `Money`,\n <>\n (on success)\n ,\n ],\n [`Hacking Exp`, `${numeralWrapper.formatExp(props.sleeve.gainRatesForTask.hack)} (2x on success)`],\n [`Strength Exp`, `${numeralWrapper.formatExp(props.sleeve.gainRatesForTask.str)} (2x on success)`],\n [`Defense Exp`, `${numeralWrapper.formatExp(props.sleeve.gainRatesForTask.def)} (2x on success)`],\n [`Dexterity Exp`, `${numeralWrapper.formatExp(props.sleeve.gainRatesForTask.dex)} (2x on success)`],\n [`Agility Exp`, `${numeralWrapper.formatExp(props.sleeve.gainRatesForTask.agi)} (2x on success)`],\n [`Charisma Exp`, `${numeralWrapper.formatExp(props.sleeve.gainRatesForTask.cha)} (2x on success)`],\n ];\n } else {\n data = [\n [`Money:`, ],\n [`Hacking Exp:`, `${numeralWrapper.formatExp(5 * props.sleeve.gainRatesForTask.hack)} / sec`],\n [`Strength Exp:`, `${numeralWrapper.formatExp(5 * props.sleeve.gainRatesForTask.str)} / sec`],\n [`Defense Exp:`, `${numeralWrapper.formatExp(5 * props.sleeve.gainRatesForTask.def)} / sec`],\n [`Dexterity Exp:`, `${numeralWrapper.formatExp(5 * props.sleeve.gainRatesForTask.dex)} / sec`],\n [`Agility Exp:`, `${numeralWrapper.formatExp(5 * props.sleeve.gainRatesForTask.agi)} / sec`],\n [`Charisma Exp:`, `${numeralWrapper.formatExp(5 * props.sleeve.gainRatesForTask.cha)} / sec`],\n ];\n if (props.sleeve.currentTask === SleeveTaskType.Company || props.sleeve.currentTask === SleeveTaskType.Faction) {\n const repGain: number = props.sleeve.getRepGain(player);\n data.push([`Reputation:`, ]);\n }\n }\n\n return (\n \n \n \n \n Earnings\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\";\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 as any).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 as any).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 { CONSTANTS } from \"../../Constants\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { IPlayer } from \"../IPlayer\";\nimport { ClassType } from \"../../utils/WorkType\";\n\nexport interface WorkEarnings {\n workMoneyLossRate: number;\n workHackExpGainRate: number;\n workStrExpGainRate: number;\n workDefExpGainRate: number;\n workDexExpGainRate: number;\n workAgiExpGainRate: number;\n workChaExpGainRate: number;\n}\n\nexport function calculateClassEarnings(player: IPlayer): WorkEarnings {\n const gameCPS = 1000 / CONSTANTS._idleSpeed;\n\n //Find cost and exp gain per game cycle\n let cost = 0;\n let hackExp = 0,\n strExp = 0,\n defExp = 0,\n dexExp = 0,\n agiExp = 0,\n chaExp = 0;\n const hashManager = player.hashManager;\n switch (player.className) {\n case ClassType.StudyComputerScience:\n hackExp =\n ((CONSTANTS.ClassStudyComputerScienceBaseExp * player.workExpMult) / gameCPS) * hashManager.getStudyMult();\n break;\n case ClassType.DataStructures:\n cost = (CONSTANTS.ClassDataStructuresBaseCost * player.workCostMult) / gameCPS;\n hackExp = ((CONSTANTS.ClassDataStructuresBaseExp * player.workExpMult) / gameCPS) * hashManager.getStudyMult();\n break;\n case ClassType.Networks:\n cost = (CONSTANTS.ClassNetworksBaseCost * player.workCostMult) / gameCPS;\n hackExp = ((CONSTANTS.ClassNetworksBaseExp * player.workExpMult) / gameCPS) * hashManager.getStudyMult();\n break;\n case ClassType.Algorithms:\n cost = (CONSTANTS.ClassAlgorithmsBaseCost * player.workCostMult) / gameCPS;\n hackExp = ((CONSTANTS.ClassAlgorithmsBaseExp * player.workExpMult) / gameCPS) * hashManager.getStudyMult();\n break;\n case ClassType.Management:\n cost = (CONSTANTS.ClassManagementBaseCost * player.workCostMult) / gameCPS;\n chaExp = ((CONSTANTS.ClassManagementBaseExp * player.workExpMult) / gameCPS) * hashManager.getStudyMult();\n break;\n case ClassType.Leadership:\n cost = (CONSTANTS.ClassLeadershipBaseCost * player.workCostMult) / gameCPS;\n chaExp = ((CONSTANTS.ClassLeadershipBaseExp * player.workExpMult) / gameCPS) * hashManager.getStudyMult();\n break;\n case ClassType.GymStrength:\n cost = (CONSTANTS.ClassGymBaseCost * player.workCostMult) / gameCPS;\n strExp = (player.workExpMult / gameCPS) * hashManager.getTrainingMult();\n break;\n case ClassType.GymDefense:\n cost = (CONSTANTS.ClassGymBaseCost * player.workCostMult) / gameCPS;\n defExp = (player.workExpMult / gameCPS) * hashManager.getTrainingMult();\n break;\n case ClassType.GymDexterity:\n cost = (CONSTANTS.ClassGymBaseCost * player.workCostMult) / gameCPS;\n dexExp = (player.workExpMult / gameCPS) * hashManager.getTrainingMult();\n break;\n case ClassType.GymAgility:\n cost = (CONSTANTS.ClassGymBaseCost * player.workCostMult) / gameCPS;\n agiExp = (player.workExpMult / gameCPS) * hashManager.getTrainingMult();\n break;\n default:\n throw new Error(\"ERR: Invalid/unrecognized class name\");\n }\n return {\n workMoneyLossRate: cost,\n workHackExpGainRate: hackExp * player.hacking_exp_mult * BitNodeMultipliers.ClassGymExpGain,\n workStrExpGainRate: strExp * player.strength_exp_mult * BitNodeMultipliers.ClassGymExpGain,\n workDefExpGainRate: defExp * player.defense_exp_mult * BitNodeMultipliers.ClassGymExpGain,\n workDexExpGainRate: dexExp * player.dexterity_exp_mult * BitNodeMultipliers.ClassGymExpGain,\n workAgiExpGainRate: agiExp * player.agility_exp_mult * BitNodeMultipliers.ClassGymExpGain,\n workChaExpGainRate: chaExp * player.charisma_exp_mult * BitNodeMultipliers.ClassGymExpGain,\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 as any).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 this.print(\n `${dashes}Root Access: ${c}${!isHacknet ? \", Required hacking skill: \" + (s as any).requiredHackingSkill : \"\"}`,\n );\n\n if (s.hasOwnProperty(\"numOpenPortsRequired\")) {\n this.print(dashes + \"Number of open ports required to NUKE: \" + (s as any).numOpenPortsRequired);\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 } 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 = () => any;\n\n/* Function that checks if the provided solution is the correct one */\nexport type SolverFunc = (data: any, 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: any) => 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: any[][]): string {\n const components: string[] = [];\n arr.forEach((e: any) => {\n let s: string = e.toString();\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: number): 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: number, ans: string): boolean => {\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: number[]): string => {\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: number[], ans: string): boolean => {\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: number): string => {\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: number, ans: string): boolean => {\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: [number, number[]]): string => {\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: [number, number[]], ans: string): boolean => {\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: number[][]): string => {\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: number[][], ans: string): boolean => {\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: string = removeBracketsFromArrayString(ans).replace(/\\s/g, \"\");\n const playerAns: any[] = sanitizedPlayerAns.split(\",\");\n for (let i = 0; i < playerAns.length; ++i) {\n playerAns[i] = parseInt(playerAns[i], 10);\n }\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: number[]): string => {\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: number[], ans: string): boolean => {\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: number[]): string => {\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: number[], ans: string): boolean => {\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: number[][]): string => {\n return [\n \"Given the following array of array 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: number[][], ans: string): boolean => {\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: string): 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: string, ans: string): boolean => {\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: number = parseInt(data.substring(0, a), 10);\n const B: number = parseInt(data.substring(a, a + b), 10);\n const C: number = parseInt(data.substring(a + b, a + b + c), 10);\n const D: number = 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: number[]): string => {\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: number[], ans: string): boolean => {\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: number[]): string => {\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: number[], ans: string): boolean => {\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: number[]): string => {\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: number[], ans: string): boolean => {\n let hold1: number = Number.MIN_SAFE_INTEGER;\n let hold2: number = 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: any[]): string => {\n const k: number = data[0];\n const prices: number[] = 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: (): any[] => {\n const k: number = getRandomInt(2, 10);\n const len: number = 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: any[], ans: string): boolean => {\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: number[][]): string => {\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: number[][], ans: string): boolean => {\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: number[]): string => {\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: number[], ans: string): boolean => {\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: number[][]): string => {\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: number[][], ans: string): boolean => {\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: number[][]): string => {\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: number[][], ans: string): boolean => {\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: string): 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: string, ans: string): boolean => {\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: any[]): string => {\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: (): any[] => {\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: any[], ans: string): boolean => {\n const num: string = data[0];\n const target: number = 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: number): string => {\n return [\n \"You are given the following decimal Value: \\n\",\n `${n} \\n`,\n \"Convert it into a binary string and encode it as a 'Hamming-Code'. eg:\\n \",\n \"Value 8 will result into binary '1000', which will be encoded\",\n \"with the pattern 'pppdpddd', where p is a paritybit and d a databit,\\n\",\n \"or '10101' (Value 21) will result into (pppdpdddpd) '1001101011'.\\n\\n\",\n \"NOTE: You need an parity Bit on Index 0 as an 'overall'-paritybit. \\n\",\n \"NOTE 2: You should watch the HammingCode-video from 3Blue1Brown, which explains the 'rule' of encoding,\",\n \"including the first Index parity-bit mentioned on the first note.\\n\\n\",\n \"Now the only one rule for this encoding:\\n\",\n \" It's not allowed to add additional leading '0's to the binary value\\n\",\n \"That means, the binary value has to be encoded as it is\",\n ].join(\" \");\n },\n gen: (): number => {\n return getRandomInt(Math.pow(2, 4), Math.pow(2, getRandomInt(1, 57)));\n },\n solver: (data: number, ans: string): boolean => {\n return ans === HammingEncode(data);\n },\n },\n {\n name: \"HammingCodes: Encoded Binary to Integer\",\n difficulty: 8,\n numTries: 10,\n desc: (n: string): string => {\n return [\n \"You are given the following encoded binary String: \\n\",\n `'${n}' \\n`,\n \"Treat it as a Hammingcode with 1 'possible' error on an 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 is following Hammings 'rule'\\n\",\n \"Note 2: Index 0 is an 'overall' parity bit. Watch the Hammingcode-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 \"Extranote 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 = HammingEncode(\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: string, ans: string): boolean => {\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: [number, [number, number][]]): string => {\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: any[]): 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: [number, [number, number][]], ans: string): boolean => {\n //Case where the player believes there is no solution.\n //Attempt to construct one to check if this is correct.\n if (ans == \"[]\") {\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 //Sanitize player input\n const sanitizedPlayerAns: string = removeBracketsFromArrayString(ans);\n const sanitizedPlayerAnsArr: string[] = sanitizedPlayerAns.split(\",\");\n const coloring: number[] = sanitizedPlayerAnsArr.map((val) => parseInt(val));\n\n //Solution provided case\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: string): 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: string, ans: string): boolean => {\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: string): 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 - 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: string, ans: string): boolean => {\n return ans === comprLZDecode(compr);\n },\n },\n {\n name: \"Compression III: LZ Compression\",\n difficulty: 10,\n numTries: 10,\n desc: (plaintext: string): 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 - 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: string, ans: string): boolean => {\n return comprLZDecode(ans) === plain && ans.length <= comprLZEncode(plain).length;\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.hacking + p.intelligence / 2 >= lvl;\n };\n}\n\nfunction bitFlumeRequirements() {\n return function (p: IPlayer) {\n return p.sourceFiles.length > 0 && p.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 = player.augmentations.length >= numAugReq && player.money > 1e11 && player.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.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","/**\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(levels: number): number {\n if (typeof this.cost === \"number\") {\n return this.cost;\n }\n\n return Math.round((levels + 1) * this.costPerLevel);\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","/**\n * The environment in which a script runs. The environment holds\n * Netscript functions and arguments for that script.\n */\nimport { NS } from \"src/ScriptEditor/NetscriptDefinitions\";\nimport { IMap } from \"../types\";\n\nexport class Environment {\n /**\n * Parent environment. Used to implement \"scope\"\n */\n parent: Environment | null = null;\n\n /**\n * Whether or not the script that uses this Environment should stop running\n */\n stopFlag = false;\n\n /**\n * Environment variables (currently only Netscript functions)\n */\n vars: any = {};\n\n constructor(parent: Environment | null) {\n if (parent instanceof Environment) {\n this.vars = Object.assign({}, parent.vars);\n }\n\n this.parent = parent;\n }\n\n /**\n * Finds the scope where the variable with the given name is defined\n */\n lookup(name: string): Environment | null {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let scope: Environment | null = this;\n while (scope) {\n if (Object.prototype.hasOwnProperty.call(scope.vars, name)) {\n return scope;\n }\n scope = scope.parent;\n }\n\n return null;\n }\n\n //Get the current value of a variable\n get(name: string): any {\n if (name in this.vars) {\n return this.vars[name];\n }\n\n throw new Error(`Undefined variable ${name}`);\n }\n\n //Sets the value of a variable in any scope\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n set(name: string, value: any): any {\n const scope = this.lookup(name);\n\n //If scope has a value, then this variable is already set in a higher scope, so\n //set is there. Otherwise, create a new variable in the local scope\n if (scope !== null) {\n return (scope.vars[name] = value);\n } else {\n return (this.vars[name] = value);\n }\n }\n\n //Creates (or overwrites) a variable in the current scope\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n def(name: string, value: any): any {\n return (this.vars[name] = value);\n }\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","/**\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 { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { Gang } from \"../Gang/Gang\";\nimport { AllGangs } from \"../Gang/AllGangs\";\nimport { GangMemberTasks } from \"../Gang/GangMemberTasks\";\nimport { GangMemberUpgrades } from \"../Gang/GangMemberUpgrades\";\nimport { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { GangMember } from \"../Gang/GangMember\";\nimport { GangMemberTask } from \"../Gang/GangMemberTask\";\n\nimport {\n Gang as IGang,\n GangGenInfo,\n GangOtherInfo,\n GangMemberInfo,\n GangMemberAscension,\n EquipmentStats,\n GangTaskStats,\n} from \"../ScriptEditor/NetscriptDefinitions\";\nimport { InternalAPI, NetscriptContext } from \"../Netscript/APIWrapper\";\n\nexport function NetscriptGang(player: IPlayer, workerScript: WorkerScript): 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 ctx.makeRuntimeErrorMsg(`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 ctx.makeRuntimeErrorMsg(`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 ctx.makeRuntimeErrorMsg(`Invalid task: '${name}'`);\n }\n\n return task;\n };\n\n return {\n createGang:\n (ctx: NetscriptContext) =>\n (_faction: unknown): boolean => {\n const faction = ctx.helper.string(\"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: any = {};\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 = ctx.helper.string(\"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 = ctx.helper.string(\"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 workerScript.log(\"gang.recruitMember\", () => `Successfully recruited Gang Member '${memberName}'`);\n } else {\n 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 = ctx.helper.string(\"memberName\", _memberName);\n const taskName = ctx.helper.string(\"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 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 workerScript.log(\n \"gang.setMemberTask\",\n () => `Successfully assigned Gang Member '${memberName}' to '${taskName}' task`,\n );\n } else {\n 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 = ctx.helper.string(\"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: any): number => {\n const equipName = ctx.helper.string(\"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 = ctx.helper.string(\"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 = ctx.helper.string(\"equipName\", _equipName);\n checkGangApiAccess(ctx);\n const equipment = GangMemberUpgrades[equipName];\n if (!equipment) {\n throw ctx.makeRuntimeErrorMsg(`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 = ctx.helper.string(\"memberName\", _memberName);\n const equipName = ctx.helper.string(\"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 workerScript.log(\"gang.purchaseEquipment\", () => `Purchased '${equipName}' for Gang member '${memberName}'`);\n } else {\n 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 = ctx.helper.string(\"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, workerScript);\n },\n getAscensionResult:\n (ctx: NetscriptContext) =>\n (_memberName: unknown): GangMemberAscension | undefined => {\n const memberName = ctx.helper.string(\"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 = ctx.helper.boolean(_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 workerScript.log(\"gang.setTerritoryWarfare\", () => \"Engaging in Gang Territory Warfare\");\n } else {\n gang.territoryWarfareEngaged = false;\n workerScript.log(\"gang.setTerritoryWarfare\", () => \"Disengaging in Gang Territory Warfare\");\n }\n },\n getChanceToWinClash:\n (ctx: NetscriptContext) =>\n (_otherGang: unknown): number => {\n const otherGang = ctx.helper.string(\"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 ctx.makeRuntimeErrorMsg(`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 { 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 { 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, 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(): any {\n return Generic_toJSON(\"GangMember\", this);\n }\n\n /**\n * Initiatizes a GangMember object from a JSON save state.\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): GangMember {\n return Generic_fromJSON(GangMember, value.data);\n }\n}\n\nReviver.constructors.GangMember = GangMember;\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","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 { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { FactionWorkType } from \"../Faction/FactionWorkTypeEnum\";\nimport { SleeveTaskType } from \"../PersonObjects/Sleeve/SleeveTaskTypesEnum\";\nimport { findSleevePurchasableAugs } from \"../PersonObjects/Sleeve/SleeveHelpers\";\nimport { StaticAugmentations } from \"../Augmentation/StaticAugmentations\";\nimport { CityName } from \"../Locations/data/CityNames\";\nimport { findCrime } from \"../Crime/CrimeHelpers\";\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\";\n\nexport function NetscriptSleeve(player: IPlayer): InternalAPI {\n const checkSleeveAPIAccess = function (ctx: NetscriptContext): void {\n if (player.bitNodeN !== 10 && !player.sourceFileLvl(10)) {\n throw ctx.makeRuntimeErrorMsg(\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 ctx.log(() => msg);\n throw ctx.makeRuntimeErrorMsg(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 hacking: sl.hacking,\n strength: sl.strength,\n defense: sl.defense,\n dexterity: sl.dexterity,\n agility: sl.agility,\n charisma: sl.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 = ctx.helper.number(\"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 = ctx.helper.number(\"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 = ctx.helper.number(\"sleeveNumber\", _sleeveNumber);\n const crimeRoughName = ctx.helper.string(\"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 = ctx.helper.number(\"sleeveNumber\", _sleeveNumber);\n const universityName = ctx.helper.string(\"universityName\", _universityName);\n const className = ctx.helper.string(\"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 = ctx.helper.number(\"sleeveNumber\", _sleeveNumber);\n const cityName = ctx.helper.string(\"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 ctx.makeRuntimeErrorMsg(`Invalid city name: '${cityName}'.`);\n }\n },\n setToCompanyWork:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown, acompanyName: unknown): boolean => {\n const sleeveNumber = ctx.helper.number(\"sleeveNumber\", _sleeveNumber);\n const companyName = ctx.helper.string(\"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 (other.currentTask === SleeveTaskType.Company && other.currentTaskLocation === companyName) {\n throw ctx.makeRuntimeErrorMsg(\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 = ctx.helper.number(\"sleeveNumber\", _sleeveNumber);\n const factionName = ctx.helper.string(\"factionName\", _factionName);\n const workType = ctx.helper.string(\"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 (other.currentTask === SleeveTaskType.Faction && other.currentTaskLocation === factionName) {\n throw ctx.makeRuntimeErrorMsg(\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 ctx.makeRuntimeErrorMsg(\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 = ctx.helper.number(\"sleeveNumber\", _sleeveNumber);\n const gymName = ctx.helper.string(\"gymName\", _gymName);\n const stat = ctx.helper.string(\"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 = ctx.helper.number(\"sleeveNumber\", _sleeveNumber);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n return getSleeveStats(sleeveNumber);\n },\n getTask:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown): SleeveTask => {\n const sleeveNumber = ctx.helper.number(\"sleeveNumber\", _sleeveNumber);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n\n const sl = player.sleeves[sleeveNumber];\n return {\n task: SleeveTaskType[sl.currentTask],\n crime: sl.crimeType,\n location: sl.currentTaskLocation,\n gymStatType: sl.gymStatType,\n factionWorkType: FactionWorkType[sl.factionWorkType],\n className: sl.className,\n };\n },\n getInformation:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown): SleeveInformation => {\n const sleeveNumber = ctx.helper.number(\"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 maxHp: sl.max_hp,\n\n mult: {\n agility: sl.agility_mult,\n agilityExp: sl.agility_exp_mult,\n charisma: sl.charisma_mult,\n charismaExp: sl.charisma_exp_mult,\n companyRep: sl.company_rep_mult,\n crimeMoney: sl.crime_money_mult,\n crimeSuccess: sl.crime_success_mult,\n defense: sl.defense_mult,\n defenseExp: sl.defense_exp_mult,\n dexterity: sl.dexterity_mult,\n dexterityExp: sl.dexterity_exp_mult,\n factionRep: sl.faction_rep_mult,\n hacking: sl.hacking_mult,\n hackingExp: sl.hacking_exp_mult,\n strength: sl.strength_mult,\n strengthExp: sl.strength_exp_mult,\n workMoney: sl.work_money_mult,\n },\n\n timeWorked: sl.currentTaskTime,\n earningsForSleeves: {\n workHackExpGain: sl.earningsForSleeves.hack,\n workStrExpGain: sl.earningsForSleeves.str,\n workDefExpGain: sl.earningsForSleeves.def,\n workDexExpGain: sl.earningsForSleeves.dex,\n workAgiExpGain: sl.earningsForSleeves.agi,\n workChaExpGain: sl.earningsForSleeves.cha,\n workMoneyGain: sl.earningsForSleeves.money,\n },\n earningsForPlayer: {\n workHackExpGain: sl.earningsForPlayer.hack,\n workStrExpGain: sl.earningsForPlayer.str,\n workDefExpGain: sl.earningsForPlayer.def,\n workDexExpGain: sl.earningsForPlayer.dex,\n workAgiExpGain: sl.earningsForPlayer.agi,\n workChaExpGain: sl.earningsForPlayer.cha,\n workMoneyGain: sl.earningsForPlayer.money,\n },\n earningsForTask: {\n workHackExpGain: sl.earningsForTask.hack,\n workStrExpGain: sl.earningsForTask.str,\n workDefExpGain: sl.earningsForTask.def,\n workDexExpGain: sl.earningsForTask.dex,\n workAgiExpGain: sl.earningsForTask.agi,\n workChaExpGain: sl.earningsForTask.cha,\n workMoneyGain: sl.earningsForTask.money,\n },\n workRepGain: sl.getRepGain(player),\n };\n },\n getSleeveAugmentations:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown): string[] => {\n const sleeveNumber = ctx.helper.number(\"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 = ctx.helper.number(\"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 = ctx.helper.number(\"sleeveNumber\", _sleeveNumber);\n const augName = ctx.helper.string(\"augName\", _augName);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n\n if (getSleeveStats(sleeveNumber).shock > 0) {\n throw ctx.makeRuntimeErrorMsg(`Sleeve shock too high: Sleeve ${sleeveNumber}`);\n }\n\n const aug = StaticAugmentations[augName];\n if (!aug) {\n throw ctx.makeRuntimeErrorMsg(`Invalid aug: ${augName}`);\n }\n\n return player.sleeves[sleeveNumber].tryBuyAugmentation(player, aug);\n },\n setToBladeburnerAction:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown, _action: unknown, _contract?: unknown): boolean => {\n const sleeveNumber = ctx.helper.number(\"sleeveNumber\", _sleeveNumber);\n const action = ctx.helper.string(\"action\", _action);\n let contract: string;\n if (typeof _contract === \"undefined\") {\n contract = \"------\";\n } else {\n contract = ctx.helper.string(\"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 (other.currentTask === SleeveTaskType.Bladeburner && other.bbAction === action) {\n throw ctx.helper.makeRuntimeErrorMsg(\n `Sleeve ${sleeveNumber} cannot take of 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","import { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { Exploit } from \"../Exploits/Exploit\";\nimport * as bcrypt from \"bcryptjs\";\nimport { Apr1Events as devMenu } from \"../ui/Apr1\";\nimport { InternalAPI, NetscriptContext } from \"../Netscript/APIWrapper\";\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(player: IPlayer): 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 const d = doc as any;\n d.completely_unused_field = undefined;\n const real_document: any = document;\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 ctx.helper.string(\"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 { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { WorkerScript } from \"../Netscript/WorkerScript\";\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\";\n\nexport function NetscriptHacknet(player: IPlayer, workerScript: WorkerScript): 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 ctx.makeRuntimeErrorMsg(\"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 ctx.makeRuntimeErrorMsg(\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 = ctx.helper.number(\"i\", _i);\n const node = getHacknetNode(ctx, i);\n const hasUpgraded = hasHacknetServers(player);\n const res: any = {\n name: node instanceof HacknetServer ? node.hostname : node.name,\n level: node.level,\n ram: node instanceof HacknetServer ? node.maxRam : node.ram,\n ramUsed: node instanceof HacknetServer ? node.ramUsed : undefined,\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 }\n\n return res;\n },\n upgradeLevel:\n (ctx: NetscriptContext) =>\n (_i: unknown, _n: unknown = 1): boolean => {\n const i = ctx.helper.number(\"i\", _i);\n const n = ctx.helper.number(\"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 = ctx.helper.number(\"i\", _i);\n const n = ctx.helper.number(\"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 = ctx.helper.number(\"i\", _i);\n const n = ctx.helper.number(\"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 = ctx.helper.number(\"i\", _i);\n const n = ctx.helper.number(\"n\", _n);\n if (!hasHacknetServers(player)) {\n return false;\n }\n const node = getHacknetNode(ctx, i);\n if (!(node instanceof HacknetServer)) {\n workerScript.log(\"hacknet.upgradeCache\", () => \"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 = ctx.helper.number(\"i\", _i);\n const n = ctx.helper.number(\"n\", _n);\n const node = getHacknetNode(ctx, i);\n return node.calculateLevelUpgradeCost(n, player.hacknet_node_level_cost_mult);\n },\n getRamUpgradeCost:\n (ctx: NetscriptContext) =>\n (_i: unknown, _n: unknown = 1): number => {\n const i = ctx.helper.number(\"i\", _i);\n const n = ctx.helper.number(\"n\", _n);\n const node = getHacknetNode(ctx, i);\n return node.calculateRamUpgradeCost(n, player.hacknet_node_ram_cost_mult);\n },\n getCoreUpgradeCost:\n (ctx: NetscriptContext) =>\n (_i: unknown, _n: unknown = 1): number => {\n const i = ctx.helper.number(\"i\", _i);\n const n = ctx.helper.number(\"n\", _n);\n const node = getHacknetNode(ctx, i);\n return node.calculateCoreUpgradeCost(n, player.hacknet_node_core_cost_mult);\n },\n getCacheUpgradeCost:\n (ctx: NetscriptContext) =>\n (_i: unknown, _n: unknown = 1): number => {\n const i = ctx.helper.number(\"i\", _i);\n const n = ctx.helper.number(\"n\", _n);\n if (!hasHacknetServers(player)) {\n return Infinity;\n }\n const node = getHacknetNode(ctx, i);\n if (!(node instanceof HacknetServer)) {\n workerScript.log(\"hacknet.getCacheUpgradeCost\", () => \"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): number => {\n const upgName = ctx.helper.string(\"upgName\", _upgName);\n if (!hasHacknetServers(player)) {\n return Infinity;\n }\n\n return player.hashManager.getUpgradeCost(upgName);\n },\n spendHashes:\n (ctx: NetscriptContext) =>\n (_upgName: unknown, _upgTarget: unknown = \"\"): boolean => {\n const upgName = ctx.helper.string(\"upgName\", _upgName);\n const upgTarget = ctx.helper.string(\"upgTarget\", _upgTarget);\n if (!hasHacknetServers(player)) {\n return false;\n }\n return purchaseHashUpgrade(player, upgName, upgTarget);\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 = ctx.helper.string(\"upgName\", _upgName);\n const level = player.hashManager.upgrades[upgName];\n if (level === undefined) {\n throw ctx.makeRuntimeErrorMsg(`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 { INetscriptHelper } from \"./INetscriptHelper\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { netscriptDelay } from \"../NetscriptEvaluator\";\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\";\n\nexport function NetscriptStanek(\n player: IPlayer,\n workerScript: WorkerScript,\n helper: INetscriptHelper,\n): InternalAPI {\n function checkStanekAPIAccess(func: string): void {\n if (!player.hasAugmentation(AugmentationNames.StaneksGift1, true)) {\n throw helper.makeRuntimeErrorMsg(func, \"Stanek's Gift is not installed\");\n }\n }\n\n return {\n giftWidth: () =>\n function (): number {\n checkStanekAPIAccess(\"giftWidth\");\n return staneksGift.width();\n },\n giftHeight: () =>\n function (): number {\n checkStanekAPIAccess(\"giftHeight\");\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 = _ctx.helper.number(\"rootX\", _rootX);\n const rootY = _ctx.helper.number(\"rootY\", _rootY);\n checkStanekAPIAccess(\"chargeFragment\");\n const fragment = staneksGift.findFragment(rootX, rootY);\n //Check whether the selected fragment can ge charged\n if (!fragment) throw _ctx.makeRuntimeErrorMsg(`No fragment with root (${rootX}, ${rootY}).`);\n if (fragment.fragment().type == FragmentType.Booster) {\n throw _ctx.makeRuntimeErrorMsg(\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 netscriptDelay(time, workerScript).then(function () {\n staneksGift.charge(player, fragment, workerScript.scriptRef.threads);\n _ctx.log(() => `Charged fragment with ${_ctx.workerScript.scriptRef.threads} threads.`);\n return Promise.resolve();\n });\n },\n fragmentDefinitions: (_ctx: NetscriptContext) =>\n function (): IFragment[] {\n checkStanekAPIAccess(\"fragmentDefinitions\");\n _ctx.log(() => `Returned ${Fragments.length} fragments`);\n return Fragments.map((f) => f.copy());\n },\n activeFragments: (_ctx: NetscriptContext) =>\n function (): IActiveFragment[] {\n checkStanekAPIAccess(\"activeFragments\");\n _ctx.log(() => `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(\"clearGift\");\n _ctx.log(() => `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 = _ctx.helper.number(\"rootX\", _rootX);\n const rootY = _ctx.helper.number(\"rootY\", _rootY);\n const rotation = _ctx.helper.number(\"rotation\", _rotation);\n const fragmentId = _ctx.helper.number(\"fragmentId\", _fragmentId);\n checkStanekAPIAccess(\"canPlaceFragment\");\n const fragment = FragmentById(fragmentId);\n if (!fragment) throw _ctx.makeRuntimeErrorMsg(`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 = _ctx.helper.number(\"rootX\", _rootX);\n const rootY = _ctx.helper.number(\"rootY\", _rootY);\n const rotation = _ctx.helper.number(\"rotation\", _rotation);\n const fragmentId = _ctx.helper.number(\"fragmentId\", _fragmentId);\n checkStanekAPIAccess(\"placeFragment\");\n const fragment = FragmentById(fragmentId);\n if (!fragment) throw _ctx.makeRuntimeErrorMsg(`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 = _ctx.helper.number(\"rootX\", _rootX);\n const rootY = _ctx.helper.number(\"rootY\", _rootY);\n checkStanekAPIAccess(\"getFragment\");\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 = _ctx.helper.number(\"rootX\", _rootX);\n const rootY = _ctx.helper.number(\"rootY\", _rootY);\n checkStanekAPIAccess(\"removeFragment\");\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 }\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 { IPlayer } from \"../PersonObjects/IPlayer\";\n\nimport { Infiltration as IInfiltration, InfiltrationLocation } 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\";\n\nexport function NetscriptInfiltration(player: IPlayer): 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 ctx.makeRuntimeErrorMsg(`Location '${location}' does not exists.`);\n if (location.infiltrationData === undefined)\n throw ctx.makeRuntimeErrorMsg(`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: location,\n reward: {\n tradeRep: calculateTradeInformationRepReward(player, reward, maxLevel, difficulty),\n sellCash: calculateSellInformationCashReward(player, reward, maxLevel, difficulty),\n SoARep: calculateInfiltratorsRepReward(player, Factions[FactionNames.ShadowsOfAnarchy], difficulty),\n },\n difficulty: difficulty,\n };\n };\n return {\n getPossibleLocations: () => (): string[] => {\n return getLocationsWithInfiltrations.map((l) => l + \"\");\n },\n getInfiltration:\n (ctx: NetscriptContext) =>\n (_location: unknown): InfiltrationLocation => {\n const location = ctx.helper.string(\"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 \"src/Netscript/APIWrapper\";\nimport { Terminal } from \"../../src/Terminal\";\n\nexport function NetscriptUserInterface(): InternalAPI {\n return {\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 ctx.log(() => `Successfully set theme`);\n } else {\n ctx.log(() => `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 ctx.log(() => `Successfully set styles`);\n } else {\n ctx.log(() => `Failed to set styles. Errors: ${errors.join(\", \")}`);\n }\n },\n\n resetTheme: (ctx: NetscriptContext) => (): void => {\n Settings.theme = { ...defaultTheme };\n ThemeEvents.emit();\n ctx.log(() => `Reinitialized theme to default`);\n },\n\n resetStyles: (ctx: NetscriptContext) => (): void => {\n Settings.styles = { ...defaultStyles };\n ThemeEvents.emit();\n ctx.log(() => `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 ctx.log(() => `Clearing terminal`);\n Terminal.clear();\n },\n };\n}\n","import { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\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\";\n\nexport function NetscriptBladeburner(player: IPlayer, workerScript: WorkerScript): 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 ctx.makeRuntimeErrorMsg(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 ctx.makeRuntimeErrorMsg(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 ctx.makeRuntimeErrorMsg(`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 ctx.makeRuntimeErrorMsg(`Invalid action type='${type}', name='${name}'`);\n }\n const actionObj = bladeburner.getActionObject(actionId);\n if (!actionObj) {\n throw ctx.makeRuntimeErrorMsg(`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 = ctx.helper.string(\"blackOpName\", _blackOpName);\n checkBladeburnerAccess(ctx);\n const action: any = getBladeburnerActionObject(ctx, \"blackops\", blackOpName);\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 = ctx.helper.string(\"type\", _type);\n const name = ctx.helper.string(\"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, workerScript);\n } catch (e: any) {\n throw ctx.makeRuntimeErrorMsg(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 = ctx.helper.string(\"type\", _type);\n const name = ctx.helper.string(\"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 ctx.log(() => errorLogText);\n return -1;\n } else {\n return time;\n }\n } catch (e: any) {\n throw ctx.makeRuntimeErrorMsg(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: any) {\n throw ctx.makeRuntimeErrorMsg(e);\n }\n },\n getActionEstimatedSuccessChance:\n (ctx: NetscriptContext) =>\n (_type: unknown, _name: unknown): [number, number] => {\n const type = ctx.helper.string(\"type\", _type);\n const name = ctx.helper.string(\"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 ctx.log(() => errorLogText);\n return [-1, -1];\n } else {\n return chance;\n }\n } catch (e: any) {\n throw ctx.makeRuntimeErrorMsg(e);\n }\n },\n getActionRepGain:\n (ctx: NetscriptContext) =>\n (_type: unknown, _name: unknown, _level: unknown): number => {\n const type = ctx.helper.string(\"type\", _type);\n const name = ctx.helper.string(\"name\", _name);\n const level = ctx.helper.number(\"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 = ctx.helper.string(\"type\", _type);\n const name = ctx.helper.string(\"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, workerScript);\n } catch (e: any) {\n throw ctx.makeRuntimeErrorMsg(e);\n }\n },\n getActionMaxLevel:\n (ctx: NetscriptContext) =>\n (_type: unknown, _name: unknown): number => {\n const type = ctx.helper.string(\"type\", _type);\n const name = ctx.helper.string(\"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 = ctx.helper.string(\"type\", _type);\n const name = ctx.helper.string(\"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 = ctx.helper.string(\"type\", _type);\n const name = ctx.helper.string(\"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 = ctx.helper.string(\"type\", _type);\n const name = ctx.helper.string(\"name\", _name);\n const autoLevel = ctx.helper.boolean(_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 = ctx.helper.string(\"type\", _type);\n const name = ctx.helper.string(\"name\", _name);\n const level = ctx.helper.number(\"level\", _level);\n checkBladeburnerAccess(ctx);\n const action = getBladeburnerActionObject(ctx, type, name);\n if (level < 1 || level > action.maxLevel) {\n ctx.helper.makeRuntimeErrorMsg(`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 = ctx.helper.string(\"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, workerScript);\n } catch (e: any) {\n throw ctx.makeRuntimeErrorMsg(e);\n }\n },\n getSkillUpgradeCost:\n (ctx: NetscriptContext) =>\n (_skillName: unknown): number => {\n const skillName = ctx.helper.string(\"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.getSkillUpgradeCostNetscriptFn(skillName, workerScript);\n } catch (e: any) {\n throw ctx.makeRuntimeErrorMsg(e);\n }\n },\n upgradeSkill:\n (ctx: NetscriptContext) =>\n (_skillName: unknown): boolean => {\n const skillName = ctx.helper.string(\"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.upgradeSkillNetscriptFn(skillName, workerScript);\n } catch (e: any) {\n throw ctx.makeRuntimeErrorMsg(e);\n }\n },\n getTeamSize:\n (ctx: NetscriptContext) =>\n (_type: unknown, _name: unknown): number => {\n const type = ctx.helper.string(\"type\", _type);\n const name = ctx.helper.string(\"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, workerScript);\n } catch (e: any) {\n throw ctx.makeRuntimeErrorMsg(e);\n }\n },\n setTeamSize:\n (ctx: NetscriptContext) =>\n (_type: unknown, _name: unknown, _size: unknown): number => {\n const type = ctx.helper.string(\"type\", _type);\n const name = ctx.helper.string(\"name\", _name);\n const size = ctx.helper.number(\"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, workerScript);\n } catch (e: any) {\n throw ctx.makeRuntimeErrorMsg(e);\n }\n },\n getCityEstimatedPopulation:\n (ctx: NetscriptContext) =>\n (_cityName: unknown): number => {\n const cityName = ctx.helper.string(\"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 = ctx.helper.string(\"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 = ctx.helper.string(\"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 = ctx.helper.string(\"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(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.strength >= 100 &&\n player.defense >= 100 &&\n player.dexterity >= 100 &&\n player.agility >= 100\n ) {\n player.bladeburner = new Bladeburner(player);\n ctx.log(() => \"You have been accepted into the Bladeburner division\");\n\n return true;\n } else {\n ctx.log(() => \"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 { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { is2DArray } from \"../utils/helpers/is2DArray\";\nimport { CodingContract } from \"../CodingContracts\";\nimport { CodingAttemptOptions, CodingContract as ICodingContract } from \"../ScriptEditor/NetscriptDefinitions\";\nimport { InternalAPI, NetscriptContext } from \"src/Netscript/APIWrapper\";\n\nexport function NetscriptCodingContract(player: IPlayer, workerScript: WorkerScript): InternalAPI {\n const getCodingContract = function (\n ctx: NetscriptContext,\n func: string,\n hostname: string,\n filename: string,\n ): CodingContract {\n const server = ctx.helper.getServer(hostname);\n const contract = server.getContract(filename);\n if (contract == null) {\n throw ctx.makeRuntimeErrorMsg(`Cannot find contract '${filename}' on server '${hostname}'`);\n }\n\n return contract;\n };\n\n return {\n attempt:\n (ctx: NetscriptContext) =>\n (\n answer: any,\n _filename: unknown,\n _hostname: unknown = workerScript.hostname,\n { returnReward }: CodingAttemptOptions = { returnReward: false },\n ): boolean | string => {\n const filename = ctx.helper.string(\"filename\", _filename);\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const contract = getCodingContract(ctx, \"attempt\", hostname, filename);\n\n // Convert answer to string. If the answer is a 2D array, then we have to\n // manually add brackets for the inner arrays\n if (is2DArray(answer)) {\n const answerComponents = [];\n for (let i = 0; i < answer.length; ++i) {\n answerComponents.push([\"[\", answer[i].toString(), \"]\"].join(\"\"));\n }\n\n answer = answerComponents.join(\",\");\n } else {\n answer = String(answer);\n }\n\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 = ctx.helper.getServer(hostname);\n if (contract.isSolution(answer)) {\n const reward = player.gainCodingContractReward(creward, contract.getDifficulty());\n ctx.log(() => `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 ctx.log(() => `Coding Contract attempt '${filename}' failed. Contract is now self-destructing`);\n serv.removeContract(filename);\n } else {\n ctx.log(\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 = workerScript.hostname): string => {\n const filename = ctx.helper.string(\"filename\", _filename);\n const hostname = ctx.helper.string(\"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 = workerScript.hostname): any => {\n const filename = ctx.helper.string(\"filename\", _filename);\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const contract = getCodingContract(ctx, \"getData\", hostname, filename);\n const data = contract.getData();\n if (data.constructor === Array) {\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 = workerScript.hostname): string => {\n const filename = ctx.helper.string(\"filename\", _filename);\n const hostname = ctx.helper.string(\"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 = workerScript.hostname): number => {\n const filename = ctx.helper.string(\"filename\", _filename);\n const hostname = ctx.helper.string(\"hostname\", _hostname);\n const contract = getCodingContract(ctx, \"getNumTriesRemaining\", hostname, filename);\n return contract.getMaxNumTries() - contract.tries;\n },\n };\n}\n","export function isArray(arr: unknown): arr is unknown[] {\n return Array.isArray(arr);\n}\n\n// Checks whether an array is a 2D array.\n// For this, a 2D array is an array which contains only other arrays.\n// If one element in the array is a number or string, it is NOT a 2D array\nexport function is2DArray(arr: unknown): arr is unknown[][] {\n return isArray(arr) && arr.every((u) => isArray(u));\n}\n","import { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { netscriptDelay } from \"../NetscriptEvaluator\";\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} 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 UpgradeOfficeSize,\n ThrowParty,\n PurchaseWarehouse,\n UpgradeWarehouse,\n BuyCoffee,\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 { calculateIntelligenceBonus } from \"../PersonObjects/formulas/intelligence\";\nimport { Industry } from \"../Corporation/Industry\";\nimport { IndustryResearchTrees, IndustryStartingCosts } from \"../Corporation/IndustryData\";\nimport { CorporationConstants } from \"../Corporation/data/Constants\";\nimport { IndustryUpgrades } from \"../Corporation/IndustryUpgrades\";\nimport { ResearchMap } from \"../Corporation/ResearchMap\";\nimport { Factions } from \"../Faction/Factions\";\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { InternalAPI, NetscriptContext } from \"src/Netscript/APIWrapper\";\n\nexport function NetscriptCorporation(player: IPlayer, workerScript: WorkerScript): 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 = ctx.helper.string(\"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 = ctx.helper.string(\"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, amountShares: number): boolean {\n if (!player.factions.includes(factionName)) throw new Error(\"Invalid faction name\");\n if (isNaN(amountCash) || amountCash < 0 || isNaN(amountShares) || amountShares < 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 if (corporation.numShares < amountShares) 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 + amountShares * corporation.sharePrice) / CorporationConstants.BribeToRepRatio;\n faction.playerReputation += repGain;\n corporation.funds = corporation.funds - amountCash;\n corporation.numShares -= amountShares;\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 ctx.makeRuntimeErrorMsg(\"Must own a corporation.\");\n if (!api) return;\n\n if (!player.corporation.unlockUpgrades[api]) throw ctx.makeRuntimeErrorMsg(\"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: division.upgrades.slice(),\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 = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const amt = ctx.helper.number(\"amount\", _amt);\n if (amt < 1) {\n throw ctx.makeRuntimeErrorMsg(\"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 = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"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 = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"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 = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const materialName = ctx.helper.string(\"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 = ctx.helper.string(\"divisionName\", _divisionName);\n const productName = ctx.helper.string(\"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 = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"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 = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const amt = ctx.helper.number(\"amount\", _amt);\n const corporation = getCorporation();\n if (amt < 1) {\n throw ctx.makeRuntimeErrorMsg(\"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 = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const materialName = ctx.helper.string(\"materialName\", _materialName);\n const amt = ctx.helper.string(\"amt\", _amt);\n const price = ctx.helper.string(\"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 = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const productName = ctx.helper.string(\"productName\", _productName);\n const amt = ctx.helper.string(\"amt\", _amt);\n const price = ctx.helper.string(\"price\", _price);\n const all = ctx.helper.boolean(_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 = ctx.helper.string(\"divisionName\", _divisionName);\n const productName = ctx.helper.string(\"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 = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const enabled = ctx.helper.boolean(_enabled);\n const warehouse = getWarehouse(divisionName, cityName);\n if (!hasUnlockUpgrade(\"Smart Supply\"))\n throw ctx.makeRuntimeErrorMsg(`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 = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const materialName = ctx.helper.string(\"materialName\", _materialName);\n const enabled = ctx.helper.boolean(_enabled);\n const warehouse = getWarehouse(divisionName, cityName);\n const material = getMaterial(divisionName, cityName, materialName);\n if (!hasUnlockUpgrade(\"Smart Supply\"))\n throw ctx.makeRuntimeErrorMsg(`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 = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const materialName = ctx.helper.string(\"materialName\", _materialName);\n const amt = ctx.helper.number(\"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 = ctx.helper.string(\"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 = ctx.helper.city(\"cityName\", _cityName);\n const materialName = ctx.helper.string(\"materialName\", _materialName);\n const amt = ctx.helper.number(\"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 = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const productName = ctx.helper.string(\"productName\", _productName);\n const designInvest = ctx.helper.number(\"designInvest\", _designInvest);\n const marketingInvest = ctx.helper.number(\"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 = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const productName = ctx.helper.string(\"productName\", _productName);\n const qty = ctx.helper.number(\"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 = ctx.helper.string(\"sourceDivision\", _sourceDivision);\n const sourceCity = ctx.helper.string(\"sourceCity\", _sourceCity);\n const targetDivision = ctx.helper.string(\"targetDivision\", _targetDivision);\n const targetCity = ctx.helper.string(\"targetCity\", _targetCity);\n const materialName = ctx.helper.string(\"materialName\", _materialName);\n const amt = ctx.helper.string(\"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 = ctx.helper.string(\"sourceDivision\", _sourceDivision);\n const sourceCity = ctx.helper.string(\"sourceCity\", _sourceCity);\n const targetDivision = ctx.helper.string(\"targetDivision\", _targetDivision);\n const targetCity = ctx.helper.string(\"targetCity\", _targetCity);\n const materialName = ctx.helper.string(\"materialName\", _materialName);\n const amt = ctx.helper.string(\"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 = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const materialName = ctx.helper.string(\"materialName\", _materialName);\n const qty = ctx.helper.number(\"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 = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const materialName = ctx.helper.string(\"materialName\", _materialName);\n const on = ctx.helper.boolean(_on);\n if (!getDivision(divisionName).hasResearch(\"Market-TA.I\"))\n throw ctx.makeRuntimeErrorMsg(`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 = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const materialName = ctx.helper.string(\"materialName\", _materialName);\n const on = ctx.helper.boolean(_on);\n if (!getDivision(divisionName).hasResearch(\"Market-TA.II\"))\n throw ctx.makeRuntimeErrorMsg(`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 = ctx.helper.string(\"divisionName\", _divisionName);\n const productName = ctx.helper.string(\"productName\", _productName);\n const on = ctx.helper.boolean(_on);\n if (!getDivision(divisionName).hasResearch(\"Market-TA.I\"))\n throw ctx.makeRuntimeErrorMsg(`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 = ctx.helper.string(\"divisionName\", _divisionName);\n const productName = ctx.helper.string(\"productName\", _productName);\n const on = ctx.helper.boolean(_on);\n if (!getDivision(divisionName).hasResearch(\"Market-TA.II\"))\n throw ctx.makeRuntimeErrorMsg(`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 = ctx.helper.string(\"divisionName\", _divisionName);\n const division = getDivision(divisionName);\n const upgrade = IndustryUpgrades[1];\n return upgrade[1] * Math.pow(upgrade[2], division.upgrades[1]);\n },\n getHireAdVertCount:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown): number => {\n checkAccess(ctx, 8);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const division = getDivision(divisionName);\n return division.upgrades[1];\n },\n getResearchCost:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _researchName: unknown): number => {\n checkAccess(ctx, 8);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const researchName = ctx.helper.string(\"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 = ctx.helper.string(\"divisionName\", _divisionName);\n const researchName = ctx.helper.string(\"researchName\", _researchName);\n return hasResearched(getDivision(divisionName), researchName);\n },\n setAutoJobAssignment:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _job: unknown, _amount: unknown): Promise => {\n checkAccess(ctx, 8);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const amount = ctx.helper.number(\"amount\", _amount);\n const job = ctx.helper.string(\"job\", _job);\n const office = getOffice(divisionName, cityName);\n if (!Object.values(EmployeePositions).includes(job)) throw new Error(`'${job}' is not a valid job.`);\n return netscriptDelay(1000, workerScript).then(function () {\n return Promise.resolve(office.setEmployeeToJob(job, amount));\n });\n },\n getOfficeSizeUpgradeCost:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _size: unknown): number => {\n checkAccess(ctx, 8);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const size = ctx.helper.number(\"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): Promise => {\n checkAccess(ctx, 8);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const employeeName = ctx.helper.string(\"employeeName\", _employeeName);\n const job = ctx.helper.string(\"job\", _job);\n const employee = getEmployee(divisionName, cityName, employeeName);\n return netscriptDelay([\"Training\", \"Unassigned\"].includes(employee.pos) ? 0 : 1000, workerScript).then(function () {\n return Promise.resolve(AssignJob(employee, job));\n });\n },\n hireEmployee:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown): any => {\n checkAccess(ctx, 8);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"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 = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const size = ctx.helper.number(\"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 async (_divisionName: unknown, _cityName: unknown, _costPerEmployee: unknown): Promise => {\n checkAccess(ctx, 8);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const costPerEmployee = ctx.helper.number(\"costPerEmployee\", _costPerEmployee);\n if (costPerEmployee < 0)\n throw new Error(\"Invalid value for Cost Per Employee field! Must be numeric and greater than 0\");\n const office = getOffice(divisionName, cityName);\n const corporation = getCorporation();\n return netscriptDelay(\n (60 * 1000) / (player.hacking_speed_mult * calculateIntelligenceBonus(player.intelligence, 1)),\n workerScript,\n ).then(function () {\n return Promise.resolve(ThrowParty(corporation, office, costPerEmployee));\n });\n },\n buyCoffee:\n (ctx: NetscriptContext) =>\n async (_divisionName: unknown, _cityName: unknown): Promise => {\n checkAccess(ctx, 8);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const corporation = getCorporation();\n return netscriptDelay(\n (60 * 1000) / (player.hacking_speed_mult * calculateIntelligenceBonus(player.intelligence, 1)),\n workerScript,\n ).then(function () {\n return Promise.resolve(BuyCoffee(corporation, getDivision(divisionName), getOffice(divisionName, cityName)));\n });\n },\n hireAdVert:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown): void => {\n checkAccess(ctx, 8);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const corporation = getCorporation();\n HireAdVert(corporation, getDivision(divisionName), getOffice(divisionName, \"Sector-12\"));\n },\n research:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _researchName: unknown): void => {\n checkAccess(ctx, 8);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const researchName = ctx.helper.string(\"researchName\", _researchName);\n Research(getDivision(divisionName), researchName);\n },\n getOffice:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown): any => {\n checkAccess(ctx, 8);\n const divisionName = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"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 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 },\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 = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"cityName\", _cityName);\n const employeeName = ctx.helper.string(\"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 expandIndustry:\n (ctx: NetscriptContext) =>\n (_industryName: unknown, _divisionName: unknown): void => {\n checkAccess(ctx);\n const industryName = ctx.helper.string(\"industryName\", _industryName);\n const divisionName = ctx.helper.string(\"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 = ctx.helper.string(\"divisionName\", _divisionName);\n const cityName = ctx.helper.city(\"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 = ctx.helper.string(\"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 = ctx.helper.string(\"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 (_percent: unknown): void => {\n checkAccess(ctx);\n const percent = ctx.helper.number(\"percent\", _percent);\n if (percent < 0 || percent > 100)\n throw new Error(\"Invalid value for percent field! Must be numeric, greater than 0, and less than 100\");\n const corporation = getCorporation();\n if (!corporation.public) throw ctx.makeRuntimeErrorMsg(`Your company has not gone public!`);\n IssueDividends(corporation, percent);\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 = ctx.helper.string(\"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 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 = ctx.helper.string(\"corporationName\", _corporationName);\n const selfFund = ctx.helper.boolean(_selfFund);\n return createCorporation(corporationName, selfFund);\n },\n hasUnlockUpgrade:\n (ctx: NetscriptContext) =>\n (_upgradeName: unknown): boolean => {\n checkAccess(ctx);\n const upgradeName = ctx.helper.string(\"upgradeName\", _upgradeName);\n return hasUnlockUpgrade(upgradeName);\n },\n getUnlockUpgradeCost:\n (ctx: NetscriptContext) =>\n (_upgradeName: unknown): number => {\n checkAccess(ctx);\n const upgradeName = ctx.helper.string(\"upgradeName\", _upgradeName);\n return getUnlockUpgradeCost(upgradeName);\n },\n getUpgradeLevel:\n (ctx: NetscriptContext) =>\n (_upgradeName: unknown): number => {\n checkAccess(ctx);\n const upgradeName = ctx.helper.string(\"upgradeName\", _upgradeName);\n return getUpgradeLevel(ctx, upgradeName);\n },\n getUpgradeLevelCost:\n (ctx: NetscriptContext) =>\n (_upgradeName: unknown): number => {\n checkAccess(ctx);\n const upgradeName = ctx.helper.string(\"upgradeName\", _upgradeName);\n return getUpgradeLevelCost(ctx, upgradeName);\n },\n getExpandIndustryCost:\n (ctx: NetscriptContext) =>\n (_industryName: unknown): number => {\n checkAccess(ctx);\n const industryName = ctx.helper.string(\"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 = ctx.helper.number(\"numShares\", _numShares);\n return goPublic(numShares);\n },\n sellShares:\n (ctx: NetscriptContext) =>\n (_numShares: unknown): number => {\n checkAccess(ctx);\n const numShares = ctx.helper.number(\"numShares\", _numShares);\n return SellShares(getCorporation(), player, numShares);\n },\n buyBackShares:\n (ctx: NetscriptContext) =>\n (_numShares: unknown): boolean => {\n checkAccess(ctx);\n const numShares = ctx.helper.number(\"numShares\", _numShares);\n return BuyBackShares(getCorporation(), player, numShares);\n },\n bribe:\n (ctx: NetscriptContext) =>\n (_factionName: unknown, _amountCash: unknown, _amountShares: unknown): boolean => {\n checkAccess(ctx);\n const factionName = ctx.helper.string(\"factionName\", _factionName);\n const amountCash = ctx.helper.number(\"amountCash\", _amountCash);\n const amountShares = ctx.helper.number(\"amountShares\", _amountShares);\n return bribe(factionName, amountCash, amountShares);\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 } 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\";\nimport { IndustryUpgrade, IndustryUpgrades } from \"./IndustryUpgrades\";\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 //Upgrades\n upgrades: number[] = Array(Object.keys(IndustryUpgrades).length).fill(0);\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 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 // Designing/Creating a Product is based mostly off Engineers\n const engrProd = office.employeeProd[EmployeePositions.Engineer];\n const mgmtProd = office.employeeProd[EmployeePositions.Management];\n const opProd = office.employeeProd[EmployeePositions.Operations];\n const total = engrProd + mgmtProd + opProd;\n if (total <= 0) {\n break;\n }\n\n // Management is a multiplier for the production from Engineers\n const mgmtFactor = 1 + mgmtProd / (1.2 * total);\n\n const progress = (Math.pow(engrProd, 0.34) + Math.pow(opProd, 0.2)) * mgmtFactor;\n\n prod.createProduct(marketCycles, progress);\n if (prod.prog >= 100) {\n prod.finishProduct(office.employeeProd, 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 upgrade(upgrade: IndustryUpgrade, refs: { corporation: ICorporation; office: OfficeSpace }): void {\n const corporation = refs.corporation;\n const office = refs.office;\n const upgN = upgrade[0];\n while (this.upgrades.length <= upgN) {\n this.upgrades.push(0);\n }\n ++this.upgrades[upgN];\n\n switch (upgN) {\n case 0: {\n //Coffee, 5% energy per employee\n for (let i = 0; i < office.employees.length; ++i) {\n office.employees[i].ene = Math.min(office.employees[i].ene * 1.05, office.maxEne);\n }\n break;\n }\n case 1: {\n //AdVert.Inc,\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 break;\n }\n default: {\n console.error(`Un-implemented function index: ${upgN}`);\n break;\n }\n }\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(): any {\n return Generic_toJSON(\"Industry\", this);\n }\n\n /**\n * Initiatizes a Industry object from a JSON save state.\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): 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, Reviver } from \"../utils/JSONReviver\";\nimport { EmployeePositions } from \"./EmployeePositions\";\nimport { ICorporation } from \"./ICorporation\";\nimport { OfficeSpace } from \"./OfficeSpace\";\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\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 }\n\n //Returns the amount the employee needs to be paid\n process(marketCycles = 1, office: OfficeSpace): number {\n const gain = 0.003 * marketCycles,\n 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 if (this.ene < office.minEne) {\n this.ene = office.minEne;\n }\n if (this.hap < office.minHap) {\n this.hap = office.minHap;\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 //Process benefits from having an office party thrown\n throwParty(money: number): number {\n const mult = 1 + money / 10e6;\n this.mor *= mult;\n this.mor = Math.min(100, this.mor);\n this.hap *= mult;\n this.hap = Math.min(100, this.hap);\n return mult;\n }\n\n toJSON(): any {\n return Generic_toJSON(\"Employee\", this);\n }\n\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): 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 { INetscriptHelper } from \"./INetscriptHelper\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\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 { Formulas as IFormulas } 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\";\n\nexport function NetscriptFormulas(player: IPlayer, helper: INetscriptHelper): InternalAPI {\n const checkFormulasAccess = function (ctx: NetscriptContext): void {\n if (!player.hasProgram(Programs.Formulas.name)) {\n throw helper.makeRuntimeErrorMsg(`formulas.${ctx.function}`, `Requires Formulas.exe to run.`);\n }\n };\n return {\n reputation: {\n calculateFavorToRep:\n (ctx: NetscriptContext) =>\n (_favor: unknown): number => {\n const favor = ctx.helper.number(\"favor\", _favor);\n checkFormulasAccess(ctx);\n return calculateFavorToRep(favor);\n },\n calculateRepToFavor:\n (ctx: NetscriptContext) =>\n (_rep: unknown): number => {\n const rep = ctx.helper.number(\"rep\", _rep);\n checkFormulasAccess(ctx);\n return calculateRepToFavor(rep);\n },\n repFromDonation:\n (ctx: NetscriptContext) =>\n (_amount: unknown, player: any): number => {\n const amount = ctx.helper.number(\"amount\", _amount);\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 = ctx.helper.number(\"exp\", _exp);\n const mult = ctx.helper.number(\"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 = ctx.helper.number(\"skill\", _skill);\n const mult = ctx.helper.number(\"mult\", _mult);\n checkFormulasAccess(ctx);\n return calculateExp(skill, mult);\n },\n },\n hacking: {\n hackChance:\n (ctx: NetscriptContext) =>\n (server: any, player: any): number => {\n checkFormulasAccess(ctx);\n return calculateHackingChance(server, player);\n },\n hackExp:\n (ctx: NetscriptContext) =>\n (server: any, player: any): number => {\n checkFormulasAccess(ctx);\n return calculateHackingExpGain(server, player);\n },\n hackPercent:\n (ctx: NetscriptContext) =>\n (server: any, player: any): number => {\n checkFormulasAccess(ctx);\n return calculatePercentMoneyHacked(server, player);\n },\n growPercent:\n (ctx: NetscriptContext) =>\n (server: any, _threads: unknown, player: any, _cores: unknown = 1): number => {\n const threads = ctx.helper.number(\"threads\", _threads);\n const cores = ctx.helper.number(\"cores\", _cores);\n checkFormulasAccess(ctx);\n return calculateServerGrowth(server, threads, player, cores);\n },\n hackTime:\n (ctx: NetscriptContext) =>\n (server: any, player: any): number => {\n checkFormulasAccess(ctx);\n return calculateHackingTime(server, player) * 1000;\n },\n growTime:\n (ctx: NetscriptContext) =>\n (server: any, player: any): number => {\n checkFormulasAccess(ctx);\n return calculateGrowTime(server, player) * 1000;\n },\n weakenTime:\n (ctx: NetscriptContext) =>\n (server: any, player: any): number => {\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 = ctx.helper.number(\"level\", _level);\n const ram = ctx.helper.number(\"ram\", _ram);\n const cores = ctx.helper.number(\"cores\", _cores);\n const mult = ctx.helper.number(\"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 = ctx.helper.number(\"startingLevel\", _startingLevel);\n const extraLevels = ctx.helper.number(\"extraLevels\", _extraLevels);\n const costMult = ctx.helper.number(\"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 = ctx.helper.number(\"startingRam\", _startingRam);\n const extraLevels = ctx.helper.number(\"extraLevels\", _extraLevels);\n const costMult = ctx.helper.number(\"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 = ctx.helper.number(\"startingCore\", _startingCore);\n const extraCores = ctx.helper.number(\"extraCores\", _extraCores);\n const costMult = ctx.helper.number(\"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 = ctx.helper.number(\"n\", _n);\n const mult = ctx.helper.number(\"mult\", _mult);\n checkFormulasAccess(ctx);\n return calculateNodeCost(n, mult);\n },\n constants: (ctx: NetscriptContext) => (): any => {\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 = ctx.helper.number(\"level\", _level);\n const ramUsed = ctx.helper.number(\"ramUsed\", _ramUsed);\n const maxRam = ctx.helper.number(\"maxRam\", _maxRam);\n const cores = ctx.helper.number(\"cores\", _cores);\n const mult = ctx.helper.number(\"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 = ctx.helper.number(\"startingLevel\", _startingLevel);\n const extraLevels = ctx.helper.number(\"extraLevels\", _extraLevels);\n const costMult = ctx.helper.number(\"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 = ctx.helper.number(\"startingRam\", _startingRam);\n const extraLevels = ctx.helper.number(\"extraLevels\", _extraLevels);\n const costMult = ctx.helper.number(\"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 = ctx.helper.number(\"startingCore\", _startingCore);\n const extraCores = ctx.helper.number(\"extraCores\", _extraCores);\n const costMult = ctx.helper.number(\"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 = ctx.helper.number(\"startingCache\", _startingCache);\n const extraCache = ctx.helper.number(\"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 = helper.string(\"hashUpgradeCost\", \"upgName\", _upgName);\n const level = ctx.helper.number(\"level\", _level);\n checkFormulasAccess(ctx);\n const upg = player.hashManager.getUpgrade(upgName);\n if (!upg) {\n throw helper.makeRuntimeErrorMsg(\n \"formulas.hacknetServers.calculateHashUpgradeCost\",\n `Invalid Hash Upgrade: ${upgName}`,\n );\n }\n return upg.getCost(level);\n },\n hacknetServerCost:\n (ctx: NetscriptContext) =>\n (_n: unknown, _mult: unknown = 1): number => {\n const n = ctx.helper.number(\"n\", _n);\n const mult = ctx.helper.number(\"mult\", _mult);\n checkFormulasAccess(ctx);\n return HScalculateServerCost(n, mult);\n },\n constants: (ctx: NetscriptContext) => (): any => {\n checkFormulasAccess(ctx);\n return Object.assign({}, HacknetServerConstants);\n },\n },\n gang: {\n wantedPenalty:\n (ctx: NetscriptContext) =>\n (gang: any): number => {\n checkFormulasAccess(ctx);\n return calculateWantedPenalty(gang);\n },\n respectGain:\n (ctx: NetscriptContext) =>\n (gang: any, member: any, task: any): number => {\n checkFormulasAccess(ctx);\n return calculateRespectGain(gang, member, task);\n },\n wantedLevelGain:\n (ctx: NetscriptContext) =>\n (gang: any, member: any, task: any): number => {\n checkFormulasAccess(ctx);\n return calculateWantedLevelGain(gang, member, task);\n },\n moneyGain:\n (ctx: NetscriptContext) =>\n (gang: any, member: any, task: any): number => {\n checkFormulasAccess(ctx);\n return calculateMoneyGain(gang, member, task);\n },\n ascensionPointsGain:\n (ctx: NetscriptContext) =>\n (_exp: unknown): number => {\n const exp = ctx.helper.number(\"exp\", _exp);\n checkFormulasAccess(ctx);\n return calculateAscensionPointsGain(exp);\n },\n ascensionMultiplier:\n (ctx: NetscriptContext) =>\n (_points: unknown): number => {\n const points = ctx.helper.number(\"points\", _points);\n checkFormulasAccess(ctx);\n return calculateAscensionMult(points);\n },\n },\n };\n}\n","import { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\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 { TIX } from \"../ScriptEditor/NetscriptDefinitions\";\nimport { InternalAPI, NetscriptContext } from \"src/Netscript/APIWrapper\";\n\nexport function NetscriptStockMarket(player: IPlayer, workerScript: WorkerScript): 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 ctx.makeRuntimeErrorMsg(`You don't have WSE Access! Cannot use ${ctx.function}()`);\n }\n if (!player.hasTixApiAccess) {\n throw ctx.makeRuntimeErrorMsg(`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 ctx.makeRuntimeErrorMsg(`Invalid stock symbol: '${symbol}'`);\n }\n\n return stock;\n };\n\n return {\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 = ctx.helper.string(\"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 = ctx.helper.string(\"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 = ctx.helper.string(\"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 = ctx.helper.string(\"symbol\", _symbol);\n checkTixApiAccess(ctx);\n const stock = SymbolToStockMap[symbol];\n if (stock == null) {\n throw ctx.makeRuntimeErrorMsg(`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 = ctx.helper.string(\"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 = ctx.helper.string(\"symbol\", _symbol);\n let shares = ctx.helper.number(\"shares\", _shares);\n const posType = ctx.helper.string(\"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 = ctx.helper.string(\"symbol\", _symbol);\n let shares = ctx.helper.number(\"shares\", _shares);\n const posType = ctx.helper.string(\"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 buy:\n (ctx: NetscriptContext) =>\n (_symbol: unknown, _shares: unknown): number => {\n const symbol = ctx.helper.string(\"symbol\", _symbol);\n const shares = ctx.helper.number(\"shares\", _shares);\n checkTixApiAccess(ctx);\n const stock = getStockFromSymbol(ctx, symbol);\n const res = buyStock(stock, shares, workerScript, {});\n return res ? stock.getAskPrice() : 0;\n },\n sell:\n (ctx: NetscriptContext) =>\n (_symbol: unknown, _shares: unknown): number => {\n const symbol = ctx.helper.string(\"symbol\", _symbol);\n const shares = ctx.helper.number(\"shares\", _shares);\n checkTixApiAccess(ctx);\n const stock = getStockFromSymbol(ctx, symbol);\n const res = sellStock(stock, shares, workerScript, {});\n\n return res ? stock.getBidPrice() : 0;\n },\n short:\n (ctx: NetscriptContext) =>\n (_symbol: unknown, _shares: unknown): number => {\n const symbol = ctx.helper.string(\"symbol\", _symbol);\n const shares = ctx.helper.number(\"shares\", _shares);\n checkTixApiAccess(ctx);\n if (player.bitNodeN !== 8) {\n if (player.sourceFileLvl(8) <= 1) {\n throw ctx.makeRuntimeErrorMsg(\"You must either be in BitNode-8 or you must have Source-File 8 Level 2.\");\n }\n }\n const stock = getStockFromSymbol(ctx, symbol);\n const res = shortStock(stock, shares, workerScript, {});\n\n return res ? stock.getBidPrice() : 0;\n },\n sellShort:\n (ctx: NetscriptContext) =>\n (_symbol: unknown, _shares: unknown): number => {\n const symbol = ctx.helper.string(\"symbol\", _symbol);\n const shares = ctx.helper.number(\"shares\", _shares);\n checkTixApiAccess(ctx);\n if (player.bitNodeN !== 8) {\n if (player.sourceFileLvl(8) <= 1) {\n throw ctx.makeRuntimeErrorMsg(\"You must either be in BitNode-8 or you must have Source-File 8 Level 2.\");\n }\n }\n const stock = getStockFromSymbol(ctx, symbol);\n const res = sellShort(stock, shares, workerScript, {});\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 = ctx.helper.string(\"symbol\", _symbol);\n const shares = ctx.helper.number(\"shares\", _shares);\n const price = ctx.helper.number(\"price\", _price);\n const type = ctx.helper.string(\"type\", _type);\n const pos = ctx.helper.string(\"pos\", _pos);\n checkTixApiAccess(ctx);\n if (player.bitNodeN !== 8) {\n if (player.sourceFileLvl(8) <= 2) {\n throw ctx.makeRuntimeErrorMsg(\"You must either be in BitNode-8 or you must have Source-File 8 Level 3.\");\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 ctx.makeRuntimeErrorMsg(`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 ctx.makeRuntimeErrorMsg(`Invalid position type: ${pos}`);\n }\n\n return placeOrder(stock, shares, price, orderType, orderPos, workerScript);\n },\n cancelOrder:\n (ctx: NetscriptContext) =>\n (_symbol: unknown, _shares: unknown, _price: unknown, _type: unknown, _pos: unknown): boolean => {\n const symbol = ctx.helper.string(\"symbol\", _symbol);\n const shares = ctx.helper.number(\"shares\", _shares);\n const price = ctx.helper.number(\"price\", _price);\n const type = ctx.helper.string(\"type\", _type);\n const pos = ctx.helper.string(\"pos\", _pos);\n checkTixApiAccess(ctx);\n if (player.bitNodeN !== 8) {\n if (player.sourceFileLvl(8) <= 2) {\n throw ctx.makeRuntimeErrorMsg(\"You must either be in BitNode-8 or you must have Source-File 8 Level 3.\");\n }\n }\n const stock = getStockFromSymbol(ctx, symbol);\n if (isNaN(shares) || isNaN(price)) {\n throw ctx.makeRuntimeErrorMsg(`Invalid shares or price. Must be numeric. shares=${shares}, price=${price}`);\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 ctx.makeRuntimeErrorMsg(`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 ctx.makeRuntimeErrorMsg(`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, workerScript);\n },\n getOrders: (ctx: NetscriptContext) => (): any => {\n checkTixApiAccess(ctx);\n if (player.bitNodeN !== 8) {\n if (player.sourceFileLvl(8) <= 2) {\n throw ctx.makeRuntimeErrorMsg(\"You must either be in BitNode-8 or have Source-File 8 Level 3.\");\n }\n }\n\n const orders: any = {};\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 = ctx.helper.string(\"symbol\", _symbol);\n if (!player.has4SDataTixApi) {\n throw ctx.makeRuntimeErrorMsg(\"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 = ctx.helper.string(\"symbol\", _symbol);\n if (!player.has4SDataTixApi) {\n throw ctx.makeRuntimeErrorMsg(\"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 ctx.log(() => \"Already purchased 4S Market Data.\");\n return true;\n }\n\n if (player.money < getStockMarket4SDataCost()) {\n ctx.log(() => \"Not enough money to purchase 4S Market Data.\");\n return false;\n }\n\n player.has4SData = true;\n player.loseMoney(getStockMarket4SDataCost(), \"stock\");\n ctx.log(() => \"Purchased 4S Market Data\");\n return true;\n },\n purchase4SMarketDataTixApi: (ctx: NetscriptContext) => (): boolean => {\n checkTixApiAccess(ctx);\n\n if (player.has4SDataTixApi) {\n ctx.log(() => \"Already purchased 4S Market Data TIX API\");\n return true;\n }\n\n if (player.money < getStockMarket4STixApiCost()) {\n ctx.log(() => \"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 ctx.log(() => \"Purchased 4S Market Data TIX API\");\n return true;\n },\n purchaseWseAccount: (ctx: NetscriptContext) => (): boolean => {\n if (player.hasWseAccount) {\n ctx.log(() => \"Already purchased WSE Account\");\n return true;\n }\n\n if (player.money < getStockMarketWseCost()) {\n ctx.log(() => \"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 ctx.log(() => \"Purchased WSE Account Access\");\n return true;\n },\n purchaseTixApi: (ctx: NetscriptContext) => (): boolean => {\n if (player.hasTixApiAccess) {\n ctx.log(() => \"Already purchased TIX API\");\n return true;\n }\n\n if (player.money < getStockMarketTixApiCost()) {\n ctx.log(() => \"Not enough money to purchase TIX API Access\");\n return false;\n }\n\n player.hasTixApiAccess = true;\n player.loseMoney(getStockMarketTixApiCost(), \"stock\");\n ctx.log(() => \"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 { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { Grafting as IGrafting } from \"../ScriptEditor/NetscriptDefinitions\";\nimport { Router } from \"../ui/GameRoot\";\n\nexport function NetscriptGrafting(player: IPlayer): InternalAPI {\n const checkGraftingAPIAccess = (ctx: NetscriptContext): void => {\n if (!player.canAccessGrafting()) {\n throw ctx.makeRuntimeErrorMsg(\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 = ctx.helper.string(\"augName\", _augName);\n checkGraftingAPIAccess(ctx);\n if (!getGraftingAvailableAugs(player).includes(augName) || !StaticAugmentations.hasOwnProperty(augName)) {\n throw ctx.makeRuntimeErrorMsg(`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 = ctx.helper.string(\"augName\", _augName);\n checkGraftingAPIAccess(ctx);\n if (!getGraftingAvailableAugs(player).includes(augName) || !StaticAugmentations.hasOwnProperty(augName)) {\n throw ctx.makeRuntimeErrorMsg(`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 = ctx.helper.string(\"augName\", _augName);\n const focus = ctx.helper.boolean(_focus);\n checkGraftingAPIAccess(ctx);\n if (player.city !== CityName.NewTokyo) {\n throw ctx.makeRuntimeErrorMsg(\"You must be in New Tokyo to begin grafting an Augmentation.\");\n }\n if (!getGraftingAvailableAugs(player).includes(augName) || !StaticAugmentations.hasOwnProperty(augName)) {\n ctx.log(() => `Invalid aug: ${augName}`);\n return false;\n }\n\n const wasFocusing = player.focus;\n if (player.isWorking) {\n const txt = player.singularityStopWork();\n ctx.log(() => txt);\n }\n\n const craftableAug = new GraftableAugmentation(StaticAugmentations[augName]);\n if (player.money < craftableAug.cost) {\n ctx.log(() => `You don't have enough money to craft ${augName}`);\n return false;\n }\n\n if (!hasAugmentationPrereqs(craftableAug.augmentation)) {\n ctx.log(() => `You don't have the pre-requisites for ${augName}`);\n return false;\n }\n\n player.loseMoney(craftableAug.cost, \"augmentations\");\n player.startGraftAugmentationWork(augName, craftableAug.time);\n\n if (focus) {\n player.startFocusing();\n Router.toWork();\n } else if (wasFocusing) {\n player.stopFocusing();\n Router.toTerminal();\n }\n\n ctx.log(() => `Began grafting Augmentation ${augName}.`);\n return true;\n },\n };\n}\n","import { 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 v1APIBreak(): void {\n interface IFileLine {\n file: string;\n line: number;\n }\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 });\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","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 tutorialScriptName = {\n [Language.None]: \"n00dles.script\",\n [Language.NS1]: \"n00dles.script\",\n [Language.NS2]: \"n00dles.js\",\n }[language];\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 Scripts must end with the .script extension. Let's make a script now by entering \n {`[home ~/]> 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 {\"[home ~/]> free\"}\n \n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalRunScript as number]: {\n content: (\n <>\n \n We have 8GB of free RAM on this machine, which is enough to run our script. Let's run our script using\n \n {`[home ~/]> 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 n00dles.script 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 {`[home ~/]> 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\";\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 as any);\n const canGang = !!(props.player.gang as any);\n const canJob = props.player.companyName !== \"\";\n const canStockMarket = props.player.hasWseAccount;\n const canBladeburner = !!(props.player.bladeburner as any);\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();\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 function handleShortcuts(this: Document, event: KeyboardEvent): any {\n if (Settings.DisableHotkeys) return;\n if ((props.player.isWorking && 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.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 { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { Player } from \"../../Player\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { StaticAugmentations } from \"../StaticAugmentations\";\n\ninterface IAugmentedStats {\n [index: string]: number;\n}\n\nfunction calculateAugmentedStats(): IAugmentedStats {\n const augP: IAugmentedStats = {};\n for (const aug of Player.queuedAugmentations) {\n const augObj = StaticAugmentations[aug.name];\n for (const mult of Object.keys(augObj.mults)) {\n const v = augP[mult] ? augP[mult] : 1;\n augP[mult] = v * augObj.mults[mult];\n }\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.hacking_chance_mult,\n augmented: Player.hacking_chance_mult * mults.hacking_chance_mult,\n },\n {\n mult: \"Hacking Speed\",\n current: Player.hacking_speed_mult,\n augmented: Player.hacking_speed_mult * mults.hacking_speed_mult,\n },\n {\n mult: \"Hacking Money\",\n current: Player.hacking_money_mult,\n augmented: Player.hacking_money_mult * mults.hacking_money_mult,\n bnMult: BitNodeMultipliers.ScriptHackMoney,\n },\n {\n mult: \"Hacking Growth\",\n current: Player.hacking_grow_mult,\n augmented: Player.hacking_grow_mult * mults.hacking_grow_mult,\n },\n {\n mult: \"Hacking Level\",\n current: Player.hacking_mult,\n augmented: Player.hacking_mult * mults.hacking_mult,\n bnMult: BitNodeMultipliers.HackingLevelMultiplier,\n },\n {\n mult: \"Hacking Experience\",\n current: Player.hacking_exp_mult,\n augmented: Player.hacking_exp_mult * mults.hacking_exp_mult,\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.strength_mult,\n augmented: Player.strength_mult * mults.strength_mult,\n bnMult: BitNodeMultipliers.StrengthLevelMultiplier,\n },\n {\n mult: \"Strength Experience\",\n current: Player.strength_exp_mult,\n augmented: Player.strength_exp_mult * mults.strength_exp_mult,\n },\n {\n mult: \"Defense Level\",\n current: Player.defense_mult,\n augmented: Player.defense_mult * mults.defense_mult,\n bnMult: BitNodeMultipliers.DefenseLevelMultiplier,\n },\n {\n mult: \"Defense Experience\",\n current: Player.defense_exp_mult,\n augmented: Player.defense_exp_mult * mults.defense_exp_mult,\n },\n {\n mult: \"Dexterity Level\",\n current: Player.dexterity_mult,\n augmented: Player.dexterity_mult * mults.dexterity_mult,\n bnMult: BitNodeMultipliers.DexterityLevelMultiplier,\n },\n {\n mult: \"Dexterity Experience\",\n current: Player.dexterity_exp_mult,\n augmented: Player.dexterity_exp_mult * mults.dexterity_exp_mult,\n },\n {\n mult: \"Agility Level\",\n current: Player.agility_mult,\n augmented: Player.agility_mult * mults.agility_mult,\n bnMult: BitNodeMultipliers.AgilityLevelMultiplier,\n },\n {\n mult: \"Agility Experience\",\n current: Player.agility_exp_mult,\n augmented: Player.agility_exp_mult * mults.agility_exp_mult,\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.charisma_mult,\n augmented: Player.charisma_mult * mults.charisma_mult,\n bnMult: BitNodeMultipliers.CharismaLevelMultiplier,\n color: Settings.theme.cha,\n },\n {\n mult: \"Charisma Experience\",\n current: Player.charisma_exp_mult,\n augmented: Player.charisma_exp_mult * mults.charisma_exp_mult,\n color: Settings.theme.cha,\n },\n ];\n const rightColData: MultiplierListItemData[] = [\n {\n mult: \"Hacknet Node Production\",\n current: Player.hacknet_node_money_mult,\n augmented: Player.hacknet_node_money_mult * mults.hacknet_node_money_mult,\n bnMult: BitNodeMultipliers.HacknetNodeMoney,\n },\n {\n mult: \"Hacknet Node Purchase Cost\",\n current: Player.hacknet_node_purchase_cost_mult,\n augmented: Player.hacknet_node_purchase_cost_mult * mults.hacknet_node_purchase_cost_mult,\n },\n {\n mult: \"Hacknet Node RAM Upgrade Cost\",\n current: Player.hacknet_node_ram_cost_mult,\n augmented: Player.hacknet_node_ram_cost_mult * mults.hacknet_node_ram_cost_mult,\n },\n {\n mult: \"Hacknet Node Core Purchase Cost\",\n current: Player.hacknet_node_core_cost_mult,\n augmented: Player.hacknet_node_core_cost_mult * mults.hacknet_node_core_cost_mult,\n },\n {\n mult: \"Hacknet Node Level Upgrade Cost\",\n current: Player.hacknet_node_level_cost_mult,\n augmented: Player.hacknet_node_level_cost_mult * mults.hacknet_node_level_cost_mult,\n },\n {\n mult: \"Company Reputation Gain\",\n current: Player.company_rep_mult,\n augmented: Player.company_rep_mult * mults.company_rep_mult,\n },\n {\n mult: \"Faction Reputation Gain\",\n current: Player.faction_rep_mult,\n augmented: Player.faction_rep_mult * mults.faction_rep_mult,\n bnMult: BitNodeMultipliers.FactionWorkRepGain,\n },\n {\n mult: \"Salary\",\n current: Player.work_money_mult,\n augmented: Player.work_money_mult * mults.work_money_mult,\n bnMult: BitNodeMultipliers.CompanyWorkMoney,\n color: Settings.theme.money,\n },\n {\n mult: \"Crime Success Chance\",\n current: Player.crime_success_mult,\n augmented: Player.crime_success_mult * mults.crime_success_mult,\n color: Settings.theme.combat,\n },\n {\n mult: \"Crime Money\",\n current: Player.crime_money_mult,\n augmented: Player.crime_money_mult * mults.crime_money_mult,\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.bladeburner_success_chance_mult,\n augmented: Player.bladeburner_success_chance_mult * mults.bladeburner_success_chance_mult,\n },\n {\n mult: \"Bladeburner Max Stamina\",\n current: Player.bladeburner_max_stamina_mult,\n augmented: Player.bladeburner_max_stamina_mult * mults.bladeburner_max_stamina_mult,\n },\n {\n mult: \"Bladeburner Stamina Gain\",\n current: Player.bladeburner_stamina_gain_mult,\n augmented: Player.bladeburner_stamina_gain_mult * mults.bladeburner_stamina_gain_mult,\n },\n {\n mult: \"Bladeburner Field Analysis\",\n current: Player.bladeburner_analysis_mult,\n augmented: Player.bladeburner_analysis_mult * mults.bladeburner_analysis_mult,\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.hacking_exp = 0;\n props.player.strength_exp = 0;\n props.player.defense_exp = 0;\n props.player.dexterity_exp = 0;\n props.player.agility_exp = 0;\n props.player.charisma_exp = 0;\n props.player.intelligence_exp = 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.hacking_exp = 0;\n break;\n case \"strength\":\n props.player.strength_exp = 0;\n break;\n case \"defense\":\n props.player.defense_exp = 0;\n break;\n case \"dexterity\":\n props.player.dexterity_exp = 0;\n break;\n case \"agility\":\n props.player.agility_exp = 0;\n break;\n case \"charisma\":\n props.player.charisma_exp = 0;\n break;\n case \"intelligence\":\n props.player.intelligence_exp = 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.intelligence === 0) {\n props.player.intelligence = 1;\n props.player.updateSkillLevels();\n }\n }\n\n function disableIntelligence(): void {\n props.player.intelligence_exp = 0;\n props.player.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 (ex: any) {\n SnackbarEvents.emit(ex.toString(), 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 console.log(Object.keys(save));\n // TODO: Continue here.\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.bladeburner_success_chance_mult * 100, 1)}%\n
    \n Aug. Max Stamina mult: {formatNumber(props.player.bladeburner_max_stamina_mult * 100, 1)}%\n
    \n Aug. Stamina Gain mult: {formatNumber(props.player.bladeburner_stamina_gain_mult * 100, 1)}%\n
    \n Aug. Field Analysis mult: {formatNumber(props.player.bladeburner_analysis_mult * 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: any;\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: any, 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 React from \"react\";\n\ninterface IContract {\n desc: JSX.Element;\n}\n\nexport const GeneralActions: {\n [key: string]: IContract | 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 },\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 },\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 },\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 },\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 },\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 },\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\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n}\n\nexport function BlackOpPage(props: IProps): React.ReactElement {\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 \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 Synthoid, 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 they believe someone has triggered this malfunction in\n a 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: any): boolean {\n return mult && 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\";\n\ninterface IProps {\n skill: any;\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\";\n\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 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\nfunction countEmployee(employees: Employee[], job: string): number {\n let n = 0;\n for (let i = 0; i < employees.length; ++i) {\n if (employees[i].pos === job) n++;\n }\n return n;\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.pos === positionNames[i]) {\n employeePositionSelectorInitialValue = positionNames[i];\n }\n }\n\n function employeePositionSelectorOnChange(e: SelectChangeEvent): void {\n if (employee === null) return;\n employee.pos = 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 AutoAssignJob(props: IAutoAssignProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const numJob = countEmployee(props.office.employees, props.job);\n const numUnassigned = countEmployee(props.office.employees, EmployeePositions.Unassigned);\n function assignEmployee(): void {\n if (numUnassigned <= 0) {\n console.warn(\"Cannot assign employee. No unassigned employees available\");\n return;\n }\n\n props.office.assignEmployeeToJob(props.job);\n props.office.calculateEmployeeProductivity(corp, division);\n props.rerender();\n }\n\n function unassignEmployee(): void {\n props.office.unassignEmployeeFromJob(props.job);\n props.office.calculateEmployeeProductivity(corp, division);\n props.rerender();\n }\n return (\n \n \n \n \n {props.job} ({numJob})\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 numUnassigned = countEmployee(props.office.employees, EmployeePositions.Unassigned);\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 return (\n <>\n \n \n \n \n Unassigned Employees:\n \n \n {numUnassigned}\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\n from upgrades and materials. This value is based off the productivity of your Operations,\n Engineering, 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 \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(\"AutoPartyManager\") && (\n <>\n Throw an office party to increase your employee's morale and happiness}\n >\n \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 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 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 { OfficeSpace } from \"../OfficeSpace\";\nimport { Industries } from \"../IndustryData\";\nimport { IndustryUpgrades } from \"../IndustryUpgrades\";\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}\nfunction Text(): 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.format(totalAdvertisingFac, \"0.000\")}\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.format(division.prodMult, \"0.00\")}\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 \n Scientific Research increases the quality of the materials and products that you produce.\n \n }\n >\n Scientific Research: {numeralWrapper.format(division.sciResearch.qty, \"0.000a\")}\n \n \n setResearchOpen(false)} industry={division} />\n \n \n );\n}\n\nfunction Upgrades(props: { office: OfficeSpace; rerender: () => void }): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const upgrades = [];\n for (const index of Object.keys(IndustryUpgrades)) {\n const upgrade = IndustryUpgrades[index];\n\n // AutoBrew research disables the Coffee upgrade\n if (division.hasResearch(\"AutoBrew\") && upgrade[4] === \"Coffee\") {\n continue;\n }\n\n const i = upgrade[0];\n const baseCost = upgrade[1];\n const priceMult = upgrade[2];\n let cost = 0;\n switch (i) {\n case 0: //Coffee, cost is static per employee\n cost = props.office.employees.length * baseCost;\n break;\n default:\n cost = baseCost * Math.pow(priceMult, division.upgrades[i]);\n break;\n }\n\n function onClick(): void {\n if (corp.funds < cost) return;\n corp.funds = corp.funds - cost;\n division.upgrade(upgrade, {\n corporation: corp,\n office: props.office,\n });\n props.rerender();\n }\n\n upgrades.push(\n \n \n \n \n ,\n );\n }\n\n return <>{upgrades};\n}\n\ninterface IProps {\n currentCity: string;\n office: OfficeSpace;\n rerender: () => void;\n}\n\nexport function IndustryOverview(props: IProps): React.ReactElement {\n const division = useDivision();\n\n return (\n \n \n
    \n Purchases & Upgrades\n
    \n {division.makesProducts && }\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\";\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(null);\n const [marketing, setMarketing] = useState(null);\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 (design === null || marketing === null) 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 onDesignChange(event: React.ChangeEvent): void {\n if (event.target.value === \"\") setDesign(null);\n else setDesign(parseFloat(event.target.value));\n }\n\n function onMarketingChange(event: React.ChangeEvent): void {\n if (event.target.value === \"\") setMarketing(null);\n else setMarketing(parseFloat(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: any[][] = [];\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.dividendPercentage <= 0 || profit <= 0) return <>;\n const totalDividends = (corp.dividendPercentage / 100) * profit;\n const retainedEarnings = profit - totalDividends;\n const dividendsPerShare = totalDividends / corp.totalShares;\n return (\n ],\n [\"Dividend Percentage:\", numeralWrapper.format(corp.dividendPercentage / 100, \"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 TextField from \"@mui/material/TextField\";\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(0);\n const [stock, setStock] = useState(0);\n const [selectedFaction, setSelectedFaction] = useState(factions.length > 0 ? factions[0] : \"\");\n const disabled =\n money === null ||\n stock === null ||\n (money === 0 && stock === 0) ||\n isNaN(money) ||\n isNaN(stock) ||\n money < 0 ||\n stock < 0 ||\n corp.funds < money ||\n stock > corp.numShares;\n\n function onMoneyChange(event: React.ChangeEvent): void {\n setMoney(parseFloat(event.target.value));\n }\n\n function onStockChange(event: React.ChangeEvent): void {\n setStock(parseFloat(event.target.value));\n }\n\n function changeFaction(event: SelectChangeEvent): void {\n setSelectedFaction(event.target.value);\n }\n\n function repGain(money: number, stock: number): number {\n return (money + stock * corp.sharePrice) / CorporationConstants.BribeToRepRatio;\n }\n\n function getRepText(money: number, stock: number): string {\n if (money === 0 && stock === 0) return \"\";\n if (isNaN(money) || isNaN(stock) || money < 0 || stock < 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 if (stock > corp.numShares) {\n return \"ERROR: You do not have this many shares to bribe with\";\n } else {\n return (\n \"You will gain \" +\n numeralWrapper.formatReputation(repGain(money, stock)) +\n \" reputation with \" +\n selectedFaction +\n \" with this bribe\"\n );\n }\n }\n\n function bribe(money: number, stock: number): void {\n const fac = Factions[selectedFaction];\n if (disabled) return;\n const rep = repGain(money, stock);\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 corp.numShares -= stock;\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, stock ? stock : 0)}\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 { use } from \"../../../ui/Context\";\nimport { useCorporation } from \"../Context\";\nimport { ICorporation } from \"../../ICorporation\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\nimport { Money } from \"../../../ui/React/Money\";\nimport { SellShares } from \"../../Actions\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\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(null);\n\n const disabled = shares === null || isNaN(shares) || shares <= 0 || shares > corp.numShares;\n\n function changeShares(event: React.ChangeEvent): void {\n if (event.target.value === \"\") setShares(null);\n else setShares(Math.round(parseFloat(event.target.value)));\n }\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 TextField from \"@mui/material/TextField\";\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(null);\n\n function changeShares(event: React.ChangeEvent): void {\n if (event.target.value === \"\") setShares(null);\n else setShares(Math.round(parseFloat(event.target.value)));\n }\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.DividendMaxPercentage * 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 TextField from \"@mui/material/TextField\";\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(null);\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 = shares === null || isNaN(newShares) || newShares < 10e6 || newShares > maxNewShares;\n\n function issueNewShares(): void {\n if (shares === null) 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 corp.totalShares += newShares;\n\n // Determine how many are bought by private investors\n // Private investors get up to 50% at most\n // Round # of private shares to the nearest millionth\n let privateShares = getRandomInt(0, Math.round(newShares / 2));\n privateShares = Math.round(privateShares / 1e6) * 1e6;\n\n corp.issuedShares += newShares - privateShares;\n corp.funds = corp.funds + profit;\n corp.immediatelyUpdateSharePrice();\n props.onClose();\n dialogBoxCreate(\n `Issued ${numeralWrapper.format(newShares, \"0.000a\")} and raised ` +\n `${numeralWrapper.formatMoney(profit)}. ${numeralWrapper.format(privateShares, \"0.000a\")} ` +\n `of these shares were bought by private investors.

    ` +\n `Stock price decreased to ${numeralWrapper.formatMoney(corp.sharePrice)}`,\n );\n }\n\n function onKeyDown(event: React.KeyboardEvent): void {\n if (event.key === KEY.ENTER) issueNewShares();\n }\n\n function onChange(event: React.ChangeEvent): void {\n if (event.target.value === \"\") setShares(null);\n else setShares(parseFloat(event.target.value));\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 50% of the new shares.\n If they choose to exercise this option, these newly issued shares become private, restricted shares, which means\n 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 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 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(\"\");\n const initialSharePrice = corp.determineValuation() / corp.totalShares;\n\n function goPublic(): void {\n const numShares = parseFloat(shares);\n const initialSharePrice = corp.determineValuation() / corp.totalShares;\n if (isNaN(numShares)) {\n dialogBoxCreate(\"Invalid value for number of issued shares\");\n return;\n }\n if (numShares > 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 = numShares;\n corp.numShares -= numShares;\n corp.addFunds(numShares * initialSharePrice);\n props.rerender();\n dialogBoxCreate(\n `You took your ${corp.name} public and earned ` +\n `${numeralWrapper.formatMoney(numShares * 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 function onChange(event: React.ChangeEvent): void {\n setShares(event.target.value);\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 corp.numShares}\n sx={{ mx: 1 }}\n onClick={goPublic}\n >\n Go Public\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\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 \"based\",\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: any = {\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 { 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 { 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 { IMap } from \"../../../types\";\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\nconst GraftableAugmentations: IMap = {};\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 for (const aug of Object.values(StaticAugmentations)) {\n const name = aug.name;\n const graftableAug = new GraftableAugmentation(aug);\n GraftableAugmentations[name] = graftableAug;\n }\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 const graftableAug = GraftableAugmentations[selectedAug];\n player.loseMoney(graftableAug.cost, \"augmentations\");\n player.startGraftAugmentationWork(selectedAug, graftableAug.time);\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 { 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 { Factions } from \"../Faction/Factions\";\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 { WorkType, ClassType } from \"../utils/WorkType\";\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\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 const expGains = [\n player.workHackExpGained > 0 ? (\n \n ) : (\n <>\n ),\n player.workStrExpGained > 0 ? (\n \n ) : (\n <>\n ),\n player.workDefExpGained > 0 ? (\n \n ) : (\n <>\n ),\n player.workDexExpGained > 0 ? (\n \n ) : (\n <>\n ),\n player.workAgiExpGained > 0 ? (\n \n ) : (\n <>\n ),\n player.workChaExpGained > 0 ? (\n \n ) : (\n <>\n ),\n ];\n\n let workInfo: IWorkInfo | null;\n\n switch (player.workType) {\n case WorkType.Faction: {\n const faction = Factions[player.currentWorkFactionName];\n if (!faction) {\n workInfo = {\n buttons: {\n cancel: () => router.toFactions(),\n },\n title:\n `You have not joined ${player.currentWorkFactionName || \"(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.finishFactionWork(true);\n }\n function unfocus(): void {\n router.toFaction(faction);\n player.stopFocusing();\n }\n\n workInfo = {\n buttons: {\n cancel: cancel,\n unfocus: unfocus,\n },\n title: (\n <>\n You are currently {player.currentWorkFactionDescription} for your faction {faction.name}\n \n ),\n\n description: (\n <>\n Current Faction Reputation: \n \n ),\n gains: [\n player.workMoneyGained > 0 ? (\n \n \n (\n )\n \n \n ) : (\n <>\n ),\n \n \n (\n )\n \n ,\n ...expGains,\n ],\n progress: {\n elapsed: player.timeWorked,\n },\n\n stopText: \"Stop Faction work\",\n };\n\n break;\n }\n\n case WorkType.StudyClass: {\n const className = player.className;\n function cancel(): void {\n player.finishClass(true);\n router.toCity();\n }\n\n function unfocus(): void {\n router.toCity();\n player.stopFocusing();\n }\n\n let stopText = \"\";\n if (\n className === ClassType.GymStrength ||\n className === ClassType.GymDefense ||\n className === ClassType.GymDexterity ||\n className === ClassType.GymAgility\n ) {\n stopText = \"Stop training at gym\";\n } else {\n stopText = \"Stop taking course\";\n }\n\n workInfo = {\n buttons: {\n cancel: cancel,\n unfocus: unfocus,\n },\n title: (\n <>\n You are currently {className}\n \n ),\n\n gains: [\n \n \n (\n )\n \n ,\n ...expGains,\n ],\n progress: {\n elapsed: player.timeWorked,\n },\n\n stopText: stopText,\n };\n\n break;\n }\n\n case WorkType.Company: {\n const comp = Companies[player.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.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();\n }\n function unfocus(): void {\n player.stopFocusing();\n router.toJob();\n }\n\n const position = player.jobs[player.companyName];\n\n const penalty = player.cancelationPenalty();\n\n const penaltyString = penalty === 0.5 ? \"half\" : \"three-quarters\";\n\n workInfo = {\n buttons: {\n cancel: cancel,\n unfocus: unfocus,\n },\n title: (\n <>\n You are currently working as a {position} at {player.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 ,\n ...expGains,\n ],\n progress: {\n elapsed: player.timeWorked,\n },\n\n stopText: \"Stop working\",\n stopTooltip:\n \"You will automatically finish after working for 8 hours. You can cancel earlier if you wish\" +\n ` but you will only gain ${penaltyString} of the reputation you've earned so far.`,\n };\n\n break;\n }\n\n case WorkType.CompanyPartTime: {\n function cancel(): void {\n player.finishWorkPartTime(true);\n router.toJob();\n }\n function unfocus(): void {\n player.stopFocusing();\n router.toJob();\n }\n const comp = Companies[player.companyName];\n let companyRep = 0;\n if (comp == null || !(comp instanceof Company)) {\n throw new Error(`Could not find Company: ${player.companyName}`);\n }\n companyRep = comp.playerReputation;\n\n const position = player.jobs[player.companyName];\n\n workInfo = {\n buttons: {\n cancel: cancel,\n unfocus: unfocus,\n },\n title: (\n <>\n You are currently working as a {position} at {player.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 ,\n ...expGains,\n ],\n progress: {\n elapsed: player.timeWorked,\n },\n\n stopText: \"Stop working\",\n stopTooltip:\n \"You will automatically finish after working for 8 hours. You can cancel earlier if you wish\" +\n \" and there will be no penalty because this is a part-time job.\",\n };\n\n break;\n }\n\n case WorkType.Crime: {\n const completion = Math.round((player.timeWorked / player.timeNeededToCompleteWork) * 100);\n\n workInfo = {\n buttons: {\n cancel: () => {\n router.toLocation(Locations[LocationName.Slums]);\n player.finishCrime(true);\n },\n },\n title: `You are attempting to ${player.crimeType}`,\n\n progress: {\n remaining: player.timeNeededToCompleteWork - player.timeWorked,\n percentage: completion,\n },\n\n stopText: \"Cancel crime\",\n };\n\n break;\n }\n\n case WorkType.CreateProgram: {\n function cancel(): void {\n player.finishCreateProgramWork(true);\n router.toTerminal();\n }\n function unfocus(): void {\n router.toTerminal();\n player.stopFocusing();\n }\n\n const completion = (player.timeWorkedCreateProgram / player.timeNeededToCompleteWork) * 100;\n\n workInfo = {\n buttons: {\n cancel: cancel,\n unfocus: unfocus,\n },\n title: (\n <>\n You are currently working on coding {player.createProgramName}\n \n ),\n\n progress: {\n elapsed: player.timeWorked,\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 break;\n }\n\n case WorkType.GraftAugmentation: {\n function cancel(): void {\n player.finishGraftAugmentationWork(true);\n router.toTerminal();\n }\n function unfocus(): void {\n router.toTerminal();\n player.stopFocusing();\n }\n\n const completion = (player.timeWorkedGraftAugmentation / player.timeNeededToCompleteWork) * 100;\n\n workInfo = {\n buttons: {\n cancel: cancel,\n unfocus: unfocus,\n },\n title: (\n <>\n You are currently working on grafting {player.graftAugmentationName}\n \n ),\n\n progress: {\n elapsed: player.timeWorked,\n percentage: completion,\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 break;\n }\n\n default:\n router.toTerminal();\n workInfo = null;\n }\n\n if (workInfo === null) {\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 { CurrentOptionsPage } from \"./CurrentOptionsPage\";\nimport { GameOptionsSidebar } from \"./GameOptionsSidebar\";\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 setCurrentTab(tab)}\n player={props.player}\n router={props.router}\n save={props.save}\n export={props.export}\n forceKill={props.forceKill}\n softReset={props.softReset}\n />\n \n \n \n );\n}\n","import { MenuItem, Select, SelectChangeEvent, TextField, Tooltip, Typography } from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { OptionSwitch } from \"../../ui/React/OptionSwitch\";\nimport { formatTime } from \"../../utils/helpers/formatTime\";\nimport { GameOptionsTab } from \"../GameOptionsTab\";\nimport { GameOptionsPage } from \"./GameOptionsPage\";\nimport { OptionsSlider } from \"./OptionsSlider\";\n\ninterface IProps {\n currentTab: GameOptionsTab;\n player: IPlayer;\n}\n\nexport const CurrentOptionsPage = (props: IProps): 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 const [timestampFormat, setTimestampFormat] = useState(Settings.TimestampsFormat);\n const [locale, setLocale] = useState(Settings.Locale);\n\n function handleExecTimeChange(event: any, newValue: number | number[]): void {\n setExecTime(newValue as number);\n Settings.CodeInstructionRunTime = newValue as number;\n }\n\n function handleRecentScriptsSizeChange(event: any, newValue: number | number[]): void {\n setRecentScriptsSize(newValue as number);\n Settings.MaxRecentScriptsCapacity = newValue as number;\n }\n\n function handleLogSizeChange(event: any, newValue: number | number[]): void {\n setLogSize(newValue as number);\n Settings.MaxLogCapacity = newValue as number;\n }\n\n function handlePortSizeChange(event: any, newValue: number | number[]): void {\n setPortSize(newValue as number);\n Settings.MaxPortCapacity = newValue as number;\n }\n\n function handleTerminalSizeChange(event: any, newValue: number | number[]): void {\n setTerminalSize(newValue as number);\n Settings.MaxTerminalCapacity = newValue as number;\n }\n\n function handleAutosaveIntervalChange(event: any, newValue: number | number[]): void {\n setAutosaveInterval(newValue as number);\n Settings.AutosaveInterval = newValue as number;\n }\n\n function handleLocaleChange(event: SelectChangeEvent): void {\n setLocale(event.target.value);\n Settings.Locale = event.target.value;\n }\n\n function handleTimestampFormatChange(event: React.ChangeEvent): void {\n setTimestampFormat(event.target.value);\n Settings.TimestampsFormat = event.target.value;\n }\n\n const pages = {\n [GameOptionsTab.SYSTEM]: (\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\n can result in poor performance if you have many scripts running.\n \n }\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 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\n lagging a lot. You'll have to restart your script every time you launch the game.\n \n }\n />\n \n ),\n [GameOptionsTab.INTERFACE]: (\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 Sets the locale for displaying numbers.}>\n Locale\n \n \n \n \n ),\n [GameOptionsTab.GAMEPLAY]: (\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 {props.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 [GameOptionsTab.MISC]: (\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\n return pages[props.currentTab];\n};\n","import {\n BugReport,\n Chat,\n Download,\n LibraryBooks,\n Palette,\n Public,\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 (ex: any) {\n SnackbarEvents.emit(ex.toString(), 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 (ex: any) {\n SnackbarEvents.emit(ex.toString(), 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 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 href=\"https://plaza.dsolver.ca/games/bitburner\"\n target=\"_blank\"\n sx={{ gridArea: \"plaza\" }}\n >\n Incremental game plaza\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 as any }, error)}\n />\n
      \n update({ ...customStyle, lineHeight: value as any }, 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: any) => {\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, { 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 { CONSTANTS } from \"../../../Constants\";\nimport { Crimes } from \"../../../Crime/Crimes\";\nimport { FactionWorkType } from \"../../../Faction/FactionWorkTypeEnum\";\nimport { use } from \"../../../ui/Context\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { ProgressBar } from \"../../../ui/React/Progress\";\nimport { Sleeve } from \"../Sleeve\";\nimport { SleeveTaskType } from \"../SleeveTaskTypesEnum\";\nimport { MoreEarningsModal } from \"./MoreEarningsModal\";\nimport { MoreStatsModal } from \"./MoreStatsModal\";\nimport { SleeveAugmentationsModal } from \"./SleeveAugmentationsModal\";\nimport { EarningsElement, StatsElement } from \"./StatsElement\";\nimport { TaskSelector } from \"./TaskSelector\";\nimport { TravelModal } from \"./TravelModal\";\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 [earningsOpen, setEarningsOpen] = 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 props.sleeve.resetTaskStatus(player); // sets to idle\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 = <>;\n switch (props.sleeve.currentTask) {\n case SleeveTaskType.Idle:\n desc = <>This sleeve is currently idle;\n break;\n case SleeveTaskType.Company:\n desc = <>This sleeve is currently working your job at {props.sleeve.currentTaskLocation}.;\n break;\n case SleeveTaskType.Faction: {\n let doing = \"nothing\";\n switch (props.sleeve.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.currentTaskLocation}.\n \n );\n break;\n }\n case SleeveTaskType.Crime: {\n const crime = Object.values(Crimes).find((crime) => crime.name === props.sleeve.crimeType);\n if (!crime) throw new Error(\"crime should not be undefined\");\n desc = (\n <>\n This sleeve is currently attempting to {crime.type} (Success Rate:{\" \"}\n {numeralWrapper.formatPercentage(crime.successRate(props.sleeve))}).\n \n );\n break;\n }\n case SleeveTaskType.Class:\n desc = <>This sleeve is currently studying/taking a course at {props.sleeve.currentTaskLocation}.;\n break;\n case SleeveTaskType.Gym:\n desc = <>This sleeve is currently working out at {props.sleeve.currentTaskLocation}.;\n break;\n case SleeveTaskType.Bladeburner: {\n let message = \"\";\n if (props.sleeve.bbContract !== \"------\") {\n message = ` - ${props.sleeve.bbContract} (Success Rate: ${props.sleeve.currentTaskLocation})`;\n } else if (props.sleeve.currentTaskLocation !== \"\") {\n message = props.sleeve.currentTaskLocation;\n }\n desc = (\n <>\n This sleeve is currently attempting to {props.sleeve.bbAction}. {message}\n \n );\n break;\n }\n case SleeveTaskType.Recovery:\n desc = (\n <>\n This sleeve is currently set to focus on shock recovery. This causes the Sleeve's shock to decrease at a\n faster rate.\n \n );\n break;\n case SleeveTaskType.Synchro:\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 break;\n default:\n console.error(`Invalid/Unrecognized taskValue in updateSleeveTaskDescription(): ${abc[0]}`);\n }\n\n return (\n <>\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 {(props.sleeve.currentTask === SleeveTaskType.Crime ||\n props.sleeve.currentTask === SleeveTaskType.Bladeburner) &&\n props.sleeve.currentTaskMaxTime > 0 && (\n \n )}\n \n \n \n setStatsOpen(false)} sleeve={props.sleeve} />\n setEarningsOpen(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 { Money } from \"../../../ui/React/Money\";\nimport * as React from \"react\";\nimport { StatsTable } from \"../../../ui/React/StatsTable\";\nimport { Modal } from \"../../../ui/React/Modal\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n sleeve: Sleeve;\n}\n\nexport function MoreEarningsModal(props: IProps): React.ReactElement {\n return (\n \n ],\n [\"Hacking Exp \", numeralWrapper.formatExp(props.sleeve.earningsForTask.hack)],\n [\"Strength Exp \", numeralWrapper.formatExp(props.sleeve.earningsForTask.str)],\n [\"Defense Exp \", numeralWrapper.formatExp(props.sleeve.earningsForTask.def)],\n [\"Dexterity Exp \", numeralWrapper.formatExp(props.sleeve.earningsForTask.dex)],\n [\"Agility Exp \", numeralWrapper.formatExp(props.sleeve.earningsForTask.agi)],\n [\"Charisma Exp \", numeralWrapper.formatExp(props.sleeve.earningsForTask.cha)],\n ]}\n title=\"Earnings for Current Task:\"\n />\n
      \n ],\n [\"Hacking Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForPlayer.hack)],\n [\"Strength Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForPlayer.str)],\n [\"Defense Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForPlayer.def)],\n [\"Dexterity Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForPlayer.dex)],\n [\"Agility Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForPlayer.agi)],\n [\"Charisma Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForPlayer.cha)],\n ]}\n title=\"Total Earnings for Host Consciousness:\"\n />\n
      \n ],\n [\"Hacking Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForSleeves.hack)],\n [\"Strength Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForSleeves.str)],\n [\"Defense Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForSleeves.def)],\n [\"Dexterity Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForSleeves.dex)],\n [\"Agility Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForSleeves.agi)],\n [\"Charisma Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForSleeves.cha)],\n ]}\n title=\"Total Earnings for Other Sleeves:\"\n />\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.hacking,\n <> ({numeralWrapper.formatExp(props.sleeve.hacking_exp)} exp),\n ],\n [\n <>Strength: ,\n props.sleeve.strength,\n <> ({numeralWrapper.formatExp(props.sleeve.strength_exp)} exp),\n ],\n [\n <>Defense: ,\n props.sleeve.defense,\n <> ({numeralWrapper.formatExp(props.sleeve.defense_exp)} exp),\n ],\n [\n <>Dexterity: ,\n props.sleeve.dexterity,\n <> ({numeralWrapper.formatExp(props.sleeve.dexterity_exp)} exp),\n ],\n [\n <>Agility: ,\n props.sleeve.agility,\n <> ({numeralWrapper.formatExp(props.sleeve.agility_exp)} exp),\n ],\n [\n <>Charisma: ,\n props.sleeve.charisma,\n <> ({numeralWrapper.formatExp(props.sleeve.charisma_exp)} exp),\n ],\n ]}\n title=\"Stats:\"\n />\n
      \n Hacking Level multiplier: , numeralWrapper.formatPercentage(props.sleeve.hacking_mult)],\n [<>Hacking Experience multiplier: , numeralWrapper.formatPercentage(props.sleeve.hacking_exp_mult)],\n [<>Strength Level multiplier: , numeralWrapper.formatPercentage(props.sleeve.strength_mult)],\n [<>Strength Experience multiplier: , numeralWrapper.formatPercentage(props.sleeve.strength_exp_mult)],\n [<>Defense Level multiplier: , numeralWrapper.formatPercentage(props.sleeve.defense_mult)],\n [<>Defense Experience multiplier: , numeralWrapper.formatPercentage(props.sleeve.defense_exp_mult)],\n [<>Dexterity Level multiplier: , numeralWrapper.formatPercentage(props.sleeve.dexterity_mult)],\n [\n <>Dexterity Experience multiplier: ,\n numeralWrapper.formatPercentage(props.sleeve.dexterity_exp_mult),\n ],\n [<>Agility Level multiplier: , numeralWrapper.formatPercentage(props.sleeve.agility_mult)],\n [<>Agility Experience multiplier: , numeralWrapper.formatPercentage(props.sleeve.agility_exp_mult)],\n [<>Charisma Level multiplier: , numeralWrapper.formatPercentage(props.sleeve.charisma_mult)],\n [<>Charisma Experience multiplier: , numeralWrapper.formatPercentage(props.sleeve.charisma_exp_mult)],\n [\n <>Faction Reputation Gain multiplier: ,\n numeralWrapper.formatPercentage(props.sleeve.faction_rep_mult),\n ],\n [\n <>Company Reputation Gain multiplier: ,\n numeralWrapper.formatPercentage(props.sleeve.company_rep_mult),\n ],\n [<>Salary multiplier: , numeralWrapper.formatPercentage(props.sleeve.work_money_mult)],\n [<>Crime Money multiplier: , numeralWrapper.formatPercentage(props.sleeve.crime_money_mult)],\n [<>Crime Success multiplier: , numeralWrapper.formatPercentage(props.sleeve.crime_success_mult)],\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, _showModal) => {\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 { SleeveTaskType } from \"../SleeveTaskTypesEnum\";\nimport { Crimes } from \"../../../Crime/Crimes\";\nimport { LocationName } from \"../../../Locations/data/LocationNames\";\nimport { CityName } from \"../../../Locations/data/CityNames\";\nimport { Factions } from \"../../../Faction/Factions\";\nimport { FactionWorkType } from \"../../../Faction/FactionWorkTypeEnum\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport { FactionNames } from \"../../../Faction/data/FactionNames\";\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 = [];\n for (const otherSleeve of player.sleeves) {\n if (sleeve === otherSleeve) {\n continue;\n }\n if (otherSleeve.currentTask === SleeveTaskType.Company) {\n forbiddenCompanies.push(otherSleeve.currentTaskLocation);\n }\n }\n const allJobs: string[] = Object.keys(player.jobs);\n for (let i = 0; i < allJobs.length; ++i) {\n if (!forbiddenCompanies.includes(allJobs[i])) {\n allJobs[i];\n }\n }\n\n return allJobs;\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 (otherSleeve.currentTask === SleeveTaskType.Faction) {\n forbiddenFactions.push(otherSleeve.currentTaskLocation);\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 (otherSleeve.currentTask === SleeveTaskType.Bladeburner && otherSleeve.bbAction == \"Take on contracts\") {\n contracts = contracts.filter((x) => x != otherSleeve.bbContract);\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, _: Sleeve) => 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 switch (sleeve.currentTask) {\n case SleeveTaskType.Idle:\n return [\"------\", \"------\", \"------\"];\n case SleeveTaskType.Company:\n return [\"Work for Company\", sleeve.currentTaskLocation, \"------\"];\n case SleeveTaskType.Faction: {\n let workType = \"\";\n switch (sleeve.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\", sleeve.currentTaskLocation, workType];\n }\n case SleeveTaskType.Crime:\n return [\"Commit Crime\", sleeve.crimeType, \"------\"];\n case SleeveTaskType.Class:\n return [\"Take University Course\", sleeve.className, sleeve.currentTaskLocation];\n case SleeveTaskType.Gym:\n return [\"Workout at Gym\", sleeve.gymStatType, sleeve.currentTaskLocation];\n case SleeveTaskType.Bladeburner:\n return [\"Perform Bladeburner Actions\", sleeve.bbAction, sleeve.bbContract];\n case SleeveTaskType.Recovery:\n return [\"Shock Recovery\", \"------\", \"------\"];\n case SleeveTaskType.Synchro:\n return [\"Synchronize\", \"------\", \"------\"];\n }\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.resetTaskStatus(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 its 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.hacknet_node_money_mult) -\n node.moneyGainRatePerSecond;\n const upgradeLevelCost = node.calculateLevelUpgradeCost(multiplier, props.player.hacknet_node_level_cost_mult);\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.hacknet_node_money_mult,\n ) - node.moneyGainRatePerSecond;\n const upgradeRamCost = node.calculateRamUpgradeCost(multiplier, props.player.hacknet_node_ram_cost_mult);\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.hacknet_node_money_mult) -\n node.moneyGainRatePerSecond;\n const upgradeCoreCost = node.calculateCoreUpgradeCost(multiplier, props.player.hacknet_node_core_cost_mult);\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(node.level + multiplier, 0, node.maxRam, node.cores, props.player.hacknet_node_money_mult) -\n calculateHashGainRate(node.level, 0, node.maxRam, node.cores, props.player.hacknet_node_money_mult);\n const modded_increase = (base_increase * (node.maxRam - node.ramUsed)) / node.maxRam;\n\n const upgradeLevelCost = node.calculateLevelUpgradeCost(multiplier, props.player.hacknet_node_level_cost_mult);\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.hacknet_node_money_mult,\n ) - calculateHashGainRate(node.level, 0, node.maxRam, node.cores, props.player.hacknet_node_money_mult);\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.hacknet_node_money_mult,\n ) -\n calculateHashGainRate(node.level, node.ramUsed, node.maxRam, node.cores, props.player.hacknet_node_money_mult);\n\n const upgradeRamCost = node.calculateRamUpgradeCost(multiplier, props.player.hacknet_node_ram_cost_mult);\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(node.level, 0, node.maxRam, node.cores + multiplier, props.player.hacknet_node_money_mult) -\n calculateHashGainRate(node.level, 0, node.maxRam, node.cores, props.player.hacknet_node_money_mult);\n const modded_increase = (base_increase * (node.maxRam - node.ramUsed)) / node.maxRam;\n\n const upgradeCoreCost = node.calculateCoreUpgradeCost(multiplier, props.player.hacknet_node_core_cost_mult);\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\";\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 if (pos.isPartTimeJob() || pos.isSoftwareConsultantJob() || pos.isBusinessConsultantJob()) {\n p.startWorkPartTime(props.locName);\n } else {\n p.startWork(props.locName);\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","// 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 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 { CONSTANTS } from \"../../Constants\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { GetServer } from \"../../Server/AllServers\";\nimport { Server } from \"../../Server/Server\";\n\nimport { Money } from \"../../ui/React/Money\";\nimport { IRouter } from \"../../ui/Router\";\nimport { serverMetadata } from \"../../Server/data/servers\";\nimport { Box } from \"@mui/material\";\nimport { ClassType } from \"../../utils/WorkType\";\n\ntype IProps = {\n loc: Location;\n p: IPlayer;\n router: IRouter;\n};\n\nexport function GymLocation(props: IProps): React.ReactElement {\n function calculateCost(): number {\n const serverMeta = serverMetadata.find((s) => s.specialName === props.loc.name);\n const server = GetServer(serverMeta ? serverMeta.hostname : \"\");\n if (server == null || !server.hasOwnProperty(\"backdoorInstalled\")) return props.loc.costMult;\n const discount = (server as Server).backdoorInstalled ? 0.9 : 1;\n return props.loc.costMult * discount;\n }\n\n function train(stat: ClassType): void {\n const loc = props.loc;\n props.p.startClass(calculateCost(), loc.expMult, stat);\n props.p.startFocusing();\n props.router.toWork();\n }\n\n function trainStrength(): void {\n train(ClassType.GymStrength);\n }\n\n function trainDefense(): void {\n train(ClassType.GymDefense);\n }\n\n function trainDexterity(): void {\n train(ClassType.GymDexterity);\n }\n\n function trainAgility(): void {\n train(ClassType.GymAgility);\n }\n\n const cost = CONSTANTS.ClassGymBaseCost * calculateCost();\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: any;\n\n constructor(props: IProps) {\n super(props);\n\n this.btnStyle = { display: \"block\" };\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,\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 < 0) {\n this.props.p.hp = 0;\n }\n if (this.props.p.hp >= this.props.p.max_hp) {\n return;\n }\n\n const cost = this.getCost();\n this.props.p.loseMoney(cost, \"hospitalization\");\n this.props.p.hp = this.props.p.max_hp;\n\n // This just forces a re-render to update the cost\n this.setState({\n currHp: this.props.p.hp,\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(router, player);\n }\n\n function robStore(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.RobStore.commit(router, player);\n }\n\n function mug(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.Mug.commit(router, player);\n }\n\n function larceny(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.Larceny.commit(router, player);\n }\n\n function dealDrugs(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.DealDrugs.commit(router, player);\n }\n\n function bondForgery(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.BondForgery.commit(router, player);\n }\n\n function traffickArms(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.TraffickArms.commit(router, player);\n }\n\n function homicide(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.Homicide.commit(router, player);\n }\n\n function grandTheftAuto(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.GrandTheftAuto.commit(router, player);\n }\n\n function kidnap(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.Kidnap.commit(router, player);\n }\n\n function assassinate(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.Assassination.commit(router, player);\n }\n\n function heist(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.Heist.commit(router, player);\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 (p.strength >= 100 && p.defense >= 100 && p.dexterity >= 100 && p.agility >= 100) {\n // Apply for Bladeburner division\n p.startBladeburner({ new: true });\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.intelligence_exp *= 1.0000000000000002;\n }\n player.hacking_exp *= 1.0000000000000002;\n player.strength_exp *= 1.0000000000000002;\n player.defense_exp *= 1.0000000000000002;\n player.agility_exp *= 1.0000000000000002;\n player.dexterity_exp *= 1.0000000000000002;\n player.charisma_exp *= 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 business man 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 so 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} as any;\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