text: /**
   * SubclassParameter - v0.1.0 - 2015-10-07
   * https://github.com/msdoom2011/subclassjs
   *
   * Copyright (c) 2015 Dmitriy Osipishin | msdoom2011@gmail.com
   */
  !function(){"use strict";Subclass.Parameter={},Subclass.Parameter.Extension={},Subclass.Parameter.ParameterManager=function(){function a(a){a&&a instanceof Subclass.Module||Subclass.Error.create("InvalidArgument").argument("the module instance",!1).received(a).expected('an instance of "Subclass.Module" class').apply(),this._module=a,this._parameters={}}return a.prototype.getModule=function(){return this._module},a.prototype.getParameters=function(a,b){var c=this.getModule(),d=c.getModuleStorage(),e={},f=this;return a!==!0&&(a=!1),b!==!1&&(b=!0),a||!b||c.isRoot()||arguments[2]==c?a?this._parameters:(d.eachModule(function(a){if(a==c)return void Subclass.Tools.extend(e,f.getParameters(!0,!1));var b=a.getParameterManager(),d=b.getParameters(!1,!1);Subclass.Tools.extend(e,d)}),e):c.getRoot().getParameterManager().getParameters(!1,!1,c)},a.prototype.getLocations=function(a){var b=this.getModule().getRoot(),c=[];arguments[1]&&(b=arguments[1]);var d=b.getModuleStorage();return d.eachModule(function(d){var e=d.getParameterManager();if(e.isset(a,!0)&&c.push(d.getName()),d!=b&&d.hasPlugins())for(var f=d.getModuleStorage(),g=f.getPlugins(),h=0;h<g.length;h++){var i=g[h],j=i.getParameterManager(),k=j.getLocations(a,i);c=c.concat(k)}}),c},a.prototype.register=function(a,b){this.getModule().isReady()&&Subclass.Error.create("Can't register new parameter when module is ready."),this._parameters[a]=Subclass.Tools.createClassInstance(Subclass.Parameter.Parameter,a,b)},a.prototype.rename=function(a,b){this.isset(a)||Subclass.Error.create('Trying to rename non existent parameter "'+a+'".'),b&&"string"==typeof b||Subclass.Error.create("InvalidError").argument("the new parameter name",!1).expected("a string").received(b).apply();for(var c=this.getLocations(a),d=0;d<c.length;d++){var e=Subclass.getModule(c[d]),f=e.getParameterManager(),g=f.getParameters(!0),h=g[a];h||Subclass.Error.create('The work of method "Subclass.Parameter.ParameterManager#getLocations" is incorrect.'),delete g[a],g[b]=h,h.setName(b)}},a.prototype.set=function(a,b){this.getModule().isReady()&&Subclass.Error.create("Can't change parameter value when module is ready."),this.isset(a)||Subclass.Error.create('Parameter with name "'+a+'" not exists.'),this._parameters[a].setValue(b)},a.prototype.get=function(a){return this.isset(a)||Subclass.Error.create('Parameter with name "'+a+'" not exists.'),this.getParameters()[a].getValue()},a.prototype.isset=function(a,b){return!!this.getParameters(b)[a]},a}(),Subclass.Parameter.Extension.ModuleAPIExtension=function(){function a(b){a.$parent.apply(this,arguments)}a.$parent=Subclass.Extension;var b=Subclass.ModuleAPI;return b.prototype.getParameterManager=function(){return this.getModule().getParameterManager.apply(this.getModule(),arguments)},b.prototype.registerParameter=function(){return this.getModule().getParameterManager().register.apply(this.getModule().getParameterManager(),arguments)},b.prototype.registerParameters=function(){return this.getModule().getSettingsManager().setParameters.apply(this.getModule().getSettingsManager(),arguments)},b.prototype.setParameter=function(){return this.getModule().getParameterManager().set.apply(this.getModule().getParameterManager(),arguments)},b.prototype.getParameter=function(){return this.getModule().getParameterManager().get.apply(this.getModule().getParameterManager(),arguments)},b.prototype.issetParameter=function(){return this.getModule().getParameterManager().isset.apply(this.getModule().getParameterManager(),arguments)},Subclass.Module.onInitializeBefore(function(c,d){b=Subclass.Tools.buildClassConstructor(b),b.hasExtension(a)||b.registerExtension(a)}),a}(),Subclass.Parameter.Extension.ModuleExtension=function(){function a(b){a.$parent.apply(this,arguments)}a.$parent=Subclass.Extension,a.initialize=function(a){this.$parent.initialize.apply(this,arguments);var b=a.getEventManager();b.getEvent("onInitialize").addListener(function(a,b){this._parameterManager=Subclass.Tools.createClassInstance(Subclass.Parameter.ParameterManager,this)})};var b=Subclass.Module;return b.prototype.getParameterManager=function(){return this._parameterManager},Subclass.Module.onInitializeBefore(function(c,d){b=Subclass.Tools.buildClassConstructor(b),b.hasExtension(a)||b.registerExtension(a)}),a}(),Subclass.Parameter.Extension.ModuleInstanceExtension=function(){function a(b){a.$parent.apply(this,arguments)}a.$parent=Subclass.Extension,a.initialize=function(b){a.$parent.initialize.apply(this,arguments),b.getEvent("onInitialize").addListener(function(){this._parameterContainer=Subclass.Tools.createClassInstance(Subclass.Parameter.ParameterContainer,this)})};var b=Subclass.ModuleInstance;return b.prototype.getParameterContainer=function(){return this._parameterContainer},Subclass.Module.onInitializeBefore(function(c,d){b=Subclass.Tools.buildClassConstructor(b),b.hasExtension(a)||b.registerExtension(a)}),a}(),Subclass.Parameter.Extension.SettingsManagerExtension=function(){function a(b){a.$parent.apply(this,arguments)}a.$parent=Subclass.Extension;var b=Subclass.SettingsManager;return b.prototype.setParameters=function(a){this.checkModuleIsReady(),a&&Subclass.Tools.isPlainObject(a)||Subclass.Error.create("InvalidModuleOption").option("parameters").module(this.getModule().getName()).received(a).expected("a plain object").apply();var b=this.getModule().getParameterManager();for(var c in a)a.hasOwnProperty(c)&&b.register(c,a[c])},b.prototype.getParameters=function(){for(var a=this.getModule().getParameterManager().getParameters(),b={},c=0;c<a.length;c++){var d=a[c].getValue(),e=a[c].getName();b[e]=Subclass.Tools.copy(d)}return b},Subclass.Module.onInitializeBefore(function(c,d){b=Subclass.Tools.buildClassConstructor(b),b.hasExtension(a)||b.registerExtension(a)}),a}(),Subclass.Parameter.Parameter=function(){function a(a,b){this._name=null,this._value=b,this.setName(a)}return a.prototype.setName=function(a){a&&"string"==typeof a||Subclass.Error.create("InvalidArgument").argument("the name of parameter",!1).received(a).expected("a string").apply(),this._name=a},a.prototype.getName=function(){return this._name},a.prototype.getValue=function(){return this._value},a.prototype.setValue=function(a){this._value=a},a}(),Subclass.Parameter.ParameterContainer=function(){function a(a){a&&a instanceof Subclass.ModuleInstance||Subclass.Error.create("InvalidArgument").argument("the module instance",!1).expected('an instance of class "Subclass.ModuleInstance"').received(a).apply(),this._moduleInstance=a,this._module=a.getModule()}return a.prototype={getModule:function(){return this._module},getModuleInstance:function(){return this._moduleInstance},getParameterManager:function(){return this.getModule().getParameterManager()},getParameters:function(){return this.getParameterManager().getParameters()},get:function(a){return this.getParameterManager().get(a)},isset:function(a){return this.getParameterManager().isset(a)}},a}(),Subclass.Parser.ParameterParser=function(){function a(){a.$parent.apply(this,arguments)}return a.$parent=Subclass.Parser.ParserAbstract,a.getName=function(){return"parameter"},a.prototype={parse:function(a){if("string"==typeof a&&a.match(/%.+%/i)){var b=this.getModule().getParameterManager(),c="%([^%]+)%",d=new RegExp(c,"i");if(new RegExp("^"+c+"$","i").test(a))e=a.match(d)[1],a=b.get(e);else for(;d.test(a);){var e=a.match(d)[1],f=b.get(e);a=a.replace(d,f)}}return a}},Subclass.Parser.ParserManager.registerParser(a),a}(),Subclass.registerPlugin(function(){function a(){a.$parent.call(this)}return a.$parent=Subclass.SubclassPlugin,a.getName=function(){return"SubclassParameter"},a.getDependencies=function(){return["SubclassParser"]},a}())}();