define(["cilantro/define/events","cilantro/rest/resource","cilantro/define/conceptmanager","cilantro/define/criteriamanager"],function(a,b,c,d){var e={criteria:$("#criteria"),pluginPanel:$("#plugin-panel")};return e.criteria.current=null,e.criteria.bind(a.ACTIVATE_CRITERION+" ShowConceptEvent",function(b,f){if(e.criteria.current===f)return!1;e.criteria.current=f,CriterionCollection.ready(function(){var b=this.store[f];b.addClass("active"),b.siblings().removeClass("active");var g=b.data();e.criteria.trigger(a.SYNC_CATEGORY,[g.category.id,f]);var h=d.retrieveCriteriaDS(f);c.isConceptLoaded(f)?c.show({id:f},h):$.ajax({url:b.data("uri"),dataType:"json",beforeSend:function(){e.pluginPanel.block()},complete:function(){e.pluginPanel.unblock()},success:function(a){c.show(a,h)}})})}),e.criteria.delegate("div","click",function(b){clearTimeout(timeout),$(this).trigger(a.ACTIVATE_CRITERION,[$(this).data("id")]),$(this).trigger(a.DEACTIVATE_DESCRIPTION)}),CriterionCollection})