!function(e){function t(t){for(var a,o,s=t[0],l=t[1],c=t[2],p=0,h=[];p=100?this.sleeves[e].synchronize(this):this.sleeves[e].shockRecovery(this));this.isWorking=!1,this.currentWorkFactionName="",this.currentWorkFactionDescription="",this.createProgramName="",this.className="",this.crimeType="",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),this.updateSkillLevels(),this.hp=this.max_hp},$.prototype.prestigeSourceFile=function(){var e=this.getHomeComputer();this.currentServer=e.ip,this.homeComputer=e.ip,this.numPeopleKilled=0,this.karma=0,this.hacking_skill=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=new B.a(1e3),this.city=P.Locations.Sector12,this.location="",this.companyName="",this.jobs={},this.purchasedServers=[],this.factions=[],this.factionInvitations=[],this.queuedAugmentations=[],this.augmentations=[],this.resleeves=[],this.sleeves.length=D.SourceFileFlags[10]+this.sleevesFromCovenant;for(let e=0;e0?this.intelligence=Math.floor(this.calculateSkill(this.intelligence_exp)):this.intelligence=0;var e=this.hp/this.max_hp;this.max_hp=Math.floor(10+this.defense/10),z.hp=Math.round(this.max_hp*e)},$.prototype.resetMultipliers=function(){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},$.prototype.hasProgram=function(e){var t=z.getHomeComputer();if(null==t)return!1;for(var n=0;n0)&&(this.intelligence_exp+=e)},$.prototype.queryStatFromString=function(e){const t=e.toLowerCase();return t.includes("hack")?z.hacking_skill:t.includes("str")?z.strength:t.includes("def")?z.defense:t.includes("dex")?z.dexterity:t.includes("agi")?z.agility:t.includes("cha")?z.charisma:t.includes("int")?z.intelligence:void 0},$.prototype.resetWorkStatus=function(){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.currentWorkFactionName="",this.currentWorkFactionDescription="",this.createProgramName="",this.className="",document.getElementById("work-in-progress-text").innerHTML=""},$.prototype.processWorkEarnings=function(e=1){const t=this.workHackExpGainRate*e,n=this.workStrExpGainRate*e,a=this.workDefExpGainRate*e,r=this.workDexExpGainRate*e,i=this.workAgiExpGainRate*e,o=this.workChaExpGainRate*e,s=(this.workMoneyGainRate-this.workMoneyLossRate)*e;this.gainHackingExp(t),this.gainStrengthExp(n),this.gainDefenseExp(a),this.gainDexterityExp(r),this.gainAgilityExp(i),this.gainCharismaExp(o),this.gainMoney(s),this.recordMoneySource(s,"work"),this.workHackExpGained+=t,this.workStrExpGained+=n,this.workDefExpGained+=a,this.workDexExpGained+=r,this.workAgiExpGained+=i,this.workChaExpGained+=o,this.workRepGained+=this.workRepGainRate*e,this.workMoneyGained+=this.workMoneyGainRate*e,this.workMoneyGained-=this.workMoneyLossRate*e},$.prototype.startWork=function(e){this.resetWorkStatus(),this.isWorking=!0,this.companyName=e,this.workType=_.CONSTANTS.WorkTypeCompany,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=_.CONSTANTS.MillisecondsPer8Hours;var t=Object(U.clearEventListeners)("work-in-progress-cancel-button");t.innerHTML="Cancel Work",t.addEventListener("click",function(){return z.finishWork(!0),!1}),E.Engine.loadWorkInProgressContent()},$.prototype.work=function(e){var t=!1;if(this.timeWorked+E.Engine._idleSpeed*e>=_.CONSTANTS.MillisecondsPer8Hours&&(t=!0,e=Math.round((_.CONSTANTS.MillisecondsPer8Hours-this.timeWorked)/E.Engine._idleSpeed)),this.timeWorked+=E.Engine._idleSpeed*e,this.workRepGainRate=this.getWorkRepGain(),this.processWorkEarnings(e),t||this.timeWorked>=_.CONSTANTS.MillisecondsPer8Hours)return this.finishWork(!1);var n=p.Companies[this.companyName],a="0";null!=n&&n instanceof u.Company?a=n.playerReputation:console.error(`Could not find Company: ${this.companyName}`);const r=this.jobs[this.companyName];document.getElementById("work-in-progress-text").innerHTML="You are currently working as a "+r+" at "+this.companyName+" (Current Company Reputation: "+W.numeralWrapper.format(a,"0,0")+")

You have been working for "+Object(K.convertTimeMsToTimeElapsedString)(this.timeWorked)+"

You have earned:

$"+W.numeralWrapper.format(this.workMoneyGained,"0,0.00")+" ($"+W.numeralWrapper.format(this.workMoneyGainRate*q,"0,0.00")+" / sec)

"+W.numeralWrapper.format(this.workRepGained,"0,0.0000")+" ("+W.numeralWrapper.format(this.workRepGainRate*q,"0,0.0000")+" / sec) reputation for this company

"+W.numeralWrapper.format(this.workHackExpGained,"0,0.0000")+" ("+W.numeralWrapper.format(this.workHackExpGainRate*q,"0,0.0000")+" / sec) hacking exp

"+W.numeralWrapper.format(this.workStrExpGained,"0,0.0000")+" ("+W.numeralWrapper.format(this.workStrExpGainRate*q,"0,0.0000")+" / sec) strength exp
"+W.numeralWrapper.format(this.workDefExpGained,"0,0.0000")+" ("+W.numeralWrapper.format(this.workDefExpGainRate*q,"0,0.0000")+" / sec) defense exp
"+W.numeralWrapper.format(this.workDexExpGained,"0,0.0000")+" ("+W.numeralWrapper.format(this.workDexExpGainRate*q,"0,0.0000")+" / sec) dexterity exp
"+W.numeralWrapper.format(this.workAgiExpGained,"0,0.0000")+" ("+W.numeralWrapper.format(this.workAgiExpGainRate*q,"0,0.0000")+" / sec) agility exp

"+W.numeralWrapper.format(this.workChaExpGained,"0,0.0000")+" ("+W.numeralWrapper.format(this.workChaExpGainRate*q,"0,0.0000")+" / sec) charisma exp

You will automatically finish after working for 8 hours. You can cancel earlier if you wish, but you will only gain half of the reputation you've earned so far."},$.prototype.finishWork=function(e,t=!1){e&&(this.workRepGained/=2),p.Companies[this.companyName].playerReputation+=this.workRepGained,this.updateSkillLevels();var n="You earned a total of:
$"+W.numeralWrapper.format(this.workMoneyGained,"0,0.00")+"
"+W.numeralWrapper.format(this.workRepGained,"0,0.0000")+" reputation for the company
"+W.numeralWrapper.format(this.workHackExpGained,"0,0.0000")+" hacking exp
"+W.numeralWrapper.format(this.workStrExpGained,"0,0.0000")+" strength exp
"+W.numeralWrapper.format(this.workDefExpGained,"0,0.0000")+" defense exp
"+W.numeralWrapper.format(this.workDexExpGained,"0,0.0000")+" dexterity exp
"+W.numeralWrapper.format(this.workAgiExpGained,"0,0.0000")+" agility exp
"+W.numeralWrapper.format(this.workChaExpGained,"0,0.0000")+" charisma exp
";if(n=e?"You worked a short shift of "+Object(K.convertTimeMsToTimeElapsedString)(this.timeWorked)+"

Since you cancelled your work early, you only gained half of the reputation you earned.

"+n:"You worked a full shift of 8 hours!

"+n,t||Object(F.dialogBoxCreate)(n),document.getElementById("mainmenu-container").style.visibility="visible",this.isWorking=!1,E.Engine.loadLocationContent(),t){var a="You worked a short shift of "+Object(K.convertTimeMsToTimeElapsedString)(this.timeWorked)+" and earned $"+W.numeralWrapper.format(this.workMoneyGained,"0,0.00")+", "+W.numeralWrapper.format(this.workRepGained,"0,0.0000")+" reputation, "+W.numeralWrapper.format(this.workHackExpGained,"0,0.0000")+" hacking exp, "+W.numeralWrapper.format(this.workStrExpGained,"0,0.0000")+" strength exp, "+W.numeralWrapper.format(this.workDefExpGained,"0,0.0000")+" defense exp, "+W.numeralWrapper.format(this.workDexExpGained,"0,0.0000")+" dexterity exp, "+W.numeralWrapper.format(this.workAgiExpGained,"0,0.0000")+" agility exp, and "+W.numeralWrapper.format(this.workChaExpGained,"0,0.0000")+" charisma exp.";return this.resetWorkStatus(),a}this.resetWorkStatus()},$.prototype.startWorkPartTime=function(e){this.resetWorkStatus(),this.isWorking=!0,this.companyName=e,this.workType=_.CONSTANTS.WorkTypeCompanyPartTime,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=_.CONSTANTS.MillisecondsPer8Hours;var t=Object(U.clearEventListeners)("work-in-progress-cancel-button");t.innerHTML="Stop Working",t.addEventListener("click",function(){return z.finishWorkPartTime(),!1}),E.Engine.loadWorkInProgressContent()},$.prototype.workPartTime=function(e){var t=!1;if(this.timeWorked+E.Engine._idleSpeed*e>=_.CONSTANTS.MillisecondsPer8Hours&&(t=!0,e=Math.round((_.CONSTANTS.MillisecondsPer8Hours-this.timeWorked)/E.Engine._idleSpeed)),this.timeWorked+=E.Engine._idleSpeed*e,this.workRepGainRate=this.getWorkRepGain(),this.processWorkEarnings(e),t||this.timeWorked>=_.CONSTANTS.MillisecondsPer8Hours)return this.finishWorkPartTime();var n=p.Companies[this.companyName],a="0";null!=n&&n instanceof u.Company?a=n.playerReputation:console.log("ERROR: Could not find Company: "+this.companyName);const r=this.jobs[this.companyName];document.getElementById("work-in-progress-text").innerHTML="You are currently working as a "+r+" at "+this.companyName+" (Current Company Reputation: "+W.numeralWrapper.format(a,"0,0")+")

You have been working for "+Object(K.convertTimeMsToTimeElapsedString)(this.timeWorked)+"

You have earned:

$"+W.numeralWrapper.format(this.workMoneyGained,"0,0.00")+" ($"+W.numeralWrapper.format(this.workMoneyGainRate*q,"0,0.00")+" / sec)

"+W.numeralWrapper.format(this.workRepGained,"0,0.0000")+" ("+W.numeralWrapper.format(this.workRepGainRate*q,"0,0.0000")+" / sec) reputation for this company

"+W.numeralWrapper.format(this.workHackExpGained,"0,0.0000")+" ("+W.numeralWrapper.format(this.workHackExpGainRate*q,"0,0.0000")+" / sec) hacking exp

"+W.numeralWrapper.format(this.workStrExpGained,"0,0.0000")+" ("+W.numeralWrapper.format(this.workStrExpGainRate*q,"0,0.0000")+" / sec) strength exp
"+W.numeralWrapper.format(this.workDefExpGained,"0,0.0000")+" ("+W.numeralWrapper.format(this.workDefExpGainRate*q,"0,0.0000")+" / sec) defense exp
"+W.numeralWrapper.format(this.workDexExpGained,"0,0.0000")+" ("+W.numeralWrapper.format(this.workDexExpGainRate*q,"0,0.0000")+" / sec) dexterity exp
"+W.numeralWrapper.format(this.workAgiExpGained,"0,0.0000")+" ("+W.numeralWrapper.format(this.workAgiExpGainRate*q,"0,0.0000")+" / sec) agility exp

"+W.numeralWrapper.format(this.workChaExpGained,"0,0.0000")+" ("+W.numeralWrapper.format(this.workChaExpGainRate*q,"0,0.0000")+" / sec) charisma exp

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."},$.prototype.finishWorkPartTime=function(e=!1){p.Companies[this.companyName].playerReputation+=this.workRepGained,this.updateSkillLevels();var t="You earned a total of:
$"+W.numeralWrapper.format(this.workMoneyGained,"0,0.00")+"
"+W.numeralWrapper.format(this.workRepGained,"0,0.0000")+" reputation for the company
"+W.numeralWrapper.format(this.workHackExpGained,"0,0.0000")+" hacking exp
"+W.numeralWrapper.format(this.workStrExpGained,"0,0.0000")+" strength exp
"+W.numeralWrapper.format(this.workDefExpGained,"0,0.0000")+" defense exp
"+W.numeralWrapper.format(this.workDexExpGained,"0,0.0000")+" dexterity exp
"+W.numeralWrapper.format(this.workAgiExpGained,"0,0.0000")+" agility exp
"+W.numeralWrapper.format(this.workChaExpGained,"0,0.0000")+" charisma exp
";if(t="You worked for "+Object(K.convertTimeMsToTimeElapsedString)(this.timeWorked)+"

"+t,e||Object(F.dialogBoxCreate)(t),document.getElementById("mainmenu-container").style.visibility="visible",this.isWorking=!1,E.Engine.loadLocationContent(),e){var n="You worked for "+Object(K.convertTimeMsToTimeElapsedString)(this.timeWorked)+" and earned a total of $"+W.numeralWrapper.format(this.workMoneyGained,"0,0.00")+", "+W.numeralWrapper.format(this.workRepGained,"0,0.0000")+" reputation, "+W.numeralWrapper.format(this.workHackExpGained,"0,0.0000")+" hacking exp, "+W.numeralWrapper.format(this.workStrExpGained,"0,0.0000")+" strength exp, "+W.numeralWrapper.format(this.workDefExpGained,"0,0.0000")+" defense exp, "+W.numeralWrapper.format(this.workDexExpGained,"0,0.0000")+" dexterity exp, "+W.numeralWrapper.format(this.workAgiExpGained,"0,0.0000")+" agility exp, and "+W.numeralWrapper.format(this.workChaExpGained,"0,0.0000")+" charisma exp";return this.resetWorkStatus(),n}this.resetWorkStatus()},$.prototype.startFactionWork=function(e){var t=1+e.favor/100;isNaN(t)&&(t=1),this.workRepGainRate*=t,this.workRepGainRate*=s.BitNodeMultipliers.FactionWorkRepGain,this.isWorking=!0,this.workType=_.CONSTANTS.WorkTypeFaction,this.currentWorkFactionName=e.name,this.timeNeededToCompleteWork=_.CONSTANTS.MillisecondsPer20Hours;var n=Object(U.clearEventListeners)("work-in-progress-cancel-button");n.innerHTML="Stop Faction Work",n.addEventListener("click",function(){return z.finishFactionWork(!0),!1}),E.Engine.loadWorkInProgressContent()},$.prototype.startFactionHackWork=function(e){this.resetWorkStatus(),this.workHackExpGainRate=.15*this.hacking_exp_mult*s.BitNodeMultipliers.FactionWorkExpGain,this.workRepGainRate=this.workRepGainRate=(this.hacking_skill+this.intelligence)/_.CONSTANTS.MaxSkillLevel*this.faction_rep_mult,this.factionWorkType=_.CONSTANTS.FactionWorkHacking,this.currentWorkFactionDescription="carrying out hacking contracts",this.startFactionWork(e)},$.prototype.startFactionFieldWork=function(e){this.resetWorkStatus(),this.workHackExpGainRate=.1*this.hacking_exp_mult*s.BitNodeMultipliers.FactionWorkExpGain,this.workStrExpGainRate=.1*this.strength_exp_mult*s.BitNodeMultipliers.FactionWorkExpGain,this.workDefExpGainRate=.1*this.defense_exp_mult*s.BitNodeMultipliers.FactionWorkExpGain,this.workDexExpGainRate=.1*this.dexterity_exp_mult*s.BitNodeMultipliers.FactionWorkExpGain,this.workAgiExpGainRate=.1*this.agility_exp_mult*s.BitNodeMultipliers.FactionWorkExpGain,this.workChaExpGainRate=.1*this.charisma_exp_mult*s.BitNodeMultipliers.FactionWorkExpGain,this.workRepGainRate=this.getFactionFieldWorkRepGain(),this.factionWorkType=_.CONSTANTS.FactionWorkField,this.currentWorkFactionDescription="carrying out field missions",this.startFactionWork(e)},$.prototype.startFactionSecurityWork=function(e){this.resetWorkStatus(),this.workHackExpGainRate=.05*this.hacking_exp_mult*s.BitNodeMultipliers.FactionWorkExpGain,this.workStrExpGainRate=.15*this.strength_exp_mult*s.BitNodeMultipliers.FactionWorkExpGain,this.workDefExpGainRate=.15*this.defense_exp_mult*s.BitNodeMultipliers.FactionWorkExpGain,this.workDexExpGainRate=.15*this.dexterity_exp_mult*s.BitNodeMultipliers.FactionWorkExpGain,this.workAgiExpGainRate=.15*this.agility_exp_mult*s.BitNodeMultipliers.FactionWorkExpGain,this.workChaExpGainRate=0*this.charisma_exp_mult*s.BitNodeMultipliers.FactionWorkExpGain,this.workRepGainRate=this.getFactionSecurityWorkRepGain(),this.factionWorkType=_.CONSTANTS.FactionWorkSecurity,this.currentWorkFactionDescription="performing security detail",this.startFactionWork(e)},$.prototype.workForFaction=function(e){var t=C.Factions[this.currentWorkFactionName];switch(this.factionWorkType){case _.CONSTANTS.FactionWorkHacking:this.workRepGainRate=(this.hacking_skill+this.intelligence)/_.CONSTANTS.MaxSkillLevel*this.faction_rep_mult;break;case _.CONSTANTS.FactionWorkField:this.workRepGainRate=this.getFactionFieldWorkRepGain();break;case _.CONSTANTS.FactionWorkSecurity:this.workRepGainRate=this.getFactionSecurityWorkRepGain()}var n=1+t.favor/100;isNaN(n)&&(n=1),this.workRepGainRate*=n,this.workRepGainRate*=s.BitNodeMultipliers.FactionWorkRepGain;var a=!1;if(this.timeWorked+E.Engine._idleSpeed*e>=_.CONSTANTS.MillisecondsPer20Hours&&(a=!0,e=Math.round((_.CONSTANTS.MillisecondsPer20Hours-this.timeWorked)/E.Engine._idleSpeed)),this.timeWorked+=E.Engine._idleSpeed*e,this.processWorkEarnings(e),a||this.timeWorked>=_.CONSTANTS.MillisecondsPer20Hours)return this.finishFactionWork(!1);document.getElementById("work-in-progress-text").innerHTML="You are currently "+this.currentWorkFactionDescription+" for your faction "+t.name+" (Current Faction Reputation: "+W.numeralWrapper.format(t.playerReputation,"0,0")+").
You have been doing this for "+Object(K.convertTimeMsToTimeElapsedString)(this.timeWorked)+"

You have earned:

$"+W.numeralWrapper.format(this.workMoneyGained,"0,0.00")+" ("+W.numeralWrapper.format(this.workMoneyGainRate*q,"0,0.00")+" / sec)

"+W.numeralWrapper.format(this.workRepGained,"0,0.0000")+" ("+W.numeralWrapper.format(this.workRepGainRate*q,"0,0.0000")+" / sec) reputation for this faction

"+W.numeralWrapper.format(this.workHackExpGained,"0,0.0000")+" ("+W.numeralWrapper.format(this.workHackExpGainRate*q,"0,0.0000")+" / sec) hacking exp

"+W.numeralWrapper.format(this.workStrExpGained,"0,0.0000")+" ("+W.numeralWrapper.format(this.workStrExpGainRate*q,"0,0.0000")+" / sec) strength exp
"+W.numeralWrapper.format(this.workDefExpGained,"0,0.0000")+" ("+W.numeralWrapper.format(this.workDefExpGainRate*q,"0,0.0000")+" / sec) defense exp
"+W.numeralWrapper.format(this.workDexExpGained,"0,0.0000")+" ("+W.numeralWrapper.format(this.workDexExpGainRate*q,"0,0.0000")+" / sec) dexterity exp
"+W.numeralWrapper.format(this.workAgiExpGained,"0,0.0000")+" ("+W.numeralWrapper.format(this.workAgiExpGainRate*q,"0,0.0000")+" / sec) agility exp

"+W.numeralWrapper.format(this.workChaExpGained,"0,0.0000")+" ("+W.numeralWrapper.format(this.workChaExpGainRate*q,"0,0.0000")+" / sec) charisma exp

You will automatically finish after working for 20 hours. You can cancel earlier if you wish.
There is no penalty for cancelling earlier."},$.prototype.finishFactionWork=function(e,t=!1){var n=C.Factions[this.currentWorkFactionName];n.playerReputation+=this.workRepGained,this.updateSkillLevels();var a="You worked for your faction "+n.name+" for a total of "+Object(K.convertTimeMsToTimeElapsedString)(this.timeWorked)+"

You earned a total of:
$"+W.numeralWrapper.format(this.workMoneyGained,"0,0.00")+"
"+W.numeralWrapper.format(this.workRepGained,"0,0.0000")+" reputation for the faction
"+W.numeralWrapper.format(this.workHackExpGained,"0,0.0000")+" hacking exp
"+W.numeralWrapper.format(this.workStrExpGained,"0,0.0000")+" strength exp
"+W.numeralWrapper.format(this.workDefExpGained,"0,0.0000")+" defense exp
"+W.numeralWrapper.format(this.workDexExpGained,"0,0.0000")+" dexterity exp
"+W.numeralWrapper.format(this.workAgiExpGained,"0,0.0000")+" agility exp
"+W.numeralWrapper.format(this.workChaExpGained,"0,0.0000")+" charisma exp
";if(t||Object(F.dialogBoxCreate)(a),document.getElementById("mainmenu-container").style.visibility="visible",this.isWorking=!1,E.Engine.loadFactionContent(),Object(O.a)(n.name),t){var r="You worked for your faction "+n.name+" for a total of "+Object(K.convertTimeMsToTimeElapsedString)(this.timeWorked)+". You earned "+W.numeralWrapper.format(this.workRepGained,"0,0.0000")+" rep, "+W.numeralWrapper.format(this.workHackExpGained,"0,0.0000")+" hacking exp, "+W.numeralWrapper.format(this.workStrExpGained,"0,0.0000")+" str exp, "+W.numeralWrapper.format(this.workDefExpGained,"0,0.0000")+" def exp, "+W.numeralWrapper.format(this.workDexExpGained,"0,0.0000")+" dex exp, "+W.numeralWrapper.format(this.workAgiExpGained,"0,0.0000")+" agi exp, and "+W.numeralWrapper.format(this.workChaExpGained,"0,0.0000")+" cha exp.";return this.resetWorkStatus(),r}this.resetWorkStatus()},$.prototype.getWorkMoneyGain=function(){let e=1;const t=p.Companies[this.companyName];A.d&&(e=1+t.favor/100);const n=this.jobs[this.companyName],a=d.CompanyPositions[n];return null==a?(console.error(`Could not find CompanyPosition object for ${n}. Work salary will be 0`),0):a.baseSalary*t.salaryMultiplier*this.work_money_mult*s.BitNodeMultipliers.CompanyWorkMoney*e},$.prototype.getWorkHackExpGain=function(){const e=p.Companies[this.companyName],t=this.jobs[this.companyName],n=d.CompanyPositions[t];return null==e||null==n?(console.error([`Could not find Company object for ${this.companyName}`,`or CompanyPosition object for ${t}.`,"Work hack exp gain will be 0"].join(" ")),0):n.hackingExpGain*e.expMultiplier*this.hacking_exp_mult*s.BitNodeMultipliers.CompanyWorkExpGain},$.prototype.getWorkStrExpGain=function(){const e=p.Companies[this.companyName],t=this.jobs[this.companyName],n=d.CompanyPositions[t];return null==e||null==n?(console.error([`Could not find Company object for ${this.companyName}`,`or CompanyPosition object for ${t}.`,"Work str exp gain will be 0"].join(" ")),0):n.strengthExpGain*e.expMultiplier*this.strength_exp_mult*s.BitNodeMultipliers.CompanyWorkExpGain},$.prototype.getWorkDefExpGain=function(){const e=p.Companies[this.companyName],t=this.jobs[this.companyName],n=d.CompanyPositions[t];return null==e||null==n?(console.error([`Could not find Company object for ${this.companyName}`,`or CompanyPosition object for ${t}.`,"Work def exp gain will be 0"].join(" ")),0):n.defenseExpGain*e.expMultiplier*this.defense_exp_mult*s.BitNodeMultipliers.CompanyWorkExpGain},$.prototype.getWorkDexExpGain=function(){const e=p.Companies[this.companyName],t=this.jobs[this.companyName],n=d.CompanyPositions[t];return null==e||null==n?(console.error([`Could not find Company object for ${this.companyName}`,`or CompanyPosition object for ${t}.`,"Work dex exp gain will be 0"].join(" ")),0):n.dexterityExpGain*e.expMultiplier*this.dexterity_exp_mult*s.BitNodeMultipliers.CompanyWorkExpGain},$.prototype.getWorkAgiExpGain=function(){const e=p.Companies[this.companyName],t=this.jobs[this.companyName],n=d.CompanyPositions[t];return null==e||null==n?(console.error([`Could not find Company object for ${this.companyName}`,`or CompanyPosition object for ${t}.`,"Work agi exp gain will be 0"].join(" ")),0):n.agilityExpGain*e.expMultiplier*this.agility_exp_mult*s.BitNodeMultipliers.CompanyWorkExpGain},$.prototype.getWorkChaExpGain=function(){const e=p.Companies[this.companyName],t=this.jobs[this.companyName],n=d.CompanyPositions[t];return null==e||null==n?(console.error([`Could not find Company object for ${this.companyName}`,`or CompanyPosition object for ${t}.`,"Work cha exp gain will be 0"].join(" ")),0):n.charismaExpGain*e.expMultiplier*this.charisma_exp_mult*s.BitNodeMultipliers.CompanyWorkExpGain},$.prototype.getWorkRepGain=function(){const e=p.Companies[this.companyName],t=this.jobs[this.companyName],n=d.CompanyPositions[t];if(null==e||null==n)return console.error([`Could not find Company object for ${this.companyName}`,`or CompanyPosition object for ${t}.`,"Work rep gain will be 0"].join(" ")),0;var a=n.calculateJobPerformance(this.hacking_skill,this.strength,this.defense,this.dexterity,this.agility,this.charisma);a+=this.intelligence/_.CONSTANTS.MaxSkillLevel;var r=1+e.favor/100;return isNaN(r)&&(r=1),a*this.company_rep_mult*r},$.prototype.getFactionSecurityWorkRepGain=function(){return.9*(this.hacking_skill/_.CONSTANTS.MaxSkillLevel+this.strength/_.CONSTANTS.MaxSkillLevel+this.defense/_.CONSTANTS.MaxSkillLevel+this.dexterity/_.CONSTANTS.MaxSkillLevel+this.agility/_.CONSTANTS.MaxSkillLevel)/4.5*this.faction_rep_mult},$.prototype.getFactionFieldWorkRepGain=function(){return.9*(this.hacking_skill/_.CONSTANTS.MaxSkillLevel+this.strength/_.CONSTANTS.MaxSkillLevel+this.defense/_.CONSTANTS.MaxSkillLevel+this.dexterity/_.CONSTANTS.MaxSkillLevel+this.agility/_.CONSTANTS.MaxSkillLevel+this.charisma/_.CONSTANTS.MaxSkillLevel+this.intelligence/_.CONSTANTS.MaxSkillLevel)/5.5*this.faction_rep_mult},$.prototype.startCreateProgramWork=function(e,t,n){this.resetWorkStatus(),this.isWorking=!0,this.workType=_.CONSTANTS.WorkTypeCreateProgram,this.createProgramReqLvl=n,this.timeNeededToCompleteWork=t;for(var a=0;a=100)break;this.timeWorkedCreateProgram=o/100*this.timeNeededToCompleteWork,this.getHomeComputer().programs.splice(a,1)}}this.createProgramName=e;var s=Object(U.clearEventListeners)("work-in-progress-cancel-button");s.innerHTML="Cancel work on creating program",s.addEventListener("click",function(){return z.finishCreateProgramWork(!0),!1}),E.Engine.loadWorkInProgressContent()},$.prototype.createProgramWork=function(e){var t=this.createProgramReqLvl,n=this.hacking_skill/t;n=1+(n-1)/5,this.timeWorked+=E.Engine._idleSpeed*e,this.timeWorkedCreateProgram+=E.Engine._idleSpeed*e*n;var a=this.createProgramName;this.timeWorkedCreateProgram>=this.timeNeededToCompleteWork&&this.finishCreateProgramWork(!1),document.getElementById("work-in-progress-text").innerHTML="You are currently working on coding "+a+".

You have been working for "+Object(K.convertTimeMsToTimeElapsedString)(this.timeWorked)+"

The program is "+(this.timeWorkedCreateProgram/this.timeNeededToCompleteWork*100).toFixed(2)+"% complete.
If you cancel, your work will be saved and you can come back to complete the program later."},$.prototype.finishCreateProgramWork=function(e,t=!1){var n=this.createProgramName;if(!1===e)Object(F.dialogBoxCreate)("You've finished creating "+n+"!
The new program can be found on your home computer."),this.getHomeComputer().programs.push(n);else{var a=n+"-"+(Math.floor(this.timeWorkedCreateProgram/this.timeNeededToCompleteWork*1e4)/100).toString()+"%-INC";this.getHomeComputer().programs.push(a)}e||this.gainIntelligenceExp(this.createProgramReqLvl/_.CONSTANTS.IntelligenceProgramBaseExpGain),document.getElementById("mainmenu-container").style.visibility="visible",this.isWorking=!1,E.Engine.loadTerminalContent(),this.resetWorkStatus()},$.prototype.startClass=function(e,t,n){this.resetWorkStatus(),this.isWorking=!0,this.workType=_.CONSTANTS.WorkTypeStudyClass,this.className=n;var a=1e3/E.Engine._idleSpeed,r=0,i=0,o=0,l=0,c=0,u=0,p=0;const h=this.hashManager;switch(n){case _.CONSTANTS.ClassStudyComputerScience:i=.5*t/a*h.getStudyMult();break;case _.CONSTANTS.ClassDataStructures:r=_.CONSTANTS.ClassDataStructuresBaseCost*e/a,i=1*t/a*h.getStudyMult();break;case _.CONSTANTS.ClassNetworks:r=_.CONSTANTS.ClassNetworksBaseCost*e/a,i=2*t/a*h.getStudyMult();break;case _.CONSTANTS.ClassAlgorithms:r=_.CONSTANTS.ClassAlgorithmsBaseCost*e/a,i=4*t/a*h.getStudyMult();break;case _.CONSTANTS.ClassManagement:r=_.CONSTANTS.ClassManagementBaseCost*e/a,p=2*t/a*h.getStudyMult();break;case _.CONSTANTS.ClassLeadership:r=_.CONSTANTS.ClassLeadershipBaseCost*e/a,p=4*t/a*h.getStudyMult();break;case _.CONSTANTS.ClassGymStrength:r=_.CONSTANTS.ClassGymBaseCost*e/a,o=1*t/a*h.getTrainingMult();break;case _.CONSTANTS.ClassGymDefense:r=_.CONSTANTS.ClassGymBaseCost*e/a,l=1*t/a*h.getTrainingMult();break;case _.CONSTANTS.ClassGymDexterity:r=_.CONSTANTS.ClassGymBaseCost*e/a,c=1*t/a*h.getTrainingMult();break;case _.CONSTANTS.ClassGymAgility:r=_.CONSTANTS.ClassGymBaseCost*e/a,u=1*t/a*h.getTrainingMult();break;default:throw new Error("ERR: Invalid/unrecognized class name")}this.workMoneyLossRate=r,this.workHackExpGainRate=i*this.hacking_exp_mult*s.BitNodeMultipliers.ClassGymExpGain,this.workStrExpGainRate=o*this.strength_exp_mult*s.BitNodeMultipliers.ClassGymExpGain,this.workDefExpGainRate=l*this.defense_exp_mult*s.BitNodeMultipliers.ClassGymExpGain,this.workDexExpGainRate=c*this.dexterity_exp_mult*s.BitNodeMultipliers.ClassGymExpGain,this.workAgiExpGainRate=u*this.agility_exp_mult*s.BitNodeMultipliers.ClassGymExpGain,this.workChaExpGainRate=p*this.charisma_exp_mult*s.BitNodeMultipliers.ClassGymExpGain;var m=Object(U.clearEventListeners)("work-in-progress-cancel-button");n==_.CONSTANTS.ClassGymStrength||n==_.CONSTANTS.ClassGymDefense||n==_.CONSTANTS.ClassGymDexterity||n==_.CONSTANTS.ClassGymAgility?m.innerHTML="Stop training at gym":m.innerHTML="Stop taking course",m.addEventListener("click",function(){return z.finishClass(),!1}),E.Engine.loadWorkInProgressContent()},$.prototype.takeClass=function(e){this.timeWorked+=E.Engine._idleSpeed*e;var t=this.className;this.processWorkEarnings(e),document.getElementById("work-in-progress-text").innerHTML="You have been "+t+" for "+Object(K.convertTimeMsToTimeElapsedString)(this.timeWorked)+"

This has cost you:
$"+W.numeralWrapper.format(this.workMoneyGained,"0,0.00")+" ($"+W.numeralWrapper.format(this.workMoneyLossRate*q,"0,0.00")+" / sec)

You have gained:
"+W.numeralWrapper.format(this.workHackExpGained,"0,0.0000")+" ("+W.numeralWrapper.format(this.workHackExpGainRate*q,"0,0.0000")+" / sec) hacking exp
"+W.numeralWrapper.format(this.workStrExpGained,"0,0.0000")+" ("+W.numeralWrapper.format(this.workStrExpGainRate*q,"0,0.0000")+" / sec) strength exp
"+W.numeralWrapper.format(this.workDefExpGained,"0,0.0000")+" ("+W.numeralWrapper.format(this.workDefExpGainRate*q,"0,0.0000")+" / sec) defense exp
"+W.numeralWrapper.format(this.workDexExpGained,"0,0.0000")+" ("+W.numeralWrapper.format(this.workDexExpGainRate*q,"0,0.0000")+" / sec) dexterity exp
"+W.numeralWrapper.format(this.workAgiExpGained,"0,0.0000")+" ("+W.numeralWrapper.format(this.workAgiExpGainRate*q,"0,0.0000")+" / sec) agility exp
"+W.numeralWrapper.format(this.workChaExpGained,"0,0.0000")+" ("+W.numeralWrapper.format(this.workChaExpGainRate*q,"0,0.0000")+" / sec) charisma exp
You may cancel at any time"},$.prototype.finishClass=function(e=!1){if(this.gainIntelligenceExp(_.CONSTANTS.IntelligenceClassBaseExpGain*Math.round(this.timeWorked/1e3)),this.workMoneyGained>0)throw new Error("ERR: Somehow gained money while taking class");this.updateSkillLevels();var t="After "+this.className+" for "+Object(K.convertTimeMsToTimeElapsedString)(this.timeWorked)+",
you spent a total of $"+W.numeralWrapper.format(-1*this.workMoneyGained,"0,0.00")+".

You earned a total of:
"+W.numeralWrapper.format(this.workHackExpGained,"0,0.0000")+" hacking exp
"+W.numeralWrapper.format(this.workStrExpGained,"0,0.0000")+" strength exp
"+W.numeralWrapper.format(this.workDefExpGained,"0,0.0000")+" defense exp
"+W.numeralWrapper.format(this.workDexExpGained,"0,0.0000")+" dexterity exp
"+W.numeralWrapper.format(this.workAgiExpGained,"0,0.0000")+" agility exp
"+W.numeralWrapper.format(this.workChaExpGained,"0,0.0000")+" charisma exp
";if(e||Object(F.dialogBoxCreate)(t),document.getElementById("mainmenu-container").style.visibility="visible",this.isWorking=!1,E.Engine.loadLocationContent(),e){var n="After "+this.className+" for "+Object(K.convertTimeMsToTimeElapsedString)(this.timeWorked)+", you spent a total of $"+W.numeralWrapper.format(-1*this.workMoneyGained,"0,0.00")+". You earned a total of: "+W.numeralWrapper.format(this.workHackExpGained,"0,0.0000")+" hacking exp, "+W.numeralWrapper.format(this.workStrExpGained,"0,0.0000")+" strength exp, "+W.numeralWrapper.format(this.workDefExpGained,"0,0.0000")+" defense exp, "+W.numeralWrapper.format(this.workDexExpGained,"0,0.0000")+" dexterity exp, "+W.numeralWrapper.format(this.workAgiExpGained,"0,0.0000")+" agility exp, and "+W.numeralWrapper.format(this.workChaExpGained,"0,0.0000")+" charisma exp";return this.resetWorkStatus(),n}this.resetWorkStatus()},$.prototype.startCrime=function(e,t,n,a,r,i,o,l,c,u=null){this.crimeType=e,this.resetWorkStatus(),this.isWorking=!0,this.workType=_.CONSTANTS.WorkTypeCrime,u&&u.workerscript&&(this.committingCrimeThruSingFn=!0,this.singFnCrimeWorkerScript=u.workerscript),this.workHackExpGained=t*this.hacking_exp_mult*s.BitNodeMultipliers.CrimeExpGain,this.workStrExpGained=n*this.strength_exp_mult*s.BitNodeMultipliers.CrimeExpGain,this.workDefExpGained=a*this.defense_exp_mult*s.BitNodeMultipliers.CrimeExpGain,this.workDexExpGained=r*this.dexterity_exp_mult*s.BitNodeMultipliers.CrimeExpGain,this.workAgiExpGained=i*this.agility_exp_mult*s.BitNodeMultipliers.CrimeExpGain,this.workChaExpGained=o*this.charisma_exp_mult*s.BitNodeMultipliers.CrimeExpGain,this.workMoneyGained=l*this.crime_money_mult*s.BitNodeMultipliers.CrimeMoney,this.timeNeededToCompleteWork=c;var p=Object(U.clearEventListeners)("work-in-progress-cancel-button");p.innerHTML="Cancel crime",p.addEventListener("click",function(){return z.finishCrime(!0),!1}),E.Engine.loadWorkInProgressContent()},$.prototype.commitCrime=function(e){if(this.timeWorked+=E.Engine._idleSpeed*e,this.timeWorked>=this.timeNeededToCompleteWork)this.finishCrime(!1);else{var t=Math.round(this.timeWorked/this.timeNeededToCompleteWork*100),n=Math.round(t/5);n<0&&(n=0),n>20&&(n=20);var a="["+Array(n+1).join("|")+Array(20-n+1).join(" ")+"]";document.getElementById("work-in-progress-text").innerHTML="You are attempting to "+this.crimeType+".
Time remaining: "+Object(K.convertTimeMsToTimeElapsedString)(this.timeNeededToCompleteWork-this.timeWorked)+"
"+a.replace(/ /g," ")}},$.prototype.finishCrime=function(e){if(!e){if(Object(b.determineCrimeSuccess)(z,this.crimeType)){let e=null;for(const t in v.Crimes)if(v.Crimes[t].type==this.crimeType){e=v.Crimes[t];break}null==e&&(console.log(this.crimeType),Object(F.dialogBoxCreate)("ERR: Unrecognized crime type. This is probably a bug please contact the developer")),z.gainMoney(this.workMoneyGained),z.recordMoneySource(this.workMoneyGained,"crime"),this.karma-=e.karma,this.numPeopleKilled+=e.kills,e.intelligence_exp>0&&this.gainIntelligenceExp(e.intelligence_exp),this.workHackExpGained*=2,this.workStrExpGained*=2,this.workDefExpGained*=2,this.workDexExpGained*=2,this.workAgiExpGained*=2,this.workChaExpGained*=2,this.committingCrimeThruSingFn?null==this.singFnCrimeWorkerScript.disableLogs.ALL&&null==this.singFnCrimeWorkerScript.disableLogs.commitCrime&&this.singFnCrimeWorkerScript.scriptRef.log("Crime successful! Gained "+W.numeralWrapper.format(this.workMoneyGained,"$0.000a")+", "+W.numeralWrapper.format(this.workHackExpGained,"0,0.0000")+" hack exp, "+W.numeralWrapper.format(this.workStrExpGained,"0,0.0000")+" str exp, "+W.numeralWrapper.format(this.workDefExpGained,"0,0.0000")+" def exp, "+W.numeralWrapper.format(this.workDexExpGained,"0,0.0000")+" dex exp, "+W.numeralWrapper.format(this.workAgiExpGained,"0,0.0000")+" agi exp, "+W.numeralWrapper.format(this.workChaExpGained,"0,0.0000")+" cha exp."):Object(F.dialogBoxCreate)("Crime successful!

You gained:
$"+W.numeralWrapper.format(this.workMoneyGained,"0,0.00")+"
"+W.numeralWrapper.format(this.workHackExpGained,"0,0.0000")+" hacking experience
"+W.numeralWrapper.format(this.workStrExpGained,"0,0.0000")+" strength experience
"+W.numeralWrapper.format(this.workDefExpGained,"0,0.0000")+" defense experience
"+W.numeralWrapper.format(this.workDexExpGained,"0,0.0000")+" dexterity experience
"+W.numeralWrapper.format(this.workAgiExpGained,"0,0.0000")+" agility experience
"+W.numeralWrapper.format(this.workChaExpGained,"0,0.0000")+" charisma experience")}else this.workHackExpGained/=2,this.workStrExpGained/=2,this.workDefExpGained/=2,this.workDexExpGained/=2,this.workAgiExpGained/=2,this.workChaExpGained/=2,this.committingCrimeThruSingFn?null==this.singFnCrimeWorkerScript.disableLogs.ALL&&null==this.singFnCrimeWorkerScript.disableLogs.commitCrime&&this.singFnCrimeWorkerScript.scriptRef.log("Crime failed! Gained "+W.numeralWrapper.format(this.workHackExpGained,"0,0.0000")+" hack exp, "+W.numeralWrapper.format(this.workStrExpGained,"0,0.0000")+" str exp, "+W.numeralWrapper.format(this.workDefExpGained,"0,0.0000")+" def exp, "+W.numeralWrapper.format(this.workDexExpGained,"0,0.0000")+" dex exp, "+W.numeralWrapper.format(this.workAgiExpGained,"0,0.0000")+" agi exp, "+W.numeralWrapper.format(this.workChaExpGained,"0,0.0000")+" cha exp."):Object(F.dialogBoxCreate)("Crime failed!

You gained:
"+W.numeralWrapper.format(this.workHackExpGained,"0,0.0000")+" hacking experience
"+W.numeralWrapper.format(this.workStrExpGained,"0,0.0000")+" strength experience
"+W.numeralWrapper.format(this.workDefExpGained,"0,0.0000")+" defense experience
"+W.numeralWrapper.format(this.workDexExpGained,"0,0.0000")+" dexterity experience
"+W.numeralWrapper.format(this.workAgiExpGained,"0,0.0000")+" agility experience
"+W.numeralWrapper.format(this.workChaExpGained,"0,0.0000")+" 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)}this.committingCrimeThruSingFn=!1,this.singFnCrimeWorkerScript=null,document.getElementById("mainmenu-container").style.visibility="visible",this.isWorking=!1,this.resetWorkStatus(),E.Engine.loadLocationContent()},$.prototype.singularityStopWork=function(){if(!this.isWorking)return"";var e;switch(this.workType){case _.CONSTANTS.WorkTypeStudyClass:e=this.finishClass(!0);break;case _.CONSTANTS.WorkTypeCompany:e=this.finishWork(!0,!0);break;case _.CONSTANTS.WorkTypeCompanyPartTime:e=this.finishWorkPartTime(!0);break;case _.CONSTANTS.WorkTypeFaction:e=this.finishFactionWork(!0,!0);break;case _.CONSTANTS.WorkTypeCreateProgram:e=this.finishCreateProgramWork(!0,!0);break;case _.CONSTANTS.WorkTypeCrime:e=this.finishCrime(!0);break;default:return console.log("ERROR: Unrecognized work type"),""}return e},$.prototype.takeDamage=function(e){if("number"==typeof e)return this.hp-=e,this.hp<=0&&(this.hospitalize(),!0);console.warn(`Player.takeDamage() called without a numeric argument: ${e}`)},$.prototype.regenerateHp=function(e){"number"==typeof e?(this.hp+=e,this.hp>this.max_hp&&(this.hp=this.max_hp)):console.warn(`Player.regenerateHp() called without a numeric argument: ${e}`)},$.prototype.hospitalize=function(){!1===N.Settings.SuppressHospitalizationPopup&&Object(F.dialogBoxCreate)("You were in critical condition! You were taken to the hospital where luckily they were able to save your life. You were charged "+W.numeralWrapper.format(this.max_hp*_.CONSTANTS.HospitalCostPerHp,"$0.000a")),this.loseMoney(this.max_hp*_.CONSTANTS.HospitalCostPerHp),this.hp=this.max_hp},$.prototype.applyForJob=function(e,t=!1){let n=null;""!==this.companyName&&(n=p.Companies[this.companyName]);const a=this.jobs[this.companyName],r=p.Companies[this.location];if(!(r instanceof u.Company))return t?"ERROR: Invalid company name: "+this.location+". applyToCompany() failed":void console.error(`Could not find company that matches the location: ${this.location}. Player.applyToCompany() failed`);let i=e;if(!this.isQualified(r,i)){var o=Object(m.getJobRequirementText)(r,i);return!t&&void Object(F.dialogBoxCreate)("Unforunately, you do not qualify for this position
"+o)}for(;;){let e=Object(h.getNextCompanyPosition)(i);if(null==e)break;if(!r.hasPosition(e))break;if(!this.isQualified(r,e))break;i=e}if(null==n||n.name!=r.name||i.name!=a){if(this.companyName=r.name,this.jobs[r.name]=i.name,document.getElementById("world-menu-header").click(),document.getElementById("world-menu-header").click(),t)return!0;Object(F.dialogBoxCreate)("Congratulations! You were offered a new job at "+this.companyName+" as a "+i.name+"!"),E.Engine.loadLocationContent()}else{var s=Object(h.getNextCompanyPosition)(i);if(null==s){if(t)return!1;Object(F.dialogBoxCreate)("You are already at the highest position for your field! No promotion available")}else if(r.hasPosition(s)){if(t)return!1;o=Object(m.getJobRequirementText)(r,s);Object(F.dialogBoxCreate)("Unfortunately, you do not qualify for a promotion
"+o)}else{if(t)return!1;Object(F.dialogBoxCreate)("You are already at the highest position for your field! No promotion available")}}},$.prototype.getNextCompanyPosition=function(e,t){var n=null;if(""!==this.companyName&&(n=p.Companies[this.companyName]),null==n||n.name!=e.name)return t;const a=this.jobs[this.companyName],r=d.CompanyPositions[a];return r.isSoftwareJob()&&t.isSoftwareJob()||r.isITJob()&&t.isITJob()||r.isBusinessJob()&&t.isBusinessJob()||r.isSecurityEngineerJob()&&t.isSecurityEngineerJob()||r.isNetworkEngineerJob()&&t.isNetworkEngineerJob()||r.isSecurityJob()&&t.isSecurityJob()||r.isAgentJob()&&t.isAgentJob()||r.isSoftwareConsultantJob()&&t.isSoftwareConsultantJob()||r.isBusinessConsultantJob()&&t.isBusinessConsultantJob()||r.isPartTimeJob()&&t.isPartTimeJob()?Object(h.getNextCompanyPosition)(r):t},$.prototype.applyForSoftwareJob=function(e=!1){return this.applyForJob(d.CompanyPositions[g.SoftwareCompanyPositions[0]],e)},$.prototype.applyForSoftwareConsultantJob=function(e=!1){return this.applyForJob(d.CompanyPositions[g.SoftwareConsultantCompanyPositions[0]],e)},$.prototype.applyForItJob=function(e=!1){return this.applyForJob(d.CompanyPositions[g.ITCompanyPositions[0]],e)},$.prototype.applyForSecurityEngineerJob=function(e=!1){var t=p.Companies[this.location];return this.isQualified(t,d.CompanyPositions[g.SecurityEngineerCompanyPositions[0]])?this.applyForJob(d.CompanyPositions[g.SecurityEngineerCompanyPositions[0]],e):!e&&void Object(F.dialogBoxCreate)("Unforunately, you do not qualify for this position")},$.prototype.applyForNetworkEngineerJob=function(e=!1){var t=p.Companies[this.location];return this.isQualified(t,d.CompanyPositions[g.NetworkEngineerCompanyPositions[0]])?this.applyForJob(d.CompanyPositions[g.NetworkEngineerCompanyPositions[0]],e):!e&&void Object(F.dialogBoxCreate)("Unforunately, you do not qualify for this position")},$.prototype.applyForBusinessJob=function(e=!1){return this.applyForJob(d.CompanyPositions[g.BusinessCompanyPositions[0]],e)},$.prototype.applyForBusinessConsultantJob=function(e=!1){return this.applyForJob(d.CompanyPositions[g.BusinessConsultantCompanyPositions[0]],e)},$.prototype.applyForSecurityJob=function(e=!1){return this.applyForJob(d.CompanyPositions[g.SecurityCompanyPositions[2]],e)},$.prototype.applyForAgentJob=function(e=!1){var t=p.Companies[this.location];return this.isQualified(t,d.CompanyPositions[g.AgentCompanyPositions[0]])?this.applyForJob(d.CompanyPositions[g.AgentCompanyPositions[0]],e):!e&&void Object(F.dialogBoxCreate)("Unforunately, you do not qualify for this position")},$.prototype.applyForEmployeeJob=function(e=!1){var t=p.Companies[this.location];if(this.isQualified(t,d.CompanyPositions[g.MiscCompanyPositions[1]])){if(this.companyName=t.name,this.jobs[t.name]=g.MiscCompanyPositions[1],document.getElementById("world-menu-header").click(),document.getElementById("world-menu-header").click(),e)return!0;Object(F.dialogBoxCreate)("Congratulations, you are now employed at "+this.companyName),E.Engine.loadLocationContent()}else{if(e)return!1;Object(F.dialogBoxCreate)("Unforunately, you do not qualify for this position")}},$.prototype.applyForPartTimeEmployeeJob=function(e=!1){var t=p.Companies[this.location];if(this.isQualified(t,d.CompanyPositions[g.PartTimeCompanyPositions[1]])){if(this.companyName=t.name,this.jobs[t.name]=g.PartTimeCompanyPositions[1],document.getElementById("world-menu-header").click(),document.getElementById("world-menu-header").click(),e)return!0;Object(F.dialogBoxCreate)("Congratulations, you are now employed part-time at "+this.companyName),E.Engine.loadLocationContent()}else{if(e)return!1;Object(F.dialogBoxCreate)("Unforunately, you do not qualify for this position")}},$.prototype.applyForWaiterJob=function(e=!1){var t=p.Companies[this.location];if(this.isQualified(t,d.CompanyPositions[g.MiscCompanyPositions[0]])){if(this.companyName=t.name,this.jobs[t.name]=g.MiscCompanyPositions[0],document.getElementById("world-menu-header").click(),document.getElementById("world-menu-header").click(),e)return!0;Object(F.dialogBoxCreate)("Congratulations, you are now employed as a waiter at "+this.companyName),E.Engine.loadLocationContent()}else{if(e)return!1;Object(F.dialogBoxCreate)("Unforunately, you do not qualify for this position")}},$.prototype.applyForPartTimeWaiterJob=function(e=!1){var t=p.Companies[this.location];if(this.isQualified(t,d.CompanyPositions[g.PartTimeCompanyPositions[0]])){if(this.companyName=t.name,this.jobs[t.name]=g.PartTimeCompanyPositions[0],document.getElementById("world-menu-header").click(),document.getElementById("world-menu-header").click(),e)return!0;Object(F.dialogBoxCreate)("Congratulations, you are now employed as a part-time waiter at "+this.companyName),E.Engine.loadLocationContent()}else{if(e)return!1;Object(F.dialogBoxCreate)("Unforunately, you do not qualify for this position")}},$.prototype.isQualified=function(e,t){var n=e.jobStatReqOffset,a=t.requiredHacking>0?t.requiredHacking+n:0,r=t.requiredStrength>0?t.requiredStrength+n:0,i=t.requiredDefense>0?t.requiredDefense+n:0,o=t.requiredDexterity>0?t.requiredDexterity+n:0,s=t.requiredDexterity>0?t.requiredDexterity+n:0,l=t.requiredCharisma>0?t.requiredCharisma+n:0;return this.hacking_skill>=a&&this.strength>=r&&this.defense>=i&&this.dexterity>=o&&this.agility>=s&&this.charisma>=l&&e.playerReputation>=t.requiredReputation},$.prototype.reapplyAllAugmentations=function(e=!0){console.log("Re-applying augmentations"),e&&this.resetMultipliers();for(let e=0;et}var i=C.Factions.Illuminati;!i.isBanned&&!i.isMember&&!i.alreadyInvited&&t>=30&&this.money.gte(15e10)&&this.hacking_skill>=1500&&this.strength>=1200&&this.defense>=1200&&this.dexterity>=1200&&this.agility>=1200&&e.push(i);var o=C.Factions.Daedalus;!o.isBanned&&!o.isMember&&!o.alreadyInvited&&t>=Math.round(30*s.BitNodeMultipliers.DaedalusAugsRequirement)&&this.money.gte(1e11)&&(this.hacking_skill>=2500||this.strength>=1500&&this.defense>=1500&&this.dexterity>=1500&&this.agility>=1500)&&e.push(o);var l=C.Factions["The Covenant"];!l.isBanned&&!l.isMember&&!l.alreadyInvited&&t>=20&&this.money.gte(75e9)&&this.hacking_skill>=850&&this.strength>=850&&this.defense>=850&&this.dexterity>=850&&this.agility>=850&&e.push(l);var c=C.Factions.ECorp;c.isBanned||c.isMember||c.alreadyInvited||!r(P.Locations.AevumECorp)||e.push(c);var u=C.Factions.MegaCorp;u.isBanned||u.isMember||u.alreadyInvited||!r(P.Locations.Sector12MegaCorp)||e.push(u);var h=C.Factions["Bachman & Associates"];h.isBanned||h.isMember||h.alreadyInvited||!r(P.Locations.AevumBachmanAndAssociates)||e.push(h);var m=C.Factions["Blade Industries"];m.isBanned||m.isMember||m.alreadyInvited||!r(P.Locations.Sector12BladeIndustries)||e.push(m);var d=C.Factions.NWO;d.isBanned||d.isMember||d.alreadyInvited||!r(P.Locations.VolhavenNWO)||e.push(d);var g=C.Factions["Clarke Incorporated"];g.isBanned||g.isMember||g.alreadyInvited||!r(P.Locations.AevumClarkeIncorporated)||e.push(g);var f=C.Factions["OmniTek Incorporated"];f.isBanned||f.isMember||f.alreadyInvited||!r(P.Locations.VolhavenOmniTekIncorporated)||e.push(f);var y=C.Factions["Four Sigma"];y.isBanned||y.isMember||y.alreadyInvited||!r(P.Locations.Sector12FourSigma)||e.push(y);var b=C.Factions["KuaiGong International"];b.isBanned||b.isMember||b.alreadyInvited||!r(P.Locations.ChongqingKuaiGongInternational)||e.push(b);var v=C.Factions["Fulcrum Secret Technologies"],E=x.AllServers[I.SpecialServerIps[I.SpecialServerNames.FulcrumSecretTechnologies]];null==E?console.log("ERROR: Could not find Fulcrum Secret Technologies Server"):v.isBanned||v.isMember||v.alreadyInvited||!E.manuallyHacked||!r(P.Locations.AevumFulcrumTechnologies,25e4)||e.push(v);var k=C.Factions.BitRunners,O=this.getHomeComputer(),T=x.AllServers[I.SpecialServerIps[I.SpecialServerNames.BitRunnersServer]];null==T?console.log("ERROR: Could not find BitRunners Server"):!k.isBanned&&!k.isMember&&T.manuallyHacked&&!k.alreadyInvited&&this.hacking_skill>=500&&O.maxRam>=128&&e.push(k);var M=C.Factions["The Black Hand"],A=x.AllServers[I.SpecialServerIps[I.SpecialServerNames.TheBlackHandServer]];null==A?console.log("ERROR: Could not find The Black Hand Server"):!M.isBanned&&!M.isMember&&A.manuallyHacked&&!M.alreadyInvited&&this.hacking_skill>=350&&O.maxRam>=64&&e.push(M);var w=C.Factions.NiteSec,R=x.AllServers[I.SpecialServerIps[I.SpecialServerNames.NiteSecServer]];null==R?console.log("ERROR: Could not find NiteSec Server"):!w.isBanned&&!w.isMember&&R.manuallyHacked&&!w.alreadyInvited&&this.hacking_skill>=200&&O.maxRam>=32&&e.push(w);var N=C.Factions.Chongqing;N.isBanned||N.isMember||N.alreadyInvited||!this.money.gte(2e7)||this.city!=P.Locations.Chongqing||e.push(N);var L=C.Factions["Sector-12"];L.isBanned||L.isMember||L.alreadyInvited||!this.money.gte(15e6)||this.city!=P.Locations.Sector12||e.push(L);var D=C.Factions["New Tokyo"];D.isBanned||D.isMember||D.alreadyInvited||!this.money.gte(2e7)||this.city!=P.Locations.NewTokyo||e.push(D);var B=C.Factions.Aevum;B.isBanned||B.isMember||B.alreadyInvited||!this.money.gte(4e7)||this.city!=P.Locations.Aevum||e.push(B);var W=C.Factions.Ishima;W.isBanned||W.isMember||W.alreadyInvited||!this.money.gte(3e7)||this.city!=P.Locations.Ishima||e.push(W);var j=C.Factions.Volhaven;j.isBanned||j.isMember||j.alreadyInvited||!this.money.gte(5e7)||this.city!=P.Locations.Volhaven||e.push(j);var F=C.Factions["Speakers for the Dead"];!F.isBanned&&!F.isMember&&!F.alreadyInvited&&this.hacking_skill>=100&&this.strength>=300&&this.defense>=300&&this.dexterity>=300&&this.agility>=300&&this.numPeopleKilled>=30&&this.karma<=-45&&!n.includes(P.Locations.Sector12CIA)&&!n.includes(P.Locations.Sector12NSA)&&e.push(F);var U=C.Factions["The Dark Army"];!U.isBanned&&!U.isMember&&!U.alreadyInvited&&this.hacking_skill>=300&&this.strength>=300&&this.defense>=300&&this.dexterity>=300&&this.agility>=300&&this.city==P.Locations.Chongqing&&this.numPeopleKilled>=5&&this.karma<=-45&&!n.includes(P.Locations.Sector12CIA)&&!n.includes(P.Locations.Sector12NSA)&&e.push(U);var H=C.Factions["The Syndicate"];!H.isBanned&&!H.isMember&&!H.alreadyInvited&&this.hacking_skill>=200&&this.strength>=200&&this.defense>=200&&this.dexterity>=200&&this.agility>=200&&(this.city==P.Locations.Aevum||this.city==P.Locations.Sector12)&&this.money.gte(1e7)&&this.karma<=-90&&!n.includes(P.Locations.Sector12CIA)&&!n.includes(P.Locations.Sector12NSA)&&e.push(H);var G=C.Factions.Silhouette;!G.isBanned&&!G.isMember&&!G.alreadyInvited&&(a.includes("Chief Technology Officer")||a.includes("Chief Financial Officer")||a.includes("Chief Executive Officer"))&&this.money.gte(15e6)&&this.karma<=-22&&e.push(G);var K=C.Factions.Tetrads;!K.isBanned&&!K.isMember&&!K.alreadyInvited&&(this.city==P.Locations.Chongqing||this.city==P.Locations.NewTokyo||this.city==P.Locations.Ishima)&&this.strength>=75&&this.defense>=75&&this.dexterity>=75&&this.agility>=75&&this.karma<=-18&&e.push(K);var q=C.Factions["Slum Snakes"];!q.isBanned&&!q.isMember&&!q.alreadyInvited&&this.strength>=30&&this.defense>=30&&this.dexterity>=30&&this.agility>=30&&this.karma<=-9&&this.money.gte(1e6)&&e.push(q);var $=C.Factions.Netburners,Y=0,z=0,V=0;for(let e=0;e=80&&Y>=8&&z>=4&&V>=100&&e.push($);var J=C.Factions["Tian Di Hui"];J.isBanned||J.isMember||J.alreadyInvited||!this.money.gte(1e6)||!(this.hacking_skill>=50)||this.city!=P.Locations.Chongqing&&this.city!=P.Locations.NewTokyo&&this.city!=P.Locations.Ishima||e.push(J);var X=C.Factions.CyberSec,Q=x.AllServers[I.SpecialServerIps[I.SpecialServerNames.CyberSecServer]];return null==Q?console.log("ERROR: Could not find CyberSec Server"):!X.isBanned&&!X.isMember&&Q.manuallyHacked&&!X.alreadyInvited&&this.hacking_skill>=50&&e.push(X),e},$.prototype.inGang=function(){return null!=this.gang&&void 0!=this.gang&&this.gang instanceof T.b},$.prototype.startGang=function(e,t){this.gang=new T.b(e,t)},$.prototype.hasCorporation=function(){return null!=this.corporation&&this.corporation instanceof f.c},$.prototype.inBladeburner=function(){return null!=this.bladeburner&&this.bladeburner instanceof l.a},$.prototype.setBitNodeNumber=function(e){this.bitNodeN=e},$.prototype.queueAugmentation=function(e){for(const t in this.queuedAugmentations)if(this.queuedAugmentations[t].name==e)return void console.log("tried to queue "+e+" twice, this may be a bug");for(const t in this.augmentations)if(this.augmentations[t].name==e)return void console.log("tried to queue "+e+" but we already have that aug");this.firstAugPurchased=!0,this.queuedAugmentations.push(new i.PlayerOwnedAugmentation(e))},$.prototype.gainCodingContractReward=function(e,t=1){if(null==e||null==e.type||null==e)return"No reward for this contract";switch(e.type){case c.CodingContractRewardType.FactionReputation:if(null==e.name||!(C.Factions[e.name]instanceof k.Faction))return e.type=c.CodingContractRewardType.FactionReputationAll,this.gainCodingContractReward(e);var n=_.CONSTANTS.CodingContractBaseFactionRepGain*t;return C.Factions[e.name].playerReputation+=n,`Gained ${n} faction reputation for ${e.name}`;case c.CodingContractRewardType.FactionReputationAll:const i=_.CONSTANTS.CodingContractBaseFactionRepGain*t,o=["Bladeburners"];var a=this.factions.slice();if(0==(a=a.filter(e=>!o.includes(e))).length)return e.type=c.CodingContractRewardType.Money,this.gainCodingContractReward(e,t);const l=Math.floor(i/a.length);for(const e of a)C.Factions[e]instanceof k.Faction&&(C.Factions[e].playerReputation+=l);return`Gained ${l} reputation for each of the following factions: ${a.toString()}`;case c.CodingContractRewardType.CompanyReputation:if(null==e.name||!(p.Companies[e.name]instanceof u.Company))return e.type=c.CodingContractRewardType.FactionReputationAll,this.gainCodingContractReward(e);n=_.CONSTANTS.CodingContractBaseCompanyRepGain*t;return p.Companies[e.name].playerReputation+=n,`Gained ${n} company reputation for ${e.name}`;case c.CodingContractRewardType.Money:default:var r=_.CONSTANTS.CodingContractBaseMoneyGain*t*s.BitNodeMultipliers.CodingContractMoney;return this.gainMoney(r),this.recordMoneySource(r,"codingcontract"),`Gained ${W.numeralWrapper.format(r,"$0.000a")}`}},$.prototype.toJSON=function(){return Object(G.Generic_toJSON)("PlayerObject",this)},$.fromJSON=function(e){return Object(G.Generic_fromJSON)($,e.data)},G.Reviver.constructors.PlayerObject=$;let z=new $},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CONSTANTS={Version:"0.46.0",MaxSkillLevel:975,MilliPerCycle:200,CorpFactionRepRequirement:2e5,BaseCostFor1GBOfRamHome:32e3,BaseCostFor1GBOfRamServer:55e3,TravelCost:2e5,BaseFavorToDonate:150,DonateMoneyToRepDivisor:1e6,FactionReputationToFavorBase:500,FactionReputationToFavorMult:1.02,CompanyReputationToFavorBase:500,CompanyReputationToFavorMult:1.02,NeuroFluxGovernorLevelMult:1.14,ScriptBaseRamCost:1.6,ScriptDomRamCost:25,ScriptWhileRamCost:0,ScriptForRamCost:0,ScriptIfRamCost:0,ScriptHackRamCost:.1,ScriptHackAnalyzeRamCost:1,ScriptGrowRamCost:.15,ScriptGrowthAnalyzeRamCost:1,ScriptWeakenRamCost:.15,ScriptScanRamCost:.2,ScriptPortProgramRamCost:.05,ScriptRunRamCost:1,ScriptExecRamCost:1.3,ScriptSpawnRamCost:2,ScriptScpRamCost:.6,ScriptKillRamCost:.5,ScriptHasRootAccessRamCost:.05,ScriptGetHostnameRamCost:.05,ScriptGetHackingLevelRamCost:.05,ScriptGetMultipliersRamCost:4,ScriptGetServerRamCost:.1,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,ScriptGetHackTimeRamCost:.05,ScriptGetFavorToDonate:.1,ScriptCodingContractBaseRamCost:10,ScriptSleeveBaseRamCost:4,ScriptSingularityFn1RamCost:1,ScriptSingularityFn2RamCost:2,ScriptSingularityFn3RamCost:3,ScriptSingularityFnRamMult:2,ScriptGangApiBaseRamCost:4,ScriptBladeburnerApiBaseRamCost:4,NumNetscriptPorts:20,HomeComputerMaxRam:1073741824,ServerBaseGrowthRate:1.03,ServerMaxGrowthRate:1.0035,ServerFortifyAmount:.002,ServerWeakenAmount:.05,PurchasedServerLimit:25,PurchasedServerMaxRam:1048576,AugmentationCostMultiplier:5,AugmentationRepMultiplier:2.5,MultipleAugMultiplier:1.9,TorRouterCost:2e5,InfiltrationBribeBaseAmount:1e5,InfiltrationMoneyValue:5e3,InfiltrationRepValue:1.4,InfiltrationExpPow:.8,WSEAccountCost:2e8,TIXAPICost:5e9,MarketData4SCost:1e9,MarketDataTixApi4SCost:25e9,StockMarketCommission:1e5,HospitalCostPerHp:1e5,IntelligenceCrimeWeight:.05,IntelligenceInfiltrationWeight:.1,IntelligenceCrimeBaseExpGain:.001,IntelligenceProgramBaseExpGain:500,IntelligenceTerminalHackBaseExpGain:200,IntelligenceSingFnBaseExpGain:.002,IntelligenceClassBaseExpGain:1e-6,IntelligenceHackingMissionBaseExpGain:.03,HackingMissionRepToDiffConversion:1e4,HackingMissionRepToRewardConversion:7,HackingMissionSpamTimeIncrease:25e3,HackingMissionTransferAttackIncrease:1.05,HackingMissionMiscDefenseIncrease:1.05,HackingMissionDifficultyToHacking:135,HackingMissionHowToPlay:"Hacking missions are a minigame that, if won, will reward you with faction reputation.

In this game you control a set of Nodes and use them to try and defeat an enemy. Your Nodes are colored blue, while the enemy's are red. There are also other nodes on the map colored gray that initially belong to neither you nor the enemy. The goal of the game is to capture all of the enemy's Database nodes within the time limit. If you fail to do this, you will lose.

Each Node has three stats: Attack, Defense, and HP. There are five different actions that a Node can take:

Attack - Targets an enemy Node and lowers its HP. The effectiveness is determined by the owner's Attack, the Player's hacking level, and the enemy's defense.

Scan - Targets an enemy Node and lowers its Defense. The effectiveness is determined by the owner's Attack, the Player's hacking level, and the enemy's defense.

Weaken - Targets an enemy Node and lowers its Attack. The effectiveness is determined by the owner's Attack, the Player's hacking level, and the enemy's defense.

Fortify - Raises the Node's Defense. The effectiveness is determined by your hacking level.

Overflow - Raises the Node's Attack but lowers its Defense. The effectiveness is determined by your hacking level.

Note that when determining the effectiveness of the above actions, the TOTAL Attack or Defense of the team is used, not just the Attack/Defense of the individual Node that is performing the action.

To capture a Node, you must lower its HP down to 0.

There are six different types of Nodes:

CPU Core - These are your main Nodes that are used to perform actions. Capable of performing every action

Firewall - Nodes with high defense. These Nodes can 'Fortify'

Database - A special type of Node. The player's objective is to conquer all of the enemy's Database Nodes within the time limit. These Nodes cannot perform any actions

Spam - Conquering one of these Nodes will slow the enemy's trace, giving the player additional time to complete the mission. These Nodes cannot perform any actions

Transfer - Conquering one of these nodes will increase the Attack of all of your CPU Cores by a small fixed percentage. These Nodes are capable of performing every action except the 'Attack' action

Shield - Nodes with high defense. These Nodes can 'Fortify'

To assign an action to a Node, you must first select one of your Nodes. This can be done by simply clicking on it. Double-clicking a node will select all of your Nodes of the same type (e.g. select all CPU Core Nodes or all Transfer Nodes). Note that only Nodes that can perform actions (CPU Core, Transfer, Shield, Firewall) can be selected. Selected Nodes will be denoted with a white highlight. After selecting a Node or multiple Nodes, select its action using the Action Buttons near the top of the screen. Every action also has a corresponding keyboard shortcut.

For certain actions such as attacking, scanning, and weakening, the Node performing the action must have a target. To target another node, simply click-and-drag from the 'source' Node to a target. A Node can only have one target, and you can target any Node that is adjacent to one of your Nodes (immediately above, below, or to the side. NOT diagonal). Furthermore, only CPU Cores and Transfer Nodes can target, since they are the only ones that can perform the related actions. To remove a target, you can simply click on the line that represents the connection between one of your Nodes and its target. Alternatively, you can select the 'source' Node and click the 'Drop Connection' button, or press 'd'.

Other Notes:

-Whenever a miscellenaous Node (not owned by the player or enemy) is conquered, the defense of all remaining miscellaneous Nodes that are not actively being targeted will increase by a fixed percentage.

-Whenever a Node is conquered, its stats are significantly reduced

-Miscellaneous Nodes slowly raise their defense over time

-Nodes slowly regenerate health over time.",MillisecondsPer20Hours:72e6,GameCyclesPer20Hours:36e4,MillisecondsPer10Hours:36e6,GameCyclesPer10Hours:18e4,MillisecondsPer8Hours:288e5,GameCyclesPer8Hours:144e3,MillisecondsPer4Hours:144e5,GameCyclesPer4Hours:72e3,MillisecondsPer2Hours:72e5,GameCyclesPer2Hours:36e3,MillisecondsPerHour:36e5,GameCyclesPerHour:18e3,MillisecondsPerHalfHour:18e5,GameCyclesPerHalfHour:9e3,MillisecondsPerQuarterHour:9e5,GameCyclesPerQuarterHour:4500,MillisecondsPerFiveMinutes:3e5,GameCyclesPerFiveMinutes:1500,FactionWorkHacking:"Faction Hacking Work",FactionWorkField:"Faction Field Work",FactionWorkSecurity:"Faction Security Work",WorkTypeCompany:"Working for Company",WorkTypeCompanyPartTime:"Working for Company part-time",WorkTypeFaction:"Working for Faction",WorkTypeCreateProgram:"Working on Create a Program",WorkTypeStudyClass:"Studying or Taking a class at university",WorkTypeCrime:"Committing a crime",ClassStudyComputerScience:"studying Computer Science",ClassDataStructures:"taking a Data Structures course",ClassNetworks:"taking a Networks course",ClassAlgorithms:"taking an Algorithms course",ClassManagement:"taking a Management course",ClassLeadership:"taking a Leadership course",ClassGymStrength:"training your strength at a gym",ClassGymDefense:"training your defense at a gym",ClassGymDexterity:"training your dexterity at a gym",ClassGymAgility:"training your agility at a gym",ClassDataStructuresBaseCost:40,ClassNetworksBaseCost:80,ClassAlgorithmsBaseCost:320,ClassManagementBaseCost:160,ClassLeadershipBaseCost:320,ClassGymBaseCost:120,CrimeShoplift:"shoplift",CrimeRobStore:"rob a store",CrimeMug:"mug someone",CrimeLarceny:"commit larceny",CrimeDrugs:"deal drugs",CrimeBondForgery:"forge corporate bonds",CrimeTraffickArms:"traffick illegal arms",CrimeHomicide:"commit homicide",CrimeGrandTheftAuto:"commit grand theft auto",CrimeKidnap:"kidnap someone for ransom",CrimeAssassination:"assassinate a high-profile target",CrimeHeist:"pull off the ultimate heist",CodingContractBaseFactionRepGain:2500,CodingContractBaseCompanyRepGain:4e3,CodingContractBaseMoneyGain:75e6,TotalNumBitNodes:24,LatestUpdate:"\n v0.46.0\n * Added BitNode-9: Hacktocracy\n * Changed BitNode-11's multipliers to make it slightly harder overall\n * Source-File 11 is now slightly stronger\n * Added several functions to Netscript Sleeve API for buying Sleeve augmentations (by hydroflame)\n * Added a new stat for Duplicate Sleeves: Memory\n * Increase baseline experience earned from Infiltration, but it now gives diminishing returns (on exp) as you get to higher difficulties/levels\n * In Bladeburner, stamina gained from Hyperbolic Regeneration Chamber is now a percentage of your max stamina\n\n * Corporation Changes:\n ** 'Demand' value of products decreases more slowly\n ** Bug Fix: Fixed a Corporation issue that broke the Market-TA2 Research\n ** Bug Fix: Issuing New Shares now works properly\n\n * Bug Fix: Money Statistics tracker was incorrectly recording profits when selling stocks manually\n * Bug Fix: Fixed an issue with the job requirement tooltip for security jobs\n "}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=n(110);n(473),n(472),n(471),n(470),n(469),n(468),n(467),n(466),n(465),n(464),n(463),n(462),n(461),n(460);t.numeralWrapper=new class{constructor(){this.defaultLocale="en",this.defaultLocale="en"}updateLocale(e){return null!=a.locale(e)||(console.warn(`Invalid locale for numeral: ${e}`),a.locale(this.defaultLocale),!1)}format(e,t){return Math.abs(e)<1e-6&&(e=0),a(e).format(t)}formatBigNumber(e){return this.format(e,"0.000a")}formatMoney(e){return this.format(e,"$0.000a")}formatPercentage(e,t=2){const n="0."+"0".repeat(t)+"%";return this.format(e,n)}}},function(e,t,n){"use strict";function a(e,t={}){const n=document.createElement(e);return void 0!==t.id&&(n.id=t.id),void 0!==t.class&&(n.className=t.class),void 0!==t.innerHTML&&(n.innerHTML=t.innerHTML),void 0!==t.innerText&&(n.innerText=t.innerText),void 0!==t.tabIndex&&(n.tabIndex=t.tabIndex),function(e,t){void 0!==t.text&&(e.text=t.text),void 0!==t.href&&(e.href=t.href),void 0!==t.target&&(e.target=t.target)}(n,t),function(e,t){void 0!==t.name&&(e.name=t.name),void 0!==t.value&&(e.value=t.value),void 0!==t.type&&(e.type=t.type),void 0!==t.checked&&(e.checked=t.checked),void 0!==t.pattern&&(e.pattern=t.pattern),void 0!==t.maxLength&&(e.maxLength=t.maxLength),void 0!==t.placeholder&&(e.placeholder=t.placeholder),void 0!==t.max&&(e.max=t.max),void 0!==t.min&&(e.min=t.min),void 0!==t.step&&(e.step=t.step)}(n,t),function(e,t){void 0!==t.for&&(e.htmlFor=t.for)}(n,t),function(e,t){void 0!==t.clickListener&&e.addEventListener("click",t.clickListener),void 0!==t.inputListener&&e.addEventListener("input",t.inputListener),void 0!==t.changeListener&&e.addEventListener("change",t.changeListener),void 0!==t.onkeyup&&e.addEventListener("keyup",t.onkeyup),void 0!==t.onkeydown&&e.addEventListener("keydown",t.onkeydown),void 0!==t.onfocus&&e.addEventListener("focus",t.onfocus)}(n,t),function(e,t){void 0!==t.display&&(e.style.display=t.display),void 0!==t.visibility&&(e.style.visibility=t.visibility),void 0!==t.margin&&(e.style.margin=t.margin),void 0!==t.marginLeft&&(e.style.marginLeft=t.marginLeft),void 0!==t.marginTop&&(e.style.marginTop=t.marginTop),void 0!==t.padding&&(e.style.padding=t.padding),void 0!==t.color&&(e.style.color=t.color),void 0!==t.border&&(e.style.border=t.border),void 0!==t.float&&(e.style.cssFloat=t.float),void 0!==t.fontSize&&(e.style.fontSize=t.fontSize),void 0!==t.whiteSpace&&(e.style.whiteSpace=t.whiteSpace),void 0!==t.width&&(e.style.width=t.width),void 0!==t.backgroundColor&&(e.style.backgroundColor=t.backgroundColor),void 0!==t.position&&(e.style.position=t.position),void 0!==t.overflow&&(e.style.overflow=t.overflow)}(n,t),function(e,t){void 0!==t.tooltip&&""!==t.tooltip?(e.className+=" tooltip",e.appendChild(a("span",{class:"tooltiptext",innerHTML:t.tooltip}))):void 0!==t.tooltipleft?(e.className+=" tooltip",e.appendChild(a("span",{class:"tooltiptextleft",innerHTML:t.tooltipleft}))):void 0!==t.tooltipsmall?(e.className+=" tooltip",e.appendChild(a("span",{class:"tooltiptext smallfont",innerHTML:t.tooltipsmall}))):void 0!==t.tooltiplow&&(e.className+="tooltip",e.appendChild(a("span",{class:"tooltiptextlow",innerHTML:t.tooltiplow})))}(n,t),n}Object.defineProperty(t,"__esModule",{value:!0}),t.createElement=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AugmentationNames={Targeting1:"Augmented Targeting I",Targeting2:"Augmented Targeting II",Targeting3:"Augmented Targeting III",SyntheticHeart:"Synthetic Heart",SynfibrilMuscle:"Synfibril Muscle",CombatRib1:"Combat Rib I",CombatRib2:"Combat Rib II",CombatRib3:"Combat Rib III",NanofiberWeave:"Nanofiber Weave",SubdermalArmor:"NEMEAN Subdermal Weave",WiredReflexes:"Wired Reflexes",GrapheneBoneLacings:"Graphene Bone Lacings",BionicSpine:"Bionic Spine",GrapheneBionicSpine:"Graphene Bionic Spine Upgrade",BionicLegs:"Bionic Legs",GrapheneBionicLegs:"Graphene Bionic Legs Upgrade",SpeechProcessor:"Speech Processor Implant",TITN41Injection:"TITN-41 Gene-Modification Injection",EnhancedSocialInteractionImplant:"Enhanced Social Interaction Implant",BitWire:"BitWire",ArtificialBioNeuralNetwork:"Artificial Bio-neural Network Implant",ArtificialSynapticPotentiation:"Artificial Synaptic Potentiation",EnhancedMyelinSheathing:"Enhanced Myelin Sheathing",SynapticEnhancement:"Synaptic Enhancement Implant",NeuralRetentionEnhancement:"Neural-Retention Enhancement",DataJack:"DataJack",ENM:"Embedded Netburner Module",ENMCore:"Embedded Netburner Module Core Implant",ENMCoreV2:"Embedded Netburner Module Core V2 Upgrade",ENMCoreV3:"Embedded Netburner Module Core V3 Upgrade",ENMAnalyzeEngine:"Embedded Netburner Module Analyze Engine",ENMDMA:"Embedded Netburner Module Direct Memory Access Upgrade",Neuralstimulator:"Neuralstimulator",NeuralAccelerator:"Neural Accelerator",CranialSignalProcessorsG1:"Cranial Signal Processors - Gen I",CranialSignalProcessorsG2:"Cranial Signal Processors - Gen II",CranialSignalProcessorsG3:"Cranial Signal Processors - Gen III",CranialSignalProcessorsG4:"Cranial Signal Processors - Gen IV",CranialSignalProcessorsG5:"Cranial Signal Processors - Gen V",NeuronalDensification:"Neuronal Densification",NuoptimalInjectorImplant:"Nuoptimal Nootropic Injector Implant",SpeechEnhancement:"Speech Enhancement",FocusWire:"FocusWire",PCDNI:"PC Direct-Neural Interface",PCDNIOptimizer:"PC Direct-Neural Interface Optimization Submodule",PCDNINeuralNetwork:"PC Direct-Neural Interface NeuroNet Injector",ADRPheromone1:"ADR-V1 Pheromone Gene",ADRPheromone2:"ADR-V2 Pheromone Gene",HacknetNodeCPUUpload:"Hacknet Node CPU Architecture Neural-Upload",HacknetNodeCacheUpload:"Hacknet Node Cache Architecture Neural-Upload",HacknetNodeNICUpload:"Hacknet Node NIC Architecture Neural-Upload",HacknetNodeKernelDNI:"Hacknet Node Kernel Direct-Neural Interface",HacknetNodeCoreDNI:"Hacknet Node Core Direct-Neural Interface",NeuroFluxGovernor:"NeuroFlux Governor",Neurotrainer1:"Neurotrainer I",Neurotrainer2:"Neurotrainer II",Neurotrainer3:"Neurotrainer III",Hypersight:"HyperSight Corneal Implant",LuminCloaking1:"LuminCloaking-V1 Skin Implant",LuminCloaking2:"LuminCloaking-V2 Skin Implant",HemoRecirculator:"HemoRecirculator",SmartSonar:"SmartSonar Implant",PowerRecirculator:"Power Recirculation Core",QLink:"QLink",TheRedPill:"The Red Pill",SPTN97:"SPTN-97 Gene Modification",HiveMind:"ECorp HVMind Implant",CordiARCReactor:"CordiARC Fusion Reactor",SmartJaw:"SmartJaw",Neotra:"Neotra",Xanipher:"Xanipher",nextSENS:"nextSENS Gene Modification",OmniTekInfoLoad:"OmniTek InfoLoad",PhotosyntheticCells:"Photosynthetic Cells",Neurolink:"BitRunners Neurolink",TheBlackHand:"The Black Hand",CRTX42AA:"CRTX42-AA Gene Modification",Neuregen:"Neuregen Gene Modification",CashRoot:"CashRoot Starter Kit",NutriGen:"NutriGen Implant",INFRARet:"INFRARET Enhancement",DermaForce:"DermaForce Particle Barrier",GrapheneBrachiBlades:"Graphene BranchiBlades Upgrade",GrapheneBionicArms:"Graphene Bionic Arms Upgrade",BrachiBlades:"BrachiBlades",BionicArms:"Bionic Arms",SNA:"Social Negotiation Assistant (S.N.A)",EsperEyewear:"EsperTech Bladeburner Eyewear",EMS4Recombination:"EMS-4 Recombination",OrionShoulder:"ORION-MKIV Shoulder",HyperionV1:"Hyperion Plasma Cannon V1",HyperionV2:"Hyperion Plasma Cannon V2",GolemSerum:"GOLEM Serum",VangelisVirus:"Vangelis Virus",VangelisVirus3:"Vangelis Virus 3.0",INTERLINKED:"I.N.T.E.R.L.I.N.K.E.D",BladeRunner:"Blade's Runners",BladeArmor:"BLADE-51b Tesla Armor",BladeArmorPowerCells:"BLADE-51b Tesla Armor: Power Cells Upgrade",BladeArmorEnergyShielding:"BLADE-51b Tesla Armor: Energy Shielding Upgrade",BladeArmorUnibeam:"BLADE-51b Tesla Armor: Unibeam Upgrade",BladeArmorOmnibeam:"BLADE-51b Tesla Armor: Omnibeam Upgrade",BladeArmorIPU:"BLADE-51b Tesla Armor: IPU Upgrade",BladesSimulacrum:"The Blade's Simulacrum"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Locations={Aevum:"Aevum",Chongqing:"Chongqing",Ishima:"Ishima",NewTokyo:"New Tokyo",Sector12:"Sector-12",Volhaven:"Volhaven",AevumAeroCorp:"AeroCorp",AevumBachmanAndAssociates:"Bachman & Associates",AevumClarkeIncorporated:"Clarke Incorporated",AevumCrushFitnessGym:"Crush Fitness Gym",AevumECorp:"ECorp",AevumFulcrumTechnologies:"Fulcrum Technologies",AevumGalacticCybersystems:"Galactic Cybersystems",AevumNetLinkTechnologies:"NetLink Technologies",AevumPolice:"Aevum Police Headquarters",AevumRhoConstruction:"Rho Construction",AevumSlums:"Aevum Slums",AevumSnapFitnessGym:"Snap Fitness Gym",AevumSummitUniversity:"Summit University",AevumTravelAgency:"Aevum Travel Agency",AevumWatchdogSecurity:"Watchdog Security",ChongqingKuaiGongInternational:"KuaiGong International",ChongqingSlums:"Chongqing Slums",ChongqingSolarisSpaceSystems:"Solaris Space Systems",ChongqingTravelAgency:"Chongqing Travel Agency",Sector12AlphaEnterprises:"Alpha Enterprises",Sector12BladeIndustries:"Blade Industries",Sector12CIA:"Central Intelligence Agency",Sector12CarmichaelSecurity:"Carmichael Security",Sector12CityHall:"Sector-12 City Hall",Sector12DeltaOne:"DeltaOne",Sector12FoodNStuff:"FoodNStuff",Sector12FourSigma:"Four Sigma",Sector12IcarusMicrosystems:"Icarus Microsystems",Sector12IronGym:"Iron Gym",Sector12JoesGuns:"Joe's Guns",Sector12MegaCorp:"MegaCorp",Sector12NSA:"National Security Agency",Sector12PowerhouseGym:"Powerhouse Gym",Sector12RothmanUniversity:"Rothman University",Sector12Slums:"Sector-12 Slums",Sector12TravelAgency:"Sector-12 Travel Agency",Sector12UniversalEnergy:"Universal Energy",NewTokyoDefComm:"DefComm",NewTokyoGlobalPharmaceuticals:"Global Pharmaceuticals",NewTokyoNoodleBar:"Noodle Bar",NewTokyoSlums:"New Tokyo Slums",NewTokyoTravelAgency:"New Tokyo Travel Agency",NewTokyoVitaLife:"VitaLife",IshimaNovaMedical:"Nova Medical",IshimaOmegaSoftware:"Omega Software",IshimaSlums:"Ishima Slums",IshimaStormTechnologies:"Storm Technologies",IshimaTravelAgency:"Ishima Travel Agency",VolhavenCompuTek:"CompuTek",VolhavenHeliosLabs:"Helios Labs",VolhavenLexoCorp:"LexoCorp",VolhavenMilleniumFitnessGym:"Millenium Fitness Gym",VolhavenNWO:"NWO",VolhavenOmniTekIncorporated:"OmniTek Incorporated",VolhavenOmniaCybersystems:"Omnia Cybersystems",VolhavenSlums:"Volhaven Slums",VolhavenSysCoreSecurities:"SysCore Securities",VolhavenTravelAgency:"Volhaven Travel Agency",VolhavenZBInstituteOfTechnology:"ZB Institute of Technology",Hospital:"Hospital",WorldStockExchange:"World Stock Exchange"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=n(46);function r(e){return e.every(a.isString)}t.replaceAt=function(e,t,n){return e.substr(0,t)+n+e.substr(t+n.length)},t.convertTimeMsToTimeElapsedString=function(e){const t=Math.floor(e/1e3),n=Math.floor(t/86400),a=t%86400,r=Math.floor(a/3600),i=a%3600,o=Math.floor(i/60);let s="";return n>0&&(s+=`${n} days `),r>0&&(s+=`${r} hours `),o>0&&(s+=`${o} minutes `),s+=`${i%60} seconds`},t.longestCommonStart=function(e){if(!r(e))return"";if(0===e.length)return"";const t=e.concat().sort(),n=t[0],a=t[t.length-1],i=n.length;let o=0;const s=(e,t)=>e.toUpperCase()===t.toUpperCase();for(;o=0;e--)if(1===n[e].nodeType)return!0;return!1},t.generateRandomString=function(e){let t="";const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let a=0;a{t.delay=null,n()},e),t.delayResolve=n})}function _(e,t,n=null){var a="";null!=n&&(a=" (Line "+function(e,t){var n=t.scriptRef.codeCode();try{return((n=n.substring(0,e.start)).match(/\n/g)||[]).length+1}catch(e){return-1}}(n,e)+")");return"|"+e.serverIp+"|"+e.name+"|"+t+a}function f(e,t,n,i,l=1){if(null!=(m=Object(s.a)(t,n,e)))return i.scriptRef.log(t+" is already running on "+e.hostname),Promise.resolve(!1);for(var c=0;cd?(i.scriptRef.log("Cannot run script "+t+"(t="+l+") on "+e.hostname+" because there is not enough available RAM!"),Promise.resolve(!1)):(null==i.disableLogs.ALL&&null==i.disableLogs.exec&&null==i.disableLogs.run&&null==i.disableLogs.spawn&&i.scriptRef.log("Running script: "+t+" on "+e.hostname+" with "+l+" threads and args: "+Object(u.arrayToString)(n)+". May take a few seconds to start up..."),(m=new o.RunningScript(p,n)).threads=l,Object(r.c)(m,e),e.runScript(m,a.a),Promise.resolve(!0))}return i.scriptRef.log("Could not find script "+t+" on "+e.hostname),Promise.resolve(!1)}function y(e){if(!Object(h.isString)(e))return!1;let t=e.split("|");if(4!=t.length)return!1;var n=t[1];return!!Object(p.isValidIPAddress)(n)}},function(e,t,n){"use strict";n.r(t),function(e){n.d(t,"dialogBoxCreate",function(){return i}),n.d(t,"dialogBoxOpened",function(){return r});let a=[];e(document).click(function(t){r&&a.length>=1&&(e(t.target).closest(a[0]).length||(a[0].remove(),a.splice(0,1),0==a.length?r=!1:a[0].style.visibility="visible"))}),e(document).on("click",".dialog-box-close-button",function(e){r&&a.length>=1&&(a[0].remove(),a.splice(0,1),0==a.length?r=!1:a[0].style.visibility="visible")});var r=!1;function i(e,t=!1){var n=document.createElement("div");n.setAttribute("class","dialog-box-container");var i=document.createElement("div");i.setAttribute("class","dialog-box-content");var o,s=document.createElement("span");s.setAttribute("class","dialog-box-close-button"),s.innerHTML="×",t?(o=document.createElement("pre")).innerHTML=e:(o=document.createElement("p")).innerHTML=e.replace(/(?:\r\n|\r|\n)/g,"
"),i.appendChild(s),i.appendChild(o),n.appendChild(i),document.body.appendChild(n),a.length>=1&&(n.style.visibility="hidden"),a.push(n),setTimeout(function(){r=!0},400)}}.call(this,n(81))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=n(86);function r(e,t={}){const n=`color: ${null!=t.color?t.color:"var(--my-font-color)"}; background-color:var(--my-background-color);${void 0===t.id?" white-space:pre-wrap;":""}`,r=`${e}`;a.getElementById("terminal-input").insertAdjacentHTML("beforebegin",r),function(){const e=a.getElementById("terminal-container");e.scrollTop=e.scrollHeight}()}t.post=function(e){r(e)},t.postError=function(e){r(`ERROR: ${e}`,{color:"#ff2929"})},t.hackProgressBarPost=function(e){r(e,{id:"hack-progress-bar"})},t.hackProgressPost=function(e){r(e,{id:"hack-progress"})}},function(e,t,n){"use strict";n.r(t),function(e){n.d(t,"Engine",function(){return ue});var a=n(7),r=n(107),i=n(88),o=n(13),s=n(77),l=n(5),c=n(80),u=n(37),p=n(185),h=n(142),m=n(106),d=(n(39),n(17)),g=n(28),_=n(2),f=n(167),y=n(14),b=n(56),v=n(35),E=n(129),k=n(6),C=n(33),O=n(42),T=n(113),S=n(67),M=n(73),P=n(53),A=n(40),w=n(0),x=n(120),R=(n(31),n(134)),N=n(79),I=n(97),L=n(61),D=n(20),B=(n(75),n(19)),W=n(98),j=n(51),F=n(41),U=n(29),H=n(72),G=n(94),K=n(146),q=n(166),$=n(101),Y=n(184),z=n(12),V=n(3),J=n(183),X=n(182),Q=n(32),Z=n(9),ee=n(115),te=(n(15),n(34)),ne=(n(23),n(4)),ae=n(45),re=n(165),ie=n(30),oe=n(1),se=n.n(oe),le=n(90),ce=n.n(le);n(330),n(278),n(276),n(274),n(272),n(270),n(268),n(266),n(264),n(262),n(260),n(258),n(256),n(254),n(252),n(250),n(248),n(246),n(244),n(242),n(240),n(238),n(236),n(234),n(232),n(230);e(document).keydown(function(e){if(!0!==B.Settings.DisableHotkeys){try{if(Object(L.b)().isFocused())return}catch(e){}if(!(w.a.isWorking||N.b||M.c||h.a))if(84==e.keyCode&&e.altKey)e.preventDefault(),ue.loadTerminalContent();else if(e.keyCode===ie.KEY.C&&e.altKey)e.preventDefault(),ue.loadCharacterContent();else if(e.keyCode===ie.KEY.E&&e.altKey)e.preventDefault(),ue.loadScriptEditorContent();else if(e.keyCode===ie.KEY.S&&e.altKey)e.preventDefault(),ue.loadActiveScriptsContent();else if(e.keyCode===ie.KEY.H&&e.altKey)e.preventDefault(),ue.loadHacknetNodesContent();else if(e.keyCode===ie.KEY.W&&e.altKey)e.preventDefault(),ue.loadWorldContent();else if(e.keyCode===ie.KEY.J&&e.altKey)e.preventDefault(),ue.loadJobContent();else if(e.keyCode===ie.KEY.R&&e.altKey)e.preventDefault(),ue.loadTravelContent();else if(e.keyCode===ie.KEY.P&&e.altKey)e.preventDefault(),ue.loadCreateProgramContent();else if(e.keyCode===ie.KEY.F&&e.altKey){if(z.routing.isOn(z.Page.Terminal)&&v.FconfSettings.ENABLE_BASH_HOTKEYS)return;e.preventDefault(),ue.loadFactionsContent()}else e.keyCode===ie.KEY.A&&e.altKey?(e.preventDefault(),ue.loadAugmentationsContent()):e.keyCode===ie.KEY.U&&e.altKey&&(e.preventDefault(),ue.loadTutorialContent());e.keyCode===ie.KEY.O&&e.altKey&&(e.preventDefault(),Object(ee.b)())}});const ue={version:"",Debug:!0,Clickables:{saveMainMenuButton:null,deleteMainMenuButton:null},Display:{progress:null,statusText:null,hacking_skill:null,terminalContent:null,characterContent:null,scriptEditorContent:null,activeScriptsContent:null,hacknetNodesContent:null,worldContent:null,createProgramContent:null,factionsContent:null,factionContent:null,factionAugmentationsContent:null,augmentationsContent:null,tutorialContent:null,infiltrationContent:null,stockMarketContent:null,locationContent:null,workInProgressContent:null,redPillContent:null,cinematicTextContent:null,missionContent:null,characterInfo:null},_lastUpdate:(new Date).getTime(),_idleSpeed:200,loadTerminalContent:function(){ue.hideAllContent(),ue.Display.terminalContent.style.display="block",z.routing.navigateTo(z.Page.Terminal),Q.MainMenuLinks.Terminal.classList.add("active")},loadCharacterContent:function(){ue.hideAllContent(),ue.Display.characterContent.style.display="block",ue.updateCharacterInfo(),z.routing.navigateTo(z.Page.CharacterInfo),Q.MainMenuLinks.Stats.classList.add("active")},loadScriptEditorContent:function(e="",t=""){ue.hideAllContent(),ue.Display.scriptEditorContent.style.display="block";try{Object(L.b)().openScript(e,t)}catch(e){Object(ae.exceptionAlert)(e)}Object(L.e)(),z.routing.navigateTo(z.Page.ScriptEditor),Q.MainMenuLinks.ScriptEditor.classList.add("active")},loadActiveScriptsContent:function(){ue.hideAllContent(),ue.Display.activeScriptsContent.style.display="block",Object(i.c)(),z.routing.navigateTo(z.Page.ActiveScripts),Q.MainMenuLinks.ActiveScripts.classList.add("active")},loadHacknetNodesContent:function(){ue.hideAllContent(),ue.Display.hacknetNodesContent.style.display="block",z.routing.navigateTo(z.Page.HacknetNodes),Object(C.n)(),Q.MainMenuLinks.HacknetNodes.classList.add("active")},loadWorldContent:function(){ue.hideAllContent(),ue.Display.worldContent.style.display="block",ue.displayWorldInfo(),z.routing.navigateTo(z.Page.World),Q.MainMenuLinks.City.classList.add("active")},loadCreateProgramContent:function(){ue.hideAllContent(),ue.Display.createProgramContent.style.display="block",Object(R.a)(),z.routing.navigateTo(z.Page.CreateProgram),Q.MainMenuLinks.CreateProgram.classList.add("active")},loadFactionsContent:function(){ue.hideAllContent(),ue.Display.factionsContent.style.display="block",ue.displayFactionsInfo(),z.routing.navigateTo(z.Page.Factions),Q.MainMenuLinks.Factions.classList.add("active")},loadFactionContent:function(){ue.hideAllContent(),ue.Display.factionContent.style.display="block",z.routing.navigateTo(z.Page.Faction)},loadAugmentationsContent:function(){ue.hideAllContent(),ue.Display.augmentationsContent.style.display="block",Object(s.c)(ue.Display.augmentationsContent),z.routing.navigateTo(z.Page.Augmentations),Q.MainMenuLinks.Augmentations.classList.add("active")},loadTutorialContent:function(){ue.hideAllContent(),ue.Display.tutorialContent.style.display="block",z.routing.navigateTo(z.Page.Tutorial),Q.MainMenuLinks.Tutorial.classList.add("active")},loadDevMenuContent:function(){ue.hideAllContent(),Object(f.b)(),z.routing.navigateTo(z.Page.DevMenu),Q.MainMenuLinks.DevMenu.classList.add("active")},loadLocationContent:function(){ue.hideAllContent(),ue.Display.locationContent.style.display="block";try{Object(E.a)()}catch(e){Object(ae.exceptionAlert)(e),console.error(e)}z.routing.navigateTo(z.Page.Location)},loadTravelContent:function(){switch(w.a.city){case k.Locations.Aevum:w.a.location=k.Locations.AevumTravelAgency;break;case k.Locations.Chongqing:w.a.location=k.Locations.ChongqingTravelAgency;break;case k.Locations.Sector12:w.a.location=k.Locations.Sector12TravelAgency;break;case k.Locations.NewTokyo:w.a.location=k.Locations.NewTokyoTravelAgency;break;case k.Locations.Ishima:w.a.location=k.Locations.IshimaTravelAgency;break;case k.Locations.Volhaven:w.a.location=k.Locations.VolhavenTravelAgency;break;default:Object(Z.dialogBoxCreate)("ERROR: Invalid city. This is a bug please contact game dev")}ue.loadLocationContent()},loadJobContent:function(){""!=w.a.companyName?(w.a.location=w.a.companyName,ue.loadLocationContent()):Object(Z.dialogBoxCreate)("You do not currently have a job! You can visit various companies in the city and try to find a job.")},loadWorkInProgressContent:function(){ue.hideAllContent(),document.getElementById("mainmenu-container").style.visibility="hidden",ue.Display.workInProgressContent.style.display="block",z.routing.navigateTo(z.Page.WorkInProgress)},loadRedPillContent:function(){ue.hideAllContent(),document.getElementById("mainmenu-container").style.visibility="hidden",ue.Display.redPillContent.style.display="block",z.routing.navigateTo(z.Page.RedPill)},loadCinematicTextContent:function(){ue.hideAllContent(),document.getElementById("mainmenu-container").style.visibility="hidden",ue.Display.cinematicTextContent.style.display="block",z.routing.navigateTo(z.Page.CinematicText)},loadInfiltrationContent:function(){ue.hideAllContent(),ue.Display.infiltrationContent.style.display="block",z.routing.navigateTo(z.Page.Infiltration)},loadStockMarketContent:function(){ue.hideAllContent(),ue.Display.stockMarketContent.style.display="block",z.routing.navigateTo(z.Page.StockMarket),Object(U.g)()},loadGangContent:function(){ue.hideAllContent(),document.getElementById("gang-container")||w.a.inGang()?(w.a.gang.displayGangContent(w.a),z.routing.navigateTo(z.Page.Gang)):(ue.loadTerminalContent(),z.routing.navigateTo(z.Page.Terminal))},loadMissionContent:function(){ue.hideAllContent(),document.getElementById("mainmenu-container").style.visibility="hidden",document.getElementById("character-overview-wrapper").style.visibility="hidden",ue.Display.missionContent.style.display="block",z.routing.navigateTo(z.Page.Mission)},loadCorporationContent:function(){w.a.corporation instanceof g.c&&(ue.hideAllContent(),document.getElementById("character-overview-wrapper").style.visibility="hidden",z.routing.navigateTo(z.Page.Corporation),w.a.corporation.createUI())},loadBladeburnerContent:function(){if(w.a.bladeburner instanceof u.a)try{ue.hideAllContent(),z.routing.navigateTo(z.Page.Bladeburner),w.a.bladeburner.createContent()}catch(e){Object(ae.exceptionAlert)(e)}},loadSleevesContent:function(){try{ue.hideAllContent(),z.routing.navigateTo(z.Page.Sleeves),Object(K.createSleevesPage)(w.a)}catch(e){Object(ae.exceptionAlert)(e)}},loadResleevingContent:function(){try{ue.hideAllContent(),z.routing.navigateTo(z.Page.Resleeves),Object(q.createResleevesPage)(w.a)}catch(e){Object(ae.exceptionAlert)(e)}},hideAllContent:function(){ue.Display.terminalContent.style.display="none",ue.Display.characterContent.style.display="none",ue.Display.scriptEditorContent.style.display="none",ue.Display.activeScriptsContent.style.display="none",Object(C.a)(),ue.Display.worldContent.style.display="none",ue.Display.createProgramContent.style.display="none",ue.Display.factionsContent.style.display="none",ue.Display.factionContent.style.display="none",ue.Display.factionAugmentationsContent.style.display="none",ue.Display.augmentationsContent.style.display="none",ue.Display.tutorialContent.style.display="none",ue.Display.locationContent.style.display="none",ue.Display.workInProgressContent.style.display="none",ue.Display.redPillContent.style.display="none",ue.Display.cinematicTextContent.style.display="none",ue.Display.infiltrationContent.style.display="none",ue.Display.stockMarketContent.style.display="none",ue.Display.missionContent.style.display="none",document.getElementById("gang-container")&&(document.getElementById("gang-container").style.display="none"),w.a.inGang()&&w.a.gang.clearUI(),w.a.corporation instanceof g.c&&w.a.corporation.clearUI(),w.a.bladeburner instanceof u.a&&w.a.bladeburner.clearContent(),Object(q.clearResleevesPage)(),Object(K.clearSleevesPage)(),ue.aevumLocationsList.style.display="none",ue.chongqingLocationsList.style.display="none",ue.sector12LocationsList.style.display="none",ue.newTokyoLocationsList.style.display="none",ue.ishimaLocationsList.style.display="none",ue.volhavenLocationsList.style.display="none",Q.MainMenuLinks.Terminal.classList.remove("active"),Q.MainMenuLinks.ScriptEditor.classList.remove("active"),Q.MainMenuLinks.ActiveScripts.classList.remove("active"),Q.MainMenuLinks.CreateProgram.classList.remove("active"),Q.MainMenuLinks.Stats.classList.remove("active"),Q.MainMenuLinks.Factions.classList.remove("active"),Q.MainMenuLinks.Augmentations.classList.remove("active"),Q.MainMenuLinks.HacknetNodes.classList.remove("active"),Q.MainMenuLinks.Sleeves.classList.remove("active"),Q.MainMenuLinks.City.classList.remove("active"),Q.MainMenuLinks.Travel.classList.remove("active"),Q.MainMenuLinks.Job.classList.remove("active"),Q.MainMenuLinks.StockMarket.classList.remove("active"),Q.MainMenuLinks.Bladeburner.classList.remove("active"),Q.MainMenuLinks.Corporation.classList.remove("active"),Q.MainMenuLinks.Gang.classList.remove("active"),Q.MainMenuLinks.Tutorial.classList.remove("active"),Q.MainMenuLinks.Options.classList.remove("active"),Q.MainMenuLinks.DevMenu.classList.remove("active"),Object(f.a)()},displayCharacterOverviewInfo:function(){ce.a.render(se.a.createElement(p.a,null),document.getElementById("character-overview-text"));const e=document.getElementById("character-overview-save-button");B.Settings.AutosaveInterval?e.classList.remove("flashing-button"):e.classList.add("flashing-button")},updateCharacterInfo:function(){Object(Y.displayCharacterInfo)(ue.Display.characterInfo,w.a)},aevumLocationsList:null,chongqingLocationsList:null,sector12LocationsList:null,newTokyoLocationsList:null,ishimaLocationsList:null,volhavenLocationsList:null,displayWorldInfo:function(){ue.aevumLocationsList.style.display="none",ue.chongqingLocationsList.style.display="none",ue.sector12LocationsList.style.display="none",ue.newTokyoLocationsList.style.display="none",ue.ishimaLocationsList.style.display="none",ue.volhavenLocationsList.style.display="none",document.getElementById("world-city-name").innerHTML=w.a.city;document.getElementById("world-city-desc");switch(w.a.city){case k.Locations.Aevum:ue.aevumLocationsList.style.display="inline";break;case k.Locations.Chongqing:ue.chongqingLocationsList.style.display="inline";break;case k.Locations.Sector12:ue.sector12LocationsList.style.display="inline",3!==w.a.bitNodeN&&!P.e||8===w.a.bitNodeN?document.getElementById("sector12-cityhall-li").style.display="none":document.getElementById("sector12-cityhall-li").style.display="block";break;case k.Locations.NewTokyo:ue.newTokyoLocationsList.style.display="inline";break;case k.Locations.Ishima:ue.ishimaLocationsList.style.display="inline";break;case k.Locations.Volhaven:ue.volhavenLocationsList.style.display="inline";break;default:console.log("Invalid city value in Player object!")}var e,t=document.getElementById("generic-locations-list");(t.style.display="inline",Object(te.removeChildrenFromElement)(t),(e=Object(ne.createElement)("li")).appendChild(Object(ne.createElement)("a",{innerText:"World Stock Exchange",class:"a-link-button",clickListener:()=>(w.a.location=k.Locations.WorldStockExchange,ue.loadStockMarketContent(),!1)})),t.appendChild(e),w.a.corporation instanceof g.c&&null==document.getElementById("location-corporation-button"))&&((e=Object(ne.createElement)("li")).appendChild(Object(ne.createElement)("a",{innerText:w.a.corporation.name,id:"location-corporation-button",class:"a-link-button",clickListener:()=>(ue.loadCorporationContent(),!1)})),t.appendChild(e));w.a.bladeburner instanceof u.a&&((e=Object(ne.createElement)("li")).appendChild(Object(ne.createElement)("a",{innerText:"Bladeburner Headquarters",class:"a-link-button",clickListener:()=>(ue.loadBladeburnerContent(),!1)})),t.appendChild(e))},displayFactionsInfo:function(){Object(te.removeChildrenFromElement)(ue.Display.factionsContent),ue.Display.factionsContent.appendChild(Object(ne.createElement)("h1",{innerText:"Factions"})),ue.Display.factionsContent.appendChild(Object(ne.createElement)("p",{innerText:"Lists all factions you have joined"}));var e=Object(ne.createElement)("ul");ue.Display.factionsContent.appendChild(Object(ne.createElement)("br"));for(var t=0;t(ue.loadFactionContent(),Object(b.a)(n),!1)})),e.appendChild(Object(ne.createElement)("br"))}();ue.Display.factionsContent.appendChild(e),ue.Display.factionsContent.appendChild(Object(ne.createElement)("br")),ue.Display.factionsContent.appendChild(Object(ne.createElement)("h1",{innerText:"Outstanding Faction Invitations"})),ue.Display.factionsContent.appendChild(Object(ne.createElement)("p",{width:"70%",innerText:"Lists factions you have been invited to, as well as factions you have previously rejected. You can accept these faction invitations at any time."}));var n=Object(ne.createElement)("ul");for(t=0;t{if(!t.isTrusted)return!1;Object(b.c)(y.Factions[e]);for(var n=0;n0&&(ue._lastUpdate=e-n,w.a.lastUpdate=e-n,ue.updateGame(t)),window.requestAnimationFrame(ue.idleTimer)},updateGame:function(e=1){var t=e*ue._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+=t,w.a.playtimeSinceLastAug+=t,w.a.playtimeSinceLastBitnode+=t,!0===H.a.actionStarted&&(ue._totalActionTime=H.a.actionTime,ue._actionTimeLeft=H.a.actionTime,ue._actionInProgress=!0,ue._actionProgressBarCount=1,ue._actionProgressStr="[ ]",ue._actionTimeStr="Time left: ",H.a.actionStarted=!1),w.a.isWorking&&(w.a.workType==_.CONSTANTS.WorkTypeFaction?w.a.workForFaction(e):w.a.workType==_.CONSTANTS.WorkTypeCreateProgram?w.a.createProgramWork(e):w.a.workType==_.CONSTANTS.WorkTypeStudyClass?w.a.takeClass(e):w.a.workType==_.CONSTANTS.WorkTypeCrime?w.a.commitCrime(e):w.a.workType==_.CONSTANTS.WorkTypeCompanyPartTime?w.a.workPartTime(e):w.a.work(e)),w.a.hasWseAccount&&Object(U.m)(e),2==w.a.bitNodeN&&w.a.inGang()&&w.a.gang.process(e,w.a),M.c&&M.b&&M.b.process(e),w.a.corporation instanceof g.c&&w.a.corporation.storeCycles(e),w.a.bladeburner instanceof u.a&&w.a.bladeburner.storeCycles(e);for(let t=0;t0?(t.innerHTML=e,t.setAttribute("class","notification-on")):(t.innerHTML="",t.setAttribute("class","notification-off")),ue.Counters.createProgramNotifications=10}if(ue.Counters.checkFactionInvitations<=0){var n=w.a.checkForFactionInvitations();if(n.length>0){!1===w.a.firstFacInvRecvd&&(w.a.firstFacInvRecvd=!0,document.getElementById("factions-tab").style.display="list-item",document.getElementById("character-menu-header").click(),document.getElementById("character-menu-header").click());var a=n[Math.floor(Math.random()*n.length)];Object(b.b)(a)}ue.Counters.checkFactionInvitations=100}if(ue.Counters.passiveFactionGrowth<=0){var s=Math.floor(600-ue.Counters.passiveFactionGrowth);Object(b.d)(s),ue.Counters.passiveFactionGrowth=600}if(ue.Counters.messages<=0&&(Object(S.b)(),o.Augmentations[l.AugmentationNames.TheRedPill].owned?ue.Counters.messages=4500:ue.Counters.messages=150),ue.Counters.sCr<=0&&(w.a.hasWseAccount&&Object(U.q)(),ue.Counters.sCr=1500),ue.Counters.mechanicProcess<=0){if(w.a.corporation instanceof g.c&&w.a.corporation.process(),w.a.bladeburner instanceof u.a)try{w.a.bladeburner.process()}catch(e){Object(ae.exceptionAlert)("Exception caught in Bladeburner.process(): "+e)}ue.Counters.mechanicProcess=5}ue.Counters.contractGeneration<=0&&(Math.random()<=.25&&Object(m.b)(),ue.Counters.contractGeneration=3e3)},_totalActionTime:0,_actionTimeLeft:0,_actionTimeStr:"Time left: ",_actionProgressStr:"[ ]",_actionProgressBarCount:1,_actionInProgress:!1,updateHackProgress:function(e=1){var t=e*ue._idleSpeed;ue._actionTimeLeft-=t/1e3,ue._actionTimeLeft=Math.max(ue._actionTimeLeft,0);for(var n=Math.round(100*(1-ue._actionTimeLeft/ue._totalActionTime));2*ue._actionProgressBarCount<=n;)ue._actionProgressStr=Object(a.replaceAt)(ue._actionProgressStr,ue._actionProgressBarCount,"|"),ue._actionProgressBarCount+=1;ue._actionTimeStr="Time left: "+Math.max(0,Math.round(ue._actionTimeLeft)).toString()+"s",document.getElementById("hack-progress").innerHTML=ue._actionTimeStr,document.getElementById("hack-progress-bar").innerHTML=ue._actionProgressStr.replace(/ /g," "),n>=100&&(ue._actionInProgress=!1,H.a.finishAction())},closeMainMenuHeader:function(e){for(var t=0;t"+V.numeralWrapper.formatMoney(q)+" and your Hacknet Nodes generated "+e+"");var z=[t,n,r,o,h,m,x,R,N];w.a.firstFacInvRecvd?z.push(l):l.style.display="none",w.a.firstAugPurchased?z.push(p):p.style.display="none",""!==w.a.companyName?z.push(v):v.style.display="none",w.a.firstTimeTraveled?z.push(f):f.style.display="none",w.a.firstProgramAvailable?z.push(i):i.style.display="none",w.a.hasWseAccount?z.push(E):E.style.display="none",w.a.bladeburner instanceof u.a?z.push(k):k.style.display="none",w.a.corporation instanceof g.c?z.push(M):M.style.display="none",w.a.inGang()?z.push(A):A.style.display="none",ue.closeMainMenuHeader(z)}else{console.log("Initializing new game"),Object(c.initBitNodes)(),Object(c.initBitNodeMultipliers)(w.a),Object(W.c)(),Object(F.initSpecialServerIps)(),ue.setDisplayElements(),ue.start(),w.a.init(),Object(D.initForeignServers)(w.a.getHomeComputer()),Object(d.initCompanies)(),Object(y.initFactions)(),Object(s.d)(),Object(S.c)(),Object(U.i)(),Object(T.a)(),Object(P.g)(),document.getElementById("hacking-menu-header").classList.toggle("opened"),document.getElementById("character-menu-header").classList.toggle("opened"),document.getElementById("world-menu-header").classList.toggle("opened"),document.getElementById("help-menu-header").classList.toggle("opened"),l.style.display="none",p.style.display="none",v.style.display="none",E.style.display="none",f.style.display="none",i.style.display="none",k.style.display="none",M.style.display="none",A.style.display="none",N.style.display="none",ue.openMainMenuHeader([t,n,r,o,h,m,x,R]),Object(O.c)(),Object(re.removeLoadingScreen)()}Object(J.a)(),Object(L.d)(),H.a.resetTerminalInput()},setDisplayElements:function(){if(ue.Display.terminalContent=document.getElementById("terminal-container"),z.routing.navigateTo(z.Page.Terminal),ue.Display.characterContent=document.getElementById("character-container"),ue.Display.characterContent.style.display="none",ue.Display.scriptEditorContent=document.getElementById("script-editor-container"),ue.Display.scriptEditorContent.style.display="none",ue.Display.activeScriptsContent=document.getElementById("active-scripts-container"),ue.Display.activeScriptsContent.style.display="none",ue.Display.hacknetNodesContent=document.getElementById("hacknet-nodes-container"),ue.Display.hacknetNodesContent.style.display="none",ue.Display.worldContent=document.getElementById("world-container"),ue.Display.worldContent.style.display="none",ue.Display.createProgramContent=document.getElementById("create-program-container"),ue.Display.createProgramContent.style.display="none",ue.Display.factionsContent=document.getElementById("factions-container"),ue.Display.factionsContent.style.display="none",ue.Display.factionContent=document.getElementById("faction-container"),ue.Display.factionContent.style.display="none",ue.Display.factionAugmentationsContent=document.getElementById("faction-augmentations-container"),ue.Display.factionAugmentationsContent.style.display="none",ue.Display.augmentationsContent=document.getElementById("augmentations-container"),ue.Display.augmentationsContent.style.display="none",ue.Display.tutorialContent=document.getElementById("tutorial-container"),ue.Display.tutorialContent.style.display="none",ue.Display.infiltrationContent=document.getElementById("infiltration-container"),ue.Display.infiltrationContent.style.display="none",ue.Display.stockMarketContent=document.getElementById("stock-market-container"),ue.Display.stockMarketContent.style.display="none",ue.Display.missionContent=document.getElementById("mission-container"),ue.Display.missionContent.style.display="none",ue.Display.characterInfo=document.getElementById("character-content"),ue.aevumLocationsList=document.getElementById("aevum-locations-list"),ue.chongqingLocationsList=document.getElementById("chongqing-locations-list"),ue.sector12LocationsList=document.getElementById("sector12-locations-list"),ue.newTokyoLocationsList=document.getElementById("newtokyo-locations-list"),ue.ishimaLocationsList=document.getElementById("ishima-locations-list"),ue.volhavenLocationsList=document.getElementById("volhaven-locations-list"),ue.Display.locationContent=document.getElementById("location-container"),ue.Display.locationContent.style.display="none",ue.Display.workInProgressContent=document.getElementById("work-in-progress-container"),ue.Display.workInProgressContent.style.display="none",ue.Display.redPillContent=document.getElementById("red-pill-container"),ue.Display.redPillContent.style.display="none",ue.Display.cinematicTextContent=document.getElementById("cinematic-text-container"),ue.Display.cinematicTextContent.style.display="none",Object(E.b)(),!Object(Q.initializeMainMenuLinks)()){const e="Failed to initialize Main Menu Links. Please try refreshing the page. If that doesn't work, report the issue to the developer";return Object(ae.exceptionAlert)(new Error(e)),void console.error(e)}},init:function(){if(document.getElementById("import-game-link").onclick=function(){I.b.importGame()},!Object(X.initializeMainMenuHeaders)(w.a,!1)){const e="Failed to initialize Main Menu Headers. Please try refreshing the page. If that doesn't work, report the issue to the developer";return Object(ae.exceptionAlert)(new Error(e)),void console.error(e)}(Q.MainMenuLinks.Terminal.addEventListener("click",function(){return ue.loadTerminalContent(),!1}),Q.MainMenuLinks.ScriptEditor.addEventListener("click",function(){return ue.loadScriptEditorContent(),!1}),Q.MainMenuLinks.ActiveScripts.addEventListener("click",function(){return ue.loadActiveScriptsContent(),!1}),Q.MainMenuLinks.CreateProgram.addEventListener("click",function(){return ue.loadCreateProgramContent(),!1}),Q.MainMenuLinks.Stats.addEventListener("click",function(){return ue.loadCharacterContent(),!1}),Q.MainMenuLinks.Factions.addEventListener("click",function(){return ue.loadFactionsContent(),!1}),Q.MainMenuLinks.Augmentations.addEventListener("click",function(){return ue.loadAugmentationsContent(),!1}),Q.MainMenuLinks.HacknetNodes.addEventListener("click",function(){return ue.loadHacknetNodesContent(),!1}),Q.MainMenuLinks.Sleeves.addEventListener("click",function(){return ue.loadSleevesContent(),Q.MainMenuLinks.Sleeves.classList.add("active"),!1}),Q.MainMenuLinks.City.addEventListener("click",function(){return ue.loadWorldContent(),!1}),Q.MainMenuLinks.Travel.addEventListener("click",function(){return ue.loadTravelContent(),Q.MainMenuLinks.Travel.classList.add("active"),!1}),Q.MainMenuLinks.Job.addEventListener("click",function(){return ue.loadJobContent(),Q.MainMenuLinks.Job.classList.add("active"),!1}),Q.MainMenuLinks.StockMarket.addEventListener("click",function(){return ue.loadStockMarketContent(),Q.MainMenuLinks.StockMarket.classList.add("active"),!1}),Q.MainMenuLinks.Bladeburner.addEventListener("click",function(){return ue.loadBladeburnerContent(),!1}),Q.MainMenuLinks.Corporation.addEventListener("click",function(){return ue.loadCorporationContent(),Q.MainMenuLinks.Corporation.classList.add("active"),!1}),Q.MainMenuLinks.Gang.addEventListener("click",function(){return ue.loadGangContent(),!1}),Q.MainMenuLinks.Tutorial.addEventListener("click",function(){return ue.loadTutorialContent(),!1}),Q.MainMenuLinks.DevMenu.addEventListener("click",function(){return!1}),ue.ActiveScriptsList=document.getElementById("active-scripts-list"),ue.Clickables.saveMainMenuButton=document.getElementById("save-game-link"),ue.Clickables.saveMainMenuButton.addEventListener("click",function(){return I.b.saveGame(pe),!1}),ue.Clickables.deleteMainMenuButton=document.getElementById("delete-game-link"),ue.Clickables.deleteMainMenuButton.addEventListener("click",function(){return I.b.deleteGame(pe),!1}),document.getElementById("export-game-link").addEventListener("click",function(){return I.b.exportGame(),!1}),document.getElementById("character-overview-save-button").addEventListener("click",function(){return I.b.saveGame(pe),!1}),document.getElementById("character-overview-options-button").addEventListener("click",function(){return Object(ee.b)(),!1}),Object(R.c)(),Object(H.b)(),w.a.isWorking)&&(document.getElementById("work-in-progress-cancel-button").addEventListener("click",function(){if(w.a.workType==_.CONSTANTS.WorkTypeFaction){y.Factions[w.a.currentWorkFactionName];w.a.finishFactionWork(!0)}else w.a.workType==_.CONSTANTS.WorkTypeCreateProgram?w.a.finishCreateProgramWork(!0):w.a.workType==_.CONSTANTS.WorkTypeStudyClass?w.a.finishClass():w.a.workType==_.CONSTANTS.WorkTypeCrime?w.a.finishCrime(!0):w.a.workType==_.CONSTANTS.WorkTypeCompanyPartTime?w.a.finishWorkPartTime():w.a.finishWork(!0)}),ue.loadWorkInProgressContent());document.getElementById("character-overview-container").style.display="block",document.getElementById("terminal-menu-link").removeAttribute("class"),document.getElementById("stats-menu-link").removeAttribute("class"),document.getElementById("create-script-menu-link").removeAttribute("class"),document.getElementById("active-scripts-menu-link").removeAttribute("class"),document.getElementById("hacknet-nodes-menu-link").removeAttribute("class"),document.getElementById("city-menu-link").removeAttribute("class"),document.getElementById("tutorial-menu-link").removeAttribute("class"),document.getElementById("copy-save-to-clipboard-link").addEventListener("click",function(){const e=I.b.getSaveString();if(navigator.clipboard)navigator.clipboard.writeText(e).then(function(){Object($.createStatusText)("Copied save to clipboard")},function(e){console.error("Unable to copy save data to clipboard using Async API"),Object($.createStatusText)("Failed to copy save")});else{const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="absolute",t.left="-9999px",document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy")?Object($.createStatusText)("Copied save to clipboard"):Object($.createStatusText)("Failed to copy save")}catch(e){console.error("Unable to copy save data to clipboard using document.execCommand('copy')"),Object($.createStatusText)("Failed to copy save")}document.body.removeChild(t)}}),document.getElementById("debug-delete-scripts-link").addEventListener("click",function(){return console.log("Deleting running scripts on home computer"),w.a.getHomeComputer().runningScripts=[],Object(Z.dialogBoxCreate)("Forcefully deleted all running scripts on home computer. Please save and refresh page"),Object(ee.a)(),!1}),document.getElementById("debug-soft-reset").addEventListener("click",function(){return Object(Z.dialogBoxCreate)("Soft Reset!"),Object(x.a)(),Object(ee.a)(),!1})},start:function(){ue.idleTimer(),Object(A.f)()}};var pe,he;window.onload=function(){if(!window.indexedDB)return ue.load(null);(he=window.indexedDB.open("bitburnerSave",1)).onerror=function(e){return console.log("Error opening indexedDB: "),console.log(e),ue.load(null)},he.onsuccess=function(e){console.log("Opening bitburnerSave database successful!");var t=(pe=e.target.result).transaction(["savestring"]).objectStore("savestring").get("save");t.onerror=function(e){return console.log("Error in Database request to get savestring: "+e),ue.load(null)},t.onsuccess=function(e){ue.load(t.result)}},he.onupgradeneeded=function(e){e.target.result.createObjectStore("savestring")}}}.call(this,n(81))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Terminal="Terminal",e.CharacterInfo="CharacterInfo",e.ScriptEditor="ScriptEditor",e.ActiveScripts="ActiveScripts",e.HacknetNodes="HacknetNodes",e.World="World",e.CreateProgram="CreateProgram",e.Factions="Factions",e.Faction="Faction",e.Augmentations="Augmentations",e.Tutorial="Tutorial",e.DevMenu="Dev Menu",e.Location="Location",e.workInProgress="WorkInProgress",e.RedPill="RedPill",e.CinematicText="CinematicText",e.Infiltration="Infiltration",e.StockMarket="StockMarket",e.Gang="Gang",e.Mission="Mission",e.Corporation="Corporation",e.Bladeburner="Bladeburner",e.Sleeves="Sleeves",e.Resleeves="Re-sleeving"}(t.Page||(t.Page={}));t.routing=new class{constructor(){this.currentPage=null}isOn(e){return this.currentPage===e}navigateTo(e){this.currentPage=e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Augmentations={}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=n(70),r=n(158),i=n(18);function o(e){const n=e.name;t.Factions[n]=e}function s(e){return t.Factions.hasOwnProperty(e)}function l(e){if(!(e instanceof a.Faction))throw new Error("Invalid argument 'newFactionObject' passed into resetFaction()");const n=e.name;s(n)&&(e.favor=t.Factions[n].favor,delete t.Factions[n]),o(e)}t.Factions={},t.loadFactions=function(e){t.Factions=JSON.parse(e,i.Reviver)},t.AddToFactions=o,t.factionExists=s,t.initFactions=function(e=1){for(const e in r.FactionInfos)l(new a.Faction(e))},t.resetFaction=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRandomInt=function(e,t){const n=Math.min(e,t),a=Math.max(e,t);return Math.floor(Math.random()*(a-n+1))+n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=n(2),r=n(21),i=n(14),o=n(18);class s{constructor(e={info:"",moneyCost:0,name:"",repCost:0}){this.baseCost=0,this.baseRepRequirement=0,this.info="",this.level=0,this.name="",this.owned=!1,this.prereqs=[],this.mults={},this.startingCost=0,this.name=e.name,this.info=e.info,this.prereqs=e.prereqs?e.prereqs:[],this.baseRepRequirement=e.repCost*a.CONSTANTS.AugmentationRepMultiplier*r.BitNodeMultipliers.AugmentationRepCost,this.baseCost=e.moneyCost*a.CONSTANTS.AugmentationCostMultiplier*r.BitNodeMultipliers.AugmentationMoneyCost,this.startingCost=this.baseCost,this.level=0,e.hacking_mult&&(this.mults.hacking_mult=e.hacking_mult),e.strength_mult&&(this.mults.strength_mult=e.strength_mult),e.defense_mult&&(this.mults.defense_mult=e.defense_mult),e.dexterity_mult&&(this.mults.dexterity_mult=e.dexterity_mult),e.agility_mult&&(this.mults.agility_mult=e.agility_mult),e.charisma_mult&&(this.mults.charisma_mult=e.charisma_mult),e.hacking_exp_mult&&(this.mults.hacking_exp_mult=e.hacking_exp_mult),e.strength_exp_mult&&(this.mults.strength_exp_mult=e.strength_exp_mult),e.defense_exp_mult&&(this.mults.defense_exp_mult=e.defense_exp_mult),e.dexterity_exp_mult&&(this.mults.dexterity_exp_mult=e.dexterity_exp_mult),e.agility_exp_mult&&(this.mults.agility_exp_mult=e.agility_exp_mult),e.charisma_exp_mult&&(this.mults.charisma_exp_mult=e.charisma_exp_mult),e.hacking_chance_mult&&(this.mults.hacking_chance_mult=e.hacking_chance_mult),e.hacking_speed_mult&&(this.mults.hacking_speed_mult=e.hacking_speed_mult),e.hacking_money_mult&&(this.mults.hacking_money_mult=e.hacking_money_mult),e.hacking_grow_mult&&(this.mults.hacking_grow_mult=e.hacking_grow_mult),e.company_rep_mult&&(this.mults.company_rep_mult=e.company_rep_mult),e.faction_rep_mult&&(this.mults.faction_rep_mult=e.faction_rep_mult),e.crime_money_mult&&(this.mults.crime_money_mult=e.crime_money_mult),e.crime_success_mult&&(this.mults.crime_success_mult=e.crime_success_mult),e.work_money_mult&&(this.mults.work_money_mult=e.work_money_mult),e.hacknet_node_money_mult&&(this.mults.hacknet_node_money_mult=e.hacknet_node_money_mult),e.hacknet_node_purchase_cost_mult&&(this.mults.hacknet_node_purchase_cost_mult=e.hacknet_node_purchase_cost_mult),e.hacknet_node_ram_cost_mult&&(this.mults.hacknet_node_ram_cost_mult=e.hacknet_node_ram_cost_mult),e.hacknet_node_core_cost_mult&&(this.mults.hacknet_node_core_cost_mult=e.hacknet_node_core_cost_mult),e.hacknet_node_level_cost_mult&&(this.mults.hacknet_node_level_cost_mult=e.hacknet_node_level_cost_mult),e.bladeburner_max_stamina_mult&&(this.mults.bladeburner_max_stamina_mult=e.bladeburner_max_stamina_mult),e.bladeburner_stamina_gain_mult&&(this.mults.bladeburner_stamina_gain_mult=e.bladeburner_stamina_gain_mult),e.bladeburner_analysis_mult&&(this.mults.bladeburner_analysis_mult=e.bladeburner_analysis_mult),e.bladeburner_success_chance_mult&&(this.mults.bladeburner_success_chance_mult=e.bladeburner_success_chance_mult)}static fromJSON(e){return o.Generic_fromJSON(s,e.data)}addToFactions(e){for(let t=0;t{!function(e){null!=t.Companies[e.name]&&console.warn(`Duplicate Company Position being defined: ${e.name}`),t.Companies[e.name]=new r.Company(e)}(e)});for(const n in t.Companies){const a=t.Companies[n];e[n]instanceof r.Company?(a.favor=e[n].favor,isNaN(a.favor)&&(a.favor=0)):a.favor=0}},t.loadCompanies=function(e){t.Companies=JSON.parse(e,i.Reviver)},t.companyExists=function(e){return t.Companies.hasOwnProperty(e)}},function(e,t,n){"use strict";function a(e,t){var n;if(null==t)return console.log("Reviver WRONGLY called with key: "+e+", and value: "+t),0;if("object"==typeof t&&"string"==typeof t.ctor&&void 0!==t.data){if("AllServersMap"===t.ctor)return console.log("Converting AllServersMap for v0.43.1"),t.data;if("function"==typeof(n=a.constructors[t.ctor]||window[t.ctor])&&"function"==typeof n.fromJSON)return n.fromJSON(t)}return t}function r(e,t,n){var a,r;n||(n=Object.keys(t)),a={};for(let e=0;e{switch(typeof e){case"number":return e;case"object":return s.getRandomInt(e.min,e.max);default:throw Error(`Do not know how to convert the type '${typeof e}' to a number`)}};for(const e of i.serverMetadata){const i={hostname:e.hostname,ip:o.createRandomIp(),numOpenPortsRequired:e.numOpenPortsRequired,organizationName:e.organizationName};void 0!==e.maxRamExponent&&(i.maxRam=Math.pow(2,l(e.maxRamExponent)));for(const t of n)void 0!==e[t]&&(i[t]=l(e[t]));const s=new a.Server(i);for(const t of e.literature||[])s.messages.push(t);void 0!==e.specialName&&r.SpecialServerIps.addIp(e.specialName,s.ip),c(s),void 0!==e.networkLayer&&t[l(e.networkLayer)-1].push(s)}const u=(e,t)=>{e.serversOnNetwork.push(t.ip),t.serversOnNetwork.push(e.ip)},p=e=>e[Math.floor(Math.random()*e.length)],h=(e,t)=>{for(const n of e)u(n,t())};h(t[0],()=>e);for(let e=1;ep(t[e-1]))},t.prestigeAllServers=function(){for(var e in t.AllServers)delete t.AllServers[e];t.AllServers={}},t.loadAllServers=function(e){t.AllServers=JSON.parse(e,l.Reviver)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BitNodeMultipliers={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,PurchasedServerLimit:1,PurchasedServerMaxRam:1,CompanyWorkMoney:1,CrimeMoney:1,HacknetNodeMoney:1,ManualHackMoney:1,ScriptHackMoney: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,BladeburnerRank:1,BladeburnerSkillCost:1,DaedalusAugsRequirement:1}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=n(20),r=n(21),i=n(2),o=n(31),s=n(127);function l(e,t,n){let a=1+(i.CONSTANTS.ServerBaseGrowthRate-1)/e.hackDifficulty;a>i.CONSTANTS.ServerMaxGrowthRate&&(a=i.CONSTANTS.ServerMaxGrowthRate);const o=e.serverGrowth/100;return Math.log(t)/(Math.log(a)*n.hacking_grow_mult*o*r.BitNodeMultipliers.ServerGrowthRate)}function c(e){for(var t in a.AllServers)if(a.AllServers.hasOwnProperty(t)&&a.AllServers[t].hostname==e)return a.AllServers[t];return null}t.numCycleForGrowth=l,t.processSingleServerGrowth=function(e,t,n){const a=Math.max(Math.floor(t/450),0);var o=1+(i.CONSTANTS.ServerBaseGrowthRate-1)/e.hackDifficulty;o>i.CONSTANTS.ServerMaxGrowthRate&&(o=i.CONSTANTS.ServerMaxGrowthRate);const s=a*(e.serverGrowth/100)*r.BitNodeMultipliers.ServerGrowthRate;let c=Math.pow(o,s*n.hacking_grow_mult);c<1&&(console.log("WARN: serverGrowth calculated to be less than 1"),c=1);const u=e.moneyAvailable;if(e.moneyAvailable*=c,e.moneyMax&&isNaN(e.moneyAvailable)&&(e.moneyAvailable=e.moneyMax),e.moneyMax&&e.moneyAvailable>e.moneyMax&&(e.moneyAvailable=e.moneyMax),u!==e.moneyAvailable){let t=l(e,e.moneyAvailable/u,n);t=Math.max(0,t),e.fortify(2*i.CONSTANTS.ServerFortifyAmount*Math.ceil(t))}return e.moneyAvailable/u},t.prestigeHomeComputer=function(e){const t=e.programs.includes(o.Programs.BitFlume.name);e.programs.length=0,e.runningScripts=[],e.serversOnNetwork=[],e.isConnectedTo=!0,e.ramUsed=0,e.programs.push(o.Programs.NukeProgram.name),t&&e.programs.push(o.Programs.BitFlume.name),e.scripts.forEach(function(e){e.updateRamUsage()}),e.messages.length=0,e.messages.push("hackers-starting-handbook.lit")},t.GetServerByHostname=c,t.getServer=function(e){return s.isValidIPAddress(e)?void 0!==a.AllServers[e]?a.AllServers[e]:null:c(e)},t.getServerOnNetwork=function(e,t){if(!(t>e.serversOnNetwork.length))return a.AllServers[e.serversOnNetwork[t]];console.error("Tried to get server on network that was out of range")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=n(86);t.clearEventListeners=function(e){try{let t;const n=(t="string"==typeof e?a.getElementById(e):e).cloneNode(!0);return null!==t.parentNode&&t.parentNode.replaceChild(n,t),n}catch(e){return console.error(e),null}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EmployeePositions={Operations:"Operations",Engineer:"Engineer",Business:"Business",Management:"Management",RandD:"Research & Development",Training:"Training",Unassigned:"Unassigned"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=n(23);t.yesNoBoxOpen=!1;const r=document.getElementById("yes-no-box-container"),i=document.getElementById("yes-no-box-text");function o(e){if(27===e.keyCode)s();else if(13===e.keyCode){const e=document.getElementById("yes-no-box-yes");e?e.click():console.error("Could not find YesNoBox Yes button DOM element")}}function s(){return r?r.style.display="none":console.error("Container not found for YesNoBox"),t.yesNoBoxOpen=!1,document.removeEventListener("keydown",o),!1}t.yesNoBoxHotkeyHandler=o,t.yesNoBoxClose=s,t.yesNoBoxGetYesButton=function(){return a.clearEventListeners("yes-no-box-yes")},t.yesNoBoxGetNoButton=function(){return a.clearEventListeners("yes-no-box-no")},t.yesNoBoxCreate=function(e){return!t.yesNoBoxOpen&&(t.yesNoBoxOpen=!0,i?i.innerHTML=e:console.error("Text element not found for YesNoBox"),r?r.style.display="flex":console.error("Container not found for YesNoBox"),document.addEventListener("keydown",o),!0)};const l=document.getElementById("yes-no-text-input-box-container"),c=document.getElementById("yes-no-text-input-box-input"),u=document.getElementById("yes-no-text-input-box-text");function p(e){if(27===e.keyCode)h();else if(13===e.keyCode){const e=document.getElementById("yes-no-text-input-box-yes");e?e.click():console.error("Could not find YesNoTxtInputBox Yes button DOM element")}}function h(){return null==l?(console.error("Container not found for YesNoTextInputBox"),!1):(l.style.display="none",t.yesNoBoxOpen=!1,c.value="",document.removeEventListener("keydown",p),!1)}t.yesNoTxtInpBoxHotkeyHandler=p,t.yesNoTxtInpBoxClose=h,t.yesNoTxtInpBoxGetYesButton=function(){return a.clearEventListeners("yes-no-text-input-box-yes")},t.yesNoTxtInpBoxGetNoButton=function(){return a.clearEventListeners("yes-no-text-input-box-no")},t.yesNoTxtInpBoxGetInput=function(){if(null==c)return console.error("Could not find YesNoTextInputBox input element"),"";let e=c.value;return e=e.replace(/\s+/g,"")},t.yesNoTxtInpBoxCreate=function(e){t.yesNoBoxOpen=!0,u&&(u.innerHTML=e),l?l.style.display="flex":console.error("Container not found for YesNoTextInputBox"),document.addEventListener("keydown",p),c.focus()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=n(86),r=n(76);t.removeElementById=function(e){try{const t=a.getElementById(e);r.removeElement(t)}catch(e){}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=n(320),r=n(3);t.Industries={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"},t.IndustryStartingCosts={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},t.IndustryDescriptions={Energy:"Engage in the production and distribution of energy.

Starting cost: "+r.numeralWrapper.format(t.IndustryStartingCosts.Energy,"$0.000a")+"
Recommended starting Industry: NO",Utilities:"Distributes water and provides wastewater services.

Starting cost: "+r.numeralWrapper.format(t.IndustryStartingCosts.Utilities,"$0.000a")+"
Recommended starting Industry: NO",Agriculture:"Cultive crops and breed livestock to produce food.

Starting cost: "+r.numeralWrapper.format(t.IndustryStartingCosts.Agriculture,"$0.000a")+"
Recommended starting Industry: YES",Fishing:"Produce food through the breeding and processing of fish and fish products

Starting cost: "+r.numeralWrapper.format(t.IndustryStartingCosts.Fishing,"$0.000a")+"
Recommended starting Industry: NO",Mining:"Extract and process metals from the earth.

Starting cost: "+r.numeralWrapper.format(t.IndustryStartingCosts.Mining,"$0.000a")+"
Recommended starting Industry: NO",Food:"Create your own restaurants all around the world.

Starting cost: "+r.numeralWrapper.format(t.IndustryStartingCosts.Food,"$0.000a")+"
Recommended starting Industry: YES",Tobacco:"Create and distribute tobacco and tobacco-related products.

Starting cost: "+r.numeralWrapper.format(t.IndustryStartingCosts.Tobacco,"$0.000a")+"
Recommended starting Industry: YES",Chemical:"Product industrial chemicals

Starting cost: "+r.numeralWrapper.format(t.IndustryStartingCosts.Chemical,"$0.000a")+"
Recommended starting Industry: NO",Pharmaceutical:"Discover, develop, and create new pharmaceutical drugs.

Starting cost: "+r.numeralWrapper.format(t.IndustryStartingCosts.Pharmaceutical,"$0.000a")+"
Recommended starting Industry: NO",Computer:"Develop and manufacture new computer hardware and networking infrastructures.

Starting cost: "+r.numeralWrapper.format(t.IndustryStartingCosts.Computer,"$0.000a")+"
Recommended starting Industry: NO",Robotics:"Develop and create robots.

Starting cost: "+r.numeralWrapper.format(t.IndustryStartingCosts.Robotics,"$0.000a")+"
Recommended starting Industry: NO",Software:"Develop computer software and create AI Cores.

Starting cost: "+r.numeralWrapper.format(t.IndustryStartingCosts.Software,"$0.000a")+"
Recommended starting Industry: YES",Healthcare:"Create and manage hospitals.

Starting cost: "+r.numeralWrapper.format(t.IndustryStartingCosts.Healthcare,"$0.000a")+"
Recommended starting Industry: NO",RealEstate:"Develop and manage real estate properties.

Starting cost: "+r.numeralWrapper.format(t.IndustryStartingCosts.RealEstate,"$0.000a")+"
Recommended starting Industry: NO"},t.IndustryResearchTrees={Energy:a.getBaseResearchTreeCopy(),Utilities:a.getBaseResearchTreeCopy(),Agriculture:a.getBaseResearchTreeCopy(),Fishing:a.getBaseResearchTreeCopy(),Mining:a.getBaseResearchTreeCopy(),Food:a.getProductIndustryResearchTreeCopy(),Tobacco:a.getProductIndustryResearchTreeCopy(),Chemical:a.getBaseResearchTreeCopy(),Pharmaceutical:a.getProductIndustryResearchTreeCopy(),Computer:a.getProductIndustryResearchTreeCopy(),Robotics:a.getProductIndustryResearchTreeCopy(),Software:a.getProductIndustryResearchTreeCopy(),Healthcare:a.getProductIndustryResearchTreeCopy(),RealEstate:a.getProductIndustryResearchTreeCopy()},t.resetIndustryResearchTrees=function(){t.IndustryResearchTrees.Energy=a.getBaseResearchTreeCopy(),t.IndustryResearchTrees.Utilities=a.getBaseResearchTreeCopy(),t.IndustryResearchTrees.Agriculture=a.getBaseResearchTreeCopy(),t.IndustryResearchTrees.Fishing=a.getBaseResearchTreeCopy(),t.IndustryResearchTrees.Mining=a.getBaseResearchTreeCopy(),t.IndustryResearchTrees.Food=a.getBaseResearchTreeCopy(),t.IndustryResearchTrees.Tobacco=a.getBaseResearchTreeCopy(),t.IndustryResearchTrees.Chemical=a.getBaseResearchTreeCopy(),t.IndustryResearchTrees.Pharmaceutical=a.getBaseResearchTreeCopy(),t.IndustryResearchTrees.Computer=a.getBaseResearchTreeCopy(),t.IndustryResearchTrees.Robotics=a.getBaseResearchTreeCopy(),t.IndustryResearchTrees.Software=a.getBaseResearchTreeCopy(),t.IndustryResearchTrees.Healthcare=a.getBaseResearchTreeCopy(),t.IndustryResearchTrees.RealEstate=a.getBaseResearchTreeCopy()}},function(module,__webpack_exports__,__webpack_require__){"use strict";(function($){__webpack_require__.d(__webpack_exports__,"f",function(){return IssueNewSharesCooldown}),__webpack_require__.d(__webpack_exports__,"k",function(){return SellSharesCooldown}),__webpack_require__.d(__webpack_exports__,"m",function(){return WarehouseInitialCost}),__webpack_require__.d(__webpack_exports__,"n",function(){return WarehouseInitialSize}),__webpack_require__.d(__webpack_exports__,"o",function(){return WarehouseUpgradeBaseCost}),__webpack_require__.d(__webpack_exports__,"g",function(){return OfficeInitialCost}),__webpack_require__.d(__webpack_exports__,"h",function(){return OfficeInitialSize}),__webpack_require__.d(__webpack_exports__,"a",function(){return BribeThreshold}),__webpack_require__.d(__webpack_exports__,"b",function(){return BribeToRepRatio}),__webpack_require__.d(__webpack_exports__,"j",function(){return ProductProductionCostRatio}),__webpack_require__.d(__webpack_exports__,"d",function(){return DividendMaxPercentage}),__webpack_require__.d(__webpack_exports__,"c",function(){return Corporation}),__webpack_require__.d(__webpack_exports__,"e",function(){return Industry}),__webpack_require__.d(__webpack_exports__,"i",function(){return OfficeSpace});var _CorporationState__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(170),_CorporationState__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_CorporationState__WEBPACK_IMPORTED_MODULE_0__),_data_CorporationUnlockUpgrades__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(145),_data_CorporationUnlockUpgrades__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(_data_CorporationUnlockUpgrades__WEBPACK_IMPORTED_MODULE_1__),_data_CorporationUpgrades__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(144),_data_CorporationUpgrades__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(_data_CorporationUpgrades__WEBPACK_IMPORTED_MODULE_2__),_EmployeePositions__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(24),_EmployeePositions__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(_EmployeePositions__WEBPACK_IMPORTED_MODULE_3__),_IndustryData__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(27),_IndustryData__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(_IndustryData__WEBPACK_IMPORTED_MODULE_4__),_IndustryUpgrades__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(131),_IndustryUpgrades__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(_IndustryUpgrades__WEBPACK_IMPORTED_MODULE_5__),_Material__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(128),_Material__WEBPACK_IMPORTED_MODULE_6___default=__webpack_require__.n(_Material__WEBPACK_IMPORTED_MODULE_6__),_MaterialSizes__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(95),_MaterialSizes__WEBPACK_IMPORTED_MODULE_7___default=__webpack_require__.n(_MaterialSizes__WEBPACK_IMPORTED_MODULE_7__),_Product__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(114),_Product__WEBPACK_IMPORTED_MODULE_8___default=__webpack_require__.n(_Product__WEBPACK_IMPORTED_MODULE_8__),_ResearchMap__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(139),_ResearchMap__WEBPACK_IMPORTED_MODULE_9___default=__webpack_require__.n(_ResearchMap__WEBPACK_IMPORTED_MODULE_9__),_Warehouse__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(85),_Warehouse__WEBPACK_IMPORTED_MODULE_10___default=__webpack_require__.n(_Warehouse__WEBPACK_IMPORTED_MODULE_10__);__webpack_require__.d(__webpack_exports__,"l",function(){return _Warehouse__WEBPACK_IMPORTED_MODULE_10__.Warehouse});var _BitNode_BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(21),_BitNode_BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_11___default=__webpack_require__.n(_BitNode_BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_11__),_Constants__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(2),_Constants__WEBPACK_IMPORTED_MODULE_12___default=__webpack_require__.n(_Constants__WEBPACK_IMPORTED_MODULE_12__),_Faction_Factions__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__(14),_Faction_Factions__WEBPACK_IMPORTED_MODULE_13___default=__webpack_require__.n(_Faction_Factions__WEBPACK_IMPORTED_MODULE_13__),_Literature__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__(113),_Locations__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__(6),_Locations__WEBPACK_IMPORTED_MODULE_15___default=__webpack_require__.n(_Locations__WEBPACK_IMPORTED_MODULE_15__),_Locations_Cities__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__(93),_Locations_Cities__WEBPACK_IMPORTED_MODULE_16___default=__webpack_require__.n(_Locations_Cities__WEBPACK_IMPORTED_MODULE_16__),_Player__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__(0),_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_18__=__webpack_require__(3),_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_18___default=__webpack_require__.n(_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_18__),_ui_navigationTracking__WEBPACK_IMPORTED_MODULE_19__=__webpack_require__(12),_ui_navigationTracking__WEBPACK_IMPORTED_MODULE_19___default=__webpack_require__.n(_ui_navigationTracking__WEBPACK_IMPORTED_MODULE_19__),_utils_calculateEffectWithFactors__WEBPACK_IMPORTED_MODULE_20__=__webpack_require__(212),_utils_calculateEffectWithFactors__WEBPACK_IMPORTED_MODULE_20___default=__webpack_require__.n(_utils_calculateEffectWithFactors__WEBPACK_IMPORTED_MODULE_20__),_utils_DialogBox__WEBPACK_IMPORTED_MODULE_21__=__webpack_require__(9),_utils_uiHelpers_clearSelector__WEBPACK_IMPORTED_MODULE_22__=__webpack_require__(163),_utils_uiHelpers_clearSelector__WEBPACK_IMPORTED_MODULE_22___default=__webpack_require__.n(_utils_uiHelpers_clearSelector__WEBPACK_IMPORTED_MODULE_22__),_utils_JSONReviver__WEBPACK_IMPORTED_MODULE_23__=__webpack_require__(18),_utils_uiHelpers_appendLineBreaks__WEBPACK_IMPORTED_MODULE_24__=__webpack_require__(78),_utils_uiHelpers_appendLineBreaks__WEBPACK_IMPORTED_MODULE_24___default=__webpack_require__.n(_utils_uiHelpers_appendLineBreaks__WEBPACK_IMPORTED_MODULE_24__),_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_25__=__webpack_require__(4),_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_25___default=__webpack_require__.n(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_25__),_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_26__=__webpack_require__(38),_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_26___default=__webpack_require__.n(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_26__),_utils_uiHelpers_createPopupCloseButton__WEBPACK_IMPORTED_MODULE_27__=__webpack_require__(58),_utils_uiHelpers_createPopupCloseButton__WEBPACK_IMPORTED_MODULE_27___default=__webpack_require__.n(_utils_uiHelpers_createPopupCloseButton__WEBPACK_IMPORTED_MODULE_27__),_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_28__=__webpack_require__(7),_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_28___default=__webpack_require__.n(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_28__),_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_29__=__webpack_require__(15),_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_29___default=__webpack_require__.n(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_29__),_utils_helpers_isString__WEBPACK_IMPORTED_MODULE_30__=__webpack_require__(46),_utils_helpers_isString__WEBPACK_IMPORTED_MODULE_30___default=__webpack_require__.n(_utils_helpers_isString__WEBPACK_IMPORTED_MODULE_30__),_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_31__=__webpack_require__(30),_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_31___default=__webpack_require__.n(_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_31__),_utils_uiHelpers_removeElement__WEBPACK_IMPORTED_MODULE_32__=__webpack_require__(76),_utils_uiHelpers_removeElement__WEBPACK_IMPORTED_MODULE_32___default=__webpack_require__.n(_utils_uiHelpers_removeElement__WEBPACK_IMPORTED_MODULE_32__),_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_33__=__webpack_require__(26),_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_33___default=__webpack_require__.n(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_33__),_utils_YesNoBox__WEBPACK_IMPORTED_MODULE_34__=__webpack_require__(25),_utils_YesNoBox__WEBPACK_IMPORTED_MODULE_34___default=__webpack_require__.n(_utils_YesNoBox__WEBPACK_IMPORTED_MODULE_34__),react__WEBPACK_IMPORTED_MODULE_35__=__webpack_require__(1),react__WEBPACK_IMPORTED_MODULE_35___default=__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_35__),react_dom__WEBPACK_IMPORTED_MODULE_36__=__webpack_require__(90),react_dom__WEBPACK_IMPORTED_MODULE_36___default=__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_36__),_ui_CorporationUIEventHandler__WEBPACK_IMPORTED_MODULE_37__=__webpack_require__(211),_ui_Root__WEBPACK_IMPORTED_MODULE_38__=__webpack_require__(210),_ui_Routing__WEBPACK_IMPORTED_MODULE_39__=__webpack_require__(118),_ui_Routing__WEBPACK_IMPORTED_MODULE_39___default=__webpack_require__.n(_ui_Routing__WEBPACK_IMPORTED_MODULE_39__),decimal_js__WEBPACK_IMPORTED_MODULE_40__=__webpack_require__(48);const INITIALSHARES=1e9,SHARESPERPRICEUPDATE=1e6,IssueNewSharesCooldown=216e3,SellSharesCooldown=18e3,CyclesPerMarketCycle=50,CyclesPerIndustryStateCycle=CyclesPerMarketCycle/_CorporationState__WEBPACK_IMPORTED_MODULE_0__.AllCorporationStates.length,SecsPerMarketCycle=CyclesPerMarketCycle/5,Cities=["Aevum","Chongqing","Sector-12","New Tokyo","Ishima","Volhaven"],WarehouseInitialCost=5e9,WarehouseInitialSize=100,WarehouseUpgradeBaseCost=1e9,OfficeInitialCost=4e9,OfficeInitialSize=3,OfficeUpgradeBaseCost=1e9,BribeThreshold=1e14,BribeToRepRatio=1e9,ProductProductionCostRatio=5,DividendMaxPercentage=50,EmployeeSalaryMultiplier=3,CyclesPerEmployeeRaise=400,EmployeeRaiseAmount=50,BaseMaxProducts=3;let researchTreeBoxOpened=!1,researchTreeBox=null;$(document).mousedown(function(e){researchTreeBoxOpened&&null==$(e.target).closest("#corporation-research-popup-box-content").get(0)&&(Object(_utils_uiHelpers_removeElement__WEBPACK_IMPORTED_MODULE_32__.removeElement)(researchTreeBox),researchTreeBox=null,researchTreeBoxOpened=!1)});var empManualAssignmentModeActive=!1;function Industry(e={}){this.offices={[_Locations__WEBPACK_IMPORTED_MODULE_15__.Locations.Aevum]:0,[_Locations__WEBPACK_IMPORTED_MODULE_15__.Locations.Chongqing]:0,[_Locations__WEBPACK_IMPORTED_MODULE_15__.Locations.Sector12]:new OfficeSpace({loc:_Locations__WEBPACK_IMPORTED_MODULE_15__.Locations.Sector12,size:OfficeInitialSize}),[_Locations__WEBPACK_IMPORTED_MODULE_15__.Locations.NewTokyo]:0,[_Locations__WEBPACK_IMPORTED_MODULE_15__.Locations.Ishima]:0,[_Locations__WEBPACK_IMPORTED_MODULE_15__.Locations.Volhaven]:0},this.name=e.name?e.name:0,this.type=e.type?e.type:0,this.sciResearch=new _Material__WEBPACK_IMPORTED_MODULE_6__.Material({name:"Scientific Research"}),this.researched={},this.reqMats={},this.prodMats=[],this.products={},this.makesProducts=!1,this.awareness=0,this.popularity=0,this.startingCost=0,this.reFac=0,this.sciFac=0,this.hwFac=0,this.robFac=0,this.aiFac=0,this.advFac=0,this.prodMult=0,this.lastCycleRevenue=new decimal_js__WEBPACK_IMPORTED_MODULE_40__.a(0),this.lastCycleExpenses=new decimal_js__WEBPACK_IMPORTED_MODULE_40__.a(0),this.thisCycleRevenue=new decimal_js__WEBPACK_IMPORTED_MODULE_40__.a(0),this.thisCycleExpenses=new decimal_js__WEBPACK_IMPORTED_MODULE_40__.a(0);var t=Object.keys(_IndustryUpgrades__WEBPACK_IMPORTED_MODULE_5__.IndustryUpgrades).length;this.upgrades=Array(t).fill(0),this.state="START",this.newInd=!0,this.warehouses={[_Locations__WEBPACK_IMPORTED_MODULE_15__.Locations.Aevum]:0,[_Locations__WEBPACK_IMPORTED_MODULE_15__.Locations.Chonqing]:0,[_Locations__WEBPACK_IMPORTED_MODULE_15__.Locations.Sector12]:new _Warehouse__WEBPACK_IMPORTED_MODULE_10__.Warehouse({corp:e.corp,industry:this,loc:_Locations__WEBPACK_IMPORTED_MODULE_15__.Locations.Sector12,size:WarehouseInitialSize}),[_Locations__WEBPACK_IMPORTED_MODULE_15__.Locations.NewTokyo]:0,[_Locations__WEBPACK_IMPORTED_MODULE_15__.Locations.Ishima]:0,[_Locations__WEBPACK_IMPORTED_MODULE_15__.Locations.Volhaven]:0},this.init()}function Employee(e={}){if(!(this instanceof Employee))return new Employee(e);this.name=e.name?e.name:"Bobby",this.mor=e.morale?e.morale:Object(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_29__.getRandomInt)(50,100),this.hap=e.happiness?e.happiness:Object(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_29__.getRandomInt)(50,100),this.ene=e.energy?e.energy:Object(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_29__.getRandomInt)(50,100),this.age=e.age?e.age:Object(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_29__.getRandomInt)(20,50),this.int=e.intelligence?e.intelligence:Object(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_29__.getRandomInt)(10,50),this.cha=e.charisma?e.charisma:Object(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_29__.getRandomInt)(10,50),this.exp=e.experience?e.experience:Object(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_29__.getRandomInt)(10,50),this.cre=e.creativity?e.creativity:Object(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_29__.getRandomInt)(10,50),this.eff=e.efficiency?e.efficiency:Object(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_29__.getRandomInt)(10,50),this.sal=e.salary?e.salary:Object(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_29__.getRandomInt)(.1,5),this.pro=0,this.cyclesUntilRaise=CyclesPerEmployeeRaise,this.loc=e.loc?e.loc:"",this.pos=_EmployeePositions__WEBPACK_IMPORTED_MODULE_3__.EmployeePositions.Unassigned}Industry.prototype.init=function(){switch(this.startingCost=_IndustryData__WEBPACK_IMPORTED_MODULE_4__.IndustryStartingCosts[this.type],this.type){case _IndustryData__WEBPACK_IMPORTED_MODULE_4__.Industries.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_4__.Industries.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_4__.Industries.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_4__.Industries.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_4__.Industries.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_4__.Industries.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_4__.Industries.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_4__.Industries.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_4__.Industries.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_4__.Industries.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_4__.Industries.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_4__.Industries.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_4__.Industries.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_4__.Industries.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.log("ERR: Invalid Industry Type passed into Industry.init(): "+this.type)}},Industry.prototype.getProductDescriptionText=function(){if(this.makesProducts)switch(this.type){case _IndustryData__WEBPACK_IMPORTED_MODULE_4__.Industries.Food:return"create and manage restaurants";case _IndustryData__WEBPACK_IMPORTED_MODULE_4__.Industries.Tobacco:return"create tobacco and tobacco-related products";case _IndustryData__WEBPACK_IMPORTED_MODULE_4__.Industries.Pharmaceutical:return"develop new pharmaceutical drugs";case _IndustryData__WEBPACK_IMPORTED_MODULE_4__.Industries.Computer:case"Computer":return"create new computer hardware and networking infrastructures";case _IndustryData__WEBPACK_IMPORTED_MODULE_4__.Industries.Robotics:return"build specialized robots and robot-related products";case _IndustryData__WEBPACK_IMPORTED_MODULE_4__.Industries.Software:return"develop computer software";case _IndustryData__WEBPACK_IMPORTED_MODULE_4__.Industries.Healthcare:return"build and manage hospitals";case _IndustryData__WEBPACK_IMPORTED_MODULE_4__.Industries.RealEstate:return"develop and manage real estate properties";default:return console.log("ERROR: Invalid industry type in Industry.getProductDescriptionText"),""}},Industry.prototype.getMaximumNumberProducts=function(){if(!this.makesProducts)return 0;let e=0;return this.hasResearch("uPgrade: Capacity.I")&&++e,this.hasResearch("uPgrade: Capacity.II")&&++e,BaseMaxProducts+e},Industry.prototype.hasMaximumNumberProducts=function(){return Object.keys(this.products).length>=this.getMaximumNumberProducts()},Industry.prototype.calculateProductionFactors=function(){for(var e=0,t=0;t0&&(e.breakdown+=t+": "+Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_28__.formatNumber)(n.data[e.loc][0]*n.siz,0)+"
")}},Industry.prototype.process=function(e=1,t,n){if(this.state=t,"START"!==t){var a=this.processMaterials(e,n);this.thisCycleRevenue=this.thisCycleRevenue.plus(a[0]),this.thisCycleExpenses=this.thisCycleExpenses.plus(a[1]),a=this.processProducts(e,n),this.thisCycleRevenue=this.thisCycleRevenue.plus(a[0]),this.thisCycleExpenses=this.thisCycleExpenses.plus(a[1])}else{(isNaN(this.thisCycleRevenue)||isNaN(this.thisCycleExpenses))&&(console.log("ERROR: NaN in Corporation's computed revenue/expenses"),console.log(this.thisCycleRevenue.toString()),console.log(this.thisCycleExpenses.toString()),Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_21__.dialogBoxCreate)("Something went wrong when compting Corporation's revenue/expenses. This is a bug. Please report to game developer"),this.thisCycleRevenue=new decimal_js__WEBPACK_IMPORTED_MODULE_40__.a(0),this.thisCycleExpenses=new decimal_js__WEBPACK_IMPORTED_MODULE_40__.a(0)),this.lastCycleRevenue=this.thisCycleRevenue.dividedBy(e*SecsPerMarketCycle),this.lastCycleExpenses=this.thisCycleExpenses.dividedBy(e*SecsPerMarketCycle),this.thisCycleRevenue=new decimal_js__WEBPACK_IMPORTED_MODULE_40__.a(0),this.thisCycleExpenses=new decimal_js__WEBPACK_IMPORTED_MODULE_40__.a(0),this.lastCycleRevenue.gt(0)&&(this.newInd=!1);var r=0;for(var i in this.offices)this.offices[i]instanceof OfficeSpace&&(r+=this.offices[i].process(e,{industry:this,corporation:n}));this.thisCycleExpenses=this.thisCycleExpenses.plus(r),this.processMaterialMarket(e),this.processProductMarket(e),this.popularity-=1e-4*e,this.popularity=Math.max(0,this.popularity);var o=n.getDreamSenseGain(),s=4*o;o>0&&(this.popularity+=o*e,this.awareness+=s*e)}},Industry.prototype.processMaterialMarket=function(e=1){for(var t=this.reqMats,n=this.prodMats,a=0;a0&&(r.qty+=a,expenses+=a*r.bCost)}(matName,industry),this.updateWarehouseSizeUsed(warehouse));break;case"PRODUCTION":if(warehouse.smartSupplyStore=0,this.prodMats.length>0){var mat=warehouse.materials[this.prodMats[0]],maxProd=this.getOfficeProductivity(office)*this.prodMult*company.getProductionMultiplier()*this.getProductionMultiplier();let e;e=mat.prdman[0]?Math.min(maxProd,mat.prdman[1]):maxProd,e*=SecsPerMarketCycle*marketCycles;var totalMatSize=0;for(let e=0;e0){var maxAmt=Math.floor((warehouse.size-warehouse.sizeUsed)/totalMatSize);e=Math.min(maxAmt,e)}e<0&&(e=0),warehouse.smartSupplyStore+=e/(SecsPerMarketCycle*marketCycles);var producableFrac=1;for(var reqMatName in this.reqMats)if(this.reqMats.hasOwnProperty(reqMatName)){var req=this.reqMats[reqMatName]*e;warehouse.materials[reqMatName].qty0&&e>0){for(const t in this.reqMats){var reqMatQtyNeeded=this.reqMats[t]*e*producableFrac;warehouse.materials[t].qty-=reqMatQtyNeeded,warehouse.materials[t].prd=0,warehouse.materials[t].prd-=reqMatQtyNeeded/(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/(SecsPerMarketCycle*marketCycles)):mat.sll=0}break;case"EXPORT":for(var matName in warehouse.materials)if(warehouse.materials.hasOwnProperty(matName)){var mat=warehouse.materials[matName];mat.totalExp=0;for(var expI=0;expI=expWarehouse.size)return;var maxAmt=Math.floor((expWarehouse.size-expWarehouse.sizeUsed)/_MaterialSizes__WEBPACK_IMPORTED_MODULE_7__.MaterialSizes[matName]);amt=Math.min(maxAmt,amt),expWarehouse.materials[matName].imp+=amt/(SecsPerMarketCycle*marketCycles),expWarehouse.materials[matName].qty+=amt,expWarehouse.materials[matName].qlt=mat.qlt,mat.qty-=amt,mat.totalExp+=amt,expIndustry.updateWarehouseSizeUsed(expWarehouse);break}}}mat.totalExp/=SecsPerMarketCycle*marketCycles}break;case"START":break;default:console.log("ERROR: Invalid state: "+this.state)}this.updateWarehouseSizeUsed(warehouse)}office instanceof OfficeSpace&&(this.sciResearch.qty+=.004*Math.pow(office.employeeProd[_EmployeePositions__WEBPACK_IMPORTED_MODULE_3__.EmployeePositions.RandD],.5)*company.getScientificResearchMultiplier()*this.getScientificResearchMultiplier())}return[revenue,expenses]},Industry.prototype.processProducts=function(e=1,t){var n=0;if("PRODUCTION"===this.state)for(const t in this.products){const n=this.products[t];if(!n.fin){const t=n.createCity,a=this.offices[t],r=a.employeeProd[_EmployeePositions__WEBPACK_IMPORTED_MODULE_3__.EmployeePositions.Engineer],i=a.employeeProd[_EmployeePositions__WEBPACK_IMPORTED_MODULE_3__.EmployeePositions.Management],o=a.employeeProd[_EmployeePositions__WEBPACK_IMPORTED_MODULE_3__.EmployeePositions.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(e,c),n.prog>=100&&n.finishProduct(a.employeeProd,this);break}}for(var a in this.products)if(this.products.hasOwnProperty(a)){var r=this.products[a];r instanceof _Product__WEBPACK_IMPORTED_MODULE_8__.Product&&r.fin&&(n+=this.processProduct(e,r,t))}return[n,0]},Industry.prototype.processProduct=function(marketCycles=1,product,corporation){let totalProfit=0;for(let i=0;i0){var maxAmt=Math.floor((warehouse.size-warehouse.sizeUsed)/netStorageSize);prod=Math.min(maxAmt,prod)}warehouse.smartSupplyStore+=prod/(SecsPerMarketCycle*marketCycles);var producableFrac=1;for(var reqMatName in product.reqMats)if(product.reqMats.hasOwnProperty(reqMatName)){var req=product.reqMats[reqMatName]*prod;warehouse.materials[reqMatName].qty0&&prod>0){for(var reqMatName in product.reqMats)if(product.reqMats.hasOwnProperty(reqMatName)){var reqMatQtyNeeded=product.reqMats[reqMatName]*prod*producableFrac;warehouse.materials[reqMatName].qty-=reqMatQtyNeeded,warehouse.materials[reqMatName].prd-=reqMatQtyNeeded/(SecsPerMarketCycle*marketCycles)}product.data[city][0]+=prod*producableFrac}product.data[city][1]=prod*producableFrac/(SecsPerMarketCycle*marketCycles);break;case"SALE":for(var reqMatName in product.pCost=0,product.reqMats)product.reqMats.hasOwnProperty(reqMatName)&&(product.pCost+=product.reqMats[reqMatName]*warehouse.materials[reqMatName].bCost);product.pCost*=ProductProductionCostRatio;const businessFactor=this.getBusinessFactor(office),advertisingFactor=this.getAdvertisingFactors()[0],marketFactor=this.getMarketFactor(product),markupLimit=product.rat/product.mku;var sCost;if(product.marketTa2){const e=product.data[city][1],t=markupLimit,n=e,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=t/r+product.pCost,product.marketTa2Price[city]=i,sCost=i}else product.marketTa1?sCost=product.pCost+markupLimit:Object(_utils_helpers_isString__WEBPACK_IMPORTED_MODULE_30__.isString)(product.sCost)?(sCost=product.sCost.replace(/MP/g,product.pCost+product.rat/product.mku),sCost=eval(sCost)):sCost=product.sCost;var markup=1;sCost>product.pCost&&sCost-product.pCost>markupLimit&&(markup=markupLimit/(sCost-product.pCost));var maxSell=.5*Math.pow(product.rat,.65)*marketFactor*corporation.getSalesMultiplier()*Math.pow(markup,2)*businessFactor*advertisingFactor*this.getSalesMultiplier(),sellAmt;if(product.sllman[city][0]&&Object(_utils_helpers_isString__WEBPACK_IMPORTED_MODULE_30__.isString)(product.sllman[city][1])){var tmp=product.sllman[city][1].replace(/MAX/g,maxSell);tmp=tmp.replace(/PROD/g,product.data[city][1]);try{tmp=eval(tmp)}catch(e){Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_21__.dialogBoxCreate)("Error evaluating your sell price expression for "+product.name+" in "+this.name+"'s "+city+" office. Sell price is being set to MAX"),tmp=maxSell}sellAmt=Math.min(maxSell,tmp)}else sellAmt=product.sllman[city][0]&&product.sllman[city][1]>0?Math.min(maxSell,product.sllman[city][1]):!1===product.sllman[city][0]?0:maxSell;sellAmt<0&&(sellAmt=0),sellAmt=sellAmt*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/(SecsPerMarketCycle*marketCycles)):product.data[city][2]=0;break;case"START":case"PURCHASE":case"EXPORT":break;default:console.log("ERROR: Invalid State: "+this.state)}}return totalProfit},Industry.prototype.discontinueProduct=function(e){for(var t in this.products)this.products.hasOwnProperty(t)&&e===this.products[t]&&delete this.products[t]},Industry.prototype.upgrade=function(e,t){var n=t.corporation,a=(t.division,t.office),r=e[0];for(e[1],e[2],e[3];this.upgrades.length<=r;)this.upgrades.push(0);switch(++this.upgrades[r],r){case 0:for(let e=0;e{if(this.sciResearch.qty>=n.cost)return this.sciResearch.qty-=n.cost,t.research(a[e]),this.researched[a[e]]=!0,Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_21__.dialogBoxCreate)(`Researched ${a[e]}. It may take a market cycle `+`(~${SecsPerMarketCycle} seconds) before the effects of `+"the Research apply."),this.createResearchBox();Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_21__.dialogBoxCreate)(`You do not have enough Scientific Research for ${n.name}`)}):console.warn(`Could not find Research Tree div for ${r}`)}const r=document.getElementById(`${e}-content`);null!=r&&(Object(_utils_uiHelpers_appendLineBreaks__WEBPACK_IMPORTED_MODULE_24__.appendLineBreaks)(r,2),r.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_25__.createElement)("pre",{display:"block",innerText:"Multipliers from research:\n"+` * Advertising Multiplier: x${t.getAdvertisingMultiplier()}\n`+` * Employee Charisma Multiplier: x${t.getEmployeeChaMultiplier()}\n`+` * Employee Creativity Multiplier: x${t.getEmployeeCreMultiplier()}\n`+` * Employee Efficiency Multiplier: x${t.getEmployeeEffMultiplier()}\n`+` * Employee Intelligence Multiplier: x${t.getEmployeeIntMultiplier()}\n`+` * Production Multiplier: x${t.getProductionMultiplier()}\n`+` * Sales Multiplier: x${t.getSalesMultiplier()}\n`+` * Scientific Research Multiplier: x${t.getScientificResearchMultiplier()}\n`+` * Storage Multiplier: x${t.getStorageMultiplier()}`})),r.appendChild(Object(_utils_uiHelpers_createPopupCloseButton__WEBPACK_IMPORTED_MODULE_27__.createPopupCloseButton)(researchTreeBox,{class:"std-button",display:"block",innerText:"Close"}))),researchTreeBoxOpened=!0},Industry.prototype.toJSON=function(){return Object(_utils_JSONReviver__WEBPACK_IMPORTED_MODULE_23__.Generic_toJSON)("Industry",this)},Industry.fromJSON=function(e){return Object(_utils_JSONReviver__WEBPACK_IMPORTED_MODULE_23__.Generic_fromJSON)(Industry,e.data)},_utils_JSONReviver__WEBPACK_IMPORTED_MODULE_23__.Reviver.constructors.Industry=Industry,Employee.prototype.process=function(e=1,t){var n=.003*e,a=n*Math.random();this.age+=n,this.exp+=n,this.age>150&&(this.int-=a,this.eff-=a,this.cha-=a),this.cyclesUntilRaise-=e,this.cyclesUntilRaise<=0&&(this.salary+=EmployeeRaiseAmount,this.cyclesUntilRaise+=CyclesPerEmployeeRaise);var r=n*Math.random();return this.pos===_EmployeePositions__WEBPACK_IMPORTED_MODULE_3__.EmployeePositions.Training&&(this.cha+=r,this.exp+=r,this.eff+=r),this.ene-=a,this.hap-=a,this.eneHappiness: "+Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_28__.formatNumber)(this.hap,3)+"
Energy: "+Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_28__.formatNumber)(this.ene,3)+"
Age: "+Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_28__.formatNumber)(this.age,3)+"
Intelligence: "+Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_28__.formatNumber)(i,3)+"
Charisma: "+Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_28__.formatNumber)(r,3)+"
Experience: "+Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_28__.formatNumber)(this.exp,3)+"
Creativity: "+Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_28__.formatNumber)(a,3)+"
Efficiency: "+Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_28__.formatNumber)(o,3)+"
Salary: "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_18__.numeralWrapper.format(this.sal,"$0.000a")+"/ s
"}));var s=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_25__.createElement)("select",{});for(var l in _EmployeePositions__WEBPACK_IMPORTED_MODULE_3__.EmployeePositions)_EmployeePositions__WEBPACK_IMPORTED_MODULE_3__.EmployeePositions.hasOwnProperty(l)&&s.add(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_25__.createElement)("option",{text:_EmployeePositions__WEBPACK_IMPORTED_MODULE_3__.EmployeePositions[l],value:_EmployeePositions__WEBPACK_IMPORTED_MODULE_3__.EmployeePositions[l]}));s.addEventListener("change",()=>{this.pos=s.options[s.selectedIndex].value});for(var c=0;c=this.size},OfficeSpace.prototype.process=function(e=1,t){t.corporation;var n=t.industry;if(n.hasResearch("HRBuddy-Recruitment")&&!this.atCapacity()){const e=this.hireRandomEmployee();n.hasResearch("HRBuddy-Training")&&(e.pos=_EmployeePositions__WEBPACK_IMPORTED_MODULE_3__.EmployeePositions.Training)}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);var a=1;n.funds<0&&n.lastCycleRevenue<0?a=Math.pow(.99,e):n.funds>0&&n.lastCycleRevenue>0&&(a=Math.pow(1.01,e));const r=n.hasResearch("AutoBrew"),i=n.hasResearch("AutoPartyManager");var o=0;for(let t=0;tCharisma: "+Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_28__.formatNumber)(t.cha,1)+"
Experience: "+Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_28__.formatNumber)(t.exp,1)+"
Creativity: "+Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_28__.formatNumber)(t.cre,1)+"
Efficiency: "+Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_28__.formatNumber)(t.eff,1)+"
Salary: "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_18__.numeralWrapper.format(t.sal,"$0.000a")+" s
",clickListener:()=>(n.hireEmployee(t,e),Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_33__.removeElementById)("cmpy-mgmt-hire-employee-popup"),!1)})},g=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_25__.createElement)("a",{class:"a-link-button",innerText:"Cancel",float:"right",clickListener:()=>(Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_33__.removeElementById)("cmpy-mgmt-hire-employee-popup"),!1)}),_=[m,d(u,this),d(p,this),d(h,this),g];Object(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_26__.createPopup)("cmpy-mgmt-hire-employee-popup",_)}},OfficeSpace.prototype.hireEmployee=function(e,t){var n=t.corporation,a=(t.industry,Object(_utils_YesNoBox__WEBPACK_IMPORTED_MODULE_34__.yesNoTxtInpBoxGetYesButton)()),r=Object(_utils_YesNoBox__WEBPACK_IMPORTED_MODULE_34__.yesNoTxtInpBoxGetNoButton)();a.innerHTML="Hire",r.innerHTML="Cancel",a.addEventListener("click",()=>{for(var t=Object(_utils_YesNoBox__WEBPACK_IMPORTED_MODULE_34__.yesNoTxtInpBoxGetInput)(),a=0;aObject(_utils_YesNoBox__WEBPACK_IMPORTED_MODULE_34__.yesNoTxtInpBoxClose)()),Object(_utils_YesNoBox__WEBPACK_IMPORTED_MODULE_34__.yesNoTxtInpBoxCreate)("Give your employee a nickname!")},OfficeSpace.prototype.hireRandomEmployee=function(){if(!this.atCapacity()&&null==document.getElementById("cmpy-mgmt-hire-employee-popup")){var e=Object(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_29__.getRandomInt)(76,100)/100,t=Object(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_29__.getRandomInt)(50,100),n=Object(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_29__.getRandomInt)(50,100),a=Object(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_29__.getRandomInt)(50,100),r=Object(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_29__.getRandomInt)(50,100),i=Object(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_29__.getRandomInt)(50,100),o=new Employee({intelligence:t*e,charisma:n*e,experience:a*e,creativity:r*e,efficiency:i*e,salary:EmployeeSalaryMultiplier*(t+n+a+r+i)*e}),s=Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_28__.generateRandomString)(7);for(let e=0;e=CyclesPerIndustryStateCycle){const t=this.getState(),n=1,a=n*CyclesPerIndustryStateCycle;if(this.storedCycles-=a,this.divisions.forEach(function(a){a.process(n,t,e)}),this.shareSaleCooldown>0&&(this.shareSaleCooldown-=a),this.issueNewSharesCooldown>0&&(this.issueNewSharesCooldown-=a),"START"===t){this.revenue=new decimal_js__WEBPACK_IMPORTED_MODULE_40__.a(0),this.expenses=new decimal_js__WEBPACK_IMPORTED_MODULE_40__.a(0),this.divisions.forEach(e=>{e.lastCycleRevenue!==-1/0&&e.lastCycleRevenue!==1/0&&e.lastCycleExpenses!==-1/0&&e.lastCycleExpenses!==1/0&&(this.revenue=this.revenue.plus(e.lastCycleRevenue),this.expenses=this.expenses.plus(e.lastCycleExpenses))});const e=this.revenue.minus(this.expenses).times(n*SecsPerMarketCycle);if(isNaN(this.funds)&&(Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_21__.dialogBoxCreate)("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=new decimal_js__WEBPACK_IMPORTED_MODULE_40__.a(15e10)),this.dividendPercentage>0&&e>0)if(isNaN(this.dividendPercentage)||this.dividendPercentage<0||this.dividendPercentage>DividendMaxPercentage)console.error(`Invalid Corporation dividend percentage: ${this.dividendPercentage}`);else{const t=this.dividendPercentage/100*e,n=e-t,a=t/this.totalShares,r=this.numShares*a*(1-this.dividendTaxPercentage/100);_Player__WEBPACK_IMPORTED_MODULE_17__.a.gainMoney(r),_Player__WEBPACK_IMPORTED_MODULE_17__.a.recordMoneySource(r,"corporation"),this.funds=this.funds.plus(n)}else this.funds=this.funds.plus(e);this.updateSharePrice()}this.state.nextState(),_ui_navigationTracking__WEBPACK_IMPORTED_MODULE_19__.routing.isOn(_ui_navigationTracking__WEBPACK_IMPORTED_MODULE_19__.Page.Corporation)&&this.rerender()}},Corporation.prototype.determineValuation=function(){var e,t=this.revenue.minus(this.expenses).toNumber();return this.public?(this.dividendPercentage>0&&(t*=(100-this.dividendPercentage)/100),e=this.funds.toNumber()+85e3*t,e*=Math.pow(1.1,this.divisions.length),e=Math.max(e,0)):(e=1e10+Math.max(this.funds.toNumber(),0)/3,t>0?(e+=315e3*t,e*=Math.pow(1.1,this.divisions.length)):e=1e10*Math.pow(1.1,this.divisions.length),e-=e%1e6),e*_BitNode_BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_11__.BitNodeMultipliers.CorporationValuation},Corporation.prototype.getInvestment=function(){var e,t=this.determineValuation();let n=4;switch(this.fundingRound){case 0:e=.1,n=4;break;case 1:e=.35,n=3;break;case 2:e=.25,n=3;break;case 3:e=.2,n=2.5;break;case 4:return}var a=t*e*n,r=Math.floor(INITIALSHARES*e),i=Object(_utils_YesNoBox__WEBPACK_IMPORTED_MODULE_34__.yesNoBoxGetYesButton)(),o=Object(_utils_YesNoBox__WEBPACK_IMPORTED_MODULE_34__.yesNoBoxGetNoButton)();i.innerHTML="Accept",o.innerHML="Reject",i.addEventListener("click",()=>(++this.fundingRound,this.funds=this.funds.plus(a),this.numShares-=r,this.rerender(),Object(_utils_YesNoBox__WEBPACK_IMPORTED_MODULE_34__.yesNoBoxClose)())),o.addEventListener("click",()=>Object(_utils_YesNoBox__WEBPACK_IMPORTED_MODULE_34__.yesNoBoxClose)()),Object(_utils_YesNoBox__WEBPACK_IMPORTED_MODULE_34__.yesNoBoxCreate)("An investment firm has offered you "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_18__.numeralWrapper.format(a,"$0.000a")+" in funding in exchange for a "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_18__.numeralWrapper.format(100*e,"0.000a")+"% stake in the company ("+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_18__.numeralWrapper.format(r,"0.000a")+" shares).

Do you accept or reject this offer?

Hint: Investment firms will offer more money if your corporation is turning a profit")},Corporation.prototype.goPublic=function(){var e,t=this.determineValuation()/this.totalShares,n=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_25__.createElement)("p",{innerHTML:"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 "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_18__.numeralWrapper.format(t,"$0.000a")+" per share (the IPO money will be deposited directly into your Corporation's funds).

You have a total of "+_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_18__.numeralWrapper.format(this.numShares,"0.000a")+" of shares that you can issue."}),a=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_25__.createElement)("input",{type:"number",placeholder:"Shares to issue",onkeyup:t=>{t.preventDefault(),t.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_31__.KEY.ENTER&&e.click()}}),r=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_25__.createElement)("br",{});e=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_25__.createElement)("a",{class:"a-link-button",innerText:"Go Public",clickListener:()=>{var e=Math.round(a.value),t=this.determineValuation()/this.totalShares;return isNaN(e)?(Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_21__.dialogBoxCreate)("Invalid value for number of issued shares"),!1):e>this.numShares?(Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_21__.dialogBoxCreate)("Error: You don't have that many shares to issue!"),!1):(this.public=!0,this.sharePrice=t,this.issuedShares=e,this.numShares-=e,this.funds=this.funds.plus(e*t),this.rerender(),Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_33__.removeElementById)("cmpy-mgmt-go-public-popup"),Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_21__.dialogBoxCreate)(`You took your ${this.name} public and earned `+`${_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_18__.numeralWrapper.formatMoney(e*t)} in your IPO`),!1)}});var i=Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_25__.createElement)("a",{class:"a-link-button",innerText:"Cancel",clickListener:()=>(Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_33__.removeElementById)("cmpy-mgmt-go-public-popup"),!1)});Object(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_26__.createPopup)("cmpy-mgmt-go-public-popup",[n,r,a,e,i])},Corporation.prototype.getTargetSharePrice=function(){return this.determineValuation()/(2*(this.totalShares-this.numShares)+1)},Corporation.prototype.updateSharePrice=function(){const e=this.getTargetSharePrice();this.sharePrice<=e?this.sharePrice*=1+.01*Math.random():this.sharePrice*=1-.01*Math.random(),this.sharePrice<=.01&&(this.sharePrice=.01)},Corporation.prototype.immediatelyUpdateSharePrice=function(){this.sharePrice=this.getTargetSharePrice()},Corporation.prototype.calculateShareSale=function(e){let t=e,n=this.shareSalesUntilPriceUpdate,a=this.sharePrice,r=0,i=0;const o=Math.ceil(e/SHARESPERPRICEUPDATE);if(!(isNaN(o)||o>1e7)){for(let e=0;e3600?`${Math.floor(t/3600)} hour(s)`:t>60?`${Math.floor(t/60)} minute(s)`:`${Math.floor(t)} second(s)`},Corporation.prototype.unlock=function(e){const t=e[0],n=e[1];for(;this.unlockUpgrades.length<=t;)this.unlockUpgrades.push(0);this.funds.lt(n)?Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_21__.dialogBoxCreate)("You don't have enough funds to unlock this!"):(this.unlockUpgrades[t]=1,this.funds=this.funds.minus(n),5===t?this.dividendTaxPercentage-=5:6===t&&(this.dividendTaxPercentage-=10))},Corporation.prototype.upgrade=function(e){for(var t=e[0],n=e[1],a=e[2],r=e[3];this.upgrades.length<=t;)this.upgrades.push(0);for(;this.upgradeMultipliers.length<=t;)this.upgradeMultipliers.push(1);var i=n*Math.pow(a,this.upgrades[t]);if(this.funds.lt(i))Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_21__.dialogBoxCreate)("You don't have enough funds to purchase this!");else if(++this.upgrades[t],this.funds=this.funds.minus(i),this.upgradeMultipliers[t]=1+this.upgrades[t]*r,1===t)for(var o=0;ox.longestName?e.length:x.longestName,x.longestSymbol=A[e].length>x.longestSymbol?A[e].length:x.longestSymbol}function I(){for(var e in P)P.hasOwnProperty(e)&&delete P[e];const t=_.getRandomInt;var n=o.Locations.AevumECorp,r=new a.Stock(n,A[n],t(40,50)/100,!0,19,t(17e3,28e3),24e11);P[n]=r;var i=o.Locations.Sector12MegaCorp,s=new a.Stock(i,A[i],t(40,50)/100,!0,19,t(24e3,34e3),24e11);P[i]=s;var l=o.Locations.Sector12BladeIndustries,c=new a.Stock(l,A[l],t(70,80)/100,!0,13,t(12e3,25e3),16e11);P[l]=c;var u=o.Locations.AevumClarkeIncorporated,p=new a.Stock(u,A[u],t(65,75)/100,!0,12,t(1e4,25e3),15e11);P[u]=p;var h=o.Locations.VolhavenOmniTekIncorporated,m=new a.Stock(h,A[h],t(60,70)/100,!0,12,t(32e3,43e3),18e11);P[h]=m;var d=o.Locations.Sector12FourSigma,g=new a.Stock(d,A[d],t(100,110)/100,!0,17,t(5e4,8e4),2e12);P[d]=g;var f=o.Locations.ChongqingKuaiGongInternational,y=new a.Stock(f,A[f],t(75,85)/100,!0,10,t(16e3,28e3),19e11);P[f]=y;var b=o.Locations.AevumFulcrumTechnologies,v=new a.Stock(b,A[b],t(120,130)/100,!0,16,t(29e3,36e3),2e12);P[b]=v;var E=o.Locations.IshimaStormTechnologies,k=new a.Stock(E,A[E],t(80,90)/100,!0,7,t(2e4,25e3),12e11);P[E]=k;var C=o.Locations.NewTokyoDefComm,O=new a.Stock(C,A[C],t(60,70)/100,!0,10,t(6e3,19e3),9e11);P[C]=O;var T=o.Locations.VolhavenHeliosLabs,S=new a.Stock(T,A[T],t(55,65)/100,!0,9,t(1e4,18e3),825e9);P[T]=S;var M=o.Locations.NewTokyoVitaLife,w=new a.Stock(M,A[M],t(70,80)/100,!0,7,t(8e3,14e3),1e12);P[M]=w;var x=o.Locations.Sector12IcarusMicrosystems,R=new a.Stock(x,A[x],t(60,70)/100,!0,7.5,t(12e3,24e3),8e11);P[x]=R;var N=o.Locations.Sector12UniversalEnergy,I=new a.Stock(N,A[N],t(50,60)/100,!0,10,t(16e3,29e3),9e11);P[N]=I;var L=o.Locations.AevumAeroCorp,D=new a.Stock(L,A[L],t(55,65)/100,!0,6,t(8e3,17e3),64e10);P[L]=D;var B=o.Locations.VolhavenOmniaCybersystems,W=new a.Stock(B,A[B],t(65,75)/100,!0,4.5,t(6e3,15e3),6e11);P[B]=W;var j=o.Locations.ChongqingSolarisSpaceSystems,F=new a.Stock(j,A[j],t(70,80)/100,!0,8.5,t(14e3,28e3),705e9);P[j]=F;var U=o.Locations.NewTokyoGlobalPharmaceuticals,H=new a.Stock(U,A[U],t(55,65)/100,!0,10.5,t(12e3,3e4),695e9);P[U]=H;var G=o.Locations.IshimaNovaMedical,K=new a.Stock(G,A[G],t(70,80)/100,!0,5,t(15e3,27e3),6e11);P[G]=K;var q=o.Locations.AevumWatchdogSecurity,$=new a.Stock(q,A[q],t(240,260)/100,!0,1.5,t(4e3,8500),45e10);P[q]=$;var Y=o.Locations.VolhavenLexoCorp,z=new a.Stock(Y,A[Y],t(115,135)/100,!0,6,t(4500,8e3),3e11);P[Y]=z;var V=o.Locations.AevumRhoConstruction,J=new a.Stock(V,A[V],t(50,70)/100,!0,1,t(2e3,7e3),18e10);P[V]=J;var X=o.Locations.Sector12AlphaEnterprises,Q=new a.Stock(X,A[X],t(175,205)/100,!0,10,t(4e3,8500),24e10);P[X]=Q;var Z=o.Locations.VolhavenSysCoreSecurities,ee=new a.Stock(Z,A[Z],t(150,170)/100,!0,3,t(3e3,8e3),2e11);P[Z]=ee;var te=o.Locations.VolhavenCompuTek,ne=new a.Stock(te,A[te],t(80,100)/100,!0,4,t(1e3,6e3),185e9);P[te]=ne;var ae=o.Locations.AevumNetLinkTechnologies,re=new a.Stock(ae,A[ae],t(400,430)/100,!0,1,t(1e3,5e3),58e9);P[ae]=re;var ie=o.Locations.IshimaOmegaSoftware,oe=new a.Stock(ie,A[ie],t(90,110)/100,!0,.5,t(1e3,8e3),6e10);P[ie]=oe;var se=o.Locations.Sector12FoodNStuff,le=new a.Stock(se,A[se],t(70,80)/100,!1,1,t(500,4500),45e9);P[se]=le;var ce=new a.Stock("Sigma Cosmetics",A["Sigma Cosmetics"],t(260,300)/100,!0,0,t(1500,3500),3e10);P["Sigma Cosmetics"]=ce;var ue=new a.Stock("Joes Guns",A["Joes Guns"],t(360,400)/100,!0,1,t(250,1500),42e9);P["Joes Guns"]=ue;var pe="Catalyst Ventures",he=new a.Stock(pe,A[pe],t(120,175)/100,!0,13.5,t(250,1500),1e11);P[pe]=he;var me="Microdyne Technologies",de=new a.Stock(me,A[me],t(70,80)/100,!0,8,t(15e3,3e4),36e10);P[me]=de;var ge="Titan Laboratories",_e=new a.Stock(ge,A[ge],t(50,70)/100,!0,11,t(12e3,24e3),42e10);P[ge]=_e;var fe={};for(var ye in P)if(P.hasOwnProperty(ye)){var be=P[ye];if(!(be instanceof a.Stock))continue;fe[be.symbol]=[]}P.Orders=fe,P.storedCycles=0,P.lastUpdate=0}function L(){for(var e in A)if(A.hasOwnProperty(e)){var t=P[e];if(null==t){console.error(`Could not find Stock for ${e}`);continue}var n=A[e];w[n]=t}}function D(){for(var e in P)if(P.hasOwnProperty(e)){var t=P[e];if(!(t instanceof a.Stock))continue;var n=.6;t.b&&(n=.4),Math.random()e.maxShares)return Object(h.dialogBoxCreate)(`You cannot purchase this many shares. ${e.symbol} has a maximum of `+`${p.numeralWrapper.formatBigNumber(e.maxShares)} shares.`),!1;var a=e.playerShares*e.playerAvgPx;c.a.loseMoney(n+i.CONSTANTS.StockMarketCommission);var r=a+n;return e.playerShares=Math.round(e.playerShares+t),e.playerAvgPx=r/e.playerShares,ee(e),Object(h.dialogBoxCreate)("Bought "+p.numeralWrapper.format(t,"0,0")+" shares of "+e.symbol+" at "+p.numeralWrapper.format(e.price,"($0.000a)")+" per share. Paid "+p.numeralWrapper.format(i.CONSTANTS.StockMarketCommission,"($0.000a)")+" in commission fees."),!0}function W(e,t){if(0==t)return!1;if(null==e||t<0||isNaN(t))return Object(h.dialogBoxCreate)("Failed to sell stock. This may be a bug, contact developer"),!1;if((t=Math.round(t))>e.playerShares&&(t=e.playerShares),0===t)return!1;const n=e.price*t-i.CONSTANTS.StockMarketCommission,a=(e.price-e.playerAvgPx)*t-i.CONSTANTS.StockMarketCommission;return c.a.gainMoney(n),c.a.recordMoneySource(a,"stock"),e.playerShares=Math.round(e.playerShares-t),0==e.playerShares&&(e.playerAvgPx=0),ee(e),Object(h.dialogBoxCreate)("Sold "+p.numeralWrapper.format(t,"0,0")+" shares of "+e.symbol+" at "+p.numeralWrapper.format(e.price,"($0.000a)")+" per share. After commissions, you gained a total of "+p.numeralWrapper.format(n,"($0.000a)")+"."),!0}function j(e,t,n=null){var a=n instanceof l.b;if(0===(t=Math.round(t))||t<0)return!1;if(null==e||isNaN(t))return a?n.scriptRef.log("ERROR: shortStock() failed because of invalid arguments."):Object(h.dialogBoxCreate)("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;var r=e.price*t;if(c.a.money.lt(r+i.CONSTANTS.StockMarketCommission))return a?n.scriptRef.log("ERROR: shortStock() failed because you do not have enough money to purchase this short position. You need "+p.numeralWrapper.format(r+i.CONSTANTS.StockMarketCommission,"($0.000a)")+"."):Object(h.dialogBoxCreate)("You do not have enough money to purchase this short position. You need "+p.numeralWrapper.format(r+i.CONSTANTS.StockMarketCommission,"($0.000a)")+"."),!1;if(t+e.playerShares+e.playerShortShares>e.maxShares)return a?n.scriptRef.log("ERROR: shortStock() failed because purchasing this many short shares would exceed "+`${e.symbol}'s maximum number of shares.`):Object(h.dialogBoxCreate)(`You cannot purchase this many shares. ${e.symbol} has a maximum of `+`${e.maxShares} shares.`),!1;var o=e.playerShortShares*e.playerAvgShortPx;c.a.loseMoney(r+i.CONSTANTS.StockMarketCommission);var s=o+r;return e.playerShortShares=Math.round(e.playerShortShares+t),e.playerAvgShortPx=s/e.playerShortShares,ee(e),a?null==n.disableLogs.ALL&&null==n.disableLogs.shortStock&&n.scriptRef.log("Bought a short position of "+p.numeralWrapper.format(t,"0,0")+" shares of "+e.symbol+" at "+p.numeralWrapper.format(e.price,"($0.000a)")+" per share. Paid "+p.numeralWrapper.format(i.CONSTANTS.StockMarketCommission,"($0.000a)")+" in commission fees."):Object(h.dialogBoxCreate)("Bought a short position of "+p.numeralWrapper.format(t,"0,0")+" shares of "+e.symbol+" at "+p.numeralWrapper.format(e.price,"($0.000a)")+" per share. Paid "+p.numeralWrapper.format(i.CONSTANTS.StockMarketCommission,"($0.000a)")+" in commission fees."),!0}function F(e,t,n=null){var a=n instanceof l.b;if(null==e||isNaN(t)||t<0)return a?n.scriptRef.log("ERROR: sellShort() failed because of invalid arguments."):Object(h.dialogBoxCreate)("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((t=Math.round(t))>e.playerShortShares&&(t=e.playerShortShares),0===t)return!1;var r=t*e.playerAvgShortPx,o=(e.playerAvgShortPx-e.price)*t-i.CONSTANTS.StockMarketCommission;return isNaN(o)&&(o=0),c.a.gainMoney(r+o),c.a.recordMoneySource(o,"stock"),a&&(n.scriptRef.onlineMoneyMade+=o,c.a.scriptProdSinceLastAug+=o),e.playerShortShares=Math.round(e.playerShortShares-t),0===e.playerShortShares&&(e.playerAvgShortPx=0),ee(e),a?null==n.disableLogs.ALL&&null==n.disableLogs.sellShort&&n.scriptRef.log("Sold your short position of "+p.numeralWrapper.format(t,"0,0")+" shares of "+e.symbol+" at "+p.numeralWrapper.format(e.price,"($0.000a)")+" per share. After commissions, you gained a total of "+p.numeralWrapper.format(r+o,"($0.000a)")+"."):Object(h.dialogBoxCreate)("Sold your short position of "+p.numeralWrapper.format(t,"0,0")+" shares of "+e.symbol+" at "+p.numeralWrapper.format(e.price,"($0.000a)")+" per share. After commissions, you gained a total of "+p.numeralWrapper.format(r+o,"($0.000a)")+"."),!0}function U(e=1){(null==P.storedCycles||isNaN(P.storedCycles))&&(P.storedCycles=0),P.storedCycles+=e;const t=6e3/i.CONSTANTS.MilliPerCycle;if(P.storedCycles=s.cap&&(c=.1,s.b=!1);var p=Math.random();p50&&(s.otlkMag=50),s.otlkMag<0&&(s.otlkMag*=-1,s.b=!s.b)}}}function H(e,t,n){var r=P.Orders;if(null!=r){var i=r[e.symbol];if(null==i||i.constructor!==Array)return console.log("ERROR: Invalid Order book for "+e.symbol+" in processOrders()"),void(i=[]);for(var o=0;o=s.price&&S(s);break;case k.LimitSell:case k.StopBuy:s.pos===C.Long&&e.price>=s.price?S(s):s.pos===C.Short&&e.price<=s.price&&S(s);break;case k.StopSell:s.pos===C.Long&&e.price<=s.price?S(s):s.pos===C.Short&&e.price>=s.price&&S(s);break;default:return void console.log("Invalid order type: "+s.type)}}}else{var l={};for(var c in P)if(P.hasOwnProperty(c)){if(!((e=P[c])instanceof a.Stock))continue;l[e.symbol]=[]}P.Orders=l}}function G(e){K=e}var K=!1,q=!1,$=i.CONSTANTS.StockMarketCommission;function Y(){function e(e,t,n,a,r){e.innerText=a,e.classList.remove("a-link-button"),e.classList.remove("a-link-button-bought"),e.classList.remove("a-link-button-inactive"),!n&&c.a.money.gte(t)?e.classList.add("a-link-button"):n?(e.innerText=r,e.classList.add("a-link-button-bought")):e.classList.add("a-link-button-inactive")}null==c.a.hasWseAccount&&(c.a.hasWseAccount=!1),null==c.a.hasTixApiAccess&&(c.a.hasTixApiAccess=!1),null==c.a.has4SData&&(c.a.has4SData=!1),null==c.a.has4SDataTixApi&&(c.a.has4SDataTixApi=!1);var t=Object(m.clearEventListeners)("stock-market-buy-account");e(t,i.CONSTANTS.WSEAccountCost,c.a.hasWseAccount,"Buy WSE Account - "+p.numeralWrapper.format(i.CONSTANTS.WSEAccountCost,"($0.000a)"),"WSE Account - Purchased"),t.addEventListener("click",function(){return c.a.hasWseAccount=!0,I(),L(),c.a.loseMoney(i.CONSTANTS.WSEAccountCost),Y(),!1});var n=Object(m.clearEventListeners)("stock-market-buy-tix-api");e(n,i.CONSTANTS.TIXAPICost,c.a.hasTixApiAccess,"Buy Trade Information eXchange (TIX) API Access - "+p.numeralWrapper.format(i.CONSTANTS.TIXAPICost,"($0.000a)"),"TIX API Access - Purchased"),n.addEventListener("click",function(){return c.a.hasTixApiAccess=!0,c.a.loseMoney(i.CONSTANTS.TIXAPICost),Y(),!1});var o=Object(m.clearEventListeners)("stock-market-buy-4s-data");e(o,Object(r.getStockMarket4SDataCost)(),c.a.has4SData,"Buy 4S Market Data Access - "+p.numeralWrapper.format(Object(r.getStockMarket4SDataCost)(),"($0.000a)"),"4S Market Data - Purchased"),o.addEventListener("click",function(){return!c.a.money.lt(Object(r.getStockMarket4SDataCost)())&&(c.a.has4SData=!0,c.a.loseMoney(Object(r.getStockMarket4SDataCost)()),Y(),!1)}),o.appendChild(Object(y.createElement)("span",{class:"tooltiptext",innerText:"Lets you view additional pricing and volatility information about stocks"})),o.style.marginRight="2px";var s=Object(m.clearEventListeners)("stock-market-4s-data-help-tip");s.style.marginTop="10px",s.addEventListener("click",()=>(Object(h.dialogBoxCreate)("Access to the 4S Market Data feed will display two additional pieces of information about each stock: Price Forecast & Volatility

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.

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).

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."),!1));var l=Object(m.clearEventListeners)("stock-market-buy-4s-tix-api");if(e(l,Object(r.getStockMarket4STixApiCost)(),c.a.has4SDataTixApi,"Buy 4S Market Data TIX API Access - "+p.numeralWrapper.format(Object(r.getStockMarket4STixApiCost)(),"($0.000a)"),"4S Market Data TIX API - Purchased"),c.a.hasTixApiAccess?(l.addEventListener("click",function(){return!c.a.money.lt(Object(r.getStockMarket4STixApiCost)())&&(c.a.has4SDataTixApi=!0,c.a.loseMoney(Object(r.getStockMarket4STixApiCost)()),Y(),!1)}),l.appendChild(Object(y.createElement)("span",{class:"tooltiptext",innerText:"Lets you access 4S Market Data through Netscript"}))):(l.classList.remove("a-link-button"),l.classList.remove("a-link-button-bought"),l.classList.remove("a-link-button-inactive"),l.classList.add("a-link-button-inactive"),l.appendChild(Object(y.createElement)("span",{class:"tooltiptext",innerText:"Requires TIX API Access"}))),null!=(E=document.getElementById("stock-market-list"))){var u=document.getElementById("stock-market-commission"),d=document.getElementById("stock-market-mode"),g=document.getElementById("stock-market-expand-tickers"),_=document.getElementById("stock-market-collapse-tickers"),b=document.getElementById("stock-market-watchlist-filter"),v=document.getElementById("stock-market-watchlist-filter-update");if(!c.a.hasWseAccount){for(K=!1;E.firstChild;)E.removeChild(E.firstChild);return u.style.visibility="hidden",d.style.visibility="hidden",g.style.visibility="hidden",_.style.visibility="hidden",b.style.visibility="hidden",void(v.style.visibility="hidden")}if(u.style.visibility="visible",d.style.visibility="visible",g.style.visibility="visible",_.style.visibility="visible",b.style.visibility="visible",v.style.visibility="visible",!K&&c.a.hasWseAccount){console.log("Creating Stock Market UI"),u.innerHTML="Commission Fees: Every transaction you make has a "+p.numeralWrapper.format(i.CONSTANTS.StockMarketCommission,"($0.000a)")+" commission fee.

WARNING: When you reset after installing Augmentations, the Stock Market is reset. This means all your positions are lost, so make sure to sell your stocks before installing Augmentations!",Object(m.clearEventListeners)("stock-market-investopedia").addEventListener("click",function(){return Object(h.dialogBoxCreate)("When making a transaction on the stock market, there are two types of positions: Long and Short. A Long position is the typical scenario where you buy a stock and earn a profit if the price of that stock increases. Meanwhile, a Short position is the exact opposite. In a Short position you purchase shares of a stock and earn a profit if the price of that stock decreases. This is also called 'shorting' a stock.

NOTE: Shorting stocks is not available immediately, and must be unlocked later on in the game.

There are three different types of orders you can make to buy or sell stocks on the exchange: Market Order, Limit Order, and Stop Order. Note that Limit Orders and Stop Orders are not available immediately, and must be unlocked later on in the game.

When you place a Market Order to buy or sell a stock, the order executes immediately at whatever the current price of the stock is. For example if you choose to short a stock with 5000 shares using a Market Order, you immediately purchase those 5000 shares in a Short position at whatever the current market price is for that stock.

A Limit Order is an order that only executes under certain conditions. A Limit Order is used to buy or sell a stock at a specified price or better. For example, lets say you purchased a Long position of 100 shares of some stock at a price of $10 per share. You can place a Limit Order to sell those 100 shares at $50 or better. The Limit Order will execute when the price of the stock reaches a value of $50 or higher.

A Stop Order is the opposite of a Limit Order. It is used to buy or sell a stock at a specified price (before the price gets 'worse'). For example, lets say you purchased a Short position of 100 shares of some stock at a price of $100 per share. The current price of the stock is $80 (a profit of $20 per share). You can place a Stop Order to sell the Short position if the stock's price reaches $90 or higher. This can be used to lock in your profits and limit any losses.

Here is a summary of how each order works and when they execute:

In a LONG Position:

A Limit Order to buy will execute if the stock's price <= order's price
A Limit Order to sell will execute if the stock's price >= order's price
A Stop Order to buy will execute if the stock's price >= order's price
A Stop Order to sell will execute if the stock's price <= order's price

In a SHORT Position:

A Limit Order to buy will execute if the stock's price >= order's price
A Limit Order to sell will execute if the stock's price <= order's price
A Stop Order to buy will execute if the stock's price <= order's price
A Stop Order to sell will execute if the stock's price >= order's price."),!1}),d&&(q=!1,d.innerHTML="Switch to 'Portfolio' ModeDisplays only the stocks for which you have shares or orders",d.addEventListener("click",z));var E=document.getElementById("stock-market-list");g&&g.addEventListener("click",()=>{for(var e=E.getElementsByClassName("accordion-header"),t=0;t{for(var e=E.getElementsByClassName("accordion-header"),t=0;t{let e=b.value.toString();P.watchlistFilter=e.replace(/\s/g,""),q?z():V()}),b.addEventListener("keyup",e=>{e.preventDefault(),e.keyCode===f.KEY.ENTER&&v.click()})):console.warn("Stock Market Watchlist DOM elements could not be found"),J(),K=!0}if(c.a.hasWseAccount)for(var k in P)if(P.hasOwnProperty(k)){var C=P[k];C instanceof a.Stock&&(Z(C,null),te(C))}}}function z(){q=!0;var e=Object(m.clearEventListeners)("stock-market-mode");e&&(e.innerHTML="Switch to 'All stocks' ModeDisplays all stocks on the WSE",e.addEventListener("click",V)),J()}function V(){q=!1;var e=Object(m.clearEventListeners)("stock-market-mode");e&&(e.innerHTML="Switch to 'Portfolio' ModeDisplays only the stocks for which you have shares or orders",e.addEventListener("click",z)),J()}function J(){var e=document.getElementById("stock-market-list");null==e&&Object(g.exceptionAlert)("Error creating Stock Tickers UI. DOM element with ID 'stock-market-list' could not be found"),Object(b.removeChildrenFromElement)(e);var t=P.Orders;if(null==t){var n={};for(var r in P)if(P.hasOwnProperty(r)){if(!((o=P[r])instanceof a.Stock))continue;n[o.symbol]=[]}P.Orders=n,t=P.Orders}let i=null;if(null!=P.watchlistFilter&&""!==P.watchlistFilter){i=P.watchlistFilter.replace(/\s/g,"").split(",")}for(var r in P)if(P.hasOwnProperty(r)){var o;if(!((o=P[r])instanceof a.Stock))continue;if(i&&!i.includes(o.symbol))continue;let e=t[o.symbol];if(q&&0===o.playerShares&&0===o.playerShortShares&&0===e.length)continue;X(o)}Q()}function X(e){if(e instanceof a.Stock){var t="stock-market-ticker-"+e.symbol,n=document.createElement("li"),r=document.createElement("button"),i=document.createElement("pre");r.classList.add("accordion-header"),r.setAttribute("id",t+"-hdr"),i.textContent=e.name+" - "+e.symbol+" - "+p.numeralWrapper.format(e.price,"($0.000a)"),r.appendChild(i);var o=document.createElement("div");o.classList.add("accordion-panel"),o.setAttribute("id",t+"-panel");var l=document.createElement("input"),u=document.createElement("select",{class:"dropdown"}),m=document.createElement("select",{class:"dropdown"}),d=document.createElement("span"),g=document.createElement("span"),_=document.createElement("span"),f=document.createElement("span"),y=document.createElement("p"),b=document.createElement("ul");l.classList.add("stock-market-input"),l.placeholder="Quantity (Shares)",l.setAttribute("id",t+"-qty-input"),l.setAttribute("onkeydown","return ( event.ctrlKey || event.altKey || (4734 && event.keyCode<40) || (event.keyCode==46) )"),u.classList.add("stock-market-input"),u.classList.add("dropdown"),u.setAttribute("id",t+"-pos-selector");var v=document.createElement("option");if(v.text="Long",u.add(v),8===c.a.bitNodeN||s.f&&s.h>=2){var T=document.createElement("option");T.text="Short",u.add(T)}m.classList.add("stock-market-input"),m.classList.add("dropdown"),m.setAttribute("id",t+"-order-selector");var S=document.createElement("option");if(S.text="Market Order",m.add(S),8===c.a.bitNodeN||s.f&&s.h>=3){var M=document.createElement("option");M.text="Limit Order",m.add(M);var P=document.createElement("option");P.text="Stop Order",m.add(P)}d.classList.add("stock-market-input"),d.classList.add("a-link-button"),d.innerHTML="Buy",d.addEventListener("click",()=>{var n=u.options[u.selectedIndex].text;n="Long"===n?C.Long:C.Short;var a=m.options[m.selectedIndex].text,r=Number(document.getElementById(t+"-qty-input").value);if(isNaN(r))return!1;switch(a){case"Market Order":n===C.Long?B(e,r):j(e,r,null);break;case"Limit Order":case"Stop Order":var i=Object(E.yesNoTxtInpBoxGetYesButton)(),o=Object(E.yesNoTxtInpBoxGetNoButton)();i.innerText="Place Buy "+a,o.innerText="Cancel Order",i.addEventListener("click",()=>{var t,i=Number(Object(E.yesNoTxtInpBoxGetInput)());t="Limit Order"===a?k.LimitBuy:k.StopBuy,O(e,r,i,t,n),Object(E.yesNoTxtInpBoxClose)()}),o.addEventListener("click",()=>{Object(E.yesNoTxtInpBoxClose)()}),Object(E.yesNoTxtInpBoxCreate)("Enter the price for your "+a);break;default:console.log("ERROR: Invalid order type")}return!1}),g.classList.add("stock-market-input"),g.classList.add("a-link-button"),g.innerHTML="Sell",g.addEventListener("click",()=>{var n=u.options[u.selectedIndex].text;n="Long"===n?C.Long:C.Short;var a=m.options[m.selectedIndex].text,r=Number(document.getElementById(t+"-qty-input").value);if(isNaN(r))return!1;switch(a){case"Market Order":n===C.Long?W(e,r):F(e,r,null);break;case"Limit Order":case"Stop Order":var i=Object(E.yesNoTxtInpBoxGetYesButton)(),o=Object(E.yesNoTxtInpBoxGetNoButton)();i.innerText="Place Sell "+a,o.innerText="Cancel Order",i.addEventListener("click",()=>{var t,i=Number(Object(E.yesNoTxtInpBoxGetInput)());t="Limit Order"===a?k.LimitSell:k.StopSell,Object(E.yesNoTxtInpBoxClose)(),O(e,r,i,t,n)}),o.addEventListener("click",()=>{Object(E.yesNoTxtInpBoxClose)()}),Object(E.yesNoTxtInpBoxCreate)("Enter the price for your "+a);break;default:console.log("ERROR: Invalid order type")}return!1}),_.classList.add("stock-market-input"),_.classList.add("a-link-button"),_.innerHTML="Buy MAX",_.addEventListener("click",()=>{var t=u.options[u.selectedIndex].text;t="Long"===t?C.Long:C.Short;var n=m.options[m.selectedIndex].text,a=c.a.money.toNumber();switch(n){case"Market Order":var r=Math.floor((a-$)/e.price);r=Math.min(r,Math.round(e.maxShares-e.playerShares-e.playerShortShares)),t===C.Long?B(e,r):j(e,r,null);break;case"Limit Order":case"Stop Order":var i=Object(E.yesNoTxtInpBoxGetYesButton)(),o=Object(E.yesNoTxtInpBoxGetNoButton)();i.innerText="Place Buy "+n,o.innerText="Cancel Order",i.addEventListener("click",()=>{var r,i=Number(Object(E.yesNoTxtInpBoxGetInput)());r="Limit Order"===n?k.LimitBuy:k.StopBuy;var o=Math.floor((a-$)/i);o=Math.min(o,Math.round(e.maxShares-e.playerShares-e.playerShortShares)),O(e,o,i,r,t),Object(E.yesNoTxtInpBoxClose)()}),o.addEventListener("click",()=>{Object(E.yesNoTxtInpBoxClose)()}),Object(E.yesNoTxtInpBoxCreate)("Enter the price for your "+n);break;default:console.log("ERROR: Invalid order type")}return!1}),f.classList.add("stock-market-input"),f.classList.add("a-link-button"),f.innerHTML="Sell ALL",f.addEventListener("click",()=>{var t=u.options[u.selectedIndex].text;switch(t="Long"===t?C.Long:C.Short,m.options[m.selectedIndex].text){case"Market Order":if(t===C.Long){var n=e.playerShares;W(e,n)}else{n=e.playerShortShares;F(e,n,null)}break;case"Limit Order":case"Stop Order":Object(h.dialogBoxCreate)("ERROR: 'Sell All' only works for Market Orders");break;default:console.log("ERROR: Invalid order type")}return!1}),y.setAttribute("id",t+"-position-text"),y.classList.add("stock-market-position-text"),e.posTxtEl=y,b.setAttribute("id",t+"-order-list"),b.classList.add("stock-market-order-list"),o.appendChild(l),o.appendChild(u),o.appendChild(m),o.appendChild(d),o.appendChild(g),o.appendChild(_),o.appendChild(f),o.appendChild(y),o.appendChild(b),n.appendChild(r),n.appendChild(o),document.getElementById("stock-market-list").appendChild(n),Z(e,!0),ee(e),te(e)}else console.log("Invalid stock in createStockSticker()")}function Q(){var e=document.getElementById("stock-market-list").getElementsByClassName("accordion-header");if(null!=e)for(var t=0;t0||e.playerShortShares>0)&&ee(e);var r=document.getElementById(n+"-hdr");if(null==r){if(!q){let t=P.watchlistFilter;""!==t&&t.includes(e.symbol)&&console.log("ERROR: Couldn't find ticker element for stock: "+e.symbol)}return}const i=p.numeralWrapper.format(e.price,"($0.000a)");let o=`${e.name}${" ".repeat(1+x.longestName-e.name.length+(x.longestSymbol-e.symbol.length))}${e.symbol} -${" ".repeat(10-i.length)}${i}`;c.a.has4SData&&(o+=` - Volatility: ${p.numeralWrapper.format(e.mv,"0,0.00")}% - Price Forecast: `,o+=(e.b?"+":"-").repeat(Math.floor(e.otlkMag/10)+1)),r.firstChild.textContent=o,null!=t&&(r.firstChild.style.color=t?"#66ff33":"red")}function ee(e){if(!u.routing.isOn(u.Page.StockMarket))return;if(!(e instanceof a.Stock))return console.log("Invalid stock in updateStockPlayerPosition():"),void console.log(e);var t="stock-market-ticker-"+e.symbol;if(q){if(0===e.playerShares&&0===e.playerShortShares&&P.Orders&&P.Orders[e.symbol]&&0===P.Orders[e.symbol].length)return Object(v.removeElementById)(t+"-hdr"),void Object(v.removeElementById)(t+"-panel");if(null==document.getElementById(t+"-hdr"))return X(e),void Q()}if(e.posTxtEl instanceof Element||(e.posTxtEl=document.getElementById(t+"-position-text")),null==e.posTxtEl)return void console.log("ERROR: Could not find stock position element for: "+e.symbol);const n=e.playerShares*e.playerAvgPx;let r=(e.price-e.playerAvgPx)*e.playerShares,i=r/n;isNaN(i)&&(i=0);const o=e.playerShortShares*e.playerAvgShortPx;let l=(e.playerAvgShortPx-e.price)*e.playerShortShares,h=l/o;isNaN(h)&&(h=0),e.posTxtEl.innerHTML=`Max Shares: ${p.numeralWrapper.format(e.maxShares,"0.000a")}
`+"

Long Position: Shares in the long position will increase in value if the price of the corresponding stock increases


Shares: "+p.numeralWrapper.format(e.playerShares,"0,0")+"
Average Price: "+p.numeralWrapper.format(e.playerAvgPx,"$0.000a")+" (Total Cost: "+p.numeralWrapper.format(n,"$0.000a")+")
Profit: "+p.numeralWrapper.format(r,"$0.000a")+" ("+p.numeralWrapper.format(i,"0.00%")+")
",(8===c.a.bitNodeN||s.f&&s.h>=2)&&(e.posTxtEl.innerHTML+="

Short Position: Shares in short position will increase in value if the price of the corresponding stock decreases


Shares: "+p.numeralWrapper.format(e.playerShortShares,"0,0")+"
Average Price: "+p.numeralWrapper.formatMoney(e.playerAvgShortPx)+" (Total Cost: "+p.numeralWrapper.formatMoney(o)+")
Profit: "+p.numeralWrapper.formatMoney(l)+" ("+p.numeralWrapper.format(h,"0.00%")+")

Orders:

")}function te(e){if(u.routing.isOn(u.Page.StockMarket)){var t="stock-market-ticker-"+e.symbol,n=document.getElementById(t+"-order-list");if(null!=n){var a=P.Orders;if(null!=a){var r=a[e.symbol];if(null!=r){if(q){if(0===e.playerShares&&0===e.playerShortShares&&P.Orders&&P.Orders[e.symbol]&&0===P.Orders[e.symbol].length)return Object(v.removeElementById)(t+"-hdr"),void Object(v.removeElementById)(t+"-panel");if(null==document.getElementById(t+"-hdr"))return X(e),void Q()}for(;n.firstChild;)n.removeChild(n.firstChild);for(var i=0;i0}function E(){const e=`hacknet-node-${c.a.hacknetNodes.length}`,t=new r.HacknetServer({adminRights:!0,hostname:e,player:c.a});c.a.hacknetNodes.push(t.ip),Object(u.AddToAllServers)(t);const n=c.a.getHomeComputer();return n.serversOnNetwork.push(t.ip),t.serversOnNetwork.push(n.ip),t}function k(){if(l.a.isRunning){if(l.a.currStep!==l.d.HacknetNodesIntroduction)return;Object(l.b)()}const e=c.a.hacknetNodes.length;if(v()){const t=T();if(isNaN(t))throw new Error("Calculated cost of purchasing HacknetServer is NaN");if(!c.a.canAfford(t))return-1;c.a.loseMoney(t);E();return c.a.hashManager.updateCapacity(c.a),e}{const t=O();if(isNaN(t))throw new Error("Calculated cost of purchasing HacknetNode is NaN");if(!c.a.canAfford(t))return-1;const n="hacknet-node-"+e,r=new a.HacknetNode(n);return r.updateMoneyGainRate(c.a),c.a.loseMoney(t),c.a.hacknetNodes.push(r),e}}function C(){return v()&&c.a.hacknetNodes.length>=r.MaxNumberHacknetServers}function O(){const e=c.a.hacknetNodes.length,t=a.HacknetNodePurchaseNextMult;return a.BaseCostForHacknetNode*Math.pow(t,e)*c.a.hacknet_node_purchase_cost_mult}function T(){const e=c.a.hacknetNodes.length,t=r.HacknetServerPurchaseMult;return e>r.MaxNumberHacknetServers?1/0:r.BaseCostForHacknetServer*Math.pow(t,e)*c.a.hacknet_node_purchase_cost_mult}function S(e,t){if(null==t)throw new Error("getMaxNumberLevelUpgrades() called without maxLevel arg");if(c.a.money.lt(e.calculateLevelUpgradeCost(1,c.a)))return 0;let n=1,a=t-1,r=t-e.level;if(c.a.money.gt(e.calculateLevelUpgradeCost(r,c.a)))return r;for(;n<=a;){var i=(n+a)/2|0;if(i!==t&&c.a.money.gt(e.calculateLevelUpgradeCost(i,c.a))&&c.a.money.lt(e.calculateLevelUpgradeCost(i+1,c.a)))return Math.min(r,i);if(c.a.money.lt(e.calculateLevelUpgradeCost(i,c.a)))a=i-1;else{if(!c.a.money.gt(e.calculateLevelUpgradeCost(i,c.a)))return Math.min(r,i);n=i+1}}return 0}function M(e,t){if(null==t)throw new Error("getMaxNumberRamUpgrades() called without maxLevel arg");if(c.a.money.lt(e.calculateRamUpgradeCost(1,c.a)))return 0;let n;if(n=e instanceof r.HacknetServer?Math.round(Math.log2(t/e.maxRam)):Math.round(Math.log2(t/e.ram)),c.a.money.gt(e.calculateRamUpgradeCost(n,c.a)))return n;for(let t=n-1;t>=0;--t)if(c.a.money.gt(e.calculateRamUpgradeCost(t,c.a)))return t;return 0}function P(e,t){if(null==t)throw new Error("getMaxNumberCoreUpgrades() called without maxLevel arg");if(c.a.money.lt(e.calculateCoreUpgradeCost(1,c.a)))return 0;let n=1,a=t-1;const r=t-e.cores;if(c.a.money.gt(e.calculateCoreUpgradeCost(r,c.a)))return r;for(;n<=a;){let i=(n+a)/2|0;if(i!=t&&c.a.money.gt(e.calculateCoreUpgradeCost(i,c.a))&&c.a.money.lt(e.calculateCoreUpgradeCost(i+1,c.a)))return Math.min(r,i);if(c.a.money.lt(e.calculateCoreUpgradeCost(i,c.a)))a=i-1;else{if(!c.a.money.gt(e.calculateCoreUpgradeCost(i,c.a)))return Math.min(r,i);n=i+1}}return 0}function A(e,t){if(null==t)throw new Error("getMaxNumberCacheUpgrades() called without maxLevel arg");if(!c.a.canAfford(e.calculateCacheUpgradeCost(1)))return 0;let n=1,a=t-1;const r=t-e.cache;if(c.a.canAfford(e.calculateCacheUpgradeCost(r)))return r;for(;n<=a;){let i=(n+a)/2|0;if(i!=t&&c.a.canAfford(e.calculateCacheUpgradeCost(i))&&!c.a.canAfford(e.calculateCacheUpgradeCost(i+1)))return Math.min(r,i);if(c.a.canAfford(e.calculateCacheUpgradeCost(i))){if(!c.a.canAfford(e.calculateCacheUpgradeCost(i)))return Math.min(r,i);n=i+1}else a=i-1}return 0}function w(){m.routing.isOn(m.Page.HacknetNodes)&&f.a.render(g.a.createElement(y.a,null),b)}function x(){b instanceof HTMLElement&&f.a.unmountComponentAtNode(b),b.style.display="none"}function R(e){return 0===c.a.hacknetNodes.length?0:v()?function(e){if(!(c.a.hashManager instanceof i.HashManager))throw new Error("Player does not have a HashManager (should be in 'hashManager' prop)");let t=0;for(let n=0;n
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:'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:"clear

Clears the console",cls:"cls

Clears the console",help:"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:"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:'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:'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:"stop

Stop your current action and go idle"};function F(e={}){this.name=e.name?e.name:p.Locations.Sector12,this.pop=e.pop?e.pop:Object(A.getRandomInt)(D,1.5*D),this.popEst=this.pop*(Math.random()+.5),this.comms=e.comms?e.comms:Object(A.getRandomInt)(5,150),this.commsEst=this.comms+Object(A.getRandomInt)(-5,5),this.commsEst<0&&(this.commsEst=0),this.chaos=0}function U(e={name:"foo",desc:"foo"}){if(!e.name)throw new Error("Failed to initialize Bladeburner Skill. No name was specified in ctor");if(this.name=e.name,!e.desc)throw new Error("Failed to initialize Bladeburner Skills. No desc was specified in ctor");this.desc=e.desc,this.baseCost=e.baseCost?e.baseCost:1,this.costInc=e.costInc?e.costInc:1,e.maxLvl&&(this.maxLvl=e.maxLvl),e.successChanceAll&&(this.successChanceAll=e.successChanceAll),e.successChanceStealth&&(this.successChanceStealth=e.successChanceStealth),e.successChanceKill&&(this.successChanceKill=e.successChanceKill),e.successChanceContract&&(this.successChanceContract=e.successChanceContract),e.successChanceOperation&&(this.successChanceOperation=e.successChanceOperation),e.successChanceEstimate&&(this.successChanceEstimate=e.successChanceEstimate),e.actionTime&&(this.actionTime=e.actionTime),e.effHack&&(this.effHack=e.effHack),e.effStr&&(this.effStr=e.effStr),e.effDef&&(this.effDef=e.effDef),e.effDex&&(this.effDex=e.effDex),e.effAgi&&(this.effAgi=e.effAgi),e.effCha&&(this.effCha=e.effCha),e.stamina&&(this.stamina=e.stamina),e.money&&(this.money=e.money),e.expGain&&(this.expGain=e.expGain),e.weaponAbility&&(this.weaponAbility=e.weaponAbility),e.gunAbility&&(this.gunAbility=e.gunAbility)}e(document).keydown(function(e){if(S.routing.isOn(S.Page.Bladeburner)){if(!(h.a.bladeburner instanceof Q))return;let i=h.a.bladeburner.consoleHistory;if(e.keyCode===_.KEY.ENTER){e.preventDefault();var t=Z.consoleInput.value;t.length>0&&(h.a.bladeburner.postToConsole("> "+t),h.a.bladeburner.resetConsoleInput(),h.a.bladeburner.executeConsoleCommands(t))}if(e.keyCode===_.KEY.UPARROW){if(null==Z.consoleInput)return;var n=W;if(0===(r=i.length))return;(n<0||n>r)&&(W=r),0!==n&&--W;var a=i[W];Z.consoleInput.value=a,Object(g.setTimeoutRef)(function(){Z.consoleInput.selectionStart=Z.consoleInput.selectionEnd=1e4},0)}if(e.keyCode===_.KEY.DOWNARROW){if(null==Z.consoleInput)return;var r;n=W;if(0==(r=i.length))return;if((n<0||n>r)&&(W=r),n==r||n==r-1)W=r,Z.consoleInput.value="";else{a=i[++W];Z.consoleInput.value=a}}}}),F.prototype.improvePopulationEstimateByCount=function(e){if(isNaN(e))throw new Error("NaN passeed into City.improvePopulationEstimateByCount()");this.popEstthis.pop&&(this.popEst=this.pop)):this.popEst>this.pop&&(this.popEst-=e,this.popEstthis.pop&&(this.popEst=this.pop)):this.popEst>this.pop&&(this.popEst*=1-e/100,this.popEstthis.comms&&(this.commsEst=this.comms)):this.commsEst>this.comms&&(this.commsEst-=e,this.commsEst0?1:-1),this.pop+=n,t.changeEstEqually&&(this.popEst+=n,this.popEst<0&&(this.popEst=0)),n}},F.prototype.changeChaosByCount=function(e){if(isNaN(e))throw new Error("NaN passed into City.changeChaosByCount()");0!==e&&(this.chaos+=e,this.chaos<0&&(this.chaos=0))},F.prototype.changeChaosByPercentage=function(e){if(isNaN(e))throw new Error("NaN passed into City.chaosChaosByPercentage()");if(0!==e){var t=this.chaos*(e/100);this.chaos+=t,this.chaos<0&&(this.chaos=0)}},F.prototype.toJSON=function(){return Object(v.Generic_toJSON)("City",this)},F.fromJSON=function(e){return Object(v.Generic_fromJSON)(F,e.data)},v.Reviver.constructors.City=F,U.prototype.calculateCost=function(e){return Math.floor((this.baseCost+e*this.costInc)*i.BitNodeMultipliers.BladeburnerSkillCost)};var H={},G={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 K(e={}){this.name=e.name?e.name:"",this.desc=e.desc?e.desc:"",this.level=1,this.maxLevel=1,this.autoLevel=!0,this.baseDifficulty=e.baseDifficulty?Object(E.addOffset)(e.baseDifficulty,10):100,this.difficultyFac=e.difficultyFac?e.difficultyFac:1.01,this.rewardFac=e.rewardFac?e.rewardFac:1.02,this.successes=0,this.failures=0,this.rankGain=e.rankGain?e.rankGain:0,e.rankLoss&&(this.rankLoss=e.rankLoss),e.hpLoss&&(this.hpLoss=e.hpLoss,this.hpLost=0),this.isStealth=!!e.isStealth,this.isKill=!!e.isKill,this.count=e.count?e.count:Object(A.getRandomInt)(1e3,25e3),this.countGrowth=e.countGrowth?e.countGrowth:Object(A.getRandomInt)(1,5);this.weights=e.weights?e.weights:{hack:1/7,str:1/7,def:1/7,dex:1/7,agi:1/7,cha:1/7,int:1/7};var t=0;for(var n in this.weights)this.weights.hasOwnProperty(n)&&(t+=this.weights[n]);if(t-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(var a in this.decays=e.decays?e.decays:{hack:.9,str:.9,def:.9,dex:.9,agi:.9,cha:.9,int:.9},this.decays)if(this.decays.hasOwnProperty(a)&&this.decays[a]>1)throw new Error("Invalid decays when constructing Action "+this.name+". Decay value cannot be greater than 1")}K.prototype.getDifficulty=function(){var e=this.baseDifficulty*Math.pow(this.difficultyFac,this.level-1);if(isNaN(e))throw new Error("Calculated NaN in Action.getDifficulty()");return e},K.prototype.getSuccessChance=function(e,t={}){if(null==e)throw new Error("Invalid Bladeburner instance passed into Action.getSuccessChance");var n=this.getDifficulty(),a=0;for(var r in this.weights)if(this.weights.hasOwnProperty(r)){var i=h.a.queryStatFromString(r),o="eff"+r.charAt(0).toUpperCase()+r.slice(1),s=e.skillMultipliers[o];null==s&&(console.log("ERROR: Failed to find Bladeburner Skill multiplier for: "+r),s=1),a+=this.weights[r]*Math.pow(s*i,this.decays[r])}(a*=e.calculateStaminaPenalty(),this instanceof V||this instanceof J)&&(this.teamCount&&this.teamCount>0&&(this.teamCount=Math.min(this.teamCount,e.teamSize),a*=Math.pow(this.teamCount,.05)));if(!(this instanceof J)){var l=e.getCurrentCity();if(t.est?a*=Math.pow(l.popEst/D,.7):a*=Math.pow(l.pop/D,.7),l.chaos>50){var c=l.chaos-50+1;n*=Math.pow(c,.1)}if(this instanceof V&&"Raid"===this.name&&l.comms<=0)return 0}if(a*=e.skillMultipliers.successChanceAll,(this instanceof V||this instanceof J)&&(a*=e.skillMultipliers.successChanceOperation),this instanceof z&&(a*=e.skillMultipliers.successChanceContract),this.isStealth&&(a*=e.skillMultipliers.successChanceStealth),this.isKill&&(a*=e.skillMultipliers.successChanceKill),a*=h.a.bladeburner_success_chance_mult,isNaN(a))throw new Error("Competence calculated as NaN in Action.getSuccessChance()");return Math.min(1,a/n)},K.prototype.attempt=function(e){return Math.random()=this.getSuccessesNeededForNextLevel(e)&&++this.maxLevel},K.prototype.toJSON=function(){return Object(v.Generic_toJSON)("Action",this)},K.fromJSON=function(e){return Object(v.Generic_fromJSON)(K,e.data)},v.Reviver.constructors.Action=K;var q={};const $=Object.freeze({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});function Y(e={}){e.name&&(this.name=e.name),e.type&&(this.type=e.type)}function z(e={}){K.call(this,e)}function V(e={}){K.call(this,e),this.reqdRank=e.reqdRank?e.reqdRank:100,this.teamCount=e.teamCount?e.teamCount:0}function J(e={}){V.call(this,e),this.count=1,this.countGrowth=0}Y.prototype.toJSON=function(){return Object(v.Generic_toJSON)("ActionIdentifier",this)},Y.fromJSON=function(e){return Object(v.Generic_fromJSON)(Y,e.data)},v.Reviver.constructors.ActionIdentifier=Y,z.prototype=Object.create(K.prototype),z.prototype.toJSON=function(){return Object(v.Generic_toJSON)("Contract",this)},z.fromJSON=function(e){return Object(v.Generic_fromJSON)(z,e.data)},v.Reviver.constructors.Contract=z,V.prototype=Object.create(K.prototype),V.prototype.toJSON=function(){return Object(v.Generic_toJSON)("Operation",this)},V.fromJSON=function(e){return Object(v.Generic_fromJSON)(V,e.data)},v.Reviver.constructors.Operation=V,J.prototype=Object.create(K.prototype),J.prototype.toJSON=function(){return Object(v.Generic_toJSON)("BlackOperation",this)},J.fromJSON=function(e){return Object(v.Generic_fromJSON)(J,e.data)},v.Reviver.constructors.BlackOperation=J;var X={};function Q(e={}){this.numHosp=0,this.moneyLost=0,this.rank=0,this.maxRank=0,this.skillPoints=0,this.totalSkillPoints=0,this.teamSize=0,this.teamLost=0,this.storedCycles=0,this.randomEventCounter=Object(A.getRandomInt)(240,600),this.actionTimeToComplete=0,this.actionTimeCurrent=0;var t=$.Idle;this.action=new Y({type:t}),this.cities={};for(var n=0;n
Does NOT require stamina."}),q[e="Recruitment"]=new K({name:e,desc:"Attempt to recruit members for your Bladeburner team. These members can help you conduct operations.

Does NOT require stamina."}),q[e="Diplomacy"]=new K({name:e,desc:"Improve diplomatic relations with the Synthoid population. Completing this action will reduce the Chaos level in your current city.

Does NOT require stamina."}),q[e="Hyperbolic Regeneration Chamber"]=new K({name:e,desc:"Enter cryogenic stasis using the Bladeburner division's hi-tech Regeneration Chamber. This will slowly heal your wounds and slightly increase your stamina.

"}),X["Operation Typhoon"]=new J({name:"Operation Typhoon",desc:"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.

The goal of Operation Typhoon 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.",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}),X["Operation Zero"]=new J({name:"Operation Zero",desc:"AeroCorp is one of the world's largest defense contractors. It's leader, Steve Watataki, is thought to be a supporter of Synthoid rights. He must be removed.

The goal of Operation Zero 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.",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}),X["Operation X"]=new J({name:"Operation X",desc:"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.

Samizdat has done a good job of keeping hidden and anonymous. However, we've just received intelligence that their base of operations is in Ishima's underground sewer systems. Your task is to investigate the sewer systems, and eliminate Samizdat. They must never publish anything again.",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}),X["Operation Titan"]=new J({name:"Operation Titan",desc:"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.

Your goal is to enter and destroy the Bioengineering department's facility in 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.",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}),X["Operation Ares"]=new J({name:"Operation Ares",desc:"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.

Your task is to intercept the deal. Leave no survivors.",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}),X["Operation Archangel"]=new J({name:"Operation Archangel",desc:"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.

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.",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}),X["Operation Juggernaut"]=new J({name:"Operation Juggernaut",desc:"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 Sector-12. We also have reason to believe the 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.

Your mission is to eradicate Juggernaut and his followers.",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}),X["Operation Red Dragon"]=new J({name:"Operation Red Dragon",desc:"The 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.

Your task is to infiltrate and destroy the Tetrads' base of operations in Los Angeles. Intelligence tells us that their base houses one of their Synthoid manufacturing units.",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}),X["Operation K"]=new J({name:"Operation K",desc:"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.

We do not have the power or jurisdiction to shutdown this down through legal or political means, so we must resort to a covert operation. Your goal is to destroy this technology and eliminateanyone who was involved in its creation.",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}),X["Operation Deckard"]=new J({name:"Operation Deckard",desc:"Despite your success in eliminating VitaLife's new android-replicating technology in Operation K, 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.The goal of Operation Deckard is to hunt down these Synthoids and retire them. I don't need to tell you how critical this mission is.",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}),X["Operation Tyrell"]=new J({name:"Operation Tyrell",desc:"A week ago Blade Industries reported a small break-in at one of their Aevum Augmentation storage facitilities. We figured out that The Dark Army 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.

We cannot have Synthoids upgrading their already-enhanced abilities with Augmentations. Your task is to hunt down the associated Dark Army members and eliminate them.",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}),X["Operation Wallace"]=new J({name:"Operation Wallace",desc:"Based on information gathered from Operation Tyrell, we've discovered that The Dark Army was well aware that there were Synthoids amongst their ranks. Even worse, we believe that The Dark Army is working together with other criminal organizations such as The Syndicate and that they are planning some sort of large-scale takeover of multiple major cities, most notably Aevum. We suspect that Synthoids have infiltrated the ranks of these criminal factions and are trying to stage another Synthoid uprising.

The best way to deal with this is to prevent it before it even happens. The goal of Operation Wallace is to destroy the Dark Army and Syndicate factions in Aevum immediately. Leave no survivors.",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}),X["Operation Shoulder of Orion"]=new J({name:"Operation Shoulder of Orion",desc:"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.

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.",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}),X["Operation Hyron"]=new J({name:"Operation Hyron",desc:"Our intelligence tells us that Fulcrum Technologies 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.

I do not need to remind you why sentient-level AIs pose a serious thread to all of mankind.

The research for this project is being conducted at one of Fulcrum Technologies secret facilities in Aevum, codenamed 'Alpha Ranch'. Infiltrate the compound, delete and destroy the work, and then find and kill the project lead.",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}),X["Operation Morpheus"]=new J({name:"Operation Morpheus",desc:"DreamSense Technologies is an advertising company that uses special technology to transmit their ads into the peoples dreams and subconcious. They do this using broadcast transmitter towers. Based on information from our agents and informants in Chonqging, 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.

The mission is to destroy this broadcast tower. Speed and stealth are of the upmost important for this.",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}),X["Operation Ion Storm"]=new J({name:"Operation Ion Storm",desc:"Our analysts have uncovered a gathering of MK-VI Synthoids that have taken up residence in the Sector-12 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.

This is a full-scale assault operation to find and retire all of these Synthoids in the Sector-12 Slums.",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}),X["Operation Annihilus"]=new J({name:"Operation Annihilus",desc:"Our superiors have ordered us to eradicate everything and everyone in an underground facility located in Aevum. They tell us that the facility houses many dangerous Synthoids and belongs to a terrorist organization called 'The Covenant'. We have no prior intelligence about this organization, so you are going in blind.",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}),X["Operation Ultron"]=new J({name:"Operation Ultron",desc:"OmniTek Incorporated, 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.

OmniTek 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 Volhaven to form a terrorist group called Ultron.

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).

Your task is to find and destroy Ultron.",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}),X["Operation Centurion"]=new J({name:"Operation Centurion",desc:"D)@#)($M)C0293c40($*)@#D0JUMP3Rm0C<*@#)*$)#02c94830c(#$*D)

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.

It seems that the universe is not without a sense of irony.

D)@#)($M)C0293c40($*)@#D0JUMP3Rm0C<*@#)*$)#02c94830c(#$*D)",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}}),X["Operation Vindictus"]=new J({name:"Operation Vindictus",desc:"D)@#)($M)C0293c40($*)@#D0JUMP3Rm0C<*@#)*$)#02c94830c(#$*D)

The bits are all around us. The daemons that hold the Node together can manifest themselves in many different ways.

D)@#)($M)C0293c40($*)@#D0JUMP3Rm0C<*@#)*$)#02c94830c(#$*D)",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}}),X["Operation Daedalus"]=new J({name:"Operation Daedalus",desc:"Yesterday we obeyed kings and bent our neck to emperors. Today we kneel only to truth.",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}})}(),this.initializeDomElementRefs(),e.new&&this.create()}Q.prototype.prestige=function(){this.resetAction();var e=c.Factions.Bladeburners;this.rank>=25&&Object(u.c)(e)},Q.prototype.create=function(){this.contracts.Tracking=new z({name:"Tracking",desc:"Identify and locate Synthoids. This contract involves reconnaissance and information-gathering ONLY. Do NOT engage. Stealth is of the utmost importance.

Successfully completing Tracking contracts will slightly improve your Synthoid population estimate for whatever city you are currently in.",baseDifficulty:125,difficultyFac:1.02,rewardFac:1.041,rankGain:.3,hpLoss:.5,count:Object(A.getRandomInt)(25,150),countGrowth:Object(A.getRandomInt)(5,75)/10,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 z({name:"Bounty Hunter",desc:"Hunt down and capture fugitive Synthoids. These Synthoids are wanted alive.

Successfully completing a Bounty Hunter contract will lower the population in your current city, and will also increase its chaos level.",baseDifficulty:250,difficultyFac:1.04,rewardFac:1.085,rankGain:.9,hpLoss:1,count:Object(A.getRandomInt)(5,150),countGrowth:Object(A.getRandomInt)(5,75)/10,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 z({name:"Retirement",desc:"Hunt down and retire (kill) rogue Synthoids.

Successfully copmleting a Retirement contract will lower the population in your current city, and will also increase its chaos level.",baseDifficulty:200,difficultyFac:1.03,rewardFac:1.065,rankGain:.6,hpLoss:1,count:Object(A.getRandomInt)(5,150),countGrowth:Object(A.getRandomInt)(5,75)/10,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 V({name:"Investigation",desc:"As a field agent, investigate and identify Synthoid populations, movements, and operations.

Successful Investigation ops will increase the accuracy of your synthoid data.

You will NOT lose HP from failed Investigation ops.",baseDifficulty:400,difficultyFac:1.03,rewardFac:1.07,reqdRank:25,rankGain:2.2,rankLoss:.2,count:Object(A.getRandomInt)(1,100),countGrowth:Object(A.getRandomInt)(10,40)/10,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 V({name:"Undercover Operation",desc:"Conduct undercover operations to identify hidden and underground Synthoid communities and organizations.

Successful Undercover ops will increase the accuracy of your synthoid data.",baseDifficulty:500,difficultyFac:1.04,rewardFac:1.09,reqdRank:100,rankGain:4.4,rankLoss:.4,hpLoss:2,count:Object(A.getRandomInt)(1,100),countGrowth:Object(A.getRandomInt)(10,40)/10,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 V({name:"Sting Operation",desc:"Conduct a sting operation to bait and capture particularly notorious Synthoid criminals.",baseDifficulty:650,difficultyFac:1.04,rewardFac:1.095,reqdRank:500,rankGain:5.5,rankLoss:.5,hpLoss:2.5,count:Object(A.getRandomInt)(1,150),countGrowth:Object(A.getRandomInt)(3,40)/10,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 V({name:"Raid",desc:"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",baseDifficulty:800,difficultyFac:1.045,rewardFac:1.1,reqdRank:3e3,rankGain:55,rankLoss:2.5,hpLoss:50,count:Object(A.getRandomInt)(1,150),countGrowth:Object(A.getRandomInt)(2,40)/10,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 V({name:"Stealth Retirement Operation",desc:"Lead a covert operation to retire Synthoids. The objective is to complete the task without drawing any attention. Stealth and discretion are key.",baseDifficulty:1e3,difficultyFac:1.05,rewardFac:1.11,reqdRank:2e4,rankGain:22,rankLoss:2,hpLoss:10,count:Object(A.getRandomInt)(1,150),countGrowth:Object(A.getRandomInt)(1,20)/10,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 V({name:"Assassination",desc:"Assassinate Synthoids that have been identified as important, high-profile social and political leaders in the Synthoid communities.",baseDifficulty:1500,difficultyFac:1.06,rewardFac:1.14,reqdRank:5e4,rankGain:44,rankLoss:4,hpLoss:5,count:Object(A.getRandomInt)(1,150),countGrowth:Object(A.getRandomInt)(1,20)/10,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})},Q.prototype.storeCycles=function(e=1){this.storedCycles+=e},Q.prototype.process=function(){if(!1===m.b&&this.blackops.hasOwnProperty("Operation Daedalus"))return Object(m.a)(h.a.bitNodeN);if(!1===a.Augmentations[r.AugmentationNames.BladesSimulacrum].owned&&h.a.isWorking){if(this.action.type!==$.Idle){let e="Your Bladeburner action was cancelled because you started doing something else.";this.automateEnabled&&(e+="

Your automation was disabled as well. You will have to re-enable it through the Bladeburner console",this.automateEnabled=!1),Object(y.dialogBoxCreate)(e)}this.resetAction()}if(this.stamina<=0&&(this.log("Your Bladeburner action was cancelled because your stamina hit 0"),this.resetAction()),this.storedCycles>=5){var e=Math.floor(this.storedCycles/5);for(var t in e=Math.min(e,5),this.storedCycles-=5*e,this.calculateMaxStamina(),this.stamina+=this.calculateStaminaGainPerSecond()*e,this.stamina=Math.min(this.maxStamina,this.stamina),this.contracts)if(this.contracts.hasOwnProperty(t)){var n=this.contracts[t];n.count+=e*n.countGrowth/480}for(var i in this.operations)if(this.operations.hasOwnProperty(i)){var o=this.operations[i];o.count+=e*o.countGrowth/480}for(var s=0;s=this.automateThreshHigh&&(this.action.name===this.automateActionHigh.name&&this.action.type===this.automateActionHigh.type||(this.action=new Y({type:this.automateActionHigh.type,name:this.automateActionHigh.name}),this.startAction(this.action)))),S.routing.isOn(S.Page.Bladeburner)&&this.updateContent()}},Q.prototype.calculateMaxStamina=function(){var e=h.a.agility*this.skillMultipliers.effAgi,t=Math.pow(e,.8)+this.staminaBonus;if(t*=this.skillMultipliers.stamina,t*=h.a.bladeburner_max_stamina_mult,isNaN(t))throw new Error("Max Stamina calculated to be NaN in Bladeburner.calculateMaxStamina()");this.maxStamina=t},Q.prototype.calculateStaminaGainPerSecond=function(){var e=h.a.agility*this.skillMultipliers.effAgi;return(.0085+this.maxStamina/7e4)*Math.pow(e,.17)*(this.skillMultipliers.stamina*h.a.bladeburner_stamina_gain_mult)},Q.prototype.calculateStaminaPenalty=function(){return Math.min(1,this.stamina/(.5*this.maxStamina))},Q.prototype.changeRank=function(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);if(Object(c.factionExists)("Bladeburners")){var t=c.Factions.Bladeburners;if(!(t instanceof l.Faction))throw new Error("Could not properly get Bladeburner Faction object in Bladeburner UI Overview Faction button");if(t.isMember){var n=1+t.favor/100;t.playerReputation+=2*e*h.a.faction_rep_mult*n}}var a=3*(this.totalSkillPoints+1);if(this.maxRank>=a){var r=Math.floor((this.maxRank-a)/3+1);this.skillPoints+=r,this.totalSkillPoints+=r}},Q.prototype.getCurrentCity=function(){var e=this.cities[this.city];if(!(e instanceof F))throw new Error("Bladeburner.getCurrentCity() did not properly return a City object");return e},Q.prototype.resetSkillMultipliers=function(){this.skillMultipliers={successChanceAll:1,successChanceStealth:1,successChanceKill:1,successChanceContract:1,successChanceOperation:1,successChanceEstimate:1,actionTime:1,effHack:1,effStr:1,effDef:1,effDex:1,effAgi:1,effCha:1,effInt:1,stamina:1,money:1,expGain:1,weaponAbility:1,gunAbility:1}},Q.prototype.updateSkillMultipliers=function(){for(var e in this.resetSkillMultipliers(),this.skills)if(this.skills.hasOwnProperty(e)){var t=H[e];if(null==t)throw new Error("Could not find Skill Object for: "+e);var n=this.skills[e];if(null==n||n<=0)continue;for(var a=Object.keys(this.skillMultipliers),r=0;r=this.actionTimeToComplete?this.completeAction():void 0}},Q.prototype.completeAction=function(){switch(this.action.type){case $.Contract:case $.Operation:try{var e=this.action.type===$.Operation;if(null==(p=this.getActionObject(this.action)))throw new Error("Failed to get Contract/Operation Object for: "+this.action.name);var t=p.getDifficulty(),n=Math.pow(t,.28)+t/650,a=Math.pow(p.rewardFac,p.level-1);if(this.stamina-=.285*n,this.stamina<0&&(this.stamina=0),p.attempt(this)){this.gainActionStats(p,!0),++p.successes,--p.count;var r=0;if(e||(r=25e4*a*this.skillMultipliers.money,h.a.gainMoney(r),h.a.recordMoneySource(r,"bladeburner")),e?p.setMaxLevel(2.5):p.setMaxLevel(3),p.rankGain){var s=Object(E.addOffset)(p.rankGain*a*i.BitNodeMultipliers.BladeburnerRank,10);this.changeRank(s),e&&this.logging.ops?this.log(p.name+" successfully completed! Gained "+Object(P.formatNumber)(s,3)+" rank"):!e&&this.logging.contracts&&this.log(p.name+" contract successfully completed! Gained "+Object(P.formatNumber)(s,3)+" rank and "+d.numeralWrapper.format(r,"$0.000a"))}e?this.completeOperation(!0):this.completeContract(!0)}else{this.gainActionStats(p,!1),++p.failures;var l=0,c=0;p.rankLoss&&(l=Object(E.addOffset)(p.rankLoss*a,10),this.changeRank(-1*l)),p.hpLoss&&(c=p.hpLoss*n,c=Math.ceil(Object(E.addOffset)(c,10)),this.hpLost+=c,h.a.takeDamage(c)&&(++this.numHosp,this.moneyLost+=o.CONSTANTS.HospitalCostPerHp*h.a.max_hp));var u="";l>0&&(u+="Lost "+Object(P.formatNumber)(l,3)+" rank."),c>0&&(u+="Took "+Object(P.formatNumber)(c,0)+" damage."),e&&this.logging.ops?this.log(p.name+" failed! "+u):!e&&this.logging.contracts&&this.log(p.name+" contract failed! "+u),e?this.completeOperation(!1):this.completeContract(!1)}p.autoLevel&&(p.level=p.maxLevel),this.startAction(this.action)}catch(e){Object(M.exceptionAlert)(e)}break;case $.BlackOp:case $.BlackOperation:try{var p;if(null==(p=this.getActionObject(this.action))||!(p instanceof J))throw new Error("Failed to get BlackOperation Object for: "+this.action.name);t=p.getDifficulty(),n=Math.pow(t,.28)+t/650;this.stamina-=.285*n,this.stamina<0&&(this.stamina=0);var g,_=p.teamCount;if(p.attempt(this)){this.gainActionStats(p,!0),p.count=0,this.blackops[p.name]=!0;var f=0;if(p.rankGain&&(f=Object(E.addOffset)(p.rankGain*i.BitNodeMultipliers.BladeburnerRank,10),this.changeRank(f)),g=Math.ceil(_/2),"Operation Daedalus"===p.name)return this.resetAction(),Object(m.a)(h.a.bitNodeN);S.routing.isOn(S.Page.Bladeburner)&&this.createActionAndSkillsContent(),this.logging.blackops&&this.log(p.name+" successful! Gained "+Object(P.formatNumber)(f,1)+" rank")}else{this.gainActionStats(p,!1);var y=0;c=0;p.rankLoss&&(y=Object(E.addOffset)(p.rankLoss,10),this.changeRank(-1*y)),p.hpLoss&&(c=p.hpLoss*n,c=Math.ceil(Object(E.addOffset)(c,10)),h.a.takeDamage(c)&&(++this.numHosp,this.moneyLost+=o.CONSTANTS.HospitalCostPerHp*h.a.max_hp)),g=Math.floor(_),this.logging.blackops&&this.log(p.name+" failed! Lost "+Object(P.formatNumber)(y,1)+" rank and took "+Object(P.formatNumber)(c,0)+" damage")}if(this.resetAction(),_>=1){var b=Object(A.getRandomInt)(1,g);this.teamSize-=b,this.teamLost+=b,this.logging.blackops&&this.log("You lost "+Object(P.formatNumber)(b,0)+" team members during "+p.name)}}catch(e){Object(M.exceptionAlert)(e)}break;case $.Training:this.stamina-=.1425;var v=30*h.a.strength_exp_mult,k=30*h.a.defense_exp_mult,C=30*h.a.dexterity_exp_mult,O=30*h.a.agility_exp_mult,T=.04*this.skillMultipliers.stamina;h.a.gainStrengthExp(v),h.a.gainDefenseExp(k),h.a.gainDexterityExp(C),h.a.gainAgilityExp(O),this.staminaBonus+=T,this.logging.general&&this.log("Training completed. Gained: "+Object(P.formatNumber)(v,1)+" str exp, "+Object(P.formatNumber)(k,1)+" def exp, "+Object(P.formatNumber)(C,1)+" dex exp, "+Object(P.formatNumber)(O,1)+" agi exp, "+Object(P.formatNumber)(T,3)+" max stamina"),this.startAction(this.action);break;case $.FieldAnalysis:case $["Field Analysis"]:var w=.04*Math.pow(h.a.hacking_skill,.3)+.04*Math.pow(h.a.intelligence,.9)+.02*Math.pow(h.a.charisma,.3);if(w*=h.a.bladeburner_analysis_mult,isNaN(w)||w<0)throw new Error("Field Analysis Effectiveness calculated to be NaN or negative");var x=20*h.a.hacking_exp_mult,R=20*h.a.charisma_exp_mult;h.a.gainHackingExp(x),h.a.gainIntelligenceExp(.001),h.a.gainCharismaExp(R),this.changeRank(.1*i.BitNodeMultipliers.BladeburnerRank),this.getCurrentCity().improvePopulationEstimateByPercentage(w*this.skillMultipliers.successChanceEstimate),this.logging.general&&this.log("Field analysis completed. Gained 0.1 rank, "+Object(P.formatNumber)(x,1)+" hacking exp, and "+Object(P.formatNumber)(R,1)+" charisma exp"),this.startAction(this.action);break;case $.Recruitment:var N=this.getRecruitmentSuccessChance();if(Math.random()=1){n=e?Math.ceil(a/2):Math.floor(a);var r=Object(A.getRandomInt)(0,n);this.teamSize-=r,this.teamLost+=r,this.logging.ops&&r>0&&this.log("Lost "+Object(P.formatNumber)(r,0)+" team members during this "+t.name)}var i=this.getCurrentCity();switch(t.name){case"Investigation":e?(i.improvePopulationEstimateByPercentage(.4*this.skillMultipliers.successChanceEstimate),Math.random()<.02*this.skillMultipliers.successChanceEstimate&&i.improveCommunityEstimate(1)):this.triggerPotentialMigration(this.city,.1);break;case"Undercover Operation":e?(i.improvePopulationEstimateByPercentage(.8*this.skillMultipliers.successChanceEstimate),Math.random()<.02*this.skillMultipliers.successChanceEstimate&&i.improveCommunityEstimate(1)):this.triggerPotentialMigration(this.city,.15);break;case"Sting Operation":e&&i.changePopulationByPercentage(-.1,{changeEstEqually:!0,nonZero:!0}),i.changeChaosByCount(.1);break;case"Raid":if(e)i.changePopulationByPercentage(-1,{changeEstEqually:!0,nonZero:!0}),--i.comms,--i.commsEst;else{var o=Object(A.getRandomInt)(-10,-5)/10;i.changePopulationByPercentage(o,{nonZero:!0})}i.changeChaosByPercentage(Object(A.getRandomInt)(1,5));break;case"Stealth Retirement Operation":e&&i.changePopulationByPercentage(-.5,{changeEstEqually:!0,nonZero:!0}),i.changeChaosByPercentage(Object(A.getRandomInt)(-3,-1));break;case"Assassination":e&&i.changePopulationByCount(-1,{estChange:-1}),i.changeChaosByPercentage(Object(A.getRandomInt)(-5,5));break;default:throw new Error("Invalid Action name in completeOperation: "+this.action.name)}},Q.prototype.getRecruitmentTime=function(){var e=h.a.charisma*this.skillMultipliers.effCha,t=Math.pow(e,.81)+e/90;return Math.max(10,Math.round(300-t))},Q.prototype.getRecruitmentSuccessChance=function(){return Math.pow(h.a.charisma,.45)/(this.teamSize+1)},Q.prototype.getDiplomacyEffectiveness=function(){return(100-(Math.pow(h.a.charisma,.045)+h.a.charisma/1e3))/100},Q.prototype.gainActionStats=function(e,t){var n=e.getDifficulty(),a=Math.pow(n,.28)+n/650,r=this.actionTimeToComplete,i=t?1:.5,o=1*r*i*a,s=.001*r*i*a;const l=this.skillMultipliers.expGain;h.a.gainHackingExp(o*e.weights.hack*h.a.hacking_exp_mult*l),h.a.gainStrengthExp(o*e.weights.str*h.a.strength_exp_mult*l),h.a.gainDefenseExp(o*e.weights.def*h.a.defense_exp_mult*l),h.a.gainDexterityExp(o*e.weights.dex*h.a.dexterity_exp_mult*l),h.a.gainAgilityExp(o*e.weights.agi*h.a.agility_exp_mult*l),h.a.gainCharismaExp(o*e.weights.cha*h.a.charisma_exp_mult*l),h.a.gainIntelligenceExp(s*e.weights.int*l)},Q.prototype.randomEvent=function(){var e=Math.random(),t=L[Object(A.getRandomInt)(0,5)],n=this.cities[t];if(!(n instanceof F))throw new Error("sourceCity was not a City object in Bladeburner.randomEvent()");for(var a=L[Object(A.getRandomInt)(0,5)];a===t;)a=L[Object(A.getRandomInt)(0,5)];var r=this.cities[a];if(!(n instanceof F&&r instanceof F))throw new Error("sourceCity/destCity was not a City object in Bladeburner.randomEvent()");if(e<=.05){++n.comms;var i=Object(A.getRandomInt)(10,20)/100,o=Math.round(n.pop*i);n.pop+=o,this.logging.events&&this.log("Intelligence indicates that a new Synthoid community was formed in a city")}else if(e<=.1)if(n.comms<=0){++n.comms;i=Object(A.getRandomInt)(10,20)/100,o=Math.round(n.pop*i);n.pop+=o,this.logging.events&&this.log("Intelligence indicates that a new Synthoid community was formed in a city")}else{--n.comms,++r.comms;i=Object(A.getRandomInt)(10,20)/100,o=Math.round(n.pop*i);n.pop-=o,r.pop+=o,this.logging.events&&this.log("Intelligence indicates that a Synthoid community migrated from "+t+" to some other city")}else if(e<=.3){i=Object(A.getRandomInt)(8,24)/100,o=Math.round(n.pop*i);n.pop+=o,this.logging.events&&this.log("Intelligence indicates that the Synthoid population of "+t+" just changed significantly")}else if(e<=.5)this.triggerMigration(t),this.logging.events&&this.log("Intelligence indicates that a large number of Synthoids migrated from "+t+" to some other city");else if(e<=.7)n.chaos+=1,n.chaos*=1+Object(A.getRandomInt)(5,20)/100,this.logging.events&&this.log("Tensions between Synthoids and humans lead to riots in "+t+"! Chaos increased");else if(e<=.9){i=Object(A.getRandomInt)(8,20)/100,o=Math.round(n.pop*i);n.pop-=o,this.logging.events&&this.log("Intelligence indicates that the Synthoid population of "+t+" just changed significantly")}},Q.prototype.triggerPotentialMigration=function(e,t){(null==t||isNaN(t))&&console.log("ERROR: Invalid 'chance' parameter passed into Bladeburner.triggerPotentialMigration()"),t>1&&(t/=100),Math.random()0&&(i*=Object(A.getRandomInt)(2,4),--a.comms,++n.comms);var o=Math.round(a.pop*i);a.pop-=o,n.pop+=o};var Z={};Q.prototype.initializeDomElementRefs=function(){Z={bladeburnerDiv:null,overviewConsoleParentDiv:null,overviewDiv:null,actionAndSkillsDiv:null,currentTab:null,consoleDiv:null,consoleTable:null,consoleInputRow:null,consoleInputCell:null,consoleInputHeader:null,consoleInput:null,overviewRank:null,overviewStamina:null,overviewStaminaHelpTip:null,overviewGen1:null,overviewEstPop:null,overviewEstPopHelpTip:null,overviewEstComms:null,overviewChaos:null,overviewSkillPoints:null,overviewBonusTime:null,overviewAugSuccessMult:null,overviewAugMaxStaminaMult:null,overviewAugStaminaGainMult:null,overviewAugAnalysisMult:null,actionsAndSkillsDesc:null,actionsAndSkillsList:null,generalActions:{},contracts:{},operations:{},blackops:{},skills:{},skillPointsDisplay:null}},Q.prototype.createContent=function(){Z.bladeburnerDiv=Object(O.createElement)("div",{id:"bladeburner-container",position:"fixed",class:"generic-menupage-container"}),Z.overviewConsoleParentDiv=Object(O.createElement)("div",{height:"60%",display:"block",position:"relative"}),Z.overviewDiv=Object(O.createElement)("div",{width:"30%",display:"inline-block",border:"1px solid white"}),Z.actionAndSkillsDiv=Object(O.createElement)("div",{height:"60%",width:"70%",display:"block",border:"1px solid white",margin:"6px",padding:"6px"}),Z.currentTab="general",this.createOverviewContent(),this.createActionAndSkillsContent(),Z.consoleDiv=Object(O.createElement)("div",{class:"bladeburner-console-div",clickListener:()=>(Z.consoleInput instanceof Element&&Z.consoleInput.focus(),!1)}),Z.consoleTable=Object(O.createElement)("table",{class:"bladeburner-console-table"}),Z.consoleInputRow=Object(O.createElement)("tr",{class:"bladeburner-console-input-row",id:"bladeubrner-console-input-row"}),Z.consoleInputCell=Object(O.createElement)("td",{class:"bladeburner-console-input-cell"}),Z.consoleInputHeader=Object(O.createElement)("pre",{innerText:"> "}),Z.consoleInput=Object(O.createElement)("input",{type:"text",class:"bladeburner-console-input",tabIndex:1,onfocus:()=>{Z.consoleInput.value=Z.consoleInput.value}}),Z.consoleInputCell.appendChild(Z.consoleInputHeader),Z.consoleInputCell.appendChild(Z.consoleInput),Z.consoleInputRow.appendChild(Z.consoleInputCell),Z.consoleTable.appendChild(Z.consoleInputRow),Z.consoleDiv.appendChild(Z.consoleTable),Z.overviewConsoleParentDiv.appendChild(Z.overviewDiv),Z.overviewConsoleParentDiv.appendChild(Z.consoleDiv),Z.bladeburnerDiv.appendChild(Z.overviewConsoleParentDiv),Z.bladeburnerDiv.appendChild(Z.actionAndSkillsDiv);const e=Object(O.createElement)("div");if(e.innerHTML=`${N}= This action requires stealth, ${I} = This action involves retirement`,Z.bladeburnerDiv.appendChild(e),document.getElementById("entire-game-container").appendChild(Z.bladeburnerDiv),0===this.consoleLogs.length)this.postToConsole("Bladeburner Console BETA"),this.postToConsole("Type 'help' to see console commands");else for(let e=0;e{Object(y.dialogBoxCreate)("Performing actions will use up your stamina.

Your max stamina is determined primarily by your agility stat.

Your stamina gain rate is determined by both your agility and your max stamina. Higher max stamina leads to a higher gain rate.

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).

Your max stamina and stamina gain rate can also be increased by training, or through skills and Augmentation upgrades.")}}),Z.overviewGen1=Object(O.createElement)("p",{display:"block"}),Z.overviewEstPop=Object(O.createElement)("p",{innerText:"Est. Synthoid Population: ",display:"inline-block",tooltip:"This is your Bladeburner division's estimate of how many Synthoids exist in your current city."}),Z.overviewEstPopHelpTip=Object(O.createElement)("div",{innerText:"?",class:"help-tip",clickListener:()=>{Object(y.dialogBoxCreate)("The success rate of your contracts/operations depends on the population of Synthoids in your current city. The success rate that is shown to you is only an estimate, and it is based on your Synthoid population estimate.

Therefore, it is important that this Synthoid population estimate is accurate so that you have a better idea of your success rate for contracts/operations. Certain actions will increase the accuracy of your population estimate.

The Synthoid populations of cities can change due to your actions or random events. If random events occur, they will be logged in the Bladeburner Console.")}}),Z.overviewEstComms=Object(O.createElement)("p",{innerText:"Est. Synthoid Communities: ",display:"inline-block",tooltip:"This is your Bladeburner divison's estimate of how many Synthoid communities exist in your current city."}),Z.overviewChaos=Object(O.createElement)("p",{innerText:"City Chaos: ",display:"inline-block",tooltip:"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."}),Z.overviewBonusTime=Object(O.createElement)("p",{innerText:"Bonus time: ",display:"inline-block",tooltip:"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."}),Z.overviewSkillPoints=Object(O.createElement)("p",{display:"block"}),Z.overviewAugSuccessMult=Object(O.createElement)("p",{display:"block"}),Z.overviewAugMaxStaminaMult=Object(O.createElement)("p",{display:"block"}),Z.overviewAugStaminaGainMult=Object(O.createElement)("p",{display:"block"}),Z.overviewAugAnalysisMult=Object(O.createElement)("p",{display:"block"}),Z.overviewDiv.appendChild(Z.overviewRank),Object(k.appendLineBreaks)(Z.overviewDiv,1),Z.overviewDiv.appendChild(Z.overviewStamina),Z.overviewDiv.appendChild(Z.overviewStaminaHelpTip),Z.overviewDiv.appendChild(Z.overviewGen1),Z.overviewDiv.appendChild(Z.overviewEstPop),Z.overviewDiv.appendChild(Z.overviewEstPopHelpTip),Object(k.appendLineBreaks)(Z.overviewDiv,1),Z.overviewDiv.appendChild(Z.overviewEstComms),Object(k.appendLineBreaks)(Z.overviewDiv,1),Z.overviewDiv.appendChild(Z.overviewChaos),Object(k.appendLineBreaks)(Z.overviewDiv,2),Z.overviewDiv.appendChild(Z.overviewBonusTime),Z.overviewDiv.appendChild(Z.overviewSkillPoints),Object(k.appendLineBreaks)(Z.overviewDiv,1),Z.overviewDiv.appendChild(Z.overviewAugSuccessMult),Z.overviewDiv.appendChild(Z.overviewAugMaxStaminaMult),Z.overviewDiv.appendChild(Z.overviewAugStaminaGainMult),Z.overviewDiv.appendChild(Z.overviewAugAnalysisMult),Object(k.appendLineBreaks)(Z.overviewDiv,1),Z.overviewDiv.appendChild(Object(O.createElement)("a",{innerHTML:"Travel",class:"a-link-button",display:"inline-block",clickListener:()=>{var e="bladeburner-travel-popup-cancel-btn",t=[];t.push(Object(O.createElement)("a",{innerText:"Cancel",class:"a-link-button",clickListener:()=>(Object(R.removeElementById)(e),!1)})),t.push(Object(O.createElement)("p",{innerText:"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"}));for(var n=0;n(n.city=L[a],Object(R.removeElementById)(e),n.updateOverviewContent(),!1)}))}(this,n);Object(T.createPopup)(e,t)}}));if(Object(c.factionExists)("Bladeburners")){var e=c.Factions.Bladeburners;if(!(e instanceof l.Faction))throw new Error("Could not properly get Bladeburner Faction object in Bladeburner UI Overview Faction button");Z.overviewDiv.appendChild(Object(O.createElement)("a",{innerText:"Faction",class:"a-link-button",display:"inline-block",tooltip:"Apply to the Bladeburner Faction, or go to the faction page if you are already a member",clickListener:()=>(e.isMember?(s.Engine.loadFactionContent(),Object(u.a)("Bladeburners")):this.rank>=25?(Object(u.c)(e),Object(y.dialogBoxCreate)("Congratulations! You were accepted into the Bladeburners faction"),Object(b.removeChildrenFromElement)(Z.overviewDiv),this.createOverviewContent()):Object(y.dialogBoxCreate)("You need a rank of 25 to join the Bladeburners Faction!"),!1)}))}Z.overviewDiv.appendChild(Object(O.createElement)("br")),Z.overviewDiv.appendChild(Object(O.createElement)("br")),this.updateOverviewContent()},Q.prototype.createActionAndSkillsContent=function(){null==Z.currentTab&&(Z.currentTab="general"),Object(b.removeChildrenFromElement)(Z.actionAndSkillsDiv),Object(C.clearObject)(Z.generalActions),Object(C.clearObject)(Z.contracts),Object(C.clearObject)(Z.operations),Object(C.clearObject)(Z.blackops),Object(C.clearObject)(Z.skills);for(var e=Z.currentTab.toLowerCase(),t=["General","Contracts","Operations","BlackOps","Skills"],n=0;n(Z.currentTab=e[t].toLowerCase(),n.createActionAndSkillsContent(),!1)}))}(t,n,this,e);switch(Z.actionsAndSkillsDesc=Object(O.createElement)("p",{display:"block",margin:"4px",padding:"4px"}),Object(b.removeChildrenFromElement)(Z.actionsAndSkillsList),Z.actionsAndSkillsList=Object(O.createElement)("ul"),e){case"general":this.createGeneralActionsContent();break;case"contracts":this.createContractsContent();break;case"operations":this.createOperationsContent();break;case"blackops":this.createBlackOpsContent();break;case"skills":this.createSkillsContent();break;default:throw new Error("Invalid value for DomElems.currentTab in Bladeburner.createActionAndSkillsContent")}this.updateContent(),Z.actionAndSkillsDiv.appendChild(Z.actionsAndSkillsDesc),Z.actionAndSkillsDiv.appendChild(Z.actionsAndSkillsList)},Q.prototype.createGeneralActionsContent=function(){if(null==Z.actionsAndSkillsList||null==Z.actionsAndSkillsDesc)throw new Error("Bladeburner.createGeneralActionsContent called with either DomElems.actionsAndSkillsList or DomElems.actionsAndSkillsDesc = null");for(var e in Z.actionsAndSkillsDesc.innerText="These are generic actions that will assist you in your Bladeburner duties. They will not affect your Bladeburner rank in any way.",q)q.hasOwnProperty(e)&&(Z.generalActions[e]=Object(O.createElement)("div",{class:"bladeburner-action",name:e}),Z.actionsAndSkillsList.appendChild(Z.generalActions[e]))},Q.prototype.createContractsContent=function(){if(null==Z.actionsAndSkillsList||null==Z.actionsAndSkillsDesc)throw new Error("Bladeburner.createContractsContent called with either DomElems.actionsAndSkillsList or DomElems.actionsAndSkillsDesc = null");for(var e in Z.actionsAndSkillsDesc.innerHTML="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.

You can unlock higher-level contracts by successfully completing them. Higher-level contracts are more difficult, but grant more rank, experience, and money.",this.contracts)this.contracts.hasOwnProperty(e)&&(Z.contracts[e]=Object(O.createElement)("div",{class:"bladeburner-action",name:e}),Z.actionsAndSkillsList.appendChild(Z.contracts[e]))},Q.prototype.createOperationsContent=function(){if(null==Z.actionsAndSkillsList||null==Z.actionsAndSkillsDesc)throw new Error("Bladeburner.createOperationsContent called with either DomElems.actionsAndSkillsList or DomElems.actionsAndSkillsDesc = null");for(var e in Z.actionsAndSkillsDesc.innerHTML="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.

Operations can affect the chaos level and Synthoid population of your current city. The exact effects vary between different Operations.

For operations, you can use a team. You must first recruit team members. Having a larger team will improves your chances of success.

You can unlock higher-level operations by successfully completing them. Higher-level operations are more difficult, but grant more rank and experience.",this.operations)this.operations.hasOwnProperty(e)&&(Z.operations[e]=Object(O.createElement)("div",{class:"bladeburner-action",name:e}),Z.actionsAndSkillsList.appendChild(Z.operations[e]))},Q.prototype.createBlackOpsContent=function(){if(null==Z.actionsAndSkillsList||null==Z.actionsAndSkillsDesc)throw new Error("Bladeburner.createBlackOpsContent called with either DomElems.actionsAndSkillsList or DomElems.actionsAndSkillsDesc = null");Z.actionsAndSkillsDesc.innerHTML="Black Operations (Black Ops) are special, one-time covert operations. Each Black Op must be unlocked successively by completing the one before it.

Your ultimate goal to climb through the ranks of Bladeburners is to complete all of the Black Ops.

Like normal operations, you may use a team for Black Ops. Failing a black op will incur heavy HP and rank losses.";var e=[];for(var t in X)X.hasOwnProperty(t)&&e.push(X[t]);e.sort(function(e,t){return e.reqdRank-t.reqdRank});for(var n=e.length-1;n>=0;--n)null==this.blackops[[e[n].name]]&&0!==n&&null==this.blackops[[e[n-1].name]]||(Z.blackops[e[n].name]=Object(O.createElement)("div",{class:"bladeburner-action",name:e[n].name}),Z.actionsAndSkillsList.appendChild(Z.blackops[e[n].name]))},Q.prototype.createSkillsContent=function(){if(null==Z.actionsAndSkillsList||null==Z.actionsAndSkillsDesc)throw new Error("Bladeburner.createSkillsContent called with either DomElems.actionsAndSkillsList or DomElems.actionsAndSkillsDesc = null");Z.actionsAndSkillsDesc.innerHTML="You will gain one skill point every 3 ranks.

Note that when upgrading a skill, the benefit for that skill is additive. However, the effects of different skills with each other is multiplicative.

";for(var e=Object.keys(this.skillMultipliers),t=0;t";break;case"successChanceStealth":Z.actionsAndSkillsDesc.innerHTML+="Stealth Success Chance: x"+n+"
";break;case"successChanceKill":Z.actionsAndSkillsDesc.innerHTML+="Retirement Success Chance: x"+n+"
";break;case"successChanceContract":Z.actionsAndSkillsDesc.innerHTML+="Contract Success Chance: x"+n+"
";break;case"successChanceOperation":Z.actionsAndSkillsDesc.innerHTML+="Operation Success Chance: x"+n+"
";break;case"successChanceEstimate":Z.actionsAndSkillsDesc.innerHTML+="Synthoid Data Estimate: x"+n+"
";break;case"actionTime":Z.actionsAndSkillsDesc.innerHTML+="Action Time: x"+n+"
";break;case"effHack":Z.actionsAndSkillsDesc.innerHTML+="Hacking Skill: x"+n+"
";break;case"effStr":Z.actionsAndSkillsDesc.innerHTML+="Strength: x"+n+"
";break;case"effDef":Z.actionsAndSkillsDesc.innerHTML+="Defense: x"+n+"
";break;case"effDex":Z.actionsAndSkillsDesc.innerHTML+="Dexterity: x"+n+"
";break;case"effAgi":Z.actionsAndSkillsDesc.innerHTML+="Agility: x"+n+"
";break;case"effCha":Z.actionsAndSkillsDesc.innerHTML+="Charisma: x"+n+"
";break;case"effInt":Z.actionsAndSkillsDesc.innerHTML+="Intelligence: x"+n+"
";break;case"stamina":Z.actionsAndSkillsDesc.innerHTML+="Stamina: x"+n+"
";break;case"money":Z.actionsAndSkillsDesc.innerHTML+="Contract Money: x"+n+"
";break;case"expGain":Z.actionsAndSkillsDesc.innerHTML+="Exp Gain: x"+n+"
";break;case"weaponAbility":case"gunAbility":break;default:console.log("Warning: Unrecognized SkillMult Key: "+e[t])}}for(var a in Z.skillPointsDisplay=Object(O.createElement)("p",{innerHTML:"
Skill Points: "+Object(P.formatNumber)(this.skillPoints,0)+""}),Z.actionAndSkillsDiv.appendChild(Z.skillPointsDisplay),H)H.hasOwnProperty(a)&&(Z.skills[a]=Object(O.createElement)("div",{class:"bladeburner-action",name:a}),Z.actionsAndSkillsList.appendChild(Z.skills[a]))},Q.prototype.updateContent=function(){this.updateOverviewContent(),this.updateActionAndSkillsContent()},Q.prototype.updateOverviewContent=function(){S.routing.isOn(S.Page.Bladeburner)&&(Z.overviewRank.childNodes[0].nodeValue="Rank: "+Object(P.formatNumber)(this.rank,2),Z.overviewStamina.innerText="Stamina: "+Object(P.formatNumber)(this.stamina,3)+" / "+Object(P.formatNumber)(this.maxStamina,3),Z.overviewGen1.innerHTML="Stamina Penalty: "+Object(P.formatNumber)(100*(1-this.calculateStaminaPenalty()),1)+"%

Team Size: "+Object(P.formatNumber)(this.teamSize,0)+"
Team Members Lost: "+Object(P.formatNumber)(this.teamLost,0)+"

Num Times Hospitalized: "+this.numHosp+"
Money Lost From Hospitalizations: "+d.numeralWrapper.format(this.moneyLost,"$0.000a")+"

Current City: "+this.city+"
",Z.overviewEstPop.childNodes[0].nodeValue="Est. Synthoid Population: "+d.numeralWrapper.format(this.getCurrentCity().popEst,"0.000a"),Z.overviewEstComms.childNodes[0].nodeValue="Est. Synthoid Communities: "+Object(P.formatNumber)(this.getCurrentCity().comms,0),Z.overviewChaos.childNodes[0].nodeValue="City Chaos: "+Object(P.formatNumber)(this.getCurrentCity().chaos),Z.overviewSkillPoints.innerText="Skill Points: "+Object(P.formatNumber)(this.skillPoints,0),Z.overviewBonusTime.childNodes[0].nodeValue="Bonus time: "+this.storedCycles/5,Z.overviewAugSuccessMult.innerText="Aug. Success Chance Mult: "+Object(P.formatNumber)(100*h.a.bladeburner_success_chance_mult,1)+"%",Z.overviewAugMaxStaminaMult.innerText="Aug. Max Stamina Mult: "+Object(P.formatNumber)(100*h.a.bladeburner_max_stamina_mult,1)+"%",Z.overviewAugStaminaGainMult.innerText="Aug. Stamina Gain Mult: "+Object(P.formatNumber)(100*h.a.bladeburner_stamina_gain_mult,1)+"%",Z.overviewAugAnalysisMult.innerText="Aug. Field Analysis Mult: "+Object(P.formatNumber)(100*h.a.bladeburner_analysis_mult,1)+"%")},Q.prototype.updateActionAndSkillsContent=function(){switch(null==Z.currentTab&&(Z.currentTab="general"),Z.currentTab.toLowerCase()){case"general":for(var e=Object.keys(Z.generalActions),t=0;t";var d=Object.keys(Z.skills);for(t=0;t(this.action.type=$[t.name],this.action.name=t.name,this.startAction(this.action),this.updateActionAndSkillsContent(),!1)}));Object(k.appendLineBreaks)(e,2),e.appendChild(Object(O.createElement)("pre",{innerHTML:t.desc,display:"inline-block"}))},Q.prototype.updateContractsUIElement=function(e,t){Object(b.removeChildrenFromElement)(e);var n=e.classList.contains(B),a=t.getSuccessChance(this,{est:!0});if(e.appendChild(Object(O.createElement)("h2",{innerText:n?t.name+" (IN PROGRESS - "+Object(P.formatNumber)(this.actionTimeCurrent,0)+" / "+Object(P.formatNumber)(this.actionTimeToComplete,0)+")":t.name,display:"inline-block"})),n){var r=this.actionTimeCurrent/this.actionTimeToComplete;e.appendChild(Object(O.createElement)("p",{display:"block",innerText:Object(f.createProgressBarText)({progress:r})}))}else e.appendChild(Object(O.createElement)("a",{innerText:"Start",class:"a-link-button",padding:"3px",margin:"3px",clickListener:()=>(this.action.type=$.Contract,this.action.name=t.name,this.startAction(this.action),this.updateActionAndSkillsContent(),!1)}));var i=t.level>=t.maxLevel;Object(k.appendLineBreaks)(e,2),e.appendChild(Object(O.createElement)("pre",{display:"inline-block",innerText:"Level: "+t.level+" / "+t.maxLevel,tooltip:t.getSuccessesNeededForNextLevel(3)+" successes needed for next level"})),e.appendChild(Object(O.createElement)("a",{class:i?"a-link-button-inactive":"a-link-button",innerHTML:"↑",padding:"2px",margin:"2px",tooltip:n?"WARNING: changing the level will restart the contract":"",display:"inline",clickListener:()=>(++t.level,n&&this.startAction(this.action),this.updateContractsUIElement(e,t),!1)})),e.appendChild(Object(O.createElement)("a",{class:t.level<=1?"a-link-button-inactive":"a-link-button",innerHTML:"↓",padding:"2px",margin:"2px",tooltip:n?"WARNING: changing the level will restart the contract":"",display:"inline",clickListener:()=>(--t.level,n&&this.startAction(this.action),this.updateContractsUIElement(e,t),!1)}));var o=t.getActionTime(this);Object(k.appendLineBreaks)(e,2),e.appendChild(Object(O.createElement)("pre",{display:"inline-block",innerHTML:t.desc+"\n\n"+`Estimated success chance: ${Object(P.formatNumber)(100*a,1)}% ${t.isStealth?N:""}${t.isKill?I:""}\n`+"Time Required (s): "+Object(P.formatNumber)(o,0)+"\nContracts remaining: "+Math.floor(t.count)+"\nSuccesses: "+t.successes+"\nFailures: "+t.failures})),e.appendChild(Object(O.createElement)("br"));var s="bladeburner-"+t.name+"-autolevel-checkbox";e.appendChild(Object(O.createElement)("label",{for:s,innerText:"Autolevel",color:"white",tooltip:"Automatically increase contract level when possible"}));const l=Object(O.createElement)("div",{class:"bbcheckbox"}),c=Object(O.createElement)("input",{type:"checkbox",id:s,checked:t.autoLevel,changeListener:()=>{t.autoLevel=c.checked}}),u=Object(O.createElement)("label",{for:s});l.appendChild(c),l.appendChild(u),e.appendChild(l)},Q.prototype.updateOperationsUIElement=function(e,t){Object(b.removeChildrenFromElement)(e);var n=e.classList.contains(B),a=t.getSuccessChance(this,{est:!0});if(e.appendChild(Object(O.createElement)("h2",{innerText:n?t.name+" (IN PROGRESS - "+Object(P.formatNumber)(this.actionTimeCurrent,0)+" / "+Object(P.formatNumber)(this.actionTimeToComplete,0)+")":t.name,display:"inline-block"})),n){var r=this.actionTimeCurrent/this.actionTimeToComplete;e.appendChild(Object(O.createElement)("p",{display:"block",innerText:Object(f.createProgressBarText)({progress:r})}))}else e.appendChild(Object(O.createElement)("a",{innerText:"Start",class:"a-link-button",margin:"3px",padding:"3px",clickListener:()=>(this.action.type=$.Operation,this.action.name=t.name,this.startAction(this.action),this.updateActionAndSkillsContent(),!1)})),e.appendChild(Object(O.createElement)("a",{innerText:"Set Team Size (Curr Size: "+Object(P.formatNumber)(t.teamCount,0)+")",class:"a-link-button",margin:"3px",padding:"3px",clickListener:()=>{var n="bladeburner-operation-set-team-size-popup",a=Object(O.createElement)("p",{innerText:"Enter the amount of team members you would like to take on these operations. 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=Object(O.createElement)("input",{type:"number",placeholder:"Team Members"}),i=Object(O.createElement)("a",{innerText:"Confirm",class:"a-link-button",clickListener:()=>{var a=Math.round(parseFloat(r.value));return isNaN(a)?Object(y.dialogBoxCreate)("Invalid value entered for number of Team Members (must be numeric)"):(t.teamCount=a,this.updateOperationsUIElement(e,t)),Object(R.removeElementById)(n),!1}}),o=Object(O.createElement)("a",{innerText:"Cancel",class:"a-link-button",clickListener:()=>(Object(R.removeElementById)(n),!1)});Object(T.createPopup)(n,[a,r,i,o])}}));var i=t.level>=t.maxLevel;Object(k.appendLineBreaks)(e,2),e.appendChild(Object(O.createElement)("pre",{display:"inline-block",innerText:"Level: "+t.level+" / "+t.maxLevel,tooltip:t.getSuccessesNeededForNextLevel(2.5)+" successes needed for next level"})),e.appendChild(Object(O.createElement)("a",{class:i?"a-link-button-inactive":"a-link-button",innerHTML:"↑",padding:"2px",margin:"2px",tooltip:n?"WARNING: changing the level will restart the Operation":"",display:"inline",clickListener:()=>(++t.level,n&&this.startAction(this.action),this.updateOperationsUIElement(e,t),!1)})),e.appendChild(Object(O.createElement)("a",{class:t.level<=1?"a-link-button-inactive":"a-link-button",innerHTML:"↓",padding:"2px",margin:"2px",tooltip:n?"WARNING: changing the level will restart the Operation":"",display:"inline",clickListener:()=>(--t.level,n&&this.startAction(this.action),this.updateOperationsUIElement(e,t),!1)}));t.getDifficulty();var o=t.getActionTime(this);Object(k.appendLineBreaks)(e,2),e.appendChild(Object(O.createElement)("pre",{display:"inline-block",innerHTML:t.desc+"\n\n"+`Estimated success chance: ${Object(P.formatNumber)(100*a,1)}% ${t.isStealth?N:""}${t.isKill?I:""}\n`+"Time Required(s): "+Object(P.formatNumber)(o,0)+"\nOperations remaining: "+Math.floor(t.count)+"\nSuccesses: "+t.successes+"\nFailures: "+t.failures})),e.appendChild(Object(O.createElement)("br"));var s="bladeburner-"+t.name+"-autolevel-checkbox";e.appendChild(Object(O.createElement)("label",{for:s,innerText:"Autolevel",color:"white",tooltip:"Automatically increase operation level when possible"}));const l=Object(O.createElement)("div",{class:"bbcheckbox"}),c=Object(O.createElement)("input",{type:"checkbox",id:s,checked:t.autoLevel,changeListener:()=>{t.autoLevel=c.checked}}),u=Object(O.createElement)("label",{for:s});l.appendChild(c),l.appendChild(u),e.appendChild(l)},Q.prototype.updateBlackOpsUIElement=function(e,t){Object(b.removeChildrenFromElement)(e);var n=e.classList.contains(B),a=null!=this.blackops[t.name],r=t.getSuccessChance(this,{est:!0}),i=(t.getDifficulty(),t.getActionTime(this)),o=this.rank>=t.reqdRank;if(a)e.appendChild(Object(O.createElement)("h2",{innerText:t.name+" (COMPLETED)",display:"block"}));else{if(e.appendChild(Object(O.createElement)("h2",{innerText:n?t.name+" (IN PROGRESS - "+Object(P.formatNumber)(this.actionTimeCurrent,0)+" / "+Object(P.formatNumber)(this.actionTimeToComplete,0)+")":t.name,display:"inline-block"})),n){var s=this.actionTimeCurrent/this.actionTimeToComplete;e.appendChild(Object(O.createElement)("p",{display:"block",innerText:Object(f.createProgressBarText)({progress:s})}))}else e.appendChild(Object(O.createElement)("a",{innerText:"Start",margin:"3px",padding:"3px",class:o?"a-link-button":"a-link-button-inactive",clickListener:()=>(this.action.type=$.BlackOperation,this.action.name=t.name,this.startAction(this.action),this.updateActionAndSkillsContent(),!1)})),e.appendChild(Object(O.createElement)("a",{innerText:"Set Team Size (Curr Size: "+Object(P.formatNumber)(t.teamCount,0)+")",class:"a-link-button",margin:"3px",padding:"3px",clickListener:()=>{var n="bladeburner-operation-set-team-size-popup",a=Object(O.createElement)("p",{innerText:"Enter the amount of team members you would like to take on this BlackOp. 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=Object(O.createElement)("input",{type:"number",placeholder:"Team Members"}),i=Object(O.createElement)("a",{innerText:"Confirm",class:"a-link-button",clickListener:()=>{var a=Math.round(parseFloat(r.value));return isNaN(a)?Object(y.dialogBoxCreate)("Invalid value entered for number of Team Members (must be numeric)"):(t.teamCount=a,this.updateBlackOpsUIElement(e,t)),Object(R.removeElementById)(n),!1}}),o=Object(O.createElement)("a",{innerText:"Cancel",class:"a-link-button",clickListener:()=>(Object(R.removeElementById)(n),!1)});Object(T.createPopup)(n,[a,r,i,o])}}));Object(k.appendLineBreaks)(e,2),e.appendChild(Object(O.createElement)("p",{display:"inline-block",innerHTML:"
"+t.desc+"

"})),e.appendChild(Object(O.createElement)("p",{display:"block",color:o?"white":"red",innerHTML:"Required Rank: "+Object(P.formatNumber)(t.reqdRank,0)+"
"})),e.appendChild(Object(O.createElement)("p",{display:"inline-block",innerHTML:`Estimated Success Chance: ${Object(P.formatNumber)(100*r,1)}% ${t.isStealth?N:""}${t.isKill?I:""}\n`+"Time Required(s): "+Object(P.formatNumber)(i,0)}))}},Q.prototype.updateSkillsUIElement=function(e,t){Object(b.removeChildrenFromElement)(e);var n=t.name,a=0;this.skills[n]&&!isNaN(this.skills[n])&&(a=this.skills[n]);var r=t.calculateCost(a);e.appendChild(Object(O.createElement)("h2",{innerText:t.name+" (Lvl "+a+")",display:"inline-block"}));var i=this.skillPoints>=r,o=!!t.maxLvl&&a>=t.maxLvl;e.appendChild(Object(O.createElement)("a",{innerText:"Level",display:"inline-block",class:i&&!o?"a-link-button":"a-link-button-inactive",margin:"3px",padding:"3px",clickListener:()=>{if(!(this.skillPoints100&&this.consoleLogs.shift()),null!=t&&null!=Z.consoleDiv&&(e("#bladeubrner-console-input-row").before(''+t+""),Z.consoleTable.childNodes.length>100&&Z.consoleTable.removeChild(Z.consoleTable.firstChild),this.updateConsoleScroll())},Q.prototype.updateConsoleScroll=function(){Z.consoleDiv.scrollTop=Z.consoleDiv.scrollHeight},Q.prototype.resetConsoleInput=function(){Z.consoleInput.value=""},Q.prototype.clearConsole=function(){for(;Z.consoleTable.childNodes.length>1;)Z.consoleTable.removeChild(Z.consoleTable.firstChild);this.consoleLogs.length=0},Q.prototype.log=function(e){this.postToConsole(`[${Object(w.getTimestamp)()}] ${e}`)},Q.prototype.executeConsoleCommands=function(e){try{this.consoleHistory[this.consoleHistory.length-1]!=e&&(this.consoleHistory.push(e),this.consoleHistory.length>50&&this.consoleHistory.splice(0,1)),W=this.consoleHistory.length;for(var t=e.split(";"),n=0;n"))}},Q.prototype.executeLogConsoleCommand=function(e){if(e.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");var t=!0;switch(e[1].toLowerCase().includes("d")&&(t=!1),e[2].toLowerCase()){case"general":case"gen":this.logging.general=t,this.log("Logging "+(t?"enabled":"disabled")+" for general actions");break;case"contract":case"contracts":this.logging.contracts=t,this.log("Logging "+(t?"enabled":"disabled")+" for Contracts");break;case"ops":case"op":case"operations":case"operation":this.logging.ops=t,this.log("Logging "+(t?"enabled":"disabled")+" for Operations");break;case"blackops":case"blackop":case"black operations":case"black operation":this.logging.blackops=t,this.log("Logging "+(t?"enabled":"disabled")+" for BlackOps");break;case"event":case"events":this.logging.events=t,this.log("Logging "+(t?"enabled":"disabled")+" for events");break;case"all":this.logging.general=t,this.logging.contracts=t,this.logging.ops=t,this.logging.blackops=t,this.logging.events=t,this.log("Logging "+(t?"enabled":"disabled")+" for everything");break;default:this.postToConsole("Invalid action/event type specified: "+e[2]),this.postToConsole("Examples of valid action/event identifiers are: [general, contracts, ops, blackops, events]")}},Q.prototype.executeSkillConsoleCommand=function(e){switch(e.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"===e[1].toLowerCase()){this.postToConsole("Skills: ");for(var t=Object.keys(H),n=0;n=c?(this.skillPoints-=c,this.upgradeSkill(a),this.log(a.name+" upgraded to Level "+this.skills[s]),this.createActionAndSkillsContent()):this.postToConsole("You do not have enough Skill Points to upgrade this. You need "+Object(P.formatNumber)(c,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")}},Q.prototype.executeStartConsoleCommand=function(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");var t=e[2];switch(e[1].toLowerCase()){case"general":case"gen":null!=q[t]?(this.action.type=$[t],this.action.name=t,this.startAction(this.action),this.updateActionAndSkillsContent()):this.postToConsole("Invalid action name specified: "+e[2]);break;case"contract":case"contracts":null!=this.contracts[t]?(this.action.type=$.Contract,this.action.name=t,this.startAction(this.action),this.updateActionAndSkillsContent()):this.postToConsole("Invalid contract name specified: "+e[2]);break;case"ops":case"op":case"operations":case"operation":null!=this.operations[t]?(this.action.type=$.Operation,this.action.name=t,this.startAction(this.action),this.updateActionAndSkillsContent()):this.postToConsole("Invalid Operation name specified: "+e[2]);break;case"blackops":case"blackop":case"black operations":case"black operation":null!=X[t]?(this.action.type=$.BlackOperation,this.action.name=t,this.startAction(this.action),this.updateActionAndSkillsContent()):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]")}},Q.prototype.getActionIdFromTypeAndName=function(e="",t=""){if(""===e||""===t)return null;var n=new Y,a=e.toLowerCase().trim(),r=t.toLowerCase().trim();switch(a){case"contract":case"contracts":case"contr":return n.type=$.Contract,this.contracts.hasOwnProperty(t)?(n.name=t,n):null;case"operation":case"operations":case"op":case"ops":return n.type=$.Operation,this.operations.hasOwnProperty(t)?(n.name=t,n):null;case"blackoperation":case"black operation":case"black operations":case"black op":case"black ops":case"blackop":case"blackops":return n.type=$.BlackOp,X.hasOwnProperty(t)?(n.name=t,n):null;case"general":case"general action":case"gen":break;default:return null}if(a.startsWith("gen")){switch(r){case"training":n.type=$.Training,n.name="Training";break;case"recruitment":case"recruit":n.type=$.Recruitment,n.name="Recruitment";break;case"field analysis":case"fieldanalysis":n.type=$["Field Analysis"],n.name="Field Analysis";break;case"diplomacy":n.type=$.Diplomacy,n.name="Diplomacy";break;case"hyperbolic regeneration chamber":n.type=$["Hyperbolic Regeneration Chamber"],n.name="Hyperbolic Regeneration Chamber";break;default:return null}return n}},Q.prototype.getTypeAndNameFromActionId=function(e){var t={};let n=Object.keys($);for(let a=0;athis.rank)return n.log(`Failed to start Black Op ${r.name} due to insufficient rank`),!1;if(null!=this.blackops[r.name])return n.log(`Failed to start Black Op ${r.name} because its already been completed`),!1;var i=[];for(const e in X)X.hasOwnProperty(e)&&i.push(e);i.sort(function(e,t){return X[e].reqdRank-X[t].reqdRank});let e=i.indexOf(r.name);if(-1===e)return n.log("ERROR: Invalid Black Operation name passed into bladeburner.startAction(). Note that this name is case-sensitive & whitespace-sensitive"),!1;if(e>0&&null==this.blackops[i[e-1]])return n.log(`ERROR: Cannot attempt Black Operation ${r.name} because you have not done the preceding one`),!1}try{return this.startAction(r),n.shouldLog("startAction")&&n.log("Starting bladeburner action with type "+e+" and name "+t),!0}catch(a){return this.resetAction(),n.log("ERROR: bladeburner.startAction() failed to start action of type "+e+" due to invalid name: "+t+"Note that this name is case-sensitive and whitespace-sensitive"),!1}},Q.prototype.getActionTimeNetscriptFn=function(e,t,n){var a="ERROR: bladeburner.getActionTime() failed due to an invalid action specified. Type: "+e+", Name: "+t+". Note that for contracts and operations, the name of the operation is case-sensitive.",r=this.getActionIdFromTypeAndName(e,t);if(null==r)return n.log(a),-1;var i=this.getActionObject(r);if(null==i)return n.log(a),-1;switch(r.type){case $.Contract:case $.Operation:case $.BlackOp:case $.BlackOperation:return i.getActionTime(this);case $.Training:case $["Field Analysis"]:case $.FieldAnalysis:return 30;case $.Recruitment:return this.getRecruitmentTime();default:return n.log(a),-1}},Q.prototype.getActionEstimatedSuccessChanceNetscriptFn=function(e,t,n){var a="ERROR: bladeburner.getActionEstimatedSuccessChance() failed due to an invalid action specified. Type: "+e+", Name: "+t+". Note that for contracts and operations, the name of the operation is case-sensitive.",r=this.getActionIdFromTypeAndName(e,t);if(null==r)return n.log(a),-1;var i=this.getActionObject(r);if(null==i)return n.log(a),-1;switch(r.type){case $.Contract:case $.Operation:case $.BlackOp:case $.BlackOperation:return i.getSuccessChance(this,{est:!0});case $.Training:case $["Field Analysis"]:case $.FieldAnalysis:return 1;case $.Recruitment:return this.getRecruitmentSuccessChance();default:return n.log(a),-1}},Q.prototype.getActionCountRemainingNetscriptFn=function(e,t,n){var a="ERROR: bladeburner.getActionCountRemaining() failed due to an invalid action specified. Type: "+e+", Name: "+t+". Note that for contracts and operations, the name of the operation is case-sensitive.",r=this.getActionIdFromTypeAndName(e,t);if(null==r)return n.log(a),-1;var i=this.getActionObject(r);if(null==i)return n.log(a),-1;switch(r.type){case $.Contract:case $.Operation:return Math.floor(i.count);case $.BlackOp:case $.BlackOperation:return null!=this.blackops[t]?0:1;case $.Training:case $["Field Analysis"]:case $.FieldAnalysis:return 1/0;default:return n.log(a),-1}},Q.prototype.getSkillLevelNetscriptFn=function(e,t){var n="ERROR: bladeburner.getSkillLevel() failed due to an invalid skill specified: "+e+". Note that the name of the skill is case-sensitive";return""===e?-1:H.hasOwnProperty(e)?null==this.skills[e]?0:this.skills[e]:(t.log(n),-1)},Q.prototype.getSkillUpgradeCostNetscriptFn=function(e,t){var n="ERROR: bladeburner.getSkillUpgradeCostNetscriptFn() failed due to an invalid skill specified: "+e+". Note that the name of the skill is case-sensitive";if(""===e)return-1;if(!H.hasOwnProperty(e))return t.log(n),-1;var a=H[e];return null==this.skills[e]?a.calculateCost(0):a.calculateCost(this.skills[e])},Q.prototype.upgradeSkillNetscriptFn=function(e,t){var n="ERROR: bladeburner.upgradeSkill() failed due to an invalid skill specified: "+e+". Note that the name of the skill is case-sensitive";if(!H.hasOwnProperty(e))return t.log(n),!1;var a=H[e],r=0;this.skills[e]&&!isNaN(this.skills[e])&&(r=this.skills[e]);var i=a.calculateCost(r);return a.maxLvl&&r>=a.maxLvl?(t.shouldLog("upgradeSkill")&&t.log(`bladeburner.upgradeSkill() failed because ${e} is already maxed`),!1):this.skillPoints=25?(Object(u.c)(t),e.shouldLog("joinBladeburnerFaction")&&e.log("Joined Bladeburners Faction"),S.routing.isOn(S.Page.Bladeburner)&&(Object(b.removeChildrenFromElement)(Z.overviewDiv),this.createOverviewContent()),!0):(e.shouldLog("joinBladeburnerFaction")&&e.log("Failed to join Bladeburners Faction because you do not have the required 25 rank"),!1))},Q.prototype.toJSON=function(){return Object(v.Generic_toJSON)("Bladeburner",this)},Q.fromJSON=function(e){return Object(v.Generic_fromJSON)(Q,e.data)},v.Reviver.constructors.Bladeburner=Q}).call(this,n(81))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=n(4),r=n(86);t.createPopup=function(e,t,n={}){const i=a.createElement("div",{class:"popup-box-container",display:"flex",id:e}),o=a.createElement("div",{class:"popup-box-content",id:`${e}-content`});for(const e of t)o.appendChild(e);return n.backgroundColor&&(o.style.backgroundColor=n.backgroundColor),i.appendChild(o),r.getElementById("entire-game-container").appendChild(i),i}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=n(322),r=n(125);t.CompanyPositions={},a.companyPositionMetadata.forEach(e=>{!function(e){null!=t.CompanyPositions[e.name]&&console.warn(`Duplicate Company Position being defined: ${e.name}`),t.CompanyPositions[e.name]=new r.CompanyPosition(e)}(e)})},function(e,t,n){"use strict";n.d(t,"b",function(){return C}),n.d(t,"h",function(){return O}),n.d(t,"a",function(){return T}),n.d(t,"f",function(){return w}),n.d(t,"d",function(){return x}),n.d(t,"c",function(){return R}),n.d(t,"g",function(){return N}),n.d(t,"e",function(){return M});var a=n(88),r=n(2),i=n(11),o=n(186),s=n(161),l=n(8),c=n(53),u=n(164),p=n(100),h=n(20),m=n(19),d=n(66),g=n(152),_=n(63),f=n(9),y=n(130),b=n(71),v=n(122),E=n(7);const k=n(223);function C(e){this.name=e.filename,this.running=!1,this.serverIp=e.server,this.code=e.getCode(),this.env=new s.a(this),this.env.set("args",e.args.slice()),this.output="",this.ramUsage=0,this.scriptRef=e,this.errorMessage="",this.args=e.args.slice(),this.delay=null,this.fnWorker=null,this.checkingRam=!1,this.loadedFns={},this.disableLogs={},this.dynamicRamUsage=r.CONSTANTS.ScriptBaseRamCost,this.dynamicLoadedFns={}}C.prototype.getServer=function(){return h.AllServers[this.serverIp]},C.prototype.getScript=function(){let e=this.getServer();for(let t=0;t{if(t instanceof Error)throw e.errorMessage=Object(l.d)(e,t.message+(t.stack&&"\nstack:\n"+t.stack.toString()||"")),e;if(Object(l.b)(t))throw e.errorMessage=t,e;throw t})}function A(e){var t,n,a=e.code;e.running=!0;try{let r=function(e,t){var n=Object(_.parse)(e,{ecmaVersion:6,allowReserved:!0,sourceType:"module"}),a=t.getServer();if(null==a)throw new Error("Failed to find underlying Server object for script");var r="",i=!1;if(k.simple(n,{ImportDeclaration:e=>{i=!0;let t=e.source.value;t.startsWith("./")&&(t=t.slice(2));let n=function(e){for(let t=0;t{n.push(e.id.name),a.push(e)}}),r="var "+t+";\n(function (namespace) {\n",a.forEach(e=>{r+=Object(g.generate)(e),r+="\n"}),n.forEach(e=>{r+="namespace."+e+" = "+e,r+="\n"}),r+="})("+t+" || ("+t+" = {}));\n"}else{let t=[];e.specifiers.forEach(e=>{t.push(e.local.name)});let n=[];k.simple(o,{FunctionDeclaration:e=>{t.includes(e.id.name)&&n.push(e)}}),n.forEach(e=>{r+=Object(g.generate)(e),r+="\n"})}}}),!i)return{code:e,lineOffset:0};var o=0;if("Program"!==n.type||null==n.body)throw new Error("Code could not be properly parsed");for(let e=n.body.length-1;e>=0;--e)"ImportDeclaration"===n.body[e].type&&(n.body.splice(e,1),++o);var s=(r.match(/\n/g)||[]).length-o;return e=Object(g.generate)(n),{code:e=r+e,lineOffset:s}}(a,e);t=r.code,n=r.lineOffset}catch(t){return Object(f.dialogBoxCreate)("Error processing Imports in "+e.name+":
"+t),e.env.stopFlag=!0,void(e.running=!1)}var r;try{r=new o.a(t,function(t,n){var a=Object(c.a)(e);for(let e in a){let r=a[e];if("function"==typeof r)if("hack"===e||"grow"===e||"weaken"===e||"sleep"===e||"prompt"===e||"run"===e||"exec"===e){let a=function(){let e=[];for(let t=0;t"+t),e.env.stopFlag=!0,void(e.running=!1)}return new Promise(function(t,n){try{!function a(){try{if(e.env.stopFlag)return n(e);r.step()?Object(d.setTimeoutRef)(a,m.Settings.CodeInstructionRunTime):t(e)}catch(t){return t=t.toString(),Object(l.b)(t)||(t=Object(l.d)(e,t)),e.errorMessage=t,n(e)}}()}catch(t){return Object(E.isString)(t)?(e.errorMessage=t,n(e)):n(t instanceof C?t:e)}})}function w(){for(var e=!1,t=O.length-1;t>=0;t--)if(0==O[t].running&&1==O[t].env.stopFlag){e=!0;var n=O[t].serverIp,r=O[t].name;h.AllServers[n].ramUsed=0;for(let e=0;eServer Ip: "+n+"
Script name: "+a+"
Args:"+Object(b.arrayToString)(e.args)+"
"+r),e.scriptRef.log("Script crashed with runtime error")}else e.scriptRef.log("Script killed");e.running=!1,e.env.stopFlag=!0}else{if(Object(l.b)(e))return Object(f.dialogBoxCreate)("Script runtime unknown error. This is a bug please contact game developer"),void console.log("ERROR: Evaluating workerscript returns only error message rather than WorkerScript object. THIS SHOULDN'T HAPPEN: "+e.toString());Object(f.dialogBoxCreate)("An unknown script died for an unknown reason. This is a bug please contact game dev"),console.log(e)}else console.log("Script returning with value: "+e[1])})}Object(d.setTimeoutRef)(w,6e3)}function x(e,t){for(var n=0;nt.maxRam-t.ramUsed)Object(f.dialogBoxCreate)("Not enough RAM to run script "+e.filename+" with args "+Object(b.arrayToString)(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.)");else{t.ramUsed=Object(v.roundToTwo)(t.ramUsed+r);var i=new C(e);i.ramUsage=r,Object(a.a)(i),O.push(i)}}function N(e=1){for(var t=e*i.Engine._idleSpeed/1e3,n=0;nm.Start&&(d.currStep-=1);_()}(),!1}),Object(l.clearEventListeners)("interactive-tutorial-next").addEventListener("click",function(){return f(),!1}),_()}function _(){if(d.isRunning){var e=Object(l.clearEventListeners)("terminal-menu-link"),t=Object(l.clearEventListeners)("stats-menu-link"),n=Object(l.clearEventListeners)("active-scripts-menu-link"),r=Object(l.clearEventListeners)("hacknet-nodes-menu-link"),i=Object(l.clearEventListeners)("city-menu-link"),o=Object(l.clearEventListeners)("tutorial-menu-link");e.removeAttribute("class"),t.removeAttribute("class"),n.removeAttribute("class"),r.removeAttribute("class"),i.removeAttribute("class"),o.removeAttribute("class");var s=document.getElementById("interactive-tutorial-next");switch(d.currStep){case m.Start:a.Engine.loadTerminalContent(),b("Welcome to Bitburner, a cyberpunk-themed incremental RPG! The game takes place in a dark, dystopian future...The year is 2077...

This tutorial will show you the basics of the game. You may skip the tutorial at any time."),s.style.display="inline-block";break;case m.GoToCharacterPage:a.Engine.loadTerminalContent(),b("Let's start by heading to the Stats page. Click the 'Stats' tab on the main navigation menu (left-hand side of the screen)"),s.style.display="none",t.setAttribute("class","flashing-button"),t.addEventListener("click",function(){return a.Engine.loadCharacterContent(),f(),!1});break;case m.CharacterPage:a.Engine.loadCharacterContent(),b("The Stats page shows a lot of important information about your progress, such as your skills, money, and bonuses/multipliers. "),s.style.display="inline-block";break;case m.CharacterGoToTerminalPage:a.Engine.loadCharacterContent(),b("Let's head to your computer's terminal by clicking the 'Terminal' tab on the main navigation menu."),s.style.display="none",e.setAttribute("class","flashing-button"),e.addEventListener("click",function(){return a.Engine.loadTerminalContent(),f(),!1});break;case m.TerminalIntro:a.Engine.loadTerminalContent(),b("The Terminal is used to interface with your home computer as well as all of the other machines around the world."),s.style.display="inline-block";break;case m.TerminalHelp:a.Engine.loadTerminalContent(),b("Let's try it out. Start by entering the 'help' command into the Terminal (Don't forget to press Enter after typing the command)"),s.style.display="none";break;case m.TerminalLs:a.Engine.loadTerminalContent(),b("The 'help' command displays a list of all available Terminal commands, how to use them, and a description of what they do.

Let's try another command. Enter the 'ls' command"),s.style.display="none";break;case m.TerminalScan:a.Engine.loadTerminalContent(),b("'ls' is a basic command that shows all of the contents (programs/scripts) 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.

Using your home computer's terminal, you can connect to other machines throughout the world. Let's do that now by first entering the 'scan' command."),s.style.display="none";break;case m.TerminalScanAnalyze1:a.Engine.loadTerminalContent(),b("The 'scan' command 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 either its IP or its hostname.

That's great and all, but there's so many servers. Which one should you go to? The 'scan-analyze' command gives some more detailed information about servers on the network. Try it now"),s.style.display="none";break;case m.TerminalScanAnalyze2:a.Engine.loadTerminalContent(),b("You just ran 'scan-analyze' with a depth of one. This command shows more detailed information about each server that you can connect to (servers that are a distance of one node away).

It is also possible to run 'scan-analyze' with a higher depth. Let's try a depth of two with the following command: 'scan-analyze 2'."),s.style.display="none";break;case m.TerminalConnect:a.Engine.loadTerminalContent(),b("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 the 'connect [ip/hostname]' command. You can type in the ip or the hostname, but dont use both.

From the results of the 'scan-analyze' command, we can see that the 'foodnstuff' server is only one node away. Let's connect so it now using: 'connect foodnstuff'"),s.style.display="none";break;case m.TerminalAnalyze:a.Engine.loadTerminalContent(),b("You are now connected to another machine! What can you do now? You can hack it!

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.

Before you try to hack a server, you should run diagnostics using the 'analyze' command"),s.style.display="none";break;case m.TerminalNuke:a.Engine.loadTerminalContent(),b("When the 'analyze' command finishes running it will show useful information about hacking the server.

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.

The 'analyze' results 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 the 'run NUKE.exe' command."),s.style.display="none";break;case m.TerminalManualHack:a.Engine.loadTerminalContent(),b("You now have root access! You can hack the server using the 'hack' command. Try doing that now."),s.style.display="none";break;case m.TerminalHackingMechanics:a.Engine.loadTerminalContent(),b("You are now attempting to hack the server. Note that 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.

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.

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."),s.style.display="inline-block";break;case m.TerminalCreateScript:a.Engine.loadTerminalContent(),b("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!

To create a new script or edit an existing one, you can use the 'nano' command. Scripts must end with the '.script' extension. Let's make a script now by entering 'nano foodnstuff.script' after the hack command finishes running (Sidenote: Pressing ctrl + c will end a command like hack early)"),s.style.display="none";break;case m.TerminalTypeScript:a.Engine.loadScriptEditorContent("foodnstuff.script",""),b("This is the script editor. You can use it to program your scripts. Scripts are written in the Netscript language, a programming language created for this game. There are details about the Netscript language in the documentation, which can be accessed in the 'Tutorial' tab on the main navigation menu. I highly suggest you check it out after this tutorial. For now, just copy and paste the following code into the script editor:

while(true) {
  hack('foodnstuff');
}

For anyone with basic programming experience, this code should be straightforward. This script will continuously hack the 'foodnstuff' server.

To save and close the script editor, press the button in the bottom left, or press ctrl + b."),s.style.display="none";break;case m.TerminalFree:a.Engine.loadTerminalContent(),b("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.

To check how much RAM is available on this machine, enter the 'free' command."),s.style.display="none";break;case m.TerminalRunScript:a.Engine.loadTerminalContent(),b("We have 16GB of free RAM on this machine, which is enough to run our script. Let's run our script using 'run foodnstuff.script'."),s.style.display="none";break;case m.TerminalGoToActiveScriptsPage:a.Engine.loadTerminalContent(),b("Your script is now running! The script might take a few seconds to 'fully start up'. Your scripts will continuously run in the background and will automatically stop if the code ever completes (the 'foodnstuff.script' will never complete because it runs an infinite loop).

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 much slower rate.

Let's check out some statistics for our running scripts by clicking the 'Active Scripts' link in the main navigation menu."),s.style.display="none",n.setAttribute("class","flashing-button"),n.addEventListener("click",function(){return a.Engine.loadActiveScriptsContent(),f(),!1});break;case m.ActiveScriptsPage:a.Engine.loadActiveScriptsContent(),b("This page displays stats/information about all of your scripts that are running across every existing server. You can use this to gauge how well your scripts are doing. Let's go back to the Terminal now using the 'Terminal'link."),s.style.display="none",e.setAttribute("class","flashing-button"),e.addEventListener("click",function(){return a.Engine.loadTerminalContent(),f(),!1});break;case m.ActiveScriptsToTerminal:a.Engine.loadTerminalContent(),b("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 'tail foodnstuff.script'"),s.style.display="none";break;case m.TerminalTailScript:a.Engine.loadTerminalContent(),b("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!

This pretty much covers the basics of hacking. To learn more about writing scripts using the Netscript language, select the 'Tutorial' link in the main navigation menu to look at the documentation. If you are an experienced JavaScript developer, I would highly suggest you check out the section on NetscriptJS/Netscript 2.0.

For now, let's move on to something else!"),s.style.display="inline-block";break;case m.GoToHacknetNodesPage:a.Engine.loadTerminalContent(),b("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 the 'Hacknet Nodes' page through the main navigation menu now."),s.style.display="none",r.setAttribute("class","flashing-button"),r.addEventListener("click",function(){return a.Engine.loadHacknetNodesContent(),f(),!1});break;case m.HacknetNodesIntroduction:a.Engine.loadHacknetNodesContent(),b("From this page you can purchase new Hacknet Nodes and upgrade your existing ones. Let's purchase a new one now."),s.style.display="none";break;case m.HacknetNodesGoToWorldPage:a.Engine.loadHacknetNodesContent(),b("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.

Let's go to the 'City' page through the main navigation menu."),s.style.display="none",i.setAttribute("class","flashing-button"),i.addEventListener("click",function(){return a.Engine.loadWorldContent(),f(),!1});break;case m.WorldDescription:a.Engine.loadWorldContent(),b("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!

Lastly, click on the 'Tutorial' link in the main navigation menu."),s.style.display="none",o.setAttribute("class","flashing-button"),o.addEventListener("click",function(){return a.Engine.loadTutorialContent(),f(),!1});break;case m.TutorialPageInfo:a.Engine.loadTutorialContent(),b("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!"),s.style.display="inline-block",s.innerHTML="Finish Tutorial";break;case m.End:y();break;default:throw new Error("Invalid tutorial step")}!0===d.stepIsDone[d.currStep]&&(s.style.display="inline-block")}else console.log("Interactive Tutorial not running")}function f(){d.currStep===m.GoToCharacterPage&&document.getElementById("stats-menu-link").removeAttribute("class"),d.currStep===m.CharacterGoToTerminalPage&&document.getElementById("terminal-menu-link").removeAttribute("class"),d.currStep===m.TerminalGoToActiveScriptsPage&&document.getElementById("active-scripts-menu-link").removeAttribute("class"),d.currStep===m.ActiveScriptsPage&&document.getElementById("terminal-menu-link").removeAttribute("class"),d.currStep===m.GoToHacknetNodesPage&&document.getElementById("hacknet-nodes-menu-link").removeAttribute("class"),d.currStep===m.HacknetNodesGoToWorldPage&&document.getElementById("city-menu-link").removeAttribute("class"),d.currStep===m.WorldDescription&&document.getElementById("tutorial-menu-link").removeAttribute("class"),d.stepIsDone[d.currStep]=!0,d.currStep
Getting Started GuideDocumentation

The Beginner's Guide to Hacking was added to your home computer! It contains some tips/pointers for starting out with the game. To read it, go to Terminal and enter

cat hackers-starting-handbook.lit"}),n=Object(c.createElement)("a",{class:"a-link-button",float:"right",padding:"6px",innerText:"Got it!",clickListener:()=>{Object(p.removeElementById)(e)}});Object(u.createPopup)(e,[t,n]),r.a.getHomeComputer().messages.push("hackers-starting-handbook.lit")}function b(e){var t=document.getElementById("interactive-tutorial-text");if(null==t)throw new Error("Could not find text box");t.innerHTML=e,t.parentElement.scrollTop=0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SoftwareCompanyPositions=["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"],t.ITCompanyPositions=["IT Intern","IT Analyst","IT Manager","Systems Administrator"],t.SecurityEngineerCompanyPositions=["Security Engineer"],t.NetworkEngineerCompanyPositions=["Network Engineer","Network Administrator"],t.BusinessCompanyPositions=["Business Intern","Business Analyst","Business Manager","Operations Manager","Chief Financial Officer","Chief Executive Officer"],t.SecurityCompanyPositions=["Police Officer","Police Chief","Security Guard","Security Officer","Security Supervisor","Head of Security"],t.AgentCompanyPositions=["Field Agent","Secret Agent","Special Operative"],t.MiscCompanyPositions=["Waiter","Employee"],t.SoftwareConsultantCompanyPositions=["Software Consultant","Senior Software Consultant"],t.BusinessConsultantCompanyPositions=["Business Consultant","Senior Business Consultant"],t.PartTimeCompanyPositions=["Part-time Waiter","Part-time Employee"]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=n(2),r=n(21),i=n(180),o=n(82),s=n(18);t.HacknetServerHashesPerLevel=.001,t.BaseCostForHacknetServer=5e4,t.BaseCostFor1GBHacknetServerRam=2e5,t.BaseCostForHacknetServerCore=1e6,t.BaseCostForHacknetServerCache=1e7,t.HacknetServerPurchaseMult=3.2,t.HacknetServerUpgradeLevelMult=1.1,t.HacknetServerUpgradeRamMult=1.4,t.HacknetServerUpgradeCoreMult=1.55,t.HacknetServerUpgradeCacheMult=1.85,t.MaxNumberHacknetServers=25,t.HacknetServerMaxLevel=300,t.HacknetServerMaxRam=8192,t.HacknetServerMaxCores=128,t.HacknetServerMaxCache=15;class l extends i.BaseServer{constructor(e={hostname:"",ip:o.createRandomIp()}){super(e),this.cache=1,this.cores=1,this.hashCapacity=0,this.hashRate=0,this.level=1,this.onlineTimeSeconds=0,this.totalHashesGenerated=0,this.maxRam=1,this.updateHashCapacity(),e.player&&this.updateHashRate(e.player)}static fromJSON(e){return s.Generic_fromJSON(l,e.data)}calculateCacheUpgradeCost(e){const n=Math.round(e);if(isNaN(n)||n<1)return 0;if(this.cache>=t.HacknetServerMaxCache)return 1/0;const a=t.HacknetServerUpgradeCacheMult;let r=0,i=this.cache;for(let e=0;e=t.HacknetServerMaxCores)return 1/0;const r=t.HacknetServerUpgradeCoreMult;let i=0,o=this.cores;for(let e=0;e=t.HacknetServerMaxLevel)return 1/0;const r=t.HacknetServerUpgradeLevelMult;let i=0,o=this.level;for(let e=0;e=t.HacknetServerMaxRam)return 1/0;let r=0,i=Math.round(Math.log2(this.maxRam)),o=this.maxRam;for(let e=0;e=t.HacknetServerMaxCache)return!1;if(this.cache+e>t.HacknetServerMaxCache){const e=Math.max(0,t.HacknetServerMaxCache-this.cache);return this.purchaseCacheUpgrade(e,n)}return!!n.canAfford(r)&&(n.loseMoney(r),this.cache=Math.round(this.cache+a),this.updateHashCapacity(),!0)}purchaseCoreUpgrade(e,n){const a=Math.round(e),r=this.calculateCoreUpgradeCost(a,n);if(isNaN(r)||r<=0||a<=0)return!1;if(this.cores>=t.HacknetServerMaxCores)return!1;if(this.cores+a>t.HacknetServerMaxCores){const e=Math.max(0,t.HacknetServerMaxCores-this.cores);return this.purchaseCoreUpgrade(e,n)}return!!n.canAfford(r)&&(n.loseMoney(r),this.cores=Math.round(this.cores+a),this.updateHashRate(n),!0)}purchaseLevelUpgrade(e,n){const a=Math.round(e),r=this.calculateLevelUpgradeCost(a,n);if(isNaN(r)||r<=0||a<=0)return!1;if(this.level>=t.HacknetServerMaxLevel)return!1;if(this.level+a>t.HacknetServerMaxLevel){const e=Math.max(0,t.HacknetServerMaxLevel-this.level);return this.purchaseLevelUpgrade(e,n)}return!!n.canAfford(r)&&(n.loseMoney(r),this.level=Math.round(this.level+a),this.updateHashRate(n),!0)}purchaseRamUpgrade(e,n){const a=Math.round(e),r=this.calculateRamUpgradeCost(a,n);if(isNaN(r)||r<=0||a<=0)return!1;if(this.maxRam>=t.HacknetServerMaxRam)return!1;if(this.maxRam*Math.pow(2,a)>t.HacknetServerMaxRam){const e=Math.max(0,Math.log2(Math.round(t.HacknetServerMaxRam/this.maxRam)));return this.purchaseRamUpgrade(e,n)}if(!n.canAfford(r))return!1;n.loseMoney(r);for(let e=0;e
Filename: "+(e.fileName||"UNKNOWN FILE NAME")+"

Line Number: "+(e.lineNumber||"UNKNOWN LINE NUMBER")+"

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 safe doesn't get corrupted",!1)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isString=function(e){return"string"==typeof e||e instanceof String}},function(e,t,n){"use strict";n.d(t,"b",function(){return o}),n.d(t,"a",function(){return s});var a=n(0),r=n(68),i=n(8);function o(e,t){return`gang.${e}() failed with exception: `+t}function s(e,t){const n=`gang.${t}() failed because you do not currently have a Gang`;if(!(a.a.gang instanceof r.b))throw Object(i.d)(e,n)}},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Ace="ace",e.Emacs="emacs",e.Vim="vim"}(t.AceKeybindingSetting||(t.AceKeybindingSetting={})),function(e){e.Default="default",e.Emacs="emacs",e.Sublime="sublime",e.Vim="vim"}(t.CodeMirrorKeybindingSetting||(t.CodeMirrorKeybindingSetting={})),function(e){e.Monokai="monokai",e.Day_3024="3024-day",e.Night_3024="3024-night",e.abcdef="abcdef",e.Ambiance_mobile="ambiance-mobile",e.Ambiance="ambiance",e.Base16_dark="base16-dark",e.Base16_light="base16-light",e.Bespin="bespin",e.Blackboard="blackboard",e.Cobalt="cobalt",e.Colorforth="colorforth",e.Darcula="darcula",e.Dracula="dracula",e.Duotone_dark="duotone-dark",e.Duotone_light="duotone-light",e.Eclipse="eclipse",e.Elegant="elegant",e.Erlang_dark="erlang-dark",e.Gruvbox_dark="gruvbox-dark",e.Hopscotch="hopscotch",e.Icecoder="icecoder",e.Idea="idea",e.Isotope="isotope",e.Lesser_dark="lesser-dark",e.Liquibyte="liquibyte",e.Lucario="lucario",e.Material="material",e.Mbo="mbo",e.Mdn_like="mdn-like",e.Midnight="midnight",e.Neat="neat",e.Neo="neo",e.Night="night",e.Oceanic_next="oceanic-next",e.Panda_syntax="panda-syntax",e.Paraiso_dark="paraiso-dark",e.Paraiso_light="paraiso-light",e.Pastel_on_dark="pastel-on-dark",e.Railscasts="railscasts",e.Rubyblue="rubyblue",e.Seti="seti",e.Shadowfox="shadowfox",e.Solarized="solarized",e.ssms="ssms",e.The_matrix="the-matrix",e.Tomorrow_night_bright="tomorrow-night-bright",e.Tomorrow_night_eighties="tomorrow-night-eighties",e.Ttcn="ttcn",e.Twilight="twilight",e.Vibrant_ink="vibrant-ink",e.xq_dark="xq-dark",e.xq_light="xq-light",e.Yeti="yeti",e.Zenburn="zenburn"}(t.CodeMirrorThemeSetting||(t.CodeMirrorThemeSetting={})),function(e){e.Ace="Ace",e.CodeMirror="CodeMirror"}(t.EditorSetting||(t.EditorSetting={})),function(e){e[e.Cost=0]="Cost",e[e.Default=1]="Default",e[e.Reputation=2]="Reputation"}(t.PurchaseAugmentationsOrderSetting||(t.PurchaseAugmentationsOrderSetting={})),function(e){e[e.Alphabetically=0]="Alphabetically",e[e.AcquirementTime=1]="AcquirementTime"}(t.OwnedAugmentationsOrderSetting||(t.OwnedAugmentationsOrderSetting={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=n(181),r=n(2);t.Crimes={Shoplift:new a.Crime("Shoplift",r.CONSTANTS.CrimeShoplift,2e3,15e3,.05,.1,{dexterity_success_weight:1,agility_success_weight:1,dexterity_exp:2,agility_exp:2}),RobStore:new a.Crime("Rob Store",r.CONSTANTS.CrimeRobStore,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:.25*r.CONSTANTS.IntelligenceCrimeBaseExpGain}),Mug:new a.Crime("Mug",r.CONSTANTS.CrimeMug,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.Crime("Larceny",r.CONSTANTS.CrimeLarceny,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:.5*r.CONSTANTS.IntelligenceCrimeBaseExpGain}),DealDrugs:new a.Crime("Deal Drugs",r.CONSTANTS.CrimeDrugs,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.Crime("Bond Forgery",r.CONSTANTS.CrimeBondForgery,3e5,45e5,.5,.1,{hacking_exp:100,dexterity_exp:150,charisma_exp:15,hacking_success_weight:.05,dexterity_success_weight:1.25,intelligence_exp:2*r.CONSTANTS.IntelligenceCrimeBaseExpGain}),TraffickArms:new a.Crime("Traffick Arms",r.CONSTANTS.CrimeTraffickArms,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.Crime("Homicide",r.CONSTANTS.CrimeHomicide,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.Crime("Grand Theft Auto",r.CONSTANTS.CrimeGrandTheftAuto,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:r.CONSTANTS.IntelligenceCrimeBaseExpGain}),Kidnap:new a.Crime("Kidnap",r.CONSTANTS.CrimeKidnap,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:2*r.CONSTANTS.IntelligenceCrimeBaseExpGain}),Assassination:new a.Crime("Assassination",r.CONSTANTS.CrimeAssassination,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:5*r.CONSTANTS.IntelligenceCrimeBaseExpGain,kills:1}),Heist:new a.Crime("Heist",r.CONSTANTS.CrimeHeist,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:10*r.CONSTANTS.IntelligenceCrimeBaseExpGain})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=n(2);t.SourceFileFlags=Array(a.CONSTANTS.TotalNumBitNodes+1),t.updateSourceFileFlags=function(e){for(let e=0;e{const a=t.CodingContractTypes[this.type],r=`coding-contract-prompt-popup-${this.fn}`,i=s.createElement("p",{innerHTML:["You are attempting to solve a Coding Contract. You have",`${this.getMaxNumTries()-this.tries} tries remaining,`,"after which the contract will self-destruct.

",`${a.desc(this.data).replace(/\n/g,"
")}`].join(" ")});let u,h,m;u=s.createElement("input",{onkeydown:e=>{e.keyCode===o.KEY.ENTER&&""!==u.value?(e.preventDefault(),h.click()):e.keyCode===o.KEY.ESC&&(e.preventDefault(),m.click())},placeholder:"Enter Solution here"}),h=s.createElement("a",{class:"a-link-button",clickListener:()=>{const t=u.value;this.isSolution(t)?e(p.Success):e(p.Failure),c.removeElementById(r)},innerText:"Solve"}),m=s.createElement("a",{class:"a-link-button",clickListener:()=>{e(p.Cancelled),c.removeElementById(r)},innerText:"Cancel"});const d=s.createElement("br");l.createPopup(r,[i,d,d,u,h,m]),u.focus()})})}toJSON(){return i.Generic_toJSON("CodingContract",this)}}t.CodingContract=h,i.Reviver.constructors.CodingContract=h},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return Ee}),n.d(t,"g",function(){return ve}),n.d(t,"d",function(){return _e}),n.d(t,"f",function(){return ge}),n.d(t,"h",function(){return ye}),n.d(t,"e",function(){return ue}),n.d(t,"b",function(){return he}),n.d(t,"c",function(){return me});var a=n(88),r=n(16),i=n(13),o=n(77),s=n(5),l=n(21),c=n(133),u=n(37),p=n(83),h=n(17),m=n(125),d=n(39),g=n(2),_=n(96),f=n(59),y=n(68),b=n(70),v=n(14),E=n(56),k=n(138),C=n(148),O=n(33),T=n(44),S=n(6),M=n(57),P=(n(67),n(73)),A=n(0),w=n(31),x=n(102),R=n(61),N=n(64),I=n(20),L=n(75),D=n(22),B=n(65),W=(n(19),n(41)),j=(n(36),n(29)),F=n(89),U=n(51),H=n(87),G=n(69),K=n(47),q=n(40),$=n(8),Y=n(100),z=n(121),V=n(94),J=n(12),X=n(3),Q=n(10),Z=n(66),ee=n(187),te=(n(9),n(160),n(71)),ne=n(82),ae=n(7),re=n(46),ie=n(4),oe=n(38),se=n(26),le=n(224).sprintf,ce=n(224).vsprintf,ue=!1,pe=!1,he=!1,me=!1,de=!1,ge=!1,_e=!1,fe=1,ye=1,be={ALL:!0,scan:!0,hack:!0,sleep:!0,disableLog:!0,enableLog:!0,grow:!0,weaken:!0,nuke:!0,brutessh:!0,ftpcrack:!0,relaysmtp:!0,httpworm:!0,sqlinject:!0,run:!0,exec:!0,spawn:!0,kill:!0,killall:!0,scp:!0,getHackingLevel:!0,getServerMoneyAvailable:!0,getServerSecurityLevel:!0,getServerBaseSecurityLevel:!0,getServerMinSecurityLevel:!0,getServerRequiredHackingLevel:!0,getServerMaxMoney:!0,getServerGrowth:!0,getServerNumPortsRequired:!0,getServerRam:!0,buyStock:!0,sellStock:!0,shortStock:!0,sellShort:!0,purchase4SMarketData:!0,purchase4SMarketDataTixApi:!0,purchaseServer:!0,deleteServer:!0,universityCourse:!0,gymWorkout:!0,travelToCity:!0,purchaseTor:!0,purchaseProgram:!0,stopAction:!0,upgradeHomeRam:!0,workForCompany:!0,applyToCompany:!0,joinFaction:!0,workForFaction:!0,donateToFaction:!0,createProgram:!0,commitCrime:!0,startAction:!0,upgradeSkill:!0,setTeamSize:!0,joinBladeburnerFaction:!0,recruitMember:!0,setMemberTask:!0,purchaseEquipment:!0,setTerritoryWarfare:!0};function ve(){for(var e=0;e1.01*t.ramUsage)throw Object($.d)(t,"Dynamic RAM usage calculated to be greater than initial RAM usage on fn: "+e+". This is probably because you somehow circumvented the static RAM calculation.

Please don't do that :(

Dynamic RAM Usage: "+t.dynamicRamUsage+"
Static RAM Usage: "+t.ramUsage)},ue=function(e,n){return t.loadedFns[e]?0:(t.loadedFns[e]=!0,n)},me=function(e,n=""){var a=Object(D.getServer)(e);if(null==a)throw t.log(`ERROR: Invalid IP or hostname passed into ${n}()`),Object($.d)(t,`Invalid IP or hostname passed into ${n}() function`);return a},_e=function(e,n=""){return e instanceof T.HacknetServer&&(t.log(`ERROR: ${n}() failed because it does not work on Hacknet Servers`),!0)},ve=function(e){if(isNaN(e))throw Object($.d)(t,"Invalid index specified for Hacknet Node: "+e);if(e<0||e>=A.a.hacknetNodes.length)throw Object($.d)(t,"Index specified for Hacknet Node is out-of-bounds: "+e);if(Object(O.i)()){const n=I.AllServers[A.a.hacknetNodes[e]];if(null==n)throw Object($.d)(t,`Could not get Hacknet Server for index ${e}. This is probably a bug, please report to game dev`);return n}return A.a.hacknetNodes[e]},ke=function(e,t){return me(t,"getCodingContract").getContract(e)};return{hacknet:{numNodes:function(){return A.a.hacknetNodes.length},purchaseNode:function(){return Object(O.l)()},getPurchaseNodeCost:function(){return Object(O.i)()?Object(O.d)():Object(O.c)()},getNodeStats:function(e){const t=ve(e),n=Object(O.i)(),a={name:t.name,level:t.level,ram:n?t.maxRam:t.ram,cores:t.cores,production:n?t.hashRate:t.moneyGainRatePerSecond,timeOnline:t.onlineTimeSeconds,totalProduction:n?t.totalHashesGenerated:t.totalMoneyGenerated};return n&&(a.cache=t.cache),a},upgradeLevel:function(e,t){return ve(e).purchaseLevelUpgrade(t,A.a)},upgradeRam:function(e,t){return ve(e).purchaseRamUpgrade(t,A.a)},upgradeCore:function(e,t){return ve(e).purchaseCoreUpgrade(t,A.a)},upgradeCache:function(e,t){if(!Object(O.i)())return!1;const n=ve(e).purchaseCacheUpgrade(t,A.a);return n&&A.a.hashManager.updateCapacity(A.a),n},getLevelUpgradeCost:function(e,t){return ve(e).calculateLevelUpgradeCost(t,A.a)},getRamUpgradeCost:function(e,t){return ve(e).calculateRamUpgradeCost(t,A.a)},getCoreUpgradeCost:function(e,t){return ve(e).calculateCoreUpgradeCost(t,A.a)},getCacheUpgradeCost:function(e,t){if(!Object(O.i)())return 1/0;return ve(e).calculateCacheUpgradeCost(t)}},sprintf:le,vsprintf:ce,scan:function(e=t.serverIp,a=!0){if(t.checkingRam)return ue("scan",g.CONSTANTS.ScriptScanRamCost);n("scan",g.CONSTANTS.ScriptScanRamCost);var r=Object(D.getServer)(e);if(null==r)throw Object($.d)(t,"Invalid IP or hostname passed into scan() command");for(var i=[],o=0;or.moneyAvailable&&(s=r.moneyAvailable),r.moneyAvailable-=s,r.moneyAvailable<0&&(r.moneyAvailable=0),A.a.gainMoney(s),t.scriptRef.onlineMoneyMade+=s,A.a.scriptProdSinceLastAug+=s,A.a.recordMoneySource(s,"hacking"),t.scriptRef.recordHack(r.ip,s,a),A.a.gainHackingExp(i),t.scriptRef.onlineExpGained+=i,null==t.disableLogs.ALL&&null==t.disableLogs.hack&&t.scriptRef.log("Script SUCCESSFULLY hacked "+r.hostname+" for $"+Object(ae.formatNumber)(s,2)+" and "+Object(ae.formatNumber)(i,4)+" exp (t="+a+")"),r.fortify(g.CONSTANTS.ServerFortifyAmount*Math.min(a,n)),Promise.resolve(s)}return A.a.gainHackingExp(o),t.scriptRef.onlineExpGained+=o,null==t.disableLogs.ALL&&null==t.disableLogs.hack&&t.scriptRef.log("Script FAILED to hack "+r.hostname+". Gained "+Object(ae.formatNumber)(o,4)+" exp (t="+a+")"),Promise.resolve(0)})},hackAnalyzeThreads:function(e,a){if(t.checkingRam)return ue("hackAnalyzeThreads",g.CONSTANTS.ScriptHackAnalyzeRamCost);n("hackAnalyzeThreads",g.CONSTANTS.ScriptHackAnalyzeRamCost);const r=me(e,"hackAnalyzeThreads");if(isNaN(a))throw Object($.d)(t,`Invalid growth argument passed into hackAnalyzeThreads: ${a}. Must be numeric`);if(a<0||a>r.moneyAvailable)return-1;const i=Object(f.e)(r);return a/Math.floor(r.moneyAvailable*i)},hackAnalyzePercent:function(e){if(t.checkingRam)return ue("hackAnalyzePercent",g.CONSTANTS.ScriptHackAnalyzeRamCost);n("hackAnalyzePercent",g.CONSTANTS.ScriptHackAnalyzeRamCost);const a=me(e,"hackAnalyzePercent");return 100*Object(f.e)(a)},hackChance:function(e){if(t.checkingRam)return ue("hackChance",g.CONSTANTS.ScriptHackAnalyzeRamCost);n("hackChance",g.CONSTANTS.ScriptHackAnalyzeRamCost);const a=me(e,"hackChance");return Object(f.b)(a)},sleep:function(e){if(t.checkingRam)return 0;if(void 0===e)throw Object($.d)(t,"sleep() call has incorrect number of arguments. Takes 1 argument");return null==t.disableLogs.ALL&&null==t.disableLogs.sleep&&t.scriptRef.log("Sleeping for "+e+" milliseconds"),Object($.e)(e,t).then(function(){return Promise.resolve(!0)})},grow:function(e){if(t.checkingRam)return ue("grow",g.CONSTANTS.ScriptGrowRamCost);n("grow",g.CONSTANTS.ScriptGrowRamCost);var a=t.scriptRef.threads;if((isNaN(a)||a<1)&&(a=1),void 0===e)throw Object($.d)(t,"grow() call has incorrect number of arguments. Takes 1 argument");var r=Object(D.getServer)(e);if(null==r)throw t.scriptRef.log("Cannot grow(). Invalid IP or hostname passed in: "+e),Object($.d)(t,"Cannot grow(). Invalid IP or hostname passed in: "+e);const i=Object(C.netscriptCanGrow)(r);if(!i.res)throw t.scriptRef.log(`ERROR: ${i.msg}`),Object($.d)(t,i.msg);var o=Object(f.a)(r);return null==t.disableLogs.ALL&&null==t.disableLogs.grow&&t.scriptRef.log("Executing grow() on server "+r.hostname+" in "+Object(ae.formatNumber)(o,3)+" seconds (t="+a+")"),Object($.e)(1e3*o,t).then(function(){if(t.env.stopFlag)return Promise.reject(t);const e=r.moneyAvailable<=0?1:r.moneyAvailable;r.moneyAvailable+=1*a;var n=Object(D.processSingleServerGrowth)(r,450*a,A.a);const i=r.moneyAvailable;t.scriptRef.recordGrow(r.ip,a);var o=Object(f.c)(r)*a;return 1==n&&(o=0),null==t.disableLogs.ALL&&null==t.disableLogs.grow&&t.scriptRef.log("Available money on "+r.hostname+" grown by "+Object(ae.formatNumber)(i/e*100-100,6)+"%. Gained "+Object(ae.formatNumber)(o,4)+" hacking exp (t="+a+")"),t.scriptRef.onlineExpGained+=o,A.a.gainHackingExp(o),Promise.resolve(i/e)})},growthAnalyze:function(e,a){if(t.checkingRam)return ue("growthAnalyze",g.CONSTANTS.ScriptGrowthAnalyzeRamCost);n("growthAnalyze",g.CONSTANTS.ScriptGrowthAnalyzeRamCost);const r=me(e,"growthAnalyze");if(isNaN(a))throw Object($.d)(t,`Invalid growth argument passed into growthAnalyze: ${a}. Must be numeric`);return Object(D.numCycleForGrowth)(r,Number(a),A.a)},weaken:function(e){if(t.checkingRam)return ue("weaken",g.CONSTANTS.ScriptWeakenRamCost);n("weaken",g.CONSTANTS.ScriptWeakenRamCost);var a=t.scriptRef.threads;if((isNaN(a)||a<1)&&(a=1),void 0===e)throw Object($.d)(t,"weaken() call has incorrect number of arguments. Takes 1 argument");var r=Object(D.getServer)(e);if(null==r)throw t.scriptRef.log("Cannot weaken(). Invalid IP or hostname passed in: "+e),Object($.d)(t,"Cannot weaken(). Invalid IP or hostname passed in: "+e);const i=Object(C.netscriptCanWeaken)(r);if(!i.res)throw t.scriptRef.log(`ERROR: ${i.msg}`),Object($.d)(t,i.msg);var o=Object(f.f)(r);return null==t.disableLogs.ALL&&null==t.disableLogs.weaken&&t.scriptRef.log("Executing weaken() on server "+r.hostname+" in "+Object(ae.formatNumber)(o,3)+" seconds (t="+a+")"),Object($.e)(1e3*o,t).then(function(){if(t.env.stopFlag)return Promise.reject(t);r.weaken(g.CONSTANTS.ServerWeakenAmount*a),t.scriptRef.recordWeaken(r.ip,a);var e=Object(f.c)(r)*a;return null==t.disableLogs.ALL&&null==t.disableLogs.weaken&&t.scriptRef.log("Server security level on "+r.hostname+" weakened to "+r.hackDifficulty+". Gained "+Object(ae.formatNumber)(e,4)+" hacking exp (t="+a+")"),t.scriptRef.onlineExpGained+=e,A.a.gainHackingExp(e),Promise.resolve(g.CONSTANTS.ServerWeakenAmount*a)})},print:function(e){if(t.checkingRam)return 0;if(void 0===e)throw Object($.d)(t,"print() call has incorrect number of arguments. Takes 1 argument");t.scriptRef.log(e.toString())},tprint:function(e){if(t.checkingRam)return 0;if(void 0===e||null==e)throw Object($.d)(t,"tprint() call has incorrect number of arguments. Takes 1 argument");e.toString();Object(Q.post)(t.scriptRef.filename+": "+e.toString())},clearLog:function(){if(t.checkingRam)return 0;t.scriptRef.clearLog()},disableLog:function(e){if(t.checkingRam)return 0;if(void 0===be[e])throw Object($.d)(t,"Invalid argument to disableLog: "+e);t.disableLogs[e]=!0,null==t.disableLogs.ALL&&null==t.disableLogs.disableLog&&t.scriptRef.log("Disabled logging for "+e)},enableLog:function(e){if(t.checkingRam)return 0;if(void 0===be[e])throw Object($.d)(t,"Invalid argument to enableLog: "+e);delete t.disableLogs[e],null==t.disableLogs.ALL&&null==t.disableLogs.enableLog&&t.scriptRef.log("Enabled logging for "+e)},isLogEnabled:function(e){if(t.checkingRam)return 0;if(void 0===be[e])throw Object($.d)(t,"Invalid argument to isLogEnabled: "+e);return!t.disableLogs[e]},getScriptLogs:function(e,n){if(t.checkingRam)return 0;if(null!=e&&"string"==typeof e){null==n&&(n=t.serverIp);const a=Object(D.getServer)(n);if(null==a)throw t.log(`getScriptLogs() failed. Invalid IP or hostname passed in: ${n}`),Object($.d)(t,`getScriptLogs() failed. Invalid IP or hostname passed in: ${n}`);let r=[];for(let e=2;e{if(void 0===e)throw Object($.d)(t,"spawn() call has incorrect number of arguments. Usage: spawn(scriptname, numThreads, [arg1], [arg2]...)");if(isNaN(a)||a<0)throw Object($.d)(t,"Invalid argument for thread count passed into run(). Must be numeric and greater than 0");for(var n=[],r=2;r0,i=a.runningScripts.length-1;i>=0;--i)Object(q.d)(a.runningScripts[i],a.ip);return null==t.disableLogs.ALL&&null==t.disableLogs.killall&&t.scriptRef.log("killall(): Killing all scripts on "+a.hostname+". May take a few minutes for the scripts to die"),r},exit:function(){if(t.checkingRam)return 0;var e=Object(D.getServer)(t.serverIp);if(null==e)throw Object($.d)(t,"Error getting Server for this script in exit(). This is a bug please contact game dev");Object(q.d)(t.scriptRef,e.ip)?t.scriptRef.log("Exiting..."):t.scriptRef.log("Exit failed(). This is a bug please contact game developer")},scp:function(e,a,r){if(t.checkingRam)return ue("scp",g.CONSTANTS.ScriptScpRamCost);if(n("scp",g.CONSTANTS.ScriptScpRamCost),2!==arguments.length&&3!==arguments.length)throw Object($.d)(t,"ERROR: scp() call has incorrect number of arguments. Takes 2 or 3 arguments");if(e&&e.constructor===Array){var i=!1;return e.forEach(function(e){Ee(t).scp(e,a,r)&&(i=!0)}),i}if(!e.endsWith(".lit")&&!Object(N.isScriptFilename)(e)&&!e.endsWith("txt"))throw Object($.d)(t,"ERROR: scp() does not work with this file type. It only works for .script, .lit, and .txt files");var o,s;if(null!=r){if(void 0===e||void 0===a||void 0===r)throw Object($.d)(t,"ERROR: scp() call has incorrect number of arguments. Takes 2 or 3 arguments");if(null==(o=Object(D.getServer)(r)))throw Object($.d)(t,`ERROR: Invalid hostname/ip passed into scp() command: ${r}`);if(null==(s=Object(D.getServer)(a)))throw Object($.d)(t,`ERROR: Invalid hostname/ip passed into scp() command: ${a}`)}else{if(null==a)throw Object($.d)(t,"ERROR: scp() call has incorrect number of arguments. Takes 2 or 3 arguments");if(void 0===e||void 0===a)throw Object($.d)(t,"ERROR: scp() call has incorrect number of arguments. Takes 2 or 3 arguments");if(null==(o=Object(D.getServer)(a)))throw Object($.d)(t,`ERROR: Invalid hostname/ip passed into scp() command: ${a}`);if(null==(s=Object(D.getServer)(t.serverIp)))throw Object($.d)(t,"Could not find server ip for this script. This is a bug please contact game developer")}if(e.endsWith(".lit")){for(var l=!1,c=0;c=2&&(i=a.toString());for(var o=[],s=0;sr.maxShares)return t.scriptRef.log(`You cannot purchase this many shares. ${r.symbol} has a maximum of `+`${r.maxShares} shares.`),0;var o=r.playerShares*r.playerAvgPx;A.a.loseMoney(i+g.CONSTANTS.StockMarketCommission);var s=o+i;return r.playerShares+=a,r.playerAvgPx=s/r.playerShares,J.routing.isOn(J.Page.StockMarket)&&Object(j.r)(r),null==t.disableLogs.ALL&&null==t.disableLogs.buyStock&&t.scriptRef.log("Bought "+Object(ae.formatNumber)(a,0)+" shares of "+r.symbol+" at $"+Object(ae.formatNumber)(r.price,2)+" per share"),r.price},sellStock:function(e,a){if(t.checkingRam)return ue("sellStock",g.CONSTANTS.ScriptBuySellStockRamCost);if(n("sellStock",g.CONSTANTS.ScriptBuySellStockRamCost),!A.a.hasTixApiAccess)throw Object($.d)(t,"You don't have TIX API Access! Cannot use sellStock()");var r=j.e[e];if(null==r)throw Object($.d)(t,"Invalid stock symbol passed into sellStock()");if(a<0||isNaN(a))return t.scriptRef.log("ERROR: Invalid 'shares' argument passed to sellStock()"),0;if((a=Math.round(a))>r.playerShares&&(a=r.playerShares),0===a)return 0;var i=r.price*a-g.CONSTANTS.StockMarketCommission;A.a.gainMoney(i);var o=(r.price-r.playerAvgPx)*a-g.CONSTANTS.StockMarketCommission;return isNaN(o)&&(o=0),t.scriptRef.onlineMoneyMade+=o,A.a.scriptProdSinceLastAug+=o,A.a.recordMoneySource(o,"stock"),r.playerShares-=a,0==r.playerShares&&(r.playerAvgPx=0),J.routing.isOn(J.Page.StockMarket)&&Object(j.r)(r),null==t.disableLogs.ALL&&null==t.disableLogs.sellStock&&t.scriptRef.log("Sold "+Object(ae.formatNumber)(a,0)+" shares of "+r.symbol+" at $"+Object(ae.formatNumber)(r.price,2)+" per share. Gained $"+Object(ae.formatNumber)(i,2)),r.price},shortStock(e,a){if(t.checkingRam)return ue("shortStock",g.CONSTANTS.ScriptBuySellStockRamCost);if(n("shortStock",g.CONSTANTS.ScriptBuySellStockRamCost),!A.a.hasTixApiAccess)throw Object($.d)(t,"You don't have TIX API Access! Cannot use shortStock()");if(8!==A.a.bitNodeN&&!(ge&&ye>=2))throw Object($.d)(t,"ERROR: Cannot use shortStock(). You must either be in BitNode-8 or you must have Level 2 of Source-File 8");var r=j.e[e];if(null==r)throw Object($.d)(t,"ERROR: Invalid stock symbol passed into shortStock()");return Object(j.p)(r,a,t)?r.price:0},sellShort(e,a){if(t.checkingRam)return ue("sellShort",g.CONSTANTS.ScriptBuySellStockRamCost);if(n("sellShort",g.CONSTANTS.ScriptBuySellStockRamCost),!A.a.hasTixApiAccess)throw Object($.d)(t,"You don't have TIX API Access! Cannot use sellShort()");if(8!==A.a.bitNodeN&&!(ge&&ye>=2))throw Object($.d)(t,"ERROR: Cannot use sellShort(). You must either be in BitNode-8 or you must have Level 2 of Source-File 8");var r=j.e[e];if(null==r)throw Object($.d)(t,"ERROR: Invalid stock symbol passed into sellShort()");return Object(j.n)(r,a,t)?r.price:0},placeOrder(e,a,r,i,o){if(t.checkingRam)return ue("placeOrder",g.CONSTANTS.ScriptBuySellStockRamCost);if(n("placeOrder",g.CONSTANTS.ScriptBuySellStockRamCost),!A.a.hasTixApiAccess)throw Object($.d)(t,"You don't have TIX API Access! Cannot use placeOrder()");if(8!==A.a.bitNodeN&&!(ge&&ye>=3))throw Object($.d)(t,"ERROR: Cannot use placeOrder(). You must either be in BitNode-8 or have Level 3 of Source-File 8");var s,l,c=j.e[e];if(null==c)throw Object($.d)(t,"ERROR: Invalid stock symbol passed into placeOrder()");if((i=i.toLowerCase()).includes("limit")&&i.includes("buy"))s=j.a.LimitBuy;else if(i.includes("limit")&&i.includes("sell"))s=j.a.LimitSell;else if(i.includes("stop")&&i.includes("buy"))s=j.a.StopBuy;else{if(!i.includes("stop")||!i.includes("sell"))throw Object($.d)(t,"ERROR: Invalid Order Type passed into placeOrder()");s=j.a.StopSell}if((o=o.toLowerCase()).includes("l"))l=j.b.Long;else{if(!o.includes("s"))throw Object($.d)(t,"ERROR: Invalid Position Type passed into placeOrder()");l=j.b.Short}return Object(j.l)(c,a,r,s,l,t)},cancelOrder(e,a,r,i,o){if(t.checkingRam)return ue("cancelOrder",g.CONSTANTS.ScriptBuySellStockRamCost);if(n("cancelOrder",g.CONSTANTS.ScriptBuySellStockRamCost),!A.a.hasTixApiAccess)throw Object($.d)(t,"You don't have TIX API Access! Cannot use cancelOrder()");if(8!==A.a.bitNodeN&&!(ge&&ye>=3))throw Object($.d)(t,"ERROR: Cannot use cancelOrder(). You must either be in BitNode-8 or have Level 3 of Source-File 8");var s,l,c=j.e[e];if(null==c)throw Object($.d)(t,"ERROR: Invalid stock symbol passed into cancelOrder()");if(isNaN(a)||isNaN(r))throw Object($.d)(t,"ERROR: Invalid shares or price argument passed into cancelOrder(). Must be numeric");if((i=i.toLowerCase()).includes("limit")&&i.includes("buy"))s=j.a.LimitBuy;else if(i.includes("limit")&&i.includes("sell"))s=j.a.LimitSell;else if(i.includes("stop")&&i.includes("buy"))s=j.a.StopBuy;else{if(!i.includes("stop")||!i.includes("sell"))throw Object($.d)(t,"ERROR: Invalid Order Type passed into placeOrder()");s=j.a.StopSell}if((o=o.toLowerCase()).includes("l"))l=j.b.Long;else{if(!o.includes("s"))throw Object($.d)(t,"ERROR: Invalid Position Type passed into placeOrder()");l=j.b.Short}var u={stock:c,shares:a,price:r,type:s,pos:l};return Object(j.f)(u,t)},getOrders:function(){if(t.checkingRam)return ue("getOrders",g.CONSTANTS.ScriptBuySellStockRamCost);if(n("getOrders",g.CONSTANTS.ScriptBuySellStockRamCost),!A.a.hasTixApiAccess)throw Object($.d)(t,"You don't have TIX API Access! Cannot use getOrders()");if(8!==A.a.bitNodeN&&!(ge&&ye>=3))throw Object($.d)(t,"ERROR: Cannot use getOrders(). You must either be in BitNode-8 or have Level 3 of Source-File 8");const e={},a=j.c.Orders;for(let t in a){const n=a[t];if(n.constructor===Array&&n.length>0){e[t]=[];for(let a=0;a=Object(B.b)())return t.log(`ERROR: You have reached the maximum limit of ${Object(B.b)()} servers. You cannot purchase any more.`),"";const i=Object(B.a)(a);if(i===1/0)return t.log("ERROR: 'purchaseServer()' failed due to an invalid 'ram' argument"),1/0;if(A.a.money.lt(i))return t.log("ERROR: Not enough money to purchase server. Need $"+Object(ae.formatNumber)(i,2)),"";var o=new L.Server({ip:Object(ne.createRandomIp)(),hostname:r,organizationName:"",isConnectedTo:!1,adminRights:!0,purchasedByPlayer:!0,maxRam:a});Object(I.AddToAllServers)(o),A.a.purchasedServers.push(o.ip);var s=A.a.getHomeComputer();return s.serversOnNetwork.push(o.ip),o.serversOnNetwork.push(s.ip),A.a.loseMoney(i),null==t.disableLogs.ALL&&null==t.disableLogs.purchaseServer&&t.scriptRef.log("Purchased new server with hostname "+o.hostname+" for $"+Object(ae.formatNumber)(i,2)),o.hostname},deleteServer:function(e){if(t.checkingRam)return ue("deleteServer",g.CONSTANTS.ScriptPurchaseServerRamCost);n("deleteServer",g.CONSTANTS.ScriptPurchaseServerRamCost);var a=String(e);a=a.replace(/\s\s+/g,"");var r=Object(D.GetServerByHostname)(a);if(null==r)return t.scriptRef.log("ERROR: Could not find server with hostname "+a+". deleteServer() failed"),!1;if(!r.purchasedByPlayer||"home"===r.hostname)return t.scriptRef.log("ERROR: Server "+r.hostname+" is not a purchased server. Cannot be deleted. deleteServer() failed"),!1;var i=r.ip;if(r.isConnectedTo)return t.scriptRef.log("ERROR: deleteServer() failed because you are currently connected to the server you are trying to delete"),!1;if(i===t.serverIp)return t.scriptRef.log("ERROR: Cannot call deleteServer() on self. deleteServer() failed"),!1;if(r.runningScripts.length>0)return t.scriptRef.log("ERROR: Cannot delete server "+r.hostname+" because it still has scripts running."),!1;for(var o=!1,s=0;sg.CONSTANTS.NumNetscriptPorts)throw Object($.d)(t,"ERROR: Trying to write to invalid port: "+e+". Only ports 1-"+g.CONSTANTS.NumNetscriptPorts+" are valid.");if(null==(e=q.a[e-1])||!(e instanceof Y.a))throw Object($.d)(t,"Could not find port: "+e+". This is a bug contact the game developer");return e.write(a)},tryWrite:function(e,a=""){if(t.checkingRam)return ue("tryWrite",g.CONSTANTS.ScriptReadWriteRamCost);if(n("tryWrite",g.CONSTANTS.ScriptReadWriteRamCost),isNaN(e))throw Object($.d)(t,"Invalid argument passed in for tryWrite: "+e);if((e=Math.round(e))<1||e>g.CONSTANTS.NumNetscriptPorts)throw Object($.d)(t,"ERROR: tryWrite() called on invalid port: "+e+". Only ports 1-"+g.CONSTANTS.NumNetscriptPorts+" are valid.");if(null==(e=q.a[e-1])||!(e instanceof Y.a))throw Object($.d)(t,"Could not find port: "+e+". This is a bug contact the game developer");return e.tryWrite(a)},read:function(e){if(t.checkingRam)return ue("read",g.CONSTANTS.ScriptReadWriteRamCost);if(n("read",g.CONSTANTS.ScriptReadWriteRamCost),isNaN(e)){if(Object(re.isString)(e)){let n=e,a=Object(D.getServer)(t.serverIp);if(null==a)throw Object($.d)(t,"Error getting Server for this script in read(). This is a bug please contact game dev");if(Object(N.isScriptFilename)(n)){let e=t.getScriptOnServer(n);return null==e?"":e.code}{let e=Object(H.getTextFile)(n,a);return null!==e?e.text:""}}throw Object($.d)(t,"Invalid argument passed in for read(): "+e)}if((e=Math.round(e))<1||e>g.CONSTANTS.NumNetscriptPorts)throw Object($.d)(t,"ERROR: Trying to read from invalid port: "+e+". Only ports 1-"+g.CONSTANTS.NumNetscriptPorts+" are valid.");if(null==(e=q.a[e-1])||!(e instanceof Y.a))throw Object($.d)(t,"ERROR: Could not find port: "+e+". This is a bug contact the game developer");return e.read()},peek:function(e){if(t.checkingRam)return ue("peek",g.CONSTANTS.ScriptReadWriteRamCost);if(n("peek",g.CONSTANTS.ScriptReadWriteRamCost),isNaN(e))throw Object($.d)(t,"ERROR: peek() called with invalid argument. Must be a port number between 1 and "+g.CONSTANTS.NumNetscriptPorts);if((e=Math.round(e))<1||e>g.CONSTANTS.NumNetscriptPorts)throw Object($.d)(t,"ERROR: peek() called with invalid argument. Must be a port number between 1 and "+g.CONSTANTS.NumNetscriptPorts);if(null==(e=q.a[e-1])||!(e instanceof Y.a))throw Object($.d)(t,"ERROR: Could not find port: "+e+". This is a bug contact the game developer");return e.peek()},clear:function(e){if(t.checkingRam)return ue("clear",g.CONSTANTS.ScriptReadWriteRamCost);if(n("clear",g.CONSTANTS.ScriptReadWriteRamCost),!isNaN(e)){if((e=Math.round(e))<1||e>g.CONSTANTS.NumNetscriptPorts)throw Object($.d)(t,"ERROR: Trying to clear invalid port: "+e+". Only ports 1-"+g.CONSTANTS.NumNetscriptPorts+" are valid");if(null==(e=q.a[e-1])||!(e instanceof Y.a))throw Object($.d)(t,"ERROR: Could not find port: "+e+". This is a bug contact the game developer");return e.clear()}if(!Object(re.isString)(e))throw Object($.d)(t,"Invalid argument passed in for clear(): "+e);var a=e,r=Object(D.getServer)(t.serverIp);if(null==r)throw Object($.d)(t,"Error getting Server for this script in clear(). This is a bug please contact game dev");var i=Object(H.getTextFile)(a,r);return null!=i&&i.write(""),0},getPortHandle:function(e){if(t.checkingRam)return ue("getPortHandle",10*g.CONSTANTS.ScriptReadWriteRamCost);if(n("getPortHandle",10*g.CONSTANTS.ScriptReadWriteRamCost),isNaN(e))throw Object($.d)(t,"ERROR: Invalid argument passed into getPortHandle(). Must be an integer between 1 and "+g.CONSTANTS.NumNetscriptPorts);if((e=Math.round(e))<1||e>g.CONSTANTS.NumNetscriptPorts)throw Object($.d)(t,"ERROR: getPortHandle() called with invalid port number: "+e+". Only ports 1-"+g.CONSTANTS.NumNetscriptPorts+" are valid");if(null==(e=q.a[e-1])||!(e instanceof Y.a))throw Object($.d)(t,"ERROR: Could not find port: "+e+". This is a bug contact the game developer");return e},rm:function(e,a){if(t.checkingRam)return ue("rm",g.CONSTANTS.ScriptReadWriteRamCost);n("rm",g.CONSTANTS.ScriptReadWriteRamCost),null!=a&&""!==a||(a=t.serverIp);var r=Object(D.getServer)(a);if(null==r)throw Object($.d)(t,`Invalid server specified for rm(): ${a}`);if(e.endsWith(".exe")){for(var i=0;i{Object(se.removeElementById)(n),e(!0)}}),i=Object(ie.createElement)("button",{class:"popup-box-button",innerText:"No",clickListener:()=>{Object(se.removeElementById)(n),e(!1)}});Object(oe.createPopup)(n,[a,r,i])})},wget:async function(n,a,r=t.serverIp){if(t.checkingRam)return 0;if(!Object(N.isScriptFilename)(a)&&!a.endsWith(".txt"))return workerSript.log(`ERROR: wget() failed because of an invalid target file: ${a}. Target file must be a script or text file`),Promise.resolve(!1);var i=me(r,"wget");return new Promise(function(o,s){e.get(n,function(e){let n;return(n=Object(N.isScriptFilename)(a)?i.writeToScriptFile(a,e):i.writeToTextFile(a,e)).success?n.overwritten?(t.log(`wget() successfully retrieved content and overwrote ${a} on ${r}`),o(!0)):(t.log(`wget successfully retrieved content to new file ${a} on ${r}`),o(!0)):(t.log("ERROR: wget() failed"),o(!1))},"text").fail(function(e){return t.log(`ERROR: wget() failed: ${JSON.stringify(e)}`),o(!1)})})},getFavorToDonate:function(){return t.checkingRam?ue("getFavorToDonate",g.CONSTANTS.ScriptGetFavorToDonate):(n("getFavorToDonate",g.CONSTANTS.ScriptGetFavorToDonate),Math.floor(g.CONSTANTS.BaseFavorToDonate*l.BitNodeMultipliers.RepToDonateToFaction))},universityCourse:function(e,a){var r=g.CONSTANTS.ScriptSingularityFn1RamCost;if(4!==A.a.bitNodeN&&(r*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return ue("universityCourse",r);if(n("universityCourse",r),4!=A.a.bitNodeN&&!(pe&&fe>=1))throw Object($.d)(t,"Cannot run universityCourse(). It is a Singularity Function and requires SourceFile-4 (level 1) to run.");if(!P.c){if(A.a.isWorking){var i=A.a.singularityStopWork();null==t.disableLogs.ALL&&null==t.disableLogs.universityCourse&&t.scriptRef.log(i)}var o,s,l;switch(e.toLowerCase()){case S.Locations.AevumSummitUniversity.toLowerCase():if(A.a.city!=S.Locations.Aevum)return t.scriptRef.log("ERROR: You cannot study at Summit University because you are not in Aevum. universityCourse() failed"),!1;A.a.location=S.Locations.AevumSummitUniversity,o=4,s=3;break;case S.Locations.Sector12RothmanUniversity.toLowerCase():if(A.a.city!=S.Locations.Sector12)return t.scriptRef.log("ERROR: You cannot study at Rothman University because you are not in Sector-12. universityCourse() failed"),!1;A.a.location=S.Locations.Sector12RothmanUniversity,o=3,s=2;break;case S.Locations.VolhavenZBInstituteOfTechnology.toLowerCase():if(A.a.city!=S.Locations.Volhaven)return t.scriptRef.log("ERROR: You cannot study at ZB Institute of Technology because you are not in Volhaven. universityCourse() failed"),!1;A.a.location=S.Locations.VolhavenZBInstituteOfTechnology,o=5,s=4;break;default:return t.scriptRef.log("Invalid university name: "+e+". universityCourse() failed"),!1}switch(a.toLowerCase()){case"Study Computer Science".toLowerCase():l=g.CONSTANTS.ClassStudyComputerScience;break;case"Data Structures".toLowerCase():l=g.CONSTANTS.ClassDataStructures;break;case"Networks".toLowerCase():l=g.CONSTANTS.ClassNetworks;break;case"Algorithms".toLowerCase():l=g.CONSTANTS.ClassAlgorithms;break;case"Management".toLowerCase():l=g.CONSTANTS.ClassManagement;break;case"Leadership".toLowerCase():l=g.CONSTANTS.ClassLeadership;break;default:return t.scriptRef.log("Invalid class name: "+a+". universityCourse() failed"),!1}return A.a.startClass(o,s,l),null==t.disableLogs.ALL&&null==t.disableLogs.universityCourse&&t.scriptRef.log("Started "+l+" at "+e),!0}t.scriptRef.log("ERROR: universityCourse() failed because you are in the middle of a mission.")},gymWorkout:function(e,a){var r=g.CONSTANTS.ScriptSingularityFn1RamCost;if(4!==A.a.bitNodeN&&(r*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return ue("gymWorkout",r);if(n("gymWorkout",r),4!=A.a.bitNodeN&&!(pe&&fe>=1))throw Object($.d)(t,"Cannot run gymWorkout(). It is a Singularity Function and requires SourceFile-4 (level 1) to run.");if(!P.c){if(A.a.isWorking){var i=A.a.singularityStopWork();null==t.disableLogs.ALL&&null==t.disableLogs.gymWorkout&&t.scriptRef.log(i)}var o,s;switch(e.toLowerCase()){case S.Locations.AevumCrushFitnessGym.toLowerCase():if(A.a.city!=S.Locations.Aevum)return t.scriptRef.log("ERROR: You cannot workout at Crush Fitness because you are not in Aevum. gymWorkout() failed"),!1;A.a.location=S.Locations.AevumCrushFitnessGym,o=3,s=2;break;case S.Locations.AevumSnapFitnessGym.toLowerCase():if(A.a.city!=S.Locations.Aevum)return t.scriptRef.log("ERROR: You cannot workout at Snap Fitness because you are not in Aevum. gymWorkout() failed"),!1;A.a.location=S.Locations.AevumSnapFitnessGym,o=10,s=5;break;case S.Locations.Sector12IronGym.toLowerCase():if(A.a.city!=S.Locations.Sector12)return t.scriptRef.log("ERROR: You cannot workout at Iron Gym because you are not in Sector-12. gymWorkout() failed"),!1;A.a.location=S.Locations.Sector12IronGym,o=1,s=1;break;case S.Locations.Sector12PowerhouseGym.toLowerCase():if(A.a.city!=S.Locations.Sector12)return t.scriptRef.log("ERROR: You cannot workout at Powerhouse Gym because you are not in Sector-12. gymWorkout() failed"),!1;A.a.location=S.Locations.Sector12PowerhouseGym,o=20,s=10;break;case S.Locations.VolhavenMilleniumFitnessGym.toLowerCase():if(A.a.city!=S.Locations.Volhaven)return t.scriptRef.log("ERROR: You cannot workout at Millenium Fitness Gym because you are not in Volhaven. gymWorkout() failed"),!1;A.a.location=S.Locations.VolhavenMilleniumFitnessGym,o=7,s=4;break;default:return t.scriptRef.log("Invalid gym name: "+e+". gymWorkout() failed"),!1}switch(a.toLowerCase()){case"strength".toLowerCase():case"str".toLowerCase():A.a.startClass(o,s,g.CONSTANTS.ClassGymStrength);break;case"defense".toLowerCase():case"def".toLowerCase():A.a.startClass(o,s,g.CONSTANTS.ClassGymDefense);break;case"dexterity".toLowerCase():case"dex".toLowerCase():A.a.startClass(o,s,g.CONSTANTS.ClassGymDexterity);break;case"agility".toLowerCase():case"agi".toLowerCase():A.a.startClass(o,s,g.CONSTANTS.ClassGymAgility);break;default:return t.scriptRef.log("Invalid stat: "+a+". gymWorkout() failed"),!1}return null==t.disableLogs.ALL&&null==t.disableLogs.gymWorkout&&t.scriptRef.log("Started training "+a+" at "+e),!0}t.scriptRef.log("ERROR: gymWorkout() failed because you are in the middle of a mission.")},travelToCity(e){var a=g.CONSTANTS.ScriptSingularityFn1RamCost;if(4!==A.a.bitNodeN&&(a*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return ue("travelToCity",a);if(n("travelToCity",a),4!=A.a.bitNodeN&&!(pe&&fe>=1))throw Object($.d)(t,"Cannot run travelToCity(). It is a Singularity Function and requires SourceFile-4 (level 1) to run.");switch(e){case S.Locations.Aevum:case S.Locations.Chongqing:case S.Locations.Sector12:case S.Locations.NewTokyo:case S.Locations.Ishima:case S.Locations.Volhaven:if(A.a.money.lt(g.CONSTANTS.TravelCost))throw t.scriptRef.log("ERROR: not enough money to travel with travelToCity()."),Object($.d)(t,"ERROR: not enough money to travel with travelToCity().");return A.a.loseMoney(g.CONSTANTS.TravelCost),A.a.city=e,null==t.disableLogs.ALL&&null==t.disableLogs.travelToCity&&t.scriptRef.log("Traveled to "+e),!0;default:return t.scriptRef.log("ERROR: Invalid city name passed into travelToCity()."),!1}},purchaseTor(){var e=g.CONSTANTS.ScriptSingularityFn1RamCost;if(4!==A.a.bitNodeN&&(e*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return ue("purchaseTor",e);if(n("purchaseTor",e),4!=A.a.bitNodeN&&!(pe&&fe>=1))throw Object($.d)(t,"Cannot run purchaseTor(). It is a Singularity Function and requires SourceFile-4 (level 1) to run.");if(null!=W.SpecialServerIps["Darkweb Server"])return t.scriptRef.log("You already have a TOR router! purchaseTor() failed"),!1;if(A.a.money.lt(g.CONSTANTS.TorRouterCost))return t.scriptRef.log("ERROR: You cannot afford to purchase a Tor router. purchaseTor() failed"),!1;A.a.loseMoney(g.CONSTANTS.TorRouterCost);var a=new L.Server({ip:Object(ne.createRandomIp)(),hostname:"darkweb",organizationName:"",isConnectedTo:!1,adminRights:!1,purchasedByPlayer:!1,maxRam:1});Object(I.AddToAllServers)(a),W.SpecialServerIps.addIp("Darkweb Server",a.ip);const r=document.getElementById("location-purchase-tor");return r.setAttribute("class","a-link-button-bought"),r.innerHTML="TOR Router - Purchased",A.a.getHomeComputer().serversOnNetwork.push(a.ip),a.serversOnNetwork.push(A.a.getHomeComputer().ip),A.a.gainIntelligenceExp(g.CONSTANTS.IntelligenceSingFnBaseExpGain),null==t.disableLogs.ALL&&null==t.disableLogs.purchaseTor&&t.scriptRef.log("You have purchased a Tor router!"),!0},purchaseProgram(e){var a=g.CONSTANTS.ScriptSingularityFn1RamCost;if(4!==A.a.bitNodeN&&(a*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return ue("purchaseProgram",a);if(n("purchaseProgram",a),4!=A.a.bitNodeN&&!(pe&&fe>=1))throw Object($.d)(t,"Cannot run purchaseProgram(). It is a Singularity Function and requires SourceFile-4 (level 1) to run.");if(null==W.SpecialServerIps["Darkweb Server"])return t.scriptRef.log("ERROR: You do not have the TOR router. purchaseProgram() failed."),!1;e=e.toLowerCase();let r=null;for(const t in _.DarkWebItems){const n=_.DarkWebItems[t];n.program.toLowerCase()==e&&(r=n)}return null==r?(t.scriptRef.log("ERROR: Invalid program name passed into purchaseProgram()."),!1):A.a.money.lt(r.price)?(t.scriptRef.log("Not enough money to purchase "+r.program),!1):A.a.hasProgram(r.program)?(t.scriptRef.log("You already have the "+r.program+" program"),!0):(A.a.loseMoney(r.price),A.a.getHomeComputer().programs.push(r.program),null==t.disableLogs.ALL&&null==t.disableLogs.purchaseProgram&&t.scriptRef.log("You have purchased the "+r.program+" program. The new program can be found on your home computer."),!0)},getStats:function(){var e=g.CONSTANTS.ScriptSingularityFn1RamCost/4;if(4!==A.a.bitNodeN&&(e*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return ue("getStats",e);if(n("getStats",e),4!=A.a.bitNodeN&&!(pe&&fe>=1))throw Object($.d)(t,"Cannot run getStats(). It is a Singularity Function and requires SourceFile-4 (level 1) to run.");return{hacking:A.a.hacking_skill,strength:A.a.strength,defense:A.a.defense,dexterity:A.a.dexterity,agility:A.a.agility,charisma:A.a.charisma,intelligence:A.a.intelligence}},getCharacterInformation:function(){var e=g.CONSTANTS.ScriptSingularityFn1RamCost/4;if(4!==A.a.bitNodeN&&(e*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return ue("getCharacterInformation",e);if(n("getCharacterInformation",e),4!=A.a.bitNodeN&&!(pe&&fe>=1))throw Object($.d)(t,"Cannot run getCharacterInformation(). It is a Singularity Function and requires SourceFile-4 (level 1) to run.");return{bitnode:A.a.bitNodeN,city:A.a.city,factions:A.a.factions.slice(),hp:A.a.hp,jobs:Object.keys(A.a.jobs),jobTitles:Object.values(A.a.jobs),maxHp:A.a.max_hp,mult:{agility:A.a.agility_mult,agilityExp:A.a.agility_exp_mult,companyRep:A.a.company_rep_mult,crimeMoney:A.a.crime_money_mult,crimeSuccess:A.a.crime_success_mult,defense:A.a.defense_mult,defenseExp:A.a.defense_exp_mult,dexterity:A.a.dexterity_mult,dexterityExp:A.a.dexterity_exp_mult,factionRep:A.a.faction_rep_mult,hacking:A.a.hacking_mult,hackingExp:A.a.hacking_exp_mult,strength:A.a.strength_mult,strengthExp:A.a.strength_exp_mult,workMoney:A.a.work_money_mult},timeWorked:A.a.timeWorked,tor:W.SpecialServerIps.hasOwnProperty("Darkweb Server"),workHackExpGain:A.a.workHackExpGained,workStrExpGain:A.a.workStrExpGained,workDefExpGain:A.a.workDefExpGained,workDexExpGain:A.a.workDexExpGained,workAgiExpGain:A.a.workAgiExpGained,workChaExpGain:A.a.workChaExpGained,workRepGain:A.a.workRepGained,workMoneyGain:A.a.workMoneyGained}},isBusy:function(){var e=g.CONSTANTS.ScriptSingularityFn1RamCost/4;if(4!==A.a.bitNodeN&&(e*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return ue("isBusy",e);if(n("isBusy",e),4!=A.a.bitNodeN&&!(pe&&fe>=1))throw Object($.d)(t,"Cannot run isBusy(). It is a Singularity Function and requires SourceFile-4 (level 1) to run.");return A.a.isWorking},stopAction:function(){var e=g.CONSTANTS.ScriptSingularityFn1RamCost/2;if(4!==A.a.bitNodeN&&(e*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return ue("stopAction",e);if(n("stopAction",e),4!=A.a.bitNodeN&&!(pe&&fe>=1))throw Object($.d)(t,"Cannot run stopAction(). It is a Singularity Function and requires SourceFile-4 (level 1) to run.");if(A.a.isWorking){var a=A.a.singularityStopWork();return null==t.disableLogs.ALL&&null==t.disableLogs.stopAction&&t.scriptRef.log(a),!0}return!1},upgradeHomeRam:function(){var e=g.CONSTANTS.ScriptSingularityFn2RamCost;if(4!==A.a.bitNodeN&&(e*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return ue("upgradeHomeRam",e);if(n("upgradeHomeRam",e),4!=A.a.bitNodeN&&!(pe&&fe>=2))throw Object($.d)(t,"Cannot run upgradeHomeRam(). It is a Singularity Function and requires SourceFile-4 (level 2) to run.");const a=A.a.getHomeComputer();if(a.maxRam>=g.CONSTANTS.HomeComputerMaxRam)return t.log("ERROR: upgradeHomeRam() failed because your home computer is at max RAM"),!1;const r=A.a.getUpgradeHomeRamCost();return A.a.money.lt(r)?(t.scriptRef.log("ERROR: upgradeHomeRam() failed because you don't have enough money"),!1):(a.maxRam*=2,A.a.loseMoney(r),A.a.gainIntelligenceExp(g.CONSTANTS.IntelligenceSingFnBaseExpGain),null==t.disableLogs.ALL&&null==t.disableLogs.upgradeHomeRam&&t.scriptRef.log("Purchased additional RAM for home computer! It now has "+a.maxRam+"GB of RAM."),!0)},getUpgradeHomeRamCost:function(){var e=g.CONSTANTS.ScriptSingularityFn2RamCost/2;if(4!==A.a.bitNodeN&&(e*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return ue("getUpgradeHomeRamCost",e);if(n("getUpgradeHomeRamCost",e),4!=A.a.bitNodeN&&!(pe&&fe>=2))throw Object($.d)(t,"Cannot run getUpgradeHomeRamCost(). It is a Singularity Function and requires SourceFile-4 (level 2) to run.");return A.a.getUpgradeHomeRamCost()},workForCompany:function(e){var a=g.CONSTANTS.ScriptSingularityFn2RamCost;if(4!==A.a.bitNodeN&&(a*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return ue("workForCompany",a);if(n("workForCompany",a),4!=A.a.bitNodeN&&!(pe&&fe>=2))throw Object($.d)(t,"Cannot run workForCompany(). It is a Singularity Function and requires SourceFile-4 (level 2) to run.");if(null==e&&(e=A.a.companyName),null==e||""===e||!(h.Companies[e]instanceof p.Company))return t.scriptRef.log(`ERROR: workForCompany() failed because of an invalid company specified: ${e}`),!1;if(!Object.keys(A.a.jobs).includes(e))return t.scriptRef.log(`ERROR: workForCompany() failed because you do not have a job at ${e}`),!1;if(P.c)return t.scriptRef.log("ERROR: workForCompany() failed because you are in the middle of a mission."),!1;const r=A.a.jobs[e],i=d.CompanyPositions[r];if(""===r||!(i instanceof m.CompanyPosition))return t.scriptRef.log("ERROR: workForCompany() failed because you do not have a job"),!1;if(A.a.isWorking){var o=A.a.singularityStopWork();null==t.disableLogs.ALL&&null==t.disableLogs.workForCompany&&t.scriptRef.log(o)}return i.isPartTimeJob()?A.a.startWorkPartTime(e):A.a.startWork(e),null==t.disableLogs.ALL&&null==t.disableLogs.workForCompany&&t.log(`Began working at ${A.a.companyName} as a ${r}`),!0},applyToCompany:function(e,a){var r,i=g.CONSTANTS.ScriptSingularityFn2RamCost;if(4!==A.a.bitNodeN&&(i*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return ue("applyToCompany",i);if(n("applyToCompany",i),4!=A.a.bitNodeN&&!(pe&&fe>=2))throw Object($.d)(t,"Cannot run applyToCompany(). It is a Singularity Function and requires SourceFile-4 (level 2) to run.");if(!Object(h.companyExists)(e))return t.scriptRef.log("ERROR: applyToCompany() failed because specified company "+e+" does not exist."),!1;switch(A.a.location=e,a.toLowerCase()){case"software":r=A.a.applyForSoftwareJob(!0);break;case"software consultant":r=A.a.applyForSoftwareConsultantJob(!0);break;case"it":r=A.a.applyForItJob(!0);break;case"security engineer":r=A.a.applyForSecurityEngineerJob(!0);break;case"network engineer":r=A.a.applyForNetworkEngineerJob(!0);break;case"business":r=A.a.applyForBusinessJob(!0);break;case"business consultant":r=A.a.applyForBusinessConsultantJob(!0);break;case"security":r=A.a.applyForSecurityJob(!0);break;case"agent":r=A.a.applyForAgentJob(!0);break;case"employee":r=A.a.applyForEmployeeJob(!0);break;case"part-time employee":r=A.a.applyForPartTimeEmployeeJob(!0);break;case"waiter":r=A.a.applyForWaiterJob(!0);break;case"part-time waiter":r=A.a.applyForPartTimeWaiterJob(!0);break;default:return t.scriptRef.log("ERROR: Invalid job passed into applyToCompany: "+a+". applyToCompany() failed"),!1}return Object(re.isString)(r)?(t.scriptRef.log(r),!1):(r?null==t.disableLogs.ALL&&null==t.disableLogs.applyToCompany&&t.log(`You were offered a new job at ${e} as a ${A.a.jobs[e]}`):null==t.disableLogs.ALL&&null==t.disableLogs.applyToCompany&&t.log(`You failed to get a new job/promotion at ${e} in the ${a} field.`),r)},getCompanyRep:function(e){var a=g.CONSTANTS.ScriptSingularityFn2RamCost/2;if(4!==A.a.bitNodeN&&(a*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return ue("getCompanyRep",a);if(n("getCompanyRep",a),4!=A.a.bitNodeN&&!(pe&&fe>=2))throw Object($.d)(t,"Cannot run getCompanyRep(). It is a Singularity Function and requires SourceFile-4 (level 2) to run.");var r=h.Companies[e];return null!=r&&r instanceof p.Company?r.playerReputation:(t.scriptRef.log("ERROR: Invalid companyName passed into getCompanyRep(): "+e),-1)},getCompanyFavor:function(e){var a=g.CONSTANTS.ScriptSingularityFn2RamCost/4;if(4!==A.a.bitNodeN&&(a*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return ue("getCompanyFavor",a);if(n("getCompanyFavor",a),4!=A.a.bitNodeN&&!(pe&&fe>=2))throw Object($.d)(t,"Cannot run getCompanyFavor(). It is a Singularity Function and requires SourceFile-4 (level 2) to run.");var r=h.Companies[e];return null!=r&&r instanceof p.Company?r.favor:(t.scriptRef.log("ERROR: Invalid companyName passed into getCompanyFavor(): "+e),-1)},getCompanyFavorGain:function(e){var a=g.CONSTANTS.ScriptSingularityFn2RamCost/4;if(4!==A.a.bitNodeN&&(a*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return ue("getCompanyFavorGain",a);if(n("getCompanyFavorGain",a),4!=A.a.bitNodeN&&!(pe&&fe>=2))throw Object($.d)(t,"Cannot run getCompanyFavorGain(). It is a Singularity Function and requires SourceFile-4 (level 2) to run.");var r=h.Companies[e];return null!=r&&r instanceof p.Company?r.getFavorGain()[0]:(t.scriptRef.log("ERROR: Invalid companyName passed into getCompanyFavorGain(): "+e),-1)},checkFactionInvitations:function(){var e=g.CONSTANTS.ScriptSingularityFn2RamCost;if(4!==A.a.bitNodeN&&(e*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return ue("checkFactionInvitations",e);if(n("checkFactionInvitations",e),4!=A.a.bitNodeN&&!(pe&&fe>=2))throw Object($.d)(t,"Cannot run checkFactionInvitations(). It is a Singularity Function and requires SourceFile-4 (level 2) to run.");return A.a.factionInvitations.slice()},joinFaction:function(e){var a=g.CONSTANTS.ScriptSingularityFn2RamCost;if(4!==A.a.bitNodeN&&(a*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return ue("joinFaction",a);if(n("joinFaction",a),4!=A.a.bitNodeN&&!(pe&&fe>=2))throw Object($.d)(t,"Cannot run joinFaction(). It is a Singularity Function and requires SourceFile-4 (level 2) to run.");if(!Object(v.factionExists)(e))return t.scriptRef.log("ERROR: Faction specified in joinFaction() does not exist."),!1;if(!A.a.factionInvitations.includes(e))return t.scriptRef.log("ERROR: Cannot join "+e+" Faction because you have not been invited. joinFaction() failed"),!1;var r=v.Factions[e];Object(E.c)(r);for(var i=0;i=2))throw Object($.d)(t,"Cannot run workForFaction(). It is a Singularity Function and requires SourceFile-4 (level 2) to run.");if(A.a.inGang()&&void 0!==y.a[e])t.scriptRef.log("ERROR: Faction specified in workForFaction() does not offer work at the moment.");else{if(!P.c){if(!Object(v.factionExists)(e))return t.scriptRef.log("ERROR: Faction specified in workForFaction() does not exist."),!1;if(!A.a.factions.includes(e))return t.scriptRef.log("ERROR: workForFaction() failed because you are not a member of "+e),!1;if(A.a.isWorking){var i=A.a.singularityStopWork();null==t.disableLogs.ALL&&null==t.disableLogs.workForFaction&&t.scriptRef.log(i)}var o=v.Factions[e];switch(a.toLowerCase()){case"hacking":case"hacking contracts":case"hackingcontracts":return["Illuminati","Daedalus","The Covenant","ECorp","MegaCorp","Bachman & Associates","Blade Industries","NWO","Clarke Incorporated","OmniTek Incorporated","Four Sigma","KuaiGong International","Fulcrum Secret Technologies","BitRunners","The Black Hand","NiteSec","Chongqing","Sector-12","New Tokyo","Aevum","Ishima","Volhaven","Speakers for the Dead","The Dark Army","The Syndicate","Silhouette","Netburners","Tian Di Hui","CyberSec"].includes(o.name)?(A.a.startFactionHackWork(o),t.scriptRef.log("Started carrying out hacking contracts for "+o.name),!0):(t.scriptRef.log("ERROR: Cannot carry out hacking contracts for "+o.name+". workForFaction() failed"),!1);case"field":case"fieldwork":case"field work":return["Illuminati","Daedalus","The Covenant","ECorp","MegaCorp","Bachman & Associates","Blade Industries","NWO","Clarke Incorporated","OmniTek Incorporated","Four Sigma","KuaiGong International","The Black Hand","Chongqing","Sector-12","New Tokyo","Aevum","Ishima","Volhaven","Speakers for the Dead","The Dark Army","The Syndicate","Silhouette","Tetrads","Slum Snakes"].includes(o.name)?(A.a.startFactionFieldWork(o),t.scriptRef.log("Started carrying out field missions for "+o.name),!0):(t.scriptRef.log("ERROR: Cannot carry out field missions for "+o.name+". workForFaction() failed"),!1);case"security":case"securitywork":case"security work":return["ECorp","MegaCorp","Bachman & Associates","Blade Industries","NWO","Clarke Incorporated","OmniTek Incorporated","Four Sigma","KuaiGong International","Fulcrum Secret Technologies","Chongqing","Sector-12","New Tokyo","Aevum","Ishima","Volhaven","Speakers for the Dead","The Syndicate","Tetrads","Slum Snakes","Tian Di Hui"].includes(o.name)?(A.a.startFactionSecurityWork(o),t.scriptRef.log("Started serving as security details for "+o.name),!0):(t.scriptRef.log("ERROR: Cannot serve as security detail for "+o.name+". workForFaction() failed"),!1);default:t.scriptRef.log("ERROR: Invalid work type passed into workForFaction(): "+a)}return!0}t.scriptRef.log("ERROR: workForFaction() failed because you are in the middle of a mission.")}},getFactionRep:function(e){var a=g.CONSTANTS.ScriptSingularityFn2RamCost/4;if(4!==A.a.bitNodeN&&(a*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return ue("getFactionRep",a);if(n("getFactionRep",a),4!=A.a.bitNodeN&&!(pe&&fe>=2))throw Object($.d)(t,"Cannot run getFactionRep(). It is a Singularity Function and requires SourceFile-4 (level 2) to run.");return Object(v.factionExists)(e)?v.Factions[e].playerReputation:(t.scriptRef.log("ERROR: Faction specified in getFactionRep() does not exist."),-1)},getFactionFavor:function(e){var a=g.CONSTANTS.ScriptSingularityFn2RamCost;if(4!==A.a.bitNodeN&&(a*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return ue("getFactionFavor",a);if(n("getFactionFavor",a),4!=A.a.bitNodeN&&!(pe&&fe>=2))throw Object($.d)(t,"Cannot run getFactionFavor(). It is a Singularity Function and requires SourceFile-4 (level 2) to run.");return Object(v.factionExists)(e)?v.Factions[e].favor:(t.scriptRef.log("ERROR: Faction specified in getFactionFavor() does not exist."),-1)},getFactionFavorGain:function(e){var a=g.CONSTANTS.ScriptSingularityFn2RamCost;if(4!==A.a.bitNodeN&&(a*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return ue("getFactionFavorGain",a);if(n("getFactionFavorGain",a),4!=A.a.bitNodeN&&!(pe&&fe>=2))throw Object($.d)(t,"Cannot run getFactionFavorGain(). It is a Singularity Function and requires SourceFile-4 (level 2) to run.");return Object(v.factionExists)(e)?v.Factions[e].getFavorGain()[0]:(t.scriptRef.log("ERROR: Faction specified in getFactionFavorGain() does not exist."),-1)},donateToFaction:function(e,a){var r=g.CONSTANTS.ScriptSingularityFn3RamCost;if(4!==A.a.bitNodeN&&(r*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return ue("donateToFaction",r);if(n("donateToFaction",r),4!=A.a.bitNodeN&&!(pe&&fe>=3))throw Object($.d)(t,"Cannot run donateToFaction(). It is a Singularity Function and requires SourceFile-4 (level 3) to run.");if(!Object(v.factionExists)(e))return t.log(`ERROR: Faction specified in donateToFaction() does not exist: ${e}`),!1;if("number"!=typeof a||a<=0)return t.log(`ERROR: Invalid donation amount specified in donateToFaction(): ${a}. Must be numeric and positive`),!1;if(A.a.money.lt(a))return t.log(`ERROR: You do not have enough money to donate $${a} to ${e}`),!1;var i=Math.round(g.CONSTANTS.BaseFavorToDonate*l.BitNodeMultipliers.RepToDonateToFaction);if(v.Factions[e].favor=3))throw Object($.d)(t,"Cannot run createProgram(). It is a Singularity Function and requires SourceFile-4 (level 3) to run.");if(P.c)return void t.scriptRef.log("ERROR: createProgram() failed because you are in the middle of a mission.");if(A.a.isWorking){var r=A.a.singularityStopWork();null==t.disableLogs.ALL&&null==t.disableLogs.createProgram&&t.scriptRef.log(r)}e=e.toLowerCase();let i=null;for(const t in w.Programs)w.Programs[t].name.toLowerCase()==e&&(i=w.Programs[t]);return null==i?(t.scriptRef.log("ERROR: createProgram() failed because the specified program does not exist: "+e),!1):A.a.hasProgram(i.name)?(t.scriptRef.log("ERROR: createProgram() failed because you already have the "+i.name+" program"),!1):i.create.req(A.a)?(A.a.startCreateProgramWork(i.name,i.create.time,i.create.level),null==t.disableLogs.ALL&&null==t.disableLogs.createProgram&&t.scriptRef.log("Began creating program: "+e),!0):(t.scriptRef.log("ERROR: createProgram() failed because hacking level is too low to create "+i.name+" (level "+i.create.level+" req)"),!1)},commitCrime:function(e){var a=g.CONSTANTS.ScriptSingularityFn3RamCost;if(4!==A.a.bitNodeN&&(a*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return ue("commitCrime",a);if(n("commitCrime",a),4!=A.a.bitNodeN&&!(pe&&fe>=3))throw Object($.d)(t,"Cannot run commitCrime(). It is a Singularity Function and requires SourceFile-4 (level 3) to run.");if(P.c)return void t.scriptRef.log("ERROR: commitCrime() failed because you are in the middle of a mission.");if(A.a.isWorking){var r=A.a.singularityStopWork();null==t.disableLogs.ALL&&null==t.disableLogs.commitCrime&&t.scriptRef.log(r)}switch(A.a.city){case S.Locations.Aevum:A.a.location=S.Locations.AevumSlums;break;case S.Locations.Chongqing:A.a.location=S.Locations.ChongqingSlums;break;case S.Locations.Sector12:A.a.location=S.Locations.Sector12Slums;break;case S.Locations.NewTokyo:A.a.location=S.Locations.NewTokyoSlums;break;case S.Locations.Ishima:A.a.location=S.Locations.IshimaSlums;break;case S.Locations.Volhaven:A.a.location=S.Locations.VolhavenSlums;break;default:console.log("Invalid Player.city value")}const i=Object(c.findCrime)(e.toLowerCase());if(null==i)throw Object($.d)(t,"Invalid crime passed into commitCrime(): "+e);return null==t.disableLogs.ALL&&null==t.disableLogs.commitCrime&&t.scriptRef.log("Attempting to commit crime: "+i.name+"..."),i.commit(A.a,1,{workerscript:t})},getCrimeChance:function(e){var a=g.CONSTANTS.ScriptSingularityFn3RamCost;if(4!==A.a.bitNodeN&&(a*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return ue("getCrimeChance",a);if(n("getCrimeChance",a),4!=A.a.bitNodeN&&!(pe&&fe>=3))throw Object($.d)(t,"Cannot run getCrimeChance(). It is a Singularity Function and requires SourceFile-4 (level 3) to run.");const r=Object(c.findCrime)(e.toLowerCase());if(null==r)throw Object($.d)(t,"Invalid crime passed into getCrimeChance(): "+r);return r.successRate(A.a)},getOwnedAugmentations:function(e=!1){var a=g.CONSTANTS.ScriptSingularityFn3RamCost;if(4!==A.a.bitNodeN&&(a*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return ue("getOwnedAugmentations",a);if(n("getOwnedAugmentations",a),4!=A.a.bitNodeN&&!(pe&&fe>=3))throw Object($.d)(t,"Cannot run getOwnedAugmentations(). It is a Singularity Function and requires SourceFile-4 (level 3) to run.");for(var r=[],i=0;i=3))throw Object($.d)(t,"Cannot run getOwnedSourceFiles(). It is a Singularity Function and requires SourceFile-4 (level 3) to run.");let a=[];for(let e=0;e=3))throw Object($.d)(t,"Cannot run getAugmentationsFromFaction(). It is a Singularity Function and requires SourceFile-4 (level 3) to run.");if(!Object(v.factionExists)(e))return t.scriptRef.log("ERROR: getAugmentationsFromFaction() failed. Invalid faction name passed in (this is case-sensitive): "+e),[];for(var r=v.Factions[e],i=[],o=0;o=3))throw Object($.d)(t,"Cannot run getAugmentationPrereq(). It is a Singularity Function and requires SourceFile-4 (level 3) to run.");return Object(o.b)(e)?i.Augmentations[e].prereqs.slice():(t.scriptRef.log("ERROR: getAugmentationPrereq() failed. Invalid Augmentation name passed in (note: this is case-sensitive): "+e),[])},getAugmentationCost:function(e){var a=g.CONSTANTS.ScriptSingularityFn3RamCost;if(4!==A.a.bitNodeN&&(a*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return ue("getAugmentationCost",a);if(n("getAugmentationCost",a),4!=A.a.bitNodeN&&!(pe&&fe>=3))throw Object($.d)(t,"Cannot run getAugmentationCost(). It is a Singularity Function and requires SourceFile-4 (level 3) to run.");if(!Object(o.b)(e))return t.scriptRef.log("ERROR: getAugmentationCost() failed. Invalid Augmentation name passed in (note: this is case-sensitive): "+e),[-1,-1];var r=i.Augmentations[e];return[r.baseRepRequirement,r.baseCost]},purchaseAugmentation:function(e,a){var o=g.CONSTANTS.ScriptSingularityFn3RamCost;if(4!==A.a.bitNodeN&&(o*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return ue("purchaseAugmentation",o);if(n("purchaseAugmentation",o),4!=A.a.bitNodeN&&!(pe&&fe>=3))throw Object($.d)(t,"Cannot run purchaseAugmentation(). It is a Singularity Function and requires SourceFile-4 (level 3) to run.");var l=v.Factions[e];if(null==l||!(l instanceof b.Faction))return t.scriptRef.log("ERROR: purchaseAugmentation() failed because of invalid faction name: "+e),!1;if(!l.augmentations.includes(a))return t.scriptRef.log("ERROR: purchaseAugmentation() failed because the faction "+e+" does not contain the "+a+" augmentation"),!1;var c=i.Augmentations[a];if(null==c||!(c instanceof r.Augmentation))return t.scriptRef.log("ERROR: purchaseAugmentation() failed because of invalid augmentation name: "+a),!1;var u=!1;if(c.name===s.AugmentationNames.NeuroFluxGovernor&&(u=!0),!u){for(var p=0;p=3))throw Object($.d)(t,"Cannot run installAugmentations(). It is a Singularity Function and requires SourceFile-4 (level 3) to run.");return 0===A.a.queuedAugmentations.length?(t.scriptRef.log("ERROR: installAugmentations() failed because you do not have any Augmentations to be installed"),!1):(A.a.gainIntelligenceExp(g.CONSTANTS.IntelligenceSingFnBaseExpGain),t.scriptRef.log("Installing Augmentations. This will cause this script to be killed"),Object(o.e)(e),!0)},gang:{getMemberNames:function(){if(t.checkingRam)return ue("getMemberNames",g.CONSTANTS.ScriptGangApiBaseRamCost/4);n("getMemberNames",g.CONSTANTS.ScriptGangApiBaseRamCost/4),K.a(t,"getMemberNames");try{const e=[];for(const t of A.a.gang.members)e.push(t.name);return e}catch(e){throw Object($.d)(t,K.b("getMemberNames",e))}},getGangInformation:function(){if(t.checkingRam)return ue("getGangInformation",g.CONSTANTS.ScriptGangApiBaseRamCost/2);n("getGangInformation",g.CONSTANTS.ScriptGangApiBaseRamCost/2),K.a(t,"getGangInformation");try{return{faction:A.a.gang.facName,isHacking:A.a.gang.isHackingGang,moneyGainRate:A.a.gang.moneyGainRate,power:A.a.gang.getPower(),respect:A.a.gang.respect,respectGainRate:A.a.gang.respectGainRate,territory:A.a.gang.getTerritory(),territoryClashChance:A.a.gang.territoryClashChance,territoryWarfareEngaged:A.a.gang.territoryWarfareEngaged,wantedLevel:A.a.gang.wanted,wantedLevelGainRate:A.a.gang.wantedGainRate}}catch(e){throw Object($.d)(t,K.b("getGangInformation",e))}},getOtherGangInformation:function(){if(t.checkingRam)return ue("getOtherGangInformation",g.CONSTANTS.ScriptGangApiBaseRamCost/2);n("getOtherGangInformation",g.CONSTANTS.ScriptGangApiBaseRamCost/2),K.a(t,"getOtherGangInformation");try{return Object.assign(y.a)}catch(e){throw Object($.d)(t,K.b("getOtherGangInformation",e))}},getMemberInformation:function(e){if(t.checkingRam)return ue("getMemberInformation",g.CONSTANTS.ScriptGangApiBaseRamCost/2);n("getMemberInformation",g.CONSTANTS.ScriptGangApiBaseRamCost/2),K.a(t,"getMemberInformation");try{for(const t of A.a.gang.members)if(t.name===e)return{agility:t.agi,agilityEquipMult:t.agi_mult,agilityAscensionMult:t.agi_asc_mult,augmentations:t.augmentations.slice(),charisma:t.cha,charismaEquipMult:t.cha_mult,charismaAscensionMult:t.cha_asc_mult,defense:t.def,defenseEquipMult:t.def_mult,defenseAscensionMult:t.def_asc_mult,dexterity:t.dex,dexterityEquipMult:t.dex_mult,dexterityAscensionMult:t.dex_asc_mult,equipment:t.upgrades.slice(),hacking:t.hack,hackingEquipMult:t.hack_mult,hackingAscensionMult:t.hack_asc_mult,strength:t.str,strengthEquipMult:t.str_mult,strengthAscensionMult:t.str_asc_mult,task:t.task};return t.log(`Invalid argument passed to gang.getMemberInformation(). No gang member could be found with name ${e}`),{}}catch(e){throw Object($.d)(t,K.b("getMemberInformation",e))}},canRecruitMember:function(){if(t.checkingRam)return ue("canRecruitMember",g.CONSTANTS.ScriptGangApiBaseRamCost/4);n("canRecruitMember",g.CONSTANTS.ScriptGangApiBaseRamCost/4),K.a(t,"canRecruitMember");try{return A.a.gang.canRecruitMember()}catch(e){throw Object($.d)(t,K.b("canRecruitMember",e))}},recruitMember:function(e){if(t.checkingRam)return ue("recruitMember",g.CONSTANTS.ScriptGangApiBaseRamCost/2);n("recruitMember",g.CONSTANTS.ScriptGangApiBaseRamCost/2),K.a(t,"recruitMember");try{const n=A.a.gang.recruitMember(e);return t.shouldLog("recruitMember")&&(n?t.log(`Successfully recruited Gang Member ${e}`):t.log(`Failed to recruit Gang Member ${e}`)),n}catch(e){throw Object($.d)(t,K.b("recruitMember",e))}},getTaskNames:function(){if(t.checkingRam)return ue("getTaskNames",g.CONSTANTS.ScriptGangApiBaseRamCost/4);n("getTaskNames",g.CONSTANTS.ScriptGangApiBaseRamCost/4),K.a(t,"getTaskNames");try{const e=A.a.gang.getAllTaskNames();return e.unshift("Unassigned"),e}catch(e){throw Object($.d)(t,K.b("getTaskNames",e))}},setMemberTask:function(e,a){if(t.checkingRam)return ue("setMemberTask",g.CONSTANTS.ScriptGangApiBaseRamCost/2);n("setMemberTask",g.CONSTANTS.ScriptGangApiBaseRamCost/2),K.a(t,"setMemberTask");try{for(const n of A.a.gang.members)if(n.name===e){const r=n.assignToTask(a);return t.shouldLog("setMemberTask")&&(r?t.log(`Successfully assigned Gang Member ${e} to ${a} task`):t.log(`Failed to assign Gang Member ${e} to ${a} task. ${e} is now Unassigned`)),r}return t.log(`Invalid argument passed to gang.setMemberTask(). No gang member could be found with name ${e}`),!1}catch(e){throw Object($.d)(t,K.b("setMemberTask",e))}},getEquipmentNames:function(){if(t.checkingRam)return ue("getEquipmentNames",g.CONSTANTS.ScriptGangApiBaseRamCost/4);n("getEquipmentNames",g.CONSTANTS.ScriptGangApiBaseRamCost/4),K.a(t,"getEquipmentNames");try{return A.a.gang.getAllUpgradeNames()}catch(e){throw Object($.d)(t,K.b("getEquipmentNames",e))}},getEquipmentCost:function(e){if(t.checkingRam)return ue("getEquipmentCost",g.CONSTANTS.ScriptGangApiBaseRamCost/2);n("getEquipmentCost",g.CONSTANTS.ScriptGangApiBaseRamCost/2),K.a(t,"getEquipmentCost");try{return A.a.gang.getUpgradeCost(e)}catch(e){throw Object($.d)(t,K.b("getEquipmentCost",e))}},getEquipmentType:function(e){if(t.checkingRam)return ue("getEquipmentType",g.CONSTANTS.ScriptGangApiBaseRamCost/2);n("getEquipmentType",g.CONSTANTS.ScriptGangApiBaseRamCost/2),K.a(t,"getEquipmentType");try{return A.a.gang.getUpgradeType(e)}catch(e){throw Object($.d)(t,K.b("getEquipmentType",e))}},purchaseEquipment:function(e,a){if(t.checkingRam)return ue("purchaseEquipment",g.CONSTANTS.ScriptGangApiBaseRamCost);n("purchaseEquipment",g.CONSTANTS.ScriptGangApiBaseRamCost),K.a(t,"purchaseEquipment");try{for(const n of A.a.gang.members)if(n.name===e){const r=n.buyUpgrade(a,A.a,A.a.gang);return t.shouldLog("purchaseEquipment")&&(r?t.log(`Purchased ${a} for Gang member ${e}`):t.log(`Failed to purchase ${a} for Gang member ${e}`)),r}return t.log(`Invalid argument passed to gang.purchaseEquipment(). No gang member could be found with name ${e}`),!1}catch(e){throw Object($.d)(t,K.b("purchaseEquipment",e))}},ascendMember:function(e){if(t.checkingRam)return ue("ascendMember",g.CONSTANTS.ScriptGangApiBaseRamCost);n("ascendMember",g.CONSTANTS.ScriptGangApiBaseRamCost),K.a(t,"ascendMember");try{for(const n of A.a.gang.members)if(n.name===e)return A.a.gang.ascendMember(n,t);return t.log(`Invalid argument passed to gang.ascendMember(). No gang member could be found with name ${e}`),!1}catch(e){throw Object($.d)(t,K.b("ascendMember",e))}},setTerritoryWarfare:function(e){if(t.checkingRam)return ue("setTerritoryWarfare",g.CONSTANTS.ScriptGangApiBaseRamCost/2);n("setTerritoryWarfare",g.CONSTANTS.ScriptGangApiBaseRamCost/2),K.a(t,"setTerritoryWarfare");try{e?(A.a.gang.territoryWarfareEngaged=!0,t.shouldLog("setTerritoryWarfare")&&t.log("Engaging in Gang Territory Warfare")):(A.a.gang.territoryWarfareEngaged=!1,t.shouldLog("setTerritoryWarfare")&&t.log("Disengaging in Gang Territory Warfare"))}catch(e){throw Object($.d)(t,K.b("setTerritoryWarfare",e))}},getChanceToWinClash:function(e){if(t.checkingRam)return ue("getChanceToWinClash",g.CONSTANTS.ScriptGangApiBaseRamCost);n("getChanceToWinClash",g.CONSTANTS.ScriptGangApiBaseRamCost),K.a(t,"getChanceToWinClash");try{if(null==y.a[e])return t.log(`Invalid gang specified in gang.getChanceToWinClash() : ${e}`),0;const n=y.a[A.a.gang.facName].power;return n/(y.a[e].power+n)}catch(e){throw Object($.d)(t,K.b("getChanceToWinClash",e))}},getBonusTime:function(){if(t.checkingRam)return 0;K.a(t,"getBonusTime");try{return Math.round(A.a.gang.storedCycles/5)}catch(e){throw Object($.d)(t,K.b("getBonusTime",e))}}},bladeburner:{getContractNames:function(){if(t.checkingRam)return ue("getContractNames",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost/10);if(n("getContractNames",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost/10),A.a.bladeburner instanceof u.a&&(7===A.a.bitNodeN||de))return A.a.bladeburner.getContractNamesNetscriptFn();throw Object($.d)(t,"getContractNames() failed because you do not currently have access to the Bladeburner API. This is either because you are not currently employed at the Bladeburner division or because you do not have Source-File 7")},getOperationNames:function(){if(t.checkingRam)return ue("getOperationNames",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost/10);if(n("getOperationNames",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost/10),A.a.bladeburner instanceof u.a&&(7===A.a.bitNodeN||de))return A.a.bladeburner.getOperationNamesNetscriptFn();throw Object($.d)(t,"getOperationNames() failed because you do not currently have access to the Bladeburner API. This is either because you are not currently employed at the Bladeburner division or because you do not have Source-File 7")},getBlackOpNames:function(){if(t.checkingRam)return ue("getBlackOpNames",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost/10);if(n("getBlackOpNames",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost/10),A.a.bladeburner instanceof u.a&&(7===A.a.bitNodeN||de))return A.a.bladeburner.getBlackOpNamesNetscriptFn();throw Object($.d)(t,"getBlackOpNames() failed because you do not currently have access to the Bladeburner API. This is either because you are not currently employed at the Bladeburner division or because you do not have Source-File 7")},getBlackOpRank:function(e=""){if(t.checkingRam)return ue("getBlackOpRank",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost/2);if(n("getBlackOpRank",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost/2),A.a.bladeburner instanceof u.a&&(7===A.a.bitNodeN||de)){const t=A.a.bladeburner.getActionIdFromTypeAndName("blackops",e);if(!t)return-1;const n=A.a.bladeburner.getActionObject(t);return n?n.reqdRank:-1}throw Object($.d)(t,"getBlackOpRank() failed because you do not currently have access to the Bladeburner API. This is either because you are not currently employed at the Bladeburner division or because you do not have Source-File 7")},getGeneralActionNames:function(){if(t.checkingRam)return ue("getGeneralActionNames",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost/10);if(n("getGeneralActionNames",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost/10),A.a.bladeburner instanceof u.a&&(7===A.a.bitNodeN||de))return A.a.bladeburner.getGeneralActionNamesNetscriptFn();throw Object($.d)(t,"getGeneralActionNames() failed because you do not currently have access to the Bladeburner API. This is either because you are not currently employed at the Bladeburner division or because you do not have Source-File 7")},getSkillNames:function(){if(t.checkingRam)return ue("getSkillNames",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost/10);if(n("getSkillNames",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost/10),A.a.bladeburner instanceof u.a&&(7===A.a.bitNodeN||de))return A.a.bladeburner.getSkillNamesNetscriptFn();throw Object($.d)(t,"getSkillNames() failed because you do not currently have access to the Bladeburner API. This is either because you are not currently employed at the Bladeburner division or because you do not have Source-File 7")},startAction:function(e="",a=""){if(t.checkingRam)return ue("startAction",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);if(n("startAction",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),A.a.bladeburner instanceof u.a&&(7===A.a.bitNodeN||de))try{return A.a.bladeburner.startActionNetscriptFn(e,a,t)}catch(e){throw Object($.d)(t,"Bladeburner.startAction() failed with exception: "+e)}throw Object($.d)(t,"startAction() failed because you do not currently have access to the Bladeburner API. This is either because you are not currently employed at the Bladeburner division or because you do not have Source-File 7")},stopBladeburnerAction:function(){if(t.checkingRam)return ue("stopBladeburnerAction",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost/2);if(n("stopBladeburnerAction",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost/2),A.a.bladeburner instanceof u.a&&(7===A.a.bitNodeN||de))return A.a.bladeburner.resetAction();throw Object($.d)(t,"stopBladeburnerAction() failed because you do not currently have access to the Bladeburner API. This is either because you are not currently employed at the Bladeburner division or because you do not have Source-File 7")},getCurrentAction:function(){if(t.checkingRam)return ue("getCurrentAction",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost/4);if(n("getCurrentAction",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost/4),A.a.bladeburner instanceof u.a&&(7===A.a.bitNodeN||de))return A.a.bladeburner.getTypeAndNameFromActionId(A.a.bladeburner.action);throw Object($.d)(t,"getCurrentAction() failed because you do not currently have access to the Bladeburner API. This is either because you are not currently employed at the Bladeburner division or because you do not have Source-File 7")},getActionTime:function(e="",a=""){if(t.checkingRam)return ue("getActionTime",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);if(n("getActionTime",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),A.a.bladeburner instanceof u.a&&(7===A.a.bitNodeN||de))try{return A.a.bladeburner.getActionTimeNetscriptFn(e,a,t)}catch(e){throw Object($.d)(t,"Bladeburner.getActionTime() failed with exception: "+e)}throw Object($.d)(t,"getActionTime() failed because you do not currently have access to the Bladeburner API. This is either because you are not currently employed at the Bladeburner division or because you do not have Source-File 7")},getActionEstimatedSuccessChance:function(e="",a=""){if(t.checkingRam)return ue("getActionEstimatedSuccessChance",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);if(n("getActionEstimatedSuccessChance",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),A.a.bladeburner instanceof u.a&&(7===A.a.bitNodeN||de))try{return A.a.bladeburner.getActionEstimatedSuccessChanceNetscriptFn(e,a,t)}catch(e){throw Object($.d)(t,"Bladeburner.getActionEstimatedSuccessChance() failed with exception: "+e)}throw Object($.d)(t,"getActionEstimatedSuccessChance() failed because you do not currently have access to the Bladeburner API. This is either because you are not currently employed at the Bladeburner division or because you do not have Source-File 7")},getActionRepGain:function(e="",a="",r){if(t.checkingRam)return ue("getActionRepGain",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);n("getActionRepGain",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),Object(G.a)(t,"getActionRepGain");try{var i=Object(G.b)("getActionAutolevel",e,a);const n=A.a.bladeburner.getActionIdFromTypeAndName(e,a);if(null==n)return t.log(i),-1;const s=A.a.bladeburner.getActionObject(n);return null==s?(t.log(i),-1):(o=null==r||isNaN(r)?Math.pow(s.rewardFac,s.level-1):Math.pow(s.rewardFac,r-1),s.rankGain*o*l.BitNodeMultipliers.BladeburnerRank);var o}catch(e){throw Object($.d)(t,Object(G.c)("getActionAutolevel",e))}},getActionCountRemaining:function(e="",a=""){if(t.checkingRam)return ue("getActionCountRemaining",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);if(n("getActionCountRemaining",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),A.a.bladeburner instanceof u.a&&(7===A.a.bitNodeN||de))try{return A.a.bladeburner.getActionCountRemainingNetscriptFn(e,a,t)}catch(e){throw Object($.d)(t,"Bladeburner.getActionCountRemaining() failed with exception: "+e)}throw Object($.d)(t,"getActionCountRemaining() failed because you do not currently have access to the Bladeburner API. This is either because you are not currently employed at the Bladeburner division or because you do not have Source-File 7")},getActionMaxLevel:function(e="",a=""){if(t.checkingRam)return ue("getActionMaxLevel",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);n("getActionMaxLevel",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),Object(G.a)(t,"getActionMaxLevel");try{var r=Object(G.b)("getActionMaxLevel",e,a);const n=A.a.bladeburner.getActionIdFromTypeAndName(e,a);if(null==n)return t.log(r),-1;const i=A.a.bladeburner.getActionObject(n);return null==i?(t.log(r),-1):i.maxLevel}catch(e){throw Object($.d)(t,Object(G.c)("getActionMaxLevel",e))}},getActionCurrentLevel:function(e="",a=""){if(t.checkingRam)return ue("getActionCurrentLevel",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);n("getActionCurrentLevel",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),Object(G.a)(t,"getActionCurrentLevel");try{var r=Object(G.b)("getActionCurrentLevel",e,a);const n=A.a.bladeburner.getActionIdFromTypeAndName(e,a);if(null==n)return t.log(r),-1;const i=A.a.bladeburner.getActionObject(n);return null==i?(t.log(r),-1):i.level}catch(e){throw Object($.d)(t,Object(G.c)("getActionCurrentLevel",e))}},getActionAutolevel:function(e="",a=""){if(t.checkingRam)return ue("getActionAutolevel",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);n("getActionAutolevel",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),Object(G.a)(t,"getActionAutolevel");try{var r=Object(G.b)("getActionAutolevel",e,a);const n=A.a.bladeburner.getActionIdFromTypeAndName(e,a);if(null==n)return t.log(r),!1;const i=A.a.bladeburner.getActionObject(n);return null==i?(t.log(r),!1):i.autoLevel}catch(e){throw Object($.d)(t,Object(G.c)("getActionAutolevel",e))}},setActionAutolevel:function(e="",a="",r=!0){if(t.checkingRam)return ue("setActionAutolevel",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);n("setActionAutolevel",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),Object(G.a)(t,"setActionAutolevel");try{var i=Object(G.b)("setActionAutolevel",e,a);const n=A.a.bladeburner.getActionIdFromTypeAndName(e,a);if(null==n)return void t.log(i);const o=A.a.bladeburner.getActionObject(n);if(null==o)return void t.log(i);o.autoLevel=r}catch(e){throw Object($.d)(t,Object(G.c)("setActionAutolevel",e))}},setActionLevel:function(e="",a="",r=1){if(t.checkingRam)return ue("setActionLevel",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);n("setActionLevel",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),Object(G.a)(t,"setActionLevel");try{var i=Object(G.b)("setActionLevel",e,a);const n=A.a.bladeburner.getActionIdFromTypeAndName(e,a);if(null==n)return void t.log(i);const o=A.a.bladeburner.getActionObject(n);if(null==o)return void t.log(i);if(r>o.maxLevel)return void t.log(`ERROR: bladeburner.${setActionLevel}() failed because level exceeds max level for given action.`);if(r<1)return void t.log(`ERROR: bladeburner.${setActionLevel}() failed because level is below 1.`);o.level=r}catch(e){throw Object($.d)(t,Object(G.c)("setActionLevel",e))}},getRank:function(){if(t.checkingRam)return ue("getRank",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);if(n("getRank",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),A.a.bladeburner instanceof u.a&&(7===A.a.bitNodeN||de))return A.a.bladeburner.rank;throw Object($.d)(t,"getRank() failed because you do not currently have access to the Bladeburner API. This is either because you are not currently employed at the Bladeburner division or because you do not have Source-File 7")},getSkillPoints:function(){if(t.checkingRam)return ue("getSkillPoints",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);if(n("getSkillPoints",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),A.a.bladeburner instanceof u.a&&(7===A.a.bitNodeN||de))return A.a.bladeburner.skillPoints;throw Object($.d)(t,"getSkillPoints() failed because you do not currently have access to the Bladeburner API. This is either because you are not currently employed at the Bladeburner division or because you do not have Source-File 7")},getSkillLevel:function(e=""){if(t.checkingRam)return ue("getSkillLevel",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);if(n("getSkillLevel",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),A.a.bladeburner instanceof u.a&&(7===A.a.bitNodeN||de))try{return A.a.bladeburner.getSkillLevelNetscriptFn(e,t)}catch(e){throw Object($.d)(t,"Bladeburner.getSkillLevel() failed with exception: "+e)}throw Object($.d)(t,"getSkillLevel() failed because you do not currently have access to the Bladeburner API. This is either because you are not currently employed at the Bladeburner division or because you do not have Source-File 7")},getSkillUpgradeCost:function(e=""){if(t.checkingRam)return ue("getSkillUpgradeCost",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);if(n("getSkillUpgradeCost",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),A.a.bladeburner instanceof u.a&&(7===A.a.bitNodeN||de))try{return A.a.bladeburner.getSkillUpgradeCostNetscriptFn(e,t)}catch(e){throw Object($.d)(t,"Bladeburner.getSkillUpgradeCost() failed with exception: "+e)}throw Object($.d)(t,"getSkillUpgradeCost() failed because you do not currently have access to the Bladeburner API. This is either because you are not currently employed at the Bladeburner division or because you do not have Source-File 7")},upgradeSkill:function(e){if(t.checkingRam)return ue("upgradeSkill",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);if(n("upgradeSkill",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),A.a.bladeburner instanceof u.a&&(7===A.a.bitNodeN||de))try{return A.a.bladeburner.upgradeSkillNetscriptFn(e,t)}catch(e){throw Object($.d)(t,"Bladeburner.upgradeSkill() failed with exception: "+e)}throw Object($.d)(t,"upgradeSkill() failed because you do not currently have access to the Bladeburner API. This is either because you are not currently employed at the Bladeburner division or because you do not have Source-File 7")},getTeamSize:function(e="",a=""){if(t.checkingRam)return ue("getTeamSize",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);if(n("getTeamSize",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),A.a.bladeburner instanceof u.a&&(7===A.a.bitNodeN||de))try{return A.a.bladeburner.getTeamSizeNetscriptFn(e,a,t)}catch(e){throw Object($.d)(t,"Bladeburner.getTeamSize() failed with exception: "+e)}throw Object($.d)(t,"getTeamSize() failed because you do not currently have access to the Bladeburner API. This is either because you are not currently employed at the Bladeburner division or because you do not have Source-File 7")},setTeamSize:function(e="",a="",r){if(t.checkingRam)return ue("setTeamSize",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);if(n("setTeamSize",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),A.a.bladeburner instanceof u.a&&(7===A.a.bitNodeN||de))try{return A.a.bladeburner.setTeamSizeNetscriptFn(e,a,r,t)}catch(e){throw Object($.d)(t,"Bladeburner.setTeamSize() failed with exception: "+e)}throw Object($.d)(t,"setTeamSize() failed because you do not currently have access to the Bladeburner API. This is either because you are not currently employed at the Bladeburner division or because you do not have Source-File 7")},getCityEstimatedPopulation:function(e){if(t.checkingRam)return ue("getCityEstimatedPopulation",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);if(n("getCityEstimatedPopulation",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),A.a.bladeburner instanceof u.a&&(7===A.a.bitNodeN||de))try{return A.a.bladeburner.getCityEstimatedPopulationNetscriptFn(e,t)}catch(e){throw Object($.d)(t,"Bladeburner.getCityEstimatedPopulation() failed with exception: "+e)}throw Object($.d)(t,"getCityEstimatedPopulation() failed because you do not currently have access to the Bladeburner API. This is either because you are not currently employed at the Bladeburner division or because you do not have Source-File 7")},getCityEstimatedCommunities:function(e){if(t.checkingRam)return ue("getCityEstimatedCommunities",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);if(n("getCityEstimatedCommunities",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),A.a.bladeburner instanceof u.a&&(7===A.a.bitNodeN||de))try{return A.a.bladeburner.getCityEstimatedCommunitiesNetscriptFn(e,t)}catch(e){throw Object($.d)(t,"Bladeburner.getCityEstimatedCommunities() failed with exception: "+e)}throw Object($.d)(t,"getCityEstimatedCommunities() failed because you do not currently have access to the Bladeburner API. This is either because you are not currently employed at the Bladeburner division or because you do not have Source-File 7")},getCityChaos:function(e){if(t.checkingRam)return ue("getCityChaos",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);if(n("getCityChaos",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),A.a.bladeburner instanceof u.a&&(7===A.a.bitNodeN||de))try{return A.a.bladeburner.getCityChaosNetscriptFn(e,t)}catch(e){throw Object($.d)(t,"Bladeburner.getCityChaos() failed with exception: "+e)}throw Object($.d)(t,"getCityChaos() failed because you do not currently have access to the Bladeburner API. This is either because you are not currently employed at the Bladeburner division or because you do not have Source-File 7")},getCity:function(){if(t.checkingRam)return ue("getCity",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);if(n("getCity",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),A.a.bladeburner instanceof u.a&&(7===A.a.bitNodeN||de))try{return A.a.bladeburner.city}catch(e){throw Object($.d)(t,"Bladeburner.getCity() failed with exception: "+e)}throw Object($.d)(t,"getCity() failed because you do not currently have access to the Bladeburner API. This is either because you are not currently employed at the Bladeburner division or because you do not have Source-File 7")},switchCity:function(e){if(t.checkingRam)return ue("switchCity",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);if(n("switchCity",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),A.a.bladeburner instanceof u.a&&(7===A.a.bitNodeN||de))try{return A.a.bladeburner.switchCityNetscriptFn(e,t)}catch(e){throw Object($.d)(t,"Bladeburner.switchCity() failed with exception: "+e)}throw Object($.d)(t,"switchCity() failed because you do not currently have access to the Bladeburner API. This is either because you are not currently employed at the Bladeburner division or because you do not have Source-File 7")},getStamina:function(){if(t.checkingRam)return ue("getStamina",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);if(n("getStamina",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),A.a.bladeburner instanceof u.a&&(7===A.a.bitNodeN||de))return[A.a.bladeburner.stamina,A.a.bladeburner.maxStamina];throw Object($.d)(t,"getStamina() failed because you do not currently have access to the Bladeburner API. This is either because you are not currently employed at the Bladeburner division or because you do not have Source-File 7")},joinBladeburnerFaction:function(){if(t.checkingRam)return ue("joinBladeburnerFaction",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);if(n("joinBladeburnerFaction",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),A.a.bladeburner instanceof u.a&&(7===A.a.bitNodeN||de))return A.a.bladeburner.joinBladeburnerFactionNetscriptFn(t);throw Object($.d)(t,"joinBladeburnerFaction() failed because you do not currently have access to the Bladeburner API. This is either because you are not currently employed at the Bladeburner division or because you do not have Source-File 7")},joinBladeburnerDivision:function(){if(t.checkingRam)return ue("joinBladeburnerDivision",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);if(n("joinBladeburnerDivision",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),7===A.a.bitNodeN||de)return A.a.bladeburner instanceof u.a||(A.a.strength>=100&&A.a.defense>=100&&A.a.dexterity>=100&&A.a.agility>=100?(A.a.bladeburner=new u.a({new:!0}),t.log("You have been accepted into the Bladeburner division"),!0):(t.log("You do not meet the requirements for joining the Bladeburner division"),!1));throw Object($.d)(t,"joinBladeburnerDivision() failed because you do not currently have access to the Bladeburner API. This is either because you are not currently employed at the Bladeburner division or because you do not have Source-File 7")},getBonusTime:function(){if(t.checkingRam)return 0;if(7===A.a.bitNodeN||de)return Math.round(A.a.bladeburner.storedCycles/5);throw Object($.d)(t,"getBonusTime() failed because you do not currently have access to the Bladeburner API. This is either because you are not currently employed at the Bladeburner division or because you do not have Source-File 7")}},codingcontract:{attempt:function(e,a,r=t.serverIp){if(t.checkingRam)return ue("attempt",g.CONSTANTS.ScriptCodingContractBaseRamCost);n("attempt",g.CONSTANTS.ScriptCodingContractBaseRamCost);const i=ke(a,r);if(null==i)return t.log(`ERROR: codingcontract.getData() failed because it could find the specified contract ${a} on server ${r}`),!1;if(Object(ee.is2DArray)(e)){let t=[];for(let n=0;n=i.getMaxNumTries()?(t.log(`Coding Contract ${a} failed. Contract is now self-destructing`),o.removeContract(a)):t.log(`Coding Contract ${a} failed. ${i.getMaxNumTries()-i.tries} attempts remaining`),!1},getContractType:function(e,a=t.serverIp){if(t.checkingRam)return ue("getContractType",g.CONSTANTS.ScriptCodingContractBaseRamCost/2);n("getContractType",g.CONSTANTS.ScriptCodingContractBaseRamCost/2);let r=ke(e,a);return null==r?(t.log(`ERROR: codingcontract.getData() failed because it could find the specified contract ${e} on server ${a}`),null):r.getType()},getData:function(e,a=t.serverIp){if(t.checkingRam)return ue("getData",g.CONSTANTS.ScriptCodingContractBaseRamCost/2);n("getData",g.CONSTANTS.ScriptCodingContractBaseRamCost/2);let r=ke(e,a);if(null==r)return t.log(`ERROR: codingcontract.getData() failed because it could find the specified contract ${e} on server ${a}`),null;let i=r.getData();if(i.constructor===Array){const e=i.slice();for(let t=0;t=A.a.sleeves.length||e<0?(t.log(`ERROR: sleeve.setToShockRecovery(${e}) failed because it is an invalid sleeve number.`),!1):A.a.sleeves[e].shockRecovery(A.a)},setToSynchronize:function(e=0){if(t.checkingRam)return ue("setToSynchronize",g.CONSTANTS.ScriptSleeveBaseRamCost);if(10!==A.a.bitNodeN&&!U.SourceFileFlags[10])throw Object($.d)(t,"setToSynchronize() failed because 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");return n("setToSynchronize",g.CONSTANTS.ScriptSleeveBaseRamCost),e>=A.a.sleeves.length||e<0?(t.log(`ERROR: sleeve.setToSynchronize(${e}) failed because it is an invalid sleeve number.`),!1):A.a.sleeves[e].synchronize(A.a)},setToCommitCrime:function(e=0,a=""){if(t.checkingRam)return ue("setToCommitCrime",g.CONSTANTS.ScriptSleeveBaseRamCost);if(10!==A.a.bitNodeN&&!U.SourceFileFlags[10])throw Object($.d)(t,"setToCommitCrime() failed because 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");return n("setToCommitCrime",g.CONSTANTS.ScriptSleeveBaseRamCost),e>=A.a.sleeves.length||e<0?(t.log(`ERROR: sleeve.setToCommitCrime(${e}) failed because it is an invalid sleeve number.`),!1):A.a.sleeves[e].commitCrime(A.a,a)},setToUniversityCourse:function(e=0,a="",r=""){if(t.checkingRam)return ue("setToUniversityCourse",g.CONSTANTS.ScriptSleeveBaseRamCost);if(10!==A.a.bitNodeN&&!U.SourceFileFlags[10])throw Object($.d)(t,"setToUniversityCourse() failed because 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");return n("setToUniversityCourse",g.CONSTANTS.ScriptSleeveBaseRamCost),e>=A.a.sleeves.length||e<0?(t.log(`ERROR: sleeve.setToUniversityCourse(${e}) failed because it is an invalid sleeve number.`),!1):A.a.sleeves[e].takeUniversityCourse(A.a,a,r)},travel:function(e=0,a=""){if(t.checkingRam)return ue("travel",g.CONSTANTS.ScriptSleeveBaseRamCost);if(10!==A.a.bitNodeN&&!U.SourceFileFlags[10])throw Object($.d)(t,"travel() failed because 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");return n("travel",g.CONSTANTS.ScriptSleeveBaseRamCost),e>=A.a.sleeves.length||e<0?(t.log(`ERROR: sleeve.travel(${e}) failed because it is an invalid sleeve number.`),!1):A.a.sleeves[e].travel(A.a,a)},setToCompanyWork:function(e=0,a=""){if(t.checkingRam)return ue("setToCompanyWork",g.CONSTANTS.ScriptSleeveBaseRamCost);if(10!==A.a.bitNodeN&&!U.SourceFileFlags[10])throw Object($.d)(t,"setToCompanyWork() failed because 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");if(n("setToCompanyWork",g.CONSTANTS.ScriptSleeveBaseRamCost),e>=A.a.sleeves.length||e<0)return t.log(`ERROR: sleeve.setToCompanyWork(${e}) failed because it is an invalid sleeve number.`),!1;for(let n=0;n=A.a.sleeves.length||e<0)return t.log(`ERROR: sleeve.setToFactionWork(${e}) failed because it is an invalid sleeve number.`),!1;for(let n=0;n=A.a.sleeves.length||e<0?(t.log(`ERROR: sleeve.setToGymWorkout(${e}) failed because it is an invalid sleeve number.`),!1):A.a.sleeves[e].workoutAtGym(A.a,a,r)},getSleeveStats:function(e=0){if(t.checkingRam)return ue("workoutAtGym",g.CONSTANTS.ScriptSleeveBaseRamCost);if(10!==A.a.bitNodeN&&!U.SourceFileFlags[10])throw Object($.d)(t,"getStats() failed because 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");if(n("workoutAtGym",g.CONSTANTS.ScriptSleeveBaseRamCost),e>=A.a.sleeves.length||e<0)return t.log(`ERROR: sleeve.workoutAtGym(${e}) failed because it is an invalid sleeve number.`),!1;const a=A.a.sleeves[e];return{shock:100-a.shock,sync:a.sync,hacking_skill:a.hacking_skill,strength:a.strength,defense:a.defense,dexterity:a.dexterity,agility:a.agility,charisma:a.charisma}},getTask:function(e=0){if(t.checkingRam)return ue("getTask",g.CONSTANTS.ScriptSleeveBaseRamCost);if(10!==A.a.bitNodeN&&!U.SourceFileFlags[10])throw Object($.d)(t,"getTask() failed because 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");if(n("getTask",g.CONSTANTS.ScriptSleeveBaseRamCost),e>=A.a.sleeves.length||e<0)return t.log(`ERROR: sleeve.getTask(${e}) failed because it is an invalid sleeve number.`),!1;const a=A.a.sleeves[e];return{task:z.SleeveTaskType[a.currentTask],crime:a.crimeType,location:a.currentTaskLocation,gymStatType:a.gymStatType,factionWorkType:k.FactionWorkType[a.factionWorkType]}},getInformation:function(e=0){if(t.checkingRam)return ue("getInformation",g.CONSTANTS.ScriptSleeveBaseRamCost);if(10!==A.a.bitNodeN&&!U.SourceFileFlags[10])throw Object($.d)(t,"getInformation() failed because 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");if(n("getInformation",g.CONSTANTS.ScriptSleeveBaseRamCost),e>=A.a.sleeves.length||e<0)return t.log(`ERROR: sleeve.getInformation(${e}) failed because it is an invalid sleeve number.`),!1;const a=A.a.sleeves[e];return{city:a.city,hp:a.hp,jobs:Object.keys(A.a.jobs),jobTitle:Object.values(A.a.jobs),maxHp:a.max_hp,tor:W.SpecialServerIps.hasOwnProperty("Darkweb Server"),mult:{agility:a.agility_mult,agilityExp:a.agility_exp_mult,companyRep:a.company_rep_mult,crimeMoney:a.crime_money_mult,crimeSuccess:a.crime_success_mult,defense:a.defense_mult,defenseExp:a.defense_exp_mult,dexterity:a.dexterity_mult,dexterityExp:a.dexterity_exp_mult,factionRep:a.faction_rep_mult,hacking:a.hacking_mult,hackingExp:a.hacking_exp_mult,strength:a.strength_mult,strengthExp:a.strength_exp_mult,workMoney:a.work_money_mult},timeWorked:a.currentTaskTime,earningsForSleeves:{workHackExpGain:a.earningsForSleeves.hack,workStrExpGain:a.earningsForSleeves.str,workDefExpGain:a.earningsForSleeves.def,workDexExpGain:a.earningsForSleeves.dex,workAgiExpGain:a.earningsForSleeves.agi,workChaExpGain:a.earningsForSleeves.cha,workMoneyGain:a.earningsForSleeves.money},earningsForPlayer:{workHackExpGain:a.earningsForPlayer.hack,workStrExpGain:a.earningsForPlayer.str,workDefExpGain:a.earningsForPlayer.def,workDexExpGain:a.earningsForPlayer.dex,workAgiExpGain:a.earningsForPlayer.agi,workChaExpGain:a.earningsForPlayer.cha,workMoneyGain:a.earningsForPlayer.money},earningsForTask:{workHackExpGain:a.earningsForTask.hack,workStrExpGain:a.earningsForTask.str,workDefExpGain:a.earningsForTask.def,workDexExpGain:a.earningsForTask.dex,workAgiExpGain:a.earningsForTask.agi,workChaExpGain:a.earningsForTask.cha,workMoneyGain:a.earningsForTask.money},workRepGain:a.getRepGain()}},getSleeveAugmentations:function(e=0){if(t.checkingRam)return ue("getSleeveAugmentations",g.CONSTANTS.ScriptSleeveBaseRamCost);if(10!==A.a.bitNodeN&&!U.SourceFileFlags[10])throw Object($.d)(t,"getSleeveAugmentations() failed because 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");if(n("getSleeveAugmentations",g.CONSTANTS.ScriptSleeveBaseRamCost),e>=A.a.sleeves.length||e<0)return t.log(`ERROR: sleeve.getSleeveAugmentations(${e}) failed because it is an invalid sleeve number.`),[];const a=[];for(let t=0;t=A.a.sleeves.length||e<0)return t.log(`ERROR: sleeve.getSleevePurchasableAugs(${e}) failed because it is an invalid sleeve number.`),[];const a=Object(V.findSleevePurchasableAugs)(A.a.sleeves[e],A.a),r=[];for(let e=0;e=A.a.sleeves.length||e<0)return t.log(`ERROR: sleeve.purchaseSleeveAug(${e}) failed because it is an invalid sleeve number.`),!1;const r=i.Augmentations[a];return r||t.log(`ERROR: sleeve.purchaseSleeveAug(${e}) failed because ${a} is not a valid aug.`),A.a.sleeves[e].tryBuyAugmentation(A.a,r)}}}}}).call(this,n(81))},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return i}),n.d(t,"f",function(){return l}),n.d(t,"e",function(){return c}),n.d(t,"g",function(){return p}),n.d(t,"h",function(){return h}),n.d(t,"c",function(){return o}),n.d(t,"d",function(){return s});var a=n(10);let r={},i={};function o(e){r=""===e?{}:JSON.parse(e)}function s(e){i=""===e?{}:JSON.parse(e)}function l(){for(var e in r)r.hasOwnProperty(e)&&Object(a.post)("alias "+e+"="+r[e]);for(var e in i)i.hasOwnProperty(e)&&Object(a.post)("global alias "+e+"="+i[e])}function c(e,t=!1){var n=e.match(/^([_|\w|!|%|,|@]+)="(.+)"$/);return null!=n&&3==n.length&&(t?function(e,t){e in r&&delete r[e];i[e]=t}(n[1],n[2]):function(e,t){e in i&&delete i[e];r[e]=t}(n[1],n[2]),!0)}function u(e){return i.hasOwnProperty(e)?i[e]:null}function p(e){return r.hasOwnProperty(e)?(delete r[e],!0):!!i.hasOwnProperty(e)&&(delete i[e],!0)}function h(e){var t=e.split(" ");if(t.length>0){if("unalias"===t[0])return t.join(" ");if(null!=(a=function(e){return r.hasOwnProperty(e)?r[e]:null}(t[0])))t[0]=a;else null!=(a=u(t[0]))&&(t[0]=a);for(var n=0;n"+n.infoText+""})),a.push(Object(k.createElement)("p",{innerText:"---------------"}));var r=t.getFavorGain();2!=r.length&&(r=0),r=r[0],a.push(Object(k.createElement)("p",{innerText:"Reputation: "+Object(C.formatNumber)(t.playerReputation,4),tooltip:"You will earn "+Object(C.formatNumber)(r,0)+" faction favor upon resetting after installing an Augmentation"})),a.push(Object(k.createElement)("p",{innerText:"---------------"})),a.push(Object(k.createElement)("p",{innerText:"Faction Favor: "+Object(C.formatNumber)(t.favor,0),tooltip:"Faction favor increases the rate at which you earn reputation for this faction by 1% per favor. Faction favor is gained whenever you reset after installing an Augmentation. The amount of favor you gain depends on how much reputation you have with the faction"})),a.push(Object(k.createElement)("p",{innerText:"---------------"})),a.push(Object(k.createElement)("pre",{id:"faction-work-description-text",innerText:"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. Note that you cannot use your terminal or create scripts when you are performing a task!"})),a.push(Object(k.createElement)("br"));var i=Object(k.createElement)("div",{class:"faction-work-div"}),c=Object(k.createElement)("div",{class:"faction-work-div-wrapper"});i.appendChild(c),c.appendChild(Object(k.createElement)("a",{class:"a-link-button",innerText:"Hacking Mission",clickListener:()=>{l.Engine.loadMissionContent();var e=new p.a(t.playerReputation,t);return Object(p.d)(!0,e),e.init(),!1}})),c.appendChild(Object(k.createElement)("p",{innerText:"Attempt a hacking mission for your faction. A mission is a mini game that, if won, earns you significant reputation with this faction. (Recommended hacking level: 200+)"})),a.push(i);var m=Object(k.createElement)("div",{class:"faction-work-div"}),d=Object(k.createElement)("div",{class:"faction-work-div-wrapper"});m.appendChild(d),d.appendChild(Object(k.createElement)("a",{class:"std-button",innerText:"Hacking Contracts",clickListener:()=>(h.a.startFactionHackWork(t),!1)})),d.appendChild(Object(k.createElement)("p",{innerText:"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."})),a.push(m);var f=Object(k.createElement)("div",{class:"faction-work-div"}),v=Object(k.createElement)("div",{class:"faction-work-div-wrapper"});f.appendChild(v),v.appendChild(Object(k.createElement)("a",{class:"std-button",innerText:"Field Work",clickListener:()=>(h.a.startFactionFieldWork(t),!1)})),v.appendChild(Object(k.createElement)("p",{innerText:"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."})),a.push(f);var T=Object(k.createElement)("div",{class:"faction-work-div"}),S=Object(k.createElement)("div",{class:"faction-work-div-wrapper"});T.appendChild(S),S.appendChild(Object(k.createElement)("a",{class:"std-button",innerText:"Security Work",clickListener:()=>(h.a.startFactionSecurityWork(t),!1)})),S.appendChild(Object(k.createElement)("p",{innerText:"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."})),a.push(T);var A=Object(k.createElement)("div",{class:"faction-work-div"}),w=Object(k.createElement)("div",{class:"faction-work-div-wrapper"});A.appendChild(w);var x=Object(k.createElement)("p",{innerText:"This donation will result in 0.000 reputation gain"}),R=Object(k.createElement)("input",{class:"text-input",placeholder:"Donation amount",inputListener:()=>{let e=0;if(""!==R.value&&(e=parseFloat(R.value)),isNaN(e))x.innerText="Invalid donate amount entered!";else{var t=e/s.CONSTANTS.DonateMoneyToRepDivisor*h.a.faction_rep_mult;x.innerText="This donation will result in "+Object(C.formatNumber)(t,3)+" reputation gain"}}});w.appendChild(Object(k.createElement)("a",{class:"std-button",innerText:"Donate Money",clickListener:()=>{var n=parseFloat(R.value);if(isNaN(n)||n<0)Object(b.dialogBoxCreate)("Invalid amount entered!");else if(h.a.money.lt(n))Object(b.dialogBoxCreate)("You cannot afford to donate this much money!");else{h.a.loseMoney(n);var a=n/s.CONSTANTS.DonateMoneyToRepDivisor*h.a.faction_rep_mult;t.playerReputation+=a,Object(b.dialogBoxCreate)("You just donated "+y.numeralWrapper.format(n,"$0.000a")+" to "+t.name+" to gain "+Object(C.formatNumber)(a,3)+" reputation"),M(e)}}})),w.appendChild(R),w.appendChild(x),a.push(A);const N=Object(k.createElement)("div",{class:"faction-work-div",display:"inline"}),I=Object(k.createElement)("div",{class:"faction-work-div-wrapper"});if(N.appendChild(I),I.appendChild(Object(k.createElement)("a",{class:"std-button",innerText:"Purchase Augmentations",margin:"5px",clickListener:()=>(l.Engine.hideAllContent(),l.Engine.Display.factionAugmentationsContent.style.display="block",P(e),!1)})),I.appendChild(Object(k.createElement)("pre",{innerHTML:"
As your reputation with this faction rises, you will unlock Augmentations, which you can purchase to enhance your abilities.

"})),a.push(N),2!=h.a.bitNodeN||"Slum Snakes"!=e&&"Tetrads"!=e&&"The Syndicate"!=e&&"The Dark Army"!=e&&"Speakers for the Dead"!=e&&"NiteSec"!=e&&"The Black Hand"!=e){if("The Covenant"===e&&h.a.bitNodeN>=10&&g.SourceFileFlags[10]){const e=Object(k.createElement)("div",{class:"faction-work-div",display:"inline"}),t=Object(k.createElement)("div",{class:"faction-work-div-wrapper"});e.appendChild(t),t.appendChild(Object(k.createElement)("a",{class:"std-button",innerText:"Purchase Duplicate Sleeves",clickListener:()=>{Object(_.createSleevePurchasesFromCovenantPopup)(h.a)}})),t.appendChild(Object(k.createElement)("p",{innerText:"Purchase Duplicate Sleeves. These are permanent! You can purchase up to 5 total."})),a.push(e)}A.style.display=t.favor>=Math.floor(s.CONSTANTS.BaseFavorToDonate*o.BitNodeMultipliers.RepToDonateToFaction)?"inline":"none",i.style.display=n.offerHackingMission?"inline":"none",m.style.display=n.offerHackingWork?"inline":"none",f.style.display=n.offerFieldWork?"inline":"none",T.style.display=n.offerSecurityWork?"inline":"none";for(B=0;B{if(h.a.inGang())l.Engine.loadGangContent();else{let a=!1;"NiteSec"!==e&&"The Black Hand"!==e||(a=!0);var t=Object(O.yesNoBoxGetYesButton)(),n=Object(O.yesNoBoxGetNoButton)();t.innerHTML="Create Gang",n.innerHTML="Cancel",t.addEventListener("click",()=>{h.a.startGang(e,a),document.getElementById("world-menu-header").click(),document.getElementById("world-menu-header").click(),l.Engine.loadGangContent(),Object(O.yesNoBoxClose)()}),n.addEventListener("click",()=>{Object(O.yesNoBoxClose)()});let r="";r=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.

",Object(O.yesNoBoxCreate)(`Would you like to create a new Gang with ${e}?

`+"Note that this will prevent you from creating a Gang with any other Faction until this BitNode is destroyed.

"+r+"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.")}}})),D.appendChild(Object(k.createElement)("p",{innerText:"Create and manage a gang for this Faction. Gangs will earn you money and faction reputation."})),a.splice(7,1,L),h.a.inGang()&&h.a.gang.facName!=e&&(L.style.display="none");for(var B=0;B(l.Engine.loadFactionContent(),M(e),!1)})),n.push(Object(k.createElement)("h1",{innerText:"Faction Augmentations"})),n.push(Object(k.createElement)("p",{id:"faction-augmentations-page-desc",innerHTML:"Lists all Augmentations that are available to purchase from "+e+"

Augmentations are powerful upgrades that will enhance your abilities."})),n.push(Object(k.createElement)("br")),n.push(Object(k.createElement)("br"));var r=Object(k.createElement)("ul");const i=Object(k.createElement)("a",{innerText:"Sort by Cost",class:"a-link-button",clickListener:()=>{d.Settings.PurchaseAugmentationsOrder=m.PurchaseAugmentationsOrderSetting.Cost;var e=t.augmentations.slice();e.sort((e,t)=>{var n=a.Augmentations[e],r=a.Augmentations[t];if(null==n||null==r)throw new Error("Invalid Augmentation Names");return n.baseCost-r.baseCost}),Object(E.removeChildrenFromElement)(r),A(r,e,t)}}),o=Object(k.createElement)("a",{innerText:"Sort by Reputation",class:"a-link-button",clickListener:()=>{d.Settings.PurchaseAugmentationsOrder=m.PurchaseAugmentationsOrderSetting.Reputation;var e=t.augmentations.slice();e.sort((e,t)=>{var n=a.Augmentations[e],r=a.Augmentations[t];if(null==n||null==r)throw new Error("Invalid Augmentation Names");return n.baseRepRequirement-r.baseRepRequirement}),Object(E.removeChildrenFromElement)(r),A(r,e,t)}}),s=Object(k.createElement)("a",{innerText:"Sort by Default Order",class:"a-link-button",clickListener:()=>{d.Settings.PurchaseAugmentationsOrder=m.PurchaseAugmentationsOrderSetting.Default,Object(E.removeChildrenFromElement)(r),A(r,t.augmentations,t)}});switch(n.push(i),n.push(o),n.push(s),d.Settings.PurchaseAugmentationsOrder){case m.PurchaseAugmentationsOrderSetting.Cost:i.click();break;case m.PurchaseAugmentationsOrderSetting.Reputation:o.click();break;default:s.click()}n.push(r);for(var c=0;c(d.Settings.SuppressBuyAugmentationConfirmation?R(s,n):w(s,n),!1)});s.name==i.AugmentationNames.NeuroFluxGovernor&&(g.innerText+=" - Level "+N());var _=Object(k.createElement)("p",{display:"inline"}),f=s.baseRepRequirement*r.augmentationRepRequirementMult;x(s)?s.name!=i.AugmentationNames.NeuroFluxGovernor&&(s.owned||l)?(g.setAttribute("class","a-link-button-inactive"),_.innerHTML="ALREADY OWNED"):n.playerReputation>=f?(g.setAttribute("class","a-link-button"),_.innerHTML="UNLOCKED - "+y.numeralWrapper.format(s.baseCost*r.augmentationPriceMult,"$0.000a")):(g.setAttribute("class","a-link-button-inactive"),_.innerHTML="LOCKED (Requires "+Object(C.formatNumber)(f,1)+" faction reputation) - "+y.numeralWrapper.format(s.baseCost*r.augmentationPriceMult,"$0.000a"),_.style.color="red"):(g.setAttribute("class","a-link-button-inactive"),_.innerHTML="LOCKED (Requires "+s.prereqs.join(",")+" as prerequisite(s))",_.style.color="red"),m.appendChild(g),p.appendChild(m),p.appendChild(_),u.appendChild(p),e.appendChild(u)}()}function w(e,t){const n=t.getInfo();var a=Object(O.yesNoBoxGetYesButton)(),r=Object(O.yesNoBoxGetNoButton)();a.innerHTML="Purchase",r.innerHTML="Cancel",a.addEventListener("click",function(){R(e,t)}),r.addEventListener("click",function(){Object(O.yesNoBoxClose)()}),Object(O.yesNoBoxCreate)("

"+e.name+"


"+e.info+"


Would you like to purchase the "+e.name+" Augmentation for $"+Object(C.formatNumber)(e.baseCost*n.augmentationPriceMult,2)+"?")}function x(e){var t=!0;if(e.prereqs&&e.prereqs.length>0)for(var n=0;n{if(e instanceof Element)r.removeElement(e);else try{const t=document.getElementById(e);t instanceof Element&&r.removeElement(t)}catch(e){console.error(`createPopupCloseButton() threw: ${e}`)}return document.removeEventListener("keydown",i),!1}}),document.addEventListener("keydown",i),n}},function(e,t,n){"use strict";n.d(t,"b",function(){return i}),n.d(t,"c",function(){return o}),n.d(t,"e",function(){return s}),n.d(t,"d",function(){return l}),n.d(t,"a",function(){return c}),n.d(t,"f",function(){return u});var a=n(21),r=n(0);n(75);function i(e){const t=(100-e.hackDifficulty)/100,n=1.75*r.a.hacking_skill+.2*r.a.intelligence,a=(n-e.requiredHackingSkill)/n*t*r.a.hacking_chance_mult;return a>1?1:a<0?0:a}function o(e){null==e.baseDifficulty&&(e.baseDifficulty=e.hackDifficulty);var t=3;return(t+=e.baseDifficulty*r.a.hacking_exp_mult*.3)*a.BitNodeMultipliers.HackExpGain}function s(e){const t=(100-e.hackDifficulty)/100*((r.a.hacking_skill-(e.requiredHackingSkill-1))/r.a.hacking_skill)*r.a.hacking_money_mult/240;return t<0?0:t>1?1:t*a.BitNodeMultipliers.ScriptHackMoney}function l(e,t,n){const a=e.requiredHackingSkill*e.hackDifficulty;null==t&&(t=r.a.hacking_skill),null==n&&(n=r.a.intelligence);var i=2.5*a+500;return 5*(i/=t+50+.1*n)/r.a.hacking_speed_mult}function c(e,t,n){return 3.2*l(e,t,n)}function u(e,t,n){return 4*l(e,t,n)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=n(4);t.createOptionElement=function(e,t=""){let n=t;return""===n&&(n=e),a.createElement("option",{text:e,value:n})}},function(e,t,n){"use strict";(function(e){n.d(t,"d",function(){return S}),n.d(t,"b",function(){return M}),n.d(t,"e",function(){return P}),n.d(t,"c",function(){return w}),n.d(t,"a",function(){return R});var a=n(102),r=n(162),i=n(64),o=n(2),s=n(11),l=n(112),c=(n(35),n(42)),u=n(40),p=n(0),h=n(109),m=n(108),d=n(20),g=n(22),_=n(19),f=n(49),y=n(87),b=n(12),v=n(3),E=n(9),k=(n(18),n(130)),C=n(4),O=null,T=null;function S(){const e=document.getElementById("script-editor-buttons-wrapper");if(null==e)return console.error("Could not find 'script-editor-buttons-wrapper'"),!1;const t=Object(C.createElement)("button",{class:"std-button",display:"inline-block",innerText:"Beautify",clickListener:()=>{let e=M();return null!=e&&e.beautifyScript(),!1}});T=Object(C.createElement)("p",{display:"inline-block",margin:"10px",id:"script-editor-status-text"});const n=Object(C.createElement)("label",{for:"script-editor-ram-check",margin:"4px",marginTop:"8px",innerText:"Dynamic RAM Usage Checker",color:"white",tooltip:"Enable/Disable the dynamic RAM Usage display. You may want to disable it for very long scripts because there may be performance issues"});(O=Object(C.createElement)("input",{type:"checkbox",name:"script-editor-ram-check",id:"script-editor-ram-check",margin:"4px",marginTop:"8px"})).checked=!0;const a=Object(C.createElement)("a",{class:"std-button",display:"inline-block",href:"https://bitburner.readthedocs.io/en/latest/index.html",innerText:"Netscript Documentation",target:"_blank"}),r=Object(C.createElement)("button",{class:"std-button",display:"inline-block",innerText:"Save & Close (Ctrl/Cmd + b)",clickListener:()=>(A(),!1)});e.appendChild(t),e.appendChild(r),e.appendChild(T),e.appendChild(O),e.appendChild(n),e.appendChild(a);const i={saveAndCloseFn:A,quitFn:s.Engine.loadTerminalContent};h.a.init(i),m.a.init(i);const o=document.getElementById("script-editor-option-editor");if(null==o)return console.error("Could not find DOM Element for editor selector (id=script-editor-option-editor)"),!1;for(let e=0;e{const e=o.value;switch(e){case f.EditorSetting.Ace:const t=m.a.getCode(),n=m.a.getFilename();h.a.create(),m.a.setInvisible(),h.a.openScript(n,t);break;case f.EditorSetting.CodeMirror:const a=h.a.getCode(),r=h.a.getFilename();m.a.create(),h.a.setInvisible(),m.a.openScript(r,a);break;default:return void console.error(`Unrecognized Editor Setting: ${e}`)}_.Settings.Editor=e}),o.onchange()}function M(){switch(_.Settings.Editor){case f.EditorSetting.Ace:return h.a;case f.EditorSetting.CodeMirror:return m.a;default:throw console.log(`Invalid Editor Setting: ${_.Settings.Editor}`),new Error(`Invalid Editor Setting: ${_.Settings.Editor}`)}}async function P(){var e=document.getElementById("script-editor-filename").value;if(null==O||!O.checked||!Object(i.isScriptFilename)(e))return void(T.innerText="N/A");let t;try{t=M().getCode()}catch(e){return void(T.innerText="RAM: ERROR")}var n=t.repeat(1),a=await Object(r.calculateRamUsage)(n);T.innerText=-1!==a?"RAM: "+v.numeralWrapper.format(a,"0.00")+" GB":"RAM: Syntax Error"}function A(){var e=document.getElementById("script-editor-filename").value;let t;try{t=M().getCode()}catch(e){return void Object(E.dialogBoxCreate)("Something went wrong when trying to save (getCurrentEditor().getCode()). Please report to game developer with details")}if(c.a.isRunning&&c.a.currStep===c.d.TerminalTypeScript){if("foodnstuff.script"!==e)return void Object(E.dialogBoxCreate)("Leave the script name as 'foodnstuff'!");if(-1==(t=t.replace(/\s/g,"")).indexOf("while(true){hack('foodnstuff');}"))return void Object(E.dialogBoxCreate)("Please copy and paste the code from the tutorial!");let r=p.a.getCurrentServer();for(var n=0;n=1&&(n=1),e.dataMap)if(e.dataMap.hasOwnProperty(a)){if(0==e.dataMap[a][2]||null==e.dataMap[a][2])continue;if(null==(h=d.AllServers[a]))continue;var r=Math.round(.5*e.dataMap[a][2]/e.onlineRunningTime*t);console.log(e.filename+" called grow() on "+h.hostname+" "+r+" times while offline"),e.log("Called grow() on "+h.hostname+" "+r+" times while offline");var i=Object(g.processSingleServerGrowth)(h,450*r,p.a);e.log(h.hostname+" grown by "+v.numeralWrapper.format(100*i-100,"0.000000%")+" from grow() calls made while offline")}var s=0;for(var a in e.dataMap)if(e.dataMap.hasOwnProperty(a)){if(0==e.dataMap[a][0]||null==e.dataMap[a][0])continue;if(null==(h=d.AllServers[a]))continue;var l=.5*e.dataMap[a][0]/e.onlineRunningTime*t;(l*=n)>h.moneyAvailable&&(l=h.moneyAvailable),s+=l,p.a.gainMoney(l),p.a.recordMoneySource(l,"hacking"),console.log(e.filename+" generated $"+l+" while offline by hacking "+h.hostname),e.log(e.filename+" generated $"+l+" while offline by hacking "+h.hostname),h.moneyAvailable-=l,h.moneyAvailable<0&&(h.moneyAvailable=0),isNaN(h.moneyAvailable)&&(h.moneyAvailable=0)}var c=e.onlineExpGained/e.onlineRunningTime*.5*t;for(var a in c*=n,p.a.gainHackingExp(c),e.offlineMoneyMade+=s,e.offlineRunningTime+=t,e.offlineExpGained+=c,e.dataMap)if(e.dataMap.hasOwnProperty(a)){if(0==e.dataMap[a][1]||null==e.dataMap[a][1])continue;if(null==(h=d.AllServers[a]))continue;var u=Math.round(.5*e.dataMap[a][1]/e.onlineRunningTime*t);console.log(e.filename+" hacked "+h.hostname+" "+u+" times while offline"),e.log("Hacked "+h.hostname+" "+u+" times while offline"),h.fortify(o.CONSTANTS.ServerFortifyAmount*u)}for(var a in e.dataMap)if(e.dataMap.hasOwnProperty(a)){if(0==e.dataMap[a][3]||null==e.dataMap[a][3])continue;var h;if(null==(h=d.AllServers[a]))continue;var m=Math.round(.5*e.dataMap[a][3]/e.onlineRunningTime*t);console.log(e.filename+" called weaken() on "+h.hostname+" "+m+" times while offline"),e.log("Called weaken() on "+h.hostname+" "+m+" times while offline"),h.weaken(o.CONSTANTS.ServerWeakenAmount*m)}return s}function R(e,t,n){for(var a=0;ae)return!1;if((n+=t[a+1])>=e)return!0}}function p(e,t){return e<65?36===e:e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&o.test(String.fromCharCode(e)):!1!==t&&u(e,l)))}function h(e,t){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&s.test(String.fromCharCode(e)):!1!==t&&(u(e,l)||u(e,c)))))}var m=function(e,t){void 0===t&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function d(e,t){return new m(e,{beforeExpr:!0,binop:t})}var g={beforeExpr:!0},_={startsExpr:!0},f={};function y(e,t){return void 0===t&&(t={}),t.keyword=e,f[e]=new m(e,t)}var b={num:new m("num",_),regexp:new m("regexp",_),string:new m("string",_),name:new m("name",_),eof:new m("eof"),bracketL:new m("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new m("]"),braceL:new m("{",{beforeExpr:!0,startsExpr:!0}),braceR:new m("}"),parenL:new m("(",{beforeExpr:!0,startsExpr:!0}),parenR:new m(")"),comma:new m(",",g),semi:new m(";",g),colon:new m(":",g),dot:new m("."),question:new m("?",g),arrow:new m("=>",g),template:new m("template"),ellipsis:new m("...",g),backQuote:new m("`",_),dollarBraceL:new m("${",{beforeExpr:!0,startsExpr:!0}),eq:new m("=",{beforeExpr:!0,isAssign:!0}),assign:new m("_=",{beforeExpr:!0,isAssign:!0}),incDec:new m("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new m("prefix",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:d("||",1),logicalAND:d("&&",2),bitwiseOR:d("|",3),bitwiseXOR:d("^",4),bitwiseAND:d("&",5),equality:d("==/!=",6),relational:d("",7),bitShift:d("<>",8),plusMin:new m("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:d("%",10),star:d("*",10),slash:d("/",10),starstar:new m("**",{beforeExpr:!0}),_break:y("break"),_case:y("case",g),_catch:y("catch"),_continue:y("continue"),_debugger:y("debugger"),_default:y("default",g),_do:y("do",{isLoop:!0,beforeExpr:!0}),_else:y("else",g),_finally:y("finally"),_for:y("for",{isLoop:!0}),_function:y("function",_),_if:y("if"),_return:y("return",g),_switch:y("switch"),_throw:y("throw",g),_try:y("try"),_var:y("var"),_const:y("const"),_while:y("while",{isLoop:!0}),_with:y("with"),_new:y("new",{beforeExpr:!0,startsExpr:!0}),_this:y("this",_),_super:y("super",_),_class:y("class"),_extends:y("extends",g),_export:y("export"),_import:y("import"),_null:y("null",_),_true:y("true",_),_false:y("false",_),_in:y("in",{beforeExpr:!0,binop:7}),_instanceof:y("instanceof",{beforeExpr:!0,binop:7}),_typeof:y("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:y("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:y("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},v=/\r\n?|\n|\u2028|\u2029/,E=new RegExp(v.source,"g");function k(e){return 10===e||13===e||8232===e||8233===e}var C=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/,O=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,T=Object.prototype,S=T.hasOwnProperty,M=T.toString;function P(e,t){return S.call(e,t)}var A=Array.isArray||function(e){return"[object Array]"===M.call(e)},w=function(e,t){this.line=e,this.column=t};w.prototype.offset=function(e){return new w(this.line,this.column+e)};var x=function(e,t,n){this.start=t,this.end=n,null!==e.sourceFile&&(this.source=e.sourceFile)};function R(e,t){for(var n=1,a=0;;){E.lastIndex=a;var r=E.exec(e);if(!(r&&r.index=2015&&(t.ecmaVersion-=2009),null==t.allowReserved&&(t.allowReserved=t.ecmaVersion<5),A(t.onToken)){var a=t.onToken;t.onToken=function(e){return a.push(e)}}return A(t.onComment)&&(t.onComment=function(e,t){return function(n,a,r,i,o,s){var l={type:n?"Block":"Line",value:a,start:r,end:i};e.locations&&(l.loc=new x(this,o,s)),e.ranges&&(l.range=[r,i]),t.push(l)}}(t,t.onComment)),t}var L={};function D(e){return new RegExp("^("+e.replace(/ /g,"|")+")$")}var B=function(e,n,r){this.options=e=I(e),this.sourceFile=e.sourceFile,this.keywords=D(a[e.ecmaVersion>=6?6:5]);var i="";if(!e.allowReserved){for(var o=e.ecmaVersion;!(i=t[o]);o--);"module"==e.sourceType&&(i+=" await")}this.reservedWords=D(i);var s=(i?i+" ":"")+t.strict;this.reservedWordsStrict=D(s),this.reservedWordsStrictBind=D(s+" "+t.strictBind),this.input=String(n),this.containsEsc=!1,this.loadPlugins(e.plugins),r?(this.pos=r,this.lineStart=this.input.lastIndexOf("\n",r-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(v).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=b.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===e.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.inFunction=this.inGenerator=this.inAsync=!1,this.yieldPos=this.awaitPos=0,this.labels=[],0===this.pos&&e.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterFunctionScope()};B.prototype.isKeyword=function(e){return this.keywords.test(e)},B.prototype.isReservedWord=function(e){return this.reservedWords.test(e)},B.prototype.extend=function(e,t){this[e]=t(this[e])},B.prototype.loadPlugins=function(e){for(var t in e){var n=L[t];if(!n)throw new Error("Plugin '"+t+"' not found");n(this,e[t])}},B.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)};var W=B.prototype,j=/^(?:'((?:[^']|\.)*)'|"((?:[^"]|\.)*)"|;)/;W.strictDirective=function(e){for(;;){O.lastIndex=e,e+=O.exec(this.input)[0].length;var t=j.exec(this.input.slice(e));if(!t)return!1;if("use strict"==(t[1]||t[2]))return!0;e+=t[0].length}},W.eat=function(e){return this.type===e&&(this.next(),!0)},W.isContextual=function(e){return this.type===b.name&&this.value===e},W.eatContextual=function(e){return this.value===e&&this.eat(b.name)},W.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},W.canInsertSemicolon=function(){return this.type===b.eof||this.type===b.braceR||v.test(this.input.slice(this.lastTokEnd,this.start))},W.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},W.semicolon=function(){this.eat(b.semi)||this.insertSemicolon()||this.unexpected()},W.afterTrailingComma=function(e,t){if(this.type==e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},W.expect=function(e){this.eat(e)||this.unexpected()},W.unexpected=function(e){this.raise(null!=e?e:this.start,"Unexpected token")};var F=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=-1};W.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var n=t?e.parenthesizedAssign:e.parenthesizedBind;n>-1&&this.raiseRecoverable(n,"Parenthesized pattern")}},W.checkExpressionErrors=function(e,t){var n=e?e.shorthandAssign:-1;if(!t)return n>=0;n>-1&&this.raise(n,"Shorthand property assignments are valid only in destructuring patterns")},W.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos=6&&(e.sourceType=this.options.sourceType),this.finishNode(e,"Program")};var H={kind:"loop"},G={kind:"switch"};U.isLet=function(){if(this.type!==b.name||this.options.ecmaVersion<6||"let"!=this.value)return!1;O.lastIndex=this.pos;var e=O.exec(this.input),t=this.pos+e[0].length,n=this.input.charCodeAt(t);if(91===n||123==n)return!0;if(p(n,!0)){for(var a=t+1;h(this.input.charCodeAt(a),!0);)++a;var r=this.input.slice(t,a);if(!this.isKeyword(r))return!0}return!1},U.isAsyncFunction=function(){if(this.type!==b.name||this.options.ecmaVersion<8||"async"!=this.value)return!1;O.lastIndex=this.pos;var e=O.exec(this.input),t=this.pos+e[0].length;return!(v.test(this.input.slice(this.pos,t))||"function"!==this.input.slice(t,t+8)||t+8!=this.input.length&&h(this.input.charAt(t+8)))},U.parseStatement=function(e,t,n){var a,r=this.type,i=this.startNode();switch(this.isLet()&&(r=b._var,a="let"),r){case b._break:case b._continue:return this.parseBreakContinueStatement(i,r.keyword);case b._debugger:return this.parseDebuggerStatement(i);case b._do:return this.parseDoStatement(i);case b._for:return this.parseForStatement(i);case b._function:return!e&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(i,!1);case b._class:return e||this.unexpected(),this.parseClass(i,!0);case b._if:return this.parseIfStatement(i);case b._return:return this.parseReturnStatement(i);case b._switch:return this.parseSwitchStatement(i);case b._throw:return this.parseThrowStatement(i);case b._try:return this.parseTryStatement(i);case b._const:case b._var:return a=a||this.value,e||"var"==a||this.unexpected(),this.parseVarStatement(i,a);case b._while:return this.parseWhileStatement(i);case b._with:return this.parseWithStatement(i);case b.braceL:return this.parseBlock();case b.semi:return this.parseEmptyStatement(i);case b._export:case b._import:return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),r===b._import?this.parseImport(i):this.parseExport(i,n);default:if(this.isAsyncFunction()&&e)return this.next(),this.parseFunctionStatement(i,!0);var o=this.value,s=this.parseExpression();return r===b.name&&"Identifier"===s.type&&this.eat(b.colon)?this.parseLabeledStatement(i,o,s):this.parseExpressionStatement(i,s)}},U.parseBreakContinueStatement=function(e,t){var n="break"==t;this.next(),this.eat(b.semi)||this.insertSemicolon()?e.label=null:this.type!==b.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var a=0;a=6?this.eat(b.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},U.parseForStatement=function(e){if(this.next(),this.labels.push(H),this.enterLexicalScope(),this.expect(b.parenL),this.type===b.semi)return this.parseFor(e,null);var t=this.isLet();if(this.type===b._var||this.type===b._const||t){var n=this.startNode(),a=t?"let":this.value;return this.next(),this.parseVar(n,!0,a),this.finishNode(n,"VariableDeclaration"),!(this.type===b._in||this.options.ecmaVersion>=6&&this.isContextual("of"))||1!==n.declarations.length||"var"!==a&&n.declarations[0].init?this.parseFor(e,n):this.parseForIn(e,n)}var r=new F,i=this.parseExpression(!0,r);return this.type===b._in||this.options.ecmaVersion>=6&&this.isContextual("of")?(this.toAssignable(i),this.checkLVal(i),this.checkPatternErrors(r,!0),this.parseForIn(e,i)):(this.checkExpressionErrors(r,!0),this.parseFor(e,i))},U.parseFunctionStatement=function(e,t){return this.next(),this.parseFunction(e,!0,!1,t)},U.isFunction=function(){return this.type===b._function||this.isAsyncFunction()},U.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement(!this.strict&&this.isFunction()),e.alternate=this.eat(b._else)?this.parseStatement(!this.strict&&this.isFunction()):null,this.finishNode(e,"IfStatement")},U.parseReturnStatement=function(e){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(b.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},U.parseSwitchStatement=function(e){var t;this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(b.braceL),this.labels.push(G),this.enterLexicalScope();for(var n=!1;this.type!=b.braceR;)if(this.type===b._case||this.type===b._default){var a=this.type===b._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),a?t.test=this.parseExpression():(n&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),n=!0,t.test=null),this.expect(b.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(!0));return this.exitLexicalScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")},U.parseThrowStatement=function(e){return this.next(),v.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var K=[];U.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===b._catch){var t=this.startNode();this.next(),this.expect(b.parenL),t.param=this.parseBindingAtom(),this.enterLexicalScope(),this.checkLVal(t.param,"let"),this.expect(b.parenR),t.body=this.parseBlock(!1),this.exitLexicalScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(b._finally)?this.parseBlock():null,e.handler||e.finalizer||this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},U.parseVarStatement=function(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")},U.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(H),e.body=this.parseStatement(!1),this.labels.pop(),this.finishNode(e,"WhileStatement")},U.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement(!1),this.finishNode(e,"WithStatement")},U.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},U.parseLabeledStatement=function(e,t,n){for(var a=0;a=0;i--){var o=this.labels[i];if(o.statementStart!=e.start)break;o.statementStart=this.start,o.kind=r}return this.labels.push({name:t,kind:r,statementStart:this.start}),e.body=this.parseStatement(!0),("ClassDeclaration"==e.body.type||"VariableDeclaration"==e.body.type&&"var"!=e.body.kind||"FunctionDeclaration"==e.body.type&&(this.strict||e.body.generator))&&this.raiseRecoverable(e.body.start,"Invalid labeled declaration"),this.labels.pop(),e.label=n,this.finishNode(e,"LabeledStatement")},U.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},U.parseBlock=function(e){void 0===e&&(e=!0);var t=this.startNode();for(t.body=[],this.expect(b.braceL),e&&this.enterLexicalScope();!this.eat(b.braceR);){var n=this.parseStatement(!0);t.body.push(n)}return e&&this.exitLexicalScope(),this.finishNode(t,"BlockStatement")},U.parseFor=function(e,t){return e.init=t,this.expect(b.semi),e.test=this.type===b.semi?null:this.parseExpression(),this.expect(b.semi),e.update=this.type===b.parenR?null:this.parseExpression(),this.expect(b.parenR),this.exitLexicalScope(),e.body=this.parseStatement(!1),this.labels.pop(),this.finishNode(e,"ForStatement")},U.parseForIn=function(e,t){var n=this.type===b._in?"ForInStatement":"ForOfStatement";return this.next(),e.left=t,e.right=this.parseExpression(),this.expect(b.parenR),this.exitLexicalScope(),e.body=this.parseStatement(!1),this.labels.pop(),this.finishNode(e,n)},U.parseVar=function(e,t,n){for(e.declarations=[],e.kind=n;;){var a=this.startNode();if(this.parseVarId(a,n),this.eat(b.eq)?a.init=this.parseMaybeAssign(t):"const"!==n||this.type===b._in||this.options.ecmaVersion>=6&&this.isContextual("of")?"Identifier"==a.id.type||t&&(this.type===b._in||this.isContextual("of"))?a.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.unexpected(),e.declarations.push(this.finishNode(a,"VariableDeclarator")),!this.eat(b.comma))break}return e},U.parseVarId=function(e,t){e.id=this.parseBindingAtom(t),this.checkLVal(e.id,t,!1)},U.parseFunction=function(e,t,n,a){this.initFunction(e),this.options.ecmaVersion>=6&&!a&&(e.generator=this.eat(b.star)),this.options.ecmaVersion>=8&&(e.async=!!a),t&&(e.id="nullableID"===t&&this.type!=b.name?null:this.parseIdent(),e.id&&this.checkLVal(e.id,"var"));var r=this.inGenerator,i=this.inAsync,o=this.yieldPos,s=this.awaitPos,l=this.inFunction;return this.inGenerator=e.generator,this.inAsync=e.async,this.yieldPos=0,this.awaitPos=0,this.inFunction=!0,this.enterFunctionScope(),t||(e.id=this.type==b.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,n),this.inGenerator=r,this.inAsync=i,this.yieldPos=o,this.awaitPos=s,this.inFunction=l,this.finishNode(e,t?"FunctionDeclaration":"FunctionExpression")},U.parseFunctionParams=function(e){this.expect(b.parenL),e.params=this.parseBindingList(b.parenR,!1,this.options.ecmaVersion>=8,!0),this.checkYieldAwaitInDefaultParams()},U.parseClass=function(e,t){this.next(),this.parseClassId(e,t),this.parseClassSuper(e);var n=this.startNode(),a=!1;for(n.body=[],this.expect(b.braceL);!this.eat(b.braceR);)if(!this.eat(b.semi)){var r=this.startNode(),i=this.eat(b.star),o=!1,s=this.type===b.name&&"static"===this.value;this.parsePropertyName(r),r.static=s&&this.type!==b.parenL,r.static&&(i&&this.unexpected(),i=this.eat(b.star),this.parsePropertyName(r)),this.options.ecmaVersion>=8&&!i&&!r.computed&&"Identifier"===r.key.type&&"async"===r.key.name&&this.type!==b.parenL&&!this.canInsertSemicolon()&&(o=!0,this.parsePropertyName(r)),r.kind="method";var l=!1;if(!r.computed){var c=r.key;i||o||"Identifier"!==c.type||this.type===b.parenL||"get"!==c.name&&"set"!==c.name||(l=!0,r.kind=c.name,c=this.parsePropertyName(r)),!r.static&&("Identifier"===c.type&&"constructor"===c.name||"Literal"===c.type&&"constructor"===c.value)&&(a&&this.raise(c.start,"Duplicate constructor in the same class"),l&&this.raise(c.start,"Constructor can't have get/set modifier"),i&&this.raise(c.start,"Constructor can't be a generator"),o&&this.raise(c.start,"Constructor can't be an async method"),r.kind="constructor",a=!0)}if(this.parseClassMethod(n,r,i,o),l){var u="get"===r.kind?0:1;if(r.value.params.length!==u){var p=r.value.start;"get"===r.kind?this.raiseRecoverable(p,"getter should have no params"):this.raiseRecoverable(p,"setter should have exactly one param")}else"set"===r.kind&&"RestElement"===r.value.params[0].type&&this.raiseRecoverable(r.value.params[0].start,"Setter cannot use rest params")}}return e.body=this.finishNode(n,"ClassBody"),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},U.parseClassMethod=function(e,t,n,a){t.value=this.parseMethod(n,a),e.body.push(this.finishNode(t,"MethodDefinition"))},U.parseClassId=function(e,t){e.id=this.type===b.name?this.parseIdent():!0===t?this.unexpected():null},U.parseClassSuper=function(e){e.superClass=this.eat(b._extends)?this.parseExprSubscripts():null},U.parseExport=function(e,t){if(this.next(),this.eat(b.star))return this.expectContextual("from"),e.source=this.type===b.string?this.parseExprAtom():this.unexpected(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration");if(this.eat(b._default)){var n;if(this.checkExport(t,"default",this.lastTokStart),this.type===b._function||(n=this.isAsyncFunction())){var a=this.startNode();this.next(),n&&this.next(),e.declaration=this.parseFunction(a,"nullableID",!1,n)}else if(this.type===b._class){var r=this.startNode();e.declaration=this.parseClass(r,"nullableID")}else e.declaration=this.parseMaybeAssign(),this.semicolon();return this.finishNode(e,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement())e.declaration=this.parseStatement(!0),"VariableDeclaration"===e.declaration.type?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id.name,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))e.source=this.type===b.string?this.parseExprAtom():this.unexpected();else{for(var i=0;i=6&&e)switch(e.type){case"Identifier":this.inAsync&&"await"===e.name&&this.raise(e.start,"Can not use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":break;case"ObjectExpression":e.type="ObjectPattern";for(var n=0;n=6&&(e.computed||e.method||e.shorthand))){var n,a=e.key;switch(a.type){case"Identifier":n=a.name;break;case"Literal":n=String(a.value);break;default:return}var r=e.kind;if(this.options.ecmaVersion>=6)"__proto__"===n&&"init"===r&&(t.proto&&this.raiseRecoverable(a.start,"Redefinition of __proto__ property"),t.proto=!0);else{var i=t[n="$"+n];i?("init"===r?this.strict&&i.init||i.get||i.set:i.init||i[r])&&this.raiseRecoverable(a.start,"Redefinition of property"):i=t[n]={init:!1,get:!1,set:!1},i[r]=!0}}},$.parseExpression=function(e,t){var n=this.start,a=this.startLoc,r=this.parseMaybeAssign(e,t);if(this.type===b.comma){var i=this.startNodeAt(n,a);for(i.expressions=[r];this.eat(b.comma);)i.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(i,"SequenceExpression")}return r},$.parseMaybeAssign=function(e,t,n){if(this.inGenerator&&this.isContextual("yield"))return this.parseYield();var a=!1,r=-1,i=-1;t?(r=t.parenthesizedAssign,i=t.trailingComma,t.parenthesizedAssign=t.trailingComma=-1):(t=new F,a=!0);var o=this.start,s=this.startLoc;this.type!=b.parenL&&this.type!=b.name||(this.potentialArrowAt=this.start);var l=this.parseMaybeConditional(e,t);if(n&&(l=n.call(this,l,o,s)),this.type.isAssign){this.checkPatternErrors(t,!0),a||F.call(t);var c=this.startNodeAt(o,s);return c.operator=this.value,c.left=this.type===b.eq?this.toAssignable(l):l,t.shorthandAssign=-1,this.checkLVal(l),this.next(),c.right=this.parseMaybeAssign(e),this.finishNode(c,"AssignmentExpression")}return a&&this.checkExpressionErrors(t,!0),r>-1&&(t.parenthesizedAssign=r),i>-1&&(t.trailingComma=i),l},$.parseMaybeConditional=function(e,t){var n=this.start,a=this.startLoc,r=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return r;if(this.eat(b.question)){var i=this.startNodeAt(n,a);return i.test=r,i.consequent=this.parseMaybeAssign(),this.expect(b.colon),i.alternate=this.parseMaybeAssign(e),this.finishNode(i,"ConditionalExpression")}return r},$.parseExprOps=function(e,t){var n=this.start,a=this.startLoc,r=this.parseMaybeUnary(t,!1);return this.checkExpressionErrors(t)?r:r.start==n&&"ArrowFunctionExpression"===r.type?r:this.parseExprOp(r,n,a,-1,e)},$.parseExprOp=function(e,t,n,a,r){var i=this.type.binop;if(null!=i&&(!r||this.type!==b._in)&&i>a){var o=this.type===b.logicalOR||this.type===b.logicalAND,s=this.value;this.next();var l=this.start,c=this.startLoc,u=this.parseExprOp(this.parseMaybeUnary(null,!1),l,c,i,r),p=this.buildBinary(t,n,e,u,s,o);return this.parseExprOp(p,t,n,a,r)}return e},$.buildBinary=function(e,t,n,a,r,i){var o=this.startNodeAt(e,t);return o.left=n,o.operator=r,o.right=a,this.finishNode(o,i?"LogicalExpression":"BinaryExpression")},$.parseMaybeUnary=function(e,t){var n,a=this.start,r=this.startLoc;if(this.inAsync&&this.isContextual("await"))n=this.parseAwait(e),t=!0;else if(this.type.prefix){var i=this.startNode(),o=this.type===b.incDec;i.operator=this.value,i.prefix=!0,this.next(),i.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(e,!0),o?this.checkLVal(i.argument):this.strict&&"delete"===i.operator&&"Identifier"===i.argument.type?this.raiseRecoverable(i.start,"Deleting local variable in strict mode"):t=!0,n=this.finishNode(i,o?"UpdateExpression":"UnaryExpression")}else{if(n=this.parseExprSubscripts(e),this.checkExpressionErrors(e))return n;for(;this.type.postfix&&!this.canInsertSemicolon();){var s=this.startNodeAt(a,r);s.operator=this.value,s.prefix=!1,s.argument=n,this.checkLVal(n),this.next(),n=this.finishNode(s,"UpdateExpression")}}return!t&&this.eat(b.starstar)?this.buildBinary(a,r,n,this.parseMaybeUnary(null,!1),"**",!1):n},$.parseExprSubscripts=function(e){var t=this.start,n=this.startLoc,a=this.parseExprAtom(e),r="ArrowFunctionExpression"===a.type&&")"!==this.input.slice(this.lastTokStart,this.lastTokEnd);if(this.checkExpressionErrors(e)||r)return a;var i=this.parseSubscripts(a,t,n);return e&&"MemberExpression"===i.type&&(e.parenthesizedAssign>=i.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=i.start&&(e.parenthesizedBind=-1)),i},$.parseSubscripts=function(e,t,n,a){for(var r,i=this.options.ecmaVersion>=8&&"Identifier"===e.type&&"async"===e.name&&this.lastTokEnd==e.end&&!this.canInsertSemicolon();;)if((r=this.eat(b.bracketL))||this.eat(b.dot)){var o=this.startNodeAt(t,n);o.object=e,o.property=r?this.parseExpression():this.parseIdent(!0),o.computed=!!r,r&&this.expect(b.bracketR),e=this.finishNode(o,"MemberExpression")}else if(!a&&this.eat(b.parenL)){var s=new F,l=this.yieldPos,c=this.awaitPos;this.yieldPos=0,this.awaitPos=0;var u=this.parseExprList(b.parenR,this.options.ecmaVersion>=8,!1,s);if(i&&!this.canInsertSemicolon()&&this.eat(b.arrow))return this.checkPatternErrors(s,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=l,this.awaitPos=c,this.parseArrowExpression(this.startNodeAt(t,n),u,!0);this.checkExpressionErrors(s,!0),this.yieldPos=l||this.yieldPos,this.awaitPos=c||this.awaitPos;var p=this.startNodeAt(t,n);p.callee=e,p.arguments=u,e=this.finishNode(p,"CallExpression")}else{if(this.type!==b.backQuote)return e;var h=this.startNodeAt(t,n);h.tag=e,h.quasi=this.parseTemplate(),e=this.finishNode(h,"TaggedTemplateExpression")}},$.parseExprAtom=function(e){var t,n=this.potentialArrowAt==this.start;switch(this.type){case b._super:this.inFunction||this.raise(this.start,"'super' outside of function or class");case b._this:var a=this.type===b._this?"ThisExpression":"Super";return t=this.startNode(),this.next(),this.finishNode(t,a);case b.name:var r=this.start,i=this.startLoc,o=this.parseIdent(this.type!==b.name);if(this.options.ecmaVersion>=8&&"async"===o.name&&!this.canInsertSemicolon()&&this.eat(b._function))return this.parseFunction(this.startNodeAt(r,i),!1,!1,!0);if(n&&!this.canInsertSemicolon()){if(this.eat(b.arrow))return this.parseArrowExpression(this.startNodeAt(r,i),[o],!1);if(this.options.ecmaVersion>=8&&"async"===o.name&&this.type===b.name)return o=this.parseIdent(),!this.canInsertSemicolon()&&this.eat(b.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(r,i),[o],!0)}return o;case b.regexp:var s=this.value;return(t=this.parseLiteral(s.value)).regex={pattern:s.pattern,flags:s.flags},t;case b.num:case b.string:return this.parseLiteral(this.value);case b._null:case b._true:case b._false:return(t=this.startNode()).value=this.type===b._null?null:this.type===b._true,t.raw=this.type.keyword,this.next(),this.finishNode(t,"Literal");case b.parenL:var l=this.start,c=this.parseParenAndDistinguishExpression(n);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(c)&&(e.parenthesizedAssign=l),e.parenthesizedBind<0&&(e.parenthesizedBind=l)),c;case b.bracketL:return t=this.startNode(),this.next(),t.elements=this.parseExprList(b.bracketR,!0,!0,e),this.finishNode(t,"ArrayExpression");case b.braceL:return this.parseObj(!1,e);case b._function:return t=this.startNode(),this.next(),this.parseFunction(t,!1);case b._class:return this.parseClass(this.startNode(),!1);case b._new:return this.parseNew();case b.backQuote:return this.parseTemplate();default:this.unexpected()}},$.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),this.next(),this.finishNode(t,"Literal")},$.parseParenExpression=function(){this.expect(b.parenL);var e=this.parseExpression();return this.expect(b.parenR),e},$.parseParenAndDistinguishExpression=function(e){var t,n=this.start,a=this.startLoc,r=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var i,o,s=this.start,l=this.startLoc,c=[],u=!0,p=!1,h=new F,m=this.yieldPos,d=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==b.parenR;){if(u?u=!1:this.expect(b.comma),r&&this.afterTrailingComma(b.parenR,!0)){p=!0;break}if(this.type===b.ellipsis){i=this.start,c.push(this.parseParenItem(this.parseRest())),this.type===b.comma&&this.raise(this.start,"Comma is not permitted after the rest element");break}this.type!==b.parenL||o||(o=this.start),c.push(this.parseMaybeAssign(!1,h,this.parseParenItem))}var g=this.start,_=this.startLoc;if(this.expect(b.parenR),e&&!this.canInsertSemicolon()&&this.eat(b.arrow))return this.checkPatternErrors(h,!1),this.checkYieldAwaitInDefaultParams(),o&&this.unexpected(o),this.yieldPos=m,this.awaitPos=d,this.parseParenArrowList(n,a,c);c.length&&!p||this.unexpected(this.lastTokStart),i&&this.unexpected(i),this.checkExpressionErrors(h,!0),this.yieldPos=m||this.yieldPos,this.awaitPos=d||this.awaitPos,c.length>1?((t=this.startNodeAt(s,l)).expressions=c,this.finishNodeAt(t,"SequenceExpression",g,_)):t=c[0]}else t=this.parseParenExpression();if(this.options.preserveParens){var f=this.startNodeAt(n,a);return f.expression=t,this.finishNode(f,"ParenthesizedExpression")}return t},$.parseParenItem=function(e){return e},$.parseParenArrowList=function(e,t,n){return this.parseArrowExpression(this.startNodeAt(e,t),n)};var Y=[];$.parseNew=function(){var e=this.startNode(),t=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(b.dot))return e.meta=t,e.property=this.parseIdent(!0),"target"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is new.target"),this.inFunction||this.raiseRecoverable(e.start,"new.target can only be used in functions"),this.finishNode(e,"MetaProperty");var n=this.start,a=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(),n,a,!0),this.eat(b.parenL)?e.arguments=this.parseExprList(b.parenR,this.options.ecmaVersion>=8,!1):e.arguments=Y,this.finishNode(e,"NewExpression")},$.parseTemplateElement=function(){var e=this.startNode();return e.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),e.tail=this.type===b.backQuote,this.finishNode(e,"TemplateElement")},$.parseTemplate=function(){var e=this.startNode();this.next(),e.expressions=[];var t=this.parseTemplateElement();for(e.quasis=[t];!t.tail;)this.expect(b.dollarBraceL),e.expressions.push(this.parseExpression()),this.expect(b.braceR),e.quasis.push(t=this.parseTemplateElement());return this.next(),this.finishNode(e,"TemplateLiteral")},$.parseObj=function(e,t){var n=this.startNode(),a=!0,r={};for(n.properties=[],this.next();!this.eat(b.braceR);){if(a)a=!1;else if(this.expect(b.comma),this.afterTrailingComma(b.braceR))break;var i,o,s,l,c=this.startNode();this.options.ecmaVersion>=6&&(c.method=!1,c.shorthand=!1,(e||t)&&(s=this.start,l=this.startLoc),e||(i=this.eat(b.star))),this.parsePropertyName(c),e||!(this.options.ecmaVersion>=8)||i||c.computed||"Identifier"!==c.key.type||"async"!==c.key.name||this.type===b.parenL||this.type===b.colon||this.canInsertSemicolon()?o=!1:(o=!0,this.parsePropertyName(c,t)),this.parsePropertyValue(c,e,i,o,s,l,t),this.checkPropClash(c,r),n.properties.push(this.finishNode(c,"Property"))}return this.finishNode(n,e?"ObjectPattern":"ObjectExpression")},$.parsePropertyValue=function(e,t,n,a,r,i,o){if((n||a)&&this.type===b.colon&&this.unexpected(),this.eat(b.colon))e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,o),e.kind="init";else if(this.options.ecmaVersion>=6&&this.type===b.parenL)t&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(n,a);else if(this.options.ecmaVersion>=5&&!e.computed&&"Identifier"===e.key.type&&("get"===e.key.name||"set"===e.key.name)&&this.type!=b.comma&&this.type!=b.braceR){(n||a||t)&&this.unexpected(),e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var s="get"===e.kind?0:1;if(e.value.params.length!==s){var l=e.value.start;"get"===e.kind?this.raiseRecoverable(l,"getter should have no params"):this.raiseRecoverable(l,"setter should have exactly one param")}else"set"===e.kind&&"RestElement"===e.value.params[0].type&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")}else this.options.ecmaVersion>=6&&!e.computed&&"Identifier"===e.key.type?((this.keywords.test(e.key.name)||(this.strict?this.reservedWordsStrict:this.reservedWords).test(e.key.name)||this.inGenerator&&"yield"==e.key.name||this.inAsync&&"await"==e.key.name)&&this.raiseRecoverable(e.key.start,"'"+e.key.name+"' can not be used as shorthand property"),e.kind="init",t?e.value=this.parseMaybeDefault(r,i,e.key):this.type===b.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(r,i,e.key)):e.value=e.key,e.shorthand=!0):this.unexpected()},$.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(b.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(b.bracketR),e.key;e.computed=!1}return e.key=this.type===b.num||this.type===b.string?this.parseExprAtom():this.parseIdent(!0)},$.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=!1,e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},$.parseMethod=function(e,t){var n=this.startNode(),a=this.inGenerator,r=this.inAsync,i=this.yieldPos,o=this.awaitPos,s=this.inFunction;return this.initFunction(n),this.options.ecmaVersion>=6&&(n.generator=e),this.options.ecmaVersion>=8&&(n.async=!!t),this.inGenerator=n.generator,this.inAsync=n.async,this.yieldPos=0,this.awaitPos=0,this.inFunction=!0,this.enterFunctionScope(),this.expect(b.parenL),n.params=this.parseBindingList(b.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(n,!1),this.inGenerator=a,this.inAsync=r,this.yieldPos=i,this.awaitPos=o,this.inFunction=s,this.finishNode(n,"FunctionExpression")},$.parseArrowExpression=function(e,t,n){var a=this.inGenerator,r=this.inAsync,i=this.yieldPos,o=this.awaitPos,s=this.inFunction;return this.enterFunctionScope(),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!n),this.inGenerator=!1,this.inAsync=e.async,this.yieldPos=0,this.awaitPos=0,this.inFunction=!0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0),this.inGenerator=a,this.inAsync=r,this.yieldPos=i,this.awaitPos=o,this.inFunction=s,this.finishNode(e,"ArrowFunctionExpression")},$.parseFunctionBody=function(e,t){var n=t&&this.type!==b.braceL,a=this.strict,r=!1;if(n)e.body=this.parseMaybeAssign(),e.expression=!0,this.checkParams(e,!1);else{var i=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);a&&!i||(r=this.strictDirective(this.end))&&i&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list");var o=this.labels;this.labels=[],r&&(this.strict=!0),this.checkParams(e,!a&&!r&&!t&&this.isSimpleParamList(e.params)),e.body=this.parseBlock(!1),e.expression=!1,this.labels=o}this.exitFunctionScope(),this.strict&&e.id&&this.checkLVal(e.id,"none"),this.strict=a},$.isSimpleParamList=function(e){for(var t=0;t=6||-1==this.input.slice(this.start,this.end).indexOf("\\"))&&this.raiseRecoverable(this.start,"The keyword '"+this.value+"' is reserved"),this.inGenerator&&"yield"===this.value&&this.raiseRecoverable(this.start,"Can not use 'yield' as identifier inside a generator"),this.inAsync&&"await"===this.value&&this.raiseRecoverable(this.start,"Can not use 'await' as identifier inside an async function"),t.name=this.value):e&&this.type.keyword?t.name=this.type.keyword:this.unexpected(),this.next(),this.finishNode(t,"Identifier")},$.parseYield=function(){this.yieldPos||(this.yieldPos=this.start);var e=this.startNode();return this.next(),this.type==b.semi||this.canInsertSemicolon()||this.type!=b.star&&!this.type.startsExpr?(e.delegate=!1,e.argument=null):(e.delegate=this.eat(b.star),e.argument=this.parseMaybeAssign()),this.finishNode(e,"YieldExpression")},$.parseAwait=function(){this.awaitPos||(this.awaitPos=this.start);var e=this.startNode();return this.next(),e.argument=this.parseMaybeUnary(null,!0),this.finishNode(e,"AwaitExpression")};var z=B.prototype;z.raise=function(e,t){var n=R(this.input,e);t+=" ("+n.line+":"+n.column+")";var a=new SyntaxError(t);throw a.pos=e,a.loc=n,a.raisedAt=this.pos,a},z.raiseRecoverable=z.raise,z.curPosition=function(){if(this.options.locations)return new w(this.curLine,this.pos-this.lineStart)};var V=B.prototype,J=Object.assign||function(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];for(var a=0;a=0;e--)if(this.context[e].generator)return!0;return!1},ne.updateContext=function(e){var t,n=this.type;n.keyword&&e==b.dot?this.exprAllowed=!1:(t=n.updateContext)?t.call(this,e):this.exprAllowed=n.beforeExpr},b.parenR.updateContext=b.braceR.updateContext=function(){if(1!=this.context.length){var e,t=this.context.pop();t===te.b_stat&&(e=this.curContext())&&"function"===e.token?(this.context.pop(),this.exprAllowed=!1):this.exprAllowed=t===te.b_tmpl||!t.isExpr}else this.exprAllowed=!0},b.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?te.b_stat:te.b_expr),this.exprAllowed=!0},b.dollarBraceL.updateContext=function(){this.context.push(te.b_tmpl),this.exprAllowed=!0},b.parenL.updateContext=function(e){var t=e===b._if||e===b._for||e===b._with||e===b._while;this.context.push(t?te.p_stat:te.p_expr),this.exprAllowed=!0},b.incDec.updateContext=function(){},b._function.updateContext=function(e){e.beforeExpr&&e!==b.semi&&e!==b._else&&(e!==b.colon&&e!==b.braceL||this.curContext()!==te.b_stat)&&this.context.push(te.f_expr),this.exprAllowed=!1},b.backQuote.updateContext=function(){this.curContext()===te.q_tmpl?this.context.pop():this.context.push(te.q_tmpl),this.exprAllowed=!1},b.star.updateContext=function(e){e==b._function&&(this.curContext()===te.f_expr?this.context[this.context.length-1]=te.f_expr_gen:this.context.push(te.f_gen)),this.exprAllowed=!0},b.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&("of"==this.value&&!this.exprAllowed||"yield"==this.value&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var ae=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new x(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},re=B.prototype,ie="object"==typeof Packages&&"[object JavaPackage]"==Object.prototype.toString.call(Packages);function oe(e,t,n,a){try{return new RegExp(e,t)}catch(e){if(void 0!==n)throw e instanceof SyntaxError&&a.raise(n,"Error parsing regular expression: "+e.message),e}}re.next=function(){this.options.onToken&&this.options.onToken(new ae(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},re.getToken=function(){return this.next(),new ae(this)},"undefined"!=typeof Symbol&&(re[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===b.eof,value:t}}}}),re.curContext=function(){return this.context[this.context.length-1]},re.nextToken=function(){var e=this.curContext();return e&&e.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length?this.finishToken(b.eof):e.override?e.override(this):void this.readToken(this.fullCharCodeAtPos())},re.readToken=function(e){return p(e,this.options.ecmaVersion>=6)||92===e?this.readWord():this.getTokenFromCode(e)},re.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=57344)return e;var t=this.input.charCodeAt(this.pos+1);return(e<<10)+t-56613888},re.skipBlockComment=function(){var e,t=this.options.onComment&&this.curPosition(),n=this.pos,a=this.input.indexOf("*/",this.pos+=2);if(-1===a&&this.raise(this.pos-2,"Unterminated comment"),this.pos=a+2,this.options.locations)for(E.lastIndex=n;(e=E.exec(this.input))&&e.index8&&e<14||e>=5760&&C.test(String.fromCharCode(e))))break e;++this.pos}}},re.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var n=this.type;this.type=e,this.value=t,this.updateContext(n)},re.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===e&&46===t?(this.pos+=3,this.finishToken(b.ellipsis)):(++this.pos,this.finishToken(b.dot))},re.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===e?this.finishOp(b.assign,2):this.finishOp(b.slash,1)},re.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),n=1,a=42===e?b.star:b.modulo;return this.options.ecmaVersion>=7&&42===t&&(++n,a=b.starstar,t=this.input.charCodeAt(this.pos+2)),61===t?this.finishOp(b.assign,n+1):this.finishOp(a,n)},re.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.finishOp(124===e?b.logicalOR:b.logicalAND,2):61===t?this.finishOp(b.assign,2):this.finishOp(124===e?b.bitwiseOR:b.bitwiseAND,1)},re.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);return 61===e?this.finishOp(b.assign,2):this.finishOp(b.bitwiseXOR,1)},re.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?45==t&&62==this.input.charCodeAt(this.pos+2)&&v.test(this.input.slice(this.lastTokEnd,this.pos))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(b.incDec,2):61===t?this.finishOp(b.assign,2):this.finishOp(b.plusMin,1)},re.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),n=1;return t===e?(n=62===e&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+n)?this.finishOp(b.assign,n+1):this.finishOp(b.bitShift,n)):33==t&&60==e&&45==this.input.charCodeAt(this.pos+2)&&45==this.input.charCodeAt(this.pos+3)?(this.inModule&&this.unexpected(),this.skipLineComment(4),this.skipSpace(),this.nextToken()):(61===t&&(n=2),this.finishOp(b.relational,n))},re.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return 61===t?this.finishOp(b.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===e&&62===t&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(b.arrow)):this.finishOp(61===e?b.eq:b.prefix,1)},re.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(b.parenL);case 41:return++this.pos,this.finishToken(b.parenR);case 59:return++this.pos,this.finishToken(b.semi);case 44:return++this.pos,this.finishToken(b.comma);case 91:return++this.pos,this.finishToken(b.bracketL);case 93:return++this.pos,this.finishToken(b.bracketR);case 123:return++this.pos,this.finishToken(b.braceL);case 125:return++this.pos,this.finishToken(b.braceR);case 58:return++this.pos,this.finishToken(b.colon);case 63:return++this.pos,this.finishToken(b.question);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(b.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(120===t||88===t)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(111===t||79===t)return this.readRadixNumber(8);if(98===t||66===t)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 126:return this.finishOp(b.prefix,1)}this.raise(this.pos,"Unexpected character '"+le(e)+"'")},re.finishOp=function(e,t){var n=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,n)};var se=!!oe("￿","u");function le(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}re.readRegexp=function(){for(var e,t,n=this,a=this.pos;;){n.pos>=n.input.length&&n.raise(a,"Unterminated regular expression");var r=n.input.charAt(n.pos);if(v.test(r)&&n.raise(a,"Unterminated regular expression"),e)e=!1;else{if("["===r)t=!0;else if("]"===r&&t)t=!1;else if("/"===r&&!t)break;e="\\"===r}++n.pos}var i=this.input.slice(a,this.pos);++this.pos;var o=this.readWord1(),s=i,l="";if(o){var c=/^[gim]*$/;this.options.ecmaVersion>=6&&(c=/^[gimuy]*$/),c.test(o)||this.raise(a,"Invalid regular expression flag"),o.indexOf("u")>=0&&(se?l="u":(s=(s=s.replace(/\\u\{([0-9a-fA-F]+)\}/g,function(e,t,r){return(t=Number("0x"+t))>1114111&&n.raise(a+r+3,"Code point out of bounds"),"x"})).replace(/\\u([a-fA-F0-9]{4})|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"),l=l.replace("u","")))}var u=null;return ie||(oe(s,l,a,this),u=oe(i,o)),this.finishToken(b.regexp,{pattern:i,flags:o,value:u})},re.readInt=function(e,t){for(var n=this.pos,a=0,r=0,i=null==t?1/0:t;r=97?s-97+10:s>=65?s-65+10:s>=48&&s<=57?s-48:1/0)>=e)break;++this.pos,a=a*e+o}return this.pos===n||null!=t&&this.pos-n!==t?null:a},re.readRadixNumber=function(e){this.pos+=2;var t=this.readInt(e);return null==t&&this.raise(this.start+2,"Expected number in radix "+e),p(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(b.num,t)},re.readNumber=function(e){var t=this.pos,n=!1,a=48===this.input.charCodeAt(this.pos);e||null!==this.readInt(10)||this.raise(t,"Invalid number"),a&&this.pos==t+1&&(a=!1);var r=this.input.charCodeAt(this.pos);46!==r||a||(++this.pos,this.readInt(10),n=!0,r=this.input.charCodeAt(this.pos)),69!==r&&101!==r||a||(43!==(r=this.input.charCodeAt(++this.pos))&&45!==r||++this.pos,null===this.readInt(10)&&this.raise(t,"Invalid number"),n=!0),p(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var i,o=this.input.slice(t,this.pos);return n?i=parseFloat(o):a&&1!==o.length?/[89]/.test(o)||this.strict?this.raise(t,"Invalid number"):i=parseInt(o,8):i=parseInt(o,10),this.finishToken(b.num,i)},re.readCodePoint=function(){var e,t=this.input.charCodeAt(this.pos);if(123===t){this.options.ecmaVersion<6&&this.unexpected();var n=++this.pos;e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111&&this.raise(n,"Code point out of bounds")}else e=this.readHexChar(4);return e},re.readString=function(e){for(var t="",n=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var a=this.input.charCodeAt(this.pos);if(a===e)break;92===a?(t+=this.input.slice(n,this.pos),t+=this.readEscapedChar(!1),n=this.pos):(k(a)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(n,this.pos++),this.finishToken(b.string,t)},re.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var n=this.input.charCodeAt(this.pos);if(96===n||36===n&&123===this.input.charCodeAt(this.pos+1))return this.pos===this.start&&this.type===b.template?36===n?(this.pos+=2,this.finishToken(b.dollarBraceL)):(++this.pos,this.finishToken(b.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(b.template,e));if(92===n)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(k(n)){switch(e+=this.input.slice(t,this.pos),++this.pos,n){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(n)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},re.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return le(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";default:if(t>=48&&t<=55){var n=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],a=parseInt(n,8);return a>255&&(n=n.slice(0,-1),a=parseInt(n,8)),"0"!==n&&(this.strict||e)&&this.raise(this.pos-2,"Octal literal in strict mode"),this.pos+=n.length-1,String.fromCharCode(a)}return String.fromCharCode(t)}},re.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return null===n&&this.raise(t,"Bad character escape sequence"),n},re.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,n=this.pos,a=this.options.ecmaVersion>=6;this.posd()?1/0:t*r.CONSTANTS.BaseCostFor1GBOfRamServer*a.BitNodeMultipliers.PurchasedServerCost}function m(){return Math.round(r.CONSTANTS.PurchasedServerLimit*a.BitNodeMultipliers.PurchasedServerLimit)}function d(){const e=Math.round(r.CONSTANTS.PurchasedServerMaxRam*a.BitNodeMultipliers.PurchasedServerMaxRam);return 1<<31-Math.clz32(e)}function g(e){const t=h(e);if(i.a.money.lt(t))Object(l.dialogBoxCreate)("You don't have enough money to purchase this server!");else if(i.a.purchasedServers.length>=m())Object(l.dialogBoxCreate)("You have reached the maximum limit of "+m()+" servers. You cannot purchase any more. You can delete some of your purchased servers using the deleteServer() Netscript function in a script");else{var n=Object(u.yesNoTxtInpBoxGetInput)();if(""!=n){var a=new s.Server({ip:Object(c.createRandomIp)(),hostname:n,organizationName:"",isConnectedTo:!1,adminRights:!0,purchasedByPlayer:!0,maxRam:e});Object(o.AddToAllServers)(a),i.a.purchasedServers.push(a.ip);var r=i.a.getHomeComputer();r.serversOnNetwork.push(a.ip),a.serversOnNetwork.push(r.ip),i.a.loseMoney(t),Object(l.dialogBoxCreate)("Server successfully purchased with hostname "+n)}else Object(l.dialogBoxCreate)("You must enter a hostname for your new server!")}}function _(e){if(i.a.money.lt(e))return void Object(l.dialogBoxCreate)("You do not have enough money to purchase additional RAM for your home computer");const t=i.a.getHomeComputer();t.maxRam>=r.CONSTANTS.HomeComputerMaxRam?Object(l.dialogBoxCreate)("You cannot upgrade your home computer RAM because it is at its maximum possible value"):(t.maxRam*=2,i.a.loseMoney(e),Object(l.dialogBoxCreate)("Purchased additional RAM for home computer! It now has "+t.maxRam+"GB of RAM."))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setTimeoutRef=window.setTimeout.bind(window)},function(e,t,n){"use strict";n.d(t,"a",function(){return f}),n.d(t,"b",function(){return g}),n.d(t,"e",function(){return d}),n.d(t,"d",function(){return y}),n.d(t,"c",function(){return v});var a=n(57),r=(n(16),n(13)),i=n(5),o=n(31),s=n(73),l=n(0),c=n(79),u=n(22),p=n(19),h=n(9);function m(e,t=!1){e.recvd=!0,!t&&p.Settings.SuppressMessages||d(e),function(e,t){var n=Object(u.GetServerByHostname)(t);if(null==n)return void console.log("WARNING: Did not locate "+t);for(var a=0;a

This message was saved as "+e.filename+" onto your home computer.";Object(h.dialogBoxCreate)(t)}function g(){var e=f[b.Jumper0],t=f[b.Jumper1],n=f[b.Jumper2],a=f[b.Jumper3],u=f[b.Jumper4],p=f[b.CyberSecTest],d=f[b.NiteSecTest],g=f[b.BitRunnersTest],_=f[b.RedPill],y=!1;r.Augmentations[i.AugmentationNames.TheRedPill].owned&&(y=!0),_&&y&&0===l.a.sourceFiles.length&&!c.b&&!s.c?h.dialogBoxOpened||m(_,!0):_&&y?c.b||s.c||h.dialogBoxOpened||m(_):e&&!e.recvd&&l.a.hacking_skill>=25?(m(e),l.a.getHomeComputer().programs.push(o.Programs.Flight.name)):t&&!t.recvd&&l.a.hacking_skill>=40?m(t):p&&!p.recvd&&l.a.hacking_skill>=50?m(p):n&&!n.recvd&&l.a.hacking_skill>=175?m(n):d&&!d.recvd&&l.a.hacking_skill>=200?m(d):a&&!a.recvd&&l.a.hacking_skill>=350?m(a):u&&!u.recvd&&l.a.hacking_skill>=490?m(u):g&&!g.recvd&&l.a.hacking_skill>=500&&m(g)}function _(e){f[e.filename]=e}let f={};function y(e){f=JSON.parse(e,Reviver)}let b={Jumper0:"j0.msg",Jumper1:"j1.msg",Jumper2:"j2.msg",Jumper3:"j3.msg",Jumper4:"j4.msg",CyberSecTest:"csec-test.msg",NiteSecTest:"nitesec-test.msg",BitRunnersTest:"19dfj3l1nd.msg",RedPill:"icarus.msg"};function v(){f={},_(new a.Message(b.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")),_(new a.Message(b.Jumper1,"Soon you will be contacted by a hacking group known as CyberSec. 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")),_(new a.Message(b.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 NiteSec.

-jump3R")),_(new a.Message(b.Jumper3,"You must learn to walk before you can run. And you must run before you can fly. Look for the black hand.

I.I.I.I

-jump3R")),_(new a.Message(b.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")),_(new a.Message(b.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 hack our server using the Terminal.

-CyberSec")),_(new a.Message(b.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 hack our hidden server using the Terminal. Then, we will contact you again.

-NiteSec")),_(new a.Message(b.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")),_(new a.Message(b.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(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return O}),n.d(t,"d",function(){return T}),n.d(t,"c",function(){return S}),n.d(t,"b",function(){return M});var a=n(189),r=n(188),i=n(11),o=n(70),s=n(14),l=n(56),c=n(3),u=n(9),p=n(18),h=n(30),m=n(103),d=n(4),g=n(38),_=n(12),f=n(7),y=n(45),b=n(15),v=n(34),E=n(76),k=n(26);e(document).keydown(function(e){if(_.routing.isOn(_.Page.Gang)&&e.altKey){if(null!=N.gangMemberFilter&&N.gangMemberFilter===document.activeElement)return;e.keyCode===h.KEY[1]?"block"===N.gangTerritorySubpage.style.display&&N.managementButton.click():e.keyCode===h.KEY[2]&&"block"===N.gangManagementSubpage.style.display&&N.territoryButton.click()}}),e(document).mousedown(function(t){N.gangMemberUpgradeBoxOpened&&null==e(t.target).closest("#gang-member-upgrade-popup-box-content").get(0)&&(Object(E.removeElement)(N.gangMemberUpgradeBox),N.gangMemberUpgradeBox=null,N.gangMemberUpgradeBoxContent=null,N.gangMemberUpgradeBoxOpened=!1,N.gangMemberUpgradeBoxElements=null)});let C=["Slum Snakes","Tetrads","The Syndicate","The Dark Army","Speakers for the Dead","NiteSec","The Black Hand"],O={"Slum Snakes":{power:1,territory:1/7},Tetrads:{power:1,territory:1/7},"The Syndicate":{power:1,territory:1/7},"The Dark Army":{power:1,territory:1/7},"Speakers for the Dead":{power:1,territory:1/7},NiteSec:{power:1,territory:1/7},"The Black Hand":{power:1,territory:1/7}};function T(){O={"Slum Snakes":{power:1,territory:1/7},Tetrads:{power:1,territory:1/7},"The Syndicate":{power:1,territory:1/7},"The Dark Army":{power:1,territory:1/7},"Speakers for the Dead":{power:1,territory:1/7},NiteSec:{power:1,territory:1/7},"The Black Hand":{power:1,territory:1/7}}}function S(e){O=JSON.parse(e,p.Reviver)}function M(e,t=!1){this.facName=e,this.members=[],this.wanted=1,this.respect=1,this.isHackingGang=t,this.respectGainRate=0,this.wantedGainRate=0,this.moneyGainRate=0,this.storedCycles=0,this.storedTerritoryAndPowerCycles=0,this.territoryClashChance=0,this.territoryWarfareEngaged=!1,this.notifyMemberDeath=!0}function P(e){this.name=e,this.task="Unassigned",this.earnedRespect=0,this.hack=1,this.str=1,this.def=1,this.dex=1,this.agi=1,this.cha=1,this.hack_exp=0,this.str_exp=0,this.def_exp=0,this.dex_exp=0,this.agi_exp=0,this.cha_exp=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,this.hack_asc_mult=1,this.str_asc_mult=1,this.def_asc_mult=1,this.dex_asc_mult=1,this.agi_asc_mult=1,this.cha_asc_mult=1,this.upgrades=[],this.augmentations=[]}function A(e="",t="",n=!1,a=!1,r={baseRespect:0,baseWanted:0,baseMoney:0,hackWeight:0,strWeight:0,defWeight:0,dexWeight:0,agiWeight:0,chaWeight:0,difficulty:0}){this.name=e,this.desc=t,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}}M.prototype.getPower=function(){return O[this.facName].power},M.prototype.getTerritory=function(){return O[this.facName].territory},M.prototype.process=function(e=1,t){const n=1e3/i.Engine._idleSpeed;if(isNaN(e)&&console.error(`NaN passed into Gang.process(): ${e}`),this.storedCycles+=e,this.storedCycles<2*n)return;const a=Math.min(this.storedCycles,5*n);try{this.processGains(a,t),this.processExperienceGains(a),this.processTerritoryAndPowerGains(a),this.storedCycles-=a}catch(e){Object(y.exceptionAlert)(`Exception caught when processing Gang: ${e}`)}},M.prototype.processGains=function(e=1,t){for(var n=0,a=0,r=0,i=0;it&&(n=1),this.wanted=n,this.wanted<1&&(this.wanted=1)}else console.warn("ERROR: wantedLevelGains is NaN");"number"==typeof n?(t.gainMoney(n*e),t.recordMoneySource(n*e,"gang")):console.warn("ERROR: respectGains is NaN")},M.prototype.processTerritoryAndPowerGains=function(e=1){if(this.storedTerritoryAndPowerCycles+=e,!(this.storedTerritoryAndPowerCycles<100)){this.storedTerritoryAndPowerCycles-=100;var t=this.facName;for(const e in O)if(O.hasOwnProperty(e))if(e==t)O[e].power+=this.calculatePower();else{const t=Math.random();if(t<.5){const t=.005*O[e].power;O[e].power+=Math.min(.85,t)}else{const n=.75*t*O[e].territory;O[e].power+=n}}this.territoryWarfareEngaged?this.territoryClashChance=1:this.territoryClashChance>0&&(this.territoryClashChance=Math.max(0,this.territoryClashChance-.01));for(var n=0;ne!==n),a=Object(b.getRandomInt)(0,e.length-1),r=C[n],i=e[a];if(!(r!==t&&i!==t||Math.random()=30)&&this.respect>=this.getRespectNeededToRecruitMember()},M.prototype.getRespectNeededToRecruitMember=function(){if(this.members.length<3)return 0;const e=this.members.length-2;return Math.round(.9*Math.pow(e,3)+Math.pow(e,2))},M.prototype.recruitMember=function(e){if(""===(e=String(e))||!this.canRecruitMember())return!1;if(this.members.filter(t=>t.name===e).length>=1)return!1;let t=new P(e);return this.members.push(t),_.routing.isOn(_.Page.Gang)&&(this.createGangMemberDisplayElement(t),this.updateGangContent()),!0},M.prototype.getWantedPenalty=function(){return this.respect/(this.respect+this.wanted)},M.prototype.processExperienceGains=function(e=1){for(var t=0;t=0;--e){const n=this.members[e];if("Territory Warfare"!==n.task)continue;const a=t/Math.pow(n.def,.6);Math.random()")):t.log(`Ascended Gang member ${e.name}`),_.routing.isOn(_.Page.Gang)&&this.displayGangMemberList(),n}catch(e){if(null!=t)throw e;Object(y.exceptionAlert)(e)}},M.prototype.getDiscount=function(){const e=this.getPower(),t=this.respect,n=Math.pow(t,.01)+t/5e6+Math.pow(e,.01)+e/1e6-1;return Math.max(1,n)},M.prototype.getAllTaskNames=function(){let e=[];const t=Object.keys(w);return e=this.isHackingGang?t.filter(e=>{let t=w[e];return null!=t&&("Unassigned"!==e&&t.isHacking)}):t.filter(e=>{let t=w[e];return null!=t&&("Unassigned"!==e&&t.isCombat)})},M.prototype.getAllUpgradeNames=function(){return Object.keys(R)},M.prototype.getUpgradeCost=function(e){return null==R[e]?1/0:R[e].getCost(this)},M.prototype.getUpgradeType=function(e){const t=R[e];if(null==t)return"";switch(t.type){case"w":return"Weapon";case"a":return"Armor";case"v":return"Vehicle";case"r":return"Rootkit";case"g":return"Augmentation";default:return""}},M.prototype.toJSON=function(){return Object(p.Generic_toJSON)("Gang",this)},M.fromJSON=function(e){return Object(p.Generic_fromJSON)(M,e.data)},p.Reviver.constructors.Gang=M,P.prototype.calculateSkill=function(e,t=1){return Math.max(Math.floor(t*(32*Math.log(e+534.5)-200)),1)},P.prototype.updateSkillLevels=function(){this.hack=this.calculateSkill(this.hack_exp,this.hack_mult*this.hack_asc_mult),this.str=this.calculateSkill(this.str_exp,this.str_mult*this.str_asc_mult),this.def=this.calculateSkill(this.def_exp,this.def_mult*this.def_asc_mult),this.dex=this.calculateSkill(this.dex_exp,this.dex_mult*this.dex_asc_mult),this.agi=this.calculateSkill(this.agi_exp,this.agi_mult*this.agi_asc_mult),this.cha=this.calculateSkill(this.cha_exp,this.cha_mult*this.cha_asc_mult)},P.prototype.calculatePower=function(){return(this.hack+this.str+this.def+this.dex+this.agi+this.cha)/95},P.prototype.assignToTask=function(e){return w.hasOwnProperty(e)?(this.task=e,!0):(this.task="Unassigned",!1)},P.prototype.unassignFromTask=function(){this.task="Unassigned"},P.prototype.getTask=function(){return this.task instanceof A&&(this.task=this.task.name),w.hasOwnProperty(this.task)?w[this.task]:w.Unassigned},P.prototype.calculateRespectGain=function(e){const t=this.getTask();if(null==t||!(t instanceof A)||0===t.baseRespect)return 0;var n=t.hackWeight/100*this.hack+t.strWeight/100*this.str+t.defWeight/100*this.def+t.dexWeight/100*this.dex+t.agiWeight/100*this.agi+t.chaWeight/100*this.cha;if((n-=4*t.difficulty)<=0)return 0;const a=Math.pow(100*O[e.facName].territory,t.territory.respect)/100;if(isNaN(a)||a<=0)return 0;var r=e.getWantedPenalty();return 11*t.baseRespect*n*a*r},P.prototype.calculateWantedLevelGain=function(e){const t=this.getTask();if(null==t||!(t instanceof A)||0===t.baseWanted)return 0;var n=t.hackWeight/100*this.hack+t.strWeight/100*this.str+t.defWeight/100*this.def+t.dexWeight/100*this.dex+t.agiWeight/100*this.agi+t.chaWeight/100*this.cha;if((n-=3.5*t.difficulty)<=0)return 0;const a=Math.pow(100*O[e.facName].territory,t.territory.wanted)/100;return isNaN(a)||a<=0?0:t.baseWanted<0?.5*t.baseWanted*n*a:7*t.baseWanted/Math.pow(3*n*a,.8)},P.prototype.calculateMoneyGain=function(e){const t=this.getTask();if(null==t||!(t instanceof A)||0===t.baseMoney)return 0;var n=t.hackWeight/100*this.hack+t.strWeight/100*this.str+t.defWeight/100*this.def+t.dexWeight/100*this.dex+t.agiWeight/100*this.agi+t.chaWeight/100*this.cha;if((n-=3.2*t.difficulty)<=0)return 0;const a=Math.pow(100*O[e.facName].territory,t.territory.money)/100;if(isNaN(a)||a<=0)return 0;var r=e.getWantedPenalty();return 5*t.baseMoney*n*a*r},P.prototype.gainExperience=function(e=1){const t=this.getTask();if(null==t||!(t instanceof A)||t===w.Unassigned)return;const n=Math.pow(t.difficulty,.9)*e;this.hack_exp+=t.hackWeight/1500*n,this.str_exp+=t.strWeight/1500*n,this.def_exp+=t.defWeight/1500*n,this.dex_exp+=t.dexWeight/1500*n,this.agi_exp+=t.agiWeight/1500*n,this.cha_exp+=t.chaWeight/1500*n},P.prototype.recordEarnedRespect=function(e=1,t){this.earnedRespect+=this.calculateRespectGain(t)*e},P.prototype.ascend=function(){const e=this.getAscensionResults(),t=e.hack,n=e.str,a=e.def,r=e.dex,i=e.agi,o=e.cha;this.hack_asc_mult+=t,this.str_asc_mult+=n,this.def_asc_mult+=a,this.dex_asc_mult+=r,this.agi_asc_mult+=i,this.cha_asc_mult+=o,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 e=0;e{!function(e,t,n,a,r){w[e]=new A(e,t,n,a,r)}(e.name,e.desc,e.isHacking,e.isCombat,e.params)}),x.prototype.getCost=function(e){const t=e.getDiscount();return this.cost/t},x.prototype.createDescription=function(){const e=["Increases:"];null!=this.mults.str&&e.push(`* Strength by ${Math.round(100*(this.mults.str-1))}%`),null!=this.mults.def&&e.push(`* Defense by ${Math.round(100*(this.mults.def-1))}%`),null!=this.mults.dex&&e.push(`* Dexterity by ${Math.round(100*(this.mults.dex-1))}%`),null!=this.mults.agi&&e.push(`* Agility by ${Math.round(100*(this.mults.agi-1))}%`),null!=this.mults.cha&&e.push(`* Charisma by ${Math.round(100*(this.mults.cha-1))}%`),null!=this.mults.hack&&e.push(`* Hacking by ${Math.round(100*(this.mults.hack-1))}%`),this.desc=e.join("
")},x.prototype.apply=function(e){null!=this.mults.str&&(e.str_mult*=this.mults.str),null!=this.mults.def&&(e.def_mult*=this.mults.def),null!=this.mults.dex&&(e.dex_mult*=this.mults.dex),null!=this.mults.agi&&(e.agi_mult*=this.mults.agi),null!=this.mults.cha&&(e.cha_mult*=this.mults.cha),null!=this.mults.hack&&(e.hack_mult*=this.mults.hack)},x.prototype.toJSON=function(){return Object(p.Generic_toJSON)("GangMemberUpgrade",this)},x.fromJSON=function(e){return Object(p.Generic_fromJSON)(x,e.data)},p.Reviver.constructors.GangMemberUpgrade=x;const R={};r.gangMemberUpgradesMetadata.forEach(e=>{!function(e,t,n,a){R[e]=new x(e,t,n,a)}(e.name,e.cost,e.upgType,e.mults)}),M.prototype.createGangMemberUpgradeBox=function(e,t=""){const n="gang-member-upgrade-popup-box";if(N.gangMemberUpgradeBoxOpened){if(null==N.gangMemberUpgradeBoxElements||null==N.gangMemberUpgradeBox||null==N.gangMemberUpgradeBoxContent)return void console.error("Refreshing Gang member upgrade box throws error because required elements are null");for(var a=2;a-1||this.members[a].task.indexOf(r)>-1){var i=this.members[a].createGangMemberUpgradePanel(this,e);N.gangMemberUpgradeBoxContent.appendChild(i),N.gangMemberUpgradeBoxElements.push(i)}}else{N.gangMemberUpgradeBoxFilter=Object(d.createElement)("input",{type:"text",placeholder:"Filter gang members",value:t,onkeyup:()=>{var t=N.gangMemberUpgradeBoxFilter.value.toString();this.createGangMemberUpgradeBox(e,t)}}),N.gangMemberUpgradeBoxDiscount=Object(d.createElement)("p",{innerText:"Discount: -"+c.numeralWrapper.format(1-1/this.getDiscount(),"0.00%"),marginLeft:"6px",tooltip:"You get a discount on equipment and upgrades based on your gang's respect and power. More respect and power leads to more discounts."}),N.gangMemberUpgradeBoxElements=[N.gangMemberUpgradeBoxFilter,N.gangMemberUpgradeBoxDiscount];for(r=N.gangMemberUpgradeBoxFilter.value.toString(),a=0;a-1||this.members[a].task.indexOf(r)>-1)&&N.gangMemberUpgradeBoxElements.push(this.members[a].createGangMemberUpgradePanel(this,e));N.gangMemberUpgradeBox=Object(g.createPopup)(n,N.gangMemberUpgradeBoxElements),N.gangMemberUpgradeBoxContent=document.getElementById(n+"-content"),N.gangMemberUpgradeBoxOpened=!0}},P.prototype.createGangMemberUpgradePanel=function(e,t){var n=Object(d.createElement)("div",{border:"1px solid white"}),a=Object(d.createElement)("h1",{innerText:this.name+" ("+this.task+")"});n.appendChild(a);var r=Object(d.createElement)("pre",{fontSize:"14px",display:"inline-block",width:"20%",innerText:"Hack: "+this.hack+" (x"+Object(f.formatNumber)(this.hack_mult*this.hack_asc_mult,2)+")\nStr: "+this.str+" (x"+Object(f.formatNumber)(this.str_mult*this.str_asc_mult,2)+")\nDef: "+this.def+" (x"+Object(f.formatNumber)(this.def_mult*this.def_asc_mult,2)+")\nDex: "+this.dex+" (x"+Object(f.formatNumber)(this.dex_mult*this.dex_asc_mult,2)+")\nAgi: "+this.agi+" (x"+Object(f.formatNumber)(this.agi_mult*this.agi_asc_mult,2)+")\nCha: "+this.cha+" (x"+Object(f.formatNumber)(this.cha_mult*this.cha_asc_mult,2)+")\n"});const i=[];function o(e){const t=R[e];null!=t?i.push(Object(d.createElement)("div",{class:"gang-owned-upgrade",innerText:e,tooltip:t.desc})):console.error(`Could not find GangMemberUpgrade object for name ${e}`)}for(const e of this.upgrades)o(e);for(const e of this.augmentations)o(e);var s=Object(d.createElement)("div",{class:"gang-owned-upgrades-div",innerText:"Purchased Upgrades:"});for(const e of i)s.appendChild(e);n.appendChild(r),n.appendChild(s),n.appendChild(Object(d.createElement)("br",{}));const l=[],u=[],p=[],h=[],m=[];for(let n in R)if(R.hasOwnProperty(n)){let a=R[n];if(t.money.lt(a.getCost(e)))continue;if(this.upgrades.includes(n)||this.augmentations.includes(n))continue;switch(a.type){case"w":l.push(a);break;case"a":u.push(a);break;case"v":p.push(a);break;case"r":h.push(a);break;case"g":m.push(a);break;default:console.error(`ERROR: Invalid Gang Member Upgrade Type: ${a.type}`)}}const g=Object(d.createElement)("div",{width:"20%",display:"inline-block"}),_=Object(d.createElement)("div",{width:"20%",display:"inline-block"}),y=Object(d.createElement)("div",{width:"20%",display:"inline-block"}),b=Object(d.createElement)("div",{width:"20%",display:"inline-block"}),v=Object(d.createElement)("div",{width:"20%",display:"inline-block"});g.appendChild(Object(d.createElement)("h2",{innerText:"Weapons"})),_.appendChild(Object(d.createElement)("h2",{innerText:"Armor"})),y.appendChild(Object(d.createElement)("h2",{innerText:"Vehicles"})),b.appendChild(Object(d.createElement)("h2",{innerText:"Rootkits"})),v.appendChild(Object(d.createElement)("h2",{innerText:"Augmentations"}));const E=[l,u,p,h,m],k=[g,_,y,b,v];for(let n=0;n(r.buyUpgrade(n,t,e),!1)};i>=3?s.tooltipleft=n.desc:s.tooltip=n.desc,a.appendChild(Object(d.createElement)("a",s))}(a[i],r,this,n,e)}}return n.appendChild(g),n.appendChild(_),n.appendChild(y),n.appendChild(b),n.appendChild(v),n};const N={gangContentCreated:!1,gangContainer:null,managementButton:null,territoryButton:null,gangManagementSubpage:null,gangTerritorySubpage:null,gangDesc:null,gangInfo:null,gangRecruitMemberButton:null,gangRecruitRequirementText:null,gangExpandAllButton:null,gangCollapseAllButton:null,gangMemberFilter:null,gangManageEquipmentButton:null,gangMemberList:null,gangMemberPanels:{},gangMemberUpgradeBoxOpened:!1,gangMemberUpgradeBox:null,gangMemberUpgradeBoxContent:null,gangMemberUpgradeBoxFilter:null,gangMemberUpgradeBoxDiscount:null,gangMemberUpgradeBoxElements:null,gangTerritoryDescText:null,gangTerritoryWarfareCheckbox:null,gangTerritoryWarfareCheckboxLabel:null,gangTerritoryWarfareClashChance:null,gangTerritoryDeathNotifyCheckbox:null,gangTerritoryDeathNotifyCheckboxLabel:null,gangTerritoryInfoText:null};M.prototype.displayGangContent=function(e){if(!N.gangContentCreated||null==N.gangContainer){N.gangContentCreated=!0,N.gangContainer=Object(d.createElement)("div",{id:"gang-container",class:"generic-menupage-container"});var t=this.facName;this.members,this.wanted,this.respect;N.gangContainer.appendChild(Object(d.createElement)("a",{class:"a-link-button",display:"inline-block",innerText:"Back",clickListener:()=>(i.Engine.loadFactionContent(),Object(l.a)(t),!1)})),N.managementButton=Object(d.createElement)("a",{id:"gang-management-subpage-button",class:"a-link-button-inactive",display:"inline-block",innerHTML:"Gang Management (Alt+1)",clickListener:()=>(N.gangManagementSubpage.style.display="block",N.gangTerritorySubpage.style.display="none",N.managementButton.classList.toggle("a-link-button-inactive"),N.managementButton.classList.toggle("a-link-button"),N.territoryButton.classList.toggle("a-link-button-inactive"),N.territoryButton.classList.toggle("a-link-button"),this.updateGangContent(),!1)}),N.territoryButton=Object(d.createElement)("a",{id:"gang-territory-subpage-button",class:"a-link-button",display:"inline-block",innerHTML:"Gang Territory (Alt+2)",clickListener:()=>(N.gangManagementSubpage.style.display="none",N.gangTerritorySubpage.style.display="block",N.managementButton.classList.toggle("a-link-button-inactive"),N.managementButton.classList.toggle("a-link-button"),N.territoryButton.classList.toggle("a-link-button-inactive"),N.territoryButton.classList.toggle("a-link-button"),this.updateGangContent(),!1)}),N.gangContainer.appendChild(N.managementButton),N.gangContainer.appendChild(N.territoryButton),N.gangManagementSubpage=Object(d.createElement)("div",{display:"block",id:"gang-management-subpage"});var n="";n=this.isHackingGang?"Ethical Hacking":"Vigilante Justice",N.gangDesc=Object(d.createElement)("p",{width:"70%",innerHTML:"This page is used to manage your gang members and get an overview of your gang's stats.

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 '"+n+"' task to lower your wanted level.

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.

You can also manage your gang programmatically through Netscript using the Gang API"}),N.gangManagementSubpage.appendChild(N.gangDesc),N.gangInfo=Object(d.createElement)("p",{id:"gang-info",width:"70%"}),N.gangManagementSubpage.appendChild(N.gangInfo),N.gangRecruitMemberButton=Object(d.createElement)("a",{id:"gang-management-recruit-member-btn",class:"a-link-button-inactive",innerHTML:"Recruit Gang Member",display:"inline-block",margin:"10px",clickListener:()=>{const e="recruit-gang-member-popup";let t;const n=Object(d.createElement)("p",{innerText:"Please enter a name for your new Gang member:"}),a=Object(d.createElement)("br"),r=Object(d.createElement)("input",{onkeyup:e=>{e.keyCode===h.KEY.ENTER&&t.click()},placeholder:"Name must be unique",type:"text"});t=Object(d.createElement)("a",{class:"std-button",clickListener:()=>{let t=r.value;return""===t?(Object(u.dialogBoxCreate)("You must enter a name for your Gang member!"),!1):this.canRecruitMember()?this.recruitMember(t)?(Object(k.removeElementById)(e),!1):(Object(u.dialogBoxCreate)("You already have a gang member with this name!"),!1):(Object(u.dialogBoxCreate)("You cannot recruit another Gang member!"),!1)},innerText:"Recruit Gang Member"});const i=Object(d.createElement)("a",{class:"std-button",clickListener:()=>(Object(k.removeElementById)(e),!1),innerText:"Cancel"});Object(g.createPopup)(e,[n,a,r,t,i])}}),N.gangManagementSubpage.appendChild(N.gangRecruitMemberButton),N.gangRecruitRequirementText=Object(d.createElement)("p",{color:"red",id:"gang-recruit-requirement-text",margin:"10px"}),N.gangManagementSubpage.appendChild(N.gangRecruitRequirementText),N.gangManagementSubpage.appendChild(Object(d.createElement)("br",{})),N.gangExpandAllButton=Object(d.createElement)("a",{class:"a-link-button",display:"inline-block",innerHTML:"Expand All",clickListener:()=>{for(var e=N.gangManagementSubpage.getElementsByClassName("accordion-header"),t=0;t{for(var e=N.gangManagementSubpage.getElementsByClassName("accordion-header"),t=0;t{this.displayGangMemberList()}}),N.gangManageEquipmentButton=Object(d.createElement)("a",{class:"a-link-button",display:"inline-block",innerHTML:"Manage Equipment",clickListener:()=>{this.createGangMemberUpgradeBox(e)}}),N.gangManagementSubpage.appendChild(N.gangExpandAllButton),N.gangManagementSubpage.appendChild(N.gangCollapseAllButton),N.gangManagementSubpage.appendChild(N.gangMemberFilter),N.gangManagementSubpage.appendChild(N.gangManageEquipmentButton),N.gangMemberList=Object(d.createElement)("ul",{id:"gang-member-list"}),this.displayGangMemberList(),N.gangManagementSubpage.appendChild(N.gangMemberList),N.gangTerritorySubpage=Object(d.createElement)("div",{id:"gang-territory-subpage",display:"none"}),N.gangTerritoryDescText=Object(d.createElement)("p",{width:"70%",innerHTML:"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.

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

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.

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.

"}),N.gangTerritorySubpage.appendChild(N.gangTerritoryDescText),N.gangTerritoryWarfareCheckbox=Object(d.createElement)("input",{display:"inline-block",id:"gang-management-territory-warfare-checkbox",changeListener:()=>{this.territoryWarfareEngaged=N.gangTerritoryWarfareCheckbox.checked},margin:"2px",type:"checkbox"}),N.gangTerritoryWarfareCheckbox.checked=this.territoryWarfareEngaged,N.gangTerritoryWarfareCheckboxLabel=Object(d.createElement)("label",{color:"white",display:"inline-block",for:"gang-management-territory-warfare-checkbox",innerText:"Engage in Territory Warfare",tooltip:"Engaging in Territory Warfare sets your clash chance to 100%. Disengaging will cause your clash chance to gradually decrease until it reaches 0%"}),N.gangTerritorySubpage.appendChild(N.gangTerritoryWarfareCheckbox),N.gangTerritorySubpage.appendChild(N.gangTerritoryWarfareCheckboxLabel),N.gangTerritorySubpage.appendChild(Object(d.createElement)("br")),N.gangTerritoryWarfareClashChance=Object(d.createElement)("p",{display:"inline-block"}),N.gangTerritorySubpage.appendChild(N.gangTerritoryWarfareClashChance),N.gangTerritorySubpage.appendChild(Object(d.createElement)("div",{class:"help-tip",display:"inline-block",innerText:"?",clickListener:()=>{Object(u.dialogBoxCreate)("This percentage represents the chance you have of 'clashing' with with another gang. If you do not wish to gain/lose territory, then keep this percentage at 0% by not engaging in territory warfare.")}})),N.gangTerritoryDeathNotifyCheckbox=Object(d.createElement)("input",{display:"inline-block",id:"gang-management-notify-member-death-checkbox",changeListener:()=>{this.notifyMemberDeath=N.gangTerritoryDeathNotifyCheckbox.checked},margin:"2px",type:"checkbox"}),N.gangTerritoryDeathNotifyCheckbox.checked=this.notifyMemberDeath,N.gangTerritoryDeathNotifyCheckboxLabel=Object(d.createElement)("label",{color:"white",display:"inline-block",for:"gang-management-notify-member-death-checkbox",innerText:"Notify about Gang Member Deaths",tooltip:"If this is enabled, then you will receive a pop-up notifying you whenever one of your Gang Members dies in a territory clash."}),N.gangTerritorySubpage.appendChild(Object(d.createElement)("br")),N.gangTerritorySubpage.appendChild(N.gangTerritoryDeathNotifyCheckbox),N.gangTerritorySubpage.appendChild(N.gangTerritoryDeathNotifyCheckboxLabel),N.gangTerritorySubpage.appendChild(Object(d.createElement)("br"));var a=Object(d.createElement)("fieldset",{display:"block",margin:"6px",width:"50%"});N.gangTerritoryInfoText=Object(d.createElement)("p"),a.appendChild(N.gangTerritoryInfoText),N.gangTerritorySubpage.appendChild(a),N.gangContainer.appendChild(N.gangTerritorySubpage),N.gangContainer.appendChild(N.gangManagementSubpage),document.getElementById("entire-game-container").appendChild(N.gangContainer)}N.gangContainer.style.display="block",this.updateGangContent()},M.prototype.displayGangMemberList=function(){Object(v.removeChildrenFromElement)(N.gangMemberList),N.gangMemberPanels={};const e=this.members,t=N.gangMemberFilter.value.toString();for(var n=0;n-1||e[n].task.indexOf(t)>-1)&&this.createGangMemberDisplayElement(e[n])},M.prototype.updateGangContent=function(){if(N.gangContentCreated)if(N.gangMemberUpgradeBoxOpened&&(N.gangMemberUpgradeBoxDiscount.childNodes[0].nodeValue="Discount: -"+c.numeralWrapper.format(1-1/this.getDiscount(),"0.00%")),"block"===N.gangTerritorySubpage.style.display){N.gangTerritoryWarfareClashChance.innerText=`Territory Clash Chance: ${c.numeralWrapper.format(this.territoryClashChance,"0.000%")}`,N.gangTerritoryWarfareCheckbox.checked=this.territoryWarfareEngaged,N.gangTerritoryInfoText.innerHTML="";const e=O[this.facName].power;for(const t in O)if(O.hasOwnProperty(t)){const n=O[t];let a,r=100*n.territory;if(a=r<=0?Object(f.formatNumber)(0,2):r>=100?Object(f.formatNumber)(100,2):Object(f.formatNumber)(r,2),t===this.facName){let e=`${t}
Power: ${Object(f.formatNumber)(n.power,6)}
`;e+=`Territory: ${a}%

`,N.gangTerritoryInfoText.innerHTML+=e}else{const r=e/(n.power+e);let i=`${t}
Power: ${Object(f.formatNumber)(n.power,6)}
`;i+=`Territory: ${a}%
`,i+=`Chance to win clash with this gang: ${c.numeralWrapper.format(r,"0.000%")}

`,N.gangTerritoryInfoText.innerHTML+=i}}}else{if(N.gangInfo instanceof Element){var e,t=s.Factions[this.facName];e=t instanceof o.Faction?t.playerReputation:"ERROR",Object(v.removeChildrenFromElement)(N.gangInfo),N.gangInfo.appendChild(Object(d.createElement)("p",{display:"inline-block",innerText:"Respect: "+Object(f.formatNumber)(this.respect,6)+" ("+Object(f.formatNumber)(5*this.respectGainRate,6)+" / sec)",tooltip:"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."})),N.gangInfo.appendChild(Object(d.createElement)("br")),N.gangInfo.appendChild(Object(d.createElement)("p",{display:"inline-block",innerText:"Wanted Level: "+Object(f.formatNumber)(this.wanted,6)+" ("+Object(f.formatNumber)(5*this.wantedGainRate,6)+" / sec)",tooltip:"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."})),N.gangInfo.appendChild(Object(d.createElement)("br"));var n=this.getWantedPenalty();n=100*(1-n),N.gangInfo.appendChild(Object(d.createElement)("p",{display:"inline-block",innerText:`Wanted Level Penalty: -${Object(f.formatNumber)(n,2)}%`,tooltip:"Penalty for respect and money gain rates due to Wanted Level"})),N.gangInfo.appendChild(Object(d.createElement)("br")),N.gangInfo.appendChild(Object(d.createElement)("p",{display:"inline-block",innerText:`Money gain rate: ${c.numeralWrapper.format(5*this.moneyGainRate,"$0.000a")} / sec`})),N.gangInfo.appendChild(Object(d.createElement)("br"));var a=100*O[this.facName].territory;let r;r=a<=0?Object(f.formatNumber)(0,2):a>=100?Object(f.formatNumber)(100,2):Object(f.formatNumber)(a,2),N.gangInfo.appendChild(Object(d.createElement)("p",{display:"inline-block",innerText:`Territory: ${Object(f.formatNumber)(r,3)}%`,tooltip:"The percentage of total territory your Gang controls"})),N.gangInfo.appendChild(Object(d.createElement)("br")),N.gangInfo.appendChild(Object(d.createElement)("p",{display:"inline-block",innerText:"Faction reputation: "+Object(f.formatNumber)(e,3)})),N.gangInfo.appendChild(Object(d.createElement)("br"));const l=1e3/i.Engine._idleSpeed;N.gangInfo.appendChild(Object(d.createElement)("p",{innerText:`Bonus time(s): ${this.storedCycles/l}`,display:"inline-block",tooltip:"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"})),N.gangInfo.appendChild(Object(d.createElement)("br"))}else console.error("gang-info DOM element DNE");const r=this.members.length,l=this.getRespectNeededToRecruitMember(),u=N.gangRecruitMemberButton;r>=30?(u.className="a-link-button-inactive",N.gangRecruitRequirementText.style.display="inline-block",N.gangRecruitRequirementText.innerHTML="You have reached the maximum amount of gang members"):this.canRecruitMember()?(u.className="a-link-button",N.gangRecruitRequirementText.style.display="none"):(u.className="a-link-button-inactive",N.gangRecruitRequirementText.style.display="inline-block",N.gangRecruitRequirementText.innerHTML=`${Object(f.formatNumber)(l,2)} respect needed to recruit next member`);for(let e=0;e")});N.gangMemberPanels[t].statsDiv=i;const o=Object(d.createElement)("pre",{display:"inline",id:t+"gang-member-stats-text"}),s=Object(d.createElement)("br"),l=Object(d.createElement)("button",{class:"accordion-button",innerText:"Ascend",clickListener:()=>{const t=`gang-management-ascend-member ${e.name}`,n=e.getAscensionResults(),a=Object(d.createElement)("pre",{innerText:["Are you sure you want to ascend this member? (S)he will lose all of","his non-Augmentation upgrades and his/her stats will reset back to 1.","",`Furthermore, your gang will lose ${c.numeralWrapper.format(e.earnedRespect,"0.000000")} respect`,"","In return, (s)he will gain the following permanent boost to stat multipliers:\n",`Hacking: +${c.numeralWrapper.format(n.hack,"0.00%")}`,`Strength: +${c.numeralWrapper.format(n.str,"0.00%")}`,`Defense: +${c.numeralWrapper.format(n.def,"0.00%")}`,`Dexterity: +${c.numeralWrapper.format(n.dex,"0.00%")}`,`Agility: +${c.numeralWrapper.format(n.agi,"0.00%")}`,`Charisma: +${c.numeralWrapper.format(n.cha,"0.00%")}`].join("\n")}),r=Object(d.createElement)("button",{class:"std-button",clickListener:()=>(this.ascendMember(e),this.updateGangMemberDisplayElement(e),Object(k.removeElementById)(t),!1),innerText:"Ascend"}),i=Object(d.createElement)("button",{class:"std-button",clickListener:()=>(Object(k.removeElementById)(t),!1),innerText:"Cancel"});Object(g.createPopup)(t,[a,r,i])}}),p=Object(d.createElement)("div",{class:"help-tip",clickListener:()=>{Object(u.dialogBoxCreate)(["Ascending a Gang Member resets the member's progress and stats in exchange","for a permanent boost to their stat multipliers.","

The additional stat multiplier that the Gang Member gains upon ascension","is based on the amount of multipliers the member has from non-Augmentation Equipment.","

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."].join(" "))},innerText:"?",marginTop:"5px"});i.appendChild(o),i.appendChild(s),i.appendChild(l),i.appendChild(p);const h=Object(d.createElement)("div",{class:"gang-member-info-div",id:t+"gang-member-task"}),_=Object(d.createElement)("select",{class:"dropdown",id:t+"gang-member-task-selector"});let f=this.getAllTaskNames();f.unshift("---");for(var y=0;y{var t=_.options[_.selectedIndex].text;e.assignToTask(t),this.setGangMemberTaskDescription(e,t),this.updateGangContent()}),w.hasOwnProperty(e.task)){var v=e.task,E=0;for(let e=0;e"))}var r=document.getElementById(t+"gang-member-gain-info");r&&(r.innerHTML=[`Money: $ ${Object(f.formatNumber)(5*e.calculateMoneyGain(this),2)} / sec`,`Respect: ${Object(f.formatNumber)(5*e.calculateRespectGain(this),6)} / sec`,`Wanted Level: ${Object(f.formatNumber)(5*e.calculateWantedLevelGain(this),6)} / sec`,`Total Respect Earned: ${Object(f.formatNumber)(e.earnedRespect,6)}`].join("
"));const i=document.getElementById(t+"gang-member-task-selector");if(i){let t=this.getAllTaskNames();if(t.unshift("---"),w.hasOwnProperty(e.task)){const n=e.task;let a=0;for(let e=0;e7===e.n))))throw Object(i.d)(e,n)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=n(2),r=n(158),i=n(18);class o{constructor(e=""){this.alreadyInvited=!1,this.augmentations=[],this.favor=0,this.isBanned=!1,this.isMember=!1,this.name="",this.playerReputation=0,this.rolloverRep=0,this.name=e}static fromJSON(e){return i.Generic_fromJSON(o,e.data)}getInfo(){const e=r.FactionInfos[this.name];if(null==e)throw new Error(`Missing faction from FactionInfos: ${this.name} this probably means the faction got corrupted somehow`);return e}gainFavor(){null==this.favor&&(this.favor=0),null==this.rolloverRep&&(this.rolloverRep=0);const e=this.getFavorGain();2===e.length?(this.favor+=e[0],this.rolloverRep=e[1]):console.error("Invalid result from getFavorGain() function")}getFavorGain(){null==this.favor&&(this.favor=0),null==this.rolloverRep&&(this.rolloverRep=0);var e=0,t=this.playerReputation+this.rolloverRep;let n=a.CONSTANTS.FactionReputationToFavorBase*Math.pow(a.CONSTANTS.FactionReputationToFavorMult,this.favor);for(;t>0&&t>=n;)++e,t-=n,n*=a.CONSTANTS.FactionReputationToFavorMult;return[e,t]}addAllAugmentations(e){this.augmentations.length=0;for(const t in e)e.hasOwnProperty(t)&&this.augmentations.push(t)}toJSON(){return i.Generic_toJSON("Faction",this)}}t.Faction=o,i.Reviver.constructors.Faction=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arrayToString=function(e){const t=[];for(let n=0;n["+(_Fconf_FconfSettings__WEBPACK_IMPORTED_MODULE_9__.FconfSettings.ENABLE_TIMESTAMPS?Object(_utils_helpers_getTimestamp__WEBPACK_IMPORTED_MODULE_37__.getTimestamp)()+" ":"")+_Player__WEBPACK_IMPORTED_MODULE_18__.a.getCurrentServer().hostname+" ~]> "+n),n.length>0&&(Terminal.resetTerminalInput(),Terminal.executeCommands(n))}if(e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_33__.KEY.C&&e.ctrlKey&&(_engine__WEBPACK_IMPORTED_MODULE_7__.Engine._actionInProgress?(Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_40__.post)("Cancelling..."),_engine__WEBPACK_IMPORTED_MODULE_7__.Engine._actionInProgress=!1,Terminal.finishAction(!0)):_Fconf_FconfSettings__WEBPACK_IMPORTED_MODULE_9__.FconfSettings.ENABLE_BASH_HOTKEYS&&Terminal.resetTerminalInput()),e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_33__.KEY.L&&e.ctrlKey&&(e.preventDefault(),Terminal.executeCommand("clear")),e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_33__.KEY.UPARROW||_Fconf_FconfSettings__WEBPACK_IMPORTED_MODULE_9__.FconfSettings.ENABLE_BASH_HOTKEYS&&e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_33__.KEY.P&&e.ctrlKey){if(_Fconf_FconfSettings__WEBPACK_IMPORTED_MODULE_9__.FconfSettings.ENABLE_BASH_HOTKEYS&&e.preventDefault(),null==t)return;var a=Terminal.commandHistoryIndex;if(0==(i=Terminal.commandHistory.length))return;(a<0||a>i)&&(Terminal.commandHistoryIndex=i),0!=a&&--Terminal.commandHistoryIndex;var r=Terminal.commandHistory[Terminal.commandHistoryIndex];t.value=r,Object(_utils_SetTimeoutRef__WEBPACK_IMPORTED_MODULE_29__.setTimeoutRef)(function(){t.selectionStart=t.selectionEnd=1e4},0)}if(e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_33__.KEY.DOWNARROW||_Fconf_FconfSettings__WEBPACK_IMPORTED_MODULE_9__.FconfSettings.ENABLE_BASH_HOTKEYS&&e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_33__.KEY.M&&e.ctrlKey){if(_Fconf_FconfSettings__WEBPACK_IMPORTED_MODULE_9__.FconfSettings.ENABLE_BASH_HOTKEYS&&e.preventDefault(),null==t)return;var i;a=Terminal.commandHistoryIndex;if(0==(i=Terminal.commandHistory.length))return;if((a<0||a>i)&&(Terminal.commandHistoryIndex=i),a==i||a==i-1)Terminal.commandHistoryIndex=i,t.value="";else{++Terminal.commandHistoryIndex;r=Terminal.commandHistory[Terminal.commandHistoryIndex];t.value=r}}if(e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_33__.KEY.TAB){if(e.preventDefault(),null==t)return;var o=t.value;if(""==o)return;const a=o.lastIndexOf(";");-1!==a&&(o=o.slice(a+1));var s=(o=(o=o.trim()).replace(/\s\s+/g," ")).split(" "),l=s.length-2;l<-1&&(l=0);var c=determineAllPossibilitiesForTabCompletion(o,l);if(0==c.length)return;var u="";n="";if(0==s.length)return;1==s.length?n=s[0]:2==s.length?(n=s[0],u=s[1]):3==s.length?(n=s[0]+" "+s[1],u=s[2]):(u=s.pop(),n=s.join(" ")),tabCompletion(n,u,c),t.focus()}_Fconf_FconfSettings__WEBPACK_IMPORTED_MODULE_9__.FconfSettings.ENABLE_BASH_HOTKEYS&&(e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_33__.KEY.A&&e.ctrlKey&&(e.preventDefault(),Terminal.moveTextCursor("home")),e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_33__.KEY.E&&e.ctrlKey&&(e.preventDefault(),Terminal.moveTextCursor("end")),e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_33__.KEY.B&&e.ctrlKey&&(e.preventDefault(),Terminal.moveTextCursor("prevchar")),e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_33__.KEY.B&&e.altKey&&(e.preventDefault(),Terminal.moveTextCursor("prevword")),e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_33__.KEY.F&&e.ctrlKey&&(e.preventDefault(),Terminal.moveTextCursor("nextchar")),e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_33__.KEY.F&&e.altKey&&(e.preventDefault(),Terminal.moveTextCursor("nextword")),e.keyCode!==_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_33__.KEY.H&&e.keyCode!==_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_33__.KEY.D||!e.ctrlKey||(Terminal.modifyInput("backspace"),e.preventDefault()))}});let terminalCtrlPressed=!1,shiftKeyPressed=!1;function tabCompletion(e,t,n,a=0){if(n.constructor!==Array)return;if(!Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_30__.containsAllStrings)(n))return;if(""==t)for(var r=n.length-1;r>=0;--r)n[r].toLowerCase().startsWith(e.toLowerCase())||n.splice(r,1);else for(r=n.length-1;r>=0;--r)n[r].toLowerCase().startsWith(t.toLowerCase())||n.splice(r,1);const i=document.getElementById("terminal-input-text-box");if(null==i)return void console.warn("Couldn't find terminal input DOM element (id=terminal-input-text-box) when trying to autocomplete");const o=i.value.lastIndexOf(";");var s="";if(0!=n.length)if(1==n.length)s=""==t?n[0]+" ":e+" "+n[0],i.value=-1===o?s:i.value.slice(0,o+1)+" "+s,i.focus();else{var l=Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_30__.longestCommonStart)(n),c="";for(r=0;r "+e),Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_40__.post)(c)):(i.value=-1===o?l:i.value.slice(0,o+1)+" "+l,i.focus()):l==t?(Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_40__.post)("> "+e+" "+t),Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_40__.post)(c)):(i.value=-1==o?e+" "+l:i.value.slice(0,o+1)+" "+e+" "+l,i.focus())}}function determineAllPossibilitiesForTabCompletion(e,t=0){var n=[];n=n.concat(Object.keys(_Alias__WEBPACK_IMPORTED_MODULE_0__.b));var a=_Player__WEBPACK_IMPORTED_MODULE_18__.a.getCurrentServer();if((e=e.toLowerCase()).startsWith("./")&&-1==t){for(var r=0;r["+_Player__WEBPACK_IMPORTED_MODULE_18__.a.getCurrentServer().hostname+' ~]$