mario-core 2.0.126-release → 2.0.127-release

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/Dashboard-BtSsn3Vo.mjs +206 -0
  2. package/dist/Dashboard-uzWPTPcg.js +1 -0
  3. package/dist/EmailTemplateDetail-CrW66rV6.js +1 -0
  4. package/dist/EmailTemplateDetail-siQwIfEp.mjs +443 -0
  5. package/dist/EmailTemplateList-DJUKGiSG.js +1 -0
  6. package/dist/EmailTemplateList-DYa5U3BY.mjs +170 -0
  7. package/dist/GalleryList-Bd9QQfIE.mjs +329 -0
  8. package/dist/GalleryList-pp4RkxC5.js +1 -0
  9. package/dist/Login-DvOFdAym.mjs +1699 -0
  10. package/dist/Login-h9gmLFZK.js +1 -0
  11. package/dist/NotificationList-DGtOVsRX.js +2 -0
  12. package/dist/NotificationList-XQ66giFX.mjs +3658 -0
  13. package/dist/SkillList-CDUc-Zc4.mjs +386 -0
  14. package/dist/SkillList-CLlJoF6w.js +1 -0
  15. package/dist/TeacherSelector-D56z1NkG.mjs +30 -0
  16. package/dist/TeacherSelector-UxolyB8k.js +1 -0
  17. package/dist/TheContent-CoA7bs3f.js +1 -0
  18. package/dist/TheContent-DZUdjJzj.mjs +38 -0
  19. package/dist/UserContainer-BToGqWO5.mjs +2696 -0
  20. package/dist/UserContainer-Bs9uVUtT.js +5 -0
  21. package/dist/UserDetail-BMuvkpEQ.js +1 -0
  22. package/dist/UserDetail-BgE9xLhy.mjs +912 -0
  23. package/dist/UserList-BuV21Pjg.js +7 -0
  24. package/dist/UserList-DdXF-Zcw.mjs +1512 -0
  25. package/dist/constants-DC5ON0TF.mjs +241 -0
  26. package/dist/constants-DoUJBhKz.js +1 -0
  27. package/dist/index-B9R5BJ7_.mjs +19607 -0
  28. package/dist/index-DenbcZA6.js +15 -0
  29. package/dist/index.js +1 -1
  30. package/dist/index.modern.js +15 -15
  31. package/dist/mailCategoryService-BJjQgqsM.mjs +11 -0
  32. package/dist/mailCategoryService-Dwo0Q0wk.js +1 -0
  33. package/dist/userService-CNkSvMtf.js +1 -0
  34. package/dist/userService-DsXLHOjx.mjs +47 -0
  35. package/package.json +1 -1
@@ -0,0 +1,3658 @@
1
+ import { jsx as pt, jsxs as Gt } from "react/jsx-runtime";
2
+ import { Input as jn, Row as Vr, Col as Un, Table as Qr, UncontrolledTooltip as ti, Button as ei } from "reactstrap";
3
+ import { K as ni, a2 as ri, i as gn, B as ii, b as Mn, ay as oi, c as dn, R as Bn, ai as si, W as ai, X as fi, az as ci } from "./index-B9R5BJ7_.mjs";
4
+ import { memo as ui, useState as Dn, useCallback as xn, useEffect as Hn } from "react";
5
+ import { useDispatch as hi, useSelector as Te } from "react-redux";
6
+ import { useParams as li } from "react-router-dom";
7
+ import { useTranslation as pi } from "react-i18next";
8
+ function di(dt) {
9
+ return ni({ attr: { viewBox: "0 0 256 256", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M103.77,185.94C103.38,187.49,93.63,224,40,224a8,8,0,0,1-8-8c0-53.63,36.51-63.38,38.06-63.77a8,8,0,0,1,3.88,15.53c-.9.25-22.42,6.54-25.56,39.86C81.7,204.48,88,183,88.26,182a8,8,0,0,1,15.51,4Zm93-67.4L192,123.31v58.33A15.91,15.91,0,0,1,187.32,193L153,227.3A15.91,15.91,0,0,1,141.7,232a16.11,16.11,0,0,1-5.1-.83,15.94,15.94,0,0,1-10.78-12.92l-5.37-38.49L76.24,135.55l-38.47-5.37A16,16,0,0,1,28.7,103L63,68.68A15.91,15.91,0,0,1,74.36,64h58.33l4.77-4.77c26.68-26.67,58.83-27.82,71.41-27.07a16,16,0,0,1,15,15C224.6,59.71,223.45,91.86,196.78,118.54ZM40,114.34l37.15,5.18L116.69,80H74.36ZM91.32,128,128,164.68l57.45-57.45a76.46,76.46,0,0,0,22.42-59.16,76.65,76.65,0,0,0-59.11,22.47ZM176,139.31l-39.53,39.53L141.67,216,176,181.64Z" } }] })(dt);
10
+ }
11
+ const xi = [
12
+ { value: !0, label: "Read" },
13
+ { value: !1, label: "Unread" }
14
+ ], vi = ({ value: dt, onChange: Xt }) => /* @__PURE__ */ pt(
15
+ ri,
16
+ {
17
+ defaultValue: dt,
18
+ options: xi,
19
+ onChange: Xt,
20
+ styles: {
21
+ menu: (G) => ({ ...G, zIndex: 10 }),
22
+ control: (G, ut) => ({
23
+ ...G,
24
+ borderRadius: "24px",
25
+ borderColor: (ut.isFocused, "#e5e7eb"),
26
+ boxShadow: "none",
27
+ minHeight: "42px",
28
+ "&:hover": {
29
+ borderColor: "#e5e7eb"
30
+ }
31
+ }),
32
+ valueContainer: (G) => ({
33
+ ...G,
34
+ padding: "0 16px"
35
+ }),
36
+ indicatorSeparator: () => ({
37
+ display: "none"
38
+ }),
39
+ dropdownIndicator: (G) => ({
40
+ ...G,
41
+ padding: "0 12px 0 0",
42
+ color: "#9ca3af"
43
+ })
44
+ }
45
+ }
46
+ ), yi = ui(vi);
47
+ function gi(dt) {
48
+ return dt && dt.__esModule && Object.prototype.hasOwnProperty.call(dt, "default") ? dt.default : dt;
49
+ }
50
+ var vn = { exports: {} };
51
+ var zn;
52
+ function _i() {
53
+ return zn || (zn = 1, (function(dt, Xt) {
54
+ (function(G, ut) {
55
+ dt.exports = ut();
56
+ })(window, function() {
57
+ return (
58
+ /******/
59
+ (function(Ct) {
60
+ var G = {};
61
+ function ut(S) {
62
+ if (G[S])
63
+ return G[S].exports;
64
+ var v = G[S] = {
65
+ /******/
66
+ i: S,
67
+ /******/
68
+ l: !1,
69
+ /******/
70
+ exports: {}
71
+ /******/
72
+ };
73
+ return Ct[S].call(v.exports, v, v.exports, ut), v.l = !0, v.exports;
74
+ }
75
+ return ut.m = Ct, ut.c = G, ut.d = function(S, v, St) {
76
+ ut.o(S, v) || Object.defineProperty(S, v, { enumerable: !0, get: St });
77
+ }, ut.r = function(S) {
78
+ typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(S, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(S, "__esModule", { value: !0 });
79
+ }, ut.t = function(S, v) {
80
+ if (v & 1 && (S = ut(S)), v & 8 || v & 4 && typeof S == "object" && S && S.__esModule) return S;
81
+ var St = /* @__PURE__ */ Object.create(null);
82
+ if (ut.r(St), Object.defineProperty(St, "default", { enumerable: !0, value: S }), v & 2 && typeof S != "string") for (var ot in S) ut.d(St, ot, (function(Ht) {
83
+ return S[Ht];
84
+ }).bind(null, ot));
85
+ return St;
86
+ }, ut.n = function(S) {
87
+ var v = S && S.__esModule ? (
88
+ /******/
89
+ function() {
90
+ return S.default;
91
+ }
92
+ ) : (
93
+ /******/
94
+ function() {
95
+ return S;
96
+ }
97
+ );
98
+ return ut.d(v, "a", v), v;
99
+ }, ut.o = function(S, v) {
100
+ return Object.prototype.hasOwnProperty.call(S, v);
101
+ }, ut.p = "", ut(ut.s = 3);
102
+ })([
103
+ /* 0 */
104
+ /***/
105
+ (function(Ct, G, ut) {
106
+ var S = this && this.__extends || /* @__PURE__ */ (function() {
107
+ var z = function(T, L) {
108
+ return z = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(W, M) {
109
+ W.__proto__ = M;
110
+ } || function(W, M) {
111
+ for (var mt in M) M.hasOwnProperty(mt) && (W[mt] = M[mt]);
112
+ }, z(T, L);
113
+ };
114
+ return function(T, L) {
115
+ z(T, L);
116
+ function W() {
117
+ this.constructor = T;
118
+ }
119
+ T.prototype = L === null ? Object.create(L) : (W.prototype = L.prototype, new W());
120
+ };
121
+ })();
122
+ Object.defineProperty(G, "__esModule", { value: !0 });
123
+ var v = 256, St = (
124
+ /** @class */
125
+ (function() {
126
+ function z(T) {
127
+ T === void 0 && (T = "="), this._paddingCharacter = T;
128
+ }
129
+ return z.prototype.encodedLength = function(T) {
130
+ return this._paddingCharacter ? (T + 2) / 3 * 4 | 0 : (T * 8 + 5) / 6 | 0;
131
+ }, z.prototype.encode = function(T) {
132
+ for (var L = "", W = 0; W < T.length - 2; W += 3) {
133
+ var M = T[W] << 16 | T[W + 1] << 8 | T[W + 2];
134
+ L += this._encodeByte(M >>> 18 & 63), L += this._encodeByte(M >>> 12 & 63), L += this._encodeByte(M >>> 6 & 63), L += this._encodeByte(M >>> 0 & 63);
135
+ }
136
+ var mt = T.length - W;
137
+ if (mt > 0) {
138
+ var M = T[W] << 16 | (mt === 2 ? T[W + 1] << 8 : 0);
139
+ L += this._encodeByte(M >>> 18 & 63), L += this._encodeByte(M >>> 12 & 63), mt === 2 ? L += this._encodeByte(M >>> 6 & 63) : L += this._paddingCharacter || "", L += this._paddingCharacter || "";
140
+ }
141
+ return L;
142
+ }, z.prototype.maxDecodedLength = function(T) {
143
+ return this._paddingCharacter ? T / 4 * 3 | 0 : (T * 6 + 7) / 8 | 0;
144
+ }, z.prototype.decodedLength = function(T) {
145
+ return this.maxDecodedLength(T.length - this._getPaddingLength(T));
146
+ }, z.prototype.decode = function(T) {
147
+ if (T.length === 0)
148
+ return new Uint8Array(0);
149
+ for (var L = this._getPaddingLength(T), W = T.length - L, M = new Uint8Array(this.maxDecodedLength(W)), mt = 0, nt = 0, $t = 0, Kt = 0, Mt = 0, zt = 0, Bt = 0; nt < W - 4; nt += 4)
150
+ Kt = this._decodeChar(T.charCodeAt(nt + 0)), Mt = this._decodeChar(T.charCodeAt(nt + 1)), zt = this._decodeChar(T.charCodeAt(nt + 2)), Bt = this._decodeChar(T.charCodeAt(nt + 3)), M[mt++] = Kt << 2 | Mt >>> 4, M[mt++] = Mt << 4 | zt >>> 2, M[mt++] = zt << 6 | Bt, $t |= Kt & v, $t |= Mt & v, $t |= zt & v, $t |= Bt & v;
151
+ if (nt < W - 1 && (Kt = this._decodeChar(T.charCodeAt(nt)), Mt = this._decodeChar(T.charCodeAt(nt + 1)), M[mt++] = Kt << 2 | Mt >>> 4, $t |= Kt & v, $t |= Mt & v), nt < W - 2 && (zt = this._decodeChar(T.charCodeAt(nt + 2)), M[mt++] = Mt << 4 | zt >>> 2, $t |= zt & v), nt < W - 3 && (Bt = this._decodeChar(T.charCodeAt(nt + 3)), M[mt++] = zt << 6 | Bt, $t |= Bt & v), $t !== 0)
152
+ throw new Error("Base64Coder: incorrect characters for decoding");
153
+ return M;
154
+ }, z.prototype._encodeByte = function(T) {
155
+ var L = T;
156
+ return L += 65, L += 25 - T >>> 8 & 6, L += 51 - T >>> 8 & -75, L += 61 - T >>> 8 & -15, L += 62 - T >>> 8 & 3, String.fromCharCode(L);
157
+ }, z.prototype._decodeChar = function(T) {
158
+ var L = v;
159
+ return L += (42 - T & T - 44) >>> 8 & -v + T - 43 + 62, L += (46 - T & T - 48) >>> 8 & -v + T - 47 + 63, L += (47 - T & T - 58) >>> 8 & -v + T - 48 + 52, L += (64 - T & T - 91) >>> 8 & -v + T - 65 + 0, L += (96 - T & T - 123) >>> 8 & -v + T - 97 + 26, L;
160
+ }, z.prototype._getPaddingLength = function(T) {
161
+ var L = 0;
162
+ if (this._paddingCharacter) {
163
+ for (var W = T.length - 1; W >= 0 && T[W] === this._paddingCharacter; W--)
164
+ L++;
165
+ if (T.length < 4 || L > 2)
166
+ throw new Error("Base64Coder: incorrect padding");
167
+ }
168
+ return L;
169
+ }, z;
170
+ })()
171
+ );
172
+ G.Coder = St;
173
+ var ot = new St();
174
+ function Ht(z) {
175
+ return ot.encode(z);
176
+ }
177
+ G.encode = Ht;
178
+ function I(z) {
179
+ return ot.decode(z);
180
+ }
181
+ G.decode = I;
182
+ var st = (
183
+ /** @class */
184
+ (function(z) {
185
+ S(T, z);
186
+ function T() {
187
+ return z !== null && z.apply(this, arguments) || this;
188
+ }
189
+ return T.prototype._encodeByte = function(L) {
190
+ var W = L;
191
+ return W += 65, W += 25 - L >>> 8 & 6, W += 51 - L >>> 8 & -75, W += 61 - L >>> 8 & -13, W += 62 - L >>> 8 & 49, String.fromCharCode(W);
192
+ }, T.prototype._decodeChar = function(L) {
193
+ var W = v;
194
+ return W += (44 - L & L - 46) >>> 8 & -v + L - 45 + 62, W += (94 - L & L - 96) >>> 8 & -v + L - 95 + 63, W += (47 - L & L - 58) >>> 8 & -v + L - 48 + 52, W += (64 - L & L - 91) >>> 8 & -v + L - 65 + 0, W += (96 - L & L - 123) >>> 8 & -v + L - 97 + 26, W;
195
+ }, T;
196
+ })(St)
197
+ );
198
+ G.URLSafeCoder = st;
199
+ var Z = new st();
200
+ function F(z) {
201
+ return Z.encode(z);
202
+ }
203
+ G.encodeURLSafe = F;
204
+ function _t(z) {
205
+ return Z.decode(z);
206
+ }
207
+ G.decodeURLSafe = _t, G.encodedLength = function(z) {
208
+ return ot.encodedLength(z);
209
+ }, G.maxDecodedLength = function(z) {
210
+ return ot.maxDecodedLength(z);
211
+ }, G.decodedLength = function(z) {
212
+ return ot.decodedLength(z);
213
+ };
214
+ }),
215
+ /* 1 */
216
+ /***/
217
+ (function(Ct, G, ut) {
218
+ Object.defineProperty(G, "__esModule", { value: !0 });
219
+ var S = "utf8: invalid string", v = "utf8: invalid source encoding";
220
+ function St(I) {
221
+ for (var st = new Uint8Array(ot(I)), Z = 0, F = 0; F < I.length; F++) {
222
+ var _t = I.charCodeAt(F);
223
+ _t < 128 ? st[Z++] = _t : _t < 2048 ? (st[Z++] = 192 | _t >> 6, st[Z++] = 128 | _t & 63) : _t < 55296 ? (st[Z++] = 224 | _t >> 12, st[Z++] = 128 | _t >> 6 & 63, st[Z++] = 128 | _t & 63) : (F++, _t = (_t & 1023) << 10, _t |= I.charCodeAt(F) & 1023, _t += 65536, st[Z++] = 240 | _t >> 18, st[Z++] = 128 | _t >> 12 & 63, st[Z++] = 128 | _t >> 6 & 63, st[Z++] = 128 | _t & 63);
224
+ }
225
+ return st;
226
+ }
227
+ G.encode = St;
228
+ function ot(I) {
229
+ for (var st = 0, Z = 0; Z < I.length; Z++) {
230
+ var F = I.charCodeAt(Z);
231
+ if (F < 128)
232
+ st += 1;
233
+ else if (F < 2048)
234
+ st += 2;
235
+ else if (F < 55296)
236
+ st += 3;
237
+ else if (F <= 57343) {
238
+ if (Z >= I.length - 1)
239
+ throw new Error(S);
240
+ Z++, st += 4;
241
+ } else
242
+ throw new Error(S);
243
+ }
244
+ return st;
245
+ }
246
+ G.encodedLength = ot;
247
+ function Ht(I) {
248
+ for (var st = [], Z = 0; Z < I.length; Z++) {
249
+ var F = I[Z];
250
+ if (F & 128) {
251
+ var _t = void 0;
252
+ if (F < 224) {
253
+ if (Z >= I.length)
254
+ throw new Error(v);
255
+ var z = I[++Z];
256
+ if ((z & 192) !== 128)
257
+ throw new Error(v);
258
+ F = (F & 31) << 6 | z & 63, _t = 128;
259
+ } else if (F < 240) {
260
+ if (Z >= I.length - 1)
261
+ throw new Error(v);
262
+ var z = I[++Z], T = I[++Z];
263
+ if ((z & 192) !== 128 || (T & 192) !== 128)
264
+ throw new Error(v);
265
+ F = (F & 15) << 12 | (z & 63) << 6 | T & 63, _t = 2048;
266
+ } else if (F < 248) {
267
+ if (Z >= I.length - 2)
268
+ throw new Error(v);
269
+ var z = I[++Z], T = I[++Z], L = I[++Z];
270
+ if ((z & 192) !== 128 || (T & 192) !== 128 || (L & 192) !== 128)
271
+ throw new Error(v);
272
+ F = (F & 15) << 18 | (z & 63) << 12 | (T & 63) << 6 | L & 63, _t = 65536;
273
+ } else
274
+ throw new Error(v);
275
+ if (F < _t || F >= 55296 && F <= 57343)
276
+ throw new Error(v);
277
+ if (F >= 65536) {
278
+ if (F > 1114111)
279
+ throw new Error(v);
280
+ F -= 65536, st.push(String.fromCharCode(55296 | F >> 10)), F = 56320 | F & 1023;
281
+ }
282
+ }
283
+ st.push(String.fromCharCode(F));
284
+ }
285
+ return st.join("");
286
+ }
287
+ G.decode = Ht;
288
+ }),
289
+ /* 2 */
290
+ /***/
291
+ (function(Ct, G, ut) {
292
+ (function(S) {
293
+ var v = function(i) {
294
+ var f, a = new Float64Array(16);
295
+ if (i) for (f = 0; f < i.length; f++) a[f] = i[f];
296
+ return a;
297
+ }, St = function() {
298
+ throw new Error("no PRNG");
299
+ }, ot = new Uint8Array(16), Ht = new Uint8Array(32);
300
+ Ht[0] = 9;
301
+ var I = v(), st = v([1]), Z = v([56129, 1]), F = v([30883, 4953, 19914, 30187, 55467, 16705, 2637, 112, 59544, 30585, 16505, 36039, 65139, 11119, 27886, 20995]), _t = v([61785, 9906, 39828, 60374, 45398, 33411, 5274, 224, 53552, 61171, 33010, 6542, 64743, 22239, 55772, 9222]), z = v([54554, 36645, 11616, 51542, 42930, 38181, 51040, 26924, 56412, 64982, 57905, 49316, 21502, 52590, 14035, 8553]), T = v([26200, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214]), L = v([41136, 18958, 6951, 50414, 58488, 44335, 6150, 12099, 55207, 15867, 153, 11085, 57099, 20417, 9344, 11139]);
302
+ function W(i, f, a, n) {
303
+ i[f] = a >> 24 & 255, i[f + 1] = a >> 16 & 255, i[f + 2] = a >> 8 & 255, i[f + 3] = a & 255, i[f + 4] = n >> 24 & 255, i[f + 5] = n >> 16 & 255, i[f + 6] = n >> 8 & 255, i[f + 7] = n & 255;
304
+ }
305
+ function M(i, f, a, n, c) {
306
+ var l, p = 0;
307
+ for (l = 0; l < c; l++) p |= i[f + l] ^ a[n + l];
308
+ return (1 & p - 1 >>> 8) - 1;
309
+ }
310
+ function mt(i, f, a, n) {
311
+ return M(i, f, a, n, 16);
312
+ }
313
+ function nt(i, f, a, n) {
314
+ return M(i, f, a, n, 32);
315
+ }
316
+ function $t(i, f, a, n) {
317
+ for (var c = n[0] & 255 | (n[1] & 255) << 8 | (n[2] & 255) << 16 | (n[3] & 255) << 24, l = a[0] & 255 | (a[1] & 255) << 8 | (a[2] & 255) << 16 | (a[3] & 255) << 24, p = a[4] & 255 | (a[5] & 255) << 8 | (a[6] & 255) << 16 | (a[7] & 255) << 24, _ = a[8] & 255 | (a[9] & 255) << 8 | (a[10] & 255) << 16 | (a[11] & 255) << 24, C = a[12] & 255 | (a[13] & 255) << 8 | (a[14] & 255) << 16 | (a[15] & 255) << 24, U = n[4] & 255 | (n[5] & 255) << 8 | (n[6] & 255) << 16 | (n[7] & 255) << 24, A = f[0] & 255 | (f[1] & 255) << 8 | (f[2] & 255) << 16 | (f[3] & 255) << 24, xt = f[4] & 255 | (f[5] & 255) << 8 | (f[6] & 255) << 16 | (f[7] & 255) << 24, k = f[8] & 255 | (f[9] & 255) << 8 | (f[10] & 255) << 16 | (f[11] & 255) << 24, q = f[12] & 255 | (f[13] & 255) << 8 | (f[14] & 255) << 16 | (f[15] & 255) << 24, D = n[8] & 255 | (n[9] & 255) << 8 | (n[10] & 255) << 16 | (n[11] & 255) << 24, V = a[16] & 255 | (a[17] & 255) << 8 | (a[18] & 255) << 16 | (a[19] & 255) << 24, K = a[20] & 255 | (a[21] & 255) << 8 | (a[22] & 255) << 16 | (a[23] & 255) << 24, $ = a[24] & 255 | (a[25] & 255) << 8 | (a[26] & 255) << 16 | (a[27] & 255) << 24, J = a[28] & 255 | (a[29] & 255) << 8 | (a[30] & 255) << 16 | (a[31] & 255) << 24, Y = n[12] & 255 | (n[13] & 255) << 8 | (n[14] & 255) << 16 | (n[15] & 255) << 24, N = c, B = l, E = p, R = _, j = C, P = U, d = A, x = xt, m = k, g = q, b = D, w = V, H = K, Q = $, et = J, tt = Y, u, it = 0; it < 20; it += 2)
318
+ u = N + H | 0, j ^= u << 7 | u >>> 25, u = j + N | 0, m ^= u << 9 | u >>> 23, u = m + j | 0, H ^= u << 13 | u >>> 19, u = H + m | 0, N ^= u << 18 | u >>> 14, u = P + B | 0, g ^= u << 7 | u >>> 25, u = g + P | 0, Q ^= u << 9 | u >>> 23, u = Q + g | 0, B ^= u << 13 | u >>> 19, u = B + Q | 0, P ^= u << 18 | u >>> 14, u = b + d | 0, et ^= u << 7 | u >>> 25, u = et + b | 0, E ^= u << 9 | u >>> 23, u = E + et | 0, d ^= u << 13 | u >>> 19, u = d + E | 0, b ^= u << 18 | u >>> 14, u = tt + w | 0, R ^= u << 7 | u >>> 25, u = R + tt | 0, x ^= u << 9 | u >>> 23, u = x + R | 0, w ^= u << 13 | u >>> 19, u = w + x | 0, tt ^= u << 18 | u >>> 14, u = N + R | 0, B ^= u << 7 | u >>> 25, u = B + N | 0, E ^= u << 9 | u >>> 23, u = E + B | 0, R ^= u << 13 | u >>> 19, u = R + E | 0, N ^= u << 18 | u >>> 14, u = P + j | 0, d ^= u << 7 | u >>> 25, u = d + P | 0, x ^= u << 9 | u >>> 23, u = x + d | 0, j ^= u << 13 | u >>> 19, u = j + x | 0, P ^= u << 18 | u >>> 14, u = b + g | 0, w ^= u << 7 | u >>> 25, u = w + b | 0, m ^= u << 9 | u >>> 23, u = m + w | 0, g ^= u << 13 | u >>> 19, u = g + m | 0, b ^= u << 18 | u >>> 14, u = tt + et | 0, H ^= u << 7 | u >>> 25, u = H + tt | 0, Q ^= u << 9 | u >>> 23, u = Q + H | 0, et ^= u << 13 | u >>> 19, u = et + Q | 0, tt ^= u << 18 | u >>> 14;
319
+ N = N + c | 0, B = B + l | 0, E = E + p | 0, R = R + _ | 0, j = j + C | 0, P = P + U | 0, d = d + A | 0, x = x + xt | 0, m = m + k | 0, g = g + q | 0, b = b + D | 0, w = w + V | 0, H = H + K | 0, Q = Q + $ | 0, et = et + J | 0, tt = tt + Y | 0, i[0] = N >>> 0 & 255, i[1] = N >>> 8 & 255, i[2] = N >>> 16 & 255, i[3] = N >>> 24 & 255, i[4] = B >>> 0 & 255, i[5] = B >>> 8 & 255, i[6] = B >>> 16 & 255, i[7] = B >>> 24 & 255, i[8] = E >>> 0 & 255, i[9] = E >>> 8 & 255, i[10] = E >>> 16 & 255, i[11] = E >>> 24 & 255, i[12] = R >>> 0 & 255, i[13] = R >>> 8 & 255, i[14] = R >>> 16 & 255, i[15] = R >>> 24 & 255, i[16] = j >>> 0 & 255, i[17] = j >>> 8 & 255, i[18] = j >>> 16 & 255, i[19] = j >>> 24 & 255, i[20] = P >>> 0 & 255, i[21] = P >>> 8 & 255, i[22] = P >>> 16 & 255, i[23] = P >>> 24 & 255, i[24] = d >>> 0 & 255, i[25] = d >>> 8 & 255, i[26] = d >>> 16 & 255, i[27] = d >>> 24 & 255, i[28] = x >>> 0 & 255, i[29] = x >>> 8 & 255, i[30] = x >>> 16 & 255, i[31] = x >>> 24 & 255, i[32] = m >>> 0 & 255, i[33] = m >>> 8 & 255, i[34] = m >>> 16 & 255, i[35] = m >>> 24 & 255, i[36] = g >>> 0 & 255, i[37] = g >>> 8 & 255, i[38] = g >>> 16 & 255, i[39] = g >>> 24 & 255, i[40] = b >>> 0 & 255, i[41] = b >>> 8 & 255, i[42] = b >>> 16 & 255, i[43] = b >>> 24 & 255, i[44] = w >>> 0 & 255, i[45] = w >>> 8 & 255, i[46] = w >>> 16 & 255, i[47] = w >>> 24 & 255, i[48] = H >>> 0 & 255, i[49] = H >>> 8 & 255, i[50] = H >>> 16 & 255, i[51] = H >>> 24 & 255, i[52] = Q >>> 0 & 255, i[53] = Q >>> 8 & 255, i[54] = Q >>> 16 & 255, i[55] = Q >>> 24 & 255, i[56] = et >>> 0 & 255, i[57] = et >>> 8 & 255, i[58] = et >>> 16 & 255, i[59] = et >>> 24 & 255, i[60] = tt >>> 0 & 255, i[61] = tt >>> 8 & 255, i[62] = tt >>> 16 & 255, i[63] = tt >>> 24 & 255;
320
+ }
321
+ function Kt(i, f, a, n) {
322
+ for (var c = n[0] & 255 | (n[1] & 255) << 8 | (n[2] & 255) << 16 | (n[3] & 255) << 24, l = a[0] & 255 | (a[1] & 255) << 8 | (a[2] & 255) << 16 | (a[3] & 255) << 24, p = a[4] & 255 | (a[5] & 255) << 8 | (a[6] & 255) << 16 | (a[7] & 255) << 24, _ = a[8] & 255 | (a[9] & 255) << 8 | (a[10] & 255) << 16 | (a[11] & 255) << 24, C = a[12] & 255 | (a[13] & 255) << 8 | (a[14] & 255) << 16 | (a[15] & 255) << 24, U = n[4] & 255 | (n[5] & 255) << 8 | (n[6] & 255) << 16 | (n[7] & 255) << 24, A = f[0] & 255 | (f[1] & 255) << 8 | (f[2] & 255) << 16 | (f[3] & 255) << 24, xt = f[4] & 255 | (f[5] & 255) << 8 | (f[6] & 255) << 16 | (f[7] & 255) << 24, k = f[8] & 255 | (f[9] & 255) << 8 | (f[10] & 255) << 16 | (f[11] & 255) << 24, q = f[12] & 255 | (f[13] & 255) << 8 | (f[14] & 255) << 16 | (f[15] & 255) << 24, D = n[8] & 255 | (n[9] & 255) << 8 | (n[10] & 255) << 16 | (n[11] & 255) << 24, V = a[16] & 255 | (a[17] & 255) << 8 | (a[18] & 255) << 16 | (a[19] & 255) << 24, K = a[20] & 255 | (a[21] & 255) << 8 | (a[22] & 255) << 16 | (a[23] & 255) << 24, $ = a[24] & 255 | (a[25] & 255) << 8 | (a[26] & 255) << 16 | (a[27] & 255) << 24, J = a[28] & 255 | (a[29] & 255) << 8 | (a[30] & 255) << 16 | (a[31] & 255) << 24, Y = n[12] & 255 | (n[13] & 255) << 8 | (n[14] & 255) << 16 | (n[15] & 255) << 24, N = c, B = l, E = p, R = _, j = C, P = U, d = A, x = xt, m = k, g = q, b = D, w = V, H = K, Q = $, et = J, tt = Y, u, it = 0; it < 20; it += 2)
323
+ u = N + H | 0, j ^= u << 7 | u >>> 25, u = j + N | 0, m ^= u << 9 | u >>> 23, u = m + j | 0, H ^= u << 13 | u >>> 19, u = H + m | 0, N ^= u << 18 | u >>> 14, u = P + B | 0, g ^= u << 7 | u >>> 25, u = g + P | 0, Q ^= u << 9 | u >>> 23, u = Q + g | 0, B ^= u << 13 | u >>> 19, u = B + Q | 0, P ^= u << 18 | u >>> 14, u = b + d | 0, et ^= u << 7 | u >>> 25, u = et + b | 0, E ^= u << 9 | u >>> 23, u = E + et | 0, d ^= u << 13 | u >>> 19, u = d + E | 0, b ^= u << 18 | u >>> 14, u = tt + w | 0, R ^= u << 7 | u >>> 25, u = R + tt | 0, x ^= u << 9 | u >>> 23, u = x + R | 0, w ^= u << 13 | u >>> 19, u = w + x | 0, tt ^= u << 18 | u >>> 14, u = N + R | 0, B ^= u << 7 | u >>> 25, u = B + N | 0, E ^= u << 9 | u >>> 23, u = E + B | 0, R ^= u << 13 | u >>> 19, u = R + E | 0, N ^= u << 18 | u >>> 14, u = P + j | 0, d ^= u << 7 | u >>> 25, u = d + P | 0, x ^= u << 9 | u >>> 23, u = x + d | 0, j ^= u << 13 | u >>> 19, u = j + x | 0, P ^= u << 18 | u >>> 14, u = b + g | 0, w ^= u << 7 | u >>> 25, u = w + b | 0, m ^= u << 9 | u >>> 23, u = m + w | 0, g ^= u << 13 | u >>> 19, u = g + m | 0, b ^= u << 18 | u >>> 14, u = tt + et | 0, H ^= u << 7 | u >>> 25, u = H + tt | 0, Q ^= u << 9 | u >>> 23, u = Q + H | 0, et ^= u << 13 | u >>> 19, u = et + Q | 0, tt ^= u << 18 | u >>> 14;
324
+ i[0] = N >>> 0 & 255, i[1] = N >>> 8 & 255, i[2] = N >>> 16 & 255, i[3] = N >>> 24 & 255, i[4] = P >>> 0 & 255, i[5] = P >>> 8 & 255, i[6] = P >>> 16 & 255, i[7] = P >>> 24 & 255, i[8] = b >>> 0 & 255, i[9] = b >>> 8 & 255, i[10] = b >>> 16 & 255, i[11] = b >>> 24 & 255, i[12] = tt >>> 0 & 255, i[13] = tt >>> 8 & 255, i[14] = tt >>> 16 & 255, i[15] = tt >>> 24 & 255, i[16] = d >>> 0 & 255, i[17] = d >>> 8 & 255, i[18] = d >>> 16 & 255, i[19] = d >>> 24 & 255, i[20] = x >>> 0 & 255, i[21] = x >>> 8 & 255, i[22] = x >>> 16 & 255, i[23] = x >>> 24 & 255, i[24] = m >>> 0 & 255, i[25] = m >>> 8 & 255, i[26] = m >>> 16 & 255, i[27] = m >>> 24 & 255, i[28] = g >>> 0 & 255, i[29] = g >>> 8 & 255, i[30] = g >>> 16 & 255, i[31] = g >>> 24 & 255;
325
+ }
326
+ function Mt(i, f, a, n) {
327
+ $t(i, f, a, n);
328
+ }
329
+ function zt(i, f, a, n) {
330
+ Kt(i, f, a, n);
331
+ }
332
+ var Bt = new Uint8Array([101, 120, 112, 97, 110, 100, 32, 51, 50, 45, 98, 121, 116, 101, 32, 107]);
333
+ function ze(i, f, a, n, c, l, p) {
334
+ var _ = new Uint8Array(16), C = new Uint8Array(64), U, A;
335
+ for (A = 0; A < 16; A++) _[A] = 0;
336
+ for (A = 0; A < 8; A++) _[A] = l[A];
337
+ for (; c >= 64; ) {
338
+ for (Mt(C, _, p, Bt), A = 0; A < 64; A++) i[f + A] = a[n + A] ^ C[A];
339
+ for (U = 1, A = 8; A < 16; A++)
340
+ U = U + (_[A] & 255) | 0, _[A] = U & 255, U >>>= 8;
341
+ c -= 64, f += 64, n += 64;
342
+ }
343
+ if (c > 0)
344
+ for (Mt(C, _, p, Bt), A = 0; A < c; A++) i[f + A] = a[n + A] ^ C[A];
345
+ return 0;
346
+ }
347
+ function oe(i, f, a, n, c) {
348
+ var l = new Uint8Array(16), p = new Uint8Array(64), _, C;
349
+ for (C = 0; C < 16; C++) l[C] = 0;
350
+ for (C = 0; C < 8; C++) l[C] = n[C];
351
+ for (; a >= 64; ) {
352
+ for (Mt(p, l, c, Bt), C = 0; C < 64; C++) i[f + C] = p[C];
353
+ for (_ = 1, C = 8; C < 16; C++)
354
+ _ = _ + (l[C] & 255) | 0, l[C] = _ & 255, _ >>>= 8;
355
+ a -= 64, f += 64;
356
+ }
357
+ if (a > 0)
358
+ for (Mt(p, l, c, Bt), C = 0; C < a; C++) i[f + C] = p[C];
359
+ return 0;
360
+ }
361
+ function ce(i, f, a, n, c) {
362
+ var l = new Uint8Array(32);
363
+ zt(l, n, c, Bt);
364
+ for (var p = new Uint8Array(8), _ = 0; _ < 8; _++) p[_] = n[_ + 16];
365
+ return oe(i, f, a, p, l);
366
+ }
367
+ function Ce(i, f, a, n, c, l, p) {
368
+ var _ = new Uint8Array(32);
369
+ zt(_, l, p, Bt);
370
+ for (var C = new Uint8Array(8), U = 0; U < 8; U++) C[U] = l[U + 16];
371
+ return ze(i, f, a, n, c, C, _);
372
+ }
373
+ var ye = function(i) {
374
+ this.buffer = new Uint8Array(16), this.r = new Uint16Array(10), this.h = new Uint16Array(10), this.pad = new Uint16Array(8), this.leftover = 0, this.fin = 0;
375
+ var f, a, n, c, l, p, _, C;
376
+ f = i[0] & 255 | (i[1] & 255) << 8, this.r[0] = f & 8191, a = i[2] & 255 | (i[3] & 255) << 8, this.r[1] = (f >>> 13 | a << 3) & 8191, n = i[4] & 255 | (i[5] & 255) << 8, this.r[2] = (a >>> 10 | n << 6) & 7939, c = i[6] & 255 | (i[7] & 255) << 8, this.r[3] = (n >>> 7 | c << 9) & 8191, l = i[8] & 255 | (i[9] & 255) << 8, this.r[4] = (c >>> 4 | l << 12) & 255, this.r[5] = l >>> 1 & 8190, p = i[10] & 255 | (i[11] & 255) << 8, this.r[6] = (l >>> 14 | p << 2) & 8191, _ = i[12] & 255 | (i[13] & 255) << 8, this.r[7] = (p >>> 11 | _ << 5) & 8065, C = i[14] & 255 | (i[15] & 255) << 8, this.r[8] = (_ >>> 8 | C << 8) & 8191, this.r[9] = C >>> 5 & 127, this.pad[0] = i[16] & 255 | (i[17] & 255) << 8, this.pad[1] = i[18] & 255 | (i[19] & 255) << 8, this.pad[2] = i[20] & 255 | (i[21] & 255) << 8, this.pad[3] = i[22] & 255 | (i[23] & 255) << 8, this.pad[4] = i[24] & 255 | (i[25] & 255) << 8, this.pad[5] = i[26] & 255 | (i[27] & 255) << 8, this.pad[6] = i[28] & 255 | (i[29] & 255) << 8, this.pad[7] = i[30] & 255 | (i[31] & 255) << 8;
377
+ };
378
+ ye.prototype.blocks = function(i, f, a) {
379
+ for (var n = this.fin ? 0 : 2048, c, l, p, _, C, U, A, xt, k, q, D, V, K, $, J, Y, N, B, E, R = this.h[0], j = this.h[1], P = this.h[2], d = this.h[3], x = this.h[4], m = this.h[5], g = this.h[6], b = this.h[7], w = this.h[8], H = this.h[9], Q = this.r[0], et = this.r[1], tt = this.r[2], u = this.r[3], it = this.r[4], vt = this.r[5], yt = this.r[6], rt = this.r[7], ht = this.r[8], lt = this.r[9]; a >= 16; )
380
+ c = i[f + 0] & 255 | (i[f + 1] & 255) << 8, R += c & 8191, l = i[f + 2] & 255 | (i[f + 3] & 255) << 8, j += (c >>> 13 | l << 3) & 8191, p = i[f + 4] & 255 | (i[f + 5] & 255) << 8, P += (l >>> 10 | p << 6) & 8191, _ = i[f + 6] & 255 | (i[f + 7] & 255) << 8, d += (p >>> 7 | _ << 9) & 8191, C = i[f + 8] & 255 | (i[f + 9] & 255) << 8, x += (_ >>> 4 | C << 12) & 8191, m += C >>> 1 & 8191, U = i[f + 10] & 255 | (i[f + 11] & 255) << 8, g += (C >>> 14 | U << 2) & 8191, A = i[f + 12] & 255 | (i[f + 13] & 255) << 8, b += (U >>> 11 | A << 5) & 8191, xt = i[f + 14] & 255 | (i[f + 15] & 255) << 8, w += (A >>> 8 | xt << 8) & 8191, H += xt >>> 5 | n, k = 0, q = k, q += R * Q, q += j * (5 * lt), q += P * (5 * ht), q += d * (5 * rt), q += x * (5 * yt), k = q >>> 13, q &= 8191, q += m * (5 * vt), q += g * (5 * it), q += b * (5 * u), q += w * (5 * tt), q += H * (5 * et), k += q >>> 13, q &= 8191, D = k, D += R * et, D += j * Q, D += P * (5 * lt), D += d * (5 * ht), D += x * (5 * rt), k = D >>> 13, D &= 8191, D += m * (5 * yt), D += g * (5 * vt), D += b * (5 * it), D += w * (5 * u), D += H * (5 * tt), k += D >>> 13, D &= 8191, V = k, V += R * tt, V += j * et, V += P * Q, V += d * (5 * lt), V += x * (5 * ht), k = V >>> 13, V &= 8191, V += m * (5 * rt), V += g * (5 * yt), V += b * (5 * vt), V += w * (5 * it), V += H * (5 * u), k += V >>> 13, V &= 8191, K = k, K += R * u, K += j * tt, K += P * et, K += d * Q, K += x * (5 * lt), k = K >>> 13, K &= 8191, K += m * (5 * ht), K += g * (5 * rt), K += b * (5 * yt), K += w * (5 * vt), K += H * (5 * it), k += K >>> 13, K &= 8191, $ = k, $ += R * it, $ += j * u, $ += P * tt, $ += d * et, $ += x * Q, k = $ >>> 13, $ &= 8191, $ += m * (5 * lt), $ += g * (5 * ht), $ += b * (5 * rt), $ += w * (5 * yt), $ += H * (5 * vt), k += $ >>> 13, $ &= 8191, J = k, J += R * vt, J += j * it, J += P * u, J += d * tt, J += x * et, k = J >>> 13, J &= 8191, J += m * Q, J += g * (5 * lt), J += b * (5 * ht), J += w * (5 * rt), J += H * (5 * yt), k += J >>> 13, J &= 8191, Y = k, Y += R * yt, Y += j * vt, Y += P * it, Y += d * u, Y += x * tt, k = Y >>> 13, Y &= 8191, Y += m * et, Y += g * Q, Y += b * (5 * lt), Y += w * (5 * ht), Y += H * (5 * rt), k += Y >>> 13, Y &= 8191, N = k, N += R * rt, N += j * yt, N += P * vt, N += d * it, N += x * u, k = N >>> 13, N &= 8191, N += m * tt, N += g * et, N += b * Q, N += w * (5 * lt), N += H * (5 * ht), k += N >>> 13, N &= 8191, B = k, B += R * ht, B += j * rt, B += P * yt, B += d * vt, B += x * it, k = B >>> 13, B &= 8191, B += m * u, B += g * tt, B += b * et, B += w * Q, B += H * (5 * lt), k += B >>> 13, B &= 8191, E = k, E += R * lt, E += j * ht, E += P * rt, E += d * yt, E += x * vt, k = E >>> 13, E &= 8191, E += m * it, E += g * u, E += b * tt, E += w * et, E += H * Q, k += E >>> 13, E &= 8191, k = (k << 2) + k | 0, k = k + q | 0, q = k & 8191, k = k >>> 13, D += k, R = q, j = D, P = V, d = K, x = $, m = J, g = Y, b = N, w = B, H = E, f += 16, a -= 16;
381
+ this.h[0] = R, this.h[1] = j, this.h[2] = P, this.h[3] = d, this.h[4] = x, this.h[5] = m, this.h[6] = g, this.h[7] = b, this.h[8] = w, this.h[9] = H;
382
+ }, ye.prototype.finish = function(i, f) {
383
+ var a = new Uint16Array(10), n, c, l, p;
384
+ if (this.leftover) {
385
+ for (p = this.leftover, this.buffer[p++] = 1; p < 16; p++) this.buffer[p] = 0;
386
+ this.fin = 1, this.blocks(this.buffer, 0, 16);
387
+ }
388
+ for (n = this.h[1] >>> 13, this.h[1] &= 8191, p = 2; p < 10; p++)
389
+ this.h[p] += n, n = this.h[p] >>> 13, this.h[p] &= 8191;
390
+ for (this.h[0] += n * 5, 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, a[0] = this.h[0] + 5, n = a[0] >>> 13, a[0] &= 8191, p = 1; p < 10; p++)
391
+ a[p] = this.h[p] + n, n = a[p] >>> 13, a[p] &= 8191;
392
+ for (a[9] -= 8192, c = (n ^ 1) - 1, p = 0; p < 10; p++) a[p] &= c;
393
+ for (c = ~c, p = 0; p < 10; p++) this.h[p] = this.h[p] & c | a[p];
394
+ for (this.h[0] = (this.h[0] | this.h[1] << 13) & 65535, this.h[1] = (this.h[1] >>> 3 | this.h[2] << 10) & 65535, this.h[2] = (this.h[2] >>> 6 | this.h[3] << 7) & 65535, this.h[3] = (this.h[3] >>> 9 | this.h[4] << 4) & 65535, this.h[4] = (this.h[4] >>> 12 | this.h[5] << 1 | this.h[6] << 14) & 65535, this.h[5] = (this.h[6] >>> 2 | this.h[7] << 11) & 65535, this.h[6] = (this.h[7] >>> 5 | this.h[8] << 8) & 65535, this.h[7] = (this.h[8] >>> 8 | this.h[9] << 5) & 65535, l = this.h[0] + this.pad[0], this.h[0] = l & 65535, p = 1; p < 8; p++)
395
+ l = (this.h[p] + this.pad[p] | 0) + (l >>> 16) | 0, this.h[p] = l & 65535;
396
+ i[f + 0] = this.h[0] >>> 0 & 255, i[f + 1] = this.h[0] >>> 8 & 255, i[f + 2] = this.h[1] >>> 0 & 255, i[f + 3] = this.h[1] >>> 8 & 255, i[f + 4] = this.h[2] >>> 0 & 255, i[f + 5] = this.h[2] >>> 8 & 255, i[f + 6] = this.h[3] >>> 0 & 255, i[f + 7] = this.h[3] >>> 8 & 255, i[f + 8] = this.h[4] >>> 0 & 255, i[f + 9] = this.h[4] >>> 8 & 255, i[f + 10] = this.h[5] >>> 0 & 255, i[f + 11] = this.h[5] >>> 8 & 255, i[f + 12] = this.h[6] >>> 0 & 255, i[f + 13] = this.h[6] >>> 8 & 255, i[f + 14] = this.h[7] >>> 0 & 255, i[f + 15] = this.h[7] >>> 8 & 255;
397
+ }, ye.prototype.update = function(i, f, a) {
398
+ var n, c;
399
+ if (this.leftover) {
400
+ for (c = 16 - this.leftover, c > a && (c = a), n = 0; n < c; n++)
401
+ this.buffer[this.leftover + n] = i[f + n];
402
+ if (a -= c, f += c, this.leftover += c, this.leftover < 16)
403
+ return;
404
+ this.blocks(this.buffer, 0, 16), this.leftover = 0;
405
+ }
406
+ if (a >= 16 && (c = a - a % 16, this.blocks(i, f, c), f += c, a -= c), a) {
407
+ for (n = 0; n < a; n++)
408
+ this.buffer[this.leftover + n] = i[f + n];
409
+ this.leftover += a;
410
+ }
411
+ };
412
+ function Oe(i, f, a, n, c, l) {
413
+ var p = new ye(l);
414
+ return p.update(a, n, c), p.finish(i, f), 0;
415
+ }
416
+ function qe(i, f, a, n, c, l) {
417
+ var p = new Uint8Array(16);
418
+ return Oe(p, 0, a, n, c, l), mt(i, f, p, 0);
419
+ }
420
+ function Pe(i, f, a, n, c) {
421
+ var l;
422
+ if (a < 32) return -1;
423
+ for (Ce(i, 0, f, 0, a, n, c), Oe(i, 16, i, 32, a - 32, i), l = 0; l < 16; l++) i[l] = 0;
424
+ return 0;
425
+ }
426
+ function ge(i, f, a, n, c) {
427
+ var l, p = new Uint8Array(32);
428
+ if (a < 32 || (ce(p, 0, 32, n, c), qe(f, 16, f, 32, a - 32, p) !== 0)) return -1;
429
+ for (Ce(i, 0, f, 0, a, n, c), l = 0; l < 32; l++) i[l] = 0;
430
+ return 0;
431
+ }
432
+ function Wt(i, f) {
433
+ var a;
434
+ for (a = 0; a < 16; a++) i[a] = f[a] | 0;
435
+ }
436
+ function Ae(i) {
437
+ var f, a, n = 1;
438
+ for (f = 0; f < 16; f++)
439
+ a = i[f] + n + 65535, n = Math.floor(a / 65536), i[f] = a - n * 65536;
440
+ i[0] += n - 1 + 37 * (n - 1);
441
+ }
442
+ function se(i, f, a) {
443
+ for (var n, c = ~(a - 1), l = 0; l < 16; l++)
444
+ n = c & (i[l] ^ f[l]), i[l] ^= n, f[l] ^= n;
445
+ }
446
+ function Ft(i, f) {
447
+ var a, n, c, l = v(), p = v();
448
+ for (a = 0; a < 16; a++) p[a] = f[a];
449
+ for (Ae(p), Ae(p), Ae(p), n = 0; n < 2; n++) {
450
+ for (l[0] = p[0] - 65517, a = 1; a < 15; a++)
451
+ l[a] = p[a] - 65535 - (l[a - 1] >> 16 & 1), l[a - 1] &= 65535;
452
+ l[15] = p[15] - 32767 - (l[14] >> 16 & 1), c = l[15] >> 16 & 1, l[14] &= 65535, se(p, l, 1 - c);
453
+ }
454
+ for (a = 0; a < 16; a++)
455
+ i[2 * a] = p[a] & 255, i[2 * a + 1] = p[a] >> 8;
456
+ }
457
+ function Fe(i, f) {
458
+ var a = new Uint8Array(32), n = new Uint8Array(32);
459
+ return Ft(a, i), Ft(n, f), nt(a, 0, n, 0);
460
+ }
461
+ function $e(i) {
462
+ var f = new Uint8Array(32);
463
+ return Ft(f, i), f[0] & 1;
464
+ }
465
+ function Rt(i, f) {
466
+ var a;
467
+ for (a = 0; a < 16; a++) i[a] = f[2 * a] + (f[2 * a + 1] << 8);
468
+ i[15] &= 32767;
469
+ }
470
+ function Tt(i, f, a) {
471
+ for (var n = 0; n < 16; n++) i[n] = f[n] + a[n];
472
+ }
473
+ function Yt(i, f, a) {
474
+ for (var n = 0; n < 16; n++) i[n] = f[n] - a[n];
475
+ }
476
+ function ft(i, f, a) {
477
+ var n, c, l = 0, p = 0, _ = 0, C = 0, U = 0, A = 0, xt = 0, k = 0, q = 0, D = 0, V = 0, K = 0, $ = 0, J = 0, Y = 0, N = 0, B = 0, E = 0, R = 0, j = 0, P = 0, d = 0, x = 0, m = 0, g = 0, b = 0, w = 0, H = 0, Q = 0, et = 0, tt = 0, u = a[0], it = a[1], vt = a[2], yt = a[3], rt = a[4], ht = a[5], lt = a[6], kt = a[7], bt = a[8], Ot = a[9], Pt = a[10], gt = a[11], Nt = a[12], It = a[13], Ut = a[14], At = a[15];
478
+ n = f[0], l += n * u, p += n * it, _ += n * vt, C += n * yt, U += n * rt, A += n * ht, xt += n * lt, k += n * kt, q += n * bt, D += n * Ot, V += n * Pt, K += n * gt, $ += n * Nt, J += n * It, Y += n * Ut, N += n * At, n = f[1], p += n * u, _ += n * it, C += n * vt, U += n * yt, A += n * rt, xt += n * ht, k += n * lt, q += n * kt, D += n * bt, V += n * Ot, K += n * Pt, $ += n * gt, J += n * Nt, Y += n * It, N += n * Ut, B += n * At, n = f[2], _ += n * u, C += n * it, U += n * vt, A += n * yt, xt += n * rt, k += n * ht, q += n * lt, D += n * kt, V += n * bt, K += n * Ot, $ += n * Pt, J += n * gt, Y += n * Nt, N += n * It, B += n * Ut, E += n * At, n = f[3], C += n * u, U += n * it, A += n * vt, xt += n * yt, k += n * rt, q += n * ht, D += n * lt, V += n * kt, K += n * bt, $ += n * Ot, J += n * Pt, Y += n * gt, N += n * Nt, B += n * It, E += n * Ut, R += n * At, n = f[4], U += n * u, A += n * it, xt += n * vt, k += n * yt, q += n * rt, D += n * ht, V += n * lt, K += n * kt, $ += n * bt, J += n * Ot, Y += n * Pt, N += n * gt, B += n * Nt, E += n * It, R += n * Ut, j += n * At, n = f[5], A += n * u, xt += n * it, k += n * vt, q += n * yt, D += n * rt, V += n * ht, K += n * lt, $ += n * kt, J += n * bt, Y += n * Ot, N += n * Pt, B += n * gt, E += n * Nt, R += n * It, j += n * Ut, P += n * At, n = f[6], xt += n * u, k += n * it, q += n * vt, D += n * yt, V += n * rt, K += n * ht, $ += n * lt, J += n * kt, Y += n * bt, N += n * Ot, B += n * Pt, E += n * gt, R += n * Nt, j += n * It, P += n * Ut, d += n * At, n = f[7], k += n * u, q += n * it, D += n * vt, V += n * yt, K += n * rt, $ += n * ht, J += n * lt, Y += n * kt, N += n * bt, B += n * Ot, E += n * Pt, R += n * gt, j += n * Nt, P += n * It, d += n * Ut, x += n * At, n = f[8], q += n * u, D += n * it, V += n * vt, K += n * yt, $ += n * rt, J += n * ht, Y += n * lt, N += n * kt, B += n * bt, E += n * Ot, R += n * Pt, j += n * gt, P += n * Nt, d += n * It, x += n * Ut, m += n * At, n = f[9], D += n * u, V += n * it, K += n * vt, $ += n * yt, J += n * rt, Y += n * ht, N += n * lt, B += n * kt, E += n * bt, R += n * Ot, j += n * Pt, P += n * gt, d += n * Nt, x += n * It, m += n * Ut, g += n * At, n = f[10], V += n * u, K += n * it, $ += n * vt, J += n * yt, Y += n * rt, N += n * ht, B += n * lt, E += n * kt, R += n * bt, j += n * Ot, P += n * Pt, d += n * gt, x += n * Nt, m += n * It, g += n * Ut, b += n * At, n = f[11], K += n * u, $ += n * it, J += n * vt, Y += n * yt, N += n * rt, B += n * ht, E += n * lt, R += n * kt, j += n * bt, P += n * Ot, d += n * Pt, x += n * gt, m += n * Nt, g += n * It, b += n * Ut, w += n * At, n = f[12], $ += n * u, J += n * it, Y += n * vt, N += n * yt, B += n * rt, E += n * ht, R += n * lt, j += n * kt, P += n * bt, d += n * Ot, x += n * Pt, m += n * gt, g += n * Nt, b += n * It, w += n * Ut, H += n * At, n = f[13], J += n * u, Y += n * it, N += n * vt, B += n * yt, E += n * rt, R += n * ht, j += n * lt, P += n * kt, d += n * bt, x += n * Ot, m += n * Pt, g += n * gt, b += n * Nt, w += n * It, H += n * Ut, Q += n * At, n = f[14], Y += n * u, N += n * it, B += n * vt, E += n * yt, R += n * rt, j += n * ht, P += n * lt, d += n * kt, x += n * bt, m += n * Ot, g += n * Pt, b += n * gt, w += n * Nt, H += n * It, Q += n * Ut, et += n * At, n = f[15], N += n * u, B += n * it, E += n * vt, R += n * yt, j += n * rt, P += n * ht, d += n * lt, x += n * kt, m += n * bt, g += n * Ot, b += n * Pt, w += n * gt, H += n * Nt, Q += n * It, et += n * Ut, tt += n * At, l += 38 * B, p += 38 * E, _ += 38 * R, C += 38 * j, U += 38 * P, A += 38 * d, xt += 38 * x, k += 38 * m, q += 38 * g, D += 38 * b, V += 38 * w, K += 38 * H, $ += 38 * Q, J += 38 * et, Y += 38 * tt, c = 1, n = l + c + 65535, c = Math.floor(n / 65536), l = n - c * 65536, n = p + c + 65535, c = Math.floor(n / 65536), p = n - c * 65536, n = _ + c + 65535, c = Math.floor(n / 65536), _ = n - c * 65536, n = C + c + 65535, c = Math.floor(n / 65536), C = n - c * 65536, n = U + c + 65535, c = Math.floor(n / 65536), U = n - c * 65536, n = A + c + 65535, c = Math.floor(n / 65536), A = n - c * 65536, n = xt + c + 65535, c = Math.floor(n / 65536), xt = n - c * 65536, n = k + c + 65535, c = Math.floor(n / 65536), k = n - c * 65536, n = q + c + 65535, c = Math.floor(n / 65536), q = n - c * 65536, n = D + c + 65535, c = Math.floor(n / 65536), D = n - c * 65536, n = V + c + 65535, c = Math.floor(n / 65536), V = n - c * 65536, n = K + c + 65535, c = Math.floor(n / 65536), K = n - c * 65536, n = $ + c + 65535, c = Math.floor(n / 65536), $ = n - c * 65536, n = J + c + 65535, c = Math.floor(n / 65536), J = n - c * 65536, n = Y + c + 65535, c = Math.floor(n / 65536), Y = n - c * 65536, n = N + c + 65535, c = Math.floor(n / 65536), N = n - c * 65536, l += c - 1 + 37 * (c - 1), c = 1, n = l + c + 65535, c = Math.floor(n / 65536), l = n - c * 65536, n = p + c + 65535, c = Math.floor(n / 65536), p = n - c * 65536, n = _ + c + 65535, c = Math.floor(n / 65536), _ = n - c * 65536, n = C + c + 65535, c = Math.floor(n / 65536), C = n - c * 65536, n = U + c + 65535, c = Math.floor(n / 65536), U = n - c * 65536, n = A + c + 65535, c = Math.floor(n / 65536), A = n - c * 65536, n = xt + c + 65535, c = Math.floor(n / 65536), xt = n - c * 65536, n = k + c + 65535, c = Math.floor(n / 65536), k = n - c * 65536, n = q + c + 65535, c = Math.floor(n / 65536), q = n - c * 65536, n = D + c + 65535, c = Math.floor(n / 65536), D = n - c * 65536, n = V + c + 65535, c = Math.floor(n / 65536), V = n - c * 65536, n = K + c + 65535, c = Math.floor(n / 65536), K = n - c * 65536, n = $ + c + 65535, c = Math.floor(n / 65536), $ = n - c * 65536, n = J + c + 65535, c = Math.floor(n / 65536), J = n - c * 65536, n = Y + c + 65535, c = Math.floor(n / 65536), Y = n - c * 65536, n = N + c + 65535, c = Math.floor(n / 65536), N = n - c * 65536, l += c - 1 + 37 * (c - 1), i[0] = l, i[1] = p, i[2] = _, i[3] = C, i[4] = U, i[5] = A, i[6] = xt, i[7] = k, i[8] = q, i[9] = D, i[10] = V, i[11] = K, i[12] = $, i[13] = J, i[14] = Y, i[15] = N;
479
+ }
480
+ function Lt(i, f) {
481
+ ft(i, f, f);
482
+ }
483
+ function Ee(i, f) {
484
+ var a = v(), n;
485
+ for (n = 0; n < 16; n++) a[n] = f[n];
486
+ for (n = 253; n >= 0; n--)
487
+ Lt(a, a), n !== 2 && n !== 4 && ft(a, a, f);
488
+ for (n = 0; n < 16; n++) i[n] = a[n];
489
+ }
490
+ function Ye(i, f) {
491
+ var a = v(), n;
492
+ for (n = 0; n < 16; n++) a[n] = f[n];
493
+ for (n = 250; n >= 0; n--)
494
+ Lt(a, a), n !== 1 && ft(a, a, f);
495
+ for (n = 0; n < 16; n++) i[n] = a[n];
496
+ }
497
+ function Vt(i, f, a) {
498
+ var n = new Uint8Array(32), c = new Float64Array(80), l, p, _ = v(), C = v(), U = v(), A = v(), xt = v(), k = v();
499
+ for (p = 0; p < 31; p++) n[p] = f[p];
500
+ for (n[31] = f[31] & 127 | 64, n[0] &= 248, Rt(c, a), p = 0; p < 16; p++)
501
+ C[p] = c[p], A[p] = _[p] = U[p] = 0;
502
+ for (_[0] = A[0] = 1, p = 254; p >= 0; --p)
503
+ l = n[p >>> 3] >>> (p & 7) & 1, se(_, C, l), se(U, A, l), Tt(xt, _, U), Yt(_, _, U), Tt(U, C, A), Yt(C, C, A), Lt(A, xt), Lt(k, _), ft(_, U, _), ft(U, C, xt), Tt(xt, _, U), Yt(_, _, U), Lt(C, _), Yt(U, A, k), ft(_, U, Z), Tt(_, _, A), ft(U, U, _), ft(_, A, k), ft(A, C, c), Lt(C, xt), se(_, C, l), se(U, A, l);
504
+ for (p = 0; p < 16; p++)
505
+ c[p + 16] = _[p], c[p + 32] = U[p], c[p + 48] = C[p], c[p + 64] = A[p];
506
+ var q = c.subarray(32), D = c.subarray(16);
507
+ return Ee(q, q), ft(D, D, q), Ft(i, D), 0;
508
+ }
509
+ function ue(i, f) {
510
+ return Vt(i, f, Ht);
511
+ }
512
+ function Je(i, f) {
513
+ return St(f, 32), ue(i, f);
514
+ }
515
+ function he(i, f, a) {
516
+ var n = new Uint8Array(32);
517
+ return Vt(n, a, f), zt(i, ot, n, Bt);
518
+ }
519
+ var ke = Pe, nn = ge;
520
+ function Xe(i, f, a, n, c, l) {
521
+ var p = new Uint8Array(32);
522
+ return he(p, c, l), ke(i, f, a, n, p);
523
+ }
524
+ function rn(i, f, a, n, c, l) {
525
+ var p = new Uint8Array(32);
526
+ return he(p, c, l), nn(i, f, a, n, p);
527
+ }
528
+ var We = [
529
+ 1116352408,
530
+ 3609767458,
531
+ 1899447441,
532
+ 602891725,
533
+ 3049323471,
534
+ 3964484399,
535
+ 3921009573,
536
+ 2173295548,
537
+ 961987163,
538
+ 4081628472,
539
+ 1508970993,
540
+ 3053834265,
541
+ 2453635748,
542
+ 2937671579,
543
+ 2870763221,
544
+ 3664609560,
545
+ 3624381080,
546
+ 2734883394,
547
+ 310598401,
548
+ 1164996542,
549
+ 607225278,
550
+ 1323610764,
551
+ 1426881987,
552
+ 3590304994,
553
+ 1925078388,
554
+ 4068182383,
555
+ 2162078206,
556
+ 991336113,
557
+ 2614888103,
558
+ 633803317,
559
+ 3248222580,
560
+ 3479774868,
561
+ 3835390401,
562
+ 2666613458,
563
+ 4022224774,
564
+ 944711139,
565
+ 264347078,
566
+ 2341262773,
567
+ 604807628,
568
+ 2007800933,
569
+ 770255983,
570
+ 1495990901,
571
+ 1249150122,
572
+ 1856431235,
573
+ 1555081692,
574
+ 3175218132,
575
+ 1996064986,
576
+ 2198950837,
577
+ 2554220882,
578
+ 3999719339,
579
+ 2821834349,
580
+ 766784016,
581
+ 2952996808,
582
+ 2566594879,
583
+ 3210313671,
584
+ 3203337956,
585
+ 3336571891,
586
+ 1034457026,
587
+ 3584528711,
588
+ 2466948901,
589
+ 113926993,
590
+ 3758326383,
591
+ 338241895,
592
+ 168717936,
593
+ 666307205,
594
+ 1188179964,
595
+ 773529912,
596
+ 1546045734,
597
+ 1294757372,
598
+ 1522805485,
599
+ 1396182291,
600
+ 2643833823,
601
+ 1695183700,
602
+ 2343527390,
603
+ 1986661051,
604
+ 1014477480,
605
+ 2177026350,
606
+ 1206759142,
607
+ 2456956037,
608
+ 344077627,
609
+ 2730485921,
610
+ 1290863460,
611
+ 2820302411,
612
+ 3158454273,
613
+ 3259730800,
614
+ 3505952657,
615
+ 3345764771,
616
+ 106217008,
617
+ 3516065817,
618
+ 3606008344,
619
+ 3600352804,
620
+ 1432725776,
621
+ 4094571909,
622
+ 1467031594,
623
+ 275423344,
624
+ 851169720,
625
+ 430227734,
626
+ 3100823752,
627
+ 506948616,
628
+ 1363258195,
629
+ 659060556,
630
+ 3750685593,
631
+ 883997877,
632
+ 3785050280,
633
+ 958139571,
634
+ 3318307427,
635
+ 1322822218,
636
+ 3812723403,
637
+ 1537002063,
638
+ 2003034995,
639
+ 1747873779,
640
+ 3602036899,
641
+ 1955562222,
642
+ 1575990012,
643
+ 2024104815,
644
+ 1125592928,
645
+ 2227730452,
646
+ 2716904306,
647
+ 2361852424,
648
+ 442776044,
649
+ 2428436474,
650
+ 593698344,
651
+ 2756734187,
652
+ 3733110249,
653
+ 3204031479,
654
+ 2999351573,
655
+ 3329325298,
656
+ 3815920427,
657
+ 3391569614,
658
+ 3928383900,
659
+ 3515267271,
660
+ 566280711,
661
+ 3940187606,
662
+ 3454069534,
663
+ 4118630271,
664
+ 4000239992,
665
+ 116418474,
666
+ 1914138554,
667
+ 174292421,
668
+ 2731055270,
669
+ 289380356,
670
+ 3203993006,
671
+ 460393269,
672
+ 320620315,
673
+ 685471733,
674
+ 587496836,
675
+ 852142971,
676
+ 1086792851,
677
+ 1017036298,
678
+ 365543100,
679
+ 1126000580,
680
+ 2618297676,
681
+ 1288033470,
682
+ 3409855158,
683
+ 1501505948,
684
+ 4234509866,
685
+ 1607167915,
686
+ 987167468,
687
+ 1816402316,
688
+ 1246189591
689
+ ];
690
+ function Ge(i, f, a, n) {
691
+ for (var c = new Int32Array(16), l = new Int32Array(16), p, _, C, U, A, xt, k, q, D, V, K, $, J, Y, N, B, E, R, j, P, d, x, m, g, b, w, H = i[0], Q = i[1], et = i[2], tt = i[3], u = i[4], it = i[5], vt = i[6], yt = i[7], rt = f[0], ht = f[1], lt = f[2], kt = f[3], bt = f[4], Ot = f[5], Pt = f[6], gt = f[7], Nt = 0; n >= 128; ) {
692
+ for (j = 0; j < 16; j++)
693
+ P = 8 * j + Nt, c[j] = a[P + 0] << 24 | a[P + 1] << 16 | a[P + 2] << 8 | a[P + 3], l[j] = a[P + 4] << 24 | a[P + 5] << 16 | a[P + 6] << 8 | a[P + 7];
694
+ for (j = 0; j < 80; j++)
695
+ if (p = H, _ = Q, C = et, U = tt, A = u, xt = it, k = vt, q = yt, D = rt, V = ht, K = lt, $ = kt, J = bt, Y = Ot, N = Pt, B = gt, d = yt, x = gt, m = x & 65535, g = x >>> 16, b = d & 65535, w = d >>> 16, d = (u >>> 14 | bt << 18) ^ (u >>> 18 | bt << 14) ^ (bt >>> 9 | u << 23), x = (bt >>> 14 | u << 18) ^ (bt >>> 18 | u << 14) ^ (u >>> 9 | bt << 23), m += x & 65535, g += x >>> 16, b += d & 65535, w += d >>> 16, d = u & it ^ ~u & vt, x = bt & Ot ^ ~bt & Pt, m += x & 65535, g += x >>> 16, b += d & 65535, w += d >>> 16, d = We[j * 2], x = We[j * 2 + 1], m += x & 65535, g += x >>> 16, b += d & 65535, w += d >>> 16, d = c[j % 16], x = l[j % 16], m += x & 65535, g += x >>> 16, b += d & 65535, w += d >>> 16, g += m >>> 16, b += g >>> 16, w += b >>> 16, E = b & 65535 | w << 16, R = m & 65535 | g << 16, d = E, x = R, m = x & 65535, g = x >>> 16, b = d & 65535, w = d >>> 16, d = (H >>> 28 | rt << 4) ^ (rt >>> 2 | H << 30) ^ (rt >>> 7 | H << 25), x = (rt >>> 28 | H << 4) ^ (H >>> 2 | rt << 30) ^ (H >>> 7 | rt << 25), m += x & 65535, g += x >>> 16, b += d & 65535, w += d >>> 16, d = H & Q ^ H & et ^ Q & et, x = rt & ht ^ rt & lt ^ ht & lt, m += x & 65535, g += x >>> 16, b += d & 65535, w += d >>> 16, g += m >>> 16, b += g >>> 16, w += b >>> 16, q = b & 65535 | w << 16, B = m & 65535 | g << 16, d = U, x = $, m = x & 65535, g = x >>> 16, b = d & 65535, w = d >>> 16, d = E, x = R, m += x & 65535, g += x >>> 16, b += d & 65535, w += d >>> 16, g += m >>> 16, b += g >>> 16, w += b >>> 16, U = b & 65535 | w << 16, $ = m & 65535 | g << 16, Q = p, et = _, tt = C, u = U, it = A, vt = xt, yt = k, H = q, ht = D, lt = V, kt = K, bt = $, Ot = J, Pt = Y, gt = N, rt = B, j % 16 === 15)
696
+ for (P = 0; P < 16; P++)
697
+ d = c[P], x = l[P], m = x & 65535, g = x >>> 16, b = d & 65535, w = d >>> 16, d = c[(P + 9) % 16], x = l[(P + 9) % 16], m += x & 65535, g += x >>> 16, b += d & 65535, w += d >>> 16, E = c[(P + 1) % 16], R = l[(P + 1) % 16], d = (E >>> 1 | R << 31) ^ (E >>> 8 | R << 24) ^ E >>> 7, x = (R >>> 1 | E << 31) ^ (R >>> 8 | E << 24) ^ (R >>> 7 | E << 25), m += x & 65535, g += x >>> 16, b += d & 65535, w += d >>> 16, E = c[(P + 14) % 16], R = l[(P + 14) % 16], d = (E >>> 19 | R << 13) ^ (R >>> 29 | E << 3) ^ E >>> 6, x = (R >>> 19 | E << 13) ^ (E >>> 29 | R << 3) ^ (R >>> 6 | E << 26), m += x & 65535, g += x >>> 16, b += d & 65535, w += d >>> 16, g += m >>> 16, b += g >>> 16, w += b >>> 16, c[P] = b & 65535 | w << 16, l[P] = m & 65535 | g << 16;
698
+ d = H, x = rt, m = x & 65535, g = x >>> 16, b = d & 65535, w = d >>> 16, d = i[0], x = f[0], m += x & 65535, g += x >>> 16, b += d & 65535, w += d >>> 16, g += m >>> 16, b += g >>> 16, w += b >>> 16, i[0] = H = b & 65535 | w << 16, f[0] = rt = m & 65535 | g << 16, d = Q, x = ht, m = x & 65535, g = x >>> 16, b = d & 65535, w = d >>> 16, d = i[1], x = f[1], m += x & 65535, g += x >>> 16, b += d & 65535, w += d >>> 16, g += m >>> 16, b += g >>> 16, w += b >>> 16, i[1] = Q = b & 65535 | w << 16, f[1] = ht = m & 65535 | g << 16, d = et, x = lt, m = x & 65535, g = x >>> 16, b = d & 65535, w = d >>> 16, d = i[2], x = f[2], m += x & 65535, g += x >>> 16, b += d & 65535, w += d >>> 16, g += m >>> 16, b += g >>> 16, w += b >>> 16, i[2] = et = b & 65535 | w << 16, f[2] = lt = m & 65535 | g << 16, d = tt, x = kt, m = x & 65535, g = x >>> 16, b = d & 65535, w = d >>> 16, d = i[3], x = f[3], m += x & 65535, g += x >>> 16, b += d & 65535, w += d >>> 16, g += m >>> 16, b += g >>> 16, w += b >>> 16, i[3] = tt = b & 65535 | w << 16, f[3] = kt = m & 65535 | g << 16, d = u, x = bt, m = x & 65535, g = x >>> 16, b = d & 65535, w = d >>> 16, d = i[4], x = f[4], m += x & 65535, g += x >>> 16, b += d & 65535, w += d >>> 16, g += m >>> 16, b += g >>> 16, w += b >>> 16, i[4] = u = b & 65535 | w << 16, f[4] = bt = m & 65535 | g << 16, d = it, x = Ot, m = x & 65535, g = x >>> 16, b = d & 65535, w = d >>> 16, d = i[5], x = f[5], m += x & 65535, g += x >>> 16, b += d & 65535, w += d >>> 16, g += m >>> 16, b += g >>> 16, w += b >>> 16, i[5] = it = b & 65535 | w << 16, f[5] = Ot = m & 65535 | g << 16, d = vt, x = Pt, m = x & 65535, g = x >>> 16, b = d & 65535, w = d >>> 16, d = i[6], x = f[6], m += x & 65535, g += x >>> 16, b += d & 65535, w += d >>> 16, g += m >>> 16, b += g >>> 16, w += b >>> 16, i[6] = vt = b & 65535 | w << 16, f[6] = Pt = m & 65535 | g << 16, d = yt, x = gt, m = x & 65535, g = x >>> 16, b = d & 65535, w = d >>> 16, d = i[7], x = f[7], m += x & 65535, g += x >>> 16, b += d & 65535, w += d >>> 16, g += m >>> 16, b += g >>> 16, w += b >>> 16, i[7] = yt = b & 65535 | w << 16, f[7] = gt = m & 65535 | g << 16, Nt += 128, n -= 128;
699
+ }
700
+ return n;
701
+ }
702
+ function ee(i, f, a) {
703
+ var n = new Int32Array(8), c = new Int32Array(8), l = new Uint8Array(256), p, _ = a;
704
+ for (n[0] = 1779033703, n[1] = 3144134277, n[2] = 1013904242, n[3] = 2773480762, n[4] = 1359893119, n[5] = 2600822924, n[6] = 528734635, n[7] = 1541459225, c[0] = 4089235720, c[1] = 2227873595, c[2] = 4271175723, c[3] = 1595750129, c[4] = 2917565137, c[5] = 725511199, c[6] = 4215389547, c[7] = 327033209, Ge(n, c, f, a), a %= 128, p = 0; p < a; p++) l[p] = f[_ - a + p];
705
+ for (l[a] = 128, a = 256 - 128 * (a < 112 ? 1 : 0), l[a - 9] = 0, W(l, a - 8, _ / 536870912 | 0, _ << 3), Ge(n, c, l, a), p = 0; p < 8; p++) W(i, 8 * p, n[p], c[p]);
706
+ return 0;
707
+ }
708
+ function ne(i, f) {
709
+ var a = v(), n = v(), c = v(), l = v(), p = v(), _ = v(), C = v(), U = v(), A = v();
710
+ Yt(a, i[1], i[0]), Yt(A, f[1], f[0]), ft(a, a, A), Tt(n, i[0], i[1]), Tt(A, f[0], f[1]), ft(n, n, A), ft(c, i[3], f[3]), ft(c, c, _t), ft(l, i[2], f[2]), Tt(l, l, l), Yt(p, n, a), Yt(_, l, c), Tt(C, l, c), Tt(U, n, a), ft(i[0], p, _), ft(i[1], U, C), ft(i[2], C, _), ft(i[3], p, U);
711
+ }
712
+ function Ke(i, f, a) {
713
+ var n;
714
+ for (n = 0; n < 4; n++)
715
+ se(i[n], f[n], a);
716
+ }
717
+ function Et(i, f) {
718
+ var a = v(), n = v(), c = v();
719
+ Ee(c, f[2]), ft(a, f[0], c), ft(n, f[1], c), Ft(i, n), i[31] ^= $e(a) << 7;
720
+ }
721
+ function Le(i, f, a) {
722
+ var n, c;
723
+ for (Wt(i[0], I), Wt(i[1], st), Wt(i[2], st), Wt(i[3], I), c = 255; c >= 0; --c)
724
+ n = a[c / 8 | 0] >> (c & 7) & 1, Ke(i, f, n), ne(f, i), ne(i, i), Ke(i, f, n);
725
+ }
726
+ function _e(i, f) {
727
+ var a = [v(), v(), v(), v()];
728
+ Wt(a[0], z), Wt(a[1], T), Wt(a[2], st), ft(a[3], z, T), Le(i, a, f);
729
+ }
730
+ function Ne(i, f, a) {
731
+ var n = new Uint8Array(64), c = [v(), v(), v(), v()], l;
732
+ for (a || St(f, 32), ee(n, f, 32), n[0] &= 248, n[31] &= 127, n[31] |= 64, _e(c, n), Et(i, c), l = 0; l < 32; l++) f[l + 32] = i[l];
733
+ return 0;
734
+ }
735
+ var be = 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]);
736
+ function Re(i, f) {
737
+ var a, n, c, l;
738
+ for (n = 63; n >= 32; --n) {
739
+ for (a = 0, c = n - 32, l = n - 12; c < l; ++c)
740
+ f[c] += a - 16 * f[n] * be[c - (n - 32)], a = Math.floor((f[c] + 128) / 256), f[c] -= a * 256;
741
+ f[c] += a, f[n] = 0;
742
+ }
743
+ for (a = 0, c = 0; c < 32; c++)
744
+ f[c] += a - (f[31] >> 4) * be[c], a = f[c] >> 8, f[c] &= 255;
745
+ for (c = 0; c < 32; c++) f[c] -= a * be[c];
746
+ for (n = 0; n < 32; n++)
747
+ f[n + 1] += f[n] >> 8, i[n] = f[n] & 255;
748
+ }
749
+ function Ie(i) {
750
+ var f = new Float64Array(64), a;
751
+ for (a = 0; a < 64; a++) f[a] = i[a];
752
+ for (a = 0; a < 64; a++) i[a] = 0;
753
+ Re(i, f);
754
+ }
755
+ function Ze(i, f, a, n) {
756
+ var c = new Uint8Array(64), l = new Uint8Array(64), p = new Uint8Array(64), _, C, U = new Float64Array(64), A = [v(), v(), v(), v()];
757
+ ee(c, n, 32), c[0] &= 248, c[31] &= 127, c[31] |= 64;
758
+ var xt = a + 64;
759
+ for (_ = 0; _ < a; _++) i[64 + _] = f[_];
760
+ for (_ = 0; _ < 32; _++) i[32 + _] = c[32 + _];
761
+ for (ee(p, i.subarray(32), a + 32), Ie(p), _e(A, p), Et(i, A), _ = 32; _ < 64; _++) i[_] = n[_];
762
+ for (ee(l, i, a + 64), Ie(l), _ = 0; _ < 64; _++) U[_] = 0;
763
+ for (_ = 0; _ < 32; _++) U[_] = p[_];
764
+ for (_ = 0; _ < 32; _++)
765
+ for (C = 0; C < 32; C++)
766
+ U[_ + C] += l[_] * c[C];
767
+ return Re(i.subarray(32), U), xt;
768
+ }
769
+ function on(i, f) {
770
+ var a = v(), n = v(), c = v(), l = v(), p = v(), _ = v(), C = v();
771
+ return Wt(i[2], st), Rt(i[1], f), Lt(c, i[1]), ft(l, c, F), Yt(c, c, i[2]), Tt(l, i[2], l), Lt(p, l), Lt(_, p), ft(C, _, p), ft(a, C, c), ft(a, a, l), Ye(a, a), ft(a, a, c), ft(a, a, l), ft(a, a, l), ft(i[0], a, l), Lt(n, i[0]), ft(n, n, l), Fe(n, c) && ft(i[0], i[0], L), Lt(n, i[0]), ft(n, n, l), Fe(n, c) ? -1 : ($e(i[0]) === f[31] >> 7 && Yt(i[0], I, i[0]), ft(i[3], i[0], i[1]), 0);
772
+ }
773
+ function je(i, f, a, n) {
774
+ var c, l = new Uint8Array(32), p = new Uint8Array(64), _ = [v(), v(), v(), v()], C = [v(), v(), v(), v()];
775
+ if (a < 64 || on(C, n)) return -1;
776
+ for (c = 0; c < a; c++) i[c] = f[c];
777
+ for (c = 0; c < 32; c++) i[c + 32] = n[c];
778
+ if (ee(p, i, a), Ie(p), Le(_, C, p), _e(C, f.subarray(32)), ne(_, C), Et(l, _), a -= 64, nt(f, 0, l, 0)) {
779
+ for (c = 0; c < a; c++) i[c] = 0;
780
+ return -1;
781
+ }
782
+ for (c = 0; c < a; c++) i[c] = f[c + 64];
783
+ return a;
784
+ }
785
+ var le = 32, ae = 24, pe = 32, fe = 16, de = 32, me = 32, xe = 32, re = 32, Ue = 32, Qt = ae, sn = pe, an = fe, Zt = 64, ie = 32, Jt = 64, Me = 32, we = 64;
786
+ S.lowlevel = {
787
+ crypto_core_hsalsa20: zt,
788
+ crypto_stream_xor: Ce,
789
+ crypto_stream: ce,
790
+ crypto_stream_salsa20_xor: ze,
791
+ crypto_stream_salsa20: oe,
792
+ crypto_onetimeauth: Oe,
793
+ crypto_onetimeauth_verify: qe,
794
+ crypto_verify_16: mt,
795
+ crypto_verify_32: nt,
796
+ crypto_secretbox: Pe,
797
+ crypto_secretbox_open: ge,
798
+ crypto_scalarmult: Vt,
799
+ crypto_scalarmult_base: ue,
800
+ crypto_box_beforenm: he,
801
+ crypto_box_afternm: ke,
802
+ crypto_box: Xe,
803
+ crypto_box_open: rn,
804
+ crypto_box_keypair: Je,
805
+ crypto_hash: ee,
806
+ crypto_sign: Ze,
807
+ crypto_sign_keypair: Ne,
808
+ crypto_sign_open: je,
809
+ crypto_secretbox_KEYBYTES: le,
810
+ crypto_secretbox_NONCEBYTES: ae,
811
+ crypto_secretbox_ZEROBYTES: pe,
812
+ crypto_secretbox_BOXZEROBYTES: fe,
813
+ crypto_scalarmult_BYTES: de,
814
+ crypto_scalarmult_SCALARBYTES: me,
815
+ crypto_box_PUBLICKEYBYTES: xe,
816
+ crypto_box_SECRETKEYBYTES: re,
817
+ crypto_box_BEFORENMBYTES: Ue,
818
+ crypto_box_NONCEBYTES: Qt,
819
+ crypto_box_ZEROBYTES: sn,
820
+ crypto_box_BOXZEROBYTES: an,
821
+ crypto_sign_BYTES: Zt,
822
+ crypto_sign_PUBLICKEYBYTES: ie,
823
+ crypto_sign_SECRETKEYBYTES: Jt,
824
+ crypto_sign_SEEDBYTES: Me,
825
+ crypto_hash_BYTES: we,
826
+ gf: v,
827
+ D: F,
828
+ L: be,
829
+ pack25519: Ft,
830
+ unpack25519: Rt,
831
+ M: ft,
832
+ A: Tt,
833
+ S: Lt,
834
+ Z: Yt,
835
+ pow2523: Ye,
836
+ add: ne,
837
+ set25519: Wt,
838
+ modL: Re,
839
+ scalarmult: Le,
840
+ scalarbase: _e
841
+ };
842
+ function Be(i, f) {
843
+ if (i.length !== le) throw new Error("bad key size");
844
+ if (f.length !== ae) throw new Error("bad nonce size");
845
+ }
846
+ function Ve(i, f) {
847
+ if (i.length !== xe) throw new Error("bad public key size");
848
+ if (f.length !== re) throw new Error("bad secret key size");
849
+ }
850
+ function Dt() {
851
+ for (var i = 0; i < arguments.length; i++)
852
+ if (!(arguments[i] instanceof Uint8Array))
853
+ throw new TypeError("unexpected type, use Uint8Array");
854
+ }
855
+ function Qe(i) {
856
+ for (var f = 0; f < i.length; f++) i[f] = 0;
857
+ }
858
+ S.randomBytes = function(i) {
859
+ var f = new Uint8Array(i);
860
+ return St(f, i), f;
861
+ }, S.secretbox = function(i, f, a) {
862
+ Dt(i, f, a), Be(a, f);
863
+ for (var n = new Uint8Array(pe + i.length), c = new Uint8Array(n.length), l = 0; l < i.length; l++) n[l + pe] = i[l];
864
+ return Pe(c, n, n.length, f, a), c.subarray(fe);
865
+ }, S.secretbox.open = function(i, f, a) {
866
+ Dt(i, f, a), Be(a, f);
867
+ for (var n = new Uint8Array(fe + i.length), c = new Uint8Array(n.length), l = 0; l < i.length; l++) n[l + fe] = i[l];
868
+ return n.length < 32 || ge(c, n, n.length, f, a) !== 0 ? null : c.subarray(pe);
869
+ }, S.secretbox.keyLength = le, S.secretbox.nonceLength = ae, S.secretbox.overheadLength = fe, S.scalarMult = function(i, f) {
870
+ if (Dt(i, f), i.length !== me) throw new Error("bad n size");
871
+ if (f.length !== de) throw new Error("bad p size");
872
+ var a = new Uint8Array(de);
873
+ return Vt(a, i, f), a;
874
+ }, S.scalarMult.base = function(i) {
875
+ if (Dt(i), i.length !== me) throw new Error("bad n size");
876
+ var f = new Uint8Array(de);
877
+ return ue(f, i), f;
878
+ }, S.scalarMult.scalarLength = me, S.scalarMult.groupElementLength = de, S.box = function(i, f, a, n) {
879
+ var c = S.box.before(a, n);
880
+ return S.secretbox(i, f, c);
881
+ }, S.box.before = function(i, f) {
882
+ Dt(i, f), Ve(i, f);
883
+ var a = new Uint8Array(Ue);
884
+ return he(a, i, f), a;
885
+ }, S.box.after = S.secretbox, S.box.open = function(i, f, a, n) {
886
+ var c = S.box.before(a, n);
887
+ return S.secretbox.open(i, f, c);
888
+ }, S.box.open.after = S.secretbox.open, S.box.keyPair = function() {
889
+ var i = new Uint8Array(xe), f = new Uint8Array(re);
890
+ return Je(i, f), { publicKey: i, secretKey: f };
891
+ }, S.box.keyPair.fromSecretKey = function(i) {
892
+ if (Dt(i), i.length !== re)
893
+ throw new Error("bad secret key size");
894
+ var f = new Uint8Array(xe);
895
+ return ue(f, i), { publicKey: f, secretKey: new Uint8Array(i) };
896
+ }, S.box.publicKeyLength = xe, S.box.secretKeyLength = re, S.box.sharedKeyLength = Ue, S.box.nonceLength = Qt, S.box.overheadLength = S.secretbox.overheadLength, S.sign = function(i, f) {
897
+ if (Dt(i, f), f.length !== Jt)
898
+ throw new Error("bad secret key size");
899
+ var a = new Uint8Array(Zt + i.length);
900
+ return Ze(a, i, i.length, f), a;
901
+ }, S.sign.open = function(i, f) {
902
+ if (Dt(i, f), f.length !== ie)
903
+ throw new Error("bad public key size");
904
+ var a = new Uint8Array(i.length), n = je(a, i, i.length, f);
905
+ if (n < 0) return null;
906
+ for (var c = new Uint8Array(n), l = 0; l < c.length; l++) c[l] = a[l];
907
+ return c;
908
+ }, S.sign.detached = function(i, f) {
909
+ for (var a = S.sign(i, f), n = new Uint8Array(Zt), c = 0; c < n.length; c++) n[c] = a[c];
910
+ return n;
911
+ }, S.sign.detached.verify = function(i, f, a) {
912
+ if (Dt(i, f, a), f.length !== Zt)
913
+ throw new Error("bad signature size");
914
+ if (a.length !== ie)
915
+ throw new Error("bad public key size");
916
+ var n = new Uint8Array(Zt + i.length), c = new Uint8Array(Zt + i.length), l;
917
+ for (l = 0; l < Zt; l++) n[l] = f[l];
918
+ for (l = 0; l < i.length; l++) n[l + Zt] = i[l];
919
+ return je(c, n, n.length, a) >= 0;
920
+ }, S.sign.keyPair = function() {
921
+ var i = new Uint8Array(ie), f = new Uint8Array(Jt);
922
+ return Ne(i, f), { publicKey: i, secretKey: f };
923
+ }, S.sign.keyPair.fromSecretKey = function(i) {
924
+ if (Dt(i), i.length !== Jt)
925
+ throw new Error("bad secret key size");
926
+ for (var f = new Uint8Array(ie), a = 0; a < f.length; a++) f[a] = i[32 + a];
927
+ return { publicKey: f, secretKey: new Uint8Array(i) };
928
+ }, S.sign.keyPair.fromSeed = function(i) {
929
+ if (Dt(i), i.length !== Me)
930
+ throw new Error("bad seed size");
931
+ for (var f = new Uint8Array(ie), a = new Uint8Array(Jt), n = 0; n < 32; n++) a[n] = i[n];
932
+ return Ne(f, a, !0), { publicKey: f, secretKey: a };
933
+ }, S.sign.publicKeyLength = ie, S.sign.secretKeyLength = Jt, S.sign.seedLength = Me, S.sign.signatureLength = Zt, S.hash = function(i) {
934
+ Dt(i);
935
+ var f = new Uint8Array(we);
936
+ return ee(f, i, i.length), f;
937
+ }, S.hash.hashLength = we, S.verify = function(i, f) {
938
+ return Dt(i, f), i.length === 0 || f.length === 0 || i.length !== f.length ? !1 : M(i, 0, f, 0, i.length) === 0;
939
+ }, S.setPRNG = function(i) {
940
+ St = i;
941
+ }, (function() {
942
+ var i = typeof self < "u" ? self.crypto || self.msCrypto : null;
943
+ if (i && i.getRandomValues) {
944
+ var f = 65536;
945
+ S.setPRNG(function(a, n) {
946
+ var c, l = new Uint8Array(n);
947
+ for (c = 0; c < n; c += f)
948
+ i.getRandomValues(l.subarray(c, c + Math.min(n - c, f)));
949
+ for (c = 0; c < n; c++) a[c] = l[c];
950
+ Qe(l);
951
+ });
952
+ } else
953
+ i = ut(4), i && i.randomBytes && S.setPRNG(function(a, n) {
954
+ var c, l = i.randomBytes(n);
955
+ for (c = 0; c < n; c++) a[c] = l[c];
956
+ Qe(l);
957
+ });
958
+ })();
959
+ })(Ct.exports ? Ct.exports : self.nacl = self.nacl || {});
960
+ }),
961
+ /* 3 */
962
+ /***/
963
+ (function(Ct, G, ut) {
964
+ Ct.exports = ut(5).default;
965
+ }),
966
+ /* 4 */
967
+ /***/
968
+ (function(Ct, G) {
969
+ }),
970
+ /* 5 */
971
+ /***/
972
+ (function(Ct, G, ut) {
973
+ ut.r(G);
974
+ var S = (function() {
975
+ function e(t, r) {
976
+ this.lastId = 0, this.prefix = t, this.name = r;
977
+ }
978
+ return e.prototype.create = function(t) {
979
+ this.lastId++;
980
+ var r = this.lastId, o = this.prefix + r, s = this.name + "[" + r + "]", h = !1, y = function() {
981
+ h || (t.apply(null, arguments), h = !0);
982
+ };
983
+ return this[r] = y, { number: r, id: o, name: s, callback: y };
984
+ }, e.prototype.remove = function(t) {
985
+ delete this[t.number];
986
+ }, e;
987
+ })(), v = new S("_pusher_script_", "Pusher.ScriptReceivers"), St = {
988
+ VERSION: "7.0.3",
989
+ PROTOCOL: 7,
990
+ wsPort: 80,
991
+ wssPort: 443,
992
+ wsPath: "",
993
+ httpHost: "sockjs.pusher.com",
994
+ httpPort: 80,
995
+ httpsPort: 443,
996
+ httpPath: "/pusher",
997
+ stats_host: "stats.pusher.com",
998
+ authEndpoint: "/pusher/auth",
999
+ authTransport: "ajax",
1000
+ activityTimeout: 12e4,
1001
+ pongTimeout: 3e4,
1002
+ unavailableTimeout: 1e4,
1003
+ cluster: "mt1",
1004
+ cdn_http: "http://js.pusher.com",
1005
+ cdn_https: "https://js.pusher.com",
1006
+ dependency_suffix: ""
1007
+ }, ot = St, Ht = (function() {
1008
+ function e(t) {
1009
+ this.options = t, this.receivers = t.receivers || v, this.loading = {};
1010
+ }
1011
+ return e.prototype.load = function(t, r, o) {
1012
+ var s = this;
1013
+ if (s.loading[t] && s.loading[t].length > 0)
1014
+ s.loading[t].push(o);
1015
+ else {
1016
+ s.loading[t] = [o];
1017
+ var h = ct.createScriptRequest(s.getPath(t, r)), y = s.receivers.create(function(O) {
1018
+ if (s.receivers.remove(y), s.loading[t]) {
1019
+ var X = s.loading[t];
1020
+ delete s.loading[t];
1021
+ for (var wt = function(qt) {
1022
+ qt || h.cleanup();
1023
+ }, jt = 0; jt < X.length; jt++)
1024
+ X[jt](O, wt);
1025
+ }
1026
+ });
1027
+ h.send(y);
1028
+ }
1029
+ }, e.prototype.getRoot = function(t) {
1030
+ var r, o = ct.getDocument().location.protocol;
1031
+ return t && t.useTLS || o === "https:" ? r = this.options.cdn_https : r = this.options.cdn_http, r.replace(/\/*$/, "") + "/" + this.options.version;
1032
+ }, e.prototype.getPath = function(t, r) {
1033
+ return this.getRoot(r) + "/" + t + this.options.suffix + ".js";
1034
+ }, e;
1035
+ })(), I = Ht, st = new S("_pusher_dependencies", "Pusher.DependenciesReceivers"), Z = new I({
1036
+ cdn_http: ot.cdn_http,
1037
+ cdn_https: ot.cdn_https,
1038
+ version: ot.VERSION,
1039
+ suffix: ot.dependency_suffix,
1040
+ receivers: st
1041
+ }), F = {
1042
+ baseUrl: "https://pusher.com",
1043
+ urls: {
1044
+ authenticationEndpoint: {
1045
+ path: "/docs/authenticating_users"
1046
+ },
1047
+ javascriptQuickStart: {
1048
+ path: "/docs/javascript_quick_start"
1049
+ },
1050
+ triggeringClientEvents: {
1051
+ path: "/docs/client_api_guide/client_events#trigger-events"
1052
+ },
1053
+ encryptedChannelSupport: {
1054
+ fullUrl: "https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support"
1055
+ }
1056
+ }
1057
+ }, _t = function(e) {
1058
+ var t = "See:", r = F.urls[e];
1059
+ if (!r)
1060
+ return "";
1061
+ var o;
1062
+ return r.fullUrl ? o = r.fullUrl : r.path && (o = F.baseUrl + r.path), o ? t + " " + o : "";
1063
+ }, z = { buildLogSuffix: _t }, T = /* @__PURE__ */ (function() {
1064
+ var e = function(t, r) {
1065
+ return e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(o, s) {
1066
+ o.__proto__ = s;
1067
+ } || function(o, s) {
1068
+ for (var h in s) s.hasOwnProperty(h) && (o[h] = s[h]);
1069
+ }, e(t, r);
1070
+ };
1071
+ return function(t, r) {
1072
+ e(t, r);
1073
+ function o() {
1074
+ this.constructor = t;
1075
+ }
1076
+ t.prototype = r === null ? Object.create(r) : (o.prototype = r.prototype, new o());
1077
+ };
1078
+ })(), L = (function(e) {
1079
+ T(t, e);
1080
+ function t(r) {
1081
+ var o = this.constructor, s = e.call(this, r) || this;
1082
+ return Object.setPrototypeOf(s, o.prototype), s;
1083
+ }
1084
+ return t;
1085
+ })(Error), W = (function(e) {
1086
+ T(t, e);
1087
+ function t(r) {
1088
+ var o = this.constructor, s = e.call(this, r) || this;
1089
+ return Object.setPrototypeOf(s, o.prototype), s;
1090
+ }
1091
+ return t;
1092
+ })(Error), M = (function(e) {
1093
+ T(t, e);
1094
+ function t(r) {
1095
+ var o = this.constructor, s = e.call(this, r) || this;
1096
+ return Object.setPrototypeOf(s, o.prototype), s;
1097
+ }
1098
+ return t;
1099
+ })(Error), mt = (function(e) {
1100
+ T(t, e);
1101
+ function t(r) {
1102
+ var o = this.constructor, s = e.call(this, r) || this;
1103
+ return Object.setPrototypeOf(s, o.prototype), s;
1104
+ }
1105
+ return t;
1106
+ })(Error), nt = (function(e) {
1107
+ T(t, e);
1108
+ function t(r) {
1109
+ var o = this.constructor, s = e.call(this, r) || this;
1110
+ return Object.setPrototypeOf(s, o.prototype), s;
1111
+ }
1112
+ return t;
1113
+ })(Error), $t = (function(e) {
1114
+ T(t, e);
1115
+ function t(r) {
1116
+ var o = this.constructor, s = e.call(this, r) || this;
1117
+ return Object.setPrototypeOf(s, o.prototype), s;
1118
+ }
1119
+ return t;
1120
+ })(Error), Kt = (function(e) {
1121
+ T(t, e);
1122
+ function t(r) {
1123
+ var o = this.constructor, s = e.call(this, r) || this;
1124
+ return Object.setPrototypeOf(s, o.prototype), s;
1125
+ }
1126
+ return t;
1127
+ })(Error), Mt = (function(e) {
1128
+ T(t, e);
1129
+ function t(r, o) {
1130
+ var s = this.constructor, h = e.call(this, o) || this;
1131
+ return h.status = r, Object.setPrototypeOf(h, s.prototype), h;
1132
+ }
1133
+ return t;
1134
+ })(Error), zt = function(e, t, r) {
1135
+ var o = this, s;
1136
+ s = ct.createXHR(), s.open("POST", o.options.authEndpoint, !0), s.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
1137
+ for (var h in this.authOptions.headers)
1138
+ s.setRequestHeader(h, this.authOptions.headers[h]);
1139
+ return s.onreadystatechange = function() {
1140
+ if (s.readyState === 4)
1141
+ if (s.status === 200) {
1142
+ var y = void 0, O = !1;
1143
+ try {
1144
+ y = JSON.parse(s.responseText), O = !0;
1145
+ } catch {
1146
+ r(new Mt(200, "JSON returned from auth endpoint was invalid, yet status code was 200. Data was: " + s.responseText), { auth: "" });
1147
+ }
1148
+ O && r(null, y);
1149
+ } else {
1150
+ var X = z.buildLogSuffix("authenticationEndpoint");
1151
+ r(new Mt(s.status, "Unable to retrieve auth string from auth endpoint - " + ("received status: " + s.status + " from " + o.options.authEndpoint + ". ") + ("Clients must be authenticated to join private or presence channels. " + X)), { auth: "" });
1152
+ }
1153
+ }, s.send(this.composeQuery(t)), s;
1154
+ }, Bt = zt;
1155
+ function ze(e) {
1156
+ return qe(ye(e));
1157
+ }
1158
+ var oe = String.fromCharCode, ce = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", Ce = function(e) {
1159
+ var t = e.charCodeAt(0);
1160
+ return t < 128 ? e : t < 2048 ? oe(192 | t >>> 6) + oe(128 | t & 63) : oe(224 | t >>> 12 & 15) + oe(128 | t >>> 6 & 63) + oe(128 | t & 63);
1161
+ }, ye = function(e) {
1162
+ return e.replace(/[^\x00-\x7F]/g, Ce);
1163
+ }, Oe = function(e) {
1164
+ var t = [0, 2, 1][e.length % 3], r = e.charCodeAt(0) << 16 | (e.length > 1 ? e.charCodeAt(1) : 0) << 8 | (e.length > 2 ? e.charCodeAt(2) : 0), o = [
1165
+ ce.charAt(r >>> 18),
1166
+ ce.charAt(r >>> 12 & 63),
1167
+ t >= 2 ? "=" : ce.charAt(r >>> 6 & 63),
1168
+ t >= 1 ? "=" : ce.charAt(r & 63)
1169
+ ];
1170
+ return o.join("");
1171
+ }, qe = window.btoa || function(e) {
1172
+ return e.replace(/[\s\S]{1,3}/g, Oe);
1173
+ }, Pe = (function() {
1174
+ function e(t, r, o, s) {
1175
+ var h = this;
1176
+ this.clear = r, this.timer = t(function() {
1177
+ h.timer && (h.timer = s(h.timer));
1178
+ }, o);
1179
+ }
1180
+ return e.prototype.isRunning = function() {
1181
+ return this.timer !== null;
1182
+ }, e.prototype.ensureAborted = function() {
1183
+ this.timer && (this.clear(this.timer), this.timer = null);
1184
+ }, e;
1185
+ })(), ge = Pe, Wt = /* @__PURE__ */ (function() {
1186
+ var e = function(t, r) {
1187
+ return e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(o, s) {
1188
+ o.__proto__ = s;
1189
+ } || function(o, s) {
1190
+ for (var h in s) s.hasOwnProperty(h) && (o[h] = s[h]);
1191
+ }, e(t, r);
1192
+ };
1193
+ return function(t, r) {
1194
+ e(t, r);
1195
+ function o() {
1196
+ this.constructor = t;
1197
+ }
1198
+ t.prototype = r === null ? Object.create(r) : (o.prototype = r.prototype, new o());
1199
+ };
1200
+ })();
1201
+ function Ae(e) {
1202
+ window.clearTimeout(e);
1203
+ }
1204
+ function se(e) {
1205
+ window.clearInterval(e);
1206
+ }
1207
+ var Ft = (function(e) {
1208
+ Wt(t, e);
1209
+ function t(r, o) {
1210
+ return e.call(this, setTimeout, Ae, r, function(s) {
1211
+ return o(), null;
1212
+ }) || this;
1213
+ }
1214
+ return t;
1215
+ })(ge), Fe = (function(e) {
1216
+ Wt(t, e);
1217
+ function t(r, o) {
1218
+ return e.call(this, setInterval, se, r, function(s) {
1219
+ return o(), s;
1220
+ }) || this;
1221
+ }
1222
+ return t;
1223
+ })(ge), $e = {
1224
+ now: function() {
1225
+ return Date.now ? Date.now() : (/* @__PURE__ */ new Date()).valueOf();
1226
+ },
1227
+ defer: function(e) {
1228
+ return new Ft(0, e);
1229
+ },
1230
+ method: function(e) {
1231
+ var t = Array.prototype.slice.call(arguments, 1);
1232
+ return function(r) {
1233
+ return r[e].apply(r, t.concat(arguments));
1234
+ };
1235
+ }
1236
+ }, Rt = $e;
1237
+ function Tt(e) {
1238
+ for (var t = [], r = 1; r < arguments.length; r++)
1239
+ t[r - 1] = arguments[r];
1240
+ for (var o = 0; o < t.length; o++) {
1241
+ var s = t[o];
1242
+ for (var h in s)
1243
+ s[h] && s[h].constructor && s[h].constructor === Object ? e[h] = Tt(e[h] || {}, s[h]) : e[h] = s[h];
1244
+ }
1245
+ return e;
1246
+ }
1247
+ function Yt() {
1248
+ for (var e = ["Pusher"], t = 0; t < arguments.length; t++)
1249
+ typeof arguments[t] == "string" ? e.push(arguments[t]) : e.push(ne(arguments[t]));
1250
+ return e.join(" : ");
1251
+ }
1252
+ function ft(e, t) {
1253
+ var r = Array.prototype.indexOf;
1254
+ if (e === null)
1255
+ return -1;
1256
+ if (r && e.indexOf === r)
1257
+ return e.indexOf(t);
1258
+ for (var o = 0, s = e.length; o < s; o++)
1259
+ if (e[o] === t)
1260
+ return o;
1261
+ return -1;
1262
+ }
1263
+ function Lt(e, t) {
1264
+ for (var r in e)
1265
+ Object.prototype.hasOwnProperty.call(e, r) && t(e[r], r, e);
1266
+ }
1267
+ function Ee(e) {
1268
+ var t = [];
1269
+ return Lt(e, function(r, o) {
1270
+ t.push(o);
1271
+ }), t;
1272
+ }
1273
+ function Ye(e) {
1274
+ var t = [];
1275
+ return Lt(e, function(r) {
1276
+ t.push(r);
1277
+ }), t;
1278
+ }
1279
+ function Vt(e, t, r) {
1280
+ for (var o = 0; o < e.length; o++)
1281
+ t.call(r || window, e[o], o, e);
1282
+ }
1283
+ function ue(e, t) {
1284
+ for (var r = [], o = 0; o < e.length; o++)
1285
+ r.push(t(e[o], o, e, r));
1286
+ return r;
1287
+ }
1288
+ function Je(e, t) {
1289
+ var r = {};
1290
+ return Lt(e, function(o, s) {
1291
+ r[s] = t(o);
1292
+ }), r;
1293
+ }
1294
+ function he(e, t) {
1295
+ t = t || function(s) {
1296
+ return !!s;
1297
+ };
1298
+ for (var r = [], o = 0; o < e.length; o++)
1299
+ t(e[o], o, e, r) && r.push(e[o]);
1300
+ return r;
1301
+ }
1302
+ function ke(e, t) {
1303
+ var r = {};
1304
+ return Lt(e, function(o, s) {
1305
+ (t && t(o, s, e, r) || o) && (r[s] = o);
1306
+ }), r;
1307
+ }
1308
+ function nn(e) {
1309
+ var t = [];
1310
+ return Lt(e, function(r, o) {
1311
+ t.push([o, r]);
1312
+ }), t;
1313
+ }
1314
+ function Xe(e, t) {
1315
+ for (var r = 0; r < e.length; r++)
1316
+ if (t(e[r], r, e))
1317
+ return !0;
1318
+ return !1;
1319
+ }
1320
+ function rn(e, t) {
1321
+ for (var r = 0; r < e.length; r++)
1322
+ if (!t(e[r], r, e))
1323
+ return !1;
1324
+ return !0;
1325
+ }
1326
+ function We(e) {
1327
+ return Je(e, function(t) {
1328
+ return typeof t == "object" && (t = ne(t)), encodeURIComponent(ze(t.toString()));
1329
+ });
1330
+ }
1331
+ function Ge(e) {
1332
+ var t = ke(e, function(o) {
1333
+ return o !== void 0;
1334
+ }), r = ue(nn(We(t)), Rt.method("join", "=")).join("&");
1335
+ return r;
1336
+ }
1337
+ function ee(e) {
1338
+ var t = [], r = [];
1339
+ return (function o(s, h) {
1340
+ var y, O, X;
1341
+ switch (typeof s) {
1342
+ case "object":
1343
+ if (!s)
1344
+ return null;
1345
+ for (y = 0; y < t.length; y += 1)
1346
+ if (t[y] === s)
1347
+ return { $ref: r[y] };
1348
+ if (t.push(s), r.push(h), Object.prototype.toString.apply(s) === "[object Array]")
1349
+ for (X = [], y = 0; y < s.length; y += 1)
1350
+ X[y] = o(s[y], h + "[" + y + "]");
1351
+ else {
1352
+ X = {};
1353
+ for (O in s)
1354
+ Object.prototype.hasOwnProperty.call(s, O) && (X[O] = o(s[O], h + "[" + JSON.stringify(O) + "]"));
1355
+ }
1356
+ return X;
1357
+ case "number":
1358
+ case "string":
1359
+ case "boolean":
1360
+ return s;
1361
+ }
1362
+ })(e, "$");
1363
+ }
1364
+ function ne(e) {
1365
+ try {
1366
+ return JSON.stringify(e);
1367
+ } catch {
1368
+ return JSON.stringify(ee(e));
1369
+ }
1370
+ }
1371
+ var Ke = (function() {
1372
+ function e() {
1373
+ this.globalLog = function(t) {
1374
+ window.console && window.console.log && window.console.log(t);
1375
+ };
1376
+ }
1377
+ return e.prototype.debug = function() {
1378
+ for (var t = [], r = 0; r < arguments.length; r++)
1379
+ t[r] = arguments[r];
1380
+ this.log(this.globalLog, t);
1381
+ }, e.prototype.warn = function() {
1382
+ for (var t = [], r = 0; r < arguments.length; r++)
1383
+ t[r] = arguments[r];
1384
+ this.log(this.globalLogWarn, t);
1385
+ }, e.prototype.error = function() {
1386
+ for (var t = [], r = 0; r < arguments.length; r++)
1387
+ t[r] = arguments[r];
1388
+ this.log(this.globalLogError, t);
1389
+ }, e.prototype.globalLogWarn = function(t) {
1390
+ window.console && window.console.warn ? window.console.warn(t) : this.globalLog(t);
1391
+ }, e.prototype.globalLogError = function(t) {
1392
+ window.console && window.console.error ? window.console.error(t) : this.globalLogWarn(t);
1393
+ }, e.prototype.log = function(t) {
1394
+ var r = Yt.apply(this, arguments);
1395
+ if (Se.log)
1396
+ Se.log(r);
1397
+ else if (Se.logToConsole) {
1398
+ var o = t.bind(this);
1399
+ o(r);
1400
+ }
1401
+ }, e;
1402
+ })(), Et = new Ke(), Le = function(e, t, r) {
1403
+ this.authOptions.headers !== void 0 && Et.warn("To send headers with the auth request, you must use AJAX, rather than JSONP.");
1404
+ var o = e.nextAuthCallbackID.toString();
1405
+ e.nextAuthCallbackID++;
1406
+ var s = e.getDocument(), h = s.createElement("script");
1407
+ e.auth_callbacks[o] = function(X) {
1408
+ r(null, X);
1409
+ };
1410
+ var y = "Pusher.auth_callbacks['" + o + "']";
1411
+ h.src = this.options.authEndpoint + "?callback=" + encodeURIComponent(y) + "&" + this.composeQuery(t);
1412
+ var O = s.getElementsByTagName("head")[0] || s.documentElement;
1413
+ O.insertBefore(h, O.firstChild);
1414
+ }, _e = Le, Ne = (function() {
1415
+ function e(t) {
1416
+ this.src = t;
1417
+ }
1418
+ return e.prototype.send = function(t) {
1419
+ var r = this, o = "Error loading " + r.src;
1420
+ r.script = document.createElement("script"), r.script.id = t.id, r.script.src = r.src, r.script.type = "text/javascript", r.script.charset = "UTF-8", r.script.addEventListener ? (r.script.onerror = function() {
1421
+ t.callback(o);
1422
+ }, r.script.onload = function() {
1423
+ t.callback(null);
1424
+ }) : r.script.onreadystatechange = function() {
1425
+ (r.script.readyState === "loaded" || r.script.readyState === "complete") && t.callback(null);
1426
+ }, r.script.async === void 0 && document.attachEvent && /opera/i.test(navigator.userAgent) ? (r.errorScript = document.createElement("script"), r.errorScript.id = t.id + "_error", r.errorScript.text = t.name + "('" + o + "');", r.script.async = r.errorScript.async = !1) : r.script.async = !0;
1427
+ var s = document.getElementsByTagName("head")[0];
1428
+ s.insertBefore(r.script, s.firstChild), r.errorScript && s.insertBefore(r.errorScript, r.script.nextSibling);
1429
+ }, e.prototype.cleanup = function() {
1430
+ this.script && (this.script.onload = this.script.onerror = null, this.script.onreadystatechange = null), this.script && this.script.parentNode && this.script.parentNode.removeChild(this.script), this.errorScript && this.errorScript.parentNode && this.errorScript.parentNode.removeChild(this.errorScript), this.script = null, this.errorScript = null;
1431
+ }, e;
1432
+ })(), be = Ne, Re = (function() {
1433
+ function e(t, r) {
1434
+ this.url = t, this.data = r;
1435
+ }
1436
+ return e.prototype.send = function(t) {
1437
+ if (!this.request) {
1438
+ var r = Ge(this.data), o = this.url + "/" + t.number + "?" + r;
1439
+ this.request = ct.createScriptRequest(o), this.request.send(t);
1440
+ }
1441
+ }, e.prototype.cleanup = function() {
1442
+ this.request && this.request.cleanup();
1443
+ }, e;
1444
+ })(), Ie = Re, Ze = function(e, t) {
1445
+ return function(r, o) {
1446
+ var s = "http" + (t ? "s" : "") + "://", h = s + (e.host || e.options.host) + e.options.path, y = ct.createJSONPRequest(h, r), O = ct.ScriptReceivers.create(function(X, wt) {
1447
+ v.remove(O), y.cleanup(), wt && wt.host && (e.host = wt.host), o && o(X, wt);
1448
+ });
1449
+ y.send(O);
1450
+ };
1451
+ }, on = {
1452
+ name: "jsonp",
1453
+ getAgent: Ze
1454
+ }, je = on;
1455
+ function le(e, t, r) {
1456
+ var o = e + (t.useTLS ? "s" : ""), s = t.useTLS ? t.hostTLS : t.hostNonTLS;
1457
+ return o + "://" + s + r;
1458
+ }
1459
+ function ae(e, t) {
1460
+ var r = "/app/" + e, o = "?protocol=" + ot.PROTOCOL + "&client=js&version=" + ot.VERSION + (t ? "&" + t : "");
1461
+ return r + o;
1462
+ }
1463
+ var pe = {
1464
+ getInitial: function(e, t) {
1465
+ var r = (t.httpPath || "") + ae(e, "flash=false");
1466
+ return le("ws", t, r);
1467
+ }
1468
+ }, fe = {
1469
+ getInitial: function(e, t) {
1470
+ var r = (t.httpPath || "/pusher") + ae(e);
1471
+ return le("http", t, r);
1472
+ }
1473
+ }, de = {
1474
+ getInitial: function(e, t) {
1475
+ return le("http", t, t.httpPath || "/pusher");
1476
+ },
1477
+ getPath: function(e, t) {
1478
+ return ae(e);
1479
+ }
1480
+ }, me = (function() {
1481
+ function e() {
1482
+ this._callbacks = {};
1483
+ }
1484
+ return e.prototype.get = function(t) {
1485
+ return this._callbacks[re(t)];
1486
+ }, e.prototype.add = function(t, r, o) {
1487
+ var s = re(t);
1488
+ this._callbacks[s] = this._callbacks[s] || [], this._callbacks[s].push({
1489
+ fn: r,
1490
+ context: o
1491
+ });
1492
+ }, e.prototype.remove = function(t, r, o) {
1493
+ if (!t && !r && !o) {
1494
+ this._callbacks = {};
1495
+ return;
1496
+ }
1497
+ var s = t ? [re(t)] : Ee(this._callbacks);
1498
+ r || o ? this.removeCallback(s, r, o) : this.removeAllCallbacks(s);
1499
+ }, e.prototype.removeCallback = function(t, r, o) {
1500
+ Vt(t, function(s) {
1501
+ this._callbacks[s] = he(this._callbacks[s] || [], function(h) {
1502
+ return r && r !== h.fn || o && o !== h.context;
1503
+ }), this._callbacks[s].length === 0 && delete this._callbacks[s];
1504
+ }, this);
1505
+ }, e.prototype.removeAllCallbacks = function(t) {
1506
+ Vt(t, function(r) {
1507
+ delete this._callbacks[r];
1508
+ }, this);
1509
+ }, e;
1510
+ })(), xe = me;
1511
+ function re(e) {
1512
+ return "_" + e;
1513
+ }
1514
+ var Ue = (function() {
1515
+ function e(t) {
1516
+ this.callbacks = new xe(), this.global_callbacks = [], this.failThrough = t;
1517
+ }
1518
+ return e.prototype.bind = function(t, r, o) {
1519
+ return this.callbacks.add(t, r, o), this;
1520
+ }, e.prototype.bind_global = function(t) {
1521
+ return this.global_callbacks.push(t), this;
1522
+ }, e.prototype.unbind = function(t, r, o) {
1523
+ return this.callbacks.remove(t, r, o), this;
1524
+ }, e.prototype.unbind_global = function(t) {
1525
+ return t ? (this.global_callbacks = he(this.global_callbacks || [], function(r) {
1526
+ return r !== t;
1527
+ }), this) : (this.global_callbacks = [], this);
1528
+ }, e.prototype.unbind_all = function() {
1529
+ return this.unbind(), this.unbind_global(), this;
1530
+ }, e.prototype.emit = function(t, r, o) {
1531
+ for (var s = 0; s < this.global_callbacks.length; s++)
1532
+ this.global_callbacks[s](t, r);
1533
+ var h = this.callbacks.get(t), y = [];
1534
+ if (o ? y.push(r, o) : r && y.push(r), h && h.length > 0)
1535
+ for (var s = 0; s < h.length; s++)
1536
+ h[s].fn.apply(h[s].context || window, y);
1537
+ else this.failThrough && this.failThrough(t, r);
1538
+ return this;
1539
+ }, e;
1540
+ })(), Qt = Ue, sn = /* @__PURE__ */ (function() {
1541
+ var e = function(t, r) {
1542
+ return e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(o, s) {
1543
+ o.__proto__ = s;
1544
+ } || function(o, s) {
1545
+ for (var h in s) s.hasOwnProperty(h) && (o[h] = s[h]);
1546
+ }, e(t, r);
1547
+ };
1548
+ return function(t, r) {
1549
+ e(t, r);
1550
+ function o() {
1551
+ this.constructor = t;
1552
+ }
1553
+ t.prototype = r === null ? Object.create(r) : (o.prototype = r.prototype, new o());
1554
+ };
1555
+ })(), an = (function(e) {
1556
+ sn(t, e);
1557
+ function t(r, o, s, h, y) {
1558
+ var O = e.call(this) || this;
1559
+ return O.initialize = ct.transportConnectionInitializer, O.hooks = r, O.name = o, O.priority = s, O.key = h, O.options = y, O.state = "new", O.timeline = y.timeline, O.activityTimeout = y.activityTimeout, O.id = O.timeline.generateUniqueID(), O;
1560
+ }
1561
+ return t.prototype.handlesActivityChecks = function() {
1562
+ return !!this.hooks.handlesActivityChecks;
1563
+ }, t.prototype.supportsPing = function() {
1564
+ return !!this.hooks.supportsPing;
1565
+ }, t.prototype.connect = function() {
1566
+ var r = this;
1567
+ if (this.socket || this.state !== "initialized")
1568
+ return !1;
1569
+ var o = this.hooks.urls.getInitial(this.key, this.options);
1570
+ try {
1571
+ this.socket = this.hooks.getSocket(o, this.options);
1572
+ } catch (s) {
1573
+ return Rt.defer(function() {
1574
+ r.onError(s), r.changeState("closed");
1575
+ }), !1;
1576
+ }
1577
+ return this.bindListeners(), Et.debug("Connecting", { transport: this.name, url: o }), this.changeState("connecting"), !0;
1578
+ }, t.prototype.close = function() {
1579
+ return this.socket ? (this.socket.close(), !0) : !1;
1580
+ }, t.prototype.send = function(r) {
1581
+ var o = this;
1582
+ return this.state === "open" ? (Rt.defer(function() {
1583
+ o.socket && o.socket.send(r);
1584
+ }), !0) : !1;
1585
+ }, t.prototype.ping = function() {
1586
+ this.state === "open" && this.supportsPing() && this.socket.ping();
1587
+ }, t.prototype.onOpen = function() {
1588
+ this.hooks.beforeOpen && this.hooks.beforeOpen(this.socket, this.hooks.urls.getPath(this.key, this.options)), this.changeState("open"), this.socket.onopen = void 0;
1589
+ }, t.prototype.onError = function(r) {
1590
+ this.emit("error", { type: "WebSocketError", error: r }), this.timeline.error(this.buildTimelineMessage({ error: r.toString() }));
1591
+ }, t.prototype.onClose = function(r) {
1592
+ r ? this.changeState("closed", {
1593
+ code: r.code,
1594
+ reason: r.reason,
1595
+ wasClean: r.wasClean
1596
+ }) : this.changeState("closed"), this.unbindListeners(), this.socket = void 0;
1597
+ }, t.prototype.onMessage = function(r) {
1598
+ this.emit("message", r);
1599
+ }, t.prototype.onActivity = function() {
1600
+ this.emit("activity");
1601
+ }, t.prototype.bindListeners = function() {
1602
+ var r = this;
1603
+ this.socket.onopen = function() {
1604
+ r.onOpen();
1605
+ }, this.socket.onerror = function(o) {
1606
+ r.onError(o);
1607
+ }, this.socket.onclose = function(o) {
1608
+ r.onClose(o);
1609
+ }, this.socket.onmessage = function(o) {
1610
+ r.onMessage(o);
1611
+ }, this.supportsPing() && (this.socket.onactivity = function() {
1612
+ r.onActivity();
1613
+ });
1614
+ }, t.prototype.unbindListeners = function() {
1615
+ this.socket && (this.socket.onopen = void 0, this.socket.onerror = void 0, this.socket.onclose = void 0, this.socket.onmessage = void 0, this.supportsPing() && (this.socket.onactivity = void 0));
1616
+ }, t.prototype.changeState = function(r, o) {
1617
+ this.state = r, this.timeline.info(this.buildTimelineMessage({
1618
+ state: r,
1619
+ params: o
1620
+ })), this.emit(r, o);
1621
+ }, t.prototype.buildTimelineMessage = function(r) {
1622
+ return Tt({ cid: this.id }, r);
1623
+ }, t;
1624
+ })(Qt), Zt = an, ie = (function() {
1625
+ function e(t) {
1626
+ this.hooks = t;
1627
+ }
1628
+ return e.prototype.isSupported = function(t) {
1629
+ return this.hooks.isSupported(t);
1630
+ }, e.prototype.createConnection = function(t, r, o, s) {
1631
+ return new Zt(this.hooks, t, r, o, s);
1632
+ }, e;
1633
+ })(), Jt = ie, Me = new Jt({
1634
+ urls: pe,
1635
+ handlesActivityChecks: !1,
1636
+ supportsPing: !1,
1637
+ isInitialized: function() {
1638
+ return !!ct.getWebSocketAPI();
1639
+ },
1640
+ isSupported: function() {
1641
+ return !!ct.getWebSocketAPI();
1642
+ },
1643
+ getSocket: function(e) {
1644
+ return ct.createWebSocket(e);
1645
+ }
1646
+ }), we = {
1647
+ urls: fe,
1648
+ handlesActivityChecks: !1,
1649
+ supportsPing: !0,
1650
+ isInitialized: function() {
1651
+ return !0;
1652
+ }
1653
+ }, Be = Tt({
1654
+ getSocket: function(e) {
1655
+ return ct.HTTPFactory.createStreamingSocket(e);
1656
+ }
1657
+ }, we), Ve = Tt({
1658
+ getSocket: function(e) {
1659
+ return ct.HTTPFactory.createPollingSocket(e);
1660
+ }
1661
+ }, we), Dt = {
1662
+ isSupported: function() {
1663
+ return ct.isXHRSupported();
1664
+ }
1665
+ }, Qe = new Jt(Tt({}, Be, Dt)), i = new Jt(Tt({}, Ve, Dt)), f = {
1666
+ ws: Me,
1667
+ xhr_streaming: Qe,
1668
+ xhr_polling: i
1669
+ }, a = f, n = new Jt({
1670
+ file: "sockjs",
1671
+ urls: de,
1672
+ handlesActivityChecks: !0,
1673
+ supportsPing: !1,
1674
+ isSupported: function() {
1675
+ return !0;
1676
+ },
1677
+ isInitialized: function() {
1678
+ return window.SockJS !== void 0;
1679
+ },
1680
+ getSocket: function(e, t) {
1681
+ return new window.SockJS(e, null, {
1682
+ js_path: Z.getPath("sockjs", {
1683
+ useTLS: t.useTLS
1684
+ }),
1685
+ ignore_null_origin: t.ignoreNullOrigin
1686
+ });
1687
+ },
1688
+ beforeOpen: function(e, t) {
1689
+ e.send(JSON.stringify({
1690
+ path: t
1691
+ }));
1692
+ }
1693
+ }), c = {
1694
+ isSupported: function(e) {
1695
+ var t = ct.isXDRSupported(e.useTLS);
1696
+ return t;
1697
+ }
1698
+ }, l = new Jt(Tt({}, Be, c)), p = new Jt(Tt({}, Ve, c));
1699
+ a.xdr_streaming = l, a.xdr_polling = p, a.sockjs = n;
1700
+ var _ = a, C = /* @__PURE__ */ (function() {
1701
+ var e = function(t, r) {
1702
+ return e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(o, s) {
1703
+ o.__proto__ = s;
1704
+ } || function(o, s) {
1705
+ for (var h in s) s.hasOwnProperty(h) && (o[h] = s[h]);
1706
+ }, e(t, r);
1707
+ };
1708
+ return function(t, r) {
1709
+ e(t, r);
1710
+ function o() {
1711
+ this.constructor = t;
1712
+ }
1713
+ t.prototype = r === null ? Object.create(r) : (o.prototype = r.prototype, new o());
1714
+ };
1715
+ })(), U = (function(e) {
1716
+ C(t, e);
1717
+ function t() {
1718
+ var r = e.call(this) || this, o = r;
1719
+ return window.addEventListener !== void 0 && (window.addEventListener("online", function() {
1720
+ o.emit("online");
1721
+ }, !1), window.addEventListener("offline", function() {
1722
+ o.emit("offline");
1723
+ }, !1)), r;
1724
+ }
1725
+ return t.prototype.isOnline = function() {
1726
+ return window.navigator.onLine === void 0 ? !0 : window.navigator.onLine;
1727
+ }, t;
1728
+ })(Qt), A = new U(), xt = (function() {
1729
+ function e(t, r, o) {
1730
+ this.manager = t, this.transport = r, this.minPingDelay = o.minPingDelay, this.maxPingDelay = o.maxPingDelay, this.pingDelay = void 0;
1731
+ }
1732
+ return e.prototype.createConnection = function(t, r, o, s) {
1733
+ var h = this;
1734
+ s = Tt({}, s, {
1735
+ activityTimeout: this.pingDelay
1736
+ });
1737
+ var y = this.transport.createConnection(t, r, o, s), O = null, X = function() {
1738
+ y.unbind("open", X), y.bind("closed", wt), O = Rt.now();
1739
+ }, wt = function(jt) {
1740
+ if (y.unbind("closed", wt), jt.code === 1002 || jt.code === 1003)
1741
+ h.manager.reportDeath();
1742
+ else if (!jt.wasClean && O) {
1743
+ var qt = Rt.now() - O;
1744
+ qt < 2 * h.maxPingDelay && (h.manager.reportDeath(), h.pingDelay = Math.max(qt / 2, h.minPingDelay));
1745
+ }
1746
+ };
1747
+ return y.bind("open", X), y;
1748
+ }, e.prototype.isSupported = function(t) {
1749
+ return this.manager.isAlive() && this.transport.isSupported(t);
1750
+ }, e;
1751
+ })(), k = xt, q = {
1752
+ decodeMessage: function(e) {
1753
+ try {
1754
+ var t = JSON.parse(e.data), r = t.data;
1755
+ if (typeof r == "string")
1756
+ try {
1757
+ r = JSON.parse(t.data);
1758
+ } catch {
1759
+ }
1760
+ var o = {
1761
+ event: t.event,
1762
+ channel: t.channel,
1763
+ data: r
1764
+ };
1765
+ return t.user_id && (o.user_id = t.user_id), o;
1766
+ } catch (s) {
1767
+ throw { type: "MessageParseError", error: s, data: e.data };
1768
+ }
1769
+ },
1770
+ encodeMessage: function(e) {
1771
+ return JSON.stringify(e);
1772
+ },
1773
+ processHandshake: function(e) {
1774
+ var t = q.decodeMessage(e);
1775
+ if (t.event === "pusher:connection_established") {
1776
+ if (!t.data.activity_timeout)
1777
+ throw "No activity timeout specified in handshake";
1778
+ return {
1779
+ action: "connected",
1780
+ id: t.data.socket_id,
1781
+ activityTimeout: t.data.activity_timeout * 1e3
1782
+ };
1783
+ } else {
1784
+ if (t.event === "pusher:error")
1785
+ return {
1786
+ action: this.getCloseAction(t.data),
1787
+ error: this.getCloseError(t.data)
1788
+ };
1789
+ throw "Invalid handshake";
1790
+ }
1791
+ },
1792
+ getCloseAction: function(e) {
1793
+ return e.code < 4e3 ? e.code >= 1002 && e.code <= 1004 ? "backoff" : null : e.code === 4e3 ? "tls_only" : e.code < 4100 ? "refused" : e.code < 4200 ? "backoff" : e.code < 4300 ? "retry" : "refused";
1794
+ },
1795
+ getCloseError: function(e) {
1796
+ return e.code !== 1e3 && e.code !== 1001 ? {
1797
+ type: "PusherError",
1798
+ data: {
1799
+ code: e.code,
1800
+ message: e.reason || e.message
1801
+ }
1802
+ } : null;
1803
+ }
1804
+ }, D = q, V = /* @__PURE__ */ (function() {
1805
+ var e = function(t, r) {
1806
+ return e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(o, s) {
1807
+ o.__proto__ = s;
1808
+ } || function(o, s) {
1809
+ for (var h in s) s.hasOwnProperty(h) && (o[h] = s[h]);
1810
+ }, e(t, r);
1811
+ };
1812
+ return function(t, r) {
1813
+ e(t, r);
1814
+ function o() {
1815
+ this.constructor = t;
1816
+ }
1817
+ t.prototype = r === null ? Object.create(r) : (o.prototype = r.prototype, new o());
1818
+ };
1819
+ })(), K = (function(e) {
1820
+ V(t, e);
1821
+ function t(r, o) {
1822
+ var s = e.call(this) || this;
1823
+ return s.id = r, s.transport = o, s.activityTimeout = o.activityTimeout, s.bindListeners(), s;
1824
+ }
1825
+ return t.prototype.handlesActivityChecks = function() {
1826
+ return this.transport.handlesActivityChecks();
1827
+ }, t.prototype.send = function(r) {
1828
+ return this.transport.send(r);
1829
+ }, t.prototype.send_event = function(r, o, s) {
1830
+ var h = { event: r, data: o };
1831
+ return s && (h.channel = s), Et.debug("Event sent", h), this.send(D.encodeMessage(h));
1832
+ }, t.prototype.ping = function() {
1833
+ this.transport.supportsPing() ? this.transport.ping() : this.send_event("pusher:ping", {});
1834
+ }, t.prototype.close = function() {
1835
+ this.transport.close();
1836
+ }, t.prototype.bindListeners = function() {
1837
+ var r = this, o = {
1838
+ message: function(h) {
1839
+ var y;
1840
+ try {
1841
+ y = D.decodeMessage(h);
1842
+ } catch (O) {
1843
+ r.emit("error", {
1844
+ type: "MessageParseError",
1845
+ error: O,
1846
+ data: h.data
1847
+ });
1848
+ }
1849
+ if (y !== void 0) {
1850
+ switch (Et.debug("Event recd", y), y.event) {
1851
+ case "pusher:error":
1852
+ r.emit("error", {
1853
+ type: "PusherError",
1854
+ data: y.data
1855
+ });
1856
+ break;
1857
+ case "pusher:ping":
1858
+ r.emit("ping");
1859
+ break;
1860
+ case "pusher:pong":
1861
+ r.emit("pong");
1862
+ break;
1863
+ }
1864
+ r.emit("message", y);
1865
+ }
1866
+ },
1867
+ activity: function() {
1868
+ r.emit("activity");
1869
+ },
1870
+ error: function(h) {
1871
+ r.emit("error", h);
1872
+ },
1873
+ closed: function(h) {
1874
+ s(), h && h.code && r.handleCloseEvent(h), r.transport = null, r.emit("closed");
1875
+ }
1876
+ }, s = function() {
1877
+ Lt(o, function(h, y) {
1878
+ r.transport.unbind(y, h);
1879
+ });
1880
+ };
1881
+ Lt(o, function(h, y) {
1882
+ r.transport.bind(y, h);
1883
+ });
1884
+ }, t.prototype.handleCloseEvent = function(r) {
1885
+ var o = D.getCloseAction(r), s = D.getCloseError(r);
1886
+ s && this.emit("error", s), o && this.emit(o, { action: o, error: s });
1887
+ }, t;
1888
+ })(Qt), $ = K, J = (function() {
1889
+ function e(t, r) {
1890
+ this.transport = t, this.callback = r, this.bindListeners();
1891
+ }
1892
+ return e.prototype.close = function() {
1893
+ this.unbindListeners(), this.transport.close();
1894
+ }, e.prototype.bindListeners = function() {
1895
+ var t = this;
1896
+ this.onMessage = function(r) {
1897
+ t.unbindListeners();
1898
+ var o;
1899
+ try {
1900
+ o = D.processHandshake(r);
1901
+ } catch (s) {
1902
+ t.finish("error", { error: s }), t.transport.close();
1903
+ return;
1904
+ }
1905
+ o.action === "connected" ? t.finish("connected", {
1906
+ connection: new $(o.id, t.transport),
1907
+ activityTimeout: o.activityTimeout
1908
+ }) : (t.finish(o.action, { error: o.error }), t.transport.close());
1909
+ }, this.onClosed = function(r) {
1910
+ t.unbindListeners();
1911
+ var o = D.getCloseAction(r) || "backoff", s = D.getCloseError(r);
1912
+ t.finish(o, { error: s });
1913
+ }, this.transport.bind("message", this.onMessage), this.transport.bind("closed", this.onClosed);
1914
+ }, e.prototype.unbindListeners = function() {
1915
+ this.transport.unbind("message", this.onMessage), this.transport.unbind("closed", this.onClosed);
1916
+ }, e.prototype.finish = function(t, r) {
1917
+ this.callback(Tt({ transport: this.transport, action: t }, r));
1918
+ }, e;
1919
+ })(), Y = J, N = (function() {
1920
+ function e(t, r) {
1921
+ this.channel = t;
1922
+ var o = r.authTransport;
1923
+ if (typeof ct.getAuthorizers()[o] > "u")
1924
+ throw "'" + o + "' is not a recognized auth transport";
1925
+ this.type = o, this.options = r, this.authOptions = r.auth || {};
1926
+ }
1927
+ return e.prototype.composeQuery = function(t) {
1928
+ var r = "socket_id=" + encodeURIComponent(t) + "&channel_name=" + encodeURIComponent(this.channel.name);
1929
+ for (var o in this.authOptions.params)
1930
+ r += "&" + encodeURIComponent(o) + "=" + encodeURIComponent(this.authOptions.params[o]);
1931
+ return r;
1932
+ }, e.prototype.authorize = function(t, r) {
1933
+ e.authorizers = e.authorizers || ct.getAuthorizers(), e.authorizers[this.type].call(this, ct, t, r);
1934
+ }, e;
1935
+ })(), B = N, E = (function() {
1936
+ function e(t, r) {
1937
+ this.timeline = t, this.options = r || {};
1938
+ }
1939
+ return e.prototype.send = function(t, r) {
1940
+ this.timeline.isEmpty() || this.timeline.send(ct.TimelineTransport.getAgent(this, t), r);
1941
+ }, e;
1942
+ })(), R = E, j = /* @__PURE__ */ (function() {
1943
+ var e = function(t, r) {
1944
+ return e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(o, s) {
1945
+ o.__proto__ = s;
1946
+ } || function(o, s) {
1947
+ for (var h in s) s.hasOwnProperty(h) && (o[h] = s[h]);
1948
+ }, e(t, r);
1949
+ };
1950
+ return function(t, r) {
1951
+ e(t, r);
1952
+ function o() {
1953
+ this.constructor = t;
1954
+ }
1955
+ t.prototype = r === null ? Object.create(r) : (o.prototype = r.prototype, new o());
1956
+ };
1957
+ })(), P = (function(e) {
1958
+ j(t, e);
1959
+ function t(r, o) {
1960
+ var s = e.call(this, function(h, y) {
1961
+ Et.debug("No callbacks on " + r + " for " + h);
1962
+ }) || this;
1963
+ return s.name = r, s.pusher = o, s.subscribed = !1, s.subscriptionPending = !1, s.subscriptionCancelled = !1, s;
1964
+ }
1965
+ return t.prototype.authorize = function(r, o) {
1966
+ return o(null, { auth: "" });
1967
+ }, t.prototype.trigger = function(r, o) {
1968
+ if (r.indexOf("client-") !== 0)
1969
+ throw new L("Event '" + r + "' does not start with 'client-'");
1970
+ if (!this.subscribed) {
1971
+ var s = z.buildLogSuffix("triggeringClientEvents");
1972
+ Et.warn("Client event triggered before channel 'subscription_succeeded' event . " + s);
1973
+ }
1974
+ return this.pusher.send_event(r, o, this.name);
1975
+ }, t.prototype.disconnect = function() {
1976
+ this.subscribed = !1, this.subscriptionPending = !1;
1977
+ }, t.prototype.handleEvent = function(r) {
1978
+ var o = r.event, s = r.data;
1979
+ if (o === "pusher_internal:subscription_succeeded")
1980
+ this.handleSubscriptionSucceededEvent(r);
1981
+ else if (o.indexOf("pusher_internal:") !== 0) {
1982
+ var h = {};
1983
+ this.emit(o, s, h);
1984
+ }
1985
+ }, t.prototype.handleSubscriptionSucceededEvent = function(r) {
1986
+ this.subscriptionPending = !1, this.subscribed = !0, this.subscriptionCancelled ? this.pusher.unsubscribe(this.name) : this.emit("pusher:subscription_succeeded", r.data);
1987
+ }, t.prototype.subscribe = function() {
1988
+ var r = this;
1989
+ this.subscribed || (this.subscriptionPending = !0, this.subscriptionCancelled = !1, this.authorize(this.pusher.connection.socket_id, function(o, s) {
1990
+ o ? (r.subscriptionPending = !1, Et.error(o.toString()), r.emit("pusher:subscription_error", Object.assign({}, {
1991
+ type: "AuthError",
1992
+ error: o.message
1993
+ }, o instanceof Mt ? { status: o.status } : {}))) : r.pusher.send_event("pusher:subscribe", {
1994
+ auth: s.auth,
1995
+ channel_data: s.channel_data,
1996
+ channel: r.name
1997
+ });
1998
+ }));
1999
+ }, t.prototype.unsubscribe = function() {
2000
+ this.subscribed = !1, this.pusher.send_event("pusher:unsubscribe", {
2001
+ channel: this.name
2002
+ });
2003
+ }, t.prototype.cancelSubscription = function() {
2004
+ this.subscriptionCancelled = !0;
2005
+ }, t.prototype.reinstateSubscription = function() {
2006
+ this.subscriptionCancelled = !1;
2007
+ }, t;
2008
+ })(Qt), d = P, x = /* @__PURE__ */ (function() {
2009
+ var e = function(t, r) {
2010
+ return e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(o, s) {
2011
+ o.__proto__ = s;
2012
+ } || function(o, s) {
2013
+ for (var h in s) s.hasOwnProperty(h) && (o[h] = s[h]);
2014
+ }, e(t, r);
2015
+ };
2016
+ return function(t, r) {
2017
+ e(t, r);
2018
+ function o() {
2019
+ this.constructor = t;
2020
+ }
2021
+ t.prototype = r === null ? Object.create(r) : (o.prototype = r.prototype, new o());
2022
+ };
2023
+ })(), m = (function(e) {
2024
+ x(t, e);
2025
+ function t() {
2026
+ return e !== null && e.apply(this, arguments) || this;
2027
+ }
2028
+ return t.prototype.authorize = function(r, o) {
2029
+ var s = gt.createAuthorizer(this, this.pusher.config);
2030
+ return s.authorize(r, o);
2031
+ }, t;
2032
+ })(d), g = m, b = (function() {
2033
+ function e() {
2034
+ this.reset();
2035
+ }
2036
+ return e.prototype.get = function(t) {
2037
+ return Object.prototype.hasOwnProperty.call(this.members, t) ? {
2038
+ id: t,
2039
+ info: this.members[t]
2040
+ } : null;
2041
+ }, e.prototype.each = function(t) {
2042
+ var r = this;
2043
+ Lt(this.members, function(o, s) {
2044
+ t(r.get(s));
2045
+ });
2046
+ }, e.prototype.setMyID = function(t) {
2047
+ this.myID = t;
2048
+ }, e.prototype.onSubscription = function(t) {
2049
+ this.members = t.presence.hash, this.count = t.presence.count, this.me = this.get(this.myID);
2050
+ }, e.prototype.addMember = function(t) {
2051
+ return this.get(t.user_id) === null && this.count++, this.members[t.user_id] = t.user_info, this.get(t.user_id);
2052
+ }, e.prototype.removeMember = function(t) {
2053
+ var r = this.get(t.user_id);
2054
+ return r && (delete this.members[t.user_id], this.count--), r;
2055
+ }, e.prototype.reset = function() {
2056
+ this.members = {}, this.count = 0, this.myID = null, this.me = null;
2057
+ }, e;
2058
+ })(), w = b, H = /* @__PURE__ */ (function() {
2059
+ var e = function(t, r) {
2060
+ return e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(o, s) {
2061
+ o.__proto__ = s;
2062
+ } || function(o, s) {
2063
+ for (var h in s) s.hasOwnProperty(h) && (o[h] = s[h]);
2064
+ }, e(t, r);
2065
+ };
2066
+ return function(t, r) {
2067
+ e(t, r);
2068
+ function o() {
2069
+ this.constructor = t;
2070
+ }
2071
+ t.prototype = r === null ? Object.create(r) : (o.prototype = r.prototype, new o());
2072
+ };
2073
+ })(), Q = (function(e) {
2074
+ H(t, e);
2075
+ function t(r, o) {
2076
+ var s = e.call(this, r, o) || this;
2077
+ return s.members = new w(), s;
2078
+ }
2079
+ return t.prototype.authorize = function(r, o) {
2080
+ var s = this;
2081
+ e.prototype.authorize.call(this, r, function(h, y) {
2082
+ if (!h) {
2083
+ if (y = y, y.channel_data === void 0) {
2084
+ var O = z.buildLogSuffix("authenticationEndpoint");
2085
+ Et.error("Invalid auth response for channel '" + s.name + "'," + ("expected 'channel_data' field. " + O)), o("Invalid auth response");
2086
+ return;
2087
+ }
2088
+ var X = JSON.parse(y.channel_data);
2089
+ s.members.setMyID(X.user_id);
2090
+ }
2091
+ o(h, y);
2092
+ });
2093
+ }, t.prototype.handleEvent = function(r) {
2094
+ var o = r.event;
2095
+ if (o.indexOf("pusher_internal:") === 0)
2096
+ this.handleInternalEvent(r);
2097
+ else {
2098
+ var s = r.data, h = {};
2099
+ r.user_id && (h.user_id = r.user_id), this.emit(o, s, h);
2100
+ }
2101
+ }, t.prototype.handleInternalEvent = function(r) {
2102
+ var o = r.event, s = r.data;
2103
+ switch (o) {
2104
+ case "pusher_internal:subscription_succeeded":
2105
+ this.handleSubscriptionSucceededEvent(r);
2106
+ break;
2107
+ case "pusher_internal:member_added":
2108
+ var h = this.members.addMember(s);
2109
+ this.emit("pusher:member_added", h);
2110
+ break;
2111
+ case "pusher_internal:member_removed":
2112
+ var y = this.members.removeMember(s);
2113
+ y && this.emit("pusher:member_removed", y);
2114
+ break;
2115
+ }
2116
+ }, t.prototype.handleSubscriptionSucceededEvent = function(r) {
2117
+ this.subscriptionPending = !1, this.subscribed = !0, this.subscriptionCancelled ? this.pusher.unsubscribe(this.name) : (this.members.onSubscription(r.data), this.emit("pusher:subscription_succeeded", this.members));
2118
+ }, t.prototype.disconnect = function() {
2119
+ this.members.reset(), e.prototype.disconnect.call(this);
2120
+ }, t;
2121
+ })(g), et = Q, tt = ut(1), u = ut(0), it = /* @__PURE__ */ (function() {
2122
+ var e = function(t, r) {
2123
+ return e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(o, s) {
2124
+ o.__proto__ = s;
2125
+ } || function(o, s) {
2126
+ for (var h in s) s.hasOwnProperty(h) && (o[h] = s[h]);
2127
+ }, e(t, r);
2128
+ };
2129
+ return function(t, r) {
2130
+ e(t, r);
2131
+ function o() {
2132
+ this.constructor = t;
2133
+ }
2134
+ t.prototype = r === null ? Object.create(r) : (o.prototype = r.prototype, new o());
2135
+ };
2136
+ })(), vt = (function(e) {
2137
+ it(t, e);
2138
+ function t(r, o, s) {
2139
+ var h = e.call(this, r, o) || this;
2140
+ return h.key = null, h.nacl = s, h;
2141
+ }
2142
+ return t.prototype.authorize = function(r, o) {
2143
+ var s = this;
2144
+ e.prototype.authorize.call(this, r, function(h, y) {
2145
+ if (h) {
2146
+ o(h, y);
2147
+ return;
2148
+ }
2149
+ var O = y.shared_secret;
2150
+ if (!O) {
2151
+ o(new Error("No shared_secret key in auth payload for encrypted channel: " + s.name), null);
2152
+ return;
2153
+ }
2154
+ s.key = Object(u.decode)(O), delete y.shared_secret, o(null, y);
2155
+ });
2156
+ }, t.prototype.trigger = function(r, o) {
2157
+ throw new nt("Client events are not currently supported for encrypted channels");
2158
+ }, t.prototype.handleEvent = function(r) {
2159
+ var o = r.event, s = r.data;
2160
+ if (o.indexOf("pusher_internal:") === 0 || o.indexOf("pusher:") === 0) {
2161
+ e.prototype.handleEvent.call(this, r);
2162
+ return;
2163
+ }
2164
+ this.handleEncryptedEvent(o, s);
2165
+ }, t.prototype.handleEncryptedEvent = function(r, o) {
2166
+ var s = this;
2167
+ if (!this.key) {
2168
+ Et.debug("Received encrypted event before key has been retrieved from the authEndpoint");
2169
+ return;
2170
+ }
2171
+ if (!o.ciphertext || !o.nonce) {
2172
+ Et.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: " + o);
2173
+ return;
2174
+ }
2175
+ var h = Object(u.decode)(o.ciphertext);
2176
+ if (h.length < this.nacl.secretbox.overheadLength) {
2177
+ Et.error("Expected encrypted event ciphertext length to be " + this.nacl.secretbox.overheadLength + ", got: " + h.length);
2178
+ return;
2179
+ }
2180
+ var y = Object(u.decode)(o.nonce);
2181
+ if (y.length < this.nacl.secretbox.nonceLength) {
2182
+ Et.error("Expected encrypted event nonce length to be " + this.nacl.secretbox.nonceLength + ", got: " + y.length);
2183
+ return;
2184
+ }
2185
+ var O = this.nacl.secretbox.open(h, y, this.key);
2186
+ if (O === null) {
2187
+ Et.debug("Failed to decrypt an event, probably because it was encrypted with a different key. Fetching a new key from the authEndpoint..."), this.authorize(this.pusher.connection.socket_id, function(X, wt) {
2188
+ if (X) {
2189
+ Et.error("Failed to make a request to the authEndpoint: " + wt + ". Unable to fetch new key, so dropping encrypted event");
2190
+ return;
2191
+ }
2192
+ if (O = s.nacl.secretbox.open(h, y, s.key), O === null) {
2193
+ Et.error("Failed to decrypt event with new key. Dropping encrypted event");
2194
+ return;
2195
+ }
2196
+ s.emit(r, s.getDataToEmit(O));
2197
+ });
2198
+ return;
2199
+ }
2200
+ this.emit(r, this.getDataToEmit(O));
2201
+ }, t.prototype.getDataToEmit = function(r) {
2202
+ var o = Object(tt.decode)(r);
2203
+ try {
2204
+ return JSON.parse(o);
2205
+ } catch {
2206
+ return o;
2207
+ }
2208
+ }, t;
2209
+ })(g), yt = vt, rt = /* @__PURE__ */ (function() {
2210
+ var e = function(t, r) {
2211
+ return e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(o, s) {
2212
+ o.__proto__ = s;
2213
+ } || function(o, s) {
2214
+ for (var h in s) s.hasOwnProperty(h) && (o[h] = s[h]);
2215
+ }, e(t, r);
2216
+ };
2217
+ return function(t, r) {
2218
+ e(t, r);
2219
+ function o() {
2220
+ this.constructor = t;
2221
+ }
2222
+ t.prototype = r === null ? Object.create(r) : (o.prototype = r.prototype, new o());
2223
+ };
2224
+ })(), ht = (function(e) {
2225
+ rt(t, e);
2226
+ function t(r, o) {
2227
+ var s = e.call(this) || this;
2228
+ s.state = "initialized", s.connection = null, s.key = r, s.options = o, s.timeline = s.options.timeline, s.usingTLS = s.options.useTLS, s.errorCallbacks = s.buildErrorCallbacks(), s.connectionCallbacks = s.buildConnectionCallbacks(s.errorCallbacks), s.handshakeCallbacks = s.buildHandshakeCallbacks(s.errorCallbacks);
2229
+ var h = ct.getNetwork();
2230
+ return h.bind("online", function() {
2231
+ s.timeline.info({ netinfo: "online" }), (s.state === "connecting" || s.state === "unavailable") && s.retryIn(0);
2232
+ }), h.bind("offline", function() {
2233
+ s.timeline.info({ netinfo: "offline" }), s.connection && s.sendActivityCheck();
2234
+ }), s.updateStrategy(), s;
2235
+ }
2236
+ return t.prototype.connect = function() {
2237
+ if (!(this.connection || this.runner)) {
2238
+ if (!this.strategy.isSupported()) {
2239
+ this.updateState("failed");
2240
+ return;
2241
+ }
2242
+ this.updateState("connecting"), this.startConnecting(), this.setUnavailableTimer();
2243
+ }
2244
+ }, t.prototype.send = function(r) {
2245
+ return this.connection ? this.connection.send(r) : !1;
2246
+ }, t.prototype.send_event = function(r, o, s) {
2247
+ return this.connection ? this.connection.send_event(r, o, s) : !1;
2248
+ }, t.prototype.disconnect = function() {
2249
+ this.disconnectInternally(), this.updateState("disconnected");
2250
+ }, t.prototype.isUsingTLS = function() {
2251
+ return this.usingTLS;
2252
+ }, t.prototype.startConnecting = function() {
2253
+ var r = this, o = function(s, h) {
2254
+ s ? r.runner = r.strategy.connect(0, o) : h.action === "error" ? (r.emit("error", {
2255
+ type: "HandshakeError",
2256
+ error: h.error
2257
+ }), r.timeline.error({ handshakeError: h.error })) : (r.abortConnecting(), r.handshakeCallbacks[h.action](h));
2258
+ };
2259
+ this.runner = this.strategy.connect(0, o);
2260
+ }, t.prototype.abortConnecting = function() {
2261
+ this.runner && (this.runner.abort(), this.runner = null);
2262
+ }, t.prototype.disconnectInternally = function() {
2263
+ if (this.abortConnecting(), this.clearRetryTimer(), this.clearUnavailableTimer(), this.connection) {
2264
+ var r = this.abandonConnection();
2265
+ r.close();
2266
+ }
2267
+ }, t.prototype.updateStrategy = function() {
2268
+ this.strategy = this.options.getStrategy({
2269
+ key: this.key,
2270
+ timeline: this.timeline,
2271
+ useTLS: this.usingTLS
2272
+ });
2273
+ }, t.prototype.retryIn = function(r) {
2274
+ var o = this;
2275
+ this.timeline.info({ action: "retry", delay: r }), r > 0 && this.emit("connecting_in", Math.round(r / 1e3)), this.retryTimer = new Ft(r || 0, function() {
2276
+ o.disconnectInternally(), o.connect();
2277
+ });
2278
+ }, t.prototype.clearRetryTimer = function() {
2279
+ this.retryTimer && (this.retryTimer.ensureAborted(), this.retryTimer = null);
2280
+ }, t.prototype.setUnavailableTimer = function() {
2281
+ var r = this;
2282
+ this.unavailableTimer = new Ft(this.options.unavailableTimeout, function() {
2283
+ r.updateState("unavailable");
2284
+ });
2285
+ }, t.prototype.clearUnavailableTimer = function() {
2286
+ this.unavailableTimer && this.unavailableTimer.ensureAborted();
2287
+ }, t.prototype.sendActivityCheck = function() {
2288
+ var r = this;
2289
+ this.stopActivityCheck(), this.connection.ping(), this.activityTimer = new Ft(this.options.pongTimeout, function() {
2290
+ r.timeline.error({ pong_timed_out: r.options.pongTimeout }), r.retryIn(0);
2291
+ });
2292
+ }, t.prototype.resetActivityCheck = function() {
2293
+ var r = this;
2294
+ this.stopActivityCheck(), this.connection && !this.connection.handlesActivityChecks() && (this.activityTimer = new Ft(this.activityTimeout, function() {
2295
+ r.sendActivityCheck();
2296
+ }));
2297
+ }, t.prototype.stopActivityCheck = function() {
2298
+ this.activityTimer && this.activityTimer.ensureAborted();
2299
+ }, t.prototype.buildConnectionCallbacks = function(r) {
2300
+ var o = this;
2301
+ return Tt({}, r, {
2302
+ message: function(s) {
2303
+ o.resetActivityCheck(), o.emit("message", s);
2304
+ },
2305
+ ping: function() {
2306
+ o.send_event("pusher:pong", {});
2307
+ },
2308
+ activity: function() {
2309
+ o.resetActivityCheck();
2310
+ },
2311
+ error: function(s) {
2312
+ o.emit("error", s);
2313
+ },
2314
+ closed: function() {
2315
+ o.abandonConnection(), o.shouldRetry() && o.retryIn(1e3);
2316
+ }
2317
+ });
2318
+ }, t.prototype.buildHandshakeCallbacks = function(r) {
2319
+ var o = this;
2320
+ return Tt({}, r, {
2321
+ connected: function(s) {
2322
+ o.activityTimeout = Math.min(o.options.activityTimeout, s.activityTimeout, s.connection.activityTimeout || 1 / 0), o.clearUnavailableTimer(), o.setConnection(s.connection), o.socket_id = o.connection.id, o.updateState("connected", { socket_id: o.socket_id });
2323
+ }
2324
+ });
2325
+ }, t.prototype.buildErrorCallbacks = function() {
2326
+ var r = this, o = function(s) {
2327
+ return function(h) {
2328
+ h.error && r.emit("error", { type: "WebSocketError", error: h.error }), s(h);
2329
+ };
2330
+ };
2331
+ return {
2332
+ tls_only: o(function() {
2333
+ r.usingTLS = !0, r.updateStrategy(), r.retryIn(0);
2334
+ }),
2335
+ refused: o(function() {
2336
+ r.disconnect();
2337
+ }),
2338
+ backoff: o(function() {
2339
+ r.retryIn(1e3);
2340
+ }),
2341
+ retry: o(function() {
2342
+ r.retryIn(0);
2343
+ })
2344
+ };
2345
+ }, t.prototype.setConnection = function(r) {
2346
+ this.connection = r;
2347
+ for (var o in this.connectionCallbacks)
2348
+ this.connection.bind(o, this.connectionCallbacks[o]);
2349
+ this.resetActivityCheck();
2350
+ }, t.prototype.abandonConnection = function() {
2351
+ if (this.connection) {
2352
+ this.stopActivityCheck();
2353
+ for (var r in this.connectionCallbacks)
2354
+ this.connection.unbind(r, this.connectionCallbacks[r]);
2355
+ var o = this.connection;
2356
+ return this.connection = null, o;
2357
+ }
2358
+ }, t.prototype.updateState = function(r, o) {
2359
+ var s = this.state;
2360
+ if (this.state = r, s !== r) {
2361
+ var h = r;
2362
+ h === "connected" && (h += " with new socket ID " + o.socket_id), Et.debug("State changed", s + " -> " + h), this.timeline.info({ state: r, params: o }), this.emit("state_change", { previous: s, current: r }), this.emit(r, o);
2363
+ }
2364
+ }, t.prototype.shouldRetry = function() {
2365
+ return this.state === "connecting" || this.state === "connected";
2366
+ }, t;
2367
+ })(Qt), lt = ht, kt = (function() {
2368
+ function e() {
2369
+ this.channels = {};
2370
+ }
2371
+ return e.prototype.add = function(t, r) {
2372
+ return this.channels[t] || (this.channels[t] = Ot(t, r)), this.channels[t];
2373
+ }, e.prototype.all = function() {
2374
+ return Ye(this.channels);
2375
+ }, e.prototype.find = function(t) {
2376
+ return this.channels[t];
2377
+ }, e.prototype.remove = function(t) {
2378
+ var r = this.channels[t];
2379
+ return delete this.channels[t], r;
2380
+ }, e.prototype.disconnect = function() {
2381
+ Lt(this.channels, function(t) {
2382
+ t.disconnect();
2383
+ });
2384
+ }, e;
2385
+ })(), bt = kt;
2386
+ function Ot(e, t) {
2387
+ if (e.indexOf("private-encrypted-") === 0) {
2388
+ if (t.config.nacl)
2389
+ return gt.createEncryptedChannel(e, t, t.config.nacl);
2390
+ var r = "Tried to subscribe to a private-encrypted- channel but no nacl implementation available", o = z.buildLogSuffix("encryptedChannelSupport");
2391
+ throw new nt(r + ". " + o);
2392
+ } else return e.indexOf("private-") === 0 ? gt.createPrivateChannel(e, t) : e.indexOf("presence-") === 0 ? gt.createPresenceChannel(e, t) : gt.createChannel(e, t);
2393
+ }
2394
+ var Pt = {
2395
+ createChannels: function() {
2396
+ return new bt();
2397
+ },
2398
+ createConnectionManager: function(e, t) {
2399
+ return new lt(e, t);
2400
+ },
2401
+ createChannel: function(e, t) {
2402
+ return new d(e, t);
2403
+ },
2404
+ createPrivateChannel: function(e, t) {
2405
+ return new g(e, t);
2406
+ },
2407
+ createPresenceChannel: function(e, t) {
2408
+ return new et(e, t);
2409
+ },
2410
+ createEncryptedChannel: function(e, t, r) {
2411
+ return new yt(e, t, r);
2412
+ },
2413
+ createTimelineSender: function(e, t) {
2414
+ return new R(e, t);
2415
+ },
2416
+ createAuthorizer: function(e, t) {
2417
+ return t.authorizer ? t.authorizer(e, t) : new B(e, t);
2418
+ },
2419
+ createHandshake: function(e, t) {
2420
+ return new Y(e, t);
2421
+ },
2422
+ createAssistantToTheTransportManager: function(e, t, r) {
2423
+ return new k(e, t, r);
2424
+ }
2425
+ }, gt = Pt, Nt = (function() {
2426
+ function e(t) {
2427
+ this.options = t || {}, this.livesLeft = this.options.lives || 1 / 0;
2428
+ }
2429
+ return e.prototype.getAssistant = function(t) {
2430
+ return gt.createAssistantToTheTransportManager(this, t, {
2431
+ minPingDelay: this.options.minPingDelay,
2432
+ maxPingDelay: this.options.maxPingDelay
2433
+ });
2434
+ }, e.prototype.isAlive = function() {
2435
+ return this.livesLeft > 0;
2436
+ }, e.prototype.reportDeath = function() {
2437
+ this.livesLeft -= 1;
2438
+ }, e;
2439
+ })(), It = Nt, Ut = (function() {
2440
+ function e(t, r) {
2441
+ this.strategies = t, this.loop = !!r.loop, this.failFast = !!r.failFast, this.timeout = r.timeout, this.timeoutLimit = r.timeoutLimit;
2442
+ }
2443
+ return e.prototype.isSupported = function() {
2444
+ return Xe(this.strategies, Rt.method("isSupported"));
2445
+ }, e.prototype.connect = function(t, r) {
2446
+ var o = this, s = this.strategies, h = 0, y = this.timeout, O = null, X = function(wt, jt) {
2447
+ jt ? r(null, jt) : (h = h + 1, o.loop && (h = h % s.length), h < s.length ? (y && (y = y * 2, o.timeoutLimit && (y = Math.min(y, o.timeoutLimit))), O = o.tryStrategy(s[h], t, { timeout: y, failFast: o.failFast }, X)) : r(!0));
2448
+ };
2449
+ return O = this.tryStrategy(s[h], t, { timeout: y, failFast: this.failFast }, X), {
2450
+ abort: function() {
2451
+ O.abort();
2452
+ },
2453
+ forceMinPriority: function(wt) {
2454
+ t = wt, O && O.forceMinPriority(wt);
2455
+ }
2456
+ };
2457
+ }, e.prototype.tryStrategy = function(t, r, o, s) {
2458
+ var h = null, y = null;
2459
+ return o.timeout > 0 && (h = new Ft(o.timeout, function() {
2460
+ y.abort(), s(!0);
2461
+ })), y = t.connect(r, function(O, X) {
2462
+ O && h && h.isRunning() && !o.failFast || (h && h.ensureAborted(), s(O, X));
2463
+ }), {
2464
+ abort: function() {
2465
+ h && h.ensureAborted(), y.abort();
2466
+ },
2467
+ forceMinPriority: function(O) {
2468
+ y.forceMinPriority(O);
2469
+ }
2470
+ };
2471
+ }, e;
2472
+ })(), At = Ut, $n = (function() {
2473
+ function e(t) {
2474
+ this.strategies = t;
2475
+ }
2476
+ return e.prototype.isSupported = function() {
2477
+ return Xe(this.strategies, Rt.method("isSupported"));
2478
+ }, e.prototype.connect = function(t, r) {
2479
+ return Yn(this.strategies, t, function(o, s) {
2480
+ return function(h, y) {
2481
+ if (s[o].error = h, h) {
2482
+ Jn(s) && r(!0);
2483
+ return;
2484
+ }
2485
+ Vt(s, function(O) {
2486
+ O.forceMinPriority(y.transport.priority);
2487
+ }), r(null, y);
2488
+ };
2489
+ });
2490
+ }, e;
2491
+ })(), fn = $n;
2492
+ function Yn(e, t, r) {
2493
+ var o = ue(e, function(s, h, y, O) {
2494
+ return s.connect(t, r(h, O));
2495
+ });
2496
+ return {
2497
+ abort: function() {
2498
+ Vt(o, Xn);
2499
+ },
2500
+ forceMinPriority: function(s) {
2501
+ Vt(o, function(h) {
2502
+ h.forceMinPriority(s);
2503
+ });
2504
+ }
2505
+ };
2506
+ }
2507
+ function Jn(e) {
2508
+ return rn(e, function(t) {
2509
+ return !!t.error;
2510
+ });
2511
+ }
2512
+ function Xn(e) {
2513
+ !e.error && !e.aborted && (e.abort(), e.aborted = !0);
2514
+ }
2515
+ var Wn = (function() {
2516
+ function e(t, r, o) {
2517
+ this.strategy = t, this.transports = r, this.ttl = o.ttl || 1800 * 1e3, this.usingTLS = o.useTLS, this.timeline = o.timeline;
2518
+ }
2519
+ return e.prototype.isSupported = function() {
2520
+ return this.strategy.isSupported();
2521
+ }, e.prototype.connect = function(t, r) {
2522
+ var o = this.usingTLS, s = Kn(o), h = [this.strategy];
2523
+ if (s && s.timestamp + this.ttl >= Rt.now()) {
2524
+ var y = this.transports[s.transport];
2525
+ y && (this.timeline.info({
2526
+ cached: !0,
2527
+ transport: s.transport,
2528
+ latency: s.latency
2529
+ }), h.push(new At([y], {
2530
+ timeout: s.latency * 2 + 1e3,
2531
+ failFast: !0
2532
+ })));
2533
+ }
2534
+ var O = Rt.now(), X = h.pop().connect(t, function wt(jt, qt) {
2535
+ jt ? (bn(o), h.length > 0 ? (O = Rt.now(), X = h.pop().connect(t, wt)) : r(jt)) : (Zn(o, qt.transport.name, Rt.now() - O), r(null, qt));
2536
+ });
2537
+ return {
2538
+ abort: function() {
2539
+ X.abort();
2540
+ },
2541
+ forceMinPriority: function(wt) {
2542
+ t = wt, X && X.forceMinPriority(wt);
2543
+ }
2544
+ };
2545
+ }, e;
2546
+ })(), Gn = Wn;
2547
+ function cn(e) {
2548
+ return "pusherTransport" + (e ? "TLS" : "NonTLS");
2549
+ }
2550
+ function Kn(e) {
2551
+ var t = ct.getLocalStorage();
2552
+ if (t)
2553
+ try {
2554
+ var r = t[cn(e)];
2555
+ if (r)
2556
+ return JSON.parse(r);
2557
+ } catch {
2558
+ bn(e);
2559
+ }
2560
+ return null;
2561
+ }
2562
+ function Zn(e, t, r) {
2563
+ var o = ct.getLocalStorage();
2564
+ if (o)
2565
+ try {
2566
+ o[cn(e)] = ne({
2567
+ timestamp: Rt.now(),
2568
+ transport: t,
2569
+ latency: r
2570
+ });
2571
+ } catch {
2572
+ }
2573
+ }
2574
+ function bn(e) {
2575
+ var t = ct.getLocalStorage();
2576
+ if (t)
2577
+ try {
2578
+ delete t[cn(e)];
2579
+ } catch {
2580
+ }
2581
+ }
2582
+ var Vn = (function() {
2583
+ function e(t, r) {
2584
+ var o = r.delay;
2585
+ this.strategy = t, this.options = { delay: o };
2586
+ }
2587
+ return e.prototype.isSupported = function() {
2588
+ return this.strategy.isSupported();
2589
+ }, e.prototype.connect = function(t, r) {
2590
+ var o = this.strategy, s, h = new Ft(this.options.delay, function() {
2591
+ s = o.connect(t, r);
2592
+ });
2593
+ return {
2594
+ abort: function() {
2595
+ h.ensureAborted(), s && s.abort();
2596
+ },
2597
+ forceMinPriority: function(y) {
2598
+ t = y, s && s.forceMinPriority(y);
2599
+ }
2600
+ };
2601
+ }, e;
2602
+ })(), tn = Vn, Qn = (function() {
2603
+ function e(t, r, o) {
2604
+ this.test = t, this.trueBranch = r, this.falseBranch = o;
2605
+ }
2606
+ return e.prototype.isSupported = function() {
2607
+ var t = this.test() ? this.trueBranch : this.falseBranch;
2608
+ return t.isSupported();
2609
+ }, e.prototype.connect = function(t, r) {
2610
+ var o = this.test() ? this.trueBranch : this.falseBranch;
2611
+ return o.connect(t, r);
2612
+ }, e;
2613
+ })(), De = Qn, tr = (function() {
2614
+ function e(t) {
2615
+ this.strategy = t;
2616
+ }
2617
+ return e.prototype.isSupported = function() {
2618
+ return this.strategy.isSupported();
2619
+ }, e.prototype.connect = function(t, r) {
2620
+ var o = this.strategy.connect(t, function(s, h) {
2621
+ h && o.abort(), r(s, h);
2622
+ });
2623
+ return o;
2624
+ }, e;
2625
+ })(), er = tr;
2626
+ function He(e) {
2627
+ return function() {
2628
+ return e.isSupported();
2629
+ };
2630
+ }
2631
+ var nr = function(e, t, r) {
2632
+ var o = {};
2633
+ function s(Rn, Wr, Gr, Kr, Zr) {
2634
+ var In = r(e, Rn, Wr, Gr, Kr, Zr);
2635
+ return o[Rn] = In, In;
2636
+ }
2637
+ var h = Object.assign({}, t, {
2638
+ hostNonTLS: e.wsHost + ":" + e.wsPort,
2639
+ hostTLS: e.wsHost + ":" + e.wssPort,
2640
+ httpPath: e.wsPath
2641
+ }), y = Object.assign({}, h, {
2642
+ useTLS: !0
2643
+ }), O = Object.assign({}, t, {
2644
+ hostNonTLS: e.httpHost + ":" + e.httpPort,
2645
+ hostTLS: e.httpHost + ":" + e.httpsPort,
2646
+ httpPath: e.httpPath
2647
+ }), X = {
2648
+ loop: !0,
2649
+ timeout: 15e3,
2650
+ timeoutLimit: 6e4
2651
+ }, wt = new It({
2652
+ lives: 2,
2653
+ minPingDelay: 1e4,
2654
+ maxPingDelay: e.activityTimeout
2655
+ }), jt = new It({
2656
+ lives: 2,
2657
+ minPingDelay: 1e4,
2658
+ maxPingDelay: e.activityTimeout
2659
+ }), qt = s("ws", "ws", 3, h, wt), te = s("wss", "ws", 3, y, wt), Fr = s("sockjs", "sockjs", 1, O), Pn = s("xhr_streaming", "xhr_streaming", 1, O, jt), $r = s("xdr_streaming", "xdr_streaming", 1, O, jt), An = s("xhr_polling", "xhr_polling", 1, O), Yr = s("xdr_polling", "xdr_polling", 1, O), En = new At([qt], X), Jr = new At([te], X), Xr = new At([Fr], X), kn = new At([
2660
+ new De(He(Pn), Pn, $r)
2661
+ ], X), Ln = new At([
2662
+ new De(He(An), An, Yr)
2663
+ ], X), Nn = new At([
2664
+ new De(He(kn), new fn([
2665
+ kn,
2666
+ new tn(Ln, { delay: 4e3 })
2667
+ ]), Ln)
2668
+ ], X), ln = new De(He(Nn), Nn, Xr), pn;
2669
+ return t.useTLS ? pn = new fn([
2670
+ En,
2671
+ new tn(ln, { delay: 2e3 })
2672
+ ]) : pn = new fn([
2673
+ En,
2674
+ new tn(Jr, { delay: 2e3 }),
2675
+ new tn(ln, { delay: 5e3 })
2676
+ ]), new Gn(new er(new De(He(qt), pn, ln)), o, {
2677
+ ttl: 18e5,
2678
+ timeline: t.timeline,
2679
+ useTLS: t.useTLS
2680
+ });
2681
+ }, rr = nr, ir = (function() {
2682
+ var e = this;
2683
+ e.timeline.info(e.buildTimelineMessage({
2684
+ transport: e.name + (e.options.useTLS ? "s" : "")
2685
+ })), e.hooks.isInitialized() ? e.changeState("initialized") : e.hooks.file ? (e.changeState("initializing"), Z.load(e.hooks.file, { useTLS: e.options.useTLS }, function(t, r) {
2686
+ e.hooks.isInitialized() ? (e.changeState("initialized"), r(!0)) : (t && e.onError(t), e.onClose(), r(!1));
2687
+ })) : e.onClose();
2688
+ }), or = {
2689
+ getRequest: function(e) {
2690
+ var t = new window.XDomainRequest();
2691
+ return t.ontimeout = function() {
2692
+ e.emit("error", new W()), e.close();
2693
+ }, t.onerror = function(r) {
2694
+ e.emit("error", r), e.close();
2695
+ }, t.onprogress = function() {
2696
+ t.responseText && t.responseText.length > 0 && e.onChunk(200, t.responseText);
2697
+ }, t.onload = function() {
2698
+ t.responseText && t.responseText.length > 0 && e.onChunk(200, t.responseText), e.emit("finished", 200), e.close();
2699
+ }, t;
2700
+ },
2701
+ abortRequest: function(e) {
2702
+ e.ontimeout = e.onerror = e.onprogress = e.onload = null, e.abort();
2703
+ }
2704
+ }, sr = or, ar = /* @__PURE__ */ (function() {
2705
+ var e = function(t, r) {
2706
+ return e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(o, s) {
2707
+ o.__proto__ = s;
2708
+ } || function(o, s) {
2709
+ for (var h in s) s.hasOwnProperty(h) && (o[h] = s[h]);
2710
+ }, e(t, r);
2711
+ };
2712
+ return function(t, r) {
2713
+ e(t, r);
2714
+ function o() {
2715
+ this.constructor = t;
2716
+ }
2717
+ t.prototype = r === null ? Object.create(r) : (o.prototype = r.prototype, new o());
2718
+ };
2719
+ })(), fr = 256 * 1024, cr = (function(e) {
2720
+ ar(t, e);
2721
+ function t(r, o, s) {
2722
+ var h = e.call(this) || this;
2723
+ return h.hooks = r, h.method = o, h.url = s, h;
2724
+ }
2725
+ return t.prototype.start = function(r) {
2726
+ var o = this;
2727
+ this.position = 0, this.xhr = this.hooks.getRequest(this), this.unloader = function() {
2728
+ o.close();
2729
+ }, ct.addUnloadListener(this.unloader), this.xhr.open(this.method, this.url, !0), this.xhr.setRequestHeader && this.xhr.setRequestHeader("Content-Type", "application/json"), this.xhr.send(r);
2730
+ }, t.prototype.close = function() {
2731
+ this.unloader && (ct.removeUnloadListener(this.unloader), this.unloader = null), this.xhr && (this.hooks.abortRequest(this.xhr), this.xhr = null);
2732
+ }, t.prototype.onChunk = function(r, o) {
2733
+ for (; ; ) {
2734
+ var s = this.advanceBuffer(o);
2735
+ if (s)
2736
+ this.emit("chunk", { status: r, data: s });
2737
+ else
2738
+ break;
2739
+ }
2740
+ this.isBufferTooLong(o) && this.emit("buffer_too_long");
2741
+ }, t.prototype.advanceBuffer = function(r) {
2742
+ var o = r.slice(this.position), s = o.indexOf(`
2743
+ `);
2744
+ return s !== -1 ? (this.position += s + 1, o.slice(0, s)) : null;
2745
+ }, t.prototype.isBufferTooLong = function(r) {
2746
+ return this.position === r.length && r.length > fr;
2747
+ }, t;
2748
+ })(Qt), ur = cr, un;
2749
+ (function(e) {
2750
+ e[e.CONNECTING = 0] = "CONNECTING", e[e.OPEN = 1] = "OPEN", e[e.CLOSED = 3] = "CLOSED";
2751
+ })(un || (un = {}));
2752
+ var ve = un, hr = 1, lr = (function() {
2753
+ function e(t, r) {
2754
+ this.hooks = t, this.session = wn(1e3) + "/" + vr(8), this.location = pr(r), this.readyState = ve.CONNECTING, this.openStream();
2755
+ }
2756
+ return e.prototype.send = function(t) {
2757
+ return this.sendRaw(JSON.stringify([t]));
2758
+ }, e.prototype.ping = function() {
2759
+ this.hooks.sendHeartbeat(this);
2760
+ }, e.prototype.close = function(t, r) {
2761
+ this.onClose(t, r, !0);
2762
+ }, e.prototype.sendRaw = function(t) {
2763
+ if (this.readyState === ve.OPEN)
2764
+ try {
2765
+ return ct.createSocketRequest("POST", mn(dr(this.location, this.session))).start(t), !0;
2766
+ } catch {
2767
+ return !1;
2768
+ }
2769
+ else
2770
+ return !1;
2771
+ }, e.prototype.reconnect = function() {
2772
+ this.closeStream(), this.openStream();
2773
+ }, e.prototype.onClose = function(t, r, o) {
2774
+ this.closeStream(), this.readyState = ve.CLOSED, this.onclose && this.onclose({
2775
+ code: t,
2776
+ reason: r,
2777
+ wasClean: o
2778
+ });
2779
+ }, e.prototype.onChunk = function(t) {
2780
+ if (t.status === 200) {
2781
+ this.readyState === ve.OPEN && this.onActivity();
2782
+ var r, o = t.data.slice(0, 1);
2783
+ switch (o) {
2784
+ case "o":
2785
+ r = JSON.parse(t.data.slice(1) || "{}"), this.onOpen(r);
2786
+ break;
2787
+ case "a":
2788
+ r = JSON.parse(t.data.slice(1) || "[]");
2789
+ for (var s = 0; s < r.length; s++)
2790
+ this.onEvent(r[s]);
2791
+ break;
2792
+ case "m":
2793
+ r = JSON.parse(t.data.slice(1) || "null"), this.onEvent(r);
2794
+ break;
2795
+ case "h":
2796
+ this.hooks.onHeartbeat(this);
2797
+ break;
2798
+ case "c":
2799
+ r = JSON.parse(t.data.slice(1) || "[]"), this.onClose(r[0], r[1], !0);
2800
+ break;
2801
+ }
2802
+ }
2803
+ }, e.prototype.onOpen = function(t) {
2804
+ this.readyState === ve.CONNECTING ? (t && t.hostname && (this.location.base = xr(this.location.base, t.hostname)), this.readyState = ve.OPEN, this.onopen && this.onopen()) : this.onClose(1006, "Server lost session", !0);
2805
+ }, e.prototype.onEvent = function(t) {
2806
+ this.readyState === ve.OPEN && this.onmessage && this.onmessage({ data: t });
2807
+ }, e.prototype.onActivity = function() {
2808
+ this.onactivity && this.onactivity();
2809
+ }, e.prototype.onError = function(t) {
2810
+ this.onerror && this.onerror(t);
2811
+ }, e.prototype.openStream = function() {
2812
+ var t = this;
2813
+ this.stream = ct.createSocketRequest("POST", mn(this.hooks.getReceiveURL(this.location, this.session))), this.stream.bind("chunk", function(r) {
2814
+ t.onChunk(r);
2815
+ }), this.stream.bind("finished", function(r) {
2816
+ t.hooks.onFinished(t, r);
2817
+ }), this.stream.bind("buffer_too_long", function() {
2818
+ t.reconnect();
2819
+ });
2820
+ try {
2821
+ this.stream.start();
2822
+ } catch (r) {
2823
+ Rt.defer(function() {
2824
+ t.onError(r), t.onClose(1006, "Could not start streaming", !1);
2825
+ });
2826
+ }
2827
+ }, e.prototype.closeStream = function() {
2828
+ this.stream && (this.stream.unbind_all(), this.stream.close(), this.stream = null);
2829
+ }, e;
2830
+ })();
2831
+ function pr(e) {
2832
+ var t = /([^\?]*)\/*(\??.*)/.exec(e);
2833
+ return {
2834
+ base: t[1],
2835
+ queryString: t[2]
2836
+ };
2837
+ }
2838
+ function dr(e, t) {
2839
+ return e.base + "/" + t + "/xhr_send";
2840
+ }
2841
+ function mn(e) {
2842
+ var t = e.indexOf("?") === -1 ? "?" : "&";
2843
+ return e + t + "t=" + +/* @__PURE__ */ new Date() + "&n=" + hr++;
2844
+ }
2845
+ function xr(e, t) {
2846
+ var r = /(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(e);
2847
+ return r[1] + t + r[3];
2848
+ }
2849
+ function wn(e) {
2850
+ return Math.floor(Math.random() * e);
2851
+ }
2852
+ function vr(e) {
2853
+ for (var t = [], r = 0; r < e; r++)
2854
+ t.push(wn(32).toString(32));
2855
+ return t.join("");
2856
+ }
2857
+ var yr = lr, gr = {
2858
+ getReceiveURL: function(e, t) {
2859
+ return e.base + "/" + t + "/xhr_streaming" + e.queryString;
2860
+ },
2861
+ onHeartbeat: function(e) {
2862
+ e.sendRaw("[]");
2863
+ },
2864
+ sendHeartbeat: function(e) {
2865
+ e.sendRaw("[]");
2866
+ },
2867
+ onFinished: function(e, t) {
2868
+ e.onClose(1006, "Connection interrupted (" + t + ")", !1);
2869
+ }
2870
+ }, _r = gr, br = {
2871
+ getReceiveURL: function(e, t) {
2872
+ return e.base + "/" + t + "/xhr" + e.queryString;
2873
+ },
2874
+ onHeartbeat: function() {
2875
+ },
2876
+ sendHeartbeat: function(e) {
2877
+ e.sendRaw("[]");
2878
+ },
2879
+ onFinished: function(e, t) {
2880
+ t === 200 ? e.reconnect() : e.onClose(1006, "Connection interrupted (" + t + ")", !1);
2881
+ }
2882
+ }, mr = br, wr = {
2883
+ getRequest: function(e) {
2884
+ var t = ct.getXHRAPI(), r = new t();
2885
+ return r.onreadystatechange = r.onprogress = function() {
2886
+ switch (r.readyState) {
2887
+ case 3:
2888
+ r.responseText && r.responseText.length > 0 && e.onChunk(r.status, r.responseText);
2889
+ break;
2890
+ case 4:
2891
+ r.responseText && r.responseText.length > 0 && e.onChunk(r.status, r.responseText), e.emit("finished", r.status), e.close();
2892
+ break;
2893
+ }
2894
+ }, r;
2895
+ },
2896
+ abortRequest: function(e) {
2897
+ e.onreadystatechange = null, e.abort();
2898
+ }
2899
+ }, Sr = wr, Tr = {
2900
+ createStreamingSocket: function(e) {
2901
+ return this.createSocket(_r, e);
2902
+ },
2903
+ createPollingSocket: function(e) {
2904
+ return this.createSocket(mr, e);
2905
+ },
2906
+ createSocket: function(e, t) {
2907
+ return new yr(e, t);
2908
+ },
2909
+ createXHR: function(e, t) {
2910
+ return this.createRequest(Sr, e, t);
2911
+ },
2912
+ createRequest: function(e, t, r) {
2913
+ return new ur(e, t, r);
2914
+ }
2915
+ }, Sn = Tr;
2916
+ Sn.createXDR = function(e, t) {
2917
+ return this.createRequest(sr, e, t);
2918
+ };
2919
+ var Cr = Sn, Or = {
2920
+ nextAuthCallbackID: 1,
2921
+ auth_callbacks: {},
2922
+ ScriptReceivers: v,
2923
+ DependenciesReceivers: st,
2924
+ getDefaultStrategy: rr,
2925
+ Transports: _,
2926
+ transportConnectionInitializer: ir,
2927
+ HTTPFactory: Cr,
2928
+ TimelineTransport: je,
2929
+ getXHRAPI: function() {
2930
+ return window.XMLHttpRequest;
2931
+ },
2932
+ getWebSocketAPI: function() {
2933
+ return window.WebSocket || window.MozWebSocket;
2934
+ },
2935
+ setup: function(e) {
2936
+ var t = this;
2937
+ window.Pusher = e;
2938
+ var r = function() {
2939
+ t.onDocumentBody(e.ready);
2940
+ };
2941
+ window.JSON ? r() : Z.load("json2", {}, r);
2942
+ },
2943
+ getDocument: function() {
2944
+ return document;
2945
+ },
2946
+ getProtocol: function() {
2947
+ return this.getDocument().location.protocol;
2948
+ },
2949
+ getAuthorizers: function() {
2950
+ return { ajax: Bt, jsonp: _e };
2951
+ },
2952
+ onDocumentBody: function(e) {
2953
+ var t = this;
2954
+ document.body ? e() : setTimeout(function() {
2955
+ t.onDocumentBody(e);
2956
+ }, 0);
2957
+ },
2958
+ createJSONPRequest: function(e, t) {
2959
+ return new Ie(e, t);
2960
+ },
2961
+ createScriptRequest: function(e) {
2962
+ return new be(e);
2963
+ },
2964
+ getLocalStorage: function() {
2965
+ try {
2966
+ return window.localStorage;
2967
+ } catch {
2968
+ return;
2969
+ }
2970
+ },
2971
+ createXHR: function() {
2972
+ return this.getXHRAPI() ? this.createXMLHttpRequest() : this.createMicrosoftXHR();
2973
+ },
2974
+ createXMLHttpRequest: function() {
2975
+ var e = this.getXHRAPI();
2976
+ return new e();
2977
+ },
2978
+ createMicrosoftXHR: function() {
2979
+ return new ActiveXObject("Microsoft.XMLHTTP");
2980
+ },
2981
+ getNetwork: function() {
2982
+ return A;
2983
+ },
2984
+ createWebSocket: function(e) {
2985
+ var t = this.getWebSocketAPI();
2986
+ return new t(e);
2987
+ },
2988
+ createSocketRequest: function(e, t) {
2989
+ if (this.isXHRSupported())
2990
+ return this.HTTPFactory.createXHR(e, t);
2991
+ if (this.isXDRSupported(t.indexOf("https:") === 0))
2992
+ return this.HTTPFactory.createXDR(e, t);
2993
+ throw "Cross-origin HTTP requests are not supported";
2994
+ },
2995
+ isXHRSupported: function() {
2996
+ var e = this.getXHRAPI();
2997
+ return !!e && new e().withCredentials !== void 0;
2998
+ },
2999
+ isXDRSupported: function(e) {
3000
+ var t = e ? "https:" : "http:", r = this.getProtocol();
3001
+ return !!window.XDomainRequest && r === t;
3002
+ },
3003
+ addUnloadListener: function(e) {
3004
+ window.addEventListener !== void 0 ? window.addEventListener("unload", e, !1) : window.attachEvent !== void 0 && window.attachEvent("onunload", e);
3005
+ },
3006
+ removeUnloadListener: function(e) {
3007
+ window.addEventListener !== void 0 ? window.removeEventListener("unload", e, !1) : window.detachEvent !== void 0 && window.detachEvent("onunload", e);
3008
+ }
3009
+ }, ct = Or, hn;
3010
+ (function(e) {
3011
+ e[e.ERROR = 3] = "ERROR", e[e.INFO = 6] = "INFO", e[e.DEBUG = 7] = "DEBUG";
3012
+ })(hn || (hn = {}));
3013
+ var en = hn, Pr = (function() {
3014
+ function e(t, r, o) {
3015
+ this.key = t, this.session = r, this.events = [], this.options = o || {}, this.sent = 0, this.uniqueID = 0;
3016
+ }
3017
+ return e.prototype.log = function(t, r) {
3018
+ t <= this.options.level && (this.events.push(Tt({}, r, { timestamp: Rt.now() })), this.options.limit && this.events.length > this.options.limit && this.events.shift());
3019
+ }, e.prototype.error = function(t) {
3020
+ this.log(en.ERROR, t);
3021
+ }, e.prototype.info = function(t) {
3022
+ this.log(en.INFO, t);
3023
+ }, e.prototype.debug = function(t) {
3024
+ this.log(en.DEBUG, t);
3025
+ }, e.prototype.isEmpty = function() {
3026
+ return this.events.length === 0;
3027
+ }, e.prototype.send = function(t, r) {
3028
+ var o = this, s = Tt({
3029
+ session: this.session,
3030
+ bundle: this.sent + 1,
3031
+ key: this.key,
3032
+ lib: "js",
3033
+ version: this.options.version,
3034
+ cluster: this.options.cluster,
3035
+ features: this.options.features,
3036
+ timeline: this.events
3037
+ }, this.options.params);
3038
+ return this.events = [], t(s, function(h, y) {
3039
+ h || o.sent++, r && r(h, y);
3040
+ }), !0;
3041
+ }, e.prototype.generateUniqueID = function() {
3042
+ return this.uniqueID++, this.uniqueID;
3043
+ }, e;
3044
+ })(), Ar = Pr, Er = (function() {
3045
+ function e(t, r, o, s) {
3046
+ this.name = t, this.priority = r, this.transport = o, this.options = s || {};
3047
+ }
3048
+ return e.prototype.isSupported = function() {
3049
+ return this.transport.isSupported({
3050
+ useTLS: this.options.useTLS
3051
+ });
3052
+ }, e.prototype.connect = function(t, r) {
3053
+ var o = this;
3054
+ if (this.isSupported()) {
3055
+ if (this.priority < t)
3056
+ return Tn(new M(), r);
3057
+ } else return Tn(new Kt(), r);
3058
+ var s = !1, h = this.transport.createConnection(this.name, this.priority, this.options.key, this.options), y = null, O = function() {
3059
+ h.unbind("initialized", O), h.connect();
3060
+ }, X = function() {
3061
+ y = gt.createHandshake(h, function(te) {
3062
+ s = !0, qt(), r(null, te);
3063
+ });
3064
+ }, wt = function(te) {
3065
+ qt(), r(te);
3066
+ }, jt = function() {
3067
+ qt();
3068
+ var te;
3069
+ te = ne(h), r(new mt(te));
3070
+ }, qt = function() {
3071
+ h.unbind("initialized", O), h.unbind("open", X), h.unbind("error", wt), h.unbind("closed", jt);
3072
+ };
3073
+ return h.bind("initialized", O), h.bind("open", X), h.bind("error", wt), h.bind("closed", jt), h.initialize(), {
3074
+ abort: function() {
3075
+ s || (qt(), y ? y.close() : h.close());
3076
+ },
3077
+ forceMinPriority: function(te) {
3078
+ s || o.priority < te && (y ? y.close() : h.close());
3079
+ }
3080
+ };
3081
+ }, e;
3082
+ })(), kr = Er;
3083
+ function Tn(e, t) {
3084
+ return Rt.defer(function() {
3085
+ t(e);
3086
+ }), {
3087
+ abort: function() {
3088
+ },
3089
+ forceMinPriority: function() {
3090
+ }
3091
+ };
3092
+ }
3093
+ var Lr = ct.Transports, Nr = function(e, t, r, o, s, h) {
3094
+ var y = Lr[r];
3095
+ if (!y)
3096
+ throw new $t(r);
3097
+ var O = (!e.enabledTransports || ft(e.enabledTransports, t) !== -1) && (!e.disabledTransports || ft(e.disabledTransports, t) === -1), X;
3098
+ return O ? (s = Object.assign({ ignoreNullOrigin: e.ignoreNullOrigin }, s), X = new kr(t, o, h ? h.getAssistant(y) : y, s)) : X = Rr, X;
3099
+ }, Rr = {
3100
+ isSupported: function() {
3101
+ return !1;
3102
+ },
3103
+ connect: function(e, t) {
3104
+ var r = Rt.defer(function() {
3105
+ t(new Kt());
3106
+ });
3107
+ return {
3108
+ abort: function() {
3109
+ r.ensureAborted();
3110
+ },
3111
+ forceMinPriority: function() {
3112
+ }
3113
+ };
3114
+ }
3115
+ };
3116
+ function Ir(e) {
3117
+ var t = {
3118
+ activityTimeout: e.activityTimeout || ot.activityTimeout,
3119
+ authEndpoint: e.authEndpoint || ot.authEndpoint,
3120
+ authTransport: e.authTransport || ot.authTransport,
3121
+ cluster: e.cluster || ot.cluster,
3122
+ httpPath: e.httpPath || ot.httpPath,
3123
+ httpPort: e.httpPort || ot.httpPort,
3124
+ httpsPort: e.httpsPort || ot.httpsPort,
3125
+ pongTimeout: e.pongTimeout || ot.pongTimeout,
3126
+ statsHost: e.statsHost || ot.stats_host,
3127
+ unavailableTimeout: e.unavailableTimeout || ot.unavailableTimeout,
3128
+ wsPath: e.wsPath || ot.wsPath,
3129
+ wsPort: e.wsPort || ot.wsPort,
3130
+ wssPort: e.wssPort || ot.wssPort,
3131
+ enableStats: Br(e),
3132
+ httpHost: jr(e),
3133
+ useTLS: Mr(e),
3134
+ wsHost: Ur(e)
3135
+ };
3136
+ return "auth" in e && (t.auth = e.auth), "authorizer" in e && (t.authorizer = e.authorizer), "disabledTransports" in e && (t.disabledTransports = e.disabledTransports), "enabledTransports" in e && (t.enabledTransports = e.enabledTransports), "ignoreNullOrigin" in e && (t.ignoreNullOrigin = e.ignoreNullOrigin), "timelineParams" in e && (t.timelineParams = e.timelineParams), "nacl" in e && (t.nacl = e.nacl), t;
3137
+ }
3138
+ function jr(e) {
3139
+ return e.httpHost ? e.httpHost : e.cluster ? "sockjs-" + e.cluster + ".pusher.com" : ot.httpHost;
3140
+ }
3141
+ function Ur(e) {
3142
+ return e.wsHost ? e.wsHost : e.cluster ? Cn(e.cluster) : Cn(ot.cluster);
3143
+ }
3144
+ function Cn(e) {
3145
+ return "ws-" + e + ".pusher.com";
3146
+ }
3147
+ function Mr(e) {
3148
+ return ct.getProtocol() === "https:" ? !0 : e.forceTLS !== !1;
3149
+ }
3150
+ function Br(e) {
3151
+ return "enableStats" in e ? e.enableStats : "disableStats" in e ? !e.disableStats : !1;
3152
+ }
3153
+ var On = (function() {
3154
+ function e(t, r) {
3155
+ var o = this;
3156
+ if (Dr(t), r = r || {}, !r.cluster && !(r.wsHost || r.httpHost)) {
3157
+ var s = z.buildLogSuffix("javascriptQuickStart");
3158
+ Et.warn("You should always specify a cluster when connecting. " + s);
3159
+ }
3160
+ "disableStats" in r && Et.warn("The disableStats option is deprecated in favor of enableStats"), this.key = t, this.config = Ir(r), this.channels = gt.createChannels(), this.global_emitter = new Qt(), this.sessionID = Math.floor(Math.random() * 1e9), this.timeline = new Ar(this.key, this.sessionID, {
3161
+ cluster: this.config.cluster,
3162
+ features: e.getClientFeatures(),
3163
+ params: this.config.timelineParams || {},
3164
+ limit: 50,
3165
+ level: en.INFO,
3166
+ version: ot.VERSION
3167
+ }), this.config.enableStats && (this.timelineSender = gt.createTimelineSender(this.timeline, {
3168
+ host: this.config.statsHost,
3169
+ path: "/timeline/v2/" + ct.TimelineTransport.name
3170
+ }));
3171
+ var h = function(y) {
3172
+ return ct.getDefaultStrategy(o.config, y, Nr);
3173
+ };
3174
+ this.connection = gt.createConnectionManager(this.key, {
3175
+ getStrategy: h,
3176
+ timeline: this.timeline,
3177
+ activityTimeout: this.config.activityTimeout,
3178
+ pongTimeout: this.config.pongTimeout,
3179
+ unavailableTimeout: this.config.unavailableTimeout,
3180
+ useTLS: !!this.config.useTLS
3181
+ }), this.connection.bind("connected", function() {
3182
+ o.subscribeAll(), o.timelineSender && o.timelineSender.send(o.connection.isUsingTLS());
3183
+ }), this.connection.bind("message", function(y) {
3184
+ var O = y.event, X = O.indexOf("pusher_internal:") === 0;
3185
+ if (y.channel) {
3186
+ var wt = o.channel(y.channel);
3187
+ wt && wt.handleEvent(y);
3188
+ }
3189
+ X || o.global_emitter.emit(y.event, y.data);
3190
+ }), this.connection.bind("connecting", function() {
3191
+ o.channels.disconnect();
3192
+ }), this.connection.bind("disconnected", function() {
3193
+ o.channels.disconnect();
3194
+ }), this.connection.bind("error", function(y) {
3195
+ Et.warn(y);
3196
+ }), e.instances.push(this), this.timeline.info({ instances: e.instances.length }), e.isReady && this.connect();
3197
+ }
3198
+ return e.ready = function() {
3199
+ e.isReady = !0;
3200
+ for (var t = 0, r = e.instances.length; t < r; t++)
3201
+ e.instances[t].connect();
3202
+ }, e.getClientFeatures = function() {
3203
+ return Ee(ke({ ws: ct.Transports.ws }, function(t) {
3204
+ return t.isSupported({});
3205
+ }));
3206
+ }, e.prototype.channel = function(t) {
3207
+ return this.channels.find(t);
3208
+ }, e.prototype.allChannels = function() {
3209
+ return this.channels.all();
3210
+ }, e.prototype.connect = function() {
3211
+ if (this.connection.connect(), this.timelineSender && !this.timelineSenderTimer) {
3212
+ var t = this.connection.isUsingTLS(), r = this.timelineSender;
3213
+ this.timelineSenderTimer = new Fe(6e4, function() {
3214
+ r.send(t);
3215
+ });
3216
+ }
3217
+ }, e.prototype.disconnect = function() {
3218
+ this.connection.disconnect(), this.timelineSenderTimer && (this.timelineSenderTimer.ensureAborted(), this.timelineSenderTimer = null);
3219
+ }, e.prototype.bind = function(t, r, o) {
3220
+ return this.global_emitter.bind(t, r, o), this;
3221
+ }, e.prototype.unbind = function(t, r, o) {
3222
+ return this.global_emitter.unbind(t, r, o), this;
3223
+ }, e.prototype.bind_global = function(t) {
3224
+ return this.global_emitter.bind_global(t), this;
3225
+ }, e.prototype.unbind_global = function(t) {
3226
+ return this.global_emitter.unbind_global(t), this;
3227
+ }, e.prototype.unbind_all = function(t) {
3228
+ return this.global_emitter.unbind_all(), this;
3229
+ }, e.prototype.subscribeAll = function() {
3230
+ var t;
3231
+ for (t in this.channels.channels)
3232
+ this.channels.channels.hasOwnProperty(t) && this.subscribe(t);
3233
+ }, e.prototype.subscribe = function(t) {
3234
+ var r = this.channels.add(t, this);
3235
+ return r.subscriptionPending && r.subscriptionCancelled ? r.reinstateSubscription() : !r.subscriptionPending && this.connection.state === "connected" && r.subscribe(), r;
3236
+ }, e.prototype.unsubscribe = function(t) {
3237
+ var r = this.channels.find(t);
3238
+ r && r.subscriptionPending ? r.cancelSubscription() : (r = this.channels.remove(t), r && r.subscribed && r.unsubscribe());
3239
+ }, e.prototype.send_event = function(t, r, o) {
3240
+ return this.connection.send_event(t, r, o);
3241
+ }, e.prototype.shouldUseTLS = function() {
3242
+ return this.config.useTLS;
3243
+ }, e.instances = [], e.isReady = !1, e.logToConsole = !1, e.Runtime = ct, e.ScriptReceivers = ct.ScriptReceivers, e.DependenciesReceivers = ct.DependenciesReceivers, e.auth_callbacks = ct.auth_callbacks, e;
3244
+ })(), Se = On;
3245
+ function Dr(e) {
3246
+ if (e == null)
3247
+ throw "You must pass your app key when you instantiate Pusher.";
3248
+ }
3249
+ ct.setup(On);
3250
+ var Hr = ut(2), zr = /* @__PURE__ */ (function() {
3251
+ var e = function(t, r) {
3252
+ return e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(o, s) {
3253
+ o.__proto__ = s;
3254
+ } || function(o, s) {
3255
+ for (var h in s) s.hasOwnProperty(h) && (o[h] = s[h]);
3256
+ }, e(t, r);
3257
+ };
3258
+ return function(t, r) {
3259
+ e(t, r);
3260
+ function o() {
3261
+ this.constructor = t;
3262
+ }
3263
+ t.prototype = r === null ? Object.create(r) : (o.prototype = r.prototype, new o());
3264
+ };
3265
+ })(), qr = (function(e) {
3266
+ zr(t, e);
3267
+ function t(r, o) {
3268
+ var s = this;
3269
+ return Se.logToConsole = t.logToConsole, Se.log = t.log, o = o || {}, o.nacl = Hr, s = e.call(this, r, o) || this, s;
3270
+ }
3271
+ return t;
3272
+ })(Se);
3273
+ G.default = qr;
3274
+ })
3275
+ /******/
3276
+ ])
3277
+ );
3278
+ });
3279
+ })(vn)), vn.exports;
3280
+ }
3281
+ var yn, qn;
3282
+ function bi() {
3283
+ return qn || (qn = 1, yn = _i()), yn;
3284
+ }
3285
+ var mi = bi();
3286
+ const wi = /* @__PURE__ */ gi(mi), _n = `${ii}/api/notification`, Si = (dt) => gn.get(_n, { params: { ...dt } }), Ti = (dt) => gn.put(`${_n}/${dt}`), Ci = () => gn.put(`${_n}/updateAllStatus`), Oi = {
3287
+ currentPage: 1,
3288
+ pageSize: 30,
3289
+ searchString: "",
3290
+ isRead: !1
3291
+ }, Pi = "Notification list", Fn = "NOTIFICATION_CHANNEL", Ai = "NEW_NOTIFICATION", Ei = () => {
3292
+ const dt = hi(), { roles: Xt } = li(), Ct = Te((M) => M.common.user), G = Ct?.id, ut = Ct?.studentId, S = Te(
3293
+ (M) => M.notification.notificationList
3294
+ ), v = Te((M) => M.common.user?.pusherKey), St = Te(
3295
+ (M) => M.common.user?.pusherCluster
3296
+ ), ot = Te(
3297
+ (M) => M.notification.totalItems
3298
+ ), Ht = Te(
3299
+ (M) => M.notification.unReadNotification
3300
+ ), [I, st] = Dn(Oi), [Z, F] = Dn(!1), _t = (M) => st({
3301
+ ...I,
3302
+ ...M
3303
+ }), z = (M) => {
3304
+ const { source: mt, extraData: nt } = M;
3305
+ switch (mt) {
3306
+ case "AssessmentAssignment":
3307
+ window.open(`/player/diagnosticsurvey/${Number(nt)}`);
3308
+ break;
3309
+ case "NewConferenceCreated":
3310
+ window.open(
3311
+ `/start-conference/${JSON.parse(nt)?.[0]}/${JSON.parse(nt)?.[1]}/conferenceRubric`
3312
+ );
3313
+ break;
3314
+ case "Class Reflection":
3315
+ window.open(
3316
+ `/start-reflection/${nt?.replace(/[\[\]]/g, "")?.split(",")?.[1]}`
3317
+ );
3318
+ break;
3319
+ case "Class Reflection Completed":
3320
+ window.open(
3321
+ `/result-reflection/${nt?.replace(/[\[\]]/g, "")?.split(",")?.[1]}`
3322
+ );
3323
+ break;
3324
+ case "External Reflection Completed":
3325
+ window.open(
3326
+ `/result-reflection/${JSON.parse(nt)?.[0]}/external`
3327
+ );
3328
+ break;
3329
+ case "NewSessionCreated":
3330
+ window.open(
3331
+ `/start-question/${JSON.parse(nt)?.[0]}/${JSON.parse(nt)?.[1]}`
3332
+ );
3333
+ break;
3334
+ case "NewSessionComplete":
3335
+ window.open(
3336
+ `/start-question/${JSON.parse(nt)?.[0]}/${JSON.parse(nt)?.[1]}`
3337
+ );
3338
+ break;
3339
+ case "ActionPointReminder":
3340
+ window.open(
3341
+ "/action-point/to-do"
3342
+ );
3343
+ break;
3344
+ case "SendNotiPLP":
3345
+ window.open(
3346
+ "/personal-learning-plan"
3347
+ );
3348
+ break;
3349
+ case "SendNotiGOAL":
3350
+ window.open(
3351
+ `/my-goals/${JSON.parse(nt)}`
3352
+ );
3353
+ break;
3354
+ case "CertificateApproved":
3355
+ window.open("/dashboard/certification/2");
3356
+ break;
3357
+ case "RequestCheckIn":
3358
+ window.open(
3359
+ `/start-question/${JSON.parse(nt)?.[0]}/${JSON.parse(nt)?.[1]}`
3360
+ );
3361
+ case "NewSurveyCreated":
3362
+ ut && window.open(
3363
+ `/start-survey/${JSON.parse(nt)?.[0]}/${ut}`
3364
+ );
3365
+ break;
3366
+ case "StudentCompletedSurvey":
3367
+ window.open(
3368
+ `/start-survey/${JSON.parse(nt)?.[0]}/${JSON.parse(nt)?.[1]}`
3369
+ );
3370
+ break;
3371
+ }
3372
+ }, T = xn(async () => {
3373
+ dt(Mn(!0));
3374
+ try {
3375
+ const M = await Si({ ...I, roles: Xt?.trim() ? [Xt] : Ct?.roles }), { items: mt, totalItems: nt } = M.data;
3376
+ dt(
3377
+ oi({
3378
+ notificationList: mt,
3379
+ totalItems: nt
3380
+ })
3381
+ );
3382
+ } catch (M) {
3383
+ dt(
3384
+ dn({
3385
+ type: "danger",
3386
+ message: M.response?.data?.title || M.message
3387
+ })
3388
+ );
3389
+ }
3390
+ dt(Mn(!1));
3391
+ }, [I]);
3392
+ Hn(() => {
3393
+ document.title = Pi;
3394
+ }, []), Hn(() => {
3395
+ T();
3396
+ let M;
3397
+ if (v && St && G)
3398
+ try {
3399
+ M = new wi(v, { cluster: St }), M.subscribe(`${Fn}-${G}`).bind(Ai, T);
3400
+ } catch (mt) {
3401
+ console.error("Failed to initialize Pusher:", mt);
3402
+ }
3403
+ return () => {
3404
+ if (M && G)
3405
+ try {
3406
+ M.unsubscribe(`${Fn}-${G}`), M.disconnect();
3407
+ } catch (mt) {
3408
+ console.error("Failed to disconnect Pusher:", mt);
3409
+ }
3410
+ };
3411
+ }, [T, G, v, St]);
3412
+ const L = xn(
3413
+ (M, mt) => {
3414
+ try {
3415
+ dt(
3416
+ Bn({
3417
+ isOpen: !0,
3418
+ type: "warning",
3419
+ message: `Do you want to mark this notification ${mt ? "read" : "unread"}?`,
3420
+ onConfirm: async () => {
3421
+ await Ti(M), T();
3422
+ }
3423
+ })
3424
+ );
3425
+ } catch (nt) {
3426
+ dt(
3427
+ dn({
3428
+ type: "danger",
3429
+ message: nt.response?.data?.title || nt.message
3430
+ })
3431
+ );
3432
+ }
3433
+ },
3434
+ [S, Ht]
3435
+ ), W = xn(async () => {
3436
+ try {
3437
+ if (S.length === 0) throw new Error("There are no unread messages");
3438
+ dt(
3439
+ Bn({
3440
+ isOpen: !0,
3441
+ type: "warning",
3442
+ message: "Do you want to mark all notification ?",
3443
+ onConfirm: async () => {
3444
+ F(!0), await Ci(), T(), F(!1);
3445
+ }
3446
+ })
3447
+ );
3448
+ } catch (M) {
3449
+ dt(
3450
+ dn({
3451
+ type: "danger",
3452
+ message: M.response?.data?.title || M.message
3453
+ })
3454
+ );
3455
+ }
3456
+ }, [S]);
3457
+ return {
3458
+ notificationList: S,
3459
+ totalItems: ot,
3460
+ unReadNotification: Ht,
3461
+ filters: I,
3462
+ changeFilters: _t,
3463
+ updateNotification: L,
3464
+ viewNotification: z,
3465
+ updateAll: W,
3466
+ toggleUpdateAllStatus: Z
3467
+ };
3468
+ }, ki = "_container_1bf04_1", Li = "_header_1bf04_7", Ni = "_markAllBtn_1bf04_14", Ri = "_markAllText_1bf04_21", Ii = "_markAllCheckbox_1bf04_27", ji = "_filterContainer_1bf04_35", Ui = "_filterLabel_1bf04_40", Mi = "_tableWrapper_1bf04_52", Bi = "_tableHead_1bf04_60", Di = "_thText_1bf04_69", Hi = "_td_1bf04_73", zi = "_rowText_1bf04_77", qi = "_rowTime_1bf04_82", Fi = "_checkboxInput_1bf04_87", $i = "_actionBtn_1bf04_95", Yi = "_iconContainer_1bf04_104", Ji = "_iconGreen_1bf04_114", Xi = "_iconOrange_1bf04_118", Wi = "_iconRed_1bf04_122", Gi = "_iconYellow_1bf04_126", Ki = "_flagIcon_1bf04_140", Zi = "_flagIconRed_1bf04_145", Vi = "_flagIconYellow_1bf04_149", Qi = "_tooltipContainer_1bf04_153", to = "_tooltipText_1bf04_157", eo = "_whiteTooltip_1bf04_163", no = "_redText_1bf04_173", at = {
3469
+ container: ki,
3470
+ header: Li,
3471
+ markAllBtn: Ni,
3472
+ markAllText: Ri,
3473
+ markAllCheckbox: Ii,
3474
+ filterContainer: ji,
3475
+ filterLabel: Ui,
3476
+ tableWrapper: Mi,
3477
+ tableHead: Bi,
3478
+ thText: Di,
3479
+ td: Hi,
3480
+ rowText: zi,
3481
+ rowTime: qi,
3482
+ checkboxInput: Fi,
3483
+ actionBtn: $i,
3484
+ iconContainer: Yi,
3485
+ iconGreen: Ji,
3486
+ iconOrange: Xi,
3487
+ iconRed: Wi,
3488
+ iconYellow: Gi,
3489
+ "explain-icon": "_explain-icon_1bf04_134",
3490
+ flagIcon: Ki,
3491
+ flagIconRed: Zi,
3492
+ flagIconYellow: Vi,
3493
+ tooltipContainer: Qi,
3494
+ tooltipText: to,
3495
+ whiteTooltip: eo,
3496
+ redText: no
3497
+ }, ro = "Notifications", io = "/images/info-icon.png", oo = (dt) => {
3498
+ const Xt = (dt.text || "").toLowerCase(), Ct = dt.informaions?.[0]?.toLowerCase();
3499
+ return Xt.includes("red flag") || Ct?.includes("red") ? /* @__PURE__ */ pt("div", { className: `${at.iconContainer} ${at.iconRed}`, children: /* @__PURE__ */ pt(
3500
+ "img",
3501
+ {
3502
+ src: "/images/flag-icon.svg",
3503
+ alt: "Red flag",
3504
+ className: `${at.flagIcon} ${at.flagIconRed}`
3505
+ }
3506
+ ) }) : Xt.includes("yellow flag") || Ct?.includes("yellow") ? /* @__PURE__ */ pt("div", { className: `${at.iconContainer} ${at.iconYellow}`, children: /* @__PURE__ */ pt(
3507
+ "img",
3508
+ {
3509
+ src: "/images/flag-icon.svg",
3510
+ alt: "Yellow flag",
3511
+ className: `${at.flagIcon} ${at.flagIconYellow}`
3512
+ }
3513
+ ) }) : Xt.includes("completed a check-in") || Xt.includes("completed a survey") || dt.source === "NewSessionComplete" || dt.source === "Class Reflection Completed" || dt.source === "External Reflection Completed" ? /* @__PURE__ */ pt("div", { className: `${at.iconContainer} ${at.iconGreen}`, children: /* @__PURE__ */ pt(ci, { color: "white", size: 18 }) }) : /* @__PURE__ */ pt("div", { className: `${at.iconContainer} ${at.iconOrange}`, children: /* @__PURE__ */ pt(di, { color: "white", size: 18 }) });
3514
+ }, po = () => {
3515
+ const {
3516
+ notificationList: dt,
3517
+ totalItems: Xt,
3518
+ filters: Ct,
3519
+ changeFilters: G,
3520
+ updateNotification: ut,
3521
+ viewNotification: S,
3522
+ updateAll: v,
3523
+ toggleUpdateAllStatus: St
3524
+ } = Ei(), { t: ot } = pi(), Ht = (I, st, Z) => {
3525
+ if (typeof I != "string") return null;
3526
+ const F = I.indexOf(" "), _t = F !== -1 ? I.substring(0, F) : I, z = F !== -1 ? I.substring(F + 1) : "";
3527
+ return /* @__PURE__ */ Gt("div", { className: st !== Z - 1 ? "mb-1" : "", children: [
3528
+ /* @__PURE__ */ pt("span", { className: `fw-bold ${at.redText}`, children: _t }),
3529
+ " ",
3530
+ z
3531
+ ] }, st);
3532
+ };
3533
+ return /* @__PURE__ */ Gt("div", { className: `animated fadeIn ${at.container}`, children: [
3534
+ /* @__PURE__ */ Gt("div", { className: "d-flex justify-content-between align-items-center mb-4", children: [
3535
+ /* @__PURE__ */ pt("h4", { className: at.header, children: ro }),
3536
+ /* @__PURE__ */ Gt("div", { className: "d-flex align-items-center", children: [
3537
+ Ct.isRead === !1 && /* @__PURE__ */ Gt(
3538
+ "div",
3539
+ {
3540
+ className: `d-flex align-items-center px-4 me-3 cursor-pointer ${at.markAllBtn}`,
3541
+ onClick: () => v(),
3542
+ children: [
3543
+ /* @__PURE__ */ pt("span", { className: `me-3 ${at.markAllText}`, children: "Mark all as read" }),
3544
+ /* @__PURE__ */ pt(
3545
+ jn,
3546
+ {
3547
+ checked: St,
3548
+ type: "checkbox",
3549
+ className: `m-0 position-relative cursor-pointer ${at.markAllCheckbox}`,
3550
+ onChange: () => v(),
3551
+ onClick: (I) => I.stopPropagation()
3552
+ }
3553
+ )
3554
+ ]
3555
+ }
3556
+ ),
3557
+ /* @__PURE__ */ Gt("div", { className: at.filterContainer, children: [
3558
+ /* @__PURE__ */ pt("span", { className: at.filterLabel, children: "Filter" }),
3559
+ /* @__PURE__ */ pt(
3560
+ yi,
3561
+ {
3562
+ value: Ct.isRead,
3563
+ onChange: (I) => G({ isRead: I.value })
3564
+ }
3565
+ )
3566
+ ] })
3567
+ ] })
3568
+ ] }),
3569
+ /* @__PURE__ */ Gt(Vr, { className: "mb-2", children: [
3570
+ /* @__PURE__ */ pt(Un, { md: 12, children: dt && dt.length > 0 ? /* @__PURE__ */ pt("div", { className: at.tableWrapper, children: /* @__PURE__ */ Gt(Qr, { borderless: !0, hover: !0, style: { margin: 0 }, children: [
3571
+ /* @__PURE__ */ pt("thead", { className: at.tableHead, children: /* @__PURE__ */ Gt("tr", { children: [
3572
+ /* @__PURE__ */ pt("th", { className: `align-middle ${at.th} ${at.thText}`, children: "Text" }),
3573
+ /* @__PURE__ */ pt("th", { className: `align-middle ${at.th}`, children: "Time" }),
3574
+ /* @__PURE__ */ pt("th", { className: `text-center align-middle ${at.th}`, children: "Is read" }),
3575
+ /* @__PURE__ */ pt("th", { className: `text-center align-middle ${at.th}`, children: "Go to session" })
3576
+ ] }) }),
3577
+ /* @__PURE__ */ pt("tbody", { children: dt.map((I, st) => /* @__PURE__ */ Gt("tr", { style: { borderBottom: st === dt.length - 1 ? "none" : "1px solid #f3f4f6" }, children: [
3578
+ /* @__PURE__ */ pt("td", { className: `align-middle ${at.td}`, children: /* @__PURE__ */ Gt("div", { className: "d-flex align-items-center", children: [
3579
+ oo(I),
3580
+ /* @__PURE__ */ Gt("span", { className: `ms-3 ${at.rowText}`, children: [
3581
+ I.text,
3582
+ I.text?.toLowerCase().includes("flag") && /* @__PURE__ */ pt(
3583
+ "img",
3584
+ {
3585
+ id: `info-icon-${I.id}`,
3586
+ src: io,
3587
+ alt: "",
3588
+ className: `ms-2 ${at["explain-icon"]}`
3589
+ }
3590
+ )
3591
+ ] }),
3592
+ I.text?.toLowerCase().includes("flag") && /* @__PURE__ */ pt(
3593
+ ti,
3594
+ {
3595
+ placement: "bottom",
3596
+ target: `info-icon-${I.id}`,
3597
+ innerClassName: at.whiteTooltip,
3598
+ offset: [0, 10],
3599
+ children: /* @__PURE__ */ pt("div", { className: `text-left p-1 ${at.tooltipContainer}`, children: /* @__PURE__ */ pt("div", { className: at.tooltipText, children: I.informaions && I.informaions.length > 0 ? I.informaions.map((Z, F) => Ht(Z, F, I.informaions.length)) : "View session details to see metrics" }) })
3600
+ }
3601
+ )
3602
+ ] }) }),
3603
+ /* @__PURE__ */ pt("td", { className: `align-middle ${at.td} ${at.rowTime}`, children: si(I.time, "yyyy-MM-DD HH:mm") }),
3604
+ /* @__PURE__ */ pt("td", { className: `text-center align-middle ${at.td}`, children: /* @__PURE__ */ pt(
3605
+ jn,
3606
+ {
3607
+ type: "checkbox",
3608
+ className: `position-relative m-0 shadow-none ${at.checkboxInput}`,
3609
+ checked: I.isRead,
3610
+ onChange: () => ut(
3611
+ I.id,
3612
+ !I.isRead
3613
+ )
3614
+ }
3615
+ ) }),
3616
+ /* @__PURE__ */ pt("td", { className: `text-center align-middle ${at.td}`, children: [
3617
+ "AssessmentAssignment",
3618
+ "NewConferenceCreated",
3619
+ "NewSessionCreated",
3620
+ "CertificateApproved",
3621
+ "Class Reflection",
3622
+ "NewSessionComplete",
3623
+ "ActionPointReminder",
3624
+ "SendNotiPLP",
3625
+ "SendNotiGOAL",
3626
+ "Class Reflection Completed",
3627
+ "External Reflection Completed",
3628
+ "RequestCheckIn",
3629
+ "NewSurveyCreated",
3630
+ "StudentCompletedSurvey"
3631
+ ].includes(I.source) && /* @__PURE__ */ pt(
3632
+ ei,
3633
+ {
3634
+ outline: !0,
3635
+ color: "secondary",
3636
+ size: "sm",
3637
+ className: at.actionBtn,
3638
+ onClick: () => S(I),
3639
+ children: "Go"
3640
+ }
3641
+ ) })
3642
+ ] }, I.id)) })
3643
+ ] }) }) : /* @__PURE__ */ pt(ai, { label: ot("notification") }) }),
3644
+ /* @__PURE__ */ pt(Un, { md: 12, className: "mt-4", children: /* @__PURE__ */ pt(
3645
+ fi,
3646
+ {
3647
+ filters: Ct,
3648
+ totalRecordCount: Xt,
3649
+ changePageSize: (I) => G({ pageSize: I }),
3650
+ changePage: (I) => G({ currentPage: I })
3651
+ }
3652
+ ) })
3653
+ ] })
3654
+ ] });
3655
+ };
3656
+ export {
3657
+ po as default
3658
+ };