!function(e){function t(t){for(var a,o,s=t[0],l=t[1],c=t[2],p=0,h=[];p
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.3\n * Added a new Augmentation: The Shadow's Simulacrum\n * Improved tab autocompletion feature in Terminal so that it works better with directories\n * Bug Fix: Tech vendor location UI now properly refreshed when purchasing a TOR router\n * Bug Fix: Fixed UI issue with faction donations\n * Bug Fix: The money statistics & breakdown should now properly track money earned from Hacknet Server (hashes -> money)\n * Bug Fix: Fixed issue with changing input in 'Minimum Path Sum in a Triangle' coding contract problem\n * Fixed several typos in various places\n\n v0.46.2\n * Source-File 2 now allows you to form gangs in other BitNodes when your karma reaches a very large negative value\n ** (Karma is a hidden stat and is lowered by committing crimes)\n * Gang changes:\n ** Bug Fix: Gangs can no longer clash with themselve\n ** Bug Fix: Winning against another gang should properly reduce their power\n\n * Bug Fix: Terminal 'wget' command now works properly\n * Bug Fix: Hacknet Server Hash upgrades now properly reset upon installing Augs/switching BitNodes\n * Bug Fix: Fixed button for creating Corporations\n\n v0.46.1\n * Added a very rudimentary directory system to the Terminal\n ** Details here: https://bitburner.readthedocs.io/en/latest/basicgameplay/terminal.html#filesystem-directories\n * Added numHashes(), hashCost(), and spendHashes() functions to the Netscript Hacknet Node API\n * 'Generate Coding Contract' hash upgrade is now more expensive\n * 'Generate Coding Contract' hash upgrade now generates the contract randomly on the server, rather than on home computer\n * The cost of selling hashes for money no longer increases each time\n * Selling hashes for money now costs 4 hashes (in exchange for $1m)\n * Bug Fix: Hacknet Node earnings should work properly when game is inactive/offline\n * Bug Fix: Duplicate Sleeve augmentations are now properly reset when switching to a new BitNode\n "}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=n(115);n(510),n(509),n(508),n(507),n(506),n(505),n(504),n(503),n(502),n(501),n(500),n(499),n(498),n(497);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",ShadowsSimulacrum:"The Shadow's Simulacrum",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";n.d(t,"a",function(){return m}),n.d(t,"c",function(){return d}),n.d(t,"e",function(){return g}),n.d(t,"d",function(){return _}),n.d(t,"f",function(){return f}),n.d(t,"b",function(){return y});n(19),n(2);var a=n(0),r=(n(165),n(38)),i=(n(79),n(21)),o=(n(18),n(125)),s=(n(103),n(60)),l=n(65),c=n(63),u=n(71),p=n(130),h=n(50);function m(e,t,n=!1){var a=[],r=t.env;if(r.stopFlag)return n?a:Promise.reject(t);var o,s,l=e.source.value,u=!1,p=[];if(1===e.specifiers.length&&"ImportNamespaceSpecifier"===e.specifiers[0].type)u=!0,o=e.specifiers[0].local.name;else for(var h=0;h{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";Object.defineProperty(t,"__esModule",{value:!0});const a=n(50);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${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"})},t.postContent=r},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")});let r=!1;function i(e,t=!1){console.log("dialogBoxCreate() called");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(82))},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.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(187),i=n(16);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";n.r(t),function(e){n.d(t,"Engine",function(){return ue});var a=n(7),r=n(111),i=n(87),o=n(11),s=n(76),l=n(5),c=n(81),u=n(39),p=n(192),h=n(144),m=n(110),d=(n(48),n(24)),g=n(32),_=n(2),f=n(171),y=n(12),b=n(51),v=n(35),E=n(30),k=n(42),C=n(117),S=n(17),T=n(150),O=n(67),M=n(73),P=n(54),A=n(38),w=n(0),x=n(126),N=(n(31),n(135)),R=n(80),I=n(96),D=n(60),B=n(20),L=(n(79),n(18)),W=n(97),j=n(43),F=n(40),U=n(29),H=n(72),G=n(93),K=n(149),q=n(170),$=n(101),Y=n(190),z=n(10),V=n(3),J=n(189),X=n(188),Q=n(33),Z=n(9),ee=n(119),te=(n(14),n(41)),ne=(n(23),n(4)),ae=n(46),re=n(169),ie=n(28),oe=n(1),se=n.n(oe),le=n(69),ce=n.n(le);n(367),n(292),n(290),n(288),n(286),n(284),n(282),n(280),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);e(document).keydown(function(e){if(!0!==L.Settings.DisableHotkeys){try{if(Object(D.b)().isFocused())return}catch(e){}if(!(w.a.isWorking||R.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.loadLocationContent();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,createProgramContent:null,factionsContent:null,factionContent: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(D.b)().openScript(e,t)}catch(e){Object(ae.exceptionAlert)(e)}Object(D.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(E.m)(),Q.MainMenuLinks.HacknetNodes.classList.add("active")},loadCreateProgramContent:function(){ue.hideAllContent(),ue.Display.createProgramContent.style.display="block",Object(N.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(e=!0){ue.hideAllContent(),ue.Display.locationContent.style.display="block",Q.MainMenuLinks.City.classList.add("active"),z.routing.navigateTo(z.Page.Location);const t=se.a.createElement(T.LocationRoot,{initiallyInCity:e,engine:ue,p:w.a});ce.a.render(t,ue.Display.locationContent)},loadTravelContent:function(){ue.hideAllContent(),w.a.gotoLocation(S.LocationName.TravelAgency),ue.Display.locationContent.style.display="block",Q.MainMenuLinks.Travel.classList.add("active"),z.routing.navigateTo(z.Page.Location);const e=se.a.createElement(T.LocationRoot,{initiallyInCity:!1,engine:ue,p:w.a});ce.a.render(e,ue.Display.locationContent)},loadJobContent:function(){if(""==w.a.companyName)return void Object(Z.dialogBoxCreate)("You do not currently have a job! You can visit various companies in the city and try to find a job.");ue.hideAllContent(),w.a.gotoLocation(w.a.companyName),ue.Display.locationContent.style.display="block",Q.MainMenuLinks.Job.classList.add("active"),z.routing.navigateTo(z.Page.Location);const e=se.a.createElement(T.LocationRoot,{initiallyInCity:!1,engine:ue,p:w.a});ce.a.render(e,ue.Display.locationContent)},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(E.a)(),ue.Display.createProgramContent.style.display="none",ue.Display.factionsContent.style.display="none",ce.a.unmountComponentAtNode(ue.Display.factionContent),ue.Display.factionContent.style.display="none",ue.Display.augmentationsContent.style.display="none",ue.Display.tutorialContent.style.display="none",ue.Display.locationContent.style.display="none",ce.a.unmountComponentAtNode(ue.Display.locationContent),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.inactivateMainMenuLinks(),Object(f.a)()},inactivateMainMenuLinks:function(){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")},displayCharacterOverviewInfo:function(){ce.a.render(se.a.createElement(p.a,null),document.getElementById("character-overview-text"));const e=document.getElementById("character-overview-save-button");L.Settings.AutosaveInterval?e.classList.remove("flashing-button"):e.classList.add("flashing-button")},updateCharacterInfo:function(){Object(Y.displayCharacterInfo)(ue.Display.characterInfo,w.a)},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.displayFactionContent)(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.joinFaction)(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),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.inviteToFaction)(a)}ue.Counters.checkFactionInvitations=100}if(ue.Counters.passiveFactionGrowth<=0){var s=Math.floor(600-ue.Counters.passiveFactionGrowth);Object(b.processPassiveFactionRepGain)(s),ue.Counters.passiveFactionGrowth=600}if(ue.Counters.messages<=0&&(Object(O.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,N,R];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(S):S.style.display="none",w.a.bladeburner instanceof u.a?z.push(T):T.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(B.initForeignServers)(w.a.getHomeComputer()),Object(d.initCompanies)(),Object(y.initFactions)(),Object(s.d)(),Object(O.c)(),Object(U.i)(),Object(C.a)(),Object(P.e)(),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",S.style.display="none",f.style.display="none",i.style.display="none",T.style.display="none",M.style.display="none",A.style.display="none",R.style.display="none",ue.openMainMenuHeader([t,n,r,o,h,m,x,N]),Object(k.c)(),Object(re.removeLoadingScreen)()}Object(J.a)(),Object(D.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.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.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.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(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.loadLocationContent(),!1}),Q.MainMenuLinks.Travel.addEventListener("click",function(){return ue.loadTravelContent(),!1}),Q.MainMenuLinks.Job.addEventListener("click",function(){return ue.loadJobContent(),!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(N.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(82))},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(19),i=n(12),o=n(16);class s{constructor(e={info:"",moneyCost:0,name:"",repCost:0}){this.baseCost=0,this.baseRepRequirement=0,this.info="",this.isSpecial=!1,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,e.isSpecial&&(this.isSpecial=!0),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{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});const a=n(20),r=n(19),i=n(2),o=n(31),s=n(130);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}),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(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});const a=n(343),r=n(83),i=n(16);t.Companies={},t.initCompanies=function(){const e=t.Companies;t.Companies={},a.companiesMetadata.forEach(e=>{!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";Object.defineProperty(t,"__esModule",{value:!0});const a=n(86),r=n(75);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(359),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(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Aevum="Aevum",e.Chongqing="Chongqing",e.Ishima="Ishima",e.NewTokyo="New Tokyo",e.Sector12="Sector-12",e.Volhaven="Volhaven"}(t.CityName||(t.CityName={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KEY={A:65,B:66,C:67,CTRL:17,D:68,DOWNARROW:40,E:69,ENTER:13,ESC:27,F:70,H:72,J:74,K:75,L:76,M:77,N:78,O:79,P:80,R:82,S:83,TAB:9,U:85,UPARROW:38,W:87,1:49,2:50}},function(e,t,n){"use strict";n.d(t,"c",function(){return P}),n.d(t,"d",function(){return A}),n.d(t,"e",function(){return w}),n.d(t,"i",function(){return R}),n.d(t,"h",function(){return I}),n.d(t,"j",function(){return D}),n.d(t,"q",function(){return B}),n.d(t,"p",function(){return j}),n.d(t,"n",function(){return F}),n.d(t,"m",function(){return U}),n.d(t,"g",function(){return Y}),n.d(t,"r",function(){return ee}),n.d(t,"k",function(){return N}),n.d(t,"o",function(){return G}),n.d(t,"l",function(){return S}),n.d(t,"f",function(){return T}),n.d(t,"a",function(){return k}),n.d(t,"b",function(){return C});var a=n(36),r=n(89),i=n(2),o=n(17),s=n(54),l=n(38),c=n(0),u=n(10),p=n(3),h=n(9),m=n(23),d=n(16),g=n(46),_=n(14),f=n(28),y=n(4),b=n(41),v=n(25),E=n(34),k={LimitBuy:"Limit Buy Order",LimitSell:"Limit Sell Order",StopBuy:"Stop Buy Order",StopSell:"Stop Sell Order"},C={Long:"L",Short:"S"};function S(e,t,n,r,i,o=null){var s=o instanceof l.b,c=new M(e,t,n,r,i);if(isNaN(t)||isNaN(n))return s?o.scriptRef.log("ERROR: Invalid numeric value provided for either 'shares' or 'price' argument"):Object(h.dialogBoxCreate)("ERROR: Invalid numeric value provided for either 'shares' or 'price' argument"),!1;if(null==P.Orders){var u={};for(var p in P)if(P.hasOwnProperty(p)){if(!((e=P[p])instanceof a.Stock))continue;u[e.symbol]=[]}P.Orders=u}return P.Orders[e.symbol].push(c),H(c.stock,c.type,c.pos),te(c.stock),!0}function T(e,t=null){var n=t instanceof l.b;if(null==P.Orders)return!1;if(e.order&&e.order instanceof M){for(var r=e.order,i=P.Orders[r.stock.symbol],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.LocationName.AevumECorp,r=new a.Stock(n,A[n],t(40,50)/100,!0,19,t(17e3,28e3),24e11);P[n]=r;var i=o.LocationName.Sector12MegaCorp,s=new a.Stock(i,A[i],t(40,50)/100,!0,19,t(24e3,34e3),24e11);P[i]=s;var l=o.LocationName.Sector12BladeIndustries,c=new a.Stock(l,A[l],t(70,80)/100,!0,13,t(12e3,25e3),16e11);P[l]=c;var u=o.LocationName.AevumClarkeIncorporated,p=new a.Stock(u,A[u],t(65,75)/100,!0,12,t(1e4,25e3),15e11);P[u]=p;var h=o.LocationName.VolhavenOmniTekIncorporated,m=new a.Stock(h,A[h],t(60,70)/100,!0,12,t(32e3,43e3),18e11);P[h]=m;var d=o.LocationName.Sector12FourSigma,g=new a.Stock(d,A[d],t(100,110)/100,!0,17,t(5e4,8e4),2e12);P[d]=g;var f=o.LocationName.ChongqingKuaiGongInternational,y=new a.Stock(f,A[f],t(75,85)/100,!0,10,t(16e3,28e3),19e11);P[f]=y;var b=o.LocationName.AevumFulcrumTechnologies,v=new a.Stock(b,A[b],t(120,130)/100,!0,16,t(29e3,36e3),2e12);P[b]=v;var E=o.LocationName.IshimaStormTechnologies,k=new a.Stock(E,A[E],t(80,90)/100,!0,7,t(2e4,25e3),12e11);P[E]=k;var C=o.LocationName.NewTokyoDefComm,S=new a.Stock(C,A[C],t(60,70)/100,!0,10,t(6e3,19e3),9e11);P[C]=S;var T=o.LocationName.VolhavenHeliosLabs,O=new a.Stock(T,A[T],t(55,65)/100,!0,9,t(1e4,18e3),825e9);P[T]=O;var M=o.LocationName.NewTokyoVitaLife,w=new a.Stock(M,A[M],t(70,80)/100,!0,7,t(8e3,14e3),1e12);P[M]=w;var x=o.LocationName.Sector12IcarusMicrosystems,N=new a.Stock(x,A[x],t(60,70)/100,!0,7.5,t(12e3,24e3),8e11);P[x]=N;var R=o.LocationName.Sector12UniversalEnergy,I=new a.Stock(R,A[R],t(50,60)/100,!0,10,t(16e3,29e3),9e11);P[R]=I;var D=o.LocationName.AevumAeroCorp,B=new a.Stock(D,A[D],t(55,65)/100,!0,6,t(8e3,17e3),64e10);P[D]=B;var L=o.LocationName.VolhavenOmniaCybersystems,W=new a.Stock(L,A[L],t(65,75)/100,!0,4.5,t(6e3,15e3),6e11);P[L]=W;var j=o.LocationName.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.LocationName.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.LocationName.IshimaNovaMedical,K=new a.Stock(G,A[G],t(70,80)/100,!0,5,t(15e3,27e3),6e11);P[G]=K;var q=o.LocationName.AevumWatchdogSecurity,$=new a.Stock(q,A[q],t(240,260)/100,!0,1.5,t(4e3,8500),45e10);P[q]=$;var Y=o.LocationName.VolhavenLexoCorp,z=new a.Stock(Y,A[Y],t(115,135)/100,!0,6,t(4500,8e3),3e11);P[Y]=z;var V=o.LocationName.AevumRhoConstruction,J=new a.Stock(V,A[V],t(50,70)/100,!0,1,t(2e3,7e3),18e10);P[V]=J;var X=o.LocationName.Sector12AlphaEnterprises,Q=new a.Stock(X,A[X],t(175,205)/100,!0,10,t(4e3,8500),24e10);P[X]=Q;var Z=o.LocationName.VolhavenSysCoreSecurities,ee=new a.Stock(Z,A[Z],t(150,170)/100,!0,3,t(3e3,8e3),2e11);P[Z]=ee;var te=o.LocationName.VolhavenCompuTek,ne=new a.Stock(te,A[te],t(80,100)/100,!0,4,t(1e3,6e3),185e9);P[te]=ne;var ae=o.LocationName.AevumNetLinkTechnologies,re=new a.Stock(ae,A[ae],t(400,430)/100,!0,1,t(1e3,5e3),58e9);P[ae]=re;var ie=o.LocationName.IshimaOmegaSoftware,oe=new a.Stock(ie,A[ie],t(90,110)/100,!0,.5,t(1e3,8e3),6e10);P[ie]=oe;var se=o.LocationName.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 D(){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 B(){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&&O(s);break;case k.LimitSell:case k.StopBuy:s.pos===C.Long&&e.price>=s.price?O(s):s.pos===C.Short&&e.price<=s.price&&O(s);break;case k.StopSell:s.pos===C.Long&&e.price<=s.price?O(s):s.pos===C.Short&&e.price>=s.price&&O(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(),D(),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.d&&s.f>=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 O=document.createElement("option");if(O.text="Market Order",m.add(O),8===c.a.bitNodeN||s.d&&s.f>=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?L(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,S(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)(),S(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?L(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)),S(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.d&&s.f>=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(){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=S();if(isNaN(t))throw new Error("Calculated cost of purchasing HacknetServer is NaN");if(!c.a.canAfford(t))return-1;c.a.loseMoney(t);c.a.createHacknetServer();return c.a.hashManager.updateCapacity(c.a),e}{const t=C();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 k(){return v()&&c.a.hacknetNodes.length>=r.MaxNumberHacknetServers}function C(){const e=c.a.hacknetNodes.length,t=a.HacknetNodePurchaseNextMult;return a.BaseCostForHacknetNode*Math.pow(t,e)*c.a.hacknet_node_purchase_cost_mult}function S(){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 T(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 O(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 M(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 P(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 A(){m.routing.isOn(m.Page.HacknetNodes)&&f.a.render(g.a.createElement(y.a,null),b)}function w(){b instanceof HTMLElement&&f.a.unmountComponentAtNode(b),b.style.display="none"}function x(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=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;o{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=S.length-1;t>=0;t--)if(0==S[t].running&&1==S[t].env.stopFlag){e=!0;var n=S[t].serverIp,r=S[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),S.push(i)}}function R(e=1){for(var t=e*i.Engine._idleSpeed/1e3,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 j(e={}){this.name=e.name?e.name:I[2],this.pop=e.pop?e.pop:Object(C.getRandomInt)(D,1.5*D),this.popEst=this.pop*(Math.random()+.5),this.comms=e.comms?e.comms:Object(C.getRandomInt)(5,150),this.commsEst=this.comms+Object(C.getRandomInt)(-5,5),this.commsEst<0&&(this.commsEst=0),this.chaos=0}function F(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(m.routing.isOn(m.Page.Bladeburner)){if(!(p.a.bladeburner instanceof X))return;let i=p.a.bladeburner.consoleHistory;if(e.keyCode===T.KEY.ENTER){e.preventDefault();var t=Q.consoleInput.value;t.length>0&&(p.a.bladeburner.postToConsole("> "+t),p.a.bladeburner.resetConsoleInput(),p.a.bladeburner.executeConsoleCommands(t))}if(e.keyCode===T.KEY.UPARROW){if(null==Q.consoleInput)return;var n=L;if(0===(r=i.length))return;(n<0||n>r)&&(L=r),0!==n&&--L;var a=i[L];Q.consoleInput.value=a,Object(f.setTimeoutRef)(function(){Q.consoleInput.selectionStart=Q.consoleInput.selectionEnd=1e4},0)}if(e.keyCode===T.KEY.DOWNARROW){if(null==Q.consoleInput)return;var r;n=L;if(0==(r=i.length))return;if((n<0||n>r)&&(L=r),n==r||n==r-1)L=r,Q.consoleInput.value="";else{a=i[++L];Q.consoleInput.value=a}}}}),j.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}},j.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))},j.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)}},j.prototype.toJSON=function(){return Object(_.Generic_toJSON)("City",this)},j.fromJSON=function(e){return Object(_.Generic_fromJSON)(j,e.data)},_.Reviver.constructors.City=j,F.prototype.calculateCost=function(e){return Math.floor((this.baseCost+e*this.costInc)*i.BitNodeMultipliers.BladeburnerSkillCost)};const U={},H={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 G(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(b.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(C.getRandomInt)(1e3,25e3),this.countGrowth=e.countGrowth?e.countGrowth:Object(C.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};let t=0;for(const e in this.weights)this.weights.hasOwnProperty(e)&&(t+=this.weights[e]);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");this.decays=e.decays?e.decays:{hack:.9,str:.9,def:.9,dex:.9,agi:.9,cha:.9,int:.9};for(const e in this.decays)if(this.decays.hasOwnProperty(e)&&this.decays[e]>1)throw new Error("Invalid decays when constructing Action "+this.name+". Decay value cannot be greater than 1")}G.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},G.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=p.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 z||this instanceof V)&&(this.teamCount&&this.teamCount>0&&(this.teamCount=Math.min(this.teamCount,e.teamSize),a*=Math.pow(this.teamCount,.05)));if(!(this instanceof V)){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 z&&"Raid"===this.name&&l.comms<=0)return 0}if(a*=e.skillMultipliers.successChanceAll,(this instanceof z||this instanceof V)&&(a*=e.skillMultipliers.successChanceOperation),this instanceof Y&&(a*=e.skillMultipliers.successChanceContract),this.isStealth&&(a*=e.skillMultipliers.successChanceStealth),this.isKill&&(a*=e.skillMultipliers.successChanceKill),a*=p.a.bladeburner_success_chance_mult,isNaN(a))throw new Error("Competence calculated as NaN in Action.getSuccessChance()");return Math.min(1,a/n)},G.prototype.attempt=function(e){return Math.random()=this.getSuccessesNeededForNextLevel(e)&&++this.maxLevel},G.prototype.toJSON=function(){return Object(_.Generic_toJSON)("Action",this)},G.fromJSON=function(e){return Object(_.Generic_fromJSON)(G,e.data)},_.Reviver.constructors.Action=G;const K={},q=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 $(e={}){e.name&&(this.name=e.name),e.type&&(this.type=e.type)}function Y(e={}){G.call(this,e)}function z(e={}){G.call(this,e),this.reqdRank=e.reqdRank?e.reqdRank:100,this.teamCount=e.teamCount?e.teamCount:0}function V(e={}){z.call(this,e),this.count=1,this.countGrowth=0}$.prototype.toJSON=function(){return Object(_.Generic_toJSON)("ActionIdentifier",this)},$.fromJSON=function(e){return Object(_.Generic_fromJSON)($,e.data)},_.Reviver.constructors.ActionIdentifier=$,Y.prototype=Object.create(G.prototype),Y.prototype.toJSON=function(){return Object(_.Generic_toJSON)("Contract",this)},Y.fromJSON=function(e){return Object(_.Generic_fromJSON)(Y,e.data)},_.Reviver.constructors.Contract=Y,z.prototype=Object.create(G.prototype),z.prototype.toJSON=function(){return Object(_.Generic_toJSON)("Operation",this)},z.fromJSON=function(e){return Object(_.Generic_fromJSON)(z,e.data)},_.Reviver.constructors.Operation=z,V.prototype=Object.create(G.prototype),V.prototype.toJSON=function(){return Object(_.Generic_toJSON)("BlackOperation",this)},V.fromJSON=function(e){return Object(_.Generic_fromJSON)(V,e.data)},_.Reviver.constructors.BlackOperation=V;const J={};function X(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(C.getRandomInt)(240,600),this.actionTimeToComplete=0,this.actionTimeCurrent=0;var t=q.Idle;this.action=new $({type:t}),this.cities={};for(var n=0;n
Does NOT require stamina."}),K[e="Recruitment"]=new G({name:e,desc:"Attempt to recruit members for your Bladeburner team. These members can help you conduct operations.

Does NOT require stamina."}),K[e="Diplomacy"]=new G({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."}),K[e="Hyperbolic Regeneration Chamber"]=new G({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.

"}),J["Operation Typhoon"]=new V({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}),J["Operation Zero"]=new V({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}),J["Operation X"]=new V({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}),J["Operation Titan"]=new V({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}),J["Operation Ares"]=new V({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}),J["Operation Archangel"]=new V({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}),J["Operation Juggernaut"]=new V({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}),J["Operation Red Dragon"]=new V({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}),J["Operation K"]=new V({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}),J["Operation Deckard"]=new V({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}),J["Operation Tyrell"]=new V({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}),J["Operation Wallace"]=new V({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}),J["Operation Shoulder of Orion"]=new V({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}),J["Operation Hyron"]=new V({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}),J["Operation Morpheus"]=new V({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}),J["Operation Ion Storm"]=new V({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}),J["Operation Annihilus"]=new V({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}),J["Operation Ultron"]=new V({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}),J["Operation Centurion"]=new V({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}}),J["Operation Vindictus"]=new V({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}}),J["Operation Daedalus"]=new V({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()}X.prototype.prestige=function(){this.resetAction();var e=c.Factions.Bladeburners;this.rank>=25&&Object(u.joinFaction)(e)},X.prototype.create=function(){this.contracts.Tracking=new Y({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(C.getRandomInt)(25,150),countGrowth:Object(C.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 Y({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(C.getRandomInt)(5,150),countGrowth:Object(C.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 Y({name:"Retirement",desc:"Hunt down and retire (kill) rogue Synthoids.

Successfully completing 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(C.getRandomInt)(5,150),countGrowth:Object(C.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 z({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(C.getRandomInt)(1,100),countGrowth:Object(C.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 z({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(C.getRandomInt)(1,100),countGrowth:Object(C.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 z({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(C.getRandomInt)(1,150),countGrowth:Object(C.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 z({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(C.getRandomInt)(1,150),countGrowth:Object(C.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 z({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(C.getRandomInt)(1,150),countGrowth:Object(C.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 z({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(C.getRandomInt)(1,150),countGrowth:Object(C.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})},X.prototype.storeCycles=function(e=1){this.storedCycles+=e},X.prototype.process=function(){if(!1===h.b&&this.blackops.hasOwnProperty("Operation Daedalus"))return Object(h.a)(p.a.bitNodeN);if(!1===a.Augmentations[r.AugmentationNames.BladesSimulacrum].owned&&p.a.isWorking){if(this.action.type!==q.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(g.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 $({type:this.automateActionHigh.type,name:this.automateActionHigh.name}),this.startAction(this.action)))),m.routing.isOn(m.Page.Bladeburner)&&this.updateContent()}},X.prototype.calculateMaxStamina=function(){var e=p.a.agility*this.skillMultipliers.effAgi,t=Math.pow(e,.8)+this.staminaBonus;if(t*=this.skillMultipliers.stamina,t*=p.a.bladeburner_max_stamina_mult,isNaN(t))throw new Error("Max Stamina calculated to be NaN in Bladeburner.calculateMaxStamina()");this.maxStamina=t},X.prototype.calculateStaminaGainPerSecond=function(){var e=p.a.agility*this.skillMultipliers.effAgi;return(.0085+this.maxStamina/7e4)*Math.pow(e,.17)*(this.skillMultipliers.stamina*p.a.bladeburner_stamina_gain_mult)},X.prototype.calculateStaminaPenalty=function(){return Math.min(1,this.stamina/(.5*this.maxStamina))},X.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*p.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}},X.prototype.getCurrentCity=function(){var e=this.cities[this.city];if(!(e instanceof j))throw new Error("Bladeburner.getCurrentCity() did not properly return a City object");return e},X.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}},X.prototype.updateSkillMultipliers=function(){for(var e in this.resetSkillMultipliers(),this.skills)if(this.skills.hasOwnProperty(e)){var t=U[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}},X.prototype.completeAction=function(){switch(this.action.type){case q.Contract:case q.Operation:try{var e=this.action.type===q.Operation;if(null==(g=this.getActionObject(this.action)))throw new Error("Failed to get Contract/Operation Object for: "+this.action.name);var t=g.getDifficulty(),n=Math.pow(t,.28)+t/650,a=Math.pow(g.rewardFac,g.level-1);if(this.stamina-=.285*n,this.stamina<0&&(this.stamina=0),g.attempt(this)){this.gainActionStats(g,!0),++g.successes,--g.count;var r=0;if(e||(r=25e4*a*this.skillMultipliers.money,p.a.gainMoney(r),p.a.recordMoneySource(r,"bladeburner")),e?g.setMaxLevel(2.5):g.setMaxLevel(3),g.rankGain){var s=Object(b.addOffset)(g.rankGain*a*i.BitNodeMultipliers.BladeburnerRank,10);this.changeRank(s),e&&this.logging.ops?this.log(g.name+" successfully completed! Gained "+Object(y.formatNumber)(s,3)+" rank"):!e&&this.logging.contracts&&this.log(g.name+" contract successfully completed! Gained "+Object(y.formatNumber)(s,3)+" rank and "+d.numeralWrapper.format(r,"$0.000a"))}e?this.completeOperation(!0):this.completeContract(!0)}else{this.gainActionStats(g,!1),++g.failures;var l=0,c=0;g.rankLoss&&(l=Object(b.addOffset)(g.rankLoss*a,10),this.changeRank(-1*l)),g.hpLoss&&(c=g.hpLoss*n,c=Math.ceil(Object(b.addOffset)(c,10)),this.hpLost+=c,p.a.takeDamage(c)&&(++this.numHosp,this.moneyLost+=o.CONSTANTS.HospitalCostPerHp*p.a.max_hp));var u="";l>0&&(u+="Lost "+Object(y.formatNumber)(l,3)+" rank."),c>0&&(u+="Took "+Object(y.formatNumber)(c,0)+" damage."),e&&this.logging.ops?this.log(g.name+" failed! "+u):!e&&this.logging.contracts&&this.log(g.name+" contract failed! "+u),e?this.completeOperation(!1):this.completeContract(!1)}g.autoLevel&&(g.level=g.maxLevel),this.startAction(this.action)}catch(e){Object(k.exceptionAlert)(e)}break;case q.BlackOp:case q.BlackOperation:try{var g;if(null==(g=this.getActionObject(this.action))||!(g instanceof V))throw new Error("Failed to get BlackOperation Object for: "+this.action.name);t=g.getDifficulty(),n=Math.pow(t,.28)+t/650;this.stamina-=.285*n,this.stamina<0&&(this.stamina=0);var _,f=g.teamCount;if(g.attempt(this)){this.gainActionStats(g,!0),g.count=0,this.blackops[g.name]=!0;var v=0;if(g.rankGain&&(v=Object(b.addOffset)(g.rankGain*i.BitNodeMultipliers.BladeburnerRank,10),this.changeRank(v)),_=Math.ceil(f/2),"Operation Daedalus"===g.name)return this.resetAction(),Object(h.a)(p.a.bitNodeN);m.routing.isOn(m.Page.Bladeburner)&&this.createActionAndSkillsContent(),this.logging.blackops&&this.log(g.name+" successful! Gained "+Object(y.formatNumber)(v,1)+" rank")}else{this.gainActionStats(g,!1);var E=0;c=0;g.rankLoss&&(E=Object(b.addOffset)(g.rankLoss,10),this.changeRank(-1*E)),g.hpLoss&&(c=g.hpLoss*n,c=Math.ceil(Object(b.addOffset)(c,10)),p.a.takeDamage(c)&&(++this.numHosp,this.moneyLost+=o.CONSTANTS.HospitalCostPerHp*p.a.max_hp)),_=Math.floor(f),this.logging.blackops&&this.log(g.name+" failed! Lost "+Object(y.formatNumber)(E,1)+" rank and took "+Object(y.formatNumber)(c,0)+" damage")}if(this.resetAction(),f>=1){var S=Object(C.getRandomInt)(1,_);this.teamSize-=S,this.teamLost+=S,this.logging.blackops&&this.log("You lost "+Object(y.formatNumber)(S,0)+" team members during "+g.name)}}catch(e){Object(k.exceptionAlert)(e)}break;case q.Training:this.stamina-=.1425;var T=30*p.a.strength_exp_mult,O=30*p.a.defense_exp_mult,M=30*p.a.dexterity_exp_mult,P=30*p.a.agility_exp_mult,A=.04*this.skillMultipliers.stamina;p.a.gainStrengthExp(T),p.a.gainDefenseExp(O),p.a.gainDexterityExp(M),p.a.gainAgilityExp(P),this.staminaBonus+=A,this.logging.general&&this.log("Training completed. Gained: "+Object(y.formatNumber)(T,1)+" str exp, "+Object(y.formatNumber)(O,1)+" def exp, "+Object(y.formatNumber)(M,1)+" dex exp, "+Object(y.formatNumber)(P,1)+" agi exp, "+Object(y.formatNumber)(A,3)+" max stamina"),this.startAction(this.action);break;case q.FieldAnalysis:case q["Field Analysis"]:var w=.04*Math.pow(p.a.hacking_skill,.3)+.04*Math.pow(p.a.intelligence,.9)+.02*Math.pow(p.a.charisma,.3);if(w*=p.a.bladeburner_analysis_mult,isNaN(w)||w<0)throw new Error("Field Analysis Effectiveness calculated to be NaN or negative");var x=20*p.a.hacking_exp_mult,N=20*p.a.charisma_exp_mult;p.a.gainHackingExp(x),p.a.gainIntelligenceExp(.001),p.a.gainCharismaExp(N),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(y.formatNumber)(x,1)+" hacking exp, and "+Object(y.formatNumber)(N,1)+" charisma exp"),this.startAction(this.action);break;case q.Recruitment:var R=this.getRecruitmentSuccessChance();if(Math.random()=1){n=e?Math.ceil(a/2):Math.floor(a);var r=Object(C.getRandomInt)(0,n);this.teamSize-=r,this.teamLost+=r,this.logging.ops&&r>0&&this.log("Lost "+Object(y.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(C.getRandomInt)(-10,-5)/10;i.changePopulationByPercentage(o,{nonZero:!0})}i.changeChaosByPercentage(Object(C.getRandomInt)(1,5));break;case"Stealth Retirement Operation":e&&i.changePopulationByPercentage(-.5,{changeEstEqually:!0,nonZero:!0}),i.changeChaosByPercentage(Object(C.getRandomInt)(-3,-1));break;case"Assassination":e&&i.changePopulationByCount(-1,{estChange:-1}),i.changeChaosByPercentage(Object(C.getRandomInt)(-5,5));break;default:throw new Error("Invalid Action name in completeOperation: "+this.action.name)}},X.prototype.getRecruitmentTime=function(){var e=p.a.charisma*this.skillMultipliers.effCha,t=Math.pow(e,.81)+e/90;return Math.max(10,Math.round(300-t))},X.prototype.getRecruitmentSuccessChance=function(){return Math.pow(p.a.charisma,.45)/(this.teamSize+1)},X.prototype.getDiplomacyEffectiveness=function(){return(100-(Math.pow(p.a.charisma,.045)+p.a.charisma/1e3))/100},X.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;p.a.gainHackingExp(o*e.weights.hack*p.a.hacking_exp_mult*l),p.a.gainStrengthExp(o*e.weights.str*p.a.strength_exp_mult*l),p.a.gainDefenseExp(o*e.weights.def*p.a.defense_exp_mult*l),p.a.gainDexterityExp(o*e.weights.dex*p.a.dexterity_exp_mult*l),p.a.gainAgilityExp(o*e.weights.agi*p.a.agility_exp_mult*l),p.a.gainCharismaExp(o*e.weights.cha*p.a.charisma_exp_mult*l),p.a.gainIntelligenceExp(s*e.weights.int*l)},X.prototype.randomEvent=function(){var e=Math.random(),t=I[Object(C.getRandomInt)(0,5)],n=this.cities[t];if(!(n instanceof j))throw new Error("sourceCity was not a City object in Bladeburner.randomEvent()");for(var a=I[Object(C.getRandomInt)(0,5)];a===t;)a=I[Object(C.getRandomInt)(0,5)];var r=this.cities[a];if(!(n instanceof j&&r instanceof j))throw new Error("sourceCity/destCity was not a City object in Bladeburner.randomEvent()");if(e<=.05){++n.comms;var i=Object(C.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(C.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(C.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(C.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(C.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(C.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")}},X.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(C.getRandomInt)(2,4),--a.comms,++n.comms);var o=Math.round(a.pop*i);a.pop-=o,n.pop+=o};let Q={};X.prototype.initializeDomElementRefs=function(){Q={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}},X.prototype.createContent=function(){Q.bladeburnerDiv=Object(P.createElement)("div",{id:"bladeburner-container",position:"fixed",class:"generic-menupage-container"}),Q.overviewConsoleParentDiv=Object(P.createElement)("div",{height:"60%",display:"block",position:"relative"}),Q.overviewDiv=Object(P.createElement)("div",{width:"30%",display:"inline-block",border:"1px solid white"}),Q.actionAndSkillsDiv=Object(P.createElement)("div",{height:"60%",width:"70%",display:"block",border:"1px solid white",margin:"6px",padding:"6px"}),Q.currentTab="general",this.createOverviewContent(),this.createActionAndSkillsContent(),Q.consoleDiv=Object(P.createElement)("div",{class:"bladeburner-console-div",clickListener:()=>(Q.consoleInput instanceof Element&&Q.consoleInput.focus(),!1)}),Q.consoleTable=Object(P.createElement)("table",{class:"bladeburner-console-table"}),Q.consoleInputRow=Object(P.createElement)("tr",{class:"bladeburner-console-input-row",id:"bladeubrner-console-input-row"}),Q.consoleInputCell=Object(P.createElement)("td",{class:"bladeburner-console-input-cell"}),Q.consoleInputHeader=Object(P.createElement)("pre",{innerText:"> "}),Q.consoleInput=Object(P.createElement)("input",{type:"text",class:"bladeburner-console-input",tabIndex:1,onfocus:()=>{Q.consoleInput.value=Q.consoleInput.value}}),Q.consoleInputCell.appendChild(Q.consoleInputHeader),Q.consoleInputCell.appendChild(Q.consoleInput),Q.consoleInputRow.appendChild(Q.consoleInputCell),Q.consoleTable.appendChild(Q.consoleInputRow),Q.consoleDiv.appendChild(Q.consoleTable),Q.overviewConsoleParentDiv.appendChild(Q.overviewDiv),Q.overviewConsoleParentDiv.appendChild(Q.consoleDiv),Q.bladeburnerDiv.appendChild(Q.overviewConsoleParentDiv),Q.bladeburnerDiv.appendChild(Q.actionAndSkillsDiv);const e=Object(P.createElement)("div");if(e.innerHTML=`${N}= This action requires stealth, ${R} = This action involves retirement`,Q.bladeburnerDiv.appendChild(e),document.getElementById("entire-game-container").appendChild(Q.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(g.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.")}}),Q.overviewGen1=Object(P.createElement)("p",{display:"block"}),Q.overviewEstPop=Object(P.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."}),Q.overviewEstPopHelpTip=Object(P.createElement)("div",{innerText:"?",class:"help-tip",clickListener:()=>{Object(g.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.")}}),Q.overviewEstComms=Object(P.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."}),Q.overviewChaos=Object(P.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."}),Q.overviewBonusTime=Object(P.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."}),Q.overviewSkillPoints=Object(P.createElement)("p",{display:"block"}),Q.overviewAugSuccessMult=Object(P.createElement)("p",{display:"block"}),Q.overviewAugMaxStaminaMult=Object(P.createElement)("p",{display:"block"}),Q.overviewAugStaminaGainMult=Object(P.createElement)("p",{display:"block"}),Q.overviewAugAnalysisMult=Object(P.createElement)("p",{display:"block"}),Q.overviewDiv.appendChild(Q.overviewRank),Object(M.appendLineBreaks)(Q.overviewDiv,1),Q.overviewDiv.appendChild(Q.overviewStamina),Q.overviewDiv.appendChild(Q.overviewStaminaHelpTip),Q.overviewDiv.appendChild(Q.overviewGen1),Q.overviewDiv.appendChild(Q.overviewEstPop),Q.overviewDiv.appendChild(Q.overviewEstPopHelpTip),Object(M.appendLineBreaks)(Q.overviewDiv,1),Q.overviewDiv.appendChild(Q.overviewEstComms),Object(M.appendLineBreaks)(Q.overviewDiv,1),Q.overviewDiv.appendChild(Q.overviewChaos),Object(M.appendLineBreaks)(Q.overviewDiv,2),Q.overviewDiv.appendChild(Q.overviewBonusTime),Q.overviewDiv.appendChild(Q.overviewSkillPoints),Object(M.appendLineBreaks)(Q.overviewDiv,1),Q.overviewDiv.appendChild(Q.overviewAugSuccessMult),Q.overviewDiv.appendChild(Q.overviewAugMaxStaminaMult),Q.overviewDiv.appendChild(Q.overviewAugStaminaGainMult),Q.overviewDiv.appendChild(Q.overviewAugAnalysisMult),Object(M.appendLineBreaks)(Q.overviewDiv,1),Q.overviewDiv.appendChild(Object(P.createElement)("a",{innerHTML:"Travel",class:"a-link-button",display:"inline-block",clickListener:()=>{var e="bladeburner-travel-popup-cancel-btn",t=[];t.push(Object(P.createElement)("a",{innerText:"Cancel",class:"a-link-button",clickListener:()=>(Object(x.removeElementById)(e),!1)})),t.push(Object(P.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=I[a],Object(x.removeElementById)(e),n.updateOverviewContent(),!1)}))}(this,n);Object(A.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");Q.overviewDiv.appendChild(Object(P.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.displayFactionContent)("Bladeburners")):this.rank>=25?(Object(u.joinFaction)(e),Object(g.dialogBoxCreate)("Congratulations! You were accepted into the Bladeburners faction"),Object(O.removeChildrenFromElement)(Q.overviewDiv),this.createOverviewContent()):Object(g.dialogBoxCreate)("You need a rank of 25 to join the Bladeburners Faction!"),!1)}))}Q.overviewDiv.appendChild(Object(P.createElement)("br")),Q.overviewDiv.appendChild(Object(P.createElement)("br")),this.updateOverviewContent()},X.prototype.createActionAndSkillsContent=function(){null==Q.currentTab&&(Q.currentTab="general"),Object(O.removeChildrenFromElement)(Q.actionAndSkillsDiv),Object(v.clearObject)(Q.generalActions),Object(v.clearObject)(Q.contracts),Object(v.clearObject)(Q.operations),Object(v.clearObject)(Q.blackops),Object(v.clearObject)(Q.skills);for(var e=Q.currentTab.toLowerCase(),t=["General","Contracts","Operations","BlackOps","Skills"],n=0;n(Q.currentTab=e[t].toLowerCase(),n.createActionAndSkillsContent(),!1)}))}(t,n,this,e);switch(Q.actionsAndSkillsDesc=Object(P.createElement)("p",{display:"block",margin:"4px",padding:"4px"}),Object(O.removeChildrenFromElement)(Q.actionsAndSkillsList),Q.actionsAndSkillsList=Object(P.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(),Q.actionAndSkillsDiv.appendChild(Q.actionsAndSkillsDesc),Q.actionAndSkillsDiv.appendChild(Q.actionsAndSkillsList)},X.prototype.createGeneralActionsContent=function(){if(null==Q.actionsAndSkillsList||null==Q.actionsAndSkillsDesc)throw new Error("Bladeburner.createGeneralActionsContent called with either DomElems.actionsAndSkillsList or DomElems.actionsAndSkillsDesc = null");for(var e in Q.actionsAndSkillsDesc.innerText="These are generic actions that will assist you in your Bladeburner duties. They will not affect your Bladeburner rank in any way.",K)K.hasOwnProperty(e)&&(Q.generalActions[e]=Object(P.createElement)("div",{class:"bladeburner-action",name:e}),Q.actionsAndSkillsList.appendChild(Q.generalActions[e]))},X.prototype.createContractsContent=function(){if(null==Q.actionsAndSkillsList||null==Q.actionsAndSkillsDesc)throw new Error("Bladeburner.createContractsContent called with either DomElems.actionsAndSkillsList or DomElems.actionsAndSkillsDesc = null");for(var e in Q.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)&&(Q.contracts[e]=Object(P.createElement)("div",{class:"bladeburner-action",name:e}),Q.actionsAndSkillsList.appendChild(Q.contracts[e]))},X.prototype.createOperationsContent=function(){if(null==Q.actionsAndSkillsList||null==Q.actionsAndSkillsDesc)throw new Error("Bladeburner.createOperationsContent called with either DomElems.actionsAndSkillsList or DomElems.actionsAndSkillsDesc = null");for(var e in Q.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)&&(Q.operations[e]=Object(P.createElement)("div",{class:"bladeburner-action",name:e}),Q.actionsAndSkillsList.appendChild(Q.operations[e]))},X.prototype.createBlackOpsContent=function(){if(null==Q.actionsAndSkillsList||null==Q.actionsAndSkillsDesc)throw new Error("Bladeburner.createBlackOpsContent called with either DomElems.actionsAndSkillsList or DomElems.actionsAndSkillsDesc = null");Q.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 J)J.hasOwnProperty(t)&&e.push(J[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]]||(Q.blackops[e[n].name]=Object(P.createElement)("div",{class:"bladeburner-action",name:e[n].name}),Q.actionsAndSkillsList.appendChild(Q.blackops[e[n].name]))},X.prototype.createSkillsContent=function(){if(null==Q.actionsAndSkillsList||null==Q.actionsAndSkillsDesc)throw new Error("Bladeburner.createSkillsContent called with either DomElems.actionsAndSkillsList or DomElems.actionsAndSkillsDesc = null");Q.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":Q.actionsAndSkillsDesc.innerHTML+="Stealth Success Chance: x"+n+"
";break;case"successChanceKill":Q.actionsAndSkillsDesc.innerHTML+="Retirement Success Chance: x"+n+"
";break;case"successChanceContract":Q.actionsAndSkillsDesc.innerHTML+="Contract Success Chance: x"+n+"
";break;case"successChanceOperation":Q.actionsAndSkillsDesc.innerHTML+="Operation Success Chance: x"+n+"
";break;case"successChanceEstimate":Q.actionsAndSkillsDesc.innerHTML+="Synthoid Data Estimate: x"+n+"
";break;case"actionTime":Q.actionsAndSkillsDesc.innerHTML+="Action Time: x"+n+"
";break;case"effHack":Q.actionsAndSkillsDesc.innerHTML+="Hacking Skill: x"+n+"
";break;case"effStr":Q.actionsAndSkillsDesc.innerHTML+="Strength: x"+n+"
";break;case"effDef":Q.actionsAndSkillsDesc.innerHTML+="Defense: x"+n+"
";break;case"effDex":Q.actionsAndSkillsDesc.innerHTML+="Dexterity: x"+n+"
";break;case"effAgi":Q.actionsAndSkillsDesc.innerHTML+="Agility: x"+n+"
";break;case"effCha":Q.actionsAndSkillsDesc.innerHTML+="Charisma: x"+n+"
";break;case"effInt":Q.actionsAndSkillsDesc.innerHTML+="Intelligence: x"+n+"
";break;case"stamina":Q.actionsAndSkillsDesc.innerHTML+="Stamina: x"+n+"
";break;case"money":Q.actionsAndSkillsDesc.innerHTML+="Contract Money: x"+n+"
";break;case"expGain":Q.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 Q.skillPointsDisplay=Object(P.createElement)("p",{innerHTML:"
Skill Points: "+Object(y.formatNumber)(this.skillPoints,0)+""}),Q.actionAndSkillsDiv.appendChild(Q.skillPointsDisplay),U)U.hasOwnProperty(a)&&(Q.skills[a]=Object(P.createElement)("div",{class:"bladeburner-action",name:a}),Q.actionsAndSkillsList.appendChild(Q.skills[a]))},X.prototype.updateContent=function(){this.updateOverviewContent(),this.updateActionAndSkillsContent()},X.prototype.updateOverviewContent=function(){m.routing.isOn(m.Page.Bladeburner)&&(Q.overviewRank.childNodes[0].nodeValue="Rank: "+Object(y.formatNumber)(this.rank,2),Q.overviewStamina.innerText="Stamina: "+Object(y.formatNumber)(this.stamina,3)+" / "+Object(y.formatNumber)(this.maxStamina,3),Q.overviewGen1.innerHTML="Stamina Penalty: "+Object(y.formatNumber)(100*(1-this.calculateStaminaPenalty()),1)+"%

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

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

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

"})),e.appendChild(Object(P.createElement)("p",{display:"block",color:o?"white":"red",innerHTML:"Required Rank: "+Object(y.formatNumber)(t.reqdRank,0)+"
"})),e.appendChild(Object(P.createElement)("p",{display:"inline-block",innerHTML:`Estimated Success Chance: ${Object(y.formatNumber)(100*r,1)}% ${t.isStealth?N:""}${t.isKill?R:""}\n`+"Time Required(s): "+Object(y.formatNumber)(i,0)}))}},X.prototype.updateSkillsUIElement=function(e,t){Object(O.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(P.createElement)("h2",{innerText:t.name+" (Lvl "+a+")",display:"inline-block"}));var i=this.skillPoints>=r,o=!!t.maxLvl&&a>=t.maxLvl;e.appendChild(Object(P.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!=Q.consoleDiv&&(e("#bladeubrner-console-input-row").before(''+t+""),Q.consoleTable.childNodes.length>100&&Q.consoleTable.removeChild(Q.consoleTable.firstChild),this.updateConsoleScroll())},X.prototype.updateConsoleScroll=function(){Q.consoleDiv.scrollTop=Q.consoleDiv.scrollHeight},X.prototype.resetConsoleInput=function(){Q.consoleInput.value=""},X.prototype.clearConsole=function(){for(;Q.consoleTable.childNodes.length>1;)Q.consoleTable.removeChild(Q.consoleTable.firstChild);this.consoleLogs.length=0},X.prototype.log=function(e){this.postToConsole(`[${Object(S.getTimestamp)()}] ${e}`)},X.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)),L=this.consoleHistory.length;for(var t=e.split(";"),n=0;n"))}},X.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]")}},X.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(U),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(y.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")}},X.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!=K[t]?(this.action.type=q[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=q.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=q.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!=J[t]?(this.action.type=q.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]")}},X.prototype.getActionIdFromTypeAndName=function(e="",t=""){if(""===e||""===t)return null;var n=new $,a=e.toLowerCase().trim(),r=t.toLowerCase().trim();switch(a){case"contract":case"contracts":case"contr":return n.type=q.Contract,this.contracts.hasOwnProperty(t)?(n.name=t,n):null;case"operation":case"operations":case"op":case"ops":return n.type=q.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=q.BlackOp,J.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=q.Training,n.name="Training";break;case"recruitment":case"recruit":n.type=q.Recruitment,n.name="Recruitment";break;case"field analysis":case"fieldanalysis":n.type=q["Field Analysis"],n.name="Field Analysis";break;case"diplomacy":n.type=q.Diplomacy,n.name="Diplomacy";break;case"hyperbolic regeneration chamber":n.type=q["Hyperbolic Regeneration Chamber"],n.name="Hyperbolic Regeneration Chamber";break;default:return null}return n}},X.prototype.getTypeAndNameFromActionId=function(e){var t={};let n=Object.keys(q);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 J)J.hasOwnProperty(e)&&i.push(e);i.sort(function(e,t){return J[e].reqdRank-J[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}},X.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 q.Contract:case q.Operation:case q.BlackOp:case q.BlackOperation:return i.getActionTime(this);case q.Training:case q["Field Analysis"]:case q.FieldAnalysis:return 30;case q.Recruitment:return this.getRecruitmentTime();default:return n.log(a),-1}},X.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 q.Contract:case q.Operation:case q.BlackOp:case q.BlackOperation:return i.getSuccessChance(this,{est:!0});case q.Training:case q["Field Analysis"]:case q.FieldAnalysis:return 1;case q.Recruitment:return this.getRecruitmentSuccessChance();default:return n.log(a),-1}},X.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 q.Contract:case q.Operation:return Math.floor(i.count);case q.BlackOp:case q.BlackOperation:return null!=this.blackops[t]?0:1;case q.Training:case q["Field Analysis"]:case q.FieldAnalysis:return 1/0;default:return n.log(a),-1}},X.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:U.hasOwnProperty(e)?null==this.skills[e]?0:this.skills[e]:(t.log(n),-1)},X.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(!U.hasOwnProperty(e))return t.log(n),-1;var a=U[e];return null==this.skills[e]?a.calculateCost(0):a.calculateCost(this.skills[e])},X.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(!U.hasOwnProperty(e))return t.log(n),!1;var a=U[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.joinFaction)(t),e.shouldLog("joinBladeburnerFaction")&&e.log("Joined Bladeburners Faction"),m.routing.isOn(m.Page.Bladeburner)&&(Object(O.removeChildrenFromElement)(Q.overviewDiv),this.createOverviewContent()),!0):(e.shouldLog("joinBladeburnerFaction")&&e.log("Failed to join Bladeburners Faction because you do not have the required 25 rank"),!1))},X.prototype.toJSON=function(){return Object(_.Generic_toJSON)("Bladeburner",this)},X.fromJSON=function(e){return Object(_.Generic_fromJSON)(X,e.data)},_.Reviver.constructors.Bladeburner=X}).call(this,n(82))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=n(16);t.SpecialServerNames={FulcrumSecretTechnologies:"Fulcrum Secret Technologies Server",CyberSecServer:"CyberSec Server",NiteSecServer:"NiteSec Server",TheBlackHandServer:"The Black Hand Server",BitRunnersServer:"BitRunners Server",TheDarkArmyServer:"The Dark Army Server",DaedalusServer:"Daedalus Server",WorldDaemon:"w0r1d_d43m0n"};class r{static fromJSON(e){return a.Generic_fromJSON(r,e.data)}constructor(){}addIp(e,t){this[e]=t}toJSON(){return a.Generic_toJSON("SpecialServerIpsMap",this)}}t.SpecialServerIpsMap=r,a.Reviver.constructors.SpecialServerIpsMap=r,t.SpecialServerIps=new r,t.prestigeSpecialServerIps=function(){for(var e in t.SpecialServerIps)delete t.SpecialServerIps[e];t.SpecialServerIps=new r},t.loadSpecialServerIps=function(e){t.SpecialServerIps=JSON.parse(e,a.Reviver)},t.initSpecialServerIps=function(){t.SpecialServerIps=new r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=n(50),r=n(86);t.removeChildrenFromElement=function(e){if(null!==e)try{const t=a.isString(e)?r.getElementById(e):e;if(t instanceof Element)for(;null!==t.firstChild;)t.removeChild(t.firstChild)}catch(e){return void console.debug(e)}}},function(e,t,n){"use strict";n.d(t,"d",function(){return m}),n.d(t,"c",function(){return g}),n.d(t,"b",function(){return f}),n.d(t,"a",function(){return d});var a=n(13),r=n(0),i=n(18),o=n(33),s=n(46),l=n(23),c=n(4),u=n(37),p=n(25);const h=["Start","GoToCharacterPage","CharacterPage","CharacterGoToTerminalPage","TerminalIntro","TerminalHelp","TerminalLs","TerminalScan","TerminalScanAnalyze1","TerminalScanAnalyze2","TerminalConnect","TerminalAnalyze","TerminalNuke","TerminalManualHack","TerminalHackingMechanics","TerminalCreateScript","TerminalTypeScript","TerminalFree","TerminalRunScript","TerminalGoToActiveScriptsPage","ActiveScriptsPage","ActiveScriptsToTerminal","TerminalTailScript","GoToHacknetNodesPage","HacknetNodesIntroduction","HacknetNodesGoToWorldPage","WorldDescription","TutorialPageInfo","End"],m={};for(let e=0;em.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.loadLocationContent(),f(),!1});break;case m.WorldDescription:a.Engine.loadLocationContent(),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});const a=n(2);t.SourceFileFlags=Array(a.CONSTANTS.TotalNumBitNodes+1),t.updateSourceFileFlags=function(e){for(let e=0;e=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";n.d(t,"b",function(){return o}),n.d(t,"a",function(){return s});var a=n(0),r=n(66),i=n(6);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});const a=n(342),r=n(121);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";var a=this&&this.__awaiter||function(e,t,n,a){return new(n||(n=Promise))(function(r,i){function o(e){try{l(a.next(e))}catch(e){i(e)}}function s(e){try{l(a.throw(e))}catch(e){i(e)}}function l(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(o,s)}l((a=a.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});const r=n(337),i=n(16),o=n(28),s=n(4),l=n(37),c=n(25);class u{constructor(e,t,n,a,r,i){this.name=e,this.desc=t,this.generate=n,this.solver=a,this.difficulty=r,this.numTries=i}}t.CodingContractType=u,t.CodingContractTypes={};for(const e of r.codingContractTypesMetadata)t.CodingContractTypes[e.name]=new u(e.name,e.desc,e.gen,e.solver,e.difficulty,e.numTries);var p;console.info(`${Object.keys(t.CodingContractTypes).length} Coding Contract Types loaded`),function(e){e[e.FactionReputation=0]="FactionReputation",e[e.FactionReputationAll=1]="FactionReputationAll",e[e.CompanyReputation=2]="CompanyReputation",e[e.Money=3]="Money"}(t.CodingContractRewardType||(t.CodingContractRewardType={})),function(e){e[e.Success=0]="Success",e[e.Failure=1]="Failure",e[e.Cancelled=2]="Cancelled"}(p=t.CodingContractResult||(t.CodingContractResult={}));class h{constructor(e="",n="Find Largest Prime Factor",a=null){if(this.tries=0,this.fn=e,this.fn.endsWith(".cct")||(this.fn+=".cct"),null==t.CodingContractTypes[n])throw new Error(`Error: invalid contract type: ${n} please contact developer`);this.type=n,this.data=t.CodingContractTypes[n].generate(),this.reward=a}static fromJSON(e){return i.Generic_fromJSON(h,e.data)}getData(){return this.data}getDescription(){return t.CodingContractTypes[this.type].desc(this.data)}getDifficulty(){return t.CodingContractTypes[this.type].difficulty}getMaxNumTries(){return t.CodingContractTypes[this.type].numTries}getType(){return t.CodingContractTypes[this.type].name}isSolution(e){return t.CodingContractTypes[this.type].solver(this.data,e)}prompt(){return a(this,void 0,void 0,function*(){return new Promise((e,n)=>{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";Object.defineProperty(t,"__esModule",{value:!0}),t.isString=function(e){return"string"==typeof e||e instanceof String}},function(e,t,n){"use strict";n.r(t),n.d(t,"inviteToFaction",function(){return S}),n.d(t,"joinFaction",function(){return T}),n.d(t,"startHackingMission",function(){return O}),n.d(t,"displayFactionContent",function(){return M}),n.d(t,"purchaseAugmentationBoxCreate",function(){return P}),n.d(t,"hasAugmentationPrereqs",function(){return A}),n.d(t,"purchaseAugmentation",function(){return w}),n.d(t,"getNextNeurofluxLevel",function(){return x}),n.d(t,"processPassiveFactionRepGain",function(){return N});var a=n(1),r=n.n(a),i=n(69),o=n.n(i),s=n(211),l=n(11),c=n(109),u=n(5),p=n(19),h=n(2),m=n(13),d=n(70),g=n(12),_=n(73),f=n(0),y=n(18),b=n(10),v=n(9),E=n(210),k=(n(16),n(7)),C=n(34);function S(e){y.Settings.SuppressFactionInvites?(e.alreadyInvited=!0,f.a.factionInvitations.push(e.name),b.routing.isOn(b.Page.Factions)&&m.Engine.loadFactionsContent()):Object(E.a)(e)}function T(e){e.isMember=!0,f.a.factions.push(e.name);const t=e.getInfo();for(const e in t.enemies){const n=t.enemies[e];g.Factions[n]instanceof d.Faction&&(g.Factions[n].isBanned=!0)}}function O(e){const t=new _.a(e.playerReputation,e);Object(_.d)(!0,t),t.init()}function M(e,t=!1){const n=g.Factions[e];if(null==n)throw new Error(`Invalid factionName passed into displayFactionContent(): ${e}`);if(!n.isMember)throw new Error("Not a member of this faction. Cannot display faction information");o.a.render(r.a.createElement(s.FactionRoot,{engine:m.Engine,initiallyOnAugmentationsPage:t,faction:n,p:f.a,startHackingMissionFn:O}),m.Engine.Display.factionContent)}function P(e,t){const n=t.getInfo(),a=Object(C.yesNoBoxGetYesButton)();a.innerHTML="Purchase",a.addEventListener("click",function(){w(e,t)});const r=Object(C.yesNoBoxGetNoButton)();r.innerHTML="Cancel",r.addEventListener("click",function(){Object(C.yesNoBoxClose)()}),Object(C.yesNoBoxCreate)("

"+e.name+"


"+e.info+"


Would you like to purchase the "+e.name+" Augmentation for $"+Object(k.formatNumber)(e.baseCost*n.augmentationPriceMult,2)+"?")}function A(e){let t=!0;if(e.prereqs&&e.prereqs.length>0)for(let n=0;n1.01*t.ramUsage)throw Object(Y.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)},pe=function(e,n){return t.loadedFns[e]?0:(t.loadedFns[e]=!0,n)},de=function(e,n=""){var a=Object(L.getServer)(e);if(null==a)throw t.log(`ERROR: Invalid IP or hostname passed into ${n}()`),Object(Y.d)(t,`Invalid IP or hostname passed into ${n}() function`);return a},fe=function(e,n=""){return e instanceof M.HacknetServer&&(t.log(`ERROR: ${n}() failed because it does not work on Hacknet Servers`),!0)},Ee=function(e){if(isNaN(e))throw Object(Y.d)(t,"Invalid index specified for Hacknet Node: "+e);if(e<0||e>=w.a.hacknetNodes.length)throw Object(Y.d)(t,"Index specified for Hacknet Node is out-of-bounds: "+e);if(Object(S.h)()){const n=D.AllServers[w.a.hacknetNodes[e]];if(null==n)throw Object(Y.d)(t,`Could not get Hacknet Server for index ${e}. This is probably a bug, please report to game dev`);return n}return w.a.hacknetNodes[e]},Ce=function(e,t){return de(t,"getCodingContract").getContract(e)};return{hacknet:{numNodes:function(){return w.a.hacknetNodes.length},purchaseNode:function(){return Object(S.k)()},getPurchaseNodeCost:function(){return Object(S.h)()?Object(S.c)():Object(S.b)()},getNodeStats:function(e){const t=Ee(e),n=Object(S.h)(),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 Ee(e).purchaseLevelUpgrade(t,w.a)},upgradeRam:function(e,t){return Ee(e).purchaseRamUpgrade(t,w.a)},upgradeCore:function(e,t){return Ee(e).purchaseCoreUpgrade(t,w.a)},upgradeCache:function(e,t){if(!Object(S.h)())return!1;const n=Ee(e).purchaseCacheUpgrade(t,w.a);return n&&w.a.hashManager.updateCapacity(w.a),n},getLevelUpgradeCost:function(e,t){return Ee(e).calculateLevelUpgradeCost(t,w.a)},getRamUpgradeCost:function(e,t){return Ee(e).calculateRamUpgradeCost(t,w.a)},getCoreUpgradeCost:function(e,t){return Ee(e).calculateCoreUpgradeCost(t,w.a)},getCacheUpgradeCost:function(e,t){if(!Object(S.h)())return 1/0;return Ee(e).calculateCacheUpgradeCost(t)},numHashes:function(){return Object(S.h)()?w.a.hashManager.hashes:0},hashCost:function(e){return Object(S.h)()?w.a.hashManager.getUpgradeCost(e):1/0},spendHashes:function(e,t){return!!Object(S.h)()&&Object(S.l)(e,t)}},sprintf:ce,vsprintf:ue,scan:function(e=t.serverIp,a=!0){if(t.checkingRam)return pe("scan",g.CONSTANTS.ScriptScanRamCost);n("scan",g.CONSTANTS.ScriptScanRamCost);var r=Object(L.getServer)(e);if(null==r)throw Object(Y.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),w.a.gainMoney(s),t.scriptRef.onlineMoneyMade+=s,w.a.scriptProdSinceLastAug+=s,w.a.recordMoneySource(s,"hacking"),t.scriptRef.recordHack(r.ip,s,a),w.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(re.formatNumber)(s,2)+" and "+Object(re.formatNumber)(i,4)+" exp (t="+a+")"),r.fortify(g.CONSTANTS.ServerFortifyAmount*Math.min(a,n)),Promise.resolve(s)}return w.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(re.formatNumber)(o,4)+" exp (t="+a+")"),Promise.resolve(0)})},hackAnalyzeThreads:function(e,a){if(t.checkingRam)return pe("hackAnalyzeThreads",g.CONSTANTS.ScriptHackAnalyzeRamCost);n("hackAnalyzeThreads",g.CONSTANTS.ScriptHackAnalyzeRamCost);const r=de(e,"hackAnalyzeThreads");if(isNaN(a))throw Object(Y.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 pe("hackAnalyzePercent",g.CONSTANTS.ScriptHackAnalyzeRamCost);n("hackAnalyzePercent",g.CONSTANTS.ScriptHackAnalyzeRamCost);const a=de(e,"hackAnalyzePercent");return 100*Object(f.e)(a)},hackChance:function(e){if(t.checkingRam)return pe("hackChance",g.CONSTANTS.ScriptHackAnalyzeRamCost);n("hackChance",g.CONSTANTS.ScriptHackAnalyzeRamCost);const a=de(e,"hackChance");return Object(f.b)(a)},sleep:function(e){if(t.checkingRam)return 0;if(void 0===e)throw Object(Y.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(Y.e)(e,t).then(function(){return Promise.resolve(!0)})},grow:function(e){if(t.checkingRam)return pe("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(Y.d)(t,"grow() call has incorrect number of arguments. Takes 1 argument");var r=Object(L.getServer)(e);if(null==r)throw t.scriptRef.log("Cannot grow(). Invalid IP or hostname passed in: "+e),Object(Y.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(Y.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(re.formatNumber)(o,3)+" seconds (t="+a+")"),Object(Y.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(L.processSingleServerGrowth)(r,450*a,w.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(re.formatNumber)(i/e*100-100,6)+"%. Gained "+Object(re.formatNumber)(o,4)+" hacking exp (t="+a+")"),t.scriptRef.onlineExpGained+=o,w.a.gainHackingExp(o),Promise.resolve(i/e)})},growthAnalyze:function(e,a){if(t.checkingRam)return pe("growthAnalyze",g.CONSTANTS.ScriptGrowthAnalyzeRamCost);n("growthAnalyze",g.CONSTANTS.ScriptGrowthAnalyzeRamCost);const r=de(e,"growthAnalyze");if(isNaN(a))throw Object(Y.d)(t,`Invalid growth argument passed into growthAnalyze: ${a}. Must be numeric`);return Object(L.numCycleForGrowth)(r,Number(a),w.a)},weaken:function(e){if(t.checkingRam)return pe("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(Y.d)(t,"weaken() call has incorrect number of arguments. Takes 1 argument");var r=Object(L.getServer)(e);if(null==r)throw t.scriptRef.log("Cannot weaken(). Invalid IP or hostname passed in: "+e),Object(Y.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(Y.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(re.formatNumber)(o,3)+" seconds (t="+a+")"),Object(Y.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(re.formatNumber)(e,4)+" hacking exp (t="+a+")"),t.scriptRef.onlineExpGained+=e,w.a.gainHackingExp(e),Promise.resolve(g.CONSTANTS.ServerWeakenAmount*a)})},print:function(e){if(t.checkingRam)return 0;if(void 0===e)throw Object(Y.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(Y.d)(t,"tprint() call has incorrect number of arguments. Takes 1 argument");e.toString();Object(Z.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===ve[e])throw Object(Y.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===ve[e])throw Object(Y.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===ve[e])throw Object(Y.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(L.getServer)(n);if(null==a)throw t.log(`getScriptLogs() failed. Invalid IP or hostname passed in: ${n}`),Object(Y.d)(t,`getScriptLogs() failed. Invalid IP or hostname passed in: ${n}`);let r=[];for(let e=2;e{if(void 0===e)throw Object(Y.d)(t,"spawn() call has incorrect number of arguments. Usage: spawn(scriptname, numThreads, [arg1], [arg2]...)");if(isNaN(a)||a<0)throw Object(Y.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($.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(L.getServer)(t.serverIp);if(null==e)throw Object(Y.d)(t,"Error getting Server for this script in exit(). This is a bug please contact game dev");Object($.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 pe("scp",g.CONSTANTS.ScriptScpRamCost);if(n("scp",g.CONSTANTS.ScriptScpRamCost),2!==arguments.length&&3!==arguments.length)throw Object(Y.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){ke(t).scp(e,a,r)&&(i=!0)}),i}if(!e.endsWith(".lit")&&!Object(I.isScriptFilename)(e)&&!e.endsWith("txt"))throw Object(Y.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(Y.d)(t,"ERROR: scp() call has incorrect number of arguments. Takes 2 or 3 arguments");if(null==(o=Object(L.getServer)(r)))throw Object(Y.d)(t,`ERROR: Invalid hostname/ip passed into scp() command: ${r}`);if(null==(s=Object(L.getServer)(a)))throw Object(Y.d)(t,`ERROR: Invalid hostname/ip passed into scp() command: ${a}`)}else{if(null==a)throw Object(Y.d)(t,"ERROR: scp() call has incorrect number of arguments. Takes 2 or 3 arguments");if(void 0===e||void 0===a)throw Object(Y.d)(t,"ERROR: scp() call has incorrect number of arguments. Takes 2 or 3 arguments");if(null==(o=Object(L.getServer)(a)))throw Object(Y.d)(t,`ERROR: Invalid hostname/ip passed into scp() command: ${a}`);if(null==(s=Object(L.getServer)(t.serverIp)))throw Object(Y.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;w.a.loseMoney(i+g.CONSTANTS.StockMarketCommission);var s=o+i;return r.playerShares+=a,r.playerAvgPx=s/r.playerShares,X.routing.isOn(X.Page.StockMarket)&&Object(F.r)(r),null==t.disableLogs.ALL&&null==t.disableLogs.buyStock&&t.scriptRef.log("Bought "+Object(re.formatNumber)(a,0)+" shares of "+r.symbol+" at $"+Object(re.formatNumber)(r.price,2)+" per share"),r.price},sellStock:function(e,a){if(t.checkingRam)return pe("sellStock",g.CONSTANTS.ScriptBuySellStockRamCost);if(n("sellStock",g.CONSTANTS.ScriptBuySellStockRamCost),!w.a.hasTixApiAccess)throw Object(Y.d)(t,"You don't have TIX API Access! Cannot use sellStock()");var r=F.e[e];if(null==r)throw Object(Y.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;w.a.gainMoney(i);var o=(r.price-r.playerAvgPx)*a-g.CONSTANTS.StockMarketCommission;return isNaN(o)&&(o=0),t.scriptRef.onlineMoneyMade+=o,w.a.scriptProdSinceLastAug+=o,w.a.recordMoneySource(o,"stock"),r.playerShares-=a,0==r.playerShares&&(r.playerAvgPx=0),X.routing.isOn(X.Page.StockMarket)&&Object(F.r)(r),null==t.disableLogs.ALL&&null==t.disableLogs.sellStock&&t.scriptRef.log("Sold "+Object(re.formatNumber)(a,0)+" shares of "+r.symbol+" at $"+Object(re.formatNumber)(r.price,2)+" per share. Gained $"+Object(re.formatNumber)(i,2)),r.price},shortStock(e,a){if(t.checkingRam)return pe("shortStock",g.CONSTANTS.ScriptBuySellStockRamCost);if(n("shortStock",g.CONSTANTS.ScriptBuySellStockRamCost),!w.a.hasTixApiAccess)throw Object(Y.d)(t,"You don't have TIX API Access! Cannot use shortStock()");if(8!==w.a.bitNodeN&&!(_e&&be>=2))throw Object(Y.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=F.e[e];if(null==r)throw Object(Y.d)(t,"ERROR: Invalid stock symbol passed into shortStock()");return Object(F.p)(r,a,t)?r.price:0},sellShort(e,a){if(t.checkingRam)return pe("sellShort",g.CONSTANTS.ScriptBuySellStockRamCost);if(n("sellShort",g.CONSTANTS.ScriptBuySellStockRamCost),!w.a.hasTixApiAccess)throw Object(Y.d)(t,"You don't have TIX API Access! Cannot use sellShort()");if(8!==w.a.bitNodeN&&!(_e&&be>=2))throw Object(Y.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=F.e[e];if(null==r)throw Object(Y.d)(t,"ERROR: Invalid stock symbol passed into sellShort()");return Object(F.n)(r,a,t)?r.price:0},placeOrder(e,a,r,i,o){if(t.checkingRam)return pe("placeOrder",g.CONSTANTS.ScriptBuySellStockRamCost);if(n("placeOrder",g.CONSTANTS.ScriptBuySellStockRamCost),!w.a.hasTixApiAccess)throw Object(Y.d)(t,"You don't have TIX API Access! Cannot use placeOrder()");if(8!==w.a.bitNodeN&&!(_e&&be>=3))throw Object(Y.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=F.e[e];if(null==c)throw Object(Y.d)(t,"ERROR: Invalid stock symbol passed into placeOrder()");if((i=i.toLowerCase()).includes("limit")&&i.includes("buy"))s=F.a.LimitBuy;else if(i.includes("limit")&&i.includes("sell"))s=F.a.LimitSell;else if(i.includes("stop")&&i.includes("buy"))s=F.a.StopBuy;else{if(!i.includes("stop")||!i.includes("sell"))throw Object(Y.d)(t,"ERROR: Invalid Order Type passed into placeOrder()");s=F.a.StopSell}if((o=o.toLowerCase()).includes("l"))l=F.b.Long;else{if(!o.includes("s"))throw Object(Y.d)(t,"ERROR: Invalid Position Type passed into placeOrder()");l=F.b.Short}return Object(F.l)(c,a,r,s,l,t)},cancelOrder(e,a,r,i,o){if(t.checkingRam)return pe("cancelOrder",g.CONSTANTS.ScriptBuySellStockRamCost);if(n("cancelOrder",g.CONSTANTS.ScriptBuySellStockRamCost),!w.a.hasTixApiAccess)throw Object(Y.d)(t,"You don't have TIX API Access! Cannot use cancelOrder()");if(8!==w.a.bitNodeN&&!(_e&&be>=3))throw Object(Y.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=F.e[e];if(null==c)throw Object(Y.d)(t,"ERROR: Invalid stock symbol passed into cancelOrder()");if(isNaN(a)||isNaN(r))throw Object(Y.d)(t,"ERROR: Invalid shares or price argument passed into cancelOrder(). Must be numeric");if((i=i.toLowerCase()).includes("limit")&&i.includes("buy"))s=F.a.LimitBuy;else if(i.includes("limit")&&i.includes("sell"))s=F.a.LimitSell;else if(i.includes("stop")&&i.includes("buy"))s=F.a.StopBuy;else{if(!i.includes("stop")||!i.includes("sell"))throw Object(Y.d)(t,"ERROR: Invalid Order Type passed into placeOrder()");s=F.a.StopSell}if((o=o.toLowerCase()).includes("l"))l=F.b.Long;else{if(!o.includes("s"))throw Object(Y.d)(t,"ERROR: Invalid Position Type passed into placeOrder()");l=F.b.Short}var u={stock:c,shares:a,price:r,type:s,pos:l};return Object(F.f)(u,t)},getOrders:function(){if(t.checkingRam)return pe("getOrders",g.CONSTANTS.ScriptBuySellStockRamCost);if(n("getOrders",g.CONSTANTS.ScriptBuySellStockRamCost),!w.a.hasTixApiAccess)throw Object(Y.d)(t,"You don't have TIX API Access! Cannot use getOrders()");if(8!==w.a.bitNodeN&&!(_e&&be>=3))throw Object(Y.d)(t,"ERROR: Cannot use getOrders(). You must either be in BitNode-8 or have Level 3 of Source-File 8");const e={},a=F.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(W.getPurchaseServerLimit)())return t.log(`ERROR: You have reached the maximum limit of ${Object(W.getPurchaseServerLimit)()} servers. You cannot purchase any more.`),"";const i=Object(W.getPurchaseServerCost)(a);if(i===1/0)return t.log("ERROR: 'purchaseServer()' failed due to an invalid 'ram' argument"),1/0;if(w.a.money.lt(i))return t.log("ERROR: Not enough money to purchase server. Need $"+Object(re.formatNumber)(i,2)),"";var o=new B.Server({ip:Object(ae.createRandomIp)(),hostname:r,organizationName:"",isConnectedTo:!1,adminRights:!0,purchasedByPlayer:!0,maxRam:a});Object(D.AddToAllServers)(o),w.a.purchasedServers.push(o.ip);var s=w.a.getHomeComputer();return s.serversOnNetwork.push(o.ip),o.serversOnNetwork.push(s.ip),w.a.loseMoney(i),null==t.disableLogs.ALL&&null==t.disableLogs.purchaseServer&&t.scriptRef.log("Purchased new server with hostname "+o.hostname+" for $"+Object(re.formatNumber)(i,2)),o.hostname},deleteServer:function(e){if(t.checkingRam)return pe("deleteServer",g.CONSTANTS.ScriptPurchaseServerRamCost);n("deleteServer",g.CONSTANTS.ScriptPurchaseServerRamCost);var a=String(e);a=a.replace(/\s\s+/g,"");var r=Object(L.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(Y.d)(t,"ERROR: Trying to write to invalid port: "+e+". Only ports 1-"+g.CONSTANTS.NumNetscriptPorts+" are valid.");if(null==(e=$.a[e-1])||!(e instanceof z.a))throw Object(Y.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 pe("tryWrite",g.CONSTANTS.ScriptReadWriteRamCost);if(n("tryWrite",g.CONSTANTS.ScriptReadWriteRamCost),isNaN(e))throw Object(Y.d)(t,"Invalid argument passed in for tryWrite: "+e);if((e=Math.round(e))<1||e>g.CONSTANTS.NumNetscriptPorts)throw Object(Y.d)(t,"ERROR: tryWrite() called on invalid port: "+e+". Only ports 1-"+g.CONSTANTS.NumNetscriptPorts+" are valid.");if(null==(e=$.a[e-1])||!(e instanceof z.a))throw Object(Y.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 pe("read",g.CONSTANTS.ScriptReadWriteRamCost);if(n("read",g.CONSTANTS.ScriptReadWriteRamCost),isNaN(e)){if(Object(ie.isString)(e)){let n=e,a=Object(L.getServer)(t.serverIp);if(null==a)throw Object(Y.d)(t,"Error getting Server for this script in read(). This is a bug please contact game dev");if(Object(I.isScriptFilename)(n)){let e=t.getScriptOnServer(n);return null==e?"":e.code}{let e=Object(G.getTextFile)(n,a);return null!==e?e.text:""}}throw Object(Y.d)(t,"Invalid argument passed in for read(): "+e)}if((e=Math.round(e))<1||e>g.CONSTANTS.NumNetscriptPorts)throw Object(Y.d)(t,"ERROR: Trying to read from invalid port: "+e+". Only ports 1-"+g.CONSTANTS.NumNetscriptPorts+" are valid.");if(null==(e=$.a[e-1])||!(e instanceof z.a))throw Object(Y.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 pe("peek",g.CONSTANTS.ScriptReadWriteRamCost);if(n("peek",g.CONSTANTS.ScriptReadWriteRamCost),isNaN(e))throw Object(Y.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(Y.d)(t,"ERROR: peek() called with invalid argument. Must be a port number between 1 and "+g.CONSTANTS.NumNetscriptPorts);if(null==(e=$.a[e-1])||!(e instanceof z.a))throw Object(Y.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 pe("clear",g.CONSTANTS.ScriptReadWriteRamCost);if(n("clear",g.CONSTANTS.ScriptReadWriteRamCost),!isNaN(e)){if((e=Math.round(e))<1||e>g.CONSTANTS.NumNetscriptPorts)throw Object(Y.d)(t,"ERROR: Trying to clear invalid port: "+e+". Only ports 1-"+g.CONSTANTS.NumNetscriptPorts+" are valid");if(null==(e=$.a[e-1])||!(e instanceof z.a))throw Object(Y.d)(t,"ERROR: Could not find port: "+e+". This is a bug contact the game developer");return e.clear()}if(!Object(ie.isString)(e))throw Object(Y.d)(t,"Invalid argument passed in for clear(): "+e);var a=e,r=Object(L.getServer)(t.serverIp);if(null==r)throw Object(Y.d)(t,"Error getting Server for this script in clear(). This is a bug please contact game dev");var i=Object(G.getTextFile)(a,r);return null!=i&&i.write(""),0},getPortHandle:function(e){if(t.checkingRam)return pe("getPortHandle",10*g.CONSTANTS.ScriptReadWriteRamCost);if(n("getPortHandle",10*g.CONSTANTS.ScriptReadWriteRamCost),isNaN(e))throw Object(Y.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(Y.d)(t,"ERROR: getPortHandle() called with invalid port number: "+e+". Only ports 1-"+g.CONSTANTS.NumNetscriptPorts+" are valid");if(null==(e=$.a[e-1])||!(e instanceof z.a))throw Object(Y.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 pe("rm",g.CONSTANTS.ScriptReadWriteRamCost);n("rm",g.CONSTANTS.ScriptReadWriteRamCost),null!=a&&""!==a||(a=t.serverIp);const r=de(a,"rm").removeFile(e);return r.res||t.log(r.msg),r.res},scriptRunning:function(e,a){if(t.checkingRam)return pe("scriptRunning",g.CONSTANTS.ScriptArbScriptRamCost);n("scriptRunning",g.CONSTANTS.ScriptArbScriptRamCost);var r=Object(L.getServer)(a);if(null==r)throw t.scriptRef.log("scriptRunning() failed. Invalid IP or hostname passed in: "+a),Object(Y.d)(t,"scriptRunning() failed. Invalid IP or hostname passed in: "+a);for(var i=0;i{Object(le.removeElementById)(n),e(!0)}}),i=Object(oe.createElement)("button",{class:"popup-box-button",innerText:"No",clickListener:()=>{Object(le.removeElementById)(n),e(!1)}});Object(se.createPopup)(n,[a,r,i])})},wget:async function(n,a,r=t.serverIp){if(t.checkingRam)return 0;if(!Object(I.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=de(r,"wget");return new Promise(function(o,s){e.get(n,function(e){let n;return(n=Object(I.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?pe("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!==w.a.bitNodeN&&(r*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return pe("universityCourse",r);if(n("universityCourse",r),4!=w.a.bitNodeN&&!(he&&ye>=1))throw Object(Y.d)(t,"Cannot run universityCourse(). It is a Singularity Function and requires SourceFile-4 (level 1) to run.");if(!A.c){if(w.a.isWorking){var i=w.a.singularityStopWork();null==t.disableLogs.ALL&&null==t.disableLogs.universityCourse&&t.scriptRef.log(i)}var o,s,l;switch(e.toLowerCase()){case O.LocationName.AevumSummitUniversity.toLowerCase():if(w.a.city!=T.CityName.Aevum)return t.scriptRef.log("ERROR: You cannot study at Summit University because you are not in Aevum. universityCourse() failed"),!1;w.a.gotoLocation(O.LocationName.AevumSummitUniversity),o=4,s=3;break;case O.LocationName.Sector12RothmanUniversity.toLowerCase():if(w.a.city!=T.CityName.Sector12)return t.scriptRef.log("ERROR: You cannot study at Rothman University because you are not in Sector-12. universityCourse() failed"),!1;w.a.location=O.LocationName.Sector12RothmanUniversity,o=3,s=2;break;case O.LocationName.VolhavenZBInstituteOfTechnology.toLowerCase():if(w.a.city!=T.CityName.Volhaven)return t.scriptRef.log("ERROR: You cannot study at ZB Institute of Technology because you are not in Volhaven. universityCourse() failed"),!1;w.a.location=O.LocationName.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 w.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!==w.a.bitNodeN&&(r*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return pe("gymWorkout",r);if(n("gymWorkout",r),4!=w.a.bitNodeN&&!(he&&ye>=1))throw Object(Y.d)(t,"Cannot run gymWorkout(). It is a Singularity Function and requires SourceFile-4 (level 1) to run.");if(!A.c){if(w.a.isWorking){var i=w.a.singularityStopWork();null==t.disableLogs.ALL&&null==t.disableLogs.gymWorkout&&t.scriptRef.log(i)}var o,s;switch(e.toLowerCase()){case O.LocationName.AevumCrushFitnessGym.toLowerCase():if(w.a.city!=T.CityName.Aevum)return t.scriptRef.log("ERROR: You cannot workout at Crush Fitness because you are not in Aevum. gymWorkout() failed"),!1;w.a.location=O.LocationName.AevumCrushFitnessGym,o=3,s=2;break;case O.LocationName.AevumSnapFitnessGym.toLowerCase():if(w.a.city!=T.CityName.Aevum)return t.scriptRef.log("ERROR: You cannot workout at Snap Fitness because you are not in Aevum. gymWorkout() failed"),!1;w.a.location=O.LocationName.AevumSnapFitnessGym,o=10,s=5;break;case O.LocationName.Sector12IronGym.toLowerCase():if(w.a.city!=T.CityName.Sector12)return t.scriptRef.log("ERROR: You cannot workout at Iron Gym because you are not in Sector-12. gymWorkout() failed"),!1;w.a.location=O.LocationName.Sector12IronGym,o=1,s=1;break;case O.LocationName.Sector12PowerhouseGym.toLowerCase():if(w.a.city!=T.CityName.Sector12)return t.scriptRef.log("ERROR: You cannot workout at Powerhouse Gym because you are not in Sector-12. gymWorkout() failed"),!1;w.a.location=O.LocationName.Sector12PowerhouseGym,o=20,s=10;break;case O.LocationName.VolhavenMilleniumFitnessGym.toLowerCase():if(w.a.city!=T.CityName.Volhaven)return t.scriptRef.log("ERROR: You cannot workout at Millenium Fitness Gym because you are not in Volhaven. gymWorkout() failed"),!1;w.a.location=O.LocationName.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():w.a.startClass(o,s,g.CONSTANTS.ClassGymStrength);break;case"defense".toLowerCase():case"def".toLowerCase():w.a.startClass(o,s,g.CONSTANTS.ClassGymDefense);break;case"dexterity".toLowerCase():case"dex".toLowerCase():w.a.startClass(o,s,g.CONSTANTS.ClassGymDexterity);break;case"agility".toLowerCase():case"agi".toLowerCase():w.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!==w.a.bitNodeN&&(a*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return pe("travelToCity",a);if(n("travelToCity",a),4!=w.a.bitNodeN&&!(he&&ye>=1))throw Object(Y.d)(t,"Cannot run travelToCity(). It is a Singularity Function and requires SourceFile-4 (level 1) to run.");switch(e){case T.CityName.Aevum:case T.CityName.Chongqing:case T.CityName.Sector12:case T.CityName.NewTokyo:case T.CityName.Ishima:case T.CityName.Volhaven:if(w.a.money.lt(g.CONSTANTS.TravelCost))throw t.scriptRef.log("ERROR: not enough money to travel with travelToCity()."),Object(Y.d)(t,"ERROR: not enough money to travel with travelToCity().");return w.a.loseMoney(g.CONSTANTS.TravelCost),w.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!==w.a.bitNodeN&&(e*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return pe("purchaseTor",e);if(n("purchaseTor",e),4!=w.a.bitNodeN&&!(he&&ye>=1))throw Object(Y.d)(t,"Cannot run purchaseTor(). It is a Singularity Function and requires SourceFile-4 (level 1) to run.");if(null!=j.SpecialServerIps["Darkweb Server"])return t.scriptRef.log("You already have a TOR router! purchaseTor() failed"),!1;if(w.a.money.lt(g.CONSTANTS.TorRouterCost))return t.scriptRef.log("ERROR: You cannot afford to purchase a Tor router. purchaseTor() failed"),!1;w.a.loseMoney(g.CONSTANTS.TorRouterCost);var a=new B.Server({ip:Object(ae.createRandomIp)(),hostname:"darkweb",organizationName:"",isConnectedTo:!1,adminRights:!1,purchasedByPlayer:!1,maxRam:1});return Object(D.AddToAllServers)(a),j.SpecialServerIps.addIp("Darkweb Server",a.ip),w.a.getHomeComputer().serversOnNetwork.push(a.ip),a.serversOnNetwork.push(w.a.getHomeComputer().ip),w.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!==w.a.bitNodeN&&(a*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return pe("purchaseProgram",a);if(n("purchaseProgram",a),4!=w.a.bitNodeN&&!(he&&ye>=1))throw Object(Y.d)(t,"Cannot run purchaseProgram(). It is a Singularity Function and requires SourceFile-4 (level 1) to run.");if(null==j.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):w.a.money.lt(r.price)?(t.scriptRef.log("Not enough money to purchase "+r.program),!1):w.a.hasProgram(r.program)?(t.scriptRef.log("You already have the "+r.program+" program"),!0):(w.a.loseMoney(r.price),w.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!==w.a.bitNodeN&&(e*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return pe("getStats",e);if(n("getStats",e),4!=w.a.bitNodeN&&!(he&&ye>=1))throw Object(Y.d)(t,"Cannot run getStats(). It is a Singularity Function and requires SourceFile-4 (level 1) to run.");return{hacking:w.a.hacking_skill,strength:w.a.strength,defense:w.a.defense,dexterity:w.a.dexterity,agility:w.a.agility,charisma:w.a.charisma,intelligence:w.a.intelligence}},getCharacterInformation:function(){var e=g.CONSTANTS.ScriptSingularityFn1RamCost/4;if(4!==w.a.bitNodeN&&(e*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return pe("getCharacterInformation",e);if(n("getCharacterInformation",e),4!=w.a.bitNodeN&&!(he&&ye>=1))throw Object(Y.d)(t,"Cannot run getCharacterInformation(). It is a Singularity Function and requires SourceFile-4 (level 1) to run.");return{bitnode:w.a.bitNodeN,city:w.a.city,factions:w.a.factions.slice(),hp:w.a.hp,jobs:Object.keys(w.a.jobs),jobTitles:Object.values(w.a.jobs),maxHp:w.a.max_hp,mult:{agility:w.a.agility_mult,agilityExp:w.a.agility_exp_mult,companyRep:w.a.company_rep_mult,crimeMoney:w.a.crime_money_mult,crimeSuccess:w.a.crime_success_mult,defense:w.a.defense_mult,defenseExp:w.a.defense_exp_mult,dexterity:w.a.dexterity_mult,dexterityExp:w.a.dexterity_exp_mult,factionRep:w.a.faction_rep_mult,hacking:w.a.hacking_mult,hackingExp:w.a.hacking_exp_mult,strength:w.a.strength_mult,strengthExp:w.a.strength_exp_mult,workMoney:w.a.work_money_mult},timeWorked:w.a.timeWorked,tor:j.SpecialServerIps.hasOwnProperty("Darkweb Server"),workHackExpGain:w.a.workHackExpGained,workStrExpGain:w.a.workStrExpGained,workDefExpGain:w.a.workDefExpGained,workDexExpGain:w.a.workDexExpGained,workAgiExpGain:w.a.workAgiExpGained,workChaExpGain:w.a.workChaExpGained,workRepGain:w.a.workRepGained,workMoneyGain:w.a.workMoneyGained}},isBusy:function(){var e=g.CONSTANTS.ScriptSingularityFn1RamCost/4;if(4!==w.a.bitNodeN&&(e*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return pe("isBusy",e);if(n("isBusy",e),4!=w.a.bitNodeN&&!(he&&ye>=1))throw Object(Y.d)(t,"Cannot run isBusy(). It is a Singularity Function and requires SourceFile-4 (level 1) to run.");return w.a.isWorking},stopAction:function(){var e=g.CONSTANTS.ScriptSingularityFn1RamCost/2;if(4!==w.a.bitNodeN&&(e*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return pe("stopAction",e);if(n("stopAction",e),4!=w.a.bitNodeN&&!(he&&ye>=1))throw Object(Y.d)(t,"Cannot run stopAction(). It is a Singularity Function and requires SourceFile-4 (level 1) to run.");if(w.a.isWorking){var a=w.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!==w.a.bitNodeN&&(e*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return pe("upgradeHomeRam",e);if(n("upgradeHomeRam",e),4!=w.a.bitNodeN&&!(he&&ye>=2))throw Object(Y.d)(t,"Cannot run upgradeHomeRam(). It is a Singularity Function and requires SourceFile-4 (level 2) to run.");const a=w.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=w.a.getUpgradeHomeRamCost();return w.a.money.lt(r)?(t.scriptRef.log("ERROR: upgradeHomeRam() failed because you don't have enough money"),!1):(a.maxRam*=2,w.a.loseMoney(r),w.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!==w.a.bitNodeN&&(e*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return pe("getUpgradeHomeRamCost",e);if(n("getUpgradeHomeRamCost",e),4!=w.a.bitNodeN&&!(he&&ye>=2))throw Object(Y.d)(t,"Cannot run getUpgradeHomeRamCost(). It is a Singularity Function and requires SourceFile-4 (level 2) to run.");return w.a.getUpgradeHomeRamCost()},workForCompany:function(e){var a=g.CONSTANTS.ScriptSingularityFn2RamCost;if(4!==w.a.bitNodeN&&(a*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return pe("workForCompany",a);if(n("workForCompany",a),4!=w.a.bitNodeN&&!(he&&ye>=2))throw Object(Y.d)(t,"Cannot run workForCompany(). It is a Singularity Function and requires SourceFile-4 (level 2) to run.");if(null==e&&(e=w.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(w.a.jobs).includes(e))return t.scriptRef.log(`ERROR: workForCompany() failed because you do not have a job at ${e}`),!1;if(A.c)return t.scriptRef.log("ERROR: workForCompany() failed because you are in the middle of a mission."),!1;const r=w.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(w.a.isWorking){var o=w.a.singularityStopWork();null==t.disableLogs.ALL&&null==t.disableLogs.workForCompany&&t.scriptRef.log(o)}return i.isPartTimeJob()?w.a.startWorkPartTime(e):w.a.startWork(e),null==t.disableLogs.ALL&&null==t.disableLogs.workForCompany&&t.log(`Began working at ${w.a.companyName} as a ${r}`),!0},applyToCompany:function(e,a){var r,i=g.CONSTANTS.ScriptSingularityFn2RamCost;if(4!==w.a.bitNodeN&&(i*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return pe("applyToCompany",i);if(n("applyToCompany",i),4!=w.a.bitNodeN&&!(he&&ye>=2))throw Object(Y.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(w.a.location=e,a.toLowerCase()){case"software":r=w.a.applyForSoftwareJob(!0);break;case"software consultant":r=w.a.applyForSoftwareConsultantJob(!0);break;case"it":r=w.a.applyForItJob(!0);break;case"security engineer":r=w.a.applyForSecurityEngineerJob(!0);break;case"network engineer":r=w.a.applyForNetworkEngineerJob(!0);break;case"business":r=w.a.applyForBusinessJob(!0);break;case"business consultant":r=w.a.applyForBusinessConsultantJob(!0);break;case"security":r=w.a.applyForSecurityJob(!0);break;case"agent":r=w.a.applyForAgentJob(!0);break;case"employee":r=w.a.applyForEmployeeJob(!0);break;case"part-time employee":r=w.a.applyForPartTimeEmployeeJob(!0);break;case"waiter":r=w.a.applyForWaiterJob(!0);break;case"part-time waiter":r=w.a.applyForPartTimeWaiterJob(!0);break;default:return t.scriptRef.log("ERROR: Invalid job passed into applyToCompany: "+a+". applyToCompany() failed"),!1}return Object(ie.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 ${w.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!==w.a.bitNodeN&&(a*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return pe("getCompanyRep",a);if(n("getCompanyRep",a),4!=w.a.bitNodeN&&!(he&&ye>=2))throw Object(Y.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!==w.a.bitNodeN&&(a*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return pe("getCompanyFavor",a);if(n("getCompanyFavor",a),4!=w.a.bitNodeN&&!(he&&ye>=2))throw Object(Y.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!==w.a.bitNodeN&&(a*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return pe("getCompanyFavorGain",a);if(n("getCompanyFavorGain",a),4!=w.a.bitNodeN&&!(he&&ye>=2))throw Object(Y.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!==w.a.bitNodeN&&(e*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return pe("checkFactionInvitations",e);if(n("checkFactionInvitations",e),4!=w.a.bitNodeN&&!(he&&ye>=2))throw Object(Y.d)(t,"Cannot run checkFactionInvitations(). It is a Singularity Function and requires SourceFile-4 (level 2) to run.");return w.a.factionInvitations.slice()},joinFaction:function(e){var a=g.CONSTANTS.ScriptSingularityFn2RamCost;if(4!==w.a.bitNodeN&&(a*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return pe("joinFaction",a);if(n("joinFaction",a),4!=w.a.bitNodeN&&!(he&&ye>=2))throw Object(Y.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(!w.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.joinFaction)(r);for(var i=0;i=2))throw Object(Y.d)(t,"Cannot run workForFaction(). It is a Singularity Function and requires SourceFile-4 (level 2) to run.");if(w.a.inGang()&&void 0!==y.a[e])t.scriptRef.log("ERROR: Faction specified in workForFaction() does not offer work at the moment.");else{if(!A.c){if(!Object(v.factionExists)(e))return t.scriptRef.log("ERROR: Faction specified in workForFaction() does not exist."),!1;if(!w.a.factions.includes(e))return t.scriptRef.log("ERROR: workForFaction() failed because you are not a member of "+e),!1;if(w.a.isWorking){var i=w.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)?(w.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)?(w.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)?(w.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!==w.a.bitNodeN&&(a*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return pe("getFactionRep",a);if(n("getFactionRep",a),4!=w.a.bitNodeN&&!(he&&ye>=2))throw Object(Y.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!==w.a.bitNodeN&&(a*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return pe("getFactionFavor",a);if(n("getFactionFavor",a),4!=w.a.bitNodeN&&!(he&&ye>=2))throw Object(Y.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!==w.a.bitNodeN&&(a*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return pe("getFactionFavorGain",a);if(n("getFactionFavorGain",a),4!=w.a.bitNodeN&&!(he&&ye>=2))throw Object(Y.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!==w.a.bitNodeN&&(r*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return pe("donateToFaction",r);if(n("donateToFaction",r),4!=w.a.bitNodeN&&!(he&&ye>=3))throw Object(Y.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(w.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(Y.d)(t,"Cannot run createProgram(). It is a Singularity Function and requires SourceFile-4 (level 3) to run.");if(A.c)return void t.scriptRef.log("ERROR: createProgram() failed because you are in the middle of a mission.");if(w.a.isWorking){var r=w.a.singularityStopWork();null==t.disableLogs.ALL&&null==t.disableLogs.createProgram&&t.scriptRef.log(r)}e=e.toLowerCase();let i=null;for(const t in x.Programs)x.Programs[t].name.toLowerCase()==e&&(i=x.Programs[t]);return null==i?(t.scriptRef.log("ERROR: createProgram() failed because the specified program does not exist: "+e),!1):w.a.hasProgram(i.name)?(t.scriptRef.log("ERROR: createProgram() failed because you already have the "+i.name+" program"),!1):i.create.req(w.a)?(w.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!==w.a.bitNodeN&&(a*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return pe("commitCrime",a);if(n("commitCrime",a),4!=w.a.bitNodeN&&!(he&&ye>=3))throw Object(Y.d)(t,"Cannot run commitCrime(). It is a Singularity Function and requires SourceFile-4 (level 3) to run.");if(A.c)return void t.scriptRef.log("ERROR: commitCrime() failed because you are in the middle of a mission.");if(w.a.isWorking){var r=w.a.singularityStopWork();null==t.disableLogs.ALL&&null==t.disableLogs.commitCrime&&t.scriptRef.log(r)}w.a.gotoLocation(O.LocationName.Slums);const i=Object(c.findCrime)(e.toLowerCase());if(null==i)throw Object(Y.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(w.a,1,{workerscript:t})},getCrimeChance:function(e){var a=g.CONSTANTS.ScriptSingularityFn3RamCost;if(4!==w.a.bitNodeN&&(a*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return pe("getCrimeChance",a);if(n("getCrimeChance",a),4!=w.a.bitNodeN&&!(he&&ye>=3))throw Object(Y.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(Y.d)(t,"Invalid crime passed into getCrimeChance(): "+r);return r.successRate(w.a)},getOwnedAugmentations:function(e=!1){var a=g.CONSTANTS.ScriptSingularityFn3RamCost;if(4!==w.a.bitNodeN&&(a*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return pe("getOwnedAugmentations",a);if(n("getOwnedAugmentations",a),4!=w.a.bitNodeN&&!(he&&ye>=3))throw Object(Y.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(Y.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(Y.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(Y.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!==w.a.bitNodeN&&(a*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return pe("getAugmentationCost",a);if(n("getAugmentationCost",a),4!=w.a.bitNodeN&&!(he&&ye>=3))throw Object(Y.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!==w.a.bitNodeN&&(o*=g.CONSTANTS.ScriptSingularityFnRamMult),t.checkingRam)return pe("purchaseAugmentation",o);if(n("purchaseAugmentation",o),4!=w.a.bitNodeN&&!(he&&ye>=3))throw Object(Y.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(Y.d)(t,"Cannot run installAugmentations(). It is a Singularity Function and requires SourceFile-4 (level 3) to run.");return 0===w.a.queuedAugmentations.length?(t.scriptRef.log("ERROR: installAugmentations() failed because you do not have any Augmentations to be installed"),!1):(w.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 pe("getMemberNames",g.CONSTANTS.ScriptGangApiBaseRamCost/4);n("getMemberNames",g.CONSTANTS.ScriptGangApiBaseRamCost/4),q.a(t,"getMemberNames");try{const e=[];for(const t of w.a.gang.members)e.push(t.name);return e}catch(e){throw Object(Y.d)(t,q.b("getMemberNames",e))}},getGangInformation:function(){if(t.checkingRam)return pe("getGangInformation",g.CONSTANTS.ScriptGangApiBaseRamCost/2);n("getGangInformation",g.CONSTANTS.ScriptGangApiBaseRamCost/2),q.a(t,"getGangInformation");try{return{faction:w.a.gang.facName,isHacking:w.a.gang.isHackingGang,moneyGainRate:w.a.gang.moneyGainRate,power:w.a.gang.getPower(),respect:w.a.gang.respect,respectGainRate:w.a.gang.respectGainRate,territory:w.a.gang.getTerritory(),territoryClashChance:w.a.gang.territoryClashChance,territoryWarfareEngaged:w.a.gang.territoryWarfareEngaged,wantedLevel:w.a.gang.wanted,wantedLevelGainRate:w.a.gang.wantedGainRate}}catch(e){throw Object(Y.d)(t,q.b("getGangInformation",e))}},getOtherGangInformation:function(){if(t.checkingRam)return pe("getOtherGangInformation",g.CONSTANTS.ScriptGangApiBaseRamCost/2);n("getOtherGangInformation",g.CONSTANTS.ScriptGangApiBaseRamCost/2),q.a(t,"getOtherGangInformation");try{return Object.assign(y.a)}catch(e){throw Object(Y.d)(t,q.b("getOtherGangInformation",e))}},getMemberInformation:function(e){if(t.checkingRam)return pe("getMemberInformation",g.CONSTANTS.ScriptGangApiBaseRamCost/2);n("getMemberInformation",g.CONSTANTS.ScriptGangApiBaseRamCost/2),q.a(t,"getMemberInformation");try{for(const t of w.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(Y.d)(t,q.b("getMemberInformation",e))}},canRecruitMember:function(){if(t.checkingRam)return pe("canRecruitMember",g.CONSTANTS.ScriptGangApiBaseRamCost/4);n("canRecruitMember",g.CONSTANTS.ScriptGangApiBaseRamCost/4),q.a(t,"canRecruitMember");try{return w.a.gang.canRecruitMember()}catch(e){throw Object(Y.d)(t,q.b("canRecruitMember",e))}},recruitMember:function(e){if(t.checkingRam)return pe("recruitMember",g.CONSTANTS.ScriptGangApiBaseRamCost/2);n("recruitMember",g.CONSTANTS.ScriptGangApiBaseRamCost/2),q.a(t,"recruitMember");try{const n=w.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(Y.d)(t,q.b("recruitMember",e))}},getTaskNames:function(){if(t.checkingRam)return pe("getTaskNames",g.CONSTANTS.ScriptGangApiBaseRamCost/4);n("getTaskNames",g.CONSTANTS.ScriptGangApiBaseRamCost/4),q.a(t,"getTaskNames");try{const e=w.a.gang.getAllTaskNames();return e.unshift("Unassigned"),e}catch(e){throw Object(Y.d)(t,q.b("getTaskNames",e))}},setMemberTask:function(e,a){if(t.checkingRam)return pe("setMemberTask",g.CONSTANTS.ScriptGangApiBaseRamCost/2);n("setMemberTask",g.CONSTANTS.ScriptGangApiBaseRamCost/2),q.a(t,"setMemberTask");try{for(const n of w.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(Y.d)(t,q.b("setMemberTask",e))}},getEquipmentNames:function(){if(t.checkingRam)return pe("getEquipmentNames",g.CONSTANTS.ScriptGangApiBaseRamCost/4);n("getEquipmentNames",g.CONSTANTS.ScriptGangApiBaseRamCost/4),q.a(t,"getEquipmentNames");try{return w.a.gang.getAllUpgradeNames()}catch(e){throw Object(Y.d)(t,q.b("getEquipmentNames",e))}},getEquipmentCost:function(e){if(t.checkingRam)return pe("getEquipmentCost",g.CONSTANTS.ScriptGangApiBaseRamCost/2);n("getEquipmentCost",g.CONSTANTS.ScriptGangApiBaseRamCost/2),q.a(t,"getEquipmentCost");try{return w.a.gang.getUpgradeCost(e)}catch(e){throw Object(Y.d)(t,q.b("getEquipmentCost",e))}},getEquipmentType:function(e){if(t.checkingRam)return pe("getEquipmentType",g.CONSTANTS.ScriptGangApiBaseRamCost/2);n("getEquipmentType",g.CONSTANTS.ScriptGangApiBaseRamCost/2),q.a(t,"getEquipmentType");try{return w.a.gang.getUpgradeType(e)}catch(e){throw Object(Y.d)(t,q.b("getEquipmentType",e))}},purchaseEquipment:function(e,a){if(t.checkingRam)return pe("purchaseEquipment",g.CONSTANTS.ScriptGangApiBaseRamCost);n("purchaseEquipment",g.CONSTANTS.ScriptGangApiBaseRamCost),q.a(t,"purchaseEquipment");try{for(const n of w.a.gang.members)if(n.name===e){const r=n.buyUpgrade(a,w.a,w.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(Y.d)(t,q.b("purchaseEquipment",e))}},ascendMember:function(e){if(t.checkingRam)return pe("ascendMember",g.CONSTANTS.ScriptGangApiBaseRamCost);n("ascendMember",g.CONSTANTS.ScriptGangApiBaseRamCost),q.a(t,"ascendMember");try{for(const n of w.a.gang.members)if(n.name===e)return w.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(Y.d)(t,q.b("ascendMember",e))}},setTerritoryWarfare:function(e){if(t.checkingRam)return pe("setTerritoryWarfare",g.CONSTANTS.ScriptGangApiBaseRamCost/2);n("setTerritoryWarfare",g.CONSTANTS.ScriptGangApiBaseRamCost/2),q.a(t,"setTerritoryWarfare");try{e?(w.a.gang.territoryWarfareEngaged=!0,t.shouldLog("setTerritoryWarfare")&&t.log("Engaging in Gang Territory Warfare")):(w.a.gang.territoryWarfareEngaged=!1,t.shouldLog("setTerritoryWarfare")&&t.log("Disengaging in Gang Territory Warfare"))}catch(e){throw Object(Y.d)(t,q.b("setTerritoryWarfare",e))}},getChanceToWinClash:function(e){if(t.checkingRam)return pe("getChanceToWinClash",g.CONSTANTS.ScriptGangApiBaseRamCost);n("getChanceToWinClash",g.CONSTANTS.ScriptGangApiBaseRamCost),q.a(t,"getChanceToWinClash");try{if(null==y.a[e])return t.log(`Invalid gang specified in gang.getChanceToWinClash() : ${e}`),0;const n=y.a[w.a.gang.facName].power;return n/(y.a[e].power+n)}catch(e){throw Object(Y.d)(t,q.b("getChanceToWinClash",e))}},getBonusTime:function(){if(t.checkingRam)return 0;q.a(t,"getBonusTime");try{return Math.round(w.a.gang.storedCycles/5)}catch(e){throw Object(Y.d)(t,q.b("getBonusTime",e))}}},bladeburner:{getContractNames:function(){if(t.checkingRam)return pe("getContractNames",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost/10);if(n("getContractNames",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost/10),w.a.bladeburner instanceof u.a&&(7===w.a.bitNodeN||ge))return w.a.bladeburner.getContractNamesNetscriptFn();throw Object(Y.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 pe("getOperationNames",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost/10);if(n("getOperationNames",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost/10),w.a.bladeburner instanceof u.a&&(7===w.a.bitNodeN||ge))return w.a.bladeburner.getOperationNamesNetscriptFn();throw Object(Y.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 pe("getBlackOpNames",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost/10);if(n("getBlackOpNames",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost/10),w.a.bladeburner instanceof u.a&&(7===w.a.bitNodeN||ge))return w.a.bladeburner.getBlackOpNamesNetscriptFn();throw Object(Y.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 pe("getBlackOpRank",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost/2);if(n("getBlackOpRank",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost/2),w.a.bladeburner instanceof u.a&&(7===w.a.bitNodeN||ge)){const t=w.a.bladeburner.getActionIdFromTypeAndName("blackops",e);if(!t)return-1;const n=w.a.bladeburner.getActionObject(t);return n?n.reqdRank:-1}throw Object(Y.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 pe("getGeneralActionNames",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost/10);if(n("getGeneralActionNames",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost/10),w.a.bladeburner instanceof u.a&&(7===w.a.bitNodeN||ge))return w.a.bladeburner.getGeneralActionNamesNetscriptFn();throw Object(Y.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 pe("getSkillNames",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost/10);if(n("getSkillNames",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost/10),w.a.bladeburner instanceof u.a&&(7===w.a.bitNodeN||ge))return w.a.bladeburner.getSkillNamesNetscriptFn();throw Object(Y.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 pe("startAction",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);if(n("startAction",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),w.a.bladeburner instanceof u.a&&(7===w.a.bitNodeN||ge))try{return w.a.bladeburner.startActionNetscriptFn(e,a,t)}catch(e){throw Object(Y.d)(t,"Bladeburner.startAction() failed with exception: "+e)}throw Object(Y.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 pe("stopBladeburnerAction",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost/2);if(n("stopBladeburnerAction",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost/2),w.a.bladeburner instanceof u.a&&(7===w.a.bitNodeN||ge))return w.a.bladeburner.resetAction();throw Object(Y.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 pe("getCurrentAction",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost/4);if(n("getCurrentAction",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost/4),w.a.bladeburner instanceof u.a&&(7===w.a.bitNodeN||ge))return w.a.bladeburner.getTypeAndNameFromActionId(w.a.bladeburner.action);throw Object(Y.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 pe("getActionTime",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);if(n("getActionTime",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),w.a.bladeburner instanceof u.a&&(7===w.a.bitNodeN||ge))try{return w.a.bladeburner.getActionTimeNetscriptFn(e,a,t)}catch(e){throw Object(Y.d)(t,"Bladeburner.getActionTime() failed with exception: "+e)}throw Object(Y.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 pe("getActionEstimatedSuccessChance",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);if(n("getActionEstimatedSuccessChance",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),w.a.bladeburner instanceof u.a&&(7===w.a.bitNodeN||ge))try{return w.a.bladeburner.getActionEstimatedSuccessChanceNetscriptFn(e,a,t)}catch(e){throw Object(Y.d)(t,"Bladeburner.getActionEstimatedSuccessChance() failed with exception: "+e)}throw Object(Y.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 pe("getActionRepGain",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);n("getActionRepGain",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),Object(K.a)(t,"getActionRepGain");try{var i=Object(K.b)("getActionAutolevel",e,a);const n=w.a.bladeburner.getActionIdFromTypeAndName(e,a);if(null==n)return t.log(i),-1;const s=w.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(Y.d)(t,Object(K.c)("getActionAutolevel",e))}},getActionCountRemaining:function(e="",a=""){if(t.checkingRam)return pe("getActionCountRemaining",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);if(n("getActionCountRemaining",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),w.a.bladeburner instanceof u.a&&(7===w.a.bitNodeN||ge))try{return w.a.bladeburner.getActionCountRemainingNetscriptFn(e,a,t)}catch(e){throw Object(Y.d)(t,"Bladeburner.getActionCountRemaining() failed with exception: "+e)}throw Object(Y.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 pe("getActionMaxLevel",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);n("getActionMaxLevel",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),Object(K.a)(t,"getActionMaxLevel");try{var r=Object(K.b)("getActionMaxLevel",e,a);const n=w.a.bladeburner.getActionIdFromTypeAndName(e,a);if(null==n)return t.log(r),-1;const i=w.a.bladeburner.getActionObject(n);return null==i?(t.log(r),-1):i.maxLevel}catch(e){throw Object(Y.d)(t,Object(K.c)("getActionMaxLevel",e))}},getActionCurrentLevel:function(e="",a=""){if(t.checkingRam)return pe("getActionCurrentLevel",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);n("getActionCurrentLevel",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),Object(K.a)(t,"getActionCurrentLevel");try{var r=Object(K.b)("getActionCurrentLevel",e,a);const n=w.a.bladeburner.getActionIdFromTypeAndName(e,a);if(null==n)return t.log(r),-1;const i=w.a.bladeburner.getActionObject(n);return null==i?(t.log(r),-1):i.level}catch(e){throw Object(Y.d)(t,Object(K.c)("getActionCurrentLevel",e))}},getActionAutolevel:function(e="",a=""){if(t.checkingRam)return pe("getActionAutolevel",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);n("getActionAutolevel",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),Object(K.a)(t,"getActionAutolevel");try{var r=Object(K.b)("getActionAutolevel",e,a);const n=w.a.bladeburner.getActionIdFromTypeAndName(e,a);if(null==n)return t.log(r),!1;const i=w.a.bladeburner.getActionObject(n);return null==i?(t.log(r),!1):i.autoLevel}catch(e){throw Object(Y.d)(t,Object(K.c)("getActionAutolevel",e))}},setActionAutolevel:function(e="",a="",r=!0){if(t.checkingRam)return pe("setActionAutolevel",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);n("setActionAutolevel",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),Object(K.a)(t,"setActionAutolevel");try{var i=Object(K.b)("setActionAutolevel",e,a);const n=w.a.bladeburner.getActionIdFromTypeAndName(e,a);if(null==n)return void t.log(i);const o=w.a.bladeburner.getActionObject(n);if(null==o)return void t.log(i);o.autoLevel=r}catch(e){throw Object(Y.d)(t,Object(K.c)("setActionAutolevel",e))}},setActionLevel:function(e="",a="",r=1){if(t.checkingRam)return pe("setActionLevel",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);n("setActionLevel",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),Object(K.a)(t,"setActionLevel");try{var i=Object(K.b)("setActionLevel",e,a);const n=w.a.bladeburner.getActionIdFromTypeAndName(e,a);if(null==n)return void t.log(i);const o=w.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(Y.d)(t,Object(K.c)("setActionLevel",e))}},getRank:function(){if(t.checkingRam)return pe("getRank",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);if(n("getRank",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),w.a.bladeburner instanceof u.a&&(7===w.a.bitNodeN||ge))return w.a.bladeburner.rank;throw Object(Y.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 pe("getSkillPoints",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);if(n("getSkillPoints",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),w.a.bladeburner instanceof u.a&&(7===w.a.bitNodeN||ge))return w.a.bladeburner.skillPoints;throw Object(Y.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 pe("getSkillLevel",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);if(n("getSkillLevel",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),w.a.bladeburner instanceof u.a&&(7===w.a.bitNodeN||ge))try{return w.a.bladeburner.getSkillLevelNetscriptFn(e,t)}catch(e){throw Object(Y.d)(t,"Bladeburner.getSkillLevel() failed with exception: "+e)}throw Object(Y.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 pe("getSkillUpgradeCost",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);if(n("getSkillUpgradeCost",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),w.a.bladeburner instanceof u.a&&(7===w.a.bitNodeN||ge))try{return w.a.bladeburner.getSkillUpgradeCostNetscriptFn(e,t)}catch(e){throw Object(Y.d)(t,"Bladeburner.getSkillUpgradeCost() failed with exception: "+e)}throw Object(Y.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 pe("upgradeSkill",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);if(n("upgradeSkill",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),w.a.bladeburner instanceof u.a&&(7===w.a.bitNodeN||ge))try{return w.a.bladeburner.upgradeSkillNetscriptFn(e,t)}catch(e){throw Object(Y.d)(t,"Bladeburner.upgradeSkill() failed with exception: "+e)}throw Object(Y.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 pe("getTeamSize",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);if(n("getTeamSize",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),w.a.bladeburner instanceof u.a&&(7===w.a.bitNodeN||ge))try{return w.a.bladeburner.getTeamSizeNetscriptFn(e,a,t)}catch(e){throw Object(Y.d)(t,"Bladeburner.getTeamSize() failed with exception: "+e)}throw Object(Y.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 pe("setTeamSize",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);if(n("setTeamSize",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),w.a.bladeburner instanceof u.a&&(7===w.a.bitNodeN||ge))try{return w.a.bladeburner.setTeamSizeNetscriptFn(e,a,r,t)}catch(e){throw Object(Y.d)(t,"Bladeburner.setTeamSize() failed with exception: "+e)}throw Object(Y.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 pe("getCityEstimatedPopulation",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);if(n("getCityEstimatedPopulation",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),w.a.bladeburner instanceof u.a&&(7===w.a.bitNodeN||ge))try{return w.a.bladeburner.getCityEstimatedPopulationNetscriptFn(e,t)}catch(e){throw Object(Y.d)(t,"Bladeburner.getCityEstimatedPopulation() failed with exception: "+e)}throw Object(Y.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 pe("getCityEstimatedCommunities",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);if(n("getCityEstimatedCommunities",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),w.a.bladeburner instanceof u.a&&(7===w.a.bitNodeN||ge))try{return w.a.bladeburner.getCityEstimatedCommunitiesNetscriptFn(e,t)}catch(e){throw Object(Y.d)(t,"Bladeburner.getCityEstimatedCommunities() failed with exception: "+e)}throw Object(Y.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 pe("getCityChaos",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);if(n("getCityChaos",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),w.a.bladeburner instanceof u.a&&(7===w.a.bitNodeN||ge))try{return w.a.bladeburner.getCityChaosNetscriptFn(e,t)}catch(e){throw Object(Y.d)(t,"Bladeburner.getCityChaos() failed with exception: "+e)}throw Object(Y.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 pe("getCity",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);if(n("getCity",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),w.a.bladeburner instanceof u.a&&(7===w.a.bitNodeN||ge))try{return w.a.bladeburner.city}catch(e){throw Object(Y.d)(t,"Bladeburner.getCity() failed with exception: "+e)}throw Object(Y.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 pe("switchCity",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);if(n("switchCity",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),w.a.bladeburner instanceof u.a&&(7===w.a.bitNodeN||ge))try{return w.a.bladeburner.switchCityNetscriptFn(e,t)}catch(e){throw Object(Y.d)(t,"Bladeburner.switchCity() failed with exception: "+e)}throw Object(Y.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 pe("getStamina",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);if(n("getStamina",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),w.a.bladeburner instanceof u.a&&(7===w.a.bitNodeN||ge))return[w.a.bladeburner.stamina,w.a.bladeburner.maxStamina];throw Object(Y.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 pe("joinBladeburnerFaction",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);if(n("joinBladeburnerFaction",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),w.a.bladeburner instanceof u.a&&(7===w.a.bitNodeN||ge))return w.a.bladeburner.joinBladeburnerFactionNetscriptFn(t);throw Object(Y.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 pe("joinBladeburnerDivision",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost);if(n("joinBladeburnerDivision",g.CONSTANTS.ScriptBladeburnerApiBaseRamCost),7===w.a.bitNodeN||ge){if(8===w.a.bitNodeN)return!1;if(w.a.bladeburner instanceof u.a)return!0;if(w.a.strength>=100&&w.a.defense>=100&&w.a.dexterity>=100&&w.a.agility>=100){w.a.bladeburner=new u.a({new:!0}),t.log("You have been accepted into the Bladeburner division");const e=document.getElementById("world-menu-header");return e instanceof HTMLElement&&(e.click(),e.click()),!0}return t.log("You do not meet the requirements for joining the Bladeburner division"),!1}throw Object(Y.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===w.a.bitNodeN||ge)return Math.round(w.a.bladeburner.storedCycles/5);throw Object(Y.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 pe("attempt",g.CONSTANTS.ScriptCodingContractBaseRamCost);n("attempt",g.CONSTANTS.ScriptCodingContractBaseRamCost);const i=Ce(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(te.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 pe("getContractType",g.CONSTANTS.ScriptCodingContractBaseRamCost/2);n("getContractType",g.CONSTANTS.ScriptCodingContractBaseRamCost/2);let r=Ce(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 pe("getData",g.CONSTANTS.ScriptCodingContractBaseRamCost/2);n("getData",g.CONSTANTS.ScriptCodingContractBaseRamCost/2);let r=Ce(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=w.a.sleeves.length||e<0?(t.log(`ERROR: sleeve.setToShockRecovery(${e}) failed because it is an invalid sleeve number.`),!1):w.a.sleeves[e].shockRecovery(w.a)},setToSynchronize:function(e=0){if(t.checkingRam)return pe("setToSynchronize",g.CONSTANTS.ScriptSleeveBaseRamCost);if(10!==w.a.bitNodeN&&!H.SourceFileFlags[10])throw Object(Y.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>=w.a.sleeves.length||e<0?(t.log(`ERROR: sleeve.setToSynchronize(${e}) failed because it is an invalid sleeve number.`),!1):w.a.sleeves[e].synchronize(w.a)},setToCommitCrime:function(e=0,a=""){if(t.checkingRam)return pe("setToCommitCrime",g.CONSTANTS.ScriptSleeveBaseRamCost);if(10!==w.a.bitNodeN&&!H.SourceFileFlags[10])throw Object(Y.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>=w.a.sleeves.length||e<0?(t.log(`ERROR: sleeve.setToCommitCrime(${e}) failed because it is an invalid sleeve number.`),!1):w.a.sleeves[e].commitCrime(w.a,a)},setToUniversityCourse:function(e=0,a="",r=""){if(t.checkingRam)return pe("setToUniversityCourse",g.CONSTANTS.ScriptSleeveBaseRamCost);if(10!==w.a.bitNodeN&&!H.SourceFileFlags[10])throw Object(Y.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>=w.a.sleeves.length||e<0?(t.log(`ERROR: sleeve.setToUniversityCourse(${e}) failed because it is an invalid sleeve number.`),!1):w.a.sleeves[e].takeUniversityCourse(w.a,a,r)},travel:function(e=0,a=""){if(t.checkingRam)return pe("travel",g.CONSTANTS.ScriptSleeveBaseRamCost);if(10!==w.a.bitNodeN&&!H.SourceFileFlags[10])throw Object(Y.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>=w.a.sleeves.length||e<0?(t.log(`ERROR: sleeve.travel(${e}) failed because it is an invalid sleeve number.`),!1):w.a.sleeves[e].travel(w.a,a)},setToCompanyWork:function(e=0,a=""){if(t.checkingRam)return pe("setToCompanyWork",g.CONSTANTS.ScriptSleeveBaseRamCost);if(10!==w.a.bitNodeN&&!H.SourceFileFlags[10])throw Object(Y.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>=w.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=w.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=w.a.sleeves.length||e<0?(t.log(`ERROR: sleeve.setToGymWorkout(${e}) failed because it is an invalid sleeve number.`),!1):w.a.sleeves[e].workoutAtGym(w.a,a,r)},getSleeveStats:function(e=0){if(t.checkingRam)return pe("workoutAtGym",g.CONSTANTS.ScriptSleeveBaseRamCost);if(10!==w.a.bitNodeN&&!H.SourceFileFlags[10])throw Object(Y.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>=w.a.sleeves.length||e<0)return t.log(`ERROR: sleeve.workoutAtGym(${e}) failed because it is an invalid sleeve number.`),!1;const a=w.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 pe("getTask",g.CONSTANTS.ScriptSleeveBaseRamCost);if(10!==w.a.bitNodeN&&!H.SourceFileFlags[10])throw Object(Y.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>=w.a.sleeves.length||e<0)return t.log(`ERROR: sleeve.getTask(${e}) failed because it is an invalid sleeve number.`),!1;const a=w.a.sleeves[e];return{task:V.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 pe("getInformation",g.CONSTANTS.ScriptSleeveBaseRamCost);if(10!==w.a.bitNodeN&&!H.SourceFileFlags[10])throw Object(Y.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>=w.a.sleeves.length||e<0)return t.log(`ERROR: sleeve.getInformation(${e}) failed because it is an invalid sleeve number.`),!1;const a=w.a.sleeves[e];return{city:a.city,hp:a.hp,jobs:Object.keys(w.a.jobs),jobTitle:Object.values(w.a.jobs),maxHp:a.max_hp,tor:j.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 pe("getSleeveAugmentations",g.CONSTANTS.ScriptSleeveBaseRamCost);if(10!==w.a.bitNodeN&&!H.SourceFileFlags[10])throw Object(Y.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>=w.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=w.a.sleeves.length||e<0)return t.log(`ERROR: sleeve.getSleevePurchasableAugs(${e}) failed because it is an invalid sleeve number.`),[];const a=Object(J.findSleevePurchasableAugs)(w.a.sleeves[e],w.a),r=[];for(let e=0;e=w.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.`),w.a.sleeves[e].tryBuyAugmentation(w.a,r)}},heart:{break:function(){return t.checkingRam?0:w.a.karma}}}}}).call(this,n(82))},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";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(19),r=n(0);n(79);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),r=n(75);t.createPopupCloseButton=function(e,t){let n;function i(e){27===e.keyCode&&n.click()}return n=a.createElement("button",{class:t.class?t.class:"popup-box-button",display:t.display?t.display:"inline-block",innerText:null==t.innerText?"Cancel":t.innerText,clickListener:()=>{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";Object.defineProperty(t,"__esModule",{value:!0});const a=n(8);function r(e){return t.GlobalAliases.hasOwnProperty(e)?t.GlobalAliases[e]:null}t.Aliases={},t.GlobalAliases={},t.loadAliases=function(e){t.Aliases=""===e?{}:JSON.parse(e)},t.loadGlobalAliases=function(e){t.GlobalAliases=""===e?{}:JSON.parse(e)},t.printAliases=function(){for(var e in t.Aliases)t.Aliases.hasOwnProperty(e)&&a.post("alias "+e+"="+t.Aliases[e]);for(var e in t.GlobalAliases)t.GlobalAliases.hasOwnProperty(e)&&a.post("global alias "+e+"="+t.GlobalAliases[e])},t.parseAliasDeclaration=function(e,n=!1){var a=e.match(/^([_|\w|!|%|,|@]+)="(.+)"$/);return null!=a&&3==a.length&&(n?function(e,n){e in t.Aliases&&delete t.Aliases[e],t.GlobalAliases[e]=n}(a[1],a[2]):function(e,n){e in t.GlobalAliases&&delete t.GlobalAliases[e],t.Aliases[e]=n}(a[1],a[2]),!0)},t.removeAlias=function(e){return t.Aliases.hasOwnProperty(e)?(delete t.Aliases[e],!0):!!t.GlobalAliases.hasOwnProperty(e)&&(delete t.GlobalAliases[e],!0)},t.substituteAliases=function(e){const n=e.split(" ");if(n.length>0){if("unalias"===n[0])return n.join(" ");null!=(i=function(e){return t.Aliases.hasOwnProperty(e)?t.Aliases[e]:null}(n[0]))?n[0]=i:null!=(i=r(n[0]))&&(n[0]=i);for(var a=0;a{let e=P();return null!=e&&e.beautifyScript(),!1}});O=Object(S.createElement)("p",{display:"inline-block",margin:"10px",id:"script-editor-status-text"});const n=Object(S.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"});(T=Object(S.createElement)("input",{type:"checkbox",name:"script-editor-ram-check",id:"script-editor-ram-check",margin:"4px",marginTop:"8px"})).checked=!0;const a=Object(S.createElement)("a",{class:"std-button",display:"inline-block",href:"https://bitburner.readthedocs.io/en/latest/index.html",innerText:"Netscript Documentation",target:"_blank"}),r=Object(S.createElement)("button",{class:"std-button",display:"inline-block",innerText:"Save & Close (Ctrl/Cmd + b)",clickListener:()=>(w(),!1)});e.appendChild(t),e.appendChild(r),e.appendChild(O),e.appendChild(T),e.appendChild(n),e.appendChild(a);const i={saveAndCloseFn:w,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 P(){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 A(){var e=document.getElementById("script-editor-filename").value;if(null==T||!T.checked||!Object(i.isScriptFilename)(e))return void(O.innerText="N/A");let t;try{t=P().getCode()}catch(e){return void(O.innerText="RAM: ERROR")}var n=t.repeat(1),a=await Object(r.calculateRamUsage)(n);O.innerText=-1!==a?"RAM: "+E.numeralWrapper.format(a,"0.00")+" GB":"RAM: Syntax Error"}function w(){var e=document.getElementById("script-editor-filename").value;let t;try{t=P().getCode()}catch(e){return void Object(k.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(k.dialogBoxCreate)("Leave the script name as 'foodnstuff'!");if(-1==(t=t.replace(/\s/g,"")).indexOf("while(true){hack('foodnstuff');}"))return void Object(k.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 "+E.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]/,S=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,T=Object.prototype,O=T.hasOwnProperty,M=T.toString;function P(e,t){return O.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 N(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 D={};function B(e){return new RegExp("^("+e.replace(/ /g,"|")+")$")}var L=function(e,n,r){this.options=e=I(e),this.sourceFile=e.sourceFile,this.keywords=B(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=B(i);var s=(i?i+" ":"")+t.strict;this.reservedWordsStrict=B(s),this.reservedWordsStrictBind=B(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()};L.prototype.isKeyword=function(e){return this.keywords.test(e)},L.prototype.isReservedWord=function(e){return this.reservedWords.test(e)},L.prototype.extend=function(e,t){this[e]=t(this[e])},L.prototype.loadPlugins=function(e){for(var t in e){var n=D[t];if(!n)throw new Error("Plugin '"+t+"' not found");n(this,e[t])}},L.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)};var W=L.prototype,j=/^(?:'((?:[^']|\.)*)'|"((?:[^"]|\.)*)"|;)/;W.strictDirective=function(e){for(;;){S.lastIndex=e,e+=S.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;S.lastIndex=this.pos;var e=S.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;S.lastIndex=this.pos;var e=S.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=L.prototype;z.raise=function(e,t){var n=N(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=L.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=L.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.post&&(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 S)if(S.hasOwnProperty(e))if(e==t)S[e].power+=this.calculatePower();else{const t=Math.random();if(t<.5){const t=.005*S[e].power;S[e].power+=Math.min(.85,t)}else{const n=.75*t*S[e].territory;S[e].power+=n}}this.territoryWarfareEngaged?this.territoryClashChance=1:this.territoryClashChance>0&&(this.territoryClashChance=Math.max(0,this.territoryClashChance-.01));for(let e=0;et!==C[e]),a=Object(g.getRandomInt)(0,n.length-1),r=C[e],i=n[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),c.routing.isOn(c.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}`),c.routing.isOn(c.Page.Gang)&&this.displayGangMemberList(),n}catch(e){if(null!=t)throw e;Object(d.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(N)},M.prototype.getUpgradeCost=function(e){return null==N[e]?1/0:N[e].getCost(this)},M.prototype.getUpgradeType=function(e){const t=N[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(h.Generic_toJSON)("Gang",this)},M.fromJSON=function(e){return Object(h.Generic_fromJSON)(M,e.data)},h.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*S[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*S[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*S[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(h.Generic_toJSON)("GangMemberUpgrade",this)},x.fromJSON=function(e){return Object(h.Generic_fromJSON)(x,e.data)},h.Reviver.constructors.GangMemberUpgrade=x;const N={};r.gangMemberUpgradesMetadata.forEach(e=>{!function(e,t,n,a){N[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(R.gangMemberUpgradeBoxOpened){if(null==R.gangMemberUpgradeBoxElements||null==R.gangMemberUpgradeBox||null==R.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);R.gangMemberUpgradeBoxContent.appendChild(i),R.gangMemberUpgradeBoxElements.push(i)}}else{R.gangMemberUpgradeBoxFilter=Object(y.createElement)("input",{type:"text",placeholder:"Filter gang members",value:t,onkeyup:()=>{var t=R.gangMemberUpgradeBoxFilter.value.toString();this.createGangMemberUpgradeBox(e,t)}}),R.gangMemberUpgradeBoxDiscount=Object(y.createElement)("p",{innerText:"Discount: -"+u.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."}),R.gangMemberUpgradeBoxElements=[R.gangMemberUpgradeBoxFilter,R.gangMemberUpgradeBoxDiscount];for(r=R.gangMemberUpgradeBoxFilter.value.toString(),a=0;a-1||this.members[a].task.indexOf(r)>-1)&&R.gangMemberUpgradeBoxElements.push(this.members[a].createGangMemberUpgradePanel(this,e));R.gangMemberUpgradeBox=Object(b.createPopup)(n,R.gangMemberUpgradeBoxElements),R.gangMemberUpgradeBoxContent=document.getElementById(n+"-content"),R.gangMemberUpgradeBoxOpened=!0}},P.prototype.createGangMemberUpgradePanel=function(e,t){var n=Object(y.createElement)("div",{border:"1px solid white"}),a=Object(y.createElement)("h1",{innerText:this.name+" ("+this.task+")"});n.appendChild(a);var r=Object(y.createElement)("pre",{fontSize:"14px",display:"inline-block",width:"20%",innerText:"Hack: "+this.hack+" (x"+Object(m.formatNumber)(this.hack_mult*this.hack_asc_mult,2)+")\nStr: "+this.str+" (x"+Object(m.formatNumber)(this.str_mult*this.str_asc_mult,2)+")\nDef: "+this.def+" (x"+Object(m.formatNumber)(this.def_mult*this.def_asc_mult,2)+")\nDex: "+this.dex+" (x"+Object(m.formatNumber)(this.dex_mult*this.dex_asc_mult,2)+")\nAgi: "+this.agi+" (x"+Object(m.formatNumber)(this.agi_mult*this.agi_asc_mult,2)+")\nCha: "+this.cha+" (x"+Object(m.formatNumber)(this.cha_mult*this.cha_asc_mult,2)+")\n"});const i=[];function o(e){const t=N[e];null!=t?i.push(Object(y.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(y.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(y.createElement)("br",{}));const l=[],c=[],p=[],h=[],d=[];for(let n in N)if(N.hasOwnProperty(n)){let a=N[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":c.push(a);break;case"v":p.push(a);break;case"r":h.push(a);break;case"g":d.push(a);break;default:console.error(`ERROR: Invalid Gang Member Upgrade Type: ${a.type}`)}}const g=Object(y.createElement)("div",{width:"20%",display:"inline-block"}),_=Object(y.createElement)("div",{width:"20%",display:"inline-block"}),f=Object(y.createElement)("div",{width:"20%",display:"inline-block"}),b=Object(y.createElement)("div",{width:"20%",display:"inline-block"}),v=Object(y.createElement)("div",{width:"20%",display:"inline-block"});g.appendChild(Object(y.createElement)("h2",{innerText:"Weapons"})),_.appendChild(Object(y.createElement)("h2",{innerText:"Armor"})),f.appendChild(Object(y.createElement)("h2",{innerText:"Vehicles"})),b.appendChild(Object(y.createElement)("h2",{innerText:"Rootkits"})),v.appendChild(Object(y.createElement)("h2",{innerText:"Augmentations"}));const E=[l,c,p,h,d],k=[g,_,f,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(y.createElement)("a",s))}(a[i],r,this,n,e)}}return n.appendChild(g),n.appendChild(_),n.appendChild(f),n.appendChild(b),n.appendChild(v),n};const R={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(!R.gangContentCreated||null==R.gangContainer){R.gangContentCreated=!0,R.gangContainer=Object(y.createElement)("div",{id:"gang-container",class:"generic-menupage-container"});var t=this.facName;this.members,this.wanted,this.respect;R.gangContainer.appendChild(Object(y.createElement)("a",{class:"a-link-button",display:"inline-block",innerText:"Back",clickListener:()=>(i.Engine.loadFactionContent(),Object(l.displayFactionContent)(t),!1)})),R.managementButton=Object(y.createElement)("a",{id:"gang-management-subpage-button",class:"a-link-button-inactive",display:"inline-block",innerHTML:"Gang Management (Alt+1)",clickListener:()=>(R.gangManagementSubpage.style.display="block",R.gangTerritorySubpage.style.display="none",R.managementButton.classList.toggle("a-link-button-inactive"),R.managementButton.classList.toggle("a-link-button"),R.territoryButton.classList.toggle("a-link-button-inactive"),R.territoryButton.classList.toggle("a-link-button"),this.updateGangContent(),!1)}),R.territoryButton=Object(y.createElement)("a",{id:"gang-territory-subpage-button",class:"a-link-button",display:"inline-block",innerHTML:"Gang Territory (Alt+2)",clickListener:()=>(R.gangManagementSubpage.style.display="none",R.gangTerritorySubpage.style.display="block",R.managementButton.classList.toggle("a-link-button-inactive"),R.managementButton.classList.toggle("a-link-button"),R.territoryButton.classList.toggle("a-link-button-inactive"),R.territoryButton.classList.toggle("a-link-button"),this.updateGangContent(),!1)}),R.gangContainer.appendChild(R.managementButton),R.gangContainer.appendChild(R.territoryButton),R.gangManagementSubpage=Object(y.createElement)("div",{display:"block",id:"gang-management-subpage"});var n="";n=this.isHackingGang?"Ethical Hacking":"Vigilante Justice",R.gangDesc=Object(y.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"}),R.gangManagementSubpage.appendChild(R.gangDesc),R.gangInfo=Object(y.createElement)("p",{id:"gang-info",width:"70%"}),R.gangManagementSubpage.appendChild(R.gangInfo),R.gangRecruitMemberButton=Object(y.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(y.createElement)("p",{innerText:"Please enter a name for your new Gang member:"}),a=Object(y.createElement)("br"),r=Object(y.createElement)("input",{onkeyup:e=>{e.keyCode===_.KEY.ENTER&&t.click()},placeholder:"Name must be unique",type:"text"});t=Object(y.createElement)("a",{class:"std-button",clickListener:()=>{let t=r.value;return""===t?(Object(p.dialogBoxCreate)("You must enter a name for your Gang member!"),!1):this.canRecruitMember()?this.recruitMember(t)?(Object(k.removeElementById)(e),!1):(Object(p.dialogBoxCreate)("You already have a gang member with this name!"),!1):(Object(p.dialogBoxCreate)("You cannot recruit another Gang member!"),!1)},innerText:"Recruit Gang Member"});const i=Object(y.createElement)("a",{class:"std-button",clickListener:()=>(Object(k.removeElementById)(e),!1),innerText:"Cancel"});Object(b.createPopup)(e,[n,a,r,t,i]),r.focus()}}),R.gangManagementSubpage.appendChild(R.gangRecruitMemberButton),R.gangRecruitRequirementText=Object(y.createElement)("p",{color:"red",id:"gang-recruit-requirement-text",margin:"10px"}),R.gangManagementSubpage.appendChild(R.gangRecruitRequirementText),R.gangManagementSubpage.appendChild(Object(y.createElement)("br",{})),R.gangExpandAllButton=Object(y.createElement)("a",{class:"a-link-button",display:"inline-block",innerHTML:"Expand All",clickListener:()=>{for(var e=R.gangManagementSubpage.getElementsByClassName("accordion-header"),t=0;t{for(var e=R.gangManagementSubpage.getElementsByClassName("accordion-header"),t=0;t{this.displayGangMemberList()}}),R.gangManageEquipmentButton=Object(y.createElement)("a",{class:"a-link-button",display:"inline-block",innerHTML:"Manage Equipment",clickListener:()=>{this.createGangMemberUpgradeBox(e)}}),R.gangManagementSubpage.appendChild(R.gangExpandAllButton),R.gangManagementSubpage.appendChild(R.gangCollapseAllButton),R.gangManagementSubpage.appendChild(R.gangMemberFilter),R.gangManagementSubpage.appendChild(R.gangManageEquipmentButton),R.gangMemberList=Object(y.createElement)("ul",{id:"gang-member-list"}),this.displayGangMemberList(),R.gangManagementSubpage.appendChild(R.gangMemberList),R.gangTerritorySubpage=Object(y.createElement)("div",{id:"gang-territory-subpage",display:"none"}),R.gangTerritoryDescText=Object(y.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.

"}),R.gangTerritorySubpage.appendChild(R.gangTerritoryDescText),R.gangTerritoryWarfareCheckbox=Object(y.createElement)("input",{display:"inline-block",id:"gang-management-territory-warfare-checkbox",changeListener:()=>{this.territoryWarfareEngaged=R.gangTerritoryWarfareCheckbox.checked},margin:"2px",type:"checkbox"}),R.gangTerritoryWarfareCheckbox.checked=this.territoryWarfareEngaged,R.gangTerritoryWarfareCheckboxLabel=Object(y.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%"}),R.gangTerritorySubpage.appendChild(R.gangTerritoryWarfareCheckbox),R.gangTerritorySubpage.appendChild(R.gangTerritoryWarfareCheckboxLabel),R.gangTerritorySubpage.appendChild(Object(y.createElement)("br")),R.gangTerritoryWarfareClashChance=Object(y.createElement)("p",{display:"inline-block"}),R.gangTerritorySubpage.appendChild(R.gangTerritoryWarfareClashChance),R.gangTerritorySubpage.appendChild(Object(y.createElement)("div",{class:"help-tip",display:"inline-block",innerText:"?",clickListener:()=>{Object(p.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.")}})),R.gangTerritoryDeathNotifyCheckbox=Object(y.createElement)("input",{display:"inline-block",id:"gang-management-notify-member-death-checkbox",changeListener:()=>{this.notifyMemberDeath=R.gangTerritoryDeathNotifyCheckbox.checked},margin:"2px",type:"checkbox"}),R.gangTerritoryDeathNotifyCheckbox.checked=this.notifyMemberDeath,R.gangTerritoryDeathNotifyCheckboxLabel=Object(y.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."}),R.gangTerritorySubpage.appendChild(Object(y.createElement)("br")),R.gangTerritorySubpage.appendChild(R.gangTerritoryDeathNotifyCheckbox),R.gangTerritorySubpage.appendChild(R.gangTerritoryDeathNotifyCheckboxLabel),R.gangTerritorySubpage.appendChild(Object(y.createElement)("br"));var a=Object(y.createElement)("fieldset",{display:"block",margin:"6px",width:"50%"});R.gangTerritoryInfoText=Object(y.createElement)("p"),a.appendChild(R.gangTerritoryInfoText),R.gangTerritorySubpage.appendChild(a),R.gangContainer.appendChild(R.gangTerritorySubpage),R.gangContainer.appendChild(R.gangManagementSubpage),document.getElementById("entire-game-container").appendChild(R.gangContainer)}R.gangContainer.style.display="block",this.updateGangContent()},M.prototype.displayGangMemberList=function(){Object(v.removeChildrenFromElement)(R.gangMemberList),R.gangMemberPanels={};const e=this.members,t=R.gangMemberFilter.value.toString();for(var n=0;n-1||e[n].task.indexOf(t)>-1)&&this.createGangMemberDisplayElement(e[n])},M.prototype.updateGangContent=function(){if(R.gangContentCreated)if(R.gangMemberUpgradeBoxOpened&&(R.gangMemberUpgradeBoxDiscount.childNodes[0].nodeValue="Discount: -"+u.numeralWrapper.format(1-1/this.getDiscount(),"0.00%")),"block"===R.gangTerritorySubpage.style.display){R.gangTerritoryWarfareClashChance.innerText=`Territory Clash Chance: ${u.numeralWrapper.format(this.territoryClashChance,"0.000%")}`,R.gangTerritoryWarfareCheckbox.checked=this.territoryWarfareEngaged,R.gangTerritoryInfoText.innerHTML="";const e=S[this.facName].power;for(const t in S)if(S.hasOwnProperty(t)){const n=S[t];let a,r=100*n.territory;if(a=r<=0?Object(m.formatNumber)(0,2):r>=100?Object(m.formatNumber)(100,2):Object(m.formatNumber)(r,2),t===this.facName){let e=`${t}
Power: ${Object(m.formatNumber)(n.power,6)}
`;e+=`Territory: ${a}%

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

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

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;if(r.Augmentations[i.AugmentationNames.TheRedPill].owned&&(y=!0),_&&y&&0===l.a.sourceFiles.length&&!c.b&&!s.c)h.dialogBoxOpened||m(_,!0);else if(_&&y)c.b||s.c||h.dialogBoxOpened||m(_);else if(e&&!e.recvd&&l.a.hacking_skill>=25){m(e);const t=o.Programs.Flight.name,n=l.a.getHomeComputer();n.programs.includes(t)||n.programs.push(t)}else 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";n.d(t,"b",function(){return o}),n.d(t,"c",function(){return s}),n.d(t,"a",function(){return l});var a=n(0),r=n(39),i=n(6);function o(e,t,n){return`ERROR: bladeburner.${e}() failed due to an invalid action specified. `+`Type: ${t}, Name: ${n}. Note that for contracts and operations, the `+"name of the operation is case-sensitive."}function s(e,t){return`bladeburner.${e}() failed with exception: `+t}function l(e,t){const n=`${t}() failed because you do not `+"currently have access to the Bladeburner API. To access the Bladeburner APIyou must be employed at the Bladeburner division, AND you must either be in BitNode-7 or have Source-File 7.";if(!(a.a.bladeburner instanceof r.a&&(7===a.a.bitNodeN||a.a.sourceFiles.some(e=>7===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(187),i=n(16);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]}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_13__.FconfSettings.ENABLE_TIMESTAMPS?Object(_utils_helpers_getTimestamp__WEBPACK_IMPORTED_MODULE_39__.getTimestamp)()+" ":"")+_Player__WEBPACK_IMPORTED_MODULE_21__.a.getCurrentServer().hostname+` ~${a}]> ${n}`),n.length>0&&(Terminal.resetTerminalInput(),Terminal.executeCommands(n))}if(e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_35__.KEY.C&&e.ctrlKey&&(_engine__WEBPACK_IMPORTED_MODULE_11__.Engine._actionInProgress?(Object(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_42__.post)("Cancelling..."),_engine__WEBPACK_IMPORTED_MODULE_11__.Engine._actionInProgress=!1,Terminal.finishAction(!0)):_Fconf_FconfSettings__WEBPACK_IMPORTED_MODULE_13__.FconfSettings.ENABLE_BASH_HOTKEYS&&Terminal.resetTerminalInput()),e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_35__.KEY.L&&e.ctrlKey&&(e.preventDefault(),Terminal.executeCommand("clear")),e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_35__.KEY.UPARROW||_Fconf_FconfSettings__WEBPACK_IMPORTED_MODULE_13__.FconfSettings.ENABLE_BASH_HOTKEYS&&e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_35__.KEY.P&&e.ctrlKey){if(_Fconf_FconfSettings__WEBPACK_IMPORTED_MODULE_13__.FconfSettings.ENABLE_BASH_HOTKEYS&&e.preventDefault(),null==t)return;var n=Terminal.commandHistoryIndex;if(0==(r=Terminal.commandHistory.length))return;(n<0||n>r)&&(Terminal.commandHistoryIndex=r),0!=n&&--Terminal.commandHistoryIndex;var a=Terminal.commandHistory[Terminal.commandHistoryIndex];t.value=a,Object(_utils_SetTimeoutRef__WEBPACK_IMPORTED_MODULE_32__.setTimeoutRef)(function(){t.selectionStart=t.selectionEnd=1e4},0)}if(e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_35__.KEY.DOWNARROW||_Fconf_FconfSettings__WEBPACK_IMPORTED_MODULE_13__.FconfSettings.ENABLE_BASH_HOTKEYS&&e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_35__.KEY.M&&e.ctrlKey){if(_Fconf_FconfSettings__WEBPACK_IMPORTED_MODULE_13__.FconfSettings.ENABLE_BASH_HOTKEYS&&e.preventDefault(),null==t)return;var r;n=Terminal.commandHistoryIndex;if(0==(r=Terminal.commandHistory.length))return;if((n<0||n>r)&&(Terminal.commandHistoryIndex=r),n==r||n==r-1)Terminal.commandHistoryIndex=r,t.value="";else{++Terminal.commandHistoryIndex;a=Terminal.commandHistory[Terminal.commandHistoryIndex];t.value=a}}if(e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_35__.KEY.TAB){if(e.preventDefault(),null==t)return;let n=t.value;if(""==n)return;const a=n.lastIndexOf(";");-1!==a&&(n=n.slice(a+1));const r=(n=(n=n.trim()).replace(/\s\s+/g," ")).split(" ");let i=r.length-2;i<-1&&(i=0);const o=Object(_Terminal_determineAllPossibilitiesForTabCompletion__WEBPACK_IMPORTED_MODULE_1__.determineAllPossibilitiesForTabCompletion)(_Player__WEBPACK_IMPORTED_MODULE_21__.a,n,i,Terminal.currDir);if(0==o.length)return;let s="",l="";if(0==r.length)return;1==r.length?l=r[0]:2==r.length?(l=r[0],s=r[1]):3==r.length?(l=r[0]+" "+r[1],s=r[2]):(s=r.pop(),l=r.join(" ")),Object(_Terminal_tabCompletion__WEBPACK_IMPORTED_MODULE_3__.tabCompletion)(l,s,o),t.focus()}_Fconf_FconfSettings__WEBPACK_IMPORTED_MODULE_13__.FconfSettings.ENABLE_BASH_HOTKEYS&&(e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_35__.KEY.A&&e.ctrlKey&&(e.preventDefault(),Terminal.moveTextCursor("home")),e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_35__.KEY.E&&e.ctrlKey&&(e.preventDefault(),Terminal.moveTextCursor("end")),e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_35__.KEY.B&&e.ctrlKey&&(e.preventDefault(),Terminal.moveTextCursor("prevchar")),e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_35__.KEY.B&&e.altKey&&(e.preventDefault(),Terminal.moveTextCursor("prevword")),e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_35__.KEY.F&&e.ctrlKey&&(e.preventDefault(),Terminal.moveTextCursor("nextchar")),e.keyCode===_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_35__.KEY.F&&e.altKey&&(e.preventDefault(),Terminal.moveTextCursor("nextword")),e.keyCode!==_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_35__.KEY.H&&e.keyCode!==_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_35__.KEY.D||!e.ctrlKey||(Terminal.modifyInput("backspace"),e.preventDefault()))}});let terminalCtrlPressed=!1,shiftKeyPressed=!1;$(document).ready(function(){_ui_navigationTracking__WEBPACK_IMPORTED_MODULE_33__.routing.isOn(_ui_navigationTracking__WEBPACK_IMPORTED_MODULE_33__.Page.Terminal)&&$(".terminal-input").focus()}),$(document).keydown(function(e){if(_ui_navigationTracking__WEBPACK_IMPORTED_MODULE_33__.routing.isOn(_ui_navigationTracking__WEBPACK_IMPORTED_MODULE_33__.Page.Terminal))if(e.which==_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_35__.KEY.CTRL)terminalCtrlPressed=!0;else if(e.shiftKey)shiftKeyPressed=!0;else if(terminalCtrlPressed||shiftKeyPressed||Terminal.contractOpen);else{var t=document.getElementById("terminal-input-text-box");null!=t&&t.focus(),terminalCtrlPressed=!1,shiftKeyPressed=!1}}),$(document).keyup(function(e){_ui_navigationTracking__WEBPACK_IMPORTED_MODULE_33__.routing.isOn(_ui_navigationTracking__WEBPACK_IMPORTED_MODULE_33__.Page.Terminal)&&(e.which==_utils_helpers_keyCodes__WEBPACK_IMPORTED_MODULE_35__.KEY.CTRL&&(terminalCtrlPressed=!1),e.shiftKey&&(shiftKeyPressed=!1))});let Terminal={hackFlag:!1,analyzeFlag:!1,actionStarted:!1,actionTime:0,commandHistory:[],commandHistoryIndex:0,contractOpen:!1,currDir:"/",resetTerminalInput:function(){const e=Terminal.currDir;_Fconf_FconfSettings__WEBPACK_IMPORTED_MODULE_13__.FconfSettings.WRAP_INPUT?(document.getElementById("terminal-input-td").innerHTML=`
[${_Player__WEBPACK_IMPORTED_MODULE_21__.a.getCurrentServer().hostname} ~${e}]$
`+'