@ctil/gql 1.0.0
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.
- package/.vscode/launch.json +18 -0
- package/README.md +248 -0
- package/cc-request-1.0.0.tgz +0 -0
- package/dist/fp.esm-VY6KF7TP.js +2699 -0
- package/dist/fp.esm-VY6KF7TP.js.map +1 -0
- package/dist/index.cjs +4632 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +300 -0
- package/dist/index.d.ts +300 -0
- package/dist/index.js +1865 -0
- package/dist/index.js.map +1 -0
- package/package.json +46 -0
- package/src/builders/auth.ts +182 -0
- package/src/builders/baseType.ts +194 -0
- package/src/builders/index.ts +5 -0
- package/src/builders/mutation.ts +341 -0
- package/src/builders/query.ts +180 -0
- package/src/builders/sms.ts +59 -0
- package/src/cache/memoryCache.ts +34 -0
- package/src/core/api/auth.ts +86 -0
- package/src/core/api/gql.ts +22 -0
- package/src/core/api/mutation.ts +100 -0
- package/src/core/api/query.ts +82 -0
- package/src/core/api/sms.ts +18 -0
- package/src/core/client.ts +47 -0
- package/src/core/core.ts +281 -0
- package/src/core/executor.ts +19 -0
- package/src/core/type.ts +76 -0
- package/src/device/index.ts +116 -0
- package/src/index.ts +60 -0
- package/src/rateLimit/rateLimit.ts +51 -0
- package/src/rateLimit/rateLimitConfig.ts +12 -0
- package/src/test.ts +80 -0
- package/tsconfig.json +17 -0
- package/tsup.config.ts +10 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,4632 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __esm = (fn, res) => function __init() {
|
|
9
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
10
|
+
};
|
|
11
|
+
var __export = (target, all) => {
|
|
12
|
+
for (var name in all)
|
|
13
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
14
|
+
};
|
|
15
|
+
var __copyProps = (to, from, except, desc) => {
|
|
16
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
+
for (let key of __getOwnPropNames(from))
|
|
18
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
19
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
22
|
+
};
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
24
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
25
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
26
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
27
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
28
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
29
|
+
mod
|
|
30
|
+
));
|
|
31
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
|
+
|
|
33
|
+
// node_modules/tslib/tslib.es6.mjs
|
|
34
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
35
|
+
function adopt(value) {
|
|
36
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
37
|
+
resolve(value);
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
41
|
+
function fulfilled(value) {
|
|
42
|
+
try {
|
|
43
|
+
step(generator.next(value));
|
|
44
|
+
} catch (e) {
|
|
45
|
+
reject(e);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function rejected(value) {
|
|
49
|
+
try {
|
|
50
|
+
step(generator["throw"](value));
|
|
51
|
+
} catch (e) {
|
|
52
|
+
reject(e);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function step(result) {
|
|
56
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
57
|
+
}
|
|
58
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
function __generator(thisArg, body) {
|
|
62
|
+
var _ = { label: 0, sent: function() {
|
|
63
|
+
if (t[0] & 1) throw t[1];
|
|
64
|
+
return t[1];
|
|
65
|
+
}, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
66
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
67
|
+
return this;
|
|
68
|
+
}), g;
|
|
69
|
+
function verb(n) {
|
|
70
|
+
return function(v) {
|
|
71
|
+
return step([n, v]);
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
function step(op) {
|
|
75
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
76
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
77
|
+
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;
|
|
78
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
79
|
+
switch (op[0]) {
|
|
80
|
+
case 0:
|
|
81
|
+
case 1:
|
|
82
|
+
t = op;
|
|
83
|
+
break;
|
|
84
|
+
case 4:
|
|
85
|
+
_.label++;
|
|
86
|
+
return { value: op[1], done: false };
|
|
87
|
+
case 5:
|
|
88
|
+
_.label++;
|
|
89
|
+
y = op[1];
|
|
90
|
+
op = [0];
|
|
91
|
+
continue;
|
|
92
|
+
case 7:
|
|
93
|
+
op = _.ops.pop();
|
|
94
|
+
_.trys.pop();
|
|
95
|
+
continue;
|
|
96
|
+
default:
|
|
97
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
98
|
+
_ = 0;
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
101
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
102
|
+
_.label = op[1];
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
106
|
+
_.label = t[1];
|
|
107
|
+
t = op;
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
if (t && _.label < t[2]) {
|
|
111
|
+
_.label = t[2];
|
|
112
|
+
_.ops.push(op);
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
if (t[2]) _.ops.pop();
|
|
116
|
+
_.trys.pop();
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
op = body.call(thisArg, _);
|
|
120
|
+
} catch (e) {
|
|
121
|
+
op = [6, e];
|
|
122
|
+
y = 0;
|
|
123
|
+
} finally {
|
|
124
|
+
f = t = 0;
|
|
125
|
+
}
|
|
126
|
+
if (op[0] & 5) throw op[1];
|
|
127
|
+
return { value: op[0] ? op[1] : void 0, done: true };
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
function __spreadArray(to, from, pack) {
|
|
131
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
132
|
+
if (ar || !(i in from)) {
|
|
133
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
134
|
+
ar[i] = from[i];
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
138
|
+
}
|
|
139
|
+
var __assign;
|
|
140
|
+
var init_tslib_es6 = __esm({
|
|
141
|
+
"node_modules/tslib/tslib.es6.mjs"() {
|
|
142
|
+
"use strict";
|
|
143
|
+
__assign = function() {
|
|
144
|
+
__assign = Object.assign || function __assign2(t) {
|
|
145
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
146
|
+
s = arguments[i];
|
|
147
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
148
|
+
}
|
|
149
|
+
return t;
|
|
150
|
+
};
|
|
151
|
+
return __assign.apply(this, arguments);
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
// node_modules/@fingerprintjs/fingerprintjs/dist/fp.esm.js
|
|
157
|
+
var fp_esm_exports = {};
|
|
158
|
+
__export(fp_esm_exports, {
|
|
159
|
+
componentsToDebugString: () => componentsToDebugString,
|
|
160
|
+
default: () => index,
|
|
161
|
+
getFullscreenElement: () => getFullscreenElement,
|
|
162
|
+
getUnstableAudioFingerprint: () => getUnstableAudioFingerprint,
|
|
163
|
+
getUnstableCanvasFingerprint: () => getUnstableCanvasFingerprint,
|
|
164
|
+
getUnstableScreenFrame: () => getUnstableScreenFrame,
|
|
165
|
+
getUnstableScreenResolution: () => getUnstableScreenResolution,
|
|
166
|
+
getWebGLContext: () => getWebGLContext,
|
|
167
|
+
hashComponents: () => hashComponents,
|
|
168
|
+
isAndroid: () => isAndroid,
|
|
169
|
+
isChromium: () => isChromium,
|
|
170
|
+
isDesktopWebKit: () => isDesktopWebKit,
|
|
171
|
+
isEdgeHTML: () => isEdgeHTML,
|
|
172
|
+
isGecko: () => isGecko,
|
|
173
|
+
isSamsungInternet: () => isSamsungInternet,
|
|
174
|
+
isTrident: () => isTrident,
|
|
175
|
+
isWebKit: () => isWebKit,
|
|
176
|
+
load: () => load,
|
|
177
|
+
loadSources: () => loadSources,
|
|
178
|
+
murmurX64Hash128: () => murmurX64Hash128,
|
|
179
|
+
prepareForSources: () => prepareForSources,
|
|
180
|
+
sources: () => sources,
|
|
181
|
+
transformSource: () => transformSource,
|
|
182
|
+
withIframe: () => withIframe
|
|
183
|
+
});
|
|
184
|
+
function wait(durationMs, resolveWith) {
|
|
185
|
+
return new Promise(function(resolve) {
|
|
186
|
+
return setTimeout(resolve, durationMs, resolveWith);
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
function releaseEventLoop() {
|
|
190
|
+
return new Promise(function(resolve) {
|
|
191
|
+
var channel = new MessageChannel();
|
|
192
|
+
channel.port1.onmessage = function() {
|
|
193
|
+
return resolve();
|
|
194
|
+
};
|
|
195
|
+
channel.port2.postMessage(null);
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
function requestIdleCallbackIfAvailable(fallbackTimeout, deadlineTimeout) {
|
|
199
|
+
if (deadlineTimeout === void 0) {
|
|
200
|
+
deadlineTimeout = Infinity;
|
|
201
|
+
}
|
|
202
|
+
var requestIdleCallback = window.requestIdleCallback;
|
|
203
|
+
if (requestIdleCallback) {
|
|
204
|
+
return new Promise(function(resolve) {
|
|
205
|
+
return requestIdleCallback.call(window, function() {
|
|
206
|
+
return resolve();
|
|
207
|
+
}, { timeout: deadlineTimeout });
|
|
208
|
+
});
|
|
209
|
+
} else {
|
|
210
|
+
return wait(Math.min(fallbackTimeout, deadlineTimeout));
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
function isPromise(value) {
|
|
214
|
+
return !!value && typeof value.then === "function";
|
|
215
|
+
}
|
|
216
|
+
function awaitIfAsync(action, callback) {
|
|
217
|
+
try {
|
|
218
|
+
var returnedValue = action();
|
|
219
|
+
if (isPromise(returnedValue)) {
|
|
220
|
+
returnedValue.then(function(result) {
|
|
221
|
+
return callback(true, result);
|
|
222
|
+
}, function(error) {
|
|
223
|
+
return callback(false, error);
|
|
224
|
+
});
|
|
225
|
+
} else {
|
|
226
|
+
callback(true, returnedValue);
|
|
227
|
+
}
|
|
228
|
+
} catch (error) {
|
|
229
|
+
callback(false, error);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
function mapWithBreaks(items, callback, loopReleaseInterval) {
|
|
233
|
+
if (loopReleaseInterval === void 0) {
|
|
234
|
+
loopReleaseInterval = 16;
|
|
235
|
+
}
|
|
236
|
+
return __awaiter(this, void 0, void 0, function() {
|
|
237
|
+
var results, lastLoopReleaseTime, i, now;
|
|
238
|
+
return __generator(this, function(_a) {
|
|
239
|
+
switch (_a.label) {
|
|
240
|
+
case 0:
|
|
241
|
+
results = Array(items.length);
|
|
242
|
+
lastLoopReleaseTime = Date.now();
|
|
243
|
+
i = 0;
|
|
244
|
+
_a.label = 1;
|
|
245
|
+
case 1:
|
|
246
|
+
if (!(i < items.length)) return [3, 4];
|
|
247
|
+
results[i] = callback(items[i], i);
|
|
248
|
+
now = Date.now();
|
|
249
|
+
if (!(now >= lastLoopReleaseTime + loopReleaseInterval)) return [3, 3];
|
|
250
|
+
lastLoopReleaseTime = now;
|
|
251
|
+
return [4, releaseEventLoop()];
|
|
252
|
+
case 2:
|
|
253
|
+
_a.sent();
|
|
254
|
+
_a.label = 3;
|
|
255
|
+
case 3:
|
|
256
|
+
++i;
|
|
257
|
+
return [3, 1];
|
|
258
|
+
case 4:
|
|
259
|
+
return [2, results];
|
|
260
|
+
}
|
|
261
|
+
});
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
function suppressUnhandledRejectionWarning(promise) {
|
|
265
|
+
promise.then(void 0, function() {
|
|
266
|
+
return void 0;
|
|
267
|
+
});
|
|
268
|
+
return promise;
|
|
269
|
+
}
|
|
270
|
+
function includes(haystack, needle) {
|
|
271
|
+
for (var i = 0, l = haystack.length; i < l; ++i) {
|
|
272
|
+
if (haystack[i] === needle) {
|
|
273
|
+
return true;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
return false;
|
|
277
|
+
}
|
|
278
|
+
function excludes(haystack, needle) {
|
|
279
|
+
return !includes(haystack, needle);
|
|
280
|
+
}
|
|
281
|
+
function toInt(value) {
|
|
282
|
+
return parseInt(value);
|
|
283
|
+
}
|
|
284
|
+
function toFloat(value) {
|
|
285
|
+
return parseFloat(value);
|
|
286
|
+
}
|
|
287
|
+
function replaceNaN(value, replacement) {
|
|
288
|
+
return typeof value === "number" && isNaN(value) ? replacement : value;
|
|
289
|
+
}
|
|
290
|
+
function countTruthy(values) {
|
|
291
|
+
return values.reduce(function(sum, value) {
|
|
292
|
+
return sum + (value ? 1 : 0);
|
|
293
|
+
}, 0);
|
|
294
|
+
}
|
|
295
|
+
function round(value, base) {
|
|
296
|
+
if (base === void 0) {
|
|
297
|
+
base = 1;
|
|
298
|
+
}
|
|
299
|
+
if (Math.abs(base) >= 1) {
|
|
300
|
+
return Math.round(value / base) * base;
|
|
301
|
+
} else {
|
|
302
|
+
var counterBase = 1 / base;
|
|
303
|
+
return Math.round(value * counterBase) / counterBase;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
function parseSimpleCssSelector(selector) {
|
|
307
|
+
var _a, _b;
|
|
308
|
+
var errorMessage = "Unexpected syntax '".concat(selector, "'");
|
|
309
|
+
var tagMatch = /^\s*([a-z-]*)(.*)$/i.exec(selector);
|
|
310
|
+
var tag = tagMatch[1] || void 0;
|
|
311
|
+
var attributes = {};
|
|
312
|
+
var partsRegex = /([.:#][\w-]+|\[.+?\])/gi;
|
|
313
|
+
var addAttribute = function(name, value) {
|
|
314
|
+
attributes[name] = attributes[name] || [];
|
|
315
|
+
attributes[name].push(value);
|
|
316
|
+
};
|
|
317
|
+
for (; ; ) {
|
|
318
|
+
var match = partsRegex.exec(tagMatch[2]);
|
|
319
|
+
if (!match) {
|
|
320
|
+
break;
|
|
321
|
+
}
|
|
322
|
+
var part = match[0];
|
|
323
|
+
switch (part[0]) {
|
|
324
|
+
case ".":
|
|
325
|
+
addAttribute("class", part.slice(1));
|
|
326
|
+
break;
|
|
327
|
+
case "#":
|
|
328
|
+
addAttribute("id", part.slice(1));
|
|
329
|
+
break;
|
|
330
|
+
case "[": {
|
|
331
|
+
var attributeMatch = /^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(part);
|
|
332
|
+
if (attributeMatch) {
|
|
333
|
+
addAttribute(attributeMatch[1], (_b = (_a = attributeMatch[4]) !== null && _a !== void 0 ? _a : attributeMatch[5]) !== null && _b !== void 0 ? _b : "");
|
|
334
|
+
} else {
|
|
335
|
+
throw new Error(errorMessage);
|
|
336
|
+
}
|
|
337
|
+
break;
|
|
338
|
+
}
|
|
339
|
+
default:
|
|
340
|
+
throw new Error(errorMessage);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
return [tag, attributes];
|
|
344
|
+
}
|
|
345
|
+
function getUTF8Bytes(input) {
|
|
346
|
+
var result = new Uint8Array(input.length);
|
|
347
|
+
for (var i = 0; i < input.length; i++) {
|
|
348
|
+
var charCode = input.charCodeAt(i);
|
|
349
|
+
if (charCode > 127) {
|
|
350
|
+
return new TextEncoder().encode(input);
|
|
351
|
+
}
|
|
352
|
+
result[i] = charCode;
|
|
353
|
+
}
|
|
354
|
+
return result;
|
|
355
|
+
}
|
|
356
|
+
function x64Add(m, n) {
|
|
357
|
+
var m0 = m[0] >>> 16, m1 = m[0] & 65535, m2 = m[1] >>> 16, m3 = m[1] & 65535;
|
|
358
|
+
var n0 = n[0] >>> 16, n1 = n[0] & 65535, n2 = n[1] >>> 16, n3 = n[1] & 65535;
|
|
359
|
+
var o0 = 0, o1 = 0, o2 = 0, o3 = 0;
|
|
360
|
+
o3 += m3 + n3;
|
|
361
|
+
o2 += o3 >>> 16;
|
|
362
|
+
o3 &= 65535;
|
|
363
|
+
o2 += m2 + n2;
|
|
364
|
+
o1 += o2 >>> 16;
|
|
365
|
+
o2 &= 65535;
|
|
366
|
+
o1 += m1 + n1;
|
|
367
|
+
o0 += o1 >>> 16;
|
|
368
|
+
o1 &= 65535;
|
|
369
|
+
o0 += m0 + n0;
|
|
370
|
+
o0 &= 65535;
|
|
371
|
+
m[0] = o0 << 16 | o1;
|
|
372
|
+
m[1] = o2 << 16 | o3;
|
|
373
|
+
}
|
|
374
|
+
function x64Multiply(m, n) {
|
|
375
|
+
var m0 = m[0] >>> 16, m1 = m[0] & 65535, m2 = m[1] >>> 16, m3 = m[1] & 65535;
|
|
376
|
+
var n0 = n[0] >>> 16, n1 = n[0] & 65535, n2 = n[1] >>> 16, n3 = n[1] & 65535;
|
|
377
|
+
var o0 = 0, o1 = 0, o2 = 0, o3 = 0;
|
|
378
|
+
o3 += m3 * n3;
|
|
379
|
+
o2 += o3 >>> 16;
|
|
380
|
+
o3 &= 65535;
|
|
381
|
+
o2 += m2 * n3;
|
|
382
|
+
o1 += o2 >>> 16;
|
|
383
|
+
o2 &= 65535;
|
|
384
|
+
o2 += m3 * n2;
|
|
385
|
+
o1 += o2 >>> 16;
|
|
386
|
+
o2 &= 65535;
|
|
387
|
+
o1 += m1 * n3;
|
|
388
|
+
o0 += o1 >>> 16;
|
|
389
|
+
o1 &= 65535;
|
|
390
|
+
o1 += m2 * n2;
|
|
391
|
+
o0 += o1 >>> 16;
|
|
392
|
+
o1 &= 65535;
|
|
393
|
+
o1 += m3 * n1;
|
|
394
|
+
o0 += o1 >>> 16;
|
|
395
|
+
o1 &= 65535;
|
|
396
|
+
o0 += m0 * n3 + m1 * n2 + m2 * n1 + m3 * n0;
|
|
397
|
+
o0 &= 65535;
|
|
398
|
+
m[0] = o0 << 16 | o1;
|
|
399
|
+
m[1] = o2 << 16 | o3;
|
|
400
|
+
}
|
|
401
|
+
function x64Rotl(m, bits) {
|
|
402
|
+
var m0 = m[0];
|
|
403
|
+
bits %= 64;
|
|
404
|
+
if (bits === 32) {
|
|
405
|
+
m[0] = m[1];
|
|
406
|
+
m[1] = m0;
|
|
407
|
+
} else if (bits < 32) {
|
|
408
|
+
m[0] = m0 << bits | m[1] >>> 32 - bits;
|
|
409
|
+
m[1] = m[1] << bits | m0 >>> 32 - bits;
|
|
410
|
+
} else {
|
|
411
|
+
bits -= 32;
|
|
412
|
+
m[0] = m[1] << bits | m0 >>> 32 - bits;
|
|
413
|
+
m[1] = m0 << bits | m[1] >>> 32 - bits;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
function x64LeftShift(m, bits) {
|
|
417
|
+
bits %= 64;
|
|
418
|
+
if (bits === 0) {
|
|
419
|
+
return;
|
|
420
|
+
} else if (bits < 32) {
|
|
421
|
+
m[0] = m[1] >>> 32 - bits;
|
|
422
|
+
m[1] = m[1] << bits;
|
|
423
|
+
} else {
|
|
424
|
+
m[0] = m[1] << bits - 32;
|
|
425
|
+
m[1] = 0;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
function x64Xor(m, n) {
|
|
429
|
+
m[0] ^= n[0];
|
|
430
|
+
m[1] ^= n[1];
|
|
431
|
+
}
|
|
432
|
+
function x64Fmix(h) {
|
|
433
|
+
var shifted = [0, h[0] >>> 1];
|
|
434
|
+
x64Xor(h, shifted);
|
|
435
|
+
x64Multiply(h, F1);
|
|
436
|
+
shifted[1] = h[0] >>> 1;
|
|
437
|
+
x64Xor(h, shifted);
|
|
438
|
+
x64Multiply(h, F2);
|
|
439
|
+
shifted[1] = h[0] >>> 1;
|
|
440
|
+
x64Xor(h, shifted);
|
|
441
|
+
}
|
|
442
|
+
function x64hash128(input, seed) {
|
|
443
|
+
var key = getUTF8Bytes(input);
|
|
444
|
+
seed = seed || 0;
|
|
445
|
+
var length = [0, key.length];
|
|
446
|
+
var remainder = length[1] % 16;
|
|
447
|
+
var bytes = length[1] - remainder;
|
|
448
|
+
var h1 = [0, seed];
|
|
449
|
+
var h2 = [0, seed];
|
|
450
|
+
var k1 = [0, 0];
|
|
451
|
+
var k2 = [0, 0];
|
|
452
|
+
var i;
|
|
453
|
+
for (i = 0; i < bytes; i = i + 16) {
|
|
454
|
+
k1[0] = key[i + 4] | key[i + 5] << 8 | key[i + 6] << 16 | key[i + 7] << 24;
|
|
455
|
+
k1[1] = key[i] | key[i + 1] << 8 | key[i + 2] << 16 | key[i + 3] << 24;
|
|
456
|
+
k2[0] = key[i + 12] | key[i + 13] << 8 | key[i + 14] << 16 | key[i + 15] << 24;
|
|
457
|
+
k2[1] = key[i + 8] | key[i + 9] << 8 | key[i + 10] << 16 | key[i + 11] << 24;
|
|
458
|
+
x64Multiply(k1, C1);
|
|
459
|
+
x64Rotl(k1, 31);
|
|
460
|
+
x64Multiply(k1, C2);
|
|
461
|
+
x64Xor(h1, k1);
|
|
462
|
+
x64Rotl(h1, 27);
|
|
463
|
+
x64Add(h1, h2);
|
|
464
|
+
x64Multiply(h1, M$1);
|
|
465
|
+
x64Add(h1, N1);
|
|
466
|
+
x64Multiply(k2, C2);
|
|
467
|
+
x64Rotl(k2, 33);
|
|
468
|
+
x64Multiply(k2, C1);
|
|
469
|
+
x64Xor(h2, k2);
|
|
470
|
+
x64Rotl(h2, 31);
|
|
471
|
+
x64Add(h2, h1);
|
|
472
|
+
x64Multiply(h2, M$1);
|
|
473
|
+
x64Add(h2, N2);
|
|
474
|
+
}
|
|
475
|
+
k1[0] = 0;
|
|
476
|
+
k1[1] = 0;
|
|
477
|
+
k2[0] = 0;
|
|
478
|
+
k2[1] = 0;
|
|
479
|
+
var val = [0, 0];
|
|
480
|
+
switch (remainder) {
|
|
481
|
+
case 15:
|
|
482
|
+
val[1] = key[i + 14];
|
|
483
|
+
x64LeftShift(val, 48);
|
|
484
|
+
x64Xor(k2, val);
|
|
485
|
+
// fallthrough
|
|
486
|
+
case 14:
|
|
487
|
+
val[1] = key[i + 13];
|
|
488
|
+
x64LeftShift(val, 40);
|
|
489
|
+
x64Xor(k2, val);
|
|
490
|
+
// fallthrough
|
|
491
|
+
case 13:
|
|
492
|
+
val[1] = key[i + 12];
|
|
493
|
+
x64LeftShift(val, 32);
|
|
494
|
+
x64Xor(k2, val);
|
|
495
|
+
// fallthrough
|
|
496
|
+
case 12:
|
|
497
|
+
val[1] = key[i + 11];
|
|
498
|
+
x64LeftShift(val, 24);
|
|
499
|
+
x64Xor(k2, val);
|
|
500
|
+
// fallthrough
|
|
501
|
+
case 11:
|
|
502
|
+
val[1] = key[i + 10];
|
|
503
|
+
x64LeftShift(val, 16);
|
|
504
|
+
x64Xor(k2, val);
|
|
505
|
+
// fallthrough
|
|
506
|
+
case 10:
|
|
507
|
+
val[1] = key[i + 9];
|
|
508
|
+
x64LeftShift(val, 8);
|
|
509
|
+
x64Xor(k2, val);
|
|
510
|
+
// fallthrough
|
|
511
|
+
case 9:
|
|
512
|
+
val[1] = key[i + 8];
|
|
513
|
+
x64Xor(k2, val);
|
|
514
|
+
x64Multiply(k2, C2);
|
|
515
|
+
x64Rotl(k2, 33);
|
|
516
|
+
x64Multiply(k2, C1);
|
|
517
|
+
x64Xor(h2, k2);
|
|
518
|
+
// fallthrough
|
|
519
|
+
case 8:
|
|
520
|
+
val[1] = key[i + 7];
|
|
521
|
+
x64LeftShift(val, 56);
|
|
522
|
+
x64Xor(k1, val);
|
|
523
|
+
// fallthrough
|
|
524
|
+
case 7:
|
|
525
|
+
val[1] = key[i + 6];
|
|
526
|
+
x64LeftShift(val, 48);
|
|
527
|
+
x64Xor(k1, val);
|
|
528
|
+
// fallthrough
|
|
529
|
+
case 6:
|
|
530
|
+
val[1] = key[i + 5];
|
|
531
|
+
x64LeftShift(val, 40);
|
|
532
|
+
x64Xor(k1, val);
|
|
533
|
+
// fallthrough
|
|
534
|
+
case 5:
|
|
535
|
+
val[1] = key[i + 4];
|
|
536
|
+
x64LeftShift(val, 32);
|
|
537
|
+
x64Xor(k1, val);
|
|
538
|
+
// fallthrough
|
|
539
|
+
case 4:
|
|
540
|
+
val[1] = key[i + 3];
|
|
541
|
+
x64LeftShift(val, 24);
|
|
542
|
+
x64Xor(k1, val);
|
|
543
|
+
// fallthrough
|
|
544
|
+
case 3:
|
|
545
|
+
val[1] = key[i + 2];
|
|
546
|
+
x64LeftShift(val, 16);
|
|
547
|
+
x64Xor(k1, val);
|
|
548
|
+
// fallthrough
|
|
549
|
+
case 2:
|
|
550
|
+
val[1] = key[i + 1];
|
|
551
|
+
x64LeftShift(val, 8);
|
|
552
|
+
x64Xor(k1, val);
|
|
553
|
+
// fallthrough
|
|
554
|
+
case 1:
|
|
555
|
+
val[1] = key[i];
|
|
556
|
+
x64Xor(k1, val);
|
|
557
|
+
x64Multiply(k1, C1);
|
|
558
|
+
x64Rotl(k1, 31);
|
|
559
|
+
x64Multiply(k1, C2);
|
|
560
|
+
x64Xor(h1, k1);
|
|
561
|
+
}
|
|
562
|
+
x64Xor(h1, length);
|
|
563
|
+
x64Xor(h2, length);
|
|
564
|
+
x64Add(h1, h2);
|
|
565
|
+
x64Add(h2, h1);
|
|
566
|
+
x64Fmix(h1);
|
|
567
|
+
x64Fmix(h2);
|
|
568
|
+
x64Add(h1, h2);
|
|
569
|
+
x64Add(h2, h1);
|
|
570
|
+
return ("00000000" + (h1[0] >>> 0).toString(16)).slice(-8) + ("00000000" + (h1[1] >>> 0).toString(16)).slice(-8) + ("00000000" + (h2[0] >>> 0).toString(16)).slice(-8) + ("00000000" + (h2[1] >>> 0).toString(16)).slice(-8);
|
|
571
|
+
}
|
|
572
|
+
function errorToObject(error) {
|
|
573
|
+
var _a;
|
|
574
|
+
return __assign({ name: error.name, message: error.message, stack: (_a = error.stack) === null || _a === void 0 ? void 0 : _a.split("\n") }, error);
|
|
575
|
+
}
|
|
576
|
+
function isFunctionNative(func) {
|
|
577
|
+
return /^function\s.*?\{\s*\[native code]\s*}$/.test(String(func));
|
|
578
|
+
}
|
|
579
|
+
function isFinalResultLoaded(loadResult) {
|
|
580
|
+
return typeof loadResult !== "function";
|
|
581
|
+
}
|
|
582
|
+
function loadSource(source, sourceOptions) {
|
|
583
|
+
var sourceLoadPromise = suppressUnhandledRejectionWarning(new Promise(function(resolveLoad) {
|
|
584
|
+
var loadStartTime = Date.now();
|
|
585
|
+
awaitIfAsync(source.bind(null, sourceOptions), function() {
|
|
586
|
+
var loadArgs = [];
|
|
587
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
588
|
+
loadArgs[_i] = arguments[_i];
|
|
589
|
+
}
|
|
590
|
+
var loadDuration = Date.now() - loadStartTime;
|
|
591
|
+
if (!loadArgs[0]) {
|
|
592
|
+
return resolveLoad(function() {
|
|
593
|
+
return { error: loadArgs[1], duration: loadDuration };
|
|
594
|
+
});
|
|
595
|
+
}
|
|
596
|
+
var loadResult = loadArgs[1];
|
|
597
|
+
if (isFinalResultLoaded(loadResult)) {
|
|
598
|
+
return resolveLoad(function() {
|
|
599
|
+
return { value: loadResult, duration: loadDuration };
|
|
600
|
+
});
|
|
601
|
+
}
|
|
602
|
+
resolveLoad(function() {
|
|
603
|
+
return new Promise(function(resolveGet) {
|
|
604
|
+
var getStartTime = Date.now();
|
|
605
|
+
awaitIfAsync(loadResult, function() {
|
|
606
|
+
var getArgs = [];
|
|
607
|
+
for (var _i2 = 0; _i2 < arguments.length; _i2++) {
|
|
608
|
+
getArgs[_i2] = arguments[_i2];
|
|
609
|
+
}
|
|
610
|
+
var duration = loadDuration + Date.now() - getStartTime;
|
|
611
|
+
if (!getArgs[0]) {
|
|
612
|
+
return resolveGet({ error: getArgs[1], duration });
|
|
613
|
+
}
|
|
614
|
+
resolveGet({ value: getArgs[1], duration });
|
|
615
|
+
});
|
|
616
|
+
});
|
|
617
|
+
});
|
|
618
|
+
});
|
|
619
|
+
}));
|
|
620
|
+
return function getComponent() {
|
|
621
|
+
return sourceLoadPromise.then(function(finalizeSource) {
|
|
622
|
+
return finalizeSource();
|
|
623
|
+
});
|
|
624
|
+
};
|
|
625
|
+
}
|
|
626
|
+
function loadSources(sources2, sourceOptions, excludeSources, loopReleaseInterval) {
|
|
627
|
+
var includedSources = Object.keys(sources2).filter(function(sourceKey) {
|
|
628
|
+
return excludes(excludeSources, sourceKey);
|
|
629
|
+
});
|
|
630
|
+
var sourceGettersPromise = suppressUnhandledRejectionWarning(mapWithBreaks(includedSources, function(sourceKey) {
|
|
631
|
+
return loadSource(sources2[sourceKey], sourceOptions);
|
|
632
|
+
}, loopReleaseInterval));
|
|
633
|
+
return function getComponents() {
|
|
634
|
+
return __awaiter(this, void 0, void 0, function() {
|
|
635
|
+
var sourceGetters, componentPromises, componentArray, components, index2;
|
|
636
|
+
return __generator(this, function(_a) {
|
|
637
|
+
switch (_a.label) {
|
|
638
|
+
case 0:
|
|
639
|
+
return [4, sourceGettersPromise];
|
|
640
|
+
case 1:
|
|
641
|
+
sourceGetters = _a.sent();
|
|
642
|
+
return [4, mapWithBreaks(sourceGetters, function(sourceGetter) {
|
|
643
|
+
return suppressUnhandledRejectionWarning(sourceGetter());
|
|
644
|
+
}, loopReleaseInterval)];
|
|
645
|
+
case 2:
|
|
646
|
+
componentPromises = _a.sent();
|
|
647
|
+
return [
|
|
648
|
+
4,
|
|
649
|
+
Promise.all(componentPromises)
|
|
650
|
+
// Keeping the component keys order the same as the source keys order
|
|
651
|
+
];
|
|
652
|
+
case 3:
|
|
653
|
+
componentArray = _a.sent();
|
|
654
|
+
components = {};
|
|
655
|
+
for (index2 = 0; index2 < includedSources.length; ++index2) {
|
|
656
|
+
components[includedSources[index2]] = componentArray[index2];
|
|
657
|
+
}
|
|
658
|
+
return [2, components];
|
|
659
|
+
}
|
|
660
|
+
});
|
|
661
|
+
});
|
|
662
|
+
};
|
|
663
|
+
}
|
|
664
|
+
function transformSource(source, transformValue) {
|
|
665
|
+
var transformLoadResult = function(loadResult) {
|
|
666
|
+
if (isFinalResultLoaded(loadResult)) {
|
|
667
|
+
return transformValue(loadResult);
|
|
668
|
+
}
|
|
669
|
+
return function() {
|
|
670
|
+
var getResult = loadResult();
|
|
671
|
+
if (isPromise(getResult)) {
|
|
672
|
+
return getResult.then(transformValue);
|
|
673
|
+
}
|
|
674
|
+
return transformValue(getResult);
|
|
675
|
+
};
|
|
676
|
+
};
|
|
677
|
+
return function(options) {
|
|
678
|
+
var loadResult = source(options);
|
|
679
|
+
if (isPromise(loadResult)) {
|
|
680
|
+
return loadResult.then(transformLoadResult);
|
|
681
|
+
}
|
|
682
|
+
return transformLoadResult(loadResult);
|
|
683
|
+
};
|
|
684
|
+
}
|
|
685
|
+
function isTrident() {
|
|
686
|
+
var w = window;
|
|
687
|
+
var n = navigator;
|
|
688
|
+
return countTruthy([
|
|
689
|
+
"MSCSSMatrix" in w,
|
|
690
|
+
"msSetImmediate" in w,
|
|
691
|
+
"msIndexedDB" in w,
|
|
692
|
+
"msMaxTouchPoints" in n,
|
|
693
|
+
"msPointerEnabled" in n
|
|
694
|
+
]) >= 4;
|
|
695
|
+
}
|
|
696
|
+
function isEdgeHTML() {
|
|
697
|
+
var w = window;
|
|
698
|
+
var n = navigator;
|
|
699
|
+
return countTruthy(["msWriteProfilerMark" in w, "MSStream" in w, "msLaunchUri" in n, "msSaveBlob" in n]) >= 3 && !isTrident();
|
|
700
|
+
}
|
|
701
|
+
function isChromium() {
|
|
702
|
+
var w = window;
|
|
703
|
+
var n = navigator;
|
|
704
|
+
return countTruthy([
|
|
705
|
+
"webkitPersistentStorage" in n,
|
|
706
|
+
"webkitTemporaryStorage" in n,
|
|
707
|
+
(n.vendor || "").indexOf("Google") === 0,
|
|
708
|
+
"webkitResolveLocalFileSystemURL" in w,
|
|
709
|
+
"BatteryManager" in w,
|
|
710
|
+
"webkitMediaStream" in w,
|
|
711
|
+
"webkitSpeechGrammar" in w
|
|
712
|
+
]) >= 5;
|
|
713
|
+
}
|
|
714
|
+
function isWebKit() {
|
|
715
|
+
var w = window;
|
|
716
|
+
var n = navigator;
|
|
717
|
+
return countTruthy([
|
|
718
|
+
"ApplePayError" in w,
|
|
719
|
+
"CSSPrimitiveValue" in w,
|
|
720
|
+
"Counter" in w,
|
|
721
|
+
n.vendor.indexOf("Apple") === 0,
|
|
722
|
+
"RGBColor" in w,
|
|
723
|
+
"WebKitMediaKeys" in w
|
|
724
|
+
]) >= 4;
|
|
725
|
+
}
|
|
726
|
+
function isDesktopWebKit() {
|
|
727
|
+
var w = window;
|
|
728
|
+
var HTMLElement = w.HTMLElement, Document = w.Document;
|
|
729
|
+
return countTruthy([
|
|
730
|
+
"safari" in w,
|
|
731
|
+
!("ongestureend" in w),
|
|
732
|
+
!("TouchEvent" in w),
|
|
733
|
+
!("orientation" in w),
|
|
734
|
+
HTMLElement && !("autocapitalize" in HTMLElement.prototype),
|
|
735
|
+
Document && "pointerLockElement" in Document.prototype
|
|
736
|
+
]) >= 4;
|
|
737
|
+
}
|
|
738
|
+
function isSafariWebKit() {
|
|
739
|
+
var w = window;
|
|
740
|
+
return (
|
|
741
|
+
// Filters-out Chrome, Yandex, DuckDuckGo (macOS and iOS), Edge
|
|
742
|
+
isFunctionNative(w.print) && // Doesn't work in Safari < 15.4
|
|
743
|
+
String(w.browser) === "[object WebPageNamespace]"
|
|
744
|
+
);
|
|
745
|
+
}
|
|
746
|
+
function isGecko() {
|
|
747
|
+
var _a, _b;
|
|
748
|
+
var w = window;
|
|
749
|
+
return countTruthy([
|
|
750
|
+
"buildID" in navigator,
|
|
751
|
+
"MozAppearance" in ((_b = (_a = document.documentElement) === null || _a === void 0 ? void 0 : _a.style) !== null && _b !== void 0 ? _b : {}),
|
|
752
|
+
"onmozfullscreenchange" in w,
|
|
753
|
+
"mozInnerScreenX" in w,
|
|
754
|
+
"CSSMozDocumentRule" in w,
|
|
755
|
+
"CanvasCaptureMediaStream" in w
|
|
756
|
+
]) >= 4;
|
|
757
|
+
}
|
|
758
|
+
function isChromium86OrNewer() {
|
|
759
|
+
var w = window;
|
|
760
|
+
return countTruthy([
|
|
761
|
+
!("MediaSettingsRange" in w),
|
|
762
|
+
"RTCEncodedAudioFrame" in w,
|
|
763
|
+
"" + w.Intl === "[object Intl]",
|
|
764
|
+
"" + w.Reflect === "[object Reflect]"
|
|
765
|
+
]) >= 3;
|
|
766
|
+
}
|
|
767
|
+
function isChromium122OrNewer() {
|
|
768
|
+
var w = window;
|
|
769
|
+
var URLPattern = w.URLPattern;
|
|
770
|
+
return countTruthy([
|
|
771
|
+
"union" in Set.prototype,
|
|
772
|
+
"Iterator" in w,
|
|
773
|
+
URLPattern && "hasRegExpGroups" in URLPattern.prototype,
|
|
774
|
+
"RGB8" in WebGLRenderingContext.prototype
|
|
775
|
+
]) >= 3;
|
|
776
|
+
}
|
|
777
|
+
function isWebKit606OrNewer() {
|
|
778
|
+
var w = window;
|
|
779
|
+
return countTruthy([
|
|
780
|
+
"DOMRectList" in w,
|
|
781
|
+
"RTCPeerConnectionIceEvent" in w,
|
|
782
|
+
"SVGGeometryElement" in w,
|
|
783
|
+
"ontransitioncancel" in w
|
|
784
|
+
]) >= 3;
|
|
785
|
+
}
|
|
786
|
+
function isWebKit616OrNewer() {
|
|
787
|
+
var w = window;
|
|
788
|
+
var n = navigator;
|
|
789
|
+
var CSS = w.CSS, HTMLButtonElement = w.HTMLButtonElement;
|
|
790
|
+
return countTruthy([
|
|
791
|
+
!("getStorageUpdates" in n),
|
|
792
|
+
HTMLButtonElement && "popover" in HTMLButtonElement.prototype,
|
|
793
|
+
"CSSCounterStyleRule" in w,
|
|
794
|
+
CSS.supports("font-size-adjust: ex-height 0.5"),
|
|
795
|
+
CSS.supports("text-transform: full-width")
|
|
796
|
+
]) >= 4;
|
|
797
|
+
}
|
|
798
|
+
function isIPad() {
|
|
799
|
+
if (navigator.platform === "iPad") {
|
|
800
|
+
return true;
|
|
801
|
+
}
|
|
802
|
+
var s = screen;
|
|
803
|
+
var screenRatio = s.width / s.height;
|
|
804
|
+
return countTruthy([
|
|
805
|
+
// Since iOS 13. Doesn't work in Chrome on iPadOS <15, but works in desktop mode.
|
|
806
|
+
"MediaSource" in window,
|
|
807
|
+
// Since iOS 12. Doesn't work in Chrome on iPadOS.
|
|
808
|
+
!!Element.prototype.webkitRequestFullscreen,
|
|
809
|
+
// iPhone 4S that runs iOS 9 matches this, but it is not supported
|
|
810
|
+
// Doesn't work in incognito mode of Safari ≥17 with split screen because of tracking prevention
|
|
811
|
+
screenRatio > 0.65 && screenRatio < 1.53
|
|
812
|
+
]) >= 2;
|
|
813
|
+
}
|
|
814
|
+
function getFullscreenElement() {
|
|
815
|
+
var d = document;
|
|
816
|
+
return d.fullscreenElement || d.msFullscreenElement || d.mozFullScreenElement || d.webkitFullscreenElement || null;
|
|
817
|
+
}
|
|
818
|
+
function exitFullscreen() {
|
|
819
|
+
var d = document;
|
|
820
|
+
return (d.exitFullscreen || d.msExitFullscreen || d.mozCancelFullScreen || d.webkitExitFullscreen).call(d);
|
|
821
|
+
}
|
|
822
|
+
function isAndroid() {
|
|
823
|
+
var isItChromium = isChromium();
|
|
824
|
+
var isItGecko = isGecko();
|
|
825
|
+
var w = window;
|
|
826
|
+
var n = navigator;
|
|
827
|
+
var c = "connection";
|
|
828
|
+
if (isItChromium) {
|
|
829
|
+
return countTruthy([
|
|
830
|
+
!("SharedWorker" in w),
|
|
831
|
+
// `typechange` is deprecated, but it's still present on Android (tested on Chrome Mobile 117)
|
|
832
|
+
// Removal proposal https://bugs.chromium.org/p/chromium/issues/detail?id=699892
|
|
833
|
+
// Note: this expression returns true on ChromeOS, so additional detectors are required to avoid false-positives
|
|
834
|
+
n[c] && "ontypechange" in n[c],
|
|
835
|
+
!("sinkId" in new Audio())
|
|
836
|
+
]) >= 2;
|
|
837
|
+
} else if (isItGecko) {
|
|
838
|
+
return countTruthy(["onorientationchange" in w, "orientation" in w, /android/i.test(n.appVersion)]) >= 2;
|
|
839
|
+
} else {
|
|
840
|
+
return false;
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
function isSamsungInternet() {
|
|
844
|
+
var n = navigator;
|
|
845
|
+
var w = window;
|
|
846
|
+
var audioPrototype = Audio.prototype;
|
|
847
|
+
var visualViewport = w.visualViewport;
|
|
848
|
+
return countTruthy([
|
|
849
|
+
"srLatency" in audioPrototype,
|
|
850
|
+
"srChannelCount" in audioPrototype,
|
|
851
|
+
"devicePosture" in n,
|
|
852
|
+
visualViewport && "segments" in visualViewport,
|
|
853
|
+
"getTextInformation" in Image.prototype
|
|
854
|
+
// Not available in Samsung Internet 21
|
|
855
|
+
]) >= 3;
|
|
856
|
+
}
|
|
857
|
+
function getAudioFingerprint() {
|
|
858
|
+
if (doesBrowserPerformAntifingerprinting$1()) {
|
|
859
|
+
return -4;
|
|
860
|
+
}
|
|
861
|
+
return getUnstableAudioFingerprint();
|
|
862
|
+
}
|
|
863
|
+
function getUnstableAudioFingerprint() {
|
|
864
|
+
var w = window;
|
|
865
|
+
var AudioContext2 = w.OfflineAudioContext || w.webkitOfflineAudioContext;
|
|
866
|
+
if (!AudioContext2) {
|
|
867
|
+
return -2;
|
|
868
|
+
}
|
|
869
|
+
if (doesBrowserSuspendAudioContext()) {
|
|
870
|
+
return -1;
|
|
871
|
+
}
|
|
872
|
+
var hashFromIndex = 4500;
|
|
873
|
+
var hashToIndex = 5e3;
|
|
874
|
+
var context = new AudioContext2(1, hashToIndex, 44100);
|
|
875
|
+
var oscillator = context.createOscillator();
|
|
876
|
+
oscillator.type = "triangle";
|
|
877
|
+
oscillator.frequency.value = 1e4;
|
|
878
|
+
var compressor = context.createDynamicsCompressor();
|
|
879
|
+
compressor.threshold.value = -50;
|
|
880
|
+
compressor.knee.value = 40;
|
|
881
|
+
compressor.ratio.value = 12;
|
|
882
|
+
compressor.attack.value = 0;
|
|
883
|
+
compressor.release.value = 0.25;
|
|
884
|
+
oscillator.connect(compressor);
|
|
885
|
+
compressor.connect(context.destination);
|
|
886
|
+
oscillator.start(0);
|
|
887
|
+
var _a = startRenderingAudio(context), renderPromise = _a[0], finishRendering = _a[1];
|
|
888
|
+
var fingerprintPromise = suppressUnhandledRejectionWarning(renderPromise.then(function(buffer) {
|
|
889
|
+
return getHash(buffer.getChannelData(0).subarray(hashFromIndex));
|
|
890
|
+
}, function(error) {
|
|
891
|
+
if (error.name === "timeout" || error.name === "suspended") {
|
|
892
|
+
return -3;
|
|
893
|
+
}
|
|
894
|
+
throw error;
|
|
895
|
+
}));
|
|
896
|
+
return function() {
|
|
897
|
+
finishRendering();
|
|
898
|
+
return fingerprintPromise;
|
|
899
|
+
};
|
|
900
|
+
}
|
|
901
|
+
function doesBrowserSuspendAudioContext() {
|
|
902
|
+
return isWebKit() && !isDesktopWebKit() && !isWebKit606OrNewer();
|
|
903
|
+
}
|
|
904
|
+
function doesBrowserPerformAntifingerprinting$1() {
|
|
905
|
+
return (
|
|
906
|
+
// Safari ≥17
|
|
907
|
+
isWebKit() && isWebKit616OrNewer() && isSafariWebKit() || // Samsung Internet ≥26
|
|
908
|
+
isChromium() && isSamsungInternet() && isChromium122OrNewer()
|
|
909
|
+
);
|
|
910
|
+
}
|
|
911
|
+
function startRenderingAudio(context) {
|
|
912
|
+
var renderTryMaxCount = 3;
|
|
913
|
+
var renderRetryDelay = 500;
|
|
914
|
+
var runningMaxAwaitTime = 500;
|
|
915
|
+
var runningSufficientTime = 5e3;
|
|
916
|
+
var finalize = function() {
|
|
917
|
+
return void 0;
|
|
918
|
+
};
|
|
919
|
+
var resultPromise = new Promise(function(resolve, reject) {
|
|
920
|
+
var isFinalized = false;
|
|
921
|
+
var renderTryCount = 0;
|
|
922
|
+
var startedRunningAt = 0;
|
|
923
|
+
context.oncomplete = function(event) {
|
|
924
|
+
return resolve(event.renderedBuffer);
|
|
925
|
+
};
|
|
926
|
+
var startRunningTimeout = function() {
|
|
927
|
+
setTimeout(function() {
|
|
928
|
+
return reject(makeInnerError(
|
|
929
|
+
"timeout"
|
|
930
|
+
/* InnerErrorName.Timeout */
|
|
931
|
+
));
|
|
932
|
+
}, Math.min(runningMaxAwaitTime, startedRunningAt + runningSufficientTime - Date.now()));
|
|
933
|
+
};
|
|
934
|
+
var tryRender = function() {
|
|
935
|
+
try {
|
|
936
|
+
var renderingPromise = context.startRendering();
|
|
937
|
+
if (isPromise(renderingPromise)) {
|
|
938
|
+
suppressUnhandledRejectionWarning(renderingPromise);
|
|
939
|
+
}
|
|
940
|
+
switch (context.state) {
|
|
941
|
+
case "running":
|
|
942
|
+
startedRunningAt = Date.now();
|
|
943
|
+
if (isFinalized) {
|
|
944
|
+
startRunningTimeout();
|
|
945
|
+
}
|
|
946
|
+
break;
|
|
947
|
+
// Sometimes the audio context doesn't start after calling `startRendering` (in addition to the cases where
|
|
948
|
+
// audio context doesn't start at all). A known case is starting an audio context when the browser tab is in
|
|
949
|
+
// background on iPhone. Retries usually help in this case.
|
|
950
|
+
case "suspended":
|
|
951
|
+
if (!document.hidden) {
|
|
952
|
+
renderTryCount++;
|
|
953
|
+
}
|
|
954
|
+
if (isFinalized && renderTryCount >= renderTryMaxCount) {
|
|
955
|
+
reject(makeInnerError(
|
|
956
|
+
"suspended"
|
|
957
|
+
/* InnerErrorName.Suspended */
|
|
958
|
+
));
|
|
959
|
+
} else {
|
|
960
|
+
setTimeout(tryRender, renderRetryDelay);
|
|
961
|
+
}
|
|
962
|
+
break;
|
|
963
|
+
}
|
|
964
|
+
} catch (error) {
|
|
965
|
+
reject(error);
|
|
966
|
+
}
|
|
967
|
+
};
|
|
968
|
+
tryRender();
|
|
969
|
+
finalize = function() {
|
|
970
|
+
if (!isFinalized) {
|
|
971
|
+
isFinalized = true;
|
|
972
|
+
if (startedRunningAt > 0) {
|
|
973
|
+
startRunningTimeout();
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
};
|
|
977
|
+
});
|
|
978
|
+
return [resultPromise, finalize];
|
|
979
|
+
}
|
|
980
|
+
function getHash(signal) {
|
|
981
|
+
var hash = 0;
|
|
982
|
+
for (var i = 0; i < signal.length; ++i) {
|
|
983
|
+
hash += Math.abs(signal[i]);
|
|
984
|
+
}
|
|
985
|
+
return hash;
|
|
986
|
+
}
|
|
987
|
+
function makeInnerError(name) {
|
|
988
|
+
var error = new Error(name);
|
|
989
|
+
error.name = name;
|
|
990
|
+
return error;
|
|
991
|
+
}
|
|
992
|
+
function withIframe(action, initialHtml, domPollInterval) {
|
|
993
|
+
var _a, _b, _c;
|
|
994
|
+
if (domPollInterval === void 0) {
|
|
995
|
+
domPollInterval = 50;
|
|
996
|
+
}
|
|
997
|
+
return __awaiter(this, void 0, void 0, function() {
|
|
998
|
+
var d, iframe;
|
|
999
|
+
return __generator(this, function(_d) {
|
|
1000
|
+
switch (_d.label) {
|
|
1001
|
+
case 0:
|
|
1002
|
+
d = document;
|
|
1003
|
+
_d.label = 1;
|
|
1004
|
+
case 1:
|
|
1005
|
+
if (!!d.body) return [3, 3];
|
|
1006
|
+
return [4, wait(domPollInterval)];
|
|
1007
|
+
case 2:
|
|
1008
|
+
_d.sent();
|
|
1009
|
+
return [3, 1];
|
|
1010
|
+
case 3:
|
|
1011
|
+
iframe = d.createElement("iframe");
|
|
1012
|
+
_d.label = 4;
|
|
1013
|
+
case 4:
|
|
1014
|
+
_d.trys.push([4, , 10, 11]);
|
|
1015
|
+
return [4, new Promise(function(_resolve, _reject) {
|
|
1016
|
+
var isComplete = false;
|
|
1017
|
+
var resolve = function() {
|
|
1018
|
+
isComplete = true;
|
|
1019
|
+
_resolve();
|
|
1020
|
+
};
|
|
1021
|
+
var reject = function(error) {
|
|
1022
|
+
isComplete = true;
|
|
1023
|
+
_reject(error);
|
|
1024
|
+
};
|
|
1025
|
+
iframe.onload = resolve;
|
|
1026
|
+
iframe.onerror = reject;
|
|
1027
|
+
var style = iframe.style;
|
|
1028
|
+
style.setProperty("display", "block", "important");
|
|
1029
|
+
style.position = "absolute";
|
|
1030
|
+
style.top = "0";
|
|
1031
|
+
style.left = "0";
|
|
1032
|
+
style.visibility = "hidden";
|
|
1033
|
+
if (initialHtml && "srcdoc" in iframe) {
|
|
1034
|
+
iframe.srcdoc = initialHtml;
|
|
1035
|
+
} else {
|
|
1036
|
+
iframe.src = "about:blank";
|
|
1037
|
+
}
|
|
1038
|
+
d.body.appendChild(iframe);
|
|
1039
|
+
var checkReadyState = function() {
|
|
1040
|
+
var _a2, _b2;
|
|
1041
|
+
if (isComplete) {
|
|
1042
|
+
return;
|
|
1043
|
+
}
|
|
1044
|
+
if (((_b2 = (_a2 = iframe.contentWindow) === null || _a2 === void 0 ? void 0 : _a2.document) === null || _b2 === void 0 ? void 0 : _b2.readyState) === "complete") {
|
|
1045
|
+
resolve();
|
|
1046
|
+
} else {
|
|
1047
|
+
setTimeout(checkReadyState, 10);
|
|
1048
|
+
}
|
|
1049
|
+
};
|
|
1050
|
+
checkReadyState();
|
|
1051
|
+
})];
|
|
1052
|
+
case 5:
|
|
1053
|
+
_d.sent();
|
|
1054
|
+
_d.label = 6;
|
|
1055
|
+
case 6:
|
|
1056
|
+
if (!!((_b = (_a = iframe.contentWindow) === null || _a === void 0 ? void 0 : _a.document) === null || _b === void 0 ? void 0 : _b.body)) return [3, 8];
|
|
1057
|
+
return [4, wait(domPollInterval)];
|
|
1058
|
+
case 7:
|
|
1059
|
+
_d.sent();
|
|
1060
|
+
return [3, 6];
|
|
1061
|
+
case 8:
|
|
1062
|
+
return [4, action(iframe, iframe.contentWindow)];
|
|
1063
|
+
case 9:
|
|
1064
|
+
return [2, _d.sent()];
|
|
1065
|
+
case 10:
|
|
1066
|
+
(_c = iframe.parentNode) === null || _c === void 0 ? void 0 : _c.removeChild(iframe);
|
|
1067
|
+
return [
|
|
1068
|
+
7
|
|
1069
|
+
/*endfinally*/
|
|
1070
|
+
];
|
|
1071
|
+
case 11:
|
|
1072
|
+
return [
|
|
1073
|
+
2
|
|
1074
|
+
/*return*/
|
|
1075
|
+
];
|
|
1076
|
+
}
|
|
1077
|
+
});
|
|
1078
|
+
});
|
|
1079
|
+
}
|
|
1080
|
+
function selectorToElement(selector) {
|
|
1081
|
+
var _a = parseSimpleCssSelector(selector), tag = _a[0], attributes = _a[1];
|
|
1082
|
+
var element = document.createElement(tag !== null && tag !== void 0 ? tag : "div");
|
|
1083
|
+
for (var _i = 0, _b = Object.keys(attributes); _i < _b.length; _i++) {
|
|
1084
|
+
var name_1 = _b[_i];
|
|
1085
|
+
var value = attributes[name_1].join(" ");
|
|
1086
|
+
if (name_1 === "style") {
|
|
1087
|
+
addStyleString(element.style, value);
|
|
1088
|
+
} else {
|
|
1089
|
+
element.setAttribute(name_1, value);
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
return element;
|
|
1093
|
+
}
|
|
1094
|
+
function addStyleString(style, source) {
|
|
1095
|
+
for (var _i = 0, _a = source.split(";"); _i < _a.length; _i++) {
|
|
1096
|
+
var property = _a[_i];
|
|
1097
|
+
var match = /^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(property);
|
|
1098
|
+
if (match) {
|
|
1099
|
+
var name_2 = match[1], value = match[2], priority = match[4];
|
|
1100
|
+
style.setProperty(name_2, value, priority || "");
|
|
1101
|
+
}
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
function isAnyParentCrossOrigin() {
|
|
1105
|
+
var currentWindow = window;
|
|
1106
|
+
for (; ; ) {
|
|
1107
|
+
var parentWindow = currentWindow.parent;
|
|
1108
|
+
if (!parentWindow || parentWindow === currentWindow) {
|
|
1109
|
+
return false;
|
|
1110
|
+
}
|
|
1111
|
+
try {
|
|
1112
|
+
if (parentWindow.location.origin !== currentWindow.location.origin) {
|
|
1113
|
+
return true;
|
|
1114
|
+
}
|
|
1115
|
+
} catch (error) {
|
|
1116
|
+
if (error instanceof Error && error.name === "SecurityError") {
|
|
1117
|
+
return true;
|
|
1118
|
+
}
|
|
1119
|
+
throw error;
|
|
1120
|
+
}
|
|
1121
|
+
currentWindow = parentWindow;
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
function getFonts() {
|
|
1125
|
+
var _this = this;
|
|
1126
|
+
return withIframe(function(_, _a) {
|
|
1127
|
+
var document2 = _a.document;
|
|
1128
|
+
return __awaiter(_this, void 0, void 0, function() {
|
|
1129
|
+
var holder, spansContainer, defaultWidth, defaultHeight, createSpan, createSpanWithFonts, initializeBaseFontsSpans, initializeFontsSpans, isFontAvailable, baseFontsSpans, fontsSpans, index2;
|
|
1130
|
+
return __generator(this, function(_b) {
|
|
1131
|
+
holder = document2.body;
|
|
1132
|
+
holder.style.fontSize = textSize;
|
|
1133
|
+
spansContainer = document2.createElement("div");
|
|
1134
|
+
spansContainer.style.setProperty("visibility", "hidden", "important");
|
|
1135
|
+
defaultWidth = {};
|
|
1136
|
+
defaultHeight = {};
|
|
1137
|
+
createSpan = function(fontFamily) {
|
|
1138
|
+
var span = document2.createElement("span");
|
|
1139
|
+
var style = span.style;
|
|
1140
|
+
style.position = "absolute";
|
|
1141
|
+
style.top = "0";
|
|
1142
|
+
style.left = "0";
|
|
1143
|
+
style.fontFamily = fontFamily;
|
|
1144
|
+
span.textContent = testString;
|
|
1145
|
+
spansContainer.appendChild(span);
|
|
1146
|
+
return span;
|
|
1147
|
+
};
|
|
1148
|
+
createSpanWithFonts = function(fontToDetect, baseFont) {
|
|
1149
|
+
return createSpan("'".concat(fontToDetect, "',").concat(baseFont));
|
|
1150
|
+
};
|
|
1151
|
+
initializeBaseFontsSpans = function() {
|
|
1152
|
+
return baseFonts.map(createSpan);
|
|
1153
|
+
};
|
|
1154
|
+
initializeFontsSpans = function() {
|
|
1155
|
+
var spans = {};
|
|
1156
|
+
var _loop_1 = function(font2) {
|
|
1157
|
+
spans[font2] = baseFonts.map(function(baseFont) {
|
|
1158
|
+
return createSpanWithFonts(font2, baseFont);
|
|
1159
|
+
});
|
|
1160
|
+
};
|
|
1161
|
+
for (var _i = 0, fontList_1 = fontList; _i < fontList_1.length; _i++) {
|
|
1162
|
+
var font = fontList_1[_i];
|
|
1163
|
+
_loop_1(font);
|
|
1164
|
+
}
|
|
1165
|
+
return spans;
|
|
1166
|
+
};
|
|
1167
|
+
isFontAvailable = function(fontSpans) {
|
|
1168
|
+
return baseFonts.some(function(baseFont, baseFontIndex) {
|
|
1169
|
+
return fontSpans[baseFontIndex].offsetWidth !== defaultWidth[baseFont] || fontSpans[baseFontIndex].offsetHeight !== defaultHeight[baseFont];
|
|
1170
|
+
});
|
|
1171
|
+
};
|
|
1172
|
+
baseFontsSpans = initializeBaseFontsSpans();
|
|
1173
|
+
fontsSpans = initializeFontsSpans();
|
|
1174
|
+
holder.appendChild(spansContainer);
|
|
1175
|
+
for (index2 = 0; index2 < baseFonts.length; index2++) {
|
|
1176
|
+
defaultWidth[baseFonts[index2]] = baseFontsSpans[index2].offsetWidth;
|
|
1177
|
+
defaultHeight[baseFonts[index2]] = baseFontsSpans[index2].offsetHeight;
|
|
1178
|
+
}
|
|
1179
|
+
return [2, fontList.filter(function(font) {
|
|
1180
|
+
return isFontAvailable(fontsSpans[font]);
|
|
1181
|
+
})];
|
|
1182
|
+
});
|
|
1183
|
+
});
|
|
1184
|
+
});
|
|
1185
|
+
}
|
|
1186
|
+
function getPlugins() {
|
|
1187
|
+
var rawPlugins = navigator.plugins;
|
|
1188
|
+
if (!rawPlugins) {
|
|
1189
|
+
return void 0;
|
|
1190
|
+
}
|
|
1191
|
+
var plugins = [];
|
|
1192
|
+
for (var i = 0; i < rawPlugins.length; ++i) {
|
|
1193
|
+
var plugin = rawPlugins[i];
|
|
1194
|
+
if (!plugin) {
|
|
1195
|
+
continue;
|
|
1196
|
+
}
|
|
1197
|
+
var mimeTypes = [];
|
|
1198
|
+
for (var j = 0; j < plugin.length; ++j) {
|
|
1199
|
+
var mimeType = plugin[j];
|
|
1200
|
+
mimeTypes.push({
|
|
1201
|
+
type: mimeType.type,
|
|
1202
|
+
suffixes: mimeType.suffixes
|
|
1203
|
+
});
|
|
1204
|
+
}
|
|
1205
|
+
plugins.push({
|
|
1206
|
+
name: plugin.name,
|
|
1207
|
+
description: plugin.description,
|
|
1208
|
+
mimeTypes
|
|
1209
|
+
});
|
|
1210
|
+
}
|
|
1211
|
+
return plugins;
|
|
1212
|
+
}
|
|
1213
|
+
function getCanvasFingerprint() {
|
|
1214
|
+
return getUnstableCanvasFingerprint(doesBrowserPerformAntifingerprinting());
|
|
1215
|
+
}
|
|
1216
|
+
function getUnstableCanvasFingerprint(skipImages) {
|
|
1217
|
+
var _a;
|
|
1218
|
+
var winding = false;
|
|
1219
|
+
var geometry;
|
|
1220
|
+
var text;
|
|
1221
|
+
var _b = makeCanvasContext(), canvas = _b[0], context = _b[1];
|
|
1222
|
+
if (!isSupported(canvas, context)) {
|
|
1223
|
+
geometry = text = "unsupported";
|
|
1224
|
+
} else {
|
|
1225
|
+
winding = doesSupportWinding(context);
|
|
1226
|
+
if (skipImages) {
|
|
1227
|
+
geometry = text = "skipped";
|
|
1228
|
+
} else {
|
|
1229
|
+
_a = renderImages(canvas, context), geometry = _a[0], text = _a[1];
|
|
1230
|
+
}
|
|
1231
|
+
}
|
|
1232
|
+
return { winding, geometry, text };
|
|
1233
|
+
}
|
|
1234
|
+
function makeCanvasContext() {
|
|
1235
|
+
var canvas = document.createElement("canvas");
|
|
1236
|
+
canvas.width = 1;
|
|
1237
|
+
canvas.height = 1;
|
|
1238
|
+
return [canvas, canvas.getContext("2d")];
|
|
1239
|
+
}
|
|
1240
|
+
function isSupported(canvas, context) {
|
|
1241
|
+
return !!(context && canvas.toDataURL);
|
|
1242
|
+
}
|
|
1243
|
+
function doesSupportWinding(context) {
|
|
1244
|
+
context.rect(0, 0, 10, 10);
|
|
1245
|
+
context.rect(2, 2, 6, 6);
|
|
1246
|
+
return !context.isPointInPath(5, 5, "evenodd");
|
|
1247
|
+
}
|
|
1248
|
+
function renderImages(canvas, context) {
|
|
1249
|
+
renderTextImage(canvas, context);
|
|
1250
|
+
var textImage1 = canvasToString(canvas);
|
|
1251
|
+
var textImage2 = canvasToString(canvas);
|
|
1252
|
+
if (textImage1 !== textImage2) {
|
|
1253
|
+
return [
|
|
1254
|
+
"unstable",
|
|
1255
|
+
"unstable"
|
|
1256
|
+
/* ImageStatus.Unstable */
|
|
1257
|
+
];
|
|
1258
|
+
}
|
|
1259
|
+
renderGeometryImage(canvas, context);
|
|
1260
|
+
var geometryImage = canvasToString(canvas);
|
|
1261
|
+
return [geometryImage, textImage1];
|
|
1262
|
+
}
|
|
1263
|
+
function renderTextImage(canvas, context) {
|
|
1264
|
+
canvas.width = 240;
|
|
1265
|
+
canvas.height = 60;
|
|
1266
|
+
context.textBaseline = "alphabetic";
|
|
1267
|
+
context.fillStyle = "#f60";
|
|
1268
|
+
context.fillRect(100, 1, 62, 20);
|
|
1269
|
+
context.fillStyle = "#069";
|
|
1270
|
+
context.font = '11pt "Times New Roman"';
|
|
1271
|
+
var printedText = "Cwm fjordbank gly ".concat(
|
|
1272
|
+
String.fromCharCode(55357, 56835)
|
|
1273
|
+
/* 😃 */
|
|
1274
|
+
);
|
|
1275
|
+
context.fillText(printedText, 2, 15);
|
|
1276
|
+
context.fillStyle = "rgba(102, 204, 0, 0.2)";
|
|
1277
|
+
context.font = "18pt Arial";
|
|
1278
|
+
context.fillText(printedText, 4, 45);
|
|
1279
|
+
}
|
|
1280
|
+
function renderGeometryImage(canvas, context) {
|
|
1281
|
+
canvas.width = 122;
|
|
1282
|
+
canvas.height = 110;
|
|
1283
|
+
context.globalCompositeOperation = "multiply";
|
|
1284
|
+
for (var _i = 0, _a = [
|
|
1285
|
+
["#f2f", 40, 40],
|
|
1286
|
+
["#2ff", 80, 40],
|
|
1287
|
+
["#ff2", 60, 80]
|
|
1288
|
+
]; _i < _a.length; _i++) {
|
|
1289
|
+
var _b = _a[_i], color = _b[0], x = _b[1], y = _b[2];
|
|
1290
|
+
context.fillStyle = color;
|
|
1291
|
+
context.beginPath();
|
|
1292
|
+
context.arc(x, y, 40, 0, Math.PI * 2, true);
|
|
1293
|
+
context.closePath();
|
|
1294
|
+
context.fill();
|
|
1295
|
+
}
|
|
1296
|
+
context.fillStyle = "#f9c";
|
|
1297
|
+
context.arc(60, 60, 60, 0, Math.PI * 2, true);
|
|
1298
|
+
context.arc(60, 60, 20, 0, Math.PI * 2, true);
|
|
1299
|
+
context.fill("evenodd");
|
|
1300
|
+
}
|
|
1301
|
+
function canvasToString(canvas) {
|
|
1302
|
+
return canvas.toDataURL();
|
|
1303
|
+
}
|
|
1304
|
+
function doesBrowserPerformAntifingerprinting() {
|
|
1305
|
+
return isWebKit() && isWebKit616OrNewer() && isSafariWebKit();
|
|
1306
|
+
}
|
|
1307
|
+
function getTouchSupport() {
|
|
1308
|
+
var n = navigator;
|
|
1309
|
+
var maxTouchPoints = 0;
|
|
1310
|
+
var touchEvent;
|
|
1311
|
+
if (n.maxTouchPoints !== void 0) {
|
|
1312
|
+
maxTouchPoints = toInt(n.maxTouchPoints);
|
|
1313
|
+
} else if (n.msMaxTouchPoints !== void 0) {
|
|
1314
|
+
maxTouchPoints = n.msMaxTouchPoints;
|
|
1315
|
+
}
|
|
1316
|
+
try {
|
|
1317
|
+
document.createEvent("TouchEvent");
|
|
1318
|
+
touchEvent = true;
|
|
1319
|
+
} catch (_a) {
|
|
1320
|
+
touchEvent = false;
|
|
1321
|
+
}
|
|
1322
|
+
var touchStart = "ontouchstart" in window;
|
|
1323
|
+
return {
|
|
1324
|
+
maxTouchPoints,
|
|
1325
|
+
touchEvent,
|
|
1326
|
+
touchStart
|
|
1327
|
+
};
|
|
1328
|
+
}
|
|
1329
|
+
function getOsCpu() {
|
|
1330
|
+
return navigator.oscpu;
|
|
1331
|
+
}
|
|
1332
|
+
function getLanguages() {
|
|
1333
|
+
var n = navigator;
|
|
1334
|
+
var result = [];
|
|
1335
|
+
var language = n.language || n.userLanguage || n.browserLanguage || n.systemLanguage;
|
|
1336
|
+
if (language !== void 0) {
|
|
1337
|
+
result.push([language]);
|
|
1338
|
+
}
|
|
1339
|
+
if (Array.isArray(n.languages)) {
|
|
1340
|
+
if (!(isChromium() && isChromium86OrNewer())) {
|
|
1341
|
+
result.push(n.languages);
|
|
1342
|
+
}
|
|
1343
|
+
} else if (typeof n.languages === "string") {
|
|
1344
|
+
var languages = n.languages;
|
|
1345
|
+
if (languages) {
|
|
1346
|
+
result.push(languages.split(","));
|
|
1347
|
+
}
|
|
1348
|
+
}
|
|
1349
|
+
return result;
|
|
1350
|
+
}
|
|
1351
|
+
function getColorDepth() {
|
|
1352
|
+
return window.screen.colorDepth;
|
|
1353
|
+
}
|
|
1354
|
+
function getDeviceMemory() {
|
|
1355
|
+
return replaceNaN(toFloat(navigator.deviceMemory), void 0);
|
|
1356
|
+
}
|
|
1357
|
+
function getScreenResolution() {
|
|
1358
|
+
if (isWebKit() && isWebKit616OrNewer() && isSafariWebKit()) {
|
|
1359
|
+
return void 0;
|
|
1360
|
+
}
|
|
1361
|
+
return getUnstableScreenResolution();
|
|
1362
|
+
}
|
|
1363
|
+
function getUnstableScreenResolution() {
|
|
1364
|
+
var s = screen;
|
|
1365
|
+
var parseDimension = function(value) {
|
|
1366
|
+
return replaceNaN(toInt(value), null);
|
|
1367
|
+
};
|
|
1368
|
+
var dimensions = [parseDimension(s.width), parseDimension(s.height)];
|
|
1369
|
+
dimensions.sort().reverse();
|
|
1370
|
+
return dimensions;
|
|
1371
|
+
}
|
|
1372
|
+
function watchScreenFrame() {
|
|
1373
|
+
if (screenFrameSizeTimeoutId !== void 0) {
|
|
1374
|
+
return;
|
|
1375
|
+
}
|
|
1376
|
+
var checkScreenFrame = function() {
|
|
1377
|
+
var frameSize = getCurrentScreenFrame();
|
|
1378
|
+
if (isFrameSizeNull(frameSize)) {
|
|
1379
|
+
screenFrameSizeTimeoutId = setTimeout(checkScreenFrame, screenFrameCheckInterval);
|
|
1380
|
+
} else {
|
|
1381
|
+
screenFrameBackup = frameSize;
|
|
1382
|
+
screenFrameSizeTimeoutId = void 0;
|
|
1383
|
+
}
|
|
1384
|
+
};
|
|
1385
|
+
checkScreenFrame();
|
|
1386
|
+
}
|
|
1387
|
+
function getUnstableScreenFrame() {
|
|
1388
|
+
var _this = this;
|
|
1389
|
+
watchScreenFrame();
|
|
1390
|
+
return function() {
|
|
1391
|
+
return __awaiter(_this, void 0, void 0, function() {
|
|
1392
|
+
var frameSize;
|
|
1393
|
+
return __generator(this, function(_a) {
|
|
1394
|
+
switch (_a.label) {
|
|
1395
|
+
case 0:
|
|
1396
|
+
frameSize = getCurrentScreenFrame();
|
|
1397
|
+
if (!isFrameSizeNull(frameSize)) return [3, 2];
|
|
1398
|
+
if (screenFrameBackup) {
|
|
1399
|
+
return [2, __spreadArray([], screenFrameBackup, true)];
|
|
1400
|
+
}
|
|
1401
|
+
if (!getFullscreenElement()) return [3, 2];
|
|
1402
|
+
return [4, exitFullscreen()];
|
|
1403
|
+
case 1:
|
|
1404
|
+
_a.sent();
|
|
1405
|
+
frameSize = getCurrentScreenFrame();
|
|
1406
|
+
_a.label = 2;
|
|
1407
|
+
case 2:
|
|
1408
|
+
if (!isFrameSizeNull(frameSize)) {
|
|
1409
|
+
screenFrameBackup = frameSize;
|
|
1410
|
+
}
|
|
1411
|
+
return [2, frameSize];
|
|
1412
|
+
}
|
|
1413
|
+
});
|
|
1414
|
+
});
|
|
1415
|
+
};
|
|
1416
|
+
}
|
|
1417
|
+
function getScreenFrame() {
|
|
1418
|
+
var _this = this;
|
|
1419
|
+
if (isWebKit() && isWebKit616OrNewer() && isSafariWebKit()) {
|
|
1420
|
+
return function() {
|
|
1421
|
+
return Promise.resolve(void 0);
|
|
1422
|
+
};
|
|
1423
|
+
}
|
|
1424
|
+
var screenFrameGetter = getUnstableScreenFrame();
|
|
1425
|
+
return function() {
|
|
1426
|
+
return __awaiter(_this, void 0, void 0, function() {
|
|
1427
|
+
var frameSize, processSize;
|
|
1428
|
+
return __generator(this, function(_a) {
|
|
1429
|
+
switch (_a.label) {
|
|
1430
|
+
case 0:
|
|
1431
|
+
return [4, screenFrameGetter()];
|
|
1432
|
+
case 1:
|
|
1433
|
+
frameSize = _a.sent();
|
|
1434
|
+
processSize = function(sideSize) {
|
|
1435
|
+
return sideSize === null ? null : round(sideSize, roundingPrecision);
|
|
1436
|
+
};
|
|
1437
|
+
return [2, [processSize(frameSize[0]), processSize(frameSize[1]), processSize(frameSize[2]), processSize(frameSize[3])]];
|
|
1438
|
+
}
|
|
1439
|
+
});
|
|
1440
|
+
});
|
|
1441
|
+
};
|
|
1442
|
+
}
|
|
1443
|
+
function getCurrentScreenFrame() {
|
|
1444
|
+
var s = screen;
|
|
1445
|
+
return [
|
|
1446
|
+
replaceNaN(toFloat(s.availTop), null),
|
|
1447
|
+
replaceNaN(toFloat(s.width) - toFloat(s.availWidth) - replaceNaN(toFloat(s.availLeft), 0), null),
|
|
1448
|
+
replaceNaN(toFloat(s.height) - toFloat(s.availHeight) - replaceNaN(toFloat(s.availTop), 0), null),
|
|
1449
|
+
replaceNaN(toFloat(s.availLeft), null)
|
|
1450
|
+
];
|
|
1451
|
+
}
|
|
1452
|
+
function isFrameSizeNull(frameSize) {
|
|
1453
|
+
for (var i = 0; i < 4; ++i) {
|
|
1454
|
+
if (frameSize[i]) {
|
|
1455
|
+
return false;
|
|
1456
|
+
}
|
|
1457
|
+
}
|
|
1458
|
+
return true;
|
|
1459
|
+
}
|
|
1460
|
+
function getHardwareConcurrency() {
|
|
1461
|
+
return replaceNaN(toInt(navigator.hardwareConcurrency), void 0);
|
|
1462
|
+
}
|
|
1463
|
+
function getTimezone() {
|
|
1464
|
+
var _a;
|
|
1465
|
+
var DateTimeFormat = (_a = window.Intl) === null || _a === void 0 ? void 0 : _a.DateTimeFormat;
|
|
1466
|
+
if (DateTimeFormat) {
|
|
1467
|
+
var timezone = new DateTimeFormat().resolvedOptions().timeZone;
|
|
1468
|
+
if (timezone) {
|
|
1469
|
+
return timezone;
|
|
1470
|
+
}
|
|
1471
|
+
}
|
|
1472
|
+
var offset = -getTimezoneOffset();
|
|
1473
|
+
return "UTC".concat(offset >= 0 ? "+" : "").concat(offset);
|
|
1474
|
+
}
|
|
1475
|
+
function getTimezoneOffset() {
|
|
1476
|
+
var currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
1477
|
+
return Math.max(
|
|
1478
|
+
// `getTimezoneOffset` returns a number as a string in some unidentified cases
|
|
1479
|
+
toFloat(new Date(currentYear, 0, 1).getTimezoneOffset()),
|
|
1480
|
+
toFloat(new Date(currentYear, 6, 1).getTimezoneOffset())
|
|
1481
|
+
);
|
|
1482
|
+
}
|
|
1483
|
+
function getSessionStorage() {
|
|
1484
|
+
try {
|
|
1485
|
+
return !!window.sessionStorage;
|
|
1486
|
+
} catch (error) {
|
|
1487
|
+
return true;
|
|
1488
|
+
}
|
|
1489
|
+
}
|
|
1490
|
+
function getLocalStorage() {
|
|
1491
|
+
try {
|
|
1492
|
+
return !!window.localStorage;
|
|
1493
|
+
} catch (e) {
|
|
1494
|
+
return true;
|
|
1495
|
+
}
|
|
1496
|
+
}
|
|
1497
|
+
function getIndexedDB() {
|
|
1498
|
+
if (isTrident() || isEdgeHTML()) {
|
|
1499
|
+
return void 0;
|
|
1500
|
+
}
|
|
1501
|
+
try {
|
|
1502
|
+
return !!window.indexedDB;
|
|
1503
|
+
} catch (e) {
|
|
1504
|
+
return true;
|
|
1505
|
+
}
|
|
1506
|
+
}
|
|
1507
|
+
function getOpenDatabase() {
|
|
1508
|
+
return !!window.openDatabase;
|
|
1509
|
+
}
|
|
1510
|
+
function getCpuClass() {
|
|
1511
|
+
return navigator.cpuClass;
|
|
1512
|
+
}
|
|
1513
|
+
function getPlatform() {
|
|
1514
|
+
var platform = navigator.platform;
|
|
1515
|
+
if (platform === "MacIntel") {
|
|
1516
|
+
if (isWebKit() && !isDesktopWebKit()) {
|
|
1517
|
+
return isIPad() ? "iPad" : "iPhone";
|
|
1518
|
+
}
|
|
1519
|
+
}
|
|
1520
|
+
return platform;
|
|
1521
|
+
}
|
|
1522
|
+
function getVendor() {
|
|
1523
|
+
return navigator.vendor || "";
|
|
1524
|
+
}
|
|
1525
|
+
function getVendorFlavors() {
|
|
1526
|
+
var flavors = [];
|
|
1527
|
+
for (var _i = 0, _a = [
|
|
1528
|
+
// Blink and some browsers on iOS
|
|
1529
|
+
"chrome",
|
|
1530
|
+
// Safari on macOS
|
|
1531
|
+
"safari",
|
|
1532
|
+
// Chrome on iOS (checked in 85 on 13 and 87 on 14)
|
|
1533
|
+
"__crWeb",
|
|
1534
|
+
"__gCrWeb",
|
|
1535
|
+
// Yandex Browser on iOS, macOS and Android (checked in 21.2 on iOS 14, macOS and Android)
|
|
1536
|
+
"yandex",
|
|
1537
|
+
// Yandex Browser on iOS (checked in 21.2 on 14)
|
|
1538
|
+
"__yb",
|
|
1539
|
+
"__ybro",
|
|
1540
|
+
// Firefox on iOS (checked in 32 on 14)
|
|
1541
|
+
"__firefox__",
|
|
1542
|
+
// Edge on iOS (checked in 46 on 14)
|
|
1543
|
+
"__edgeTrackingPreventionStatistics",
|
|
1544
|
+
"webkit",
|
|
1545
|
+
// Opera Touch on iOS (checked in 2.6 on 14)
|
|
1546
|
+
"oprt",
|
|
1547
|
+
// Samsung Internet on Android (checked in 11.1)
|
|
1548
|
+
"samsungAr",
|
|
1549
|
+
// UC Browser on Android (checked in 12.10 and 13.0)
|
|
1550
|
+
"ucweb",
|
|
1551
|
+
"UCShellJava",
|
|
1552
|
+
// Puffin on Android (checked in 9.0)
|
|
1553
|
+
"puffinDevice"
|
|
1554
|
+
// UC on iOS and Opera on Android have no specific global variables
|
|
1555
|
+
// Edge for Android isn't checked
|
|
1556
|
+
]; _i < _a.length; _i++) {
|
|
1557
|
+
var key = _a[_i];
|
|
1558
|
+
var value = window[key];
|
|
1559
|
+
if (value && typeof value === "object") {
|
|
1560
|
+
flavors.push(key);
|
|
1561
|
+
}
|
|
1562
|
+
}
|
|
1563
|
+
return flavors.sort();
|
|
1564
|
+
}
|
|
1565
|
+
function areCookiesEnabled() {
|
|
1566
|
+
var d = document;
|
|
1567
|
+
try {
|
|
1568
|
+
d.cookie = "cookietest=1; SameSite=Strict;";
|
|
1569
|
+
var result = d.cookie.indexOf("cookietest=") !== -1;
|
|
1570
|
+
d.cookie = "cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT";
|
|
1571
|
+
return result;
|
|
1572
|
+
} catch (e) {
|
|
1573
|
+
return false;
|
|
1574
|
+
}
|
|
1575
|
+
}
|
|
1576
|
+
function getFilters() {
|
|
1577
|
+
var fromB64 = atob;
|
|
1578
|
+
return {
|
|
1579
|
+
abpIndo: [
|
|
1580
|
+
"#Iklan-Melayang",
|
|
1581
|
+
"#Kolom-Iklan-728",
|
|
1582
|
+
"#SidebarIklan-wrapper",
|
|
1583
|
+
'[title="ALIENBOLA" i]',
|
|
1584
|
+
fromB64("I0JveC1CYW5uZXItYWRz")
|
|
1585
|
+
],
|
|
1586
|
+
abpvn: [".quangcao", "#mobileCatfish", fromB64("LmNsb3NlLWFkcw=="), '[id^="bn_bottom_fixed_"]', "#pmadv"],
|
|
1587
|
+
adBlockFinland: [
|
|
1588
|
+
".mainostila",
|
|
1589
|
+
fromB64("LnNwb25zb3JpdA=="),
|
|
1590
|
+
".ylamainos",
|
|
1591
|
+
fromB64("YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd"),
|
|
1592
|
+
fromB64("YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd")
|
|
1593
|
+
],
|
|
1594
|
+
adBlockPersian: [
|
|
1595
|
+
"#navbar_notice_50",
|
|
1596
|
+
".kadr",
|
|
1597
|
+
'TABLE[width="140px"]',
|
|
1598
|
+
"#divAgahi",
|
|
1599
|
+
fromB64("YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd")
|
|
1600
|
+
],
|
|
1601
|
+
adBlockWarningRemoval: [
|
|
1602
|
+
"#adblock-honeypot",
|
|
1603
|
+
".adblocker-root",
|
|
1604
|
+
".wp_adblock_detect",
|
|
1605
|
+
fromB64("LmhlYWRlci1ibG9ja2VkLWFk"),
|
|
1606
|
+
fromB64("I2FkX2Jsb2NrZXI=")
|
|
1607
|
+
],
|
|
1608
|
+
adGuardAnnoyances: [
|
|
1609
|
+
".hs-sosyal",
|
|
1610
|
+
"#cookieconsentdiv",
|
|
1611
|
+
'div[class^="app_gdpr"]',
|
|
1612
|
+
".as-oil",
|
|
1613
|
+
'[data-cypress="soft-push-notification-modal"]'
|
|
1614
|
+
],
|
|
1615
|
+
adGuardBase: [
|
|
1616
|
+
".BetterJsPopOverlay",
|
|
1617
|
+
fromB64("I2FkXzMwMFgyNTA="),
|
|
1618
|
+
fromB64("I2Jhbm5lcmZsb2F0MjI="),
|
|
1619
|
+
fromB64("I2NhbXBhaWduLWJhbm5lcg=="),
|
|
1620
|
+
fromB64("I0FkLUNvbnRlbnQ=")
|
|
1621
|
+
],
|
|
1622
|
+
adGuardChinese: [
|
|
1623
|
+
fromB64("LlppX2FkX2FfSA=="),
|
|
1624
|
+
fromB64("YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd"),
|
|
1625
|
+
"#widget-quan",
|
|
1626
|
+
fromB64("YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd"),
|
|
1627
|
+
fromB64("YVtocmVmKj0iLjE5NTZobC5jb20vIl0=")
|
|
1628
|
+
],
|
|
1629
|
+
adGuardFrench: [
|
|
1630
|
+
"#pavePub",
|
|
1631
|
+
fromB64("LmFkLWRlc2t0b3AtcmVjdGFuZ2xl"),
|
|
1632
|
+
".mobile_adhesion",
|
|
1633
|
+
".widgetadv",
|
|
1634
|
+
fromB64("LmFkc19iYW4=")
|
|
1635
|
+
],
|
|
1636
|
+
adGuardGerman: ['aside[data-portal-id="leaderboard"]'],
|
|
1637
|
+
adGuardJapanese: [
|
|
1638
|
+
"#kauli_yad_1",
|
|
1639
|
+
fromB64("YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0="),
|
|
1640
|
+
fromB64("Ll9wb3BJbl9pbmZpbml0ZV9hZA=="),
|
|
1641
|
+
fromB64("LmFkZ29vZ2xl"),
|
|
1642
|
+
fromB64("Ll9faXNib29zdFJldHVybkFk")
|
|
1643
|
+
],
|
|
1644
|
+
adGuardMobile: [
|
|
1645
|
+
fromB64("YW1wLWF1dG8tYWRz"),
|
|
1646
|
+
fromB64("LmFtcF9hZA=="),
|
|
1647
|
+
'amp-embed[type="24smi"]',
|
|
1648
|
+
"#mgid_iframe1",
|
|
1649
|
+
fromB64("I2FkX2ludmlld19hcmVh")
|
|
1650
|
+
],
|
|
1651
|
+
adGuardRussian: [
|
|
1652
|
+
fromB64("YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0="),
|
|
1653
|
+
fromB64("LnJlY2xhbWE="),
|
|
1654
|
+
'div[id^="smi2adblock"]',
|
|
1655
|
+
fromB64("ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd"),
|
|
1656
|
+
"#psyduckpockeball"
|
|
1657
|
+
],
|
|
1658
|
+
adGuardSocial: [
|
|
1659
|
+
fromB64("YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0="),
|
|
1660
|
+
fromB64("YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0="),
|
|
1661
|
+
".etsy-tweet",
|
|
1662
|
+
"#inlineShare",
|
|
1663
|
+
".popup-social"
|
|
1664
|
+
],
|
|
1665
|
+
adGuardSpanishPortuguese: ["#barraPublicidade", "#Publicidade", "#publiEspecial", "#queTooltip", ".cnt-publi"],
|
|
1666
|
+
adGuardTrackingProtection: [
|
|
1667
|
+
"#qoo-counter",
|
|
1668
|
+
fromB64("YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=="),
|
|
1669
|
+
fromB64("YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0="),
|
|
1670
|
+
fromB64("YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=="),
|
|
1671
|
+
"#top100counter"
|
|
1672
|
+
],
|
|
1673
|
+
adGuardTurkish: [
|
|
1674
|
+
"#backkapat",
|
|
1675
|
+
fromB64("I3Jla2xhbWk="),
|
|
1676
|
+
fromB64("YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbnRlay5jb20udHIvIl0="),
|
|
1677
|
+
fromB64("YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd"),
|
|
1678
|
+
fromB64("YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ==")
|
|
1679
|
+
],
|
|
1680
|
+
bulgarian: [fromB64("dGQjZnJlZW5ldF90YWJsZV9hZHM="), "#ea_intext_div", ".lapni-pop-over", "#xenium_hot_offers"],
|
|
1681
|
+
easyList: [
|
|
1682
|
+
".yb-floorad",
|
|
1683
|
+
fromB64("LndpZGdldF9wb19hZHNfd2lkZ2V0"),
|
|
1684
|
+
fromB64("LnRyYWZmaWNqdW5reS1hZA=="),
|
|
1685
|
+
".textad_headline",
|
|
1686
|
+
fromB64("LnNwb25zb3JlZC10ZXh0LWxpbmtz")
|
|
1687
|
+
],
|
|
1688
|
+
easyListChina: [
|
|
1689
|
+
fromB64("LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=="),
|
|
1690
|
+
fromB64("LmZyb250cGFnZUFkdk0="),
|
|
1691
|
+
"#taotaole",
|
|
1692
|
+
"#aafoot.top_box",
|
|
1693
|
+
".cfa_popup"
|
|
1694
|
+
],
|
|
1695
|
+
easyListCookie: [
|
|
1696
|
+
".ezmob-footer",
|
|
1697
|
+
".cc-CookieWarning",
|
|
1698
|
+
"[data-cookie-number]",
|
|
1699
|
+
fromB64("LmF3LWNvb2tpZS1iYW5uZXI="),
|
|
1700
|
+
".sygnal24-gdpr-modal-wrap"
|
|
1701
|
+
],
|
|
1702
|
+
easyListCzechSlovak: [
|
|
1703
|
+
"#onlajny-stickers",
|
|
1704
|
+
fromB64("I3Jla2xhbW5pLWJveA=="),
|
|
1705
|
+
fromB64("LnJla2xhbWEtbWVnYWJvYXJk"),
|
|
1706
|
+
".sklik",
|
|
1707
|
+
fromB64("W2lkXj0ic2tsaWtSZWtsYW1hIl0=")
|
|
1708
|
+
],
|
|
1709
|
+
easyListDutch: [
|
|
1710
|
+
fromB64("I2FkdmVydGVudGll"),
|
|
1711
|
+
fromB64("I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=="),
|
|
1712
|
+
".adstekst",
|
|
1713
|
+
fromB64("YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0="),
|
|
1714
|
+
"#semilo-lrectangle"
|
|
1715
|
+
],
|
|
1716
|
+
easyListGermany: [
|
|
1717
|
+
"#SSpotIMPopSlider",
|
|
1718
|
+
fromB64("LnNwb25zb3JsaW5rZ3J1ZW4="),
|
|
1719
|
+
fromB64("I3dlcmJ1bmdza3k="),
|
|
1720
|
+
fromB64("I3Jla2xhbWUtcmVjaHRzLW1pdHRl"),
|
|
1721
|
+
fromB64("YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0=")
|
|
1722
|
+
],
|
|
1723
|
+
easyListItaly: [
|
|
1724
|
+
fromB64("LmJveF9hZHZfYW5udW5jaQ=="),
|
|
1725
|
+
".sb-box-pubbliredazionale",
|
|
1726
|
+
fromB64("YVtocmVmXj0iaHR0cDovL2FmZmlsaWF6aW9uaWFkcy5zbmFpLml0LyJd"),
|
|
1727
|
+
fromB64("YVtocmVmXj0iaHR0cHM6Ly9hZHNlcnZlci5odG1sLml0LyJd"),
|
|
1728
|
+
fromB64("YVtocmVmXj0iaHR0cHM6Ly9hZmZpbGlhemlvbmlhZHMuc25haS5pdC8iXQ==")
|
|
1729
|
+
],
|
|
1730
|
+
easyListLithuania: [
|
|
1731
|
+
fromB64("LnJla2xhbW9zX3RhcnBhcw=="),
|
|
1732
|
+
fromB64("LnJla2xhbW9zX251b3JvZG9z"),
|
|
1733
|
+
fromB64("aW1nW2FsdD0iUmVrbGFtaW5pcyBza3lkZWxpcyJd"),
|
|
1734
|
+
fromB64("aW1nW2FsdD0iRGVkaWt1b3RpLmx0IHNlcnZlcmlhaSJd"),
|
|
1735
|
+
fromB64("aW1nW2FsdD0iSG9zdGluZ2FzIFNlcnZlcmlhaS5sdCJd")
|
|
1736
|
+
],
|
|
1737
|
+
estonian: [fromB64("QVtocmVmKj0iaHR0cDovL3BheTRyZXN1bHRzMjQuZXUiXQ==")],
|
|
1738
|
+
fanboyAnnoyances: ["#ac-lre-player", ".navigate-to-top", "#subscribe_popup", ".newsletter_holder", "#back-top"],
|
|
1739
|
+
fanboyAntiFacebook: [".util-bar-module-firefly-visible"],
|
|
1740
|
+
fanboyEnhancedTrackers: [
|
|
1741
|
+
".open.pushModal",
|
|
1742
|
+
"#issuem-leaky-paywall-articles-zero-remaining-nag",
|
|
1743
|
+
"#sovrn_container",
|
|
1744
|
+
'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',
|
|
1745
|
+
".BlockNag__Card"
|
|
1746
|
+
],
|
|
1747
|
+
fanboySocial: ["#FollowUs", "#meteored_share", "#social_follow", ".article-sharer", ".community__social-desc"],
|
|
1748
|
+
frellwitSwedish: [
|
|
1749
|
+
fromB64("YVtocmVmKj0iY2FzaW5vcHJvLnNlIl1bdGFyZ2V0PSJfYmxhbmsiXQ=="),
|
|
1750
|
+
fromB64("YVtocmVmKj0iZG9rdG9yLXNlLm9uZWxpbmsubWUiXQ=="),
|
|
1751
|
+
"article.category-samarbete",
|
|
1752
|
+
fromB64("ZGl2LmhvbGlkQWRz"),
|
|
1753
|
+
"ul.adsmodern"
|
|
1754
|
+
],
|
|
1755
|
+
greekAdBlock: [
|
|
1756
|
+
fromB64("QVtocmVmKj0iYWRtYW4ub3RlbmV0LmdyL2NsaWNrPyJd"),
|
|
1757
|
+
fromB64("QVtocmVmKj0iaHR0cDovL2F4aWFiYW5uZXJzLmV4b2R1cy5nci8iXQ=="),
|
|
1758
|
+
fromB64("QVtocmVmKj0iaHR0cDovL2ludGVyYWN0aXZlLmZvcnRobmV0LmdyL2NsaWNrPyJd"),
|
|
1759
|
+
"DIV.agores300",
|
|
1760
|
+
"TABLE.advright"
|
|
1761
|
+
],
|
|
1762
|
+
hungarian: [
|
|
1763
|
+
"#cemp_doboz",
|
|
1764
|
+
".optimonk-iframe-container",
|
|
1765
|
+
fromB64("LmFkX19tYWlu"),
|
|
1766
|
+
fromB64("W2NsYXNzKj0iR29vZ2xlQWRzIl0="),
|
|
1767
|
+
"#hirdetesek_box"
|
|
1768
|
+
],
|
|
1769
|
+
iDontCareAboutCookies: [
|
|
1770
|
+
'.alert-info[data-block-track*="CookieNotice"]',
|
|
1771
|
+
".ModuleTemplateCookieIndicator",
|
|
1772
|
+
".o--cookies--container",
|
|
1773
|
+
"#cookies-policy-sticky",
|
|
1774
|
+
"#stickyCookieBar"
|
|
1775
|
+
],
|
|
1776
|
+
icelandicAbp: [fromB64("QVtocmVmXj0iL2ZyYW1ld29yay9yZXNvdXJjZXMvZm9ybXMvYWRzLmFzcHgiXQ==")],
|
|
1777
|
+
latvian: [
|
|
1778
|
+
fromB64("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiAxMjBweDsgaGVpZ2h0OiA0MHB4OyBvdmVyZmxvdzogaGlkZGVuOyBwb3NpdGlvbjogcmVsYXRpdmU7Il0="),
|
|
1779
|
+
fromB64("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiA4OHB4OyBoZWlnaHQ6IDMxcHg7IG92ZXJmbG93OiBoaWRkZW47IHBvc2l0aW9uOiByZWxhdGl2ZTsiXQ==")
|
|
1780
|
+
],
|
|
1781
|
+
listKr: [
|
|
1782
|
+
fromB64("YVtocmVmKj0iLy9hZC5wbGFuYnBsdXMuY28ua3IvIl0="),
|
|
1783
|
+
fromB64("I2xpdmVyZUFkV3JhcHBlcg=="),
|
|
1784
|
+
fromB64("YVtocmVmKj0iLy9hZHYuaW1hZHJlcC5jby5rci8iXQ=="),
|
|
1785
|
+
fromB64("aW5zLmZhc3R2aWV3LWFk"),
|
|
1786
|
+
".revenue_unit_item.dable"
|
|
1787
|
+
],
|
|
1788
|
+
listeAr: [
|
|
1789
|
+
fromB64("LmdlbWluaUxCMUFk"),
|
|
1790
|
+
".right-and-left-sponsers",
|
|
1791
|
+
fromB64("YVtocmVmKj0iLmFmbGFtLmluZm8iXQ=="),
|
|
1792
|
+
fromB64("YVtocmVmKj0iYm9vcmFxLm9yZyJd"),
|
|
1793
|
+
fromB64("YVtocmVmKj0iZHViaXp6bGUuY29tL2FyLz91dG1fc291cmNlPSJd")
|
|
1794
|
+
],
|
|
1795
|
+
listeFr: [
|
|
1796
|
+
fromB64("YVtocmVmXj0iaHR0cDovL3Byb21vLnZhZG9yLmNvbS8iXQ=="),
|
|
1797
|
+
fromB64("I2FkY29udGFpbmVyX3JlY2hlcmNoZQ=="),
|
|
1798
|
+
fromB64("YVtocmVmKj0id2Vib3JhbWEuZnIvZmNnaS1iaW4vIl0="),
|
|
1799
|
+
".site-pub-interstitiel",
|
|
1800
|
+
'div[id^="crt-"][data-criteo-id]'
|
|
1801
|
+
],
|
|
1802
|
+
officialPolish: [
|
|
1803
|
+
"#ceneo-placeholder-ceneo-12",
|
|
1804
|
+
fromB64("W2hyZWZePSJodHRwczovL2FmZi5zZW5kaHViLnBsLyJd"),
|
|
1805
|
+
fromB64("YVtocmVmXj0iaHR0cDovL2Fkdm1hbmFnZXIudGVjaGZ1bi5wbC9yZWRpcmVjdC8iXQ=="),
|
|
1806
|
+
fromB64("YVtocmVmXj0iaHR0cDovL3d3dy50cml6ZXIucGwvP3V0bV9zb3VyY2UiXQ=="),
|
|
1807
|
+
fromB64("ZGl2I3NrYXBpZWNfYWQ=")
|
|
1808
|
+
],
|
|
1809
|
+
ro: [
|
|
1810
|
+
fromB64("YVtocmVmXj0iLy9hZmZ0cmsuYWx0ZXgucm8vQ291bnRlci9DbGljayJd"),
|
|
1811
|
+
fromB64("YVtocmVmXj0iaHR0cHM6Ly9ibGFja2ZyaWRheXNhbGVzLnJvL3Ryay9zaG9wLyJd"),
|
|
1812
|
+
fromB64("YVtocmVmXj0iaHR0cHM6Ly9ldmVudC4ycGVyZm9ybWFudC5jb20vZXZlbnRzL2NsaWNrIl0="),
|
|
1813
|
+
fromB64("YVtocmVmXj0iaHR0cHM6Ly9sLnByb2ZpdHNoYXJlLnJvLyJd"),
|
|
1814
|
+
'a[href^="/url/"]'
|
|
1815
|
+
],
|
|
1816
|
+
ruAd: [
|
|
1817
|
+
fromB64("YVtocmVmKj0iLy9mZWJyYXJlLnJ1LyJd"),
|
|
1818
|
+
fromB64("YVtocmVmKj0iLy91dGltZy5ydS8iXQ=="),
|
|
1819
|
+
fromB64("YVtocmVmKj0iOi8vY2hpa2lkaWtpLnJ1Il0="),
|
|
1820
|
+
"#pgeldiz",
|
|
1821
|
+
".yandex-rtb-block"
|
|
1822
|
+
],
|
|
1823
|
+
thaiAds: [
|
|
1824
|
+
"a[href*=macau-uta-popup]",
|
|
1825
|
+
fromB64("I2Fkcy1nb29nbGUtbWlkZGxlX3JlY3RhbmdsZS1ncm91cA=="),
|
|
1826
|
+
fromB64("LmFkczMwMHM="),
|
|
1827
|
+
".bumq",
|
|
1828
|
+
".img-kosana"
|
|
1829
|
+
],
|
|
1830
|
+
webAnnoyancesUltralist: [
|
|
1831
|
+
"#mod-social-share-2",
|
|
1832
|
+
"#social-tools",
|
|
1833
|
+
fromB64("LmN0cGwtZnVsbGJhbm5lcg=="),
|
|
1834
|
+
".zergnet-recommend",
|
|
1835
|
+
".yt.btn-link.btn-md.btn"
|
|
1836
|
+
]
|
|
1837
|
+
};
|
|
1838
|
+
}
|
|
1839
|
+
function getDomBlockers(_a) {
|
|
1840
|
+
var _b = _a === void 0 ? {} : _a, debug = _b.debug;
|
|
1841
|
+
return __awaiter(this, void 0, void 0, function() {
|
|
1842
|
+
var filters, filterNames, allSelectors, blockedSelectors, activeBlockers;
|
|
1843
|
+
var _c;
|
|
1844
|
+
return __generator(this, function(_d) {
|
|
1845
|
+
switch (_d.label) {
|
|
1846
|
+
case 0:
|
|
1847
|
+
if (!isApplicable()) {
|
|
1848
|
+
return [2, void 0];
|
|
1849
|
+
}
|
|
1850
|
+
filters = getFilters();
|
|
1851
|
+
filterNames = Object.keys(filters);
|
|
1852
|
+
allSelectors = (_c = []).concat.apply(_c, filterNames.map(function(filterName) {
|
|
1853
|
+
return filters[filterName];
|
|
1854
|
+
}));
|
|
1855
|
+
return [4, getBlockedSelectors(allSelectors)];
|
|
1856
|
+
case 1:
|
|
1857
|
+
blockedSelectors = _d.sent();
|
|
1858
|
+
if (debug) {
|
|
1859
|
+
printDebug(filters, blockedSelectors);
|
|
1860
|
+
}
|
|
1861
|
+
activeBlockers = filterNames.filter(function(filterName) {
|
|
1862
|
+
var selectors = filters[filterName];
|
|
1863
|
+
var blockedCount = countTruthy(selectors.map(function(selector) {
|
|
1864
|
+
return blockedSelectors[selector];
|
|
1865
|
+
}));
|
|
1866
|
+
return blockedCount > selectors.length * 0.6;
|
|
1867
|
+
});
|
|
1868
|
+
activeBlockers.sort();
|
|
1869
|
+
return [2, activeBlockers];
|
|
1870
|
+
}
|
|
1871
|
+
});
|
|
1872
|
+
});
|
|
1873
|
+
}
|
|
1874
|
+
function isApplicable() {
|
|
1875
|
+
return isWebKit() || isAndroid();
|
|
1876
|
+
}
|
|
1877
|
+
function getBlockedSelectors(selectors) {
|
|
1878
|
+
var _a;
|
|
1879
|
+
return __awaiter(this, void 0, void 0, function() {
|
|
1880
|
+
var d, root, elements, blockedSelectors, i, element, holder, i;
|
|
1881
|
+
return __generator(this, function(_b) {
|
|
1882
|
+
switch (_b.label) {
|
|
1883
|
+
case 0:
|
|
1884
|
+
d = document;
|
|
1885
|
+
root = d.createElement("div");
|
|
1886
|
+
elements = new Array(selectors.length);
|
|
1887
|
+
blockedSelectors = {};
|
|
1888
|
+
forceShow(root);
|
|
1889
|
+
for (i = 0; i < selectors.length; ++i) {
|
|
1890
|
+
element = selectorToElement(selectors[i]);
|
|
1891
|
+
if (element.tagName === "DIALOG") {
|
|
1892
|
+
element.show();
|
|
1893
|
+
}
|
|
1894
|
+
holder = d.createElement("div");
|
|
1895
|
+
forceShow(holder);
|
|
1896
|
+
holder.appendChild(element);
|
|
1897
|
+
root.appendChild(holder);
|
|
1898
|
+
elements[i] = element;
|
|
1899
|
+
}
|
|
1900
|
+
_b.label = 1;
|
|
1901
|
+
case 1:
|
|
1902
|
+
if (!!d.body) return [3, 3];
|
|
1903
|
+
return [4, wait(50)];
|
|
1904
|
+
case 2:
|
|
1905
|
+
_b.sent();
|
|
1906
|
+
return [3, 1];
|
|
1907
|
+
case 3:
|
|
1908
|
+
d.body.appendChild(root);
|
|
1909
|
+
try {
|
|
1910
|
+
for (i = 0; i < selectors.length; ++i) {
|
|
1911
|
+
if (!elements[i].offsetParent) {
|
|
1912
|
+
blockedSelectors[selectors[i]] = true;
|
|
1913
|
+
}
|
|
1914
|
+
}
|
|
1915
|
+
} finally {
|
|
1916
|
+
(_a = root.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(root);
|
|
1917
|
+
}
|
|
1918
|
+
return [2, blockedSelectors];
|
|
1919
|
+
}
|
|
1920
|
+
});
|
|
1921
|
+
});
|
|
1922
|
+
}
|
|
1923
|
+
function forceShow(element) {
|
|
1924
|
+
element.style.setProperty("visibility", "hidden", "important");
|
|
1925
|
+
element.style.setProperty("display", "block", "important");
|
|
1926
|
+
}
|
|
1927
|
+
function printDebug(filters, blockedSelectors) {
|
|
1928
|
+
var message = "DOM blockers debug:\n```";
|
|
1929
|
+
for (var _i = 0, _a = Object.keys(filters); _i < _a.length; _i++) {
|
|
1930
|
+
var filterName = _a[_i];
|
|
1931
|
+
message += "\n".concat(filterName, ":");
|
|
1932
|
+
for (var _b = 0, _c = filters[filterName]; _b < _c.length; _b++) {
|
|
1933
|
+
var selector = _c[_b];
|
|
1934
|
+
message += "\n ".concat(blockedSelectors[selector] ? "\u{1F6AB}" : "\u27A1\uFE0F", " ").concat(selector);
|
|
1935
|
+
}
|
|
1936
|
+
}
|
|
1937
|
+
console.log("".concat(message, "\n```"));
|
|
1938
|
+
}
|
|
1939
|
+
function getColorGamut() {
|
|
1940
|
+
for (var _i = 0, _a = ["rec2020", "p3", "srgb"]; _i < _a.length; _i++) {
|
|
1941
|
+
var gamut = _a[_i];
|
|
1942
|
+
if (matchMedia("(color-gamut: ".concat(gamut, ")")).matches) {
|
|
1943
|
+
return gamut;
|
|
1944
|
+
}
|
|
1945
|
+
}
|
|
1946
|
+
return void 0;
|
|
1947
|
+
}
|
|
1948
|
+
function areColorsInverted() {
|
|
1949
|
+
if (doesMatch$5("inverted")) {
|
|
1950
|
+
return true;
|
|
1951
|
+
}
|
|
1952
|
+
if (doesMatch$5("none")) {
|
|
1953
|
+
return false;
|
|
1954
|
+
}
|
|
1955
|
+
return void 0;
|
|
1956
|
+
}
|
|
1957
|
+
function doesMatch$5(value) {
|
|
1958
|
+
return matchMedia("(inverted-colors: ".concat(value, ")")).matches;
|
|
1959
|
+
}
|
|
1960
|
+
function areColorsForced() {
|
|
1961
|
+
if (doesMatch$4("active")) {
|
|
1962
|
+
return true;
|
|
1963
|
+
}
|
|
1964
|
+
if (doesMatch$4("none")) {
|
|
1965
|
+
return false;
|
|
1966
|
+
}
|
|
1967
|
+
return void 0;
|
|
1968
|
+
}
|
|
1969
|
+
function doesMatch$4(value) {
|
|
1970
|
+
return matchMedia("(forced-colors: ".concat(value, ")")).matches;
|
|
1971
|
+
}
|
|
1972
|
+
function getMonochromeDepth() {
|
|
1973
|
+
if (!matchMedia("(min-monochrome: 0)").matches) {
|
|
1974
|
+
return void 0;
|
|
1975
|
+
}
|
|
1976
|
+
for (var i = 0; i <= maxValueToCheck; ++i) {
|
|
1977
|
+
if (matchMedia("(max-monochrome: ".concat(i, ")")).matches) {
|
|
1978
|
+
return i;
|
|
1979
|
+
}
|
|
1980
|
+
}
|
|
1981
|
+
throw new Error("Too high value");
|
|
1982
|
+
}
|
|
1983
|
+
function getContrastPreference() {
|
|
1984
|
+
if (doesMatch$3("no-preference")) {
|
|
1985
|
+
return 0;
|
|
1986
|
+
}
|
|
1987
|
+
if (doesMatch$3("high") || doesMatch$3("more")) {
|
|
1988
|
+
return 1;
|
|
1989
|
+
}
|
|
1990
|
+
if (doesMatch$3("low") || doesMatch$3("less")) {
|
|
1991
|
+
return -1;
|
|
1992
|
+
}
|
|
1993
|
+
if (doesMatch$3("forced")) {
|
|
1994
|
+
return 10;
|
|
1995
|
+
}
|
|
1996
|
+
return void 0;
|
|
1997
|
+
}
|
|
1998
|
+
function doesMatch$3(value) {
|
|
1999
|
+
return matchMedia("(prefers-contrast: ".concat(value, ")")).matches;
|
|
2000
|
+
}
|
|
2001
|
+
function isMotionReduced() {
|
|
2002
|
+
if (doesMatch$2("reduce")) {
|
|
2003
|
+
return true;
|
|
2004
|
+
}
|
|
2005
|
+
if (doesMatch$2("no-preference")) {
|
|
2006
|
+
return false;
|
|
2007
|
+
}
|
|
2008
|
+
return void 0;
|
|
2009
|
+
}
|
|
2010
|
+
function doesMatch$2(value) {
|
|
2011
|
+
return matchMedia("(prefers-reduced-motion: ".concat(value, ")")).matches;
|
|
2012
|
+
}
|
|
2013
|
+
function isTransparencyReduced() {
|
|
2014
|
+
if (doesMatch$1("reduce")) {
|
|
2015
|
+
return true;
|
|
2016
|
+
}
|
|
2017
|
+
if (doesMatch$1("no-preference")) {
|
|
2018
|
+
return false;
|
|
2019
|
+
}
|
|
2020
|
+
return void 0;
|
|
2021
|
+
}
|
|
2022
|
+
function doesMatch$1(value) {
|
|
2023
|
+
return matchMedia("(prefers-reduced-transparency: ".concat(value, ")")).matches;
|
|
2024
|
+
}
|
|
2025
|
+
function isHDR() {
|
|
2026
|
+
if (doesMatch("high")) {
|
|
2027
|
+
return true;
|
|
2028
|
+
}
|
|
2029
|
+
if (doesMatch("standard")) {
|
|
2030
|
+
return false;
|
|
2031
|
+
}
|
|
2032
|
+
return void 0;
|
|
2033
|
+
}
|
|
2034
|
+
function doesMatch(value) {
|
|
2035
|
+
return matchMedia("(dynamic-range: ".concat(value, ")")).matches;
|
|
2036
|
+
}
|
|
2037
|
+
function getMathFingerprint() {
|
|
2038
|
+
var acos = M.acos || fallbackFn;
|
|
2039
|
+
var acosh = M.acosh || fallbackFn;
|
|
2040
|
+
var asin = M.asin || fallbackFn;
|
|
2041
|
+
var asinh = M.asinh || fallbackFn;
|
|
2042
|
+
var atanh = M.atanh || fallbackFn;
|
|
2043
|
+
var atan = M.atan || fallbackFn;
|
|
2044
|
+
var sin = M.sin || fallbackFn;
|
|
2045
|
+
var sinh = M.sinh || fallbackFn;
|
|
2046
|
+
var cos = M.cos || fallbackFn;
|
|
2047
|
+
var cosh = M.cosh || fallbackFn;
|
|
2048
|
+
var tan = M.tan || fallbackFn;
|
|
2049
|
+
var tanh = M.tanh || fallbackFn;
|
|
2050
|
+
var exp = M.exp || fallbackFn;
|
|
2051
|
+
var expm1 = M.expm1 || fallbackFn;
|
|
2052
|
+
var log1p = M.log1p || fallbackFn;
|
|
2053
|
+
var powPI = function(value) {
|
|
2054
|
+
return M.pow(M.PI, value);
|
|
2055
|
+
};
|
|
2056
|
+
var acoshPf = function(value) {
|
|
2057
|
+
return M.log(value + M.sqrt(value * value - 1));
|
|
2058
|
+
};
|
|
2059
|
+
var asinhPf = function(value) {
|
|
2060
|
+
return M.log(value + M.sqrt(value * value + 1));
|
|
2061
|
+
};
|
|
2062
|
+
var atanhPf = function(value) {
|
|
2063
|
+
return M.log((1 + value) / (1 - value)) / 2;
|
|
2064
|
+
};
|
|
2065
|
+
var sinhPf = function(value) {
|
|
2066
|
+
return M.exp(value) - 1 / M.exp(value) / 2;
|
|
2067
|
+
};
|
|
2068
|
+
var coshPf = function(value) {
|
|
2069
|
+
return (M.exp(value) + 1 / M.exp(value)) / 2;
|
|
2070
|
+
};
|
|
2071
|
+
var expm1Pf = function(value) {
|
|
2072
|
+
return M.exp(value) - 1;
|
|
2073
|
+
};
|
|
2074
|
+
var tanhPf = function(value) {
|
|
2075
|
+
return (M.exp(2 * value) - 1) / (M.exp(2 * value) + 1);
|
|
2076
|
+
};
|
|
2077
|
+
var log1pPf = function(value) {
|
|
2078
|
+
return M.log(1 + value);
|
|
2079
|
+
};
|
|
2080
|
+
return {
|
|
2081
|
+
acos: acos(0.12312423423423424),
|
|
2082
|
+
acosh: acosh(1e308),
|
|
2083
|
+
acoshPf: acoshPf(1e154),
|
|
2084
|
+
asin: asin(0.12312423423423424),
|
|
2085
|
+
asinh: asinh(1),
|
|
2086
|
+
asinhPf: asinhPf(1),
|
|
2087
|
+
atanh: atanh(0.5),
|
|
2088
|
+
atanhPf: atanhPf(0.5),
|
|
2089
|
+
atan: atan(0.5),
|
|
2090
|
+
sin: sin(-1e300),
|
|
2091
|
+
sinh: sinh(1),
|
|
2092
|
+
sinhPf: sinhPf(1),
|
|
2093
|
+
cos: cos(10.000000000123),
|
|
2094
|
+
cosh: cosh(1),
|
|
2095
|
+
coshPf: coshPf(1),
|
|
2096
|
+
tan: tan(-1e300),
|
|
2097
|
+
tanh: tanh(1),
|
|
2098
|
+
tanhPf: tanhPf(1),
|
|
2099
|
+
exp: exp(1),
|
|
2100
|
+
expm1: expm1(1),
|
|
2101
|
+
expm1Pf: expm1Pf(1),
|
|
2102
|
+
log1p: log1p(10),
|
|
2103
|
+
log1pPf: log1pPf(10),
|
|
2104
|
+
powPI: powPI(-100)
|
|
2105
|
+
};
|
|
2106
|
+
}
|
|
2107
|
+
function getFontPreferences() {
|
|
2108
|
+
return withNaturalFonts(function(document2, container) {
|
|
2109
|
+
var elements = {};
|
|
2110
|
+
var sizes = {};
|
|
2111
|
+
for (var _i = 0, _a = Object.keys(presets); _i < _a.length; _i++) {
|
|
2112
|
+
var key = _a[_i];
|
|
2113
|
+
var _b = presets[key], _c = _b[0], style = _c === void 0 ? {} : _c, _d = _b[1], text = _d === void 0 ? defaultText : _d;
|
|
2114
|
+
var element = document2.createElement("span");
|
|
2115
|
+
element.textContent = text;
|
|
2116
|
+
element.style.whiteSpace = "nowrap";
|
|
2117
|
+
for (var _e = 0, _f = Object.keys(style); _e < _f.length; _e++) {
|
|
2118
|
+
var name_1 = _f[_e];
|
|
2119
|
+
var value = style[name_1];
|
|
2120
|
+
if (value !== void 0) {
|
|
2121
|
+
element.style[name_1] = value;
|
|
2122
|
+
}
|
|
2123
|
+
}
|
|
2124
|
+
elements[key] = element;
|
|
2125
|
+
container.append(document2.createElement("br"), element);
|
|
2126
|
+
}
|
|
2127
|
+
for (var _g = 0, _h = Object.keys(presets); _g < _h.length; _g++) {
|
|
2128
|
+
var key = _h[_g];
|
|
2129
|
+
sizes[key] = elements[key].getBoundingClientRect().width;
|
|
2130
|
+
}
|
|
2131
|
+
return sizes;
|
|
2132
|
+
});
|
|
2133
|
+
}
|
|
2134
|
+
function withNaturalFonts(action, containerWidthPx) {
|
|
2135
|
+
if (containerWidthPx === void 0) {
|
|
2136
|
+
containerWidthPx = 4e3;
|
|
2137
|
+
}
|
|
2138
|
+
return withIframe(function(_, iframeWindow) {
|
|
2139
|
+
var iframeDocument = iframeWindow.document;
|
|
2140
|
+
var iframeBody = iframeDocument.body;
|
|
2141
|
+
var bodyStyle = iframeBody.style;
|
|
2142
|
+
bodyStyle.width = "".concat(containerWidthPx, "px");
|
|
2143
|
+
bodyStyle.webkitTextSizeAdjust = bodyStyle.textSizeAdjust = "none";
|
|
2144
|
+
if (isChromium()) {
|
|
2145
|
+
iframeBody.style.zoom = "".concat(1 / iframeWindow.devicePixelRatio);
|
|
2146
|
+
} else if (isWebKit()) {
|
|
2147
|
+
iframeBody.style.zoom = "reset";
|
|
2148
|
+
}
|
|
2149
|
+
var linesOfText = iframeDocument.createElement("div");
|
|
2150
|
+
linesOfText.textContent = __spreadArray([], Array(containerWidthPx / 20 << 0), true).map(function() {
|
|
2151
|
+
return "word";
|
|
2152
|
+
}).join(" ");
|
|
2153
|
+
iframeBody.appendChild(linesOfText);
|
|
2154
|
+
return action(iframeDocument, iframeBody);
|
|
2155
|
+
}, '<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">');
|
|
2156
|
+
}
|
|
2157
|
+
function isPdfViewerEnabled() {
|
|
2158
|
+
return navigator.pdfViewerEnabled;
|
|
2159
|
+
}
|
|
2160
|
+
function getArchitecture() {
|
|
2161
|
+
var f = new Float32Array(1);
|
|
2162
|
+
var u8 = new Uint8Array(f.buffer);
|
|
2163
|
+
f[0] = Infinity;
|
|
2164
|
+
f[0] = f[0] - f[0];
|
|
2165
|
+
return u8[3];
|
|
2166
|
+
}
|
|
2167
|
+
function getApplePayState() {
|
|
2168
|
+
var ApplePaySession = window.ApplePaySession;
|
|
2169
|
+
if (typeof (ApplePaySession === null || ApplePaySession === void 0 ? void 0 : ApplePaySession.canMakePayments) !== "function") {
|
|
2170
|
+
return -1;
|
|
2171
|
+
}
|
|
2172
|
+
if (willPrintConsoleError()) {
|
|
2173
|
+
return -3;
|
|
2174
|
+
}
|
|
2175
|
+
try {
|
|
2176
|
+
return ApplePaySession.canMakePayments() ? 1 : 0;
|
|
2177
|
+
} catch (error) {
|
|
2178
|
+
return getStateFromError(error);
|
|
2179
|
+
}
|
|
2180
|
+
}
|
|
2181
|
+
function getStateFromError(error) {
|
|
2182
|
+
if (error instanceof Error && error.name === "InvalidAccessError" && /\bfrom\b.*\binsecure\b/i.test(error.message)) {
|
|
2183
|
+
return -2;
|
|
2184
|
+
}
|
|
2185
|
+
throw error;
|
|
2186
|
+
}
|
|
2187
|
+
function getPrivateClickMeasurement() {
|
|
2188
|
+
var _a;
|
|
2189
|
+
var link = document.createElement("a");
|
|
2190
|
+
var sourceId = (_a = link.attributionSourceId) !== null && _a !== void 0 ? _a : link.attributionsourceid;
|
|
2191
|
+
return sourceId === void 0 ? void 0 : String(sourceId);
|
|
2192
|
+
}
|
|
2193
|
+
function getWebGlBasics(_a) {
|
|
2194
|
+
var _b, _c, _d, _e, _f, _g;
|
|
2195
|
+
var cache2 = _a.cache;
|
|
2196
|
+
var gl = getWebGLContext(cache2);
|
|
2197
|
+
if (!gl) {
|
|
2198
|
+
return STATUS_NO_GL_CONTEXT;
|
|
2199
|
+
}
|
|
2200
|
+
if (!isValidParameterGetter(gl)) {
|
|
2201
|
+
return STATUS_GET_PARAMETER_NOT_A_FUNCTION;
|
|
2202
|
+
}
|
|
2203
|
+
var debugExtension = shouldAvoidDebugRendererInfo() ? null : gl.getExtension(rendererInfoExtensionName);
|
|
2204
|
+
return {
|
|
2205
|
+
version: ((_b = gl.getParameter(gl.VERSION)) === null || _b === void 0 ? void 0 : _b.toString()) || "",
|
|
2206
|
+
vendor: ((_c = gl.getParameter(gl.VENDOR)) === null || _c === void 0 ? void 0 : _c.toString()) || "",
|
|
2207
|
+
vendorUnmasked: debugExtension ? (_d = gl.getParameter(debugExtension.UNMASKED_VENDOR_WEBGL)) === null || _d === void 0 ? void 0 : _d.toString() : "",
|
|
2208
|
+
renderer: ((_e = gl.getParameter(gl.RENDERER)) === null || _e === void 0 ? void 0 : _e.toString()) || "",
|
|
2209
|
+
rendererUnmasked: debugExtension ? (_f = gl.getParameter(debugExtension.UNMASKED_RENDERER_WEBGL)) === null || _f === void 0 ? void 0 : _f.toString() : "",
|
|
2210
|
+
shadingLanguageVersion: ((_g = gl.getParameter(gl.SHADING_LANGUAGE_VERSION)) === null || _g === void 0 ? void 0 : _g.toString()) || ""
|
|
2211
|
+
};
|
|
2212
|
+
}
|
|
2213
|
+
function getWebGlExtensions(_a) {
|
|
2214
|
+
var cache2 = _a.cache;
|
|
2215
|
+
var gl = getWebGLContext(cache2);
|
|
2216
|
+
if (!gl) {
|
|
2217
|
+
return STATUS_NO_GL_CONTEXT;
|
|
2218
|
+
}
|
|
2219
|
+
if (!isValidParameterGetter(gl)) {
|
|
2220
|
+
return STATUS_GET_PARAMETER_NOT_A_FUNCTION;
|
|
2221
|
+
}
|
|
2222
|
+
var extensions = gl.getSupportedExtensions();
|
|
2223
|
+
var contextAttributes = gl.getContextAttributes();
|
|
2224
|
+
var unsupportedExtensions = [];
|
|
2225
|
+
var attributes = [];
|
|
2226
|
+
var parameters = [];
|
|
2227
|
+
var extensionParameters = [];
|
|
2228
|
+
var shaderPrecisions = [];
|
|
2229
|
+
if (contextAttributes) {
|
|
2230
|
+
for (var _i = 0, _b = Object.keys(contextAttributes); _i < _b.length; _i++) {
|
|
2231
|
+
var attributeName = _b[_i];
|
|
2232
|
+
attributes.push("".concat(attributeName, "=").concat(contextAttributes[attributeName]));
|
|
2233
|
+
}
|
|
2234
|
+
}
|
|
2235
|
+
var constants = getConstantsFromPrototype(gl);
|
|
2236
|
+
for (var _c = 0, constants_1 = constants; _c < constants_1.length; _c++) {
|
|
2237
|
+
var constant = constants_1[_c];
|
|
2238
|
+
var code = gl[constant];
|
|
2239
|
+
parameters.push("".concat(constant, "=").concat(code).concat(validContextParameters.has(code) ? "=".concat(gl.getParameter(code)) : ""));
|
|
2240
|
+
}
|
|
2241
|
+
if (extensions) {
|
|
2242
|
+
for (var _d = 0, extensions_1 = extensions; _d < extensions_1.length; _d++) {
|
|
2243
|
+
var name_1 = extensions_1[_d];
|
|
2244
|
+
if (name_1 === rendererInfoExtensionName && shouldAvoidDebugRendererInfo() || name_1 === polygonModeExtensionName && shouldAvoidPolygonModeExtensions()) {
|
|
2245
|
+
continue;
|
|
2246
|
+
}
|
|
2247
|
+
var extension = gl.getExtension(name_1);
|
|
2248
|
+
if (!extension) {
|
|
2249
|
+
unsupportedExtensions.push(name_1);
|
|
2250
|
+
continue;
|
|
2251
|
+
}
|
|
2252
|
+
for (var _e = 0, _f = getConstantsFromPrototype(extension); _e < _f.length; _e++) {
|
|
2253
|
+
var constant = _f[_e];
|
|
2254
|
+
var code = extension[constant];
|
|
2255
|
+
extensionParameters.push("".concat(constant, "=").concat(code).concat(validExtensionParams.has(code) ? "=".concat(gl.getParameter(code)) : ""));
|
|
2256
|
+
}
|
|
2257
|
+
}
|
|
2258
|
+
}
|
|
2259
|
+
for (var _g = 0, shaderTypes_1 = shaderTypes; _g < shaderTypes_1.length; _g++) {
|
|
2260
|
+
var shaderType = shaderTypes_1[_g];
|
|
2261
|
+
for (var _h = 0, precisionTypes_1 = precisionTypes; _h < precisionTypes_1.length; _h++) {
|
|
2262
|
+
var precisionType = precisionTypes_1[_h];
|
|
2263
|
+
var shaderPrecision = getShaderPrecision(gl, shaderType, precisionType);
|
|
2264
|
+
shaderPrecisions.push("".concat(shaderType, ".").concat(precisionType, "=").concat(shaderPrecision.join(",")));
|
|
2265
|
+
}
|
|
2266
|
+
}
|
|
2267
|
+
extensionParameters.sort();
|
|
2268
|
+
parameters.sort();
|
|
2269
|
+
return {
|
|
2270
|
+
contextAttributes: attributes,
|
|
2271
|
+
parameters,
|
|
2272
|
+
shaderPrecisions,
|
|
2273
|
+
extensions,
|
|
2274
|
+
extensionParameters,
|
|
2275
|
+
unsupportedExtensions
|
|
2276
|
+
};
|
|
2277
|
+
}
|
|
2278
|
+
function getWebGLContext(cache2) {
|
|
2279
|
+
if (cache2.webgl) {
|
|
2280
|
+
return cache2.webgl.context;
|
|
2281
|
+
}
|
|
2282
|
+
var canvas = document.createElement("canvas");
|
|
2283
|
+
var context;
|
|
2284
|
+
canvas.addEventListener("webglCreateContextError", function() {
|
|
2285
|
+
return context = void 0;
|
|
2286
|
+
});
|
|
2287
|
+
for (var _i = 0, _a = ["webgl", "experimental-webgl"]; _i < _a.length; _i++) {
|
|
2288
|
+
var type = _a[_i];
|
|
2289
|
+
try {
|
|
2290
|
+
context = canvas.getContext(type);
|
|
2291
|
+
} catch (_b) {
|
|
2292
|
+
}
|
|
2293
|
+
if (context) {
|
|
2294
|
+
break;
|
|
2295
|
+
}
|
|
2296
|
+
}
|
|
2297
|
+
cache2.webgl = { context };
|
|
2298
|
+
return context;
|
|
2299
|
+
}
|
|
2300
|
+
function getShaderPrecision(gl, shaderType, precisionType) {
|
|
2301
|
+
var shaderPrecision = gl.getShaderPrecisionFormat(gl[shaderType], gl[precisionType]);
|
|
2302
|
+
return shaderPrecision ? [shaderPrecision.rangeMin, shaderPrecision.rangeMax, shaderPrecision.precision] : [];
|
|
2303
|
+
}
|
|
2304
|
+
function getConstantsFromPrototype(obj) {
|
|
2305
|
+
var keys = Object.keys(obj.__proto__);
|
|
2306
|
+
return keys.filter(isConstantLike);
|
|
2307
|
+
}
|
|
2308
|
+
function isConstantLike(key) {
|
|
2309
|
+
return typeof key === "string" && !key.match(/[^A-Z0-9_x]/);
|
|
2310
|
+
}
|
|
2311
|
+
function shouldAvoidDebugRendererInfo() {
|
|
2312
|
+
return isGecko();
|
|
2313
|
+
}
|
|
2314
|
+
function shouldAvoidPolygonModeExtensions() {
|
|
2315
|
+
return isChromium() || isWebKit();
|
|
2316
|
+
}
|
|
2317
|
+
function isValidParameterGetter(gl) {
|
|
2318
|
+
return typeof gl.getParameter === "function";
|
|
2319
|
+
}
|
|
2320
|
+
function getAudioContextBaseLatency() {
|
|
2321
|
+
var isAllowedPlatform = isAndroid() || isWebKit();
|
|
2322
|
+
if (!isAllowedPlatform) {
|
|
2323
|
+
return -2;
|
|
2324
|
+
}
|
|
2325
|
+
if (!window.AudioContext) {
|
|
2326
|
+
return -1;
|
|
2327
|
+
}
|
|
2328
|
+
var latency = new AudioContext().baseLatency;
|
|
2329
|
+
if (latency === null || latency === void 0) {
|
|
2330
|
+
return -1;
|
|
2331
|
+
}
|
|
2332
|
+
if (!isFinite(latency)) {
|
|
2333
|
+
return -3;
|
|
2334
|
+
}
|
|
2335
|
+
return latency;
|
|
2336
|
+
}
|
|
2337
|
+
function getDateTimeLocale() {
|
|
2338
|
+
if (!window.Intl) {
|
|
2339
|
+
return -1;
|
|
2340
|
+
}
|
|
2341
|
+
var DateTimeFormat = window.Intl.DateTimeFormat;
|
|
2342
|
+
if (!DateTimeFormat) {
|
|
2343
|
+
return -2;
|
|
2344
|
+
}
|
|
2345
|
+
var locale = DateTimeFormat().resolvedOptions().locale;
|
|
2346
|
+
if (!locale && locale !== "") {
|
|
2347
|
+
return -3;
|
|
2348
|
+
}
|
|
2349
|
+
return locale;
|
|
2350
|
+
}
|
|
2351
|
+
function loadBuiltinSources(options) {
|
|
2352
|
+
return loadSources(sources, options, []);
|
|
2353
|
+
}
|
|
2354
|
+
function getConfidence(components) {
|
|
2355
|
+
var openConfidenceScore = getOpenConfidenceScore(components);
|
|
2356
|
+
var proConfidenceScore = deriveProConfidenceScore(openConfidenceScore);
|
|
2357
|
+
return { score: openConfidenceScore, comment: commentTemplate.replace(/\$/g, "".concat(proConfidenceScore)) };
|
|
2358
|
+
}
|
|
2359
|
+
function getOpenConfidenceScore(components) {
|
|
2360
|
+
if (isAndroid()) {
|
|
2361
|
+
return 0.4;
|
|
2362
|
+
}
|
|
2363
|
+
if (isWebKit()) {
|
|
2364
|
+
return isDesktopWebKit() && !(isWebKit616OrNewer() && isSafariWebKit()) ? 0.5 : 0.3;
|
|
2365
|
+
}
|
|
2366
|
+
var platform = "value" in components.platform ? components.platform.value : "";
|
|
2367
|
+
if (/^Win/.test(platform)) {
|
|
2368
|
+
return 0.6;
|
|
2369
|
+
}
|
|
2370
|
+
if (/^Mac/.test(platform)) {
|
|
2371
|
+
return 0.5;
|
|
2372
|
+
}
|
|
2373
|
+
return 0.7;
|
|
2374
|
+
}
|
|
2375
|
+
function deriveProConfidenceScore(openConfidenceScore) {
|
|
2376
|
+
return round(0.99 + 0.01 * openConfidenceScore, 1e-4);
|
|
2377
|
+
}
|
|
2378
|
+
function componentsToCanonicalString(components) {
|
|
2379
|
+
var result = "";
|
|
2380
|
+
for (var _i = 0, _a = Object.keys(components).sort(); _i < _a.length; _i++) {
|
|
2381
|
+
var componentKey = _a[_i];
|
|
2382
|
+
var component = components[componentKey];
|
|
2383
|
+
var value = "error" in component ? "error" : JSON.stringify(component.value);
|
|
2384
|
+
result += "".concat(result ? "|" : "").concat(componentKey.replace(/([:|\\])/g, "\\$1"), ":").concat(value);
|
|
2385
|
+
}
|
|
2386
|
+
return result;
|
|
2387
|
+
}
|
|
2388
|
+
function componentsToDebugString(components) {
|
|
2389
|
+
return JSON.stringify(components, function(_key, value) {
|
|
2390
|
+
if (value instanceof Error) {
|
|
2391
|
+
return errorToObject(value);
|
|
2392
|
+
}
|
|
2393
|
+
return value;
|
|
2394
|
+
}, 2);
|
|
2395
|
+
}
|
|
2396
|
+
function hashComponents(components) {
|
|
2397
|
+
return x64hash128(componentsToCanonicalString(components));
|
|
2398
|
+
}
|
|
2399
|
+
function makeLazyGetResult(components) {
|
|
2400
|
+
var visitorIdCache;
|
|
2401
|
+
var confidence = getConfidence(components);
|
|
2402
|
+
return {
|
|
2403
|
+
get visitorId() {
|
|
2404
|
+
if (visitorIdCache === void 0) {
|
|
2405
|
+
visitorIdCache = hashComponents(this.components);
|
|
2406
|
+
}
|
|
2407
|
+
return visitorIdCache;
|
|
2408
|
+
},
|
|
2409
|
+
set visitorId(visitorId) {
|
|
2410
|
+
visitorIdCache = visitorId;
|
|
2411
|
+
},
|
|
2412
|
+
confidence,
|
|
2413
|
+
components,
|
|
2414
|
+
version
|
|
2415
|
+
};
|
|
2416
|
+
}
|
|
2417
|
+
function prepareForSources(delayFallback) {
|
|
2418
|
+
if (delayFallback === void 0) {
|
|
2419
|
+
delayFallback = 50;
|
|
2420
|
+
}
|
|
2421
|
+
return requestIdleCallbackIfAvailable(delayFallback, delayFallback * 2);
|
|
2422
|
+
}
|
|
2423
|
+
function makeAgent(getComponents, debug) {
|
|
2424
|
+
var creationTime = Date.now();
|
|
2425
|
+
return {
|
|
2426
|
+
get: function(options) {
|
|
2427
|
+
return __awaiter(this, void 0, void 0, function() {
|
|
2428
|
+
var startTime, components, result;
|
|
2429
|
+
return __generator(this, function(_a) {
|
|
2430
|
+
switch (_a.label) {
|
|
2431
|
+
case 0:
|
|
2432
|
+
startTime = Date.now();
|
|
2433
|
+
return [4, getComponents()];
|
|
2434
|
+
case 1:
|
|
2435
|
+
components = _a.sent();
|
|
2436
|
+
result = makeLazyGetResult(components);
|
|
2437
|
+
if (debug || (options === null || options === void 0 ? void 0 : options.debug)) {
|
|
2438
|
+
console.log("Copy the text below to get the debug data:\n\n```\nversion: ".concat(result.version, "\nuserAgent: ").concat(navigator.userAgent, "\ntimeBetweenLoadAndGet: ").concat(startTime - creationTime, "\nvisitorId: ").concat(result.visitorId, "\ncomponents: ").concat(componentsToDebugString(components), "\n```"));
|
|
2439
|
+
}
|
|
2440
|
+
return [2, result];
|
|
2441
|
+
}
|
|
2442
|
+
});
|
|
2443
|
+
});
|
|
2444
|
+
}
|
|
2445
|
+
};
|
|
2446
|
+
}
|
|
2447
|
+
function monitor() {
|
|
2448
|
+
if (window.__fpjs_d_m || Math.random() >= 1e-3) {
|
|
2449
|
+
return;
|
|
2450
|
+
}
|
|
2451
|
+
try {
|
|
2452
|
+
var request = new XMLHttpRequest();
|
|
2453
|
+
request.open("get", "https://m1.openfpcdn.io/fingerprintjs/v".concat(version, "/npm-monitoring"), true);
|
|
2454
|
+
request.send();
|
|
2455
|
+
} catch (error) {
|
|
2456
|
+
console.error(error);
|
|
2457
|
+
}
|
|
2458
|
+
}
|
|
2459
|
+
function load(options) {
|
|
2460
|
+
var _a;
|
|
2461
|
+
if (options === void 0) {
|
|
2462
|
+
options = {};
|
|
2463
|
+
}
|
|
2464
|
+
return __awaiter(this, void 0, void 0, function() {
|
|
2465
|
+
var delayFallback, debug, getComponents;
|
|
2466
|
+
return __generator(this, function(_b) {
|
|
2467
|
+
switch (_b.label) {
|
|
2468
|
+
case 0:
|
|
2469
|
+
if ((_a = options.monitoring) !== null && _a !== void 0 ? _a : true) {
|
|
2470
|
+
monitor();
|
|
2471
|
+
}
|
|
2472
|
+
delayFallback = options.delayFallback, debug = options.debug;
|
|
2473
|
+
return [4, prepareForSources(delayFallback)];
|
|
2474
|
+
case 1:
|
|
2475
|
+
_b.sent();
|
|
2476
|
+
getComponents = loadBuiltinSources({ cache: {}, debug });
|
|
2477
|
+
return [2, makeAgent(getComponents, debug)];
|
|
2478
|
+
}
|
|
2479
|
+
});
|
|
2480
|
+
});
|
|
2481
|
+
}
|
|
2482
|
+
var version, F1, F2, C1, C2, M$1, N1, N2, testString, textSize, baseFonts, fontList, screenFrameCheckInterval, roundingPrecision, screenFrameBackup, screenFrameSizeTimeoutId, maxValueToCheck, M, fallbackFn, defaultText, presets, willPrintConsoleError, STATUS_NO_GL_CONTEXT, STATUS_GET_PARAMETER_NOT_A_FUNCTION, validContextParameters, validExtensionParams, shaderTypes, precisionTypes, rendererInfoExtensionName, polygonModeExtensionName, sources, commentTemplate, index, murmurX64Hash128;
|
|
2483
|
+
var init_fp_esm = __esm({
|
|
2484
|
+
"node_modules/@fingerprintjs/fingerprintjs/dist/fp.esm.js"() {
|
|
2485
|
+
"use strict";
|
|
2486
|
+
init_tslib_es6();
|
|
2487
|
+
version = "4.6.2";
|
|
2488
|
+
F1 = [4283543511, 3981806797];
|
|
2489
|
+
F2 = [3301882366, 444984403];
|
|
2490
|
+
C1 = [2277735313, 289559509];
|
|
2491
|
+
C2 = [1291169091, 658871167];
|
|
2492
|
+
M$1 = [0, 5];
|
|
2493
|
+
N1 = [0, 1390208809];
|
|
2494
|
+
N2 = [0, 944331445];
|
|
2495
|
+
testString = "mmMwWLliI0O&1";
|
|
2496
|
+
textSize = "48px";
|
|
2497
|
+
baseFonts = ["monospace", "sans-serif", "serif"];
|
|
2498
|
+
fontList = [
|
|
2499
|
+
// This is android-specific font from "Roboto" family
|
|
2500
|
+
"sans-serif-thin",
|
|
2501
|
+
"ARNO PRO",
|
|
2502
|
+
"Agency FB",
|
|
2503
|
+
"Arabic Typesetting",
|
|
2504
|
+
"Arial Unicode MS",
|
|
2505
|
+
"AvantGarde Bk BT",
|
|
2506
|
+
"BankGothic Md BT",
|
|
2507
|
+
"Batang",
|
|
2508
|
+
"Bitstream Vera Sans Mono",
|
|
2509
|
+
"Calibri",
|
|
2510
|
+
"Century",
|
|
2511
|
+
"Century Gothic",
|
|
2512
|
+
"Clarendon",
|
|
2513
|
+
"EUROSTILE",
|
|
2514
|
+
"Franklin Gothic",
|
|
2515
|
+
"Futura Bk BT",
|
|
2516
|
+
"Futura Md BT",
|
|
2517
|
+
"GOTHAM",
|
|
2518
|
+
"Gill Sans",
|
|
2519
|
+
"HELV",
|
|
2520
|
+
"Haettenschweiler",
|
|
2521
|
+
"Helvetica Neue",
|
|
2522
|
+
"Humanst521 BT",
|
|
2523
|
+
"Leelawadee",
|
|
2524
|
+
"Letter Gothic",
|
|
2525
|
+
"Levenim MT",
|
|
2526
|
+
"Lucida Bright",
|
|
2527
|
+
"Lucida Sans",
|
|
2528
|
+
"Menlo",
|
|
2529
|
+
"MS Mincho",
|
|
2530
|
+
"MS Outlook",
|
|
2531
|
+
"MS Reference Specialty",
|
|
2532
|
+
"MS UI Gothic",
|
|
2533
|
+
"MT Extra",
|
|
2534
|
+
"MYRIAD PRO",
|
|
2535
|
+
"Marlett",
|
|
2536
|
+
"Meiryo UI",
|
|
2537
|
+
"Microsoft Uighur",
|
|
2538
|
+
"Minion Pro",
|
|
2539
|
+
"Monotype Corsiva",
|
|
2540
|
+
"PMingLiU",
|
|
2541
|
+
"Pristina",
|
|
2542
|
+
"SCRIPTINA",
|
|
2543
|
+
"Segoe UI Light",
|
|
2544
|
+
"Serifa",
|
|
2545
|
+
"SimHei",
|
|
2546
|
+
"Small Fonts",
|
|
2547
|
+
"Staccato222 BT",
|
|
2548
|
+
"TRAJAN PRO",
|
|
2549
|
+
"Univers CE 55 Medium",
|
|
2550
|
+
"Vrinda",
|
|
2551
|
+
"ZWAdobeF"
|
|
2552
|
+
];
|
|
2553
|
+
screenFrameCheckInterval = 2500;
|
|
2554
|
+
roundingPrecision = 10;
|
|
2555
|
+
maxValueToCheck = 100;
|
|
2556
|
+
M = Math;
|
|
2557
|
+
fallbackFn = function() {
|
|
2558
|
+
return 0;
|
|
2559
|
+
};
|
|
2560
|
+
defaultText = "mmMwWLliI0fiflO&1";
|
|
2561
|
+
presets = {
|
|
2562
|
+
/**
|
|
2563
|
+
* The default font. User can change it in desktop Chrome, desktop Firefox, IE 11,
|
|
2564
|
+
* Android Chrome (but only when the size is ≥ than the default) and Android Firefox.
|
|
2565
|
+
*/
|
|
2566
|
+
default: [],
|
|
2567
|
+
/** OS font on macOS. User can change its size and weight. Applies after Safari restart. */
|
|
2568
|
+
apple: [{ font: "-apple-system-body" }],
|
|
2569
|
+
/** User can change it in desktop Chrome and desktop Firefox. */
|
|
2570
|
+
serif: [{ fontFamily: "serif" }],
|
|
2571
|
+
/** User can change it in desktop Chrome and desktop Firefox. */
|
|
2572
|
+
sans: [{ fontFamily: "sans-serif" }],
|
|
2573
|
+
/** User can change it in desktop Chrome and desktop Firefox. */
|
|
2574
|
+
mono: [{ fontFamily: "monospace" }],
|
|
2575
|
+
/**
|
|
2576
|
+
* Check the smallest allowed font size. User can change it in desktop Chrome, desktop Firefox and desktop Safari.
|
|
2577
|
+
* The height can be 0 in Chrome on a retina display.
|
|
2578
|
+
*/
|
|
2579
|
+
min: [{ fontSize: "1px" }],
|
|
2580
|
+
/** Tells one OS from another in desktop Chrome. */
|
|
2581
|
+
system: [{ fontFamily: "system-ui" }]
|
|
2582
|
+
};
|
|
2583
|
+
willPrintConsoleError = isAnyParentCrossOrigin;
|
|
2584
|
+
STATUS_NO_GL_CONTEXT = -1;
|
|
2585
|
+
STATUS_GET_PARAMETER_NOT_A_FUNCTION = -2;
|
|
2586
|
+
validContextParameters = /* @__PURE__ */ new Set([
|
|
2587
|
+
10752,
|
|
2588
|
+
2849,
|
|
2589
|
+
2884,
|
|
2590
|
+
2885,
|
|
2591
|
+
2886,
|
|
2592
|
+
2928,
|
|
2593
|
+
2929,
|
|
2594
|
+
2930,
|
|
2595
|
+
2931,
|
|
2596
|
+
2932,
|
|
2597
|
+
2960,
|
|
2598
|
+
2961,
|
|
2599
|
+
2962,
|
|
2600
|
+
2963,
|
|
2601
|
+
2964,
|
|
2602
|
+
2965,
|
|
2603
|
+
2966,
|
|
2604
|
+
2967,
|
|
2605
|
+
2968,
|
|
2606
|
+
2978,
|
|
2607
|
+
3024,
|
|
2608
|
+
3042,
|
|
2609
|
+
3088,
|
|
2610
|
+
3089,
|
|
2611
|
+
3106,
|
|
2612
|
+
3107,
|
|
2613
|
+
32773,
|
|
2614
|
+
32777,
|
|
2615
|
+
32777,
|
|
2616
|
+
32823,
|
|
2617
|
+
32824,
|
|
2618
|
+
32936,
|
|
2619
|
+
32937,
|
|
2620
|
+
32938,
|
|
2621
|
+
32939,
|
|
2622
|
+
32968,
|
|
2623
|
+
32969,
|
|
2624
|
+
32970,
|
|
2625
|
+
32971,
|
|
2626
|
+
3317,
|
|
2627
|
+
33170,
|
|
2628
|
+
3333,
|
|
2629
|
+
3379,
|
|
2630
|
+
3386,
|
|
2631
|
+
33901,
|
|
2632
|
+
33902,
|
|
2633
|
+
34016,
|
|
2634
|
+
34024,
|
|
2635
|
+
34076,
|
|
2636
|
+
3408,
|
|
2637
|
+
3410,
|
|
2638
|
+
3411,
|
|
2639
|
+
3412,
|
|
2640
|
+
3413,
|
|
2641
|
+
3414,
|
|
2642
|
+
3415,
|
|
2643
|
+
34467,
|
|
2644
|
+
34816,
|
|
2645
|
+
34817,
|
|
2646
|
+
34818,
|
|
2647
|
+
34819,
|
|
2648
|
+
34877,
|
|
2649
|
+
34921,
|
|
2650
|
+
34930,
|
|
2651
|
+
35660,
|
|
2652
|
+
35661,
|
|
2653
|
+
35724,
|
|
2654
|
+
35738,
|
|
2655
|
+
35739,
|
|
2656
|
+
36003,
|
|
2657
|
+
36004,
|
|
2658
|
+
36005,
|
|
2659
|
+
36347,
|
|
2660
|
+
36348,
|
|
2661
|
+
36349,
|
|
2662
|
+
37440,
|
|
2663
|
+
37441,
|
|
2664
|
+
37443,
|
|
2665
|
+
7936,
|
|
2666
|
+
7937,
|
|
2667
|
+
7938
|
|
2668
|
+
// SAMPLE_ALPHA_TO_COVERAGE (32926) and SAMPLE_COVERAGE (32928) are excluded because they trigger a console warning
|
|
2669
|
+
// in IE, Chrome ≤ 59 and Safari ≤ 13 and give no entropy.
|
|
2670
|
+
]);
|
|
2671
|
+
validExtensionParams = /* @__PURE__ */ new Set([
|
|
2672
|
+
34047,
|
|
2673
|
+
35723,
|
|
2674
|
+
36063,
|
|
2675
|
+
34852,
|
|
2676
|
+
34853,
|
|
2677
|
+
34854,
|
|
2678
|
+
34229,
|
|
2679
|
+
36392,
|
|
2680
|
+
36795,
|
|
2681
|
+
38449
|
|
2682
|
+
// MAX_VIEWS_OVR
|
|
2683
|
+
]);
|
|
2684
|
+
shaderTypes = ["FRAGMENT_SHADER", "VERTEX_SHADER"];
|
|
2685
|
+
precisionTypes = ["LOW_FLOAT", "MEDIUM_FLOAT", "HIGH_FLOAT", "LOW_INT", "MEDIUM_INT", "HIGH_INT"];
|
|
2686
|
+
rendererInfoExtensionName = "WEBGL_debug_renderer_info";
|
|
2687
|
+
polygonModeExtensionName = "WEBGL_polygon_mode";
|
|
2688
|
+
sources = {
|
|
2689
|
+
// READ FIRST:
|
|
2690
|
+
// See https://github.com/fingerprintjs/fingerprintjs/blob/master/contributing.md#how-to-add-an-entropy-source
|
|
2691
|
+
// to learn how entropy source works and how to make your own.
|
|
2692
|
+
// The sources run in this exact order.
|
|
2693
|
+
// The asynchronous sources are at the start to run in parallel with other sources.
|
|
2694
|
+
fonts: getFonts,
|
|
2695
|
+
domBlockers: getDomBlockers,
|
|
2696
|
+
fontPreferences: getFontPreferences,
|
|
2697
|
+
audio: getAudioFingerprint,
|
|
2698
|
+
screenFrame: getScreenFrame,
|
|
2699
|
+
canvas: getCanvasFingerprint,
|
|
2700
|
+
osCpu: getOsCpu,
|
|
2701
|
+
languages: getLanguages,
|
|
2702
|
+
colorDepth: getColorDepth,
|
|
2703
|
+
deviceMemory: getDeviceMemory,
|
|
2704
|
+
screenResolution: getScreenResolution,
|
|
2705
|
+
hardwareConcurrency: getHardwareConcurrency,
|
|
2706
|
+
timezone: getTimezone,
|
|
2707
|
+
sessionStorage: getSessionStorage,
|
|
2708
|
+
localStorage: getLocalStorage,
|
|
2709
|
+
indexedDB: getIndexedDB,
|
|
2710
|
+
openDatabase: getOpenDatabase,
|
|
2711
|
+
cpuClass: getCpuClass,
|
|
2712
|
+
platform: getPlatform,
|
|
2713
|
+
plugins: getPlugins,
|
|
2714
|
+
touchSupport: getTouchSupport,
|
|
2715
|
+
vendor: getVendor,
|
|
2716
|
+
vendorFlavors: getVendorFlavors,
|
|
2717
|
+
cookiesEnabled: areCookiesEnabled,
|
|
2718
|
+
colorGamut: getColorGamut,
|
|
2719
|
+
invertedColors: areColorsInverted,
|
|
2720
|
+
forcedColors: areColorsForced,
|
|
2721
|
+
monochrome: getMonochromeDepth,
|
|
2722
|
+
contrast: getContrastPreference,
|
|
2723
|
+
reducedMotion: isMotionReduced,
|
|
2724
|
+
reducedTransparency: isTransparencyReduced,
|
|
2725
|
+
hdr: isHDR,
|
|
2726
|
+
math: getMathFingerprint,
|
|
2727
|
+
pdfViewerEnabled: isPdfViewerEnabled,
|
|
2728
|
+
architecture: getArchitecture,
|
|
2729
|
+
applePay: getApplePayState,
|
|
2730
|
+
privateClickMeasurement: getPrivateClickMeasurement,
|
|
2731
|
+
audioBaseLatency: getAudioContextBaseLatency,
|
|
2732
|
+
dateTimeLocale: getDateTimeLocale,
|
|
2733
|
+
// Some sources can affect other sources (e.g. WebGL can affect canvas), so it's important to run these sources
|
|
2734
|
+
// after other sources.
|
|
2735
|
+
webGlBasics: getWebGlBasics,
|
|
2736
|
+
webGlExtensions: getWebGlExtensions
|
|
2737
|
+
};
|
|
2738
|
+
commentTemplate = "$ if upgrade to Pro: https://fpjs.dev/pro";
|
|
2739
|
+
index = { load, hashComponents, componentsToDebugString };
|
|
2740
|
+
murmurX64Hash128 = x64hash128;
|
|
2741
|
+
}
|
|
2742
|
+
});
|
|
2743
|
+
|
|
2744
|
+
// src/index.ts
|
|
2745
|
+
var index_exports = {};
|
|
2746
|
+
__export(index_exports, {
|
|
2747
|
+
auth: () => auth,
|
|
2748
|
+
clearHeaders: () => clearHeaders,
|
|
2749
|
+
getBrowserDeviceInfo: () => getBrowserDeviceInfo,
|
|
2750
|
+
getClient: () => getClient,
|
|
2751
|
+
getDeviceInfo: () => getDeviceInfo,
|
|
2752
|
+
gql: () => gql,
|
|
2753
|
+
initGraphQLClient: () => initGraphQLClient,
|
|
2754
|
+
mutation: () => mutation,
|
|
2755
|
+
query: () => query,
|
|
2756
|
+
removeHeader: () => removeHeader,
|
|
2757
|
+
removeToken: () => removeToken,
|
|
2758
|
+
setEndpoint: () => setEndpoint,
|
|
2759
|
+
setHeader: () => setHeader,
|
|
2760
|
+
setHeaders: () => setHeaders,
|
|
2761
|
+
setToken: () => setToken,
|
|
2762
|
+
sms: () => sms,
|
|
2763
|
+
useInterceptor: () => useInterceptor
|
|
2764
|
+
});
|
|
2765
|
+
module.exports = __toCommonJS(index_exports);
|
|
2766
|
+
|
|
2767
|
+
// src/core/core.ts
|
|
2768
|
+
var import_graphql_request = require("graphql-request");
|
|
2769
|
+
|
|
2770
|
+
// node_modules/graphql/jsutils/devAssert.mjs
|
|
2771
|
+
function devAssert(condition, message) {
|
|
2772
|
+
const booleanCondition = Boolean(condition);
|
|
2773
|
+
if (!booleanCondition) {
|
|
2774
|
+
throw new Error(message);
|
|
2775
|
+
}
|
|
2776
|
+
}
|
|
2777
|
+
|
|
2778
|
+
// node_modules/graphql/language/ast.mjs
|
|
2779
|
+
var QueryDocumentKeys = {
|
|
2780
|
+
Name: [],
|
|
2781
|
+
Document: ["definitions"],
|
|
2782
|
+
OperationDefinition: [
|
|
2783
|
+
"name",
|
|
2784
|
+
"variableDefinitions",
|
|
2785
|
+
"directives",
|
|
2786
|
+
"selectionSet"
|
|
2787
|
+
],
|
|
2788
|
+
VariableDefinition: ["variable", "type", "defaultValue", "directives"],
|
|
2789
|
+
Variable: ["name"],
|
|
2790
|
+
SelectionSet: ["selections"],
|
|
2791
|
+
Field: ["alias", "name", "arguments", "directives", "selectionSet"],
|
|
2792
|
+
Argument: ["name", "value"],
|
|
2793
|
+
FragmentSpread: ["name", "directives"],
|
|
2794
|
+
InlineFragment: ["typeCondition", "directives", "selectionSet"],
|
|
2795
|
+
FragmentDefinition: [
|
|
2796
|
+
"name",
|
|
2797
|
+
// Note: fragment variable definitions are deprecated and will removed in v17.0.0
|
|
2798
|
+
"variableDefinitions",
|
|
2799
|
+
"typeCondition",
|
|
2800
|
+
"directives",
|
|
2801
|
+
"selectionSet"
|
|
2802
|
+
],
|
|
2803
|
+
IntValue: [],
|
|
2804
|
+
FloatValue: [],
|
|
2805
|
+
StringValue: [],
|
|
2806
|
+
BooleanValue: [],
|
|
2807
|
+
NullValue: [],
|
|
2808
|
+
EnumValue: [],
|
|
2809
|
+
ListValue: ["values"],
|
|
2810
|
+
ObjectValue: ["fields"],
|
|
2811
|
+
ObjectField: ["name", "value"],
|
|
2812
|
+
Directive: ["name", "arguments"],
|
|
2813
|
+
NamedType: ["name"],
|
|
2814
|
+
ListType: ["type"],
|
|
2815
|
+
NonNullType: ["type"],
|
|
2816
|
+
SchemaDefinition: ["description", "directives", "operationTypes"],
|
|
2817
|
+
OperationTypeDefinition: ["type"],
|
|
2818
|
+
ScalarTypeDefinition: ["description", "name", "directives"],
|
|
2819
|
+
ObjectTypeDefinition: [
|
|
2820
|
+
"description",
|
|
2821
|
+
"name",
|
|
2822
|
+
"interfaces",
|
|
2823
|
+
"directives",
|
|
2824
|
+
"fields"
|
|
2825
|
+
],
|
|
2826
|
+
FieldDefinition: ["description", "name", "arguments", "type", "directives"],
|
|
2827
|
+
InputValueDefinition: [
|
|
2828
|
+
"description",
|
|
2829
|
+
"name",
|
|
2830
|
+
"type",
|
|
2831
|
+
"defaultValue",
|
|
2832
|
+
"directives"
|
|
2833
|
+
],
|
|
2834
|
+
InterfaceTypeDefinition: [
|
|
2835
|
+
"description",
|
|
2836
|
+
"name",
|
|
2837
|
+
"interfaces",
|
|
2838
|
+
"directives",
|
|
2839
|
+
"fields"
|
|
2840
|
+
],
|
|
2841
|
+
UnionTypeDefinition: ["description", "name", "directives", "types"],
|
|
2842
|
+
EnumTypeDefinition: ["description", "name", "directives", "values"],
|
|
2843
|
+
EnumValueDefinition: ["description", "name", "directives"],
|
|
2844
|
+
InputObjectTypeDefinition: ["description", "name", "directives", "fields"],
|
|
2845
|
+
DirectiveDefinition: ["description", "name", "arguments", "locations"],
|
|
2846
|
+
SchemaExtension: ["directives", "operationTypes"],
|
|
2847
|
+
ScalarTypeExtension: ["name", "directives"],
|
|
2848
|
+
ObjectTypeExtension: ["name", "interfaces", "directives", "fields"],
|
|
2849
|
+
InterfaceTypeExtension: ["name", "interfaces", "directives", "fields"],
|
|
2850
|
+
UnionTypeExtension: ["name", "directives", "types"],
|
|
2851
|
+
EnumTypeExtension: ["name", "directives", "values"],
|
|
2852
|
+
InputObjectTypeExtension: ["name", "directives", "fields"]
|
|
2853
|
+
};
|
|
2854
|
+
var kindValues = new Set(Object.keys(QueryDocumentKeys));
|
|
2855
|
+
function isNode(maybeNode) {
|
|
2856
|
+
const maybeKind = maybeNode === null || maybeNode === void 0 ? void 0 : maybeNode.kind;
|
|
2857
|
+
return typeof maybeKind === "string" && kindValues.has(maybeKind);
|
|
2858
|
+
}
|
|
2859
|
+
var OperationTypeNode;
|
|
2860
|
+
(function(OperationTypeNode2) {
|
|
2861
|
+
OperationTypeNode2["QUERY"] = "query";
|
|
2862
|
+
OperationTypeNode2["MUTATION"] = "mutation";
|
|
2863
|
+
OperationTypeNode2["SUBSCRIPTION"] = "subscription";
|
|
2864
|
+
})(OperationTypeNode || (OperationTypeNode = {}));
|
|
2865
|
+
|
|
2866
|
+
// node_modules/graphql/language/kinds.mjs
|
|
2867
|
+
var Kind;
|
|
2868
|
+
(function(Kind2) {
|
|
2869
|
+
Kind2["NAME"] = "Name";
|
|
2870
|
+
Kind2["DOCUMENT"] = "Document";
|
|
2871
|
+
Kind2["OPERATION_DEFINITION"] = "OperationDefinition";
|
|
2872
|
+
Kind2["VARIABLE_DEFINITION"] = "VariableDefinition";
|
|
2873
|
+
Kind2["SELECTION_SET"] = "SelectionSet";
|
|
2874
|
+
Kind2["FIELD"] = "Field";
|
|
2875
|
+
Kind2["ARGUMENT"] = "Argument";
|
|
2876
|
+
Kind2["FRAGMENT_SPREAD"] = "FragmentSpread";
|
|
2877
|
+
Kind2["INLINE_FRAGMENT"] = "InlineFragment";
|
|
2878
|
+
Kind2["FRAGMENT_DEFINITION"] = "FragmentDefinition";
|
|
2879
|
+
Kind2["VARIABLE"] = "Variable";
|
|
2880
|
+
Kind2["INT"] = "IntValue";
|
|
2881
|
+
Kind2["FLOAT"] = "FloatValue";
|
|
2882
|
+
Kind2["STRING"] = "StringValue";
|
|
2883
|
+
Kind2["BOOLEAN"] = "BooleanValue";
|
|
2884
|
+
Kind2["NULL"] = "NullValue";
|
|
2885
|
+
Kind2["ENUM"] = "EnumValue";
|
|
2886
|
+
Kind2["LIST"] = "ListValue";
|
|
2887
|
+
Kind2["OBJECT"] = "ObjectValue";
|
|
2888
|
+
Kind2["OBJECT_FIELD"] = "ObjectField";
|
|
2889
|
+
Kind2["DIRECTIVE"] = "Directive";
|
|
2890
|
+
Kind2["NAMED_TYPE"] = "NamedType";
|
|
2891
|
+
Kind2["LIST_TYPE"] = "ListType";
|
|
2892
|
+
Kind2["NON_NULL_TYPE"] = "NonNullType";
|
|
2893
|
+
Kind2["SCHEMA_DEFINITION"] = "SchemaDefinition";
|
|
2894
|
+
Kind2["OPERATION_TYPE_DEFINITION"] = "OperationTypeDefinition";
|
|
2895
|
+
Kind2["SCALAR_TYPE_DEFINITION"] = "ScalarTypeDefinition";
|
|
2896
|
+
Kind2["OBJECT_TYPE_DEFINITION"] = "ObjectTypeDefinition";
|
|
2897
|
+
Kind2["FIELD_DEFINITION"] = "FieldDefinition";
|
|
2898
|
+
Kind2["INPUT_VALUE_DEFINITION"] = "InputValueDefinition";
|
|
2899
|
+
Kind2["INTERFACE_TYPE_DEFINITION"] = "InterfaceTypeDefinition";
|
|
2900
|
+
Kind2["UNION_TYPE_DEFINITION"] = "UnionTypeDefinition";
|
|
2901
|
+
Kind2["ENUM_TYPE_DEFINITION"] = "EnumTypeDefinition";
|
|
2902
|
+
Kind2["ENUM_VALUE_DEFINITION"] = "EnumValueDefinition";
|
|
2903
|
+
Kind2["INPUT_OBJECT_TYPE_DEFINITION"] = "InputObjectTypeDefinition";
|
|
2904
|
+
Kind2["DIRECTIVE_DEFINITION"] = "DirectiveDefinition";
|
|
2905
|
+
Kind2["SCHEMA_EXTENSION"] = "SchemaExtension";
|
|
2906
|
+
Kind2["SCALAR_TYPE_EXTENSION"] = "ScalarTypeExtension";
|
|
2907
|
+
Kind2["OBJECT_TYPE_EXTENSION"] = "ObjectTypeExtension";
|
|
2908
|
+
Kind2["INTERFACE_TYPE_EXTENSION"] = "InterfaceTypeExtension";
|
|
2909
|
+
Kind2["UNION_TYPE_EXTENSION"] = "UnionTypeExtension";
|
|
2910
|
+
Kind2["ENUM_TYPE_EXTENSION"] = "EnumTypeExtension";
|
|
2911
|
+
Kind2["INPUT_OBJECT_TYPE_EXTENSION"] = "InputObjectTypeExtension";
|
|
2912
|
+
})(Kind || (Kind = {}));
|
|
2913
|
+
|
|
2914
|
+
// node_modules/graphql/language/characterClasses.mjs
|
|
2915
|
+
function isWhiteSpace(code) {
|
|
2916
|
+
return code === 9 || code === 32;
|
|
2917
|
+
}
|
|
2918
|
+
|
|
2919
|
+
// node_modules/graphql/language/blockString.mjs
|
|
2920
|
+
function printBlockString(value, options) {
|
|
2921
|
+
const escapedValue = value.replace(/"""/g, '\\"""');
|
|
2922
|
+
const lines = escapedValue.split(/\r\n|[\n\r]/g);
|
|
2923
|
+
const isSingleLine = lines.length === 1;
|
|
2924
|
+
const forceLeadingNewLine = lines.length > 1 && lines.slice(1).every((line) => line.length === 0 || isWhiteSpace(line.charCodeAt(0)));
|
|
2925
|
+
const hasTrailingTripleQuotes = escapedValue.endsWith('\\"""');
|
|
2926
|
+
const hasTrailingQuote = value.endsWith('"') && !hasTrailingTripleQuotes;
|
|
2927
|
+
const hasTrailingSlash = value.endsWith("\\");
|
|
2928
|
+
const forceTrailingNewline = hasTrailingQuote || hasTrailingSlash;
|
|
2929
|
+
const printAsMultipleLines = !(options !== null && options !== void 0 && options.minimize) && // add leading and trailing new lines only if it improves readability
|
|
2930
|
+
(!isSingleLine || value.length > 70 || forceTrailingNewline || forceLeadingNewLine || hasTrailingTripleQuotes);
|
|
2931
|
+
let result = "";
|
|
2932
|
+
const skipLeadingNewLine = isSingleLine && isWhiteSpace(value.charCodeAt(0));
|
|
2933
|
+
if (printAsMultipleLines && !skipLeadingNewLine || forceLeadingNewLine) {
|
|
2934
|
+
result += "\n";
|
|
2935
|
+
}
|
|
2936
|
+
result += escapedValue;
|
|
2937
|
+
if (printAsMultipleLines || forceTrailingNewline) {
|
|
2938
|
+
result += "\n";
|
|
2939
|
+
}
|
|
2940
|
+
return '"""' + result + '"""';
|
|
2941
|
+
}
|
|
2942
|
+
|
|
2943
|
+
// node_modules/graphql/jsutils/inspect.mjs
|
|
2944
|
+
var MAX_ARRAY_LENGTH = 10;
|
|
2945
|
+
var MAX_RECURSIVE_DEPTH = 2;
|
|
2946
|
+
function inspect(value) {
|
|
2947
|
+
return formatValue(value, []);
|
|
2948
|
+
}
|
|
2949
|
+
function formatValue(value, seenValues) {
|
|
2950
|
+
switch (typeof value) {
|
|
2951
|
+
case "string":
|
|
2952
|
+
return JSON.stringify(value);
|
|
2953
|
+
case "function":
|
|
2954
|
+
return value.name ? `[function ${value.name}]` : "[function]";
|
|
2955
|
+
case "object":
|
|
2956
|
+
return formatObjectValue(value, seenValues);
|
|
2957
|
+
default:
|
|
2958
|
+
return String(value);
|
|
2959
|
+
}
|
|
2960
|
+
}
|
|
2961
|
+
function formatObjectValue(value, previouslySeenValues) {
|
|
2962
|
+
if (value === null) {
|
|
2963
|
+
return "null";
|
|
2964
|
+
}
|
|
2965
|
+
if (previouslySeenValues.includes(value)) {
|
|
2966
|
+
return "[Circular]";
|
|
2967
|
+
}
|
|
2968
|
+
const seenValues = [...previouslySeenValues, value];
|
|
2969
|
+
if (isJSONable(value)) {
|
|
2970
|
+
const jsonValue = value.toJSON();
|
|
2971
|
+
if (jsonValue !== value) {
|
|
2972
|
+
return typeof jsonValue === "string" ? jsonValue : formatValue(jsonValue, seenValues);
|
|
2973
|
+
}
|
|
2974
|
+
} else if (Array.isArray(value)) {
|
|
2975
|
+
return formatArray(value, seenValues);
|
|
2976
|
+
}
|
|
2977
|
+
return formatObject(value, seenValues);
|
|
2978
|
+
}
|
|
2979
|
+
function isJSONable(value) {
|
|
2980
|
+
return typeof value.toJSON === "function";
|
|
2981
|
+
}
|
|
2982
|
+
function formatObject(object, seenValues) {
|
|
2983
|
+
const entries = Object.entries(object);
|
|
2984
|
+
if (entries.length === 0) {
|
|
2985
|
+
return "{}";
|
|
2986
|
+
}
|
|
2987
|
+
if (seenValues.length > MAX_RECURSIVE_DEPTH) {
|
|
2988
|
+
return "[" + getObjectTag(object) + "]";
|
|
2989
|
+
}
|
|
2990
|
+
const properties = entries.map(
|
|
2991
|
+
([key, value]) => key + ": " + formatValue(value, seenValues)
|
|
2992
|
+
);
|
|
2993
|
+
return "{ " + properties.join(", ") + " }";
|
|
2994
|
+
}
|
|
2995
|
+
function formatArray(array, seenValues) {
|
|
2996
|
+
if (array.length === 0) {
|
|
2997
|
+
return "[]";
|
|
2998
|
+
}
|
|
2999
|
+
if (seenValues.length > MAX_RECURSIVE_DEPTH) {
|
|
3000
|
+
return "[Array]";
|
|
3001
|
+
}
|
|
3002
|
+
const len = Math.min(MAX_ARRAY_LENGTH, array.length);
|
|
3003
|
+
const remaining = array.length - len;
|
|
3004
|
+
const items = [];
|
|
3005
|
+
for (let i = 0; i < len; ++i) {
|
|
3006
|
+
items.push(formatValue(array[i], seenValues));
|
|
3007
|
+
}
|
|
3008
|
+
if (remaining === 1) {
|
|
3009
|
+
items.push("... 1 more item");
|
|
3010
|
+
} else if (remaining > 1) {
|
|
3011
|
+
items.push(`... ${remaining} more items`);
|
|
3012
|
+
}
|
|
3013
|
+
return "[" + items.join(", ") + "]";
|
|
3014
|
+
}
|
|
3015
|
+
function getObjectTag(object) {
|
|
3016
|
+
const tag = Object.prototype.toString.call(object).replace(/^\[object /, "").replace(/]$/, "");
|
|
3017
|
+
if (tag === "Object" && typeof object.constructor === "function") {
|
|
3018
|
+
const name = object.constructor.name;
|
|
3019
|
+
if (typeof name === "string" && name !== "") {
|
|
3020
|
+
return name;
|
|
3021
|
+
}
|
|
3022
|
+
}
|
|
3023
|
+
return tag;
|
|
3024
|
+
}
|
|
3025
|
+
|
|
3026
|
+
// node_modules/graphql/language/printString.mjs
|
|
3027
|
+
function printString(str) {
|
|
3028
|
+
return `"${str.replace(escapedRegExp, escapedReplacer)}"`;
|
|
3029
|
+
}
|
|
3030
|
+
var escapedRegExp = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g;
|
|
3031
|
+
function escapedReplacer(str) {
|
|
3032
|
+
return escapeSequences[str.charCodeAt(0)];
|
|
3033
|
+
}
|
|
3034
|
+
var escapeSequences = [
|
|
3035
|
+
"\\u0000",
|
|
3036
|
+
"\\u0001",
|
|
3037
|
+
"\\u0002",
|
|
3038
|
+
"\\u0003",
|
|
3039
|
+
"\\u0004",
|
|
3040
|
+
"\\u0005",
|
|
3041
|
+
"\\u0006",
|
|
3042
|
+
"\\u0007",
|
|
3043
|
+
"\\b",
|
|
3044
|
+
"\\t",
|
|
3045
|
+
"\\n",
|
|
3046
|
+
"\\u000B",
|
|
3047
|
+
"\\f",
|
|
3048
|
+
"\\r",
|
|
3049
|
+
"\\u000E",
|
|
3050
|
+
"\\u000F",
|
|
3051
|
+
"\\u0010",
|
|
3052
|
+
"\\u0011",
|
|
3053
|
+
"\\u0012",
|
|
3054
|
+
"\\u0013",
|
|
3055
|
+
"\\u0014",
|
|
3056
|
+
"\\u0015",
|
|
3057
|
+
"\\u0016",
|
|
3058
|
+
"\\u0017",
|
|
3059
|
+
"\\u0018",
|
|
3060
|
+
"\\u0019",
|
|
3061
|
+
"\\u001A",
|
|
3062
|
+
"\\u001B",
|
|
3063
|
+
"\\u001C",
|
|
3064
|
+
"\\u001D",
|
|
3065
|
+
"\\u001E",
|
|
3066
|
+
"\\u001F",
|
|
3067
|
+
"",
|
|
3068
|
+
"",
|
|
3069
|
+
'\\"',
|
|
3070
|
+
"",
|
|
3071
|
+
"",
|
|
3072
|
+
"",
|
|
3073
|
+
"",
|
|
3074
|
+
"",
|
|
3075
|
+
"",
|
|
3076
|
+
"",
|
|
3077
|
+
"",
|
|
3078
|
+
"",
|
|
3079
|
+
"",
|
|
3080
|
+
"",
|
|
3081
|
+
"",
|
|
3082
|
+
"",
|
|
3083
|
+
// 2F
|
|
3084
|
+
"",
|
|
3085
|
+
"",
|
|
3086
|
+
"",
|
|
3087
|
+
"",
|
|
3088
|
+
"",
|
|
3089
|
+
"",
|
|
3090
|
+
"",
|
|
3091
|
+
"",
|
|
3092
|
+
"",
|
|
3093
|
+
"",
|
|
3094
|
+
"",
|
|
3095
|
+
"",
|
|
3096
|
+
"",
|
|
3097
|
+
"",
|
|
3098
|
+
"",
|
|
3099
|
+
"",
|
|
3100
|
+
// 3F
|
|
3101
|
+
"",
|
|
3102
|
+
"",
|
|
3103
|
+
"",
|
|
3104
|
+
"",
|
|
3105
|
+
"",
|
|
3106
|
+
"",
|
|
3107
|
+
"",
|
|
3108
|
+
"",
|
|
3109
|
+
"",
|
|
3110
|
+
"",
|
|
3111
|
+
"",
|
|
3112
|
+
"",
|
|
3113
|
+
"",
|
|
3114
|
+
"",
|
|
3115
|
+
"",
|
|
3116
|
+
"",
|
|
3117
|
+
// 4F
|
|
3118
|
+
"",
|
|
3119
|
+
"",
|
|
3120
|
+
"",
|
|
3121
|
+
"",
|
|
3122
|
+
"",
|
|
3123
|
+
"",
|
|
3124
|
+
"",
|
|
3125
|
+
"",
|
|
3126
|
+
"",
|
|
3127
|
+
"",
|
|
3128
|
+
"",
|
|
3129
|
+
"",
|
|
3130
|
+
"\\\\",
|
|
3131
|
+
"",
|
|
3132
|
+
"",
|
|
3133
|
+
"",
|
|
3134
|
+
// 5F
|
|
3135
|
+
"",
|
|
3136
|
+
"",
|
|
3137
|
+
"",
|
|
3138
|
+
"",
|
|
3139
|
+
"",
|
|
3140
|
+
"",
|
|
3141
|
+
"",
|
|
3142
|
+
"",
|
|
3143
|
+
"",
|
|
3144
|
+
"",
|
|
3145
|
+
"",
|
|
3146
|
+
"",
|
|
3147
|
+
"",
|
|
3148
|
+
"",
|
|
3149
|
+
"",
|
|
3150
|
+
"",
|
|
3151
|
+
// 6F
|
|
3152
|
+
"",
|
|
3153
|
+
"",
|
|
3154
|
+
"",
|
|
3155
|
+
"",
|
|
3156
|
+
"",
|
|
3157
|
+
"",
|
|
3158
|
+
"",
|
|
3159
|
+
"",
|
|
3160
|
+
"",
|
|
3161
|
+
"",
|
|
3162
|
+
"",
|
|
3163
|
+
"",
|
|
3164
|
+
"",
|
|
3165
|
+
"",
|
|
3166
|
+
"",
|
|
3167
|
+
"\\u007F",
|
|
3168
|
+
"\\u0080",
|
|
3169
|
+
"\\u0081",
|
|
3170
|
+
"\\u0082",
|
|
3171
|
+
"\\u0083",
|
|
3172
|
+
"\\u0084",
|
|
3173
|
+
"\\u0085",
|
|
3174
|
+
"\\u0086",
|
|
3175
|
+
"\\u0087",
|
|
3176
|
+
"\\u0088",
|
|
3177
|
+
"\\u0089",
|
|
3178
|
+
"\\u008A",
|
|
3179
|
+
"\\u008B",
|
|
3180
|
+
"\\u008C",
|
|
3181
|
+
"\\u008D",
|
|
3182
|
+
"\\u008E",
|
|
3183
|
+
"\\u008F",
|
|
3184
|
+
"\\u0090",
|
|
3185
|
+
"\\u0091",
|
|
3186
|
+
"\\u0092",
|
|
3187
|
+
"\\u0093",
|
|
3188
|
+
"\\u0094",
|
|
3189
|
+
"\\u0095",
|
|
3190
|
+
"\\u0096",
|
|
3191
|
+
"\\u0097",
|
|
3192
|
+
"\\u0098",
|
|
3193
|
+
"\\u0099",
|
|
3194
|
+
"\\u009A",
|
|
3195
|
+
"\\u009B",
|
|
3196
|
+
"\\u009C",
|
|
3197
|
+
"\\u009D",
|
|
3198
|
+
"\\u009E",
|
|
3199
|
+
"\\u009F"
|
|
3200
|
+
];
|
|
3201
|
+
|
|
3202
|
+
// node_modules/graphql/language/visitor.mjs
|
|
3203
|
+
var BREAK = Object.freeze({});
|
|
3204
|
+
function visit(root, visitor, visitorKeys = QueryDocumentKeys) {
|
|
3205
|
+
const enterLeaveMap = /* @__PURE__ */ new Map();
|
|
3206
|
+
for (const kind of Object.values(Kind)) {
|
|
3207
|
+
enterLeaveMap.set(kind, getEnterLeaveForKind(visitor, kind));
|
|
3208
|
+
}
|
|
3209
|
+
let stack = void 0;
|
|
3210
|
+
let inArray = Array.isArray(root);
|
|
3211
|
+
let keys = [root];
|
|
3212
|
+
let index2 = -1;
|
|
3213
|
+
let edits = [];
|
|
3214
|
+
let node = root;
|
|
3215
|
+
let key = void 0;
|
|
3216
|
+
let parent = void 0;
|
|
3217
|
+
const path2 = [];
|
|
3218
|
+
const ancestors = [];
|
|
3219
|
+
do {
|
|
3220
|
+
index2++;
|
|
3221
|
+
const isLeaving = index2 === keys.length;
|
|
3222
|
+
const isEdited = isLeaving && edits.length !== 0;
|
|
3223
|
+
if (isLeaving) {
|
|
3224
|
+
key = ancestors.length === 0 ? void 0 : path2[path2.length - 1];
|
|
3225
|
+
node = parent;
|
|
3226
|
+
parent = ancestors.pop();
|
|
3227
|
+
if (isEdited) {
|
|
3228
|
+
if (inArray) {
|
|
3229
|
+
node = node.slice();
|
|
3230
|
+
let editOffset = 0;
|
|
3231
|
+
for (const [editKey, editValue] of edits) {
|
|
3232
|
+
const arrayKey = editKey - editOffset;
|
|
3233
|
+
if (editValue === null) {
|
|
3234
|
+
node.splice(arrayKey, 1);
|
|
3235
|
+
editOffset++;
|
|
3236
|
+
} else {
|
|
3237
|
+
node[arrayKey] = editValue;
|
|
3238
|
+
}
|
|
3239
|
+
}
|
|
3240
|
+
} else {
|
|
3241
|
+
node = { ...node };
|
|
3242
|
+
for (const [editKey, editValue] of edits) {
|
|
3243
|
+
node[editKey] = editValue;
|
|
3244
|
+
}
|
|
3245
|
+
}
|
|
3246
|
+
}
|
|
3247
|
+
index2 = stack.index;
|
|
3248
|
+
keys = stack.keys;
|
|
3249
|
+
edits = stack.edits;
|
|
3250
|
+
inArray = stack.inArray;
|
|
3251
|
+
stack = stack.prev;
|
|
3252
|
+
} else if (parent) {
|
|
3253
|
+
key = inArray ? index2 : keys[index2];
|
|
3254
|
+
node = parent[key];
|
|
3255
|
+
if (node === null || node === void 0) {
|
|
3256
|
+
continue;
|
|
3257
|
+
}
|
|
3258
|
+
path2.push(key);
|
|
3259
|
+
}
|
|
3260
|
+
let result;
|
|
3261
|
+
if (!Array.isArray(node)) {
|
|
3262
|
+
var _enterLeaveMap$get, _enterLeaveMap$get2;
|
|
3263
|
+
isNode(node) || devAssert(false, `Invalid AST Node: ${inspect(node)}.`);
|
|
3264
|
+
const visitFn = isLeaving ? (_enterLeaveMap$get = enterLeaveMap.get(node.kind)) === null || _enterLeaveMap$get === void 0 ? void 0 : _enterLeaveMap$get.leave : (_enterLeaveMap$get2 = enterLeaveMap.get(node.kind)) === null || _enterLeaveMap$get2 === void 0 ? void 0 : _enterLeaveMap$get2.enter;
|
|
3265
|
+
result = visitFn === null || visitFn === void 0 ? void 0 : visitFn.call(visitor, node, key, parent, path2, ancestors);
|
|
3266
|
+
if (result === BREAK) {
|
|
3267
|
+
break;
|
|
3268
|
+
}
|
|
3269
|
+
if (result === false) {
|
|
3270
|
+
if (!isLeaving) {
|
|
3271
|
+
path2.pop();
|
|
3272
|
+
continue;
|
|
3273
|
+
}
|
|
3274
|
+
} else if (result !== void 0) {
|
|
3275
|
+
edits.push([key, result]);
|
|
3276
|
+
if (!isLeaving) {
|
|
3277
|
+
if (isNode(result)) {
|
|
3278
|
+
node = result;
|
|
3279
|
+
} else {
|
|
3280
|
+
path2.pop();
|
|
3281
|
+
continue;
|
|
3282
|
+
}
|
|
3283
|
+
}
|
|
3284
|
+
}
|
|
3285
|
+
}
|
|
3286
|
+
if (result === void 0 && isEdited) {
|
|
3287
|
+
edits.push([key, node]);
|
|
3288
|
+
}
|
|
3289
|
+
if (isLeaving) {
|
|
3290
|
+
path2.pop();
|
|
3291
|
+
} else {
|
|
3292
|
+
var _node$kind;
|
|
3293
|
+
stack = {
|
|
3294
|
+
inArray,
|
|
3295
|
+
index: index2,
|
|
3296
|
+
keys,
|
|
3297
|
+
edits,
|
|
3298
|
+
prev: stack
|
|
3299
|
+
};
|
|
3300
|
+
inArray = Array.isArray(node);
|
|
3301
|
+
keys = inArray ? node : (_node$kind = visitorKeys[node.kind]) !== null && _node$kind !== void 0 ? _node$kind : [];
|
|
3302
|
+
index2 = -1;
|
|
3303
|
+
edits = [];
|
|
3304
|
+
if (parent) {
|
|
3305
|
+
ancestors.push(parent);
|
|
3306
|
+
}
|
|
3307
|
+
parent = node;
|
|
3308
|
+
}
|
|
3309
|
+
} while (stack !== void 0);
|
|
3310
|
+
if (edits.length !== 0) {
|
|
3311
|
+
return edits[edits.length - 1][1];
|
|
3312
|
+
}
|
|
3313
|
+
return root;
|
|
3314
|
+
}
|
|
3315
|
+
function getEnterLeaveForKind(visitor, kind) {
|
|
3316
|
+
const kindVisitor = visitor[kind];
|
|
3317
|
+
if (typeof kindVisitor === "object") {
|
|
3318
|
+
return kindVisitor;
|
|
3319
|
+
} else if (typeof kindVisitor === "function") {
|
|
3320
|
+
return {
|
|
3321
|
+
enter: kindVisitor,
|
|
3322
|
+
leave: void 0
|
|
3323
|
+
};
|
|
3324
|
+
}
|
|
3325
|
+
return {
|
|
3326
|
+
enter: visitor.enter,
|
|
3327
|
+
leave: visitor.leave
|
|
3328
|
+
};
|
|
3329
|
+
}
|
|
3330
|
+
|
|
3331
|
+
// node_modules/graphql/language/printer.mjs
|
|
3332
|
+
function print(ast) {
|
|
3333
|
+
return visit(ast, printDocASTReducer);
|
|
3334
|
+
}
|
|
3335
|
+
var MAX_LINE_LENGTH = 80;
|
|
3336
|
+
var printDocASTReducer = {
|
|
3337
|
+
Name: {
|
|
3338
|
+
leave: (node) => node.value
|
|
3339
|
+
},
|
|
3340
|
+
Variable: {
|
|
3341
|
+
leave: (node) => "$" + node.name
|
|
3342
|
+
},
|
|
3343
|
+
// Document
|
|
3344
|
+
Document: {
|
|
3345
|
+
leave: (node) => join(node.definitions, "\n\n")
|
|
3346
|
+
},
|
|
3347
|
+
OperationDefinition: {
|
|
3348
|
+
leave(node) {
|
|
3349
|
+
const varDefs = wrap("(", join(node.variableDefinitions, ", "), ")");
|
|
3350
|
+
const prefix = join(
|
|
3351
|
+
[
|
|
3352
|
+
node.operation,
|
|
3353
|
+
join([node.name, varDefs]),
|
|
3354
|
+
join(node.directives, " ")
|
|
3355
|
+
],
|
|
3356
|
+
" "
|
|
3357
|
+
);
|
|
3358
|
+
return (prefix === "query" ? "" : prefix + " ") + node.selectionSet;
|
|
3359
|
+
}
|
|
3360
|
+
},
|
|
3361
|
+
VariableDefinition: {
|
|
3362
|
+
leave: ({ variable, type, defaultValue, directives }) => variable + ": " + type + wrap(" = ", defaultValue) + wrap(" ", join(directives, " "))
|
|
3363
|
+
},
|
|
3364
|
+
SelectionSet: {
|
|
3365
|
+
leave: ({ selections }) => block(selections)
|
|
3366
|
+
},
|
|
3367
|
+
Field: {
|
|
3368
|
+
leave({ alias, name, arguments: args, directives, selectionSet }) {
|
|
3369
|
+
const prefix = wrap("", alias, ": ") + name;
|
|
3370
|
+
let argsLine = prefix + wrap("(", join(args, ", "), ")");
|
|
3371
|
+
if (argsLine.length > MAX_LINE_LENGTH) {
|
|
3372
|
+
argsLine = prefix + wrap("(\n", indent(join(args, "\n")), "\n)");
|
|
3373
|
+
}
|
|
3374
|
+
return join([argsLine, join(directives, " "), selectionSet], " ");
|
|
3375
|
+
}
|
|
3376
|
+
},
|
|
3377
|
+
Argument: {
|
|
3378
|
+
leave: ({ name, value }) => name + ": " + value
|
|
3379
|
+
},
|
|
3380
|
+
// Fragments
|
|
3381
|
+
FragmentSpread: {
|
|
3382
|
+
leave: ({ name, directives }) => "..." + name + wrap(" ", join(directives, " "))
|
|
3383
|
+
},
|
|
3384
|
+
InlineFragment: {
|
|
3385
|
+
leave: ({ typeCondition, directives, selectionSet }) => join(
|
|
3386
|
+
[
|
|
3387
|
+
"...",
|
|
3388
|
+
wrap("on ", typeCondition),
|
|
3389
|
+
join(directives, " "),
|
|
3390
|
+
selectionSet
|
|
3391
|
+
],
|
|
3392
|
+
" "
|
|
3393
|
+
)
|
|
3394
|
+
},
|
|
3395
|
+
FragmentDefinition: {
|
|
3396
|
+
leave: ({ name, typeCondition, variableDefinitions, directives, selectionSet }) => (
|
|
3397
|
+
// or removed in the future.
|
|
3398
|
+
`fragment ${name}${wrap("(", join(variableDefinitions, ", "), ")")} on ${typeCondition} ${wrap("", join(directives, " "), " ")}` + selectionSet
|
|
3399
|
+
)
|
|
3400
|
+
},
|
|
3401
|
+
// Value
|
|
3402
|
+
IntValue: {
|
|
3403
|
+
leave: ({ value }) => value
|
|
3404
|
+
},
|
|
3405
|
+
FloatValue: {
|
|
3406
|
+
leave: ({ value }) => value
|
|
3407
|
+
},
|
|
3408
|
+
StringValue: {
|
|
3409
|
+
leave: ({ value, block: isBlockString }) => isBlockString ? printBlockString(value) : printString(value)
|
|
3410
|
+
},
|
|
3411
|
+
BooleanValue: {
|
|
3412
|
+
leave: ({ value }) => value ? "true" : "false"
|
|
3413
|
+
},
|
|
3414
|
+
NullValue: {
|
|
3415
|
+
leave: () => "null"
|
|
3416
|
+
},
|
|
3417
|
+
EnumValue: {
|
|
3418
|
+
leave: ({ value }) => value
|
|
3419
|
+
},
|
|
3420
|
+
ListValue: {
|
|
3421
|
+
leave: ({ values }) => "[" + join(values, ", ") + "]"
|
|
3422
|
+
},
|
|
3423
|
+
ObjectValue: {
|
|
3424
|
+
leave: ({ fields }) => "{" + join(fields, ", ") + "}"
|
|
3425
|
+
},
|
|
3426
|
+
ObjectField: {
|
|
3427
|
+
leave: ({ name, value }) => name + ": " + value
|
|
3428
|
+
},
|
|
3429
|
+
// Directive
|
|
3430
|
+
Directive: {
|
|
3431
|
+
leave: ({ name, arguments: args }) => "@" + name + wrap("(", join(args, ", "), ")")
|
|
3432
|
+
},
|
|
3433
|
+
// Type
|
|
3434
|
+
NamedType: {
|
|
3435
|
+
leave: ({ name }) => name
|
|
3436
|
+
},
|
|
3437
|
+
ListType: {
|
|
3438
|
+
leave: ({ type }) => "[" + type + "]"
|
|
3439
|
+
},
|
|
3440
|
+
NonNullType: {
|
|
3441
|
+
leave: ({ type }) => type + "!"
|
|
3442
|
+
},
|
|
3443
|
+
// Type System Definitions
|
|
3444
|
+
SchemaDefinition: {
|
|
3445
|
+
leave: ({ description, directives, operationTypes }) => wrap("", description, "\n") + join(["schema", join(directives, " "), block(operationTypes)], " ")
|
|
3446
|
+
},
|
|
3447
|
+
OperationTypeDefinition: {
|
|
3448
|
+
leave: ({ operation, type }) => operation + ": " + type
|
|
3449
|
+
},
|
|
3450
|
+
ScalarTypeDefinition: {
|
|
3451
|
+
leave: ({ description, name, directives }) => wrap("", description, "\n") + join(["scalar", name, join(directives, " ")], " ")
|
|
3452
|
+
},
|
|
3453
|
+
ObjectTypeDefinition: {
|
|
3454
|
+
leave: ({ description, name, interfaces, directives, fields }) => wrap("", description, "\n") + join(
|
|
3455
|
+
[
|
|
3456
|
+
"type",
|
|
3457
|
+
name,
|
|
3458
|
+
wrap("implements ", join(interfaces, " & ")),
|
|
3459
|
+
join(directives, " "),
|
|
3460
|
+
block(fields)
|
|
3461
|
+
],
|
|
3462
|
+
" "
|
|
3463
|
+
)
|
|
3464
|
+
},
|
|
3465
|
+
FieldDefinition: {
|
|
3466
|
+
leave: ({ description, name, arguments: args, type, directives }) => wrap("", description, "\n") + name + (hasMultilineItems(args) ? wrap("(\n", indent(join(args, "\n")), "\n)") : wrap("(", join(args, ", "), ")")) + ": " + type + wrap(" ", join(directives, " "))
|
|
3467
|
+
},
|
|
3468
|
+
InputValueDefinition: {
|
|
3469
|
+
leave: ({ description, name, type, defaultValue, directives }) => wrap("", description, "\n") + join(
|
|
3470
|
+
[name + ": " + type, wrap("= ", defaultValue), join(directives, " ")],
|
|
3471
|
+
" "
|
|
3472
|
+
)
|
|
3473
|
+
},
|
|
3474
|
+
InterfaceTypeDefinition: {
|
|
3475
|
+
leave: ({ description, name, interfaces, directives, fields }) => wrap("", description, "\n") + join(
|
|
3476
|
+
[
|
|
3477
|
+
"interface",
|
|
3478
|
+
name,
|
|
3479
|
+
wrap("implements ", join(interfaces, " & ")),
|
|
3480
|
+
join(directives, " "),
|
|
3481
|
+
block(fields)
|
|
3482
|
+
],
|
|
3483
|
+
" "
|
|
3484
|
+
)
|
|
3485
|
+
},
|
|
3486
|
+
UnionTypeDefinition: {
|
|
3487
|
+
leave: ({ description, name, directives, types }) => wrap("", description, "\n") + join(
|
|
3488
|
+
["union", name, join(directives, " "), wrap("= ", join(types, " | "))],
|
|
3489
|
+
" "
|
|
3490
|
+
)
|
|
3491
|
+
},
|
|
3492
|
+
EnumTypeDefinition: {
|
|
3493
|
+
leave: ({ description, name, directives, values }) => wrap("", description, "\n") + join(["enum", name, join(directives, " "), block(values)], " ")
|
|
3494
|
+
},
|
|
3495
|
+
EnumValueDefinition: {
|
|
3496
|
+
leave: ({ description, name, directives }) => wrap("", description, "\n") + join([name, join(directives, " ")], " ")
|
|
3497
|
+
},
|
|
3498
|
+
InputObjectTypeDefinition: {
|
|
3499
|
+
leave: ({ description, name, directives, fields }) => wrap("", description, "\n") + join(["input", name, join(directives, " "), block(fields)], " ")
|
|
3500
|
+
},
|
|
3501
|
+
DirectiveDefinition: {
|
|
3502
|
+
leave: ({ description, name, arguments: args, repeatable, locations }) => wrap("", description, "\n") + "directive @" + name + (hasMultilineItems(args) ? wrap("(\n", indent(join(args, "\n")), "\n)") : wrap("(", join(args, ", "), ")")) + (repeatable ? " repeatable" : "") + " on " + join(locations, " | ")
|
|
3503
|
+
},
|
|
3504
|
+
SchemaExtension: {
|
|
3505
|
+
leave: ({ directives, operationTypes }) => join(
|
|
3506
|
+
["extend schema", join(directives, " "), block(operationTypes)],
|
|
3507
|
+
" "
|
|
3508
|
+
)
|
|
3509
|
+
},
|
|
3510
|
+
ScalarTypeExtension: {
|
|
3511
|
+
leave: ({ name, directives }) => join(["extend scalar", name, join(directives, " ")], " ")
|
|
3512
|
+
},
|
|
3513
|
+
ObjectTypeExtension: {
|
|
3514
|
+
leave: ({ name, interfaces, directives, fields }) => join(
|
|
3515
|
+
[
|
|
3516
|
+
"extend type",
|
|
3517
|
+
name,
|
|
3518
|
+
wrap("implements ", join(interfaces, " & ")),
|
|
3519
|
+
join(directives, " "),
|
|
3520
|
+
block(fields)
|
|
3521
|
+
],
|
|
3522
|
+
" "
|
|
3523
|
+
)
|
|
3524
|
+
},
|
|
3525
|
+
InterfaceTypeExtension: {
|
|
3526
|
+
leave: ({ name, interfaces, directives, fields }) => join(
|
|
3527
|
+
[
|
|
3528
|
+
"extend interface",
|
|
3529
|
+
name,
|
|
3530
|
+
wrap("implements ", join(interfaces, " & ")),
|
|
3531
|
+
join(directives, " "),
|
|
3532
|
+
block(fields)
|
|
3533
|
+
],
|
|
3534
|
+
" "
|
|
3535
|
+
)
|
|
3536
|
+
},
|
|
3537
|
+
UnionTypeExtension: {
|
|
3538
|
+
leave: ({ name, directives, types }) => join(
|
|
3539
|
+
[
|
|
3540
|
+
"extend union",
|
|
3541
|
+
name,
|
|
3542
|
+
join(directives, " "),
|
|
3543
|
+
wrap("= ", join(types, " | "))
|
|
3544
|
+
],
|
|
3545
|
+
" "
|
|
3546
|
+
)
|
|
3547
|
+
},
|
|
3548
|
+
EnumTypeExtension: {
|
|
3549
|
+
leave: ({ name, directives, values }) => join(["extend enum", name, join(directives, " "), block(values)], " ")
|
|
3550
|
+
},
|
|
3551
|
+
InputObjectTypeExtension: {
|
|
3552
|
+
leave: ({ name, directives, fields }) => join(["extend input", name, join(directives, " "), block(fields)], " ")
|
|
3553
|
+
}
|
|
3554
|
+
};
|
|
3555
|
+
function join(maybeArray, separator = "") {
|
|
3556
|
+
var _maybeArray$filter$jo;
|
|
3557
|
+
return (_maybeArray$filter$jo = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.filter((x) => x).join(separator)) !== null && _maybeArray$filter$jo !== void 0 ? _maybeArray$filter$jo : "";
|
|
3558
|
+
}
|
|
3559
|
+
function block(array) {
|
|
3560
|
+
return wrap("{\n", indent(join(array, "\n")), "\n}");
|
|
3561
|
+
}
|
|
3562
|
+
function wrap(start, maybeString, end = "") {
|
|
3563
|
+
return maybeString != null && maybeString !== "" ? start + maybeString + end : "";
|
|
3564
|
+
}
|
|
3565
|
+
function indent(str) {
|
|
3566
|
+
return wrap(" ", str.replace(/\n/g, "\n "));
|
|
3567
|
+
}
|
|
3568
|
+
function hasMultilineItems(maybeArray) {
|
|
3569
|
+
var _maybeArray$some;
|
|
3570
|
+
return (_maybeArray$some = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.some((str) => str.includes("\n"))) !== null && _maybeArray$some !== void 0 ? _maybeArray$some : false;
|
|
3571
|
+
}
|
|
3572
|
+
|
|
3573
|
+
// src/device/index.ts
|
|
3574
|
+
var import_uuid = require("uuid");
|
|
3575
|
+
function getDeviceIdFromIndexedDB() {
|
|
3576
|
+
return new Promise((resolve) => {
|
|
3577
|
+
if (typeof indexedDB === "undefined") return resolve(null);
|
|
3578
|
+
const request = indexedDB.open("DeviceDB", 1);
|
|
3579
|
+
request.onupgradeneeded = () => {
|
|
3580
|
+
const db = request.result;
|
|
3581
|
+
db.createObjectStore("info");
|
|
3582
|
+
};
|
|
3583
|
+
request.onsuccess = () => {
|
|
3584
|
+
const db = request.result;
|
|
3585
|
+
const tx = db.transaction("info", "readonly");
|
|
3586
|
+
const store = tx.objectStore("info");
|
|
3587
|
+
const getReq = store.get("deviceId");
|
|
3588
|
+
getReq.onsuccess = () => resolve(getReq.result ?? null);
|
|
3589
|
+
getReq.onerror = () => resolve(null);
|
|
3590
|
+
};
|
|
3591
|
+
request.onerror = () => resolve(null);
|
|
3592
|
+
});
|
|
3593
|
+
}
|
|
3594
|
+
function setDeviceIdToIndexedDB(id) {
|
|
3595
|
+
return new Promise((resolve) => {
|
|
3596
|
+
if (typeof indexedDB === "undefined") return resolve();
|
|
3597
|
+
const request = indexedDB.open("DeviceDB", 1);
|
|
3598
|
+
request.onupgradeneeded = () => {
|
|
3599
|
+
const db = request.result;
|
|
3600
|
+
db.createObjectStore("info");
|
|
3601
|
+
};
|
|
3602
|
+
request.onsuccess = () => {
|
|
3603
|
+
const db = request.result;
|
|
3604
|
+
const tx = db.transaction("info", "readwrite");
|
|
3605
|
+
const store = tx.objectStore("info");
|
|
3606
|
+
store.put(id, "deviceId");
|
|
3607
|
+
tx.oncomplete = () => resolve();
|
|
3608
|
+
tx.onerror = () => resolve();
|
|
3609
|
+
};
|
|
3610
|
+
request.onerror = () => resolve();
|
|
3611
|
+
});
|
|
3612
|
+
}
|
|
3613
|
+
async function getBrowserDeviceInfo() {
|
|
3614
|
+
let deviceId;
|
|
3615
|
+
try {
|
|
3616
|
+
const { load: load2 } = await Promise.resolve().then(() => (init_fp_esm(), fp_esm_exports));
|
|
3617
|
+
const fp = await load2();
|
|
3618
|
+
const result = await fp.get();
|
|
3619
|
+
deviceId = result.visitorId;
|
|
3620
|
+
} catch {
|
|
3621
|
+
let id = await getDeviceIdFromIndexedDB();
|
|
3622
|
+
if (!id) {
|
|
3623
|
+
id = (0, import_uuid.v4)();
|
|
3624
|
+
await setDeviceIdToIndexedDB(id);
|
|
3625
|
+
}
|
|
3626
|
+
deviceId = id;
|
|
3627
|
+
}
|
|
3628
|
+
const deviceName = (() => {
|
|
3629
|
+
const platform = navigator.platform || "unknown";
|
|
3630
|
+
const width = screen.width || 0;
|
|
3631
|
+
const height = screen.height || 0;
|
|
3632
|
+
const colorDepth = screen.colorDepth || 24;
|
|
3633
|
+
return `${platform}-${width}x${height}x${colorDepth}`;
|
|
3634
|
+
})();
|
|
3635
|
+
return {
|
|
3636
|
+
deviceId,
|
|
3637
|
+
deviceName,
|
|
3638
|
+
env: "browser"
|
|
3639
|
+
};
|
|
3640
|
+
}
|
|
3641
|
+
async function getNodeDeviceInfo() {
|
|
3642
|
+
const os = await import("os");
|
|
3643
|
+
const machine = await import("node-machine-id");
|
|
3644
|
+
const machineIdSync = machine.machineIdSync || machine.default?.machineIdSync;
|
|
3645
|
+
if (typeof machineIdSync !== "function") {
|
|
3646
|
+
throw new Error("node-machine-id: machineIdSync not found");
|
|
3647
|
+
}
|
|
3648
|
+
const id = machineIdSync(true);
|
|
3649
|
+
return {
|
|
3650
|
+
deviceId: id,
|
|
3651
|
+
deviceName: os.hostname(),
|
|
3652
|
+
env: "node"
|
|
3653
|
+
};
|
|
3654
|
+
}
|
|
3655
|
+
async function getDeviceInfo() {
|
|
3656
|
+
const isBrowser2 = typeof window !== "undefined" && typeof navigator !== "undefined" && typeof screen !== "undefined";
|
|
3657
|
+
return isBrowser2 ? getBrowserDeviceInfo() : getNodeDeviceInfo();
|
|
3658
|
+
}
|
|
3659
|
+
|
|
3660
|
+
// src/core/executor.ts
|
|
3661
|
+
async function execute(payload) {
|
|
3662
|
+
const client2 = getClient();
|
|
3663
|
+
return client2.request(payload.query, payload.variables);
|
|
3664
|
+
}
|
|
3665
|
+
|
|
3666
|
+
// src/builders/baseType.ts
|
|
3667
|
+
function buildWhere(where) {
|
|
3668
|
+
if (!where) return "";
|
|
3669
|
+
const parts = [];
|
|
3670
|
+
for (const key in where) {
|
|
3671
|
+
const value = where[key];
|
|
3672
|
+
if (key === "_and" || key === "_or") {
|
|
3673
|
+
const sub = value.map((w) => `{ ${buildWhere(w)} }`).filter(Boolean).join(", ");
|
|
3674
|
+
if (sub) parts.push(`${key}: [${sub}]`);
|
|
3675
|
+
} else if (key === "_not") {
|
|
3676
|
+
const sub = buildWhere(value);
|
|
3677
|
+
if (sub) parts.push(`${key}: { ${sub} }`);
|
|
3678
|
+
} else if (typeof value === "object" && value !== null) {
|
|
3679
|
+
const conds = Object.entries(value).map(([op, val]) => {
|
|
3680
|
+
if (typeof val === "string" && val.startsWith("$")) return `${op}: ${val}`;
|
|
3681
|
+
return `${op}: ${JSON.stringify(String(val))}`;
|
|
3682
|
+
}).join(", ");
|
|
3683
|
+
parts.push(`${key}: { ${conds} }`);
|
|
3684
|
+
} else {
|
|
3685
|
+
if (typeof value === "string" && value.startsWith("$")) {
|
|
3686
|
+
parts.push(`${key}: ${value}`);
|
|
3687
|
+
} else {
|
|
3688
|
+
parts.push(`${key}: ${JSON.stringify(String(value))}`);
|
|
3689
|
+
}
|
|
3690
|
+
}
|
|
3691
|
+
}
|
|
3692
|
+
return parts.join(", ");
|
|
3693
|
+
}
|
|
3694
|
+
function buildFields(fields) {
|
|
3695
|
+
return fields.map((f) => {
|
|
3696
|
+
if (typeof f === "string") return f;
|
|
3697
|
+
const [key, node] = Object.entries(f)[0];
|
|
3698
|
+
const args = [];
|
|
3699
|
+
if (node.where) args.push(`where: { ${buildWhere(node.where)} }`);
|
|
3700
|
+
if (node.distinctOn) args.push(`distinct_on: [${node.distinctOn.map((s) => `${s}`).join(" ")}]`);
|
|
3701
|
+
if (node.orderBy)
|
|
3702
|
+
args.push(
|
|
3703
|
+
`order_by: {${Object.entries(node.orderBy).map(([k, v]) => `${k}: ${v}`).join(" ")}}`
|
|
3704
|
+
);
|
|
3705
|
+
if (node.limit !== void 0) args.push(`limit: ${node.limit}`);
|
|
3706
|
+
if (node.offset !== void 0) args.push(`offset: ${node.offset}`);
|
|
3707
|
+
const argsStr = args.length ? `(${args.join(" ")})` : "";
|
|
3708
|
+
return `${key}${argsStr} { ${buildFields(node.fields)} }`;
|
|
3709
|
+
}).join(" ");
|
|
3710
|
+
}
|
|
3711
|
+
function buildMutationFields(fields) {
|
|
3712
|
+
return `affected_rows returning { ${buildFields(fields)} }`;
|
|
3713
|
+
}
|
|
3714
|
+
function buildDataValue(data) {
|
|
3715
|
+
const parts = [];
|
|
3716
|
+
for (const key in data) {
|
|
3717
|
+
const value = data[key];
|
|
3718
|
+
if (value === null || value === void 0) continue;
|
|
3719
|
+
if (typeof value === "string" && value.startsWith("$")) {
|
|
3720
|
+
parts.push(`${key}: ${value}`);
|
|
3721
|
+
} else if (typeof value === "object" && !Array.isArray(value) && value.constructor === Object) {
|
|
3722
|
+
parts.push(`${key}: { ${buildDataValue(value)} }`);
|
|
3723
|
+
} else if (Array.isArray(value)) {
|
|
3724
|
+
const arrStr = value.map((v) => {
|
|
3725
|
+
if (typeof v === "string" && v.startsWith("$")) return v;
|
|
3726
|
+
if (typeof v === "object" && v !== null && v.constructor === Object) {
|
|
3727
|
+
return `{ ${buildDataValue(v)} }`;
|
|
3728
|
+
}
|
|
3729
|
+
return formatGraphQLValue(v);
|
|
3730
|
+
}).join(" ");
|
|
3731
|
+
parts.push(`${key}: [${arrStr}]`);
|
|
3732
|
+
} else {
|
|
3733
|
+
parts.push(`${key}: ${formatGraphQLValue(value)}`);
|
|
3734
|
+
}
|
|
3735
|
+
}
|
|
3736
|
+
return parts.join(" ");
|
|
3737
|
+
}
|
|
3738
|
+
function formatGraphQLValue(value) {
|
|
3739
|
+
if (value === null) return "null";
|
|
3740
|
+
if (typeof value === "string") {
|
|
3741
|
+
return JSON.stringify(value);
|
|
3742
|
+
}
|
|
3743
|
+
if (typeof value === "number" || typeof value === "boolean") {
|
|
3744
|
+
return String(value);
|
|
3745
|
+
}
|
|
3746
|
+
return JSON.stringify(value);
|
|
3747
|
+
}
|
|
3748
|
+
function toPascalCase(str) {
|
|
3749
|
+
const camel = str.replace(/[-_ ]+(\w)/g, (_, c) => c ? c.toUpperCase() : "").replace(/^\w/, (c) => c.toLowerCase());
|
|
3750
|
+
return camel.charAt(0).toUpperCase() + camel.slice(1);
|
|
3751
|
+
}
|
|
3752
|
+
function buildCommonResultSelection(dataFields) {
|
|
3753
|
+
if (dataFields && dataFields.length > 0) {
|
|
3754
|
+
return `success code message data { ${buildFields(dataFields)} }`;
|
|
3755
|
+
}
|
|
3756
|
+
return `success code message data`;
|
|
3757
|
+
}
|
|
3758
|
+
|
|
3759
|
+
// src/builders/query.ts
|
|
3760
|
+
function buildGraphQLQueryList(input) {
|
|
3761
|
+
const { operationName, fields, variables, where, orderBy, distinctOn, limit, offset } = input;
|
|
3762
|
+
const varDefs = variables ? Object.keys(variables).map((k) => `$${k}: String!`).join(", ") : "";
|
|
3763
|
+
const topArgs = [];
|
|
3764
|
+
if (where) topArgs.push(`where: { ${buildWhere(where)} }`);
|
|
3765
|
+
if (distinctOn) topArgs.push(`distinct_on: [${distinctOn.map((s) => `${s}`).join(" ")}]`);
|
|
3766
|
+
if (orderBy)
|
|
3767
|
+
topArgs.push(
|
|
3768
|
+
`order_by: {${Object.entries(orderBy).map(([k, v]) => `${k}: ${v}`).join(" ")}}`
|
|
3769
|
+
);
|
|
3770
|
+
if (limit !== void 0) topArgs.push(`limit: ${limit}`);
|
|
3771
|
+
if (offset !== void 0) topArgs.push(`offset: ${offset}`);
|
|
3772
|
+
const topArgsStr = topArgs.length ? `(${topArgs.join(" ")})` : "";
|
|
3773
|
+
const query2 = `query ${operationName}${varDefs ? `(${varDefs})` : ""} { ${operationName}${topArgsStr} ${fields ? "{" + buildFields(fields) + "}" : ""} }`;
|
|
3774
|
+
return { query: query2, variables };
|
|
3775
|
+
}
|
|
3776
|
+
function buildGraphQLQueryByIdFixed(queryByIdInput) {
|
|
3777
|
+
const { pk, fields, operationName } = queryByIdInput;
|
|
3778
|
+
const variables = { id: pk };
|
|
3779
|
+
const query2 = `query ${operationName + "_by_pk"}($id: Long!) {
|
|
3780
|
+
${operationName + "_by_pk"}(id: $id) {
|
|
3781
|
+
${buildFields(fields)}
|
|
3782
|
+
}
|
|
3783
|
+
}`;
|
|
3784
|
+
return { query: query2, variables };
|
|
3785
|
+
}
|
|
3786
|
+
function buildGraphQLQueryPageList(input) {
|
|
3787
|
+
const { operationName, fields, variables, where, orderBy, distinctOn, page, size } = input;
|
|
3788
|
+
const varDefs = variables ? Object.keys(variables).map((k) => `$${k}: String!`).join(", ") : "";
|
|
3789
|
+
const topArgs = [];
|
|
3790
|
+
if (where) topArgs.push(`where: { ${buildWhere(where)} }`);
|
|
3791
|
+
if (distinctOn) topArgs.push(`distinct_on: [${distinctOn.map((s) => `${s}`).join(" ")}]`);
|
|
3792
|
+
if (orderBy)
|
|
3793
|
+
topArgs.push(
|
|
3794
|
+
`order_by: {${Object.entries(orderBy).map(([k, v]) => `${k}: ${v}`).join(" ")}}`
|
|
3795
|
+
);
|
|
3796
|
+
if (size !== void 0) topArgs.push(`size: ${size}`);
|
|
3797
|
+
if (page !== void 0) topArgs.push(`page: ${page}`);
|
|
3798
|
+
const topArgsStr = topArgs.length ? `(${topArgs.join(" ")})` : "";
|
|
3799
|
+
const query2 = `query ${"get" + toPascalCase(operationName) + "PageList"}${varDefs ? `(${varDefs})` : ""} { ${"get" + toPascalCase(operationName) + "PageList"}${topArgsStr} { hasMore list{${buildFields(fields)}} page size total } }`;
|
|
3800
|
+
return { query: query2, variables };
|
|
3801
|
+
}
|
|
3802
|
+
function buildGraphQLQueryAggregate(input) {
|
|
3803
|
+
const { operationName, fields, aggregateFields, variables, where, distinctOn } = input;
|
|
3804
|
+
const varDefs = variables ? Object.keys(variables).map((k) => `$${k}: String!`).join(", ") : "";
|
|
3805
|
+
const topArgs = [];
|
|
3806
|
+
if (where) topArgs.push(`where: { ${buildWhere(where)} }`);
|
|
3807
|
+
if (distinctOn) topArgs.push(`distinct_on: [${distinctOn.map((s) => `${s}`).join(" ")}]`);
|
|
3808
|
+
const topArgsStr = topArgs.length ? `(${topArgs.join(" ")})` : "";
|
|
3809
|
+
const aggregateParts = [];
|
|
3810
|
+
if (aggregateFields) {
|
|
3811
|
+
if (aggregateFields.count) aggregateParts.push("count");
|
|
3812
|
+
["sum", "avg", "max", "min"].forEach((key) => {
|
|
3813
|
+
const fields2 = aggregateFields[key];
|
|
3814
|
+
if (fields2 && fields2.length > 0) {
|
|
3815
|
+
aggregateParts.push(`${key} { ${fields2.join(" ")} }`);
|
|
3816
|
+
}
|
|
3817
|
+
});
|
|
3818
|
+
} else {
|
|
3819
|
+
aggregateParts.push("count");
|
|
3820
|
+
}
|
|
3821
|
+
const aggregateStr = aggregateParts.join(" ");
|
|
3822
|
+
const query2 = `
|
|
3823
|
+
query ${operationName + "_aggregateount"}${varDefs ? `(${varDefs})` : ""} {
|
|
3824
|
+
${operationName}_aggregateount${topArgsStr} {
|
|
3825
|
+
aggregate { ${aggregateStr} }
|
|
3826
|
+
nodes { ${buildFields(fields)} }
|
|
3827
|
+
}
|
|
3828
|
+
}
|
|
3829
|
+
`;
|
|
3830
|
+
return { query: query2, variables };
|
|
3831
|
+
}
|
|
3832
|
+
|
|
3833
|
+
// src/builders/mutation.ts
|
|
3834
|
+
function buildGraphQLMutationInsertOne(input) {
|
|
3835
|
+
const { operationName, fields, data, variables } = input;
|
|
3836
|
+
const entityName = operationName.toLowerCase();
|
|
3837
|
+
const varDefs = variables ? Object.keys(variables).map((k) => `$${k}: String!`).join(", ") : "";
|
|
3838
|
+
let dataArg;
|
|
3839
|
+
if (variables && variables.data) {
|
|
3840
|
+
dataArg = "$data";
|
|
3841
|
+
} else {
|
|
3842
|
+
dataArg = `{ ${buildDataValue(data)} }`;
|
|
3843
|
+
}
|
|
3844
|
+
const finalVariables = variables || {};
|
|
3845
|
+
if (!variables || !variables.data) {
|
|
3846
|
+
finalVariables.data = data;
|
|
3847
|
+
}
|
|
3848
|
+
const mutationName = `insert_${entityName}_one`;
|
|
3849
|
+
const query2 = `mutation ${mutationName}${varDefs ? `(${varDefs})` : ""} {
|
|
3850
|
+
${mutationName}(${operationName}: ${dataArg}) {
|
|
3851
|
+
${buildMutationFields(fields)}
|
|
3852
|
+
}
|
|
3853
|
+
}`;
|
|
3854
|
+
return { query: query2, variables: finalVariables };
|
|
3855
|
+
}
|
|
3856
|
+
function buildGraphQLMutationBatchInsert(input) {
|
|
3857
|
+
const { operationName, fields, datas, variables } = input;
|
|
3858
|
+
const entityName = operationName.toLowerCase();
|
|
3859
|
+
const varDefs = variables ? Object.keys(variables).map((k) => `$${k}: String!`).join(", ") : "";
|
|
3860
|
+
let datasArg;
|
|
3861
|
+
if (variables && variables.datas) {
|
|
3862
|
+
datasArg = "$datas";
|
|
3863
|
+
} else {
|
|
3864
|
+
const datasArr = datas.map((d) => `{ ${buildDataValue(d)} }`).join(" ");
|
|
3865
|
+
datasArg = `[${datasArr}]`;
|
|
3866
|
+
}
|
|
3867
|
+
const finalVariables = variables || {};
|
|
3868
|
+
if (!variables || !variables.datas) {
|
|
3869
|
+
finalVariables.datas = datas;
|
|
3870
|
+
}
|
|
3871
|
+
const mutationName = `insert_${entityName}s`;
|
|
3872
|
+
const query2 = `mutation ${mutationName}${varDefs ? `(${varDefs})` : ""} {
|
|
3873
|
+
${mutationName}(${operationName}s: ${datasArg}) {
|
|
3874
|
+
affected_rows
|
|
3875
|
+
returning { ${buildFields(fields)} }
|
|
3876
|
+
}
|
|
3877
|
+
}`;
|
|
3878
|
+
return { query: query2, variables: finalVariables };
|
|
3879
|
+
}
|
|
3880
|
+
function buildGraphQLMutationUpdate(input) {
|
|
3881
|
+
const { operationName, fields, _set, where, variables } = input;
|
|
3882
|
+
const entityName = operationName.toLowerCase();
|
|
3883
|
+
const varDefs = variables ? Object.keys(variables).map((k) => `$${k}: String!`).join(", ") : "";
|
|
3884
|
+
const args = [];
|
|
3885
|
+
let setArg;
|
|
3886
|
+
if (variables && variables._set) {
|
|
3887
|
+
setArg = "$_set";
|
|
3888
|
+
} else {
|
|
3889
|
+
setArg = `{ ${buildDataValue(_set)} }`;
|
|
3890
|
+
}
|
|
3891
|
+
args.push(`_set: ${setArg}`);
|
|
3892
|
+
args.push(`where: { ${buildWhere(where)} }`);
|
|
3893
|
+
const finalVariables = variables || {};
|
|
3894
|
+
if (!variables || !variables._set) {
|
|
3895
|
+
finalVariables._set = _set;
|
|
3896
|
+
}
|
|
3897
|
+
const mutationName = `update_${entityName}`;
|
|
3898
|
+
const query2 = `mutation ${mutationName}${varDefs ? `(${varDefs})` : ""} {
|
|
3899
|
+
${mutationName}(${args.join(", ")}) {
|
|
3900
|
+
${buildMutationFields(fields)}
|
|
3901
|
+
}
|
|
3902
|
+
}`;
|
|
3903
|
+
return { query: query2, variables: finalVariables };
|
|
3904
|
+
}
|
|
3905
|
+
function buildGraphQLMutationBatchUpdate(input) {
|
|
3906
|
+
const { operationName, fields, _set, variables } = input;
|
|
3907
|
+
const entityName = operationName.toLowerCase();
|
|
3908
|
+
const varDefs = variables ? Object.keys(variables).map((k) => `$${k}: String!`).join(", ") : "";
|
|
3909
|
+
let setArg;
|
|
3910
|
+
if (variables && variables._set) {
|
|
3911
|
+
setArg = "$_set";
|
|
3912
|
+
} else {
|
|
3913
|
+
const setsArr = _set.map((s) => `{ ${buildDataValue(s)} }`).join(" ");
|
|
3914
|
+
setArg = `[${setsArr}]`;
|
|
3915
|
+
}
|
|
3916
|
+
const finalVariables = variables || {};
|
|
3917
|
+
if (!variables || !variables._set) {
|
|
3918
|
+
finalVariables._set = _set;
|
|
3919
|
+
}
|
|
3920
|
+
const mutationName = `update_${entityName}_many`;
|
|
3921
|
+
const query2 = `mutation ${mutationName}${varDefs ? `(${varDefs})` : ""} {
|
|
3922
|
+
${mutationName}(_set: ${setArg}) {
|
|
3923
|
+
affected_rows
|
|
3924
|
+
returning { ${buildFields(fields)} }
|
|
3925
|
+
}
|
|
3926
|
+
}`;
|
|
3927
|
+
return { query: query2, variables: finalVariables };
|
|
3928
|
+
}
|
|
3929
|
+
function buildGraphQLMutationUpdateByPk(input) {
|
|
3930
|
+
const { operationName, fields, _set, pk_columns, variables } = input;
|
|
3931
|
+
const entityName = operationName.toLowerCase();
|
|
3932
|
+
const varDefs = variables ? Object.keys(variables).map((k) => `$${k}: String!`).join(", ") : "";
|
|
3933
|
+
const args = [];
|
|
3934
|
+
let setArg;
|
|
3935
|
+
if (variables && variables._set) {
|
|
3936
|
+
setArg = "$_set";
|
|
3937
|
+
} else {
|
|
3938
|
+
setArg = `{ ${buildDataValue(_set)} }`;
|
|
3939
|
+
}
|
|
3940
|
+
args.push(`_set: ${setArg}`);
|
|
3941
|
+
args.push(`pk_columns: ${formatGraphQLValue(pk_columns)}`);
|
|
3942
|
+
const finalVariables = variables || {};
|
|
3943
|
+
if (!variables || !variables._set) {
|
|
3944
|
+
finalVariables._set = _set;
|
|
3945
|
+
}
|
|
3946
|
+
const mutationName = `update_${entityName}_by_pk`;
|
|
3947
|
+
const query2 = `mutation ${mutationName}${varDefs ? `(${varDefs})` : ""} {
|
|
3948
|
+
${mutationName}(${args.join(", ")}) {
|
|
3949
|
+
${buildMutationFields(fields)}
|
|
3950
|
+
}
|
|
3951
|
+
}`;
|
|
3952
|
+
return { query: query2, variables: finalVariables };
|
|
3953
|
+
}
|
|
3954
|
+
function buildGraphQLMutationDeleteById(input) {
|
|
3955
|
+
const { operationName, fields, pk_columns, variables } = input;
|
|
3956
|
+
const entityName = operationName.toLowerCase();
|
|
3957
|
+
const varDefs = variables ? Object.keys(variables).map((k) => `$${k}: String!`).join(", ") : "";
|
|
3958
|
+
const args = `pk_columns: ${formatGraphQLValue(pk_columns)}`;
|
|
3959
|
+
const mutationName = `delete_${entityName}_by_pk`;
|
|
3960
|
+
const query2 = `mutation ${mutationName}${varDefs ? `(${varDefs})` : ""} {
|
|
3961
|
+
${mutationName}(${args}) {
|
|
3962
|
+
${buildMutationFields(fields)}
|
|
3963
|
+
}
|
|
3964
|
+
}`;
|
|
3965
|
+
return { query: query2, variables: variables || {} };
|
|
3966
|
+
}
|
|
3967
|
+
function buildGraphQLMutationDelete(input) {
|
|
3968
|
+
const { operationName, fields, where, variables } = input;
|
|
3969
|
+
const entityName = operationName.toLowerCase();
|
|
3970
|
+
const varDefs = variables ? Object.keys(variables).map((k) => `$${k}: String!`).join(", ") : "";
|
|
3971
|
+
const args = `where: { ${buildWhere(where)} }`;
|
|
3972
|
+
const mutationName = `delete_${entityName}`;
|
|
3973
|
+
const query2 = `mutation ${mutationName}${varDefs ? `(${varDefs})` : ""} {
|
|
3974
|
+
${mutationName}(${args}) {
|
|
3975
|
+
affected_rows
|
|
3976
|
+
returning { ${buildFields(fields)} }
|
|
3977
|
+
}
|
|
3978
|
+
}`;
|
|
3979
|
+
return { query: query2, variables: variables || {} };
|
|
3980
|
+
}
|
|
3981
|
+
|
|
3982
|
+
// src/builders/sms.ts
|
|
3983
|
+
function buildGraphQLMutationSendCode(input) {
|
|
3984
|
+
const { phone } = input;
|
|
3985
|
+
const finalVariables = { ...input.variables || {} };
|
|
3986
|
+
if (finalVariables.phone === void 0) finalVariables.phone = phone;
|
|
3987
|
+
const varDefs = Object.keys(finalVariables).length ? Object.keys(finalVariables).map((k) => `$${k}: String!`).join(", ") : "";
|
|
3988
|
+
const selection = buildCommonResultSelection(input.dataFields);
|
|
3989
|
+
const query2 = `mutation sendCode${varDefs ? `(${varDefs})` : ""} {
|
|
3990
|
+
sendCode(phone: $phone) {
|
|
3991
|
+
${selection}
|
|
3992
|
+
}
|
|
3993
|
+
}`;
|
|
3994
|
+
return { query: query2, variables: finalVariables };
|
|
3995
|
+
}
|
|
3996
|
+
function buildGraphQLMutationVerifyCode(input) {
|
|
3997
|
+
const { code, phone } = input;
|
|
3998
|
+
const finalVariables = { ...input.variables || {} };
|
|
3999
|
+
if (finalVariables.code === void 0) finalVariables.code = code;
|
|
4000
|
+
if (finalVariables.phone === void 0) finalVariables.phone = phone;
|
|
4001
|
+
const varDefs = Object.keys(finalVariables).length ? Object.keys(finalVariables).map((k) => `$${k}: String!`).join(", ") : "";
|
|
4002
|
+
const query2 = `mutation verifyCode${varDefs ? `(${varDefs})` : ""} {
|
|
4003
|
+
verifyCode(code: $code, phone: $phone) {
|
|
4004
|
+
${buildCommonResultSelection()}
|
|
4005
|
+
}
|
|
4006
|
+
}`;
|
|
4007
|
+
return { query: query2, variables: finalVariables };
|
|
4008
|
+
}
|
|
4009
|
+
|
|
4010
|
+
// src/builders/auth.ts
|
|
4011
|
+
function buildGraphQLMutationLogin(input) {
|
|
4012
|
+
const fields = [
|
|
4013
|
+
"deviceId",
|
|
4014
|
+
"deviceName",
|
|
4015
|
+
"expireAt",
|
|
4016
|
+
"lastRefreshTime",
|
|
4017
|
+
"loginAccount",
|
|
4018
|
+
"loginTime",
|
|
4019
|
+
"permissions",
|
|
4020
|
+
"refreshExpireAt",
|
|
4021
|
+
"refreshToken",
|
|
4022
|
+
"requestIp",
|
|
4023
|
+
"roles",
|
|
4024
|
+
"token",
|
|
4025
|
+
"userAgent",
|
|
4026
|
+
"userId"
|
|
4027
|
+
];
|
|
4028
|
+
const { account, password, deviceId } = input;
|
|
4029
|
+
const finalVariables = { ...input.variables || {} };
|
|
4030
|
+
if (finalVariables.account === void 0) finalVariables.account = account;
|
|
4031
|
+
if (finalVariables.password === void 0) finalVariables.password = password;
|
|
4032
|
+
if (finalVariables.deviceId === void 0 && deviceId != void 0) finalVariables.deviceId = deviceId;
|
|
4033
|
+
const varDefs = Object.keys(finalVariables).length ? Object.keys(finalVariables).map((k) => `$${k}: String!`).join(", ") : "";
|
|
4034
|
+
const query2 = `mutation login${varDefs ? `(${varDefs})` : ""} {
|
|
4035
|
+
login(account: $account, password: $password ${deviceId ? ", deviceId: $deviceId" : ""}) {
|
|
4036
|
+
${buildFields(fields)}
|
|
4037
|
+
}
|
|
4038
|
+
}`;
|
|
4039
|
+
return { query: query2, variables: finalVariables };
|
|
4040
|
+
}
|
|
4041
|
+
function buildGraphQLMutationRegisterUser(input) {
|
|
4042
|
+
const { user, fields } = input;
|
|
4043
|
+
const finalVariables = { ...input.variables || {} };
|
|
4044
|
+
const useVar = finalVariables.user !== void 0;
|
|
4045
|
+
const varDefs = Object.keys(finalVariables).length ? Object.keys(finalVariables).map((k) => `$${k}: String!`).join(", ") : "";
|
|
4046
|
+
const userArg = useVar ? "$user" : `{ ${buildDataValue(user)} }`;
|
|
4047
|
+
const query2 = `mutation registerUser${varDefs ? `(${varDefs})` : ""} {
|
|
4048
|
+
registerUser(user: ${userArg}) {
|
|
4049
|
+
${buildFields(fields)}
|
|
4050
|
+
}
|
|
4051
|
+
}`;
|
|
4052
|
+
return { query: query2, variables: finalVariables };
|
|
4053
|
+
}
|
|
4054
|
+
function buildGraphQLMutationLogout(input = {}) {
|
|
4055
|
+
const finalVariables = { ...input.variables || {} };
|
|
4056
|
+
const varDefs = Object.keys(finalVariables).length ? Object.keys(finalVariables).map((k) => `$${k}: String!`).join(", ") : "";
|
|
4057
|
+
const query2 = `mutation logout${varDefs ? `(${varDefs})` : ""} {
|
|
4058
|
+
logout {
|
|
4059
|
+
${buildCommonResultSelection(input.dataFields)}
|
|
4060
|
+
}
|
|
4061
|
+
}`;
|
|
4062
|
+
return { query: query2, variables: finalVariables };
|
|
4063
|
+
}
|
|
4064
|
+
function buildGraphQLMutationLogoutAllDevices(input = {}) {
|
|
4065
|
+
const finalVariables = { ...input.variables || {} };
|
|
4066
|
+
const varDefs = Object.keys(finalVariables).length ? Object.keys(finalVariables).map((k) => `$${k}: String!`).join(", ") : "";
|
|
4067
|
+
const query2 = `mutation logoutAllDevices${varDefs ? `(${varDefs})` : ""} {
|
|
4068
|
+
logoutAllDevices {
|
|
4069
|
+
${buildCommonResultSelection(input.dataFields)}
|
|
4070
|
+
}
|
|
4071
|
+
}`;
|
|
4072
|
+
return { query: query2, variables: finalVariables };
|
|
4073
|
+
}
|
|
4074
|
+
function buildGraphQLMutationLogoutDevice(input) {
|
|
4075
|
+
const { deviceId } = input;
|
|
4076
|
+
const finalVariables = { ...input.variables || {} };
|
|
4077
|
+
if (finalVariables.deviceId === void 0) finalVariables.deviceId = deviceId;
|
|
4078
|
+
const varDefs = Object.keys(finalVariables).length ? Object.keys(finalVariables).map((k) => `$${k}: String!`).join(", ") : "";
|
|
4079
|
+
const query2 = `mutation logoutDevice${varDefs ? `(${varDefs})` : ""} {
|
|
4080
|
+
logoutDevice(deviceId: $deviceId) {
|
|
4081
|
+
${buildCommonResultSelection(input.dataFields)}
|
|
4082
|
+
}
|
|
4083
|
+
}`;
|
|
4084
|
+
return { query: query2, variables: finalVariables };
|
|
4085
|
+
}
|
|
4086
|
+
function buildGraphQLMutationRefreshToken(input) {
|
|
4087
|
+
const fields = [
|
|
4088
|
+
"deviceId",
|
|
4089
|
+
"deviceName",
|
|
4090
|
+
"expireAt",
|
|
4091
|
+
"lastRefreshTime",
|
|
4092
|
+
"loginAccount",
|
|
4093
|
+
"loginTime",
|
|
4094
|
+
"permissions",
|
|
4095
|
+
"refreshExpireAt",
|
|
4096
|
+
"refreshToken",
|
|
4097
|
+
"requestIp",
|
|
4098
|
+
"roles",
|
|
4099
|
+
"token",
|
|
4100
|
+
"userAgent",
|
|
4101
|
+
"userId"
|
|
4102
|
+
];
|
|
4103
|
+
const { refreshToken } = input;
|
|
4104
|
+
const finalVariables = { ...input.variables || {} };
|
|
4105
|
+
if (finalVariables.refreshToken === void 0) finalVariables.refreshToken = refreshToken;
|
|
4106
|
+
const varDefs = Object.keys(finalVariables).length ? Object.keys(finalVariables).map((k) => `$${k}: String!`).join(", ") : "";
|
|
4107
|
+
const query2 = `mutation refreshToken${varDefs ? `(${varDefs})` : ""} {
|
|
4108
|
+
refreshToken(refreshToken: $refreshToken) {
|
|
4109
|
+
${buildFields(fields)}
|
|
4110
|
+
}
|
|
4111
|
+
}`;
|
|
4112
|
+
return { query: query2, variables: finalVariables };
|
|
4113
|
+
}
|
|
4114
|
+
|
|
4115
|
+
// src/rateLimit/rateLimitConfig.ts
|
|
4116
|
+
var rateLimitConfig = {
|
|
4117
|
+
defaultRules: {
|
|
4118
|
+
query: { max: 10, window: 1, debounce: 0 },
|
|
4119
|
+
mutation: { max: 3, window: 1, debounce: 200 }
|
|
4120
|
+
},
|
|
4121
|
+
custom: {
|
|
4122
|
+
login: { max: 1, window: 5, debounce: 0 },
|
|
4123
|
+
refreshToken: { max: 2, window: 5, debounce: 0 }
|
|
4124
|
+
}
|
|
4125
|
+
};
|
|
4126
|
+
|
|
4127
|
+
// src/rateLimit/rateLimit.ts
|
|
4128
|
+
var trackers = /* @__PURE__ */ new Map();
|
|
4129
|
+
function getRule(operateName, type, config) {
|
|
4130
|
+
return config.custom?.[operateName] || config.defaultRules[type];
|
|
4131
|
+
}
|
|
4132
|
+
function rateLimit(operateName, type, fn, config = rateLimitConfig) {
|
|
4133
|
+
const rule = getRule(operateName, type, config);
|
|
4134
|
+
const now = Date.now();
|
|
4135
|
+
const key = `${type}::${operateName}`;
|
|
4136
|
+
if (!trackers.has(key)) trackers.set(key, { timestamps: [] });
|
|
4137
|
+
const tracker = trackers.get(key);
|
|
4138
|
+
tracker.timestamps = tracker.timestamps.filter((ts) => now - ts < rule.window * 1e3);
|
|
4139
|
+
return new Promise((resolve, reject) => {
|
|
4140
|
+
const exec = () => {
|
|
4141
|
+
if (tracker.timestamps.length >= rule.max) {
|
|
4142
|
+
return reject(new Error(`Rate limit exceeded for ${operateName}`));
|
|
4143
|
+
}
|
|
4144
|
+
tracker.timestamps.push(Date.now());
|
|
4145
|
+
fn().then(resolve).catch(reject);
|
|
4146
|
+
};
|
|
4147
|
+
if (rule.debounce > 0) {
|
|
4148
|
+
if (tracker.timeout) clearTimeout(tracker.timeout);
|
|
4149
|
+
tracker.timeout = setTimeout(exec, rule.debounce);
|
|
4150
|
+
} else {
|
|
4151
|
+
exec();
|
|
4152
|
+
}
|
|
4153
|
+
});
|
|
4154
|
+
}
|
|
4155
|
+
|
|
4156
|
+
// src/cache/memoryCache.ts
|
|
4157
|
+
var DEFAULT_TTL = 5 * 60 * 1e3;
|
|
4158
|
+
var cache = /* @__PURE__ */ new Map();
|
|
4159
|
+
function getCacheKey(key, variables) {
|
|
4160
|
+
return variables ? `${key}::${JSON.stringify(variables)}` : key;
|
|
4161
|
+
}
|
|
4162
|
+
function getFromCache(key) {
|
|
4163
|
+
const item = cache.get(key);
|
|
4164
|
+
if (!item) return null;
|
|
4165
|
+
if (Date.now() > item.expire) {
|
|
4166
|
+
cache.delete(key);
|
|
4167
|
+
return null;
|
|
4168
|
+
}
|
|
4169
|
+
return item.data;
|
|
4170
|
+
}
|
|
4171
|
+
function setCache(key, data, ttl = DEFAULT_TTL) {
|
|
4172
|
+
cache.set(key, { data, expire: Date.now() + ttl });
|
|
4173
|
+
}
|
|
4174
|
+
function clearCache() {
|
|
4175
|
+
cache.clear();
|
|
4176
|
+
}
|
|
4177
|
+
|
|
4178
|
+
// src/core/api/auth.ts
|
|
4179
|
+
var auth = {
|
|
4180
|
+
async login(input) {
|
|
4181
|
+
return rateLimit("login", "mutation", async () => {
|
|
4182
|
+
const { query: query2, variables } = buildGraphQLMutationLogin(input);
|
|
4183
|
+
const result = await execute({ query: query2, variables });
|
|
4184
|
+
setLoginInfo(result.login, input.remember);
|
|
4185
|
+
clearCache();
|
|
4186
|
+
return result;
|
|
4187
|
+
}, rateLimitConfig);
|
|
4188
|
+
},
|
|
4189
|
+
async refreshToken(input) {
|
|
4190
|
+
return rateLimit("refreshToken", "mutation", async () => {
|
|
4191
|
+
const { query: query2, variables } = buildGraphQLMutationRefreshToken(input);
|
|
4192
|
+
const result = await execute({ query: query2, variables });
|
|
4193
|
+
setLoginInfo(result.refreshToken, input.remember);
|
|
4194
|
+
clearCache();
|
|
4195
|
+
return result;
|
|
4196
|
+
}, rateLimitConfig);
|
|
4197
|
+
},
|
|
4198
|
+
async register(input) {
|
|
4199
|
+
return rateLimit("registerUser", "mutation", async () => {
|
|
4200
|
+
const { query: query2, variables } = buildGraphQLMutationRegisterUser(input);
|
|
4201
|
+
const result = await execute({ query: query2, variables });
|
|
4202
|
+
clearCache();
|
|
4203
|
+
return result;
|
|
4204
|
+
}, rateLimitConfig);
|
|
4205
|
+
},
|
|
4206
|
+
async logout() {
|
|
4207
|
+
return rateLimit("logout", "mutation", async () => {
|
|
4208
|
+
const { query: query2, variables } = buildGraphQLMutationLogout();
|
|
4209
|
+
const result = await execute({ query: query2, variables });
|
|
4210
|
+
removeLoginInfo();
|
|
4211
|
+
clearCache();
|
|
4212
|
+
return result;
|
|
4213
|
+
}, rateLimitConfig);
|
|
4214
|
+
},
|
|
4215
|
+
async logoutAllDevices() {
|
|
4216
|
+
return rateLimit("logoutAllDevices", "mutation", async () => {
|
|
4217
|
+
const { query: query2, variables } = buildGraphQLMutationLogoutAllDevices();
|
|
4218
|
+
const result = await execute({ query: query2, variables });
|
|
4219
|
+
removeLoginInfo();
|
|
4220
|
+
clearCache();
|
|
4221
|
+
return result;
|
|
4222
|
+
}, rateLimitConfig);
|
|
4223
|
+
},
|
|
4224
|
+
async logoutDevice(deviceId) {
|
|
4225
|
+
return rateLimit("logoutDevice", "mutation", async () => {
|
|
4226
|
+
const { query: query2, variables } = buildGraphQLMutationLogoutDevice({ deviceId });
|
|
4227
|
+
const result = await execute({ query: query2, variables });
|
|
4228
|
+
if (getLoginInfo()?.deviceId == deviceId) {
|
|
4229
|
+
removeLoginInfo();
|
|
4230
|
+
}
|
|
4231
|
+
clearCache();
|
|
4232
|
+
return result;
|
|
4233
|
+
}, rateLimitConfig);
|
|
4234
|
+
}
|
|
4235
|
+
};
|
|
4236
|
+
|
|
4237
|
+
// src/core/core.ts
|
|
4238
|
+
var import_fs = __toESM(require("fs"), 1);
|
|
4239
|
+
var import_path = __toESM(require("path"), 1);
|
|
4240
|
+
var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined";
|
|
4241
|
+
var isNode2 = typeof process !== "undefined" && process.versions?.node != null;
|
|
4242
|
+
var NODE_LOGIN_FILE = import_path.default.resolve(process.cwd(), "loginInfo.json");
|
|
4243
|
+
var STORAGE_KEY = "GRAPHQL_LOGIN_INFO";
|
|
4244
|
+
var nodeLoginInfo = null;
|
|
4245
|
+
var CCRequest = class {
|
|
4246
|
+
constructor(config) {
|
|
4247
|
+
this.config = config;
|
|
4248
|
+
this.interceptors = [];
|
|
4249
|
+
this.deviceInfoPromise = getDeviceInfo();
|
|
4250
|
+
this.headers = this.buildHeaders(config);
|
|
4251
|
+
const loginInfo = this.loadLoginInfo();
|
|
4252
|
+
if (loginInfo?.token) this.setToken(loginInfo.token);
|
|
4253
|
+
this.buildClient();
|
|
4254
|
+
}
|
|
4255
|
+
/** 注册一个拦截器(支持多个) */
|
|
4256
|
+
use(interceptor) {
|
|
4257
|
+
this.interceptors.push(interceptor);
|
|
4258
|
+
}
|
|
4259
|
+
/** 构建 GraphQLClient 实例 */
|
|
4260
|
+
buildClient() {
|
|
4261
|
+
this.client = new import_graphql_request.GraphQLClient(this.config.endpoint || "/graphql", {
|
|
4262
|
+
headers: this.headers
|
|
4263
|
+
});
|
|
4264
|
+
}
|
|
4265
|
+
/** 构建初始 headers */
|
|
4266
|
+
buildHeaders(config) {
|
|
4267
|
+
const headers = {
|
|
4268
|
+
"Content-Type": "application/json",
|
|
4269
|
+
...config.headers
|
|
4270
|
+
};
|
|
4271
|
+
if (config.Authorization) {
|
|
4272
|
+
headers.Authorization = `Bearer ${config.Authorization}`;
|
|
4273
|
+
}
|
|
4274
|
+
return headers;
|
|
4275
|
+
}
|
|
4276
|
+
// ===== Token 管理 =====
|
|
4277
|
+
setToken(token) {
|
|
4278
|
+
this.config.Authorization = token;
|
|
4279
|
+
this.headers.Authorization = `Bearer ${token}`;
|
|
4280
|
+
this.buildClient();
|
|
4281
|
+
}
|
|
4282
|
+
removeToken() {
|
|
4283
|
+
this.config.Authorization = void 0;
|
|
4284
|
+
delete this.headers.Authorization;
|
|
4285
|
+
this.buildClient();
|
|
4286
|
+
}
|
|
4287
|
+
// ===== LoginInfo 管理 =====
|
|
4288
|
+
setLoginInfo(loginInfo, remember = false) {
|
|
4289
|
+
this.config.loginInfo = loginInfo;
|
|
4290
|
+
if (loginInfo.token) this.setToken(loginInfo.token);
|
|
4291
|
+
if (isBrowser) {
|
|
4292
|
+
const storage = remember ? localStorage : sessionStorage;
|
|
4293
|
+
storage.setItem(STORAGE_KEY, JSON.stringify(loginInfo));
|
|
4294
|
+
} else if (isNode2) {
|
|
4295
|
+
nodeLoginInfo = loginInfo;
|
|
4296
|
+
try {
|
|
4297
|
+
import_fs.default.writeFileSync(NODE_LOGIN_FILE, JSON.stringify(loginInfo), "utf-8");
|
|
4298
|
+
} catch (err) {
|
|
4299
|
+
console.error("Failed to persist login info to file:", err);
|
|
4300
|
+
}
|
|
4301
|
+
}
|
|
4302
|
+
}
|
|
4303
|
+
/** 加载登录信息(含访问 token 和刷新 token 过期检查) */
|
|
4304
|
+
/** 加载登录信息(仅负责加载,不负责刷新) */
|
|
4305
|
+
loadLoginInfo() {
|
|
4306
|
+
let info = null;
|
|
4307
|
+
if (isBrowser) {
|
|
4308
|
+
const str = localStorage.getItem(STORAGE_KEY) || sessionStorage.getItem(STORAGE_KEY);
|
|
4309
|
+
if (str) {
|
|
4310
|
+
try {
|
|
4311
|
+
info = JSON.parse(str);
|
|
4312
|
+
} catch {
|
|
4313
|
+
info = null;
|
|
4314
|
+
}
|
|
4315
|
+
}
|
|
4316
|
+
} else if (isNode2) {
|
|
4317
|
+
if (nodeLoginInfo) return nodeLoginInfo;
|
|
4318
|
+
if (import_fs.default.existsSync(NODE_LOGIN_FILE)) {
|
|
4319
|
+
try {
|
|
4320
|
+
const raw = import_fs.default.readFileSync(NODE_LOGIN_FILE, "utf-8");
|
|
4321
|
+
info = JSON.parse(raw);
|
|
4322
|
+
} catch {
|
|
4323
|
+
info = null;
|
|
4324
|
+
}
|
|
4325
|
+
}
|
|
4326
|
+
}
|
|
4327
|
+
if (info) this.config.loginInfo = info;
|
|
4328
|
+
return info;
|
|
4329
|
+
}
|
|
4330
|
+
getLoginInfo() {
|
|
4331
|
+
if (this.config.loginInfo) return this.config.loginInfo;
|
|
4332
|
+
return this.loadLoginInfo();
|
|
4333
|
+
}
|
|
4334
|
+
removeLoginInfo() {
|
|
4335
|
+
delete this.config.loginInfo;
|
|
4336
|
+
if (isBrowser) {
|
|
4337
|
+
localStorage.removeItem(STORAGE_KEY);
|
|
4338
|
+
sessionStorage.removeItem(STORAGE_KEY);
|
|
4339
|
+
} else if (isNode2) {
|
|
4340
|
+
nodeLoginInfo = null;
|
|
4341
|
+
try {
|
|
4342
|
+
} catch {
|
|
4343
|
+
}
|
|
4344
|
+
}
|
|
4345
|
+
this.removeToken();
|
|
4346
|
+
}
|
|
4347
|
+
// ===== Endpoint & Header 管理 =====
|
|
4348
|
+
setEndpoint(endpoint) {
|
|
4349
|
+
this.config.endpoint = endpoint;
|
|
4350
|
+
this.buildClient();
|
|
4351
|
+
}
|
|
4352
|
+
setHeader(key, value) {
|
|
4353
|
+
this.headers[key] = value;
|
|
4354
|
+
}
|
|
4355
|
+
setHeaders(headers) {
|
|
4356
|
+
Object.assign(this.headers, headers);
|
|
4357
|
+
}
|
|
4358
|
+
removeHeader(key) {
|
|
4359
|
+
delete this.headers[key];
|
|
4360
|
+
}
|
|
4361
|
+
clearHeaders() {
|
|
4362
|
+
this.headers = { "Content-Type": "application/json" };
|
|
4363
|
+
}
|
|
4364
|
+
//无感刷新
|
|
4365
|
+
async ensureTokenValid() {
|
|
4366
|
+
const loginInfo = this.getLoginInfo();
|
|
4367
|
+
if (!loginInfo) return;
|
|
4368
|
+
const now = Date.now();
|
|
4369
|
+
const accessExpired = new Date(loginInfo.expireAt).getTime() <= now;
|
|
4370
|
+
const refreshExpired = new Date(loginInfo.refreshExpireAt).getTime() <= now;
|
|
4371
|
+
if (refreshExpired) {
|
|
4372
|
+
this.removeLoginInfo();
|
|
4373
|
+
throw new Error("Login expired. Please login again.");
|
|
4374
|
+
}
|
|
4375
|
+
if (accessExpired && !refreshExpired) {
|
|
4376
|
+
try {
|
|
4377
|
+
const refreshResult = await auth.refreshToken({
|
|
4378
|
+
refreshToken: loginInfo.refreshToken,
|
|
4379
|
+
remember: true
|
|
4380
|
+
});
|
|
4381
|
+
const newInfo = refreshResult.refreshToken ?? refreshResult;
|
|
4382
|
+
this.setLoginInfo(newInfo, true);
|
|
4383
|
+
} catch (err) {
|
|
4384
|
+
this.removeLoginInfo();
|
|
4385
|
+
throw new Error("Failed to refresh token. Please login again.");
|
|
4386
|
+
}
|
|
4387
|
+
}
|
|
4388
|
+
}
|
|
4389
|
+
// ===== 请求逻辑 =====
|
|
4390
|
+
async request(query2, variables) {
|
|
4391
|
+
let queryStr = typeof query2 === "string" ? query2 : print(query2);
|
|
4392
|
+
if (!/refreshToken/i.test(queryStr)) {
|
|
4393
|
+
await this.ensureTokenValid();
|
|
4394
|
+
}
|
|
4395
|
+
const { deviceId, deviceName } = await this.deviceInfoPromise;
|
|
4396
|
+
let headersWithDevice = Object.fromEntries(
|
|
4397
|
+
Object.entries({
|
|
4398
|
+
...this.headers,
|
|
4399
|
+
"X-Device-Id": deviceId,
|
|
4400
|
+
"X-Device-Name": deviceName
|
|
4401
|
+
}).filter(([_, v]) => v !== void 0)
|
|
4402
|
+
);
|
|
4403
|
+
for (const interceptor of this.interceptors) {
|
|
4404
|
+
if (interceptor.onRequest) {
|
|
4405
|
+
const result = await interceptor.onRequest({
|
|
4406
|
+
query: queryStr,
|
|
4407
|
+
variables,
|
|
4408
|
+
headers: headersWithDevice
|
|
4409
|
+
});
|
|
4410
|
+
queryStr = result.query;
|
|
4411
|
+
variables = result.variables;
|
|
4412
|
+
headersWithDevice = Object.fromEntries(
|
|
4413
|
+
Object.entries(result.headers).filter(([_, v]) => v !== void 0)
|
|
4414
|
+
);
|
|
4415
|
+
}
|
|
4416
|
+
}
|
|
4417
|
+
try {
|
|
4418
|
+
const res = await this.client.rawRequest(
|
|
4419
|
+
queryStr,
|
|
4420
|
+
variables,
|
|
4421
|
+
headersWithDevice
|
|
4422
|
+
);
|
|
4423
|
+
let data = res.data;
|
|
4424
|
+
for (const interceptor of this.interceptors) {
|
|
4425
|
+
if (interceptor.onResponse) {
|
|
4426
|
+
data = await interceptor.onResponse(data);
|
|
4427
|
+
}
|
|
4428
|
+
}
|
|
4429
|
+
return data;
|
|
4430
|
+
} catch (err) {
|
|
4431
|
+
const message = err.response?.errors?.[0]?.message ?? err.message;
|
|
4432
|
+
const status = err.response?.errors?.[0]?.extensions?.code ?? 500;
|
|
4433
|
+
const formattedError = {
|
|
4434
|
+
message,
|
|
4435
|
+
status,
|
|
4436
|
+
data: err.response?.data ?? null,
|
|
4437
|
+
errors: err.response?.errors ?? null,
|
|
4438
|
+
request: err.request
|
|
4439
|
+
};
|
|
4440
|
+
for (const interceptor of this.interceptors) {
|
|
4441
|
+
if (interceptor.onError) {
|
|
4442
|
+
await interceptor.onError(formattedError);
|
|
4443
|
+
}
|
|
4444
|
+
}
|
|
4445
|
+
throw formattedError;
|
|
4446
|
+
}
|
|
4447
|
+
}
|
|
4448
|
+
};
|
|
4449
|
+
|
|
4450
|
+
// src/core/client.ts
|
|
4451
|
+
var client = null;
|
|
4452
|
+
function initGraphQLClient(config) {
|
|
4453
|
+
client = new CCRequest(config);
|
|
4454
|
+
return client;
|
|
4455
|
+
}
|
|
4456
|
+
function getClient() {
|
|
4457
|
+
if (!client) throw new Error("GraphQL client not initialized. Call initGraphQLClient() first.");
|
|
4458
|
+
return client;
|
|
4459
|
+
}
|
|
4460
|
+
var useInterceptor = (interceptor) => getClient().use(interceptor);
|
|
4461
|
+
var setToken = (token) => getClient().setToken(token);
|
|
4462
|
+
var removeToken = () => getClient().removeToken();
|
|
4463
|
+
var setLoginInfo = (loginInfo, remember = false) => getClient().setLoginInfo(loginInfo, remember);
|
|
4464
|
+
var removeLoginInfo = () => getClient().removeLoginInfo();
|
|
4465
|
+
var getLoginInfo = () => getClient().getLoginInfo();
|
|
4466
|
+
var setEndpoint = (endpoint) => getClient().setEndpoint(endpoint);
|
|
4467
|
+
var setHeader = (key, value) => getClient().setHeader(key, value);
|
|
4468
|
+
var setHeaders = (headers) => getClient().setHeaders(headers);
|
|
4469
|
+
var removeHeader = (key) => getClient().removeHeader(key);
|
|
4470
|
+
var clearHeaders = () => getClient().clearHeaders();
|
|
4471
|
+
|
|
4472
|
+
// src/core/api/query.ts
|
|
4473
|
+
var query = {
|
|
4474
|
+
async list(input, useCache = true, ttl) {
|
|
4475
|
+
return rateLimit("list", "query", async () => {
|
|
4476
|
+
const { query: q, variables } = buildGraphQLQueryList(input);
|
|
4477
|
+
const key = getCacheKey(q, variables);
|
|
4478
|
+
if (useCache) {
|
|
4479
|
+
const cached = getFromCache(key);
|
|
4480
|
+
if (cached) return cached;
|
|
4481
|
+
}
|
|
4482
|
+
const result = await execute({ query: q, variables });
|
|
4483
|
+
if (useCache) setCache(key, result, ttl ?? DEFAULT_TTL);
|
|
4484
|
+
return result;
|
|
4485
|
+
});
|
|
4486
|
+
},
|
|
4487
|
+
async byId(input, useCache = true, ttl) {
|
|
4488
|
+
return rateLimit("byId", "query", async () => {
|
|
4489
|
+
const { query: q, variables } = buildGraphQLQueryByIdFixed(input);
|
|
4490
|
+
const key = getCacheKey(q, variables);
|
|
4491
|
+
if (useCache) {
|
|
4492
|
+
const cached = getFromCache(key);
|
|
4493
|
+
if (cached) return cached;
|
|
4494
|
+
}
|
|
4495
|
+
const result = await execute({ query: q, variables });
|
|
4496
|
+
if (useCache) setCache(key, result, ttl ?? DEFAULT_TTL);
|
|
4497
|
+
return result;
|
|
4498
|
+
});
|
|
4499
|
+
},
|
|
4500
|
+
async page(input, useCache = true, ttl) {
|
|
4501
|
+
return rateLimit("page", "query", async () => {
|
|
4502
|
+
const { query: q, variables } = buildGraphQLQueryPageList(input);
|
|
4503
|
+
const key = getCacheKey(q, variables);
|
|
4504
|
+
if (useCache) {
|
|
4505
|
+
const cached = getFromCache(key);
|
|
4506
|
+
if (cached) return cached;
|
|
4507
|
+
}
|
|
4508
|
+
const result = await execute({ query: q, variables });
|
|
4509
|
+
if (useCache) setCache(key, result, ttl ?? DEFAULT_TTL);
|
|
4510
|
+
return result;
|
|
4511
|
+
});
|
|
4512
|
+
},
|
|
4513
|
+
async aggregate(input, useCache = true, ttl) {
|
|
4514
|
+
return rateLimit("aggregate", "query", async () => {
|
|
4515
|
+
const { query: q, variables } = buildGraphQLQueryAggregate(input);
|
|
4516
|
+
const key = getCacheKey(q, variables);
|
|
4517
|
+
if (useCache) {
|
|
4518
|
+
const cached = getFromCache(key);
|
|
4519
|
+
if (cached) return cached;
|
|
4520
|
+
}
|
|
4521
|
+
const result = await execute({ query: q, variables });
|
|
4522
|
+
if (useCache) setCache(key, result, ttl ?? DEFAULT_TTL);
|
|
4523
|
+
return result;
|
|
4524
|
+
});
|
|
4525
|
+
}
|
|
4526
|
+
};
|
|
4527
|
+
|
|
4528
|
+
// src/core/api/mutation.ts
|
|
4529
|
+
var mutation = {
|
|
4530
|
+
async insertOne(input) {
|
|
4531
|
+
return rateLimit("insertOne", "mutation", async () => {
|
|
4532
|
+
const { query: query2, variables } = buildGraphQLMutationInsertOne(input);
|
|
4533
|
+
const result = await execute({ query: query2, variables });
|
|
4534
|
+
clearCache();
|
|
4535
|
+
return result;
|
|
4536
|
+
});
|
|
4537
|
+
},
|
|
4538
|
+
async batchInsert(input) {
|
|
4539
|
+
return rateLimit("batchInsert", "mutation", async () => {
|
|
4540
|
+
const { query: query2, variables } = buildGraphQLMutationBatchInsert(input);
|
|
4541
|
+
const result = await execute({ query: query2, variables });
|
|
4542
|
+
clearCache();
|
|
4543
|
+
return result;
|
|
4544
|
+
});
|
|
4545
|
+
},
|
|
4546
|
+
async update(input) {
|
|
4547
|
+
return rateLimit("update", "mutation", async () => {
|
|
4548
|
+
const { query: query2, variables } = buildGraphQLMutationUpdate(input);
|
|
4549
|
+
const result = await execute({ query: query2, variables });
|
|
4550
|
+
clearCache();
|
|
4551
|
+
return result;
|
|
4552
|
+
});
|
|
4553
|
+
},
|
|
4554
|
+
async batchUpdate(input) {
|
|
4555
|
+
return rateLimit("batchUpdate", "mutation", async () => {
|
|
4556
|
+
const { query: query2, variables } = buildGraphQLMutationBatchUpdate(input);
|
|
4557
|
+
const result = await execute({ query: query2, variables });
|
|
4558
|
+
clearCache();
|
|
4559
|
+
return result;
|
|
4560
|
+
});
|
|
4561
|
+
},
|
|
4562
|
+
async updateByPk(input) {
|
|
4563
|
+
return rateLimit("updateByPk", "mutation", async () => {
|
|
4564
|
+
const { query: query2, variables } = buildGraphQLMutationUpdateByPk(input);
|
|
4565
|
+
const result = await execute({ query: query2, variables });
|
|
4566
|
+
clearCache();
|
|
4567
|
+
return result;
|
|
4568
|
+
});
|
|
4569
|
+
},
|
|
4570
|
+
async delete(input) {
|
|
4571
|
+
return rateLimit("delete", "mutation", async () => {
|
|
4572
|
+
const { query: query2, variables } = buildGraphQLMutationDelete(input);
|
|
4573
|
+
const result = await execute({ query: query2, variables });
|
|
4574
|
+
clearCache();
|
|
4575
|
+
return result;
|
|
4576
|
+
});
|
|
4577
|
+
},
|
|
4578
|
+
async deleteById(input) {
|
|
4579
|
+
return rateLimit("deleteById", "mutation", async () => {
|
|
4580
|
+
const { query: query2, variables } = buildGraphQLMutationDeleteById(input);
|
|
4581
|
+
const result = await execute({ query: query2, variables });
|
|
4582
|
+
clearCache();
|
|
4583
|
+
return result;
|
|
4584
|
+
});
|
|
4585
|
+
}
|
|
4586
|
+
};
|
|
4587
|
+
|
|
4588
|
+
// src/core/api/sms.ts
|
|
4589
|
+
var sms = {
|
|
4590
|
+
async send(input) {
|
|
4591
|
+
const { query: query2, variables } = buildGraphQLMutationSendCode(input);
|
|
4592
|
+
return execute({ query: query2, variables });
|
|
4593
|
+
},
|
|
4594
|
+
async verify(input) {
|
|
4595
|
+
const { query: query2, variables } = buildGraphQLMutationVerifyCode(input);
|
|
4596
|
+
return execute({ query: query2, variables });
|
|
4597
|
+
}
|
|
4598
|
+
};
|
|
4599
|
+
|
|
4600
|
+
// src/core/api/gql.ts
|
|
4601
|
+
var gql = {
|
|
4602
|
+
/**
|
|
4603
|
+
* 执行任意 GraphQL 文本或 DocumentNode
|
|
4604
|
+
* @param query 原生 GQL 文本或 DocumentNode
|
|
4605
|
+
* @param variables 可选变量
|
|
4606
|
+
* @returns Promise<T>
|
|
4607
|
+
*/
|
|
4608
|
+
async execute(query2, variables) {
|
|
4609
|
+
return execute({ query: query2, variables });
|
|
4610
|
+
}
|
|
4611
|
+
};
|
|
4612
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
4613
|
+
0 && (module.exports = {
|
|
4614
|
+
auth,
|
|
4615
|
+
clearHeaders,
|
|
4616
|
+
getBrowserDeviceInfo,
|
|
4617
|
+
getClient,
|
|
4618
|
+
getDeviceInfo,
|
|
4619
|
+
gql,
|
|
4620
|
+
initGraphQLClient,
|
|
4621
|
+
mutation,
|
|
4622
|
+
query,
|
|
4623
|
+
removeHeader,
|
|
4624
|
+
removeToken,
|
|
4625
|
+
setEndpoint,
|
|
4626
|
+
setHeader,
|
|
4627
|
+
setHeaders,
|
|
4628
|
+
setToken,
|
|
4629
|
+
sms,
|
|
4630
|
+
useInterceptor
|
|
4631
|
+
});
|
|
4632
|
+
//# sourceMappingURL=index.cjs.map
|