var __slice=[].slice;define(["underscore"],function(e){var t,n;return t={},n={subscribe:function(e,r,i){var s,o;return(o=t[e])==null&&(t[e]=[]),i?s=function(){return n.unsubscribe(e,s,!0),r.apply(null,arguments)}:s=r,t[e].push(s)},publish:function(){var n,r,i,s,o,u;r=arguments[0],n=2<=arguments.length?__slice.call(arguments,1):[];if(!(s=t[r]))return;for(o=0,u=s.length;o<u;o++)i=s[o],i&&i.apply(null,n);setTimeout(function(){return t[r]=e.compact(s)})},unsubscribe:function(e,n,r){var i,s;if(!(i=t[e]))return;if((s=i.indexOf(n))>=0)return r?i[s]=null:i.splice(s,1)}},n})