!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.Storefront=t()}}(function(){return function t(e,n,r){function i(s,a){if(!n[s]){if(!e[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var f=new Error("Cannot find module '"+s+"'");throw f.code="MODULE_NOT_FOUND",f}var c=n[s]={exports:{}};e[s][0].call(c.exports,function(t){var n=e[s][1][t];return i(n?n:t)},c,c.exports,t,e,n,r)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s2?n-2:0),i=2;n>i;i++)r[i-2]=arguments[i];var o=t[e];r.forEach(function(e){t[e]=o})}n.__esModule=!0,n["default"]=r,e.exports=n["default"]},{}],3:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;e>r;r++)n[r-1]=arguments[r];return n.forEach(function(e){var n=t[e];n&&s["default"].isFunction(n)&&(t[e]=n.bind(t))}),t}n.__esModule=!0,n["default"]=i;var o=t(20),s=r(o);e.exports=n["default"]},{20:20}],4:[function(t,e,n){"use strict";function r(t){return String(t).replace(/(?:^|[-_])(\w)/g,function(t,e){return e?e.toUpperCase():""})}n.__esModule=!0,n["default"]=r,e.exports=n["default"]},{}],5:[function(t,e){(function(t){"use strict";e.exports=function(e){for(var n,r,i={},o=function(){},s=["memory"],a=["assert","clear","count","debug","dir","dirxml","error","exception","group","groupCollapsed","groupEnd","info","log","markTimeline","profile","profiles","profileEnd","show","table","time","timeEnd","timeline","timelineEnd","timeStamp","trace","warn"];n=s.pop();)n in e||(e[n]=e[n]||i);for(;r=a.pop();)n in e||(e[r]=e[r]||o);return t.console||(t.console=e),e}(t.console||{})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],6:[function(t,e,n){(function(r){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function o(t,e,n){var i=(void 0===arguments[3]?{}:arguments[3],""+t+":"+e),o={name:i,"public":{},emit:function(){for(var t=arguments.length,e=Array(t),r=0;t>r;r++)e[r]=arguments[r];return e.unshift(i),n.emit.apply(n,e),o},emitNextTick:function(){for(var t=arguments.length,e=Array(t),s=0;t>s;s++)e[s]=arguments[s];return e.unshift(i),r.nextTick(function(){n.emit.apply(n,e)}),o},emitNow:function(){for(var t=arguments.length,e=Array(t),r=0;t>r;r++)e[r]=arguments[r];return e.unshift(i),n.emit.apply(n,e),o},emitFlat:function(){for(var t=arguments.length,e=Array(t),r=0;t>r;r++)e[r]=arguments[r];var e=f["default"]([i].concat(e));return n.emit.apply(n,e),o}};return o["public"]["on"+a["default"](e)]=function(t){return n.on(i,t),function(){n.removeListener(i,t)}},o["public"]["off"+a["default"](e)]=function(t){return n.removeListener(i,t),o},o}n.__esModule=!0,n["default"]=o;var s=t(4),a=i(s),u=t(11),f=i(u);e.exports=n["default"]}).call(this,t(19))},{11:11,19:19,4:4}],7:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}n.__esModule=!0;var o=t(5),s=r(o),a=t(14),u=r(a),f=t(17),c=r(f),l=10,h=null,d=!1,p=function(){function t(){i(this,t),this.active=!1,this._handlers={},this._processed={},this._tokenList=[],this._queue=[]}return t.prototype.register=function(t,e){e&&this._handlers.hasOwnProperty(e)&&(e=c["default"]());var n=e||c["default"]();return this._handlers[n]=t,this._tokenList=Object.keys(this._handlers),n},t.prototype.deregister=function(t){var e=this._handlers[t];return e&&delete this._handlers[t],e},t.prototype.waitFor=function(t){var e=this;return this.active?this:this(t||[]).forEach(function(t){e._callHandler(t.token||t)})},t.prototype.dispatch=function(t,e){if(this.active)return this._queue.push([t,e]),this;var n=this._tokenList.length,r=0,i=void 0,o=void 0,a=void 0;if(d&&(a=t.type,s["default"].time(a),s["default"].group(a)),n){for(i=u["default"](),this.active=!0,this._currentAction=t,this._processed={};n>r;)this._callHandler(this._tokenList[r]),r+=1;this._currentAction=null,this.active=!1,o=u["default"]()-i,d&&o>l&&s["default"].info("Dispatch of",t.type,"took >",l,"ms")}if(d&&(s["default"].groupEnd(a),s["default"].timeEnd(a)),e&&e(),this._queue.length){var f=this._queue.shift(),c=f[0],h=f[1];this.dispatch(c,h)}return this},t.prototype._callHandler=function(t){if(this._processed[t]!==!0&&this.active){var e=this._handlers[t];e.call(this,this._currentAction,this,t),this._processed[t]=!0}},t.getInstance=function(){return null===h&&(h=new this),h},t.enableLogging=function(t){d=t},t}();n["default"]=p,e.exports=n["default"]},{14:14,17:17,5:5}],8:[function(t,e,n){"use strict";function r(t,e,n,r,i,o,s,a){if(!t){var u,f,c;throw void 0===e?u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings."):(f=[n,r,i,o,s,a],c=0,u=new Error("Violation: "+e.replace(/%s/g,function(){return f[c++]}))),u.framesToPop=1,u}}n.__esModule=!0,n["default"]=r,e.exports=n["default"]},{}],9:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){var e=a["default"](t);return{onStoreEvent:function(t,n,r){this._storefrontSubscriptions||(this._storefrontSubscriptions=e()),this._storefrontSubscriptions.on(t,n,r)},componentWillUnmount:function(){this._storefrontSubscriptions&&(this._storefrontSubscriptions.release(),this._storefrontSubscriptions=null)}}}n.__esModule=!0,n["default"]=i;var o=t(4),s=(r(o),t(16)),a=r(s);e.exports=n["default"]},{16:16,4:4}],10:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){var n={};a["default"].isFunction(t)&&(t=o(t));for(var r in t){var i=t[r];e===!0?n[r]=i:a["default"].isFunction(i)&&(n[r]=i)}return n}function o(t){if(!("getOwnPropertyNames"in Object))return t.prototype;var e=(new t,{});return Object.getOwnPropertyNames(t.prototype).forEach(function(n){"constructor"!==n&&(e[n]=t.prototype[n])}),e}n.__esModule=!0,n["default"]=i;var s=t(20),a=r(s);e.exports=n["default"]},{20:20}],11:[function(t,e,n){"use strict";function r(t){var e=[];return e.concat.apply(e,t)}n.__esModule=!0,n["default"]=r,e.exports=n["default"]},{}],12:[function(t,e,n){(function(r){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}n.__esModule=!0;var s=t(20),a=i(s),u=t(2),f=i(u),c=t(3),l=i(c),h=t(4),d=i(h),p=t(10),g=i(p),v=t(13),_=(i(v),function(){function t(e,n,r){var i=this;o(this,t),this.runtime=e,this.name=n,this._instance=r,this._handlers={},this._notifyEvent=e.createEvent(n,"notify"),this._changeEvent=e.createEvent(n,"change"),this.expose(this._notifyEvent["public"]),this.expose(this._changeEvent["public"]),this.expose({listen:this._changeEvent["public"].onChange,unlisten:this._changeEvent["public"].offChange}),l["default"](this,"dispatch","notify","actions","waitFor","hasChanged","before","expose","get","before","createEvent","invoke"),f["default"](this,"actions","action","observe","observes"),f["default"](this,"get","getStore","getClerk"),f["default"](this,"expose","exposes","outlet","outlets"),f["default"](this,"createEvent","defineEvent"),f["default"](this,"hasChanged","dataDidChange","dataHasChanged"),null==r.token&&(r.token=e.dispatcher.register(function(t){var e=i._handlers[t.type];e&&e(t)}))}return t.prototype.dispatch=function(t,e,n){var i=this,o=function(){i.runtime.dispatcher.dispatch({origin:i.name,type:t,payload:e},n)};return this.runtime.settings.aysncDispatch?r.nextTick(o):o(),this},t.prototype.invoke=function(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;e>r;r++)n[r-1]=arguments[r];var i=this._instance[t];if(a["default"].isFunction(i))return i.apply(this._instance,n);if(!t.indexOf("."))throw new Error("Method "+t+" not found!");var o=t.split("."),s=o[0],u=o[1],f=this.runtime.get(s);if(!f)throw new Error("Store "+s+" not found for invocation: '"+t+"'!");f.invoke.apply(f,[u].concat(n))},t.prototype.notify=function(t){return this._notifyEvent.emitNow(t),this},t.prototype.before=function(t){var e=this;return t=g["default"](t),Object.keys(t).forEach(function(n){var r=""+e.name+"_"+n,i=t[n],o=e.dispatch.bind(e,r);i.displayName=r,e._instance[n]=i.bind(e._instance,o)}),this},t.prototype.actions=function(t,e){var n=this;if(1===arguments.length?(e=t,t=this.name):a["default"].isObject(t)&&(t=t.name),a["default"].isNotString(t))throw new Error("Unknown store type: "+a["default"](t));return e=g["default"](e),Object.keys(e).forEach(function(r){var i=""+t+"_"+r,o=e[r];if(n._handlers[i]=o.bind(n._instance),t==n.name&&!n._instance[r]){var s={};s[r]=function(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;e>r;r++)n[r-1]=arguments[r];t(1===n.length?n[0]:n)},s[r]._isStub=!0,n.before(s)}}),this},t.prototype.waitFor=function(){for(var t=this,e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];return n=n.map(function(e){return a["default"].isString(e)?t.runtime.get(e):e}),this.runtime.dispatcher.waitFor(n),this},t.prototype.hasChanged=function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];return this._changeEvent.emit(e),this},t.prototype.expose=function(t){var e=this,n=void 0===arguments[1]?!1:arguments[1];return t=g["default"](t,n),Object.keys(t).forEach(function(n){if(e._instance.hasOwnProperty(n)){var r=new Error("Redefinition of '"+n+"' in store '"+storeName+"' not allowed.");throw r.framesToPop=3,r}e._instance[n]=t[n]}),this},t.prototype.get=function(t){return t?this.runtime.get(t,!0):this._instance},t.prototype.createEvent=function(t){var e=void 0===arguments[1]?{}:arguments[1],n=this.runtime.createEvent(name,t,e),r=e.async?n.emitNextTick.bind(n):n.emit.bind(n);return this.expose(n["public"]),this._instance["emit"+d["default"](t)]=r,r},t.prototype.resetInternals=function(){var t=this;this._handlers={},this._instance.token&&this.runtime.dispatcher.deregister(this._instance.token),Object.keys(this._instance).forEach(function(e){"name"!==e&&delete t._instance[e]})},t}());n["default"]=_,e.exports=n["default"]}).call(this,t(19))},{10:10,13:13,19:19,2:2,20:20,3:3,4:4}],13:[function(t,e,n){"use strict";function r(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;e>r;r++)n[r-1]=arguments[r];return n.forEach(function(e){Object.keys(e).forEach(function(n){t[n]=e[n]})}),t}n.__esModule=!0,n["default"]=r,e.exports=n["default"]},{}],14:[function(t,e,n){"use strict";n.__esModule=!0;var r=function(){return"object"==typeof performance&&performance.now?performance.now.bind(performance):Date.now?Date.now.bind(Date):function(){return(new Date).getTime()}}();n["default"]=r,e.exports=n["default"]},{}],15:[function(t,e,n){(function(r,i){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}n.__esModule=!0;var a=t(7),u=o(a),f=t(21),c=o(f),l=t(12),h=o(l),d=t(2),p=o(d),g=t(3),v=o(g),_=t(4),m=o(_),y=t(5),w=o(y),b=t(6),E=o(b),x=t(8),k=o(x),C=t(9),M=o(C),O=t(11),L=o(O),A=t(20),j=o(A),S=t(13),F=o(S),N=t(14),T=o(N),D=t(16),I=o(D),q=t(17),P=o(q),H=t(18),U=o(H),z={asyncDispatch:!0,freezeInstance:!1,useRAF:!0,verbose:!1,logging:!1,singletonDispatcher:!1},R=function(){function t(e){s(this,t),this._emitter=new c["default"],this._registry={},this._managers={},this._builders=[],this._events={},this._anyChangeEvent=this.createEvent("*","any-change"),this._dataChanges=[],this._timer=!1,this.version=U["default"],this.configure(e),this.dispatcher=this.settings.singletonDispatcher?u["default"].getInstance():new u["default"],this.util={alias:p["default"],bindAll:v["default"],camelize:m["default"],ensure:k["default"],eventHelperMixin:M["default"](this),flatten:L["default"],kind:j["default"],merge:F["default"],now:T["default"],subscriptions:I["default"](this),uid:P["default"]},this.mixins={eventHelper:M["default"](this),subscriptions:I["default"](this)},p["default"](this,"get","getInstance")}return t.prototype.configure=function(){var t=void 0===arguments[0]?{}:arguments[0];return this.settings=F["default"]({},z,t),u["default"].enableLogging(this.settings.logging),this},t.prototype.newInstance=function(e){return new t(e||this.settings)},t.prototype.createEvent=function(t,e,n){var r=E["default"](t,e,this._emitter,n);return this._events[r.name]||(this._events[r.name]=r),this._events[r.name]},t.prototype.knownEvents=function(){return Object.keys(this._events)},t.prototype.define=function(t,e){return j["default"].isUndefined(e)&&(e=t,t=P["default"]()),this._buildFactory(t,e)},t.prototype.get=function(t,e){var n=this._registry[t];return n||(this._warn("Storefront: Store",t,"is not defined."),e===!0&&(this._info("Storefront: Building stub for",t),n={name:t},this._registry[t]=n)),n},t.prototype.getManager=function(t){return this._managers[t]},t.prototype.hasStore=function(t){return this._registry.hasOwnProperty(t)},t.prototype.onChange=function(t){var e=this;return this._anyChangeEvent["public"].onAnyChange(t),function(){e._anyChangeEvent.publish.offAnyChange(t)}},t.prototype.offChange=function(t){return this._anyChangeEvent["public"].offAnyChange(t),this},t.prototype.size=function(){return this.storeNames().length},t.prototype.storeNames=function(){return Object.keys(this._registry)},t.prototype.allStores=function(){var t=this,e={};return Object.keys(this._registry).forEach(function(n){e[n]=t._registry[n]}),e},t.prototype.recreateStore=function(t){var e=this,n=this.getManager(t);return n&&n.resetInternals(),this._builders.filter(function(e){return e.name===t}).forEach(function(t){e._buildFactory(t.name,t.builder,!1)}),this.get(t)},t.prototype._buildFactory=function(t,e,n){var r=this._registry[t],i=this._managers[t],o=void 0;if(r?this._warn("Storefront:",t,"already defined: Merging definitions."):(r={name:t},this._registry[t]=r),i||(i=new h["default"](this,t,r),this._managers[t]=i,this._trackChangeFor(t)),j["default"].isFunction(e))o=e(i);else{if(!j["default"].isObject(e))throw new Error("Wrong builder type: Must provide a builder function or object.");o=e}return j["default"].isObject(o)&&i.expose(o,!0),this.settings.freezeInstance===!0&&Object.freeze(r),n!==!1&&this._builders.push({name:t,builder:e,manager:i}),this.get(t)},t.prototype._trackChangeFor=function(t){var e=this,n=""+t+":change";this._emitter.on(n,function(){for(var t=arguments.length,o=Array(t),s=0;t>s;s++)o[s]=arguments[s];e._dataChanges.push({type:n,params:o}),e._timer||(e.settings.useRAF&&i.requestAnimationFrame?requestAnimationFrame(e._relayDataChanges.bind(e)):r.nextTick(e._relayDataChanges.bind(e)),e._timer=!0)})},t.prototype._stopTrackingChangesFor=function(t){var e=""+t+":change";this._emitter.removeListener(e)},t.prototype._relayDataChanges=function(){this._dataChanges.length&&(this._anyChangeEvent.emitNow(this._dataChanges),this._dataChanges=[]),this._timer=!1},t.prototype._warn=function(){this.settings.verbose&&w["default"].warn.apply(w["default"],arguments)},t.prototype._info=function(){this.settings.verbose&&w["default"].info.apply(w["default"],arguments)},t}();n["default"]=R,e.exports=n["default"]}).call(this,t(19),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{11:11,12:12,13:13,14:14,16:16,17:17,18:18,19:19,2:2,20:20,21:21,3:3,4:4,5:5,6:6,7:7,8:8,9:9}],16:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t){return function(){return new c(t)}}n.__esModule=!0,n["default"]=o;var s=t(2),a=r(s),u=t(4),f=r(u),c=function(){function t(e){i(this,t),this._runtime=e,this._storeListeners=[],a["default"](this,"on","onStoreEvent","onEvent"),a["default"](this,"release","off","releaseAll")}return t.prototype.size=function(){return this._storeListeners.length},t.prototype.on=function(t,e,n){t=t.name||t;var r=this._runtime.getInstance(t),i=null;if(r)if(e=f["default"](e),i=r["on"+e]){var o=i(n);this._storeListeners.push(o)}else this._runtime.settings.verbose&&console.warn("Storefront: Event",e,"isn't supported by store:",t);else this._runtime.settings.verbose&&console.warn("Storefront: Store",t,"not found");return this},t.prototype.release=function(){return this._storeListeners.forEach(function(t){return t()}),this._storeListeners=[],this},t}();e.exports=n["default"]},{2:2,4:4}],17:[function(t,e,n){"use strict";function r(){for(var t=void 0===arguments[0]?36:arguments[0],e=Math.floor((new Date).getTime()/1e3);i>=e;)e+=1;return i=e,e.toString(t)}n.__esModule=!0,n["default"]=r;var i=0;e.exports=n["default"]},{}],18:[function(t,e){"use strict";e.exports="0.8.1"},{}],19:[function(t,e){function n(){}var r=e.exports={};r.nextTick=function(){var t="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.MutationObserver,n="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(t)return function(t){return window.setImmediate(t)};var r=[];if(e){var i=document.createElement("div"),o=new MutationObserver(function(){var t=r.slice();r.length=0,t.forEach(function(t){t()})});return o.observe(i,{attributes:!0}),function(t){r.length||i.setAttribute("yes","no"),r.push(t)}}return n?(window.addEventListener("message",function(t){var e=t.source;if((e===window||null===e)&&"process-tick"===t.data&&(t.stopPropagation(),r.length>0)){var n=r.shift();n()}},!0),function(t){r.push(t),window.postMessage("process-tick","*")}):function(t){setTimeout(t,0)}}(),r.title="browser",r.browser=!0,r.env={},r.argv=[],r.on=n,r.addListener=n,r.once=n,r.off=n,r.removeListener=n,r.removeAllListeners=n,r.emit=n,r.binding=function(){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(){throw new Error("process.chdir is not supported")}},{}],20:[function(t,e){(function(){var t,n,r,i,o,s,a,u,f;for(f="Boolean Number String Function Array Date RegExp Undefined Null NodeList".split(" "),r=/element$/,s=Object.keys||function(t){var e,n,r;r=[];for(e in t)n=t[e],r.push(e);return r},n=function(){var t,e,n,r,i,o;for(r=Object.prototype.toString,e=/\[object HTML(.*)\]/,t={},i=0,o=f.length;o>i;i++)n=f[i],t["[object "+n+"]"]=n.toLowerCase();return function(n){var i,o;return o=r.call(n),(i=t[o])?i:(i=o.match(e))?i[1].toLowerCase():"object"}}(),u=f.concat(["Object"]),i=function(t){var e;return e=t.toLowerCase(),n["is"+t]=function(t){return n(t)===e},n["isNot"+t]=function(t){return n(t)!==e}},o=0,a=u.length;a>o;o++)t=u[o],i(t);n.isEmpty=function(t){switch(n(t)){case"null":return!0;case"undefined":return!0;case"string":return""===t;case"object":return 0===s(t).length;case"array":return 0===t.length;case"number":return isNaN(t);case"nodelist":return 0===t.length;default:return!1}},n.isNotEmpty=function(t){return!n.isEmpty(t)},n.isElement=function(t){return r.test(n(t))},n.isNotElement=function(t){return!n.isElement(t)},"undefined"!=typeof e&&null!==e?e.exports=n:this.type=n}).call(this)},{}],21:[function(t,e){"use strict";function n(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function r(){}var i="function"!=typeof Object.create?"~":!1;r.prototype._events=void 0,r.prototype.listeners=function(t,e){var n=i?i+t:t,r=this._events&&this._events[n];if(e)return!!r;if(!r)return[];if(this._events[n].fn)return[this._events[n].fn];for(var o=0,s=this._events[n].length,a=new Array(s);s>o;o++)a[o]=this._events[n][o].fn;return a},r.prototype.emit=function(t,e,n,r,o,s){var a=i?i+t:t;if(!this._events||!this._events[a])return!1;var u,f,c=this._events[a],l=arguments.length;if("function"==typeof c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,n),!0;case 4:return c.fn.call(c.context,e,n,r),!0;case 5:return c.fn.call(c.context,e,n,r,o),!0;case 6:return c.fn.call(c.context,e,n,r,o,s),!0}for(f=1,u=new Array(l-1);l>f;f++)u[f-1]=arguments[f];c.fn.apply(c.context,u)}else{var h,d=c.length;for(f=0;d>f;f++)switch(c[f].once&&this.removeListener(t,c[f].fn,void 0,!0),l){case 1:c[f].fn.call(c[f].context);break;case 2:c[f].fn.call(c[f].context,e);break;case 3:c[f].fn.call(c[f].context,e,n);break;default:if(!u)for(h=1,u=new Array(l-1);l>h;h++)u[h-1]=arguments[h];c[f].fn.apply(c[f].context,u)}}return!0},r.prototype.on=function(t,e,r){var o=new n(e,r||this),s=i?i+t:t;return this._events||(this._events=i?{}:Object.create(null)),this._events[s]?this._events[s].fn?this._events[s]=[this._events[s],o]:this._events[s].push(o):this._events[s]=o,this},r.prototype.once=function(t,e,r){var o=new n(e,r||this,!0),s=i?i+t:t;return this._events||(this._events=i?{}:Object.create(null)),this._events[s]?this._events[s].fn?this._events[s]=[this._events[s],o]:this._events[s].push(o):this._events[s]=o,this},r.prototype.removeListener=function(t,e,n,r){var o=i?i+t:t;if(!this._events||!this._events[o])return this;var s=this._events[o],a=[];if(e)if(s.fn)(s.fn!==e||r&&!s.once||n&&s.context!==n)&&a.push(s);else for(var u=0,f=s.length;f>u;u++)(s[u].fn!==e||r&&!s[u].once||n&&s[u].context!==n)&&a.push(s[u]);return a.length?this._events[o]=1===a.length?a[0]:a:delete this._events[o],this},r.prototype.removeAllListeners=function(t){return this._events?(t?delete this._events[i?i+t:t]:this._events=i?{}:Object.create(null),this):this},r.prototype.off=r.prototype.removeListener,r.prototype.addListener=r.prototype.on,r.prototype.setMaxListeners=function(){return this},r.prefixed=i,e.exports=r},{}]},{},[1])(1)});