!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.eio=t()}}(function(){var t;return function t(e,r,n){function o(s,a){if(!r[s]){if(!e[s]){var c="function"==typeof require&&require;if(!a&&c)return c(s,!0);if(i)return i(s,!0);var p=new Error("Cannot find module '"+s+"'");throw p.code="MODULE_NOT_FOUND",p}var u=r[s]={exports:{}};e[s][0].call(u.exports,function(t){var r=e[s][1][t];return o(r||t)},u,u.exports,t,e,r,n)}return r[s].exports}for(var i="function"==typeof require&&require,s=0;s';i=document.createElement(t)}catch(t){i=document.createElement("iframe"),i.name=o.iframeId,i.src="javascript:0"}i.id=o.iframeId,o.form.appendChild(i),o.iframe=i}var o=this;if(!this.form){var i,s=document.createElement("form"),a=document.createElement("textarea"),u=this.iframeId="eio_iframe_"+this.index;s.className="socketio",s.style.position="absolute",s.style.top="-1000px",s.style.left="-1000px",s.target=u,s.method="POST",s.setAttribute("accept-charset","utf-8"),a.name="d",s.appendChild(a),document.body.appendChild(s),this.form=s,this.area=a}this.form.action=this.uri(),n(),t=t.replace(p,"\\\n"),this.area.value=t.replace(c,"\\n");try{this.form.submit()}catch(t){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"==o.iframe.readyState&&r()}:this.iframe.onload=r}}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./polling":8,"component-inherit":13}],7:[function(t,e,r){(function(r){function n(){}function o(t){if(c.call(this,t),r.location){var e="https:"==location.protocol,n=location.port;n||(n=e?443:80),this.xd=t.hostname!=r.location.hostname||n!=t.port,this.xs=t.secure!=e}}function i(t){this.method=t.method||"GET",this.uri=t.uri,this.xd=!!t.xd,this.xs=!!t.xs,this.async=!1!==t.async,this.data=void 0!=t.data?t.data:null,this.agent=t.agent,this.isBinary=t.isBinary,this.supportsBinary=t.supportsBinary,this.enablesXDR=t.enablesXDR,this.pfx=t.pfx,this.key=t.key,this.passphrase=t.passphrase,this.cert=t.cert,this.ca=t.ca,this.ciphers=t.ciphers,this.rejectUnauthorized=t.rejectUnauthorized,this.create()}function s(){for(var t in i.requests)i.requests.hasOwnProperty(t)&&i.requests[t].abort()}var a=t("xmlhttprequest"),c=t("./polling"),p=t("component-emitter"),u=t("component-inherit"),h=t("debug")("engine.io-client:polling-xhr");e.exports=o,e.exports.Request=i,u(o,c),o.prototype.supportsBinary=!0,o.prototype.request=function(t){return t=t||{},t.uri=this.uri(),t.xd=this.xd,t.xs=this.xs,t.agent=this.agent||!1,t.supportsBinary=this.supportsBinary,t.enablesXDR=this.enablesXDR,t.pfx=this.pfx,t.key=this.key,t.passphrase=this.passphrase,t.cert=this.cert,t.ca=this.ca,t.ciphers=this.ciphers,t.rejectUnauthorized=this.rejectUnauthorized,new i(t)},o.prototype.doWrite=function(t,e){var r="string"!=typeof t&&void 0!==t,n=this.request({method:"POST",data:t,isBinary:r}),o=this;n.on("success",e),n.on("error",function(t){o.onError("xhr post error",t)}),this.sendXhr=n},o.prototype.doPoll=function(){h("xhr poll");var t=this.request(),e=this;t.on("data",function(t){e.onData(t)}),t.on("error",function(t){e.onError("xhr poll error",t)}),this.pollXhr=t},p(i.prototype),i.prototype.create=function(){var t={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};t.pfx=this.pfx,t.key=this.key,t.passphrase=this.passphrase,t.cert=this.cert,t.ca=this.ca,t.ciphers=this.ciphers,t.rejectUnauthorized=this.rejectUnauthorized;var e=this.xhr=new a(t),n=this;try{if(h("xhr open %s: %s",this.method,this.uri),e.open(this.method,this.uri,this.async),this.supportsBinary&&(e.responseType="arraybuffer"),"POST"==this.method)try{this.isBinary?e.setRequestHeader("Content-type","application/octet-stream"):e.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(t){}"withCredentials"in e&&(e.withCredentials=!0),this.hasXDR()?(e.onload=function(){n.onLoad()},e.onerror=function(){n.onError(e.responseText)}):e.onreadystatechange=function(){4==e.readyState&&(200==e.status||1223==e.status?n.onLoad():setTimeout(function(){n.onError(e.status)},0))},h("xhr data %s",this.data),e.send(this.data)}catch(t){return void setTimeout(function(){n.onError(t)},0)}r.document&&(this.index=i.requestsCount++,i.requests[this.index]=this)},i.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},i.prototype.onData=function(t){this.emit("data",t),this.onSuccess()},i.prototype.onError=function(t){this.emit("error",t),this.cleanup(!0)},i.prototype.cleanup=function(t){if(void 0!==this.xhr&&null!==this.xhr){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=n:this.xhr.onreadystatechange=n,t)try{this.xhr.abort()}catch(t){}r.document&&delete i.requests[this.index],this.xhr=null}},i.prototype.onLoad=function(){var t;try{var e;try{e=this.xhr.getResponseHeader("Content-Type").split(";")[0]}catch(t){}t="application/octet-stream"===e?this.xhr.response:this.supportsBinary?"ok":this.xhr.responseText}catch(t){this.onError(t)}null!=t&&this.onData(t)},i.prototype.hasXDR=function(){return void 0!==r.XDomainRequest&&!this.xs&&this.enablesXDR},i.prototype.abort=function(){this.cleanup()},r.document&&(i.requestsCount=0,i.requests={},r.attachEvent?r.attachEvent("onunload",s):r.addEventListener&&r.addEventListener("beforeunload",s,!1))}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./polling":8,"component-emitter":12,"component-inherit":13,debug:14,xmlhttprequest:10}],8:[function(t,e,r){function n(t){var e=t&&t.forceBase64;p&&!e||(this.supportsBinary=!1),o.call(this,t)}var o=t("../transport"),i=t("parseqs"),s=t("engine.io-parser"),a=t("component-inherit"),c=t("debug")("engine.io-client:polling");e.exports=n;var p=function(){return null!=new(t("xmlhttprequest"))({xdomain:!1}).responseType}();a(n,o),n.prototype.name="polling",n.prototype.doOpen=function(){this.poll()},n.prototype.pause=function(t){function e(){c("paused"),r.readyState="paused",t()}var r=this;if(this.readyState="pausing",this.polling||!this.writable){var n=0;this.polling&&(c("we are currently polling - waiting to pause"),n++,this.once("pollComplete",function(){c("pre-pause polling complete"),--n||e()})),this.writable||(c("we are currently writing - waiting to pause"),n++,this.once("drain",function(){c("pre-pause writing complete"),--n||e()}))}else e()},n.prototype.poll=function(){c("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},n.prototype.onData=function(t){var e=this;c("polling got data %s",t);var r=function(t,r,n){if("opening"==e.readyState&&e.onOpen(),"close"==t.type)return e.onClose(),!1;e.onPacket(t)};s.decodePayload(t,this.socket.binaryType,r),"closed"!=this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"==this.readyState?this.poll():c('ignoring poll - transport state "%s"',this.readyState))},n.prototype.doClose=function(){function t(){c("writing close packet"),e.write([{type:"close"}])}var e=this;"open"==this.readyState?(c("transport open - closing"),t()):(c("transport not open - deferring close"),this.once("open",t))},n.prototype.write=function(t){var e=this;this.writable=!1;var r=function(){e.writable=!0,e.emit("drain")},e=this;s.encodePayload(t,this.supportsBinary,function(t){e.doWrite(t,r)})},n.prototype.uri=function(){var t=this.query||{},e=this.secure?"https":"http",r="";return!1!==this.timestampRequests&&(t[this.timestampParam]=+new Date+"-"+o.timestamps++),this.supportsBinary||t.sid||(t.b64=1),t=i.encode(t),this.port&&("https"==e&&443!=this.port||"http"==e&&80!=this.port)&&(r=":"+this.port),t.length&&(t="?"+t),e+"://"+this.hostname+r+this.path+t}},{"../transport":4,"component-inherit":13,debug:14,"engine.io-parser":17,parseqs:29,xmlhttprequest:10}],9:[function(t,e,r){function n(t){t&&t.forceBase64&&(this.supportsBinary=!1),o.call(this,t)}var o=t("../transport"),i=t("engine.io-parser"),s=t("parseqs"),a=t("component-inherit"),c=t("debug")("engine.io-client:websocket"),p=t("ws");e.exports=n,a(n,o),n.prototype.name="websocket",n.prototype.supportsBinary=!0,n.prototype.doOpen=function(){if(this.check()){var t=this.uri(),e={agent:this.agent};e.pfx=this.pfx,e.key=this.key,e.passphrase=this.passphrase,e.cert=this.cert,e.ca=this.ca,e.ciphers=this.ciphers,e.rejectUnauthorized=this.rejectUnauthorized,this.ws=new p(t,void 0,e),void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.binaryType="arraybuffer",this.addEventListeners()}},n.prototype.addEventListeners=function(){var t=this;this.ws.onopen=function(){t.onOpen()},this.ws.onclose=function(){t.onClose()},this.ws.onmessage=function(e){t.onData(e.data)},this.ws.onerror=function(e){t.onError("websocket error",e)}},"undefined"!=typeof navigator&&/iPad|iPhone|iPod/i.test(navigator.userAgent)&&(n.prototype.onData=function(t){var e=this;setTimeout(function(){o.prototype.onData.call(e,t)},0)}),n.prototype.write=function(t){function e(){r.writable=!0,r.emit("drain")}var r=this;this.writable=!1;for(var n=0,o=t.length;n=31}function o(){var t=arguments,e=this.useColors;if(t[0]=(e?"%c":"")+this.namespace+(e?" %c":" ")+t[0]+(e?"%c ":" ")+"+"+r.humanize(this.diff),!e)return t;var n="color: "+this.color;t=[t[0],n,"color: inherit"].concat(Array.prototype.slice.call(t,1));var o=0,i=0;return t[0].replace(/%[a-z%]/g,function(t){"%%"!==t&&(o++,"%c"===t&&(i=o))}),t.splice(i,0,n),t}function i(){return"object"==typeof console&&"function"==typeof console.log&&Function.prototype.apply.call(console.log,console,arguments)}function s(t){try{null==t?localStorage.removeItem("debug"):localStorage.debug=t}catch(t){}}function a(){var t;try{t=localStorage.debug}catch(t){}return t}r=e.exports=t("./debug"),r.log=i,r.formatArgs=o,r.save=s,r.load=a,r.useColors=n,r.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],r.formatters.j=function(t){return JSON.stringify(t)},r.enable(a())},{"./debug":15}],15:[function(t,e,r){function n(){return r.colors[u++%r.colors.length]}function o(t){function e(){}function o(){var t=o,e=+new Date,i=e-(p||e);t.diff=i,t.prev=p,t.curr=e,p=e,null==t.useColors&&(t.useColors=r.useColors()),null==t.color&&t.useColors&&(t.color=n());var s=Array.prototype.slice.call(arguments);s[0]=r.coerce(s[0]),"string"!=typeof s[0]&&(s=["%o"].concat(s));var a=0;s[0]=s[0].replace(/%([a-z%])/g,function(e,n){if("%%"===e)return e;a++;var o=r.formatters[n];if("function"==typeof o){var i=s[a];e=o.call(t,i),s.splice(a,1),a--}return e}),"function"==typeof r.formatArgs&&(s=r.formatArgs.apply(t,s)),(o.log||r.log||console.log.bind(console)).apply(t,s)}e.enabled=!1,o.enabled=!0;var i=r.enabled(t)?o:e;return i.namespace=t,i}function i(t){r.save(t);for(var e=(t||"").split(/[\s,]+/),n=e.length,o=0;o=u?Math.round(t/u)+"d":t>=p?Math.round(t/p)+"h":t>=c?Math.round(t/c)+"m":t>=a?Math.round(t/a)+"s":t+"ms"}function i(t){return s(t,u,"day")||s(t,p,"hour")||s(t,c,"minute")||s(t,a,"second")||t+" ms"}function s(t,e,r){if(!(t1?{type:v[o],data:t.substring(1)}:{type:v[o]}:b}var i=new Uint8Array(t),o=i[0],s=u(t,1);return w&&"blob"===e&&(s=new w([s])),{type:v[o],data:s}},r.decodeBase64Packet=function(t,r){var n=v[t.charAt(0)];if(!e.ArrayBuffer)return{type:n,data:{base64:!0,data:t.substr(1)}};var o=h.decode(t.substr(1));return"blob"===r&&w&&(o=new w([o])),{type:n,data:o}},r.encodePayload=function(t,e,n){function o(t){return t.length+":"+t}function i(t,n){r.encodePacket(t,!!s&&e,!0,function(t){n(null,o(t))})}"function"==typeof e&&(n=e,e=null);var s=p(t);return e&&s?w&&!m?r.encodePayloadAsBlob(t,n):r.encodePayloadAsArrayBuffer(t,n):t.length?void a(t,i,function(t,e){return n(e.join(""))}):n("0:")},r.decodePayload=function(t,e,n){if("string"!=typeof t)return r.decodePayloadAsBinary(t,e,n);"function"==typeof e&&(n=e,e=null);var o;if(""==t)return n(b,0,1);for(var i,s,a="",c=0,p=t.length;c0;){for(var a=new Uint8Array(o),c=0===a[0],p="",h=1;255!=a[h];h++){if(p.length>310){s=!0;break}p+=a[h]}if(s)return n(b,0,1);o=u(o,2+p.length),p=parseInt(p);var f=u(o,0,p);if(c)try{f=String.fromCharCode.apply(null,new Uint8Array(f))}catch(t){var l=new Uint8Array(f);f="";for(var h=0;hn&&(r=n),e>=n||e>=r||0===n)return new ArrayBuffer(0);for(var o=new Uint8Array(t),i=new Uint8Array(r-e),s=e,a=0;s>2],i+=t[(3&n[r])<<4|n[r+1]>>4],i+=t[(15&n[r+1])<<2|n[r+2]>>6],i+=t[63&n[r+2]];return o%3==2?i=i.substring(0,i.length-1)+"=":o%3==1&&(i=i.substring(0,i.length-2)+"=="),i},r.decode=function(e){var r,n,o,i,s,a=.75*e.length,c=e.length,p=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);var u=new ArrayBuffer(a),h=new Uint8Array(u);for(r=0;r>4,h[p++]=(15&o)<<4|i>>2,h[p++]=(3&i)<<6|63&s;return u}}("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")},{}],22:[function(t,e,r){(function(r){function n(t){function e(t){if(!t)return!1;if(r.Buffer&&r.Buffer.isBuffer(t)||r.ArrayBuffer&&t instanceof ArrayBuffer||r.Blob&&t instanceof Blob||r.File&&t instanceof File)return!0;if(o(t)){for(var n=0;n=55296&&e<=56319&&o65535&&(e-=65536,o+=b(e>>>10&1023|55296),e=56320|1023&e),o+=b(e);return o}function a(t,e){return b(t>>e&63|128)}function c(t){if(0==(4294967168&t))return b(t);var e="";return 0==(4294965248&t)?e=b(t>>6&31|192):0==(4294901760&t)?(e=b(t>>12&15|224),e+=a(t,6)):0==(4292870144&t)&&(e=b(t>>18&7|240),e+=a(t,12),e+=a(t,6)),e+=b(63&t|128)}function p(t){for(var e,r=i(t),n=r.length,o=-1,s="";++o=g)throw Error("Invalid byte index");var t=255&m[v];if(v++,128==(192&t))return 63&t;throw Error("Invalid continuation byte")}function h(){var t,e,r,n,o;if(v>g)throw Error("Invalid byte index");if(v==g)return!1;if(t=255&m[v],v++,0==(128&t))return t;if(192==(224&t)){var e=u();if((o=(31&t)<<6|e)>=128)return o;throw Error("Invalid continuation byte")}if(224==(240&t)){if(e=u(),r=u(),(o=(15&t)<<12|e<<6|r)>=2048)return o;throw Error("Invalid continuation byte")}if(240==(248&t)&&(e=u(),r=u(),n=u(),(o=(15&t)<<18|e<<12|r<<6|n)>=65536&&o<=1114111))return o;throw Error("Invalid UTF-8 detected")}function f(t){m=i(t),g=m.length,v=0;for(var e,r=[];!1!==(e=h());)r.push(e);return s(r)}var l="object"==typeof n&&n,d="object"==typeof r&&r&&r.exports==l&&r,y="object"==typeof e&&e;y.global!==y&&y.window!==y||(o=y);var m,g,v,b=String.fromCharCode,w={version:"2.0.0",encode:p,decode:f};if("function"==typeof t&&"object"==typeof t.amd&&t.amd)t(function(){return w});else if(l&&!l.nodeType)if(d)d.exports=w;else{var k={},x=k.hasOwnProperty;for(var _ in w)x.call(w,_)&&(l[_]=w[_])}else o.utf8=w}(this)}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],25:[function(t,e,r){var n=t("global");try{e.exports="XMLHttpRequest"in n&&"withCredentials"in new n.XMLHttpRequest}catch(t){e.exports=!1}},{global:26}],26:[function(t,e,r){e.exports=function(){return this}()},{}],27:[function(t,e,r){var n=[].indexOf;e.exports=function(t,e){if(n)return t.indexOf(e);for(var r=0;r=l)return void g.emit("reconnecting_failed");var t=f?2*(h||u/2):u*d;p=!0,y=setTimeout(function(){g.open()},t),h=t,g.emit("reconnecting",{attempt:d+1,max_attempts:l,delay:t}),d++}var a,c=!1,p=!1,u=4e3,h=0,f=!0,l=5,d=0,y=null,m=!1,g=eio.apply(eio,arguments);return g.on("open",r),g.on("close",n),g.on("error",o),a=g.close,g.close=i,e&&("number"==typeof e.reconnect_delay&&(u=e.reconnect_delay),"number"==typeof e.reconnect_max_attempts&&(l=e.reconnect_max_attempts),void 0!==e.reconnect_delay_exponential&&(f=!!e.reconnect_delay_exponential)),g},Rpc:function(){function t(t){var r=new e(t),n=function(){return n.makeCall.apply(n,arguments)};for(var o in r)n[o]=r[o];return n._mixinEmitter(),n._bindSocketListeners(),n._rpc=n,n}function e(t){this._next_id=0,this._rpc_callbacks={},this._socket=t,this._rpc=this,this._namespace="",this._namespaces=[]}return e.prototype._bindSocketListeners=function(){var t=this;this._onMessageProxy=function(){t._onMessage.apply(t,arguments)},this._socket.on("message",this._onMessageProxy)},e.prototype.dispose=function(){this._onMessageProxy&&(this._socket.removeListener("message",this._onMessageProxy),delete this._onMessageProxy);for(var t in this._namespaces)this._namespaces[t].dispose();this.removeAllListeners()},e.prototype.namespace=function(t){var e,r;return e=this._namespace?this._namespace+"."+t:t,r=new this._rpc.Namespace(this._rpc,e),this._rpc._namespaces.push(r),r},e.prototype._findRelevantNamespaces=function(t){var e=[];for(var r in this._namespaces)this._namespaces[r]._namespace===t&&e.push(this._namespaces[r]),0===this._namespaces[r]._namespace.indexOf(t+".")&&e.push(this._namespaces[r]);return e},e.prototype._mixinEmitter=function(t){var e=["on","once","off","removeListener","removeAllListeners","emit","listeners","hasListeners"];t=t||this;for(var r=0;r0)){o=e.method.substring(0,e.method.lastIndexOf(".")),i=this._findRelevantNamespaces(o);for(s in i)e.method=e.method.replace(i[s]._namespace+".",""),i[s].emit.apply(i[s],[e.method,r].concat(e.params))}},e.prototype._createReturnCallFn=function(t){var e=this;return function(){var r=Array.prototype.slice.call(arguments,0),n={id:t,response:r};e.send(n)}},e.prototype._noop=function(){},e.prototype.Namespace=function(t,e){var r=function(){if(void 0!==arguments[0])return arguments[0]=r._namespace+"."+arguments[0],r._rpc.apply(r._rpc,arguments)};return r._rpc=t,r._namespace=e,r.dispose=function(){r.removeAllListeners(),r._rpc=null},t._mixinEmitter(r),r},t}()};