faye 1.1.3 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of faye might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 1d21600eba1d7a476e10fb4e93317b605f40732b14db06d3d15406378cca1c42
4
- data.tar.gz: 5974b38601740876b2eb6ef3f9f91be64a70487e032f9fc1f653d467419c42b0
2
+ SHA1:
3
+ metadata.gz: 3634db7d5df645db6594e0dcc9495fbea06eb796
4
+ data.tar.gz: d1c7e53ddc0a7429b0570bb1df7b3d41fcba35d5
5
5
  SHA512:
6
- metadata.gz: 4e945112c6d85f1813e37f1b389f3d918d2c002a64c645f8d5c352a4a6c2f920cad7e929c8557798ffb5dbd7fb996532291491264807de86257e2f3893c9e7db
7
- data.tar.gz: 0b1091bc38bb9a04243b5bb5f553eac596e56f7c14f2ce6f09cc6b3d1820bcd6db33f0a1d772b765c367089d8aba1043e2324231ec2a1f84995e324030c923c2
6
+ metadata.gz: 39e44a81f5cd009e4ee03fd7e1bc52cbaff1c36ec054b50f6f21163548bd3ca4cbef55da1e4f18c4ca43ccad1ea03213301c4852946b6f9bbf1d8cf26f277211
7
+ data.tar.gz: a053b9728e35524af2ff61d966e9aa25c0c4b629d06ab2d84354fa4b58ada44234aaf266861e819441a8b268bd5fb8fd2da93aa2cef60fb3872642f380d32214
@@ -1,7 +1,17 @@
1
- ### 1.1.3 / 2020-04-28
2
-
3
- * Fix `/meta/*` channel recognition bug in the server that enables authentication bypass
4
- * https://blog.jcoglan.com/2020/04/28/authentication-bypass-in-faye/
1
+ ### 1.2.0 / 2016-06-26
2
+
3
+ * Add `client.subscribe().withChannel()` to yield the message channel for wildcard subscriptions
4
+ * Restructure the JavaScript codebase around Node modules (require/exports) rather than globals
5
+ * Update the Promise shim to reflect the standard API, including `catch()` and `all()`
6
+ * Support connecting to servers that use SNI in the Ruby client
7
+ * Make the JavaScript client work inside React Native and Web Workers
8
+ * Remove JSON2; you should import a JSON shim yourself if necessary
9
+ * Handle errors that occur when a message is partially delivered via EventSource
10
+ * Reject requests with invalid (non-array or -object) top-level JSON values
11
+ * Make local client requests asynchronous to avoid re-entrant request handling errors
12
+ * Remove `Connection: Close` from HTTP responses to allow use of keep-alive
13
+ * Use `XMLHttpRequest` in preference to the ActiveX API in IE10
14
+ * Fix bug where flushing large message batches puts promises in an invalid state
5
15
 
6
16
 
7
17
  ### 1.1.2 / 2015-07-19
data/README.md CHANGED
@@ -14,7 +14,7 @@ applications, and clients that can be used on the server and in the browser.
14
14
 
15
15
  (The MIT License)
16
16
 
17
- Copyright (c) 2009-2020 James Coglan and contributors
17
+ Copyright (c) 2009-2016 James Coglan and contributors
18
18
 
19
19
  Permission is hereby granted, free of charge, to any person obtaining a copy of
20
20
  this software and associated documentation files (the 'Software'), to deal in
@@ -0,0 +1,3 @@
1
+ var Faye=function(t){function e(i){if(n[i])return n[i].exports;var s=n[i]={exports:{},id:i,loaded:!1};return t[i].call(s.exports,s,s.exports,e),s.loaded=!0,s.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";var i=n(1),s=n(2),r={VERSION:i.VERSION,Client:n(4),Scheduler:n(32)};s.wrapper=r,t.exports=r},function(t){t.exports={VERSION:"1.2.0",BAYEUX_VERSION:"1.0",ID_LENGTH:160,JSONP_CALLBACK:"jsonpcallback",CONNECTION_TYPES:["long-polling","cross-origin-long-polling","callback-polling","websocket","eventsource","in-process"],MANDATORY_CONNECTION_TYPES:["long-polling","callback-polling","in-process"]}},function(t,e,n){"use strict";var i=n(3),s={LOG_LEVELS:{fatal:4,error:3,warn:2,info:1,debug:0},writeLog:function(t,e){var n=s.logger||(s.wrapper||s).logger;if(n){var r=Array.prototype.slice.apply(t),o="[Faye",c=this.className,a=r.shift().replace(/\?/g,function(){try{return i(r.shift())}catch(t){return"[Object]"}});c&&(o+="."+c),o+="] ","function"==typeof n[e]?n[e](o+a):"function"==typeof n&&n(o+a)}}};for(var r in s.LOG_LEVELS)(function(t){s[t]=function(){this.writeLog(arguments,t)}})(r);t.exports=s},function(t){"use strict";t.exports=function(t){return JSON.stringify(t,function(t,e){return this[t]instanceof Array?this[t]:e})}},function(t,e,n){(function(e){"use strict";var i=n(5),s=n(7),r=(n(9),n(10)),o=n(11),c=n(12),a=n(1),h=n(8),u=n(13),l=n(14),f=n(2),p=n(15),d=n(17),_=n(19),v=n(33),g=n(34),m=n(35),y=n(36),E=s({className:"Client",UNCONNECTED:1,CONNECTING:2,CONNECTED:3,DISCONNECTED:4,HANDSHAKE:"handshake",RETRY:"retry",NONE:"none",CONNECTION_TIMEOUT:60,DEFAULT_ENDPOINT:"/bayeux",INTERVAL:0,initialize:function(t,n){this.info("New client created for ?",t),n=n||{},u(n,["interval","timeout","endpoints","proxy","retry","scheduler","websocketExtensions","tls","ca"]),this._channels=new d.Set,this._dispatcher=_.create(this,t||this.DEFAULT_ENDPOINT,n),this._messageId=0,this._state=this.UNCONNECTED,this._responseCallbacks={},this._advice={reconnect:this.RETRY,interval:1e3*(n.interval||this.INTERVAL),timeout:1e3*(n.timeout||this.CONNECTION_TIMEOUT)},this._dispatcher.timeout=this._advice.timeout/1e3,this._dispatcher.bind("message",this._receiveMessage,this),c.Event&&void 0!==e.onbeforeunload&&c.Event.on(e,"beforeunload",function(){o.indexOf(this._dispatcher._disabled,"autodisconnect")<0&&this.disconnect()},this)},addWebsocketExtension:function(t){return this._dispatcher.addWebsocketExtension(t)},disable:function(t){return this._dispatcher.disable(t)},setHeader:function(t,e){return this._dispatcher.setHeader(t,e)},handshake:function(t,n){if(this._advice.reconnect!==this.NONE&&this._state===this.UNCONNECTED){this._state=this.CONNECTING;var s=this;this.info("Initiating handshake with ?",r.stringify(this._dispatcher.endpoint)),this._dispatcher.selectTransport(a.MANDATORY_CONNECTION_TYPES),this._sendMessage({channel:d.HANDSHAKE,version:a.BAYEUX_VERSION,supportedConnectionTypes:this._dispatcher.getConnectionTypes()},{},function(r){r.successful?(this._state=this.CONNECTED,this._dispatcher.clientId=r.clientId,this._dispatcher.selectTransport(r.supportedConnectionTypes),this.info("Handshake successful: ?",this._dispatcher.clientId),this.subscribe(this._channels.getKeys(),!0),t&&i(function(){t.call(n)})):(this.info("Handshake unsuccessful"),e.setTimeout(function(){s.handshake(t,n)},1e3*this._dispatcher.retry),this._state=this.UNCONNECTED)},this)}},connect:function(t,e){if(this._advice.reconnect!==this.NONE&&this._state!==this.DISCONNECTED){if(this._state===this.UNCONNECTED)return this.handshake(function(){this.connect(t,e)},this);this.callback(t,e),this._state===this.CONNECTED&&(this.info("Calling deferred actions for ?",this._dispatcher.clientId),this.setDeferredStatus("succeeded"),this.setDeferredStatus("unknown"),this._connectRequest||(this._connectRequest=!0,this.info("Initiating connection for ?",this._dispatcher.clientId),this._sendMessage({channel:d.CONNECT,clientId:this._dispatcher.clientId,connectionType:this._dispatcher.connectionType},{},this._cycleConnection,this)))}},disconnect:function(){if(this._state===this.CONNECTED){this._state=this.DISCONNECTED,this.info("Disconnecting ?",this._dispatcher.clientId);var t=new m;return this._sendMessage({channel:d.DISCONNECT,clientId:this._dispatcher.clientId},{},function(e){e.successful?(this._dispatcher.close(),t.setDeferredStatus("succeeded")):t.setDeferredStatus("failed",v.parse(e.error))},this),this.info("Clearing channel listeners for ?",this._dispatcher.clientId),this._channels=new d.Set,t}},subscribe:function(t,e,n){if(t instanceof Array)return o.map(t,function(t){return this.subscribe(t,e,n)},this);var i=new y(this,t,e,n),s=e===!0,r=this._channels.hasSubscription(t);return r&&!s?(this._channels.subscribe([t],i),i.setDeferredStatus("succeeded"),i):(this.connect(function(){this.info("Client ? attempting to subscribe to ?",this._dispatcher.clientId,t),s||this._channels.subscribe([t],i),this._sendMessage({channel:d.SUBSCRIBE,clientId:this._dispatcher.clientId,subscription:t},{},function(e){if(!e.successful)return i.setDeferredStatus("failed",v.parse(e.error)),this._channels.unsubscribe(t,i);var n=[].concat(e.subscription);this.info("Subscription acknowledged for ? to ?",this._dispatcher.clientId,n),i.setDeferredStatus("succeeded")},this)},this),i)},unsubscribe:function(t,e){if(t instanceof Array)return o.map(t,function(t){return this.unsubscribe(t,e)},this);var n=this._channels.unsubscribe(t,e);n&&this.connect(function(){this.info("Client ? attempting to unsubscribe from ?",this._dispatcher.clientId,t),this._sendMessage({channel:d.UNSUBSCRIBE,clientId:this._dispatcher.clientId,subscription:t},{},function(t){if(t.successful){var e=[].concat(t.subscription);this.info("Unsubscription acknowledged for ? from ?",this._dispatcher.clientId,e)}},this)},this)},publish:function(t,e,n){u(n||{},["attempts","deadline"]);var i=new m;return this.connect(function(){this.info("Client ? queueing published message to ?: ?",this._dispatcher.clientId,t,e),this._sendMessage({channel:t,data:e,clientId:this._dispatcher.clientId},n,function(t){t.successful?i.setDeferredStatus("succeeded"):i.setDeferredStatus("failed",v.parse(t.error))},this)},this),i},_sendMessage:function(t,e,n,i){t.id=this._generateMessageId();var s=this._advice.timeout?1.2*this._advice.timeout/1e3:1.2*this._dispatcher.retry;this.pipeThroughExtensions("outgoing",t,null,function(t){t&&(n&&(this._responseCallbacks[t.id]=[n,i]),this._dispatcher.sendMessage(t,s,e||{}))},this)},_generateMessageId:function(){return this._messageId+=1,this._messageId>=Math.pow(2,32)&&(this._messageId=0),this._messageId.toString(36)},_receiveMessage:function(t){var e,n=t.id;void 0!==t.successful&&(e=this._responseCallbacks[n],delete this._responseCallbacks[n]),this.pipeThroughExtensions("incoming",t,null,function(t){t&&(t.advice&&this._handleAdvice(t.advice),this._deliverMessage(t),e&&e[0].call(e[1],t))},this)},_handleAdvice:function(t){h(this._advice,t),this._dispatcher.timeout=this._advice.timeout/1e3,this._advice.reconnect===this.HANDSHAKE&&this._state!==this.DISCONNECTED&&(this._state=this.UNCONNECTED,this._dispatcher.clientId=null,this._cycleConnection())},_deliverMessage:function(t){t.channel&&void 0!==t.data&&(this.info("Client ? calling listeners for ? with ?",this._dispatcher.clientId,t.channel,t.data),this._channels.distributeMessage(t))},_cycleConnection:function(){this._connectRequest&&(this._connectRequest=null,this.info("Closed connection for ?",this._dispatcher.clientId));var t=this;e.setTimeout(function(){t.connect()},this._advice.interval)}});h(E.prototype,l),h(E.prototype,p),h(E.prototype,f),h(E.prototype,g),t.exports=E}).call(e,function(){return this}())},function(t,e,n){"use strict";function i(){if(a.length)throw a.shift()}function s(t){var e;e=c.length?c.pop():new r,e.task=t,o(e)}function r(){this.task=null}var o=n(6),c=[],a=[],h=o.makeRequestCallFromTimer(i);t.exports=s,r.prototype.call=function(){try{this.task.call()}catch(t){s.onerror?s.onerror(t):(a.push(t),h())}finally{this.task=null,c[c.length]=this}}},function(t,e){(function(e){"use strict";function n(t){c.length||(o(),a=!0),c[c.length]=t}function i(){for(;h<c.length;){var t=h;if(h+=1,c[t].call(),h>u){for(var e=0,n=c.length-h;n>e;e++)c[e]=c[e+h];c.length-=h,h=0}}c.length=0,h=0,a=!1}function s(t){var e=1,n=new l(t),i=document.createTextNode("");return n.observe(i,{characterData:!0}),function(){e=-e,i.data=e}}function r(t){return function(){function e(){clearTimeout(n),clearInterval(i),t()}var n=setTimeout(e,0),i=setInterval(e,50)}}t.exports=n;var o,c=[],a=!1,h=0,u=1024,l=e.MutationObserver||e.WebKitMutationObserver;o="function"==typeof l?s(i):r(i),n.requestFlush=o,n.makeRequestCallFromTimer=r}).call(e,function(){return this}())},function(t,e,n){"use strict";var i=n(8);t.exports=function(t,e){"function"!=typeof t&&(e=t,t=Object);var n=function(){return this.initialize?this.initialize.apply(this,arguments)||this:this},s=function(){};return s.prototype=t.prototype,n.prototype=new s,i(n.prototype,e),n}},function(t){"use strict";t.exports=function(t,e,n){if(!e)return t;for(var i in e)e.hasOwnProperty(i)&&(t.hasOwnProperty(i)&&n===!1||t[i]!==e[i]&&(t[i]=e[i]));return t}},function(t,e,n){"use strict";var i=n(5),s=0,r=1,o=2,c=function(t){return t},a=function(t){throw t},h=function(t){if(this._state=s,this._onFulfilled=[],this._onRejected=[],"function"==typeof t){var e=this;t(function(t){d(e,t)},function(t){v(e,t)})}};h.prototype.then=function(t,e){var n=new h;return u(this,t,n),l(this,e,n),n},h.prototype["catch"]=function(t){return this.then(null,t)};var u=function(t,e,n){"function"!=typeof e&&(e=c);var i=function(t){f(e,t,n)};t._state===s?t._onFulfilled.push(i):t._state===r&&i(t._value)},l=function(t,e,n){"function"!=typeof e&&(e=a);var i=function(t){f(e,t,n)};t._state===s?t._onRejected.push(i):t._state===o&&i(t._reason)},f=function(t,e,n){i(function(){p(t,e,n)})},p=function(t,e,n){var i;try{i=t(e)}catch(s){return v(n,s)}i===n?v(n,new TypeError("Recursive promise chain detected")):d(n,i)},d=function(t,e){var n,i,s=!1;try{if(n=typeof e,i=null!==e&&("function"===n||"object"===n)&&e.then,"function"!=typeof i)return _(t,e);i.call(e,function(e){s^(s=!0)&&d(t,e)},function(e){s^(s=!0)&&v(t,e)})}catch(r){if(!(s^(s=!0)))return;v(t,r)}},_=function(t,e){if(t._state===s){t._state=r,t._value=e,t._onRejected=[];for(var n,i=t._onFulfilled;n=i.shift();)n(e)}},v=function(t,e){if(t._state===s){t._state=o,t._reason=e,t._onFulfilled=[];for(var n,i=t._onRejected;n=i.shift();)n(e)}};h.resolve=h.accept=h.fulfill=function(t){return new h(function(e){e(t)})},h.reject=function(t){return new h(function(e,n){n(t)})},h.all=function(t){return new h(function(e,n){var i,s=[],r=t.length;if(0===r)return e(s);for(i=0;r>i;i++)(function(t,i){h.resolve(t).then(function(t){s[i]=t,0===--r&&e(s)},n)})(t[i],i)})},h.race=function(t){return new h(function(e,n){for(var i=0,s=t.length;s>i;i++)h.resolve(t[i]).then(e,n)})},h.deferred=h.pending=function(){var t={};return t.promise=new h(function(e,n){t.fulfill=t.resolve=e,t.reject=n}),t},t.exports=h},function(t){"use strict";t.exports={isURI:function(t){return t&&t.protocol&&t.host&&t.path},isSameOrigin:function(t){return t.protocol===location.protocol&&t.hostname===location.hostname&&t.port===location.port},parse:function(t){if("string"!=typeof t)return t;var e,n,i,s,r,o,c={},a=function(e,n){t=t.replace(n,function(t){return c[e]=t,""}),c[e]=c[e]||""};for(a("protocol",/^[a-z]+\:/i),a("host",/^\/\/[^\/\?#]+/),/^\//.test(t)||c.host||(t=location.pathname.replace(/[^\/]*$/,"")+t),a("pathname",/^[^\?#]*/),a("search",/^\?[^#]*/),a("hash",/^#.*/),c.protocol=c.protocol||location.protocol,c.host?(c.host=c.host.substr(2),e=c.host.split(":"),c.hostname=e[0],c.port=e[1]||""):(c.host=location.host,c.hostname=location.hostname,c.port=location.port),c.pathname=c.pathname||"/",c.path=c.pathname+c.search,n=c.search.replace(/^\?/,""),i=n?n.split("&"):[],o={},s=0,r=i.length;r>s;s++)e=i[s].split("="),o[decodeURIComponent(e[0]||"")]=decodeURIComponent(e[1]||"");return c.query=o,c.href=this.stringify(c),c},stringify:function(t){var e=t.protocol+"//"+t.hostname;return t.port&&(e+=":"+t.port),e+=t.pathname+this.queryString(t.query)+(t.hash||"")},queryString:function(t){var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push(encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return 0===e.length?"":"?"+e.join("&")}}},function(t){"use strict";t.exports={commonElement:function(t,e){for(var n=0,i=t.length;i>n;n++)if(-1!==this.indexOf(e,t[n]))return t[n];return null},indexOf:function(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0,i=t.length;i>n;n++)if(t[n]===e)return n;return-1},map:function(t,e,n){if(t.map)return t.map(e,n);var i=[];if(t instanceof Array)for(var s=0,r=t.length;r>s;s++)i.push(e.call(n||null,t[s],s));else for(var o in t)t.hasOwnProperty(o)&&i.push(e.call(n||null,o,t[o]));return i},filter:function(t,e,n){if(t.filter)return t.filter(e,n);for(var i=[],s=0,r=t.length;r>s;s++)e.call(n||null,t[s],s)&&i.push(t[s]);return i},asyncEach:function(t,e,n,i){var s=t.length,r=-1,o=0,c=!1,a=function(){return o-=1,r+=1,r===s?n&&n.call(i):void e(t[r],u)},h=function(){if(!c){for(c=!0;o>0;)a();c=!1}},u=function(){o+=1,h()};u()}}},function(t,e){(function(e){"use strict";var n={_registry:[],on:function(t,e,n,i){var s=function(){n.call(i)};t.addEventListener?t.addEventListener(e,s,!1):t.attachEvent("on"+e,s),this._registry.push({_element:t,_type:e,_callback:n,_context:i,_handler:s})},detach:function(t,e,n,i){for(var s,r=this._registry.length;r--;)s=this._registry[r],t&&t!==s._element||e&&e!==s._type||n&&n!==s._callback||i&&i!==s._context||(s._element.removeEventListener?s._element.removeEventListener(s._type,s._handler,!1):s._element.detachEvent("on"+s._type,s._handler),this._registry.splice(r,1),s=null)}};void 0!==e.onunload&&n.on(e,"unload",n.detach,n),t.exports={Event:n}}).call(e,function(){return this}())},function(t,e,n){"use strict";var i=n(11);t.exports=function(t,e){for(var n in t)if(i.indexOf(e,n)<0)throw new Error("Unrecognized option: "+n)}},function(t,e,n){(function(e){"use strict";var i=n(9);t.exports={then:function(t,e){var n=this;return this._promise||(this._promise=new i(function(t,e){n._resolve=t,n._reject=e})),0===arguments.length?this._promise:this._promise.then(t,e)},callback:function(t,e){return this.then(function(n){t.call(e,n)})},errback:function(t,e){return this.then(null,function(n){t.call(e,n)})},timeout:function(t,n){this.then();var i=this;this._timer=e.setTimeout(function(){i._reject(n)},1e3*t)},setDeferredStatus:function(t,n){this._timer&&e.clearTimeout(this._timer),this.then(),"succeeded"===t?this._resolve(n):"failed"===t?this._reject(n):delete this._promise}}}).call(e,function(){return this}())},function(t,e,n){"use strict";var i=n(8),s=n(16),r={countListeners:function(t){return this.listeners(t).length},bind:function(t,e,n){var i=Array.prototype.slice,s=function(){e.apply(n,i.call(arguments))};return this._listeners=this._listeners||[],this._listeners.push([t,e,n,s]),this.on(t,s)},unbind:function(t,e,n){this._listeners=this._listeners||[];for(var i,s=this._listeners.length;s--;)i=this._listeners[s],i[0]===t&&(!e||i[1]===e&&i[2]===n)&&(this._listeners.splice(s,1),this.removeListener(t,i[3]))}};i(r,s.prototype),r.trigger=r.emit,t.exports=r},function(t){function e(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0;n<t.length;n++)if(e===t[n])return n;return-1}function n(){}var i="function"==typeof Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};t.exports=n,n.prototype.emit=function(t){if("error"===t&&(!this._events||!this._events.error||i(this._events.error)&&!this._events.error.length))throw arguments[1]instanceof Error?arguments[1]:new Error("Uncaught, unspecified 'error' event.");if(!this._events)return!1;var e=this._events[t];if(!e)return!1;if("function"==typeof e){switch(arguments.length){case 1:e.call(this);break;case 2:e.call(this,arguments[1]);break;case 3:e.call(this,arguments[1],arguments[2]);break;default:var n=Array.prototype.slice.call(arguments,1);e.apply(this,n)}return!0}if(i(e)){for(var n=Array.prototype.slice.call(arguments,1),s=e.slice(),r=0,o=s.length;o>r;r++)s[r].apply(this,n);return!0}return!1},n.prototype.addListener=function(t,e){if("function"!=typeof e)throw new Error("addListener only takes instances of Function");return this._events||(this._events={}),this.emit("newListener",t,e),this._events[t]?i(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){var n=this;return n.on(t,function i(){n.removeListener(t,i),e.apply(this,arguments)}),this},n.prototype.removeListener=function(t,n){if("function"!=typeof n)throw new Error("removeListener only takes instances of Function");if(!this._events||!this._events[t])return this;var s=this._events[t];if(i(s)){var r=e(s,n);if(0>r)return this;s.splice(r,1),0==s.length&&delete this._events[t]}else this._events[t]===n&&delete this._events[t];return this},n.prototype.removeAllListeners=function(t){return 0===arguments.length?(this._events={},this):(t&&this._events&&this._events[t]&&(this._events[t]=null),this)},n.prototype.listeners=function(t){return this._events||(this._events={}),this._events[t]||(this._events[t]=[]),i(this._events[t])||(this._events[t]=[this._events[t]]),this._events[t]}},function(t,e,n){"use strict";var i=n(7),s=n(8),r=n(15),o=n(18),c=i({initialize:function(t){this.id=this.name=t},push:function(t){this.trigger("message",t)},isUnused:function(){return 0===this.countListeners("message")}});s(c.prototype,r),s(c,{HANDSHAKE:"/meta/handshake",CONNECT:"/meta/connect",SUBSCRIBE:"/meta/subscribe",UNSUBSCRIBE:"/meta/unsubscribe",DISCONNECT:"/meta/disconnect",META:"meta",SERVICE:"service",expand:function(t){var e=this.parse(t),n=["/**",t],i=e.slice();i[i.length-1]="*",n.push(this.unparse(i));for(var s=1,r=e.length;r>s;s++)i=e.slice(0,s),i.push("**"),n.push(this.unparse(i));return n},isValid:function(t){return o.CHANNEL_NAME.test(t)||o.CHANNEL_PATTERN.test(t)},parse:function(t){return this.isValid(t)?t.split("/").slice(1):null},unparse:function(t){return"/"+t.join("/")},isMeta:function(t){var e=this.parse(t);return e?e[0]===this.META:null},isService:function(t){var e=this.parse(t);return e?e[0]===this.SERVICE:null},isSubscribable:function(t){return this.isValid(t)?!this.isMeta(t)&&!this.isService(t):null},Set:i({initialize:function(){this._channels={}},getKeys:function(){var t=[];for(var e in this._channels)t.push(e);return t},remove:function(t){delete this._channels[t]},hasSubscription:function(t){return this._channels.hasOwnProperty(t)},subscribe:function(t,e){for(var n,i=0,s=t.length;s>i;i++){n=t[i];var r=this._channels[n]=this._channels[n]||new c(n);r.bind("message",e)}},unsubscribe:function(t,e){var n=this._channels[t];return n?(n.unbind("message",e),n.isUnused()?(this.remove(t),!0):!1):!1},distributeMessage:function(t){for(var e=c.expand(t.channel),n=0,i=e.length;i>n;n++){var s=this._channels[e[n]];s&&s.trigger("message",t)}}})}),t.exports=c},function(t){"use strict";t.exports={CHANNEL_NAME:/^\/(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)))+(\/(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)))+)*$/,CHANNEL_PATTERN:/^(\/(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)))+)*\/\*{1,2}$/,ERROR:/^([0-9][0-9][0-9]:(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)| |\/|\*|\.))*(,(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)| |\/|\*|\.))*)*:(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)| |\/|\*|\.))*|[0-9][0-9][0-9]::(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)| |\/|\*|\.))*)$/,VERSION:/^([0-9])+(\.(([a-z]|[A-Z])|[0-9])(((([a-z]|[A-Z])|[0-9])|\-|\_))*)*$/}},function(t,e,n){(function(e){"use strict";var i=n(7),s=n(10),r=n(20),o=n(8),c=n(2),a=n(15),h=n(21),u=n(32),l=i({className:"Dispatcher",MAX_REQUEST_SIZE:2048,DEFAULT_RETRY:5,UP:1,DOWN:2,initialize:function(t,e,n){this._client=t,this.endpoint=s.parse(e),this._alternates=n.endpoints||{},this.cookies=r.CookieJar&&new r.CookieJar,this._disabled=[],this._envelopes={},this.headers={},this.retry=n.retry||this.DEFAULT_RETRY,this._scheduler=n.scheduler||u,this._state=0,this.transports={},this.wsExtensions=[],this.proxy=n.proxy||{},"string"==typeof this._proxy&&(this._proxy={origin:this._proxy});var i=n.websocketExtensions;if(i){i=[].concat(i);for(var o=0,c=i.length;c>o;o++)this.addWebsocketExtension(i[o])}this.tls=n.tls||{},this.tls.ca=this.tls.ca||n.ca;for(var a in this._alternates)this._alternates[a]=s.parse(this._alternates[a]);this.maxRequestSize=this.MAX_REQUEST_SIZE},endpointFor:function(t){return this._alternates[t]||this.endpoint},addWebsocketExtension:function(t){this.wsExtensions.push(t)},disable:function(t){this._disabled.push(t)},setHeader:function(t,e){this.headers[t]=e},close:function(){var t=this._transport;delete this._transport,t&&t.close()},getConnectionTypes:function(){return h.getConnectionTypes()},selectTransport:function(t){h.get(this,t,this._disabled,function(t){this.debug("Selected ? transport for ?",t.connectionType,s.stringify(t.endpoint)),t!==this._transport&&(this._transport&&this._transport.close(),this._transport=t,this.connectionType=t.connectionType)},this)},sendMessage:function(t,e,n){n=n||{};var i,s=t.id,r=n.attempts,o=n.deadline&&(new Date).getTime()+1e3*n.deadline,c=this._envelopes[s];c||(i=new this._scheduler(t,{timeout:e,interval:this.retry,attempts:r,deadline:o}),c=this._envelopes[s]={message:t,scheduler:i}),this._sendEnvelope(c)},_sendEnvelope:function(t){if(this._transport&&!t.request&&!t.timer){var n=t.message,i=t.scheduler,s=this;if(!i.isDeliverable())return i.abort(),void delete this._envelopes[n.id];t.timer=e.setTimeout(function(){s.handleError(n)},1e3*i.getTimeout()),i.send(),t.request=this._transport.sendMessage(n)}},handleResponse:function(t){var n=this._envelopes[t.id];void 0!==t.successful&&n&&(n.scheduler.succeed(),delete this._envelopes[t.id],e.clearTimeout(n.timer)),this.trigger("message",t),this._state!==this.UP&&(this._state=this.UP,this._client.trigger("transport:up"))},handleError:function(t,n){var i=this._envelopes[t.id],s=i&&i.request,r=this;if(s){s.then(function(t){t&&t.abort&&t.abort()});var o=i.scheduler;o.fail(),e.clearTimeout(i.timer),i.request=i.timer=null,n?this._sendEnvelope(i):i.timer=e.setTimeout(function(){i.timer=null,r._sendEnvelope(i)},1e3*o.getInterval()),this._state!==this.DOWN&&(this._state=this.DOWN,this._client.trigger("transport:down"))}}});l.create=function(t,e,n){return new l(t,e,n)},o(l.prototype,a),o(l.prototype,c),t.exports=l}).call(e,function(){return this}())},function(t){"use strict";t.exports={}},function(t,e,n){"use strict";var i=n(22);i.register("websocket",n(24)),i.register("eventsource",n(28)),i.register("long-polling",n(29)),i.register("cross-origin-long-polling",n(30)),i.register("callback-polling",n(31)),t.exports=i},function(t,e,n){"use strict";var i=n(7),s=n(20).Cookie,r=n(9),o=n(10),c=n(11),a=n(8),h=n(2),u=n(23),l=n(17),f=a(i({className:"Transport",DEFAULT_PORTS:{"http:":80,"https:":443,"ws:":80,"wss:":443},SECURE_PROTOCOLS:["https:","wss:"],MAX_DELAY:0,batching:!0,initialize:function(t,e){this._dispatcher=t,this.endpoint=e,this._outbox=[],this._proxy=a({},this._dispatcher.proxy),this._proxy.origin||"undefined"==typeof process||(this._proxy.origin=c.indexOf(this.SECURE_PROTOCOLS,this.endpoint.protocol)>=0?process.env.HTTPS_PROXY||process.env.https_proxy:process.env.HTTP_PROXY||process.env.http_proxy)},close:function(){},encode:function(){return""},sendMessage:function(t){return this.debug("Client ? sending message to ?: ?",this._dispatcher.clientId,o.stringify(this.endpoint),t),this.batching?(this._outbox.push(t),this._flushLargeBatch(),t.channel===l.HANDSHAKE?this._publish(.01):(t.channel===l.CONNECT&&(this._connectMessage=t),this._publish(this.MAX_DELAY))):r.resolve(this.request([t]))},_makePromise:function(){var t=this;this._requestPromise=this._requestPromise||new r(function(e){t._resolvePromise=e})},_publish:function(t){return this._makePromise(),this.addTimeout("publish",t,function(){this._flush(),delete this._requestPromise},this),this._requestPromise},_flush:function(){this.removeTimeout("publish"),this._outbox.length>1&&this._connectMessage&&(this._connectMessage.advice={timeout:0}),this._resolvePromise(this.request(this._outbox)),this._connectMessage=null,this._outbox=[]},_flushLargeBatch:function(){var t=this.encode(this._outbox);if(!(t.length<this._dispatcher.maxRequestSize)){var e=this._outbox.pop();this._makePromise(),this._flush(),e&&this._outbox.push(e)}},_receive:function(t){if(t){t=[].concat(t),this.debug("Client ? received from ? via ?: ?",this._dispatcher.clientId,o.stringify(this.endpoint),this.connectionType,t);for(var e=0,n=t.length;n>e;e++)this._dispatcher.handleResponse(t[e])}},_handleError:function(t){t=[].concat(t),this.debug("Client ? failed to send to ? via ?: ?",this._dispatcher.clientId,o.stringify(this.endpoint),this.connectionType,t);for(var e=0,n=t.length;n>e;e++)this._dispatcher.handleError(t[e])},_getCookies:function(){var t=this._dispatcher.cookies,e=o.stringify(this.endpoint);return t?c.map(t.getCookiesSync(e),function(t){return t.cookieString()}).join("; "):""},_storeCookies:function(t){var e,n=this._dispatcher.cookies,i=o.stringify(this.endpoint);if(t&&n){t=[].concat(t);for(var r=0,c=t.length;c>r;r++)e=s.parse(t[r]),n.setCookieSync(e,i)}}}),{get:function(t,e,n,i,s){var r=t.endpoint;c.asyncEach(this._transports,function(r,o){var a=r[0],h=r[1],u=t.endpointFor(a);return c.indexOf(n,a)>=0?o():c.indexOf(e,a)<0?(h.isUsable(t,u,function(){}),o()):void h.isUsable(t,u,function(e){if(!e)return o();var n=h.hasOwnProperty("create")?h.create(t,u):new h(t,u);i.call(s,n)})},function(){throw new Error("Could not find a usable connection type for "+o.stringify(r))})},register:function(t,e){this._transports.push([t,e]),e.prototype.connectionType=t},getConnectionTypes:function(){return c.map(this._transports,function(t){return t[0]})},_transports:[]});a(f.prototype,h),a(f.prototype,u),t.exports=f},function(t,e){(function(e){"use strict";t.exports={addTimeout:function(t,n,i,s){if(this._timeouts=this._timeouts||{},!this._timeouts.hasOwnProperty(t)){var r=this;this._timeouts[t]=e.setTimeout(function(){delete r._timeouts[t],i.call(s)},1e3*n)}},removeTimeout:function(t){this._timeouts=this._timeouts||{};var n=this._timeouts[t];n&&(e.clearTimeout(n),delete this._timeouts[t])},removeAllTimeouts:function(){this._timeouts=this._timeouts||{};for(var t in this._timeouts)this.removeTimeout(t)}}}).call(e,function(){return this}())},function(t,e,n){(function(e){"use strict";var i=n(7),s=n(9),r=n(25),o=n(10),c=n(12),a=n(26),h=n(8),u=n(3),l=n(27),f=n(14),p=n(22),d=h(i(p,{UNCONNECTED:1,CONNECTING:2,CONNECTED:3,batching:!1,isUsable:function(t,e){this.callback(function(){t.call(e,!0)}),this.errback(function(){t.call(e,!1)}),this.connect()},request:function(t){this._pending=this._pending||new r;for(var e=0,n=t.length;n>e;e++)this._pending.add(t[e]);var i=this,o=new s(function(e){i.callback(function(n){n&&1===n.readyState&&(n.send(u(t)),e(n))}),i.connect()});return{abort:function(){o.then(function(t){t.close()})}}},connect:function(){if(!d._unloaded&&(this._state=this._state||this.UNCONNECTED,this._state===this.UNCONNECTED)){this._state=this.CONNECTING;var t=this._createSocket();if(!t)return this.setDeferredStatus("failed");var e=this;t.onopen=function(){t.headers&&e._storeCookies(t.headers["set-cookie"]),e._socket=t,e._state=e.CONNECTED,e._everConnected=!0,e._ping(),e.setDeferredStatus("succeeded",t)};var n=!1;t.onclose=t.onerror=function(){if(!n){n=!0;var i=e._state===e.CONNECTED;t.onopen=t.onclose=t.onerror=t.onmessage=null,delete e._socket,e._state=e.UNCONNECTED,e.removeTimeout("ping");var s=e._pending?e._pending.toArray():[];delete e._pending,i||e._everConnected?(e.setDeferredStatus("unknown"),e._handleError(s,i)):e.setDeferredStatus("failed")}},t.onmessage=function(t){var n;try{n=JSON.parse(t.data)}catch(i){}if(n){n=[].concat(n);for(var s=0,r=n.length;r>s;s++)void 0!==n[s].successful&&e._pending.remove(n[s]);e._receive(n)}}}},close:function(){this._socket&&this._socket.close()},_createSocket:function(){var t=d.getSocketUrl(this.endpoint),e=this._dispatcher.headers,n=this._dispatcher.wsExtensions,i=this._getCookies(),s=this._dispatcher.tls,r={extensions:n,headers:e,proxy:this._proxy,tls:s};return""!==i&&(r.headers.Cookie=i),l.create(t,[],r)},_ping:function(){this._socket&&1===this._socket.readyState&&(this._socket.send("[]"),this.addTimeout("ping",this._dispatcher.timeout/2,this._ping,this))}}),{PROTOCOLS:{"http:":"ws:","https:":"wss:"},create:function(t,e){var n=t.transports.websocket=t.transports.websocket||{};return n[e.href]=n[e.href]||new this(t,e),n[e.href]},getSocketUrl:function(t){return t=a(t),t.protocol=this.PROTOCOLS[t.protocol],o.stringify(t)},isUsable:function(t,e,n,i){this.create(t,e).isUsable(n,i)}});h(d.prototype,f),c.Event&&void 0!==e.onbeforeunload&&c.Event.on(e,"beforeunload",function(){d._unloaded=!0}),t.exports=d}).call(e,function(){return this}())},function(t,e,n){"use strict";var i=n(7);t.exports=i({initialize:function(){this._index={}},add:function(t){var e=void 0!==t.id?t.id:t;return this._index.hasOwnProperty(e)?!1:(this._index[e]=t,!0)},forEach:function(t,e){for(var n in this._index)this._index.hasOwnProperty(n)&&t.call(e,this._index[n])},isEmpty:function(){for(var t in this._index)if(this._index.hasOwnProperty(t))return!1;return!0},member:function(t){for(var e in this._index)if(this._index[e]===t)return!0;return!1},remove:function(t){var e=void 0!==t.id?t.id:t,n=this._index[e];return delete this._index[e],n},toArray:function(){var t=[];return this.forEach(function(e){t.push(e)}),t}})},function(t){"use strict";var e=function(t){var n,i,s;if(t instanceof Array){for(n=[],i=t.length;i--;)n[i]=e(t[i]);return n}if("object"==typeof t){n=null===t?null:{};for(s in t)n[s]=e(t[s]);return n}return t};t.exports=e},function(t,e){(function(e){"use strict";var n=e.MozWebSocket||e.WebSocket;t.exports={create:function(t){return new n(t)}}}).call(e,function(){return this}())},function(t,e,n){(function(e){"use strict";var i=n(7),s=n(10),r=n(26),o=n(8),c=n(14),a=n(22),h=n(29),u=o(i(a,{initialize:function(t,n){if(a.prototype.initialize.call(this,t,n),!e.EventSource)return this.setDeferredStatus("failed");this._xhr=new h(t,n),n=r(n),n.pathname+="/"+t.clientId;var i=new e.EventSource(s.stringify(n)),o=this;i.onopen=function(){o._everConnected=!0,o.setDeferredStatus("succeeded")},i.onerror=function(){o._everConnected?o._handleError([]):(o.setDeferredStatus("failed"),i.close())},i.onmessage=function(t){var e;try{e=JSON.parse(t.data)}catch(n){}e?o._receive(e):o._handleError([])},this._socket=i},close:function(){this._socket&&(this._socket.onopen=this._socket.onerror=this._socket.onmessage=null,this._socket.close(),delete this._socket)},isUsable:function(t,e){this.callback(function(){t.call(e,!0)}),this.errback(function(){t.call(e,!1)})},encode:function(t){return this._xhr.encode(t)},request:function(t){return this._xhr.request(t)}}),{isUsable:function(t,e,n,i){var s=t.clientId;return s?void h.isUsable(t,e,function(s){return s?void this.create(t,e).isUsable(n,i):n.call(i,!1)},this):n.call(i,!1)},create:function(t,e){var n=t.transports.eventsource=t.transports.eventsource||{},i=t.clientId,o=r(e);return o.pathname+="/"+(i||""),o=s.stringify(o),n[o]=n[o]||new this(t,e),n[o]}});o(u.prototype,c),t.exports=u}).call(e,function(){return this}())},function(t,e,n){(function(e){"use strict";var i=n(7),s=n(10),r=n(12),o=n(8),c=n(3),a=n(22),h=o(i(a,{encode:function(t){return c(t)},request:function(t){var n,i=this.endpoint.href,s=this;if(e.XMLHttpRequest)n=new XMLHttpRequest;else{if(!e.ActiveXObject)return this._handleError(t);n=new ActiveXObject("Microsoft.XMLHTTP")}n.open("POST",i,!0),n.setRequestHeader("Content-Type","application/json"),n.setRequestHeader("Pragma","no-cache"),n.setRequestHeader("X-Requested-With","XMLHttpRequest");var o=this._dispatcher.headers;
2
+ for(var c in o)o.hasOwnProperty(c)&&n.setRequestHeader(c,o[c]);var a=function(){n.abort()};return void 0!==e.onbeforeunload&&r.Event.on(e,"beforeunload",a),n.onreadystatechange=function(){if(n&&4===n.readyState){var i=null,o=n.status,c=n.responseText,h=o>=200&&300>o||304===o||1223===o;if(void 0!==e.onbeforeunload&&r.Event.detach(e,"beforeunload",a),n.onreadystatechange=function(){},n=null,!h)return s._handleError(t);try{i=JSON.parse(c)}catch(u){}i?s._receive(i):s._handleError(t)}},n.send(this.encode(t)),n}}),{isUsable:function(t,e,n,i){var r="ReactNative"===navigator.product||s.isSameOrigin(e);n.call(i,r)}});t.exports=h}).call(e,function(){return this}())},function(t,e,n){(function(e){"use strict";var i=n(7),s=n(25),r=n(10),o=n(8),c=n(3),a=n(22),h=o(i(a,{encode:function(t){return"message="+encodeURIComponent(c(t))},request:function(t){var n,i=e.XDomainRequest?XDomainRequest:XMLHttpRequest,s=new i,o=++h._id,c=this._dispatcher.headers,a=this;if(s.open("POST",r.stringify(this.endpoint),!0),s.setRequestHeader){s.setRequestHeader("Pragma","no-cache");for(n in c)c.hasOwnProperty(n)&&s.setRequestHeader(n,c[n])}var u=function(){return s?(h._pending.remove(o),s.onload=s.onerror=s.ontimeout=s.onprogress=null,void(s=null)):!1};return s.onload=function(){var e;try{e=JSON.parse(s.responseText)}catch(n){}u(),e?a._receive(e):a._handleError(t)},s.onerror=s.ontimeout=function(){u(),a._handleError(t)},s.onprogress=function(){},i===e.XDomainRequest&&h._pending.add({id:o,xhr:s}),s.send(this.encode(t)),s}}),{_id:0,_pending:new s,isUsable:function(t,n,i,s){if(r.isSameOrigin(n))return i.call(s,!1);if(e.XDomainRequest)return i.call(s,n.protocol===location.protocol);if(e.XMLHttpRequest){var o=new XMLHttpRequest;return i.call(s,void 0!==o.withCredentials)}return i.call(s,!1)}});t.exports=h}).call(e,function(){return this}())},function(t,e,n){(function(e){"use strict";var i=n(7),s=n(10),r=n(26),o=n(8),c=n(3),a=n(22),h=o(i(a,{encode:function(t){var e=r(this.endpoint);return e.query.message=c(t),e.query.jsonp="__jsonp"+h._cbCount+"__",s.stringify(e)},request:function(t){var n=document.getElementsByTagName("head")[0],i=document.createElement("script"),o=h.getCallbackName(),a=r(this.endpoint),u=this;a.query.message=c(t),a.query.jsonp=o;var l=function(){if(!e[o])return!1;e[o]=void 0;try{delete e[o]}catch(t){}i.parentNode.removeChild(i)};return e[o]=function(t){l(),u._receive(t)},i.type="text/javascript",i.src=s.stringify(a),n.appendChild(i),i.onerror=function(){l(),u._handleError(t)},{abort:l}}}),{_cbCount:0,getCallbackName:function(){return this._cbCount+=1,"__jsonp"+this._cbCount+"__"},isUsable:function(t,e,n,i){n.call(i,!0)}});t.exports=h}).call(e,function(){return this}())},function(t,e,n){"use strict";var i=n(8),s=function(t,e){this.message=t,this.options=e,this.attempts=0};i(s.prototype,{getTimeout:function(){return this.options.timeout},getInterval:function(){return this.options.interval},isDeliverable:function(){var t=this.options.attempts,e=this.attempts,n=this.options.deadline,i=(new Date).getTime();return void 0!==t&&e>=t?!1:void 0!==n&&i>n?!1:!0},send:function(){this.attempts+=1},succeed:function(){},fail:function(){},abort:function(){}}),t.exports=s},function(t,e,n){"use strict";var i=n(7),s=n(18),r=i({initialize:function(t,e,n){this.code=t,this.params=Array.prototype.slice.call(e),this.message=n},toString:function(){return this.code+":"+this.params.join(",")+":"+this.message}});r.parse=function(t){if(t=t||"",!s.ERROR.test(t))return new r(null,[],t);var e=t.split(":"),n=parseInt(e[0]),i=e[1].split(","),t=e[2];return new r(n,i,t)};var o={versionMismatch:[300,"Version mismatch"],conntypeMismatch:[301,"Connection types not supported"],extMismatch:[302,"Extension mismatch"],badRequest:[400,"Bad request"],clientUnknown:[401,"Unknown client"],parameterMissing:[402,"Missing required parameter"],channelForbidden:[403,"Forbidden channel"],channelUnknown:[404,"Unknown channel"],channelInvalid:[405,"Invalid channel"],extUnknown:[406,"Unknown extension"],publishFailed:[407,"Failed to publish"],serverError:[500,"Internal server error"]};for(var c in o)(function(t){r[t]=function(){return new r(o[t][0],arguments,o[t][1]).toString()}})(c);t.exports=r},function(t,e,n){"use strict";var i=n(8),s=n(2),r={addExtension:function(t){this._extensions=this._extensions||[],this._extensions.push(t),t.added&&t.added(this)},removeExtension:function(t){if(this._extensions)for(var e=this._extensions.length;e--;)this._extensions[e]===t&&(this._extensions.splice(e,1),t.removed&&t.removed(this))},pipeThroughExtensions:function(t,e,n,i,s){if(this.debug("Passing through ? extensions: ?",t,e),!this._extensions)return i.call(s,e);var r=this._extensions.slice(),o=function(e){if(!e)return i.call(s,e);var c=r.shift();if(!c)return i.call(s,e);var a=c[t];return a?void(a.length>=3?c[t](e,n,o):c[t](e,o)):o(e)};o(e)}};i(r,s),t.exports=r},function(t,e,n){"use strict";var i=n(7),s=n(14);t.exports=i(s)},function(t,e,n){"use strict";var i=n(7),s=n(8),r=n(14),o=i({initialize:function(t,e,n,i){this._client=t,this._channels=e,this._callback=n,this._context=i,this._cancelled=!1},withChannel:function(t,e){return this._withChannel=[t,e],this},apply:function(t,e){var n=e[0];this._callback&&this._callback.call(this._context,n.data),this._withChannel&&this._withChannel[0].call(this._withChannel[1],n.channel,n.data)},cancel:function(){this._cancelled||(this._client.unsubscribe(this._channels,this),this._cancelled=!0)},unsubscribe:function(){this.cancel()}});s(o.prototype,r),t.exports=o}]);
3
+ //# sourceMappingURL=faye-browser-min.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"faye-browser.js","sources":["webpack:///webpack/bootstrap 15f36c39af4f607b524f","webpack:///./src/faye_browser.js","webpack:///./src/util/constants.js","webpack:///./src/mixins/logging.js","webpack:///./src/util/to_json.js","webpack:///./src/protocol/client.js","webpack:///./~/asap/browser-asap.js","webpack:///./~/asap/browser-raw.js","webpack:///./src/util/class.js","webpack:///./src/util/extend.js","webpack:///./src/util/promise.js","webpack:///./src/util/uri.js","webpack:///./src/util/array.js","webpack:///./src/util/browser/event.js","webpack:///./src/util/validate_options.js","webpack:///./src/mixins/deferrable.js","webpack:///./src/mixins/publisher.js","webpack:///./src/util/event_emitter.js","webpack:///./src/protocol/channel.js","webpack:///./src/protocol/grammar.js","webpack:///./src/protocol/dispatcher.js","webpack:///./src/util/cookies/browser_cookies.js","webpack:///./src/transport/browser_transports.js","webpack:///./src/transport/transport.js","webpack:///./src/mixins/timeouts.js","webpack:///./src/transport/web_socket.js","webpack:///./src/util/set.js","webpack:///./src/util/copy_object.js","webpack:///./src/util/websocket/browser_websocket.js","webpack:///./src/transport/event_source.js","webpack:///./src/transport/xhr.js","webpack:///./src/transport/cors.js","webpack:///./src/transport/jsonp.js","webpack:///./src/protocol/scheduler.js","webpack:///./src/protocol/error.js","webpack:///./src/protocol/extensible.js","webpack:///./src/protocol/publication.js","webpack:///./src/protocol/subscription.js"],"names":["__webpack_require__","moduleId","installedModules","exports","module","id","loaded","modules","call","m","c","p","constants","Logging","Faye","VERSION","Client","Scheduler","wrapper","BAYEUX_VERSION","ID_LENGTH","JSONP_CALLBACK","CONNECTION_TYPES","MANDATORY_CONNECTION_TYPES","toJSON","LOG_LEVELS","fatal","error","warn","info","debug","writeLog","messageArgs","level","logger","args","Array","prototype","slice","apply","banner","klass","this","className","message","shift","replace","key","arguments","object","JSON","stringify","value","global","asap","Class","URI","array","browser","extend","validateOptions","Deferrable","Publisher","Channel","Dispatcher","Error","Extensible","Publication","Subscription","UNCONNECTED","CONNECTING","CONNECTED","DISCONNECTED","HANDSHAKE","RETRY","NONE","CONNECTION_TIMEOUT","DEFAULT_ENDPOINT","INTERVAL","initialize","endpoint","options","_channels","Set","_dispatcher","create","_messageId","_state","_responseCallbacks","_advice","reconnect","interval","timeout","bind","_receiveMessage","Event","undefined","onbeforeunload","on","indexOf","_disabled","disconnect","addWebsocketExtension","extension","disable","feature","setHeader","name","handshake","callback","context","self","selectTransport","_sendMessage","channel","version","supportedConnectionTypes","getConnectionTypes","response","successful","clientId","subscribe","getKeys","setTimeout","retry","connect","setDeferredStatus","_connectRequest","CONNECT","connectionType","_cycleConnection","promise","DISCONNECT","close","parse","map","subscription","force","hasSubscribe","hasSubscription","SUBSCRIBE","unsubscribe","channels","concat","dead","UNSUBSCRIBE","publish","data","publication","_generateMessageId","pipeThroughExtensions","sendMessage","Math","pow","toString","advice","_handleAdvice","_deliverMessage","distributeMessage","throwFirstError","pendingErrors","length","task","rawTask","freeTasks","pop","RawTask","rawAsap","requestErrorThrow","makeRequestCallFromTimer","onerror","push","queue","requestFlush","flushing","flush","index","currentIndex","capacity","scan","newLength","makeRequestCallFromMutationObserver","toggle","observer","BrowserMutationObserver","node","document","createTextNode","observe","characterData","handleTimer","clearTimeout","timeoutHandle","clearInterval","intervalHandle","setInterval","MutationObserver","WebKitMutationObserver","parent","methods","Object","bridge","dest","source","overwrite","hasOwnProperty","PENDING","FULFILLED","REJECTED","RETURN","x","THROW","Promise","_onFulfilled","_onRejected","fulfill","reason","reject","then","onFulfilled","onRejected","next","registerOnFulfilled","registerOnRejected","handler","invoke","_value","_reason","fn","_invoke","outcome","TypeError","type","called","_fulfill","v","r","resolve","accept","all","promises","i","list","n","race","deferred","pending","tuple","isURI","uri","protocol","host","path","isSameOrigin","location","hostname","port","url","parts","query","pairs","consume","pattern","match","test","pathname","substr","split","search","decodeURIComponent","href","string","queryString","hash","encodeURIComponent","join","commonElement","lista","listb","needle","result","filter","asyncEach","iterator","calls","looping","iterate","resume","loop","_registry","element","eventName","wrapped","addEventListener","attachEvent","_element","_type","_callback","_context","_handler","detach","register","removeEventListener","detachEvent","splice","onunload","validKeys","errback","_promise","_resolve","_reject","seconds","_timer","status","EventEmitter","countListeners","eventType","listeners","listener","_listeners","unbind","removeListener","trigger","emit","xs","isArray","_events","l","addListener","once","g","removeAllListeners","Grammar","isUnused","META","SERVICE","expand","segments","copy","unparse","isValid","CHANNEL_NAME","CHANNEL_PATTERN","isMeta","isService","isSubscribable","keys","remove","names","ERROR","cookies","Transport","MAX_REQUEST_SIZE","DEFAULT_RETRY","UP","DOWN","client","_client","_alternates","endpoints","CookieJar","_envelopes","headers","_scheduler","scheduler","transports","wsExtensions","proxy","_proxy","origin","exts","websocketExtensions","tls","ca","maxRequestSize","endpointFor","transport","_transport","transportTypes","get","attempts","deadline","Date","getTime","envelope","_sendEnvelope","request","timer","isDeliverable","abort","handleError","getTimeout","send","handleResponse","reply","succeed","immediate","req","fail","getInterval","Cookie","Timeouts","DEFAULT_PORTS","http:","https:","ws:","wss:","SECURE_PROTOCOLS","MAX_DELAY","batching","dispatcher","_outbox","process","env","HTTPS_PROXY","https_proxy","HTTP_PROXY","http_proxy","encode","_flushLargeBatch","_publish","_connectMessage","_makePromise","_requestPromise","_resolvePromise","delay","addTimeout","_flush","removeTimeout","last","_receive","replies","_handleError","messages","_getCookies","getCookiesSync","cookie","cookieString","_storeCookies","setCookie","setCookieSync","allowed","disabled","_transports","pair","connType","connEndpoint","isUsable","t","_timeouts","removeAllTimeouts","copyObject","ws","WebSocket","_pending","add","socket","readyState","_unloaded","_createSocket","onopen","_socket","_everConnected","_ping","closed","onclose","wasConnected","onmessage","toArray","event","getSocketUrl","extensions","PROTOCOLS","sockets","websocket","_index","item","forEach","block","isEmpty","member","removed","clone","WS","MozWebSocket","XHR","EventSource","_xhr","usable","eventsource","xhr","XMLHttpRequest","ActiveXObject","open","setRequestHeader","onreadystatechange","text","responseText","navigator","product","CORS","xhrClass","XDomainRequest","_id","cleanUp","onload","ontimeout","onprogress","withCredentials","JSONP","jsonp","_cbCount","head","getElementsByTagName","script","createElement","callbackName","getCallbackName","cleanup","parentNode","removeChild","src","appendChild","made","now","code","params","parseInt","errors","versionMismatch","conntypeMismatch","extMismatch","badRequest","clientUnknown","parameterMissing","channelForbidden","channelUnknown","channelInvalid","extUnknown","publishFailed","serverError","addExtension","_extensions","added","removeExtension","stage","pipe","_cancelled","withChannel","_withChannel","cancel"],"mappings":"qBAIA,QAAAA,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAE,OAGA,IAAAC,GAAAF,EAAAD,IACAE,WACAE,GAAAJ,EACAK,QAAA,EAUA,OANAC,GAAAN,GAAAO,KAAAJ,EAAAD,QAAAC,EAAAA,EAAAD,QAAAH,GAGAI,EAAAE,QAAA,EAGAF,EAAAD,QAvBA,GAAAD,KAqCA,OATAF,GAAAS,EAAAF,EAGAP,EAAAU,EAAAR,EAGAF,EAAAW,EAAA,GAGAX,EAAA,qBCtCA,YAEA,IAAAY,GAAAZ,EAAA,GACAa,EAAAb,EAAA,GAEAc,GACAC,QAAAH,EAAAG,QAEAC,OAAAhB,EAAA,GACAiB,UAAAjB,EAAA,IAGAa,GAAAK,QAAAJ,EAEAV,EAAAD,QAAAW,eCdAV,EAAAD,SACAY,QAAA,QAEAI,eAAA,MACAC,UAAA,IACAC,eAAA,gBACAC,kBAAA,eAAA,4BAAA,mBAAA,YAAA,cAAA,cAEAC,4BAAA,eAAA,mBAAA,gCCRA,YAEA,IAAAC,GAAAxB,EAAA,GAEAa,GACAY,YACAC,MAAA,EACAC,MAAA,EACAC,KAAA,EACAC,KAAA,EACAC,MAAA,GAGAC,SAAA,SAAAC,EAAAC,GACA,GAAAC,GAAArB,EAAAqB,SAAArB,EAAAK,SAAAL,GAAAqB,MACA,IAAAA,EAAA,CAEA,GAAAC,GAAAC,MAAAC,UAAAC,MAAAC,MAAAP,GACAQ,EAAA,QACAC,EAAAC,KAAAC,UAEAC,EAAAT,EAAAU,QAAAC,QAAA,MAAA,WACA,IACA,MAAAtB,GAAAW,EAAAU,SACW,MAAAlB,GACX,MAAA,aAIAc,KAAAD,GAAA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WAIA3e,GAAAS,EAAA/B,UAAAwB,GAEAzD,EAAAD,QAAAiE;ArC3CA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;ACtCA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;;;;;;ACdA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;ACTA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW;AACX;AACA;AACA,UAAS;;AAET;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;;;;;;;AC9CA;;AAEA;;AAEA;AACA;AACA;AACA,IAAG;AACH;;;;;;;ACRA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,qBAAoB;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,QAAO;AACP,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,MAAK,IAAI;;AAET;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA,wCAAuC,yBAAyB;;AAEhE,QAAO;AACP;AACA,uCAAsC,oCAAoC;AAC1E;AACA;AACA,MAAK;AACL,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,yCAAwC,kCAAkC;;AAE1E;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA,MAAK,IAAI;AACT,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,MAAK,IAAI;AACT;AACA;AACA;AACA,QAAO;AACP;AACA;AACA,MAAK;;AAEL;AACA;;AAEA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;;AAEP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,QAAO,IAAI;AACX;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,QAAO;AACP,MAAK;;AAEL;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;;AAEP;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,QAAO,IAAI;AACX;;AAEA;AACA;AACA,QAAO;AACP,MAAK;AACL,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAiC;AACjC;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;AACA;AACA;AACA,QAAO;AACP,MAAK;;AAEL;AACA,IAAG;;AAEH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,mEAAkE;AAClE,MAAK;AACL,IAAG;;AAEH;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL,IAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,mCAAkC,iBAAiB;AACnD;AACA,EAAC;;AAED;AACA;AACA;AACA;;AAEA;;;;;;;;ACjYA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAY,MAAM;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;;;;;;;ACjEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAgE,kBAAkB;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA4B,oBAAoB;AAChD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3NA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;ACtBA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACXA;;AAEA;;AAEA;AACA;AACA;;AAEA,2BAA0B,WAAW;AACrC,2BAA0B;;AAE1B;AACA;AACA;AACA;;AAEA;AACA;;AAEA,0BAAyB,uBAAuB;AAChD,0BAAyB,uBAAuB;AAChD;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,kCAAiC;;AAEjC;AACA;AACA,IAAG;AACH;AACA;AACA;;AAEA;AACA;AACA,mCAAkC;;AAElC;AACA;AACA,IAAG;AACH;AACA;AACA;;AAEA;AACA,oBAAmB,2BAA2B;AAC9C;;AAEA;AACA;;AAEA;AACA;AACA,IAAG;AACH;AACA;;AAEA;AACA;AACA,IAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,MAAK;AACL,IAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,iDAAgD,iBAAiB;AACjE;;AAEA;AACA,iDAAgD,iBAAiB;AACjE;;AAEA;AACA;AACA;;AAEA;;AAEA,gBAAe,OAAO;AACtB;AACA;AACA;AACA,QAAO;AACP,MAAK;AACL,IAAG;AACH;;AAEA;AACA;AACA,yCAAwC,OAAO;AAC/C;AACA,IAAG;AACH;;AAEA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;;AAEA;;;;;;;AChKA;;AAEA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,iBAAgB;;AAEhB;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,kCAAiC,OAAO;AACxC;AACA;AACA;;AAEA;;AAEA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AClFA;;AAEA;AACA;AACA,sCAAqC,OAAO;AAC5C;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;;AAEA,qCAAoC,OAAO;AAC3C;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;;AAEA;AACA,yCAAwC,OAAO;AAC/C;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,sCAAqC,OAAO;AAC5C;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACzEA;;AAEA;AACA;;AAEA;AACA,+BAA8B;;AAE9B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL,IAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;;;;;;ACjDA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACTA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;;AAEP;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA,uCAAsC,gCAAgC;AACtE,IAAG;;AAEH;AACA,8CAA6C,iCAAiC;AAC9E,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,MAAK;AACL,IAAG;;AAEH;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/CA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,+BAA8B;;AAE9B;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAmB,eAAe;AAClC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA2B;AAC3B,QAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,IAAG;AACH;;AAEA;AACA,0CAAyC,OAAO;AAChD;AACA;AACA;;AAEA,IAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA,IAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AC1KA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,EAAC;;AAED;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,yCAAwC,OAAO;AAC/C;AACA;AACA;AACA;;AAEA;AACA,IAAG;;AAEH;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,wCAAuC,OAAO;AAC9C;AACA;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA,MAAK;;AAEL;AACA;;AAEA,2CAA0C,OAAO;AACjD;AACA;AACA;AACA;AACA,IAAG;AACH,EAAC;;AAED;;;;;;;ACnIA;;AAEA;AACA;AACA,qFAAoF,IAAI;AACxF;AACA;AACA;;;;;;;ACPA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,yBAAwB;AACxB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,yDAAwD;;AAExD;AACA;AACA;AACA,uCAAsC,OAAO;AAC7C;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,MAAK;AACL,IAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,iDAAgD,+EAA+E;AAC/H,0CAAyC;AACzC;;AAEA;AACA,IAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAK;;AAEL;AACA;AACA,IAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,MAAK;;AAEL;AACA;;AAEA;AACA;;AAEA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA,QAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,EAAC;;AAED;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;ACxLA;;AAEA;;;;;;;ACFA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;ACVA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,+BAA8B;AAC9B,sBAAqB,mDAAmD;AACxE;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,iCAAgC;;AAEhC;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH,uBAAsB;;AAEtB;AACA;AACA,IAAG;;AAEH;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,IAAG;;AAEH;AACA;;AAEA;AACA;AACA,MAAK;AACL,IAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA,MAAK;;AAEL;AACA,IAAG;;AAEH;AACA;;AAEA;AACA,sCAAqC;;AAErC;;AAEA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,IAAG;;AAEH;AACA;AACA;;AAEA;AACA;;AAEA,wCAAuC,OAAO;AAC9C;AACA,IAAG;;AAEH;AACA;;AAEA;AACA;;AAEA,yCAAwC,OAAO;AAC/C;AACA,IAAG;;AAEH;AACA;AACA;;AAEA;;AAEA;AACA;AACA,MAAK,SAAS;AACd,IAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;;AAEA,0CAAyC,OAAO;AAChD;AACA;AACA;AACA;;AAEA,EAAC;AACD;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,+DAA8D;AAC9D;AACA;;AAEA;AACA;AACA;AACA;AACA,QAAO;AACP,MAAK;AACL;AACA,MAAK;AACL,IAAG;;AAEH;AACA;AACA;AACA,IAAG;;AAEH;AACA,qDAAoD,cAAc;AAClE,IAAG;;AAEH;AACA,EAAC;;AAED;AACA;;AAEA;;;;;;;ACzLA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;;;;;;;;ACzBA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,+BAA8B,+BAA+B;AAC7D,8BAA6B,gCAAgC;AAC7D;AACA,IAAG;;AAEH;AACA;AACA,yCAAwC,OAAO;;AAE/C;;AAEA;AACA;AACA;AACA;AACA;AACA,QAAO;;AAEP;AACA,MAAK;;AAEL;AACA,0BAAyB,4BAA4B,aAAa;AAClE;AACA,IAAG;;AAEH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;;AAEA;AACA;AACA,YAAW,mCAAmC;;AAE9C;;AAEA;;AAEA,0CAAyC,OAAO;AAChD;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,uBAAsB;;AAEtB;;AAEA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA,EAAC;AACD;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,EAAC;;AAED;;AAEA;AACA,wDAAuD,6BAA6B;;AAEpF;;;;;;;;AChKA;;AAEA;;AAEA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,kCAAiC,mBAAmB;AACpD;AACA;AACA,EAAC;;;;;;;ACjDD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;;AAEA;;;;;;;AClBA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;ACRA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAW,mCAAmC;;AAE9C;AACA;AACA;AACA;AACA;;AAEA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA,+BAA8B,+BAA+B;AAC7D,8BAA6B,gCAAgC;AAC7D,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;;AAEA,EAAC;AACD;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAK;AACL,IAAG;;AAEH;AACA,8FAA6F;AAC7F;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,EAAC;;AAED;;AAEA;;;;;;;;AChGA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAK;AACL;AACA,MAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,6BAA4B;AAC5B;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA,QAAO;;AAEP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,EAAC;AACD;AACA;AACA;;AAEA;AACA;AACA,EAAC;;AAED;;;;;;;;ACjFA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAW,yCAAyC;;AAEpD;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,0BAAyB,iBAAiB;;AAE1C;AACA;AACA;AACA,EAAC;AACD;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;;AAED;;;;;;;;ACnFA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,YAAW,8BAA8B;AACzC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,aAAY;AACZ;AACA,EAAC;AACD;;AAEA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,EAAC;;AAED;;;;;;;;AC/DA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH,yBAAwB;;AAExB,sBAAqB;;AAErB;AACA,EAAC;;AAED;;;;;;;AC7CA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,EAAC;;AAED;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;;;;;;;ACtDA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;;;;;;AC9CA;;AAEA;AACA;;AAEA;;;;;;;ACLA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,IAAG;;AAEH;AACA;;AAEA;AACA;;AAEA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,EAAC;;AAED;;AAEA","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 15f36c39af4f607b524f\n **/","'use strict';\n\nvar constants = require('./util/constants'),\n Logging = require('./mixins/logging');\n\nvar Faye = {\n VERSION: constants.VERSION,\n\n Client: require('./protocol/client'),\n Scheduler: require('./protocol/scheduler')\n};\n\nLogging.wrapper = Faye;\n\nmodule.exports = Faye;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/faye_browser.js\n ** module id = 0\n ** module chunks = 0\n **/","module.exports = {\n VERSION: '1.2.0',\n\n BAYEUX_VERSION: '1.0',\n ID_LENGTH: 160,\n JSONP_CALLBACK: 'jsonpcallback',\n CONNECTION_TYPES: ['long-polling', 'cross-origin-long-polling', 'callback-polling', 'websocket', 'eventsource', 'in-process'],\n\n MANDATORY_CONNECTION_TYPES: ['long-polling', 'callback-polling', 'in-process']\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/util/constants.js\n ** module id = 1\n ** module chunks = 0\n **/","'use strict';\n\nvar toJSON = require('../util/to_json');\n\nvar Logging = {\n LOG_LEVELS: {\n fatal: 4,\n error: 3,\n warn: 2,\n info: 1,\n debug: 0\n },\n\n writeLog: function(messageArgs, level) {\n var logger = Logging.logger || (Logging.wrapper || Logging).logger;\n if (!logger) return;\n\n var args = Array.prototype.slice.apply(messageArgs),\n banner = '[Faye',\n klass = this.className,\n\n message = args.shift().replace(/\\?/g, function() {\n try {\n return toJSON(args.shift());\n } catch (error) {\n return '[Object]';\n }\n });\n\n if (klass) banner += '.' + klass;\n banner += '] ';\n\n if (typeof logger[level] === 'function')\n logger[level](banner + message);\n else if (typeof logger === 'function')\n logger(banner + message);\n }\n};\n\nfor (var key in Logging.LOG_LEVELS)\n (function(level) {\n Logging[level] = function() {\n this.writeLog(arguments, level);\n };\n })(key);\n\nmodule.exports = Logging;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/mixins/logging.js\n ** module id = 2\n ** module chunks = 0\n **/","'use strict';\n\n// http://assanka.net/content/tech/2009/09/02/json2-js-vs-prototype/\n\nmodule.exports = function(object) {\n return JSON.stringify(object, function(key, value) {\n return (this[key] instanceof Array) ? this[key] : value;\n });\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/util/to_json.js\n ** module id = 3\n ** module chunks = 0\n **/","'use strict';\n\nvar asap = require('asap'),\n Class = require('../util/class'),\n Promise = require('../util/promise'),\n URI = require('../util/uri'),\n array = require('../util/array'),\n browser = require('../util/browser'),\n constants = require('../util/constants'),\n extend = require('../util/extend'),\n validateOptions = require('../util/validate_options'),\n Deferrable = require('../mixins/deferrable'),\n Logging = require('../mixins/logging'),\n Publisher = require('../mixins/publisher'),\n Channel = require('./channel'),\n Dispatcher = require('./dispatcher'),\n Error = require('./error'),\n Extensible = require('./extensible'),\n Publication = require('./publication'),\n Subscription = require('./subscription');\n\nvar Client = Class({ className: 'Client',\n UNCONNECTED: 1,\n CONNECTING: 2,\n CONNECTED: 3,\n DISCONNECTED: 4,\n\n HANDSHAKE: 'handshake',\n RETRY: 'retry',\n NONE: 'none',\n\n CONNECTION_TIMEOUT: 60,\n\n DEFAULT_ENDPOINT: '/bayeux',\n INTERVAL: 0,\n\n initialize: function(endpoint, options) {\n this.info('New client created for ?', endpoint);\n options = options || {};\n\n validateOptions(options, ['interval', 'timeout', 'endpoints', 'proxy', 'retry', 'scheduler', 'websocketExtensions', 'tls', 'ca']);\n\n this._channels = new Channel.Set();\n this._dispatcher = Dispatcher.create(this, endpoint || this.DEFAULT_ENDPOINT, options);\n\n this._messageId = 0;\n this._state = this.UNCONNECTED;\n\n this._responseCallbacks = {};\n\n this._advice = {\n reconnect: this.RETRY,\n interval: 1000 * (options.interval || this.INTERVAL),\n timeout: 1000 * (options.timeout || this.CONNECTION_TIMEOUT)\n };\n this._dispatcher.timeout = this._advice.timeout / 1000;\n\n this._dispatcher.bind('message', this._receiveMessage, this);\n\n if (browser.Event && global.onbeforeunload !== undefined)\n browser.Event.on(global, 'beforeunload', function() {\n if (array.indexOf(this._dispatcher._disabled, 'autodisconnect') < 0)\n this.disconnect();\n }, this);\n },\n\n addWebsocketExtension: function(extension) {\n return this._dispatcher.addWebsocketExtension(extension);\n },\n\n disable: function(feature) {\n return this._dispatcher.disable(feature);\n },\n\n setHeader: function(name, value) {\n return this._dispatcher.setHeader(name, value);\n },\n\n // Request\n // MUST include: * channel\n // * version\n // * supportedConnectionTypes\n // MAY include: * minimumVersion\n // * ext\n // * id\n //\n // Success Response Failed Response\n // MUST include: * channel MUST include: * channel\n // * version * successful\n // * supportedConnectionTypes * error\n // * clientId MAY include: * supportedConnectionTypes\n // * successful * advice\n // MAY include: * minimumVersion * version\n // * advice * minimumVersion\n // * ext * ext\n // * id * id\n // * authSuccessful\n handshake: function(callback, context) {\n if (this._advice.reconnect === this.NONE) return;\n if (this._state !== this.UNCONNECTED) return;\n\n this._state = this.CONNECTING;\n var self = this;\n\n this.info('Initiating handshake with ?', URI.stringify(this._dispatcher.endpoint));\n this._dispatcher.selectTransport(constants.MANDATORY_CONNECTION_TYPES);\n\n this._sendMessage({\n channel: Channel.HANDSHAKE,\n version: constants.BAYEUX_VERSION,\n supportedConnectionTypes: this._dispatcher.getConnectionTypes()\n\n }, {}, function(response) {\n\n if (response.successful) {\n this._state = this.CONNECTED;\n this._dispatcher.clientId = response.clientId;\n\n this._dispatcher.selectTransport(response.supportedConnectionTypes);\n\n this.info('Handshake successful: ?', this._dispatcher.clientId);\n\n this.subscribe(this._channels.getKeys(), true);\n if (callback) asap(function() { callback.call(context) });\n\n } else {\n this.info('Handshake unsuccessful');\n global.setTimeout(function() { self.handshake(callback, context) }, this._dispatcher.retry * 1000);\n this._state = this.UNCONNECTED;\n }\n }, this);\n },\n\n // Request Response\n // MUST include: * channel MUST include: * channel\n // * clientId * successful\n // * connectionType * clientId\n // MAY include: * ext MAY include: * error\n // * id * advice\n // * ext\n // * id\n // * timestamp\n connect: function(callback, context) {\n if (this._advice.reconnect === this.NONE) return;\n if (this._state === this.DISCONNECTED) return;\n\n if (this._state === this.UNCONNECTED)\n return this.handshake(function() { this.connect(callback, context) }, this);\n\n this.callback(callback, context);\n if (this._state !== this.CONNECTED) return;\n\n this.info('Calling deferred actions for ?', this._dispatcher.clientId);\n this.setDeferredStatus('succeeded');\n this.setDeferredStatus('unknown');\n\n if (this._connectRequest) return;\n this._connectRequest = true;\n\n this.info('Initiating connection for ?', this._dispatcher.clientId);\n\n this._sendMessage({\n channel: Channel.CONNECT,\n clientId: this._dispatcher.clientId,\n connectionType: this._dispatcher.connectionType\n\n }, {}, this._cycleConnection, this);\n },\n\n // Request Response\n // MUST include: * channel MUST include: * channel\n // * clientId * successful\n // MAY include: * ext * clientId\n // * id MAY include: * error\n // * ext\n // * id\n disconnect: function() {\n if (this._state !== this.CONNECTED) return;\n this._state = this.DISCONNECTED;\n\n this.info('Disconnecting ?', this._dispatcher.clientId);\n var promise = new Publication();\n\n this._sendMessage({\n channel: Channel.DISCONNECT,\n clientId: this._dispatcher.clientId\n\n }, {}, function(response) {\n if (response.successful) {\n this._dispatcher.close();\n promise.setDeferredStatus('succeeded');\n } else {\n promise.setDeferredStatus('failed', Error.parse(response.error));\n }\n }, this);\n\n this.info('Clearing channel listeners for ?', this._dispatcher.clientId);\n this._channels = new Channel.Set();\n\n return promise;\n },\n\n // Request Response\n // MUST include: * channel MUST include: * channel\n // * clientId * successful\n // * subscription * clientId\n // MAY include: * ext * subscription\n // * id MAY include: * error\n // * advice\n // * ext\n // * id\n // * timestamp\n subscribe: function(channel, callback, context) {\n if (channel instanceof Array)\n return array.map(channel, function(c) {\n return this.subscribe(c, callback, context);\n }, this);\n\n var subscription = new Subscription(this, channel, callback, context),\n force = (callback === true),\n hasSubscribe = this._channels.hasSubscription(channel);\n\n if (hasSubscribe && !force) {\n this._channels.subscribe([channel], subscription);\n subscription.setDeferredStatus('succeeded');\n return subscription;\n }\n\n this.connect(function() {\n this.info('Client ? attempting to subscribe to ?', this._dispatcher.clientId, channel);\n if (!force) this._channels.subscribe([channel], subscription);\n\n this._sendMessage({\n channel: Channel.SUBSCRIBE,\n clientId: this._dispatcher.clientId,\n subscription: channel\n\n }, {}, function(response) {\n if (!response.successful) {\n subscription.setDeferredStatus('failed', Error.parse(response.error));\n return this._channels.unsubscribe(channel, subscription);\n }\n\n var channels = [].concat(response.subscription);\n this.info('Subscription acknowledged for ? to ?', this._dispatcher.clientId, channels);\n subscription.setDeferredStatus('succeeded');\n }, this);\n }, this);\n\n return subscription;\n },\n\n // Request Response\n // MUST include: * channel MUST include: * channel\n // * clientId * successful\n // * subscription * clientId\n // MAY include: * ext * subscription\n // * id MAY include: * error\n // * advice\n // * ext\n // * id\n // * timestamp\n unsubscribe: function(channel, subscription) {\n if (channel instanceof Array)\n return array.map(channel, function(c) {\n return this.unsubscribe(c, subscription);\n }, this);\n\n var dead = this._channels.unsubscribe(channel, subscription);\n if (!dead) return;\n\n this.connect(function() {\n this.info('Client ? attempting to unsubscribe from ?', this._dispatcher.clientId, channel);\n\n this._sendMessage({\n channel: Channel.UNSUBSCRIBE,\n clientId: this._dispatcher.clientId,\n subscription: channel\n\n }, {}, function(response) {\n if (!response.successful) return;\n\n var channels = [].concat(response.subscription);\n this.info('Unsubscription acknowledged for ? from ?', this._dispatcher.clientId, channels);\n }, this);\n }, this);\n },\n\n // Request Response\n // MUST include: * channel MUST include: * channel\n // * data * successful\n // MAY include: * clientId MAY include: * id\n // * id * error\n // * ext * ext\n publish: function(channel, data, options) {\n validateOptions(options || {}, ['attempts', 'deadline']);\n var publication = new Publication();\n\n this.connect(function() {\n this.info('Client ? queueing published message to ?: ?', this._dispatcher.clientId, channel, data);\n\n this._sendMessage({\n channel: channel,\n data: data,\n clientId: this._dispatcher.clientId\n\n }, options, function(response) {\n if (response.successful)\n publication.setDeferredStatus('succeeded');\n else\n publication.setDeferredStatus('failed', Error.parse(response.error));\n }, this);\n }, this);\n\n return publication;\n },\n\n _sendMessage: function(message, options, callback, context) {\n message.id = this._generateMessageId();\n\n var timeout = this._advice.timeout\n ? 1.2 * this._advice.timeout / 1000\n : 1.2 * this._dispatcher.retry;\n\n this.pipeThroughExtensions('outgoing', message, null, function(message) {\n if (!message) return;\n if (callback) this._responseCallbacks[message.id] = [callback, context];\n this._dispatcher.sendMessage(message, timeout, options || {});\n }, this);\n },\n\n _generateMessageId: function() {\n this._messageId += 1;\n if (this._messageId >= Math.pow(2,32)) this._messageId = 0;\n return this._messageId.toString(36);\n },\n\n _receiveMessage: function(message) {\n var id = message.id, callback;\n\n if (message.successful !== undefined) {\n callback = this._responseCallbacks[id];\n delete this._responseCallbacks[id];\n }\n\n this.pipeThroughExtensions('incoming', message, null, function(message) {\n if (!message) return;\n if (message.advice) this._handleAdvice(message.advice);\n this._deliverMessage(message);\n if (callback) callback[0].call(callback[1], message);\n }, this);\n },\n\n _handleAdvice: function(advice) {\n extend(this._advice, advice);\n this._dispatcher.timeout = this._advice.timeout / 1000;\n\n if (this._advice.reconnect === this.HANDSHAKE && this._state !== this.DISCONNECTED) {\n this._state = this.UNCONNECTED;\n this._dispatcher.clientId = null;\n this._cycleConnection();\n }\n },\n\n _deliverMessage: function(message) {\n if (!message.channel || message.data === undefined) return;\n this.info('Client ? calling listeners for ? with ?', this._dispatcher.clientId, message.channel, message.data);\n this._channels.distributeMessage(message);\n },\n\n _cycleConnection: function() {\n if (this._connectRequest) {\n this._connectRequest = null;\n this.info('Closed connection for ?', this._dispatcher.clientId);\n }\n var self = this;\n global.setTimeout(function() { self.connect() }, this._advice.interval);\n }\n});\n\nextend(Client.prototype, Deferrable);\nextend(Client.prototype, Publisher);\nextend(Client.prototype, Logging);\nextend(Client.prototype, Extensible);\n\nmodule.exports = Client;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/protocol/client.js\n ** module id = 4\n ** module chunks = 0\n **/","\"use strict\";\n\n// rawAsap provides everything we need except exception management.\nvar rawAsap = require(\"./raw\");\n// RawTasks are recycled to reduce GC churn.\nvar freeTasks = [];\n// We queue errors to ensure they are thrown in right order (FIFO).\n// Array-as-queue is good enough here, since we are just dealing with exceptions.\nvar pendingErrors = [];\nvar requestErrorThrow = rawAsap.makeRequestCallFromTimer(throwFirstError);\n\nfunction throwFirstError() {\n if (pendingErrors.length) {\n throw pendingErrors.shift();\n }\n}\n\n/**\n * Calls a task as soon as possible after returning, in its own event, with priority\n * over other events like animation, reflow, and repaint. An error thrown from an\n * event will not interrupt, nor even substantially slow down the processing of\n * other events, but will be rather postponed to a lower priority event.\n * @param {{call}} task A callable object, typically a function that takes no\n * arguments.\n */\nmodule.exports = asap;\nfunction asap(task) {\n var rawTask;\n if (freeTasks.length) {\n rawTask = freeTasks.pop();\n } else {\n rawTask = new RawTask();\n }\n rawTask.task = task;\n rawAsap(rawTask);\n}\n\n// We wrap tasks with recyclable task objects. A task object implements\n// `call`, just like a function.\nfunction RawTask() {\n this.task = null;\n}\n\n// The sole purpose of wrapping the task is to catch the exception and recycle\n// the task object after its single use.\nRawTask.prototype.call = function () {\n try {\n this.task.call();\n } catch (error) {\n if (asap.onerror) {\n // This hook exists purely for testing purposes.\n // Its name will be periodically randomized to break any code that\n // depends on its existence.\n asap.onerror(error);\n } else {\n // In a web browser, exceptions are not fatal. However, to avoid\n // slowing down the queue of pending tasks, we rethrow the error in a\n // lower priority turn.\n pendingErrors.push(error);\n requestErrorThrow();\n }\n } finally {\n this.task = null;\n freeTasks[freeTasks.length] = this;\n }\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/asap/browser-asap.js\n ** module id = 5\n ** module chunks = 0\n **/","\"use strict\";\n\n// Use the fastest means possible to execute a task in its own turn, with\n// priority over other events including IO, animation, reflow, and redraw\n// events in browsers.\n//\n// An exception thrown by a task will permanently interrupt the processing of\n// subsequent tasks. The higher level `asap` function ensures that if an\n// exception is thrown by a task, that the task queue will continue flushing as\n// soon as possible, but if you use `rawAsap` directly, you are responsible to\n// either ensure that no exceptions are thrown from your task, or to manually\n// call `rawAsap.requestFlush` if an exception is thrown.\nmodule.exports = rawAsap;\nfunction rawAsap(task) {\n if (!queue.length) {\n requestFlush();\n flushing = true;\n }\n // Equivalent to push, but avoids a function call.\n queue[queue.length] = task;\n}\n\nvar queue = [];\n// Once a flush has been requested, no further calls to `requestFlush` are\n// necessary until the next `flush` completes.\nvar flushing = false;\n// `requestFlush` is an implementation-specific method that attempts to kick\n// off a `flush` event as quickly as possible. `flush` will attempt to exhaust\n// the event queue before yielding to the browser's own event loop.\nvar requestFlush;\n// The position of the next task to execute in the task queue. This is\n// preserved between calls to `flush` so that it can be resumed if\n// a task throws an exception.\nvar index = 0;\n// If a task schedules additional tasks recursively, the task queue can grow\n// unbounded. To prevent memory exhaustion, the task queue will periodically\n// truncate already-completed tasks.\nvar capacity = 1024;\n\n// The flush function processes all tasks that have been scheduled with\n// `rawAsap` unless and until one of those tasks throws an exception.\n// If a task throws an exception, `flush` ensures that its state will remain\n// consistent and will resume where it left off when called again.\n// However, `flush` does not make any arrangements to be called again if an\n// exception is thrown.\nfunction flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}\n\n// `requestFlush` is implemented using a strategy based on data collected from\n// every available SauceLabs Selenium web driver worker at time of writing.\n// https://docs.google.com/spreadsheets/d/1mG-5UYGup5qxGdEMWkhP6BWCz053NUb2E1QoUTU16uA/edit#gid=783724593\n\n// Safari 6 and 6.1 for desktop, iPad, and iPhone are the only browsers that\n// have WebKitMutationObserver but not un-prefixed MutationObserver.\n// Must use `global` instead of `window` to work in both frames and web\n// workers. `global` is a provision of Browserify, Mr, Mrs, or Mop.\nvar BrowserMutationObserver = global.MutationObserver || global.WebKitMutationObserver;\n\n// MutationObservers are desirable because they have high priority and work\n// reliably everywhere they are implemented.\n// They are implemented in all modern browsers.\n//\n// - Android 4-4.3\n// - Chrome 26-34\n// - Firefox 14-29\n// - Internet Explorer 11\n// - iPad Safari 6-7.1\n// - iPhone Safari 7-7.1\n// - Safari 6-7\nif (typeof BrowserMutationObserver === \"function\") {\n requestFlush = makeRequestCallFromMutationObserver(flush);\n\n// MessageChannels are desirable because they give direct access to the HTML\n// task queue, are implemented in Internet Explorer 10, Safari 5.0-1, and Opera\n// 11-12, and in web workers in many engines.\n// Although message channels yield to any queued rendering and IO tasks, they\n// would be better than imposing the 4ms delay of timers.\n// However, they do not work reliably in Internet Explorer or Safari.\n\n// Internet Explorer 10 is the only browser that has setImmediate but does\n// not have MutationObservers.\n// Although setImmediate yields to the browser's renderer, it would be\n// preferrable to falling back to setTimeout since it does not have\n// the minimum 4ms penalty.\n// Unfortunately there appears to be a bug in Internet Explorer 10 Mobile (and\n// Desktop to a lesser extent) that renders both setImmediate and\n// MessageChannel useless for the purposes of ASAP.\n// https://github.com/kriskowal/q/issues/396\n\n// Timers are implemented universally.\n// We fall back to timers in workers in most engines, and in foreground\n// contexts in the following browsers.\n// However, note that even this simple case requires nuances to operate in a\n// broad spectrum of browsers.\n//\n// - Firefox 3-13\n// - Internet Explorer 6-9\n// - iPad Safari 4.3\n// - Lynx 2.8.7\n} else {\n requestFlush = makeRequestCallFromTimer(flush);\n}\n\n// `requestFlush` requests that the high priority event queue be flushed as\n// soon as possible.\n// This is useful to prevent an error thrown in a task from stalling the event\n// queue if the exception handled by Node.js’s\n// `process.on(\"uncaughtException\")` or by a domain.\nrawAsap.requestFlush = requestFlush;\n\n// To request a high priority event, we induce a mutation observer by toggling\n// the text of a text node between \"1\" and \"-1\".\nfunction makeRequestCallFromMutationObserver(callback) {\n var toggle = 1;\n var observer = new BrowserMutationObserver(callback);\n var node = document.createTextNode(\"\");\n observer.observe(node, {characterData: true});\n return function requestCall() {\n toggle = -toggle;\n node.data = toggle;\n };\n}\n\n// The message channel technique was discovered by Malte Ubl and was the\n// original foundation for this library.\n// http://www.nonblocking.io/2011/06/windownexttick.html\n\n// Safari 6.0.5 (at least) intermittently fails to create message ports on a\n// page's first load. Thankfully, this version of Safari supports\n// MutationObservers, so we don't need to fall back in that case.\n\n// function makeRequestCallFromMessageChannel(callback) {\n// var channel = new MessageChannel();\n// channel.port1.onmessage = callback;\n// return function requestCall() {\n// channel.port2.postMessage(0);\n// };\n// }\n\n// For reasons explained above, we are also unable to use `setImmediate`\n// under any circumstances.\n// Even if we were, there is another bug in Internet Explorer 10.\n// It is not sufficient to assign `setImmediate` to `requestFlush` because\n// `setImmediate` must be called *by name* and therefore must be wrapped in a\n// closure.\n// Never forget.\n\n// function makeRequestCallFromSetImmediate(callback) {\n// return function requestCall() {\n// setImmediate(callback);\n// };\n// }\n\n// Safari 6.0 has a problem where timers will get lost while the user is\n// scrolling. This problem does not impact ASAP because Safari 6.0 supports\n// mutation observers, so that implementation is used instead.\n// However, if we ever elect to use timers in Safari, the prevalent work-around\n// is to add a scroll event listener that calls for a flush.\n\n// `setTimeout` does not call the passed callback if the delay is less than\n// approximately 7 in web workers in Firefox 8 through 18, and sometimes not\n// even then.\n\nfunction makeRequestCallFromTimer(callback) {\n return function requestCall() {\n // We dispatch a timeout with a specified delay of 0 for engines that\n // can reliably accommodate that request. This will usually be snapped\n // to a 4 milisecond delay, but once we're flushing, there's no delay\n // between events.\n var timeoutHandle = setTimeout(handleTimer, 0);\n // However, since this timer gets frequently dropped in Firefox\n // workers, we enlist an interval handle that will try to fire\n // an event 20 times per second until it succeeds.\n var intervalHandle = setInterval(handleTimer, 50);\n\n function handleTimer() {\n // Whichever timer succeeds will cancel both timers and\n // execute the callback.\n clearTimeout(timeoutHandle);\n clearInterval(intervalHandle);\n callback();\n }\n };\n}\n\n// This is for `asap.js` only.\n// Its name will be periodically randomized to break any code that depends on\n// its existence.\nrawAsap.makeRequestCallFromTimer = makeRequestCallFromTimer;\n\n// ASAP was originally a nextTick shim included in Q. This was factored out\n// into this ASAP package. It was later adapted to RSVP which made further\n// amendments. These decisions, particularly to marginalize MessageChannel and\n// to capture the MutationObserver implementation in a closure, were integrated\n// back into ASAP proper.\n// https://github.com/tildeio/rsvp.js/blob/cddf7232546a9cf858524b75cde6f9edf72620a7/lib/rsvp/asap.js\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/asap/browser-raw.js\n ** module id = 6\n ** module chunks = 0\n **/","'use strict';\n\nvar extend = require('./extend');\n\nmodule.exports = function(parent, methods) {\n if (typeof parent !== 'function') {\n methods = parent;\n parent = Object;\n }\n\n var klass = function() {\n if (!this.initialize) return this;\n return this.initialize.apply(this, arguments) || this;\n };\n\n var bridge = function() {};\n bridge.prototype = parent.prototype;\n\n klass.prototype = new bridge();\n extend(klass.prototype, methods);\n\n return klass;\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/util/class.js\n ** module id = 7\n ** module chunks = 0\n **/","'use strict';\n\nmodule.exports = function(dest, source, overwrite) {\n if (!source) return dest;\n for (var key in source) {\n if (!source.hasOwnProperty(key)) continue;\n if (dest.hasOwnProperty(key) && overwrite === false) continue;\n if (dest[key] !== source[key])\n dest[key] = source[key];\n }\n return dest;\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/util/extend.js\n ** module id = 8\n ** module chunks = 0\n **/","'use strict';\n\nvar asap = require('asap');\n\nvar PENDING = 0,\n FULFILLED = 1,\n REJECTED = 2;\n\nvar RETURN = function(x) { return x },\n THROW = function(x) { throw x };\n\nvar Promise = function(task) {\n this._state = PENDING;\n this._onFulfilled = [];\n this._onRejected = [];\n\n if (typeof task !== 'function') return;\n var self = this;\n\n task(function(value) { fulfill(self, value) },\n function(reason) { reject(self, reason) });\n};\n\nPromise.prototype.then = function(onFulfilled, onRejected) {\n var next = new Promise();\n registerOnFulfilled(this, onFulfilled, next);\n registerOnRejected(this, onRejected, next);\n return next;\n};\n\nPromise.prototype.catch = function(onRejected) {\n return this.then(null, onRejected);\n};\n\nvar registerOnFulfilled = function(promise, onFulfilled, next) {\n if (typeof onFulfilled !== 'function') onFulfilled = RETURN;\n var handler = function(value) { invoke(onFulfilled, value, next) };\n\n if (promise._state === PENDING) {\n promise._onFulfilled.push(handler);\n } else if (promise._state === FULFILLED) {\n handler(promise._value);\n }\n};\n\nvar registerOnRejected = function(promise, onRejected, next) {\n if (typeof onRejected !== 'function') onRejected = THROW;\n var handler = function(reason) { invoke(onRejected, reason, next) };\n\n if (promise._state === PENDING) {\n promise._onRejected.push(handler);\n } else if (promise._state === REJECTED) {\n handler(promise._reason);\n }\n};\n\nvar invoke = function(fn, value, next) {\n asap(function() { _invoke(fn, value, next) });\n};\n\nvar _invoke = function(fn, value, next) {\n var outcome;\n\n try {\n outcome = fn(value);\n } catch (error) {\n return reject(next, error);\n }\n\n if (outcome === next) {\n reject(next, new TypeError('Recursive promise chain detected'));\n } else {\n fulfill(next, outcome);\n }\n};\n\nvar fulfill = function(promise, value) {\n var called = false, type, then;\n\n try {\n type = typeof value;\n then = value !== null && (type === 'function' || type === 'object') && value.then;\n\n if (typeof then !== 'function') return _fulfill(promise, value);\n\n then.call(value, function(v) {\n if (!(called ^ (called = true))) return;\n fulfill(promise, v);\n }, function(r) {\n if (!(called ^ (called = true))) return;\n reject(promise, r);\n });\n } catch (error) {\n if (!(called ^ (called = true))) return;\n reject(promise, error);\n }\n};\n\nvar _fulfill = function(promise, value) {\n if (promise._state !== PENDING) return;\n\n promise._state = FULFILLED;\n promise._value = value;\n promise._onRejected = [];\n\n var onFulfilled = promise._onFulfilled, fn;\n while (fn = onFulfilled.shift()) fn(value);\n};\n\nvar reject = function(promise, reason) {\n if (promise._state !== PENDING) return;\n\n promise._state = REJECTED;\n promise._reason = reason;\n promise._onFulfilled = [];\n\n var onRejected = promise._onRejected, fn;\n while (fn = onRejected.shift()) fn(reason);\n};\n\nPromise.resolve = Promise.accept = Promise.fulfill = function(value) {\n return new Promise(function(resolve, reject) { resolve(value) });\n};\n\nPromise.reject = function(reason) {\n return new Promise(function(resolve, reject) { reject(reason) });\n};\n\nPromise.all = function(promises) {\n return new Promise(function(resolve, reject) {\n var list = [], n = promises.length, i;\n\n if (n === 0) return resolve(list);\n\n for (i = 0; i < n; i++) (function(promise, i) {\n Promise.resolve(promise).then(function(value) {\n list[i] = value;\n if (--n === 0) resolve(list);\n }, reject);\n })(promises[i], i);\n });\n};\n\nPromise.race = function(promises) {\n return new Promise(function(resolve, reject) {\n for (var i = 0, n = promises.length; i < n; i++)\n Promise.resolve(promises[i]).then(resolve, reject);\n });\n};\n\nPromise.deferred = Promise.pending = function() {\n var tuple = {};\n\n tuple.promise = new Promise(function(resolve, reject) {\n tuple.fulfill = tuple.resolve = resolve;\n tuple.reject = reject;\n });\n return tuple;\n};\n\nmodule.exports = Promise;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/util/promise.js\n ** module id = 9\n ** module chunks = 0\n **/","'use strict';\n\nmodule.exports = {\n isURI: function(uri) {\n return uri && uri.protocol && uri.host && uri.path;\n },\n\n isSameOrigin: function(uri) {\n return uri.protocol === location.protocol &&\n uri.hostname === location.hostname &&\n uri.port === location.port;\n },\n\n parse: function(url) {\n if (typeof url !== 'string') return url;\n var uri = {}, parts, query, pairs, i, n, data;\n\n var consume = function(name, pattern) {\n url = url.replace(pattern, function(match) {\n uri[name] = match;\n return '';\n });\n uri[name] = uri[name] || '';\n };\n\n consume('protocol', /^[a-z]+\\:/i);\n consume('host', /^\\/\\/[^\\/\\?#]+/);\n\n if (!/^\\//.test(url) && !uri.host)\n url = location.pathname.replace(/[^\\/]*$/, '') + url;\n\n consume('pathname', /^[^\\?#]*/);\n consume('search', /^\\?[^#]*/);\n consume('hash', /^#.*/);\n\n uri.protocol = uri.protocol || location.protocol;\n\n if (uri.host) {\n uri.host = uri.host.substr(2);\n parts = uri.host.split(':');\n uri.hostname = parts[0];\n uri.port = parts[1] || '';\n } else {\n uri.host = location.host;\n uri.hostname = location.hostname;\n uri.port = location.port;\n }\n\n uri.pathname = uri.pathname || '/';\n uri.path = uri.pathname + uri.search;\n\n query = uri.search.replace(/^\\?/, '');\n pairs = query ? query.split('&') : [];\n data = {};\n\n for (i = 0, n = pairs.length; i < n; i++) {\n parts = pairs[i].split('=');\n data[decodeURIComponent(parts[0] || '')] = decodeURIComponent(parts[1] || '');\n }\n\n uri.query = data;\n\n uri.href = this.stringify(uri);\n return uri;\n },\n\n stringify: function(uri) {\n var string = uri.protocol + '//' + uri.hostname;\n if (uri.port) string += ':' + uri.port;\n string += uri.pathname + this.queryString(uri.query) + (uri.hash || '');\n return string;\n },\n\n queryString: function(query) {\n var pairs = [];\n for (var key in query) {\n if (!query.hasOwnProperty(key)) continue;\n pairs.push(encodeURIComponent(key) + '=' + encodeURIComponent(query[key]));\n }\n if (pairs.length === 0) return '';\n return '?' + pairs.join('&');\n }\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/util/uri.js\n ** module id = 10\n ** module chunks = 0\n **/","'use strict';\n\nmodule.exports = {\n commonElement: function(lista, listb) {\n for (var i = 0, n = lista.length; i < n; i++) {\n if (this.indexOf(listb, lista[i]) !== -1)\n return lista[i];\n }\n return null;\n },\n\n indexOf: function(list, needle) {\n if (list.indexOf) return list.indexOf(needle);\n\n for (var i = 0, n = list.length; i < n; i++) {\n if (list[i] === needle) return i;\n }\n return -1;\n },\n\n map: function(object, callback, context) {\n if (object.map) return object.map(callback, context);\n var result = [];\n\n if (object instanceof Array) {\n for (var i = 0, n = object.length; i < n; i++) {\n result.push(callback.call(context || null, object[i], i));\n }\n } else {\n for (var key in object) {\n if (!object.hasOwnProperty(key)) continue;\n result.push(callback.call(context || null, key, object[key]));\n }\n }\n return result;\n },\n\n filter: function(array, callback, context) {\n if (array.filter) return array.filter(callback, context);\n var result = [];\n for (var i = 0, n = array.length; i < n; i++) {\n if (callback.call(context || null, array[i], i))\n result.push(array[i]);\n }\n return result;\n },\n\n asyncEach: function(list, iterator, callback, context) {\n var n = list.length,\n i = -1,\n calls = 0,\n looping = false;\n\n var iterate = function() {\n calls -= 1;\n i += 1;\n if (i === n) return callback && callback.call(context);\n iterator(list[i], resume);\n };\n\n var loop = function() {\n if (looping) return;\n looping = true;\n while (calls > 0) iterate();\n looping = false;\n };\n\n var resume = function() {\n calls += 1;\n loop();\n };\n resume();\n }\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/util/array.js\n ** module id = 11\n ** module chunks = 0\n **/","'use strict';\n\nvar Event = {\n _registry: [],\n\n on: function(element, eventName, callback, context) {\n var wrapped = function() { callback.call(context) };\n\n if (element.addEventListener)\n element.addEventListener(eventName, wrapped, false);\n else\n element.attachEvent('on' + eventName, wrapped);\n\n this._registry.push({\n _element: element,\n _type: eventName,\n _callback: callback,\n _context: context,\n _handler: wrapped\n });\n },\n\n detach: function(element, eventName, callback, context) {\n var i = this._registry.length, register;\n while (i--) {\n register = this._registry[i];\n\n if ((element && element !== register._element) ||\n (eventName && eventName !== register._type) ||\n (callback && callback !== register._callback) ||\n (context && context !== register._context))\n continue;\n\n if (register._element.removeEventListener)\n register._element.removeEventListener(register._type, register._handler, false);\n else\n register._element.detachEvent('on' + register._type, register._handler);\n\n this._registry.splice(i,1);\n register = null;\n }\n }\n};\n\nif (global.onunload !== undefined)\n Event.on(global, 'unload', Event.detach, Event);\n\nmodule.exports = {\n Event: Event\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/util/browser/event.js\n ** module id = 12\n ** module chunks = 0\n **/","'use strict';\n\nvar array = require('./array');\n\nmodule.exports = function(options, validKeys) {\n for (var key in options) {\n if (array.indexOf(validKeys, key) < 0)\n throw new Error('Unrecognized option: ' + key);\n }\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/util/validate_options.js\n ** module id = 13\n ** module chunks = 0\n **/","'use strict';\n\nvar Promise = require('../util/promise');\n\nmodule.exports = {\n then: function(callback, errback) {\n var self = this;\n if (!this._promise)\n this._promise = new Promise(function(resolve, reject) {\n self._resolve = resolve;\n self._reject = reject;\n });\n\n if (arguments.length === 0)\n return this._promise;\n else\n return this._promise.then(callback, errback);\n },\n\n callback: function(callback, context) {\n return this.then(function(value) { callback.call(context, value) });\n },\n\n errback: function(callback, context) {\n return this.then(null, function(reason) { callback.call(context, reason) });\n },\n\n timeout: function(seconds, message) {\n this.then();\n var self = this;\n this._timer = global.setTimeout(function() {\n self._reject(message);\n }, seconds * 1000);\n },\n\n setDeferredStatus: function(status, value) {\n if (this._timer) global.clearTimeout(this._timer);\n\n this.then();\n\n if (status === 'succeeded')\n this._resolve(value);\n else if (status === 'failed')\n this._reject(value);\n else\n delete this._promise;\n }\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/mixins/deferrable.js\n ** module id = 14\n ** module chunks = 0\n **/","'use strict';\n\nvar extend = require('../util/extend'),\n EventEmitter = require('../util/event_emitter');\n\nvar Publisher = {\n countListeners: function(eventType) {\n return this.listeners(eventType).length;\n },\n\n bind: function(eventType, listener, context) {\n var slice = Array.prototype.slice,\n handler = function() { listener.apply(context, slice.call(arguments)) };\n\n this._listeners = this._listeners || [];\n this._listeners.push([eventType, listener, context, handler]);\n return this.on(eventType, handler);\n },\n\n unbind: function(eventType, listener, context) {\n this._listeners = this._listeners || [];\n var n = this._listeners.length, tuple;\n\n while (n--) {\n tuple = this._listeners[n];\n if (tuple[0] !== eventType) continue;\n if (listener && (tuple[1] !== listener || tuple[2] !== context)) continue;\n this._listeners.splice(n, 1);\n this.removeListener(eventType, tuple[3]);\n }\n }\n};\n\nextend(Publisher, EventEmitter.prototype);\nPublisher.trigger = Publisher.emit;\n\nmodule.exports = Publisher;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/mixins/publisher.js\n ** module id = 15\n ** module chunks = 0\n **/","/*\nCopyright Joyent, Inc. and other Node contributors. All rights reserved.\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n*/\n\nvar isArray = typeof Array.isArray === 'function'\n ? Array.isArray\n : function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]'\n }\n;\nfunction indexOf (xs, x) {\n if (xs.indexOf) return xs.indexOf(x);\n for (var i = 0; i < xs.length; i++) {\n if (x === xs[i]) return i;\n }\n return -1;\n}\n\nfunction EventEmitter() {}\nmodule.exports = EventEmitter;\n\nEventEmitter.prototype.emit = function(type) {\n // If there is no 'error' event listener then throw.\n if (type === 'error') {\n if (!this._events || !this._events.error ||\n (isArray(this._events.error) && !this._events.error.length))\n {\n if (arguments[1] instanceof Error) {\n throw arguments[1]; // Unhandled 'error' event\n } else {\n throw new Error(\"Uncaught, unspecified 'error' event.\");\n }\n return false;\n }\n }\n\n if (!this._events) return false;\n var handler = this._events[type];\n if (!handler) return false;\n\n if (typeof handler == 'function') {\n switch (arguments.length) {\n // fast cases\n case 1:\n handler.call(this);\n break;\n case 2:\n handler.call(this, arguments[1]);\n break;\n case 3:\n handler.call(this, arguments[1], arguments[2]);\n break;\n // slower\n default:\n var args = Array.prototype.slice.call(arguments, 1);\n handler.apply(this, args);\n }\n return true;\n\n } else if (isArray(handler)) {\n var args = Array.prototype.slice.call(arguments, 1);\n\n var listeners = handler.slice();\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i].apply(this, args);\n }\n return true;\n\n } else {\n return false;\n }\n};\n\n// EventEmitter is defined in src/node_events.cc\n// EventEmitter.prototype.emit() is also defined there.\nEventEmitter.prototype.addListener = function(type, listener) {\n if ('function' !== typeof listener) {\n throw new Error('addListener only takes instances of Function');\n }\n\n if (!this._events) this._events = {};\n\n // To avoid recursion in the case that type == \"newListeners\"! Before\n // adding it to the listeners, first emit \"newListeners\".\n this.emit('newListener', type, listener);\n\n if (!this._events[type]) {\n // Optimize the case of one listener. Don't need the extra array object.\n this._events[type] = listener;\n } else if (isArray(this._events[type])) {\n // If we've already got an array, just append.\n this._events[type].push(listener);\n } else {\n // Adding the second element, need to change to array.\n this._events[type] = [this._events[type], listener];\n }\n\n return this;\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.once = function(type, listener) {\n var self = this;\n self.on(type, function g() {\n self.removeListener(type, g);\n listener.apply(this, arguments);\n });\n\n return this;\n};\n\nEventEmitter.prototype.removeListener = function(type, listener) {\n if ('function' !== typeof listener) {\n throw new Error('removeListener only takes instances of Function');\n }\n\n // does not use listeners(), so no side effect of creating _events[type]\n if (!this._events || !this._events[type]) return this;\n\n var list = this._events[type];\n\n if (isArray(list)) {\n var i = indexOf(list, listener);\n if (i < 0) return this;\n list.splice(i, 1);\n if (list.length == 0)\n delete this._events[type];\n } else if (this._events[type] === listener) {\n delete this._events[type];\n }\n\n return this;\n};\n\nEventEmitter.prototype.removeAllListeners = function(type) {\n if (arguments.length === 0) {\n this._events = {};\n return this;\n }\n\n // does not use listeners(), so no side effect of creating _events[type]\n if (type && this._events && this._events[type]) this._events[type] = null;\n return this;\n};\n\nEventEmitter.prototype.listeners = function(type) {\n if (!this._events) this._events = {};\n if (!this._events[type]) this._events[type] = [];\n if (!isArray(this._events[type])) {\n this._events[type] = [this._events[type]];\n }\n return this._events[type];\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/util/event_emitter.js\n ** module id = 16\n ** module chunks = 0\n **/","'use strict';\n\nvar Class = require('../util/class'),\n extend = require('../util/extend'),\n Publisher = require('../mixins/publisher'),\n Grammar = require('./grammar');\n\nvar Channel = Class({\n initialize: function(name) {\n this.id = this.name = name;\n },\n\n push: function(message) {\n this.trigger('message', message);\n },\n\n isUnused: function() {\n return this.countListeners('message') === 0;\n }\n});\n\nextend(Channel.prototype, Publisher);\n\nextend(Channel, {\n HANDSHAKE: '/meta/handshake',\n CONNECT: '/meta/connect',\n SUBSCRIBE: '/meta/subscribe',\n UNSUBSCRIBE: '/meta/unsubscribe',\n DISCONNECT: '/meta/disconnect',\n\n META: 'meta',\n SERVICE: 'service',\n\n expand: function(name) {\n var segments = this.parse(name),\n channels = ['/**', name];\n\n var copy = segments.slice();\n copy[copy.length - 1] = '*';\n channels.push(this.unparse(copy));\n\n for (var i = 1, n = segments.length; i < n; i++) {\n copy = segments.slice(0, i);\n copy.push('**');\n channels.push(this.unparse(copy));\n }\n\n return channels;\n },\n\n isValid: function(name) {\n return Grammar.CHANNEL_NAME.test(name) ||\n Grammar.CHANNEL_PATTERN.test(name);\n },\n\n parse: function(name) {\n if (!this.isValid(name)) return null;\n return name.split('/').slice(1);\n },\n\n unparse: function(segments) {\n return '/' + segments.join('/');\n },\n\n isMeta: function(name) {\n var segments = this.parse(name);\n return segments ? (segments[0] === this.META) : null;\n },\n\n isService: function(name) {\n var segments = this.parse(name);\n return segments ? (segments[0] === this.SERVICE) : null;\n },\n\n isSubscribable: function(name) {\n if (!this.isValid(name)) return null;\n return !this.isMeta(name) && !this.isService(name);\n },\n\n Set: Class({\n initialize: function() {\n this._channels = {};\n },\n\n getKeys: function() {\n var keys = [];\n for (var key in this._channels) keys.push(key);\n return keys;\n },\n\n remove: function(name) {\n delete this._channels[name];\n },\n\n hasSubscription: function(name) {\n return this._channels.hasOwnProperty(name);\n },\n\n subscribe: function(names, subscription) {\n var name;\n for (var i = 0, n = names.length; i < n; i++) {\n name = names[i];\n var channel = this._channels[name] = this._channels[name] || new Channel(name);\n channel.bind('message', subscription);\n }\n },\n\n unsubscribe: function(name, subscription) {\n var channel = this._channels[name];\n if (!channel) return false;\n channel.unbind('message', subscription);\n\n if (channel.isUnused()) {\n this.remove(name);\n return true;\n } else {\n return false;\n }\n },\n\n distributeMessage: function(message) {\n var channels = Channel.expand(message.channel);\n\n for (var i = 0, n = channels.length; i < n; i++) {\n var channel = this._channels[channels[i]];\n if (channel) channel.trigger('message', message);\n }\n }\n })\n});\n\nmodule.exports = Channel;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/protocol/channel.js\n ** module id = 17\n ** module chunks = 0\n **/","'use strict';\n\nmodule.exports = {\n CHANNEL_NAME: /^\\/(((([a-z]|[A-Z])|[0-9])|(\\-|\\_|\\!|\\~|\\(|\\)|\\$|\\@)))+(\\/(((([a-z]|[A-Z])|[0-9])|(\\-|\\_|\\!|\\~|\\(|\\)|\\$|\\@)))+)*$/,\n CHANNEL_PATTERN: /^(\\/(((([a-z]|[A-Z])|[0-9])|(\\-|\\_|\\!|\\~|\\(|\\)|\\$|\\@)))+)*\\/\\*{1,2}$/,\n ERROR: /^([0-9][0-9][0-9]:(((([a-z]|[A-Z])|[0-9])|(\\-|\\_|\\!|\\~|\\(|\\)|\\$|\\@)| |\\/|\\*|\\.))*(,(((([a-z]|[A-Z])|[0-9])|(\\-|\\_|\\!|\\~|\\(|\\)|\\$|\\@)| |\\/|\\*|\\.))*)*:(((([a-z]|[A-Z])|[0-9])|(\\-|\\_|\\!|\\~|\\(|\\)|\\$|\\@)| |\\/|\\*|\\.))*|[0-9][0-9][0-9]::(((([a-z]|[A-Z])|[0-9])|(\\-|\\_|\\!|\\~|\\(|\\)|\\$|\\@)| |\\/|\\*|\\.))*)$/,\n VERSION: /^([0-9])+(\\.(([a-z]|[A-Z])|[0-9])(((([a-z]|[A-Z])|[0-9])|\\-|\\_))*)*$/\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/protocol/grammar.js\n ** module id = 18\n ** module chunks = 0\n **/","'use strict';\n\nvar Class = require('../util/class'),\n URI = require('../util/uri'),\n cookies = require('../util/cookies'),\n extend = require('../util/extend'),\n Logging = require('../mixins/logging'),\n Publisher = require('../mixins/publisher'),\n Transport = require('../transport'),\n Scheduler = require('./scheduler');\n\nvar Dispatcher = Class({ className: 'Dispatcher',\n MAX_REQUEST_SIZE: 2048,\n DEFAULT_RETRY: 5,\n\n UP: 1,\n DOWN: 2,\n\n initialize: function(client, endpoint, options) {\n this._client = client;\n this.endpoint = URI.parse(endpoint);\n this._alternates = options.endpoints || {};\n\n this.cookies = cookies.CookieJar && new cookies.CookieJar();\n this._disabled = [];\n this._envelopes = {};\n this.headers = {};\n this.retry = options.retry || this.DEFAULT_RETRY;\n this._scheduler = options.scheduler || Scheduler;\n this._state = 0;\n this.transports = {};\n this.wsExtensions = [];\n\n this.proxy = options.proxy || {};\n if (typeof this._proxy === 'string') this._proxy = {origin: this._proxy};\n\n var exts = options.websocketExtensions;\n if (exts) {\n exts = [].concat(exts);\n for (var i = 0, n = exts.length; i < n; i++)\n this.addWebsocketExtension(exts[i]);\n }\n\n this.tls = options.tls || {};\n this.tls.ca = this.tls.ca || options.ca;\n\n for (var type in this._alternates)\n this._alternates[type] = URI.parse(this._alternates[type]);\n\n this.maxRequestSize = this.MAX_REQUEST_SIZE;\n },\n\n endpointFor: function(connectionType) {\n return this._alternates[connectionType] || this.endpoint;\n },\n\n addWebsocketExtension: function(extension) {\n this.wsExtensions.push(extension);\n },\n\n disable: function(feature) {\n this._disabled.push(feature);\n },\n\n setHeader: function(name, value) {\n this.headers[name] = value;\n },\n\n close: function() {\n var transport = this._transport;\n delete this._transport;\n if (transport) transport.close();\n },\n\n getConnectionTypes: function() {\n return Transport.getConnectionTypes();\n },\n\n selectTransport: function(transportTypes) {\n Transport.get(this, transportTypes, this._disabled, function(transport) {\n this.debug('Selected ? transport for ?', transport.connectionType, URI.stringify(transport.endpoint));\n\n if (transport === this._transport) return;\n if (this._transport) this._transport.close();\n\n this._transport = transport;\n this.connectionType = transport.connectionType;\n }, this);\n },\n\n sendMessage: function(message, timeout, options) {\n options = options || {};\n\n var id = message.id,\n attempts = options.attempts,\n deadline = options.deadline && new Date().getTime() + (options.deadline * 1000),\n envelope = this._envelopes[id],\n scheduler;\n\n if (!envelope) {\n scheduler = new this._scheduler(message, {timeout: timeout, interval: this.retry, attempts: attempts, deadline: deadline});\n envelope = this._envelopes[id] = {message: message, scheduler: scheduler};\n }\n\n this._sendEnvelope(envelope);\n },\n\n _sendEnvelope: function(envelope) {\n if (!this._transport) return;\n if (envelope.request || envelope.timer) return;\n\n var message = envelope.message,\n scheduler = envelope.scheduler,\n self = this;\n\n if (!scheduler.isDeliverable()) {\n scheduler.abort();\n delete this._envelopes[message.id];\n return;\n }\n\n envelope.timer = global.setTimeout(function() {\n self.handleError(message);\n }, scheduler.getTimeout() * 1000);\n\n scheduler.send();\n envelope.request = this._transport.sendMessage(message);\n },\n\n handleResponse: function(reply) {\n var envelope = this._envelopes[reply.id];\n\n if (reply.successful !== undefined && envelope) {\n envelope.scheduler.succeed();\n delete this._envelopes[reply.id];\n global.clearTimeout(envelope.timer);\n }\n\n this.trigger('message', reply);\n\n if (this._state === this.UP) return;\n this._state = this.UP;\n this._client.trigger('transport:up');\n },\n\n handleError: function(message, immediate) {\n var envelope = this._envelopes[message.id],\n request = envelope && envelope.request,\n self = this;\n\n if (!request) return;\n\n request.then(function(req) {\n if (req && req.abort) req.abort();\n });\n\n var scheduler = envelope.scheduler;\n scheduler.fail();\n\n global.clearTimeout(envelope.timer);\n envelope.request = envelope.timer = null;\n\n if (immediate) {\n this._sendEnvelope(envelope);\n } else {\n envelope.timer = global.setTimeout(function() {\n envelope.timer = null;\n self._sendEnvelope(envelope);\n }, scheduler.getInterval() * 1000);\n }\n\n if (this._state === this.DOWN) return;\n this._state = this.DOWN;\n this._client.trigger('transport:down');\n }\n});\n\nDispatcher.create = function(client, endpoint, options) {\n return new Dispatcher(client, endpoint, options);\n};\n\nextend(Dispatcher.prototype, Publisher);\nextend(Dispatcher.prototype, Logging);\n\nmodule.exports = Dispatcher;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/protocol/dispatcher.js\n ** module id = 19\n ** module chunks = 0\n **/","'use strict';\n\nmodule.exports = {};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/util/cookies/browser_cookies.js\n ** module id = 20\n ** module chunks = 0\n **/","'use strict';\n\nvar Transport = require('./transport');\n\nTransport.register('websocket', require('./web_socket'));\nTransport.register('eventsource', require('./event_source'));\nTransport.register('long-polling', require('./xhr'));\nTransport.register('cross-origin-long-polling', require('./cors'));\nTransport.register('callback-polling', require('./jsonp'));\n\nmodule.exports = Transport;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/transport/browser_transports.js\n ** module id = 21\n ** module chunks = 0\n **/","'use strict';\n\nvar Class = require('../util/class'),\n Cookie = require('../util/cookies').Cookie,\n Promise = require('../util/promise'),\n URI = require('../util/uri'),\n array = require('../util/array'),\n extend = require('../util/extend'),\n Logging = require('../mixins/logging'),\n Timeouts = require('../mixins/timeouts'),\n Channel = require('../protocol/channel');\n\nvar Transport = extend(Class({ className: 'Transport',\n DEFAULT_PORTS: {'http:': 80, 'https:': 443, 'ws:': 80, 'wss:': 443},\n SECURE_PROTOCOLS: ['https:', 'wss:'],\n MAX_DELAY: 0,\n\n batching: true,\n\n initialize: function(dispatcher, endpoint) {\n this._dispatcher = dispatcher;\n this.endpoint = endpoint;\n this._outbox = [];\n this._proxy = extend({}, this._dispatcher.proxy);\n\n if (!this._proxy.origin && typeof process !== 'undefined') {\n this._proxy.origin = array.indexOf(this.SECURE_PROTOCOLS, this.endpoint.protocol) >= 0\n ? (process.env.HTTPS_PROXY || process.env.https_proxy)\n : (process.env.HTTP_PROXY || process.env.http_proxy);\n }\n },\n\n close: function() {},\n\n encode: function(messages) {\n return '';\n },\n\n sendMessage: function(message) {\n this.debug('Client ? sending message to ?: ?',\n this._dispatcher.clientId, URI.stringify(this.endpoint), message);\n\n if (!this.batching) return Promise.resolve(this.request([message]));\n\n this._outbox.push(message);\n this._flushLargeBatch();\n\n if (message.channel === Channel.HANDSHAKE)\n return this._publish(0.01);\n\n if (message.channel === Channel.CONNECT)\n this._connectMessage = message;\n\n return this._publish(this.MAX_DELAY);\n },\n\n _makePromise: function() {\n var self = this;\n\n this._requestPromise = this._requestPromise || new Promise(function(resolve) {\n self._resolvePromise = resolve;\n });\n },\n\n _publish: function(delay) {\n this._makePromise();\n\n this.addTimeout('publish', delay, function() {\n this._flush();\n delete this._requestPromise;\n }, this);\n\n return this._requestPromise;\n },\n\n _flush: function() {\n this.removeTimeout('publish');\n\n if (this._outbox.length > 1 && this._connectMessage)\n this._connectMessage.advice = {timeout: 0};\n\n this._resolvePromise(this.request(this._outbox));\n\n this._connectMessage = null;\n this._outbox = [];\n },\n\n _flushLargeBatch: function() {\n var string = this.encode(this._outbox);\n if (string.length < this._dispatcher.maxRequestSize) return;\n var last = this._outbox.pop();\n\n this._makePromise();\n this._flush();\n\n if (last) this._outbox.push(last);\n },\n\n _receive: function(replies) {\n if (!replies) return;\n replies = [].concat(replies);\n\n this.debug('Client ? received from ? via ?: ?',\n this._dispatcher.clientId, URI.stringify(this.endpoint), this.connectionType, replies);\n\n for (var i = 0, n = replies.length; i < n; i++)\n this._dispatcher.handleResponse(replies[i]);\n },\n\n _handleError: function(messages, immediate) {\n messages = [].concat(messages);\n\n this.debug('Client ? failed to send to ? via ?: ?',\n this._dispatcher.clientId, URI.stringify(this.endpoint), this.connectionType, messages);\n\n for (var i = 0, n = messages.length; i < n; i++)\n this._dispatcher.handleError(messages[i]);\n },\n\n _getCookies: function() {\n var cookies = this._dispatcher.cookies,\n url = URI.stringify(this.endpoint);\n\n if (!cookies) return '';\n\n return array.map(cookies.getCookiesSync(url), function(cookie) {\n return cookie.cookieString();\n }).join('; ');\n },\n\n _storeCookies: function(setCookie) {\n var cookies = this._dispatcher.cookies,\n url = URI.stringify(this.endpoint),\n cookie;\n\n if (!setCookie || !cookies) return;\n setCookie = [].concat(setCookie);\n\n for (var i = 0, n = setCookie.length; i < n; i++) {\n cookie = Cookie.parse(setCookie[i]);\n cookies.setCookieSync(cookie, url);\n }\n }\n\n}), {\n get: function(dispatcher, allowed, disabled, callback, context) {\n var endpoint = dispatcher.endpoint;\n\n array.asyncEach(this._transports, function(pair, resume) {\n var connType = pair[0], klass = pair[1],\n connEndpoint = dispatcher.endpointFor(connType);\n\n if (array.indexOf(disabled, connType) >= 0)\n return resume();\n\n if (array.indexOf(allowed, connType) < 0) {\n klass.isUsable(dispatcher, connEndpoint, function() {});\n return resume();\n }\n\n klass.isUsable(dispatcher, connEndpoint, function(isUsable) {\n if (!isUsable) return resume();\n var transport = klass.hasOwnProperty('create') ? klass.create(dispatcher, connEndpoint) : new klass(dispatcher, connEndpoint);\n callback.call(context, transport);\n });\n }, function() {\n throw new Error('Could not find a usable connection type for ' + URI.stringify(endpoint));\n });\n },\n\n register: function(type, klass) {\n this._transports.push([type, klass]);\n klass.prototype.connectionType = type;\n },\n\n getConnectionTypes: function() {\n return array.map(this._transports, function(t) { return t[0] });\n },\n\n _transports: []\n});\n\nextend(Transport.prototype, Logging);\nextend(Transport.prototype, Timeouts);\n\nmodule.exports = Transport;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/transport/transport.js\n ** module id = 22\n ** module chunks = 0\n **/","'use strict';\n\nmodule.exports = {\n addTimeout: function(name, delay, callback, context) {\n this._timeouts = this._timeouts || {};\n if (this._timeouts.hasOwnProperty(name)) return;\n var self = this;\n this._timeouts[name] = global.setTimeout(function() {\n delete self._timeouts[name];\n callback.call(context);\n }, 1000 * delay);\n },\n\n removeTimeout: function(name) {\n this._timeouts = this._timeouts || {};\n var timeout = this._timeouts[name];\n if (!timeout) return;\n global.clearTimeout(timeout);\n delete this._timeouts[name];\n },\n\n removeAllTimeouts: function() {\n this._timeouts = this._timeouts || {};\n for (var name in this._timeouts) this.removeTimeout(name);\n }\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/mixins/timeouts.js\n ** module id = 23\n ** module chunks = 0\n **/","'use strict';\n\nvar Class = require('../util/class'),\n Promise = require('../util/promise'),\n Set = require('../util/set'),\n URI = require('../util/uri'),\n browser = require('../util/browser'),\n copyObject = require('../util/copy_object'),\n extend = require('../util/extend'),\n toJSON = require('../util/to_json'),\n ws = require('../util/websocket'),\n Deferrable = require('../mixins/deferrable'),\n Transport = require('./transport');\n\nvar WebSocket = extend(Class(Transport, {\n UNCONNECTED: 1,\n CONNECTING: 2,\n CONNECTED: 3,\n\n batching: false,\n\n isUsable: function(callback, context) {\n this.callback(function() { callback.call(context, true) });\n this.errback(function() { callback.call(context, false) });\n this.connect();\n },\n\n request: function(messages) {\n this._pending = this._pending || new Set();\n for (var i = 0, n = messages.length; i < n; i++) this._pending.add(messages[i]);\n\n var self = this;\n\n var promise = new Promise(function(resolve, reject) {\n self.callback(function(socket) {\n if (!socket || socket.readyState !== 1) return;\n socket.send(toJSON(messages));\n resolve(socket);\n });\n\n self.connect();\n });\n\n return {\n abort: function() { promise.then(function(ws) { ws.close() }) }\n };\n },\n\n connect: function() {\n if (WebSocket._unloaded) return;\n\n this._state = this._state || this.UNCONNECTED;\n if (this._state !== this.UNCONNECTED) return;\n this._state = this.CONNECTING;\n\n var socket = this._createSocket();\n if (!socket) return this.setDeferredStatus('failed');\n\n var self = this;\n\n socket.onopen = function() {\n if (socket.headers) self._storeCookies(socket.headers['set-cookie']);\n self._socket = socket;\n self._state = self.CONNECTED;\n self._everConnected = true;\n self._ping();\n self.setDeferredStatus('succeeded', socket);\n };\n\n var closed = false;\n socket.onclose = socket.onerror = function() {\n if (closed) return;\n closed = true;\n\n var wasConnected = (self._state === self.CONNECTED);\n socket.onopen = socket.onclose = socket.onerror = socket.onmessage = null;\n\n delete self._socket;\n self._state = self.UNCONNECTED;\n self.removeTimeout('ping');\n\n var pending = self._pending ? self._pending.toArray() : [];\n delete self._pending;\n\n if (wasConnected || self._everConnected) {\n self.setDeferredStatus('unknown');\n self._handleError(pending, wasConnected);\n } else {\n self.setDeferredStatus('failed');\n }\n };\n\n socket.onmessage = function(event) {\n var replies;\n try { replies = JSON.parse(event.data) } catch (error) {}\n\n if (!replies) return;\n\n replies = [].concat(replies);\n\n for (var i = 0, n = replies.length; i < n; i++) {\n if (replies[i].successful === undefined) continue;\n self._pending.remove(replies[i]);\n }\n self._receive(replies);\n };\n },\n\n close: function() {\n if (!this._socket) return;\n this._socket.close();\n },\n\n _createSocket: function() {\n var url = WebSocket.getSocketUrl(this.endpoint),\n headers = this._dispatcher.headers,\n extensions = this._dispatcher.wsExtensions,\n cookie = this._getCookies(),\n tls = this._dispatcher.tls,\n options = {extensions: extensions, headers: headers, proxy: this._proxy, tls: tls};\n\n if (cookie !== '') options.headers['Cookie'] = cookie;\n\n return ws.create(url, [], options);\n },\n\n _ping: function() {\n if (!this._socket || this._socket.readyState !== 1) return;\n this._socket.send('[]');\n this.addTimeout('ping', this._dispatcher.timeout / 2, this._ping, this);\n }\n\n}), {\n PROTOCOLS: {\n 'http:': 'ws:',\n 'https:': 'wss:'\n },\n\n create: function(dispatcher, endpoint) {\n var sockets = dispatcher.transports.websocket = dispatcher.transports.websocket || {};\n sockets[endpoint.href] = sockets[endpoint.href] || new this(dispatcher, endpoint);\n return sockets[endpoint.href];\n },\n\n getSocketUrl: function(endpoint) {\n endpoint = copyObject(endpoint);\n endpoint.protocol = this.PROTOCOLS[endpoint.protocol];\n return URI.stringify(endpoint);\n },\n\n isUsable: function(dispatcher, endpoint, callback, context) {\n this.create(dispatcher, endpoint).isUsable(callback, context);\n }\n});\n\nextend(WebSocket.prototype, Deferrable);\n\nif (browser.Event && global.onbeforeunload !== undefined)\n browser.Event.on(global, 'beforeunload', function() { WebSocket._unloaded = true });\n\nmodule.exports = WebSocket;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/transport/web_socket.js\n ** module id = 24\n ** module chunks = 0\n **/","'use strict';\n\nvar Class = require('./class');\n\nmodule.exports = Class({\n initialize: function() {\n this._index = {};\n },\n\n add: function(item) {\n var key = (item.id !== undefined) ? item.id : item;\n if (this._index.hasOwnProperty(key)) return false;\n this._index[key] = item;\n return true;\n },\n\n forEach: function(block, context) {\n for (var key in this._index) {\n if (this._index.hasOwnProperty(key))\n block.call(context, this._index[key]);\n }\n },\n\n isEmpty: function() {\n for (var key in this._index) {\n if (this._index.hasOwnProperty(key)) return false;\n }\n return true;\n },\n\n member: function(item) {\n for (var key in this._index) {\n if (this._index[key] === item) return true;\n }\n return false;\n },\n\n remove: function(item) {\n var key = (item.id !== undefined) ? item.id : item;\n var removed = this._index[key];\n delete this._index[key];\n return removed;\n },\n\n toArray: function() {\n var array = [];\n this.forEach(function(item) { array.push(item) });\n return array;\n }\n});\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/util/set.js\n ** module id = 25\n ** module chunks = 0\n **/","'use strict';\n\nvar copyObject = function(object) {\n var clone, i, key;\n if (object instanceof Array) {\n clone = [];\n i = object.length;\n while (i--) clone[i] = copyObject(object[i]);\n return clone;\n } else if (typeof object === 'object') {\n clone = (object === null) ? null : {};\n for (key in object) clone[key] = copyObject(object[key]);\n return clone;\n } else {\n return object;\n }\n};\n\nmodule.exports = copyObject;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/util/copy_object.js\n ** module id = 26\n ** module chunks = 0\n **/","'use strict';\n\nvar WS = global.MozWebSocket || global.WebSocket;\n\nmodule.exports = {\n create: function(url, protocols, options) {\n return new WS(url);\n }\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/util/websocket/browser_websocket.js\n ** module id = 27\n ** module chunks = 0\n **/","'use strict';\n\nvar Class = require('../util/class'),\n URI = require('../util/uri'),\n copyObject = require('../util/copy_object'),\n extend = require('../util/extend'),\n Deferrable = require('../mixins/deferrable'),\n Transport = require('./transport'),\n XHR = require('./xhr');\n\nvar EventSource = extend(Class(Transport, {\n initialize: function(dispatcher, endpoint) {\n Transport.prototype.initialize.call(this, dispatcher, endpoint);\n if (!global.EventSource) return this.setDeferredStatus('failed');\n\n this._xhr = new XHR(dispatcher, endpoint);\n\n endpoint = copyObject(endpoint);\n endpoint.pathname += '/' + dispatcher.clientId;\n\n var socket = new global.EventSource(URI.stringify(endpoint)),\n self = this;\n\n socket.onopen = function() {\n self._everConnected = true;\n self.setDeferredStatus('succeeded');\n };\n\n socket.onerror = function() {\n if (self._everConnected) {\n self._handleError([]);\n } else {\n self.setDeferredStatus('failed');\n socket.close();\n }\n };\n\n socket.onmessage = function(event) {\n var replies;\n try { replies = JSON.parse(event.data) } catch (error) {}\n\n if (replies)\n self._receive(replies);\n else\n self._handleError([]);\n };\n\n this._socket = socket;\n },\n\n close: function() {\n if (!this._socket) return;\n this._socket.onopen = this._socket.onerror = this._socket.onmessage = null;\n this._socket.close();\n delete this._socket;\n },\n\n isUsable: function(callback, context) {\n this.callback(function() { callback.call(context, true) });\n this.errback(function() { callback.call(context, false) });\n },\n\n encode: function(messages) {\n return this._xhr.encode(messages);\n },\n\n request: function(messages) {\n return this._xhr.request(messages);\n }\n\n}), {\n isUsable: function(dispatcher, endpoint, callback, context) {\n var id = dispatcher.clientId;\n if (!id) return callback.call(context, false);\n\n XHR.isUsable(dispatcher, endpoint, function(usable) {\n if (!usable) return callback.call(context, false);\n this.create(dispatcher, endpoint).isUsable(callback, context);\n }, this);\n },\n\n create: function(dispatcher, endpoint) {\n var sockets = dispatcher.transports.eventsource = dispatcher.transports.eventsource || {},\n id = dispatcher.clientId;\n\n var url = copyObject(endpoint);\n url.pathname += '/' + (id || '');\n url = URI.stringify(url);\n\n sockets[url] = sockets[url] || new this(dispatcher, endpoint);\n return sockets[url];\n }\n});\n\nextend(EventSource.prototype, Deferrable);\n\nmodule.exports = EventSource;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/transport/event_source.js\n ** module id = 28\n ** module chunks = 0\n **/","'use strict';\n\nvar Class = require('../util/class'),\n URI = require('../util/uri'),\n browser = require('../util/browser'),\n extend = require('../util/extend'),\n toJSON = require('../util/to_json'),\n Transport = require('./transport');\n\nvar XHR = extend(Class(Transport, {\n encode: function(messages) {\n return toJSON(messages);\n },\n\n request: function(messages) {\n var href = this.endpoint.href,\n self = this,\n xhr;\n\n // Prefer XMLHttpRequest over ActiveXObject if they both exist\n if (global.XMLHttpRequest) {\n xhr = new XMLHttpRequest();\n } else if (global.ActiveXObject) {\n xhr = new ActiveXObject('Microsoft.XMLHTTP');\n } else {\n return this._handleError(messages);\n }\n\n xhr.open('POST', href, true);\n xhr.setRequestHeader('Content-Type', 'application/json');\n xhr.setRequestHeader('Pragma', 'no-cache');\n xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n\n var headers = this._dispatcher.headers;\n for (var key in headers) {\n if (!headers.hasOwnProperty(key)) continue;\n xhr.setRequestHeader(key, headers[key]);\n }\n\n var abort = function() { xhr.abort() };\n if (global.onbeforeunload !== undefined)\n browser.Event.on(global, 'beforeunload', abort);\n\n xhr.onreadystatechange = function() {\n if (!xhr || xhr.readyState !== 4) return;\n\n var replies = null,\n status = xhr.status,\n text = xhr.responseText,\n successful = (status >= 200 && status < 300) || status === 304 || status === 1223;\n\n if (global.onbeforeunload !== undefined)\n browser.Event.detach(global, 'beforeunload', abort);\n\n xhr.onreadystatechange = function() {};\n xhr = null;\n\n if (!successful) return self._handleError(messages);\n\n try {\n replies = JSON.parse(text);\n } catch (error) {}\n\n if (replies)\n self._receive(replies);\n else\n self._handleError(messages);\n };\n\n xhr.send(this.encode(messages));\n return xhr;\n }\n}), {\n isUsable: function(dispatcher, endpoint, callback, context) {\n var usable = (navigator.product === 'ReactNative')\n || URI.isSameOrigin(endpoint);\n\n callback.call(context, usable);\n }\n});\n\nmodule.exports = XHR;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/transport/xhr.js\n ** module id = 29\n ** module chunks = 0\n **/","'use strict';\n\nvar Class = require('../util/class'),\n Set = require('../util/set'),\n URI = require('../util/uri'),\n extend = require('../util/extend'),\n toJSON = require('../util/to_json'),\n Transport = require('./transport');\n\nvar CORS = extend(Class(Transport, {\n encode: function(messages) {\n return 'message=' + encodeURIComponent(toJSON(messages));\n },\n\n request: function(messages) {\n var xhrClass = global.XDomainRequest ? XDomainRequest : XMLHttpRequest,\n xhr = new xhrClass(),\n id = ++CORS._id,\n headers = this._dispatcher.headers,\n self = this,\n key;\n\n xhr.open('POST', URI.stringify(this.endpoint), true);\n\n if (xhr.setRequestHeader) {\n xhr.setRequestHeader('Pragma', 'no-cache');\n for (key in headers) {\n if (!headers.hasOwnProperty(key)) continue;\n xhr.setRequestHeader(key, headers[key]);\n }\n }\n\n var cleanUp = function() {\n if (!xhr) return false;\n CORS._pending.remove(id);\n xhr.onload = xhr.onerror = xhr.ontimeout = xhr.onprogress = null;\n xhr = null;\n };\n\n xhr.onload = function() {\n var replies;\n try { replies = JSON.parse(xhr.responseText) } catch (error) {}\n\n cleanUp();\n\n if (replies)\n self._receive(replies);\n else\n self._handleError(messages);\n };\n\n xhr.onerror = xhr.ontimeout = function() {\n cleanUp();\n self._handleError(messages);\n };\n\n xhr.onprogress = function() {};\n\n if (xhrClass === global.XDomainRequest)\n CORS._pending.add({id: id, xhr: xhr});\n\n xhr.send(this.encode(messages));\n return xhr;\n }\n}), {\n _id: 0,\n _pending: new Set(),\n\n isUsable: function(dispatcher, endpoint, callback, context) {\n if (URI.isSameOrigin(endpoint))\n return callback.call(context, false);\n\n if (global.XDomainRequest)\n return callback.call(context, endpoint.protocol === location.protocol);\n\n if (global.XMLHttpRequest) {\n var xhr = new XMLHttpRequest();\n return callback.call(context, xhr.withCredentials !== undefined);\n }\n return callback.call(context, false);\n }\n});\n\nmodule.exports = CORS;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/transport/cors.js\n ** module id = 30\n ** module chunks = 0\n **/","'use strict';\n\nvar Class = require('../util/class'),\n URI = require('../util/uri'),\n copyObject = require('../util/copy_object'),\n extend = require('../util/extend'),\n toJSON = require('../util/to_json'),\n Transport = require('./transport');\n\nvar JSONP = extend(Class(Transport, {\n encode: function(messages) {\n var url = copyObject(this.endpoint);\n url.query.message = toJSON(messages);\n url.query.jsonp = '__jsonp' + JSONP._cbCount + '__';\n return URI.stringify(url);\n },\n\n request: function(messages) {\n var head = document.getElementsByTagName('head')[0],\n script = document.createElement('script'),\n callbackName = JSONP.getCallbackName(),\n endpoint = copyObject(this.endpoint),\n self = this;\n\n endpoint.query.message = toJSON(messages);\n endpoint.query.jsonp = callbackName;\n\n var cleanup = function() {\n if (!global[callbackName]) return false;\n global[callbackName] = undefined;\n try { delete global[callbackName] } catch (error) {}\n script.parentNode.removeChild(script);\n };\n\n global[callbackName] = function(replies) {\n cleanup();\n self._receive(replies);\n };\n\n script.type = 'text/javascript';\n script.src = URI.stringify(endpoint);\n head.appendChild(script);\n\n script.onerror = function() {\n cleanup();\n self._handleError(messages);\n };\n\n return {abort: cleanup};\n }\n}), {\n _cbCount: 0,\n\n getCallbackName: function() {\n this._cbCount += 1;\n return '__jsonp' + this._cbCount + '__';\n },\n\n isUsable: function(dispatcher, endpoint, callback, context) {\n callback.call(context, true);\n }\n});\n\nmodule.exports = JSONP;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/transport/jsonp.js\n ** module id = 31\n ** module chunks = 0\n **/","'use strict';\n\nvar extend = require('../util/extend');\n\nvar Scheduler = function(message, options) {\n this.message = message;\n this.options = options;\n this.attempts = 0;\n};\n\nextend(Scheduler.prototype, {\n getTimeout: function() {\n return this.options.timeout;\n },\n\n getInterval: function() {\n return this.options.interval;\n },\n\n isDeliverable: function() {\n var attempts = this.options.attempts,\n made = this.attempts,\n deadline = this.options.deadline,\n now = new Date().getTime();\n\n if (attempts !== undefined && made >= attempts)\n return false;\n\n if (deadline !== undefined && now > deadline)\n return false;\n\n return true;\n },\n\n send: function() {\n this.attempts += 1;\n },\n\n succeed: function() {},\n\n fail: function() {},\n\n abort: function() {}\n});\n\nmodule.exports = Scheduler;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/protocol/scheduler.js\n ** module id = 32\n ** module chunks = 0\n **/","'use strict';\n\nvar Class = require('../util/class'),\n Grammar = require('./grammar');\n\nvar Error = Class({\n initialize: function(code, params, message) {\n this.code = code;\n this.params = Array.prototype.slice.call(params);\n this.message = message;\n },\n\n toString: function() {\n return this.code + ':' +\n this.params.join(',') + ':' +\n this.message;\n }\n});\n\nError.parse = function(message) {\n message = message || '';\n if (!Grammar.ERROR.test(message)) return new Error(null, [], message);\n\n var parts = message.split(':'),\n code = parseInt(parts[0]),\n params = parts[1].split(','),\n message = parts[2];\n\n return new Error(code, params, message);\n};\n\n// http://code.google.com/p/cometd/wiki/BayeuxCodes\nvar errors = {\n versionMismatch: [300, 'Version mismatch'],\n conntypeMismatch: [301, 'Connection types not supported'],\n extMismatch: [302, 'Extension mismatch'],\n badRequest: [400, 'Bad request'],\n clientUnknown: [401, 'Unknown client'],\n parameterMissing: [402, 'Missing required parameter'],\n channelForbidden: [403, 'Forbidden channel'],\n channelUnknown: [404, 'Unknown channel'],\n channelInvalid: [405, 'Invalid channel'],\n extUnknown: [406, 'Unknown extension'],\n publishFailed: [407, 'Failed to publish'],\n serverError: [500, 'Internal server error']\n};\n\nfor (var name in errors)\n (function(name) {\n Error[name] = function() {\n return new Error(errors[name][0], arguments, errors[name][1]).toString();\n };\n })(name);\n\nmodule.exports = Error;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/protocol/error.js\n ** module id = 33\n ** module chunks = 0\n **/","'use strict';\n\nvar extend = require('../util/extend'),\n Logging = require('../mixins/logging');\n\nvar Extensible = {\n addExtension: function(extension) {\n this._extensions = this._extensions || [];\n this._extensions.push(extension);\n if (extension.added) extension.added(this);\n },\n\n removeExtension: function(extension) {\n if (!this._extensions) return;\n var i = this._extensions.length;\n while (i--) {\n if (this._extensions[i] !== extension) continue;\n this._extensions.splice(i,1);\n if (extension.removed) extension.removed(this);\n }\n },\n\n pipeThroughExtensions: function(stage, message, request, callback, context) {\n this.debug('Passing through ? extensions: ?', stage, message);\n\n if (!this._extensions) return callback.call(context, message);\n var extensions = this._extensions.slice();\n\n var pipe = function(message) {\n if (!message) return callback.call(context, message);\n\n var extension = extensions.shift();\n if (!extension) return callback.call(context, message);\n\n var fn = extension[stage];\n if (!fn) return pipe(message);\n\n if (fn.length >= 3) extension[stage](message, request, pipe);\n else extension[stage](message, pipe);\n };\n pipe(message);\n }\n};\n\nextend(Extensible, Logging);\n\nmodule.exports = Extensible;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/protocol/extensible.js\n ** module id = 34\n ** module chunks = 0\n **/","'use strict';\n\nvar Class = require('../util/class'),\n Deferrable = require('../mixins/deferrable');\n\nmodule.exports = Class(Deferrable);\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/protocol/publication.js\n ** module id = 35\n ** module chunks = 0\n **/","'use strict';\n\nvar Class = require('../util/class'),\n extend = require('../util/extend'),\n Deferrable = require('../mixins/deferrable');\n\nvar Subscription = Class({\n initialize: function(client, channels, callback, context) {\n this._client = client;\n this._channels = channels;\n this._callback = callback;\n this._context = context;\n this._cancelled = false;\n },\n\n withChannel: function(callback, context) {\n this._withChannel = [callback, context];\n return this;\n },\n\n apply: function(context, args) {\n var message = args[0];\n\n if (this._callback)\n this._callback.call(this._context, message.data);\n\n if (this._withChannel)\n this._withChannel[0].call(this._withChannel[1], message.channel, message.data);\n },\n\n cancel: function() {\n if (this._cancelled) return;\n this._client.unsubscribe(this._channels, this);\n this._cancelled = true;\n },\n\n unsubscribe: function() {\n this.cancel();\n }\n});\n\nextend(Subscription.prototype, Deferrable);\n\nmodule.exports = Subscription;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/protocol/subscription.js\n ** module id = 36\n ** module chunks = 0\n **/"]}
@@ -0,0 +1,3017 @@
1
+ var Faye =
2
+ /******/ (function(modules) { // webpackBootstrap
3
+ /******/ // The module cache
4
+ /******/ var installedModules = {};
5
+ /******/
6
+ /******/ // The require function
7
+ /******/ function __webpack_require__(moduleId) {
8
+ /******/
9
+ /******/ // Check if module is in cache
10
+ /******/ if(installedModules[moduleId])
11
+ /******/ return installedModules[moduleId].exports;
12
+ /******/
13
+ /******/ // Create a new module (and put it into the cache)
14
+ /******/ var module = installedModules[moduleId] = {
15
+ /******/ exports: {},
16
+ /******/ id: moduleId,
17
+ /******/ loaded: false
18
+ /******/ };
19
+ /******/
20
+ /******/ // Execute the module function
21
+ /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
22
+ /******/
23
+ /******/ // Flag the module as loaded
24
+ /******/ module.loaded = true;
25
+ /******/
26
+ /******/ // Return the exports of the module
27
+ /******/ return module.exports;
28
+ /******/ }
29
+ /******/
30
+ /******/
31
+ /******/ // expose the modules object (__webpack_modules__)
32
+ /******/ __webpack_require__.m = modules;
33
+ /******/
34
+ /******/ // expose the module cache
35
+ /******/ __webpack_require__.c = installedModules;
36
+ /******/
37
+ /******/ // __webpack_public_path__
38
+ /******/ __webpack_require__.p = "";
39
+ /******/
40
+ /******/ // Load entry module and return exports
41
+ /******/ return __webpack_require__(0);
42
+ /******/ })
43
+ /************************************************************************/
44
+ /******/ ([
45
+ /* 0 */
46
+ /***/ function(module, exports, __webpack_require__) {
47
+
48
+ 'use strict';
49
+
50
+ var constants = __webpack_require__(1),
51
+ Logging = __webpack_require__(2);
52
+
53
+ var Faye = {
54
+ VERSION: constants.VERSION,
55
+
56
+ Client: __webpack_require__(4),
57
+ Scheduler: __webpack_require__(32)
58
+ };
59
+
60
+ Logging.wrapper = Faye;
61
+
62
+ module.exports = Faye;
63
+
64
+
65
+ /***/ },
66
+ /* 1 */
67
+ /***/ function(module, exports) {
68
+
69
+ module.exports = {
70
+ VERSION: '1.2.0',
71
+
72
+ BAYEUX_VERSION: '1.0',
73
+ ID_LENGTH: 160,
74
+ JSONP_CALLBACK: 'jsonpcallback',
75
+ CONNECTION_TYPES: ['long-polling', 'cross-origin-long-polling', 'callback-polling', 'websocket', 'eventsource', 'in-process'],
76
+
77
+ MANDATORY_CONNECTION_TYPES: ['long-polling', 'callback-polling', 'in-process']
78
+ };
79
+
80
+
81
+ /***/ },
82
+ /* 2 */
83
+ /***/ function(module, exports, __webpack_require__) {
84
+
85
+ 'use strict';
86
+
87
+ var toJSON = __webpack_require__(3);
88
+
89
+ var Logging = {
90
+ LOG_LEVELS: {
91
+ fatal: 4,
92
+ error: 3,
93
+ warn: 2,
94
+ info: 1,
95
+ debug: 0
96
+ },
97
+
98
+ writeLog: function(messageArgs, level) {
99
+ var logger = Logging.logger || (Logging.wrapper || Logging).logger;
100
+ if (!logger) return;
101
+
102
+ var args = Array.prototype.slice.apply(messageArgs),
103
+ banner = '[Faye',
104
+ klass = this.className,
105
+
106
+ message = args.shift().replace(/\?/g, function() {
107
+ try {
108
+ return toJSON(args.shift());
109
+ } catch (error) {
110
+ return '[Object]';
111
+ }
112
+ });
113
+
114
+ if (klass) banner += '.' + klass;
115
+ banner += '] ';
116
+
117
+ if (typeof logger[level] === 'function')
118
+ logger[level](banner + message);
119
+ else if (typeof logger === 'function')
120
+ logger(banner + message);
121
+ }
122
+ };
123
+
124
+ for (var key in Logging.LOG_LEVELS)
125
+ (function(level) {
126
+ Logging[level] = function() {
127
+ this.writeLog(arguments, level);
128
+ };
129
+ })(key);
130
+
131
+ module.exports = Logging;
132
+
133
+
134
+ /***/ },
135
+ /* 3 */
136
+ /***/ function(module, exports) {
137
+
138
+ 'use strict';
139
+
140
+ // http://assanka.net/content/tech/2009/09/02/json2-js-vs-prototype/
141
+
142
+ module.exports = function(object) {
143
+ return JSON.stringify(object, function(key, value) {
144
+ return (this[key] instanceof Array) ? this[key] : value;
145
+ });
146
+ };
147
+
148
+
149
+ /***/ },
150
+ /* 4 */
151
+ /***/ function(module, exports, __webpack_require__) {
152
+
153
+ /* WEBPACK VAR INJECTION */(function(global) {'use strict';
154
+
155
+ var asap = __webpack_require__(5),
156
+ Class = __webpack_require__(7),
157
+ Promise = __webpack_require__(9),
158
+ URI = __webpack_require__(10),
159
+ array = __webpack_require__(11),
160
+ browser = __webpack_require__(12),
161
+ constants = __webpack_require__(1),
162
+ extend = __webpack_require__(8),
163
+ validateOptions = __webpack_require__(13),
164
+ Deferrable = __webpack_require__(14),
165
+ Logging = __webpack_require__(2),
166
+ Publisher = __webpack_require__(15),
167
+ Channel = __webpack_require__(17),
168
+ Dispatcher = __webpack_require__(19),
169
+ Error = __webpack_require__(33),
170
+ Extensible = __webpack_require__(34),
171
+ Publication = __webpack_require__(35),
172
+ Subscription = __webpack_require__(36);
173
+
174
+ var Client = Class({ className: 'Client',
175
+ UNCONNECTED: 1,
176
+ CONNECTING: 2,
177
+ CONNECTED: 3,
178
+ DISCONNECTED: 4,
179
+
180
+ HANDSHAKE: 'handshake',
181
+ RETRY: 'retry',
182
+ NONE: 'none',
183
+
184
+ CONNECTION_TIMEOUT: 60,
185
+
186
+ DEFAULT_ENDPOINT: '/bayeux',
187
+ INTERVAL: 0,
188
+
189
+ initialize: function(endpoint, options) {
190
+ this.info('New client created for ?', endpoint);
191
+ options = options || {};
192
+
193
+ validateOptions(options, ['interval', 'timeout', 'endpoints', 'proxy', 'retry', 'scheduler', 'websocketExtensions', 'tls', 'ca']);
194
+
195
+ this._channels = new Channel.Set();
196
+ this._dispatcher = Dispatcher.create(this, endpoint || this.DEFAULT_ENDPOINT, options);
197
+
198
+ this._messageId = 0;
199
+ this._state = this.UNCONNECTED;
200
+
201
+ this._responseCallbacks = {};
202
+
203
+ this._advice = {
204
+ reconnect: this.RETRY,
205
+ interval: 1000 * (options.interval || this.INTERVAL),
206
+ timeout: 1000 * (options.timeout || this.CONNECTION_TIMEOUT)
207
+ };
208
+ this._dispatcher.timeout = this._advice.timeout / 1000;
209
+
210
+ this._dispatcher.bind('message', this._receiveMessage, this);
211
+
212
+ if (browser.Event && global.onbeforeunload !== undefined)
213
+ browser.Event.on(global, 'beforeunload', function() {
214
+ if (array.indexOf(this._dispatcher._disabled, 'autodisconnect') < 0)
215
+ this.disconnect();
216
+ }, this);
217
+ },
218
+
219
+ addWebsocketExtension: function(extension) {
220
+ return this._dispatcher.addWebsocketExtension(extension);
221
+ },
222
+
223
+ disable: function(feature) {
224
+ return this._dispatcher.disable(feature);
225
+ },
226
+
227
+ setHeader: function(name, value) {
228
+ return this._dispatcher.setHeader(name, value);
229
+ },
230
+
231
+ // Request
232
+ // MUST include: * channel
233
+ // * version
234
+ // * supportedConnectionTypes
235
+ // MAY include: * minimumVersion
236
+ // * ext
237
+ // * id
238
+ //
239
+ // Success Response Failed Response
240
+ // MUST include: * channel MUST include: * channel
241
+ // * version * successful
242
+ // * supportedConnectionTypes * error
243
+ // * clientId MAY include: * supportedConnectionTypes
244
+ // * successful * advice
245
+ // MAY include: * minimumVersion * version
246
+ // * advice * minimumVersion
247
+ // * ext * ext
248
+ // * id * id
249
+ // * authSuccessful
250
+ handshake: function(callback, context) {
251
+ if (this._advice.reconnect === this.NONE) return;
252
+ if (this._state !== this.UNCONNECTED) return;
253
+
254
+ this._state = this.CONNECTING;
255
+ var self = this;
256
+
257
+ this.info('Initiating handshake with ?', URI.stringify(this._dispatcher.endpoint));
258
+ this._dispatcher.selectTransport(constants.MANDATORY_CONNECTION_TYPES);
259
+
260
+ this._sendMessage({
261
+ channel: Channel.HANDSHAKE,
262
+ version: constants.BAYEUX_VERSION,
263
+ supportedConnectionTypes: this._dispatcher.getConnectionTypes()
264
+
265
+ }, {}, function(response) {
266
+
267
+ if (response.successful) {
268
+ this._state = this.CONNECTED;
269
+ this._dispatcher.clientId = response.clientId;
270
+
271
+ this._dispatcher.selectTransport(response.supportedConnectionTypes);
272
+
273
+ this.info('Handshake successful: ?', this._dispatcher.clientId);
274
+
275
+ this.subscribe(this._channels.getKeys(), true);
276
+ if (callback) asap(function() { callback.call(context) });
277
+
278
+ } else {
279
+ this.info('Handshake unsuccessful');
280
+ global.setTimeout(function() { self.handshake(callback, context) }, this._dispatcher.retry * 1000);
281
+ this._state = this.UNCONNECTED;
282
+ }
283
+ }, this);
284
+ },
285
+
286
+ // Request Response
287
+ // MUST include: * channel MUST include: * channel
288
+ // * clientId * successful
289
+ // * connectionType * clientId
290
+ // MAY include: * ext MAY include: * error
291
+ // * id * advice
292
+ // * ext
293
+ // * id
294
+ // * timestamp
295
+ connect: function(callback, context) {
296
+ if (this._advice.reconnect === this.NONE) return;
297
+ if (this._state === this.DISCONNECTED) return;
298
+
299
+ if (this._state === this.UNCONNECTED)
300
+ return this.handshake(function() { this.connect(callback, context) }, this);
301
+
302
+ this.callback(callback, context);
303
+ if (this._state !== this.CONNECTED) return;
304
+
305
+ this.info('Calling deferred actions for ?', this._dispatcher.clientId);
306
+ this.setDeferredStatus('succeeded');
307
+ this.setDeferredStatus('unknown');
308
+
309
+ if (this._connectRequest) return;
310
+ this._connectRequest = true;
311
+
312
+ this.info('Initiating connection for ?', this._dispatcher.clientId);
313
+
314
+ this._sendMessage({
315
+ channel: Channel.CONNECT,
316
+ clientId: this._dispatcher.clientId,
317
+ connectionType: this._dispatcher.connectionType
318
+
319
+ }, {}, this._cycleConnection, this);
320
+ },
321
+
322
+ // Request Response
323
+ // MUST include: * channel MUST include: * channel
324
+ // * clientId * successful
325
+ // MAY include: * ext * clientId
326
+ // * id MAY include: * error
327
+ // * ext
328
+ // * id
329
+ disconnect: function() {
330
+ if (this._state !== this.CONNECTED) return;
331
+ this._state = this.DISCONNECTED;
332
+
333
+ this.info('Disconnecting ?', this._dispatcher.clientId);
334
+ var promise = new Publication();
335
+
336
+ this._sendMessage({
337
+ channel: Channel.DISCONNECT,
338
+ clientId: this._dispatcher.clientId
339
+
340
+ }, {}, function(response) {
341
+ if (response.successful) {
342
+ this._dispatcher.close();
343
+ promise.setDeferredStatus('succeeded');
344
+ } else {
345
+ promise.setDeferredStatus('failed', Error.parse(response.error));
346
+ }
347
+ }, this);
348
+
349
+ this.info('Clearing channel listeners for ?', this._dispatcher.clientId);
350
+ this._channels = new Channel.Set();
351
+
352
+ return promise;
353
+ },
354
+
355
+ // Request Response
356
+ // MUST include: * channel MUST include: * channel
357
+ // * clientId * successful
358
+ // * subscription * clientId
359
+ // MAY include: * ext * subscription
360
+ // * id MAY include: * error
361
+ // * advice
362
+ // * ext
363
+ // * id
364
+ // * timestamp
365
+ subscribe: function(channel, callback, context) {
366
+ if (channel instanceof Array)
367
+ return array.map(channel, function(c) {
368
+ return this.subscribe(c, callback, context);
369
+ }, this);
370
+
371
+ var subscription = new Subscription(this, channel, callback, context),
372
+ force = (callback === true),
373
+ hasSubscribe = this._channels.hasSubscription(channel);
374
+
375
+ if (hasSubscribe && !force) {
376
+ this._channels.subscribe([channel], subscription);
377
+ subscription.setDeferredStatus('succeeded');
378
+ return subscription;
379
+ }
380
+
381
+ this.connect(function() {
382
+ this.info('Client ? attempting to subscribe to ?', this._dispatcher.clientId, channel);
383
+ if (!force) this._channels.subscribe([channel], subscription);
384
+
385
+ this._sendMessage({
386
+ channel: Channel.SUBSCRIBE,
387
+ clientId: this._dispatcher.clientId,
388
+ subscription: channel
389
+
390
+ }, {}, function(response) {
391
+ if (!response.successful) {
392
+ subscription.setDeferredStatus('failed', Error.parse(response.error));
393
+ return this._channels.unsubscribe(channel, subscription);
394
+ }
395
+
396
+ var channels = [].concat(response.subscription);
397
+ this.info('Subscription acknowledged for ? to ?', this._dispatcher.clientId, channels);
398
+ subscription.setDeferredStatus('succeeded');
399
+ }, this);
400
+ }, this);
401
+
402
+ return subscription;
403
+ },
404
+
405
+ // Request Response
406
+ // MUST include: * channel MUST include: * channel
407
+ // * clientId * successful
408
+ // * subscription * clientId
409
+ // MAY include: * ext * subscription
410
+ // * id MAY include: * error
411
+ // * advice
412
+ // * ext
413
+ // * id
414
+ // * timestamp
415
+ unsubscribe: function(channel, subscription) {
416
+ if (channel instanceof Array)
417
+ return array.map(channel, function(c) {
418
+ return this.unsubscribe(c, subscription);
419
+ }, this);
420
+
421
+ var dead = this._channels.unsubscribe(channel, subscription);
422
+ if (!dead) return;
423
+
424
+ this.connect(function() {
425
+ this.info('Client ? attempting to unsubscribe from ?', this._dispatcher.clientId, channel);
426
+
427
+ this._sendMessage({
428
+ channel: Channel.UNSUBSCRIBE,
429
+ clientId: this._dispatcher.clientId,
430
+ subscription: channel
431
+
432
+ }, {}, function(response) {
433
+ if (!response.successful) return;
434
+
435
+ var channels = [].concat(response.subscription);
436
+ this.info('Unsubscription acknowledged for ? from ?', this._dispatcher.clientId, channels);
437
+ }, this);
438
+ }, this);
439
+ },
440
+
441
+ // Request Response
442
+ // MUST include: * channel MUST include: * channel
443
+ // * data * successful
444
+ // MAY include: * clientId MAY include: * id
445
+ // * id * error
446
+ // * ext * ext
447
+ publish: function(channel, data, options) {
448
+ validateOptions(options || {}, ['attempts', 'deadline']);
449
+ var publication = new Publication();
450
+
451
+ this.connect(function() {
452
+ this.info('Client ? queueing published message to ?: ?', this._dispatcher.clientId, channel, data);
453
+
454
+ this._sendMessage({
455
+ channel: channel,
456
+ data: data,
457
+ clientId: this._dispatcher.clientId
458
+
459
+ }, options, function(response) {
460
+ if (response.successful)
461
+ publication.setDeferredStatus('succeeded');
462
+ else
463
+ publication.setDeferredStatus('failed', Error.parse(response.error));
464
+ }, this);
465
+ }, this);
466
+
467
+ return publication;
468
+ },
469
+
470
+ _sendMessage: function(message, options, callback, context) {
471
+ message.id = this._generateMessageId();
472
+
473
+ var timeout = this._advice.timeout
474
+ ? 1.2 * this._advice.timeout / 1000
475
+ : 1.2 * this._dispatcher.retry;
476
+
477
+ this.pipeThroughExtensions('outgoing', message, null, function(message) {
478
+ if (!message) return;
479
+ if (callback) this._responseCallbacks[message.id] = [callback, context];
480
+ this._dispatcher.sendMessage(message, timeout, options || {});
481
+ }, this);
482
+ },
483
+
484
+ _generateMessageId: function() {
485
+ this._messageId += 1;
486
+ if (this._messageId >= Math.pow(2,32)) this._messageId = 0;
487
+ return this._messageId.toString(36);
488
+ },
489
+
490
+ _receiveMessage: function(message) {
491
+ var id = message.id, callback;
492
+
493
+ if (message.successful !== undefined) {
494
+ callback = this._responseCallbacks[id];
495
+ delete this._responseCallbacks[id];
496
+ }
497
+
498
+ this.pipeThroughExtensions('incoming', message, null, function(message) {
499
+ if (!message) return;
500
+ if (message.advice) this._handleAdvice(message.advice);
501
+ this._deliverMessage(message);
502
+ if (callback) callback[0].call(callback[1], message);
503
+ }, this);
504
+ },
505
+
506
+ _handleAdvice: function(advice) {
507
+ extend(this._advice, advice);
508
+ this._dispatcher.timeout = this._advice.timeout / 1000;
509
+
510
+ if (this._advice.reconnect === this.HANDSHAKE && this._state !== this.DISCONNECTED) {
511
+ this._state = this.UNCONNECTED;
512
+ this._dispatcher.clientId = null;
513
+ this._cycleConnection();
514
+ }
515
+ },
516
+
517
+ _deliverMessage: function(message) {
518
+ if (!message.channel || message.data === undefined) return;
519
+ this.info('Client ? calling listeners for ? with ?', this._dispatcher.clientId, message.channel, message.data);
520
+ this._channels.distributeMessage(message);
521
+ },
522
+
523
+ _cycleConnection: function() {
524
+ if (this._connectRequest) {
525
+ this._connectRequest = null;
526
+ this.info('Closed connection for ?', this._dispatcher.clientId);
527
+ }
528
+ var self = this;
529
+ global.setTimeout(function() { self.connect() }, this._advice.interval);
530
+ }
531
+ });
532
+
533
+ extend(Client.prototype, Deferrable);
534
+ extend(Client.prototype, Publisher);
535
+ extend(Client.prototype, Logging);
536
+ extend(Client.prototype, Extensible);
537
+
538
+ module.exports = Client;
539
+
540
+ /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
541
+
542
+ /***/ },
543
+ /* 5 */
544
+ /***/ function(module, exports, __webpack_require__) {
545
+
546
+ "use strict";
547
+
548
+ // rawAsap provides everything we need except exception management.
549
+ var rawAsap = __webpack_require__(6);
550
+ // RawTasks are recycled to reduce GC churn.
551
+ var freeTasks = [];
552
+ // We queue errors to ensure they are thrown in right order (FIFO).
553
+ // Array-as-queue is good enough here, since we are just dealing with exceptions.
554
+ var pendingErrors = [];
555
+ var requestErrorThrow = rawAsap.makeRequestCallFromTimer(throwFirstError);
556
+
557
+ function throwFirstError() {
558
+ if (pendingErrors.length) {
559
+ throw pendingErrors.shift();
560
+ }
561
+ }
562
+
563
+ /**
564
+ * Calls a task as soon as possible after returning, in its own event, with priority
565
+ * over other events like animation, reflow, and repaint. An error thrown from an
566
+ * event will not interrupt, nor even substantially slow down the processing of
567
+ * other events, but will be rather postponed to a lower priority event.
568
+ * @param {{call}} task A callable object, typically a function that takes no
569
+ * arguments.
570
+ */
571
+ module.exports = asap;
572
+ function asap(task) {
573
+ var rawTask;
574
+ if (freeTasks.length) {
575
+ rawTask = freeTasks.pop();
576
+ } else {
577
+ rawTask = new RawTask();
578
+ }
579
+ rawTask.task = task;
580
+ rawAsap(rawTask);
581
+ }
582
+
583
+ // We wrap tasks with recyclable task objects. A task object implements
584
+ // `call`, just like a function.
585
+ function RawTask() {
586
+ this.task = null;
587
+ }
588
+
589
+ // The sole purpose of wrapping the task is to catch the exception and recycle
590
+ // the task object after its single use.
591
+ RawTask.prototype.call = function () {
592
+ try {
593
+ this.task.call();
594
+ } catch (error) {
595
+ if (asap.onerror) {
596
+ // This hook exists purely for testing purposes.
597
+ // Its name will be periodically randomized to break any code that
598
+ // depends on its existence.
599
+ asap.onerror(error);
600
+ } else {
601
+ // In a web browser, exceptions are not fatal. However, to avoid
602
+ // slowing down the queue of pending tasks, we rethrow the error in a
603
+ // lower priority turn.
604
+ pendingErrors.push(error);
605
+ requestErrorThrow();
606
+ }
607
+ } finally {
608
+ this.task = null;
609
+ freeTasks[freeTasks.length] = this;
610
+ }
611
+ };
612
+
613
+
614
+ /***/ },
615
+ /* 6 */
616
+ /***/ function(module, exports) {
617
+
618
+ /* WEBPACK VAR INJECTION */(function(global) {"use strict";
619
+
620
+ // Use the fastest means possible to execute a task in its own turn, with
621
+ // priority over other events including IO, animation, reflow, and redraw
622
+ // events in browsers.
623
+ //
624
+ // An exception thrown by a task will permanently interrupt the processing of
625
+ // subsequent tasks. The higher level `asap` function ensures that if an
626
+ // exception is thrown by a task, that the task queue will continue flushing as
627
+ // soon as possible, but if you use `rawAsap` directly, you are responsible to
628
+ // either ensure that no exceptions are thrown from your task, or to manually
629
+ // call `rawAsap.requestFlush` if an exception is thrown.
630
+ module.exports = rawAsap;
631
+ function rawAsap(task) {
632
+ if (!queue.length) {
633
+ requestFlush();
634
+ flushing = true;
635
+ }
636
+ // Equivalent to push, but avoids a function call.
637
+ queue[queue.length] = task;
638
+ }
639
+
640
+ var queue = [];
641
+ // Once a flush has been requested, no further calls to `requestFlush` are
642
+ // necessary until the next `flush` completes.
643
+ var flushing = false;
644
+ // `requestFlush` is an implementation-specific method that attempts to kick
645
+ // off a `flush` event as quickly as possible. `flush` will attempt to exhaust
646
+ // the event queue before yielding to the browser's own event loop.
647
+ var requestFlush;
648
+ // The position of the next task to execute in the task queue. This is
649
+ // preserved between calls to `flush` so that it can be resumed if
650
+ // a task throws an exception.
651
+ var index = 0;
652
+ // If a task schedules additional tasks recursively, the task queue can grow
653
+ // unbounded. To prevent memory exhaustion, the task queue will periodically
654
+ // truncate already-completed tasks.
655
+ var capacity = 1024;
656
+
657
+ // The flush function processes all tasks that have been scheduled with
658
+ // `rawAsap` unless and until one of those tasks throws an exception.
659
+ // If a task throws an exception, `flush` ensures that its state will remain
660
+ // consistent and will resume where it left off when called again.
661
+ // However, `flush` does not make any arrangements to be called again if an
662
+ // exception is thrown.
663
+ function flush() {
664
+ while (index < queue.length) {
665
+ var currentIndex = index;
666
+ // Advance the index before calling the task. This ensures that we will
667
+ // begin flushing on the next task the task throws an error.
668
+ index = index + 1;
669
+ queue[currentIndex].call();
670
+ // Prevent leaking memory for long chains of recursive calls to `asap`.
671
+ // If we call `asap` within tasks scheduled by `asap`, the queue will
672
+ // grow, but to avoid an O(n) walk for every task we execute, we don't
673
+ // shift tasks off the queue after they have been executed.
674
+ // Instead, we periodically shift 1024 tasks off the queue.
675
+ if (index > capacity) {
676
+ // Manually shift all values starting at the index back to the
677
+ // beginning of the queue.
678
+ for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {
679
+ queue[scan] = queue[scan + index];
680
+ }
681
+ queue.length -= index;
682
+ index = 0;
683
+ }
684
+ }
685
+ queue.length = 0;
686
+ index = 0;
687
+ flushing = false;
688
+ }
689
+
690
+ // `requestFlush` is implemented using a strategy based on data collected from
691
+ // every available SauceLabs Selenium web driver worker at time of writing.
692
+ // https://docs.google.com/spreadsheets/d/1mG-5UYGup5qxGdEMWkhP6BWCz053NUb2E1QoUTU16uA/edit#gid=783724593
693
+
694
+ // Safari 6 and 6.1 for desktop, iPad, and iPhone are the only browsers that
695
+ // have WebKitMutationObserver but not un-prefixed MutationObserver.
696
+ // Must use `global` instead of `window` to work in both frames and web
697
+ // workers. `global` is a provision of Browserify, Mr, Mrs, or Mop.
698
+ var BrowserMutationObserver = global.MutationObserver || global.WebKitMutationObserver;
699
+
700
+ // MutationObservers are desirable because they have high priority and work
701
+ // reliably everywhere they are implemented.
702
+ // They are implemented in all modern browsers.
703
+ //
704
+ // - Android 4-4.3
705
+ // - Chrome 26-34
706
+ // - Firefox 14-29
707
+ // - Internet Explorer 11
708
+ // - iPad Safari 6-7.1
709
+ // - iPhone Safari 7-7.1
710
+ // - Safari 6-7
711
+ if (typeof BrowserMutationObserver === "function") {
712
+ requestFlush = makeRequestCallFromMutationObserver(flush);
713
+
714
+ // MessageChannels are desirable because they give direct access to the HTML
715
+ // task queue, are implemented in Internet Explorer 10, Safari 5.0-1, and Opera
716
+ // 11-12, and in web workers in many engines.
717
+ // Although message channels yield to any queued rendering and IO tasks, they
718
+ // would be better than imposing the 4ms delay of timers.
719
+ // However, they do not work reliably in Internet Explorer or Safari.
720
+
721
+ // Internet Explorer 10 is the only browser that has setImmediate but does
722
+ // not have MutationObservers.
723
+ // Although setImmediate yields to the browser's renderer, it would be
724
+ // preferrable to falling back to setTimeout since it does not have
725
+ // the minimum 4ms penalty.
726
+ // Unfortunately there appears to be a bug in Internet Explorer 10 Mobile (and
727
+ // Desktop to a lesser extent) that renders both setImmediate and
728
+ // MessageChannel useless for the purposes of ASAP.
729
+ // https://github.com/kriskowal/q/issues/396
730
+
731
+ // Timers are implemented universally.
732
+ // We fall back to timers in workers in most engines, and in foreground
733
+ // contexts in the following browsers.
734
+ // However, note that even this simple case requires nuances to operate in a
735
+ // broad spectrum of browsers.
736
+ //
737
+ // - Firefox 3-13
738
+ // - Internet Explorer 6-9
739
+ // - iPad Safari 4.3
740
+ // - Lynx 2.8.7
741
+ } else {
742
+ requestFlush = makeRequestCallFromTimer(flush);
743
+ }
744
+
745
+ // `requestFlush` requests that the high priority event queue be flushed as
746
+ // soon as possible.
747
+ // This is useful to prevent an error thrown in a task from stalling the event
748
+ // queue if the exception handled by Node.js’s
749
+ // `process.on("uncaughtException")` or by a domain.
750
+ rawAsap.requestFlush = requestFlush;
751
+
752
+ // To request a high priority event, we induce a mutation observer by toggling
753
+ // the text of a text node between "1" and "-1".
754
+ function makeRequestCallFromMutationObserver(callback) {
755
+ var toggle = 1;
756
+ var observer = new BrowserMutationObserver(callback);
757
+ var node = document.createTextNode("");
758
+ observer.observe(node, {characterData: true});
759
+ return function requestCall() {
760
+ toggle = -toggle;
761
+ node.data = toggle;
762
+ };
763
+ }
764
+
765
+ // The message channel technique was discovered by Malte Ubl and was the
766
+ // original foundation for this library.
767
+ // http://www.nonblocking.io/2011/06/windownexttick.html
768
+
769
+ // Safari 6.0.5 (at least) intermittently fails to create message ports on a
770
+ // page's first load. Thankfully, this version of Safari supports
771
+ // MutationObservers, so we don't need to fall back in that case.
772
+
773
+ // function makeRequestCallFromMessageChannel(callback) {
774
+ // var channel = new MessageChannel();
775
+ // channel.port1.onmessage = callback;
776
+ // return function requestCall() {
777
+ // channel.port2.postMessage(0);
778
+ // };
779
+ // }
780
+
781
+ // For reasons explained above, we are also unable to use `setImmediate`
782
+ // under any circumstances.
783
+ // Even if we were, there is another bug in Internet Explorer 10.
784
+ // It is not sufficient to assign `setImmediate` to `requestFlush` because
785
+ // `setImmediate` must be called *by name* and therefore must be wrapped in a
786
+ // closure.
787
+ // Never forget.
788
+
789
+ // function makeRequestCallFromSetImmediate(callback) {
790
+ // return function requestCall() {
791
+ // setImmediate(callback);
792
+ // };
793
+ // }
794
+
795
+ // Safari 6.0 has a problem where timers will get lost while the user is
796
+ // scrolling. This problem does not impact ASAP because Safari 6.0 supports
797
+ // mutation observers, so that implementation is used instead.
798
+ // However, if we ever elect to use timers in Safari, the prevalent work-around
799
+ // is to add a scroll event listener that calls for a flush.
800
+
801
+ // `setTimeout` does not call the passed callback if the delay is less than
802
+ // approximately 7 in web workers in Firefox 8 through 18, and sometimes not
803
+ // even then.
804
+
805
+ function makeRequestCallFromTimer(callback) {
806
+ return function requestCall() {
807
+ // We dispatch a timeout with a specified delay of 0 for engines that
808
+ // can reliably accommodate that request. This will usually be snapped
809
+ // to a 4 milisecond delay, but once we're flushing, there's no delay
810
+ // between events.
811
+ var timeoutHandle = setTimeout(handleTimer, 0);
812
+ // However, since this timer gets frequently dropped in Firefox
813
+ // workers, we enlist an interval handle that will try to fire
814
+ // an event 20 times per second until it succeeds.
815
+ var intervalHandle = setInterval(handleTimer, 50);
816
+
817
+ function handleTimer() {
818
+ // Whichever timer succeeds will cancel both timers and
819
+ // execute the callback.
820
+ clearTimeout(timeoutHandle);
821
+ clearInterval(intervalHandle);
822
+ callback();
823
+ }
824
+ };
825
+ }
826
+
827
+ // This is for `asap.js` only.
828
+ // Its name will be periodically randomized to break any code that depends on
829
+ // its existence.
830
+ rawAsap.makeRequestCallFromTimer = makeRequestCallFromTimer;
831
+
832
+ // ASAP was originally a nextTick shim included in Q. This was factored out
833
+ // into this ASAP package. It was later adapted to RSVP which made further
834
+ // amendments. These decisions, particularly to marginalize MessageChannel and
835
+ // to capture the MutationObserver implementation in a closure, were integrated
836
+ // back into ASAP proper.
837
+ // https://github.com/tildeio/rsvp.js/blob/cddf7232546a9cf858524b75cde6f9edf72620a7/lib/rsvp/asap.js
838
+
839
+ /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
840
+
841
+ /***/ },
842
+ /* 7 */
843
+ /***/ function(module, exports, __webpack_require__) {
844
+
845
+ 'use strict';
846
+
847
+ var extend = __webpack_require__(8);
848
+
849
+ module.exports = function(parent, methods) {
850
+ if (typeof parent !== 'function') {
851
+ methods = parent;
852
+ parent = Object;
853
+ }
854
+
855
+ var klass = function() {
856
+ if (!this.initialize) return this;
857
+ return this.initialize.apply(this, arguments) || this;
858
+ };
859
+
860
+ var bridge = function() {};
861
+ bridge.prototype = parent.prototype;
862
+
863
+ klass.prototype = new bridge();
864
+ extend(klass.prototype, methods);
865
+
866
+ return klass;
867
+ };
868
+
869
+
870
+ /***/ },
871
+ /* 8 */
872
+ /***/ function(module, exports) {
873
+
874
+ 'use strict';
875
+
876
+ module.exports = function(dest, source, overwrite) {
877
+ if (!source) return dest;
878
+ for (var key in source) {
879
+ if (!source.hasOwnProperty(key)) continue;
880
+ if (dest.hasOwnProperty(key) && overwrite === false) continue;
881
+ if (dest[key] !== source[key])
882
+ dest[key] = source[key];
883
+ }
884
+ return dest;
885
+ };
886
+
887
+
888
+ /***/ },
889
+ /* 9 */
890
+ /***/ function(module, exports, __webpack_require__) {
891
+
892
+ 'use strict';
893
+
894
+ var asap = __webpack_require__(5);
895
+
896
+ var PENDING = 0,
897
+ FULFILLED = 1,
898
+ REJECTED = 2;
899
+
900
+ var RETURN = function(x) { return x },
901
+ THROW = function(x) { throw x };
902
+
903
+ var Promise = function(task) {
904
+ this._state = PENDING;
905
+ this._onFulfilled = [];
906
+ this._onRejected = [];
907
+
908
+ if (typeof task !== 'function') return;
909
+ var self = this;
910
+
911
+ task(function(value) { fulfill(self, value) },
912
+ function(reason) { reject(self, reason) });
913
+ };
914
+
915
+ Promise.prototype.then = function(onFulfilled, onRejected) {
916
+ var next = new Promise();
917
+ registerOnFulfilled(this, onFulfilled, next);
918
+ registerOnRejected(this, onRejected, next);
919
+ return next;
920
+ };
921
+
922
+ Promise.prototype.catch = function(onRejected) {
923
+ return this.then(null, onRejected);
924
+ };
925
+
926
+ var registerOnFulfilled = function(promise, onFulfilled, next) {
927
+ if (typeof onFulfilled !== 'function') onFulfilled = RETURN;
928
+ var handler = function(value) { invoke(onFulfilled, value, next) };
929
+
930
+ if (promise._state === PENDING) {
931
+ promise._onFulfilled.push(handler);
932
+ } else if (promise._state === FULFILLED) {
933
+ handler(promise._value);
934
+ }
935
+ };
936
+
937
+ var registerOnRejected = function(promise, onRejected, next) {
938
+ if (typeof onRejected !== 'function') onRejected = THROW;
939
+ var handler = function(reason) { invoke(onRejected, reason, next) };
940
+
941
+ if (promise._state === PENDING) {
942
+ promise._onRejected.push(handler);
943
+ } else if (promise._state === REJECTED) {
944
+ handler(promise._reason);
945
+ }
946
+ };
947
+
948
+ var invoke = function(fn, value, next) {
949
+ asap(function() { _invoke(fn, value, next) });
950
+ };
951
+
952
+ var _invoke = function(fn, value, next) {
953
+ var outcome;
954
+
955
+ try {
956
+ outcome = fn(value);
957
+ } catch (error) {
958
+ return reject(next, error);
959
+ }
960
+
961
+ if (outcome === next) {
962
+ reject(next, new TypeError('Recursive promise chain detected'));
963
+ } else {
964
+ fulfill(next, outcome);
965
+ }
966
+ };
967
+
968
+ var fulfill = function(promise, value) {
969
+ var called = false, type, then;
970
+
971
+ try {
972
+ type = typeof value;
973
+ then = value !== null && (type === 'function' || type === 'object') && value.then;
974
+
975
+ if (typeof then !== 'function') return _fulfill(promise, value);
976
+
977
+ then.call(value, function(v) {
978
+ if (!(called ^ (called = true))) return;
979
+ fulfill(promise, v);
980
+ }, function(r) {
981
+ if (!(called ^ (called = true))) return;
982
+ reject(promise, r);
983
+ });
984
+ } catch (error) {
985
+ if (!(called ^ (called = true))) return;
986
+ reject(promise, error);
987
+ }
988
+ };
989
+
990
+ var _fulfill = function(promise, value) {
991
+ if (promise._state !== PENDING) return;
992
+
993
+ promise._state = FULFILLED;
994
+ promise._value = value;
995
+ promise._onRejected = [];
996
+
997
+ var onFulfilled = promise._onFulfilled, fn;
998
+ while (fn = onFulfilled.shift()) fn(value);
999
+ };
1000
+
1001
+ var reject = function(promise, reason) {
1002
+ if (promise._state !== PENDING) return;
1003
+
1004
+ promise._state = REJECTED;
1005
+ promise._reason = reason;
1006
+ promise._onFulfilled = [];
1007
+
1008
+ var onRejected = promise._onRejected, fn;
1009
+ while (fn = onRejected.shift()) fn(reason);
1010
+ };
1011
+
1012
+ Promise.resolve = Promise.accept = Promise.fulfill = function(value) {
1013
+ return new Promise(function(resolve, reject) { resolve(value) });
1014
+ };
1015
+
1016
+ Promise.reject = function(reason) {
1017
+ return new Promise(function(resolve, reject) { reject(reason) });
1018
+ };
1019
+
1020
+ Promise.all = function(promises) {
1021
+ return new Promise(function(resolve, reject) {
1022
+ var list = [], n = promises.length, i;
1023
+
1024
+ if (n === 0) return resolve(list);
1025
+
1026
+ for (i = 0; i < n; i++) (function(promise, i) {
1027
+ Promise.resolve(promise).then(function(value) {
1028
+ list[i] = value;
1029
+ if (--n === 0) resolve(list);
1030
+ }, reject);
1031
+ })(promises[i], i);
1032
+ });
1033
+ };
1034
+
1035
+ Promise.race = function(promises) {
1036
+ return new Promise(function(resolve, reject) {
1037
+ for (var i = 0, n = promises.length; i < n; i++)
1038
+ Promise.resolve(promises[i]).then(resolve, reject);
1039
+ });
1040
+ };
1041
+
1042
+ Promise.deferred = Promise.pending = function() {
1043
+ var tuple = {};
1044
+
1045
+ tuple.promise = new Promise(function(resolve, reject) {
1046
+ tuple.fulfill = tuple.resolve = resolve;
1047
+ tuple.reject = reject;
1048
+ });
1049
+ return tuple;
1050
+ };
1051
+
1052
+ module.exports = Promise;
1053
+
1054
+
1055
+ /***/ },
1056
+ /* 10 */
1057
+ /***/ function(module, exports) {
1058
+
1059
+ 'use strict';
1060
+
1061
+ module.exports = {
1062
+ isURI: function(uri) {
1063
+ return uri && uri.protocol && uri.host && uri.path;
1064
+ },
1065
+
1066
+ isSameOrigin: function(uri) {
1067
+ return uri.protocol === location.protocol &&
1068
+ uri.hostname === location.hostname &&
1069
+ uri.port === location.port;
1070
+ },
1071
+
1072
+ parse: function(url) {
1073
+ if (typeof url !== 'string') return url;
1074
+ var uri = {}, parts, query, pairs, i, n, data;
1075
+
1076
+ var consume = function(name, pattern) {
1077
+ url = url.replace(pattern, function(match) {
1078
+ uri[name] = match;
1079
+ return '';
1080
+ });
1081
+ uri[name] = uri[name] || '';
1082
+ };
1083
+
1084
+ consume('protocol', /^[a-z]+\:/i);
1085
+ consume('host', /^\/\/[^\/\?#]+/);
1086
+
1087
+ if (!/^\//.test(url) && !uri.host)
1088
+ url = location.pathname.replace(/[^\/]*$/, '') + url;
1089
+
1090
+ consume('pathname', /^[^\?#]*/);
1091
+ consume('search', /^\?[^#]*/);
1092
+ consume('hash', /^#.*/);
1093
+
1094
+ uri.protocol = uri.protocol || location.protocol;
1095
+
1096
+ if (uri.host) {
1097
+ uri.host = uri.host.substr(2);
1098
+ parts = uri.host.split(':');
1099
+ uri.hostname = parts[0];
1100
+ uri.port = parts[1] || '';
1101
+ } else {
1102
+ uri.host = location.host;
1103
+ uri.hostname = location.hostname;
1104
+ uri.port = location.port;
1105
+ }
1106
+
1107
+ uri.pathname = uri.pathname || '/';
1108
+ uri.path = uri.pathname + uri.search;
1109
+
1110
+ query = uri.search.replace(/^\?/, '');
1111
+ pairs = query ? query.split('&') : [];
1112
+ data = {};
1113
+
1114
+ for (i = 0, n = pairs.length; i < n; i++) {
1115
+ parts = pairs[i].split('=');
1116
+ data[decodeURIComponent(parts[0] || '')] = decodeURIComponent(parts[1] || '');
1117
+ }
1118
+
1119
+ uri.query = data;
1120
+
1121
+ uri.href = this.stringify(uri);
1122
+ return uri;
1123
+ },
1124
+
1125
+ stringify: function(uri) {
1126
+ var string = uri.protocol + '//' + uri.hostname;
1127
+ if (uri.port) string += ':' + uri.port;
1128
+ string += uri.pathname + this.queryString(uri.query) + (uri.hash || '');
1129
+ return string;
1130
+ },
1131
+
1132
+ queryString: function(query) {
1133
+ var pairs = [];
1134
+ for (var key in query) {
1135
+ if (!query.hasOwnProperty(key)) continue;
1136
+ pairs.push(encodeURIComponent(key) + '=' + encodeURIComponent(query[key]));
1137
+ }
1138
+ if (pairs.length === 0) return '';
1139
+ return '?' + pairs.join('&');
1140
+ }
1141
+ };
1142
+
1143
+
1144
+ /***/ },
1145
+ /* 11 */
1146
+ /***/ function(module, exports) {
1147
+
1148
+ 'use strict';
1149
+
1150
+ module.exports = {
1151
+ commonElement: function(lista, listb) {
1152
+ for (var i = 0, n = lista.length; i < n; i++) {
1153
+ if (this.indexOf(listb, lista[i]) !== -1)
1154
+ return lista[i];
1155
+ }
1156
+ return null;
1157
+ },
1158
+
1159
+ indexOf: function(list, needle) {
1160
+ if (list.indexOf) return list.indexOf(needle);
1161
+
1162
+ for (var i = 0, n = list.length; i < n; i++) {
1163
+ if (list[i] === needle) return i;
1164
+ }
1165
+ return -1;
1166
+ },
1167
+
1168
+ map: function(object, callback, context) {
1169
+ if (object.map) return object.map(callback, context);
1170
+ var result = [];
1171
+
1172
+ if (object instanceof Array) {
1173
+ for (var i = 0, n = object.length; i < n; i++) {
1174
+ result.push(callback.call(context || null, object[i], i));
1175
+ }
1176
+ } else {
1177
+ for (var key in object) {
1178
+ if (!object.hasOwnProperty(key)) continue;
1179
+ result.push(callback.call(context || null, key, object[key]));
1180
+ }
1181
+ }
1182
+ return result;
1183
+ },
1184
+
1185
+ filter: function(array, callback, context) {
1186
+ if (array.filter) return array.filter(callback, context);
1187
+ var result = [];
1188
+ for (var i = 0, n = array.length; i < n; i++) {
1189
+ if (callback.call(context || null, array[i], i))
1190
+ result.push(array[i]);
1191
+ }
1192
+ return result;
1193
+ },
1194
+
1195
+ asyncEach: function(list, iterator, callback, context) {
1196
+ var n = list.length,
1197
+ i = -1,
1198
+ calls = 0,
1199
+ looping = false;
1200
+
1201
+ var iterate = function() {
1202
+ calls -= 1;
1203
+ i += 1;
1204
+ if (i === n) return callback && callback.call(context);
1205
+ iterator(list[i], resume);
1206
+ };
1207
+
1208
+ var loop = function() {
1209
+ if (looping) return;
1210
+ looping = true;
1211
+ while (calls > 0) iterate();
1212
+ looping = false;
1213
+ };
1214
+
1215
+ var resume = function() {
1216
+ calls += 1;
1217
+ loop();
1218
+ };
1219
+ resume();
1220
+ }
1221
+ };
1222
+
1223
+
1224
+ /***/ },
1225
+ /* 12 */
1226
+ /***/ function(module, exports) {
1227
+
1228
+ /* WEBPACK VAR INJECTION */(function(global) {'use strict';
1229
+
1230
+ var Event = {
1231
+ _registry: [],
1232
+
1233
+ on: function(element, eventName, callback, context) {
1234
+ var wrapped = function() { callback.call(context) };
1235
+
1236
+ if (element.addEventListener)
1237
+ element.addEventListener(eventName, wrapped, false);
1238
+ else
1239
+ element.attachEvent('on' + eventName, wrapped);
1240
+
1241
+ this._registry.push({
1242
+ _element: element,
1243
+ _type: eventName,
1244
+ _callback: callback,
1245
+ _context: context,
1246
+ _handler: wrapped
1247
+ });
1248
+ },
1249
+
1250
+ detach: function(element, eventName, callback, context) {
1251
+ var i = this._registry.length, register;
1252
+ while (i--) {
1253
+ register = this._registry[i];
1254
+
1255
+ if ((element && element !== register._element) ||
1256
+ (eventName && eventName !== register._type) ||
1257
+ (callback && callback !== register._callback) ||
1258
+ (context && context !== register._context))
1259
+ continue;
1260
+
1261
+ if (register._element.removeEventListener)
1262
+ register._element.removeEventListener(register._type, register._handler, false);
1263
+ else
1264
+ register._element.detachEvent('on' + register._type, register._handler);
1265
+
1266
+ this._registry.splice(i,1);
1267
+ register = null;
1268
+ }
1269
+ }
1270
+ };
1271
+
1272
+ if (global.onunload !== undefined)
1273
+ Event.on(global, 'unload', Event.detach, Event);
1274
+
1275
+ module.exports = {
1276
+ Event: Event
1277
+ };
1278
+
1279
+ /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
1280
+
1281
+ /***/ },
1282
+ /* 13 */
1283
+ /***/ function(module, exports, __webpack_require__) {
1284
+
1285
+ 'use strict';
1286
+
1287
+ var array = __webpack_require__(11);
1288
+
1289
+ module.exports = function(options, validKeys) {
1290
+ for (var key in options) {
1291
+ if (array.indexOf(validKeys, key) < 0)
1292
+ throw new Error('Unrecognized option: ' + key);
1293
+ }
1294
+ };
1295
+
1296
+
1297
+ /***/ },
1298
+ /* 14 */
1299
+ /***/ function(module, exports, __webpack_require__) {
1300
+
1301
+ /* WEBPACK VAR INJECTION */(function(global) {'use strict';
1302
+
1303
+ var Promise = __webpack_require__(9);
1304
+
1305
+ module.exports = {
1306
+ then: function(callback, errback) {
1307
+ var self = this;
1308
+ if (!this._promise)
1309
+ this._promise = new Promise(function(resolve, reject) {
1310
+ self._resolve = resolve;
1311
+ self._reject = reject;
1312
+ });
1313
+
1314
+ if (arguments.length === 0)
1315
+ return this._promise;
1316
+ else
1317
+ return this._promise.then(callback, errback);
1318
+ },
1319
+
1320
+ callback: function(callback, context) {
1321
+ return this.then(function(value) { callback.call(context, value) });
1322
+ },
1323
+
1324
+ errback: function(callback, context) {
1325
+ return this.then(null, function(reason) { callback.call(context, reason) });
1326
+ },
1327
+
1328
+ timeout: function(seconds, message) {
1329
+ this.then();
1330
+ var self = this;
1331
+ this._timer = global.setTimeout(function() {
1332
+ self._reject(message);
1333
+ }, seconds * 1000);
1334
+ },
1335
+
1336
+ setDeferredStatus: function(status, value) {
1337
+ if (this._timer) global.clearTimeout(this._timer);
1338
+
1339
+ this.then();
1340
+
1341
+ if (status === 'succeeded')
1342
+ this._resolve(value);
1343
+ else if (status === 'failed')
1344
+ this._reject(value);
1345
+ else
1346
+ delete this._promise;
1347
+ }
1348
+ };
1349
+
1350
+ /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
1351
+
1352
+ /***/ },
1353
+ /* 15 */
1354
+ /***/ function(module, exports, __webpack_require__) {
1355
+
1356
+ 'use strict';
1357
+
1358
+ var extend = __webpack_require__(8),
1359
+ EventEmitter = __webpack_require__(16);
1360
+
1361
+ var Publisher = {
1362
+ countListeners: function(eventType) {
1363
+ return this.listeners(eventType).length;
1364
+ },
1365
+
1366
+ bind: function(eventType, listener, context) {
1367
+ var slice = Array.prototype.slice,
1368
+ handler = function() { listener.apply(context, slice.call(arguments)) };
1369
+
1370
+ this._listeners = this._listeners || [];
1371
+ this._listeners.push([eventType, listener, context, handler]);
1372
+ return this.on(eventType, handler);
1373
+ },
1374
+
1375
+ unbind: function(eventType, listener, context) {
1376
+ this._listeners = this._listeners || [];
1377
+ var n = this._listeners.length, tuple;
1378
+
1379
+ while (n--) {
1380
+ tuple = this._listeners[n];
1381
+ if (tuple[0] !== eventType) continue;
1382
+ if (listener && (tuple[1] !== listener || tuple[2] !== context)) continue;
1383
+ this._listeners.splice(n, 1);
1384
+ this.removeListener(eventType, tuple[3]);
1385
+ }
1386
+ }
1387
+ };
1388
+
1389
+ extend(Publisher, EventEmitter.prototype);
1390
+ Publisher.trigger = Publisher.emit;
1391
+
1392
+ module.exports = Publisher;
1393
+
1394
+
1395
+ /***/ },
1396
+ /* 16 */
1397
+ /***/ function(module, exports) {
1398
+
1399
+ /*
1400
+ Copyright Joyent, Inc. and other Node contributors. All rights reserved.
1401
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
1402
+ this software and associated documentation files (the "Software"), to deal in
1403
+ the Software without restriction, including without limitation the rights to
1404
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
1405
+ of the Software, and to permit persons to whom the Software is furnished to do
1406
+ so, subject to the following conditions:
1407
+
1408
+ The above copyright notice and this permission notice shall be included in all
1409
+ copies or substantial portions of the Software.
1410
+
1411
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1412
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1413
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1414
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1415
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1416
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1417
+ SOFTWARE.
1418
+ */
1419
+
1420
+ var isArray = typeof Array.isArray === 'function'
1421
+ ? Array.isArray
1422
+ : function (xs) {
1423
+ return Object.prototype.toString.call(xs) === '[object Array]'
1424
+ }
1425
+ ;
1426
+ function indexOf (xs, x) {
1427
+ if (xs.indexOf) return xs.indexOf(x);
1428
+ for (var i = 0; i < xs.length; i++) {
1429
+ if (x === xs[i]) return i;
1430
+ }
1431
+ return -1;
1432
+ }
1433
+
1434
+ function EventEmitter() {}
1435
+ module.exports = EventEmitter;
1436
+
1437
+ EventEmitter.prototype.emit = function(type) {
1438
+ // If there is no 'error' event listener then throw.
1439
+ if (type === 'error') {
1440
+ if (!this._events || !this._events.error ||
1441
+ (isArray(this._events.error) && !this._events.error.length))
1442
+ {
1443
+ if (arguments[1] instanceof Error) {
1444
+ throw arguments[1]; // Unhandled 'error' event
1445
+ } else {
1446
+ throw new Error("Uncaught, unspecified 'error' event.");
1447
+ }
1448
+ return false;
1449
+ }
1450
+ }
1451
+
1452
+ if (!this._events) return false;
1453
+ var handler = this._events[type];
1454
+ if (!handler) return false;
1455
+
1456
+ if (typeof handler == 'function') {
1457
+ switch (arguments.length) {
1458
+ // fast cases
1459
+ case 1:
1460
+ handler.call(this);
1461
+ break;
1462
+ case 2:
1463
+ handler.call(this, arguments[1]);
1464
+ break;
1465
+ case 3:
1466
+ handler.call(this, arguments[1], arguments[2]);
1467
+ break;
1468
+ // slower
1469
+ default:
1470
+ var args = Array.prototype.slice.call(arguments, 1);
1471
+ handler.apply(this, args);
1472
+ }
1473
+ return true;
1474
+
1475
+ } else if (isArray(handler)) {
1476
+ var args = Array.prototype.slice.call(arguments, 1);
1477
+
1478
+ var listeners = handler.slice();
1479
+ for (var i = 0, l = listeners.length; i < l; i++) {
1480
+ listeners[i].apply(this, args);
1481
+ }
1482
+ return true;
1483
+
1484
+ } else {
1485
+ return false;
1486
+ }
1487
+ };
1488
+
1489
+ // EventEmitter is defined in src/node_events.cc
1490
+ // EventEmitter.prototype.emit() is also defined there.
1491
+ EventEmitter.prototype.addListener = function(type, listener) {
1492
+ if ('function' !== typeof listener) {
1493
+ throw new Error('addListener only takes instances of Function');
1494
+ }
1495
+
1496
+ if (!this._events) this._events = {};
1497
+
1498
+ // To avoid recursion in the case that type == "newListeners"! Before
1499
+ // adding it to the listeners, first emit "newListeners".
1500
+ this.emit('newListener', type, listener);
1501
+
1502
+ if (!this._events[type]) {
1503
+ // Optimize the case of one listener. Don't need the extra array object.
1504
+ this._events[type] = listener;
1505
+ } else if (isArray(this._events[type])) {
1506
+ // If we've already got an array, just append.
1507
+ this._events[type].push(listener);
1508
+ } else {
1509
+ // Adding the second element, need to change to array.
1510
+ this._events[type] = [this._events[type], listener];
1511
+ }
1512
+
1513
+ return this;
1514
+ };
1515
+
1516
+ EventEmitter.prototype.on = EventEmitter.prototype.addListener;
1517
+
1518
+ EventEmitter.prototype.once = function(type, listener) {
1519
+ var self = this;
1520
+ self.on(type, function g() {
1521
+ self.removeListener(type, g);
1522
+ listener.apply(this, arguments);
1523
+ });
1524
+
1525
+ return this;
1526
+ };
1527
+
1528
+ EventEmitter.prototype.removeListener = function(type, listener) {
1529
+ if ('function' !== typeof listener) {
1530
+ throw new Error('removeListener only takes instances of Function');
1531
+ }
1532
+
1533
+ // does not use listeners(), so no side effect of creating _events[type]
1534
+ if (!this._events || !this._events[type]) return this;
1535
+
1536
+ var list = this._events[type];
1537
+
1538
+ if (isArray(list)) {
1539
+ var i = indexOf(list, listener);
1540
+ if (i < 0) return this;
1541
+ list.splice(i, 1);
1542
+ if (list.length == 0)
1543
+ delete this._events[type];
1544
+ } else if (this._events[type] === listener) {
1545
+ delete this._events[type];
1546
+ }
1547
+
1548
+ return this;
1549
+ };
1550
+
1551
+ EventEmitter.prototype.removeAllListeners = function(type) {
1552
+ if (arguments.length === 0) {
1553
+ this._events = {};
1554
+ return this;
1555
+ }
1556
+
1557
+ // does not use listeners(), so no side effect of creating _events[type]
1558
+ if (type && this._events && this._events[type]) this._events[type] = null;
1559
+ return this;
1560
+ };
1561
+
1562
+ EventEmitter.prototype.listeners = function(type) {
1563
+ if (!this._events) this._events = {};
1564
+ if (!this._events[type]) this._events[type] = [];
1565
+ if (!isArray(this._events[type])) {
1566
+ this._events[type] = [this._events[type]];
1567
+ }
1568
+ return this._events[type];
1569
+ };
1570
+
1571
+
1572
+ /***/ },
1573
+ /* 17 */
1574
+ /***/ function(module, exports, __webpack_require__) {
1575
+
1576
+ 'use strict';
1577
+
1578
+ var Class = __webpack_require__(7),
1579
+ extend = __webpack_require__(8),
1580
+ Publisher = __webpack_require__(15),
1581
+ Grammar = __webpack_require__(18);
1582
+
1583
+ var Channel = Class({
1584
+ initialize: function(name) {
1585
+ this.id = this.name = name;
1586
+ },
1587
+
1588
+ push: function(message) {
1589
+ this.trigger('message', message);
1590
+ },
1591
+
1592
+ isUnused: function() {
1593
+ return this.countListeners('message') === 0;
1594
+ }
1595
+ });
1596
+
1597
+ extend(Channel.prototype, Publisher);
1598
+
1599
+ extend(Channel, {
1600
+ HANDSHAKE: '/meta/handshake',
1601
+ CONNECT: '/meta/connect',
1602
+ SUBSCRIBE: '/meta/subscribe',
1603
+ UNSUBSCRIBE: '/meta/unsubscribe',
1604
+ DISCONNECT: '/meta/disconnect',
1605
+
1606
+ META: 'meta',
1607
+ SERVICE: 'service',
1608
+
1609
+ expand: function(name) {
1610
+ var segments = this.parse(name),
1611
+ channels = ['/**', name];
1612
+
1613
+ var copy = segments.slice();
1614
+ copy[copy.length - 1] = '*';
1615
+ channels.push(this.unparse(copy));
1616
+
1617
+ for (var i = 1, n = segments.length; i < n; i++) {
1618
+ copy = segments.slice(0, i);
1619
+ copy.push('**');
1620
+ channels.push(this.unparse(copy));
1621
+ }
1622
+
1623
+ return channels;
1624
+ },
1625
+
1626
+ isValid: function(name) {
1627
+ return Grammar.CHANNEL_NAME.test(name) ||
1628
+ Grammar.CHANNEL_PATTERN.test(name);
1629
+ },
1630
+
1631
+ parse: function(name) {
1632
+ if (!this.isValid(name)) return null;
1633
+ return name.split('/').slice(1);
1634
+ },
1635
+
1636
+ unparse: function(segments) {
1637
+ return '/' + segments.join('/');
1638
+ },
1639
+
1640
+ isMeta: function(name) {
1641
+ var segments = this.parse(name);
1642
+ return segments ? (segments[0] === this.META) : null;
1643
+ },
1644
+
1645
+ isService: function(name) {
1646
+ var segments = this.parse(name);
1647
+ return segments ? (segments[0] === this.SERVICE) : null;
1648
+ },
1649
+
1650
+ isSubscribable: function(name) {
1651
+ if (!this.isValid(name)) return null;
1652
+ return !this.isMeta(name) && !this.isService(name);
1653
+ },
1654
+
1655
+ Set: Class({
1656
+ initialize: function() {
1657
+ this._channels = {};
1658
+ },
1659
+
1660
+ getKeys: function() {
1661
+ var keys = [];
1662
+ for (var key in this._channels) keys.push(key);
1663
+ return keys;
1664
+ },
1665
+
1666
+ remove: function(name) {
1667
+ delete this._channels[name];
1668
+ },
1669
+
1670
+ hasSubscription: function(name) {
1671
+ return this._channels.hasOwnProperty(name);
1672
+ },
1673
+
1674
+ subscribe: function(names, subscription) {
1675
+ var name;
1676
+ for (var i = 0, n = names.length; i < n; i++) {
1677
+ name = names[i];
1678
+ var channel = this._channels[name] = this._channels[name] || new Channel(name);
1679
+ channel.bind('message', subscription);
1680
+ }
1681
+ },
1682
+
1683
+ unsubscribe: function(name, subscription) {
1684
+ var channel = this._channels[name];
1685
+ if (!channel) return false;
1686
+ channel.unbind('message', subscription);
1687
+
1688
+ if (channel.isUnused()) {
1689
+ this.remove(name);
1690
+ return true;
1691
+ } else {
1692
+ return false;
1693
+ }
1694
+ },
1695
+
1696
+ distributeMessage: function(message) {
1697
+ var channels = Channel.expand(message.channel);
1698
+
1699
+ for (var i = 0, n = channels.length; i < n; i++) {
1700
+ var channel = this._channels[channels[i]];
1701
+ if (channel) channel.trigger('message', message);
1702
+ }
1703
+ }
1704
+ })
1705
+ });
1706
+
1707
+ module.exports = Channel;
1708
+
1709
+
1710
+ /***/ },
1711
+ /* 18 */
1712
+ /***/ function(module, exports) {
1713
+
1714
+ 'use strict';
1715
+
1716
+ module.exports = {
1717
+ CHANNEL_NAME: /^\/(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)))+(\/(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)))+)*$/,
1718
+ CHANNEL_PATTERN: /^(\/(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)))+)*\/\*{1,2}$/,
1719
+ ERROR: /^([0-9][0-9][0-9]:(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)| |\/|\*|\.))*(,(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)| |\/|\*|\.))*)*:(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)| |\/|\*|\.))*|[0-9][0-9][0-9]::(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)| |\/|\*|\.))*)$/,
1720
+ VERSION: /^([0-9])+(\.(([a-z]|[A-Z])|[0-9])(((([a-z]|[A-Z])|[0-9])|\-|\_))*)*$/
1721
+ };
1722
+
1723
+
1724
+ /***/ },
1725
+ /* 19 */
1726
+ /***/ function(module, exports, __webpack_require__) {
1727
+
1728
+ /* WEBPACK VAR INJECTION */(function(global) {'use strict';
1729
+
1730
+ var Class = __webpack_require__(7),
1731
+ URI = __webpack_require__(10),
1732
+ cookies = __webpack_require__(20),
1733
+ extend = __webpack_require__(8),
1734
+ Logging = __webpack_require__(2),
1735
+ Publisher = __webpack_require__(15),
1736
+ Transport = __webpack_require__(21),
1737
+ Scheduler = __webpack_require__(32);
1738
+
1739
+ var Dispatcher = Class({ className: 'Dispatcher',
1740
+ MAX_REQUEST_SIZE: 2048,
1741
+ DEFAULT_RETRY: 5,
1742
+
1743
+ UP: 1,
1744
+ DOWN: 2,
1745
+
1746
+ initialize: function(client, endpoint, options) {
1747
+ this._client = client;
1748
+ this.endpoint = URI.parse(endpoint);
1749
+ this._alternates = options.endpoints || {};
1750
+
1751
+ this.cookies = cookies.CookieJar && new cookies.CookieJar();
1752
+ this._disabled = [];
1753
+ this._envelopes = {};
1754
+ this.headers = {};
1755
+ this.retry = options.retry || this.DEFAULT_RETRY;
1756
+ this._scheduler = options.scheduler || Scheduler;
1757
+ this._state = 0;
1758
+ this.transports = {};
1759
+ this.wsExtensions = [];
1760
+
1761
+ this.proxy = options.proxy || {};
1762
+ if (typeof this._proxy === 'string') this._proxy = {origin: this._proxy};
1763
+
1764
+ var exts = options.websocketExtensions;
1765
+ if (exts) {
1766
+ exts = [].concat(exts);
1767
+ for (var i = 0, n = exts.length; i < n; i++)
1768
+ this.addWebsocketExtension(exts[i]);
1769
+ }
1770
+
1771
+ this.tls = options.tls || {};
1772
+ this.tls.ca = this.tls.ca || options.ca;
1773
+
1774
+ for (var type in this._alternates)
1775
+ this._alternates[type] = URI.parse(this._alternates[type]);
1776
+
1777
+ this.maxRequestSize = this.MAX_REQUEST_SIZE;
1778
+ },
1779
+
1780
+ endpointFor: function(connectionType) {
1781
+ return this._alternates[connectionType] || this.endpoint;
1782
+ },
1783
+
1784
+ addWebsocketExtension: function(extension) {
1785
+ this.wsExtensions.push(extension);
1786
+ },
1787
+
1788
+ disable: function(feature) {
1789
+ this._disabled.push(feature);
1790
+ },
1791
+
1792
+ setHeader: function(name, value) {
1793
+ this.headers[name] = value;
1794
+ },
1795
+
1796
+ close: function() {
1797
+ var transport = this._transport;
1798
+ delete this._transport;
1799
+ if (transport) transport.close();
1800
+ },
1801
+
1802
+ getConnectionTypes: function() {
1803
+ return Transport.getConnectionTypes();
1804
+ },
1805
+
1806
+ selectTransport: function(transportTypes) {
1807
+ Transport.get(this, transportTypes, this._disabled, function(transport) {
1808
+ this.debug('Selected ? transport for ?', transport.connectionType, URI.stringify(transport.endpoint));
1809
+
1810
+ if (transport === this._transport) return;
1811
+ if (this._transport) this._transport.close();
1812
+
1813
+ this._transport = transport;
1814
+ this.connectionType = transport.connectionType;
1815
+ }, this);
1816
+ },
1817
+
1818
+ sendMessage: function(message, timeout, options) {
1819
+ options = options || {};
1820
+
1821
+ var id = message.id,
1822
+ attempts = options.attempts,
1823
+ deadline = options.deadline && new Date().getTime() + (options.deadline * 1000),
1824
+ envelope = this._envelopes[id],
1825
+ scheduler;
1826
+
1827
+ if (!envelope) {
1828
+ scheduler = new this._scheduler(message, {timeout: timeout, interval: this.retry, attempts: attempts, deadline: deadline});
1829
+ envelope = this._envelopes[id] = {message: message, scheduler: scheduler};
1830
+ }
1831
+
1832
+ this._sendEnvelope(envelope);
1833
+ },
1834
+
1835
+ _sendEnvelope: function(envelope) {
1836
+ if (!this._transport) return;
1837
+ if (envelope.request || envelope.timer) return;
1838
+
1839
+ var message = envelope.message,
1840
+ scheduler = envelope.scheduler,
1841
+ self = this;
1842
+
1843
+ if (!scheduler.isDeliverable()) {
1844
+ scheduler.abort();
1845
+ delete this._envelopes[message.id];
1846
+ return;
1847
+ }
1848
+
1849
+ envelope.timer = global.setTimeout(function() {
1850
+ self.handleError(message);
1851
+ }, scheduler.getTimeout() * 1000);
1852
+
1853
+ scheduler.send();
1854
+ envelope.request = this._transport.sendMessage(message);
1855
+ },
1856
+
1857
+ handleResponse: function(reply) {
1858
+ var envelope = this._envelopes[reply.id];
1859
+
1860
+ if (reply.successful !== undefined && envelope) {
1861
+ envelope.scheduler.succeed();
1862
+ delete this._envelopes[reply.id];
1863
+ global.clearTimeout(envelope.timer);
1864
+ }
1865
+
1866
+ this.trigger('message', reply);
1867
+
1868
+ if (this._state === this.UP) return;
1869
+ this._state = this.UP;
1870
+ this._client.trigger('transport:up');
1871
+ },
1872
+
1873
+ handleError: function(message, immediate) {
1874
+ var envelope = this._envelopes[message.id],
1875
+ request = envelope && envelope.request,
1876
+ self = this;
1877
+
1878
+ if (!request) return;
1879
+
1880
+ request.then(function(req) {
1881
+ if (req && req.abort) req.abort();
1882
+ });
1883
+
1884
+ var scheduler = envelope.scheduler;
1885
+ scheduler.fail();
1886
+
1887
+ global.clearTimeout(envelope.timer);
1888
+ envelope.request = envelope.timer = null;
1889
+
1890
+ if (immediate) {
1891
+ this._sendEnvelope(envelope);
1892
+ } else {
1893
+ envelope.timer = global.setTimeout(function() {
1894
+ envelope.timer = null;
1895
+ self._sendEnvelope(envelope);
1896
+ }, scheduler.getInterval() * 1000);
1897
+ }
1898
+
1899
+ if (this._state === this.DOWN) return;
1900
+ this._state = this.DOWN;
1901
+ this._client.trigger('transport:down');
1902
+ }
1903
+ });
1904
+
1905
+ Dispatcher.create = function(client, endpoint, options) {
1906
+ return new Dispatcher(client, endpoint, options);
1907
+ };
1908
+
1909
+ extend(Dispatcher.prototype, Publisher);
1910
+ extend(Dispatcher.prototype, Logging);
1911
+
1912
+ module.exports = Dispatcher;
1913
+
1914
+ /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
1915
+
1916
+ /***/ },
1917
+ /* 20 */
1918
+ /***/ function(module, exports) {
1919
+
1920
+ 'use strict';
1921
+
1922
+ module.exports = {};
1923
+
1924
+
1925
+ /***/ },
1926
+ /* 21 */
1927
+ /***/ function(module, exports, __webpack_require__) {
1928
+
1929
+ 'use strict';
1930
+
1931
+ var Transport = __webpack_require__(22);
1932
+
1933
+ Transport.register('websocket', __webpack_require__(24));
1934
+ Transport.register('eventsource', __webpack_require__(28));
1935
+ Transport.register('long-polling', __webpack_require__(29));
1936
+ Transport.register('cross-origin-long-polling', __webpack_require__(30));
1937
+ Transport.register('callback-polling', __webpack_require__(31));
1938
+
1939
+ module.exports = Transport;
1940
+
1941
+
1942
+ /***/ },
1943
+ /* 22 */
1944
+ /***/ function(module, exports, __webpack_require__) {
1945
+
1946
+ 'use strict';
1947
+
1948
+ var Class = __webpack_require__(7),
1949
+ Cookie = __webpack_require__(20).Cookie,
1950
+ Promise = __webpack_require__(9),
1951
+ URI = __webpack_require__(10),
1952
+ array = __webpack_require__(11),
1953
+ extend = __webpack_require__(8),
1954
+ Logging = __webpack_require__(2),
1955
+ Timeouts = __webpack_require__(23),
1956
+ Channel = __webpack_require__(17);
1957
+
1958
+ var Transport = extend(Class({ className: 'Transport',
1959
+ DEFAULT_PORTS: {'http:': 80, 'https:': 443, 'ws:': 80, 'wss:': 443},
1960
+ SECURE_PROTOCOLS: ['https:', 'wss:'],
1961
+ MAX_DELAY: 0,
1962
+
1963
+ batching: true,
1964
+
1965
+ initialize: function(dispatcher, endpoint) {
1966
+ this._dispatcher = dispatcher;
1967
+ this.endpoint = endpoint;
1968
+ this._outbox = [];
1969
+ this._proxy = extend({}, this._dispatcher.proxy);
1970
+
1971
+ if (!this._proxy.origin && typeof process !== 'undefined') {
1972
+ this._proxy.origin = array.indexOf(this.SECURE_PROTOCOLS, this.endpoint.protocol) >= 0
1973
+ ? (process.env.HTTPS_PROXY || process.env.https_proxy)
1974
+ : (process.env.HTTP_PROXY || process.env.http_proxy);
1975
+ }
1976
+ },
1977
+
1978
+ close: function() {},
1979
+
1980
+ encode: function(messages) {
1981
+ return '';
1982
+ },
1983
+
1984
+ sendMessage: function(message) {
1985
+ this.debug('Client ? sending message to ?: ?',
1986
+ this._dispatcher.clientId, URI.stringify(this.endpoint), message);
1987
+
1988
+ if (!this.batching) return Promise.resolve(this.request([message]));
1989
+
1990
+ this._outbox.push(message);
1991
+ this._flushLargeBatch();
1992
+
1993
+ if (message.channel === Channel.HANDSHAKE)
1994
+ return this._publish(0.01);
1995
+
1996
+ if (message.channel === Channel.CONNECT)
1997
+ this._connectMessage = message;
1998
+
1999
+ return this._publish(this.MAX_DELAY);
2000
+ },
2001
+
2002
+ _makePromise: function() {
2003
+ var self = this;
2004
+
2005
+ this._requestPromise = this._requestPromise || new Promise(function(resolve) {
2006
+ self._resolvePromise = resolve;
2007
+ });
2008
+ },
2009
+
2010
+ _publish: function(delay) {
2011
+ this._makePromise();
2012
+
2013
+ this.addTimeout('publish', delay, function() {
2014
+ this._flush();
2015
+ delete this._requestPromise;
2016
+ }, this);
2017
+
2018
+ return this._requestPromise;
2019
+ },
2020
+
2021
+ _flush: function() {
2022
+ this.removeTimeout('publish');
2023
+
2024
+ if (this._outbox.length > 1 && this._connectMessage)
2025
+ this._connectMessage.advice = {timeout: 0};
2026
+
2027
+ this._resolvePromise(this.request(this._outbox));
2028
+
2029
+ this._connectMessage = null;
2030
+ this._outbox = [];
2031
+ },
2032
+
2033
+ _flushLargeBatch: function() {
2034
+ var string = this.encode(this._outbox);
2035
+ if (string.length < this._dispatcher.maxRequestSize) return;
2036
+ var last = this._outbox.pop();
2037
+
2038
+ this._makePromise();
2039
+ this._flush();
2040
+
2041
+ if (last) this._outbox.push(last);
2042
+ },
2043
+
2044
+ _receive: function(replies) {
2045
+ if (!replies) return;
2046
+ replies = [].concat(replies);
2047
+
2048
+ this.debug('Client ? received from ? via ?: ?',
2049
+ this._dispatcher.clientId, URI.stringify(this.endpoint), this.connectionType, replies);
2050
+
2051
+ for (var i = 0, n = replies.length; i < n; i++)
2052
+ this._dispatcher.handleResponse(replies[i]);
2053
+ },
2054
+
2055
+ _handleError: function(messages, immediate) {
2056
+ messages = [].concat(messages);
2057
+
2058
+ this.debug('Client ? failed to send to ? via ?: ?',
2059
+ this._dispatcher.clientId, URI.stringify(this.endpoint), this.connectionType, messages);
2060
+
2061
+ for (var i = 0, n = messages.length; i < n; i++)
2062
+ this._dispatcher.handleError(messages[i]);
2063
+ },
2064
+
2065
+ _getCookies: function() {
2066
+ var cookies = this._dispatcher.cookies,
2067
+ url = URI.stringify(this.endpoint);
2068
+
2069
+ if (!cookies) return '';
2070
+
2071
+ return array.map(cookies.getCookiesSync(url), function(cookie) {
2072
+ return cookie.cookieString();
2073
+ }).join('; ');
2074
+ },
2075
+
2076
+ _storeCookies: function(setCookie) {
2077
+ var cookies = this._dispatcher.cookies,
2078
+ url = URI.stringify(this.endpoint),
2079
+ cookie;
2080
+
2081
+ if (!setCookie || !cookies) return;
2082
+ setCookie = [].concat(setCookie);
2083
+
2084
+ for (var i = 0, n = setCookie.length; i < n; i++) {
2085
+ cookie = Cookie.parse(setCookie[i]);
2086
+ cookies.setCookieSync(cookie, url);
2087
+ }
2088
+ }
2089
+
2090
+ }), {
2091
+ get: function(dispatcher, allowed, disabled, callback, context) {
2092
+ var endpoint = dispatcher.endpoint;
2093
+
2094
+ array.asyncEach(this._transports, function(pair, resume) {
2095
+ var connType = pair[0], klass = pair[1],
2096
+ connEndpoint = dispatcher.endpointFor(connType);
2097
+
2098
+ if (array.indexOf(disabled, connType) >= 0)
2099
+ return resume();
2100
+
2101
+ if (array.indexOf(allowed, connType) < 0) {
2102
+ klass.isUsable(dispatcher, connEndpoint, function() {});
2103
+ return resume();
2104
+ }
2105
+
2106
+ klass.isUsable(dispatcher, connEndpoint, function(isUsable) {
2107
+ if (!isUsable) return resume();
2108
+ var transport = klass.hasOwnProperty('create') ? klass.create(dispatcher, connEndpoint) : new klass(dispatcher, connEndpoint);
2109
+ callback.call(context, transport);
2110
+ });
2111
+ }, function() {
2112
+ throw new Error('Could not find a usable connection type for ' + URI.stringify(endpoint));
2113
+ });
2114
+ },
2115
+
2116
+ register: function(type, klass) {
2117
+ this._transports.push([type, klass]);
2118
+ klass.prototype.connectionType = type;
2119
+ },
2120
+
2121
+ getConnectionTypes: function() {
2122
+ return array.map(this._transports, function(t) { return t[0] });
2123
+ },
2124
+
2125
+ _transports: []
2126
+ });
2127
+
2128
+ extend(Transport.prototype, Logging);
2129
+ extend(Transport.prototype, Timeouts);
2130
+
2131
+ module.exports = Transport;
2132
+
2133
+
2134
+ /***/ },
2135
+ /* 23 */
2136
+ /***/ function(module, exports) {
2137
+
2138
+ /* WEBPACK VAR INJECTION */(function(global) {'use strict';
2139
+
2140
+ module.exports = {
2141
+ addTimeout: function(name, delay, callback, context) {
2142
+ this._timeouts = this._timeouts || {};
2143
+ if (this._timeouts.hasOwnProperty(name)) return;
2144
+ var self = this;
2145
+ this._timeouts[name] = global.setTimeout(function() {
2146
+ delete self._timeouts[name];
2147
+ callback.call(context);
2148
+ }, 1000 * delay);
2149
+ },
2150
+
2151
+ removeTimeout: function(name) {
2152
+ this._timeouts = this._timeouts || {};
2153
+ var timeout = this._timeouts[name];
2154
+ if (!timeout) return;
2155
+ global.clearTimeout(timeout);
2156
+ delete this._timeouts[name];
2157
+ },
2158
+
2159
+ removeAllTimeouts: function() {
2160
+ this._timeouts = this._timeouts || {};
2161
+ for (var name in this._timeouts) this.removeTimeout(name);
2162
+ }
2163
+ };
2164
+
2165
+ /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
2166
+
2167
+ /***/ },
2168
+ /* 24 */
2169
+ /***/ function(module, exports, __webpack_require__) {
2170
+
2171
+ /* WEBPACK VAR INJECTION */(function(global) {'use strict';
2172
+
2173
+ var Class = __webpack_require__(7),
2174
+ Promise = __webpack_require__(9),
2175
+ Set = __webpack_require__(25),
2176
+ URI = __webpack_require__(10),
2177
+ browser = __webpack_require__(12),
2178
+ copyObject = __webpack_require__(26),
2179
+ extend = __webpack_require__(8),
2180
+ toJSON = __webpack_require__(3),
2181
+ ws = __webpack_require__(27),
2182
+ Deferrable = __webpack_require__(14),
2183
+ Transport = __webpack_require__(22);
2184
+
2185
+ var WebSocket = extend(Class(Transport, {
2186
+ UNCONNECTED: 1,
2187
+ CONNECTING: 2,
2188
+ CONNECTED: 3,
2189
+
2190
+ batching: false,
2191
+
2192
+ isUsable: function(callback, context) {
2193
+ this.callback(function() { callback.call(context, true) });
2194
+ this.errback(function() { callback.call(context, false) });
2195
+ this.connect();
2196
+ },
2197
+
2198
+ request: function(messages) {
2199
+ this._pending = this._pending || new Set();
2200
+ for (var i = 0, n = messages.length; i < n; i++) this._pending.add(messages[i]);
2201
+
2202
+ var self = this;
2203
+
2204
+ var promise = new Promise(function(resolve, reject) {
2205
+ self.callback(function(socket) {
2206
+ if (!socket || socket.readyState !== 1) return;
2207
+ socket.send(toJSON(messages));
2208
+ resolve(socket);
2209
+ });
2210
+
2211
+ self.connect();
2212
+ });
2213
+
2214
+ return {
2215
+ abort: function() { promise.then(function(ws) { ws.close() }) }
2216
+ };
2217
+ },
2218
+
2219
+ connect: function() {
2220
+ if (WebSocket._unloaded) return;
2221
+
2222
+ this._state = this._state || this.UNCONNECTED;
2223
+ if (this._state !== this.UNCONNECTED) return;
2224
+ this._state = this.CONNECTING;
2225
+
2226
+ var socket = this._createSocket();
2227
+ if (!socket) return this.setDeferredStatus('failed');
2228
+
2229
+ var self = this;
2230
+
2231
+ socket.onopen = function() {
2232
+ if (socket.headers) self._storeCookies(socket.headers['set-cookie']);
2233
+ self._socket = socket;
2234
+ self._state = self.CONNECTED;
2235
+ self._everConnected = true;
2236
+ self._ping();
2237
+ self.setDeferredStatus('succeeded', socket);
2238
+ };
2239
+
2240
+ var closed = false;
2241
+ socket.onclose = socket.onerror = function() {
2242
+ if (closed) return;
2243
+ closed = true;
2244
+
2245
+ var wasConnected = (self._state === self.CONNECTED);
2246
+ socket.onopen = socket.onclose = socket.onerror = socket.onmessage = null;
2247
+
2248
+ delete self._socket;
2249
+ self._state = self.UNCONNECTED;
2250
+ self.removeTimeout('ping');
2251
+
2252
+ var pending = self._pending ? self._pending.toArray() : [];
2253
+ delete self._pending;
2254
+
2255
+ if (wasConnected || self._everConnected) {
2256
+ self.setDeferredStatus('unknown');
2257
+ self._handleError(pending, wasConnected);
2258
+ } else {
2259
+ self.setDeferredStatus('failed');
2260
+ }
2261
+ };
2262
+
2263
+ socket.onmessage = function(event) {
2264
+ var replies;
2265
+ try { replies = JSON.parse(event.data) } catch (error) {}
2266
+
2267
+ if (!replies) return;
2268
+
2269
+ replies = [].concat(replies);
2270
+
2271
+ for (var i = 0, n = replies.length; i < n; i++) {
2272
+ if (replies[i].successful === undefined) continue;
2273
+ self._pending.remove(replies[i]);
2274
+ }
2275
+ self._receive(replies);
2276
+ };
2277
+ },
2278
+
2279
+ close: function() {
2280
+ if (!this._socket) return;
2281
+ this._socket.close();
2282
+ },
2283
+
2284
+ _createSocket: function() {
2285
+ var url = WebSocket.getSocketUrl(this.endpoint),
2286
+ headers = this._dispatcher.headers,
2287
+ extensions = this._dispatcher.wsExtensions,
2288
+ cookie = this._getCookies(),
2289
+ tls = this._dispatcher.tls,
2290
+ options = {extensions: extensions, headers: headers, proxy: this._proxy, tls: tls};
2291
+
2292
+ if (cookie !== '') options.headers['Cookie'] = cookie;
2293
+
2294
+ return ws.create(url, [], options);
2295
+ },
2296
+
2297
+ _ping: function() {
2298
+ if (!this._socket || this._socket.readyState !== 1) return;
2299
+ this._socket.send('[]');
2300
+ this.addTimeout('ping', this._dispatcher.timeout / 2, this._ping, this);
2301
+ }
2302
+
2303
+ }), {
2304
+ PROTOCOLS: {
2305
+ 'http:': 'ws:',
2306
+ 'https:': 'wss:'
2307
+ },
2308
+
2309
+ create: function(dispatcher, endpoint) {
2310
+ var sockets = dispatcher.transports.websocket = dispatcher.transports.websocket || {};
2311
+ sockets[endpoint.href] = sockets[endpoint.href] || new this(dispatcher, endpoint);
2312
+ return sockets[endpoint.href];
2313
+ },
2314
+
2315
+ getSocketUrl: function(endpoint) {
2316
+ endpoint = copyObject(endpoint);
2317
+ endpoint.protocol = this.PROTOCOLS[endpoint.protocol];
2318
+ return URI.stringify(endpoint);
2319
+ },
2320
+
2321
+ isUsable: function(dispatcher, endpoint, callback, context) {
2322
+ this.create(dispatcher, endpoint).isUsable(callback, context);
2323
+ }
2324
+ });
2325
+
2326
+ extend(WebSocket.prototype, Deferrable);
2327
+
2328
+ if (browser.Event && global.onbeforeunload !== undefined)
2329
+ browser.Event.on(global, 'beforeunload', function() { WebSocket._unloaded = true });
2330
+
2331
+ module.exports = WebSocket;
2332
+
2333
+ /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
2334
+
2335
+ /***/ },
2336
+ /* 25 */
2337
+ /***/ function(module, exports, __webpack_require__) {
2338
+
2339
+ 'use strict';
2340
+
2341
+ var Class = __webpack_require__(7);
2342
+
2343
+ module.exports = Class({
2344
+ initialize: function() {
2345
+ this._index = {};
2346
+ },
2347
+
2348
+ add: function(item) {
2349
+ var key = (item.id !== undefined) ? item.id : item;
2350
+ if (this._index.hasOwnProperty(key)) return false;
2351
+ this._index[key] = item;
2352
+ return true;
2353
+ },
2354
+
2355
+ forEach: function(block, context) {
2356
+ for (var key in this._index) {
2357
+ if (this._index.hasOwnProperty(key))
2358
+ block.call(context, this._index[key]);
2359
+ }
2360
+ },
2361
+
2362
+ isEmpty: function() {
2363
+ for (var key in this._index) {
2364
+ if (this._index.hasOwnProperty(key)) return false;
2365
+ }
2366
+ return true;
2367
+ },
2368
+
2369
+ member: function(item) {
2370
+ for (var key in this._index) {
2371
+ if (this._index[key] === item) return true;
2372
+ }
2373
+ return false;
2374
+ },
2375
+
2376
+ remove: function(item) {
2377
+ var key = (item.id !== undefined) ? item.id : item;
2378
+ var removed = this._index[key];
2379
+ delete this._index[key];
2380
+ return removed;
2381
+ },
2382
+
2383
+ toArray: function() {
2384
+ var array = [];
2385
+ this.forEach(function(item) { array.push(item) });
2386
+ return array;
2387
+ }
2388
+ });
2389
+
2390
+
2391
+ /***/ },
2392
+ /* 26 */
2393
+ /***/ function(module, exports) {
2394
+
2395
+ 'use strict';
2396
+
2397
+ var copyObject = function(object) {
2398
+ var clone, i, key;
2399
+ if (object instanceof Array) {
2400
+ clone = [];
2401
+ i = object.length;
2402
+ while (i--) clone[i] = copyObject(object[i]);
2403
+ return clone;
2404
+ } else if (typeof object === 'object') {
2405
+ clone = (object === null) ? null : {};
2406
+ for (key in object) clone[key] = copyObject(object[key]);
2407
+ return clone;
2408
+ } else {
2409
+ return object;
2410
+ }
2411
+ };
2412
+
2413
+ module.exports = copyObject;
2414
+
2415
+
2416
+ /***/ },
2417
+ /* 27 */
2418
+ /***/ function(module, exports) {
2419
+
2420
+ /* WEBPACK VAR INJECTION */(function(global) {'use strict';
2421
+
2422
+ var WS = global.MozWebSocket || global.WebSocket;
2423
+
2424
+ module.exports = {
2425
+ create: function(url, protocols, options) {
2426
+ return new WS(url);
2427
+ }
2428
+ };
2429
+
2430
+ /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
2431
+
2432
+ /***/ },
2433
+ /* 28 */
2434
+ /***/ function(module, exports, __webpack_require__) {
2435
+
2436
+ /* WEBPACK VAR INJECTION */(function(global) {'use strict';
2437
+
2438
+ var Class = __webpack_require__(7),
2439
+ URI = __webpack_require__(10),
2440
+ copyObject = __webpack_require__(26),
2441
+ extend = __webpack_require__(8),
2442
+ Deferrable = __webpack_require__(14),
2443
+ Transport = __webpack_require__(22),
2444
+ XHR = __webpack_require__(29);
2445
+
2446
+ var EventSource = extend(Class(Transport, {
2447
+ initialize: function(dispatcher, endpoint) {
2448
+ Transport.prototype.initialize.call(this, dispatcher, endpoint);
2449
+ if (!global.EventSource) return this.setDeferredStatus('failed');
2450
+
2451
+ this._xhr = new XHR(dispatcher, endpoint);
2452
+
2453
+ endpoint = copyObject(endpoint);
2454
+ endpoint.pathname += '/' + dispatcher.clientId;
2455
+
2456
+ var socket = new global.EventSource(URI.stringify(endpoint)),
2457
+ self = this;
2458
+
2459
+ socket.onopen = function() {
2460
+ self._everConnected = true;
2461
+ self.setDeferredStatus('succeeded');
2462
+ };
2463
+
2464
+ socket.onerror = function() {
2465
+ if (self._everConnected) {
2466
+ self._handleError([]);
2467
+ } else {
2468
+ self.setDeferredStatus('failed');
2469
+ socket.close();
2470
+ }
2471
+ };
2472
+
2473
+ socket.onmessage = function(event) {
2474
+ var replies;
2475
+ try { replies = JSON.parse(event.data) } catch (error) {}
2476
+
2477
+ if (replies)
2478
+ self._receive(replies);
2479
+ else
2480
+ self._handleError([]);
2481
+ };
2482
+
2483
+ this._socket = socket;
2484
+ },
2485
+
2486
+ close: function() {
2487
+ if (!this._socket) return;
2488
+ this._socket.onopen = this._socket.onerror = this._socket.onmessage = null;
2489
+ this._socket.close();
2490
+ delete this._socket;
2491
+ },
2492
+
2493
+ isUsable: function(callback, context) {
2494
+ this.callback(function() { callback.call(context, true) });
2495
+ this.errback(function() { callback.call(context, false) });
2496
+ },
2497
+
2498
+ encode: function(messages) {
2499
+ return this._xhr.encode(messages);
2500
+ },
2501
+
2502
+ request: function(messages) {
2503
+ return this._xhr.request(messages);
2504
+ }
2505
+
2506
+ }), {
2507
+ isUsable: function(dispatcher, endpoint, callback, context) {
2508
+ var id = dispatcher.clientId;
2509
+ if (!id) return callback.call(context, false);
2510
+
2511
+ XHR.isUsable(dispatcher, endpoint, function(usable) {
2512
+ if (!usable) return callback.call(context, false);
2513
+ this.create(dispatcher, endpoint).isUsable(callback, context);
2514
+ }, this);
2515
+ },
2516
+
2517
+ create: function(dispatcher, endpoint) {
2518
+ var sockets = dispatcher.transports.eventsource = dispatcher.transports.eventsource || {},
2519
+ id = dispatcher.clientId;
2520
+
2521
+ var url = copyObject(endpoint);
2522
+ url.pathname += '/' + (id || '');
2523
+ url = URI.stringify(url);
2524
+
2525
+ sockets[url] = sockets[url] || new this(dispatcher, endpoint);
2526
+ return sockets[url];
2527
+ }
2528
+ });
2529
+
2530
+ extend(EventSource.prototype, Deferrable);
2531
+
2532
+ module.exports = EventSource;
2533
+
2534
+ /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
2535
+
2536
+ /***/ },
2537
+ /* 29 */
2538
+ /***/ function(module, exports, __webpack_require__) {
2539
+
2540
+ /* WEBPACK VAR INJECTION */(function(global) {'use strict';
2541
+
2542
+ var Class = __webpack_require__(7),
2543
+ URI = __webpack_require__(10),
2544
+ browser = __webpack_require__(12),
2545
+ extend = __webpack_require__(8),
2546
+ toJSON = __webpack_require__(3),
2547
+ Transport = __webpack_require__(22);
2548
+
2549
+ var XHR = extend(Class(Transport, {
2550
+ encode: function(messages) {
2551
+ return toJSON(messages);
2552
+ },
2553
+
2554
+ request: function(messages) {
2555
+ var href = this.endpoint.href,
2556
+ self = this,
2557
+ xhr;
2558
+
2559
+ // Prefer XMLHttpRequest over ActiveXObject if they both exist
2560
+ if (global.XMLHttpRequest) {
2561
+ xhr = new XMLHttpRequest();
2562
+ } else if (global.ActiveXObject) {
2563
+ xhr = new ActiveXObject('Microsoft.XMLHTTP');
2564
+ } else {
2565
+ return this._handleError(messages);
2566
+ }
2567
+
2568
+ xhr.open('POST', href, true);
2569
+ xhr.setRequestHeader('Content-Type', 'application/json');
2570
+ xhr.setRequestHeader('Pragma', 'no-cache');
2571
+ xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
2572
+
2573
+ var headers = this._dispatcher.headers;
2574
+ for (var key in headers) {
2575
+ if (!headers.hasOwnProperty(key)) continue;
2576
+ xhr.setRequestHeader(key, headers[key]);
2577
+ }
2578
+
2579
+ var abort = function() { xhr.abort() };
2580
+ if (global.onbeforeunload !== undefined)
2581
+ browser.Event.on(global, 'beforeunload', abort);
2582
+
2583
+ xhr.onreadystatechange = function() {
2584
+ if (!xhr || xhr.readyState !== 4) return;
2585
+
2586
+ var replies = null,
2587
+ status = xhr.status,
2588
+ text = xhr.responseText,
2589
+ successful = (status >= 200 && status < 300) || status === 304 || status === 1223;
2590
+
2591
+ if (global.onbeforeunload !== undefined)
2592
+ browser.Event.detach(global, 'beforeunload', abort);
2593
+
2594
+ xhr.onreadystatechange = function() {};
2595
+ xhr = null;
2596
+
2597
+ if (!successful) return self._handleError(messages);
2598
+
2599
+ try {
2600
+ replies = JSON.parse(text);
2601
+ } catch (error) {}
2602
+
2603
+ if (replies)
2604
+ self._receive(replies);
2605
+ else
2606
+ self._handleError(messages);
2607
+ };
2608
+
2609
+ xhr.send(this.encode(messages));
2610
+ return xhr;
2611
+ }
2612
+ }), {
2613
+ isUsable: function(dispatcher, endpoint, callback, context) {
2614
+ var usable = (navigator.product === 'ReactNative')
2615
+ || URI.isSameOrigin(endpoint);
2616
+
2617
+ callback.call(context, usable);
2618
+ }
2619
+ });
2620
+
2621
+ module.exports = XHR;
2622
+
2623
+ /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
2624
+
2625
+ /***/ },
2626
+ /* 30 */
2627
+ /***/ function(module, exports, __webpack_require__) {
2628
+
2629
+ /* WEBPACK VAR INJECTION */(function(global) {'use strict';
2630
+
2631
+ var Class = __webpack_require__(7),
2632
+ Set = __webpack_require__(25),
2633
+ URI = __webpack_require__(10),
2634
+ extend = __webpack_require__(8),
2635
+ toJSON = __webpack_require__(3),
2636
+ Transport = __webpack_require__(22);
2637
+
2638
+ var CORS = extend(Class(Transport, {
2639
+ encode: function(messages) {
2640
+ return 'message=' + encodeURIComponent(toJSON(messages));
2641
+ },
2642
+
2643
+ request: function(messages) {
2644
+ var xhrClass = global.XDomainRequest ? XDomainRequest : XMLHttpRequest,
2645
+ xhr = new xhrClass(),
2646
+ id = ++CORS._id,
2647
+ headers = this._dispatcher.headers,
2648
+ self = this,
2649
+ key;
2650
+
2651
+ xhr.open('POST', URI.stringify(this.endpoint), true);
2652
+
2653
+ if (xhr.setRequestHeader) {
2654
+ xhr.setRequestHeader('Pragma', 'no-cache');
2655
+ for (key in headers) {
2656
+ if (!headers.hasOwnProperty(key)) continue;
2657
+ xhr.setRequestHeader(key, headers[key]);
2658
+ }
2659
+ }
2660
+
2661
+ var cleanUp = function() {
2662
+ if (!xhr) return false;
2663
+ CORS._pending.remove(id);
2664
+ xhr.onload = xhr.onerror = xhr.ontimeout = xhr.onprogress = null;
2665
+ xhr = null;
2666
+ };
2667
+
2668
+ xhr.onload = function() {
2669
+ var replies;
2670
+ try { replies = JSON.parse(xhr.responseText) } catch (error) {}
2671
+
2672
+ cleanUp();
2673
+
2674
+ if (replies)
2675
+ self._receive(replies);
2676
+ else
2677
+ self._handleError(messages);
2678
+ };
2679
+
2680
+ xhr.onerror = xhr.ontimeout = function() {
2681
+ cleanUp();
2682
+ self._handleError(messages);
2683
+ };
2684
+
2685
+ xhr.onprogress = function() {};
2686
+
2687
+ if (xhrClass === global.XDomainRequest)
2688
+ CORS._pending.add({id: id, xhr: xhr});
2689
+
2690
+ xhr.send(this.encode(messages));
2691
+ return xhr;
2692
+ }
2693
+ }), {
2694
+ _id: 0,
2695
+ _pending: new Set(),
2696
+
2697
+ isUsable: function(dispatcher, endpoint, callback, context) {
2698
+ if (URI.isSameOrigin(endpoint))
2699
+ return callback.call(context, false);
2700
+
2701
+ if (global.XDomainRequest)
2702
+ return callback.call(context, endpoint.protocol === location.protocol);
2703
+
2704
+ if (global.XMLHttpRequest) {
2705
+ var xhr = new XMLHttpRequest();
2706
+ return callback.call(context, xhr.withCredentials !== undefined);
2707
+ }
2708
+ return callback.call(context, false);
2709
+ }
2710
+ });
2711
+
2712
+ module.exports = CORS;
2713
+
2714
+ /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
2715
+
2716
+ /***/ },
2717
+ /* 31 */
2718
+ /***/ function(module, exports, __webpack_require__) {
2719
+
2720
+ /* WEBPACK VAR INJECTION */(function(global) {'use strict';
2721
+
2722
+ var Class = __webpack_require__(7),
2723
+ URI = __webpack_require__(10),
2724
+ copyObject = __webpack_require__(26),
2725
+ extend = __webpack_require__(8),
2726
+ toJSON = __webpack_require__(3),
2727
+ Transport = __webpack_require__(22);
2728
+
2729
+ var JSONP = extend(Class(Transport, {
2730
+ encode: function(messages) {
2731
+ var url = copyObject(this.endpoint);
2732
+ url.query.message = toJSON(messages);
2733
+ url.query.jsonp = '__jsonp' + JSONP._cbCount + '__';
2734
+ return URI.stringify(url);
2735
+ },
2736
+
2737
+ request: function(messages) {
2738
+ var head = document.getElementsByTagName('head')[0],
2739
+ script = document.createElement('script'),
2740
+ callbackName = JSONP.getCallbackName(),
2741
+ endpoint = copyObject(this.endpoint),
2742
+ self = this;
2743
+
2744
+ endpoint.query.message = toJSON(messages);
2745
+ endpoint.query.jsonp = callbackName;
2746
+
2747
+ var cleanup = function() {
2748
+ if (!global[callbackName]) return false;
2749
+ global[callbackName] = undefined;
2750
+ try { delete global[callbackName] } catch (error) {}
2751
+ script.parentNode.removeChild(script);
2752
+ };
2753
+
2754
+ global[callbackName] = function(replies) {
2755
+ cleanup();
2756
+ self._receive(replies);
2757
+ };
2758
+
2759
+ script.type = 'text/javascript';
2760
+ script.src = URI.stringify(endpoint);
2761
+ head.appendChild(script);
2762
+
2763
+ script.onerror = function() {
2764
+ cleanup();
2765
+ self._handleError(messages);
2766
+ };
2767
+
2768
+ return {abort: cleanup};
2769
+ }
2770
+ }), {
2771
+ _cbCount: 0,
2772
+
2773
+ getCallbackName: function() {
2774
+ this._cbCount += 1;
2775
+ return '__jsonp' + this._cbCount + '__';
2776
+ },
2777
+
2778
+ isUsable: function(dispatcher, endpoint, callback, context) {
2779
+ callback.call(context, true);
2780
+ }
2781
+ });
2782
+
2783
+ module.exports = JSONP;
2784
+
2785
+ /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
2786
+
2787
+ /***/ },
2788
+ /* 32 */
2789
+ /***/ function(module, exports, __webpack_require__) {
2790
+
2791
+ 'use strict';
2792
+
2793
+ var extend = __webpack_require__(8);
2794
+
2795
+ var Scheduler = function(message, options) {
2796
+ this.message = message;
2797
+ this.options = options;
2798
+ this.attempts = 0;
2799
+ };
2800
+
2801
+ extend(Scheduler.prototype, {
2802
+ getTimeout: function() {
2803
+ return this.options.timeout;
2804
+ },
2805
+
2806
+ getInterval: function() {
2807
+ return this.options.interval;
2808
+ },
2809
+
2810
+ isDeliverable: function() {
2811
+ var attempts = this.options.attempts,
2812
+ made = this.attempts,
2813
+ deadline = this.options.deadline,
2814
+ now = new Date().getTime();
2815
+
2816
+ if (attempts !== undefined && made >= attempts)
2817
+ return false;
2818
+
2819
+ if (deadline !== undefined && now > deadline)
2820
+ return false;
2821
+
2822
+ return true;
2823
+ },
2824
+
2825
+ send: function() {
2826
+ this.attempts += 1;
2827
+ },
2828
+
2829
+ succeed: function() {},
2830
+
2831
+ fail: function() {},
2832
+
2833
+ abort: function() {}
2834
+ });
2835
+
2836
+ module.exports = Scheduler;
2837
+
2838
+
2839
+ /***/ },
2840
+ /* 33 */
2841
+ /***/ function(module, exports, __webpack_require__) {
2842
+
2843
+ 'use strict';
2844
+
2845
+ var Class = __webpack_require__(7),
2846
+ Grammar = __webpack_require__(18);
2847
+
2848
+ var Error = Class({
2849
+ initialize: function(code, params, message) {
2850
+ this.code = code;
2851
+ this.params = Array.prototype.slice.call(params);
2852
+ this.message = message;
2853
+ },
2854
+
2855
+ toString: function() {
2856
+ return this.code + ':' +
2857
+ this.params.join(',') + ':' +
2858
+ this.message;
2859
+ }
2860
+ });
2861
+
2862
+ Error.parse = function(message) {
2863
+ message = message || '';
2864
+ if (!Grammar.ERROR.test(message)) return new Error(null, [], message);
2865
+
2866
+ var parts = message.split(':'),
2867
+ code = parseInt(parts[0]),
2868
+ params = parts[1].split(','),
2869
+ message = parts[2];
2870
+
2871
+ return new Error(code, params, message);
2872
+ };
2873
+
2874
+ // http://code.google.com/p/cometd/wiki/BayeuxCodes
2875
+ var errors = {
2876
+ versionMismatch: [300, 'Version mismatch'],
2877
+ conntypeMismatch: [301, 'Connection types not supported'],
2878
+ extMismatch: [302, 'Extension mismatch'],
2879
+ badRequest: [400, 'Bad request'],
2880
+ clientUnknown: [401, 'Unknown client'],
2881
+ parameterMissing: [402, 'Missing required parameter'],
2882
+ channelForbidden: [403, 'Forbidden channel'],
2883
+ channelUnknown: [404, 'Unknown channel'],
2884
+ channelInvalid: [405, 'Invalid channel'],
2885
+ extUnknown: [406, 'Unknown extension'],
2886
+ publishFailed: [407, 'Failed to publish'],
2887
+ serverError: [500, 'Internal server error']
2888
+ };
2889
+
2890
+ for (var name in errors)
2891
+ (function(name) {
2892
+ Error[name] = function() {
2893
+ return new Error(errors[name][0], arguments, errors[name][1]).toString();
2894
+ };
2895
+ })(name);
2896
+
2897
+ module.exports = Error;
2898
+
2899
+
2900
+ /***/ },
2901
+ /* 34 */
2902
+ /***/ function(module, exports, __webpack_require__) {
2903
+
2904
+ 'use strict';
2905
+
2906
+ var extend = __webpack_require__(8),
2907
+ Logging = __webpack_require__(2);
2908
+
2909
+ var Extensible = {
2910
+ addExtension: function(extension) {
2911
+ this._extensions = this._extensions || [];
2912
+ this._extensions.push(extension);
2913
+ if (extension.added) extension.added(this);
2914
+ },
2915
+
2916
+ removeExtension: function(extension) {
2917
+ if (!this._extensions) return;
2918
+ var i = this._extensions.length;
2919
+ while (i--) {
2920
+ if (this._extensions[i] !== extension) continue;
2921
+ this._extensions.splice(i,1);
2922
+ if (extension.removed) extension.removed(this);
2923
+ }
2924
+ },
2925
+
2926
+ pipeThroughExtensions: function(stage, message, request, callback, context) {
2927
+ this.debug('Passing through ? extensions: ?', stage, message);
2928
+
2929
+ if (!this._extensions) return callback.call(context, message);
2930
+ var extensions = this._extensions.slice();
2931
+
2932
+ var pipe = function(message) {
2933
+ if (!message) return callback.call(context, message);
2934
+
2935
+ var extension = extensions.shift();
2936
+ if (!extension) return callback.call(context, message);
2937
+
2938
+ var fn = extension[stage];
2939
+ if (!fn) return pipe(message);
2940
+
2941
+ if (fn.length >= 3) extension[stage](message, request, pipe);
2942
+ else extension[stage](message, pipe);
2943
+ };
2944
+ pipe(message);
2945
+ }
2946
+ };
2947
+
2948
+ extend(Extensible, Logging);
2949
+
2950
+ module.exports = Extensible;
2951
+
2952
+
2953
+ /***/ },
2954
+ /* 35 */
2955
+ /***/ function(module, exports, __webpack_require__) {
2956
+
2957
+ 'use strict';
2958
+
2959
+ var Class = __webpack_require__(7),
2960
+ Deferrable = __webpack_require__(14);
2961
+
2962
+ module.exports = Class(Deferrable);
2963
+
2964
+
2965
+ /***/ },
2966
+ /* 36 */
2967
+ /***/ function(module, exports, __webpack_require__) {
2968
+
2969
+ 'use strict';
2970
+
2971
+ var Class = __webpack_require__(7),
2972
+ extend = __webpack_require__(8),
2973
+ Deferrable = __webpack_require__(14);
2974
+
2975
+ var Subscription = Class({
2976
+ initialize: function(client, channels, callback, context) {
2977
+ this._client = client;
2978
+ this._channels = channels;
2979
+ this._callback = callback;
2980
+ this._context = context;
2981
+ this._cancelled = false;
2982
+ },
2983
+
2984
+ withChannel: function(callback, context) {
2985
+ this._withChannel = [callback, context];
2986
+ return this;
2987
+ },
2988
+
2989
+ apply: function(context, args) {
2990
+ var message = args[0];
2991
+
2992
+ if (this._callback)
2993
+ this._callback.call(this._context, message.data);
2994
+
2995
+ if (this._withChannel)
2996
+ this._withChannel[0].call(this._withChannel[1], message.channel, message.data);
2997
+ },
2998
+
2999
+ cancel: function() {
3000
+ if (this._cancelled) return;
3001
+ this._client.unsubscribe(this._channels, this);
3002
+ this._cancelled = true;
3003
+ },
3004
+
3005
+ unsubscribe: function() {
3006
+ this.cancel();
3007
+ }
3008
+ });
3009
+
3010
+ extend(Subscription.prototype, Deferrable);
3011
+
3012
+ module.exports = Subscription;
3013
+
3014
+
3015
+ /***/ }
3016
+ /******/ ]);
3017
+ //# sourceMappingURL=faye-browser.js.map