dispatch.to("Foundry/2.1 Core Plugins").at(function($){$.module=function(){var self=function(name,factory){var module;if("string"==typeof name){if(module=self.get(name),void 0===factory)return module;if($.isFunction(factory))return module.factory=factory,module.status="loading",factory.call(module,$),module}var _this=this;if($.isArray(name)){var tasks=$.map(name,function(task){if($.isFunction(task))return task;if($.isPlainObject(task)){var module=self.get(task.name);return void 0===module?null:("pending"===module.status&&(module.status="loading"),task.module=module,task)
}});$.each(tasks,function(i,task){return $.isFunction(task)?(task(),void 0):($.isPlainObject(task)&&self.apply(_this,[task.name,task.factory]),void 0)})}};return $.extend(self,{registry:{},get:function(name){return void 0!==name?self.registry[name]||self.create(name):void 0},create:function(name){var module=$.Deferred();return $.extend(module,{name:name,type:"module",status:"pending"}),module.done(function(){module.exports=this,module.status="ready"}),self.registry[name]=module},remove:function(name){delete self.registry[name]
}}),self}(),dispatch.to("Foundry/2.1 Modules").at(function(exports,manifest){$.module(manifest.name,exports)})});