(function(){var e=function(e){var t=this,n=function(){var t=e.event,n=t.trigger,r=function(e){return(typeof HTMLElement=="object"?e instanceof HTMLElement:typeof e=="object"&&e.nodeType===1&&typeof e.nodeName=="string")||e===window||e===document};e.event.trigger=function(t,n,r,i){var s=t.type||t,o=[],u;s.indexOf("!")>=0&&(s=s.slice(0,-1),u=!0),s.indexOf(".")>=0&&(o=s.split("."),s=o.shift(),o.sort());if((!r||e.event.customEvent[s])&&!e.event.global[s])return;t=typeof t=="object"?t[e.expando]?t:new e.Event(s,t):new e.Event(s),t.type=s,t.exclusive=u,t.namespace=o.join("."),t.namespace_re=RegExp("(^|\\.)"+o.join("\\.(?:.*\\.)?")+"(\\.|$)");if(i||!r)t.preventDefault(),t.stopPropagation();if(!r){e.each(e.cache,function(){var r=e.expando,i=this[r];i&&i.events&&i.events[s]&&e.event.trigger(t,n,i.handle.elem)});return}if(r.nodeType===3||r.nodeType===8)return;t.result=undefined,t.target=r,n=n?e.makeArray(n):[],n.unshift(t);var a=r,f=s.indexOf(":")<0?"on"+s:"";do{var l=e._data(a,"handle");t.currentTarget=a,l&&l.apply(a,n),f&&e.acceptData(a)&&a[f]&&a[f].apply(a,n)===!1&&(t.result=!1,t.preventDefault()),a=a.parentNode||a.ownerDocument||a===t.target.ownerDocument&&window}while(a&&!t.isPropagationStopped());if(!t.isDefaultPrevented()){var c,h=e.event.special[s]||{};if((!h._default||h._default.call(r.ownerDocument,t)===!1)&&(s!=="click"||!e.nodeName(r,"a"))&&e.acceptData(r)){try{f&&r[s]&&(c=r[f],c&&(r[f]=null),e.event.triggered=s,r[s]())}catch(p){}c&&(r[f]=c),e.event.triggered=undefined}}return t.result},e.event.handle=function(n){n=e.event.fix(n||window.event);var i=((e._data(this,"events")||{})[n.type]||[]).slice(0),s=!n.exclusive&&!n.namespace,o=Array.prototype.slice.call(arguments,0);o[0]=n,n.currentTarget=this;var u=n.type,a=n.type!=="default"&&t.special["default"]&&!n.originalEvent&&r(n.target);a&&t.special["default"].triggerDefault(n,this,o[1]),n.type=u;for(var f=0,l=i.length;f<l;f++){var c=i[f];if(n.firstPass){n.firstPass=!1;continue}if(s||n.namespace_re.test(c.namespace)){n.handler=c.handler,n.data=c.data,n.handleObj=c;var h=c.handler.apply(this,o);h!==undefined&&(n.result=h,h===!1&&(n.preventDefault(),n.stopPropagation()));if(n.isImmediatePropagationStopped())break}}return a&&t.special["default"].checkAndRunDefaults(n,this),n.result}};n(),t.resolveWith(n)};dispatch("mvc/event.handle").containing(e).to("Foundry/2.1 Modules")})();