"use strict";
_kangoLoader.add("kango/core", function(require, exports, module) {
function Core(){EventTarget.call(this),this._asyncModules=[],this._apiFactories={},this._moduleInitializedListener=func.bind(function(e){array.remove(this._asyncModules,e.data)},this),this.addEventListener("moduleinitialized",this._moduleInitializedListener)}var utils=require("kango/utils"),object=utils.object,array=utils.array,func=utils.func,EventTarget=utils.EventTarget,extensionInfo=require("kango/extension_info");Core.prototype=object.extend(EventTarget,{init:function(){object.forEach(extensionInfo.modules,function(e){require(e)});var e=!1;this.addEventListener("moduleinitialized",func.bind(function(i){array.remove(this._asyncModules,i.data),e&&0==this._asyncModules.length&&this._fireReady()},this)),this.removeEventListener("moduleinitialized",this._moduleInitializedListener),e=!0,0==this._asyncModules.length&&this._fireReady()},_fireReady:function(){this.fireEvent("ready")},dispose:function(){this.removeAllEventListeners()},registerApiFactory:function(e,i){this._apiFactories[e]=i},createApiInstance:function(e){var i={},t={};return object.forEach(this._apiFactories,function(n,o){var s=n(e);s&&(t[o]=s,i[o]=s.obj)}),{obj:i,clear:function(){object.forEach(t,function(e){e.clear()})}}},addAsyncModule:function(e){this._asyncModules.push(e)}}),module.exports=new Core;
});