diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6d8fe00a6..2bdfcc8fd 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,29 @@
# Changelog
+## 7.0.0 (2020-07-30)
+
+[UPDATED] Type signatures for authorizer callback. Previously the authorizer
+callback had 2 arguments, the first was a boolean indicating that the second
+was an error. Switched for a more conventional `function(err, data)` signature.
+**This is a breaking change, if you use a custom authorizer**
+
+[UPDATED] Types of errors emitted on `pusher:subscription_error` events.
+Previously this event just contained the status code the auth endpoint
+returned. This was replaced with a (hopefully) more error object with a message
+and a `status` key.
+**This is a breaking change, if you depend on the status in the
+`pusher:subscription_error` event**
+
+[FIXED] Stop wrapping websocket errors multiple times. [Fixes issue
+464](https://github.com/pusher/pusher-js/issues/464)
+**This might be a breaking change, if you depend on the structure of `'error'` events
+emitted by `pusher.connection`**
+
+[FIXED] Stop swallowing errors thrown by handlers on encrypted channels.
+Previously errors thrown by handlers bound to encrypted channels were caught
+and ignored. This was unintentional and undesirable. [Fixes Issue
+437](https://github.com/pusher/pusher-js/issues/437)
+
## 6.0.3 (2020-05-14)
[FIXED] Added typescript declarations for the pusher-js/with-encryption build
diff --git a/README.md b/README.md
index 85abcac57..4e8788cda 100644
--- a/README.md
+++ b/README.md
@@ -101,13 +101,13 @@ const Pusher = require('pusher-js/with-encryption');
#### CDN
```html
-
+
```
If you'd like to use encrypted channels:
```html
-
+
```
You can also use [cdnjs.com](https://cdnjs.com/libraries/pusher) if you prefer
@@ -172,13 +172,13 @@ Notes:
You can import the worker script (`pusher.worker.js`, not `pusher.js`) from the CDN:
```javascript
-importScripts('https://js.pusher.com/6.0/pusher.worker.min.js');
+importScripts('https://js.pusher.com/7.0/pusher.worker.min.js');
```
If you'd like to use encrypted channels:
```javascript
-importScripts('https://js.pusher.com/6.0/pusher-with-encryption.worker.min.js');
+importScripts('https://js.pusher.com/7.0/pusher-with-encryption.worker.min.js');
```
### Node.js
@@ -637,17 +637,17 @@ First, clone this repository and run `npm install && git submodule init && git s
In the `dist/web` folder, you should see the files you need: `pusher.js`, `pusher.min.js`, `json2.js`, `json.min.js`, `sockjs.js` and `sockjs.min.js`. `pusher.js` should be built referencing your URLs as the dependency hosts.
-First, make sure you expose all files from the `dist` directory. They need to be in a directory with named after the version number. For example, if you're hosting version 6.0.3 under `http://example.com/pusher-js` (and https for SSL), files should be accessible under following URL's:
+First, make sure you expose all files from the `dist` directory. They need to be in a directory with named after the version number. For example, if you're hosting version 7.0.0 under `http://example.com/pusher-js` (and https for SSL), files should be accessible under following URL's:
- http://example.com/pusher-js/6.0.3/pusher.js
- http://example.com/pusher-js/6.0.3/json2.js
- http://example.com/pusher-js/6.0.3/sockjs.js
+ http://example.com/pusher-js/7.0.0/pusher.js
+ http://example.com/pusher-js/7.0.0/json2.js
+ http://example.com/pusher-js/7.0.0/sockjs.js
Minified files should have `.min` in their names, as in the `dist/web` directory:
- http://example.com/pusher-js/6.0.3/pusher.min.js
- http://example.com/pusher-js/6.0.3/json2.min.js
- http://example.com/pusher-js/6.0.3/sockjs.min.js
+ http://example.com/pusher-js/7.0.0/pusher.min.js
+ http://example.com/pusher-js/7.0.0/json2.min.js
+ http://example.com/pusher-js/7.0.0/sockjs.min.js
## SockJS compatibility
diff --git a/dist/node/pusher.js b/dist/node/pusher.js
index 115087f3c..cdc14c2c0 100644
--- a/dist/node/pusher.js
+++ b/dist/node/pusher.js
@@ -1,5 +1,5 @@
/*!
- * Pusher JavaScript Library v6.0.3
+ * Pusher JavaScript Library v7.0.0
* https://pusher.com/
*
* Copyright 2020, Pusher
@@ -940,7 +940,7 @@ module.exports = HttpParser;
var Stream = __webpack_require__(5).Stream,
util = __webpack_require__(0),
driver = __webpack_require__(4),
- EventTarget = __webpack_require__(17),
+ EventTarget = __webpack_require__(16),
Event = __webpack_require__(7);
var API = function(options) {
@@ -1123,161 +1123,6 @@ module.exports = API;
"use strict";
-// Copyright (C) 2016 Dmitry Chestnykh
-// MIT License. See LICENSE file for details.
-Object.defineProperty(exports, "__esModule", { value: true });
-/**
- * Package utf8 implements UTF-8 encoding and decoding.
- */
-var INVALID_UTF16 = "utf8: invalid string";
-var INVALID_UTF8 = "utf8: invalid source encoding";
-/**
- * Encodes the given string into UTF-8 byte array.
- * Throws if the source string has invalid UTF-16 encoding.
- */
-function encode(s) {
- // Calculate result length and allocate output array.
- // encodedLength() also validates string and throws errors,
- // so we don't need repeat validation here.
- var arr = new Uint8Array(encodedLength(s));
- var pos = 0;
- for (var i = 0; i < s.length; i++) {
- var c = s.charCodeAt(i);
- if (c < 0x80) {
- arr[pos++] = c;
- }
- else if (c < 0x800) {
- arr[pos++] = 0xc0 | c >> 6;
- arr[pos++] = 0x80 | c & 0x3f;
- }
- else if (c < 0xd800) {
- arr[pos++] = 0xe0 | c >> 12;
- arr[pos++] = 0x80 | (c >> 6) & 0x3f;
- arr[pos++] = 0x80 | c & 0x3f;
- }
- else {
- i++; // get one more character
- c = (c & 0x3ff) << 10;
- c |= s.charCodeAt(i) & 0x3ff;
- c += 0x10000;
- arr[pos++] = 0xf0 | c >> 18;
- arr[pos++] = 0x80 | (c >> 12) & 0x3f;
- arr[pos++] = 0x80 | (c >> 6) & 0x3f;
- arr[pos++] = 0x80 | c & 0x3f;
- }
- }
- return arr;
-}
-exports.encode = encode;
-/**
- * Returns the number of bytes required to encode the given string into UTF-8.
- * Throws if the source string has invalid UTF-16 encoding.
- */
-function encodedLength(s) {
- var result = 0;
- for (var i = 0; i < s.length; i++) {
- var c = s.charCodeAt(i);
- if (c < 0x80) {
- result += 1;
- }
- else if (c < 0x800) {
- result += 2;
- }
- else if (c < 0xd800) {
- result += 3;
- }
- else if (c <= 0xdfff) {
- if (i >= s.length - 1) {
- throw new Error(INVALID_UTF16);
- }
- i++; // "eat" next character
- result += 4;
- }
- else {
- throw new Error(INVALID_UTF16);
- }
- }
- return result;
-}
-exports.encodedLength = encodedLength;
-/**
- * Decodes the given byte array from UTF-8 into a string.
- * Throws if encoding is invalid.
- */
-function decode(arr) {
- var chars = [];
- for (var i = 0; i < arr.length; i++) {
- var b = arr[i];
- if (b & 0x80) {
- var min = void 0;
- if (b < 0xe0) {
- // Need 1 more byte.
- if (i >= arr.length) {
- throw new Error(INVALID_UTF8);
- }
- var n1 = arr[++i];
- if ((n1 & 0xc0) !== 0x80) {
- throw new Error(INVALID_UTF8);
- }
- b = (b & 0x1f) << 6 | (n1 & 0x3f);
- min = 0x80;
- }
- else if (b < 0xf0) {
- // Need 2 more bytes.
- if (i >= arr.length - 1) {
- throw new Error(INVALID_UTF8);
- }
- var n1 = arr[++i];
- var n2 = arr[++i];
- if ((n1 & 0xc0) !== 0x80 || (n2 & 0xc0) !== 0x80) {
- throw new Error(INVALID_UTF8);
- }
- b = (b & 0x0f) << 12 | (n1 & 0x3f) << 6 | (n2 & 0x3f);
- min = 0x800;
- }
- else if (b < 0xf8) {
- // Need 3 more bytes.
- if (i >= arr.length - 2) {
- throw new Error(INVALID_UTF8);
- }
- var n1 = arr[++i];
- var n2 = arr[++i];
- var n3 = arr[++i];
- if ((n1 & 0xc0) !== 0x80 || (n2 & 0xc0) !== 0x80 || (n3 & 0xc0) !== 0x80) {
- throw new Error(INVALID_UTF8);
- }
- b = (b & 0x0f) << 18 | (n1 & 0x3f) << 12 | (n2 & 0x3f) << 6 | (n3 & 0x3f);
- min = 0x10000;
- }
- else {
- throw new Error(INVALID_UTF8);
- }
- if (b < min || (b >= 0xd800 && b <= 0xdfff)) {
- throw new Error(INVALID_UTF8);
- }
- if (b >= 0x10000) {
- // Surrogate pair.
- if (b > 0x10ffff) {
- throw new Error(INVALID_UTF8);
- }
- b -= 0x10000;
- chars.push(String.fromCharCode(0xd800 | (b >> 10)));
- b = 0xdc00 | (b & 0x3ff);
- }
- }
- chars.push(String.fromCharCode(b));
- }
- return chars.join("");
-}
-exports.decode = decode;
-//# sourceMappingURL=utf8.js.map
-
-/***/ }),
-/* 13 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
var Buffer = __webpack_require__(1).Buffer,
crypto = __webpack_require__(3),
@@ -1763,7 +1608,7 @@ module.exports = Hybi;
/***/ }),
-/* 14 */
+/* 13 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -1836,13 +1681,13 @@ module.exports = RingBuffer;
/***/ }),
-/* 15 */
+/* 14 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
-var RingBuffer = __webpack_require__(14);
+var RingBuffer = __webpack_require__(13);
var Pledge = function() {
this._complete = false;
@@ -1880,7 +1725,7 @@ module.exports = Pledge;
/***/ }),
-/* 16 */
+/* 15 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@@ -2010,7 +1855,7 @@ module.exports = Draft75;
/***/ }),
-/* 17 */
+/* 16 */
/***/ (function(module, exports, __webpack_require__) {
var Event = __webpack_require__(7);
@@ -2043,6 +1888,161 @@ var EventTarget = {
module.exports = EventTarget;
+/***/ }),
+/* 17 */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+// Copyright (C) 2016 Dmitry Chestnykh
+// MIT License. See LICENSE file for details.
+Object.defineProperty(exports, "__esModule", { value: true });
+/**
+ * Package utf8 implements UTF-8 encoding and decoding.
+ */
+var INVALID_UTF16 = "utf8: invalid string";
+var INVALID_UTF8 = "utf8: invalid source encoding";
+/**
+ * Encodes the given string into UTF-8 byte array.
+ * Throws if the source string has invalid UTF-16 encoding.
+ */
+function encode(s) {
+ // Calculate result length and allocate output array.
+ // encodedLength() also validates string and throws errors,
+ // so we don't need repeat validation here.
+ var arr = new Uint8Array(encodedLength(s));
+ var pos = 0;
+ for (var i = 0; i < s.length; i++) {
+ var c = s.charCodeAt(i);
+ if (c < 0x80) {
+ arr[pos++] = c;
+ }
+ else if (c < 0x800) {
+ arr[pos++] = 0xc0 | c >> 6;
+ arr[pos++] = 0x80 | c & 0x3f;
+ }
+ else if (c < 0xd800) {
+ arr[pos++] = 0xe0 | c >> 12;
+ arr[pos++] = 0x80 | (c >> 6) & 0x3f;
+ arr[pos++] = 0x80 | c & 0x3f;
+ }
+ else {
+ i++; // get one more character
+ c = (c & 0x3ff) << 10;
+ c |= s.charCodeAt(i) & 0x3ff;
+ c += 0x10000;
+ arr[pos++] = 0xf0 | c >> 18;
+ arr[pos++] = 0x80 | (c >> 12) & 0x3f;
+ arr[pos++] = 0x80 | (c >> 6) & 0x3f;
+ arr[pos++] = 0x80 | c & 0x3f;
+ }
+ }
+ return arr;
+}
+exports.encode = encode;
+/**
+ * Returns the number of bytes required to encode the given string into UTF-8.
+ * Throws if the source string has invalid UTF-16 encoding.
+ */
+function encodedLength(s) {
+ var result = 0;
+ for (var i = 0; i < s.length; i++) {
+ var c = s.charCodeAt(i);
+ if (c < 0x80) {
+ result += 1;
+ }
+ else if (c < 0x800) {
+ result += 2;
+ }
+ else if (c < 0xd800) {
+ result += 3;
+ }
+ else if (c <= 0xdfff) {
+ if (i >= s.length - 1) {
+ throw new Error(INVALID_UTF16);
+ }
+ i++; // "eat" next character
+ result += 4;
+ }
+ else {
+ throw new Error(INVALID_UTF16);
+ }
+ }
+ return result;
+}
+exports.encodedLength = encodedLength;
+/**
+ * Decodes the given byte array from UTF-8 into a string.
+ * Throws if encoding is invalid.
+ */
+function decode(arr) {
+ var chars = [];
+ for (var i = 0; i < arr.length; i++) {
+ var b = arr[i];
+ if (b & 0x80) {
+ var min = void 0;
+ if (b < 0xe0) {
+ // Need 1 more byte.
+ if (i >= arr.length) {
+ throw new Error(INVALID_UTF8);
+ }
+ var n1 = arr[++i];
+ if ((n1 & 0xc0) !== 0x80) {
+ throw new Error(INVALID_UTF8);
+ }
+ b = (b & 0x1f) << 6 | (n1 & 0x3f);
+ min = 0x80;
+ }
+ else if (b < 0xf0) {
+ // Need 2 more bytes.
+ if (i >= arr.length - 1) {
+ throw new Error(INVALID_UTF8);
+ }
+ var n1 = arr[++i];
+ var n2 = arr[++i];
+ if ((n1 & 0xc0) !== 0x80 || (n2 & 0xc0) !== 0x80) {
+ throw new Error(INVALID_UTF8);
+ }
+ b = (b & 0x0f) << 12 | (n1 & 0x3f) << 6 | (n2 & 0x3f);
+ min = 0x800;
+ }
+ else if (b < 0xf8) {
+ // Need 3 more bytes.
+ if (i >= arr.length - 2) {
+ throw new Error(INVALID_UTF8);
+ }
+ var n1 = arr[++i];
+ var n2 = arr[++i];
+ var n3 = arr[++i];
+ if ((n1 & 0xc0) !== 0x80 || (n2 & 0xc0) !== 0x80 || (n3 & 0xc0) !== 0x80) {
+ throw new Error(INVALID_UTF8);
+ }
+ b = (b & 0x0f) << 18 | (n1 & 0x3f) << 12 | (n2 & 0x3f) << 6 | (n3 & 0x3f);
+ min = 0x10000;
+ }
+ else {
+ throw new Error(INVALID_UTF8);
+ }
+ if (b < min || (b >= 0xd800 && b <= 0xdfff)) {
+ throw new Error(INVALID_UTF8);
+ }
+ if (b >= 0x10000) {
+ // Surrogate pair.
+ if (b > 0x10ffff) {
+ throw new Error(INVALID_UTF8);
+ }
+ b -= 0x10000;
+ chars.push(String.fromCharCode(0xd800 | (b >> 10)));
+ b = 0xdc00 | (b & 0x3ff);
+ }
+ }
+ chars.push(String.fromCharCode(b));
+ }
+ return chars.join("");
+}
+exports.decode = decode;
+//# sourceMappingURL=utf8.js.map
+
/***/ }),
/* 18 */
/***/ (function(module, exports, __webpack_require__) {
@@ -5378,7 +5378,7 @@ var Buffer = __webpack_require__(1).Buffer,
util = __webpack_require__(0),
HttpParser = __webpack_require__(10),
Base = __webpack_require__(2),
- Hybi = __webpack_require__(13),
+ Hybi = __webpack_require__(12),
Proxy = __webpack_require__(36);
var Client = function(_url, options) {
@@ -6070,7 +6070,7 @@ var instance = {
},
validFrameRsv: function(frame) {
- var allowed = {rsv1: false, rsv2: false, rsv3: false},
+ var allowed = { rsv1: false, rsv2: false, rsv3: false },
ext;
if (Extensions.MESSAGE_OPCODES.indexOf(frame.opcode) >= 0) {
@@ -6129,7 +6129,7 @@ module.exports = Extensions;
var TOKEN = /([!#\$%&'\*\+\-\.\^_`\|~0-9A-Za-z]+)/,
NOTOKEN = /([^!#\$%&'\*\+\-\.\^_`\|~0-9A-Za-z])/g,
- QUOTED = /"((?:\\[\x00-\x7f]|[^\x00-\x08\x0a-\x1f\x7f"])*)"/,
+ QUOTED = /"((?:\\[\x00-\x7f]|[^\x00-\x08\x0a-\x1f\x7f"\\])*)"/,
PARAM = new RegExp(TOKEN.source + '(?:=(?:' + TOKEN.source + '|' + QUOTED.source + '))?'),
EXT = new RegExp(TOKEN.source + '(?: *; *' + PARAM.source + ')*', 'g'),
EXT_LIST = new RegExp('^' + EXT.source + '(?: *, *' + EXT.source + ')*$'),
@@ -6210,7 +6210,7 @@ Offers.prototype.push = function(name, params) {
this._byName[name] = [];
this._byName[name].push(params);
- this._inOrder.push({name: name, params: params});
+ this._inOrder.push({ name: name, params: params });
};
Offers.prototype.eachOffer = function(callback, context) {
@@ -6238,11 +6238,11 @@ module.exports = Parser;
var Cell = __webpack_require__(32),
- Pledge = __webpack_require__(15);
+ Pledge = __webpack_require__(14);
var Pipeline = function(sessions) {
this._cells = sessions.map(function(session) { return new Cell(session) });
- this._stopped = {incoming: false, outgoing: false};
+ this._stopped = { incoming: false, outgoing: false };
};
Pipeline.prototype.processIncomingMessage = function(message, callback, context) {
@@ -6256,7 +6256,7 @@ Pipeline.prototype.processOutgoingMessage = function(message, callback, context)
};
Pipeline.prototype.close = function(callback, context) {
- this._stopped = {incoming: true, outgoing: true};
+ this._stopped = { incoming: true, outgoing: true };
var closed = this._cells.map(function(a) { return a.close() });
if (callback)
@@ -6292,7 +6292,7 @@ module.exports = Pipeline;
var Functor = __webpack_require__(33),
- Pledge = __webpack_require__(15);
+ Pledge = __webpack_require__(14);
var Cell = function(tuple) {
this._ext = tuple[0];
@@ -6351,7 +6351,7 @@ module.exports = Cell;
"use strict";
-var RingBuffer = __webpack_require__(14);
+var RingBuffer = __webpack_require__(13);
var Functor = function(session, method) {
this._session = session;
@@ -6366,7 +6366,7 @@ Functor.QUEUE_SIZE = 8;
Functor.prototype.call = function(error, message, callback, context) {
if (this._stopped) return;
- var record = {error: error, message: message, callback: callback, context: context, done: false},
+ var record = { error: error, message: message, callback: callback, context: context, done: false },
called = false,
self = this;
@@ -6608,9 +6608,9 @@ module.exports = Proxy;
var util = __webpack_require__(0),
HttpParser = __webpack_require__(10),
Base = __webpack_require__(2),
- Draft75 = __webpack_require__(16),
+ Draft75 = __webpack_require__(15),
Draft76 = __webpack_require__(38),
- Hybi = __webpack_require__(13);
+ Hybi = __webpack_require__(12);
var Server = function(options) {
Base.call(this, null, null, options);
@@ -6726,7 +6726,7 @@ module.exports = Server;
var Buffer = __webpack_require__(1).Buffer,
Base = __webpack_require__(2),
- Draft75 = __webpack_require__(16),
+ Draft75 = __webpack_require__(15),
crypto = __webpack_require__(3),
util = __webpack_require__(0);
@@ -6952,7 +6952,7 @@ var Stream = __webpack_require__(5).Stream,
driver = __webpack_require__(4),
Headers = __webpack_require__(9),
API = __webpack_require__(11),
- EventTarget = __webpack_require__(17),
+ EventTarget = __webpack_require__(16),
Event = __webpack_require__(7);
var EventSource = function(request, response, options) {
@@ -7447,7 +7447,7 @@ function safeJSONStringify(source) {
// CONCATENATED MODULE: ./src/core/defaults.ts
var Defaults = {
- VERSION: "6.0.3",
+ VERSION: "7.0.0",
PROTOCOL: 7,
wsPort: 80,
wssPort: 443,
@@ -8151,7 +8151,7 @@ var connection_Connection = (function (_super) {
_this.emit('activity');
},
error: function (error) {
- _this.emit('error', { type: 'WebSocketError', error: error });
+ _this.emit('error', error);
},
closed: function (closeEvent) {
unbindListeners();
@@ -8387,6 +8387,18 @@ var UnsupportedStrategy = (function (_super) {
return UnsupportedStrategy;
}(Error));
+var HTTPAuthError = (function (_super) {
+ errors_extends(HTTPAuthError, _super);
+ function HTTPAuthError(status, msg) {
+ var _newTarget = this.constructor;
+ var _this = _super.call(this, msg) || this;
+ _this.status = status;
+ Object.setPrototypeOf(_this, _newTarget.prototype);
+ return _this;
+ }
+ return HTTPAuthError;
+}(Error));
+
// CONCATENATED MODULE: ./src/core/utils/url_store.ts
var urlStore = {
@@ -8442,6 +8454,7 @@ var channel_extends = (undefined && undefined.__extends) || (function () {
+
var channel_Channel = (function (_super) {
channel_extends(Channel, _super);
function Channel(name, pusher) {
@@ -8456,7 +8469,7 @@ var channel_Channel = (function (_super) {
return _this;
}
Channel.prototype.authorize = function (socketId, callback) {
- return callback(false, { auth: '' });
+ return callback(null, { auth: '' });
};
Channel.prototype.trigger = function (event, data) {
if (event.indexOf('client-') !== 0) {
@@ -8502,11 +8515,13 @@ var channel_Channel = (function (_super) {
this.subscriptionCancelled = false;
this.authorize(this.pusher.connection.socket_id, function (error, data) {
if (error) {
- logger.error(data);
- _this.emit('pusher:subscription_error', data);
+ logger.error(error.toString());
+ _this.emit('pusher:subscription_error', Object.assign({}, {
+ type: 'AuthError',
+ error: error.message
+ }, error instanceof HTTPAuthError ? { status: error.status } : {}));
}
else {
- data = data;
_this.pusher.send_event('pusher:subscribe', {
auth: data.auth,
channel_data: data.channel_data,
@@ -8712,7 +8727,7 @@ var presence_channel_PresenceChannel = (function (_super) {
/* harmony default export */ var presence_channel = (presence_channel_PresenceChannel);
// EXTERNAL MODULE: ./node_modules/@stablelib/utf8/lib/utf8.js
-var utf8 = __webpack_require__(12);
+var utf8 = __webpack_require__(17);
// EXTERNAL MODULE: ./node_modules/@stablelib/base64/lib/base64.js
var base64 = __webpack_require__(8);
@@ -8748,18 +8763,17 @@ var encrypted_channel_EncryptedChannel = (function (_super) {
var _this = this;
_super.prototype.authorize.call(this, socketId, function (error, authData) {
if (error) {
- callback(true, authData);
+ callback(error, authData);
return;
}
var sharedSecret = authData['shared_secret'];
if (!sharedSecret) {
- var errorMsg = "No shared_secret key in auth payload for encrypted channel: " + _this.name;
- callback(true, errorMsg);
+ callback(new Error("No shared_secret key in auth payload for encrypted channel: " + _this.name), null);
return;
}
_this.key = Object(base64["decode"])(sharedSecret);
delete authData['shared_secret'];
- callback(false, authData);
+ callback(null, authData);
});
};
EncryptedChannel.prototype.trigger = function (event, data) {
@@ -8809,21 +8823,21 @@ var encrypted_channel_EncryptedChannel = (function (_super) {
logger.error("Failed to decrypt event with new key. Dropping encrypted event");
return;
}
- _this.emitJSON(event, Object(utf8["decode"])(bytes));
+ _this.emit(event, _this.getDataToEmit(bytes));
return;
});
return;
}
- this.emitJSON(event, Object(utf8["decode"])(bytes));
+ this.emit(event, this.getDataToEmit(bytes));
};
- EncryptedChannel.prototype.emitJSON = function (eventName, data) {
+ EncryptedChannel.prototype.getDataToEmit = function (bytes) {
+ var raw = Object(utf8["decode"])(bytes);
try {
- this.emit(eventName, JSON.parse(data));
+ return JSON.parse(raw);
}
- catch (e) {
- this.emit(eventName, data);
+ catch (_a) {
+ return raw;
}
- return this;
};
return EncryptedChannel;
}(private_channel));
@@ -9021,7 +9035,7 @@ var connection_manager_ConnectionManager = (function (_super) {
_this.resetActivityCheck();
},
error: function (error) {
- _this.emit('error', { type: 'WebSocketError', error: error });
+ _this.emit('error', error);
},
closed: function () {
_this.abandonConnection();
@@ -10126,25 +10140,25 @@ var ajax = function (context, socketId, callback) {
xhr.onreadystatechange = function () {
if (xhr.readyState === 4) {
if (xhr.status === 200) {
- var data, parsed = false;
+ var data = void 0;
+ var parsed = false;
try {
data = JSON.parse(xhr.responseText);
parsed = true;
}
catch (e) {
- callback(true, 'JSON returned from auth endpoint was invalid, yet status code was 200. Data was: ' +
- xhr.responseText);
+ callback(new HTTPAuthError(200, 'JSON returned from auth endpoint was invalid, yet status code was 200. Data was: ' +
+ xhr.responseText), { auth: '' });
}
if (parsed) {
- callback(false, data);
+ callback(null, data);
}
}
else {
var suffix = url_store.buildLogSuffix('authenticationEndpoint');
- logger.error('Unable to retrieve auth string from auth endpoint - ' +
- ("received status " + xhr.status + " from " + self.options.authEndpoint + ". ") +
- ("Clients must be authenticated to join private or presence channels. " + suffix));
- callback(true, xhr.status);
+ callback(new HTTPAuthError(xhr.status, 'Unable to retrieve auth string from auth endpoint - ' +
+ ("received status: " + xhr.status + " from " + self.options.authEndpoint + ". ") +
+ ("Clients must be authenticated to join private or presence channels. " + suffix)), { auth: '' });
}
}
};
diff --git a/dist/react-native/pusher.js b/dist/react-native/pusher.js
index a7526c78f..354146525 100644
--- a/dist/react-native/pusher.js
+++ b/dist/react-native/pusher.js
@@ -1,8 +1,8 @@
/*!
- * Pusher JavaScript Library v6.0.3
+ * Pusher JavaScript Library v7.0.0
* https://pusher.com/
*
* Copyright 2020, Pusher
* Released under the MIT licence.
*/
-module.exports=function(t){var n={};function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)e.d(r,o,function(n){return t[n]}.bind(null,o));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=14)}([function(t,n,e){"use strict";(function(t){e.d(n,"f",(function(){return i})),e.d(n,"m",(function(){return s})),e.d(n,"d",(function(){return a})),e.d(n,"k",(function(){return c})),e.d(n,"i",(function(){return u})),e.d(n,"n",(function(){return h})),e.d(n,"c",(function(){return f})),e.d(n,"j",(function(){return p})),e.d(n,"g",(function(){return l})),e.d(n,"h",(function(){return d})),e.d(n,"b",(function(){return y})),e.d(n,"a",(function(){return g})),e.d(n,"e",(function(){return b})),e.d(n,"l",(function(){return m}));var r=e(11),o=e(2);function i(t){for(var n=[],e=1;e0)for(o=0;o=1002&&t.code<=1004?"backoff":null:4e3===t.code?"tls_only":t.code<4100?"refused":t.code<4200?"backoff":t.code<4300?"retry":"refused"},getCloseError:function(t){return 1e3!==t.code&&1001!==t.code?{type:"PusherError",data:{code:t.code,message:t.reason||t.message}}:null}},T=k,C=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(n,e)};return function(n,e){function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),O=function(t){function n(n,e){var r=t.call(this)||this;return r.id=n,r.transport=e,r.activityTimeout=e.activityTimeout,r.bindListeners(),r}return C(n,t),n.prototype.handlesActivityChecks=function(){return this.transport.handlesActivityChecks()},n.prototype.send=function(t){return this.transport.send(t)},n.prototype.send_event=function(t,n,e){var r={event:t,data:n};return e&&(r.channel=e),p.a.debug("Event sent",r),this.send(T.encodeMessage(r))},n.prototype.ping=function(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})},n.prototype.close=function(){this.transport.close()},n.prototype.bindListeners=function(){var t=this,n={message:function(n){var e;try{e=T.decodeMessage(n)}catch(e){t.emit("error",{type:"MessageParseError",error:e,data:n.data})}if(void 0!==e){switch(p.a.debug("Event recd",e),e.event){case"pusher:error":t.emit("error",{type:"PusherError",data:e.data});break;case"pusher:ping":t.emit("ping");break;case"pusher:pong":t.emit("pong")}t.emit("message",e)}},activity:function(){t.emit("activity")},error:function(n){t.emit("error",{type:"WebSocketError",error:n})},closed:function(n){e(),n&&n.code&&t.handleCloseEvent(n),t.transport=null,t.emit("closed")}},e=function(){r.k(n,(function(n,e){t.transport.unbind(e,n)}))};r.k(n,(function(n,e){t.transport.bind(e,n)}))},n.prototype.handleCloseEvent=function(t){var n=T.getCloseAction(t),e=T.getCloseError(t);e&&this.emit("error",e),n&&this.emit(n,{action:n,error:e})},n}(f.a),P=function(){function t(t,n){this.transport=t,this.callback=n,this.bindListeners()}return t.prototype.close=function(){this.unbindListeners(),this.transport.close()},t.prototype.bindListeners=function(){var t=this;this.onMessage=function(n){var e;t.unbindListeners();try{e=T.processHandshake(n)}catch(n){return t.finish("error",{error:n}),void t.transport.close()}"connected"===e.action?t.finish("connected",{connection:new O(e.id,t.transport),activityTimeout:e.activityTimeout}):(t.finish(e.action,{error:e.error}),t.transport.close())},this.onClosed=function(n){t.unbindListeners();var e=T.getCloseAction(n)||"backoff",r=T.getCloseError(n);t.finish(e,{error:r})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)},t.prototype.unbindListeners=function(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)},t.prototype.finish=function(t,n){this.callback(r.f({transport:this.transport,action:t},n))},t}(),A=function(){function t(t,n){this.channel=t;var e=n.authTransport;if(void 0===Ut.getAuthorizers()[e])throw"'"+e+"' is not a recognized auth transport";this.type=e,this.options=n,this.authOptions=n.auth||{}}return t.prototype.composeQuery=function(t){var n="socket_id="+encodeURIComponent(t)+"&channel_name="+encodeURIComponent(this.channel.name);for(var e in this.authOptions.params)n+="&"+encodeURIComponent(e)+"="+encodeURIComponent(this.authOptions.params[e]);return n},t.prototype.authorize=function(n,e){t.authorizers=t.authorizers||Ut.getAuthorizers(),t.authorizers[this.type].call(this,Ut,n,e)},t}(),E=function(){function t(t,n){this.timeline=t,this.options=n||{}}return t.prototype.send=function(t,n){this.timeline.isEmpty()||this.timeline.send(Ut.TimelineTransport.getAgent(this,t),n)},t}(),x=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(n,e)};return function(n,e){function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),L=function(t){function n(n){var e=this.constructor,r=t.call(this,n)||this;return Object.setPrototypeOf(r,e.prototype),r}return x(n,t),n}(Error),U=(function(t){function n(n){var e=this.constructor,r=t.call(this,n)||this;return Object.setPrototypeOf(r,e.prototype),r}x(n,t)}(Error),function(t){function n(n){var e=this.constructor,r=t.call(this,n)||this;return Object.setPrototypeOf(r,e.prototype),r}return x(n,t),n}(Error)),M=function(t){function n(n){var e=this.constructor,r=t.call(this,n)||this;return Object.setPrototypeOf(r,e.prototype),r}return x(n,t),n}(Error),R=function(t){function n(n){var e=this.constructor,r=t.call(this,n)||this;return Object.setPrototypeOf(r,e.prototype),r}return x(n,t),n}(Error),j=function(t){function n(n){var e=this.constructor,r=t.call(this,n)||this;return Object.setPrototypeOf(r,e.prototype),r}return x(n,t),n}(Error),I=function(t){function n(n){var e=this.constructor,r=t.call(this,n)||this;return Object.setPrototypeOf(r,e.prototype),r}return x(n,t),n}(Error),N={baseUrl:"https://pusher.com",urls:{authenticationEndpoint:{path:"/docs/authenticating_users"},javascriptQuickStart:{path:"/docs/javascript_quick_start"},triggeringClientEvents:{path:"/docs/client_api_guide/client_events#trigger-events"},encryptedChannelSupport:{fullUrl:"https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support"}}},B=function(t){var n,e=N.urls[t];return e?(e.fullUrl?n=e.fullUrl:e.path&&(n=N.baseUrl+e.path),n?"See: "+n:""):""},D=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(n,e)};return function(n,e){function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),H=function(t){function n(n,e){var r=t.call(this,(function(t,e){p.a.debug("No callbacks on "+n+" for "+t)}))||this;return r.name=n,r.pusher=e,r.subscribed=!1,r.subscriptionPending=!1,r.subscriptionCancelled=!1,r}return D(n,t),n.prototype.authorize=function(t,n){return n(!1,{auth:""})},n.prototype.trigger=function(t,n){if(0!==t.indexOf("client-"))throw new L("Event '"+t+"' does not start with 'client-'");if(!this.subscribed){var e=B("triggeringClientEvents");p.a.warn("Client event triggered before channel 'subscription_succeeded' event . "+e)}return this.pusher.send_event(t,n,this.name)},n.prototype.disconnect=function(){this.subscribed=!1,this.subscriptionPending=!1},n.prototype.handleEvent=function(t){var n=t.event,e=t.data;if("pusher_internal:subscription_succeeded"===n)this.handleSubscriptionSucceededEvent(t);else if(0!==n.indexOf("pusher_internal:")){this.emit(n,e,{})}},n.prototype.handleSubscriptionSucceededEvent=function(t){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",t.data)},n.prototype.subscribe=function(){var t=this;this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,(function(n,e){n?(p.a.error(e),t.emit("pusher:subscription_error",e)):(e=e,t.pusher.send_event("pusher:subscribe",{auth:e.auth,channel_data:e.channel_data,channel:t.name}))})))},n.prototype.unsubscribe=function(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})},n.prototype.cancelSubscription=function(){this.subscriptionCancelled=!0},n.prototype.reinstateSubscription=function(){this.subscriptionCancelled=!1},n}(f.a),z=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(n,e)};return function(n,e){function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),F=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return z(n,t),n.prototype.authorize=function(t,n){return tt.createAuthorizer(this,this.pusher.config).authorize(t,n)},n}(H),q=function(){function t(){this.reset()}return t.prototype.get=function(t){return Object.prototype.hasOwnProperty.call(this.members,t)?{id:t,info:this.members[t]}:null},t.prototype.each=function(t){var n=this;r.k(this.members,(function(e,r){t(n.get(r))}))},t.prototype.setMyID=function(t){this.myID=t},t.prototype.onSubscription=function(t){this.members=t.presence.hash,this.count=t.presence.count,this.me=this.get(this.myID)},t.prototype.addMember=function(t){return null===this.get(t.user_id)&&this.count++,this.members[t.user_id]=t.user_info,this.get(t.user_id)},t.prototype.removeMember=function(t){var n=this.get(t.user_id);return n&&(delete this.members[t.user_id],this.count--),n},t.prototype.reset=function(){this.members={},this.count=0,this.myID=null,this.me=null},t}(),Y=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(n,e)};return function(n,e){function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),K=function(t){function n(n,e){var r=t.call(this,n,e)||this;return r.members=new q,r}return Y(n,t),n.prototype.authorize=function(n,e){var r=this;t.prototype.authorize.call(this,n,(function(t,n){if(!t){if(void 0===(n=n).channel_data){var o=B("authenticationEndpoint");return p.a.error("Invalid auth response for channel '"+r.name+"',expected 'channel_data' field. "+o),void e("Invalid auth response")}var i=JSON.parse(n.channel_data);r.members.setMyID(i.user_id)}e(t,n)}))},n.prototype.handleEvent=function(t){var n=t.event;if(0===n.indexOf("pusher_internal:"))this.handleInternalEvent(t);else{var e=t.data,r={};t.user_id&&(r.user_id=t.user_id),this.emit(n,e,r)}},n.prototype.handleInternalEvent=function(t){var n=t.event,e=t.data;switch(n){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(t);break;case"pusher_internal:member_added":var r=this.members.addMember(e);this.emit("pusher:member_added",r);break;case"pusher_internal:member_removed":var o=this.members.removeMember(e);o&&this.emit("pusher:member_removed",o)}},n.prototype.handleSubscriptionSucceededEvent=function(t){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(t.data),this.emit("pusher:subscription_succeeded",this.members))},n.prototype.disconnect=function(){this.members.reset(),t.prototype.disconnect.call(this)},n}(F),J=e(9),X=e(7),W=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(n,e)};return function(n,e){function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),G=function(t){function n(n,e,r){var o=t.call(this,n,e)||this;return o.key=null,o.nacl=r,o}return W(n,t),n.prototype.authorize=function(n,e){var r=this;t.prototype.authorize.call(this,n,(function(t,n){if(t)e(!0,n);else{var o=n.shared_secret;if(o)r.key=Object(X.decode)(o),delete n.shared_secret,e(!1,n);else{var i="No shared_secret key in auth payload for encrypted channel: "+r.name;e(!0,i)}}}))},n.prototype.trigger=function(t,n){throw new R("Client events are not currently supported for encrypted channels")},n.prototype.handleEvent=function(n){var e=n.event,r=n.data;0!==e.indexOf("pusher_internal:")&&0!==e.indexOf("pusher:")?this.handleEncryptedEvent(e,r):t.prototype.handleEvent.call(this,n)},n.prototype.handleEncryptedEvent=function(t,n){var e=this;if(this.key)if(n.ciphertext&&n.nonce){var r=Object(X.decode)(n.ciphertext);if(r.length0&&this.emit("connecting_in",Math.round(t/1e3)),this.retryTimer=new V.a(t||0,(function(){n.disconnectInternally(),n.connect()}))},n.prototype.clearRetryTimer=function(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)},n.prototype.setUnavailableTimer=function(){var t=this;this.unavailableTimer=new V.a(this.options.unavailableTimeout,(function(){t.updateState("unavailable")}))},n.prototype.clearUnavailableTimer=function(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()},n.prototype.sendActivityCheck=function(){var t=this;this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new V.a(this.options.pongTimeout,(function(){t.timeline.error({pong_timed_out:t.options.pongTimeout}),t.retryIn(0)}))},n.prototype.resetActivityCheck=function(){var t=this;this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new V.a(this.activityTimeout,(function(){t.sendActivityCheck()})))},n.prototype.stopActivityCheck=function(){this.activityTimer&&this.activityTimer.ensureAborted()},n.prototype.buildConnectionCallbacks=function(t){var n=this;return r.f({},t,{message:function(t){n.resetActivityCheck(),n.emit("message",t)},ping:function(){n.send_event("pusher:pong",{})},activity:function(){n.resetActivityCheck()},error:function(t){n.emit("error",{type:"WebSocketError",error:t})},closed:function(){n.abandonConnection(),n.shouldRetry()&&n.retryIn(1e3)}})},n.prototype.buildHandshakeCallbacks=function(t){var n=this;return r.f({},t,{connected:function(t){n.activityTimeout=Math.min(n.options.activityTimeout,t.activityTimeout,t.connection.activityTimeout||1/0),n.clearUnavailableTimer(),n.setConnection(t.connection),n.socket_id=n.connection.id,n.updateState("connected",{socket_id:n.socket_id})}})},n.prototype.buildErrorCallbacks=function(){var t=this,n=function(n){return function(e){e.error&&t.emit("error",{type:"WebSocketError",error:e.error}),n(e)}};return{tls_only:n((function(){t.usingTLS=!0,t.updateStrategy(),t.retryIn(0)})),refused:n((function(){t.disconnect()})),backoff:n((function(){t.retryIn(1e3)})),retry:n((function(){t.retryIn(0)}))}},n.prototype.setConnection=function(t){for(var n in this.connection=t,this.connectionCallbacks)this.connection.bind(n,this.connectionCallbacks[n]);this.resetActivityCheck()},n.prototype.abandonConnection=function(){if(this.connection){for(var t in this.stopActivityCheck(),this.connectionCallbacks)this.connection.unbind(t,this.connectionCallbacks[t]);var n=this.connection;return this.connection=null,n}},n.prototype.updateState=function(t,n){var e=this.state;if(this.state=t,e!==t){var r=t;"connected"===r&&(r+=" with new socket ID "+n.socket_id),p.a.debug("State changed",e+" -> "+r),this.timeline.info({state:t,params:n}),this.emit("state_change",{previous:e,current:t}),this.emit(t,n)}},n.prototype.shouldRetry=function(){return"connecting"===this.state||"connected"===this.state},n}(f.a),$=function(){function t(){this.channels={}}return t.prototype.add=function(t,n){return this.channels[t]||(this.channels[t]=function(t,n){if(0===t.indexOf("private-encrypted-")){if(n.config.nacl)return tt.createEncryptedChannel(t,n,n.config.nacl);var e=B("encryptedChannelSupport");throw new R("Tried to subscribe to a private-encrypted- channel but no nacl implementation available. "+e)}return 0===t.indexOf("private-")?tt.createPrivateChannel(t,n):0===t.indexOf("presence-")?tt.createPresenceChannel(t,n):tt.createChannel(t,n)}(t,n)),this.channels[t]},t.prototype.all=function(){return r.n(this.channels)},t.prototype.find=function(t){return this.channels[t]},t.prototype.remove=function(t){var n=this.channels[t];return delete this.channels[t],n},t.prototype.disconnect=function(){r.k(this.channels,(function(t){t.disconnect()}))},t}();var tt={createChannels:function(){return new $},createConnectionManager:function(t,n){return new Q(t,n)},createChannel:function(t,n){return new H(t,n)},createPrivateChannel:function(t,n){return new F(t,n)},createPresenceChannel:function(t,n){return new K(t,n)},createEncryptedChannel:function(t,n,e){return new G(t,n,e)},createTimelineSender:function(t,n){return new E(t,n)},createAuthorizer:function(t,n){return n.authorizer?n.authorizer(t,n):new A(t,n)},createHandshake:function(t,n){return new P(t,n)},createAssistantToTheTransportManager:function(t,n,e){return new S(t,n,e)}},nt=function(){function t(t){this.options=t||{},this.livesLeft=this.options.lives||1/0}return t.prototype.getAssistant=function(t){return tt.createAssistantToTheTransportManager(this,t,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})},t.prototype.isAlive=function(){return this.livesLeft>0},t.prototype.reportDeath=function(){this.livesLeft-=1},t}(),et=function(){function t(t,n){this.strategies=t,this.loop=Boolean(n.loop),this.failFast=Boolean(n.failFast),this.timeout=n.timeout,this.timeoutLimit=n.timeoutLimit}return t.prototype.isSupported=function(){return r.b(this.strategies,h.a.method("isSupported"))},t.prototype.connect=function(t,n){var e=this,r=this.strategies,o=0,i=this.timeout,s=null,a=function(c,u){u?n(null,u):(o+=1,e.loop&&(o%=r.length),o0&&(o=new V.a(e.timeout,(function(){i.abort(),r(!0)}))),i=t.connect(n,(function(t,n){t&&o&&o.isRunning()&&!e.failFast||(o&&o.ensureAborted(),r(t,n))})),{abort:function(){o&&o.ensureAborted(),i.abort()},forceMinPriority:function(t){i.forceMinPriority(t)}}},t}(),rt=function(){function t(t){this.strategies=t}return t.prototype.isSupported=function(){return r.b(this.strategies,h.a.method("isSupported"))},t.prototype.connect=function(t,n){return function(t,n,e){var o=r.j(t,(function(t,r,o,i){return t.connect(n,e(r,i))}));return{abort:function(){r.c(o,ot)},forceMinPriority:function(t){r.c(o,(function(n){n.forceMinPriority(t)}))}}}(this.strategies,t,(function(t,e){return function(o,i){e[t].error=o,o?function(t){return r.a(t,(function(t){return Boolean(t.error)}))}(e)&&n(!0):(r.c(e,(function(t){t.forceMinPriority(i.transport.priority)})),n(null,i))}}))},t}();function ot(t){t.error||t.aborted||(t.abort(),t.aborted=!0)}var it=function(){function t(t,n,e){this.strategy=t,this.transports=n,this.ttl=e.ttl||18e5,this.usingTLS=e.useTLS,this.timeline=e.timeline}return t.prototype.isSupported=function(){return this.strategy.isSupported()},t.prototype.connect=function(t,n){var e=this.usingTLS,o=function(t){var n=Ut.getLocalStorage();if(n)try{var e=n[st(t)];if(e)return JSON.parse(e)}catch(n){at(t)}return null}(e),i=[this.strategy];if(o&&o.timestamp+this.ttl>=h.a.now()){var s=this.transports[o.transport];s&&(this.timeline.info({cached:!0,transport:o.transport,latency:o.latency}),i.push(new et([s],{timeout:2*o.latency+1e3,failFast:!0})))}var a=h.a.now(),c=i.pop().connect(t,(function o(s,u){s?(at(e),i.length>0?(a=h.a.now(),c=i.pop().connect(t,o)):n(s)):(!function(t,n,e){var o=Ut.getLocalStorage();if(o)try{o[st(t)]=r.l({timestamp:h.a.now(),transport:n,latency:e})}catch(t){}}(e,u.transport.name,h.a.now()-a),n(null,u))}));return{abort:function(){c.abort()},forceMinPriority:function(n){t=n,c&&c.forceMinPriority(n)}}},t}();function st(t){return"pusherTransport"+(t?"TLS":"NonTLS")}function at(t){var n=Ut.getLocalStorage();if(n)try{delete n[st(t)]}catch(t){}}var ct=function(){function t(t,n){var e=n.delay;this.strategy=t,this.options={delay:e}}return t.prototype.isSupported=function(){return this.strategy.isSupported()},t.prototype.connect=function(t,n){var e,r=this.strategy,o=new V.a(this.options.delay,(function(){e=r.connect(t,n)}));return{abort:function(){o.ensureAborted(),e&&e.abort()},forceMinPriority:function(n){t=n,e&&e.forceMinPriority(n)}}},t}(),ut=function(){function t(t,n,e){this.test=t,this.trueBranch=n,this.falseBranch=e}return t.prototype.isSupported=function(){return(this.test()?this.trueBranch:this.falseBranch).isSupported()},t.prototype.connect=function(t,n){return(this.test()?this.trueBranch:this.falseBranch).connect(t,n)},t}(),ht=function(){function t(t){this.strategy=t}return t.prototype.isSupported=function(){return this.strategy.isSupported()},t.prototype.connect=function(t,n){var e=this.strategy.connect(t,(function(t,r){r&&e.abort(),n(t,r)}));return e},t}();function ft(t){return function(){return t.isSupported()}}var pt,lt=function(t,n,e){var o={};function i(n,r,i,s,a){var c=e(t,n,r,i,s,a);return o[n]=c,c}var s,a=Object.assign({},n,{hostNonTLS:t.wsHost+":"+t.wsPort,hostTLS:t.wsHost+":"+t.wssPort,httpPath:t.wsPath}),c=r.f({},a,{useTLS:!0}),u=Object.assign({},n,{hostNonTLS:t.httpHost+":"+t.httpPort,hostTLS:t.httpHost+":"+t.httpsPort,httpPath:t.httpPath}),h={loop:!0,timeout:15e3,timeoutLimit:6e4},f=new nt({lives:2,minPingDelay:1e4,maxPingDelay:t.activityTimeout}),p=new nt({lives:2,minPingDelay:1e4,maxPingDelay:t.activityTimeout}),l=i("ws","ws",3,a,f),d=i("wss","ws",3,c,f),y=i("xhr_streaming","xhr_streaming",1,u,p),g=i("xhr_polling","xhr_polling",1,u),v=new et([l],h),b=new et([d],h),m=new et([y],h),_=new et([g],h),w=new et([new ut(ft(m),new rt([m,new ct(_,{delay:4e3})]),_)],h);return s=n.useTLS?new rt([v,new ct(w,{delay:2e3})]):new rt([v,new ct(b,{delay:2e3}),new ct(w,{delay:5e3})]),new it(new ht(new ut(ft(l),s,w)),o,{ttl:18e5,timeline:n.timeline,useTLS:n.useTLS})},dt=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(n,e)};return function(n,e){function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),yt=function(t){function n(n,e,r){var o=t.call(this)||this;return o.hooks=n,o.method=e,o.url=r,o}return dt(n,t),n.prototype.start=function(t){var n=this;this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=function(){n.close()},Ut.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(t)},n.prototype.close=function(){this.unloader&&(Ut.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)},n.prototype.onChunk=function(t,n){for(;;){var e=this.advanceBuffer(n);if(!e)break;this.emit("chunk",{status:t,data:e})}this.isBufferTooLong(n)&&this.emit("buffer_too_long")},n.prototype.advanceBuffer=function(t){var n=t.slice(this.position),e=n.indexOf("\n");return-1!==e?(this.position+=e+1,n.slice(0,e)):null},n.prototype.isBufferTooLong=function(t){return this.position===t.length&&t.length>262144},n}(f.a);!function(t){t[t.CONNECTING=0]="CONNECTING",t[t.OPEN=1]="OPEN",t[t.CLOSED=3]="CLOSED"}(pt||(pt={}));var gt=pt,vt=1;function bt(t){var n=-1===t.indexOf("?")?"?":"&";return t+n+"t="+ +new Date+"&n="+vt++}function mt(t){return Math.floor(Math.random()*t)}var _t=function(){function t(t,n){this.hooks=t,this.session=mt(1e3)+"/"+function(t){for(var n=[],e=0;e0&&t.onChunk(n.status,n.responseText);break;case 4:n.responseText&&n.responseText.length>0&&t.onChunk(n.status,n.responseText),t.emit("finished",n.status),t.close()}},n},abortRequest:function(t){t.onreadystatechange=null,t.abort()}},Tt={getDefaultStrategy:lt,Transports:w,transportConnectionInitializer:function(){this.timeline.info(this.buildTimelineMessage({transport:this.name+(this.options.useTLS?"s":"")})),this.hooks.isInitialized()?this.changeState("initialized"):this.onClose()},HTTPFactory:{createStreamingSocket:function(t){return this.createSocket(wt,t)},createPollingSocket:function(t){return this.createSocket(St,t)},createSocket:function(t,n){return new _t(t,n)},createXHR:function(t,n){return this.createRequest(kt,t,n)},createRequest:function(t,n,e){return new yt(t,n,e)}},setup:function(t){t.ready()},getLocalStorage:function(){},getClientFeatures:function(){return r.i(r.h({ws:w.ws},(function(t){return t.isSupported({})})))},getProtocol:function(){return"http:"},isXHRSupported:function(){return!0},createSocketRequest:function(t,n){if(this.isXHRSupported())return this.HTTPFactory.createXHR(t,n);throw"Cross-origin HTTP requests are not supported"},createXHR:function(){return new(this.getXHRAPI())},createWebSocket:function(t){return new(this.getWebSocketAPI())(t)},addUnloadListener:function(t){},removeUnloadListener:function(t){}},Ct=e(10),Ot=e.n(Ct),Pt=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(n,e)};return function(n,e){function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}();function At(t){return"none"!==t.type.toLowerCase()}var Et,xt=new(function(t){function n(){var n=t.call(this)||this;return n.online=!0,Ot.a.fetch().then((function(t){n.online=At(t)})),Ot.a.addEventListener((function(t){var e=At(t);n.online!==e&&(n.online=e,n.online?n.emit("online"):n.emit("offline"))})),n}return Pt(n,t),n.prototype.isOnline=function(){return this.online},n}(f.a)),Lt=function(t,n,e){var r,o=this;for(var i in(r=Ut.createXHR()).open("POST",o.options.authEndpoint,!0),r.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),this.authOptions.headers)r.setRequestHeader(i,this.authOptions.headers[i]);return r.onreadystatechange=function(){if(4===r.readyState)if(200===r.status){var t,n=!1;try{t=JSON.parse(r.responseText),n=!0}catch(t){e(!0,"JSON returned from auth endpoint was invalid, yet status code was 200. Data was: "+r.responseText)}n&&e(!1,t)}else{var i=B("authenticationEndpoint");p.a.error("Unable to retrieve auth string from auth endpoint - received status "+r.status+" from "+o.options.authEndpoint+". Clients must be authenticated to join private or presence channels. "+i),e(!0,r.status)}},r.send(this.composeQuery(n)),r},Ut={getDefaultStrategy:Tt.getDefaultStrategy,Transports:Tt.Transports,setup:Tt.setup,getProtocol:Tt.getProtocol,isXHRSupported:Tt.isXHRSupported,getLocalStorage:Tt.getLocalStorage,createXHR:Tt.createXHR,createWebSocket:Tt.createWebSocket,addUnloadListener:Tt.addUnloadListener,removeUnloadListener:Tt.removeUnloadListener,transportConnectionInitializer:Tt.transportConnectionInitializer,createSocketRequest:Tt.createSocketRequest,HTTPFactory:Tt.HTTPFactory,TimelineTransport:{name:"xhr",getAgent:function(t,n){return function(e,o){var i="http"+(n?"s":"")+"://"+(t.host||t.options.host)+t.options.path;i+="/2?"+r.e(e);var s=Ut.createXHR();s.open("GET",i,!0),s.onreadystatechange=function(){if(4===s.readyState){var n=s.status,e=s.responseText;if(200!==n)return void p.a.debug("TimelineSender Error: received "+n+" from stats.pusher.com");try{var r=JSON.parse(e).host}catch(t){p.a.debug("TimelineSenderError: invalid response "+e)}r&&(t.host=r)}},s.send()}}},getAuthorizers:function(){return{ajax:Lt}},getWebSocketAPI:function(){return WebSocket},getXHRAPI:function(){return XMLHttpRequest},getNetwork:function(){return xt}};!function(t){t[t.ERROR=3]="ERROR",t[t.INFO=6]="INFO",t[t.DEBUG=7]="DEBUG"}(Et||(Et={}));var Mt=Et,Rt=function(){function t(t,n,e){this.key=t,this.session=n,this.events=[],this.options=e||{},this.sent=0,this.uniqueID=0}return t.prototype.log=function(t,n){t<=this.options.level&&(this.events.push(r.f({},n,{timestamp:h.a.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())},t.prototype.error=function(t){this.log(Mt.ERROR,t)},t.prototype.info=function(t){this.log(Mt.INFO,t)},t.prototype.debug=function(t){this.log(Mt.DEBUG,t)},t.prototype.isEmpty=function(){return 0===this.events.length},t.prototype.send=function(t,n){var e=this,o=r.f({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],t(o,(function(t,r){t||e.sent++,n&&n(t,r)})),!0},t.prototype.generateUniqueID=function(){return this.uniqueID++,this.uniqueID},t}(),jt=function(){function t(t,n,e,r){this.name=t,this.priority=n,this.transport=e,this.options=r||{}}return t.prototype.isSupported=function(){return this.transport.isSupported({useTLS:this.options.useTLS})},t.prototype.connect=function(t,n){var e=this;if(!this.isSupported())return It(new I,n);if(this.priority>>18&63),n+=this._encodeByte(r>>>12&63),n+=this._encodeByte(r>>>6&63),n+=this._encodeByte(r>>>0&63)}var o=t.length-e;if(o>0){r=t[e]<<16|(2===o?t[e+1]<<8:0);n+=this._encodeByte(r>>>18&63),n+=this._encodeByte(r>>>12&63),n+=2===o?this._encodeByte(r>>>6&63):this._paddingCharacter||"",n+=this._paddingCharacter||""}return n},t.prototype.maxDecodedLength=function(t){return this._paddingCharacter?t/4*3|0:(6*t+7)/8|0},t.prototype.decodedLength=function(t){return this.maxDecodedLength(t.length-this._getPaddingLength(t))},t.prototype.decode=function(t){if(0===t.length)return new Uint8Array(0);for(var n=this._getPaddingLength(t),e=t.length-n,r=new Uint8Array(this.maxDecodedLength(e)),o=0,i=0,s=0,a=0,c=0,u=0,h=0;i>>4,r[o++]=c<<4|u>>>2,r[o++]=u<<6|h,s|=256&a,s|=256&c,s|=256&u,s|=256&h;if(i>>4,s|=256&a,s|=256&c),i>>2,s|=256&u),i>>8&6,n+=51-t>>>8&-75,n+=61-t>>>8&-15,n+=62-t>>>8&3,String.fromCharCode(n)},t.prototype._decodeChar=function(t){var n=256;return n+=(42-t&t-44)>>>8&-256+t-43+62,n+=(46-t&t-48)>>>8&-256+t-47+63,n+=(47-t&t-58)>>>8&-256+t-48+52,n+=(64-t&t-91)>>>8&-256+t-65+0,n+=(96-t&t-123)>>>8&-256+t-97+26},t.prototype._getPaddingLength=function(t){var n=0;if(this._paddingCharacter){for(var e=t.length-1;e>=0&&t[e]===this._paddingCharacter;e--)n++;if(t.length<4||n>2)throw new Error("Base64Coder: incorrect padding")}return n},t}();n.Coder=i;var s=new i;n.encode=function(t){return s.encode(t)},n.decode=function(t){return s.decode(t)};var a=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return o(n,t),n.prototype._encodeByte=function(t){var n=t;return n+=65,n+=25-t>>>8&6,n+=51-t>>>8&-75,n+=61-t>>>8&-13,n+=62-t>>>8&49,String.fromCharCode(n)},n.prototype._decodeChar=function(t){var n=256;return n+=(44-t&t-46)>>>8&-256+t-45+62,n+=(94-t&t-96)>>>8&-256+t-95+63,n+=(47-t&t-58)>>>8&-256+t-48+52,n+=(64-t&t-91)>>>8&-256+t-65+0,n+=(96-t&t-123)>>>8&-256+t-97+26},n}(i);n.URLSafeCoder=a;var c=new a;n.encodeURLSafe=function(t){return c.encode(t)},n.decodeURLSafe=function(t){return c.decode(t)},n.encodedLength=function(t){return s.encodedLength(t)},n.maxDecodedLength=function(t){return s.maxDecodedLength(t)},n.decodedLength=function(t){return s.decodedLength(t)}},function(t,n,e){"use strict";var r=function(){function t(t,n,e,r){var o=this;this.clear=n,this.timer=t((function(){o.timer&&(o.timer=r(o.timer))}),e)}return t.prototype.isRunning=function(){return null!==this.timer},t.prototype.ensureAborted=function(){this.timer&&(this.clear(this.timer),this.timer=null)},t}();n.a=r},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r="utf8: invalid source encoding";function o(t){for(var n=0,e=0;e=t.length-1)throw new Error("utf8: invalid string");e++,n+=4}}return n}n.encode=function(t){for(var n=new Uint8Array(o(t)),e=0,r=0;r>6,n[e++]=128|63&i):i<55296?(n[e++]=224|i>>12,n[e++]=128|i>>6&63,n[e++]=128|63&i):(r++,i=(1023&i)<<10,i|=1023&t.charCodeAt(r),i+=65536,n[e++]=240|i>>18,n[e++]=128|i>>12&63,n[e++]=128|i>>6&63,n[e++]=128|63&i)}return n},n.encodedLength=o,n.decode=function(t){for(var n=[],e=0;e=t.length)throw new Error(r);if(128!=(192&(s=t[++e])))throw new Error(r);o=(31&o)<<6|63&s,i=128}else if(o<240){if(e>=t.length-1)throw new Error(r);var s=t[++e],a=t[++e];if(128!=(192&s)||128!=(192&a))throw new Error(r);o=(15&o)<<12|(63&s)<<6|63&a,i=2048}else{if(!(o<248))throw new Error(r);if(e>=t.length-2)throw new Error(r);s=t[++e],a=t[++e];var c=t[++e];if(128!=(192&s)||128!=(192&a)||128!=(192&c))throw new Error(r);o=(15&o)<<18|(63&s)<<12|(63&a)<<6|63&c,i=65536}if(o=55296&&o<=57343)throw new Error(r);if(o>=65536){if(o>1114111)throw new Error(r);o-=65536,n.push(String.fromCharCode(55296|o>>10)),o=56320|1023&o}}n.push(String.fromCharCode(o))}return n.join("")}},function(t,n){t.exports=require("@react-native-community/netinfo")},function(t,n,e){"use strict";(function(t){function r(t){return p(h(t))}e.d(n,"a",(function(){return r}));for(var o=String.fromCharCode,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s={},a=0,c=i.length;a>>6)+o(128|63&n):o(224|n>>>12&15)+o(128|n>>>6&63)+o(128|63&n)},h=function(t){return t.replace(/[^\x00-\x7F]/g,u)},f=function(t){var n=[0,2,1][t.length%3],e=t.charCodeAt(0)<<16|(t.length>1?t.charCodeAt(1):0)<<8|(t.length>2?t.charCodeAt(2):0);return[i.charAt(e>>>18),i.charAt(e>>>12&63),n>=2?"=":i.charAt(e>>>6&63),n>=1?"=":i.charAt(63&e)].join("")},p=t.btoa||function(t){return t.replace(/[\s\S]{1,3}/g,f)}}).call(this,e(6))},function(t,n,e){"use strict";var r=e(0),o=function(){function t(){this._callbacks={}}return t.prototype.get=function(t){return this._callbacks[i(t)]},t.prototype.add=function(t,n,e){var r=i(t);this._callbacks[r]=this._callbacks[r]||[],this._callbacks[r].push({fn:n,context:e})},t.prototype.remove=function(t,n,e){if(t||n||e){var o=t?[i(t)]:r.i(this._callbacks);n||e?this.removeCallback(o,n,e):this.removeAllCallbacks(o)}else this._callbacks={}},t.prototype.removeCallback=function(t,n,e){r.c(t,(function(t){this._callbacks[t]=r.g(this._callbacks[t]||[],(function(t){return n&&n!==t.fn||e&&e!==t.context})),0===this._callbacks[t].length&&delete this._callbacks[t]}),this)},t.prototype.removeAllCallbacks=function(t){r.c(t,(function(t){delete this._callbacks[t]}),this)},t}();function i(t){return"_"+t}n.a=o},function(t,n,e){!function(t){"use strict";var n=function(t){var n,e=new Float64Array(16);if(t)for(n=0;n>24&255,t[n+1]=e>>16&255,t[n+2]=e>>8&255,t[n+3]=255&e,t[n+4]=r>>24&255,t[n+5]=r>>16&255,t[n+6]=r>>8&255,t[n+7]=255&r}function y(t,n,e,r,o){var i,s=0;for(i=0;i>>8)-1}function g(t,n,e,r){return y(t,n,e,r,16)}function v(t,n,e,r){return y(t,n,e,r,32)}function b(t,n,e,r){!function(t,n,e,r){for(var o,i=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,a=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,c=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,u=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,h=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,f=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,p=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,l=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,d=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,y=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,g=255&e[16]|(255&e[17])<<8|(255&e[18])<<16|(255&e[19])<<24,v=255&e[20]|(255&e[21])<<8|(255&e[22])<<16|(255&e[23])<<24,b=255&e[24]|(255&e[25])<<8|(255&e[26])<<16|(255&e[27])<<24,m=255&e[28]|(255&e[29])<<8|(255&e[30])<<16|(255&e[31])<<24,_=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,w=i,S=s,k=a,T=c,C=u,O=h,P=f,A=p,E=l,x=d,L=y,U=g,M=v,R=b,j=m,I=_,N=0;N<20;N+=2)w^=(o=(M^=(o=(E^=(o=(C^=(o=w+M|0)<<7|o>>>25)+w|0)<<9|o>>>23)+C|0)<<13|o>>>19)+E|0)<<18|o>>>14,O^=(o=(S^=(o=(R^=(o=(x^=(o=O+S|0)<<7|o>>>25)+O|0)<<9|o>>>23)+x|0)<<13|o>>>19)+R|0)<<18|o>>>14,L^=(o=(P^=(o=(k^=(o=(j^=(o=L+P|0)<<7|o>>>25)+L|0)<<9|o>>>23)+j|0)<<13|o>>>19)+k|0)<<18|o>>>14,I^=(o=(U^=(o=(A^=(o=(T^=(o=I+U|0)<<7|o>>>25)+I|0)<<9|o>>>23)+T|0)<<13|o>>>19)+A|0)<<18|o>>>14,w^=(o=(T^=(o=(k^=(o=(S^=(o=w+T|0)<<7|o>>>25)+w|0)<<9|o>>>23)+S|0)<<13|o>>>19)+k|0)<<18|o>>>14,O^=(o=(C^=(o=(A^=(o=(P^=(o=O+C|0)<<7|o>>>25)+O|0)<<9|o>>>23)+P|0)<<13|o>>>19)+A|0)<<18|o>>>14,L^=(o=(x^=(o=(E^=(o=(U^=(o=L+x|0)<<7|o>>>25)+L|0)<<9|o>>>23)+U|0)<<13|o>>>19)+E|0)<<18|o>>>14,I^=(o=(j^=(o=(R^=(o=(M^=(o=I+j|0)<<7|o>>>25)+I|0)<<9|o>>>23)+M|0)<<13|o>>>19)+R|0)<<18|o>>>14;w=w+i|0,S=S+s|0,k=k+a|0,T=T+c|0,C=C+u|0,O=O+h|0,P=P+f|0,A=A+p|0,E=E+l|0,x=x+d|0,L=L+y|0,U=U+g|0,M=M+v|0,R=R+b|0,j=j+m|0,I=I+_|0,t[0]=w>>>0&255,t[1]=w>>>8&255,t[2]=w>>>16&255,t[3]=w>>>24&255,t[4]=S>>>0&255,t[5]=S>>>8&255,t[6]=S>>>16&255,t[7]=S>>>24&255,t[8]=k>>>0&255,t[9]=k>>>8&255,t[10]=k>>>16&255,t[11]=k>>>24&255,t[12]=T>>>0&255,t[13]=T>>>8&255,t[14]=T>>>16&255,t[15]=T>>>24&255,t[16]=C>>>0&255,t[17]=C>>>8&255,t[18]=C>>>16&255,t[19]=C>>>24&255,t[20]=O>>>0&255,t[21]=O>>>8&255,t[22]=O>>>16&255,t[23]=O>>>24&255,t[24]=P>>>0&255,t[25]=P>>>8&255,t[26]=P>>>16&255,t[27]=P>>>24&255,t[28]=A>>>0&255,t[29]=A>>>8&255,t[30]=A>>>16&255,t[31]=A>>>24&255,t[32]=E>>>0&255,t[33]=E>>>8&255,t[34]=E>>>16&255,t[35]=E>>>24&255,t[36]=x>>>0&255,t[37]=x>>>8&255,t[38]=x>>>16&255,t[39]=x>>>24&255,t[40]=L>>>0&255,t[41]=L>>>8&255,t[42]=L>>>16&255,t[43]=L>>>24&255,t[44]=U>>>0&255,t[45]=U>>>8&255,t[46]=U>>>16&255,t[47]=U>>>24&255,t[48]=M>>>0&255,t[49]=M>>>8&255,t[50]=M>>>16&255,t[51]=M>>>24&255,t[52]=R>>>0&255,t[53]=R>>>8&255,t[54]=R>>>16&255,t[55]=R>>>24&255,t[56]=j>>>0&255,t[57]=j>>>8&255,t[58]=j>>>16&255,t[59]=j>>>24&255,t[60]=I>>>0&255,t[61]=I>>>8&255,t[62]=I>>>16&255,t[63]=I>>>24&255}(t,n,e,r)}function m(t,n,e,r){!function(t,n,e,r){for(var o,i=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,a=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,c=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,u=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,h=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,f=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,p=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,l=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,d=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,y=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,g=255&e[16]|(255&e[17])<<8|(255&e[18])<<16|(255&e[19])<<24,v=255&e[20]|(255&e[21])<<8|(255&e[22])<<16|(255&e[23])<<24,b=255&e[24]|(255&e[25])<<8|(255&e[26])<<16|(255&e[27])<<24,m=255&e[28]|(255&e[29])<<8|(255&e[30])<<16|(255&e[31])<<24,_=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,w=0;w<20;w+=2)i^=(o=(v^=(o=(l^=(o=(u^=(o=i+v|0)<<7|o>>>25)+i|0)<<9|o>>>23)+u|0)<<13|o>>>19)+l|0)<<18|o>>>14,h^=(o=(s^=(o=(b^=(o=(d^=(o=h+s|0)<<7|o>>>25)+h|0)<<9|o>>>23)+d|0)<<13|o>>>19)+b|0)<<18|o>>>14,y^=(o=(f^=(o=(a^=(o=(m^=(o=y+f|0)<<7|o>>>25)+y|0)<<9|o>>>23)+m|0)<<13|o>>>19)+a|0)<<18|o>>>14,_^=(o=(g^=(o=(p^=(o=(c^=(o=_+g|0)<<7|o>>>25)+_|0)<<9|o>>>23)+c|0)<<13|o>>>19)+p|0)<<18|o>>>14,i^=(o=(c^=(o=(a^=(o=(s^=(o=i+c|0)<<7|o>>>25)+i|0)<<9|o>>>23)+s|0)<<13|o>>>19)+a|0)<<18|o>>>14,h^=(o=(u^=(o=(p^=(o=(f^=(o=h+u|0)<<7|o>>>25)+h|0)<<9|o>>>23)+f|0)<<13|o>>>19)+p|0)<<18|o>>>14,y^=(o=(d^=(o=(l^=(o=(g^=(o=y+d|0)<<7|o>>>25)+y|0)<<9|o>>>23)+g|0)<<13|o>>>19)+l|0)<<18|o>>>14,_^=(o=(m^=(o=(b^=(o=(v^=(o=_+m|0)<<7|o>>>25)+_|0)<<9|o>>>23)+v|0)<<13|o>>>19)+b|0)<<18|o>>>14;t[0]=i>>>0&255,t[1]=i>>>8&255,t[2]=i>>>16&255,t[3]=i>>>24&255,t[4]=h>>>0&255,t[5]=h>>>8&255,t[6]=h>>>16&255,t[7]=h>>>24&255,t[8]=y>>>0&255,t[9]=y>>>8&255,t[10]=y>>>16&255,t[11]=y>>>24&255,t[12]=_>>>0&255,t[13]=_>>>8&255,t[14]=_>>>16&255,t[15]=_>>>24&255,t[16]=f>>>0&255,t[17]=f>>>8&255,t[18]=f>>>16&255,t[19]=f>>>24&255,t[20]=p>>>0&255,t[21]=p>>>8&255,t[22]=p>>>16&255,t[23]=p>>>24&255,t[24]=l>>>0&255,t[25]=l>>>8&255,t[26]=l>>>16&255,t[27]=l>>>24&255,t[28]=d>>>0&255,t[29]=d>>>8&255,t[30]=d>>>16&255,t[31]=d>>>24&255}(t,n,e,r)}var _=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function w(t,n,e,r,o,i,s){var a,c,u=new Uint8Array(16),h=new Uint8Array(64);for(c=0;c<16;c++)u[c]=0;for(c=0;c<8;c++)u[c]=i[c];for(;o>=64;){for(b(h,u,s,_),c=0;c<64;c++)t[n+c]=e[r+c]^h[c];for(a=1,c=8;c<16;c++)a=a+(255&u[c])|0,u[c]=255&a,a>>>=8;o-=64,n+=64,r+=64}if(o>0)for(b(h,u,s,_),c=0;c=64;){for(b(c,a,o,_),s=0;s<64;s++)t[n+s]=c[s];for(i=1,s=8;s<16;s++)i=i+(255&a[s])|0,a[s]=255&i,i>>>=8;e-=64,n+=64}if(e>0)for(b(c,a,o,_),s=0;s>>13|e<<3),r=255&t[4]|(255&t[5])<<8,this.r[2]=7939&(e>>>10|r<<6),o=255&t[6]|(255&t[7])<<8,this.r[3]=8191&(r>>>7|o<<9),i=255&t[8]|(255&t[9])<<8,this.r[4]=255&(o>>>4|i<<12),this.r[5]=i>>>1&8190,s=255&t[10]|(255&t[11])<<8,this.r[6]=8191&(i>>>14|s<<2),a=255&t[12]|(255&t[13])<<8,this.r[7]=8065&(s>>>11|a<<5),c=255&t[14]|(255&t[15])<<8,this.r[8]=8191&(a>>>8|c<<8),this.r[9]=c>>>5&127,this.pad[0]=255&t[16]|(255&t[17])<<8,this.pad[1]=255&t[18]|(255&t[19])<<8,this.pad[2]=255&t[20]|(255&t[21])<<8,this.pad[3]=255&t[22]|(255&t[23])<<8,this.pad[4]=255&t[24]|(255&t[25])<<8,this.pad[5]=255&t[26]|(255&t[27])<<8,this.pad[6]=255&t[28]|(255&t[29])<<8,this.pad[7]=255&t[30]|(255&t[31])<<8};function O(t,n,e,r,o,i){var s=new C(i);return s.update(e,r,o),s.finish(t,n),0}function P(t,n,e,r,o,i){var s=new Uint8Array(16);return O(s,0,e,r,o,i),g(t,n,s,0)}function A(t,n,e,r,o){var i;if(e<32)return-1;for(T(t,0,n,0,e,r,o),O(t,16,t,32,e-32,t),i=0;i<16;i++)t[i]=0;return 0}function E(t,n,e,r,o){var i,s=new Uint8Array(32);if(e<32)return-1;if(k(s,0,32,r,o),0!==P(n,16,n,32,e-32,s))return-1;for(T(t,0,n,0,e,r,o),i=0;i<32;i++)t[i]=0;return 0}function x(t,n){var e;for(e=0;e<16;e++)t[e]=0|n[e]}function L(t){var n,e,r=1;for(n=0;n<16;n++)e=t[n]+r+65535,r=Math.floor(e/65536),t[n]=e-65536*r;t[0]+=r-1+37*(r-1)}function U(t,n,e){for(var r,o=~(e-1),i=0;i<16;i++)r=o&(t[i]^n[i]),t[i]^=r,n[i]^=r}function M(t,e){var r,o,i,s=n(),a=n();for(r=0;r<16;r++)a[r]=e[r];for(L(a),L(a),L(a),o=0;o<2;o++){for(s[0]=a[0]-65517,r=1;r<15;r++)s[r]=a[r]-65535-(s[r-1]>>16&1),s[r-1]&=65535;s[15]=a[15]-32767-(s[14]>>16&1),i=s[15]>>16&1,s[14]&=65535,U(a,s,1-i)}for(r=0;r<16;r++)t[2*r]=255&a[r],t[2*r+1]=a[r]>>8}function R(t,n){var e=new Uint8Array(32),r=new Uint8Array(32);return M(e,t),M(r,n),v(e,0,r,0)}function j(t){var n=new Uint8Array(32);return M(n,t),1&n[0]}function I(t,n){var e;for(e=0;e<16;e++)t[e]=n[2*e]+(n[2*e+1]<<8);t[15]&=32767}function N(t,n,e){for(var r=0;r<16;r++)t[r]=n[r]+e[r]}function B(t,n,e){for(var r=0;r<16;r++)t[r]=n[r]-e[r]}function D(t,n,e){var r,o,i=0,s=0,a=0,c=0,u=0,h=0,f=0,p=0,l=0,d=0,y=0,g=0,v=0,b=0,m=0,_=0,w=0,S=0,k=0,T=0,C=0,O=0,P=0,A=0,E=0,x=0,L=0,U=0,M=0,R=0,j=0,I=e[0],N=e[1],B=e[2],D=e[3],H=e[4],z=e[5],F=e[6],q=e[7],Y=e[8],K=e[9],J=e[10],X=e[11],W=e[12],G=e[13],V=e[14],Z=e[15];i+=(r=n[0])*I,s+=r*N,a+=r*B,c+=r*D,u+=r*H,h+=r*z,f+=r*F,p+=r*q,l+=r*Y,d+=r*K,y+=r*J,g+=r*X,v+=r*W,b+=r*G,m+=r*V,_+=r*Z,s+=(r=n[1])*I,a+=r*N,c+=r*B,u+=r*D,h+=r*H,f+=r*z,p+=r*F,l+=r*q,d+=r*Y,y+=r*K,g+=r*J,v+=r*X,b+=r*W,m+=r*G,_+=r*V,w+=r*Z,a+=(r=n[2])*I,c+=r*N,u+=r*B,h+=r*D,f+=r*H,p+=r*z,l+=r*F,d+=r*q,y+=r*Y,g+=r*K,v+=r*J,b+=r*X,m+=r*W,_+=r*G,w+=r*V,S+=r*Z,c+=(r=n[3])*I,u+=r*N,h+=r*B,f+=r*D,p+=r*H,l+=r*z,d+=r*F,y+=r*q,g+=r*Y,v+=r*K,b+=r*J,m+=r*X,_+=r*W,w+=r*G,S+=r*V,k+=r*Z,u+=(r=n[4])*I,h+=r*N,f+=r*B,p+=r*D,l+=r*H,d+=r*z,y+=r*F,g+=r*q,v+=r*Y,b+=r*K,m+=r*J,_+=r*X,w+=r*W,S+=r*G,k+=r*V,T+=r*Z,h+=(r=n[5])*I,f+=r*N,p+=r*B,l+=r*D,d+=r*H,y+=r*z,g+=r*F,v+=r*q,b+=r*Y,m+=r*K,_+=r*J,w+=r*X,S+=r*W,k+=r*G,T+=r*V,C+=r*Z,f+=(r=n[6])*I,p+=r*N,l+=r*B,d+=r*D,y+=r*H,g+=r*z,v+=r*F,b+=r*q,m+=r*Y,_+=r*K,w+=r*J,S+=r*X,k+=r*W,T+=r*G,C+=r*V,O+=r*Z,p+=(r=n[7])*I,l+=r*N,d+=r*B,y+=r*D,g+=r*H,v+=r*z,b+=r*F,m+=r*q,_+=r*Y,w+=r*K,S+=r*J,k+=r*X,T+=r*W,C+=r*G,O+=r*V,P+=r*Z,l+=(r=n[8])*I,d+=r*N,y+=r*B,g+=r*D,v+=r*H,b+=r*z,m+=r*F,_+=r*q,w+=r*Y,S+=r*K,k+=r*J,T+=r*X,C+=r*W,O+=r*G,P+=r*V,A+=r*Z,d+=(r=n[9])*I,y+=r*N,g+=r*B,v+=r*D,b+=r*H,m+=r*z,_+=r*F,w+=r*q,S+=r*Y,k+=r*K,T+=r*J,C+=r*X,O+=r*W,P+=r*G,A+=r*V,E+=r*Z,y+=(r=n[10])*I,g+=r*N,v+=r*B,b+=r*D,m+=r*H,_+=r*z,w+=r*F,S+=r*q,k+=r*Y,T+=r*K,C+=r*J,O+=r*X,P+=r*W,A+=r*G,E+=r*V,x+=r*Z,g+=(r=n[11])*I,v+=r*N,b+=r*B,m+=r*D,_+=r*H,w+=r*z,S+=r*F,k+=r*q,T+=r*Y,C+=r*K,O+=r*J,P+=r*X,A+=r*W,E+=r*G,x+=r*V,L+=r*Z,v+=(r=n[12])*I,b+=r*N,m+=r*B,_+=r*D,w+=r*H,S+=r*z,k+=r*F,T+=r*q,C+=r*Y,O+=r*K,P+=r*J,A+=r*X,E+=r*W,x+=r*G,L+=r*V,U+=r*Z,b+=(r=n[13])*I,m+=r*N,_+=r*B,w+=r*D,S+=r*H,k+=r*z,T+=r*F,C+=r*q,O+=r*Y,P+=r*K,A+=r*J,E+=r*X,x+=r*W,L+=r*G,U+=r*V,M+=r*Z,m+=(r=n[14])*I,_+=r*N,w+=r*B,S+=r*D,k+=r*H,T+=r*z,C+=r*F,O+=r*q,P+=r*Y,A+=r*K,E+=r*J,x+=r*X,L+=r*W,U+=r*G,M+=r*V,R+=r*Z,_+=(r=n[15])*I,s+=38*(S+=r*B),a+=38*(k+=r*D),c+=38*(T+=r*H),u+=38*(C+=r*z),h+=38*(O+=r*F),f+=38*(P+=r*q),p+=38*(A+=r*Y),l+=38*(E+=r*K),d+=38*(x+=r*J),y+=38*(L+=r*X),g+=38*(U+=r*W),v+=38*(M+=r*G),b+=38*(R+=r*V),m+=38*(j+=r*Z),i=(r=(i+=38*(w+=r*N))+(o=1)+65535)-65536*(o=Math.floor(r/65536)),s=(r=s+o+65535)-65536*(o=Math.floor(r/65536)),a=(r=a+o+65535)-65536*(o=Math.floor(r/65536)),c=(r=c+o+65535)-65536*(o=Math.floor(r/65536)),u=(r=u+o+65535)-65536*(o=Math.floor(r/65536)),h=(r=h+o+65535)-65536*(o=Math.floor(r/65536)),f=(r=f+o+65535)-65536*(o=Math.floor(r/65536)),p=(r=p+o+65535)-65536*(o=Math.floor(r/65536)),l=(r=l+o+65535)-65536*(o=Math.floor(r/65536)),d=(r=d+o+65535)-65536*(o=Math.floor(r/65536)),y=(r=y+o+65535)-65536*(o=Math.floor(r/65536)),g=(r=g+o+65535)-65536*(o=Math.floor(r/65536)),v=(r=v+o+65535)-65536*(o=Math.floor(r/65536)),b=(r=b+o+65535)-65536*(o=Math.floor(r/65536)),m=(r=m+o+65535)-65536*(o=Math.floor(r/65536)),_=(r=_+o+65535)-65536*(o=Math.floor(r/65536)),i=(r=(i+=o-1+37*(o-1))+(o=1)+65535)-65536*(o=Math.floor(r/65536)),s=(r=s+o+65535)-65536*(o=Math.floor(r/65536)),a=(r=a+o+65535)-65536*(o=Math.floor(r/65536)),c=(r=c+o+65535)-65536*(o=Math.floor(r/65536)),u=(r=u+o+65535)-65536*(o=Math.floor(r/65536)),h=(r=h+o+65535)-65536*(o=Math.floor(r/65536)),f=(r=f+o+65535)-65536*(o=Math.floor(r/65536)),p=(r=p+o+65535)-65536*(o=Math.floor(r/65536)),l=(r=l+o+65535)-65536*(o=Math.floor(r/65536)),d=(r=d+o+65535)-65536*(o=Math.floor(r/65536)),y=(r=y+o+65535)-65536*(o=Math.floor(r/65536)),g=(r=g+o+65535)-65536*(o=Math.floor(r/65536)),v=(r=v+o+65535)-65536*(o=Math.floor(r/65536)),b=(r=b+o+65535)-65536*(o=Math.floor(r/65536)),m=(r=m+o+65535)-65536*(o=Math.floor(r/65536)),_=(r=_+o+65535)-65536*(o=Math.floor(r/65536)),i+=o-1+37*(o-1),t[0]=i,t[1]=s,t[2]=a,t[3]=c,t[4]=u,t[5]=h,t[6]=f,t[7]=p,t[8]=l,t[9]=d,t[10]=y,t[11]=g,t[12]=v,t[13]=b,t[14]=m,t[15]=_}function H(t,n){D(t,n,n)}function z(t,e){var r,o=n();for(r=0;r<16;r++)o[r]=e[r];for(r=253;r>=0;r--)H(o,o),2!==r&&4!==r&&D(o,o,e);for(r=0;r<16;r++)t[r]=o[r]}function F(t,e){var r,o=n();for(r=0;r<16;r++)o[r]=e[r];for(r=250;r>=0;r--)H(o,o),1!==r&&D(o,o,e);for(r=0;r<16;r++)t[r]=o[r]}function q(t,e,r){var o,i,s=new Uint8Array(32),a=new Float64Array(80),u=n(),h=n(),f=n(),p=n(),l=n(),d=n();for(i=0;i<31;i++)s[i]=e[i];for(s[31]=127&e[31]|64,s[0]&=248,I(a,r),i=0;i<16;i++)h[i]=a[i],p[i]=u[i]=f[i]=0;for(u[0]=p[0]=1,i=254;i>=0;--i)U(u,h,o=s[i>>>3]>>>(7&i)&1),U(f,p,o),N(l,u,f),B(u,u,f),N(f,h,p),B(h,h,p),H(p,l),H(d,u),D(u,f,u),D(f,h,l),N(l,u,f),B(u,u,f),H(h,u),B(f,p,d),D(u,f,c),N(u,u,p),D(f,f,u),D(u,p,d),D(p,h,a),H(h,l),U(u,h,o),U(f,p,o);for(i=0;i<16;i++)a[i+16]=u[i],a[i+32]=f[i],a[i+48]=h[i],a[i+64]=p[i];var y=a.subarray(32),g=a.subarray(16);return z(y,y),D(g,g,y),M(t,g),0}function Y(t,n){return q(t,n,i)}function K(t,n){return r(n,32),Y(t,n)}function J(t,n,e){var r=new Uint8Array(32);return q(r,e,n),m(t,o,r,_)}C.prototype.blocks=function(t,n,e){for(var r,o,i,s,a,c,u,h,f,p,l,d,y,g,v,b,m,_,w,S=this.fin?0:2048,k=this.h[0],T=this.h[1],C=this.h[2],O=this.h[3],P=this.h[4],A=this.h[5],E=this.h[6],x=this.h[7],L=this.h[8],U=this.h[9],M=this.r[0],R=this.r[1],j=this.r[2],I=this.r[3],N=this.r[4],B=this.r[5],D=this.r[6],H=this.r[7],z=this.r[8],F=this.r[9];e>=16;)p=f=0,p+=(k+=8191&(r=255&t[n+0]|(255&t[n+1])<<8))*M,p+=(T+=8191&(r>>>13|(o=255&t[n+2]|(255&t[n+3])<<8)<<3))*(5*F),p+=(C+=8191&(o>>>10|(i=255&t[n+4]|(255&t[n+5])<<8)<<6))*(5*z),p+=(O+=8191&(i>>>7|(s=255&t[n+6]|(255&t[n+7])<<8)<<9))*(5*H),f=(p+=(P+=8191&(s>>>4|(a=255&t[n+8]|(255&t[n+9])<<8)<<12))*(5*D))>>>13,p&=8191,p+=(A+=a>>>1&8191)*(5*B),p+=(E+=8191&(a>>>14|(c=255&t[n+10]|(255&t[n+11])<<8)<<2))*(5*N),p+=(x+=8191&(c>>>11|(u=255&t[n+12]|(255&t[n+13])<<8)<<5))*(5*I),p+=(L+=8191&(u>>>8|(h=255&t[n+14]|(255&t[n+15])<<8)<<8))*(5*j),l=f+=(p+=(U+=h>>>5|S)*(5*R))>>>13,l+=k*R,l+=T*M,l+=C*(5*F),l+=O*(5*z),f=(l+=P*(5*H))>>>13,l&=8191,l+=A*(5*D),l+=E*(5*B),l+=x*(5*N),l+=L*(5*I),f+=(l+=U*(5*j))>>>13,l&=8191,d=f,d+=k*j,d+=T*R,d+=C*M,d+=O*(5*F),f=(d+=P*(5*z))>>>13,d&=8191,d+=A*(5*H),d+=E*(5*D),d+=x*(5*B),d+=L*(5*N),y=f+=(d+=U*(5*I))>>>13,y+=k*I,y+=T*j,y+=C*R,y+=O*M,f=(y+=P*(5*F))>>>13,y&=8191,y+=A*(5*z),y+=E*(5*H),y+=x*(5*D),y+=L*(5*B),g=f+=(y+=U*(5*N))>>>13,g+=k*N,g+=T*I,g+=C*j,g+=O*R,f=(g+=P*M)>>>13,g&=8191,g+=A*(5*F),g+=E*(5*z),g+=x*(5*H),g+=L*(5*D),v=f+=(g+=U*(5*B))>>>13,v+=k*B,v+=T*N,v+=C*I,v+=O*j,f=(v+=P*R)>>>13,v&=8191,v+=A*M,v+=E*(5*F),v+=x*(5*z),v+=L*(5*H),b=f+=(v+=U*(5*D))>>>13,b+=k*D,b+=T*B,b+=C*N,b+=O*I,f=(b+=P*j)>>>13,b&=8191,b+=A*R,b+=E*M,b+=x*(5*F),b+=L*(5*z),m=f+=(b+=U*(5*H))>>>13,m+=k*H,m+=T*D,m+=C*B,m+=O*N,f=(m+=P*I)>>>13,m&=8191,m+=A*j,m+=E*R,m+=x*M,m+=L*(5*F),_=f+=(m+=U*(5*z))>>>13,_+=k*z,_+=T*H,_+=C*D,_+=O*B,f=(_+=P*N)>>>13,_&=8191,_+=A*I,_+=E*j,_+=x*R,_+=L*M,w=f+=(_+=U*(5*F))>>>13,w+=k*F,w+=T*z,w+=C*H,w+=O*D,f=(w+=P*B)>>>13,w&=8191,w+=A*N,w+=E*I,w+=x*j,w+=L*R,k=p=8191&(f=(f=((f+=(w+=U*M)>>>13)<<2)+f|0)+(p&=8191)|0),T=l+=f>>>=13,C=d&=8191,O=y&=8191,P=g&=8191,A=v&=8191,E=b&=8191,x=m&=8191,L=_&=8191,U=w&=8191,n+=16,e-=16;this.h[0]=k,this.h[1]=T,this.h[2]=C,this.h[3]=O,this.h[4]=P,this.h[5]=A,this.h[6]=E,this.h[7]=x,this.h[8]=L,this.h[9]=U},C.prototype.finish=function(t,n){var e,r,o,i,s=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;i<16;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(e=this.h[1]>>>13,this.h[1]&=8191,i=2;i<10;i++)this.h[i]+=e,e=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*e,e=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=e,e=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=e,s[0]=this.h[0]+5,e=s[0]>>>13,s[0]&=8191,i=1;i<10;i++)s[i]=this.h[i]+e,e=s[i]>>>13,s[i]&=8191;for(s[9]-=8192,r=(1^e)-1,i=0;i<10;i++)s[i]&=r;for(r=~r,i=0;i<10;i++)this.h[i]=this.h[i]&r|s[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),o=this.h[0]+this.pad[0],this.h[0]=65535&o,i=1;i<8;i++)o=(this.h[i]+this.pad[i]|0)+(o>>>16)|0,this.h[i]=65535&o;t[n+0]=this.h[0]>>>0&255,t[n+1]=this.h[0]>>>8&255,t[n+2]=this.h[1]>>>0&255,t[n+3]=this.h[1]>>>8&255,t[n+4]=this.h[2]>>>0&255,t[n+5]=this.h[2]>>>8&255,t[n+6]=this.h[3]>>>0&255,t[n+7]=this.h[3]>>>8&255,t[n+8]=this.h[4]>>>0&255,t[n+9]=this.h[4]>>>8&255,t[n+10]=this.h[5]>>>0&255,t[n+11]=this.h[5]>>>8&255,t[n+12]=this.h[6]>>>0&255,t[n+13]=this.h[6]>>>8&255,t[n+14]=this.h[7]>>>0&255,t[n+15]=this.h[7]>>>8&255},C.prototype.update=function(t,n,e){var r,o;if(this.leftover){for((o=16-this.leftover)>e&&(o=e),r=0;r=16&&(o=e-e%16,this.blocks(t,n,o),n+=o,e-=o),e){for(r=0;r=128;){for(S=0;S<16;S++)k=8*S+W,x[S]=e[k+0]<<24|e[k+1]<<16|e[k+2]<<8|e[k+3],L[S]=e[k+4]<<24|e[k+5]<<16|e[k+6]<<8|e[k+7];for(S=0;S<80;S++)if(o=U,i=M,s=R,a=j,c=I,u=N,h=B,D,p=H,l=z,d=F,y=q,g=Y,v=K,b=J,X,O=65535&(C=X),P=C>>>16,A=65535&(T=D),E=T>>>16,O+=65535&(C=(Y>>>14|I<<18)^(Y>>>18|I<<14)^(I>>>9|Y<<23)),P+=C>>>16,A+=65535&(T=(I>>>14|Y<<18)^(I>>>18|Y<<14)^(Y>>>9|I<<23)),E+=T>>>16,O+=65535&(C=Y&K^~Y&J),P+=C>>>16,A+=65535&(T=I&N^~I&B),E+=T>>>16,O+=65535&(C=G[2*S+1]),P+=C>>>16,A+=65535&(T=G[2*S]),E+=T>>>16,T=x[S%16],P+=(C=L[S%16])>>>16,A+=65535&T,E+=T>>>16,A+=(P+=(O+=65535&C)>>>16)>>>16,O=65535&(C=w=65535&O|P<<16),P=C>>>16,A=65535&(T=_=65535&A|(E+=A>>>16)<<16),E=T>>>16,O+=65535&(C=(H>>>28|U<<4)^(U>>>2|H<<30)^(U>>>7|H<<25)),P+=C>>>16,A+=65535&(T=(U>>>28|H<<4)^(H>>>2|U<<30)^(H>>>7|U<<25)),E+=T>>>16,P+=(C=H&z^H&F^z&F)>>>16,A+=65535&(T=U&M^U&R^M&R),E+=T>>>16,f=65535&(A+=(P+=(O+=65535&C)>>>16)>>>16)|(E+=A>>>16)<<16,m=65535&O|P<<16,O=65535&(C=y),P=C>>>16,A=65535&(T=a),E=T>>>16,P+=(C=w)>>>16,A+=65535&(T=_),E+=T>>>16,M=o,R=i,j=s,I=a=65535&(A+=(P+=(O+=65535&C)>>>16)>>>16)|(E+=A>>>16)<<16,N=c,B=u,D=h,U=f,z=p,F=l,q=d,Y=y=65535&O|P<<16,K=g,J=v,X=b,H=m,S%16==15)for(k=0;k<16;k++)T=x[k],O=65535&(C=L[k]),P=C>>>16,A=65535&T,E=T>>>16,T=x[(k+9)%16],O+=65535&(C=L[(k+9)%16]),P+=C>>>16,A+=65535&T,E+=T>>>16,_=x[(k+1)%16],O+=65535&(C=((w=L[(k+1)%16])>>>1|_<<31)^(w>>>8|_<<24)^(w>>>7|_<<25)),P+=C>>>16,A+=65535&(T=(_>>>1|w<<31)^(_>>>8|w<<24)^_>>>7),E+=T>>>16,_=x[(k+14)%16],P+=(C=((w=L[(k+14)%16])>>>19|_<<13)^(_>>>29|w<<3)^(w>>>6|_<<26))>>>16,A+=65535&(T=(_>>>19|w<<13)^(w>>>29|_<<3)^_>>>6),E+=T>>>16,E+=(A+=(P+=(O+=65535&C)>>>16)>>>16)>>>16,x[k]=65535&A|E<<16,L[k]=65535&O|P<<16;O=65535&(C=H),P=C>>>16,A=65535&(T=U),E=T>>>16,T=t[0],P+=(C=n[0])>>>16,A+=65535&T,E+=T>>>16,E+=(A+=(P+=(O+=65535&C)>>>16)>>>16)>>>16,t[0]=U=65535&A|E<<16,n[0]=H=65535&O|P<<16,O=65535&(C=z),P=C>>>16,A=65535&(T=M),E=T>>>16,T=t[1],P+=(C=n[1])>>>16,A+=65535&T,E+=T>>>16,E+=(A+=(P+=(O+=65535&C)>>>16)>>>16)>>>16,t[1]=M=65535&A|E<<16,n[1]=z=65535&O|P<<16,O=65535&(C=F),P=C>>>16,A=65535&(T=R),E=T>>>16,T=t[2],P+=(C=n[2])>>>16,A+=65535&T,E+=T>>>16,E+=(A+=(P+=(O+=65535&C)>>>16)>>>16)>>>16,t[2]=R=65535&A|E<<16,n[2]=F=65535&O|P<<16,O=65535&(C=q),P=C>>>16,A=65535&(T=j),E=T>>>16,T=t[3],P+=(C=n[3])>>>16,A+=65535&T,E+=T>>>16,E+=(A+=(P+=(O+=65535&C)>>>16)>>>16)>>>16,t[3]=j=65535&A|E<<16,n[3]=q=65535&O|P<<16,O=65535&(C=Y),P=C>>>16,A=65535&(T=I),E=T>>>16,T=t[4],P+=(C=n[4])>>>16,A+=65535&T,E+=T>>>16,E+=(A+=(P+=(O+=65535&C)>>>16)>>>16)>>>16,t[4]=I=65535&A|E<<16,n[4]=Y=65535&O|P<<16,O=65535&(C=K),P=C>>>16,A=65535&(T=N),E=T>>>16,T=t[5],P+=(C=n[5])>>>16,A+=65535&T,E+=T>>>16,E+=(A+=(P+=(O+=65535&C)>>>16)>>>16)>>>16,t[5]=N=65535&A|E<<16,n[5]=K=65535&O|P<<16,O=65535&(C=J),P=C>>>16,A=65535&(T=B),E=T>>>16,T=t[6],P+=(C=n[6])>>>16,A+=65535&T,E+=T>>>16,E+=(A+=(P+=(O+=65535&C)>>>16)>>>16)>>>16,t[6]=B=65535&A|E<<16,n[6]=J=65535&O|P<<16,O=65535&(C=X),P=C>>>16,A=65535&(T=D),E=T>>>16,T=t[7],P+=(C=n[7])>>>16,A+=65535&T,E+=T>>>16,E+=(A+=(P+=(O+=65535&C)>>>16)>>>16)>>>16,t[7]=D=65535&A|E<<16,n[7]=X=65535&O|P<<16,W+=128,r-=128}return r}function Z(t,n,e){var r,o=new Int32Array(8),i=new Int32Array(8),s=new Uint8Array(256),a=e;for(o[0]=1779033703,o[1]=3144134277,o[2]=1013904242,o[3]=2773480762,o[4]=1359893119,o[5]=2600822924,o[6]=528734635,o[7]=1541459225,i[0]=4089235720,i[1]=2227873595,i[2]=4271175723,i[3]=1595750129,i[4]=2917565137,i[5]=725511199,i[6]=4215389547,i[7]=327033209,V(o,i,n,e),e%=128,r=0;r=0;--o)$(t,n,r=e[o/8|0]>>(7&o)&1),Q(n,t),Q(t,t),$(t,n,r)}function et(t,e){var r=[n(),n(),n(),n()];x(r[0],f),x(r[1],p),x(r[2],a),D(r[3],f,p),nt(t,r,e)}function rt(t,e,o){var i,s=new Uint8Array(64),a=[n(),n(),n(),n()];for(o||r(e,32),Z(s,e,32),s[0]&=248,s[31]&=127,s[31]|=64,et(a,s),tt(t,a),i=0;i<32;i++)e[i+32]=t[i];return 0}var ot=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function it(t,n){var e,r,o,i;for(r=63;r>=32;--r){for(e=0,o=r-32,i=r-12;o>4)*ot[o],e=n[o]>>8,n[o]&=255;for(o=0;o<32;o++)n[o]-=e*ot[o];for(r=0;r<32;r++)n[r+1]+=n[r]>>8,t[r]=255&n[r]}function st(t){var n,e=new Float64Array(64);for(n=0;n<64;n++)e[n]=t[n];for(n=0;n<64;n++)t[n]=0;it(t,e)}function at(t,e,r,o){var i,s,a=new Uint8Array(64),c=new Uint8Array(64),u=new Uint8Array(64),h=new Float64Array(64),f=[n(),n(),n(),n()];Z(a,o,32),a[0]&=248,a[31]&=127,a[31]|=64;var p=r+64;for(i=0;i>7&&B(t[0],s,t[0]),D(t[3],t[0],t[1]),0)}(p,o))return-1;for(i=0;i=0},t.sign.keyPair=function(){var t=new Uint8Array(32),n=new Uint8Array(64);return rt(t,n),{publicKey:t,secretKey:n}},t.sign.keyPair.fromSecretKey=function(t){if(ht(t),64!==t.length)throw new Error("bad secret key size");for(var n=new Uint8Array(32),e=0;e0)for(o=0;o=1002&&t.code<=1004?"backoff":null:4e3===t.code?"tls_only":t.code<4100?"refused":t.code<4200?"backoff":t.code<4300?"retry":"refused"},getCloseError:function(t){return 1e3!==t.code&&1001!==t.code?{type:"PusherError",data:{code:t.code,message:t.reason||t.message}}:null}},T=k,C=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(n,e)};return function(n,e){function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),O=function(t){function n(n,e){var r=t.call(this)||this;return r.id=n,r.transport=e,r.activityTimeout=e.activityTimeout,r.bindListeners(),r}return C(n,t),n.prototype.handlesActivityChecks=function(){return this.transport.handlesActivityChecks()},n.prototype.send=function(t){return this.transport.send(t)},n.prototype.send_event=function(t,n,e){var r={event:t,data:n};return e&&(r.channel=e),l.a.debug("Event sent",r),this.send(T.encodeMessage(r))},n.prototype.ping=function(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})},n.prototype.close=function(){this.transport.close()},n.prototype.bindListeners=function(){var t=this,n={message:function(n){var e;try{e=T.decodeMessage(n)}catch(e){t.emit("error",{type:"MessageParseError",error:e,data:n.data})}if(void 0!==e){switch(l.a.debug("Event recd",e),e.event){case"pusher:error":t.emit("error",{type:"PusherError",data:e.data});break;case"pusher:ping":t.emit("ping");break;case"pusher:pong":t.emit("pong")}t.emit("message",e)}},activity:function(){t.emit("activity")},error:function(n){t.emit("error",n)},closed:function(n){e(),n&&n.code&&t.handleCloseEvent(n),t.transport=null,t.emit("closed")}},e=function(){r.k(n,(function(n,e){t.transport.unbind(e,n)}))};r.k(n,(function(n,e){t.transport.bind(e,n)}))},n.prototype.handleCloseEvent=function(t){var n=T.getCloseAction(t),e=T.getCloseError(t);e&&this.emit("error",e),n&&this.emit(n,{action:n,error:e})},n}(f.a),P=function(){function t(t,n){this.transport=t,this.callback=n,this.bindListeners()}return t.prototype.close=function(){this.unbindListeners(),this.transport.close()},t.prototype.bindListeners=function(){var t=this;this.onMessage=function(n){var e;t.unbindListeners();try{e=T.processHandshake(n)}catch(n){return t.finish("error",{error:n}),void t.transport.close()}"connected"===e.action?t.finish("connected",{connection:new O(e.id,t.transport),activityTimeout:e.activityTimeout}):(t.finish(e.action,{error:e.error}),t.transport.close())},this.onClosed=function(n){t.unbindListeners();var e=T.getCloseAction(n)||"backoff",r=T.getCloseError(n);t.finish(e,{error:r})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)},t.prototype.unbindListeners=function(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)},t.prototype.finish=function(t,n){this.callback(r.f({transport:this.transport,action:t},n))},t}(),A=function(){function t(t,n){this.channel=t;var e=n.authTransport;if(void 0===Mt.getAuthorizers()[e])throw"'"+e+"' is not a recognized auth transport";this.type=e,this.options=n,this.authOptions=n.auth||{}}return t.prototype.composeQuery=function(t){var n="socket_id="+encodeURIComponent(t)+"&channel_name="+encodeURIComponent(this.channel.name);for(var e in this.authOptions.params)n+="&"+encodeURIComponent(e)+"="+encodeURIComponent(this.authOptions.params[e]);return n},t.prototype.authorize=function(n,e){t.authorizers=t.authorizers||Mt.getAuthorizers(),t.authorizers[this.type].call(this,Mt,n,e)},t}(),E=function(){function t(t,n){this.timeline=t,this.options=n||{}}return t.prototype.send=function(t,n){this.timeline.isEmpty()||this.timeline.send(Mt.TimelineTransport.getAgent(this,t),n)},t}(),x=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(n,e)};return function(n,e){function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),L=function(t){function n(n){var e=this.constructor,r=t.call(this,n)||this;return Object.setPrototypeOf(r,e.prototype),r}return x(n,t),n}(Error),U=(function(t){function n(n){var e=this.constructor,r=t.call(this,n)||this;return Object.setPrototypeOf(r,e.prototype),r}x(n,t)}(Error),function(t){function n(n){var e=this.constructor,r=t.call(this,n)||this;return Object.setPrototypeOf(r,e.prototype),r}return x(n,t),n}(Error)),M=function(t){function n(n){var e=this.constructor,r=t.call(this,n)||this;return Object.setPrototypeOf(r,e.prototype),r}return x(n,t),n}(Error),R=function(t){function n(n){var e=this.constructor,r=t.call(this,n)||this;return Object.setPrototypeOf(r,e.prototype),r}return x(n,t),n}(Error),j=function(t){function n(n){var e=this.constructor,r=t.call(this,n)||this;return Object.setPrototypeOf(r,e.prototype),r}return x(n,t),n}(Error),I=function(t){function n(n){var e=this.constructor,r=t.call(this,n)||this;return Object.setPrototypeOf(r,e.prototype),r}return x(n,t),n}(Error),N=function(t){function n(n,e){var r=this.constructor,o=t.call(this,e)||this;return o.status=n,Object.setPrototypeOf(o,r.prototype),o}return x(n,t),n}(Error),D={baseUrl:"https://pusher.com",urls:{authenticationEndpoint:{path:"/docs/authenticating_users"},javascriptQuickStart:{path:"/docs/javascript_quick_start"},triggeringClientEvents:{path:"/docs/client_api_guide/client_events#trigger-events"},encryptedChannelSupport:{fullUrl:"https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support"}}},B=function(t){var n,e=D.urls[t];return e?(e.fullUrl?n=e.fullUrl:e.path&&(n=D.baseUrl+e.path),n?"See: "+n:""):""},H=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(n,e)};return function(n,e){function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),z=function(t){function n(n,e){var r=t.call(this,(function(t,e){l.a.debug("No callbacks on "+n+" for "+t)}))||this;return r.name=n,r.pusher=e,r.subscribed=!1,r.subscriptionPending=!1,r.subscriptionCancelled=!1,r}return H(n,t),n.prototype.authorize=function(t,n){return n(null,{auth:""})},n.prototype.trigger=function(t,n){if(0!==t.indexOf("client-"))throw new L("Event '"+t+"' does not start with 'client-'");if(!this.subscribed){var e=B("triggeringClientEvents");l.a.warn("Client event triggered before channel 'subscription_succeeded' event . "+e)}return this.pusher.send_event(t,n,this.name)},n.prototype.disconnect=function(){this.subscribed=!1,this.subscriptionPending=!1},n.prototype.handleEvent=function(t){var n=t.event,e=t.data;if("pusher_internal:subscription_succeeded"===n)this.handleSubscriptionSucceededEvent(t);else if(0!==n.indexOf("pusher_internal:")){this.emit(n,e,{})}},n.prototype.handleSubscriptionSucceededEvent=function(t){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",t.data)},n.prototype.subscribe=function(){var t=this;this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,(function(n,e){n?(l.a.error(n.toString()),t.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:n.message},n instanceof N?{status:n.status}:{}))):t.pusher.send_event("pusher:subscribe",{auth:e.auth,channel_data:e.channel_data,channel:t.name})})))},n.prototype.unsubscribe=function(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})},n.prototype.cancelSubscription=function(){this.subscriptionCancelled=!0},n.prototype.reinstateSubscription=function(){this.subscriptionCancelled=!1},n}(f.a),F=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(n,e)};return function(n,e){function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),q=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return F(n,t),n.prototype.authorize=function(t,n){return nt.createAuthorizer(this,this.pusher.config).authorize(t,n)},n}(z),Y=function(){function t(){this.reset()}return t.prototype.get=function(t){return Object.prototype.hasOwnProperty.call(this.members,t)?{id:t,info:this.members[t]}:null},t.prototype.each=function(t){var n=this;r.k(this.members,(function(e,r){t(n.get(r))}))},t.prototype.setMyID=function(t){this.myID=t},t.prototype.onSubscription=function(t){this.members=t.presence.hash,this.count=t.presence.count,this.me=this.get(this.myID)},t.prototype.addMember=function(t){return null===this.get(t.user_id)&&this.count++,this.members[t.user_id]=t.user_info,this.get(t.user_id)},t.prototype.removeMember=function(t){var n=this.get(t.user_id);return n&&(delete this.members[t.user_id],this.count--),n},t.prototype.reset=function(){this.members={},this.count=0,this.myID=null,this.me=null},t}(),K=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(n,e)};return function(n,e){function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),X=function(t){function n(n,e){var r=t.call(this,n,e)||this;return r.members=new Y,r}return K(n,t),n.prototype.authorize=function(n,e){var r=this;t.prototype.authorize.call(this,n,(function(t,n){if(!t){if(void 0===(n=n).channel_data){var o=B("authenticationEndpoint");return l.a.error("Invalid auth response for channel '"+r.name+"',expected 'channel_data' field. "+o),void e("Invalid auth response")}var i=JSON.parse(n.channel_data);r.members.setMyID(i.user_id)}e(t,n)}))},n.prototype.handleEvent=function(t){var n=t.event;if(0===n.indexOf("pusher_internal:"))this.handleInternalEvent(t);else{var e=t.data,r={};t.user_id&&(r.user_id=t.user_id),this.emit(n,e,r)}},n.prototype.handleInternalEvent=function(t){var n=t.event,e=t.data;switch(n){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(t);break;case"pusher_internal:member_added":var r=this.members.addMember(e);this.emit("pusher:member_added",r);break;case"pusher_internal:member_removed":var o=this.members.removeMember(e);o&&this.emit("pusher:member_removed",o)}},n.prototype.handleSubscriptionSucceededEvent=function(t){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(t.data),this.emit("pusher:subscription_succeeded",this.members))},n.prototype.disconnect=function(){this.members.reset(),t.prototype.disconnect.call(this)},n}(q),J=e(12),W=e(7),G=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(n,e)};return function(n,e){function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),V=function(t){function n(n,e,r){var o=t.call(this,n,e)||this;return o.key=null,o.nacl=r,o}return G(n,t),n.prototype.authorize=function(n,e){var r=this;t.prototype.authorize.call(this,n,(function(t,n){if(t)e(t,n);else{var o=n.shared_secret;o?(r.key=Object(W.decode)(o),delete n.shared_secret,e(null,n)):e(new Error("No shared_secret key in auth payload for encrypted channel: "+r.name),null)}}))},n.prototype.trigger=function(t,n){throw new R("Client events are not currently supported for encrypted channels")},n.prototype.handleEvent=function(n){var e=n.event,r=n.data;0!==e.indexOf("pusher_internal:")&&0!==e.indexOf("pusher:")?this.handleEncryptedEvent(e,r):t.prototype.handleEvent.call(this,n)},n.prototype.handleEncryptedEvent=function(t,n){var e=this;if(this.key)if(n.ciphertext&&n.nonce){var r=Object(W.decode)(n.ciphertext);if(r.length0&&this.emit("connecting_in",Math.round(t/1e3)),this.retryTimer=new Z.a(t||0,(function(){n.disconnectInternally(),n.connect()}))},n.prototype.clearRetryTimer=function(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)},n.prototype.setUnavailableTimer=function(){var t=this;this.unavailableTimer=new Z.a(this.options.unavailableTimeout,(function(){t.updateState("unavailable")}))},n.prototype.clearUnavailableTimer=function(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()},n.prototype.sendActivityCheck=function(){var t=this;this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new Z.a(this.options.pongTimeout,(function(){t.timeline.error({pong_timed_out:t.options.pongTimeout}),t.retryIn(0)}))},n.prototype.resetActivityCheck=function(){var t=this;this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new Z.a(this.activityTimeout,(function(){t.sendActivityCheck()})))},n.prototype.stopActivityCheck=function(){this.activityTimer&&this.activityTimer.ensureAborted()},n.prototype.buildConnectionCallbacks=function(t){var n=this;return r.f({},t,{message:function(t){n.resetActivityCheck(),n.emit("message",t)},ping:function(){n.send_event("pusher:pong",{})},activity:function(){n.resetActivityCheck()},error:function(t){n.emit("error",t)},closed:function(){n.abandonConnection(),n.shouldRetry()&&n.retryIn(1e3)}})},n.prototype.buildHandshakeCallbacks=function(t){var n=this;return r.f({},t,{connected:function(t){n.activityTimeout=Math.min(n.options.activityTimeout,t.activityTimeout,t.connection.activityTimeout||1/0),n.clearUnavailableTimer(),n.setConnection(t.connection),n.socket_id=n.connection.id,n.updateState("connected",{socket_id:n.socket_id})}})},n.prototype.buildErrorCallbacks=function(){var t=this,n=function(n){return function(e){e.error&&t.emit("error",{type:"WebSocketError",error:e.error}),n(e)}};return{tls_only:n((function(){t.usingTLS=!0,t.updateStrategy(),t.retryIn(0)})),refused:n((function(){t.disconnect()})),backoff:n((function(){t.retryIn(1e3)})),retry:n((function(){t.retryIn(0)}))}},n.prototype.setConnection=function(t){for(var n in this.connection=t,this.connectionCallbacks)this.connection.bind(n,this.connectionCallbacks[n]);this.resetActivityCheck()},n.prototype.abandonConnection=function(){if(this.connection){for(var t in this.stopActivityCheck(),this.connectionCallbacks)this.connection.unbind(t,this.connectionCallbacks[t]);var n=this.connection;return this.connection=null,n}},n.prototype.updateState=function(t,n){var e=this.state;if(this.state=t,e!==t){var r=t;"connected"===r&&(r+=" with new socket ID "+n.socket_id),l.a.debug("State changed",e+" -> "+r),this.timeline.info({state:t,params:n}),this.emit("state_change",{previous:e,current:t}),this.emit(t,n)}},n.prototype.shouldRetry=function(){return"connecting"===this.state||"connected"===this.state},n}(f.a),tt=function(){function t(){this.channels={}}return t.prototype.add=function(t,n){return this.channels[t]||(this.channels[t]=function(t,n){if(0===t.indexOf("private-encrypted-")){if(n.config.nacl)return nt.createEncryptedChannel(t,n,n.config.nacl);var e=B("encryptedChannelSupport");throw new R("Tried to subscribe to a private-encrypted- channel but no nacl implementation available. "+e)}return 0===t.indexOf("private-")?nt.createPrivateChannel(t,n):0===t.indexOf("presence-")?nt.createPresenceChannel(t,n):nt.createChannel(t,n)}(t,n)),this.channels[t]},t.prototype.all=function(){return r.n(this.channels)},t.prototype.find=function(t){return this.channels[t]},t.prototype.remove=function(t){var n=this.channels[t];return delete this.channels[t],n},t.prototype.disconnect=function(){r.k(this.channels,(function(t){t.disconnect()}))},t}();var nt={createChannels:function(){return new tt},createConnectionManager:function(t,n){return new $(t,n)},createChannel:function(t,n){return new z(t,n)},createPrivateChannel:function(t,n){return new q(t,n)},createPresenceChannel:function(t,n){return new X(t,n)},createEncryptedChannel:function(t,n,e){return new V(t,n,e)},createTimelineSender:function(t,n){return new E(t,n)},createAuthorizer:function(t,n){return n.authorizer?n.authorizer(t,n):new A(t,n)},createHandshake:function(t,n){return new P(t,n)},createAssistantToTheTransportManager:function(t,n,e){return new S(t,n,e)}},et=function(){function t(t){this.options=t||{},this.livesLeft=this.options.lives||1/0}return t.prototype.getAssistant=function(t){return nt.createAssistantToTheTransportManager(this,t,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})},t.prototype.isAlive=function(){return this.livesLeft>0},t.prototype.reportDeath=function(){this.livesLeft-=1},t}(),rt=function(){function t(t,n){this.strategies=t,this.loop=Boolean(n.loop),this.failFast=Boolean(n.failFast),this.timeout=n.timeout,this.timeoutLimit=n.timeoutLimit}return t.prototype.isSupported=function(){return r.b(this.strategies,h.a.method("isSupported"))},t.prototype.connect=function(t,n){var e=this,r=this.strategies,o=0,i=this.timeout,s=null,a=function(c,u){u?n(null,u):(o+=1,e.loop&&(o%=r.length),o0&&(o=new Z.a(e.timeout,(function(){i.abort(),r(!0)}))),i=t.connect(n,(function(t,n){t&&o&&o.isRunning()&&!e.failFast||(o&&o.ensureAborted(),r(t,n))})),{abort:function(){o&&o.ensureAborted(),i.abort()},forceMinPriority:function(t){i.forceMinPriority(t)}}},t}(),ot=function(){function t(t){this.strategies=t}return t.prototype.isSupported=function(){return r.b(this.strategies,h.a.method("isSupported"))},t.prototype.connect=function(t,n){return function(t,n,e){var o=r.j(t,(function(t,r,o,i){return t.connect(n,e(r,i))}));return{abort:function(){r.c(o,it)},forceMinPriority:function(t){r.c(o,(function(n){n.forceMinPriority(t)}))}}}(this.strategies,t,(function(t,e){return function(o,i){e[t].error=o,o?function(t){return r.a(t,(function(t){return Boolean(t.error)}))}(e)&&n(!0):(r.c(e,(function(t){t.forceMinPriority(i.transport.priority)})),n(null,i))}}))},t}();function it(t){t.error||t.aborted||(t.abort(),t.aborted=!0)}var st=function(){function t(t,n,e){this.strategy=t,this.transports=n,this.ttl=e.ttl||18e5,this.usingTLS=e.useTLS,this.timeline=e.timeline}return t.prototype.isSupported=function(){return this.strategy.isSupported()},t.prototype.connect=function(t,n){var e=this.usingTLS,o=function(t){var n=Mt.getLocalStorage();if(n)try{var e=n[at(t)];if(e)return JSON.parse(e)}catch(n){ct(t)}return null}(e),i=[this.strategy];if(o&&o.timestamp+this.ttl>=h.a.now()){var s=this.transports[o.transport];s&&(this.timeline.info({cached:!0,transport:o.transport,latency:o.latency}),i.push(new rt([s],{timeout:2*o.latency+1e3,failFast:!0})))}var a=h.a.now(),c=i.pop().connect(t,(function o(s,u){s?(ct(e),i.length>0?(a=h.a.now(),c=i.pop().connect(t,o)):n(s)):(!function(t,n,e){var o=Mt.getLocalStorage();if(o)try{o[at(t)]=r.l({timestamp:h.a.now(),transport:n,latency:e})}catch(t){}}(e,u.transport.name,h.a.now()-a),n(null,u))}));return{abort:function(){c.abort()},forceMinPriority:function(n){t=n,c&&c.forceMinPriority(n)}}},t}();function at(t){return"pusherTransport"+(t?"TLS":"NonTLS")}function ct(t){var n=Mt.getLocalStorage();if(n)try{delete n[at(t)]}catch(t){}}var ut=function(){function t(t,n){var e=n.delay;this.strategy=t,this.options={delay:e}}return t.prototype.isSupported=function(){return this.strategy.isSupported()},t.prototype.connect=function(t,n){var e,r=this.strategy,o=new Z.a(this.options.delay,(function(){e=r.connect(t,n)}));return{abort:function(){o.ensureAborted(),e&&e.abort()},forceMinPriority:function(n){t=n,e&&e.forceMinPriority(n)}}},t}(),ht=function(){function t(t,n,e){this.test=t,this.trueBranch=n,this.falseBranch=e}return t.prototype.isSupported=function(){return(this.test()?this.trueBranch:this.falseBranch).isSupported()},t.prototype.connect=function(t,n){return(this.test()?this.trueBranch:this.falseBranch).connect(t,n)},t}(),ft=function(){function t(t){this.strategy=t}return t.prototype.isSupported=function(){return this.strategy.isSupported()},t.prototype.connect=function(t,n){var e=this.strategy.connect(t,(function(t,r){r&&e.abort(),n(t,r)}));return e},t}();function lt(t){return function(){return t.isSupported()}}var pt,dt=function(t,n,e){var o={};function i(n,r,i,s,a){var c=e(t,n,r,i,s,a);return o[n]=c,c}var s,a=Object.assign({},n,{hostNonTLS:t.wsHost+":"+t.wsPort,hostTLS:t.wsHost+":"+t.wssPort,httpPath:t.wsPath}),c=r.f({},a,{useTLS:!0}),u=Object.assign({},n,{hostNonTLS:t.httpHost+":"+t.httpPort,hostTLS:t.httpHost+":"+t.httpsPort,httpPath:t.httpPath}),h={loop:!0,timeout:15e3,timeoutLimit:6e4},f=new et({lives:2,minPingDelay:1e4,maxPingDelay:t.activityTimeout}),l=new et({lives:2,minPingDelay:1e4,maxPingDelay:t.activityTimeout}),p=i("ws","ws",3,a,f),d=i("wss","ws",3,c,f),y=i("xhr_streaming","xhr_streaming",1,u,l),g=i("xhr_polling","xhr_polling",1,u),v=new rt([p],h),b=new rt([d],h),m=new rt([y],h),_=new rt([g],h),w=new rt([new ht(lt(m),new ot([m,new ut(_,{delay:4e3})]),_)],h);return s=n.useTLS?new ot([v,new ut(w,{delay:2e3})]):new ot([v,new ut(b,{delay:2e3}),new ut(w,{delay:5e3})]),new st(new ft(new ht(lt(p),s,w)),o,{ttl:18e5,timeline:n.timeline,useTLS:n.useTLS})},yt=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(n,e)};return function(n,e){function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}(),gt=function(t){function n(n,e,r){var o=t.call(this)||this;return o.hooks=n,o.method=e,o.url=r,o}return yt(n,t),n.prototype.start=function(t){var n=this;this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=function(){n.close()},Mt.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(t)},n.prototype.close=function(){this.unloader&&(Mt.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)},n.prototype.onChunk=function(t,n){for(;;){var e=this.advanceBuffer(n);if(!e)break;this.emit("chunk",{status:t,data:e})}this.isBufferTooLong(n)&&this.emit("buffer_too_long")},n.prototype.advanceBuffer=function(t){var n=t.slice(this.position),e=n.indexOf("\n");return-1!==e?(this.position+=e+1,n.slice(0,e)):null},n.prototype.isBufferTooLong=function(t){return this.position===t.length&&t.length>262144},n}(f.a);!function(t){t[t.CONNECTING=0]="CONNECTING",t[t.OPEN=1]="OPEN",t[t.CLOSED=3]="CLOSED"}(pt||(pt={}));var vt=pt,bt=1;function mt(t){var n=-1===t.indexOf("?")?"?":"&";return t+n+"t="+ +new Date+"&n="+bt++}function _t(t){return Math.floor(Math.random()*t)}var wt=function(){function t(t,n){this.hooks=t,this.session=_t(1e3)+"/"+function(t){for(var n=[],e=0;e0&&t.onChunk(n.status,n.responseText);break;case 4:n.responseText&&n.responseText.length>0&&t.onChunk(n.status,n.responseText),t.emit("finished",n.status),t.close()}},n},abortRequest:function(t){t.onreadystatechange=null,t.abort()}},Ct={getDefaultStrategy:dt,Transports:w,transportConnectionInitializer:function(){this.timeline.info(this.buildTimelineMessage({transport:this.name+(this.options.useTLS?"s":"")})),this.hooks.isInitialized()?this.changeState("initialized"):this.onClose()},HTTPFactory:{createStreamingSocket:function(t){return this.createSocket(St,t)},createPollingSocket:function(t){return this.createSocket(kt,t)},createSocket:function(t,n){return new wt(t,n)},createXHR:function(t,n){return this.createRequest(Tt,t,n)},createRequest:function(t,n,e){return new gt(t,n,e)}},setup:function(t){t.ready()},getLocalStorage:function(){},getClientFeatures:function(){return r.i(r.h({ws:w.ws},(function(t){return t.isSupported({})})))},getProtocol:function(){return"http:"},isXHRSupported:function(){return!0},createSocketRequest:function(t,n){if(this.isXHRSupported())return this.HTTPFactory.createXHR(t,n);throw"Cross-origin HTTP requests are not supported"},createXHR:function(){return new(this.getXHRAPI())},createWebSocket:function(t){return new(this.getWebSocketAPI())(t)},addUnloadListener:function(t){},removeUnloadListener:function(t){}},Ot=e(9),Pt=e.n(Ot),At=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(n,e)};return function(n,e){function r(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}();function Et(t){return"none"!==t.type.toLowerCase()}var xt,Lt=new(function(t){function n(){var n=t.call(this)||this;return n.online=!0,Pt.a.fetch().then((function(t){n.online=Et(t)})),Pt.a.addEventListener((function(t){var e=Et(t);n.online!==e&&(n.online=e,n.online?n.emit("online"):n.emit("offline"))})),n}return At(n,t),n.prototype.isOnline=function(){return this.online},n}(f.a)),Ut=function(t,n,e){var r,o=this;for(var i in(r=Mt.createXHR()).open("POST",o.options.authEndpoint,!0),r.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),this.authOptions.headers)r.setRequestHeader(i,this.authOptions.headers[i]);return r.onreadystatechange=function(){if(4===r.readyState)if(200===r.status){var t=void 0,n=!1;try{t=JSON.parse(r.responseText),n=!0}catch(t){e(new N(200,"JSON returned from auth endpoint was invalid, yet status code was 200. Data was: "+r.responseText),{auth:""})}n&&e(null,t)}else{var i=B("authenticationEndpoint");e(new N(r.status,"Unable to retrieve auth string from auth endpoint - received status: "+r.status+" from "+o.options.authEndpoint+". Clients must be authenticated to join private or presence channels. "+i),{auth:""})}},r.send(this.composeQuery(n)),r},Mt={getDefaultStrategy:Ct.getDefaultStrategy,Transports:Ct.Transports,setup:Ct.setup,getProtocol:Ct.getProtocol,isXHRSupported:Ct.isXHRSupported,getLocalStorage:Ct.getLocalStorage,createXHR:Ct.createXHR,createWebSocket:Ct.createWebSocket,addUnloadListener:Ct.addUnloadListener,removeUnloadListener:Ct.removeUnloadListener,transportConnectionInitializer:Ct.transportConnectionInitializer,createSocketRequest:Ct.createSocketRequest,HTTPFactory:Ct.HTTPFactory,TimelineTransport:{name:"xhr",getAgent:function(t,n){return function(e,o){var i="http"+(n?"s":"")+"://"+(t.host||t.options.host)+t.options.path;i+="/2?"+r.e(e);var s=Mt.createXHR();s.open("GET",i,!0),s.onreadystatechange=function(){if(4===s.readyState){var n=s.status,e=s.responseText;if(200!==n)return void l.a.debug("TimelineSender Error: received "+n+" from stats.pusher.com");try{var r=JSON.parse(e).host}catch(t){l.a.debug("TimelineSenderError: invalid response "+e)}r&&(t.host=r)}},s.send()}}},getAuthorizers:function(){return{ajax:Ut}},getWebSocketAPI:function(){return WebSocket},getXHRAPI:function(){return XMLHttpRequest},getNetwork:function(){return Lt}};!function(t){t[t.ERROR=3]="ERROR",t[t.INFO=6]="INFO",t[t.DEBUG=7]="DEBUG"}(xt||(xt={}));var Rt=xt,jt=function(){function t(t,n,e){this.key=t,this.session=n,this.events=[],this.options=e||{},this.sent=0,this.uniqueID=0}return t.prototype.log=function(t,n){t<=this.options.level&&(this.events.push(r.f({},n,{timestamp:h.a.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())},t.prototype.error=function(t){this.log(Rt.ERROR,t)},t.prototype.info=function(t){this.log(Rt.INFO,t)},t.prototype.debug=function(t){this.log(Rt.DEBUG,t)},t.prototype.isEmpty=function(){return 0===this.events.length},t.prototype.send=function(t,n){var e=this,o=r.f({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],t(o,(function(t,r){t||e.sent++,n&&n(t,r)})),!0},t.prototype.generateUniqueID=function(){return this.uniqueID++,this.uniqueID},t}(),It=function(){function t(t,n,e,r){this.name=t,this.priority=n,this.transport=e,this.options=r||{}}return t.prototype.isSupported=function(){return this.transport.isSupported({useTLS:this.options.useTLS})},t.prototype.connect=function(t,n){var e=this;if(!this.isSupported())return Nt(new I,n);if(this.priority>>18&63),n+=this._encodeByte(r>>>12&63),n+=this._encodeByte(r>>>6&63),n+=this._encodeByte(r>>>0&63)}var o=t.length-e;if(o>0){r=t[e]<<16|(2===o?t[e+1]<<8:0);n+=this._encodeByte(r>>>18&63),n+=this._encodeByte(r>>>12&63),n+=2===o?this._encodeByte(r>>>6&63):this._paddingCharacter||"",n+=this._paddingCharacter||""}return n},t.prototype.maxDecodedLength=function(t){return this._paddingCharacter?t/4*3|0:(6*t+7)/8|0},t.prototype.decodedLength=function(t){return this.maxDecodedLength(t.length-this._getPaddingLength(t))},t.prototype.decode=function(t){if(0===t.length)return new Uint8Array(0);for(var n=this._getPaddingLength(t),e=t.length-n,r=new Uint8Array(this.maxDecodedLength(e)),o=0,i=0,s=0,a=0,c=0,u=0,h=0;i>>4,r[o++]=c<<4|u>>>2,r[o++]=u<<6|h,s|=256&a,s|=256&c,s|=256&u,s|=256&h;if(i>>4,s|=256&a,s|=256&c),i>>2,s|=256&u),i>>8&6,n+=51-t>>>8&-75,n+=61-t>>>8&-15,n+=62-t>>>8&3,String.fromCharCode(n)},t.prototype._decodeChar=function(t){var n=256;return n+=(42-t&t-44)>>>8&-256+t-43+62,n+=(46-t&t-48)>>>8&-256+t-47+63,n+=(47-t&t-58)>>>8&-256+t-48+52,n+=(64-t&t-91)>>>8&-256+t-65+0,n+=(96-t&t-123)>>>8&-256+t-97+26},t.prototype._getPaddingLength=function(t){var n=0;if(this._paddingCharacter){for(var e=t.length-1;e>=0&&t[e]===this._paddingCharacter;e--)n++;if(t.length<4||n>2)throw new Error("Base64Coder: incorrect padding")}return n},t}();n.Coder=i;var s=new i;n.encode=function(t){return s.encode(t)},n.decode=function(t){return s.decode(t)};var a=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return o(n,t),n.prototype._encodeByte=function(t){var n=t;return n+=65,n+=25-t>>>8&6,n+=51-t>>>8&-75,n+=61-t>>>8&-13,n+=62-t>>>8&49,String.fromCharCode(n)},n.prototype._decodeChar=function(t){var n=256;return n+=(44-t&t-46)>>>8&-256+t-45+62,n+=(94-t&t-96)>>>8&-256+t-95+63,n+=(47-t&t-58)>>>8&-256+t-48+52,n+=(64-t&t-91)>>>8&-256+t-65+0,n+=(96-t&t-123)>>>8&-256+t-97+26},n}(i);n.URLSafeCoder=a;var c=new a;n.encodeURLSafe=function(t){return c.encode(t)},n.decodeURLSafe=function(t){return c.decode(t)},n.encodedLength=function(t){return s.encodedLength(t)},n.maxDecodedLength=function(t){return s.maxDecodedLength(t)},n.decodedLength=function(t){return s.decodedLength(t)}},function(t,n,e){"use strict";var r=function(){function t(t,n,e,r){var o=this;this.clear=n,this.timer=t((function(){o.timer&&(o.timer=r(o.timer))}),e)}return t.prototype.isRunning=function(){return null!==this.timer},t.prototype.ensureAborted=function(){this.timer&&(this.clear(this.timer),this.timer=null)},t}();n.a=r},function(t,n){t.exports=require("@react-native-community/netinfo")},function(t,n,e){"use strict";(function(t){function r(t){return l(h(t))}e.d(n,"a",(function(){return r}));for(var o=String.fromCharCode,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s={},a=0,c=i.length;a>>6)+o(128|63&n):o(224|n>>>12&15)+o(128|n>>>6&63)+o(128|63&n)},h=function(t){return t.replace(/[^\x00-\x7F]/g,u)},f=function(t){var n=[0,2,1][t.length%3],e=t.charCodeAt(0)<<16|(t.length>1?t.charCodeAt(1):0)<<8|(t.length>2?t.charCodeAt(2):0);return[i.charAt(e>>>18),i.charAt(e>>>12&63),n>=2?"=":i.charAt(e>>>6&63),n>=1?"=":i.charAt(63&e)].join("")},l=t.btoa||function(t){return t.replace(/[\s\S]{1,3}/g,f)}}).call(this,e(6))},function(t,n,e){"use strict";var r=e(0),o=function(){function t(){this._callbacks={}}return t.prototype.get=function(t){return this._callbacks[i(t)]},t.prototype.add=function(t,n,e){var r=i(t);this._callbacks[r]=this._callbacks[r]||[],this._callbacks[r].push({fn:n,context:e})},t.prototype.remove=function(t,n,e){if(t||n||e){var o=t?[i(t)]:r.i(this._callbacks);n||e?this.removeCallback(o,n,e):this.removeAllCallbacks(o)}else this._callbacks={}},t.prototype.removeCallback=function(t,n,e){r.c(t,(function(t){this._callbacks[t]=r.g(this._callbacks[t]||[],(function(t){return n&&n!==t.fn||e&&e!==t.context})),0===this._callbacks[t].length&&delete this._callbacks[t]}),this)},t.prototype.removeAllCallbacks=function(t){r.c(t,(function(t){delete this._callbacks[t]}),this)},t}();function i(t){return"_"+t}n.a=o},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r="utf8: invalid source encoding";function o(t){for(var n=0,e=0;e=t.length-1)throw new Error("utf8: invalid string");e++,n+=4}}return n}n.encode=function(t){for(var n=new Uint8Array(o(t)),e=0,r=0;r>6,n[e++]=128|63&i):i<55296?(n[e++]=224|i>>12,n[e++]=128|i>>6&63,n[e++]=128|63&i):(r++,i=(1023&i)<<10,i|=1023&t.charCodeAt(r),i+=65536,n[e++]=240|i>>18,n[e++]=128|i>>12&63,n[e++]=128|i>>6&63,n[e++]=128|63&i)}return n},n.encodedLength=o,n.decode=function(t){for(var n=[],e=0;e=t.length)throw new Error(r);if(128!=(192&(s=t[++e])))throw new Error(r);o=(31&o)<<6|63&s,i=128}else if(o<240){if(e>=t.length-1)throw new Error(r);var s=t[++e],a=t[++e];if(128!=(192&s)||128!=(192&a))throw new Error(r);o=(15&o)<<12|(63&s)<<6|63&a,i=2048}else{if(!(o<248))throw new Error(r);if(e>=t.length-2)throw new Error(r);s=t[++e],a=t[++e];var c=t[++e];if(128!=(192&s)||128!=(192&a)||128!=(192&c))throw new Error(r);o=(15&o)<<18|(63&s)<<12|(63&a)<<6|63&c,i=65536}if(o=55296&&o<=57343)throw new Error(r);if(o>=65536){if(o>1114111)throw new Error(r);o-=65536,n.push(String.fromCharCode(55296|o>>10)),o=56320|1023&o}}n.push(String.fromCharCode(o))}return n.join("")}},function(t,n,e){!function(t){"use strict";var n=function(t){var n,e=new Float64Array(16);if(t)for(n=0;n>24&255,t[n+1]=e>>16&255,t[n+2]=e>>8&255,t[n+3]=255&e,t[n+4]=r>>24&255,t[n+5]=r>>16&255,t[n+6]=r>>8&255,t[n+7]=255&r}function y(t,n,e,r,o){var i,s=0;for(i=0;i>>8)-1}function g(t,n,e,r){return y(t,n,e,r,16)}function v(t,n,e,r){return y(t,n,e,r,32)}function b(t,n,e,r){!function(t,n,e,r){for(var o,i=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,a=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,c=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,u=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,h=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,f=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,l=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,p=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,d=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,y=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,g=255&e[16]|(255&e[17])<<8|(255&e[18])<<16|(255&e[19])<<24,v=255&e[20]|(255&e[21])<<8|(255&e[22])<<16|(255&e[23])<<24,b=255&e[24]|(255&e[25])<<8|(255&e[26])<<16|(255&e[27])<<24,m=255&e[28]|(255&e[29])<<8|(255&e[30])<<16|(255&e[31])<<24,_=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,w=i,S=s,k=a,T=c,C=u,O=h,P=f,A=l,E=p,x=d,L=y,U=g,M=v,R=b,j=m,I=_,N=0;N<20;N+=2)w^=(o=(M^=(o=(E^=(o=(C^=(o=w+M|0)<<7|o>>>25)+w|0)<<9|o>>>23)+C|0)<<13|o>>>19)+E|0)<<18|o>>>14,O^=(o=(S^=(o=(R^=(o=(x^=(o=O+S|0)<<7|o>>>25)+O|0)<<9|o>>>23)+x|0)<<13|o>>>19)+R|0)<<18|o>>>14,L^=(o=(P^=(o=(k^=(o=(j^=(o=L+P|0)<<7|o>>>25)+L|0)<<9|o>>>23)+j|0)<<13|o>>>19)+k|0)<<18|o>>>14,I^=(o=(U^=(o=(A^=(o=(T^=(o=I+U|0)<<7|o>>>25)+I|0)<<9|o>>>23)+T|0)<<13|o>>>19)+A|0)<<18|o>>>14,w^=(o=(T^=(o=(k^=(o=(S^=(o=w+T|0)<<7|o>>>25)+w|0)<<9|o>>>23)+S|0)<<13|o>>>19)+k|0)<<18|o>>>14,O^=(o=(C^=(o=(A^=(o=(P^=(o=O+C|0)<<7|o>>>25)+O|0)<<9|o>>>23)+P|0)<<13|o>>>19)+A|0)<<18|o>>>14,L^=(o=(x^=(o=(E^=(o=(U^=(o=L+x|0)<<7|o>>>25)+L|0)<<9|o>>>23)+U|0)<<13|o>>>19)+E|0)<<18|o>>>14,I^=(o=(j^=(o=(R^=(o=(M^=(o=I+j|0)<<7|o>>>25)+I|0)<<9|o>>>23)+M|0)<<13|o>>>19)+R|0)<<18|o>>>14;w=w+i|0,S=S+s|0,k=k+a|0,T=T+c|0,C=C+u|0,O=O+h|0,P=P+f|0,A=A+l|0,E=E+p|0,x=x+d|0,L=L+y|0,U=U+g|0,M=M+v|0,R=R+b|0,j=j+m|0,I=I+_|0,t[0]=w>>>0&255,t[1]=w>>>8&255,t[2]=w>>>16&255,t[3]=w>>>24&255,t[4]=S>>>0&255,t[5]=S>>>8&255,t[6]=S>>>16&255,t[7]=S>>>24&255,t[8]=k>>>0&255,t[9]=k>>>8&255,t[10]=k>>>16&255,t[11]=k>>>24&255,t[12]=T>>>0&255,t[13]=T>>>8&255,t[14]=T>>>16&255,t[15]=T>>>24&255,t[16]=C>>>0&255,t[17]=C>>>8&255,t[18]=C>>>16&255,t[19]=C>>>24&255,t[20]=O>>>0&255,t[21]=O>>>8&255,t[22]=O>>>16&255,t[23]=O>>>24&255,t[24]=P>>>0&255,t[25]=P>>>8&255,t[26]=P>>>16&255,t[27]=P>>>24&255,t[28]=A>>>0&255,t[29]=A>>>8&255,t[30]=A>>>16&255,t[31]=A>>>24&255,t[32]=E>>>0&255,t[33]=E>>>8&255,t[34]=E>>>16&255,t[35]=E>>>24&255,t[36]=x>>>0&255,t[37]=x>>>8&255,t[38]=x>>>16&255,t[39]=x>>>24&255,t[40]=L>>>0&255,t[41]=L>>>8&255,t[42]=L>>>16&255,t[43]=L>>>24&255,t[44]=U>>>0&255,t[45]=U>>>8&255,t[46]=U>>>16&255,t[47]=U>>>24&255,t[48]=M>>>0&255,t[49]=M>>>8&255,t[50]=M>>>16&255,t[51]=M>>>24&255,t[52]=R>>>0&255,t[53]=R>>>8&255,t[54]=R>>>16&255,t[55]=R>>>24&255,t[56]=j>>>0&255,t[57]=j>>>8&255,t[58]=j>>>16&255,t[59]=j>>>24&255,t[60]=I>>>0&255,t[61]=I>>>8&255,t[62]=I>>>16&255,t[63]=I>>>24&255}(t,n,e,r)}function m(t,n,e,r){!function(t,n,e,r){for(var o,i=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,a=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,c=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,u=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,h=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,f=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,l=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,p=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,d=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,y=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,g=255&e[16]|(255&e[17])<<8|(255&e[18])<<16|(255&e[19])<<24,v=255&e[20]|(255&e[21])<<8|(255&e[22])<<16|(255&e[23])<<24,b=255&e[24]|(255&e[25])<<8|(255&e[26])<<16|(255&e[27])<<24,m=255&e[28]|(255&e[29])<<8|(255&e[30])<<16|(255&e[31])<<24,_=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,w=0;w<20;w+=2)i^=(o=(v^=(o=(p^=(o=(u^=(o=i+v|0)<<7|o>>>25)+i|0)<<9|o>>>23)+u|0)<<13|o>>>19)+p|0)<<18|o>>>14,h^=(o=(s^=(o=(b^=(o=(d^=(o=h+s|0)<<7|o>>>25)+h|0)<<9|o>>>23)+d|0)<<13|o>>>19)+b|0)<<18|o>>>14,y^=(o=(f^=(o=(a^=(o=(m^=(o=y+f|0)<<7|o>>>25)+y|0)<<9|o>>>23)+m|0)<<13|o>>>19)+a|0)<<18|o>>>14,_^=(o=(g^=(o=(l^=(o=(c^=(o=_+g|0)<<7|o>>>25)+_|0)<<9|o>>>23)+c|0)<<13|o>>>19)+l|0)<<18|o>>>14,i^=(o=(c^=(o=(a^=(o=(s^=(o=i+c|0)<<7|o>>>25)+i|0)<<9|o>>>23)+s|0)<<13|o>>>19)+a|0)<<18|o>>>14,h^=(o=(u^=(o=(l^=(o=(f^=(o=h+u|0)<<7|o>>>25)+h|0)<<9|o>>>23)+f|0)<<13|o>>>19)+l|0)<<18|o>>>14,y^=(o=(d^=(o=(p^=(o=(g^=(o=y+d|0)<<7|o>>>25)+y|0)<<9|o>>>23)+g|0)<<13|o>>>19)+p|0)<<18|o>>>14,_^=(o=(m^=(o=(b^=(o=(v^=(o=_+m|0)<<7|o>>>25)+_|0)<<9|o>>>23)+v|0)<<13|o>>>19)+b|0)<<18|o>>>14;t[0]=i>>>0&255,t[1]=i>>>8&255,t[2]=i>>>16&255,t[3]=i>>>24&255,t[4]=h>>>0&255,t[5]=h>>>8&255,t[6]=h>>>16&255,t[7]=h>>>24&255,t[8]=y>>>0&255,t[9]=y>>>8&255,t[10]=y>>>16&255,t[11]=y>>>24&255,t[12]=_>>>0&255,t[13]=_>>>8&255,t[14]=_>>>16&255,t[15]=_>>>24&255,t[16]=f>>>0&255,t[17]=f>>>8&255,t[18]=f>>>16&255,t[19]=f>>>24&255,t[20]=l>>>0&255,t[21]=l>>>8&255,t[22]=l>>>16&255,t[23]=l>>>24&255,t[24]=p>>>0&255,t[25]=p>>>8&255,t[26]=p>>>16&255,t[27]=p>>>24&255,t[28]=d>>>0&255,t[29]=d>>>8&255,t[30]=d>>>16&255,t[31]=d>>>24&255}(t,n,e,r)}var _=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function w(t,n,e,r,o,i,s){var a,c,u=new Uint8Array(16),h=new Uint8Array(64);for(c=0;c<16;c++)u[c]=0;for(c=0;c<8;c++)u[c]=i[c];for(;o>=64;){for(b(h,u,s,_),c=0;c<64;c++)t[n+c]=e[r+c]^h[c];for(a=1,c=8;c<16;c++)a=a+(255&u[c])|0,u[c]=255&a,a>>>=8;o-=64,n+=64,r+=64}if(o>0)for(b(h,u,s,_),c=0;c=64;){for(b(c,a,o,_),s=0;s<64;s++)t[n+s]=c[s];for(i=1,s=8;s<16;s++)i=i+(255&a[s])|0,a[s]=255&i,i>>>=8;e-=64,n+=64}if(e>0)for(b(c,a,o,_),s=0;s>>13|e<<3),r=255&t[4]|(255&t[5])<<8,this.r[2]=7939&(e>>>10|r<<6),o=255&t[6]|(255&t[7])<<8,this.r[3]=8191&(r>>>7|o<<9),i=255&t[8]|(255&t[9])<<8,this.r[4]=255&(o>>>4|i<<12),this.r[5]=i>>>1&8190,s=255&t[10]|(255&t[11])<<8,this.r[6]=8191&(i>>>14|s<<2),a=255&t[12]|(255&t[13])<<8,this.r[7]=8065&(s>>>11|a<<5),c=255&t[14]|(255&t[15])<<8,this.r[8]=8191&(a>>>8|c<<8),this.r[9]=c>>>5&127,this.pad[0]=255&t[16]|(255&t[17])<<8,this.pad[1]=255&t[18]|(255&t[19])<<8,this.pad[2]=255&t[20]|(255&t[21])<<8,this.pad[3]=255&t[22]|(255&t[23])<<8,this.pad[4]=255&t[24]|(255&t[25])<<8,this.pad[5]=255&t[26]|(255&t[27])<<8,this.pad[6]=255&t[28]|(255&t[29])<<8,this.pad[7]=255&t[30]|(255&t[31])<<8};function O(t,n,e,r,o,i){var s=new C(i);return s.update(e,r,o),s.finish(t,n),0}function P(t,n,e,r,o,i){var s=new Uint8Array(16);return O(s,0,e,r,o,i),g(t,n,s,0)}function A(t,n,e,r,o){var i;if(e<32)return-1;for(T(t,0,n,0,e,r,o),O(t,16,t,32,e-32,t),i=0;i<16;i++)t[i]=0;return 0}function E(t,n,e,r,o){var i,s=new Uint8Array(32);if(e<32)return-1;if(k(s,0,32,r,o),0!==P(n,16,n,32,e-32,s))return-1;for(T(t,0,n,0,e,r,o),i=0;i<32;i++)t[i]=0;return 0}function x(t,n){var e;for(e=0;e<16;e++)t[e]=0|n[e]}function L(t){var n,e,r=1;for(n=0;n<16;n++)e=t[n]+r+65535,r=Math.floor(e/65536),t[n]=e-65536*r;t[0]+=r-1+37*(r-1)}function U(t,n,e){for(var r,o=~(e-1),i=0;i<16;i++)r=o&(t[i]^n[i]),t[i]^=r,n[i]^=r}function M(t,e){var r,o,i,s=n(),a=n();for(r=0;r<16;r++)a[r]=e[r];for(L(a),L(a),L(a),o=0;o<2;o++){for(s[0]=a[0]-65517,r=1;r<15;r++)s[r]=a[r]-65535-(s[r-1]>>16&1),s[r-1]&=65535;s[15]=a[15]-32767-(s[14]>>16&1),i=s[15]>>16&1,s[14]&=65535,U(a,s,1-i)}for(r=0;r<16;r++)t[2*r]=255&a[r],t[2*r+1]=a[r]>>8}function R(t,n){var e=new Uint8Array(32),r=new Uint8Array(32);return M(e,t),M(r,n),v(e,0,r,0)}function j(t){var n=new Uint8Array(32);return M(n,t),1&n[0]}function I(t,n){var e;for(e=0;e<16;e++)t[e]=n[2*e]+(n[2*e+1]<<8);t[15]&=32767}function N(t,n,e){for(var r=0;r<16;r++)t[r]=n[r]+e[r]}function D(t,n,e){for(var r=0;r<16;r++)t[r]=n[r]-e[r]}function B(t,n,e){var r,o,i=0,s=0,a=0,c=0,u=0,h=0,f=0,l=0,p=0,d=0,y=0,g=0,v=0,b=0,m=0,_=0,w=0,S=0,k=0,T=0,C=0,O=0,P=0,A=0,E=0,x=0,L=0,U=0,M=0,R=0,j=0,I=e[0],N=e[1],D=e[2],B=e[3],H=e[4],z=e[5],F=e[6],q=e[7],Y=e[8],K=e[9],X=e[10],J=e[11],W=e[12],G=e[13],V=e[14],Z=e[15];i+=(r=n[0])*I,s+=r*N,a+=r*D,c+=r*B,u+=r*H,h+=r*z,f+=r*F,l+=r*q,p+=r*Y,d+=r*K,y+=r*X,g+=r*J,v+=r*W,b+=r*G,m+=r*V,_+=r*Z,s+=(r=n[1])*I,a+=r*N,c+=r*D,u+=r*B,h+=r*H,f+=r*z,l+=r*F,p+=r*q,d+=r*Y,y+=r*K,g+=r*X,v+=r*J,b+=r*W,m+=r*G,_+=r*V,w+=r*Z,a+=(r=n[2])*I,c+=r*N,u+=r*D,h+=r*B,f+=r*H,l+=r*z,p+=r*F,d+=r*q,y+=r*Y,g+=r*K,v+=r*X,b+=r*J,m+=r*W,_+=r*G,w+=r*V,S+=r*Z,c+=(r=n[3])*I,u+=r*N,h+=r*D,f+=r*B,l+=r*H,p+=r*z,d+=r*F,y+=r*q,g+=r*Y,v+=r*K,b+=r*X,m+=r*J,_+=r*W,w+=r*G,S+=r*V,k+=r*Z,u+=(r=n[4])*I,h+=r*N,f+=r*D,l+=r*B,p+=r*H,d+=r*z,y+=r*F,g+=r*q,v+=r*Y,b+=r*K,m+=r*X,_+=r*J,w+=r*W,S+=r*G,k+=r*V,T+=r*Z,h+=(r=n[5])*I,f+=r*N,l+=r*D,p+=r*B,d+=r*H,y+=r*z,g+=r*F,v+=r*q,b+=r*Y,m+=r*K,_+=r*X,w+=r*J,S+=r*W,k+=r*G,T+=r*V,C+=r*Z,f+=(r=n[6])*I,l+=r*N,p+=r*D,d+=r*B,y+=r*H,g+=r*z,v+=r*F,b+=r*q,m+=r*Y,_+=r*K,w+=r*X,S+=r*J,k+=r*W,T+=r*G,C+=r*V,O+=r*Z,l+=(r=n[7])*I,p+=r*N,d+=r*D,y+=r*B,g+=r*H,v+=r*z,b+=r*F,m+=r*q,_+=r*Y,w+=r*K,S+=r*X,k+=r*J,T+=r*W,C+=r*G,O+=r*V,P+=r*Z,p+=(r=n[8])*I,d+=r*N,y+=r*D,g+=r*B,v+=r*H,b+=r*z,m+=r*F,_+=r*q,w+=r*Y,S+=r*K,k+=r*X,T+=r*J,C+=r*W,O+=r*G,P+=r*V,A+=r*Z,d+=(r=n[9])*I,y+=r*N,g+=r*D,v+=r*B,b+=r*H,m+=r*z,_+=r*F,w+=r*q,S+=r*Y,k+=r*K,T+=r*X,C+=r*J,O+=r*W,P+=r*G,A+=r*V,E+=r*Z,y+=(r=n[10])*I,g+=r*N,v+=r*D,b+=r*B,m+=r*H,_+=r*z,w+=r*F,S+=r*q,k+=r*Y,T+=r*K,C+=r*X,O+=r*J,P+=r*W,A+=r*G,E+=r*V,x+=r*Z,g+=(r=n[11])*I,v+=r*N,b+=r*D,m+=r*B,_+=r*H,w+=r*z,S+=r*F,k+=r*q,T+=r*Y,C+=r*K,O+=r*X,P+=r*J,A+=r*W,E+=r*G,x+=r*V,L+=r*Z,v+=(r=n[12])*I,b+=r*N,m+=r*D,_+=r*B,w+=r*H,S+=r*z,k+=r*F,T+=r*q,C+=r*Y,O+=r*K,P+=r*X,A+=r*J,E+=r*W,x+=r*G,L+=r*V,U+=r*Z,b+=(r=n[13])*I,m+=r*N,_+=r*D,w+=r*B,S+=r*H,k+=r*z,T+=r*F,C+=r*q,O+=r*Y,P+=r*K,A+=r*X,E+=r*J,x+=r*W,L+=r*G,U+=r*V,M+=r*Z,m+=(r=n[14])*I,_+=r*N,w+=r*D,S+=r*B,k+=r*H,T+=r*z,C+=r*F,O+=r*q,P+=r*Y,A+=r*K,E+=r*X,x+=r*J,L+=r*W,U+=r*G,M+=r*V,R+=r*Z,_+=(r=n[15])*I,s+=38*(S+=r*D),a+=38*(k+=r*B),c+=38*(T+=r*H),u+=38*(C+=r*z),h+=38*(O+=r*F),f+=38*(P+=r*q),l+=38*(A+=r*Y),p+=38*(E+=r*K),d+=38*(x+=r*X),y+=38*(L+=r*J),g+=38*(U+=r*W),v+=38*(M+=r*G),b+=38*(R+=r*V),m+=38*(j+=r*Z),i=(r=(i+=38*(w+=r*N))+(o=1)+65535)-65536*(o=Math.floor(r/65536)),s=(r=s+o+65535)-65536*(o=Math.floor(r/65536)),a=(r=a+o+65535)-65536*(o=Math.floor(r/65536)),c=(r=c+o+65535)-65536*(o=Math.floor(r/65536)),u=(r=u+o+65535)-65536*(o=Math.floor(r/65536)),h=(r=h+o+65535)-65536*(o=Math.floor(r/65536)),f=(r=f+o+65535)-65536*(o=Math.floor(r/65536)),l=(r=l+o+65535)-65536*(o=Math.floor(r/65536)),p=(r=p+o+65535)-65536*(o=Math.floor(r/65536)),d=(r=d+o+65535)-65536*(o=Math.floor(r/65536)),y=(r=y+o+65535)-65536*(o=Math.floor(r/65536)),g=(r=g+o+65535)-65536*(o=Math.floor(r/65536)),v=(r=v+o+65535)-65536*(o=Math.floor(r/65536)),b=(r=b+o+65535)-65536*(o=Math.floor(r/65536)),m=(r=m+o+65535)-65536*(o=Math.floor(r/65536)),_=(r=_+o+65535)-65536*(o=Math.floor(r/65536)),i=(r=(i+=o-1+37*(o-1))+(o=1)+65535)-65536*(o=Math.floor(r/65536)),s=(r=s+o+65535)-65536*(o=Math.floor(r/65536)),a=(r=a+o+65535)-65536*(o=Math.floor(r/65536)),c=(r=c+o+65535)-65536*(o=Math.floor(r/65536)),u=(r=u+o+65535)-65536*(o=Math.floor(r/65536)),h=(r=h+o+65535)-65536*(o=Math.floor(r/65536)),f=(r=f+o+65535)-65536*(o=Math.floor(r/65536)),l=(r=l+o+65535)-65536*(o=Math.floor(r/65536)),p=(r=p+o+65535)-65536*(o=Math.floor(r/65536)),d=(r=d+o+65535)-65536*(o=Math.floor(r/65536)),y=(r=y+o+65535)-65536*(o=Math.floor(r/65536)),g=(r=g+o+65535)-65536*(o=Math.floor(r/65536)),v=(r=v+o+65535)-65536*(o=Math.floor(r/65536)),b=(r=b+o+65535)-65536*(o=Math.floor(r/65536)),m=(r=m+o+65535)-65536*(o=Math.floor(r/65536)),_=(r=_+o+65535)-65536*(o=Math.floor(r/65536)),i+=o-1+37*(o-1),t[0]=i,t[1]=s,t[2]=a,t[3]=c,t[4]=u,t[5]=h,t[6]=f,t[7]=l,t[8]=p,t[9]=d,t[10]=y,t[11]=g,t[12]=v,t[13]=b,t[14]=m,t[15]=_}function H(t,n){B(t,n,n)}function z(t,e){var r,o=n();for(r=0;r<16;r++)o[r]=e[r];for(r=253;r>=0;r--)H(o,o),2!==r&&4!==r&&B(o,o,e);for(r=0;r<16;r++)t[r]=o[r]}function F(t,e){var r,o=n();for(r=0;r<16;r++)o[r]=e[r];for(r=250;r>=0;r--)H(o,o),1!==r&&B(o,o,e);for(r=0;r<16;r++)t[r]=o[r]}function q(t,e,r){var o,i,s=new Uint8Array(32),a=new Float64Array(80),u=n(),h=n(),f=n(),l=n(),p=n(),d=n();for(i=0;i<31;i++)s[i]=e[i];for(s[31]=127&e[31]|64,s[0]&=248,I(a,r),i=0;i<16;i++)h[i]=a[i],l[i]=u[i]=f[i]=0;for(u[0]=l[0]=1,i=254;i>=0;--i)U(u,h,o=s[i>>>3]>>>(7&i)&1),U(f,l,o),N(p,u,f),D(u,u,f),N(f,h,l),D(h,h,l),H(l,p),H(d,u),B(u,f,u),B(f,h,p),N(p,u,f),D(u,u,f),H(h,u),D(f,l,d),B(u,f,c),N(u,u,l),B(f,f,u),B(u,l,d),B(l,h,a),H(h,p),U(u,h,o),U(f,l,o);for(i=0;i<16;i++)a[i+16]=u[i],a[i+32]=f[i],a[i+48]=h[i],a[i+64]=l[i];var y=a.subarray(32),g=a.subarray(16);return z(y,y),B(g,g,y),M(t,g),0}function Y(t,n){return q(t,n,i)}function K(t,n){return r(n,32),Y(t,n)}function X(t,n,e){var r=new Uint8Array(32);return q(r,e,n),m(t,o,r,_)}C.prototype.blocks=function(t,n,e){for(var r,o,i,s,a,c,u,h,f,l,p,d,y,g,v,b,m,_,w,S=this.fin?0:2048,k=this.h[0],T=this.h[1],C=this.h[2],O=this.h[3],P=this.h[4],A=this.h[5],E=this.h[6],x=this.h[7],L=this.h[8],U=this.h[9],M=this.r[0],R=this.r[1],j=this.r[2],I=this.r[3],N=this.r[4],D=this.r[5],B=this.r[6],H=this.r[7],z=this.r[8],F=this.r[9];e>=16;)l=f=0,l+=(k+=8191&(r=255&t[n+0]|(255&t[n+1])<<8))*M,l+=(T+=8191&(r>>>13|(o=255&t[n+2]|(255&t[n+3])<<8)<<3))*(5*F),l+=(C+=8191&(o>>>10|(i=255&t[n+4]|(255&t[n+5])<<8)<<6))*(5*z),l+=(O+=8191&(i>>>7|(s=255&t[n+6]|(255&t[n+7])<<8)<<9))*(5*H),f=(l+=(P+=8191&(s>>>4|(a=255&t[n+8]|(255&t[n+9])<<8)<<12))*(5*B))>>>13,l&=8191,l+=(A+=a>>>1&8191)*(5*D),l+=(E+=8191&(a>>>14|(c=255&t[n+10]|(255&t[n+11])<<8)<<2))*(5*N),l+=(x+=8191&(c>>>11|(u=255&t[n+12]|(255&t[n+13])<<8)<<5))*(5*I),l+=(L+=8191&(u>>>8|(h=255&t[n+14]|(255&t[n+15])<<8)<<8))*(5*j),p=f+=(l+=(U+=h>>>5|S)*(5*R))>>>13,p+=k*R,p+=T*M,p+=C*(5*F),p+=O*(5*z),f=(p+=P*(5*H))>>>13,p&=8191,p+=A*(5*B),p+=E*(5*D),p+=x*(5*N),p+=L*(5*I),f+=(p+=U*(5*j))>>>13,p&=8191,d=f,d+=k*j,d+=T*R,d+=C*M,d+=O*(5*F),f=(d+=P*(5*z))>>>13,d&=8191,d+=A*(5*H),d+=E*(5*B),d+=x*(5*D),d+=L*(5*N),y=f+=(d+=U*(5*I))>>>13,y+=k*I,y+=T*j,y+=C*R,y+=O*M,f=(y+=P*(5*F))>>>13,y&=8191,y+=A*(5*z),y+=E*(5*H),y+=x*(5*B),y+=L*(5*D),g=f+=(y+=U*(5*N))>>>13,g+=k*N,g+=T*I,g+=C*j,g+=O*R,f=(g+=P*M)>>>13,g&=8191,g+=A*(5*F),g+=E*(5*z),g+=x*(5*H),g+=L*(5*B),v=f+=(g+=U*(5*D))>>>13,v+=k*D,v+=T*N,v+=C*I,v+=O*j,f=(v+=P*R)>>>13,v&=8191,v+=A*M,v+=E*(5*F),v+=x*(5*z),v+=L*(5*H),b=f+=(v+=U*(5*B))>>>13,b+=k*B,b+=T*D,b+=C*N,b+=O*I,f=(b+=P*j)>>>13,b&=8191,b+=A*R,b+=E*M,b+=x*(5*F),b+=L*(5*z),m=f+=(b+=U*(5*H))>>>13,m+=k*H,m+=T*B,m+=C*D,m+=O*N,f=(m+=P*I)>>>13,m&=8191,m+=A*j,m+=E*R,m+=x*M,m+=L*(5*F),_=f+=(m+=U*(5*z))>>>13,_+=k*z,_+=T*H,_+=C*B,_+=O*D,f=(_+=P*N)>>>13,_&=8191,_+=A*I,_+=E*j,_+=x*R,_+=L*M,w=f+=(_+=U*(5*F))>>>13,w+=k*F,w+=T*z,w+=C*H,w+=O*B,f=(w+=P*D)>>>13,w&=8191,w+=A*N,w+=E*I,w+=x*j,w+=L*R,k=l=8191&(f=(f=((f+=(w+=U*M)>>>13)<<2)+f|0)+(l&=8191)|0),T=p+=f>>>=13,C=d&=8191,O=y&=8191,P=g&=8191,A=v&=8191,E=b&=8191,x=m&=8191,L=_&=8191,U=w&=8191,n+=16,e-=16;this.h[0]=k,this.h[1]=T,this.h[2]=C,this.h[3]=O,this.h[4]=P,this.h[5]=A,this.h[6]=E,this.h[7]=x,this.h[8]=L,this.h[9]=U},C.prototype.finish=function(t,n){var e,r,o,i,s=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;i<16;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(e=this.h[1]>>>13,this.h[1]&=8191,i=2;i<10;i++)this.h[i]+=e,e=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*e,e=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=e,e=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=e,s[0]=this.h[0]+5,e=s[0]>>>13,s[0]&=8191,i=1;i<10;i++)s[i]=this.h[i]+e,e=s[i]>>>13,s[i]&=8191;for(s[9]-=8192,r=(1^e)-1,i=0;i<10;i++)s[i]&=r;for(r=~r,i=0;i<10;i++)this.h[i]=this.h[i]&r|s[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),o=this.h[0]+this.pad[0],this.h[0]=65535&o,i=1;i<8;i++)o=(this.h[i]+this.pad[i]|0)+(o>>>16)|0,this.h[i]=65535&o;t[n+0]=this.h[0]>>>0&255,t[n+1]=this.h[0]>>>8&255,t[n+2]=this.h[1]>>>0&255,t[n+3]=this.h[1]>>>8&255,t[n+4]=this.h[2]>>>0&255,t[n+5]=this.h[2]>>>8&255,t[n+6]=this.h[3]>>>0&255,t[n+7]=this.h[3]>>>8&255,t[n+8]=this.h[4]>>>0&255,t[n+9]=this.h[4]>>>8&255,t[n+10]=this.h[5]>>>0&255,t[n+11]=this.h[5]>>>8&255,t[n+12]=this.h[6]>>>0&255,t[n+13]=this.h[6]>>>8&255,t[n+14]=this.h[7]>>>0&255,t[n+15]=this.h[7]>>>8&255},C.prototype.update=function(t,n,e){var r,o;if(this.leftover){for((o=16-this.leftover)>e&&(o=e),r=0;r=16&&(o=e-e%16,this.blocks(t,n,o),n+=o,e-=o),e){for(r=0;r=128;){for(S=0;S<16;S++)k=8*S+W,x[S]=e[k+0]<<24|e[k+1]<<16|e[k+2]<<8|e[k+3],L[S]=e[k+4]<<24|e[k+5]<<16|e[k+6]<<8|e[k+7];for(S=0;S<80;S++)if(o=U,i=M,s=R,a=j,c=I,u=N,h=D,B,l=H,p=z,d=F,y=q,g=Y,v=K,b=X,J,O=65535&(C=J),P=C>>>16,A=65535&(T=B),E=T>>>16,O+=65535&(C=(Y>>>14|I<<18)^(Y>>>18|I<<14)^(I>>>9|Y<<23)),P+=C>>>16,A+=65535&(T=(I>>>14|Y<<18)^(I>>>18|Y<<14)^(Y>>>9|I<<23)),E+=T>>>16,O+=65535&(C=Y&K^~Y&X),P+=C>>>16,A+=65535&(T=I&N^~I&D),E+=T>>>16,O+=65535&(C=G[2*S+1]),P+=C>>>16,A+=65535&(T=G[2*S]),E+=T>>>16,T=x[S%16],P+=(C=L[S%16])>>>16,A+=65535&T,E+=T>>>16,A+=(P+=(O+=65535&C)>>>16)>>>16,O=65535&(C=w=65535&O|P<<16),P=C>>>16,A=65535&(T=_=65535&A|(E+=A>>>16)<<16),E=T>>>16,O+=65535&(C=(H>>>28|U<<4)^(U>>>2|H<<30)^(U>>>7|H<<25)),P+=C>>>16,A+=65535&(T=(U>>>28|H<<4)^(H>>>2|U<<30)^(H>>>7|U<<25)),E+=T>>>16,P+=(C=H&z^H&F^z&F)>>>16,A+=65535&(T=U&M^U&R^M&R),E+=T>>>16,f=65535&(A+=(P+=(O+=65535&C)>>>16)>>>16)|(E+=A>>>16)<<16,m=65535&O|P<<16,O=65535&(C=y),P=C>>>16,A=65535&(T=a),E=T>>>16,P+=(C=w)>>>16,A+=65535&(T=_),E+=T>>>16,M=o,R=i,j=s,I=a=65535&(A+=(P+=(O+=65535&C)>>>16)>>>16)|(E+=A>>>16)<<16,N=c,D=u,B=h,U=f,z=l,F=p,q=d,Y=y=65535&O|P<<16,K=g,X=v,J=b,H=m,S%16==15)for(k=0;k<16;k++)T=x[k],O=65535&(C=L[k]),P=C>>>16,A=65535&T,E=T>>>16,T=x[(k+9)%16],O+=65535&(C=L[(k+9)%16]),P+=C>>>16,A+=65535&T,E+=T>>>16,_=x[(k+1)%16],O+=65535&(C=((w=L[(k+1)%16])>>>1|_<<31)^(w>>>8|_<<24)^(w>>>7|_<<25)),P+=C>>>16,A+=65535&(T=(_>>>1|w<<31)^(_>>>8|w<<24)^_>>>7),E+=T>>>16,_=x[(k+14)%16],P+=(C=((w=L[(k+14)%16])>>>19|_<<13)^(_>>>29|w<<3)^(w>>>6|_<<26))>>>16,A+=65535&(T=(_>>>19|w<<13)^(w>>>29|_<<3)^_>>>6),E+=T>>>16,E+=(A+=(P+=(O+=65535&C)>>>16)>>>16)>>>16,x[k]=65535&A|E<<16,L[k]=65535&O|P<<16;O=65535&(C=H),P=C>>>16,A=65535&(T=U),E=T>>>16,T=t[0],P+=(C=n[0])>>>16,A+=65535&T,E+=T>>>16,E+=(A+=(P+=(O+=65535&C)>>>16)>>>16)>>>16,t[0]=U=65535&A|E<<16,n[0]=H=65535&O|P<<16,O=65535&(C=z),P=C>>>16,A=65535&(T=M),E=T>>>16,T=t[1],P+=(C=n[1])>>>16,A+=65535&T,E+=T>>>16,E+=(A+=(P+=(O+=65535&C)>>>16)>>>16)>>>16,t[1]=M=65535&A|E<<16,n[1]=z=65535&O|P<<16,O=65535&(C=F),P=C>>>16,A=65535&(T=R),E=T>>>16,T=t[2],P+=(C=n[2])>>>16,A+=65535&T,E+=T>>>16,E+=(A+=(P+=(O+=65535&C)>>>16)>>>16)>>>16,t[2]=R=65535&A|E<<16,n[2]=F=65535&O|P<<16,O=65535&(C=q),P=C>>>16,A=65535&(T=j),E=T>>>16,T=t[3],P+=(C=n[3])>>>16,A+=65535&T,E+=T>>>16,E+=(A+=(P+=(O+=65535&C)>>>16)>>>16)>>>16,t[3]=j=65535&A|E<<16,n[3]=q=65535&O|P<<16,O=65535&(C=Y),P=C>>>16,A=65535&(T=I),E=T>>>16,T=t[4],P+=(C=n[4])>>>16,A+=65535&T,E+=T>>>16,E+=(A+=(P+=(O+=65535&C)>>>16)>>>16)>>>16,t[4]=I=65535&A|E<<16,n[4]=Y=65535&O|P<<16,O=65535&(C=K),P=C>>>16,A=65535&(T=N),E=T>>>16,T=t[5],P+=(C=n[5])>>>16,A+=65535&T,E+=T>>>16,E+=(A+=(P+=(O+=65535&C)>>>16)>>>16)>>>16,t[5]=N=65535&A|E<<16,n[5]=K=65535&O|P<<16,O=65535&(C=X),P=C>>>16,A=65535&(T=D),E=T>>>16,T=t[6],P+=(C=n[6])>>>16,A+=65535&T,E+=T>>>16,E+=(A+=(P+=(O+=65535&C)>>>16)>>>16)>>>16,t[6]=D=65535&A|E<<16,n[6]=X=65535&O|P<<16,O=65535&(C=J),P=C>>>16,A=65535&(T=B),E=T>>>16,T=t[7],P+=(C=n[7])>>>16,A+=65535&T,E+=T>>>16,E+=(A+=(P+=(O+=65535&C)>>>16)>>>16)>>>16,t[7]=B=65535&A|E<<16,n[7]=J=65535&O|P<<16,W+=128,r-=128}return r}function Z(t,n,e){var r,o=new Int32Array(8),i=new Int32Array(8),s=new Uint8Array(256),a=e;for(o[0]=1779033703,o[1]=3144134277,o[2]=1013904242,o[3]=2773480762,o[4]=1359893119,o[5]=2600822924,o[6]=528734635,o[7]=1541459225,i[0]=4089235720,i[1]=2227873595,i[2]=4271175723,i[3]=1595750129,i[4]=2917565137,i[5]=725511199,i[6]=4215389547,i[7]=327033209,V(o,i,n,e),e%=128,r=0;r=0;--o)$(t,n,r=e[o/8|0]>>(7&o)&1),Q(n,t),Q(t,t),$(t,n,r)}function et(t,e){var r=[n(),n(),n(),n()];x(r[0],f),x(r[1],l),x(r[2],a),B(r[3],f,l),nt(t,r,e)}function rt(t,e,o){var i,s=new Uint8Array(64),a=[n(),n(),n(),n()];for(o||r(e,32),Z(s,e,32),s[0]&=248,s[31]&=127,s[31]|=64,et(a,s),tt(t,a),i=0;i<32;i++)e[i+32]=t[i];return 0}var ot=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function it(t,n){var e,r,o,i;for(r=63;r>=32;--r){for(e=0,o=r-32,i=r-12;o>4)*ot[o],e=n[o]>>8,n[o]&=255;for(o=0;o<32;o++)n[o]-=e*ot[o];for(r=0;r<32;r++)n[r+1]+=n[r]>>8,t[r]=255&n[r]}function st(t){var n,e=new Float64Array(64);for(n=0;n<64;n++)e[n]=t[n];for(n=0;n<64;n++)t[n]=0;it(t,e)}function at(t,e,r,o){var i,s,a=new Uint8Array(64),c=new Uint8Array(64),u=new Uint8Array(64),h=new Float64Array(64),f=[n(),n(),n(),n()];Z(a,o,32),a[0]&=248,a[31]&=127,a[31]|=64;var l=r+64;for(i=0;i>7&&D(t[0],s,t[0]),B(t[3],t[0],t[1]),0)}(l,o))return-1;for(i=0;i=0},t.sign.keyPair=function(){var t=new Uint8Array(32),n=new Uint8Array(64);return rt(t,n),{publicKey:t,secretKey:n}},t.sign.keyPair.fromSecretKey=function(t){if(ht(t),64!==t.length)throw new Error("bad secret key size");for(var n=new Uint8Array(32),e=0;e>>18&63),e+=this._encodeByte(r>>>12&63),e+=this._encodeByte(r>>>6&63),e+=this._encodeByte(r>>>0&63)}var o=t.length-n;if(o>0){r=t[n]<<16|(2===o?t[n+1]<<8:0);e+=this._encodeByte(r>>>18&63),e+=this._encodeByte(r>>>12&63),e+=2===o?this._encodeByte(r>>>6&63):this._paddingCharacter||"",e+=this._paddingCharacter||""}return e},t.prototype.maxDecodedLength=function(t){return this._paddingCharacter?t/4*3|0:(6*t+7)/8|0},t.prototype.decodedLength=function(t){return this.maxDecodedLength(t.length-this._getPaddingLength(t))},t.prototype.decode=function(t){if(0===t.length)return new Uint8Array(0);for(var e=this._getPaddingLength(t),n=t.length-e,r=new Uint8Array(this.maxDecodedLength(n)),o=0,i=0,s=0,c=0,a=0,u=0,h=0;i>>4,r[o++]=a<<4|u>>>2,r[o++]=u<<6|h,s|=256&c,s|=256&a,s|=256&u,s|=256&h;if(i>>4,s|=256&c,s|=256&a),i>>2,s|=256&u),i>>8&6,e+=51-t>>>8&-75,e+=61-t>>>8&-15,e+=62-t>>>8&3,String.fromCharCode(e)},t.prototype._decodeChar=function(t){var e=256;return e+=(42-t&t-44)>>>8&-256+t-43+62,e+=(46-t&t-48)>>>8&-256+t-47+63,e+=(47-t&t-58)>>>8&-256+t-48+52,e+=(64-t&t-91)>>>8&-256+t-65+0,e+=(96-t&t-123)>>>8&-256+t-97+26},t.prototype._getPaddingLength=function(t){var e=0;if(this._paddingCharacter){for(var n=t.length-1;n>=0&&t[n]===this._paddingCharacter;n--)e++;if(t.length<4||e>2)throw new Error("Base64Coder: incorrect padding")}return e},t}();e.Coder=i;var s=new i;e.encode=function(t){return s.encode(t)},e.decode=function(t){return s.decode(t)};var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype._encodeByte=function(t){var e=t;return e+=65,e+=25-t>>>8&6,e+=51-t>>>8&-75,e+=61-t>>>8&-13,e+=62-t>>>8&49,String.fromCharCode(e)},e.prototype._decodeChar=function(t){var e=256;return e+=(44-t&t-46)>>>8&-256+t-45+62,e+=(94-t&t-96)>>>8&-256+t-95+63,e+=(47-t&t-58)>>>8&-256+t-48+52,e+=(64-t&t-91)>>>8&-256+t-65+0,e+=(96-t&t-123)>>>8&-256+t-97+26},e}(i);e.URLSafeCoder=c;var a=new c;e.encodeURLSafe=function(t){return a.encode(t)},e.decodeURLSafe=function(t){return a.decode(t)},e.encodedLength=function(t){return s.encodedLength(t)},e.maxDecodedLength=function(t){return s.maxDecodedLength(t)},e.decodedLength=function(t){return s.decodedLength(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r="utf8: invalid source encoding";function o(t){for(var e=0,n=0;n=t.length-1)throw new Error("utf8: invalid string");n++,e+=4}}return e}e.encode=function(t){for(var e=new Uint8Array(o(t)),n=0,r=0;r>6,e[n++]=128|63&i):i<55296?(e[n++]=224|i>>12,e[n++]=128|i>>6&63,e[n++]=128|63&i):(r++,i=(1023&i)<<10,i|=1023&t.charCodeAt(r),i+=65536,e[n++]=240|i>>18,e[n++]=128|i>>12&63,e[n++]=128|i>>6&63,e[n++]=128|63&i)}return e},e.encodedLength=o,e.decode=function(t){for(var e=[],n=0;n=t.length)throw new Error(r);if(128!=(192&(s=t[++n])))throw new Error(r);o=(31&o)<<6|63&s,i=128}else if(o<240){if(n>=t.length-1)throw new Error(r);var s=t[++n],c=t[++n];if(128!=(192&s)||128!=(192&c))throw new Error(r);o=(15&o)<<12|(63&s)<<6|63&c,i=2048}else{if(!(o<248))throw new Error(r);if(n>=t.length-2)throw new Error(r);s=t[++n],c=t[++n];var a=t[++n];if(128!=(192&s)||128!=(192&c)||128!=(192&a))throw new Error(r);o=(15&o)<<18|(63&s)<<12|(63&c)<<6|63&a,i=65536}if(o=55296&&o<=57343)throw new Error(r);if(o>=65536){if(o>1114111)throw new Error(r);o-=65536,e.push(String.fromCharCode(55296|o>>10)),o=56320|1023&o}}e.push(String.fromCharCode(o))}return e.join("")}},function(t,e,n){!function(t){"use strict";var e=function(t){var e,n=new Float64Array(16);if(t)for(e=0;e>24&255,t[e+1]=n>>16&255,t[e+2]=n>>8&255,t[e+3]=255&n,t[e+4]=r>>24&255,t[e+5]=r>>16&255,t[e+6]=r>>8&255,t[e+7]=255&r}function y(t,e,n,r,o){var i,s=0;for(i=0;i>>8)-1}function g(t,e,n,r){return y(t,e,n,r,16)}function v(t,e,n,r){return y(t,e,n,r,32)}function b(t,e,n,r){!function(t,e,n,r){for(var o,i=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,c=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,a=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,u=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,h=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,p=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,f=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,l=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,d=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,y=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,g=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,v=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,b=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,m=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,w=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,_=i,S=s,k=c,T=a,C=u,P=h,O=p,E=f,A=l,x=d,L=y,R=g,U=v,M=b,j=m,I=w,N=0;N<20;N+=2)_^=(o=(U^=(o=(A^=(o=(C^=(o=_+U|0)<<7|o>>>25)+_|0)<<9|o>>>23)+C|0)<<13|o>>>19)+A|0)<<18|o>>>14,P^=(o=(S^=(o=(M^=(o=(x^=(o=P+S|0)<<7|o>>>25)+P|0)<<9|o>>>23)+x|0)<<13|o>>>19)+M|0)<<18|o>>>14,L^=(o=(O^=(o=(k^=(o=(j^=(o=L+O|0)<<7|o>>>25)+L|0)<<9|o>>>23)+j|0)<<13|o>>>19)+k|0)<<18|o>>>14,I^=(o=(R^=(o=(E^=(o=(T^=(o=I+R|0)<<7|o>>>25)+I|0)<<9|o>>>23)+T|0)<<13|o>>>19)+E|0)<<18|o>>>14,_^=(o=(T^=(o=(k^=(o=(S^=(o=_+T|0)<<7|o>>>25)+_|0)<<9|o>>>23)+S|0)<<13|o>>>19)+k|0)<<18|o>>>14,P^=(o=(C^=(o=(E^=(o=(O^=(o=P+C|0)<<7|o>>>25)+P|0)<<9|o>>>23)+O|0)<<13|o>>>19)+E|0)<<18|o>>>14,L^=(o=(x^=(o=(A^=(o=(R^=(o=L+x|0)<<7|o>>>25)+L|0)<<9|o>>>23)+R|0)<<13|o>>>19)+A|0)<<18|o>>>14,I^=(o=(j^=(o=(M^=(o=(U^=(o=I+j|0)<<7|o>>>25)+I|0)<<9|o>>>23)+U|0)<<13|o>>>19)+M|0)<<18|o>>>14;_=_+i|0,S=S+s|0,k=k+c|0,T=T+a|0,C=C+u|0,P=P+h|0,O=O+p|0,E=E+f|0,A=A+l|0,x=x+d|0,L=L+y|0,R=R+g|0,U=U+v|0,M=M+b|0,j=j+m|0,I=I+w|0,t[0]=_>>>0&255,t[1]=_>>>8&255,t[2]=_>>>16&255,t[3]=_>>>24&255,t[4]=S>>>0&255,t[5]=S>>>8&255,t[6]=S>>>16&255,t[7]=S>>>24&255,t[8]=k>>>0&255,t[9]=k>>>8&255,t[10]=k>>>16&255,t[11]=k>>>24&255,t[12]=T>>>0&255,t[13]=T>>>8&255,t[14]=T>>>16&255,t[15]=T>>>24&255,t[16]=C>>>0&255,t[17]=C>>>8&255,t[18]=C>>>16&255,t[19]=C>>>24&255,t[20]=P>>>0&255,t[21]=P>>>8&255,t[22]=P>>>16&255,t[23]=P>>>24&255,t[24]=O>>>0&255,t[25]=O>>>8&255,t[26]=O>>>16&255,t[27]=O>>>24&255,t[28]=E>>>0&255,t[29]=E>>>8&255,t[30]=E>>>16&255,t[31]=E>>>24&255,t[32]=A>>>0&255,t[33]=A>>>8&255,t[34]=A>>>16&255,t[35]=A>>>24&255,t[36]=x>>>0&255,t[37]=x>>>8&255,t[38]=x>>>16&255,t[39]=x>>>24&255,t[40]=L>>>0&255,t[41]=L>>>8&255,t[42]=L>>>16&255,t[43]=L>>>24&255,t[44]=R>>>0&255,t[45]=R>>>8&255,t[46]=R>>>16&255,t[47]=R>>>24&255,t[48]=U>>>0&255,t[49]=U>>>8&255,t[50]=U>>>16&255,t[51]=U>>>24&255,t[52]=M>>>0&255,t[53]=M>>>8&255,t[54]=M>>>16&255,t[55]=M>>>24&255,t[56]=j>>>0&255,t[57]=j>>>8&255,t[58]=j>>>16&255,t[59]=j>>>24&255,t[60]=I>>>0&255,t[61]=I>>>8&255,t[62]=I>>>16&255,t[63]=I>>>24&255}(t,e,n,r)}function m(t,e,n,r){!function(t,e,n,r){for(var o,i=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,c=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,a=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,u=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,h=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,p=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,f=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,l=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,d=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,y=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,g=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,v=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,b=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,m=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,w=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,_=0;_<20;_+=2)i^=(o=(v^=(o=(l^=(o=(u^=(o=i+v|0)<<7|o>>>25)+i|0)<<9|o>>>23)+u|0)<<13|o>>>19)+l|0)<<18|o>>>14,h^=(o=(s^=(o=(b^=(o=(d^=(o=h+s|0)<<7|o>>>25)+h|0)<<9|o>>>23)+d|0)<<13|o>>>19)+b|0)<<18|o>>>14,y^=(o=(p^=(o=(c^=(o=(m^=(o=y+p|0)<<7|o>>>25)+y|0)<<9|o>>>23)+m|0)<<13|o>>>19)+c|0)<<18|o>>>14,w^=(o=(g^=(o=(f^=(o=(a^=(o=w+g|0)<<7|o>>>25)+w|0)<<9|o>>>23)+a|0)<<13|o>>>19)+f|0)<<18|o>>>14,i^=(o=(a^=(o=(c^=(o=(s^=(o=i+a|0)<<7|o>>>25)+i|0)<<9|o>>>23)+s|0)<<13|o>>>19)+c|0)<<18|o>>>14,h^=(o=(u^=(o=(f^=(o=(p^=(o=h+u|0)<<7|o>>>25)+h|0)<<9|o>>>23)+p|0)<<13|o>>>19)+f|0)<<18|o>>>14,y^=(o=(d^=(o=(l^=(o=(g^=(o=y+d|0)<<7|o>>>25)+y|0)<<9|o>>>23)+g|0)<<13|o>>>19)+l|0)<<18|o>>>14,w^=(o=(m^=(o=(b^=(o=(v^=(o=w+m|0)<<7|o>>>25)+w|0)<<9|o>>>23)+v|0)<<13|o>>>19)+b|0)<<18|o>>>14;t[0]=i>>>0&255,t[1]=i>>>8&255,t[2]=i>>>16&255,t[3]=i>>>24&255,t[4]=h>>>0&255,t[5]=h>>>8&255,t[6]=h>>>16&255,t[7]=h>>>24&255,t[8]=y>>>0&255,t[9]=y>>>8&255,t[10]=y>>>16&255,t[11]=y>>>24&255,t[12]=w>>>0&255,t[13]=w>>>8&255,t[14]=w>>>16&255,t[15]=w>>>24&255,t[16]=p>>>0&255,t[17]=p>>>8&255,t[18]=p>>>16&255,t[19]=p>>>24&255,t[20]=f>>>0&255,t[21]=f>>>8&255,t[22]=f>>>16&255,t[23]=f>>>24&255,t[24]=l>>>0&255,t[25]=l>>>8&255,t[26]=l>>>16&255,t[27]=l>>>24&255,t[28]=d>>>0&255,t[29]=d>>>8&255,t[30]=d>>>16&255,t[31]=d>>>24&255}(t,e,n,r)}var w=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function _(t,e,n,r,o,i,s){var c,a,u=new Uint8Array(16),h=new Uint8Array(64);for(a=0;a<16;a++)u[a]=0;for(a=0;a<8;a++)u[a]=i[a];for(;o>=64;){for(b(h,u,s,w),a=0;a<64;a++)t[e+a]=n[r+a]^h[a];for(c=1,a=8;a<16;a++)c=c+(255&u[a])|0,u[a]=255&c,c>>>=8;o-=64,e+=64,r+=64}if(o>0)for(b(h,u,s,w),a=0;a=64;){for(b(a,c,o,w),s=0;s<64;s++)t[e+s]=a[s];for(i=1,s=8;s<16;s++)i=i+(255&c[s])|0,c[s]=255&i,i>>>=8;n-=64,e+=64}if(n>0)for(b(a,c,o,w),s=0;s>>13|n<<3),r=255&t[4]|(255&t[5])<<8,this.r[2]=7939&(n>>>10|r<<6),o=255&t[6]|(255&t[7])<<8,this.r[3]=8191&(r>>>7|o<<9),i=255&t[8]|(255&t[9])<<8,this.r[4]=255&(o>>>4|i<<12),this.r[5]=i>>>1&8190,s=255&t[10]|(255&t[11])<<8,this.r[6]=8191&(i>>>14|s<<2),c=255&t[12]|(255&t[13])<<8,this.r[7]=8065&(s>>>11|c<<5),a=255&t[14]|(255&t[15])<<8,this.r[8]=8191&(c>>>8|a<<8),this.r[9]=a>>>5&127,this.pad[0]=255&t[16]|(255&t[17])<<8,this.pad[1]=255&t[18]|(255&t[19])<<8,this.pad[2]=255&t[20]|(255&t[21])<<8,this.pad[3]=255&t[22]|(255&t[23])<<8,this.pad[4]=255&t[24]|(255&t[25])<<8,this.pad[5]=255&t[26]|(255&t[27])<<8,this.pad[6]=255&t[28]|(255&t[29])<<8,this.pad[7]=255&t[30]|(255&t[31])<<8};function P(t,e,n,r,o,i){var s=new C(i);return s.update(n,r,o),s.finish(t,e),0}function O(t,e,n,r,o,i){var s=new Uint8Array(16);return P(s,0,n,r,o,i),g(t,e,s,0)}function E(t,e,n,r,o){var i;if(n<32)return-1;for(T(t,0,e,0,n,r,o),P(t,16,t,32,n-32,t),i=0;i<16;i++)t[i]=0;return 0}function A(t,e,n,r,o){var i,s=new Uint8Array(32);if(n<32)return-1;if(k(s,0,32,r,o),0!==O(e,16,e,32,n-32,s))return-1;for(T(t,0,e,0,n,r,o),i=0;i<32;i++)t[i]=0;return 0}function x(t,e){var n;for(n=0;n<16;n++)t[n]=0|e[n]}function L(t){var e,n,r=1;for(e=0;e<16;e++)n=t[e]+r+65535,r=Math.floor(n/65536),t[e]=n-65536*r;t[0]+=r-1+37*(r-1)}function R(t,e,n){for(var r,o=~(n-1),i=0;i<16;i++)r=o&(t[i]^e[i]),t[i]^=r,e[i]^=r}function U(t,n){var r,o,i,s=e(),c=e();for(r=0;r<16;r++)c[r]=n[r];for(L(c),L(c),L(c),o=0;o<2;o++){for(s[0]=c[0]-65517,r=1;r<15;r++)s[r]=c[r]-65535-(s[r-1]>>16&1),s[r-1]&=65535;s[15]=c[15]-32767-(s[14]>>16&1),i=s[15]>>16&1,s[14]&=65535,R(c,s,1-i)}for(r=0;r<16;r++)t[2*r]=255&c[r],t[2*r+1]=c[r]>>8}function M(t,e){var n=new Uint8Array(32),r=new Uint8Array(32);return U(n,t),U(r,e),v(n,0,r,0)}function j(t){var e=new Uint8Array(32);return U(e,t),1&e[0]}function I(t,e){var n;for(n=0;n<16;n++)t[n]=e[2*n]+(e[2*n+1]<<8);t[15]&=32767}function N(t,e,n){for(var r=0;r<16;r++)t[r]=e[r]+n[r]}function D(t,e,n){for(var r=0;r<16;r++)t[r]=e[r]-n[r]}function B(t,e,n){var r,o,i=0,s=0,c=0,a=0,u=0,h=0,p=0,f=0,l=0,d=0,y=0,g=0,v=0,b=0,m=0,w=0,_=0,S=0,k=0,T=0,C=0,P=0,O=0,E=0,A=0,x=0,L=0,R=0,U=0,M=0,j=0,I=n[0],N=n[1],D=n[2],B=n[3],H=n[4],z=n[5],q=n[6],F=n[7],X=n[8],J=n[9],Y=n[10],K=n[11],W=n[12],G=n[13],V=n[14],Q=n[15];i+=(r=e[0])*I,s+=r*N,c+=r*D,a+=r*B,u+=r*H,h+=r*z,p+=r*q,f+=r*F,l+=r*X,d+=r*J,y+=r*Y,g+=r*K,v+=r*W,b+=r*G,m+=r*V,w+=r*Q,s+=(r=e[1])*I,c+=r*N,a+=r*D,u+=r*B,h+=r*H,p+=r*z,f+=r*q,l+=r*F,d+=r*X,y+=r*J,g+=r*Y,v+=r*K,b+=r*W,m+=r*G,w+=r*V,_+=r*Q,c+=(r=e[2])*I,a+=r*N,u+=r*D,h+=r*B,p+=r*H,f+=r*z,l+=r*q,d+=r*F,y+=r*X,g+=r*J,v+=r*Y,b+=r*K,m+=r*W,w+=r*G,_+=r*V,S+=r*Q,a+=(r=e[3])*I,u+=r*N,h+=r*D,p+=r*B,f+=r*H,l+=r*z,d+=r*q,y+=r*F,g+=r*X,v+=r*J,b+=r*Y,m+=r*K,w+=r*W,_+=r*G,S+=r*V,k+=r*Q,u+=(r=e[4])*I,h+=r*N,p+=r*D,f+=r*B,l+=r*H,d+=r*z,y+=r*q,g+=r*F,v+=r*X,b+=r*J,m+=r*Y,w+=r*K,_+=r*W,S+=r*G,k+=r*V,T+=r*Q,h+=(r=e[5])*I,p+=r*N,f+=r*D,l+=r*B,d+=r*H,y+=r*z,g+=r*q,v+=r*F,b+=r*X,m+=r*J,w+=r*Y,_+=r*K,S+=r*W,k+=r*G,T+=r*V,C+=r*Q,p+=(r=e[6])*I,f+=r*N,l+=r*D,d+=r*B,y+=r*H,g+=r*z,v+=r*q,b+=r*F,m+=r*X,w+=r*J,_+=r*Y,S+=r*K,k+=r*W,T+=r*G,C+=r*V,P+=r*Q,f+=(r=e[7])*I,l+=r*N,d+=r*D,y+=r*B,g+=r*H,v+=r*z,b+=r*q,m+=r*F,w+=r*X,_+=r*J,S+=r*Y,k+=r*K,T+=r*W,C+=r*G,P+=r*V,O+=r*Q,l+=(r=e[8])*I,d+=r*N,y+=r*D,g+=r*B,v+=r*H,b+=r*z,m+=r*q,w+=r*F,_+=r*X,S+=r*J,k+=r*Y,T+=r*K,C+=r*W,P+=r*G,O+=r*V,E+=r*Q,d+=(r=e[9])*I,y+=r*N,g+=r*D,v+=r*B,b+=r*H,m+=r*z,w+=r*q,_+=r*F,S+=r*X,k+=r*J,T+=r*Y,C+=r*K,P+=r*W,O+=r*G,E+=r*V,A+=r*Q,y+=(r=e[10])*I,g+=r*N,v+=r*D,b+=r*B,m+=r*H,w+=r*z,_+=r*q,S+=r*F,k+=r*X,T+=r*J,C+=r*Y,P+=r*K,O+=r*W,E+=r*G,A+=r*V,x+=r*Q,g+=(r=e[11])*I,v+=r*N,b+=r*D,m+=r*B,w+=r*H,_+=r*z,S+=r*q,k+=r*F,T+=r*X,C+=r*J,P+=r*Y,O+=r*K,E+=r*W,A+=r*G,x+=r*V,L+=r*Q,v+=(r=e[12])*I,b+=r*N,m+=r*D,w+=r*B,_+=r*H,S+=r*z,k+=r*q,T+=r*F,C+=r*X,P+=r*J,O+=r*Y,E+=r*K,A+=r*W,x+=r*G,L+=r*V,R+=r*Q,b+=(r=e[13])*I,m+=r*N,w+=r*D,_+=r*B,S+=r*H,k+=r*z,T+=r*q,C+=r*F,P+=r*X,O+=r*J,E+=r*Y,A+=r*K,x+=r*W,L+=r*G,R+=r*V,U+=r*Q,m+=(r=e[14])*I,w+=r*N,_+=r*D,S+=r*B,k+=r*H,T+=r*z,C+=r*q,P+=r*F,O+=r*X,E+=r*J,A+=r*Y,x+=r*K,L+=r*W,R+=r*G,U+=r*V,M+=r*Q,w+=(r=e[15])*I,s+=38*(S+=r*D),c+=38*(k+=r*B),a+=38*(T+=r*H),u+=38*(C+=r*z),h+=38*(P+=r*q),p+=38*(O+=r*F),f+=38*(E+=r*X),l+=38*(A+=r*J),d+=38*(x+=r*Y),y+=38*(L+=r*K),g+=38*(R+=r*W),v+=38*(U+=r*G),b+=38*(M+=r*V),m+=38*(j+=r*Q),i=(r=(i+=38*(_+=r*N))+(o=1)+65535)-65536*(o=Math.floor(r/65536)),s=(r=s+o+65535)-65536*(o=Math.floor(r/65536)),c=(r=c+o+65535)-65536*(o=Math.floor(r/65536)),a=(r=a+o+65535)-65536*(o=Math.floor(r/65536)),u=(r=u+o+65535)-65536*(o=Math.floor(r/65536)),h=(r=h+o+65535)-65536*(o=Math.floor(r/65536)),p=(r=p+o+65535)-65536*(o=Math.floor(r/65536)),f=(r=f+o+65535)-65536*(o=Math.floor(r/65536)),l=(r=l+o+65535)-65536*(o=Math.floor(r/65536)),d=(r=d+o+65535)-65536*(o=Math.floor(r/65536)),y=(r=y+o+65535)-65536*(o=Math.floor(r/65536)),g=(r=g+o+65535)-65536*(o=Math.floor(r/65536)),v=(r=v+o+65535)-65536*(o=Math.floor(r/65536)),b=(r=b+o+65535)-65536*(o=Math.floor(r/65536)),m=(r=m+o+65535)-65536*(o=Math.floor(r/65536)),w=(r=w+o+65535)-65536*(o=Math.floor(r/65536)),i=(r=(i+=o-1+37*(o-1))+(o=1)+65535)-65536*(o=Math.floor(r/65536)),s=(r=s+o+65535)-65536*(o=Math.floor(r/65536)),c=(r=c+o+65535)-65536*(o=Math.floor(r/65536)),a=(r=a+o+65535)-65536*(o=Math.floor(r/65536)),u=(r=u+o+65535)-65536*(o=Math.floor(r/65536)),h=(r=h+o+65535)-65536*(o=Math.floor(r/65536)),p=(r=p+o+65535)-65536*(o=Math.floor(r/65536)),f=(r=f+o+65535)-65536*(o=Math.floor(r/65536)),l=(r=l+o+65535)-65536*(o=Math.floor(r/65536)),d=(r=d+o+65535)-65536*(o=Math.floor(r/65536)),y=(r=y+o+65535)-65536*(o=Math.floor(r/65536)),g=(r=g+o+65535)-65536*(o=Math.floor(r/65536)),v=(r=v+o+65535)-65536*(o=Math.floor(r/65536)),b=(r=b+o+65535)-65536*(o=Math.floor(r/65536)),m=(r=m+o+65535)-65536*(o=Math.floor(r/65536)),w=(r=w+o+65535)-65536*(o=Math.floor(r/65536)),i+=o-1+37*(o-1),t[0]=i,t[1]=s,t[2]=c,t[3]=a,t[4]=u,t[5]=h,t[6]=p,t[7]=f,t[8]=l,t[9]=d,t[10]=y,t[11]=g,t[12]=v,t[13]=b,t[14]=m,t[15]=w}function H(t,e){B(t,e,e)}function z(t,n){var r,o=e();for(r=0;r<16;r++)o[r]=n[r];for(r=253;r>=0;r--)H(o,o),2!==r&&4!==r&&B(o,o,n);for(r=0;r<16;r++)t[r]=o[r]}function q(t,n){var r,o=e();for(r=0;r<16;r++)o[r]=n[r];for(r=250;r>=0;r--)H(o,o),1!==r&&B(o,o,n);for(r=0;r<16;r++)t[r]=o[r]}function F(t,n,r){var o,i,s=new Uint8Array(32),c=new Float64Array(80),u=e(),h=e(),p=e(),f=e(),l=e(),d=e();for(i=0;i<31;i++)s[i]=n[i];for(s[31]=127&n[31]|64,s[0]&=248,I(c,r),i=0;i<16;i++)h[i]=c[i],f[i]=u[i]=p[i]=0;for(u[0]=f[0]=1,i=254;i>=0;--i)R(u,h,o=s[i>>>3]>>>(7&i)&1),R(p,f,o),N(l,u,p),D(u,u,p),N(p,h,f),D(h,h,f),H(f,l),H(d,u),B(u,p,u),B(p,h,l),N(l,u,p),D(u,u,p),H(h,u),D(p,f,d),B(u,p,a),N(u,u,f),B(p,p,u),B(u,f,d),B(f,h,c),H(h,l),R(u,h,o),R(p,f,o);for(i=0;i<16;i++)c[i+16]=u[i],c[i+32]=p[i],c[i+48]=h[i],c[i+64]=f[i];var y=c.subarray(32),g=c.subarray(16);return z(y,y),B(g,g,y),U(t,g),0}function X(t,e){return F(t,e,i)}function J(t,e){return r(e,32),X(t,e)}function Y(t,e,n){var r=new Uint8Array(32);return F(r,n,e),m(t,o,r,w)}C.prototype.blocks=function(t,e,n){for(var r,o,i,s,c,a,u,h,p,f,l,d,y,g,v,b,m,w,_,S=this.fin?0:2048,k=this.h[0],T=this.h[1],C=this.h[2],P=this.h[3],O=this.h[4],E=this.h[5],A=this.h[6],x=this.h[7],L=this.h[8],R=this.h[9],U=this.r[0],M=this.r[1],j=this.r[2],I=this.r[3],N=this.r[4],D=this.r[5],B=this.r[6],H=this.r[7],z=this.r[8],q=this.r[9];n>=16;)f=p=0,f+=(k+=8191&(r=255&t[e+0]|(255&t[e+1])<<8))*U,f+=(T+=8191&(r>>>13|(o=255&t[e+2]|(255&t[e+3])<<8)<<3))*(5*q),f+=(C+=8191&(o>>>10|(i=255&t[e+4]|(255&t[e+5])<<8)<<6))*(5*z),f+=(P+=8191&(i>>>7|(s=255&t[e+6]|(255&t[e+7])<<8)<<9))*(5*H),p=(f+=(O+=8191&(s>>>4|(c=255&t[e+8]|(255&t[e+9])<<8)<<12))*(5*B))>>>13,f&=8191,f+=(E+=c>>>1&8191)*(5*D),f+=(A+=8191&(c>>>14|(a=255&t[e+10]|(255&t[e+11])<<8)<<2))*(5*N),f+=(x+=8191&(a>>>11|(u=255&t[e+12]|(255&t[e+13])<<8)<<5))*(5*I),f+=(L+=8191&(u>>>8|(h=255&t[e+14]|(255&t[e+15])<<8)<<8))*(5*j),l=p+=(f+=(R+=h>>>5|S)*(5*M))>>>13,l+=k*M,l+=T*U,l+=C*(5*q),l+=P*(5*z),p=(l+=O*(5*H))>>>13,l&=8191,l+=E*(5*B),l+=A*(5*D),l+=x*(5*N),l+=L*(5*I),p+=(l+=R*(5*j))>>>13,l&=8191,d=p,d+=k*j,d+=T*M,d+=C*U,d+=P*(5*q),p=(d+=O*(5*z))>>>13,d&=8191,d+=E*(5*H),d+=A*(5*B),d+=x*(5*D),d+=L*(5*N),y=p+=(d+=R*(5*I))>>>13,y+=k*I,y+=T*j,y+=C*M,y+=P*U,p=(y+=O*(5*q))>>>13,y&=8191,y+=E*(5*z),y+=A*(5*H),y+=x*(5*B),y+=L*(5*D),g=p+=(y+=R*(5*N))>>>13,g+=k*N,g+=T*I,g+=C*j,g+=P*M,p=(g+=O*U)>>>13,g&=8191,g+=E*(5*q),g+=A*(5*z),g+=x*(5*H),g+=L*(5*B),v=p+=(g+=R*(5*D))>>>13,v+=k*D,v+=T*N,v+=C*I,v+=P*j,p=(v+=O*M)>>>13,v&=8191,v+=E*U,v+=A*(5*q),v+=x*(5*z),v+=L*(5*H),b=p+=(v+=R*(5*B))>>>13,b+=k*B,b+=T*D,b+=C*N,b+=P*I,p=(b+=O*j)>>>13,b&=8191,b+=E*M,b+=A*U,b+=x*(5*q),b+=L*(5*z),m=p+=(b+=R*(5*H))>>>13,m+=k*H,m+=T*B,m+=C*D,m+=P*N,p=(m+=O*I)>>>13,m&=8191,m+=E*j,m+=A*M,m+=x*U,m+=L*(5*q),w=p+=(m+=R*(5*z))>>>13,w+=k*z,w+=T*H,w+=C*B,w+=P*D,p=(w+=O*N)>>>13,w&=8191,w+=E*I,w+=A*j,w+=x*M,w+=L*U,_=p+=(w+=R*(5*q))>>>13,_+=k*q,_+=T*z,_+=C*H,_+=P*B,p=(_+=O*D)>>>13,_&=8191,_+=E*N,_+=A*I,_+=x*j,_+=L*M,k=f=8191&(p=(p=((p+=(_+=R*U)>>>13)<<2)+p|0)+(f&=8191)|0),T=l+=p>>>=13,C=d&=8191,P=y&=8191,O=g&=8191,E=v&=8191,A=b&=8191,x=m&=8191,L=w&=8191,R=_&=8191,e+=16,n-=16;this.h[0]=k,this.h[1]=T,this.h[2]=C,this.h[3]=P,this.h[4]=O,this.h[5]=E,this.h[6]=A,this.h[7]=x,this.h[8]=L,this.h[9]=R},C.prototype.finish=function(t,e){var n,r,o,i,s=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;i<16;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(n=this.h[1]>>>13,this.h[1]&=8191,i=2;i<10;i++)this.h[i]+=n,n=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*n,n=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=n,n=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=n,s[0]=this.h[0]+5,n=s[0]>>>13,s[0]&=8191,i=1;i<10;i++)s[i]=this.h[i]+n,n=s[i]>>>13,s[i]&=8191;for(s[9]-=8192,r=(1^n)-1,i=0;i<10;i++)s[i]&=r;for(r=~r,i=0;i<10;i++)this.h[i]=this.h[i]&r|s[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),o=this.h[0]+this.pad[0],this.h[0]=65535&o,i=1;i<8;i++)o=(this.h[i]+this.pad[i]|0)+(o>>>16)|0,this.h[i]=65535&o;t[e+0]=this.h[0]>>>0&255,t[e+1]=this.h[0]>>>8&255,t[e+2]=this.h[1]>>>0&255,t[e+3]=this.h[1]>>>8&255,t[e+4]=this.h[2]>>>0&255,t[e+5]=this.h[2]>>>8&255,t[e+6]=this.h[3]>>>0&255,t[e+7]=this.h[3]>>>8&255,t[e+8]=this.h[4]>>>0&255,t[e+9]=this.h[4]>>>8&255,t[e+10]=this.h[5]>>>0&255,t[e+11]=this.h[5]>>>8&255,t[e+12]=this.h[6]>>>0&255,t[e+13]=this.h[6]>>>8&255,t[e+14]=this.h[7]>>>0&255,t[e+15]=this.h[7]>>>8&255},C.prototype.update=function(t,e,n){var r,o;if(this.leftover){for((o=16-this.leftover)>n&&(o=n),r=0;r=16&&(o=n-n%16,this.blocks(t,e,o),e+=o,n-=o),n){for(r=0;r=128;){for(S=0;S<16;S++)k=8*S+W,x[S]=n[k+0]<<24|n[k+1]<<16|n[k+2]<<8|n[k+3],L[S]=n[k+4]<<24|n[k+5]<<16|n[k+6]<<8|n[k+7];for(S=0;S<80;S++)if(o=R,i=U,s=M,c=j,a=I,u=N,h=D,B,f=H,l=z,d=q,y=F,g=X,v=J,b=Y,K,P=65535&(C=K),O=C>>>16,E=65535&(T=B),A=T>>>16,P+=65535&(C=(X>>>14|I<<18)^(X>>>18|I<<14)^(I>>>9|X<<23)),O+=C>>>16,E+=65535&(T=(I>>>14|X<<18)^(I>>>18|X<<14)^(X>>>9|I<<23)),A+=T>>>16,P+=65535&(C=X&J^~X&Y),O+=C>>>16,E+=65535&(T=I&N^~I&D),A+=T>>>16,P+=65535&(C=G[2*S+1]),O+=C>>>16,E+=65535&(T=G[2*S]),A+=T>>>16,T=x[S%16],O+=(C=L[S%16])>>>16,E+=65535&T,A+=T>>>16,E+=(O+=(P+=65535&C)>>>16)>>>16,P=65535&(C=_=65535&P|O<<16),O=C>>>16,E=65535&(T=w=65535&E|(A+=E>>>16)<<16),A=T>>>16,P+=65535&(C=(H>>>28|R<<4)^(R>>>2|H<<30)^(R>>>7|H<<25)),O+=C>>>16,E+=65535&(T=(R>>>28|H<<4)^(H>>>2|R<<30)^(H>>>7|R<<25)),A+=T>>>16,O+=(C=H&z^H&q^z&q)>>>16,E+=65535&(T=R&U^R&M^U&M),A+=T>>>16,p=65535&(E+=(O+=(P+=65535&C)>>>16)>>>16)|(A+=E>>>16)<<16,m=65535&P|O<<16,P=65535&(C=y),O=C>>>16,E=65535&(T=c),A=T>>>16,O+=(C=_)>>>16,E+=65535&(T=w),A+=T>>>16,U=o,M=i,j=s,I=c=65535&(E+=(O+=(P+=65535&C)>>>16)>>>16)|(A+=E>>>16)<<16,N=a,D=u,B=h,R=p,z=f,q=l,F=d,X=y=65535&P|O<<16,J=g,Y=v,K=b,H=m,S%16==15)for(k=0;k<16;k++)T=x[k],P=65535&(C=L[k]),O=C>>>16,E=65535&T,A=T>>>16,T=x[(k+9)%16],P+=65535&(C=L[(k+9)%16]),O+=C>>>16,E+=65535&T,A+=T>>>16,w=x[(k+1)%16],P+=65535&(C=((_=L[(k+1)%16])>>>1|w<<31)^(_>>>8|w<<24)^(_>>>7|w<<25)),O+=C>>>16,E+=65535&(T=(w>>>1|_<<31)^(w>>>8|_<<24)^w>>>7),A+=T>>>16,w=x[(k+14)%16],O+=(C=((_=L[(k+14)%16])>>>19|w<<13)^(w>>>29|_<<3)^(_>>>6|w<<26))>>>16,E+=65535&(T=(w>>>19|_<<13)^(_>>>29|w<<3)^w>>>6),A+=T>>>16,A+=(E+=(O+=(P+=65535&C)>>>16)>>>16)>>>16,x[k]=65535&E|A<<16,L[k]=65535&P|O<<16;P=65535&(C=H),O=C>>>16,E=65535&(T=R),A=T>>>16,T=t[0],O+=(C=e[0])>>>16,E+=65535&T,A+=T>>>16,A+=(E+=(O+=(P+=65535&C)>>>16)>>>16)>>>16,t[0]=R=65535&E|A<<16,e[0]=H=65535&P|O<<16,P=65535&(C=z),O=C>>>16,E=65535&(T=U),A=T>>>16,T=t[1],O+=(C=e[1])>>>16,E+=65535&T,A+=T>>>16,A+=(E+=(O+=(P+=65535&C)>>>16)>>>16)>>>16,t[1]=U=65535&E|A<<16,e[1]=z=65535&P|O<<16,P=65535&(C=q),O=C>>>16,E=65535&(T=M),A=T>>>16,T=t[2],O+=(C=e[2])>>>16,E+=65535&T,A+=T>>>16,A+=(E+=(O+=(P+=65535&C)>>>16)>>>16)>>>16,t[2]=M=65535&E|A<<16,e[2]=q=65535&P|O<<16,P=65535&(C=F),O=C>>>16,E=65535&(T=j),A=T>>>16,T=t[3],O+=(C=e[3])>>>16,E+=65535&T,A+=T>>>16,A+=(E+=(O+=(P+=65535&C)>>>16)>>>16)>>>16,t[3]=j=65535&E|A<<16,e[3]=F=65535&P|O<<16,P=65535&(C=X),O=C>>>16,E=65535&(T=I),A=T>>>16,T=t[4],O+=(C=e[4])>>>16,E+=65535&T,A+=T>>>16,A+=(E+=(O+=(P+=65535&C)>>>16)>>>16)>>>16,t[4]=I=65535&E|A<<16,e[4]=X=65535&P|O<<16,P=65535&(C=J),O=C>>>16,E=65535&(T=N),A=T>>>16,T=t[5],O+=(C=e[5])>>>16,E+=65535&T,A+=T>>>16,A+=(E+=(O+=(P+=65535&C)>>>16)>>>16)>>>16,t[5]=N=65535&E|A<<16,e[5]=J=65535&P|O<<16,P=65535&(C=Y),O=C>>>16,E=65535&(T=D),A=T>>>16,T=t[6],O+=(C=e[6])>>>16,E+=65535&T,A+=T>>>16,A+=(E+=(O+=(P+=65535&C)>>>16)>>>16)>>>16,t[6]=D=65535&E|A<<16,e[6]=Y=65535&P|O<<16,P=65535&(C=K),O=C>>>16,E=65535&(T=B),A=T>>>16,T=t[7],O+=(C=e[7])>>>16,E+=65535&T,A+=T>>>16,A+=(E+=(O+=(P+=65535&C)>>>16)>>>16)>>>16,t[7]=B=65535&E|A<<16,e[7]=K=65535&P|O<<16,W+=128,r-=128}return r}function Q(t,e,n){var r,o=new Int32Array(8),i=new Int32Array(8),s=new Uint8Array(256),c=n;for(o[0]=1779033703,o[1]=3144134277,o[2]=1013904242,o[3]=2773480762,o[4]=1359893119,o[5]=2600822924,o[6]=528734635,o[7]=1541459225,i[0]=4089235720,i[1]=2227873595,i[2]=4271175723,i[3]=1595750129,i[4]=2917565137,i[5]=725511199,i[6]=4215389547,i[7]=327033209,V(o,i,e,n),n%=128,r=0;r=0;--o)$(t,e,r=n[o/8|0]>>(7&o)&1),Z(e,t),Z(t,t),$(t,e,r)}function nt(t,n){var r=[e(),e(),e(),e()];x(r[0],p),x(r[1],f),x(r[2],c),B(r[3],p,f),et(t,r,n)}function rt(t,n,o){var i,s=new Uint8Array(64),c=[e(),e(),e(),e()];for(o||r(n,32),Q(s,n,32),s[0]&=248,s[31]&=127,s[31]|=64,nt(c,s),tt(t,c),i=0;i<32;i++)n[i+32]=t[i];return 0}var ot=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function it(t,e){var n,r,o,i;for(r=63;r>=32;--r){for(n=0,o=r-32,i=r-12;o>4)*ot[o],n=e[o]>>8,e[o]&=255;for(o=0;o<32;o++)e[o]-=n*ot[o];for(r=0;r<32;r++)e[r+1]+=e[r]>>8,t[r]=255&e[r]}function st(t){var e,n=new Float64Array(64);for(e=0;e<64;e++)n[e]=t[e];for(e=0;e<64;e++)t[e]=0;it(t,n)}function ct(t,n,r,o){var i,s,c=new Uint8Array(64),a=new Uint8Array(64),u=new Uint8Array(64),h=new Float64Array(64),p=[e(),e(),e(),e()];Q(c,o,32),c[0]&=248,c[31]&=127,c[31]|=64;var f=r+64;for(i=0;i>7&&D(t[0],s,t[0]),B(t[3],t[0],t[1]),0)}(f,o))return-1;for(i=0;i=0},t.sign.keyPair=function(){var t=new Uint8Array(32),e=new Uint8Array(64);return rt(t,e),{publicKey:t,secretKey:e}},t.sign.keyPair.fromSecretKey=function(t){if(ht(t),64!==t.length)throw new Error("bad secret key size");for(var e=new Uint8Array(32),n=0;n0)r.loading[t].push(n);else{r.loading[t]=[n];var o=we.createScriptRequest(r.getPath(t,e)),i=r.receivers.create((function(e){if(r.receivers.remove(i),r.loading[t]){var n=r.loading[t];delete r.loading[t];for(var s=function(t){t||o.cleanup()},c=0;c>>6)+u(128|63&e):u(224|e>>>12&15)+u(128|e>>>6&63)+u(128|63&e)},g=function(t){return t.replace(/[^\x00-\x7F]/g,y)},v=function(t){var e=[0,2,1][t.length%3],n=t.charCodeAt(0)<<16|(t.length>1?t.charCodeAt(1):0)<<8|(t.length>2?t.charCodeAt(2):0);return[h.charAt(n>>>18),h.charAt(n>>>12&63),e>=2?"=":h.charAt(n>>>6&63),e>=1?"=":h.charAt(63&n)].join("")},b=window.btoa||function(t){return t.replace(/[\s\S]{1,3}/g,v)},m=function(){function t(t,e,n,r){var o=this;this.clear=e,this.timer=t((function(){o.timer&&(o.timer=r(o.timer))}),n)}return t.prototype.isRunning=function(){return null!==this.timer},t.prototype.ensureAborted=function(){this.timer&&(this.clear(this.timer),this.timer=null)},t}(),w=(d=function(t,e){return(d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}d(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});function _(t){window.clearTimeout(t)}function S(t){window.clearInterval(t)}var k=function(t){function e(e,n){return t.call(this,setTimeout,_,e,(function(t){return n(),null}))||this}return w(e,t),e}(m),T=function(t){function e(e,n){return t.call(this,setInterval,S,e,(function(t){return n(),t}))||this}return w(e,t),e}(m),C={now:function(){return Date.now?Date.now():(new Date).valueOf()},defer:function(t){return new k(0,t)},method:function(t){for(var e=[],n=1;n0)for(r=0;r=1002&&t.code<=1004?"backoff":null:4e3===t.code?"tls_only":t.code<4100?"refused":t.code<4200?"backoff":t.code<4300?"retry":"refused"},getCloseError:function(t){return 1e3!==t.code&&1001!==t.code?{type:"PusherError",data:{code:t.code,message:t.reason||t.message}}:null}},mt=bt,wt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_t=function(t){function e(e,n){var r=t.call(this)||this;return r.id=e,r.transport=n,r.activityTimeout=n.activityTimeout,r.bindListeners(),r}return wt(e,t),e.prototype.handlesActivityChecks=function(){return this.transport.handlesActivityChecks()},e.prototype.send=function(t){return this.transport.send(t)},e.prototype.send_event=function(t,e,n){var r={event:t,data:e};return n&&(r.channel=n),B.debug("Event sent",r),this.send(mt.encodeMessage(r))},e.prototype.ping=function(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})},e.prototype.close=function(){this.transport.close()},e.prototype.bindListeners=function(){var t=this,e={message:function(e){var n;try{n=mt.decodeMessage(e)}catch(n){t.emit("error",{type:"MessageParseError",error:n,data:e.data})}if(void 0!==n){switch(B.debug("Event recd",n),n.event){case"pusher:error":t.emit("error",{type:"PusherError",data:n.data});break;case"pusher:ping":t.emit("ping");break;case"pusher:pong":t.emit("pong")}t.emit("message",n)}},activity:function(){t.emit("activity")},error:function(e){t.emit("error",{type:"WebSocketError",error:e})},closed:function(e){n(),e&&e.code&&t.handleCloseEvent(e),t.transport=null,t.emit("closed")}},n=function(){A(e,(function(e,n){t.transport.unbind(n,e)}))};A(e,(function(e,n){t.transport.bind(n,e)}))},e.prototype.handleCloseEvent=function(t){var e=mt.getCloseAction(t),n=mt.getCloseError(t);n&&this.emit("error",n),e&&this.emit(e,{action:e,error:n})},e}(tt),St=function(){function t(t,e){this.transport=t,this.callback=e,this.bindListeners()}return t.prototype.close=function(){this.unbindListeners(),this.transport.close()},t.prototype.bindListeners=function(){var t=this;this.onMessage=function(e){var n;t.unbindListeners();try{n=mt.processHandshake(e)}catch(e){return t.finish("error",{error:e}),void t.transport.close()}"connected"===n.action?t.finish("connected",{connection:new _t(n.id,t.transport),activityTimeout:n.activityTimeout}):(t.finish(n.action,{error:n.error}),t.transport.close())},this.onClosed=function(e){t.unbindListeners();var n=mt.getCloseAction(e)||"backoff",r=mt.getCloseError(e);t.finish(n,{error:r})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)},t.prototype.unbindListeners=function(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)},t.prototype.finish=function(t,e){this.callback(P({transport:this.transport,action:t},e))},t}(),kt=function(){function t(t,e){this.channel=t;var n=e.authTransport;if(void 0===we.getAuthorizers()[n])throw"'"+n+"' is not a recognized auth transport";this.type=n,this.options=e,this.authOptions=e.auth||{}}return t.prototype.composeQuery=function(t){var e="socket_id="+encodeURIComponent(t)+"&channel_name="+encodeURIComponent(this.channel.name);for(var n in this.authOptions.params)e+="&"+encodeURIComponent(n)+"="+encodeURIComponent(this.authOptions.params[n]);return e},t.prototype.authorize=function(e,n){t.authorizers=t.authorizers||we.getAuthorizers(),t.authorizers[this.type].call(this,we,e,n)},t}(),Tt=function(){function t(t,e){this.timeline=t,this.options=e||{}}return t.prototype.send=function(t,e){this.timeline.isEmpty()||this.timeline.send(we.TimelineTransport.getAgent(this,t),e)},t}(),Ct=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Pt=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return Object.setPrototypeOf(r,n.prototype),r}return Ct(e,t),e}(Error),Ot=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return Object.setPrototypeOf(r,n.prototype),r}return Ct(e,t),e}(Error),Et=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return Object.setPrototypeOf(r,n.prototype),r}return Ct(e,t),e}(Error),At=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return Object.setPrototypeOf(r,n.prototype),r}return Ct(e,t),e}(Error),xt=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return Object.setPrototypeOf(r,n.prototype),r}return Ct(e,t),e}(Error),Lt=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return Object.setPrototypeOf(r,n.prototype),r}return Ct(e,t),e}(Error),Rt=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return Object.setPrototypeOf(r,n.prototype),r}return Ct(e,t),e}(Error),Ut=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Mt=function(t){function e(e,n){var r=t.call(this,(function(t,n){B.debug("No callbacks on "+e+" for "+t)}))||this;return r.name=e,r.pusher=n,r.subscribed=!1,r.subscriptionPending=!1,r.subscriptionCancelled=!1,r}return Ut(e,t),e.prototype.authorize=function(t,e){return e(!1,{auth:""})},e.prototype.trigger=function(t,e){if(0!==t.indexOf("client-"))throw new Pt("Event '"+t+"' does not start with 'client-'");if(!this.subscribed){var n=z("triggeringClientEvents");B.warn("Client event triggered before channel 'subscription_succeeded' event . "+n)}return this.pusher.send_event(t,e,this.name)},e.prototype.disconnect=function(){this.subscribed=!1,this.subscriptionPending=!1},e.prototype.handleEvent=function(t){var e=t.event,n=t.data;if("pusher_internal:subscription_succeeded"===e)this.handleSubscriptionSucceededEvent(t);else if(0!==e.indexOf("pusher_internal:")){this.emit(e,n,{})}},e.prototype.handleSubscriptionSucceededEvent=function(t){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",t.data)},e.prototype.subscribe=function(){var t=this;this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,(function(e,n){e?(B.error(n),t.emit("pusher:subscription_error",n)):(n=n,t.pusher.send_event("pusher:subscribe",{auth:n.auth,channel_data:n.channel_data,channel:t.name}))})))},e.prototype.unsubscribe=function(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})},e.prototype.cancelSubscription=function(){this.subscriptionCancelled=!0},e.prototype.reinstateSubscription=function(){this.subscriptionCancelled=!1},e}(tt),jt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),It=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return jt(e,t),e.prototype.authorize=function(t,e){return Kt.createAuthorizer(this,this.pusher.config).authorize(t,e)},e}(Mt),Nt=function(){function t(){this.reset()}return t.prototype.get=function(t){return Object.prototype.hasOwnProperty.call(this.members,t)?{id:t,info:this.members[t]}:null},t.prototype.each=function(t){var e=this;A(this.members,(function(n,r){t(e.get(r))}))},t.prototype.setMyID=function(t){this.myID=t},t.prototype.onSubscription=function(t){this.members=t.presence.hash,this.count=t.presence.count,this.me=this.get(this.myID)},t.prototype.addMember=function(t){return null===this.get(t.user_id)&&this.count++,this.members[t.user_id]=t.user_info,this.get(t.user_id)},t.prototype.removeMember=function(t){var e=this.get(t.user_id);return e&&(delete this.members[t.user_id],this.count--),e},t.prototype.reset=function(){this.members={},this.count=0,this.myID=null,this.me=null},t}(),Dt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Bt=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.members=new Nt,r}return Dt(e,t),e.prototype.authorize=function(e,n){var r=this;t.prototype.authorize.call(this,e,(function(t,e){if(!t){if(void 0===(e=e).channel_data){var o=z("authenticationEndpoint");return B.error("Invalid auth response for channel '"+r.name+"',expected 'channel_data' field. "+o),void n("Invalid auth response")}var i=JSON.parse(e.channel_data);r.members.setMyID(i.user_id)}n(t,e)}))},e.prototype.handleEvent=function(t){var e=t.event;if(0===e.indexOf("pusher_internal:"))this.handleInternalEvent(t);else{var n=t.data,r={};t.user_id&&(r.user_id=t.user_id),this.emit(e,n,r)}},e.prototype.handleInternalEvent=function(t){var e=t.event,n=t.data;switch(e){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(t);break;case"pusher_internal:member_added":var r=this.members.addMember(n);this.emit("pusher:member_added",r);break;case"pusher_internal:member_removed":var o=this.members.removeMember(n);o&&this.emit("pusher:member_removed",o)}},e.prototype.handleSubscriptionSucceededEvent=function(t){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(t.data),this.emit("pusher:subscription_succeeded",this.members))},e.prototype.disconnect=function(){this.members.reset(),t.prototype.disconnect.call(this)},e}(It),Ht=n(1),zt=n(0),qt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ft=function(t){function e(e,n,r){var o=t.call(this,e,n)||this;return o.key=null,o.nacl=r,o}return qt(e,t),e.prototype.authorize=function(e,n){var r=this;t.prototype.authorize.call(this,e,(function(t,e){if(t)n(!0,e);else{var o=e.shared_secret;if(o)r.key=Object(zt.decode)(o),delete e.shared_secret,n(!1,e);else{var i="No shared_secret key in auth payload for encrypted channel: "+r.name;n(!0,i)}}}))},e.prototype.trigger=function(t,e){throw new xt("Client events are not currently supported for encrypted channels")},e.prototype.handleEvent=function(e){var n=e.event,r=e.data;0!==n.indexOf("pusher_internal:")&&0!==n.indexOf("pusher:")?this.handleEncryptedEvent(n,r):t.prototype.handleEvent.call(this,e)},e.prototype.handleEncryptedEvent=function(t,e){var n=this;if(this.key)if(e.ciphertext&&e.nonce){var r=Object(zt.decode)(e.ciphertext);if(r.length0&&this.emit("connecting_in",Math.round(t/1e3)),this.retryTimer=new k(t||0,(function(){e.disconnectInternally(),e.connect()}))},e.prototype.clearRetryTimer=function(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)},e.prototype.setUnavailableTimer=function(){var t=this;this.unavailableTimer=new k(this.options.unavailableTimeout,(function(){t.updateState("unavailable")}))},e.prototype.clearUnavailableTimer=function(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()},e.prototype.sendActivityCheck=function(){var t=this;this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new k(this.options.pongTimeout,(function(){t.timeline.error({pong_timed_out:t.options.pongTimeout}),t.retryIn(0)}))},e.prototype.resetActivityCheck=function(){var t=this;this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new k(this.activityTimeout,(function(){t.sendActivityCheck()})))},e.prototype.stopActivityCheck=function(){this.activityTimer&&this.activityTimer.ensureAborted()},e.prototype.buildConnectionCallbacks=function(t){var e=this;return P({},t,{message:function(t){e.resetActivityCheck(),e.emit("message",t)},ping:function(){e.send_event("pusher:pong",{})},activity:function(){e.resetActivityCheck()},error:function(t){e.emit("error",{type:"WebSocketError",error:t})},closed:function(){e.abandonConnection(),e.shouldRetry()&&e.retryIn(1e3)}})},e.prototype.buildHandshakeCallbacks=function(t){var e=this;return P({},t,{connected:function(t){e.activityTimeout=Math.min(e.options.activityTimeout,t.activityTimeout,t.connection.activityTimeout||1/0),e.clearUnavailableTimer(),e.setConnection(t.connection),e.socket_id=e.connection.id,e.updateState("connected",{socket_id:e.socket_id})}})},e.prototype.buildErrorCallbacks=function(){var t=this,e=function(e){return function(n){n.error&&t.emit("error",{type:"WebSocketError",error:n.error}),e(n)}};return{tls_only:e((function(){t.usingTLS=!0,t.updateStrategy(),t.retryIn(0)})),refused:e((function(){t.disconnect()})),backoff:e((function(){t.retryIn(1e3)})),retry:e((function(){t.retryIn(0)}))}},e.prototype.setConnection=function(t){for(var e in this.connection=t,this.connectionCallbacks)this.connection.bind(e,this.connectionCallbacks[e]);this.resetActivityCheck()},e.prototype.abandonConnection=function(){if(this.connection){for(var t in this.stopActivityCheck(),this.connectionCallbacks)this.connection.unbind(t,this.connectionCallbacks[t]);var e=this.connection;return this.connection=null,e}},e.prototype.updateState=function(t,e){var n=this.state;if(this.state=t,n!==t){var r=t;"connected"===r&&(r+=" with new socket ID "+e.socket_id),B.debug("State changed",n+" -> "+r),this.timeline.info({state:t,params:e}),this.emit("state_change",{previous:n,current:t}),this.emit(t,e)}},e.prototype.shouldRetry=function(){return"connecting"===this.state||"connected"===this.state},e}(tt),Yt=function(){function t(){this.channels={}}return t.prototype.add=function(t,e){return this.channels[t]||(this.channels[t]=function(t,e){if(0===t.indexOf("private-encrypted-")){if(e.config.nacl)return Kt.createEncryptedChannel(t,e,e.config.nacl);var n=z("encryptedChannelSupport");throw new xt("Tried to subscribe to a private-encrypted- channel but no nacl implementation available. "+n)}return 0===t.indexOf("private-")?Kt.createPrivateChannel(t,e):0===t.indexOf("presence-")?Kt.createPresenceChannel(t,e):Kt.createChannel(t,e)}(t,e)),this.channels[t]},t.prototype.all=function(){return function(t){var e=[];return A(t,(function(t){e.push(t)})),e}(this.channels)},t.prototype.find=function(t){return this.channels[t]},t.prototype.remove=function(t){var e=this.channels[t];return delete this.channels[t],e},t.prototype.disconnect=function(){A(this.channels,(function(t){t.disconnect()}))},t}();var Kt={createChannels:function(){return new Yt},createConnectionManager:function(t,e){return new Jt(t,e)},createChannel:function(t,e){return new Mt(t,e)},createPrivateChannel:function(t,e){return new It(t,e)},createPresenceChannel:function(t,e){return new Bt(t,e)},createEncryptedChannel:function(t,e,n){return new Ft(t,e,n)},createTimelineSender:function(t,e){return new Tt(t,e)},createAuthorizer:function(t,e){return e.authorizer?e.authorizer(t,e):new kt(t,e)},createHandshake:function(t,e){return new St(t,e)},createAssistantToTheTransportManager:function(t,e,n){return new vt(t,e,n)}},Wt=function(){function t(t){this.options=t||{},this.livesLeft=this.options.lives||1/0}return t.prototype.getAssistant=function(t){return Kt.createAssistantToTheTransportManager(this,t,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})},t.prototype.isAlive=function(){return this.livesLeft>0},t.prototype.reportDeath=function(){this.livesLeft-=1},t}(),Gt=function(){function t(t,e){this.strategies=t,this.loop=Boolean(e.loop),this.failFast=Boolean(e.failFast),this.timeout=e.timeout,this.timeoutLimit=e.timeoutLimit}return t.prototype.isSupported=function(){return j(this.strategies,C.method("isSupported"))},t.prototype.connect=function(t,e){var n=this,r=this.strategies,o=0,i=this.timeout,s=null,c=function(a,u){u?e(null,u):(o+=1,n.loop&&(o%=r.length),o0&&(o=new k(n.timeout,(function(){i.abort(),r(!0)}))),i=t.connect(e,(function(t,e){t&&o&&o.isRunning()&&!n.failFast||(o&&o.ensureAborted(),r(t,e))})),{abort:function(){o&&o.ensureAborted(),i.abort()},forceMinPriority:function(t){i.forceMinPriority(t)}}},t}(),Vt=function(){function t(t){this.strategies=t}return t.prototype.isSupported=function(){return j(this.strategies,C.method("isSupported"))},t.prototype.connect=function(t,e){return function(t,e,n){var r=R(t,(function(t,r,o,i){return t.connect(e,n(r,i))}));return{abort:function(){L(r,Qt)},forceMinPriority:function(t){L(r,(function(e){e.forceMinPriority(t)}))}}}(this.strategies,t,(function(t,n){return function(r,o){n[t].error=r,r?function(t){return function(t,e){for(var n=0;n=C.now()){var i=this.transports[r.transport];i&&(this.timeline.info({cached:!0,transport:r.transport,latency:r.latency}),o.push(new Gt([i],{timeout:2*r.latency+1e3,failFast:!0})))}var s=C.now(),c=o.pop().connect(t,(function r(i,a){i?(te(n),o.length>0?(s=C.now(),c=o.pop().connect(t,r)):e(i)):(!function(t,e,n){var r=we.getLocalStorage();if(r)try{r[$t(t)]=D({timestamp:C.now(),transport:e,latency:n})}catch(t){}}(n,a.transport.name,C.now()-s),e(null,a))}));return{abort:function(){c.abort()},forceMinPriority:function(e){t=e,c&&c.forceMinPriority(e)}}},t}();function $t(t){return"pusherTransport"+(t?"TLS":"NonTLS")}function te(t){var e=we.getLocalStorage();if(e)try{delete e[$t(t)]}catch(t){}}var ee=function(){function t(t,e){var n=e.delay;this.strategy=t,this.options={delay:n}}return t.prototype.isSupported=function(){return this.strategy.isSupported()},t.prototype.connect=function(t,e){var n,r=this.strategy,o=new k(this.options.delay,(function(){n=r.connect(t,e)}));return{abort:function(){o.ensureAborted(),n&&n.abort()},forceMinPriority:function(e){t=e,n&&n.forceMinPriority(e)}}},t}(),ne=function(){function t(t,e,n){this.test=t,this.trueBranch=e,this.falseBranch=n}return t.prototype.isSupported=function(){return(this.test()?this.trueBranch:this.falseBranch).isSupported()},t.prototype.connect=function(t,e){return(this.test()?this.trueBranch:this.falseBranch).connect(t,e)},t}(),re=function(){function t(t){this.strategy=t}return t.prototype.isSupported=function(){return this.strategy.isSupported()},t.prototype.connect=function(t,e){var n=this.strategy.connect(t,(function(t,r){r&&n.abort(),e(t,r)}));return n},t}();function oe(t){return function(){return t.isSupported()}}var ie,se=function(t,e,n){var r={};function o(e,o,i,s,c){var a=n(t,e,o,i,s,c);return r[e]=a,a}var i,s=Object.assign({},e,{hostNonTLS:t.wsHost+":"+t.wsPort,hostTLS:t.wsHost+":"+t.wssPort,httpPath:t.wsPath}),c=Object.assign({},s,{useTLS:!0}),a=Object.assign({},e,{hostNonTLS:t.httpHost+":"+t.httpPort,hostTLS:t.httpHost+":"+t.httpsPort,httpPath:t.httpPath}),u={loop:!0,timeout:15e3,timeoutLimit:6e4},h=new Wt({lives:2,minPingDelay:1e4,maxPingDelay:t.activityTimeout}),p=new Wt({lives:2,minPingDelay:1e4,maxPingDelay:t.activityTimeout}),f=o("ws","ws",3,s,h),l=o("wss","ws",3,c,h),d=o("sockjs","sockjs",1,a),y=o("xhr_streaming","xhr_streaming",1,a,p),g=o("xdr_streaming","xdr_streaming",1,a,p),v=o("xhr_polling","xhr_polling",1,a),b=o("xdr_polling","xdr_polling",1,a),m=new Gt([f],u),w=new Gt([l],u),_=new Gt([d],u),S=new Gt([new ne(oe(y),y,g)],u),k=new Gt([new ne(oe(v),v,b)],u),T=new Gt([new ne(oe(S),new Vt([S,new ee(k,{delay:4e3})]),k)],u),C=new ne(oe(T),T,_);return i=e.useTLS?new Vt([m,new ee(C,{delay:2e3})]):new Vt([m,new ee(w,{delay:2e3}),new ee(C,{delay:5e3})]),new Zt(new re(new ne(oe(f),i,C)),r,{ttl:18e5,timeline:e.timeline,useTLS:e.useTLS})},ce={getRequest:function(t){var e=new window.XDomainRequest;return e.ontimeout=function(){t.emit("error",new Ot),t.close()},e.onerror=function(e){t.emit("error",e),t.close()},e.onprogress=function(){e.responseText&&e.responseText.length>0&&t.onChunk(200,e.responseText)},e.onload=function(){e.responseText&&e.responseText.length>0&&t.onChunk(200,e.responseText),t.emit("finished",200),t.close()},e},abortRequest:function(t){t.ontimeout=t.onerror=t.onprogress=t.onload=null,t.abort()}},ae=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ue=function(t){function e(e,n,r){var o=t.call(this)||this;return o.hooks=e,o.method=n,o.url=r,o}return ae(e,t),e.prototype.start=function(t){var e=this;this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=function(){e.close()},we.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(t)},e.prototype.close=function(){this.unloader&&(we.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)},e.prototype.onChunk=function(t,e){for(;;){var n=this.advanceBuffer(e);if(!n)break;this.emit("chunk",{status:t,data:n})}this.isBufferTooLong(e)&&this.emit("buffer_too_long")},e.prototype.advanceBuffer=function(t){var e=t.slice(this.position),n=e.indexOf("\n");return-1!==n?(this.position+=n+1,e.slice(0,n)):null},e.prototype.isBufferTooLong=function(t){return this.position===t.length&&t.length>262144},e}(tt);!function(t){t[t.CONNECTING=0]="CONNECTING",t[t.OPEN=1]="OPEN",t[t.CLOSED=3]="CLOSED"}(ie||(ie={}));var he=ie,pe=1;function fe(t){var e=-1===t.indexOf("?")?"?":"&";return t+e+"t="+ +new Date+"&n="+pe++}function le(t){return Math.floor(Math.random()*t)}var de,ye=function(){function t(t,e){this.hooks=t,this.session=le(1e3)+"/"+function(t){for(var e=[],n=0;n0&&t.onChunk(e.status,e.responseText);break;case 4:e.responseText&&e.responseText.length>0&&t.onChunk(e.status,e.responseText),t.emit("finished",e.status),t.close()}},e},abortRequest:function(t){t.onreadystatechange=null,t.abort()}},me={createStreamingSocket:function(t){return this.createSocket(ge,t)},createPollingSocket:function(t){return this.createSocket(ve,t)},createSocket:function(t,e){return new ye(t,e)},createXHR:function(t,e){return this.createRequest(be,t,e)},createRequest:function(t,e,n){return new ue(t,e,n)},createXDR:function(t,e){return this.createRequest(ce,t,e)}},we={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:o,DependenciesReceivers:c,getDefaultStrategy:se,Transports:dt,transportConnectionInitializer:function(){var t=this;t.timeline.info(t.buildTimelineMessage({transport:t.name+(t.options.useTLS?"s":"")})),t.hooks.isInitialized()?t.changeState("initialized"):t.hooks.file?(t.changeState("initializing"),a.load(t.hooks.file,{useTLS:t.options.useTLS},(function(e,n){t.hooks.isInitialized()?(t.changeState("initialized"),n(!0)):(e&&t.onError(e),t.onClose(),n(!1))}))):t.onClose()},HTTPFactory:me,TimelineTransport:Y,getXHRAPI:function(){return window.XMLHttpRequest},getWebSocketAPI:function(){return window.WebSocket||window.MozWebSocket},setup:function(t){var e=this;window.Pusher=t;var n=function(){e.onDocumentBody(t.ready)};window.JSON?n():a.load("json2",{},n)},getDocument:function(){return document},getProtocol:function(){return this.getDocument().location.protocol},getAuthorizers:function(){return{ajax:q,jsonp:F}},onDocumentBody:function(t){var e=this;document.body?t():setTimeout((function(){e.onDocumentBody(t)}),0)},createJSONPRequest:function(t,e){return new J(t,e)},createScriptRequest:function(t){return new X(t)},getLocalStorage:function(){try{return window.localStorage}catch(t){return}},createXHR:function(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest:function(){return new(this.getXHRAPI())},createMicrosoftXHR:function(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork:function(){return gt},createWebSocket:function(t){return new(this.getWebSocketAPI())(t)},createSocketRequest:function(t,e){if(this.isXHRSupported())return this.HTTPFactory.createXHR(t,e);if(this.isXDRSupported(0===e.indexOf("https:")))return this.HTTPFactory.createXDR(t,e);throw"Cross-origin HTTP requests are not supported"},isXHRSupported:function(){var t=this.getXHRAPI();return Boolean(t)&&void 0!==(new t).withCredentials},isXDRSupported:function(t){var e=t?"https:":"http:",n=this.getProtocol();return Boolean(window.XDomainRequest)&&n===e},addUnloadListener:function(t){void 0!==window.addEventListener?window.addEventListener("unload",t,!1):void 0!==window.attachEvent&&window.attachEvent("onunload",t)},removeUnloadListener:function(t){void 0!==window.addEventListener?window.removeEventListener("unload",t,!1):void 0!==window.detachEvent&&window.detachEvent("onunload",t)}};!function(t){t[t.ERROR=3]="ERROR",t[t.INFO=6]="INFO",t[t.DEBUG=7]="DEBUG"}(de||(de={}));var _e=de,Se=function(){function t(t,e,n){this.key=t,this.session=e,this.events=[],this.options=n||{},this.sent=0,this.uniqueID=0}return t.prototype.log=function(t,e){t<=this.options.level&&(this.events.push(P({},e,{timestamp:C.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())},t.prototype.error=function(t){this.log(_e.ERROR,t)},t.prototype.info=function(t){this.log(_e.INFO,t)},t.prototype.debug=function(t){this.log(_e.DEBUG,t)},t.prototype.isEmpty=function(){return 0===this.events.length},t.prototype.send=function(t,e){var n=this,r=P({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],t(r,(function(t,r){t||n.sent++,e&&e(t,r)})),!0},t.prototype.generateUniqueID=function(){return this.uniqueID++,this.uniqueID},t}(),ke=function(){function t(t,e,n,r){this.name=t,this.priority=e,this.transport=n,this.options=r||{}}return t.prototype.isSupported=function(){return this.transport.isSupported({useTLS:this.options.useTLS})},t.prototype.connect=function(t,e){var n=this;if(!this.isSupported())return Te(new Rt,e);if(this.priority>>18&63),e+=this._encodeByte(r>>>12&63),e+=this._encodeByte(r>>>6&63),e+=this._encodeByte(r>>>0&63)}var o=t.length-n;if(o>0){r=t[n]<<16|(2===o?t[n+1]<<8:0);e+=this._encodeByte(r>>>18&63),e+=this._encodeByte(r>>>12&63),e+=2===o?this._encodeByte(r>>>6&63):this._paddingCharacter||"",e+=this._paddingCharacter||""}return e},t.prototype.maxDecodedLength=function(t){return this._paddingCharacter?t/4*3|0:(6*t+7)/8|0},t.prototype.decodedLength=function(t){return this.maxDecodedLength(t.length-this._getPaddingLength(t))},t.prototype.decode=function(t){if(0===t.length)return new Uint8Array(0);for(var e=this._getPaddingLength(t),n=t.length-e,r=new Uint8Array(this.maxDecodedLength(n)),o=0,i=0,s=0,c=0,a=0,u=0,h=0;i>>4,r[o++]=a<<4|u>>>2,r[o++]=u<<6|h,s|=256&c,s|=256&a,s|=256&u,s|=256&h;if(i>>4,s|=256&c,s|=256&a),i>>2,s|=256&u),i>>8&6,e+=51-t>>>8&-75,e+=61-t>>>8&-15,e+=62-t>>>8&3,String.fromCharCode(e)},t.prototype._decodeChar=function(t){var e=256;return e+=(42-t&t-44)>>>8&-256+t-43+62,e+=(46-t&t-48)>>>8&-256+t-47+63,e+=(47-t&t-58)>>>8&-256+t-48+52,e+=(64-t&t-91)>>>8&-256+t-65+0,e+=(96-t&t-123)>>>8&-256+t-97+26},t.prototype._getPaddingLength=function(t){var e=0;if(this._paddingCharacter){for(var n=t.length-1;n>=0&&t[n]===this._paddingCharacter;n--)e++;if(t.length<4||e>2)throw new Error("Base64Coder: incorrect padding")}return e},t}();e.Coder=i;var s=new i;e.encode=function(t){return s.encode(t)},e.decode=function(t){return s.decode(t)};var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype._encodeByte=function(t){var e=t;return e+=65,e+=25-t>>>8&6,e+=51-t>>>8&-75,e+=61-t>>>8&-13,e+=62-t>>>8&49,String.fromCharCode(e)},e.prototype._decodeChar=function(t){var e=256;return e+=(44-t&t-46)>>>8&-256+t-45+62,e+=(94-t&t-96)>>>8&-256+t-95+63,e+=(47-t&t-58)>>>8&-256+t-48+52,e+=(64-t&t-91)>>>8&-256+t-65+0,e+=(96-t&t-123)>>>8&-256+t-97+26},e}(i);e.URLSafeCoder=c;var a=new c;e.encodeURLSafe=function(t){return a.encode(t)},e.decodeURLSafe=function(t){return a.decode(t)},e.encodedLength=function(t){return s.encodedLength(t)},e.maxDecodedLength=function(t){return s.maxDecodedLength(t)},e.decodedLength=function(t){return s.decodedLength(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r="utf8: invalid source encoding";function o(t){for(var e=0,n=0;n=t.length-1)throw new Error("utf8: invalid string");n++,e+=4}}return e}e.encode=function(t){for(var e=new Uint8Array(o(t)),n=0,r=0;r>6,e[n++]=128|63&i):i<55296?(e[n++]=224|i>>12,e[n++]=128|i>>6&63,e[n++]=128|63&i):(r++,i=(1023&i)<<10,i|=1023&t.charCodeAt(r),i+=65536,e[n++]=240|i>>18,e[n++]=128|i>>12&63,e[n++]=128|i>>6&63,e[n++]=128|63&i)}return e},e.encodedLength=o,e.decode=function(t){for(var e=[],n=0;n=t.length)throw new Error(r);if(128!=(192&(s=t[++n])))throw new Error(r);o=(31&o)<<6|63&s,i=128}else if(o<240){if(n>=t.length-1)throw new Error(r);var s=t[++n],c=t[++n];if(128!=(192&s)||128!=(192&c))throw new Error(r);o=(15&o)<<12|(63&s)<<6|63&c,i=2048}else{if(!(o<248))throw new Error(r);if(n>=t.length-2)throw new Error(r);s=t[++n],c=t[++n];var a=t[++n];if(128!=(192&s)||128!=(192&c)||128!=(192&a))throw new Error(r);o=(15&o)<<18|(63&s)<<12|(63&c)<<6|63&a,i=65536}if(o=55296&&o<=57343)throw new Error(r);if(o>=65536){if(o>1114111)throw new Error(r);o-=65536,e.push(String.fromCharCode(55296|o>>10)),o=56320|1023&o}}e.push(String.fromCharCode(o))}return e.join("")}},function(t,e,n){!function(t){"use strict";var e=function(t){var e,n=new Float64Array(16);if(t)for(e=0;e>24&255,t[e+1]=n>>16&255,t[e+2]=n>>8&255,t[e+3]=255&n,t[e+4]=r>>24&255,t[e+5]=r>>16&255,t[e+6]=r>>8&255,t[e+7]=255&r}function y(t,e,n,r,o){var i,s=0;for(i=0;i>>8)-1}function g(t,e,n,r){return y(t,e,n,r,16)}function v(t,e,n,r){return y(t,e,n,r,32)}function b(t,e,n,r){!function(t,e,n,r){for(var o,i=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,c=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,a=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,u=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,h=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,p=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,f=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,l=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,d=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,y=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,g=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,v=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,b=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,m=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,w=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,_=i,S=s,k=c,T=a,C=u,P=h,O=p,E=f,A=l,x=d,L=y,R=g,U=v,M=b,j=m,I=w,D=0;D<20;D+=2)_^=(o=(U^=(o=(A^=(o=(C^=(o=_+U|0)<<7|o>>>25)+_|0)<<9|o>>>23)+C|0)<<13|o>>>19)+A|0)<<18|o>>>14,P^=(o=(S^=(o=(M^=(o=(x^=(o=P+S|0)<<7|o>>>25)+P|0)<<9|o>>>23)+x|0)<<13|o>>>19)+M|0)<<18|o>>>14,L^=(o=(O^=(o=(k^=(o=(j^=(o=L+O|0)<<7|o>>>25)+L|0)<<9|o>>>23)+j|0)<<13|o>>>19)+k|0)<<18|o>>>14,I^=(o=(R^=(o=(E^=(o=(T^=(o=I+R|0)<<7|o>>>25)+I|0)<<9|o>>>23)+T|0)<<13|o>>>19)+E|0)<<18|o>>>14,_^=(o=(T^=(o=(k^=(o=(S^=(o=_+T|0)<<7|o>>>25)+_|0)<<9|o>>>23)+S|0)<<13|o>>>19)+k|0)<<18|o>>>14,P^=(o=(C^=(o=(E^=(o=(O^=(o=P+C|0)<<7|o>>>25)+P|0)<<9|o>>>23)+O|0)<<13|o>>>19)+E|0)<<18|o>>>14,L^=(o=(x^=(o=(A^=(o=(R^=(o=L+x|0)<<7|o>>>25)+L|0)<<9|o>>>23)+R|0)<<13|o>>>19)+A|0)<<18|o>>>14,I^=(o=(j^=(o=(M^=(o=(U^=(o=I+j|0)<<7|o>>>25)+I|0)<<9|o>>>23)+U|0)<<13|o>>>19)+M|0)<<18|o>>>14;_=_+i|0,S=S+s|0,k=k+c|0,T=T+a|0,C=C+u|0,P=P+h|0,O=O+p|0,E=E+f|0,A=A+l|0,x=x+d|0,L=L+y|0,R=R+g|0,U=U+v|0,M=M+b|0,j=j+m|0,I=I+w|0,t[0]=_>>>0&255,t[1]=_>>>8&255,t[2]=_>>>16&255,t[3]=_>>>24&255,t[4]=S>>>0&255,t[5]=S>>>8&255,t[6]=S>>>16&255,t[7]=S>>>24&255,t[8]=k>>>0&255,t[9]=k>>>8&255,t[10]=k>>>16&255,t[11]=k>>>24&255,t[12]=T>>>0&255,t[13]=T>>>8&255,t[14]=T>>>16&255,t[15]=T>>>24&255,t[16]=C>>>0&255,t[17]=C>>>8&255,t[18]=C>>>16&255,t[19]=C>>>24&255,t[20]=P>>>0&255,t[21]=P>>>8&255,t[22]=P>>>16&255,t[23]=P>>>24&255,t[24]=O>>>0&255,t[25]=O>>>8&255,t[26]=O>>>16&255,t[27]=O>>>24&255,t[28]=E>>>0&255,t[29]=E>>>8&255,t[30]=E>>>16&255,t[31]=E>>>24&255,t[32]=A>>>0&255,t[33]=A>>>8&255,t[34]=A>>>16&255,t[35]=A>>>24&255,t[36]=x>>>0&255,t[37]=x>>>8&255,t[38]=x>>>16&255,t[39]=x>>>24&255,t[40]=L>>>0&255,t[41]=L>>>8&255,t[42]=L>>>16&255,t[43]=L>>>24&255,t[44]=R>>>0&255,t[45]=R>>>8&255,t[46]=R>>>16&255,t[47]=R>>>24&255,t[48]=U>>>0&255,t[49]=U>>>8&255,t[50]=U>>>16&255,t[51]=U>>>24&255,t[52]=M>>>0&255,t[53]=M>>>8&255,t[54]=M>>>16&255,t[55]=M>>>24&255,t[56]=j>>>0&255,t[57]=j>>>8&255,t[58]=j>>>16&255,t[59]=j>>>24&255,t[60]=I>>>0&255,t[61]=I>>>8&255,t[62]=I>>>16&255,t[63]=I>>>24&255}(t,e,n,r)}function m(t,e,n,r){!function(t,e,n,r){for(var o,i=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,c=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,a=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,u=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,h=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,p=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,f=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,l=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,d=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,y=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,g=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,v=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,b=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,m=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,w=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,_=0;_<20;_+=2)i^=(o=(v^=(o=(l^=(o=(u^=(o=i+v|0)<<7|o>>>25)+i|0)<<9|o>>>23)+u|0)<<13|o>>>19)+l|0)<<18|o>>>14,h^=(o=(s^=(o=(b^=(o=(d^=(o=h+s|0)<<7|o>>>25)+h|0)<<9|o>>>23)+d|0)<<13|o>>>19)+b|0)<<18|o>>>14,y^=(o=(p^=(o=(c^=(o=(m^=(o=y+p|0)<<7|o>>>25)+y|0)<<9|o>>>23)+m|0)<<13|o>>>19)+c|0)<<18|o>>>14,w^=(o=(g^=(o=(f^=(o=(a^=(o=w+g|0)<<7|o>>>25)+w|0)<<9|o>>>23)+a|0)<<13|o>>>19)+f|0)<<18|o>>>14,i^=(o=(a^=(o=(c^=(o=(s^=(o=i+a|0)<<7|o>>>25)+i|0)<<9|o>>>23)+s|0)<<13|o>>>19)+c|0)<<18|o>>>14,h^=(o=(u^=(o=(f^=(o=(p^=(o=h+u|0)<<7|o>>>25)+h|0)<<9|o>>>23)+p|0)<<13|o>>>19)+f|0)<<18|o>>>14,y^=(o=(d^=(o=(l^=(o=(g^=(o=y+d|0)<<7|o>>>25)+y|0)<<9|o>>>23)+g|0)<<13|o>>>19)+l|0)<<18|o>>>14,w^=(o=(m^=(o=(b^=(o=(v^=(o=w+m|0)<<7|o>>>25)+w|0)<<9|o>>>23)+v|0)<<13|o>>>19)+b|0)<<18|o>>>14;t[0]=i>>>0&255,t[1]=i>>>8&255,t[2]=i>>>16&255,t[3]=i>>>24&255,t[4]=h>>>0&255,t[5]=h>>>8&255,t[6]=h>>>16&255,t[7]=h>>>24&255,t[8]=y>>>0&255,t[9]=y>>>8&255,t[10]=y>>>16&255,t[11]=y>>>24&255,t[12]=w>>>0&255,t[13]=w>>>8&255,t[14]=w>>>16&255,t[15]=w>>>24&255,t[16]=p>>>0&255,t[17]=p>>>8&255,t[18]=p>>>16&255,t[19]=p>>>24&255,t[20]=f>>>0&255,t[21]=f>>>8&255,t[22]=f>>>16&255,t[23]=f>>>24&255,t[24]=l>>>0&255,t[25]=l>>>8&255,t[26]=l>>>16&255,t[27]=l>>>24&255,t[28]=d>>>0&255,t[29]=d>>>8&255,t[30]=d>>>16&255,t[31]=d>>>24&255}(t,e,n,r)}var w=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function _(t,e,n,r,o,i,s){var c,a,u=new Uint8Array(16),h=new Uint8Array(64);for(a=0;a<16;a++)u[a]=0;for(a=0;a<8;a++)u[a]=i[a];for(;o>=64;){for(b(h,u,s,w),a=0;a<64;a++)t[e+a]=n[r+a]^h[a];for(c=1,a=8;a<16;a++)c=c+(255&u[a])|0,u[a]=255&c,c>>>=8;o-=64,e+=64,r+=64}if(o>0)for(b(h,u,s,w),a=0;a=64;){for(b(a,c,o,w),s=0;s<64;s++)t[e+s]=a[s];for(i=1,s=8;s<16;s++)i=i+(255&c[s])|0,c[s]=255&i,i>>>=8;n-=64,e+=64}if(n>0)for(b(a,c,o,w),s=0;s>>13|n<<3),r=255&t[4]|(255&t[5])<<8,this.r[2]=7939&(n>>>10|r<<6),o=255&t[6]|(255&t[7])<<8,this.r[3]=8191&(r>>>7|o<<9),i=255&t[8]|(255&t[9])<<8,this.r[4]=255&(o>>>4|i<<12),this.r[5]=i>>>1&8190,s=255&t[10]|(255&t[11])<<8,this.r[6]=8191&(i>>>14|s<<2),c=255&t[12]|(255&t[13])<<8,this.r[7]=8065&(s>>>11|c<<5),a=255&t[14]|(255&t[15])<<8,this.r[8]=8191&(c>>>8|a<<8),this.r[9]=a>>>5&127,this.pad[0]=255&t[16]|(255&t[17])<<8,this.pad[1]=255&t[18]|(255&t[19])<<8,this.pad[2]=255&t[20]|(255&t[21])<<8,this.pad[3]=255&t[22]|(255&t[23])<<8,this.pad[4]=255&t[24]|(255&t[25])<<8,this.pad[5]=255&t[26]|(255&t[27])<<8,this.pad[6]=255&t[28]|(255&t[29])<<8,this.pad[7]=255&t[30]|(255&t[31])<<8};function P(t,e,n,r,o,i){var s=new C(i);return s.update(n,r,o),s.finish(t,e),0}function O(t,e,n,r,o,i){var s=new Uint8Array(16);return P(s,0,n,r,o,i),g(t,e,s,0)}function E(t,e,n,r,o){var i;if(n<32)return-1;for(T(t,0,e,0,n,r,o),P(t,16,t,32,n-32,t),i=0;i<16;i++)t[i]=0;return 0}function A(t,e,n,r,o){var i,s=new Uint8Array(32);if(n<32)return-1;if(k(s,0,32,r,o),0!==O(e,16,e,32,n-32,s))return-1;for(T(t,0,e,0,n,r,o),i=0;i<32;i++)t[i]=0;return 0}function x(t,e){var n;for(n=0;n<16;n++)t[n]=0|e[n]}function L(t){var e,n,r=1;for(e=0;e<16;e++)n=t[e]+r+65535,r=Math.floor(n/65536),t[e]=n-65536*r;t[0]+=r-1+37*(r-1)}function R(t,e,n){for(var r,o=~(n-1),i=0;i<16;i++)r=o&(t[i]^e[i]),t[i]^=r,e[i]^=r}function U(t,n){var r,o,i,s=e(),c=e();for(r=0;r<16;r++)c[r]=n[r];for(L(c),L(c),L(c),o=0;o<2;o++){for(s[0]=c[0]-65517,r=1;r<15;r++)s[r]=c[r]-65535-(s[r-1]>>16&1),s[r-1]&=65535;s[15]=c[15]-32767-(s[14]>>16&1),i=s[15]>>16&1,s[14]&=65535,R(c,s,1-i)}for(r=0;r<16;r++)t[2*r]=255&c[r],t[2*r+1]=c[r]>>8}function M(t,e){var n=new Uint8Array(32),r=new Uint8Array(32);return U(n,t),U(r,e),v(n,0,r,0)}function j(t){var e=new Uint8Array(32);return U(e,t),1&e[0]}function I(t,e){var n;for(n=0;n<16;n++)t[n]=e[2*n]+(e[2*n+1]<<8);t[15]&=32767}function D(t,e,n){for(var r=0;r<16;r++)t[r]=e[r]+n[r]}function N(t,e,n){for(var r=0;r<16;r++)t[r]=e[r]-n[r]}function B(t,e,n){var r,o,i=0,s=0,c=0,a=0,u=0,h=0,p=0,f=0,l=0,d=0,y=0,g=0,v=0,b=0,m=0,w=0,_=0,S=0,k=0,T=0,C=0,P=0,O=0,E=0,A=0,x=0,L=0,R=0,U=0,M=0,j=0,I=n[0],D=n[1],N=n[2],B=n[3],H=n[4],z=n[5],q=n[6],F=n[7],X=n[8],J=n[9],Y=n[10],K=n[11],W=n[12],G=n[13],V=n[14],Q=n[15];i+=(r=e[0])*I,s+=r*D,c+=r*N,a+=r*B,u+=r*H,h+=r*z,p+=r*q,f+=r*F,l+=r*X,d+=r*J,y+=r*Y,g+=r*K,v+=r*W,b+=r*G,m+=r*V,w+=r*Q,s+=(r=e[1])*I,c+=r*D,a+=r*N,u+=r*B,h+=r*H,p+=r*z,f+=r*q,l+=r*F,d+=r*X,y+=r*J,g+=r*Y,v+=r*K,b+=r*W,m+=r*G,w+=r*V,_+=r*Q,c+=(r=e[2])*I,a+=r*D,u+=r*N,h+=r*B,p+=r*H,f+=r*z,l+=r*q,d+=r*F,y+=r*X,g+=r*J,v+=r*Y,b+=r*K,m+=r*W,w+=r*G,_+=r*V,S+=r*Q,a+=(r=e[3])*I,u+=r*D,h+=r*N,p+=r*B,f+=r*H,l+=r*z,d+=r*q,y+=r*F,g+=r*X,v+=r*J,b+=r*Y,m+=r*K,w+=r*W,_+=r*G,S+=r*V,k+=r*Q,u+=(r=e[4])*I,h+=r*D,p+=r*N,f+=r*B,l+=r*H,d+=r*z,y+=r*q,g+=r*F,v+=r*X,b+=r*J,m+=r*Y,w+=r*K,_+=r*W,S+=r*G,k+=r*V,T+=r*Q,h+=(r=e[5])*I,p+=r*D,f+=r*N,l+=r*B,d+=r*H,y+=r*z,g+=r*q,v+=r*F,b+=r*X,m+=r*J,w+=r*Y,_+=r*K,S+=r*W,k+=r*G,T+=r*V,C+=r*Q,p+=(r=e[6])*I,f+=r*D,l+=r*N,d+=r*B,y+=r*H,g+=r*z,v+=r*q,b+=r*F,m+=r*X,w+=r*J,_+=r*Y,S+=r*K,k+=r*W,T+=r*G,C+=r*V,P+=r*Q,f+=(r=e[7])*I,l+=r*D,d+=r*N,y+=r*B,g+=r*H,v+=r*z,b+=r*q,m+=r*F,w+=r*X,_+=r*J,S+=r*Y,k+=r*K,T+=r*W,C+=r*G,P+=r*V,O+=r*Q,l+=(r=e[8])*I,d+=r*D,y+=r*N,g+=r*B,v+=r*H,b+=r*z,m+=r*q,w+=r*F,_+=r*X,S+=r*J,k+=r*Y,T+=r*K,C+=r*W,P+=r*G,O+=r*V,E+=r*Q,d+=(r=e[9])*I,y+=r*D,g+=r*N,v+=r*B,b+=r*H,m+=r*z,w+=r*q,_+=r*F,S+=r*X,k+=r*J,T+=r*Y,C+=r*K,P+=r*W,O+=r*G,E+=r*V,A+=r*Q,y+=(r=e[10])*I,g+=r*D,v+=r*N,b+=r*B,m+=r*H,w+=r*z,_+=r*q,S+=r*F,k+=r*X,T+=r*J,C+=r*Y,P+=r*K,O+=r*W,E+=r*G,A+=r*V,x+=r*Q,g+=(r=e[11])*I,v+=r*D,b+=r*N,m+=r*B,w+=r*H,_+=r*z,S+=r*q,k+=r*F,T+=r*X,C+=r*J,P+=r*Y,O+=r*K,E+=r*W,A+=r*G,x+=r*V,L+=r*Q,v+=(r=e[12])*I,b+=r*D,m+=r*N,w+=r*B,_+=r*H,S+=r*z,k+=r*q,T+=r*F,C+=r*X,P+=r*J,O+=r*Y,E+=r*K,A+=r*W,x+=r*G,L+=r*V,R+=r*Q,b+=(r=e[13])*I,m+=r*D,w+=r*N,_+=r*B,S+=r*H,k+=r*z,T+=r*q,C+=r*F,P+=r*X,O+=r*J,E+=r*Y,A+=r*K,x+=r*W,L+=r*G,R+=r*V,U+=r*Q,m+=(r=e[14])*I,w+=r*D,_+=r*N,S+=r*B,k+=r*H,T+=r*z,C+=r*q,P+=r*F,O+=r*X,E+=r*J,A+=r*Y,x+=r*K,L+=r*W,R+=r*G,U+=r*V,M+=r*Q,w+=(r=e[15])*I,s+=38*(S+=r*N),c+=38*(k+=r*B),a+=38*(T+=r*H),u+=38*(C+=r*z),h+=38*(P+=r*q),p+=38*(O+=r*F),f+=38*(E+=r*X),l+=38*(A+=r*J),d+=38*(x+=r*Y),y+=38*(L+=r*K),g+=38*(R+=r*W),v+=38*(U+=r*G),b+=38*(M+=r*V),m+=38*(j+=r*Q),i=(r=(i+=38*(_+=r*D))+(o=1)+65535)-65536*(o=Math.floor(r/65536)),s=(r=s+o+65535)-65536*(o=Math.floor(r/65536)),c=(r=c+o+65535)-65536*(o=Math.floor(r/65536)),a=(r=a+o+65535)-65536*(o=Math.floor(r/65536)),u=(r=u+o+65535)-65536*(o=Math.floor(r/65536)),h=(r=h+o+65535)-65536*(o=Math.floor(r/65536)),p=(r=p+o+65535)-65536*(o=Math.floor(r/65536)),f=(r=f+o+65535)-65536*(o=Math.floor(r/65536)),l=(r=l+o+65535)-65536*(o=Math.floor(r/65536)),d=(r=d+o+65535)-65536*(o=Math.floor(r/65536)),y=(r=y+o+65535)-65536*(o=Math.floor(r/65536)),g=(r=g+o+65535)-65536*(o=Math.floor(r/65536)),v=(r=v+o+65535)-65536*(o=Math.floor(r/65536)),b=(r=b+o+65535)-65536*(o=Math.floor(r/65536)),m=(r=m+o+65535)-65536*(o=Math.floor(r/65536)),w=(r=w+o+65535)-65536*(o=Math.floor(r/65536)),i=(r=(i+=o-1+37*(o-1))+(o=1)+65535)-65536*(o=Math.floor(r/65536)),s=(r=s+o+65535)-65536*(o=Math.floor(r/65536)),c=(r=c+o+65535)-65536*(o=Math.floor(r/65536)),a=(r=a+o+65535)-65536*(o=Math.floor(r/65536)),u=(r=u+o+65535)-65536*(o=Math.floor(r/65536)),h=(r=h+o+65535)-65536*(o=Math.floor(r/65536)),p=(r=p+o+65535)-65536*(o=Math.floor(r/65536)),f=(r=f+o+65535)-65536*(o=Math.floor(r/65536)),l=(r=l+o+65535)-65536*(o=Math.floor(r/65536)),d=(r=d+o+65535)-65536*(o=Math.floor(r/65536)),y=(r=y+o+65535)-65536*(o=Math.floor(r/65536)),g=(r=g+o+65535)-65536*(o=Math.floor(r/65536)),v=(r=v+o+65535)-65536*(o=Math.floor(r/65536)),b=(r=b+o+65535)-65536*(o=Math.floor(r/65536)),m=(r=m+o+65535)-65536*(o=Math.floor(r/65536)),w=(r=w+o+65535)-65536*(o=Math.floor(r/65536)),i+=o-1+37*(o-1),t[0]=i,t[1]=s,t[2]=c,t[3]=a,t[4]=u,t[5]=h,t[6]=p,t[7]=f,t[8]=l,t[9]=d,t[10]=y,t[11]=g,t[12]=v,t[13]=b,t[14]=m,t[15]=w}function H(t,e){B(t,e,e)}function z(t,n){var r,o=e();for(r=0;r<16;r++)o[r]=n[r];for(r=253;r>=0;r--)H(o,o),2!==r&&4!==r&&B(o,o,n);for(r=0;r<16;r++)t[r]=o[r]}function q(t,n){var r,o=e();for(r=0;r<16;r++)o[r]=n[r];for(r=250;r>=0;r--)H(o,o),1!==r&&B(o,o,n);for(r=0;r<16;r++)t[r]=o[r]}function F(t,n,r){var o,i,s=new Uint8Array(32),c=new Float64Array(80),u=e(),h=e(),p=e(),f=e(),l=e(),d=e();for(i=0;i<31;i++)s[i]=n[i];for(s[31]=127&n[31]|64,s[0]&=248,I(c,r),i=0;i<16;i++)h[i]=c[i],f[i]=u[i]=p[i]=0;for(u[0]=f[0]=1,i=254;i>=0;--i)R(u,h,o=s[i>>>3]>>>(7&i)&1),R(p,f,o),D(l,u,p),N(u,u,p),D(p,h,f),N(h,h,f),H(f,l),H(d,u),B(u,p,u),B(p,h,l),D(l,u,p),N(u,u,p),H(h,u),N(p,f,d),B(u,p,a),D(u,u,f),B(p,p,u),B(u,f,d),B(f,h,c),H(h,l),R(u,h,o),R(p,f,o);for(i=0;i<16;i++)c[i+16]=u[i],c[i+32]=p[i],c[i+48]=h[i],c[i+64]=f[i];var y=c.subarray(32),g=c.subarray(16);return z(y,y),B(g,g,y),U(t,g),0}function X(t,e){return F(t,e,i)}function J(t,e){return r(e,32),X(t,e)}function Y(t,e,n){var r=new Uint8Array(32);return F(r,n,e),m(t,o,r,w)}C.prototype.blocks=function(t,e,n){for(var r,o,i,s,c,a,u,h,p,f,l,d,y,g,v,b,m,w,_,S=this.fin?0:2048,k=this.h[0],T=this.h[1],C=this.h[2],P=this.h[3],O=this.h[4],E=this.h[5],A=this.h[6],x=this.h[7],L=this.h[8],R=this.h[9],U=this.r[0],M=this.r[1],j=this.r[2],I=this.r[3],D=this.r[4],N=this.r[5],B=this.r[6],H=this.r[7],z=this.r[8],q=this.r[9];n>=16;)f=p=0,f+=(k+=8191&(r=255&t[e+0]|(255&t[e+1])<<8))*U,f+=(T+=8191&(r>>>13|(o=255&t[e+2]|(255&t[e+3])<<8)<<3))*(5*q),f+=(C+=8191&(o>>>10|(i=255&t[e+4]|(255&t[e+5])<<8)<<6))*(5*z),f+=(P+=8191&(i>>>7|(s=255&t[e+6]|(255&t[e+7])<<8)<<9))*(5*H),p=(f+=(O+=8191&(s>>>4|(c=255&t[e+8]|(255&t[e+9])<<8)<<12))*(5*B))>>>13,f&=8191,f+=(E+=c>>>1&8191)*(5*N),f+=(A+=8191&(c>>>14|(a=255&t[e+10]|(255&t[e+11])<<8)<<2))*(5*D),f+=(x+=8191&(a>>>11|(u=255&t[e+12]|(255&t[e+13])<<8)<<5))*(5*I),f+=(L+=8191&(u>>>8|(h=255&t[e+14]|(255&t[e+15])<<8)<<8))*(5*j),l=p+=(f+=(R+=h>>>5|S)*(5*M))>>>13,l+=k*M,l+=T*U,l+=C*(5*q),l+=P*(5*z),p=(l+=O*(5*H))>>>13,l&=8191,l+=E*(5*B),l+=A*(5*N),l+=x*(5*D),l+=L*(5*I),p+=(l+=R*(5*j))>>>13,l&=8191,d=p,d+=k*j,d+=T*M,d+=C*U,d+=P*(5*q),p=(d+=O*(5*z))>>>13,d&=8191,d+=E*(5*H),d+=A*(5*B),d+=x*(5*N),d+=L*(5*D),y=p+=(d+=R*(5*I))>>>13,y+=k*I,y+=T*j,y+=C*M,y+=P*U,p=(y+=O*(5*q))>>>13,y&=8191,y+=E*(5*z),y+=A*(5*H),y+=x*(5*B),y+=L*(5*N),g=p+=(y+=R*(5*D))>>>13,g+=k*D,g+=T*I,g+=C*j,g+=P*M,p=(g+=O*U)>>>13,g&=8191,g+=E*(5*q),g+=A*(5*z),g+=x*(5*H),g+=L*(5*B),v=p+=(g+=R*(5*N))>>>13,v+=k*N,v+=T*D,v+=C*I,v+=P*j,p=(v+=O*M)>>>13,v&=8191,v+=E*U,v+=A*(5*q),v+=x*(5*z),v+=L*(5*H),b=p+=(v+=R*(5*B))>>>13,b+=k*B,b+=T*N,b+=C*D,b+=P*I,p=(b+=O*j)>>>13,b&=8191,b+=E*M,b+=A*U,b+=x*(5*q),b+=L*(5*z),m=p+=(b+=R*(5*H))>>>13,m+=k*H,m+=T*B,m+=C*N,m+=P*D,p=(m+=O*I)>>>13,m&=8191,m+=E*j,m+=A*M,m+=x*U,m+=L*(5*q),w=p+=(m+=R*(5*z))>>>13,w+=k*z,w+=T*H,w+=C*B,w+=P*N,p=(w+=O*D)>>>13,w&=8191,w+=E*I,w+=A*j,w+=x*M,w+=L*U,_=p+=(w+=R*(5*q))>>>13,_+=k*q,_+=T*z,_+=C*H,_+=P*B,p=(_+=O*N)>>>13,_&=8191,_+=E*D,_+=A*I,_+=x*j,_+=L*M,k=f=8191&(p=(p=((p+=(_+=R*U)>>>13)<<2)+p|0)+(f&=8191)|0),T=l+=p>>>=13,C=d&=8191,P=y&=8191,O=g&=8191,E=v&=8191,A=b&=8191,x=m&=8191,L=w&=8191,R=_&=8191,e+=16,n-=16;this.h[0]=k,this.h[1]=T,this.h[2]=C,this.h[3]=P,this.h[4]=O,this.h[5]=E,this.h[6]=A,this.h[7]=x,this.h[8]=L,this.h[9]=R},C.prototype.finish=function(t,e){var n,r,o,i,s=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;i<16;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(n=this.h[1]>>>13,this.h[1]&=8191,i=2;i<10;i++)this.h[i]+=n,n=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*n,n=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=n,n=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=n,s[0]=this.h[0]+5,n=s[0]>>>13,s[0]&=8191,i=1;i<10;i++)s[i]=this.h[i]+n,n=s[i]>>>13,s[i]&=8191;for(s[9]-=8192,r=(1^n)-1,i=0;i<10;i++)s[i]&=r;for(r=~r,i=0;i<10;i++)this.h[i]=this.h[i]&r|s[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),o=this.h[0]+this.pad[0],this.h[0]=65535&o,i=1;i<8;i++)o=(this.h[i]+this.pad[i]|0)+(o>>>16)|0,this.h[i]=65535&o;t[e+0]=this.h[0]>>>0&255,t[e+1]=this.h[0]>>>8&255,t[e+2]=this.h[1]>>>0&255,t[e+3]=this.h[1]>>>8&255,t[e+4]=this.h[2]>>>0&255,t[e+5]=this.h[2]>>>8&255,t[e+6]=this.h[3]>>>0&255,t[e+7]=this.h[3]>>>8&255,t[e+8]=this.h[4]>>>0&255,t[e+9]=this.h[4]>>>8&255,t[e+10]=this.h[5]>>>0&255,t[e+11]=this.h[5]>>>8&255,t[e+12]=this.h[6]>>>0&255,t[e+13]=this.h[6]>>>8&255,t[e+14]=this.h[7]>>>0&255,t[e+15]=this.h[7]>>>8&255},C.prototype.update=function(t,e,n){var r,o;if(this.leftover){for((o=16-this.leftover)>n&&(o=n),r=0;r=16&&(o=n-n%16,this.blocks(t,e,o),e+=o,n-=o),n){for(r=0;r=128;){for(S=0;S<16;S++)k=8*S+W,x[S]=n[k+0]<<24|n[k+1]<<16|n[k+2]<<8|n[k+3],L[S]=n[k+4]<<24|n[k+5]<<16|n[k+6]<<8|n[k+7];for(S=0;S<80;S++)if(o=R,i=U,s=M,c=j,a=I,u=D,h=N,B,f=H,l=z,d=q,y=F,g=X,v=J,b=Y,K,P=65535&(C=K),O=C>>>16,E=65535&(T=B),A=T>>>16,P+=65535&(C=(X>>>14|I<<18)^(X>>>18|I<<14)^(I>>>9|X<<23)),O+=C>>>16,E+=65535&(T=(I>>>14|X<<18)^(I>>>18|X<<14)^(X>>>9|I<<23)),A+=T>>>16,P+=65535&(C=X&J^~X&Y),O+=C>>>16,E+=65535&(T=I&D^~I&N),A+=T>>>16,P+=65535&(C=G[2*S+1]),O+=C>>>16,E+=65535&(T=G[2*S]),A+=T>>>16,T=x[S%16],O+=(C=L[S%16])>>>16,E+=65535&T,A+=T>>>16,E+=(O+=(P+=65535&C)>>>16)>>>16,P=65535&(C=_=65535&P|O<<16),O=C>>>16,E=65535&(T=w=65535&E|(A+=E>>>16)<<16),A=T>>>16,P+=65535&(C=(H>>>28|R<<4)^(R>>>2|H<<30)^(R>>>7|H<<25)),O+=C>>>16,E+=65535&(T=(R>>>28|H<<4)^(H>>>2|R<<30)^(H>>>7|R<<25)),A+=T>>>16,O+=(C=H&z^H&q^z&q)>>>16,E+=65535&(T=R&U^R&M^U&M),A+=T>>>16,p=65535&(E+=(O+=(P+=65535&C)>>>16)>>>16)|(A+=E>>>16)<<16,m=65535&P|O<<16,P=65535&(C=y),O=C>>>16,E=65535&(T=c),A=T>>>16,O+=(C=_)>>>16,E+=65535&(T=w),A+=T>>>16,U=o,M=i,j=s,I=c=65535&(E+=(O+=(P+=65535&C)>>>16)>>>16)|(A+=E>>>16)<<16,D=a,N=u,B=h,R=p,z=f,q=l,F=d,X=y=65535&P|O<<16,J=g,Y=v,K=b,H=m,S%16==15)for(k=0;k<16;k++)T=x[k],P=65535&(C=L[k]),O=C>>>16,E=65535&T,A=T>>>16,T=x[(k+9)%16],P+=65535&(C=L[(k+9)%16]),O+=C>>>16,E+=65535&T,A+=T>>>16,w=x[(k+1)%16],P+=65535&(C=((_=L[(k+1)%16])>>>1|w<<31)^(_>>>8|w<<24)^(_>>>7|w<<25)),O+=C>>>16,E+=65535&(T=(w>>>1|_<<31)^(w>>>8|_<<24)^w>>>7),A+=T>>>16,w=x[(k+14)%16],O+=(C=((_=L[(k+14)%16])>>>19|w<<13)^(w>>>29|_<<3)^(_>>>6|w<<26))>>>16,E+=65535&(T=(w>>>19|_<<13)^(_>>>29|w<<3)^w>>>6),A+=T>>>16,A+=(E+=(O+=(P+=65535&C)>>>16)>>>16)>>>16,x[k]=65535&E|A<<16,L[k]=65535&P|O<<16;P=65535&(C=H),O=C>>>16,E=65535&(T=R),A=T>>>16,T=t[0],O+=(C=e[0])>>>16,E+=65535&T,A+=T>>>16,A+=(E+=(O+=(P+=65535&C)>>>16)>>>16)>>>16,t[0]=R=65535&E|A<<16,e[0]=H=65535&P|O<<16,P=65535&(C=z),O=C>>>16,E=65535&(T=U),A=T>>>16,T=t[1],O+=(C=e[1])>>>16,E+=65535&T,A+=T>>>16,A+=(E+=(O+=(P+=65535&C)>>>16)>>>16)>>>16,t[1]=U=65535&E|A<<16,e[1]=z=65535&P|O<<16,P=65535&(C=q),O=C>>>16,E=65535&(T=M),A=T>>>16,T=t[2],O+=(C=e[2])>>>16,E+=65535&T,A+=T>>>16,A+=(E+=(O+=(P+=65535&C)>>>16)>>>16)>>>16,t[2]=M=65535&E|A<<16,e[2]=q=65535&P|O<<16,P=65535&(C=F),O=C>>>16,E=65535&(T=j),A=T>>>16,T=t[3],O+=(C=e[3])>>>16,E+=65535&T,A+=T>>>16,A+=(E+=(O+=(P+=65535&C)>>>16)>>>16)>>>16,t[3]=j=65535&E|A<<16,e[3]=F=65535&P|O<<16,P=65535&(C=X),O=C>>>16,E=65535&(T=I),A=T>>>16,T=t[4],O+=(C=e[4])>>>16,E+=65535&T,A+=T>>>16,A+=(E+=(O+=(P+=65535&C)>>>16)>>>16)>>>16,t[4]=I=65535&E|A<<16,e[4]=X=65535&P|O<<16,P=65535&(C=J),O=C>>>16,E=65535&(T=D),A=T>>>16,T=t[5],O+=(C=e[5])>>>16,E+=65535&T,A+=T>>>16,A+=(E+=(O+=(P+=65535&C)>>>16)>>>16)>>>16,t[5]=D=65535&E|A<<16,e[5]=J=65535&P|O<<16,P=65535&(C=Y),O=C>>>16,E=65535&(T=N),A=T>>>16,T=t[6],O+=(C=e[6])>>>16,E+=65535&T,A+=T>>>16,A+=(E+=(O+=(P+=65535&C)>>>16)>>>16)>>>16,t[6]=N=65535&E|A<<16,e[6]=Y=65535&P|O<<16,P=65535&(C=K),O=C>>>16,E=65535&(T=B),A=T>>>16,T=t[7],O+=(C=e[7])>>>16,E+=65535&T,A+=T>>>16,A+=(E+=(O+=(P+=65535&C)>>>16)>>>16)>>>16,t[7]=B=65535&E|A<<16,e[7]=K=65535&P|O<<16,W+=128,r-=128}return r}function Q(t,e,n){var r,o=new Int32Array(8),i=new Int32Array(8),s=new Uint8Array(256),c=n;for(o[0]=1779033703,o[1]=3144134277,o[2]=1013904242,o[3]=2773480762,o[4]=1359893119,o[5]=2600822924,o[6]=528734635,o[7]=1541459225,i[0]=4089235720,i[1]=2227873595,i[2]=4271175723,i[3]=1595750129,i[4]=2917565137,i[5]=725511199,i[6]=4215389547,i[7]=327033209,V(o,i,e,n),n%=128,r=0;r=0;--o)$(t,e,r=n[o/8|0]>>(7&o)&1),Z(e,t),Z(t,t),$(t,e,r)}function nt(t,n){var r=[e(),e(),e(),e()];x(r[0],p),x(r[1],f),x(r[2],c),B(r[3],p,f),et(t,r,n)}function rt(t,n,o){var i,s=new Uint8Array(64),c=[e(),e(),e(),e()];for(o||r(n,32),Q(s,n,32),s[0]&=248,s[31]&=127,s[31]|=64,nt(c,s),tt(t,c),i=0;i<32;i++)n[i+32]=t[i];return 0}var ot=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function it(t,e){var n,r,o,i;for(r=63;r>=32;--r){for(n=0,o=r-32,i=r-12;o>4)*ot[o],n=e[o]>>8,e[o]&=255;for(o=0;o<32;o++)e[o]-=n*ot[o];for(r=0;r<32;r++)e[r+1]+=e[r]>>8,t[r]=255&e[r]}function st(t){var e,n=new Float64Array(64);for(e=0;e<64;e++)n[e]=t[e];for(e=0;e<64;e++)t[e]=0;it(t,n)}function ct(t,n,r,o){var i,s,c=new Uint8Array(64),a=new Uint8Array(64),u=new Uint8Array(64),h=new Float64Array(64),p=[e(),e(),e(),e()];Q(c,o,32),c[0]&=248,c[31]&=127,c[31]|=64;var f=r+64;for(i=0;i>7&&N(t[0],s,t[0]),B(t[3],t[0],t[1]),0)}(f,o))return-1;for(i=0;i=0},t.sign.keyPair=function(){var t=new Uint8Array(32),e=new Uint8Array(64);return rt(t,e),{publicKey:t,secretKey:e}},t.sign.keyPair.fromSecretKey=function(t){if(ht(t),64!==t.length)throw new Error("bad secret key size");for(var e=new Uint8Array(32),n=0;n0)r.loading[t].push(n);else{r.loading[t]=[n];var o=_e.createScriptRequest(r.getPath(t,e)),i=r.receivers.create((function(e){if(r.receivers.remove(i),r.loading[t]){var n=r.loading[t];delete r.loading[t];for(var s=function(t){t||o.cleanup()},c=0;c>>6)+S(128|63&e):S(224|e>>>12&15)+S(128|e>>>6&63)+S(128|63&e)},E=function(t){return t.replace(/[^\x00-\x7F]/g,O)},A=function(t){var e=[0,2,1][t.length%3],n=t.charCodeAt(0)<<16|(t.length>1?t.charCodeAt(1):0)<<8|(t.length>2?t.charCodeAt(2):0);return[k.charAt(n>>>18),k.charAt(n>>>12&63),e>=2?"=":k.charAt(n>>>6&63),e>=1?"=":k.charAt(63&n)].join("")},x=window.btoa||function(t){return t.replace(/[\s\S]{1,3}/g,A)},L=function(){function t(t,e,n,r){var o=this;this.clear=e,this.timer=t((function(){o.timer&&(o.timer=r(o.timer))}),n)}return t.prototype.isRunning=function(){return null!==this.timer},t.prototype.ensureAborted=function(){this.timer&&(this.clear(this.timer),this.timer=null)},t}(),R=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function U(t){window.clearTimeout(t)}function M(t){window.clearInterval(t)}var j=function(t){function e(e,n){return t.call(this,setTimeout,U,e,(function(t){return n(),null}))||this}return R(e,t),e}(L),I=function(t){function e(e,n){return t.call(this,setInterval,M,e,(function(t){return n(),t}))||this}return R(e,t),e}(L),D={now:function(){return Date.now?Date.now():(new Date).valueOf()},defer:function(t){return new j(0,t)},method:function(t){for(var e=[],n=1;n0)for(r=0;r=1002&&t.code<=1004?"backoff":null:4e3===t.code?"tls_only":t.code<4100?"refused":t.code<4200?"backoff":t.code<4300?"retry":"refused"},getCloseError:function(t){return 1e3!==t.code&&1001!==t.code?{type:"PusherError",data:{code:t.code,message:t.reason||t.message}}:null}},Et=Ot,At=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),xt=function(t){function e(e,n){var r=t.call(this)||this;return r.id=e,r.transport=n,r.activityTimeout=n.activityTimeout,r.bindListeners(),r}return At(e,t),e.prototype.handlesActivityChecks=function(){return this.transport.handlesActivityChecks()},e.prototype.send=function(t){return this.transport.send(t)},e.prototype.send_event=function(t,e,n){var r={event:t,data:e};return n&&(r.channel=n),Q.debug("Event sent",r),this.send(Et.encodeMessage(r))},e.prototype.ping=function(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})},e.prototype.close=function(){this.transport.close()},e.prototype.bindListeners=function(){var t=this,e={message:function(e){var n;try{n=Et.decodeMessage(e)}catch(n){t.emit("error",{type:"MessageParseError",error:n,data:e.data})}if(void 0!==n){switch(Q.debug("Event recd",n),n.event){case"pusher:error":t.emit("error",{type:"PusherError",data:n.data});break;case"pusher:ping":t.emit("ping");break;case"pusher:pong":t.emit("pong")}t.emit("message",n)}},activity:function(){t.emit("activity")},error:function(e){t.emit("error",e)},closed:function(e){n(),e&&e.code&&t.handleCloseEvent(e),t.transport=null,t.emit("closed")}},n=function(){z(e,(function(e,n){t.transport.unbind(n,e)}))};z(e,(function(e,n){t.transport.bind(n,e)}))},e.prototype.handleCloseEvent=function(t){var e=Et.getCloseAction(t),n=Et.getCloseError(t);n&&this.emit("error",n),e&&this.emit(e,{action:e,error:n})},e}(ut),Lt=function(){function t(t,e){this.transport=t,this.callback=e,this.bindListeners()}return t.prototype.close=function(){this.unbindListeners(),this.transport.close()},t.prototype.bindListeners=function(){var t=this;this.onMessage=function(e){var n;t.unbindListeners();try{n=Et.processHandshake(e)}catch(e){return t.finish("error",{error:e}),void t.transport.close()}"connected"===n.action?t.finish("connected",{connection:new xt(n.id,t.transport),activityTimeout:n.activityTimeout}):(t.finish(n.action,{error:n.error}),t.transport.close())},this.onClosed=function(e){t.unbindListeners();var n=Et.getCloseAction(e)||"backoff",r=Et.getCloseError(e);t.finish(n,{error:r})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)},t.prototype.unbindListeners=function(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)},t.prototype.finish=function(t,e){this.callback(N({transport:this.transport,action:t},e))},t}(),Rt=function(){function t(t,e){this.channel=t;var n=e.authTransport;if(void 0===_e.getAuthorizers()[n])throw"'"+n+"' is not a recognized auth transport";this.type=n,this.options=e,this.authOptions=e.auth||{}}return t.prototype.composeQuery=function(t){var e="socket_id="+encodeURIComponent(t)+"&channel_name="+encodeURIComponent(this.channel.name);for(var n in this.authOptions.params)e+="&"+encodeURIComponent(n)+"="+encodeURIComponent(this.authOptions.params[n]);return e},t.prototype.authorize=function(e,n){t.authorizers=t.authorizers||_e.getAuthorizers(),t.authorizers[this.type].call(this,_e,e,n)},t}(),Ut=function(){function t(t,e){this.timeline=t,this.options=e||{}}return t.prototype.send=function(t,e){this.timeline.isEmpty()||this.timeline.send(_e.TimelineTransport.getAgent(this,t),e)},t}(),Mt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),jt=function(t){function e(e,n){var r=t.call(this,(function(t,n){Q.debug("No callbacks on "+e+" for "+t)}))||this;return r.name=e,r.pusher=n,r.subscribed=!1,r.subscriptionPending=!1,r.subscriptionCancelled=!1,r}return Mt(e,t),e.prototype.authorize=function(t,e){return e(null,{auth:""})},e.prototype.trigger=function(t,e){if(0!==t.indexOf("client-"))throw new l("Event '"+t+"' does not start with 'client-'");if(!this.subscribed){var n=p("triggeringClientEvents");Q.warn("Client event triggered before channel 'subscription_succeeded' event . "+n)}return this.pusher.send_event(t,e,this.name)},e.prototype.disconnect=function(){this.subscribed=!1,this.subscriptionPending=!1},e.prototype.handleEvent=function(t){var e=t.event,n=t.data;if("pusher_internal:subscription_succeeded"===e)this.handleSubscriptionSucceededEvent(t);else if(0!==e.indexOf("pusher_internal:")){this.emit(e,n,{})}},e.prototype.handleSubscriptionSucceededEvent=function(t){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",t.data)},e.prototype.subscribe=function(){var t=this;this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,(function(e,n){e?(Q.error(e.toString()),t.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:e.message},e instanceof w?{status:e.status}:{}))):t.pusher.send_event("pusher:subscribe",{auth:n.auth,channel_data:n.channel_data,channel:t.name})})))},e.prototype.unsubscribe=function(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})},e.prototype.cancelSubscription=function(){this.subscriptionCancelled=!0},e.prototype.reinstateSubscription=function(){this.subscriptionCancelled=!1},e}(ut),It=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Dt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return It(e,t),e.prototype.authorize=function(t,e){return Wt.createAuthorizer(this,this.pusher.config).authorize(t,e)},e}(jt),Nt=function(){function t(){this.reset()}return t.prototype.get=function(t){return Object.prototype.hasOwnProperty.call(this.members,t)?{id:t,info:this.members[t]}:null},t.prototype.each=function(t){var e=this;z(this.members,(function(n,r){t(e.get(r))}))},t.prototype.setMyID=function(t){this.myID=t},t.prototype.onSubscription=function(t){this.members=t.presence.hash,this.count=t.presence.count,this.me=this.get(this.myID)},t.prototype.addMember=function(t){return null===this.get(t.user_id)&&this.count++,this.members[t.user_id]=t.user_info,this.get(t.user_id)},t.prototype.removeMember=function(t){var e=this.get(t.user_id);return e&&(delete this.members[t.user_id],this.count--),e},t.prototype.reset=function(){this.members={},this.count=0,this.myID=null,this.me=null},t}(),Bt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ht=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.members=new Nt,r}return Bt(e,t),e.prototype.authorize=function(e,n){var r=this;t.prototype.authorize.call(this,e,(function(t,e){if(!t){if(void 0===(e=e).channel_data){var o=p("authenticationEndpoint");return Q.error("Invalid auth response for channel '"+r.name+"',expected 'channel_data' field. "+o),void n("Invalid auth response")}var i=JSON.parse(e.channel_data);r.members.setMyID(i.user_id)}n(t,e)}))},e.prototype.handleEvent=function(t){var e=t.event;if(0===e.indexOf("pusher_internal:"))this.handleInternalEvent(t);else{var n=t.data,r={};t.user_id&&(r.user_id=t.user_id),this.emit(e,n,r)}},e.prototype.handleInternalEvent=function(t){var e=t.event,n=t.data;switch(e){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(t);break;case"pusher_internal:member_added":var r=this.members.addMember(n);this.emit("pusher:member_added",r);break;case"pusher_internal:member_removed":var o=this.members.removeMember(n);o&&this.emit("pusher:member_removed",o)}},e.prototype.handleSubscriptionSucceededEvent=function(t){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(t.data),this.emit("pusher:subscription_succeeded",this.members))},e.prototype.disconnect=function(){this.members.reset(),t.prototype.disconnect.call(this)},e}(Dt),zt=n(1),qt=n(0),Ft=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Xt=function(t){function e(e,n,r){var o=t.call(this,e,n)||this;return o.key=null,o.nacl=r,o}return Ft(e,t),e.prototype.authorize=function(e,n){var r=this;t.prototype.authorize.call(this,e,(function(t,e){if(t)n(t,e);else{var o=e.shared_secret;o?(r.key=Object(qt.decode)(o),delete e.shared_secret,n(null,e)):n(new Error("No shared_secret key in auth payload for encrypted channel: "+r.name),null)}}))},e.prototype.trigger=function(t,e){throw new v("Client events are not currently supported for encrypted channels")},e.prototype.handleEvent=function(e){var n=e.event,r=e.data;0!==n.indexOf("pusher_internal:")&&0!==n.indexOf("pusher:")?this.handleEncryptedEvent(n,r):t.prototype.handleEvent.call(this,e)},e.prototype.handleEncryptedEvent=function(t,e){var n=this;if(this.key)if(e.ciphertext&&e.nonce){var r=Object(qt.decode)(e.ciphertext);if(r.length0&&this.emit("connecting_in",Math.round(t/1e3)),this.retryTimer=new j(t||0,(function(){e.disconnectInternally(),e.connect()}))},e.prototype.clearRetryTimer=function(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)},e.prototype.setUnavailableTimer=function(){var t=this;this.unavailableTimer=new j(this.options.unavailableTimeout,(function(){t.updateState("unavailable")}))},e.prototype.clearUnavailableTimer=function(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()},e.prototype.sendActivityCheck=function(){var t=this;this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new j(this.options.pongTimeout,(function(){t.timeline.error({pong_timed_out:t.options.pongTimeout}),t.retryIn(0)}))},e.prototype.resetActivityCheck=function(){var t=this;this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new j(this.activityTimeout,(function(){t.sendActivityCheck()})))},e.prototype.stopActivityCheck=function(){this.activityTimer&&this.activityTimer.ensureAborted()},e.prototype.buildConnectionCallbacks=function(t){var e=this;return N({},t,{message:function(t){e.resetActivityCheck(),e.emit("message",t)},ping:function(){e.send_event("pusher:pong",{})},activity:function(){e.resetActivityCheck()},error:function(t){e.emit("error",t)},closed:function(){e.abandonConnection(),e.shouldRetry()&&e.retryIn(1e3)}})},e.prototype.buildHandshakeCallbacks=function(t){var e=this;return N({},t,{connected:function(t){e.activityTimeout=Math.min(e.options.activityTimeout,t.activityTimeout,t.connection.activityTimeout||1/0),e.clearUnavailableTimer(),e.setConnection(t.connection),e.socket_id=e.connection.id,e.updateState("connected",{socket_id:e.socket_id})}})},e.prototype.buildErrorCallbacks=function(){var t=this,e=function(e){return function(n){n.error&&t.emit("error",{type:"WebSocketError",error:n.error}),e(n)}};return{tls_only:e((function(){t.usingTLS=!0,t.updateStrategy(),t.retryIn(0)})),refused:e((function(){t.disconnect()})),backoff:e((function(){t.retryIn(1e3)})),retry:e((function(){t.retryIn(0)}))}},e.prototype.setConnection=function(t){for(var e in this.connection=t,this.connectionCallbacks)this.connection.bind(e,this.connectionCallbacks[e]);this.resetActivityCheck()},e.prototype.abandonConnection=function(){if(this.connection){for(var t in this.stopActivityCheck(),this.connectionCallbacks)this.connection.unbind(t,this.connectionCallbacks[t]);var e=this.connection;return this.connection=null,e}},e.prototype.updateState=function(t,e){var n=this.state;if(this.state=t,n!==t){var r=t;"connected"===r&&(r+=" with new socket ID "+e.socket_id),Q.debug("State changed",n+" -> "+r),this.timeline.info({state:t,params:e}),this.emit("state_change",{previous:n,current:t}),this.emit(t,e)}},e.prototype.shouldRetry=function(){return"connecting"===this.state||"connected"===this.state},e}(ut),Kt=function(){function t(){this.channels={}}return t.prototype.add=function(t,e){return this.channels[t]||(this.channels[t]=function(t,e){if(0===t.indexOf("private-encrypted-")){if(e.config.nacl)return Wt.createEncryptedChannel(t,e,e.config.nacl);var n=p("encryptedChannelSupport");throw new v("Tried to subscribe to a private-encrypted- channel but no nacl implementation available. "+n)}return 0===t.indexOf("private-")?Wt.createPrivateChannel(t,e):0===t.indexOf("presence-")?Wt.createPresenceChannel(t,e):Wt.createChannel(t,e)}(t,e)),this.channels[t]},t.prototype.all=function(){return function(t){var e=[];return z(t,(function(t){e.push(t)})),e}(this.channels)},t.prototype.find=function(t){return this.channels[t]},t.prototype.remove=function(t){var e=this.channels[t];return delete this.channels[t],e},t.prototype.disconnect=function(){z(this.channels,(function(t){t.disconnect()}))},t}();var Wt={createChannels:function(){return new Kt},createConnectionManager:function(t,e){return new Yt(t,e)},createChannel:function(t,e){return new jt(t,e)},createPrivateChannel:function(t,e){return new Dt(t,e)},createPresenceChannel:function(t,e){return new Ht(t,e)},createEncryptedChannel:function(t,e,n){return new Xt(t,e,n)},createTimelineSender:function(t,e){return new Ut(t,e)},createAuthorizer:function(t,e){return e.authorizer?e.authorizer(t,e):new Rt(t,e)},createHandshake:function(t,e){return new Lt(t,e)},createAssistantToTheTransportManager:function(t,e,n){return new Pt(t,e,n)}},Gt=function(){function t(t){this.options=t||{},this.livesLeft=this.options.lives||1/0}return t.prototype.getAssistant=function(t){return Wt.createAssistantToTheTransportManager(this,t,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})},t.prototype.isAlive=function(){return this.livesLeft>0},t.prototype.reportDeath=function(){this.livesLeft-=1},t}(),Vt=function(){function t(t,e){this.strategies=t,this.loop=Boolean(e.loop),this.failFast=Boolean(e.failFast),this.timeout=e.timeout,this.timeoutLimit=e.timeoutLimit}return t.prototype.isSupported=function(){return K(this.strategies,D.method("isSupported"))},t.prototype.connect=function(t,e){var n=this,r=this.strategies,o=0,i=this.timeout,s=null,c=function(a,u){u?e(null,u):(o+=1,n.loop&&(o%=r.length),o0&&(o=new j(n.timeout,(function(){i.abort(),r(!0)}))),i=t.connect(e,(function(t,e){t&&o&&o.isRunning()&&!n.failFast||(o&&o.ensureAborted(),r(t,e))})),{abort:function(){o&&o.ensureAborted(),i.abort()},forceMinPriority:function(t){i.forceMinPriority(t)}}},t}(),Qt=function(){function t(t){this.strategies=t}return t.prototype.isSupported=function(){return K(this.strategies,D.method("isSupported"))},t.prototype.connect=function(t,e){return function(t,e,n){var r=X(t,(function(t,r,o,i){return t.connect(e,n(r,i))}));return{abort:function(){F(r,Zt)},forceMinPriority:function(t){F(r,(function(e){e.forceMinPriority(t)}))}}}(this.strategies,t,(function(t,n){return function(r,o){n[t].error=r,r?function(t){return function(t,e){for(var n=0;n=D.now()){var i=this.transports[r.transport];i&&(this.timeline.info({cached:!0,transport:r.transport,latency:r.latency}),o.push(new Vt([i],{timeout:2*r.latency+1e3,failFast:!0})))}var s=D.now(),c=o.pop().connect(t,(function r(i,a){i?(ee(n),o.length>0?(s=D.now(),c=o.pop().connect(t,r)):e(i)):(!function(t,e,n){var r=_e.getLocalStorage();if(r)try{r[te(t)]=V({timestamp:D.now(),transport:e,latency:n})}catch(t){}}(n,a.transport.name,D.now()-s),e(null,a))}));return{abort:function(){c.abort()},forceMinPriority:function(e){t=e,c&&c.forceMinPriority(e)}}},t}();function te(t){return"pusherTransport"+(t?"TLS":"NonTLS")}function ee(t){var e=_e.getLocalStorage();if(e)try{delete e[te(t)]}catch(t){}}var ne=function(){function t(t,e){var n=e.delay;this.strategy=t,this.options={delay:n}}return t.prototype.isSupported=function(){return this.strategy.isSupported()},t.prototype.connect=function(t,e){var n,r=this.strategy,o=new j(this.options.delay,(function(){n=r.connect(t,e)}));return{abort:function(){o.ensureAborted(),n&&n.abort()},forceMinPriority:function(e){t=e,n&&n.forceMinPriority(e)}}},t}(),re=function(){function t(t,e,n){this.test=t,this.trueBranch=e,this.falseBranch=n}return t.prototype.isSupported=function(){return(this.test()?this.trueBranch:this.falseBranch).isSupported()},t.prototype.connect=function(t,e){return(this.test()?this.trueBranch:this.falseBranch).connect(t,e)},t}(),oe=function(){function t(t){this.strategy=t}return t.prototype.isSupported=function(){return this.strategy.isSupported()},t.prototype.connect=function(t,e){var n=this.strategy.connect(t,(function(t,r){r&&n.abort(),e(t,r)}));return n},t}();function ie(t){return function(){return t.isSupported()}}var se,ce=function(t,e,n){var r={};function o(e,o,i,s,c){var a=n(t,e,o,i,s,c);return r[e]=a,a}var i,s=Object.assign({},e,{hostNonTLS:t.wsHost+":"+t.wsPort,hostTLS:t.wsHost+":"+t.wssPort,httpPath:t.wsPath}),c=Object.assign({},s,{useTLS:!0}),a=Object.assign({},e,{hostNonTLS:t.httpHost+":"+t.httpPort,hostTLS:t.httpHost+":"+t.httpsPort,httpPath:t.httpPath}),u={loop:!0,timeout:15e3,timeoutLimit:6e4},h=new Gt({lives:2,minPingDelay:1e4,maxPingDelay:t.activityTimeout}),p=new Gt({lives:2,minPingDelay:1e4,maxPingDelay:t.activityTimeout}),f=o("ws","ws",3,s,h),l=o("wss","ws",3,c,h),d=o("sockjs","sockjs",1,a),y=o("xhr_streaming","xhr_streaming",1,a,p),g=o("xdr_streaming","xdr_streaming",1,a,p),v=o("xhr_polling","xhr_polling",1,a),b=o("xdr_polling","xdr_polling",1,a),m=new Vt([f],u),w=new Vt([l],u),_=new Vt([d],u),S=new Vt([new re(ie(y),y,g)],u),k=new Vt([new re(ie(v),v,b)],u),T=new Vt([new re(ie(S),new Qt([S,new ne(k,{delay:4e3})]),k)],u),C=new re(ie(T),T,_);return i=e.useTLS?new Qt([m,new ne(C,{delay:2e3})]):new Qt([m,new ne(w,{delay:2e3}),new ne(C,{delay:5e3})]),new $t(new oe(new re(ie(f),i,C)),r,{ttl:18e5,timeline:e.timeline,useTLS:e.useTLS})},ae={getRequest:function(t){var e=new window.XDomainRequest;return e.ontimeout=function(){t.emit("error",new d),t.close()},e.onerror=function(e){t.emit("error",e),t.close()},e.onprogress=function(){e.responseText&&e.responseText.length>0&&t.onChunk(200,e.responseText)},e.onload=function(){e.responseText&&e.responseText.length>0&&t.onChunk(200,e.responseText),t.emit("finished",200),t.close()},e},abortRequest:function(t){t.ontimeout=t.onerror=t.onprogress=t.onload=null,t.abort()}},ue=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),he=function(t){function e(e,n,r){var o=t.call(this)||this;return o.hooks=e,o.method=n,o.url=r,o}return ue(e,t),e.prototype.start=function(t){var e=this;this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=function(){e.close()},_e.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(t)},e.prototype.close=function(){this.unloader&&(_e.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)},e.prototype.onChunk=function(t,e){for(;;){var n=this.advanceBuffer(e);if(!n)break;this.emit("chunk",{status:t,data:n})}this.isBufferTooLong(e)&&this.emit("buffer_too_long")},e.prototype.advanceBuffer=function(t){var e=t.slice(this.position),n=e.indexOf("\n");return-1!==n?(this.position+=n+1,e.slice(0,n)):null},e.prototype.isBufferTooLong=function(t){return this.position===t.length&&t.length>262144},e}(ut);!function(t){t[t.CONNECTING=0]="CONNECTING",t[t.OPEN=1]="OPEN",t[t.CLOSED=3]="CLOSED"}(se||(se={}));var pe=se,fe=1;function le(t){var e=-1===t.indexOf("?")?"?":"&";return t+e+"t="+ +new Date+"&n="+fe++}function de(t){return Math.floor(Math.random()*t)}var ye,ge=function(){function t(t,e){this.hooks=t,this.session=de(1e3)+"/"+function(t){for(var e=[],n=0;n0&&t.onChunk(e.status,e.responseText);break;case 4:e.responseText&&e.responseText.length>0&&t.onChunk(e.status,e.responseText),t.emit("finished",e.status),t.close()}},e},abortRequest:function(t){t.onreadystatechange=null,t.abort()}},we={createStreamingSocket:function(t){return this.createSocket(ve,t)},createPollingSocket:function(t){return this.createSocket(be,t)},createSocket:function(t,e){return new ge(t,e)},createXHR:function(t,e){return this.createRequest(me,t,e)},createRequest:function(t,e,n){return new he(t,e,n)},createXDR:function(t,e){return this.createRequest(ae,t,e)}},_e={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:i,DependenciesReceivers:a,getDefaultStrategy:ce,Transports:kt,transportConnectionInitializer:function(){var t=this;t.timeline.info(t.buildTimelineMessage({transport:t.name+(t.options.useTLS?"s":"")})),t.hooks.isInitialized()?t.changeState("initialized"):t.hooks.file?(t.changeState("initializing"),u.load(t.hooks.file,{useTLS:t.options.useTLS},(function(e,n){t.hooks.isInitialized()?(t.changeState("initialized"),n(!0)):(e&&t.onError(e),t.onClose(),n(!1))}))):t.onClose()},HTTPFactory:we,TimelineTransport:et,getXHRAPI:function(){return window.XMLHttpRequest},getWebSocketAPI:function(){return window.WebSocket||window.MozWebSocket},setup:function(t){var e=this;window.Pusher=t;var n=function(){e.onDocumentBody(t.ready)};window.JSON?n():u.load("json2",{},n)},getDocument:function(){return document},getProtocol:function(){return this.getDocument().location.protocol},getAuthorizers:function(){return{ajax:_,jsonp:Z}},onDocumentBody:function(t){var e=this;document.body?t():setTimeout((function(){e.onDocumentBody(t)}),0)},createJSONPRequest:function(t,e){return new tt(t,e)},createScriptRequest:function(t){return new $(t)},getLocalStorage:function(){try{return window.localStorage}catch(t){return}},createXHR:function(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest:function(){return new(this.getXHRAPI())},createMicrosoftXHR:function(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork:function(){return Ct},createWebSocket:function(t){return new(this.getWebSocketAPI())(t)},createSocketRequest:function(t,e){if(this.isXHRSupported())return this.HTTPFactory.createXHR(t,e);if(this.isXDRSupported(0===e.indexOf("https:")))return this.HTTPFactory.createXDR(t,e);throw"Cross-origin HTTP requests are not supported"},isXHRSupported:function(){var t=this.getXHRAPI();return Boolean(t)&&void 0!==(new t).withCredentials},isXDRSupported:function(t){var e=t?"https:":"http:",n=this.getProtocol();return Boolean(window.XDomainRequest)&&n===e},addUnloadListener:function(t){void 0!==window.addEventListener?window.addEventListener("unload",t,!1):void 0!==window.attachEvent&&window.attachEvent("onunload",t)},removeUnloadListener:function(t){void 0!==window.addEventListener?window.removeEventListener("unload",t,!1):void 0!==window.detachEvent&&window.detachEvent("onunload",t)}};!function(t){t[t.ERROR=3]="ERROR",t[t.INFO=6]="INFO",t[t.DEBUG=7]="DEBUG"}(ye||(ye={}));var Se=ye,ke=function(){function t(t,e,n){this.key=t,this.session=e,this.events=[],this.options=n||{},this.sent=0,this.uniqueID=0}return t.prototype.log=function(t,e){t<=this.options.level&&(this.events.push(N({},e,{timestamp:D.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())},t.prototype.error=function(t){this.log(Se.ERROR,t)},t.prototype.info=function(t){this.log(Se.INFO,t)},t.prototype.debug=function(t){this.log(Se.DEBUG,t)},t.prototype.isEmpty=function(){return 0===this.events.length},t.prototype.send=function(t,e){var n=this,r=N({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],t(r,(function(t,r){t||n.sent++,e&&e(t,r)})),!0},t.prototype.generateUniqueID=function(){return this.uniqueID++,this.uniqueID},t}(),Te=function(){function t(t,e,n,r){this.name=t,this.priority=e,this.transport=n,this.options=r||{}}return t.prototype.isSupported=function(){return this.transport.isSupported({useTLS:this.options.useTLS})},t.prototype.connect=function(t,e){var n=this;if(!this.isSupported())return Ce(new m,e);if(this.priority>>18&63),e+=this._encodeByte(o>>>12&63),e+=this._encodeByte(o>>>6&63),e+=this._encodeByte(o>>>0&63)}var r=t.length-n;if(r>0){o=t[n]<<16|(2===r?t[n+1]<<8:0);e+=this._encodeByte(o>>>18&63),e+=this._encodeByte(o>>>12&63),e+=2===r?this._encodeByte(o>>>6&63):this._paddingCharacter||"",e+=this._paddingCharacter||""}return e},t.prototype.maxDecodedLength=function(t){return this._paddingCharacter?t/4*3|0:(6*t+7)/8|0},t.prototype.decodedLength=function(t){return this.maxDecodedLength(t.length-this._getPaddingLength(t))},t.prototype.decode=function(t){if(0===t.length)return new Uint8Array(0);for(var e=this._getPaddingLength(t),n=t.length-e,o=new Uint8Array(this.maxDecodedLength(n)),r=0,i=0,s=0,c=0,a=0,u=0,h=0;i>>4,o[r++]=a<<4|u>>>2,o[r++]=u<<6|h,s|=256&c,s|=256&a,s|=256&u,s|=256&h;if(i>>4,s|=256&c,s|=256&a),i>>2,s|=256&u),i>>8&6,e+=51-t>>>8&-75,e+=61-t>>>8&-15,e+=62-t>>>8&3,String.fromCharCode(e)},t.prototype._decodeChar=function(t){var e=256;return e+=(42-t&t-44)>>>8&-256+t-43+62,e+=(46-t&t-48)>>>8&-256+t-47+63,e+=(47-t&t-58)>>>8&-256+t-48+52,e+=(64-t&t-91)>>>8&-256+t-65+0,e+=(96-t&t-123)>>>8&-256+t-97+26},t.prototype._getPaddingLength=function(t){var e=0;if(this._paddingCharacter){for(var n=t.length-1;n>=0&&t[n]===this._paddingCharacter;n--)e++;if(t.length<4||e>2)throw new Error("Base64Coder: incorrect padding")}return e},t}();e.Coder=i;var s=new i;e.encode=function(t){return s.encode(t)},e.decode=function(t){return s.decode(t)};var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype._encodeByte=function(t){var e=t;return e+=65,e+=25-t>>>8&6,e+=51-t>>>8&-75,e+=61-t>>>8&-13,e+=62-t>>>8&49,String.fromCharCode(e)},e.prototype._decodeChar=function(t){var e=256;return e+=(44-t&t-46)>>>8&-256+t-45+62,e+=(94-t&t-96)>>>8&-256+t-95+63,e+=(47-t&t-58)>>>8&-256+t-48+52,e+=(64-t&t-91)>>>8&-256+t-65+0,e+=(96-t&t-123)>>>8&-256+t-97+26},e}(i);e.URLSafeCoder=c;var a=new c;e.encodeURLSafe=function(t){return a.encode(t)},e.decodeURLSafe=function(t){return a.decode(t)},e.encodedLength=function(t){return s.encodedLength(t)},e.maxDecodedLength=function(t){return s.maxDecodedLength(t)},e.decodedLength=function(t){return s.decodedLength(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o="utf8: invalid source encoding";function r(t){for(var e=0,n=0;n=t.length-1)throw new Error("utf8: invalid string");n++,e+=4}}return e}e.encode=function(t){for(var e=new Uint8Array(r(t)),n=0,o=0;o>6,e[n++]=128|63&i):i<55296?(e[n++]=224|i>>12,e[n++]=128|i>>6&63,e[n++]=128|63&i):(o++,i=(1023&i)<<10,i|=1023&t.charCodeAt(o),i+=65536,e[n++]=240|i>>18,e[n++]=128|i>>12&63,e[n++]=128|i>>6&63,e[n++]=128|63&i)}return e},e.encodedLength=r,e.decode=function(t){for(var e=[],n=0;n=t.length)throw new Error(o);if(128!=(192&(s=t[++n])))throw new Error(o);r=(31&r)<<6|63&s,i=128}else if(r<240){if(n>=t.length-1)throw new Error(o);var s=t[++n],c=t[++n];if(128!=(192&s)||128!=(192&c))throw new Error(o);r=(15&r)<<12|(63&s)<<6|63&c,i=2048}else{if(!(r<248))throw new Error(o);if(n>=t.length-2)throw new Error(o);s=t[++n],c=t[++n];var a=t[++n];if(128!=(192&s)||128!=(192&c)||128!=(192&a))throw new Error(o);r=(15&r)<<18|(63&s)<<12|(63&c)<<6|63&a,i=65536}if(r=55296&&r<=57343)throw new Error(o);if(r>=65536){if(r>1114111)throw new Error(o);r-=65536,e.push(String.fromCharCode(55296|r>>10)),r=56320|1023&r}}e.push(String.fromCharCode(r))}return e.join("")}},function(t,e,n){t.exports=n(3).default},function(t,e,n){"use strict";n.r(e);var o=function(){function t(t,e){this.lastId=0,this.prefix=t,this.name=e}return t.prototype.create=function(t){this.lastId++;var e=this.lastId,n=this.prefix+e,o=this.name+"["+e+"]",r=!1,i=function(){r||(t.apply(null,arguments),r=!0)};return this[e]=i,{number:e,id:n,name:o,callback:i}},t.prototype.remove=function(t){delete this[t.number]},t}(),r=new o("_pusher_script_","Pusher.ScriptReceivers"),i={VERSION:"6.0.3",PROTOCOL:7,wsPort:80,wssPort:443,wsPath:"",httpHost:"sockjs.pusher.com",httpPort:80,httpsPort:443,httpPath:"/pusher",stats_host:"stats.pusher.com",authEndpoint:"/pusher/auth",authTransport:"ajax",activityTimeout:12e4,pongTimeout:3e4,unavailableTimeout:1e4,cluster:"mt1",cdn_http:"http://js.pusher.com",cdn_https:"https://js.pusher.com",dependency_suffix:""},s=function(){function t(t){this.options=t,this.receivers=t.receivers||r,this.loading={}}return t.prototype.load=function(t,e,n){var o=this;if(o.loading[t]&&o.loading[t].length>0)o.loading[t].push(n);else{o.loading[t]=[n];var r=we.createScriptRequest(o.getPath(t,e)),i=o.receivers.create((function(e){if(o.receivers.remove(i),o.loading[t]){var n=o.loading[t];delete o.loading[t];for(var s=function(t){t||r.cleanup()},c=0;c>>6)+u(128|63&e):u(224|e>>>12&15)+u(128|e>>>6&63)+u(128|63&e)},g=function(t){return t.replace(/[^\x00-\x7F]/g,y)},v=function(t){var e=[0,2,1][t.length%3],n=t.charCodeAt(0)<<16|(t.length>1?t.charCodeAt(1):0)<<8|(t.length>2?t.charCodeAt(2):0);return[h.charAt(n>>>18),h.charAt(n>>>12&63),e>=2?"=":h.charAt(n>>>6&63),e>=1?"=":h.charAt(63&n)].join("")},b=window.btoa||function(t){return t.replace(/[\s\S]{1,3}/g,v)},m=function(){function t(t,e,n,o){var r=this;this.clear=e,this.timer=t((function(){r.timer&&(r.timer=o(r.timer))}),n)}return t.prototype.isRunning=function(){return null!==this.timer},t.prototype.ensureAborted=function(){this.timer&&(this.clear(this.timer),this.timer=null)},t}(),w=(d=function(t,e){return(d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}d(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});function _(t){window.clearTimeout(t)}function S(t){window.clearInterval(t)}var k=function(t){function e(e,n){return t.call(this,setTimeout,_,e,(function(t){return n(),null}))||this}return w(e,t),e}(m),C=function(t){function e(e,n){return t.call(this,setInterval,S,e,(function(t){return n(),t}))||this}return w(e,t),e}(m),T={now:function(){return Date.now?Date.now():(new Date).valueOf()},defer:function(t){return new k(0,t)},method:function(t){for(var e=[],n=1;n0)for(o=0;o=1002&&t.code<=1004?"backoff":null:4e3===t.code?"tls_only":t.code<4100?"refused":t.code<4200?"backoff":t.code<4300?"retry":"refused"},getCloseError:function(t){return 1e3!==t.code&&1001!==t.code?{type:"PusherError",data:{code:t.code,message:t.reason||t.message}}:null}},mt=bt,wt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),_t=function(t){function e(e,n){var o=t.call(this)||this;return o.id=e,o.transport=n,o.activityTimeout=n.activityTimeout,o.bindListeners(),o}return wt(e,t),e.prototype.handlesActivityChecks=function(){return this.transport.handlesActivityChecks()},e.prototype.send=function(t){return this.transport.send(t)},e.prototype.send_event=function(t,e,n){var o={event:t,data:e};return n&&(o.channel=n),q.debug("Event sent",o),this.send(mt.encodeMessage(o))},e.prototype.ping=function(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})},e.prototype.close=function(){this.transport.close()},e.prototype.bindListeners=function(){var t=this,e={message:function(e){var n;try{n=mt.decodeMessage(e)}catch(n){t.emit("error",{type:"MessageParseError",error:n,data:e.data})}if(void 0!==n){switch(q.debug("Event recd",n),n.event){case"pusher:error":t.emit("error",{type:"PusherError",data:n.data});break;case"pusher:ping":t.emit("ping");break;case"pusher:pong":t.emit("pong")}t.emit("message",n)}},activity:function(){t.emit("activity")},error:function(e){t.emit("error",{type:"WebSocketError",error:e})},closed:function(e){n(),e&&e.code&&t.handleCloseEvent(e),t.transport=null,t.emit("closed")}},n=function(){L(e,(function(e,n){t.transport.unbind(n,e)}))};L(e,(function(e,n){t.transport.bind(n,e)}))},e.prototype.handleCloseEvent=function(t){var e=mt.getCloseAction(t),n=mt.getCloseError(t);n&&this.emit("error",n),e&&this.emit(e,{action:e,error:n})},e}(tt),St=function(){function t(t,e){this.transport=t,this.callback=e,this.bindListeners()}return t.prototype.close=function(){this.unbindListeners(),this.transport.close()},t.prototype.bindListeners=function(){var t=this;this.onMessage=function(e){var n;t.unbindListeners();try{n=mt.processHandshake(e)}catch(e){return t.finish("error",{error:e}),void t.transport.close()}"connected"===n.action?t.finish("connected",{connection:new _t(n.id,t.transport),activityTimeout:n.activityTimeout}):(t.finish(n.action,{error:n.error}),t.transport.close())},this.onClosed=function(e){t.unbindListeners();var n=mt.getCloseAction(e)||"backoff",o=mt.getCloseError(e);t.finish(n,{error:o})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)},t.prototype.unbindListeners=function(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)},t.prototype.finish=function(t,e){this.callback(P({transport:this.transport,action:t},e))},t}(),kt=function(){function t(t,e){this.channel=t;var n=e.authTransport;if(void 0===we.getAuthorizers()[n])throw"'"+n+"' is not a recognized auth transport";this.type=n,this.options=e,this.authOptions=e.auth||{}}return t.prototype.composeQuery=function(t){var e="socket_id="+encodeURIComponent(t)+"&channel_name="+encodeURIComponent(this.channel.name);for(var n in this.authOptions.params)e+="&"+encodeURIComponent(n)+"="+encodeURIComponent(this.authOptions.params[n]);return e},t.prototype.authorize=function(e,n){t.authorizers=t.authorizers||we.getAuthorizers(),t.authorizers[this.type].call(this,we,e,n)},t}(),Ct=function(){function t(t,e){this.timeline=t,this.options=e||{}}return t.prototype.send=function(t,e){this.timeline.isEmpty()||this.timeline.send(we.TimelineTransport.getAgent(this,t),e)},t}(),Tt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Pt=function(t){function e(e){var n=this.constructor,o=t.call(this,e)||this;return Object.setPrototypeOf(o,n.prototype),o}return Tt(e,t),e}(Error),Ot=function(t){function e(e){var n=this.constructor,o=t.call(this,e)||this;return Object.setPrototypeOf(o,n.prototype),o}return Tt(e,t),e}(Error),Et=function(t){function e(e){var n=this.constructor,o=t.call(this,e)||this;return Object.setPrototypeOf(o,n.prototype),o}return Tt(e,t),e}(Error),Lt=function(t){function e(e){var n=this.constructor,o=t.call(this,e)||this;return Object.setPrototypeOf(o,n.prototype),o}return Tt(e,t),e}(Error),xt=function(t){function e(e){var n=this.constructor,o=t.call(this,e)||this;return Object.setPrototypeOf(o,n.prototype),o}return Tt(e,t),e}(Error),At=function(t){function e(e){var n=this.constructor,o=t.call(this,e)||this;return Object.setPrototypeOf(o,n.prototype),o}return Tt(e,t),e}(Error),Rt=function(t){function e(e){var n=this.constructor,o=t.call(this,e)||this;return Object.setPrototypeOf(o,n.prototype),o}return Tt(e,t),e}(Error),jt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),It=function(t){function e(e,n){var o=t.call(this,(function(t,n){q.debug("No callbacks on "+e+" for "+t)}))||this;return o.name=e,o.pusher=n,o.subscribed=!1,o.subscriptionPending=!1,o.subscriptionCancelled=!1,o}return jt(e,t),e.prototype.authorize=function(t,e){return e(!1,{auth:""})},e.prototype.trigger=function(t,e){if(0!==t.indexOf("client-"))throw new Pt("Event '"+t+"' does not start with 'client-'");if(!this.subscribed){var n=z("triggeringClientEvents");q.warn("Client event triggered before channel 'subscription_succeeded' event . "+n)}return this.pusher.send_event(t,e,this.name)},e.prototype.disconnect=function(){this.subscribed=!1,this.subscriptionPending=!1},e.prototype.handleEvent=function(t){var e=t.event,n=t.data;if("pusher_internal:subscription_succeeded"===e)this.handleSubscriptionSucceededEvent(t);else if(0!==e.indexOf("pusher_internal:")){this.emit(e,n,{})}},e.prototype.handleSubscriptionSucceededEvent=function(t){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",t.data)},e.prototype.subscribe=function(){var t=this;this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,(function(e,n){e?(q.error(n),t.emit("pusher:subscription_error",n)):(n=n,t.pusher.send_event("pusher:subscribe",{auth:n.auth,channel_data:n.channel_data,channel:t.name}))})))},e.prototype.unsubscribe=function(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})},e.prototype.cancelSubscription=function(){this.subscriptionCancelled=!0},e.prototype.reinstateSubscription=function(){this.subscriptionCancelled=!1},e}(tt),Dt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Nt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Dt(e,t),e.prototype.authorize=function(t,e){return Gt.createAuthorizer(this,this.pusher.config).authorize(t,e)},e}(It),Mt=function(){function t(){this.reset()}return t.prototype.get=function(t){return Object.prototype.hasOwnProperty.call(this.members,t)?{id:t,info:this.members[t]}:null},t.prototype.each=function(t){var e=this;L(this.members,(function(n,o){t(e.get(o))}))},t.prototype.setMyID=function(t){this.myID=t},t.prototype.onSubscription=function(t){this.members=t.presence.hash,this.count=t.presence.count,this.me=this.get(this.myID)},t.prototype.addMember=function(t){return null===this.get(t.user_id)&&this.count++,this.members[t.user_id]=t.user_info,this.get(t.user_id)},t.prototype.removeMember=function(t){var e=this.get(t.user_id);return e&&(delete this.members[t.user_id],this.count--),e},t.prototype.reset=function(){this.members={},this.count=0,this.myID=null,this.me=null},t}(),Ht=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),qt=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.members=new Mt,o}return Ht(e,t),e.prototype.authorize=function(e,n){var o=this;t.prototype.authorize.call(this,e,(function(t,e){if(!t){if(void 0===(e=e).channel_data){var r=z("authenticationEndpoint");return q.error("Invalid auth response for channel '"+o.name+"',expected 'channel_data' field. "+r),void n("Invalid auth response")}var i=JSON.parse(e.channel_data);o.members.setMyID(i.user_id)}n(t,e)}))},e.prototype.handleEvent=function(t){var e=t.event;if(0===e.indexOf("pusher_internal:"))this.handleInternalEvent(t);else{var n=t.data,o={};t.user_id&&(o.user_id=t.user_id),this.emit(e,n,o)}},e.prototype.handleInternalEvent=function(t){var e=t.event,n=t.data;switch(e){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(t);break;case"pusher_internal:member_added":var o=this.members.addMember(n);this.emit("pusher:member_added",o);break;case"pusher_internal:member_removed":var r=this.members.removeMember(n);r&&this.emit("pusher:member_removed",r)}},e.prototype.handleSubscriptionSucceededEvent=function(t){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(t.data),this.emit("pusher:subscription_succeeded",this.members))},e.prototype.disconnect=function(){this.members.reset(),t.prototype.disconnect.call(this)},e}(Nt),Bt=n(1),zt=n(0),Ut=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Ft=function(t){function e(e,n,o){var r=t.call(this,e,n)||this;return r.key=null,r.nacl=o,r}return Ut(e,t),e.prototype.authorize=function(e,n){var o=this;t.prototype.authorize.call(this,e,(function(t,e){if(t)n(!0,e);else{var r=e.shared_secret;if(r)o.key=Object(zt.decode)(r),delete e.shared_secret,n(!1,e);else{var i="No shared_secret key in auth payload for encrypted channel: "+o.name;n(!0,i)}}}))},e.prototype.trigger=function(t,e){throw new xt("Client events are not currently supported for encrypted channels")},e.prototype.handleEvent=function(e){var n=e.event,o=e.data;0!==n.indexOf("pusher_internal:")&&0!==n.indexOf("pusher:")?this.handleEncryptedEvent(n,o):t.prototype.handleEvent.call(this,e)},e.prototype.handleEncryptedEvent=function(t,e){var n=this;if(this.key)if(e.ciphertext&&e.nonce){var o=Object(zt.decode)(e.ciphertext);if(o.length0&&this.emit("connecting_in",Math.round(t/1e3)),this.retryTimer=new k(t||0,(function(){e.disconnectInternally(),e.connect()}))},e.prototype.clearRetryTimer=function(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)},e.prototype.setUnavailableTimer=function(){var t=this;this.unavailableTimer=new k(this.options.unavailableTimeout,(function(){t.updateState("unavailable")}))},e.prototype.clearUnavailableTimer=function(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()},e.prototype.sendActivityCheck=function(){var t=this;this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new k(this.options.pongTimeout,(function(){t.timeline.error({pong_timed_out:t.options.pongTimeout}),t.retryIn(0)}))},e.prototype.resetActivityCheck=function(){var t=this;this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new k(this.activityTimeout,(function(){t.sendActivityCheck()})))},e.prototype.stopActivityCheck=function(){this.activityTimer&&this.activityTimer.ensureAborted()},e.prototype.buildConnectionCallbacks=function(t){var e=this;return P({},t,{message:function(t){e.resetActivityCheck(),e.emit("message",t)},ping:function(){e.send_event("pusher:pong",{})},activity:function(){e.resetActivityCheck()},error:function(t){e.emit("error",{type:"WebSocketError",error:t})},closed:function(){e.abandonConnection(),e.shouldRetry()&&e.retryIn(1e3)}})},e.prototype.buildHandshakeCallbacks=function(t){var e=this;return P({},t,{connected:function(t){e.activityTimeout=Math.min(e.options.activityTimeout,t.activityTimeout,t.connection.activityTimeout||1/0),e.clearUnavailableTimer(),e.setConnection(t.connection),e.socket_id=e.connection.id,e.updateState("connected",{socket_id:e.socket_id})}})},e.prototype.buildErrorCallbacks=function(){var t=this,e=function(e){return function(n){n.error&&t.emit("error",{type:"WebSocketError",error:n.error}),e(n)}};return{tls_only:e((function(){t.usingTLS=!0,t.updateStrategy(),t.retryIn(0)})),refused:e((function(){t.disconnect()})),backoff:e((function(){t.retryIn(1e3)})),retry:e((function(){t.retryIn(0)}))}},e.prototype.setConnection=function(t){for(var e in this.connection=t,this.connectionCallbacks)this.connection.bind(e,this.connectionCallbacks[e]);this.resetActivityCheck()},e.prototype.abandonConnection=function(){if(this.connection){for(var t in this.stopActivityCheck(),this.connectionCallbacks)this.connection.unbind(t,this.connectionCallbacks[t]);var e=this.connection;return this.connection=null,e}},e.prototype.updateState=function(t,e){var n=this.state;if(this.state=t,n!==t){var o=t;"connected"===o&&(o+=" with new socket ID "+e.socket_id),q.debug("State changed",n+" -> "+o),this.timeline.info({state:t,params:e}),this.emit("state_change",{previous:n,current:t}),this.emit(t,e)}},e.prototype.shouldRetry=function(){return"connecting"===this.state||"connected"===this.state},e}(tt),Wt=function(){function t(){this.channels={}}return t.prototype.add=function(t,e){return this.channels[t]||(this.channels[t]=function(t,e){if(0===t.indexOf("private-encrypted-")){if(e.config.nacl)return Gt.createEncryptedChannel(t,e,e.config.nacl);var n=z("encryptedChannelSupport");throw new xt("Tried to subscribe to a private-encrypted- channel but no nacl implementation available. "+n)}return 0===t.indexOf("private-")?Gt.createPrivateChannel(t,e):0===t.indexOf("presence-")?Gt.createPresenceChannel(t,e):Gt.createChannel(t,e)}(t,e)),this.channels[t]},t.prototype.all=function(){return function(t){var e=[];return L(t,(function(t){e.push(t)})),e}(this.channels)},t.prototype.find=function(t){return this.channels[t]},t.prototype.remove=function(t){var e=this.channels[t];return delete this.channels[t],e},t.prototype.disconnect=function(){L(this.channels,(function(t){t.disconnect()}))},t}();var Gt={createChannels:function(){return new Wt},createConnectionManager:function(t,e){return new Xt(t,e)},createChannel:function(t,e){return new It(t,e)},createPrivateChannel:function(t,e){return new Nt(t,e)},createPresenceChannel:function(t,e){return new qt(t,e)},createEncryptedChannel:function(t,e,n){return new Ft(t,e,n)},createTimelineSender:function(t,e){return new Ct(t,e)},createAuthorizer:function(t,e){return e.authorizer?e.authorizer(t,e):new kt(t,e)},createHandshake:function(t,e){return new St(t,e)},createAssistantToTheTransportManager:function(t,e,n){return new vt(t,e,n)}},Qt=function(){function t(t){this.options=t||{},this.livesLeft=this.options.lives||1/0}return t.prototype.getAssistant=function(t){return Gt.createAssistantToTheTransportManager(this,t,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})},t.prototype.isAlive=function(){return this.livesLeft>0},t.prototype.reportDeath=function(){this.livesLeft-=1},t}(),Vt=function(){function t(t,e){this.strategies=t,this.loop=Boolean(e.loop),this.failFast=Boolean(e.failFast),this.timeout=e.timeout,this.timeoutLimit=e.timeoutLimit}return t.prototype.isSupported=function(){return D(this.strategies,T.method("isSupported"))},t.prototype.connect=function(t,e){var n=this,o=this.strategies,r=0,i=this.timeout,s=null,c=function(a,u){u?e(null,u):(r+=1,n.loop&&(r%=o.length),r0&&(r=new k(n.timeout,(function(){i.abort(),o(!0)}))),i=t.connect(e,(function(t,e){t&&r&&r.isRunning()&&!n.failFast||(r&&r.ensureAborted(),o(t,e))})),{abort:function(){r&&r.ensureAborted(),i.abort()},forceMinPriority:function(t){i.forceMinPriority(t)}}},t}(),Yt=function(){function t(t){this.strategies=t}return t.prototype.isSupported=function(){return D(this.strategies,T.method("isSupported"))},t.prototype.connect=function(t,e){return function(t,e,n){var o=R(t,(function(t,o,r,i){return t.connect(e,n(o,i))}));return{abort:function(){A(o,$t)},forceMinPriority:function(t){A(o,(function(e){e.forceMinPriority(t)}))}}}(this.strategies,t,(function(t,n){return function(o,r){n[t].error=o,o?function(t){return function(t,e){for(var n=0;n=T.now()){var i=this.transports[o.transport];i&&(this.timeline.info({cached:!0,transport:o.transport,latency:o.latency}),r.push(new Vt([i],{timeout:2*o.latency+1e3,failFast:!0})))}var s=T.now(),c=r.pop().connect(t,(function o(i,a){i?(te(n),r.length>0?(s=T.now(),c=r.pop().connect(t,o)):e(i)):(!function(t,e,n){var o=we.getLocalStorage();if(o)try{o[Zt(t)]=H({timestamp:T.now(),transport:e,latency:n})}catch(t){}}(n,a.transport.name,T.now()-s),e(null,a))}));return{abort:function(){c.abort()},forceMinPriority:function(e){t=e,c&&c.forceMinPriority(e)}}},t}();function Zt(t){return"pusherTransport"+(t?"TLS":"NonTLS")}function te(t){var e=we.getLocalStorage();if(e)try{delete e[Zt(t)]}catch(t){}}var ee=function(){function t(t,e){var n=e.delay;this.strategy=t,this.options={delay:n}}return t.prototype.isSupported=function(){return this.strategy.isSupported()},t.prototype.connect=function(t,e){var n,o=this.strategy,r=new k(this.options.delay,(function(){n=o.connect(t,e)}));return{abort:function(){r.ensureAborted(),n&&n.abort()},forceMinPriority:function(e){t=e,n&&n.forceMinPriority(e)}}},t}(),ne=function(){function t(t,e,n){this.test=t,this.trueBranch=e,this.falseBranch=n}return t.prototype.isSupported=function(){return(this.test()?this.trueBranch:this.falseBranch).isSupported()},t.prototype.connect=function(t,e){return(this.test()?this.trueBranch:this.falseBranch).connect(t,e)},t}(),oe=function(){function t(t){this.strategy=t}return t.prototype.isSupported=function(){return this.strategy.isSupported()},t.prototype.connect=function(t,e){var n=this.strategy.connect(t,(function(t,o){o&&n.abort(),e(t,o)}));return n},t}();function re(t){return function(){return t.isSupported()}}var ie,se=function(t,e,n){var o={};function r(e,r,i,s,c){var a=n(t,e,r,i,s,c);return o[e]=a,a}var i,s=Object.assign({},e,{hostNonTLS:t.wsHost+":"+t.wsPort,hostTLS:t.wsHost+":"+t.wssPort,httpPath:t.wsPath}),c=Object.assign({},s,{useTLS:!0}),a=Object.assign({},e,{hostNonTLS:t.httpHost+":"+t.httpPort,hostTLS:t.httpHost+":"+t.httpsPort,httpPath:t.httpPath}),u={loop:!0,timeout:15e3,timeoutLimit:6e4},h=new Qt({lives:2,minPingDelay:1e4,maxPingDelay:t.activityTimeout}),p=new Qt({lives:2,minPingDelay:1e4,maxPingDelay:t.activityTimeout}),l=r("ws","ws",3,s,h),f=r("wss","ws",3,c,h),d=r("sockjs","sockjs",1,a),y=r("xhr_streaming","xhr_streaming",1,a,p),g=r("xdr_streaming","xdr_streaming",1,a,p),v=r("xhr_polling","xhr_polling",1,a),b=r("xdr_polling","xdr_polling",1,a),m=new Vt([l],u),w=new Vt([f],u),_=new Vt([d],u),S=new Vt([new ne(re(y),y,g)],u),k=new Vt([new ne(re(v),v,b)],u),C=new Vt([new ne(re(S),new Yt([S,new ee(k,{delay:4e3})]),k)],u),T=new ne(re(C),C,_);return i=e.useTLS?new Yt([m,new ee(T,{delay:2e3})]):new Yt([m,new ee(w,{delay:2e3}),new ee(T,{delay:5e3})]),new Kt(new oe(new ne(re(l),i,T)),o,{ttl:18e5,timeline:e.timeline,useTLS:e.useTLS})},ce={getRequest:function(t){var e=new window.XDomainRequest;return e.ontimeout=function(){t.emit("error",new Ot),t.close()},e.onerror=function(e){t.emit("error",e),t.close()},e.onprogress=function(){e.responseText&&e.responseText.length>0&&t.onChunk(200,e.responseText)},e.onload=function(){e.responseText&&e.responseText.length>0&&t.onChunk(200,e.responseText),t.emit("finished",200),t.close()},e},abortRequest:function(t){t.ontimeout=t.onerror=t.onprogress=t.onload=null,t.abort()}},ae=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),ue=function(t){function e(e,n,o){var r=t.call(this)||this;return r.hooks=e,r.method=n,r.url=o,r}return ae(e,t),e.prototype.start=function(t){var e=this;this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=function(){e.close()},we.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(t)},e.prototype.close=function(){this.unloader&&(we.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)},e.prototype.onChunk=function(t,e){for(;;){var n=this.advanceBuffer(e);if(!n)break;this.emit("chunk",{status:t,data:n})}this.isBufferTooLong(e)&&this.emit("buffer_too_long")},e.prototype.advanceBuffer=function(t){var e=t.slice(this.position),n=e.indexOf("\n");return-1!==n?(this.position+=n+1,e.slice(0,n)):null},e.prototype.isBufferTooLong=function(t){return this.position===t.length&&t.length>262144},e}(tt);!function(t){t[t.CONNECTING=0]="CONNECTING",t[t.OPEN=1]="OPEN",t[t.CLOSED=3]="CLOSED"}(ie||(ie={}));var he=ie,pe=1;function le(t){var e=-1===t.indexOf("?")?"?":"&";return t+e+"t="+ +new Date+"&n="+pe++}function fe(t){return Math.floor(Math.random()*t)}var de,ye=function(){function t(t,e){this.hooks=t,this.session=fe(1e3)+"/"+function(t){for(var e=[],n=0;n0&&t.onChunk(e.status,e.responseText);break;case 4:e.responseText&&e.responseText.length>0&&t.onChunk(e.status,e.responseText),t.emit("finished",e.status),t.close()}},e},abortRequest:function(t){t.onreadystatechange=null,t.abort()}},me={createStreamingSocket:function(t){return this.createSocket(ge,t)},createPollingSocket:function(t){return this.createSocket(ve,t)},createSocket:function(t,e){return new ye(t,e)},createXHR:function(t,e){return this.createRequest(be,t,e)},createRequest:function(t,e,n){return new ue(t,e,n)},createXDR:function(t,e){return this.createRequest(ce,t,e)}},we={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:r,DependenciesReceivers:c,getDefaultStrategy:se,Transports:dt,transportConnectionInitializer:function(){var t=this;t.timeline.info(t.buildTimelineMessage({transport:t.name+(t.options.useTLS?"s":"")})),t.hooks.isInitialized()?t.changeState("initialized"):t.hooks.file?(t.changeState("initializing"),a.load(t.hooks.file,{useTLS:t.options.useTLS},(function(e,n){t.hooks.isInitialized()?(t.changeState("initialized"),n(!0)):(e&&t.onError(e),t.onClose(),n(!1))}))):t.onClose()},HTTPFactory:me,TimelineTransport:W,getXHRAPI:function(){return window.XMLHttpRequest},getWebSocketAPI:function(){return window.WebSocket||window.MozWebSocket},setup:function(t){var e=this;window.Pusher=t;var n=function(){e.onDocumentBody(t.ready)};window.JSON?n():a.load("json2",{},n)},getDocument:function(){return document},getProtocol:function(){return this.getDocument().location.protocol},getAuthorizers:function(){return{ajax:U,jsonp:F}},onDocumentBody:function(t){var e=this;document.body?t():setTimeout((function(){e.onDocumentBody(t)}),0)},createJSONPRequest:function(t,e){return new X(t,e)},createScriptRequest:function(t){return new J(t)},getLocalStorage:function(){try{return window.localStorage}catch(t){return}},createXHR:function(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest:function(){return new(this.getXHRAPI())},createMicrosoftXHR:function(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork:function(){return gt},createWebSocket:function(t){return new(this.getWebSocketAPI())(t)},createSocketRequest:function(t,e){if(this.isXHRSupported())return this.HTTPFactory.createXHR(t,e);if(this.isXDRSupported(0===e.indexOf("https:")))return this.HTTPFactory.createXDR(t,e);throw"Cross-origin HTTP requests are not supported"},isXHRSupported:function(){var t=this.getXHRAPI();return Boolean(t)&&void 0!==(new t).withCredentials},isXDRSupported:function(t){var e=t?"https:":"http:",n=this.getProtocol();return Boolean(window.XDomainRequest)&&n===e},addUnloadListener:function(t){void 0!==window.addEventListener?window.addEventListener("unload",t,!1):void 0!==window.attachEvent&&window.attachEvent("onunload",t)},removeUnloadListener:function(t){void 0!==window.addEventListener?window.removeEventListener("unload",t,!1):void 0!==window.detachEvent&&window.detachEvent("onunload",t)}};!function(t){t[t.ERROR=3]="ERROR",t[t.INFO=6]="INFO",t[t.DEBUG=7]="DEBUG"}(de||(de={}));var _e=de,Se=function(){function t(t,e,n){this.key=t,this.session=e,this.events=[],this.options=n||{},this.sent=0,this.uniqueID=0}return t.prototype.log=function(t,e){t<=this.options.level&&(this.events.push(P({},e,{timestamp:T.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())},t.prototype.error=function(t){this.log(_e.ERROR,t)},t.prototype.info=function(t){this.log(_e.INFO,t)},t.prototype.debug=function(t){this.log(_e.DEBUG,t)},t.prototype.isEmpty=function(){return 0===this.events.length},t.prototype.send=function(t,e){var n=this,o=P({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],t(o,(function(t,o){t||n.sent++,e&&e(t,o)})),!0},t.prototype.generateUniqueID=function(){return this.uniqueID++,this.uniqueID},t}(),ke=function(){function t(t,e,n,o){this.name=t,this.priority=e,this.transport=n,this.options=o||{}}return t.prototype.isSupported=function(){return this.transport.isSupported({useTLS:this.options.useTLS})},t.prototype.connect=function(t,e){var n=this;if(!this.isSupported())return Ce(new Rt,e);if(this.priority>>18&63),e+=this._encodeByte(o>>>12&63),e+=this._encodeByte(o>>>6&63),e+=this._encodeByte(o>>>0&63)}var r=t.length-n;if(r>0){o=t[n]<<16|(2===r?t[n+1]<<8:0);e+=this._encodeByte(o>>>18&63),e+=this._encodeByte(o>>>12&63),e+=2===r?this._encodeByte(o>>>6&63):this._paddingCharacter||"",e+=this._paddingCharacter||""}return e},t.prototype.maxDecodedLength=function(t){return this._paddingCharacter?t/4*3|0:(6*t+7)/8|0},t.prototype.decodedLength=function(t){return this.maxDecodedLength(t.length-this._getPaddingLength(t))},t.prototype.decode=function(t){if(0===t.length)return new Uint8Array(0);for(var e=this._getPaddingLength(t),n=t.length-e,o=new Uint8Array(this.maxDecodedLength(n)),r=0,i=0,s=0,c=0,a=0,u=0,h=0;i>>4,o[r++]=a<<4|u>>>2,o[r++]=u<<6|h,s|=256&c,s|=256&a,s|=256&u,s|=256&h;if(i>>4,s|=256&c,s|=256&a),i>>2,s|=256&u),i>>8&6,e+=51-t>>>8&-75,e+=61-t>>>8&-15,e+=62-t>>>8&3,String.fromCharCode(e)},t.prototype._decodeChar=function(t){var e=256;return e+=(42-t&t-44)>>>8&-256+t-43+62,e+=(46-t&t-48)>>>8&-256+t-47+63,e+=(47-t&t-58)>>>8&-256+t-48+52,e+=(64-t&t-91)>>>8&-256+t-65+0,e+=(96-t&t-123)>>>8&-256+t-97+26},t.prototype._getPaddingLength=function(t){var e=0;if(this._paddingCharacter){for(var n=t.length-1;n>=0&&t[n]===this._paddingCharacter;n--)e++;if(t.length<4||e>2)throw new Error("Base64Coder: incorrect padding")}return e},t}();e.Coder=i;var s=new i;e.encode=function(t){return s.encode(t)},e.decode=function(t){return s.decode(t)};var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype._encodeByte=function(t){var e=t;return e+=65,e+=25-t>>>8&6,e+=51-t>>>8&-75,e+=61-t>>>8&-13,e+=62-t>>>8&49,String.fromCharCode(e)},e.prototype._decodeChar=function(t){var e=256;return e+=(44-t&t-46)>>>8&-256+t-45+62,e+=(94-t&t-96)>>>8&-256+t-95+63,e+=(47-t&t-58)>>>8&-256+t-48+52,e+=(64-t&t-91)>>>8&-256+t-65+0,e+=(96-t&t-123)>>>8&-256+t-97+26},e}(i);e.URLSafeCoder=c;var a=new c;e.encodeURLSafe=function(t){return a.encode(t)},e.decodeURLSafe=function(t){return a.decode(t)},e.encodedLength=function(t){return s.encodedLength(t)},e.maxDecodedLength=function(t){return s.maxDecodedLength(t)},e.decodedLength=function(t){return s.decodedLength(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o="utf8: invalid source encoding";function r(t){for(var e=0,n=0;n=t.length-1)throw new Error("utf8: invalid string");n++,e+=4}}return e}e.encode=function(t){for(var e=new Uint8Array(r(t)),n=0,o=0;o>6,e[n++]=128|63&i):i<55296?(e[n++]=224|i>>12,e[n++]=128|i>>6&63,e[n++]=128|63&i):(o++,i=(1023&i)<<10,i|=1023&t.charCodeAt(o),i+=65536,e[n++]=240|i>>18,e[n++]=128|i>>12&63,e[n++]=128|i>>6&63,e[n++]=128|63&i)}return e},e.encodedLength=r,e.decode=function(t){for(var e=[],n=0;n=t.length)throw new Error(o);if(128!=(192&(s=t[++n])))throw new Error(o);r=(31&r)<<6|63&s,i=128}else if(r<240){if(n>=t.length-1)throw new Error(o);var s=t[++n],c=t[++n];if(128!=(192&s)||128!=(192&c))throw new Error(o);r=(15&r)<<12|(63&s)<<6|63&c,i=2048}else{if(!(r<248))throw new Error(o);if(n>=t.length-2)throw new Error(o);s=t[++n],c=t[++n];var a=t[++n];if(128!=(192&s)||128!=(192&c)||128!=(192&a))throw new Error(o);r=(15&r)<<18|(63&s)<<12|(63&c)<<6|63&a,i=65536}if(r=55296&&r<=57343)throw new Error(o);if(r>=65536){if(r>1114111)throw new Error(o);r-=65536,e.push(String.fromCharCode(55296|r>>10)),r=56320|1023&r}}e.push(String.fromCharCode(r))}return e.join("")}},function(t,e,n){t.exports=n(3).default},function(t,e,n){"use strict";n.r(e);var o,r=function(){function t(t,e){this.lastId=0,this.prefix=t,this.name=e}return t.prototype.create=function(t){this.lastId++;var e=this.lastId,n=this.prefix+e,o=this.name+"["+e+"]",r=!1,i=function(){r||(t.apply(null,arguments),r=!0)};return this[e]=i,{number:e,id:n,name:o,callback:i}},t.prototype.remove=function(t){delete this[t.number]},t}(),i=new r("_pusher_script_","Pusher.ScriptReceivers"),s={VERSION:"7.0.0",PROTOCOL:7,wsPort:80,wssPort:443,wsPath:"",httpHost:"sockjs.pusher.com",httpPort:80,httpsPort:443,httpPath:"/pusher",stats_host:"stats.pusher.com",authEndpoint:"/pusher/auth",authTransport:"ajax",activityTimeout:12e4,pongTimeout:3e4,unavailableTimeout:1e4,cluster:"mt1",cdn_http:"http://js.pusher.com",cdn_https:"https://js.pusher.com",dependency_suffix:""},c=function(){function t(t){this.options=t,this.receivers=t.receivers||i,this.loading={}}return t.prototype.load=function(t,e,n){var o=this;if(o.loading[t]&&o.loading[t].length>0)o.loading[t].push(n);else{o.loading[t]=[n];var r=_e.createScriptRequest(o.getPath(t,e)),i=o.receivers.create((function(e){if(o.receivers.remove(i),o.loading[t]){var n=o.loading[t];delete o.loading[t];for(var s=function(t){t||r.cleanup()},c=0;c>>6)+S(128|63&e):S(224|e>>>12&15)+S(128|e>>>6&63)+S(128|63&e)},E=function(t){return t.replace(/[^\x00-\x7F]/g,O)},L=function(t){var e=[0,2,1][t.length%3],n=t.charCodeAt(0)<<16|(t.length>1?t.charCodeAt(1):0)<<8|(t.length>2?t.charCodeAt(2):0);return[k.charAt(n>>>18),k.charAt(n>>>12&63),e>=2?"=":k.charAt(n>>>6&63),e>=1?"=":k.charAt(63&n)].join("")},x=window.btoa||function(t){return t.replace(/[\s\S]{1,3}/g,L)},A=function(){function t(t,e,n,o){var r=this;this.clear=e,this.timer=t((function(){r.timer&&(r.timer=o(r.timer))}),n)}return t.prototype.isRunning=function(){return null!==this.timer},t.prototype.ensureAborted=function(){this.timer&&(this.clear(this.timer),this.timer=null)},t}(),R=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();function j(t){window.clearTimeout(t)}function D(t){window.clearInterval(t)}var I=function(t){function e(e,n){return t.call(this,setTimeout,j,e,(function(t){return n(),null}))||this}return R(e,t),e}(A),N=function(t){function e(e,n){return t.call(this,setInterval,D,e,(function(t){return n(),t}))||this}return R(e,t),e}(A),M={now:function(){return Date.now?Date.now():(new Date).valueOf()},defer:function(t){return new I(0,t)},method:function(t){for(var e=[],n=1;n0)for(o=0;o=1002&&t.code<=1004?"backoff":null:4e3===t.code?"tls_only":t.code<4100?"refused":t.code<4200?"backoff":t.code<4300?"retry":"refused"},getCloseError:function(t){return 1e3!==t.code&&1001!==t.code?{type:"PusherError",data:{code:t.code,message:t.reason||t.message}}:null}},Et=Ot,Lt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),xt=function(t){function e(e,n){var o=t.call(this)||this;return o.id=e,o.transport=n,o.activityTimeout=n.activityTimeout,o.bindListeners(),o}return Lt(e,t),e.prototype.handlesActivityChecks=function(){return this.transport.handlesActivityChecks()},e.prototype.send=function(t){return this.transport.send(t)},e.prototype.send_event=function(t,e,n){var o={event:t,data:e};return n&&(o.channel=n),$.debug("Event sent",o),this.send(Et.encodeMessage(o))},e.prototype.ping=function(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})},e.prototype.close=function(){this.transport.close()},e.prototype.bindListeners=function(){var t=this,e={message:function(e){var n;try{n=Et.decodeMessage(e)}catch(n){t.emit("error",{type:"MessageParseError",error:n,data:e.data})}if(void 0!==n){switch($.debug("Event recd",n),n.event){case"pusher:error":t.emit("error",{type:"PusherError",data:n.data});break;case"pusher:ping":t.emit("ping");break;case"pusher:pong":t.emit("pong")}t.emit("message",n)}},activity:function(){t.emit("activity")},error:function(e){t.emit("error",e)},closed:function(e){n(),e&&e.code&&t.handleCloseEvent(e),t.transport=null,t.emit("closed")}},n=function(){z(e,(function(e,n){t.transport.unbind(n,e)}))};z(e,(function(e,n){t.transport.bind(n,e)}))},e.prototype.handleCloseEvent=function(t){var e=Et.getCloseAction(t),n=Et.getCloseError(t);n&&this.emit("error",n),e&&this.emit(e,{action:e,error:n})},e}(ut),At=function(){function t(t,e){this.transport=t,this.callback=e,this.bindListeners()}return t.prototype.close=function(){this.unbindListeners(),this.transport.close()},t.prototype.bindListeners=function(){var t=this;this.onMessage=function(e){var n;t.unbindListeners();try{n=Et.processHandshake(e)}catch(e){return t.finish("error",{error:e}),void t.transport.close()}"connected"===n.action?t.finish("connected",{connection:new xt(n.id,t.transport),activityTimeout:n.activityTimeout}):(t.finish(n.action,{error:n.error}),t.transport.close())},this.onClosed=function(e){t.unbindListeners();var n=Et.getCloseAction(e)||"backoff",o=Et.getCloseError(e);t.finish(n,{error:o})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)},t.prototype.unbindListeners=function(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)},t.prototype.finish=function(t,e){this.callback(H({transport:this.transport,action:t},e))},t}(),Rt=function(){function t(t,e){this.channel=t;var n=e.authTransport;if(void 0===_e.getAuthorizers()[n])throw"'"+n+"' is not a recognized auth transport";this.type=n,this.options=e,this.authOptions=e.auth||{}}return t.prototype.composeQuery=function(t){var e="socket_id="+encodeURIComponent(t)+"&channel_name="+encodeURIComponent(this.channel.name);for(var n in this.authOptions.params)e+="&"+encodeURIComponent(n)+"="+encodeURIComponent(this.authOptions.params[n]);return e},t.prototype.authorize=function(e,n){t.authorizers=t.authorizers||_e.getAuthorizers(),t.authorizers[this.type].call(this,_e,e,n)},t}(),jt=function(){function t(t,e){this.timeline=t,this.options=e||{}}return t.prototype.send=function(t,e){this.timeline.isEmpty()||this.timeline.send(_e.TimelineTransport.getAgent(this,t),e)},t}(),Dt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),It=function(t){function e(e,n){var o=t.call(this,(function(t,n){$.debug("No callbacks on "+e+" for "+t)}))||this;return o.name=e,o.pusher=n,o.subscribed=!1,o.subscriptionPending=!1,o.subscriptionCancelled=!1,o}return Dt(e,t),e.prototype.authorize=function(t,e){return e(null,{auth:""})},e.prototype.trigger=function(t,e){if(0!==t.indexOf("client-"))throw new f("Event '"+t+"' does not start with 'client-'");if(!this.subscribed){var n=p("triggeringClientEvents");$.warn("Client event triggered before channel 'subscription_succeeded' event . "+n)}return this.pusher.send_event(t,e,this.name)},e.prototype.disconnect=function(){this.subscribed=!1,this.subscriptionPending=!1},e.prototype.handleEvent=function(t){var e=t.event,n=t.data;if("pusher_internal:subscription_succeeded"===e)this.handleSubscriptionSucceededEvent(t);else if(0!==e.indexOf("pusher_internal:")){this.emit(e,n,{})}},e.prototype.handleSubscriptionSucceededEvent=function(t){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",t.data)},e.prototype.subscribe=function(){var t=this;this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,(function(e,n){e?($.error(e.toString()),t.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:e.message},e instanceof w?{status:e.status}:{}))):t.pusher.send_event("pusher:subscribe",{auth:n.auth,channel_data:n.channel_data,channel:t.name})})))},e.prototype.unsubscribe=function(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})},e.prototype.cancelSubscription=function(){this.subscriptionCancelled=!0},e.prototype.reinstateSubscription=function(){this.subscriptionCancelled=!1},e}(ut),Nt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Mt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Nt(e,t),e.prototype.authorize=function(t,e){return Qt.createAuthorizer(this,this.pusher.config).authorize(t,e)},e}(It),Ht=function(){function t(){this.reset()}return t.prototype.get=function(t){return Object.prototype.hasOwnProperty.call(this.members,t)?{id:t,info:this.members[t]}:null},t.prototype.each=function(t){var e=this;z(this.members,(function(n,o){t(e.get(o))}))},t.prototype.setMyID=function(t){this.myID=t},t.prototype.onSubscription=function(t){this.members=t.presence.hash,this.count=t.presence.count,this.me=this.get(this.myID)},t.prototype.addMember=function(t){return null===this.get(t.user_id)&&this.count++,this.members[t.user_id]=t.user_info,this.get(t.user_id)},t.prototype.removeMember=function(t){var e=this.get(t.user_id);return e&&(delete this.members[t.user_id],this.count--),e},t.prototype.reset=function(){this.members={},this.count=0,this.myID=null,this.me=null},t}(),qt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Bt=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.members=new Ht,o}return qt(e,t),e.prototype.authorize=function(e,n){var o=this;t.prototype.authorize.call(this,e,(function(t,e){if(!t){if(void 0===(e=e).channel_data){var r=p("authenticationEndpoint");return $.error("Invalid auth response for channel '"+o.name+"',expected 'channel_data' field. "+r),void n("Invalid auth response")}var i=JSON.parse(e.channel_data);o.members.setMyID(i.user_id)}n(t,e)}))},e.prototype.handleEvent=function(t){var e=t.event;if(0===e.indexOf("pusher_internal:"))this.handleInternalEvent(t);else{var n=t.data,o={};t.user_id&&(o.user_id=t.user_id),this.emit(e,n,o)}},e.prototype.handleInternalEvent=function(t){var e=t.event,n=t.data;switch(e){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(t);break;case"pusher_internal:member_added":var o=this.members.addMember(n);this.emit("pusher:member_added",o);break;case"pusher_internal:member_removed":var r=this.members.removeMember(n);r&&this.emit("pusher:member_removed",r)}},e.prototype.handleSubscriptionSucceededEvent=function(t){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(t.data),this.emit("pusher:subscription_succeeded",this.members))},e.prototype.disconnect=function(){this.members.reset(),t.prototype.disconnect.call(this)},e}(Mt),zt=n(1),Ut=n(0),Ft=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Xt=function(t){function e(e,n,o){var r=t.call(this,e,n)||this;return r.key=null,r.nacl=o,r}return Ft(e,t),e.prototype.authorize=function(e,n){var o=this;t.prototype.authorize.call(this,e,(function(t,e){if(t)n(t,e);else{var r=e.shared_secret;r?(o.key=Object(Ut.decode)(r),delete e.shared_secret,n(null,e)):n(new Error("No shared_secret key in auth payload for encrypted channel: "+o.name),null)}}))},e.prototype.trigger=function(t,e){throw new v("Client events are not currently supported for encrypted channels")},e.prototype.handleEvent=function(e){var n=e.event,o=e.data;0!==n.indexOf("pusher_internal:")&&0!==n.indexOf("pusher:")?this.handleEncryptedEvent(n,o):t.prototype.handleEvent.call(this,e)},e.prototype.handleEncryptedEvent=function(t,e){var n=this;if(this.key)if(e.ciphertext&&e.nonce){var o=Object(Ut.decode)(e.ciphertext);if(o.length0&&this.emit("connecting_in",Math.round(t/1e3)),this.retryTimer=new I(t||0,(function(){e.disconnectInternally(),e.connect()}))},e.prototype.clearRetryTimer=function(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)},e.prototype.setUnavailableTimer=function(){var t=this;this.unavailableTimer=new I(this.options.unavailableTimeout,(function(){t.updateState("unavailable")}))},e.prototype.clearUnavailableTimer=function(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()},e.prototype.sendActivityCheck=function(){var t=this;this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new I(this.options.pongTimeout,(function(){t.timeline.error({pong_timed_out:t.options.pongTimeout}),t.retryIn(0)}))},e.prototype.resetActivityCheck=function(){var t=this;this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new I(this.activityTimeout,(function(){t.sendActivityCheck()})))},e.prototype.stopActivityCheck=function(){this.activityTimer&&this.activityTimer.ensureAborted()},e.prototype.buildConnectionCallbacks=function(t){var e=this;return H({},t,{message:function(t){e.resetActivityCheck(),e.emit("message",t)},ping:function(){e.send_event("pusher:pong",{})},activity:function(){e.resetActivityCheck()},error:function(t){e.emit("error",t)},closed:function(){e.abandonConnection(),e.shouldRetry()&&e.retryIn(1e3)}})},e.prototype.buildHandshakeCallbacks=function(t){var e=this;return H({},t,{connected:function(t){e.activityTimeout=Math.min(e.options.activityTimeout,t.activityTimeout,t.connection.activityTimeout||1/0),e.clearUnavailableTimer(),e.setConnection(t.connection),e.socket_id=e.connection.id,e.updateState("connected",{socket_id:e.socket_id})}})},e.prototype.buildErrorCallbacks=function(){var t=this,e=function(e){return function(n){n.error&&t.emit("error",{type:"WebSocketError",error:n.error}),e(n)}};return{tls_only:e((function(){t.usingTLS=!0,t.updateStrategy(),t.retryIn(0)})),refused:e((function(){t.disconnect()})),backoff:e((function(){t.retryIn(1e3)})),retry:e((function(){t.retryIn(0)}))}},e.prototype.setConnection=function(t){for(var e in this.connection=t,this.connectionCallbacks)this.connection.bind(e,this.connectionCallbacks[e]);this.resetActivityCheck()},e.prototype.abandonConnection=function(){if(this.connection){for(var t in this.stopActivityCheck(),this.connectionCallbacks)this.connection.unbind(t,this.connectionCallbacks[t]);var e=this.connection;return this.connection=null,e}},e.prototype.updateState=function(t,e){var n=this.state;if(this.state=t,n!==t){var o=t;"connected"===o&&(o+=" with new socket ID "+e.socket_id),$.debug("State changed",n+" -> "+o),this.timeline.info({state:t,params:e}),this.emit("state_change",{previous:n,current:t}),this.emit(t,e)}},e.prototype.shouldRetry=function(){return"connecting"===this.state||"connected"===this.state},e}(ut),Gt=function(){function t(){this.channels={}}return t.prototype.add=function(t,e){return this.channels[t]||(this.channels[t]=function(t,e){if(0===t.indexOf("private-encrypted-")){if(e.config.nacl)return Qt.createEncryptedChannel(t,e,e.config.nacl);var n=p("encryptedChannelSupport");throw new v("Tried to subscribe to a private-encrypted- channel but no nacl implementation available. "+n)}return 0===t.indexOf("private-")?Qt.createPrivateChannel(t,e):0===t.indexOf("presence-")?Qt.createPresenceChannel(t,e):Qt.createChannel(t,e)}(t,e)),this.channels[t]},t.prototype.all=function(){return function(t){var e=[];return z(t,(function(t){e.push(t)})),e}(this.channels)},t.prototype.find=function(t){return this.channels[t]},t.prototype.remove=function(t){var e=this.channels[t];return delete this.channels[t],e},t.prototype.disconnect=function(){z(this.channels,(function(t){t.disconnect()}))},t}();var Qt={createChannels:function(){return new Gt},createConnectionManager:function(t,e){return new Wt(t,e)},createChannel:function(t,e){return new It(t,e)},createPrivateChannel:function(t,e){return new Mt(t,e)},createPresenceChannel:function(t,e){return new Bt(t,e)},createEncryptedChannel:function(t,e,n){return new Xt(t,e,n)},createTimelineSender:function(t,e){return new jt(t,e)},createAuthorizer:function(t,e){return e.authorizer?e.authorizer(t,e):new Rt(t,e)},createHandshake:function(t,e){return new At(t,e)},createAssistantToTheTransportManager:function(t,e,n){return new Pt(t,e,n)}},Vt=function(){function t(t){this.options=t||{},this.livesLeft=this.options.lives||1/0}return t.prototype.getAssistant=function(t){return Qt.createAssistantToTheTransportManager(this,t,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})},t.prototype.isAlive=function(){return this.livesLeft>0},t.prototype.reportDeath=function(){this.livesLeft-=1},t}(),Yt=function(){function t(t,e){this.strategies=t,this.loop=Boolean(e.loop),this.failFast=Boolean(e.failFast),this.timeout=e.timeout,this.timeoutLimit=e.timeoutLimit}return t.prototype.isSupported=function(){return G(this.strategies,M.method("isSupported"))},t.prototype.connect=function(t,e){var n=this,o=this.strategies,r=0,i=this.timeout,s=null,c=function(a,u){u?e(null,u):(r+=1,n.loop&&(r%=o.length),r0&&(r=new I(n.timeout,(function(){i.abort(),o(!0)}))),i=t.connect(e,(function(t,e){t&&r&&r.isRunning()&&!n.failFast||(r&&r.ensureAborted(),o(t,e))})),{abort:function(){r&&r.ensureAborted(),i.abort()},forceMinPriority:function(t){i.forceMinPriority(t)}}},t}(),$t=function(){function t(t){this.strategies=t}return t.prototype.isSupported=function(){return G(this.strategies,M.method("isSupported"))},t.prototype.connect=function(t,e){return function(t,e,n){var o=X(t,(function(t,o,r,i){return t.connect(e,n(o,i))}));return{abort:function(){F(o,Kt)},forceMinPriority:function(t){F(o,(function(e){e.forceMinPriority(t)}))}}}(this.strategies,t,(function(t,n){return function(o,r){n[t].error=o,o?function(t){return function(t,e){for(var n=0;n=M.now()){var i=this.transports[o.transport];i&&(this.timeline.info({cached:!0,transport:o.transport,latency:o.latency}),r.push(new Yt([i],{timeout:2*o.latency+1e3,failFast:!0})))}var s=M.now(),c=r.pop().connect(t,(function o(i,a){i?(ee(n),r.length>0?(s=M.now(),c=r.pop().connect(t,o)):e(i)):(!function(t,e,n){var o=_e.getLocalStorage();if(o)try{o[te(t)]=Y({timestamp:M.now(),transport:e,latency:n})}catch(t){}}(n,a.transport.name,M.now()-s),e(null,a))}));return{abort:function(){c.abort()},forceMinPriority:function(e){t=e,c&&c.forceMinPriority(e)}}},t}();function te(t){return"pusherTransport"+(t?"TLS":"NonTLS")}function ee(t){var e=_e.getLocalStorage();if(e)try{delete e[te(t)]}catch(t){}}var ne=function(){function t(t,e){var n=e.delay;this.strategy=t,this.options={delay:n}}return t.prototype.isSupported=function(){return this.strategy.isSupported()},t.prototype.connect=function(t,e){var n,o=this.strategy,r=new I(this.options.delay,(function(){n=o.connect(t,e)}));return{abort:function(){r.ensureAborted(),n&&n.abort()},forceMinPriority:function(e){t=e,n&&n.forceMinPriority(e)}}},t}(),oe=function(){function t(t,e,n){this.test=t,this.trueBranch=e,this.falseBranch=n}return t.prototype.isSupported=function(){return(this.test()?this.trueBranch:this.falseBranch).isSupported()},t.prototype.connect=function(t,e){return(this.test()?this.trueBranch:this.falseBranch).connect(t,e)},t}(),re=function(){function t(t){this.strategy=t}return t.prototype.isSupported=function(){return this.strategy.isSupported()},t.prototype.connect=function(t,e){var n=this.strategy.connect(t,(function(t,o){o&&n.abort(),e(t,o)}));return n},t}();function ie(t){return function(){return t.isSupported()}}var se,ce=function(t,e,n){var o={};function r(e,r,i,s,c){var a=n(t,e,r,i,s,c);return o[e]=a,a}var i,s=Object.assign({},e,{hostNonTLS:t.wsHost+":"+t.wsPort,hostTLS:t.wsHost+":"+t.wssPort,httpPath:t.wsPath}),c=Object.assign({},s,{useTLS:!0}),a=Object.assign({},e,{hostNonTLS:t.httpHost+":"+t.httpPort,hostTLS:t.httpHost+":"+t.httpsPort,httpPath:t.httpPath}),u={loop:!0,timeout:15e3,timeoutLimit:6e4},h=new Vt({lives:2,minPingDelay:1e4,maxPingDelay:t.activityTimeout}),p=new Vt({lives:2,minPingDelay:1e4,maxPingDelay:t.activityTimeout}),l=r("ws","ws",3,s,h),f=r("wss","ws",3,c,h),d=r("sockjs","sockjs",1,a),y=r("xhr_streaming","xhr_streaming",1,a,p),g=r("xdr_streaming","xdr_streaming",1,a,p),v=r("xhr_polling","xhr_polling",1,a),b=r("xdr_polling","xdr_polling",1,a),m=new Yt([l],u),w=new Yt([f],u),_=new Yt([d],u),S=new Yt([new oe(ie(y),y,g)],u),k=new Yt([new oe(ie(v),v,b)],u),C=new Yt([new oe(ie(S),new $t([S,new ne(k,{delay:4e3})]),k)],u),T=new oe(ie(C),C,_);return i=e.useTLS?new $t([m,new ne(T,{delay:2e3})]):new $t([m,new ne(w,{delay:2e3}),new ne(T,{delay:5e3})]),new Zt(new re(new oe(ie(l),i,T)),o,{ttl:18e5,timeline:e.timeline,useTLS:e.useTLS})},ae={getRequest:function(t){var e=new window.XDomainRequest;return e.ontimeout=function(){t.emit("error",new d),t.close()},e.onerror=function(e){t.emit("error",e),t.close()},e.onprogress=function(){e.responseText&&e.responseText.length>0&&t.onChunk(200,e.responseText)},e.onload=function(){e.responseText&&e.responseText.length>0&&t.onChunk(200,e.responseText),t.emit("finished",200),t.close()},e},abortRequest:function(t){t.ontimeout=t.onerror=t.onprogress=t.onload=null,t.abort()}},ue=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),he=function(t){function e(e,n,o){var r=t.call(this)||this;return r.hooks=e,r.method=n,r.url=o,r}return ue(e,t),e.prototype.start=function(t){var e=this;this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=function(){e.close()},_e.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(t)},e.prototype.close=function(){this.unloader&&(_e.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)},e.prototype.onChunk=function(t,e){for(;;){var n=this.advanceBuffer(e);if(!n)break;this.emit("chunk",{status:t,data:n})}this.isBufferTooLong(e)&&this.emit("buffer_too_long")},e.prototype.advanceBuffer=function(t){var e=t.slice(this.position),n=e.indexOf("\n");return-1!==n?(this.position+=n+1,e.slice(0,n)):null},e.prototype.isBufferTooLong=function(t){return this.position===t.length&&t.length>262144},e}(ut);!function(t){t[t.CONNECTING=0]="CONNECTING",t[t.OPEN=1]="OPEN",t[t.CLOSED=3]="CLOSED"}(se||(se={}));var pe=se,le=1;function fe(t){var e=-1===t.indexOf("?")?"?":"&";return t+e+"t="+ +new Date+"&n="+le++}function de(t){return Math.floor(Math.random()*t)}var ye,ge=function(){function t(t,e){this.hooks=t,this.session=de(1e3)+"/"+function(t){for(var e=[],n=0;n0&&t.onChunk(e.status,e.responseText);break;case 4:e.responseText&&e.responseText.length>0&&t.onChunk(e.status,e.responseText),t.emit("finished",e.status),t.close()}},e},abortRequest:function(t){t.onreadystatechange=null,t.abort()}},we={createStreamingSocket:function(t){return this.createSocket(ve,t)},createPollingSocket:function(t){return this.createSocket(be,t)},createSocket:function(t,e){return new ge(t,e)},createXHR:function(t,e){return this.createRequest(me,t,e)},createRequest:function(t,e,n){return new he(t,e,n)},createXDR:function(t,e){return this.createRequest(ae,t,e)}},_e={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:i,DependenciesReceivers:a,getDefaultStrategy:ce,Transports:kt,transportConnectionInitializer:function(){var t=this;t.timeline.info(t.buildTimelineMessage({transport:t.name+(t.options.useTLS?"s":"")})),t.hooks.isInitialized()?t.changeState("initialized"):t.hooks.file?(t.changeState("initializing"),u.load(t.hooks.file,{useTLS:t.options.useTLS},(function(e,n){t.hooks.isInitialized()?(t.changeState("initialized"),n(!0)):(e&&t.onError(e),t.onClose(),n(!1))}))):t.onClose()},HTTPFactory:we,TimelineTransport:et,getXHRAPI:function(){return window.XMLHttpRequest},getWebSocketAPI:function(){return window.WebSocket||window.MozWebSocket},setup:function(t){var e=this;window.Pusher=t;var n=function(){e.onDocumentBody(t.ready)};window.JSON?n():u.load("json2",{},n)},getDocument:function(){return document},getProtocol:function(){return this.getDocument().location.protocol},getAuthorizers:function(){return{ajax:_,jsonp:K}},onDocumentBody:function(t){var e=this;document.body?t():setTimeout((function(){e.onDocumentBody(t)}),0)},createJSONPRequest:function(t,e){return new tt(t,e)},createScriptRequest:function(t){return new Z(t)},getLocalStorage:function(){try{return window.localStorage}catch(t){return}},createXHR:function(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest:function(){return new(this.getXHRAPI())},createMicrosoftXHR:function(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork:function(){return Tt},createWebSocket:function(t){return new(this.getWebSocketAPI())(t)},createSocketRequest:function(t,e){if(this.isXHRSupported())return this.HTTPFactory.createXHR(t,e);if(this.isXDRSupported(0===e.indexOf("https:")))return this.HTTPFactory.createXDR(t,e);throw"Cross-origin HTTP requests are not supported"},isXHRSupported:function(){var t=this.getXHRAPI();return Boolean(t)&&void 0!==(new t).withCredentials},isXDRSupported:function(t){var e=t?"https:":"http:",n=this.getProtocol();return Boolean(window.XDomainRequest)&&n===e},addUnloadListener:function(t){void 0!==window.addEventListener?window.addEventListener("unload",t,!1):void 0!==window.attachEvent&&window.attachEvent("onunload",t)},removeUnloadListener:function(t){void 0!==window.addEventListener?window.removeEventListener("unload",t,!1):void 0!==window.detachEvent&&window.detachEvent("onunload",t)}};!function(t){t[t.ERROR=3]="ERROR",t[t.INFO=6]="INFO",t[t.DEBUG=7]="DEBUG"}(ye||(ye={}));var Se=ye,ke=function(){function t(t,e,n){this.key=t,this.session=e,this.events=[],this.options=n||{},this.sent=0,this.uniqueID=0}return t.prototype.log=function(t,e){t<=this.options.level&&(this.events.push(H({},e,{timestamp:M.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())},t.prototype.error=function(t){this.log(Se.ERROR,t)},t.prototype.info=function(t){this.log(Se.INFO,t)},t.prototype.debug=function(t){this.log(Se.DEBUG,t)},t.prototype.isEmpty=function(){return 0===this.events.length},t.prototype.send=function(t,e){var n=this,o=H({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],t(o,(function(t,o){t||n.sent++,e&&e(t,o)})),!0},t.prototype.generateUniqueID=function(){return this.uniqueID++,this.uniqueID},t}(),Ce=function(){function t(t,e,n,o){this.name=t,this.priority=e,this.transport=n,this.options=o||{}}return t.prototype.isSupported=function(){return this.transport.isSupported({useTLS:this.options.useTLS})},t.prototype.connect=function(t,e){var n=this;if(!this.isSupported())return Te(new m,e);if(this.priority>>18&63),e+=this._encodeByte(r>>>12&63),e+=this._encodeByte(r>>>6&63),e+=this._encodeByte(r>>>0&63)}var o=t.length-n;if(o>0){r=t[n]<<16|(2===o?t[n+1]<<8:0);e+=this._encodeByte(r>>>18&63),e+=this._encodeByte(r>>>12&63),e+=2===o?this._encodeByte(r>>>6&63):this._paddingCharacter||"",e+=this._paddingCharacter||""}return e},t.prototype.maxDecodedLength=function(t){return this._paddingCharacter?t/4*3|0:(6*t+7)/8|0},t.prototype.decodedLength=function(t){return this.maxDecodedLength(t.length-this._getPaddingLength(t))},t.prototype.decode=function(t){if(0===t.length)return new Uint8Array(0);for(var e=this._getPaddingLength(t),n=t.length-e,r=new Uint8Array(this.maxDecodedLength(n)),o=0,i=0,s=0,a=0,c=0,u=0,h=0;i>>4,r[o++]=c<<4|u>>>2,r[o++]=u<<6|h,s|=256&a,s|=256&c,s|=256&u,s|=256&h;if(i>>4,s|=256&a,s|=256&c),i>>2,s|=256&u),i>>8&6,e+=51-t>>>8&-75,e+=61-t>>>8&-15,e+=62-t>>>8&3,String.fromCharCode(e)},t.prototype._decodeChar=function(t){var e=256;return e+=(42-t&t-44)>>>8&-256+t-43+62,e+=(46-t&t-48)>>>8&-256+t-47+63,e+=(47-t&t-58)>>>8&-256+t-48+52,e+=(64-t&t-91)>>>8&-256+t-65+0,e+=(96-t&t-123)>>>8&-256+t-97+26},t.prototype._getPaddingLength=function(t){var e=0;if(this._paddingCharacter){for(var n=t.length-1;n>=0&&t[n]===this._paddingCharacter;n--)e++;if(t.length<4||e>2)throw new Error("Base64Coder: incorrect padding")}return e},t}();e.Coder=i;var s=new i;e.encode=function(t){return s.encode(t)},e.decode=function(t){return s.decode(t)};var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype._encodeByte=function(t){var e=t;return e+=65,e+=25-t>>>8&6,e+=51-t>>>8&-75,e+=61-t>>>8&-13,e+=62-t>>>8&49,String.fromCharCode(e)},e.prototype._decodeChar=function(t){var e=256;return e+=(44-t&t-46)>>>8&-256+t-45+62,e+=(94-t&t-96)>>>8&-256+t-95+63,e+=(47-t&t-58)>>>8&-256+t-48+52,e+=(64-t&t-91)>>>8&-256+t-65+0,e+=(96-t&t-123)>>>8&-256+t-97+26},e}(i);e.URLSafeCoder=a;var c=new a;e.encodeURLSafe=function(t){return c.encode(t)},e.decodeURLSafe=function(t){return c.decode(t)},e.encodedLength=function(t){return s.encodedLength(t)},e.maxDecodedLength=function(t){return s.maxDecodedLength(t)},e.decodedLength=function(t){return s.decodedLength(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r="utf8: invalid source encoding";function o(t){for(var e=0,n=0;n=t.length-1)throw new Error("utf8: invalid string");n++,e+=4}}return e}e.encode=function(t){for(var e=new Uint8Array(o(t)),n=0,r=0;r>6,e[n++]=128|63&i):i<55296?(e[n++]=224|i>>12,e[n++]=128|i>>6&63,e[n++]=128|63&i):(r++,i=(1023&i)<<10,i|=1023&t.charCodeAt(r),i+=65536,e[n++]=240|i>>18,e[n++]=128|i>>12&63,e[n++]=128|i>>6&63,e[n++]=128|63&i)}return e},e.encodedLength=o,e.decode=function(t){for(var e=[],n=0;n=t.length)throw new Error(r);if(128!=(192&(s=t[++n])))throw new Error(r);o=(31&o)<<6|63&s,i=128}else if(o<240){if(n>=t.length-1)throw new Error(r);var s=t[++n],a=t[++n];if(128!=(192&s)||128!=(192&a))throw new Error(r);o=(15&o)<<12|(63&s)<<6|63&a,i=2048}else{if(!(o<248))throw new Error(r);if(n>=t.length-2)throw new Error(r);s=t[++n],a=t[++n];var c=t[++n];if(128!=(192&s)||128!=(192&a)||128!=(192&c))throw new Error(r);o=(15&o)<<18|(63&s)<<12|(63&a)<<6|63&c,i=65536}if(o=55296&&o<=57343)throw new Error(r);if(o>=65536){if(o>1114111)throw new Error(r);o-=65536,e.push(String.fromCharCode(55296|o>>10)),o=56320|1023&o}}e.push(String.fromCharCode(o))}return e.join("")}},function(t,e,n){!function(t){"use strict";var e=function(t){var e,n=new Float64Array(16);if(t)for(e=0;e>24&255,t[e+1]=n>>16&255,t[e+2]=n>>8&255,t[e+3]=255&n,t[e+4]=r>>24&255,t[e+5]=r>>16&255,t[e+6]=r>>8&255,t[e+7]=255&r}function y(t,e,n,r,o){var i,s=0;for(i=0;i>>8)-1}function g(t,e,n,r){return y(t,e,n,r,16)}function v(t,e,n,r){return y(t,e,n,r,32)}function b(t,e,n,r){!function(t,e,n,r){for(var o,i=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,c=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,u=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,h=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,f=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,p=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,l=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,d=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,y=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,g=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,v=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,b=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,m=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,_=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,w=i,S=s,k=a,C=c,T=u,O=h,P=f,A=p,E=l,x=d,L=y,U=g,M=v,R=b,j=m,I=_,N=0;N<20;N+=2)w^=(o=(M^=(o=(E^=(o=(T^=(o=w+M|0)<<7|o>>>25)+w|0)<<9|o>>>23)+T|0)<<13|o>>>19)+E|0)<<18|o>>>14,O^=(o=(S^=(o=(R^=(o=(x^=(o=O+S|0)<<7|o>>>25)+O|0)<<9|o>>>23)+x|0)<<13|o>>>19)+R|0)<<18|o>>>14,L^=(o=(P^=(o=(k^=(o=(j^=(o=L+P|0)<<7|o>>>25)+L|0)<<9|o>>>23)+j|0)<<13|o>>>19)+k|0)<<18|o>>>14,I^=(o=(U^=(o=(A^=(o=(C^=(o=I+U|0)<<7|o>>>25)+I|0)<<9|o>>>23)+C|0)<<13|o>>>19)+A|0)<<18|o>>>14,w^=(o=(C^=(o=(k^=(o=(S^=(o=w+C|0)<<7|o>>>25)+w|0)<<9|o>>>23)+S|0)<<13|o>>>19)+k|0)<<18|o>>>14,O^=(o=(T^=(o=(A^=(o=(P^=(o=O+T|0)<<7|o>>>25)+O|0)<<9|o>>>23)+P|0)<<13|o>>>19)+A|0)<<18|o>>>14,L^=(o=(x^=(o=(E^=(o=(U^=(o=L+x|0)<<7|o>>>25)+L|0)<<9|o>>>23)+U|0)<<13|o>>>19)+E|0)<<18|o>>>14,I^=(o=(j^=(o=(R^=(o=(M^=(o=I+j|0)<<7|o>>>25)+I|0)<<9|o>>>23)+M|0)<<13|o>>>19)+R|0)<<18|o>>>14;w=w+i|0,S=S+s|0,k=k+a|0,C=C+c|0,T=T+u|0,O=O+h|0,P=P+f|0,A=A+p|0,E=E+l|0,x=x+d|0,L=L+y|0,U=U+g|0,M=M+v|0,R=R+b|0,j=j+m|0,I=I+_|0,t[0]=w>>>0&255,t[1]=w>>>8&255,t[2]=w>>>16&255,t[3]=w>>>24&255,t[4]=S>>>0&255,t[5]=S>>>8&255,t[6]=S>>>16&255,t[7]=S>>>24&255,t[8]=k>>>0&255,t[9]=k>>>8&255,t[10]=k>>>16&255,t[11]=k>>>24&255,t[12]=C>>>0&255,t[13]=C>>>8&255,t[14]=C>>>16&255,t[15]=C>>>24&255,t[16]=T>>>0&255,t[17]=T>>>8&255,t[18]=T>>>16&255,t[19]=T>>>24&255,t[20]=O>>>0&255,t[21]=O>>>8&255,t[22]=O>>>16&255,t[23]=O>>>24&255,t[24]=P>>>0&255,t[25]=P>>>8&255,t[26]=P>>>16&255,t[27]=P>>>24&255,t[28]=A>>>0&255,t[29]=A>>>8&255,t[30]=A>>>16&255,t[31]=A>>>24&255,t[32]=E>>>0&255,t[33]=E>>>8&255,t[34]=E>>>16&255,t[35]=E>>>24&255,t[36]=x>>>0&255,t[37]=x>>>8&255,t[38]=x>>>16&255,t[39]=x>>>24&255,t[40]=L>>>0&255,t[41]=L>>>8&255,t[42]=L>>>16&255,t[43]=L>>>24&255,t[44]=U>>>0&255,t[45]=U>>>8&255,t[46]=U>>>16&255,t[47]=U>>>24&255,t[48]=M>>>0&255,t[49]=M>>>8&255,t[50]=M>>>16&255,t[51]=M>>>24&255,t[52]=R>>>0&255,t[53]=R>>>8&255,t[54]=R>>>16&255,t[55]=R>>>24&255,t[56]=j>>>0&255,t[57]=j>>>8&255,t[58]=j>>>16&255,t[59]=j>>>24&255,t[60]=I>>>0&255,t[61]=I>>>8&255,t[62]=I>>>16&255,t[63]=I>>>24&255}(t,e,n,r)}function m(t,e,n,r){!function(t,e,n,r){for(var o,i=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,c=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,u=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,h=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,f=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,p=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,l=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,d=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,y=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,g=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,v=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,b=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,m=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,_=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,w=0;w<20;w+=2)i^=(o=(v^=(o=(l^=(o=(u^=(o=i+v|0)<<7|o>>>25)+i|0)<<9|o>>>23)+u|0)<<13|o>>>19)+l|0)<<18|o>>>14,h^=(o=(s^=(o=(b^=(o=(d^=(o=h+s|0)<<7|o>>>25)+h|0)<<9|o>>>23)+d|0)<<13|o>>>19)+b|0)<<18|o>>>14,y^=(o=(f^=(o=(a^=(o=(m^=(o=y+f|0)<<7|o>>>25)+y|0)<<9|o>>>23)+m|0)<<13|o>>>19)+a|0)<<18|o>>>14,_^=(o=(g^=(o=(p^=(o=(c^=(o=_+g|0)<<7|o>>>25)+_|0)<<9|o>>>23)+c|0)<<13|o>>>19)+p|0)<<18|o>>>14,i^=(o=(c^=(o=(a^=(o=(s^=(o=i+c|0)<<7|o>>>25)+i|0)<<9|o>>>23)+s|0)<<13|o>>>19)+a|0)<<18|o>>>14,h^=(o=(u^=(o=(p^=(o=(f^=(o=h+u|0)<<7|o>>>25)+h|0)<<9|o>>>23)+f|0)<<13|o>>>19)+p|0)<<18|o>>>14,y^=(o=(d^=(o=(l^=(o=(g^=(o=y+d|0)<<7|o>>>25)+y|0)<<9|o>>>23)+g|0)<<13|o>>>19)+l|0)<<18|o>>>14,_^=(o=(m^=(o=(b^=(o=(v^=(o=_+m|0)<<7|o>>>25)+_|0)<<9|o>>>23)+v|0)<<13|o>>>19)+b|0)<<18|o>>>14;t[0]=i>>>0&255,t[1]=i>>>8&255,t[2]=i>>>16&255,t[3]=i>>>24&255,t[4]=h>>>0&255,t[5]=h>>>8&255,t[6]=h>>>16&255,t[7]=h>>>24&255,t[8]=y>>>0&255,t[9]=y>>>8&255,t[10]=y>>>16&255,t[11]=y>>>24&255,t[12]=_>>>0&255,t[13]=_>>>8&255,t[14]=_>>>16&255,t[15]=_>>>24&255,t[16]=f>>>0&255,t[17]=f>>>8&255,t[18]=f>>>16&255,t[19]=f>>>24&255,t[20]=p>>>0&255,t[21]=p>>>8&255,t[22]=p>>>16&255,t[23]=p>>>24&255,t[24]=l>>>0&255,t[25]=l>>>8&255,t[26]=l>>>16&255,t[27]=l>>>24&255,t[28]=d>>>0&255,t[29]=d>>>8&255,t[30]=d>>>16&255,t[31]=d>>>24&255}(t,e,n,r)}var _=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function w(t,e,n,r,o,i,s){var a,c,u=new Uint8Array(16),h=new Uint8Array(64);for(c=0;c<16;c++)u[c]=0;for(c=0;c<8;c++)u[c]=i[c];for(;o>=64;){for(b(h,u,s,_),c=0;c<64;c++)t[e+c]=n[r+c]^h[c];for(a=1,c=8;c<16;c++)a=a+(255&u[c])|0,u[c]=255&a,a>>>=8;o-=64,e+=64,r+=64}if(o>0)for(b(h,u,s,_),c=0;c=64;){for(b(c,a,o,_),s=0;s<64;s++)t[e+s]=c[s];for(i=1,s=8;s<16;s++)i=i+(255&a[s])|0,a[s]=255&i,i>>>=8;n-=64,e+=64}if(n>0)for(b(c,a,o,_),s=0;s>>13|n<<3),r=255&t[4]|(255&t[5])<<8,this.r[2]=7939&(n>>>10|r<<6),o=255&t[6]|(255&t[7])<<8,this.r[3]=8191&(r>>>7|o<<9),i=255&t[8]|(255&t[9])<<8,this.r[4]=255&(o>>>4|i<<12),this.r[5]=i>>>1&8190,s=255&t[10]|(255&t[11])<<8,this.r[6]=8191&(i>>>14|s<<2),a=255&t[12]|(255&t[13])<<8,this.r[7]=8065&(s>>>11|a<<5),c=255&t[14]|(255&t[15])<<8,this.r[8]=8191&(a>>>8|c<<8),this.r[9]=c>>>5&127,this.pad[0]=255&t[16]|(255&t[17])<<8,this.pad[1]=255&t[18]|(255&t[19])<<8,this.pad[2]=255&t[20]|(255&t[21])<<8,this.pad[3]=255&t[22]|(255&t[23])<<8,this.pad[4]=255&t[24]|(255&t[25])<<8,this.pad[5]=255&t[26]|(255&t[27])<<8,this.pad[6]=255&t[28]|(255&t[29])<<8,this.pad[7]=255&t[30]|(255&t[31])<<8};function O(t,e,n,r,o,i){var s=new T(i);return s.update(n,r,o),s.finish(t,e),0}function P(t,e,n,r,o,i){var s=new Uint8Array(16);return O(s,0,n,r,o,i),g(t,e,s,0)}function A(t,e,n,r,o){var i;if(n<32)return-1;for(C(t,0,e,0,n,r,o),O(t,16,t,32,n-32,t),i=0;i<16;i++)t[i]=0;return 0}function E(t,e,n,r,o){var i,s=new Uint8Array(32);if(n<32)return-1;if(k(s,0,32,r,o),0!==P(e,16,e,32,n-32,s))return-1;for(C(t,0,e,0,n,r,o),i=0;i<32;i++)t[i]=0;return 0}function x(t,e){var n;for(n=0;n<16;n++)t[n]=0|e[n]}function L(t){var e,n,r=1;for(e=0;e<16;e++)n=t[e]+r+65535,r=Math.floor(n/65536),t[e]=n-65536*r;t[0]+=r-1+37*(r-1)}function U(t,e,n){for(var r,o=~(n-1),i=0;i<16;i++)r=o&(t[i]^e[i]),t[i]^=r,e[i]^=r}function M(t,n){var r,o,i,s=e(),a=e();for(r=0;r<16;r++)a[r]=n[r];for(L(a),L(a),L(a),o=0;o<2;o++){for(s[0]=a[0]-65517,r=1;r<15;r++)s[r]=a[r]-65535-(s[r-1]>>16&1),s[r-1]&=65535;s[15]=a[15]-32767-(s[14]>>16&1),i=s[15]>>16&1,s[14]&=65535,U(a,s,1-i)}for(r=0;r<16;r++)t[2*r]=255&a[r],t[2*r+1]=a[r]>>8}function R(t,e){var n=new Uint8Array(32),r=new Uint8Array(32);return M(n,t),M(r,e),v(n,0,r,0)}function j(t){var e=new Uint8Array(32);return M(e,t),1&e[0]}function I(t,e){var n;for(n=0;n<16;n++)t[n]=e[2*n]+(e[2*n+1]<<8);t[15]&=32767}function N(t,e,n){for(var r=0;r<16;r++)t[r]=e[r]+n[r]}function B(t,e,n){for(var r=0;r<16;r++)t[r]=e[r]-n[r]}function D(t,e,n){var r,o,i=0,s=0,a=0,c=0,u=0,h=0,f=0,p=0,l=0,d=0,y=0,g=0,v=0,b=0,m=0,_=0,w=0,S=0,k=0,C=0,T=0,O=0,P=0,A=0,E=0,x=0,L=0,U=0,M=0,R=0,j=0,I=n[0],N=n[1],B=n[2],D=n[3],H=n[4],z=n[5],F=n[6],q=n[7],Y=n[8],K=n[9],J=n[10],W=n[11],X=n[12],G=n[13],V=n[14],Z=n[15];i+=(r=e[0])*I,s+=r*N,a+=r*B,c+=r*D,u+=r*H,h+=r*z,f+=r*F,p+=r*q,l+=r*Y,d+=r*K,y+=r*J,g+=r*W,v+=r*X,b+=r*G,m+=r*V,_+=r*Z,s+=(r=e[1])*I,a+=r*N,c+=r*B,u+=r*D,h+=r*H,f+=r*z,p+=r*F,l+=r*q,d+=r*Y,y+=r*K,g+=r*J,v+=r*W,b+=r*X,m+=r*G,_+=r*V,w+=r*Z,a+=(r=e[2])*I,c+=r*N,u+=r*B,h+=r*D,f+=r*H,p+=r*z,l+=r*F,d+=r*q,y+=r*Y,g+=r*K,v+=r*J,b+=r*W,m+=r*X,_+=r*G,w+=r*V,S+=r*Z,c+=(r=e[3])*I,u+=r*N,h+=r*B,f+=r*D,p+=r*H,l+=r*z,d+=r*F,y+=r*q,g+=r*Y,v+=r*K,b+=r*J,m+=r*W,_+=r*X,w+=r*G,S+=r*V,k+=r*Z,u+=(r=e[4])*I,h+=r*N,f+=r*B,p+=r*D,l+=r*H,d+=r*z,y+=r*F,g+=r*q,v+=r*Y,b+=r*K,m+=r*J,_+=r*W,w+=r*X,S+=r*G,k+=r*V,C+=r*Z,h+=(r=e[5])*I,f+=r*N,p+=r*B,l+=r*D,d+=r*H,y+=r*z,g+=r*F,v+=r*q,b+=r*Y,m+=r*K,_+=r*J,w+=r*W,S+=r*X,k+=r*G,C+=r*V,T+=r*Z,f+=(r=e[6])*I,p+=r*N,l+=r*B,d+=r*D,y+=r*H,g+=r*z,v+=r*F,b+=r*q,m+=r*Y,_+=r*K,w+=r*J,S+=r*W,k+=r*X,C+=r*G,T+=r*V,O+=r*Z,p+=(r=e[7])*I,l+=r*N,d+=r*B,y+=r*D,g+=r*H,v+=r*z,b+=r*F,m+=r*q,_+=r*Y,w+=r*K,S+=r*J,k+=r*W,C+=r*X,T+=r*G,O+=r*V,P+=r*Z,l+=(r=e[8])*I,d+=r*N,y+=r*B,g+=r*D,v+=r*H,b+=r*z,m+=r*F,_+=r*q,w+=r*Y,S+=r*K,k+=r*J,C+=r*W,T+=r*X,O+=r*G,P+=r*V,A+=r*Z,d+=(r=e[9])*I,y+=r*N,g+=r*B,v+=r*D,b+=r*H,m+=r*z,_+=r*F,w+=r*q,S+=r*Y,k+=r*K,C+=r*J,T+=r*W,O+=r*X,P+=r*G,A+=r*V,E+=r*Z,y+=(r=e[10])*I,g+=r*N,v+=r*B,b+=r*D,m+=r*H,_+=r*z,w+=r*F,S+=r*q,k+=r*Y,C+=r*K,T+=r*J,O+=r*W,P+=r*X,A+=r*G,E+=r*V,x+=r*Z,g+=(r=e[11])*I,v+=r*N,b+=r*B,m+=r*D,_+=r*H,w+=r*z,S+=r*F,k+=r*q,C+=r*Y,T+=r*K,O+=r*J,P+=r*W,A+=r*X,E+=r*G,x+=r*V,L+=r*Z,v+=(r=e[12])*I,b+=r*N,m+=r*B,_+=r*D,w+=r*H,S+=r*z,k+=r*F,C+=r*q,T+=r*Y,O+=r*K,P+=r*J,A+=r*W,E+=r*X,x+=r*G,L+=r*V,U+=r*Z,b+=(r=e[13])*I,m+=r*N,_+=r*B,w+=r*D,S+=r*H,k+=r*z,C+=r*F,T+=r*q,O+=r*Y,P+=r*K,A+=r*J,E+=r*W,x+=r*X,L+=r*G,U+=r*V,M+=r*Z,m+=(r=e[14])*I,_+=r*N,w+=r*B,S+=r*D,k+=r*H,C+=r*z,T+=r*F,O+=r*q,P+=r*Y,A+=r*K,E+=r*J,x+=r*W,L+=r*X,U+=r*G,M+=r*V,R+=r*Z,_+=(r=e[15])*I,s+=38*(S+=r*B),a+=38*(k+=r*D),c+=38*(C+=r*H),u+=38*(T+=r*z),h+=38*(O+=r*F),f+=38*(P+=r*q),p+=38*(A+=r*Y),l+=38*(E+=r*K),d+=38*(x+=r*J),y+=38*(L+=r*W),g+=38*(U+=r*X),v+=38*(M+=r*G),b+=38*(R+=r*V),m+=38*(j+=r*Z),i=(r=(i+=38*(w+=r*N))+(o=1)+65535)-65536*(o=Math.floor(r/65536)),s=(r=s+o+65535)-65536*(o=Math.floor(r/65536)),a=(r=a+o+65535)-65536*(o=Math.floor(r/65536)),c=(r=c+o+65535)-65536*(o=Math.floor(r/65536)),u=(r=u+o+65535)-65536*(o=Math.floor(r/65536)),h=(r=h+o+65535)-65536*(o=Math.floor(r/65536)),f=(r=f+o+65535)-65536*(o=Math.floor(r/65536)),p=(r=p+o+65535)-65536*(o=Math.floor(r/65536)),l=(r=l+o+65535)-65536*(o=Math.floor(r/65536)),d=(r=d+o+65535)-65536*(o=Math.floor(r/65536)),y=(r=y+o+65535)-65536*(o=Math.floor(r/65536)),g=(r=g+o+65535)-65536*(o=Math.floor(r/65536)),v=(r=v+o+65535)-65536*(o=Math.floor(r/65536)),b=(r=b+o+65535)-65536*(o=Math.floor(r/65536)),m=(r=m+o+65535)-65536*(o=Math.floor(r/65536)),_=(r=_+o+65535)-65536*(o=Math.floor(r/65536)),i=(r=(i+=o-1+37*(o-1))+(o=1)+65535)-65536*(o=Math.floor(r/65536)),s=(r=s+o+65535)-65536*(o=Math.floor(r/65536)),a=(r=a+o+65535)-65536*(o=Math.floor(r/65536)),c=(r=c+o+65535)-65536*(o=Math.floor(r/65536)),u=(r=u+o+65535)-65536*(o=Math.floor(r/65536)),h=(r=h+o+65535)-65536*(o=Math.floor(r/65536)),f=(r=f+o+65535)-65536*(o=Math.floor(r/65536)),p=(r=p+o+65535)-65536*(o=Math.floor(r/65536)),l=(r=l+o+65535)-65536*(o=Math.floor(r/65536)),d=(r=d+o+65535)-65536*(o=Math.floor(r/65536)),y=(r=y+o+65535)-65536*(o=Math.floor(r/65536)),g=(r=g+o+65535)-65536*(o=Math.floor(r/65536)),v=(r=v+o+65535)-65536*(o=Math.floor(r/65536)),b=(r=b+o+65535)-65536*(o=Math.floor(r/65536)),m=(r=m+o+65535)-65536*(o=Math.floor(r/65536)),_=(r=_+o+65535)-65536*(o=Math.floor(r/65536)),i+=o-1+37*(o-1),t[0]=i,t[1]=s,t[2]=a,t[3]=c,t[4]=u,t[5]=h,t[6]=f,t[7]=p,t[8]=l,t[9]=d,t[10]=y,t[11]=g,t[12]=v,t[13]=b,t[14]=m,t[15]=_}function H(t,e){D(t,e,e)}function z(t,n){var r,o=e();for(r=0;r<16;r++)o[r]=n[r];for(r=253;r>=0;r--)H(o,o),2!==r&&4!==r&&D(o,o,n);for(r=0;r<16;r++)t[r]=o[r]}function F(t,n){var r,o=e();for(r=0;r<16;r++)o[r]=n[r];for(r=250;r>=0;r--)H(o,o),1!==r&&D(o,o,n);for(r=0;r<16;r++)t[r]=o[r]}function q(t,n,r){var o,i,s=new Uint8Array(32),a=new Float64Array(80),u=e(),h=e(),f=e(),p=e(),l=e(),d=e();for(i=0;i<31;i++)s[i]=n[i];for(s[31]=127&n[31]|64,s[0]&=248,I(a,r),i=0;i<16;i++)h[i]=a[i],p[i]=u[i]=f[i]=0;for(u[0]=p[0]=1,i=254;i>=0;--i)U(u,h,o=s[i>>>3]>>>(7&i)&1),U(f,p,o),N(l,u,f),B(u,u,f),N(f,h,p),B(h,h,p),H(p,l),H(d,u),D(u,f,u),D(f,h,l),N(l,u,f),B(u,u,f),H(h,u),B(f,p,d),D(u,f,c),N(u,u,p),D(f,f,u),D(u,p,d),D(p,h,a),H(h,l),U(u,h,o),U(f,p,o);for(i=0;i<16;i++)a[i+16]=u[i],a[i+32]=f[i],a[i+48]=h[i],a[i+64]=p[i];var y=a.subarray(32),g=a.subarray(16);return z(y,y),D(g,g,y),M(t,g),0}function Y(t,e){return q(t,e,i)}function K(t,e){return r(e,32),Y(t,e)}function J(t,e,n){var r=new Uint8Array(32);return q(r,n,e),m(t,o,r,_)}T.prototype.blocks=function(t,e,n){for(var r,o,i,s,a,c,u,h,f,p,l,d,y,g,v,b,m,_,w,S=this.fin?0:2048,k=this.h[0],C=this.h[1],T=this.h[2],O=this.h[3],P=this.h[4],A=this.h[5],E=this.h[6],x=this.h[7],L=this.h[8],U=this.h[9],M=this.r[0],R=this.r[1],j=this.r[2],I=this.r[3],N=this.r[4],B=this.r[5],D=this.r[6],H=this.r[7],z=this.r[8],F=this.r[9];n>=16;)p=f=0,p+=(k+=8191&(r=255&t[e+0]|(255&t[e+1])<<8))*M,p+=(C+=8191&(r>>>13|(o=255&t[e+2]|(255&t[e+3])<<8)<<3))*(5*F),p+=(T+=8191&(o>>>10|(i=255&t[e+4]|(255&t[e+5])<<8)<<6))*(5*z),p+=(O+=8191&(i>>>7|(s=255&t[e+6]|(255&t[e+7])<<8)<<9))*(5*H),f=(p+=(P+=8191&(s>>>4|(a=255&t[e+8]|(255&t[e+9])<<8)<<12))*(5*D))>>>13,p&=8191,p+=(A+=a>>>1&8191)*(5*B),p+=(E+=8191&(a>>>14|(c=255&t[e+10]|(255&t[e+11])<<8)<<2))*(5*N),p+=(x+=8191&(c>>>11|(u=255&t[e+12]|(255&t[e+13])<<8)<<5))*(5*I),p+=(L+=8191&(u>>>8|(h=255&t[e+14]|(255&t[e+15])<<8)<<8))*(5*j),l=f+=(p+=(U+=h>>>5|S)*(5*R))>>>13,l+=k*R,l+=C*M,l+=T*(5*F),l+=O*(5*z),f=(l+=P*(5*H))>>>13,l&=8191,l+=A*(5*D),l+=E*(5*B),l+=x*(5*N),l+=L*(5*I),f+=(l+=U*(5*j))>>>13,l&=8191,d=f,d+=k*j,d+=C*R,d+=T*M,d+=O*(5*F),f=(d+=P*(5*z))>>>13,d&=8191,d+=A*(5*H),d+=E*(5*D),d+=x*(5*B),d+=L*(5*N),y=f+=(d+=U*(5*I))>>>13,y+=k*I,y+=C*j,y+=T*R,y+=O*M,f=(y+=P*(5*F))>>>13,y&=8191,y+=A*(5*z),y+=E*(5*H),y+=x*(5*D),y+=L*(5*B),g=f+=(y+=U*(5*N))>>>13,g+=k*N,g+=C*I,g+=T*j,g+=O*R,f=(g+=P*M)>>>13,g&=8191,g+=A*(5*F),g+=E*(5*z),g+=x*(5*H),g+=L*(5*D),v=f+=(g+=U*(5*B))>>>13,v+=k*B,v+=C*N,v+=T*I,v+=O*j,f=(v+=P*R)>>>13,v&=8191,v+=A*M,v+=E*(5*F),v+=x*(5*z),v+=L*(5*H),b=f+=(v+=U*(5*D))>>>13,b+=k*D,b+=C*B,b+=T*N,b+=O*I,f=(b+=P*j)>>>13,b&=8191,b+=A*R,b+=E*M,b+=x*(5*F),b+=L*(5*z),m=f+=(b+=U*(5*H))>>>13,m+=k*H,m+=C*D,m+=T*B,m+=O*N,f=(m+=P*I)>>>13,m&=8191,m+=A*j,m+=E*R,m+=x*M,m+=L*(5*F),_=f+=(m+=U*(5*z))>>>13,_+=k*z,_+=C*H,_+=T*D,_+=O*B,f=(_+=P*N)>>>13,_&=8191,_+=A*I,_+=E*j,_+=x*R,_+=L*M,w=f+=(_+=U*(5*F))>>>13,w+=k*F,w+=C*z,w+=T*H,w+=O*D,f=(w+=P*B)>>>13,w&=8191,w+=A*N,w+=E*I,w+=x*j,w+=L*R,k=p=8191&(f=(f=((f+=(w+=U*M)>>>13)<<2)+f|0)+(p&=8191)|0),C=l+=f>>>=13,T=d&=8191,O=y&=8191,P=g&=8191,A=v&=8191,E=b&=8191,x=m&=8191,L=_&=8191,U=w&=8191,e+=16,n-=16;this.h[0]=k,this.h[1]=C,this.h[2]=T,this.h[3]=O,this.h[4]=P,this.h[5]=A,this.h[6]=E,this.h[7]=x,this.h[8]=L,this.h[9]=U},T.prototype.finish=function(t,e){var n,r,o,i,s=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;i<16;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(n=this.h[1]>>>13,this.h[1]&=8191,i=2;i<10;i++)this.h[i]+=n,n=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*n,n=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=n,n=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=n,s[0]=this.h[0]+5,n=s[0]>>>13,s[0]&=8191,i=1;i<10;i++)s[i]=this.h[i]+n,n=s[i]>>>13,s[i]&=8191;for(s[9]-=8192,r=(1^n)-1,i=0;i<10;i++)s[i]&=r;for(r=~r,i=0;i<10;i++)this.h[i]=this.h[i]&r|s[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),o=this.h[0]+this.pad[0],this.h[0]=65535&o,i=1;i<8;i++)o=(this.h[i]+this.pad[i]|0)+(o>>>16)|0,this.h[i]=65535&o;t[e+0]=this.h[0]>>>0&255,t[e+1]=this.h[0]>>>8&255,t[e+2]=this.h[1]>>>0&255,t[e+3]=this.h[1]>>>8&255,t[e+4]=this.h[2]>>>0&255,t[e+5]=this.h[2]>>>8&255,t[e+6]=this.h[3]>>>0&255,t[e+7]=this.h[3]>>>8&255,t[e+8]=this.h[4]>>>0&255,t[e+9]=this.h[4]>>>8&255,t[e+10]=this.h[5]>>>0&255,t[e+11]=this.h[5]>>>8&255,t[e+12]=this.h[6]>>>0&255,t[e+13]=this.h[6]>>>8&255,t[e+14]=this.h[7]>>>0&255,t[e+15]=this.h[7]>>>8&255},T.prototype.update=function(t,e,n){var r,o;if(this.leftover){for((o=16-this.leftover)>n&&(o=n),r=0;r=16&&(o=n-n%16,this.blocks(t,e,o),e+=o,n-=o),n){for(r=0;r=128;){for(S=0;S<16;S++)k=8*S+X,x[S]=n[k+0]<<24|n[k+1]<<16|n[k+2]<<8|n[k+3],L[S]=n[k+4]<<24|n[k+5]<<16|n[k+6]<<8|n[k+7];for(S=0;S<80;S++)if(o=U,i=M,s=R,a=j,c=I,u=N,h=B,D,p=H,l=z,d=F,y=q,g=Y,v=K,b=J,W,O=65535&(T=W),P=T>>>16,A=65535&(C=D),E=C>>>16,O+=65535&(T=(Y>>>14|I<<18)^(Y>>>18|I<<14)^(I>>>9|Y<<23)),P+=T>>>16,A+=65535&(C=(I>>>14|Y<<18)^(I>>>18|Y<<14)^(Y>>>9|I<<23)),E+=C>>>16,O+=65535&(T=Y&K^~Y&J),P+=T>>>16,A+=65535&(C=I&N^~I&B),E+=C>>>16,O+=65535&(T=G[2*S+1]),P+=T>>>16,A+=65535&(C=G[2*S]),E+=C>>>16,C=x[S%16],P+=(T=L[S%16])>>>16,A+=65535&C,E+=C>>>16,A+=(P+=(O+=65535&T)>>>16)>>>16,O=65535&(T=w=65535&O|P<<16),P=T>>>16,A=65535&(C=_=65535&A|(E+=A>>>16)<<16),E=C>>>16,O+=65535&(T=(H>>>28|U<<4)^(U>>>2|H<<30)^(U>>>7|H<<25)),P+=T>>>16,A+=65535&(C=(U>>>28|H<<4)^(H>>>2|U<<30)^(H>>>7|U<<25)),E+=C>>>16,P+=(T=H&z^H&F^z&F)>>>16,A+=65535&(C=U&M^U&R^M&R),E+=C>>>16,f=65535&(A+=(P+=(O+=65535&T)>>>16)>>>16)|(E+=A>>>16)<<16,m=65535&O|P<<16,O=65535&(T=y),P=T>>>16,A=65535&(C=a),E=C>>>16,P+=(T=w)>>>16,A+=65535&(C=_),E+=C>>>16,M=o,R=i,j=s,I=a=65535&(A+=(P+=(O+=65535&T)>>>16)>>>16)|(E+=A>>>16)<<16,N=c,B=u,D=h,U=f,z=p,F=l,q=d,Y=y=65535&O|P<<16,K=g,J=v,W=b,H=m,S%16==15)for(k=0;k<16;k++)C=x[k],O=65535&(T=L[k]),P=T>>>16,A=65535&C,E=C>>>16,C=x[(k+9)%16],O+=65535&(T=L[(k+9)%16]),P+=T>>>16,A+=65535&C,E+=C>>>16,_=x[(k+1)%16],O+=65535&(T=((w=L[(k+1)%16])>>>1|_<<31)^(w>>>8|_<<24)^(w>>>7|_<<25)),P+=T>>>16,A+=65535&(C=(_>>>1|w<<31)^(_>>>8|w<<24)^_>>>7),E+=C>>>16,_=x[(k+14)%16],P+=(T=((w=L[(k+14)%16])>>>19|_<<13)^(_>>>29|w<<3)^(w>>>6|_<<26))>>>16,A+=65535&(C=(_>>>19|w<<13)^(w>>>29|_<<3)^_>>>6),E+=C>>>16,E+=(A+=(P+=(O+=65535&T)>>>16)>>>16)>>>16,x[k]=65535&A|E<<16,L[k]=65535&O|P<<16;O=65535&(T=H),P=T>>>16,A=65535&(C=U),E=C>>>16,C=t[0],P+=(T=e[0])>>>16,A+=65535&C,E+=C>>>16,E+=(A+=(P+=(O+=65535&T)>>>16)>>>16)>>>16,t[0]=U=65535&A|E<<16,e[0]=H=65535&O|P<<16,O=65535&(T=z),P=T>>>16,A=65535&(C=M),E=C>>>16,C=t[1],P+=(T=e[1])>>>16,A+=65535&C,E+=C>>>16,E+=(A+=(P+=(O+=65535&T)>>>16)>>>16)>>>16,t[1]=M=65535&A|E<<16,e[1]=z=65535&O|P<<16,O=65535&(T=F),P=T>>>16,A=65535&(C=R),E=C>>>16,C=t[2],P+=(T=e[2])>>>16,A+=65535&C,E+=C>>>16,E+=(A+=(P+=(O+=65535&T)>>>16)>>>16)>>>16,t[2]=R=65535&A|E<<16,e[2]=F=65535&O|P<<16,O=65535&(T=q),P=T>>>16,A=65535&(C=j),E=C>>>16,C=t[3],P+=(T=e[3])>>>16,A+=65535&C,E+=C>>>16,E+=(A+=(P+=(O+=65535&T)>>>16)>>>16)>>>16,t[3]=j=65535&A|E<<16,e[3]=q=65535&O|P<<16,O=65535&(T=Y),P=T>>>16,A=65535&(C=I),E=C>>>16,C=t[4],P+=(T=e[4])>>>16,A+=65535&C,E+=C>>>16,E+=(A+=(P+=(O+=65535&T)>>>16)>>>16)>>>16,t[4]=I=65535&A|E<<16,e[4]=Y=65535&O|P<<16,O=65535&(T=K),P=T>>>16,A=65535&(C=N),E=C>>>16,C=t[5],P+=(T=e[5])>>>16,A+=65535&C,E+=C>>>16,E+=(A+=(P+=(O+=65535&T)>>>16)>>>16)>>>16,t[5]=N=65535&A|E<<16,e[5]=K=65535&O|P<<16,O=65535&(T=J),P=T>>>16,A=65535&(C=B),E=C>>>16,C=t[6],P+=(T=e[6])>>>16,A+=65535&C,E+=C>>>16,E+=(A+=(P+=(O+=65535&T)>>>16)>>>16)>>>16,t[6]=B=65535&A|E<<16,e[6]=J=65535&O|P<<16,O=65535&(T=W),P=T>>>16,A=65535&(C=D),E=C>>>16,C=t[7],P+=(T=e[7])>>>16,A+=65535&C,E+=C>>>16,E+=(A+=(P+=(O+=65535&T)>>>16)>>>16)>>>16,t[7]=D=65535&A|E<<16,e[7]=W=65535&O|P<<16,X+=128,r-=128}return r}function Z(t,e,n){var r,o=new Int32Array(8),i=new Int32Array(8),s=new Uint8Array(256),a=n;for(o[0]=1779033703,o[1]=3144134277,o[2]=1013904242,o[3]=2773480762,o[4]=1359893119,o[5]=2600822924,o[6]=528734635,o[7]=1541459225,i[0]=4089235720,i[1]=2227873595,i[2]=4271175723,i[3]=1595750129,i[4]=2917565137,i[5]=725511199,i[6]=4215389547,i[7]=327033209,V(o,i,e,n),n%=128,r=0;r=0;--o)$(t,e,r=n[o/8|0]>>(7&o)&1),Q(e,t),Q(t,t),$(t,e,r)}function nt(t,n){var r=[e(),e(),e(),e()];x(r[0],f),x(r[1],p),x(r[2],a),D(r[3],f,p),et(t,r,n)}function rt(t,n,o){var i,s=new Uint8Array(64),a=[e(),e(),e(),e()];for(o||r(n,32),Z(s,n,32),s[0]&=248,s[31]&=127,s[31]|=64,nt(a,s),tt(t,a),i=0;i<32;i++)n[i+32]=t[i];return 0}var ot=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function it(t,e){var n,r,o,i;for(r=63;r>=32;--r){for(n=0,o=r-32,i=r-12;o>4)*ot[o],n=e[o]>>8,e[o]&=255;for(o=0;o<32;o++)e[o]-=n*ot[o];for(r=0;r<32;r++)e[r+1]+=e[r]>>8,t[r]=255&e[r]}function st(t){var e,n=new Float64Array(64);for(e=0;e<64;e++)n[e]=t[e];for(e=0;e<64;e++)t[e]=0;it(t,n)}function at(t,n,r,o){var i,s,a=new Uint8Array(64),c=new Uint8Array(64),u=new Uint8Array(64),h=new Float64Array(64),f=[e(),e(),e(),e()];Z(a,o,32),a[0]&=248,a[31]&=127,a[31]|=64;var p=r+64;for(i=0;i>7&&B(t[0],s,t[0]),D(t[3],t[0],t[1]),0)}(p,o))return-1;for(i=0;i=0},t.sign.keyPair=function(){var t=new Uint8Array(32),e=new Uint8Array(64);return rt(t,e),{publicKey:t,secretKey:e}},t.sign.keyPair.fromSecretKey=function(t){if(ht(t),64!==t.length)throw new Error("bad secret key size");for(var e=new Uint8Array(32),n=0;n>>6)+r(128|63&e):r(224|e>>>12&15)+r(128|e>>>6&63)+r(128|63&e)},h=function(t){return t.replace(/[^\x00-\x7F]/g,u)},f=function(t){var e=[0,2,1][t.length%3],n=t.charCodeAt(0)<<16|(t.length>1?t.charCodeAt(1):0)<<8|(t.length>2?t.charCodeAt(2):0);return[o.charAt(n>>>18),o.charAt(n>>>12&63),e>=2?"=":o.charAt(n>>>6&63),e>=1?"=":o.charAt(63&n)].join("")},p=self.btoa||function(t){return t.replace(/[\s\S]{1,3}/g,f)},l=function(){function t(t,e,n,r){var o=this;this.clear=e,this.timer=t((function(){o.timer&&(o.timer=r(o.timer))}),n)}return t.prototype.isRunning=function(){return null!==this.timer},t.prototype.ensureAborted=function(){this.timer&&(this.clear(this.timer),this.timer=null)},t}(),d=(c=function(t,e){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}c(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});function y(t){self.clearTimeout(t)}function g(t){self.clearInterval(t)}var v=function(t){function e(e,n){return t.call(this,setTimeout,y,e,(function(t){return n(),null}))||this}return d(e,t),e}(l),b=function(t){function e(e,n){return t.call(this,setInterval,g,e,(function(t){return n(),t}))||this}return d(e,t),e}(l),m={now:function(){return Date.now?Date.now():(new Date).valueOf()},defer:function(t){return new v(0,t)},method:function(t){for(var e=[],n=1;n0)for(r=0;r=1002&&t.code<=1004?"backoff":null:4e3===t.code?"tls_only":t.code<4100?"refused":t.code<4200?"backoff":t.code<4300?"retry":"refused"},getCloseError:function(t){return 1e3!==t.code&&1001!==t.code?{type:"PusherError",data:{code:t.code,message:t.reason||t.message}}:null}},$=Q,tt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),et=function(t){function e(e,n){var r=t.call(this)||this;return r.id=e,r.transport=n,r.activityTimeout=n.activityTimeout,r.bindListeners(),r}return tt(e,t),e.prototype.handlesActivityChecks=function(){return this.transport.handlesActivityChecks()},e.prototype.send=function(t){return this.transport.send(t)},e.prototype.send_event=function(t,e,n){var r={event:t,data:e};return n&&(r.channel=n),z.debug("Event sent",r),this.send($.encodeMessage(r))},e.prototype.ping=function(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})},e.prototype.close=function(){this.transport.close()},e.prototype.bindListeners=function(){var t=this,e={message:function(e){var n;try{n=$.decodeMessage(e)}catch(n){t.emit("error",{type:"MessageParseError",error:n,data:e.data})}if(void 0!==n){switch(z.debug("Event recd",n),n.event){case"pusher:error":t.emit("error",{type:"PusherError",data:n.data});break;case"pusher:ping":t.emit("ping");break;case"pusher:pong":t.emit("pong")}t.emit("message",n)}},activity:function(){t.emit("activity")},error:function(e){t.emit("error",{type:"WebSocketError",error:e})},closed:function(e){n(),e&&e.code&&t.handleCloseEvent(e),t.transport=null,t.emit("closed")}},n=function(){k(e,(function(e,n){t.transport.unbind(n,e)}))};k(e,(function(e,n){t.transport.bind(n,e)}))},e.prototype.handleCloseEvent=function(t){var e=$.getCloseAction(t),n=$.getCloseError(t);n&&this.emit("error",n),e&&this.emit(e,{action:e,error:n})},e}(H),nt=function(){function t(t,e){this.transport=t,this.callback=e,this.bindListeners()}return t.prototype.close=function(){this.unbindListeners(),this.transport.close()},t.prototype.bindListeners=function(){var t=this;this.onMessage=function(e){var n;t.unbindListeners();try{n=$.processHandshake(e)}catch(e){return t.finish("error",{error:e}),void t.transport.close()}"connected"===n.action?t.finish("connected",{connection:new et(n.id,t.transport),activityTimeout:n.activityTimeout}):(t.finish(n.action,{error:n.error}),t.transport.close())},this.onClosed=function(e){t.unbindListeners();var n=$.getCloseAction(e)||"backoff",r=$.getCloseError(e);t.finish(n,{error:r})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)},t.prototype.unbindListeners=function(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)},t.prototype.finish=function(t,e){this.callback(_({transport:this.transport,action:t},e))},t}(),rt=function(){function t(t,e){this.channel=t;var n=e.authTransport;if(void 0===re.getAuthorizers()[n])throw"'"+n+"' is not a recognized auth transport";this.type=n,this.options=e,this.authOptions=e.auth||{}}return t.prototype.composeQuery=function(t){var e="socket_id="+encodeURIComponent(t)+"&channel_name="+encodeURIComponent(this.channel.name);for(var n in this.authOptions.params)e+="&"+encodeURIComponent(n)+"="+encodeURIComponent(this.authOptions.params[n]);return e},t.prototype.authorize=function(e,n){t.authorizers=t.authorizers||re.getAuthorizers(),t.authorizers[this.type].call(this,re,e,n)},t}(),ot=function(){function t(t,e){this.timeline=t,this.options=e||{}}return t.prototype.send=function(t,e){this.timeline.isEmpty()||this.timeline.send(re.TimelineTransport.getAgent(this,t),e)},t}(),it=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),st=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return Object.setPrototypeOf(r,n.prototype),r}return it(e,t),e}(Error),at=(function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return Object.setPrototypeOf(r,n.prototype),r}it(e,t)}(Error),function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return Object.setPrototypeOf(r,n.prototype),r}return it(e,t),e}(Error)),ct=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return Object.setPrototypeOf(r,n.prototype),r}return it(e,t),e}(Error),ut=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return Object.setPrototypeOf(r,n.prototype),r}return it(e,t),e}(Error),ht=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return Object.setPrototypeOf(r,n.prototype),r}return it(e,t),e}(Error),ft=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return Object.setPrototypeOf(r,n.prototype),r}return it(e,t),e}(Error),pt={baseUrl:"https://pusher.com",urls:{authenticationEndpoint:{path:"/docs/authenticating_users"},javascriptQuickStart:{path:"/docs/javascript_quick_start"},triggeringClientEvents:{path:"/docs/client_api_guide/client_events#trigger-events"},encryptedChannelSupport:{fullUrl:"https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support"}}},lt=function(t){var e,n=pt.urls[t];return n?(n.fullUrl?e=n.fullUrl:n.path&&(e=pt.baseUrl+n.path),e?"See: "+e:""):""},dt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),yt=function(t){function e(e,n){var r=t.call(this,(function(t,n){z.debug("No callbacks on "+e+" for "+t)}))||this;return r.name=e,r.pusher=n,r.subscribed=!1,r.subscriptionPending=!1,r.subscriptionCancelled=!1,r}return dt(e,t),e.prototype.authorize=function(t,e){return e(!1,{auth:""})},e.prototype.trigger=function(t,e){if(0!==t.indexOf("client-"))throw new st("Event '"+t+"' does not start with 'client-'");if(!this.subscribed){var n=lt("triggeringClientEvents");z.warn("Client event triggered before channel 'subscription_succeeded' event . "+n)}return this.pusher.send_event(t,e,this.name)},e.prototype.disconnect=function(){this.subscribed=!1,this.subscriptionPending=!1},e.prototype.handleEvent=function(t){var e=t.event,n=t.data;if("pusher_internal:subscription_succeeded"===e)this.handleSubscriptionSucceededEvent(t);else if(0!==e.indexOf("pusher_internal:")){this.emit(e,n,{})}},e.prototype.handleSubscriptionSucceededEvent=function(t){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",t.data)},e.prototype.subscribe=function(){var t=this;this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,(function(e,n){e?(z.error(n),t.emit("pusher:subscription_error",n)):(n=n,t.pusher.send_event("pusher:subscribe",{auth:n.auth,channel_data:n.channel_data,channel:t.name}))})))},e.prototype.unsubscribe=function(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})},e.prototype.cancelSubscription=function(){this.subscriptionCancelled=!0},e.prototype.reinstateSubscription=function(){this.subscriptionCancelled=!1},e}(H),gt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),vt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return gt(e,t),e.prototype.authorize=function(t,e){return At.createAuthorizer(this,this.pusher.config).authorize(t,e)},e}(yt),bt=function(){function t(){this.reset()}return t.prototype.get=function(t){return Object.prototype.hasOwnProperty.call(this.members,t)?{id:t,info:this.members[t]}:null},t.prototype.each=function(t){var e=this;k(this.members,(function(n,r){t(e.get(r))}))},t.prototype.setMyID=function(t){this.myID=t},t.prototype.onSubscription=function(t){this.members=t.presence.hash,this.count=t.presence.count,this.me=this.get(this.myID)},t.prototype.addMember=function(t){return null===this.get(t.user_id)&&this.count++,this.members[t.user_id]=t.user_info,this.get(t.user_id)},t.prototype.removeMember=function(t){var e=this.get(t.user_id);return e&&(delete this.members[t.user_id],this.count--),e},t.prototype.reset=function(){this.members={},this.count=0,this.myID=null,this.me=null},t}(),mt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_t=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.members=new bt,r}return mt(e,t),e.prototype.authorize=function(e,n){var r=this;t.prototype.authorize.call(this,e,(function(t,e){if(!t){if(void 0===(e=e).channel_data){var o=lt("authenticationEndpoint");return z.error("Invalid auth response for channel '"+r.name+"',expected 'channel_data' field. "+o),void n("Invalid auth response")}var i=JSON.parse(e.channel_data);r.members.setMyID(i.user_id)}n(t,e)}))},e.prototype.handleEvent=function(t){var e=t.event;if(0===e.indexOf("pusher_internal:"))this.handleInternalEvent(t);else{var n=t.data,r={};t.user_id&&(r.user_id=t.user_id),this.emit(e,n,r)}},e.prototype.handleInternalEvent=function(t){var e=t.event,n=t.data;switch(e){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(t);break;case"pusher_internal:member_added":var r=this.members.addMember(n);this.emit("pusher:member_added",r);break;case"pusher_internal:member_removed":var o=this.members.removeMember(n);o&&this.emit("pusher:member_removed",o)}},e.prototype.handleSubscriptionSucceededEvent=function(t){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(t.data),this.emit("pusher:subscription_succeeded",this.members))},e.prototype.disconnect=function(){this.members.reset(),t.prototype.disconnect.call(this)},e}(vt),wt=n(1),St=n(0),kt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ct=function(t){function e(e,n,r){var o=t.call(this,e,n)||this;return o.key=null,o.nacl=r,o}return kt(e,t),e.prototype.authorize=function(e,n){var r=this;t.prototype.authorize.call(this,e,(function(t,e){if(t)n(!0,e);else{var o=e.shared_secret;if(o)r.key=Object(St.decode)(o),delete e.shared_secret,n(!1,e);else{var i="No shared_secret key in auth payload for encrypted channel: "+r.name;n(!0,i)}}}))},e.prototype.trigger=function(t,e){throw new ut("Client events are not currently supported for encrypted channels")},e.prototype.handleEvent=function(e){var n=e.event,r=e.data;0!==n.indexOf("pusher_internal:")&&0!==n.indexOf("pusher:")?this.handleEncryptedEvent(n,r):t.prototype.handleEvent.call(this,e)},e.prototype.handleEncryptedEvent=function(t,e){var n=this;if(this.key)if(e.ciphertext&&e.nonce){var r=Object(St.decode)(e.ciphertext);if(r.length0&&this.emit("connecting_in",Math.round(t/1e3)),this.retryTimer=new v(t||0,(function(){e.disconnectInternally(),e.connect()}))},e.prototype.clearRetryTimer=function(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)},e.prototype.setUnavailableTimer=function(){var t=this;this.unavailableTimer=new v(this.options.unavailableTimeout,(function(){t.updateState("unavailable")}))},e.prototype.clearUnavailableTimer=function(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()},e.prototype.sendActivityCheck=function(){var t=this;this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new v(this.options.pongTimeout,(function(){t.timeline.error({pong_timed_out:t.options.pongTimeout}),t.retryIn(0)}))},e.prototype.resetActivityCheck=function(){var t=this;this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new v(this.activityTimeout,(function(){t.sendActivityCheck()})))},e.prototype.stopActivityCheck=function(){this.activityTimer&&this.activityTimer.ensureAborted()},e.prototype.buildConnectionCallbacks=function(t){var e=this;return _({},t,{message:function(t){e.resetActivityCheck(),e.emit("message",t)},ping:function(){e.send_event("pusher:pong",{})},activity:function(){e.resetActivityCheck()},error:function(t){e.emit("error",{type:"WebSocketError",error:t})},closed:function(){e.abandonConnection(),e.shouldRetry()&&e.retryIn(1e3)}})},e.prototype.buildHandshakeCallbacks=function(t){var e=this;return _({},t,{connected:function(t){e.activityTimeout=Math.min(e.options.activityTimeout,t.activityTimeout,t.connection.activityTimeout||1/0),e.clearUnavailableTimer(),e.setConnection(t.connection),e.socket_id=e.connection.id,e.updateState("connected",{socket_id:e.socket_id})}})},e.prototype.buildErrorCallbacks=function(){var t=this,e=function(e){return function(n){n.error&&t.emit("error",{type:"WebSocketError",error:n.error}),e(n)}};return{tls_only:e((function(){t.usingTLS=!0,t.updateStrategy(),t.retryIn(0)})),refused:e((function(){t.disconnect()})),backoff:e((function(){t.retryIn(1e3)})),retry:e((function(){t.retryIn(0)}))}},e.prototype.setConnection=function(t){for(var e in this.connection=t,this.connectionCallbacks)this.connection.bind(e,this.connectionCallbacks[e]);this.resetActivityCheck()},e.prototype.abandonConnection=function(){if(this.connection){for(var t in this.stopActivityCheck(),this.connectionCallbacks)this.connection.unbind(t,this.connectionCallbacks[t]);var e=this.connection;return this.connection=null,e}},e.prototype.updateState=function(t,e){var n=this.state;if(this.state=t,n!==t){var r=t;"connected"===r&&(r+=" with new socket ID "+e.socket_id),z.debug("State changed",n+" -> "+r),this.timeline.info({state:t,params:e}),this.emit("state_change",{previous:n,current:t}),this.emit(t,e)}},e.prototype.shouldRetry=function(){return"connecting"===this.state||"connected"===this.state},e}(H),Pt=function(){function t(){this.channels={}}return t.prototype.add=function(t,e){return this.channels[t]||(this.channels[t]=function(t,e){if(0===t.indexOf("private-encrypted-")){if(e.config.nacl)return At.createEncryptedChannel(t,e,e.config.nacl);var n=lt("encryptedChannelSupport");throw new ut("Tried to subscribe to a private-encrypted- channel but no nacl implementation available. "+n)}return 0===t.indexOf("private-")?At.createPrivateChannel(t,e):0===t.indexOf("presence-")?At.createPresenceChannel(t,e):At.createChannel(t,e)}(t,e)),this.channels[t]},t.prototype.all=function(){return function(t){var e=[];return k(t,(function(t){e.push(t)})),e}(this.channels)},t.prototype.find=function(t){return this.channels[t]},t.prototype.remove=function(t){var e=this.channels[t];return delete this.channels[t],e},t.prototype.disconnect=function(){k(this.channels,(function(t){t.disconnect()}))},t}();var At={createChannels:function(){return new Pt},createConnectionManager:function(t,e){return new Ot(t,e)},createChannel:function(t,e){return new yt(t,e)},createPrivateChannel:function(t,e){return new vt(t,e)},createPresenceChannel:function(t,e){return new _t(t,e)},createEncryptedChannel:function(t,e,n){return new Ct(t,e,n)},createTimelineSender:function(t,e){return new ot(t,e)},createAuthorizer:function(t,e){return e.authorizer?e.authorizer(t,e):new rt(t,e)},createHandshake:function(t,e){return new nt(t,e)},createAssistantToTheTransportManager:function(t,e,n){return new Z(t,e,n)}},Et=function(){function t(t){this.options=t||{},this.livesLeft=this.options.lives||1/0}return t.prototype.getAssistant=function(t){return At.createAssistantToTheTransportManager(this,t,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})},t.prototype.isAlive=function(){return this.livesLeft>0},t.prototype.reportDeath=function(){this.livesLeft-=1},t}(),xt=function(){function t(t,e){this.strategies=t,this.loop=Boolean(e.loop),this.failFast=Boolean(e.failFast),this.timeout=e.timeout,this.timeoutLimit=e.timeoutLimit}return t.prototype.isSupported=function(){return E(this.strategies,m.method("isSupported"))},t.prototype.connect=function(t,e){var n=this,r=this.strategies,o=0,i=this.timeout,s=null,a=function(c,u){u?e(null,u):(o+=1,n.loop&&(o%=r.length),o0&&(o=new v(n.timeout,(function(){i.abort(),r(!0)}))),i=t.connect(e,(function(t,e){t&&o&&o.isRunning()&&!n.failFast||(o&&o.ensureAborted(),r(t,e))})),{abort:function(){o&&o.ensureAborted(),i.abort()},forceMinPriority:function(t){i.forceMinPriority(t)}}},t}(),Lt=function(){function t(t){this.strategies=t}return t.prototype.isSupported=function(){return E(this.strategies,m.method("isSupported"))},t.prototype.connect=function(t,e){return function(t,e,n){var r=O(t,(function(t,r,o,i){return t.connect(e,n(r,i))}));return{abort:function(){T(r,Ut)},forceMinPriority:function(t){T(r,(function(e){e.forceMinPriority(t)}))}}}(this.strategies,t,(function(t,n){return function(r,o){n[t].error=r,r?function(t){return function(t,e){for(var n=0;n=m.now()){var i=this.transports[r.transport];i&&(this.timeline.info({cached:!0,transport:r.transport,latency:r.latency}),o.push(new xt([i],{timeout:2*r.latency+1e3,failFast:!0})))}var s=m.now(),a=o.pop().connect(t,(function r(i,c){i?(jt(n),o.length>0?(s=m.now(),a=o.pop().connect(t,r)):e(i)):(!function(t,e,n){var r=re.getLocalStorage();if(r)try{r[Rt(t)]=U({timestamp:m.now(),transport:e,latency:n})}catch(t){}}(n,c.transport.name,m.now()-s),e(null,c))}));return{abort:function(){a.abort()},forceMinPriority:function(e){t=e,a&&a.forceMinPriority(e)}}},t}();function Rt(t){return"pusherTransport"+(t?"TLS":"NonTLS")}function jt(t){var e=re.getLocalStorage();if(e)try{delete e[Rt(t)]}catch(t){}}var It=function(){function t(t,e){var n=e.delay;this.strategy=t,this.options={delay:n}}return t.prototype.isSupported=function(){return this.strategy.isSupported()},t.prototype.connect=function(t,e){var n,r=this.strategy,o=new v(this.options.delay,(function(){n=r.connect(t,e)}));return{abort:function(){o.ensureAborted(),n&&n.abort()},forceMinPriority:function(e){t=e,n&&n.forceMinPriority(e)}}},t}(),Nt=function(){function t(t,e,n){this.test=t,this.trueBranch=e,this.falseBranch=n}return t.prototype.isSupported=function(){return(this.test()?this.trueBranch:this.falseBranch).isSupported()},t.prototype.connect=function(t,e){return(this.test()?this.trueBranch:this.falseBranch).connect(t,e)},t}(),Bt=function(){function t(t){this.strategy=t}return t.prototype.isSupported=function(){return this.strategy.isSupported()},t.prototype.connect=function(t,e){var n=this.strategy.connect(t,(function(t,r){r&&n.abort(),e(t,r)}));return n},t}();function Dt(t){return function(){return t.isSupported()}}var Ht,zt=function(t,e,n){var r={};function o(e,o,i,s,a){var c=n(t,e,o,i,s,a);return r[e]=c,c}var i,s=Object.assign({},e,{hostNonTLS:t.wsHost+":"+t.wsPort,hostTLS:t.wsHost+":"+t.wssPort,httpPath:t.wsPath}),a=_({},s,{useTLS:!0}),c=Object.assign({},e,{hostNonTLS:t.httpHost+":"+t.httpPort,hostTLS:t.httpHost+":"+t.httpsPort,httpPath:t.httpPath}),u={loop:!0,timeout:15e3,timeoutLimit:6e4},h=new Et({lives:2,minPingDelay:1e4,maxPingDelay:t.activityTimeout}),f=new Et({lives:2,minPingDelay:1e4,maxPingDelay:t.activityTimeout}),p=o("ws","ws",3,s,h),l=o("wss","ws",3,a,h),d=o("xhr_streaming","xhr_streaming",1,c,f),y=o("xhr_polling","xhr_polling",1,c),g=new xt([p],u),v=new xt([l],u),b=new xt([d],u),m=new xt([y],u),w=new xt([new Nt(Dt(b),new Lt([b,new It(m,{delay:4e3})]),m)],u);return i=e.useTLS?new Lt([g,new It(w,{delay:2e3})]):new Lt([g,new It(v,{delay:2e3}),new It(w,{delay:5e3})]),new Mt(new Bt(new Nt(Dt(p),i,w)),r,{ttl:18e5,timeline:e.timeline,useTLS:e.useTLS})},Ft=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),qt=function(t){function e(e,n,r){var o=t.call(this)||this;return o.hooks=e,o.method=n,o.url=r,o}return Ft(e,t),e.prototype.start=function(t){var e=this;this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=function(){e.close()},re.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(t)},e.prototype.close=function(){this.unloader&&(re.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)},e.prototype.onChunk=function(t,e){for(;;){var n=this.advanceBuffer(e);if(!n)break;this.emit("chunk",{status:t,data:n})}this.isBufferTooLong(e)&&this.emit("buffer_too_long")},e.prototype.advanceBuffer=function(t){var e=t.slice(this.position),n=e.indexOf("\n");return-1!==n?(this.position+=n+1,e.slice(0,n)):null},e.prototype.isBufferTooLong=function(t){return this.position===t.length&&t.length>262144},e}(H);!function(t){t[t.CONNECTING=0]="CONNECTING",t[t.OPEN=1]="OPEN",t[t.CLOSED=3]="CLOSED"}(Ht||(Ht={}));var Yt=Ht,Kt=1;function Jt(t){var e=-1===t.indexOf("?")?"?":"&";return t+e+"t="+ +new Date+"&n="+Kt++}function Wt(t){return Math.floor(Math.random()*t)}var Xt,Gt=function(){function t(t,e){this.hooks=t,this.session=Wt(1e3)+"/"+function(t){for(var e=[],n=0;n0&&t.onChunk(e.status,e.responseText);break;case 4:e.responseText&&e.responseText.length>0&&t.onChunk(e.status,e.responseText),t.emit("finished",e.status),t.close()}},e},abortRequest:function(t){t.onreadystatechange=null,t.abort()}},$t={getDefaultStrategy:zt,Transports:V,transportConnectionInitializer:function(){this.timeline.info(this.buildTimelineMessage({transport:this.name+(this.options.useTLS?"s":"")})),this.hooks.isInitialized()?this.changeState("initialized"):this.onClose()},HTTPFactory:{createStreamingSocket:function(t){return this.createSocket(Vt,t)},createPollingSocket:function(t){return this.createSocket(Zt,t)},createSocket:function(t,e){return new Gt(t,e)},createXHR:function(t,e){return this.createRequest(Qt,t,e)},createRequest:function(t,e,n){return new qt(t,e,n)}},setup:function(t){t.ready()},getLocalStorage:function(){},getClientFeatures:function(){return C(A({ws:V.ws},(function(t){return t.isSupported({})})))},getProtocol:function(){return"http:"},isXHRSupported:function(){return!0},createSocketRequest:function(t,e){if(this.isXHRSupported())return this.HTTPFactory.createXHR(t,e);throw"Cross-origin HTTP requests are not supported"},createXHR:function(){return new(this.getXHRAPI())},createWebSocket:function(t){return new(this.getWebSocketAPI())(t)},addUnloadListener:function(t){},removeUnloadListener:function(t){}},te=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ee=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return te(e,t),e.prototype.isOnline=function(){return!0},e}(H)),ne=function(t,e,n){var r=new Headers;for(var o in r.set("Content-Type","application/x-www-form-urlencoded"),this.authOptions.headers)r.set(o,this.authOptions.headers[o]);var i=this.composeQuery(e),s=new Request(this.options.authEndpoint,{headers:r,body:i,credentials:"same-origin",method:"POST"});return fetch(s).then((function(t){var e=t.status;if(200===e)return t.text();throw z.error("Couldn't get auth info from your auth endpoint",e),e})).then((function(t){try{t=JSON.parse(t)}catch(n){var e="JSON returned from auth endpoint was invalid, yet status code was 200. Data was: "+t;throw z.error(e),e}n(!1,t)})).catch((function(t){n(!0,t)}))},re={getDefaultStrategy:$t.getDefaultStrategy,Transports:$t.Transports,setup:$t.setup,getProtocol:$t.getProtocol,isXHRSupported:$t.isXHRSupported,getLocalStorage:$t.getLocalStorage,createXHR:$t.createXHR,createWebSocket:$t.createWebSocket,addUnloadListener:$t.addUnloadListener,removeUnloadListener:$t.removeUnloadListener,transportConnectionInitializer:$t.transportConnectionInitializer,createSocketRequest:$t.createSocketRequest,HTTPFactory:$t.HTTPFactory,TimelineTransport:{name:"xhr",getAgent:function(t,e){return function(n,r){var o="http"+(e?"s":"")+"://"+(t.host||t.options.host)+t.options.path,i=L(n);fetch(o+="/2?"+i).then((function(t){if(200!==t.status)throw"received "+t.status+" from stats.pusher.com";return t.json()})).then((function(e){var n=e.host;n&&(t.host=n)})).catch((function(t){z.debug("TimelineSender Error: ",t)}))}}},getAuthorizers:function(){return{ajax:ne}},getWebSocketAPI:function(){return WebSocket},getXHRAPI:function(){return XMLHttpRequest},getNetwork:function(){return ee}};!function(t){t[t.ERROR=3]="ERROR",t[t.INFO=6]="INFO",t[t.DEBUG=7]="DEBUG"}(Xt||(Xt={}));var oe=Xt,ie=function(){function t(t,e,n){this.key=t,this.session=e,this.events=[],this.options=n||{},this.sent=0,this.uniqueID=0}return t.prototype.log=function(t,e){t<=this.options.level&&(this.events.push(_({},e,{timestamp:m.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())},t.prototype.error=function(t){this.log(oe.ERROR,t)},t.prototype.info=function(t){this.log(oe.INFO,t)},t.prototype.debug=function(t){this.log(oe.DEBUG,t)},t.prototype.isEmpty=function(){return 0===this.events.length},t.prototype.send=function(t,e){var n=this,r=_({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],t(r,(function(t,r){t||n.sent++,e&&e(t,r)})),!0},t.prototype.generateUniqueID=function(){return this.uniqueID++,this.uniqueID},t}(),se=function(){function t(t,e,n,r){this.name=t,this.priority=e,this.transport=n,this.options=r||{}}return t.prototype.isSupported=function(){return this.transport.isSupported({useTLS:this.options.useTLS})},t.prototype.connect=function(t,e){var n=this;if(!this.isSupported())return ae(new ft,e);if(this.priority>>18&63),e+=this._encodeByte(r>>>12&63),e+=this._encodeByte(r>>>6&63),e+=this._encodeByte(r>>>0&63)}var o=t.length-n;if(o>0){r=t[n]<<16|(2===o?t[n+1]<<8:0);e+=this._encodeByte(r>>>18&63),e+=this._encodeByte(r>>>12&63),e+=2===o?this._encodeByte(r>>>6&63):this._paddingCharacter||"",e+=this._paddingCharacter||""}return e},t.prototype.maxDecodedLength=function(t){return this._paddingCharacter?t/4*3|0:(6*t+7)/8|0},t.prototype.decodedLength=function(t){return this.maxDecodedLength(t.length-this._getPaddingLength(t))},t.prototype.decode=function(t){if(0===t.length)return new Uint8Array(0);for(var e=this._getPaddingLength(t),n=t.length-e,r=new Uint8Array(this.maxDecodedLength(n)),o=0,i=0,s=0,a=0,c=0,u=0,h=0;i>>4,r[o++]=c<<4|u>>>2,r[o++]=u<<6|h,s|=256&a,s|=256&c,s|=256&u,s|=256&h;if(i>>4,s|=256&a,s|=256&c),i>>2,s|=256&u),i>>8&6,e+=51-t>>>8&-75,e+=61-t>>>8&-15,e+=62-t>>>8&3,String.fromCharCode(e)},t.prototype._decodeChar=function(t){var e=256;return e+=(42-t&t-44)>>>8&-256+t-43+62,e+=(46-t&t-48)>>>8&-256+t-47+63,e+=(47-t&t-58)>>>8&-256+t-48+52,e+=(64-t&t-91)>>>8&-256+t-65+0,e+=(96-t&t-123)>>>8&-256+t-97+26},t.prototype._getPaddingLength=function(t){var e=0;if(this._paddingCharacter){for(var n=t.length-1;n>=0&&t[n]===this._paddingCharacter;n--)e++;if(t.length<4||e>2)throw new Error("Base64Coder: incorrect padding")}return e},t}();e.Coder=i;var s=new i;e.encode=function(t){return s.encode(t)},e.decode=function(t){return s.decode(t)};var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype._encodeByte=function(t){var e=t;return e+=65,e+=25-t>>>8&6,e+=51-t>>>8&-75,e+=61-t>>>8&-13,e+=62-t>>>8&49,String.fromCharCode(e)},e.prototype._decodeChar=function(t){var e=256;return e+=(44-t&t-46)>>>8&-256+t-45+62,e+=(94-t&t-96)>>>8&-256+t-95+63,e+=(47-t&t-58)>>>8&-256+t-48+52,e+=(64-t&t-91)>>>8&-256+t-65+0,e+=(96-t&t-123)>>>8&-256+t-97+26},e}(i);e.URLSafeCoder=a;var c=new a;e.encodeURLSafe=function(t){return c.encode(t)},e.decodeURLSafe=function(t){return c.decode(t)},e.encodedLength=function(t){return s.encodedLength(t)},e.maxDecodedLength=function(t){return s.maxDecodedLength(t)},e.decodedLength=function(t){return s.decodedLength(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r="utf8: invalid source encoding";function o(t){for(var e=0,n=0;n=t.length-1)throw new Error("utf8: invalid string");n++,e+=4}}return e}e.encode=function(t){for(var e=new Uint8Array(o(t)),n=0,r=0;r>6,e[n++]=128|63&i):i<55296?(e[n++]=224|i>>12,e[n++]=128|i>>6&63,e[n++]=128|63&i):(r++,i=(1023&i)<<10,i|=1023&t.charCodeAt(r),i+=65536,e[n++]=240|i>>18,e[n++]=128|i>>12&63,e[n++]=128|i>>6&63,e[n++]=128|63&i)}return e},e.encodedLength=o,e.decode=function(t){for(var e=[],n=0;n=t.length)throw new Error(r);if(128!=(192&(s=t[++n])))throw new Error(r);o=(31&o)<<6|63&s,i=128}else if(o<240){if(n>=t.length-1)throw new Error(r);var s=t[++n],a=t[++n];if(128!=(192&s)||128!=(192&a))throw new Error(r);o=(15&o)<<12|(63&s)<<6|63&a,i=2048}else{if(!(o<248))throw new Error(r);if(n>=t.length-2)throw new Error(r);s=t[++n],a=t[++n];var c=t[++n];if(128!=(192&s)||128!=(192&a)||128!=(192&c))throw new Error(r);o=(15&o)<<18|(63&s)<<12|(63&a)<<6|63&c,i=65536}if(o=55296&&o<=57343)throw new Error(r);if(o>=65536){if(o>1114111)throw new Error(r);o-=65536,e.push(String.fromCharCode(55296|o>>10)),o=56320|1023&o}}e.push(String.fromCharCode(o))}return e.join("")}},function(t,e,n){!function(t){"use strict";var e=function(t){var e,n=new Float64Array(16);if(t)for(e=0;e>24&255,t[e+1]=n>>16&255,t[e+2]=n>>8&255,t[e+3]=255&n,t[e+4]=r>>24&255,t[e+5]=r>>16&255,t[e+6]=r>>8&255,t[e+7]=255&r}function y(t,e,n,r,o){var i,s=0;for(i=0;i>>8)-1}function g(t,e,n,r){return y(t,e,n,r,16)}function v(t,e,n,r){return y(t,e,n,r,32)}function b(t,e,n,r){!function(t,e,n,r){for(var o,i=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,c=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,u=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,h=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,f=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,l=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,p=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,d=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,y=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,g=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,v=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,b=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,m=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,_=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,w=i,S=s,k=a,C=c,T=u,P=h,O=f,A=l,E=p,x=d,L=y,U=g,M=v,R=b,j=m,I=_,N=0;N<20;N+=2)w^=(o=(M^=(o=(E^=(o=(T^=(o=w+M|0)<<7|o>>>25)+w|0)<<9|o>>>23)+T|0)<<13|o>>>19)+E|0)<<18|o>>>14,P^=(o=(S^=(o=(R^=(o=(x^=(o=P+S|0)<<7|o>>>25)+P|0)<<9|o>>>23)+x|0)<<13|o>>>19)+R|0)<<18|o>>>14,L^=(o=(O^=(o=(k^=(o=(j^=(o=L+O|0)<<7|o>>>25)+L|0)<<9|o>>>23)+j|0)<<13|o>>>19)+k|0)<<18|o>>>14,I^=(o=(U^=(o=(A^=(o=(C^=(o=I+U|0)<<7|o>>>25)+I|0)<<9|o>>>23)+C|0)<<13|o>>>19)+A|0)<<18|o>>>14,w^=(o=(C^=(o=(k^=(o=(S^=(o=w+C|0)<<7|o>>>25)+w|0)<<9|o>>>23)+S|0)<<13|o>>>19)+k|0)<<18|o>>>14,P^=(o=(T^=(o=(A^=(o=(O^=(o=P+T|0)<<7|o>>>25)+P|0)<<9|o>>>23)+O|0)<<13|o>>>19)+A|0)<<18|o>>>14,L^=(o=(x^=(o=(E^=(o=(U^=(o=L+x|0)<<7|o>>>25)+L|0)<<9|o>>>23)+U|0)<<13|o>>>19)+E|0)<<18|o>>>14,I^=(o=(j^=(o=(R^=(o=(M^=(o=I+j|0)<<7|o>>>25)+I|0)<<9|o>>>23)+M|0)<<13|o>>>19)+R|0)<<18|o>>>14;w=w+i|0,S=S+s|0,k=k+a|0,C=C+c|0,T=T+u|0,P=P+h|0,O=O+f|0,A=A+l|0,E=E+p|0,x=x+d|0,L=L+y|0,U=U+g|0,M=M+v|0,R=R+b|0,j=j+m|0,I=I+_|0,t[0]=w>>>0&255,t[1]=w>>>8&255,t[2]=w>>>16&255,t[3]=w>>>24&255,t[4]=S>>>0&255,t[5]=S>>>8&255,t[6]=S>>>16&255,t[7]=S>>>24&255,t[8]=k>>>0&255,t[9]=k>>>8&255,t[10]=k>>>16&255,t[11]=k>>>24&255,t[12]=C>>>0&255,t[13]=C>>>8&255,t[14]=C>>>16&255,t[15]=C>>>24&255,t[16]=T>>>0&255,t[17]=T>>>8&255,t[18]=T>>>16&255,t[19]=T>>>24&255,t[20]=P>>>0&255,t[21]=P>>>8&255,t[22]=P>>>16&255,t[23]=P>>>24&255,t[24]=O>>>0&255,t[25]=O>>>8&255,t[26]=O>>>16&255,t[27]=O>>>24&255,t[28]=A>>>0&255,t[29]=A>>>8&255,t[30]=A>>>16&255,t[31]=A>>>24&255,t[32]=E>>>0&255,t[33]=E>>>8&255,t[34]=E>>>16&255,t[35]=E>>>24&255,t[36]=x>>>0&255,t[37]=x>>>8&255,t[38]=x>>>16&255,t[39]=x>>>24&255,t[40]=L>>>0&255,t[41]=L>>>8&255,t[42]=L>>>16&255,t[43]=L>>>24&255,t[44]=U>>>0&255,t[45]=U>>>8&255,t[46]=U>>>16&255,t[47]=U>>>24&255,t[48]=M>>>0&255,t[49]=M>>>8&255,t[50]=M>>>16&255,t[51]=M>>>24&255,t[52]=R>>>0&255,t[53]=R>>>8&255,t[54]=R>>>16&255,t[55]=R>>>24&255,t[56]=j>>>0&255,t[57]=j>>>8&255,t[58]=j>>>16&255,t[59]=j>>>24&255,t[60]=I>>>0&255,t[61]=I>>>8&255,t[62]=I>>>16&255,t[63]=I>>>24&255}(t,e,n,r)}function m(t,e,n,r){!function(t,e,n,r){for(var o,i=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,c=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,u=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,h=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,f=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,l=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,p=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,d=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,y=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,g=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,v=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,b=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,m=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,_=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,w=0;w<20;w+=2)i^=(o=(v^=(o=(p^=(o=(u^=(o=i+v|0)<<7|o>>>25)+i|0)<<9|o>>>23)+u|0)<<13|o>>>19)+p|0)<<18|o>>>14,h^=(o=(s^=(o=(b^=(o=(d^=(o=h+s|0)<<7|o>>>25)+h|0)<<9|o>>>23)+d|0)<<13|o>>>19)+b|0)<<18|o>>>14,y^=(o=(f^=(o=(a^=(o=(m^=(o=y+f|0)<<7|o>>>25)+y|0)<<9|o>>>23)+m|0)<<13|o>>>19)+a|0)<<18|o>>>14,_^=(o=(g^=(o=(l^=(o=(c^=(o=_+g|0)<<7|o>>>25)+_|0)<<9|o>>>23)+c|0)<<13|o>>>19)+l|0)<<18|o>>>14,i^=(o=(c^=(o=(a^=(o=(s^=(o=i+c|0)<<7|o>>>25)+i|0)<<9|o>>>23)+s|0)<<13|o>>>19)+a|0)<<18|o>>>14,h^=(o=(u^=(o=(l^=(o=(f^=(o=h+u|0)<<7|o>>>25)+h|0)<<9|o>>>23)+f|0)<<13|o>>>19)+l|0)<<18|o>>>14,y^=(o=(d^=(o=(p^=(o=(g^=(o=y+d|0)<<7|o>>>25)+y|0)<<9|o>>>23)+g|0)<<13|o>>>19)+p|0)<<18|o>>>14,_^=(o=(m^=(o=(b^=(o=(v^=(o=_+m|0)<<7|o>>>25)+_|0)<<9|o>>>23)+v|0)<<13|o>>>19)+b|0)<<18|o>>>14;t[0]=i>>>0&255,t[1]=i>>>8&255,t[2]=i>>>16&255,t[3]=i>>>24&255,t[4]=h>>>0&255,t[5]=h>>>8&255,t[6]=h>>>16&255,t[7]=h>>>24&255,t[8]=y>>>0&255,t[9]=y>>>8&255,t[10]=y>>>16&255,t[11]=y>>>24&255,t[12]=_>>>0&255,t[13]=_>>>8&255,t[14]=_>>>16&255,t[15]=_>>>24&255,t[16]=f>>>0&255,t[17]=f>>>8&255,t[18]=f>>>16&255,t[19]=f>>>24&255,t[20]=l>>>0&255,t[21]=l>>>8&255,t[22]=l>>>16&255,t[23]=l>>>24&255,t[24]=p>>>0&255,t[25]=p>>>8&255,t[26]=p>>>16&255,t[27]=p>>>24&255,t[28]=d>>>0&255,t[29]=d>>>8&255,t[30]=d>>>16&255,t[31]=d>>>24&255}(t,e,n,r)}var _=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function w(t,e,n,r,o,i,s){var a,c,u=new Uint8Array(16),h=new Uint8Array(64);for(c=0;c<16;c++)u[c]=0;for(c=0;c<8;c++)u[c]=i[c];for(;o>=64;){for(b(h,u,s,_),c=0;c<64;c++)t[e+c]=n[r+c]^h[c];for(a=1,c=8;c<16;c++)a=a+(255&u[c])|0,u[c]=255&a,a>>>=8;o-=64,e+=64,r+=64}if(o>0)for(b(h,u,s,_),c=0;c=64;){for(b(c,a,o,_),s=0;s<64;s++)t[e+s]=c[s];for(i=1,s=8;s<16;s++)i=i+(255&a[s])|0,a[s]=255&i,i>>>=8;n-=64,e+=64}if(n>0)for(b(c,a,o,_),s=0;s>>13|n<<3),r=255&t[4]|(255&t[5])<<8,this.r[2]=7939&(n>>>10|r<<6),o=255&t[6]|(255&t[7])<<8,this.r[3]=8191&(r>>>7|o<<9),i=255&t[8]|(255&t[9])<<8,this.r[4]=255&(o>>>4|i<<12),this.r[5]=i>>>1&8190,s=255&t[10]|(255&t[11])<<8,this.r[6]=8191&(i>>>14|s<<2),a=255&t[12]|(255&t[13])<<8,this.r[7]=8065&(s>>>11|a<<5),c=255&t[14]|(255&t[15])<<8,this.r[8]=8191&(a>>>8|c<<8),this.r[9]=c>>>5&127,this.pad[0]=255&t[16]|(255&t[17])<<8,this.pad[1]=255&t[18]|(255&t[19])<<8,this.pad[2]=255&t[20]|(255&t[21])<<8,this.pad[3]=255&t[22]|(255&t[23])<<8,this.pad[4]=255&t[24]|(255&t[25])<<8,this.pad[5]=255&t[26]|(255&t[27])<<8,this.pad[6]=255&t[28]|(255&t[29])<<8,this.pad[7]=255&t[30]|(255&t[31])<<8};function P(t,e,n,r,o,i){var s=new T(i);return s.update(n,r,o),s.finish(t,e),0}function O(t,e,n,r,o,i){var s=new Uint8Array(16);return P(s,0,n,r,o,i),g(t,e,s,0)}function A(t,e,n,r,o){var i;if(n<32)return-1;for(C(t,0,e,0,n,r,o),P(t,16,t,32,n-32,t),i=0;i<16;i++)t[i]=0;return 0}function E(t,e,n,r,o){var i,s=new Uint8Array(32);if(n<32)return-1;if(k(s,0,32,r,o),0!==O(e,16,e,32,n-32,s))return-1;for(C(t,0,e,0,n,r,o),i=0;i<32;i++)t[i]=0;return 0}function x(t,e){var n;for(n=0;n<16;n++)t[n]=0|e[n]}function L(t){var e,n,r=1;for(e=0;e<16;e++)n=t[e]+r+65535,r=Math.floor(n/65536),t[e]=n-65536*r;t[0]+=r-1+37*(r-1)}function U(t,e,n){for(var r,o=~(n-1),i=0;i<16;i++)r=o&(t[i]^e[i]),t[i]^=r,e[i]^=r}function M(t,n){var r,o,i,s=e(),a=e();for(r=0;r<16;r++)a[r]=n[r];for(L(a),L(a),L(a),o=0;o<2;o++){for(s[0]=a[0]-65517,r=1;r<15;r++)s[r]=a[r]-65535-(s[r-1]>>16&1),s[r-1]&=65535;s[15]=a[15]-32767-(s[14]>>16&1),i=s[15]>>16&1,s[14]&=65535,U(a,s,1-i)}for(r=0;r<16;r++)t[2*r]=255&a[r],t[2*r+1]=a[r]>>8}function R(t,e){var n=new Uint8Array(32),r=new Uint8Array(32);return M(n,t),M(r,e),v(n,0,r,0)}function j(t){var e=new Uint8Array(32);return M(e,t),1&e[0]}function I(t,e){var n;for(n=0;n<16;n++)t[n]=e[2*n]+(e[2*n+1]<<8);t[15]&=32767}function N(t,e,n){for(var r=0;r<16;r++)t[r]=e[r]+n[r]}function D(t,e,n){for(var r=0;r<16;r++)t[r]=e[r]-n[r]}function B(t,e,n){var r,o,i=0,s=0,a=0,c=0,u=0,h=0,f=0,l=0,p=0,d=0,y=0,g=0,v=0,b=0,m=0,_=0,w=0,S=0,k=0,C=0,T=0,P=0,O=0,A=0,E=0,x=0,L=0,U=0,M=0,R=0,j=0,I=n[0],N=n[1],D=n[2],B=n[3],H=n[4],z=n[5],F=n[6],q=n[7],Y=n[8],K=n[9],J=n[10],X=n[11],W=n[12],G=n[13],V=n[14],Z=n[15];i+=(r=e[0])*I,s+=r*N,a+=r*D,c+=r*B,u+=r*H,h+=r*z,f+=r*F,l+=r*q,p+=r*Y,d+=r*K,y+=r*J,g+=r*X,v+=r*W,b+=r*G,m+=r*V,_+=r*Z,s+=(r=e[1])*I,a+=r*N,c+=r*D,u+=r*B,h+=r*H,f+=r*z,l+=r*F,p+=r*q,d+=r*Y,y+=r*K,g+=r*J,v+=r*X,b+=r*W,m+=r*G,_+=r*V,w+=r*Z,a+=(r=e[2])*I,c+=r*N,u+=r*D,h+=r*B,f+=r*H,l+=r*z,p+=r*F,d+=r*q,y+=r*Y,g+=r*K,v+=r*J,b+=r*X,m+=r*W,_+=r*G,w+=r*V,S+=r*Z,c+=(r=e[3])*I,u+=r*N,h+=r*D,f+=r*B,l+=r*H,p+=r*z,d+=r*F,y+=r*q,g+=r*Y,v+=r*K,b+=r*J,m+=r*X,_+=r*W,w+=r*G,S+=r*V,k+=r*Z,u+=(r=e[4])*I,h+=r*N,f+=r*D,l+=r*B,p+=r*H,d+=r*z,y+=r*F,g+=r*q,v+=r*Y,b+=r*K,m+=r*J,_+=r*X,w+=r*W,S+=r*G,k+=r*V,C+=r*Z,h+=(r=e[5])*I,f+=r*N,l+=r*D,p+=r*B,d+=r*H,y+=r*z,g+=r*F,v+=r*q,b+=r*Y,m+=r*K,_+=r*J,w+=r*X,S+=r*W,k+=r*G,C+=r*V,T+=r*Z,f+=(r=e[6])*I,l+=r*N,p+=r*D,d+=r*B,y+=r*H,g+=r*z,v+=r*F,b+=r*q,m+=r*Y,_+=r*K,w+=r*J,S+=r*X,k+=r*W,C+=r*G,T+=r*V,P+=r*Z,l+=(r=e[7])*I,p+=r*N,d+=r*D,y+=r*B,g+=r*H,v+=r*z,b+=r*F,m+=r*q,_+=r*Y,w+=r*K,S+=r*J,k+=r*X,C+=r*W,T+=r*G,P+=r*V,O+=r*Z,p+=(r=e[8])*I,d+=r*N,y+=r*D,g+=r*B,v+=r*H,b+=r*z,m+=r*F,_+=r*q,w+=r*Y,S+=r*K,k+=r*J,C+=r*X,T+=r*W,P+=r*G,O+=r*V,A+=r*Z,d+=(r=e[9])*I,y+=r*N,g+=r*D,v+=r*B,b+=r*H,m+=r*z,_+=r*F,w+=r*q,S+=r*Y,k+=r*K,C+=r*J,T+=r*X,P+=r*W,O+=r*G,A+=r*V,E+=r*Z,y+=(r=e[10])*I,g+=r*N,v+=r*D,b+=r*B,m+=r*H,_+=r*z,w+=r*F,S+=r*q,k+=r*Y,C+=r*K,T+=r*J,P+=r*X,O+=r*W,A+=r*G,E+=r*V,x+=r*Z,g+=(r=e[11])*I,v+=r*N,b+=r*D,m+=r*B,_+=r*H,w+=r*z,S+=r*F,k+=r*q,C+=r*Y,T+=r*K,P+=r*J,O+=r*X,A+=r*W,E+=r*G,x+=r*V,L+=r*Z,v+=(r=e[12])*I,b+=r*N,m+=r*D,_+=r*B,w+=r*H,S+=r*z,k+=r*F,C+=r*q,T+=r*Y,P+=r*K,O+=r*J,A+=r*X,E+=r*W,x+=r*G,L+=r*V,U+=r*Z,b+=(r=e[13])*I,m+=r*N,_+=r*D,w+=r*B,S+=r*H,k+=r*z,C+=r*F,T+=r*q,P+=r*Y,O+=r*K,A+=r*J,E+=r*X,x+=r*W,L+=r*G,U+=r*V,M+=r*Z,m+=(r=e[14])*I,_+=r*N,w+=r*D,S+=r*B,k+=r*H,C+=r*z,T+=r*F,P+=r*q,O+=r*Y,A+=r*K,E+=r*J,x+=r*X,L+=r*W,U+=r*G,M+=r*V,R+=r*Z,_+=(r=e[15])*I,s+=38*(S+=r*D),a+=38*(k+=r*B),c+=38*(C+=r*H),u+=38*(T+=r*z),h+=38*(P+=r*F),f+=38*(O+=r*q),l+=38*(A+=r*Y),p+=38*(E+=r*K),d+=38*(x+=r*J),y+=38*(L+=r*X),g+=38*(U+=r*W),v+=38*(M+=r*G),b+=38*(R+=r*V),m+=38*(j+=r*Z),i=(r=(i+=38*(w+=r*N))+(o=1)+65535)-65536*(o=Math.floor(r/65536)),s=(r=s+o+65535)-65536*(o=Math.floor(r/65536)),a=(r=a+o+65535)-65536*(o=Math.floor(r/65536)),c=(r=c+o+65535)-65536*(o=Math.floor(r/65536)),u=(r=u+o+65535)-65536*(o=Math.floor(r/65536)),h=(r=h+o+65535)-65536*(o=Math.floor(r/65536)),f=(r=f+o+65535)-65536*(o=Math.floor(r/65536)),l=(r=l+o+65535)-65536*(o=Math.floor(r/65536)),p=(r=p+o+65535)-65536*(o=Math.floor(r/65536)),d=(r=d+o+65535)-65536*(o=Math.floor(r/65536)),y=(r=y+o+65535)-65536*(o=Math.floor(r/65536)),g=(r=g+o+65535)-65536*(o=Math.floor(r/65536)),v=(r=v+o+65535)-65536*(o=Math.floor(r/65536)),b=(r=b+o+65535)-65536*(o=Math.floor(r/65536)),m=(r=m+o+65535)-65536*(o=Math.floor(r/65536)),_=(r=_+o+65535)-65536*(o=Math.floor(r/65536)),i=(r=(i+=o-1+37*(o-1))+(o=1)+65535)-65536*(o=Math.floor(r/65536)),s=(r=s+o+65535)-65536*(o=Math.floor(r/65536)),a=(r=a+o+65535)-65536*(o=Math.floor(r/65536)),c=(r=c+o+65535)-65536*(o=Math.floor(r/65536)),u=(r=u+o+65535)-65536*(o=Math.floor(r/65536)),h=(r=h+o+65535)-65536*(o=Math.floor(r/65536)),f=(r=f+o+65535)-65536*(o=Math.floor(r/65536)),l=(r=l+o+65535)-65536*(o=Math.floor(r/65536)),p=(r=p+o+65535)-65536*(o=Math.floor(r/65536)),d=(r=d+o+65535)-65536*(o=Math.floor(r/65536)),y=(r=y+o+65535)-65536*(o=Math.floor(r/65536)),g=(r=g+o+65535)-65536*(o=Math.floor(r/65536)),v=(r=v+o+65535)-65536*(o=Math.floor(r/65536)),b=(r=b+o+65535)-65536*(o=Math.floor(r/65536)),m=(r=m+o+65535)-65536*(o=Math.floor(r/65536)),_=(r=_+o+65535)-65536*(o=Math.floor(r/65536)),i+=o-1+37*(o-1),t[0]=i,t[1]=s,t[2]=a,t[3]=c,t[4]=u,t[5]=h,t[6]=f,t[7]=l,t[8]=p,t[9]=d,t[10]=y,t[11]=g,t[12]=v,t[13]=b,t[14]=m,t[15]=_}function H(t,e){B(t,e,e)}function z(t,n){var r,o=e();for(r=0;r<16;r++)o[r]=n[r];for(r=253;r>=0;r--)H(o,o),2!==r&&4!==r&&B(o,o,n);for(r=0;r<16;r++)t[r]=o[r]}function F(t,n){var r,o=e();for(r=0;r<16;r++)o[r]=n[r];for(r=250;r>=0;r--)H(o,o),1!==r&&B(o,o,n);for(r=0;r<16;r++)t[r]=o[r]}function q(t,n,r){var o,i,s=new Uint8Array(32),a=new Float64Array(80),u=e(),h=e(),f=e(),l=e(),p=e(),d=e();for(i=0;i<31;i++)s[i]=n[i];for(s[31]=127&n[31]|64,s[0]&=248,I(a,r),i=0;i<16;i++)h[i]=a[i],l[i]=u[i]=f[i]=0;for(u[0]=l[0]=1,i=254;i>=0;--i)U(u,h,o=s[i>>>3]>>>(7&i)&1),U(f,l,o),N(p,u,f),D(u,u,f),N(f,h,l),D(h,h,l),H(l,p),H(d,u),B(u,f,u),B(f,h,p),N(p,u,f),D(u,u,f),H(h,u),D(f,l,d),B(u,f,c),N(u,u,l),B(f,f,u),B(u,l,d),B(l,h,a),H(h,p),U(u,h,o),U(f,l,o);for(i=0;i<16;i++)a[i+16]=u[i],a[i+32]=f[i],a[i+48]=h[i],a[i+64]=l[i];var y=a.subarray(32),g=a.subarray(16);return z(y,y),B(g,g,y),M(t,g),0}function Y(t,e){return q(t,e,i)}function K(t,e){return r(e,32),Y(t,e)}function J(t,e,n){var r=new Uint8Array(32);return q(r,n,e),m(t,o,r,_)}T.prototype.blocks=function(t,e,n){for(var r,o,i,s,a,c,u,h,f,l,p,d,y,g,v,b,m,_,w,S=this.fin?0:2048,k=this.h[0],C=this.h[1],T=this.h[2],P=this.h[3],O=this.h[4],A=this.h[5],E=this.h[6],x=this.h[7],L=this.h[8],U=this.h[9],M=this.r[0],R=this.r[1],j=this.r[2],I=this.r[3],N=this.r[4],D=this.r[5],B=this.r[6],H=this.r[7],z=this.r[8],F=this.r[9];n>=16;)l=f=0,l+=(k+=8191&(r=255&t[e+0]|(255&t[e+1])<<8))*M,l+=(C+=8191&(r>>>13|(o=255&t[e+2]|(255&t[e+3])<<8)<<3))*(5*F),l+=(T+=8191&(o>>>10|(i=255&t[e+4]|(255&t[e+5])<<8)<<6))*(5*z),l+=(P+=8191&(i>>>7|(s=255&t[e+6]|(255&t[e+7])<<8)<<9))*(5*H),f=(l+=(O+=8191&(s>>>4|(a=255&t[e+8]|(255&t[e+9])<<8)<<12))*(5*B))>>>13,l&=8191,l+=(A+=a>>>1&8191)*(5*D),l+=(E+=8191&(a>>>14|(c=255&t[e+10]|(255&t[e+11])<<8)<<2))*(5*N),l+=(x+=8191&(c>>>11|(u=255&t[e+12]|(255&t[e+13])<<8)<<5))*(5*I),l+=(L+=8191&(u>>>8|(h=255&t[e+14]|(255&t[e+15])<<8)<<8))*(5*j),p=f+=(l+=(U+=h>>>5|S)*(5*R))>>>13,p+=k*R,p+=C*M,p+=T*(5*F),p+=P*(5*z),f=(p+=O*(5*H))>>>13,p&=8191,p+=A*(5*B),p+=E*(5*D),p+=x*(5*N),p+=L*(5*I),f+=(p+=U*(5*j))>>>13,p&=8191,d=f,d+=k*j,d+=C*R,d+=T*M,d+=P*(5*F),f=(d+=O*(5*z))>>>13,d&=8191,d+=A*(5*H),d+=E*(5*B),d+=x*(5*D),d+=L*(5*N),y=f+=(d+=U*(5*I))>>>13,y+=k*I,y+=C*j,y+=T*R,y+=P*M,f=(y+=O*(5*F))>>>13,y&=8191,y+=A*(5*z),y+=E*(5*H),y+=x*(5*B),y+=L*(5*D),g=f+=(y+=U*(5*N))>>>13,g+=k*N,g+=C*I,g+=T*j,g+=P*R,f=(g+=O*M)>>>13,g&=8191,g+=A*(5*F),g+=E*(5*z),g+=x*(5*H),g+=L*(5*B),v=f+=(g+=U*(5*D))>>>13,v+=k*D,v+=C*N,v+=T*I,v+=P*j,f=(v+=O*R)>>>13,v&=8191,v+=A*M,v+=E*(5*F),v+=x*(5*z),v+=L*(5*H),b=f+=(v+=U*(5*B))>>>13,b+=k*B,b+=C*D,b+=T*N,b+=P*I,f=(b+=O*j)>>>13,b&=8191,b+=A*R,b+=E*M,b+=x*(5*F),b+=L*(5*z),m=f+=(b+=U*(5*H))>>>13,m+=k*H,m+=C*B,m+=T*D,m+=P*N,f=(m+=O*I)>>>13,m&=8191,m+=A*j,m+=E*R,m+=x*M,m+=L*(5*F),_=f+=(m+=U*(5*z))>>>13,_+=k*z,_+=C*H,_+=T*B,_+=P*D,f=(_+=O*N)>>>13,_&=8191,_+=A*I,_+=E*j,_+=x*R,_+=L*M,w=f+=(_+=U*(5*F))>>>13,w+=k*F,w+=C*z,w+=T*H,w+=P*B,f=(w+=O*D)>>>13,w&=8191,w+=A*N,w+=E*I,w+=x*j,w+=L*R,k=l=8191&(f=(f=((f+=(w+=U*M)>>>13)<<2)+f|0)+(l&=8191)|0),C=p+=f>>>=13,T=d&=8191,P=y&=8191,O=g&=8191,A=v&=8191,E=b&=8191,x=m&=8191,L=_&=8191,U=w&=8191,e+=16,n-=16;this.h[0]=k,this.h[1]=C,this.h[2]=T,this.h[3]=P,this.h[4]=O,this.h[5]=A,this.h[6]=E,this.h[7]=x,this.h[8]=L,this.h[9]=U},T.prototype.finish=function(t,e){var n,r,o,i,s=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;i<16;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(n=this.h[1]>>>13,this.h[1]&=8191,i=2;i<10;i++)this.h[i]+=n,n=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*n,n=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=n,n=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=n,s[0]=this.h[0]+5,n=s[0]>>>13,s[0]&=8191,i=1;i<10;i++)s[i]=this.h[i]+n,n=s[i]>>>13,s[i]&=8191;for(s[9]-=8192,r=(1^n)-1,i=0;i<10;i++)s[i]&=r;for(r=~r,i=0;i<10;i++)this.h[i]=this.h[i]&r|s[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),o=this.h[0]+this.pad[0],this.h[0]=65535&o,i=1;i<8;i++)o=(this.h[i]+this.pad[i]|0)+(o>>>16)|0,this.h[i]=65535&o;t[e+0]=this.h[0]>>>0&255,t[e+1]=this.h[0]>>>8&255,t[e+2]=this.h[1]>>>0&255,t[e+3]=this.h[1]>>>8&255,t[e+4]=this.h[2]>>>0&255,t[e+5]=this.h[2]>>>8&255,t[e+6]=this.h[3]>>>0&255,t[e+7]=this.h[3]>>>8&255,t[e+8]=this.h[4]>>>0&255,t[e+9]=this.h[4]>>>8&255,t[e+10]=this.h[5]>>>0&255,t[e+11]=this.h[5]>>>8&255,t[e+12]=this.h[6]>>>0&255,t[e+13]=this.h[6]>>>8&255,t[e+14]=this.h[7]>>>0&255,t[e+15]=this.h[7]>>>8&255},T.prototype.update=function(t,e,n){var r,o;if(this.leftover){for((o=16-this.leftover)>n&&(o=n),r=0;r=16&&(o=n-n%16,this.blocks(t,e,o),e+=o,n-=o),n){for(r=0;r=128;){for(S=0;S<16;S++)k=8*S+W,x[S]=n[k+0]<<24|n[k+1]<<16|n[k+2]<<8|n[k+3],L[S]=n[k+4]<<24|n[k+5]<<16|n[k+6]<<8|n[k+7];for(S=0;S<80;S++)if(o=U,i=M,s=R,a=j,c=I,u=N,h=D,B,l=H,p=z,d=F,y=q,g=Y,v=K,b=J,X,P=65535&(T=X),O=T>>>16,A=65535&(C=B),E=C>>>16,P+=65535&(T=(Y>>>14|I<<18)^(Y>>>18|I<<14)^(I>>>9|Y<<23)),O+=T>>>16,A+=65535&(C=(I>>>14|Y<<18)^(I>>>18|Y<<14)^(Y>>>9|I<<23)),E+=C>>>16,P+=65535&(T=Y&K^~Y&J),O+=T>>>16,A+=65535&(C=I&N^~I&D),E+=C>>>16,P+=65535&(T=G[2*S+1]),O+=T>>>16,A+=65535&(C=G[2*S]),E+=C>>>16,C=x[S%16],O+=(T=L[S%16])>>>16,A+=65535&C,E+=C>>>16,A+=(O+=(P+=65535&T)>>>16)>>>16,P=65535&(T=w=65535&P|O<<16),O=T>>>16,A=65535&(C=_=65535&A|(E+=A>>>16)<<16),E=C>>>16,P+=65535&(T=(H>>>28|U<<4)^(U>>>2|H<<30)^(U>>>7|H<<25)),O+=T>>>16,A+=65535&(C=(U>>>28|H<<4)^(H>>>2|U<<30)^(H>>>7|U<<25)),E+=C>>>16,O+=(T=H&z^H&F^z&F)>>>16,A+=65535&(C=U&M^U&R^M&R),E+=C>>>16,f=65535&(A+=(O+=(P+=65535&T)>>>16)>>>16)|(E+=A>>>16)<<16,m=65535&P|O<<16,P=65535&(T=y),O=T>>>16,A=65535&(C=a),E=C>>>16,O+=(T=w)>>>16,A+=65535&(C=_),E+=C>>>16,M=o,R=i,j=s,I=a=65535&(A+=(O+=(P+=65535&T)>>>16)>>>16)|(E+=A>>>16)<<16,N=c,D=u,B=h,U=f,z=l,F=p,q=d,Y=y=65535&P|O<<16,K=g,J=v,X=b,H=m,S%16==15)for(k=0;k<16;k++)C=x[k],P=65535&(T=L[k]),O=T>>>16,A=65535&C,E=C>>>16,C=x[(k+9)%16],P+=65535&(T=L[(k+9)%16]),O+=T>>>16,A+=65535&C,E+=C>>>16,_=x[(k+1)%16],P+=65535&(T=((w=L[(k+1)%16])>>>1|_<<31)^(w>>>8|_<<24)^(w>>>7|_<<25)),O+=T>>>16,A+=65535&(C=(_>>>1|w<<31)^(_>>>8|w<<24)^_>>>7),E+=C>>>16,_=x[(k+14)%16],O+=(T=((w=L[(k+14)%16])>>>19|_<<13)^(_>>>29|w<<3)^(w>>>6|_<<26))>>>16,A+=65535&(C=(_>>>19|w<<13)^(w>>>29|_<<3)^_>>>6),E+=C>>>16,E+=(A+=(O+=(P+=65535&T)>>>16)>>>16)>>>16,x[k]=65535&A|E<<16,L[k]=65535&P|O<<16;P=65535&(T=H),O=T>>>16,A=65535&(C=U),E=C>>>16,C=t[0],O+=(T=e[0])>>>16,A+=65535&C,E+=C>>>16,E+=(A+=(O+=(P+=65535&T)>>>16)>>>16)>>>16,t[0]=U=65535&A|E<<16,e[0]=H=65535&P|O<<16,P=65535&(T=z),O=T>>>16,A=65535&(C=M),E=C>>>16,C=t[1],O+=(T=e[1])>>>16,A+=65535&C,E+=C>>>16,E+=(A+=(O+=(P+=65535&T)>>>16)>>>16)>>>16,t[1]=M=65535&A|E<<16,e[1]=z=65535&P|O<<16,P=65535&(T=F),O=T>>>16,A=65535&(C=R),E=C>>>16,C=t[2],O+=(T=e[2])>>>16,A+=65535&C,E+=C>>>16,E+=(A+=(O+=(P+=65535&T)>>>16)>>>16)>>>16,t[2]=R=65535&A|E<<16,e[2]=F=65535&P|O<<16,P=65535&(T=q),O=T>>>16,A=65535&(C=j),E=C>>>16,C=t[3],O+=(T=e[3])>>>16,A+=65535&C,E+=C>>>16,E+=(A+=(O+=(P+=65535&T)>>>16)>>>16)>>>16,t[3]=j=65535&A|E<<16,e[3]=q=65535&P|O<<16,P=65535&(T=Y),O=T>>>16,A=65535&(C=I),E=C>>>16,C=t[4],O+=(T=e[4])>>>16,A+=65535&C,E+=C>>>16,E+=(A+=(O+=(P+=65535&T)>>>16)>>>16)>>>16,t[4]=I=65535&A|E<<16,e[4]=Y=65535&P|O<<16,P=65535&(T=K),O=T>>>16,A=65535&(C=N),E=C>>>16,C=t[5],O+=(T=e[5])>>>16,A+=65535&C,E+=C>>>16,E+=(A+=(O+=(P+=65535&T)>>>16)>>>16)>>>16,t[5]=N=65535&A|E<<16,e[5]=K=65535&P|O<<16,P=65535&(T=J),O=T>>>16,A=65535&(C=D),E=C>>>16,C=t[6],O+=(T=e[6])>>>16,A+=65535&C,E+=C>>>16,E+=(A+=(O+=(P+=65535&T)>>>16)>>>16)>>>16,t[6]=D=65535&A|E<<16,e[6]=J=65535&P|O<<16,P=65535&(T=X),O=T>>>16,A=65535&(C=B),E=C>>>16,C=t[7],O+=(T=e[7])>>>16,A+=65535&C,E+=C>>>16,E+=(A+=(O+=(P+=65535&T)>>>16)>>>16)>>>16,t[7]=B=65535&A|E<<16,e[7]=X=65535&P|O<<16,W+=128,r-=128}return r}function Z(t,e,n){var r,o=new Int32Array(8),i=new Int32Array(8),s=new Uint8Array(256),a=n;for(o[0]=1779033703,o[1]=3144134277,o[2]=1013904242,o[3]=2773480762,o[4]=1359893119,o[5]=2600822924,o[6]=528734635,o[7]=1541459225,i[0]=4089235720,i[1]=2227873595,i[2]=4271175723,i[3]=1595750129,i[4]=2917565137,i[5]=725511199,i[6]=4215389547,i[7]=327033209,V(o,i,e,n),n%=128,r=0;r=0;--o)$(t,e,r=n[o/8|0]>>(7&o)&1),Q(e,t),Q(t,t),$(t,e,r)}function nt(t,n){var r=[e(),e(),e(),e()];x(r[0],f),x(r[1],l),x(r[2],a),B(r[3],f,l),et(t,r,n)}function rt(t,n,o){var i,s=new Uint8Array(64),a=[e(),e(),e(),e()];for(o||r(n,32),Z(s,n,32),s[0]&=248,s[31]&=127,s[31]|=64,nt(a,s),tt(t,a),i=0;i<32;i++)n[i+32]=t[i];return 0}var ot=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function it(t,e){var n,r,o,i;for(r=63;r>=32;--r){for(n=0,o=r-32,i=r-12;o>4)*ot[o],n=e[o]>>8,e[o]&=255;for(o=0;o<32;o++)e[o]-=n*ot[o];for(r=0;r<32;r++)e[r+1]+=e[r]>>8,t[r]=255&e[r]}function st(t){var e,n=new Float64Array(64);for(e=0;e<64;e++)n[e]=t[e];for(e=0;e<64;e++)t[e]=0;it(t,n)}function at(t,n,r,o){var i,s,a=new Uint8Array(64),c=new Uint8Array(64),u=new Uint8Array(64),h=new Float64Array(64),f=[e(),e(),e(),e()];Z(a,o,32),a[0]&=248,a[31]&=127,a[31]|=64;var l=r+64;for(i=0;i>7&&D(t[0],s,t[0]),B(t[3],t[0],t[1]),0)}(l,o))return-1;for(i=0;i=0},t.sign.keyPair=function(){var t=new Uint8Array(32),e=new Uint8Array(64);return rt(t,e),{publicKey:t,secretKey:e}},t.sign.keyPair.fromSecretKey=function(t){if(ht(t),64!==t.length)throw new Error("bad secret key size");for(var e=new Uint8Array(32),n=0;n>>6)+r(128|63&e):r(224|e>>>12&15)+r(128|e>>>6&63)+r(128|63&e)},h=function(t){return t.replace(/[^\x00-\x7F]/g,u)},f=function(t){var e=[0,2,1][t.length%3],n=t.charCodeAt(0)<<16|(t.length>1?t.charCodeAt(1):0)<<8|(t.length>2?t.charCodeAt(2):0);return[o.charAt(n>>>18),o.charAt(n>>>12&63),e>=2?"=":o.charAt(n>>>6&63),e>=1?"=":o.charAt(63&n)].join("")},l=self.btoa||function(t){return t.replace(/[\s\S]{1,3}/g,f)},p=function(){function t(t,e,n,r){var o=this;this.clear=e,this.timer=t((function(){o.timer&&(o.timer=r(o.timer))}),n)}return t.prototype.isRunning=function(){return null!==this.timer},t.prototype.ensureAborted=function(){this.timer&&(this.clear(this.timer),this.timer=null)},t}(),d=(c=function(t,e){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}c(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});function y(t){self.clearTimeout(t)}function g(t){self.clearInterval(t)}var v=function(t){function e(e,n){return t.call(this,setTimeout,y,e,(function(t){return n(),null}))||this}return d(e,t),e}(p),b=function(t){function e(e,n){return t.call(this,setInterval,g,e,(function(t){return n(),t}))||this}return d(e,t),e}(p),m={now:function(){return Date.now?Date.now():(new Date).valueOf()},defer:function(t){return new v(0,t)},method:function(t){for(var e=[],n=1;n0)for(r=0;r=1002&&t.code<=1004?"backoff":null:4e3===t.code?"tls_only":t.code<4100?"refused":t.code<4200?"backoff":t.code<4300?"retry":"refused"},getCloseError:function(t){return 1e3!==t.code&&1001!==t.code?{type:"PusherError",data:{code:t.code,message:t.reason||t.message}}:null}},$=Q,tt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),et=function(t){function e(e,n){var r=t.call(this)||this;return r.id=e,r.transport=n,r.activityTimeout=n.activityTimeout,r.bindListeners(),r}return tt(e,t),e.prototype.handlesActivityChecks=function(){return this.transport.handlesActivityChecks()},e.prototype.send=function(t){return this.transport.send(t)},e.prototype.send_event=function(t,e,n){var r={event:t,data:e};return n&&(r.channel=n),z.debug("Event sent",r),this.send($.encodeMessage(r))},e.prototype.ping=function(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})},e.prototype.close=function(){this.transport.close()},e.prototype.bindListeners=function(){var t=this,e={message:function(e){var n;try{n=$.decodeMessage(e)}catch(n){t.emit("error",{type:"MessageParseError",error:n,data:e.data})}if(void 0!==n){switch(z.debug("Event recd",n),n.event){case"pusher:error":t.emit("error",{type:"PusherError",data:n.data});break;case"pusher:ping":t.emit("ping");break;case"pusher:pong":t.emit("pong")}t.emit("message",n)}},activity:function(){t.emit("activity")},error:function(e){t.emit("error",e)},closed:function(e){n(),e&&e.code&&t.handleCloseEvent(e),t.transport=null,t.emit("closed")}},n=function(){k(e,(function(e,n){t.transport.unbind(n,e)}))};k(e,(function(e,n){t.transport.bind(n,e)}))},e.prototype.handleCloseEvent=function(t){var e=$.getCloseAction(t),n=$.getCloseError(t);n&&this.emit("error",n),e&&this.emit(e,{action:e,error:n})},e}(H),nt=function(){function t(t,e){this.transport=t,this.callback=e,this.bindListeners()}return t.prototype.close=function(){this.unbindListeners(),this.transport.close()},t.prototype.bindListeners=function(){var t=this;this.onMessage=function(e){var n;t.unbindListeners();try{n=$.processHandshake(e)}catch(e){return t.finish("error",{error:e}),void t.transport.close()}"connected"===n.action?t.finish("connected",{connection:new et(n.id,t.transport),activityTimeout:n.activityTimeout}):(t.finish(n.action,{error:n.error}),t.transport.close())},this.onClosed=function(e){t.unbindListeners();var n=$.getCloseAction(e)||"backoff",r=$.getCloseError(e);t.finish(n,{error:r})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)},t.prototype.unbindListeners=function(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)},t.prototype.finish=function(t,e){this.callback(_({transport:this.transport,action:t},e))},t}(),rt=function(){function t(t,e){this.channel=t;var n=e.authTransport;if(void 0===oe.getAuthorizers()[n])throw"'"+n+"' is not a recognized auth transport";this.type=n,this.options=e,this.authOptions=e.auth||{}}return t.prototype.composeQuery=function(t){var e="socket_id="+encodeURIComponent(t)+"&channel_name="+encodeURIComponent(this.channel.name);for(var n in this.authOptions.params)e+="&"+encodeURIComponent(n)+"="+encodeURIComponent(this.authOptions.params[n]);return e},t.prototype.authorize=function(e,n){t.authorizers=t.authorizers||oe.getAuthorizers(),t.authorizers[this.type].call(this,oe,e,n)},t}(),ot=function(){function t(t,e){this.timeline=t,this.options=e||{}}return t.prototype.send=function(t,e){this.timeline.isEmpty()||this.timeline.send(oe.TimelineTransport.getAgent(this,t),e)},t}(),it=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),st=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return Object.setPrototypeOf(r,n.prototype),r}return it(e,t),e}(Error),at=(function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return Object.setPrototypeOf(r,n.prototype),r}it(e,t)}(Error),function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return Object.setPrototypeOf(r,n.prototype),r}return it(e,t),e}(Error)),ct=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return Object.setPrototypeOf(r,n.prototype),r}return it(e,t),e}(Error),ut=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return Object.setPrototypeOf(r,n.prototype),r}return it(e,t),e}(Error),ht=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return Object.setPrototypeOf(r,n.prototype),r}return it(e,t),e}(Error),ft=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return Object.setPrototypeOf(r,n.prototype),r}return it(e,t),e}(Error),lt=function(t){function e(e,n){var r=this.constructor,o=t.call(this,n)||this;return o.status=e,Object.setPrototypeOf(o,r.prototype),o}return it(e,t),e}(Error),pt={baseUrl:"https://pusher.com",urls:{authenticationEndpoint:{path:"/docs/authenticating_users"},javascriptQuickStart:{path:"/docs/javascript_quick_start"},triggeringClientEvents:{path:"/docs/client_api_guide/client_events#trigger-events"},encryptedChannelSupport:{fullUrl:"https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support"}}},dt=function(t){var e,n=pt.urls[t];return n?(n.fullUrl?e=n.fullUrl:n.path&&(e=pt.baseUrl+n.path),e?"See: "+e:""):""},yt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),gt=function(t){function e(e,n){var r=t.call(this,(function(t,n){z.debug("No callbacks on "+e+" for "+t)}))||this;return r.name=e,r.pusher=n,r.subscribed=!1,r.subscriptionPending=!1,r.subscriptionCancelled=!1,r}return yt(e,t),e.prototype.authorize=function(t,e){return e(null,{auth:""})},e.prototype.trigger=function(t,e){if(0!==t.indexOf("client-"))throw new st("Event '"+t+"' does not start with 'client-'");if(!this.subscribed){var n=dt("triggeringClientEvents");z.warn("Client event triggered before channel 'subscription_succeeded' event . "+n)}return this.pusher.send_event(t,e,this.name)},e.prototype.disconnect=function(){this.subscribed=!1,this.subscriptionPending=!1},e.prototype.handleEvent=function(t){var e=t.event,n=t.data;if("pusher_internal:subscription_succeeded"===e)this.handleSubscriptionSucceededEvent(t);else if(0!==e.indexOf("pusher_internal:")){this.emit(e,n,{})}},e.prototype.handleSubscriptionSucceededEvent=function(t){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",t.data)},e.prototype.subscribe=function(){var t=this;this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,(function(e,n){e?(z.error(e.toString()),t.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:e.message},e instanceof lt?{status:e.status}:{}))):t.pusher.send_event("pusher:subscribe",{auth:n.auth,channel_data:n.channel_data,channel:t.name})})))},e.prototype.unsubscribe=function(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})},e.prototype.cancelSubscription=function(){this.subscriptionCancelled=!0},e.prototype.reinstateSubscription=function(){this.subscriptionCancelled=!1},e}(H),vt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),bt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return vt(e,t),e.prototype.authorize=function(t,e){return Et.createAuthorizer(this,this.pusher.config).authorize(t,e)},e}(gt),mt=function(){function t(){this.reset()}return t.prototype.get=function(t){return Object.prototype.hasOwnProperty.call(this.members,t)?{id:t,info:this.members[t]}:null},t.prototype.each=function(t){var e=this;k(this.members,(function(n,r){t(e.get(r))}))},t.prototype.setMyID=function(t){this.myID=t},t.prototype.onSubscription=function(t){this.members=t.presence.hash,this.count=t.presence.count,this.me=this.get(this.myID)},t.prototype.addMember=function(t){return null===this.get(t.user_id)&&this.count++,this.members[t.user_id]=t.user_info,this.get(t.user_id)},t.prototype.removeMember=function(t){var e=this.get(t.user_id);return e&&(delete this.members[t.user_id],this.count--),e},t.prototype.reset=function(){this.members={},this.count=0,this.myID=null,this.me=null},t}(),_t=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),wt=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.members=new mt,r}return _t(e,t),e.prototype.authorize=function(e,n){var r=this;t.prototype.authorize.call(this,e,(function(t,e){if(!t){if(void 0===(e=e).channel_data){var o=dt("authenticationEndpoint");return z.error("Invalid auth response for channel '"+r.name+"',expected 'channel_data' field. "+o),void n("Invalid auth response")}var i=JSON.parse(e.channel_data);r.members.setMyID(i.user_id)}n(t,e)}))},e.prototype.handleEvent=function(t){var e=t.event;if(0===e.indexOf("pusher_internal:"))this.handleInternalEvent(t);else{var n=t.data,r={};t.user_id&&(r.user_id=t.user_id),this.emit(e,n,r)}},e.prototype.handleInternalEvent=function(t){var e=t.event,n=t.data;switch(e){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(t);break;case"pusher_internal:member_added":var r=this.members.addMember(n);this.emit("pusher:member_added",r);break;case"pusher_internal:member_removed":var o=this.members.removeMember(n);o&&this.emit("pusher:member_removed",o)}},e.prototype.handleSubscriptionSucceededEvent=function(t){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(t.data),this.emit("pusher:subscription_succeeded",this.members))},e.prototype.disconnect=function(){this.members.reset(),t.prototype.disconnect.call(this)},e}(bt),St=n(1),kt=n(0),Ct=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Tt=function(t){function e(e,n,r){var o=t.call(this,e,n)||this;return o.key=null,o.nacl=r,o}return Ct(e,t),e.prototype.authorize=function(e,n){var r=this;t.prototype.authorize.call(this,e,(function(t,e){if(t)n(t,e);else{var o=e.shared_secret;o?(r.key=Object(kt.decode)(o),delete e.shared_secret,n(null,e)):n(new Error("No shared_secret key in auth payload for encrypted channel: "+r.name),null)}}))},e.prototype.trigger=function(t,e){throw new ut("Client events are not currently supported for encrypted channels")},e.prototype.handleEvent=function(e){var n=e.event,r=e.data;0!==n.indexOf("pusher_internal:")&&0!==n.indexOf("pusher:")?this.handleEncryptedEvent(n,r):t.prototype.handleEvent.call(this,e)},e.prototype.handleEncryptedEvent=function(t,e){var n=this;if(this.key)if(e.ciphertext&&e.nonce){var r=Object(kt.decode)(e.ciphertext);if(r.length0&&this.emit("connecting_in",Math.round(t/1e3)),this.retryTimer=new v(t||0,(function(){e.disconnectInternally(),e.connect()}))},e.prototype.clearRetryTimer=function(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)},e.prototype.setUnavailableTimer=function(){var t=this;this.unavailableTimer=new v(this.options.unavailableTimeout,(function(){t.updateState("unavailable")}))},e.prototype.clearUnavailableTimer=function(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()},e.prototype.sendActivityCheck=function(){var t=this;this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new v(this.options.pongTimeout,(function(){t.timeline.error({pong_timed_out:t.options.pongTimeout}),t.retryIn(0)}))},e.prototype.resetActivityCheck=function(){var t=this;this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new v(this.activityTimeout,(function(){t.sendActivityCheck()})))},e.prototype.stopActivityCheck=function(){this.activityTimer&&this.activityTimer.ensureAborted()},e.prototype.buildConnectionCallbacks=function(t){var e=this;return _({},t,{message:function(t){e.resetActivityCheck(),e.emit("message",t)},ping:function(){e.send_event("pusher:pong",{})},activity:function(){e.resetActivityCheck()},error:function(t){e.emit("error",t)},closed:function(){e.abandonConnection(),e.shouldRetry()&&e.retryIn(1e3)}})},e.prototype.buildHandshakeCallbacks=function(t){var e=this;return _({},t,{connected:function(t){e.activityTimeout=Math.min(e.options.activityTimeout,t.activityTimeout,t.connection.activityTimeout||1/0),e.clearUnavailableTimer(),e.setConnection(t.connection),e.socket_id=e.connection.id,e.updateState("connected",{socket_id:e.socket_id})}})},e.prototype.buildErrorCallbacks=function(){var t=this,e=function(e){return function(n){n.error&&t.emit("error",{type:"WebSocketError",error:n.error}),e(n)}};return{tls_only:e((function(){t.usingTLS=!0,t.updateStrategy(),t.retryIn(0)})),refused:e((function(){t.disconnect()})),backoff:e((function(){t.retryIn(1e3)})),retry:e((function(){t.retryIn(0)}))}},e.prototype.setConnection=function(t){for(var e in this.connection=t,this.connectionCallbacks)this.connection.bind(e,this.connectionCallbacks[e]);this.resetActivityCheck()},e.prototype.abandonConnection=function(){if(this.connection){for(var t in this.stopActivityCheck(),this.connectionCallbacks)this.connection.unbind(t,this.connectionCallbacks[t]);var e=this.connection;return this.connection=null,e}},e.prototype.updateState=function(t,e){var n=this.state;if(this.state=t,n!==t){var r=t;"connected"===r&&(r+=" with new socket ID "+e.socket_id),z.debug("State changed",n+" -> "+r),this.timeline.info({state:t,params:e}),this.emit("state_change",{previous:n,current:t}),this.emit(t,e)}},e.prototype.shouldRetry=function(){return"connecting"===this.state||"connected"===this.state},e}(H),At=function(){function t(){this.channels={}}return t.prototype.add=function(t,e){return this.channels[t]||(this.channels[t]=function(t,e){if(0===t.indexOf("private-encrypted-")){if(e.config.nacl)return Et.createEncryptedChannel(t,e,e.config.nacl);var n=dt("encryptedChannelSupport");throw new ut("Tried to subscribe to a private-encrypted- channel but no nacl implementation available. "+n)}return 0===t.indexOf("private-")?Et.createPrivateChannel(t,e):0===t.indexOf("presence-")?Et.createPresenceChannel(t,e):Et.createChannel(t,e)}(t,e)),this.channels[t]},t.prototype.all=function(){return function(t){var e=[];return k(t,(function(t){e.push(t)})),e}(this.channels)},t.prototype.find=function(t){return this.channels[t]},t.prototype.remove=function(t){var e=this.channels[t];return delete this.channels[t],e},t.prototype.disconnect=function(){k(this.channels,(function(t){t.disconnect()}))},t}();var Et={createChannels:function(){return new At},createConnectionManager:function(t,e){return new Ot(t,e)},createChannel:function(t,e){return new gt(t,e)},createPrivateChannel:function(t,e){return new bt(t,e)},createPresenceChannel:function(t,e){return new wt(t,e)},createEncryptedChannel:function(t,e,n){return new Tt(t,e,n)},createTimelineSender:function(t,e){return new ot(t,e)},createAuthorizer:function(t,e){return e.authorizer?e.authorizer(t,e):new rt(t,e)},createHandshake:function(t,e){return new nt(t,e)},createAssistantToTheTransportManager:function(t,e,n){return new Z(t,e,n)}},xt=function(){function t(t){this.options=t||{},this.livesLeft=this.options.lives||1/0}return t.prototype.getAssistant=function(t){return Et.createAssistantToTheTransportManager(this,t,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})},t.prototype.isAlive=function(){return this.livesLeft>0},t.prototype.reportDeath=function(){this.livesLeft-=1},t}(),Lt=function(){function t(t,e){this.strategies=t,this.loop=Boolean(e.loop),this.failFast=Boolean(e.failFast),this.timeout=e.timeout,this.timeoutLimit=e.timeoutLimit}return t.prototype.isSupported=function(){return E(this.strategies,m.method("isSupported"))},t.prototype.connect=function(t,e){var n=this,r=this.strategies,o=0,i=this.timeout,s=null,a=function(c,u){u?e(null,u):(o+=1,n.loop&&(o%=r.length),o0&&(o=new v(n.timeout,(function(){i.abort(),r(!0)}))),i=t.connect(e,(function(t,e){t&&o&&o.isRunning()&&!n.failFast||(o&&o.ensureAborted(),r(t,e))})),{abort:function(){o&&o.ensureAborted(),i.abort()},forceMinPriority:function(t){i.forceMinPriority(t)}}},t}(),Ut=function(){function t(t){this.strategies=t}return t.prototype.isSupported=function(){return E(this.strategies,m.method("isSupported"))},t.prototype.connect=function(t,e){return function(t,e,n){var r=P(t,(function(t,r,o,i){return t.connect(e,n(r,i))}));return{abort:function(){T(r,Mt)},forceMinPriority:function(t){T(r,(function(e){e.forceMinPriority(t)}))}}}(this.strategies,t,(function(t,n){return function(r,o){n[t].error=r,r?function(t){return function(t,e){for(var n=0;n=m.now()){var i=this.transports[r.transport];i&&(this.timeline.info({cached:!0,transport:r.transport,latency:r.latency}),o.push(new Lt([i],{timeout:2*r.latency+1e3,failFast:!0})))}var s=m.now(),a=o.pop().connect(t,(function r(i,c){i?(It(n),o.length>0?(s=m.now(),a=o.pop().connect(t,r)):e(i)):(!function(t,e,n){var r=oe.getLocalStorage();if(r)try{r[jt(t)]=U({timestamp:m.now(),transport:e,latency:n})}catch(t){}}(n,c.transport.name,m.now()-s),e(null,c))}));return{abort:function(){a.abort()},forceMinPriority:function(e){t=e,a&&a.forceMinPriority(e)}}},t}();function jt(t){return"pusherTransport"+(t?"TLS":"NonTLS")}function It(t){var e=oe.getLocalStorage();if(e)try{delete e[jt(t)]}catch(t){}}var Nt=function(){function t(t,e){var n=e.delay;this.strategy=t,this.options={delay:n}}return t.prototype.isSupported=function(){return this.strategy.isSupported()},t.prototype.connect=function(t,e){var n,r=this.strategy,o=new v(this.options.delay,(function(){n=r.connect(t,e)}));return{abort:function(){o.ensureAborted(),n&&n.abort()},forceMinPriority:function(e){t=e,n&&n.forceMinPriority(e)}}},t}(),Dt=function(){function t(t,e,n){this.test=t,this.trueBranch=e,this.falseBranch=n}return t.prototype.isSupported=function(){return(this.test()?this.trueBranch:this.falseBranch).isSupported()},t.prototype.connect=function(t,e){return(this.test()?this.trueBranch:this.falseBranch).connect(t,e)},t}(),Bt=function(){function t(t){this.strategy=t}return t.prototype.isSupported=function(){return this.strategy.isSupported()},t.prototype.connect=function(t,e){var n=this.strategy.connect(t,(function(t,r){r&&n.abort(),e(t,r)}));return n},t}();function Ht(t){return function(){return t.isSupported()}}var zt,Ft=function(t,e,n){var r={};function o(e,o,i,s,a){var c=n(t,e,o,i,s,a);return r[e]=c,c}var i,s=Object.assign({},e,{hostNonTLS:t.wsHost+":"+t.wsPort,hostTLS:t.wsHost+":"+t.wssPort,httpPath:t.wsPath}),a=_({},s,{useTLS:!0}),c=Object.assign({},e,{hostNonTLS:t.httpHost+":"+t.httpPort,hostTLS:t.httpHost+":"+t.httpsPort,httpPath:t.httpPath}),u={loop:!0,timeout:15e3,timeoutLimit:6e4},h=new xt({lives:2,minPingDelay:1e4,maxPingDelay:t.activityTimeout}),f=new xt({lives:2,minPingDelay:1e4,maxPingDelay:t.activityTimeout}),l=o("ws","ws",3,s,h),p=o("wss","ws",3,a,h),d=o("xhr_streaming","xhr_streaming",1,c,f),y=o("xhr_polling","xhr_polling",1,c),g=new Lt([l],u),v=new Lt([p],u),b=new Lt([d],u),m=new Lt([y],u),w=new Lt([new Dt(Ht(b),new Ut([b,new Nt(m,{delay:4e3})]),m)],u);return i=e.useTLS?new Ut([g,new Nt(w,{delay:2e3})]):new Ut([g,new Nt(v,{delay:2e3}),new Nt(w,{delay:5e3})]),new Rt(new Bt(new Dt(Ht(l),i,w)),r,{ttl:18e5,timeline:e.timeline,useTLS:e.useTLS})},qt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Yt=function(t){function e(e,n,r){var o=t.call(this)||this;return o.hooks=e,o.method=n,o.url=r,o}return qt(e,t),e.prototype.start=function(t){var e=this;this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=function(){e.close()},oe.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(t)},e.prototype.close=function(){this.unloader&&(oe.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)},e.prototype.onChunk=function(t,e){for(;;){var n=this.advanceBuffer(e);if(!n)break;this.emit("chunk",{status:t,data:n})}this.isBufferTooLong(e)&&this.emit("buffer_too_long")},e.prototype.advanceBuffer=function(t){var e=t.slice(this.position),n=e.indexOf("\n");return-1!==n?(this.position+=n+1,e.slice(0,n)):null},e.prototype.isBufferTooLong=function(t){return this.position===t.length&&t.length>262144},e}(H);!function(t){t[t.CONNECTING=0]="CONNECTING",t[t.OPEN=1]="OPEN",t[t.CLOSED=3]="CLOSED"}(zt||(zt={}));var Kt=zt,Jt=1;function Xt(t){var e=-1===t.indexOf("?")?"?":"&";return t+e+"t="+ +new Date+"&n="+Jt++}function Wt(t){return Math.floor(Math.random()*t)}var Gt,Vt=function(){function t(t,e){this.hooks=t,this.session=Wt(1e3)+"/"+function(t){for(var e=[],n=0;n0&&t.onChunk(e.status,e.responseText);break;case 4:e.responseText&&e.responseText.length>0&&t.onChunk(e.status,e.responseText),t.emit("finished",e.status),t.close()}},e},abortRequest:function(t){t.onreadystatechange=null,t.abort()}},te={getDefaultStrategy:Ft,Transports:V,transportConnectionInitializer:function(){this.timeline.info(this.buildTimelineMessage({transport:this.name+(this.options.useTLS?"s":"")})),this.hooks.isInitialized()?this.changeState("initialized"):this.onClose()},HTTPFactory:{createStreamingSocket:function(t){return this.createSocket(Zt,t)},createPollingSocket:function(t){return this.createSocket(Qt,t)},createSocket:function(t,e){return new Vt(t,e)},createXHR:function(t,e){return this.createRequest($t,t,e)},createRequest:function(t,e,n){return new Yt(t,e,n)}},setup:function(t){t.ready()},getLocalStorage:function(){},getClientFeatures:function(){return C(A({ws:V.ws},(function(t){return t.isSupported({})})))},getProtocol:function(){return"http:"},isXHRSupported:function(){return!0},createSocketRequest:function(t,e){if(this.isXHRSupported())return this.HTTPFactory.createXHR(t,e);throw"Cross-origin HTTP requests are not supported"},createXHR:function(){return new(this.getXHRAPI())},createWebSocket:function(t){return new(this.getWebSocketAPI())(t)},addUnloadListener:function(t){},removeUnloadListener:function(t){}},ee=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ne=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ee(e,t),e.prototype.isOnline=function(){return!0},e}(H)),re=function(t,e,n){var r=new Headers;for(var o in r.set("Content-Type","application/x-www-form-urlencoded"),this.authOptions.headers)r.set(o,this.authOptions.headers[o]);var i=this.composeQuery(e),s=new Request(this.options.authEndpoint,{headers:r,body:i,credentials:"same-origin",method:"POST"});return fetch(s).then((function(t){var e=t.status;if(200===e)return t.text();throw new lt(200,"Could not get auth info from your auth endpoint, status: "+e)})).then((function(t){var e;try{e=JSON.parse(t)}catch(e){throw new lt(200,"JSON returned from auth endpoint was invalid, yet status code was 200. Data was: "+t)}n(null,e)})).catch((function(t){n(t,{auth:""})}))},oe={getDefaultStrategy:te.getDefaultStrategy,Transports:te.Transports,setup:te.setup,getProtocol:te.getProtocol,isXHRSupported:te.isXHRSupported,getLocalStorage:te.getLocalStorage,createXHR:te.createXHR,createWebSocket:te.createWebSocket,addUnloadListener:te.addUnloadListener,removeUnloadListener:te.removeUnloadListener,transportConnectionInitializer:te.transportConnectionInitializer,createSocketRequest:te.createSocketRequest,HTTPFactory:te.HTTPFactory,TimelineTransport:{name:"xhr",getAgent:function(t,e){return function(n,r){var o="http"+(e?"s":"")+"://"+(t.host||t.options.host)+t.options.path,i=L(n);fetch(o+="/2?"+i).then((function(t){if(200!==t.status)throw"received "+t.status+" from stats.pusher.com";return t.json()})).then((function(e){var n=e.host;n&&(t.host=n)})).catch((function(t){z.debug("TimelineSender Error: ",t)}))}}},getAuthorizers:function(){return{ajax:re}},getWebSocketAPI:function(){return WebSocket},getXHRAPI:function(){return XMLHttpRequest},getNetwork:function(){return ne}};!function(t){t[t.ERROR=3]="ERROR",t[t.INFO=6]="INFO",t[t.DEBUG=7]="DEBUG"}(Gt||(Gt={}));var ie=Gt,se=function(){function t(t,e,n){this.key=t,this.session=e,this.events=[],this.options=n||{},this.sent=0,this.uniqueID=0}return t.prototype.log=function(t,e){t<=this.options.level&&(this.events.push(_({},e,{timestamp:m.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())},t.prototype.error=function(t){this.log(ie.ERROR,t)},t.prototype.info=function(t){this.log(ie.INFO,t)},t.prototype.debug=function(t){this.log(ie.DEBUG,t)},t.prototype.isEmpty=function(){return 0===this.events.length},t.prototype.send=function(t,e){var n=this,r=_({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],t(r,(function(t,r){t||n.sent++,e&&e(t,r)})),!0},t.prototype.generateUniqueID=function(){return this.uniqueID++,this.uniqueID},t}(),ae=function(){function t(t,e,n,r){this.name=t,this.priority=e,this.transport=n,this.options=r||{}}return t.prototype.isSupported=function(){return this.transport.isSupported({useTLS:this.options.useTLS})},t.prototype.connect=function(t,e){var n=this;if(!this.isSupported())return ce(new ft,e);if(this.priority>>18&63),e+=this._encodeByte(o>>>12&63),e+=this._encodeByte(o>>>6&63),e+=this._encodeByte(o>>>0&63)}var r=t.length-n;if(r>0){o=t[n]<<16|(2===r?t[n+1]<<8:0);e+=this._encodeByte(o>>>18&63),e+=this._encodeByte(o>>>12&63),e+=2===r?this._encodeByte(o>>>6&63):this._paddingCharacter||"",e+=this._paddingCharacter||""}return e},t.prototype.maxDecodedLength=function(t){return this._paddingCharacter?t/4*3|0:(6*t+7)/8|0},t.prototype.decodedLength=function(t){return this.maxDecodedLength(t.length-this._getPaddingLength(t))},t.prototype.decode=function(t){if(0===t.length)return new Uint8Array(0);for(var e=this._getPaddingLength(t),n=t.length-e,o=new Uint8Array(this.maxDecodedLength(n)),r=0,i=0,s=0,c=0,a=0,u=0,h=0;i>>4,o[r++]=a<<4|u>>>2,o[r++]=u<<6|h,s|=256&c,s|=256&a,s|=256&u,s|=256&h;if(i>>4,s|=256&c,s|=256&a),i>>2,s|=256&u),i>>8&6,e+=51-t>>>8&-75,e+=61-t>>>8&-15,e+=62-t>>>8&3,String.fromCharCode(e)},t.prototype._decodeChar=function(t){var e=256;return e+=(42-t&t-44)>>>8&-256+t-43+62,e+=(46-t&t-48)>>>8&-256+t-47+63,e+=(47-t&t-58)>>>8&-256+t-48+52,e+=(64-t&t-91)>>>8&-256+t-65+0,e+=(96-t&t-123)>>>8&-256+t-97+26},t.prototype._getPaddingLength=function(t){var e=0;if(this._paddingCharacter){for(var n=t.length-1;n>=0&&t[n]===this._paddingCharacter;n--)e++;if(t.length<4||e>2)throw new Error("Base64Coder: incorrect padding")}return e},t}();e.Coder=i;var s=new i;e.encode=function(t){return s.encode(t)},e.decode=function(t){return s.decode(t)};var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype._encodeByte=function(t){var e=t;return e+=65,e+=25-t>>>8&6,e+=51-t>>>8&-75,e+=61-t>>>8&-13,e+=62-t>>>8&49,String.fromCharCode(e)},e.prototype._decodeChar=function(t){var e=256;return e+=(44-t&t-46)>>>8&-256+t-45+62,e+=(94-t&t-96)>>>8&-256+t-95+63,e+=(47-t&t-58)>>>8&-256+t-48+52,e+=(64-t&t-91)>>>8&-256+t-65+0,e+=(96-t&t-123)>>>8&-256+t-97+26},e}(i);e.URLSafeCoder=c;var a=new c;e.encodeURLSafe=function(t){return a.encode(t)},e.decodeURLSafe=function(t){return a.decode(t)},e.encodedLength=function(t){return s.encodedLength(t)},e.maxDecodedLength=function(t){return s.maxDecodedLength(t)},e.decodedLength=function(t){return s.decodedLength(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o="utf8: invalid source encoding";function r(t){for(var e=0,n=0;n=t.length-1)throw new Error("utf8: invalid string");n++,e+=4}}return e}e.encode=function(t){for(var e=new Uint8Array(r(t)),n=0,o=0;o>6,e[n++]=128|63&i):i<55296?(e[n++]=224|i>>12,e[n++]=128|i>>6&63,e[n++]=128|63&i):(o++,i=(1023&i)<<10,i|=1023&t.charCodeAt(o),i+=65536,e[n++]=240|i>>18,e[n++]=128|i>>12&63,e[n++]=128|i>>6&63,e[n++]=128|63&i)}return e},e.encodedLength=r,e.decode=function(t){for(var e=[],n=0;n=t.length)throw new Error(o);if(128!=(192&(s=t[++n])))throw new Error(o);r=(31&r)<<6|63&s,i=128}else if(r<240){if(n>=t.length-1)throw new Error(o);var s=t[++n],c=t[++n];if(128!=(192&s)||128!=(192&c))throw new Error(o);r=(15&r)<<12|(63&s)<<6|63&c,i=2048}else{if(!(r<248))throw new Error(o);if(n>=t.length-2)throw new Error(o);s=t[++n],c=t[++n];var a=t[++n];if(128!=(192&s)||128!=(192&c)||128!=(192&a))throw new Error(o);r=(15&r)<<18|(63&s)<<12|(63&c)<<6|63&a,i=65536}if(r=55296&&r<=57343)throw new Error(o);if(r>=65536){if(r>1114111)throw new Error(o);r-=65536,e.push(String.fromCharCode(55296|r>>10)),r=56320|1023&r}}e.push(String.fromCharCode(r))}return e.join("")}},function(t,e,n){t.exports=n(3).default},function(t,e,n){"use strict";n.r(e);for(var o=String.fromCharCode,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i={},s=0,c=r.length;s>>6)+o(128|63&e):o(224|e>>>12&15)+o(128|e>>>6&63)+o(128|63&e)},h=function(t){return t.replace(/[^\x00-\x7F]/g,u)},p=function(t){var e=[0,2,1][t.length%3],n=t.charCodeAt(0)<<16|(t.length>1?t.charCodeAt(1):0)<<8|(t.length>2?t.charCodeAt(2):0);return[r.charAt(n>>>18),r.charAt(n>>>12&63),e>=2?"=":r.charAt(n>>>6&63),e>=1?"=":r.charAt(63&n)].join("")},l=self.btoa||function(t){return t.replace(/[\s\S]{1,3}/g,p)},f=function(){function t(t,e,n,o){var r=this;this.clear=e,this.timer=t((function(){r.timer&&(r.timer=o(r.timer))}),n)}return t.prototype.isRunning=function(){return null!==this.timer},t.prototype.ensureAborted=function(){this.timer&&(this.clear(this.timer),this.timer=null)},t}(),d=(a=function(t,e){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});function y(t){self.clearTimeout(t)}function g(t){self.clearInterval(t)}var b=function(t){function e(e,n){return t.call(this,setTimeout,y,e,(function(t){return n(),null}))||this}return d(e,t),e}(f),v=function(t){function e(e,n){return t.call(this,setInterval,g,e,(function(t){return n(),t}))||this}return d(e,t),e}(f),m={now:function(){return Date.now?Date.now():(new Date).valueOf()},defer:function(t){return new b(0,t)},method:function(t){for(var e=[],n=1;n0)for(o=0;o=1002&&t.code<=1004?"backoff":null:4e3===t.code?"tls_only":t.code<4100?"refused":t.code<4200?"backoff":t.code<4300?"retry":"refused"},getCloseError:function(t){return 1e3!==t.code&&1001!==t.code?{type:"PusherError",data:{code:t.code,message:t.reason||t.message}}:null}},Z=K,tt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),et=function(t){function e(e,n){var o=t.call(this)||this;return o.id=e,o.transport=n,o.activityTimeout=n.activityTimeout,o.bindListeners(),o}return tt(e,t),e.prototype.handlesActivityChecks=function(){return this.transport.handlesActivityChecks()},e.prototype.send=function(t){return this.transport.send(t)},e.prototype.send_event=function(t,e,n){var o={event:t,data:e};return n&&(o.channel=n),B.debug("Event sent",o),this.send(Z.encodeMessage(o))},e.prototype.ping=function(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})},e.prototype.close=function(){this.transport.close()},e.prototype.bindListeners=function(){var t=this,e={message:function(e){var n;try{n=Z.decodeMessage(e)}catch(n){t.emit("error",{type:"MessageParseError",error:n,data:e.data})}if(void 0!==n){switch(B.debug("Event recd",n),n.event){case"pusher:error":t.emit("error",{type:"PusherError",data:n.data});break;case"pusher:ping":t.emit("ping");break;case"pusher:pong":t.emit("pong")}t.emit("message",n)}},activity:function(){t.emit("activity")},error:function(e){t.emit("error",{type:"WebSocketError",error:e})},closed:function(e){n(),e&&e.code&&t.handleCloseEvent(e),t.transport=null,t.emit("closed")}},n=function(){k(e,(function(e,n){t.transport.unbind(n,e)}))};k(e,(function(e,n){t.transport.bind(n,e)}))},e.prototype.handleCloseEvent=function(t){var e=Z.getCloseAction(t),n=Z.getCloseError(t);n&&this.emit("error",n),e&&this.emit(e,{action:e,error:n})},e}(z),nt=function(){function t(t,e){this.transport=t,this.callback=e,this.bindListeners()}return t.prototype.close=function(){this.unbindListeners(),this.transport.close()},t.prototype.bindListeners=function(){var t=this;this.onMessage=function(e){var n;t.unbindListeners();try{n=Z.processHandshake(e)}catch(e){return t.finish("error",{error:e}),void t.transport.close()}"connected"===n.action?t.finish("connected",{connection:new et(n.id,t.transport),activityTimeout:n.activityTimeout}):(t.finish(n.action,{error:n.error}),t.transport.close())},this.onClosed=function(e){t.unbindListeners();var n=Z.getCloseAction(e)||"backoff",o=Z.getCloseError(e);t.finish(n,{error:o})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)},t.prototype.unbindListeners=function(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)},t.prototype.finish=function(t,e){this.callback(_({transport:this.transport,action:t},e))},t}(),ot=function(){function t(t,e){this.channel=t;var n=e.authTransport;if(void 0===oe.getAuthorizers()[n])throw"'"+n+"' is not a recognized auth transport";this.type=n,this.options=e,this.authOptions=e.auth||{}}return t.prototype.composeQuery=function(t){var e="socket_id="+encodeURIComponent(t)+"&channel_name="+encodeURIComponent(this.channel.name);for(var n in this.authOptions.params)e+="&"+encodeURIComponent(n)+"="+encodeURIComponent(this.authOptions.params[n]);return e},t.prototype.authorize=function(e,n){t.authorizers=t.authorizers||oe.getAuthorizers(),t.authorizers[this.type].call(this,oe,e,n)},t}(),rt=function(){function t(t,e){this.timeline=t,this.options=e||{}}return t.prototype.send=function(t,e){this.timeline.isEmpty()||this.timeline.send(oe.TimelineTransport.getAgent(this,t),e)},t}(),it=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),st=function(t){function e(e){var n=this.constructor,o=t.call(this,e)||this;return Object.setPrototypeOf(o,n.prototype),o}return it(e,t),e}(Error),ct=(function(t){function e(e){var n=this.constructor,o=t.call(this,e)||this;return Object.setPrototypeOf(o,n.prototype),o}it(e,t)}(Error),function(t){function e(e){var n=this.constructor,o=t.call(this,e)||this;return Object.setPrototypeOf(o,n.prototype),o}return it(e,t),e}(Error)),at=function(t){function e(e){var n=this.constructor,o=t.call(this,e)||this;return Object.setPrototypeOf(o,n.prototype),o}return it(e,t),e}(Error),ut=function(t){function e(e){var n=this.constructor,o=t.call(this,e)||this;return Object.setPrototypeOf(o,n.prototype),o}return it(e,t),e}(Error),ht=function(t){function e(e){var n=this.constructor,o=t.call(this,e)||this;return Object.setPrototypeOf(o,n.prototype),o}return it(e,t),e}(Error),pt=function(t){function e(e){var n=this.constructor,o=t.call(this,e)||this;return Object.setPrototypeOf(o,n.prototype),o}return it(e,t),e}(Error),lt={baseUrl:"https://pusher.com",urls:{authenticationEndpoint:{path:"/docs/authenticating_users"},javascriptQuickStart:{path:"/docs/javascript_quick_start"},triggeringClientEvents:{path:"/docs/client_api_guide/client_events#trigger-events"},encryptedChannelSupport:{fullUrl:"https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support"}}},ft=function(t){var e,n=lt.urls[t];return n?(n.fullUrl?e=n.fullUrl:n.path&&(e=lt.baseUrl+n.path),e?"See: "+e:""):""},dt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),yt=function(t){function e(e,n){var o=t.call(this,(function(t,n){B.debug("No callbacks on "+e+" for "+t)}))||this;return o.name=e,o.pusher=n,o.subscribed=!1,o.subscriptionPending=!1,o.subscriptionCancelled=!1,o}return dt(e,t),e.prototype.authorize=function(t,e){return e(!1,{auth:""})},e.prototype.trigger=function(t,e){if(0!==t.indexOf("client-"))throw new st("Event '"+t+"' does not start with 'client-'");if(!this.subscribed){var n=ft("triggeringClientEvents");B.warn("Client event triggered before channel 'subscription_succeeded' event . "+n)}return this.pusher.send_event(t,e,this.name)},e.prototype.disconnect=function(){this.subscribed=!1,this.subscriptionPending=!1},e.prototype.handleEvent=function(t){var e=t.event,n=t.data;if("pusher_internal:subscription_succeeded"===e)this.handleSubscriptionSucceededEvent(t);else if(0!==e.indexOf("pusher_internal:")){this.emit(e,n,{})}},e.prototype.handleSubscriptionSucceededEvent=function(t){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",t.data)},e.prototype.subscribe=function(){var t=this;this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,(function(e,n){e?(B.error(n),t.emit("pusher:subscription_error",n)):(n=n,t.pusher.send_event("pusher:subscribe",{auth:n.auth,channel_data:n.channel_data,channel:t.name}))})))},e.prototype.unsubscribe=function(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})},e.prototype.cancelSubscription=function(){this.subscriptionCancelled=!0},e.prototype.reinstateSubscription=function(){this.subscriptionCancelled=!1},e}(z),gt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),bt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return gt(e,t),e.prototype.authorize=function(t,e){return Lt.createAuthorizer(this,this.pusher.config).authorize(t,e)},e}(yt),vt=function(){function t(){this.reset()}return t.prototype.get=function(t){return Object.prototype.hasOwnProperty.call(this.members,t)?{id:t,info:this.members[t]}:null},t.prototype.each=function(t){var e=this;k(this.members,(function(n,o){t(e.get(o))}))},t.prototype.setMyID=function(t){this.myID=t},t.prototype.onSubscription=function(t){this.members=t.presence.hash,this.count=t.presence.count,this.me=this.get(this.myID)},t.prototype.addMember=function(t){return null===this.get(t.user_id)&&this.count++,this.members[t.user_id]=t.user_info,this.get(t.user_id)},t.prototype.removeMember=function(t){var e=this.get(t.user_id);return e&&(delete this.members[t.user_id],this.count--),e},t.prototype.reset=function(){this.members={},this.count=0,this.myID=null,this.me=null},t}(),mt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),_t=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.members=new vt,o}return mt(e,t),e.prototype.authorize=function(e,n){var o=this;t.prototype.authorize.call(this,e,(function(t,e){if(!t){if(void 0===(e=e).channel_data){var r=ft("authenticationEndpoint");return B.error("Invalid auth response for channel '"+o.name+"',expected 'channel_data' field. "+r),void n("Invalid auth response")}var i=JSON.parse(e.channel_data);o.members.setMyID(i.user_id)}n(t,e)}))},e.prototype.handleEvent=function(t){var e=t.event;if(0===e.indexOf("pusher_internal:"))this.handleInternalEvent(t);else{var n=t.data,o={};t.user_id&&(o.user_id=t.user_id),this.emit(e,n,o)}},e.prototype.handleInternalEvent=function(t){var e=t.event,n=t.data;switch(e){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(t);break;case"pusher_internal:member_added":var o=this.members.addMember(n);this.emit("pusher:member_added",o);break;case"pusher_internal:member_removed":var r=this.members.removeMember(n);r&&this.emit("pusher:member_removed",r)}},e.prototype.handleSubscriptionSucceededEvent=function(t){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(t.data),this.emit("pusher:subscription_succeeded",this.members))},e.prototype.disconnect=function(){this.members.reset(),t.prototype.disconnect.call(this)},e}(bt),St=n(1),wt=n(0),kt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Ct=function(t){function e(e,n,o){var r=t.call(this,e,n)||this;return r.key=null,r.nacl=o,r}return kt(e,t),e.prototype.authorize=function(e,n){var o=this;t.prototype.authorize.call(this,e,(function(t,e){if(t)n(!0,e);else{var r=e.shared_secret;if(r)o.key=Object(wt.decode)(r),delete e.shared_secret,n(!1,e);else{var i="No shared_secret key in auth payload for encrypted channel: "+o.name;n(!0,i)}}}))},e.prototype.trigger=function(t,e){throw new ut("Client events are not currently supported for encrypted channels")},e.prototype.handleEvent=function(e){var n=e.event,o=e.data;0!==n.indexOf("pusher_internal:")&&0!==n.indexOf("pusher:")?this.handleEncryptedEvent(n,o):t.prototype.handleEvent.call(this,e)},e.prototype.handleEncryptedEvent=function(t,e){var n=this;if(this.key)if(e.ciphertext&&e.nonce){var o=Object(wt.decode)(e.ciphertext);if(o.length0&&this.emit("connecting_in",Math.round(t/1e3)),this.retryTimer=new b(t||0,(function(){e.disconnectInternally(),e.connect()}))},e.prototype.clearRetryTimer=function(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)},e.prototype.setUnavailableTimer=function(){var t=this;this.unavailableTimer=new b(this.options.unavailableTimeout,(function(){t.updateState("unavailable")}))},e.prototype.clearUnavailableTimer=function(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()},e.prototype.sendActivityCheck=function(){var t=this;this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new b(this.options.pongTimeout,(function(){t.timeline.error({pong_timed_out:t.options.pongTimeout}),t.retryIn(0)}))},e.prototype.resetActivityCheck=function(){var t=this;this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new b(this.activityTimeout,(function(){t.sendActivityCheck()})))},e.prototype.stopActivityCheck=function(){this.activityTimer&&this.activityTimer.ensureAborted()},e.prototype.buildConnectionCallbacks=function(t){var e=this;return _({},t,{message:function(t){e.resetActivityCheck(),e.emit("message",t)},ping:function(){e.send_event("pusher:pong",{})},activity:function(){e.resetActivityCheck()},error:function(t){e.emit("error",{type:"WebSocketError",error:t})},closed:function(){e.abandonConnection(),e.shouldRetry()&&e.retryIn(1e3)}})},e.prototype.buildHandshakeCallbacks=function(t){var e=this;return _({},t,{connected:function(t){e.activityTimeout=Math.min(e.options.activityTimeout,t.activityTimeout,t.connection.activityTimeout||1/0),e.clearUnavailableTimer(),e.setConnection(t.connection),e.socket_id=e.connection.id,e.updateState("connected",{socket_id:e.socket_id})}})},e.prototype.buildErrorCallbacks=function(){var t=this,e=function(e){return function(n){n.error&&t.emit("error",{type:"WebSocketError",error:n.error}),e(n)}};return{tls_only:e((function(){t.usingTLS=!0,t.updateStrategy(),t.retryIn(0)})),refused:e((function(){t.disconnect()})),backoff:e((function(){t.retryIn(1e3)})),retry:e((function(){t.retryIn(0)}))}},e.prototype.setConnection=function(t){for(var e in this.connection=t,this.connectionCallbacks)this.connection.bind(e,this.connectionCallbacks[e]);this.resetActivityCheck()},e.prototype.abandonConnection=function(){if(this.connection){for(var t in this.stopActivityCheck(),this.connectionCallbacks)this.connection.unbind(t,this.connectionCallbacks[t]);var e=this.connection;return this.connection=null,e}},e.prototype.updateState=function(t,e){var n=this.state;if(this.state=t,n!==t){var o=t;"connected"===o&&(o+=" with new socket ID "+e.socket_id),B.debug("State changed",n+" -> "+o),this.timeline.info({state:t,params:e}),this.emit("state_change",{previous:n,current:t}),this.emit(t,e)}},e.prototype.shouldRetry=function(){return"connecting"===this.state||"connected"===this.state},e}(z),Pt=function(){function t(){this.channels={}}return t.prototype.add=function(t,e){return this.channels[t]||(this.channels[t]=function(t,e){if(0===t.indexOf("private-encrypted-")){if(e.config.nacl)return Lt.createEncryptedChannel(t,e,e.config.nacl);var n=ft("encryptedChannelSupport");throw new ut("Tried to subscribe to a private-encrypted- channel but no nacl implementation available. "+n)}return 0===t.indexOf("private-")?Lt.createPrivateChannel(t,e):0===t.indexOf("presence-")?Lt.createPresenceChannel(t,e):Lt.createChannel(t,e)}(t,e)),this.channels[t]},t.prototype.all=function(){return function(t){var e=[];return k(t,(function(t){e.push(t)})),e}(this.channels)},t.prototype.find=function(t){return this.channels[t]},t.prototype.remove=function(t){var e=this.channels[t];return delete this.channels[t],e},t.prototype.disconnect=function(){k(this.channels,(function(t){t.disconnect()}))},t}();var Lt={createChannels:function(){return new Pt},createConnectionManager:function(t,e){return new Ot(t,e)},createChannel:function(t,e){return new yt(t,e)},createPrivateChannel:function(t,e){return new bt(t,e)},createPresenceChannel:function(t,e){return new _t(t,e)},createEncryptedChannel:function(t,e,n){return new Ct(t,e,n)},createTimelineSender:function(t,e){return new rt(t,e)},createAuthorizer:function(t,e){return e.authorizer?e.authorizer(t,e):new ot(t,e)},createHandshake:function(t,e){return new nt(t,e)},createAssistantToTheTransportManager:function(t,e,n){return new $(t,e,n)}},Et=function(){function t(t){this.options=t||{},this.livesLeft=this.options.lives||1/0}return t.prototype.getAssistant=function(t){return Lt.createAssistantToTheTransportManager(this,t,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})},t.prototype.isAlive=function(){return this.livesLeft>0},t.prototype.reportDeath=function(){this.livesLeft-=1},t}(),At=function(){function t(t,e){this.strategies=t,this.loop=Boolean(e.loop),this.failFast=Boolean(e.failFast),this.timeout=e.timeout,this.timeoutLimit=e.timeoutLimit}return t.prototype.isSupported=function(){return E(this.strategies,m.method("isSupported"))},t.prototype.connect=function(t,e){var n=this,o=this.strategies,r=0,i=this.timeout,s=null,c=function(a,u){u?e(null,u):(r+=1,n.loop&&(r%=o.length),r0&&(r=new b(n.timeout,(function(){i.abort(),o(!0)}))),i=t.connect(e,(function(t,e){t&&r&&r.isRunning()&&!n.failFast||(r&&r.ensureAborted(),o(t,e))})),{abort:function(){r&&r.ensureAborted(),i.abort()},forceMinPriority:function(t){i.forceMinPriority(t)}}},t}(),xt=function(){function t(t){this.strategies=t}return t.prototype.isSupported=function(){return E(this.strategies,m.method("isSupported"))},t.prototype.connect=function(t,e){return function(t,e,n){var o=O(t,(function(t,o,r,i){return t.connect(e,n(o,i))}));return{abort:function(){T(o,jt)},forceMinPriority:function(t){T(o,(function(e){e.forceMinPriority(t)}))}}}(this.strategies,t,(function(t,n){return function(o,r){n[t].error=o,o?function(t){return function(t,e){for(var n=0;n=m.now()){var i=this.transports[o.transport];i&&(this.timeline.info({cached:!0,transport:o.transport,latency:o.latency}),r.push(new At([i],{timeout:2*o.latency+1e3,failFast:!0})))}var s=m.now(),c=r.pop().connect(t,(function o(i,a){i?(Nt(n),r.length>0?(s=m.now(),c=r.pop().connect(t,o)):e(i)):(!function(t,e,n){var o=oe.getLocalStorage();if(o)try{o[It(t)]=j({timestamp:m.now(),transport:e,latency:n})}catch(t){}}(n,a.transport.name,m.now()-s),e(null,a))}));return{abort:function(){c.abort()},forceMinPriority:function(e){t=e,c&&c.forceMinPriority(e)}}},t}();function It(t){return"pusherTransport"+(t?"TLS":"NonTLS")}function Nt(t){var e=oe.getLocalStorage();if(e)try{delete e[It(t)]}catch(t){}}var Dt=function(){function t(t,e){var n=e.delay;this.strategy=t,this.options={delay:n}}return t.prototype.isSupported=function(){return this.strategy.isSupported()},t.prototype.connect=function(t,e){var n,o=this.strategy,r=new b(this.options.delay,(function(){n=o.connect(t,e)}));return{abort:function(){r.ensureAborted(),n&&n.abort()},forceMinPriority:function(e){t=e,n&&n.forceMinPriority(e)}}},t}(),Mt=function(){function t(t,e,n){this.test=t,this.trueBranch=e,this.falseBranch=n}return t.prototype.isSupported=function(){return(this.test()?this.trueBranch:this.falseBranch).isSupported()},t.prototype.connect=function(t,e){return(this.test()?this.trueBranch:this.falseBranch).connect(t,e)},t}(),Ht=function(){function t(t){this.strategy=t}return t.prototype.isSupported=function(){return this.strategy.isSupported()},t.prototype.connect=function(t,e){var n=this.strategy.connect(t,(function(t,o){o&&n.abort(),e(t,o)}));return n},t}();function Ut(t){return function(){return t.isSupported()}}var zt,Bt=function(t,e,n){var o={};function r(e,r,i,s,c){var a=n(t,e,r,i,s,c);return o[e]=a,a}var i,s=Object.assign({},e,{hostNonTLS:t.wsHost+":"+t.wsPort,hostTLS:t.wsHost+":"+t.wssPort,httpPath:t.wsPath}),c=_({},s,{useTLS:!0}),a=Object.assign({},e,{hostNonTLS:t.httpHost+":"+t.httpPort,hostTLS:t.httpHost+":"+t.httpsPort,httpPath:t.httpPath}),u={loop:!0,timeout:15e3,timeoutLimit:6e4},h=new Et({lives:2,minPingDelay:1e4,maxPingDelay:t.activityTimeout}),p=new Et({lives:2,minPingDelay:1e4,maxPingDelay:t.activityTimeout}),l=r("ws","ws",3,s,h),f=r("wss","ws",3,c,h),d=r("xhr_streaming","xhr_streaming",1,a,p),y=r("xhr_polling","xhr_polling",1,a),g=new At([l],u),b=new At([f],u),v=new At([d],u),m=new At([y],u),S=new At([new Mt(Ut(v),new xt([v,new Dt(m,{delay:4e3})]),m)],u);return i=e.useTLS?new xt([g,new Dt(S,{delay:2e3})]):new xt([g,new Dt(b,{delay:2e3}),new Dt(S,{delay:5e3})]),new Rt(new Ht(new Mt(Ut(l),i,S)),o,{ttl:18e5,timeline:e.timeline,useTLS:e.useTLS})},Ft=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),qt=function(t){function e(e,n,o){var r=t.call(this)||this;return r.hooks=e,r.method=n,r.url=o,r}return Ft(e,t),e.prototype.start=function(t){var e=this;this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=function(){e.close()},oe.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(t)},e.prototype.close=function(){this.unloader&&(oe.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)},e.prototype.onChunk=function(t,e){for(;;){var n=this.advanceBuffer(e);if(!n)break;this.emit("chunk",{status:t,data:n})}this.isBufferTooLong(e)&&this.emit("buffer_too_long")},e.prototype.advanceBuffer=function(t){var e=t.slice(this.position),n=e.indexOf("\n");return-1!==n?(this.position+=n+1,e.slice(0,n)):null},e.prototype.isBufferTooLong=function(t){return this.position===t.length&&t.length>262144},e}(z);!function(t){t[t.CONNECTING=0]="CONNECTING",t[t.OPEN=1]="OPEN",t[t.CLOSED=3]="CLOSED"}(zt||(zt={}));var Jt=zt,Wt=1;function Xt(t){var e=-1===t.indexOf("?")?"?":"&";return t+e+"t="+ +new Date+"&n="+Wt++}function Gt(t){return Math.floor(Math.random()*t)}var Qt,Vt=function(){function t(t,e){this.hooks=t,this.session=Gt(1e3)+"/"+function(t){for(var e=[],n=0;n0&&t.onChunk(e.status,e.responseText);break;case 4:e.responseText&&e.responseText.length>0&&t.onChunk(e.status,e.responseText),t.emit("finished",e.status),t.close()}},e},abortRequest:function(t){t.onreadystatechange=null,t.abort()}},Zt={getDefaultStrategy:Bt,Transports:Y,transportConnectionInitializer:function(){this.timeline.info(this.buildTimelineMessage({transport:this.name+(this.options.useTLS?"s":"")})),this.hooks.isInitialized()?this.changeState("initialized"):this.onClose()},HTTPFactory:{createStreamingSocket:function(t){return this.createSocket(Yt,t)},createPollingSocket:function(t){return this.createSocket($t,t)},createSocket:function(t,e){return new Vt(t,e)},createXHR:function(t,e){return this.createRequest(Kt,t,e)},createRequest:function(t,e,n){return new qt(t,e,n)}},setup:function(t){t.ready()},getLocalStorage:function(){},getClientFeatures:function(){return C(L({ws:Y.ws},(function(t){return t.isSupported({})})))},getProtocol:function(){return"http:"},isXHRSupported:function(){return!0},createSocketRequest:function(t,e){if(this.isXHRSupported())return this.HTTPFactory.createXHR(t,e);throw"Cross-origin HTTP requests are not supported"},createXHR:function(){return new(this.getXHRAPI())},createWebSocket:function(t){return new(this.getWebSocketAPI())(t)},addUnloadListener:function(t){},removeUnloadListener:function(t){}},te=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),ee=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return te(e,t),e.prototype.isOnline=function(){return!0},e}(z)),ne=function(t,e,n){var o=new Headers;for(var r in o.set("Content-Type","application/x-www-form-urlencoded"),this.authOptions.headers)o.set(r,this.authOptions.headers[r]);var i=this.composeQuery(e),s=new Request(this.options.authEndpoint,{headers:o,body:i,credentials:"same-origin",method:"POST"});return fetch(s).then((function(t){var e=t.status;if(200===e)return t.text();throw B.error("Couldn't get auth info from your auth endpoint",e),e})).then((function(t){try{t=JSON.parse(t)}catch(n){var e="JSON returned from auth endpoint was invalid, yet status code was 200. Data was: "+t;throw B.error(e),e}n(!1,t)})).catch((function(t){n(!0,t)}))},oe={getDefaultStrategy:Zt.getDefaultStrategy,Transports:Zt.Transports,setup:Zt.setup,getProtocol:Zt.getProtocol,isXHRSupported:Zt.isXHRSupported,getLocalStorage:Zt.getLocalStorage,createXHR:Zt.createXHR,createWebSocket:Zt.createWebSocket,addUnloadListener:Zt.addUnloadListener,removeUnloadListener:Zt.removeUnloadListener,transportConnectionInitializer:Zt.transportConnectionInitializer,createSocketRequest:Zt.createSocketRequest,HTTPFactory:Zt.HTTPFactory,TimelineTransport:{name:"xhr",getAgent:function(t,e){return function(n,o){var r="http"+(e?"s":"")+"://"+(t.host||t.options.host)+t.options.path,i=x(n);fetch(r+="/2?"+i).then((function(t){if(200!==t.status)throw"received "+t.status+" from stats.pusher.com";return t.json()})).then((function(e){var n=e.host;n&&(t.host=n)})).catch((function(t){B.debug("TimelineSender Error: ",t)}))}}},getAuthorizers:function(){return{ajax:ne}},getWebSocketAPI:function(){return WebSocket},getXHRAPI:function(){return XMLHttpRequest},getNetwork:function(){return ee}};!function(t){t[t.ERROR=3]="ERROR",t[t.INFO=6]="INFO",t[t.DEBUG=7]="DEBUG"}(Qt||(Qt={}));var re=Qt,ie=function(){function t(t,e,n){this.key=t,this.session=e,this.events=[],this.options=n||{},this.sent=0,this.uniqueID=0}return t.prototype.log=function(t,e){t<=this.options.level&&(this.events.push(_({},e,{timestamp:m.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())},t.prototype.error=function(t){this.log(re.ERROR,t)},t.prototype.info=function(t){this.log(re.INFO,t)},t.prototype.debug=function(t){this.log(re.DEBUG,t)},t.prototype.isEmpty=function(){return 0===this.events.length},t.prototype.send=function(t,e){var n=this,o=_({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],t(o,(function(t,o){t||n.sent++,e&&e(t,o)})),!0},t.prototype.generateUniqueID=function(){return this.uniqueID++,this.uniqueID},t}(),se=function(){function t(t,e,n,o){this.name=t,this.priority=e,this.transport=n,this.options=o||{}}return t.prototype.isSupported=function(){return this.transport.isSupported({useTLS:this.options.useTLS})},t.prototype.connect=function(t,e){var n=this;if(!this.isSupported())return ce(new pt,e);if(this.priority>>18&63),e+=this._encodeByte(o>>>12&63),e+=this._encodeByte(o>>>6&63),e+=this._encodeByte(o>>>0&63)}var r=t.length-n;if(r>0){o=t[n]<<16|(2===r?t[n+1]<<8:0);e+=this._encodeByte(o>>>18&63),e+=this._encodeByte(o>>>12&63),e+=2===r?this._encodeByte(o>>>6&63):this._paddingCharacter||"",e+=this._paddingCharacter||""}return e},t.prototype.maxDecodedLength=function(t){return this._paddingCharacter?t/4*3|0:(6*t+7)/8|0},t.prototype.decodedLength=function(t){return this.maxDecodedLength(t.length-this._getPaddingLength(t))},t.prototype.decode=function(t){if(0===t.length)return new Uint8Array(0);for(var e=this._getPaddingLength(t),n=t.length-e,o=new Uint8Array(this.maxDecodedLength(n)),r=0,i=0,s=0,c=0,a=0,u=0,h=0;i>>4,o[r++]=a<<4|u>>>2,o[r++]=u<<6|h,s|=256&c,s|=256&a,s|=256&u,s|=256&h;if(i>>4,s|=256&c,s|=256&a),i>>2,s|=256&u),i>>8&6,e+=51-t>>>8&-75,e+=61-t>>>8&-15,e+=62-t>>>8&3,String.fromCharCode(e)},t.prototype._decodeChar=function(t){var e=256;return e+=(42-t&t-44)>>>8&-256+t-43+62,e+=(46-t&t-48)>>>8&-256+t-47+63,e+=(47-t&t-58)>>>8&-256+t-48+52,e+=(64-t&t-91)>>>8&-256+t-65+0,e+=(96-t&t-123)>>>8&-256+t-97+26},t.prototype._getPaddingLength=function(t){var e=0;if(this._paddingCharacter){for(var n=t.length-1;n>=0&&t[n]===this._paddingCharacter;n--)e++;if(t.length<4||e>2)throw new Error("Base64Coder: incorrect padding")}return e},t}();e.Coder=i;var s=new i;e.encode=function(t){return s.encode(t)},e.decode=function(t){return s.decode(t)};var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype._encodeByte=function(t){var e=t;return e+=65,e+=25-t>>>8&6,e+=51-t>>>8&-75,e+=61-t>>>8&-13,e+=62-t>>>8&49,String.fromCharCode(e)},e.prototype._decodeChar=function(t){var e=256;return e+=(44-t&t-46)>>>8&-256+t-45+62,e+=(94-t&t-96)>>>8&-256+t-95+63,e+=(47-t&t-58)>>>8&-256+t-48+52,e+=(64-t&t-91)>>>8&-256+t-65+0,e+=(96-t&t-123)>>>8&-256+t-97+26},e}(i);e.URLSafeCoder=c;var a=new c;e.encodeURLSafe=function(t){return a.encode(t)},e.decodeURLSafe=function(t){return a.decode(t)},e.encodedLength=function(t){return s.encodedLength(t)},e.maxDecodedLength=function(t){return s.maxDecodedLength(t)},e.decodedLength=function(t){return s.decodedLength(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o="utf8: invalid source encoding";function r(t){for(var e=0,n=0;n=t.length-1)throw new Error("utf8: invalid string");n++,e+=4}}return e}e.encode=function(t){for(var e=new Uint8Array(r(t)),n=0,o=0;o>6,e[n++]=128|63&i):i<55296?(e[n++]=224|i>>12,e[n++]=128|i>>6&63,e[n++]=128|63&i):(o++,i=(1023&i)<<10,i|=1023&t.charCodeAt(o),i+=65536,e[n++]=240|i>>18,e[n++]=128|i>>12&63,e[n++]=128|i>>6&63,e[n++]=128|63&i)}return e},e.encodedLength=r,e.decode=function(t){for(var e=[],n=0;n=t.length)throw new Error(o);if(128!=(192&(s=t[++n])))throw new Error(o);r=(31&r)<<6|63&s,i=128}else if(r<240){if(n>=t.length-1)throw new Error(o);var s=t[++n],c=t[++n];if(128!=(192&s)||128!=(192&c))throw new Error(o);r=(15&r)<<12|(63&s)<<6|63&c,i=2048}else{if(!(r<248))throw new Error(o);if(n>=t.length-2)throw new Error(o);s=t[++n],c=t[++n];var a=t[++n];if(128!=(192&s)||128!=(192&c)||128!=(192&a))throw new Error(o);r=(15&r)<<18|(63&s)<<12|(63&c)<<6|63&a,i=65536}if(r=55296&&r<=57343)throw new Error(o);if(r>=65536){if(r>1114111)throw new Error(o);r-=65536,e.push(String.fromCharCode(55296|r>>10)),r=56320|1023&r}}e.push(String.fromCharCode(r))}return e.join("")}},function(t,e,n){t.exports=n(3).default},function(t,e,n){"use strict";n.r(e);for(var o=String.fromCharCode,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i={},s=0,c=r.length;s>>6)+o(128|63&e):o(224|e>>>12&15)+o(128|e>>>6&63)+o(128|63&e)},h=function(t){return t.replace(/[^\x00-\x7F]/g,u)},p=function(t){var e=[0,2,1][t.length%3],n=t.charCodeAt(0)<<16|(t.length>1?t.charCodeAt(1):0)<<8|(t.length>2?t.charCodeAt(2):0);return[r.charAt(n>>>18),r.charAt(n>>>12&63),e>=2?"=":r.charAt(n>>>6&63),e>=1?"=":r.charAt(63&n)].join("")},l=self.btoa||function(t){return t.replace(/[\s\S]{1,3}/g,p)},f=function(){function t(t,e,n,o){var r=this;this.clear=e,this.timer=t((function(){r.timer&&(r.timer=o(r.timer))}),n)}return t.prototype.isRunning=function(){return null!==this.timer},t.prototype.ensureAborted=function(){this.timer&&(this.clear(this.timer),this.timer=null)},t}(),d=(a=function(t,e){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});function y(t){self.clearTimeout(t)}function g(t){self.clearInterval(t)}var b=function(t){function e(e,n){return t.call(this,setTimeout,y,e,(function(t){return n(),null}))||this}return d(e,t),e}(f),v=function(t){function e(e,n){return t.call(this,setInterval,g,e,(function(t){return n(),t}))||this}return d(e,t),e}(f),m={now:function(){return Date.now?Date.now():(new Date).valueOf()},defer:function(t){return new b(0,t)},method:function(t){for(var e=[],n=1;n0)for(o=0;o=1002&&t.code<=1004?"backoff":null:4e3===t.code?"tls_only":t.code<4100?"refused":t.code<4200?"backoff":t.code<4300?"retry":"refused"},getCloseError:function(t){return 1e3!==t.code&&1001!==t.code?{type:"PusherError",data:{code:t.code,message:t.reason||t.message}}:null}},Z=K,tt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),et=function(t){function e(e,n){var o=t.call(this)||this;return o.id=e,o.transport=n,o.activityTimeout=n.activityTimeout,o.bindListeners(),o}return tt(e,t),e.prototype.handlesActivityChecks=function(){return this.transport.handlesActivityChecks()},e.prototype.send=function(t){return this.transport.send(t)},e.prototype.send_event=function(t,e,n){var o={event:t,data:e};return n&&(o.channel=n),B.debug("Event sent",o),this.send(Z.encodeMessage(o))},e.prototype.ping=function(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})},e.prototype.close=function(){this.transport.close()},e.prototype.bindListeners=function(){var t=this,e={message:function(e){var n;try{n=Z.decodeMessage(e)}catch(n){t.emit("error",{type:"MessageParseError",error:n,data:e.data})}if(void 0!==n){switch(B.debug("Event recd",n),n.event){case"pusher:error":t.emit("error",{type:"PusherError",data:n.data});break;case"pusher:ping":t.emit("ping");break;case"pusher:pong":t.emit("pong")}t.emit("message",n)}},activity:function(){t.emit("activity")},error:function(e){t.emit("error",e)},closed:function(e){n(),e&&e.code&&t.handleCloseEvent(e),t.transport=null,t.emit("closed")}},n=function(){k(e,(function(e,n){t.transport.unbind(n,e)}))};k(e,(function(e,n){t.transport.bind(n,e)}))},e.prototype.handleCloseEvent=function(t){var e=Z.getCloseAction(t),n=Z.getCloseError(t);n&&this.emit("error",n),e&&this.emit(e,{action:e,error:n})},e}(z),nt=function(){function t(t,e){this.transport=t,this.callback=e,this.bindListeners()}return t.prototype.close=function(){this.unbindListeners(),this.transport.close()},t.prototype.bindListeners=function(){var t=this;this.onMessage=function(e){var n;t.unbindListeners();try{n=Z.processHandshake(e)}catch(e){return t.finish("error",{error:e}),void t.transport.close()}"connected"===n.action?t.finish("connected",{connection:new et(n.id,t.transport),activityTimeout:n.activityTimeout}):(t.finish(n.action,{error:n.error}),t.transport.close())},this.onClosed=function(e){t.unbindListeners();var n=Z.getCloseAction(e)||"backoff",o=Z.getCloseError(e);t.finish(n,{error:o})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)},t.prototype.unbindListeners=function(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)},t.prototype.finish=function(t,e){this.callback(_({transport:this.transport,action:t},e))},t}(),ot=function(){function t(t,e){this.channel=t;var n=e.authTransport;if(void 0===re.getAuthorizers()[n])throw"'"+n+"' is not a recognized auth transport";this.type=n,this.options=e,this.authOptions=e.auth||{}}return t.prototype.composeQuery=function(t){var e="socket_id="+encodeURIComponent(t)+"&channel_name="+encodeURIComponent(this.channel.name);for(var n in this.authOptions.params)e+="&"+encodeURIComponent(n)+"="+encodeURIComponent(this.authOptions.params[n]);return e},t.prototype.authorize=function(e,n){t.authorizers=t.authorizers||re.getAuthorizers(),t.authorizers[this.type].call(this,re,e,n)},t}(),rt=function(){function t(t,e){this.timeline=t,this.options=e||{}}return t.prototype.send=function(t,e){this.timeline.isEmpty()||this.timeline.send(re.TimelineTransport.getAgent(this,t),e)},t}(),it=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),st=function(t){function e(e){var n=this.constructor,o=t.call(this,e)||this;return Object.setPrototypeOf(o,n.prototype),o}return it(e,t),e}(Error),ct=(function(t){function e(e){var n=this.constructor,o=t.call(this,e)||this;return Object.setPrototypeOf(o,n.prototype),o}it(e,t)}(Error),function(t){function e(e){var n=this.constructor,o=t.call(this,e)||this;return Object.setPrototypeOf(o,n.prototype),o}return it(e,t),e}(Error)),at=function(t){function e(e){var n=this.constructor,o=t.call(this,e)||this;return Object.setPrototypeOf(o,n.prototype),o}return it(e,t),e}(Error),ut=function(t){function e(e){var n=this.constructor,o=t.call(this,e)||this;return Object.setPrototypeOf(o,n.prototype),o}return it(e,t),e}(Error),ht=function(t){function e(e){var n=this.constructor,o=t.call(this,e)||this;return Object.setPrototypeOf(o,n.prototype),o}return it(e,t),e}(Error),pt=function(t){function e(e){var n=this.constructor,o=t.call(this,e)||this;return Object.setPrototypeOf(o,n.prototype),o}return it(e,t),e}(Error),lt=function(t){function e(e,n){var o=this.constructor,r=t.call(this,n)||this;return r.status=e,Object.setPrototypeOf(r,o.prototype),r}return it(e,t),e}(Error),ft={baseUrl:"https://pusher.com",urls:{authenticationEndpoint:{path:"/docs/authenticating_users"},javascriptQuickStart:{path:"/docs/javascript_quick_start"},triggeringClientEvents:{path:"/docs/client_api_guide/client_events#trigger-events"},encryptedChannelSupport:{fullUrl:"https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support"}}},dt=function(t){var e,n=ft.urls[t];return n?(n.fullUrl?e=n.fullUrl:n.path&&(e=ft.baseUrl+n.path),e?"See: "+e:""):""},yt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),gt=function(t){function e(e,n){var o=t.call(this,(function(t,n){B.debug("No callbacks on "+e+" for "+t)}))||this;return o.name=e,o.pusher=n,o.subscribed=!1,o.subscriptionPending=!1,o.subscriptionCancelled=!1,o}return yt(e,t),e.prototype.authorize=function(t,e){return e(null,{auth:""})},e.prototype.trigger=function(t,e){if(0!==t.indexOf("client-"))throw new st("Event '"+t+"' does not start with 'client-'");if(!this.subscribed){var n=dt("triggeringClientEvents");B.warn("Client event triggered before channel 'subscription_succeeded' event . "+n)}return this.pusher.send_event(t,e,this.name)},e.prototype.disconnect=function(){this.subscribed=!1,this.subscriptionPending=!1},e.prototype.handleEvent=function(t){var e=t.event,n=t.data;if("pusher_internal:subscription_succeeded"===e)this.handleSubscriptionSucceededEvent(t);else if(0!==e.indexOf("pusher_internal:")){this.emit(e,n,{})}},e.prototype.handleSubscriptionSucceededEvent=function(t){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",t.data)},e.prototype.subscribe=function(){var t=this;this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,(function(e,n){e?(B.error(e.toString()),t.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:e.message},e instanceof lt?{status:e.status}:{}))):t.pusher.send_event("pusher:subscribe",{auth:n.auth,channel_data:n.channel_data,channel:t.name})})))},e.prototype.unsubscribe=function(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})},e.prototype.cancelSubscription=function(){this.subscriptionCancelled=!0},e.prototype.reinstateSubscription=function(){this.subscriptionCancelled=!1},e}(z),bt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),vt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return bt(e,t),e.prototype.authorize=function(t,e){return Lt.createAuthorizer(this,this.pusher.config).authorize(t,e)},e}(gt),mt=function(){function t(){this.reset()}return t.prototype.get=function(t){return Object.prototype.hasOwnProperty.call(this.members,t)?{id:t,info:this.members[t]}:null},t.prototype.each=function(t){var e=this;k(this.members,(function(n,o){t(e.get(o))}))},t.prototype.setMyID=function(t){this.myID=t},t.prototype.onSubscription=function(t){this.members=t.presence.hash,this.count=t.presence.count,this.me=this.get(this.myID)},t.prototype.addMember=function(t){return null===this.get(t.user_id)&&this.count++,this.members[t.user_id]=t.user_info,this.get(t.user_id)},t.prototype.removeMember=function(t){var e=this.get(t.user_id);return e&&(delete this.members[t.user_id],this.count--),e},t.prototype.reset=function(){this.members={},this.count=0,this.myID=null,this.me=null},t}(),_t=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),St=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.members=new mt,o}return _t(e,t),e.prototype.authorize=function(e,n){var o=this;t.prototype.authorize.call(this,e,(function(t,e){if(!t){if(void 0===(e=e).channel_data){var r=dt("authenticationEndpoint");return B.error("Invalid auth response for channel '"+o.name+"',expected 'channel_data' field. "+r),void n("Invalid auth response")}var i=JSON.parse(e.channel_data);o.members.setMyID(i.user_id)}n(t,e)}))},e.prototype.handleEvent=function(t){var e=t.event;if(0===e.indexOf("pusher_internal:"))this.handleInternalEvent(t);else{var n=t.data,o={};t.user_id&&(o.user_id=t.user_id),this.emit(e,n,o)}},e.prototype.handleInternalEvent=function(t){var e=t.event,n=t.data;switch(e){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(t);break;case"pusher_internal:member_added":var o=this.members.addMember(n);this.emit("pusher:member_added",o);break;case"pusher_internal:member_removed":var r=this.members.removeMember(n);r&&this.emit("pusher:member_removed",r)}},e.prototype.handleSubscriptionSucceededEvent=function(t){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(t.data),this.emit("pusher:subscription_succeeded",this.members))},e.prototype.disconnect=function(){this.members.reset(),t.prototype.disconnect.call(this)},e}(vt),wt=n(1),kt=n(0),Ct=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Tt=function(t){function e(e,n,o){var r=t.call(this,e,n)||this;return r.key=null,r.nacl=o,r}return Ct(e,t),e.prototype.authorize=function(e,n){var o=this;t.prototype.authorize.call(this,e,(function(t,e){if(t)n(t,e);else{var r=e.shared_secret;r?(o.key=Object(kt.decode)(r),delete e.shared_secret,n(null,e)):n(new Error("No shared_secret key in auth payload for encrypted channel: "+o.name),null)}}))},e.prototype.trigger=function(t,e){throw new ut("Client events are not currently supported for encrypted channels")},e.prototype.handleEvent=function(e){var n=e.event,o=e.data;0!==n.indexOf("pusher_internal:")&&0!==n.indexOf("pusher:")?this.handleEncryptedEvent(n,o):t.prototype.handleEvent.call(this,e)},e.prototype.handleEncryptedEvent=function(t,e){var n=this;if(this.key)if(e.ciphertext&&e.nonce){var o=Object(kt.decode)(e.ciphertext);if(o.length0&&this.emit("connecting_in",Math.round(t/1e3)),this.retryTimer=new b(t||0,(function(){e.disconnectInternally(),e.connect()}))},e.prototype.clearRetryTimer=function(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)},e.prototype.setUnavailableTimer=function(){var t=this;this.unavailableTimer=new b(this.options.unavailableTimeout,(function(){t.updateState("unavailable")}))},e.prototype.clearUnavailableTimer=function(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()},e.prototype.sendActivityCheck=function(){var t=this;this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new b(this.options.pongTimeout,(function(){t.timeline.error({pong_timed_out:t.options.pongTimeout}),t.retryIn(0)}))},e.prototype.resetActivityCheck=function(){var t=this;this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new b(this.activityTimeout,(function(){t.sendActivityCheck()})))},e.prototype.stopActivityCheck=function(){this.activityTimer&&this.activityTimer.ensureAborted()},e.prototype.buildConnectionCallbacks=function(t){var e=this;return _({},t,{message:function(t){e.resetActivityCheck(),e.emit("message",t)},ping:function(){e.send_event("pusher:pong",{})},activity:function(){e.resetActivityCheck()},error:function(t){e.emit("error",t)},closed:function(){e.abandonConnection(),e.shouldRetry()&&e.retryIn(1e3)}})},e.prototype.buildHandshakeCallbacks=function(t){var e=this;return _({},t,{connected:function(t){e.activityTimeout=Math.min(e.options.activityTimeout,t.activityTimeout,t.connection.activityTimeout||1/0),e.clearUnavailableTimer(),e.setConnection(t.connection),e.socket_id=e.connection.id,e.updateState("connected",{socket_id:e.socket_id})}})},e.prototype.buildErrorCallbacks=function(){var t=this,e=function(e){return function(n){n.error&&t.emit("error",{type:"WebSocketError",error:n.error}),e(n)}};return{tls_only:e((function(){t.usingTLS=!0,t.updateStrategy(),t.retryIn(0)})),refused:e((function(){t.disconnect()})),backoff:e((function(){t.retryIn(1e3)})),retry:e((function(){t.retryIn(0)}))}},e.prototype.setConnection=function(t){for(var e in this.connection=t,this.connectionCallbacks)this.connection.bind(e,this.connectionCallbacks[e]);this.resetActivityCheck()},e.prototype.abandonConnection=function(){if(this.connection){for(var t in this.stopActivityCheck(),this.connectionCallbacks)this.connection.unbind(t,this.connectionCallbacks[t]);var e=this.connection;return this.connection=null,e}},e.prototype.updateState=function(t,e){var n=this.state;if(this.state=t,n!==t){var o=t;"connected"===o&&(o+=" with new socket ID "+e.socket_id),B.debug("State changed",n+" -> "+o),this.timeline.info({state:t,params:e}),this.emit("state_change",{previous:n,current:t}),this.emit(t,e)}},e.prototype.shouldRetry=function(){return"connecting"===this.state||"connected"===this.state},e}(z),Et=function(){function t(){this.channels={}}return t.prototype.add=function(t,e){return this.channels[t]||(this.channels[t]=function(t,e){if(0===t.indexOf("private-encrypted-")){if(e.config.nacl)return Lt.createEncryptedChannel(t,e,e.config.nacl);var n=dt("encryptedChannelSupport");throw new ut("Tried to subscribe to a private-encrypted- channel but no nacl implementation available. "+n)}return 0===t.indexOf("private-")?Lt.createPrivateChannel(t,e):0===t.indexOf("presence-")?Lt.createPresenceChannel(t,e):Lt.createChannel(t,e)}(t,e)),this.channels[t]},t.prototype.all=function(){return function(t){var e=[];return k(t,(function(t){e.push(t)})),e}(this.channels)},t.prototype.find=function(t){return this.channels[t]},t.prototype.remove=function(t){var e=this.channels[t];return delete this.channels[t],e},t.prototype.disconnect=function(){k(this.channels,(function(t){t.disconnect()}))},t}();var Lt={createChannels:function(){return new Et},createConnectionManager:function(t,e){return new Ot(t,e)},createChannel:function(t,e){return new gt(t,e)},createPrivateChannel:function(t,e){return new vt(t,e)},createPresenceChannel:function(t,e){return new St(t,e)},createEncryptedChannel:function(t,e,n){return new Tt(t,e,n)},createTimelineSender:function(t,e){return new rt(t,e)},createAuthorizer:function(t,e){return e.authorizer?e.authorizer(t,e):new ot(t,e)},createHandshake:function(t,e){return new nt(t,e)},createAssistantToTheTransportManager:function(t,e,n){return new $(t,e,n)}},At=function(){function t(t){this.options=t||{},this.livesLeft=this.options.lives||1/0}return t.prototype.getAssistant=function(t){return Lt.createAssistantToTheTransportManager(this,t,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})},t.prototype.isAlive=function(){return this.livesLeft>0},t.prototype.reportDeath=function(){this.livesLeft-=1},t}(),xt=function(){function t(t,e){this.strategies=t,this.loop=Boolean(e.loop),this.failFast=Boolean(e.failFast),this.timeout=e.timeout,this.timeoutLimit=e.timeoutLimit}return t.prototype.isSupported=function(){return L(this.strategies,m.method("isSupported"))},t.prototype.connect=function(t,e){var n=this,o=this.strategies,r=0,i=this.timeout,s=null,c=function(a,u){u?e(null,u):(r+=1,n.loop&&(r%=o.length),r0&&(r=new b(n.timeout,(function(){i.abort(),o(!0)}))),i=t.connect(e,(function(t,e){t&&r&&r.isRunning()&&!n.failFast||(r&&r.ensureAborted(),o(t,e))})),{abort:function(){r&&r.ensureAborted(),i.abort()},forceMinPriority:function(t){i.forceMinPriority(t)}}},t}(),jt=function(){function t(t){this.strategies=t}return t.prototype.isSupported=function(){return L(this.strategies,m.method("isSupported"))},t.prototype.connect=function(t,e){return function(t,e,n){var o=P(t,(function(t,o,r,i){return t.connect(e,n(o,i))}));return{abort:function(){T(o,Rt)},forceMinPriority:function(t){T(o,(function(e){e.forceMinPriority(t)}))}}}(this.strategies,t,(function(t,n){return function(o,r){n[t].error=o,o?function(t){return function(t,e){for(var n=0;n=m.now()){var i=this.transports[o.transport];i&&(this.timeline.info({cached:!0,transport:o.transport,latency:o.latency}),r.push(new xt([i],{timeout:2*o.latency+1e3,failFast:!0})))}var s=m.now(),c=r.pop().connect(t,(function o(i,a){i?(Mt(n),r.length>0?(s=m.now(),c=r.pop().connect(t,o)):e(i)):(!function(t,e,n){var o=re.getLocalStorage();if(o)try{o[Dt(t)]=j({timestamp:m.now(),transport:e,latency:n})}catch(t){}}(n,a.transport.name,m.now()-s),e(null,a))}));return{abort:function(){c.abort()},forceMinPriority:function(e){t=e,c&&c.forceMinPriority(e)}}},t}();function Dt(t){return"pusherTransport"+(t?"TLS":"NonTLS")}function Mt(t){var e=re.getLocalStorage();if(e)try{delete e[Dt(t)]}catch(t){}}var Nt=function(){function t(t,e){var n=e.delay;this.strategy=t,this.options={delay:n}}return t.prototype.isSupported=function(){return this.strategy.isSupported()},t.prototype.connect=function(t,e){var n,o=this.strategy,r=new b(this.options.delay,(function(){n=o.connect(t,e)}));return{abort:function(){r.ensureAborted(),n&&n.abort()},forceMinPriority:function(e){t=e,n&&n.forceMinPriority(e)}}},t}(),Ht=function(){function t(t,e,n){this.test=t,this.trueBranch=e,this.falseBranch=n}return t.prototype.isSupported=function(){return(this.test()?this.trueBranch:this.falseBranch).isSupported()},t.prototype.connect=function(t,e){return(this.test()?this.trueBranch:this.falseBranch).connect(t,e)},t}(),Ut=function(){function t(t){this.strategy=t}return t.prototype.isSupported=function(){return this.strategy.isSupported()},t.prototype.connect=function(t,e){var n=this.strategy.connect(t,(function(t,o){o&&n.abort(),e(t,o)}));return n},t}();function zt(t){return function(){return t.isSupported()}}var Bt,Ft=function(t,e,n){var o={};function r(e,r,i,s,c){var a=n(t,e,r,i,s,c);return o[e]=a,a}var i,s=Object.assign({},e,{hostNonTLS:t.wsHost+":"+t.wsPort,hostTLS:t.wsHost+":"+t.wssPort,httpPath:t.wsPath}),c=_({},s,{useTLS:!0}),a=Object.assign({},e,{hostNonTLS:t.httpHost+":"+t.httpPort,hostTLS:t.httpHost+":"+t.httpsPort,httpPath:t.httpPath}),u={loop:!0,timeout:15e3,timeoutLimit:6e4},h=new At({lives:2,minPingDelay:1e4,maxPingDelay:t.activityTimeout}),p=new At({lives:2,minPingDelay:1e4,maxPingDelay:t.activityTimeout}),l=r("ws","ws",3,s,h),f=r("wss","ws",3,c,h),d=r("xhr_streaming","xhr_streaming",1,a,p),y=r("xhr_polling","xhr_polling",1,a),g=new xt([l],u),b=new xt([f],u),v=new xt([d],u),m=new xt([y],u),S=new xt([new Ht(zt(v),new jt([v,new Nt(m,{delay:4e3})]),m)],u);return i=e.useTLS?new jt([g,new Nt(S,{delay:2e3})]):new jt([g,new Nt(b,{delay:2e3}),new Nt(S,{delay:5e3})]),new It(new Ut(new Ht(zt(l),i,S)),o,{ttl:18e5,timeline:e.timeline,useTLS:e.useTLS})},qt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Jt=function(t){function e(e,n,o){var r=t.call(this)||this;return r.hooks=e,r.method=n,r.url=o,r}return qt(e,t),e.prototype.start=function(t){var e=this;this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=function(){e.close()},re.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(t)},e.prototype.close=function(){this.unloader&&(re.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)},e.prototype.onChunk=function(t,e){for(;;){var n=this.advanceBuffer(e);if(!n)break;this.emit("chunk",{status:t,data:n})}this.isBufferTooLong(e)&&this.emit("buffer_too_long")},e.prototype.advanceBuffer=function(t){var e=t.slice(this.position),n=e.indexOf("\n");return-1!==n?(this.position+=n+1,e.slice(0,n)):null},e.prototype.isBufferTooLong=function(t){return this.position===t.length&&t.length>262144},e}(z);!function(t){t[t.CONNECTING=0]="CONNECTING",t[t.OPEN=1]="OPEN",t[t.CLOSED=3]="CLOSED"}(Bt||(Bt={}));var Wt=Bt,Xt=1;function Gt(t){var e=-1===t.indexOf("?")?"?":"&";return t+e+"t="+ +new Date+"&n="+Xt++}function Qt(t){return Math.floor(Math.random()*t)}var Vt,Yt=function(){function t(t,e){this.hooks=t,this.session=Qt(1e3)+"/"+function(t){for(var e=[],n=0;n0&&t.onChunk(e.status,e.responseText);break;case 4:e.responseText&&e.responseText.length>0&&t.onChunk(e.status,e.responseText),t.emit("finished",e.status),t.close()}},e},abortRequest:function(t){t.onreadystatechange=null,t.abort()}},te={getDefaultStrategy:Ft,Transports:Y,transportConnectionInitializer:function(){this.timeline.info(this.buildTimelineMessage({transport:this.name+(this.options.useTLS?"s":"")})),this.hooks.isInitialized()?this.changeState("initialized"):this.onClose()},HTTPFactory:{createStreamingSocket:function(t){return this.createSocket($t,t)},createPollingSocket:function(t){return this.createSocket(Kt,t)},createSocket:function(t,e){return new Yt(t,e)},createXHR:function(t,e){return this.createRequest(Zt,t,e)},createRequest:function(t,e,n){return new Jt(t,e,n)}},setup:function(t){t.ready()},getLocalStorage:function(){},getClientFeatures:function(){return C(E({ws:Y.ws},(function(t){return t.isSupported({})})))},getProtocol:function(){return"http:"},isXHRSupported:function(){return!0},createSocketRequest:function(t,e){if(this.isXHRSupported())return this.HTTPFactory.createXHR(t,e);throw"Cross-origin HTTP requests are not supported"},createXHR:function(){return new(this.getXHRAPI())},createWebSocket:function(t){return new(this.getWebSocketAPI())(t)},addUnloadListener:function(t){},removeUnloadListener:function(t){}},ee=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),ne=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ee(e,t),e.prototype.isOnline=function(){return!0},e}(z)),oe=function(t,e,n){var o=new Headers;for(var r in o.set("Content-Type","application/x-www-form-urlencoded"),this.authOptions.headers)o.set(r,this.authOptions.headers[r]);var i=this.composeQuery(e),s=new Request(this.options.authEndpoint,{headers:o,body:i,credentials:"same-origin",method:"POST"});return fetch(s).then((function(t){var e=t.status;if(200===e)return t.text();throw new lt(200,"Could not get auth info from your auth endpoint, status: "+e)})).then((function(t){var e;try{e=JSON.parse(t)}catch(e){throw new lt(200,"JSON returned from auth endpoint was invalid, yet status code was 200. Data was: "+t)}n(null,e)})).catch((function(t){n(t,{auth:""})}))},re={getDefaultStrategy:te.getDefaultStrategy,Transports:te.Transports,setup:te.setup,getProtocol:te.getProtocol,isXHRSupported:te.isXHRSupported,getLocalStorage:te.getLocalStorage,createXHR:te.createXHR,createWebSocket:te.createWebSocket,addUnloadListener:te.addUnloadListener,removeUnloadListener:te.removeUnloadListener,transportConnectionInitializer:te.transportConnectionInitializer,createSocketRequest:te.createSocketRequest,HTTPFactory:te.HTTPFactory,TimelineTransport:{name:"xhr",getAgent:function(t,e){return function(n,o){var r="http"+(e?"s":"")+"://"+(t.host||t.options.host)+t.options.path,i=x(n);fetch(r+="/2?"+i).then((function(t){if(200!==t.status)throw"received "+t.status+" from stats.pusher.com";return t.json()})).then((function(e){var n=e.host;n&&(t.host=n)})).catch((function(t){B.debug("TimelineSender Error: ",t)}))}}},getAuthorizers:function(){return{ajax:oe}},getWebSocketAPI:function(){return WebSocket},getXHRAPI:function(){return XMLHttpRequest},getNetwork:function(){return ne}};!function(t){t[t.ERROR=3]="ERROR",t[t.INFO=6]="INFO",t[t.DEBUG=7]="DEBUG"}(Vt||(Vt={}));var ie=Vt,se=function(){function t(t,e,n){this.key=t,this.session=e,this.events=[],this.options=n||{},this.sent=0,this.uniqueID=0}return t.prototype.log=function(t,e){t<=this.options.level&&(this.events.push(_({},e,{timestamp:m.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())},t.prototype.error=function(t){this.log(ie.ERROR,t)},t.prototype.info=function(t){this.log(ie.INFO,t)},t.prototype.debug=function(t){this.log(ie.DEBUG,t)},t.prototype.isEmpty=function(){return 0===this.events.length},t.prototype.send=function(t,e){var n=this,o=_({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],t(o,(function(t,o){t||n.sent++,e&&e(t,o)})),!0},t.prototype.generateUniqueID=function(){return this.uniqueID++,this.uniqueID},t}(),ce=function(){function t(t,e,n,o){this.name=t,this.priority=e,this.transport=n,this.options=o||{}}return t.prototype.isSupported=function(){return this.transport.isSupported({useTLS:this.options.useTLS})},t.prototype.connect=function(t,e){var n=this;if(!this.isSupported())return ae(new pt,e);if(this.priority void;
+export declare type AuthorizerCallback = (error: Error | null, authData: AuthData) => void;
export interface Authorizer {
authorize(socketId: string, callback: AuthorizerCallback): void;
}
diff --git a/types/src/core/channels/encrypted_channel.d.ts b/types/src/core/channels/encrypted_channel.d.ts
index 0eff3f355..9258b49a1 100644
--- a/types/src/core/channels/encrypted_channel.d.ts
+++ b/types/src/core/channels/encrypted_channel.d.ts
@@ -1,6 +1,5 @@
import PrivateChannel from './private_channel';
import Pusher from '../pusher';
-import Dispatcher from '../events/dispatcher';
import { PusherEvent } from '../connection/protocol/message-types';
import { AuthorizerCallback } from '../auth/options';
import * as nacl from 'tweetnacl';
@@ -12,5 +11,5 @@ export default class EncryptedChannel extends PrivateChannel {
trigger(event: string, data: any): boolean;
handleEvent(event: PusherEvent): void;
private handleEncryptedEvent;
- emitJSON(eventName: string, data?: any): Dispatcher;
+ getDataToEmit(bytes: Uint8Array): string;
}
diff --git a/types/src/core/errors.d.ts b/types/src/core/errors.d.ts
index c64cf72fe..50f61f306 100644
--- a/types/src/core/errors.d.ts
+++ b/types/src/core/errors.d.ts
@@ -19,3 +19,7 @@ export declare class UnsupportedTransport extends Error {
export declare class UnsupportedStrategy extends Error {
constructor(msg?: string);
}
+export declare class HTTPAuthError extends Error {
+ status: number;
+ constructor(status: number, msg?: string);
+}