1 line
471 KiB
Plaintext
1 line
471 KiB
Plaintext
{"version":3,"sources":["../yjs/node_modules/browser-pack/_prelude.js","node_modules/after/index.js","y-websockets-client.js","node_modules/arraybuffer.slice/index.js","node_modules/backo2/index.js","node_modules/base64-arraybuffer/lib/base64-arraybuffer.js","node_modules/blob/index.js","node_modules/component-bind/index.js","node_modules/component-emitter/index.js","node_modules/component-inherit/index.js","node_modules/debug/browser.js","node_modules/debug/debug.js","node_modules/engine.io-client/index.js","node_modules/engine.io-client/lib/index.js","node_modules/engine.io-client/lib/socket.js","node_modules/engine.io-client/lib/transport.js","node_modules/engine.io-client/lib/transports/index.js","node_modules/engine.io-client/lib/transports/polling-jsonp.js","node_modules/engine.io-client/lib/transports/polling-xhr.js","node_modules/engine.io-client/lib/transports/polling.js","node_modules/engine.io-client/lib/transports/websocket.js","node_modules/engine.io-client/lib/xmlhttprequest.js","node_modules/engine.io-client/node_modules/component-emitter/index.js","node_modules/engine.io-parser/lib/browser.js","node_modules/engine.io-parser/lib/keys.js","node_modules/engine.io-parser/node_modules/has-binary/index.js","node_modules/has-binary/index.js","node_modules/has-cors/index.js","node_modules/indexof/index.js","node_modules/isarray/index.js","node_modules/json3/lib/json3.js","node_modules/ms/index.js","node_modules/parsejson/index.js","node_modules/parseqs/index.js","node_modules/parseuri/index.js","node_modules/socket.io-client/lib/index.js","node_modules/socket.io-client/lib/manager.js","node_modules/socket.io-client/lib/on.js","node_modules/socket.io-client/lib/socket.js","node_modules/socket.io-client/lib/url.js","node_modules/socket.io-parser/binary.js","node_modules/socket.io-parser/index.js","node_modules/socket.io-parser/is-buffer.js","node_modules/to-array/index.js","node_modules/utf8/utf8.js","node_modules/yeast/index.js","src/src/Websockets-client.js"],"names":["e","t","n","r","s","o","u","a","require","i","f","Error","code","l","exports","call","length",1,"module","after","count","callback","err_cb","proxy","err","result","bail","noop",2,"arraybuffer","start","end","bytes","byteLength","slice","ArrayBuffer","abv","Uint8Array","ii","buffer",3,"Backoff","opts","this","ms","min","max","factor","jitter","attempts","prototype","duration","Math","pow","rand","random","deviation","floor","reset","setMin","setMax","setJitter",4,"chars","encode","len","base64","substring","decode","encoded1","encoded2","encoded3","encoded4","bufferLength","p","indexOf",5,"global","mapArrayBufferViews","ary","chunk","buf","copy","set","byteOffset","BlobBuilderConstructor","options","bb","BlobBuilder","append","getBlob","type","BlobConstructor","Blob","WebKitBlobBuilder","MSBlobBuilder","MozBlobBuilder","blobSupported","size","blobSupportsArrayBufferView","b","blobBuilderSupported","self","window",6,"obj","fn","args","arguments","apply","concat",7,"Emitter","mixin","key","on","addEventListener","event","_callbacks","push","once","off","removeListener","removeAllListeners","removeEventListener","callbacks","cb","splice","emit","listeners","hasListeners",8,"constructor",9,"useColors","document","documentElement","style","console","firebug","exception","table","navigator","userAgent","toLowerCase","match","parseInt","RegExp","$1","formatArgs","namespace","humanize","diff","c","color","Array","index","lastC","replace","log","Function","save","namespaces","storage","removeItem","debug","load","localstorage","localStorage","chrome","local","colors","formatters","j","v","JSON","stringify","enable","./debug",10,"selectColor","prevColor","disabled","enabled","curr","Date","prevTime","prev","coerce","format","formatter","val","logFn","bind","split","skips","substr","names","disable","name","test","stack","message",11,"./lib/",12,"parser","./socket","engine.io-parser",13,"Socket","uri","parseuri","hostname","host","secure","protocol","port","query","location","agent","parseqs","upgrade","path","forceJSONP","jsonp","forceBase64","enablesXDR","timestampParam","timestampRequests","transports","readyState","writeBuffer","policyPort","rememberUpgrade","binaryType","onlyBinaryUpgrades","perMessageDeflate","threshold","pfx","passphrase","cert","ca","ciphers","rejectUnauthorized","undefined","freeGlobal","extraHeaders","Object","keys","open","clone","hasOwnProperty","parsejson","priorWebsocketSuccess","Transport","createTransport","EIO","transport","id","sid","socket","setTimeout","shift","setTransport","onDrain","packet","onPacket","onError","onClose","probe","onTransportOpen","upgradeLosesBinary","supportsBinary","failed","send","data","msg","upgrading","pause","cleanup","flush","freezeTransport","close","onerror","error","onTransportClose","onclose","onupgrade","to","onOpen","upgrades","onHandshake","setPing","filterUpgrades","pingInterval","pingTimeout","onHeartbeat","timeout","clearTimeout","pingTimeoutTimer","pingIntervalTimer","ping","sendPacket","prevBufferLen","writable","write","compress","cleanupAndClose","waitForUpgrade","reason","desc","filteredUpgrades","./transport","./transports","component-emitter","indexof",14,"description","doOpen","doClose","packets","onData","decodePacket",15,"polling","xhr","xd","xs","isSSL","xdomain","xscheme","XMLHttpRequest","XHR","JSONP","websocket","./polling-jsonp","./polling-xhr","./websocket","xmlhttprequest-ssl",16,"empty","JSONPPolling","Polling","___eio","script","inherit","rNewline","rEscapedNewline","parentNode","removeChild","form","iframe","doPoll","createElement","async","src","insertAt","getElementsByTagName","insertBefore","head","body","appendChild","isUAgecko","doWrite","complete","initIframe","html","iframeId","area","className","position","top","left","target","method","setAttribute","action","value","submit","attachEvent","onreadystatechange","onload","./polling","component-inherit",17,"Request","isBinary","create","unloadHandler","requests","abort","request","req","sendXhr","pollXhr","setDisableHeaderCheck","setRequestHeader","responseType","withCredentials","hasXDR","onLoad","responseText","status","requestsCount","onSuccess","fromError","contentType","getResponseHeader","response","String","fromCharCode","ui8Arr","dataArray","idx","XDomainRequest",18,"hasXHR2","yeast","poll","onPause","total","decodePayload","callbackfn","encodePayload","schema","b64","ipv6","../transport",19,"WS","BrowserWebSocket","WebSocket","MozWebSocket","check","protocols","headers","ws","supports","binary","addEventListeners","onopen","onmessage","ev","done","encodePacket","Buffer",20,"hasCORS","ActiveXObject","has-cors",21,22,"encodeBase64Object","encodeArrayBuffer","encodeBase64Packet","contentArray","resultBuffer","encodeBlobAsArrayBuffer","fr","FileReader","readAsArrayBuffer","encodeBlob","dontSendBlobs","blob","map","each","next","eachWithIndex","el","hasBinary","sliceBuffer","base64encoder","utf8","isAndroid","isPhantomJS","pong","packetslist","utf8encode","encoded","readAsDataURL","b64data","typed","basic","btoa","utf8decode","charAt","decodeBase64Packet","Number","asArray","rest","setLengthHeader","encodeOne","doneCallback","encodePayloadAsBlob","encodePayloadAsArrayBuffer","results","join","decodePayloadAsBinary","chr","ret","encodedPackets","totalLength","reduce","acc","toString","resultArray","bufferIndex","forEach","isString","ab","view","charCodeAt","lenStr","binaryIdentifier","lengthAry","bufferTail","buffers","numberTooLong","tailArray","msgLength","./keys","arraybuffer.slice","base64-arraybuffer","has-binary",23,"arr","has",24,"_hasBinary","isBuffer","File","isArray","toJSON","isarray",25,26,27,28,29,"runInContext","context","undef","isSupported","serialized","stringifySupported","isExtended","getClass","parse","parseSupported","root","SyntaxError","TypeError","nativeJSON","isProperty","objectProto","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","functionClass","dateClass","numberClass","stringClass","arrayClass","booleanClass","charIndexBuggy","Months","getDay","year","month","property","members","__proto__","original","parent","object","Properties","valueOf","isFunction","isConstructor","hasProperty","objectTypes","Escapes",92,34,"leadingZeroes","toPaddedString","width","unicodePrefix","quote","useCharIndex","symbols","charCode","serialize","properties","whitespace","indentation","date","time","hours","minutes","seconds","milliseconds","element","prefix","pop","source","filter","Index","Source","Unescapes",47,98,116,110,102,114,"lex","begin","isSigned","get","hasMembers","update","walk","isLoader","define","amd","function","freeExports","nodeType","previousJSON","isRestored","JSON3","noConflict",30,"str","exec","parseFloat","y","d","h","m","short","round","long","plural","ceil",31,"rvalidchars","rvalidescape","rvalidtokens","rvalidbraces","rtrimLeft","rtrimRight",32,"encodeURIComponent","qs","qry","pairs","pair","decodeURIComponent",33,"re","parts","authority","ipv6uri","lookup","io","parsed","url","sameNamespace","cache","nsps","newConnection","forceNew","multiplex","Manager","managers","connect","./manager","./url","socket.io-parser",35,"subs","reconnection","reconnectionAttempts","Infinity","reconnectionDelay","reconnectionDelayMax","randomizationFactor","backoff","connecting","lastPing","encoding","packetBuffer","encoder","Encoder","decoder","Decoder","autoConnect","eio","emitAll","nsp","updateSocketIds","engine","_reconnection","_reconnectionAttempts","_reconnectionDelay","_randomizationFactor","_reconnectionDelayMax","_timeout","maybeReconnectOnOpen","reconnecting","reconnect","skipReconnect","openSub","errorSub","timer","destroy","onping","onpong","ondata","add","ondecoded","onConnecting","processPacketQueue","pack","sub","disconnect","delay","onreconnect","attempt","./on","backo2","component-bind","engine.io-client",36,37,"json","ids","acks","receiveBuffer","sendBuffer","connected","disconnected","toArray","hasBin","events","connect_error","connect_timeout","reconnect_attempt","reconnect_failed","reconnect_error","subEvents","unshift","parserType","EVENT","BINARY_EVENT","flags","CONNECT","onpacket","onconnect","onevent","ACK","onack","BINARY_ACK","DISCONNECT","ondisconnect","ERROR","ack","sent","emitBuffered","to-array",38,"loc","href",39,"isBuf","deconstructPacket","_deconstructPacket","placeholder","_placeholder","num","newData","packetData","attachments","reconstructPacket","_reconstructPacket","removeBlobs","_removeBlobs","curKey","containingObject","pendingBlobs","fileReader","bloblessData","./is-buffer",40,"encodeAsString","encodeAsBinary","writeEncoding","deconstruction","reconstructor","decodeString","types","BinaryReconstructor","reconPack","takeBinaryData","finishedReconstruction","binData","./binary","json3",41,42,"dup",43,"list","array",44,"ucs2decode","string","extra","output","counter","ucs2encode","stringFromCharCode","checkScalarValue","codePoint","toUpperCase","createByte","encodeCodePoint","symbol","codePoints","byteString","readContinuationByte","byteIndex","byteCount","continuationByte","byteArray","decodeSymbol","byte1","byte2","byte3","byte4","tmp","freeModule","version",45,"alphabet","decoded","now","seed",46,"_classCallCheck","instance","Constructor","_possibleConstructorReturn","ReferenceError","_inherits","subClass","superClass","enumerable","configurable","setPrototypeOf","extend","Y","Connector","_Y$AbstractConnector","joinRoom","room","userJoined","setUserId","receiveMessage","peer","userLeft","role","_this","getPrototypeOf","_createClass","_get","uid","AbstractConnector","defineProperties","props","descriptor","defineProperty","protoProps","staticProps","receiver","getOwnPropertyDescriptor","getter","socket.io-client"],"mappings":"CAAA,QAAAA,GAAAC,EAAAC,EAAAC,GAAA,QAAAC,GAAAC,EAAAC,GAAA,IAAAJ,EAAAG,GAAA,CAAA,IAAAJ,EAAAI,GAAA,CAAA,GAAAE,GAAA,kBAAAC,U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6T,GAAoB,GAAI,SAAWpkB,GAAQ,MAAOA,GAAKmE,KAAgB,IAAImgB,GAAStkB,EAAKyT,GAAK,IAAe3X,SAAXwoB,EAA4C,MAAOA,GAAO92B,KAAK42B,I4CrlOxdtQ,EAASxiB,EAAOwiB,MACpBxiB,GAAOwiB,OAAS,IAChB,IAAI0C,GAAKvpB,EAAQ,mBAAmBqE,GAE7BwiB,OAASA,EAoEhBnmB,EAAOJ,QAAUq1B,EACA,mBAANC,IACTD,EAAOC,K5CsnONr1B,KAAK4B,KAAuB,mBAAXkC,QAAyBA,OAAyB,mBAATyB,MAAuBA,KAAyB,mBAAXC,QAAyBA,aAExHuxB,mBAAmB,KAAKvR,IAAI,SAAS/lB,EAAQU,EAAOJ,cAE5C","file":"y-websockets-client.js","sourcesContent":["(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})","module.exports = after\n\nfunction after(count, callback, err_cb) {\n var bail = false\n err_cb = err_cb || noop\n proxy.count = count\n\n return (count === 0) ? callback() : proxy\n\n function proxy(err, result) {\n if (proxy.count <= 0) {\n throw new Error('after called too many times')\n }\n --proxy.count\n\n // after first error, rest are passed to err_cb\n if (err) {\n bail = true\n callback(err)\n // future error callbacks will go to error handler\n callback = err_cb\n } else if (proxy.count === 0 && !bail) {\n callback(null, result)\n }\n }\n}\n\nfunction noop() {}\n","(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){\nmodule.exports = after\n\nfunction after(count, callback, err_cb) {\n var bail = false\n err_cb = err_cb || noop\n proxy.count = count\n\n return (count === 0) ? callback() : proxy\n\n function proxy(err, result) {\n if (proxy.count <= 0) {\n throw new Error('after called too many times')\n }\n --proxy.count\n\n // after first error, rest are passed to err_cb\n if (err) {\n bail = true\n callback(err)\n // future error callbacks will go to error handler\n callback = err_cb\n } else if (proxy.count === 0 && !bail) {\n callback(null, result)\n }\n }\n}\n\nfunction noop() {}\n\n},{}],2:[function(require,module,exports){\n/**\n * An abstraction for slicing an arraybuffer even when\n * ArrayBuffer.prototype.slice is not supported\n *\n * @api public\n */\n\nmodule.exports = function(arraybuffer, start, end) {\n var bytes = arraybuffer.byteLength;\n start = start || 0;\n end = end || bytes;\n\n if (arraybuffer.slice) { return arraybuffer.slice(start, end); }\n\n if (start < 0) { start += bytes; }\n if (end < 0) { end += bytes; }\n if (end > bytes) { end = bytes; }\n\n if (start >= bytes || start >= end || bytes === 0) {\n return new ArrayBuffer(0);\n }\n\n var abv = new Uint8Array(arraybuffer);\n var result = new Uint8Array(end - start);\n for (var i = start, ii = 0; i < end; i++, ii++) {\n result[ii] = abv[i];\n }\n return result.buffer;\n};\n\n},{}],3:[function(require,module,exports){\n\n/**\n * Expose `Backoff`.\n */\n\nmodule.exports = Backoff;\n\n/**\n * Initialize backoff timer with `opts`.\n *\n * - `min` initial timeout in milliseconds [100]\n * - `max` max timeout [10000]\n * - `jitter` [0]\n * - `factor` [2]\n *\n * @param {Object} opts\n * @api public\n */\n\nfunction Backoff(opts) {\n opts = opts || {};\n this.ms = opts.min || 100;\n this.max = opts.max || 10000;\n this.factor = opts.factor || 2;\n this.jitter = opts.jitter > 0 && opts.jitter <= 1 ? opts.jitter : 0;\n this.attempts = 0;\n}\n\n/**\n * Return the backoff duration.\n *\n * @return {Number}\n * @api public\n */\n\nBackoff.prototype.duration = function(){\n var ms = this.ms * Math.pow(this.factor, this.attempts++);\n if (this.jitter) {\n var rand = Math.random();\n var deviation = Math.floor(rand * this.jitter * ms);\n ms = (Math.floor(rand * 10) & 1) == 0 ? ms - deviation : ms + deviation;\n }\n return Math.min(ms, this.max) | 0;\n};\n\n/**\n * Reset the number of attempts.\n *\n * @api public\n */\n\nBackoff.prototype.reset = function(){\n this.attempts = 0;\n};\n\n/**\n * Set the minimum duration\n *\n * @api public\n */\n\nBackoff.prototype.setMin = function(min){\n this.ms = min;\n};\n\n/**\n * Set the maximum duration\n *\n * @api public\n */\n\nBackoff.prototype.setMax = function(max){\n this.max = max;\n};\n\n/**\n * Set the jitter\n *\n * @api public\n */\n\nBackoff.prototype.setJitter = function(jitter){\n this.jitter = jitter;\n};\n\n\n},{}],4:[function(require,module,exports){\n/*\n * base64-arraybuffer\n * https://github.com/niklasvh/base64-arraybuffer\n *\n * Copyright (c) 2012 Niklas von Hertzen\n * Licensed under the MIT license.\n */\n(function(chars){\n \"use strict\";\n\n exports.encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer),\n i, len = bytes.length, base64 = \"\";\n\n for (i = 0; i < len; i+=3) {\n base64 += chars[bytes[i] >> 2];\n base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\n base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\n base64 += chars[bytes[i + 2] & 63];\n }\n\n if ((len % 3) === 2) {\n base64 = base64.substring(0, base64.length - 1) + \"=\";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + \"==\";\n }\n\n return base64;\n };\n\n exports.decode = function(base64) {\n var bufferLength = base64.length * 0.75,\n len = base64.length, i, p = 0,\n encoded1, encoded2, encoded3, encoded4;\n\n if (base64[base64.length - 1] === \"=\") {\n bufferLength--;\n if (base64[base64.length - 2] === \"=\") {\n bufferLength--;\n }\n }\n\n var arraybuffer = new ArrayBuffer(bufferLength),\n bytes = new Uint8Array(arraybuffer);\n\n for (i = 0; i < len; i+=4) {\n encoded1 = chars.indexOf(base64[i]);\n encoded2 = chars.indexOf(base64[i+1]);\n encoded3 = chars.indexOf(base64[i+2]);\n encoded4 = chars.indexOf(base64[i+3]);\n\n bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n }\n\n return arraybuffer;\n };\n})(\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\");\n\n},{}],5:[function(require,module,exports){\n(function (global){\n/**\n * Create a blob builder even when vendor prefixes exist\n */\n\nvar BlobBuilder = global.BlobBuilder\n || global.WebKitBlobBuilder\n || global.MSBlobBuilder\n || global.MozBlobBuilder;\n\n/**\n * Check if Blob constructor is supported\n */\n\nvar blobSupported = (function() {\n try {\n var a = new Blob(['hi']);\n return a.size === 2;\n } catch(e) {\n return false;\n }\n})();\n\n/**\n * Check if Blob constructor supports ArrayBufferViews\n * Fails in Safari 6, so we need to map to ArrayBuffers there.\n */\n\nvar blobSupportsArrayBufferView = blobSupported && (function() {\n try {\n var b = new Blob([new Uint8Array([1,2])]);\n return b.size === 2;\n } catch(e) {\n return false;\n }\n})();\n\n/**\n * Check if BlobBuilder is supported\n */\n\nvar blobBuilderSupported = BlobBuilder\n && BlobBuilder.prototype.append\n && BlobBuilder.prototype.getBlob;\n\n/**\n * Helper function that maps ArrayBufferViews to ArrayBuffers\n * Used by BlobBuilder constructor and old browsers that didn't\n * support it in the Blob constructor.\n */\n\nfunction mapArrayBufferViews(ary) {\n for (var i = 0; i < ary.length; i++) {\n var chunk = ary[i];\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n\n ary[i] = buf;\n }\n }\n}\n\nfunction BlobBuilderConstructor(ary, options) {\n options = options || {};\n\n var bb = new BlobBuilder();\n mapArrayBufferViews(ary);\n\n for (var i = 0; i < ary.length; i++) {\n bb.append(ary[i]);\n }\n\n return (options.type) ? bb.getBlob(options.type) : bb.getBlob();\n};\n\nfunction BlobConstructor(ary, options) {\n mapArrayBufferViews(ary);\n return new Blob(ary, options || {});\n};\n\nmodule.exports = (function() {\n if (blobSupported) {\n return blobSupportsArrayBufferView ? global.Blob : BlobConstructor;\n } else if (blobBuilderSupported) {\n return BlobBuilderConstructor;\n } else {\n return undefined;\n }\n})();\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n\n},{}],6:[function(require,module,exports){\n/**\n * Slice reference.\n */\n\nvar slice = [].slice;\n\n/**\n * Bind `obj` to `fn`.\n *\n * @param {Object} obj\n * @param {Function|String} fn or string\n * @return {Function}\n * @api public\n */\n\nmodule.exports = function(obj, fn){\n if ('string' == typeof fn) fn = obj[fn];\n if ('function' != typeof fn) throw new Error('bind() requires a function');\n var args = slice.call(arguments, 2);\n return function(){\n return fn.apply(obj, args.concat(slice.call(arguments)));\n }\n};\n\n},{}],7:[function(require,module,exports){\n\n/**\n * Expose `Emitter`.\n */\n\nmodule.exports = Emitter;\n\n/**\n * Initialize a new `Emitter`.\n *\n * @api public\n */\n\nfunction Emitter(obj) {\n if (obj) return mixin(obj);\n};\n\n/**\n * Mixin the emitter properties.\n *\n * @param {Object} obj\n * @return {Object}\n * @api private\n */\n\nfunction mixin(obj) {\n for (var key in Emitter.prototype) {\n obj[key] = Emitter.prototype[key];\n }\n return obj;\n}\n\n/**\n * Listen on the given `event` with `fn`.\n *\n * @param {String} event\n * @param {Function} fn\n * @return {Emitter}\n * @api public\n */\n\nEmitter.prototype.on =\nEmitter.prototype.addEventListener = function(event, fn){\n this._callbacks = this._callbacks || {};\n (this._callbacks['$' + event] = this._callbacks['$' + event] || [])\n .push(fn);\n return this;\n};\n\n/**\n * Adds an `event` listener that will be invoked a single\n * time then automatically removed.\n *\n * @param {String} event\n * @param {Function} fn\n * @return {Emitter}\n * @api public\n */\n\nEmitter.prototype.once = function(event, fn){\n function on() {\n this.off(event, on);\n fn.apply(this, arguments);\n }\n\n on.fn = fn;\n this.on(event, on);\n return this;\n};\n\n/**\n * Remove the given callback for `event` or all\n * registered callbacks.\n *\n * @param {String} event\n * @param {Function} fn\n * @return {Emitter}\n * @api public\n */\n\nEmitter.prototype.off =\nEmitter.prototype.removeListener =\nEmitter.prototype.removeAllListeners =\nEmitter.prototype.removeEventListener = function(event, fn){\n this._callbacks = this._callbacks || {};\n\n // all\n if (0 == arguments.length) {\n this._callbacks = {};\n return this;\n }\n\n // specific event\n var callbacks = this._callbacks['$' + event];\n if (!callbacks) return this;\n\n // remove all handlers\n if (1 == arguments.length) {\n delete this._callbacks['$' + event];\n return this;\n }\n\n // remove specific handler\n var cb;\n for (var i = 0; i < callbacks.length; i++) {\n cb = callbacks[i];\n if (cb === fn || cb.fn === fn) {\n callbacks.splice(i, 1);\n break;\n }\n }\n return this;\n};\n\n/**\n * Emit `event` with the given args.\n *\n * @param {String} event\n * @param {Mixed} ...\n * @return {Emitter}\n */\n\nEmitter.prototype.emit = function(event){\n this._callbacks = this._callbacks || {};\n var args = [].slice.call(arguments, 1)\n , callbacks = this._callbacks['$' + event];\n\n if (callbacks) {\n callbacks = callbacks.slice(0);\n for (var i = 0, len = callbacks.length; i < len; ++i) {\n callbacks[i].apply(this, args);\n }\n }\n\n return this;\n};\n\n/**\n * Return array of callbacks for `event`.\n *\n * @param {String} event\n * @return {Array}\n * @api public\n */\n\nEmitter.prototype.listeners = function(event){\n this._callbacks = this._callbacks || {};\n return this._callbacks['$' + event] || [];\n};\n\n/**\n * Check if this emitter has `event` handlers.\n *\n * @param {String} event\n * @return {Boolean}\n * @api public\n */\n\nEmitter.prototype.hasListeners = function(event){\n return !! this.listeners(event).length;\n};\n\n},{}],8:[function(require,module,exports){\n\nmodule.exports = function(a, b){\n var fn = function(){};\n fn.prototype = b.prototype;\n a.prototype = new fn;\n a.prototype.constructor = a;\n};\n},{}],9:[function(require,module,exports){\n\n/**\n * This is the web browser implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = require('./debug');\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = 'undefined' != typeof chrome\n && 'undefined' != typeof chrome.storage\n ? chrome.storage.local\n : localstorage();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n 'lightseagreen',\n 'forestgreen',\n 'goldenrod',\n 'dodgerblue',\n 'darkorchid',\n 'crimson'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\nfunction useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nexports.formatters.j = function(v) {\n return JSON.stringify(v);\n};\n\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}\n\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\nfunction log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n try {\n if (null == namespaces) {\n exports.storage.removeItem('debug');\n } else {\n exports.storage.debug = namespaces;\n }\n } catch(e) {}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n var r;\n try {\n r = exports.storage.debug;\n } catch(e) {}\n return r;\n}\n\n/**\n * Enable namespaces listed in `localStorage.debug` initially.\n */\n\nexports.enable(load());\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage(){\n try {\n return window.localStorage;\n } catch (e) {}\n}\n\n},{\"./debug\":10}],10:[function(require,module,exports){\n\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = debug;\nexports.coerce = coerce;\nexports.disable = disable;\nexports.enable = enable;\nexports.enabled = enabled;\nexports.humanize = require('ms');\n\n/**\n * The currently active debug mode names, and names to skip.\n */\n\nexports.names = [];\nexports.skips = [];\n\n/**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lowercased letter, i.e. \"n\".\n */\n\nexports.formatters = {};\n\n/**\n * Previously assigned color.\n */\n\nvar prevColor = 0;\n\n/**\n * Previous log timestamp.\n */\n\nvar prevTime;\n\n/**\n * Select a color.\n *\n * @return {Number}\n * @api private\n */\n\nfunction selectColor() {\n return exports.colors[prevColor++ % exports.colors.length];\n}\n\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\nfunction debug(namespace) {\n\n // define the `disabled` version\n function disabled() {\n }\n disabled.enabled = false;\n\n // define the `enabled` version\n function enabled() {\n\n var self = enabled;\n\n // set `diff` timestamp\n var curr = +new Date();\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n\n // add the `color` if not set\n if (null == self.useColors) self.useColors = exports.useColors();\n if (null == self.color && self.useColors) self.color = selectColor();\n\n var args = Array.prototype.slice.call(arguments);\n\n args[0] = exports.coerce(args[0]);\n\n if ('string' !== typeof args[0]) {\n // anything else let's inspect with %o\n args = ['%o'].concat(args);\n }\n\n // apply any `formatters` transformations\n var index = 0;\n args[0] = args[0].replace(/%([a-z%])/g, function(match, format) {\n // if we encounter an escaped % then don't increase the array index\n if (match === '%%') return match;\n index++;\n var formatter = exports.formatters[format];\n if ('function' === typeof formatter) {\n var val = args[index];\n match = formatter.call(self, val);\n\n // now we need to remove `args[index]` since it's inlined in the `format`\n args.splice(index, 1);\n index--;\n }\n return match;\n });\n\n if ('function' === typeof exports.formatArgs) {\n args = exports.formatArgs.apply(self, args);\n }\n var logFn = enabled.log || exports.log || console.log.bind(console);\n logFn.apply(self, args);\n }\n enabled.enabled = true;\n\n var fn = exports.enabled(namespace) ? enabled : disabled;\n\n fn.namespace = namespace;\n\n return fn;\n}\n\n/**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\nfunction enable(namespaces) {\n exports.save(namespaces);\n\n var split = (namespaces || '').split(/[\\s,]+/);\n var len = split.length;\n\n for (var i = 0; i < len; i++) {\n if (!split[i]) continue; // ignore empty strings\n namespaces = split[i].replace(/\\*/g, '.*?');\n if (namespaces[0] === '-') {\n exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n exports.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n}\n\n/**\n * Disable debug output.\n *\n * @api public\n */\n\nfunction disable() {\n exports.enable('');\n}\n\n/**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\nfunction enabled(name) {\n var i, len;\n for (i = 0, len = exports.skips.length; i < len; i++) {\n if (exports.skips[i].test(name)) {\n return false;\n }\n }\n for (i = 0, len = exports.names.length; i < len; i++) {\n if (exports.names[i].test(name)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\nfunction coerce(val) {\n if (val instanceof Error) return val.stack || val.message;\n return val;\n}\n\n},{\"ms\":30}],11:[function(require,module,exports){\n\nmodule.exports = require('./lib/');\n\n},{\"./lib/\":12}],12:[function(require,module,exports){\n\nmodule.exports = require('./socket');\n\n/**\n * Exports parser\n *\n * @api public\n *\n */\nmodule.exports.parser = require('engine.io-parser');\n\n},{\"./socket\":13,\"engine.io-parser\":22}],13:[function(require,module,exports){\n(function (global){\n/**\n * Module dependencies.\n */\n\nvar transports = require('./transports');\nvar Emitter = require('component-emitter');\nvar debug = require('debug')('engine.io-client:socket');\nvar index = require('indexof');\nvar parser = require('engine.io-parser');\nvar parseuri = require('parseuri');\nvar parsejson = require('parsejson');\nvar parseqs = require('parseqs');\n\n/**\n * Module exports.\n */\n\nmodule.exports = Socket;\n\n/**\n * Noop function.\n *\n * @api private\n */\n\nfunction noop(){}\n\n/**\n * Socket constructor.\n *\n * @param {String|Object} uri or options\n * @param {Object} options\n * @api public\n */\n\nfunction Socket(uri, opts){\n if (!(this instanceof Socket)) return new Socket(uri, opts);\n\n opts = opts || {};\n\n if (uri && 'object' == typeof uri) {\n opts = uri;\n uri = null;\n }\n\n if (uri) {\n uri = parseuri(uri);\n opts.hostname = uri.host;\n opts.secure = uri.protocol == 'https' || uri.protocol == 'wss';\n opts.port = uri.port;\n if (uri.query) opts.query = uri.query;\n } else if (opts.host) {\n opts.hostname = parseuri(opts.host).host;\n }\n\n this.secure = null != opts.secure ? opts.secure :\n (global.location && 'https:' == location.protocol);\n\n if (opts.hostname && !opts.port) {\n // if no port is specified manually, use the protocol default\n opts.port = this.secure ? '443' : '80';\n }\n\n this.agent = opts.agent || false;\n this.hostname = opts.hostname ||\n (global.location ? location.hostname : 'localhost');\n this.port = opts.port || (global.location && location.port ?\n location.port :\n (this.secure ? 443 : 80));\n this.query = opts.query || {};\n if ('string' == typeof this.query) this.query = parseqs.decode(this.query);\n this.upgrade = false !== opts.upgrade;\n this.path = (opts.path || '/engine.io').replace(/\\/$/, '') + '/';\n this.forceJSONP = !!opts.forceJSONP;\n this.jsonp = false !== opts.jsonp;\n this.forceBase64 = !!opts.forceBase64;\n this.enablesXDR = !!opts.enablesXDR;\n this.timestampParam = opts.timestampParam || 't';\n this.timestampRequests = opts.timestampRequests;\n this.transports = opts.transports || ['polling', 'websocket'];\n this.readyState = '';\n this.writeBuffer = [];\n this.policyPort = opts.policyPort || 843;\n this.rememberUpgrade = opts.rememberUpgrade || false;\n this.binaryType = null;\n this.onlyBinaryUpgrades = opts.onlyBinaryUpgrades;\n this.perMessageDeflate = false !== opts.perMessageDeflate ? (opts.perMessageDeflate || {}) : false;\n\n if (true === this.perMessageDeflate) this.perMessageDeflate = {};\n if (this.perMessageDeflate && null == this.perMessageDeflate.threshold) {\n this.perMessageDeflate.threshold = 1024;\n }\n\n // SSL options for Node.js client\n this.pfx = opts.pfx || null;\n this.key = opts.key || null;\n this.passphrase = opts.passphrase || null;\n this.cert = opts.cert || null;\n this.ca = opts.ca || null;\n this.ciphers = opts.ciphers || null;\n this.rejectUnauthorized = opts.rejectUnauthorized === undefined ? null : opts.rejectUnauthorized;\n\n // other options for Node.js client\n var freeGlobal = typeof global == 'object' && global;\n if (freeGlobal.global === freeGlobal) {\n if (opts.extraHeaders && Object.keys(opts.extraHeaders).length > 0) {\n this.extraHeaders = opts.extraHeaders;\n }\n }\n\n this.open();\n}\n\nSocket.priorWebsocketSuccess = false;\n\n/**\n * Mix in `Emitter`.\n */\n\nEmitter(Socket.prototype);\n\n/**\n * Protocol version.\n *\n * @api public\n */\n\nSocket.protocol = parser.protocol; // this is an int\n\n/**\n * Expose deps for legacy compatibility\n * and standalone browser access.\n */\n\nSocket.Socket = Socket;\nSocket.Transport = require('./transport');\nSocket.transports = require('./transports');\nSocket.parser = require('engine.io-parser');\n\n/**\n * Creates transport of the given type.\n *\n * @param {String} transport name\n * @return {Transport}\n * @api private\n */\n\nSocket.prototype.createTransport = function (name) {\n debug('creating transport \"%s\"', name);\n var query = clone(this.query);\n\n // append engine.io protocol identifier\n query.EIO = parser.protocol;\n\n // transport name\n query.transport = name;\n\n // session id if we already have one\n if (this.id) query.sid = this.id;\n\n var transport = new transports[name]({\n agent: this.agent,\n hostname: this.hostname,\n port: this.port,\n secure: this.secure,\n path: this.path,\n query: query,\n forceJSONP: this.forceJSONP,\n jsonp: this.jsonp,\n forceBase64: this.forceBase64,\n enablesXDR: this.enablesXDR,\n timestampRequests: this.timestampRequests,\n timestampParam: this.timestampParam,\n policyPort: this.policyPort,\n socket: this,\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 perMessageDeflate: this.perMessageDeflate,\n extraHeaders: this.extraHeaders\n });\n\n return transport;\n};\n\nfunction clone (obj) {\n var o = {};\n for (var i in obj) {\n if (obj.hasOwnProperty(i)) {\n o[i] = obj[i];\n }\n }\n return o;\n}\n\n/**\n * Initializes transport to use and starts probe.\n *\n * @api private\n */\nSocket.prototype.open = function () {\n var transport;\n if (this.rememberUpgrade && Socket.priorWebsocketSuccess && this.transports.indexOf('websocket') != -1) {\n transport = 'websocket';\n } else if (0 === this.transports.length) {\n // Emit error on next tick so it can be listened to\n var self = this;\n setTimeout(function() {\n self.emit('error', 'No transports available');\n }, 0);\n return;\n } else {\n transport = this.transports[0];\n }\n this.readyState = 'opening';\n\n // Retry with the next transport if the transport is disabled (jsonp: false)\n try {\n transport = this.createTransport(transport);\n } catch (e) {\n this.transports.shift();\n this.open();\n return;\n }\n\n transport.open();\n this.setTransport(transport);\n};\n\n/**\n * Sets the current transport. Disables the existing one (if any).\n *\n * @api private\n */\n\nSocket.prototype.setTransport = function(transport){\n debug('setting transport %s', transport.name);\n var self = this;\n\n if (this.transport) {\n debug('clearing existing transport %s', this.transport.name);\n this.transport.removeAllListeners();\n }\n\n // set up transport\n this.transport = transport;\n\n // set up transport listeners\n transport\n .on('drain', function(){\n self.onDrain();\n })\n .on('packet', function(packet){\n self.onPacket(packet);\n })\n .on('error', function(e){\n self.onError(e);\n })\n .on('close', function(){\n self.onClose('transport close');\n });\n};\n\n/**\n * Probes a transport.\n *\n * @param {String} transport name\n * @api private\n */\n\nSocket.prototype.probe = function (name) {\n debug('probing transport \"%s\"', name);\n var transport = this.createTransport(name, { probe: 1 })\n , failed = false\n , self = this;\n\n Socket.priorWebsocketSuccess = false;\n\n function onTransportOpen(){\n if (self.onlyBinaryUpgrades) {\n var upgradeLosesBinary = !this.supportsBinary && self.transport.supportsBinary;\n failed = failed || upgradeLosesBinary;\n }\n if (failed) return;\n\n debug('probe transport \"%s\" opened', name);\n transport.send([{ type: 'ping', data: 'probe' }]);\n transport.once('packet', function (msg) {\n if (failed) return;\n if ('pong' == msg.type && 'probe' == msg.data) {\n debug('probe transport \"%s\" pong', name);\n self.upgrading = true;\n self.emit('upgrading', transport);\n if (!transport) return;\n Socket.priorWebsocketSuccess = 'websocket' == transport.name;\n\n debug('pausing current transport \"%s\"', self.transport.name);\n self.transport.pause(function () {\n if (failed) return;\n if ('closed' == self.readyState) return;\n debug('changing transport and sending upgrade packet');\n\n cleanup();\n\n self.setTransport(transport);\n transport.send([{ type: 'upgrade' }]);\n self.emit('upgrade', transport);\n transport = null;\n self.upgrading = false;\n self.flush();\n });\n } else {\n debug('probe transport \"%s\" failed', name);\n var err = new Error('probe error');\n err.transport = transport.name;\n self.emit('upgradeError', err);\n }\n });\n }\n\n function freezeTransport() {\n if (failed) return;\n\n // Any callback called by transport should be ignored since now\n failed = true;\n\n cleanup();\n\n transport.close();\n transport = null;\n }\n\n //Handle any error that happens while probing\n function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }\n\n function onTransportClose(){\n onerror(\"transport closed\");\n }\n\n //When the socket is closed while we're probing\n function onclose(){\n onerror(\"socket closed\");\n }\n\n //When the socket is upgraded while we're probing\n function onupgrade(to){\n if (transport && to.name != transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }\n\n //Remove all listeners on the transport and on self\n function cleanup(){\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }\n\n transport.once('open', onTransportOpen);\n transport.once('error', onerror);\n transport.once('close', onTransportClose);\n\n this.once('close', onclose);\n this.once('upgrading', onupgrade);\n\n transport.open();\n\n};\n\n/**\n * Called when connection is deemed open.\n *\n * @api public\n */\n\nSocket.prototype.onOpen = function () {\n debug('socket open');\n this.readyState = 'open';\n Socket.priorWebsocketSuccess = 'websocket' == this.transport.name;\n this.emit('open');\n this.flush();\n\n // we check for `readyState` in case an `open`\n // listener already closed the socket\n if ('open' == this.readyState && this.upgrade && this.transport.pause) {\n debug('starting upgrade probes');\n for (var i = 0, l = this.upgrades.length; i < l; i++) {\n this.probe(this.upgrades[i]);\n }\n }\n};\n\n/**\n * Handles a packet.\n *\n * @api private\n */\n\nSocket.prototype.onPacket = function (packet) {\n if ('opening' == this.readyState || 'open' == this.readyState) {\n debug('socket receive: type \"%s\", data \"%s\"', packet.type, packet.data);\n\n this.emit('packet', packet);\n\n // Socket is live - any packet counts\n this.emit('heartbeat');\n\n switch (packet.type) {\n case 'open':\n this.onHandshake(parsejson(packet.data));\n break;\n\n case 'pong':\n this.setPing();\n this.emit('pong');\n break;\n\n case 'error':\n var err = new Error('server error');\n err.code = packet.data;\n this.onError(err);\n break;\n\n case 'message':\n this.emit('data', packet.data);\n this.emit('message', packet.data);\n break;\n }\n } else {\n debug('packet received with socket readyState \"%s\"', this.readyState);\n }\n};\n\n/**\n * Called upon handshake completion.\n *\n * @param {Object} handshake obj\n * @api private\n */\n\nSocket.prototype.onHandshake = function (data) {\n this.emit('handshake', data);\n this.id = data.sid;\n this.transport.query.sid = data.sid;\n this.upgrades = this.filterUpgrades(data.upgrades);\n this.pingInterval = data.pingInterval;\n this.pingTimeout = data.pingTimeout;\n this.onOpen();\n // In case open handler closes socket\n if ('closed' == this.readyState) return;\n this.setPing();\n\n // Prolong liveness of socket on heartbeat\n this.removeListener('heartbeat', this.onHeartbeat);\n this.on('heartbeat', this.onHeartbeat);\n};\n\n/**\n * Resets ping timeout.\n *\n * @api private\n */\n\nSocket.prototype.onHeartbeat = function (timeout) {\n clearTimeout(this.pingTimeoutTimer);\n var self = this;\n self.pingTimeoutTimer = setTimeout(function () {\n if ('closed' == self.readyState) return;\n self.onClose('ping timeout');\n }, timeout || (self.pingInterval + self.pingTimeout));\n};\n\n/**\n * Pings server every `this.pingInterval` and expects response\n * within `this.pingTimeout` or closes connection.\n *\n * @api private\n */\n\nSocket.prototype.setPing = function () {\n var self = this;\n clearTimeout(self.pingIntervalTimer);\n self.pingIntervalTimer = setTimeout(function () {\n debug('writing ping packet - expecting pong within %sms', self.pingTimeout);\n self.ping();\n self.onHeartbeat(self.pingTimeout);\n }, self.pingInterval);\n};\n\n/**\n* Sends a ping packet.\n*\n* @api private\n*/\n\nSocket.prototype.ping = function () {\n var self = this;\n this.sendPacket('ping', function(){\n self.emit('ping');\n });\n};\n\n/**\n * Called on `drain` event\n *\n * @api private\n */\n\nSocket.prototype.onDrain = function() {\n this.writeBuffer.splice(0, this.prevBufferLen);\n\n // setting prevBufferLen = 0 is very important\n // for example, when upgrading, upgrade packet is sent over,\n // and a nonzero prevBufferLen could cause problems on `drain`\n this.prevBufferLen = 0;\n\n if (0 === this.writeBuffer.length) {\n this.emit('drain');\n } else {\n this.flush();\n }\n};\n\n/**\n * Flush write buffers.\n *\n * @api private\n */\n\nSocket.prototype.flush = function () {\n if ('closed' != this.readyState && this.transport.writable &&\n !this.upgrading && this.writeBuffer.length) {\n debug('flushing %d packets in socket', this.writeBuffer.length);\n this.transport.send(this.writeBuffer);\n // keep track of current length of writeBuffer\n // splice writeBuffer and callbackBuffer on `drain`\n this.prevBufferLen = this.writeBuffer.length;\n this.emit('flush');\n }\n};\n\n/**\n * Sends a message.\n *\n * @param {String} message.\n * @param {Function} callback function.\n * @param {Object} options.\n * @return {Socket} for chaining.\n * @api public\n */\n\nSocket.prototype.write =\nSocket.prototype.send = function (msg, options, fn) {\n this.sendPacket('message', msg, options, fn);\n return this;\n};\n\n/**\n * Sends a packet.\n *\n * @param {String} packet type.\n * @param {String} data.\n * @param {Object} options.\n * @param {Function} callback function.\n * @api private\n */\n\nSocket.prototype.sendPacket = function (type, data, options, fn) {\n if('function' == typeof data) {\n fn = data;\n data = undefined;\n }\n\n if ('function' == typeof options) {\n fn = options;\n options = null;\n }\n\n if ('closing' == this.readyState || 'closed' == this.readyState) {\n return;\n }\n\n options = options || {};\n options.compress = false !== options.compress;\n\n var packet = {\n type: type,\n data: data,\n options: options\n };\n this.emit('packetCreate', packet);\n this.writeBuffer.push(packet);\n if (fn) this.once('flush', fn);\n this.flush();\n};\n\n/**\n * Closes the connection.\n *\n * @api private\n */\n\nSocket.prototype.close = function () {\n if ('opening' == this.readyState || 'open' == this.readyState) {\n this.readyState = 'closing';\n\n var self = this;\n\n if (this.writeBuffer.length) {\n this.once('drain', function() {\n if (this.upgrading) {\n waitForUpgrade();\n } else {\n close();\n }\n });\n } else if (this.upgrading) {\n waitForUpgrade();\n } else {\n close();\n }\n }\n\n function close() {\n self.onClose('forced close');\n debug('socket closing - telling transport to close');\n self.transport.close();\n }\n\n function cleanupAndClose() {\n self.removeListener('upgrade', cleanupAndClose);\n self.removeListener('upgradeError', cleanupAndClose);\n close();\n }\n\n function waitForUpgrade() {\n // wait for upgrade to finish since we can't send packets while pausing a transport\n self.once('upgrade', cleanupAndClose);\n self.once('upgradeError', cleanupAndClose);\n }\n\n return this;\n};\n\n/**\n * Called upon transport error\n *\n * @api private\n */\n\nSocket.prototype.onError = function (err) {\n debug('socket error %j', err);\n Socket.priorWebsocketSuccess = false;\n this.emit('error', err);\n this.onClose('transport error', err);\n};\n\n/**\n * Called upon transport close.\n *\n * @api private\n */\n\nSocket.prototype.onClose = function (reason, desc) {\n if ('opening' == this.readyState || 'open' == this.readyState || 'closing' == this.readyState) {\n debug('socket close with reason: \"%s\"', reason);\n var self = this;\n\n // clear timers\n clearTimeout(this.pingIntervalTimer);\n clearTimeout(this.pingTimeoutTimer);\n\n // stop event from firing again for transport\n this.transport.removeAllListeners('close');\n\n // ensure transport won't stay open\n this.transport.close();\n\n // ignore further transport communication\n this.transport.removeAllListeners();\n\n // set ready state\n this.readyState = 'closed';\n\n // clear session id\n this.id = null;\n\n // emit close event\n this.emit('close', reason, desc);\n\n // clean buffers after, so users can still\n // grab the buffers on `close` event\n self.writeBuffer = [];\n self.prevBufferLen = 0;\n }\n};\n\n/**\n * Filters upgrades, returning only those matching client transports.\n *\n * @param {Array} server upgrades\n * @api private\n *\n */\n\nSocket.prototype.filterUpgrades = function (upgrades) {\n var filteredUpgrades = [];\n for (var i = 0, j = upgrades.length; i<j; i++) {\n if (~index(this.transports, upgrades[i])) filteredUpgrades.push(upgrades[i]);\n }\n return filteredUpgrades;\n};\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n\n},{\"./transport\":14,\"./transports\":15,\"component-emitter\":21,\"debug\":9,\"engine.io-parser\":22,\"indexof\":27,\"parsejson\":31,\"parseqs\":32,\"parseuri\":33}],14:[function(require,module,exports){\n/**\n * Module dependencies.\n */\n\nvar parser = require('engine.io-parser');\nvar Emitter = require('component-emitter');\n\n/**\n * Module exports.\n */\n\nmodule.exports = Transport;\n\n/**\n * Transport abstract constructor.\n *\n * @param {Object} options.\n * @api private\n */\n\nfunction Transport (opts) {\n this.path = opts.path;\n this.hostname = opts.hostname;\n this.port = opts.port;\n this.secure = opts.secure;\n this.query = opts.query;\n this.timestampParam = opts.timestampParam;\n this.timestampRequests = opts.timestampRequests;\n this.readyState = '';\n this.agent = opts.agent || false;\n this.socket = opts.socket;\n this.enablesXDR = opts.enablesXDR;\n\n // SSL options for Node.js client\n this.pfx = opts.pfx;\n this.key = opts.key;\n this.passphrase = opts.passphrase;\n this.cert = opts.cert;\n this.ca = opts.ca;\n this.ciphers = opts.ciphers;\n this.rejectUnauthorized = opts.rejectUnauthorized;\n\n // other options for Node.js client\n this.extraHeaders = opts.extraHeaders;\n}\n\n/**\n * Mix in `Emitter`.\n */\n\nEmitter(Transport.prototype);\n\n/**\n * Emits an error.\n *\n * @param {String} str\n * @return {Transport} for chaining\n * @api public\n */\n\nTransport.prototype.onError = function (msg, desc) {\n var err = new Error(msg);\n err.type = 'TransportError';\n err.description = desc;\n this.emit('error', err);\n return this;\n};\n\n/**\n * Opens the transport.\n *\n * @api public\n */\n\nTransport.prototype.open = function () {\n if ('closed' == this.readyState || '' == this.readyState) {\n this.readyState = 'opening';\n this.doOpen();\n }\n\n return this;\n};\n\n/**\n * Closes the transport.\n *\n * @api private\n */\n\nTransport.prototype.close = function () {\n if ('opening' == this.readyState || 'open' == this.readyState) {\n this.doClose();\n this.onClose();\n }\n\n return this;\n};\n\n/**\n * Sends multiple packets.\n *\n * @param {Array} packets\n * @api private\n */\n\nTransport.prototype.send = function(packets){\n if ('open' == this.readyState) {\n this.write(packets);\n } else {\n throw new Error('Transport not open');\n }\n};\n\n/**\n * Called upon open\n *\n * @api private\n */\n\nTransport.prototype.onOpen = function () {\n this.readyState = 'open';\n this.writable = true;\n this.emit('open');\n};\n\n/**\n * Called with data.\n *\n * @param {String} data\n * @api private\n */\n\nTransport.prototype.onData = function(data){\n var packet = parser.decodePacket(data, this.socket.binaryType);\n this.onPacket(packet);\n};\n\n/**\n * Called with a decoded packet.\n */\n\nTransport.prototype.onPacket = function (packet) {\n this.emit('packet', packet);\n};\n\n/**\n * Called upon close.\n *\n * @api private\n */\n\nTransport.prototype.onClose = function () {\n this.readyState = 'closed';\n this.emit('close');\n};\n\n},{\"component-emitter\":21,\"engine.io-parser\":22}],15:[function(require,module,exports){\n(function (global){\n/**\n * Module dependencies\n */\n\nvar XMLHttpRequest = require('xmlhttprequest-ssl');\nvar XHR = require('./polling-xhr');\nvar JSONP = require('./polling-jsonp');\nvar websocket = require('./websocket');\n\n/**\n * Export transports.\n */\n\nexports.polling = polling;\nexports.websocket = websocket;\n\n/**\n * Polling transport polymorphic constructor.\n * Decides on xhr vs jsonp based on feature detection.\n *\n * @api private\n */\n\nfunction polling(opts){\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' == location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname != location.hostname || port != opts.port;\n xs = opts.secure != isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n\n},{\"./polling-jsonp\":16,\"./polling-xhr\":17,\"./websocket\":19,\"xmlhttprequest-ssl\":20}],16:[function(require,module,exports){\n(function (global){\n\n/**\n * Module requirements.\n */\n\nvar Polling = require('./polling');\nvar inherit = require('component-inherit');\n\n/**\n * Module exports.\n */\n\nmodule.exports = JSONPPolling;\n\n/**\n * Cached regular expressions.\n */\n\nvar rNewline = /\\n/g;\nvar rEscapedNewline = /\\\\n/g;\n\n/**\n * Global JSONP callbacks.\n */\n\nvar callbacks;\n\n/**\n * Callbacks count.\n */\n\nvar index = 0;\n\n/**\n * Noop.\n */\n\nfunction empty () { }\n\n/**\n * JSONP Polling constructor.\n *\n * @param {Object} opts.\n * @api public\n */\n\nfunction JSONPPolling (opts) {\n Polling.call(this, opts);\n\n this.query = this.query || {};\n\n // define global callbacks array if not present\n // we do this here (lazily) to avoid unneeded global pollution\n if (!callbacks) {\n // we need to consider multiple engines in the same page\n if (!global.___eio) global.___eio = [];\n callbacks = global.___eio;\n }\n\n // callback identifier\n this.index = callbacks.length;\n\n // add callback to jsonp global\n var self = this;\n callbacks.push(function (msg) {\n self.onData(msg);\n });\n\n // append to query string\n this.query.j = this.index;\n\n // prevent spurious errors from being emitted when the window is unloaded\n if (global.document && global.addEventListener) {\n global.addEventListener('beforeunload', function () {\n if (self.script) self.script.onerror = empty;\n }, false);\n }\n}\n\n/**\n * Inherits from Polling.\n */\n\ninherit(JSONPPolling, Polling);\n\n/*\n * JSONP only supports binary as base64 encoded strings\n */\n\nJSONPPolling.prototype.supportsBinary = false;\n\n/**\n * Closes the socket.\n *\n * @api private\n */\n\nJSONPPolling.prototype.doClose = function () {\n if (this.script) {\n this.script.parentNode.removeChild(this.script);\n this.script = null;\n }\n\n if (this.form) {\n this.form.parentNode.removeChild(this.form);\n this.form = null;\n this.iframe = null;\n }\n\n Polling.prototype.doClose.call(this);\n};\n\n/**\n * Starts a poll cycle.\n *\n * @api private\n */\n\nJSONPPolling.prototype.doPoll = function () {\n var self = this;\n var script = document.createElement('script');\n\n if (this.script) {\n this.script.parentNode.removeChild(this.script);\n this.script = null;\n }\n\n script.async = true;\n script.src = this.uri();\n script.onerror = function(e){\n self.onError('jsonp poll error',e);\n };\n\n var insertAt = document.getElementsByTagName('script')[0];\n if (insertAt) {\n insertAt.parentNode.insertBefore(script, insertAt);\n }\n else {\n (document.head || document.body).appendChild(script);\n }\n this.script = script;\n\n var isUAgecko = 'undefined' != typeof navigator && /gecko/i.test(navigator.userAgent);\n \n if (isUAgecko) {\n setTimeout(function () {\n var iframe = document.createElement('iframe');\n document.body.appendChild(iframe);\n document.body.removeChild(iframe);\n }, 100);\n }\n};\n\n/**\n * Writes with a hidden iframe.\n *\n * @param {String} data to send\n * @param {Function} called upon flush.\n * @api private\n */\n\nJSONPPolling.prototype.doWrite = function (data, fn) {\n var self = this;\n\n if (!this.form) {\n var form = document.createElement('form');\n var area = document.createElement('textarea');\n var id = this.iframeId = 'eio_iframe_' + this.index;\n var iframe;\n\n form.className = 'socketio';\n form.style.position = 'absolute';\n form.style.top = '-1000px';\n form.style.left = '-1000px';\n form.target = id;\n form.method = 'POST';\n form.setAttribute('accept-charset', 'utf-8');\n area.name = 'd';\n form.appendChild(area);\n document.body.appendChild(form);\n\n this.form = form;\n this.area = area;\n }\n\n this.form.action = this.uri();\n\n function complete () {\n initIframe();\n fn();\n }\n\n function initIframe () {\n if (self.iframe) {\n try {\n self.form.removeChild(self.iframe);\n } catch (e) {\n self.onError('jsonp polling iframe removal error', e);\n }\n }\n\n try {\n // ie6 dynamic iframes with target=\"\" support (thanks Chris Lambacher)\n var html = '<iframe src=\"javascript:0\" name=\"'+ self.iframeId +'\">';\n iframe = document.createElement(html);\n } catch (e) {\n iframe = document.createElement('iframe');\n iframe.name = self.iframeId;\n iframe.src = 'javascript:0';\n }\n\n iframe.id = self.iframeId;\n\n self.form.appendChild(iframe);\n self.iframe = iframe;\n }\n\n initIframe();\n\n // escape \\n to prevent it from being converted into \\r\\n by some UAs\n // double escaping is required for escaped new lines because unescaping of new lines can be done safely on server-side\n data = data.replace(rEscapedNewline, '\\\\\\n');\n this.area.value = data.replace(rNewline, '\\\\n');\n\n try {\n this.form.submit();\n } catch(e) {}\n\n if (this.iframe.attachEvent) {\n this.iframe.onreadystatechange = function(){\n if (self.iframe.readyState == 'complete') {\n complete();\n }\n };\n } else {\n this.iframe.onload = complete;\n }\n};\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n\n},{\"./polling\":18,\"component-inherit\":8}],17:[function(require,module,exports){\n(function (global){\n/**\n * Module requirements.\n */\n\nvar XMLHttpRequest = require('xmlhttprequest-ssl');\nvar Polling = require('./polling');\nvar Emitter = require('component-emitter');\nvar inherit = require('component-inherit');\nvar debug = require('debug')('engine.io-client:polling-xhr');\n\n/**\n * Module exports.\n */\n\nmodule.exports = XHR;\nmodule.exports.Request = Request;\n\n/**\n * Empty function\n */\n\nfunction empty(){}\n\n/**\n * XHR Polling constructor.\n *\n * @param {Object} opts\n * @api public\n */\n\nfunction XHR(opts){\n Polling.call(this, opts);\n\n if (global.location) {\n var isSSL = 'https:' == location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n this.xd = opts.hostname != global.location.hostname ||\n port != opts.port;\n this.xs = opts.secure != isSSL;\n } else {\n this.extraHeaders = opts.extraHeaders;\n }\n}\n\n/**\n * Inherits from Polling.\n */\n\ninherit(XHR, Polling);\n\n/**\n * XHR supports binary\n */\n\nXHR.prototype.supportsBinary = true;\n\n/**\n * Creates a request.\n *\n * @param {String} method\n * @api private\n */\n\nXHR.prototype.request = function(opts){\n opts = opts || {};\n opts.uri = this.uri();\n opts.xd = this.xd;\n opts.xs = this.xs;\n opts.agent = this.agent || false;\n opts.supportsBinary = this.supportsBinary;\n opts.enablesXDR = this.enablesXDR;\n\n // SSL options for Node.js client\n opts.pfx = this.pfx;\n opts.key = this.key;\n opts.passphrase = this.passphrase;\n opts.cert = this.cert;\n opts.ca = this.ca;\n opts.ciphers = this.ciphers;\n opts.rejectUnauthorized = this.rejectUnauthorized;\n\n // other options for Node.js client\n opts.extraHeaders = this.extraHeaders;\n\n return new Request(opts);\n};\n\n/**\n * Sends data.\n *\n * @param {String} data to send.\n * @param {Function} called upon flush.\n * @api private\n */\n\nXHR.prototype.doWrite = function(data, fn){\n var isBinary = typeof data !== 'string' && data !== undefined;\n var req = this.request({ method: 'POST', data: data, isBinary: isBinary });\n var self = this;\n req.on('success', fn);\n req.on('error', function(err){\n self.onError('xhr post error', err);\n });\n this.sendXhr = req;\n};\n\n/**\n * Starts a poll cycle.\n *\n * @api private\n */\n\nXHR.prototype.doPoll = function(){\n debug('xhr poll');\n var req = this.request();\n var self = this;\n req.on('data', function(data){\n self.onData(data);\n });\n req.on('error', function(err){\n self.onError('xhr poll error', err);\n });\n this.pollXhr = req;\n};\n\n/**\n * Request constructor\n *\n * @param {Object} options\n * @api public\n */\n\nfunction Request(opts){\n this.method = opts.method || 'GET';\n this.uri = opts.uri;\n this.xd = !!opts.xd;\n this.xs = !!opts.xs;\n this.async = false !== opts.async;\n this.data = undefined != opts.data ? opts.data : null;\n this.agent = opts.agent;\n this.isBinary = opts.isBinary;\n this.supportsBinary = opts.supportsBinary;\n this.enablesXDR = opts.enablesXDR;\n\n // SSL options for Node.js client\n this.pfx = opts.pfx;\n this.key = opts.key;\n this.passphrase = opts.passphrase;\n this.cert = opts.cert;\n this.ca = opts.ca;\n this.ciphers = opts.ciphers;\n this.rejectUnauthorized = opts.rejectUnauthorized;\n\n // other options for Node.js client\n this.extraHeaders = opts.extraHeaders;\n\n this.create();\n}\n\n/**\n * Mix in `Emitter`.\n */\n\nEmitter(Request.prototype);\n\n/**\n * Creates the XHR object and sends the request.\n *\n * @api private\n */\n\nRequest.prototype.create = function(){\n var opts = { agent: this.agent, xdomain: this.xd, xscheme: this.xs, enablesXDR: this.enablesXDR };\n\n // SSL options for Node.js client\n opts.pfx = this.pfx;\n opts.key = this.key;\n opts.passphrase = this.passphrase;\n opts.cert = this.cert;\n opts.ca = this.ca;\n opts.ciphers = this.ciphers;\n opts.rejectUnauthorized = this.rejectUnauthorized;\n\n var xhr = this.xhr = new XMLHttpRequest(opts);\n var self = this;\n\n try {\n debug('xhr open %s: %s', this.method, this.uri);\n xhr.open(this.method, this.uri, this.async);\n try {\n if (this.extraHeaders) {\n xhr.setDisableHeaderCheck(true);\n for (var i in this.extraHeaders) {\n if (this.extraHeaders.hasOwnProperty(i)) {\n xhr.setRequestHeader(i, this.extraHeaders[i]);\n }\n }\n }\n } catch (e) {}\n if (this.supportsBinary) {\n // This has to be done after open because Firefox is stupid\n // http://stackoverflow.com/questions/13216903/get-binary-data-with-xmlhttprequest-in-a-firefox-extension\n xhr.responseType = 'arraybuffer';\n }\n\n if ('POST' == this.method) {\n try {\n if (this.isBinary) {\n xhr.setRequestHeader('Content-type', 'application/octet-stream');\n } else {\n xhr.setRequestHeader('Content-type', 'text/plain;charset=UTF-8');\n }\n } catch (e) {}\n }\n\n // ie6 check\n if ('withCredentials' in xhr) {\n xhr.withCredentials = true;\n }\n\n if (this.hasXDR()) {\n xhr.onload = function(){\n self.onLoad();\n };\n xhr.onerror = function(){\n self.onError(xhr.responseText);\n };\n } else {\n xhr.onreadystatechange = function(){\n if (4 != xhr.readyState) return;\n if (200 == xhr.status || 1223 == xhr.status) {\n self.onLoad();\n } else {\n // make sure the `error` event handler that's user-set\n // does not throw in the same tick and gets caught here\n setTimeout(function(){\n self.onError(xhr.status);\n }, 0);\n }\n };\n }\n\n debug('xhr data %s', this.data);\n xhr.send(this.data);\n } catch (e) {\n // Need to defer since .create() is called directly fhrom the constructor\n // and thus the 'error' event can only be only bound *after* this exception\n // occurs. Therefore, also, we cannot throw here at all.\n setTimeout(function() {\n self.onError(e);\n }, 0);\n return;\n }\n\n if (global.document) {\n this.index = Request.requestsCount++;\n Request.requests[this.index] = this;\n }\n};\n\n/**\n * Called upon successful response.\n *\n * @api private\n */\n\nRequest.prototype.onSuccess = function(){\n this.emit('success');\n this.cleanup();\n};\n\n/**\n * Called if we have data.\n *\n * @api private\n */\n\nRequest.prototype.onData = function(data){\n this.emit('data', data);\n this.onSuccess();\n};\n\n/**\n * Called upon error.\n *\n * @api private\n */\n\nRequest.prototype.onError = function(err){\n this.emit('error', err);\n this.cleanup(true);\n};\n\n/**\n * Cleans up house.\n *\n * @api private\n */\n\nRequest.prototype.cleanup = function(fromError){\n if ('undefined' == typeof this.xhr || null === this.xhr) {\n return;\n }\n // xmlhttprequest\n if (this.hasXDR()) {\n this.xhr.onload = this.xhr.onerror = empty;\n } else {\n this.xhr.onreadystatechange = empty;\n }\n\n if (fromError) {\n try {\n this.xhr.abort();\n } catch(e) {}\n }\n\n if (global.document) {\n delete Request.requests[this.index];\n }\n\n this.xhr = null;\n};\n\n/**\n * Called upon load.\n *\n * @api private\n */\n\nRequest.prototype.onLoad = function(){\n var data;\n try {\n var contentType;\n try {\n contentType = this.xhr.getResponseHeader('Content-Type').split(';')[0];\n } catch (e) {}\n if (contentType === 'application/octet-stream') {\n data = this.xhr.response;\n } else {\n if (!this.supportsBinary) {\n data = this.xhr.responseText;\n } else {\n try {\n data = String.fromCharCode.apply(null, new Uint8Array(this.xhr.response));\n } catch (e) {\n var ui8Arr = new Uint8Array(this.xhr.response);\n var dataArray = [];\n for (var idx = 0, length = ui8Arr.length; idx < length; idx++) {\n dataArray.push(ui8Arr[idx]);\n }\n\n data = String.fromCharCode.apply(null, dataArray);\n }\n }\n }\n } catch (e) {\n this.onError(e);\n }\n if (null != data) {\n this.onData(data);\n }\n};\n\n/**\n * Check if it has XDomainRequest.\n *\n * @api private\n */\n\nRequest.prototype.hasXDR = function(){\n return 'undefined' !== typeof global.XDomainRequest && !this.xs && this.enablesXDR;\n};\n\n/**\n * Aborts the request.\n *\n * @api public\n */\n\nRequest.prototype.abort = function(){\n this.cleanup();\n};\n\n/**\n * Aborts pending requests when unloading the window. This is needed to prevent\n * memory leaks (e.g. when using IE) and to ensure that no spurious error is\n * emitted.\n */\n\nif (global.document) {\n Request.requestsCount = 0;\n Request.requests = {};\n if (global.attachEvent) {\n global.attachEvent('onunload', unloadHandler);\n } else if (global.addEventListener) {\n global.addEventListener('beforeunload', unloadHandler, false);\n }\n}\n\nfunction unloadHandler() {\n for (var i in Request.requests) {\n if (Request.requests.hasOwnProperty(i)) {\n Request.requests[i].abort();\n }\n }\n}\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n\n},{\"./polling\":18,\"component-emitter\":21,\"component-inherit\":8,\"debug\":9,\"xmlhttprequest-ssl\":20}],18:[function(require,module,exports){\n/**\n * Module dependencies.\n */\n\nvar Transport = require('../transport');\nvar parseqs = require('parseqs');\nvar parser = require('engine.io-parser');\nvar inherit = require('component-inherit');\nvar yeast = require('yeast');\nvar debug = require('debug')('engine.io-client:polling');\n\n/**\n * Module exports.\n */\n\nmodule.exports = Polling;\n\n/**\n * Is XHR2 supported?\n */\n\nvar hasXHR2 = (function() {\n var XMLHttpRequest = require('xmlhttprequest-ssl');\n var xhr = new XMLHttpRequest({ xdomain: false });\n return null != xhr.responseType;\n})();\n\n/**\n * Polling interface.\n *\n * @param {Object} opts\n * @api private\n */\n\nfunction Polling(opts){\n var forceBase64 = (opts && opts.forceBase64);\n if (!hasXHR2 || forceBase64) {\n this.supportsBinary = false;\n }\n Transport.call(this, opts);\n}\n\n/**\n * Inherits from Transport.\n */\n\ninherit(Polling, Transport);\n\n/**\n * Transport name.\n */\n\nPolling.prototype.name = 'polling';\n\n/**\n * Opens the socket (triggers polling). We write a PING message to determine\n * when the transport is open.\n *\n * @api private\n */\n\nPolling.prototype.doOpen = function(){\n this.poll();\n};\n\n/**\n * Pauses polling.\n *\n * @param {Function} callback upon buffers are flushed and transport is paused\n * @api private\n */\n\nPolling.prototype.pause = function(onPause){\n var pending = 0;\n var self = this;\n\n this.readyState = 'pausing';\n\n function pause(){\n debug('paused');\n self.readyState = 'paused';\n onPause();\n }\n\n if (this.polling || !this.writable) {\n var total = 0;\n\n if (this.polling) {\n debug('we are currently polling - waiting to pause');\n total++;\n this.once('pollComplete', function(){\n debug('pre-pause polling complete');\n --total || pause();\n });\n }\n\n if (!this.writable) {\n debug('we are currently writing - waiting to pause');\n total++;\n this.once('drain', function(){\n debug('pre-pause writing complete');\n --total || pause();\n });\n }\n } else {\n pause();\n }\n};\n\n/**\n * Starts polling cycle.\n *\n * @api public\n */\n\nPolling.prototype.poll = function(){\n debug('polling');\n this.polling = true;\n this.doPoll();\n this.emit('poll');\n};\n\n/**\n * Overloads onData to detect payloads.\n *\n * @api private\n */\n\nPolling.prototype.onData = function(data){\n var self = this;\n debug('polling got data %s', data);\n var callback = function(packet, index, total) {\n // if its the first message we consider the transport open\n if ('opening' == self.readyState) {\n self.onOpen();\n }\n\n // if its a close packet, we close the ongoing requests\n if ('close' == packet.type) {\n self.onClose();\n return false;\n }\n\n // otherwise bypass onData and handle the message\n self.onPacket(packet);\n };\n\n // decode payload\n parser.decodePayload(data, this.socket.binaryType, callback);\n\n // if an event did not trigger closing\n if ('closed' != this.readyState) {\n // if we got data we're not polling\n this.polling = false;\n this.emit('pollComplete');\n\n if ('open' == this.readyState) {\n this.poll();\n } else {\n debug('ignoring poll - transport state \"%s\"', this.readyState);\n }\n }\n};\n\n/**\n * For polling, send a close packet.\n *\n * @api private\n */\n\nPolling.prototype.doClose = function(){\n var self = this;\n\n function close(){\n debug('writing close packet');\n self.write([{ type: 'close' }]);\n }\n\n if ('open' == this.readyState) {\n debug('transport open - closing');\n close();\n } else {\n // in case we're trying to close while\n // handshaking is in progress (GH-164)\n debug('transport not open - deferring close');\n this.once('open', close);\n }\n};\n\n/**\n * Writes a packets payload.\n *\n * @param {Array} data packets\n * @param {Function} drain callback\n * @api private\n */\n\nPolling.prototype.write = function(packets){\n var self = this;\n this.writable = false;\n var callbackfn = function() {\n self.writable = true;\n self.emit('drain');\n };\n\n var self = this;\n parser.encodePayload(packets, this.supportsBinary, function(data) {\n self.doWrite(data, callbackfn);\n });\n};\n\n/**\n * Generates uri for connection.\n *\n * @api private\n */\n\nPolling.prototype.uri = function(){\n var query = this.query || {};\n var schema = this.secure ? 'https' : 'http';\n var port = '';\n\n // cache busting is forced\n if (false !== this.timestampRequests) {\n query[this.timestampParam] = yeast();\n }\n\n if (!this.supportsBinary && !query.sid) {\n query.b64 = 1;\n }\n\n query = parseqs.encode(query);\n\n // avoid port if default for schema\n if (this.port && (('https' == schema && this.port != 443) ||\n ('http' == schema && this.port != 80))) {\n port = ':' + this.port;\n }\n\n // prepend ? to query\n if (query.length) {\n query = '?' + query;\n }\n\n var ipv6 = this.hostname.indexOf(':') !== -1;\n return schema + '://' + (ipv6 ? '[' + this.hostname + ']' : this.hostname) + port + this.path + query;\n};\n\n},{\"../transport\":14,\"component-inherit\":8,\"debug\":9,\"engine.io-parser\":22,\"parseqs\":32,\"xmlhttprequest-ssl\":20,\"yeast\":45}],19:[function(require,module,exports){\n(function (global){\n/**\n * Module dependencies.\n */\n\nvar Transport = require('../transport');\nvar parser = require('engine.io-parser');\nvar parseqs = require('parseqs');\nvar inherit = require('component-inherit');\nvar yeast = require('yeast');\nvar debug = require('debug')('engine.io-client:websocket');\nvar BrowserWebSocket = global.WebSocket || global.MozWebSocket;\n\n/**\n * Get either the `WebSocket` or `MozWebSocket` globals\n * in the browser or the WebSocket-compatible interface\n * exposed by `ws` for Node environment.\n */\n\nvar WebSocket = BrowserWebSocket || (typeof window !== 'undefined' ? null : require('ws'));\n\n/**\n * Module exports.\n */\n\nmodule.exports = WS;\n\n/**\n * WebSocket transport constructor.\n *\n * @api {Object} connection options\n * @api public\n */\n\nfunction WS(opts){\n var forceBase64 = (opts && opts.forceBase64);\n if (forceBase64) {\n this.supportsBinary = false;\n }\n this.perMessageDeflate = opts.perMessageDeflate;\n Transport.call(this, opts);\n}\n\n/**\n * Inherits from Transport.\n */\n\ninherit(WS, Transport);\n\n/**\n * Transport name.\n *\n * @api public\n */\n\nWS.prototype.name = 'websocket';\n\n/*\n * WebSockets support binary\n */\n\nWS.prototype.supportsBinary = true;\n\n/**\n * Opens socket.\n *\n * @api private\n */\n\nWS.prototype.doOpen = function(){\n if (!this.check()) {\n // let probe timeout\n return;\n }\n\n var self = this;\n var uri = this.uri();\n var protocols = void(0);\n var opts = {\n agent: this.agent,\n perMessageDeflate: this.perMessageDeflate\n };\n\n // SSL options for Node.js client\n opts.pfx = this.pfx;\n opts.key = this.key;\n opts.passphrase = this.passphrase;\n opts.cert = this.cert;\n opts.ca = this.ca;\n opts.ciphers = this.ciphers;\n opts.rejectUnauthorized = this.rejectUnauthorized;\n if (this.extraHeaders) {\n opts.headers = this.extraHeaders;\n }\n\n this.ws = BrowserWebSocket ? new WebSocket(uri) : new WebSocket(uri, protocols, opts);\n\n if (this.ws.binaryType === undefined) {\n this.supportsBinary = false;\n }\n\n if (this.ws.supports && this.ws.supports.binary) {\n this.supportsBinary = true;\n this.ws.binaryType = 'buffer';\n } else {\n this.ws.binaryType = 'arraybuffer';\n }\n\n this.addEventListeners();\n};\n\n/**\n * Adds event listeners to the socket\n *\n * @api private\n */\n\nWS.prototype.addEventListeners = function(){\n var self = this;\n\n this.ws.onopen = function(){\n self.onOpen();\n };\n this.ws.onclose = function(){\n self.onClose();\n };\n this.ws.onmessage = function(ev){\n self.onData(ev.data);\n };\n this.ws.onerror = function(e){\n self.onError('websocket error', e);\n };\n};\n\n/**\n * Override `onData` to use a timer on iOS.\n * See: https://gist.github.com/mloughran/2052006\n *\n * @api private\n */\n\nif ('undefined' != typeof navigator\n && /iPad|iPhone|iPod/i.test(navigator.userAgent)) {\n WS.prototype.onData = function(data){\n var self = this;\n setTimeout(function(){\n Transport.prototype.onData.call(self, data);\n }, 0);\n };\n}\n\n/**\n * Writes data to socket.\n *\n * @param {Array} array of packets.\n * @api private\n */\n\nWS.prototype.write = function(packets){\n var self = this;\n this.writable = false;\n\n // encodePacket efficient as it uses WS framing\n // no need for encodePayload\n var total = packets.length;\n for (var i = 0, l = total; i < l; i++) {\n (function(packet) {\n parser.encodePacket(packet, self.supportsBinary, function(data) {\n if (!BrowserWebSocket) {\n // always create a new object (GH-437)\n var opts = {};\n if (packet.options) {\n opts.compress = packet.options.compress;\n }\n\n if (self.perMessageDeflate) {\n var len = 'string' == typeof data ? global.Buffer.byteLength(data) : data.length;\n if (len < self.perMessageDeflate.threshold) {\n opts.compress = false;\n }\n }\n }\n\n //Sometimes the websocket has already been closed but the browser didn't\n //have a chance of informing us about it yet, in that case send will\n //throw an error\n try {\n if (BrowserWebSocket) {\n // TypeError is thrown when passing the second argument on Safari\n self.ws.send(data);\n } else {\n self.ws.send(data, opts);\n }\n } catch (e){\n debug('websocket closed before onclose event');\n }\n\n --total || done();\n });\n })(packets[i]);\n }\n\n function done(){\n self.emit('flush');\n\n // fake drain\n // defer to next tick to allow Socket to clear writeBuffer\n setTimeout(function(){\n self.writable = true;\n self.emit('drain');\n }, 0);\n }\n};\n\n/**\n * Called upon close\n *\n * @api private\n */\n\nWS.prototype.onClose = function(){\n Transport.prototype.onClose.call(this);\n};\n\n/**\n * Closes socket.\n *\n * @api private\n */\n\nWS.prototype.doClose = function(){\n if (typeof this.ws !== 'undefined') {\n this.ws.close();\n }\n};\n\n/**\n * Generates uri for connection.\n *\n * @api private\n */\n\nWS.prototype.uri = function(){\n var query = this.query || {};\n var schema = this.secure ? 'wss' : 'ws';\n var port = '';\n\n // avoid port if default for schema\n if (this.port && (('wss' == schema && this.port != 443)\n || ('ws' == schema && this.port != 80))) {\n port = ':' + this.port;\n }\n\n // append timestamp to URI\n if (this.timestampRequests) {\n query[this.timestampParam] = yeast();\n }\n\n // communicate binary support capabilities\n if (!this.supportsBinary) {\n query.b64 = 1;\n }\n\n query = parseqs.encode(query);\n\n // prepend ? to query\n if (query.length) {\n query = '?' + query;\n }\n\n var ipv6 = this.hostname.indexOf(':') !== -1;\n return schema + '://' + (ipv6 ? '[' + this.hostname + ']' : this.hostname) + port + this.path + query;\n};\n\n/**\n * Feature detection for WebSocket.\n *\n * @return {Boolean} whether this transport is available.\n * @api public\n */\n\nWS.prototype.check = function(){\n return !!WebSocket && !('__initialize' in WebSocket && this.name === WS.prototype.name);\n};\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n\n},{\"../transport\":14,\"component-inherit\":8,\"debug\":9,\"engine.io-parser\":22,\"parseqs\":32,\"ws\":47,\"yeast\":45}],20:[function(require,module,exports){\n// browser shim for xmlhttprequest module\nvar hasCORS = require('has-cors');\n\nmodule.exports = function(opts) {\n var xdomain = opts.xdomain;\n\n // scheme must be same when usign XDomainRequest\n // http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx\n var xscheme = opts.xscheme;\n\n // XDomainRequest has a flow of not sending cookie, therefore it should be disabled as a default.\n // https://github.com/Automattic/engine.io-client/pull/217\n var enablesXDR = opts.enablesXDR;\n\n // XMLHttpRequest can be disabled on IE\n try {\n if ('undefined' != typeof XMLHttpRequest && (!xdomain || hasCORS)) {\n return new XMLHttpRequest();\n }\n } catch (e) { }\n\n // Use XDomainRequest for IE8 if enablesXDR is true\n // because loading bar keeps flashing when using jsonp-polling\n // https://github.com/yujiosaka/socke.io-ie8-loading-example\n try {\n if ('undefined' != typeof XDomainRequest && !xscheme && enablesXDR) {\n return new XDomainRequest();\n }\n } catch (e) { }\n\n if (!xdomain) {\n try {\n return new ActiveXObject('Microsoft.XMLHTTP');\n } catch(e) { }\n }\n}\n\n},{\"has-cors\":26}],21:[function(require,module,exports){\n\n/**\n * Expose `Emitter`.\n */\n\nmodule.exports = Emitter;\n\n/**\n * Initialize a new `Emitter`.\n *\n * @api public\n */\n\nfunction Emitter(obj) {\n if (obj) return mixin(obj);\n};\n\n/**\n * Mixin the emitter properties.\n *\n * @param {Object} obj\n * @return {Object}\n * @api private\n */\n\nfunction mixin(obj) {\n for (var key in Emitter.prototype) {\n obj[key] = Emitter.prototype[key];\n }\n return obj;\n}\n\n/**\n * Listen on the given `event` with `fn`.\n *\n * @param {String} event\n * @param {Function} fn\n * @return {Emitter}\n * @api public\n */\n\nEmitter.prototype.on =\nEmitter.prototype.addEventListener = function(event, fn){\n this._callbacks = this._callbacks || {};\n (this._callbacks[event] = this._callbacks[event] || [])\n .push(fn);\n return this;\n};\n\n/**\n * Adds an `event` listener that will be invoked a single\n * time then automatically removed.\n *\n * @param {String} event\n * @param {Function} fn\n * @return {Emitter}\n * @api public\n */\n\nEmitter.prototype.once = function(event, fn){\n var self = this;\n this._callbacks = this._callbacks || {};\n\n function on() {\n self.off(event, on);\n fn.apply(this, arguments);\n }\n\n on.fn = fn;\n this.on(event, on);\n return this;\n};\n\n/**\n * Remove the given callback for `event` or all\n * registered callbacks.\n *\n * @param {String} event\n * @param {Function} fn\n * @return {Emitter}\n * @api public\n */\n\nEmitter.prototype.off =\nEmitter.prototype.removeListener =\nEmitter.prototype.removeAllListeners =\nEmitter.prototype.removeEventListener = function(event, fn){\n this._callbacks = this._callbacks || {};\n\n // all\n if (0 == arguments.length) {\n this._callbacks = {};\n return this;\n }\n\n // specific event\n var callbacks = this._callbacks[event];\n if (!callbacks) return this;\n\n // remove all handlers\n if (1 == arguments.length) {\n delete this._callbacks[event];\n return this;\n }\n\n // remove specific handler\n var cb;\n for (var i = 0; i < callbacks.length; i++) {\n cb = callbacks[i];\n if (cb === fn || cb.fn === fn) {\n callbacks.splice(i, 1);\n break;\n }\n }\n return this;\n};\n\n/**\n * Emit `event` with the given args.\n *\n * @param {String} event\n * @param {Mixed} ...\n * @return {Emitter}\n */\n\nEmitter.prototype.emit = function(event){\n this._callbacks = this._callbacks || {};\n var args = [].slice.call(arguments, 1)\n , callbacks = this._callbacks[event];\n\n if (callbacks) {\n callbacks = callbacks.slice(0);\n for (var i = 0, len = callbacks.length; i < len; ++i) {\n callbacks[i].apply(this, args);\n }\n }\n\n return this;\n};\n\n/**\n * Return array of callbacks for `event`.\n *\n * @param {String} event\n * @return {Array}\n * @api public\n */\n\nEmitter.prototype.listeners = function(event){\n this._callbacks = this._callbacks || {};\n return this._callbacks[event] || [];\n};\n\n/**\n * Check if this emitter has `event` handlers.\n *\n * @param {String} event\n * @return {Boolean}\n * @api public\n */\n\nEmitter.prototype.hasListeners = function(event){\n return !! this.listeners(event).length;\n};\n\n},{}],22:[function(require,module,exports){\n(function (global){\n/**\n * Module dependencies.\n */\n\nvar keys = require('./keys');\nvar hasBinary = require('has-binary');\nvar sliceBuffer = require('arraybuffer.slice');\nvar base64encoder = require('base64-arraybuffer');\nvar after = require('after');\nvar utf8 = require('utf8');\n\n/**\n * Check if we are running an android browser. That requires us to use\n * ArrayBuffer with polling transports...\n *\n * http://ghinda.net/jpeg-blob-ajax-android/\n */\n\nvar isAndroid = navigator.userAgent.match(/Android/i);\n\n/**\n * Check if we are running in PhantomJS.\n * Uploading a Blob with PhantomJS does not work correctly, as reported here:\n * https://github.com/ariya/phantomjs/issues/11395\n * @type boolean\n */\nvar isPhantomJS = /PhantomJS/i.test(navigator.userAgent);\n\n/**\n * When true, avoids using Blobs to encode payloads.\n * @type boolean\n */\nvar dontSendBlobs = isAndroid || isPhantomJS;\n\n/**\n * Current protocol version.\n */\n\nexports.protocol = 3;\n\n/**\n * Packet types.\n */\n\nvar packets = exports.packets = {\n open: 0 // non-ws\n , close: 1 // non-ws\n , ping: 2\n , pong: 3\n , message: 4\n , upgrade: 5\n , noop: 6\n};\n\nvar packetslist = keys(packets);\n\n/**\n * Premade error packet.\n */\n\nvar err = { type: 'error', data: 'parser error' };\n\n/**\n * Create a blob api even for blob builder when vendor prefixes exist\n */\n\nvar Blob = require('blob');\n\n/**\n * Encodes a packet.\n *\n * <packet type id> [ <data> ]\n *\n * Example:\n *\n * 5hello world\n * 3\n * 4\n *\n * Binary is encoded in an identical principle\n *\n * @api private\n */\n\nexports.encodePacket = function (packet, supportsBinary, utf8encode, callback) {\n if ('function' == typeof supportsBinary) {\n callback = supportsBinary;\n supportsBinary = false;\n }\n\n if ('function' == typeof utf8encode) {\n callback = utf8encode;\n utf8encode = null;\n }\n\n var data = (packet.data === undefined)\n ? undefined\n : packet.data.buffer || packet.data;\n\n if (global.ArrayBuffer && data instanceof ArrayBuffer) {\n return encodeArrayBuffer(packet, supportsBinary, callback);\n } else if (Blob && data instanceof global.Blob) {\n return encodeBlob(packet, supportsBinary, callback);\n }\n\n // might be an object with { base64: true, data: dataAsBase64String }\n if (data && data.base64) {\n return encodeBase64Object(packet, callback);\n }\n\n // Sending data as a utf-8 string\n var encoded = packets[packet.type];\n\n // data fragment is optional\n if (undefined !== packet.data) {\n encoded += utf8encode ? utf8.encode(String(packet.data)) : String(packet.data);\n }\n\n return callback('' + encoded);\n\n};\n\nfunction encodeBase64Object(packet, callback) {\n // packet data is an object { base64: true, data: dataAsBase64String }\n var message = 'b' + exports.packets[packet.type] + packet.data.data;\n return callback(message);\n}\n\n/**\n * Encode packet helpers for binary types\n */\n\nfunction encodeArrayBuffer(packet, supportsBinary, callback) {\n if (!supportsBinary) {\n return exports.encodeBase64Packet(packet, callback);\n }\n\n var data = packet.data;\n var contentArray = new Uint8Array(data);\n var resultBuffer = new Uint8Array(1 + data.byteLength);\n\n resultBuffer[0] = packets[packet.type];\n for (var i = 0; i < contentArray.length; i++) {\n resultBuffer[i+1] = contentArray[i];\n }\n\n return callback(resultBuffer.buffer);\n}\n\nfunction encodeBlobAsArrayBuffer(packet, supportsBinary, callback) {\n if (!supportsBinary) {\n return exports.encodeBase64Packet(packet, callback);\n }\n\n var fr = new FileReader();\n fr.onload = function() {\n packet.data = fr.result;\n exports.encodePacket(packet, supportsBinary, true, callback);\n };\n return fr.readAsArrayBuffer(packet.data);\n}\n\nfunction encodeBlob(packet, supportsBinary, callback) {\n if (!supportsBinary) {\n return exports.encodeBase64Packet(packet, callback);\n }\n\n if (dontSendBlobs) {\n return encodeBlobAsArrayBuffer(packet, supportsBinary, callback);\n }\n\n var length = new Uint8Array(1);\n length[0] = packets[packet.type];\n var blob = new Blob([length.buffer, packet.data]);\n\n return callback(blob);\n}\n\n/**\n * Encodes a packet with binary data in a base64 string\n *\n * @param {Object} packet, has `type` and `data`\n * @return {String} base64 encoded message\n */\n\nexports.encodeBase64Packet = function(packet, callback) {\n var message = 'b' + exports.packets[packet.type];\n if (Blob && packet.data instanceof global.Blob) {\n var fr = new FileReader();\n fr.onload = function() {\n var b64 = fr.result.split(',')[1];\n callback(message + b64);\n };\n return fr.readAsDataURL(packet.data);\n }\n\n var b64data;\n try {\n b64data = String.fromCharCode.apply(null, new Uint8Array(packet.data));\n } catch (e) {\n // iPhone Safari doesn't let you apply with typed arrays\n var typed = new Uint8Array(packet.data);\n var basic = new Array(typed.length);\n for (var i = 0; i < typed.length; i++) {\n basic[i] = typed[i];\n }\n b64data = String.fromCharCode.apply(null, basic);\n }\n message += global.btoa(b64data);\n return callback(message);\n};\n\n/**\n * Decodes a packet. Changes format to Blob if requested.\n *\n * @return {Object} with `type` and `data` (if any)\n * @api private\n */\n\nexports.decodePacket = function (data, binaryType, utf8decode) {\n // String data\n if (typeof data == 'string' || data === undefined) {\n if (data.charAt(0) == 'b') {\n return exports.decodeBase64Packet(data.substr(1), binaryType);\n }\n\n if (utf8decode) {\n try {\n data = utf8.decode(data);\n } catch (e) {\n return err;\n }\n }\n var type = data.charAt(0);\n\n if (Number(type) != type || !packetslist[type]) {\n return err;\n }\n\n if (data.length > 1) {\n return { type: packetslist[type], data: data.substring(1) };\n } else {\n return { type: packetslist[type] };\n }\n }\n\n var asArray = new Uint8Array(data);\n var type = asArray[0];\n var rest = sliceBuffer(data, 1);\n if (Blob && binaryType === 'blob') {\n rest = new Blob([rest]);\n }\n return { type: packetslist[type], data: rest };\n};\n\n/**\n * Decodes a packet encoded in a base64 string\n *\n * @param {String} base64 encoded message\n * @return {Object} with `type` and `data` (if any)\n */\n\nexports.decodeBase64Packet = function(msg, binaryType) {\n var type = packetslist[msg.charAt(0)];\n if (!global.ArrayBuffer) {\n return { type: type, data: { base64: true, data: msg.substr(1) } };\n }\n\n var data = base64encoder.decode(msg.substr(1));\n\n if (binaryType === 'blob' && Blob) {\n data = new Blob([data]);\n }\n\n return { type: type, data: data };\n};\n\n/**\n * Encodes multiple messages (payload).\n *\n * <length>:data\n *\n * Example:\n *\n * 11:hello world2:hi\n *\n * If any contents are binary, they will be encoded as base64 strings. Base64\n * encoded strings are marked with a b before the length specifier\n *\n * @param {Array} packets\n * @api private\n */\n\nexports.encodePayload = function (packets, supportsBinary, callback) {\n if (typeof supportsBinary == 'function') {\n callback = supportsBinary;\n supportsBinary = null;\n }\n\n var isBinary = hasBinary(packets);\n\n if (supportsBinary && isBinary) {\n if (Blob && !dontSendBlobs) {\n return exports.encodePayloadAsBlob(packets, callback);\n }\n\n return exports.encodePayloadAsArrayBuffer(packets, callback);\n }\n\n if (!packets.length) {\n return callback('0:');\n }\n\n function setLengthHeader(message) {\n return message.length + ':' + message;\n }\n\n function encodeOne(packet, doneCallback) {\n exports.encodePacket(packet, !isBinary ? false : supportsBinary, true, function(message) {\n doneCallback(null, setLengthHeader(message));\n });\n }\n\n map(packets, encodeOne, function(err, results) {\n return callback(results.join(''));\n });\n};\n\n/**\n * Async array map using after\n */\n\nfunction map(ary, each, done) {\n var result = new Array(ary.length);\n var next = after(ary.length, done);\n\n var eachWithIndex = function(i, el, cb) {\n each(el, function(error, msg) {\n result[i] = msg;\n cb(error, result);\n });\n };\n\n for (var i = 0; i < ary.length; i++) {\n eachWithIndex(i, ary[i], next);\n }\n}\n\n/*\n * Decodes data when a payload is maybe expected. Possible binary contents are\n * decoded from their base64 representation\n *\n * @param {String} data, callback method\n * @api public\n */\n\nexports.decodePayload = function (data, binaryType, callback) {\n if (typeof data != 'string') {\n return exports.decodePayloadAsBinary(data, binaryType, callback);\n }\n\n if (typeof binaryType === 'function') {\n callback = binaryType;\n binaryType = null;\n }\n\n var packet;\n if (data == '') {\n // parser error - ignoring payload\n return callback(err, 0, 1);\n }\n\n var length = ''\n , n, msg;\n\n for (var i = 0, l = data.length; i < l; i++) {\n var chr = data.charAt(i);\n\n if (':' != chr) {\n length += chr;\n } else {\n if ('' == length || (length != (n = Number(length)))) {\n // parser error - ignoring payload\n return callback(err, 0, 1);\n }\n\n msg = data.substr(i + 1, n);\n\n if (length != msg.length) {\n // parser error - ignoring payload\n return callback(err, 0, 1);\n }\n\n if (msg.length) {\n packet = exports.decodePacket(msg, binaryType, true);\n\n if (err.type == packet.type && err.data == packet.data) {\n // parser error in individual packet - ignoring payload\n return callback(err, 0, 1);\n }\n\n var ret = callback(packet, i + n, l);\n if (false === ret) return;\n }\n\n // advance cursor\n i += n;\n length = '';\n }\n }\n\n if (length != '') {\n // parser error - ignoring payload\n return callback(err, 0, 1);\n }\n\n};\n\n/**\n * Encodes multiple messages (payload) as binary.\n *\n * <1 = binary, 0 = string><number from 0-9><number from 0-9>[...]<number\n * 255><data>\n *\n * Example:\n * 1 3 255 1 2 3, if the binary contents are interpreted as 8 bit integers\n *\n * @param {Array} packets\n * @return {ArrayBuffer} encoded payload\n * @api private\n */\n\nexports.encodePayloadAsArrayBuffer = function(packets, callback) {\n if (!packets.length) {\n return callback(new ArrayBuffer(0));\n }\n\n function encodeOne(packet, doneCallback) {\n exports.encodePacket(packet, true, true, function(data) {\n return doneCallback(null, data);\n });\n }\n\n map(packets, encodeOne, function(err, encodedPackets) {\n var totalLength = encodedPackets.reduce(function(acc, p) {\n var len;\n if (typeof p === 'string'){\n len = p.length;\n } else {\n len = p.byteLength;\n }\n return acc + len.toString().length + len + 2; // string/binary identifier + separator = 2\n }, 0);\n\n var resultArray = new Uint8Array(totalLength);\n\n var bufferIndex = 0;\n encodedPackets.forEach(function(p) {\n var isString = typeof p === 'string';\n var ab = p;\n if (isString) {\n var view = new Uint8Array(p.length);\n for (var i = 0; i < p.length; i++) {\n view[i] = p.charCodeAt(i);\n }\n ab = view.buffer;\n }\n\n if (isString) { // not true binary\n resultArray[bufferIndex++] = 0;\n } else { // true binary\n resultArray[bufferIndex++] = 1;\n }\n\n var lenStr = ab.byteLength.toString();\n for (var i = 0; i < lenStr.length; i++) {\n resultArray[bufferIndex++] = parseInt(lenStr[i]);\n }\n resultArray[bufferIndex++] = 255;\n\n var view = new Uint8Array(ab);\n for (var i = 0; i < view.length; i++) {\n resultArray[bufferIndex++] = view[i];\n }\n });\n\n return callback(resultArray.buffer);\n });\n};\n\n/**\n * Encode as Blob\n */\n\nexports.encodePayloadAsBlob = function(packets, callback) {\n function encodeOne(packet, doneCallback) {\n exports.encodePacket(packet, true, true, function(encoded) {\n var binaryIdentifier = new Uint8Array(1);\n binaryIdentifier[0] = 1;\n if (typeof encoded === 'string') {\n var view = new Uint8Array(encoded.length);\n for (var i = 0; i < encoded.length; i++) {\n view[i] = encoded.charCodeAt(i);\n }\n encoded = view.buffer;\n binaryIdentifier[0] = 0;\n }\n\n var len = (encoded instanceof ArrayBuffer)\n ? encoded.byteLength\n : encoded.size;\n\n var lenStr = len.toString();\n var lengthAry = new Uint8Array(lenStr.length + 1);\n for (var i = 0; i < lenStr.length; i++) {\n lengthAry[i] = parseInt(lenStr[i]);\n }\n lengthAry[lenStr.length] = 255;\n\n if (Blob) {\n var blob = new Blob([binaryIdentifier.buffer, lengthAry.buffer, encoded]);\n doneCallback(null, blob);\n }\n });\n }\n\n map(packets, encodeOne, function(err, results) {\n return callback(new Blob(results));\n });\n};\n\n/*\n * Decodes data when a payload is maybe expected. Strings are decoded by\n * interpreting each byte as a key code for entries marked to start with 0. See\n * description of encodePayloadAsBinary\n *\n * @param {ArrayBuffer} data, callback method\n * @api public\n */\n\nexports.decodePayloadAsBinary = function (data, binaryType, callback) {\n if (typeof binaryType === 'function') {\n callback = binaryType;\n binaryType = null;\n }\n\n var bufferTail = data;\n var buffers = [];\n\n var numberTooLong = false;\n while (bufferTail.byteLength > 0) {\n var tailArray = new Uint8Array(bufferTail);\n var isString = tailArray[0] === 0;\n var msgLength = '';\n\n for (var i = 1; ; i++) {\n if (tailArray[i] == 255) break;\n\n if (msgLength.length > 310) {\n numberTooLong = true;\n break;\n }\n\n msgLength += tailArray[i];\n }\n\n if(numberTooLong) return callback(err, 0, 1);\n\n bufferTail = sliceBuffer(bufferTail, 2 + msgLength.length);\n msgLength = parseInt(msgLength);\n\n var msg = sliceBuffer(bufferTail, 0, msgLength);\n if (isString) {\n try {\n msg = String.fromCharCode.apply(null, new Uint8Array(msg));\n } catch (e) {\n // iPhone Safari doesn't let you apply to typed arrays\n var typed = new Uint8Array(msg);\n msg = '';\n for (var i = 0; i < typed.length; i++) {\n msg += String.fromCharCode(typed[i]);\n }\n }\n }\n\n buffers.push(msg);\n bufferTail = sliceBuffer(bufferTail, msgLength);\n }\n\n var total = buffers.length;\n buffers.forEach(function(buffer, i) {\n callback(exports.decodePacket(buffer, binaryType, true), i, total);\n });\n};\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n\n},{\"./keys\":23,\"after\":1,\"arraybuffer.slice\":2,\"base64-arraybuffer\":4,\"blob\":5,\"has-binary\":24,\"utf8\":44}],23:[function(require,module,exports){\n\n/**\n * Gets the keys for an object.\n *\n * @return {Array} keys\n * @api private\n */\n\nmodule.exports = Object.keys || function keys (obj){\n var arr = [];\n var has = Object.prototype.hasOwnProperty;\n\n for (var i in obj) {\n if (has.call(obj, i)) {\n arr.push(i);\n }\n }\n return arr;\n};\n\n},{}],24:[function(require,module,exports){\n(function (global){\n\n/*\n * Module requirements.\n */\n\nvar isArray = require('isarray');\n\n/**\n * Module exports.\n */\n\nmodule.exports = hasBinary;\n\n/**\n * Checks for binary data.\n *\n * Right now only Buffer and ArrayBuffer are supported..\n *\n * @param {Object} anything\n * @api public\n */\n\nfunction hasBinary(data) {\n\n function _hasBinary(obj) {\n if (!obj) return false;\n\n if ( (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer) ||\n (global.Blob && obj instanceof Blob) ||\n (global.File && obj instanceof File)\n ) {\n return true;\n }\n\n if (isArray(obj)) {\n for (var i = 0; i < obj.length; i++) {\n if (_hasBinary(obj[i])) {\n return true;\n }\n }\n } else if (obj && 'object' == typeof obj) {\n if (obj.toJSON) {\n obj = obj.toJSON();\n }\n\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key) && _hasBinary(obj[key])) {\n return true;\n }\n }\n }\n\n return false;\n }\n\n return _hasBinary(data);\n}\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n\n},{\"isarray\":28}],25:[function(require,module,exports){\n(function (global){\n\n/*\n * Module requirements.\n */\n\nvar isArray = require('isarray');\n\n/**\n * Module exports.\n */\n\nmodule.exports = hasBinary;\n\n/**\n * Checks for binary data.\n *\n * Right now only Buffer and ArrayBuffer are supported..\n *\n * @param {Object} anything\n * @api public\n */\n\nfunction hasBinary(data) {\n\n function _hasBinary(obj) {\n if (!obj) return false;\n\n if ( (global.Buffer && global.Buffer.isBuffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer) ||\n (global.Blob && obj instanceof Blob) ||\n (global.File && obj instanceof File)\n ) {\n return true;\n }\n\n if (isArray(obj)) {\n for (var i = 0; i < obj.length; i++) {\n if (_hasBinary(obj[i])) {\n return true;\n }\n }\n } else if (obj && 'object' == typeof obj) {\n // see: https://github.com/Automattic/has-binary/pull/4\n if (obj.toJSON && 'function' == typeof obj.toJSON) {\n obj = obj.toJSON();\n }\n\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key) && _hasBinary(obj[key])) {\n return true;\n }\n }\n }\n\n return false;\n }\n\n return _hasBinary(data);\n}\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n\n},{\"isarray\":28}],26:[function(require,module,exports){\n\n/**\n * Module exports.\n *\n * Logic borrowed from Modernizr:\n *\n * - https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cors.js\n */\n\ntry {\n module.exports = typeof XMLHttpRequest !== 'undefined' &&\n 'withCredentials' in new XMLHttpRequest();\n} catch (err) {\n // if XMLHttp support is disabled in IE then it will throw\n // when trying to create\n module.exports = false;\n}\n\n},{}],27:[function(require,module,exports){\n\nvar indexOf = [].indexOf;\n\nmodule.exports = function(arr, obj){\n if (indexOf) return arr.indexOf(obj);\n for (var i = 0; i < arr.length; ++i) {\n if (arr[i] === obj) return i;\n }\n return -1;\n};\n},{}],28:[function(require,module,exports){\nmodule.exports = Array.isArray || function (arr) {\n return Object.prototype.toString.call(arr) == '[object Array]';\n};\n\n},{}],29:[function(require,module,exports){\n(function (global){\n/*! JSON v3.3.2 | http://bestiejs.github.io/json3 | Copyright 2012-2014, Kit Cambridge | http://kit.mit-license.org */\n;(function () {\n // Detect the `define` function exposed by asynchronous module loaders. The\n // strict `define` check is necessary for compatibility with `r.js`.\n var isLoader = typeof define === \"function\" && define.amd;\n\n // A set of types used to distinguish objects from primitives.\n var objectTypes = {\n \"function\": true,\n \"object\": true\n };\n\n // Detect the `exports` object exposed by CommonJS implementations.\n var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports;\n\n // Use the `global` object exposed by Node (including Browserify via\n // `insert-module-globals`), Narwhal, and Ringo as the default context,\n // and the `window` object in browsers. Rhino exports a `global` function\n // instead.\n var root = objectTypes[typeof window] && window || this,\n freeGlobal = freeExports && objectTypes[typeof module] && module && !module.nodeType && typeof global == \"object\" && global;\n\n if (freeGlobal && (freeGlobal[\"global\"] === freeGlobal || freeGlobal[\"window\"] === freeGlobal || freeGlobal[\"self\"] === freeGlobal)) {\n root = freeGlobal;\n }\n\n // Public: Initializes JSON 3 using the given `context` object, attaching the\n // `stringify` and `parse` functions to the specified `exports` object.\n function runInContext(context, exports) {\n context || (context = root[\"Object\"]());\n exports || (exports = root[\"Object\"]());\n\n // Native constructor aliases.\n var Number = context[\"Number\"] || root[\"Number\"],\n String = context[\"String\"] || root[\"String\"],\n Object = context[\"Object\"] || root[\"Object\"],\n Date = context[\"Date\"] || root[\"Date\"],\n SyntaxError = context[\"SyntaxError\"] || root[\"SyntaxError\"],\n TypeError = context[\"TypeError\"] || root[\"TypeError\"],\n Math = context[\"Math\"] || root[\"Math\"],\n nativeJSON = context[\"JSON\"] || root[\"JSON\"];\n\n // Delegate to the native `stringify` and `parse` implementations.\n if (typeof nativeJSON == \"object\" && nativeJSON) {\n exports.stringify = nativeJSON.stringify;\n exports.parse = nativeJSON.parse;\n }\n\n // Convenience aliases.\n var objectProto = Object.prototype,\n getClass = objectProto.toString,\n isProperty, forEach, undef;\n\n // Test the `Date#getUTC*` methods. Based on work by @Yaffle.\n var isExtended = new Date(-3509827334573292);\n try {\n // The `getUTCFullYear`, `Month`, and `Date` methods return nonsensical\n // results for certain dates in Opera >= 10.53.\n isExtended = isExtended.getUTCFullYear() == -109252 && isExtended.getUTCMonth() === 0 && isExtended.getUTCDate() === 1 &&\n // Safari < 2.0.2 stores the internal millisecond time value correctly,\n // but clips the values returned by the date methods to the range of\n // signed 32-bit integers ([-2 ** 31, 2 ** 31 - 1]).\n isExtended.getUTCHours() == 10 && isExtended.getUTCMinutes() == 37 && isExtended.getUTCSeconds() == 6 && isExtended.getUTCMilliseconds() == 708;\n } catch (exception) {}\n\n // Internal: Determines whether the native `JSON.stringify` and `parse`\n // implementations are spec-compliant. Based on work by Ken Snyder.\n function has(name) {\n if (has[name] !== undef) {\n // Return cached feature test result.\n return has[name];\n }\n var isSupported;\n if (name == \"bug-string-char-index\") {\n // IE <= 7 doesn't support accessing string characters using square\n // bracket notation. IE 8 only supports this for primitives.\n isSupported = \"a\"[0] != \"a\";\n } else if (name == \"json\") {\n // Indicates whether both `JSON.stringify` and `JSON.parse` are\n // supported.\n isSupported = has(\"json-stringify\") && has(\"json-parse\");\n } else {\n var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n // Test `JSON.stringify`.\n if (name == \"json-stringify\") {\n var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n if (stringifySupported) {\n // A test function object with a custom `toJSON` method.\n (value = function () {\n return 1;\n }).toJSON = value;\n try {\n stringifySupported =\n // Firefox 3.1b1 and b2 serialize string, number, and boolean\n // primitives as object literals.\n stringify(0) === \"0\" &&\n // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n // literals.\n stringify(new Number()) === \"0\" &&\n stringify(new String()) == '\"\"' &&\n // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n // does not define a canonical JSON representation (this applies to\n // objects with `toJSON` properties as well, *unless* they are nested\n // within an object or array).\n stringify(getClass) === undef &&\n // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n // FF 3.1b3 pass this test.\n stringify(undef) === undef &&\n // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n // respectively, if the value is omitted entirely.\n stringify() === undef &&\n // FF 3.1b1, 2 throw an error if the given value is not a number,\n // string, array, object, Boolean, or `null` literal. This applies to\n // objects with custom `toJSON` methods as well, unless they are nested\n // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n // methods entirely.\n stringify(value) === \"1\" &&\n stringify([value]) == \"[1]\" &&\n // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n // `\"[null]\"`.\n stringify([undef]) == \"[null]\" &&\n // YUI 3.0.0b1 fails to serialize `null` literals.\n stringify(null) == \"null\" &&\n // FF 3.1b1, 2 halts serialization if an array contains a function:\n // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n // elides non-JSON values from objects and arrays, unless they\n // define custom `toJSON` methods.\n stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n stringify(null, value) === \"1\" &&\n stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n // serialize extended years.\n stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n // The milliseconds are optional in ES 5, but required in 5.1.\n stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n // four-digit years instead of six-digit years. Credits: @Yaffle.\n stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n // values less than 1000. Credits: @Yaffle.\n stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n } catch (exception) {\n stringifySupported = false;\n }\n }\n isSupported = stringifySupported;\n }\n // Test `JSON.parse`.\n if (name == \"json-parse\") {\n var parse = exports.parse;\n if (typeof parse == \"function\") {\n try {\n // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n // Conforming implementations should also coerce the initial argument to\n // a string prior to parsing.\n if (parse(\"0\") === 0 && !parse(false)) {\n // Simple parsing test.\n value = parse(serialized);\n var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n if (parseSupported) {\n try {\n // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n parseSupported = !parse('\"\\t\"');\n } catch (exception) {}\n if (parseSupported) {\n try {\n // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n // certain octal literals.\n parseSupported = parse(\"01\") !== 1;\n } catch (exception) {}\n }\n if (parseSupported) {\n try {\n // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n // points. These environments, along with FF 3.1b1 and 2,\n // also allow trailing commas in JSON objects and arrays.\n parseSupported = parse(\"1.\") !== 1;\n } catch (exception) {}\n }\n }\n }\n } catch (exception) {\n parseSupported = false;\n }\n }\n isSupported = parseSupported;\n }\n }\n return has[name] = !!isSupported;\n }\n\n if (!has(\"json\")) {\n // Common `[[Class]]` name aliases.\n var functionClass = \"[object Function]\",\n dateClass = \"[object Date]\",\n numberClass = \"[object Number]\",\n stringClass = \"[object String]\",\n arrayClass = \"[object Array]\",\n booleanClass = \"[object Boolean]\";\n\n // Detect incomplete support for accessing string characters by index.\n var charIndexBuggy = has(\"bug-string-char-index\");\n\n // Define additional utility methods if the `Date` methods are buggy.\n if (!isExtended) {\n var floor = Math.floor;\n // A mapping between the months of the year and the number of days between\n // January 1st and the first of the respective month.\n var Months = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334];\n // Internal: Calculates the number of days between the Unix epoch and the\n // first day of the given month.\n var getDay = function (year, month) {\n return Months[month] + 365 * (year - 1970) + floor((year - 1969 + (month = +(month > 1))) / 4) - floor((year - 1901 + month) / 100) + floor((year - 1601 + month) / 400);\n };\n }\n\n // Internal: Determines if a property is a direct property of the given\n // object. Delegates to the native `Object#hasOwnProperty` method.\n if (!(isProperty = objectProto.hasOwnProperty)) {\n isProperty = function (property) {\n var members = {}, constructor;\n if ((members.__proto__ = null, members.__proto__ = {\n // The *proto* property cannot be set multiple times in recent\n // versions of Firefox and SeaMonkey.\n \"toString\": 1\n }, members).toString != getClass) {\n // Safari <= 2.0.3 doesn't implement `Object#hasOwnProperty`, but\n // supports the mutable *proto* property.\n isProperty = function (property) {\n // Capture and break the object's prototype chain (see section 8.6.2\n // of the ES 5.1 spec). The parenthesized expression prevents an\n // unsafe transformation by the Closure Compiler.\n var original = this.__proto__, result = property in (this.__proto__ = null, this);\n // Restore the original prototype chain.\n this.__proto__ = original;\n return result;\n };\n } else {\n // Capture a reference to the top-level `Object` constructor.\n constructor = members.constructor;\n // Use the `constructor` property to simulate `Object#hasOwnProperty` in\n // other environments.\n isProperty = function (property) {\n var parent = (this.constructor || constructor).prototype;\n return property in this && !(property in parent && this[property] === parent[property]);\n };\n }\n members = null;\n return isProperty.call(this, property);\n };\n }\n\n // Internal: Normalizes the `for...in` iteration algorithm across\n // environments. Each enumerated key is yielded to a `callback` function.\n forEach = function (object, callback) {\n var size = 0, Properties, members, property;\n\n // Tests for bugs in the current environment's `for...in` algorithm. The\n // `valueOf` property inherits the non-enumerable flag from\n // `Object.prototype` in older versions of IE, Netscape, and Mozilla.\n (Properties = function () {\n this.valueOf = 0;\n }).prototype.valueOf = 0;\n\n // Iterate over a new instance of the `Properties` class.\n members = new Properties();\n for (property in members) {\n // Ignore all properties inherited from `Object.prototype`.\n if (isProperty.call(members, property)) {\n size++;\n }\n }\n Properties = members = null;\n\n // Normalize the iteration algorithm.\n if (!size) {\n // A list of non-enumerable properties inherited from `Object.prototype`.\n members = [\"valueOf\", \"toString\", \"toLocaleString\", \"propertyIsEnumerable\", \"isPrototypeOf\", \"hasOwnProperty\", \"constructor\"];\n // IE <= 8, Mozilla 1.0, and Netscape 6.2 ignore shadowed non-enumerable\n // properties.\n forEach = function (object, callback) {\n var isFunction = getClass.call(object) == functionClass, property, length;\n var hasProperty = !isFunction && typeof object.constructor != \"function\" && objectTypes[typeof object.hasOwnProperty] && object.hasOwnProperty || isProperty;\n for (property in object) {\n // Gecko <= 1.0 enumerates the `prototype` property of functions under\n // certain conditions; IE does not.\n if (!(isFunction && property == \"prototype\") && hasProperty.call(object, property)) {\n callback(property);\n }\n }\n // Manually invoke the callback for each non-enumerable property.\n for (length = members.length; property = members[--length]; hasProperty.call(object, property) && callback(property));\n };\n } else if (size == 2) {\n // Safari <= 2.0.4 enumerates shadowed properties twice.\n forEach = function (object, callback) {\n // Create a set of iterated properties.\n var members = {}, isFunction = getClass.call(object) == functionClass, property;\n for (property in object) {\n // Store each property name to prevent double enumeration. The\n // `prototype` property of functions is not enumerated due to cross-\n // environment inconsistencies.\n if (!(isFunction && property == \"prototype\") && !isProperty.call(members, property) && (members[property] = 1) && isProperty.call(object, property)) {\n callback(property);\n }\n }\n };\n } else {\n // No bugs detected; use the standard `for...in` algorithm.\n forEach = function (object, callback) {\n var isFunction = getClass.call(object) == functionClass, property, isConstructor;\n for (property in object) {\n if (!(isFunction && property == \"prototype\") && isProperty.call(object, property) && !(isConstructor = property === \"constructor\")) {\n callback(property);\n }\n }\n // Manually invoke the callback for the `constructor` property due to\n // cross-environment inconsistencies.\n if (isConstructor || isProperty.call(object, (property = \"constructor\"))) {\n callback(property);\n }\n };\n }\n return forEach(object, callback);\n };\n\n // Public: Serializes a JavaScript `value` as a JSON string. The optional\n // `filter` argument may specify either a function that alters how object and\n // array members are serialized, or an array of strings and numbers that\n // indicates which properties should be serialized. The optional `width`\n // argument may be either a string or number that specifies the indentation\n // level of the output.\n if (!has(\"json-stringify\")) {\n // Internal: A map of control characters and their escaped equivalents.\n var Escapes = {\n 92: \"\\\\\\\\\",\n 34: '\\\\\"',\n 8: \"\\\\b\",\n 12: \"\\\\f\",\n 10: \"\\\\n\",\n 13: \"\\\\r\",\n 9: \"\\\\t\"\n };\n\n // Internal: Converts `value` into a zero-padded string such that its\n // length is at least equal to `width`. The `width` must be <= 6.\n var leadingZeroes = \"000000\";\n var toPaddedString = function (width, value) {\n // The `|| 0` expression is necessary to work around a bug in\n // Opera <= 7.54u2 where `0 == -0`, but `String(-0) !== \"0\"`.\n return (leadingZeroes + (value || 0)).slice(-width);\n };\n\n // Internal: Double-quotes a string `value`, replacing all ASCII control\n // characters (characters with code unit values between 0 and 31) with\n // their escaped equivalents. This is an implementation of the\n // `Quote(value)` operation defined in ES 5.1 section 15.12.3.\n var unicodePrefix = \"\\\\u00\";\n var quote = function (value) {\n var result = '\"', index = 0, length = value.length, useCharIndex = !charIndexBuggy || length > 10;\n var symbols = useCharIndex && (charIndexBuggy ? value.split(\"\") : value);\n for (; index < length; index++) {\n var charCode = value.charCodeAt(index);\n // If the character is a control character, append its Unicode or\n // shorthand escape sequence; otherwise, append the character as-is.\n switch (charCode) {\n case 8: case 9: case 10: case 12: case 13: case 34: case 92:\n result += Escapes[charCode];\n break;\n default:\n if (charCode < 32) {\n result += unicodePrefix + toPaddedString(2, charCode.toString(16));\n break;\n }\n result += useCharIndex ? symbols[index] : value.charAt(index);\n }\n }\n return result + '\"';\n };\n\n // Internal: Recursively serializes an object. Implements the\n // `Str(key, holder)`, `JO(value)`, and `JA(value)` operations.\n var serialize = function (property, object, callback, properties, whitespace, indentation, stack) {\n var value, className, year, month, date, time, hours, minutes, seconds, milliseconds, results, element, index, length, prefix, result;\n try {\n // Necessary for host object support.\n value = object[property];\n } catch (exception) {}\n if (typeof value == \"object\" && value) {\n className = getClass.call(value);\n if (className == dateClass && !isProperty.call(value, \"toJSON\")) {\n if (value > -1 / 0 && value < 1 / 0) {\n // Dates are serialized according to the `Date#toJSON` method\n // specified in ES 5.1 section 15.9.5.44. See section 15.9.1.15\n // for the ISO 8601 date time string format.\n if (getDay) {\n // Manually compute the year, month, date, hours, minutes,\n // seconds, and milliseconds if the `getUTC*` methods are\n // buggy. Adapted from @Yaffle's `date-shim` project.\n date = floor(value / 864e5);\n for (year = floor(date / 365.2425) + 1970 - 1; getDay(year + 1, 0) <= date; year++);\n for (month = floor((date - getDay(year, 0)) / 30.42); getDay(year, month + 1) <= date; month++);\n date = 1 + date - getDay(year, month);\n // The `time` value specifies the time within the day (see ES\n // 5.1 section 15.9.1.2). The formula `(A % B + B) % B` is used\n // to compute `A modulo B`, as the `%` operator does not\n // correspond to the `modulo` operation for negative numbers.\n time = (value % 864e5 + 864e5) % 864e5;\n // The hours, minutes, seconds, and milliseconds are obtained by\n // decomposing the time within the day. See section 15.9.1.10.\n hours = floor(time / 36e5) % 24;\n minutes = floor(time / 6e4) % 60;\n seconds = floor(time / 1e3) % 60;\n milliseconds = time % 1e3;\n } else {\n year = value.getUTCFullYear();\n month = value.getUTCMonth();\n date = value.getUTCDate();\n hours = value.getUTCHours();\n minutes = value.getUTCMinutes();\n seconds = value.getUTCSeconds();\n milliseconds = value.getUTCMilliseconds();\n }\n // Serialize extended years correctly.\n value = (year <= 0 || year >= 1e4 ? (year < 0 ? \"-\" : \"+\") + toPaddedString(6, year < 0 ? -year : year) : toPaddedString(4, year)) +\n \"-\" + toPaddedString(2, month + 1) + \"-\" + toPaddedString(2, date) +\n // Months, dates, hours, minutes, and seconds should have two\n // digits; milliseconds should have three.\n \"T\" + toPaddedString(2, hours) + \":\" + toPaddedString(2, minutes) + \":\" + toPaddedString(2, seconds) +\n // Milliseconds are optional in ES 5.0, but required in 5.1.\n \".\" + toPaddedString(3, milliseconds) + \"Z\";\n } else {\n value = null;\n }\n } else if (typeof value.toJSON == \"function\" && ((className != numberClass && className != stringClass && className != arrayClass) || isProperty.call(value, \"toJSON\"))) {\n // Prototype <= 1.6.1 adds non-standard `toJSON` methods to the\n // `Number`, `String`, `Date`, and `Array` prototypes. JSON 3\n // ignores all `toJSON` methods on these objects unless they are\n // defined directly on an instance.\n value = value.toJSON(property);\n }\n }\n if (callback) {\n // If a replacement function was provided, call it to obtain the value\n // for serialization.\n value = callback.call(object, property, value);\n }\n if (value === null) {\n return \"null\";\n }\n className = getClass.call(value);\n if (className == booleanClass) {\n // Booleans are represented literally.\n return \"\" + value;\n } else if (className == numberClass) {\n // JSON numbers must be finite. `Infinity` and `NaN` are serialized as\n // `\"null\"`.\n return value > -1 / 0 && value < 1 / 0 ? \"\" + value : \"null\";\n } else if (className == stringClass) {\n // Strings are double-quoted and escaped.\n return quote(\"\" + value);\n }\n // Recursively serialize objects and arrays.\n if (typeof value == \"object\") {\n // Check for cyclic structures. This is a linear search; performance\n // is inversely proportional to the number of unique nested objects.\n for (length = stack.length; length--;) {\n if (stack[length] === value) {\n // Cyclic structures cannot be serialized by `JSON.stringify`.\n throw TypeError();\n }\n }\n // Add the object to the stack of traversed objects.\n stack.push(value);\n results = [];\n // Save the current indentation level and indent one additional level.\n prefix = indentation;\n indentation += whitespace;\n if (className == arrayClass) {\n // Recursively serialize array elements.\n for (index = 0, length = value.length; index < length; index++) {\n element = serialize(index, value, callback, properties, whitespace, indentation, stack);\n results.push(element === undef ? \"null\" : element);\n }\n result = results.length ? (whitespace ? \"[\\n\" + indentation + results.join(\",\\n\" + indentation) + \"\\n\" + prefix + \"]\" : (\"[\" + results.join(\",\") + \"]\")) : \"[]\";\n } else {\n // Recursively serialize object members. Members are selected from\n // either a user-specified list of property names, or the object\n // itself.\n forEach(properties || value, function (property) {\n var element = serialize(property, value, callback, properties, whitespace, indentation, stack);\n if (element !== undef) {\n // According to ES 5.1 section 15.12.3: \"If `gap` {whitespace}\n // is not the empty string, let `member` {quote(property) + \":\"}\n // be the concatenation of `member` and the `space` character.\"\n // The \"`space` character\" refers to the literal space\n // character, not the `space` {width} argument provided to\n // `JSON.stringify`.\n results.push(quote(property) + \":\" + (whitespace ? \" \" : \"\") + element);\n }\n });\n result = results.length ? (whitespace ? \"{\\n\" + indentation + results.join(\",\\n\" + indentation) + \"\\n\" + prefix + \"}\" : (\"{\" + results.join(\",\") + \"}\")) : \"{}\";\n }\n // Remove the object from the traversed object stack.\n stack.pop();\n return result;\n }\n };\n\n // Public: `JSON.stringify`. See ES 5.1 section 15.12.3.\n exports.stringify = function (source, filter, width) {\n var whitespace, callback, properties, className;\n if (objectTypes[typeof filter] && filter) {\n if ((className = getClass.call(filter)) == functionClass) {\n callback = filter;\n } else if (className == arrayClass) {\n // Convert the property names array into a makeshift set.\n properties = {};\n for (var index = 0, length = filter.length, value; index < length; value = filter[index++], ((className = getClass.call(value)), className == stringClass || className == numberClass) && (properties[value] = 1));\n }\n }\n if (width) {\n if ((className = getClass.call(width)) == numberClass) {\n // Convert the `width` to an integer and create a string containing\n // `width` number of space characters.\n if ((width -= width % 1) > 0) {\n for (whitespace = \"\", width > 10 && (width = 10); whitespace.length < width; whitespace += \" \");\n }\n } else if (className == stringClass) {\n whitespace = width.length <= 10 ? width : width.slice(0, 10);\n }\n }\n // Opera <= 7.54u2 discards the values associated with empty string keys\n // (`\"\"`) only if they are used directly within an object member list\n // (e.g., `!(\"\" in { \"\": 1})`).\n return serialize(\"\", (value = {}, value[\"\"] = source, value), callback, properties, whitespace, \"\", []);\n };\n }\n\n // Public: Parses a JSON source string.\n if (!has(\"json-parse\")) {\n var fromCharCode = String.fromCharCode;\n\n // Internal: A map of escaped control characters and their unescaped\n // equivalents.\n var Unescapes = {\n 92: \"\\\\\",\n 34: '\"',\n 47: \"/\",\n 98: \"\\b\",\n 116: \"\\t\",\n 110: \"\\n\",\n 102: \"\\f\",\n 114: \"\\r\"\n };\n\n // Internal: Stores the parser state.\n var Index, Source;\n\n // Internal: Resets the parser state and throws a `SyntaxError`.\n var abort = function () {\n Index = Source = null;\n throw SyntaxError();\n };\n\n // Internal: Returns the next token, or `\"$\"` if the parser has reached\n // the end of the source string. A token may be a string, number, `null`\n // literal, or Boolean literal.\n var lex = function () {\n var source = Source, length = source.length, value, begin, position, isSigned, charCode;\n while (Index < length) {\n charCode = source.charCodeAt(Index);\n switch (charCode) {\n case 9: case 10: case 13: case 32:\n // Skip whitespace tokens, including tabs, carriage returns, line\n // feeds, and space characters.\n Index++;\n break;\n case 123: case 125: case 91: case 93: case 58: case 44:\n // Parse a punctuator token (`{`, `}`, `[`, `]`, `:`, or `,`) at\n // the current position.\n value = charIndexBuggy ? source.charAt(Index) : source[Index];\n Index++;\n return value;\n case 34:\n // `\"` delimits a JSON string; advance to the next character and\n // begin parsing the string. String tokens are prefixed with the\n // sentinel `@` character to distinguish them from punctuators and\n // end-of-string tokens.\n for (value = \"@\", Index++; Index < length;) {\n charCode = source.charCodeAt(Index);\n if (charCode < 32) {\n // Unescaped ASCII control characters (those with a code unit\n // less than the space character) are not permitted.\n abort();\n } else if (charCode == 92) {\n // A reverse solidus (`\\`) marks the beginning of an escaped\n // control character (including `\"`, `\\`, and `/`) or Unicode\n // escape sequence.\n charCode = source.charCodeAt(++Index);\n switch (charCode) {\n case 92: case 34: case 47: case 98: case 116: case 110: case 102: case 114:\n // Revive escaped control characters.\n value += Unescapes[charCode];\n Index++;\n break;\n case 117:\n // `\\u` marks the beginning of a Unicode escape sequence.\n // Advance to the first character and validate the\n // four-digit code point.\n begin = ++Index;\n for (position = Index + 4; Index < position; Index++) {\n charCode = source.charCodeAt(Index);\n // A valid sequence comprises four hexdigits (case-\n // insensitive) that form a single hexadecimal value.\n if (!(charCode >= 48 && charCode <= 57 || charCode >= 97 && charCode <= 102 || charCode >= 65 && charCode <= 70)) {\n // Invalid Unicode escape sequence.\n abort();\n }\n }\n // Revive the escaped character.\n value += fromCharCode(\"0x\" + source.slice(begin, Index));\n break;\n default:\n // Invalid escape sequence.\n abort();\n }\n } else {\n if (charCode == 34) {\n // An unescaped double-quote character marks the end of the\n // string.\n break;\n }\n charCode = source.charCodeAt(Index);\n begin = Index;\n // Optimize for the common case where a string is valid.\n while (charCode >= 32 && charCode != 92 && charCode != 34) {\n charCode = source.charCodeAt(++Index);\n }\n // Append the string as-is.\n value += source.slice(begin, Index);\n }\n }\n if (source.charCodeAt(Index) == 34) {\n // Advance to the next character and return the revived string.\n Index++;\n return value;\n }\n // Unterminated string.\n abort();\n default:\n // Parse numbers and literals.\n begin = Index;\n // Advance past the negative sign, if one is specified.\n if (charCode == 45) {\n isSigned = true;\n charCode = source.charCodeAt(++Index);\n }\n // Parse an integer or floating-point value.\n if (charCode >= 48 && charCode <= 57) {\n // Leading zeroes are interpreted as octal literals.\n if (charCode == 48 && ((charCode = source.charCodeAt(Index + 1)), charCode >= 48 && charCode <= 57)) {\n // Illegal octal literal.\n abort();\n }\n isSigned = false;\n // Parse the integer component.\n for (; Index < length && ((charCode = source.charCodeAt(Index)), charCode >= 48 && charCode <= 57); Index++);\n // Floats cannot contain a leading decimal point; however, this\n // case is already accounted for by the parser.\n if (source.charCodeAt(Index) == 46) {\n position = ++Index;\n // Parse the decimal component.\n for (; position < length && ((charCode = source.charCodeAt(position)), charCode >= 48 && charCode <= 57); position++);\n if (position == Index) {\n // Illegal trailing decimal.\n abort();\n }\n Index = position;\n }\n // Parse exponents. The `e` denoting the exponent is\n // case-insensitive.\n charCode = source.charCodeAt(Index);\n if (charCode == 101 || charCode == 69) {\n charCode = source.charCodeAt(++Index);\n // Skip past the sign following the exponent, if one is\n // specified.\n if (charCode == 43 || charCode == 45) {\n Index++;\n }\n // Parse the exponential component.\n for (position = Index; position < length && ((charCode = source.charCodeAt(position)), charCode >= 48 && charCode <= 57); position++);\n if (position == Index) {\n // Illegal empty exponent.\n abort();\n }\n Index = position;\n }\n // Coerce the parsed value to a JavaScript number.\n return +source.slice(begin, Index);\n }\n // A negative sign may only precede numbers.\n if (isSigned) {\n abort();\n }\n // `true`, `false`, and `null` literals.\n if (source.slice(Index, Index + 4) == \"true\") {\n Index += 4;\n return true;\n } else if (source.slice(Index, Index + 5) == \"false\") {\n Index += 5;\n return false;\n } else if (source.slice(Index, Index + 4) == \"null\") {\n Index += 4;\n return null;\n }\n // Unrecognized token.\n abort();\n }\n }\n // Return the sentinel `$` character if the parser has reached the end\n // of the source string.\n return \"$\";\n };\n\n // Internal: Parses a JSON `value` token.\n var get = function (value) {\n var results, hasMembers;\n if (value == \"$\") {\n // Unexpected end of input.\n abort();\n }\n if (typeof value == \"string\") {\n if ((charIndexBuggy ? value.charAt(0) : value[0]) == \"@\") {\n // Remove the sentinel `@` character.\n return value.slice(1);\n }\n // Parse object and array literals.\n if (value == \"[\") {\n // Parses a JSON array, returning a new JavaScript array.\n results = [];\n for (;; hasMembers || (hasMembers = true)) {\n value = lex();\n // A closing square bracket marks the end of the array literal.\n if (value == \"]\") {\n break;\n }\n // If the array literal contains elements, the current token\n // should be a comma separating the previous element from the\n // next.\n if (hasMembers) {\n if (value == \",\") {\n value = lex();\n if (value == \"]\") {\n // Unexpected trailing `,` in array literal.\n abort();\n }\n } else {\n // A `,` must separate each array element.\n abort();\n }\n }\n // Elisions and leading commas are not permitted.\n if (value == \",\") {\n abort();\n }\n results.push(get(value));\n }\n return results;\n } else if (value == \"{\") {\n // Parses a JSON object, returning a new JavaScript object.\n results = {};\n for (;; hasMembers || (hasMembers = true)) {\n value = lex();\n // A closing curly brace marks the end of the object literal.\n if (value == \"}\") {\n break;\n }\n // If the object literal contains members, the current token\n // should be a comma separator.\n if (hasMembers) {\n if (value == \",\") {\n value = lex();\n if (value == \"}\") {\n // Unexpected trailing `,` in object literal.\n abort();\n }\n } else {\n // A `,` must separate each object member.\n abort();\n }\n }\n // Leading commas are not permitted, object property names must be\n // double-quoted strings, and a `:` must separate each property\n // name and value.\n if (value == \",\" || typeof value != \"string\" || (charIndexBuggy ? value.charAt(0) : value[0]) != \"@\" || lex() != \":\") {\n abort();\n }\n results[value.slice(1)] = get(lex());\n }\n return results;\n }\n // Unexpected token encountered.\n abort();\n }\n return value;\n };\n\n // Internal: Updates a traversed object member.\n var update = function (source, property, callback) {\n var element = walk(source, property, callback);\n if (element === undef) {\n delete source[property];\n } else {\n source[property] = element;\n }\n };\n\n // Internal: Recursively traverses a parsed JSON object, invoking the\n // `callback` function for each value. This is an implementation of the\n // `Walk(holder, name)` operation defined in ES 5.1 section 15.12.2.\n var walk = function (source, property, callback) {\n var value = source[property], length;\n if (typeof value == \"object\" && value) {\n // `forEach` can't be used to traverse an array in Opera <= 8.54\n // because its `Object#hasOwnProperty` implementation returns `false`\n // for array indices (e.g., `![1, 2, 3].hasOwnProperty(\"0\")`).\n if (getClass.call(value) == arrayClass) {\n for (length = value.length; length--;) {\n update(value, length, callback);\n }\n } else {\n forEach(value, function (property) {\n update(value, property, callback);\n });\n }\n }\n return callback.call(source, property, value);\n };\n\n // Public: `JSON.parse`. See ES 5.1 section 15.12.2.\n exports.parse = function (source, callback) {\n var result, value;\n Index = 0;\n Source = \"\" + source;\n result = get(lex());\n // If a JSON string contains multiple tokens, it is invalid.\n if (lex() != \"$\") {\n abort();\n }\n // Reset the parser state.\n Index = Source = null;\n return callback && getClass.call(callback) == functionClass ? walk((value = {}, value[\"\"] = result, value), \"\", callback) : result;\n };\n }\n }\n\n exports[\"runInContext\"] = runInContext;\n return exports;\n }\n\n if (freeExports && !isLoader) {\n // Export for CommonJS environments.\n runInContext(root, freeExports);\n } else {\n // Export for web browsers and JavaScript engines.\n var nativeJSON = root.JSON,\n previousJSON = root[\"JSON3\"],\n isRestored = false;\n\n var JSON3 = runInContext(root, (root[\"JSON3\"] = {\n // Public: Restores the original value of the global `JSON` object and\n // returns a reference to the `JSON3` object.\n \"noConflict\": function () {\n if (!isRestored) {\n isRestored = true;\n root.JSON = nativeJSON;\n root[\"JSON3\"] = previousJSON;\n nativeJSON = previousJSON = null;\n }\n return JSON3;\n }\n }));\n\n root.JSON = {\n \"parse\": JSON3.parse,\n \"stringify\": JSON3.stringify\n };\n }\n\n // Export for asynchronous module loaders.\n if (isLoader) {\n define(function () {\n return JSON3;\n });\n }\n}).call(this);\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n\n},{}],30:[function(require,module,exports){\n/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} options\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options){\n options = options || {};\n if ('string' == typeof val) return parse(val);\n return options.long\n ? long(val)\n : short(val);\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = '' + str;\n if (str.length > 10000) return;\n var match = /^((?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str);\n if (!match) return;\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction short(ms) {\n if (ms >= d) return Math.round(ms / d) + 'd';\n if (ms >= h) return Math.round(ms / h) + 'h';\n if (ms >= m) return Math.round(ms / m) + 'm';\n if (ms >= s) return Math.round(ms / s) + 's';\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction long(ms) {\n return plural(ms, d, 'day')\n || plural(ms, h, 'hour')\n || plural(ms, m, 'minute')\n || plural(ms, s, 'second')\n || ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, n, name) {\n if (ms < n) return;\n if (ms < n * 1.5) return Math.floor(ms / n) + ' ' + name;\n return Math.ceil(ms / n) + ' ' + name + 's';\n}\n\n},{}],31:[function(require,module,exports){\n(function (global){\n/**\n * JSON parse.\n *\n * @see Based on jQuery#parseJSON (MIT) and JSON2\n * @api private\n */\n\nvar rvalidchars = /^[\\],:{}\\s]*$/;\nvar rvalidescape = /\\\\(?:[\"\\\\\\/bfnrt]|u[0-9a-fA-F]{4})/g;\nvar rvalidtokens = /\"[^\"\\\\\\n\\r]*\"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/g;\nvar rvalidbraces = /(?:^|:|,)(?:\\s*\\[)+/g;\nvar rtrimLeft = /^\\s+/;\nvar rtrimRight = /\\s+$/;\n\nmodule.exports = function parsejson(data) {\n if ('string' != typeof data || !data) {\n return null;\n }\n\n data = data.replace(rtrimLeft, '').replace(rtrimRight, '');\n\n // Attempt to parse using the native JSON parser first\n if (global.JSON && JSON.parse) {\n return JSON.parse(data);\n }\n\n if (rvalidchars.test(data.replace(rvalidescape, '@')\n .replace(rvalidtokens, ']')\n .replace(rvalidbraces, ''))) {\n return (new Function('return ' + data))();\n }\n};\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n\n},{}],32:[function(require,module,exports){\n/**\n * Compiles a querystring\n * Returns string representation of the object\n *\n * @param {Object}\n * @api private\n */\n\nexports.encode = function (obj) {\n var str = '';\n\n for (var i in obj) {\n if (obj.hasOwnProperty(i)) {\n if (str.length) str += '&';\n str += encodeURIComponent(i) + '=' + encodeURIComponent(obj[i]);\n }\n }\n\n return str;\n};\n\n/**\n * Parses a simple querystring into an object\n *\n * @param {String} qs\n * @api private\n */\n\nexports.decode = function(qs){\n var qry = {};\n var pairs = qs.split('&');\n for (var i = 0, l = pairs.length; i < l; i++) {\n var pair = pairs[i].split('=');\n qry[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);\n }\n return qry;\n};\n\n},{}],33:[function(require,module,exports){\n/**\n * Parses an URI\n *\n * @author Steven Levithan <stevenlevithan.com> (MIT license)\n * @api private\n */\n\nvar re = /^(?:(?![^:@]+:[^:@\\/]*@)(http|https|ws|wss):\\/\\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\\/?#]*)(?::(\\d*))?)(((\\/(?:[^?#](?![^?#\\/]*\\.[^?#\\/.]+(?:[?#]|$)))*\\/?)?([^?#\\/]*))(?:\\?([^#]*))?(?:#(.*))?)/;\n\nvar parts = [\n 'source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor'\n];\n\nmodule.exports = function parseuri(str) {\n var src = str,\n b = str.indexOf('['),\n e = str.indexOf(']');\n\n if (b != -1 && e != -1) {\n str = str.substring(0, b) + str.substring(b, e).replace(/:/g, ';') + str.substring(e, str.length);\n }\n\n var m = re.exec(str || ''),\n uri = {},\n i = 14;\n\n while (i--) {\n uri[parts[i]] = m[i] || '';\n }\n\n if (b != -1 && e != -1) {\n uri.source = src;\n uri.host = uri.host.substring(1, uri.host.length - 1).replace(/;/g, ':');\n uri.authority = uri.authority.replace('[', '').replace(']', '').replace(/;/g, ':');\n uri.ipv6uri = true;\n }\n\n return uri;\n};\n\n},{}],34:[function(require,module,exports){\n\n/**\n * Module dependencies.\n */\n\nvar url = require('./url');\nvar parser = require('socket.io-parser');\nvar Manager = require('./manager');\nvar debug = require('debug')('socket.io-client');\n\n/**\n * Module exports.\n */\n\nmodule.exports = exports = lookup;\n\n/**\n * Managers cache.\n */\n\nvar cache = exports.managers = {};\n\n/**\n * Looks up an existing `Manager` for multiplexing.\n * If the user summons:\n *\n * `io('http://localhost/a');`\n * `io('http://localhost/b');`\n *\n * We reuse the existing instance based on same scheme/port/host,\n * and we initialize sockets for each namespace.\n *\n * @api public\n */\n\nfunction lookup(uri, opts) {\n if (typeof uri == 'object') {\n opts = uri;\n uri = undefined;\n }\n\n opts = opts || {};\n\n var parsed = url(uri);\n var source = parsed.source;\n var id = parsed.id;\n var path = parsed.path;\n var sameNamespace = cache[id] && path in cache[id].nsps;\n var newConnection = opts.forceNew || opts['force new connection'] ||\n false === opts.multiplex || sameNamespace;\n\n var io;\n\n if (newConnection) {\n debug('ignoring socket cache for %s', source);\n io = Manager(source, opts);\n } else {\n if (!cache[id]) {\n debug('new io instance for %s', source);\n cache[id] = Manager(source, opts);\n }\n io = cache[id];\n }\n\n return io.socket(parsed.path);\n}\n\n/**\n * Protocol version.\n *\n * @api public\n */\n\nexports.protocol = parser.protocol;\n\n/**\n * `connect`.\n *\n * @param {String} uri\n * @api public\n */\n\nexports.connect = lookup;\n\n/**\n * Expose constructors for standalone build.\n *\n * @api public\n */\n\nexports.Manager = require('./manager');\nexports.Socket = require('./socket');\n\n},{\"./manager\":35,\"./socket\":37,\"./url\":38,\"debug\":9,\"socket.io-parser\":40}],35:[function(require,module,exports){\n\n/**\n * Module dependencies.\n */\n\nvar eio = require('engine.io-client');\nvar Socket = require('./socket');\nvar Emitter = require('component-emitter');\nvar parser = require('socket.io-parser');\nvar on = require('./on');\nvar bind = require('component-bind');\nvar debug = require('debug')('socket.io-client:manager');\nvar indexOf = require('indexof');\nvar Backoff = require('backo2');\n\n/**\n * IE6+ hasOwnProperty\n */\n\nvar has = Object.prototype.hasOwnProperty;\n\n/**\n * Module exports\n */\n\nmodule.exports = Manager;\n\n/**\n * `Manager` constructor.\n *\n * @param {String} engine instance or engine uri/opts\n * @param {Object} options\n * @api public\n */\n\nfunction Manager(uri, opts){\n if (!(this instanceof Manager)) return new Manager(uri, opts);\n if (uri && ('object' == typeof uri)) {\n opts = uri;\n uri = undefined;\n }\n opts = opts || {};\n\n opts.path = opts.path || '/socket.io';\n this.nsps = {};\n this.subs = [];\n this.opts = opts;\n this.reconnection(opts.reconnection !== false);\n this.reconnectionAttempts(opts.reconnectionAttempts || Infinity);\n this.reconnectionDelay(opts.reconnectionDelay || 1000);\n this.reconnectionDelayMax(opts.reconnectionDelayMax || 5000);\n this.randomizationFactor(opts.randomizationFactor || 0.5);\n this.backoff = new Backoff({\n min: this.reconnectionDelay(),\n max: this.reconnectionDelayMax(),\n jitter: this.randomizationFactor()\n });\n this.timeout(null == opts.timeout ? 20000 : opts.timeout);\n this.readyState = 'closed';\n this.uri = uri;\n this.connecting = [];\n this.lastPing = null;\n this.encoding = false;\n this.packetBuffer = [];\n this.encoder = new parser.Encoder();\n this.decoder = new parser.Decoder();\n this.autoConnect = opts.autoConnect !== false;\n if (this.autoConnect) this.open();\n}\n\n/**\n * Propagate given event to sockets and emit on `this`\n *\n * @api private\n */\n\nManager.prototype.emitAll = function() {\n this.emit.apply(this, arguments);\n for (var nsp in this.nsps) {\n if (has.call(this.nsps, nsp)) {\n this.nsps[nsp].emit.apply(this.nsps[nsp], arguments);\n }\n }\n};\n\n/**\n * Update `socket.id` of all sockets\n *\n * @api private\n */\n\nManager.prototype.updateSocketIds = function(){\n for (var nsp in this.nsps) {\n if (has.call(this.nsps, nsp)) {\n this.nsps[nsp].id = this.engine.id;\n }\n }\n};\n\n/**\n * Mix in `Emitter`.\n */\n\nEmitter(Manager.prototype);\n\n/**\n * Sets the `reconnection` config.\n *\n * @param {Boolean} true/false if it should automatically reconnect\n * @return {Manager} self or value\n * @api public\n */\n\nManager.prototype.reconnection = function(v){\n if (!arguments.length) return this._reconnection;\n this._reconnection = !!v;\n return this;\n};\n\n/**\n * Sets the reconnection attempts config.\n *\n * @param {Number} max reconnection attempts before giving up\n * @return {Manager} self or value\n * @api public\n */\n\nManager.prototype.reconnectionAttempts = function(v){\n if (!arguments.length) return this._reconnectionAttempts;\n this._reconnectionAttempts = v;\n return this;\n};\n\n/**\n * Sets the delay between reconnections.\n *\n * @param {Number} delay\n * @return {Manager} self or value\n * @api public\n */\n\nManager.prototype.reconnectionDelay = function(v){\n if (!arguments.length) return this._reconnectionDelay;\n this._reconnectionDelay = v;\n this.backoff && this.backoff.setMin(v);\n return this;\n};\n\nManager.prototype.randomizationFactor = function(v){\n if (!arguments.length) return this._randomizationFactor;\n this._randomizationFactor = v;\n this.backoff && this.backoff.setJitter(v);\n return this;\n};\n\n/**\n * Sets the maximum delay between reconnections.\n *\n * @param {Number} delay\n * @return {Manager} self or value\n * @api public\n */\n\nManager.prototype.reconnectionDelayMax = function(v){\n if (!arguments.length) return this._reconnectionDelayMax;\n this._reconnectionDelayMax = v;\n this.backoff && this.backoff.setMax(v);\n return this;\n};\n\n/**\n * Sets the connection timeout. `false` to disable\n *\n * @return {Manager} self or value\n * @api public\n */\n\nManager.prototype.timeout = function(v){\n if (!arguments.length) return this._timeout;\n this._timeout = v;\n return this;\n};\n\n/**\n * Starts trying to reconnect if reconnection is enabled and we have not\n * started reconnecting yet\n *\n * @api private\n */\n\nManager.prototype.maybeReconnectOnOpen = function() {\n // Only try to reconnect if it's the first time we're connecting\n if (!this.reconnecting && this._reconnection && this.backoff.attempts === 0) {\n // keeps reconnection from firing twice for the same reconnection loop\n this.reconnect();\n }\n};\n\n\n/**\n * Sets the current transport `socket`.\n *\n * @param {Function} optional, callback\n * @return {Manager} self\n * @api public\n */\n\nManager.prototype.open =\nManager.prototype.connect = function(fn){\n debug('readyState %s', this.readyState);\n if (~this.readyState.indexOf('open')) return this;\n\n debug('opening %s', this.uri);\n this.engine = eio(this.uri, this.opts);\n var socket = this.engine;\n var self = this;\n this.readyState = 'opening';\n this.skipReconnect = false;\n\n // emit `open`\n var openSub = on(socket, 'open', function() {\n self.onopen();\n fn && fn();\n });\n\n // emit `connect_error`\n var errorSub = on(socket, 'error', function(data){\n debug('connect_error');\n self.cleanup();\n self.readyState = 'closed';\n self.emitAll('connect_error', data);\n if (fn) {\n var err = new Error('Connection error');\n err.data = data;\n fn(err);\n } else {\n // Only do this if there is no fn to handle the error\n self.maybeReconnectOnOpen();\n }\n });\n\n // emit `connect_timeout`\n if (false !== this._timeout) {\n var timeout = this._timeout;\n debug('connect attempt will timeout after %d', timeout);\n\n // set timer\n var timer = setTimeout(function(){\n debug('connect attempt timed out after %d', timeout);\n openSub.destroy();\n socket.close();\n socket.emit('error', 'timeout');\n self.emitAll('connect_timeout', timeout);\n }, timeout);\n\n this.subs.push({\n destroy: function(){\n clearTimeout(timer);\n }\n });\n }\n\n this.subs.push(openSub);\n this.subs.push(errorSub);\n\n return this;\n};\n\n/**\n * Called upon transport open.\n *\n * @api private\n */\n\nManager.prototype.onopen = function(){\n debug('open');\n\n // clear old subs\n this.cleanup();\n\n // mark as open\n this.readyState = 'open';\n this.emit('open');\n\n // add new subs\n var socket = this.engine;\n this.subs.push(on(socket, 'data', bind(this, 'ondata')));\n this.subs.push(on(socket, 'ping', bind(this, 'onping')));\n this.subs.push(on(socket, 'pong', bind(this, 'onpong')));\n this.subs.push(on(socket, 'error', bind(this, 'onerror')));\n this.subs.push(on(socket, 'close', bind(this, 'onclose')));\n this.subs.push(on(this.decoder, 'decoded', bind(this, 'ondecoded')));\n};\n\n/**\n * Called upon a ping.\n *\n * @api private\n */\n\nManager.prototype.onping = function(){\n this.lastPing = new Date;\n this.emitAll('ping');\n};\n\n/**\n * Called upon a packet.\n *\n * @api private\n */\n\nManager.prototype.onpong = function(){\n this.emitAll('pong', new Date - this.lastPing);\n};\n\n/**\n * Called with data.\n *\n * @api private\n */\n\nManager.prototype.ondata = function(data){\n this.decoder.add(data);\n};\n\n/**\n * Called when parser fully decodes a packet.\n *\n * @api private\n */\n\nManager.prototype.ondecoded = function(packet) {\n this.emit('packet', packet);\n};\n\n/**\n * Called upon socket error.\n *\n * @api private\n */\n\nManager.prototype.onerror = function(err){\n debug('error', err);\n this.emitAll('error', err);\n};\n\n/**\n * Creates a new socket for the given `nsp`.\n *\n * @return {Socket}\n * @api public\n */\n\nManager.prototype.socket = function(nsp){\n var socket = this.nsps[nsp];\n if (!socket) {\n socket = new Socket(this, nsp);\n this.nsps[nsp] = socket;\n var self = this;\n socket.on('connecting', onConnecting);\n socket.on('connect', function(){\n socket.id = self.engine.id;\n });\n\n if (this.autoConnect) {\n // manually call here since connecting evnet is fired before listening\n onConnecting();\n }\n }\n\n function onConnecting() {\n if (!~indexOf(self.connecting, socket)) {\n self.connecting.push(socket);\n }\n }\n\n return socket;\n};\n\n/**\n * Called upon a socket close.\n *\n * @param {Socket} socket\n */\n\nManager.prototype.destroy = function(socket){\n var index = indexOf(this.connecting, socket);\n if (~index) this.connecting.splice(index, 1);\n if (this.connecting.length) return;\n\n this.close();\n};\n\n/**\n * Writes a packet.\n *\n * @param {Object} packet\n * @api private\n */\n\nManager.prototype.packet = function(packet){\n debug('writing packet %j', packet);\n var self = this;\n\n if (!self.encoding) {\n // encode, then write to engine with result\n self.encoding = true;\n this.encoder.encode(packet, function(encodedPackets) {\n for (var i = 0; i < encodedPackets.length; i++) {\n self.engine.write(encodedPackets[i], packet.options);\n }\n self.encoding = false;\n self.processPacketQueue();\n });\n } else { // add packet to the queue\n self.packetBuffer.push(packet);\n }\n};\n\n/**\n * If packet buffer is non-empty, begins encoding the\n * next packet in line.\n *\n * @api private\n */\n\nManager.prototype.processPacketQueue = function() {\n if (this.packetBuffer.length > 0 && !this.encoding) {\n var pack = this.packetBuffer.shift();\n this.packet(pack);\n }\n};\n\n/**\n * Clean up transport subscriptions and packet buffer.\n *\n * @api private\n */\n\nManager.prototype.cleanup = function(){\n debug('cleanup');\n\n var sub;\n while (sub = this.subs.shift()) sub.destroy();\n\n this.packetBuffer = [];\n this.encoding = false;\n this.lastPing = null;\n\n this.decoder.destroy();\n};\n\n/**\n * Close the current socket.\n *\n * @api private\n */\n\nManager.prototype.close =\nManager.prototype.disconnect = function(){\n debug('disconnect');\n this.skipReconnect = true;\n this.reconnecting = false;\n if ('opening' == this.readyState) {\n // `onclose` will not fire because\n // an open event never happened\n this.cleanup();\n }\n this.backoff.reset();\n this.readyState = 'closed';\n if (this.engine) this.engine.close();\n};\n\n/**\n * Called upon engine close.\n *\n * @api private\n */\n\nManager.prototype.onclose = function(reason){\n debug('onclose');\n\n this.cleanup();\n this.backoff.reset();\n this.readyState = 'closed';\n this.emit('close', reason);\n\n if (this._reconnection && !this.skipReconnect) {\n this.reconnect();\n }\n};\n\n/**\n * Attempt a reconnection.\n *\n * @api private\n */\n\nManager.prototype.reconnect = function(){\n if (this.reconnecting || this.skipReconnect) return this;\n\n var self = this;\n\n if (this.backoff.attempts >= this._reconnectionAttempts) {\n debug('reconnect failed');\n this.backoff.reset();\n this.emitAll('reconnect_failed');\n this.reconnecting = false;\n } else {\n var delay = this.backoff.duration();\n debug('will wait %dms before reconnect attempt', delay);\n\n this.reconnecting = true;\n var timer = setTimeout(function(){\n if (self.skipReconnect) return;\n\n debug('attempting reconnect');\n self.emitAll('reconnect_attempt', self.backoff.attempts);\n self.emitAll('reconnecting', self.backoff.attempts);\n\n // check again for the case socket closed in above events\n if (self.skipReconnect) return;\n\n self.open(function(err){\n if (err) {\n debug('reconnect attempt error');\n self.reconnecting = false;\n self.reconnect();\n self.emitAll('reconnect_error', err.data);\n } else {\n debug('reconnect success');\n self.onreconnect();\n }\n });\n }, delay);\n\n this.subs.push({\n destroy: function(){\n clearTimeout(timer);\n }\n });\n }\n};\n\n/**\n * Called upon successful reconnect.\n *\n * @api private\n */\n\nManager.prototype.onreconnect = function(){\n var attempt = this.backoff.attempts;\n this.reconnecting = false;\n this.backoff.reset();\n this.updateSocketIds();\n this.emitAll('reconnect', attempt);\n};\n\n},{\"./on\":36,\"./socket\":37,\"backo2\":3,\"component-bind\":6,\"component-emitter\":7,\"debug\":9,\"engine.io-client\":11,\"indexof\":27,\"socket.io-parser\":40}],36:[function(require,module,exports){\n\n/**\n * Module exports.\n */\n\nmodule.exports = on;\n\n/**\n * Helper for subscriptions.\n *\n * @param {Object|EventEmitter} obj with `Emitter` mixin or `EventEmitter`\n * @param {String} event name\n * @param {Function} callback\n * @api public\n */\n\nfunction on(obj, ev, fn) {\n obj.on(ev, fn);\n return {\n destroy: function(){\n obj.removeListener(ev, fn);\n }\n };\n}\n\n},{}],37:[function(require,module,exports){\n\n/**\n * Module dependencies.\n */\n\nvar parser = require('socket.io-parser');\nvar Emitter = require('component-emitter');\nvar toArray = require('to-array');\nvar on = require('./on');\nvar bind = require('component-bind');\nvar debug = require('debug')('socket.io-client:socket');\nvar hasBin = require('has-binary');\n\n/**\n * Module exports.\n */\n\nmodule.exports = exports = Socket;\n\n/**\n * Internal events (blacklisted).\n * These events can't be emitted by the user.\n *\n * @api private\n */\n\nvar events = {\n connect: 1,\n connect_error: 1,\n connect_timeout: 1,\n connecting: 1,\n disconnect: 1,\n error: 1,\n reconnect: 1,\n reconnect_attempt: 1,\n reconnect_failed: 1,\n reconnect_error: 1,\n reconnecting: 1,\n ping: 1,\n pong: 1\n};\n\n/**\n * Shortcut to `Emitter#emit`.\n */\n\nvar emit = Emitter.prototype.emit;\n\n/**\n * `Socket` constructor.\n *\n * @api public\n */\n\nfunction Socket(io, nsp){\n this.io = io;\n this.nsp = nsp;\n this.json = this; // compat\n this.ids = 0;\n this.acks = {};\n this.receiveBuffer = [];\n this.sendBuffer = [];\n this.connected = false;\n this.disconnected = true;\n if (this.io.autoConnect) this.open();\n}\n\n/**\n * Mix in `Emitter`.\n */\n\nEmitter(Socket.prototype);\n\n/**\n * Subscribe to open, close and packet events\n *\n * @api private\n */\n\nSocket.prototype.subEvents = function() {\n if (this.subs) return;\n\n var io = this.io;\n this.subs = [\n on(io, 'open', bind(this, 'onopen')),\n on(io, 'packet', bind(this, 'onpacket')),\n on(io, 'close', bind(this, 'onclose'))\n ];\n};\n\n/**\n * \"Opens\" the socket.\n *\n * @api public\n */\n\nSocket.prototype.open =\nSocket.prototype.connect = function(){\n if (this.connected) return this;\n\n this.subEvents();\n this.io.open(); // ensure open\n if ('open' == this.io.readyState) this.onopen();\n this.emit('connecting');\n return this;\n};\n\n/**\n * Sends a `message` event.\n *\n * @return {Socket} self\n * @api public\n */\n\nSocket.prototype.send = function(){\n var args = toArray(arguments);\n args.unshift('message');\n this.emit.apply(this, args);\n return this;\n};\n\n/**\n * Override `emit`.\n * If the event is in `events`, it's emitted normally.\n *\n * @param {String} event name\n * @return {Socket} self\n * @api public\n */\n\nSocket.prototype.emit = function(ev){\n if (events.hasOwnProperty(ev)) {\n emit.apply(this, arguments);\n return this;\n }\n\n var args = toArray(arguments);\n var parserType = parser.EVENT; // default\n if (hasBin(args)) { parserType = parser.BINARY_EVENT; } // binary\n var packet = { type: parserType, data: args };\n\n packet.options = {};\n packet.options.compress = !this.flags || false !== this.flags.compress;\n\n // event ack callback\n if ('function' == typeof args[args.length - 1]) {\n debug('emitting packet with ack id %d', this.ids);\n this.acks[this.ids] = args.pop();\n packet.id = this.ids++;\n }\n\n if (this.connected) {\n this.packet(packet);\n } else {\n this.sendBuffer.push(packet);\n }\n\n delete this.flags;\n\n return this;\n};\n\n/**\n * Sends a packet.\n *\n * @param {Object} packet\n * @api private\n */\n\nSocket.prototype.packet = function(packet){\n packet.nsp = this.nsp;\n this.io.packet(packet);\n};\n\n/**\n * Called upon engine `open`.\n *\n * @api private\n */\n\nSocket.prototype.onopen = function(){\n debug('transport is open - connecting');\n\n // write connect packet if necessary\n if ('/' != this.nsp) {\n this.packet({ type: parser.CONNECT });\n }\n};\n\n/**\n * Called upon engine `close`.\n *\n * @param {String} reason\n * @api private\n */\n\nSocket.prototype.onclose = function(reason){\n debug('close (%s)', reason);\n this.connected = false;\n this.disconnected = true;\n delete this.id;\n this.emit('disconnect', reason);\n};\n\n/**\n * Called with socket packet.\n *\n * @param {Object} packet\n * @api private\n */\n\nSocket.prototype.onpacket = function(packet){\n if (packet.nsp != this.nsp) return;\n\n switch (packet.type) {\n case parser.CONNECT:\n this.onconnect();\n break;\n\n case parser.EVENT:\n this.onevent(packet);\n break;\n\n case parser.BINARY_EVENT:\n this.onevent(packet);\n break;\n\n case parser.ACK:\n this.onack(packet);\n break;\n\n case parser.BINARY_ACK:\n this.onack(packet);\n break;\n\n case parser.DISCONNECT:\n this.ondisconnect();\n break;\n\n case parser.ERROR:\n this.emit('error', packet.data);\n break;\n }\n};\n\n/**\n * Called upon a server event.\n *\n * @param {Object} packet\n * @api private\n */\n\nSocket.prototype.onevent = function(packet){\n var args = packet.data || [];\n debug('emitting event %j', args);\n\n if (null != packet.id) {\n debug('attaching ack callback to event');\n args.push(this.ack(packet.id));\n }\n\n if (this.connected) {\n emit.apply(this, args);\n } else {\n this.receiveBuffer.push(args);\n }\n};\n\n/**\n * Produces an ack callback to emit with an event.\n *\n * @api private\n */\n\nSocket.prototype.ack = function(id){\n var self = this;\n var sent = false;\n return function(){\n // prevent double callbacks\n if (sent) return;\n sent = true;\n var args = toArray(arguments);\n debug('sending ack %j', args);\n\n var type = hasBin(args) ? parser.BINARY_ACK : parser.ACK;\n self.packet({\n type: type,\n id: id,\n data: args\n });\n };\n};\n\n/**\n * Called upon a server acknowlegement.\n *\n * @param {Object} packet\n * @api private\n */\n\nSocket.prototype.onack = function(packet){\n var ack = this.acks[packet.id];\n if ('function' == typeof ack) {\n debug('calling ack %s with %j', packet.id, packet.data);\n ack.apply(this, packet.data);\n delete this.acks[packet.id];\n } else {\n debug('bad ack %s', packet.id);\n }\n};\n\n/**\n * Called upon server connect.\n *\n * @api private\n */\n\nSocket.prototype.onconnect = function(){\n this.connected = true;\n this.disconnected = false;\n this.emit('connect');\n this.emitBuffered();\n};\n\n/**\n * Emit buffered events (received and emitted).\n *\n * @api private\n */\n\nSocket.prototype.emitBuffered = function(){\n var i;\n for (i = 0; i < this.receiveBuffer.length; i++) {\n emit.apply(this, this.receiveBuffer[i]);\n }\n this.receiveBuffer = [];\n\n for (i = 0; i < this.sendBuffer.length; i++) {\n this.packet(this.sendBuffer[i]);\n }\n this.sendBuffer = [];\n};\n\n/**\n * Called upon server disconnect.\n *\n * @api private\n */\n\nSocket.prototype.ondisconnect = function(){\n debug('server disconnect (%s)', this.nsp);\n this.destroy();\n this.onclose('io server disconnect');\n};\n\n/**\n * Called upon forced client/server side disconnections,\n * this method ensures the manager stops tracking us and\n * that reconnections don't get triggered for this.\n *\n * @api private.\n */\n\nSocket.prototype.destroy = function(){\n if (this.subs) {\n // clean subscriptions to avoid reconnections\n for (var i = 0; i < this.subs.length; i++) {\n this.subs[i].destroy();\n }\n this.subs = null;\n }\n\n this.io.destroy(this);\n};\n\n/**\n * Disconnects the socket manually.\n *\n * @return {Socket} self\n * @api public\n */\n\nSocket.prototype.close =\nSocket.prototype.disconnect = function(){\n if (this.connected) {\n debug('performing disconnect (%s)', this.nsp);\n this.packet({ type: parser.DISCONNECT });\n }\n\n // remove socket from pool\n this.destroy();\n\n if (this.connected) {\n // fire events\n this.onclose('io client disconnect');\n }\n return this;\n};\n\n/**\n * Sets the compress flag.\n *\n * @param {Boolean} if `true`, compresses the sending data\n * @return {Socket} self\n * @api public\n */\n\nSocket.prototype.compress = function(compress){\n this.flags = this.flags || {};\n this.flags.compress = compress;\n return this;\n};\n\n},{\"./on\":36,\"component-bind\":6,\"component-emitter\":7,\"debug\":9,\"has-binary\":25,\"socket.io-parser\":40,\"to-array\":43}],38:[function(require,module,exports){\n(function (global){\n\n/**\n * Module dependencies.\n */\n\nvar parseuri = require('parseuri');\nvar debug = require('debug')('socket.io-client:url');\n\n/**\n * Module exports.\n */\n\nmodule.exports = url;\n\n/**\n * URL parser.\n *\n * @param {String} url\n * @param {Object} An object meant to mimic window.location.\n * Defaults to window.location.\n * @api public\n */\n\nfunction url(uri, loc){\n var obj = uri;\n\n // default to window.location\n var loc = loc || global.location;\n if (null == uri) uri = loc.protocol + '//' + loc.host;\n\n // relative path support\n if ('string' == typeof uri) {\n if ('/' == uri.charAt(0)) {\n if ('/' == uri.charAt(1)) {\n uri = loc.protocol + uri;\n } else {\n uri = loc.host + uri;\n }\n }\n\n if (!/^(https?|wss?):\\/\\//.test(uri)) {\n debug('protocol-less url %s', uri);\n if ('undefined' != typeof loc) {\n uri = loc.protocol + '//' + uri;\n } else {\n uri = 'https://' + uri;\n }\n }\n\n // parse\n debug('parse %s', uri);\n obj = parseuri(uri);\n }\n\n // make sure we treat `localhost:80` and `localhost` equally\n if (!obj.port) {\n if (/^(http|ws)$/.test(obj.protocol)) {\n obj.port = '80';\n }\n else if (/^(http|ws)s$/.test(obj.protocol)) {\n obj.port = '443';\n }\n }\n\n obj.path = obj.path || '/';\n\n var ipv6 = obj.host.indexOf(':') !== -1;\n var host = ipv6 ? '[' + obj.host + ']' : obj.host;\n\n // define unique id\n obj.id = obj.protocol + '://' + host + ':' + obj.port;\n // define href\n obj.href = obj.protocol + '://' + host + (loc && loc.port == obj.port ? '' : (':' + obj.port));\n\n return obj;\n}\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n\n},{\"debug\":9,\"parseuri\":33}],39:[function(require,module,exports){\n(function (global){\n/*global Blob,File*/\n\n/**\n * Module requirements\n */\n\nvar isArray = require('isarray');\nvar isBuf = require('./is-buffer');\n\n/**\n * Replaces every Buffer | ArrayBuffer in packet with a numbered placeholder.\n * Anything with blobs or files should be fed through removeBlobs before coming\n * here.\n *\n * @param {Object} packet - socket.io event packet\n * @return {Object} with deconstructed packet and list of buffers\n * @api public\n */\n\nexports.deconstructPacket = function(packet){\n var buffers = [];\n var packetData = packet.data;\n\n function _deconstructPacket(data) {\n if (!data) return data;\n\n if (isBuf(data)) {\n var placeholder = { _placeholder: true, num: buffers.length };\n buffers.push(data);\n return placeholder;\n } else if (isArray(data)) {\n var newData = new Array(data.length);\n for (var i = 0; i < data.length; i++) {\n newData[i] = _deconstructPacket(data[i]);\n }\n return newData;\n } else if ('object' == typeof data && !(data instanceof Date)) {\n var newData = {};\n for (var key in data) {\n newData[key] = _deconstructPacket(data[key]);\n }\n return newData;\n }\n return data;\n }\n\n var pack = packet;\n pack.data = _deconstructPacket(packetData);\n pack.attachments = buffers.length; // number of binary 'attachments'\n return {packet: pack, buffers: buffers};\n};\n\n/**\n * Reconstructs a binary packet from its placeholder packet and buffers\n *\n * @param {Object} packet - event packet with placeholders\n * @param {Array} buffers - binary buffers to put in placeholder positions\n * @return {Object} reconstructed packet\n * @api public\n */\n\nexports.reconstructPacket = function(packet, buffers) {\n var curPlaceHolder = 0;\n\n function _reconstructPacket(data) {\n if (data && data._placeholder) {\n var buf = buffers[data.num]; // appropriate buffer (should be natural order anyway)\n return buf;\n } else if (isArray(data)) {\n for (var i = 0; i < data.length; i++) {\n data[i] = _reconstructPacket(data[i]);\n }\n return data;\n } else if (data && 'object' == typeof data) {\n for (var key in data) {\n data[key] = _reconstructPacket(data[key]);\n }\n return data;\n }\n return data;\n }\n\n packet.data = _reconstructPacket(packet.data);\n packet.attachments = undefined; // no longer useful\n return packet;\n};\n\n/**\n * Asynchronously removes Blobs or Files from data via\n * FileReader's readAsArrayBuffer method. Used before encoding\n * data as msgpack. Calls callback with the blobless data.\n *\n * @param {Object} data\n * @param {Function} callback\n * @api private\n */\n\nexports.removeBlobs = function(data, callback) {\n function _removeBlobs(obj, curKey, containingObject) {\n if (!obj) return obj;\n\n // convert any blob\n if ((global.Blob && obj instanceof Blob) ||\n (global.File && obj instanceof File)) {\n pendingBlobs++;\n\n // async filereader\n var fileReader = new FileReader();\n fileReader.onload = function() { // this.result == arraybuffer\n if (containingObject) {\n containingObject[curKey] = this.result;\n }\n else {\n bloblessData = this.result;\n }\n\n // if nothing pending its callback time\n if(! --pendingBlobs) {\n callback(bloblessData);\n }\n };\n\n fileReader.readAsArrayBuffer(obj); // blob -> arraybuffer\n } else if (isArray(obj)) { // handle array\n for (var i = 0; i < obj.length; i++) {\n _removeBlobs(obj[i], i, obj);\n }\n } else if (obj && 'object' == typeof obj && !isBuf(obj)) { // and object\n for (var key in obj) {\n _removeBlobs(obj[key], key, obj);\n }\n }\n }\n\n var pendingBlobs = 0;\n var bloblessData = data;\n _removeBlobs(bloblessData);\n if (!pendingBlobs) {\n callback(bloblessData);\n }\n};\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n\n},{\"./is-buffer\":41,\"isarray\":28}],40:[function(require,module,exports){\n\n/**\n * Module dependencies.\n */\n\nvar debug = require('debug')('socket.io-parser');\nvar json = require('json3');\nvar isArray = require('isarray');\nvar Emitter = require('component-emitter');\nvar binary = require('./binary');\nvar isBuf = require('./is-buffer');\n\n/**\n * Protocol version.\n *\n * @api public\n */\n\nexports.protocol = 4;\n\n/**\n * Packet types.\n *\n * @api public\n */\n\nexports.types = [\n 'CONNECT',\n 'DISCONNECT',\n 'EVENT',\n 'BINARY_EVENT',\n 'ACK',\n 'BINARY_ACK',\n 'ERROR'\n];\n\n/**\n * Packet type `connect`.\n *\n * @api public\n */\n\nexports.CONNECT = 0;\n\n/**\n * Packet type `disconnect`.\n *\n * @api public\n */\n\nexports.DISCONNECT = 1;\n\n/**\n * Packet type `event`.\n *\n * @api public\n */\n\nexports.EVENT = 2;\n\n/**\n * Packet type `ack`.\n *\n * @api public\n */\n\nexports.ACK = 3;\n\n/**\n * Packet type `error`.\n *\n * @api public\n */\n\nexports.ERROR = 4;\n\n/**\n * Packet type 'binary event'\n *\n * @api public\n */\n\nexports.BINARY_EVENT = 5;\n\n/**\n * Packet type `binary ack`. For acks with binary arguments.\n *\n * @api public\n */\n\nexports.BINARY_ACK = 6;\n\n/**\n * Encoder constructor.\n *\n * @api public\n */\n\nexports.Encoder = Encoder;\n\n/**\n * Decoder constructor.\n *\n * @api public\n */\n\nexports.Decoder = Decoder;\n\n/**\n * A socket.io Encoder instance\n *\n * @api public\n */\n\nfunction Encoder() {}\n\n/**\n * Encode a packet as a single string if non-binary, or as a\n * buffer sequence, depending on packet type.\n *\n * @param {Object} obj - packet object\n * @param {Function} callback - function to handle encodings (likely engine.write)\n * @return Calls callback with Array of encodings\n * @api public\n */\n\nEncoder.prototype.encode = function(obj, callback){\n debug('encoding packet %j', obj);\n\n if (exports.BINARY_EVENT == obj.type || exports.BINARY_ACK == obj.type) {\n encodeAsBinary(obj, callback);\n }\n else {\n var encoding = encodeAsString(obj);\n callback([encoding]);\n }\n};\n\n/**\n * Encode packet as string.\n *\n * @param {Object} packet\n * @return {String} encoded\n * @api private\n */\n\nfunction encodeAsString(obj) {\n var str = '';\n var nsp = false;\n\n // first is type\n str += obj.type;\n\n // attachments if we have them\n if (exports.BINARY_EVENT == obj.type || exports.BINARY_ACK == obj.type) {\n str += obj.attachments;\n str += '-';\n }\n\n // if we have a namespace other than `/`\n // we append it followed by a comma `,`\n if (obj.nsp && '/' != obj.nsp) {\n nsp = true;\n str += obj.nsp;\n }\n\n // immediately followed by the id\n if (null != obj.id) {\n if (nsp) {\n str += ',';\n nsp = false;\n }\n str += obj.id;\n }\n\n // json data\n if (null != obj.data) {\n if (nsp) str += ',';\n str += json.stringify(obj.data);\n }\n\n debug('encoded %j as %s', obj, str);\n return str;\n}\n\n/**\n * Encode packet as 'buffer sequence' by removing blobs, and\n * deconstructing packet into object with placeholders and\n * a list of buffers.\n *\n * @param {Object} packet\n * @return {Buffer} encoded\n * @api private\n */\n\nfunction encodeAsBinary(obj, callback) {\n\n function writeEncoding(bloblessData) {\n var deconstruction = binary.deconstructPacket(bloblessData);\n var pack = encodeAsString(deconstruction.packet);\n var buffers = deconstruction.buffers;\n\n buffers.unshift(pack); // add packet info to beginning of data list\n callback(buffers); // write all the buffers\n }\n\n binary.removeBlobs(obj, writeEncoding);\n}\n\n/**\n * A socket.io Decoder instance\n *\n * @return {Object} decoder\n * @api public\n */\n\nfunction Decoder() {\n this.reconstructor = null;\n}\n\n/**\n * Mix in `Emitter` with Decoder.\n */\n\nEmitter(Decoder.prototype);\n\n/**\n * Decodes an ecoded packet string into packet JSON.\n *\n * @param {String} obj - encoded packet\n * @return {Object} packet\n * @api public\n */\n\nDecoder.prototype.add = function(obj) {\n var packet;\n if ('string' == typeof obj) {\n packet = decodeString(obj);\n if (exports.BINARY_EVENT == packet.type || exports.BINARY_ACK == packet.type) { // binary packet's json\n this.reconstructor = new BinaryReconstructor(packet);\n\n // no attachments, labeled binary but no binary data to follow\n if (this.reconstructor.reconPack.attachments === 0) {\n this.emit('decoded', packet);\n }\n } else { // non-binary full packet\n this.emit('decoded', packet);\n }\n }\n else if (isBuf(obj) || obj.base64) { // raw binary data\n if (!this.reconstructor) {\n throw new Error('got binary data when not reconstructing a packet');\n } else {\n packet = this.reconstructor.takeBinaryData(obj);\n if (packet) { // received final buffer\n this.reconstructor = null;\n this.emit('decoded', packet);\n }\n }\n }\n else {\n throw new Error('Unknown type: ' + obj);\n }\n};\n\n/**\n * Decode a packet String (JSON data)\n *\n * @param {String} str\n * @return {Object} packet\n * @api private\n */\n\nfunction decodeString(str) {\n var p = {};\n var i = 0;\n\n // look up type\n p.type = Number(str.charAt(0));\n if (null == exports.types[p.type]) return error();\n\n // look up attachments if type binary\n if (exports.BINARY_EVENT == p.type || exports.BINARY_ACK == p.type) {\n var buf = '';\n while (str.charAt(++i) != '-') {\n buf += str.charAt(i);\n if (i == str.length) break;\n }\n if (buf != Number(buf) || str.charAt(i) != '-') {\n throw new Error('Illegal attachments');\n }\n p.attachments = Number(buf);\n }\n\n // look up namespace (if any)\n if ('/' == str.charAt(i + 1)) {\n p.nsp = '';\n while (++i) {\n var c = str.charAt(i);\n if (',' == c) break;\n p.nsp += c;\n if (i == str.length) break;\n }\n } else {\n p.nsp = '/';\n }\n\n // look up id\n var next = str.charAt(i + 1);\n if ('' !== next && Number(next) == next) {\n p.id = '';\n while (++i) {\n var c = str.charAt(i);\n if (null == c || Number(c) != c) {\n --i;\n break;\n }\n p.id += str.charAt(i);\n if (i == str.length) break;\n }\n p.id = Number(p.id);\n }\n\n // look up json data\n if (str.charAt(++i)) {\n try {\n p.data = json.parse(str.substr(i));\n } catch(e){\n return error();\n }\n }\n\n debug('decoded %s as %j', str, p);\n return p;\n}\n\n/**\n * Deallocates a parser's resources\n *\n * @api public\n */\n\nDecoder.prototype.destroy = function() {\n if (this.reconstructor) {\n this.reconstructor.finishedReconstruction();\n }\n};\n\n/**\n * A manager of a binary event's 'buffer sequence'. Should\n * be constructed whenever a packet of type BINARY_EVENT is\n * decoded.\n *\n * @param {Object} packet\n * @return {BinaryReconstructor} initialized reconstructor\n * @api private\n */\n\nfunction BinaryReconstructor(packet) {\n this.reconPack = packet;\n this.buffers = [];\n}\n\n/**\n * Method to be called when binary data received from connection\n * after a BINARY_EVENT packet.\n *\n * @param {Buffer | ArrayBuffer} binData - the raw binary data received\n * @return {null | Object} returns null if more binary data is expected or\n * a reconstructed packet object if all buffers have been received.\n * @api private\n */\n\nBinaryReconstructor.prototype.takeBinaryData = function(binData) {\n this.buffers.push(binData);\n if (this.buffers.length == this.reconPack.attachments) { // done with buffer list\n var packet = binary.reconstructPacket(this.reconPack, this.buffers);\n this.finishedReconstruction();\n return packet;\n }\n return null;\n};\n\n/**\n * Cleans up binary packet reconstruction variables.\n *\n * @api private\n */\n\nBinaryReconstructor.prototype.finishedReconstruction = function() {\n this.reconPack = null;\n this.buffers = [];\n};\n\nfunction error(data){\n return {\n type: exports.ERROR,\n data: 'parser error'\n };\n}\n\n},{\"./binary\":39,\"./is-buffer\":41,\"component-emitter\":42,\"debug\":9,\"isarray\":28,\"json3\":29}],41:[function(require,module,exports){\n(function (global){\n\nmodule.exports = isBuf;\n\n/**\n * Returns true if obj is a buffer or an arraybuffer.\n *\n * @api private\n */\n\nfunction isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n\n},{}],42:[function(require,module,exports){\narguments[4][21][0].apply(exports,arguments)\n},{\"dup\":21}],43:[function(require,module,exports){\nmodule.exports = toArray\n\nfunction toArray(list, index) {\n var array = []\n\n index = index || 0\n\n for (var i = index || 0; i < list.length; i++) {\n array[i - index] = list[i]\n }\n\n return array\n}\n\n},{}],44:[function(require,module,exports){\n(function (global){\n/*! https://mths.be/utf8js v2.0.0 by @mathias */\n;(function(root) {\n\n\t// Detect free variables `exports`\n\tvar freeExports = typeof exports == 'object' && exports;\n\n\t// Detect free variable `module`\n\tvar freeModule = typeof module == 'object' && module &&\n\t\tmodule.exports == freeExports && module;\n\n\t// Detect free variable `global`, from Node.js or Browserified code,\n\t// and use it as `root`\n\tvar freeGlobal = typeof global == 'object' && global;\n\tif (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {\n\t\troot = freeGlobal;\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\tvar stringFromCharCode = String.fromCharCode;\n\n\t// Taken from https://mths.be/punycode\n\tfunction ucs2decode(string) {\n\t\tvar output = [];\n\t\tvar counter = 0;\n\t\tvar length = string.length;\n\t\tvar value;\n\t\tvar extra;\n\t\twhile (counter < length) {\n\t\t\tvalue = string.charCodeAt(counter++);\n\t\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t\t// high surrogate, and there is a next character\n\t\t\t\textra = string.charCodeAt(counter++);\n\t\t\t\tif ((extra & 0xFC00) == 0xDC00) { // low surrogate\n\t\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t\t} else {\n\t\t\t\t\t// unmatched surrogate; only append this code unit, in case the next\n\t\t\t\t\t// code unit is the high surrogate of a surrogate pair\n\t\t\t\t\toutput.push(value);\n\t\t\t\t\tcounter--;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\toutput.push(value);\n\t\t\t}\n\t\t}\n\t\treturn output;\n\t}\n\n\t// Taken from https://mths.be/punycode\n\tfunction ucs2encode(array) {\n\t\tvar length = array.length;\n\t\tvar index = -1;\n\t\tvar value;\n\t\tvar output = '';\n\t\twhile (++index < length) {\n\t\t\tvalue = array[index];\n\t\t\tif (value > 0xFFFF) {\n\t\t\t\tvalue -= 0x10000;\n\t\t\t\toutput += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);\n\t\t\t\tvalue = 0xDC00 | value & 0x3FF;\n\t\t\t}\n\t\t\toutput += stringFromCharCode(value);\n\t\t}\n\t\treturn output;\n\t}\n\n\tfunction checkScalarValue(codePoint) {\n\t\tif (codePoint >= 0xD800 && codePoint <= 0xDFFF) {\n\t\t\tthrow Error(\n\t\t\t\t'Lone surrogate U+' + codePoint.toString(16).toUpperCase() +\n\t\t\t\t' is not a scalar value'\n\t\t\t);\n\t\t}\n\t}\n\t/*--------------------------------------------------------------------------*/\n\n\tfunction createByte(codePoint, shift) {\n\t\treturn stringFromCharCode(((codePoint >> shift) & 0x3F) | 0x80);\n\t}\n\n\tfunction encodeCodePoint(codePoint) {\n\t\tif ((codePoint & 0xFFFFFF80) == 0) { // 1-byte sequence\n\t\t\treturn stringFromCharCode(codePoint);\n\t\t}\n\t\tvar symbol = '';\n\t\tif ((codePoint & 0xFFFFF800) == 0) { // 2-byte sequence\n\t\t\tsymbol = stringFromCharCode(((codePoint >> 6) & 0x1F) | 0xC0);\n\t\t}\n\t\telse if ((codePoint & 0xFFFF0000) == 0) { // 3-byte sequence\n\t\t\tcheckScalarValue(codePoint);\n\t\t\tsymbol = stringFromCharCode(((codePoint >> 12) & 0x0F) | 0xE0);\n\t\t\tsymbol += createByte(codePoint, 6);\n\t\t}\n\t\telse if ((codePoint & 0xFFE00000) == 0) { // 4-byte sequence\n\t\t\tsymbol = stringFromCharCode(((codePoint >> 18) & 0x07) | 0xF0);\n\t\t\tsymbol += createByte(codePoint, 12);\n\t\t\tsymbol += createByte(codePoint, 6);\n\t\t}\n\t\tsymbol += stringFromCharCode((codePoint & 0x3F) | 0x80);\n\t\treturn symbol;\n\t}\n\n\tfunction utf8encode(string) {\n\t\tvar codePoints = ucs2decode(string);\n\t\tvar length = codePoints.length;\n\t\tvar index = -1;\n\t\tvar codePoint;\n\t\tvar byteString = '';\n\t\twhile (++index < length) {\n\t\t\tcodePoint = codePoints[index];\n\t\t\tbyteString += encodeCodePoint(codePoint);\n\t\t}\n\t\treturn byteString;\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\tfunction readContinuationByte() {\n\t\tif (byteIndex >= byteCount) {\n\t\t\tthrow Error('Invalid byte index');\n\t\t}\n\n\t\tvar continuationByte = byteArray[byteIndex] & 0xFF;\n\t\tbyteIndex++;\n\n\t\tif ((continuationByte & 0xC0) == 0x80) {\n\t\t\treturn continuationByte & 0x3F;\n\t\t}\n\n\t\t// If we end up here, it’s not a continuation byte\n\t\tthrow Error('Invalid continuation byte');\n\t}\n\n\tfunction decodeSymbol() {\n\t\tvar byte1;\n\t\tvar byte2;\n\t\tvar byte3;\n\t\tvar byte4;\n\t\tvar codePoint;\n\n\t\tif (byteIndex > byteCount) {\n\t\t\tthrow Error('Invalid byte index');\n\t\t}\n\n\t\tif (byteIndex == byteCount) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Read first byte\n\t\tbyte1 = byteArray[byteIndex] & 0xFF;\n\t\tbyteIndex++;\n\n\t\t// 1-byte sequence (no continuation bytes)\n\t\tif ((byte1 & 0x80) == 0) {\n\t\t\treturn byte1;\n\t\t}\n\n\t\t// 2-byte sequence\n\t\tif ((byte1 & 0xE0) == 0xC0) {\n\t\t\tvar byte2 = readContinuationByte();\n\t\t\tcodePoint = ((byte1 & 0x1F) << 6) | byte2;\n\t\t\tif (codePoint >= 0x80) {\n\t\t\t\treturn codePoint;\n\t\t\t} else {\n\t\t\t\tthrow Error('Invalid continuation byte');\n\t\t\t}\n\t\t}\n\n\t\t// 3-byte sequence (may include unpaired surrogates)\n\t\tif ((byte1 & 0xF0) == 0xE0) {\n\t\t\tbyte2 = readContinuationByte();\n\t\t\tbyte3 = readContinuationByte();\n\t\t\tcodePoint = ((byte1 & 0x0F) << 12) | (byte2 << 6) | byte3;\n\t\t\tif (codePoint >= 0x0800) {\n\t\t\t\tcheckScalarValue(codePoint);\n\t\t\t\treturn codePoint;\n\t\t\t} else {\n\t\t\t\tthrow Error('Invalid continuation byte');\n\t\t\t}\n\t\t}\n\n\t\t// 4-byte sequence\n\t\tif ((byte1 & 0xF8) == 0xF0) {\n\t\t\tbyte2 = readContinuationByte();\n\t\t\tbyte3 = readContinuationByte();\n\t\t\tbyte4 = readContinuationByte();\n\t\t\tcodePoint = ((byte1 & 0x0F) << 0x12) | (byte2 << 0x0C) |\n\t\t\t\t(byte3 << 0x06) | byte4;\n\t\t\tif (codePoint >= 0x010000 && codePoint <= 0x10FFFF) {\n\t\t\t\treturn codePoint;\n\t\t\t}\n\t\t}\n\n\t\tthrow Error('Invalid UTF-8 detected');\n\t}\n\n\tvar byteArray;\n\tvar byteCount;\n\tvar byteIndex;\n\tfunction utf8decode(byteString) {\n\t\tbyteArray = ucs2decode(byteString);\n\t\tbyteCount = byteArray.length;\n\t\tbyteIndex = 0;\n\t\tvar codePoints = [];\n\t\tvar tmp;\n\t\twhile ((tmp = decodeSymbol()) !== false) {\n\t\t\tcodePoints.push(tmp);\n\t\t}\n\t\treturn ucs2encode(codePoints);\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\tvar utf8 = {\n\t\t'version': '2.0.0',\n\t\t'encode': utf8encode,\n\t\t'decode': utf8decode\n\t};\n\n\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t// like the following:\n\tif (\n\t\ttypeof define == 'function' &&\n\t\ttypeof define.amd == 'object' &&\n\t\tdefine.amd\n\t) {\n\t\tdefine(function() {\n\t\t\treturn utf8;\n\t\t});\n\t}\telse if (freeExports && !freeExports.nodeType) {\n\t\tif (freeModule) { // in Node.js or RingoJS v0.8.0+\n\t\t\tfreeModule.exports = utf8;\n\t\t} else { // in Narwhal or RingoJS v0.7.0-\n\t\t\tvar object = {};\n\t\t\tvar hasOwnProperty = object.hasOwnProperty;\n\t\t\tfor (var key in utf8) {\n\t\t\t\thasOwnProperty.call(utf8, key) && (freeExports[key] = utf8[key]);\n\t\t\t}\n\t\t}\n\t} else { // in Rhino or a web browser\n\t\troot.utf8 = utf8;\n\t}\n\n}(this));\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n\n},{}],45:[function(require,module,exports){\n'use strict';\n\nvar alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'.split('')\n , length = 64\n , map = {}\n , seed = 0\n , i = 0\n , prev;\n\n/**\n * Return a string representing the specified number.\n *\n * @param {Number} num The number to convert.\n * @returns {String} The string representation of the number.\n * @api public\n */\nfunction encode(num) {\n var encoded = '';\n\n do {\n encoded = alphabet[num % length] + encoded;\n num = Math.floor(num / length);\n } while (num > 0);\n\n return encoded;\n}\n\n/**\n * Return the integer value specified by the given string.\n *\n * @param {String} str The string to convert.\n * @returns {Number} The integer value represented by the string.\n * @api public\n */\nfunction decode(str) {\n var decoded = 0;\n\n for (i = 0; i < str.length; i++) {\n decoded = decoded * length + map[str.charAt(i)];\n }\n\n return decoded;\n}\n\n/**\n * Yeast: A tiny growing id generator.\n *\n * @returns {String} A unique id.\n * @api public\n */\nfunction yeast() {\n var now = encode(+new Date());\n\n if (now !== prev) return seed = 0, prev = now;\n return now +'.'+ encode(seed++);\n}\n\n//\n// Map each character to its index.\n//\nfor (; i < length; i++) map[alphabet[i]] = i;\n\n//\n// Expose the `yeast`, `encode` and `decode` functions.\n//\nyeast.encode = encode;\nyeast.decode = decode;\nmodule.exports = yeast;\n\n},{}],46:[function(require,module,exports){\n(function (global){\n/* global Y, global */\n'use strict';\n\n// socket.io requires utf8. This package checks if it is required by requirejs.\n// If window.require is set, then it will define itself as a module. This is erratic behavior and\n// results in socket.io having a \"bad request\".\n// This is why we undefine global.define (it is set by requirejs) before we require socket.io-client.\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar define = global.define;\nglobal.define = null;\nvar io = require('socket.io-client');\n// redefine global.define\nglobal.define = define;\n\nfunction extend(Y) {\n var Connector = function (_Y$AbstractConnector) {\n _inherits(Connector, _Y$AbstractConnector);\n\n function Connector(y, options) {\n _classCallCheck(this, Connector);\n\n if (options === undefined) {\n throw new Error('Options must not be undefined!');\n }\n if (options.room == null) {\n throw new Error('You must define a room name!');\n }\n options.role = 'slave';\n\n var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(Connector).call(this, y, options));\n\n _this.options = options;\n options.url = options.url || 'https://yjs.dbis.rwth-aachen.de:5074';\n var socket = io(options.url);\n _this.socket = socket;\n var self = _this;\n if (socket.connected) {\n joinRoom();\n } else {\n socket.on('connect', joinRoom);\n }\n function joinRoom() {\n socket.emit('joinRoom', options.room);\n self.userJoined('server', 'master');\n\n socket.on('yjsEvent', function (message) {\n if (message.type != null) {\n if (message.type === 'sync done') {\n self.setUserId(socket.id);\n }\n if (message.room === options.room) {\n self.receiveMessage('server', message);\n }\n }\n });\n\n socket.on('disconnect', function (peer) {\n self.userLeft('server');\n });\n }\n return _this;\n }\n\n _createClass(Connector, [{\n key: 'disconnect',\n value: function disconnect() {\n this.socket.disconnect();\n _get(Object.getPrototypeOf(Connector.prototype), 'disconnect', this).call(this);\n }\n }, {\n key: 'reconnect',\n value: function reconnect() {\n this.socket.connect();\n this.socket.emit('joinRoom', this.options.room);\n this.userJoined('server', 'master');\n _get(Object.getPrototypeOf(Connector.prototype), 'reconnect', this).call(this);\n }\n }, {\n key: 'send',\n value: function send(uid, message) {\n message.room = this.options.room;\n this.socket.emit('yjsEvent', message);\n }\n }, {\n key: 'broadcast',\n value: function broadcast(message) {\n message.room = this.options.room;\n this.socket.emit('yjsEvent', message);\n }\n }, {\n key: 'isDisconnected',\n value: function isDisconnected() {\n return this.socket.disconnected;\n }\n }]);\n\n return Connector;\n }(Y.AbstractConnector);\n\n Y.extend('websockets-client', Connector);\n}\n\nmodule.exports = extend;\nif (typeof Y !== 'undefined') {\n extend(Y);\n}\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n\n},{\"socket.io-client\":34}],47:[function(require,module,exports){\n\n},{}]},{},[46])\n\n","/**\n * An abstraction for slicing an arraybuffer even when\n * ArrayBuffer.prototype.slice is not supported\n *\n * @api public\n */\n\nmodule.exports = function(arraybuffer, start, end) {\n var bytes = arraybuffer.byteLength;\n start = start || 0;\n end = end || bytes;\n\n if (arraybuffer.slice) { return arraybuffer.slice(start, end); }\n\n if (start < 0) { start += bytes; }\n if (end < 0) { end += bytes; }\n if (end > bytes) { end = bytes; }\n\n if (start >= bytes || start >= end || bytes === 0) {\n return new ArrayBuffer(0);\n }\n\n var abv = new Uint8Array(arraybuffer);\n var result = new Uint8Array(end - start);\n for (var i = start, ii = 0; i < end; i++, ii++) {\n result[ii] = abv[i];\n }\n return result.buffer;\n};\n","\n/**\n * Expose `Backoff`.\n */\n\nmodule.exports = Backoff;\n\n/**\n * Initialize backoff timer with `opts`.\n *\n * - `min` initial timeout in milliseconds [100]\n * - `max` max timeout [10000]\n * - `jitter` [0]\n * - `factor` [2]\n *\n * @param {Object} opts\n * @api public\n */\n\nfunction Backoff(opts) {\n opts = opts || {};\n this.ms = opts.min || 100;\n this.max = opts.max || 10000;\n this.factor = opts.factor || 2;\n this.jitter = opts.jitter > 0 && opts.jitter <= 1 ? opts.jitter : 0;\n this.attempts = 0;\n}\n\n/**\n * Return the backoff duration.\n *\n * @return {Number}\n * @api public\n */\n\nBackoff.prototype.duration = function(){\n var ms = this.ms * Math.pow(this.factor, this.attempts++);\n if (this.jitter) {\n var rand = Math.random();\n var deviation = Math.floor(rand * this.jitter * ms);\n ms = (Math.floor(rand * 10) & 1) == 0 ? ms - deviation : ms + deviation;\n }\n return Math.min(ms, this.max) | 0;\n};\n\n/**\n * Reset the number of attempts.\n *\n * @api public\n */\n\nBackoff.prototype.reset = function(){\n this.attempts = 0;\n};\n\n/**\n * Set the minimum duration\n *\n * @api public\n */\n\nBackoff.prototype.setMin = function(min){\n this.ms = min;\n};\n\n/**\n * Set the maximum duration\n *\n * @api public\n */\n\nBackoff.prototype.setMax = function(max){\n this.max = max;\n};\n\n/**\n * Set the jitter\n *\n * @api public\n */\n\nBackoff.prototype.setJitter = function(jitter){\n this.jitter = jitter;\n};\n\n","/*\n * base64-arraybuffer\n * https://github.com/niklasvh/base64-arraybuffer\n *\n * Copyright (c) 2012 Niklas von Hertzen\n * Licensed under the MIT license.\n */\n(function(chars){\n \"use strict\";\n\n exports.encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer),\n i, len = bytes.length, base64 = \"\";\n\n for (i = 0; i < len; i+=3) {\n base64 += chars[bytes[i] >> 2];\n base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\n base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\n base64 += chars[bytes[i + 2] & 63];\n }\n\n if ((len % 3) === 2) {\n base64 = base64.substring(0, base64.length - 1) + \"=\";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + \"==\";\n }\n\n return base64;\n };\n\n exports.decode = function(base64) {\n var bufferLength = base64.length * 0.75,\n len = base64.length, i, p = 0,\n encoded1, encoded2, encoded3, encoded4;\n\n if (base64[base64.length - 1] === \"=\") {\n bufferLength--;\n if (base64[base64.length - 2] === \"=\") {\n bufferLength--;\n }\n }\n\n var arraybuffer = new ArrayBuffer(bufferLength),\n bytes = new Uint8Array(arraybuffer);\n\n for (i = 0; i < len; i+=4) {\n encoded1 = chars.indexOf(base64[i]);\n encoded2 = chars.indexOf(base64[i+1]);\n encoded3 = chars.indexOf(base64[i+2]);\n encoded4 = chars.indexOf(base64[i+3]);\n\n bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n }\n\n return arraybuffer;\n };\n})(\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\");\n","/**\n * Create a blob builder even when vendor prefixes exist\n */\n\nvar BlobBuilder = global.BlobBuilder\n || global.WebKitBlobBuilder\n || global.MSBlobBuilder\n || global.MozBlobBuilder;\n\n/**\n * Check if Blob constructor is supported\n */\n\nvar blobSupported = (function() {\n try {\n var a = new Blob(['hi']);\n return a.size === 2;\n } catch(e) {\n return false;\n }\n})();\n\n/**\n * Check if Blob constructor supports ArrayBufferViews\n * Fails in Safari 6, so we need to map to ArrayBuffers there.\n */\n\nvar blobSupportsArrayBufferView = blobSupported && (function() {\n try {\n var b = new Blob([new Uint8Array([1,2])]);\n return b.size === 2;\n } catch(e) {\n return false;\n }\n})();\n\n/**\n * Check if BlobBuilder is supported\n */\n\nvar blobBuilderSupported = BlobBuilder\n && BlobBuilder.prototype.append\n && BlobBuilder.prototype.getBlob;\n\n/**\n * Helper function that maps ArrayBufferViews to ArrayBuffers\n * Used by BlobBuilder constructor and old browsers that didn't\n * support it in the Blob constructor.\n */\n\nfunction mapArrayBufferViews(ary) {\n for (var i = 0; i < ary.length; i++) {\n var chunk = ary[i];\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer;\n\n // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n\n ary[i] = buf;\n }\n }\n}\n\nfunction BlobBuilderConstructor(ary, options) {\n options = options || {};\n\n var bb = new BlobBuilder();\n mapArrayBufferViews(ary);\n\n for (var i = 0; i < ary.length; i++) {\n bb.append(ary[i]);\n }\n\n return (options.type) ? bb.getBlob(options.type) : bb.getBlob();\n};\n\nfunction BlobConstructor(ary, options) {\n mapArrayBufferViews(ary);\n return new Blob(ary, options || {});\n};\n\nmodule.exports = (function() {\n if (blobSupported) {\n return blobSupportsArrayBufferView ? global.Blob : BlobConstructor;\n } else if (blobBuilderSupported) {\n return BlobBuilderConstructor;\n } else {\n return undefined;\n }\n})();\n","/**\n * Slice reference.\n */\n\nvar slice = [].slice;\n\n/**\n * Bind `obj` to `fn`.\n *\n * @param {Object} obj\n * @param {Function|String} fn or string\n * @return {Function}\n * @api public\n */\n\nmodule.exports = function(obj, fn){\n if ('string' == typeof fn) fn = obj[fn];\n if ('function' != typeof fn) throw new Error('bind() requires a function');\n var args = slice.call(arguments, 2);\n return function(){\n return fn.apply(obj, args.concat(slice.call(arguments)));\n }\n};\n","\n/**\n * Expose `Emitter`.\n */\n\nmodule.exports = Emitter;\n\n/**\n * Initialize a new `Emitter`.\n *\n * @api public\n */\n\nfunction Emitter(obj) {\n if (obj) return mixin(obj);\n};\n\n/**\n * Mixin the emitter properties.\n *\n * @param {Object} obj\n * @return {Object}\n * @api private\n */\n\nfunction mixin(obj) {\n for (var key in Emitter.prototype) {\n obj[key] = Emitter.prototype[key];\n }\n return obj;\n}\n\n/**\n * Listen on the given `event` with `fn`.\n *\n * @param {String} event\n * @param {Function} fn\n * @return {Emitter}\n * @api public\n */\n\nEmitter.prototype.on =\nEmitter.prototype.addEventListener = function(event, fn){\n this._callbacks = this._callbacks || {};\n (this._callbacks['$' + event] = this._callbacks['$' + event] || [])\n .push(fn);\n return this;\n};\n\n/**\n * Adds an `event` listener that will be invoked a single\n * time then automatically removed.\n *\n * @param {String} event\n * @param {Function} fn\n * @return {Emitter}\n * @api public\n */\n\nEmitter.prototype.once = function(event, fn){\n function on() {\n this.off(event, on);\n fn.apply(this, arguments);\n }\n\n on.fn = fn;\n this.on(event, on);\n return this;\n};\n\n/**\n * Remove the given callback for `event` or all\n * registered callbacks.\n *\n * @param {String} event\n * @param {Function} fn\n * @return {Emitter}\n * @api public\n */\n\nEmitter.prototype.off =\nEmitter.prototype.removeListener =\nEmitter.prototype.removeAllListeners =\nEmitter.prototype.removeEventListener = function(event, fn){\n this._callbacks = this._callbacks || {};\n\n // all\n if (0 == arguments.length) {\n this._callbacks = {};\n return this;\n }\n\n // specific event\n var callbacks = this._callbacks['$' + event];\n if (!callbacks) return this;\n\n // remove all handlers\n if (1 == arguments.length) {\n delete this._callbacks['$' + event];\n return this;\n }\n\n // remove specific handler\n var cb;\n for (var i = 0; i < callbacks.length; i++) {\n cb = callbacks[i];\n if (cb === fn || cb.fn === fn) {\n callbacks.splice(i, 1);\n break;\n }\n }\n return this;\n};\n\n/**\n * Emit `event` with the given args.\n *\n * @param {String} event\n * @param {Mixed} ...\n * @return {Emitter}\n */\n\nEmitter.prototype.emit = function(event){\n this._callbacks = this._callbacks || {};\n var args = [].slice.call(arguments, 1)\n , callbacks = this._callbacks['$' + event];\n\n if (callbacks) {\n callbacks = callbacks.slice(0);\n for (var i = 0, len = callbacks.length; i < len; ++i) {\n callbacks[i].apply(this, args);\n }\n }\n\n return this;\n};\n\n/**\n * Return array of callbacks for `event`.\n *\n * @param {String} event\n * @return {Array}\n * @api public\n */\n\nEmitter.prototype.listeners = function(event){\n this._callbacks = this._callbacks || {};\n return this._callbacks['$' + event] || [];\n};\n\n/**\n * Check if this emitter has `event` handlers.\n *\n * @param {String} event\n * @return {Boolean}\n * @api public\n */\n\nEmitter.prototype.hasListeners = function(event){\n return !! this.listeners(event).length;\n};\n","\nmodule.exports = function(a, b){\n var fn = function(){};\n fn.prototype = b.prototype;\n a.prototype = new fn;\n a.prototype.constructor = a;\n};","\n/**\n * This is the web browser implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = require('./debug');\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = 'undefined' != typeof chrome\n && 'undefined' != typeof chrome.storage\n ? chrome.storage.local\n : localstorage();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n 'lightseagreen',\n 'forestgreen',\n 'goldenrod',\n 'dodgerblue',\n 'darkorchid',\n 'crimson'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\nfunction useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nexports.formatters.j = function(v) {\n return JSON.stringify(v);\n};\n\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}\n\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\nfunction log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n try {\n if (null == namespaces) {\n exports.storage.removeItem('debug');\n } else {\n exports.storage.debug = namespaces;\n }\n } catch(e) {}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n var r;\n try {\n r = exports.storage.debug;\n } catch(e) {}\n return r;\n}\n\n/**\n * Enable namespaces listed in `localStorage.debug` initially.\n */\n\nexports.enable(load());\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage(){\n try {\n return window.localStorage;\n } catch (e) {}\n}\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = debug;\nexports.coerce = coerce;\nexports.disable = disable;\nexports.enable = enable;\nexports.enabled = enabled;\nexports.humanize = require('ms');\n\n/**\n * The currently active debug mode names, and names to skip.\n */\n\nexports.names = [];\nexports.skips = [];\n\n/**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lowercased letter, i.e. \"n\".\n */\n\nexports.formatters = {};\n\n/**\n * Previously assigned color.\n */\n\nvar prevColor = 0;\n\n/**\n * Previous log timestamp.\n */\n\nvar prevTime;\n\n/**\n * Select a color.\n *\n * @return {Number}\n * @api private\n */\n\nfunction selectColor() {\n return exports.colors[prevColor++ % exports.colors.length];\n}\n\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\nfunction debug(namespace) {\n\n // define the `disabled` version\n function disabled() {\n }\n disabled.enabled = false;\n\n // define the `enabled` version\n function enabled() {\n\n var self = enabled;\n\n // set `diff` timestamp\n var curr = +new Date();\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n\n // add the `color` if not set\n if (null == self.useColors) self.useColors = exports.useColors();\n if (null == self.color && self.useColors) self.color = selectColor();\n\n var args = Array.prototype.slice.call(arguments);\n\n args[0] = exports.coerce(args[0]);\n\n if ('string' !== typeof args[0]) {\n // anything else let's inspect with %o\n args = ['%o'].concat(args);\n }\n\n // apply any `formatters` transformations\n var index = 0;\n args[0] = args[0].replace(/%([a-z%])/g, function(match, format) {\n // if we encounter an escaped % then don't increase the array index\n if (match === '%%') return match;\n index++;\n var formatter = exports.formatters[format];\n if ('function' === typeof formatter) {\n var val = args[index];\n match = formatter.call(self, val);\n\n // now we need to remove `args[index]` since it's inlined in the `format`\n args.splice(index, 1);\n index--;\n }\n return match;\n });\n\n if ('function' === typeof exports.formatArgs) {\n args = exports.formatArgs.apply(self, args);\n }\n var logFn = enabled.log || exports.log || console.log.bind(console);\n logFn.apply(self, args);\n }\n enabled.enabled = true;\n\n var fn = exports.enabled(namespace) ? enabled : disabled;\n\n fn.namespace = namespace;\n\n return fn;\n}\n\n/**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\nfunction enable(namespaces) {\n exports.save(namespaces);\n\n var split = (namespaces || '').split(/[\\s,]+/);\n var len = split.length;\n\n for (var i = 0; i < len; i++) {\n if (!split[i]) continue; // ignore empty strings\n namespaces = split[i].replace(/\\*/g, '.*?');\n if (namespaces[0] === '-') {\n exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n exports.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n}\n\n/**\n * Disable debug output.\n *\n * @api public\n */\n\nfunction disable() {\n exports.enable('');\n}\n\n/**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\nfunction enabled(name) {\n var i, len;\n for (i = 0, len = exports.skips.length; i < len; i++) {\n if (exports.skips[i].test(name)) {\n return false;\n }\n }\n for (i = 0, len = exports.names.length; i < len; i++) {\n if (exports.names[i].test(name)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\nfunction coerce(val) {\n if (val instanceof Error) return val.stack || val.message;\n return val;\n}\n","\nmodule.exports = require('./lib/');\n","\nmodule.exports = require('./socket');\n\n/**\n * Exports parser\n *\n * @api public\n *\n */\nmodule.exports.parser = require('engine.io-parser');\n","/**\n * Module dependencies.\n */\n\nvar transports = require('./transports');\nvar Emitter = require('component-emitter');\nvar debug = require('debug')('engine.io-client:socket');\nvar index = require('indexof');\nvar parser = require('engine.io-parser');\nvar parseuri = require('parseuri');\nvar parsejson = require('parsejson');\nvar parseqs = require('parseqs');\n\n/**\n * Module exports.\n */\n\nmodule.exports = Socket;\n\n/**\n * Noop function.\n *\n * @api private\n */\n\nfunction noop(){}\n\n/**\n * Socket constructor.\n *\n * @param {String|Object} uri or options\n * @param {Object} options\n * @api public\n */\n\nfunction Socket(uri, opts){\n if (!(this instanceof Socket)) return new Socket(uri, opts);\n\n opts = opts || {};\n\n if (uri && 'object' == typeof uri) {\n opts = uri;\n uri = null;\n }\n\n if (uri) {\n uri = parseuri(uri);\n opts.hostname = uri.host;\n opts.secure = uri.protocol == 'https' || uri.protocol == 'wss';\n opts.port = uri.port;\n if (uri.query) opts.query = uri.query;\n } else if (opts.host) {\n opts.hostname = parseuri(opts.host).host;\n }\n\n this.secure = null != opts.secure ? opts.secure :\n (global.location && 'https:' == location.protocol);\n\n if (opts.hostname && !opts.port) {\n // if no port is specified manually, use the protocol default\n opts.port = this.secure ? '443' : '80';\n }\n\n this.agent = opts.agent || false;\n this.hostname = opts.hostname ||\n (global.location ? location.hostname : 'localhost');\n this.port = opts.port || (global.location && location.port ?\n location.port :\n (this.secure ? 443 : 80));\n this.query = opts.query || {};\n if ('string' == typeof this.query) this.query = parseqs.decode(this.query);\n this.upgrade = false !== opts.upgrade;\n this.path = (opts.path || '/engine.io').replace(/\\/$/, '') + '/';\n this.forceJSONP = !!opts.forceJSONP;\n this.jsonp = false !== opts.jsonp;\n this.forceBase64 = !!opts.forceBase64;\n this.enablesXDR = !!opts.enablesXDR;\n this.timestampParam = opts.timestampParam || 't';\n this.timestampRequests = opts.timestampRequests;\n this.transports = opts.transports || ['polling', 'websocket'];\n this.readyState = '';\n this.writeBuffer = [];\n this.policyPort = opts.policyPort || 843;\n this.rememberUpgrade = opts.rememberUpgrade || false;\n this.binaryType = null;\n this.onlyBinaryUpgrades = opts.onlyBinaryUpgrades;\n this.perMessageDeflate = false !== opts.perMessageDeflate ? (opts.perMessageDeflate || {}) : false;\n\n if (true === this.perMessageDeflate) this.perMessageDeflate = {};\n if (this.perMessageDeflate && null == this.perMessageDeflate.threshold) {\n this.perMessageDeflate.threshold = 1024;\n }\n\n // SSL options for Node.js client\n this.pfx = opts.pfx || null;\n this.key = opts.key || null;\n this.passphrase = opts.passphrase || null;\n this.cert = opts.cert || null;\n this.ca = opts.ca || null;\n this.ciphers = opts.ciphers || null;\n this.rejectUnauthorized = opts.rejectUnauthorized === undefined ? null : opts.rejectUnauthorized;\n\n // other options for Node.js client\n var freeGlobal = typeof global == 'object' && global;\n if (freeGlobal.global === freeGlobal) {\n if (opts.extraHeaders && Object.keys(opts.extraHeaders).length > 0) {\n this.extraHeaders = opts.extraHeaders;\n }\n }\n\n this.open();\n}\n\nSocket.priorWebsocketSuccess = false;\n\n/**\n * Mix in `Emitter`.\n */\n\nEmitter(Socket.prototype);\n\n/**\n * Protocol version.\n *\n * @api public\n */\n\nSocket.protocol = parser.protocol; // this is an int\n\n/**\n * Expose deps for legacy compatibility\n * and standalone browser access.\n */\n\nSocket.Socket = Socket;\nSocket.Transport = require('./transport');\nSocket.transports = require('./transports');\nSocket.parser = require('engine.io-parser');\n\n/**\n * Creates transport of the given type.\n *\n * @param {String} transport name\n * @return {Transport}\n * @api private\n */\n\nSocket.prototype.createTransport = function (name) {\n debug('creating transport \"%s\"', name);\n var query = clone(this.query);\n\n // append engine.io protocol identifier\n query.EIO = parser.protocol;\n\n // transport name\n query.transport = name;\n\n // session id if we already have one\n if (this.id) query.sid = this.id;\n\n var transport = new transports[name]({\n agent: this.agent,\n hostname: this.hostname,\n port: this.port,\n secure: this.secure,\n path: this.path,\n query: query,\n forceJSONP: this.forceJSONP,\n jsonp: this.jsonp,\n forceBase64: this.forceBase64,\n enablesXDR: this.enablesXDR,\n timestampRequests: this.timestampRequests,\n timestampParam: this.timestampParam,\n policyPort: this.policyPort,\n socket: this,\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 perMessageDeflate: this.perMessageDeflate,\n extraHeaders: this.extraHeaders\n });\n\n return transport;\n};\n\nfunction clone (obj) {\n var o = {};\n for (var i in obj) {\n if (obj.hasOwnProperty(i)) {\n o[i] = obj[i];\n }\n }\n return o;\n}\n\n/**\n * Initializes transport to use and starts probe.\n *\n * @api private\n */\nSocket.prototype.open = function () {\n var transport;\n if (this.rememberUpgrade && Socket.priorWebsocketSuccess && this.transports.indexOf('websocket') != -1) {\n transport = 'websocket';\n } else if (0 === this.transports.length) {\n // Emit error on next tick so it can be listened to\n var self = this;\n setTimeout(function() {\n self.emit('error', 'No transports available');\n }, 0);\n return;\n } else {\n transport = this.transports[0];\n }\n this.readyState = 'opening';\n\n // Retry with the next transport if the transport is disabled (jsonp: false)\n try {\n transport = this.createTransport(transport);\n } catch (e) {\n this.transports.shift();\n this.open();\n return;\n }\n\n transport.open();\n this.setTransport(transport);\n};\n\n/**\n * Sets the current transport. Disables the existing one (if any).\n *\n * @api private\n */\n\nSocket.prototype.setTransport = function(transport){\n debug('setting transport %s', transport.name);\n var self = this;\n\n if (this.transport) {\n debug('clearing existing transport %s', this.transport.name);\n this.transport.removeAllListeners();\n }\n\n // set up transport\n this.transport = transport;\n\n // set up transport listeners\n transport\n .on('drain', function(){\n self.onDrain();\n })\n .on('packet', function(packet){\n self.onPacket(packet);\n })\n .on('error', function(e){\n self.onError(e);\n })\n .on('close', function(){\n self.onClose('transport close');\n });\n};\n\n/**\n * Probes a transport.\n *\n * @param {String} transport name\n * @api private\n */\n\nSocket.prototype.probe = function (name) {\n debug('probing transport \"%s\"', name);\n var transport = this.createTransport(name, { probe: 1 })\n , failed = false\n , self = this;\n\n Socket.priorWebsocketSuccess = false;\n\n function onTransportOpen(){\n if (self.onlyBinaryUpgrades) {\n var upgradeLosesBinary = !this.supportsBinary && self.transport.supportsBinary;\n failed = failed || upgradeLosesBinary;\n }\n if (failed) return;\n\n debug('probe transport \"%s\" opened', name);\n transport.send([{ type: 'ping', data: 'probe' }]);\n transport.once('packet', function (msg) {\n if (failed) return;\n if ('pong' == msg.type && 'probe' == msg.data) {\n debug('probe transport \"%s\" pong', name);\n self.upgrading = true;\n self.emit('upgrading', transport);\n if (!transport) return;\n Socket.priorWebsocketSuccess = 'websocket' == transport.name;\n\n debug('pausing current transport \"%s\"', self.transport.name);\n self.transport.pause(function () {\n if (failed) return;\n if ('closed' == self.readyState) return;\n debug('changing transport and sending upgrade packet');\n\n cleanup();\n\n self.setTransport(transport);\n transport.send([{ type: 'upgrade' }]);\n self.emit('upgrade', transport);\n transport = null;\n self.upgrading = false;\n self.flush();\n });\n } else {\n debug('probe transport \"%s\" failed', name);\n var err = new Error('probe error');\n err.transport = transport.name;\n self.emit('upgradeError', err);\n }\n });\n }\n\n function freezeTransport() {\n if (failed) return;\n\n // Any callback called by transport should be ignored since now\n failed = true;\n\n cleanup();\n\n transport.close();\n transport = null;\n }\n\n //Handle any error that happens while probing\n function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }\n\n function onTransportClose(){\n onerror(\"transport closed\");\n }\n\n //When the socket is closed while we're probing\n function onclose(){\n onerror(\"socket closed\");\n }\n\n //When the socket is upgraded while we're probing\n function onupgrade(to){\n if (transport && to.name != transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }\n\n //Remove all listeners on the transport and on self\n function cleanup(){\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }\n\n transport.once('open', onTransportOpen);\n transport.once('error', onerror);\n transport.once('close', onTransportClose);\n\n this.once('close', onclose);\n this.once('upgrading', onupgrade);\n\n transport.open();\n\n};\n\n/**\n * Called when connection is deemed open.\n *\n * @api public\n */\n\nSocket.prototype.onOpen = function () {\n debug('socket open');\n this.readyState = 'open';\n Socket.priorWebsocketSuccess = 'websocket' == this.transport.name;\n this.emit('open');\n this.flush();\n\n // we check for `readyState` in case an `open`\n // listener already closed the socket\n if ('open' == this.readyState && this.upgrade && this.transport.pause) {\n debug('starting upgrade probes');\n for (var i = 0, l = this.upgrades.length; i < l; i++) {\n this.probe(this.upgrades[i]);\n }\n }\n};\n\n/**\n * Handles a packet.\n *\n * @api private\n */\n\nSocket.prototype.onPacket = function (packet) {\n if ('opening' == this.readyState || 'open' == this.readyState) {\n debug('socket receive: type \"%s\", data \"%s\"', packet.type, packet.data);\n\n this.emit('packet', packet);\n\n // Socket is live - any packet counts\n this.emit('heartbeat');\n\n switch (packet.type) {\n case 'open':\n this.onHandshake(parsejson(packet.data));\n break;\n\n case 'pong':\n this.setPing();\n this.emit('pong');\n break;\n\n case 'error':\n var err = new Error('server error');\n err.code = packet.data;\n this.onError(err);\n break;\n\n case 'message':\n this.emit('data', packet.data);\n this.emit('message', packet.data);\n break;\n }\n } else {\n debug('packet received with socket readyState \"%s\"', this.readyState);\n }\n};\n\n/**\n * Called upon handshake completion.\n *\n * @param {Object} handshake obj\n * @api private\n */\n\nSocket.prototype.onHandshake = function (data) {\n this.emit('handshake', data);\n this.id = data.sid;\n this.transport.query.sid = data.sid;\n this.upgrades = this.filterUpgrades(data.upgrades);\n this.pingInterval = data.pingInterval;\n this.pingTimeout = data.pingTimeout;\n this.onOpen();\n // In case open handler closes socket\n if ('closed' == this.readyState) return;\n this.setPing();\n\n // Prolong liveness of socket on heartbeat\n this.removeListener('heartbeat', this.onHeartbeat);\n this.on('heartbeat', this.onHeartbeat);\n};\n\n/**\n * Resets ping timeout.\n *\n * @api private\n */\n\nSocket.prototype.onHeartbeat = function (timeout) {\n clearTimeout(this.pingTimeoutTimer);\n var self = this;\n self.pingTimeoutTimer = setTimeout(function () {\n if ('closed' == self.readyState) return;\n self.onClose('ping timeout');\n }, timeout || (self.pingInterval + self.pingTimeout));\n};\n\n/**\n * Pings server every `this.pingInterval` and expects response\n * within `this.pingTimeout` or closes connection.\n *\n * @api private\n */\n\nSocket.prototype.setPing = function () {\n var self = this;\n clearTimeout(self.pingIntervalTimer);\n self.pingIntervalTimer = setTimeout(function () {\n debug('writing ping packet - expecting pong within %sms', self.pingTimeout);\n self.ping();\n self.onHeartbeat(self.pingTimeout);\n }, self.pingInterval);\n};\n\n/**\n* Sends a ping packet.\n*\n* @api private\n*/\n\nSocket.prototype.ping = function () {\n var self = this;\n this.sendPacket('ping', function(){\n self.emit('ping');\n });\n};\n\n/**\n * Called on `drain` event\n *\n * @api private\n */\n\nSocket.prototype.onDrain = function() {\n this.writeBuffer.splice(0, this.prevBufferLen);\n\n // setting prevBufferLen = 0 is very important\n // for example, when upgrading, upgrade packet is sent over,\n // and a nonzero prevBufferLen could cause problems on `drain`\n this.prevBufferLen = 0;\n\n if (0 === this.writeBuffer.length) {\n this.emit('drain');\n } else {\n this.flush();\n }\n};\n\n/**\n * Flush write buffers.\n *\n * @api private\n */\n\nSocket.prototype.flush = function () {\n if ('closed' != this.readyState && this.transport.writable &&\n !this.upgrading && this.writeBuffer.length) {\n debug('flushing %d packets in socket', this.writeBuffer.length);\n this.transport.send(this.writeBuffer);\n // keep track of current length of writeBuffer\n // splice writeBuffer and callbackBuffer on `drain`\n this.prevBufferLen = this.writeBuffer.length;\n this.emit('flush');\n }\n};\n\n/**\n * Sends a message.\n *\n * @param {String} message.\n * @param {Function} callback function.\n * @param {Object} options.\n * @return {Socket} for chaining.\n * @api public\n */\n\nSocket.prototype.write =\nSocket.prototype.send = function (msg, options, fn) {\n this.sendPacket('message', msg, options, fn);\n return this;\n};\n\n/**\n * Sends a packet.\n *\n * @param {String} packet type.\n * @param {String} data.\n * @param {Object} options.\n * @param {Function} callback function.\n * @api private\n */\n\nSocket.prototype.sendPacket = function (type, data, options, fn) {\n if('function' == typeof data) {\n fn = data;\n data = undefined;\n }\n\n if ('function' == typeof options) {\n fn = options;\n options = null;\n }\n\n if ('closing' == this.readyState || 'closed' == this.readyState) {\n return;\n }\n\n options = options || {};\n options.compress = false !== options.compress;\n\n var packet = {\n type: type,\n data: data,\n options: options\n };\n this.emit('packetCreate', packet);\n this.writeBuffer.push(packet);\n if (fn) this.once('flush', fn);\n this.flush();\n};\n\n/**\n * Closes the connection.\n *\n * @api private\n */\n\nSocket.prototype.close = function () {\n if ('opening' == this.readyState || 'open' == this.readyState) {\n this.readyState = 'closing';\n\n var self = this;\n\n if (this.writeBuffer.length) {\n this.once('drain', function() {\n if (this.upgrading) {\n waitForUpgrade();\n } else {\n close();\n }\n });\n } else if (this.upgrading) {\n waitForUpgrade();\n } else {\n close();\n }\n }\n\n function close() {\n self.onClose('forced close');\n debug('socket closing - telling transport to close');\n self.transport.close();\n }\n\n function cleanupAndClose() {\n self.removeListener('upgrade', cleanupAndClose);\n self.removeListener('upgradeError', cleanupAndClose);\n close();\n }\n\n function waitForUpgrade() {\n // wait for upgrade to finish since we can't send packets while pausing a transport\n self.once('upgrade', cleanupAndClose);\n self.once('upgradeError', cleanupAndClose);\n }\n\n return this;\n};\n\n/**\n * Called upon transport error\n *\n * @api private\n */\n\nSocket.prototype.onError = function (err) {\n debug('socket error %j', err);\n Socket.priorWebsocketSuccess = false;\n this.emit('error', err);\n this.onClose('transport error', err);\n};\n\n/**\n * Called upon transport close.\n *\n * @api private\n */\n\nSocket.prototype.onClose = function (reason, desc) {\n if ('opening' == this.readyState || 'open' == this.readyState || 'closing' == this.readyState) {\n debug('socket close with reason: \"%s\"', reason);\n var self = this;\n\n // clear timers\n clearTimeout(this.pingIntervalTimer);\n clearTimeout(this.pingTimeoutTimer);\n\n // stop event from firing again for transport\n this.transport.removeAllListeners('close');\n\n // ensure transport won't stay open\n this.transport.close();\n\n // ignore further transport communication\n this.transport.removeAllListeners();\n\n // set ready state\n this.readyState = 'closed';\n\n // clear session id\n this.id = null;\n\n // emit close event\n this.emit('close', reason, desc);\n\n // clean buffers after, so users can still\n // grab the buffers on `close` event\n self.writeBuffer = [];\n self.prevBufferLen = 0;\n }\n};\n\n/**\n * Filters upgrades, returning only those matching client transports.\n *\n * @param {Array} server upgrades\n * @api private\n *\n */\n\nSocket.prototype.filterUpgrades = function (upgrades) {\n var filteredUpgrades = [];\n for (var i = 0, j = upgrades.length; i<j; i++) {\n if (~index(this.transports, upgrades[i])) filteredUpgrades.push(upgrades[i]);\n }\n return filteredUpgrades;\n};\n","/**\n * Module dependencies.\n */\n\nvar parser = require('engine.io-parser');\nvar Emitter = require('component-emitter');\n\n/**\n * Module exports.\n */\n\nmodule.exports = Transport;\n\n/**\n * Transport abstract constructor.\n *\n * @param {Object} options.\n * @api private\n */\n\nfunction Transport (opts) {\n this.path = opts.path;\n this.hostname = opts.hostname;\n this.port = opts.port;\n this.secure = opts.secure;\n this.query = opts.query;\n this.timestampParam = opts.timestampParam;\n this.timestampRequests = opts.timestampRequests;\n this.readyState = '';\n this.agent = opts.agent || false;\n this.socket = opts.socket;\n this.enablesXDR = opts.enablesXDR;\n\n // SSL options for Node.js client\n this.pfx = opts.pfx;\n this.key = opts.key;\n this.passphrase = opts.passphrase;\n this.cert = opts.cert;\n this.ca = opts.ca;\n this.ciphers = opts.ciphers;\n this.rejectUnauthorized = opts.rejectUnauthorized;\n\n // other options for Node.js client\n this.extraHeaders = opts.extraHeaders;\n}\n\n/**\n * Mix in `Emitter`.\n */\n\nEmitter(Transport.prototype);\n\n/**\n * Emits an error.\n *\n * @param {String} str\n * @return {Transport} for chaining\n * @api public\n */\n\nTransport.prototype.onError = function (msg, desc) {\n var err = new Error(msg);\n err.type = 'TransportError';\n err.description = desc;\n this.emit('error', err);\n return this;\n};\n\n/**\n * Opens the transport.\n *\n * @api public\n */\n\nTransport.prototype.open = function () {\n if ('closed' == this.readyState || '' == this.readyState) {\n this.readyState = 'opening';\n this.doOpen();\n }\n\n return this;\n};\n\n/**\n * Closes the transport.\n *\n * @api private\n */\n\nTransport.prototype.close = function () {\n if ('opening' == this.readyState || 'open' == this.readyState) {\n this.doClose();\n this.onClose();\n }\n\n return this;\n};\n\n/**\n * Sends multiple packets.\n *\n * @param {Array} packets\n * @api private\n */\n\nTransport.prototype.send = function(packets){\n if ('open' == this.readyState) {\n this.write(packets);\n } else {\n throw new Error('Transport not open');\n }\n};\n\n/**\n * Called upon open\n *\n * @api private\n */\n\nTransport.prototype.onOpen = function () {\n this.readyState = 'open';\n this.writable = true;\n this.emit('open');\n};\n\n/**\n * Called with data.\n *\n * @param {String} data\n * @api private\n */\n\nTransport.prototype.onData = function(data){\n var packet = parser.decodePacket(data, this.socket.binaryType);\n this.onPacket(packet);\n};\n\n/**\n * Called with a decoded packet.\n */\n\nTransport.prototype.onPacket = function (packet) {\n this.emit('packet', packet);\n};\n\n/**\n * Called upon close.\n *\n * @api private\n */\n\nTransport.prototype.onClose = function () {\n this.readyState = 'closed';\n this.emit('close');\n};\n","/**\n * Module dependencies\n */\n\nvar XMLHttpRequest = require('xmlhttprequest-ssl');\nvar XHR = require('./polling-xhr');\nvar JSONP = require('./polling-jsonp');\nvar websocket = require('./websocket');\n\n/**\n * Export transports.\n */\n\nexports.polling = polling;\nexports.websocket = websocket;\n\n/**\n * Polling transport polymorphic constructor.\n * Decides on xhr vs jsonp based on feature detection.\n *\n * @api private\n */\n\nfunction polling(opts){\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' == location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname != location.hostname || port != opts.port;\n xs = opts.secure != isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}\n","\n/**\n * Module requirements.\n */\n\nvar Polling = require('./polling');\nvar inherit = require('component-inherit');\n\n/**\n * Module exports.\n */\n\nmodule.exports = JSONPPolling;\n\n/**\n * Cached regular expressions.\n */\n\nvar rNewline = /\\n/g;\nvar rEscapedNewline = /\\\\n/g;\n\n/**\n * Global JSONP callbacks.\n */\n\nvar callbacks;\n\n/**\n * Callbacks count.\n */\n\nvar index = 0;\n\n/**\n * Noop.\n */\n\nfunction empty () { }\n\n/**\n * JSONP Polling constructor.\n *\n * @param {Object} opts.\n * @api public\n */\n\nfunction JSONPPolling (opts) {\n Polling.call(this, opts);\n\n this.query = this.query || {};\n\n // define global callbacks array if not present\n // we do this here (lazily) to avoid unneeded global pollution\n if (!callbacks) {\n // we need to consider multiple engines in the same page\n if (!global.___eio) global.___eio = [];\n callbacks = global.___eio;\n }\n\n // callback identifier\n this.index = callbacks.length;\n\n // add callback to jsonp global\n var self = this;\n callbacks.push(function (msg) {\n self.onData(msg);\n });\n\n // append to query string\n this.query.j = this.index;\n\n // prevent spurious errors from being emitted when the window is unloaded\n if (global.document && global.addEventListener) {\n global.addEventListener('beforeunload', function () {\n if (self.script) self.script.onerror = empty;\n }, false);\n }\n}\n\n/**\n * Inherits from Polling.\n */\n\ninherit(JSONPPolling, Polling);\n\n/*\n * JSONP only supports binary as base64 encoded strings\n */\n\nJSONPPolling.prototype.supportsBinary = false;\n\n/**\n * Closes the socket.\n *\n * @api private\n */\n\nJSONPPolling.prototype.doClose = function () {\n if (this.script) {\n this.script.parentNode.removeChild(this.script);\n this.script = null;\n }\n\n if (this.form) {\n this.form.parentNode.removeChild(this.form);\n this.form = null;\n this.iframe = null;\n }\n\n Polling.prototype.doClose.call(this);\n};\n\n/**\n * Starts a poll cycle.\n *\n * @api private\n */\n\nJSONPPolling.prototype.doPoll = function () {\n var self = this;\n var script = document.createElement('script');\n\n if (this.script) {\n this.script.parentNode.removeChild(this.script);\n this.script = null;\n }\n\n script.async = true;\n script.src = this.uri();\n script.onerror = function(e){\n self.onError('jsonp poll error',e);\n };\n\n var insertAt = document.getElementsByTagName('script')[0];\n if (insertAt) {\n insertAt.parentNode.insertBefore(script, insertAt);\n }\n else {\n (document.head || document.body).appendChild(script);\n }\n this.script = script;\n\n var isUAgecko = 'undefined' != typeof navigator && /gecko/i.test(navigator.userAgent);\n \n if (isUAgecko) {\n setTimeout(function () {\n var iframe = document.createElement('iframe');\n document.body.appendChild(iframe);\n document.body.removeChild(iframe);\n }, 100);\n }\n};\n\n/**\n * Writes with a hidden iframe.\n *\n * @param {String} data to send\n * @param {Function} called upon flush.\n * @api private\n */\n\nJSONPPolling.prototype.doWrite = function (data, fn) {\n var self = this;\n\n if (!this.form) {\n var form = document.createElement('form');\n var area = document.createElement('textarea');\n var id = this.iframeId = 'eio_iframe_' + this.index;\n var iframe;\n\n form.className = 'socketio';\n form.style.position = 'absolute';\n form.style.top = '-1000px';\n form.style.left = '-1000px';\n form.target = id;\n form.method = 'POST';\n form.setAttribute('accept-charset', 'utf-8');\n area.name = 'd';\n form.appendChild(area);\n document.body.appendChild(form);\n\n this.form = form;\n this.area = area;\n }\n\n this.form.action = this.uri();\n\n function complete () {\n initIframe();\n fn();\n }\n\n function initIframe () {\n if (self.iframe) {\n try {\n self.form.removeChild(self.iframe);\n } catch (e) {\n self.onError('jsonp polling iframe removal error', e);\n }\n }\n\n try {\n // ie6 dynamic iframes with target=\"\" support (thanks Chris Lambacher)\n var html = '<iframe src=\"javascript:0\" name=\"'+ self.iframeId +'\">';\n iframe = document.createElement(html);\n } catch (e) {\n iframe = document.createElement('iframe');\n iframe.name = self.iframeId;\n iframe.src = 'javascript:0';\n }\n\n iframe.id = self.iframeId;\n\n self.form.appendChild(iframe);\n self.iframe = iframe;\n }\n\n initIframe();\n\n // escape \\n to prevent it from being converted into \\r\\n by some UAs\n // double escaping is required for escaped new lines because unescaping of new lines can be done safely on server-side\n data = data.replace(rEscapedNewline, '\\\\\\n');\n this.area.value = data.replace(rNewline, '\\\\n');\n\n try {\n this.form.submit();\n } catch(e) {}\n\n if (this.iframe.attachEvent) {\n this.iframe.onreadystatechange = function(){\n if (self.iframe.readyState == 'complete') {\n complete();\n }\n };\n } else {\n this.iframe.onload = complete;\n }\n};\n","/**\n * Module requirements.\n */\n\nvar XMLHttpRequest = require('xmlhttprequest-ssl');\nvar Polling = require('./polling');\nvar Emitter = require('component-emitter');\nvar inherit = require('component-inherit');\nvar debug = require('debug')('engine.io-client:polling-xhr');\n\n/**\n * Module exports.\n */\n\nmodule.exports = XHR;\nmodule.exports.Request = Request;\n\n/**\n * Empty function\n */\n\nfunction empty(){}\n\n/**\n * XHR Polling constructor.\n *\n * @param {Object} opts\n * @api public\n */\n\nfunction XHR(opts){\n Polling.call(this, opts);\n\n if (global.location) {\n var isSSL = 'https:' == location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n this.xd = opts.hostname != global.location.hostname ||\n port != opts.port;\n this.xs = opts.secure != isSSL;\n } else {\n this.extraHeaders = opts.extraHeaders;\n }\n}\n\n/**\n * Inherits from Polling.\n */\n\ninherit(XHR, Polling);\n\n/**\n * XHR supports binary\n */\n\nXHR.prototype.supportsBinary = true;\n\n/**\n * Creates a request.\n *\n * @param {String} method\n * @api private\n */\n\nXHR.prototype.request = function(opts){\n opts = opts || {};\n opts.uri = this.uri();\n opts.xd = this.xd;\n opts.xs = this.xs;\n opts.agent = this.agent || false;\n opts.supportsBinary = this.supportsBinary;\n opts.enablesXDR = this.enablesXDR;\n\n // SSL options for Node.js client\n opts.pfx = this.pfx;\n opts.key = this.key;\n opts.passphrase = this.passphrase;\n opts.cert = this.cert;\n opts.ca = this.ca;\n opts.ciphers = this.ciphers;\n opts.rejectUnauthorized = this.rejectUnauthorized;\n\n // other options for Node.js client\n opts.extraHeaders = this.extraHeaders;\n\n return new Request(opts);\n};\n\n/**\n * Sends data.\n *\n * @param {String} data to send.\n * @param {Function} called upon flush.\n * @api private\n */\n\nXHR.prototype.doWrite = function(data, fn){\n var isBinary = typeof data !== 'string' && data !== undefined;\n var req = this.request({ method: 'POST', data: data, isBinary: isBinary });\n var self = this;\n req.on('success', fn);\n req.on('error', function(err){\n self.onError('xhr post error', err);\n });\n this.sendXhr = req;\n};\n\n/**\n * Starts a poll cycle.\n *\n * @api private\n */\n\nXHR.prototype.doPoll = function(){\n debug('xhr poll');\n var req = this.request();\n var self = this;\n req.on('data', function(data){\n self.onData(data);\n });\n req.on('error', function(err){\n self.onError('xhr poll error', err);\n });\n this.pollXhr = req;\n};\n\n/**\n * Request constructor\n *\n * @param {Object} options\n * @api public\n */\n\nfunction Request(opts){\n this.method = opts.method || 'GET';\n this.uri = opts.uri;\n this.xd = !!opts.xd;\n this.xs = !!opts.xs;\n this.async = false !== opts.async;\n this.data = undefined != opts.data ? opts.data : null;\n this.agent = opts.agent;\n this.isBinary = opts.isBinary;\n this.supportsBinary = opts.supportsBinary;\n this.enablesXDR = opts.enablesXDR;\n\n // SSL options for Node.js client\n this.pfx = opts.pfx;\n this.key = opts.key;\n this.passphrase = opts.passphrase;\n this.cert = opts.cert;\n this.ca = opts.ca;\n this.ciphers = opts.ciphers;\n this.rejectUnauthorized = opts.rejectUnauthorized;\n\n // other options for Node.js client\n this.extraHeaders = opts.extraHeaders;\n\n this.create();\n}\n\n/**\n * Mix in `Emitter`.\n */\n\nEmitter(Request.prototype);\n\n/**\n * Creates the XHR object and sends the request.\n *\n * @api private\n */\n\nRequest.prototype.create = function(){\n var opts = { agent: this.agent, xdomain: this.xd, xscheme: this.xs, enablesXDR: this.enablesXDR };\n\n // SSL options for Node.js client\n opts.pfx = this.pfx;\n opts.key = this.key;\n opts.passphrase = this.passphrase;\n opts.cert = this.cert;\n opts.ca = this.ca;\n opts.ciphers = this.ciphers;\n opts.rejectUnauthorized = this.rejectUnauthorized;\n\n var xhr = this.xhr = new XMLHttpRequest(opts);\n var self = this;\n\n try {\n debug('xhr open %s: %s', this.method, this.uri);\n xhr.open(this.method, this.uri, this.async);\n try {\n if (this.extraHeaders) {\n xhr.setDisableHeaderCheck(true);\n for (var i in this.extraHeaders) {\n if (this.extraHeaders.hasOwnProperty(i)) {\n xhr.setRequestHeader(i, this.extraHeaders[i]);\n }\n }\n }\n } catch (e) {}\n if (this.supportsBinary) {\n // This has to be done after open because Firefox is stupid\n // http://stackoverflow.com/questions/13216903/get-binary-data-with-xmlhttprequest-in-a-firefox-extension\n xhr.responseType = 'arraybuffer';\n }\n\n if ('POST' == this.method) {\n try {\n if (this.isBinary) {\n xhr.setRequestHeader('Content-type', 'application/octet-stream');\n } else {\n xhr.setRequestHeader('Content-type', 'text/plain;charset=UTF-8');\n }\n } catch (e) {}\n }\n\n // ie6 check\n if ('withCredentials' in xhr) {\n xhr.withCredentials = true;\n }\n\n if (this.hasXDR()) {\n xhr.onload = function(){\n self.onLoad();\n };\n xhr.onerror = function(){\n self.onError(xhr.responseText);\n };\n } else {\n xhr.onreadystatechange = function(){\n if (4 != xhr.readyState) return;\n if (200 == xhr.status || 1223 == xhr.status) {\n self.onLoad();\n } else {\n // make sure the `error` event handler that's user-set\n // does not throw in the same tick and gets caught here\n setTimeout(function(){\n self.onError(xhr.status);\n }, 0);\n }\n };\n }\n\n debug('xhr data %s', this.data);\n xhr.send(this.data);\n } catch (e) {\n // Need to defer since .create() is called directly fhrom the constructor\n // and thus the 'error' event can only be only bound *after* this exception\n // occurs. Therefore, also, we cannot throw here at all.\n setTimeout(function() {\n self.onError(e);\n }, 0);\n return;\n }\n\n if (global.document) {\n this.index = Request.requestsCount++;\n Request.requests[this.index] = this;\n }\n};\n\n/**\n * Called upon successful response.\n *\n * @api private\n */\n\nRequest.prototype.onSuccess = function(){\n this.emit('success');\n this.cleanup();\n};\n\n/**\n * Called if we have data.\n *\n * @api private\n */\n\nRequest.prototype.onData = function(data){\n this.emit('data', data);\n this.onSuccess();\n};\n\n/**\n * Called upon error.\n *\n * @api private\n */\n\nRequest.prototype.onError = function(err){\n this.emit('error', err);\n this.cleanup(true);\n};\n\n/**\n * Cleans up house.\n *\n * @api private\n */\n\nRequest.prototype.cleanup = function(fromError){\n if ('undefined' == typeof this.xhr || null === this.xhr) {\n return;\n }\n // xmlhttprequest\n if (this.hasXDR()) {\n this.xhr.onload = this.xhr.onerror = empty;\n } else {\n this.xhr.onreadystatechange = empty;\n }\n\n if (fromError) {\n try {\n this.xhr.abort();\n } catch(e) {}\n }\n\n if (global.document) {\n delete Request.requests[this.index];\n }\n\n this.xhr = null;\n};\n\n/**\n * Called upon load.\n *\n * @api private\n */\n\nRequest.prototype.onLoad = function(){\n var data;\n try {\n var contentType;\n try {\n contentType = this.xhr.getResponseHeader('Content-Type').split(';')[0];\n } catch (e) {}\n if (contentType === 'application/octet-stream') {\n data = this.xhr.response;\n } else {\n if (!this.supportsBinary) {\n data = this.xhr.responseText;\n } else {\n try {\n data = String.fromCharCode.apply(null, new Uint8Array(this.xhr.response));\n } catch (e) {\n var ui8Arr = new Uint8Array(this.xhr.response);\n var dataArray = [];\n for (var idx = 0, length = ui8Arr.length; idx < length; idx++) {\n dataArray.push(ui8Arr[idx]);\n }\n\n data = String.fromCharCode.apply(null, dataArray);\n }\n }\n }\n } catch (e) {\n this.onError(e);\n }\n if (null != data) {\n this.onData(data);\n }\n};\n\n/**\n * Check if it has XDomainRequest.\n *\n * @api private\n */\n\nRequest.prototype.hasXDR = function(){\n return 'undefined' !== typeof global.XDomainRequest && !this.xs && this.enablesXDR;\n};\n\n/**\n * Aborts the request.\n *\n * @api public\n */\n\nRequest.prototype.abort = function(){\n this.cleanup();\n};\n\n/**\n * Aborts pending requests when unloading the window. This is needed to prevent\n * memory leaks (e.g. when using IE) and to ensure that no spurious error is\n * emitted.\n */\n\nif (global.document) {\n Request.requestsCount = 0;\n Request.requests = {};\n if (global.attachEvent) {\n global.attachEvent('onunload', unloadHandler);\n } else if (global.addEventListener) {\n global.addEventListener('beforeunload', unloadHandler, false);\n }\n}\n\nfunction unloadHandler() {\n for (var i in Request.requests) {\n if (Request.requests.hasOwnProperty(i)) {\n Request.requests[i].abort();\n }\n }\n}\n","/**\n * Module dependencies.\n */\n\nvar Transport = require('../transport');\nvar parseqs = require('parseqs');\nvar parser = require('engine.io-parser');\nvar inherit = require('component-inherit');\nvar yeast = require('yeast');\nvar debug = require('debug')('engine.io-client:polling');\n\n/**\n * Module exports.\n */\n\nmodule.exports = Polling;\n\n/**\n * Is XHR2 supported?\n */\n\nvar hasXHR2 = (function() {\n var XMLHttpRequest = require('xmlhttprequest-ssl');\n var xhr = new XMLHttpRequest({ xdomain: false });\n return null != xhr.responseType;\n})();\n\n/**\n * Polling interface.\n *\n * @param {Object} opts\n * @api private\n */\n\nfunction Polling(opts){\n var forceBase64 = (opts && opts.forceBase64);\n if (!hasXHR2 || forceBase64) {\n this.supportsBinary = false;\n }\n Transport.call(this, opts);\n}\n\n/**\n * Inherits from Transport.\n */\n\ninherit(Polling, Transport);\n\n/**\n * Transport name.\n */\n\nPolling.prototype.name = 'polling';\n\n/**\n * Opens the socket (triggers polling). We write a PING message to determine\n * when the transport is open.\n *\n * @api private\n */\n\nPolling.prototype.doOpen = function(){\n this.poll();\n};\n\n/**\n * Pauses polling.\n *\n * @param {Function} callback upon buffers are flushed and transport is paused\n * @api private\n */\n\nPolling.prototype.pause = function(onPause){\n var pending = 0;\n var self = this;\n\n this.readyState = 'pausing';\n\n function pause(){\n debug('paused');\n self.readyState = 'paused';\n onPause();\n }\n\n if (this.polling || !this.writable) {\n var total = 0;\n\n if (this.polling) {\n debug('we are currently polling - waiting to pause');\n total++;\n this.once('pollComplete', function(){\n debug('pre-pause polling complete');\n --total || pause();\n });\n }\n\n if (!this.writable) {\n debug('we are currently writing - waiting to pause');\n total++;\n this.once('drain', function(){\n debug('pre-pause writing complete');\n --total || pause();\n });\n }\n } else {\n pause();\n }\n};\n\n/**\n * Starts polling cycle.\n *\n * @api public\n */\n\nPolling.prototype.poll = function(){\n debug('polling');\n this.polling = true;\n this.doPoll();\n this.emit('poll');\n};\n\n/**\n * Overloads onData to detect payloads.\n *\n * @api private\n */\n\nPolling.prototype.onData = function(data){\n var self = this;\n debug('polling got data %s', data);\n var callback = function(packet, index, total) {\n // if its the first message we consider the transport open\n if ('opening' == self.readyState) {\n self.onOpen();\n }\n\n // if its a close packet, we close the ongoing requests\n if ('close' == packet.type) {\n self.onClose();\n return false;\n }\n\n // otherwise bypass onData and handle the message\n self.onPacket(packet);\n };\n\n // decode payload\n parser.decodePayload(data, this.socket.binaryType, callback);\n\n // if an event did not trigger closing\n if ('closed' != this.readyState) {\n // if we got data we're not polling\n this.polling = false;\n this.emit('pollComplete');\n\n if ('open' == this.readyState) {\n this.poll();\n } else {\n debug('ignoring poll - transport state \"%s\"', this.readyState);\n }\n }\n};\n\n/**\n * For polling, send a close packet.\n *\n * @api private\n */\n\nPolling.prototype.doClose = function(){\n var self = this;\n\n function close(){\n debug('writing close packet');\n self.write([{ type: 'close' }]);\n }\n\n if ('open' == this.readyState) {\n debug('transport open - closing');\n close();\n } else {\n // in case we're trying to close while\n // handshaking is in progress (GH-164)\n debug('transport not open - deferring close');\n this.once('open', close);\n }\n};\n\n/**\n * Writes a packets payload.\n *\n * @param {Array} data packets\n * @param {Function} drain callback\n * @api private\n */\n\nPolling.prototype.write = function(packets){\n var self = this;\n this.writable = false;\n var callbackfn = function() {\n self.writable = true;\n self.emit('drain');\n };\n\n var self = this;\n parser.encodePayload(packets, this.supportsBinary, function(data) {\n self.doWrite(data, callbackfn);\n });\n};\n\n/**\n * Generates uri for connection.\n *\n * @api private\n */\n\nPolling.prototype.uri = function(){\n var query = this.query || {};\n var schema = this.secure ? 'https' : 'http';\n var port = '';\n\n // cache busting is forced\n if (false !== this.timestampRequests) {\n query[this.timestampParam] = yeast();\n }\n\n if (!this.supportsBinary && !query.sid) {\n query.b64 = 1;\n }\n\n query = parseqs.encode(query);\n\n // avoid port if default for schema\n if (this.port && (('https' == schema && this.port != 443) ||\n ('http' == schema && this.port != 80))) {\n port = ':' + this.port;\n }\n\n // prepend ? to query\n if (query.length) {\n query = '?' + query;\n }\n\n var ipv6 = this.hostname.indexOf(':') !== -1;\n return schema + '://' + (ipv6 ? '[' + this.hostname + ']' : this.hostname) + port + this.path + query;\n};\n","/**\n * Module dependencies.\n */\n\nvar Transport = require('../transport');\nvar parser = require('engine.io-parser');\nvar parseqs = require('parseqs');\nvar inherit = require('component-inherit');\nvar yeast = require('yeast');\nvar debug = require('debug')('engine.io-client:websocket');\nvar BrowserWebSocket = global.WebSocket || global.MozWebSocket;\n\n/**\n * Get either the `WebSocket` or `MozWebSocket` globals\n * in the browser or the WebSocket-compatible interface\n * exposed by `ws` for Node environment.\n */\n\nvar WebSocket = BrowserWebSocket || (typeof window !== 'undefined' ? null : require('ws'));\n\n/**\n * Module exports.\n */\n\nmodule.exports = WS;\n\n/**\n * WebSocket transport constructor.\n *\n * @api {Object} connection options\n * @api public\n */\n\nfunction WS(opts){\n var forceBase64 = (opts && opts.forceBase64);\n if (forceBase64) {\n this.supportsBinary = false;\n }\n this.perMessageDeflate = opts.perMessageDeflate;\n Transport.call(this, opts);\n}\n\n/**\n * Inherits from Transport.\n */\n\ninherit(WS, Transport);\n\n/**\n * Transport name.\n *\n * @api public\n */\n\nWS.prototype.name = 'websocket';\n\n/*\n * WebSockets support binary\n */\n\nWS.prototype.supportsBinary = true;\n\n/**\n * Opens socket.\n *\n * @api private\n */\n\nWS.prototype.doOpen = function(){\n if (!this.check()) {\n // let probe timeout\n return;\n }\n\n var self = this;\n var uri = this.uri();\n var protocols = void(0);\n var opts = {\n agent: this.agent,\n perMessageDeflate: this.perMessageDeflate\n };\n\n // SSL options for Node.js client\n opts.pfx = this.pfx;\n opts.key = this.key;\n opts.passphrase = this.passphrase;\n opts.cert = this.cert;\n opts.ca = this.ca;\n opts.ciphers = this.ciphers;\n opts.rejectUnauthorized = this.rejectUnauthorized;\n if (this.extraHeaders) {\n opts.headers = this.extraHeaders;\n }\n\n this.ws = BrowserWebSocket ? new WebSocket(uri) : new WebSocket(uri, protocols, opts);\n\n if (this.ws.binaryType === undefined) {\n this.supportsBinary = false;\n }\n\n if (this.ws.supports && this.ws.supports.binary) {\n this.supportsBinary = true;\n this.ws.binaryType = 'buffer';\n } else {\n this.ws.binaryType = 'arraybuffer';\n }\n\n this.addEventListeners();\n};\n\n/**\n * Adds event listeners to the socket\n *\n * @api private\n */\n\nWS.prototype.addEventListeners = function(){\n var self = this;\n\n this.ws.onopen = function(){\n self.onOpen();\n };\n this.ws.onclose = function(){\n self.onClose();\n };\n this.ws.onmessage = function(ev){\n self.onData(ev.data);\n };\n this.ws.onerror = function(e){\n self.onError('websocket error', e);\n };\n};\n\n/**\n * Override `onData` to use a timer on iOS.\n * See: https://gist.github.com/mloughran/2052006\n *\n * @api private\n */\n\nif ('undefined' != typeof navigator\n && /iPad|iPhone|iPod/i.test(navigator.userAgent)) {\n WS.prototype.onData = function(data){\n var self = this;\n setTimeout(function(){\n Transport.prototype.onData.call(self, data);\n }, 0);\n };\n}\n\n/**\n * Writes data to socket.\n *\n * @param {Array} array of packets.\n * @api private\n */\n\nWS.prototype.write = function(packets){\n var self = this;\n this.writable = false;\n\n // encodePacket efficient as it uses WS framing\n // no need for encodePayload\n var total = packets.length;\n for (var i = 0, l = total; i < l; i++) {\n (function(packet) {\n parser.encodePacket(packet, self.supportsBinary, function(data) {\n if (!BrowserWebSocket) {\n // always create a new object (GH-437)\n var opts = {};\n if (packet.options) {\n opts.compress = packet.options.compress;\n }\n\n if (self.perMessageDeflate) {\n var len = 'string' == typeof data ? global.Buffer.byteLength(data) : data.length;\n if (len < self.perMessageDeflate.threshold) {\n opts.compress = false;\n }\n }\n }\n\n //Sometimes the websocket has already been closed but the browser didn't\n //have a chance of informing us about it yet, in that case send will\n //throw an error\n try {\n if (BrowserWebSocket) {\n // TypeError is thrown when passing the second argument on Safari\n self.ws.send(data);\n } else {\n self.ws.send(data, opts);\n }\n } catch (e){\n debug('websocket closed before onclose event');\n }\n\n --total || done();\n });\n })(packets[i]);\n }\n\n function done(){\n self.emit('flush');\n\n // fake drain\n // defer to next tick to allow Socket to clear writeBuffer\n setTimeout(function(){\n self.writable = true;\n self.emit('drain');\n }, 0);\n }\n};\n\n/**\n * Called upon close\n *\n * @api private\n */\n\nWS.prototype.onClose = function(){\n Transport.prototype.onClose.call(this);\n};\n\n/**\n * Closes socket.\n *\n * @api private\n */\n\nWS.prototype.doClose = function(){\n if (typeof this.ws !== 'undefined') {\n this.ws.close();\n }\n};\n\n/**\n * Generates uri for connection.\n *\n * @api private\n */\n\nWS.prototype.uri = function(){\n var query = this.query || {};\n var schema = this.secure ? 'wss' : 'ws';\n var port = '';\n\n // avoid port if default for schema\n if (this.port && (('wss' == schema && this.port != 443)\n || ('ws' == schema && this.port != 80))) {\n port = ':' + this.port;\n }\n\n // append timestamp to URI\n if (this.timestampRequests) {\n query[this.timestampParam] = yeast();\n }\n\n // communicate binary support capabilities\n if (!this.supportsBinary) {\n query.b64 = 1;\n }\n\n query = parseqs.encode(query);\n\n // prepend ? to query\n if (query.length) {\n query = '?' + query;\n }\n\n var ipv6 = this.hostname.indexOf(':') !== -1;\n return schema + '://' + (ipv6 ? '[' + this.hostname + ']' : this.hostname) + port + this.path + query;\n};\n\n/**\n * Feature detection for WebSocket.\n *\n * @return {Boolean} whether this transport is available.\n * @api public\n */\n\nWS.prototype.check = function(){\n return !!WebSocket && !('__initialize' in WebSocket && this.name === WS.prototype.name);\n};\n","// browser shim for xmlhttprequest module\nvar hasCORS = require('has-cors');\n\nmodule.exports = function(opts) {\n var xdomain = opts.xdomain;\n\n // scheme must be same when usign XDomainRequest\n // http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx\n var xscheme = opts.xscheme;\n\n // XDomainRequest has a flow of not sending cookie, therefore it should be disabled as a default.\n // https://github.com/Automattic/engine.io-client/pull/217\n var enablesXDR = opts.enablesXDR;\n\n // XMLHttpRequest can be disabled on IE\n try {\n if ('undefined' != typeof XMLHttpRequest && (!xdomain || hasCORS)) {\n return new XMLHttpRequest();\n }\n } catch (e) { }\n\n // Use XDomainRequest for IE8 if enablesXDR is true\n // because loading bar keeps flashing when using jsonp-polling\n // https://github.com/yujiosaka/socke.io-ie8-loading-example\n try {\n if ('undefined' != typeof XDomainRequest && !xscheme && enablesXDR) {\n return new XDomainRequest();\n }\n } catch (e) { }\n\n if (!xdomain) {\n try {\n return new ActiveXObject('Microsoft.XMLHTTP');\n } catch(e) { }\n }\n}\n","\n/**\n * Expose `Emitter`.\n */\n\nmodule.exports = Emitter;\n\n/**\n * Initialize a new `Emitter`.\n *\n * @api public\n */\n\nfunction Emitter(obj) {\n if (obj) return mixin(obj);\n};\n\n/**\n * Mixin the emitter properties.\n *\n * @param {Object} obj\n * @return {Object}\n * @api private\n */\n\nfunction mixin(obj) {\n for (var key in Emitter.prototype) {\n obj[key] = Emitter.prototype[key];\n }\n return obj;\n}\n\n/**\n * Listen on the given `event` with `fn`.\n *\n * @param {String} event\n * @param {Function} fn\n * @return {Emitter}\n * @api public\n */\n\nEmitter.prototype.on =\nEmitter.prototype.addEventListener = function(event, fn){\n this._callbacks = this._callbacks || {};\n (this._callbacks[event] = this._callbacks[event] || [])\n .push(fn);\n return this;\n};\n\n/**\n * Adds an `event` listener that will be invoked a single\n * time then automatically removed.\n *\n * @param {String} event\n * @param {Function} fn\n * @return {Emitter}\n * @api public\n */\n\nEmitter.prototype.once = function(event, fn){\n var self = this;\n this._callbacks = this._callbacks || {};\n\n function on() {\n self.off(event, on);\n fn.apply(this, arguments);\n }\n\n on.fn = fn;\n this.on(event, on);\n return this;\n};\n\n/**\n * Remove the given callback for `event` or all\n * registered callbacks.\n *\n * @param {String} event\n * @param {Function} fn\n * @return {Emitter}\n * @api public\n */\n\nEmitter.prototype.off =\nEmitter.prototype.removeListener =\nEmitter.prototype.removeAllListeners =\nEmitter.prototype.removeEventListener = function(event, fn){\n this._callbacks = this._callbacks || {};\n\n // all\n if (0 == arguments.length) {\n this._callbacks = {};\n return this;\n }\n\n // specific event\n var callbacks = this._callbacks[event];\n if (!callbacks) return this;\n\n // remove all handlers\n if (1 == arguments.length) {\n delete this._callbacks[event];\n return this;\n }\n\n // remove specific handler\n var cb;\n for (var i = 0; i < callbacks.length; i++) {\n cb = callbacks[i];\n if (cb === fn || cb.fn === fn) {\n callbacks.splice(i, 1);\n break;\n }\n }\n return this;\n};\n\n/**\n * Emit `event` with the given args.\n *\n * @param {String} event\n * @param {Mixed} ...\n * @return {Emitter}\n */\n\nEmitter.prototype.emit = function(event){\n this._callbacks = this._callbacks || {};\n var args = [].slice.call(arguments, 1)\n , callbacks = this._callbacks[event];\n\n if (callbacks) {\n callbacks = callbacks.slice(0);\n for (var i = 0, len = callbacks.length; i < len; ++i) {\n callbacks[i].apply(this, args);\n }\n }\n\n return this;\n};\n\n/**\n * Return array of callbacks for `event`.\n *\n * @param {String} event\n * @return {Array}\n * @api public\n */\n\nEmitter.prototype.listeners = function(event){\n this._callbacks = this._callbacks || {};\n return this._callbacks[event] || [];\n};\n\n/**\n * Check if this emitter has `event` handlers.\n *\n * @param {String} event\n * @return {Boolean}\n * @api public\n */\n\nEmitter.prototype.hasListeners = function(event){\n return !! this.listeners(event).length;\n};\n","/**\n * Module dependencies.\n */\n\nvar keys = require('./keys');\nvar hasBinary = require('has-binary');\nvar sliceBuffer = require('arraybuffer.slice');\nvar base64encoder = require('base64-arraybuffer');\nvar after = require('after');\nvar utf8 = require('utf8');\n\n/**\n * Check if we are running an android browser. That requires us to use\n * ArrayBuffer with polling transports...\n *\n * http://ghinda.net/jpeg-blob-ajax-android/\n */\n\nvar isAndroid = navigator.userAgent.match(/Android/i);\n\n/**\n * Check if we are running in PhantomJS.\n * Uploading a Blob with PhantomJS does not work correctly, as reported here:\n * https://github.com/ariya/phantomjs/issues/11395\n * @type boolean\n */\nvar isPhantomJS = /PhantomJS/i.test(navigator.userAgent);\n\n/**\n * When true, avoids using Blobs to encode payloads.\n * @type boolean\n */\nvar dontSendBlobs = isAndroid || isPhantomJS;\n\n/**\n * Current protocol version.\n */\n\nexports.protocol = 3;\n\n/**\n * Packet types.\n */\n\nvar packets = exports.packets = {\n open: 0 // non-ws\n , close: 1 // non-ws\n , ping: 2\n , pong: 3\n , message: 4\n , upgrade: 5\n , noop: 6\n};\n\nvar packetslist = keys(packets);\n\n/**\n * Premade error packet.\n */\n\nvar err = { type: 'error', data: 'parser error' };\n\n/**\n * Create a blob api even for blob builder when vendor prefixes exist\n */\n\nvar Blob = require('blob');\n\n/**\n * Encodes a packet.\n *\n * <packet type id> [ <data> ]\n *\n * Example:\n *\n * 5hello world\n * 3\n * 4\n *\n * Binary is encoded in an identical principle\n *\n * @api private\n */\n\nexports.encodePacket = function (packet, supportsBinary, utf8encode, callback) {\n if ('function' == typeof supportsBinary) {\n callback = supportsBinary;\n supportsBinary = false;\n }\n\n if ('function' == typeof utf8encode) {\n callback = utf8encode;\n utf8encode = null;\n }\n\n var data = (packet.data === undefined)\n ? undefined\n : packet.data.buffer || packet.data;\n\n if (global.ArrayBuffer && data instanceof ArrayBuffer) {\n return encodeArrayBuffer(packet, supportsBinary, callback);\n } else if (Blob && data instanceof global.Blob) {\n return encodeBlob(packet, supportsBinary, callback);\n }\n\n // might be an object with { base64: true, data: dataAsBase64String }\n if (data && data.base64) {\n return encodeBase64Object(packet, callback);\n }\n\n // Sending data as a utf-8 string\n var encoded = packets[packet.type];\n\n // data fragment is optional\n if (undefined !== packet.data) {\n encoded += utf8encode ? utf8.encode(String(packet.data)) : String(packet.data);\n }\n\n return callback('' + encoded);\n\n};\n\nfunction encodeBase64Object(packet, callback) {\n // packet data is an object { base64: true, data: dataAsBase64String }\n var message = 'b' + exports.packets[packet.type] + packet.data.data;\n return callback(message);\n}\n\n/**\n * Encode packet helpers for binary types\n */\n\nfunction encodeArrayBuffer(packet, supportsBinary, callback) {\n if (!supportsBinary) {\n return exports.encodeBase64Packet(packet, callback);\n }\n\n var data = packet.data;\n var contentArray = new Uint8Array(data);\n var resultBuffer = new Uint8Array(1 + data.byteLength);\n\n resultBuffer[0] = packets[packet.type];\n for (var i = 0; i < contentArray.length; i++) {\n resultBuffer[i+1] = contentArray[i];\n }\n\n return callback(resultBuffer.buffer);\n}\n\nfunction encodeBlobAsArrayBuffer(packet, supportsBinary, callback) {\n if (!supportsBinary) {\n return exports.encodeBase64Packet(packet, callback);\n }\n\n var fr = new FileReader();\n fr.onload = function() {\n packet.data = fr.result;\n exports.encodePacket(packet, supportsBinary, true, callback);\n };\n return fr.readAsArrayBuffer(packet.data);\n}\n\nfunction encodeBlob(packet, supportsBinary, callback) {\n if (!supportsBinary) {\n return exports.encodeBase64Packet(packet, callback);\n }\n\n if (dontSendBlobs) {\n return encodeBlobAsArrayBuffer(packet, supportsBinary, callback);\n }\n\n var length = new Uint8Array(1);\n length[0] = packets[packet.type];\n var blob = new Blob([length.buffer, packet.data]);\n\n return callback(blob);\n}\n\n/**\n * Encodes a packet with binary data in a base64 string\n *\n * @param {Object} packet, has `type` and `data`\n * @return {String} base64 encoded message\n */\n\nexports.encodeBase64Packet = function(packet, callback) {\n var message = 'b' + exports.packets[packet.type];\n if (Blob && packet.data instanceof global.Blob) {\n var fr = new FileReader();\n fr.onload = function() {\n var b64 = fr.result.split(',')[1];\n callback(message + b64);\n };\n return fr.readAsDataURL(packet.data);\n }\n\n var b64data;\n try {\n b64data = String.fromCharCode.apply(null, new Uint8Array(packet.data));\n } catch (e) {\n // iPhone Safari doesn't let you apply with typed arrays\n var typed = new Uint8Array(packet.data);\n var basic = new Array(typed.length);\n for (var i = 0; i < typed.length; i++) {\n basic[i] = typed[i];\n }\n b64data = String.fromCharCode.apply(null, basic);\n }\n message += global.btoa(b64data);\n return callback(message);\n};\n\n/**\n * Decodes a packet. Changes format to Blob if requested.\n *\n * @return {Object} with `type` and `data` (if any)\n * @api private\n */\n\nexports.decodePacket = function (data, binaryType, utf8decode) {\n // String data\n if (typeof data == 'string' || data === undefined) {\n if (data.charAt(0) == 'b') {\n return exports.decodeBase64Packet(data.substr(1), binaryType);\n }\n\n if (utf8decode) {\n try {\n data = utf8.decode(data);\n } catch (e) {\n return err;\n }\n }\n var type = data.charAt(0);\n\n if (Number(type) != type || !packetslist[type]) {\n return err;\n }\n\n if (data.length > 1) {\n return { type: packetslist[type], data: data.substring(1) };\n } else {\n return { type: packetslist[type] };\n }\n }\n\n var asArray = new Uint8Array(data);\n var type = asArray[0];\n var rest = sliceBuffer(data, 1);\n if (Blob && binaryType === 'blob') {\n rest = new Blob([rest]);\n }\n return { type: packetslist[type], data: rest };\n};\n\n/**\n * Decodes a packet encoded in a base64 string\n *\n * @param {String} base64 encoded message\n * @return {Object} with `type` and `data` (if any)\n */\n\nexports.decodeBase64Packet = function(msg, binaryType) {\n var type = packetslist[msg.charAt(0)];\n if (!global.ArrayBuffer) {\n return { type: type, data: { base64: true, data: msg.substr(1) } };\n }\n\n var data = base64encoder.decode(msg.substr(1));\n\n if (binaryType === 'blob' && Blob) {\n data = new Blob([data]);\n }\n\n return { type: type, data: data };\n};\n\n/**\n * Encodes multiple messages (payload).\n *\n * <length>:data\n *\n * Example:\n *\n * 11:hello world2:hi\n *\n * If any contents are binary, they will be encoded as base64 strings. Base64\n * encoded strings are marked with a b before the length specifier\n *\n * @param {Array} packets\n * @api private\n */\n\nexports.encodePayload = function (packets, supportsBinary, callback) {\n if (typeof supportsBinary == 'function') {\n callback = supportsBinary;\n supportsBinary = null;\n }\n\n var isBinary = hasBinary(packets);\n\n if (supportsBinary && isBinary) {\n if (Blob && !dontSendBlobs) {\n return exports.encodePayloadAsBlob(packets, callback);\n }\n\n return exports.encodePayloadAsArrayBuffer(packets, callback);\n }\n\n if (!packets.length) {\n return callback('0:');\n }\n\n function setLengthHeader(message) {\n return message.length + ':' + message;\n }\n\n function encodeOne(packet, doneCallback) {\n exports.encodePacket(packet, !isBinary ? false : supportsBinary, true, function(message) {\n doneCallback(null, setLengthHeader(message));\n });\n }\n\n map(packets, encodeOne, function(err, results) {\n return callback(results.join(''));\n });\n};\n\n/**\n * Async array map using after\n */\n\nfunction map(ary, each, done) {\n var result = new Array(ary.length);\n var next = after(ary.length, done);\n\n var eachWithIndex = function(i, el, cb) {\n each(el, function(error, msg) {\n result[i] = msg;\n cb(error, result);\n });\n };\n\n for (var i = 0; i < ary.length; i++) {\n eachWithIndex(i, ary[i], next);\n }\n}\n\n/*\n * Decodes data when a payload is maybe expected. Possible binary contents are\n * decoded from their base64 representation\n *\n * @param {String} data, callback method\n * @api public\n */\n\nexports.decodePayload = function (data, binaryType, callback) {\n if (typeof data != 'string') {\n return exports.decodePayloadAsBinary(data, binaryType, callback);\n }\n\n if (typeof binaryType === 'function') {\n callback = binaryType;\n binaryType = null;\n }\n\n var packet;\n if (data == '') {\n // parser error - ignoring payload\n return callback(err, 0, 1);\n }\n\n var length = ''\n , n, msg;\n\n for (var i = 0, l = data.length; i < l; i++) {\n var chr = data.charAt(i);\n\n if (':' != chr) {\n length += chr;\n } else {\n if ('' == length || (length != (n = Number(length)))) {\n // parser error - ignoring payload\n return callback(err, 0, 1);\n }\n\n msg = data.substr(i + 1, n);\n\n if (length != msg.length) {\n // parser error - ignoring payload\n return callback(err, 0, 1);\n }\n\n if (msg.length) {\n packet = exports.decodePacket(msg, binaryType, true);\n\n if (err.type == packet.type && err.data == packet.data) {\n // parser error in individual packet - ignoring payload\n return callback(err, 0, 1);\n }\n\n var ret = callback(packet, i + n, l);\n if (false === ret) return;\n }\n\n // advance cursor\n i += n;\n length = '';\n }\n }\n\n if (length != '') {\n // parser error - ignoring payload\n return callback(err, 0, 1);\n }\n\n};\n\n/**\n * Encodes multiple messages (payload) as binary.\n *\n * <1 = binary, 0 = string><number from 0-9><number from 0-9>[...]<number\n * 255><data>\n *\n * Example:\n * 1 3 255 1 2 3, if the binary contents are interpreted as 8 bit integers\n *\n * @param {Array} packets\n * @return {ArrayBuffer} encoded payload\n * @api private\n */\n\nexports.encodePayloadAsArrayBuffer = function(packets, callback) {\n if (!packets.length) {\n return callback(new ArrayBuffer(0));\n }\n\n function encodeOne(packet, doneCallback) {\n exports.encodePacket(packet, true, true, function(data) {\n return doneCallback(null, data);\n });\n }\n\n map(packets, encodeOne, function(err, encodedPackets) {\n var totalLength = encodedPackets.reduce(function(acc, p) {\n var len;\n if (typeof p === 'string'){\n len = p.length;\n } else {\n len = p.byteLength;\n }\n return acc + len.toString().length + len + 2; // string/binary identifier + separator = 2\n }, 0);\n\n var resultArray = new Uint8Array(totalLength);\n\n var bufferIndex = 0;\n encodedPackets.forEach(function(p) {\n var isString = typeof p === 'string';\n var ab = p;\n if (isString) {\n var view = new Uint8Array(p.length);\n for (var i = 0; i < p.length; i++) {\n view[i] = p.charCodeAt(i);\n }\n ab = view.buffer;\n }\n\n if (isString) { // not true binary\n resultArray[bufferIndex++] = 0;\n } else { // true binary\n resultArray[bufferIndex++] = 1;\n }\n\n var lenStr = ab.byteLength.toString();\n for (var i = 0; i < lenStr.length; i++) {\n resultArray[bufferIndex++] = parseInt(lenStr[i]);\n }\n resultArray[bufferIndex++] = 255;\n\n var view = new Uint8Array(ab);\n for (var i = 0; i < view.length; i++) {\n resultArray[bufferIndex++] = view[i];\n }\n });\n\n return callback(resultArray.buffer);\n });\n};\n\n/**\n * Encode as Blob\n */\n\nexports.encodePayloadAsBlob = function(packets, callback) {\n function encodeOne(packet, doneCallback) {\n exports.encodePacket(packet, true, true, function(encoded) {\n var binaryIdentifier = new Uint8Array(1);\n binaryIdentifier[0] = 1;\n if (typeof encoded === 'string') {\n var view = new Uint8Array(encoded.length);\n for (var i = 0; i < encoded.length; i++) {\n view[i] = encoded.charCodeAt(i);\n }\n encoded = view.buffer;\n binaryIdentifier[0] = 0;\n }\n\n var len = (encoded instanceof ArrayBuffer)\n ? encoded.byteLength\n : encoded.size;\n\n var lenStr = len.toString();\n var lengthAry = new Uint8Array(lenStr.length + 1);\n for (var i = 0; i < lenStr.length; i++) {\n lengthAry[i] = parseInt(lenStr[i]);\n }\n lengthAry[lenStr.length] = 255;\n\n if (Blob) {\n var blob = new Blob([binaryIdentifier.buffer, lengthAry.buffer, encoded]);\n doneCallback(null, blob);\n }\n });\n }\n\n map(packets, encodeOne, function(err, results) {\n return callback(new Blob(results));\n });\n};\n\n/*\n * Decodes data when a payload is maybe expected. Strings are decoded by\n * interpreting each byte as a key code for entries marked to start with 0. See\n * description of encodePayloadAsBinary\n *\n * @param {ArrayBuffer} data, callback method\n * @api public\n */\n\nexports.decodePayloadAsBinary = function (data, binaryType, callback) {\n if (typeof binaryType === 'function') {\n callback = binaryType;\n binaryType = null;\n }\n\n var bufferTail = data;\n var buffers = [];\n\n var numberTooLong = false;\n while (bufferTail.byteLength > 0) {\n var tailArray = new Uint8Array(bufferTail);\n var isString = tailArray[0] === 0;\n var msgLength = '';\n\n for (var i = 1; ; i++) {\n if (tailArray[i] == 255) break;\n\n if (msgLength.length > 310) {\n numberTooLong = true;\n break;\n }\n\n msgLength += tailArray[i];\n }\n\n if(numberTooLong) return callback(err, 0, 1);\n\n bufferTail = sliceBuffer(bufferTail, 2 + msgLength.length);\n msgLength = parseInt(msgLength);\n\n var msg = sliceBuffer(bufferTail, 0, msgLength);\n if (isString) {\n try {\n msg = String.fromCharCode.apply(null, new Uint8Array(msg));\n } catch (e) {\n // iPhone Safari doesn't let you apply to typed arrays\n var typed = new Uint8Array(msg);\n msg = '';\n for (var i = 0; i < typed.length; i++) {\n msg += String.fromCharCode(typed[i]);\n }\n }\n }\n\n buffers.push(msg);\n bufferTail = sliceBuffer(bufferTail, msgLength);\n }\n\n var total = buffers.length;\n buffers.forEach(function(buffer, i) {\n callback(exports.decodePacket(buffer, binaryType, true), i, total);\n });\n};\n","\n/**\n * Gets the keys for an object.\n *\n * @return {Array} keys\n * @api private\n */\n\nmodule.exports = Object.keys || function keys (obj){\n var arr = [];\n var has = Object.prototype.hasOwnProperty;\n\n for (var i in obj) {\n if (has.call(obj, i)) {\n arr.push(i);\n }\n }\n return arr;\n};\n","\n/*\n * Module requirements.\n */\n\nvar isArray = require('isarray');\n\n/**\n * Module exports.\n */\n\nmodule.exports = hasBinary;\n\n/**\n * Checks for binary data.\n *\n * Right now only Buffer and ArrayBuffer are supported..\n *\n * @param {Object} anything\n * @api public\n */\n\nfunction hasBinary(data) {\n\n function _hasBinary(obj) {\n if (!obj) return false;\n\n if ( (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer) ||\n (global.Blob && obj instanceof Blob) ||\n (global.File && obj instanceof File)\n ) {\n return true;\n }\n\n if (isArray(obj)) {\n for (var i = 0; i < obj.length; i++) {\n if (_hasBinary(obj[i])) {\n return true;\n }\n }\n } else if (obj && 'object' == typeof obj) {\n if (obj.toJSON) {\n obj = obj.toJSON();\n }\n\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key) && _hasBinary(obj[key])) {\n return true;\n }\n }\n }\n\n return false;\n }\n\n return _hasBinary(data);\n}\n","\n/*\n * Module requirements.\n */\n\nvar isArray = require('isarray');\n\n/**\n * Module exports.\n */\n\nmodule.exports = hasBinary;\n\n/**\n * Checks for binary data.\n *\n * Right now only Buffer and ArrayBuffer are supported..\n *\n * @param {Object} anything\n * @api public\n */\n\nfunction hasBinary(data) {\n\n function _hasBinary(obj) {\n if (!obj) return false;\n\n if ( (global.Buffer && global.Buffer.isBuffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer) ||\n (global.Blob && obj instanceof Blob) ||\n (global.File && obj instanceof File)\n ) {\n return true;\n }\n\n if (isArray(obj)) {\n for (var i = 0; i < obj.length; i++) {\n if (_hasBinary(obj[i])) {\n return true;\n }\n }\n } else if (obj && 'object' == typeof obj) {\n // see: https://github.com/Automattic/has-binary/pull/4\n if (obj.toJSON && 'function' == typeof obj.toJSON) {\n obj = obj.toJSON();\n }\n\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key) && _hasBinary(obj[key])) {\n return true;\n }\n }\n }\n\n return false;\n }\n\n return _hasBinary(data);\n}\n","\n/**\n * Module exports.\n *\n * Logic borrowed from Modernizr:\n *\n * - https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cors.js\n */\n\ntry {\n module.exports = typeof XMLHttpRequest !== 'undefined' &&\n 'withCredentials' in new XMLHttpRequest();\n} catch (err) {\n // if XMLHttp support is disabled in IE then it will throw\n // when trying to create\n module.exports = false;\n}\n","\nvar indexOf = [].indexOf;\n\nmodule.exports = function(arr, obj){\n if (indexOf) return arr.indexOf(obj);\n for (var i = 0; i < arr.length; ++i) {\n if (arr[i] === obj) return i;\n }\n return -1;\n};","module.exports = Array.isArray || function (arr) {\n return Object.prototype.toString.call(arr) == '[object Array]';\n};\n","/*! JSON v3.3.2 | http://bestiejs.github.io/json3 | Copyright 2012-2014, Kit Cambridge | http://kit.mit-license.org */\n;(function () {\n // Detect the `define` function exposed by asynchronous module loaders. The\n // strict `define` check is necessary for compatibility with `r.js`.\n var isLoader = typeof define === \"function\" && define.amd;\n\n // A set of types used to distinguish objects from primitives.\n var objectTypes = {\n \"function\": true,\n \"object\": true\n };\n\n // Detect the `exports` object exposed by CommonJS implementations.\n var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports;\n\n // Use the `global` object exposed by Node (including Browserify via\n // `insert-module-globals`), Narwhal, and Ringo as the default context,\n // and the `window` object in browsers. Rhino exports a `global` function\n // instead.\n var root = objectTypes[typeof window] && window || this,\n freeGlobal = freeExports && objectTypes[typeof module] && module && !module.nodeType && typeof global == \"object\" && global;\n\n if (freeGlobal && (freeGlobal[\"global\"] === freeGlobal || freeGlobal[\"window\"] === freeGlobal || freeGlobal[\"self\"] === freeGlobal)) {\n root = freeGlobal;\n }\n\n // Public: Initializes JSON 3 using the given `context` object, attaching the\n // `stringify` and `parse` functions to the specified `exports` object.\n function runInContext(context, exports) {\n context || (context = root[\"Object\"]());\n exports || (exports = root[\"Object\"]());\n\n // Native constructor aliases.\n var Number = context[\"Number\"] || root[\"Number\"],\n String = context[\"String\"] || root[\"String\"],\n Object = context[\"Object\"] || root[\"Object\"],\n Date = context[\"Date\"] || root[\"Date\"],\n SyntaxError = context[\"SyntaxError\"] || root[\"SyntaxError\"],\n TypeError = context[\"TypeError\"] || root[\"TypeError\"],\n Math = context[\"Math\"] || root[\"Math\"],\n nativeJSON = context[\"JSON\"] || root[\"JSON\"];\n\n // Delegate to the native `stringify` and `parse` implementations.\n if (typeof nativeJSON == \"object\" && nativeJSON) {\n exports.stringify = nativeJSON.stringify;\n exports.parse = nativeJSON.parse;\n }\n\n // Convenience aliases.\n var objectProto = Object.prototype,\n getClass = objectProto.toString,\n isProperty, forEach, undef;\n\n // Test the `Date#getUTC*` methods. Based on work by @Yaffle.\n var isExtended = new Date(-3509827334573292);\n try {\n // The `getUTCFullYear`, `Month`, and `Date` methods return nonsensical\n // results for certain dates in Opera >= 10.53.\n isExtended = isExtended.getUTCFullYear() == -109252 && isExtended.getUTCMonth() === 0 && isExtended.getUTCDate() === 1 &&\n // Safari < 2.0.2 stores the internal millisecond time value correctly,\n // but clips the values returned by the date methods to the range of\n // signed 32-bit integers ([-2 ** 31, 2 ** 31 - 1]).\n isExtended.getUTCHours() == 10 && isExtended.getUTCMinutes() == 37 && isExtended.getUTCSeconds() == 6 && isExtended.getUTCMilliseconds() == 708;\n } catch (exception) {}\n\n // Internal: Determines whether the native `JSON.stringify` and `parse`\n // implementations are spec-compliant. Based on work by Ken Snyder.\n function has(name) {\n if (has[name] !== undef) {\n // Return cached feature test result.\n return has[name];\n }\n var isSupported;\n if (name == \"bug-string-char-index\") {\n // IE <= 7 doesn't support accessing string characters using square\n // bracket notation. IE 8 only supports this for primitives.\n isSupported = \"a\"[0] != \"a\";\n } else if (name == \"json\") {\n // Indicates whether both `JSON.stringify` and `JSON.parse` are\n // supported.\n isSupported = has(\"json-stringify\") && has(\"json-parse\");\n } else {\n var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n // Test `JSON.stringify`.\n if (name == \"json-stringify\") {\n var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n if (stringifySupported) {\n // A test function object with a custom `toJSON` method.\n (value = function () {\n return 1;\n }).toJSON = value;\n try {\n stringifySupported =\n // Firefox 3.1b1 and b2 serialize string, number, and boolean\n // primitives as object literals.\n stringify(0) === \"0\" &&\n // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n // literals.\n stringify(new Number()) === \"0\" &&\n stringify(new String()) == '\"\"' &&\n // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n // does not define a canonical JSON representation (this applies to\n // objects with `toJSON` properties as well, *unless* they are nested\n // within an object or array).\n stringify(getClass) === undef &&\n // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n // FF 3.1b3 pass this test.\n stringify(undef) === undef &&\n // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n // respectively, if the value is omitted entirely.\n stringify() === undef &&\n // FF 3.1b1, 2 throw an error if the given value is not a number,\n // string, array, object, Boolean, or `null` literal. This applies to\n // objects with custom `toJSON` methods as well, unless they are nested\n // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n // methods entirely.\n stringify(value) === \"1\" &&\n stringify([value]) == \"[1]\" &&\n // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n // `\"[null]\"`.\n stringify([undef]) == \"[null]\" &&\n // YUI 3.0.0b1 fails to serialize `null` literals.\n stringify(null) == \"null\" &&\n // FF 3.1b1, 2 halts serialization if an array contains a function:\n // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n // elides non-JSON values from objects and arrays, unless they\n // define custom `toJSON` methods.\n stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n stringify(null, value) === \"1\" &&\n stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n // serialize extended years.\n stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n // The milliseconds are optional in ES 5, but required in 5.1.\n stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n // four-digit years instead of six-digit years. Credits: @Yaffle.\n stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n // values less than 1000. Credits: @Yaffle.\n stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n } catch (exception) {\n stringifySupported = false;\n }\n }\n isSupported = stringifySupported;\n }\n // Test `JSON.parse`.\n if (name == \"json-parse\") {\n var parse = exports.parse;\n if (typeof parse == \"function\") {\n try {\n // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n // Conforming implementations should also coerce the initial argument to\n // a string prior to parsing.\n if (parse(\"0\") === 0 && !parse(false)) {\n // Simple parsing test.\n value = parse(serialized);\n var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n if (parseSupported) {\n try {\n // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n parseSupported = !parse('\"\\t\"');\n } catch (exception) {}\n if (parseSupported) {\n try {\n // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n // certain octal literals.\n parseSupported = parse(\"01\") !== 1;\n } catch (exception) {}\n }\n if (parseSupported) {\n try {\n // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n // points. These environments, along with FF 3.1b1 and 2,\n // also allow trailing commas in JSON objects and arrays.\n parseSupported = parse(\"1.\") !== 1;\n } catch (exception) {}\n }\n }\n }\n } catch (exception) {\n parseSupported = false;\n }\n }\n isSupported = parseSupported;\n }\n }\n return has[name] = !!isSupported;\n }\n\n if (!has(\"json\")) {\n // Common `[[Class]]` name aliases.\n var functionClass = \"[object Function]\",\n dateClass = \"[object Date]\",\n numberClass = \"[object Number]\",\n stringClass = \"[object String]\",\n arrayClass = \"[object Array]\",\n booleanClass = \"[object Boolean]\";\n\n // Detect incomplete support for accessing string characters by index.\n var charIndexBuggy = has(\"bug-string-char-index\");\n\n // Define additional utility methods if the `Date` methods are buggy.\n if (!isExtended) {\n var floor = Math.floor;\n // A mapping between the months of the year and the number of days between\n // January 1st and the first of the respective month.\n var Months = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334];\n // Internal: Calculates the number of days between the Unix epoch and the\n // first day of the given month.\n var getDay = function (year, month) {\n return Months[month] + 365 * (year - 1970) + floor((year - 1969 + (month = +(month > 1))) / 4) - floor((year - 1901 + month) / 100) + floor((year - 1601 + month) / 400);\n };\n }\n\n // Internal: Determines if a property is a direct property of the given\n // object. Delegates to the native `Object#hasOwnProperty` method.\n if (!(isProperty = objectProto.hasOwnProperty)) {\n isProperty = function (property) {\n var members = {}, constructor;\n if ((members.__proto__ = null, members.__proto__ = {\n // The *proto* property cannot be set multiple times in recent\n // versions of Firefox and SeaMonkey.\n \"toString\": 1\n }, members).toString != getClass) {\n // Safari <= 2.0.3 doesn't implement `Object#hasOwnProperty`, but\n // supports the mutable *proto* property.\n isProperty = function (property) {\n // Capture and break the object's prototype chain (see section 8.6.2\n // of the ES 5.1 spec). The parenthesized expression prevents an\n // unsafe transformation by the Closure Compiler.\n var original = this.__proto__, result = property in (this.__proto__ = null, this);\n // Restore the original prototype chain.\n this.__proto__ = original;\n return result;\n };\n } else {\n // Capture a reference to the top-level `Object` constructor.\n constructor = members.constructor;\n // Use the `constructor` property to simulate `Object#hasOwnProperty` in\n // other environments.\n isProperty = function (property) {\n var parent = (this.constructor || constructor).prototype;\n return property in this && !(property in parent && this[property] === parent[property]);\n };\n }\n members = null;\n return isProperty.call(this, property);\n };\n }\n\n // Internal: Normalizes the `for...in` iteration algorithm across\n // environments. Each enumerated key is yielded to a `callback` function.\n forEach = function (object, callback) {\n var size = 0, Properties, members, property;\n\n // Tests for bugs in the current environment's `for...in` algorithm. The\n // `valueOf` property inherits the non-enumerable flag from\n // `Object.prototype` in older versions of IE, Netscape, and Mozilla.\n (Properties = function () {\n this.valueOf = 0;\n }).prototype.valueOf = 0;\n\n // Iterate over a new instance of the `Properties` class.\n members = new Properties();\n for (property in members) {\n // Ignore all properties inherited from `Object.prototype`.\n if (isProperty.call(members, property)) {\n size++;\n }\n }\n Properties = members = null;\n\n // Normalize the iteration algorithm.\n if (!size) {\n // A list of non-enumerable properties inherited from `Object.prototype`.\n members = [\"valueOf\", \"toString\", \"toLocaleString\", \"propertyIsEnumerable\", \"isPrototypeOf\", \"hasOwnProperty\", \"constructor\"];\n // IE <= 8, Mozilla 1.0, and Netscape 6.2 ignore shadowed non-enumerable\n // properties.\n forEach = function (object, callback) {\n var isFunction = getClass.call(object) == functionClass, property, length;\n var hasProperty = !isFunction && typeof object.constructor != \"function\" && objectTypes[typeof object.hasOwnProperty] && object.hasOwnProperty || isProperty;\n for (property in object) {\n // Gecko <= 1.0 enumerates the `prototype` property of functions under\n // certain conditions; IE does not.\n if (!(isFunction && property == \"prototype\") && hasProperty.call(object, property)) {\n callback(property);\n }\n }\n // Manually invoke the callback for each non-enumerable property.\n for (length = members.length; property = members[--length]; hasProperty.call(object, property) && callback(property));\n };\n } else if (size == 2) {\n // Safari <= 2.0.4 enumerates shadowed properties twice.\n forEach = function (object, callback) {\n // Create a set of iterated properties.\n var members = {}, isFunction = getClass.call(object) == functionClass, property;\n for (property in object) {\n // Store each property name to prevent double enumeration. The\n // `prototype` property of functions is not enumerated due to cross-\n // environment inconsistencies.\n if (!(isFunction && property == \"prototype\") && !isProperty.call(members, property) && (members[property] = 1) && isProperty.call(object, property)) {\n callback(property);\n }\n }\n };\n } else {\n // No bugs detected; use the standard `for...in` algorithm.\n forEach = function (object, callback) {\n var isFunction = getClass.call(object) == functionClass, property, isConstructor;\n for (property in object) {\n if (!(isFunction && property == \"prototype\") && isProperty.call(object, property) && !(isConstructor = property === \"constructor\")) {\n callback(property);\n }\n }\n // Manually invoke the callback for the `constructor` property due to\n // cross-environment inconsistencies.\n if (isConstructor || isProperty.call(object, (property = \"constructor\"))) {\n callback(property);\n }\n };\n }\n return forEach(object, callback);\n };\n\n // Public: Serializes a JavaScript `value` as a JSON string. The optional\n // `filter` argument may specify either a function that alters how object and\n // array members are serialized, or an array of strings and numbers that\n // indicates which properties should be serialized. The optional `width`\n // argument may be either a string or number that specifies the indentation\n // level of the output.\n if (!has(\"json-stringify\")) {\n // Internal: A map of control characters and their escaped equivalents.\n var Escapes = {\n 92: \"\\\\\\\\\",\n 34: '\\\\\"',\n 8: \"\\\\b\",\n 12: \"\\\\f\",\n 10: \"\\\\n\",\n 13: \"\\\\r\",\n 9: \"\\\\t\"\n };\n\n // Internal: Converts `value` into a zero-padded string such that its\n // length is at least equal to `width`. The `width` must be <= 6.\n var leadingZeroes = \"000000\";\n var toPaddedString = function (width, value) {\n // The `|| 0` expression is necessary to work around a bug in\n // Opera <= 7.54u2 where `0 == -0`, but `String(-0) !== \"0\"`.\n return (leadingZeroes + (value || 0)).slice(-width);\n };\n\n // Internal: Double-quotes a string `value`, replacing all ASCII control\n // characters (characters with code unit values between 0 and 31) with\n // their escaped equivalents. This is an implementation of the\n // `Quote(value)` operation defined in ES 5.1 section 15.12.3.\n var unicodePrefix = \"\\\\u00\";\n var quote = function (value) {\n var result = '\"', index = 0, length = value.length, useCharIndex = !charIndexBuggy || length > 10;\n var symbols = useCharIndex && (charIndexBuggy ? value.split(\"\") : value);\n for (; index < length; index++) {\n var charCode = value.charCodeAt(index);\n // If the character is a control character, append its Unicode or\n // shorthand escape sequence; otherwise, append the character as-is.\n switch (charCode) {\n case 8: case 9: case 10: case 12: case 13: case 34: case 92:\n result += Escapes[charCode];\n break;\n default:\n if (charCode < 32) {\n result += unicodePrefix + toPaddedString(2, charCode.toString(16));\n break;\n }\n result += useCharIndex ? symbols[index] : value.charAt(index);\n }\n }\n return result + '\"';\n };\n\n // Internal: Recursively serializes an object. Implements the\n // `Str(key, holder)`, `JO(value)`, and `JA(value)` operations.\n var serialize = function (property, object, callback, properties, whitespace, indentation, stack) {\n var value, className, year, month, date, time, hours, minutes, seconds, milliseconds, results, element, index, length, prefix, result;\n try {\n // Necessary for host object support.\n value = object[property];\n } catch (exception) {}\n if (typeof value == \"object\" && value) {\n className = getClass.call(value);\n if (className == dateClass && !isProperty.call(value, \"toJSON\")) {\n if (value > -1 / 0 && value < 1 / 0) {\n // Dates are serialized according to the `Date#toJSON` method\n // specified in ES 5.1 section 15.9.5.44. See section 15.9.1.15\n // for the ISO 8601 date time string format.\n if (getDay) {\n // Manually compute the year, month, date, hours, minutes,\n // seconds, and milliseconds if the `getUTC*` methods are\n // buggy. Adapted from @Yaffle's `date-shim` project.\n date = floor(value / 864e5);\n for (year = floor(date / 365.2425) + 1970 - 1; getDay(year + 1, 0) <= date; year++);\n for (month = floor((date - getDay(year, 0)) / 30.42); getDay(year, month + 1) <= date; month++);\n date = 1 + date - getDay(year, month);\n // The `time` value specifies the time within the day (see ES\n // 5.1 section 15.9.1.2). The formula `(A % B + B) % B` is used\n // to compute `A modulo B`, as the `%` operator does not\n // correspond to the `modulo` operation for negative numbers.\n time = (value % 864e5 + 864e5) % 864e5;\n // The hours, minutes, seconds, and milliseconds are obtained by\n // decomposing the time within the day. See section 15.9.1.10.\n hours = floor(time / 36e5) % 24;\n minutes = floor(time / 6e4) % 60;\n seconds = floor(time / 1e3) % 60;\n milliseconds = time % 1e3;\n } else {\n year = value.getUTCFullYear();\n month = value.getUTCMonth();\n date = value.getUTCDate();\n hours = value.getUTCHours();\n minutes = value.getUTCMinutes();\n seconds = value.getUTCSeconds();\n milliseconds = value.getUTCMilliseconds();\n }\n // Serialize extended years correctly.\n value = (year <= 0 || year >= 1e4 ? (year < 0 ? \"-\" : \"+\") + toPaddedString(6, year < 0 ? -year : year) : toPaddedString(4, year)) +\n \"-\" + toPaddedString(2, month + 1) + \"-\" + toPaddedString(2, date) +\n // Months, dates, hours, minutes, and seconds should have two\n // digits; milliseconds should have three.\n \"T\" + toPaddedString(2, hours) + \":\" + toPaddedString(2, minutes) + \":\" + toPaddedString(2, seconds) +\n // Milliseconds are optional in ES 5.0, but required in 5.1.\n \".\" + toPaddedString(3, milliseconds) + \"Z\";\n } else {\n value = null;\n }\n } else if (typeof value.toJSON == \"function\" && ((className != numberClass && className != stringClass && className != arrayClass) || isProperty.call(value, \"toJSON\"))) {\n // Prototype <= 1.6.1 adds non-standard `toJSON` methods to the\n // `Number`, `String`, `Date`, and `Array` prototypes. JSON 3\n // ignores all `toJSON` methods on these objects unless they are\n // defined directly on an instance.\n value = value.toJSON(property);\n }\n }\n if (callback) {\n // If a replacement function was provided, call it to obtain the value\n // for serialization.\n value = callback.call(object, property, value);\n }\n if (value === null) {\n return \"null\";\n }\n className = getClass.call(value);\n if (className == booleanClass) {\n // Booleans are represented literally.\n return \"\" + value;\n } else if (className == numberClass) {\n // JSON numbers must be finite. `Infinity` and `NaN` are serialized as\n // `\"null\"`.\n return value > -1 / 0 && value < 1 / 0 ? \"\" + value : \"null\";\n } else if (className == stringClass) {\n // Strings are double-quoted and escaped.\n return quote(\"\" + value);\n }\n // Recursively serialize objects and arrays.\n if (typeof value == \"object\") {\n // Check for cyclic structures. This is a linear search; performance\n // is inversely proportional to the number of unique nested objects.\n for (length = stack.length; length--;) {\n if (stack[length] === value) {\n // Cyclic structures cannot be serialized by `JSON.stringify`.\n throw TypeError();\n }\n }\n // Add the object to the stack of traversed objects.\n stack.push(value);\n results = [];\n // Save the current indentation level and indent one additional level.\n prefix = indentation;\n indentation += whitespace;\n if (className == arrayClass) {\n // Recursively serialize array elements.\n for (index = 0, length = value.length; index < length; index++) {\n element = serialize(index, value, callback, properties, whitespace, indentation, stack);\n results.push(element === undef ? \"null\" : element);\n }\n result = results.length ? (whitespace ? \"[\\n\" + indentation + results.join(\",\\n\" + indentation) + \"\\n\" + prefix + \"]\" : (\"[\" + results.join(\",\") + \"]\")) : \"[]\";\n } else {\n // Recursively serialize object members. Members are selected from\n // either a user-specified list of property names, or the object\n // itself.\n forEach(properties || value, function (property) {\n var element = serialize(property, value, callback, properties, whitespace, indentation, stack);\n if (element !== undef) {\n // According to ES 5.1 section 15.12.3: \"If `gap` {whitespace}\n // is not the empty string, let `member` {quote(property) + \":\"}\n // be the concatenation of `member` and the `space` character.\"\n // The \"`space` character\" refers to the literal space\n // character, not the `space` {width} argument provided to\n // `JSON.stringify`.\n results.push(quote(property) + \":\" + (whitespace ? \" \" : \"\") + element);\n }\n });\n result = results.length ? (whitespace ? \"{\\n\" + indentation + results.join(\",\\n\" + indentation) + \"\\n\" + prefix + \"}\" : (\"{\" + results.join(\",\") + \"}\")) : \"{}\";\n }\n // Remove the object from the traversed object stack.\n stack.pop();\n return result;\n }\n };\n\n // Public: `JSON.stringify`. See ES 5.1 section 15.12.3.\n exports.stringify = function (source, filter, width) {\n var whitespace, callback, properties, className;\n if (objectTypes[typeof filter] && filter) {\n if ((className = getClass.call(filter)) == functionClass) {\n callback = filter;\n } else if (className == arrayClass) {\n // Convert the property names array into a makeshift set.\n properties = {};\n for (var index = 0, length = filter.length, value; index < length; value = filter[index++], ((className = getClass.call(value)), className == stringClass || className == numberClass) && (properties[value] = 1));\n }\n }\n if (width) {\n if ((className = getClass.call(width)) == numberClass) {\n // Convert the `width` to an integer and create a string containing\n // `width` number of space characters.\n if ((width -= width % 1) > 0) {\n for (whitespace = \"\", width > 10 && (width = 10); whitespace.length < width; whitespace += \" \");\n }\n } else if (className == stringClass) {\n whitespace = width.length <= 10 ? width : width.slice(0, 10);\n }\n }\n // Opera <= 7.54u2 discards the values associated with empty string keys\n // (`\"\"`) only if they are used directly within an object member list\n // (e.g., `!(\"\" in { \"\": 1})`).\n return serialize(\"\", (value = {}, value[\"\"] = source, value), callback, properties, whitespace, \"\", []);\n };\n }\n\n // Public: Parses a JSON source string.\n if (!has(\"json-parse\")) {\n var fromCharCode = String.fromCharCode;\n\n // Internal: A map of escaped control characters and their unescaped\n // equivalents.\n var Unescapes = {\n 92: \"\\\\\",\n 34: '\"',\n 47: \"/\",\n 98: \"\\b\",\n 116: \"\\t\",\n 110: \"\\n\",\n 102: \"\\f\",\n 114: \"\\r\"\n };\n\n // Internal: Stores the parser state.\n var Index, Source;\n\n // Internal: Resets the parser state and throws a `SyntaxError`.\n var abort = function () {\n Index = Source = null;\n throw SyntaxError();\n };\n\n // Internal: Returns the next token, or `\"$\"` if the parser has reached\n // the end of the source string. A token may be a string, number, `null`\n // literal, or Boolean literal.\n var lex = function () {\n var source = Source, length = source.length, value, begin, position, isSigned, charCode;\n while (Index < length) {\n charCode = source.charCodeAt(Index);\n switch (charCode) {\n case 9: case 10: case 13: case 32:\n // Skip whitespace tokens, including tabs, carriage returns, line\n // feeds, and space characters.\n Index++;\n break;\n case 123: case 125: case 91: case 93: case 58: case 44:\n // Parse a punctuator token (`{`, `}`, `[`, `]`, `:`, or `,`) at\n // the current position.\n value = charIndexBuggy ? source.charAt(Index) : source[Index];\n Index++;\n return value;\n case 34:\n // `\"` delimits a JSON string; advance to the next character and\n // begin parsing the string. String tokens are prefixed with the\n // sentinel `@` character to distinguish them from punctuators and\n // end-of-string tokens.\n for (value = \"@\", Index++; Index < length;) {\n charCode = source.charCodeAt(Index);\n if (charCode < 32) {\n // Unescaped ASCII control characters (those with a code unit\n // less than the space character) are not permitted.\n abort();\n } else if (charCode == 92) {\n // A reverse solidus (`\\`) marks the beginning of an escaped\n // control character (including `\"`, `\\`, and `/`) or Unicode\n // escape sequence.\n charCode = source.charCodeAt(++Index);\n switch (charCode) {\n case 92: case 34: case 47: case 98: case 116: case 110: case 102: case 114:\n // Revive escaped control characters.\n value += Unescapes[charCode];\n Index++;\n break;\n case 117:\n // `\\u` marks the beginning of a Unicode escape sequence.\n // Advance to the first character and validate the\n // four-digit code point.\n begin = ++Index;\n for (position = Index + 4; Index < position; Index++) {\n charCode = source.charCodeAt(Index);\n // A valid sequence comprises four hexdigits (case-\n // insensitive) that form a single hexadecimal value.\n if (!(charCode >= 48 && charCode <= 57 || charCode >= 97 && charCode <= 102 || charCode >= 65 && charCode <= 70)) {\n // Invalid Unicode escape sequence.\n abort();\n }\n }\n // Revive the escaped character.\n value += fromCharCode(\"0x\" + source.slice(begin, Index));\n break;\n default:\n // Invalid escape sequence.\n abort();\n }\n } else {\n if (charCode == 34) {\n // An unescaped double-quote character marks the end of the\n // string.\n break;\n }\n charCode = source.charCodeAt(Index);\n begin = Index;\n // Optimize for the common case where a string is valid.\n while (charCode >= 32 && charCode != 92 && charCode != 34) {\n charCode = source.charCodeAt(++Index);\n }\n // Append the string as-is.\n value += source.slice(begin, Index);\n }\n }\n if (source.charCodeAt(Index) == 34) {\n // Advance to the next character and return the revived string.\n Index++;\n return value;\n }\n // Unterminated string.\n abort();\n default:\n // Parse numbers and literals.\n begin = Index;\n // Advance past the negative sign, if one is specified.\n if (charCode == 45) {\n isSigned = true;\n charCode = source.charCodeAt(++Index);\n }\n // Parse an integer or floating-point value.\n if (charCode >= 48 && charCode <= 57) {\n // Leading zeroes are interpreted as octal literals.\n if (charCode == 48 && ((charCode = source.charCodeAt(Index + 1)), charCode >= 48 && charCode <= 57)) {\n // Illegal octal literal.\n abort();\n }\n isSigned = false;\n // Parse the integer component.\n for (; Index < length && ((charCode = source.charCodeAt(Index)), charCode >= 48 && charCode <= 57); Index++);\n // Floats cannot contain a leading decimal point; however, this\n // case is already accounted for by the parser.\n if (source.charCodeAt(Index) == 46) {\n position = ++Index;\n // Parse the decimal component.\n for (; position < length && ((charCode = source.charCodeAt(position)), charCode >= 48 && charCode <= 57); position++);\n if (position == Index) {\n // Illegal trailing decimal.\n abort();\n }\n Index = position;\n }\n // Parse exponents. The `e` denoting the exponent is\n // case-insensitive.\n charCode = source.charCodeAt(Index);\n if (charCode == 101 || charCode == 69) {\n charCode = source.charCodeAt(++Index);\n // Skip past the sign following the exponent, if one is\n // specified.\n if (charCode == 43 || charCode == 45) {\n Index++;\n }\n // Parse the exponential component.\n for (position = Index; position < length && ((charCode = source.charCodeAt(position)), charCode >= 48 && charCode <= 57); position++);\n if (position == Index) {\n // Illegal empty exponent.\n abort();\n }\n Index = position;\n }\n // Coerce the parsed value to a JavaScript number.\n return +source.slice(begin, Index);\n }\n // A negative sign may only precede numbers.\n if (isSigned) {\n abort();\n }\n // `true`, `false`, and `null` literals.\n if (source.slice(Index, Index + 4) == \"true\") {\n Index += 4;\n return true;\n } else if (source.slice(Index, Index + 5) == \"false\") {\n Index += 5;\n return false;\n } else if (source.slice(Index, Index + 4) == \"null\") {\n Index += 4;\n return null;\n }\n // Unrecognized token.\n abort();\n }\n }\n // Return the sentinel `$` character if the parser has reached the end\n // of the source string.\n return \"$\";\n };\n\n // Internal: Parses a JSON `value` token.\n var get = function (value) {\n var results, hasMembers;\n if (value == \"$\") {\n // Unexpected end of input.\n abort();\n }\n if (typeof value == \"string\") {\n if ((charIndexBuggy ? value.charAt(0) : value[0]) == \"@\") {\n // Remove the sentinel `@` character.\n return value.slice(1);\n }\n // Parse object and array literals.\n if (value == \"[\") {\n // Parses a JSON array, returning a new JavaScript array.\n results = [];\n for (;; hasMembers || (hasMembers = true)) {\n value = lex();\n // A closing square bracket marks the end of the array literal.\n if (value == \"]\") {\n break;\n }\n // If the array literal contains elements, the current token\n // should be a comma separating the previous element from the\n // next.\n if (hasMembers) {\n if (value == \",\") {\n value = lex();\n if (value == \"]\") {\n // Unexpected trailing `,` in array literal.\n abort();\n }\n } else {\n // A `,` must separate each array element.\n abort();\n }\n }\n // Elisions and leading commas are not permitted.\n if (value == \",\") {\n abort();\n }\n results.push(get(value));\n }\n return results;\n } else if (value == \"{\") {\n // Parses a JSON object, returning a new JavaScript object.\n results = {};\n for (;; hasMembers || (hasMembers = true)) {\n value = lex();\n // A closing curly brace marks the end of the object literal.\n if (value == \"}\") {\n break;\n }\n // If the object literal contains members, the current token\n // should be a comma separator.\n if (hasMembers) {\n if (value == \",\") {\n value = lex();\n if (value == \"}\") {\n // Unexpected trailing `,` in object literal.\n abort();\n }\n } else {\n // A `,` must separate each object member.\n abort();\n }\n }\n // Leading commas are not permitted, object property names must be\n // double-quoted strings, and a `:` must separate each property\n // name and value.\n if (value == \",\" || typeof value != \"string\" || (charIndexBuggy ? value.charAt(0) : value[0]) != \"@\" || lex() != \":\") {\n abort();\n }\n results[value.slice(1)] = get(lex());\n }\n return results;\n }\n // Unexpected token encountered.\n abort();\n }\n return value;\n };\n\n // Internal: Updates a traversed object member.\n var update = function (source, property, callback) {\n var element = walk(source, property, callback);\n if (element === undef) {\n delete source[property];\n } else {\n source[property] = element;\n }\n };\n\n // Internal: Recursively traverses a parsed JSON object, invoking the\n // `callback` function for each value. This is an implementation of the\n // `Walk(holder, name)` operation defined in ES 5.1 section 15.12.2.\n var walk = function (source, property, callback) {\n var value = source[property], length;\n if (typeof value == \"object\" && value) {\n // `forEach` can't be used to traverse an array in Opera <= 8.54\n // because its `Object#hasOwnProperty` implementation returns `false`\n // for array indices (e.g., `![1, 2, 3].hasOwnProperty(\"0\")`).\n if (getClass.call(value) == arrayClass) {\n for (length = value.length; length--;) {\n update(value, length, callback);\n }\n } else {\n forEach(value, function (property) {\n update(value, property, callback);\n });\n }\n }\n return callback.call(source, property, value);\n };\n\n // Public: `JSON.parse`. See ES 5.1 section 15.12.2.\n exports.parse = function (source, callback) {\n var result, value;\n Index = 0;\n Source = \"\" + source;\n result = get(lex());\n // If a JSON string contains multiple tokens, it is invalid.\n if (lex() != \"$\") {\n abort();\n }\n // Reset the parser state.\n Index = Source = null;\n return callback && getClass.call(callback) == functionClass ? walk((value = {}, value[\"\"] = result, value), \"\", callback) : result;\n };\n }\n }\n\n exports[\"runInContext\"] = runInContext;\n return exports;\n }\n\n if (freeExports && !isLoader) {\n // Export for CommonJS environments.\n runInContext(root, freeExports);\n } else {\n // Export for web browsers and JavaScript engines.\n var nativeJSON = root.JSON,\n previousJSON = root[\"JSON3\"],\n isRestored = false;\n\n var JSON3 = runInContext(root, (root[\"JSON3\"] = {\n // Public: Restores the original value of the global `JSON` object and\n // returns a reference to the `JSON3` object.\n \"noConflict\": function () {\n if (!isRestored) {\n isRestored = true;\n root.JSON = nativeJSON;\n root[\"JSON3\"] = previousJSON;\n nativeJSON = previousJSON = null;\n }\n return JSON3;\n }\n }));\n\n root.JSON = {\n \"parse\": JSON3.parse,\n \"stringify\": JSON3.stringify\n };\n }\n\n // Export for asynchronous module loaders.\n if (isLoader) {\n define(function () {\n return JSON3;\n });\n }\n}).call(this);\n","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} options\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options){\n options = options || {};\n if ('string' == typeof val) return parse(val);\n return options.long\n ? long(val)\n : short(val);\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = '' + str;\n if (str.length > 10000) return;\n var match = /^((?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str);\n if (!match) return;\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction short(ms) {\n if (ms >= d) return Math.round(ms / d) + 'd';\n if (ms >= h) return Math.round(ms / h) + 'h';\n if (ms >= m) return Math.round(ms / m) + 'm';\n if (ms >= s) return Math.round(ms / s) + 's';\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction long(ms) {\n return plural(ms, d, 'day')\n || plural(ms, h, 'hour')\n || plural(ms, m, 'minute')\n || plural(ms, s, 'second')\n || ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, n, name) {\n if (ms < n) return;\n if (ms < n * 1.5) return Math.floor(ms / n) + ' ' + name;\n return Math.ceil(ms / n) + ' ' + name + 's';\n}\n","/**\n * JSON parse.\n *\n * @see Based on jQuery#parseJSON (MIT) and JSON2\n * @api private\n */\n\nvar rvalidchars = /^[\\],:{}\\s]*$/;\nvar rvalidescape = /\\\\(?:[\"\\\\\\/bfnrt]|u[0-9a-fA-F]{4})/g;\nvar rvalidtokens = /\"[^\"\\\\\\n\\r]*\"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/g;\nvar rvalidbraces = /(?:^|:|,)(?:\\s*\\[)+/g;\nvar rtrimLeft = /^\\s+/;\nvar rtrimRight = /\\s+$/;\n\nmodule.exports = function parsejson(data) {\n if ('string' != typeof data || !data) {\n return null;\n }\n\n data = data.replace(rtrimLeft, '').replace(rtrimRight, '');\n\n // Attempt to parse using the native JSON parser first\n if (global.JSON && JSON.parse) {\n return JSON.parse(data);\n }\n\n if (rvalidchars.test(data.replace(rvalidescape, '@')\n .replace(rvalidtokens, ']')\n .replace(rvalidbraces, ''))) {\n return (new Function('return ' + data))();\n }\n};","/**\n * Compiles a querystring\n * Returns string representation of the object\n *\n * @param {Object}\n * @api private\n */\n\nexports.encode = function (obj) {\n var str = '';\n\n for (var i in obj) {\n if (obj.hasOwnProperty(i)) {\n if (str.length) str += '&';\n str += encodeURIComponent(i) + '=' + encodeURIComponent(obj[i]);\n }\n }\n\n return str;\n};\n\n/**\n * Parses a simple querystring into an object\n *\n * @param {String} qs\n * @api private\n */\n\nexports.decode = function(qs){\n var qry = {};\n var pairs = qs.split('&');\n for (var i = 0, l = pairs.length; i < l; i++) {\n var pair = pairs[i].split('=');\n qry[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);\n }\n return qry;\n};\n","/**\n * Parses an URI\n *\n * @author Steven Levithan <stevenlevithan.com> (MIT license)\n * @api private\n */\n\nvar re = /^(?:(?![^:@]+:[^:@\\/]*@)(http|https|ws|wss):\\/\\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\\/?#]*)(?::(\\d*))?)(((\\/(?:[^?#](?![^?#\\/]*\\.[^?#\\/.]+(?:[?#]|$)))*\\/?)?([^?#\\/]*))(?:\\?([^#]*))?(?:#(.*))?)/;\n\nvar parts = [\n 'source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor'\n];\n\nmodule.exports = function parseuri(str) {\n var src = str,\n b = str.indexOf('['),\n e = str.indexOf(']');\n\n if (b != -1 && e != -1) {\n str = str.substring(0, b) + str.substring(b, e).replace(/:/g, ';') + str.substring(e, str.length);\n }\n\n var m = re.exec(str || ''),\n uri = {},\n i = 14;\n\n while (i--) {\n uri[parts[i]] = m[i] || '';\n }\n\n if (b != -1 && e != -1) {\n uri.source = src;\n uri.host = uri.host.substring(1, uri.host.length - 1).replace(/;/g, ':');\n uri.authority = uri.authority.replace('[', '').replace(']', '').replace(/;/g, ':');\n uri.ipv6uri = true;\n }\n\n return uri;\n};\n","\n/**\n * Module dependencies.\n */\n\nvar url = require('./url');\nvar parser = require('socket.io-parser');\nvar Manager = require('./manager');\nvar debug = require('debug')('socket.io-client');\n\n/**\n * Module exports.\n */\n\nmodule.exports = exports = lookup;\n\n/**\n * Managers cache.\n */\n\nvar cache = exports.managers = {};\n\n/**\n * Looks up an existing `Manager` for multiplexing.\n * If the user summons:\n *\n * `io('http://localhost/a');`\n * `io('http://localhost/b');`\n *\n * We reuse the existing instance based on same scheme/port/host,\n * and we initialize sockets for each namespace.\n *\n * @api public\n */\n\nfunction lookup(uri, opts) {\n if (typeof uri == 'object') {\n opts = uri;\n uri = undefined;\n }\n\n opts = opts || {};\n\n var parsed = url(uri);\n var source = parsed.source;\n var id = parsed.id;\n var path = parsed.path;\n var sameNamespace = cache[id] && path in cache[id].nsps;\n var newConnection = opts.forceNew || opts['force new connection'] ||\n false === opts.multiplex || sameNamespace;\n\n var io;\n\n if (newConnection) {\n debug('ignoring socket cache for %s', source);\n io = Manager(source, opts);\n } else {\n if (!cache[id]) {\n debug('new io instance for %s', source);\n cache[id] = Manager(source, opts);\n }\n io = cache[id];\n }\n\n return io.socket(parsed.path);\n}\n\n/**\n * Protocol version.\n *\n * @api public\n */\n\nexports.protocol = parser.protocol;\n\n/**\n * `connect`.\n *\n * @param {String} uri\n * @api public\n */\n\nexports.connect = lookup;\n\n/**\n * Expose constructors for standalone build.\n *\n * @api public\n */\n\nexports.Manager = require('./manager');\nexports.Socket = require('./socket');\n","\n/**\n * Module dependencies.\n */\n\nvar eio = require('engine.io-client');\nvar Socket = require('./socket');\nvar Emitter = require('component-emitter');\nvar parser = require('socket.io-parser');\nvar on = require('./on');\nvar bind = require('component-bind');\nvar debug = require('debug')('socket.io-client:manager');\nvar indexOf = require('indexof');\nvar Backoff = require('backo2');\n\n/**\n * IE6+ hasOwnProperty\n */\n\nvar has = Object.prototype.hasOwnProperty;\n\n/**\n * Module exports\n */\n\nmodule.exports = Manager;\n\n/**\n * `Manager` constructor.\n *\n * @param {String} engine instance or engine uri/opts\n * @param {Object} options\n * @api public\n */\n\nfunction Manager(uri, opts){\n if (!(this instanceof Manager)) return new Manager(uri, opts);\n if (uri && ('object' == typeof uri)) {\n opts = uri;\n uri = undefined;\n }\n opts = opts || {};\n\n opts.path = opts.path || '/socket.io';\n this.nsps = {};\n this.subs = [];\n this.opts = opts;\n this.reconnection(opts.reconnection !== false);\n this.reconnectionAttempts(opts.reconnectionAttempts || Infinity);\n this.reconnectionDelay(opts.reconnectionDelay || 1000);\n this.reconnectionDelayMax(opts.reconnectionDelayMax || 5000);\n this.randomizationFactor(opts.randomizationFactor || 0.5);\n this.backoff = new Backoff({\n min: this.reconnectionDelay(),\n max: this.reconnectionDelayMax(),\n jitter: this.randomizationFactor()\n });\n this.timeout(null == opts.timeout ? 20000 : opts.timeout);\n this.readyState = 'closed';\n this.uri = uri;\n this.connecting = [];\n this.lastPing = null;\n this.encoding = false;\n this.packetBuffer = [];\n this.encoder = new parser.Encoder();\n this.decoder = new parser.Decoder();\n this.autoConnect = opts.autoConnect !== false;\n if (this.autoConnect) this.open();\n}\n\n/**\n * Propagate given event to sockets and emit on `this`\n *\n * @api private\n */\n\nManager.prototype.emitAll = function() {\n this.emit.apply(this, arguments);\n for (var nsp in this.nsps) {\n if (has.call(this.nsps, nsp)) {\n this.nsps[nsp].emit.apply(this.nsps[nsp], arguments);\n }\n }\n};\n\n/**\n * Update `socket.id` of all sockets\n *\n * @api private\n */\n\nManager.prototype.updateSocketIds = function(){\n for (var nsp in this.nsps) {\n if (has.call(this.nsps, nsp)) {\n this.nsps[nsp].id = this.engine.id;\n }\n }\n};\n\n/**\n * Mix in `Emitter`.\n */\n\nEmitter(Manager.prototype);\n\n/**\n * Sets the `reconnection` config.\n *\n * @param {Boolean} true/false if it should automatically reconnect\n * @return {Manager} self or value\n * @api public\n */\n\nManager.prototype.reconnection = function(v){\n if (!arguments.length) return this._reconnection;\n this._reconnection = !!v;\n return this;\n};\n\n/**\n * Sets the reconnection attempts config.\n *\n * @param {Number} max reconnection attempts before giving up\n * @return {Manager} self or value\n * @api public\n */\n\nManager.prototype.reconnectionAttempts = function(v){\n if (!arguments.length) return this._reconnectionAttempts;\n this._reconnectionAttempts = v;\n return this;\n};\n\n/**\n * Sets the delay between reconnections.\n *\n * @param {Number} delay\n * @return {Manager} self or value\n * @api public\n */\n\nManager.prototype.reconnectionDelay = function(v){\n if (!arguments.length) return this._reconnectionDelay;\n this._reconnectionDelay = v;\n this.backoff && this.backoff.setMin(v);\n return this;\n};\n\nManager.prototype.randomizationFactor = function(v){\n if (!arguments.length) return this._randomizationFactor;\n this._randomizationFactor = v;\n this.backoff && this.backoff.setJitter(v);\n return this;\n};\n\n/**\n * Sets the maximum delay between reconnections.\n *\n * @param {Number} delay\n * @return {Manager} self or value\n * @api public\n */\n\nManager.prototype.reconnectionDelayMax = function(v){\n if (!arguments.length) return this._reconnectionDelayMax;\n this._reconnectionDelayMax = v;\n this.backoff && this.backoff.setMax(v);\n return this;\n};\n\n/**\n * Sets the connection timeout. `false` to disable\n *\n * @return {Manager} self or value\n * @api public\n */\n\nManager.prototype.timeout = function(v){\n if (!arguments.length) return this._timeout;\n this._timeout = v;\n return this;\n};\n\n/**\n * Starts trying to reconnect if reconnection is enabled and we have not\n * started reconnecting yet\n *\n * @api private\n */\n\nManager.prototype.maybeReconnectOnOpen = function() {\n // Only try to reconnect if it's the first time we're connecting\n if (!this.reconnecting && this._reconnection && this.backoff.attempts === 0) {\n // keeps reconnection from firing twice for the same reconnection loop\n this.reconnect();\n }\n};\n\n\n/**\n * Sets the current transport `socket`.\n *\n * @param {Function} optional, callback\n * @return {Manager} self\n * @api public\n */\n\nManager.prototype.open =\nManager.prototype.connect = function(fn){\n debug('readyState %s', this.readyState);\n if (~this.readyState.indexOf('open')) return this;\n\n debug('opening %s', this.uri);\n this.engine = eio(this.uri, this.opts);\n var socket = this.engine;\n var self = this;\n this.readyState = 'opening';\n this.skipReconnect = false;\n\n // emit `open`\n var openSub = on(socket, 'open', function() {\n self.onopen();\n fn && fn();\n });\n\n // emit `connect_error`\n var errorSub = on(socket, 'error', function(data){\n debug('connect_error');\n self.cleanup();\n self.readyState = 'closed';\n self.emitAll('connect_error', data);\n if (fn) {\n var err = new Error('Connection error');\n err.data = data;\n fn(err);\n } else {\n // Only do this if there is no fn to handle the error\n self.maybeReconnectOnOpen();\n }\n });\n\n // emit `connect_timeout`\n if (false !== this._timeout) {\n var timeout = this._timeout;\n debug('connect attempt will timeout after %d', timeout);\n\n // set timer\n var timer = setTimeout(function(){\n debug('connect attempt timed out after %d', timeout);\n openSub.destroy();\n socket.close();\n socket.emit('error', 'timeout');\n self.emitAll('connect_timeout', timeout);\n }, timeout);\n\n this.subs.push({\n destroy: function(){\n clearTimeout(timer);\n }\n });\n }\n\n this.subs.push(openSub);\n this.subs.push(errorSub);\n\n return this;\n};\n\n/**\n * Called upon transport open.\n *\n * @api private\n */\n\nManager.prototype.onopen = function(){\n debug('open');\n\n // clear old subs\n this.cleanup();\n\n // mark as open\n this.readyState = 'open';\n this.emit('open');\n\n // add new subs\n var socket = this.engine;\n this.subs.push(on(socket, 'data', bind(this, 'ondata')));\n this.subs.push(on(socket, 'ping', bind(this, 'onping')));\n this.subs.push(on(socket, 'pong', bind(this, 'onpong')));\n this.subs.push(on(socket, 'error', bind(this, 'onerror')));\n this.subs.push(on(socket, 'close', bind(this, 'onclose')));\n this.subs.push(on(this.decoder, 'decoded', bind(this, 'ondecoded')));\n};\n\n/**\n * Called upon a ping.\n *\n * @api private\n */\n\nManager.prototype.onping = function(){\n this.lastPing = new Date;\n this.emitAll('ping');\n};\n\n/**\n * Called upon a packet.\n *\n * @api private\n */\n\nManager.prototype.onpong = function(){\n this.emitAll('pong', new Date - this.lastPing);\n};\n\n/**\n * Called with data.\n *\n * @api private\n */\n\nManager.prototype.ondata = function(data){\n this.decoder.add(data);\n};\n\n/**\n * Called when parser fully decodes a packet.\n *\n * @api private\n */\n\nManager.prototype.ondecoded = function(packet) {\n this.emit('packet', packet);\n};\n\n/**\n * Called upon socket error.\n *\n * @api private\n */\n\nManager.prototype.onerror = function(err){\n debug('error', err);\n this.emitAll('error', err);\n};\n\n/**\n * Creates a new socket for the given `nsp`.\n *\n * @return {Socket}\n * @api public\n */\n\nManager.prototype.socket = function(nsp){\n var socket = this.nsps[nsp];\n if (!socket) {\n socket = new Socket(this, nsp);\n this.nsps[nsp] = socket;\n var self = this;\n socket.on('connecting', onConnecting);\n socket.on('connect', function(){\n socket.id = self.engine.id;\n });\n\n if (this.autoConnect) {\n // manually call here since connecting evnet is fired before listening\n onConnecting();\n }\n }\n\n function onConnecting() {\n if (!~indexOf(self.connecting, socket)) {\n self.connecting.push(socket);\n }\n }\n\n return socket;\n};\n\n/**\n * Called upon a socket close.\n *\n * @param {Socket} socket\n */\n\nManager.prototype.destroy = function(socket){\n var index = indexOf(this.connecting, socket);\n if (~index) this.connecting.splice(index, 1);\n if (this.connecting.length) return;\n\n this.close();\n};\n\n/**\n * Writes a packet.\n *\n * @param {Object} packet\n * @api private\n */\n\nManager.prototype.packet = function(packet){\n debug('writing packet %j', packet);\n var self = this;\n\n if (!self.encoding) {\n // encode, then write to engine with result\n self.encoding = true;\n this.encoder.encode(packet, function(encodedPackets) {\n for (var i = 0; i < encodedPackets.length; i++) {\n self.engine.write(encodedPackets[i], packet.options);\n }\n self.encoding = false;\n self.processPacketQueue();\n });\n } else { // add packet to the queue\n self.packetBuffer.push(packet);\n }\n};\n\n/**\n * If packet buffer is non-empty, begins encoding the\n * next packet in line.\n *\n * @api private\n */\n\nManager.prototype.processPacketQueue = function() {\n if (this.packetBuffer.length > 0 && !this.encoding) {\n var pack = this.packetBuffer.shift();\n this.packet(pack);\n }\n};\n\n/**\n * Clean up transport subscriptions and packet buffer.\n *\n * @api private\n */\n\nManager.prototype.cleanup = function(){\n debug('cleanup');\n\n var sub;\n while (sub = this.subs.shift()) sub.destroy();\n\n this.packetBuffer = [];\n this.encoding = false;\n this.lastPing = null;\n\n this.decoder.destroy();\n};\n\n/**\n * Close the current socket.\n *\n * @api private\n */\n\nManager.prototype.close =\nManager.prototype.disconnect = function(){\n debug('disconnect');\n this.skipReconnect = true;\n this.reconnecting = false;\n if ('opening' == this.readyState) {\n // `onclose` will not fire because\n // an open event never happened\n this.cleanup();\n }\n this.backoff.reset();\n this.readyState = 'closed';\n if (this.engine) this.engine.close();\n};\n\n/**\n * Called upon engine close.\n *\n * @api private\n */\n\nManager.prototype.onclose = function(reason){\n debug('onclose');\n\n this.cleanup();\n this.backoff.reset();\n this.readyState = 'closed';\n this.emit('close', reason);\n\n if (this._reconnection && !this.skipReconnect) {\n this.reconnect();\n }\n};\n\n/**\n * Attempt a reconnection.\n *\n * @api private\n */\n\nManager.prototype.reconnect = function(){\n if (this.reconnecting || this.skipReconnect) return this;\n\n var self = this;\n\n if (this.backoff.attempts >= this._reconnectionAttempts) {\n debug('reconnect failed');\n this.backoff.reset();\n this.emitAll('reconnect_failed');\n this.reconnecting = false;\n } else {\n var delay = this.backoff.duration();\n debug('will wait %dms before reconnect attempt', delay);\n\n this.reconnecting = true;\n var timer = setTimeout(function(){\n if (self.skipReconnect) return;\n\n debug('attempting reconnect');\n self.emitAll('reconnect_attempt', self.backoff.attempts);\n self.emitAll('reconnecting', self.backoff.attempts);\n\n // check again for the case socket closed in above events\n if (self.skipReconnect) return;\n\n self.open(function(err){\n if (err) {\n debug('reconnect attempt error');\n self.reconnecting = false;\n self.reconnect();\n self.emitAll('reconnect_error', err.data);\n } else {\n debug('reconnect success');\n self.onreconnect();\n }\n });\n }, delay);\n\n this.subs.push({\n destroy: function(){\n clearTimeout(timer);\n }\n });\n }\n};\n\n/**\n * Called upon successful reconnect.\n *\n * @api private\n */\n\nManager.prototype.onreconnect = function(){\n var attempt = this.backoff.attempts;\n this.reconnecting = false;\n this.backoff.reset();\n this.updateSocketIds();\n this.emitAll('reconnect', attempt);\n};\n","\n/**\n * Module exports.\n */\n\nmodule.exports = on;\n\n/**\n * Helper for subscriptions.\n *\n * @param {Object|EventEmitter} obj with `Emitter` mixin or `EventEmitter`\n * @param {String} event name\n * @param {Function} callback\n * @api public\n */\n\nfunction on(obj, ev, fn) {\n obj.on(ev, fn);\n return {\n destroy: function(){\n obj.removeListener(ev, fn);\n }\n };\n}\n","\n/**\n * Module dependencies.\n */\n\nvar parser = require('socket.io-parser');\nvar Emitter = require('component-emitter');\nvar toArray = require('to-array');\nvar on = require('./on');\nvar bind = require('component-bind');\nvar debug = require('debug')('socket.io-client:socket');\nvar hasBin = require('has-binary');\n\n/**\n * Module exports.\n */\n\nmodule.exports = exports = Socket;\n\n/**\n * Internal events (blacklisted).\n * These events can't be emitted by the user.\n *\n * @api private\n */\n\nvar events = {\n connect: 1,\n connect_error: 1,\n connect_timeout: 1,\n connecting: 1,\n disconnect: 1,\n error: 1,\n reconnect: 1,\n reconnect_attempt: 1,\n reconnect_failed: 1,\n reconnect_error: 1,\n reconnecting: 1,\n ping: 1,\n pong: 1\n};\n\n/**\n * Shortcut to `Emitter#emit`.\n */\n\nvar emit = Emitter.prototype.emit;\n\n/**\n * `Socket` constructor.\n *\n * @api public\n */\n\nfunction Socket(io, nsp){\n this.io = io;\n this.nsp = nsp;\n this.json = this; // compat\n this.ids = 0;\n this.acks = {};\n this.receiveBuffer = [];\n this.sendBuffer = [];\n this.connected = false;\n this.disconnected = true;\n if (this.io.autoConnect) this.open();\n}\n\n/**\n * Mix in `Emitter`.\n */\n\nEmitter(Socket.prototype);\n\n/**\n * Subscribe to open, close and packet events\n *\n * @api private\n */\n\nSocket.prototype.subEvents = function() {\n if (this.subs) return;\n\n var io = this.io;\n this.subs = [\n on(io, 'open', bind(this, 'onopen')),\n on(io, 'packet', bind(this, 'onpacket')),\n on(io, 'close', bind(this, 'onclose'))\n ];\n};\n\n/**\n * \"Opens\" the socket.\n *\n * @api public\n */\n\nSocket.prototype.open =\nSocket.prototype.connect = function(){\n if (this.connected) return this;\n\n this.subEvents();\n this.io.open(); // ensure open\n if ('open' == this.io.readyState) this.onopen();\n this.emit('connecting');\n return this;\n};\n\n/**\n * Sends a `message` event.\n *\n * @return {Socket} self\n * @api public\n */\n\nSocket.prototype.send = function(){\n var args = toArray(arguments);\n args.unshift('message');\n this.emit.apply(this, args);\n return this;\n};\n\n/**\n * Override `emit`.\n * If the event is in `events`, it's emitted normally.\n *\n * @param {String} event name\n * @return {Socket} self\n * @api public\n */\n\nSocket.prototype.emit = function(ev){\n if (events.hasOwnProperty(ev)) {\n emit.apply(this, arguments);\n return this;\n }\n\n var args = toArray(arguments);\n var parserType = parser.EVENT; // default\n if (hasBin(args)) { parserType = parser.BINARY_EVENT; } // binary\n var packet = { type: parserType, data: args };\n\n packet.options = {};\n packet.options.compress = !this.flags || false !== this.flags.compress;\n\n // event ack callback\n if ('function' == typeof args[args.length - 1]) {\n debug('emitting packet with ack id %d', this.ids);\n this.acks[this.ids] = args.pop();\n packet.id = this.ids++;\n }\n\n if (this.connected) {\n this.packet(packet);\n } else {\n this.sendBuffer.push(packet);\n }\n\n delete this.flags;\n\n return this;\n};\n\n/**\n * Sends a packet.\n *\n * @param {Object} packet\n * @api private\n */\n\nSocket.prototype.packet = function(packet){\n packet.nsp = this.nsp;\n this.io.packet(packet);\n};\n\n/**\n * Called upon engine `open`.\n *\n * @api private\n */\n\nSocket.prototype.onopen = function(){\n debug('transport is open - connecting');\n\n // write connect packet if necessary\n if ('/' != this.nsp) {\n this.packet({ type: parser.CONNECT });\n }\n};\n\n/**\n * Called upon engine `close`.\n *\n * @param {String} reason\n * @api private\n */\n\nSocket.prototype.onclose = function(reason){\n debug('close (%s)', reason);\n this.connected = false;\n this.disconnected = true;\n delete this.id;\n this.emit('disconnect', reason);\n};\n\n/**\n * Called with socket packet.\n *\n * @param {Object} packet\n * @api private\n */\n\nSocket.prototype.onpacket = function(packet){\n if (packet.nsp != this.nsp) return;\n\n switch (packet.type) {\n case parser.CONNECT:\n this.onconnect();\n break;\n\n case parser.EVENT:\n this.onevent(packet);\n break;\n\n case parser.BINARY_EVENT:\n this.onevent(packet);\n break;\n\n case parser.ACK:\n this.onack(packet);\n break;\n\n case parser.BINARY_ACK:\n this.onack(packet);\n break;\n\n case parser.DISCONNECT:\n this.ondisconnect();\n break;\n\n case parser.ERROR:\n this.emit('error', packet.data);\n break;\n }\n};\n\n/**\n * Called upon a server event.\n *\n * @param {Object} packet\n * @api private\n */\n\nSocket.prototype.onevent = function(packet){\n var args = packet.data || [];\n debug('emitting event %j', args);\n\n if (null != packet.id) {\n debug('attaching ack callback to event');\n args.push(this.ack(packet.id));\n }\n\n if (this.connected) {\n emit.apply(this, args);\n } else {\n this.receiveBuffer.push(args);\n }\n};\n\n/**\n * Produces an ack callback to emit with an event.\n *\n * @api private\n */\n\nSocket.prototype.ack = function(id){\n var self = this;\n var sent = false;\n return function(){\n // prevent double callbacks\n if (sent) return;\n sent = true;\n var args = toArray(arguments);\n debug('sending ack %j', args);\n\n var type = hasBin(args) ? parser.BINARY_ACK : parser.ACK;\n self.packet({\n type: type,\n id: id,\n data: args\n });\n };\n};\n\n/**\n * Called upon a server acknowlegement.\n *\n * @param {Object} packet\n * @api private\n */\n\nSocket.prototype.onack = function(packet){\n var ack = this.acks[packet.id];\n if ('function' == typeof ack) {\n debug('calling ack %s with %j', packet.id, packet.data);\n ack.apply(this, packet.data);\n delete this.acks[packet.id];\n } else {\n debug('bad ack %s', packet.id);\n }\n};\n\n/**\n * Called upon server connect.\n *\n * @api private\n */\n\nSocket.prototype.onconnect = function(){\n this.connected = true;\n this.disconnected = false;\n this.emit('connect');\n this.emitBuffered();\n};\n\n/**\n * Emit buffered events (received and emitted).\n *\n * @api private\n */\n\nSocket.prototype.emitBuffered = function(){\n var i;\n for (i = 0; i < this.receiveBuffer.length; i++) {\n emit.apply(this, this.receiveBuffer[i]);\n }\n this.receiveBuffer = [];\n\n for (i = 0; i < this.sendBuffer.length; i++) {\n this.packet(this.sendBuffer[i]);\n }\n this.sendBuffer = [];\n};\n\n/**\n * Called upon server disconnect.\n *\n * @api private\n */\n\nSocket.prototype.ondisconnect = function(){\n debug('server disconnect (%s)', this.nsp);\n this.destroy();\n this.onclose('io server disconnect');\n};\n\n/**\n * Called upon forced client/server side disconnections,\n * this method ensures the manager stops tracking us and\n * that reconnections don't get triggered for this.\n *\n * @api private.\n */\n\nSocket.prototype.destroy = function(){\n if (this.subs) {\n // clean subscriptions to avoid reconnections\n for (var i = 0; i < this.subs.length; i++) {\n this.subs[i].destroy();\n }\n this.subs = null;\n }\n\n this.io.destroy(this);\n};\n\n/**\n * Disconnects the socket manually.\n *\n * @return {Socket} self\n * @api public\n */\n\nSocket.prototype.close =\nSocket.prototype.disconnect = function(){\n if (this.connected) {\n debug('performing disconnect (%s)', this.nsp);\n this.packet({ type: parser.DISCONNECT });\n }\n\n // remove socket from pool\n this.destroy();\n\n if (this.connected) {\n // fire events\n this.onclose('io client disconnect');\n }\n return this;\n};\n\n/**\n * Sets the compress flag.\n *\n * @param {Boolean} if `true`, compresses the sending data\n * @return {Socket} self\n * @api public\n */\n\nSocket.prototype.compress = function(compress){\n this.flags = this.flags || {};\n this.flags.compress = compress;\n return this;\n};\n","\n/**\n * Module dependencies.\n */\n\nvar parseuri = require('parseuri');\nvar debug = require('debug')('socket.io-client:url');\n\n/**\n * Module exports.\n */\n\nmodule.exports = url;\n\n/**\n * URL parser.\n *\n * @param {String} url\n * @param {Object} An object meant to mimic window.location.\n * Defaults to window.location.\n * @api public\n */\n\nfunction url(uri, loc){\n var obj = uri;\n\n // default to window.location\n var loc = loc || global.location;\n if (null == uri) uri = loc.protocol + '//' + loc.host;\n\n // relative path support\n if ('string' == typeof uri) {\n if ('/' == uri.charAt(0)) {\n if ('/' == uri.charAt(1)) {\n uri = loc.protocol + uri;\n } else {\n uri = loc.host + uri;\n }\n }\n\n if (!/^(https?|wss?):\\/\\//.test(uri)) {\n debug('protocol-less url %s', uri);\n if ('undefined' != typeof loc) {\n uri = loc.protocol + '//' + uri;\n } else {\n uri = 'https://' + uri;\n }\n }\n\n // parse\n debug('parse %s', uri);\n obj = parseuri(uri);\n }\n\n // make sure we treat `localhost:80` and `localhost` equally\n if (!obj.port) {\n if (/^(http|ws)$/.test(obj.protocol)) {\n obj.port = '80';\n }\n else if (/^(http|ws)s$/.test(obj.protocol)) {\n obj.port = '443';\n }\n }\n\n obj.path = obj.path || '/';\n\n var ipv6 = obj.host.indexOf(':') !== -1;\n var host = ipv6 ? '[' + obj.host + ']' : obj.host;\n\n // define unique id\n obj.id = obj.protocol + '://' + host + ':' + obj.port;\n // define href\n obj.href = obj.protocol + '://' + host + (loc && loc.port == obj.port ? '' : (':' + obj.port));\n\n return obj;\n}\n","/*global Blob,File*/\n\n/**\n * Module requirements\n */\n\nvar isArray = require('isarray');\nvar isBuf = require('./is-buffer');\n\n/**\n * Replaces every Buffer | ArrayBuffer in packet with a numbered placeholder.\n * Anything with blobs or files should be fed through removeBlobs before coming\n * here.\n *\n * @param {Object} packet - socket.io event packet\n * @return {Object} with deconstructed packet and list of buffers\n * @api public\n */\n\nexports.deconstructPacket = function(packet){\n var buffers = [];\n var packetData = packet.data;\n\n function _deconstructPacket(data) {\n if (!data) return data;\n\n if (isBuf(data)) {\n var placeholder = { _placeholder: true, num: buffers.length };\n buffers.push(data);\n return placeholder;\n } else if (isArray(data)) {\n var newData = new Array(data.length);\n for (var i = 0; i < data.length; i++) {\n newData[i] = _deconstructPacket(data[i]);\n }\n return newData;\n } else if ('object' == typeof data && !(data instanceof Date)) {\n var newData = {};\n for (var key in data) {\n newData[key] = _deconstructPacket(data[key]);\n }\n return newData;\n }\n return data;\n }\n\n var pack = packet;\n pack.data = _deconstructPacket(packetData);\n pack.attachments = buffers.length; // number of binary 'attachments'\n return {packet: pack, buffers: buffers};\n};\n\n/**\n * Reconstructs a binary packet from its placeholder packet and buffers\n *\n * @param {Object} packet - event packet with placeholders\n * @param {Array} buffers - binary buffers to put in placeholder positions\n * @return {Object} reconstructed packet\n * @api public\n */\n\nexports.reconstructPacket = function(packet, buffers) {\n var curPlaceHolder = 0;\n\n function _reconstructPacket(data) {\n if (data && data._placeholder) {\n var buf = buffers[data.num]; // appropriate buffer (should be natural order anyway)\n return buf;\n } else if (isArray(data)) {\n for (var i = 0; i < data.length; i++) {\n data[i] = _reconstructPacket(data[i]);\n }\n return data;\n } else if (data && 'object' == typeof data) {\n for (var key in data) {\n data[key] = _reconstructPacket(data[key]);\n }\n return data;\n }\n return data;\n }\n\n packet.data = _reconstructPacket(packet.data);\n packet.attachments = undefined; // no longer useful\n return packet;\n};\n\n/**\n * Asynchronously removes Blobs or Files from data via\n * FileReader's readAsArrayBuffer method. Used before encoding\n * data as msgpack. Calls callback with the blobless data.\n *\n * @param {Object} data\n * @param {Function} callback\n * @api private\n */\n\nexports.removeBlobs = function(data, callback) {\n function _removeBlobs(obj, curKey, containingObject) {\n if (!obj) return obj;\n\n // convert any blob\n if ((global.Blob && obj instanceof Blob) ||\n (global.File && obj instanceof File)) {\n pendingBlobs++;\n\n // async filereader\n var fileReader = new FileReader();\n fileReader.onload = function() { // this.result == arraybuffer\n if (containingObject) {\n containingObject[curKey] = this.result;\n }\n else {\n bloblessData = this.result;\n }\n\n // if nothing pending its callback time\n if(! --pendingBlobs) {\n callback(bloblessData);\n }\n };\n\n fileReader.readAsArrayBuffer(obj); // blob -> arraybuffer\n } else if (isArray(obj)) { // handle array\n for (var i = 0; i < obj.length; i++) {\n _removeBlobs(obj[i], i, obj);\n }\n } else if (obj && 'object' == typeof obj && !isBuf(obj)) { // and object\n for (var key in obj) {\n _removeBlobs(obj[key], key, obj);\n }\n }\n }\n\n var pendingBlobs = 0;\n var bloblessData = data;\n _removeBlobs(bloblessData);\n if (!pendingBlobs) {\n callback(bloblessData);\n }\n};\n","\n/**\n * Module dependencies.\n */\n\nvar debug = require('debug')('socket.io-parser');\nvar json = require('json3');\nvar isArray = require('isarray');\nvar Emitter = require('component-emitter');\nvar binary = require('./binary');\nvar isBuf = require('./is-buffer');\n\n/**\n * Protocol version.\n *\n * @api public\n */\n\nexports.protocol = 4;\n\n/**\n * Packet types.\n *\n * @api public\n */\n\nexports.types = [\n 'CONNECT',\n 'DISCONNECT',\n 'EVENT',\n 'BINARY_EVENT',\n 'ACK',\n 'BINARY_ACK',\n 'ERROR'\n];\n\n/**\n * Packet type `connect`.\n *\n * @api public\n */\n\nexports.CONNECT = 0;\n\n/**\n * Packet type `disconnect`.\n *\n * @api public\n */\n\nexports.DISCONNECT = 1;\n\n/**\n * Packet type `event`.\n *\n * @api public\n */\n\nexports.EVENT = 2;\n\n/**\n * Packet type `ack`.\n *\n * @api public\n */\n\nexports.ACK = 3;\n\n/**\n * Packet type `error`.\n *\n * @api public\n */\n\nexports.ERROR = 4;\n\n/**\n * Packet type 'binary event'\n *\n * @api public\n */\n\nexports.BINARY_EVENT = 5;\n\n/**\n * Packet type `binary ack`. For acks with binary arguments.\n *\n * @api public\n */\n\nexports.BINARY_ACK = 6;\n\n/**\n * Encoder constructor.\n *\n * @api public\n */\n\nexports.Encoder = Encoder;\n\n/**\n * Decoder constructor.\n *\n * @api public\n */\n\nexports.Decoder = Decoder;\n\n/**\n * A socket.io Encoder instance\n *\n * @api public\n */\n\nfunction Encoder() {}\n\n/**\n * Encode a packet as a single string if non-binary, or as a\n * buffer sequence, depending on packet type.\n *\n * @param {Object} obj - packet object\n * @param {Function} callback - function to handle encodings (likely engine.write)\n * @return Calls callback with Array of encodings\n * @api public\n */\n\nEncoder.prototype.encode = function(obj, callback){\n debug('encoding packet %j', obj);\n\n if (exports.BINARY_EVENT == obj.type || exports.BINARY_ACK == obj.type) {\n encodeAsBinary(obj, callback);\n }\n else {\n var encoding = encodeAsString(obj);\n callback([encoding]);\n }\n};\n\n/**\n * Encode packet as string.\n *\n * @param {Object} packet\n * @return {String} encoded\n * @api private\n */\n\nfunction encodeAsString(obj) {\n var str = '';\n var nsp = false;\n\n // first is type\n str += obj.type;\n\n // attachments if we have them\n if (exports.BINARY_EVENT == obj.type || exports.BINARY_ACK == obj.type) {\n str += obj.attachments;\n str += '-';\n }\n\n // if we have a namespace other than `/`\n // we append it followed by a comma `,`\n if (obj.nsp && '/' != obj.nsp) {\n nsp = true;\n str += obj.nsp;\n }\n\n // immediately followed by the id\n if (null != obj.id) {\n if (nsp) {\n str += ',';\n nsp = false;\n }\n str += obj.id;\n }\n\n // json data\n if (null != obj.data) {\n if (nsp) str += ',';\n str += json.stringify(obj.data);\n }\n\n debug('encoded %j as %s', obj, str);\n return str;\n}\n\n/**\n * Encode packet as 'buffer sequence' by removing blobs, and\n * deconstructing packet into object with placeholders and\n * a list of buffers.\n *\n * @param {Object} packet\n * @return {Buffer} encoded\n * @api private\n */\n\nfunction encodeAsBinary(obj, callback) {\n\n function writeEncoding(bloblessData) {\n var deconstruction = binary.deconstructPacket(bloblessData);\n var pack = encodeAsString(deconstruction.packet);\n var buffers = deconstruction.buffers;\n\n buffers.unshift(pack); // add packet info to beginning of data list\n callback(buffers); // write all the buffers\n }\n\n binary.removeBlobs(obj, writeEncoding);\n}\n\n/**\n * A socket.io Decoder instance\n *\n * @return {Object} decoder\n * @api public\n */\n\nfunction Decoder() {\n this.reconstructor = null;\n}\n\n/**\n * Mix in `Emitter` with Decoder.\n */\n\nEmitter(Decoder.prototype);\n\n/**\n * Decodes an ecoded packet string into packet JSON.\n *\n * @param {String} obj - encoded packet\n * @return {Object} packet\n * @api public\n */\n\nDecoder.prototype.add = function(obj) {\n var packet;\n if ('string' == typeof obj) {\n packet = decodeString(obj);\n if (exports.BINARY_EVENT == packet.type || exports.BINARY_ACK == packet.type) { // binary packet's json\n this.reconstructor = new BinaryReconstructor(packet);\n\n // no attachments, labeled binary but no binary data to follow\n if (this.reconstructor.reconPack.attachments === 0) {\n this.emit('decoded', packet);\n }\n } else { // non-binary full packet\n this.emit('decoded', packet);\n }\n }\n else if (isBuf(obj) || obj.base64) { // raw binary data\n if (!this.reconstructor) {\n throw new Error('got binary data when not reconstructing a packet');\n } else {\n packet = this.reconstructor.takeBinaryData(obj);\n if (packet) { // received final buffer\n this.reconstructor = null;\n this.emit('decoded', packet);\n }\n }\n }\n else {\n throw new Error('Unknown type: ' + obj);\n }\n};\n\n/**\n * Decode a packet String (JSON data)\n *\n * @param {String} str\n * @return {Object} packet\n * @api private\n */\n\nfunction decodeString(str) {\n var p = {};\n var i = 0;\n\n // look up type\n p.type = Number(str.charAt(0));\n if (null == exports.types[p.type]) return error();\n\n // look up attachments if type binary\n if (exports.BINARY_EVENT == p.type || exports.BINARY_ACK == p.type) {\n var buf = '';\n while (str.charAt(++i) != '-') {\n buf += str.charAt(i);\n if (i == str.length) break;\n }\n if (buf != Number(buf) || str.charAt(i) != '-') {\n throw new Error('Illegal attachments');\n }\n p.attachments = Number(buf);\n }\n\n // look up namespace (if any)\n if ('/' == str.charAt(i + 1)) {\n p.nsp = '';\n while (++i) {\n var c = str.charAt(i);\n if (',' == c) break;\n p.nsp += c;\n if (i == str.length) break;\n }\n } else {\n p.nsp = '/';\n }\n\n // look up id\n var next = str.charAt(i + 1);\n if ('' !== next && Number(next) == next) {\n p.id = '';\n while (++i) {\n var c = str.charAt(i);\n if (null == c || Number(c) != c) {\n --i;\n break;\n }\n p.id += str.charAt(i);\n if (i == str.length) break;\n }\n p.id = Number(p.id);\n }\n\n // look up json data\n if (str.charAt(++i)) {\n try {\n p.data = json.parse(str.substr(i));\n } catch(e){\n return error();\n }\n }\n\n debug('decoded %s as %j', str, p);\n return p;\n}\n\n/**\n * Deallocates a parser's resources\n *\n * @api public\n */\n\nDecoder.prototype.destroy = function() {\n if (this.reconstructor) {\n this.reconstructor.finishedReconstruction();\n }\n};\n\n/**\n * A manager of a binary event's 'buffer sequence'. Should\n * be constructed whenever a packet of type BINARY_EVENT is\n * decoded.\n *\n * @param {Object} packet\n * @return {BinaryReconstructor} initialized reconstructor\n * @api private\n */\n\nfunction BinaryReconstructor(packet) {\n this.reconPack = packet;\n this.buffers = [];\n}\n\n/**\n * Method to be called when binary data received from connection\n * after a BINARY_EVENT packet.\n *\n * @param {Buffer | ArrayBuffer} binData - the raw binary data received\n * @return {null | Object} returns null if more binary data is expected or\n * a reconstructed packet object if all buffers have been received.\n * @api private\n */\n\nBinaryReconstructor.prototype.takeBinaryData = function(binData) {\n this.buffers.push(binData);\n if (this.buffers.length == this.reconPack.attachments) { // done with buffer list\n var packet = binary.reconstructPacket(this.reconPack, this.buffers);\n this.finishedReconstruction();\n return packet;\n }\n return null;\n};\n\n/**\n * Cleans up binary packet reconstruction variables.\n *\n * @api private\n */\n\nBinaryReconstructor.prototype.finishedReconstruction = function() {\n this.reconPack = null;\n this.buffers = [];\n};\n\nfunction error(data){\n return {\n type: exports.ERROR,\n data: 'parser error'\n };\n}\n","\nmodule.exports = isBuf;\n\n/**\n * Returns true if obj is a buffer or an arraybuffer.\n *\n * @api private\n */\n\nfunction isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}\n","module.exports = toArray\n\nfunction toArray(list, index) {\n var array = []\n\n index = index || 0\n\n for (var i = index || 0; i < list.length; i++) {\n array[i - index] = list[i]\n }\n\n return array\n}\n","/*! https://mths.be/utf8js v2.0.0 by @mathias */\n;(function(root) {\n\n\t// Detect free variables `exports`\n\tvar freeExports = typeof exports == 'object' && exports;\n\n\t// Detect free variable `module`\n\tvar freeModule = typeof module == 'object' && module &&\n\t\tmodule.exports == freeExports && module;\n\n\t// Detect free variable `global`, from Node.js or Browserified code,\n\t// and use it as `root`\n\tvar freeGlobal = typeof global == 'object' && global;\n\tif (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {\n\t\troot = freeGlobal;\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\tvar stringFromCharCode = String.fromCharCode;\n\n\t// Taken from https://mths.be/punycode\n\tfunction ucs2decode(string) {\n\t\tvar output = [];\n\t\tvar counter = 0;\n\t\tvar length = string.length;\n\t\tvar value;\n\t\tvar extra;\n\t\twhile (counter < length) {\n\t\t\tvalue = string.charCodeAt(counter++);\n\t\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t\t// high surrogate, and there is a next character\n\t\t\t\textra = string.charCodeAt(counter++);\n\t\t\t\tif ((extra & 0xFC00) == 0xDC00) { // low surrogate\n\t\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t\t} else {\n\t\t\t\t\t// unmatched surrogate; only append this code unit, in case the next\n\t\t\t\t\t// code unit is the high surrogate of a surrogate pair\n\t\t\t\t\toutput.push(value);\n\t\t\t\t\tcounter--;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\toutput.push(value);\n\t\t\t}\n\t\t}\n\t\treturn output;\n\t}\n\n\t// Taken from https://mths.be/punycode\n\tfunction ucs2encode(array) {\n\t\tvar length = array.length;\n\t\tvar index = -1;\n\t\tvar value;\n\t\tvar output = '';\n\t\twhile (++index < length) {\n\t\t\tvalue = array[index];\n\t\t\tif (value > 0xFFFF) {\n\t\t\t\tvalue -= 0x10000;\n\t\t\t\toutput += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);\n\t\t\t\tvalue = 0xDC00 | value & 0x3FF;\n\t\t\t}\n\t\t\toutput += stringFromCharCode(value);\n\t\t}\n\t\treturn output;\n\t}\n\n\tfunction checkScalarValue(codePoint) {\n\t\tif (codePoint >= 0xD800 && codePoint <= 0xDFFF) {\n\t\t\tthrow Error(\n\t\t\t\t'Lone surrogate U+' + codePoint.toString(16).toUpperCase() +\n\t\t\t\t' is not a scalar value'\n\t\t\t);\n\t\t}\n\t}\n\t/*--------------------------------------------------------------------------*/\n\n\tfunction createByte(codePoint, shift) {\n\t\treturn stringFromCharCode(((codePoint >> shift) & 0x3F) | 0x80);\n\t}\n\n\tfunction encodeCodePoint(codePoint) {\n\t\tif ((codePoint & 0xFFFFFF80) == 0) { // 1-byte sequence\n\t\t\treturn stringFromCharCode(codePoint);\n\t\t}\n\t\tvar symbol = '';\n\t\tif ((codePoint & 0xFFFFF800) == 0) { // 2-byte sequence\n\t\t\tsymbol = stringFromCharCode(((codePoint >> 6) & 0x1F) | 0xC0);\n\t\t}\n\t\telse if ((codePoint & 0xFFFF0000) == 0) { // 3-byte sequence\n\t\t\tcheckScalarValue(codePoint);\n\t\t\tsymbol = stringFromCharCode(((codePoint >> 12) & 0x0F) | 0xE0);\n\t\t\tsymbol += createByte(codePoint, 6);\n\t\t}\n\t\telse if ((codePoint & 0xFFE00000) == 0) { // 4-byte sequence\n\t\t\tsymbol = stringFromCharCode(((codePoint >> 18) & 0x07) | 0xF0);\n\t\t\tsymbol += createByte(codePoint, 12);\n\t\t\tsymbol += createByte(codePoint, 6);\n\t\t}\n\t\tsymbol += stringFromCharCode((codePoint & 0x3F) | 0x80);\n\t\treturn symbol;\n\t}\n\n\tfunction utf8encode(string) {\n\t\tvar codePoints = ucs2decode(string);\n\t\tvar length = codePoints.length;\n\t\tvar index = -1;\n\t\tvar codePoint;\n\t\tvar byteString = '';\n\t\twhile (++index < length) {\n\t\t\tcodePoint = codePoints[index];\n\t\t\tbyteString += encodeCodePoint(codePoint);\n\t\t}\n\t\treturn byteString;\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\tfunction readContinuationByte() {\n\t\tif (byteIndex >= byteCount) {\n\t\t\tthrow Error('Invalid byte index');\n\t\t}\n\n\t\tvar continuationByte = byteArray[byteIndex] & 0xFF;\n\t\tbyteIndex++;\n\n\t\tif ((continuationByte & 0xC0) == 0x80) {\n\t\t\treturn continuationByte & 0x3F;\n\t\t}\n\n\t\t// If we end up here, it’s not a continuation byte\n\t\tthrow Error('Invalid continuation byte');\n\t}\n\n\tfunction decodeSymbol() {\n\t\tvar byte1;\n\t\tvar byte2;\n\t\tvar byte3;\n\t\tvar byte4;\n\t\tvar codePoint;\n\n\t\tif (byteIndex > byteCount) {\n\t\t\tthrow Error('Invalid byte index');\n\t\t}\n\n\t\tif (byteIndex == byteCount) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Read first byte\n\t\tbyte1 = byteArray[byteIndex] & 0xFF;\n\t\tbyteIndex++;\n\n\t\t// 1-byte sequence (no continuation bytes)\n\t\tif ((byte1 & 0x80) == 0) {\n\t\t\treturn byte1;\n\t\t}\n\n\t\t// 2-byte sequence\n\t\tif ((byte1 & 0xE0) == 0xC0) {\n\t\t\tvar byte2 = readContinuationByte();\n\t\t\tcodePoint = ((byte1 & 0x1F) << 6) | byte2;\n\t\t\tif (codePoint >= 0x80) {\n\t\t\t\treturn codePoint;\n\t\t\t} else {\n\t\t\t\tthrow Error('Invalid continuation byte');\n\t\t\t}\n\t\t}\n\n\t\t// 3-byte sequence (may include unpaired surrogates)\n\t\tif ((byte1 & 0xF0) == 0xE0) {\n\t\t\tbyte2 = readContinuationByte();\n\t\t\tbyte3 = readContinuationByte();\n\t\t\tcodePoint = ((byte1 & 0x0F) << 12) | (byte2 << 6) | byte3;\n\t\t\tif (codePoint >= 0x0800) {\n\t\t\t\tcheckScalarValue(codePoint);\n\t\t\t\treturn codePoint;\n\t\t\t} else {\n\t\t\t\tthrow Error('Invalid continuation byte');\n\t\t\t}\n\t\t}\n\n\t\t// 4-byte sequence\n\t\tif ((byte1 & 0xF8) == 0xF0) {\n\t\t\tbyte2 = readContinuationByte();\n\t\t\tbyte3 = readContinuationByte();\n\t\t\tbyte4 = readContinuationByte();\n\t\t\tcodePoint = ((byte1 & 0x0F) << 0x12) | (byte2 << 0x0C) |\n\t\t\t\t(byte3 << 0x06) | byte4;\n\t\t\tif (codePoint >= 0x010000 && codePoint <= 0x10FFFF) {\n\t\t\t\treturn codePoint;\n\t\t\t}\n\t\t}\n\n\t\tthrow Error('Invalid UTF-8 detected');\n\t}\n\n\tvar byteArray;\n\tvar byteCount;\n\tvar byteIndex;\n\tfunction utf8decode(byteString) {\n\t\tbyteArray = ucs2decode(byteString);\n\t\tbyteCount = byteArray.length;\n\t\tbyteIndex = 0;\n\t\tvar codePoints = [];\n\t\tvar tmp;\n\t\twhile ((tmp = decodeSymbol()) !== false) {\n\t\t\tcodePoints.push(tmp);\n\t\t}\n\t\treturn ucs2encode(codePoints);\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\tvar utf8 = {\n\t\t'version': '2.0.0',\n\t\t'encode': utf8encode,\n\t\t'decode': utf8decode\n\t};\n\n\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t// like the following:\n\tif (\n\t\ttypeof define == 'function' &&\n\t\ttypeof define.amd == 'object' &&\n\t\tdefine.amd\n\t) {\n\t\tdefine(function() {\n\t\t\treturn utf8;\n\t\t});\n\t}\telse if (freeExports && !freeExports.nodeType) {\n\t\tif (freeModule) { // in Node.js or RingoJS v0.8.0+\n\t\t\tfreeModule.exports = utf8;\n\t\t} else { // in Narwhal or RingoJS v0.7.0-\n\t\t\tvar object = {};\n\t\t\tvar hasOwnProperty = object.hasOwnProperty;\n\t\t\tfor (var key in utf8) {\n\t\t\t\thasOwnProperty.call(utf8, key) && (freeExports[key] = utf8[key]);\n\t\t\t}\n\t\t}\n\t} else { // in Rhino or a web browser\n\t\troot.utf8 = utf8;\n\t}\n\n}(this));\n","'use strict';\n\nvar alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'.split('')\n , length = 64\n , map = {}\n , seed = 0\n , i = 0\n , prev;\n\n/**\n * Return a string representing the specified number.\n *\n * @param {Number} num The number to convert.\n * @returns {String} The string representation of the number.\n * @api public\n */\nfunction encode(num) {\n var encoded = '';\n\n do {\n encoded = alphabet[num % length] + encoded;\n num = Math.floor(num / length);\n } while (num > 0);\n\n return encoded;\n}\n\n/**\n * Return the integer value specified by the given string.\n *\n * @param {String} str The string to convert.\n * @returns {Number} The integer value represented by the string.\n * @api public\n */\nfunction decode(str) {\n var decoded = 0;\n\n for (i = 0; i < str.length; i++) {\n decoded = decoded * length + map[str.charAt(i)];\n }\n\n return decoded;\n}\n\n/**\n * Yeast: A tiny growing id generator.\n *\n * @returns {String} A unique id.\n * @api public\n */\nfunction yeast() {\n var now = encode(+new Date());\n\n if (now !== prev) return seed = 0, prev = now;\n return now +'.'+ encode(seed++);\n}\n\n//\n// Map each character to its index.\n//\nfor (; i < length; i++) map[alphabet[i]] = i;\n\n//\n// Expose the `yeast`, `encode` and `decode` functions.\n//\nyeast.encode = encode;\nyeast.decode = decode;\nmodule.exports = yeast;\n","/* global Y, global */\r\n'use strict'\r\n\r\n// socket.io requires utf8. This package checks if it is required by requirejs.\r\n// If window.require is set, then it will define itself as a module. This is erratic behavior and\r\n// results in socket.io having a \"bad request\".\r\n// This is why we undefine global.define (it is set by requirejs) before we require socket.io-client.\r\nvar define = global.define\r\nglobal.define = null\r\nvar io = require('socket.io-client')\r\n// redefine global.define\r\nglobal.define = define\r\n\r\nfunction extend (Y) {\r\n class Connector extends Y.AbstractConnector {\r\n constructor (y, options) {\r\n if (options === undefined) {\r\n throw new Error('Options must not be undefined!')\r\n }\r\n if (options.room == null) {\r\n throw new Error('You must define a room name!')\r\n }\r\n options.role = 'slave'\r\n super(y, options)\r\n this.options = options\r\n options.url = options.url || 'https://yjs.dbis.rwth-aachen.de:5074'\r\n var socket = io(options.url)\r\n this.socket = socket\r\n var self = this\r\n if (socket.connected) {\r\n joinRoom()\r\n } else {\r\n socket.on('connect', joinRoom)\r\n }\r\n function joinRoom () {\r\n socket.emit('joinRoom', options.room)\r\n self.userJoined('server', 'master')\r\n\r\n socket.on('yjsEvent', function (message) {\r\n if (message.type != null) {\r\n if (message.type === 'sync done') {\r\n self.setUserId(socket.id)\r\n }\r\n if (message.room === options.room) {\r\n self.receiveMessage('server', message)\r\n }\r\n }\r\n })\r\n\r\n socket.on('disconnect', function (peer) {\r\n self.userLeft('server')\r\n })\r\n }\r\n }\r\n disconnect () {\r\n this.socket.disconnect()\r\n super.disconnect()\r\n }\r\n reconnect () {\r\n this.socket.connect()\r\n this.socket.emit('joinRoom', this.options.room)\r\n this.userJoined('server', 'master')\r\n super.reconnect()\r\n }\r\n send (uid, message) {\r\n message.room = this.options.room\r\n this.socket.emit('yjsEvent', message)\r\n }\r\n broadcast (message) {\r\n message.room = this.options.room\r\n this.socket.emit('yjsEvent', message)\r\n }\r\n isDisconnected () {\r\n return this.socket.disconnected\r\n }\r\n }\r\n Y.extend('websockets-client', Connector)\r\n}\r\n\r\nmodule.exports = extend\r\nif (typeof Y !== 'undefined') {\r\n extend(Y)\r\n}\r\n"],"sourceRoot":"/source/"} |