Advertisement
Guest User

Untitled

a guest
Apr 8th, 2017
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 146.61 KB | None | 0 0
  1. var __extends=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var t in i)i.hasOwnProperty(t)&&(e[t]=i[t])};return function(i,t){function n(){this.constructor=i}e(i,t),i.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}(),Grepo;!function(e){!function(i){!function(i){var t=function(){function i(e){this._GrepoManager=null,this._ClassName="",this._TitleBarClassName="",this._NavigationBarClassName="",this._ContentClassName="",this._Stylesheet=null,this._Modal=!1,this._OnCloseAction=function(){},this._Title="Base Window",this._Dimensions={Height:564,Width:780},this._Constraints={MinLeft:0,MaxLeft:0,MinTop:0,MaxTop:0},this._Offsets={Top:0,Left:0},this._Dragging=!1,this._Draggable=!0,this._Modal=!1,this.GrepoManager=e}return Object.defineProperty(i.prototype,"Draggable",{get:function(){return this._Draggable},set:function(e){this._Draggable=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"Modal",{get:function(){return this._Modal},set:function(e){this._Modal=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"ClassName",{get:function(){return this._ClassName},set:function(e){this._ClassName=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"TitleBarClassName",{get:function(){return this._TitleBarClassName},set:function(e){this._TitleBarClassName=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"Title",{get:function(){return this._Title},set:function(e){this._Title=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"Dimensions",{get:function(){return this._Dimensions},set:function(e){this._Dimensions=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"Constraints",{get:function(){return this._Constraints},set:function(e){this._Constraints=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"Offsets",{get:function(){return this._Offsets},set:function(e){this._Offsets=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"Dragging",{get:function(){return this._Dragging},set:function(e){this._Dragging=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"ContentClassName",{get:function(){return this._ContentClassName},set:function(e){this._ContentClassName=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"Stylesheet",{get:function(){return this._Stylesheet},set:function(e){this._Stylesheet=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"OnCloseAction",{get:function(){return this._OnCloseAction},set:function(e){this._OnCloseAction=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"NavigationBarClassName",{get:function(){return this._NavigationBarClassName},set:function(e){this._NavigationBarClassName=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"GrepoManager",{get:function(){return this._GrepoManager},set:function(e){this._GrepoManager=e},enumerable:!0,configurable:!0}),i.prototype.init=function(i){for(var t in i)this[t]=i[t];this.calculateConstraints(),this.ClassName=e.Common.Helpers.generateGuid(),this.TitleBarClassName=e.Common.Helpers.generateGuid(),this.ContentClassName=e.Common.Helpers.generateGuid(),this.NavigationBarClassName=e.Common.Helpers.generateGuid(),this.createWindow(),this.registerListeners()},i.prototype.createWindow=function(){this.GrepoManager.LayoutManager.registerWindow(this.ClassName,this.Title);var e=$('<div class="'+this.ClassName+'"><div class="'+this.TitleBarClassName+'"><h3>'+this.Title+'</h3><ul><li><a><i class="fa fa-lg fa-times"></i></a></li></ul></div><div class="'+this.NavigationBarClassName+'"><ul></ul></div><div class="'+this.ContentClassName+'"></div></div>');$("body").append(e),$("."+this.ClassName).css({left:($("body").width()-this.Dimensions.Width-4)/2,top:($("body").height()-this.Dimensions.Height-4)/2});var i="."+this.ClassName+" {position: absolute; background: rgb(88, 92, 95); height: "+this.Dimensions.Height+"px; width: "+this.Dimensions.Width+"px; position: absolute; z-index: 5000; border: 2px solid black;}."+this.TitleBarClassName+" {position: absolute; width: 100%; height: 35px; top: 0; left: 0; border-bottom: 2px solid black; color: white; background: rgb(53, 56, 58);}."+this.TitleBarClassName+" h3 {padding: 0; margin: 0; margin-top: 8px;}."+this.TitleBarClassName+" div {width: 100%; position: absolute; top: 0; left: 0; height: 100%;}."+this.TitleBarClassName+" ul {position: absolute; right: 0; top: 0; z-index: 2;}."+this.TitleBarClassName+" ul li {padding: 8px 10px;}."+this.TitleBarClassName+" a i {cursor: pointer; color: white; }."+this.TitleBarClassName+" a i.fa-pencil-square-o {margin-left: 5px}."+this.TitleBarClassName+" ul li a {cursor: pointer;}."+this.NavigationBarClassName+" {position: absolute; left: 0; top: 37px; height: 527px; width: 150px; border-right: 2px solid black; background: rgb(53, 56, 58);}."+this.NavigationBarClassName+" ul {height: 100%; width: 100%;}."+this.NavigationBarClassName+" ul li {padding: 8px 0px; border-bottom: 1px solid black; color: white; cursor: pointer;}."+this.NavigationBarClassName+" ul li:hover, ."+this.NavigationBarClassName+" ul li.active {background: rgb(88, 92, 95);}."+this.ContentClassName+" {width: 628px; position: absolute; top: 37px; left: 152px; height: 488px; overflow: scroll;}."+this.ContentClassName+" div {position: absolute; top: 0; left: 0; height: 100%; width: 100%; display: none; background: rgb(88, 92, 95)}."+this.ContentClassName+" div.active {display: block}."+this.ContentClassName+" div:first-child {display: block;}",t=$("<style>"+i+"</style>");$("head").append(t)},i.prototype.registerListeners=function(){var i=this,t=this;$("."+this.ClassName).on("mousedown",function(){t.GrepoManager.LayoutManager.focusWindow(i.ClassName)}),$("body").on("click","."+this.TitleBarClassName+" ul li a",function(){console.log("disposing"),i.dispose()}),$("."+this.TitleBarClassName).on("mousedown",function(e){return i.Dragging=!0,t.GrepoManager.LayoutManager.focusWindow(i.ClassName),$("."+i.TitleBarClassName).css({cursor:"move"}),i.Offsets={Left:(e.pageX||(e.originalEvent.touches?e.originalEvent.touches[0].pageX:0))-$("."+i.ClassName).offset().left,Top:(e.pageY||(e.originalEvent.touches?e.originalEvent.touches[0].pageY:0))-$("."+i.ClassName).offset().top},i.calculateConstraints(),!1}).on("mousemove",function(t){if(i.Dragging){e.Common.Helpers.logMessage("dragging");var n={left:(t.pageX||(t.originalEvent.touches?t.originalEvent.touches[0].pageX:0))-i.Offsets.Left,top:(t.pageY||(t.originalEvent.touches?t.originalEvent.touches[0].pageY:0))-i.Offsets.Top};n.left<=i.Constraints.MinLeft&&(n.left=i.Constraints.MinLeft),n.left>=i.Constraints.MaxLeft&&(n.left=i.Constraints.MaxLeft),n.top<=i.Constraints.MinTop&&(n.top=i.Constraints.MinTop),n.top>=i.Constraints.MaxTop&&(n.top=i.Constraints.MaxTop),$("."+i.ClassName).css(n)}return!1}).on("mouseup",function(e){return i.Dragging=!1,$("."+i.TitleBarClassName+" div").css({cursor:"default"}),!1}).on("mouseout",function(e){return i.Dragging=!1,$("."+i.TitleBarClassName+" div").css({cursor:"default"}),!1})},i.prototype.calculateConstraints=function(){this.Constraints={MinLeft:5,MinTop:5,MaxLeft:$("body").width()-(this.Dimensions.Width+4)-5,MaxTop:$("body").height()-(this.Dimensions.Height+4)-5}},i.prototype.dispose=function(){$("."+this.ClassName).remove(),this.GrepoManager.LayoutManager.unregisterWindow(this.ClassName),this.OnCloseAction.call()},i.prototype.addNavigation=function(e){for(var i=this,t=1,n=0,a=e;n<a.length;n++){var o=a[n],r=$("<li data-panel-id='"+t+"'>"+o.Title+"</li>").on("click",function(){i.switchPanel($(this).data("panel-id")),$("."+i.NavigationBarClassName+" ul li").removeClass("active"),$(this).addClass("active")});$("."+this.NavigationBarClassName+" ul").append(r),t++}$("."+this.NavigationBarClassName+" ul li").first().addClass("active")},i.prototype.addPanel=function(e){$("."+this.ContentClassName).append(e)},i.prototype.switchPanel=function(e){$("."+this.ContentClassName+" div").removeClass("active"),$("."+this.ContentClassName+" div:nth-child("+e+")").addClass("active")},i.prototype.updateInterface=function(){},i}();i.BaseWindow=t;var n=function(i){function t(e){var t=i.call(this,e)||this;return t._BuildConfig=null,t._ResourcesBarClassName="",t._BuildingsPanelClassName="",t._GeneralPanelClassName="",t._ResearchesPanelClassName="",t._UnitsPanelClassName="",t._TownsPanelClassName="",t}return __extends(t,i),Object.defineProperty(t.prototype,"ResourcesBarClassName",{get:function(){return this._ResourcesBarClassName},set:function(e){this._ResourcesBarClassName=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"BuildConfig",{get:function(){return this._BuildConfig},set:function(e){this._BuildConfig=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"BuildingsPanelClassName",{get:function(){return this._BuildingsPanelClassName},set:function(e){this._BuildingsPanelClassName=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"GeneralPanelClassName",{get:function(){return this._GeneralPanelClassName},set:function(e){this._GeneralPanelClassName=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ResearchesPanelClassName",{get:function(){return this._ResearchesPanelClassName},set:function(e){this._ResearchesPanelClassName=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"UnitsPanelClassName",{get:function(){return this._UnitsPanelClassName},set:function(e){this._UnitsPanelClassName=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"TownsPanelClassName",{get:function(){return this._TownsPanelClassName},set:function(e){this._TownsPanelClassName=e},enumerable:!0,configurable:!0}),t.prototype.init=function(e){i.prototype.init.call(this,e),this.addNavigation([{Title:"Towns"},{Title:"Buildings"},{Title:"Researches"},{Title:"Units"}]),this.addPanel(this.getTownsPanel()),this.addPanel(this.getBuildingsPanel()),this.addPanel(this.getResearchesPanel()),this.addPanel(this.getUnitsPanel()),this.addResourcesBar(),this.addStyles(),this.initValues(),this.registerBuildConfigListeners();var t=-1!=this.BuildConfig.ID.indexOf("Custom")&&this.GrepoManager.PermissionService.getPermission("CustomBuildConfigs")?'<a><i class="fa fa-lg fa-pencil-square-o" data-config-id="'+this.BuildConfig.ID+'"></i></a>':"";$("."+this.TitleBarClassName).html("<h3>"+this.BuildConfig.ID+" - "+this.BuildConfig.Title+t+' </h3><ul><li><a><i class="fa fa-lg fa-times"></i></a></li></ul>')},t.prototype.addStyles=function(){var e="."+this.ContentClassName+" {height: 488px;}."+this.ResourcesBarClassName+" {width: 628px; position: absolute; top: 525px; left: 152px; background: rgb(53, 56, 58); z-index: 2000; height: 37px; border-top: 2px solid black;}."+this.BuildingsPanelClassName+" {overflow: scroll;}."+this.BuildingsPanelClassName+" form {height: 100%;}."+this.BuildingsPanelClassName+" form ul {float: left; width: 50%; overflow: auto; height: 100%; box-sizing: border-box;}."+this.BuildingsPanelClassName+" form ul:nth-child(1) {border-right: 2px solid black;}."+this.BuildingsPanelClassName+" form ul li {overflow: auto; padding: 8px; height: 20px;}."+this.BuildingsPanelClassName+" form ul li ul {overflow: auto; width: 100%; border: 0 !important;}."+this.BuildingsPanelClassName+" form ul li ul li {float: left; padding: 0 8px;}."+this.BuildingsPanelClassName+" form ul li ul li:nth-child(1) {width: 133px; text-align: right;}."+this.BuildingsPanelClassName+" form ul li ul li:nth-child(2) {width: 126px;}."+this.BuildingsPanelClassName+" form ul li ul li input {width: 100%;}."+this.ResearchesPanelClassName+" {}."+this.ResearchesPanelClassName+" form {height: 100%;}."+this.ResearchesPanelClassName+" form ul {float: left; width: 33%; overflow: auto; height: 100%; box-sizing: border-box;}."+this.ResearchesPanelClassName+" form ul:nth-child(1) {border-right: 2px solid black; width: 182px; padding: 0 16px;}."+this.ResearchesPanelClassName+" form ul:nth-child(1) li ul {padding: 0;}."+this.ResearchesPanelClassName+" form ul:nth-child(2) {border-right: 2px solid black; width: 231px; padding: 0 16px;}."+this.ResearchesPanelClassName+" form ul:nth-child(2) li ul {padding: 0;}."+this.ResearchesPanelClassName+" form ul:nth-child(3) {border-right: 0; width: 215px; padding: 0 16px;}."+this.ResearchesPanelClassName+" form ul:nth-child(3) li ul {padding: 0;}."+this.ResearchesPanelClassName+" form ul li {height: 36px;}."+this.ResearchesPanelClassName+" form ul li ul {float: none; overflow: auto; width: 100% !important; border: 0 !important;}."+this.ResearchesPanelClassName+" form ul li ul li {float: left; padding: 9px 0; height: auto;}."+this.ResearchesPanelClassName+" form ul:nth-child(1) li ul li:nth-child(1) {width: 80px; padding-right: 8px;}."+this.ResearchesPanelClassName+" form ul:nth-child(1) li ul li:nth-child(2) {}."+this.ResearchesPanelClassName+" form ul:nth-child(2) li ul li:nth-child(1) {width: 129px; padding-right: 8px;}."+this.ResearchesPanelClassName+" form ul:nth-child(2) li ul li:nth-child(2) {}."+this.ResearchesPanelClassName+" form ul:nth-child(3) li ul li:nth-child(1) {width: 115px; padding-right: 8px;}."+this.ResearchesPanelClassName+" form ul:nth-child(3) li ul li:nth-child(2) {}."+this.ResearchesPanelClassName+" form ul li ul li:nth-child(1) {width: 150px; text-align: right; padding-right: 5px;}."+this.ResearchesPanelClassName+" form ul li ul li:nth-child(2) {width: 52px;}."+this.UnitsPanelClassName+" {}."+this.UnitsPanelClassName+" form {height: 100%;}."+this.UnitsPanelClassName+" form ul {float: left; overflow: auto; height: 100%; box-sizing: border-box; border-right: 2px solid black; padding: 0 22px;}."+this.UnitsPanelClassName+" form ul:nth-child(1) {padding-left: 24px;}."+this.UnitsPanelClassName+" form ul li {height: 35px;}."+this.UnitsPanelClassName+" form ul li ul {float: none; overflow: auto; width: 100%; border: 0; padding: 0;}."+this.UnitsPanelClassName+" form ul li ul:nth-child(1) {padding-left: 0px;}."+this.UnitsPanelClassName+" form ul li ul li {float: left; padding: 8px 0px; height: auto;}."+this.UnitsPanelClassName+" form ul li ul li:nth-child(1) {text-align: right; padding-right: 12px;}."+this.UnitsPanelClassName+" form ul:nth-child(1) li ul li:nth-child(1) {width: 55px;}."+this.UnitsPanelClassName+" form ul:nth-child(2) li ul li:nth-child(1) {width: 107px;}."+this.UnitsPanelClassName+" form ul:nth-child(3) li ul li:nth-child(1) {width: 98px;}."+this.UnitsPanelClassName+" form ul li ul li:nth-child(2) {width: 64px;}."+this.UnitsPanelClassName+" form ul li ul li:nth-child(2) input {width: 100%;}."+this.TownsPanelClassName+" {}."+this.TownsPanelClassName+" ul {margin-bottom: 8px;}."+this.TownsPanelClassName+" ul li {width: 199px; padding: 8px 0px 0 8px; float: left;}."+this.TownsPanelClassName+" ul li ul {border: 2px solid black; background: rgba(155, 155, 155, 1); overflow: auto; height: 100px; padding: 8px 8px 0 8px; margin-bottom: 0;}."+this.TownsPanelClassName+" ul li ul li {float: none; padding: 0; width: auto; padding-bottom: 8px;}."+this.TownsPanelClassName+" ul li ul li:nth-child(1) {font-weight: bold; font-size: 11pt; text-decoration: underline;}."+this.ResourcesBarClassName+" {}."+this.ResourcesBarClassName+" ul {overflow: auto;}."+this.ResourcesBarClassName+" ul li {float: left; padding: 5px 5px; color: white;}",i=$("<style>"+e+"</style>");$("head").append(i)},t.prototype.setBuildConfig=function(i){this.BuildConfig=i,e.Common.Helpers.logMessage(["city build",this.BuildConfig])},t.prototype.initValues=function(){var e=this;$("."+this.BuildingsPanelClassName+" form ul li ul li input").each(function(){var i=e.BuildConfig.BuildingLevels[$(this).data("building-id")];$(this).val(i),$(this).parent().parent().find("li span").first().text("("+i+")")}),$("."+this.ResearchesPanelClassName+" form ul li ul li select").each(function(){var i=1==e.BuildConfig.ResearchLevels[$(this).data("research-id")]?"Yes":"No";$(this).find("option[value="+i+"]").first().prop("selected",!0)}),this.recalculateResourcesBar()},t.prototype.registerBuildConfigListeners=function(){var i=this;-1!=this.BuildConfig.ID.indexOf("Custom")&&this.GrepoManager.PermissionService.getPermission("CustomBuildConfigs")&&($("body").on("click","."+this.TitleBarClassName+" h3 a .fa-pencil-square-o",function(){var t=i.GrepoManager.BuildConfigManager.getConfigByID($(this).data("config-id"));e.Common.Helpers.logMessage(["clicked pencil",$(this).data("config-id"),t,i.TitleBarClassName]),$("."+i.TitleBarClassName+" h3").html(t.ID+" - <input type='text' value='"+t.Title+"' data-config-id='"+$(this).data("config-id")+"'><a><i class='fa fa-lg fa-check' data-config-id='"+$(this).data("config-id")+"'></i></a>")}),$("body").on("click","."+this.TitleBarClassName+" h3 input",function(){return $(this).focus().select(),!1}),$("body").on("click","."+this.TitleBarClassName+" h3 a .fa-check",function(){var e=i.GrepoManager.BuildConfigManager.getConfigByID($(this).data("config-id"));e.Title=$("."+i.TitleBarClassName+" h3 input").val(),i.GrepoManager.BuildConfigManager.updateBuildConfig(e),i.GrepoManager.BuildConfigManager.updateToolbarTownConfig(),i.GrepoManager.BuildConfigManager.updateInterface(),$("."+i.TitleBarClassName).html("<h3>"+e.ID+" - "+e.Title+' <a><i class="fa fa-lg fa-pencil-square-o" data-config-id="'+$(this).data("config-id")+'"></i></a></h3><ul><li><a><i class="fa fa-lg fa-times"></i></a></li></ul>')}),$("body").on("keydown","."+this.TitleBarClassName+" h3 input",function(e){if(13==e.which){var t=i.GrepoManager.BuildConfigManager.getConfigByID($(this).data("config-id"));t.Title=$("."+i.TitleBarClassName+" h3 input").val(),i.GrepoManager.BuildConfigManager.updateBuildConfig(t),i.GrepoManager.BuildConfigManager.updateToolbarTownConfig(),i.GrepoManager.BuildConfigManager.updateInterface(),$("."+i.TitleBarClassName).html("<h3>"+t.ID+" - "+t.Title+' <a><i class="fa fa-lg fa-pencil-square-o" data-config-id="'+$(this).data("config-id")+'"></i></a></h3><ul><li><a><i class="fa fa-lg fa-times"></i></a></li></ul>')}}))},t.prototype.addResourcesBar=function(){this.ResourcesBarClassName=e.Common.Helpers.generateGuid();var i=$("<div class='"+this.ResourcesBarClassName+"'><ul><li><ul><li>Points: </li><li></li></ul></li><li><ul><li>Population: </li><li></li><li>/</li><li></li></ul></li></ul></div>");$("."+this.ClassName).append(i)},t.prototype.recalculateResourcesBar=function(){var i=0,t=0,n=33,a=["Theater","Thermal","Library","Lighthouse","Tower","Statue","Oracle","TradeOffice"];$("."+this.BuildingsPanelClassName+" form ul li ul li input").each(function(){if(-1!==a.indexOf($(this).data("building-id")))1==$(this).val()&&(n+=500,i+=60);else{var t=e.Common.Helpers.convertBuildingCodeToGame($(this).data("building-id"));i+=e.Common.Helpers.getPopulationForBuilding(t,$(this).val()),console.log(t),n+=e.Common.Helpers.getPointsForBuilding(t,Number($(this).val()))}}),t=this.recalculateAllowedPopulation(),$("."+this.ResourcesBarClassName+" ul li:nth-child(1) ul li:nth-child(2)").text(n),$("."+this.ResourcesBarClassName+" ul li:nth-child(2) ul li:nth-child(2)").text(i),$("."+this.ResourcesBarClassName+" ul li:nth-child(2) ul li:nth-child(4)").text(t)},t.prototype.recalculateAllowedPopulation=function(){var i=0;return"Yes"==$("select[data-research-id=Plow").val()&&(i+=200),i+=e.Common.Helpers.getMaxPopulationForFarm($("input[data-building-id=Farm").val()),1==$("input[data-building-id=Thermal]").val()&&(i*=1.1),Math.floor(i)},t.prototype.getBuildingsPanel=function(){this.BuildingsPanelClassName=e.Common.Helpers.generateGuid();var i=this;return this.GrepoManager.PermissionService.getPermission("CustomBuildConfigs")&&($("body").on("input","."+this.BuildingsPanelClassName+" form ul li ul li input",function(){$(this).parent().parent().find("li span").first().text("("+$(this).val()+")")}),$("body").on("change","."+this.BuildingsPanelClassName+" form ul li ul li input",function(){i.BuildConfig.BuildingLevels[$(this).data("building-id")]=Number($(this).val()),i.GrepoManager.BuildConfigManager.updateBuildConfig(i.BuildConfig),i.recalculateResourcesBar(),i.recalculateAvailableBuildings()})),'<div class="'+this.BuildingsPanelClassName+'"><form><ul><li><ul><li>Senate <span>()</span></li><li><input type="range" min="0" max="25" step="1" value="1" data-building-id="Main" /></li></ul></li><li><ul><li>Cave <span>()</span></li><li><input type="range" min="0" max="10" step="1" value="1" data-building-id="Hide" /></li></ul></li><li><ul><li>Timber Camp <span>()</span></li><li><input type="range" min="0" max="40" step="1" value="1" data-building-id="Lumber" /></li></ul></li><li><ul><li>Quarry <span>()</span></li><li><input type="range" min="0" max="40" step="1" value="1" data-building-id="Stoner" /></li></ul></li><li><ul><li>Iron Mine <span>()</span></li><li><input type="range" min="0" max="40" step="1" value="1" data-building-id="Ironer" /></li></ul></li><li><ul><li>Market <span>()</span></li><li><input type="range" min="0" max="30" step="1" value="1" data-building-id="Market" /></li></ul></li><li><ul><li>Harbor <span>()</span></li><li><input type="range" min="0" max="30" step="1" value="1" data-building-id="Docks" /></li></ul></li><li><ul><li>Barracks <span>()</span></li><li><input type="range" min="0" max="30" step="1" value="1" data-building-id="Barracks" /></li></ul></li><li><ul><li>Wall <span>()</span></li><li><input type="range" min="0" max="25" step="1" value="1" data-building-id="Wall" /></li></ul></li><li><ul><li>Warehouse <span>()</span></li><li><input type="range" min="0" max="35" step="1" value="1" data-building-id="Storage" /></li></ul></li><li><ul><li>Farm <span>()</span></li><li><input type="range" min="0" max="45" step="1" value="1" data-building-id="Farm" /></li></ul></li><li><ul><li>Academy <span>()</span></li><li><input type="range" min="0" max="36" step="1" value="1" data-building-id="Academy" /></li></ul></li><li><ul><li>Temple <span>()</span></li><li><input type="range" min="0" max="30" step="1" value="1" data-building-id="Temple" /></li></ul></li></ul><ul><li><h4>Special Buildings Left</h4></li><li><ul><li>Theater <span>()</span></li><li><input type="range" min="0" max="1" step="1" value="0" data-building-id="Theater" /></li></ul></li><li><ul><li>Thermal Baths <span>()</span></li><li><input type="range" min="0" max="1" step="1" value="0" data-building-id="Thermal" /></li></ul></li><li><ul><li>Library <span>()</span></li><li><input type="range" min="0" max="1" step="1" value="0" data-building-id="Library" /></li></ul></li><li><ul><li>Lighthouse <span>()</span></li><li><input type="range" min="0" max="1" step="1" value="0" data-building-id="Lighthouse" /></li></ul></li><li><h4>Special Buildings Right</h4></li><li><ul><li>Tower <span>()</span></li><li><input type="range" min="0" max="1" step="1" value="0" data-building-id="Tower" /></li></ul></li><li><ul><li>Divine Statue <span>()</span></li><li><input type="range" min="0" max="1" step="1" value="0" data-building-id="Statue" /></li></ul></li><li><ul><li>Oracle <span>()</span></li><li><input type="range" min="0" max="1" step="1" value="0" data-building-id="Oracle" /></li></ul></li><li><ul><li>Merchant&#39;s Shop <span>()</span></li><li><input type="range" min="0" max="1" step="1" value="0" data-building-id="TradeOffice" /></li></ul></li></ul></form></div>'},t.prototype.getResearchesPanel=function(){var i=this;return this.ResearchesPanelClassName=e.Common.Helpers.generateGuid(),this.GrepoManager.PermissionService.getPermission("CustomBuildConfigs")&&$("body").on("change","."+this.ResearchesPanelClassName+" form ul li ul li select",function(){var e="Yes"==$(this).val();i.BuildConfig.ResearchLevels[$(this).data("research-id")]=e,i.GrepoManager.BuildConfigManager.updateBuildConfig(i.BuildConfig),i.recalculateResourcesBar(),i.recalculateAvailableUnits($(this).data("research-id"),$(this).val())}),'<div class="'+this.ResearchesPanelClassName+'"><form><ul><li><ul><li>Slinger</li><li><select data-research-id="Slinger"><option value="Yes">Yes</option><option value="No">No</option></select></li></ul></li> <li><ul><li>Archer</li><li><select data-research-id="Archer"><option value="Yes">Yes</option><option value="No">No</option></select></li></ul></li> <li><ul><li>City Guard</li><li><select data-research-id="TownGuard"><option value="Yes">Yes</option><option value="No">No</option></select></li></ul></li> <li><ul><li>Hoplite</li><li><select data-research-id="Hoplite"><option value="Yes">Yes</option><option value="No">No</option></select></li></ul></li> <li><ul><li>Diplomacy</li><li><select data-research-id="Diplomacy"><option value="Yes">Yes</option><option value="No">No</option></select></li></ul></li> <li><ul><li>Meteorology</li><li><select data-research-id="Meteorology"><option value="Yes">Yes</option><option value="No">No</option></select></li></ul></li> <li><ul><li>Espionage</li><li><select data-research-id="Espionage"><option value="Yes">Yes</option><option value="No">No</option></select></li></ul></li> <li><ul><li>Booty</li><li><select data-research-id="Booty"><option value="Yes">Yes</option><option value="No">No</option></select></li></ul></li> <li><ul><li>Ceramics</li><li><select data-research-id="Pottery"><option value="Yes">Yes</option><option value="No">No</option></select></li></ul></li> <li><ul><li>Horesemen</li><li><select data-research-id="Rider"><option value="Yes">Yes</option><option value="No">No</option></select></li></ul></li> <li><ul><li>Architecture</li><li><select data-research-id="Architecture"><option value="Yes">Yes</option><option value="No">No</option></select></li></ul></li> <li><ul><li>Trainer</li><li><select data-research-id="Instructor"><option value="Yes">Yes</option><option value="No">No</option></select></li></ul></li> <li><ul><li>Bireme</li><li><select data-research-id="Bireme"><option value="Yes">Yes</option><option value="No">No</option></select></li></ul></li></ul><ul><li><ul><li>Crane</li><li><select data-research-id="BuildingCrane"><option value="Yes">Yes</option><option value="No">No</option></select></li></ul></li> <li><ul><li>Shipwright</li><li><select data-research-id="ShipWright"><option value="Yes">Yes</option><option value="No">No</option></select></li></ul></li> <li><ul><li>Chariots</li><li><select data-research-id="Chariot"><option value="Yes">Yes</option><option value="No">No</option></select></li></ul></li> <li><ul><li>Light Ship</li><li><select data-research-id="AttackShip"><option value="Yes">Yes</option><option value="No">No</option></select></li></ul></li> <li><ul><li>Conscription</li><li><select data-research-id="Conscription"><option value="Yes">Yes</option><option value="No">No</option></select></li></ul></li> <li><ul><li>Fire Ship</li><li><select data-research-id="DemolitionShip"><option value="Yes">Yes</option><option value="No">No</option></select></li></ul></li> <li><ul><li>Catapult</li><li><select data-research-id="Catapult"><option value="Yes">Yes</option><option value="No">No</option></select></li></ul></li><li><ul><li>Cryptography</li><li><select data-research-id="Cryptography"><option value="Yes">Yes</option><option value="No">No</option></select></li></ul></li> <li><ul><li>Democracy</li><li><select data-research-id="Democracy"><option value="Yes">Yes</option><option value="No">No</option></select></li></ul></li> <li><ul><li>Colony Ship</li><li><select data-research-id="ColonizeShip"><option value="Yes">Yes</option><option value="No">No</option></select></li></ul></li> <li><ul><li>Fast Transport Ship</li><li><select data-research-id="SmallTransporter"><option value="Yes">Yes</option><option value="No">No</option></select></li></ul></li> <li><ul><li>Plow</li><li><select data-research-id="Plow"><option value="Yes">Yes</option><option value="No">No</option></select></li></ul></li> <li><ul><li>Bunks</li><li><select data-research-id="Berth"><option value="Yes">Yes</option><option value="No">No</option></select></li></ul></li> </ul><ul><li><ul><li>Trireme</li><li><select data-research-id="Trireme"><option value="Yes">Yes</option><option value="No">No</option></select></li></ul></li> <li><ul><li>Phalanx</li><li><select data-research-id="Phalanx"><option value="Yes">Yes</option><option value="No">No</option></select></li></ul></li> <li><ul><li>Breakthrough</li><li><select data-research-id="Breach"><option value="Yes">Yes</option><option value="No">No</option></select></li></ul></li> <li><ul><li>Mathematics</li><li><select data-research-id="Mathematics"><option value="Yes">Yes</option><option value="No">No</option></select></li></ul></li> <li><ul><li>Battering Ram</li><li><select data-research-id="Ram"><option value="Yes">Yes</option><option value="No">No</option></select></li></ul></li> <li><ul><li>Cartography</li><li><select data-research-id="Cartography"><option value="Yes">Yes</option><option value="No">No</option></select></li></ul></li> <li><ul><li>Conquest</li><li><select data-research-id="TakeOverOld"><option value="Yes">Yes</option><option value="No">No</option></select></li></ul></li> <li><ul><li>Stone Hail</li><li><select data-research-id="StoneStorm"><option value="Yes">Yes</option><option value="No">No</option></select></li></ul></li> <li><ul><li>Temple Looting</li><li><select data-research-id="TempleLooting"><option value="Yes">Yes</option><option value="No">No</option></select></li></ul></li> <li><ul><li>Divine Selection</li><li><select data-research-id="DivineSelection"><option value="Yes">Yes</option><option value="No">No</option></select></li></ul></li> <li><ul><li>Battle Experience</li><li><select data-research-id="CombatExperience"><option value="Yes">Yes</option><option value="No">No</option></select></li></ul></li> <li><ul><li>Strong Wine</li><li><select data-research-id="StrongWine"><option value="Yes">Yes</option><option value="No">No</option></select></li></ul></li> <li><ul><li>Set Sail</li><li><select data-research-id="SetSail"><option value="Yes">Yes</option><option value="No">No</option></select></li></ul></li> </ul></form></div>'},t.prototype.getUnitsPanel=function(){return this.UnitsPanelClassName=e.Common.Helpers.generateGuid(),
  2. '<div class="'+this.UnitsPanelClassName+'"><form><ul><li><ul><li>Sword</li><li><input type="text" value="0" data-unit-id="Sword" /></li></ul></li><li><ul><li>Slinger</li><li><input type="text" value="0" data-unit-id="Slinger" /></li></ul></li><li><ul><li>Archer</li><li><input type="text" value="0" data-unit-id="Archer" /></li></ul></li><li><ul><li>Hoplite</li><li><input type="text" value="0" data-unit-id="Hoplite" /></li></ul></li><li><ul><li>Rider</li><li><input type="text" value="0" data-unit-id="Horseman" /></li></ul></li><li><ul><li>Chariot</li><li><input type="text" value="0" data-unit-id="Chariot" /></li></ul></li><li><ul><li>Catapult</li><li><input type="text" value="0" data-unit-id="Catapult" /></li></ul></li></ul><ul><li><ul><li>Minotaur</li><li><input type="text" value="0" data-unit-id="Minotaur" /></li></ul></li><li><ul><li>Manticore</li><li><input type="text" value="0" data-unit-id="Manticore" /></li></ul></li><li><ul><li>Cyclops</li><li><input type="text" value="0" data-unit-id="Zyklop" /></li></ul></li><li><ul><li>Hydra</li><li><input type="text" value="0" data-unit-id="SeaMonster" /></li></ul></li><li><ul><li>Centaur</li><li><input type="text" value="0" data-unit-id="Centaur" /></li></ul></li><li><ul><li>Pegasus</li><li><input type="text" value="0" data-unit-id="Pegasus" /></li></ul></li><li><ul><li>Cerberus</li><li><input type="text" value="0" data-unit-id="Cerberus" /></li></ul></li><li><ul><li>Erinys</li><li><input type="text" value="0" data-unit-id="Fury" /></li></ul></li><li><ul><li>Griffin</li><li><input type="text" value="0" data-unit-id="Griffin" /></li></ul></li><li><ul><li>Calydonian Boar</li><li><input type="text" value="0" data-unit-id="CalydonianBoar" /></li></ul></li><li><ul><li>Harpy</li><li><input type="text" value="0" data-unit-id="Harpy" /></li></ul></li><li><ul><li>Medusa</li><li><input type="text" value="0" data-unit-id="Medusa" /></li></ul></li><li><ul><li>Envoy</li><li><input type="text" value="0" data-unit-id="Godsent" /></li></ul></li></ul><ul><li><ul><li>Transport Boat</li><li><input type="text" value="0" data-unit-id="BigTransporter" /></li></ul></li><li><ul><li>Bireme</li><li><input type="text" value="0" data-unit-id="Bireme" /></li></ul></li><li><ul><li>Light Ship</li><li><input type="text" value="0" data-unit-id="AttackShip" /></li></ul></li><li><ul><li>Fire Ship</li><li><input type="text" value="0" data-unit-id="DemolitionShip" /></li></ul></li><li><ul><li>Fast Transport</li><li><input type="text" value="0" data-unit-id="SmallTransporter" /></li></ul></li><li><ul><li>Trireme</li><li><input type="text" value="0" data-unit-id="Trireme" /></li></ul></li><li><ul><li>Colony Ship</li><li><input type="text" value="0" data-unit-id="ColonizeShip" /></li></ul></li></ul></form></div>'},t.prototype.getTownsPanel=function(){var i=ITowns.getTowns();this.TownsPanelClassName=e.Common.Helpers.generateGuid();for(var t='<div class="'+this.TownsPanelClassName+'"><ul>',n=this.GrepoManager.BuildConfigManager.getTownsInGroup(this.GrepoManager.BuildConfigManager.getConfigNumberFromID(this.BuildConfig.ID)),a=0,o=n;a<o.length;a++){var r=o[a];t+="<li><ul><li>"+i[r].name+"</li><li>"+i[r].getPoints().toLocaleString()+" points</li><li>("+i[r].getIslandCoordinateX()+","+i[r].getIslandCoordinateY()+")</li><li>God: "+gmHelpers._.capitalize(i[r].god(),!0)+"</li></ul></li>"}return t+="</ul></div>"},t.prototype.updateInterface=function(){i.prototype.updateInterface.call(this);for(var e=ITowns.getTowns(),t="<ul>",n=this.GrepoManager.BuildConfigManager.getTownsInGroup(this.GrepoManager.BuildConfigManager.getConfigNumberFromID(this.BuildConfig.ID)),a=0,o=n;a<o.length;a++){var r=o[a];t+="<li><ul><li>"+e[r].name+"</li><li>"+e[r].getPoints().toLocaleString()+" points</li><li>("+e[r].getIslandCoordinateX()+","+e[r].getIslandCoordinateY()+")</li><li>God: "+gmHelpers._.capitalize(e[r].god(),!0)+"</li></ul></li>"}t+="</ul>",$("."+this.TownsPanelClassName).html(t)},t.prototype.recalculateAvailableUnits=function(e,i){var e=gmHelpers._.capitalize(e,!0);i?$("."+this.UnitsPanelClassName+" input[data-unit-id="+e+"]").prop("disabled",!1).val(0):$("."+this.UnitsPanelClassName+" input[data-unit-id="+e+"]").prop("disabled",!0).val(0)},t.prototype.getBuildingLevel=function(e){var e=gmHelpers._.capitalize(e,!0);return $("."+this.BuildingsPanelClassName+' input[data-building-id="'+e+'"]').val()},t.prototype.setBuildingLevel=function(e,i){var e=gmHelpers._.capitalize(e,!0);$("."+this.BuildingsPanelClassName+' input[data-building-id="'+e+'"]').val(i)},t.prototype.disableBuilding=function(e){this.setBuildingLevel(e,0),$("."+this.BuildingsPanelClassName+' input[data-building-id="'+e+'"]').prop("disabled",!0)},t.prototype.enableBuilding=function(e){$("."+this.BuildingsPanelClassName+' input[data-building-id="'+e+'"]').prop("disabled",!1)},t.prototype.recalculateAvailableBuildings=function(){this.getBuildingLevel("Main")<10||this.getBuildingLevel("Storage")<7||this.getBuildingLevel("Market")<4?this.disableBuilding("Hide"):this.enableBuilding("Hide"),this.getBuildingLevel("Lumber")<1?this.disableBuilding("Ironer"):this.enableBuilding("Ironer"),this.getBuildingLevel("Main")<3||this.getBuildingLevel("Storage")<5?this.disableBuilding("Market"):this.enableBuilding("Market"),this.getBuildingLevel("Main")<14||this.getBuildingLevel("Lumber")<15||this.getBuildingLevel("Ironer")<10?this.disableBuilding("Docks"):this.enableBuilding("Docks"),this.getBuildingLevel("Ironer")<1||this.getBuildingLevel("Main")<2||this.getBuildingLevel("Farm")<3||this.getBuildingLevel("Lumber")<1?this.disableBuilding("Barracks"):this.enableBuilding("Barracks"),this.getBuildingLevel("Main")<5||this.getBuildingLevel("Temple")<3?this.disableBuilding("Wall"):this.enableBuilding("Wall"),this.getBuildingLevel("Main")<8||this.getBuildingLevel("Farm")<6||this.getBuildingLevel("Barracks")<5?this.disableBuilding("Academy"):this.enableBuilding("Academy"),this.getBuildingLevel("Stoner")<1?this.disableBuilding("Temple"):this.enableBuilding("Temple"),this.getBuildingLevel("Main")<24||this.getBuildingLevel("Lumber")<35||this.getBuildingLevel("Ironer")<32||this.getBuildingLevel("Docks")<5||this.getBuildingLevel("Academy")<5?this.disableBuilding("Theater"):this.enableBuilding("Theater"),this.getBuildingLevel("Main")<24||this.getBuildingLevel("Farm")<35||this.getBuildingLevel("Docks")<5||this.getBuildingLevel("Academy")<5?this.disableBuilding("Thermal"):this.enableBuilding("Thermal"),this.getBuildingLevel("Main")<24||this.getBuildingLevel("Docks")<5||this.getBuildingLevel("Academy")<20?this.disableBuilding("Library"):this.enableBuilding("Library"),this.getBuildingLevel("Main")<24||this.getBuildingLevel("Docks")<20||this.getBuildingLevel("Academy")<5?this.disableBuilding("Lighthouse"):this.enableBuilding("Lighthouse"),this.getBuildingLevel("Main")<21||this.getBuildingLevel("Wall")<20||this.getBuildingLevel("Temple")<5||this.getBuildingLevel("Market")<5?this.disableBuilding("Tower"):this.enableBuilding("Tower"),this.getBuildingLevel("Main")<21||this.getBuildingLevel("Temple")<12||this.getBuildingLevel("Market")<5?this.disableBuilding("Statue"):this.enableBuilding("Statue"),this.getBuildingLevel("Main")<21||this.getBuildingLevel("Hide")<10||this.getBuildingLevel("Market")<5||this.getBuildingLevel("Temple")<5?this.disableBuilding("Oracle"):this.enableBuilding("Oracle"),this.getBuildingLevel("Main")<21||this.getBuildingLevel("Market")<15||this.getBuildingLevel("Temple")<5?this.disableBuilding("TradeOffice"):this.enableBuilding("TradeOffice")},t}(e.Layout.Windows.BaseWindow);i.BuildConfigWindow=n;var a=function(i){function t(e){var t=i.call(this,e)||this;return t._UserPanelClassName="",t._KeyBindingsPanelClassName="",t}return __extends(t,i),Object.defineProperty(t.prototype,"UserPanelClassName",{get:function(){return this._UserPanelClassName},set:function(e){this._UserPanelClassName=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"KeyBindingsPanelClassName",{get:function(){return this._KeyBindingsPanelClassName},set:function(e){this._KeyBindingsPanelClassName=e},enumerable:!0,configurable:!0}),t.prototype.init=function(e){i.prototype.init.call(this,e),this.addNavigation([{Title:"User"},{Title:"Key Bindings"}]),this.addPanel(this.getUserPanel()),this.addPanel(this.getKeyBindingsPanel())},t.prototype.getUserPanel=function(){return this.UserPanelClassName=e.Common.Helpers.generateGuid(),"<div class='"+this.UserPanelClassName+"'></div>"},t.prototype.getKeyBindingsPanel=function(){return this.KeyBindingsPanelClassName=e.Common.Helpers.generateGuid(),"<div class='"+this.KeyBindingsPanelClassName+"'></div>"},t}(t);i.SettingsWindow=a;var o=function(i){function t(e){var t=i.call(this,e)||this;return t._TownSortBarClassName="",t._TownMenuClassName="",t}return __extends(t,i),Object.defineProperty(t.prototype,"TownSortBarClassName",{get:function(){return this._TownSortBarClassName},set:function(e){this._TownSortBarClassName=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"TownMenuClassName",{get:function(){return this._TownMenuClassName},set:function(e){this._TownMenuClassName=e},enumerable:!0,configurable:!0}),t.prototype.init=function(t){i.prototype.init.call(this,t);for(var n=[],a=this.GrepoManager.BuildConfigManager.getBuildConfigs(),o=0,r=a;o<r.length;o++){var s=r[o],l=this.GrepoManager.BuildConfigManager.getConfigNumberFromID(s.ID),u=this.GrepoManager.BuildConfigManager.getTownsInGroup(l);n.push({Title:s.ID+" ("+u.length+")"}),this.addConfigTownsPanel(s)}this.addNavigation(n),this.addTownSortBar(),this.TownMenuClassName=e.Common.Helpers.generateGuid(),this.addStyles(),this.registerTownListeners()},t.prototype.addStyles=function(){var e="."+this.ClassName+" ."+this.ContentClassName+" div {}."+this.ClassName+" ."+this.ContentClassName+" div ul {margin-bottom: 8px}."+this.ClassName+" ."+this.ContentClassName+" div ul li {position: relative; width: 199px; padding: 8px 0px 0 8px; float: left;}."+this.ClassName+" ."+this.ContentClassName+" div ul li ul {border: 2px solid black; background: rgba(155, 155, 155, 1); overflow: auto; height: 122px; padding: 4px 8px 0 8px; margin-bottom: 0;}."+this.ClassName+" ."+this.ContentClassName+" div ul li ul li {float: none; padding: 0; width: auto; padding-bottom: 8px;}."+this.ClassName+" ."+this.ContentClassName+" div ul li ul h4 {padding-bottom: 8px; font-weight: bold; font-size: 11pt; text-decoration: underline;}."+this.ClassName+" ."+this.ContentClassName+" div a {position: absolute; top: 16px; right: 11px; color: white;}."+this.ClassName+" ."+this.TownSortBarClassName+" {width: 628px; position: absolute; top: 525px; left: 152px; background: rgb(53, 56, 58); z-index: 2000; height: 37px; border-top: 2px solid black;}."+this.ClassName+" ."+this.TownSortBarClassName+" ul {overflow: auto;}."+this.ClassName+" ."+this.TownSortBarClassName+" ul li {float: left; padding: 5px 5px; color: white;}."+this.ClassName+" ."+this.ContentClassName+" div ul ."+this.TownMenuClassName+" {position: relative; display: block; overflow: auto; height: auto;}."+this.ClassName+" ."+this.ContentClassName+" div ul ."+this.TownMenuClassName+" ul {border: 0; padding: 0; overflow: auto; height: auto;}."+this.ClassName+" ."+this.ContentClassName+" div ul ."+this.TownMenuClassName+" li a {position: initial;}."+this.ClassName+" ."+this.ContentClassName+" div ul ."+this.TownMenuClassName+" ul li {list-style: none; float: left; width: 79px; border: 1px solid black; overflow: hidden; height: 17px; background: rgb(53, 56, 58); margin: 0px 0px 8px 0; font-size: 11px; padding: 3px 2px 0px; color: white; }."+this.ClassName+" ."+this.ContentClassName+" div ul ."+this.TownMenuClassName+" ul li:nth-child(even) {}."+this.ClassName+" ."+this.ContentClassName+" div ul ."+this.TownMenuClassName+" ul li:nth-child(odd) {margin-right: 8px;}",i=$("<style>"+e+"</style>");$("head").append(i)},t.prototype.addConfigTownsPanel=function(e){for(var i=ITowns.getTowns(),t='<div data-config-id="'+e.ID+'"><ul>',n=this.GrepoManager.BuildConfigManager.getTownsInGroup(this.GrepoManager.BuildConfigManager.getConfigNumberFromID(e.ID)),a=0,o=n;a<o.length;a++){var r=o[a];t+="<li><ul data-town-id='"+r+"' data-town-name='"+i[r].name+"'><h4>"+i[r].name+"</h4><li>"+i[r].getPoints().toLocaleString()+" points</li><li>("+i[r].getIslandCoordinateX()+","+i[r].getIslandCoordinateY()+")</li><li>God: "+gmHelpers._.capitalize(i[r].god(),!0)+"</li><a href='#'><i class='fa fa-lg fa-bars'></i></a></ul></li>"}t+="</ul></div>",this.addPanel(t)},t.prototype.updateConfigTownsPanel=function(e){},t.prototype.updateInterface=function(){i.prototype.updateInterface.call(this);for(var e=this.GrepoManager.BuildConfigManager.getBuildConfigs(),t=0,n=e;t<n.length;t++){var a=n[t],o=this.GrepoManager.BuildConfigManager.getConfigNumberFromID(a.ID);this.GrepoManager.BuildConfigManager.getTownsInGroup(o);this.updateConfigTownsPanel(a)}},t.prototype.addTownSortBar=function(){this.TownSortBarClassName=e.Common.Helpers.generateGuid();var i=$("<div class='"+this.TownSortBarClassName+"'><ul></ul></div>");$("."+this.ClassName).append(i)},t.prototype.registerTownListeners=function(){var i=this;$("body").on("click","."+this.ContentClassName+" li a i.fa-bars",function(){return $(this).parent().parent().find("."+i.TownMenuClassName).length>0?i.hideTownMenu($(this).parent()):i.showTownMenu($(this).parent()),!1}),$("body").on("click","."+this.TownMenuClassName+" li:nth-child(1) a",function(){}),$("body").on("click","."+this.TownMenuClassName+" li:nth-child(2) a",function(){var i=$(this).parent().parent().parent().parent().data("town-id");return e.Common.Helpers.switchToTown(i),!1}),$("body").on("click","."+this.TownMenuClassName+" li:nth-child(3) a",function(){var t=$(this).parent().parent().parent().parent().data("town-id"),n=$(this).parent().parent().parent().parent().data("town-name");return e.Common.Helpers.openAttackWindow(t,n),i.dispose(),!1}),$("body").on("click","."+this.TownMenuClassName+" li:nth-child(4) a",function(){var t=$(this).parent().parent().parent().parent().data("town-id"),n=$(this).parent().parent().parent().parent().data("town-name");return e.Common.Helpers.openSupportWindow(t,n),i.dispose(),!1}),$("body").on("click","."+this.TownMenuClassName+" li:nth-child(5) a",function(){var t=$(this).parent().parent().parent().parent().data("town-id"),n=$(this).parent().parent().parent().parent().data("town-name");return e.Common.Helpers.openTradeWindow(t,n),i.dispose(),!1})},t.prototype.showTownMenu=function(e){console.log("showing town menu");var i="<div class='"+this.TownMenuClassName+"'><ul><li><a href='#'>Set Group</a></li><li><a href='#'>Select Town</a></li><li><a href='#'>Attack</a></li><li><a href='#'>Support</a></li><li><a href='#'>Trade</a></li></ul></div>";e.parent().find("li").hide(),e.parent().append(i)},t.prototype.hideTownMenu=function(e){$(e).parent().find("."+this.TownMenuClassName).remove(),$(e).parent().find("li").show()},t}(t);i.BuildConfigGroupTownWindow=o;var r=function(e){function i(i){return e.call(this,i)||this}return __extends(i,e),i}(t);i.TeamWindow=r;var s=function(e){function i(i){return e.call(this,i)||this}return __extends(i,e),i.prototype.init=function(i){this.GrepoManager.LayoutManager.showOverlay(),e.prototype.init.call(this,i),this.addStyles()},i.prototype.addStyles=function(){var e=$("<style></style>");$("head").append(e)},i}(t);i.UserLoginWindow=s}(i.Windows||(i.Windows={}))}(e.Layout||(e.Layout={}))}(Grepo||(Grepo={}));var Grepo;!function(e){!function(i){!function(i){var t=function(){function i(e){this._ClassName="",this.Parent=e,this.addStyles()}return Object.defineProperty(i.prototype,"Parent",{get:function(){return this._Parent},set:function(e){this._Parent=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"ClassName",{get:function(){return this._ClassName},set:function(e){this._ClassName=e},enumerable:!0,configurable:!0}),i.prototype.addToolbarToWindow=function(){e.Common.Helpers.logMessage("adding senate toolbar to window");var i=this,t=[{Title:"Build Next",Action:function(){i.Parent.GrepoManager.BuildingManager.build()}},{Title:"Highlight Buildings",Action:function(){i.Parent.GrepoManager.BuildingManager.highlightBuildings()}},{Title:"Share To GM",Action:function(){i.Parent.GrepoManager.ContextMenuManager.toolbars.building_main.shareBuildings()}}],n=$("<div class='"+this.ClassName+"'><ul><li><span>GrepoManager: </span></li></ul></div>");$(".js-window-main-container .gpwindow_frame .gpwindow_content #techtree #buildings").parent().parent().append(n);for(var a=0,o=t;a<o.length;a++){var r=o[a],s=$("<li><a>"+r.Title+"</a></li>").on("click",r.Action);$("."+this.ClassName+" ul").append(s)}},i.prototype.addStyles=function(){if(""==this.ClassName){this.ClassName=e.Common.Helpers.generateGuid();var i="."+this.ClassName+" {background-color: rgb(53, 56, 58); width: 790px; height: 30px; position: absolute; bottom: 0; box-sizing: border-box; color: white; padding-top: 3px; border: 2px solid black;}."+this.ClassName+" li {margin: 0 10px; float: left;}."+this.ClassName+" span {top: 1px; position: relative;}."+this.ClassName+" li a{cursor: pointer; float: left; padding: 1px 7px 1px 7px; color: #373a3c; background-color: #fff; border-color: #ccc; display: inline-block; font-weight: 400; line-height: 1.25; text-align: center; white-space: nowrap; vertical-align: middle; cursor: pointer; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; border: 1px solid transparent; border-radius: .25rem; color: #373a3c; background-color: #fff; border-color: #ccc;}."+this.ClassName+" li a:hover {color: #373a3c; background-color: #e6e6e6; border-color: #adadad;}."+this.ClassName+" li a:active {color: #373a3c; background-color: #b7b5b5 !important; border-color: #adadad;}",t=$("<style>"+i+"</style>");$("head").append(t)}},i.prototype.checkToolbar=function(){0==$("."+this.ClassName).length&&this.addToolbarToWindow()},i.prototype.shareBuildings=function(){var i=this.Parent.GrepoManager.BuildingManager.getBuildingLevels(),t=i.serialize();e.Common.Helpers.logMessage([i,t]),swal("Uploaded!","Your city build has been uploaded!","success")},i}();i.SenateContextMenu=t}(i.ContextMenu||(i.ContextMenu={}))}(e.Layout||(e.Layout={}))}(Grepo||(Grepo={}));var Grepo;!function(e){!function(i){!function(i){var t=function(){function i(e){this._ClassName="",this.Parent=e,this.addStyles()}return Object.defineProperty(i.prototype,"Parent",{get:function(){return this._Parent},set:function(e){this._Parent=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"ClassName",{get:function(){return this._ClassName},set:function(e){this._ClassName=e},enumerable:!0,configurable:!0}),i.prototype.addToolbarToWindow=function(){e.Common.Helpers.logMessage("adding docks toolbar to window");var i=$("<div class='"+this.ClassName+"'><ul><li>Item 1</li></ul></div>");$(".js-window-main-container .gpwindow_frame .gpwindow_content #unit_order #units #big_transporter").parent().parent().parent().append(i)},i.prototype.addStyles=function(){if(""==this.ClassName){this.ClassName=e.Common.Helpers.generateGuid();var i="."+this.ClassName+" {width: 790px; height: 25px; background-color: rgb(53, 56, 58); position: absolute; bottom: 0; border-top: 2px solid black; border-bottom: 2px solid black; box-sizing: border-box; border: 2px solid black; color: white; }."+this.ClassName+" li {cursor: pointer; float: left; padding: 2px 7px 3px 7px; }."+this.ClassName+" li:hover {background-color: rgb(88, 92, 95);}",t=$("<style>"+i+"</style>");$("head").append(t)}},i.prototype.checkToolbar=function(){0==$("."+this.ClassName).length&&this.addToolbarToWindow()},i}();i.DocksContextMenu=t}(i.ContextMenu||(i.ContextMenu={}))}(e.Layout||(e.Layout={}))}(Grepo||(Grepo={}));var Grepo;!function(e){!function(i){!function(i){var t=function(){function i(e){this._ClassName="",this.Parent=e,this.addStyles()}return Object.defineProperty(i.prototype,"Parent",{get:function(){return this._Parent},set:function(e){this._Parent=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"ClassName",{get:function(){return this._ClassName},set:function(e){this._ClassName=e},enumerable:!0,configurable:!0}),i.prototype.addToolbarToWindow=function(){e.Common.Helpers.logMessage("adding barracks toolbar to window");var i=$("<div class='"+this.ClassName+"'><ul><li>Item 1</li></ul></div>");$(".js-window-main-container .gpwindow_frame .gpwindow_content #unit_order #units").parent().parent().append(i)},i.prototype.addStyles=function(){if(""==this.ClassName){this.ClassName=e.Common.Helpers.generateGuid();var i="."+this.ClassName+" {width: 790px; height: 25px; background-color: rgb(53, 56, 58); position: absolute; bottom: 0; border-top: 2px solid black; border-bottom: 2px solid black; box-sizing: border-box; border: 2px solid black; color: white; }."+this.ClassName+" li {cursor: pointer; float: left; padding: 2px 7px 3px 7px; }."+this.ClassName+" li:hover {background-color: rgb(88, 92, 95);}",t=$("<style>"+i+"</style>");$("head").append(t)}},i.prototype.checkToolbar=function(){0==$("."+this.ClassName).length&&this.addToolbarToWindow()},i}();i.BarracksContextMenu=t}(i.ContextMenu||(i.ContextMenu={}))}(e.Layout||(e.Layout={}))}(Grepo||(Grepo={}));var Grepo;!function(e){!function(i){!function(i){var t=function(){function i(e){this._ClassName="",this.Parent=e,this.addStyles()}return Object.defineProperty(i.prototype,"Parent",{get:function(){return this._Parent},set:function(e){this._Parent=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"ClassName",{get:function(){return this._ClassName},set:function(e){this._ClassName=e},enumerable:!0,configurable:!0}),i.prototype.addToolbarToWindow=function(){e.Common.Helpers.logMessage("adding academy toolbar to window");var i=$("<div class='"+this.ClassName+"'><ul><li>Item 1</li></ul></div>");$(".js-window-main-container.classic_window.academy .window_content").append(i)},i.prototype.addStyles=function(){if(""==this.ClassName){this.ClassName=e.Common.Helpers.generateGuid();var i="."+this.ClassName+" {width: 790px; height: 25px; background-color: rgb(53, 56, 58); position: absolute; bottom: 8px; left: 16px; border-top: 2px solid black; border-bottom: 2px solid black; box-sizing: border-box; border: 2px solid black; color: white; }."+this.ClassName+" li {cursor: pointer; float: left; padding: 2px 7px 3px 7px; }."+this.ClassName+" li:hover {background-color: rgb(88, 92, 95);}",t=$("<style>"+i+"</style>");$("head").append(t)}},i.prototype.checkToolbar=function(){0==$("."+this.ClassName).length&&this.addToolbarToWindow()},i}();i.AcademyContextMenu=t}(i.ContextMenu||(i.ContextMenu={}))}(e.Layout||(e.Layout={}))}(Grepo||(Grepo={}));var Grepo;!function(e){!function(e){!function(e){var i=function(){function e(){this.Id=0,this.Name="",this.Points=0,this.Owner=null}return e}();e.Town=i}(e.Models||(e.Models={}))}(e.Common||(e.Common={}))}(Grepo||(Grepo={}));var Grepo;!function(e){!function(e){!function(e){var i=function(){function e(){this.PlayerID=0,this.TownID=0}return e}();e.ReportPlayer=i}(e.Models||(e.Models={}))}(e.Common||(e.Common={}))}(Grepo||(Grepo={}));var Grepo;!function(e){!function(e){!function(e){var i=function(){function e(){this.Id=0,this.Name="",this.Points=0}return e}();e.Player=i}(e.Models||(e.Models={}))}(e.Common||(e.Common={}))}(Grepo||(Grepo={}));var Grepo;!function(e){!function(i){!function(i){var t=function(){function i(e){this.Sword=0,this.Slinger=0,this.Archer=0,this.Hoplite=0,this.Rider=0,this.Chariot=0,this.Catapult=0,this.Minotaur=0,this.Manticore=0,this.Zyklop=0,this.SeaMonster=0,this.Centaur=0,this.Pegasus=0,this.Cerberus=0,this.Fury=0,this.Griffin=0,this.CalydonianBoar=0,this.Harpy=0,this.Medusa=0,this.Godsent=0,this.BigTransporter=0,this.Bireme=0,this.AttackShip=0,this.DemolitionShip=0,this.SmallTransporter=0,this.Trireme=0,this.ColonizeShip=0;for(var i in e)this[i]=e[i]}return i.prototype.serialize=function(){return JSON.stringify(this)},i.initWithNoTroops=function(){return new e.Common.Containers.UnitLevelContainer({Sword:0,Slinger:0,Archer:0,Hoplite:0,Rider:0,Chariot:0,Catapult:0,Minotaur:0,Manticore:0,Zyklop:0,SeaMonster:0,Centaur:0,Pegasus:0,Cerberus:0,Fury:0,Griffin:0,CalydonianBoar:0,Harpy:0,Medusa:0,Godsent:0,BigTransporter:0,Bireme:0,AttackShip:0,DemolitionShip:0,SmallTransporter:0,Trireme:0,ColonizeShip:0})},i}();i.UnitLevelContainer=t}(i.Containers||(i.Containers={}))}(e.Common||(e.Common={}))}(Grepo||(Grepo={}));var Grepo;!function(e){!function(i){!function(i){var t=function(){function i(e){this.Slinger=!1,this.Archer=!1,this.TownGuard=!1,this.Hoplite=!1,this.Diplomacy=!1,this.Meteorology=!1,this.Espionage=!1,this.Booty=!1,this.Pottery=!1,this.Rider=!1,this.Architecture=!1,this.Instructor=!1,this.Bireme=!1,this.BuildingCrane=!1,this.ShipWright=!1,this.Chariot=!1,this.AttackShip=!1,this.Conscription=!1,this.DemolitionShip=!1,this.Catapult=!1,this.Cryptography=!1,this.Democracy=!1,this.ColonizeShip=!1,this.SmallTransporter=!1,this.Plow=!1,this.Berth=!1,this.Trireme=!1,this.Phalanx=!1,this.Breach=!1,this.Mathematics=!1,this.Ram=!1,this.Cartography=!1,this.TakeOverOld=!1,this.StoneStorm=!1,this.TempleLooting=!1,this.DivineSelection=!1,this.CombatExperience=!1,this.StrongWine=!1,this.SetSail=!1;for(var i in e)this[i]=e[i]}return i.prototype.serialize=function(){return JSON.stringify(this)},i.initWithNoResearches=function(){return new e.Common.Containers.ResearchLevelContainer({Slinger:!1,Archer:!1,TownGuard:!1,Hoplite:!1,Diplomacy:!1,Meteorology:!1,Espionage:!1,Booty:!1,Pottery:!1,Rider:!1,Architecture:!1,Instructor:!1,Bireme:!1,BuildingCrane:!1,ShipWright:!1,Chariot:!1,AttackShip:!1,Conscription:!1,DemolitionShip:!1,Catapult:!1,Cryptography:!1,Democracy:!1,ColonizeShip:!1,SmallTransporter:!1,Plow:!1,Berth:!1,Trireme:!1,Phalanx:!1,Breach:!1,Mathematics:!1,Ram:!1,Cartography:!1,TakeOverOld:!1,StoneStorm:!1,TempleLooting:!1,DivineSelection:!1,CombatExperience:!1,StrongWine:!1,SetSail:!1})},i}();i.ResearchLevelContainer=t}(i.Containers||(i.Containers={}))}(e.Common||(e.Common={}))}(Grepo||(Grepo={}));var Grepo;!function(e){!function(e){!function(e){var i=function(){function e(e){this.Administrator=!1,this.Merchant=!1,this.HighPriestess=!1,this.Commander=!1,this.Captain=!1;for(var i in e)this[i]=e[i]}return e}();e.PremiumAdvisersContainer=i}(e.Containers||(e.Containers={}))}(e.Common||(e.Common={}))}(Grepo||(Grepo={}));var Grepo;!function(e){!function(e){!function(e){var i=function(){function e(e){this.Slinger=!1,this.Archer=!1,this.TownGuard=!1,this.Hoplite=!1,this.Diplomacy=!1,this.Meteorology=!1,this.Espionage=!1,this.Booty=!1,this.Pottery=!1,this.Rider=!1,this.Architecture=!1,this.Instructor=!1,this.Bireme=!1,this.BuildingCrane=!1,this.ShipWright=!1,this.Chariot=!1,this.AttackShip=!1,this.Conscription=!1,this.DemolitionShip=!1,this.Catapult=!1,this.Cryptography=!1,this.Democracy=!1,this.ColonizeShip=!1,this.SmallTransporter=!1,this.Plow=!1,this.Berth=!1,this.Trireme=!1,this.Phalanx=!1,this.Breach=!1,this.Mathematics=!1,this.Ram=!1,this.Cartography=!1,this.TakeOverOld=!1,this.StoneStorm=!1,this.TempleLooting=!1,this.DivineSelection=!1,this.CombatExperience=!1,this.StrongWine=!1,this.SetSail=!1,this.EmptySlots=0;for(var i in e)this[i]=e[i]}return e.prototype.canResearch=function(e){return this.EmptySlots>0&&this[e]},e.prototype.canResearchAnything=function(){return this.EmptySlots>0&&(this.Slinger||this.Archer||this.TownGuard||this.Hoplite||this.Diplomacy||this.Meteorology||this.Espionage||this.Booty||this.Pottery||this.Rider||this.Architecture||this.Instructor||this.Bireme||this.BuildingCrane||this.ShipWright||this.Chariot||this.AttackShip||this.Conscription||this.DemolitionShip||this.Catapult||this.Cryptography||this.Democracy||this.ColonizeShip||this.SmallTransporter||this.Plow||this.Berth||this.Trireme||this.Phalanx||this.Breach||this.Mathematics||this.Ram||this.Cartography||this.TakeOverOld||this.StoneStorm||this.TempleLooting||this.DivineSelection||this.CombatExperience||this.StrongWine||this.SetSail)},e}();e.PossibleResearchContainer=i}(e.Containers||(e.Containers={}))}(e.Common||(e.Common={}))}(Grepo||(Grepo={}));var Grepo;!function(e){!function(e){!function(e){var i=function(){function e(e){this.Main=!1,this.Hide=!1,this.Lumber=!1,this.Stoner=!1,this.Ironer=!1,this.Market=!1,this.Docks=!1,this.Barracks=!1,this.Wall=!1,this.Storage=!1,this.Farm=!1,this.Academy=!1,this.Temple=!1,this.Theater=!1,this.Thermal=!1,this.Library=!1,this.Lighthouse=!1,this.Tower=!1,this.Statue=!1,this.Oracle=!1,this.TradeOffice=!1,this.EmptySlots=0;for(var i in e)this[i]=e[i]}return e.prototype.canBuildBuilding=function(e){return this.EmptySlots>0&&this[e]},e.prototype.canBuildAnyMainBuilding=function(){return this.EmptySlots>0&&(this.Main||this.Hide||this.Lumber||this.Stoner||this.Ironer||this.Market||this.Docks||this.Barracks||this.Wall||this.Storage||this.Farm||this.Academy||this.Temple)},e.prototype.canBuildAnyLeftSpecialBuilding=function(){return this.EmptySlots>0&&(this.Theater||this.Thermal||this.Library||this.Lighthouse)},e.prototype.canBuildAnyRightSpecialBuilding=function(){return this.EmptySlots>0&&(this.Tower||this.Statue||this.Oracle||this.TradeOffice)},e.prototype.canBuildAnything=function(){return this.canBuildAnyMainBuilding()||this.canBuildAnyLeftSpecialBuilding()||this.canBuildAnyRightSpecialBuilding()},e}();e.PossibleBuildingContainer=i}(e.Containers||(e.Containers={}))}(e.Common||(e.Common={}))}(Grepo||(Grepo={}));var Grepo;!function(e){!function(i){!function(i){var t=function(){function i(e){this.CustomBuildConfigs=!0;for(var i in e)this[i]=e[i]}return i.createFromJSON=function(i){var t=JSON.parse(i);return new e.Common.Containers.PermissionsContainer(t)},i}();i.PermissionsContainer=t}(i.Containers||(i.Containers={}))}(e.Common||(e.Common={}))}(Grepo||(Grepo={}));var Grepo;!function(e){!function(e){!function(e){var i=function(){function e(e,i,t){this.woodRatio=1,this.ironRatio=1,this.stoneRatio=1,this.wood=e,this.iron=i,this.stone=t,this.calculateRatios()}return e.prototype.calculateRatios=function(){var e=Math.min(this.wood,this.iron,this.stone);this.woodRatio=this.wood/e,this.ironRatio=this.iron/e,this.stoneRatio=this.stone/e},e}();e.CityResourceContainer=i}(e.Containers||(e.Containers={}))}(e.Common||(e.Common={}))}(Grepo||(Grepo={}));var Grepo;!function(e){!function(i){!function(i){var t=function(){function i(e){this.Main=0,this.Hide=0,this.Lumber=0,this.Stoner=0,this.Ironer=0,this.Market=0,this.Docks=0,this.Barracks=0,this.Wall=0,this.Storage=0,this.Farm=0,this.Academy=0,this.Temple=0,this.Theater=0,this.Thermal=0,this.Library=0,this.Lighthouse=0,this.Tower=0,this.Statue=0,this.Oracle=0,this.TradeOffice=0;for(var i in e)this[i]=e[i]}return i.prototype.serialize=function(){return JSON.stringify(this)},i.prototype.toObject=function(){},i.initWithMaxValues=function(i){var t=new e.Common.Containers.BuildingLevelContainer({Main:25,Hide:10,Place:1,Lumber:40,Stoner:40,Ironer:40,Market:30,Docks:30,Barracks:30,Wall:25,Storage:35,Farm:45,Academy:36,Temple:30});if(void 0!==i)for(var n in i)t[n]=i[n];return t},i}();i.BuildingLevelContainer=t}(i.Containers||(i.Containers={}))}(e.Common||(e.Common={}))}(Grepo||(Grepo={}));var Grepo;!function(e){!function(i){!function(i){var t=function(){function i(e){this.ID="",this.Title="",this.ShortcutKey="",this.BuildingLevels=null,this.UnitLevels=null,this.ResearchLevels=null;for(var i in e)this[i]=e[i]}return i.prototype.serialize=function(){return JSON.stringify(this)},i.createFromJSON=function(i){var t=JSON.parse(i),n=new e.Common.Containers.BuildingLevelContainer(t.BuildingLevels),a=new e.Common.Containers.ResearchLevelContainer(t.ResearchLevels),o=new e.Common.Containers.UnitLevelContainer(t.UnitLevels);return new e.Common.Containers.BuildConfigContainer({ID:t.ID,ShortcutKey:t.ShortcutKey,Title:t.Title,UnitLevels:o,ResearchLevels:a,BuildingLevels:n})},i}();i.BuildConfigContainer=t}(i.Containers||(i.Containers={}))}(e.Common||(e.Common={}))}(Grepo||(Grepo={}));var Grepo;!function(e){
  3. !function(e){!function(e){var i=function(){function e(e){this.World="",this.Username="";for(var i in e)this[i]=e[i]}return e}();e.AuthenticationContainer=i}(e.Containers||(e.Containers={}))}(e.Common||(e.Common={}))}(Grepo||(Grepo={}));var Grepo;!function(e){!function(i){var t=function(){function i(){this.checkIfAuthenticatable()}return Object.defineProperty(i.prototype,"GrepoManager",{get:function(){return this._GrepoManager},set:function(e){this._GrepoManager=e},enumerable:!0,configurable:!0}),i.prototype.login=function(){},i.prototype.logout=function(){},i.prototype.checkIfAuthenticatable=function(){if(null!=localStorage.getItem("ssid"))this.authenticateWithToken(localStorage.getItem("ssid"));else if(!this.GrepoManager.LayoutManager.windowExists("Login")){var i=new e.Layout.Windows.UserLoginWindow(this.GrepoManager);i.init({Title:"Login",Draggable:!1,Modal:!0,ZIndex:5001,Dimensions:{Height:350,Width:400}})}},i}();i.UserService=t}(e.Services||(e.Services={}))}(Grepo||(Grepo={}));var Grepo;!function(e){!function(e){var i=function(){function e(e){this.GrepoManager=e,window.setInterval(function(){this.checkForUpdate()},6e4)}return Object.defineProperty(e.prototype,"GrepoManager",{get:function(){return this._GrepoManager},set:function(e){this._GrepoManager=e},enumerable:!0,configurable:!0}),e.prototype.checkForUpdate=function(){return!1},e}();e.UpdateAppService=i}(e.Services||(e.Services={}))}(Grepo||(Grepo={}));var Grepo;!function(e){!function(e){var i=function(){function e(e){this.GrepoManager=e}return Object.defineProperty(e.prototype,"GrepoManager",{get:function(){return this._GrepoManager},set:function(e){this._GrepoManager=e},enumerable:!0,configurable:!0}),e.prototype.getTranslation=function(e,i){return i},e}();e.TranslationService=i}(e.Services||(e.Services={}))}(Grepo||(Grepo={}));var Grepo;!function(e){!function(e){var i=function(){function e(e){var i=this;this._Url="https://grepo.azurewebsites.net/signalr",this._Connection=null,this._GrepoHub=null,this.GrepoManager=e,this.Connection=$.hubConnection(this.Url,{useDefaultPath:!1}),this.GrepoHub=this.Connection.createHubProxy("grepoManagerHub"),this.GrepoHub.on("ExampleEvent",this.exampleEvent),this.GrepoHub.on("RunCommand",this.runCommand),this.GrepoHub.on("ReturnHello",function(e){i.returnHello(e)}),this.Connection.start().done(function(){i.onConnect()}).fail(function(){i.onFail()})}return Object.defineProperty(e.prototype,"Url",{get:function(){return this._Url},set:function(e){this._Url=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"GrepoManager",{get:function(){return this._GrepoManager},set:function(e){this._GrepoManager=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"Connection",{get:function(){return this._Connection},set:function(e){this._Connection=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"GrepoHub",{get:function(){return this._GrepoHub},set:function(e){this._GrepoHub=e},enumerable:!0,configurable:!0}),e.prototype.exampleEvent=function(){},e.prototype.onConnect=function(){console.log("connected"),this.GrepoHub.invoke("helloWorld")},e.prototype.onFail=function(){console.log("failed to connect")},e.prototype.runCommand=function(){},e.prototype.returnHello=function(e){alert(e)},e.prototype.authenticate=function(e,i,t){},e.prototype.authenticateFromToken=function(e,i){},e.prototype.logout=function(){},e.prototype.resetPassword=function(e,i){},e.prototype.getPermissions=function(){return JSON.stringify({})},e.prototype.getLatestTownConfigs=function(){return""},e.prototype.getLatestBuildConfigs=function(){return""},e.prototype.updateTownConfigs=function(e){},e.prototype.updateBuildConfigs=function(e){},e.prototype.submitReport=function(e){},e.prototype.shareOngoingConquest=function(e){},e}();e.SocketService=i}(e.Services||(e.Services={}))}(Grepo||(Grepo={}));var Grepo;!function(e){!function(i){var t=function(){function i(i){this.SocketService=i,this.Permissions=e.Common.Containers.PermissionsContainer.createFromJSON(this.SocketService.getPermissions())}return Object.defineProperty(i.prototype,"SocketService",{get:function(){return this._SocketService},set:function(e){this._SocketService=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"Permissions",{get:function(){return this._Permissions},set:function(e){this._Permissions=e},enumerable:!0,configurable:!0}),i.prototype.getPermission=function(e){return this.Permissions[e]},i}();i.PermissionsService=t}(e.Services||(e.Services={}))}(Grepo||(Grepo={}));var Grepo;!function(e){!function(e){var i=function(){function e(){this.tick()}return e.prototype.tick=function(){},e}();e.NotificationService=i}(e.Services||(e.Services={}))}(Grepo||(Grepo={}));var Grepo;!function(e){!function(i){var t=function(){function i(){this._Events={}}return Object.defineProperty(i.prototype,"Signals",{get:function(){return this._Signals},set:function(e){this._Signals=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"Events",{get:function(){return this._Events},set:function(e){this._Events=e},enumerable:!0,configurable:!0}),i.prototype.registerEvent=function(e,i){this.Events[e]=new signals.Signal,this.Events[e].add(i)},i.prototype.triggerEvent=function(i){e.Common.Helpers.logMessage(["triggering event",i]),this.Events[i].dispatch()},i}();i.EventService=t}(e.Services||(e.Services={}))}(Grepo||(Grepo={}));var Grepo;!function(e){!function(e){var i=function(){function e(e){this._ClassName=null,this.GrepoManager=e,this.ClassName=this.GrepoManager.ContextMenuManager.addItemToMainToolbar(this.GrepoManager.TranslationService.getTranslation("unitManagerToolbarName","Units"),"fa-users","middle-left","U",function(){}),this.GrepoManager.HelpManager.listKeyBinding(this.GrepoManager.TranslationService.getTranslation("unitManagerKeyBindingText","Unit Recruitment"),"U")}return Object.defineProperty(e.prototype,"GrepoManager",{get:function(){return this._GrepoManager},set:function(e){this._GrepoManager=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ClassName",{get:function(){return this._ClassName},set:function(e){this._ClassName=e},enumerable:!0,configurable:!0}),e}();e.UnitManager=i}(e.Management||(e.Management={}))}(Grepo||(Grepo={}));var Grepo;!function(e){!function(e){var i=function(){function e(e){this._ClassName=null,this.GrepoManager=e,this.ClassName=this.GrepoManager.ContextMenuManager.addItemToMainToolbar(this.GrepoManager.TranslationService.getTranslation("teamManagerToolbarName","Teams"),"fa-users","middle-left","T",function(){}),this.GrepoManager.HelpManager.listKeyBinding(this.GrepoManager.TranslationService.getTranslation("teamManagerKeyBindingText","Teams Recruitment"),"T")}return Object.defineProperty(e.prototype,"GrepoManager",{get:function(){return this._GrepoManager},set:function(e){this._GrepoManager=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ClassName",{get:function(){return this._ClassName},set:function(e){this._ClassName=e},enumerable:!0,configurable:!0}),e}();e.TeamManager=i}(e.Management||(e.Management={}))}(Grepo||(Grepo={}));var Grepo;!function(e){!function(e){var i=function(){function e(e){this._ClassName=null,this.GrepoManager=e,this.ClassName=this.GrepoManager.ContextMenuManager.addItemToMainToolbar(this.GrepoManager.TranslationService.getTranslation("shipManagerToolbarName","Ships"),"fa-ship","middle-left","D",function(){}),this.GrepoManager.HelpManager.listKeyBinding(this.GrepoManager.TranslationService.getTranslation("shipManagerKeyBindingText","Ships Recruitment"),"D")}return Object.defineProperty(e.prototype,"GrepoManager",{get:function(){return this._GrepoManager},set:function(e){this._GrepoManager=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ClassName",{get:function(){return this._ClassName},set:function(e){this._ClassName=e},enumerable:!0,configurable:!0}),e}();e.ShipManager=i}(e.Management||(e.Management={}))}(Grepo||(Grepo={}));var Grepo;!function(e){!function(i){var t=function(){function i(i){var t=this;this._ClassName=null,this.GrepoManager=i;var n=this;this.ClassName=this.GrepoManager.ContextMenuManager.addItemToMainToolbar(this.GrepoManager.TranslationService.getTranslation("settingsManagerToolbarName","Settings"),"fa-cog","middle-right","S",function(){if(!t.GrepoManager.LayoutManager.windowExists("Settings")){new e.Layout.Windows.SettingsWindow(n.GrepoManager).init({Title:"Settings",OnCloseAction:function(){$("."+t.ClassName).removeClass("active")}}),$("."+t.ClassName).addClass("active")}});var a="."+this.ClassName+".active {background-color: rgb(88, 92, 95);}",o=$("<style>"+a+"</style>");$("head").append(o),this.GrepoManager.HelpManager.listKeyBinding(this.GrepoManager.TranslationService.getTranslation("settingsManagerKeyBindingText","Settings"),"S")}return Object.defineProperty(i.prototype,"GrepoManager",{get:function(){return this._GrepoManager},set:function(e){this._GrepoManager=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"ClassName",{get:function(){return this._ClassName},set:function(e){this._ClassName=e},enumerable:!0,configurable:!0}),i}();i.SettingsManager=t}(e.Management||(e.Management={}))}(Grepo||(Grepo={}));var Grepo;!function(e){!function(e){var i=function(){function e(e){this._ClassName=null,this.GrepoManager=e,this.ClassName=this.GrepoManager.ContextMenuManager.addItemToMainToolbar(this.GrepoManager.TranslationService.getTranslation("resourceManagerToolbarName","Trade"),"fa-truck","middle-left","T",function(){}),this.GrepoManager.HelpManager.listKeyBinding(this.GrepoManager.TranslationService.getTranslation("resourceManagerKeyBindingText","Resource Manager"),"T")}return Object.defineProperty(e.prototype,"GrepoManager",{get:function(){return this._GrepoManager},set:function(e){this._GrepoManager=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ClassName",{get:function(){return this._ClassName},set:function(e){this._ClassName=e},enumerable:!0,configurable:!0}),e}();e.ResourceManager=i}(e.Management||(e.Management={}))}(Grepo||(Grepo={}));var Grepo;!function(e){!function(i){var t=function(){function i(e){var i=this;this._ClassName=null,this.GrepoManager=e,this.ClassName=this.GrepoManager.ContextMenuManager.addItemToMainToolbar(this.GrepoManager.TranslationService.getTranslation("researchManagerToolbarName","Research"),"fa-graduation-cap","middle-left","A",function(){i.GrepoManager.LayoutManager.checkOpenMainBuildingWindow("academy")?i.research():i.GrepoManager.LayoutManager.openMainBuildingWindow("academy")}),this.GrepoManager.HelpManager.listKeyBinding(this.GrepoManager.TranslationService.getTranslation("researchManagerKeyBindingText","Research"),"A")}return Object.defineProperty(i.prototype,"GrepoManager",{get:function(){return this._GrepoManager},set:function(e){this._GrepoManager=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"ClassName",{get:function(){return this._ClassName},set:function(e){this._ClassName=e},enumerable:!0,configurable:!0}),i.prototype.researchItem=function(e){$(".research_box ."+e).parent().find(".button_upgrade").first().click()},i.prototype.isResearched=function(e){var i=!$(".research_box ."+e).hasClass("inactive");return $(".researches_queue .queued_building_order .item_icon."+e).length>0&&(i=!0),i},i.prototype.canResearchAny=function(){return $(".research_box .button_upgrade").length>0},i.prototype.canResearch=function(e){return $(".research_box ."+e).parent().find(".button_upgrade").length>0},i.prototype.getResearchPoints=function(){return Number($(".research_points_box .research_points").text().split("/")[0])},i.prototype.getCurrentAcademyLevel=function(){return ITowns.getCurrentTown().getBuildings().attributes.academy},i.prototype.shouldResearch=function(i){var t=e.Common.Helpers.convertResearchGameToCode(i);return!(!this.GrepoManager.BuildConfigManager.getCurrentTownConfig().ResearchLevels[t]||!this.canResearch(i))},i.prototype.getEmptyResearchSlots=function(){return $(".researches_queue .empty_slot").length},i.prototype.research=function(){var i=new e.Common.Containers.PossibleResearchContainer({Slinger:this.shouldResearch("slinger"),Archer:this.shouldResearch("archer"),TownGuard:this.shouldResearch("town_guard"),Hoplite:this.shouldResearch("hoplite"),Diplomacy:this.shouldResearch("diplomacy"),Meteorology:this.shouldResearch("meteorology"),Espionage:this.shouldResearch("espionage"),Booty:this.shouldResearch("booty"),Pottery:this.shouldResearch("pottery"),Rider:this.shouldResearch("rider"),Architecture:this.shouldResearch("architecture"),Instructor:this.shouldResearch("instructor"),Bireme:this.shouldResearch("bireme"),BuildingCrane:this.shouldResearch("building_crane"),ShipWright:this.shouldResearch("shipwright"),Chariot:this.shouldResearch("chariot"),AttackShip:this.shouldResearch("attack_ship"),Conscription:this.shouldResearch("conscription"),DemolitionShip:this.shouldResearch("demolition_ship"),Catapult:this.shouldResearch("catapult"),Cryptography:this.shouldResearch("cryptography"),Democracy:this.shouldResearch("democracy"),ColonizeShip:this.shouldResearch("colonize_ship"),SmallTransporter:this.shouldResearch("small_transporter"),Plow:this.shouldResearch("plow"),Berth:this.shouldResearch("berth"),Trireme:this.shouldResearch("trireme"),Phalanx:this.shouldResearch("phalanx"),Breach:this.shouldResearch("breach"),Mathematics:this.shouldResearch("mathematics"),Ram:this.shouldResearch("ram"),Cartography:this.shouldResearch("cartography"),TakeOverOld:this.shouldResearch("take_over_old"),StoneStorm:this.shouldResearch("stonestorm"),TempleLooting:this.shouldResearch("temple_looting"),DivineSelection:this.shouldResearch("divine_selection"),CombatExperience:this.shouldResearch("combat_experience"),StrongWine:this.shouldResearch("strong_wine"),SetSail:this.shouldResearch("set_sail"),EmptySlots:this.getEmptyResearchSlots()});return i.canResearchAnything()?(e.Common.Helpers.logMessage(i),i.canResearch("Slinger")?(this.researchItem("slinger"),!0):i.canResearch("Archer")?(this.researchItem("archer"),!0):i.canResearch("TownGuard")?(this.researchItem("town_guard"),!0):i.canResearch("Hoplite")?(this.researchItem("hoplite"),!0):i.canResearch("Diplomacy")?(this.researchItem("diplomacy"),!0):i.canResearch("Meteorology")?(this.researchItem("meteorology"),!0):i.canResearch("Espionage")?(this.researchItem("espionage"),!0):i.canResearch("Booty")?(this.researchItem("booty"),!0):i.canResearch("Pottery")?(this.researchItem("pottery"),!0):i.canResearch("Rider")?(this.researchItem("rider"),!0):i.canResearch("Architecture")?(this.researchItem("architecture"),!0):i.canResearch("Instructor")?(this.researchItem("instructor"),!0):i.canResearch("Bireme")?(this.researchItem("bireme"),!0):i.canResearch("BuildingCrane")?(this.researchItem("building_crane"),!0):i.canResearch("ShipWright")?(this.researchItem("shipwright"),!0):i.canResearch("Chariot")?(this.researchItem("chariot"),!0):i.canResearch("AttackShip")?(this.researchItem("attack_ship"),!0):i.canResearch("Conscription")?(this.researchItem("conscription"),!0):i.canResearch("DemolitionShip")?(this.researchItem("demolition_ship"),!0):i.canResearch("Catapult")?(this.researchItem("catapult"),!0):i.canResearch("Cryptography")?(this.researchItem("cryptography"),!0):i.canResearch("Democracy")?(this.researchItem("democracy"),!0):i.canResearch("ColonizeShip")?(this.researchItem("colonize_ship"),!0):i.canResearch("SmallTransporter")?(this.researchItem("small_transporter"),!0):i.canResearch("Plow")?(this.researchItem("plow"),!0):i.canResearch("Berth")?(this.researchItem("berth"),!0):i.canResearch("Trireme")?(this.researchItem("trireme"),!0):i.canResearch("Phalanx")?(this.researchItem("phalanx"),!0):i.canResearch("Breach")?(this.researchItem("breach"),!0):i.canResearch("Mathematics")?(this.researchItem("mathematics"),!0):i.canResearch("Ram")?(this.researchItem("ram"),!0):i.canResearch("Cartography")?(this.researchItem("cartography"),!0):i.canResearch("TakeOverOld")?(this.researchItem("take_over_old"),!0):i.canResearch("StoneStorm")?(this.researchItem("stone_storm"),!0):i.canResearch("TempleLooting")?(this.researchItem("temple_looting"),!0):i.canResearch("DivineSelection")?(this.researchItem("divine_selection"),!0):i.canResearch("CombatExperience")?(this.researchItem("combat_experience"),!0):i.canResearch("StrongWine")?(this.researchItem("strong_wine"),!0):i.canResearch("SetSail")?(this.researchItem("set_sail"),!0):void 0):(this.GrepoManager.LayoutManager.goToNextCity(),!1)},i}();i.ResearchManager=t}(e.Management||(e.Management={}))}(Grepo||(Grepo={}));var Grepo;!function(e){!function(e){var i=function(){function e(e){this.GrepoManager=e}return Object.defineProperty(e.prototype,"GrepoManager",{get:function(){return this._GrepoManager},set:function(e){this._GrepoManager=e},enumerable:!0,configurable:!0}),e}();e.GodManager=i}(e.Management||(e.Management={}))}(Grepo||(Grepo={}));var Grepo;!function(e){!function(e){var i=function(){function e(e){this.GrepoManager=e}return Object.defineProperty(e.prototype,"GrepoManager",{get:function(){return this._GrepoManager},set:function(e){this._GrepoManager=e},enumerable:!0,configurable:!0}),e}();e.CultureManager=i}(e.Management||(e.Management={}))}(Grepo||(Grepo={}));var Grepo;!function(e){!function(i){var t=function(){function i(i){this._ActionsClassName="",this._InfoClassName="",this._HideCommands=!0,this.GrepoManager=i,this.ActionsClassName=e.Common.Helpers.generateGuid(),this.InfoClassName=e.Common.Helpers.generateGuid(),this.registerListeners(),this.addStyles()}return Object.defineProperty(i.prototype,"GrepoManager",{get:function(){return this._GrepoManager},set:function(e){this._GrepoManager=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"ActionsClassName",{get:function(){return this._ActionsClassName},set:function(e){this._ActionsClassName=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"InfoClassName",{get:function(){return this._InfoClassName},set:function(e){this._InfoClassName=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"HideCommands",{get:function(){return this._HideCommands},set:function(e){this._HideCommands=e},enumerable:!0,configurable:!0}),i.prototype.registerListeners=function(){var e=this;$("body").on("mouseenter",".gpwindow_content #command_overview .js-command-row",function(){$(this).append("<div class='"+e.ActionsClassName+"'><a href=''><i class='fa fa-lg fa-times'></i></a></div>"),console.log("added")}),$("body").on("mouseleave",".gpwindow_content #command_overview .js-command-row",function(){$(this).find("."+e.ActionsClassName).remove(),console.log("removed")}),$("body").on("click","."+e.ActionsClassName+" a",function(){var i=Number($(this).parent().parent().attr("id").replace("command_",""));return e.hideCommand(i),!1}),$.Observer(GameEvents.town.commands.update).subscribe("GrepoManager_Commands_Update",function(){e.handleWindowOpen()})},i.prototype.addStyles=function(){var e="."+this.ActionsClassName+" {position: absolute; right: 10px; top: 10px;}#command_overview_tabs #command_overview .js-command-row {padding-right: 40px;}."+this.InfoClassName+"{position: absolute; right: 180px; top: 0; font-size: 11px;} ."+this.InfoClassName+" li {padding-top: 3px; border: 0;}."+this.InfoClassName+" li:nth-child(2) {margin-left: 1px;}."+this.InfoClassName+" li i {padding-right: 10px;}."+this.InfoClassName+" li:nth-child(2) i {padding-right: 11px;}",i=$("<style>"+e+"</style>");$("head").append(i)},i.prototype.getCommands=function(){if(null!=localStorage.getItem("trackedCommands")){return JSON.parse(localStorage.getItem("trackedCommands"))}return localStorage.setItem("trackedCommands",JSON.stringify({})),{}},i.prototype.setCommands=function(e){localStorage.setItem("trackedCommands",JSON.stringify(e))},i.prototype.hideCommand=function(e){var i=this.getCommands();i[e].hidden=!0,$("#command_"+e).remove(),this.setCommands(i)},i.prototype.hideCommands=function(){var e=this;window.setTimeout(function(){var i=e.getCommands();underscore.each(i,function(e,i,t){console.log(e),e.hidden&&$("#command_"+e.id).remove()})},500)},i.prototype.handleWindowOpen=function(){this.trackCommands(),this.HideCommands&&this.hideCommands(),this.addInfoToCommands()},i.prototype.trackCommands=function(){var e=this;window.setTimeout(function(){var i=e.getCommands();$(".gpwindow_content #command_overview .js-command-row").each(function(){var t=$(this).attr("id").replace("command_","");if(null==i[t])if(console.log("storing command"),0==$(this).find(".command_overview_units").length){var n=$(".eta-command-"+t).text();i[t]={id:t,firstSeen:Math.floor(Date.now()/1e3),initialDuration:n,hidden:!1}}else i[t]={id:t,firstSeen:0,initialDuration:0,hidden:!1};e.setCommands(i)})},500)},i.prototype.addInfoToCommands=function(){var i=this,t=this;window.setTimeout(function(){var n=i.getCommands();underscore.each(n,function(i,n,a){if(console.log(i),i.firstSeen>0&&0==$("#command_"+i.id+" ."+t.InfoClassName).length){var o=e.Common.Helpers.formatTimestamp(i.firstSeen);$("#command_"+i.id).append("<div class='"+t.InfoClassName+"'><ul><li><i class='fa fa-lg fa-eye' title='Time Spotted'></i>"+o+"</li><li><i class='fa fa-lg fa-clock-o' title='Duration When Spotted'></i>"+i.initialDuration+"</li></ul></div>")}})},500)},i}();i.CommandManager=t}(e.Management||(e.Management={}))}(Grepo||(Grepo={}));var Grepo;!function(e){!function(i){var t=function(){function i(i){var t=this;this._Buildings=null,this._ClassName=null,this.GrepoManager=i,e.Common.Helpers.logMessage(this.GrepoManager.ContextMenuManager),this.ClassName=this.GrepoManager.ContextMenuManager.addItemToMainToolbar(this.GrepoManager.TranslationService.getTranslation("buildingManagerToolbarName","Buildings"),"fa-home","middle-left","B",function(){t.GrepoManager.LayoutManager.checkOpenMainBuildingWindow("main")?t.build():t.GrepoManager.LayoutManager.openMainBuildingWindow("main")}),this.Buildings=this.GrepoManager.BuildConfigManager.getCurrentTownConfig().BuildingLevels,this.GrepoManager.HelpManager.listKeyBinding(this.GrepoManager.TranslationService.getTranslation("buildingManagerKeyBindingText","Building"),"B"),this.GrepoManager.ContextMenuManager.addToolbar({Title:"Senate",Window:"building_main",Commands:[{Title:"Build Next",Action:function(){e.Common.Helpers.logMessage("build next")}},{Title:"Highlight Buildings",Action:function(){e.Common.Helpers.logMessage("highlight buildings")}}]})}return Object.defineProperty(i.prototype,"GrepoManager",{get:function(){return this._GrepoManager},set:function(e){this._GrepoManager=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"Buildings",{get:function(){return this._Buildings},set:function(e){this._Buildings=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"ClassName",{get:function(){return this._ClassName},set:function(e){this._ClassName=e},enumerable:!0,configurable:!0}),i.prototype.getMainBuildingLevel=function(e){var i=Number($("#building_main_"+e+" .building .level:first-child()").text());return $("#building_tasks_main .queued_building_order."+e+" .building_level").each(function(){i=Number($(this).text().trim())}),i},i.prototype.getSpecialBuildingLeftLevel=function(e){return $("#special_group_1").length>0?0:$("#building_main_"+e).length>0?1:0},i.prototype.getSpecialBuildingRightLevel=function(e){return $("#special_group_2").length>0?0:$("#building_main_"+e).length>0?1:0},i.prototype.canBuildMainBuilding=function(e){return!$("#building_main_"+e+" .button_build").not(".tear_down").hasClass("build_grey")},i.prototype.canBuildSpecialLeftBuilding=function(e){return!(this.getSpecialBuildingLeftLevel("theater")>0||this.getSpecialBuildingLeftLevel("thermal")>0||this.getSpecialBuildingLeftLevel("library")>0||this.getSpecialBuildingLeftLevel("lighthouse")>0)&&-1!=$("#special_building_"+e).css("background-image").indexOf("passive")},i.prototype.canBuildSpecialRightBuilding=function(e){return!(this.getSpecialBuildingLeftLevel("tower")>0||this.getSpecialBuildingLeftLevel("statue")>0||this.getSpecialBuildingLeftLevel("oracle")>0||this.getSpecialBuildingLeftLevel("trade_office")>0)&&-1!=$("#special_building_"+e).css("background-image").indexOf("passive")},i.prototype.buildMainBuilding=function(e){$("#building_main_"+e+" .button_build").not(".tear_down").click()},i.prototype.buildSpecialBuilding=function(e){$("#special_building_"+e).not(".special_tear_town").click()},i.prototype.isMainBuildingMaxLevel=function(i){return!(this.getMainBuildingLevel(i)<this.Buildings[e.Common.Helpers.convertBuildingGameToCode(i)])},i.prototype.isCurrentlyBuildingMainBuilding=function(e){return $("#building_tasks_main .queued_building_order."+e).length>0},i.prototype.isSpecialBuildingLeftMaxLevel=function(i){return!(this.getSpecialBuildingLeftLevel(i)<this.Buildings[e.Common.Helpers.convertBuildingGameToCode(i)])},i.prototype.isSpecialBuildingRightMaxLevel=function(i){return!(this.getSpecialBuildingRightLevel(i)<this.Buildings[e.Common.Helpers.convertBuildingGameToCode(i)])},i.prototype.getEmptyBuildSlots=function(){return $("#building_tasks_main .empty_slot").length},i.prototype.shouldBuildMain=function(){return!(!this.canBuildMainBuilding("main")||this.isMainBuildingMaxLevel("main"))&&(1==this.getEmptyBuildSlots()||(!!(this.isMainBuildingMaxLevel("lumber")&&this.isMainBuildingMaxLevel("stoner")&&this.isMainBuildingMaxLevel("ironer"))||void 0))},i.prototype.shouldBuildHide=function(){return this.getMainBuildingLevel("main")>=10&&this.getMainBuildingLevel("storage")>=7&&this.getMainBuildingLevel("market")>=4&&(!(!this.canBuildMainBuilding("hide")||this.isMainBuildingMaxLevel("hide"))&&(this.getMainBuildingLevel("market")>=5&&this.getMainBuildingLevel("lumber")>=25&&this.getMainBuildingLevel("ironer")>=25&&this.getMainBuildingLevel("stoner")>=25))},i.prototype.shouldBuildPlace=function(){return!1},i.prototype.shouldBuildLumber=function(){return!(!this.canBuildMainBuilding("lumber")||this.isMainBuildingMaxLevel("lumber"))&&this.getMainBuildingLevel("lumber")<Math.min(this.getMainBuildingLevel("ironer"),this.getMainBuildingLevel("stoner"),this.getMainBuildingLevel("lumber"))+3},i.prototype.shouldBuildStoner=function(){return!(!this.canBuildMainBuilding("stoner")||this.isMainBuildingMaxLevel("stoner"))&&this.getMainBuildingLevel("stoner")<Math.min(this.getMainBuildingLevel("ironer"),this.getMainBuildingLevel("stoner"),this.getMainBuildingLevel("lumber"))+3},i.prototype.shouldBuildIroner=function(){return this.getMainBuildingLevel("lumber")>=1&&(!(!this.canBuildMainBuilding("ironer")||this.isMainBuildingMaxLevel("ironer"))&&this.getMainBuildingLevel("ironer")<Math.min(this.getMainBuildingLevel("ironer"),this.getMainBuildingLevel("stoner"),this.getMainBuildingLevel("lumber"))+3)},i.prototype.shouldBuildMarket=function(){return this.getMainBuildingLevel("main")>=3&&this.getMainBuildingLevel("storage")>=5&&(!(!this.canBuildMainBuilding("market")||this.isMainBuildingMaxLevel("market"))&&(this.getMainBuildingLevel("market")<5&&this.getMainBuildingLevel("lumber")>=20&&this.getMainBuildingLevel("ironer")>=20&&this.getMainBuildingLevel("stoner")>=20||(this.getMainBuildingLevel("market")<10&&this.getMainBuildingLevel("lumber")>=30&&this.getMainBuildingLevel("ironer")>=30&&this.getMainBuildingLevel("stoner")>=30||!!(this.isMainBuildingMaxLevel("academy")&&this.isMainBuildingMaxLevel("lumber")&&this.isMainBuildingMaxLevel("ironer")&&this.isMainBuildingMaxLevel("stoner")))))},i.prototype.shouldBuildDocks=function(){return this.getMainBuildingLevel("main")>=14&&this.getMainBuildingLevel("lumber")>=15&&this.getMainBuildingLevel("ironer")>=10&&(!(!this.canBuildMainBuilding("docks")||this.isMainBuildingMaxLevel("docks"))&&(this.getMainBuildingLevel("docks")<20&&this.getMainBuildingLevel("academy")>=28||!!(this.isMainBuildingMaxLevel("lumber")&&this.isMainBuildingMaxLevel("ironer")&&this.isMainBuildingMaxLevel("stoner")&&this.isMainBuildingMaxLevel("academy"))))},i.prototype.shouldBuildBarracks=function(){return this.getMainBuildingLevel("ironer")>=1&&this.getMainBuildingLevel("main")>=2&&this.getMainBuildingLevel("farm")>=3&&this.getMainBuildingLevel("lumber")>=1&&(!(!this.canBuildMainBuilding("barracks")||this.isMainBuildingMaxLevel("barracks"))&&(this.getMainBuildingLevel("barracks")<5&&this.getMainBuildingLevel("lumber")>=10&&this.getMainBuildingLevel("stoner")>=10&&this.getMainBuildingLevel("ironer")>=10||!!(this.isMainBuildingMaxLevel("lumber")&&this.isMainBuildingMaxLevel("ironer")&&this.isMainBuildingMaxLevel("stoner")&&this.isMainBuildingMaxLevel("academy"))))},i.prototype.shouldBuildWall=function(){return this.getMainBuildingLevel("main")>=5&&this.getMainBuildingLevel("temple")>=3&&(!(!this.canBuildMainBuilding("wall")||this.isMainBuildingMaxLevel("wall"))&&!!(this.isMainBuildingMaxLevel("lumber")&&this.isMainBuildingMaxLevel("ironer")&&this.isMainBuildingMaxLevel("stoner")&&this.isMainBuildingMaxLevel("academy")))},i.prototype.shouldBuildStorage=function(){return!(!this.canBuildMainBuilding("storage")||this.isMainBuildingMaxLevel("storage"))&&(this.getMainBuildingLevel("storage")<Math.max(this.getMainBuildingLevel("ironer"),this.getMainBuildingLevel("stoner"),this.getMainBuildingLevel("lumber"))/2+5||!!(this.isMainBuildingMaxLevel("lumber")&&this.isMainBuildingMaxLevel("ironer")&&this.isMainBuildingMaxLevel("stoner")&&this.getMainBuildingLevel("main")>=25))},i.prototype.shouldBuildFarm=function(){return!(!this.canBuildMainBuilding("farm")||this.isMainBuildingMaxLevel("farm"))&&(this.GrepoManager.LayoutManager.getCityPopulation()<100&&!this.isCurrentlyBuildingMainBuilding("farm")||(!(!(this.GrepoManager.LayoutManager.getCityPopulation()<100)||this.canBuildMainBuilding("lumber")||this.canBuildMainBuilding("stoner")||this.canBuildMainBuilding("ironer")||this.canBuildMainBuilding("storage")||this.canBuildMainBuilding("academy")||this.canBuildMainBuilding("barracks")||this.canBuildMainBuilding("docks"))||!!(this.isMainBuildingMaxLevel("lumber")&&this.isMainBuildingMaxLevel("stoner")&&this.isMainBuildingMaxLevel("ironer")&&this.isMainBuildingMaxLevel("main")&&this.isMainBuildingMaxLevel("storage")&&this.isMainBuildingMaxLevel("academy")&&this.isMainBuildingMaxLevel("barracks")&&this.isMainBuildingMaxLevel("docks"))))},i.prototype.shouldBuildAcademy=function(){return this.getMainBuildingLevel("main")>=8&&this.getMainBuildingLevel("farm")>=6&&this.getMainBuildingLevel("barracks")>=5&&(!(!this.canBuildMainBuilding("academy")||this.isMainBuildingMaxLevel("academy"))&&(this.getMainBuildingLevel("academy")<13&&this.getMainBuildingLevel("lumber")>=20&&this.getMainBuildingLevel("stoner")>=20&&this.getMainBuildingLevel("ironer")>=20||!!(this.isMainBuildingMaxLevel("storage")&&this.isMainBuildingMaxLevel("main")&&this.isMainBuildingMaxLevel("lumber")&&this.isMainBuildingMaxLevel("stoner")&&this.isMainBuildingMaxLevel("ironer"))))},i.prototype.shouldBuildTemple=function(){return this.getMainBuildingLevel("stoner")>=1&&(!(!this.canBuildMainBuilding("temple")||this.isMainBuildingMaxLevel("temple"))&&!!(this.isMainBuildingMaxLevel("lumber")&&this.isMainBuildingMaxLevel("ironer")&&this.isMainBuildingMaxLevel("stoner")&&this.isMainBuildingMaxLevel("academy")))},i.prototype.shouldBuildSpecialTheater=function(){return this.getMainBuildingLevel("main")>=24&&this.getMainBuildingLevel("lumber")>=35&&this.getMainBuildingLevel("ironer")>=32&&this.getMainBuildingLevel("docks")>=5&&this.getMainBuildingLevel("academy")>=5&&this.getSpecialBuildingLeftLevel("thermal")<1&&this.getSpecialBuildingLeftLevel("library")<1&&this.getSpecialBuildingLeftLevel("lighthouse")<1&&!(!this.canBuildSpecialLeftBuilding("theater")||this.isSpecialBuildingLeftMaxLevel("theater"))},i.prototype.shouldBuildSpecialThermal=function(){
  4. return this.getMainBuildingLevel("main")>=24&&this.getMainBuildingLevel("farm")>=35&&this.getMainBuildingLevel("docks")>=5&&this.getMainBuildingLevel("academy")>=5&&this.getSpecialBuildingLeftLevel("theater")<1&&this.getSpecialBuildingLeftLevel("library")<1&&this.getSpecialBuildingLeftLevel("lighthouse")<1&&!(!this.canBuildSpecialLeftBuilding("thermal")||this.isSpecialBuildingLeftMaxLevel("thermal"))},i.prototype.shouldBuildSpecialLibrary=function(){return this.getMainBuildingLevel("main")>=24&&this.getMainBuildingLevel("docks")>=5&&this.getMainBuildingLevel("academy")>=20&&this.getSpecialBuildingLeftLevel("theater")<1&&this.getSpecialBuildingLeftLevel("thermal")<1&&this.getSpecialBuildingLeftLevel("lighthouse")<1&&!(!this.canBuildSpecialLeftBuilding("library")||this.isSpecialBuildingLeftMaxLevel("library"))},i.prototype.shouldBuildSpecialLighthouse=function(){return this.getMainBuildingLevel("main")>=24&&this.getMainBuildingLevel("docks")>=20&&this.getMainBuildingLevel("academy")>=5&&this.getSpecialBuildingLeftLevel("theater")<1&&this.getSpecialBuildingLeftLevel("thermal")<1&&this.getSpecialBuildingLeftLevel("library")<1&&!(!this.canBuildSpecialLeftBuilding("lighthouse")||this.isSpecialBuildingLeftMaxLevel("lighthouse"))},i.prototype.shouldBuildSpecialTower=function(){return this.getMainBuildingLevel("main")>=21&&this.getMainBuildingLevel("wall")>=20&&this.getMainBuildingLevel("temple")>=5&&this.getMainBuildingLevel("market")>=5&&this.getSpecialBuildingRightLevel("statue")<1&&this.getSpecialBuildingRightLevel("oracle")<1&&this.getSpecialBuildingRightLevel("trade_office")<1&&!(!this.canBuildSpecialRightBuilding("tower")||this.isSpecialBuildingRightMaxLevel("tower"))},i.prototype.shouldBuildSpecialStatue=function(){return this.getMainBuildingLevel("main")>=21&&this.getMainBuildingLevel("temple")>=12&&this.getMainBuildingLevel("market")>=5&&this.getSpecialBuildingRightLevel("tower")<1&&this.getSpecialBuildingRightLevel("oracle")<1&&this.getSpecialBuildingRightLevel("trade_office")<1&&!(!this.canBuildSpecialRightBuilding("statue")||this.isSpecialBuildingRightMaxLevel("statue"))},i.prototype.shouldBuildSpecialOracle=function(){return this.getMainBuildingLevel("main")>=21&&this.getMainBuildingLevel("hide")>=10&&this.getMainBuildingLevel("market")>=5&&this.getMainBuildingLevel("temple")>=5&&this.getSpecialBuildingRightLevel("tower")<1&&this.getSpecialBuildingRightLevel("statue")<1&&this.getSpecialBuildingRightLevel("trade_office")<1&&!(!this.canBuildSpecialRightBuilding("oracle")||this.isSpecialBuildingRightMaxLevel("oracle"))},i.prototype.shouldBuildSpecialTradeOffice=function(){return this.getMainBuildingLevel("main")>=21&&this.getMainBuildingLevel("market")>=15&&this.getMainBuildingLevel("temple")>=5&&this.getSpecialBuildingRightLevel("tower")<1&&this.getSpecialBuildingRightLevel("statue")<1&&this.getSpecialBuildingRightLevel("oracle")<1&&!(!this.canBuildSpecialRightBuilding("trade_office")||this.isSpecialBuildingRightMaxLevel("trade_office"))},i.prototype.checkFastBuildButtonForFree=function(){"Free"==$(".js-window-main-container .type_building_queue .js-queue-item .btn_time_reduction").first().text().trim()&&$(".js-window-main-container .type_building_queue .js-queue-item .btn_time_reduction").first().click()},i.prototype.build=function(){var i=new e.Common.Containers.PossibleBuildingContainer({Main:this.shouldBuildMain(),Hide:this.shouldBuildHide(),Lumber:this.shouldBuildLumber(),Stoner:this.shouldBuildStoner(),Ironer:this.shouldBuildIroner(),Market:this.shouldBuildMarket(),Docks:this.shouldBuildDocks(),Barracks:this.shouldBuildBarracks(),Wall:this.shouldBuildWall(),Storage:this.shouldBuildStorage(),Farm:this.shouldBuildFarm(),Academy:this.shouldBuildAcademy(),Temple:this.shouldBuildTemple(),Theater:this.shouldBuildSpecialTheater(),Thermal:this.shouldBuildSpecialThermal(),Library:this.shouldBuildSpecialLibrary(),Lighthouse:this.shouldBuildSpecialLighthouse(),Tower:this.shouldBuildSpecialTower(),Statue:this.shouldBuildSpecialStatue(),Oracle:this.shouldBuildSpecialOracle(),TradeOffice:this.shouldBuildSpecialTradeOffice(),EmptySlots:this.getEmptyBuildSlots()});return e.Common.Helpers.logMessage(["possible buildings",i]),this.checkFastBuildButtonForFree(),i.canBuildAnything()?i.canBuildBuilding("Farm")?(this.buildMainBuilding("farm"),!0):i.canBuildBuilding("Main")?(this.buildMainBuilding("main"),!0):i.canBuildBuilding("Storage")?(this.buildMainBuilding("storage"),!0):i.canBuildBuilding("Market")?(this.buildMainBuilding("market"),!0):i.canBuildBuilding("Docks")?(this.buildMainBuilding("docks"),!0):i.canBuildBuilding("Barracks")?(this.buildMainBuilding("barracks"),!0):i.canBuildBuilding("Temple")?(this.buildMainBuilding("temple"),!0):i.canBuildBuilding("Academy")?(this.buildMainBuilding("academy"),!0):i.canBuildBuilding("Hide")?(this.buildMainBuilding("hide"),!0):i.canBuildBuilding("Stoner")?(this.buildMainBuilding("stoner"),!0):i.canBuildBuilding("Lumber")?(this.buildMainBuilding("lumber"),!0):i.canBuildBuilding("Ironer")?(this.buildMainBuilding("ironer"),!0):i.canBuildBuilding("Tower")?(this.buildSpecialBuilding("tower"),!0):i.canBuildBuilding("Statue")?(this.buildSpecialBuilding("statue"),!0):i.canBuildBuilding("Oracle")?(this.buildSpecialBuilding("oracle"),!0):i.canBuildBuilding("TradeOffice")?(this.buildSpecialBuilding("trade_office"),!0):i.canBuildBuilding("Theater")?(this.buildSpecialBuilding("theater"),!0):i.canBuildBuilding("Thermal")?(this.buildSpecialBuilding("thermal"),!0):i.canBuildBuilding("Library")?(this.buildSpecialBuilding("library"),!0):i.canBuildBuilding("Lighthouse")?(this.buildSpecialBuilding("lighthouse"),!0):i.canBuildBuilding("Wall")?(this.buildMainBuilding("wall"),!0):void 0:(this.GrepoManager.LayoutManager.goToNextCity(),!1)},i.prototype.highlightBuildings=function(){var i=new e.Common.Containers.PossibleBuildingContainer({Main:this.shouldBuildMain(),Hide:this.shouldBuildHide(),Lumber:this.shouldBuildLumber(),Stoner:this.shouldBuildStoner(),Ironer:this.shouldBuildIroner(),Market:this.shouldBuildMarket(),Docks:this.shouldBuildDocks(),Barracks:this.shouldBuildBarracks(),Wall:this.shouldBuildWall(),Storage:this.shouldBuildStorage(),Farm:this.shouldBuildFarm(),Academy:this.shouldBuildAcademy(),Temple:this.shouldBuildTemple(),Theater:this.shouldBuildSpecialTheater(),Thermal:this.shouldBuildSpecialThermal(),Library:this.shouldBuildSpecialLibrary(),Lighthouse:this.shouldBuildSpecialLighthouse(),Tower:this.shouldBuildSpecialTower(),Statue:this.shouldBuildSpecialStatue(),Oracle:this.shouldBuildSpecialOracle(),TradeOffice:this.shouldBuildSpecialTradeOffice(),EmptySlots:this.getEmptyBuildSlots()});for(var t in i)i[t]&&$("#building_main_"+t.toLowerCase()+" .button_build").css({background:"orange"});e.Common.Helpers.logMessage("doing this")},i.prototype.getBuildingLevels=function(){return new e.Common.Containers.BuildingLevelContainer({Main:this.getMainBuildingLevel("main"),Hide:this.getMainBuildingLevel("hide"),Lumber:this.getMainBuildingLevel("lumber"),Stoner:this.getMainBuildingLevel("stoner"),Ironer:this.getMainBuildingLevel("ironer"),Market:this.getMainBuildingLevel("market"),Docks:this.getMainBuildingLevel("docks"),Barracks:this.getMainBuildingLevel("barracks"),Wall:this.getMainBuildingLevel("wall"),Storage:this.getMainBuildingLevel("storage"),Farm:this.getMainBuildingLevel("farm"),Academy:this.getMainBuildingLevel("academy"),Temple:this.getMainBuildingLevel("temple"),Theater:this.getSpecialBuildingLeftLevel("theater"),Thermal:this.getSpecialBuildingLeftLevel("thermal"),Library:this.getSpecialBuildingLeftLevel("library"),Lighthouse:this.getSpecialBuildingLeftLevel("lighthouse"),Tower:this.getSpecialBuildingRightLevel("tower"),Statue:this.getSpecialBuildingRightLevel("statue"),Oracle:this.getSpecialBuildingRightLevel("oracle"),TradeOffice:this.getSpecialBuildingRightLevel("trade_office")})},i}();i.BuildingManager=t}(e.Management||(e.Management={}))}(Grepo||(Grepo={}));var Grepo;!function(e){!function(i){var t=function(){function i(e){this._ClassName=null,this._SubClassName="",this._Windows=[];var i=this;this.GrepoManager=e,this.GrepoManager.HelpManager.listKeyBinding(this.GrepoManager.TranslationService.getTranslation("buildConfigManagerPresetsKeyBinding","City Config Presets 1 - 6"),"1 - 6"),this.GrepoManager.PermissionService.getPermission("CustomBuildConfigs")&&this.GrepoManager.HelpManager.listKeyBinding(this.GrepoManager.TranslationService.getTranslation("buildConfigManagerCustomsKeyBinding","Cycle Custom City Configurations"),"0"),this.initializeConfigs(),this.ClassName=this.GrepoManager.ContextMenuManager.addItemToMainToolbar(this.GrepoManager.TranslationService.getTranslation("buildConfigManagerToolbarName","Town Configurations"),"fa-tag","middle-right","C",function(){return i.toggleMenu(),!1}),this.addSubmenuToToolbar(),this.updateToolbarTownConfig(),this.registerListeners()}return Object.defineProperty(i.prototype,"GrepoManager",{get:function(){return this._GrepoManager},set:function(e){this._GrepoManager=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"ClassName",{get:function(){return this._ClassName},set:function(e){this._ClassName=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"SubClassName",{get:function(){return this._SubClassName},set:function(e){this._SubClassName=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"Windows",{get:function(){return this._Windows},set:function(e){this._Windows=e},enumerable:!0,configurable:!0}),i.prototype.initializeConfigs=function(){null==localStorage.getItem("buildConfigs")&&(this.addConfig(new e.Common.Containers.BuildConfigContainer({ID:"Preset 1",Title:"Fast Build",ShortcutKey:"1",BuildingLevels:e.Common.Containers.BuildingLevelContainer.initWithMaxValues({}),UnitLevels:new e.Common.Containers.UnitLevelContainer({}),ResearchLevels:new e.Common.Containers.ResearchLevelContainer({Slinger:!1,Archer:!1,TownGuard:!1,Hoplite:!1,Diplomacy:!1,Meteorology:!1,Espionage:!1,Booty:!1,Pottery:!0,Rider:!1,Architecture:!0,Instructor:!1,Bireme:!1,BuildingCrane:!0,ShipWright:!1,Chariot:!1,AttackShip:!1,Conscription:!1,DemolitionShip:!1,Catapult:!1,Cryptography:!1,Democracy:!1,ColonizeShip:!0,SmallTransporter:!1,Plow:!0,Berth:!1,Trireme:!1,Phalanx:!1,Breach:!1,Mathematics:!1,Ram:!1,Cartography:!1,TakeOverOld:!0,StoneStorm:!1,TempleLooting:!1,DivineSelection:!1,CombatExperience:!0,StrongWine:!0,SetSail:!0})}),!0,!1),this.addConfig(new e.Common.Containers.BuildConfigContainer({ID:"Preset 2",Title:"Myth Siege Break",ShortcutKey:"2",BuildingLevels:e.Common.Containers.BuildingLevelContainer.initWithMaxValues({Thermal:1,TradeOffice:1}),UnitLevels:new e.Common.Containers.UnitLevelContainer({Manticore:500,Griffin:500,Harpy:500}),ResearchLevels:new e.Common.Containers.ResearchLevelContainer({Slinger:!1,Archer:!1,TownGuard:!1,Hoplite:!1,Diplomacy:!1,Meteorology:!0,Espionage:!1,Booty:!1,Pottery:!0,Rider:!1,Architecture:!0,Instructor:!0,Bireme:!1,BuildingCrane:!0,ShipWright:!1,Chariot:!1,AttackShip:!1,Conscription:!0,DemolitionShip:!1,Catapult:!1,Cryptography:!1,Democracy:!1,ColonizeShip:!0,SmallTransporter:!1,Plow:!0,Berth:!1,Trireme:!1,Phalanx:!1,Breach:!1,Mathematics:!1,Ram:!1,Cartography:!1,TakeOverOld:!0,StoneStorm:!1,TempleLooting:!0,DivineSelection:!1,CombatExperience:!0,StrongWine:!0,SetSail:!0})}),!0,!1),this.addConfig(new e.Common.Containers.BuildConfigContainer({ID:"Preset 3",Title:"Sea Siege Break",ShortcutKey:"3",BuildingLevels:e.Common.Containers.BuildingLevelContainer.initWithMaxValues({Lighthouse:1,TradeOffice:1}),UnitLevels:new e.Common.Containers.UnitLevelContainer({AttackShip:1e4}),ResearchLevels:new e.Common.Containers.ResearchLevelContainer({Slinger:!1,Archer:!1,TownGuard:!1,Hoplite:!1,Diplomacy:!1,Meteorology:!1,Espionage:!1,Booty:!1,Pottery:!0,Rider:!1,Architecture:!0,Instructor:!1,Bireme:!1,BuildingCrane:!0,ShipWright:!0,Chariot:!1,AttackShip:!0,Conscription:!1,DemolitionShip:!1,Catapult:!1,Cryptography:!1,Democracy:!1,ColonizeShip:!0,SmallTransporter:!1,Plow:!0,Berth:!1,Trireme:!1,Phalanx:!1,Breach:!1,Mathematics:!0,Ram:!1,Cartography:!0,TakeOverOld:!0,StoneStorm:!1,TempleLooting:!1,DivineSelection:!1,CombatExperience:!0,StrongWine:!0,SetSail:!0})}),!0,!1),this.addConfig(new e.Common.Containers.BuildConfigContainer({ID:"Preset 4",Title:"Long Term Support",ShortcutKey:"4",BuildingLevels:e.Common.Containers.BuildingLevelContainer.initWithMaxValues({Thermal:1,TradeOffice:1}),UnitLevels:new e.Common.Containers.UnitLevelContainer({Bireme:1e4}),ResearchLevels:new e.Common.Containers.ResearchLevelContainer({Slinger:!1,Archer:!1,TownGuard:!1,Hoplite:!1,Diplomacy:!1,Meteorology:!1,Espionage:!1,Booty:!1,Pottery:!0,Rider:!1,Architecture:!0,Instructor:!1,Bireme:!0,BuildingCrane:!0,ShipWright:!0,Chariot:!1,AttackShip:!1,Conscription:!1,DemolitionShip:!1,Catapult:!1,Cryptography:!1,Democracy:!1,ColonizeShip:!0,SmallTransporter:!1,Plow:!0,Berth:!1,Trireme:!1,Phalanx:!1,Breach:!1,Mathematics:!0,Ram:!1,Cartography:!0,TakeOverOld:!0,StoneStorm:!1,TempleLooting:!1,DivineSelection:!1,CombatExperience:!0,StrongWine:!0,SetSail:!0})}),!0,!1),this.addConfig(new e.Common.Containers.BuildConfigContainer({ID:"Preset 5",Title:"Siege Support",ShortcutKey:"5",BuildingLevels:e.Common.Containers.BuildingLevelContainer.initWithMaxValues({Lighthouse:1,TradeOffice:1}),UnitLevels:new e.Common.Containers.UnitLevelContainer({Sword:1500,Hoplite:1500,Archer:1500,Bireme:1500,SmallTransport:1500}),ResearchLevels:new e.Common.Containers.ResearchLevelContainer({Slinger:!1,Archer:!0,TownGuard:!1,Hoplite:!0,Diplomacy:!1,Meteorology:!0,Espionage:!1,Booty:!1,Pottery:!0,Rider:!1,Architecture:!0,Instructor:!0,Bireme:!0,BuildingCrane:!0,ShipWright:!0,Chariot:!1,AttackShip:!1,Conscription:!0,DemolitionShip:!1,Catapult:!1,Cryptography:!1,Democracy:!1,ColonizeShip:!0,SmallTransporter:!0,Plow:!0,Berth:!0,Trireme:!1,Phalanx:!1,Breach:!1,Mathematics:!0,Ram:!1,Cartography:!0,TakeOverOld:!0,StoneStorm:!1,TempleLooting:!1,DivineSelection:!1,CombatExperience:!0,StrongWine:!0,SetSail:!0})}),!0,!1),this.addConfig(new e.Common.Containers.BuildConfigContainer({ID:"Preset 6",Title:"Farming Attack",ShortcutKey:"6",BuildingLevels:e.Common.Containers.BuildingLevelContainer.initWithMaxValues({Lighthouse:1,TradeOffice:1}),UnitLevels:new e.Common.Containers.UnitLevelContainer({Slinger:3e3,SmallTransport:1e3,AttackShip:1e3}),ResearchLevels:new e.Common.Containers.ResearchLevelContainer({Slinger:!1,Archer:!1,TownGuard:!1,Hoplite:!1,Diplomacy:!1,Meteorology:!0,Espionage:!1,Booty:!1,Pottery:!0,Rider:!1,Architecture:!0,Instructor:!0,Bireme:!1,BuildingCrane:!0,ShipWright:!0,Chariot:!1,AttackShip:!1,Conscription:!0,DemolitionShip:!1,Catapult:!1,Cryptography:!1,Democracy:!1,ColonizeShip:!0,SmallTransporter:!0,Plow:!0,Berth:!0,Trireme:!1,Phalanx:!1,Breach:!1,Mathematics:!0,Ram:!1,Cartography:!0,TakeOverOld:!0,StoneStorm:!1,TempleLooting:!1,DivineSelection:!1,CombatExperience:!0,StrongWine:!0,SetSail:!0})}),!0,!1),this.initialiseTownConfigs())},i.prototype.storeConfigsInLocalStorage=function(e){var i=JSON.stringify(e);localStorage.setItem("buildConfigs",i)},i.prototype.addConfig=function(e,i,t){if(i||this.GrepoManager.PermissionService.getPermission("CustomBuildConfigs")){var n=this.getBuildConfigs();n.push(e),this.storeConfigsInLocalStorage(n),t&&this.updateInterface()}},i.prototype.updateInterface=function(){var e=this.getBuildConfigs();$("."+this.SubClassName+" ul li").not("."+this.SubClassName+" ul li:nth-child(1)").not("."+this.SubClassName+" ul li:nth-child(2)").remove();for(var i=0,t=e;i<t.length;i++){var n=t[i],a="",o="";if(this.GrepoManager.PermissionService.getPermission("CustomBuildConfigs")&&(a=-1!=n.ID.indexOf("Custom")?"<li><a href='#' data-config-id='"+n.ID+"'><i class='fa fa-lg fa-times'></i></a></li>":"",o="<li><a href='#' data-config-id='"+n.ID+"'><i class='fa fa-lg fa-clone'></i></a></li>"),-1!=n.ID.indexOf("Custom")&&this.GrepoManager.PermissionService.getPermission("CustomBuildConfigs")){var r=$("<li data-config-id='"+n.ID+"'>"+n.ID+" - "+n.Title+" <ul><li><a href='#' data-config-id='"+n.ID+"'><i class='fa fa-lg fa-check'></i></a></li><li><a href='#' data-config-id='"+n.ID+"'><i class='fa fa-lg fa-cog'></i></a></li>"+o+a+"</ul></li>");$("."+this.SubClassName+" ul").first().append(r)}else if(-1==n.ID.indexOf("Custom")||this.GrepoManager.PermissionService.getPermission("CustomBuildConfigs")){var r=$("<li data-config-id='"+n.ID+"'>"+n.ID+" - "+n.Title+" <ul><li><a href='#' data-config-id='"+n.ID+"'><i class='fa fa-lg fa-check'></i></a></li><li><a href='#' data-config-id='"+n.ID+"'><i class='fa fa-lg fa-cog'></i></a></li>"+o+a+"</ul></li>");$("."+this.SubClassName+" ul").first().append(r)}else;}},i.prototype.getBuildConfigs=function(){if(null==localStorage.getItem("buildConfigs"))return[];for(var i=JSON.parse(localStorage.getItem("buildConfigs")),t=[],n=0,a=i;n<a.length;n++){var o=a[n],r=JSON.stringify(o),s=e.Common.Containers.BuildConfigContainer.createFromJSON(r);t.push(s)}return t},i.prototype.addSubmenuToToolbar=function(){this.SubClassName=e.Common.Helpers.generateGuid();var i="."+this.ClassName+".active {background-color: rgb(88, 92, 95);}."+this.ClassName+".active ."+this.SubClassName+" {display: block;}."+this.ClassName+" ."+this.SubClassName+" ul li:first-child:hover {background: inherit;}."+this.ClassName+" ."+this.SubClassName+" ul li:first-child {border-top: 0; padding-top: 8px;}."+this.ClassName+" ."+this.SubClassName+" ul li:first-child ul {display: block;}."+this.ClassName+" ."+this.SubClassName+" ul li:first-child ul li {padding-top: 9px;}."+this.ClassName+" ."+this.SubClassName+" {position: absolute; right: -2px; width: 350px; height: auto; background: rgb(53, 56, 58); border: 2px solid white; bottom: 43px; display: none;}."+this.ClassName+" ."+this.SubClassName+" h3 { margin: 0 auto;}."+this.ClassName+" ."+this.SubClassName+" ul li {cursor: default; height: 35px; border-top: 0; width: 100%; float: none; box-sizing: border-box; padding: 8px 10px; border-top: 1px solid rgb(255, 255, 255);}."+this.ClassName+" ."+this.SubClassName+" ul li:hover, ."+this.ClassName+" ."+this.SubClassName+" ul li.selected {background-color: rgb(88, 92, 95);}."+this.ClassName+" ."+this.SubClassName+" ul li:hover ul, ."+this.ClassName+" ."+this.SubClassName+" li.selected ul, ."+this.ClassName+" ."+this.SubClassName+" li.active ul {display: block;}."+this.ClassName+" ."+this.SubClassName+" ul li ul {position: absolute; width: 125px; right: 0; top: 0; color: white; float: right; display: none;}."+this.ClassName+" ."+this.SubClassName+" ul li ul li {border-top: 0; float: right; width: 25%; padding-top: 10px;}."+this.ClassName+" ."+this.SubClassName+" ul li ul li a{color: white; cursor: pointer;}."+this.ClassName+" ."+this.SubClassName+" ul li ul li a .fa-cog {top: -2px; right: -1px; position: relative;}."+this.ClassName+" ."+this.SubClassName+" ul li ul li a:hover .fa-plus {color: #ffffab;}."+this.ClassName+" ."+this.SubClassName+" ul li ul li a:hover .fa-check {color: #00ff00;}."+this.ClassName+" ."+this.SubClassName+" ul li.active ul li a .fa-check {color: #00ff00;}."+this.ClassName+" ."+this.SubClassName+" ul li ul li a:hover .fa-cog {color: #00fbff;}."+this.ClassName+" ."+this.SubClassName+" ul li ul li a:hover .fa-times {color: #ff0000;}",t=$("<style>"+i+"</style>");$("head").append(t);var n="<li></li>";this.GrepoManager.PermissionService.getPermission("CustomBuildConfigs")&&(n="<li><a href='#'><i class='fa fa-lg fa-plus'></i></a></li>");var a="<div class='"+this.SubClassName+"'><ul><li><h3>Categorise Town</h3><ul><li><a href='#'><i class='fa fa-lg fa-info-circle'></i></a></li>"+n+"</ul></li></ul></div>";e.Common.Helpers.logMessage([a,n]);var o=$(a);$("."+this.ClassName).append(o),this.updateInterface()},i.prototype.toggleMenu=function(){$("."+this.ClassName).hasClass("active")?$("."+this.ClassName).removeClass("active"):$("."+this.ClassName).addClass("active")},i.prototype.getCurrentTownConfig=function(){if(localStorage.getItem("townConfigs")){var e=ITowns.getCurrentTown().id,i=this.getTownConfigs();if(null!=i[e]){var t=i[e];return this.getBuildConfigs()[t]}return this.setCurrentTownConfig(0,!0),this.getBuildConfigs()[0]}return this.setCurrentTownConfig(0,!0),this.getBuildConfigs()[0]},i.prototype.setCurrentTownConfig=function(e,i){var t=this.getTownConfigs();t[ITowns.getCurrentTown().id]=e,this.setTownConfigs(t),i&&this.updateToolbarTownConfig()},i.prototype.cycleCustomTownConfigs=function(){e.Common.Helpers.logMessage("cycling configs");var i=this.getBuildConfigs();if(i.length>6){var t=this.getCurrentTownConfig().ID;if(e.Common.Helpers.logMessage(["currentConfig ID",t]),-1==t.indexOf("Custom"))e.Common.Helpers.logMessage("Not on a custom"),this.setCurrentTownConfig(6,!0);else{e.Common.Helpers.logMessage("on a custom");var n=Number(t.split(" ")[1]);e.Common.Helpers.logMessage([n,5+n]),5+n+1<i.length?this.setCurrentTownConfig(5+n+1,!0):this.setCurrentTownConfig(6,!0)}}},i.prototype.registerListeners=function(){var i=this,t=this;$.Observer(GameEvents.town.town_switch).subscribe("GrepoManager_Town_Switch_Get_Config",function(){t.handleTownSwitch()});var t=this;$("body").keydown(function(i){t.GrepoManager.PermissionService.getPermission("CustomBuildConfigs")&&i.which==e.Common.Helpers.getKeyCode("0")&&i.altKey&&t.cycleCustomTownConfigs(),i.which==e.Common.Helpers.getKeyCode("1")&&i.altKey&&t.setCurrentTownConfig(0,!0),i.which==e.Common.Helpers.getKeyCode("2")&&i.altKey&&t.setCurrentTownConfig(1,!0),i.which==e.Common.Helpers.getKeyCode("3")&&i.altKey&&t.setCurrentTownConfig(2,!0),i.which==e.Common.Helpers.getKeyCode("4")&&i.altKey&&t.setCurrentTownConfig(3,!0),i.which==e.Common.Helpers.getKeyCode("5")&&i.altKey&&t.setCurrentTownConfig(4,!0),i.which==e.Common.Helpers.getKeyCode("6")&&i.altKey&&t.setCurrentTownConfig(5,!0)});var t=this;$("body").on("click","."+this.ClassName+" ."+this.SubClassName+" li",function(e){if(e.target===this){$("."+t.ClassName+" ."+t.SubClassName+" li").removeClass("selected"),$("."+t.ClassName+" ."+t.SubClassName+" li").removeClass("active"),$(this).addClass("active");var i=t.getBuildConfigs(),n=t.getConfigNumberFromID($(this).data("config-id"));return t.setCurrentTownConfig(n,!0),$("."+t.ClassName+" p").text(i[n].Title),!1}}),this.GrepoManager.PermissionService.getPermission("CustomBuildConfigs")&&$("body").on("click","."+this.ClassName+" ."+this.SubClassName+" ul li:first-child ul li:nth-child(2) a",function(){t.getBuildConfigs().length<16?i.createNewEmptyCustomBuild():swal("Group Limit Reached","You may only have 10 custom groups, please delete one and try again!","warning")}),$("body").on("click","."+this.ClassName+" ."+this.SubClassName+" ul li:first-child ul li:nth-child(1) a",function(){return i.showTownGroupingsWindow(),t.toggleMenu(),!1}),$("body").on("click","."+this.ClassName+" ."+this.SubClassName+" ul li ul li:nth-child(1) a",function(){$("."+t.ClassName+" ."+t.SubClassName+" li").removeClass("selected"),$("."+t.ClassName+" ."+t.SubClassName+" li").removeClass("active"),$(this).parent().parent().parent().addClass("active");var e=t.getBuildConfigs(),i=t.getConfigNumberFromID($(this).data("config-id"));return t.setCurrentTownConfig(i,!0),$("."+t.ClassName+" p").text(e[i].Title),!1}),$("body").on("click","."+this.ClassName+" ."+this.SubClassName+" ul li ul li:nth-child(2) a",function(){if(null!=$(this).data("config-id")){e.Common.Helpers.logMessage("clicked settings for "+$(this).data("config-id"));var i=t.getBuildConfigs(),n=t.getConfigNumberFromID($(this).data("config-id")),a=i[n];if(!t.GrepoManager.LayoutManager.windowExists("Customise "+a.ID+" - "+a.Title)){var o=t.Windows.length;t.Windows[o]=new e.Layout.Windows.BuildConfigWindow(t.GrepoManager),t.Windows[o].setBuildConfig(a),t.Windows[o].init({Title:"Customise "+a.ID+" - "+a.Title})}t.toggleMenu()}return!1}),this.GrepoManager.PermissionService.getPermission("CustomBuildConfigs")&&$("body").on("click","."+this.ClassName+" ."+this.SubClassName+" ul li ul li:nth-child(3) a",function(){e.Common.Helpers.logMessage("clicked clone for "+$(this).data("config-id"));var i=t.getBuildConfigs();if(i.length<16){var n=i[t.getConfigNumberFromID($(this).data("config-id"))],a=JSON.stringify(n);e.Common.Helpers.logMessage([t.getBuildConfigs(),n,a]);var o=e.Common.Containers.BuildConfigContainer.createFromJSON(a);o.Title=n.Title+" Copy",o.ID="Custom "+(i.length-5),t.addConfig(o,!1,!0)}else swal("Group Limit Reached","You may only have 10 custom groups, please delete one and try again!","warning");return!1}),this.GrepoManager.PermissionService.getPermission("CustomBuildConfigs")&&$("body").on("click","."+this.ClassName+" ."+this.SubClassName+" ul li ul li:nth-child(4) a",function(){var i=t.getConfigByID($(this).data("config-id"));swal({title:"Are you sure?",text:'"'+i.ID+" - "+i.Title+'" will be deleted, this cannot be undone',type:"warning",showCancelButton:!0,confirmButtonColor:"#DD6B55",confirmButtonText:"Yes, Delete!"}).then(function(){if($(this).data("config-id")<=5)return!1;var n=t.getConfigNumberFromID($(this).data("config-id"));t.getBuildConfigs()[n]=null;var a=t.getTownConfigs();e.Common.Helpers.logMessage(["town configs",a]);for(var o=0,r=a;o<r.length;o++){var s=r[o];s==n&&(s=0)}t.setTownConfigs(a),e.Common.Helpers.logMessage(["town configs",a]),swal("Deleted!",'"'+i.ID+" - "+i.Title+'" has been deleted.',"success")})})},i.prototype.handleTownSwitch=function(){this.updateToolbarTownConfig(),this.updateWindowInterfaces()},i.prototype.updateToolbarTownConfig=function(){var e=this.getCurrentTownConfig();$("."+this.ClassName+" p").text(e.Title),$("."+this.ClassName+" ."+this.SubClassName+" li").removeClass("active"),$("."+this.ClassName+" ul li").each(function(){$(this).text().trim()==e.ID+" - "+e.Title&&$(this).addClass("active")})},i.prototype.createNewEmptyCustomBuild=function(){if(this.GrepoManager.PermissionService.getPermission("CustomBuildConfigs")){var i=this.getBuildConfigs().length-5,t=new e.Common.Containers.BuildConfigContainer({ID:"Custom "+i,Title:"Empty Build "+i,BuildingLevels:e.Common.Containers.BuildingLevelContainer.initWithMaxValues({}),ResearchLevels:e.Common.Containers.ResearchLevelContainer.initWithNoResearches(),UnitLevels:e.Common.Containers.UnitLevelContainer.initWithNoTroops()});this.addConfig(t,!1,!0)}},i.prototype.getConfigNumberFromID=function(e){var i=this.getBuildConfigs(),t=null;for(var n in i)i[n].ID==e&&(t=n);return t},i.prototype.getConfigByID=function(e){return this.getBuildConfigs()[this.getConfigNumberFromID(e)]},i.prototype.updateBuildConfig=function(i){if(this.GrepoManager.PermissionService.getPermission("CustomBuildConfigs")){e.Common.Helpers.logMessage(["build config - ",i]);var t=this.getBuildConfigs();e.Common.Helpers.logMessage(["build configs - ",t]);var n=this.getConfigNumberFromID(i.ID);e.Common.Helpers.logMessage(["build config id - ",n]),t[n]=i,e.Common.Helpers.logMessage(["updated configs - ",t]),this.setBuildConfigs(t)}},i.prototype.getTownConfigs=function(){var e=localStorage.getItem("townConfigs");return null!=e?JSON.parse(e):{}},i.prototype.setBuildConfigs=function(e){localStorage.setItem("buildConfigs",JSON.stringify(e))},i.prototype.setTownConfigs=function(e){localStorage.setItem("townConfigs",JSON.stringify(e))},i.prototype.initialiseTownConfigs=function(){for(var e=gmHelpers._.allKeys(ITowns.towns),i={},t=0,n=e;t<n.length;t++){i[n[t]]=0}this.setTownConfigs(i)},i.prototype.getTownsInGroup=function(e){var i=this.getTownConfigs(),t=[];for(var n in i)i[n]==e&&t.push(n);return t},i.prototype.showTownGroupingsWindow=function(){if(!this.GrepoManager.LayoutManager.windowExists("Towns Overview")){var i=this.Windows.length;this.Windows[i]=new e.Layout.Windows.BuildConfigGroupTownWindow(this.GrepoManager),this.Windows[i].init({Title:"Towns Overview"})}},i.prototype.updateWindowInterfaces=function(){for(var e=0,i=this.Windows;e<i.length;e++){i[e].updateInterface()}},i}();i.BuildConfigManager=t}(e.Management||(e.Management={}))}(Grepo||(Grepo={}));var Grepo;!function(e){!function(i){var t=function(){function i(e){this._ClassName=null,this._SubClassName=null,this.GrepoManager=e;var i=this;this.ClassName=this.GrepoManager.ContextMenuManager.addItemToMainToolbar("","fa-exclamation-circle","right","N",function(){i.toggleMenu()}),this.GrepoManager.HelpManager.listKeyBinding("Notifications Pane","N"),this.addSubmenuToToolbar()}return Object.defineProperty(i.prototype,"GrepoManager",{get:function(){return this._GrepoManager},set:function(e){this._GrepoManager=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"ClassName",{get:function(){return this._ClassName},set:function(e){this._ClassName=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"SubClassName",{get:function(){return this._SubClassName},set:function(e){this._SubClassName=e},enumerable:!0,configurable:!0}),i.prototype.addSubmenuToToolbar=function(){this.SubClassName=e.Common.Helpers.generateGuid();var i="."+this.ClassName+".active {background-color: rgb(88, 92, 95);}."+this.SubClassName+".active {display: block;}."+this.SubClassName+" {position: absolute; right: 0; width: 218px; height: auto; background: rgb(53, 56, 58); border-left: 2px solid white; border-bottom: 2px solid white; top: 0; z-index:1999; display: none;}."+this.SubClassName+" ul {overflow-y: scroll;}."+this.SubClassName+" ul li:first-child {border-top: 0;}."+this.SubClassName+" ul li {width: 100%; float: none; box-sizing: border-box; padding: 10px 10px !important; border-top: 1px solid rgb(255, 255, 255);}."+this.SubClassName+" ul li:hover {background-color: rgb(88, 92, 95);}",t=$("<style>"+i+"</style>");$("head").append(t);var n=$("<div class='"+this.SubClassName+"'><h3>Notifications</h3><ul></ul></div>");$("body").append(n),this.adjustHeight()},i.prototype.toggleMenu=function(){$("."+this.ClassName).hasClass("active")?($("."+this.ClassName).removeClass("active"),$("."+this.SubClassName).removeClass("active"),$("#ui_box").css({width:"100%",marginRight:"0"})):($("."+this.ClassName).addClass("active"),$("."+this.SubClassName).addClass("active"),$("#ui_box").css({width:"auto",marginRight:"220px"}))},i.prototype.adjustHeight=function(){this.GrepoManager.ContextMenuManager.toolbarVisible?$("."+this.SubClassName).css({height:$("body").outerHeight()-34}):$("."+this.SubClassName).css({height:$("body").outerHeight()})},i}();i.NotificationsManager=t}(e.Layout||(e.Layout={}))}(Grepo||(Grepo={}));var Grepo;!function(e){!function(i){var t=function(){function i(e){this.OpenedWindows=[],this.WindowHandlers={},this.Windows=[],this.WindowTypes={},this.GrepoManager=e,this.registerWindowListeners()}return Object.defineProperty(i.prototype,"GrepoManager",{get:function(){return this._GrepoManager},set:function(e){this._GrepoManager=e},enumerable:!0,configurable:!0}),i.prototype.checkOpenMainBuildingWindow=function(e){for(var i=this.getOpenWindows(),t=!1,n=0,a=i;n<a.length;n++){a[n]=="building_"+e&&(t=!0)}return t},i.prototype.openMainBuildingWindow=function(e){switch(e){case"main":MainWindowFactory.openMainWindow();break;case"hide":HideWindowFactory.openHideWindow();break;case"place":PlaceWindowFactory.openPlaceWindow();break;case"lumber":LumberWindowFactory.openLumberWindow();break;case"stoner":StonerWindowFactory.openStonerWindow();break;case"ironer":IronerWindowFactory.openIronerWindow();break;case"market":MarketWindowFactory.openMarketWindow();break;case"docks":DocksWindowFactory.openDocksWindow();break;case"barracks":BarracksWindowFactory.openBarracksWindow();break;case"wall":break;case"storage":StorageWindowFactory.openStorageWindow();break;case"farm":break;case"academy":AcademyWindowFactory.openAcademyWindow();break;case"temple":TempleWindowFactory.openTempleWindow()}},i.prototype.showOverlay=function(i){var t=e.Common.Helpers.generateGuid();return $(i).append("<div class='"+t+"'></div>"),$("."+t).css({position:"absolute",width:"100%",height:"100%",backgroundColor:"rgba(0,0,0,0.5)",zIndex:5e3}),t},i.prototype.hideOverlay=function(e){$("."+e).remove()},
  5. i.prototype.getCityLumber=function(){return Number($(".ui_resources_bar .wood .amount").text())},i.prototype.getCityStone=function(){return Number($(".ui_resources_bar .stone .amount").text())},i.prototype.getCityIron=function(){return Number($(".ui_resources_bar .iron .amount").text())},i.prototype.getCityResources=function(){var i=this.getCityLumber(),t=this.getCityIron(),n=this.getCityStone();return new e.Common.Containers.CityResourceContainer(i,t,n)},i.prototype.getCityPopulation=function(){return Number($(".ui_resources_bar .population .amount").text())},i.prototype.goToPrevCity=function(){$(".town_name_area .btn_prev_town").click()},i.prototype.goToNextCity=function(){$(".town_name_area .btn_next_town").click()},i.prototype.getPremiumAdvisers=function(){return new e.Common.Containers.PremiumAdvisersContainer({Administrator:0==$(".ui_advisors .advisor_frame.curator .advisor.curator_sepia").length,Merchant:0==$(".ui_advisors .advisor_frame.trader .advisor.trader_sepia").length,HighPriestess:0==$(".ui_advisors .advisor_frame.priest .advisor.priest_sepia").length,Commander:0==$(".ui_advisors .advisor_frame.commander .advisor.commander_sepia").length,Captain:0==$(".ui_advisors .advisor_frame.captain .advisor.captain_sepia").length})},i.prototype.getOpenWindows=function(){var e=[];return $(".js-window-main-container.classic_window.market").length&&e.push("building_market"),$(".js-window-main-container .gpwindow_frame .gpwindow_content #techtree #buildings").length&&e.push("building_main"),$(".js-window-main-container .gpwindow_frame .gpwindow_content #unit_order #units #sword").length&&e.push("building_barracks"),$(".js-window-main-container .gpwindow_frame .gpwindow_content #unit_order #units #big_transporter").length&&e.push("building_docks"),$(".js-window-main-container.classic_window.academy").length&&e.push("building_academy"),$(".js-window-main-container .gpwindow_frame .gpwindow_content #place_defense #command_overview_tabs #command_overview").length&&e.push("overview_command"),e},i.prototype.handleWindowOpen=function(){var i=this;this.GrepoManager.ContextMenuManager.repositionGameElements(!1),window.setTimeout(function(){e.Common.Helpers.logMessage("window opened");var t=i.OpenedWindows,n=i.getOpenWindows(),a=gmHelpers._.difference(n,t)[0];e.Common.Helpers.logMessage(a),i.GrepoManager.windowOpened(),i.OpenedWindows=n},250)},i.prototype.handleWindowClose=function(){e.Common.Helpers.logMessage("window closed");var i=this.getOpenWindows();this.OpenedWindows=i,this.GrepoManager.ContextMenuManager.repositionGameElements(!1)},i.prototype.handleWindowReload=function(){e.Common.Helpers.logMessage("window reloaded");var i=this.OpenedWindows,t=this.getOpenWindows(),n=gmHelpers._.difference(t,i)[0];null!=n&&e.Common.Helpers.logMessage(n),this.OpenedWindows=t,this.GrepoManager.windowOpened()},i.prototype.handleWindowMinimize=function(){this.GrepoManager.ContextMenuManager.repositionGameElements(!1)},i.prototype.handleWindowMaximize=function(){this.GrepoManager.ContextMenuManager.repositionGameElements(!1)},i.prototype.registerWindowListeners=function(){var e=this;$.Observer(GameEvents.window.open).subscribe("GrepoManager_Window_Open",function(){e.handleWindowOpen()}),$.Observer(GameEvents.window.close).subscribe("GrepoManager_Window_Close",function(){e.handleWindowClose()}),$.Observer(GameEvents.window.reload).subscribe("GrepoManager_Window_Reload",function(){e.handleWindowReload()}),$.Observer(GameEvents.window.minimize).subscribe("GrepoManager_Window_Minimize",function(){e.handleWindowMinimize()}),$.Observer(GameEvents.window.maximize).subscribe("GrepoManager_Window_Maximize",function(){e.handleWindowMaximize()})},i.prototype.registerWindowHandler=function(e,i){this.WindowHandlers[e]=i},i.prototype.registerWindow=function(e,i){this.Windows.push(e),this.WindowTypes[e]=i,this.cleanupWindowIndexes()},i.prototype.unregisterWindow=function(e){var i=gmHelpers._.without(this.Windows,e);this.Windows=i,delete this.WindowTypes[e],this.cleanupWindowIndexes()},i.prototype.focusWindow=function(e){var i=gmHelpers._.without(this.Windows,e);$("."+e).css({zIndex:5e3}),i.push(e),this.Windows=i,this.cleanupWindowIndexes()},i.prototype.windowExists=function(i){var t=!1;for(var n in this.WindowTypes)e.Common.Helpers.logMessage(n),this.WindowTypes[n]==i&&(t=!0);return t},i.prototype.cleanupWindowIndexes=function(){for(var e=0;e<this.Windows.length;e++){var i=this.Windows[e];$("."+i).css({zIndex:3500+e})}for(var e=0;e<this.Windows.length;e++){var i=this.Windows[e];$("."+i).css({zIndex:2200+e})}},i}();i.LayoutManager=t}(e.Layout||(e.Layout={}))}(Grepo||(Grepo={}));var Grepo;!function(e){!function(i){var t=function(){function i(e){this._ClassName=null,this._SubClassName=null,this.GrepoManager=e;var i=this;this.ClassName=this.GrepoManager.ContextMenuManager.addItemToMainToolbar("","fa-question-circle","right","K",function(){i.toggleMenu()}),this.addSubmenuToToolbar(),this.listKeyBinding("Show Key Bindings","K")}return Object.defineProperty(i.prototype,"GrepoManager",{get:function(){return this._GrepoManager},set:function(e){this._GrepoManager=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"ClassName",{get:function(){return this._ClassName},set:function(e){this._ClassName=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"SubClassName",{get:function(){return this._SubClassName},set:function(e){this._SubClassName=e},enumerable:!0,configurable:!0}),i.prototype.addSubmenuToToolbar=function(){this.SubClassName=e.Common.Helpers.generateGuid();var i="."+this.ClassName+".active {background-color: rgb(88, 92, 95);}."+this.ClassName+".active ."+this.SubClassName+" {display: block;}."+this.ClassName+" ."+this.SubClassName+" ul li:hover {background: inherit;}."+this.ClassName+" ."+this.SubClassName+" ul li:first-child {border-top: 0; padding-top: 8px;}."+this.ClassName+" ."+this.SubClassName+" h3 { margin: 0 auto;}."+this.ClassName+" ."+this.SubClassName+" {position: absolute; right: -2px; width: 400px; height: auto; background: rgb(53, 56, 58); border: 2px solid white; bottom: 43px; display: none;}."+this.ClassName+" ."+this.SubClassName+" ul li {cursor: default; height: auto; border-top: 0; width: 100%; float: none; box-sizing: border-box; padding: 8px 10px; border-top: 1px solid rgb(255, 255, 255);}."+this.ClassName+" ."+this.SubClassName+" ul li ul {overflow: auto;}."+this.ClassName+" ."+this.SubClassName+" ul li ul li {padding: 0; float: left; border: 0; text-align: right; width: 35%}."+this.ClassName+" ."+this.SubClassName+" ul li ul li:first-child {padding-top: 0px; text-align:left; width: 65%}."+this.ClassName+" ."+this.SubClassName+" ul li kbd {padding: 2px 4px; font-size: 100%; color: black; background-color: #868686; border-radius: 3px; -webkit-box-shadow: inset 0 -1px 0 rgba(0,0,0,.25); box-shadow: inset 0 -1px 0 rgba(0,0,0,.25); font-weight: 600;}",t=$("<style>"+i+"</style>");$("head").append(t);var n=$("<div class='"+this.SubClassName+"'><ul><li><h3>Help - Key Bindings</h3></li></ul></div>");$("."+this.ClassName).append(n)},i.prototype.toggleMenu=function(){$("."+this.ClassName).hasClass("active")?$("."+this.ClassName).removeClass("active"):$("."+this.ClassName).addClass("active")},i.prototype.listKeyBinding=function(e,i){$("."+this.SubClassName).find("ul").first().append("<li><ul><li>"+e+": </li><li><kbd>Alt</kbd> + <kbd>"+i+"</kbd></li></ul></li>")},i}();i.HelpManager=t}(e.Layout||(e.Layout={}))}(Grepo||(Grepo={}));var Grepo;!function(e){!function(i){var t=function(){function i(i){this.toolbar=null,this.toolbarVisible=!0,this.toolbars={},this.GrepoManager=i,this.createToolbar(),this.toolbars.building_main=new e.Layout.ContextMenu.SenateContextMenu(this),this.toolbars.building_barracks=new e.Layout.ContextMenu.BarracksContextMenu(this),this.toolbars.building_academy=new e.Layout.ContextMenu.AcademyContextMenu(this),this.toolbars.building_docks=new e.Layout.ContextMenu.DocksContextMenu(this),this.registerEventServiceListeners()}return Object.defineProperty(i.prototype,"GrepoManager",{get:function(){return this._GrepoManager},set:function(e){this._GrepoManager=e},enumerable:!0,configurable:!0}),i.prototype.registerEventServiceListeners=function(){var e=this;this.GrepoManager.EventService.registerEvent("RepositionGameElements",function(){e.repositionGameElements(!1)})},i.prototype.createToolbar=function(){var i=this,t=e.Common.Helpers.generateGuid(),n="body {overflow: hidden}."+t+" {height: 32px; background-color: rgb(53, 56, 58); bottom: 0px; z-index: 2001; border-top: 2px solid white; width: 100%; position: absolute; text-align: left;}."+t+".minimize {width: 36px; border-right: 2px solid white; background-color: rgba(53, 56, 58, 0.5);}."+t+".minimize:hover {background-color: rgb(53, 56, 58);}."+t+".minimize ul { height: 0}."+t+".minimize ul:first-child {height: 100%}."+t+" ul {}."+t+" ul li {float: left; cursor: pointer; color: white; font-weight: normal; height: 36px; padding-top: 7px; padding-left: 8px; padding-right: 10px; position: relative;}."+t+" ul li p {float: right; margin: 0;}."+t+" ul li.hastext i {margin-right: 5px}."+t+" ul li:hover {background-color: rgb(88, 92, 95);}."+t+" ul li.nohover {padding-right: 0px;}."+t+" ul li.nohover:hover {background-color: rgb(53, 56, 58);}."+t+" ul.left li:first-child {width: 36px; text-align: center; border-right: 2px solid white; padding-left: 0; padding-right: 0;}."+t+" ul.right, ."+t+" ul.middle-right {float: right;}",a=$("<style>"+n+"</style>");$("head").append(a);var o=$("<div class='"+t+"'><ul class='left'></ul><ul class='middle-left'></ul><ul class='right'></ul><ul class='middle-right'></ul></ul></div>");$("body").append(o),this.toolbar=$("."+t),this.toolbar.removeClass("minimize"),this.toolbarVisible=!0,this.repositionGameElements(!0);this.addItemToMainToolbar("","fa-bars","left","H",function(){i.toolbarVisible?i.hideToolbar():i.showToolbar()})},i.prototype.addItemToMainToolbar=function(i,t,n,a,o){var r=e.Common.Helpers.generateGuid(),s=r+" "+(""!=i?"hastext":""),l=t?"<i class='fa fa-lg "+t+"'></i>":"",u=i?"<p>"+i+"</p>":"",h=$("<li class='"+s+"' >"+l+u+"</li>");return this.toolbar.find("ul."+n).first().append(h),$("."+r+", ."+r+" p:eq(0), ."+r+" i:eq(0)").on("click",function(e){e.target===this&&o.call()}),$("body").keydown(function(i){i.which==e.Common.Helpers.getKeyCode(a)&&i.altKey&&o.call()}),r},i.prototype.checkToolbarExists=function(e){return!!this.toolbars[e]},i.prototype.loadToolbar=function(i){e.Common.Helpers.logMessage("trying to load toolbar for "+i),this.toolbars[i].addToolbarToWindow()},i.prototype.hideToolbar=function(){this.toolbar.addClass("minimize"),this.toolbarVisible=!1,this.repositionGameElements(!1),this.GrepoManager.NotificationsManager.adjustHeight()},i.prototype.showToolbar=function(){this.toolbar.removeClass("minimize"),this.toolbarVisible=!0,this.repositionGameElements(!1),this.GrepoManager.NotificationsManager.adjustHeight()},i.prototype.repositionGameElements=function(i){e.Common.Helpers.logMessage("repositioning");var t=-3,n=14,a=25,o=11;$("#minimized_windows_area .windows_box .box").length>0&&(t+=34),i?(t+=34,n+=34,a+=34,o+=34):this.toolbar.hasClass("minimize")||(t+=34,n+=34,a+=34,o+=34),$(".ui_construction_queue").css({bottom:t+"px"}),$("#minimized_windows_area").css({bottom:n+"px"}),$("#notification_area").css({bottom:o+"px"}),$(".happening_large_icon_container").css({bottom:a+"px"})},i.prototype.addToolbar=function(e,i){this.toolbars[e]=i},i.prototype.getCommonStyles=function(e){return"."+e+" {width: 100%; height: 25px; background-color: rgb(53, 56, 58); position: absolute; bottom: 0; border-top: 2px solid black; border-bottom: 2px solid black; box-sizing: border-box; border: 2px solid black; color: white; }."+e+" li {cursor: pointer; float: left; padding: 2px 7px 3px 7px; }."+e+" li.active {background-color: rgb(88, 92, 95);}."+e+" li:hover {background-color: rgb(88, 92, 95);}"},i.prototype.checkToolbars=function(e){var i=this;$.each(e,function(){i.toolbars[this].checkToolbar()})},i}();i.ContextMenuManager=t}(e.Layout||(e.Layout={}))}(Grepo||(Grepo={}));var Grepo;!function(e){!function(i){var t=function(){function i(){}return i.generateRandomTime=function(e,i){var t=Math.random()*e,n=Math.random(),a=0;return n>.95&&(a=n*i),t+a},i.generateGuid=function(){var e=(new Date).getTime(),i="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(i){var t=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===i?t:3&t|8).toString(16)});return i=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"][Math.floor(26*Math.random())]+i.substring(1)},i.getCurrentTown=function(){var i=new e.Common.Models.Town;return i.Id=Game.townId,i.Name=Game.townName,i.Points=0,i.Owner=null,i},i.getCurrentPlayer=function(){var i=new e.Common.Models.Player;return i.Id=Game.player_id,i.Name=Game.player_name,i.Points=Game.player_points,i},i.getWorld=function(){return Game.world_id},i.getKeyCode=function(e){var e=e.toLowerCase();return{0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,a:65,b:66,c:67,d:68,e:69,f:70,g:71,h:72,i:73,j:74,k:75,l:76,m:77,n:78,o:79,p:80,q:81,r:82,s:83,t:84,u:85,v:86,w:87,x:88,y:89,z:90}[e]},i.convertBuildingCodeToGame=function(e){return{Main:"main",Hide:"hide",Place:"place",Lumber:"lumber",Stoner:"stoner",Ironer:"ironer",Market:"market",Docks:"docks",Barracks:"barracks",Wall:"wall",Storage:"storage",Farm:"farm",Academy:"academy",Temple:"temple",Theater:"theater",Thermal:"thermal",Library:"library",Lighthouse:"lighthouse",Tower:"tower",Statue:"statue",Oracle:"oracle",TradeOffice:"trade_office"}[e]},i.convertBuildingGameToCode=function(e){return{main:"Main",hide:"Hide",place:"Place",lumber:"Lumber",stoner:"Stoner",ironer:"Ironer",market:"Market",docks:"Docks",barracks:"Barracks",wall:"Wall",storage:"Storage",farm:"Farm",academy:"Academy",temple:"Temple",theater:"Theater",thermal:"Thermal",library:"Library",lighthouse:"Lighthouse",tower:"Tower",statue:"Statue",oracle:"Oracle",trade_office:"TradeOffice"}[e]},i.convertResearchCodeToGame=function(e){return{Slinger:"slinger",Archer:"archer",TownGuard:"town_guard",Hoplite:"hoplite",Diplomacy:"diplomacy",Meteorology:"meteorology",Espionage:"espionage",Booty:"booty",Pottery:"pottery",Rider:"rider",Architecture:"architecture",Instructor:"instructor",Bireme:"bireme",BuildingCrane:"building_crane",ShipWright:"shipwright",Chariot:"chariot",AttackShip:"attack_ship",Conscription:"conscription",DemolitionShip:"demolition_ship",Catapult:"catapult",Cryptography:"cryptography",Democracy:"democracy",ColonizeShip:"colonize_ship",SmallTransporter:"small_transporter",Plow:"plow",Berth:"berth",Trireme:"trireme",Phalanx:"phalanx",Breach:"breach",Mathematics:"mathematics",Ram:"ram",Cartography:"cartography",TakeOverOld:"take_over_old",StoneStorm:"stone_storm",TempleLooting:"temple_looting",DivineSelection:"divine_selection",CombatExperience:"combat_experience",StrongWine:"strong_wine",SetSail:"set_sail"}[e]},i.convertResearchGameToCode=function(e){return{slinger:"Slinger",archer:"Archer",town_guard:"TownGuard",hoplite:"Hoplite",diplomacy:"Diplomacy",meteorology:"Meteorology",espionage:"Espionage",booty:"Booty",pottery:"Pottery",rider:"Rider",architecture:"Architecture",instructor:"Instructor",bireme:"Bireme",building_crane:"BuildingCrane",shipwright:"ShipWright",chariot:"Chariot",attack_ship:"AttackShip",conscription:"Conscription",demolition_ship:"DemolitionShip",catapult:"Catapult",cryptography:"Cryptography",democracy:"Democracy",colonize_ship:"ColonizeShip",small_transporter:"SmallTransporter",plow:"Plow",berth:"Berth",trireme:"Trireme",phalanx:"Phalanx",breach:"Breach",mathematics:"Mathematics",ram:"Ram",cartography:"Cartography",take_over_old:"TakeOverOld",stone_storm:"StoneStorm",temple_looting:"TempleLooting",divine_selection:"DivineSelection",combat_experience:"CombatExperience",strong_wine:"StrongWine",set_sail:"SetSail"}[e]},i.getPopulationForBuilding=function(e,i){return Math.round(GameData.buildings[e].pop*Math.pow(i,GameData.buildings[e].pop_factor))},i.getPointsForBuilding=function(e,i){return{main:[0,110,121,133,146,161,177,195,214,236,259,285,314,345,380,418,459,505,556,612,673,740,814,895,985,1083],lumber:[0,22,24,27,29,32,35,39,43,47,52,57,63,69,76,84,92,101,111,122,135,148,163,179,197,217,239,263,289,318,350,385,423,466,512,563,619,681,749,824,906],stoner:[0,22,24,27,29,32,35,39,43,47,52,57,63,69,76,84,92,101,111,122,135,148,163,179,197,217,238,262,288,317,349,384,422,464,510,561,617,679,747,822,904],ironer:[0,22,24,26,29,32,35,39,43,47,52,57,63,69,76,84,92,101,111,122,134,147,162,178,196,216,237,261,287,316,348,383,421,464,510,561,617,679,747,822,904],hide:[0,60,72,86,104,124,149,179,215,258,310],storage:[0,15,17,19,22,25,29,33,37,42,48,55,63,71,81,93,106,121,137,157,179,204,232,265,302,344,392,447,510,581,662,755,861,981,1119,1275],market:[0,108,117,126,136,147,159,172,186,201,217,234,253,273,295,319,345,373,403,435,470,508,549,593,640,691,746,806,870,940,1015],barracks:[0,33,37,41,46,51,57,64,71,79,88,98,109,122,136,152,169,188,210,234,261,291,324,361,403,449,501,559,623,695,775],docks:[0,66,73,80,88,97,107,118,130,143,157,173,190,209,230,253,278,306,337,371,408,449,494,543,597,657,723,795,875,963,1059],wall:[0,34,38,42,47,53,59,66,74,83,93,104,117,131,147,164,184,206,231,258,289,324,363,407,455,510],academy:[0,67,75,84,94,105,118,132,148,166,186,208,233,261,292,327,366,410,459,514,576,645,722,809,906,1015,1137,1273,1426,1597,1789,2004,2246,2516,2820,3159,3539],temple:[0,216,233,252,272,294,318,343,370,400,432,467,504,544,588,636,687,742,801,865,934,1012,1093,1180,1274,1376,1485,1604,1731,1870,2020],farm:[0,17,19,21,24,26,30,33,37,42,47,52,58,65,73,82,92,103,115,129,145,162,182,203,228,255,286,320,358,401,449,503,564,631,707,792,887,993,1113,1246,1396,1563,1751,1961,2196,2460],theater:[0,500],lighthouse:[0,500],library:[0,500],thermal:[0,500],tower:[0,500],statue:[0,500],oracle:[0,500],trade_office:[0,500],place:[0,33]}[e][i]},i.getMaxPopulationForFarm=function(e){return Math.floor(GameData.buildings.farm.farm_factor*Math.pow(e,GameData.buildings.farm.farm_pow))},i.logMessage=function(e){var i=new Date;console.log(i.toTimeString(),e)},i.switchToTown=function(e){HelperTown.townSwitch(e)},i.openSupportWindow=function(e,i){GPWindowMgr.Create(GPWindowMgr.TYPE_TOWN,i,"support",{id:e}),window.setTimeout(function(){$("#town_info-support").click()},250)},i.openAttackWindow=function(e,i){GPWindowMgr.Create(GPWindowMgr.TYPE_TOWN,i,"attack",{id:e}),window.setTimeout(function(){$("#town_info-attack").click()},250)},i.openSpyWindow=function(e,i){GPWindowMgr.Create(GPWindowMgr.TYPE_TOWN,i,"espionage",{id:e}),window.setTimeout(function(){$("#town_info-espionage").click()},250)},i.openTradeWindow=function(e,i){GPWindowMgr.Create(GPWindowMgr.TYPE_TOWN,i,"trading",{id:e}),window.setTimeout(function(){$("#town_info-trading").click()},250)},i.formatTimestamp=function(e){var i=new Date(1e3*e);return i.getFullYear()+"/"+(i.getMonth()+1<10?"0"+(i.getMonth()+1):i.getMonth()+1)+"/"+(i.getDate()<10?"0"+i.getDate():i.getDate())+" "+(i.getHours()<10?"0"+i.getHours():i.getHours())+":"+(i.getMinutes()<10?"0"+i.getMinutes():i.getMinutes())+":"+(i.getSeconds()<10?"0"+i.getSeconds():i.getSeconds())},i}();i.Helpers=t}(e.Common||(e.Common={}))}(Grepo||(Grepo={}));var Grepo;!function(e){var i=function(){function i(){this.SocketService=new e.Services.SocketService(this),this.TranslationService=new e.Services.TranslationService(this),this.UpdateAppService=new e.Services.UpdateAppService(this),this.PermissionService=new e.Services.PermissionsService(this.SocketService),this.EventService=new e.Services.EventService,this.ContextMenuManager=new e.Layout.ContextMenuManager(this),this.HelpManager=new e.Layout.HelpManager(this),this.LayoutManager=new e.Layout.LayoutManager(this),this.BuildConfigManager=new e.Management.BuildConfigManager(this),this.SettingsManager=new e.Management.SettingsManager(this),this.CommandManager=new e.Management.CommandManager(this),this.BuildingManager=new e.Management.BuildingManager(this),this.UnitManager=new e.Management.UnitManager(this),this.ShipManager=new e.Management.ShipManager(this),this.ResearchManager=new e.Management.ResearchManager(this),this.ResourceManager=new e.Management.ResourceManager(this),this.NotificationsManager=new e.Layout.NotificationsManager(this),this.CultureManager=new e.Management.CultureManager(this),this.GodManager=new e.Management.GodManager(this),this.WindowListeningComponents=[this.CommandManager]}return Object.defineProperty(i.prototype,"HelpManager",{get:function(){return this._HelpManager},set:function(e){this._HelpManager=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"BuildingManager",{get:function(){return this._BuildingManager},set:function(e){this._BuildingManager=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"CultureManager",{get:function(){return this._CultureManager},set:function(e){this._CultureManager=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"GodManager",{get:function(){return this._GodManager},set:function(e){this._GodManager=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"LayoutManager",{get:function(){return this._LayoutManager},set:function(e){this._LayoutManager=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"ResearchManager",{get:function(){return this._ResearchManager},set:function(e){this._ResearchManager=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"ResourceManager",{get:function(){return this._ResourceManager},set:function(e){this._ResourceManager=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"UnitManager",{get:function(){return this._UnitManager},set:function(e){this._UnitManager=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"SettingsManager",{get:function(){return this._SettingsManager},set:function(e){this._SettingsManager=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"ContextMenuManager",{get:function(){return this._ContextMenuManager},set:function(e){this._ContextMenuManager=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"NotificationsManager",{get:function(){return this._NotificationsManager},set:function(e){this._NotificationsManager=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"ShipManager",{get:function(){return this._ShipManager},set:function(e){this._ShipManager=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"BuildConfigManager",{get:function(){return this._BuildConfigManager},set:function(e){this._BuildConfigManager=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"CommandManager",{get:function(){return this._CommandManager},set:function(e){this._CommandManager=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"EventService",{get:function(){return this._EventService},set:function(e){this._EventService=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"PermissionService",{get:function(){return this._PermissionService},set:function(e){this._PermissionService=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"SocketService",{get:function(){return this._SocketService},set:function(e){this._SocketService=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"TranslationService",{get:function(){return this._TranslationService},set:function(e){this._TranslationService=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"UpdateAppService",{get:function(){return this._UpdateAppService},set:function(e){this._UpdateAppService=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"WindowListeningComponents",{get:function(){return this._WindowListeningComponents},set:function(e){this._WindowListeningComponents=e},enumerable:!0,configurable:!0}),i.prototype.windowOpened=function(){for(var e=0,i=this.WindowListeningComponents;e<i.length;e++){i[e].handleWindowOpen()}},i}();e.GrepoManager=i,window.setTimeout(function(){!function(){new i}()},1e3)}(Grepo||(Grepo={}));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement