(function(e,f){var i=[].slice,g=/\s+/,a=function(){return false},d=function(){return true};function k(l,n,m){(l||"").split(g).forEach(function(o){m(o,n)})}function h(l){return new RegExp("(?:^| )"+l.replace(" "," .* ?")+"(?: |$)")}function c(l){var m=(""+l).split(".");return{e:m[0],ns:m.slice(1).sort().join(" ")}}function b(l,m,q,n){var p,o;o=c(m);o.ns&&(p=h(o.ns));return l.filter(function(r){return r&&(!o.e||r.e===o.e)&&(!o.ns||p.test(r.ns))&&(!q||r.cb===q||r.cb._cb===q)&&(!n||r.ctx===n)})}function j(m,l){if(!(this instanceof j)){return new j(m,l)}l&&f.extend(this,l);this.type=m;return this}j.prototype={isDefaultPrevented:a,isPropagationStopped:a,preventDefault:function(){this.isDefaultPrevented=d},stopPropagation:function(){this.isPropagationStopped=d}};e.event={on:function(l,p,m){var n=this,o;if(!p){return this}o=this._events||(this._events=[]);k(l,p,function(q,s){var r=c(q);r.cb=s;r.ctx=m;r.ctx2=m||n;r.id=o.length;o.push(r)});return this},one:function(l,o,m){var n=this;if(!o){return this}k(l,o,function(p,r){var q=function(){n.off(p,q);return r.apply(m||n,arguments)};q._cb=r;n.on(p,q,m)});return this},off:function(l,o,n){var m=this._events;if(!m){return this}if(!l&&!o&&!n){this._events=[];return this}k(l,o,function(p,q){b(m,p,q,n).forEach(function(r){delete m[r.id]})});return this},trigger:function(m){var q=-1,o,p,n,l,r;if(!this._events||!m){return this}typeof m==="string"&&(m=new j(m));o=i.call(arguments,1);m.args=o;o.unshift(m);p=b(this._events,m.type);if(p){l=p.length;while(++q<l){if((n=m.isPropagationStopped())||false===(r=p[q]).cb.apply(r.ctx2,o)){n||(m.stopPropagation(),m.preventDefault());break}}}return this}};e.Event=j})(gmu,gmu.$);