@cendarsoss/pusher-js 8.4.17 → 8.4.18

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.
@@ -286,9 +286,9 @@ function encode(s) {
286
286
  }
287
287
  var fromCharCode = String.fromCharCode;
288
288
  var b64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
289
- var cb_utob = function(c) {
290
- var cc = c.charCodeAt(0);
291
- return cc < 128 ? c : cc < 2048 ? fromCharCode(192 | cc >>> 6) + fromCharCode(128 | cc & 63) : fromCharCode(224 | cc >>> 12 & 15) + fromCharCode(128 | cc >>> 6 & 63) + fromCharCode(128 | cc & 63);
289
+ var cb_utob = function(c3) {
290
+ var cc = c3.charCodeAt(0);
291
+ return cc < 128 ? c3 : cc < 2048 ? fromCharCode(192 | cc >>> 6) + fromCharCode(128 | cc & 63) : fromCharCode(224 | cc >>> 12 & 15) + fromCharCode(128 | cc >>> 6 & 63) + fromCharCode(128 | cc & 63);
292
292
  };
293
293
  var utob = function(u) {
294
294
  return u.replace(/[^\x00-\x7F]/g, cb_utob);
@@ -331,7 +331,7 @@ class Timer {
331
331
  }
332
332
  }
333
333
  }
334
- function clearTimeout(timer) {
334
+ function clearTimeout$1(timer) {
335
335
  window.clearTimeout(timer);
336
336
  }
337
337
  function clearInterval(timer) {
@@ -339,7 +339,7 @@ function clearInterval(timer) {
339
339
  }
340
340
  class OneOffTimer extends Timer {
341
341
  constructor(delay, callback) {
342
- super(setTimeout, clearTimeout, delay, function(timer) {
342
+ super(setTimeout, clearTimeout$1, delay, function(timer) {
343
343
  callback();
344
344
  return null;
345
345
  });
@@ -848,7 +848,7 @@ class Dispatcher {
848
848
  }
849
849
  this.global_callbacks = filter(
850
850
  this.global_callbacks || [],
851
- (c) => c !== callback
851
+ (c3) => c3 !== callback
852
852
  );
853
853
  return this;
854
854
  }
@@ -1900,25 +1900,25 @@ function requireUtf8() {
1900
1900
  var arr = new Uint8Array(encodedLength(s));
1901
1901
  var pos = 0;
1902
1902
  for (var i = 0; i < s.length; i++) {
1903
- var c = s.charCodeAt(i);
1904
- if (c < 128) {
1905
- arr[pos++] = c;
1906
- } else if (c < 2048) {
1907
- arr[pos++] = 192 | c >> 6;
1908
- arr[pos++] = 128 | c & 63;
1909
- } else if (c < 55296) {
1910
- arr[pos++] = 224 | c >> 12;
1911
- arr[pos++] = 128 | c >> 6 & 63;
1912
- arr[pos++] = 128 | c & 63;
1903
+ var c3 = s.charCodeAt(i);
1904
+ if (c3 < 128) {
1905
+ arr[pos++] = c3;
1906
+ } else if (c3 < 2048) {
1907
+ arr[pos++] = 192 | c3 >> 6;
1908
+ arr[pos++] = 128 | c3 & 63;
1909
+ } else if (c3 < 55296) {
1910
+ arr[pos++] = 224 | c3 >> 12;
1911
+ arr[pos++] = 128 | c3 >> 6 & 63;
1912
+ arr[pos++] = 128 | c3 & 63;
1913
1913
  } else {
1914
1914
  i++;
1915
- c = (c & 1023) << 10;
1916
- c |= s.charCodeAt(i) & 1023;
1917
- c += 65536;
1918
- arr[pos++] = 240 | c >> 18;
1919
- arr[pos++] = 128 | c >> 12 & 63;
1920
- arr[pos++] = 128 | c >> 6 & 63;
1921
- arr[pos++] = 128 | c & 63;
1915
+ c3 = (c3 & 1023) << 10;
1916
+ c3 |= s.charCodeAt(i) & 1023;
1917
+ c3 += 65536;
1918
+ arr[pos++] = 240 | c3 >> 18;
1919
+ arr[pos++] = 128 | c3 >> 12 & 63;
1920
+ arr[pos++] = 128 | c3 >> 6 & 63;
1921
+ arr[pos++] = 128 | c3 & 63;
1922
1922
  }
1923
1923
  }
1924
1924
  return arr;
@@ -1927,14 +1927,14 @@ function requireUtf8() {
1927
1927
  function encodedLength(s) {
1928
1928
  var result = 0;
1929
1929
  for (var i = 0; i < s.length; i++) {
1930
- var c = s.charCodeAt(i);
1931
- if (c < 128) {
1930
+ var c3 = s.charCodeAt(i);
1931
+ if (c3 < 128) {
1932
1932
  result += 1;
1933
- } else if (c < 2048) {
1933
+ } else if (c3 < 2048) {
1934
1934
  result += 2;
1935
- } else if (c < 55296) {
1935
+ } else if (c3 < 55296) {
1936
1936
  result += 3;
1937
- } else if (c <= 57343) {
1937
+ } else if (c3 <= 57343) {
1938
1938
  if (i >= s.length - 1) {
1939
1939
  throw new Error(INVALID_UTF16);
1940
1940
  }
@@ -2052,19 +2052,19 @@ function requireBase64() {
2052
2052
  var out = "";
2053
2053
  var i = 0;
2054
2054
  for (; i < data.length - 2; i += 3) {
2055
- var c = data[i] << 16 | data[i + 1] << 8 | data[i + 2];
2056
- out += this._encodeByte(c >>> 3 * 6 & 63);
2057
- out += this._encodeByte(c >>> 2 * 6 & 63);
2058
- out += this._encodeByte(c >>> 1 * 6 & 63);
2059
- out += this._encodeByte(c >>> 0 * 6 & 63);
2055
+ var c3 = data[i] << 16 | data[i + 1] << 8 | data[i + 2];
2056
+ out += this._encodeByte(c3 >>> 3 * 6 & 63);
2057
+ out += this._encodeByte(c3 >>> 2 * 6 & 63);
2058
+ out += this._encodeByte(c3 >>> 1 * 6 & 63);
2059
+ out += this._encodeByte(c3 >>> 0 * 6 & 63);
2060
2060
  }
2061
2061
  var left = data.length - i;
2062
2062
  if (left > 0) {
2063
- var c = data[i] << 16 | (left === 2 ? data[i + 1] << 8 : 0);
2064
- out += this._encodeByte(c >>> 3 * 6 & 63);
2065
- out += this._encodeByte(c >>> 2 * 6 & 63);
2063
+ var c3 = data[i] << 16 | (left === 2 ? data[i + 1] << 8 : 0);
2064
+ out += this._encodeByte(c3 >>> 3 * 6 & 63);
2065
+ out += this._encodeByte(c3 >>> 2 * 6 & 63);
2066
2066
  if (left === 2) {
2067
- out += this._encodeByte(c >>> 1 * 6 & 63);
2067
+ out += this._encodeByte(c3 >>> 1 * 6 & 63);
2068
2068
  } else {
2069
2069
  out += this._paddingCharacter || "";
2070
2070
  }
@@ -2136,13 +2136,13 @@ function requireBase64() {
2136
2136
  result += 62 - b >>> 8 & 62 - 43 - 63 + 47;
2137
2137
  return String.fromCharCode(result);
2138
2138
  };
2139
- Coder2.prototype._decodeChar = function(c) {
2139
+ Coder2.prototype._decodeChar = function(c3) {
2140
2140
  var result = INVALID_BYTE;
2141
- result += (42 - c & c - 44) >>> 8 & -INVALID_BYTE + c - 43 + 62;
2142
- result += (46 - c & c - 48) >>> 8 & -INVALID_BYTE + c - 47 + 63;
2143
- result += (47 - c & c - 58) >>> 8 & -INVALID_BYTE + c - 48 + 52;
2144
- result += (64 - c & c - 91) >>> 8 & -INVALID_BYTE + c - 65 + 0;
2145
- result += (96 - c & c - 123) >>> 8 & -INVALID_BYTE + c - 97 + 26;
2141
+ result += (42 - c3 & c3 - 44) >>> 8 & -INVALID_BYTE + c3 - 43 + 62;
2142
+ result += (46 - c3 & c3 - 48) >>> 8 & -INVALID_BYTE + c3 - 47 + 63;
2143
+ result += (47 - c3 & c3 - 58) >>> 8 & -INVALID_BYTE + c3 - 48 + 52;
2144
+ result += (64 - c3 & c3 - 91) >>> 8 & -INVALID_BYTE + c3 - 65 + 0;
2145
+ result += (96 - c3 & c3 - 123) >>> 8 & -INVALID_BYTE + c3 - 97 + 26;
2146
2146
  return result;
2147
2147
  };
2148
2148
  Coder2.prototype._getPaddingLength = function(s) {
@@ -2189,13 +2189,13 @@ function requireBase64() {
2189
2189
  result += 62 - b >>> 8 & 62 - 45 - 63 + 95;
2190
2190
  return String.fromCharCode(result);
2191
2191
  };
2192
- URLSafeCoder2.prototype._decodeChar = function(c) {
2192
+ URLSafeCoder2.prototype._decodeChar = function(c3) {
2193
2193
  var result = INVALID_BYTE;
2194
- result += (44 - c & c - 46) >>> 8 & -INVALID_BYTE + c - 45 + 62;
2195
- result += (94 - c & c - 96) >>> 8 & -INVALID_BYTE + c - 95 + 63;
2196
- result += (47 - c & c - 58) >>> 8 & -INVALID_BYTE + c - 48 + 52;
2197
- result += (64 - c & c - 91) >>> 8 & -INVALID_BYTE + c - 65 + 0;
2198
- result += (96 - c & c - 123) >>> 8 & -INVALID_BYTE + c - 97 + 26;
2194
+ result += (44 - c3 & c3 - 46) >>> 8 & -INVALID_BYTE + c3 - 45 + 62;
2195
+ result += (94 - c3 & c3 - 96) >>> 8 & -INVALID_BYTE + c3 - 95 + 63;
2196
+ result += (47 - c3 & c3 - 58) >>> 8 & -INVALID_BYTE + c3 - 48 + 52;
2197
+ result += (64 - c3 & c3 - 91) >>> 8 & -INVALID_BYTE + c3 - 65 + 0;
2198
+ result += (96 - c3 & c3 - 123) >>> 8 & -INVALID_BYTE + c3 - 97 + 26;
2199
2199
  return result;
2200
2200
  };
2201
2201
  return URLSafeCoder2;
@@ -4276,12 +4276,551 @@ class UserFacade extends Dispatcher {
4276
4276
  this._signinDoneResolve = resolve;
4277
4277
  }
4278
4278
  }
4279
+ var x = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date, I = /* @__PURE__ */ new Set(), R = typeof process == "object" && process ? process : {}, U = (c3, t, e, i) => {
4280
+ typeof R.emitWarning == "function" ? R.emitWarning(c3, t, e, i) : console.error(`[${e}] ${t}: ${c3}`);
4281
+ }, C = globalThis.AbortController, D = globalThis.AbortSignal;
4282
+ if (typeof C > "u") {
4283
+ D = class {
4284
+ onabort;
4285
+ _onabort = [];
4286
+ reason;
4287
+ aborted = false;
4288
+ addEventListener(i, s) {
4289
+ this._onabort.push(s);
4290
+ }
4291
+ }, C = class {
4292
+ constructor() {
4293
+ t();
4294
+ }
4295
+ signal = new D();
4296
+ abort(i) {
4297
+ if (!this.signal.aborted) {
4298
+ this.signal.reason = i, this.signal.aborted = true;
4299
+ for (let s of this.signal._onabort) s(i);
4300
+ this.signal.onabort?.(i);
4301
+ }
4302
+ }
4303
+ };
4304
+ let c3 = R.env?.LRU_CACHE_IGNORE_AC_WARNING !== "1", t = () => {
4305
+ c3 && (c3 = false, U("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.", "NO_ABORT_CONTROLLER", "ENOTSUP", t));
4306
+ };
4307
+ }
4308
+ var G = (c3) => !I.has(c3), y = (c3) => c3 && c3 === Math.floor(c3) && c3 > 0 && isFinite(c3), M = (c3) => y(c3) ? c3 <= Math.pow(2, 8) ? Uint8Array : c3 <= Math.pow(2, 16) ? Uint16Array : c3 <= Math.pow(2, 32) ? Uint32Array : c3 <= Number.MAX_SAFE_INTEGER ? z : null : null, z = class extends Array {
4309
+ constructor(t) {
4310
+ super(t), this.fill(0);
4311
+ }
4312
+ }, W = class c {
4313
+ heap;
4314
+ length;
4315
+ static #o = false;
4316
+ static create(t) {
4317
+ let e = M(t);
4318
+ if (!e) return [];
4319
+ c.#o = true;
4320
+ let i = new c(t, e);
4321
+ return c.#o = false, i;
4322
+ }
4323
+ constructor(t, e) {
4324
+ if (!c.#o) throw new TypeError("instantiate Stack using Stack.create(n)");
4325
+ this.heap = new e(t), this.length = 0;
4326
+ }
4327
+ push(t) {
4328
+ this.heap[this.length++] = t;
4329
+ }
4330
+ pop() {
4331
+ return this.heap[--this.length];
4332
+ }
4333
+ }, L = class c2 {
4334
+ #o;
4335
+ #c;
4336
+ #w;
4337
+ #C;
4338
+ #S;
4339
+ #L;
4340
+ #I;
4341
+ #m;
4342
+ get perf() {
4343
+ return this.#m;
4344
+ }
4345
+ ttl;
4346
+ ttlResolution;
4347
+ ttlAutopurge;
4348
+ updateAgeOnGet;
4349
+ updateAgeOnHas;
4350
+ allowStale;
4351
+ noDisposeOnSet;
4352
+ noUpdateTTL;
4353
+ maxEntrySize;
4354
+ sizeCalculation;
4355
+ noDeleteOnFetchRejection;
4356
+ noDeleteOnStaleGet;
4357
+ allowStaleOnFetchAbort;
4358
+ allowStaleOnFetchRejection;
4359
+ ignoreFetchAbort;
4360
+ #n;
4361
+ #_;
4362
+ #s;
4363
+ #i;
4364
+ #t;
4365
+ #a;
4366
+ #u;
4367
+ #l;
4368
+ #h;
4369
+ #b;
4370
+ #r;
4371
+ #y;
4372
+ #A;
4373
+ #d;
4374
+ #g;
4375
+ #T;
4376
+ #v;
4377
+ #f;
4378
+ #U;
4379
+ static unsafeExposeInternals(t) {
4380
+ return { starts: t.#A, ttls: t.#d, autopurgeTimers: t.#g, sizes: t.#y, keyMap: t.#s, keyList: t.#i, valList: t.#t, next: t.#a, prev: t.#u, get head() {
4381
+ return t.#l;
4382
+ }, get tail() {
4383
+ return t.#h;
4384
+ }, free: t.#b, isBackgroundFetch: (e) => t.#e(e), backgroundFetch: (e, i, s, n) => t.#G(e, i, s, n), moveToTail: (e) => t.#D(e), indexes: (e) => t.#F(e), rindexes: (e) => t.#O(e), isStale: (e) => t.#p(e) };
4385
+ }
4386
+ get max() {
4387
+ return this.#o;
4388
+ }
4389
+ get maxSize() {
4390
+ return this.#c;
4391
+ }
4392
+ get calculatedSize() {
4393
+ return this.#_;
4394
+ }
4395
+ get size() {
4396
+ return this.#n;
4397
+ }
4398
+ get fetchMethod() {
4399
+ return this.#L;
4400
+ }
4401
+ get memoMethod() {
4402
+ return this.#I;
4403
+ }
4404
+ get dispose() {
4405
+ return this.#w;
4406
+ }
4407
+ get onInsert() {
4408
+ return this.#C;
4409
+ }
4410
+ get disposeAfter() {
4411
+ return this.#S;
4412
+ }
4413
+ constructor(t) {
4414
+ let { max: e = 0, ttl: i, ttlResolution: s = 1, ttlAutopurge: n, updateAgeOnGet: o, updateAgeOnHas: h, allowStale: r, dispose: a, onInsert: w, disposeAfter: f, noDisposeOnSet: d, noUpdateTTL: g, maxSize: A = 0, maxEntrySize: p = 0, sizeCalculation: _, fetchMethod: l, memoMethod: S, noDeleteOnFetchRejection: b, noDeleteOnStaleGet: m, allowStaleOnFetchRejection: u, allowStaleOnFetchAbort: T, ignoreFetchAbort: F, perf: v } = t;
4415
+ if (v !== void 0 && typeof v?.now != "function") throw new TypeError("perf option must have a now() method if specified");
4416
+ if (this.#m = v ?? x, e !== 0 && !y(e)) throw new TypeError("max option must be a nonnegative integer");
4417
+ let O = e ? M(e) : Array;
4418
+ if (!O) throw new Error("invalid max value: " + e);
4419
+ if (this.#o = e, this.#c = A, this.maxEntrySize = p || this.#c, this.sizeCalculation = _, this.sizeCalculation) {
4420
+ if (!this.#c && !this.maxEntrySize) throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
4421
+ if (typeof this.sizeCalculation != "function") throw new TypeError("sizeCalculation set to non-function");
4422
+ }
4423
+ if (S !== void 0 && typeof S != "function") throw new TypeError("memoMethod must be a function if defined");
4424
+ if (this.#I = S, l !== void 0 && typeof l != "function") throw new TypeError("fetchMethod must be a function if specified");
4425
+ if (this.#L = l, this.#v = !!l, this.#s = /* @__PURE__ */ new Map(), this.#i = new Array(e).fill(void 0), this.#t = new Array(e).fill(void 0), this.#a = new O(e), this.#u = new O(e), this.#l = 0, this.#h = 0, this.#b = W.create(e), this.#n = 0, this.#_ = 0, typeof a == "function" && (this.#w = a), typeof w == "function" && (this.#C = w), typeof f == "function" ? (this.#S = f, this.#r = []) : (this.#S = void 0, this.#r = void 0), this.#T = !!this.#w, this.#U = !!this.#C, this.#f = !!this.#S, this.noDisposeOnSet = !!d, this.noUpdateTTL = !!g, this.noDeleteOnFetchRejection = !!b, this.allowStaleOnFetchRejection = !!u, this.allowStaleOnFetchAbort = !!T, this.ignoreFetchAbort = !!F, this.maxEntrySize !== 0) {
4426
+ if (this.#c !== 0 && !y(this.#c)) throw new TypeError("maxSize must be a positive integer if specified");
4427
+ if (!y(this.maxEntrySize)) throw new TypeError("maxEntrySize must be a positive integer if specified");
4428
+ this.#B();
4429
+ }
4430
+ if (this.allowStale = !!r, this.noDeleteOnStaleGet = !!m, this.updateAgeOnGet = !!o, this.updateAgeOnHas = !!h, this.ttlResolution = y(s) || s === 0 ? s : 1, this.ttlAutopurge = !!n, this.ttl = i || 0, this.ttl) {
4431
+ if (!y(this.ttl)) throw new TypeError("ttl must be a positive integer if specified");
4432
+ this.#j();
4433
+ }
4434
+ if (this.#o === 0 && this.ttl === 0 && this.#c === 0) throw new TypeError("At least one of max, maxSize, or ttl is required");
4435
+ if (!this.ttlAutopurge && !this.#o && !this.#c) {
4436
+ let E = "LRU_CACHE_UNBOUNDED";
4437
+ G(E) && (I.add(E), U("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.", "UnboundedCacheWarning", E, c2));
4438
+ }
4439
+ }
4440
+ getRemainingTTL(t) {
4441
+ return this.#s.has(t) ? 1 / 0 : 0;
4442
+ }
4443
+ #j() {
4444
+ let t = new z(this.#o), e = new z(this.#o);
4445
+ this.#d = t, this.#A = e;
4446
+ let i = this.ttlAutopurge ? new Array(this.#o) : void 0;
4447
+ this.#g = i, this.#N = (h, r, a = this.#m.now()) => {
4448
+ e[h] = r !== 0 ? a : 0, t[h] = r, s(h, r);
4449
+ }, this.#R = (h) => {
4450
+ e[h] = t[h] !== 0 ? this.#m.now() : 0, s(h, t[h]);
4451
+ };
4452
+ let s = this.ttlAutopurge ? (h, r) => {
4453
+ if (i?.[h] && (clearTimeout(i[h]), i[h] = void 0), r && r !== 0 && i) {
4454
+ let a = setTimeout(() => {
4455
+ this.#p(h) && this.#E(this.#i[h], "expire");
4456
+ }, r + 1);
4457
+ a.unref && a.unref(), i[h] = a;
4458
+ }
4459
+ } : () => {
4460
+ };
4461
+ this.#z = (h, r) => {
4462
+ if (t[r]) {
4463
+ let a = t[r], w = e[r];
4464
+ if (!a || !w) return;
4465
+ h.ttl = a, h.start = w, h.now = n || o();
4466
+ let f = h.now - w;
4467
+ h.remainingTTL = a - f;
4468
+ }
4469
+ };
4470
+ let n = 0, o = () => {
4471
+ let h = this.#m.now();
4472
+ if (this.ttlResolution > 0) {
4473
+ n = h;
4474
+ let r = setTimeout(() => n = 0, this.ttlResolution);
4475
+ r.unref && r.unref();
4476
+ }
4477
+ return h;
4478
+ };
4479
+ this.getRemainingTTL = (h) => {
4480
+ let r = this.#s.get(h);
4481
+ if (r === void 0) return 0;
4482
+ let a = t[r], w = e[r];
4483
+ if (!a || !w) return 1 / 0;
4484
+ let f = (n || o()) - w;
4485
+ return a - f;
4486
+ }, this.#p = (h) => {
4487
+ let r = e[h], a = t[h];
4488
+ return !!a && !!r && (n || o()) - r > a;
4489
+ };
4490
+ }
4491
+ #R = () => {
4492
+ };
4493
+ #z = () => {
4494
+ };
4495
+ #N = () => {
4496
+ };
4497
+ #p = () => false;
4498
+ #B() {
4499
+ let t = new z(this.#o);
4500
+ this.#_ = 0, this.#y = t, this.#W = (e) => {
4501
+ this.#_ -= t[e], t[e] = 0;
4502
+ }, this.#P = (e, i, s, n) => {
4503
+ if (this.#e(i)) return 0;
4504
+ if (!y(s)) if (n) {
4505
+ if (typeof n != "function") throw new TypeError("sizeCalculation must be a function");
4506
+ if (s = n(i, e), !y(s)) throw new TypeError("sizeCalculation return invalid (expect positive integer)");
4507
+ } else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");
4508
+ return s;
4509
+ }, this.#M = (e, i, s) => {
4510
+ if (t[e] = i, this.#c) {
4511
+ let n = this.#c - t[e];
4512
+ for (; this.#_ > n; ) this.#x(true);
4513
+ }
4514
+ this.#_ += t[e], s && (s.entrySize = i, s.totalCalculatedSize = this.#_);
4515
+ };
4516
+ }
4517
+ #W = (t) => {
4518
+ };
4519
+ #M = (t, e, i) => {
4520
+ };
4521
+ #P = (t, e, i, s) => {
4522
+ if (i || s) throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");
4523
+ return 0;
4524
+ };
4525
+ *#F({ allowStale: t = this.allowStale } = {}) {
4526
+ if (this.#n) for (let e = this.#h; !(!this.#H(e) || ((t || !this.#p(e)) && (yield e), e === this.#l)); ) e = this.#u[e];
4527
+ }
4528
+ *#O({ allowStale: t = this.allowStale } = {}) {
4529
+ if (this.#n) for (let e = this.#l; !(!this.#H(e) || ((t || !this.#p(e)) && (yield e), e === this.#h)); ) e = this.#a[e];
4530
+ }
4531
+ #H(t) {
4532
+ return t !== void 0 && this.#s.get(this.#i[t]) === t;
4533
+ }
4534
+ *entries() {
4535
+ for (let t of this.#F()) this.#t[t] !== void 0 && this.#i[t] !== void 0 && !this.#e(this.#t[t]) && (yield [this.#i[t], this.#t[t]]);
4536
+ }
4537
+ *rentries() {
4538
+ for (let t of this.#O()) this.#t[t] !== void 0 && this.#i[t] !== void 0 && !this.#e(this.#t[t]) && (yield [this.#i[t], this.#t[t]]);
4539
+ }
4540
+ *keys() {
4541
+ for (let t of this.#F()) {
4542
+ let e = this.#i[t];
4543
+ e !== void 0 && !this.#e(this.#t[t]) && (yield e);
4544
+ }
4545
+ }
4546
+ *rkeys() {
4547
+ for (let t of this.#O()) {
4548
+ let e = this.#i[t];
4549
+ e !== void 0 && !this.#e(this.#t[t]) && (yield e);
4550
+ }
4551
+ }
4552
+ *values() {
4553
+ for (let t of this.#F()) this.#t[t] !== void 0 && !this.#e(this.#t[t]) && (yield this.#t[t]);
4554
+ }
4555
+ *rvalues() {
4556
+ for (let t of this.#O()) this.#t[t] !== void 0 && !this.#e(this.#t[t]) && (yield this.#t[t]);
4557
+ }
4558
+ [Symbol.iterator]() {
4559
+ return this.entries();
4560
+ }
4561
+ [Symbol.toStringTag] = "LRUCache";
4562
+ find(t, e = {}) {
4563
+ for (let i of this.#F()) {
4564
+ let s = this.#t[i], n = this.#e(s) ? s.__staleWhileFetching : s;
4565
+ if (n !== void 0 && t(n, this.#i[i], this)) return this.get(this.#i[i], e);
4566
+ }
4567
+ }
4568
+ forEach(t, e = this) {
4569
+ for (let i of this.#F()) {
4570
+ let s = this.#t[i], n = this.#e(s) ? s.__staleWhileFetching : s;
4571
+ n !== void 0 && t.call(e, n, this.#i[i], this);
4572
+ }
4573
+ }
4574
+ rforEach(t, e = this) {
4575
+ for (let i of this.#O()) {
4576
+ let s = this.#t[i], n = this.#e(s) ? s.__staleWhileFetching : s;
4577
+ n !== void 0 && t.call(e, n, this.#i[i], this);
4578
+ }
4579
+ }
4580
+ purgeStale() {
4581
+ let t = false;
4582
+ for (let e of this.#O({ allowStale: true })) this.#p(e) && (this.#E(this.#i[e], "expire"), t = true);
4583
+ return t;
4584
+ }
4585
+ info(t) {
4586
+ let e = this.#s.get(t);
4587
+ if (e === void 0) return;
4588
+ let i = this.#t[e], s = this.#e(i) ? i.__staleWhileFetching : i;
4589
+ if (s === void 0) return;
4590
+ let n = { value: s };
4591
+ if (this.#d && this.#A) {
4592
+ let o = this.#d[e], h = this.#A[e];
4593
+ if (o && h) {
4594
+ let r = o - (this.#m.now() - h);
4595
+ n.ttl = r, n.start = Date.now();
4596
+ }
4597
+ }
4598
+ return this.#y && (n.size = this.#y[e]), n;
4599
+ }
4600
+ dump() {
4601
+ let t = [];
4602
+ for (let e of this.#F({ allowStale: true })) {
4603
+ let i = this.#i[e], s = this.#t[e], n = this.#e(s) ? s.__staleWhileFetching : s;
4604
+ if (n === void 0 || i === void 0) continue;
4605
+ let o = { value: n };
4606
+ if (this.#d && this.#A) {
4607
+ o.ttl = this.#d[e];
4608
+ let h = this.#m.now() - this.#A[e];
4609
+ o.start = Math.floor(Date.now() - h);
4610
+ }
4611
+ this.#y && (o.size = this.#y[e]), t.unshift([i, o]);
4612
+ }
4613
+ return t;
4614
+ }
4615
+ load(t) {
4616
+ this.clear();
4617
+ for (let [e, i] of t) {
4618
+ if (i.start) {
4619
+ let s = Date.now() - i.start;
4620
+ i.start = this.#m.now() - s;
4621
+ }
4622
+ this.set(e, i.value, i);
4623
+ }
4624
+ }
4625
+ set(t, e, i = {}) {
4626
+ if (e === void 0) return this.delete(t), this;
4627
+ let { ttl: s = this.ttl, start: n, noDisposeOnSet: o = this.noDisposeOnSet, sizeCalculation: h = this.sizeCalculation, status: r } = i, { noUpdateTTL: a = this.noUpdateTTL } = i, w = this.#P(t, e, i.size || 0, h);
4628
+ if (this.maxEntrySize && w > this.maxEntrySize) return r && (r.set = "miss", r.maxEntrySizeExceeded = true), this.#E(t, "set"), this;
4629
+ let f = this.#n === 0 ? void 0 : this.#s.get(t);
4630
+ if (f === void 0) f = this.#n === 0 ? this.#h : this.#b.length !== 0 ? this.#b.pop() : this.#n === this.#o ? this.#x(false) : this.#n, this.#i[f] = t, this.#t[f] = e, this.#s.set(t, f), this.#a[this.#h] = f, this.#u[f] = this.#h, this.#h = f, this.#n++, this.#M(f, w, r), r && (r.set = "add"), a = false, this.#U && this.#C?.(e, t, "add");
4631
+ else {
4632
+ this.#D(f);
4633
+ let d = this.#t[f];
4634
+ if (e !== d) {
4635
+ if (this.#v && this.#e(d)) {
4636
+ d.__abortController.abort(new Error("replaced"));
4637
+ let { __staleWhileFetching: g } = d;
4638
+ g !== void 0 && !o && (this.#T && this.#w?.(g, t, "set"), this.#f && this.#r?.push([g, t, "set"]));
4639
+ } else o || (this.#T && this.#w?.(d, t, "set"), this.#f && this.#r?.push([d, t, "set"]));
4640
+ if (this.#W(f), this.#M(f, w, r), this.#t[f] = e, r) {
4641
+ r.set = "replace";
4642
+ let g = d && this.#e(d) ? d.__staleWhileFetching : d;
4643
+ g !== void 0 && (r.oldValue = g);
4644
+ }
4645
+ } else r && (r.set = "update");
4646
+ this.#U && this.onInsert?.(e, t, e === d ? "update" : "replace");
4647
+ }
4648
+ if (s !== 0 && !this.#d && this.#j(), this.#d && (a || this.#N(f, s, n), r && this.#z(r, f)), !o && this.#f && this.#r) {
4649
+ let d = this.#r, g;
4650
+ for (; g = d?.shift(); ) this.#S?.(...g);
4651
+ }
4652
+ return this;
4653
+ }
4654
+ pop() {
4655
+ try {
4656
+ for (; this.#n; ) {
4657
+ let t = this.#t[this.#l];
4658
+ if (this.#x(true), this.#e(t)) {
4659
+ if (t.__staleWhileFetching) return t.__staleWhileFetching;
4660
+ } else if (t !== void 0) return t;
4661
+ }
4662
+ } finally {
4663
+ if (this.#f && this.#r) {
4664
+ let t = this.#r, e;
4665
+ for (; e = t?.shift(); ) this.#S?.(...e);
4666
+ }
4667
+ }
4668
+ }
4669
+ #x(t) {
4670
+ let e = this.#l, i = this.#i[e], s = this.#t[e];
4671
+ return this.#v && this.#e(s) ? s.__abortController.abort(new Error("evicted")) : (this.#T || this.#f) && (this.#T && this.#w?.(s, i, "evict"), this.#f && this.#r?.push([s, i, "evict"])), this.#W(e), this.#g?.[e] && (clearTimeout(this.#g[e]), this.#g[e] = void 0), t && (this.#i[e] = void 0, this.#t[e] = void 0, this.#b.push(e)), this.#n === 1 ? (this.#l = this.#h = 0, this.#b.length = 0) : this.#l = this.#a[e], this.#s.delete(i), this.#n--, e;
4672
+ }
4673
+ has(t, e = {}) {
4674
+ let { updateAgeOnHas: i = this.updateAgeOnHas, status: s } = e, n = this.#s.get(t);
4675
+ if (n !== void 0) {
4676
+ let o = this.#t[n];
4677
+ if (this.#e(o) && o.__staleWhileFetching === void 0) return false;
4678
+ if (this.#p(n)) s && (s.has = "stale", this.#z(s, n));
4679
+ else return i && this.#R(n), s && (s.has = "hit", this.#z(s, n)), true;
4680
+ } else s && (s.has = "miss");
4681
+ return false;
4682
+ }
4683
+ peek(t, e = {}) {
4684
+ let { allowStale: i = this.allowStale } = e, s = this.#s.get(t);
4685
+ if (s === void 0 || !i && this.#p(s)) return;
4686
+ let n = this.#t[s];
4687
+ return this.#e(n) ? n.__staleWhileFetching : n;
4688
+ }
4689
+ #G(t, e, i, s) {
4690
+ let n = e === void 0 ? void 0 : this.#t[e];
4691
+ if (this.#e(n)) return n;
4692
+ let o = new C(), { signal: h } = i;
4693
+ h?.addEventListener("abort", () => o.abort(h.reason), { signal: o.signal });
4694
+ let r = { signal: o.signal, options: i, context: s }, a = (p, _ = false) => {
4695
+ let { aborted: l } = o.signal, S = i.ignoreFetchAbort && p !== void 0, b = i.ignoreFetchAbort || !!(i.allowStaleOnFetchAbort && p !== void 0);
4696
+ if (i.status && (l && !_ ? (i.status.fetchAborted = true, i.status.fetchError = o.signal.reason, S && (i.status.fetchAbortIgnored = true)) : i.status.fetchResolved = true), l && !S && !_) return f(o.signal.reason, b);
4697
+ let m = g, u = this.#t[e];
4698
+ return (u === g || S && _ && u === void 0) && (p === void 0 ? m.__staleWhileFetching !== void 0 ? this.#t[e] = m.__staleWhileFetching : this.#E(t, "fetch") : (i.status && (i.status.fetchUpdated = true), this.set(t, p, r.options))), p;
4699
+ }, w = (p) => (i.status && (i.status.fetchRejected = true, i.status.fetchError = p), f(p, false)), f = (p, _) => {
4700
+ let { aborted: l } = o.signal, S = l && i.allowStaleOnFetchAbort, b = S || i.allowStaleOnFetchRejection, m = b || i.noDeleteOnFetchRejection, u = g;
4701
+ if (this.#t[e] === g && (!m || !_ && u.__staleWhileFetching === void 0 ? this.#E(t, "fetch") : S || (this.#t[e] = u.__staleWhileFetching)), b) return i.status && u.__staleWhileFetching !== void 0 && (i.status.returnedStale = true), u.__staleWhileFetching;
4702
+ if (u.__returned === u) throw p;
4703
+ }, d = (p, _) => {
4704
+ let l = this.#L?.(t, n, r);
4705
+ l && l instanceof Promise && l.then((S) => p(S === void 0 ? void 0 : S), _), o.signal.addEventListener("abort", () => {
4706
+ (!i.ignoreFetchAbort || i.allowStaleOnFetchAbort) && (p(void 0), i.allowStaleOnFetchAbort && (p = (S) => a(S, true)));
4707
+ });
4708
+ };
4709
+ i.status && (i.status.fetchDispatched = true);
4710
+ let g = new Promise(d).then(a, w), A = Object.assign(g, { __abortController: o, __staleWhileFetching: n, __returned: void 0 });
4711
+ return e === void 0 ? (this.set(t, A, { ...r.options, status: void 0 }), e = this.#s.get(t)) : this.#t[e] = A, A;
4712
+ }
4713
+ #e(t) {
4714
+ if (!this.#v) return false;
4715
+ let e = t;
4716
+ return !!e && e instanceof Promise && e.hasOwnProperty("__staleWhileFetching") && e.__abortController instanceof C;
4717
+ }
4718
+ async fetch(t, e = {}) {
4719
+ let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n = this.noDeleteOnStaleGet, ttl: o = this.ttl, noDisposeOnSet: h = this.noDisposeOnSet, size: r = 0, sizeCalculation: a = this.sizeCalculation, noUpdateTTL: w = this.noUpdateTTL, noDeleteOnFetchRejection: f = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection: d = this.allowStaleOnFetchRejection, ignoreFetchAbort: g = this.ignoreFetchAbort, allowStaleOnFetchAbort: A = this.allowStaleOnFetchAbort, context: p, forceRefresh: _ = false, status: l, signal: S } = e;
4720
+ if (!this.#v) return l && (l.fetch = "get"), this.get(t, { allowStale: i, updateAgeOnGet: s, noDeleteOnStaleGet: n, status: l });
4721
+ let b = { allowStale: i, updateAgeOnGet: s, noDeleteOnStaleGet: n, ttl: o, noDisposeOnSet: h, size: r, sizeCalculation: a, noUpdateTTL: w, noDeleteOnFetchRejection: f, allowStaleOnFetchRejection: d, allowStaleOnFetchAbort: A, ignoreFetchAbort: g, status: l, signal: S }, m = this.#s.get(t);
4722
+ if (m === void 0) {
4723
+ l && (l.fetch = "miss");
4724
+ let u = this.#G(t, m, b, p);
4725
+ return u.__returned = u;
4726
+ } else {
4727
+ let u = this.#t[m];
4728
+ if (this.#e(u)) {
4729
+ let E = i && u.__staleWhileFetching !== void 0;
4730
+ return l && (l.fetch = "inflight", E && (l.returnedStale = true)), E ? u.__staleWhileFetching : u.__returned = u;
4731
+ }
4732
+ let T = this.#p(m);
4733
+ if (!_ && !T) return l && (l.fetch = "hit"), this.#D(m), s && this.#R(m), l && this.#z(l, m), u;
4734
+ let F = this.#G(t, m, b, p), O = F.__staleWhileFetching !== void 0 && i;
4735
+ return l && (l.fetch = T ? "stale" : "refresh", O && T && (l.returnedStale = true)), O ? F.__staleWhileFetching : F.__returned = F;
4736
+ }
4737
+ }
4738
+ async forceFetch(t, e = {}) {
4739
+ let i = await this.fetch(t, e);
4740
+ if (i === void 0) throw new Error("fetch() returned undefined");
4741
+ return i;
4742
+ }
4743
+ memo(t, e = {}) {
4744
+ let i = this.#I;
4745
+ if (!i) throw new Error("no memoMethod provided to constructor");
4746
+ let { context: s, forceRefresh: n, ...o } = e, h = this.get(t, o);
4747
+ if (!n && h !== void 0) return h;
4748
+ let r = i(t, h, { options: o, context: s });
4749
+ return this.set(t, r, o), r;
4750
+ }
4751
+ get(t, e = {}) {
4752
+ let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n = this.noDeleteOnStaleGet, status: o } = e, h = this.#s.get(t);
4753
+ if (h !== void 0) {
4754
+ let r = this.#t[h], a = this.#e(r);
4755
+ return o && this.#z(o, h), this.#p(h) ? (o && (o.get = "stale"), a ? (o && i && r.__staleWhileFetching !== void 0 && (o.returnedStale = true), i ? r.__staleWhileFetching : void 0) : (n || this.#E(t, "expire"), o && i && (o.returnedStale = true), i ? r : void 0)) : (o && (o.get = "hit"), a ? r.__staleWhileFetching : (this.#D(h), s && this.#R(h), r));
4756
+ } else o && (o.get = "miss");
4757
+ }
4758
+ #k(t, e) {
4759
+ this.#u[e] = t, this.#a[t] = e;
4760
+ }
4761
+ #D(t) {
4762
+ t !== this.#h && (t === this.#l ? this.#l = this.#a[t] : this.#k(this.#u[t], this.#a[t]), this.#k(this.#h, t), this.#h = t);
4763
+ }
4764
+ delete(t) {
4765
+ return this.#E(t, "delete");
4766
+ }
4767
+ #E(t, e) {
4768
+ let i = false;
4769
+ if (this.#n !== 0) {
4770
+ let s = this.#s.get(t);
4771
+ if (s !== void 0) if (this.#g?.[s] && (clearTimeout(this.#g?.[s]), this.#g[s] = void 0), i = true, this.#n === 1) this.#V(e);
4772
+ else {
4773
+ this.#W(s);
4774
+ let n = this.#t[s];
4775
+ if (this.#e(n) ? n.__abortController.abort(new Error("deleted")) : (this.#T || this.#f) && (this.#T && this.#w?.(n, t, e), this.#f && this.#r?.push([n, t, e])), this.#s.delete(t), this.#i[s] = void 0, this.#t[s] = void 0, s === this.#h) this.#h = this.#u[s];
4776
+ else if (s === this.#l) this.#l = this.#a[s];
4777
+ else {
4778
+ let o = this.#u[s];
4779
+ this.#a[o] = this.#a[s];
4780
+ let h = this.#a[s];
4781
+ this.#u[h] = this.#u[s];
4782
+ }
4783
+ this.#n--, this.#b.push(s);
4784
+ }
4785
+ }
4786
+ if (this.#f && this.#r?.length) {
4787
+ let s = this.#r, n;
4788
+ for (; n = s?.shift(); ) this.#S?.(...n);
4789
+ }
4790
+ return i;
4791
+ }
4792
+ clear() {
4793
+ return this.#V("delete");
4794
+ }
4795
+ #V(t) {
4796
+ for (let e of this.#O({ allowStale: true })) {
4797
+ let i = this.#t[e];
4798
+ if (this.#e(i)) i.__abortController.abort(new Error("deleted"));
4799
+ else {
4800
+ let s = this.#i[e];
4801
+ this.#T && this.#w?.(i, s, t), this.#f && this.#r?.push([i, s, t]);
4802
+ }
4803
+ }
4804
+ if (this.#s.clear(), this.#t.fill(void 0), this.#i.fill(void 0), this.#d && this.#A) {
4805
+ this.#d.fill(0), this.#A.fill(0);
4806
+ for (let e of this.#g ?? []) e !== void 0 && clearTimeout(e);
4807
+ this.#g?.fill(void 0);
4808
+ }
4809
+ if (this.#y && this.#y.fill(0), this.#l = 0, this.#h = 0, this.#b.length = 0, this.#_ = 0, this.#n = 0, this.#f && this.#r) {
4810
+ let e = this.#r, i;
4811
+ for (; i = e?.shift(); ) this.#S?.(...i);
4812
+ }
4813
+ }
4814
+ };
4815
+ const MAX_CONFLATION_CACHE_KEYS = 2e3;
4279
4816
  class ChannelState {
4280
4817
  constructor(channelName) {
4281
4818
  this.channelName = channelName;
4282
4819
  this.conflationKey = null;
4283
4820
  this.maxMessagesPerKey = 30;
4284
- this.conflationCaches = /* @__PURE__ */ new Map();
4821
+ this.conflationCaches = new L({
4822
+ max: MAX_CONFLATION_CACHE_KEYS
4823
+ });
4285
4824
  this.baseMessage = null;
4286
4825
  this.baseSequence = null;
4287
4826
  this.lastSequence = null;
@@ -4322,7 +4861,7 @@ class ChannelState {
4322
4861
  return this.baseMessage;
4323
4862
  }
4324
4863
  const key = conflationKeyValue || "";
4325
- const cache = this.conflationCaches.get(key);
4864
+ const cache = this.conflationCaches.peek(key);
4326
4865
  if (!cache || baseIndex === void 0) {
4327
4866
  console.error("[ChannelState] No cache or baseIndex undefined", {
4328
4867
  hasCache: !!cache,
@@ -4342,6 +4881,7 @@ class ChannelState {
4342
4881
  });
4343
4882
  return null;
4344
4883
  }
4884
+ this.conflationCaches.get(key);
4345
4885
  return message.content;
4346
4886
  }
4347
4887
  /**
@@ -4349,10 +4889,9 @@ class ChannelState {
4349
4889
  */
4350
4890
  updateConflationCache(conflationKeyValue, message, sequence) {
4351
4891
  const key = conflationKeyValue || "";
4352
- let cache = this.conflationCaches.get(key);
4892
+ let cache = this.conflationCaches.peek(key);
4353
4893
  if (!cache) {
4354
4894
  cache = [];
4355
- this.conflationCaches.set(key, cache);
4356
4895
  }
4357
4896
  if (cache.length > 0) {
4358
4897
  const lastCacheItem = cache[cache.length - 1];
@@ -4364,6 +4903,7 @@ class ChannelState {
4364
4903
  while (cache.length > this.maxMessagesPerKey) {
4365
4904
  cache.shift();
4366
4905
  }
4906
+ this.conflationCaches.set(key, cache);
4367
4907
  }
4368
4908
  /**
4369
4909
  * Check if we have a valid base
@@ -4415,8 +4955,8 @@ class ChannelState {
4415
4955
  };
4416
4956
  }
4417
4957
  }
4418
- const zDigits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~".split("").map(function(x) {
4419
- return x.charCodeAt(0);
4958
+ const zDigits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~".split("").map(function(x2) {
4959
+ return x2.charCodeAt(0);
4420
4960
  });
4421
4961
  const zValue = [
4422
4962
  -1,
@@ -4571,9 +5111,9 @@ class Reader {
4571
5111
  // Read base64-encoded unsigned integer.
4572
5112
  getInt() {
4573
5113
  let v = 0;
4574
- let c;
4575
- while (this.haveBytes() && (c = zValue[127 & this.getByte()]) >= 0) {
4576
- v = (v << 6) + c;
5114
+ let c3;
5115
+ while (this.haveBytes() && (c3 = zValue[127 & this.getByte()]) >= 0) {
5116
+ v = (v << 6) + c3;
4577
5117
  }
4578
5118
  this.pos--;
4579
5119
  return v >>> 0;
@@ -4616,45 +5156,45 @@ class Writer {
4616
5156
  }
4617
5157
  }
4618
5158
  function checksum(arr) {
4619
- let sum0 = 0, sum1 = 0, sum2 = 0, sum3 = 0, z = 0, N = arr.length;
5159
+ let sum0 = 0, sum1 = 0, sum2 = 0, sum3 = 0, z2 = 0, N = arr.length;
4620
5160
  while (N >= 16) {
4621
- sum0 = sum0 + arr[z + 0] | 0;
4622
- sum1 = sum1 + arr[z + 1] | 0;
4623
- sum2 = sum2 + arr[z + 2] | 0;
4624
- sum3 = sum3 + arr[z + 3] | 0;
4625
- sum0 = sum0 + arr[z + 4] | 0;
4626
- sum1 = sum1 + arr[z + 5] | 0;
4627
- sum2 = sum2 + arr[z + 6] | 0;
4628
- sum3 = sum3 + arr[z + 7] | 0;
4629
- sum0 = sum0 + arr[z + 8] | 0;
4630
- sum1 = sum1 + arr[z + 9] | 0;
4631
- sum2 = sum2 + arr[z + 10] | 0;
4632
- sum3 = sum3 + arr[z + 11] | 0;
4633
- sum0 = sum0 + arr[z + 12] | 0;
4634
- sum1 = sum1 + arr[z + 13] | 0;
4635
- sum2 = sum2 + arr[z + 14] | 0;
4636
- sum3 = sum3 + arr[z + 15] | 0;
4637
- z += 16;
5161
+ sum0 = sum0 + arr[z2 + 0] | 0;
5162
+ sum1 = sum1 + arr[z2 + 1] | 0;
5163
+ sum2 = sum2 + arr[z2 + 2] | 0;
5164
+ sum3 = sum3 + arr[z2 + 3] | 0;
5165
+ sum0 = sum0 + arr[z2 + 4] | 0;
5166
+ sum1 = sum1 + arr[z2 + 5] | 0;
5167
+ sum2 = sum2 + arr[z2 + 6] | 0;
5168
+ sum3 = sum3 + arr[z2 + 7] | 0;
5169
+ sum0 = sum0 + arr[z2 + 8] | 0;
5170
+ sum1 = sum1 + arr[z2 + 9] | 0;
5171
+ sum2 = sum2 + arr[z2 + 10] | 0;
5172
+ sum3 = sum3 + arr[z2 + 11] | 0;
5173
+ sum0 = sum0 + arr[z2 + 12] | 0;
5174
+ sum1 = sum1 + arr[z2 + 13] | 0;
5175
+ sum2 = sum2 + arr[z2 + 14] | 0;
5176
+ sum3 = sum3 + arr[z2 + 15] | 0;
5177
+ z2 += 16;
4638
5178
  N -= 16;
4639
5179
  }
4640
5180
  while (N >= 4) {
4641
- sum0 = sum0 + arr[z + 0] | 0;
4642
- sum1 = sum1 + arr[z + 1] | 0;
4643
- sum2 = sum2 + arr[z + 2] | 0;
4644
- sum3 = sum3 + arr[z + 3] | 0;
4645
- z += 4;
5181
+ sum0 = sum0 + arr[z2 + 0] | 0;
5182
+ sum1 = sum1 + arr[z2 + 1] | 0;
5183
+ sum2 = sum2 + arr[z2 + 2] | 0;
5184
+ sum3 = sum3 + arr[z2 + 3] | 0;
5185
+ z2 += 4;
4646
5186
  N -= 4;
4647
5187
  }
4648
5188
  sum3 = ((sum3 + (sum2 << 8) | 0) + (sum1 << 16) | 0) + (sum0 << 24) | 0;
4649
5189
  switch (N) {
4650
5190
  case 3:
4651
- sum3 = sum3 + (arr[z + 2] << 8) | 0;
5191
+ sum3 = sum3 + (arr[z2 + 2] << 8) | 0;
4652
5192
  /* falls through */
4653
5193
  case 2:
4654
- sum3 = sum3 + (arr[z + 1] << 16) | 0;
5194
+ sum3 = sum3 + (arr[z2 + 1] << 16) | 0;
4655
5195
  /* falls through */
4656
5196
  case 1:
4657
- sum3 = sum3 + (arr[z + 0] << 24) | 0;
5197
+ sum3 = sum3 + (arr[z2 + 0] << 24) | 0;
4658
5198
  }
4659
5199
  return sum3 >>> 0;
4660
5200
  }
@@ -5110,15 +5650,15 @@ class VCDiff {
5110
5650
  _buildTargetWindow(position, sourceSegment) {
5111
5651
  let window2 = delta(this.delta, position);
5112
5652
  let T = new Uint8Array(window2.targetWindowLength);
5113
- let U = new TypedArrayList();
5653
+ let U2 = new TypedArrayList();
5114
5654
  let uTargetPosition = 0;
5115
5655
  if (sourceSegment) {
5116
- U.add(sourceSegment);
5656
+ U2.add(sourceSegment);
5117
5657
  uTargetPosition = sourceSegment.length;
5118
5658
  }
5119
- U.add(T);
5659
+ U2.add(T);
5120
5660
  this.source.length;
5121
- let delta$1 = new Delta(U, uTargetPosition, window2.data, window2.addresses);
5661
+ let delta$1 = new Delta(U2, uTargetPosition, window2.data, window2.addresses);
5122
5662
  window2.instructions.forEach((instruction) => {
5123
5663
  instruction.execute(delta$1);
5124
5664
  });
@@ -5126,8 +5666,8 @@ class VCDiff {
5126
5666
  }
5127
5667
  }
5128
5668
  class Delta {
5129
- constructor(U, UTargetPosition, data, addresses) {
5130
- this.U = U;
5669
+ constructor(U2, UTargetPosition, data, addresses) {
5670
+ this.U = U2;
5131
5671
  this.UTargetPosition = UTargetPosition;
5132
5672
  this.data = data;
5133
5673
  this.dataPosition = 0;