@jetthai/cuora 1.0.200 → 1.0.201

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 (3) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/bundle.mjs +413 -2429
  3. package/package.json +2 -2
package/dist/bundle.mjs CHANGED
@@ -122,12 +122,13 @@ var game$1 = {
122
122
  logoutGame: ({ uid_site, provider_id }) => ({ url: 'game/logout', method: 'get', params: { uid_site, provider_id } }),
123
123
 
124
124
  getGameTags: ({ q }) => ({ url: 'game/search', method: 'get', params: { q } }),
125
+ getGameSearchHome: () => ({ url: 'game/search/home', method: 'get' }),
125
126
  getGameSearchList: ({ id, index, q, click, clickDefault }) => ({
126
127
  url: 'game/search/list',
127
128
  method: 'get',
128
129
  params: { id, index, q, click, clickDefault },
129
130
  }),
130
- setGameSearchTrace: ({ traceId, tagId, tagIndex, gameCode, gameCodeIndex, query, click, clickDefault }) => ({
131
+ setGameSearchTrace: ({ traceId, tagId, tagIndex, gameCode, gameCodeIndex, query, click, clickDefault, isYouMayLike, isRecentlyGame, isRecentlySearch }) => ({
131
132
  url: 'game/search/trace',
132
133
  method: 'post',
133
134
  params: {
@@ -139,6 +140,9 @@ var game$1 = {
139
140
  query,
140
141
  click,
141
142
  clickDefault,
143
+ isYouMayLike,
144
+ isRecentlyGame,
145
+ isRecentlySearch
142
146
  },
143
147
  }),
144
148
  gameHistory: ({ requestTimestamp, lang, provider, type }) => ({
@@ -5317,9 +5321,9 @@ var _equalArrays = equalArrays$2;
5317
5321
  var root$4 = _root;
5318
5322
 
5319
5323
  /** Built-in value references. */
5320
- var Uint8Array$2 = root$4.Uint8Array;
5324
+ var Uint8Array$1 = root$4.Uint8Array;
5321
5325
 
5322
- var _Uint8Array = Uint8Array$2;
5326
+ var _Uint8Array = Uint8Array$1;
5323
5327
 
5324
5328
  /**
5325
5329
  * Converts `map` to its key-value pairs.
@@ -5362,7 +5366,7 @@ function setToArray$1(set) {
5362
5366
  var _setToArray = setToArray$1;
5363
5367
 
5364
5368
  var Symbol$2 = _Symbol,
5365
- Uint8Array$1 = _Uint8Array,
5369
+ Uint8Array = _Uint8Array,
5366
5370
  eq$1 = eq_1,
5367
5371
  equalArrays$1 = _equalArrays,
5368
5372
  mapToArray = _mapToArray,
@@ -5419,7 +5423,7 @@ function equalByTag$1(object, other, tag, bitmask, customizer, equalFunc, stack)
5419
5423
 
5420
5424
  case arrayBufferTag$1:
5421
5425
  if ((object.byteLength != other.byteLength) ||
5422
- !equalFunc(new Uint8Array$1(object), new Uint8Array$1(other))) {
5426
+ !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
5423
5427
  return false;
5424
5428
  }
5425
5429
  return true;
@@ -7589,6 +7593,7 @@ function activity$1 (request) {
7589
7593
  activityMap: {},
7590
7594
  tournamentList: [],
7591
7595
  refs: {},
7596
+ uidSite: ''
7592
7597
  },
7593
7598
  states: {
7594
7599
  fetchingActivityList: {
@@ -7609,6 +7614,11 @@ function activity$1 (request) {
7609
7614
  target: 'fetchingActivityList',
7610
7615
  },
7611
7616
  },
7617
+ on: {
7618
+ SET_UNREAD: {
7619
+ actions: 'setUnread'
7620
+ }
7621
+ }
7612
7622
  },
7613
7623
  },
7614
7624
  },
@@ -7621,10 +7631,38 @@ function activity$1 (request) {
7621
7631
  }
7622
7632
  }),
7623
7633
  setActivityList: assign((context, event) => {
7634
+ const noRedActivity = [2, 4, 13, 20, 91, 92];
7635
+ const { uidSite } = context;
7636
+ let list = event.data;
7637
+ list.forEach(activity => {
7638
+ const storageUnread = localStorage.getItem(`unread_${activity.activityNo}_${uidSite}`);
7639
+ if (noRedActivity.includes(activity.activityType)) {
7640
+ activity.unread = false;
7641
+ } else if (storageUnread) {
7642
+ activity.unread = JSON.parse(storageUnread);
7643
+ } else {
7644
+ activity.unread = true;
7645
+ }
7646
+ });
7624
7647
  return {
7625
- activityList: event.data,
7648
+ activityList: list,
7626
7649
  }
7627
7650
  }),
7651
+ setUnread: assign((context, event) => {
7652
+ const { uidSite, activityNo, unread } = event.data;
7653
+ const list = JSON.parse(JSON.stringify(context.activityList));
7654
+ localStorage.setItem(`unread_${activityNo}_${uidSite}`, `${unread}`);
7655
+ list.map((item) => {
7656
+ if (item.activityNo === activityNo) {
7657
+ item.unread = JSON.parse(`${unread}`);
7658
+ }
7659
+ return item
7660
+ });
7661
+ return {
7662
+ activityList: list,
7663
+ uidSite
7664
+ }
7665
+ })
7628
7666
  },
7629
7667
  delays: {
7630
7668
  TIMEOUT: (context, event) => {
@@ -7772,7 +7810,7 @@ var storage = {
7772
7810
  }
7773
7811
  };
7774
7812
 
7775
- /*! *****************************************************************************
7813
+ /******************************************************************************
7776
7814
  Copyright (c) Microsoft Corporation.
7777
7815
 
7778
7816
  Permission to use, copy, modify, and/or distribute this software for any
@@ -7804,2434 +7842,28 @@ function __rest(s, e) {
7804
7842
  t[p] = s[p];
7805
7843
  if (s != null && typeof Object.getOwnPropertySymbols === "function")
7806
7844
  for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7807
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
7808
- t[p[i]] = s[p[i]];
7809
- }
7810
- return t;
7811
- }
7812
-
7813
- function __awaiter(thisArg, _arguments, P, generator) {
7814
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
7815
- return new (P || (P = Promise))(function (resolve, reject) {
7816
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
7817
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7818
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7819
- step((generator = generator.apply(thisArg, _arguments || [])).next());
7820
- });
7821
- }
7822
-
7823
- function __generator(thisArg, body) {
7824
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
7825
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
7826
- function verb(n) { return function (v) { return step([n, v]); }; }
7827
- function step(op) {
7828
- if (f) throw new TypeError("Generator is already executing.");
7829
- while (_) try {
7830
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
7831
- if (y = 0, t) op = [op[0] & 2, t.value];
7832
- switch (op[0]) {
7833
- case 0: case 1: t = op; break;
7834
- case 4: _.label++; return { value: op[1], done: false };
7835
- case 5: _.label++; y = op[1]; op = [0]; continue;
7836
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
7837
- default:
7838
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
7839
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
7840
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
7841
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
7842
- if (t[2]) _.ops.pop();
7843
- _.trys.pop(); continue;
7844
- }
7845
- op = body.call(thisArg, _);
7846
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
7847
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
7848
- }
7849
- }
7850
-
7851
- /** @deprecated */
7852
- function __spreadArrays() {
7853
- for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
7854
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
7855
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
7856
- r[k] = a[j];
7857
- return r;
7858
- }
7859
-
7860
- /**
7861
- * FingerprintJS v3.3.3 - Copyright (c) FingerprintJS, Inc, 2022 (https://fingerprintjs.com)
7862
- * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
7863
- *
7864
- * This software contains code from open-source projects:
7865
- * MurmurHash3 by Karan Lyons (https://github.com/karanlyons/murmurHash3.js)
7866
- */
7867
-
7868
- function wait(durationMs, resolveWith) {
7869
- return new Promise(function (resolve) { return setTimeout(resolve, durationMs, resolveWith); });
7870
- }
7871
- function requestIdleCallbackIfAvailable(fallbackTimeout, deadlineTimeout) {
7872
- if (deadlineTimeout === void 0) { deadlineTimeout = Infinity; }
7873
- var requestIdleCallback = window.requestIdleCallback;
7874
- if (requestIdleCallback) {
7875
- // The function `requestIdleCallback` loses the binding to `window` here.
7876
- // `globalThis` isn't always equal `window` (see https://github.com/fingerprintjs/fingerprintjs/issues/683).
7877
- // Therefore, an error can occur. `call(window,` prevents the error.
7878
- return new Promise(function (resolve) { return requestIdleCallback.call(window, function () { return resolve(); }, { timeout: deadlineTimeout }); });
7879
- }
7880
- else {
7881
- return wait(Math.min(fallbackTimeout, deadlineTimeout));
7882
- }
7883
- }
7884
- function isPromise(value) {
7885
- return value && typeof value.then === 'function';
7886
- }
7887
- /**
7888
- * Calls a maybe asynchronous function without creating microtasks when the function is synchronous.
7889
- * Catches errors in both cases.
7890
- *
7891
- * If just you run a code like this:
7892
- * ```
7893
- * console.time('Action duration')
7894
- * await action()
7895
- * console.timeEnd('Action duration')
7896
- * ```
7897
- * The synchronous function time can be measured incorrectly because another microtask may run before the `await`
7898
- * returns the control back to the code.
7899
- */
7900
- function awaitIfAsync(action, callback) {
7901
- try {
7902
- var returnedValue = action();
7903
- if (isPromise(returnedValue)) {
7904
- returnedValue.then(function (result) { return callback(true, result); }, function (error) { return callback(false, error); });
7905
- }
7906
- else {
7907
- callback(true, returnedValue);
7908
- }
7909
- }
7910
- catch (error) {
7911
- callback(false, error);
7912
- }
7913
- }
7914
- /**
7915
- * If you run many synchronous tasks without using this function, the JS main loop will be busy and asynchronous tasks
7916
- * (e.g. completing a network request, rendering the page) won't be able to happen.
7917
- * This function allows running many synchronous tasks such way that asynchronous tasks can run too in background.
7918
- */
7919
- function forEachWithBreaks(items, callback, loopReleaseInterval) {
7920
- if (loopReleaseInterval === void 0) { loopReleaseInterval = 16; }
7921
- return __awaiter(this, void 0, void 0, function () {
7922
- var lastLoopReleaseTime, i, now;
7923
- return __generator(this, function (_a) {
7924
- switch (_a.label) {
7925
- case 0:
7926
- lastLoopReleaseTime = Date.now();
7927
- i = 0;
7928
- _a.label = 1;
7929
- case 1:
7930
- if (!(i < items.length)) return [3 /*break*/, 4];
7931
- callback(items[i], i);
7932
- now = Date.now();
7933
- if (!(now >= lastLoopReleaseTime + loopReleaseInterval)) return [3 /*break*/, 3];
7934
- lastLoopReleaseTime = now;
7935
- // Allows asynchronous actions and microtasks to happen
7936
- return [4 /*yield*/, wait(0)];
7937
- case 2:
7938
- // Allows asynchronous actions and microtasks to happen
7939
- _a.sent();
7940
- _a.label = 3;
7941
- case 3:
7942
- ++i;
7943
- return [3 /*break*/, 1];
7944
- case 4: return [2 /*return*/];
7945
- }
7946
- });
7947
- });
7948
- }
7949
-
7950
- /*
7951
- * Taken from https://github.com/karanlyons/murmurHash3.js/blob/a33d0723127e2e5415056c455f8aed2451ace208/murmurHash3.js
7952
- */
7953
- //
7954
- // Given two 64bit ints (as an array of two 32bit ints) returns the two
7955
- // added together as a 64bit int (as an array of two 32bit ints).
7956
- //
7957
- function x64Add(m, n) {
7958
- m = [m[0] >>> 16, m[0] & 0xffff, m[1] >>> 16, m[1] & 0xffff];
7959
- n = [n[0] >>> 16, n[0] & 0xffff, n[1] >>> 16, n[1] & 0xffff];
7960
- var o = [0, 0, 0, 0];
7961
- o[3] += m[3] + n[3];
7962
- o[2] += o[3] >>> 16;
7963
- o[3] &= 0xffff;
7964
- o[2] += m[2] + n[2];
7965
- o[1] += o[2] >>> 16;
7966
- o[2] &= 0xffff;
7967
- o[1] += m[1] + n[1];
7968
- o[0] += o[1] >>> 16;
7969
- o[1] &= 0xffff;
7970
- o[0] += m[0] + n[0];
7971
- o[0] &= 0xffff;
7972
- return [(o[0] << 16) | o[1], (o[2] << 16) | o[3]];
7973
- }
7974
- //
7975
- // Given two 64bit ints (as an array of two 32bit ints) returns the two
7976
- // multiplied together as a 64bit int (as an array of two 32bit ints).
7977
- //
7978
- function x64Multiply(m, n) {
7979
- m = [m[0] >>> 16, m[0] & 0xffff, m[1] >>> 16, m[1] & 0xffff];
7980
- n = [n[0] >>> 16, n[0] & 0xffff, n[1] >>> 16, n[1] & 0xffff];
7981
- var o = [0, 0, 0, 0];
7982
- o[3] += m[3] * n[3];
7983
- o[2] += o[3] >>> 16;
7984
- o[3] &= 0xffff;
7985
- o[2] += m[2] * n[3];
7986
- o[1] += o[2] >>> 16;
7987
- o[2] &= 0xffff;
7988
- o[2] += m[3] * n[2];
7989
- o[1] += o[2] >>> 16;
7990
- o[2] &= 0xffff;
7991
- o[1] += m[1] * n[3];
7992
- o[0] += o[1] >>> 16;
7993
- o[1] &= 0xffff;
7994
- o[1] += m[2] * n[2];
7995
- o[0] += o[1] >>> 16;
7996
- o[1] &= 0xffff;
7997
- o[1] += m[3] * n[1];
7998
- o[0] += o[1] >>> 16;
7999
- o[1] &= 0xffff;
8000
- o[0] += m[0] * n[3] + m[1] * n[2] + m[2] * n[1] + m[3] * n[0];
8001
- o[0] &= 0xffff;
8002
- return [(o[0] << 16) | o[1], (o[2] << 16) | o[3]];
8003
- }
8004
- //
8005
- // Given a 64bit int (as an array of two 32bit ints) and an int
8006
- // representing a number of bit positions, returns the 64bit int (as an
8007
- // array of two 32bit ints) rotated left by that number of positions.
8008
- //
8009
- function x64Rotl(m, n) {
8010
- n %= 64;
8011
- if (n === 32) {
8012
- return [m[1], m[0]];
8013
- }
8014
- else if (n < 32) {
8015
- return [(m[0] << n) | (m[1] >>> (32 - n)), (m[1] << n) | (m[0] >>> (32 - n))];
8016
- }
8017
- else {
8018
- n -= 32;
8019
- return [(m[1] << n) | (m[0] >>> (32 - n)), (m[0] << n) | (m[1] >>> (32 - n))];
8020
- }
8021
- }
8022
- //
8023
- // Given a 64bit int (as an array of two 32bit ints) and an int
8024
- // representing a number of bit positions, returns the 64bit int (as an
8025
- // array of two 32bit ints) shifted left by that number of positions.
8026
- //
8027
- function x64LeftShift(m, n) {
8028
- n %= 64;
8029
- if (n === 0) {
8030
- return m;
8031
- }
8032
- else if (n < 32) {
8033
- return [(m[0] << n) | (m[1] >>> (32 - n)), m[1] << n];
8034
- }
8035
- else {
8036
- return [m[1] << (n - 32), 0];
8037
- }
8038
- }
8039
- //
8040
- // Given two 64bit ints (as an array of two 32bit ints) returns the two
8041
- // xored together as a 64bit int (as an array of two 32bit ints).
8042
- //
8043
- function x64Xor(m, n) {
8044
- return [m[0] ^ n[0], m[1] ^ n[1]];
8045
- }
8046
- //
8047
- // Given a block, returns murmurHash3's final x64 mix of that block.
8048
- // (`[0, h[0] >>> 1]` is a 33 bit unsigned right shift. This is the
8049
- // only place where we need to right shift 64bit ints.)
8050
- //
8051
- function x64Fmix(h) {
8052
- h = x64Xor(h, [0, h[0] >>> 1]);
8053
- h = x64Multiply(h, [0xff51afd7, 0xed558ccd]);
8054
- h = x64Xor(h, [0, h[0] >>> 1]);
8055
- h = x64Multiply(h, [0xc4ceb9fe, 0x1a85ec53]);
8056
- h = x64Xor(h, [0, h[0] >>> 1]);
8057
- return h;
8058
- }
8059
- //
8060
- // Given a string and an optional seed as an int, returns a 128 bit
8061
- // hash using the x64 flavor of MurmurHash3, as an unsigned hex.
8062
- //
8063
- function x64hash128(key, seed) {
8064
- key = key || '';
8065
- seed = seed || 0;
8066
- var remainder = key.length % 16;
8067
- var bytes = key.length - remainder;
8068
- var h1 = [0, seed];
8069
- var h2 = [0, seed];
8070
- var k1 = [0, 0];
8071
- var k2 = [0, 0];
8072
- var c1 = [0x87c37b91, 0x114253d5];
8073
- var c2 = [0x4cf5ad43, 0x2745937f];
8074
- var i;
8075
- for (i = 0; i < bytes; i = i + 16) {
8076
- k1 = [
8077
- (key.charCodeAt(i + 4) & 0xff) |
8078
- ((key.charCodeAt(i + 5) & 0xff) << 8) |
8079
- ((key.charCodeAt(i + 6) & 0xff) << 16) |
8080
- ((key.charCodeAt(i + 7) & 0xff) << 24),
8081
- (key.charCodeAt(i) & 0xff) |
8082
- ((key.charCodeAt(i + 1) & 0xff) << 8) |
8083
- ((key.charCodeAt(i + 2) & 0xff) << 16) |
8084
- ((key.charCodeAt(i + 3) & 0xff) << 24),
8085
- ];
8086
- k2 = [
8087
- (key.charCodeAt(i + 12) & 0xff) |
8088
- ((key.charCodeAt(i + 13) & 0xff) << 8) |
8089
- ((key.charCodeAt(i + 14) & 0xff) << 16) |
8090
- ((key.charCodeAt(i + 15) & 0xff) << 24),
8091
- (key.charCodeAt(i + 8) & 0xff) |
8092
- ((key.charCodeAt(i + 9) & 0xff) << 8) |
8093
- ((key.charCodeAt(i + 10) & 0xff) << 16) |
8094
- ((key.charCodeAt(i + 11) & 0xff) << 24),
8095
- ];
8096
- k1 = x64Multiply(k1, c1);
8097
- k1 = x64Rotl(k1, 31);
8098
- k1 = x64Multiply(k1, c2);
8099
- h1 = x64Xor(h1, k1);
8100
- h1 = x64Rotl(h1, 27);
8101
- h1 = x64Add(h1, h2);
8102
- h1 = x64Add(x64Multiply(h1, [0, 5]), [0, 0x52dce729]);
8103
- k2 = x64Multiply(k2, c2);
8104
- k2 = x64Rotl(k2, 33);
8105
- k2 = x64Multiply(k2, c1);
8106
- h2 = x64Xor(h2, k2);
8107
- h2 = x64Rotl(h2, 31);
8108
- h2 = x64Add(h2, h1);
8109
- h2 = x64Add(x64Multiply(h2, [0, 5]), [0, 0x38495ab5]);
8110
- }
8111
- k1 = [0, 0];
8112
- k2 = [0, 0];
8113
- switch (remainder) {
8114
- case 15:
8115
- k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 14)], 48));
8116
- // fallthrough
8117
- case 14:
8118
- k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 13)], 40));
8119
- // fallthrough
8120
- case 13:
8121
- k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 12)], 32));
8122
- // fallthrough
8123
- case 12:
8124
- k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 11)], 24));
8125
- // fallthrough
8126
- case 11:
8127
- k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 10)], 16));
8128
- // fallthrough
8129
- case 10:
8130
- k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 9)], 8));
8131
- // fallthrough
8132
- case 9:
8133
- k2 = x64Xor(k2, [0, key.charCodeAt(i + 8)]);
8134
- k2 = x64Multiply(k2, c2);
8135
- k2 = x64Rotl(k2, 33);
8136
- k2 = x64Multiply(k2, c1);
8137
- h2 = x64Xor(h2, k2);
8138
- // fallthrough
8139
- case 8:
8140
- k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 7)], 56));
8141
- // fallthrough
8142
- case 7:
8143
- k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 6)], 48));
8144
- // fallthrough
8145
- case 6:
8146
- k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 5)], 40));
8147
- // fallthrough
8148
- case 5:
8149
- k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 4)], 32));
8150
- // fallthrough
8151
- case 4:
8152
- k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 3)], 24));
8153
- // fallthrough
8154
- case 3:
8155
- k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 2)], 16));
8156
- // fallthrough
8157
- case 2:
8158
- k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 1)], 8));
8159
- // fallthrough
8160
- case 1:
8161
- k1 = x64Xor(k1, [0, key.charCodeAt(i)]);
8162
- k1 = x64Multiply(k1, c1);
8163
- k1 = x64Rotl(k1, 31);
8164
- k1 = x64Multiply(k1, c2);
8165
- h1 = x64Xor(h1, k1);
8166
- // fallthrough
8167
- }
8168
- h1 = x64Xor(h1, [0, key.length]);
8169
- h2 = x64Xor(h2, [0, key.length]);
8170
- h1 = x64Add(h1, h2);
8171
- h2 = x64Add(h2, h1);
8172
- h1 = x64Fmix(h1);
8173
- h2 = x64Fmix(h2);
8174
- h1 = x64Add(h1, h2);
8175
- h2 = x64Add(h2, h1);
8176
- return (('00000000' + (h1[0] >>> 0).toString(16)).slice(-8) +
8177
- ('00000000' + (h1[1] >>> 0).toString(16)).slice(-8) +
8178
- ('00000000' + (h2[0] >>> 0).toString(16)).slice(-8) +
8179
- ('00000000' + (h2[1] >>> 0).toString(16)).slice(-8));
8180
- }
8181
-
8182
- /*
8183
- * This file contains functions to work with pure data only (no browser features, DOM, side effects, etc).
8184
- */
8185
- /**
8186
- * Does the same as Array.prototype.includes but has better typing
8187
- */
8188
- function includes(haystack, needle) {
8189
- for (var i = 0, l = haystack.length; i < l; ++i) {
8190
- if (haystack[i] === needle) {
8191
- return true;
8192
- }
8193
- }
8194
- return false;
8195
- }
8196
- /**
8197
- * Like `!includes()` but with proper typing
8198
- */
8199
- function excludes(haystack, needle) {
8200
- return !includes(haystack, needle);
8201
- }
8202
- /**
8203
- * Be careful, NaN can return
8204
- */
8205
- function toInt(value) {
8206
- return parseInt(value);
8207
- }
8208
- /**
8209
- * Be careful, NaN can return
8210
- */
8211
- function toFloat(value) {
8212
- return parseFloat(value);
8213
- }
8214
- function replaceNaN(value, replacement) {
8215
- return typeof value === 'number' && isNaN(value) ? replacement : value;
8216
- }
8217
- function countTruthy(values) {
8218
- return values.reduce(function (sum, value) { return sum + (value ? 1 : 0); }, 0);
8219
- }
8220
- function round(value, base) {
8221
- if (base === void 0) { base = 1; }
8222
- if (Math.abs(base) >= 1) {
8223
- return Math.round(value / base) * base;
8224
- }
8225
- else {
8226
- // Sometimes when a number is multiplied by a small number, precision is lost,
8227
- // for example 1234 * 0.0001 === 0.12340000000000001, and it's more precise divide: 1234 / (1 / 0.0001) === 0.1234.
8228
- var counterBase = 1 / base;
8229
- return Math.round(value * counterBase) / counterBase;
8230
- }
8231
- }
8232
- /**
8233
- * Parses a CSS selector into tag name with HTML attributes.
8234
- * Only single element selector are supported (without operators like space, +, >, etc).
8235
- *
8236
- * Multiple values can be returned for each attribute. You decide how to handle them.
8237
- */
8238
- function parseSimpleCssSelector(selector) {
8239
- var _a, _b;
8240
- var errorMessage = "Unexpected syntax '" + selector + "'";
8241
- var tagMatch = /^\s*([a-z-]*)(.*)$/i.exec(selector);
8242
- var tag = tagMatch[1] || undefined;
8243
- var attributes = {};
8244
- var partsRegex = /([.:#][\w-]+|\[.+?\])/gi;
8245
- var addAttribute = function (name, value) {
8246
- attributes[name] = attributes[name] || [];
8247
- attributes[name].push(value);
8248
- };
8249
- for (;;) {
8250
- var match = partsRegex.exec(tagMatch[2]);
8251
- if (!match) {
8252
- break;
8253
- }
8254
- var part = match[0];
8255
- switch (part[0]) {
8256
- case '.':
8257
- addAttribute('class', part.slice(1));
8258
- break;
8259
- case '#':
8260
- addAttribute('id', part.slice(1));
8261
- break;
8262
- case '[': {
8263
- var attributeMatch = /^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(part);
8264
- if (attributeMatch) {
8265
- addAttribute(attributeMatch[1], (_b = (_a = attributeMatch[4]) !== null && _a !== void 0 ? _a : attributeMatch[5]) !== null && _b !== void 0 ? _b : '');
8266
- }
8267
- else {
8268
- throw new Error(errorMessage);
8269
- }
8270
- break;
8271
- }
8272
- default:
8273
- throw new Error(errorMessage);
8274
- }
8275
- }
8276
- return [tag, attributes];
8277
- }
8278
-
8279
- function ensureErrorWithMessage(error) {
8280
- return error && typeof error === 'object' && 'message' in error ? error : { message: error };
8281
- }
8282
- /**
8283
- * Loads the given entropy source. Returns a function that gets an entropy component from the source.
8284
- *
8285
- * The result is returned synchronously to prevent `loadSources` from
8286
- * waiting for one source to load before getting the components from the other sources.
8287
- */
8288
- function loadSource(source, sourceOptions) {
8289
- var isFinalResultLoaded = function (loadResult) {
8290
- return typeof loadResult !== 'function';
8291
- };
8292
- var sourceLoadPromise = new Promise(function (resolveLoad) {
8293
- var loadStartTime = Date.now();
8294
- // `awaitIfAsync` is used instead of just `await` in order to measure the duration of synchronous sources
8295
- // correctly (other microtasks won't affect the duration).
8296
- awaitIfAsync(source.bind(null, sourceOptions), function () {
8297
- var loadArgs = [];
8298
- for (var _i = 0; _i < arguments.length; _i++) {
8299
- loadArgs[_i] = arguments[_i];
8300
- }
8301
- var loadDuration = Date.now() - loadStartTime;
8302
- // Source loading failed
8303
- if (!loadArgs[0]) {
8304
- return resolveLoad(function () { return ({ error: ensureErrorWithMessage(loadArgs[1]), duration: loadDuration }); });
8305
- }
8306
- var loadResult = loadArgs[1];
8307
- // Source loaded with the final result
8308
- if (isFinalResultLoaded(loadResult)) {
8309
- return resolveLoad(function () { return ({ value: loadResult, duration: loadDuration }); });
8310
- }
8311
- // Source loaded with "get" stage
8312
- resolveLoad(function () {
8313
- return new Promise(function (resolveGet) {
8314
- var getStartTime = Date.now();
8315
- awaitIfAsync(loadResult, function () {
8316
- var getArgs = [];
8317
- for (var _i = 0; _i < arguments.length; _i++) {
8318
- getArgs[_i] = arguments[_i];
8319
- }
8320
- var duration = loadDuration + Date.now() - getStartTime;
8321
- // Source getting failed
8322
- if (!getArgs[0]) {
8323
- return resolveGet({ error: ensureErrorWithMessage(getArgs[1]), duration: duration });
8324
- }
8325
- // Source getting succeeded
8326
- resolveGet({ value: getArgs[1], duration: duration });
8327
- });
8328
- });
8329
- });
8330
- });
8331
- });
8332
- return function getComponent() {
8333
- return sourceLoadPromise.then(function (finalizeSource) { return finalizeSource(); });
8334
- };
8335
- }
8336
- /**
8337
- * Loads the given entropy sources. Returns a function that collects the entropy components.
8338
- *
8339
- * The result is returned synchronously in order to allow start getting the components
8340
- * before the sources are loaded completely.
8341
- *
8342
- * Warning for package users:
8343
- * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
8344
- */
8345
- function loadSources(sources, sourceOptions, excludeSources) {
8346
- var includedSources = Object.keys(sources).filter(function (sourceKey) { return excludes(excludeSources, sourceKey); });
8347
- var sourceGetters = Array(includedSources.length);
8348
- // Using `forEachWithBreaks` allows asynchronous sources to complete between synchronous sources
8349
- // and measure the duration correctly
8350
- forEachWithBreaks(includedSources, function (sourceKey, index) {
8351
- sourceGetters[index] = loadSource(sources[sourceKey], sourceOptions);
8352
- });
8353
- return function getComponents() {
8354
- return __awaiter(this, void 0, void 0, function () {
8355
- var components, _i, includedSources_1, sourceKey, componentPromises, _loop_1, state_1;
8356
- return __generator(this, function (_a) {
8357
- switch (_a.label) {
8358
- case 0:
8359
- components = {};
8360
- for (_i = 0, includedSources_1 = includedSources; _i < includedSources_1.length; _i++) {
8361
- sourceKey = includedSources_1[_i];
8362
- components[sourceKey] = undefined;
8363
- }
8364
- componentPromises = Array(includedSources.length);
8365
- _loop_1 = function () {
8366
- var hasAllComponentPromises;
8367
- return __generator(this, function (_a) {
8368
- switch (_a.label) {
8369
- case 0:
8370
- hasAllComponentPromises = true;
8371
- return [4 /*yield*/, forEachWithBreaks(includedSources, function (sourceKey, index) {
8372
- if (!componentPromises[index]) {
8373
- // `sourceGetters` may be incomplete at this point of execution because `forEachWithBreaks` is asynchronous
8374
- if (sourceGetters[index]) {
8375
- componentPromises[index] = sourceGetters[index]().then(function (component) { return (components[sourceKey] = component); });
8376
- }
8377
- else {
8378
- hasAllComponentPromises = false;
8379
- }
8380
- }
8381
- })];
8382
- case 1:
8383
- _a.sent();
8384
- if (hasAllComponentPromises) {
8385
- return [2 /*return*/, "break"];
8386
- }
8387
- return [4 /*yield*/, wait(1)]; // Lets the source load loop continue
8388
- case 2:
8389
- _a.sent(); // Lets the source load loop continue
8390
- return [2 /*return*/];
8391
- }
8392
- });
8393
- };
8394
- _a.label = 1;
8395
- case 1: return [5 /*yield**/, _loop_1()];
8396
- case 2:
8397
- state_1 = _a.sent();
8398
- if (state_1 === "break")
8399
- return [3 /*break*/, 4];
8400
- _a.label = 3;
8401
- case 3: return [3 /*break*/, 1];
8402
- case 4: return [4 /*yield*/, Promise.all(componentPromises)];
8403
- case 5:
8404
- _a.sent();
8405
- return [2 /*return*/, components];
8406
- }
8407
- });
8408
- });
8409
- };
8410
- }
8411
-
8412
- /*
8413
- * Functions to help with features that vary through browsers
8414
- */
8415
- /**
8416
- * Checks whether the browser is based on Trident (the Internet Explorer engine) without using user-agent.
8417
- *
8418
- * Warning for package users:
8419
- * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
8420
- */
8421
- function isTrident() {
8422
- var w = window;
8423
- var n = navigator;
8424
- // The properties are checked to be in IE 10, IE 11 and not to be in other browsers in October 2020
8425
- return (countTruthy([
8426
- 'MSCSSMatrix' in w,
8427
- 'msSetImmediate' in w,
8428
- 'msIndexedDB' in w,
8429
- 'msMaxTouchPoints' in n,
8430
- 'msPointerEnabled' in n,
8431
- ]) >= 4);
8432
- }
8433
- /**
8434
- * Checks whether the browser is based on EdgeHTML (the pre-Chromium Edge engine) without using user-agent.
8435
- *
8436
- * Warning for package users:
8437
- * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
8438
- */
8439
- function isEdgeHTML() {
8440
- // Based on research in October 2020
8441
- var w = window;
8442
- var n = navigator;
8443
- return (countTruthy(['msWriteProfilerMark' in w, 'MSStream' in w, 'msLaunchUri' in n, 'msSaveBlob' in n]) >= 3 &&
8444
- !isTrident());
8445
- }
8446
- /**
8447
- * Checks whether the browser is based on Chromium without using user-agent.
8448
- *
8449
- * Warning for package users:
8450
- * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
8451
- */
8452
- function isChromium() {
8453
- // Based on research in October 2020. Tested to detect Chromium 42-86.
8454
- var w = window;
8455
- var n = navigator;
8456
- return (countTruthy([
8457
- 'webkitPersistentStorage' in n,
8458
- 'webkitTemporaryStorage' in n,
8459
- n.vendor.indexOf('Google') === 0,
8460
- 'webkitResolveLocalFileSystemURL' in w,
8461
- 'BatteryManager' in w,
8462
- 'webkitMediaStream' in w,
8463
- 'webkitSpeechGrammar' in w,
8464
- ]) >= 5);
8465
- }
8466
- /**
8467
- * Checks whether the browser is based on mobile or desktop Safari without using user-agent.
8468
- * All iOS browsers use WebKit (the Safari engine).
8469
- *
8470
- * Warning for package users:
8471
- * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
8472
- */
8473
- function isWebKit() {
8474
- // Based on research in September 2020
8475
- var w = window;
8476
- var n = navigator;
8477
- return (countTruthy([
8478
- 'ApplePayError' in w,
8479
- 'CSSPrimitiveValue' in w,
8480
- 'Counter' in w,
8481
- n.vendor.indexOf('Apple') === 0,
8482
- 'getStorageUpdates' in n,
8483
- 'WebKitMediaKeys' in w,
8484
- ]) >= 4);
8485
- }
8486
- /**
8487
- * Checks whether the WebKit browser is a desktop Safari.
8488
- *
8489
- * Warning for package users:
8490
- * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
8491
- */
8492
- function isDesktopSafari() {
8493
- var w = window;
8494
- return (countTruthy([
8495
- 'safari' in w,
8496
- !('DeviceMotionEvent' in w),
8497
- !('ongestureend' in w),
8498
- !('standalone' in navigator),
8499
- ]) >= 3);
8500
- }
8501
- /**
8502
- * Checks whether the browser is based on Gecko (Firefox engine) without using user-agent.
8503
- *
8504
- * Warning for package users:
8505
- * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
8506
- */
8507
- function isGecko() {
8508
- var _a, _b;
8509
- var w = window;
8510
- // Based on research in September 2020
8511
- return (countTruthy([
8512
- 'buildID' in navigator,
8513
- 'MozAppearance' in ((_b = (_a = document.documentElement) === null || _a === void 0 ? void 0 : _a.style) !== null && _b !== void 0 ? _b : {}),
8514
- 'onmozfullscreenchange' in w,
8515
- 'mozInnerScreenX' in w,
8516
- 'CSSMozDocumentRule' in w,
8517
- 'CanvasCaptureMediaStream' in w,
8518
- ]) >= 4);
8519
- }
8520
- /**
8521
- * Checks whether the browser is based on Chromium version ≥86 without using user-agent.
8522
- * It doesn't check that the browser is based on Chromium, there is a separate function for this.
8523
- */
8524
- function isChromium86OrNewer() {
8525
- // Checked in Chrome 85 vs Chrome 86 both on desktop and Android
8526
- var w = window;
8527
- return (countTruthy([
8528
- !('MediaSettingsRange' in w),
8529
- 'RTCEncodedAudioFrame' in w,
8530
- '' + w.Intl === '[object Intl]',
8531
- '' + w.Reflect === '[object Reflect]',
8532
- ]) >= 3);
8533
- }
8534
- /**
8535
- * Checks whether the browser is based on WebKit version ≥606 (Safari ≥12) without using user-agent.
8536
- * It doesn't check that the browser is based on WebKit, there is a separate function for this.
8537
- *
8538
- * @link https://en.wikipedia.org/wiki/Safari_version_history#Release_history Safari-WebKit versions map
8539
- */
8540
- function isWebKit606OrNewer() {
8541
- // Checked in Safari 9–14
8542
- var w = window;
8543
- return (countTruthy([
8544
- 'DOMRectList' in w,
8545
- 'RTCPeerConnectionIceEvent' in w,
8546
- 'SVGGeometryElement' in w,
8547
- 'ontransitioncancel' in w,
8548
- ]) >= 3);
8549
- }
8550
- /**
8551
- * Checks whether the device is an iPad.
8552
- * It doesn't check that the engine is WebKit and that the WebKit isn't desktop.
8553
- */
8554
- function isIPad() {
8555
- // Checked on:
8556
- // Safari on iPadOS (both mobile and desktop modes): 8, 11, 12, 13, 14
8557
- // Chrome on iPadOS (both mobile and desktop modes): 11, 12, 13, 14
8558
- // Safari on iOS (both mobile and desktop modes): 9, 10, 11, 12, 13, 14
8559
- // Chrome on iOS (both mobile and desktop modes): 9, 10, 11, 12, 13, 14
8560
- // Before iOS 13. Safari tampers the value in "request desktop site" mode since iOS 13.
8561
- if (navigator.platform === 'iPad') {
8562
- return true;
8563
- }
8564
- var s = screen;
8565
- var screenRatio = s.width / s.height;
8566
- return (countTruthy([
8567
- 'MediaSource' in window,
8568
- !!Element.prototype.webkitRequestFullscreen,
8569
- // iPhone 4S that runs iOS 9 matches this. But it won't match the criteria above, so it won't be detected as iPad.
8570
- screenRatio > 0.65 && screenRatio < 1.53,
8571
- ]) >= 2);
8572
- }
8573
- /**
8574
- * Warning for package users:
8575
- * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
8576
- */
8577
- function getFullscreenElement() {
8578
- var d = document;
8579
- return d.fullscreenElement || d.msFullscreenElement || d.mozFullScreenElement || d.webkitFullscreenElement || null;
8580
- }
8581
- function exitFullscreen() {
8582
- var d = document;
8583
- // `call` is required because the function throws an error without a proper "this" context
8584
- return (d.exitFullscreen || d.msExitFullscreen || d.mozCancelFullScreen || d.webkitExitFullscreen).call(d);
8585
- }
8586
- /**
8587
- * Checks whether the device runs on Android without using user-agent.
8588
- *
8589
- * Warning for package users:
8590
- * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
8591
- */
8592
- function isAndroid() {
8593
- var isItChromium = isChromium();
8594
- var isItGecko = isGecko();
8595
- // Only 2 browser engines are presented on Android.
8596
- // Actually, there is also Android 4.1 browser, but it's not worth detecting it at the moment.
8597
- if (!isItChromium && !isItGecko) {
8598
- return false;
8599
- }
8600
- var w = window;
8601
- // Chrome removes all words "Android" from `navigator` when desktop version is requested
8602
- // Firefox keeps "Android" in `navigator.appVersion` when desktop version is requested
8603
- return (countTruthy([
8604
- 'onorientationchange' in w,
8605
- 'orientation' in w,
8606
- isItChromium && !('SharedWorker' in w),
8607
- isItGecko && /android/i.test(navigator.appVersion),
8608
- ]) >= 2);
8609
- }
8610
-
8611
- /**
8612
- * A deep description: https://fingerprintjs.com/blog/audio-fingerprinting/
8613
- * Inspired by and based on https://github.com/cozylife/audio-fingerprint
8614
- */
8615
- function getAudioFingerprint() {
8616
- var w = window;
8617
- var AudioContext = w.OfflineAudioContext || w.webkitOfflineAudioContext;
8618
- if (!AudioContext) {
8619
- return -2 /* NotSupported */;
8620
- }
8621
- // In some browsers, audio context always stays suspended unless the context is started in response to a user action
8622
- // (e.g. a click or a tap). It prevents audio fingerprint from being taken at an arbitrary moment of time.
8623
- // Such browsers are old and unpopular, so the audio fingerprinting is just skipped in them.
8624
- // See a similar case explanation at https://stackoverflow.com/questions/46363048/onaudioprocess-not-called-on-ios11#46534088
8625
- if (doesCurrentBrowserSuspendAudioContext()) {
8626
- return -1 /* KnownToSuspend */;
8627
- }
8628
- var hashFromIndex = 4500;
8629
- var hashToIndex = 5000;
8630
- var context = new AudioContext(1, hashToIndex, 44100);
8631
- var oscillator = context.createOscillator();
8632
- oscillator.type = 'triangle';
8633
- oscillator.frequency.value = 10000;
8634
- var compressor = context.createDynamicsCompressor();
8635
- compressor.threshold.value = -50;
8636
- compressor.knee.value = 40;
8637
- compressor.ratio.value = 12;
8638
- compressor.attack.value = 0;
8639
- compressor.release.value = 0.25;
8640
- oscillator.connect(compressor);
8641
- compressor.connect(context.destination);
8642
- oscillator.start(0);
8643
- var _a = startRenderingAudio(context), renderPromise = _a[0], finishRendering = _a[1];
8644
- var fingerprintPromise = renderPromise.then(function (buffer) { return getHash(buffer.getChannelData(0).subarray(hashFromIndex)); }, function (error) {
8645
- if (error.name === "timeout" /* Timeout */ || error.name === "suspended" /* Suspended */) {
8646
- return -3 /* Timeout */;
8647
- }
8648
- throw error;
8649
- });
8650
- // Suppresses the console error message in case when the fingerprint fails before requested
8651
- fingerprintPromise.catch(function () { return undefined; });
8652
- return function () {
8653
- finishRendering();
8654
- return fingerprintPromise;
8655
- };
8656
- }
8657
- /**
8658
- * Checks if the current browser is known to always suspend audio context
8659
- */
8660
- function doesCurrentBrowserSuspendAudioContext() {
8661
- return isWebKit() && !isDesktopSafari() && !isWebKit606OrNewer();
8662
- }
8663
- /**
8664
- * Starts rendering the audio context.
8665
- * When the returned function is called, the render process starts finishing.
8666
- */
8667
- function startRenderingAudio(context) {
8668
- var renderTryMaxCount = 3;
8669
- var renderRetryDelay = 500;
8670
- var runningMaxAwaitTime = 500;
8671
- var runningSufficientTime = 5000;
8672
- var finalize = function () { return undefined; };
8673
- var resultPromise = new Promise(function (resolve, reject) {
8674
- var isFinalized = false;
8675
- var renderTryCount = 0;
8676
- var startedRunningAt = 0;
8677
- context.oncomplete = function (event) { return resolve(event.renderedBuffer); };
8678
- var startRunningTimeout = function () {
8679
- setTimeout(function () { return reject(makeInnerError("timeout" /* Timeout */)); }, Math.min(runningMaxAwaitTime, startedRunningAt + runningSufficientTime - Date.now()));
8680
- };
8681
- var tryRender = function () {
8682
- try {
8683
- context.startRendering();
8684
- switch (context.state) {
8685
- case 'running':
8686
- startedRunningAt = Date.now();
8687
- if (isFinalized) {
8688
- startRunningTimeout();
8689
- }
8690
- break;
8691
- // Sometimes the audio context doesn't start after calling `startRendering` (in addition to the cases where
8692
- // audio context doesn't start at all). A known case is starting an audio context when the browser tab is in
8693
- // background on iPhone. Retries usually help in this case.
8694
- case 'suspended':
8695
- // The audio context can reject starting until the tab is in foreground. Long fingerprint duration
8696
- // in background isn't a problem, therefore the retry attempts don't count in background. It can lead to
8697
- // a situation when a fingerprint takes very long time and finishes successfully. FYI, the audio context
8698
- // can be suspended when `document.hidden === false` and start running after a retry.
8699
- if (!document.hidden) {
8700
- renderTryCount++;
8701
- }
8702
- if (isFinalized && renderTryCount >= renderTryMaxCount) {
8703
- reject(makeInnerError("suspended" /* Suspended */));
8704
- }
8705
- else {
8706
- setTimeout(tryRender, renderRetryDelay);
8707
- }
8708
- break;
8709
- }
8710
- }
8711
- catch (error) {
8712
- reject(error);
8713
- }
8714
- };
8715
- tryRender();
8716
- finalize = function () {
8717
- if (!isFinalized) {
8718
- isFinalized = true;
8719
- if (startedRunningAt > 0) {
8720
- startRunningTimeout();
8721
- }
8722
- }
8723
- };
8724
- });
8725
- return [resultPromise, finalize];
8726
- }
8727
- function getHash(signal) {
8728
- var hash = 0;
8729
- for (var i = 0; i < signal.length; ++i) {
8730
- hash += Math.abs(signal[i]);
8731
- }
8732
- return hash;
8733
- }
8734
- function makeInnerError(name) {
8735
- var error = new Error(name);
8736
- error.name = name;
8737
- return error;
8738
- }
8739
-
8740
- /**
8741
- * Creates and keeps an invisible iframe while the given function runs.
8742
- * The given function is called when the iframe is loaded and has a body.
8743
- * The iframe allows to measure DOM sizes inside itself.
8744
- *
8745
- * Notice: passing an initial HTML code doesn't work in IE.
8746
- *
8747
- * Warning for package users:
8748
- * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
8749
- */
8750
- function withIframe(action, initialHtml, domPollInterval) {
8751
- var _a, _b, _c;
8752
- if (domPollInterval === void 0) { domPollInterval = 50; }
8753
- return __awaiter(this, void 0, void 0, function () {
8754
- var d, iframe;
8755
- return __generator(this, function (_d) {
8756
- switch (_d.label) {
8757
- case 0:
8758
- d = document;
8759
- _d.label = 1;
8760
- case 1:
8761
- if (!!d.body) return [3 /*break*/, 3];
8762
- return [4 /*yield*/, wait(domPollInterval)];
8763
- case 2:
8764
- _d.sent();
8765
- return [3 /*break*/, 1];
8766
- case 3:
8767
- iframe = d.createElement('iframe');
8768
- _d.label = 4;
8769
- case 4:
8770
- _d.trys.push([4, , 10, 11]);
8771
- return [4 /*yield*/, new Promise(function (_resolve, _reject) {
8772
- var isComplete = false;
8773
- var resolve = function () {
8774
- isComplete = true;
8775
- _resolve();
8776
- };
8777
- var reject = function (error) {
8778
- isComplete = true;
8779
- _reject(error);
8780
- };
8781
- iframe.onload = resolve;
8782
- iframe.onerror = reject;
8783
- var style = iframe.style;
8784
- style.setProperty('display', 'block', 'important'); // Required for browsers to calculate the layout
8785
- style.position = 'absolute';
8786
- style.top = '0';
8787
- style.left = '0';
8788
- style.visibility = 'hidden';
8789
- if (initialHtml && 'srcdoc' in iframe) {
8790
- iframe.srcdoc = initialHtml;
8791
- }
8792
- else {
8793
- iframe.src = 'about:blank';
8794
- }
8795
- d.body.appendChild(iframe);
8796
- // WebKit in WeChat doesn't fire the iframe's `onload` for some reason.
8797
- // This code checks for the loading state manually.
8798
- // See https://github.com/fingerprintjs/fingerprintjs/issues/645
8799
- var checkReadyState = function () {
8800
- var _a, _b;
8801
- // The ready state may never become 'complete' in Firefox despite the 'load' event being fired.
8802
- // So an infinite setTimeout loop can happen without this check.
8803
- // See https://github.com/fingerprintjs/fingerprintjs/pull/716#issuecomment-986898796
8804
- if (isComplete) {
8805
- return;
8806
- }
8807
- // Make sure iframe.contentWindow and iframe.contentWindow.document are both loaded
8808
- // The contentWindow.document can miss in JSDOM (https://github.com/jsdom/jsdom).
8809
- if (((_b = (_a = iframe.contentWindow) === null || _a === void 0 ? void 0 : _a.document) === null || _b === void 0 ? void 0 : _b.readyState) === 'complete') {
8810
- resolve();
8811
- }
8812
- else {
8813
- setTimeout(checkReadyState, 10);
8814
- }
8815
- };
8816
- checkReadyState();
8817
- })];
8818
- case 5:
8819
- _d.sent();
8820
- _d.label = 6;
8821
- case 6:
8822
- if (!!((_b = (_a = iframe.contentWindow) === null || _a === void 0 ? void 0 : _a.document) === null || _b === void 0 ? void 0 : _b.body)) return [3 /*break*/, 8];
8823
- return [4 /*yield*/, wait(domPollInterval)];
8824
- case 7:
8825
- _d.sent();
8826
- return [3 /*break*/, 6];
8827
- case 8: return [4 /*yield*/, action(iframe, iframe.contentWindow)];
8828
- case 9: return [2 /*return*/, _d.sent()];
8829
- case 10:
8830
- (_c = iframe.parentNode) === null || _c === void 0 ? void 0 : _c.removeChild(iframe);
8831
- return [7 /*endfinally*/];
8832
- case 11: return [2 /*return*/];
8833
- }
8834
- });
8835
- });
8836
- }
8837
- /**
8838
- * Creates a DOM element that matches the given selector.
8839
- * Only single element selector are supported (without operators like space, +, >, etc).
8840
- */
8841
- function selectorToElement(selector) {
8842
- var _a = parseSimpleCssSelector(selector), tag = _a[0], attributes = _a[1];
8843
- var element = document.createElement(tag !== null && tag !== void 0 ? tag : 'div');
8844
- for (var _i = 0, _b = Object.keys(attributes); _i < _b.length; _i++) {
8845
- var name_1 = _b[_i];
8846
- var value = attributes[name_1].join(' ');
8847
- // Changing the `style` attribute can cause a CSP error, therefore we change the `style.cssText` property.
8848
- // https://github.com/fingerprintjs/fingerprintjs/issues/733
8849
- if (name_1 === 'style') {
8850
- addStyleString(element.style, value);
8851
- }
8852
- else {
8853
- element.setAttribute(name_1, value);
8854
- }
8855
- }
8856
- return element;
8857
- }
8858
- /**
8859
- * Adds CSS styles from a string in such a way that doesn't trigger a CSP warning (unsafe-inline or unsafe-eval)
8860
- */
8861
- function addStyleString(style, source) {
8862
- // We don't use `style.cssText` because browsers must block it when no `unsafe-eval` CSP is presented: https://csplite.com/csp145/#w3c_note
8863
- // Even though the browsers ignore this standard, we don't use `cssText` just in case.
8864
- for (var _i = 0, _a = source.split(';'); _i < _a.length; _i++) {
8865
- var property = _a[_i];
8866
- var match = /^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(property);
8867
- if (match) {
8868
- var name_2 = match[1], value = match[2], priority = match[4];
8869
- style.setProperty(name_2, value, priority || ''); // The last argument can't be undefined in IE11
8870
- }
8871
- }
8872
- }
8873
-
8874
- // We use m or w because these two characters take up the maximum width.
8875
- // And we use a LLi so that the same matching fonts can get separated.
8876
- var testString = 'mmMwWLliI0O&1';
8877
- // We test using 48px font size, we may use any size. I guess larger the better.
8878
- var textSize = '48px';
8879
- // A font will be compared against all the three default fonts.
8880
- // And if for any default fonts it doesn't match, then that font is available.
8881
- var baseFonts = ['monospace', 'sans-serif', 'serif'];
8882
- var fontList = [
8883
- // This is android-specific font from "Roboto" family
8884
- 'sans-serif-thin',
8885
- 'ARNO PRO',
8886
- 'Agency FB',
8887
- 'Arabic Typesetting',
8888
- 'Arial Unicode MS',
8889
- 'AvantGarde Bk BT',
8890
- 'BankGothic Md BT',
8891
- 'Batang',
8892
- 'Bitstream Vera Sans Mono',
8893
- 'Calibri',
8894
- 'Century',
8895
- 'Century Gothic',
8896
- 'Clarendon',
8897
- 'EUROSTILE',
8898
- 'Franklin Gothic',
8899
- 'Futura Bk BT',
8900
- 'Futura Md BT',
8901
- 'GOTHAM',
8902
- 'Gill Sans',
8903
- 'HELV',
8904
- 'Haettenschweiler',
8905
- 'Helvetica Neue',
8906
- 'Humanst521 BT',
8907
- 'Leelawadee',
8908
- 'Letter Gothic',
8909
- 'Levenim MT',
8910
- 'Lucida Bright',
8911
- 'Lucida Sans',
8912
- 'Menlo',
8913
- 'MS Mincho',
8914
- 'MS Outlook',
8915
- 'MS Reference Specialty',
8916
- 'MS UI Gothic',
8917
- 'MT Extra',
8918
- 'MYRIAD PRO',
8919
- 'Marlett',
8920
- 'Meiryo UI',
8921
- 'Microsoft Uighur',
8922
- 'Minion Pro',
8923
- 'Monotype Corsiva',
8924
- 'PMingLiU',
8925
- 'Pristina',
8926
- 'SCRIPTINA',
8927
- 'Segoe UI Light',
8928
- 'Serifa',
8929
- 'SimHei',
8930
- 'Small Fonts',
8931
- 'Staccato222 BT',
8932
- 'TRAJAN PRO',
8933
- 'Univers CE 55 Medium',
8934
- 'Vrinda',
8935
- 'ZWAdobeF',
8936
- ];
8937
- // kudos to http://www.lalit.org/lab/javascript-css-font-detect/
8938
- function getFonts() {
8939
- // Running the script in an iframe makes it not affect the page look and not be affected by the page CSS. See:
8940
- // https://github.com/fingerprintjs/fingerprintjs/issues/592
8941
- // https://github.com/fingerprintjs/fingerprintjs/issues/628
8942
- return withIframe(function (_, _a) {
8943
- var document = _a.document;
8944
- var holder = document.body;
8945
- holder.style.fontSize = textSize;
8946
- // div to load spans for the default fonts and the fonts to detect
8947
- var spansContainer = document.createElement('div');
8948
- var defaultWidth = {};
8949
- var defaultHeight = {};
8950
- // creates a span where the fonts will be loaded
8951
- var createSpan = function (fontFamily) {
8952
- var span = document.createElement('span');
8953
- var style = span.style;
8954
- style.position = 'absolute';
8955
- style.top = '0';
8956
- style.left = '0';
8957
- style.fontFamily = fontFamily;
8958
- span.textContent = testString;
8959
- spansContainer.appendChild(span);
8960
- return span;
8961
- };
8962
- // creates a span and load the font to detect and a base font for fallback
8963
- var createSpanWithFonts = function (fontToDetect, baseFont) {
8964
- return createSpan("'" + fontToDetect + "'," + baseFont);
8965
- };
8966
- // creates spans for the base fonts and adds them to baseFontsDiv
8967
- var initializeBaseFontsSpans = function () {
8968
- return baseFonts.map(createSpan);
8969
- };
8970
- // creates spans for the fonts to detect and adds them to fontsDiv
8971
- var initializeFontsSpans = function () {
8972
- // Stores {fontName : [spans for that font]}
8973
- var spans = {};
8974
- var _loop_1 = function (font) {
8975
- spans[font] = baseFonts.map(function (baseFont) { return createSpanWithFonts(font, baseFont); });
8976
- };
8977
- for (var _i = 0, fontList_1 = fontList; _i < fontList_1.length; _i++) {
8978
- var font = fontList_1[_i];
8979
- _loop_1(font);
8980
- }
8981
- return spans;
8982
- };
8983
- // checks if a font is available
8984
- var isFontAvailable = function (fontSpans) {
8985
- return baseFonts.some(function (baseFont, baseFontIndex) {
8986
- return fontSpans[baseFontIndex].offsetWidth !== defaultWidth[baseFont] ||
8987
- fontSpans[baseFontIndex].offsetHeight !== defaultHeight[baseFont];
8988
- });
8989
- };
8990
- // create spans for base fonts
8991
- var baseFontsSpans = initializeBaseFontsSpans();
8992
- // create spans for fonts to detect
8993
- var fontsSpans = initializeFontsSpans();
8994
- // add all the spans to the DOM
8995
- holder.appendChild(spansContainer);
8996
- // get the default width for the three base fonts
8997
- for (var index = 0; index < baseFonts.length; index++) {
8998
- defaultWidth[baseFonts[index]] = baseFontsSpans[index].offsetWidth; // width for the default font
8999
- defaultHeight[baseFonts[index]] = baseFontsSpans[index].offsetHeight; // height for the default font
9000
- }
9001
- // check available fonts
9002
- return fontList.filter(function (font) { return isFontAvailable(fontsSpans[font]); });
9003
- });
9004
- }
9005
-
9006
- function getPlugins() {
9007
- var rawPlugins = navigator.plugins;
9008
- if (!rawPlugins) {
9009
- return undefined;
9010
- }
9011
- var plugins = [];
9012
- // Safari 10 doesn't support iterating navigator.plugins with for...of
9013
- for (var i = 0; i < rawPlugins.length; ++i) {
9014
- var plugin = rawPlugins[i];
9015
- if (!plugin) {
9016
- continue;
9017
- }
9018
- var mimeTypes = [];
9019
- for (var j = 0; j < plugin.length; ++j) {
9020
- var mimeType = plugin[j];
9021
- mimeTypes.push({
9022
- type: mimeType.type,
9023
- suffixes: mimeType.suffixes,
9024
- });
9025
- }
9026
- plugins.push({
9027
- name: plugin.name,
9028
- description: plugin.description,
9029
- mimeTypes: mimeTypes,
9030
- });
9031
- }
9032
- return plugins;
9033
- }
9034
-
9035
- // https://www.browserleaks.com/canvas#how-does-it-work
9036
- function getCanvasFingerprint() {
9037
- var _a = makeCanvasContext(), canvas = _a[0], context = _a[1];
9038
- if (!isSupported(canvas, context)) {
9039
- return { winding: false, geometry: '', text: '' };
9040
- }
9041
- return {
9042
- winding: doesSupportWinding(context),
9043
- geometry: makeGeometryImage(canvas, context),
9044
- // Text is unstable:
9045
- // https://github.com/fingerprintjs/fingerprintjs/issues/583
9046
- // https://github.com/fingerprintjs/fingerprintjs/issues/103
9047
- // Therefore it's extracted into a separate image.
9048
- text: makeTextImage(canvas, context),
9049
- };
9050
- }
9051
- function makeCanvasContext() {
9052
- var canvas = document.createElement('canvas');
9053
- canvas.width = 1;
9054
- canvas.height = 1;
9055
- return [canvas, canvas.getContext('2d')];
9056
- }
9057
- function isSupported(canvas, context) {
9058
- // TODO: look into: https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob
9059
- return !!(context && canvas.toDataURL);
9060
- }
9061
- function doesSupportWinding(context) {
9062
- // https://web.archive.org/web/20170825024655/http://blogs.adobe.com/webplatform/2013/01/30/winding-rules-in-canvas/
9063
- // https://github.com/Modernizr/Modernizr/blob/master/feature-detects/canvas/winding.js
9064
- context.rect(0, 0, 10, 10);
9065
- context.rect(2, 2, 6, 6);
9066
- return !context.isPointInPath(5, 5, 'evenodd');
9067
- }
9068
- function makeTextImage(canvas, context) {
9069
- // Resizing the canvas cleans it
9070
- canvas.width = 240;
9071
- canvas.height = 60;
9072
- context.textBaseline = 'alphabetic';
9073
- context.fillStyle = '#f60';
9074
- context.fillRect(100, 1, 62, 20);
9075
- context.fillStyle = '#069';
9076
- // It's important to use explicit built-in fonts in order to exclude the affect of font preferences
9077
- // (there is a separate entropy source for them).
9078
- context.font = '11pt "Times New Roman"';
9079
- // The choice of emojis has a gigantic impact on rendering performance (especially in FF).
9080
- // Some newer emojis cause it to slow down 50-200 times.
9081
- // There must be no text to the right of the emoji, see https://github.com/fingerprintjs/fingerprintjs/issues/574
9082
- // A bare emoji shouldn't be used because the canvas will change depending on the script encoding:
9083
- // https://github.com/fingerprintjs/fingerprintjs/issues/66
9084
- // Escape sequence shouldn't be used too because Terser will turn it into a bare unicode.
9085
- var printedText = "Cwm fjordbank gly " + String.fromCharCode(55357, 56835) /* 😃 */;
9086
- context.fillText(printedText, 2, 15);
9087
- context.fillStyle = 'rgba(102, 204, 0, 0.2)';
9088
- context.font = '18pt Arial';
9089
- context.fillText(printedText, 4, 45);
9090
- return save(canvas);
9091
- }
9092
- function makeGeometryImage(canvas, context) {
9093
- // Resizing the canvas cleans it
9094
- canvas.width = 122;
9095
- canvas.height = 110;
9096
- // Canvas blending
9097
- // https://web.archive.org/web/20170826194121/http://blogs.adobe.com/webplatform/2013/01/28/blending-features-in-canvas/
9098
- // http://jsfiddle.net/NDYV8/16/
9099
- context.globalCompositeOperation = 'multiply';
9100
- for (var _i = 0, _a = [
9101
- ['#f2f', 40, 40],
9102
- ['#2ff', 80, 40],
9103
- ['#ff2', 60, 80],
9104
- ]; _i < _a.length; _i++) {
9105
- var _b = _a[_i], color = _b[0], x = _b[1], y = _b[2];
9106
- context.fillStyle = color;
9107
- context.beginPath();
9108
- context.arc(x, y, 40, 0, Math.PI * 2, true);
9109
- context.closePath();
9110
- context.fill();
9111
- }
9112
- // Canvas winding
9113
- // https://web.archive.org/web/20130913061632/http://blogs.adobe.com/webplatform/2013/01/30/winding-rules-in-canvas/
9114
- // http://jsfiddle.net/NDYV8/19/
9115
- context.fillStyle = '#f9c';
9116
- context.arc(60, 60, 60, 0, Math.PI * 2, true);
9117
- context.arc(60, 60, 20, 0, Math.PI * 2, true);
9118
- context.fill('evenodd');
9119
- return save(canvas);
9120
- }
9121
- function save(canvas) {
9122
- // TODO: look into: https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob
9123
- return canvas.toDataURL();
9124
- }
9125
-
9126
- /**
9127
- * This is a crude and primitive touch screen detection. It's not possible to currently reliably detect the availability
9128
- * of a touch screen with a JS, without actually subscribing to a touch event.
9129
- *
9130
- * @see http://www.stucox.com/blog/you-cant-detect-a-touchscreen/
9131
- * @see https://github.com/Modernizr/Modernizr/issues/548
9132
- */
9133
- function getTouchSupport() {
9134
- var n = navigator;
9135
- var maxTouchPoints = 0;
9136
- var touchEvent;
9137
- if (n.maxTouchPoints !== undefined) {
9138
- maxTouchPoints = toInt(n.maxTouchPoints);
9139
- }
9140
- else if (n.msMaxTouchPoints !== undefined) {
9141
- maxTouchPoints = n.msMaxTouchPoints;
9142
- }
9143
- try {
9144
- document.createEvent('TouchEvent');
9145
- touchEvent = true;
9146
- }
9147
- catch (_a) {
9148
- touchEvent = false;
9149
- }
9150
- var touchStart = 'ontouchstart' in window;
9151
- return {
9152
- maxTouchPoints: maxTouchPoints,
9153
- touchEvent: touchEvent,
9154
- touchStart: touchStart,
9155
- };
9156
- }
9157
-
9158
- function getOsCpu() {
9159
- return navigator.oscpu;
9160
- }
9161
-
9162
- function getLanguages() {
9163
- var n = navigator;
9164
- var result = [];
9165
- var language = n.language || n.userLanguage || n.browserLanguage || n.systemLanguage;
9166
- if (language !== undefined) {
9167
- result.push([language]);
9168
- }
9169
- if (Array.isArray(n.languages)) {
9170
- // Starting from Chromium 86, there is only a single value in `navigator.language` in Incognito mode:
9171
- // the value of `navigator.language`. Therefore the value is ignored in this browser.
9172
- if (!(isChromium() && isChromium86OrNewer())) {
9173
- result.push(n.languages);
9174
- }
9175
- }
9176
- else if (typeof n.languages === 'string') {
9177
- var languages = n.languages;
9178
- if (languages) {
9179
- result.push(languages.split(','));
9180
- }
9181
- }
9182
- return result;
9183
- }
9184
-
9185
- function getColorDepth() {
9186
- return window.screen.colorDepth;
9187
- }
9188
-
9189
- function getDeviceMemory() {
9190
- // `navigator.deviceMemory` is a string containing a number in some unidentified cases
9191
- return replaceNaN(toFloat(navigator.deviceMemory), undefined);
9192
- }
9193
-
9194
- function getScreenResolution() {
9195
- var s = screen;
9196
- // Some browsers return screen resolution as strings, e.g. "1200", instead of a number, e.g. 1200.
9197
- // I suspect it's done by certain plugins that randomize browser properties to prevent fingerprinting.
9198
- // Some browsers even return screen resolution as not numbers.
9199
- var parseDimension = function (value) { return replaceNaN(toInt(value), null); };
9200
- var dimensions = [parseDimension(s.width), parseDimension(s.height)];
9201
- dimensions.sort().reverse();
9202
- return dimensions;
9203
- }
9204
-
9205
- var screenFrameCheckInterval = 2500;
9206
- var roundingPrecision = 10;
9207
- // The type is readonly to protect from unwanted mutations
9208
- var screenFrameBackup;
9209
- var screenFrameSizeTimeoutId;
9210
- /**
9211
- * Starts watching the screen frame size. When a non-zero size appears, the size is saved and the watch is stopped.
9212
- * Later, when `getScreenFrame` runs, it will return the saved non-zero size if the current size is null.
9213
- *
9214
- * This trick is required to mitigate the fact that the screen frame turns null in some cases.
9215
- * See more on this at https://github.com/fingerprintjs/fingerprintjs/issues/568
9216
- */
9217
- function watchScreenFrame() {
9218
- if (screenFrameSizeTimeoutId !== undefined) {
9219
- return;
9220
- }
9221
- var checkScreenFrame = function () {
9222
- var frameSize = getCurrentScreenFrame();
9223
- if (isFrameSizeNull(frameSize)) {
9224
- screenFrameSizeTimeoutId = setTimeout(checkScreenFrame, screenFrameCheckInterval);
9225
- }
9226
- else {
9227
- screenFrameBackup = frameSize;
9228
- screenFrameSizeTimeoutId = undefined;
9229
- }
9230
- };
9231
- checkScreenFrame();
9232
- }
9233
- function getScreenFrame() {
9234
- var _this = this;
9235
- watchScreenFrame();
9236
- return function () { return __awaiter(_this, void 0, void 0, function () {
9237
- var frameSize;
9238
- return __generator(this, function (_a) {
9239
- switch (_a.label) {
9240
- case 0:
9241
- frameSize = getCurrentScreenFrame();
9242
- if (!isFrameSizeNull(frameSize)) return [3 /*break*/, 2];
9243
- if (screenFrameBackup) {
9244
- return [2 /*return*/, __spreadArrays(screenFrameBackup)];
9245
- }
9246
- if (!getFullscreenElement()) return [3 /*break*/, 2];
9247
- // Some browsers set the screen frame to zero when programmatic fullscreen is on.
9248
- // There is a chance of getting a non-zero frame after exiting the fullscreen.
9249
- // See more on this at https://github.com/fingerprintjs/fingerprintjs/issues/568
9250
- return [4 /*yield*/, exitFullscreen()];
9251
- case 1:
9252
- // Some browsers set the screen frame to zero when programmatic fullscreen is on.
9253
- // There is a chance of getting a non-zero frame after exiting the fullscreen.
9254
- // See more on this at https://github.com/fingerprintjs/fingerprintjs/issues/568
9255
- _a.sent();
9256
- frameSize = getCurrentScreenFrame();
9257
- _a.label = 2;
9258
- case 2:
9259
- if (!isFrameSizeNull(frameSize)) {
9260
- screenFrameBackup = frameSize;
9261
- }
9262
- return [2 /*return*/, frameSize];
9263
- }
9264
- });
9265
- }); };
9266
- }
9267
- /**
9268
- * Sometimes the available screen resolution changes a bit, e.g. 1900x1440 → 1900x1439. A possible reason: macOS Dock
9269
- * shrinks to fit more icons when there is too little space. The rounding is used to mitigate the difference.
9270
- */
9271
- function getRoundedScreenFrame() {
9272
- var _this = this;
9273
- var screenFrameGetter = getScreenFrame();
9274
- return function () { return __awaiter(_this, void 0, void 0, function () {
9275
- var frameSize, processSize;
9276
- return __generator(this, function (_a) {
9277
- switch (_a.label) {
9278
- case 0: return [4 /*yield*/, screenFrameGetter()];
9279
- case 1:
9280
- frameSize = _a.sent();
9281
- processSize = function (sideSize) { return (sideSize === null ? null : round(sideSize, roundingPrecision)); };
9282
- // It might look like I don't know about `for` and `map`.
9283
- // In fact, such code is used to avoid TypeScript issues without using `as`.
9284
- return [2 /*return*/, [processSize(frameSize[0]), processSize(frameSize[1]), processSize(frameSize[2]), processSize(frameSize[3])]];
9285
- }
9286
- });
9287
- }); };
9288
- }
9289
- function getCurrentScreenFrame() {
9290
- var s = screen;
9291
- // Some browsers return screen resolution as strings, e.g. "1200", instead of a number, e.g. 1200.
9292
- // I suspect it's done by certain plugins that randomize browser properties to prevent fingerprinting.
9293
- //
9294
- // Some browsers (IE, Edge ≤18) don't provide `screen.availLeft` and `screen.availTop`. The property values are
9295
- // replaced with 0 in such cases to not lose the entropy from `screen.availWidth` and `screen.availHeight`.
9296
- return [
9297
- replaceNaN(toFloat(s.availTop), null),
9298
- replaceNaN(toFloat(s.width) - toFloat(s.availWidth) - replaceNaN(toFloat(s.availLeft), 0), null),
9299
- replaceNaN(toFloat(s.height) - toFloat(s.availHeight) - replaceNaN(toFloat(s.availTop), 0), null),
9300
- replaceNaN(toFloat(s.availLeft), null),
9301
- ];
9302
- }
9303
- function isFrameSizeNull(frameSize) {
9304
- for (var i = 0; i < 4; ++i) {
9305
- if (frameSize[i]) {
9306
- return false;
9307
- }
9308
- }
9309
- return true;
9310
- }
9311
-
9312
- function getHardwareConcurrency() {
9313
- // sometimes hardware concurrency is a string
9314
- return replaceNaN(toInt(navigator.hardwareConcurrency), undefined);
9315
- }
9316
-
9317
- function getTimezone() {
9318
- var _a;
9319
- var DateTimeFormat = (_a = window.Intl) === null || _a === void 0 ? void 0 : _a.DateTimeFormat;
9320
- if (DateTimeFormat) {
9321
- var timezone = new DateTimeFormat().resolvedOptions().timeZone;
9322
- if (timezone) {
9323
- return timezone;
9324
- }
9325
- }
9326
- // For browsers that don't support timezone names
9327
- // The minus is intentional because the JS offset is opposite to the real offset
9328
- var offset = -getTimezoneOffset();
9329
- return "UTC" + (offset >= 0 ? '+' : '') + Math.abs(offset);
9330
- }
9331
- function getTimezoneOffset() {
9332
- var currentYear = new Date().getFullYear();
9333
- // The timezone offset may change over time due to daylight saving time (DST) shifts.
9334
- // The non-DST timezone offset is used as the result timezone offset.
9335
- // Since the DST season differs in the northern and the southern hemispheres,
9336
- // both January and July timezones offsets are considered.
9337
- return Math.max(
9338
- // `getTimezoneOffset` returns a number as a string in some unidentified cases
9339
- toFloat(new Date(currentYear, 0, 1).getTimezoneOffset()), toFloat(new Date(currentYear, 6, 1).getTimezoneOffset()));
9340
- }
9341
-
9342
- function getSessionStorage() {
9343
- try {
9344
- return !!window.sessionStorage;
9345
- }
9346
- catch (error) {
9347
- /* SecurityError when referencing it means it exists */
9348
- return true;
9349
- }
9350
- }
9351
-
9352
- // https://bugzilla.mozilla.org/show_bug.cgi?id=781447
9353
- function getLocalStorage() {
9354
- try {
9355
- return !!window.localStorage;
9356
- }
9357
- catch (e) {
9358
- /* SecurityError when referencing it means it exists */
9359
- return true;
9360
- }
9361
- }
9362
-
9363
- function getIndexedDB() {
9364
- // IE and Edge don't allow accessing indexedDB in private mode, therefore IE and Edge will have different
9365
- // visitor identifier in normal and private modes.
9366
- if (isTrident() || isEdgeHTML()) {
9367
- return undefined;
9368
- }
9369
- try {
9370
- return !!window.indexedDB;
9371
- }
9372
- catch (e) {
9373
- /* SecurityError when referencing it means it exists */
9374
- return true;
9375
- }
9376
- }
9377
-
9378
- function getOpenDatabase() {
9379
- return !!window.openDatabase;
9380
- }
9381
-
9382
- function getCpuClass() {
9383
- return navigator.cpuClass;
9384
- }
9385
-
9386
- function getPlatform() {
9387
- // Android Chrome 86 and 87 and Android Firefox 80 and 84 don't mock the platform value when desktop mode is requested
9388
- var platform = navigator.platform;
9389
- // iOS mocks the platform value when desktop version is requested: https://github.com/fingerprintjs/fingerprintjs/issues/514
9390
- // iPad uses desktop mode by default since iOS 13
9391
- // The value is 'MacIntel' on M1 Macs
9392
- // The value is 'iPhone' on iPod Touch
9393
- if (platform === 'MacIntel') {
9394
- if (isWebKit() && !isDesktopSafari()) {
9395
- return isIPad() ? 'iPad' : 'iPhone';
9396
- }
9397
- }
9398
- return platform;
9399
- }
9400
-
9401
- function getVendor() {
9402
- return navigator.vendor || '';
9403
- }
9404
-
9405
- /**
9406
- * Checks for browser-specific (not engine specific) global variables to tell browsers with the same engine apart.
9407
- * Only somewhat popular browsers are considered.
9408
- */
9409
- function getVendorFlavors() {
9410
- var flavors = [];
9411
- for (var _i = 0, _a = [
9412
- // Blink and some browsers on iOS
9413
- 'chrome',
9414
- // Safari on macOS
9415
- 'safari',
9416
- // Chrome on iOS (checked in 85 on 13 and 87 on 14)
9417
- '__crWeb',
9418
- '__gCrWeb',
9419
- // Yandex Browser on iOS, macOS and Android (checked in 21.2 on iOS 14, macOS and Android)
9420
- 'yandex',
9421
- // Yandex Browser on iOS (checked in 21.2 on 14)
9422
- '__yb',
9423
- '__ybro',
9424
- // Firefox on iOS (checked in 32 on 14)
9425
- '__firefox__',
9426
- // Edge on iOS (checked in 46 on 14)
9427
- '__edgeTrackingPreventionStatistics',
9428
- 'webkit',
9429
- // Opera Touch on iOS (checked in 2.6 on 14)
9430
- 'oprt',
9431
- // Samsung Internet on Android (checked in 11.1)
9432
- 'samsungAr',
9433
- // UC Browser on Android (checked in 12.10 and 13.0)
9434
- 'ucweb',
9435
- 'UCShellJava',
9436
- // Puffin on Android (checked in 9.0)
9437
- 'puffinDevice',
9438
- ]; _i < _a.length; _i++) {
9439
- var key = _a[_i];
9440
- var value = window[key];
9441
- if (value && typeof value === 'object') {
9442
- flavors.push(key);
9443
- }
9444
- }
9445
- return flavors.sort();
9446
- }
9447
-
9448
- /**
9449
- * navigator.cookieEnabled cannot detect custom or nuanced cookie blocking configurations. For example, when blocking
9450
- * cookies via the Advanced Privacy Settings in IE9, it always returns true. And there have been issues in the past with
9451
- * site-specific exceptions. Don't rely on it.
9452
- *
9453
- * @see https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cookies.js Taken from here
9454
- */
9455
- function areCookiesEnabled() {
9456
- var d = document;
9457
- // Taken from here: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cookies.js
9458
- // navigator.cookieEnabled cannot detect custom or nuanced cookie blocking configurations. For example, when blocking
9459
- // cookies via the Advanced Privacy Settings in IE9, it always returns true. And there have been issues in the past
9460
- // with site-specific exceptions. Don't rely on it.
9461
- // try..catch because some in situations `document.cookie` is exposed but throws a
9462
- // SecurityError if you try to access it; e.g. documents created from data URIs
9463
- // or in sandboxed iframes (depending on flags/context)
9464
- try {
9465
- // Create cookie
9466
- d.cookie = 'cookietest=1; SameSite=Strict;';
9467
- var result = d.cookie.indexOf('cookietest=') !== -1;
9468
- // Delete cookie
9469
- d.cookie = 'cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT';
9470
- return result;
9471
- }
9472
- catch (e) {
9473
- return false;
9474
- }
9475
- }
9476
-
9477
- /**
9478
- * Only single element selector are supported (no operators like space, +, >, etc).
9479
- * `embed` and `position: fixed;` will be considered as blocked anyway because it always has no offsetParent.
9480
- * Avoid `iframe` and anything with `[src=]` because they produce excess HTTP requests.
9481
- *
9482
- * See docs/content_blockers.md to learn how to make the list
9483
- */
9484
- var filters = {
9485
- abpIndo: [
9486
- '#Iklan-Melayang',
9487
- '#Kolom-Iklan-728',
9488
- '#SidebarIklan-wrapper',
9489
- 'a[title="7naga poker" i]',
9490
- '[title="ALIENBOLA" i]',
9491
- ],
9492
- abpvn: [
9493
- '#quangcaomb',
9494
- '.iosAdsiosAds-layout',
9495
- '.quangcao',
9496
- '[href^="https://r88.vn/"]',
9497
- '[href^="https://zbet.vn/"]',
9498
- ],
9499
- adBlockFinland: [
9500
- '.mainostila',
9501
- '.sponsorit',
9502
- '.ylamainos',
9503
- 'a[href*="/clickthrgh.asp?"]',
9504
- 'a[href^="https://app.readpeak.com/ads"]',
9505
- ],
9506
- adBlockPersian: [
9507
- '#navbar_notice_50',
9508
- 'a[href^="http://g1.v.fwmrm.net/ad/"]',
9509
- '.kadr',
9510
- 'TABLE[width="140px"]',
9511
- '#divAgahi',
9512
- ],
9513
- adBlockWarningRemoval: ['#adblock-honeypot', '.adblocker-root', '.wp_adblock_detect'],
9514
- adGuardAnnoyances: ['amp-embed[type="zen"]', '.hs-sosyal', '#cookieconsentdiv', 'div[class^="app_gdpr"]', '.as-oil'],
9515
- adGuardBase: ['#ad-after', '#ad-p3', '.BetterJsPopOverlay', '#ad_300X250', '#bannerfloat22'],
9516
- adGuardChinese: [
9517
- // Disabled because not reproducible. Will be replaced during the next filter update.
9518
- // '#piao_div_0[style*="width:140px;"]',
9519
- 'a[href*=".ttz5.cn"]',
9520
- 'a[href*=".yabovip2027.com/"]',
9521
- '.tm3all2h4b',
9522
- '.cc5278_banner_ad',
9523
- ],
9524
- adGuardFrench: [
9525
- '.zonepub',
9526
- '[class*="_adLeaderboard"]',
9527
- '[id^="block-xiti_oas-"]',
9528
- 'a[href^="http://ptapjmp.com/"]',
9529
- 'a[href^="https://go.alvexo.com/"]',
9530
- ],
9531
- adGuardGerman: [
9532
- '.banneritemwerbung_head_1',
9533
- '.boxstartwerbung',
9534
- '.werbung3',
9535
- 'a[href^="http://www.eis.de/index.phtml?refid="]',
9536
- 'a[href^="https://www.tipico.com/?affiliateId="]',
9537
- ],
9538
- adGuardJapanese: [
9539
- '#kauli_yad_1',
9540
- '#ad-giftext',
9541
- '#adsSPRBlock',
9542
- 'a[href^="http://ad2.trafficgate.net/"]',
9543
- 'a[href^="http://www.rssad.jp/"]',
9544
- ],
9545
- adGuardMobile: ['amp-auto-ads', '#mgid_iframe', '.amp_ad', 'amp-embed[type="24smi"]', '#mgid_iframe1'],
9546
- adGuardRussian: [
9547
- 'a[href^="https://ya-distrib.ru/r/"]',
9548
- 'a[href^="https://ad.letmeads.com/"]',
9549
- '.reclama',
9550
- 'div[id^="smi2adblock"]',
9551
- 'div[id^="AdFox_banner_"]',
9552
- ],
9553
- adGuardSocial: [
9554
- 'a[href^="//www.stumbleupon.com/submit?url="]',
9555
- 'a[href^="//telegram.me/share/url?"]',
9556
- '.etsy-tweet',
9557
- '#inlineShare',
9558
- '.popup-social',
9559
- ],
9560
- adGuardSpanishPortuguese: [
9561
- '#barraPublicidade',
9562
- '#Publicidade',
9563
- '#publiEspecial',
9564
- '#queTooltip',
9565
- '[href^="http://ads.glispa.com/"]',
9566
- ],
9567
- adGuardTrackingProtection: [
9568
- 'amp-embed[type="taboola"]',
9569
- '#qoo-counter',
9570
- 'a[href^="http://click.hotlog.ru/"]',
9571
- 'a[href^="http://hitcounter.ru/top/stat.php"]',
9572
- 'a[href^="http://top.mail.ru/jump"]',
9573
- ],
9574
- adGuardTurkish: [
9575
- '#backkapat',
9576
- '#reklami',
9577
- 'a[href^="http://adserv.ontek.com.tr/"]',
9578
- 'a[href^="http://izlenzi.com/campaign/"]',
9579
- 'a[href^="http://www.installads.net/"]',
9580
- ],
9581
- bulgarian: ['td#freenet_table_ads', '#adbody', '#ea_intext_div', '.lapni-pop-over', '#xenium_hot_offers'],
9582
- easyList: ['#AD_banner_bottom', '#Ads_google_02', '#N-ad-article-rightRail-1', '#ad-fullbanner2', '#ad-zone-2'],
9583
- easyListChina: [
9584
- 'a[href*=".wensixuetang.com/"]',
9585
- 'A[href*="/hth107.com/"]',
9586
- '.appguide-wrap[onclick*="bcebos.com"]',
9587
- '.frontpageAdvM',
9588
- '#taotaole',
9589
- ],
9590
- easyListCookie: ['#adtoniq-msg-bar', '#CoockiesPage', '#CookieModal_cookiemodal', '#DO_CC_PANEL', '#ShowCookie'],
9591
- easyListCzechSlovak: ['#onlajny-stickers', '#reklamni-box', '.reklama-megaboard', '.sklik', '[id^="sklikReklama"]'],
9592
- easyListDutch: [
9593
- '#advertentie',
9594
- '#vipAdmarktBannerBlock',
9595
- '.adstekst',
9596
- 'a[href^="https://xltube.nl/click/"]',
9597
- '#semilo-lrectangle',
9598
- ],
9599
- easyListGermany: [
9600
- 'a[href^="http://www.hw-area.com/?dp="]',
9601
- 'a[href^="https://ads.sunmaker.com/tracking.php?"]',
9602
- '.werbung-skyscraper2',
9603
- '.bannergroup_werbung',
9604
- '.ads_rechts',
9605
- ],
9606
- easyListItaly: [
9607
- '.box_adv_annunci',
9608
- '.sb-box-pubbliredazionale',
9609
- 'a[href^="http://affiliazioniads.snai.it/"]',
9610
- 'a[href^="https://adserver.html.it/"]',
9611
- 'a[href^="https://affiliazioniads.snai.it/"]',
9612
- ],
9613
- easyListLithuania: [
9614
- '.reklamos_tarpas',
9615
- '.reklamos_nuorodos',
9616
- 'img[alt="Reklaminis skydelis"]',
9617
- 'img[alt="Dedikuoti.lt serveriai"]',
9618
- 'img[alt="Hostingas Serveriai.lt"]',
9619
- ],
9620
- estonian: ['A[href*="http://pay4results24.eu"]'],
9621
- fanboyAnnoyances: [
9622
- '#feedback-tab',
9623
- '#taboola-below-article',
9624
- '.feedburnerFeedBlock',
9625
- '.widget-feedburner-counter',
9626
- '[title="Subscribe to our blog"]',
9627
- ],
9628
- fanboyAntiFacebook: ['.util-bar-module-firefly-visible'],
9629
- fanboyEnhancedTrackers: [
9630
- '.open.pushModal',
9631
- '#issuem-leaky-paywall-articles-zero-remaining-nag',
9632
- '#sovrn_container',
9633
- 'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',
9634
- '.BlockNag__Card',
9635
- ],
9636
- fanboySocial: [
9637
- '.td-tags-and-social-wrapper-box',
9638
- '.twitterContainer',
9639
- '.youtube-social',
9640
- 'a[title^="Like us on Facebook"]',
9641
- 'img[alt^="Share on Digg"]',
9642
- ],
9643
- frellwitSwedish: [
9644
- 'a[href*="casinopro.se"][target="_blank"]',
9645
- 'a[href*="doktor-se.onelink.me"]',
9646
- 'article.category-samarbete',
9647
- 'div.holidAds',
9648
- 'ul.adsmodern',
9649
- ],
9650
- greekAdBlock: [
9651
- 'A[href*="adman.otenet.gr/click?"]',
9652
- 'A[href*="http://axiabanners.exodus.gr/"]',
9653
- 'A[href*="http://interactive.forthnet.gr/click?"]',
9654
- 'DIV.agores300',
9655
- 'TABLE.advright',
9656
- ],
9657
- hungarian: [
9658
- 'A[href*="ad.eval.hu"]',
9659
- 'A[href*="ad.netmedia.hu"]',
9660
- 'A[href*="daserver.ultraweb.hu"]',
9661
- '#cemp_doboz',
9662
- '.optimonk-iframe-container',
9663
- ],
9664
- iDontCareAboutCookies: [
9665
- '.alert-info[data-block-track*="CookieNotice"]',
9666
- '.ModuleTemplateCookieIndicator',
9667
- '.o--cookies--container',
9668
- '.cookie-msg-info-container',
9669
- '#cookies-policy-sticky',
9670
- ],
9671
- icelandicAbp: ['A[href^="/framework/resources/forms/ads.aspx"]'],
9672
- latvian: [
9673
- 'a[href="http://www.salidzini.lv/"][style="display: block; width: 120px; height: 40px; overflow: hidden; position: relative;"]',
9674
- 'a[href="http://www.salidzini.lv/"][style="display: block; width: 88px; height: 31px; overflow: hidden; position: relative;"]',
9675
- ],
9676
- listKr: [
9677
- 'a[href*="//kingtoon.slnk.kr"]',
9678
- 'a[href*="//playdsb.com/kr"]',
9679
- 'div.logly-lift-adz',
9680
- 'div[data-widget_id="ml6EJ074"]',
9681
- 'ins.daum_ddn_area',
9682
- ],
9683
- listeAr: [
9684
- '.geminiLB1Ad',
9685
- '.right-and-left-sponsers',
9686
- 'a[href*=".aflam.info"]',
9687
- 'a[href*="booraq.org"]',
9688
- 'a[href*="dubizzle.com/ar/?utm_source="]',
9689
- ],
9690
- listeFr: [
9691
- 'a[href^="http://promo.vador.com/"]',
9692
- '#adcontainer_recherche',
9693
- 'a[href*="weborama.fr/fcgi-bin/"]',
9694
- '.site-pub-interstitiel',
9695
- 'div[id^="crt-"][data-criteo-id]',
9696
- ],
9697
- officialPolish: [
9698
- '#ceneo-placeholder-ceneo-12',
9699
- '[href^="https://aff.sendhub.pl/"]',
9700
- 'a[href^="http://advmanager.techfun.pl/redirect/"]',
9701
- 'a[href^="http://www.trizer.pl/?utm_source"]',
9702
- 'div#skapiec_ad',
9703
- ],
9704
- ro: [
9705
- 'a[href^="//afftrk.altex.ro/Counter/Click"]',
9706
- 'a[href^="/magazin/"]',
9707
- 'a[href^="https://blackfridaysales.ro/trk/shop/"]',
9708
- 'a[href^="https://event.2performant.com/events/click"]',
9709
- 'a[href^="https://l.profitshare.ro/"]',
9710
- ],
9711
- ruAd: [
9712
- 'a[href*="//febrare.ru/"]',
9713
- 'a[href*="//utimg.ru/"]',
9714
- 'a[href*="://chikidiki.ru"]',
9715
- '#pgeldiz',
9716
- '.yandex-rtb-block',
9717
- ],
9718
- thaiAds: ['a[href*=macau-uta-popup]', '#ads-google-middle_rectangle-group', '.ads300s', '.bumq', '.img-kosana'],
9719
- webAnnoyancesUltralist: [
9720
- '#mod-social-share-2',
9721
- '#social-tools',
9722
- '.ctpl-fullbanner',
9723
- '.zergnet-recommend',
9724
- '.yt.btn-link.btn-md.btn',
9725
- ],
9726
- };
9727
- /**
9728
- * The order of the returned array means nothing (it's always sorted alphabetically).
9729
- *
9730
- * Notice that the source is slightly unstable.
9731
- * Safari provides a 2-taps way to disable all content blockers on a page temporarily.
9732
- * Also content blockers can be disabled permanently for a domain, but it requires 4 taps.
9733
- * So empty array shouldn't be treated as "no blockers", it should be treated as "no signal".
9734
- * If you are a website owner, don't make your visitors want to disable content blockers.
9735
- */
9736
- function getDomBlockers(_a) {
9737
- var debug = (_a === void 0 ? {} : _a).debug;
9738
- return __awaiter(this, void 0, void 0, function () {
9739
- var filterNames, allSelectors, blockedSelectors, activeBlockers;
9740
- var _b;
9741
- return __generator(this, function (_c) {
9742
- switch (_c.label) {
9743
- case 0:
9744
- if (!isApplicable()) {
9745
- return [2 /*return*/, undefined];
9746
- }
9747
- filterNames = Object.keys(filters);
9748
- allSelectors = (_b = []).concat.apply(_b, filterNames.map(function (filterName) { return filters[filterName]; }));
9749
- return [4 /*yield*/, getBlockedSelectors(allSelectors)];
9750
- case 1:
9751
- blockedSelectors = _c.sent();
9752
- if (debug) {
9753
- printDebug(blockedSelectors);
9754
- }
9755
- activeBlockers = filterNames.filter(function (filterName) {
9756
- var selectors = filters[filterName];
9757
- var blockedCount = countTruthy(selectors.map(function (selector) { return blockedSelectors[selector]; }));
9758
- return blockedCount > selectors.length * 0.6;
9759
- });
9760
- activeBlockers.sort();
9761
- return [2 /*return*/, activeBlockers];
9762
- }
9763
- });
9764
- });
9765
- }
9766
- function isApplicable() {
9767
- // Safari (desktop and mobile) and all Android browsers keep content blockers in both regular and private mode
9768
- return isWebKit() || isAndroid();
9769
- }
9770
- function getBlockedSelectors(selectors) {
9771
- var _a;
9772
- return __awaiter(this, void 0, void 0, function () {
9773
- var d, root, elements, blockedSelectors, i, element, holder, i;
9774
- return __generator(this, function (_b) {
9775
- switch (_b.label) {
9776
- case 0:
9777
- d = document;
9778
- root = d.createElement('div');
9779
- elements = new Array(selectors.length);
9780
- blockedSelectors = {} // Set() isn't used just in case somebody need older browser support
9781
- ;
9782
- forceShow(root);
9783
- // First create all elements that can be blocked. If the DOM steps below are done in a single cycle,
9784
- // browser will alternate tree modification and layout reading, that is very slow.
9785
- for (i = 0; i < selectors.length; ++i) {
9786
- element = selectorToElement(selectors[i]);
9787
- holder = d.createElement('div') // Protects from unwanted effects of `+` and `~` selectors of filters
9788
- ;
9789
- forceShow(holder);
9790
- holder.appendChild(element);
9791
- root.appendChild(holder);
9792
- elements[i] = element;
9793
- }
9794
- _b.label = 1;
9795
- case 1:
9796
- if (!!d.body) return [3 /*break*/, 3];
9797
- return [4 /*yield*/, wait(50)];
9798
- case 2:
9799
- _b.sent();
9800
- return [3 /*break*/, 1];
9801
- case 3:
9802
- d.body.appendChild(root);
9803
- try {
9804
- // Then check which of the elements are blocked
9805
- for (i = 0; i < selectors.length; ++i) {
9806
- if (!elements[i].offsetParent) {
9807
- blockedSelectors[selectors[i]] = true;
9808
- }
9809
- }
9810
- }
9811
- finally {
9812
- // Then remove the elements
9813
- (_a = root.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(root);
9814
- }
9815
- return [2 /*return*/, blockedSelectors];
9816
- }
9817
- });
9818
- });
9819
- }
9820
- function forceShow(element) {
9821
- element.style.setProperty('display', 'block', 'important');
9822
- }
9823
- function printDebug(blockedSelectors) {
9824
- var message = 'DOM blockers debug:\n```';
9825
- for (var _i = 0, _a = Object.keys(filters); _i < _a.length; _i++) {
9826
- var filterName = _a[_i];
9827
- message += "\n" + filterName + ":";
9828
- for (var _b = 0, _c = filters[filterName]; _b < _c.length; _b++) {
9829
- var selector = _c[_b];
9830
- message += "\n " + selector + " " + (blockedSelectors[selector] ? '🚫' : '➡️');
9831
- }
9832
- }
9833
- // console.log is ok here because it's under a debug clause
9834
- // eslint-disable-next-line no-console
9835
- console.log(message + "\n```");
9836
- }
9837
-
9838
- /**
9839
- * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/color-gamut
9840
- */
9841
- function getColorGamut() {
9842
- // rec2020 includes p3 and p3 includes srgb
9843
- for (var _i = 0, _a = ['rec2020', 'p3', 'srgb']; _i < _a.length; _i++) {
9844
- var gamut = _a[_i];
9845
- if (matchMedia("(color-gamut: " + gamut + ")").matches) {
9846
- return gamut;
9847
- }
9848
- }
9849
- return undefined;
9850
- }
9851
-
9852
- /**
9853
- * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/inverted-colors
9854
- */
9855
- function areColorsInverted() {
9856
- if (doesMatch('inverted')) {
9857
- return true;
9858
- }
9859
- if (doesMatch('none')) {
9860
- return false;
9861
- }
9862
- return undefined;
9863
- }
9864
- function doesMatch(value) {
9865
- return matchMedia("(inverted-colors: " + value + ")").matches;
9866
- }
9867
-
9868
- /**
9869
- * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/forced-colors
9870
- */
9871
- function areColorsForced() {
9872
- if (doesMatch$1('active')) {
9873
- return true;
9874
- }
9875
- if (doesMatch$1('none')) {
9876
- return false;
9877
- }
9878
- return undefined;
9879
- }
9880
- function doesMatch$1(value) {
9881
- return matchMedia("(forced-colors: " + value + ")").matches;
9882
- }
9883
-
9884
- var maxValueToCheck = 100;
9885
- /**
9886
- * If the display is monochrome (e.g. black&white), the value will be ≥0 and will mean the number of bits per pixel.
9887
- * If the display is not monochrome, the returned value will be 0.
9888
- * If the browser doesn't support this feature, the returned value will be undefined.
9889
- *
9890
- * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/monochrome
9891
- */
9892
- function getMonochromeDepth() {
9893
- if (!matchMedia('(min-monochrome: 0)').matches) {
9894
- // The media feature isn't supported by the browser
9895
- return undefined;
9896
- }
9897
- // A variation of binary search algorithm can be used here.
9898
- // But since expected values are very small (≤10), there is no sense in adding the complexity.
9899
- for (var i = 0; i <= maxValueToCheck; ++i) {
9900
- if (matchMedia("(max-monochrome: " + i + ")").matches) {
9901
- return i;
9902
- }
9903
- }
9904
- throw new Error('Too high value');
9905
- }
9906
-
9907
- /**
9908
- * @see https://www.w3.org/TR/mediaqueries-5/#prefers-contrast
9909
- * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-contrast
9910
- */
9911
- function getContrastPreference() {
9912
- if (doesMatch$2('no-preference')) {
9913
- return 0 /* None */;
9914
- }
9915
- // The sources contradict on the keywords. Probably 'high' and 'low' will never be implemented.
9916
- // Need to check it when all browsers implement the feature.
9917
- if (doesMatch$2('high') || doesMatch$2('more')) {
9918
- return 1 /* More */;
9919
- }
9920
- if (doesMatch$2('low') || doesMatch$2('less')) {
9921
- return -1 /* Less */;
9922
- }
9923
- if (doesMatch$2('forced')) {
9924
- return 10 /* ForcedColors */;
9925
- }
9926
- return undefined;
9927
- }
9928
- function doesMatch$2(value) {
9929
- return matchMedia("(prefers-contrast: " + value + ")").matches;
9930
- }
9931
-
9932
- /**
9933
- * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion
9934
- */
9935
- function isMotionReduced() {
9936
- if (doesMatch$3('reduce')) {
9937
- return true;
9938
- }
9939
- if (doesMatch$3('no-preference')) {
9940
- return false;
9941
- }
9942
- return undefined;
9943
- }
9944
- function doesMatch$3(value) {
9945
- return matchMedia("(prefers-reduced-motion: " + value + ")").matches;
9946
- }
9947
-
9948
- /**
9949
- * @see https://www.w3.org/TR/mediaqueries-5/#dynamic-range
9950
- */
9951
- function isHDR() {
9952
- if (doesMatch$4('high')) {
9953
- return true;
9954
- }
9955
- if (doesMatch$4('standard')) {
9956
- return false;
9957
- }
9958
- return undefined;
9959
- }
9960
- function doesMatch$4(value) {
9961
- return matchMedia("(dynamic-range: " + value + ")").matches;
9962
- }
9963
-
9964
- var M$1 = Math; // To reduce the minified code size
9965
- var fallbackFn = function () { return 0; };
9966
- /**
9967
- * @see https://gitlab.torproject.org/legacy/trac/-/issues/13018
9968
- * @see https://bugzilla.mozilla.org/show_bug.cgi?id=531915
9969
- */
9970
- function getMathFingerprint() {
9971
- // Native operations
9972
- var acos = M$1.acos || fallbackFn;
9973
- var acosh = M$1.acosh || fallbackFn;
9974
- var asin = M$1.asin || fallbackFn;
9975
- var asinh = M$1.asinh || fallbackFn;
9976
- var atanh = M$1.atanh || fallbackFn;
9977
- var atan = M$1.atan || fallbackFn;
9978
- var sin = M$1.sin || fallbackFn;
9979
- var sinh = M$1.sinh || fallbackFn;
9980
- var cos = M$1.cos || fallbackFn;
9981
- var cosh = M$1.cosh || fallbackFn;
9982
- var tan = M$1.tan || fallbackFn;
9983
- var tanh = M$1.tanh || fallbackFn;
9984
- var exp = M$1.exp || fallbackFn;
9985
- var expm1 = M$1.expm1 || fallbackFn;
9986
- var log1p = M$1.log1p || fallbackFn;
9987
- // Operation polyfills
9988
- var powPI = function (value) { return M$1.pow(M$1.PI, value); };
9989
- var acoshPf = function (value) { return M$1.log(value + M$1.sqrt(value * value - 1)); };
9990
- var asinhPf = function (value) { return M$1.log(value + M$1.sqrt(value * value + 1)); };
9991
- var atanhPf = function (value) { return M$1.log((1 + value) / (1 - value)) / 2; };
9992
- var sinhPf = function (value) { return M$1.exp(value) - 1 / M$1.exp(value) / 2; };
9993
- var coshPf = function (value) { return (M$1.exp(value) + 1 / M$1.exp(value)) / 2; };
9994
- var expm1Pf = function (value) { return M$1.exp(value) - 1; };
9995
- var tanhPf = function (value) { return (M$1.exp(2 * value) - 1) / (M$1.exp(2 * value) + 1); };
9996
- var log1pPf = function (value) { return M$1.log(1 + value); };
9997
- // Note: constant values are empirical
9998
- return {
9999
- acos: acos(0.123124234234234242),
10000
- acosh: acosh(1e308),
10001
- acoshPf: acoshPf(1e154),
10002
- asin: asin(0.123124234234234242),
10003
- asinh: asinh(1),
10004
- asinhPf: asinhPf(1),
10005
- atanh: atanh(0.5),
10006
- atanhPf: atanhPf(0.5),
10007
- atan: atan(0.5),
10008
- sin: sin(-1e300),
10009
- sinh: sinh(1),
10010
- sinhPf: sinhPf(1),
10011
- cos: cos(10.000000000123),
10012
- cosh: cosh(1),
10013
- coshPf: coshPf(1),
10014
- tan: tan(-1e300),
10015
- tanh: tanh(1),
10016
- tanhPf: tanhPf(1),
10017
- exp: exp(1),
10018
- expm1: expm1(1),
10019
- expm1Pf: expm1Pf(1),
10020
- log1p: log1p(10),
10021
- log1pPf: log1pPf(10),
10022
- powPI: powPI(-100),
10023
- };
10024
- }
10025
-
10026
- /**
10027
- * We use m or w because these two characters take up the maximum width.
10028
- * Also there are a couple of ligatures.
10029
- */
10030
- var defaultText = 'mmMwWLliI0fiflO&1';
10031
- /**
10032
- * Settings of text blocks to measure. The keys are random but persistent words.
10033
- */
10034
- var presets = {
10035
- /**
10036
- * The default font. User can change it in desktop Chrome, desktop Firefox, IE 11,
10037
- * Android Chrome (but only when the size is ≥ than the default) and Android Firefox.
10038
- */
10039
- default: [],
10040
- /** OS font on macOS. User can change its size and weight. Applies after Safari restart. */
10041
- apple: [{ font: '-apple-system-body' }],
10042
- /** User can change it in desktop Chrome and desktop Firefox. */
10043
- serif: [{ fontFamily: 'serif' }],
10044
- /** User can change it in desktop Chrome and desktop Firefox. */
10045
- sans: [{ fontFamily: 'sans-serif' }],
10046
- /** User can change it in desktop Chrome and desktop Firefox. */
10047
- mono: [{ fontFamily: 'monospace' }],
10048
- /**
10049
- * Check the smallest allowed font size. User can change it in desktop Chrome, desktop Firefox and desktop Safari.
10050
- * The height can be 0 in Chrome on a retina display.
10051
- */
10052
- min: [{ fontSize: '1px' }],
10053
- /** Tells one OS from another in desktop Chrome. */
10054
- system: [{ fontFamily: 'system-ui' }],
10055
- };
10056
- /**
10057
- * The result is a dictionary of the width of the text samples.
10058
- * Heights aren't included because they give no extra entropy and are unstable.
10059
- *
10060
- * The result is very stable in IE 11, Edge 18 and Safari 14.
10061
- * The result changes when the OS pixel density changes in Chromium 87. The real pixel density is required to solve,
10062
- * but seems like it's impossible: https://stackoverflow.com/q/1713771/1118709.
10063
- * The "min" and the "mono" (only on Windows) value may change when the page is zoomed in Firefox 87.
10064
- */
10065
- function getFontPreferences() {
10066
- return withNaturalFonts(function (document, container) {
10067
- var elements = {};
10068
- var sizes = {};
10069
- // First create all elements to measure. If the DOM steps below are done in a single cycle,
10070
- // browser will alternate tree modification and layout reading, that is very slow.
10071
- for (var _i = 0, _a = Object.keys(presets); _i < _a.length; _i++) {
10072
- var key = _a[_i];
10073
- var _b = presets[key], _c = _b[0], style = _c === void 0 ? {} : _c, _d = _b[1], text = _d === void 0 ? defaultText : _d;
10074
- var element = document.createElement('span');
10075
- element.textContent = text;
10076
- element.style.whiteSpace = 'nowrap';
10077
- for (var _e = 0, _f = Object.keys(style); _e < _f.length; _e++) {
10078
- var name_1 = _f[_e];
10079
- var value = style[name_1];
10080
- if (value !== undefined) {
10081
- element.style[name_1] = value;
10082
- }
10083
- }
10084
- elements[key] = element;
10085
- container.appendChild(document.createElement('br'));
10086
- container.appendChild(element);
10087
- }
10088
- // Then measure the created elements
10089
- for (var _g = 0, _h = Object.keys(presets); _g < _h.length; _g++) {
10090
- var key = _h[_g];
10091
- sizes[key] = elements[key].getBoundingClientRect().width;
10092
- }
10093
- return sizes;
10094
- });
10095
- }
10096
- /**
10097
- * Creates a DOM environment that provides the most natural font available, including Android OS font.
10098
- * Measurements of the elements are zoom-independent.
10099
- * Don't put a content to measure inside an absolutely positioned element.
10100
- */
10101
- function withNaturalFonts(action, containerWidthPx) {
10102
- if (containerWidthPx === void 0) { containerWidthPx = 4000; }
10103
- /*
10104
- * Requirements for Android Chrome to apply the system font size to a text inside an iframe:
10105
- * - The iframe mustn't have a `display: none;` style;
10106
- * - The text mustn't be positioned absolutely;
10107
- * - The text block must be wide enough.
10108
- * 2560px on some devices in portrait orientation for the biggest font size option (32px);
10109
- * - There must be much enough text to form a few lines (I don't know the exact numbers);
10110
- * - The text must have the `text-size-adjust: none` style. Otherwise the text will scale in "Desktop site" mode;
10111
- *
10112
- * Requirements for Android Firefox to apply the system font size to a text inside an iframe:
10113
- * - The iframe document must have a header: `<meta name="viewport" content="width=device-width, initial-scale=1" />`.
10114
- * The only way to set it is to use the `srcdoc` attribute of the iframe;
10115
- * - The iframe content must get loaded before adding extra content with JavaScript;
10116
- *
10117
- * https://example.com as the iframe target always inherits Android font settings so it can be used as a reference.
10118
- *
10119
- * Observations on how page zoom affects the measurements:
10120
- * - macOS Safari 11.1, 12.1, 13.1, 14.0: zoom reset + offsetWidth = 100% reliable;
10121
- * - macOS Safari 11.1, 12.1, 13.1, 14.0: zoom reset + getBoundingClientRect = 100% reliable;
10122
- * - macOS Safari 14.0: offsetWidth = 5% fluctuation;
10123
- * - macOS Safari 14.0: getBoundingClientRect = 5% fluctuation;
10124
- * - iOS Safari 9, 10, 11.0, 12.0: haven't found a way to zoom a page (pinch doesn't change layout);
10125
- * - iOS Safari 13.1, 14.0: zoom reset + offsetWidth = 100% reliable;
10126
- * - iOS Safari 13.1, 14.0: zoom reset + getBoundingClientRect = 100% reliable;
10127
- * - iOS Safari 14.0: offsetWidth = 100% reliable;
10128
- * - iOS Safari 14.0: getBoundingClientRect = 100% reliable;
10129
- * - Chrome 42, 65, 80, 87: zoom 1/devicePixelRatio + offsetWidth = 1px fluctuation;
10130
- * - Chrome 42, 65, 80, 87: zoom 1/devicePixelRatio + getBoundingClientRect = 100% reliable;
10131
- * - Chrome 87: offsetWidth = 1px fluctuation;
10132
- * - Chrome 87: getBoundingClientRect = 0.7px fluctuation;
10133
- * - Firefox 48, 51: offsetWidth = 10% fluctuation;
10134
- * - Firefox 48, 51: getBoundingClientRect = 10% fluctuation;
10135
- * - Firefox 52, 53, 57, 62, 66, 67, 68, 71, 75, 80, 84: offsetWidth = width 100% reliable, height 10% fluctuation;
10136
- * - Firefox 52, 53, 57, 62, 66, 67, 68, 71, 75, 80, 84: getBoundingClientRect = width 100% reliable, height 10%
10137
- * fluctuation;
10138
- * - Android Chrome 86: haven't found a way to zoom a page (pinch doesn't change layout);
10139
- * - Android Firefox 84: font size in accessibility settings changes all the CSS sizes, but offsetWidth and
10140
- * getBoundingClientRect keep measuring with regular units, so the size reflects the font size setting and doesn't
10141
- * fluctuate;
10142
- * - IE 11, Edge 18: zoom 1/devicePixelRatio + offsetWidth = 100% reliable;
10143
- * - IE 11, Edge 18: zoom 1/devicePixelRatio + getBoundingClientRect = reflects the zoom level;
10144
- * - IE 11, Edge 18: offsetWidth = 100% reliable;
10145
- * - IE 11, Edge 18: getBoundingClientRect = 100% reliable;
10146
- */
10147
- return withIframe(function (_, iframeWindow) {
10148
- var iframeDocument = iframeWindow.document;
10149
- var iframeBody = iframeDocument.body;
10150
- var bodyStyle = iframeBody.style;
10151
- bodyStyle.width = containerWidthPx + "px";
10152
- bodyStyle.webkitTextSizeAdjust = bodyStyle.textSizeAdjust = 'none';
10153
- // See the big comment above
10154
- if (isChromium()) {
10155
- iframeBody.style.zoom = "" + 1 / iframeWindow.devicePixelRatio;
10156
- }
10157
- else if (isWebKit()) {
10158
- iframeBody.style.zoom = 'reset';
10159
- }
10160
- // See the big comment above
10161
- var linesOfText = iframeDocument.createElement('div');
10162
- linesOfText.textContent = __spreadArrays(Array((containerWidthPx / 20) << 0)).map(function () { return 'word'; }).join(' ');
10163
- iframeBody.appendChild(linesOfText);
10164
- return action(iframeDocument, iframeBody);
10165
- }, '<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">');
10166
- }
10167
-
10168
- /**
10169
- * The list of entropy sources used to make visitor identifiers.
10170
- *
10171
- * This value isn't restricted by Semantic Versioning, i.e. it may be changed without bumping minor or major version of
10172
- * this package.
10173
- */
10174
- var sources = {
10175
- // READ FIRST:
10176
- // See https://github.com/fingerprintjs/fingerprintjs/blob/master/contributing.md#how-to-make-an-entropy-source
10177
- // to learn how entropy source works and how to make your own.
10178
- // The sources run in this exact order.
10179
- // The asynchronous sources are at the start to run in parallel with other sources.
10180
- fonts: getFonts,
10181
- domBlockers: getDomBlockers,
10182
- fontPreferences: getFontPreferences,
10183
- audio: getAudioFingerprint,
10184
- screenFrame: getRoundedScreenFrame,
10185
- osCpu: getOsCpu,
10186
- languages: getLanguages,
10187
- colorDepth: getColorDepth,
10188
- deviceMemory: getDeviceMemory,
10189
- screenResolution: getScreenResolution,
10190
- hardwareConcurrency: getHardwareConcurrency,
10191
- timezone: getTimezone,
10192
- sessionStorage: getSessionStorage,
10193
- localStorage: getLocalStorage,
10194
- indexedDB: getIndexedDB,
10195
- openDatabase: getOpenDatabase,
10196
- cpuClass: getCpuClass,
10197
- platform: getPlatform,
10198
- plugins: getPlugins,
10199
- canvas: getCanvasFingerprint,
10200
- touchSupport: getTouchSupport,
10201
- vendor: getVendor,
10202
- vendorFlavors: getVendorFlavors,
10203
- cookiesEnabled: areCookiesEnabled,
10204
- colorGamut: getColorGamut,
10205
- invertedColors: areColorsInverted,
10206
- forcedColors: areColorsForced,
10207
- monochrome: getMonochromeDepth,
10208
- contrast: getContrastPreference,
10209
- reducedMotion: isMotionReduced,
10210
- hdr: isHDR,
10211
- math: getMathFingerprint,
10212
- };
10213
- /**
10214
- * A delay is required to ensure consistent entropy components.
10215
- * See https://github.com/fingerprintjs/fingerprintjs/issues/254
10216
- * and https://github.com/fingerprintjs/fingerprintjs/issues/307
10217
- * and https://github.com/fingerprintjs/fingerprintjs/commit/945633e7c5f67ae38eb0fea37349712f0e669b18
10218
- */
10219
- function prepareForSources(delayFallback) {
10220
- if (delayFallback === void 0) { delayFallback = 50; }
10221
- // A proper deadline is unknown. Let it be twice the fallback timeout so that both cases have the same average time.
10222
- return requestIdleCallbackIfAvailable(delayFallback, delayFallback * 2);
7845
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
7846
+ t[p[i]] = s[p[i]];
7847
+ }
7848
+ return t;
7849
+ }
7850
+
7851
+ /** @deprecated */
7852
+ function __spreadArrays() {
7853
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
7854
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
7855
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
7856
+ r[k] = a[j];
7857
+ return r;
10223
7858
  }
10224
- // The exports below are for private usage. They may change unexpectedly. Use them at your own risk.
10225
- /** Not documented, out of Semantic Versioning, usage is at your own risk */
10226
- var murmurX64Hash128 = x64hash128;
10227
7859
 
10228
7860
  /**
10229
- * FingerprintJS Pro v3.5.7 - Copyright (c) FingerprintJS, Inc, 2022 (https://fingerprintjs.com)
7861
+ * FingerprintJS Pro v3.8.0 - Copyright (c) FingerprintJS, Inc, 2022 (https://fingerprint.com)
10230
7862
  *
10231
7863
  * This software contains code from open-source projects:
10232
7864
  * MurmurHash3 by Karan Lyons (https://github.com/karanlyons/murmurHash3.js)
10233
7865
  */
10234
- function b(e,n){return new Promise((function(t){return y(t,e,n)}))}function y(e,n){for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];var i=Date.now()+n,o=0,a=function(){o=setTimeout((function(){Date.now()<i?a():e.apply(void 0,t);}),i-Date.now());};return a(),function(){return clearTimeout(o)}}function w(e,n,t){for(var r=[],i=3;i<arguments.length;i++)r[i-3]=arguments[i];var o,a=!1,u=e,s=0,c=function(){a||o||(s=Date.now(),o=y((function(){a=!0,t.apply(void 0,r);}),u));},l=function(){!a&&o&&(o(),o=void 0,u-=Date.now()-s);};return n&&c(),{start:c,stop:l}}function E(e,n){for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];var i=document,o="visibilitychange",a=function(){return i.hidden?c():s()},u=w(n,!i.hidden,(function(){i.removeEventListener(o,a),e.apply(void 0,t);})),s=u.start,c=u.stop;return i.addEventListener(o,a),function(){i.removeEventListener(o,a),c();}}function R(e,n){return new Promise((function(t){return E(t,e,n)}))}function T(t,r){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,t()];case 1:return [2,n.sent()];case 2:return e=n.sent(),console.error(e),[2,r];case 3:return [2]}}))}))}function S(t,r){var i=this;return new Promise((function(o,a){var u=r(),s=!1;null==t||t.then(o,a).then((function(){return s=!0}));var c=function(t){return __awaiter(i,void 0,void 0,(function(){var e,r;return __generator(this,(function(n){switch(n.label){case 0:if(t.done)return [2,o(t.value)];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,t.value];case 2:if(e=n.sent(),!s)try{c(u.next(e));}catch(i){a(i);}return [3,4];case 3:if(r=n.sent(),!s)try{c(u.throw(r));}catch(i){a(i);}return [3,4];case 4:return [2]}}))}))};c(u.next());}))}function I(t,r){return __awaiter(this,void 0,void 0,(function(){var e,i,o,a;return __generator(this,(function(n){switch(n.label){case 0:try{e=r().then((function(e){return i=[!0,e]}),(function(e){return i=[!1,e]}));}catch(u){i=[!1,u];}return a=t.then((function(e){return o=[!0,e]}),(function(e){return o=[!1,e]})),[4,Promise.race([e,a])];case 1:return n.sent(),[2,function(){if(i){if(i[0])return i[1];throw i[1]}if(o){if(o[0])return o[1];throw o[1]}throw new Error("96375")}]}}))}))}function A(){var e=window;try{return e.self!==e.top}catch(n){return !0}}function _(e,t){var r;return __generator(this,(function(n){switch(n.label){case 0:r=0,n.label=1;case 1:return [4,Math.random()*Math.min(t,e*Math.pow(2,r))];case 2:n.sent(),n.label=3;case 3:return ++r,[3,1];case 4:return [2]}}))}function C(e){return e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}var O="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",D=O+"+/";function P(e,n){if(0==n.length||n.length>e.length)return -1;for(var t=0;t<e.length;t++){for(var r=0,i=0;i<n.length;i++){if(e[t+i]!==n[i]){r=0;break}r++;}if(r==n.length)return t}return -1}function N(e){if("function"==typeof TextDecoder){var n=(new TextDecoder).decode(e);if(n)return n}var t=C(e);return decodeURIComponent(escape(String.fromCharCode.apply(null,t)))}function x(e){return e.reduce((function(e,n){return e+(n?1:0)}),0)}function L(e,n,t){return void 0===t&&(t="..."),e.length<=n?e:""+e.slice(0,Math.max(0,n-t.length))+t}function q(e,n){return (e-n+256)%256}function j(e){for(var n=C(e),t=n.length,r="",i=0;i<t;i+=3)r+=D[n[i]>>2]+D[(3&n[i])<<4|n[i+1]>>4]+D[(15&n[i+1])<<2|n[i+2]>>6]+D[63&n[i+2]];return t%3==2?r.slice(0,-1)+"=":t%3==1?r.slice(0,-2)+"==":r}function M(e){for(var n="",t=0;t<e.length;++t)if(t>0){var r=e[t].toLowerCase();r!==e[t]?n+=" "+r:n+=e[t];}else n+=e[t].toUpperCase();return n}function U(e){return void 0===e?void 0:""+e}function F(e,n){for(var t="",r=0;r<e;r++)t+=n.charAt(Math.random()*n.length);return t}function V(e){return F(e,O)}function B(){return 256*Math.random()|0}function G(e){var n=e.filter((function(e){return !!e}));return n.length?function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=function(n){T((function(){return n.apply(void 0,e)}));},i=0,o=n;i<o.length;i++){var a=o[i];r(a);}}:void 0}function H(e){void 0===e&&(e="[FingerprintJS Pro] ");var n={};return function(t){switch(t.e){case 15:n[t.getCallId]=t.request;break;case 18:console.log(e+"Visitor id request",n[t.getCallId]);break;case 19:console.log(e+"Visitor id response",t.body);break;case 16:case 17:delete n[t.getCallId];}}}function X(e){var n=e.url,t=e.method,r=void 0===t?"get":t,i=e.body,o=e.headers,a=e.withCredentials,u=void 0!==a&&a,s=e.timeout,c=e.responseFormat,l=e.abort;return new Promise((function(e,t){var a=new XMLHttpRequest;for(var f in a.open(r,n,!0),a.withCredentials=u,a.timeout=void 0===s?0:Math.max(s,1),"binary"===c&&(a.responseType="arraybuffer"),o)a.setRequestHeader(f,o[f]);a.onload=function(){return e(function(e){return {body:e.response,status:e.status,statusText:e.statusText}}(a))},a.ontimeout=function(){return t(J("TimeoutError","The request timed out"))},a.onabort=function(){return t(J("AbortError","The request is aborted"))},a.onerror=function(){return t(J("TypeError",navigator.onLine?"Connection error":"Network offline"))},a.send(function(e){var n,t=function(){try{return new Blob([]),!1}catch(n){return !0}};if(e instanceof ArrayBuffer){if(!t())return new Uint8Array(e)}else if((null===(n=e)||void 0===n?void 0:n.buffer)instanceof ArrayBuffer&&t())return e.buffer;return e}(i)),null==l||l.catch((function(){})).then((function(){a.onabort=null,a.abort();}));}))}function J(e,n){var t=new Error(n);return t.name=e,t}function Y(e,n){for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];e&&T((function(){var r=n.apply(void 0,t);void 0!==r&&e(r);}));}function Q(t,r,i,o,a){return __awaiter(this,void 0,void 0,(function(){var e,u;return __generator(this,(function(n){switch(n.label){case 0:Y(t,r),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,a()];case 2:return e=n.sent(),[3,4];case 3:throw u=n.sent(),Y(t,o,u),u;case 4:return Y(t,i,e),[2,e]}}))}))}function ne(){var e=window,n=navigator;return x(["maxTouchPoints"in n,"mediaCapabilities"in n,"PointerEvent"in e,"visualViewport"in e,"onafterprint"in e])>=4}function te(){var e=window;return x([!("PushManager"in e),!("AudioBuffer"in e),!("RTCPeerConnection"in e),!("geolocation"in navigator),!("ServiceWorker"in e)])>=3}var Re={us:"use1",eu:"eun1",ap:"aps1"};function Te(t,r,i){var o,a=function(e,t,r,i){void 0===r&&(r=1/0);var o=_(300,1e4);return S(null==i?void 0:i.then((function(){}),(function(){})),(function(){var a,u,s;return __generator(this,(function(n){switch(n.label){case 0:a=0,n.label=1;case 1:if(!(a<r))return [3,8];u=Date.now(),n.label=2;case 2:return n.trys.push([2,4,,5]),[4,e(a,i)];case 3:return [2,n.sent()];case 4:return s=n.sent(),t(s),[3,5];case 5:return [4,b(u+o.next().value-Date.now())];case 6:n.sent(),n.label=7;case 7:return ++a,[3,1];case 8:return [2,void 0]}}))}))}((function(r,o){return function(t,r,i,o,a){return __awaiter(this,void 0,void 0,(function(){var e,u;return __generator(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,Q(a,(function(){return {e:9,tryNumber:i,timeout:r}}),(function(e){var n=e.status,t=e.body;return {e:10,tryNumber:i,status:n,body:t}}),(function(e){return {e:11,tryNumber:i,error:e}}),(function(){return X({url:t,timeout:r,abort:o})}))];case 1:return e=n.sent(),[3,3];case 2:switch((u=n.sent()).name){case"AbortError":throw Se(u.message,-2);case"TimeoutError":throw Se(u.message,-3);case"TypeError":throw Se(u.message,-4)}throw u;case 3:if(200===e.status)return [2,e.body];throw Se(L(e.status+": "+e.body,255),-5)}}))}))}(t,5e3,r,o,i)}),(function(e){return o=e}),10,r);return a.catch((function(){})),function(e){return void 0===e&&(e=new Promise((function(){}))),Promise.race([e.then((function(){}),(function(){})),a]).then((function(e){if(void 0!==e)return e;throw o||Se("Timeout",-3)}))}}function Se(e,n){var t=new Error(e);return t.__="slt",t.s=n,t}function Ce(e){var n,r=e.components,i=e.customComponent,o=e.apiKey,u=e.visitorToken,s=e.tls,c=e.tag,l=e.extendedResult,f=e.linkedId,d=e.algorithm;return (n={}).c=o,n.url=location.href,n.t=function(e){if(e&&"object"==typeof e)return e;if(null==e)return;return {tag:e}}(c),n.cbd=l?1:void 0,n.lid=f,n.cr=document.referrer||void 0,n.a=d,n.s1=xe(r.osCpu,-1),n.s2=Pe(r.languages),n.s3=Pe(r.colorDepth),n.s4=xe(r.deviceMemory,-1),n.s5=Oe(r.screenResolution,(function(e){return {s:0,v:e.map((function(e){return null===e?-1:e}))}})),n.s6=Oe(r[5],(function(e){return {s:0,v:e.map((function(e){return null===e?-1:e}))}})),n.s7=xe(r.hardwareConcurrency,-1),n.s8=Le(r[6]),n.s9=Pe(r.timezone),n.s10=Pe(r.sessionStorage),n.s11=Pe(r.localStorage),n.s12=xe(r.indexedDB,-1),n.s13=Pe(r.openDatabase),n.s14=xe(r.cpuClass,-1),n.s15=Pe(r.platform),n.s16=xe(r.plugins,-1),n.s17=Oe(r.canvas,(function(e){return {s:0,v:__assign(__assign({},e),{geometry:murmurX64Hash128(e.geometry),text:murmurX64Hash128(e.text)})}})),n.s18=Le(r[7]),n.s19=Pe(r.touchSupport),n.s20=Pe(r.fonts),n.s21=Oe(r.audio,(function(e){return -1===e||-2===e||-3===e?{s:e,v:null}:{s:0,v:e}})),n.s22=xe(r[10],-1),n.s24=Pe(r[31]),n.s26=Le(r[8]),n.s27=Pe(r.vendor),n.s28=Pe(r.vendorFlavors),n.s30=xe(r[11],-1),n.s31=Pe(r[4]),n.s32=Pe(r.cookiesEnabled),n.s33=Pe(r[12]),n.s34=Ne(r[0]),n.s35=Ne(r[3]),n.s36=xe(r.domBlockers,-1),n.s37=xe(r.colorGamut,-1),n.s38=xe(r.contrast,-1),n.s39=xe(r.forcedColors,-1),n.s40=xe(r.hdr,-1),n.s41=xe(r.invertedColors,-1),n.s42=xe(r.monochrome,-1),n.s43=xe(r.reducedMotion,-1),n.s44=xe(r[13],-1),n.s45=Pe(r[14]),n.s46=Oe(r.math,(function(e){return {s:0,v:murmurX64Hash128(Object.keys(e).map((function(n){return n+"="+e[n]})).join(","))}})),n.s47=Oe(r.j,(function(e){return {s:e?0:-1,v:e?__assign(__assign({},e),{contextAttributes:murmurX64Hash128(e.contextAttributes),parameters:murmurX64Hash128(e.parameters),shaderPrecisions:murmurX64Hash128(e.shaderPrecisions),extensions:murmurX64Hash128(e.extensions),extensionParameters:murmurX64Hash128(e.extensionParameters),fingerprint:murmurX64Hash128(e.fingerprint)}):null}})),n.s48=Pe(r[15]),n.s49=xe(r[16],-1),n.s50=xe(r[17],-1),n.s51=Pe(r.fontPreferences),n.s52=Oe(r[2],(function(e){return {s:"number"==typeof e?e:e.length?0:1,v:"number"==typeof e?"":murmurX64Hash128(JSON.stringify(e))}})),n.s53=Ne(r[18]),n.s54=Le(r[1]),n.s55=function(e){var n=e[0],t=e[1];if(void 0!==n&&void 0!==t)return {s:0,v:n||t};if(void 0!==n)return {s:1,v:n};if(void 0!==t)return {s:2,v:t};return {s:-1,v:null}}(u),n.s56=function(e){if(!e)return {s:-1,v:null};if(e.error){var n=e.error;return function(e){return "slt"===e.__}(n)?{s:n.s,v:null}:{e:n.message}}return {s:0,v:e.value}}(s),n.s57=xe(r[19],-1),n.s58=xe(r[9],-1),n.s59=Pe(r[20]),n.s60=Pe(r[21]),n.s61=Pe(r[22]),n.s62=Pe(r[23]),n.s63=Pe(r[24]),n.s64=Pe(r[25]),n.s65=Pe(r[26]),n.s66=xe(r[27],-1),n.s67=i?{s:0,v:i}:{s:-1,v:null},n.s68=Pe(r[28]),n.s69=Ne(r[29]),n.s71=Pe(r[30]),n.s72=xe(r[32],-1),n}function Oe(e,n){return e.error?{e:De(e.error)}:n(e.value)}function De(e){var n;try{n=""+e.message,"name"in e&&(n=e.name+": "+n);}catch(e){n="Code 3017: "+e.name+": "+e.message;}return L(n,500)}function Pe(e){return Oe(e,(function(e){return {s:0,v:e}}))}function Ne(e){return Oe(e,(function(e){return e}))}function xe(e,n){return Oe(e,(function(e){return {s:null==e?n:0,v:null!=e?e:null}}))}function Le(e){return Oe(e,(function(e){return "number"==typeof e?{s:e,v:null}:{s:0,v:e}}))}var qe=M("WrongRegion"),je=M("SubscriptionNotActive"),Me=M("UnsupportedVersion");function Ue(e,n){var r=e.bodyData;return void 0===r?Ke(e):function(e){return e instanceof Object&&"2"===e.v&&e.products instanceof Object}(r)?function(e,n){var r=e.notifications,i=e.requestId,o=e.error,a=e.products;if(We(r),o)return Fe(o,i,n);var u=a.identification;if(!u)throw new Error("There is no identification result in the response");if(We(u.notifications),u.error)return Fe(u.error,i,n);return [__assign({requestId:i},u.data.result),u.data.visitorToken]}(r,n):Ke(e)}function Fe(e,n,t){switch(e.code){case"NotAvailableForCrawlBots":return Be(n,!0,t);case"NotAvailableWithoutUA":return Be(n,void 0,t);case"Failed":case"RequestTimeout":return Ge(Ve(e),n,e);default:throw Ge(Ve(e),n,e)}}function Ve(e){var n,t=e.code,r=e.message;return void 0===t?r:null!==(n=function(e){switch(e){case"TokenRequired":return "Token required";case"TokenNotFound":return "Token not found";case"TokenExpired":return "Token expired";case"RequestCannotBeParsed":return "Request cannot be parsed";case"Failed":return "Request failed";case"RequestTimeout":return "Request failed to process";case"TooManyRequests":return "Too many requests, rate limit exceeded";case"OriginNotAvailable":return "Not available for this origin";case"HeaderRestricted":return "Not available with restricted header";case"NotAvailableForCrawlBots":return "Not available for crawl bots";case"NotAvailableWithoutUA":return "Not available when User-Agent is unspecified"}}(t))&&void 0!==n?n:M(t)}function Be(e,n,r){var i={requestId:e,visitorFound:!1,visitorId:"",confidence:{score:.9,comment:"The real score is unknown"}};if(!r)return [i];var o="n/a",a=__assign(__assign({},i),{bot:{probability:1},incognito:!1,browserName:o,browserVersion:o,device:o,ip:o,os:o,osVersion:o});return void 0!==n&&(a.bot.safe=n),[a]}function Ge(e,n,t){var r=new Error(e);return void 0!==n&&(r.requestId=n),void 0!==t&&(r.raw=t),r}function We(e){null==e||e.forEach($e);}function $e(e){var n=e.level,t=e.message;"error"===n?console.error(t):"warning"===n?console.warn(t):console.log(t);}function Ke(e){var n=Ge("Response cannot be parsed",void 0,{httpStatusCode:e.status,bodyBase64:j(e.body)});if(e.status>=500)return n;throw n}function He(e,n,t,r,i){void 0===i&&(i=B);var o=i()%(t+1),a=function(e){if("function"==typeof TextEncoder)return (new TextEncoder).encode(e);for(var n=unescape(encodeURI(e)),t=new Uint8Array(n.length),r=0;r<n.length;++r)t[r]=n.charCodeAt(r);return t}(JSON.stringify(e)),u=1+n.length+1+o+r+a.length,s=new ArrayBuffer(u),c=new Uint8Array(s),l=0,f=i();c[l++]=f;for(var d=0,v=n;d<v.length;d++){var h=v[d];c[l++]=f+h;}c[l++]=f+o;for(var g=0;g<o;++g)c[l++]=i();var m=new Uint8Array(r);for(g=0;g<r;++g)m[g]=i(),c[l++]=m[g];for(g=0;g<a.length;++g)c[l++]=a[g]^m[g%r];return s}function Xe(e,n,t){var r=function(){throw new Error("Invalid data")},i=C(e);i.length<n.length+2&&r();for(var o=0;o<n.length;++o)q(i[1+o],i[0])!==n[o]&&r();var a=1+n.length,u=q(i[a],i[0]);i.length<a+1+u+t&&r();var s=a+1+u,c=s+t,l=new Uint8Array(i.length-c);for(o=0;o<l.length;++o)l[o]=i[c+o]^i[s+o%t];return JSON.parse(N(l))}var Je=[3,7];function ze(r){return __awaiter(this,void 0,void 0,(function(){var e,i,o;return __generator(this,(function(n){switch(n.label){case 0:return [4,X(__assign(__assign({},r),{body:(u=r.body,He(u,Je,3,7)),responseFormat:"binary"}))];case 1:e=n.sent();try{a=e.body,i=Xe(a,Je,7),o=!0;}catch(s){try{i=JSON.parse(N(e.body)),o=!1;}catch(c){}}return [2,__assign(__assign({},e),{bodyData:i,isSecret:o})]}var a,u;}))}))}function Ye(e,n){if(n)return n;var t="api.fpjs.io";return "us"!==e&&(t=e+"."+t),"https://"+t}function Qe(i,o,a){var u=i.endpoint,s=i.extendedResult,c=void 0!==s&&s,l=__rest(i,["endpoint","extendedResult"]);return __awaiter(this,void 0,void 0,(function(){var r,i,s;return __generator(this,(function(f){switch(f.label){case 0:return r=(d=u)+(-1===d.indexOf("?")?"?":"&")+"ci=js/"+encodeURIComponent("3.5.7"),i=Ce(__assign({extendedResult:c},l)),s=0,[4,Q(a,(function(){return {e:15,endpoint:r,request:i}}),(function(e){return {e:16,result:e}}),(function(e){return {e:17,error:e}}),(function(){return function(e,t){var r,i=_(300,1e4);return S(null==t?void 0:t.catch((function(e){r||(r=e);})).then((function(){throw r})),(function(){var o,a,u;return __generator(this,(function(n){switch(n.label){case 0:return o=Date.now(),[4,e(t)];case 1:return (a=n.sent())instanceof Error?(r=a,u=i.next().value,[4,b(o+u-Date.now())]):[2,a];case 2:n.sent(),n.label=3;case 3:return [3,0];case 4:return [2]}}))}))}((function(t){return function(t,r,i,o,a,u){return __awaiter(this,void 0,void 0,(function(){var e,s;return __generator(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,Q(u,(function(){return {e:18,tryNumber:o}}),(function(e){var n=e.status,t=e.body,r=e.bodyData,i=e.isSecret;return {e:19,tryNumber:o,status:n,body:null!=r?r:t,isSecret:i}}),(function(e){return {e:20,tryNumber:o,error:e}}),(function(){return ze({url:t,method:"post",body:r,headers:{"Content-Type":"text/plain"},withCredentials:!0,abort:a})}))];case 1:return e=n.sent(),[3,3];case 2:return s=n.sent(),[2,new Error("AbortError"===s.name?"Network request aborted":"Network connection error")];case 3:return [2,Ue(e,i)]}}))}))}(r,i,c,s++,t,a)}),o)}))];case 1:return [2,f.sent()]}var d;}))}))}function Ze(){var e,n,t=en();return (null===(n=null===(e=window[t[0]])||void 0===e?void 0:e[t[1]])||void 0===n?void 0:n[t[2]])||1073741824}function en(){return Xe(new Uint32Array([1238629110,448276002,3812774028,808844344,1040086494,3917076003,2006609522,3391962601,1618783843,902064594,3846817827,1945380650,2587245025,908308022,938305751,2922813991,1910122279,3709215973,809499767,66414809,3983071030,916072247,3711377838,822474088,300514777,4182498348,953759295,3408360096,591258990,229539788]),[],5)}function nn(){var e,n,t=on();try{n=A()?null===(e=window.top)||void 0===e?void 0:e[t[0]]:window[t[0]];}catch(r){if("SecurityError"===r.name)return !1;throw r}if(!n)return !1;try{n[t[1]][t[2]](t[3],t[4],{},(function(){}));}catch(r){return !new RegExp(t[5]).test(r)}return !1}function tn(){return __awaiter(this,void 0,void 0,(function(){var e,t,r;return __generator(this,(function(n){switch(n.label){case 0:e=document,t=on(),(r=e.createElement("iframe")).style.display="none",n.label=1;case 1:return e.body?[3,3]:[4,b(50)];case 2:return n.sent(),[3,1];case 3:return n.trys.push([3,,5,6]),e.body.appendChild(r),[4,Promise.race([b(20,!1),new Promise((function(e){r.contentWindow?r.contentWindow[t[6]].addEventListener("error",(function(){return e(!0)})):e(!1);}))])];case 4:return [2,n.sent()];case 5:return r.remove(),[7];case 6:return [2]}}))}))}function rn(){var e=window.openDatabase,n=window.localStorage;try{e(null,null,null,null);}catch(t){return !0}try{return n.setItem("test","1"),n.removeItem("test"),!1}catch(t){return !0}}function on(){return Xe(new Uint32Array([571803394,2333197341,667974149,459532809,2807590137,1996360231,241878290,3893584866,1793199716,1479125268,4262158585,1442777440,325646623,3826480888,665278571,175243026,2757050360,1760166496,1415636746,2836884200,2012960809,241499411,2840995822,1912086370,1482750223,4212860839,1726092917,359464731,3894101733,1487478637]),[],3)}var an=[[function(){return isChromium()},function(){return x(["ClipboardItem"in(t=window),"PerformanceEventTiming"in t,"RTCSctpTransport"in t])>=2?function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r,i,o;return __generator(this,(function(n){switch(n.label){case 0:return e=en(),t=navigator,r=t[e[3]],(i=t[e[4]])?[4,new Promise((function(n){i[e[5]]((function(e,t){return n(t)}));}))]:[3,2];case 1:return o=n.sent(),[3,4];case 2:return (null==r?void 0:r[e[6]])?[4,r[e[6]]().then((function(e){return e.quota}))]:[3,4];case 3:o=n.sent(),n.label=4;case 4:return o?[2,o<Ze()]:[2,!1]}}))}))}():function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(n){switch(n.label){case 0:return (e=window.webkitRequestFileSystem)?[4,new Promise((function(n){e(0,1,(function(){return n(!1)}),(function(){return n(!0)}));}))]:[2,!1];case 1:return [2,n.sent()]}}))}))}();var t;}],[function(){return isWebKit()},function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return ne()?isDesktopSafari()?[2,nn()]:[2,tn()]:[2,rn()]}))}))}],[function(){return isGecko()},function(){return new Promise((function(e){try{var n=indexedDB.open("test");n.onerror=function(){return e(!0)},n.onsuccess=function(){return e(!1)};}catch(t){return e(!0)}}))}],[function(){return isTrident()||isEdgeHTML()},function(){try{if(!window.indexedDB)return !0}catch(e){return !0}return !1}]];function un(t){var r=t.storageKeyPrefix;return __awaiter(this,void 0,void 0,(function(){var e,t,i;return __generator(this,(function(n){switch(n.label){case 0:return void 0!==(t=function(e){try{var n=localStorage.getItem(e);if(!n)return;return "1"===n}catch(t){return}}(e=r+"_i"))?[2,t]:[4,sn()];case 1:return i=n.sent(),function(e,n){try{localStorage.setItem(e,n?"1":"0");}catch(t){}}(e,i),[2,i]}}))}))}function sn(){return __awaiter(this,void 0,void 0,(function(){var e,t,r,i,o;return __generator(this,(function(n){switch(n.label){case 0:e=0,t=an,n.label=1;case 1:return e<t.length?(r=t[e],i=r[0],o=r[1],i()?[4,o()]:[3,3]):[3,4];case 2:return [2,n.sent()];case 3:return e++,[3,1];case 4:return [2,!1]}}))}))}function cn(){var e=window;if(!isChromium())return !1;try{if([66,114,97,118,101].map((function(e){return String.fromCharCode(e)})).join("")in e)return !0;var n=document.createElement("canvas");n.width=4,n.height=4,n.style.display="inline";var t=n.toDataURL();if(""===t)return !0;for(var r=window.atob(t.split(",")[1]),i=r.length,o=new Uint8Array(i),a=0;a<i;a++)o[a]=r.charCodeAt(a);var u=P(o,[73,68,65,84,24]);if(-1===u)return !1;var c=P(o,[73,69,78,68]);return -1!==c&&1321!==o.slice(u+5,c).reduce((function(e,n){return e+n}),0)}catch(l){return !1}}function ln(){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(n){switch(n.label){case 0:return e=[],[4,I(R(2e3,-4),fn.bind(null,(function(n){return e.push(n)})))];case 1:return t=n.sent(),[2,function(){var n=t();return 0===n||-4===n?{s:n,v:__spreadArrays(e)}:{s:n,v:null}}]}}))}))}function fn(t){return __awaiter(this,void 0,void 0,(function(){var e,r,i;return __generator(this,(function(n){switch(n.label){case 0:if(e=window,!(r=e.RTCPeerConnection||e.webkitRTCPeerConnection))return [2,-3];try{i=new r({iceServers:Xe(new Uint32Array([1116284708,2807606666,1856165634,1993636598,3410021538,3195192872,1656883084,2598385300,3564798284,1087152758,1841329857,3355624888,3127755894,1804885912,4294258839]),[],7).map((function(e){return {urls:"stun:"+e}}))});}catch(o){if("NotSupportedError"===o.name)return [2,-6];throw o}n.label=1;case 1:return n.trys.push([1,,3,4]),[4,new Promise((function(e,n){var r,a=!1;i.onicecandidate=function(n){var r=n.candidate;if(!r)return e(0);var i=r.candidate;i&&(t(i),!a&&/ typ [sp]rflx /.test(i)&&(a=!0,E(e,10,0)));},i.onicegatheringstatechange=function(){"complete"===i.iceGatheringState&&e(0);};try{null===(r=i.createDataChannel)||void 0===r||r.call(i,"test");}catch(o){return void("NotSupportedError"===o.name?e(-7):n(o))}var u=function(e,n){try{return e.createOffer(n)}catch(o){if(/\bcreateOffer\b.*(\bcallback\b.*\bnot a function\b|\barguments required\b.*\bpresent\b)/i.test(o.message))return new Promise((function(t,r){e.createOffer(t,r,n);}));throw o}}(i,isEdgeHTML()?{offerToReceiveAudio:!0}:void 0);void 0===u?e(-8):u.then((function(e){return i.setLocalDescription(e)}),n);}))];case 2:return [2,n.sent()];case 3:try{i.close();}catch(a){}return [7];case 4:return [2]}}))}))}function dn(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(n){switch(n.label){case 0:if("function"!=typeof(e=window.ApplePaySession))return [2,{s:-1,v:null}];n.label=1;case 1:return n.trys.push([1,4,,5]),e.canMakePayments()?isWebKit()&&!ne()?[2,{s:0,v:1}]:[4,new Promise((function(e){return setTimeout(e,0)}))]:[2,{s:0,v:0}];case 2:return n.sent(),[4,Promise.race([e.canMakePaymentsWithActiveCard(""),R(100,!1)])];case 3:return [2,{s:0,v:n.sent()?3:2}];case 4:return [2,vn(n.sent())];case 5:return [2]}}))}))}function vn(e){if("InvalidAccessError"===e.name){if(/\bfrom\b.*\binsecure\b/i.test(e.message))return {s:-2,v:null};if(/\bdifferent\b.*\borigin\b.*top.level\b.*\bframe\b/i.test(e.message))return {s:-3,v:null}}throw e}function hn(){return !!gn("dark")||!gn("light")&&void 0}function gn(e){return matchMedia("(prefers-color-scheme: "+e+")").matches}function mn(){var e=Date.now();return [pn(e),pn(e-6e4*(new Date).getTimezoneOffset())]}function pn(e){var n=Number(e);return isNaN(n)?-1:n}function bn(){var e=window.performance;if(null==e?void 0:e.now){for(var n=1,t=1,r=e.now(),i=r,o=0;o<5e4;o++)if((r=i)<(i=e.now())){var a=i-r;a>n?a<t&&(t=a):a<n&&(t=n,n=a);}return [n,t]}}function yn(){var e,n;return null===(n=null===(e=window.performance)||void 0===e?void 0:e.memory)||void 0===n?void 0:n.jsHeapSizeLimit}var wn=["MAX_TEXTURE_MAX_ANISOTROPY_EXT","FRAGMENT_SHADER_DERIVATIVE_HINT_OES","MAX_COLOR_ATTACHMENTS_WEBGL","MAX_DRAW_BUFFERS_WEBGL","DRAW_BUFFER0_WEBGL","DRAW_BUFFER1_WEBGL","VERTEX_ARRAY_BINDING_OES","TIMESTAMP_EXT","GPU_DISJOINT_EXT","MAX_VIEWS_OVR"],En=[10752,2849,2884,2885,2886,2928,2929,2930,2931,2932,2960,2961,2962,2963,2964,2965,2966,2967,2968,2978,3024,3042,3088,3089,3106,3107,32773,32777,32777,32823,32824,32926,32928,32936,32937,32938,32939,32968,32969,32970,32971,3317,33170,3333,3379,3386,33901,33902,34016,34024,34076,3408,3410,3411,3412,3413,3414,3415,34467,34816,34817,34818,34819,34877,34921,34930,35660,35661,35724,35738,35739,36003,36004,36005,36347,36348,36349,37440,37441,37443,7936,7937,7938],Rn=[32926,32928],Tn=["FRAGMENT_SHADER","VERTEX_SHADER"],Sn=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"];function In(e,n,t){var r=e.getShaderPrecisionFormat(e[n],e[t]);return r?[r.rangeMin,r.rangeMax,r.precision]:[]}function kn(e){return "string"==typeof e&&!e.match(/[^A-Z0-9_x]/)}function An(e){return Object.keys(e.__proto__).filter(kn)}function _n(){for(var e=document.createElement("canvas"),n=["webgl","experimental-webgl"],r=void 0,i=0;i<n.length&&!r;i++)try{r=e.getContext(n[i]);}catch(a){}if(r){var o=__assign(__assign({},function(e){var n,t,r,i,o,a,u=e.getSupportedExtensions(),s=e.getExtension("WEBGL_debug_renderer_info"),c=e.getContextAttributes(),l=[],d=[],v=[],h=[];for(var g in c)Object.prototype.hasOwnProperty.call(c,g)&&l.push(g+"="+c[g]);for(var m=An(e),p=isTrident(),b=0,y=m;b<y.length;b++){var w=e[_=y[b]];if(En.indexOf(w)>-1){var E=p&&-1===Rn.indexOf(w)?e.getParameter(w):null;d.push(_+"("+w+")="+E);}else d.push(_+"="+w);}if(u)for(var R=0,T=u;R<T.length;R++){var S=T[R],I=e.getExtension(S);if(I)for(var k=0,A=An(I);k<A.length;k++){var _;w=I[_=A[k]],wn.indexOf(_)>0?v.push(_+"("+w+")="+e.getParameter(w)):v.push(_+"="+w);}}for(var C=0,O=Tn;C<O.length;C++)for(var D=O[C],P=0,N=Sn;P<N.length;P++){var x=N[P],L=In(e,D,x);h.push(D+"."+x+"="+L.join(","));}return v.sort(),d.sort(),{version:(null===(n=e.getParameter(e.VERSION))||void 0===n?void 0:n.toString())||"",vendor:(null===(t=e.getParameter(e.VENDOR))||void 0===t?void 0:t.toString())||"",vendorUnmasked:s?null===(r=e.getParameter(s.UNMASKED_VENDOR_WEBGL))||void 0===r?void 0:r.toString():"",renderer:(null===(i=e.getParameter(e.RENDERER))||void 0===i?void 0:i.toString())||"",rendererUnmasked:s?null===(o=e.getParameter(s.UNMASKED_RENDERER_WEBGL))||void 0===o?void 0:o.toString():"",shadingLanguageVersion:(null===(a=e.getParameter(e.SHADING_LANGUAGE_VERSION))||void 0===a?void 0:a.toString())||"",contextAttributes:l.join("&"),parameters:d.join("&"),shaderPrecisions:h.join("&"),extensions:u?u.join(","):"",extensionParameters:v.join(",")}}(r)),{fingerprint:""});return function(e){e.clearColor(0,0,1,1);var n=e.createProgram();if(n){i(0,"attribute vec2 p;uniform float t;void main(){float s=sin(t);float c=cos(t);gl_Position=vec4(p*mat2(c,s,-s,c),1,1);}"),i(1,"void main(){gl_FragColor=vec4(1,0,0,1);}"),e.linkProgram(n),e.useProgram(n),e.enableVertexAttribArray(0);var t=e.getUniformLocation(n,"t"),r=e.createBuffer();e.bindBuffer(34962,r),e.bufferData(34962,new Float32Array([0,1,-1,-1,1,-1]),35044),e.vertexAttribPointer(0,2,5126,!1,0,0),e.clear(16384),e.uniform1f(t,3.65),e.drawArrays(4,0,3);}function i(t,r){var i=e.createShader(35633-t);n&&i&&(e.shaderSource(i,r),e.compileShader(i),e.attachShader(n,i));}}(r),o.fingerprint=e.toDataURL(),o}}function Cn(){var t=window.speechSynthesis;if("function"!=typeof(null==t?void 0:t.getVoices))return -1;var r=function(){return t.getVoices()};return !t.addEventListener||isGecko()&&te()?On(r()):function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(n){switch(n.label){case 0:return n.trys.push([0,,2,3]),[4,new Promise((function(n,r){var i,o=function(){t.getVoices().length?(null==i||i(),i=y(n,50)):i||(i=E(n,600));};e=function(){try{o();}catch(e){r(e);}},o(),t.addEventListener("voiceschanged",e);}))];case 1:return [2,n.sent()];case 2:return e&&t.removeEventListener("voiceschanged",e),[7];case 3:return [2]}}))}))}(t).then((function(){return function(){var e=r();return e.length?On(e):-2}}))}function On(e){var n=function(e){return e.replace(/([,\\])/g,"\\$1")};return e.map((function(e){return [n(e.voiceURI),n(e.name),n(e.lang),e.localService?"1":"0",e.default?"1":"0"].join(",")})).sort()}function Dn(){return {s:isWebKit()&&!isDesktopSafari()?ne()?0:1:2,v:[(typeof SourceBuffer).slice(0,3),(typeof SourceBufferList).slice(0,3)]}}var Pn={m:["$$s-macbook-pro","$$s-macbook-air","$$s-mac-mini"],i:["$$s-iphone"]},Nn={m:["macbook-pro-$$","macbook-air-$$","mac-mini-$$"],i:["iphone-$$"]},xn={us:["james","mary","john","patricia","robert","jennifer","michael","linda","william","elizabeth","david","barbara","richard","susan","joseph","jessica","thomas","sarah","charles","karen","christopher","nancy","daniel","lisa","matthew","margaret","anthony","betty","donald","sandra"],gb:["oliver","george","noah","arthur","harry","leo","muhammad","jack","charlie","oscar","jacob","henry","thomas","joshua","william","olivia","amelia","isla","ava","mia","isabella","sophia","grace","lily","freya","emily","ivy","ella","rosie","charlotte"],ru:["aleksandr","sergej","vladimir","elena","tatana","andrej","aleksej","olga","nikolaj","natala","anna","ivan","dmitrij","irina","maria","mihail","svetlana","ekaterina","evgenij","viktor","anastasia","urij","ulia","valentin","roman","igor","anatolij","oleg","pavel","maksim"]},Ln={m:["macbook-pro","macbook-air","mac-mini","mac-pro"],i:["iphone","iphone-2"]};function qn(t){return __awaiter(this,void 0,void 0,(function(){var r,i,o,a,u,s,c,l,f=this;return __generator(this,(function(d){switch(d.label){case 0:if(!(r=window.RTCPeerConnection))return [2,-5];i=Math.random().toString(),o=new Map,u="candidate:0 1 udp 2113937151 $ad $pt typ host generation 0 ufrag "+(a="ABCD")+" network-cost 999",s=new r({iceTransportPolicy:"all"}),c=s.createDataChannel(i),l=0,d.label=1;case 1:return d.trys.push([1,,3,4]),[4,new Promise((function(r,i){E((function(){return r(-4)}),1e3),s.oniceconnectionstatechange=function(){"checking"===s.iceConnectionState&&(l=setInterval((function(){return __awaiter(f,void 0,void 0,(function(){var e,t;return __generator(this,(function(n){switch(n.label){case 0:return "checking"!==s.iceConnectionState?[2,r([])]:[4,s.getStats()];case 1:return e=n.sent(),t=[],e.forEach((function(e){if("remote-candidate"===e.type){var n=o.get(e.port);t.push(n);}})),t.length>0&&r(t),[2]}}))}))}),30));},s.createOffer().then((function(e){var n=e.sdp;if(!n)return r(-5);for(var i=[],c=0;c<t.length;c++){var l=t[c],f=50003+c,d=u.replace("$ad",l).replace("$pt",f.toString());o.set(f,l),i.push("a="+d);}var v={type:"answer",sdp:n.replace(/a=ice-ufrag:(.*?)\s{1,2}/,"a=ice-ufrag:"+a+"\r\n").replace(/a=setup:(.*?)\s{1,2}/,"a=setup:active\r\n").replace(/c=IN IP4 ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/,(function(e,n){return "c=IN IP4 "+n+"\r\nb=AS:30\r\n"+i.join("\r\n")}))};return s.setLocalDescription(e),s.setRemoteDescription(v)}),i);}))];case 2:return [2,d.sent()];case 3:return c.close(),s.close(),clearInterval(l),[7];case 4:return [2]}}))}))}function jn(t){return __awaiter(this,void 0,void 0,(function(){var r,o=this;return __generator(this,(function(a){switch(a.label){case 0:r=new AbortController,a.label=1;case 1:return a.trys.push([1,,3,4]),[4,Promise.race(__spreadArrays(t.map((function(t){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,fetch("http"+("http:"===location.protocol?"":"s")+"://"+t,{signal:r.signal})];case 1:return e.sent(),[3,3];case 2:return e.sent(),[3,3];case 3:return [2,t]}}))}))})),[R(500,-4)]))];case 2:return [2,a.sent()];case 3:return r.abort(),[7];case 4:return [2]}}))}))}function Mn(){for(var e=!isDesktopSafari(),n=navigator.language.toLowerCase(),r=function(){var e={"en-us":__assign(__assign({},Pn),{n:xn.us}),"en-gb":__assign(__assign({},Pn),{n:xn.gb}),"ru-ru":__assign(__assign({},Nn),{n:xn.ru})};return e.default=e["en-us"],e.en=e["en-us"],e.ru=e["ru-ru"],e}(),i=r[n]||r[n.slice(0,2)]||r.default,o=e?i.i.slice():i.m.slice(),a=e?Ln.i.slice():Ln.m.slice(),u=0,s=e?i.n:i.n.slice(0,15);u<s.length;u++)for(var c=s[u],f=0,d=o;f<d.length;f++){var v=d[f];a.push(v.replace("$$",c));}return a.map((function(e){return e+".local"}))}function Un(t){return __awaiter(this,void 0,void 0,(function(){var e,r;return __generator(this,(function(n){switch(n.label){case 0:return !isWebKit()||(i=window,x(["mediaSession"in navigator,"BigInt64Array"in i,"FormDataEvent"in i,"ImageBitmap"in i,"WebGL2RenderingContext"in i,"onclose"in i])>=4)?[2,-2]:[4,qn(e=Mn())];case 1:return r=n.sent(),null==t||t(),"number"==typeof r?[2,r]:r.length===e.length?[2,-3]:r.length>1?[2,jn(r)]:1===r.length?[2,r[0]]:[2,-1]}var i;}))}))}function Fn(){var e,n,t,r=((t=new Promise((function(t,r){e=t,n=r;}))).resolve=e,t.reject=n,t),i=R(isDesktopSafari()?310:410);return I(Promise.race([r,i]).then((function(e){if(void 0!==e)return R(e+100-Date.now())})).then((function(){return -4})),(function(){return Un((function(){return r.resolve(Date.now())}))}))}var Vn=["brands","mobile","platform","platformVersion","architecture","bitness","model","uaFullVersion"];function Bn(){var t;return __awaiter(this,void 0,void 0,(function(){var r,i,o,a=this;return __generator(this,(function(u){switch(u.label){case 0:return (r=navigator.userAgentData)&&"object"==typeof r?(i={},o=[],"function"!=typeof r.getHighEntropyValues?[3,2]:[4,Promise.all(Vn.map((function(t){return __awaiter(a,void 0,void 0,(function(){var e,a;return __generator(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,r.getHighEntropyValues([t])];case 1:return void 0!==(e=n.sent()[t])&&(i[t]="string"==typeof e?e:JSON.stringify(e)),[3,3];case 2:if("NotAllowedError"!==(a=n.sent()).name)throw a;return o.push(t),[3,3];case 3:return [2]}}))}))})))]):[2,void 0];case 1:u.sent(),u.label=2;case 2:return [2,{b:r.brands.map((function(e){return {b:e.brand,v:e.version}})),m:r.mobile,p:null!==(t=r.platform)&&void 0!==t?t:null,h:i,nah:o}]}}))}))}function Gn(){var e=document.createElement("a").attributionsourceid;return void 0===e?void 0:String(e)}function Wn(){return function(e){for(var n,t,r=[],i=e;;)try{var o=null===(n=i.location)||void 0===n?void 0:n.href,a=null===(t=i.document)||void 0===t?void 0:t.referrer;if(void 0===o||void 0===a)return {s:1,v:r};r.push({l:o,f:a});var u=i.parent;if(!u||u===i)return {s:0,v:r};i=u;}catch(s){if($n(s))return {s:1,v:r};throw s}}(window)}function $n(e){if(!e||"object"!=typeof e)return !1;var n=e;return !(!isTrident()&&!isEdgeHTML()||"Error"!==n.name&&"TypeError"!==n.name||"Permission denied"!==n.message)||"SecurityError"===n.name}function Kn(){return function(e){var n=e.location,t=e.origin,r=n.origin,i=n.ancestorOrigins,o=null;if(i){o=new Array(i.length);for(var a=0;a<i.length;++a)o[a]=i[a];}return {w:null==t?null:t,l:null==r?null:r,a:o}}(window)}function Hn(){return eval.toString().length}function Xn(){var t=this;return I(b(250,-2),(function(){return __awaiter(t,void 0,void 0,(function(){var e;return __generator(this,(function(n){switch(n.label){case 0:return (null==(e=navigator.mediaDevices)?void 0:e.enumerateDevices)?[4,e.enumerateDevices()]:[2,-1];case 1:return [2,n.sent().map((function(e){return {d:e.deviceId,g:e.groupId,k:e.kind,l:e.label}}))]}}))}))}))}function Jn(){return navigator.webdriver}function zn(){var e;return null!==(e=navigator.doNotTrack)&&void 0!==e?e:void 0}function Yn(){var e;return null!==(e=window.devicePixelRatio)&&void 0!==e?e:void 0}function Qn(){var t=this;return I(b(75,-3),(function(){return __awaiter(t,void 0,void 0,(function(){var e,t,r,i;return __generator(this,(function(n){switch(n.label){case 0:if(!(e=navigator).requestMediaKeySystemAccess)return [2,-1];n.label=1;case 1:return n.trys.push([1,6,,7]),[4,e.requestMediaKeySystemAccess("org.w3.clearkey",[{initDataTypes:["keyids","webm"],audioCapabilities:["opus","vorbis"].map((function(e){return {contentType:'audio/webm; codecs="'+e+'"'}})),videoCapabilities:["vp9","vp8"].map((function(e){return {contentType:'video/webm; codecs="'+e+'"'}}))}])];case 2:return [4,n.sent().createMediaKeys()];case 3:return t=n.sent(),(r=t.createSession()).sessionId?[3,5]:[4,new Promise((function(e){r.onmessage=e,r.generateRequest("webm",new Uint8Array([1,1,1,1]));}))];case 4:n.sent(),n.label=5;case 5:return [2,r.sessionId];case 6:if("NotSupportedError"===(i=n.sent()).name)return [2,-2];throw i;case 7:return [2]}}))}))}))}function Zn(){var e=window.WebAssembly;if(null==e?void 0:e.validate){for(var n=[0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10],t=0,r=0,o=[[9,1,7,0,65,0,253,15,26,11,0,10,4,110,97,109,101,2,3,1,0,0],[240,67,0,0,0,12,1,10,0,252,2,3,1,1,0,0,110,26,11,161,10],[6,1,4,0,18,0,11,0,10,4,110,97,109,101,2,3,1,0,0],[8,1,6,0,65,0,192,26,11,0,10,4,110,97,109,101,2,3,1,0,0],[7,1,5,0,208,112,26,11,0,10,4,110,97,109,101,2,3,1,0,0]];r<o.length;r++){var a=o[r];t<<=1,t|=e.validate(Uint8Array.of.apply(Uint8Array,__spreadArrays(n,a)))?1:0;}return t}}function et(){for(var e=[],n=Math.random(),t=24575;t>=0;--t)if(t%4096==0){var r=Math.random();e.push((n-r)*Math.pow(2,31)|0),n=r;}return e}function nt(){var t;return __awaiter(this,void 0,void 0,(function(){var r,i,o,a,u,s,c=this;return __generator(this,(function(l){switch(l.label){case 0:if(!(r=null===(t=window.crypto)||void 0===t?void 0:t.subtle)||!r.generateKey||!r.exportKey)return [2,-1];i=function(){return __awaiter(c,void 0,void 0,(function(){var e,t;return __generator(this,(function(n){switch(n.label){case 0:return [4,r.generateKey({name:"AES-GCM",length:128},!0,["encrypt"])];case 1:return e=n.sent(),[4,r.exportKey("raw",e)];case 2:return t=n.sent(),[2,new Uint8Array(t)]}}))}))},l.label=1;case 1:return l.trys.push([1,3,,4]),[4,Promise.all([i(),i()])];case 2:for(o=l.sent(),a=new Uint8Array(o[0].length),u=0;u<o[0].length;++u)a[u]=165^o[0][u]^o[1][u];return [2,j(a)];case 3:if("NotSupportedError"===(s=l.sent()).name)return [2,-2];throw s;case 4:return [2]}}))}))}function tt(i){var o=this,a=i.delayFallback,b=__rest(i,["delayFallback"]),y=loadSources(function(){var e;return (e={})[0]=ln,e[1]=Fn,e}(),b,[]),w=prepareForSources(a).then((function(){sources.screenFrame;var e=__rest(sources,["screenFrame"]);return loadSources(__assign(__assign(__assign({},function(){var e;return (e={})[2]=Cn,e[3]=dn,e[4]=un,e[5]=getScreenFrame,e[8]=Xn,e[7]=nt,e[6]=Qn,e[9]=Bn,e[10]=Zn,e[11]=zn,e[12]=cn,e[13]=hn,e[14]=mn,e[15]=et,e[16]=bn,e[17]=yn,e[18]=Dn,e[19]=Yn,e[20]=isTrident,e[21]=isEdgeHTML,e[22]=isChromium,e[23]=isWebKit,e[24]=isDesktopSafari,e[25]=isGecko,e[26]=isAndroid,e[27]=Gn,e[28]=te,e[29]=Wn,e[30]=Kn,e[31]=Hn,e[32]=Jn,e}()),e),function(){var e;return (e={}).j=_n,e}()),b,[])}));return function(){return __awaiter(o,void 0,void 0,(function(){var e,r,i;return __generator(this,(function(n){switch(n.label){case 0:return [4,Promise.all([y(),w.then((function(e){return e()}))])];case 1:return e=n.sent(),r=e[0],i=e[1],[2,__assign(__assign({},r),i)]}}))}))}}function rt(e){for(var n=e+"=",t=0,r=document.cookie.split(";");t<r.length;t++){for(var i=r[t],o=0;" "===i[o]&&o<i.length;)++o;if(i.indexOf(n)===o)return i.slice(o+n.length)}}function it(e,n,t,r){var i=e+"="+n,o="expires="+new Date(Date.now()+24*t*60*60*1e3).toUTCString(),a=r?"domain="+r:"";document.cookie=[i,"path=/",o,a,"SameSite=Lax"].join("; ");}function ot(e,n,t){var r=location.hostname;(at(r,(function(n){!function(e,n){it(e,"",-1,n);}(e,n);})),t<0)||at(r,(function(r){return it(e,n,t,r),rt(e)!==n}))&&it(e,n,t);}function at(e,n){var t=e.length;do{if(t=t>0?e.lastIndexOf(".",t-1):-1,!1===n(e.slice(t+1)))return !1}while(t>=0);return !0}function ut(e,n){ot(n,e,365),function(e,n){var t;try{null===(t=null===localStorage||void 0===localStorage?void 0:localStorage.setItem)||void 0===t||t.call(localStorage,e,n);}catch(r){}}(n,e);}function st(e){var n,t;try{return null!==(t=null===(n=null===localStorage||void 0===localStorage?void 0:localStorage.getItem)||void 0===n?void 0:n.call(localStorage,e))&&void 0!==t?t:void 0}catch(r){}}function ct(e,n,t,r,i){if(!n){var o=function(e,n){return n||(Object.prototype.hasOwnProperty.call(Re,e)||(e="us"),"https://tls-"+Re[e]+".fpapi.io")}(e,t);return Y(i,(function(){return {e:6,endpoint:o}})),[Te(o,r,i),Date.now()]}}function lt(r,i,o,a,u,s,c,l){var f=this,d=function(t,r,i,l,d,g,m){return __awaiter(f,void 0,void 0,(function(){var e,f,p,b,y,w,E,T,S;return __generator(this,(function(n){switch(n.label){case 0:return e=R(l).then((function(){throw new Error("Client timeout")})),[4,Promise.race([e,Promise.all([h(m),v(l,i,m)])])];case 1:return f=n.sent(),p=f[0],b=f[1],w=function(e){return [rt(e),st(e)]}(y=c+"_t"),[4,Qe({apiKey:o,endpoint:Ye(a,u),components:p,customComponent:g,tag:t,visitorToken:w,tls:b,linkedId:r,extendedResult:d,algorithm:s},e,m)];case 2:return E=n.sent(),T=E[0],(S=E[1])&&ut(S,y),[2,T]}}))}))},v=function(t,r,o){return __awaiter(f,void 0,void 0,(function(){var e,a,u,s,c;return __generator(this,(function(n){switch(n.label){case 0:if(!i||r)return [2,void 0];e=i[0],a=i[1],u=Math.min(Math.max(.1*t,a+1e4-Date.now()),.4*t),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,e(R(u))];case 2:return s=n.sent(),Y(o,(function(){return {e:7,result:s}})),[2,{value:s}];case 3:return c=n.sent(),Y(o,(function(){return {e:8,error:c}})),[2,{error:c}];case 4:return [2]}}))}))},h=function(t){return __awaiter(f,void 0,void 0,(function(){var e,i;return __generator(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,r()];case 1:return e=n.sent(),Y(t,(function(){return {e:13,result:e}})),[2,e];case 2:throw i=n.sent(),Y(t,(function(){return {e:14,error:i}})),i;case 3:return [2]}}))}))};return {get:function(e){void 0===e&&(e={});var n=l&&function(e,n){return function(r){return e(__assign(__assign({},r),{getCallId:n}))}}(l,V(8));return Q(n,(function(){return {e:3,options:e}}),(function(e){return {e:4,result:e}}),(function(e){return {e:5,error:e}}),(function(){var t=e.timeout,r=void 0===t?1e4:t,i=e.tag,o=e.linkedId,a=e.disableTls,u=e.extendedResult,s=e.environment;return d(i,U(o),a,r,u,s,n)}))}}}function ft(e,n,r){var i,o=G([null==r?void 0:r.debug,(i=/{(.*?)}/.exec(location.hash),!!i&&1915004642===function(e){for(var n=0,t=0;t<e.length;++t)n=(n<<5)-n+e.charCodeAt(t)|0;return n}(i[1])&&H())]),a=o&&function(e,n){return function(r){return e(__assign(__assign({},r),{agentId:n}))}}(o,V(8));return Q(a,(function(){return {e:0,version:"3.5.7",options:r}}),(function(){return {e:1}}),(function(e){return {e:2,error:e}}),(function(){var t=r.token,i=r.apiKey,o=void 0===i?t:i,u=r.region,s=void 0===u?"us":u,c=r.tlsEndpoint,l=r.disableTls,f=r.storageKey,d=void 0===f?"_vid":f,v=r.endpoint,h=r.delayFallback,g=r.algorithm;if(!o||"string"!=typeof o)throw new Error("Token required");var m=ct(s,l,c,n,a);return Y(a,(function(){return {e:12}})),lt(e({delayFallback:h,storageKeyPrefix:d}),m,o,s,v,U(g),d,a)}))}var dt=function(e){return ft(tt,void 0,e)},It={load:dt,ERROR_CLIENT_TIMEOUT:"Client timeout",ERROR_NETWORK_CONNECTION:"Network connection error",ERROR_NETWORK_ABORT:"Network request aborted",ERROR_WRONG_REGION:qe,ERROR_SUBSCRIPTION_NOT_ACTIVE:je,ERROR_API_KEY_MISSING:"Token required",ERROR_API_KEY_INVALID:"Token not found",ERROR_API_KEY_EXPIRED:"Token expired",ERROR_BAD_REQUEST_FORMAT:"Request cannot be parsed",ERROR_BAD_RESPONSE_FORMAT:"Response cannot be parsed",ERROR_GENERAL_SERVER_FAILURE:"Request failed",ERROR_SERVER_TIMEOUT:"Request failed to process",ERROR_RATE_LIMIT:"Too many requests, rate limit exceeded",ERROR_FORBIDDEN_ORIGIN:"Not available for this origin",ERROR_FORBIDDEN_HEADER:"Not available with restricted header",ERROR_UNSUPPORTED_VERSION:Me,ERROR_TOKEN_MISSING:"Token required",ERROR_TOKEN_INVALID:"Token not found",ERROR_TOKEN_EXPIRED:"Token expired"};
7866
+ function n(e,t){return function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(e,t)?e[t]:void 0}function o(e){for(var t="",r=0;r<e.length;++r)if(r>0){var n=e[r].toLowerCase();n!==e[r]?t+=" "+n:t+=e[r];}else t+=e[r].toUpperCase();return t}var i={default:"endpoint"},u={default:"tlsEndpoint"},l=/*#__PURE__*/o("WrongRegion"),f=/*#__PURE__*/o("SubscriptionNotActive"),E=/*#__PURE__*/o("UnsupportedVersion"),p=/*#__PURE__*/o("InstallationMethodRestricted"),_=/*#__PURE__*/o("HostnameRestricted");function k(t,r){var n=[];return function(t,r){var n=5,o=(d=t,s=__spreadArrays(d),{current:function(){return s[0]},postpone:function(){var e=s.shift();void 0!==e&&s.push(e);},exclude:function(){s.shift();}}),i=(a=100,R=3e3,c=0,function(){return Math.random()*Math.min(R,a*Math.pow(2,c++))}),u=o.current();var a,R,c;var d,s;if(void 0===u)return Promise.reject(new TypeError("The list of script URL patterns is empty"));var l=function(e,t){return r(e).catch((function(e){if(t+1>=n)throw e;!function(e){if(!(e instanceof Error))return !1;var t=e.message;return "Blocked by CSP"===t||"9319"===t}(e)?o.postpone():o.exclude();var r,u=o.current();if(void 0===u)throw e;return (r=i(),new Promise((function(e){return setTimeout(e,r)}))).then((function(){return l(u,t+1)}))}))};return l(u,0)}(t,(function(e){var t=new Date,o=function(){return n.push({url:e,startedAt:t,finishedAt:new Date})},i=r(e);return i.then(o,o),i})).then((function(e){return [e,{attempts:n}]}))}var b="https://fpnpmcdn.net/v<version>/<apiKey>/loader_v<loaderVersion>.js",D=b,C="Failed to load the JS script of the agent";function U(e){var o;e.scriptUrlPattern;var i=e.token,u=e.apiKey,a=void 0===u?i:u,R=__rest(e,["scriptUrlPattern","token","apiKey"]),c=null!==(o=n(e,"scriptUrlPattern"))&&void 0!==o?o:b;return Promise.resolve().then((function(){if(!a||"string"!=typeof a)throw new Error("API key required");return k(function(e,t){return (Array.isArray(e)?e:[e]).map((function(e){return function(e,t){var r=encodeURIComponent;return e.replace(/<[^<>]+>/g,(function(e){return "<version>"===e?"3":"<apiKey>"===e?r(t):"<loaderVersion>"===e?r("3.8.0"):e}))}(String(e),t)}))}(c,a),g).catch(q)})).then((function(e){var t=e[0],n=e[1];return t.load(__assign(__assign({},R),{ldi:n}))}))}function g(e){return function(e,t,r,n){var o,i=document,u="securitypolicyviolation",a=function(t){var r=new URL(e,location.href),n=t.blockedURI;n!==r.href&&n!==r.protocol.slice(0,-1)&&n!==r.origin||(o=t,R());};i.addEventListener(u,a);var R=function(){return i.removeEventListener(u,a)};return null==n||n.then(R,R),Promise.resolve().then(t).then((function(e){return R(),e}),(function(e){return new Promise((function(e){return setTimeout(e)})).then((function(){if(R(),o)return r(o);throw e}))}))}(e,(function(){return function(e){return new Promise((function(t,r){var n=document.createElement("script"),o=function(){var e;return null===(e=n.parentNode)||void 0===e?void 0:e.removeChild(n)},i=document.head||document.getElementsByTagName("head")[0];n.onload=function(){o(),t();},n.onerror=function(){o(),r(new Error(C));},n.async=!0,n.src=e,i.appendChild(n);}))}(e)}),(function(){throw new Error("Blocked by CSP")})).then(L)}function L(){var e=window,t="__fpjs_p_l_b",r=e[t];if(function(e,t){var r,n=null===(r=Object.getOwnPropertyDescriptor)||void 0===r?void 0:r.call(Object,e,t);(null==n?void 0:n.configurable)?delete e[t]:n&&!n.writable||(e[t]=void 0);}(e,t),"function"!=typeof(null==r?void 0:r.load))throw new Error("9319");return r}function q(e){throw e instanceof Error&&"9319"===e.message?new Error(C):e}var B={load:U,defaultScriptUrlPattern:D,ERROR_SCRIPT_LOAD_FAIL:C,ERROR_API_KEY_EXPIRED:"API key expired",ERROR_API_KEY_INVALID:"API key not found",ERROR_API_KEY_MISSING:"API key required",ERROR_BAD_REQUEST_FORMAT:"Request cannot be parsed",ERROR_BAD_RESPONSE_FORMAT:"Response cannot be parsed",ERROR_CLIENT_TIMEOUT:"Client timeout",ERROR_CSP_BLOCK:"Blocked by CSP",ERROR_FORBIDDEN_ENDPOINT:_,ERROR_FORBIDDEN_HEADER:"Not available with restricted header",ERROR_FORBIDDEN_ORIGIN:"Not available for this origin",ERROR_GENERAL_SERVER_FAILURE:"Request failed",ERROR_INSTALLATION_METHOD_RESTRICTED:p,ERROR_NETWORK_ABORT:"Network request aborted",ERROR_NETWORK_CONNECTION:"Network connection error",ERROR_RATE_LIMIT:"Too many requests, rate limit exceeded",ERROR_SERVER_TIMEOUT:"Request failed to process",ERROR_SUBSCRIPTION_NOT_ACTIVE:f,ERROR_TOKEN_EXPIRED:"API key expired",ERROR_TOKEN_INVALID:"API key not found",ERROR_TOKEN_MISSING:"API key required",ERROR_UNSUPPORTED_VERSION:E,ERROR_WRONG_REGION:l,defaultEndpoint:i,defaultTlsEndpoint:u};
10235
7867
 
10236
7868
  const reg = /fnapi\d*/;
10237
7869
  // const reg = /(?<=https:\/\/)\w+(?=(\.\w+\.\w+))/
@@ -10240,7 +7872,7 @@ const getDeviceToken = async ({ fpToken, sentry, apiURL }) => {
10240
7872
  let dt, endpoint;
10241
7873
  try {
10242
7874
  endpoint = apiURL.replace(reg, 'fp');
10243
- const fp = await It.load({ apiKey: fpToken, endpoint });
7875
+ const fp = await B.load({ apiKey: fpToken, endpoint });
10244
7876
  const result = await fp.get({ timeout: 30000 });
10245
7877
  dt = result.visitorId;
10246
7878
 
@@ -14341,6 +11973,357 @@ function game_search (request) {
14341
11973
  )
14342
11974
  }
14343
11975
 
11976
+ function game_search_v2 (request) {
11977
+ return createMachine(
11978
+ {
11979
+ id: 'game_search_v2',
11980
+ initial: 'preset',
11981
+ context: {
11982
+ keyword: '',
11983
+ tagId: null,
11984
+ mainTagList: [],
11985
+ tagList: [],
11986
+ gameList: [],
11987
+ recentlySearch: [],
11988
+ recentlyGame: [],
11989
+ youMayLike: [],
11990
+ // 以下變數為數據分析用
11991
+ selectedType: null,
11992
+ tagIndex: null,
11993
+ click: null,
11994
+ clickDefault: null,
11995
+ traceId: null,
11996
+ isYouMayLike: null,
11997
+ isRecentlyGame: null,
11998
+ isRecentlySearch: null,
11999
+ gameCode: null,
12000
+ },
12001
+ states: {
12002
+ preset: {
12003
+ invoke: {
12004
+ src: 'fetchTags',
12005
+ onDone: {
12006
+ target: 'loading',
12007
+ actions: 'setMainTagList',
12008
+ },
12009
+ onError: {
12010
+ target: 'fail',
12011
+ },
12012
+ },
12013
+ },
12014
+ loading: {
12015
+ invoke: {
12016
+ src: 'fetchInitialData',
12017
+ onDone: {
12018
+ target: 'idle',
12019
+ actions: 'setInitialData',
12020
+ },
12021
+ onError: {
12022
+ target: '#game_search_v2.fail',
12023
+ },
12024
+ },
12025
+ },
12026
+ idle: {
12027
+ on: {
12028
+ SET_MAIN_TAG_ID: {
12029
+ target: 'setGameList',
12030
+ actions: ['setMainTagId', 'setTraceData']
12031
+ },
12032
+ PLAY_GAME: {
12033
+ target: 'sendingTrace',
12034
+ actions: 'setGameCode',
12035
+ },
12036
+ START_SEARCH: {
12037
+ target: 'searching',
12038
+ actions: 'clearKeywords',
12039
+ },
12040
+ CLEAR_MAIN_TAG: {
12041
+ actions: 'clearMainTag',
12042
+ }
12043
+ },
12044
+ },
12045
+ setGameList: {
12046
+ always: [
12047
+ {
12048
+ target: 'idle',
12049
+ actions: 'setGames',
12050
+ cond: 'isRecentlyYouMayLike'
12051
+ },
12052
+ {
12053
+ target: 'fetchGameList',
12054
+ }
12055
+ ]
12056
+ },
12057
+ fetchGameList: {
12058
+ invoke: {
12059
+ src: 'fetchGames',
12060
+ onDone: {
12061
+ target: 'idle',
12062
+ actions: 'setGames',
12063
+ },
12064
+ onError: {
12065
+ target: '#game_search_v2.fail',
12066
+ },
12067
+ },
12068
+ },
12069
+ searching: {
12070
+ initial: 'searchIdle',
12071
+ states: {
12072
+ searchIdle: {
12073
+ on: {
12074
+ SET_TAG_ID: {
12075
+ target: '#game_search_v2.fetchGameList',
12076
+ actions: ['setTagId', 'setTraceData']
12077
+ },
12078
+ PRESS_ENTER: [
12079
+ {
12080
+ actions: send((context, event) => ({
12081
+ type: 'SET_TAG_ID',
12082
+ data: {
12083
+ tagId: context.tagList[0]?.id,
12084
+ traceData: {
12085
+ isYouMayLike: null,
12086
+ isRecentlyGame: null,
12087
+ isRecentlySearch: null
12088
+ }
12089
+ }
12090
+ })),
12091
+ cond: 'hasTagList',
12092
+ },
12093
+ {
12094
+ target: '#game_search_v2.sendingTrace',
12095
+ actions: 'clearExceptKeyword',
12096
+ },
12097
+ ],
12098
+ SET_KEYWORD: {
12099
+ target: 'debouncing',
12100
+ actions: 'setKeyword',
12101
+ },
12102
+ STOP_SEARCH: {
12103
+ target: '#game_search_v2.idle',
12104
+ actions: 'clearKeywords'
12105
+ },
12106
+ },
12107
+ },
12108
+ debouncing: {
12109
+ on: {
12110
+ SET_KEYWORD: {
12111
+ target: 'debouncing',
12112
+ actions: 'setKeyword',
12113
+ },
12114
+ },
12115
+ after: {
12116
+ 500: {
12117
+ target: 'fetching',
12118
+ },
12119
+ },
12120
+ },
12121
+ fetching: {
12122
+ invoke: {
12123
+ src: 'fetchTags',
12124
+ onDone: {
12125
+ target: 'searchIdle',
12126
+ actions: 'setTagList',
12127
+ },
12128
+ onError: {
12129
+ target: '#game_search_v2.fail',
12130
+ },
12131
+ },
12132
+ },
12133
+ },
12134
+ },
12135
+ sendingTrace: {
12136
+ invoke: {
12137
+ src: 'sendTrace',
12138
+ onDone: {
12139
+ target: 'idle',
12140
+ },
12141
+ onError: {
12142
+ target: 'fail',
12143
+ },
12144
+ },
12145
+ },
12146
+ fail: {},
12147
+ },
12148
+ },
12149
+ {
12150
+ actions: {
12151
+ setMainTagList: assign((context, event) => {
12152
+ return {
12153
+ mainTagList: event.data,
12154
+ }
12155
+ }),
12156
+ setInitialData: assign((context, event) => {
12157
+ const { recentlySearch = [], recentlyGame = [], youMayLike = [] } = event.data;
12158
+ let tagId = null;
12159
+ let gameList = [];
12160
+ if (recentlyGame?.length > 0) {
12161
+ gameList = recentlyGame;
12162
+ } else if (youMayLike?.length > 0) {
12163
+ gameList = youMayLike;
12164
+ }
12165
+ return {
12166
+ recentlySearch: recentlySearch.filter(item => item.id && item.i18n),
12167
+ recentlyGame,
12168
+ youMayLike,
12169
+ gameList,
12170
+ tagId
12171
+ }
12172
+ }),
12173
+ setMainTagId: assign((context, event) => {
12174
+ const { tagId } = event.data;
12175
+ const { mainTagList } = context;
12176
+ const tagIndex = mainTagList.findIndex((tag) => tag.id === tagId);
12177
+ return {
12178
+ keyword: '',
12179
+ tagId,
12180
+ tagIndex,
12181
+ click: 1,
12182
+ clickDefault: null,
12183
+ }
12184
+ }),
12185
+ clearMainTag: assign((context, event) => {
12186
+ return {
12187
+ tagId: null,
12188
+ }
12189
+ }),
12190
+ setTagId: assign((context, event) => {
12191
+ const { tagId, clickTagType } = event.data;
12192
+ const { mainTagList, tagList, recentlySearch } = context;
12193
+ if (clickTagType === 'RECENTLY SEARCH') {
12194
+ const tagIndex = recentlySearch.findIndex((tag) => tag.id === tagId);
12195
+ return {
12196
+ tagId,
12197
+ tagIndex,
12198
+ click: 1,
12199
+ clickDefault: null,
12200
+ }
12201
+ } else if (clickTagType === 'POPULAR KEYWORDS' || tagList.length <= 0) {
12202
+ const tagIndex = mainTagList.findIndex((tag) => tag.id === tagId);
12203
+ return {
12204
+ tagId,
12205
+ tagIndex,
12206
+ click: null,
12207
+ clickDefault: 1,
12208
+ }
12209
+ } else {
12210
+ const tagIndex = tagList.findIndex((tag) => tag.id === tagId);
12211
+ return {
12212
+ tagId,
12213
+ tagIndex,
12214
+ click: 1,
12215
+ clickDefault: null,
12216
+ }
12217
+ }
12218
+ }),
12219
+ setGames: assign((context, event) => {
12220
+ if (event?.data) {
12221
+ const { traceId, result } = event.data;
12222
+ return {
12223
+ traceId,
12224
+ gameList: result,
12225
+ }
12226
+ } else {
12227
+ const { tagId, recentlyGame, youMayLike } = context;
12228
+ let gameList = [];
12229
+ if (tagId === 'RECENTLY') {
12230
+ gameList = recentlyGame;
12231
+ } else if (tagId === 'YOU MAY LIKE') {
12232
+ gameList = youMayLike;
12233
+ }
12234
+ return {
12235
+ traceId: null,
12236
+ gameList,
12237
+ }
12238
+ }
12239
+ }),
12240
+ setTraceData: assign((context, event) => {
12241
+ const { isYouMayLike, isRecentlyGame, isRecentlySearch } = event.data?.traceData;
12242
+ return {
12243
+ isYouMayLike,
12244
+ isRecentlyGame,
12245
+ isRecentlySearch,
12246
+ }
12247
+ }),
12248
+ setKeyword: assign((context, event) => {
12249
+ return {
12250
+ keyword: event.data,
12251
+ }
12252
+ }),
12253
+ clearKeywords: assign((context, event) => {
12254
+ return {
12255
+ keyword: '',
12256
+ }
12257
+ }),
12258
+ setTagList: assign((context, event) => {
12259
+ return {
12260
+ tagList: event.data,
12261
+ }
12262
+ }),
12263
+ setGameCode: assign((context, event) => {
12264
+ const { gameList } = context;
12265
+ const gameCode = event.data;
12266
+ const gameCodeIndex = gameList.findIndex((game) => game === gameCode);
12267
+ return {
12268
+ gameCode,
12269
+ gameCodeIndex,
12270
+ }
12271
+ }),
12272
+ clearExceptKeyword: assign((context, event) => {
12273
+ return {
12274
+ gameList: [],
12275
+ traceId: null,
12276
+ tagId: null,
12277
+ tagIndex: null,
12278
+ gameCode: null,
12279
+ gameCodeIndex: null,
12280
+ isYouMayLike: null,
12281
+ isRecentlyGame: null,
12282
+ isRecentlySearch: null,
12283
+ query: context.keyword,
12284
+ click: null,
12285
+ clickDefault: null,
12286
+ }
12287
+ }),
12288
+ },
12289
+ guards: {
12290
+ isRecentlyYouMayLike: (context, event) => {
12291
+ const { tagId } = context;
12292
+ return tagId === 'RECENTLY' || tagId === 'YOU MAY LIKE'
12293
+ },
12294
+ hasTagList: (context, event) => {
12295
+ const { tagList } = context;
12296
+ return tagList?.length > 0
12297
+ },
12298
+ },
12299
+ services: {
12300
+ fetchTags: async (context, event) => {
12301
+ const { keyword } = context;
12302
+ const { result } = await request.send(game$1.getGameTags({ q: keyword }));
12303
+ return result
12304
+ },
12305
+ fetchInitialData: async (context, event) => {
12306
+ const data = await request.send(game$1.getGameSearchHome());
12307
+ return data
12308
+ },
12309
+ fetchGames: async (context, event) => {
12310
+ const { tagId, tagIndex, keyword, click, clickDefault } = context;
12311
+ const { traceId, result } = await request.send(game$1.getGameSearchList({ id: tagId, index: tagIndex, q: keyword, click, clickDefault }));
12312
+ return { traceId, result }
12313
+ },
12314
+ sendTrace: async (context, event) => {
12315
+ const { traceId, tagId, tagIndex, gameCode, gameCodeIndex, keyword: query, click, clickDefault, isYouMayLike, isRecentlyGame, isRecentlySearch } = context;
12316
+ let id = tagId;
12317
+ if (tagId === 'RECENTLY' || tagId === 'YOU MAY LIKE') {
12318
+ id = null;
12319
+ }
12320
+ return await request.send(game$1.setGameSearchTrace({ traceId, tagId: id, tagIndex, gameCode, gameCodeIndex, query, click, clickDefault, isYouMayLike, isRecentlyGame, isRecentlySearch }))
12321
+ },
12322
+ },
12323
+ }
12324
+ )
12325
+ }
12326
+
14344
12327
  function game_hot_new (request) {
14345
12328
  return createMachine(
14346
12329
  {
@@ -20113,6 +18096,7 @@ var index$1 = {
20113
18096
  game_favorite,
20114
18097
  game_favorite_v2,
20115
18098
  game_search,
18099
+ game_search_v2,
20116
18100
  game_hot_new,
20117
18101
  inbox,
20118
18102
  merge,