{"version":3,"file":"pusher-CkGBBHT-.js","sources":["../../../node_modules/pusher-js/dist/web/pusher.js"],"sourcesContent":["/*!\n * Pusher JavaScript Library v7.0.6\n * https://pusher.com/\n *\n * Copyright 2020, Pusher\n * Released under the MIT licence.\n */\n\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Pusher\"] = factory();\n\telse\n\t\troot[\"Pusher\"] = factory();\n})(window, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// define __esModule on exports\n/******/ \t__webpack_require__.r = function(exports) {\n/******/ \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n/******/ \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n/******/ \t\t}\n/******/ \t\tObject.defineProperty(exports, '__esModule', { value: true });\n/******/ \t};\n/******/\n/******/ \t// create a fake namespace object\n/******/ \t// mode & 1: value is a module id, require it\n/******/ \t// mode & 2: merge all properties of value into the ns\n/******/ \t// mode & 4: return value when already ns object\n/******/ \t// mode & 8|1: behave like require\n/******/ \t__webpack_require__.t = function(value, mode) {\n/******/ \t\tif(mode & 1) value = __webpack_require__(value);\n/******/ \t\tif(mode & 8) return value;\n/******/ \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n/******/ \t\tvar ns = Object.create(null);\n/******/ \t\t__webpack_require__.r(ns);\n/******/ \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n/******/ \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n/******/ \t\treturn ns;\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 2);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// Copyright (C) 2016 Dmitry Chestnykh\n// MIT License. See LICENSE file for details.\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Package base64 implements Base64 encoding and decoding.\n */\n// Invalid character used in decoding to indicate\n// that the character to decode is out of range of\n// alphabet and cannot be decoded.\nvar INVALID_BYTE = 256;\n/**\n * Implements standard Base64 encoding.\n *\n * Operates in constant time.\n */\nvar Coder = /** @class */ (function () {\n // TODO(dchest): methods to encode chunk-by-chunk.\n function Coder(_paddingCharacter) {\n if (_paddingCharacter === void 0) { _paddingCharacter = \"=\"; }\n this._paddingCharacter = _paddingCharacter;\n }\n Coder.prototype.encodedLength = function (length) {\n if (!this._paddingCharacter) {\n return (length * 8 + 5) / 6 | 0;\n }\n return (length + 2) / 3 * 4 | 0;\n };\n Coder.prototype.encode = function (data) {\n var out = \"\";\n var i = 0;\n for (; i < data.length - 2; i += 3) {\n var c = (data[i] << 16) | (data[i + 1] << 8) | (data[i + 2]);\n out += this._encodeByte((c >>> 3 * 6) & 63);\n out += this._encodeByte((c >>> 2 * 6) & 63);\n out += this._encodeByte((c >>> 1 * 6) & 63);\n out += this._encodeByte((c >>> 0 * 6) & 63);\n }\n var left = data.length - i;\n if (left > 0) {\n var c = (data[i] << 16) | (left === 2 ? data[i + 1] << 8 : 0);\n out += this._encodeByte((c >>> 3 * 6) & 63);\n out += this._encodeByte((c >>> 2 * 6) & 63);\n if (left === 2) {\n out += this._encodeByte((c >>> 1 * 6) & 63);\n }\n else {\n out += this._paddingCharacter || \"\";\n }\n out += this._paddingCharacter || \"\";\n }\n return out;\n };\n Coder.prototype.maxDecodedLength = function (length) {\n if (!this._paddingCharacter) {\n return (length * 6 + 7) / 8 | 0;\n }\n return length / 4 * 3 | 0;\n };\n Coder.prototype.decodedLength = function (s) {\n return this.maxDecodedLength(s.length - this._getPaddingLength(s));\n };\n Coder.prototype.decode = function (s) {\n if (s.length === 0) {\n return new Uint8Array(0);\n }\n var paddingLength = this._getPaddingLength(s);\n var length = s.length - paddingLength;\n var out = new Uint8Array(this.maxDecodedLength(length));\n var op = 0;\n var i = 0;\n var haveBad = 0;\n var v0 = 0, v1 = 0, v2 = 0, v3 = 0;\n for (; i < length - 4; i += 4) {\n v0 = this._decodeChar(s.charCodeAt(i + 0));\n v1 = this._decodeChar(s.charCodeAt(i + 1));\n v2 = this._decodeChar(s.charCodeAt(i + 2));\n v3 = this._decodeChar(s.charCodeAt(i + 3));\n out[op++] = (v0 << 2) | (v1 >>> 4);\n out[op++] = (v1 << 4) | (v2 >>> 2);\n out[op++] = (v2 << 6) | v3;\n haveBad |= v0 & INVALID_BYTE;\n haveBad |= v1 & INVALID_BYTE;\n haveBad |= v2 & INVALID_BYTE;\n haveBad |= v3 & INVALID_BYTE;\n }\n if (i < length - 1) {\n v0 = this._decodeChar(s.charCodeAt(i));\n v1 = this._decodeChar(s.charCodeAt(i + 1));\n out[op++] = (v0 << 2) | (v1 >>> 4);\n haveBad |= v0 & INVALID_BYTE;\n haveBad |= v1 & INVALID_BYTE;\n }\n if (i < length - 2) {\n v2 = this._decodeChar(s.charCodeAt(i + 2));\n out[op++] = (v1 << 4) | (v2 >>> 2);\n haveBad |= v2 & INVALID_BYTE;\n }\n if (i < length - 3) {\n v3 = this._decodeChar(s.charCodeAt(i + 3));\n out[op++] = (v2 << 6) | v3;\n haveBad |= v3 & INVALID_BYTE;\n }\n if (haveBad !== 0) {\n throw new Error(\"Base64Coder: incorrect characters for decoding\");\n }\n return out;\n };\n // Standard encoding have the following encoded/decoded ranges,\n // which we need to convert between.\n //\n // ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789 + /\n // Index: 0 - 25 26 - 51 52 - 61 62 63\n // ASCII: 65 - 90 97 - 122 48 - 57 43 47\n //\n // Encode 6 bits in b into a new character.\n Coder.prototype._encodeByte = function (b) {\n // Encoding uses constant time operations as follows:\n //\n // 1. Define comparison of A with B using (A - B) >>> 8:\n // if A > B, then result is positive integer\n // if A <= B, then result is 0\n //\n // 2. Define selection of C or 0 using bitwise AND: X & C:\n // if X == 0, then result is 0\n // if X != 0, then result is C\n //\n // 3. Start with the smallest comparison (b >= 0), which is always\n // true, so set the result to the starting ASCII value (65).\n //\n // 4. Continue comparing b to higher ASCII values, and selecting\n // zero if comparison isn't true, otherwise selecting a value\n // to add to result, which:\n //\n // a) undoes the previous addition\n // b) provides new value to add\n //\n var result = b;\n // b >= 0\n result += 65;\n // b > 25\n result += ((25 - b) >>> 8) & ((0 - 65) - 26 + 97);\n // b > 51\n result += ((51 - b) >>> 8) & ((26 - 97) - 52 + 48);\n // b > 61\n result += ((61 - b) >>> 8) & ((52 - 48) - 62 + 43);\n // b > 62\n result += ((62 - b) >>> 8) & ((62 - 43) - 63 + 47);\n return String.fromCharCode(result);\n };\n // Decode a character code into a byte.\n // Must return 256 if character is out of alphabet range.\n Coder.prototype._decodeChar = function (c) {\n // Decoding works similar to encoding: using the same comparison\n // function, but now it works on ranges: result is always incremented\n // by value, but this value becomes zero if the range is not\n // satisfied.\n //\n // Decoding starts with invalid value, 256, which is then\n // subtracted when the range is satisfied. If none of the ranges\n // apply, the function returns 256, which is then checked by\n // the caller to throw error.\n var result = INVALID_BYTE; // start with invalid character\n // c == 43 (c > 42 and c < 44)\n result += (((42 - c) & (c - 44)) >>> 8) & (-INVALID_BYTE + c - 43 + 62);\n // c == 47 (c > 46 and c < 48)\n result += (((46 - c) & (c - 48)) >>> 8) & (-INVALID_BYTE + c - 47 + 63);\n // c > 47 and c < 58\n result += (((47 - c) & (c - 58)) >>> 8) & (-INVALID_BYTE + c - 48 + 52);\n // c > 64 and c < 91\n result += (((64 - c) & (c - 91)) >>> 8) & (-INVALID_BYTE + c - 65 + 0);\n // c > 96 and c < 123\n result += (((96 - c) & (c - 123)) >>> 8) & (-INVALID_BYTE + c - 97 + 26);\n return result;\n };\n Coder.prototype._getPaddingLength = function (s) {\n var paddingLength = 0;\n if (this._paddingCharacter) {\n for (var i = s.length - 1; i >= 0; i--) {\n if (s[i] !== this._paddingCharacter) {\n break;\n }\n paddingLength++;\n }\n if (s.length < 4 || paddingLength > 2) {\n throw new Error(\"Base64Coder: incorrect padding\");\n }\n }\n return paddingLength;\n };\n return Coder;\n}());\nexports.Coder = Coder;\nvar stdCoder = new Coder();\nfunction encode(data) {\n return stdCoder.encode(data);\n}\nexports.encode = encode;\nfunction decode(s) {\n return stdCoder.decode(s);\n}\nexports.decode = decode;\n/**\n * Implements URL-safe Base64 encoding.\n * (Same as Base64, but '+' is replaced with '-', and '/' with '_').\n *\n * Operates in constant time.\n */\nvar URLSafeCoder = /** @class */ (function (_super) {\n __extends(URLSafeCoder, _super);\n function URLSafeCoder() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n // URL-safe encoding have the following encoded/decoded ranges:\n //\n // ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789 - _\n // Index: 0 - 25 26 - 51 52 - 61 62 63\n // ASCII: 65 - 90 97 - 122 48 - 57 45 95\n //\n URLSafeCoder.prototype._encodeByte = function (b) {\n var result = b;\n // b >= 0\n result += 65;\n // b > 25\n result += ((25 - b) >>> 8) & ((0 - 65) - 26 + 97);\n // b > 51\n result += ((51 - b) >>> 8) & ((26 - 97) - 52 + 48);\n // b > 61\n result += ((61 - b) >>> 8) & ((52 - 48) - 62 + 45);\n // b > 62\n result += ((62 - b) >>> 8) & ((62 - 45) - 63 + 95);\n return String.fromCharCode(result);\n };\n URLSafeCoder.prototype._decodeChar = function (c) {\n var result = INVALID_BYTE;\n // c == 45 (c > 44 and c < 46)\n result += (((44 - c) & (c - 46)) >>> 8) & (-INVALID_BYTE + c - 45 + 62);\n // c == 95 (c > 94 and c < 96)\n result += (((94 - c) & (c - 96)) >>> 8) & (-INVALID_BYTE + c - 95 + 63);\n // c > 47 and c < 58\n result += (((47 - c) & (c - 58)) >>> 8) & (-INVALID_BYTE + c - 48 + 52);\n // c > 64 and c < 91\n result += (((64 - c) & (c - 91)) >>> 8) & (-INVALID_BYTE + c - 65 + 0);\n // c > 96 and c < 123\n result += (((96 - c) & (c - 123)) >>> 8) & (-INVALID_BYTE + c - 97 + 26);\n return result;\n };\n return URLSafeCoder;\n}(Coder));\nexports.URLSafeCoder = URLSafeCoder;\nvar urlSafeCoder = new URLSafeCoder();\nfunction encodeURLSafe(data) {\n return urlSafeCoder.encode(data);\n}\nexports.encodeURLSafe = encodeURLSafe;\nfunction decodeURLSafe(s) {\n return urlSafeCoder.decode(s);\n}\nexports.decodeURLSafe = decodeURLSafe;\nexports.encodedLength = function (length) {\n return stdCoder.encodedLength(length);\n};\nexports.maxDecodedLength = function (length) {\n return stdCoder.maxDecodedLength(length);\n};\nexports.decodedLength = function (s) {\n return stdCoder.decodedLength(s);\n};\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// Copyright (C) 2016 Dmitry Chestnykh\n// MIT License. See LICENSE file for details.\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Package utf8 implements UTF-8 encoding and decoding.\n */\nvar INVALID_UTF16 = \"utf8: invalid string\";\nvar INVALID_UTF8 = \"utf8: invalid source encoding\";\n/**\n * Encodes the given string into UTF-8 byte array.\n * Throws if the source string has invalid UTF-16 encoding.\n */\nfunction encode(s) {\n // Calculate result length and allocate output array.\n // encodedLength() also validates string and throws errors,\n // so we don't need repeat validation here.\n var arr = new Uint8Array(encodedLength(s));\n var pos = 0;\n for (var i = 0; i < s.length; i++) {\n var c = s.charCodeAt(i);\n if (c < 0x80) {\n arr[pos++] = c;\n }\n else if (c < 0x800) {\n arr[pos++] = 0xc0 | c >> 6;\n arr[pos++] = 0x80 | c & 0x3f;\n }\n else if (c < 0xd800) {\n arr[pos++] = 0xe0 | c >> 12;\n arr[pos++] = 0x80 | (c >> 6) & 0x3f;\n arr[pos++] = 0x80 | c & 0x3f;\n }\n else {\n i++; // get one more character\n c = (c & 0x3ff) << 10;\n c |= s.charCodeAt(i) & 0x3ff;\n c += 0x10000;\n arr[pos++] = 0xf0 | c >> 18;\n arr[pos++] = 0x80 | (c >> 12) & 0x3f;\n arr[pos++] = 0x80 | (c >> 6) & 0x3f;\n arr[pos++] = 0x80 | c & 0x3f;\n }\n }\n return arr;\n}\nexports.encode = encode;\n/**\n * Returns the number of bytes required to encode the given string into UTF-8.\n * Throws if the source string has invalid UTF-16 encoding.\n */\nfunction encodedLength(s) {\n var result = 0;\n for (var i = 0; i < s.length; i++) {\n var c = s.charCodeAt(i);\n if (c < 0x80) {\n result += 1;\n }\n else if (c < 0x800) {\n result += 2;\n }\n else if (c < 0xd800) {\n result += 3;\n }\n else if (c <= 0xdfff) {\n if (i >= s.length - 1) {\n throw new Error(INVALID_UTF16);\n }\n i++; // \"eat\" next character\n result += 4;\n }\n else {\n throw new Error(INVALID_UTF16);\n }\n }\n return result;\n}\nexports.encodedLength = encodedLength;\n/**\n * Decodes the given byte array from UTF-8 into a string.\n * Throws if encoding is invalid.\n */\nfunction decode(arr) {\n var chars = [];\n for (var i = 0; i < arr.length; i++) {\n var b = arr[i];\n if (b & 0x80) {\n var min = void 0;\n if (b < 0xe0) {\n // Need 1 more byte.\n if (i >= arr.length) {\n throw new Error(INVALID_UTF8);\n }\n var n1 = arr[++i];\n if ((n1 & 0xc0) !== 0x80) {\n throw new Error(INVALID_UTF8);\n }\n b = (b & 0x1f) << 6 | (n1 & 0x3f);\n min = 0x80;\n }\n else if (b < 0xf0) {\n // Need 2 more bytes.\n if (i >= arr.length - 1) {\n throw new Error(INVALID_UTF8);\n }\n var n1 = arr[++i];\n var n2 = arr[++i];\n if ((n1 & 0xc0) !== 0x80 || (n2 & 0xc0) !== 0x80) {\n throw new Error(INVALID_UTF8);\n }\n b = (b & 0x0f) << 12 | (n1 & 0x3f) << 6 | (n2 & 0x3f);\n min = 0x800;\n }\n else if (b < 0xf8) {\n // Need 3 more bytes.\n if (i >= arr.length - 2) {\n throw new Error(INVALID_UTF8);\n }\n var n1 = arr[++i];\n var n2 = arr[++i];\n var n3 = arr[++i];\n if ((n1 & 0xc0) !== 0x80 || (n2 & 0xc0) !== 0x80 || (n3 & 0xc0) !== 0x80) {\n throw new Error(INVALID_UTF8);\n }\n b = (b & 0x0f) << 18 | (n1 & 0x3f) << 12 | (n2 & 0x3f) << 6 | (n3 & 0x3f);\n min = 0x10000;\n }\n else {\n throw new Error(INVALID_UTF8);\n }\n if (b < min || (b >= 0xd800 && b <= 0xdfff)) {\n throw new Error(INVALID_UTF8);\n }\n if (b >= 0x10000) {\n // Surrogate pair.\n if (b > 0x10ffff) {\n throw new Error(INVALID_UTF8);\n }\n b -= 0x10000;\n chars.push(String.fromCharCode(0xd800 | (b >> 10)));\n b = 0xdc00 | (b & 0x3ff);\n }\n }\n chars.push(String.fromCharCode(b));\n }\n return chars.join(\"\");\n}\nexports.decode = decode;\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// required so we don't have to do require('pusher').default etc.\nmodule.exports = __webpack_require__(3).default;\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n// ESM COMPAT FLAG\n__webpack_require__.r(__webpack_exports__);\n\n// CONCATENATED MODULE: ./src/runtimes/web/dom/script_receiver_factory.ts\nvar ScriptReceiverFactory = (function () {\n function ScriptReceiverFactory(prefix, name) {\n this.lastId = 0;\n this.prefix = prefix;\n this.name = name;\n }\n ScriptReceiverFactory.prototype.create = function (callback) {\n this.lastId++;\n var number = this.lastId;\n var id = this.prefix + number;\n var name = this.name + '[' + number + ']';\n var called = false;\n var callbackWrapper = function () {\n if (!called) {\n callback.apply(null, arguments);\n called = true;\n }\n };\n this[number] = callbackWrapper;\n return { number: number, id: id, name: name, callback: callbackWrapper };\n };\n ScriptReceiverFactory.prototype.remove = function (receiver) {\n delete this[receiver.number];\n };\n return ScriptReceiverFactory;\n}());\n\nvar ScriptReceivers = new ScriptReceiverFactory('_pusher_script_', 'Pusher.ScriptReceivers');\n\n// CONCATENATED MODULE: ./src/core/defaults.ts\nvar Defaults = {\n VERSION: \"7.0.6\",\n PROTOCOL: 7,\n wsPort: 80,\n wssPort: 443,\n wsPath: '',\n httpHost: 'sockjs.pusher.com',\n httpPort: 80,\n httpsPort: 443,\n httpPath: '/pusher',\n stats_host: 'stats.pusher.com',\n authEndpoint: '/pusher/auth',\n authTransport: 'ajax',\n activityTimeout: 120000,\n pongTimeout: 30000,\n unavailableTimeout: 10000,\n cluster: 'mt1',\n cdn_http: \"http://js.pusher.com\",\n cdn_https: \"https://js.pusher.com\",\n dependency_suffix: \"\"\n};\n/* harmony default export */ var defaults = (Defaults);\n\n// CONCATENATED MODULE: ./src/runtimes/web/dom/dependency_loader.ts\n\n\nvar dependency_loader_DependencyLoader = (function () {\n function DependencyLoader(options) {\n this.options = options;\n this.receivers = options.receivers || ScriptReceivers;\n this.loading = {};\n }\n DependencyLoader.prototype.load = function (name, options, callback) {\n var self = this;\n if (self.loading[name] && self.loading[name].length > 0) {\n self.loading[name].push(callback);\n }\n else {\n self.loading[name] = [callback];\n var request = runtime.createScriptRequest(self.getPath(name, options));\n var receiver = self.receivers.create(function (error) {\n self.receivers.remove(receiver);\n if (self.loading[name]) {\n var callbacks = self.loading[name];\n delete self.loading[name];\n var successCallback = function (wasSuccessful) {\n if (!wasSuccessful) {\n request.cleanup();\n }\n };\n for (var i = 0; i < callbacks.length; i++) {\n callbacks[i](error, successCallback);\n }\n }\n });\n request.send(receiver);\n }\n };\n DependencyLoader.prototype.getRoot = function (options) {\n var cdn;\n var protocol = runtime.getDocument().location.protocol;\n if ((options && options.useTLS) || protocol === 'https:') {\n cdn = this.options.cdn_https;\n }\n else {\n cdn = this.options.cdn_http;\n }\n return cdn.replace(/\\/*$/, '') + '/' + this.options.version;\n };\n DependencyLoader.prototype.getPath = function (name, options) {\n return this.getRoot(options) + '/' + name + this.options.suffix + '.js';\n };\n return DependencyLoader;\n}());\n/* harmony default export */ var dependency_loader = (dependency_loader_DependencyLoader);\n\n// CONCATENATED MODULE: ./src/runtimes/web/dom/dependencies.ts\n\n\n\nvar DependenciesReceivers = new ScriptReceiverFactory('_pusher_dependencies', 'Pusher.DependenciesReceivers');\nvar Dependencies = new dependency_loader({\n cdn_http: defaults.cdn_http,\n cdn_https: defaults.cdn_https,\n version: defaults.VERSION,\n suffix: defaults.dependency_suffix,\n receivers: DependenciesReceivers\n});\n\n// CONCATENATED MODULE: ./src/core/utils/url_store.ts\nvar urlStore = {\n baseUrl: 'https://pusher.com',\n urls: {\n authenticationEndpoint: {\n path: '/docs/authenticating_users'\n },\n javascriptQuickStart: {\n path: '/docs/javascript_quick_start'\n },\n triggeringClientEvents: {\n path: '/docs/client_api_guide/client_events#trigger-events'\n },\n encryptedChannelSupport: {\n fullUrl: 'https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support'\n }\n }\n};\nvar buildLogSuffix = function (key) {\n var urlPrefix = 'See:';\n var urlObj = urlStore.urls[key];\n if (!urlObj)\n return '';\n var url;\n if (urlObj.fullUrl) {\n url = urlObj.fullUrl;\n }\n else if (urlObj.path) {\n url = urlStore.baseUrl + urlObj.path;\n }\n if (!url)\n return '';\n return urlPrefix + \" \" + url;\n};\n/* harmony default export */ var url_store = ({ buildLogSuffix: buildLogSuffix });\n\n// CONCATENATED MODULE: ./src/core/errors.ts\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar BadEventName = (function (_super) {\n __extends(BadEventName, _super);\n function BadEventName(msg) {\n var _newTarget = this.constructor;\n var _this = _super.call(this, msg) || this;\n Object.setPrototypeOf(_this, _newTarget.prototype);\n return _this;\n }\n return BadEventName;\n}(Error));\n\nvar RequestTimedOut = (function (_super) {\n __extends(RequestTimedOut, _super);\n function RequestTimedOut(msg) {\n var _newTarget = this.constructor;\n var _this = _super.call(this, msg) || this;\n Object.setPrototypeOf(_this, _newTarget.prototype);\n return _this;\n }\n return RequestTimedOut;\n}(Error));\n\nvar TransportPriorityTooLow = (function (_super) {\n __extends(TransportPriorityTooLow, _super);\n function TransportPriorityTooLow(msg) {\n var _newTarget = this.constructor;\n var _this = _super.call(this, msg) || this;\n Object.setPrototypeOf(_this, _newTarget.prototype);\n return _this;\n }\n return TransportPriorityTooLow;\n}(Error));\n\nvar TransportClosed = (function (_super) {\n __extends(TransportClosed, _super);\n function TransportClosed(msg) {\n var _newTarget = this.constructor;\n var _this = _super.call(this, msg) || this;\n Object.setPrototypeOf(_this, _newTarget.prototype);\n return _this;\n }\n return TransportClosed;\n}(Error));\n\nvar UnsupportedFeature = (function (_super) {\n __extends(UnsupportedFeature, _super);\n function UnsupportedFeature(msg) {\n var _newTarget = this.constructor;\n var _this = _super.call(this, msg) || this;\n Object.setPrototypeOf(_this, _newTarget.prototype);\n return _this;\n }\n return UnsupportedFeature;\n}(Error));\n\nvar UnsupportedTransport = (function (_super) {\n __extends(UnsupportedTransport, _super);\n function UnsupportedTransport(msg) {\n var _newTarget = this.constructor;\n var _this = _super.call(this, msg) || this;\n Object.setPrototypeOf(_this, _newTarget.prototype);\n return _this;\n }\n return UnsupportedTransport;\n}(Error));\n\nvar UnsupportedStrategy = (function (_super) {\n __extends(UnsupportedStrategy, _super);\n function UnsupportedStrategy(msg) {\n var _newTarget = this.constructor;\n var _this = _super.call(this, msg) || this;\n Object.setPrototypeOf(_this, _newTarget.prototype);\n return _this;\n }\n return UnsupportedStrategy;\n}(Error));\n\nvar HTTPAuthError = (function (_super) {\n __extends(HTTPAuthError, _super);\n function HTTPAuthError(status, msg) {\n var _newTarget = this.constructor;\n var _this = _super.call(this, msg) || this;\n _this.status = status;\n Object.setPrototypeOf(_this, _newTarget.prototype);\n return _this;\n }\n return HTTPAuthError;\n}(Error));\n\n\n// CONCATENATED MODULE: ./src/runtimes/isomorphic/auth/xhr_auth.ts\n\n\n\nvar ajax = function (context, socketId, callback) {\n var self = this, xhr;\n xhr = runtime.createXHR();\n xhr.open('POST', self.options.authEndpoint, true);\n xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n for (var headerName in this.authOptions.headers) {\n xhr.setRequestHeader(headerName, this.authOptions.headers[headerName]);\n }\n xhr.onreadystatechange = function () {\n if (xhr.readyState === 4) {\n if (xhr.status === 200) {\n var data = void 0;\n var parsed = false;\n try {\n data = JSON.parse(xhr.responseText);\n parsed = true;\n }\n catch (e) {\n callback(new HTTPAuthError(200, 'JSON returned from auth endpoint was invalid, yet status code was 200. Data was: ' +\n xhr.responseText), { auth: '' });\n }\n if (parsed) {\n callback(null, data);\n }\n }\n else {\n var suffix = url_store.buildLogSuffix('authenticationEndpoint');\n callback(new HTTPAuthError(xhr.status, 'Unable to retrieve auth string from auth endpoint - ' +\n (\"received status: \" + xhr.status + \" from \" + self.options.authEndpoint + \". \") +\n (\"Clients must be authenticated to join private or presence channels. \" + suffix)), { auth: '' });\n }\n }\n };\n xhr.send(this.composeQuery(socketId));\n return xhr;\n};\n/* harmony default export */ var xhr_auth = (ajax);\n\n// CONCATENATED MODULE: ./src/core/base64.ts\nfunction encode(s) {\n return btoa(utob(s));\n}\nvar fromCharCode = String.fromCharCode;\nvar b64chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\nvar b64tab = {};\nfor (var base64_i = 0, l = b64chars.length; base64_i < l; base64_i++) {\n b64tab[b64chars.charAt(base64_i)] = base64_i;\n}\nvar cb_utob = function (c) {\n var cc = c.charCodeAt(0);\n return cc < 0x80\n ? c\n : cc < 0x800\n ? fromCharCode(0xc0 | (cc >>> 6)) + fromCharCode(0x80 | (cc & 0x3f))\n : fromCharCode(0xe0 | ((cc >>> 12) & 0x0f)) +\n fromCharCode(0x80 | ((cc >>> 6) & 0x3f)) +\n fromCharCode(0x80 | (cc & 0x3f));\n};\nvar utob = function (u) {\n return u.replace(/[^\\x00-\\x7F]/g, cb_utob);\n};\nvar cb_encode = function (ccc) {\n var padlen = [0, 2, 1][ccc.length % 3];\n var ord = (ccc.charCodeAt(0) << 16) |\n ((ccc.length > 1 ? ccc.charCodeAt(1) : 0) << 8) |\n (ccc.length > 2 ? ccc.charCodeAt(2) : 0);\n var chars = [\n b64chars.charAt(ord >>> 18),\n b64chars.charAt((ord >>> 12) & 63),\n padlen >= 2 ? '=' : b64chars.charAt((ord >>> 6) & 63),\n padlen >= 1 ? '=' : b64chars.charAt(ord & 63)\n ];\n return chars.join('');\n};\nvar btoa = window.btoa ||\n function (b) {\n return b.replace(/[\\s\\S]{1,3}/g, cb_encode);\n };\n\n// CONCATENATED MODULE: ./src/core/utils/timers/abstract_timer.ts\nvar Timer = (function () {\n function Timer(set, clear, delay, callback) {\n var _this = this;\n this.clear = clear;\n this.timer = set(function () {\n if (_this.timer) {\n _this.timer = callback(_this.timer);\n }\n }, delay);\n }\n Timer.prototype.isRunning = function () {\n return this.timer !== null;\n };\n Timer.prototype.ensureAborted = function () {\n if (this.timer) {\n this.clear(this.timer);\n this.timer = null;\n }\n };\n return Timer;\n}());\n/* harmony default export */ var abstract_timer = (Timer);\n\n// CONCATENATED MODULE: ./src/core/utils/timers/index.ts\nvar timers_extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\nfunction timers_clearTimeout(timer) {\n window.clearTimeout(timer);\n}\nfunction timers_clearInterval(timer) {\n window.clearInterval(timer);\n}\nvar OneOffTimer = (function (_super) {\n timers_extends(OneOffTimer, _super);\n function OneOffTimer(delay, callback) {\n return _super.call(this, setTimeout, timers_clearTimeout, delay, function (timer) {\n callback();\n return null;\n }) || this;\n }\n return OneOffTimer;\n}(abstract_timer));\n\nvar PeriodicTimer = (function (_super) {\n timers_extends(PeriodicTimer, _super);\n function PeriodicTimer(delay, callback) {\n return _super.call(this, setInterval, timers_clearInterval, delay, function (timer) {\n callback();\n return timer;\n }) || this;\n }\n return PeriodicTimer;\n}(abstract_timer));\n\n\n// CONCATENATED MODULE: ./src/core/util.ts\n\nvar Util = {\n now: function () {\n if (Date.now) {\n return Date.now();\n }\n else {\n return new Date().valueOf();\n }\n },\n defer: function (callback) {\n return new OneOffTimer(0, callback);\n },\n method: function (name) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n var boundArguments = Array.prototype.slice.call(arguments, 1);\n return function (object) {\n return object[name].apply(object, boundArguments.concat(arguments));\n };\n }\n};\n/* harmony default export */ var util = (Util);\n\n// CONCATENATED MODULE: ./src/core/utils/collections.ts\n\n\nfunction extend(target) {\n var sources = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n sources[_i - 1] = arguments[_i];\n }\n for (var i = 0; i < sources.length; i++) {\n var extensions = sources[i];\n for (var property in extensions) {\n if (extensions[property] &&\n extensions[property].constructor &&\n extensions[property].constructor === Object) {\n target[property] = extend(target[property] || {}, extensions[property]);\n }\n else {\n target[property] = extensions[property];\n }\n }\n }\n return target;\n}\nfunction stringify() {\n var m = ['Pusher'];\n for (var i = 0; i < arguments.length; i++) {\n if (typeof arguments[i] === 'string') {\n m.push(arguments[i]);\n }\n else {\n m.push(safeJSONStringify(arguments[i]));\n }\n }\n return m.join(' : ');\n}\nfunction arrayIndexOf(array, item) {\n var nativeIndexOf = Array.prototype.indexOf;\n if (array === null) {\n return -1;\n }\n if (nativeIndexOf && array.indexOf === nativeIndexOf) {\n return array.indexOf(item);\n }\n for (var i = 0, l = array.length; i < l; i++) {\n if (array[i] === item) {\n return i;\n }\n }\n return -1;\n}\nfunction objectApply(object, f) {\n for (var key in object) {\n if (Object.prototype.hasOwnProperty.call(object, key)) {\n f(object[key], key, object);\n }\n }\n}\nfunction keys(object) {\n var keys = [];\n objectApply(object, function (_, key) {\n keys.push(key);\n });\n return keys;\n}\nfunction values(object) {\n var values = [];\n objectApply(object, function (value) {\n values.push(value);\n });\n return values;\n}\nfunction apply(array, f, context) {\n for (var i = 0; i < array.length; i++) {\n f.call(context || window, array[i], i, array);\n }\n}\nfunction map(array, f) {\n var result = [];\n for (var i = 0; i < array.length; i++) {\n result.push(f(array[i], i, array, result));\n }\n return result;\n}\nfunction mapObject(object, f) {\n var result = {};\n objectApply(object, function (value, key) {\n result[key] = f(value);\n });\n return result;\n}\nfunction filter(array, test) {\n test =\n test ||\n function (value) {\n return !!value;\n };\n var result = [];\n for (var i = 0; i < array.length; i++) {\n if (test(array[i], i, array, result)) {\n result.push(array[i]);\n }\n }\n return result;\n}\nfunction filterObject(object, test) {\n var result = {};\n objectApply(object, function (value, key) {\n if ((test && test(value, key, object, result)) || Boolean(value)) {\n result[key] = value;\n }\n });\n return result;\n}\nfunction flatten(object) {\n var result = [];\n objectApply(object, function (value, key) {\n result.push([key, value]);\n });\n return result;\n}\nfunction any(array, test) {\n for (var i = 0; i < array.length; i++) {\n if (test(array[i], i, array)) {\n return true;\n }\n }\n return false;\n}\nfunction collections_all(array, test) {\n for (var i = 0; i < array.length; i++) {\n if (!test(array[i], i, array)) {\n return false;\n }\n }\n return true;\n}\nfunction encodeParamsObject(data) {\n return mapObject(data, function (value) {\n if (typeof value === 'object') {\n value = safeJSONStringify(value);\n }\n return encodeURIComponent(encode(value.toString()));\n });\n}\nfunction buildQueryString(data) {\n var params = filterObject(data, function (value) {\n return value !== undefined;\n });\n var query = map(flatten(encodeParamsObject(params)), util.method('join', '=')).join('&');\n return query;\n}\nfunction decycleObject(object) {\n var objects = [], paths = [];\n return (function derez(value, path) {\n var i, name, nu;\n switch (typeof value) {\n case 'object':\n if (!value) {\n return null;\n }\n for (i = 0; i < objects.length; i += 1) {\n if (objects[i] === value) {\n return { $ref: paths[i] };\n }\n }\n objects.push(value);\n paths.push(path);\n if (Object.prototype.toString.apply(value) === '[object Array]') {\n nu = [];\n for (i = 0; i < value.length; i += 1) {\n nu[i] = derez(value[i], path + '[' + i + ']');\n }\n }\n else {\n nu = {};\n for (name in value) {\n if (Object.prototype.hasOwnProperty.call(value, name)) {\n nu[name] = derez(value[name], path + '[' + JSON.stringify(name) + ']');\n }\n }\n }\n return nu;\n case 'number':\n case 'string':\n case 'boolean':\n return value;\n }\n })(object, '$');\n}\nfunction safeJSONStringify(source) {\n try {\n return JSON.stringify(source);\n }\n catch (e) {\n return JSON.stringify(decycleObject(source));\n }\n}\n\n// CONCATENATED MODULE: ./src/core/logger.ts\n\n\nvar logger_Logger = (function () {\n function Logger() {\n this.globalLog = function (message) {\n if (window.console && window.console.log) {\n window.console.log(message);\n }\n };\n }\n Logger.prototype.debug = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n this.log(this.globalLog, args);\n };\n Logger.prototype.warn = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n this.log(this.globalLogWarn, args);\n };\n Logger.prototype.error = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n this.log(this.globalLogError, args);\n };\n Logger.prototype.globalLogWarn = function (message) {\n if (window.console && window.console.warn) {\n window.console.warn(message);\n }\n else {\n this.globalLog(message);\n }\n };\n Logger.prototype.globalLogError = function (message) {\n if (window.console && window.console.error) {\n window.console.error(message);\n }\n else {\n this.globalLogWarn(message);\n }\n };\n Logger.prototype.log = function (defaultLoggingFunction) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n var message = stringify.apply(this, arguments);\n if (core_pusher.log) {\n core_pusher.log(message);\n }\n else if (core_pusher.logToConsole) {\n var log = defaultLoggingFunction.bind(this);\n log(message);\n }\n };\n return Logger;\n}());\n/* harmony default export */ var logger = (new logger_Logger());\n\n// CONCATENATED MODULE: ./src/runtimes/web/auth/jsonp_auth.ts\n\nvar jsonp = function (context, socketId, callback) {\n if (this.authOptions.headers !== undefined) {\n logger.warn('To send headers with the auth request, you must use AJAX, rather than JSONP.');\n }\n var callbackName = context.nextAuthCallbackID.toString();\n context.nextAuthCallbackID++;\n var document = context.getDocument();\n var script = document.createElement('script');\n context.auth_callbacks[callbackName] = function (data) {\n callback(null, data);\n };\n var callback_name = \"Pusher.auth_callbacks['\" + callbackName + \"']\";\n script.src =\n this.options.authEndpoint +\n '?callback=' +\n encodeURIComponent(callback_name) +\n '&' +\n this.composeQuery(socketId);\n var head = document.getElementsByTagName('head')[0] || document.documentElement;\n head.insertBefore(script, head.firstChild);\n};\n/* harmony default export */ var jsonp_auth = (jsonp);\n\n// CONCATENATED MODULE: ./src/runtimes/web/dom/script_request.ts\nvar ScriptRequest = (function () {\n function ScriptRequest(src) {\n this.src = src;\n }\n ScriptRequest.prototype.send = function (receiver) {\n var self = this;\n var errorString = 'Error loading ' + self.src;\n self.script = document.createElement('script');\n self.script.id = receiver.id;\n self.script.src = self.src;\n self.script.type = 'text/javascript';\n self.script.charset = 'UTF-8';\n if (self.script.addEventListener) {\n self.script.onerror = function () {\n receiver.callback(errorString);\n };\n self.script.onload = function () {\n receiver.callback(null);\n };\n }\n else {\n self.script.onreadystatechange = function () {\n if (self.script.readyState === 'loaded' ||\n self.script.readyState === 'complete') {\n receiver.callback(null);\n }\n };\n }\n if (self.script.async === undefined &&\n document.attachEvent &&\n /opera/i.test(navigator.userAgent)) {\n self.errorScript = document.createElement('script');\n self.errorScript.id = receiver.id + '_error';\n self.errorScript.text = receiver.name + \"('\" + errorString + \"');\";\n self.script.async = self.errorScript.async = false;\n }\n else {\n self.script.async = true;\n }\n var head = document.getElementsByTagName('head')[0];\n head.insertBefore(self.script, head.firstChild);\n if (self.errorScript) {\n head.insertBefore(self.errorScript, self.script.nextSibling);\n }\n };\n ScriptRequest.prototype.cleanup = function () {\n if (this.script) {\n this.script.onload = this.script.onerror = null;\n this.script.onreadystatechange = null;\n }\n if (this.script && this.script.parentNode) {\n this.script.parentNode.removeChild(this.script);\n }\n if (this.errorScript && this.errorScript.parentNode) {\n this.errorScript.parentNode.removeChild(this.errorScript);\n }\n this.script = null;\n this.errorScript = null;\n };\n return ScriptRequest;\n}());\n/* harmony default export */ var script_request = (ScriptRequest);\n\n// CONCATENATED MODULE: ./src/runtimes/web/dom/jsonp_request.ts\n\n\nvar jsonp_request_JSONPRequest = (function () {\n function JSONPRequest(url, data) {\n this.url = url;\n this.data = data;\n }\n JSONPRequest.prototype.send = function (receiver) {\n if (this.request) {\n return;\n }\n var query = buildQueryString(this.data);\n var url = this.url + '/' + receiver.number + '?' + query;\n this.request = runtime.createScriptRequest(url);\n this.request.send(receiver);\n };\n JSONPRequest.prototype.cleanup = function () {\n if (this.request) {\n this.request.cleanup();\n }\n };\n return JSONPRequest;\n}());\n/* harmony default export */ var jsonp_request = (jsonp_request_JSONPRequest);\n\n// CONCATENATED MODULE: ./src/runtimes/web/timeline/jsonp_timeline.ts\n\n\nvar getAgent = function (sender, useTLS) {\n return function (data, callback) {\n var scheme = 'http' + (useTLS ? 's' : '') + '://';\n var url = scheme + (sender.host || sender.options.host) + sender.options.path;\n var request = runtime.createJSONPRequest(url, data);\n var receiver = runtime.ScriptReceivers.create(function (error, result) {\n ScriptReceivers.remove(receiver);\n request.cleanup();\n if (result && result.host) {\n sender.host = result.host;\n }\n if (callback) {\n callback(error, result);\n }\n });\n request.send(receiver);\n };\n};\nvar jsonp_timeline_jsonp = {\n name: 'jsonp',\n getAgent: getAgent\n};\n/* harmony default export */ var jsonp_timeline = (jsonp_timeline_jsonp);\n\n// CONCATENATED MODULE: ./src/core/transports/url_schemes.ts\n\nfunction getGenericURL(baseScheme, params, path) {\n var scheme = baseScheme + (params.useTLS ? 's' : '');\n var host = params.useTLS ? params.hostTLS : params.hostNonTLS;\n return scheme + '://' + host + path;\n}\nfunction getGenericPath(key, queryString) {\n var path = '/app/' + key;\n var query = '?protocol=' +\n defaults.PROTOCOL +\n '&client=js' +\n '&version=' +\n defaults.VERSION +\n (queryString ? '&' + queryString : '');\n return path + query;\n}\nvar ws = {\n getInitial: function (key, params) {\n var path = (params.httpPath || '') + getGenericPath(key, 'flash=false');\n return getGenericURL('ws', params, path);\n }\n};\nvar http = {\n getInitial: function (key, params) {\n var path = (params.httpPath || '/pusher') + getGenericPath(key);\n return getGenericURL('http', params, path);\n }\n};\nvar sockjs = {\n getInitial: function (key, params) {\n return getGenericURL('http', params, params.httpPath || '/pusher');\n },\n getPath: function (key, params) {\n return getGenericPath(key);\n }\n};\n\n// CONCATENATED MODULE: ./src/core/events/callback_registry.ts\n\nvar callback_registry_CallbackRegistry = (function () {\n function CallbackRegistry() {\n this._callbacks = {};\n }\n CallbackRegistry.prototype.get = function (name) {\n return this._callbacks[prefix(name)];\n };\n CallbackRegistry.prototype.add = function (name, callback, context) {\n var prefixedEventName = prefix(name);\n this._callbacks[prefixedEventName] =\n this._callbacks[prefixedEventName] || [];\n this._callbacks[prefixedEventName].push({\n fn: callback,\n context: context\n });\n };\n CallbackRegistry.prototype.remove = function (name, callback, context) {\n if (!name && !callback && !context) {\n this._callbacks = {};\n return;\n }\n var names = name ? [prefix(name)] : keys(this._callbacks);\n if (callback || context) {\n this.removeCallback(names, callback, context);\n }\n else {\n this.removeAllCallbacks(names);\n }\n };\n CallbackRegistry.prototype.removeCallback = function (names, callback, context) {\n apply(names, function (name) {\n this._callbacks[name] = filter(this._callbacks[name] || [], function (binding) {\n return ((callback && callback !== binding.fn) ||\n (context && context !== binding.context));\n });\n if (this._callbacks[name].length === 0) {\n delete this._callbacks[name];\n }\n }, this);\n };\n CallbackRegistry.prototype.removeAllCallbacks = function (names) {\n apply(names, function (name) {\n delete this._callbacks[name];\n }, this);\n };\n return CallbackRegistry;\n}());\n/* harmony default export */ var callback_registry = (callback_registry_CallbackRegistry);\nfunction prefix(name) {\n return '_' + name;\n}\n\n// CONCATENATED MODULE: ./src/core/events/dispatcher.ts\n\n\nvar dispatcher_Dispatcher = (function () {\n function Dispatcher(failThrough) {\n this.callbacks = new callback_registry();\n this.global_callbacks = [];\n this.failThrough = failThrough;\n }\n Dispatcher.prototype.bind = function (eventName, callback, context) {\n this.callbacks.add(eventName, callback, context);\n return this;\n };\n Dispatcher.prototype.bind_global = function (callback) {\n this.global_callbacks.push(callback);\n return this;\n };\n Dispatcher.prototype.unbind = function (eventName, callback, context) {\n this.callbacks.remove(eventName, callback, context);\n return this;\n };\n Dispatcher.prototype.unbind_global = function (callback) {\n if (!callback) {\n this.global_callbacks = [];\n return this;\n }\n this.global_callbacks = filter(this.global_callbacks || [], function (c) { return c !== callback; });\n return this;\n };\n Dispatcher.prototype.unbind_all = function () {\n this.unbind();\n this.unbind_global();\n return this;\n };\n Dispatcher.prototype.emit = function (eventName, data, metadata) {\n for (var i = 0; i < this.global_callbacks.length; i++) {\n this.global_callbacks[i](eventName, data);\n }\n var callbacks = this.callbacks.get(eventName);\n var args = [];\n if (metadata) {\n args.push(data, metadata);\n }\n else if (data) {\n args.push(data);\n }\n if (callbacks && callbacks.length > 0) {\n for (var i = 0; i < callbacks.length; i++) {\n callbacks[i].fn.apply(callbacks[i].context || window, args);\n }\n }\n else if (this.failThrough) {\n this.failThrough(eventName, data);\n }\n return this;\n };\n return Dispatcher;\n}());\n/* harmony default export */ var dispatcher = (dispatcher_Dispatcher);\n\n// CONCATENATED MODULE: ./src/core/transports/transport_connection.ts\nvar transport_connection_extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n\n\n\nvar transport_connection_TransportConnection = (function (_super) {\n transport_connection_extends(TransportConnection, _super);\n function TransportConnection(hooks, name, priority, key, options) {\n var _this = _super.call(this) || this;\n _this.initialize = runtime.transportConnectionInitializer;\n _this.hooks = hooks;\n _this.name = name;\n _this.priority = priority;\n _this.key = key;\n _this.options = options;\n _this.state = 'new';\n _this.timeline = options.timeline;\n _this.activityTimeout = options.activityTimeout;\n _this.id = _this.timeline.generateUniqueID();\n return _this;\n }\n TransportConnection.prototype.handlesActivityChecks = function () {\n return Boolean(this.hooks.handlesActivityChecks);\n };\n TransportConnection.prototype.supportsPing = function () {\n return Boolean(this.hooks.supportsPing);\n };\n TransportConnection.prototype.connect = function () {\n var _this = this;\n if (this.socket || this.state !== 'initialized') {\n return false;\n }\n var url = this.hooks.urls.getInitial(this.key, this.options);\n try {\n this.socket = this.hooks.getSocket(url, this.options);\n }\n catch (e) {\n util.defer(function () {\n _this.onError(e);\n _this.changeState('closed');\n });\n return false;\n }\n this.bindListeners();\n logger.debug('Connecting', { transport: this.name, url: url });\n this.changeState('connecting');\n return true;\n };\n TransportConnection.prototype.close = function () {\n if (this.socket) {\n this.socket.close();\n return true;\n }\n else {\n return false;\n }\n };\n TransportConnection.prototype.send = function (data) {\n var _this = this;\n if (this.state === 'open') {\n util.defer(function () {\n if (_this.socket) {\n _this.socket.send(data);\n }\n });\n return true;\n }\n else {\n return false;\n }\n };\n TransportConnection.prototype.ping = function () {\n if (this.state === 'open' && this.supportsPing()) {\n this.socket.ping();\n }\n };\n TransportConnection.prototype.onOpen = function () {\n if (this.hooks.beforeOpen) {\n this.hooks.beforeOpen(this.socket, this.hooks.urls.getPath(this.key, this.options));\n }\n this.changeState('open');\n this.socket.onopen = undefined;\n };\n TransportConnection.prototype.onError = function (error) {\n this.emit('error', { type: 'WebSocketError', error: error });\n this.timeline.error(this.buildTimelineMessage({ error: error.toString() }));\n };\n TransportConnection.prototype.onClose = function (closeEvent) {\n if (closeEvent) {\n this.changeState('closed', {\n code: closeEvent.code,\n reason: closeEvent.reason,\n wasClean: closeEvent.wasClean\n });\n }\n else {\n this.changeState('closed');\n }\n this.unbindListeners();\n this.socket = undefined;\n };\n TransportConnection.prototype.onMessage = function (message) {\n this.emit('message', message);\n };\n TransportConnection.prototype.onActivity = function () {\n this.emit('activity');\n };\n TransportConnection.prototype.bindListeners = function () {\n var _this = this;\n this.socket.onopen = function () {\n _this.onOpen();\n };\n this.socket.onerror = function (error) {\n _this.onError(error);\n };\n this.socket.onclose = function (closeEvent) {\n _this.onClose(closeEvent);\n };\n this.socket.onmessage = function (message) {\n _this.onMessage(message);\n };\n if (this.supportsPing()) {\n this.socket.onactivity = function () {\n _this.onActivity();\n };\n }\n };\n TransportConnection.prototype.unbindListeners = function () {\n if (this.socket) {\n this.socket.onopen = undefined;\n this.socket.onerror = undefined;\n this.socket.onclose = undefined;\n this.socket.onmessage = undefined;\n if (this.supportsPing()) {\n this.socket.onactivity = undefined;\n }\n }\n };\n TransportConnection.prototype.changeState = function (state, params) {\n this.state = state;\n this.timeline.info(this.buildTimelineMessage({\n state: state,\n params: params\n }));\n this.emit(state, params);\n };\n TransportConnection.prototype.buildTimelineMessage = function (message) {\n return extend({ cid: this.id }, message);\n };\n return TransportConnection;\n}(dispatcher));\n/* harmony default export */ var transport_connection = (transport_connection_TransportConnection);\n\n// CONCATENATED MODULE: ./src/core/transports/transport.ts\n\nvar transport_Transport = (function () {\n function Transport(hooks) {\n this.hooks = hooks;\n }\n Transport.prototype.isSupported = function (environment) {\n return this.hooks.isSupported(environment);\n };\n Transport.prototype.createConnection = function (name, priority, key, options) {\n return new transport_connection(this.hooks, name, priority, key, options);\n };\n return Transport;\n}());\n/* harmony default export */ var transports_transport = (transport_Transport);\n\n// CONCATENATED MODULE: ./src/runtimes/isomorphic/transports/transports.ts\n\n\n\n\nvar WSTransport = new transports_transport({\n urls: ws,\n handlesActivityChecks: false,\n supportsPing: false,\n isInitialized: function () {\n return Boolean(runtime.getWebSocketAPI());\n },\n isSupported: function () {\n return Boolean(runtime.getWebSocketAPI());\n },\n getSocket: function (url) {\n return runtime.createWebSocket(url);\n }\n});\nvar httpConfiguration = {\n urls: http,\n handlesActivityChecks: false,\n supportsPing: true,\n isInitialized: function () {\n return true;\n }\n};\nvar streamingConfiguration = extend({\n getSocket: function (url) {\n return runtime.HTTPFactory.createStreamingSocket(url);\n }\n}, httpConfiguration);\nvar pollingConfiguration = extend({\n getSocket: function (url) {\n return runtime.HTTPFactory.createPollingSocket(url);\n }\n}, httpConfiguration);\nvar xhrConfiguration = {\n isSupported: function () {\n return runtime.isXHRSupported();\n }\n};\nvar XHRStreamingTransport = new transports_transport((extend({}, streamingConfiguration, xhrConfiguration)));\nvar XHRPollingTransport = new transports_transport(extend({}, pollingConfiguration, xhrConfiguration));\nvar Transports = {\n ws: WSTransport,\n xhr_streaming: XHRStreamingTransport,\n xhr_polling: XHRPollingTransport\n};\n/* harmony default export */ var transports = (Transports);\n\n// CONCATENATED MODULE: ./src/runtimes/web/transports/transports.ts\n\n\n\n\n\n\nvar SockJSTransport = new transports_transport({\n file: 'sockjs',\n urls: sockjs,\n handlesActivityChecks: true,\n supportsPing: false,\n isSupported: function () {\n return true;\n },\n isInitialized: function () {\n return window.SockJS !== undefined;\n },\n getSocket: function (url, options) {\n return new window.SockJS(url, null, {\n js_path: Dependencies.getPath('sockjs', {\n useTLS: options.useTLS\n }),\n ignore_null_origin: options.ignoreNullOrigin\n });\n },\n beforeOpen: function (socket, path) {\n socket.send(JSON.stringify({\n path: path\n }));\n }\n});\nvar xdrConfiguration = {\n isSupported: function (environment) {\n var yes = runtime.isXDRSupported(environment.useTLS);\n return yes;\n }\n};\nvar XDRStreamingTransport = new transports_transport((extend({}, streamingConfiguration, xdrConfiguration)));\nvar XDRPollingTransport = new transports_transport(extend({}, pollingConfiguration, xdrConfiguration));\ntransports.xdr_streaming = XDRStreamingTransport;\ntransports.xdr_polling = XDRPollingTransport;\ntransports.sockjs = SockJSTransport;\n/* harmony default export */ var transports_transports = (transports);\n\n// CONCATENATED MODULE: ./src/runtimes/web/net_info.ts\nvar net_info_extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\nvar NetInfo = (function (_super) {\n net_info_extends(NetInfo, _super);\n function NetInfo() {\n var _this = _super.call(this) || this;\n var self = _this;\n if (window.addEventListener !== undefined) {\n window.addEventListener('online', function () {\n self.emit('online');\n }, false);\n window.addEventListener('offline', function () {\n self.emit('offline');\n }, false);\n }\n return _this;\n }\n NetInfo.prototype.isOnline = function () {\n if (window.navigator.onLine === undefined) {\n return true;\n }\n else {\n return window.navigator.onLine;\n }\n };\n return NetInfo;\n}(dispatcher));\n\nvar net_info_Network = new NetInfo();\n\n// CONCATENATED MODULE: ./src/core/transports/assistant_to_the_transport_manager.ts\n\n\nvar assistant_to_the_transport_manager_AssistantToTheTransportManager = (function () {\n function AssistantToTheTransportManager(manager, transport, options) {\n this.manager = manager;\n this.transport = transport;\n this.minPingDelay = options.minPingDelay;\n this.maxPingDelay = options.maxPingDelay;\n this.pingDelay = undefined;\n }\n AssistantToTheTransportManager.prototype.createConnection = function (name, priority, key, options) {\n var _this = this;\n options = extend({}, options, {\n activityTimeout: this.pingDelay\n });\n var connection = this.transport.createConnection(name, priority, key, options);\n var openTimestamp = null;\n var onOpen = function () {\n connection.unbind('open', onOpen);\n connection.bind('closed', onClosed);\n openTimestamp = util.now();\n };\n var onClosed = function (closeEvent) {\n connection.unbind('closed', onClosed);\n if (closeEvent.code === 1002 || closeEvent.code === 1003) {\n _this.manager.reportDeath();\n }\n else if (!closeEvent.wasClean && openTimestamp) {\n var lifespan = util.now() - openTimestamp;\n if (lifespan < 2 * _this.maxPingDelay) {\n _this.manager.reportDeath();\n _this.pingDelay = Math.max(lifespan / 2, _this.minPingDelay);\n }\n }\n };\n connection.bind('open', onOpen);\n return connection;\n };\n AssistantToTheTransportManager.prototype.isSupported = function (environment) {\n return this.manager.isAlive() && this.transport.isSupported(environment);\n };\n return AssistantToTheTransportManager;\n}());\n/* harmony default export */ var assistant_to_the_transport_manager = (assistant_to_the_transport_manager_AssistantToTheTransportManager);\n\n// CONCATENATED MODULE: ./src/core/connection/protocol/protocol.ts\nvar Protocol = {\n decodeMessage: function (messageEvent) {\n try {\n var messageData = JSON.parse(messageEvent.data);\n var pusherEventData = messageData.data;\n if (typeof pusherEventData === 'string') {\n try {\n pusherEventData = JSON.parse(messageData.data);\n }\n catch (e) { }\n }\n var pusherEvent = {\n event: messageData.event,\n channel: messageData.channel,\n data: pusherEventData\n };\n if (messageData.user_id) {\n pusherEvent.user_id = messageData.user_id;\n }\n return pusherEvent;\n }\n catch (e) {\n throw { type: 'MessageParseError', error: e, data: messageEvent.data };\n }\n },\n encodeMessage: function (event) {\n return JSON.stringify(event);\n },\n processHandshake: function (messageEvent) {\n var message = Protocol.decodeMessage(messageEvent);\n if (message.event === 'pusher:connection_established') {\n if (!message.data.activity_timeout) {\n throw 'No activity timeout specified in handshake';\n }\n return {\n action: 'connected',\n id: message.data.socket_id,\n activityTimeout: message.data.activity_timeout * 1000\n };\n }\n else if (message.event === 'pusher:error') {\n return {\n action: this.getCloseAction(message.data),\n error: this.getCloseError(message.data)\n };\n }\n else {\n throw 'Invalid handshake';\n }\n },\n getCloseAction: function (closeEvent) {\n if (closeEvent.code < 4000) {\n if (closeEvent.code >= 1002 && closeEvent.code <= 1004) {\n return 'backoff';\n }\n else {\n return null;\n }\n }\n else if (closeEvent.code === 4000) {\n return 'tls_only';\n }\n else if (closeEvent.code < 4100) {\n return 'refused';\n }\n else if (closeEvent.code < 4200) {\n return 'backoff';\n }\n else if (closeEvent.code < 4300) {\n return 'retry';\n }\n else {\n return 'refused';\n }\n },\n getCloseError: function (closeEvent) {\n if (closeEvent.code !== 1000 && closeEvent.code !== 1001) {\n return {\n type: 'PusherError',\n data: {\n code: closeEvent.code,\n message: closeEvent.reason || closeEvent.message\n }\n };\n }\n else {\n return null;\n }\n }\n};\n/* harmony default export */ var protocol_protocol = (Protocol);\n\n// CONCATENATED MODULE: ./src/core/connection/connection.ts\nvar connection_extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n\n\nvar connection_Connection = (function (_super) {\n connection_extends(Connection, _super);\n function Connection(id, transport) {\n var _this = _super.call(this) || this;\n _this.id = id;\n _this.transport = transport;\n _this.activityTimeout = transport.activityTimeout;\n _this.bindListeners();\n return _this;\n }\n Connection.prototype.handlesActivityChecks = function () {\n return this.transport.handlesActivityChecks();\n };\n Connection.prototype.send = function (data) {\n return this.transport.send(data);\n };\n Connection.prototype.send_event = function (name, data, channel) {\n var event = { event: name, data: data };\n if (channel) {\n event.channel = channel;\n }\n logger.debug('Event sent', event);\n return this.send(protocol_protocol.encodeMessage(event));\n };\n Connection.prototype.ping = function () {\n if (this.transport.supportsPing()) {\n this.transport.ping();\n }\n else {\n this.send_event('pusher:ping', {});\n }\n };\n Connection.prototype.close = function () {\n this.transport.close();\n };\n Connection.prototype.bindListeners = function () {\n var _this = this;\n var listeners = {\n message: function (messageEvent) {\n var pusherEvent;\n try {\n pusherEvent = protocol_protocol.decodeMessage(messageEvent);\n }\n catch (e) {\n _this.emit('error', {\n type: 'MessageParseError',\n error: e,\n data: messageEvent.data\n });\n }\n if (pusherEvent !== undefined) {\n logger.debug('Event recd', pusherEvent);\n switch (pusherEvent.event) {\n case 'pusher:error':\n _this.emit('error', {\n type: 'PusherError',\n data: pusherEvent.data\n });\n break;\n case 'pusher:ping':\n _this.emit('ping');\n break;\n case 'pusher:pong':\n _this.emit('pong');\n break;\n }\n _this.emit('message', pusherEvent);\n }\n },\n activity: function () {\n _this.emit('activity');\n },\n error: function (error) {\n _this.emit('error', error);\n },\n closed: function (closeEvent) {\n unbindListeners();\n if (closeEvent && closeEvent.code) {\n _this.handleCloseEvent(closeEvent);\n }\n _this.transport = null;\n _this.emit('closed');\n }\n };\n var unbindListeners = function () {\n objectApply(listeners, function (listener, event) {\n _this.transport.unbind(event, listener);\n });\n };\n objectApply(listeners, function (listener, event) {\n _this.transport.bind(event, listener);\n });\n };\n Connection.prototype.handleCloseEvent = function (closeEvent) {\n var action = protocol_protocol.getCloseAction(closeEvent);\n var error = protocol_protocol.getCloseError(closeEvent);\n if (error) {\n this.emit('error', error);\n }\n if (action) {\n this.emit(action, { action: action, error: error });\n }\n };\n return Connection;\n}(dispatcher));\n/* harmony default export */ var connection_connection = (connection_Connection);\n\n// CONCATENATED MODULE: ./src/core/connection/handshake/index.ts\n\n\n\nvar handshake_Handshake = (function () {\n function Handshake(transport, callback) {\n this.transport = transport;\n this.callback = callback;\n this.bindListeners();\n }\n Handshake.prototype.close = function () {\n this.unbindListeners();\n this.transport.close();\n };\n Handshake.prototype.bindListeners = function () {\n var _this = this;\n this.onMessage = function (m) {\n _this.unbindListeners();\n var result;\n try {\n result = protocol_protocol.processHandshake(m);\n }\n catch (e) {\n _this.finish('error', { error: e });\n _this.transport.close();\n return;\n }\n if (result.action === 'connected') {\n _this.finish('connected', {\n connection: new connection_connection(result.id, _this.transport),\n activityTimeout: result.activityTimeout\n });\n }\n else {\n _this.finish(result.action, { error: result.error });\n _this.transport.close();\n }\n };\n this.onClosed = function (closeEvent) {\n _this.unbindListeners();\n var action = protocol_protocol.getCloseAction(closeEvent) || 'backoff';\n var error = protocol_protocol.getCloseError(closeEvent);\n _this.finish(action, { error: error });\n };\n this.transport.bind('message', this.onMessage);\n this.transport.bind('closed', this.onClosed);\n };\n Handshake.prototype.unbindListeners = function () {\n this.transport.unbind('message', this.onMessage);\n this.transport.unbind('closed', this.onClosed);\n };\n Handshake.prototype.finish = function (action, params) {\n this.callback(extend({ transport: this.transport, action: action }, params));\n };\n return Handshake;\n}());\n/* harmony default export */ var connection_handshake = (handshake_Handshake);\n\n// CONCATENATED MODULE: ./src/core/auth/pusher_authorizer.ts\n\nvar pusher_authorizer_PusherAuthorizer = (function () {\n function PusherAuthorizer(channel, options) {\n this.channel = channel;\n var authTransport = options.authTransport;\n if (typeof runtime.getAuthorizers()[authTransport] === 'undefined') {\n throw \"'\" + authTransport + \"' is not a recognized auth transport\";\n }\n this.type = authTransport;\n this.options = options;\n this.authOptions = options.auth || {};\n }\n PusherAuthorizer.prototype.composeQuery = function (socketId) {\n var query = 'socket_id=' +\n encodeURIComponent(socketId) +\n '&channel_name=' +\n encodeURIComponent(this.channel.name);\n for (var i in this.authOptions.params) {\n query +=\n '&' +\n encodeURIComponent(i) +\n '=' +\n encodeURIComponent(this.authOptions.params[i]);\n }\n return query;\n };\n PusherAuthorizer.prototype.authorize = function (socketId, callback) {\n PusherAuthorizer.authorizers =\n PusherAuthorizer.authorizers || runtime.getAuthorizers();\n PusherAuthorizer.authorizers[this.type].call(this, runtime, socketId, callback);\n };\n return PusherAuthorizer;\n}());\n/* harmony default export */ var pusher_authorizer = (pusher_authorizer_PusherAuthorizer);\n\n// CONCATENATED MODULE: ./src/core/timeline/timeline_sender.ts\n\nvar timeline_sender_TimelineSender = (function () {\n function TimelineSender(timeline, options) {\n this.timeline = timeline;\n this.options = options || {};\n }\n TimelineSender.prototype.send = function (useTLS, callback) {\n if (this.timeline.isEmpty()) {\n return;\n }\n this.timeline.send(runtime.TimelineTransport.getAgent(this, useTLS), callback);\n };\n return TimelineSender;\n}());\n/* harmony default export */ var timeline_sender = (timeline_sender_TimelineSender);\n\n// CONCATENATED MODULE: ./src/core/channels/channel.ts\nvar channel_extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n\n\n\nvar channel_Channel = (function (_super) {\n channel_extends(Channel, _super);\n function Channel(name, pusher) {\n var _this = _super.call(this, function (event, data) {\n logger.debug('No callbacks on ' + name + ' for ' + event);\n }) || this;\n _this.name = name;\n _this.pusher = pusher;\n _this.subscribed = false;\n _this.subscriptionPending = false;\n _this.subscriptionCancelled = false;\n return _this;\n }\n Channel.prototype.authorize = function (socketId, callback) {\n return callback(null, { auth: '' });\n };\n Channel.prototype.trigger = function (event, data) {\n if (event.indexOf('client-') !== 0) {\n throw new BadEventName(\"Event '\" + event + \"' does not start with 'client-'\");\n }\n if (!this.subscribed) {\n var suffix = url_store.buildLogSuffix('triggeringClientEvents');\n logger.warn(\"Client event triggered before channel 'subscription_succeeded' event . \" + suffix);\n }\n return this.pusher.send_event(event, data, this.name);\n };\n Channel.prototype.disconnect = function () {\n this.subscribed = false;\n this.subscriptionPending = false;\n };\n Channel.prototype.handleEvent = function (event) {\n var eventName = event.event;\n var data = event.data;\n if (eventName === 'pusher_internal:subscription_succeeded') {\n this.handleSubscriptionSucceededEvent(event);\n }\n else if (eventName.indexOf('pusher_internal:') !== 0) {\n var metadata = {};\n this.emit(eventName, data, metadata);\n }\n };\n Channel.prototype.handleSubscriptionSucceededEvent = function (event) {\n this.subscriptionPending = false;\n this.subscribed = true;\n if (this.subscriptionCancelled) {\n this.pusher.unsubscribe(this.name);\n }\n else {\n this.emit('pusher:subscription_succeeded', event.data);\n }\n };\n Channel.prototype.subscribe = function () {\n var _this = this;\n if (this.subscribed) {\n return;\n }\n this.subscriptionPending = true;\n this.subscriptionCancelled = false;\n this.authorize(this.pusher.connection.socket_id, function (error, data) {\n if (error) {\n _this.subscriptionPending = false;\n logger.error(error.toString());\n _this.emit('pusher:subscription_error', Object.assign({}, {\n type: 'AuthError',\n error: error.message\n }, error instanceof HTTPAuthError ? { status: error.status } : {}));\n }\n else {\n _this.pusher.send_event('pusher:subscribe', {\n auth: data.auth,\n channel_data: data.channel_data,\n channel: _this.name\n });\n }\n });\n };\n Channel.prototype.unsubscribe = function () {\n this.subscribed = false;\n this.pusher.send_event('pusher:unsubscribe', {\n channel: this.name\n });\n };\n Channel.prototype.cancelSubscription = function () {\n this.subscriptionCancelled = true;\n };\n Channel.prototype.reinstateSubscription = function () {\n this.subscriptionCancelled = false;\n };\n return Channel;\n}(dispatcher));\n/* harmony default export */ var channels_channel = (channel_Channel);\n\n// CONCATENATED MODULE: ./src/core/channels/private_channel.ts\nvar private_channel_extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\nvar private_channel_PrivateChannel = (function (_super) {\n private_channel_extends(PrivateChannel, _super);\n function PrivateChannel() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PrivateChannel.prototype.authorize = function (socketId, callback) {\n var authorizer = factory.createAuthorizer(this, this.pusher.config);\n return authorizer.authorize(socketId, callback);\n };\n return PrivateChannel;\n}(channels_channel));\n/* harmony default export */ var private_channel = (private_channel_PrivateChannel);\n\n// CONCATENATED MODULE: ./src/core/channels/members.ts\n\nvar members_Members = (function () {\n function Members() {\n this.reset();\n }\n Members.prototype.get = function (id) {\n if (Object.prototype.hasOwnProperty.call(this.members, id)) {\n return {\n id: id,\n info: this.members[id]\n };\n }\n else {\n return null;\n }\n };\n Members.prototype.each = function (callback) {\n var _this = this;\n objectApply(this.members, function (member, id) {\n callback(_this.get(id));\n });\n };\n Members.prototype.setMyID = function (id) {\n this.myID = id;\n };\n Members.prototype.onSubscription = function (subscriptionData) {\n this.members = subscriptionData.presence.hash;\n this.count = subscriptionData.presence.count;\n this.me = this.get(this.myID);\n };\n Members.prototype.addMember = function (memberData) {\n if (this.get(memberData.user_id) === null) {\n this.count++;\n }\n this.members[memberData.user_id] = memberData.user_info;\n return this.get(memberData.user_id);\n };\n Members.prototype.removeMember = function (memberData) {\n var member = this.get(memberData.user_id);\n if (member) {\n delete this.members[memberData.user_id];\n this.count--;\n }\n return member;\n };\n Members.prototype.reset = function () {\n this.members = {};\n this.count = 0;\n this.myID = null;\n this.me = null;\n };\n return Members;\n}());\n/* harmony default export */ var members = (members_Members);\n\n// CONCATENATED MODULE: ./src/core/channels/presence_channel.ts\nvar presence_channel_extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n\n\nvar presence_channel_PresenceChannel = (function (_super) {\n presence_channel_extends(PresenceChannel, _super);\n function PresenceChannel(name, pusher) {\n var _this = _super.call(this, name, pusher) || this;\n _this.members = new members();\n return _this;\n }\n PresenceChannel.prototype.authorize = function (socketId, callback) {\n var _this = this;\n _super.prototype.authorize.call(this, socketId, function (error, authData) {\n if (!error) {\n authData = authData;\n if (authData.channel_data === undefined) {\n var suffix = url_store.buildLogSuffix('authenticationEndpoint');\n logger.error(\"Invalid auth response for channel '\" + _this.name + \"',\" +\n (\"expected 'channel_data' field. \" + suffix));\n callback('Invalid auth response');\n return;\n }\n var channelData = JSON.parse(authData.channel_data);\n _this.members.setMyID(channelData.user_id);\n }\n callback(error, authData);\n });\n };\n PresenceChannel.prototype.handleEvent = function (event) {\n var eventName = event.event;\n if (eventName.indexOf('pusher_internal:') === 0) {\n this.handleInternalEvent(event);\n }\n else {\n var data = event.data;\n var metadata = {};\n if (event.user_id) {\n metadata.user_id = event.user_id;\n }\n this.emit(eventName, data, metadata);\n }\n };\n PresenceChannel.prototype.handleInternalEvent = function (event) {\n var eventName = event.event;\n var data = event.data;\n switch (eventName) {\n case 'pusher_internal:subscription_succeeded':\n this.handleSubscriptionSucceededEvent(event);\n break;\n case 'pusher_internal:member_added':\n var addedMember = this.members.addMember(data);\n this.emit('pusher:member_added', addedMember);\n break;\n case 'pusher_internal:member_removed':\n var removedMember = this.members.removeMember(data);\n if (removedMember) {\n this.emit('pusher:member_removed', removedMember);\n }\n break;\n }\n };\n PresenceChannel.prototype.handleSubscriptionSucceededEvent = function (event) {\n this.subscriptionPending = false;\n this.subscribed = true;\n if (this.subscriptionCancelled) {\n this.pusher.unsubscribe(this.name);\n }\n else {\n this.members.onSubscription(event.data);\n this.emit('pusher:subscription_succeeded', this.members);\n }\n };\n PresenceChannel.prototype.disconnect = function () {\n this.members.reset();\n _super.prototype.disconnect.call(this);\n };\n return PresenceChannel;\n}(private_channel));\n/* harmony default export */ var presence_channel = (presence_channel_PresenceChannel);\n\n// EXTERNAL MODULE: ./node_modules/@stablelib/utf8/lib/utf8.js\nvar utf8 = __webpack_require__(1);\n\n// EXTERNAL MODULE: ./node_modules/@stablelib/base64/lib/base64.js\nvar base64 = __webpack_require__(0);\n\n// CONCATENATED MODULE: ./src/core/channels/encrypted_channel.ts\nvar encrypted_channel_extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n\n\n\nvar encrypted_channel_EncryptedChannel = (function (_super) {\n encrypted_channel_extends(EncryptedChannel, _super);\n function EncryptedChannel(name, pusher, nacl) {\n var _this = _super.call(this, name, pusher) || this;\n _this.key = null;\n _this.nacl = nacl;\n return _this;\n }\n EncryptedChannel.prototype.authorize = function (socketId, callback) {\n var _this = this;\n _super.prototype.authorize.call(this, socketId, function (error, authData) {\n if (error) {\n callback(error, authData);\n return;\n }\n var sharedSecret = authData['shared_secret'];\n if (!sharedSecret) {\n callback(new Error(\"No shared_secret key in auth payload for encrypted channel: \" + _this.name), null);\n return;\n }\n _this.key = Object(base64[\"decode\"])(sharedSecret);\n delete authData['shared_secret'];\n callback(null, authData);\n });\n };\n EncryptedChannel.prototype.trigger = function (event, data) {\n throw new UnsupportedFeature('Client events are not currently supported for encrypted channels');\n };\n EncryptedChannel.prototype.handleEvent = function (event) {\n var eventName = event.event;\n var data = event.data;\n if (eventName.indexOf('pusher_internal:') === 0 ||\n eventName.indexOf('pusher:') === 0) {\n _super.prototype.handleEvent.call(this, event);\n return;\n }\n this.handleEncryptedEvent(eventName, data);\n };\n EncryptedChannel.prototype.handleEncryptedEvent = function (event, data) {\n var _this = this;\n if (!this.key) {\n logger.debug('Received encrypted event before key has been retrieved from the authEndpoint');\n return;\n }\n if (!data.ciphertext || !data.nonce) {\n logger.error('Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: ' +\n data);\n return;\n }\n var cipherText = Object(base64[\"decode\"])(data.ciphertext);\n if (cipherText.length < this.nacl.secretbox.overheadLength) {\n logger.error(\"Expected encrypted event ciphertext length to be \" + this.nacl.secretbox.overheadLength + \", got: \" + cipherText.length);\n return;\n }\n var nonce = Object(base64[\"decode\"])(data.nonce);\n if (nonce.length < this.nacl.secretbox.nonceLength) {\n logger.error(\"Expected encrypted event nonce length to be \" + this.nacl.secretbox.nonceLength + \", got: \" + nonce.length);\n return;\n }\n var bytes = this.nacl.secretbox.open(cipherText, nonce, this.key);\n if (bytes === null) {\n logger.debug('Failed to decrypt an event, probably because it was encrypted with a different key. Fetching a new key from the authEndpoint...');\n this.authorize(this.pusher.connection.socket_id, function (error, authData) {\n if (error) {\n logger.error(\"Failed to make a request to the authEndpoint: \" + authData + \". Unable to fetch new key, so dropping encrypted event\");\n return;\n }\n bytes = _this.nacl.secretbox.open(cipherText, nonce, _this.key);\n if (bytes === null) {\n logger.error(\"Failed to decrypt event with new key. Dropping encrypted event\");\n return;\n }\n _this.emit(event, _this.getDataToEmit(bytes));\n return;\n });\n return;\n }\n this.emit(event, this.getDataToEmit(bytes));\n };\n EncryptedChannel.prototype.getDataToEmit = function (bytes) {\n var raw = Object(utf8[\"decode\"])(bytes);\n try {\n return JSON.parse(raw);\n }\n catch (_a) {\n return raw;\n }\n };\n return EncryptedChannel;\n}(private_channel));\n/* harmony default export */ var encrypted_channel = (encrypted_channel_EncryptedChannel);\n\n// CONCATENATED MODULE: ./src/core/connection/connection_manager.ts\nvar connection_manager_extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n\n\n\nvar connection_manager_ConnectionManager = (function (_super) {\n connection_manager_extends(ConnectionManager, _super);\n function ConnectionManager(key, options) {\n var _this = _super.call(this) || this;\n _this.state = 'initialized';\n _this.connection = null;\n _this.key = key;\n _this.options = options;\n _this.timeline = _this.options.timeline;\n _this.usingTLS = _this.options.useTLS;\n _this.errorCallbacks = _this.buildErrorCallbacks();\n _this.connectionCallbacks = _this.buildConnectionCallbacks(_this.errorCallbacks);\n _this.handshakeCallbacks = _this.buildHandshakeCallbacks(_this.errorCallbacks);\n var Network = runtime.getNetwork();\n Network.bind('online', function () {\n _this.timeline.info({ netinfo: 'online' });\n if (_this.state === 'connecting' || _this.state === 'unavailable') {\n _this.retryIn(0);\n }\n });\n Network.bind('offline', function () {\n _this.timeline.info({ netinfo: 'offline' });\n if (_this.connection) {\n _this.sendActivityCheck();\n }\n });\n _this.updateStrategy();\n return _this;\n }\n ConnectionManager.prototype.connect = function () {\n if (this.connection || this.runner) {\n return;\n }\n if (!this.strategy.isSupported()) {\n this.updateState('failed');\n return;\n }\n this.updateState('connecting');\n this.startConnecting();\n this.setUnavailableTimer();\n };\n ConnectionManager.prototype.send = function (data) {\n if (this.connection) {\n return this.connection.send(data);\n }\n else {\n return false;\n }\n };\n ConnectionManager.prototype.send_event = function (name, data, channel) {\n if (this.connection) {\n return this.connection.send_event(name, data, channel);\n }\n else {\n return false;\n }\n };\n ConnectionManager.prototype.disconnect = function () {\n this.disconnectInternally();\n this.updateState('disconnected');\n };\n ConnectionManager.prototype.isUsingTLS = function () {\n return this.usingTLS;\n };\n ConnectionManager.prototype.startConnecting = function () {\n var _this = this;\n var callback = function (error, handshake) {\n if (error) {\n _this.runner = _this.strategy.connect(0, callback);\n }\n else {\n if (handshake.action === 'error') {\n _this.emit('error', {\n type: 'HandshakeError',\n error: handshake.error\n });\n _this.timeline.error({ handshakeError: handshake.error });\n }\n else {\n _this.abortConnecting();\n _this.handshakeCallbacks[handshake.action](handshake);\n }\n }\n };\n this.runner = this.strategy.connect(0, callback);\n };\n ConnectionManager.prototype.abortConnecting = function () {\n if (this.runner) {\n this.runner.abort();\n this.runner = null;\n }\n };\n ConnectionManager.prototype.disconnectInternally = function () {\n this.abortConnecting();\n this.clearRetryTimer();\n this.clearUnavailableTimer();\n if (this.connection) {\n var connection = this.abandonConnection();\n connection.close();\n }\n };\n ConnectionManager.prototype.updateStrategy = function () {\n this.strategy = this.options.getStrategy({\n key: this.key,\n timeline: this.timeline,\n useTLS: this.usingTLS\n });\n };\n ConnectionManager.prototype.retryIn = function (delay) {\n var _this = this;\n this.timeline.info({ action: 'retry', delay: delay });\n if (delay > 0) {\n this.emit('connecting_in', Math.round(delay / 1000));\n }\n this.retryTimer = new OneOffTimer(delay || 0, function () {\n _this.disconnectInternally();\n _this.connect();\n });\n };\n ConnectionManager.prototype.clearRetryTimer = function () {\n if (this.retryTimer) {\n this.retryTimer.ensureAborted();\n this.retryTimer = null;\n }\n };\n ConnectionManager.prototype.setUnavailableTimer = function () {\n var _this = this;\n this.unavailableTimer = new OneOffTimer(this.options.unavailableTimeout, function () {\n _this.updateState('unavailable');\n });\n };\n ConnectionManager.prototype.clearUnavailableTimer = function () {\n if (this.unavailableTimer) {\n this.unavailableTimer.ensureAborted();\n }\n };\n ConnectionManager.prototype.sendActivityCheck = function () {\n var _this = this;\n this.stopActivityCheck();\n this.connection.ping();\n this.activityTimer = new OneOffTimer(this.options.pongTimeout, function () {\n _this.timeline.error({ pong_timed_out: _this.options.pongTimeout });\n _this.retryIn(0);\n });\n };\n ConnectionManager.prototype.resetActivityCheck = function () {\n var _this = this;\n this.stopActivityCheck();\n if (this.connection && !this.connection.handlesActivityChecks()) {\n this.activityTimer = new OneOffTimer(this.activityTimeout, function () {\n _this.sendActivityCheck();\n });\n }\n };\n ConnectionManager.prototype.stopActivityCheck = function () {\n if (this.activityTimer) {\n this.activityTimer.ensureAborted();\n }\n };\n ConnectionManager.prototype.buildConnectionCallbacks = function (errorCallbacks) {\n var _this = this;\n return extend({}, errorCallbacks, {\n message: function (message) {\n _this.resetActivityCheck();\n _this.emit('message', message);\n },\n ping: function () {\n _this.send_event('pusher:pong', {});\n },\n activity: function () {\n _this.resetActivityCheck();\n },\n error: function (error) {\n _this.emit('error', error);\n },\n closed: function () {\n _this.abandonConnection();\n if (_this.shouldRetry()) {\n _this.retryIn(1000);\n }\n }\n });\n };\n ConnectionManager.prototype.buildHandshakeCallbacks = function (errorCallbacks) {\n var _this = this;\n return extend({}, errorCallbacks, {\n connected: function (handshake) {\n _this.activityTimeout = Math.min(_this.options.activityTimeout, handshake.activityTimeout, handshake.connection.activityTimeout || Infinity);\n _this.clearUnavailableTimer();\n _this.setConnection(handshake.connection);\n _this.socket_id = _this.connection.id;\n _this.updateState('connected', { socket_id: _this.socket_id });\n }\n });\n };\n ConnectionManager.prototype.buildErrorCallbacks = function () {\n var _this = this;\n var withErrorEmitted = function (callback) {\n return function (result) {\n if (result.error) {\n _this.emit('error', { type: 'WebSocketError', error: result.error });\n }\n callback(result);\n };\n };\n return {\n tls_only: withErrorEmitted(function () {\n _this.usingTLS = true;\n _this.updateStrategy();\n _this.retryIn(0);\n }),\n refused: withErrorEmitted(function () {\n _this.disconnect();\n }),\n backoff: withErrorEmitted(function () {\n _this.retryIn(1000);\n }),\n retry: withErrorEmitted(function () {\n _this.retryIn(0);\n })\n };\n };\n ConnectionManager.prototype.setConnection = function (connection) {\n this.connection = connection;\n for (var event in this.connectionCallbacks) {\n this.connection.bind(event, this.connectionCallbacks[event]);\n }\n this.resetActivityCheck();\n };\n ConnectionManager.prototype.abandonConnection = function () {\n if (!this.connection) {\n return;\n }\n this.stopActivityCheck();\n for (var event in this.connectionCallbacks) {\n this.connection.unbind(event, this.connectionCallbacks[event]);\n }\n var connection = this.connection;\n this.connection = null;\n return connection;\n };\n ConnectionManager.prototype.updateState = function (newState, data) {\n var previousState = this.state;\n this.state = newState;\n if (previousState !== newState) {\n var newStateDescription = newState;\n if (newStateDescription === 'connected') {\n newStateDescription += ' with new socket ID ' + data.socket_id;\n }\n logger.debug('State changed', previousState + ' -> ' + newStateDescription);\n this.timeline.info({ state: newState, params: data });\n this.emit('state_change', { previous: previousState, current: newState });\n this.emit(newState, data);\n }\n };\n ConnectionManager.prototype.shouldRetry = function () {\n return this.state === 'connecting' || this.state === 'connected';\n };\n return ConnectionManager;\n}(dispatcher));\n/* harmony default export */ var connection_manager = (connection_manager_ConnectionManager);\n\n// CONCATENATED MODULE: ./src/core/channels/channels.ts\n\n\n\n\nvar channels_Channels = (function () {\n function Channels() {\n this.channels = {};\n }\n Channels.prototype.add = function (name, pusher) {\n if (!this.channels[name]) {\n this.channels[name] = createChannel(name, pusher);\n }\n return this.channels[name];\n };\n Channels.prototype.all = function () {\n return values(this.channels);\n };\n Channels.prototype.find = function (name) {\n return this.channels[name];\n };\n Channels.prototype.remove = function (name) {\n var channel = this.channels[name];\n delete this.channels[name];\n return channel;\n };\n Channels.prototype.disconnect = function () {\n objectApply(this.channels, function (channel) {\n channel.disconnect();\n });\n };\n return Channels;\n}());\n/* harmony default export */ var channels = (channels_Channels);\nfunction createChannel(name, pusher) {\n if (name.indexOf('private-encrypted-') === 0) {\n if (pusher.config.nacl) {\n return factory.createEncryptedChannel(name, pusher, pusher.config.nacl);\n }\n var errMsg = 'Tried to subscribe to a private-encrypted- channel but no nacl implementation available';\n var suffix = url_store.buildLogSuffix('encryptedChannelSupport');\n throw new UnsupportedFeature(errMsg + \". \" + suffix);\n }\n else if (name.indexOf('private-') === 0) {\n return factory.createPrivateChannel(name, pusher);\n }\n else if (name.indexOf('presence-') === 0) {\n return factory.createPresenceChannel(name, pusher);\n }\n else {\n return factory.createChannel(name, pusher);\n }\n}\n\n// CONCATENATED MODULE: ./src/core/utils/factory.ts\n\n\n\n\n\n\n\n\n\n\nvar Factory = {\n createChannels: function () {\n return new channels();\n },\n createConnectionManager: function (key, options) {\n return new connection_manager(key, options);\n },\n createChannel: function (name, pusher) {\n return new channels_channel(name, pusher);\n },\n createPrivateChannel: function (name, pusher) {\n return new private_channel(name, pusher);\n },\n createPresenceChannel: function (name, pusher) {\n return new presence_channel(name, pusher);\n },\n createEncryptedChannel: function (name, pusher, nacl) {\n return new encrypted_channel(name, pusher, nacl);\n },\n createTimelineSender: function (timeline, options) {\n return new timeline_sender(timeline, options);\n },\n createAuthorizer: function (channel, options) {\n if (options.authorizer) {\n return options.authorizer(channel, options);\n }\n return new pusher_authorizer(channel, options);\n },\n createHandshake: function (transport, callback) {\n return new connection_handshake(transport, callback);\n },\n createAssistantToTheTransportManager: function (manager, transport, options) {\n return new assistant_to_the_transport_manager(manager, transport, options);\n }\n};\n/* harmony default export */ var factory = (Factory);\n\n// CONCATENATED MODULE: ./src/core/transports/transport_manager.ts\n\nvar transport_manager_TransportManager = (function () {\n function TransportManager(options) {\n this.options = options || {};\n this.livesLeft = this.options.lives || Infinity;\n }\n TransportManager.prototype.getAssistant = function (transport) {\n return factory.createAssistantToTheTransportManager(this, transport, {\n minPingDelay: this.options.minPingDelay,\n maxPingDelay: this.options.maxPingDelay\n });\n };\n TransportManager.prototype.isAlive = function () {\n return this.livesLeft > 0;\n };\n TransportManager.prototype.reportDeath = function () {\n this.livesLeft -= 1;\n };\n return TransportManager;\n}());\n/* harmony default export */ var transport_manager = (transport_manager_TransportManager);\n\n// CONCATENATED MODULE: ./src/core/strategies/sequential_strategy.ts\n\n\n\nvar sequential_strategy_SequentialStrategy = (function () {\n function SequentialStrategy(strategies, options) {\n this.strategies = strategies;\n this.loop = Boolean(options.loop);\n this.failFast = Boolean(options.failFast);\n this.timeout = options.timeout;\n this.timeoutLimit = options.timeoutLimit;\n }\n SequentialStrategy.prototype.isSupported = function () {\n return any(this.strategies, util.method('isSupported'));\n };\n SequentialStrategy.prototype.connect = function (minPriority, callback) {\n var _this = this;\n var strategies = this.strategies;\n var current = 0;\n var timeout = this.timeout;\n var runner = null;\n var tryNextStrategy = function (error, handshake) {\n if (handshake) {\n callback(null, handshake);\n }\n else {\n current = current + 1;\n if (_this.loop) {\n current = current % strategies.length;\n }\n if (current < strategies.length) {\n if (timeout) {\n timeout = timeout * 2;\n if (_this.timeoutLimit) {\n timeout = Math.min(timeout, _this.timeoutLimit);\n }\n }\n runner = _this.tryStrategy(strategies[current], minPriority, { timeout: timeout, failFast: _this.failFast }, tryNextStrategy);\n }\n else {\n callback(true);\n }\n }\n };\n runner = this.tryStrategy(strategies[current], minPriority, { timeout: timeout, failFast: this.failFast }, tryNextStrategy);\n return {\n abort: function () {\n runner.abort();\n },\n forceMinPriority: function (p) {\n minPriority = p;\n if (runner) {\n runner.forceMinPriority(p);\n }\n }\n };\n };\n SequentialStrategy.prototype.tryStrategy = function (strategy, minPriority, options, callback) {\n var timer = null;\n var runner = null;\n if (options.timeout > 0) {\n timer = new OneOffTimer(options.timeout, function () {\n runner.abort();\n callback(true);\n });\n }\n runner = strategy.connect(minPriority, function (error, handshake) {\n if (error && timer && timer.isRunning() && !options.failFast) {\n return;\n }\n if (timer) {\n timer.ensureAborted();\n }\n callback(error, handshake);\n });\n return {\n abort: function () {\n if (timer) {\n timer.ensureAborted();\n }\n runner.abort();\n },\n forceMinPriority: function (p) {\n runner.forceMinPriority(p);\n }\n };\n };\n return SequentialStrategy;\n}());\n/* harmony default export */ var sequential_strategy = (sequential_strategy_SequentialStrategy);\n\n// CONCATENATED MODULE: ./src/core/strategies/best_connected_ever_strategy.ts\n\n\nvar best_connected_ever_strategy_BestConnectedEverStrategy = (function () {\n function BestConnectedEverStrategy(strategies) {\n this.strategies = strategies;\n }\n BestConnectedEverStrategy.prototype.isSupported = function () {\n return any(this.strategies, util.method('isSupported'));\n };\n BestConnectedEverStrategy.prototype.connect = function (minPriority, callback) {\n return connect(this.strategies, minPriority, function (i, runners) {\n return function (error, handshake) {\n runners[i].error = error;\n if (error) {\n if (allRunnersFailed(runners)) {\n callback(true);\n }\n return;\n }\n apply(runners, function (runner) {\n runner.forceMinPriority(handshake.transport.priority);\n });\n callback(null, handshake);\n };\n });\n };\n return BestConnectedEverStrategy;\n}());\n/* harmony default export */ var best_connected_ever_strategy = (best_connected_ever_strategy_BestConnectedEverStrategy);\nfunction connect(strategies, minPriority, callbackBuilder) {\n var runners = map(strategies, function (strategy, i, _, rs) {\n return strategy.connect(minPriority, callbackBuilder(i, rs));\n });\n return {\n abort: function () {\n apply(runners, abortRunner);\n },\n forceMinPriority: function (p) {\n apply(runners, function (runner) {\n runner.forceMinPriority(p);\n });\n }\n };\n}\nfunction allRunnersFailed(runners) {\n return collections_all(runners, function (runner) {\n return Boolean(runner.error);\n });\n}\nfunction abortRunner(runner) {\n if (!runner.error && !runner.aborted) {\n runner.abort();\n runner.aborted = true;\n }\n}\n\n// CONCATENATED MODULE: ./src/core/strategies/cached_strategy.ts\n\n\n\n\nvar cached_strategy_CachedStrategy = (function () {\n function CachedStrategy(strategy, transports, options) {\n this.strategy = strategy;\n this.transports = transports;\n this.ttl = options.ttl || 1800 * 1000;\n this.usingTLS = options.useTLS;\n this.timeline = options.timeline;\n }\n CachedStrategy.prototype.isSupported = function () {\n return this.strategy.isSupported();\n };\n CachedStrategy.prototype.connect = function (minPriority, callback) {\n var usingTLS = this.usingTLS;\n var info = fetchTransportCache(usingTLS);\n var strategies = [this.strategy];\n if (info && info.timestamp + this.ttl >= util.now()) {\n var transport = this.transports[info.transport];\n if (transport) {\n this.timeline.info({\n cached: true,\n transport: info.transport,\n latency: info.latency\n });\n strategies.push(new sequential_strategy([transport], {\n timeout: info.latency * 2 + 1000,\n failFast: true\n }));\n }\n }\n var startTimestamp = util.now();\n var runner = strategies\n .pop()\n .connect(minPriority, function cb(error, handshake) {\n if (error) {\n flushTransportCache(usingTLS);\n if (strategies.length > 0) {\n startTimestamp = util.now();\n runner = strategies.pop().connect(minPriority, cb);\n }\n else {\n callback(error);\n }\n }\n else {\n storeTransportCache(usingTLS, handshake.transport.name, util.now() - startTimestamp);\n callback(null, handshake);\n }\n });\n return {\n abort: function () {\n runner.abort();\n },\n forceMinPriority: function (p) {\n minPriority = p;\n if (runner) {\n runner.forceMinPriority(p);\n }\n }\n };\n };\n return CachedStrategy;\n}());\n/* harmony default export */ var cached_strategy = (cached_strategy_CachedStrategy);\nfunction getTransportCacheKey(usingTLS) {\n return 'pusherTransport' + (usingTLS ? 'TLS' : 'NonTLS');\n}\nfunction fetchTransportCache(usingTLS) {\n var storage = runtime.getLocalStorage();\n if (storage) {\n try {\n var serializedCache = storage[getTransportCacheKey(usingTLS)];\n if (serializedCache) {\n return JSON.parse(serializedCache);\n }\n }\n catch (e) {\n flushTransportCache(usingTLS);\n }\n }\n return null;\n}\nfunction storeTransportCache(usingTLS, transport, latency) {\n var storage = runtime.getLocalStorage();\n if (storage) {\n try {\n storage[getTransportCacheKey(usingTLS)] = safeJSONStringify({\n timestamp: util.now(),\n transport: transport,\n latency: latency\n });\n }\n catch (e) {\n }\n }\n}\nfunction flushTransportCache(usingTLS) {\n var storage = runtime.getLocalStorage();\n if (storage) {\n try {\n delete storage[getTransportCacheKey(usingTLS)];\n }\n catch (e) {\n }\n }\n}\n\n// CONCATENATED MODULE: ./src/core/strategies/delayed_strategy.ts\n\nvar delayed_strategy_DelayedStrategy = (function () {\n function DelayedStrategy(strategy, _a) {\n var number = _a.delay;\n this.strategy = strategy;\n this.options = { delay: number };\n }\n DelayedStrategy.prototype.isSupported = function () {\n return this.strategy.isSupported();\n };\n DelayedStrategy.prototype.connect = function (minPriority, callback) {\n var strategy = this.strategy;\n var runner;\n var timer = new OneOffTimer(this.options.delay, function () {\n runner = strategy.connect(minPriority, callback);\n });\n return {\n abort: function () {\n timer.ensureAborted();\n if (runner) {\n runner.abort();\n }\n },\n forceMinPriority: function (p) {\n minPriority = p;\n if (runner) {\n runner.forceMinPriority(p);\n }\n }\n };\n };\n return DelayedStrategy;\n}());\n/* harmony default export */ var delayed_strategy = (delayed_strategy_DelayedStrategy);\n\n// CONCATENATED MODULE: ./src/core/strategies/if_strategy.ts\nvar IfStrategy = (function () {\n function IfStrategy(test, trueBranch, falseBranch) {\n this.test = test;\n this.trueBranch = trueBranch;\n this.falseBranch = falseBranch;\n }\n IfStrategy.prototype.isSupported = function () {\n var branch = this.test() ? this.trueBranch : this.falseBranch;\n return branch.isSupported();\n };\n IfStrategy.prototype.connect = function (minPriority, callback) {\n var branch = this.test() ? this.trueBranch : this.falseBranch;\n return branch.connect(minPriority, callback);\n };\n return IfStrategy;\n}());\n/* harmony default export */ var if_strategy = (IfStrategy);\n\n// CONCATENATED MODULE: ./src/core/strategies/first_connected_strategy.ts\nvar FirstConnectedStrategy = (function () {\n function FirstConnectedStrategy(strategy) {\n this.strategy = strategy;\n }\n FirstConnectedStrategy.prototype.isSupported = function () {\n return this.strategy.isSupported();\n };\n FirstConnectedStrategy.prototype.connect = function (minPriority, callback) {\n var runner = this.strategy.connect(minPriority, function (error, handshake) {\n if (handshake) {\n runner.abort();\n }\n callback(error, handshake);\n });\n return runner;\n };\n return FirstConnectedStrategy;\n}());\n/* harmony default export */ var first_connected_strategy = (FirstConnectedStrategy);\n\n// CONCATENATED MODULE: ./src/runtimes/web/default_strategy.ts\n\n\n\n\n\n\n\nfunction testSupportsStrategy(strategy) {\n return function () {\n return strategy.isSupported();\n };\n}\nvar getDefaultStrategy = function (config, baseOptions, defineTransport) {\n var definedTransports = {};\n function defineTransportStrategy(name, type, priority, options, manager) {\n var transport = defineTransport(config, name, type, priority, options, manager);\n definedTransports[name] = transport;\n return transport;\n }\n var ws_options = Object.assign({}, baseOptions, {\n hostNonTLS: config.wsHost + ':' + config.wsPort,\n hostTLS: config.wsHost + ':' + config.wssPort,\n httpPath: config.wsPath\n });\n var wss_options = Object.assign({}, ws_options, {\n useTLS: true\n });\n var sockjs_options = Object.assign({}, baseOptions, {\n hostNonTLS: config.httpHost + ':' + config.httpPort,\n hostTLS: config.httpHost + ':' + config.httpsPort,\n httpPath: config.httpPath\n });\n var timeouts = {\n loop: true,\n timeout: 15000,\n timeoutLimit: 60000\n };\n var ws_manager = new transport_manager({\n lives: 2,\n minPingDelay: 10000,\n maxPingDelay: config.activityTimeout\n });\n var streaming_manager = new transport_manager({\n lives: 2,\n minPingDelay: 10000,\n maxPingDelay: config.activityTimeout\n });\n var ws_transport = defineTransportStrategy('ws', 'ws', 3, ws_options, ws_manager);\n var wss_transport = defineTransportStrategy('wss', 'ws', 3, wss_options, ws_manager);\n var sockjs_transport = defineTransportStrategy('sockjs', 'sockjs', 1, sockjs_options);\n var xhr_streaming_transport = defineTransportStrategy('xhr_streaming', 'xhr_streaming', 1, sockjs_options, streaming_manager);\n var xdr_streaming_transport = defineTransportStrategy('xdr_streaming', 'xdr_streaming', 1, sockjs_options, streaming_manager);\n var xhr_polling_transport = defineTransportStrategy('xhr_polling', 'xhr_polling', 1, sockjs_options);\n var xdr_polling_transport = defineTransportStrategy('xdr_polling', 'xdr_polling', 1, sockjs_options);\n var ws_loop = new sequential_strategy([ws_transport], timeouts);\n var wss_loop = new sequential_strategy([wss_transport], timeouts);\n var sockjs_loop = new sequential_strategy([sockjs_transport], timeouts);\n var streaming_loop = new sequential_strategy([\n new if_strategy(testSupportsStrategy(xhr_streaming_transport), xhr_streaming_transport, xdr_streaming_transport)\n ], timeouts);\n var polling_loop = new sequential_strategy([\n new if_strategy(testSupportsStrategy(xhr_polling_transport), xhr_polling_transport, xdr_polling_transport)\n ], timeouts);\n var http_loop = new sequential_strategy([\n new if_strategy(testSupportsStrategy(streaming_loop), new best_connected_ever_strategy([\n streaming_loop,\n new delayed_strategy(polling_loop, { delay: 4000 })\n ]), polling_loop)\n ], timeouts);\n var http_fallback_loop = new if_strategy(testSupportsStrategy(http_loop), http_loop, sockjs_loop);\n var wsStrategy;\n if (baseOptions.useTLS) {\n wsStrategy = new best_connected_ever_strategy([\n ws_loop,\n new delayed_strategy(http_fallback_loop, { delay: 2000 })\n ]);\n }\n else {\n wsStrategy = new best_connected_ever_strategy([\n ws_loop,\n new delayed_strategy(wss_loop, { delay: 2000 }),\n new delayed_strategy(http_fallback_loop, { delay: 5000 })\n ]);\n }\n return new cached_strategy(new first_connected_strategy(new if_strategy(testSupportsStrategy(ws_transport), wsStrategy, http_fallback_loop)), definedTransports, {\n ttl: 1800000,\n timeline: baseOptions.timeline,\n useTLS: baseOptions.useTLS\n });\n};\n/* harmony default export */ var default_strategy = (getDefaultStrategy);\n\n// CONCATENATED MODULE: ./src/runtimes/web/transports/transport_connection_initializer.ts\n\n/* harmony default export */ var transport_connection_initializer = (function () {\n var self = this;\n self.timeline.info(self.buildTimelineMessage({\n transport: self.name + (self.options.useTLS ? 's' : '')\n }));\n if (self.hooks.isInitialized()) {\n self.changeState('initialized');\n }\n else if (self.hooks.file) {\n self.changeState('initializing');\n Dependencies.load(self.hooks.file, { useTLS: self.options.useTLS }, function (error, callback) {\n if (self.hooks.isInitialized()) {\n self.changeState('initialized');\n callback(true);\n }\n else {\n if (error) {\n self.onError(error);\n }\n self.onClose();\n callback(false);\n }\n });\n }\n else {\n self.onClose();\n }\n});\n\n// CONCATENATED MODULE: ./src/runtimes/web/http/http_xdomain_request.ts\n\nvar http_xdomain_request_hooks = {\n getRequest: function (socket) {\n var xdr = new window.XDomainRequest();\n xdr.ontimeout = function () {\n socket.emit('error', new RequestTimedOut());\n socket.close();\n };\n xdr.onerror = function (e) {\n socket.emit('error', e);\n socket.close();\n };\n xdr.onprogress = function () {\n if (xdr.responseText && xdr.responseText.length > 0) {\n socket.onChunk(200, xdr.responseText);\n }\n };\n xdr.onload = function () {\n if (xdr.responseText && xdr.responseText.length > 0) {\n socket.onChunk(200, xdr.responseText);\n }\n socket.emit('finished', 200);\n socket.close();\n };\n return xdr;\n },\n abortRequest: function (xdr) {\n xdr.ontimeout = xdr.onerror = xdr.onprogress = xdr.onload = null;\n xdr.abort();\n }\n};\n/* harmony default export */ var http_xdomain_request = (http_xdomain_request_hooks);\n\n// CONCATENATED MODULE: ./src/core/http/http_request.ts\nvar http_request_extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\nvar MAX_BUFFER_LENGTH = 256 * 1024;\nvar http_request_HTTPRequest = (function (_super) {\n http_request_extends(HTTPRequest, _super);\n function HTTPRequest(hooks, method, url) {\n var _this = _super.call(this) || this;\n _this.hooks = hooks;\n _this.method = method;\n _this.url = url;\n return _this;\n }\n HTTPRequest.prototype.start = function (payload) {\n var _this = this;\n this.position = 0;\n this.xhr = this.hooks.getRequest(this);\n this.unloader = function () {\n _this.close();\n };\n runtime.addUnloadListener(this.unloader);\n this.xhr.open(this.method, this.url, true);\n if (this.xhr.setRequestHeader) {\n this.xhr.setRequestHeader('Content-Type', 'application/json');\n }\n this.xhr.send(payload);\n };\n HTTPRequest.prototype.close = function () {\n if (this.unloader) {\n runtime.removeUnloadListener(this.unloader);\n this.unloader = null;\n }\n if (this.xhr) {\n this.hooks.abortRequest(this.xhr);\n this.xhr = null;\n }\n };\n HTTPRequest.prototype.onChunk = function (status, data) {\n while (true) {\n var chunk = this.advanceBuffer(data);\n if (chunk) {\n this.emit('chunk', { status: status, data: chunk });\n }\n else {\n break;\n }\n }\n if (this.isBufferTooLong(data)) {\n this.emit('buffer_too_long');\n }\n };\n HTTPRequest.prototype.advanceBuffer = function (buffer) {\n var unreadData = buffer.slice(this.position);\n var endOfLinePosition = unreadData.indexOf('\\n');\n if (endOfLinePosition !== -1) {\n this.position += endOfLinePosition + 1;\n return unreadData.slice(0, endOfLinePosition);\n }\n else {\n return null;\n }\n };\n HTTPRequest.prototype.isBufferTooLong = function (buffer) {\n return this.position === buffer.length && buffer.length > MAX_BUFFER_LENGTH;\n };\n return HTTPRequest;\n}(dispatcher));\n/* harmony default export */ var http_request = (http_request_HTTPRequest);\n\n// CONCATENATED MODULE: ./src/core/http/state.ts\nvar State;\n(function (State) {\n State[State[\"CONNECTING\"] = 0] = \"CONNECTING\";\n State[State[\"OPEN\"] = 1] = \"OPEN\";\n State[State[\"CLOSED\"] = 3] = \"CLOSED\";\n})(State || (State = {}));\n/* harmony default export */ var state = (State);\n\n// CONCATENATED MODULE: ./src/core/http/http_socket.ts\n\n\n\nvar autoIncrement = 1;\nvar http_socket_HTTPSocket = (function () {\n function HTTPSocket(hooks, url) {\n this.hooks = hooks;\n this.session = randomNumber(1000) + '/' + randomString(8);\n this.location = getLocation(url);\n this.readyState = state.CONNECTING;\n this.openStream();\n }\n HTTPSocket.prototype.send = function (payload) {\n return this.sendRaw(JSON.stringify([payload]));\n };\n HTTPSocket.prototype.ping = function () {\n this.hooks.sendHeartbeat(this);\n };\n HTTPSocket.prototype.close = function (code, reason) {\n this.onClose(code, reason, true);\n };\n HTTPSocket.prototype.sendRaw = function (payload) {\n if (this.readyState === state.OPEN) {\n try {\n runtime.createSocketRequest('POST', getUniqueURL(getSendURL(this.location, this.session))).start(payload);\n return true;\n }\n catch (e) {\n return false;\n }\n }\n else {\n return false;\n }\n };\n HTTPSocket.prototype.reconnect = function () {\n this.closeStream();\n this.openStream();\n };\n HTTPSocket.prototype.onClose = function (code, reason, wasClean) {\n this.closeStream();\n this.readyState = state.CLOSED;\n if (this.onclose) {\n this.onclose({\n code: code,\n reason: reason,\n wasClean: wasClean\n });\n }\n };\n HTTPSocket.prototype.onChunk = function (chunk) {\n if (chunk.status !== 200) {\n return;\n }\n if (this.readyState === state.OPEN) {\n this.onActivity();\n }\n var payload;\n var type = chunk.data.slice(0, 1);\n switch (type) {\n case 'o':\n payload = JSON.parse(chunk.data.slice(1) || '{}');\n this.onOpen(payload);\n break;\n case 'a':\n payload = JSON.parse(chunk.data.slice(1) || '[]');\n for (var i = 0; i < payload.length; i++) {\n this.onEvent(payload[i]);\n }\n break;\n case 'm':\n payload = JSON.parse(chunk.data.slice(1) || 'null');\n this.onEvent(payload);\n break;\n case 'h':\n this.hooks.onHeartbeat(this);\n break;\n case 'c':\n payload = JSON.parse(chunk.data.slice(1) || '[]');\n this.onClose(payload[0], payload[1], true);\n break;\n }\n };\n HTTPSocket.prototype.onOpen = function (options) {\n if (this.readyState === state.CONNECTING) {\n if (options && options.hostname) {\n this.location.base = replaceHost(this.location.base, options.hostname);\n }\n this.readyState = state.OPEN;\n if (this.onopen) {\n this.onopen();\n }\n }\n else {\n this.onClose(1006, 'Server lost session', true);\n }\n };\n HTTPSocket.prototype.onEvent = function (event) {\n if (this.readyState === state.OPEN && this.onmessage) {\n this.onmessage({ data: event });\n }\n };\n HTTPSocket.prototype.onActivity = function () {\n if (this.onactivity) {\n this.onactivity();\n }\n };\n HTTPSocket.prototype.onError = function (error) {\n if (this.onerror) {\n this.onerror(error);\n }\n };\n HTTPSocket.prototype.openStream = function () {\n var _this = this;\n this.stream = runtime.createSocketRequest('POST', getUniqueURL(this.hooks.getReceiveURL(this.location, this.session)));\n this.stream.bind('chunk', function (chunk) {\n _this.onChunk(chunk);\n });\n this.stream.bind('finished', function (status) {\n _this.hooks.onFinished(_this, status);\n });\n this.stream.bind('buffer_too_long', function () {\n _this.reconnect();\n });\n try {\n this.stream.start();\n }\n catch (error) {\n util.defer(function () {\n _this.onError(error);\n _this.onClose(1006, 'Could not start streaming', false);\n });\n }\n };\n HTTPSocket.prototype.closeStream = function () {\n if (this.stream) {\n this.stream.unbind_all();\n this.stream.close();\n this.stream = null;\n }\n };\n return HTTPSocket;\n}());\nfunction getLocation(url) {\n var parts = /([^\\?]*)\\/*(\\??.*)/.exec(url);\n return {\n base: parts[1],\n queryString: parts[2]\n };\n}\nfunction getSendURL(url, session) {\n return url.base + '/' + session + '/xhr_send';\n}\nfunction getUniqueURL(url) {\n var separator = url.indexOf('?') === -1 ? '?' : '&';\n return url + separator + 't=' + +new Date() + '&n=' + autoIncrement++;\n}\nfunction replaceHost(url, hostname) {\n var urlParts = /(https?:\\/\\/)([^\\/:]+)((\\/|:)?.*)/.exec(url);\n return urlParts[1] + hostname + urlParts[3];\n}\nfunction randomNumber(max) {\n return Math.floor(Math.random() * max);\n}\nfunction randomString(length) {\n var result = [];\n for (var i = 0; i < length; i++) {\n result.push(randomNumber(32).toString(32));\n }\n return result.join('');\n}\n/* harmony default export */ var http_socket = (http_socket_HTTPSocket);\n\n// CONCATENATED MODULE: ./src/core/http/http_streaming_socket.ts\nvar http_streaming_socket_hooks = {\n getReceiveURL: function (url, session) {\n return url.base + '/' + session + '/xhr_streaming' + url.queryString;\n },\n onHeartbeat: function (socket) {\n socket.sendRaw('[]');\n },\n sendHeartbeat: function (socket) {\n socket.sendRaw('[]');\n },\n onFinished: function (socket, status) {\n socket.onClose(1006, 'Connection interrupted (' + status + ')', false);\n }\n};\n/* harmony default export */ var http_streaming_socket = (http_streaming_socket_hooks);\n\n// CONCATENATED MODULE: ./src/core/http/http_polling_socket.ts\nvar http_polling_socket_hooks = {\n getReceiveURL: function (url, session) {\n return url.base + '/' + session + '/xhr' + url.queryString;\n },\n onHeartbeat: function () {\n },\n sendHeartbeat: function (socket) {\n socket.sendRaw('[]');\n },\n onFinished: function (socket, status) {\n if (status === 200) {\n socket.reconnect();\n }\n else {\n socket.onClose(1006, 'Connection interrupted (' + status + ')', false);\n }\n }\n};\n/* harmony default export */ var http_polling_socket = (http_polling_socket_hooks);\n\n// CONCATENATED MODULE: ./src/runtimes/isomorphic/http/http_xhr_request.ts\n\nvar http_xhr_request_hooks = {\n getRequest: function (socket) {\n var Constructor = runtime.getXHRAPI();\n var xhr = new Constructor();\n xhr.onreadystatechange = xhr.onprogress = function () {\n switch (xhr.readyState) {\n case 3:\n if (xhr.responseText && xhr.responseText.length > 0) {\n socket.onChunk(xhr.status, xhr.responseText);\n }\n break;\n case 4:\n if (xhr.responseText && xhr.responseText.length > 0) {\n socket.onChunk(xhr.status, xhr.responseText);\n }\n socket.emit('finished', xhr.status);\n socket.close();\n break;\n }\n };\n return xhr;\n },\n abortRequest: function (xhr) {\n xhr.onreadystatechange = null;\n xhr.abort();\n }\n};\n/* harmony default export */ var http_xhr_request = (http_xhr_request_hooks);\n\n// CONCATENATED MODULE: ./src/runtimes/isomorphic/http/http.ts\n\n\n\n\n\nvar HTTP = {\n createStreamingSocket: function (url) {\n return this.createSocket(http_streaming_socket, url);\n },\n createPollingSocket: function (url) {\n return this.createSocket(http_polling_socket, url);\n },\n createSocket: function (hooks, url) {\n return new http_socket(hooks, url);\n },\n createXHR: function (method, url) {\n return this.createRequest(http_xhr_request, method, url);\n },\n createRequest: function (hooks, method, url) {\n return new http_request(hooks, method, url);\n }\n};\n/* harmony default export */ var http_http = (HTTP);\n\n// CONCATENATED MODULE: ./src/runtimes/web/http/http.ts\n\n\nhttp_http.createXDR = function (method, url) {\n return this.createRequest(http_xdomain_request, method, url);\n};\n/* harmony default export */ var web_http_http = (http_http);\n\n// CONCATENATED MODULE: ./src/runtimes/web/runtime.ts\n\n\n\n\n\n\n\n\n\n\n\n\nvar Runtime = {\n nextAuthCallbackID: 1,\n auth_callbacks: {},\n ScriptReceivers: ScriptReceivers,\n DependenciesReceivers: DependenciesReceivers,\n getDefaultStrategy: default_strategy,\n Transports: transports_transports,\n transportConnectionInitializer: transport_connection_initializer,\n HTTPFactory: web_http_http,\n TimelineTransport: jsonp_timeline,\n getXHRAPI: function () {\n return window.XMLHttpRequest;\n },\n getWebSocketAPI: function () {\n return window.WebSocket || window.MozWebSocket;\n },\n setup: function (PusherClass) {\n var _this = this;\n window.Pusher = PusherClass;\n var initializeOnDocumentBody = function () {\n _this.onDocumentBody(PusherClass.ready);\n };\n if (!window.JSON) {\n Dependencies.load('json2', {}, initializeOnDocumentBody);\n }\n else {\n initializeOnDocumentBody();\n }\n },\n getDocument: function () {\n return document;\n },\n getProtocol: function () {\n return this.getDocument().location.protocol;\n },\n getAuthorizers: function () {\n return { ajax: xhr_auth, jsonp: jsonp_auth };\n },\n onDocumentBody: function (callback) {\n var _this = this;\n if (document.body) {\n callback();\n }\n else {\n setTimeout(function () {\n _this.onDocumentBody(callback);\n }, 0);\n }\n },\n createJSONPRequest: function (url, data) {\n return new jsonp_request(url, data);\n },\n createScriptRequest: function (src) {\n return new script_request(src);\n },\n getLocalStorage: function () {\n try {\n return window.localStorage;\n }\n catch (e) {\n return undefined;\n }\n },\n createXHR: function () {\n if (this.getXHRAPI()) {\n return this.createXMLHttpRequest();\n }\n else {\n return this.createMicrosoftXHR();\n }\n },\n createXMLHttpRequest: function () {\n var Constructor = this.getXHRAPI();\n return new Constructor();\n },\n createMicrosoftXHR: function () {\n return new ActiveXObject('Microsoft.XMLHTTP');\n },\n getNetwork: function () {\n return net_info_Network;\n },\n createWebSocket: function (url) {\n var Constructor = this.getWebSocketAPI();\n return new Constructor(url);\n },\n createSocketRequest: function (method, url) {\n if (this.isXHRSupported()) {\n return this.HTTPFactory.createXHR(method, url);\n }\n else if (this.isXDRSupported(url.indexOf('https:') === 0)) {\n return this.HTTPFactory.createXDR(method, url);\n }\n else {\n throw 'Cross-origin HTTP requests are not supported';\n }\n },\n isXHRSupported: function () {\n var Constructor = this.getXHRAPI();\n return (Boolean(Constructor) && new Constructor().withCredentials !== undefined);\n },\n isXDRSupported: function (useTLS) {\n var protocol = useTLS ? 'https:' : 'http:';\n var documentProtocol = this.getProtocol();\n return (Boolean(window['XDomainRequest']) && documentProtocol === protocol);\n },\n addUnloadListener: function (listener) {\n if (window.addEventListener !== undefined) {\n window.addEventListener('unload', listener, false);\n }\n else if (window.attachEvent !== undefined) {\n window.attachEvent('onunload', listener);\n }\n },\n removeUnloadListener: function (listener) {\n if (window.addEventListener !== undefined) {\n window.removeEventListener('unload', listener, false);\n }\n else if (window.detachEvent !== undefined) {\n window.detachEvent('onunload', listener);\n }\n }\n};\n/* harmony default export */ var runtime = (Runtime);\n\n// CONCATENATED MODULE: ./src/core/timeline/level.ts\nvar TimelineLevel;\n(function (TimelineLevel) {\n TimelineLevel[TimelineLevel[\"ERROR\"] = 3] = \"ERROR\";\n TimelineLevel[TimelineLevel[\"INFO\"] = 6] = \"INFO\";\n TimelineLevel[TimelineLevel[\"DEBUG\"] = 7] = \"DEBUG\";\n})(TimelineLevel || (TimelineLevel = {}));\n/* harmony default export */ var timeline_level = (TimelineLevel);\n\n// CONCATENATED MODULE: ./src/core/timeline/timeline.ts\n\n\n\nvar timeline_Timeline = (function () {\n function Timeline(key, session, options) {\n this.key = key;\n this.session = session;\n this.events = [];\n this.options = options || {};\n this.sent = 0;\n this.uniqueID = 0;\n }\n Timeline.prototype.log = function (level, event) {\n if (level <= this.options.level) {\n this.events.push(extend({}, event, { timestamp: util.now() }));\n if (this.options.limit && this.events.length > this.options.limit) {\n this.events.shift();\n }\n }\n };\n Timeline.prototype.error = function (event) {\n this.log(timeline_level.ERROR, event);\n };\n Timeline.prototype.info = function (event) {\n this.log(timeline_level.INFO, event);\n };\n Timeline.prototype.debug = function (event) {\n this.log(timeline_level.DEBUG, event);\n };\n Timeline.prototype.isEmpty = function () {\n return this.events.length === 0;\n };\n Timeline.prototype.send = function (sendfn, callback) {\n var _this = this;\n var data = extend({\n session: this.session,\n bundle: this.sent + 1,\n key: this.key,\n lib: 'js',\n version: this.options.version,\n cluster: this.options.cluster,\n features: this.options.features,\n timeline: this.events\n }, this.options.params);\n this.events = [];\n sendfn(data, function (error, result) {\n if (!error) {\n _this.sent++;\n }\n if (callback) {\n callback(error, result);\n }\n });\n return true;\n };\n Timeline.prototype.generateUniqueID = function () {\n this.uniqueID++;\n return this.uniqueID;\n };\n return Timeline;\n}());\n/* harmony default export */ var timeline_timeline = (timeline_Timeline);\n\n// CONCATENATED MODULE: ./src/core/strategies/transport_strategy.ts\n\n\n\n\nvar transport_strategy_TransportStrategy = (function () {\n function TransportStrategy(name, priority, transport, options) {\n this.name = name;\n this.priority = priority;\n this.transport = transport;\n this.options = options || {};\n }\n TransportStrategy.prototype.isSupported = function () {\n return this.transport.isSupported({\n useTLS: this.options.useTLS\n });\n };\n TransportStrategy.prototype.connect = function (minPriority, callback) {\n var _this = this;\n if (!this.isSupported()) {\n return failAttempt(new UnsupportedStrategy(), callback);\n }\n else if (this.priority < minPriority) {\n return failAttempt(new TransportPriorityTooLow(), callback);\n }\n var connected = false;\n var transport = this.transport.createConnection(this.name, this.priority, this.options.key, this.options);\n var handshake = null;\n var onInitialized = function () {\n transport.unbind('initialized', onInitialized);\n transport.connect();\n };\n var onOpen = function () {\n handshake = factory.createHandshake(transport, function (result) {\n connected = true;\n unbindListeners();\n callback(null, result);\n });\n };\n var onError = function (error) {\n unbindListeners();\n callback(error);\n };\n var onClosed = function () {\n unbindListeners();\n var serializedTransport;\n serializedTransport = safeJSONStringify(transport);\n callback(new TransportClosed(serializedTransport));\n };\n var unbindListeners = function () {\n transport.unbind('initialized', onInitialized);\n transport.unbind('open', onOpen);\n transport.unbind('error', onError);\n transport.unbind('closed', onClosed);\n };\n transport.bind('initialized', onInitialized);\n transport.bind('open', onOpen);\n transport.bind('error', onError);\n transport.bind('closed', onClosed);\n transport.initialize();\n return {\n abort: function () {\n if (connected) {\n return;\n }\n unbindListeners();\n if (handshake) {\n handshake.close();\n }\n else {\n transport.close();\n }\n },\n forceMinPriority: function (p) {\n if (connected) {\n return;\n }\n if (_this.priority < p) {\n if (handshake) {\n handshake.close();\n }\n else {\n transport.close();\n }\n }\n }\n };\n };\n return TransportStrategy;\n}());\n/* harmony default export */ var transport_strategy = (transport_strategy_TransportStrategy);\nfunction failAttempt(error, callback) {\n util.defer(function () {\n callback(error);\n });\n return {\n abort: function () { },\n forceMinPriority: function () { }\n };\n}\n\n// CONCATENATED MODULE: ./src/core/strategies/strategy_builder.ts\n\n\n\n\n\nvar strategy_builder_Transports = runtime.Transports;\nvar strategy_builder_defineTransport = function (config, name, type, priority, options, manager) {\n var transportClass = strategy_builder_Transports[type];\n if (!transportClass) {\n throw new UnsupportedTransport(type);\n }\n var enabled = (!config.enabledTransports ||\n arrayIndexOf(config.enabledTransports, name) !== -1) &&\n (!config.disabledTransports ||\n arrayIndexOf(config.disabledTransports, name) === -1);\n var transport;\n if (enabled) {\n options = Object.assign({ ignoreNullOrigin: config.ignoreNullOrigin }, options);\n transport = new transport_strategy(name, priority, manager ? manager.getAssistant(transportClass) : transportClass, options);\n }\n else {\n transport = strategy_builder_UnsupportedStrategy;\n }\n return transport;\n};\nvar strategy_builder_UnsupportedStrategy = {\n isSupported: function () {\n return false;\n },\n connect: function (_, callback) {\n var deferred = util.defer(function () {\n callback(new UnsupportedStrategy());\n });\n return {\n abort: function () {\n deferred.ensureAborted();\n },\n forceMinPriority: function () { }\n };\n }\n};\n\n// CONCATENATED MODULE: ./src/core/config.ts\n\n\nfunction getConfig(opts) {\n var config = {\n activityTimeout: opts.activityTimeout || defaults.activityTimeout,\n authEndpoint: opts.authEndpoint || defaults.authEndpoint,\n authTransport: opts.authTransport || defaults.authTransport,\n cluster: opts.cluster || defaults.cluster,\n httpPath: opts.httpPath || defaults.httpPath,\n httpPort: opts.httpPort || defaults.httpPort,\n httpsPort: opts.httpsPort || defaults.httpsPort,\n pongTimeout: opts.pongTimeout || defaults.pongTimeout,\n statsHost: opts.statsHost || defaults.stats_host,\n unavailableTimeout: opts.unavailableTimeout || defaults.unavailableTimeout,\n wsPath: opts.wsPath || defaults.wsPath,\n wsPort: opts.wsPort || defaults.wsPort,\n wssPort: opts.wssPort || defaults.wssPort,\n enableStats: getEnableStatsConfig(opts),\n httpHost: getHttpHost(opts),\n useTLS: shouldUseTLS(opts),\n wsHost: getWebsocketHost(opts)\n };\n if ('auth' in opts)\n config.auth = opts.auth;\n if ('authorizer' in opts)\n config.authorizer = opts.authorizer;\n if ('disabledTransports' in opts)\n config.disabledTransports = opts.disabledTransports;\n if ('enabledTransports' in opts)\n config.enabledTransports = opts.enabledTransports;\n if ('ignoreNullOrigin' in opts)\n config.ignoreNullOrigin = opts.ignoreNullOrigin;\n if ('timelineParams' in opts)\n config.timelineParams = opts.timelineParams;\n if ('nacl' in opts) {\n config.nacl = opts.nacl;\n }\n return config;\n}\nfunction getHttpHost(opts) {\n if (opts.httpHost) {\n return opts.httpHost;\n }\n if (opts.cluster) {\n return \"sockjs-\" + opts.cluster + \".pusher.com\";\n }\n return defaults.httpHost;\n}\nfunction getWebsocketHost(opts) {\n if (opts.wsHost) {\n return opts.wsHost;\n }\n if (opts.cluster) {\n return getWebsocketHostFromCluster(opts.cluster);\n }\n return getWebsocketHostFromCluster(defaults.cluster);\n}\nfunction getWebsocketHostFromCluster(cluster) {\n return \"ws-\" + cluster + \".pusher.com\";\n}\nfunction shouldUseTLS(opts) {\n if (runtime.getProtocol() === 'https:') {\n return true;\n }\n else if (opts.forceTLS === false) {\n return false;\n }\n return true;\n}\nfunction getEnableStatsConfig(opts) {\n if ('enableStats' in opts) {\n return opts.enableStats;\n }\n if ('disableStats' in opts) {\n return !opts.disableStats;\n }\n return false;\n}\n\n// CONCATENATED MODULE: ./src/core/pusher.ts\n\n\n\n\n\n\n\n\n\n\n\n\nvar pusher_Pusher = (function () {\n function Pusher(app_key, options) {\n var _this = this;\n checkAppKey(app_key);\n options = options || {};\n if (!options.cluster && !(options.wsHost || options.httpHost)) {\n var suffix = url_store.buildLogSuffix('javascriptQuickStart');\n logger.warn(\"You should always specify a cluster when connecting. \" + suffix);\n }\n if ('disableStats' in options) {\n logger.warn('The disableStats option is deprecated in favor of enableStats');\n }\n this.key = app_key;\n this.config = getConfig(options);\n this.channels = factory.createChannels();\n this.global_emitter = new dispatcher();\n this.sessionID = Math.floor(Math.random() * 1000000000);\n this.timeline = new timeline_timeline(this.key, this.sessionID, {\n cluster: this.config.cluster,\n features: Pusher.getClientFeatures(),\n params: this.config.timelineParams || {},\n limit: 50,\n level: timeline_level.INFO,\n version: defaults.VERSION\n });\n if (this.config.enableStats) {\n this.timelineSender = factory.createTimelineSender(this.timeline, {\n host: this.config.statsHost,\n path: '/timeline/v2/' + runtime.TimelineTransport.name\n });\n }\n var getStrategy = function (options) {\n return runtime.getDefaultStrategy(_this.config, options, strategy_builder_defineTransport);\n };\n this.connection = factory.createConnectionManager(this.key, {\n getStrategy: getStrategy,\n timeline: this.timeline,\n activityTimeout: this.config.activityTimeout,\n pongTimeout: this.config.pongTimeout,\n unavailableTimeout: this.config.unavailableTimeout,\n useTLS: Boolean(this.config.useTLS)\n });\n this.connection.bind('connected', function () {\n _this.subscribeAll();\n if (_this.timelineSender) {\n _this.timelineSender.send(_this.connection.isUsingTLS());\n }\n });\n this.connection.bind('message', function (event) {\n var eventName = event.event;\n var internal = eventName.indexOf('pusher_internal:') === 0;\n if (event.channel) {\n var channel = _this.channel(event.channel);\n if (channel) {\n channel.handleEvent(event);\n }\n }\n if (!internal) {\n _this.global_emitter.emit(event.event, event.data);\n }\n });\n this.connection.bind('connecting', function () {\n _this.channels.disconnect();\n });\n this.connection.bind('disconnected', function () {\n _this.channels.disconnect();\n });\n this.connection.bind('error', function (err) {\n logger.warn(err);\n });\n Pusher.instances.push(this);\n this.timeline.info({ instances: Pusher.instances.length });\n if (Pusher.isReady) {\n this.connect();\n }\n }\n Pusher.ready = function () {\n Pusher.isReady = true;\n for (var i = 0, l = Pusher.instances.length; i < l; i++) {\n Pusher.instances[i].connect();\n }\n };\n Pusher.getClientFeatures = function () {\n return keys(filterObject({ ws: runtime.Transports.ws }, function (t) {\n return t.isSupported({});\n }));\n };\n Pusher.prototype.channel = function (name) {\n return this.channels.find(name);\n };\n Pusher.prototype.allChannels = function () {\n return this.channels.all();\n };\n Pusher.prototype.connect = function () {\n this.connection.connect();\n if (this.timelineSender) {\n if (!this.timelineSenderTimer) {\n var usingTLS = this.connection.isUsingTLS();\n var timelineSender = this.timelineSender;\n this.timelineSenderTimer = new PeriodicTimer(60000, function () {\n timelineSender.send(usingTLS);\n });\n }\n }\n };\n Pusher.prototype.disconnect = function () {\n this.connection.disconnect();\n if (this.timelineSenderTimer) {\n this.timelineSenderTimer.ensureAborted();\n this.timelineSenderTimer = null;\n }\n };\n Pusher.prototype.bind = function (event_name, callback, context) {\n this.global_emitter.bind(event_name, callback, context);\n return this;\n };\n Pusher.prototype.unbind = function (event_name, callback, context) {\n this.global_emitter.unbind(event_name, callback, context);\n return this;\n };\n Pusher.prototype.bind_global = function (callback) {\n this.global_emitter.bind_global(callback);\n return this;\n };\n Pusher.prototype.unbind_global = function (callback) {\n this.global_emitter.unbind_global(callback);\n return this;\n };\n Pusher.prototype.unbind_all = function (callback) {\n this.global_emitter.unbind_all();\n return this;\n };\n Pusher.prototype.subscribeAll = function () {\n var channelName;\n for (channelName in this.channels.channels) {\n if (this.channels.channels.hasOwnProperty(channelName)) {\n this.subscribe(channelName);\n }\n }\n };\n Pusher.prototype.subscribe = function (channel_name) {\n var channel = this.channels.add(channel_name, this);\n if (channel.subscriptionPending && channel.subscriptionCancelled) {\n channel.reinstateSubscription();\n }\n else if (!channel.subscriptionPending &&\n this.connection.state === 'connected') {\n channel.subscribe();\n }\n return channel;\n };\n Pusher.prototype.unsubscribe = function (channel_name) {\n var channel = this.channels.find(channel_name);\n if (channel && channel.subscriptionPending) {\n channel.cancelSubscription();\n }\n else {\n channel = this.channels.remove(channel_name);\n if (channel && channel.subscribed) {\n channel.unsubscribe();\n }\n }\n };\n Pusher.prototype.send_event = function (event_name, data, channel) {\n return this.connection.send_event(event_name, data, channel);\n };\n Pusher.prototype.shouldUseTLS = function () {\n return this.config.useTLS;\n };\n Pusher.instances = [];\n Pusher.isReady = false;\n Pusher.logToConsole = false;\n Pusher.Runtime = runtime;\n Pusher.ScriptReceivers = runtime.ScriptReceivers;\n Pusher.DependenciesReceivers = runtime.DependenciesReceivers;\n Pusher.auth_callbacks = runtime.auth_callbacks;\n return Pusher;\n}());\n/* harmony default export */ var core_pusher = __webpack_exports__[\"default\"] = (pusher_Pusher);\nfunction checkAppKey(key) {\n if (key === null || key === undefined) {\n throw 'You must pass your app key when you instantiate Pusher.';\n }\n}\nruntime.setup(pusher_Pusher);\n\n\n/***/ })\n/******/ ]);\n});\n//# sourceMappingURL=pusher.js.map"],"names":["root","factory","module","modules","installedModules","__webpack_require__","moduleId","exports","name","getter","value","mode","ns","key","object","property","__extends","extendStatics","d","b","p","__","INVALID_BYTE","Coder","_paddingCharacter","length","data","out","i","c","left","s","paddingLength","op","haveBad","v0","v1","v2","v3","result","stdCoder","encode","decode","URLSafeCoder","_super","urlSafeCoder","encodeURLSafe","decodeURLSafe","INVALID_UTF16","INVALID_UTF8","arr","encodedLength","pos","chars","min","n1","n2","n3","__webpack_exports__","ScriptReceiverFactory","prefix","callback","number","id","called","callbackWrapper","receiver","ScriptReceivers","Defaults","defaults","dependency_loader_DependencyLoader","DependencyLoader","options","self","request","runtime","error","callbacks","successCallback","wasSuccessful","cdn","protocol","dependency_loader","DependenciesReceivers","Dependencies","urlStore","buildLogSuffix","urlPrefix","urlObj","url","url_store","BadEventName","msg","_newTarget","_this","RequestTimedOut","TransportPriorityTooLow","TransportClosed","UnsupportedFeature","UnsupportedTransport","UnsupportedStrategy","HTTPAuthError","status","ajax","context","socketId","xhr","headerName","parsed","suffix","xhr_auth","btoa","utob","fromCharCode","b64chars","cb_utob","cc","u","cb_encode","ccc","padlen","ord","Timer","set","clear","delay","abstract_timer","timers_extends","timers_clearTimeout","timer","timers_clearInterval","OneOffTimer","PeriodicTimer","Util","boundArguments","util","extend","target","sources","_i","extensions","stringify","m","safeJSONStringify","arrayIndexOf","array","item","nativeIndexOf","l","objectApply","f","keys","_","values","apply","map","mapObject","filter","test","filterObject","flatten","any","collections_all","encodeParamsObject","buildQueryString","params","query","decycleObject","objects","paths","derez","path","nu","source","logger_Logger","Logger","message","args","defaultLoggingFunction","core_pusher","log","logger","jsonp","callbackName","document","script","callback_name","head","jsonp_auth","ScriptRequest","src","errorString","script_request","jsonp_request_JSONPRequest","JSONPRequest","jsonp_request","getAgent","sender","useTLS","scheme","jsonp_timeline_jsonp","jsonp_timeline","getGenericURL","baseScheme","host","getGenericPath","queryString","ws","http","sockjs","callback_registry_CallbackRegistry","CallbackRegistry","prefixedEventName","names","binding","callback_registry","dispatcher_Dispatcher","Dispatcher","failThrough","eventName","metadata","dispatcher","transport_connection_extends","transport_connection_TransportConnection","TransportConnection","hooks","priority","e","closeEvent","state","transport_connection","transport_Transport","Transport","environment","transports_transport","WSTransport","httpConfiguration","streamingConfiguration","pollingConfiguration","xhrConfiguration","XHRStreamingTransport","XHRPollingTransport","Transports","transports","SockJSTransport","socket","xdrConfiguration","yes","XDRStreamingTransport","XDRPollingTransport","transports_transports","net_info_extends","NetInfo","net_info_Network","assistant_to_the_transport_manager_AssistantToTheTransportManager","AssistantToTheTransportManager","manager","transport","connection","openTimestamp","onOpen","onClosed","lifespan","assistant_to_the_transport_manager","Protocol","messageEvent","messageData","pusherEventData","pusherEvent","event","protocol_protocol","connection_extends","connection_Connection","Connection","channel","listeners","unbindListeners","listener","action","connection_connection","handshake_Handshake","Handshake","connection_handshake","pusher_authorizer_PusherAuthorizer","PusherAuthorizer","authTransport","pusher_authorizer","timeline_sender_TimelineSender","TimelineSender","timeline","timeline_sender","channel_extends","channel_Channel","Channel","pusher","channels_channel","private_channel_extends","private_channel_PrivateChannel","PrivateChannel","authorizer","private_channel","members_Members","Members","member","subscriptionData","memberData","members","presence_channel_extends","presence_channel_PresenceChannel","PresenceChannel","authData","channelData","addedMember","removedMember","presence_channel","utf8","base64","encrypted_channel_extends","encrypted_channel_EncryptedChannel","EncryptedChannel","nacl","sharedSecret","cipherText","nonce","bytes","raw","encrypted_channel","connection_manager_extends","connection_manager_ConnectionManager","ConnectionManager","Network","handshake","errorCallbacks","withErrorEmitted","newState","previousState","newStateDescription","connection_manager","channels_Channels","Channels","createChannel","channels","errMsg","Factory","transport_manager_TransportManager","TransportManager","transport_manager","sequential_strategy_SequentialStrategy","SequentialStrategy","strategies","minPriority","current","timeout","runner","tryNextStrategy","strategy","sequential_strategy","best_connected_ever_strategy_BestConnectedEverStrategy","BestConnectedEverStrategy","connect","runners","allRunnersFailed","best_connected_ever_strategy","callbackBuilder","rs","abortRunner","cached_strategy_CachedStrategy","CachedStrategy","usingTLS","info","fetchTransportCache","startTimestamp","cb","flushTransportCache","storeTransportCache","cached_strategy","getTransportCacheKey","storage","serializedCache","latency","delayed_strategy_DelayedStrategy","DelayedStrategy","_a","delayed_strategy","IfStrategy","trueBranch","falseBranch","branch","if_strategy","FirstConnectedStrategy","first_connected_strategy","testSupportsStrategy","getDefaultStrategy","config","baseOptions","defineTransport","definedTransports","defineTransportStrategy","type","ws_options","wss_options","sockjs_options","timeouts","ws_manager","streaming_manager","ws_transport","wss_transport","sockjs_transport","xhr_streaming_transport","xdr_streaming_transport","xhr_polling_transport","xdr_polling_transport","ws_loop","wss_loop","sockjs_loop","streaming_loop","polling_loop","http_loop","http_fallback_loop","wsStrategy","default_strategy","transport_connection_initializer","http_xdomain_request_hooks","xdr","http_xdomain_request","http_request_extends","MAX_BUFFER_LENGTH","http_request_HTTPRequest","HTTPRequest","method","payload","chunk","buffer","unreadData","endOfLinePosition","http_request","State","autoIncrement","http_socket_HTTPSocket","HTTPSocket","randomNumber","randomString","getLocation","code","reason","getUniqueURL","getSendURL","wasClean","replaceHost","parts","session","separator","hostname","urlParts","max","http_socket","http_streaming_socket_hooks","http_streaming_socket","http_polling_socket_hooks","http_polling_socket","http_xhr_request_hooks","Constructor","http_xhr_request","HTTP","http_http","web_http_http","Runtime","PusherClass","initializeOnDocumentBody","documentProtocol","TimelineLevel","timeline_level","timeline_Timeline","Timeline","level","sendfn","timeline_timeline","transport_strategy_TransportStrategy","TransportStrategy","failAttempt","connected","onInitialized","onError","serializedTransport","transport_strategy","strategy_builder_Transports","strategy_builder_defineTransport","transportClass","enabled","strategy_builder_UnsupportedStrategy","deferred","getConfig","opts","getEnableStatsConfig","getHttpHost","shouldUseTLS","getWebsocketHost","getWebsocketHostFromCluster","cluster","pusher_Pusher","Pusher","app_key","checkAppKey","getStrategy","internal","err","timelineSender","event_name","channelName","channel_name"],"mappings":";;;;;;qBAQC,SAA0CA,EAAMC,EAAS,CAExDC,GAAA,QAAiBD,EAAS,CAO3B,GAAE,OAAQ,UAAW,CACtB,OAAiB,SAASE,EAAS,CAEzB,IAAIC,EAAmB,CAAE,EAGzB,SAASC,EAAoBC,EAAU,CAGtC,GAAGF,EAAiBE,CAAQ,EAC3B,OAAOF,EAAiBE,CAAQ,EAAE,QAGnC,IAAIJ,EAASE,EAAiBE,CAAQ,EAAI,CACzC,EAAGA,EACH,EAAG,GACH,QAAS,CAAA,CACT,EAGD,OAAAH,EAAQG,CAAQ,EAAE,KAAKJ,EAAO,QAASA,EAAQA,EAAO,QAASG,CAAmB,EAGlFH,EAAO,EAAI,GAGJA,EAAO,QAKf,OAAAG,EAAoB,EAAIF,EAGxBE,EAAoB,EAAID,EAGxBC,EAAoB,EAAI,SAASE,EAASC,EAAMC,EAAQ,CACnDJ,EAAoB,EAAEE,EAASC,CAAI,GACtC,OAAO,eAAeD,EAASC,EAAM,CAAE,WAAY,GAAM,IAAKC,EAAQ,CAEvE,EAGDJ,EAAoB,EAAI,SAASE,EAAS,CACtC,OAAO,OAAW,KAAe,OAAO,aAC1C,OAAO,eAAeA,EAAS,OAAO,YAAa,CAAE,MAAO,SAAU,EAEvE,OAAO,eAAeA,EAAS,aAAc,CAAE,MAAO,GAAM,CAC5D,EAODF,EAAoB,EAAI,SAASK,EAAOC,EAAM,CAG7C,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