"use strict";var ContentObject=function(t,n,i,a){this.currentContentLanguage=null,this.additionalTranslationCallback=a,this.afterConstructionCallback=i,this.$contentPage=null,this.$standardContentElems={},this.additionalIdentificators=null,this.$additionalContentElems=null,this.additionalIdentificatorsNames=null,this.additionalIdentificators=n,Util.isInitialized(t)&&this.init(t)};ContentObject.prototype.init=function(t){this.$contentPage=t,this.$contentPage.is("#onscreenGui")||this.$contentPage.addClass("window-full");for(var n=0;n<ContentObject.StandardIdentificators._enumNames.length;n++)this.$standardContentElems[ContentObject.StandardIdentificators._enumNames[n]]=t.find("["+ContentObject.StandardIdentificators._enumNames[n]+"]");if(this.additionalIdentificatorsNames=null,Util.isInitialized(this.additionalIdentificators))for(this.$additionalContentElems={},this.additionalIdentificatorsNames=Object.keys(this.additionalIdentificators),n=0;n<this.additionalIdentificatorsNames.length;n++)this.$additionalContentElems[this.additionalIdentificatorsNames[n]]=t.find("["+this.additionalIdentificatorsNames[n]+"]");this.applyCallback("modifier"),Util.isInitialized(this.afterConstructionCallback)&&this.afterConstructionCallback(this)},ContentObject.StandardIdentificators={langcaption:{translation:function(t,n){t.html(ContentLibrary.getContentString(t.attr("langcaption")))}},langcaption_title:{translation:function(t,n){t.tooltipster("content",ContentLibrary.getContentString(t.attr("langcaption_title")))},modifier:function(t,n){t.addClass("tooltip"),t.tooltipster({theme:"tooltipster-light",hideOnClick:!0})}},langtype:{translation:function(t,n){var i=t.attr("langtype");Preferences.Languages[i]===Preferences.Languages.getCurrentLanguage()?t.show():t.hide()}},dialogtitle:{translation:function(t,n){n.find(".windowDialog").dialog("option","title",ContentLibrary.getContentString(t.attr("dialogtitle")))}}},ContentObject.StandardIdentificators._enumNames=Object.keys(ContentObject.StandardIdentificators),ContentObject.prototype._applyCallback=function(t,n,i,a){for(var e=i[a],o=0;o<e.length;o++)Util.isInitialized(n[a][t])&&n[a][t]($(e[o]),this.$contentPage)},ContentObject.prototype.applyCallback=function(t){for(var n=0;n<ContentObject.StandardIdentificators._enumNames.length;n++)this._applyCallback(t,ContentObject.StandardIdentificators,this.$standardContentElems,ContentObject.StandardIdentificators._enumNames[n]);if(Util.isInitialized(this.additionalIdentificatorsNames))for(n=0;n<this.additionalIdentificatorsNames.length;n++)this._applyCallback(t,this.additionalIdentificators,this.$additionalContentElems,this.additionalIdentificatorsNames[n])},ContentObject.prototype.translate=function(){this.currentContentLanguage!==Preferences.Languages.getCurrentLanguage()&&(this.applyCallback("translation"),Util.isInitialized(this.additionalTranslationCallback)&&this.additionalTranslationCallback(this,this),this.currentContentLanguage=Preferences.Languages.getCurrentLanguage())};