!function(n,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.io=t():n.io=t()}(this,function(){return function(n){function t(r){if(i[r])return i[r].exports;var u=i[r]={exports:{},id:r,loaded:!1};return n[r].call(u.exports,u,u.exports,t),u.loaded=!0,u.exports}var i={};return t.m=n,t.c=i,t.p="",t(0)}([function(n,t,i){"use strict";function u(n,t){"object"===("undefined"==typeof n?"undefined":o(n))&&(t=n,n=void 0);t=t||{};var c,i=s(n),h=i.source,u=i.id,l=i.path,a=r[u]&&l in r[u].nsps,v=t.forceNew||t["force new connection"]||!1===t.multiplex||a;return v?(e("ignoring socket cache for %s",h),c=f(h,t)):(r[u]||(e("new io instance for %s",h),r[u]=f(h,t)),c=r[u]),i.query&&!t.query&&(t.query=i.query),c.socket(i.path,t)}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},s=i(1),h=i(7),f=i(13),e=i(3)("socket.io-client"),r;n.exports=t=u;r=t.managers={};t.protocol=h.protocol;t.connect=u;t.Manager=i(13);t.Socket=i(39)},function(n,t,i){(function(t){"use strict";function u(n,i){var u=n,o,e;return i=i||t.location,null==n&&(n=i.protocol+"//"+i.host),"string"==typeof n&&("/"===n.charAt(0)&&(n="/"===n.charAt(1)?i.protocol+n:i.host+n),/^(https?|wss?):\/\//.test(n)||(r("protocol-less url %s",n),n="undefined"!=typeof i?i.protocol+"//"+n:"https://"+n),r("parse %s",n),u=f(n)),u.port||(/^(http|ws)$/.test(u.protocol)?u.port="80":/^(http|ws)s$/.test(u.protocol)&&(u.port="443")),u.path=u.path||"/",o=u.host.indexOf(":")!==-1,e=o?"["+u.host+"]":u.host,u.id=u.protocol+"://"+e+":"+u.port,u.href=u.protocol+"://"+e+(i&&i.port===u.port?"":":"+u.port),u}var f=i(2),r=i(3)("socket.io-client:url");n.exports=u}).call(t,function(){return this}())},function(n){var t=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,i=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];n.exports=function(n){var o=n,u=n.indexOf("["),f=n.indexOf("]");u!=-1&&f!=-1&&(n=n.substring(0,u)+n.substring(u,f).replace(/:/g,";")+n.substring(f,n.length));for(var s=t.exec(n||""),r={},e=14;e--;)r[i[e]]=s[e]||"";return u!=-1&&f!=-1&&(r.source=o,r.host=r.host.substring(1,r.host.length-1).replace(/;/g,":"),r.authority=r.authority.replace("[","").replace("]","").replace(/;/g,":"),r.ipv6uri=!0),r}},function(n,t,i){(function(r){function f(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function e(n){var i=this.useColors,r,u,f;(n[0]=(i?"%c":"")+this.namespace+(i?" %c":" ")+n[0]+(i?"%c ":" ")+"+"+t.humanize(this.diff),i)&&(r="color: "+this.color,n.splice(1,0,r,"color: inherit"),u=0,f=0,n[0].replace(/%[a-zA-Z%]/g,function(n){"%%"!==n&&(u++,"%c"===n&&(f=u))}),n.splice(f,0,r))}function o(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function s(n){try{null==n?t.storage.removeItem("debug"):t.storage.debug=n}catch(i){}}function u(){var n;try{n=t.storage.debug}catch(i){}return!n&&"undefined"!=typeof r&&"env"in r&&(n=r.env.DEBUG),n}function h(){try{return window.localStorage}catch(n){}}t=n.exports=i(5);t.log=o;t.formatArgs=e;t.save=s;t.load=u;t.useColors=f;t.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:h();t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"];t.formatters.j=function(n){try{return JSON.stringify(n)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}};t.enable(u())}).call(t,i(4))},function(n){function h(){throw new Error("setTimeout has not been defined");}function c(){throw new Error("clearTimeout has not been defined");}function l(n){if(r===setTimeout)return setTimeout(n,0);if((r===h||!r)&&setTimeout)return r=setTimeout,setTimeout(n,0);try{return r(n,0)}catch(t){try{return r.call(null,n,0)}catch(t){return r.call(this,n,0)}}}function y(n){if(u===clearTimeout)return clearTimeout(n);if((u===c||!u)&&clearTimeout)return u=clearTimeout,clearTimeout(n);try{return u(n)}catch(t){try{return u.call(null,n)}catch(t){return u.call(this,n)}}}function p(){o&&e&&(o=!1,e.length?f=e.concat(f):s=-1,f.length&&a())}function a(){var t,n;if(!o){for(t=l(p),o=!0,n=f.length;n;){for(e=f,f=[];++s<n;)e&&e[s].run();s=-1;n=f.length}e=null;o=!1;y(t)}}function v(n,t){this.fun=n;this.array=t}function i(){}var r,u,t=n.exports={};!function(){try{r="function"==typeof setTimeout?setTimeout:h}catch(n){r=h}try{u="function"==typeof clearTimeout?clearTimeout:c}catch(n){u=c}}();var e,f=[],o=!1,s=-1;t.nextTick=function(n){var i=new Array(arguments.length-1),t;if(arguments.length>1)for(t=1;t<arguments.length;t++)i[t-1]=arguments[t];f.push(new v(n,i));1!==f.length||o||l(a)};v.prototype.run=function(){this.fun.apply(null,this.array)};t.title="browser";t.browser=!0;t.env={};t.argv=[];t.version="";t.versions={};t.on=i;t.addListener=i;t.once=i;t.off=i;t.removeListener=i;t.removeAllListeners=i;t.emit=i;t.prependListener=i;t.prependOnceListener=i;t.listeners=function(){return[]};t.binding=function(){throw new Error("process.binding is not supported");};t.cwd=function(){return"/"};t.chdir=function(){throw new Error("process.chdir is not supported");};t.umask=function(){return 0}},function(n,t,i){function f(n){var r,i=0;for(r in n)i=(i<<5)-i+n.charCodeAt(r),i|=0;return t.colors[Math.abs(i)%t.colors.length]}function r(n){function i(){var n,f,e,s;if(i.enabled){var r=i,o=+new Date,h=o-(u||o);for(r.diff=h,r.prev=u,r.curr=o,u=o,n=new Array(arguments.length),f=0;f<n.length;f++)n[f]=arguments[f];n[0]=t.coerce(n[0]);"string"!=typeof n[0]&&n.unshift("%O");e=0;n[0]=n[0].replace(/%([a-zA-Z%])/g,function(i,u){var f,o;return"%%"===i?i:(e++,f=t.formatters[u],"function"==typeof f&&(o=n[e],i=f.call(r,o),n.splice(e,1),e--),i)});t.formatArgs.call(r,n);s=i.log||t.log||console.log.bind(console);s.apply(r,n)}}return i.namespace=n,i.enabled=t.enabled(n),i.useColors=t.useColors(),i.color=f(n),"function"==typeof t.init&&t.init(i),i}function e(n){t.save(n);t.names=[];t.skips=[];for(var r=("string"==typeof n?n:"").split(/[\s,]+/),u=r.length,i=0;i<u;i++)r[i]&&(n=r[i].replace(/\*/g,".*?"),"-"===n[0]?t.skips.push(new RegExp("^"+n.substr(1)+"$")):t.names.push(new RegExp("^"+n+"$")))}function o(){t.enable("")}function s(n){for(var i=0,r=t.skips.length;i<r;i++)if(t.skips[i].test(n))return!1;for(i=0,r=t.names.length;i<r;i++)if(t.names[i].test(n))return!0;return!1}function h(n){return n instanceof Error?n.stack||n.message:n}t=n.exports=r.debug=r["default"]=r;t.coerce=h;t.disable=o;t.enable=e;t.enabled=s;t.humanize=i(6);t.names=[];t.skips=[];t.formatters={};var u},function(n){function e(n){var e,f,o;if((n=String(n),!(n.length>100))&&(e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(n),e)){f=parseFloat(e[1]);o=(e[2]||"ms").toLowerCase();switch(o){case"years":case"year":case"yrs":case"yr":case"y":return f*h;case"days":case"day":case"d":return f*u;case"hours":case"hour":case"hrs":case"hr":case"h":return f*r;case"minutes":case"minute":case"mins":case"min":case"m":return f*i;case"seconds":case"second":case"secs":case"sec":case"s":return f*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return f;default:return}}}function o(n){return n>=u?Math.round(n/u)+"d":n>=r?Math.round(n/r)+"h":n>=i?Math.round(n/i)+"m":n>=t?Math.round(n/t)+"s":n+"ms"}function s(n){return f(n,u,"day")||f(n,r,"hour")||f(n,i,"minute")||f(n,t,"second")||n+" ms"}function f(n,t,i){if(!(n<t))return n<1.5*t?Math.floor(n/t)+" "+i:Math.ceil(n/t)+" "+i+"s"}var t=1e3,i=60*t,r=60*i,u=24*r,h=365.25*u;n.exports=function(n,t){t=t||{};var i=typeof n;if("string"===i&&n.length>0)return e(n);if("number"===i&&isNaN(n)===!1)return t.long?s(n):o(n);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(n));}},function(n,t,i){function o(){}function s(n){var i=""+n.type;return t.BINARY_EVENT!==n.type&&t.BINARY_ACK!==n.type||(i+=n.attachments+"-"),n.nsp&&"/"!==n.nsp&&(i+=n.nsp+","),null!=n.id&&(i+=n.id),null!=n.data&&(i+=JSON.stringify(n.data)),f("encoded %j as %s",n,i),i}function c(n,t){function i(n){var i=e.deconstructPacket(n),u=s(i.packet),r=i.buffers;r.unshift(u);t(r)}e.removeBlobs(n,i)}function r(){this.reconstructor=null}function l(n){var i=0,r={type:Number(n.charAt(0))},e,o,u;if(null==t.types[r.type])return h();if(t.BINARY_EVENT===r.type||t.BINARY_ACK===r.type){for(e="";"-"!==n.charAt(++i)&&(e+=n.charAt(i),i!=n.length););if(e!=Number(e)||"-"!==n.charAt(i))throw new Error("Illegal attachments");r.attachments=Number(e)}if("/"===n.charAt(i+1))for(r.nsp="";++i;){if(u=n.charAt(i),","===u)break;if(r.nsp+=u,i===n.length)break}else r.nsp="/";if(o=n.charAt(i+1),""!==o&&Number(o)==o){for(r.id="";++i;){if(u=n.charAt(i),null==u||Number(u)!=u){--i;break}if(r.id+=n.charAt(i),i===n.length)break}r.id=Number(r.id)}return n.charAt(++i)&&(r=a(r,n.substr(i))),f("decoded %s as %j",n,r),r}function a(n,t){try{n.data=JSON.parse(t)}catch(i){return h()}return n}function u(n){this.reconPack=n;this.buffers=[]}function h(){return{type:t.ERROR,data:"parser error"}}var f=i(3)("socket.io-parser"),v=i(8),y=i(9),e=i(11),p=i(12);t.protocol=4;t.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"];t.CONNECT=0;t.DISCONNECT=1;t.EVENT=2;t.ACK=3;t.ERROR=4;t.BINARY_EVENT=5;t.BINARY_ACK=6;t.Encoder=o;t.Decoder=r;o.prototype.encode=function(n,i){if(n.type!==t.EVENT&&n.type!==t.ACK||!y(n.data)||(n.type=n.type===t.EVENT?t.BINARY_EVENT:t.BINARY_ACK),f("encoding packet %j",n),t.BINARY_EVENT===n.type||t.BINARY_ACK===n.type)c(n,i);else{var r=s(n);i([r])}};v(r.prototype);r.prototype.add=function(n){var i;if("string"==typeof n)i=l(n),t.BINARY_EVENT===i.type||t.BINARY_ACK===i.type?(this.reconstructor=new u(i),0===this.reconstructor.reconPack.attachments&&this.emit("decoded",i)):this.emit("decoded",i);else{if(!p(n)&&!n.base64)throw new Error("Unknown type: "+n);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");i=this.reconstructor.takeBinaryData(n);i&&(this.reconstructor=null,this.emit("decoded",i))}};r.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()};u.prototype.takeBinaryData=function(n){if(this.buffers.push(n),this.buffers.length===this.reconPack.attachments){var t=e.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null};u.prototype.finishedReconstruction=function(){this.reconPack=null;this.buffers=[]}},function(n){function t(n){if(n)return i(n)}function i(n){for(var i in t.prototype)n[i]=t.prototype[i];return n}n.exports=t;t.prototype.on=t.prototype.addEventListener=function(n,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(t),this};t.prototype.once=function(n,t){function i(){this.off(n,i);t.apply(this,arguments)}return i.fn=t,this.on(n,i),this};t.prototype.off=t.prototype.removeListener=t.prototype.removeAllListeners=t.prototype.removeEventListener=function(n,t){var i,u,r;if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;if(i=this._callbacks["$"+n],!i)return this;if(1==arguments.length)return delete this._callbacks["$"+n],this;for(r=0;r<i.length;r++)if(u=i[r],u===t||u.fn===t){i.splice(r,1);break}return this};t.prototype.emit=function(n){var r,t,i,u;if(this._callbacks=this._callbacks||{},r=[].slice.call(arguments,1),t=this._callbacks["$"+n],t)for(t=t.slice(0),i=0,u=t.length;i<u;++i)t[i].apply(this,r);return this};t.prototype.listeners=function(n){return this._callbacks=this._callbacks||{},this._callbacks["$"+n]||[]};t.prototype.hasListeners=function(n){return!!this.listeners(n).length}},function(n,t,i){(function(t){function r(n){var i,s,u;if(!n||"object"!=typeof n)return!1;if(f(n)){for(i=0,s=n.length;i<s;i++)if(r(n[i]))return!0;return!1}if("function"==typeof t.Buffer&&t.Buffer.isBuffer&&t.Buffer.isBuffer(n)||"function"==typeof t.ArrayBuffer&&n instanceof ArrayBuffer||e&&n instanceof Blob||o&&n instanceof File)return!0;if(n.toJSON&&"function"==typeof n.toJSON&&1===arguments.length)return r(n.toJSON(),!0);for(u in n)if(Object.prototype.hasOwnProperty.call(n,u)&&r(n[u]))return!0;return!1}var f=i(10),u=Object.prototype.toString,e="function"==typeof t.Blob||"[object BlobConstructor]"===u.call(t.Blob),o="function"==typeof t.File||"[object FileConstructor]"===u.call(t.File);n.exports=r}).call(t,function(){return this}())},function(n){var t={}.toString;n.exports=Array.isArray||function(n){return"[object Array]"==t.call(n)}},function(n,t,i){(function(n){function r(n,t){var s,u,i,o;if(!n)return n;if(e(n))return s={_placeholder:!0,num:t.length},t.push(n),s;if(f(n)){for(i=new Array(n.length),u=0;u<n.length;u++)i[u]=r(n[u],t);return i}if("object"==typeof n&&!(n instanceof Date)){i={};for(o in n)i[o]=r(n[o],t);return i}return n}function u(n,t){var i,r;if(!n)return n;if(n&&n._placeholder)return t[n.num];if(f(n))for(i=0;i<n.length;i++)n[i]=u(n[i],t);else if("object"==typeof n)for(r in n)n[r]=u(n[r],t);return n}var f=i(10),e=i(12),o=Object.prototype.toString,s="function"==typeof n.Blob||"[object BlobConstructor]"===o.call(n.Blob),h="function"==typeof n.File||"[object FileConstructor]"===o.call(n.File);t.deconstructPacket=function(n){var t=[],u=n.data,i=n;return i.data=r(u,t),i.attachments=t.length,{packet:i,buffers:t}};t.reconstructPacket=function(n,t){return n.data=u(n.data,t),n.attachments=void 0,n};t.removeBlobs=function(n,t){function r(n,o,c){var a,l,v;if(!n)return n;if(s&&n instanceof Blob||h&&n instanceof File)u++,a=new FileReader,a.onload=function(){c?c[o]=this.result:i=this.result;--u||t(i)},a.readAsArrayBuffer(n);else if(f(n))for(l=0;l<n.length;l++)r(n[l],l,n);else if("object"==typeof n&&!e(n))for(v in n)r(n[v],v,n)}var u=0,i=n;r(i);u||t(i)}}).call(t,function(){return this}())},function(n,t){(function(t){function i(n){return t.Buffer&&t.Buffer.isBuffer(n)||t.ArrayBuffer&&n instanceof ArrayBuffer}n.exports=i}).call(t,function(){return this}())},function(n,t,i){"use strict";function r(n,t){if(!(this instanceof r))return new r(n,t);n&&"object"===("undefined"==typeof n?"undefined":h(n))&&(t=n,n=void 0);t=t||{};t.path=t.path||"/socket.io";this.nsps={};this.subs=[];this.opts=t;this.reconnection(t.reconnection!==!1);this.reconnectionAttempts(t.reconnectionAttempts||1/0);this.reconnectionDelay(t.reconnectionDelay||1e3);this.reconnectionDelayMax(t.reconnectionDelayMax||5e3);this.randomizationFactor(t.randomizationFactor||.5);this.backoff=new y({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()});this.timeout(null==t.timeout?2e4:t.timeout);this.readyState="closed";this.uri=n;this.connecting=[];this.lastPing=null;this.encoding=!1;this.packetBuffer=[];var i=t.parser||v;this.encoder=new i.Encoder;this.decoder=new i.Decoder;this.autoConnect=t.autoConnect!==!1;this.autoConnect&&this.open()}var h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},c=i(14),l=i(39),a=i(8),v=i(7),f=i(41),e=i(42),u=i(3)("socket.io-client:manager"),o=i(37),y=i(43),s=Object.prototype.hasOwnProperty;n.exports=r;r.prototype.emitAll=function(){this.emit.apply(this,arguments);for(var n in this.nsps)s.call(this.nsps,n)&&this.nsps[n].emit.apply(this.nsps[n],arguments)};r.prototype.updateSocketIds=function(){for(var n in this.nsps)s.call(this.nsps,n)&&(this.nsps[n].id=this.generateId(n))};r.prototype.generateId=function(n){return("/"===n?"":n+"#")+this.engine.id};a(r.prototype);r.prototype.reconnection=function(n){return arguments.length?(this._reconnection=!!n,this):this._reconnection};r.prototype.reconnectionAttempts=function(n){return arguments.length?(this._reconnectionAttempts=n,this):this._reconnectionAttempts};r.prototype.reconnectionDelay=function(n){return arguments.length?(this._reconnectionDelay=n,this.backoff&&this.backoff.setMin(n),this):this._reconnectionDelay};r.prototype.randomizationFactor=function(n){return arguments.length?(this._randomizationFactor=n,this.backoff&&this.backoff.setJitter(n),this):this._randomizationFactor};r.prototype.reconnectionDelayMax=function(n){return arguments.length?(this._reconnectionDelayMax=n,this.backoff&&this.backoff.setMax(n),this):this._reconnectionDelayMax};r.prototype.timeout=function(n){return arguments.length?(this._timeout=n,this):this._timeout};r.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()};r.prototype.open=r.prototype.connect=function(n){var i,t,e,o,r,s;return(u("readyState %s",this.readyState),~this.readyState.indexOf("open"))?this:(u("opening %s",this.uri),this.engine=c(this.uri,this.opts),i=this.engine,t=this,this.readyState="opening",this.skipReconnect=!1,e=f(i,"open",function(){t.onopen();n&&n()}),o=f(i,"error",function(i){if(u("connect_error"),t.cleanup(),t.readyState="closed",t.emitAll("connect_error",i),n){var r=new Error("Connection error");r.data=i;n(r)}else t.maybeReconnectOnOpen()}),!1!==this._timeout&&(r=this._timeout,u("connect attempt will timeout after %d",r),s=setTimeout(function(){u("connect attempt timed out after %d",r);e.destroy();i.close();i.emit("error","timeout");t.emitAll("connect_timeout",r)},r),this.subs.push({destroy:function(){clearTimeout(s)}})),this.subs.push(e),this.subs.push(o),this)};r.prototype.onopen=function(){u("open");this.cleanup();this.readyState="open";this.emit("open");var n=this.engine;this.subs.push(f(n,"data",e(this,"ondata")));this.subs.push(f(n,"ping",e(this,"onping")));this.subs.push(f(n,"pong",e(this,"onpong")));this.subs.push(f(n,"error",e(this,"onerror")));this.subs.push(f(n,"close",e(this,"onclose")));this.subs.push(f(this.decoder,"decoded",e(this,"ondecoded")))};r.prototype.onping=function(){this.lastPing=new Date;this.emitAll("ping")};r.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)};r.prototype.ondata=function(n){this.decoder.add(n)};r.prototype.ondecoded=function(n){this.emit("packet",n)};r.prototype.onerror=function(n){u("error",n);this.emitAll("error",n)};r.prototype.socket=function(n,t){function u(){~o(r.connecting,i)||r.connecting.push(i)}var i=this.nsps[n],r;return i||(i=new l(this,n,t),this.nsps[n]=i,r=this,i.on("connecting",u),i.on("connect",function(){i.id=r.generateId(n)}),this.autoConnect&&u()),i};r.prototype.destroy=function(n){var t=o(this.connecting,n);~t&&this.connecting.splice(t,1);this.connecting.length||this.close()};r.prototype.packet=function(n){u("writing packet %j",n);var t=this;n.query&&0===n.type&&(n.nsp+="?"+n.query);t.encoding?t.packetBuffer.push(n):(t.encoding=!0,this.encoder.encode(n,function(i){for(var r=0;r<i.length;r++)t.engine.write(i[r],n.options);t.encoding=!1;t.processPacketQueue()}))};r.prototype.processPacketQueue=function(){if(this.packetBuffer.length>0&&!this.encoding){var n=this.packetBuffer.shift();this.packet(n)}};r.prototype.cleanup=function(){var t,n,i;for(u("cleanup"),t=this.subs.length,n=0;n<t;n++)i=this.subs.shift(),i.destroy();this.packetBuffer=[];this.encoding=!1;this.lastPing=null;this.decoder.destroy()};r.prototype.close=r.prototype.disconnect=function(){u("disconnect");this.skipReconnect=!0;this.reconnecting=!1;"opening"===this.readyState&&this.cleanup();this.backoff.reset();this.readyState="closed";this.engine&&this.engine.close()};r.prototype.onclose=function(n){u("onclose");this.cleanup();this.backoff.reset();this.readyState="closed";this.emit("close",n);this._reconnection&&!this.skipReconnect&&this.reconnect()};r.prototype.reconnect=function(){var n,t,i;if(this.reconnecting||this.skipReconnect)return this;n=this;this.backoff.attempts>=this._reconnectionAttempts?(u("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1):(t=this.backoff.duration(),u("will wait %dms before reconnect attempt",t),this.reconnecting=!0,i=setTimeout(function(){n.skipReconnect||(u("attempting reconnect"),n.emitAll("reconnect_attempt",n.backoff.attempts),n.emitAll("reconnecting",n.backoff.attempts),n.skipReconnect||n.open(function(t){t?(u("reconnect attempt error"),n.reconnecting=!1,n.reconnect(),n.emitAll("reconnect_error",t.data)):(u("reconnect success"),n.onreconnect())}))},t),this.subs.push({destroy:function(){clearTimeout(i)}}))};r.prototype.onreconnect=function(){var n=this.backoff.attempts;this.reconnecting=!1;this.backoff.reset();this.updateSocketIds();this.emitAll("reconnect",n)}},function(n,t,i){n.exports=i(15)},function(n,t,i){n.exports=i(16);n.exports.parser=i(23)},function(n,t,i){(function(t){function r(n,i){if(!(this instanceof r))return new r(n,i);i=i||{};n&&"object"==typeof n&&(i=n,n=null);n?(n=e(n),i.hostname=n.host,i.secure="https"===n.protocol||"wss"===n.protocol,i.port=n.port,n.query&&(i.query=n.query)):i.host&&(i.hostname=e(i.host).host);this.secure=null!=i.secure?i.secure:t.location&&"https:"===location.protocol;i.hostname&&!i.port&&(i.port=this.secure?"443":"80");this.agent=i.agent||!1;this.hostname=i.hostname||(t.location?location.hostname:"localhost");this.port=i.port||(t.location&&location.port?location.port:this.secure?443:80);this.query=i.query||{};"string"==typeof this.query&&(this.query=a.decode(this.query));this.upgrade=!1!==i.upgrade;this.path=(i.path||"/engine.io").replace(/\/$/,"")+"/";this.forceJSONP=!!i.forceJSONP;this.jsonp=!1!==i.jsonp;this.forceBase64=!!i.forceBase64;this.enablesXDR=!!i.enablesXDR;this.timestampParam=i.timestampParam||"t";this.timestampRequests=i.timestampRequests;this.transports=i.transports||["polling","websocket"];this.transportOptions=i.transportOptions||{};this.readyState="";this.writeBuffer=[];this.prevBufferLen=0;this.policyPort=i.policyPort||843;this.rememberUpgrade=i.rememberUpgrade||!1;this.binaryType=null;this.onlyBinaryUpgrades=i.onlyBinaryUpgrades;this.perMessageDeflate=!1!==i.perMessageDeflate&&(i.perMessageDeflate||{});!0===this.perMessageDeflate&&(this.perMessageDeflate={});this.perMessageDeflate&&null==this.perMessageDeflate.threshold&&(this.perMessageDeflate.threshold=1024);this.pfx=i.pfx||null;this.key=i.key||null;this.passphrase=i.passphrase||null;this.cert=i.cert||null;this.ca=i.ca||null;this.ciphers=i.ciphers||null;this.rejectUnauthorized=void 0===i.rejectUnauthorized||i.rejectUnauthorized;this.forceNode=!!i.forceNode;var u="object"==typeof t&&t;u.global===u&&(i.extraHeaders&&Object.keys(i.extraHeaders).length>0&&(this.extraHeaders=i.extraHeaders),i.localAddress&&(this.localAddress=i.localAddress));this.id=null;this.upgrades=null;this.pingInterval=null;this.pingTimeout=null;this.pingIntervalTimer=null;this.pingTimeoutTimer=null;this.open()}function o(n){var i={},t;for(t in n)n.hasOwnProperty(t)&&(i[t]=n[t]);return i}var s=i(17),h=i(8),u=i(3)("engine.io-client:socket"),c=i(37),f=i(23),e=i(2),l=i(38),a=i(31);n.exports=r;r.priorWebsocketSuccess=!1;h(r.prototype);r.protocol=f.protocol;r.Socket=r;r.Transport=i(22);r.transports=i(17);r.parser=i(23);r.prototype.createTransport=function(n){var i,t;return u('creating transport "%s"',n),i=o(this.query),i.EIO=f.protocol,i.transport=n,t=this.transportOptions[n]||{},this.id&&(i.sid=this.id),new s[n]({query:i,socket:this,agent:t.agent||this.agent,hostname:t.hostname||this.hostname,port:t.port||this.port,secure:t.secure||this.secure,path:t.path||this.path,forceJSONP:t.forceJSONP||this.forceJSONP,jsonp:t.jsonp||this.jsonp,forceBase64:t.forceBase64||this.forceBase64,enablesXDR:t.enablesXDR||this.enablesXDR,timestampRequests:t.timestampRequests||this.timestampRequests,timestampParam:t.timestampParam||this.timestampParam,policyPort:t.policyPort||this.policyPort,pfx:t.pfx||this.pfx,key:t.key||this.key,passphrase:t.passphrase||this.passphrase,cert:t.cert||this.cert,ca:t.ca||this.ca,ciphers:t.ciphers||this.ciphers,rejectUnauthorized:t.rejectUnauthorized||this.rejectUnauthorized,perMessageDeflate:t.perMessageDeflate||this.perMessageDeflate,extraHeaders:t.extraHeaders||this.extraHeaders,forceNode:t.forceNode||this.forceNode,localAddress:t.localAddress||this.localAddress,requestTimeout:t.requestTimeout||this.requestTimeout,protocols:t.protocols||void 0})};r.prototype.open=function(){var n,t;if(this.rememberUpgrade&&r.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)n="websocket";else{if(0===this.transports.length)return t=this,void setTimeout(function(){t.emit("error","No transports available")},0);n=this.transports[0]}this.readyState="opening";try{n=this.createTransport(n)}catch(i){return this.transports.shift(),void this.open()}n.open();this.setTransport(n)};r.prototype.setTransport=function(n){u("setting transport %s",n.name);var t=this;this.transport&&(u("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners());this.transport=n;n.on("drain",function(){t.onDrain()}).on("packet",function(n){t.onPacket(n)}).on("error",function(n){t.onError(n)}).on("close",function(){t.onClose("transport close")})};r.prototype.probe=function(n){function o(){if(i.onlyBinaryUpgrades){var e=!this.supportsBinary&&i.transport.supportsBinary;f=f||e}f||(u('probe transport "%s" opened',n),t.send([{type:"ping",data:"probe"}]),t.once("packet",function(e){if(!f)if("pong"===e.type&&"probe"===e.data){if(u('probe transport "%s" pong',n),i.upgrading=!0,i.emit("upgrading",t),!t)return;r.priorWebsocketSuccess="websocket"===t.name;u('pausing current transport "%s"',i.transport.name);i.transport.pause(function(){f||"closed"!==i.readyState&&(u("changing transport and sending upgrade packet"),a(),i.setTransport(t),t.send([{type:"upgrade"}]),i.emit("upgrade",t),t=null,i.upgrading=!1,i.flush())})}else{u('probe transport "%s" failed',n);var o=new Error("probe error");o.transport=t.name;i.emit("upgradeError",o)}}))}function s(){f||(f=!0,a(),t.close(),t=null)}function e(r){var f=new Error("probe error: "+r);f.transport=t.name;s();u('probe transport "%s" failed because of error: %s',n,r);i.emit("upgradeError",f)}function h(){e("transport closed")}function c(){e("socket closed")}function l(n){t&&n.name!==t.name&&(u('"%s" works - aborting "%s"',n.name,t.name),s())}function a(){t.removeListener("open",o);t.removeListener("error",e);t.removeListener("close",h);i.removeListener("close",c);i.removeListener("upgrading",l)}u('probing transport "%s"',n);var t=this.createTransport(n,{probe:1}),f=!1,i=this;r.priorWebsocketSuccess=!1;t.once("open",o);t.once("error",e);t.once("close",h);this.once("close",c);this.once("upgrading",l);t.open()};r.prototype.onOpen=function(){if(u("socket open"),this.readyState="open",r.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.upgrade&&this.transport.pause){u("starting upgrade probes");for(var n=0,t=this.upgrades.length;n<t;n++)this.probe(this.upgrades[n])}};r.prototype.onPacket=function(n){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(u('socket receive: type "%s", data "%s"',n.type,n.data),this.emit("packet",n),this.emit("heartbeat"),n.type){case"open":this.onHandshake(l(n.data));break;case"pong":this.setPing();this.emit("pong");break;case"error":var t=new Error("server error");t.code=n.data;this.onError(t);break;case"message":this.emit("data",n.data);this.emit("message",n.data)}else u('packet received with socket readyState "%s"',this.readyState)};r.prototype.onHandshake=function(n){this.emit("handshake",n);this.id=n.sid;this.transport.query.sid=n.sid;this.upgrades=this.filterUpgrades(n.upgrades);this.pingInterval=n.pingInterval;this.pingTimeout=n.pingTimeout;this.onOpen();"closed"!==this.readyState&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))};r.prototype.onHeartbeat=function(n){clearTimeout(this.pingTimeoutTimer);var t=this;t.pingTimeoutTimer=setTimeout(function(){"closed"!==t.readyState&&t.onClose("ping timeout")},n||t.pingInterval+t.pingTimeout)};r.prototype.setPing=function(){var n=this;clearTimeout(n.pingIntervalTimer);n.pingIntervalTimer=setTimeout(function(){u("writing ping packet - expecting pong within %sms",n.pingTimeout);n.ping();n.onHeartbeat(n.pingTimeout)},n.pingInterval)};r.prototype.ping=function(){var n=this;this.sendPacket("ping",function(){n.emit("ping")})};r.prototype.onDrain=function(){this.writeBuffer.splice(0,this.prevBufferLen);this.prevBufferLen=0;0===this.writeBuffer.length?this.emit("drain"):this.flush()};r.prototype.flush=function(){"closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(u("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))};r.prototype.write=r.prototype.send=function(n,t,i){return this.sendPacket("message",n,t,i),this};r.prototype.sendPacket=function(n,t,i,r){if("function"==typeof t&&(r=t,t=void 0),"function"==typeof i&&(r=i,i=null),"closing"!==this.readyState&&"closed"!==this.readyState){i=i||{};i.compress=!1!==i.compress;var u={type:n,data:t,options:i};this.emit("packetCreate",u);this.writeBuffer.push(u);r&&this.once("flush",r);this.flush()}};r.prototype.close=function(){function i(){n.onClose("forced close");u("socket closing - telling transport to close");n.transport.close()}function t(){n.removeListener("upgrade",t);n.removeListener("upgradeError",t);i()}function r(){n.once("upgrade",t);n.once("upgradeError",t)}if("opening"===this.readyState||"open"===this.readyState){this.readyState="closing";var n=this;this.writeBuffer.length?this.once("drain",function(){this.upgrading?r():i()}):this.upgrading?r():i()}return this};r.prototype.onError=function(n){u("socket error %j",n);r.priorWebsocketSuccess=!1;this.emit("error",n);this.onClose("transport error",n)};r.prototype.onClose=function(n,t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){u('socket close with reason: "%s"',n);var i=this;clearTimeout(this.pingIntervalTimer);clearTimeout(this.pingTimeoutTimer);this.transport.removeAllListeners("close");this.transport.close();this.transport.removeAllListeners();this.readyState="closed";this.id=null;this.emit("close",n,t);i.writeBuffer=[];i.prevBufferLen=0}};r.prototype.filterUpgrades=function(n){for(var i=[],t=0,r=n.length;t<r;t++)~c(this.transports,n[t])&&i.push(n[t]);return i}}).call(t,function(){return this}())},function(n,t,i){(function(n){function r(t){var o,s=!1,h=!1,c=!1!==t.jsonp,r,i;if(n.location&&(r="https:"===location.protocol,i=location.port,i||(i=r?443:80),s=t.hostname!==location.hostname||i!==t.port,h=t.secure!==r),t.xdomain=s,t.xscheme=h,o=new u(t),"open"in o&&!t.forceJSONP)return new f(t);if(!c)throw new Error("JSONP disabled");return new e(t)}var u=i(18),f=i(20),e=i(34),o=i(35);t.polling=r;t.websocket=o}).call(t,function(){return this}())},function(n,t,i){(function(t){var r=i(19);n.exports=function(n){var i=n.xdomain,u=n.xscheme,f=n.enablesXDR;try{if("undefined"!=typeof XMLHttpRequest&&(!i||r))return new XMLHttpRequest}catch(e){}try{if("undefined"!=typeof XDomainRequest&&!u&&f)return new XDomainRequest}catch(e){}if(!i)try{return new t[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch(e){}}}).call(t,function(){return this}())},function(n){try{n.exports="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(t){n.exports=!1}},function(n,t,i){(function(t){function e(){}function u(n){if(s.call(this,n),this.requestTimeout=n.requestTimeout,this.extraHeaders=n.extraHeaders,t.location){var r="https:"===location.protocol,i=location.port;i||(i=r?443:80);this.xd=n.hostname!==t.location.hostname||i!==n.port;this.xs=n.secure!==r}}function r(n){this.method=n.method||"GET";this.uri=n.uri;this.xd=!!n.xd;this.xs=!!n.xs;this.async=!1!==n.async;this.data=void 0!==n.data?n.data:null;this.agent=n.agent;this.isBinary=n.isBinary;this.supportsBinary=n.supportsBinary;this.enablesXDR=n.enablesXDR;this.requestTimeout=n.requestTimeout;this.pfx=n.pfx;this.key=n.key;this.passphrase=n.passphrase;this.cert=n.cert;this.ca=n.ca;this.ciphers=n.ciphers;this.rejectUnauthorized=n.rejectUnauthorized;this.extraHeaders=n.extraHeaders;this.create()}function o(){for(var n in r.requests)r.requests.hasOwnProperty(n)&&r.requests[n].abort()}var h=i(18),s=i(21),c=i(8),l=i(32),f=i(3)("engine.io-client:polling-xhr");n.exports=u;n.exports.Request=r;l(u,s);u.prototype.supportsBinary=!0;u.prototype.request=function(n){return n=n||{},n.uri=this.uri(),n.xd=this.xd,n.xs=this.xs,n.agent=this.agent||!1,n.supportsBinary=this.supportsBinary,n.enablesXDR=this.enablesXDR,n.pfx=this.pfx,n.key=this.key,n.passphrase=this.passphrase,n.cert=this.cert,n.ca=this.ca,n.ciphers=this.ciphers,n.rejectUnauthorized=this.rejectUnauthorized,n.requestTimeout=this.requestTimeout,n.extraHeaders=this.extraHeaders,new r(n)};u.prototype.doWrite=function(n,t){var r="string"!=typeof n&&void 0!==n,i=this.request({method:"POST",data:n,isBinary:r}),u=this;i.on("success",t);i.on("error",function(n){u.onError("xhr post error",n)});this.sendXhr=i};u.prototype.doPoll=function(){f("xhr poll");var n=this.request(),t=this;n.on("data",function(n){t.onData(n)});n.on("error",function(n){t.onError("xhr poll error",n)});this.pollXhr=n};c(r.prototype);r.prototype.create=function(){var i={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR},n,u,e;i.pfx=this.pfx;i.key=this.key;i.passphrase=this.passphrase;i.cert=this.cert;i.ca=this.ca;i.ciphers=this.ciphers;i.rejectUnauthorized=this.rejectUnauthorized;n=this.xhr=new h(i);u=this;try{f("xhr open %s: %s",this.method,this.uri);n.open(this.method,this.uri,this.async);try{if(this.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(e in this.extraHeaders)this.extraHeaders.hasOwnProperty(e)&&n.setRequestHeader(e,this.extraHeaders[e])}}catch(o){}if("POST"===this.method)try{this.isBinary?n.setRequestHeader("Content-type","application/octet-stream"):n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(o){}try{n.setRequestHeader("Accept","*/*")}catch(o){}"withCredentials"in n&&(n.withCredentials=!0);this.requestTimeout&&(n.timeout=this.requestTimeout);this.hasXDR()?(n.onload=function(){u.onLoad()},n.onerror=function(){u.onError(n.responseText)}):n.onreadystatechange=function(){if(2===n.readyState){var t;try{t=n.getResponseHeader("Content-Type")}catch(i){}"application/octet-stream"===t&&(n.responseType="arraybuffer")}4===n.readyState&&(200===n.status||1223===n.status?u.onLoad():setTimeout(function(){u.onError(n.status)},0))};f("xhr data %s",this.data);n.send(this.data)}catch(o){return void setTimeout(function(){u.onError(o)},0)}t.document&&(this.index=r.requestsCount++,r.requests[this.index]=this)};r.prototype.onSuccess=function(){this.emit("success");this.cleanup()};r.prototype.onData=function(n){this.emit("data",n);this.onSuccess()};r.prototype.onError=function(n){this.emit("error",n);this.cleanup(!0)};r.prototype.cleanup=function(n){if("undefined"!=typeof this.xhr&&null!==this.xhr){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=e:this.xhr.onreadystatechange=e,n)try{this.xhr.abort()}catch(i){}t.document&&delete r.requests[this.index];this.xhr=null}};r.prototype.onLoad=function(){var n,t;try{try{t=this.xhr.getResponseHeader("Content-Type")}catch(i){}n="application/octet-stream"===t?this.xhr.response||this.xhr.responseText:this.xhr.responseText}catch(i){this.onError(i)}null!=n&&this.onData(n)};r.prototype.hasXDR=function(){return"undefined"!=typeof t.XDomainRequest&&!this.xs&&this.enablesXDR};r.prototype.abort=function(){this.cleanup()};r.requestsCount=0;r.requests={};t.document&&(t.attachEvent?t.attachEvent("onunload",o):t.addEventListener&&t.addEventListener("beforeunload",o,!1))}).call(t,function(){return this}())},function(n,t,i){function u(n){var t=n&&n.forceBase64;o&&!t||(this.supportsBinary=!1);f.call(this,n)}var f=i(22),s=i(31),e=i(23),h=i(32),c=i(33),r=i(3)("engine.io-client:polling"),o;n.exports=u;o=function(){var n=i(18),t=new n({xdomain:!1});return null!=t.responseType}();h(u,f);u.prototype.name="polling";u.prototype.doOpen=function(){this.poll()};u.prototype.pause=function(n){function i(){r("paused");u.readyState="paused";n()}var u=this,t;(this.readyState="pausing",this.polling||!this.writable)?(t=0,this.polling&&(r("we are currently polling - waiting to pause"),t++,this.once("pollComplete",function(){r("pre-pause polling complete");--t||i()})),this.writable||(r("we are currently writing - waiting to pause"),t++,this.once("drain",function(){r("pre-pause writing complete");--t||i()}))):i()};u.prototype.poll=function(){r("polling");this.polling=!0;this.doPoll();this.emit("poll")};u.prototype.onData=function(n){var t=this,i;r("polling got data %s",n);i=function(n){return"opening"===t.readyState&&t.onOpen(),"close"===n.type?(t.onClose(),!1):void t.onPacket(n)};e.decodePayload(n,this.socket.binaryType,i);"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState?this.poll():r('ignoring poll - transport state "%s"',this.readyState))};u.prototype.doClose=function(){function n(){r("writing close packet");t.write([{type:"close"}])}var t=this;"open"===this.readyState?(r("transport open - closing"),n()):(r("transport not open - deferring close"),this.once("open",n))};u.prototype.write=function(n){var t=this,i;this.writable=!1;i=function(){t.writable=!0;t.emit("drain")};e.encodePayload(n,this.supportsBinary,function(n){t.doWrite(n,i)})};u.prototype.uri=function(){var n=this.query||{},t=this.secure?"https":"http",i="",r;return!1!==this.timestampRequests&&(n[this.timestampParam]=c()),this.supportsBinary||n.sid||(n.b64=1),n=s.encode(n),this.port&&("https"===t&&443!==Number(this.port)||"http"===t&&80!==Number(this.port))&&(i=":"+this.port),n.length&&(n="?"+n),r=this.hostname.indexOf(":")!==-1,t+"://"+(r?"["+this.hostname+"]":this.hostname)+i+this.path+n}},function(n,t,i){function r(n){this.path=n.path;this.hostname=n.hostname;this.port=n.port;this.secure=n.secure;this.query=n.query;this.timestampParam=n.timestampParam;this.timestampRequests=n.timestampRequests;this.readyState="";this.agent=n.agent||!1;this.socket=n.socket;this.enablesXDR=n.enablesXDR;this.pfx=n.pfx;this.key=n.key;this.passphrase=n.passphrase;this.cert=n.cert;this.ca=n.ca;this.ciphers=n.ciphers;this.rejectUnauthorized=n.rejectUnauthorized;this.forceNode=n.forceNode;this.extraHeaders=n.extraHeaders;this.localAddress=n.localAddress}var u=i(23),f=i(8);n.exports=r;f(r.prototype);r.prototype.onError=function(n,t){var i=new Error(n);return i.type="TransportError",i.description=t,this.emit("error",i),this};r.prototype.open=function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this};r.prototype.close=function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this};r.prototype.send=function(n){if("open"!==this.readyState)throw new Error("Transport not open");this.write(n)};r.prototype.onOpen=function(){this.readyState="open";this.writable=!0;this.emit("open")};r.prototype.onData=function(n){var t=u.decodePacket(n,this.socket.binaryType);this.onPacket(t)};r.prototype.onPacket=function(n){this.emit("packet",n)};r.prototype.onClose=function(){this.readyState="closed";this.emit("close")}},function(n,t,i){(function(n){function a(n,i){var r="b"+t.packets[n.type]+n.data.data;return i(r)}function v(n,i,r){var u;if(!i)return t.encodeBase64Packet(n,r);var e=n.data,s=new Uint8Array(e),f=new Uint8Array(1+e.byteLength);for(f[0]=o[n.type],u=0;u<s.length;u++)f[u+1]=s[u];return r(f.buffer)}function y(n,i,r){if(!i)return t.encodeBase64Packet(n,r);var u=new FileReader;return u.onload=function(){n.data=u.result;t.encodePacket(n,i,!0,r)},u.readAsArrayBuffer(n.data)}function p(n,i,r){var f,e;return i?l?y(n,i,r):(f=new Uint8Array(1),f[0]=o[n.type],e=new u([f.buffer,n.data]),r(e)):t.encodeBase64Packet(n,r)}function w(n){try{n=c.decode(n,{strict:!1})}catch(t){return!1}return n}function s(n,t,i){for(var u=new Array(n.length),f=d(n.length,i),e=function(n,i,r){t(i,function(t,i){u[n]=i;r(t,u)})},r=0;r<n.length;r++)e(r,n[r],f)}var h,b=i(24),k=i(9),e=i(25),d=i(26),c=i(27);n&&n.ArrayBuffer&&(h=i(29));var g="undefined"!=typeof navigator&&/Android/i.test(navigator.userAgent),nt="undefined"!=typeof navigator&&/PhantomJS/i.test(navigator.userAgent),l=g||nt;t.protocol=3;var o=t.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},f=b(o),r={type:"error",data:"parser error"},u=i(30);t.encodePacket=function(t,i,r,f){var e,s;return("function"==typeof i&&(f=i,i=!1),"function"==typeof r&&(f=r,r=null),e=void 0===t.data?void 0:t.data.buffer||t.data,n.ArrayBuffer&&e instanceof ArrayBuffer)?v(t,i,f):u&&e instanceof n.Blob?p(t,i,f):e&&e.base64?a(t,f):(s=o[t.type],void 0!==t.data&&(s+=r?c.encode(String(t.data),{strict:!1}):String(t.data)),f(""+s))};t.encodeBase64Packet=function(i,r){var o="b"+t.packets[i.type],f,s;if(u&&i.data instanceof n.Blob)return f=new FileReader,f.onload=function(){var n=f.result.split(",")[1];r(o+n)},f.readAsDataURL(i.data);try{s=String.fromCharCode.apply(null,new Uint8Array(i.data))}catch(l){for(var h=new Uint8Array(i.data),c=new Array(h.length),e=0;e<h.length;e++)c[e]=h[e];s=String.fromCharCode.apply(null,c)}return o+=n.btoa(s),r(o)};t.decodePacket=function(n,i,o){var s;if(void 0===n)return r;if("string"==typeof n)return"b"===n.charAt(0)?t.decodeBase64Packet(n.substr(1),i):o&&(n=w(n),n===!1)?r:(s=n.charAt(0),Number(s)==s&&f[s]?n.length>1?{type:f[s],data:n.substring(1)}:{type:f[s]}:r);var c=new Uint8Array(n),s=c[0],h=e(n,1);return u&&"blob"===i&&(h=new u([h])),{type:f[s],data:h}};t.decodeBase64Packet=function(n,t){var r=f[n.charAt(0)],i;return h?(i=h.decode(n.substr(1)),"blob"===t&&u&&(i=new u([i])),{type:r,data:i}):{type:r,data:{base64:!0,data:n.substr(1)}}};t.encodePayload=function(n,i,r){function e(n){return n.length+":"+n}function o(n,r){t.encodePacket(n,!!f&&i,!1,function(n){r(null,e(n))})}"function"==typeof i&&(r=i,i=null);var f=k(n);return i&&f?u&&!l?t.encodePayloadAsBlob(n,r):t.encodePayloadAsArrayBuffer(n,r):n.length?void s(n,o,function(n,t){return r(t.join(""))}):r("0:")};t.decodePayload=function(n,i,u){var o,c,a;if("string"!=typeof n)return t.decodePayloadAsBinary(n,i,u);if("function"==typeof i&&(u=i,i=null),""===n)return u(r,0,1);for(var s,h,f="",e=0,l=n.length;e<l;e++)if(c=n.charAt(e),":"===c){if(""===f||f!=(s=Number(f))||(h=n.substr(e+1,s),f!=h.length))return u(r,0,1);if(h.length){if(o=t.decodePacket(h,i,!1),r.type===o.type&&r.data===o.data)return u(r,0,1);if(a=u(o,e+s,l),!1===a)return}e+=s;f=""}else f+=c;if(""!==f)return u(r,0,1)};t.encodePayloadAsArrayBuffer=function(n,i){function r(n,i){t.encodePacket(n,!0,!0,function(n){return i(null,n)})}return n.length?void s(n,r,function(n,t){var f=t.reduce(function(n,t){var i;return i="string"==typeof t?t.length:t.byteLength,n+i.toString().length+i+2},0),r=new Uint8Array(f),u=0;return t.forEach(function(n){var o="string"==typeof n,f=n,e,i,t;if(o){for(i=new Uint8Array(n.length),t=0;t<n.length;t++)i[t]=n.charCodeAt(t);f=i.buffer}for(r[u++]=o?0:1,e=f.byteLength.toString(),t=0;t<e.length;t++)r[u++]=parseInt(e[t]);for(r[u++]=255,i=new Uint8Array(f),t=0;t<i.length;t++)r[u++]=i[t]}),i(r.buffer)}):i(new ArrayBuffer(0))};t.encodePayloadAsBlob=function(n,i){function r(n,i){t.encodePacket(n,!0,!0,function(n){var f=new Uint8Array(1),e,t,s;if(f[0]=1,"string"==typeof n){for(e=new Uint8Array(n.length),t=0;t<n.length;t++)e[t]=n.charCodeAt(t);n=e.buffer;f[0]=0}for(var h=n instanceof ArrayBuffer?n.byteLength:n.size,r=h.toString(),o=new Uint8Array(r.length+1),t=0;t<r.length;t++)o[t]=parseInt(r[t]);(o[r.length]=255,u)&&(s=new u([f.buffer,o.buffer,n]),i(null,s))})}s(n,r,function(n,t){return i(new u(t))})};t.decodePayloadAsBinary=function(n,i,u){var f,c,h,a,o,v;for("function"==typeof i&&(u=i,i=null),f=n,c=[];f.byteLength>0;){for(var l=new Uint8Array(f),y=0===l[0],s="",o=1;255!==l[o];o++){if(s.length>310)return u(r,0,1);s+=l[o]}if(f=e(f,2+s.length),s=parseInt(s),h=e(f,0,s),y)try{h=String.fromCharCode.apply(null,new Uint8Array(h))}catch(p){for(a=new Uint8Array(h),h="",o=0;o<a.length;o++)h+=String.fromCharCode(a[o])}c.push(h);f=e(f,s)}v=c.length;c.forEach(function(n,r){u(t.decodePacket(n,i,!0),r,v)})}}).call(t,function(){return this}())},function(n){n.exports=Object.keys||function(n){var i=[],r=Object.prototype.hasOwnProperty,t;for(t in n)r.call(n,t)&&i.push(t);return i}},function(n){n.exports=function(n,t,i){var r=n.byteLength;if(t=t||0,i=i||r,n.slice)return n.slice(t,i);if(t<0&&(t+=r),i<0&&(i+=r),i>r&&(i=r),t>=r||t>=i||0===r)return new ArrayBuffer(0);for(var o=new Uint8Array(n),f=new Uint8Array(i-t),u=t,e=0;u<i;u++,e++)f[e]=o[u];return f.buffer}},function(n){function t(n,t,r){function u(n,i){if(u.count<=0)throw new Error("after called too many times");--u.count;n?(f=!0,t(n),t=r):0!==u.count||f||t(null,i)}var f=!1;return r=r||i,u.count=n,0===n?t():u}function i(){}n.exports=t},function(n,t,i){var r;(function(n,u){!function(f){function v(n){for(var t,u,r=[],i=0,f=n.length;i<f;)t=n.charCodeAt(i++),t>=55296&&t<=56319&&i<f?(u=n.charCodeAt(i++),56320==(64512&u)?r.push(((1023&t)<<10)+(1023&u)+65536):(r.push(t),i--)):r.push(t);return r}function w(n){for(var t,u=n.length,r=-1,i="";++r<u;)t=n[r],t>65535&&(t-=65536,i+=e(t>>>10&1023|55296),t=56320|1023&t),i+=e(t);return i}function y(n,t){if(n>=55296&&n<=57343){if(t)throw Error("Lone surrogate U+"+n.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function a(n,t){return e(n>>t&63|128)}function b(n,t){if(0==(4294967168&n))return e(n);var i="";return 0==(4294965248&n)?i=e(n>>6&31|192):0==(4294901760&n)?(y(n,t)||(n=65533),i=e(n>>12&15|224),i+=a(n,6)):0==(4292870144&n)&&(i=e(n>>18&7|240),i+=a(n,12),i+=a(n,6)),i+e(63&n|128)}function k(n,t){t=t||{};for(var i,e=!1!==t.strict,r=v(n),o=r.length,u=-1,f="";++u<o;)i=r[u],f+=b(i,e);return f}function s(){if(o>=l)throw Error("Invalid byte index");var n=255&c[o];if(o++,128==(192&n))return 63&n;throw Error("Invalid continuation byte");}function d(n){var i,r,u,f,t;if(o>l)throw Error("Invalid byte index");if(o==l)return!1;if(i=255&c[o],o++,0==(128&i))return i;if(192==(224&i)){if(r=s(),t=(31&i)<<6|r,t>=128)return t;throw Error("Invalid continuation byte");}if(224==(240&i)){if(r=s(),u=s(),t=(15&i)<<12|r<<6|u,t>=2048)return y(t,n)?t:65533;throw Error("Invalid continuation byte");}if(240==(248&i)&&(r=s(),u=s(),f=s(),t=(7&i)<<18|r<<12|u<<6|f,t>=65536&&t<=1114111))return t;throw Error("Invalid UTF-8 detected");}function g(n,t){var r,u,i;for(t=t||{},r=!1!==t.strict,c=v(n),l=c.length,o=0,i=[];(u=d(r))!==!1;)i.push(u);return w(i)}var nt="object"==typeof t&&t,h=("object"==typeof n&&n&&n.exports==nt&&n,"object"==typeof u&&u),c,l,o,e,p;h.global!==h&&h.window!==h||(f=h);e=String.fromCharCode;p={version:"2.1.2",encode:k,decode:g};r=function(){return p}.call(t,i,t,n);!(void 0!==r&&(n.exports=r))}(this)}).call(t,i(28)(n),function(){return this}())},function(n){n.exports=function(n){return n.webpackPolyfill||(n.deprecate=function(){},n.paths=[],n.children=[],n.webpackPolyfill=1),n}},function(n,t){!function(){"use strict";for(var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=new Uint8Array(256),r=0;r<n.length;r++)i[n.charCodeAt(r)]=r;t.encode=function(t){for(var u=new Uint8Array(t),f=u.length,i="",r=0;r<f;r+=3)i+=n[u[r]>>2],i+=n[(3&u[r])<<4|u[r+1]>>4],i+=n[(15&u[r+1])<<2|u[r+2]>>6],i+=n[63&u[r+2]];return f%3==2?i=i.substring(0,i.length-1)+"=":f%3==1&&(i=i.substring(0,i.length-2)+"=="),i};t.decode=function(n){var t,h,u,f,c,e=.75*n.length,l=n.length,o=0,s,r;for("="===n[n.length-1]&&(e--,"="===n[n.length-2]&&e--),s=new ArrayBuffer(e),r=new Uint8Array(s),t=0;t<l;t+=4)h=i[n.charCodeAt(t)],u=i[n.charCodeAt(t+1)],f=i[n.charCodeAt(t+2)],c=i[n.charCodeAt(t+3)],r[o++]=h<<2|u>>4,r[o++]=(15&u)<<4|f>>2,r[o++]=(3&f)<<6|63&c;return s}}()},function(n,t){(function(t){function r(n){for(var t,r,u,i=0;i<n.length;i++)t=n[i],t.buffer instanceof ArrayBuffer&&(r=t.buffer,t.byteLength!==r.byteLength&&(u=new Uint8Array(t.byteLength),u.set(new Uint8Array(r,t.byteOffset,t.byteLength)),r=u.buffer),n[i]=r)}function f(n,t){var u,f;for(t=t||{},u=new i,r(n),f=0;f<n.length;f++)u.append(n[f]);return t.type?u.getBlob(t.type):u.getBlob()}function e(n,t){return r(n),new Blob(n,t||{})}var i=t.BlobBuilder||t.WebKitBlobBuilder||t.MSBlobBuilder||t.MozBlobBuilder,u=function(){try{var n=new Blob(["hi"]);return 2===n.size}catch(t){return!1}}(),o=u&&function(){try{var n=new Blob([new Uint8Array([1,2])]);return 2===n.size}catch(t){return!1}}(),s=i&&i.prototype.append&&i.prototype.getBlob;n.exports=function(){return u?o?t.Blob:e:s?f:void 0}()}).call(t,function(){return this}())},function(n,t){t.encode=function(n){var t="",i;for(i in n)n.hasOwnProperty(i)&&(t.length&&(t+="&"),t+=encodeURIComponent(i)+"="+encodeURIComponent(n[i]));return t};t.decode=function(n){for(var i,r={},u=n.split("&"),t=0,f=u.length;t<f;t++)i=u[t].split("="),r[decodeURIComponent(i[0])]=decodeURIComponent(i[1]);return r}},function(n){n.exports=function(n,t){var i=function(){};i.prototype=t.prototype;n.prototype=new i;n.prototype.constructor=n}},function(n){"use strict";function r(n){var t="";do t=e[n%i]+t,n=Math.floor(n/i);while(n>0);return t}function h(n){var r=0;for(t=0;t<n.length;t++)r=r*i+o[n.charAt(t)];return r}function u(){var n=r(+new Date);return n!==f?(s=0,f=n):n+"."+r(s++)}for(var f,e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),i=64,o={},s=0,t=0;t<i;t++)o[e[t]]=t;u.encode=r;u.decode=h;n.exports=u},function(n,t,i){(function(t){function s(){}function r(n){f.call(this,n);this.query=this.query||{};u||(t.___eio||(t.___eio=[]),u=t.___eio);this.index=u.length;var i=this;u.push(function(n){i.onData(n)});this.query.j=this.index;t.document&&t.addEventListener&&t.addEventListener("beforeunload",function(){i.script&&(i.script.onerror=s)},!1)}var f=i(21),h=i(32),u,e,o;n.exports=r;e=/\n/g;o=/\\n/g;h(r,f);r.prototype.supportsBinary=!1;r.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null);this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null);f.prototype.doClose.call(this)};r.prototype.doPoll=function(){var r=this,n=document.createElement("script"),t,i;this.script&&(this.script.parentNode.removeChild(this.script),this.script=null);n.async=!0;n.src=this.uri();n.onerror=function(n){r.onError("jsonp poll error",n)};t=document.getElementsByTagName("script")[0];t?t.parentNode.insertBefore(n,t):(document.head||document.body).appendChild(n);this.script=n;i="undefined"!=typeof navigator&&/gecko/i.test(navigator.userAgent);i&&setTimeout(function(){var n=document.createElement("iframe");document.body.appendChild(n);document.body.removeChild(n)},100)};r.prototype.doWrite=function(n,t){function s(){h();t()}function h(){if(i.iframe)try{i.form.removeChild(i.iframe)}catch(n){i.onError("jsonp polling iframe removal error",n)}try{var t='<iframe src="javascript:0" name="'+i.iframeId+'">';u=document.createElement(t)}catch(n){u=document.createElement("iframe");u.name=i.iframeId;u.src="javascript:0"}u.id=i.iframeId;i.form.appendChild(u);i.iframe=u}var i=this;if(!this.form){var u,r=document.createElement("form"),f=document.createElement("textarea"),c=this.iframeId="eio_iframe_"+this.index;r.className="socketio";r.style.position="absolute";r.style.top="-1000px";r.style.left="-1000px";r.target=c;r.method="POST";r.setAttribute("accept-charset","utf-8");f.name="d";r.appendChild(f);document.body.appendChild(r);this.form=r;this.area=f}this.form.action=this.uri();h();n=n.replace(o,"\\\n");this.area.value=n.replace(e,"\\n");try{this.form.submit()}catch(l){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===i.iframe.readyState&&s()}:this.iframe.onload=s}}).call(t,function(){return this}())},function(n,t,i){(function(t){function r(n){var t=n&&n.forceBase64;t&&(this.supportsBinary=!1);this.perMessageDeflate=n.perMessageDeflate;this.usingBrowserWebSocket=o&&!n.forceNode;this.protocols=n.protocols;this.usingBrowserWebSocket||(u=f);e.call(this,n)}var f,e=i(22),s=i(23),h=i(31),c=i(32),l=i(33),a=i(3)("engine.io-client:websocket"),o=t.WebSocket||t.MozWebSocket,u;if("undefined"==typeof window)try{f=i(36)}catch(v){}u=o;u||"undefined"!=typeof window||(u=f);n.exports=r;c(r,e);r.prototype.name="websocket";r.prototype.supportsBinary=!0;r.prototype.doOpen=function(){if(this.check()){var t=this.uri(),i=this.protocols,n={agent:this.agent,perMessageDeflate:this.perMessageDeflate};n.pfx=this.pfx;n.key=this.key;n.passphrase=this.passphrase;n.cert=this.cert;n.ca=this.ca;n.ciphers=this.ciphers;n.rejectUnauthorized=this.rejectUnauthorized;this.extraHeaders&&(n.headers=this.extraHeaders);this.localAddress&&(n.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket?i?new u(t,i):new u(t):new u(t,i,n)}catch(r){return this.emit("error",r)}void 0===this.ws.binaryType&&(this.supportsBinary=!1);this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer";this.addEventListeners()}};r.prototype.addEventListeners=function(){var n=this;this.ws.onopen=function(){n.onOpen()};this.ws.onclose=function(){n.onClose()};this.ws.onmessage=function(t){n.onData(t.data)};this.ws.onerror=function(t){n.onError("websocket error",t)}};r.prototype.write=function(n){function f(){i.emit("flush");setTimeout(function(){i.writable=!0;i.emit("drain")},0)}var i=this;this.writable=!1;for(var u=n.length,r=0,e=u;r<e;r++)!function(n){s.encodePacket(n,i.supportsBinary,function(r){var e,o;i.usingBrowserWebSocket||(e={},(n.options&&(e.compress=n.options.compress),i.perMessageDeflate)&&(o="string"==typeof r?t.Buffer.byteLength(r):r.length,o<i.perMessageDeflate.threshold&&(e.compress=!1)));try{i.usingBrowserWebSocket?i.ws.send(r):i.ws.send(r,e)}catch(s){a("websocket closed before onclose event")}--u||f()})}(n[r])};r.prototype.onClose=function(){e.prototype.onClose.call(this)};r.prototype.doClose=function(){"undefined"!=typeof this.ws&&this.ws.close()};r.prototype.uri=function(){var n=this.query||{},t=this.secure?"wss":"ws",i="",r;return this.port&&("wss"===t&&443!==Number(this.port)||"ws"===t&&80!==Number(this.port))&&(i=":"+this.port),this.timestampRequests&&(n[this.timestampParam]=l()),this.supportsBinary||(n.b64=1),n=h.encode(n),n.length&&(n="?"+n),r=this.hostname.indexOf(":")!==-1,t+"://"+(r?"["+this.hostname+"]":this.hostname)+i+this.path+n};r.prototype.check=function(){return!(!u||"__initialize"in u&&this.name===r.prototype.name)}}).call(t,function(){return this}())},function(){},function(n){var t=[].indexOf;n.exports=function(n,i){if(t)return n.indexOf(i);for(var r=0;r<n.length;++r)if(n[r]===i)return r;return-1}},function(n,t){(function(t){var i=/^[\],:{}\s]*$/,r=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,u=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,f=/(?:^|:|,)(?:\s*\[)+/g,e=/^\s+/,o=/\s+$/;n.exports=function(n){return"string"==typeof n&&n?(n=n.replace(e,"").replace(o,""),t.JSON&&JSON.parse?JSON.parse(n):i.test(n.replace(r,"@").replace(u,"]").replace(f,""))?new Function("return "+n)():void 0):null}}).call(t,function(){return this}())},function(n,t,i){"use strict";function r(n,t,i){this.io=n;this.nsp=t;this.json=this;this.ids=0;this.acks={};this.receiveBuffer=[];this.sendBuffer=[];this.connected=!1;this.disconnected=!0;i&&i.query&&(this.query=i.query);this.io.autoConnect&&this.open()}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},u=i(7),c=i(8),o=i(40),s=i(41),h=i(42),f=i(3)("socket.io-client:socket"),v=i(31),l,e;n.exports=t=r;l={connect:1,connect_error:1,connect_timeout:1,connecting:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1,ping:1,pong:1};e=c.prototype.emit;c(r.prototype);r.prototype.subEvents=function(){if(!this.subs){var n=this.io;this.subs=[s(n,"open",h(this,"onopen")),s(n,"packet",h(this,"onpacket")),s(n,"close",h(this,"onclose"))]}};r.prototype.open=r.prototype.connect=function(){return this.connected?this:(this.subEvents(),this.io.open(),"open"===this.io.readyState&&this.onopen(),this.emit("connecting"),this)};r.prototype.send=function(){var n=o(arguments);return n.unshift("message"),this.emit.apply(this,n),this};r.prototype.emit=function(n){if(l.hasOwnProperty(n))return e.apply(this,arguments),this;var i=o(arguments),t={type:u.EVENT,data:i};return t.options={},t.options.compress=!this.flags||!1!==this.flags.compress,"function"==typeof i[i.length-1]&&(f("emitting packet with ack id %d",this.ids),this.acks[this.ids]=i.pop(),t.id=this.ids++),this.connected?this.packet(t):this.sendBuffer.push(t),delete this.flags,this};r.prototype.packet=function(n){n.nsp=this.nsp;this.io.packet(n)};r.prototype.onopen=function(){if(f("transport is open - connecting"),"/"!==this.nsp)if(this.query){var n="object"===a(this.query)?v.encode(this.query):this.query;f("sending connect packet with query %s",n);this.packet({type:u.CONNECT,query:n})}else this.packet({type:u.CONNECT})};r.prototype.onclose=function(n){f("close (%s)",n);this.connected=!1;this.disconnected=!0;delete this.id;this.emit("disconnect",n)};r.prototype.onpacket=function(n){if(n.nsp===this.nsp)switch(n.type){case u.CONNECT:this.onconnect();break;case u.EVENT:this.onevent(n);break;case u.BINARY_EVENT:this.onevent(n);break;case u.ACK:this.onack(n);break;case u.BINARY_ACK:this.onack(n);break;case u.DISCONNECT:this.ondisconnect();break;case u.ERROR:this.emit("error",n.data)}};r.prototype.onevent=function(n){var t=n.data||[];f("emitting event %j",t);null!=n.id&&(f("attaching ack callback to event"),t.push(this.ack(n.id)));this.connected?e.apply(this,t):this.receiveBuffer.push(t)};r.prototype.ack=function(n){var i=this,t=!1;return function(){if(!t){t=!0;var r=o(arguments);f("sending ack %j",r);i.packet({type:u.ACK,id:n,data:r})}}};r.prototype.onack=function(n){var t=this.acks[n.id];"function"==typeof t?(f("calling ack %s with %j",n.id,n.data),t.apply(this,n.data),delete this.acks[n.id]):f("bad ack %s",n.id)};r.prototype.onconnect=function(){this.connected=!0;this.disconnected=!1;this.emit("connect");this.emitBuffered()};r.prototype.emitBuffered=function(){for(var n=0;n<this.receiveBuffer.length;n++)e.apply(this,this.receiveBuffer[n]);for(this.receiveBuffer=[],n=0;n<this.sendBuffer.length;n++)this.packet(this.sendBuffer[n]);this.sendBuffer=[]};r.prototype.ondisconnect=function(){f("server disconnect (%s)",this.nsp);this.destroy();this.onclose("io server disconnect")};r.prototype.destroy=function(){if(this.subs){for(var n=0;n<this.subs.length;n++)this.subs[n].destroy();this.subs=null}this.io.destroy(this)};r.prototype.close=r.prototype.disconnect=function(){return this.connected&&(f("performing disconnect (%s)",this.nsp),this.packet({type:u.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this};r.prototype.compress=function(n){return this.flags=this.flags||{},this.flags.compress=n,this}},function(n){function t(n,t){var r=[],i;for(t=t||0,i=t||0;i<n.length;i++)r[i-t]=n[i];return r}n.exports=t},function(n){"use strict";function t(n,t,i){return n.on(t,i),{destroy:function(){n.removeListener(t,i)}}}n.exports=t},function(n){var t=[].slice;n.exports=function(n,i){if("string"==typeof i&&(i=n[i]),"function"!=typeof i)throw new Error("bind() requires a function");var r=t.call(arguments,2);return function(){return i.apply(n,r.concat(t.call(arguments)))}}},function(n){function t(n){n=n||{};this.ms=n.min||100;this.max=n.max||1e4;this.factor=n.factor||2;this.jitter=n.jitter>0&&n.jitter<=1?n.jitter:0;this.attempts=0}n.exports=t;t.prototype.duration=function(){var n=this.ms*Math.pow(this.factor,this.attempts++),t,i;return this.jitter&&(t=Math.random(),i=Math.floor(t*this.jitter*n),n=0==(1&Math.floor(10*t))?n-i:n+i),0|Math.min(n,this.max)};t.prototype.reset=function(){this.attempts=0};t.prototype.setMin=function(n){this.ms=n};t.prototype.setMax=function(n){this.max=n};t.prototype.setJitter=function(n){this.jitter=n}}])}),function(n){n.LabelClogSocketObject=function(t,i){this.$socket=null;this.$el=n(i);this.$opts=n.extend(!0,{},n.LabelClogSocketObject.defaults,t);this._init()};n.LabelClogSocketObject.defaults={datas:[],labelinterval:500,labelckinterval:0,iscalculate:!0,ondraw:function(){return!1},onclog:function(){return!1}};n.LabelClogSocketObject.prototype={_init:function(){this._socket();this._clogbg()},setdata:function(n){this.$opts.datas=n;var t=this._getcode(n);this.$socket!=null&&this.$socket.emit("setcode",t)},adddata:function(n){for(var u=this.$opts.datas,r=[],i,f,t=0;t<n.length;t++){for(i=0;i<u.length;i++)u[i].code==n[t].code;r.push(n[t])}r.length>0&&(this.$opts.datas.push.apply(this.$opts.datas,r),f=this._getcode(this.$opts.datas),this.$socket!=null&&this.$socket.emit("setcode",f))},_getcode:function(n){for(var i=[],t=0;t<n.length;t++)i.push(n[t].code);return i},_getcontainer:function(n){for(var t=0;t<this.$opts.datas.length;t++)if(this.$opts.datas[t].code==n)return this.$opts.datas[t].container;return null},_socket:function(){var n=this,t=n._getcode(n.$opts.datas);this.$socket=io.connect(ebaiyinSettings.hqUrl,{query:{codes:t}});this.$socket.on("sendmarket",function(t){for(var i,r,u,f=0;f<t.length;f++){for(i=t[f],r=null,u=0;u<n.$opts.datas.length;u++)if(n.$opts.datas[u].code==i.Symbol){r=n.$opts.datas[u];break}if(r!=null){n.$opts.iscalculate&&(i.NewPrice=parseFloat(i.NewPrice,10),i.LastClose=parseFloat(i.LastClose,10),i.Floatprice=parseFloat(i.NewPrice-i.LastClose),i.Percentage=parseFloat(i.PriceChangeRatio),i.NewPrice==0&&(i.NewPrice=i.LastClose,i.Floatprice=0,i.Percentage=0),i.Floatprice=n._formatdata(i.Floatprice,3,!1),i.Percentage=n._formatdata(i.Percentage,3,!1));n.$opts.ondraw(r.container,r.data,i);r.data!=null&&(r.isclog=!0,r.date=new Date);r.data=i}}})},_clogbg:function(){var n=this;typeof n.$opts.onclog=="function"&&setInterval(function(){for(var u=new Date,i,r,t=0;t<n.$opts.datas.length;t++)if(i=n.$opts.datas[t],i.isclog&&(r=n._gettimespan(u,i.date,"fff"),r>=n.$opts.labelinterval)){n.$opts.onclog(i.container);n.$opts.datas[t].isclog=!1}},n.$opts.labelckinterval)},_formatdata:function(n,t,i){var u=String(n),o,f,r,e;if(u.indexOf(".")==-1)return parseFloat(n).toFixed(2);for(o=!1,u.indexOf("-")!=-1&&(u=u.substring(1,u.length),o=!0),f=u.split(".")[0],r=u.split(".")[1],i||(r=r.substring(0,t)),e=r.length-1;e>0;e--)if(r[e]=="0")r=r.substring(0,e);else break;return r=r.length<2?r+"0":r,r.length>t?o?parseFloat("-"+f+"."+r).toFixed(t):parseFloat(f+"."+r).toFixed(t):o?parseFloat("-"+f+"."+r).toFixed(r.length):parseFloat(f+"."+r).toFixed(r.length)},_gettimespan:function(n,t,i){var r=n.getTime()-t.getTime();return i=="fff"?r:r}};n.fn.labelclogsocket=function(t){return this.each(function(){var i=n.data(this,"labelclogsocket");i||n.data(this,"labelclogsocket",new n.LabelClogSocketObject(t,this))}),this}}(jQuery)