var Faye=function(t){var e={};function n(i){if(e[i])return e[i].exports;var s=e[i]={i:i,l:!1,exports:{}};return t[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)n.d(i,s,function(e){return t[e]}.bind(null,s));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=38)}([function(t,e,n){"use strict";var i=Array.prototype.forEach,s=Object.prototype.hasOwnProperty;t.exports=function(t){return i.call(arguments,(function(e,n){if(0!==n)for(var i in e)s.call(e,i)&&(t[i]=e[i])})),t}},function(t,e,n){"use strict";var i=n(0);t.exports=function(t,e){"function"!=typeof t&&(e=t,t=Object);var n=function(){return this.initialize&&this.initialize.apply(this,arguments)||this},s=function(){};return s.prototype=t.prototype,n.prototype=new s,i(n.prototype,e),n}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"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),/@/.test(c.host)&&(c.auth=c.host.split("@")[0],c.host=c.host.split("@")[1]),e=c.host.match(/^\[([^\]]+)\]|^[^:]+/),c.hostname=e[1]||e[0],c.port=(c.host.match(/:(\d+)$/)||[])[1]||""):(c.host=location.host,c.hostname=location.hostname,c.port=location.port),c.pathname=c.pathname||"/",c.path=c.pathname+c.search,o={},s=0,r=(i=(n=c.search.replace(/^\?/,""))?n.split("&"):[]).length;s1&&this._connectMessage&&(this._connectMessage.advice={timeout:0}),this._resolvePromise(this.request(this._outbox)),this._connectMessage=null,this._outbox=[]},_flushLargeBatch:function(){if(!(this.encode(this._outbox).length1&&(n=r[i]),n=n||r["CGI_"+s]):(n=r[i]||r[s])&&!r[i]&&console.warn("The environment variable "+s+" is discouraged. Use "+i+"."),n}}}}),{get:function(t,e,n,i,s){var r=t.endpoint;o.asyncEach(this._transports,(function(r,c){var a=r[0],h=r[1],u=t.endpointFor(a);return o.indexOf(n,a)>=0?c():o.indexOf(e,a)<0?(h.isUsable(t,u,(function(){})),c()):void h.isUsable(t,u,(function(e){if(!e)return c();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 "+r.href)}))},register:function(t,e){this._transports.push([t,e]),e.prototype.connectionType=t},getConnectionTypes:function(){return o.map(this._transports,(function(t){return t[0]}))},disable:function(t){if("autodisconnect"===t)for(var e=0;e0;)a();c=!1}}()};h()}}},function(t,e,n){"use strict";var i=function(t){var e,n,s;if(t instanceof Array){for(e=[],n=t.length;n--;)e[n]=i(t[n]);return e}if("object"==typeof t){for(s in e=null===t?null:{},t)e[s]=i(t[s]);return e}return t};t.exports=i},function(t,e,n){"use strict";var i=n(26),s=[],r=[],o=i.makeRequestCallFromTimer((function(){if(r.length)throw r.shift()}));function c(t){var e;(e=s.length?s.pop():new a).task=t,i(e)}function a(){this.task=null}t.exports=c,a.prototype.call=function(){try{this.task.call()}catch(t){c.onerror?c.onerror(t):(r.push(t),o())}finally{this.task=null,s[s.length]=this}}},function(t,e,n){"use strict";t.exports={Event:{_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)}}}},function(t,e,n){"use strict";var i=n(1),s=n(0),r=n(9),o=n(16),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;s=200&&o<300||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(t){}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=a}).call(this,n(2))},function(t,e,n){"use strict";var i=function(t,e){this.message=t,this.options=e,this.attempts=0};n(0)(i.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)&&!(void 0!==n&&i>n)},send:function(){this.attempts+=1},succeed:function(){},fail:function(){},abort:function(){}}),t.exports=i},function(t,e){t.exports={VERSION:"1.4.1",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(1),s=n(0),r=n(7),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},function(t,e,n){"use strict";(function(e){var i=n(13),s=n(1),r=(n(6),n(11)),o=n(14),c=n(23),a=n(0),h=n(27),u=n(7),l=n(8),f=n(9),d=n(15),p=n(17),_=n(35),v=n(36),g=n(37),m=n(24),y=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),h(n=n||{},["interval","timeout","endpoints","proxy","retry","scheduler","websocketExtensions","tls","ca"]),this._channels=new d.Set,this._dispatcher=p.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),o.Event&&void 0!==e.onbeforeunload&&o.Event.on(e,"beforeunload",(function(){r.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 ?",this._dispatcher.endpoint.href),this._dispatcher.selectTransport(c.MANDATORY_CONNECTION_TYPES),this._sendMessage({channel:d.HANDSHAKE,version:c.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 g;return this._sendMessage({channel:d.DISCONNECT,clientId:this._dispatcher.clientId},{},(function(e){e.successful?(this._dispatcher.close(),t.setDeferredStatus("succeeded")):t.setDeferredStatus("failed",_.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 r.map(t,(function(t){return this.subscribe(t,e,n)}),this);var i=new m(this,t,e,n),s=!0===e;return this._channels.hasSubscription(t)&&!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",_.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 r.map(t,(function(t){return this.unsubscribe(t,e)}),this);this._channels.unsubscribe(t,e)&&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){h(n||{},["attempts","deadline"]);var i=new g;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",_.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){a(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)}});a(y.prototype,u),a(y.prototype,f),a(y.prototype,l),a(y.prototype,v),t.exports=y}).call(this,n(2))},function(t,e,n){"use strict";(function(e){function n(t){s.length||(i(),!0),s[s.length]=t}t.exports=n;var i,s=[],r=0;function o(){for(;r1024){for(var e=0,n=s.length-r;e=3?c[t](e,n,o):c[t](e,o)};o(e)}};n(0)(i,n(8)),t.exports=i},function(t,e,n){"use strict";var i=n(1),s=n(7);t.exports=i(s)},function(t,e,n){"use strict";var i=n(23),s=n(8),r={VERSION:i.VERSION,Client:n(25),Scheduler:n(22)};s.wrapper=r,t.exports=r}]); //# sourceMappingURL=faye-browser-min.js.map