@smart100/spu-web-plugin 0.0.15 → 0.0.17
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/dist/spu-web-plugin.mjs +6852 -359
- package/package.json +1 -1
- package/src/apaasSpuTrack.ts +194 -0
- package/src/components/expandexp/index.ts +57 -12
- package/src/components/expandexp/template.ts +4 -3
- package/src/install.ts +7 -47
- package/src/oss/downloadService.ts +43 -17
- package/src/package/apaas-track/apaas-spu/index.js +11 -0
- package/src/package/apaas-track/apaas-spu/index.mjs +4956 -0
- package/src/package/apaas-track/apaas-spu/index.umd.js +11 -0
- package/src/package/apaas-track/apaas-spu/lzma_worker.js +2668 -0
- package/src/storageProxy.ts +2 -0
- package/src/types/shims-lib.d.ts +3 -0
|
@@ -0,0 +1,4956 @@
|
|
|
1
|
+
function Ut() {
|
|
2
|
+
return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
|
|
3
|
+
}
|
|
4
|
+
function be() {
|
|
5
|
+
return Ut() + Ut() + "-" + Ut() + "-" + Ut() + "-" + Ut() + "-" + Ut() + Ut() + Ut();
|
|
6
|
+
}
|
|
7
|
+
function $s() {
|
|
8
|
+
return be().replace(/-/g, "").slice(0, 16);
|
|
9
|
+
}
|
|
10
|
+
function Js(n) {
|
|
11
|
+
let e = n > 0 ? new Date(n) : new Date(), s = e.getDate() < 10 ? "0" + e.getDate() : e.getDate(), r = e.getMonth() < 9 ? "0" + (e.getMonth() + 1) : e.getMonth() + 1, i = e.getFullYear(), a = e.getHours() < 10 ? "0" + e.getHours() : e.getHours(), u = e.getMinutes() < 10 ? "0" + e.getMinutes() : e.getMinutes(), l = e.getSeconds() < 10 ? "0" + e.getSeconds() : e.getSeconds(), w = e.getMilliseconds() < 10 ? "0" + e.getMilliseconds() : e.getMilliseconds();
|
|
12
|
+
return w < 100 && (w = "0" + w), {
|
|
13
|
+
time: +e,
|
|
14
|
+
year: i,
|
|
15
|
+
month: r,
|
|
16
|
+
day: s,
|
|
17
|
+
hour: a,
|
|
18
|
+
minute: u,
|
|
19
|
+
second: l,
|
|
20
|
+
millisecond: w
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function Gs(n) {
|
|
24
|
+
return Object.prototype.toString.call(n) === "[object Number]";
|
|
25
|
+
}
|
|
26
|
+
function Xs(n) {
|
|
27
|
+
return typeof n == "bigint";
|
|
28
|
+
}
|
|
29
|
+
function Je(n) {
|
|
30
|
+
return typeof n == "string";
|
|
31
|
+
}
|
|
32
|
+
function Et(n) {
|
|
33
|
+
return Object.prototype.toString.call(n) === "[object Array]";
|
|
34
|
+
}
|
|
35
|
+
function Gr(n) {
|
|
36
|
+
return typeof n == "boolean";
|
|
37
|
+
}
|
|
38
|
+
function Xr(n) {
|
|
39
|
+
return n === void 0;
|
|
40
|
+
}
|
|
41
|
+
function Wr(n) {
|
|
42
|
+
return n === null;
|
|
43
|
+
}
|
|
44
|
+
function qn(n) {
|
|
45
|
+
return typeof n == "symbol";
|
|
46
|
+
}
|
|
47
|
+
function Yt(n) {
|
|
48
|
+
return Object.prototype.toString.call(n) === "[object Object]" || !Gs(n) && !Xs(n) && !Je(n) && !Gr(n) && !Et(n) && !Wr(n) && !Ws(n) && !Xr(n) && !qn(n);
|
|
49
|
+
}
|
|
50
|
+
function Ws(n) {
|
|
51
|
+
return typeof n == "function";
|
|
52
|
+
}
|
|
53
|
+
function Qr(n) {
|
|
54
|
+
const e = Object.prototype.toString.call(n);
|
|
55
|
+
return e === "[object Window]" || e === "[object DOMWindow]" || e === "[object global]";
|
|
56
|
+
}
|
|
57
|
+
function Vr(n) {
|
|
58
|
+
return n == null || typeof n == "string" || typeof n == "boolean" || typeof n == "number" || typeof n == "function" || typeof n == "symbol" || typeof n == "bigint" ? !1 : typeof Symbol < "u" && typeof n[Symbol.iterator] == "function";
|
|
59
|
+
}
|
|
60
|
+
function Kr(n) {
|
|
61
|
+
return Object.prototype.toString.call(n).replace(/\[object (.*)\]/, "$1");
|
|
62
|
+
}
|
|
63
|
+
function Zr(n) {
|
|
64
|
+
let e = Object.prototype.hasOwnProperty;
|
|
65
|
+
if (!n || typeof n != "object" || n.nodeType || Qr(n))
|
|
66
|
+
return !1;
|
|
67
|
+
try {
|
|
68
|
+
if (n.constructor && !e.call(n, "constructor") && !e.call(n.constructor.prototype, "isPrototypeOf"))
|
|
69
|
+
return !1;
|
|
70
|
+
} catch {
|
|
71
|
+
return !1;
|
|
72
|
+
}
|
|
73
|
+
let s;
|
|
74
|
+
for (s in n)
|
|
75
|
+
;
|
|
76
|
+
return s === void 0 || e.call(n, s);
|
|
77
|
+
}
|
|
78
|
+
const Yr = /[\n\t]/g, ti = (n) => ({ "\n": "\\n", " ": "\\t" })[n];
|
|
79
|
+
function ei(n) {
|
|
80
|
+
return typeof n != "string" ? n : String(n).replace(
|
|
81
|
+
Yr,
|
|
82
|
+
ti
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
const ni = () => {
|
|
86
|
+
const n = /* @__PURE__ */ new WeakSet();
|
|
87
|
+
return (e) => {
|
|
88
|
+
if (typeof e == "object" && e !== null) {
|
|
89
|
+
if (n.has(e))
|
|
90
|
+
return !0;
|
|
91
|
+
n.add(e);
|
|
92
|
+
}
|
|
93
|
+
return !1;
|
|
94
|
+
};
|
|
95
|
+
}, _s = (n, e = 0) => {
|
|
96
|
+
let s = "";
|
|
97
|
+
return Je(n) ? (e > 0 && (n = Qs(n, e)), s += '"' + ei(n) + '"') : qn(n) ? s += String(n).replace(/^Symbol\((.*)\)$/i, 'Symbol("$1")') : Ws(n) ? s += (n.name || "function") + "()" : Xs(n) ? s += String(n) + "n" : s += String(n), s;
|
|
98
|
+
}, An = (n, e, s = 0) => {
|
|
99
|
+
var r, i;
|
|
100
|
+
if (!Yt(n) && !Et(n)) {
|
|
101
|
+
e.ret += _s(n, e.keyMaxLen);
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
if (e.circularFinder(n)) {
|
|
105
|
+
let f = "";
|
|
106
|
+
Et(n) ? f = "(Circular Array)" : Yt(n) && (f = `(Circular ${((r = n.constructor) == null ? void 0 : r.name) || "Object"})`), e.ret += e.standardJSON ? `"${f}"` : f;
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
let a = "", u = "";
|
|
110
|
+
if (e.pretty) {
|
|
111
|
+
for (let f = 0; f <= s; f++)
|
|
112
|
+
a += " ";
|
|
113
|
+
u = `
|
|
114
|
+
`;
|
|
115
|
+
}
|
|
116
|
+
let l = "{", w = "}";
|
|
117
|
+
Et(n) && (l = "[", w = "]"), e.ret += l + u;
|
|
118
|
+
const p = ri(n);
|
|
119
|
+
for (let f = 0; f < p.length; f++) {
|
|
120
|
+
const v = p[f];
|
|
121
|
+
e.ret += a;
|
|
122
|
+
try {
|
|
123
|
+
Et(n) || (Yt(v) || Et(v) || qn(v) ? e.ret += Object.prototype.toString.call(v) : Je(v) && e.standardJSON ? e.ret += '"' + v + '"' : e.ret += v, e.ret += ": ");
|
|
124
|
+
} catch {
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
try {
|
|
128
|
+
const h = n[v];
|
|
129
|
+
Et(h) ? e.maxDepth > -1 && s >= e.maxDepth ? e.ret += "Array(" + h.length + ")" : An(h, e, s + 1) : Yt(h) ? e.maxDepth > -1 && s >= e.maxDepth ? e.ret += (((i = h.constructor) == null ? void 0 : i.name) || "Object") + " {}" : An(h, e, s + 1) : e.ret += _s(h, e.keyMaxLen);
|
|
130
|
+
} catch {
|
|
131
|
+
e.ret += e.standardJSON ? '"(PARSE_ERROR)"' : "(PARSE_ERROR)";
|
|
132
|
+
}
|
|
133
|
+
if (e.keyMaxLen > 0 && e.ret.length >= e.keyMaxLen * 10) {
|
|
134
|
+
e.ret += ", (...)";
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
f < p.length - 1 && (e.ret += ", "), e.ret += u;
|
|
138
|
+
}
|
|
139
|
+
e.ret += a.substring(0, a.length - 2) + w;
|
|
140
|
+
};
|
|
141
|
+
function vs(n, e = {
|
|
142
|
+
maxDepth: -1,
|
|
143
|
+
keyMaxLen: -1,
|
|
144
|
+
pretty: !1,
|
|
145
|
+
standardJSON: !1
|
|
146
|
+
}) {
|
|
147
|
+
const s = Object.assign(
|
|
148
|
+
{
|
|
149
|
+
ret: "",
|
|
150
|
+
maxDepth: -1,
|
|
151
|
+
keyMaxLen: -1,
|
|
152
|
+
pretty: !1,
|
|
153
|
+
standardJSON: !1,
|
|
154
|
+
circularFinder: ni()
|
|
155
|
+
},
|
|
156
|
+
e
|
|
157
|
+
);
|
|
158
|
+
return An(n, s), s.ret;
|
|
159
|
+
}
|
|
160
|
+
function si(n) {
|
|
161
|
+
try {
|
|
162
|
+
return self.Blob ? new self.Blob([n], { type: "text/plain" }).size : encodeURI(n).split(/%(?:u[0-9A-F]{2})?[0-9A-F]{2}|./).length - 1;
|
|
163
|
+
} catch {
|
|
164
|
+
return 0;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
function je(n) {
|
|
168
|
+
return n <= 0 ? "" : n >= 1e3 * 1e3 ? (n / 1e3 / 1e3).toFixed(1) + " MB" : n >= 1e3 * 1 ? (n / 1e3).toFixed(1) + " KB" : n + " B";
|
|
169
|
+
}
|
|
170
|
+
function Qs(n, e) {
|
|
171
|
+
return n.length > e && (n = n.substring(0, e) + `...(${je(si(n))})`), n;
|
|
172
|
+
}
|
|
173
|
+
function ri(n) {
|
|
174
|
+
return !Yt(n) && !Et(n) ? [] : Object.keys(n);
|
|
175
|
+
}
|
|
176
|
+
function ii(n = [], e = 1024 * 1024) {
|
|
177
|
+
if (!n.length)
|
|
178
|
+
return [];
|
|
179
|
+
if (JSON.stringify(n).length <= e)
|
|
180
|
+
return [n];
|
|
181
|
+
let s = [], r = [], i = 0;
|
|
182
|
+
for (let a = 0; a < n.length; a++) {
|
|
183
|
+
const u = n[a], l = JSON.stringify(u).length;
|
|
184
|
+
i + l < e ? (r.push(u), i += l) : r.length ? (s.push(r), r = [u], i = l) : (s.push([u]), i = 0);
|
|
185
|
+
}
|
|
186
|
+
return s;
|
|
187
|
+
}
|
|
188
|
+
const ai = (n) => typeof n == "object" ? (n.config && n.request && (n.config = void 0, n.request = void 0), n.status !== void 0 ? n.data ? (n.detail = typeof n.data == "object" ? JSON.stringify(n.data) : n.data, n = new Error(n.detail)) : n.body ? (n.detail = typeof n.body == "object" ? JSON.stringify(n.body) : n.body, n = new Error(n.detail)) : (n.message = `${n.statusText || n.bodyText || ""}`, n = new Error(n.message)) : n = new Error(JSON.stringify(n)), n) : new Error(n), $n = (n) => {
|
|
189
|
+
var e;
|
|
190
|
+
let s = null;
|
|
191
|
+
n ? n && n instanceof Error ? s = n : s = ai(n) : (n = new Error("error"), s = n);
|
|
192
|
+
const r = {
|
|
193
|
+
message: "",
|
|
194
|
+
detail: "",
|
|
195
|
+
name: "",
|
|
196
|
+
stack: []
|
|
197
|
+
};
|
|
198
|
+
if (r.message = s.message, r.name = s.name, r.detail = ((e = s.stack) == null ? void 0 : e.toString()) || s.message, s.stack) {
|
|
199
|
+
let i = s.stack.split(/\n\s+at/);
|
|
200
|
+
i.length && (i = i.slice(1)), r.stack = i;
|
|
201
|
+
}
|
|
202
|
+
return r;
|
|
203
|
+
}, On = (n) => new Promise((e) => {
|
|
204
|
+
setTimeout(() => {
|
|
205
|
+
e(void 0), n && n();
|
|
206
|
+
}, 0);
|
|
207
|
+
}), we = () => {
|
|
208
|
+
if (typeof wx < "u" && !window) {
|
|
209
|
+
const n = getCurrentPages();
|
|
210
|
+
return n.length ? n[n.length - 1].route : "applaunch";
|
|
211
|
+
} else
|
|
212
|
+
return window.location.href;
|
|
213
|
+
};
|
|
214
|
+
var oi = Object.defineProperty, ci = (n, e, s) => e in n ? oi(n, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : n[e] = s, I = (n, e, s) => (ci(n, typeof e != "symbol" ? e + "" : e, s), s);
|
|
215
|
+
class ui {
|
|
216
|
+
constructor(e) {
|
|
217
|
+
I(this, "limit"), I(this, "runningSize"), I(this, "taskList"), this.limit = e, this.taskList = [], this.runningSize = 0;
|
|
218
|
+
}
|
|
219
|
+
addTask(e) {
|
|
220
|
+
this.taskList.push(e), this.run();
|
|
221
|
+
}
|
|
222
|
+
async run() {
|
|
223
|
+
for (; this.taskList.length && this.runningSize < this.limit; ) {
|
|
224
|
+
const e = this.taskList.shift();
|
|
225
|
+
e && (this.runningSize++, await e(), this.runningSize--, this.run());
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
var Vs = /* @__PURE__ */ ((n) => (n[n.NORMAL = 0] = "NORMAL", n[n.HIGH = 1] = "HIGH", n[n.EMERGEN = 2] = "EMERGEN", n))(Vs || {});
|
|
230
|
+
class at {
|
|
231
|
+
constructor(e, s, r) {
|
|
232
|
+
I(this, "_level", 0), this.apaasTrack = e, this.type = s, r && (this._level = r);
|
|
233
|
+
}
|
|
234
|
+
getProperties() {
|
|
235
|
+
return {};
|
|
236
|
+
}
|
|
237
|
+
setProperties(e) {
|
|
238
|
+
}
|
|
239
|
+
getEventLog(e) {
|
|
240
|
+
const s = e || Date.now();
|
|
241
|
+
return {
|
|
242
|
+
...this.apaasTrack.baseLog,
|
|
243
|
+
types: this.type,
|
|
244
|
+
logtime: String(s),
|
|
245
|
+
epochnanos: String(s) + "000000",
|
|
246
|
+
event: this.type,
|
|
247
|
+
properties: this.getProperties(),
|
|
248
|
+
url: we()
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
I(at, "eventOptions"), I(at, "initApaasTrackHook"), I(at, "startApaasTrackHook"), I(at, "destroyApaasTrackHook");
|
|
253
|
+
class hi extends at {
|
|
254
|
+
constructor(e) {
|
|
255
|
+
super(e, "init");
|
|
256
|
+
}
|
|
257
|
+
getProperties() {
|
|
258
|
+
const e = this.apaasTrack.baseLog;
|
|
259
|
+
return {
|
|
260
|
+
system: e.system || "",
|
|
261
|
+
systemver: e.systemver || "",
|
|
262
|
+
manufacturer: e.manufacturer || "",
|
|
263
|
+
browser: e.browser || "",
|
|
264
|
+
browserver: e.browserver || "",
|
|
265
|
+
terminalid: e.terminalid || "",
|
|
266
|
+
client: e.client || "",
|
|
267
|
+
clientver: e.clientver || ""
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
class li extends at {
|
|
272
|
+
constructor(e) {
|
|
273
|
+
super(e, "custom"), I(this, "info", {});
|
|
274
|
+
}
|
|
275
|
+
setCustomType(e) {
|
|
276
|
+
this.type = e;
|
|
277
|
+
}
|
|
278
|
+
getProperties() {
|
|
279
|
+
return {
|
|
280
|
+
...this.info
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
setProperties(e) {
|
|
284
|
+
this.info = e;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
const fe = {
|
|
288
|
+
init: hi,
|
|
289
|
+
custom: li
|
|
290
|
+
}, Ot = (n, e) => {
|
|
291
|
+
const s = fe[e];
|
|
292
|
+
return new s(n);
|
|
293
|
+
}, pi = (n, e, s) => {
|
|
294
|
+
const r = s || Date.now(), i = Ot(n, e);
|
|
295
|
+
return {
|
|
296
|
+
...n.baseLog,
|
|
297
|
+
types: e,
|
|
298
|
+
logtime: String(r),
|
|
299
|
+
epochnanos: String(r) + "000000",
|
|
300
|
+
event: e,
|
|
301
|
+
properties: i.getProperties(),
|
|
302
|
+
url: we()
|
|
303
|
+
};
|
|
304
|
+
}, bs = (n, e, s) => {
|
|
305
|
+
const r = s || Date.now();
|
|
306
|
+
return {
|
|
307
|
+
...n.baseLog,
|
|
308
|
+
types: e.type,
|
|
309
|
+
logtime: String(r),
|
|
310
|
+
epochnanos: String(r) + "000000",
|
|
311
|
+
event: e.type,
|
|
312
|
+
properties: e.getProperties(),
|
|
313
|
+
url: we()
|
|
314
|
+
};
|
|
315
|
+
}, Ks = (n, e) => {
|
|
316
|
+
if (fe[n])
|
|
317
|
+
throw Error(`\u8BE5\u4E8B\u4EF6${n} \u5DF2\u5B58\u5728\uFF0C\u6CE8\u518C\u5931\u8D25`);
|
|
318
|
+
fe[n] = e;
|
|
319
|
+
};
|
|
320
|
+
class di {
|
|
321
|
+
constructor(e, s) {
|
|
322
|
+
I(this, "name", ""), I(this, "time", 0), I(this, "info", {}), e && (this.name = e), s && (this.info = s), this.time = Date.now();
|
|
323
|
+
}
|
|
324
|
+
get epochnanos() {
|
|
325
|
+
return this.time * 1e6;
|
|
326
|
+
}
|
|
327
|
+
get attributes() {
|
|
328
|
+
return this.getAttributes();
|
|
329
|
+
}
|
|
330
|
+
getAttributes() {
|
|
331
|
+
return {};
|
|
332
|
+
}
|
|
333
|
+
getJson() {
|
|
334
|
+
return {
|
|
335
|
+
name: this.name,
|
|
336
|
+
epochnanos: this.time * 1e6,
|
|
337
|
+
attributes: this.getAttributes(),
|
|
338
|
+
...this.info
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
setInfo(e) {
|
|
342
|
+
this.info = e || {};
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
class mi extends di {
|
|
346
|
+
constructor() {
|
|
347
|
+
super(...arguments), I(this, "name", "exception"), I(this, "exceptionType", ""), I(this, "exceptionMessage", ""), I(this, "exceptionStackTrace", "");
|
|
348
|
+
}
|
|
349
|
+
getAttributes() {
|
|
350
|
+
return {
|
|
351
|
+
"exception.type": this.exceptionType,
|
|
352
|
+
"exception.message": this.exceptionMessage,
|
|
353
|
+
"exception.stacktrace": this.exceptionStackTrace
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
setInfo(e) {
|
|
357
|
+
this.exceptionMessage = e.exceptionMessage, this.exceptionType = e.exceptionType, this.exceptionStackTrace = e.exceptionStackTrace;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
class Jn extends at {
|
|
361
|
+
constructor(e, s, r) {
|
|
362
|
+
super(e, "span"), I(this, "spanid", ""), I(this, "traceid", ""), I(this, "parentspanid", ""), I(this, "name", ""), I(this, "attributes", {}), I(this, "events", []), I(this, "statuscode", "OK"), I(this, "statusmessage", ""), I(this, "startTime", 0), I(this, "endTime", 0), this.name = s, this.traceid = be(), this.spanid = $s(), this.parentspanid = r || "", this.start();
|
|
363
|
+
}
|
|
364
|
+
trackLog() {
|
|
365
|
+
this.apaasTrack.addLogByEvent(this);
|
|
366
|
+
}
|
|
367
|
+
createSpanEvent(e, s) {
|
|
368
|
+
return new Jn(
|
|
369
|
+
this.apaasTrack,
|
|
370
|
+
e,
|
|
371
|
+
s
|
|
372
|
+
);
|
|
373
|
+
}
|
|
374
|
+
setAttribute(e) {
|
|
375
|
+
const s = e.getAttributes();
|
|
376
|
+
this.attributes = s;
|
|
377
|
+
}
|
|
378
|
+
addEvent(e) {
|
|
379
|
+
this.events.push(e);
|
|
380
|
+
}
|
|
381
|
+
exception(e) {
|
|
382
|
+
const s = new mi();
|
|
383
|
+
let r = "", i = "", a = "";
|
|
384
|
+
if (e instanceof Error) {
|
|
385
|
+
const u = $n(e);
|
|
386
|
+
r = u.detail, i = u.name, a = u.stack.join(",");
|
|
387
|
+
} else
|
|
388
|
+
r = e.exceptionMessage, i = e.exceptionType, a = e.exceptionStackTrace;
|
|
389
|
+
s.setInfo({
|
|
390
|
+
exceptionMessage: r,
|
|
391
|
+
exceptionType: i,
|
|
392
|
+
exceptionStackTrace: a
|
|
393
|
+
}), this.events.push(s);
|
|
394
|
+
}
|
|
395
|
+
start() {
|
|
396
|
+
this.startTime = Date.now();
|
|
397
|
+
}
|
|
398
|
+
end(e, s) {
|
|
399
|
+
e && (this.statusmessage = e), s && (this.statuscode = s), this.endTime = Date.now();
|
|
400
|
+
}
|
|
401
|
+
getProperties() {
|
|
402
|
+
return {
|
|
403
|
+
traceid: this.traceid,
|
|
404
|
+
spanid: this.spanid,
|
|
405
|
+
parentspanid: this.parentspanid,
|
|
406
|
+
name: this.name,
|
|
407
|
+
attributes: this.attributes,
|
|
408
|
+
events: this.events.map((e) => e.getJson()),
|
|
409
|
+
statuscode: this.statuscode,
|
|
410
|
+
statusmessage: this.statusmessage,
|
|
411
|
+
startepochnanos: this.startTime * 1e6,
|
|
412
|
+
endepochnanos: this.endTime * 1e6,
|
|
413
|
+
duration: (this.endTime - this.startTime) * 1e6
|
|
414
|
+
};
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
const Ln = "1.0.17";
|
|
418
|
+
class hn {
|
|
419
|
+
constructor(e) {
|
|
420
|
+
I(this, "_version", Ln), I(this, "commonLog", null), I(this, "browserLog", null), I(this, "options"), this.options = e, typeof window < "u" && (window.__apaasTrackVersion__ = Ln), typeof wx < "u" && !window && (wx.__apaasTrackVersion__ = Ln), e.commonLog && this.initCommonLog(e.commonLog), this.runEventInitHooks();
|
|
421
|
+
}
|
|
422
|
+
registerEvent(e, s) {
|
|
423
|
+
Ks(e, s), s.initApaasTrackHook && s.initApaasTrackHook(this), s.startApaasTrackHook && s.startApaasTrackHook(this);
|
|
424
|
+
}
|
|
425
|
+
get groupid() {
|
|
426
|
+
var e;
|
|
427
|
+
return (e = this.browserLog) == null ? void 0 : e.distinctid;
|
|
428
|
+
}
|
|
429
|
+
runEventInitHooks() {
|
|
430
|
+
Object.values(fe).forEach(
|
|
431
|
+
(e) => {
|
|
432
|
+
e.initApaasTrackHook && e.initApaasTrackHook(this);
|
|
433
|
+
}
|
|
434
|
+
);
|
|
435
|
+
}
|
|
436
|
+
runEventStartHooks() {
|
|
437
|
+
Object.values(fe).forEach(
|
|
438
|
+
(e) => {
|
|
439
|
+
e.startApaasTrackHook && e.startApaasTrackHook(this);
|
|
440
|
+
}
|
|
441
|
+
);
|
|
442
|
+
}
|
|
443
|
+
runEventDestroyHooks() {
|
|
444
|
+
Object.values(fe).forEach(
|
|
445
|
+
(e) => {
|
|
446
|
+
e.destroyApaasTrackHook && e.destroyApaasTrackHook(this);
|
|
447
|
+
}
|
|
448
|
+
);
|
|
449
|
+
}
|
|
450
|
+
get anonymousid() {
|
|
451
|
+
var e;
|
|
452
|
+
return (e = this.browserLog) == null ? void 0 : e.anonymousid;
|
|
453
|
+
}
|
|
454
|
+
get distinctid() {
|
|
455
|
+
var e;
|
|
456
|
+
return (e = this.browserLog) == null ? void 0 : e.distinctid;
|
|
457
|
+
}
|
|
458
|
+
get baseLog() {
|
|
459
|
+
return {
|
|
460
|
+
...this.browserLog,
|
|
461
|
+
...this.commonLog
|
|
462
|
+
};
|
|
463
|
+
}
|
|
464
|
+
initCommonLog(e) {
|
|
465
|
+
this.commonLog = e;
|
|
466
|
+
}
|
|
467
|
+
createEventLog(e, s) {
|
|
468
|
+
return pi(this, e, s);
|
|
469
|
+
}
|
|
470
|
+
addLogByType(e, s) {
|
|
471
|
+
const r = this.createEventLog(e, s);
|
|
472
|
+
this.addLogToQueue(r);
|
|
473
|
+
}
|
|
474
|
+
addLogByEvent(e, s) {
|
|
475
|
+
const r = bs(this, e, s);
|
|
476
|
+
this.addLogToQueue(r);
|
|
477
|
+
}
|
|
478
|
+
createCustomEvent(e) {
|
|
479
|
+
const s = Ot(this, "custom");
|
|
480
|
+
return s.setCustomType(e), s;
|
|
481
|
+
}
|
|
482
|
+
createSpanEvent(e, s) {
|
|
483
|
+
return new Jn(this, e, s);
|
|
484
|
+
}
|
|
485
|
+
addLogByCustomEvent(e, s = {}, r) {
|
|
486
|
+
const i = this.createCustomEvent(e);
|
|
487
|
+
i.setProperties(s);
|
|
488
|
+
const a = bs(this, i, r);
|
|
489
|
+
this.addLogToQueue(a);
|
|
490
|
+
}
|
|
491
|
+
executeInitEvent() {
|
|
492
|
+
const e = Ot(this, "init");
|
|
493
|
+
e.setProperties({
|
|
494
|
+
groupid: this.groupid
|
|
495
|
+
}), this.addLogByEvent(e);
|
|
496
|
+
}
|
|
497
|
+
updateCommonLog(e) {
|
|
498
|
+
this.commonLog = {
|
|
499
|
+
...this.commonLog,
|
|
500
|
+
...e
|
|
501
|
+
};
|
|
502
|
+
}
|
|
503
|
+
trackEvent(e, s = {}, r) {
|
|
504
|
+
const i = Ot(this, e);
|
|
505
|
+
i.setProperties(s), this.addLogByEvent(i, r);
|
|
506
|
+
}
|
|
507
|
+
start(...e) {
|
|
508
|
+
this.executeInitEvent(), this.runEventStartHooks();
|
|
509
|
+
}
|
|
510
|
+
destroy() {
|
|
511
|
+
this.runEventDestroyHooks();
|
|
512
|
+
}
|
|
513
|
+
transformLog(e) {
|
|
514
|
+
return e;
|
|
515
|
+
}
|
|
516
|
+
async addLogToQueue(e, s = !1, r = !0) {
|
|
517
|
+
r && (e = this.transformLog(e)), await this.sendLog(e, s);
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
I(hn, "registerEvent", Ks);
|
|
521
|
+
class Hc {
|
|
522
|
+
constructor(e) {
|
|
523
|
+
I(this, "name", ""), I(this, "groupid", ""), this.name = e.name, this.groupid = e.groupid;
|
|
524
|
+
}
|
|
525
|
+
getJson() {
|
|
526
|
+
return {
|
|
527
|
+
name: this.name,
|
|
528
|
+
attributes: this.getAttributes()
|
|
529
|
+
};
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
var fi = Object.defineProperty, gi = (n, e, s) => e in n ? fi(n, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : n[e] = s, b = (n, e, s) => (gi(n, typeof e != "symbol" ? e + "" : e, s), s), _i = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, zn = { exports: {} };
|
|
533
|
+
(function(n, e) {
|
|
534
|
+
(function(s, r) {
|
|
535
|
+
var i = "1.0.32", a = "", u = "?", l = "function", w = "undefined", p = "object", f = "string", v = "major", h = "model", _ = "name", y = "type", k = "vendor", T = "version", R = "architecture", tt = "console", M = "mobile", C = "tablet", V = "smarttv", J = "wearable", ht = "embedded", gt = 350, zt = "Amazon", re = "Apple", Se = "ASUS", Ge = "BlackBerry", Ht = "Browser", Jt = "Chrome", bn = "Edge", ie = "Firefox", Gt = "Google", Xe = "Huawei", Y = "LG", Tt = "Microsoft", Ft = "Motorola", ae = "Opera", Pe = "Samsung", Le = "Sharp", Xt = "Sony", It = "Xiaomi", Ee = "Zebra", We = "Facebook", wn = function(z, q) {
|
|
536
|
+
var A = {};
|
|
537
|
+
for (var W in z)
|
|
538
|
+
q[W] && q[W].length % 2 === 0 ? A[W] = q[W].concat(z[W]) : A[W] = z[W];
|
|
539
|
+
return A;
|
|
540
|
+
}, Ct = function(z) {
|
|
541
|
+
for (var q = {}, A = 0; A < z.length; A++)
|
|
542
|
+
q[z[A].toUpperCase()] = z[A];
|
|
543
|
+
return q;
|
|
544
|
+
}, xe = function(z, q) {
|
|
545
|
+
return typeof z === f ? Wt(q).indexOf(Wt(z)) !== -1 : !1;
|
|
546
|
+
}, Wt = function(z) {
|
|
547
|
+
return z.toLowerCase();
|
|
548
|
+
}, yn = function(z) {
|
|
549
|
+
return typeof z === f ? z.replace(/[^\d\.]/g, a).split(".")[0] : r;
|
|
550
|
+
}, Qt = function(z, q) {
|
|
551
|
+
if (typeof z === f)
|
|
552
|
+
return z = z.replace(/^\s\s*/, a).replace(/\s\s*$/, a), typeof q === w ? z : z.substring(0, gt);
|
|
553
|
+
}, lt = function(z, q) {
|
|
554
|
+
for (var A = 0, W, O, ce, G, dt, _t; A < q.length && !dt; ) {
|
|
555
|
+
var Ke = q[A], Ce = q[A + 1];
|
|
556
|
+
for (W = O = 0; W < Ke.length && !dt; )
|
|
557
|
+
if (dt = Ke[W++].exec(z), dt)
|
|
558
|
+
for (ce = 0; ce < Ce.length; ce++)
|
|
559
|
+
_t = dt[++O], G = Ce[ce], typeof G === p && G.length > 0 ? G.length === 2 ? typeof G[1] == l ? this[G[0]] = G[1].call(this, _t) : this[G[0]] = G[1] : G.length === 3 ? typeof G[1] === l && !(G[1].exec && G[1].test) ? this[G[0]] = _t ? G[1].call(this, _t, G[2]) : r : this[G[0]] = _t ? _t.replace(G[1], G[2]) : r : G.length === 4 && (this[G[0]] = _t ? G[3].call(this, _t.replace(G[1], G[2])) : r) : this[G] = _t || r;
|
|
560
|
+
A += 2;
|
|
561
|
+
}
|
|
562
|
+
}, Be = function(z, q) {
|
|
563
|
+
for (var A in q)
|
|
564
|
+
if (typeof q[A] === p && q[A].length > 0) {
|
|
565
|
+
for (var W = 0; W < q[A].length; W++)
|
|
566
|
+
if (xe(q[A][W], z))
|
|
567
|
+
return A === u ? r : A;
|
|
568
|
+
} else if (xe(q[A], z))
|
|
569
|
+
return A === u ? r : A;
|
|
570
|
+
return z;
|
|
571
|
+
}, Qe = {
|
|
572
|
+
"1.0": "/8",
|
|
573
|
+
"1.2": "/1",
|
|
574
|
+
"1.3": "/3",
|
|
575
|
+
"2.0": "/412",
|
|
576
|
+
"2.0.2": "/416",
|
|
577
|
+
"2.0.3": "/417",
|
|
578
|
+
"2.0.4": "/419",
|
|
579
|
+
"?": "/"
|
|
580
|
+
}, Ve = {
|
|
581
|
+
ME: "4.90",
|
|
582
|
+
"NT 3.11": "NT3.51",
|
|
583
|
+
"NT 4.0": "NT4.0",
|
|
584
|
+
2e3: "NT 5.0",
|
|
585
|
+
XP: ["NT 5.1", "NT 5.2"],
|
|
586
|
+
Vista: "NT 6.0",
|
|
587
|
+
7: "NT 6.1",
|
|
588
|
+
8: "NT 6.2",
|
|
589
|
+
"8.1": "NT 6.3",
|
|
590
|
+
10: ["NT 6.4", "NT 10.0"],
|
|
591
|
+
RT: "ARM"
|
|
592
|
+
}, Mt = {
|
|
593
|
+
browser: [
|
|
594
|
+
[
|
|
595
|
+
/\b(?:crmo|crios)\/([\w\.]+)/i
|
|
596
|
+
],
|
|
597
|
+
[T, [_, "Chrome"]],
|
|
598
|
+
[
|
|
599
|
+
/edg(?:e|ios|a)?\/([\w\.]+)/i
|
|
600
|
+
],
|
|
601
|
+
[T, [_, "Edge"]],
|
|
602
|
+
[
|
|
603
|
+
/(opera mini)\/([-\w\.]+)/i,
|
|
604
|
+
/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,
|
|
605
|
+
/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i
|
|
606
|
+
],
|
|
607
|
+
[_, T],
|
|
608
|
+
[
|
|
609
|
+
/opios[\/ ]+([\w\.]+)/i
|
|
610
|
+
],
|
|
611
|
+
[T, [_, ae + " Mini"]],
|
|
612
|
+
[
|
|
613
|
+
/\bopr\/([\w\.]+)/i
|
|
614
|
+
],
|
|
615
|
+
[T, [_, ae]],
|
|
616
|
+
[
|
|
617
|
+
/(kindle)\/([\w\.]+)/i,
|
|
618
|
+
/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,
|
|
619
|
+
/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,
|
|
620
|
+
/(ba?idubrowser)[\/ ]?([\w\.]+)/i,
|
|
621
|
+
/(?:ms|\()(ie) ([\w\.]+)/i,
|
|
622
|
+
/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,
|
|
623
|
+
/(weibo)__([\d\.]+)/i
|
|
624
|
+
],
|
|
625
|
+
[_, T],
|
|
626
|
+
[
|
|
627
|
+
/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i
|
|
628
|
+
],
|
|
629
|
+
[T, [_, "UC" + Ht]],
|
|
630
|
+
[
|
|
631
|
+
/microm.+\bqbcore\/([\w\.]+)/i,
|
|
632
|
+
/\bqbcore\/([\w\.]+).+microm/i
|
|
633
|
+
],
|
|
634
|
+
[T, [_, "WeChat(Win) Desktop"]],
|
|
635
|
+
[
|
|
636
|
+
/micromessenger\/([\w\.]+)/i
|
|
637
|
+
],
|
|
638
|
+
[T, [_, "WeChat"]],
|
|
639
|
+
[
|
|
640
|
+
/konqueror\/([\w\.]+)/i
|
|
641
|
+
],
|
|
642
|
+
[T, [_, "Konqueror"]],
|
|
643
|
+
[
|
|
644
|
+
/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i
|
|
645
|
+
],
|
|
646
|
+
[T, [_, "IE"]],
|
|
647
|
+
[
|
|
648
|
+
/yabrowser\/([\w\.]+)/i
|
|
649
|
+
],
|
|
650
|
+
[T, [_, "Yandex"]],
|
|
651
|
+
[
|
|
652
|
+
/(avast|avg)\/([\w\.]+)/i
|
|
653
|
+
],
|
|
654
|
+
[[_, /(.+)/, "$1 Secure " + Ht], T],
|
|
655
|
+
[
|
|
656
|
+
/\bfocus\/([\w\.]+)/i
|
|
657
|
+
],
|
|
658
|
+
[T, [_, ie + " Focus"]],
|
|
659
|
+
[
|
|
660
|
+
/\bopt\/([\w\.]+)/i
|
|
661
|
+
],
|
|
662
|
+
[T, [_, ae + " Touch"]],
|
|
663
|
+
[
|
|
664
|
+
/coc_coc\w+\/([\w\.]+)/i
|
|
665
|
+
],
|
|
666
|
+
[T, [_, "Coc Coc"]],
|
|
667
|
+
[
|
|
668
|
+
/dolfin\/([\w\.]+)/i
|
|
669
|
+
],
|
|
670
|
+
[T, [_, "Dolphin"]],
|
|
671
|
+
[
|
|
672
|
+
/coast\/([\w\.]+)/i
|
|
673
|
+
],
|
|
674
|
+
[T, [_, ae + " Coast"]],
|
|
675
|
+
[
|
|
676
|
+
/miuibrowser\/([\w\.]+)/i
|
|
677
|
+
],
|
|
678
|
+
[T, [_, "MIUI " + Ht]],
|
|
679
|
+
[
|
|
680
|
+
/fxios\/([-\w\.]+)/i
|
|
681
|
+
],
|
|
682
|
+
[T, [_, ie]],
|
|
683
|
+
[
|
|
684
|
+
/\bqihu|(qi?ho?o?|360)browser/i
|
|
685
|
+
],
|
|
686
|
+
[[_, "360 " + Ht]],
|
|
687
|
+
[
|
|
688
|
+
/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i
|
|
689
|
+
],
|
|
690
|
+
[[_, /(.+)/, "$1 " + Ht], T],
|
|
691
|
+
[
|
|
692
|
+
/(comodo_dragon)\/([\w\.]+)/i
|
|
693
|
+
],
|
|
694
|
+
[[_, /_/g, " "], T],
|
|
695
|
+
[
|
|
696
|
+
/(electron)\/([\w\.]+) safari/i,
|
|
697
|
+
/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,
|
|
698
|
+
/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i
|
|
699
|
+
],
|
|
700
|
+
[_, T],
|
|
701
|
+
[
|
|
702
|
+
/(metasr)[\/ ]?([\w\.]+)/i,
|
|
703
|
+
/(lbbrowser)/i,
|
|
704
|
+
/\[(linkedin)app\]/i
|
|
705
|
+
],
|
|
706
|
+
[_],
|
|
707
|
+
[
|
|
708
|
+
/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i
|
|
709
|
+
],
|
|
710
|
+
[[_, We], T],
|
|
711
|
+
[
|
|
712
|
+
/safari (line)\/([\w\.]+)/i,
|
|
713
|
+
/\b(line)\/([\w\.]+)\/iab/i,
|
|
714
|
+
/(chromium|instagram)[\/ ]([-\w\.]+)/i
|
|
715
|
+
],
|
|
716
|
+
[_, T],
|
|
717
|
+
[
|
|
718
|
+
/\bgsa\/([\w\.]+) .*safari\//i
|
|
719
|
+
],
|
|
720
|
+
[T, [_, "GSA"]],
|
|
721
|
+
[
|
|
722
|
+
/headlesschrome(?:\/([\w\.]+)| )/i
|
|
723
|
+
],
|
|
724
|
+
[T, [_, Jt + " Headless"]],
|
|
725
|
+
[
|
|
726
|
+
/ wv\).+(chrome)\/([\w\.]+)/i
|
|
727
|
+
],
|
|
728
|
+
[[_, Jt + " WebView"], T],
|
|
729
|
+
[
|
|
730
|
+
/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i
|
|
731
|
+
],
|
|
732
|
+
[T, [_, "Android " + Ht]],
|
|
733
|
+
[
|
|
734
|
+
/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i
|
|
735
|
+
],
|
|
736
|
+
[_, T],
|
|
737
|
+
[
|
|
738
|
+
/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i
|
|
739
|
+
],
|
|
740
|
+
[T, [_, "Mobile Safari"]],
|
|
741
|
+
[
|
|
742
|
+
/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i
|
|
743
|
+
],
|
|
744
|
+
[T, _],
|
|
745
|
+
[
|
|
746
|
+
/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i
|
|
747
|
+
],
|
|
748
|
+
[_, [T, Be, Qe]],
|
|
749
|
+
[
|
|
750
|
+
/(webkit|khtml)\/([\w\.]+)/i
|
|
751
|
+
],
|
|
752
|
+
[_, T],
|
|
753
|
+
[
|
|
754
|
+
/(navigator|netscape\d?)\/([-\w\.]+)/i
|
|
755
|
+
],
|
|
756
|
+
[[_, "Netscape"], T],
|
|
757
|
+
[
|
|
758
|
+
/mobile vr; rv:([\w\.]+)\).+firefox/i
|
|
759
|
+
],
|
|
760
|
+
[T, [_, ie + " Reality"]],
|
|
761
|
+
[
|
|
762
|
+
/ekiohf.+(flow)\/([\w\.]+)/i,
|
|
763
|
+
/(swiftfox)/i,
|
|
764
|
+
/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,
|
|
765
|
+
/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,
|
|
766
|
+
/(firefox)\/([\w\.]+)/i,
|
|
767
|
+
/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,
|
|
768
|
+
/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,
|
|
769
|
+
/(links) \(([\w\.]+)/i
|
|
770
|
+
],
|
|
771
|
+
[_, T]
|
|
772
|
+
],
|
|
773
|
+
cpu: [
|
|
774
|
+
[
|
|
775
|
+
/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i
|
|
776
|
+
],
|
|
777
|
+
[[R, "amd64"]],
|
|
778
|
+
[
|
|
779
|
+
/(ia32(?=;))/i
|
|
780
|
+
],
|
|
781
|
+
[[R, Wt]],
|
|
782
|
+
[
|
|
783
|
+
/((?:i[346]|x)86)[;\)]/i
|
|
784
|
+
],
|
|
785
|
+
[[R, "ia32"]],
|
|
786
|
+
[
|
|
787
|
+
/\b(aarch64|arm(v?8e?l?|_?64))\b/i
|
|
788
|
+
],
|
|
789
|
+
[[R, "arm64"]],
|
|
790
|
+
[
|
|
791
|
+
/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i
|
|
792
|
+
],
|
|
793
|
+
[[R, "armhf"]],
|
|
794
|
+
[
|
|
795
|
+
/windows (ce|mobile); ppc;/i
|
|
796
|
+
],
|
|
797
|
+
[[R, "arm"]],
|
|
798
|
+
[
|
|
799
|
+
/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i
|
|
800
|
+
],
|
|
801
|
+
[[R, /ower/, a, Wt]],
|
|
802
|
+
[
|
|
803
|
+
/(sun4\w)[;\)]/i
|
|
804
|
+
],
|
|
805
|
+
[[R, "sparc"]],
|
|
806
|
+
[
|
|
807
|
+
/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i
|
|
808
|
+
],
|
|
809
|
+
[[R, Wt]]
|
|
810
|
+
],
|
|
811
|
+
device: [
|
|
812
|
+
[
|
|
813
|
+
/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i
|
|
814
|
+
],
|
|
815
|
+
[h, [k, Pe], [y, C]],
|
|
816
|
+
[
|
|
817
|
+
/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,
|
|
818
|
+
/samsung[- ]([-\w]+)/i,
|
|
819
|
+
/sec-(sgh\w+)/i
|
|
820
|
+
],
|
|
821
|
+
[h, [k, Pe], [y, M]],
|
|
822
|
+
[
|
|
823
|
+
/\((ip(?:hone|od)[\w ]*);/i
|
|
824
|
+
],
|
|
825
|
+
[h, [k, re], [y, M]],
|
|
826
|
+
[
|
|
827
|
+
/\((ipad);[-\w\),; ]+apple/i,
|
|
828
|
+
/applecoremedia\/[\w\.]+ \((ipad)/i,
|
|
829
|
+
/\b(ipad)\d\d?,\d\d?[;\]].+ios/i
|
|
830
|
+
],
|
|
831
|
+
[h, [k, re], [y, C]],
|
|
832
|
+
[
|
|
833
|
+
/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i
|
|
834
|
+
],
|
|
835
|
+
[h, [k, Xe], [y, C]],
|
|
836
|
+
[
|
|
837
|
+
/(?:huawei|honor)([-\w ]+)[;\)]/i,
|
|
838
|
+
/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i
|
|
839
|
+
],
|
|
840
|
+
[h, [k, Xe], [y, M]],
|
|
841
|
+
[
|
|
842
|
+
/\b(poco[\w ]+)(?: bui|\))/i,
|
|
843
|
+
/\b; (\w+) build\/hm\1/i,
|
|
844
|
+
/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,
|
|
845
|
+
/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,
|
|
846
|
+
/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i
|
|
847
|
+
],
|
|
848
|
+
[[h, /_/g, " "], [k, It], [y, M]],
|
|
849
|
+
[
|
|
850
|
+
/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i
|
|
851
|
+
],
|
|
852
|
+
[[h, /_/g, " "], [k, It], [y, C]],
|
|
853
|
+
[
|
|
854
|
+
/; (\w+) bui.+ oppo/i,
|
|
855
|
+
/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i
|
|
856
|
+
],
|
|
857
|
+
[h, [k, "OPPO"], [y, M]],
|
|
858
|
+
[
|
|
859
|
+
/vivo (\w+)(?: bui|\))/i,
|
|
860
|
+
/\b(v[12]\d{3}\w?[at])(?: bui|;)/i
|
|
861
|
+
],
|
|
862
|
+
[h, [k, "Vivo"], [y, M]],
|
|
863
|
+
[
|
|
864
|
+
/\b(rmx[12]\d{3})(?: bui|;|\))/i
|
|
865
|
+
],
|
|
866
|
+
[h, [k, "Realme"], [y, M]],
|
|
867
|
+
[
|
|
868
|
+
/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,
|
|
869
|
+
/\bmot(?:orola)?[- ](\w*)/i,
|
|
870
|
+
/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i
|
|
871
|
+
],
|
|
872
|
+
[h, [k, Ft], [y, M]],
|
|
873
|
+
[
|
|
874
|
+
/\b(mz60\d|xoom[2 ]{0,2}) build\//i
|
|
875
|
+
],
|
|
876
|
+
[h, [k, Ft], [y, C]],
|
|
877
|
+
[
|
|
878
|
+
/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i
|
|
879
|
+
],
|
|
880
|
+
[h, [k, Y], [y, C]],
|
|
881
|
+
[
|
|
882
|
+
/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,
|
|
883
|
+
/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,
|
|
884
|
+
/\blg-?([\d\w]+) bui/i
|
|
885
|
+
],
|
|
886
|
+
[h, [k, Y], [y, M]],
|
|
887
|
+
[
|
|
888
|
+
/(ideatab[-\w ]+)/i,
|
|
889
|
+
/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i
|
|
890
|
+
],
|
|
891
|
+
[h, [k, "Lenovo"], [y, C]],
|
|
892
|
+
[
|
|
893
|
+
/(?:maemo|nokia).*(n900|lumia \d+)/i,
|
|
894
|
+
/nokia[-_ ]?([-\w\.]*)/i
|
|
895
|
+
],
|
|
896
|
+
[[h, /_/g, " "], [k, "Nokia"], [y, M]],
|
|
897
|
+
[
|
|
898
|
+
/(pixel c)\b/i
|
|
899
|
+
],
|
|
900
|
+
[h, [k, Gt], [y, C]],
|
|
901
|
+
[
|
|
902
|
+
/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i
|
|
903
|
+
],
|
|
904
|
+
[h, [k, Gt], [y, M]],
|
|
905
|
+
[
|
|
906
|
+
/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i
|
|
907
|
+
],
|
|
908
|
+
[h, [k, Xt], [y, M]],
|
|
909
|
+
[
|
|
910
|
+
/sony tablet [ps]/i,
|
|
911
|
+
/\b(?:sony)?sgp\w+(?: bui|\))/i
|
|
912
|
+
],
|
|
913
|
+
[[h, "Xperia Tablet"], [k, Xt], [y, C]],
|
|
914
|
+
[
|
|
915
|
+
/ (kb2005|in20[12]5|be20[12][59])\b/i,
|
|
916
|
+
/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i
|
|
917
|
+
],
|
|
918
|
+
[h, [k, "OnePlus"], [y, M]],
|
|
919
|
+
[
|
|
920
|
+
/(alexa)webm/i,
|
|
921
|
+
/(kf[a-z]{2}wi)( bui|\))/i,
|
|
922
|
+
/(kf[a-z]+)( bui|\)).+silk\//i
|
|
923
|
+
],
|
|
924
|
+
[h, [k, zt], [y, C]],
|
|
925
|
+
[
|
|
926
|
+
/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i
|
|
927
|
+
],
|
|
928
|
+
[[h, /(.+)/g, "Fire Phone $1"], [k, zt], [y, M]],
|
|
929
|
+
[
|
|
930
|
+
/(playbook);[-\w\),; ]+(rim)/i
|
|
931
|
+
],
|
|
932
|
+
[h, k, [y, C]],
|
|
933
|
+
[
|
|
934
|
+
/\b((?:bb[a-f]|st[hv])100-\d)/i,
|
|
935
|
+
/\(bb10; (\w+)/i
|
|
936
|
+
],
|
|
937
|
+
[h, [k, Ge], [y, M]],
|
|
938
|
+
[
|
|
939
|
+
/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i
|
|
940
|
+
],
|
|
941
|
+
[h, [k, Se], [y, C]],
|
|
942
|
+
[
|
|
943
|
+
/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i
|
|
944
|
+
],
|
|
945
|
+
[h, [k, Se], [y, M]],
|
|
946
|
+
[
|
|
947
|
+
/(nexus 9)/i
|
|
948
|
+
],
|
|
949
|
+
[h, [k, "HTC"], [y, C]],
|
|
950
|
+
[
|
|
951
|
+
/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,
|
|
952
|
+
/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,
|
|
953
|
+
/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i
|
|
954
|
+
],
|
|
955
|
+
[k, [h, /_/g, " "], [y, M]],
|
|
956
|
+
[
|
|
957
|
+
/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i
|
|
958
|
+
],
|
|
959
|
+
[h, [k, "Acer"], [y, C]],
|
|
960
|
+
[
|
|
961
|
+
/droid.+; (m[1-5] note) bui/i,
|
|
962
|
+
/\bmz-([-\w]{2,})/i
|
|
963
|
+
],
|
|
964
|
+
[h, [k, "Meizu"], [y, M]],
|
|
965
|
+
[
|
|
966
|
+
/\b(sh-?[altvz]?\d\d[a-ekm]?)/i
|
|
967
|
+
],
|
|
968
|
+
[h, [k, Le], [y, M]],
|
|
969
|
+
[
|
|
970
|
+
/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,
|
|
971
|
+
/(hp) ([\w ]+\w)/i,
|
|
972
|
+
/(asus)-?(\w+)/i,
|
|
973
|
+
/(microsoft); (lumia[\w ]+)/i,
|
|
974
|
+
/(lenovo)[-_ ]?([-\w]+)/i,
|
|
975
|
+
/(jolla)/i,
|
|
976
|
+
/(oppo) ?([\w ]+) bui/i
|
|
977
|
+
],
|
|
978
|
+
[k, h, [y, M]],
|
|
979
|
+
[
|
|
980
|
+
/(archos) (gamepad2?)/i,
|
|
981
|
+
/(hp).+(touchpad(?!.+tablet)|tablet)/i,
|
|
982
|
+
/(kindle)\/([\w\.]+)/i,
|
|
983
|
+
/(nook)[\w ]+build\/(\w+)/i,
|
|
984
|
+
/(dell) (strea[kpr\d ]*[\dko])/i,
|
|
985
|
+
/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,
|
|
986
|
+
/(trinity)[- ]*(t\d{3}) bui/i,
|
|
987
|
+
/(gigaset)[- ]+(q\w{1,9}) bui/i,
|
|
988
|
+
/(vodafone) ([\w ]+)(?:\)| bui)/i
|
|
989
|
+
],
|
|
990
|
+
[k, h, [y, C]],
|
|
991
|
+
[
|
|
992
|
+
/(surface duo)/i
|
|
993
|
+
],
|
|
994
|
+
[h, [k, Tt], [y, C]],
|
|
995
|
+
[
|
|
996
|
+
/droid [\d\.]+; (fp\du?)(?: b|\))/i
|
|
997
|
+
],
|
|
998
|
+
[h, [k, "Fairphone"], [y, M]],
|
|
999
|
+
[
|
|
1000
|
+
/(u304aa)/i
|
|
1001
|
+
],
|
|
1002
|
+
[h, [k, "AT&T"], [y, M]],
|
|
1003
|
+
[
|
|
1004
|
+
/\bsie-(\w*)/i
|
|
1005
|
+
],
|
|
1006
|
+
[h, [k, "Siemens"], [y, M]],
|
|
1007
|
+
[
|
|
1008
|
+
/\b(rct\w+) b/i
|
|
1009
|
+
],
|
|
1010
|
+
[h, [k, "RCA"], [y, C]],
|
|
1011
|
+
[
|
|
1012
|
+
/\b(venue[\d ]{2,7}) b/i
|
|
1013
|
+
],
|
|
1014
|
+
[h, [k, "Dell"], [y, C]],
|
|
1015
|
+
[
|
|
1016
|
+
/\b(q(?:mv|ta)\w+) b/i
|
|
1017
|
+
],
|
|
1018
|
+
[h, [k, "Verizon"], [y, C]],
|
|
1019
|
+
[
|
|
1020
|
+
/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i
|
|
1021
|
+
],
|
|
1022
|
+
[h, [k, "Barnes & Noble"], [y, C]],
|
|
1023
|
+
[
|
|
1024
|
+
/\b(tm\d{3}\w+) b/i
|
|
1025
|
+
],
|
|
1026
|
+
[h, [k, "NuVision"], [y, C]],
|
|
1027
|
+
[
|
|
1028
|
+
/\b(k88) b/i
|
|
1029
|
+
],
|
|
1030
|
+
[h, [k, "ZTE"], [y, C]],
|
|
1031
|
+
[
|
|
1032
|
+
/\b(nx\d{3}j) b/i
|
|
1033
|
+
],
|
|
1034
|
+
[h, [k, "ZTE"], [y, M]],
|
|
1035
|
+
[
|
|
1036
|
+
/\b(gen\d{3}) b.+49h/i
|
|
1037
|
+
],
|
|
1038
|
+
[h, [k, "Swiss"], [y, M]],
|
|
1039
|
+
[
|
|
1040
|
+
/\b(zur\d{3}) b/i
|
|
1041
|
+
],
|
|
1042
|
+
[h, [k, "Swiss"], [y, C]],
|
|
1043
|
+
[
|
|
1044
|
+
/\b((zeki)?tb.*\b) b/i
|
|
1045
|
+
],
|
|
1046
|
+
[h, [k, "Zeki"], [y, C]],
|
|
1047
|
+
[
|
|
1048
|
+
/\b([yr]\d{2}) b/i,
|
|
1049
|
+
/\b(dragon[- ]+touch |dt)(\w{5}) b/i
|
|
1050
|
+
],
|
|
1051
|
+
[[k, "Dragon Touch"], h, [y, C]],
|
|
1052
|
+
[
|
|
1053
|
+
/\b(ns-?\w{0,9}) b/i
|
|
1054
|
+
],
|
|
1055
|
+
[h, [k, "Insignia"], [y, C]],
|
|
1056
|
+
[
|
|
1057
|
+
/\b((nxa|next)-?\w{0,9}) b/i
|
|
1058
|
+
],
|
|
1059
|
+
[h, [k, "NextBook"], [y, C]],
|
|
1060
|
+
[
|
|
1061
|
+
/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i
|
|
1062
|
+
],
|
|
1063
|
+
[[k, "Voice"], h, [y, M]],
|
|
1064
|
+
[
|
|
1065
|
+
/\b(lvtel\-)?(v1[12]) b/i
|
|
1066
|
+
],
|
|
1067
|
+
[[k, "LvTel"], h, [y, M]],
|
|
1068
|
+
[
|
|
1069
|
+
/\b(ph-1) /i
|
|
1070
|
+
],
|
|
1071
|
+
[h, [k, "Essential"], [y, M]],
|
|
1072
|
+
[
|
|
1073
|
+
/\b(v(100md|700na|7011|917g).*\b) b/i
|
|
1074
|
+
],
|
|
1075
|
+
[h, [k, "Envizen"], [y, C]],
|
|
1076
|
+
[
|
|
1077
|
+
/\b(trio[-\w\. ]+) b/i
|
|
1078
|
+
],
|
|
1079
|
+
[h, [k, "MachSpeed"], [y, C]],
|
|
1080
|
+
[
|
|
1081
|
+
/\btu_(1491) b/i
|
|
1082
|
+
],
|
|
1083
|
+
[h, [k, "Rotor"], [y, C]],
|
|
1084
|
+
[
|
|
1085
|
+
/(shield[\w ]+) b/i
|
|
1086
|
+
],
|
|
1087
|
+
[h, [k, "Nvidia"], [y, C]],
|
|
1088
|
+
[
|
|
1089
|
+
/(sprint) (\w+)/i
|
|
1090
|
+
],
|
|
1091
|
+
[k, h, [y, M]],
|
|
1092
|
+
[
|
|
1093
|
+
/(kin\.[onetw]{3})/i
|
|
1094
|
+
],
|
|
1095
|
+
[[h, /\./g, " "], [k, Tt], [y, M]],
|
|
1096
|
+
[
|
|
1097
|
+
/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i
|
|
1098
|
+
],
|
|
1099
|
+
[h, [k, Ee], [y, C]],
|
|
1100
|
+
[
|
|
1101
|
+
/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i
|
|
1102
|
+
],
|
|
1103
|
+
[h, [k, Ee], [y, M]],
|
|
1104
|
+
[
|
|
1105
|
+
/(ouya)/i,
|
|
1106
|
+
/(nintendo) ([wids3utch]+)/i
|
|
1107
|
+
],
|
|
1108
|
+
[k, h, [y, tt]],
|
|
1109
|
+
[
|
|
1110
|
+
/droid.+; (shield) bui/i
|
|
1111
|
+
],
|
|
1112
|
+
[h, [k, "Nvidia"], [y, tt]],
|
|
1113
|
+
[
|
|
1114
|
+
/(playstation [345portablevi]+)/i
|
|
1115
|
+
],
|
|
1116
|
+
[h, [k, Xt], [y, tt]],
|
|
1117
|
+
[
|
|
1118
|
+
/\b(xbox(?: one)?(?!; xbox))[\); ]/i
|
|
1119
|
+
],
|
|
1120
|
+
[h, [k, Tt], [y, tt]],
|
|
1121
|
+
[
|
|
1122
|
+
/smart-tv.+(samsung)/i
|
|
1123
|
+
],
|
|
1124
|
+
[k, [y, V]],
|
|
1125
|
+
[
|
|
1126
|
+
/hbbtv.+maple;(\d+)/i
|
|
1127
|
+
],
|
|
1128
|
+
[[h, /^/, "SmartTV"], [k, Pe], [y, V]],
|
|
1129
|
+
[
|
|
1130
|
+
/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i
|
|
1131
|
+
],
|
|
1132
|
+
[[k, Y], [y, V]],
|
|
1133
|
+
[
|
|
1134
|
+
/(apple) ?tv/i
|
|
1135
|
+
],
|
|
1136
|
+
[k, [h, re + " TV"], [y, V]],
|
|
1137
|
+
[
|
|
1138
|
+
/crkey/i
|
|
1139
|
+
],
|
|
1140
|
+
[[h, Jt + "cast"], [k, Gt], [y, V]],
|
|
1141
|
+
[
|
|
1142
|
+
/droid.+aft(\w)( bui|\))/i
|
|
1143
|
+
],
|
|
1144
|
+
[h, [k, zt], [y, V]],
|
|
1145
|
+
[
|
|
1146
|
+
/\(dtv[\);].+(aquos)/i,
|
|
1147
|
+
/(aquos-tv[\w ]+)\)/i
|
|
1148
|
+
],
|
|
1149
|
+
[h, [k, Le], [y, V]],
|
|
1150
|
+
[
|
|
1151
|
+
/(bravia[\w ]+)( bui|\))/i
|
|
1152
|
+
],
|
|
1153
|
+
[h, [k, Xt], [y, V]],
|
|
1154
|
+
[
|
|
1155
|
+
/(mitv-\w{5}) bui/i
|
|
1156
|
+
],
|
|
1157
|
+
[h, [k, It], [y, V]],
|
|
1158
|
+
[
|
|
1159
|
+
/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,
|
|
1160
|
+
/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i
|
|
1161
|
+
],
|
|
1162
|
+
[[k, Qt], [h, Qt], [y, V]],
|
|
1163
|
+
[
|
|
1164
|
+
/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i
|
|
1165
|
+
],
|
|
1166
|
+
[[y, V]],
|
|
1167
|
+
[
|
|
1168
|
+
/((pebble))app/i
|
|
1169
|
+
],
|
|
1170
|
+
[k, h, [y, J]],
|
|
1171
|
+
[
|
|
1172
|
+
/droid.+; (glass) \d/i
|
|
1173
|
+
],
|
|
1174
|
+
[h, [k, Gt], [y, J]],
|
|
1175
|
+
[
|
|
1176
|
+
/droid.+; (wt63?0{2,3})\)/i
|
|
1177
|
+
],
|
|
1178
|
+
[h, [k, Ee], [y, J]],
|
|
1179
|
+
[
|
|
1180
|
+
/(quest( 2)?)/i
|
|
1181
|
+
],
|
|
1182
|
+
[h, [k, We], [y, J]],
|
|
1183
|
+
[
|
|
1184
|
+
/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i
|
|
1185
|
+
],
|
|
1186
|
+
[k, [y, ht]],
|
|
1187
|
+
[
|
|
1188
|
+
/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i
|
|
1189
|
+
],
|
|
1190
|
+
[h, [y, M]],
|
|
1191
|
+
[
|
|
1192
|
+
/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i
|
|
1193
|
+
],
|
|
1194
|
+
[h, [y, C]],
|
|
1195
|
+
[
|
|
1196
|
+
/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i
|
|
1197
|
+
],
|
|
1198
|
+
[[y, C]],
|
|
1199
|
+
[
|
|
1200
|
+
/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i
|
|
1201
|
+
],
|
|
1202
|
+
[[y, M]],
|
|
1203
|
+
[
|
|
1204
|
+
/(android[-\w\. ]{0,9});.+buil/i
|
|
1205
|
+
],
|
|
1206
|
+
[h, [k, "Generic"]]
|
|
1207
|
+
],
|
|
1208
|
+
engine: [
|
|
1209
|
+
[
|
|
1210
|
+
/windows.+ edge\/([\w\.]+)/i
|
|
1211
|
+
],
|
|
1212
|
+
[T, [_, bn + "HTML"]],
|
|
1213
|
+
[
|
|
1214
|
+
/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i
|
|
1215
|
+
],
|
|
1216
|
+
[T, [_, "Blink"]],
|
|
1217
|
+
[
|
|
1218
|
+
/(presto)\/([\w\.]+)/i,
|
|
1219
|
+
/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,
|
|
1220
|
+
/ekioh(flow)\/([\w\.]+)/i,
|
|
1221
|
+
/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,
|
|
1222
|
+
/(icab)[\/ ]([23]\.[\d\.]+)/i
|
|
1223
|
+
],
|
|
1224
|
+
[_, T],
|
|
1225
|
+
[
|
|
1226
|
+
/rv\:([\w\.]{1,9})\b.+(gecko)/i
|
|
1227
|
+
],
|
|
1228
|
+
[T, _]
|
|
1229
|
+
],
|
|
1230
|
+
os: [
|
|
1231
|
+
[
|
|
1232
|
+
/microsoft (windows) (vista|xp)/i
|
|
1233
|
+
],
|
|
1234
|
+
[_, T],
|
|
1235
|
+
[
|
|
1236
|
+
/(windows) nt 6\.2; (arm)/i,
|
|
1237
|
+
/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,
|
|
1238
|
+
/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i
|
|
1239
|
+
],
|
|
1240
|
+
[_, [T, Be, Ve]],
|
|
1241
|
+
[
|
|
1242
|
+
/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i
|
|
1243
|
+
],
|
|
1244
|
+
[[_, "Windows"], [T, Be, Ve]],
|
|
1245
|
+
[
|
|
1246
|
+
/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,
|
|
1247
|
+
/cfnetwork\/.+darwin/i
|
|
1248
|
+
],
|
|
1249
|
+
[[T, /_/g, "."], [_, "iOS"]],
|
|
1250
|
+
[
|
|
1251
|
+
/(mac os x) ?([\w\. ]*)/i,
|
|
1252
|
+
/(macintosh|mac_powerpc\b)(?!.+haiku)/i
|
|
1253
|
+
],
|
|
1254
|
+
[[_, "Mac OS"], [T, /_/g, "."]],
|
|
1255
|
+
[
|
|
1256
|
+
/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i
|
|
1257
|
+
],
|
|
1258
|
+
[T, _],
|
|
1259
|
+
[
|
|
1260
|
+
/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,
|
|
1261
|
+
/(blackberry)\w*\/([\w\.]*)/i,
|
|
1262
|
+
/(tizen|kaios)[\/ ]([\w\.]+)/i,
|
|
1263
|
+
/\((series40);/i
|
|
1264
|
+
],
|
|
1265
|
+
[_, T],
|
|
1266
|
+
[
|
|
1267
|
+
/\(bb(10);/i
|
|
1268
|
+
],
|
|
1269
|
+
[T, [_, Ge]],
|
|
1270
|
+
[
|
|
1271
|
+
/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i
|
|
1272
|
+
],
|
|
1273
|
+
[T, [_, "Symbian"]],
|
|
1274
|
+
[
|
|
1275
|
+
/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i
|
|
1276
|
+
],
|
|
1277
|
+
[T, [_, ie + " OS"]],
|
|
1278
|
+
[
|
|
1279
|
+
/web0s;.+rt(tv)/i,
|
|
1280
|
+
/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i
|
|
1281
|
+
],
|
|
1282
|
+
[T, [_, "webOS"]],
|
|
1283
|
+
[
|
|
1284
|
+
/crkey\/([\d\.]+)/i
|
|
1285
|
+
],
|
|
1286
|
+
[T, [_, Jt + "cast"]],
|
|
1287
|
+
[
|
|
1288
|
+
/(cros) [\w]+ ([\w\.]+\w)/i
|
|
1289
|
+
],
|
|
1290
|
+
[[_, "Chromium OS"], T],
|
|
1291
|
+
[
|
|
1292
|
+
/(nintendo|playstation) ([wids345portablevuch]+)/i,
|
|
1293
|
+
/(xbox); +xbox ([^\);]+)/i,
|
|
1294
|
+
/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,
|
|
1295
|
+
/(mint)[\/\(\) ]?(\w*)/i,
|
|
1296
|
+
/(mageia|vectorlinux)[; ]/i,
|
|
1297
|
+
/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,
|
|
1298
|
+
/(hurd|linux) ?([\w\.]*)/i,
|
|
1299
|
+
/(gnu) ?([\w\.]*)/i,
|
|
1300
|
+
/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,
|
|
1301
|
+
/(haiku) (\w+)/i
|
|
1302
|
+
],
|
|
1303
|
+
[_, T],
|
|
1304
|
+
[
|
|
1305
|
+
/(sunos) ?([\w\.\d]*)/i
|
|
1306
|
+
],
|
|
1307
|
+
[[_, "Solaris"], T],
|
|
1308
|
+
[
|
|
1309
|
+
/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,
|
|
1310
|
+
/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,
|
|
1311
|
+
/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,
|
|
1312
|
+
/(unix) ?([\w\.]*)/i
|
|
1313
|
+
],
|
|
1314
|
+
[_, T]
|
|
1315
|
+
]
|
|
1316
|
+
}, ot = function(z, q) {
|
|
1317
|
+
if (typeof z === p && (q = z, z = r), !(this instanceof ot))
|
|
1318
|
+
return new ot(z, q).getResult();
|
|
1319
|
+
var A = z || (typeof s !== w && s.navigator && s.navigator.userAgent ? s.navigator.userAgent : a), W = q ? wn(Mt, q) : Mt;
|
|
1320
|
+
return this.getBrowser = function() {
|
|
1321
|
+
var O = {};
|
|
1322
|
+
return O[_] = r, O[T] = r, lt.call(O, A, W.browser), O.major = yn(O.version), O;
|
|
1323
|
+
}, this.getCPU = function() {
|
|
1324
|
+
var O = {};
|
|
1325
|
+
return O[R] = r, lt.call(O, A, W.cpu), O;
|
|
1326
|
+
}, this.getDevice = function() {
|
|
1327
|
+
var O = {};
|
|
1328
|
+
return O[k] = r, O[h] = r, O[y] = r, lt.call(O, A, W.device), O;
|
|
1329
|
+
}, this.getEngine = function() {
|
|
1330
|
+
var O = {};
|
|
1331
|
+
return O[_] = r, O[T] = r, lt.call(O, A, W.engine), O;
|
|
1332
|
+
}, this.getOS = function() {
|
|
1333
|
+
var O = {};
|
|
1334
|
+
return O[_] = r, O[T] = r, lt.call(O, A, W.os), O;
|
|
1335
|
+
}, this.getResult = function() {
|
|
1336
|
+
return {
|
|
1337
|
+
ua: this.getUA(),
|
|
1338
|
+
browser: this.getBrowser(),
|
|
1339
|
+
engine: this.getEngine(),
|
|
1340
|
+
os: this.getOS(),
|
|
1341
|
+
device: this.getDevice(),
|
|
1342
|
+
cpu: this.getCPU()
|
|
1343
|
+
};
|
|
1344
|
+
}, this.getUA = function() {
|
|
1345
|
+
return A;
|
|
1346
|
+
}, this.setUA = function(O) {
|
|
1347
|
+
return A = typeof O === f && O.length > gt ? Qt(O, gt) : O, this;
|
|
1348
|
+
}, this.setUA(A), this;
|
|
1349
|
+
};
|
|
1350
|
+
ot.VERSION = i, ot.BROWSER = Ct([_, T, v]), ot.CPU = Ct([R]), ot.DEVICE = Ct([h, k, y, tt, M, V, C, J, ht]), ot.ENGINE = ot.OS = Ct([_, T]), n.exports && (e = n.exports = ot), e.UAParser = ot;
|
|
1351
|
+
var Nt = typeof s !== w && (s.jQuery || s.Zepto);
|
|
1352
|
+
if (Nt && !Nt.ua) {
|
|
1353
|
+
var oe = new ot();
|
|
1354
|
+
Nt.ua = oe.getResult(), Nt.ua.get = function() {
|
|
1355
|
+
return oe.getUA();
|
|
1356
|
+
}, Nt.ua.set = function(z) {
|
|
1357
|
+
oe.setUA(z);
|
|
1358
|
+
var q = oe.getResult();
|
|
1359
|
+
for (var A in q)
|
|
1360
|
+
Nt.ua[A] = q[A];
|
|
1361
|
+
};
|
|
1362
|
+
}
|
|
1363
|
+
})(typeof window == "object" ? window : _i);
|
|
1364
|
+
})(zn, zn.exports);
|
|
1365
|
+
var Zs = { exports: {} }, Ys = { exports: {} };
|
|
1366
|
+
(function() {
|
|
1367
|
+
var n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", e = {
|
|
1368
|
+
rotl: function(s, r) {
|
|
1369
|
+
return s << r | s >>> 32 - r;
|
|
1370
|
+
},
|
|
1371
|
+
rotr: function(s, r) {
|
|
1372
|
+
return s << 32 - r | s >>> r;
|
|
1373
|
+
},
|
|
1374
|
+
endian: function(s) {
|
|
1375
|
+
if (s.constructor == Number)
|
|
1376
|
+
return e.rotl(s, 8) & 16711935 | e.rotl(s, 24) & 4278255360;
|
|
1377
|
+
for (var r = 0; r < s.length; r++)
|
|
1378
|
+
s[r] = e.endian(s[r]);
|
|
1379
|
+
return s;
|
|
1380
|
+
},
|
|
1381
|
+
randomBytes: function(s) {
|
|
1382
|
+
for (var r = []; s > 0; s--)
|
|
1383
|
+
r.push(Math.floor(Math.random() * 256));
|
|
1384
|
+
return r;
|
|
1385
|
+
},
|
|
1386
|
+
bytesToWords: function(s) {
|
|
1387
|
+
for (var r = [], i = 0, a = 0; i < s.length; i++, a += 8)
|
|
1388
|
+
r[a >>> 5] |= s[i] << 24 - a % 32;
|
|
1389
|
+
return r;
|
|
1390
|
+
},
|
|
1391
|
+
wordsToBytes: function(s) {
|
|
1392
|
+
for (var r = [], i = 0; i < s.length * 32; i += 8)
|
|
1393
|
+
r.push(s[i >>> 5] >>> 24 - i % 32 & 255);
|
|
1394
|
+
return r;
|
|
1395
|
+
},
|
|
1396
|
+
bytesToHex: function(s) {
|
|
1397
|
+
for (var r = [], i = 0; i < s.length; i++)
|
|
1398
|
+
r.push((s[i] >>> 4).toString(16)), r.push((s[i] & 15).toString(16));
|
|
1399
|
+
return r.join("");
|
|
1400
|
+
},
|
|
1401
|
+
hexToBytes: function(s) {
|
|
1402
|
+
for (var r = [], i = 0; i < s.length; i += 2)
|
|
1403
|
+
r.push(parseInt(s.substr(i, 2), 16));
|
|
1404
|
+
return r;
|
|
1405
|
+
},
|
|
1406
|
+
bytesToBase64: function(s) {
|
|
1407
|
+
for (var r = [], i = 0; i < s.length; i += 3)
|
|
1408
|
+
for (var a = s[i] << 16 | s[i + 1] << 8 | s[i + 2], u = 0; u < 4; u++)
|
|
1409
|
+
i * 8 + u * 6 <= s.length * 8 ? r.push(n.charAt(a >>> 6 * (3 - u) & 63)) : r.push("=");
|
|
1410
|
+
return r.join("");
|
|
1411
|
+
},
|
|
1412
|
+
base64ToBytes: function(s) {
|
|
1413
|
+
s = s.replace(/[^A-Z0-9+\/]/ig, "");
|
|
1414
|
+
for (var r = [], i = 0, a = 0; i < s.length; a = ++i % 4)
|
|
1415
|
+
a != 0 && r.push((n.indexOf(s.charAt(i - 1)) & Math.pow(2, -2 * a + 8) - 1) << a * 2 | n.indexOf(s.charAt(i)) >>> 6 - a * 2);
|
|
1416
|
+
return r;
|
|
1417
|
+
}
|
|
1418
|
+
};
|
|
1419
|
+
Ys.exports = e;
|
|
1420
|
+
})();
|
|
1421
|
+
var Hn = {
|
|
1422
|
+
utf8: {
|
|
1423
|
+
stringToBytes: function(n) {
|
|
1424
|
+
return Hn.bin.stringToBytes(unescape(encodeURIComponent(n)));
|
|
1425
|
+
},
|
|
1426
|
+
bytesToString: function(n) {
|
|
1427
|
+
return decodeURIComponent(escape(Hn.bin.bytesToString(n)));
|
|
1428
|
+
}
|
|
1429
|
+
},
|
|
1430
|
+
bin: {
|
|
1431
|
+
stringToBytes: function(n) {
|
|
1432
|
+
for (var e = [], s = 0; s < n.length; s++)
|
|
1433
|
+
e.push(n.charCodeAt(s) & 255);
|
|
1434
|
+
return e;
|
|
1435
|
+
},
|
|
1436
|
+
bytesToString: function(n) {
|
|
1437
|
+
for (var e = [], s = 0; s < n.length; s++)
|
|
1438
|
+
e.push(String.fromCharCode(n[s]));
|
|
1439
|
+
return e.join("");
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1442
|
+
}, ws = Hn;
|
|
1443
|
+
/*!
|
|
1444
|
+
* Determine if an object is a Buffer
|
|
1445
|
+
*
|
|
1446
|
+
* @author Feross Aboukhadijeh <https://feross.org>
|
|
1447
|
+
* @license MIT
|
|
1448
|
+
*/
|
|
1449
|
+
var vi = function(n) {
|
|
1450
|
+
return n != null && (tr(n) || bi(n) || !!n._isBuffer);
|
|
1451
|
+
};
|
|
1452
|
+
function tr(n) {
|
|
1453
|
+
return !!n.constructor && typeof n.constructor.isBuffer == "function" && n.constructor.isBuffer(n);
|
|
1454
|
+
}
|
|
1455
|
+
function bi(n) {
|
|
1456
|
+
return typeof n.readFloatLE == "function" && typeof n.slice == "function" && tr(n.slice(0, 0));
|
|
1457
|
+
}
|
|
1458
|
+
(function() {
|
|
1459
|
+
var n = Ys.exports, e = ws.utf8, s = vi, r = ws.bin, i = function(a, u) {
|
|
1460
|
+
a.constructor == String ? u && u.encoding === "binary" ? a = r.stringToBytes(a) : a = e.stringToBytes(a) : s(a) ? a = Array.prototype.slice.call(a, 0) : !Array.isArray(a) && a.constructor !== Uint8Array && (a = a.toString());
|
|
1461
|
+
for (var l = n.bytesToWords(a), w = a.length * 8, p = 1732584193, f = -271733879, v = -1732584194, h = 271733878, _ = 0; _ < l.length; _++)
|
|
1462
|
+
l[_] = (l[_] << 8 | l[_] >>> 24) & 16711935 | (l[_] << 24 | l[_] >>> 8) & 4278255360;
|
|
1463
|
+
l[w >>> 5] |= 128 << w % 32, l[(w + 64 >>> 9 << 4) + 14] = w;
|
|
1464
|
+
for (var y = i._ff, k = i._gg, T = i._hh, R = i._ii, _ = 0; _ < l.length; _ += 16) {
|
|
1465
|
+
var tt = p, M = f, C = v, V = h;
|
|
1466
|
+
p = y(p, f, v, h, l[_ + 0], 7, -680876936), h = y(h, p, f, v, l[_ + 1], 12, -389564586), v = y(v, h, p, f, l[_ + 2], 17, 606105819), f = y(f, v, h, p, l[_ + 3], 22, -1044525330), p = y(p, f, v, h, l[_ + 4], 7, -176418897), h = y(h, p, f, v, l[_ + 5], 12, 1200080426), v = y(v, h, p, f, l[_ + 6], 17, -1473231341), f = y(f, v, h, p, l[_ + 7], 22, -45705983), p = y(p, f, v, h, l[_ + 8], 7, 1770035416), h = y(h, p, f, v, l[_ + 9], 12, -1958414417), v = y(v, h, p, f, l[_ + 10], 17, -42063), f = y(f, v, h, p, l[_ + 11], 22, -1990404162), p = y(p, f, v, h, l[_ + 12], 7, 1804603682), h = y(h, p, f, v, l[_ + 13], 12, -40341101), v = y(v, h, p, f, l[_ + 14], 17, -1502002290), f = y(f, v, h, p, l[_ + 15], 22, 1236535329), p = k(p, f, v, h, l[_ + 1], 5, -165796510), h = k(h, p, f, v, l[_ + 6], 9, -1069501632), v = k(v, h, p, f, l[_ + 11], 14, 643717713), f = k(f, v, h, p, l[_ + 0], 20, -373897302), p = k(p, f, v, h, l[_ + 5], 5, -701558691), h = k(h, p, f, v, l[_ + 10], 9, 38016083), v = k(v, h, p, f, l[_ + 15], 14, -660478335), f = k(f, v, h, p, l[_ + 4], 20, -405537848), p = k(p, f, v, h, l[_ + 9], 5, 568446438), h = k(h, p, f, v, l[_ + 14], 9, -1019803690), v = k(v, h, p, f, l[_ + 3], 14, -187363961), f = k(f, v, h, p, l[_ + 8], 20, 1163531501), p = k(p, f, v, h, l[_ + 13], 5, -1444681467), h = k(h, p, f, v, l[_ + 2], 9, -51403784), v = k(v, h, p, f, l[_ + 7], 14, 1735328473), f = k(f, v, h, p, l[_ + 12], 20, -1926607734), p = T(p, f, v, h, l[_ + 5], 4, -378558), h = T(h, p, f, v, l[_ + 8], 11, -2022574463), v = T(v, h, p, f, l[_ + 11], 16, 1839030562), f = T(f, v, h, p, l[_ + 14], 23, -35309556), p = T(p, f, v, h, l[_ + 1], 4, -1530992060), h = T(h, p, f, v, l[_ + 4], 11, 1272893353), v = T(v, h, p, f, l[_ + 7], 16, -155497632), f = T(f, v, h, p, l[_ + 10], 23, -1094730640), p = T(p, f, v, h, l[_ + 13], 4, 681279174), h = T(h, p, f, v, l[_ + 0], 11, -358537222), v = T(v, h, p, f, l[_ + 3], 16, -722521979), f = T(f, v, h, p, l[_ + 6], 23, 76029189), p = T(p, f, v, h, l[_ + 9], 4, -640364487), h = T(h, p, f, v, l[_ + 12], 11, -421815835), v = T(v, h, p, f, l[_ + 15], 16, 530742520), f = T(f, v, h, p, l[_ + 2], 23, -995338651), p = R(p, f, v, h, l[_ + 0], 6, -198630844), h = R(h, p, f, v, l[_ + 7], 10, 1126891415), v = R(v, h, p, f, l[_ + 14], 15, -1416354905), f = R(f, v, h, p, l[_ + 5], 21, -57434055), p = R(p, f, v, h, l[_ + 12], 6, 1700485571), h = R(h, p, f, v, l[_ + 3], 10, -1894986606), v = R(v, h, p, f, l[_ + 10], 15, -1051523), f = R(f, v, h, p, l[_ + 1], 21, -2054922799), p = R(p, f, v, h, l[_ + 8], 6, 1873313359), h = R(h, p, f, v, l[_ + 15], 10, -30611744), v = R(v, h, p, f, l[_ + 6], 15, -1560198380), f = R(f, v, h, p, l[_ + 13], 21, 1309151649), p = R(p, f, v, h, l[_ + 4], 6, -145523070), h = R(h, p, f, v, l[_ + 11], 10, -1120210379), v = R(v, h, p, f, l[_ + 2], 15, 718787259), f = R(f, v, h, p, l[_ + 9], 21, -343485551), p = p + tt >>> 0, f = f + M >>> 0, v = v + C >>> 0, h = h + V >>> 0;
|
|
1467
|
+
}
|
|
1468
|
+
return n.endian([p, f, v, h]);
|
|
1469
|
+
};
|
|
1470
|
+
i._ff = function(a, u, l, w, p, f, v) {
|
|
1471
|
+
var h = a + (u & l | ~u & w) + (p >>> 0) + v;
|
|
1472
|
+
return (h << f | h >>> 32 - f) + u;
|
|
1473
|
+
}, i._gg = function(a, u, l, w, p, f, v) {
|
|
1474
|
+
var h = a + (u & w | l & ~w) + (p >>> 0) + v;
|
|
1475
|
+
return (h << f | h >>> 32 - f) + u;
|
|
1476
|
+
}, i._hh = function(a, u, l, w, p, f, v) {
|
|
1477
|
+
var h = a + (u ^ l ^ w) + (p >>> 0) + v;
|
|
1478
|
+
return (h << f | h >>> 32 - f) + u;
|
|
1479
|
+
}, i._ii = function(a, u, l, w, p, f, v) {
|
|
1480
|
+
var h = a + (l ^ (u | ~w)) + (p >>> 0) + v;
|
|
1481
|
+
return (h << f | h >>> 32 - f) + u;
|
|
1482
|
+
}, i._blocksize = 16, i._digestsize = 16, Zs.exports = function(a, u) {
|
|
1483
|
+
if (a == null)
|
|
1484
|
+
throw new Error("Illegal argument " + a);
|
|
1485
|
+
var l = n.wordsToBytes(i(a, u));
|
|
1486
|
+
return u && u.asBytes ? l : u && u.asString ? r.bytesToString(l) : n.bytesToHex(l);
|
|
1487
|
+
};
|
|
1488
|
+
})();
|
|
1489
|
+
const sn = "1.0.17";
|
|
1490
|
+
//! © 2015 Nathan Rugg <nmrugg@gmail.com> | MIT
|
|
1491
|
+
function wi(n) {
|
|
1492
|
+
var e = 1, s = 2, r = 3, i = {}, a = new Worker(n || "./lzma_worker-min.js");
|
|
1493
|
+
return a.onmessage = function(u) {
|
|
1494
|
+
u.data.action === r ? i[u.data.cbn] && typeof i[u.data.cbn].on_progress == "function" && i[u.data.cbn].on_progress(u.data.result) : i[u.data.cbn] && typeof i[u.data.cbn].on_finish == "function" && (i[u.data.cbn].on_finish(u.data.result, u.data.error), delete i[u.data.cbn]);
|
|
1495
|
+
}, a.onerror = function(u) {
|
|
1496
|
+
var l = new Error(u.message + " (" + u.filename + ":" + u.lineno + ")");
|
|
1497
|
+
for (var w in i)
|
|
1498
|
+
i[w].on_finish(null, l);
|
|
1499
|
+
console.error("Uncaught error in lzma_worker", l);
|
|
1500
|
+
}, function() {
|
|
1501
|
+
function u(l, w, p, f, v) {
|
|
1502
|
+
var h;
|
|
1503
|
+
do
|
|
1504
|
+
h = Math.floor(Math.random() * 1e7);
|
|
1505
|
+
while (typeof i[h] < "u");
|
|
1506
|
+
i[h] = {
|
|
1507
|
+
on_finish: f,
|
|
1508
|
+
on_progress: v
|
|
1509
|
+
}, a.postMessage({
|
|
1510
|
+
action: l,
|
|
1511
|
+
cbn: h,
|
|
1512
|
+
data: w,
|
|
1513
|
+
mode: p
|
|
1514
|
+
});
|
|
1515
|
+
}
|
|
1516
|
+
return {
|
|
1517
|
+
compress: function(l, w, p, f) {
|
|
1518
|
+
u(e, l, w, p, f);
|
|
1519
|
+
},
|
|
1520
|
+
decompress: function(l, w, p) {
|
|
1521
|
+
u(s, l, !1, w, p);
|
|
1522
|
+
},
|
|
1523
|
+
worker: function() {
|
|
1524
|
+
return a;
|
|
1525
|
+
}
|
|
1526
|
+
};
|
|
1527
|
+
}();
|
|
1528
|
+
}
|
|
1529
|
+
var Fn = function() {
|
|
1530
|
+
var n = 1, e = 3, s = typeof setImmediate == "function" ? setImmediate : setTimeout, r = 4294967296, i = [4294967295, -r], a = [0, -9223372036854776e3], u = [0, 0], l = [1, 0];
|
|
1531
|
+
function w(t, o) {
|
|
1532
|
+
postMessage({
|
|
1533
|
+
action: e,
|
|
1534
|
+
cbn: o,
|
|
1535
|
+
result: t
|
|
1536
|
+
});
|
|
1537
|
+
}
|
|
1538
|
+
function p(t) {
|
|
1539
|
+
var o = [];
|
|
1540
|
+
return o[t - 1] = void 0, o;
|
|
1541
|
+
}
|
|
1542
|
+
function f(t, o) {
|
|
1543
|
+
return _(t[0] + o[0], t[1] + o[1]);
|
|
1544
|
+
}
|
|
1545
|
+
function v(t, o) {
|
|
1546
|
+
return R(~~Math.max(Math.min(t[1] / r, 2147483647), -2147483648) & ~~Math.max(Math.min(o[1] / r, 2147483647), -2147483648), T(t) & T(o));
|
|
1547
|
+
}
|
|
1548
|
+
function h(t, o) {
|
|
1549
|
+
var c, d;
|
|
1550
|
+
return t[0] == o[0] && t[1] == o[1] ? 0 : (c = t[1] < 0, d = o[1] < 0, c && !d ? -1 : !c && d ? 1 : J(t, o)[1] < 0 ? -1 : 1);
|
|
1551
|
+
}
|
|
1552
|
+
function _(t, o) {
|
|
1553
|
+
var c, d;
|
|
1554
|
+
for (o %= 18446744073709552e3, t %= 18446744073709552e3, c = o % r, d = Math.floor(t / r) * r, o = o - c + d, t = t - d + c; t < 0; )
|
|
1555
|
+
t += r, o -= r;
|
|
1556
|
+
for (; t > 4294967295; )
|
|
1557
|
+
t -= r, o += r;
|
|
1558
|
+
for (o = o % 18446744073709552e3; o > 9223372032559809e3; )
|
|
1559
|
+
o -= 18446744073709552e3;
|
|
1560
|
+
for (; o < -9223372036854776e3; )
|
|
1561
|
+
o += 18446744073709552e3;
|
|
1562
|
+
return [t, o];
|
|
1563
|
+
}
|
|
1564
|
+
function y(t, o) {
|
|
1565
|
+
return t[0] == o[0] && t[1] == o[1];
|
|
1566
|
+
}
|
|
1567
|
+
function k(t) {
|
|
1568
|
+
return t >= 0 ? [t, 0] : [t + r, -r];
|
|
1569
|
+
}
|
|
1570
|
+
function T(t) {
|
|
1571
|
+
return t[0] >= 2147483648 ? ~~Math.max(Math.min(t[0] - r, 2147483647), -2147483648) : ~~Math.max(Math.min(t[0], 2147483647), -2147483648);
|
|
1572
|
+
}
|
|
1573
|
+
function R(t, o) {
|
|
1574
|
+
var c, d;
|
|
1575
|
+
return c = t * r, d = o, o < 0 && (d += r), [d, c];
|
|
1576
|
+
}
|
|
1577
|
+
function tt(t) {
|
|
1578
|
+
return t <= 30 ? 1 << t : tt(30) * tt(t - 30);
|
|
1579
|
+
}
|
|
1580
|
+
function M(t, o) {
|
|
1581
|
+
var c, d, m, g;
|
|
1582
|
+
if (o &= 63, y(t, a))
|
|
1583
|
+
return o ? u : t;
|
|
1584
|
+
if (t[1] < 0)
|
|
1585
|
+
throw new Error("Neg");
|
|
1586
|
+
return g = tt(o), d = t[1] * g % 18446744073709552e3, m = t[0] * g, c = m - m % r, d += c, m -= c, d >= 9223372036854776e3 && (d -= 18446744073709552e3), [m, d];
|
|
1587
|
+
}
|
|
1588
|
+
function C(t, o) {
|
|
1589
|
+
var c;
|
|
1590
|
+
return o &= 63, c = tt(o), _(Math.floor(t[0] / c), t[1] / c);
|
|
1591
|
+
}
|
|
1592
|
+
function V(t, o) {
|
|
1593
|
+
var c;
|
|
1594
|
+
return o &= 63, c = C(t, o), t[1] < 0 && (c = f(c, M([2, 0], 63 - o))), c;
|
|
1595
|
+
}
|
|
1596
|
+
function J(t, o) {
|
|
1597
|
+
return _(t[0] - o[0], t[1] - o[1]);
|
|
1598
|
+
}
|
|
1599
|
+
function ht(t, o) {
|
|
1600
|
+
return t.buf = o, t.pos = 0, t.count = o.length, t;
|
|
1601
|
+
}
|
|
1602
|
+
function gt(t, o, c, d) {
|
|
1603
|
+
return t.pos >= t.count ? -1 : (d = Math.min(d, t.count - t.pos), Jt(t.buf, t.pos, o, c, d), t.pos += d, d);
|
|
1604
|
+
}
|
|
1605
|
+
function zt(t) {
|
|
1606
|
+
return t.buf = p(32), t.count = 0, t;
|
|
1607
|
+
}
|
|
1608
|
+
function re(t) {
|
|
1609
|
+
var o = t.buf;
|
|
1610
|
+
return o.length = t.count, o;
|
|
1611
|
+
}
|
|
1612
|
+
function Se(t, o) {
|
|
1613
|
+
t.buf[t.count++] = o << 24 >> 24;
|
|
1614
|
+
}
|
|
1615
|
+
function Ge(t, o, c, d) {
|
|
1616
|
+
Jt(o, c, t.buf, t.count, d), t.count += d;
|
|
1617
|
+
}
|
|
1618
|
+
function Ht(t, o, c, d, m) {
|
|
1619
|
+
var g;
|
|
1620
|
+
for (g = o; g < c; ++g)
|
|
1621
|
+
d[m++] = t.charCodeAt(g);
|
|
1622
|
+
}
|
|
1623
|
+
function Jt(t, o, c, d, m) {
|
|
1624
|
+
for (var g = 0; g < m; ++g)
|
|
1625
|
+
c[d + g] = t[o + g];
|
|
1626
|
+
}
|
|
1627
|
+
function bn(t, o) {
|
|
1628
|
+
xr(o, 1 << t.s), o._numFastBytes = t.f, Br(o, t.m), o._numLiteralPosStateBits = 0, o._numLiteralContextBits = 3, o._posStateBits = 2, o._posStateMask = 3;
|
|
1629
|
+
}
|
|
1630
|
+
function ie(t, o, c, d, m) {
|
|
1631
|
+
var g, S;
|
|
1632
|
+
if (h(d, i) < 0)
|
|
1633
|
+
throw new Error("invalid length " + d);
|
|
1634
|
+
for (t.length_0 = d, g = q({}), bn(m, g), g._writeEndMark = typeof Fn.disableEndMark > "u", Cr(g, c), S = 0; S < 64; S += 8)
|
|
1635
|
+
Se(c, T(C(d, S)) & 255);
|
|
1636
|
+
t.chunker = (g._needReleaseMFStream = 0, g._inStream = o, g._finished = 0, z(g), g._rangeEncoder.Stream = c, Ke(g), W(g), A(g), g._lenEncoder._tableSize = g._numFastBytes + 1 - 2, ss(g._lenEncoder, 1 << g._posStateBits), g._repMatchLenEncoder._tableSize = g._numFastBytes + 1 - 2, ss(g._repMatchLenEncoder, 1 << g._posStateBits), g.nowPos64 = u, Be({}, g));
|
|
1637
|
+
}
|
|
1638
|
+
function Gt(t, o, c) {
|
|
1639
|
+
return t.output = zt({}), ie(t, ht({}, o), t.output, k(o.length), c), t;
|
|
1640
|
+
}
|
|
1641
|
+
function Xe(t, o, c, d) {
|
|
1642
|
+
var m;
|
|
1643
|
+
t._keepSizeBefore = o, t._keepSizeAfter = c, m = o + c + d, (t._bufferBase == null || t._blockSize != m) && (t._bufferBase = null, t._blockSize = m, t._bufferBase = p(t._blockSize)), t._pointerToLastSafePosition = t._blockSize - c;
|
|
1644
|
+
}
|
|
1645
|
+
function Y(t, o) {
|
|
1646
|
+
return t._bufferBase[t._bufferOffset + t._pos + o];
|
|
1647
|
+
}
|
|
1648
|
+
function Tt(t, o, c, d) {
|
|
1649
|
+
var m, g;
|
|
1650
|
+
for (t._streamEndWasReached && t._pos + o + d > t._streamPos && (d = t._streamPos - (t._pos + o)), ++c, g = t._bufferOffset + t._pos + o, m = 0; m < d && t._bufferBase[g + m] == t._bufferBase[g + m - c]; ++m)
|
|
1651
|
+
;
|
|
1652
|
+
return m;
|
|
1653
|
+
}
|
|
1654
|
+
function Ft(t) {
|
|
1655
|
+
return t._streamPos - t._pos;
|
|
1656
|
+
}
|
|
1657
|
+
function ae(t) {
|
|
1658
|
+
var o, c, d;
|
|
1659
|
+
for (d = t._bufferOffset + t._pos - t._keepSizeBefore, d > 0 && --d, c = t._bufferOffset + t._streamPos - d, o = 0; o < c; ++o)
|
|
1660
|
+
t._bufferBase[o] = t._bufferBase[d + o];
|
|
1661
|
+
t._bufferOffset -= d;
|
|
1662
|
+
}
|
|
1663
|
+
function Pe(t) {
|
|
1664
|
+
var o;
|
|
1665
|
+
++t._pos, t._pos > t._posLimit && (o = t._bufferOffset + t._pos, o > t._pointerToLastSafePosition && ae(t), Le(t));
|
|
1666
|
+
}
|
|
1667
|
+
function Le(t) {
|
|
1668
|
+
var o, c, d;
|
|
1669
|
+
if (!t._streamEndWasReached)
|
|
1670
|
+
for (; ; ) {
|
|
1671
|
+
if (d = -t._bufferOffset + t._blockSize - t._streamPos, !d)
|
|
1672
|
+
return;
|
|
1673
|
+
if (o = gt(t._stream, t._bufferBase, t._bufferOffset + t._streamPos, d), o == -1) {
|
|
1674
|
+
t._posLimit = t._streamPos, c = t._bufferOffset + t._posLimit, c > t._pointerToLastSafePosition && (t._posLimit = t._pointerToLastSafePosition - t._bufferOffset), t._streamEndWasReached = 1;
|
|
1675
|
+
return;
|
|
1676
|
+
}
|
|
1677
|
+
t._streamPos += o, t._streamPos >= t._pos + t._keepSizeAfter && (t._posLimit = t._streamPos - t._keepSizeAfter);
|
|
1678
|
+
}
|
|
1679
|
+
}
|
|
1680
|
+
function Xt(t, o) {
|
|
1681
|
+
t._bufferOffset += o, t._posLimit -= o, t._pos -= o, t._streamPos -= o;
|
|
1682
|
+
}
|
|
1683
|
+
var It = function() {
|
|
1684
|
+
var t, o, c, d = [];
|
|
1685
|
+
for (t = 0; t < 256; ++t) {
|
|
1686
|
+
for (c = t, o = 0; o < 8; ++o)
|
|
1687
|
+
(c & 1) != 0 ? c = c >>> 1 ^ -306674912 : c >>>= 1;
|
|
1688
|
+
d[t] = c;
|
|
1689
|
+
}
|
|
1690
|
+
return d;
|
|
1691
|
+
}();
|
|
1692
|
+
function Ee(t, o, c, d, m) {
|
|
1693
|
+
var g, S, B;
|
|
1694
|
+
o < 1073741567 && (t._cutValue = 16 + (d >> 1), B = ~~((o + c + d + m) / 2) + 256, Xe(t, o + c, d + m, B), t._matchMaxLen = d, g = o + 1, t._cyclicBufferSize != g && (t._son = p((t._cyclicBufferSize = g) * 2)), S = 65536, t.HASH_ARRAY && (S = o - 1, S |= S >> 1, S |= S >> 2, S |= S >> 4, S |= S >> 8, S >>= 1, S |= 65535, S > 16777216 && (S >>= 1), t._hashMask = S, ++S, S += t.kFixHashSize), S != t._hashSizeSum && (t._hash = p(t._hashSizeSum = S)));
|
|
1695
|
+
}
|
|
1696
|
+
function We(t, o) {
|
|
1697
|
+
var c, d, m, g, S, B, D, L, x, X, H, F, et, P, N, K, j, vt, st, bt, St;
|
|
1698
|
+
if (t._pos + t._matchMaxLen <= t._streamPos)
|
|
1699
|
+
P = t._matchMaxLen;
|
|
1700
|
+
else if (P = t._streamPos - t._pos, P < t.kMinMatchCheck)
|
|
1701
|
+
return Ct(t), 0;
|
|
1702
|
+
for (j = 0, N = t._pos > t._cyclicBufferSize ? t._pos - t._cyclicBufferSize : 0, d = t._bufferOffset + t._pos, K = 1, L = 0, x = 0, t.HASH_ARRAY ? (St = It[t._bufferBase[d] & 255] ^ t._bufferBase[d + 1] & 255, L = St & 1023, St ^= (t._bufferBase[d + 2] & 255) << 8, x = St & 65535, X = (St ^ It[t._bufferBase[d + 3] & 255] << 5) & t._hashMask) : X = t._bufferBase[d] & 255 ^ (t._bufferBase[d + 1] & 255) << 8, m = t._hash[t.kFixHashSize + X] || 0, t.HASH_ARRAY && (g = t._hash[L] || 0, S = t._hash[1024 + x] || 0, t._hash[L] = t._pos, t._hash[1024 + x] = t._pos, g > N && t._bufferBase[t._bufferOffset + g] == t._bufferBase[d] && (o[j++] = K = 2, o[j++] = t._pos - g - 1), S > N && t._bufferBase[t._bufferOffset + S] == t._bufferBase[d] && (S == g && (j -= 2), o[j++] = K = 3, o[j++] = t._pos - S - 1, g = S), j != 0 && g == m && (j -= 2, K = 1)), t._hash[t.kFixHashSize + X] = t._pos, st = (t._cyclicBufferPos << 1) + 1, bt = t._cyclicBufferPos << 1, F = et = t.kNumHashDirectBytes, t.kNumHashDirectBytes != 0 && m > N && t._bufferBase[t._bufferOffset + m + t.kNumHashDirectBytes] != t._bufferBase[d + t.kNumHashDirectBytes] && (o[j++] = K = t.kNumHashDirectBytes, o[j++] = t._pos - m - 1), c = t._cutValue; ; ) {
|
|
1703
|
+
if (m <= N || c-- == 0) {
|
|
1704
|
+
t._son[st] = t._son[bt] = 0;
|
|
1705
|
+
break;
|
|
1706
|
+
}
|
|
1707
|
+
if (D = t._pos - m, B = (D <= t._cyclicBufferPos ? t._cyclicBufferPos - D : t._cyclicBufferPos - D + t._cyclicBufferSize) << 1, vt = t._bufferOffset + m, H = F < et ? F : et, t._bufferBase[vt + H] == t._bufferBase[d + H]) {
|
|
1708
|
+
for (; ++H != P && t._bufferBase[vt + H] == t._bufferBase[d + H]; )
|
|
1709
|
+
;
|
|
1710
|
+
if (K < H && (o[j++] = K = H, o[j++] = D - 1, H == P)) {
|
|
1711
|
+
t._son[bt] = t._son[B], t._son[st] = t._son[B + 1];
|
|
1712
|
+
break;
|
|
1713
|
+
}
|
|
1714
|
+
}
|
|
1715
|
+
(t._bufferBase[vt + H] & 255) < (t._bufferBase[d + H] & 255) ? (t._son[bt] = m, bt = B + 1, m = t._son[bt], et = H) : (t._son[st] = m, st = B, m = t._son[st], F = H);
|
|
1716
|
+
}
|
|
1717
|
+
return Ct(t), j;
|
|
1718
|
+
}
|
|
1719
|
+
function wn(t) {
|
|
1720
|
+
t._bufferOffset = 0, t._pos = 0, t._streamPos = 0, t._streamEndWasReached = 0, Le(t), t._cyclicBufferPos = 0, Xt(t, -1);
|
|
1721
|
+
}
|
|
1722
|
+
function Ct(t) {
|
|
1723
|
+
var o;
|
|
1724
|
+
++t._cyclicBufferPos >= t._cyclicBufferSize && (t._cyclicBufferPos = 0), Pe(t), t._pos == 1073741823 && (o = t._pos - t._cyclicBufferSize, xe(t._son, t._cyclicBufferSize * 2, o), xe(t._hash, t._hashSizeSum, o), Xt(t, o));
|
|
1725
|
+
}
|
|
1726
|
+
function xe(t, o, c) {
|
|
1727
|
+
var d, m;
|
|
1728
|
+
for (d = 0; d < o; ++d)
|
|
1729
|
+
m = t[d] || 0, m <= c ? m = 0 : m -= c, t[d] = m;
|
|
1730
|
+
}
|
|
1731
|
+
function Wt(t, o) {
|
|
1732
|
+
t.HASH_ARRAY = o > 2, t.HASH_ARRAY ? (t.kNumHashDirectBytes = 0, t.kMinMatchCheck = 4, t.kFixHashSize = 66560) : (t.kNumHashDirectBytes = 2, t.kMinMatchCheck = 3, t.kFixHashSize = 0);
|
|
1733
|
+
}
|
|
1734
|
+
function yn(t, o) {
|
|
1735
|
+
var c, d, m, g, S, B, D, L, x, X, H, F, et, P, N, K, j;
|
|
1736
|
+
do {
|
|
1737
|
+
if (t._pos + t._matchMaxLen <= t._streamPos)
|
|
1738
|
+
F = t._matchMaxLen;
|
|
1739
|
+
else if (F = t._streamPos - t._pos, F < t.kMinMatchCheck) {
|
|
1740
|
+
Ct(t);
|
|
1741
|
+
continue;
|
|
1742
|
+
}
|
|
1743
|
+
for (et = t._pos > t._cyclicBufferSize ? t._pos - t._cyclicBufferSize : 0, d = t._bufferOffset + t._pos, t.HASH_ARRAY ? (j = It[t._bufferBase[d] & 255] ^ t._bufferBase[d + 1] & 255, B = j & 1023, t._hash[B] = t._pos, j ^= (t._bufferBase[d + 2] & 255) << 8, D = j & 65535, t._hash[1024 + D] = t._pos, L = (j ^ It[t._bufferBase[d + 3] & 255] << 5) & t._hashMask) : L = t._bufferBase[d] & 255 ^ (t._bufferBase[d + 1] & 255) << 8, m = t._hash[t.kFixHashSize + L], t._hash[t.kFixHashSize + L] = t._pos, N = (t._cyclicBufferPos << 1) + 1, K = t._cyclicBufferPos << 1, X = H = t.kNumHashDirectBytes, c = t._cutValue; ; ) {
|
|
1744
|
+
if (m <= et || c-- == 0) {
|
|
1745
|
+
t._son[N] = t._son[K] = 0;
|
|
1746
|
+
break;
|
|
1747
|
+
}
|
|
1748
|
+
if (S = t._pos - m, g = (S <= t._cyclicBufferPos ? t._cyclicBufferPos - S : t._cyclicBufferPos - S + t._cyclicBufferSize) << 1, P = t._bufferOffset + m, x = X < H ? X : H, t._bufferBase[P + x] == t._bufferBase[d + x]) {
|
|
1749
|
+
for (; ++x != F && t._bufferBase[P + x] == t._bufferBase[d + x]; )
|
|
1750
|
+
;
|
|
1751
|
+
if (x == F) {
|
|
1752
|
+
t._son[K] = t._son[g], t._son[N] = t._son[g + 1];
|
|
1753
|
+
break;
|
|
1754
|
+
}
|
|
1755
|
+
}
|
|
1756
|
+
(t._bufferBase[P + x] & 255) < (t._bufferBase[d + x] & 255) ? (t._son[K] = m, K = g + 1, m = t._son[K], H = x) : (t._son[N] = m, N = g, m = t._son[N], X = x);
|
|
1757
|
+
}
|
|
1758
|
+
Ct(t);
|
|
1759
|
+
} while (--o != 0);
|
|
1760
|
+
}
|
|
1761
|
+
function Qt(t) {
|
|
1762
|
+
return t -= 2, t < 4 ? t : 3;
|
|
1763
|
+
}
|
|
1764
|
+
function lt(t) {
|
|
1765
|
+
return t < 4 ? 0 : t < 10 ? t - 3 : t - 6;
|
|
1766
|
+
}
|
|
1767
|
+
function Be(t, o) {
|
|
1768
|
+
return t.encoder = o, t.decoder = null, t.alive = 1, t;
|
|
1769
|
+
}
|
|
1770
|
+
function Qe(t) {
|
|
1771
|
+
if (!t.alive)
|
|
1772
|
+
throw new Error("bad state");
|
|
1773
|
+
if (t.encoder)
|
|
1774
|
+
Ve(t);
|
|
1775
|
+
else
|
|
1776
|
+
throw new Error("No decoding");
|
|
1777
|
+
return t.alive;
|
|
1778
|
+
}
|
|
1779
|
+
function Ve(t) {
|
|
1780
|
+
oe(t.encoder, t.encoder.processedInSize, t.encoder.processedOutSize, t.encoder.finished), t.inBytesProcessed = t.encoder.processedInSize[0], t.encoder.finished[0] && (Er(t.encoder), t.alive = 0);
|
|
1781
|
+
}
|
|
1782
|
+
var Mt = function() {
|
|
1783
|
+
var t, o, c, d = 2, m = [0, 1];
|
|
1784
|
+
for (c = 2; c < 22; ++c)
|
|
1785
|
+
for (o = 1 << (c >> 1) - 1, t = 0; t < o; ++t, ++d)
|
|
1786
|
+
m[d] = c << 24 >> 24;
|
|
1787
|
+
return m;
|
|
1788
|
+
}();
|
|
1789
|
+
function ot(t, o) {
|
|
1790
|
+
var c, d, m, g;
|
|
1791
|
+
t._optimumEndIndex = o, m = t._optimum[o].PosPrev, d = t._optimum[o].BackPrev;
|
|
1792
|
+
do
|
|
1793
|
+
t._optimum[o].Prev1IsChar && (is(t._optimum[m]), t._optimum[m].PosPrev = m - 1, t._optimum[o].Prev2 && (t._optimum[m - 1].Prev1IsChar = 0, t._optimum[m - 1].PosPrev = t._optimum[o].PosPrev2, t._optimum[m - 1].BackPrev = t._optimum[o].BackPrev2)), g = m, c = d, d = t._optimum[g].BackPrev, m = t._optimum[g].PosPrev, t._optimum[g].BackPrev = c, t._optimum[g].PosPrev = o, o = g;
|
|
1794
|
+
while (o > 0);
|
|
1795
|
+
return t.backRes = t._optimum[0].BackPrev, t._optimumCurrentIndex = t._optimum[0].PosPrev, t._optimumCurrentIndex;
|
|
1796
|
+
}
|
|
1797
|
+
function Nt(t) {
|
|
1798
|
+
t._state = 0, t._previousByte = 0;
|
|
1799
|
+
for (var o = 0; o < 4; ++o)
|
|
1800
|
+
t._repDistances[o] = 0;
|
|
1801
|
+
}
|
|
1802
|
+
function oe(t, o, c, d) {
|
|
1803
|
+
var m, g, S, B, D, L, x, X, H, F, et, P, N, K, j;
|
|
1804
|
+
if (o[0] = u, c[0] = u, d[0] = 1, t._inStream && (t._matchFinder._stream = t._inStream, wn(t._matchFinder), t._needReleaseMFStream = 1, t._inStream = null), !t._finished) {
|
|
1805
|
+
if (t._finished = 1, K = t.nowPos64, y(t.nowPos64, u)) {
|
|
1806
|
+
if (!Ft(t._matchFinder)) {
|
|
1807
|
+
O(t, T(t.nowPos64));
|
|
1808
|
+
return;
|
|
1809
|
+
}
|
|
1810
|
+
kn(t), N = T(t.nowPos64) & t._posStateMask, Q(t._rangeEncoder, t._isMatch, (t._state << 4) + N, 0), t._state = lt(t._state), S = Y(t._matchFinder, -t._additionalOffset), rs(ue(t._literalEncoder, T(t.nowPos64), t._previousByte), t._rangeEncoder, S), t._previousByte = S, --t._additionalOffset, t.nowPos64 = f(t.nowPos64, l);
|
|
1811
|
+
}
|
|
1812
|
+
if (!Ft(t._matchFinder)) {
|
|
1813
|
+
O(t, T(t.nowPos64));
|
|
1814
|
+
return;
|
|
1815
|
+
}
|
|
1816
|
+
for (; ; ) {
|
|
1817
|
+
if (x = ce(t, T(t.nowPos64)), F = t.backRes, N = T(t.nowPos64) & t._posStateMask, g = (t._state << 4) + N, x == 1 && F == -1)
|
|
1818
|
+
Q(t._rangeEncoder, t._isMatch, g, 0), S = Y(t._matchFinder, -t._additionalOffset), j = ue(t._literalEncoder, T(t.nowPos64), t._previousByte), t._state < 7 ? rs(j, t._rangeEncoder, S) : (H = Y(t._matchFinder, -t._repDistances[0] - 1 - t._additionalOffset), Hr(j, t._rangeEncoder, H, S)), t._previousByte = S, t._state = lt(t._state);
|
|
1819
|
+
else {
|
|
1820
|
+
if (Q(t._rangeEncoder, t._isMatch, g, 1), F < 4) {
|
|
1821
|
+
if (Q(t._rangeEncoder, t._isRep, t._state, 1), F ? (Q(t._rangeEncoder, t._isRepG0, t._state, 1), F == 1 ? Q(t._rangeEncoder, t._isRepG1, t._state, 0) : (Q(t._rangeEncoder, t._isRepG1, t._state, 1), Q(t._rangeEncoder, t._isRepG2, t._state, F - 2))) : (Q(t._rangeEncoder, t._isRepG0, t._state, 0), x == 1 ? Q(t._rangeEncoder, t._isRep0Long, g, 0) : Q(t._rangeEncoder, t._isRep0Long, g, 1)), x == 1 ? t._state = t._state < 7 ? 9 : 11 : (Sn(t._repMatchLenEncoder, t._rangeEncoder, x - 2, N), t._state = t._state < 7 ? 8 : 11), B = t._repDistances[F], F != 0) {
|
|
1822
|
+
for (L = F; L >= 1; --L)
|
|
1823
|
+
t._repDistances[L] = t._repDistances[L - 1];
|
|
1824
|
+
t._repDistances[0] = B;
|
|
1825
|
+
}
|
|
1826
|
+
} else {
|
|
1827
|
+
for (Q(t._rangeEncoder, t._isRep, t._state, 0), t._state = t._state < 7 ? 7 : 10, Sn(t._lenEncoder, t._rangeEncoder, x - 2, N), F -= 4, P = Tn(F), X = Qt(x), Re(t._posSlotEncoder[X], t._rangeEncoder, P), P >= 4 && (D = (P >> 1) - 1, m = (2 | P & 1) << D, et = F - m, P < 14 ? jr(t._posEncoders, m - P - 1, t._rangeEncoder, D, et) : (os(t._rangeEncoder, et >> 4, D - 4), as(t._posAlignEncoder, t._rangeEncoder, et & 15), ++t._alignPriceCount)), B = F, L = 3; L >= 1; --L)
|
|
1828
|
+
t._repDistances[L] = t._repDistances[L - 1];
|
|
1829
|
+
t._repDistances[0] = B, ++t._matchPriceCount;
|
|
1830
|
+
}
|
|
1831
|
+
t._previousByte = Y(t._matchFinder, x - 1 - t._additionalOffset);
|
|
1832
|
+
}
|
|
1833
|
+
if (t._additionalOffset -= x, t.nowPos64 = f(t.nowPos64, k(x)), !t._additionalOffset) {
|
|
1834
|
+
if (t._matchPriceCount >= 128 && W(t), t._alignPriceCount >= 16 && A(t), o[0] = t.nowPos64, c[0] = qr(t._rangeEncoder), !Ft(t._matchFinder)) {
|
|
1835
|
+
O(t, T(t.nowPos64));
|
|
1836
|
+
return;
|
|
1837
|
+
}
|
|
1838
|
+
if (h(J(t.nowPos64, K), [4096, 0]) >= 0) {
|
|
1839
|
+
t._finished = 0, d[0] = 0;
|
|
1840
|
+
return;
|
|
1841
|
+
}
|
|
1842
|
+
}
|
|
1843
|
+
}
|
|
1844
|
+
}
|
|
1845
|
+
}
|
|
1846
|
+
function z(t) {
|
|
1847
|
+
var o, c;
|
|
1848
|
+
t._matchFinder || (o = {}, c = 4, t._matchFinderType || (c = 2), Wt(o, c), t._matchFinder = o), Or(t._literalEncoder, t._numLiteralPosStateBits, t._numLiteralContextBits), !(t._dictionarySize == t._dictionarySizePrev && t._numFastBytesPrev == t._numFastBytes) && (Ee(t._matchFinder, t._dictionarySize, 4096, t._numFastBytes, 274), t._dictionarySizePrev = t._dictionarySize, t._numFastBytesPrev = t._numFastBytes);
|
|
1849
|
+
}
|
|
1850
|
+
function q(t) {
|
|
1851
|
+
var o;
|
|
1852
|
+
for (t._repDistances = p(4), t._optimum = [], t._rangeEncoder = {}, t._isMatch = p(192), t._isRep = p(12), t._isRepG0 = p(12), t._isRepG1 = p(12), t._isRepG2 = p(12), t._isRep0Long = p(192), t._posSlotEncoder = [], t._posEncoders = p(114), t._posAlignEncoder = Me({}, 4), t._lenEncoder = ns({}), t._repMatchLenEncoder = ns({}), t._literalEncoder = {}, t._matchDistances = [], t._posSlotPrices = [], t._distancesPrices = [], t._alignPrices = p(16), t.reps = p(4), t.repLens = p(4), t.processedInSize = [u], t.processedOutSize = [u], t.finished = [0], t.properties = p(5), t.tempPrices = p(128), t._longestMatchLength = 0, t._matchFinderType = 1, t._numDistancePairs = 0, t._numFastBytesPrev = -1, t.backRes = 0, o = 0; o < 4096; ++o)
|
|
1853
|
+
t._optimum[o] = {};
|
|
1854
|
+
for (o = 0; o < 4; ++o)
|
|
1855
|
+
t._posSlotEncoder[o] = Me({}, 6);
|
|
1856
|
+
return t;
|
|
1857
|
+
}
|
|
1858
|
+
function A(t) {
|
|
1859
|
+
for (var o = 0; o < 16; ++o)
|
|
1860
|
+
t._alignPrices[o] = Nr(t._posAlignEncoder, o);
|
|
1861
|
+
t._alignPriceCount = 0;
|
|
1862
|
+
}
|
|
1863
|
+
function W(t) {
|
|
1864
|
+
var o, c, d, m, g, S, B, D;
|
|
1865
|
+
for (m = 4; m < 128; ++m)
|
|
1866
|
+
S = Tn(m), d = (S >> 1) - 1, o = (2 | S & 1) << d, t.tempPrices[m] = Ur(t._posEncoders, o - S - 1, d, m - o);
|
|
1867
|
+
for (g = 0; g < 4; ++g) {
|
|
1868
|
+
for (c = t._posSlotEncoder[g], B = g << 6, S = 0; S < t._distTableSize; ++S)
|
|
1869
|
+
t._posSlotPrices[B + S] = Ye(c, S);
|
|
1870
|
+
for (S = 14; S < t._distTableSize; ++S)
|
|
1871
|
+
t._posSlotPrices[B + S] += (S >> 1) - 1 - 4 << 6;
|
|
1872
|
+
for (D = g * 128, m = 0; m < 4; ++m)
|
|
1873
|
+
t._distancesPrices[D + m] = t._posSlotPrices[B + m];
|
|
1874
|
+
for (; m < 128; ++m)
|
|
1875
|
+
t._distancesPrices[D + m] = t._posSlotPrices[B + Tn(m)] + t.tempPrices[m];
|
|
1876
|
+
}
|
|
1877
|
+
t._matchPriceCount = 0;
|
|
1878
|
+
}
|
|
1879
|
+
function O(t, o) {
|
|
1880
|
+
Yn(t), Mr(t, o & t._posStateMask);
|
|
1881
|
+
for (var c = 0; c < 5; ++c)
|
|
1882
|
+
Pn(t._rangeEncoder);
|
|
1883
|
+
}
|
|
1884
|
+
function ce(t, o) {
|
|
1885
|
+
var c, d, m, g, S, B, D, L, x, X, H, F, et, P, N, K, j, vt, st, bt, St, pt, he, tn, wt, Pt, Lt, ut, Rt, Z, E, jt, Kt, rt, it, ls, yt, Ae, Zt, Dt, le, Oe, U, nt, pe, ps, ds, ms, fs, gs;
|
|
1886
|
+
if (t._optimumEndIndex != t._optimumCurrentIndex)
|
|
1887
|
+
return et = t._optimum[t._optimumCurrentIndex].PosPrev - t._optimumCurrentIndex, t.backRes = t._optimum[t._optimumCurrentIndex].BackPrev, t._optimumCurrentIndex = t._optimum[t._optimumCurrentIndex].PosPrev, et;
|
|
1888
|
+
if (t._optimumCurrentIndex = t._optimumEndIndex = 0, t._longestMatchWasFound ? (F = t._longestMatchLength, t._longestMatchWasFound = 0) : F = kn(t), Lt = t._numDistancePairs, wt = Ft(t._matchFinder) + 1, wt < 2)
|
|
1889
|
+
return t.backRes = -1, 1;
|
|
1890
|
+
for (wt > 273 && (wt = 273), Dt = 0, x = 0; x < 4; ++x)
|
|
1891
|
+
t.reps[x] = t._repDistances[x], t.repLens[x] = Tt(t._matchFinder, -1, t.reps[x], 273), t.repLens[x] > t.repLens[Dt] && (Dt = x);
|
|
1892
|
+
if (t.repLens[Dt] >= t._numFastBytes)
|
|
1893
|
+
return t.backRes = Dt, et = t.repLens[Dt], Ce(t, et - 1), et;
|
|
1894
|
+
if (F >= t._numFastBytes)
|
|
1895
|
+
return t.backRes = t._matchDistances[Lt - 1] + 4, Ce(t, F - 1), F;
|
|
1896
|
+
if (D = Y(t._matchFinder, -1), j = Y(t._matchFinder, -t._repDistances[0] - 1 - 1), F < 2 && D != j && t.repLens[Dt] < 2)
|
|
1897
|
+
return t.backRes = -1, 1;
|
|
1898
|
+
if (t._optimum[0].State = t._state, rt = o & t._posStateMask, t._optimum[1].Price = $[t._isMatch[(t._state << 4) + rt] >>> 2] + Ze(ue(t._literalEncoder, o, t._previousByte), t._state >= 7, j, D), is(t._optimum[1]), vt = $[2048 - t._isMatch[(t._state << 4) + rt] >>> 2], Zt = vt + $[2048 - t._isRep[t._state] >>> 2], j == D && (le = Zt + _t(t, t._state, rt), le < t._optimum[1].Price && (t._optimum[1].Price = le, Ir(t._optimum[1]))), H = F >= t.repLens[Dt] ? F : t.repLens[Dt], H < 2)
|
|
1899
|
+
return t.backRes = t._optimum[1].BackPrev, 1;
|
|
1900
|
+
t._optimum[1].PosPrev = 0, t._optimum[0].Backs0 = t.reps[0], t._optimum[0].Backs1 = t.reps[1], t._optimum[0].Backs2 = t.reps[2], t._optimum[0].Backs3 = t.reps[3], X = H;
|
|
1901
|
+
do
|
|
1902
|
+
t._optimum[X--].Price = 268435455;
|
|
1903
|
+
while (X >= 2);
|
|
1904
|
+
for (x = 0; x < 4; ++x)
|
|
1905
|
+
if (Ae = t.repLens[x], !(Ae < 2)) {
|
|
1906
|
+
ls = Zt + dt(t, x, t._state, rt);
|
|
1907
|
+
do
|
|
1908
|
+
g = ls + Vt(t._repMatchLenEncoder, Ae - 2, rt), E = t._optimum[Ae], g < E.Price && (E.Price = g, E.PosPrev = 0, E.BackPrev = x, E.Prev1IsChar = 0);
|
|
1909
|
+
while (--Ae >= 2);
|
|
1910
|
+
}
|
|
1911
|
+
if (tn = vt + $[t._isRep[t._state] >>> 2], X = t.repLens[0] >= 2 ? t.repLens[0] + 1 : 2, X <= F) {
|
|
1912
|
+
for (ut = 0; X > t._matchDistances[ut]; )
|
|
1913
|
+
ut += 2;
|
|
1914
|
+
for (; L = t._matchDistances[ut + 1], g = tn + G(t, L, X, rt), E = t._optimum[X], g < E.Price && (E.Price = g, E.PosPrev = 0, E.BackPrev = L + 4, E.Prev1IsChar = 0), !(X == t._matchDistances[ut] && (ut += 2, ut == Lt)); ++X)
|
|
1915
|
+
;
|
|
1916
|
+
}
|
|
1917
|
+
for (c = 0; ; ) {
|
|
1918
|
+
if (++c, c == H)
|
|
1919
|
+
return ot(t, c);
|
|
1920
|
+
if (st = kn(t), Lt = t._numDistancePairs, st >= t._numFastBytes)
|
|
1921
|
+
return t._longestMatchLength = st, t._longestMatchWasFound = 1, ot(t, c);
|
|
1922
|
+
if (++o, Kt = t._optimum[c].PosPrev, t._optimum[c].Prev1IsChar ? (--Kt, t._optimum[c].Prev2 ? (U = t._optimum[t._optimum[c].PosPrev2].State, t._optimum[c].BackPrev2 < 4 ? U = U < 7 ? 8 : 11 : U = U < 7 ? 7 : 10) : U = t._optimum[Kt].State, U = lt(U)) : U = t._optimum[Kt].State, Kt == c - 1 ? t._optimum[c].BackPrev ? U = lt(U) : U = U < 7 ? 9 : 11 : (t._optimum[c].Prev1IsChar && t._optimum[c].Prev2 ? (Kt = t._optimum[c].PosPrev2, jt = t._optimum[c].BackPrev2, U = U < 7 ? 8 : 11) : (jt = t._optimum[c].BackPrev, jt < 4 ? U = U < 7 ? 8 : 11 : U = U < 7 ? 7 : 10), Z = t._optimum[Kt], jt < 4 ? jt ? jt == 1 ? (t.reps[0] = Z.Backs1, t.reps[1] = Z.Backs0, t.reps[2] = Z.Backs2, t.reps[3] = Z.Backs3) : jt == 2 ? (t.reps[0] = Z.Backs2, t.reps[1] = Z.Backs0, t.reps[2] = Z.Backs1, t.reps[3] = Z.Backs3) : (t.reps[0] = Z.Backs3, t.reps[1] = Z.Backs0, t.reps[2] = Z.Backs1, t.reps[3] = Z.Backs2) : (t.reps[0] = Z.Backs0, t.reps[1] = Z.Backs1, t.reps[2] = Z.Backs2, t.reps[3] = Z.Backs3) : (t.reps[0] = jt - 4, t.reps[1] = Z.Backs0, t.reps[2] = Z.Backs1, t.reps[3] = Z.Backs2)), t._optimum[c].State = U, t._optimum[c].Backs0 = t.reps[0], t._optimum[c].Backs1 = t.reps[1], t._optimum[c].Backs2 = t.reps[2], t._optimum[c].Backs3 = t.reps[3], B = t._optimum[c].Price, D = Y(t._matchFinder, -1), j = Y(t._matchFinder, -t.reps[0] - 1 - 1), rt = o & t._posStateMask, d = B + $[t._isMatch[(U << 4) + rt] >>> 2] + Ze(ue(t._literalEncoder, o, Y(t._matchFinder, -2)), U >= 7, j, D), pt = t._optimum[c + 1], bt = 0, d < pt.Price && (pt.Price = d, pt.PosPrev = c, pt.BackPrev = -1, pt.Prev1IsChar = 0, bt = 1), vt = B + $[2048 - t._isMatch[(U << 4) + rt] >>> 2], Zt = vt + $[2048 - t._isRep[U] >>> 2], j == D && !(pt.PosPrev < c && !pt.BackPrev) && (le = Zt + ($[t._isRepG0[U] >>> 2] + $[t._isRep0Long[(U << 4) + rt] >>> 2]), le <= pt.Price && (pt.Price = le, pt.PosPrev = c, pt.BackPrev = 0, pt.Prev1IsChar = 0, bt = 1)), Pt = Ft(t._matchFinder) + 1, Pt = 4095 - c < Pt ? 4095 - c : Pt, wt = Pt, !(wt < 2)) {
|
|
1923
|
+
if (wt > t._numFastBytes && (wt = t._numFastBytes), !bt && j != D && (pe = Math.min(Pt - 1, t._numFastBytes), N = Tt(t._matchFinder, 0, t.reps[0], pe), N >= 2)) {
|
|
1924
|
+
for (nt = lt(U), it = o + 1 & t._posStateMask, he = d + $[2048 - t._isMatch[(nt << 4) + it] >>> 2] + $[2048 - t._isRep[nt] >>> 2], Rt = c + 1 + N; H < Rt; )
|
|
1925
|
+
t._optimum[++H].Price = 268435455;
|
|
1926
|
+
g = he + (ps = Vt(t._repMatchLenEncoder, N - 2, it), ps + dt(t, 0, nt, it)), E = t._optimum[Rt], g < E.Price && (E.Price = g, E.PosPrev = c + 1, E.BackPrev = 0, E.Prev1IsChar = 1, E.Prev2 = 0);
|
|
1927
|
+
}
|
|
1928
|
+
for (Oe = 2, yt = 0; yt < 4; ++yt)
|
|
1929
|
+
if (P = Tt(t._matchFinder, -1, t.reps[yt], wt), !(P < 2)) {
|
|
1930
|
+
K = P;
|
|
1931
|
+
do {
|
|
1932
|
+
for (; H < c + P; )
|
|
1933
|
+
t._optimum[++H].Price = 268435455;
|
|
1934
|
+
g = Zt + (ds = Vt(t._repMatchLenEncoder, P - 2, rt), ds + dt(t, yt, U, rt)), E = t._optimum[c + P], g < E.Price && (E.Price = g, E.PosPrev = c, E.BackPrev = yt, E.Prev1IsChar = 0);
|
|
1935
|
+
} while (--P >= 2);
|
|
1936
|
+
if (P = K, yt || (Oe = P + 1), P < Pt && (pe = Math.min(Pt - 1 - P, t._numFastBytes), N = Tt(t._matchFinder, P, t.reps[yt], pe), N >= 2)) {
|
|
1937
|
+
for (nt = U < 7 ? 8 : 11, it = o + P & t._posStateMask, m = Zt + (ms = Vt(t._repMatchLenEncoder, P - 2, rt), ms + dt(t, yt, U, rt)) + $[t._isMatch[(nt << 4) + it] >>> 2] + Ze(ue(t._literalEncoder, o + P, Y(t._matchFinder, P - 1 - 1)), 1, Y(t._matchFinder, P - 1 - (t.reps[yt] + 1)), Y(t._matchFinder, P - 1)), nt = lt(nt), it = o + P + 1 & t._posStateMask, St = m + $[2048 - t._isMatch[(nt << 4) + it] >>> 2], he = St + $[2048 - t._isRep[nt] >>> 2], Rt = P + 1 + N; H < c + Rt; )
|
|
1938
|
+
t._optimum[++H].Price = 268435455;
|
|
1939
|
+
g = he + (fs = Vt(t._repMatchLenEncoder, N - 2, it), fs + dt(t, 0, nt, it)), E = t._optimum[c + Rt], g < E.Price && (E.Price = g, E.PosPrev = c + P + 1, E.BackPrev = 0, E.Prev1IsChar = 1, E.Prev2 = 1, E.PosPrev2 = c, E.BackPrev2 = yt);
|
|
1940
|
+
}
|
|
1941
|
+
}
|
|
1942
|
+
if (st > wt) {
|
|
1943
|
+
for (st = wt, Lt = 0; st > t._matchDistances[Lt]; Lt += 2)
|
|
1944
|
+
;
|
|
1945
|
+
t._matchDistances[Lt] = st, Lt += 2;
|
|
1946
|
+
}
|
|
1947
|
+
if (st >= Oe) {
|
|
1948
|
+
for (tn = vt + $[t._isRep[U] >>> 2]; H < c + st; )
|
|
1949
|
+
t._optimum[++H].Price = 268435455;
|
|
1950
|
+
for (ut = 0; Oe > t._matchDistances[ut]; )
|
|
1951
|
+
ut += 2;
|
|
1952
|
+
for (P = Oe; ; ++P)
|
|
1953
|
+
if (S = t._matchDistances[ut + 1], g = tn + G(t, S, P, rt), E = t._optimum[c + P], g < E.Price && (E.Price = g, E.PosPrev = c, E.BackPrev = S + 4, E.Prev1IsChar = 0), P == t._matchDistances[ut]) {
|
|
1954
|
+
if (P < Pt && (pe = Math.min(Pt - 1 - P, t._numFastBytes), N = Tt(t._matchFinder, P, S, pe), N >= 2)) {
|
|
1955
|
+
for (nt = U < 7 ? 7 : 10, it = o + P & t._posStateMask, m = g + $[t._isMatch[(nt << 4) + it] >>> 2] + Ze(ue(t._literalEncoder, o + P, Y(t._matchFinder, P - 1 - 1)), 1, Y(t._matchFinder, P - (S + 1) - 1), Y(t._matchFinder, P - 1)), nt = lt(nt), it = o + P + 1 & t._posStateMask, St = m + $[2048 - t._isMatch[(nt << 4) + it] >>> 2], he = St + $[2048 - t._isRep[nt] >>> 2], Rt = P + 1 + N; H < c + Rt; )
|
|
1956
|
+
t._optimum[++H].Price = 268435455;
|
|
1957
|
+
g = he + (gs = Vt(t._repMatchLenEncoder, N - 2, it), gs + dt(t, 0, nt, it)), E = t._optimum[c + Rt], g < E.Price && (E.Price = g, E.PosPrev = c + P + 1, E.BackPrev = 0, E.Prev1IsChar = 1, E.Prev2 = 1, E.PosPrev2 = c, E.BackPrev2 = S + 4);
|
|
1958
|
+
}
|
|
1959
|
+
if (ut += 2, ut == Lt)
|
|
1960
|
+
break;
|
|
1961
|
+
}
|
|
1962
|
+
}
|
|
1963
|
+
}
|
|
1964
|
+
}
|
|
1965
|
+
}
|
|
1966
|
+
function G(t, o, c, d) {
|
|
1967
|
+
var m, g = Qt(c);
|
|
1968
|
+
return o < 128 ? m = t._distancesPrices[g * 128 + o] : m = t._posSlotPrices[(g << 6) + Rr(o)] + t._alignPrices[o & 15], m + Vt(t._lenEncoder, c - 2, d);
|
|
1969
|
+
}
|
|
1970
|
+
function dt(t, o, c, d) {
|
|
1971
|
+
var m;
|
|
1972
|
+
return o ? (m = $[2048 - t._isRepG0[c] >>> 2], o == 1 ? m += $[t._isRepG1[c] >>> 2] : (m += $[2048 - t._isRepG1[c] >>> 2], m += De(t._isRepG2[c], o - 2))) : (m = $[t._isRepG0[c] >>> 2], m += $[2048 - t._isRep0Long[(c << 4) + d] >>> 2]), m;
|
|
1973
|
+
}
|
|
1974
|
+
function _t(t, o, c) {
|
|
1975
|
+
return $[t._isRepG0[o] >>> 2] + $[t._isRep0Long[(o << 4) + c] >>> 2];
|
|
1976
|
+
}
|
|
1977
|
+
function Ke(t) {
|
|
1978
|
+
Nt(t), $r(t._rangeEncoder), ct(t._isMatch), ct(t._isRep0Long), ct(t._isRep), ct(t._isRepG0), ct(t._isRepG1), ct(t._isRepG2), ct(t._posEncoders), zr(t._literalEncoder);
|
|
1979
|
+
for (var o = 0; o < 4; ++o)
|
|
1980
|
+
ct(t._posSlotEncoder[o].Models);
|
|
1981
|
+
ts(t._lenEncoder, 1 << t._posStateBits), ts(t._repMatchLenEncoder, 1 << t._posStateBits), ct(t._posAlignEncoder.Models), t._longestMatchWasFound = 0, t._optimumEndIndex = 0, t._optimumCurrentIndex = 0, t._additionalOffset = 0;
|
|
1982
|
+
}
|
|
1983
|
+
function Ce(t, o) {
|
|
1984
|
+
o > 0 && (yn(t._matchFinder, o), t._additionalOffset += o);
|
|
1985
|
+
}
|
|
1986
|
+
function kn(t) {
|
|
1987
|
+
var o = 0;
|
|
1988
|
+
return t._numDistancePairs = We(t._matchFinder, t._matchDistances), t._numDistancePairs > 0 && (o = t._matchDistances[t._numDistancePairs - 2], o == t._numFastBytes && (o += Tt(t._matchFinder, o - 1, t._matchDistances[t._numDistancePairs - 1], 273 - o))), ++t._additionalOffset, o;
|
|
1989
|
+
}
|
|
1990
|
+
function Yn(t) {
|
|
1991
|
+
t._matchFinder && t._needReleaseMFStream && (t._matchFinder._stream = null, t._needReleaseMFStream = 0);
|
|
1992
|
+
}
|
|
1993
|
+
function Er(t) {
|
|
1994
|
+
Yn(t), t._rangeEncoder.Stream = null;
|
|
1995
|
+
}
|
|
1996
|
+
function xr(t, o) {
|
|
1997
|
+
t._dictionarySize = o;
|
|
1998
|
+
for (var c = 0; o > 1 << c; ++c)
|
|
1999
|
+
;
|
|
2000
|
+
t._distTableSize = c * 2;
|
|
2001
|
+
}
|
|
2002
|
+
function Br(t, o) {
|
|
2003
|
+
var c = t._matchFinderType;
|
|
2004
|
+
t._matchFinderType = o, t._matchFinder && c != t._matchFinderType && (t._dictionarySizePrev = -1, t._matchFinder = null);
|
|
2005
|
+
}
|
|
2006
|
+
function Cr(t, o) {
|
|
2007
|
+
t.properties[0] = (t._posStateBits * 5 + t._numLiteralPosStateBits) * 9 + t._numLiteralContextBits << 24 >> 24;
|
|
2008
|
+
for (var c = 0; c < 4; ++c)
|
|
2009
|
+
t.properties[1 + c] = t._dictionarySize >> 8 * c << 24 >> 24;
|
|
2010
|
+
Ge(o, t.properties, 0, 5);
|
|
2011
|
+
}
|
|
2012
|
+
function Mr(t, o) {
|
|
2013
|
+
if (t._writeEndMark) {
|
|
2014
|
+
Q(t._rangeEncoder, t._isMatch, (t._state << 4) + o, 1), Q(t._rangeEncoder, t._isRep, t._state, 0), t._state = t._state < 7 ? 7 : 10, Sn(t._lenEncoder, t._rangeEncoder, 0, o);
|
|
2015
|
+
var c = Qt(2);
|
|
2016
|
+
Re(t._posSlotEncoder[c], t._rangeEncoder, 63), os(t._rangeEncoder, 67108863, 26), as(t._posAlignEncoder, t._rangeEncoder, 15);
|
|
2017
|
+
}
|
|
2018
|
+
}
|
|
2019
|
+
function Tn(t) {
|
|
2020
|
+
return t < 2048 ? Mt[t] : t < 2097152 ? Mt[t >> 10] + 20 : Mt[t >> 20] + 40;
|
|
2021
|
+
}
|
|
2022
|
+
function Rr(t) {
|
|
2023
|
+
return t < 131072 ? Mt[t >> 6] + 12 : t < 134217728 ? Mt[t >> 16] + 32 : Mt[t >> 26] + 52;
|
|
2024
|
+
}
|
|
2025
|
+
function Dr(t, o, c, d) {
|
|
2026
|
+
c < 8 ? (Q(o, t._choice, 0, 0), Re(t._lowCoder[d], o, c)) : (c -= 8, Q(o, t._choice, 0, 1), c < 8 ? (Q(o, t._choice, 1, 0), Re(t._midCoder[d], o, c)) : (Q(o, t._choice, 1, 1), Re(t._highCoder, o, c - 8)));
|
|
2027
|
+
}
|
|
2028
|
+
function Ar(t) {
|
|
2029
|
+
t._choice = p(2), t._lowCoder = p(16), t._midCoder = p(16), t._highCoder = Me({}, 8);
|
|
2030
|
+
for (var o = 0; o < 16; ++o)
|
|
2031
|
+
t._lowCoder[o] = Me({}, 3), t._midCoder[o] = Me({}, 3);
|
|
2032
|
+
return t;
|
|
2033
|
+
}
|
|
2034
|
+
function ts(t, o) {
|
|
2035
|
+
ct(t._choice);
|
|
2036
|
+
for (var c = 0; c < o; ++c)
|
|
2037
|
+
ct(t._lowCoder[c].Models), ct(t._midCoder[c].Models);
|
|
2038
|
+
ct(t._highCoder.Models);
|
|
2039
|
+
}
|
|
2040
|
+
function es(t, o, c, d, m) {
|
|
2041
|
+
var g, S, B, D, L;
|
|
2042
|
+
for (g = $[t._choice[0] >>> 2], S = $[2048 - t._choice[0] >>> 2], B = S + $[t._choice[1] >>> 2], D = S + $[2048 - t._choice[1] >>> 2], L = 0, L = 0; L < 8; ++L) {
|
|
2043
|
+
if (L >= c)
|
|
2044
|
+
return;
|
|
2045
|
+
d[m + L] = g + Ye(t._lowCoder[o], L);
|
|
2046
|
+
}
|
|
2047
|
+
for (; L < 16; ++L) {
|
|
2048
|
+
if (L >= c)
|
|
2049
|
+
return;
|
|
2050
|
+
d[m + L] = B + Ye(t._midCoder[o], L - 8);
|
|
2051
|
+
}
|
|
2052
|
+
for (; L < c; ++L)
|
|
2053
|
+
d[m + L] = D + Ye(t._highCoder, L - 8 - 8);
|
|
2054
|
+
}
|
|
2055
|
+
function Sn(t, o, c, d) {
|
|
2056
|
+
Dr(t, o, c, d), --t._counters[d] == 0 && (es(t, d, t._tableSize, t._prices, d * 272), t._counters[d] = t._tableSize);
|
|
2057
|
+
}
|
|
2058
|
+
function ns(t) {
|
|
2059
|
+
return Ar(t), t._prices = [], t._counters = [], t;
|
|
2060
|
+
}
|
|
2061
|
+
function Vt(t, o, c) {
|
|
2062
|
+
return t._prices[c * 272 + o];
|
|
2063
|
+
}
|
|
2064
|
+
function ss(t, o) {
|
|
2065
|
+
for (var c = 0; c < o; ++c)
|
|
2066
|
+
es(t, c, t._tableSize, t._prices, c * 272), t._counters[c] = t._tableSize;
|
|
2067
|
+
}
|
|
2068
|
+
function Or(t, o, c) {
|
|
2069
|
+
var d, m;
|
|
2070
|
+
if (!(t.m_Coders != null && t.m_NumPrevBits == c && t.m_NumPosBits == o))
|
|
2071
|
+
for (t.m_NumPosBits = o, t.m_PosMask = (1 << o) - 1, t.m_NumPrevBits = c, m = 1 << t.m_NumPrevBits + t.m_NumPosBits, t.m_Coders = p(m), d = 0; d < m; ++d)
|
|
2072
|
+
t.m_Coders[d] = Fr({});
|
|
2073
|
+
}
|
|
2074
|
+
function ue(t, o, c) {
|
|
2075
|
+
return t.m_Coders[((o & t.m_PosMask) << t.m_NumPrevBits) + ((c & 255) >>> 8 - t.m_NumPrevBits)];
|
|
2076
|
+
}
|
|
2077
|
+
function zr(t) {
|
|
2078
|
+
var o, c = 1 << t.m_NumPrevBits + t.m_NumPosBits;
|
|
2079
|
+
for (o = 0; o < c; ++o)
|
|
2080
|
+
ct(t.m_Coders[o].m_Encoders);
|
|
2081
|
+
}
|
|
2082
|
+
function rs(t, o, c) {
|
|
2083
|
+
var d, m, g = 1;
|
|
2084
|
+
for (m = 7; m >= 0; --m)
|
|
2085
|
+
d = c >> m & 1, Q(o, t.m_Encoders, g, d), g = g << 1 | d;
|
|
2086
|
+
}
|
|
2087
|
+
function Hr(t, o, c, d) {
|
|
2088
|
+
var m, g, S, B, D = 1, L = 1;
|
|
2089
|
+
for (g = 7; g >= 0; --g)
|
|
2090
|
+
m = d >> g & 1, B = L, D && (S = c >> g & 1, B += 1 + S << 8, D = S == m), Q(o, t.m_Encoders, B, m), L = L << 1 | m;
|
|
2091
|
+
}
|
|
2092
|
+
function Fr(t) {
|
|
2093
|
+
return t.m_Encoders = p(768), t;
|
|
2094
|
+
}
|
|
2095
|
+
function Ze(t, o, c, d) {
|
|
2096
|
+
var m, g = 1, S = 7, B, D = 0;
|
|
2097
|
+
if (o) {
|
|
2098
|
+
for (; S >= 0; --S)
|
|
2099
|
+
if (B = c >> S & 1, m = d >> S & 1, D += De(t.m_Encoders[(1 + B << 8) + g], m), g = g << 1 | m, B != m) {
|
|
2100
|
+
--S;
|
|
2101
|
+
break;
|
|
2102
|
+
}
|
|
2103
|
+
}
|
|
2104
|
+
for (; S >= 0; --S)
|
|
2105
|
+
m = d >> S & 1, D += De(t.m_Encoders[g], m), g = g << 1 | m;
|
|
2106
|
+
return D;
|
|
2107
|
+
}
|
|
2108
|
+
function is(t) {
|
|
2109
|
+
t.BackPrev = -1, t.Prev1IsChar = 0;
|
|
2110
|
+
}
|
|
2111
|
+
function Ir(t) {
|
|
2112
|
+
t.BackPrev = 0, t.Prev1IsChar = 0;
|
|
2113
|
+
}
|
|
2114
|
+
function Me(t, o) {
|
|
2115
|
+
return t.NumBitLevels = o, t.Models = p(1 << o), t;
|
|
2116
|
+
}
|
|
2117
|
+
function Re(t, o, c) {
|
|
2118
|
+
var d, m, g = 1;
|
|
2119
|
+
for (m = t.NumBitLevels; m != 0; )
|
|
2120
|
+
--m, d = c >>> m & 1, Q(o, t.Models, g, d), g = g << 1 | d;
|
|
2121
|
+
}
|
|
2122
|
+
function Ye(t, o) {
|
|
2123
|
+
var c, d, m = 1, g = 0;
|
|
2124
|
+
for (d = t.NumBitLevels; d != 0; )
|
|
2125
|
+
--d, c = o >>> d & 1, g += De(t.Models[m], c), m = (m << 1) + c;
|
|
2126
|
+
return g;
|
|
2127
|
+
}
|
|
2128
|
+
function as(t, o, c) {
|
|
2129
|
+
var d, m, g = 1;
|
|
2130
|
+
for (m = 0; m < t.NumBitLevels; ++m)
|
|
2131
|
+
d = c & 1, Q(o, t.Models, g, d), g = g << 1 | d, c >>= 1;
|
|
2132
|
+
}
|
|
2133
|
+
function Nr(t, o) {
|
|
2134
|
+
var c, d, m = 1, g = 0;
|
|
2135
|
+
for (d = t.NumBitLevels; d != 0; --d)
|
|
2136
|
+
c = o & 1, o >>>= 1, g += De(t.Models[m], c), m = m << 1 | c;
|
|
2137
|
+
return g;
|
|
2138
|
+
}
|
|
2139
|
+
function jr(t, o, c, d, m) {
|
|
2140
|
+
var g, S, B = 1;
|
|
2141
|
+
for (S = 0; S < d; ++S)
|
|
2142
|
+
g = m & 1, Q(c, t, o + B, g), B = B << 1 | g, m >>= 1;
|
|
2143
|
+
}
|
|
2144
|
+
function Ur(t, o, c, d) {
|
|
2145
|
+
var m, g, S = 1, B = 0;
|
|
2146
|
+
for (g = c; g != 0; --g)
|
|
2147
|
+
m = d & 1, d >>>= 1, B += $[((t[o + S] - m ^ -m) & 2047) >>> 2], S = S << 1 | m;
|
|
2148
|
+
return B;
|
|
2149
|
+
}
|
|
2150
|
+
function ct(t) {
|
|
2151
|
+
for (var o = t.length - 1; o >= 0; --o)
|
|
2152
|
+
t[o] = 1024;
|
|
2153
|
+
}
|
|
2154
|
+
var $ = function() {
|
|
2155
|
+
var t, o, c, d, m = [];
|
|
2156
|
+
for (o = 8; o >= 0; --o)
|
|
2157
|
+
for (d = 1 << 9 - o - 1, t = 1 << 9 - o, c = d; c < t; ++c)
|
|
2158
|
+
m[c] = (o << 6) + (t - c << 6 >>> 9 - o - 1);
|
|
2159
|
+
return m;
|
|
2160
|
+
}();
|
|
2161
|
+
function Q(t, o, c, d) {
|
|
2162
|
+
var m, g = o[c];
|
|
2163
|
+
m = (t.Range >>> 11) * g, d ? (t.Low = f(t.Low, v(k(m), [4294967295, 0])), t.Range -= m, o[c] = g - (g >>> 5) << 16 >> 16) : (t.Range = m, o[c] = g + (2048 - g >>> 5) << 16 >> 16), t.Range & -16777216 || (t.Range <<= 8, Pn(t));
|
|
2164
|
+
}
|
|
2165
|
+
function os(t, o, c) {
|
|
2166
|
+
for (var d = c - 1; d >= 0; --d)
|
|
2167
|
+
t.Range >>>= 1, (o >>> d & 1) == 1 && (t.Low = f(t.Low, k(t.Range))), t.Range & -16777216 || (t.Range <<= 8, Pn(t));
|
|
2168
|
+
}
|
|
2169
|
+
function qr(t) {
|
|
2170
|
+
return f(f(k(t._cacheSize), t._position), [4, 0]);
|
|
2171
|
+
}
|
|
2172
|
+
function $r(t) {
|
|
2173
|
+
t._position = u, t.Low = u, t.Range = -1, t._cacheSize = 1, t._cache = 0;
|
|
2174
|
+
}
|
|
2175
|
+
function Pn(t) {
|
|
2176
|
+
var o, c = T(V(t.Low, 32));
|
|
2177
|
+
if (c != 0 || h(t.Low, [4278190080, 0]) < 0) {
|
|
2178
|
+
t._position = f(t._position, k(t._cacheSize)), o = t._cache;
|
|
2179
|
+
do
|
|
2180
|
+
Se(t.Stream, o + c), o = 255;
|
|
2181
|
+
while (--t._cacheSize != 0);
|
|
2182
|
+
t._cache = T(t.Low) >>> 24;
|
|
2183
|
+
}
|
|
2184
|
+
++t._cacheSize, t.Low = M(v(t.Low, [16777215, 0]), 8);
|
|
2185
|
+
}
|
|
2186
|
+
function De(t, o) {
|
|
2187
|
+
return $[((t - o ^ -o) & 2047) >>> 2];
|
|
2188
|
+
}
|
|
2189
|
+
function cs(t) {
|
|
2190
|
+
var o, c = [], d, m = 0, g, S = t.length;
|
|
2191
|
+
if (typeof t == "object")
|
|
2192
|
+
return t;
|
|
2193
|
+
for (Ht(t, 0, S, c, 0), g = 0; g < S; ++g)
|
|
2194
|
+
o = c[g], o >= 1 && o <= 127 ? ++m : !o || o >= 128 && o <= 2047 ? m += 2 : m += 3;
|
|
2195
|
+
for (d = [], m = 0, g = 0; g < S; ++g)
|
|
2196
|
+
o = c[g], o >= 1 && o <= 127 ? d[m++] = o << 24 >> 24 : !o || o >= 128 && o <= 2047 ? (d[m++] = (192 | o >> 6 & 31) << 24 >> 24, d[m++] = (128 | o & 63) << 24 >> 24) : (d[m++] = (224 | o >> 12 & 15) << 24 >> 24, d[m++] = (128 | o >> 6 & 63) << 24 >> 24, d[m++] = (128 | o & 63) << 24 >> 24);
|
|
2197
|
+
return d;
|
|
2198
|
+
}
|
|
2199
|
+
function us(t) {
|
|
2200
|
+
return t[1] + t[0];
|
|
2201
|
+
}
|
|
2202
|
+
function Jr(t, o, c, d) {
|
|
2203
|
+
var m = {}, g, S, B = typeof c > "u" && typeof d > "u";
|
|
2204
|
+
if (typeof c != "function" && (S = c, c = d = 0), d = d || function(L) {
|
|
2205
|
+
if (!(typeof S > "u"))
|
|
2206
|
+
return w(L, S);
|
|
2207
|
+
}, c = c || function(L, x) {
|
|
2208
|
+
if (!(typeof S > "u"))
|
|
2209
|
+
return postMessage({
|
|
2210
|
+
action: n,
|
|
2211
|
+
cbn: S,
|
|
2212
|
+
result: L,
|
|
2213
|
+
error: x
|
|
2214
|
+
});
|
|
2215
|
+
}, B) {
|
|
2216
|
+
for (m.c = Gt({}, cs(t), hs(o)); Qe(m.c.chunker); )
|
|
2217
|
+
;
|
|
2218
|
+
return re(m.c.output);
|
|
2219
|
+
}
|
|
2220
|
+
try {
|
|
2221
|
+
m.c = Gt({}, cs(t), hs(o)), d(0);
|
|
2222
|
+
} catch (L) {
|
|
2223
|
+
return c(null, L);
|
|
2224
|
+
}
|
|
2225
|
+
function D() {
|
|
2226
|
+
try {
|
|
2227
|
+
for (var L, x = new Date().getTime(); Qe(m.c.chunker); )
|
|
2228
|
+
if (g = us(m.c.chunker.inBytesProcessed) / us(m.c.length_0), new Date().getTime() - x > 200)
|
|
2229
|
+
return d(g), s(D, 0), 0;
|
|
2230
|
+
d(1), L = re(m.c.output), s(c.bind(null, L), 0);
|
|
2231
|
+
} catch (X) {
|
|
2232
|
+
c(null, X);
|
|
2233
|
+
}
|
|
2234
|
+
}
|
|
2235
|
+
s(D, 0);
|
|
2236
|
+
}
|
|
2237
|
+
var hs = function() {
|
|
2238
|
+
var t = [
|
|
2239
|
+
{ s: 16, f: 64, m: 0 },
|
|
2240
|
+
{ s: 20, f: 64, m: 0 },
|
|
2241
|
+
{ s: 19, f: 64, m: 1 },
|
|
2242
|
+
{ s: 20, f: 64, m: 1 },
|
|
2243
|
+
{ s: 21, f: 128, m: 1 },
|
|
2244
|
+
{ s: 22, f: 128, m: 1 },
|
|
2245
|
+
{ s: 23, f: 128, m: 1 },
|
|
2246
|
+
{ s: 24, f: 255, m: 1 },
|
|
2247
|
+
{ s: 25, f: 255, m: 1 }
|
|
2248
|
+
];
|
|
2249
|
+
return function(o) {
|
|
2250
|
+
return t[o - 1] || t[6];
|
|
2251
|
+
};
|
|
2252
|
+
}();
|
|
2253
|
+
return typeof onmessage < "u" && (typeof window > "u" || typeof window.document > "u") && function() {
|
|
2254
|
+
onmessage = function(t) {
|
|
2255
|
+
t && t.data && t.data.action == n && Fn.compress(t.data.data, t.data.mode, t.data.cbn);
|
|
2256
|
+
};
|
|
2257
|
+
}(), {
|
|
2258
|
+
compress: Jr
|
|
2259
|
+
};
|
|
2260
|
+
}();
|
|
2261
|
+
const yi = async (n) => await Ti(n);
|
|
2262
|
+
let en = null;
|
|
2263
|
+
const ki = async (n) => (n = n || '"./lzma_worker-min.js"', en || (await yi(n) ? en = wi(n) : (console.error("lzma\u65E0\u6CD5\u627E\u5230" + n + ": \u65E0\u6CD5\u542F\u52A8worker\u6A21\u5F0F\uFF0C\u5C06\u542F\u7528\u6D4F\u89C8\u5668\u8BA1\u7B97\u6A21\u5F0F\uFF0C\u6027\u80FD\u53D7\u5F71\u54CD"), en = Fn), en)), Ti = (n) => new Promise((e, s) => {
|
|
2264
|
+
const r = new XMLHttpRequest();
|
|
2265
|
+
r.open("get", n, !0), r.addEventListener("error", (i) => {
|
|
2266
|
+
e(!1);
|
|
2267
|
+
}), r.addEventListener("load", (i) => {
|
|
2268
|
+
r.status === 200 && e(!0), e(!1);
|
|
2269
|
+
}), r.send();
|
|
2270
|
+
}), Si = new ui(5);
|
|
2271
|
+
let er = "";
|
|
2272
|
+
const Pi = (n) => {
|
|
2273
|
+
er = n;
|
|
2274
|
+
};
|
|
2275
|
+
let ys = null;
|
|
2276
|
+
const nr = (n) => {
|
|
2277
|
+
const e = typeof n == "string" ? n : JSON.stringify(n);
|
|
2278
|
+
let s = location.pathname;
|
|
2279
|
+
s = s.replace(/[^\/\/.]+\.(html|html)$/, "").replace("//", "/");
|
|
2280
|
+
const r = er || location.origin + s + "static/lzma_worker.js";
|
|
2281
|
+
return console.log("lzma_worker", r), new Promise(async (i) => {
|
|
2282
|
+
let a = Date.now();
|
|
2283
|
+
window.requestIdleCallback(async () => {
|
|
2284
|
+
ys = await ki(r), ys.compress(e, 5, (u, l) => {
|
|
2285
|
+
if (!u)
|
|
2286
|
+
throw Error("static/lzma_worker.js \u65E0\u6CD5\u52A0\u8F7D\uFF0C\u8BF7\u68C0\u67E5\u8BE5\u6587\u4EF6");
|
|
2287
|
+
console.log("compress finish", Date.now() - a);
|
|
2288
|
+
const w = [...u], p = new Int8Array(w.length);
|
|
2289
|
+
for (let f = 0; f < w.length; f++)
|
|
2290
|
+
p[f] = w[f];
|
|
2291
|
+
console.log("compress success", Date.now() - a), i(p);
|
|
2292
|
+
});
|
|
2293
|
+
});
|
|
2294
|
+
});
|
|
2295
|
+
}, on = async (n, e, s) => new Promise((r, i) => {
|
|
2296
|
+
const a = new XMLHttpRequest();
|
|
2297
|
+
a.open("POST", n, !0), s ? (a.setRequestHeader("xw-body-encoding", "v1"), Si.addTask(() => new Promise((u, l) => {
|
|
2298
|
+
nr(e).then((w) => {
|
|
2299
|
+
a.send(w.buffer);
|
|
2300
|
+
}).finally(() => {
|
|
2301
|
+
u();
|
|
2302
|
+
});
|
|
2303
|
+
}))) : a.send(JSON.stringify(e)), a.onreadystatechange = () => {
|
|
2304
|
+
}, a.addEventListener("readystatechange", (u) => {
|
|
2305
|
+
a.readyState === 4 && a.status === 200 ? r(void 0) : a.status === 500 && i(a.statusText);
|
|
2306
|
+
}), a.addEventListener("error", (u) => {
|
|
2307
|
+
console.error("\u957F\u5EA6", JSON.stringify(e).length), i(u);
|
|
2308
|
+
});
|
|
2309
|
+
}), Li = (n, e, s) => {
|
|
2310
|
+
window.navigator.sendBeacon !== void 0 ? s ? nr(e).then((r) => {
|
|
2311
|
+
window.navigator.sendBeacon(n, r.buffer);
|
|
2312
|
+
}) : window.navigator.sendBeacon(n, JSON.stringify(e)) : on(n, e, s);
|
|
2313
|
+
};
|
|
2314
|
+
class Ei {
|
|
2315
|
+
constructor() {
|
|
2316
|
+
b(this, "logs", []);
|
|
2317
|
+
}
|
|
2318
|
+
get length() {
|
|
2319
|
+
return this.logs.length;
|
|
2320
|
+
}
|
|
2321
|
+
async init() {
|
|
2322
|
+
}
|
|
2323
|
+
async push(e) {
|
|
2324
|
+
try {
|
|
2325
|
+
this.logs.push(e);
|
|
2326
|
+
} catch (s) {
|
|
2327
|
+
console.error(s);
|
|
2328
|
+
}
|
|
2329
|
+
}
|
|
2330
|
+
async compulsionSave() {
|
|
2331
|
+
}
|
|
2332
|
+
clearArray() {
|
|
2333
|
+
this.logs.length = 0;
|
|
2334
|
+
}
|
|
2335
|
+
async shift(e = 1) {
|
|
2336
|
+
let s = [[...this.logs]];
|
|
2337
|
+
return this.clearArray(), s;
|
|
2338
|
+
}
|
|
2339
|
+
}
|
|
2340
|
+
async function xi(n) {
|
|
2341
|
+
const e = new Ei();
|
|
2342
|
+
return await e.init(), e;
|
|
2343
|
+
}
|
|
2344
|
+
var Bi = typeof global == "object" && global && global.Object === Object && global;
|
|
2345
|
+
const Ci = Bi;
|
|
2346
|
+
var Mi = typeof self == "object" && self && self.Object === Object && self, Ri = Ci || Mi || Function("return this")();
|
|
2347
|
+
const ln = Ri;
|
|
2348
|
+
var Di = ln.Symbol;
|
|
2349
|
+
const $t = Di;
|
|
2350
|
+
var sr = Object.prototype, Ai = sr.hasOwnProperty, Oi = sr.toString, ze = $t ? $t.toStringTag : void 0;
|
|
2351
|
+
function zi(n) {
|
|
2352
|
+
var e = Ai.call(n, ze), s = n[ze];
|
|
2353
|
+
try {
|
|
2354
|
+
n[ze] = void 0;
|
|
2355
|
+
var r = !0;
|
|
2356
|
+
} catch {
|
|
2357
|
+
}
|
|
2358
|
+
var i = Oi.call(n);
|
|
2359
|
+
return r && (e ? n[ze] = s : delete n[ze]), i;
|
|
2360
|
+
}
|
|
2361
|
+
var Hi = Object.prototype, Fi = Hi.toString;
|
|
2362
|
+
function Ii(n) {
|
|
2363
|
+
return Fi.call(n);
|
|
2364
|
+
}
|
|
2365
|
+
var Ni = "[object Null]", ji = "[object Undefined]", ks = $t ? $t.toStringTag : void 0;
|
|
2366
|
+
function Gn(n) {
|
|
2367
|
+
return n == null ? n === void 0 ? ji : Ni : ks && ks in Object(n) ? zi(n) : Ii(n);
|
|
2368
|
+
}
|
|
2369
|
+
function Xn(n) {
|
|
2370
|
+
return n != null && typeof n == "object";
|
|
2371
|
+
}
|
|
2372
|
+
var Ui = "[object Symbol]";
|
|
2373
|
+
function pn(n) {
|
|
2374
|
+
return typeof n == "symbol" || Xn(n) && Gn(n) == Ui;
|
|
2375
|
+
}
|
|
2376
|
+
function qi(n, e) {
|
|
2377
|
+
for (var s = -1, r = n == null ? 0 : n.length, i = Array(r); ++s < r; )
|
|
2378
|
+
i[s] = e(n[s], s, n);
|
|
2379
|
+
return i;
|
|
2380
|
+
}
|
|
2381
|
+
var $i = Array.isArray;
|
|
2382
|
+
const dn = $i;
|
|
2383
|
+
var Ji = 1 / 0, Ts = $t ? $t.prototype : void 0, Ss = Ts ? Ts.toString : void 0;
|
|
2384
|
+
function rr(n) {
|
|
2385
|
+
if (typeof n == "string")
|
|
2386
|
+
return n;
|
|
2387
|
+
if (dn(n))
|
|
2388
|
+
return qi(n, rr) + "";
|
|
2389
|
+
if (pn(n))
|
|
2390
|
+
return Ss ? Ss.call(n) : "";
|
|
2391
|
+
var e = n + "";
|
|
2392
|
+
return e == "0" && 1 / n == -Ji ? "-0" : e;
|
|
2393
|
+
}
|
|
2394
|
+
var Gi = /\s/;
|
|
2395
|
+
function Xi(n) {
|
|
2396
|
+
for (var e = n.length; e-- && Gi.test(n.charAt(e)); )
|
|
2397
|
+
;
|
|
2398
|
+
return e;
|
|
2399
|
+
}
|
|
2400
|
+
var Wi = /^\s+/;
|
|
2401
|
+
function Qi(n) {
|
|
2402
|
+
return n && n.slice(0, Xi(n) + 1).replace(Wi, "");
|
|
2403
|
+
}
|
|
2404
|
+
function Ue(n) {
|
|
2405
|
+
var e = typeof n;
|
|
2406
|
+
return n != null && (e == "object" || e == "function");
|
|
2407
|
+
}
|
|
2408
|
+
var Ps = 0 / 0, Vi = /^[-+]0x[0-9a-f]+$/i, Ki = /^0b[01]+$/i, Zi = /^0o[0-7]+$/i, Yi = parseInt;
|
|
2409
|
+
function Ls(n) {
|
|
2410
|
+
if (typeof n == "number")
|
|
2411
|
+
return n;
|
|
2412
|
+
if (pn(n))
|
|
2413
|
+
return Ps;
|
|
2414
|
+
if (Ue(n)) {
|
|
2415
|
+
var e = typeof n.valueOf == "function" ? n.valueOf() : n;
|
|
2416
|
+
n = Ue(e) ? e + "" : e;
|
|
2417
|
+
}
|
|
2418
|
+
if (typeof n != "string")
|
|
2419
|
+
return n === 0 ? n : +n;
|
|
2420
|
+
n = Qi(n);
|
|
2421
|
+
var s = Ki.test(n);
|
|
2422
|
+
return s || Zi.test(n) ? Yi(n.slice(2), s ? 2 : 8) : Vi.test(n) ? Ps : +n;
|
|
2423
|
+
}
|
|
2424
|
+
var ta = "[object AsyncFunction]", ea = "[object Function]", na = "[object GeneratorFunction]", sa = "[object Proxy]";
|
|
2425
|
+
function ra(n) {
|
|
2426
|
+
if (!Ue(n))
|
|
2427
|
+
return !1;
|
|
2428
|
+
var e = Gn(n);
|
|
2429
|
+
return e == ea || e == na || e == ta || e == sa;
|
|
2430
|
+
}
|
|
2431
|
+
var ia = ln["__core-js_shared__"];
|
|
2432
|
+
const En = ia;
|
|
2433
|
+
var Es = function() {
|
|
2434
|
+
var n = /[^.]+$/.exec(En && En.keys && En.keys.IE_PROTO || "");
|
|
2435
|
+
return n ? "Symbol(src)_1." + n : "";
|
|
2436
|
+
}();
|
|
2437
|
+
function aa(n) {
|
|
2438
|
+
return !!Es && Es in n;
|
|
2439
|
+
}
|
|
2440
|
+
var oa = Function.prototype, ca = oa.toString;
|
|
2441
|
+
function ua(n) {
|
|
2442
|
+
if (n != null) {
|
|
2443
|
+
try {
|
|
2444
|
+
return ca.call(n);
|
|
2445
|
+
} catch {
|
|
2446
|
+
}
|
|
2447
|
+
try {
|
|
2448
|
+
return n + "";
|
|
2449
|
+
} catch {
|
|
2450
|
+
}
|
|
2451
|
+
}
|
|
2452
|
+
return "";
|
|
2453
|
+
}
|
|
2454
|
+
var ha = /[\\^$.*+?()[\]{}|]/g, la = /^\[object .+?Constructor\]$/, pa = Function.prototype, da = Object.prototype, ma = pa.toString, fa = da.hasOwnProperty, ga = RegExp(
|
|
2455
|
+
"^" + ma.call(fa).replace(ha, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
2456
|
+
);
|
|
2457
|
+
function _a(n) {
|
|
2458
|
+
if (!Ue(n) || aa(n))
|
|
2459
|
+
return !1;
|
|
2460
|
+
var e = ra(n) ? ga : la;
|
|
2461
|
+
return e.test(ua(n));
|
|
2462
|
+
}
|
|
2463
|
+
function va(n, e) {
|
|
2464
|
+
return n == null ? void 0 : n[e];
|
|
2465
|
+
}
|
|
2466
|
+
function ir(n, e) {
|
|
2467
|
+
var s = va(n, e);
|
|
2468
|
+
return _a(s) ? s : void 0;
|
|
2469
|
+
}
|
|
2470
|
+
function ba(n, e) {
|
|
2471
|
+
return n === e || n !== n && e !== e;
|
|
2472
|
+
}
|
|
2473
|
+
var wa = "[object Arguments]";
|
|
2474
|
+
function xs(n) {
|
|
2475
|
+
return Xn(n) && Gn(n) == wa;
|
|
2476
|
+
}
|
|
2477
|
+
var ar = Object.prototype, ya = ar.hasOwnProperty, ka = ar.propertyIsEnumerable, Ta = xs(function() {
|
|
2478
|
+
return arguments;
|
|
2479
|
+
}()) ? xs : function(n) {
|
|
2480
|
+
return Xn(n) && ya.call(n, "callee") && !ka.call(n, "callee");
|
|
2481
|
+
};
|
|
2482
|
+
const Sa = Ta;
|
|
2483
|
+
var Pa = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, La = /^\w*$/;
|
|
2484
|
+
function Ea(n, e) {
|
|
2485
|
+
if (dn(n))
|
|
2486
|
+
return !1;
|
|
2487
|
+
var s = typeof n;
|
|
2488
|
+
return s == "number" || s == "symbol" || s == "boolean" || n == null || pn(n) ? !0 : La.test(n) || !Pa.test(n) || e != null && n in Object(e);
|
|
2489
|
+
}
|
|
2490
|
+
var xa = ir(Object, "create");
|
|
2491
|
+
const qe = xa;
|
|
2492
|
+
function Ba() {
|
|
2493
|
+
this.__data__ = qe ? qe(null) : {}, this.size = 0;
|
|
2494
|
+
}
|
|
2495
|
+
function Ca(n) {
|
|
2496
|
+
var e = this.has(n) && delete this.__data__[n];
|
|
2497
|
+
return this.size -= e ? 1 : 0, e;
|
|
2498
|
+
}
|
|
2499
|
+
var Ma = "__lodash_hash_undefined__", Ra = Object.prototype, Da = Ra.hasOwnProperty;
|
|
2500
|
+
function Aa(n) {
|
|
2501
|
+
var e = this.__data__;
|
|
2502
|
+
if (qe) {
|
|
2503
|
+
var s = e[n];
|
|
2504
|
+
return s === Ma ? void 0 : s;
|
|
2505
|
+
}
|
|
2506
|
+
return Da.call(e, n) ? e[n] : void 0;
|
|
2507
|
+
}
|
|
2508
|
+
var Oa = Object.prototype, za = Oa.hasOwnProperty;
|
|
2509
|
+
function Ha(n) {
|
|
2510
|
+
var e = this.__data__;
|
|
2511
|
+
return qe ? e[n] !== void 0 : za.call(e, n);
|
|
2512
|
+
}
|
|
2513
|
+
var Fa = "__lodash_hash_undefined__";
|
|
2514
|
+
function Ia(n, e) {
|
|
2515
|
+
var s = this.__data__;
|
|
2516
|
+
return this.size += this.has(n) ? 0 : 1, s[n] = qe && e === void 0 ? Fa : e, this;
|
|
2517
|
+
}
|
|
2518
|
+
function ee(n) {
|
|
2519
|
+
var e = -1, s = n == null ? 0 : n.length;
|
|
2520
|
+
for (this.clear(); ++e < s; ) {
|
|
2521
|
+
var r = n[e];
|
|
2522
|
+
this.set(r[0], r[1]);
|
|
2523
|
+
}
|
|
2524
|
+
}
|
|
2525
|
+
ee.prototype.clear = Ba;
|
|
2526
|
+
ee.prototype.delete = Ca;
|
|
2527
|
+
ee.prototype.get = Aa;
|
|
2528
|
+
ee.prototype.has = Ha;
|
|
2529
|
+
ee.prototype.set = Ia;
|
|
2530
|
+
function Na() {
|
|
2531
|
+
this.__data__ = [], this.size = 0;
|
|
2532
|
+
}
|
|
2533
|
+
function mn(n, e) {
|
|
2534
|
+
for (var s = n.length; s--; )
|
|
2535
|
+
if (ba(n[s][0], e))
|
|
2536
|
+
return s;
|
|
2537
|
+
return -1;
|
|
2538
|
+
}
|
|
2539
|
+
var ja = Array.prototype, Ua = ja.splice;
|
|
2540
|
+
function qa(n) {
|
|
2541
|
+
var e = this.__data__, s = mn(e, n);
|
|
2542
|
+
if (s < 0)
|
|
2543
|
+
return !1;
|
|
2544
|
+
var r = e.length - 1;
|
|
2545
|
+
return s == r ? e.pop() : Ua.call(e, s, 1), --this.size, !0;
|
|
2546
|
+
}
|
|
2547
|
+
function $a(n) {
|
|
2548
|
+
var e = this.__data__, s = mn(e, n);
|
|
2549
|
+
return s < 0 ? void 0 : e[s][1];
|
|
2550
|
+
}
|
|
2551
|
+
function Ja(n) {
|
|
2552
|
+
return mn(this.__data__, n) > -1;
|
|
2553
|
+
}
|
|
2554
|
+
function Ga(n, e) {
|
|
2555
|
+
var s = this.__data__, r = mn(s, n);
|
|
2556
|
+
return r < 0 ? (++this.size, s.push([n, e])) : s[r][1] = e, this;
|
|
2557
|
+
}
|
|
2558
|
+
function ye(n) {
|
|
2559
|
+
var e = -1, s = n == null ? 0 : n.length;
|
|
2560
|
+
for (this.clear(); ++e < s; ) {
|
|
2561
|
+
var r = n[e];
|
|
2562
|
+
this.set(r[0], r[1]);
|
|
2563
|
+
}
|
|
2564
|
+
}
|
|
2565
|
+
ye.prototype.clear = Na;
|
|
2566
|
+
ye.prototype.delete = qa;
|
|
2567
|
+
ye.prototype.get = $a;
|
|
2568
|
+
ye.prototype.has = Ja;
|
|
2569
|
+
ye.prototype.set = Ga;
|
|
2570
|
+
var Xa = ir(ln, "Map");
|
|
2571
|
+
const Wa = Xa;
|
|
2572
|
+
function Qa() {
|
|
2573
|
+
this.size = 0, this.__data__ = {
|
|
2574
|
+
hash: new ee(),
|
|
2575
|
+
map: new (Wa || ye)(),
|
|
2576
|
+
string: new ee()
|
|
2577
|
+
};
|
|
2578
|
+
}
|
|
2579
|
+
function Va(n) {
|
|
2580
|
+
var e = typeof n;
|
|
2581
|
+
return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? n !== "__proto__" : n === null;
|
|
2582
|
+
}
|
|
2583
|
+
function fn(n, e) {
|
|
2584
|
+
var s = n.__data__;
|
|
2585
|
+
return Va(e) ? s[typeof e == "string" ? "string" : "hash"] : s.map;
|
|
2586
|
+
}
|
|
2587
|
+
function Ka(n) {
|
|
2588
|
+
var e = fn(this, n).delete(n);
|
|
2589
|
+
return this.size -= e ? 1 : 0, e;
|
|
2590
|
+
}
|
|
2591
|
+
function Za(n) {
|
|
2592
|
+
return fn(this, n).get(n);
|
|
2593
|
+
}
|
|
2594
|
+
function Ya(n) {
|
|
2595
|
+
return fn(this, n).has(n);
|
|
2596
|
+
}
|
|
2597
|
+
function to(n, e) {
|
|
2598
|
+
var s = fn(this, n), r = s.size;
|
|
2599
|
+
return s.set(n, e), this.size += s.size == r ? 0 : 1, this;
|
|
2600
|
+
}
|
|
2601
|
+
function ne(n) {
|
|
2602
|
+
var e = -1, s = n == null ? 0 : n.length;
|
|
2603
|
+
for (this.clear(); ++e < s; ) {
|
|
2604
|
+
var r = n[e];
|
|
2605
|
+
this.set(r[0], r[1]);
|
|
2606
|
+
}
|
|
2607
|
+
}
|
|
2608
|
+
ne.prototype.clear = Qa;
|
|
2609
|
+
ne.prototype.delete = Ka;
|
|
2610
|
+
ne.prototype.get = Za;
|
|
2611
|
+
ne.prototype.has = Ya;
|
|
2612
|
+
ne.prototype.set = to;
|
|
2613
|
+
var eo = "Expected a function";
|
|
2614
|
+
function Wn(n, e) {
|
|
2615
|
+
if (typeof n != "function" || e != null && typeof e != "function")
|
|
2616
|
+
throw new TypeError(eo);
|
|
2617
|
+
var s = function() {
|
|
2618
|
+
var r = arguments, i = e ? e.apply(this, r) : r[0], a = s.cache;
|
|
2619
|
+
if (a.has(i))
|
|
2620
|
+
return a.get(i);
|
|
2621
|
+
var u = n.apply(this, r);
|
|
2622
|
+
return s.cache = a.set(i, u) || a, u;
|
|
2623
|
+
};
|
|
2624
|
+
return s.cache = new (Wn.Cache || ne)(), s;
|
|
2625
|
+
}
|
|
2626
|
+
Wn.Cache = ne;
|
|
2627
|
+
var no = 500;
|
|
2628
|
+
function so(n) {
|
|
2629
|
+
var e = Wn(n, function(r) {
|
|
2630
|
+
return s.size === no && s.clear(), r;
|
|
2631
|
+
}), s = e.cache;
|
|
2632
|
+
return e;
|
|
2633
|
+
}
|
|
2634
|
+
var ro = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, io = /\\(\\)?/g, ao = so(function(n) {
|
|
2635
|
+
var e = [];
|
|
2636
|
+
return n.charCodeAt(0) === 46 && e.push(""), n.replace(ro, function(s, r, i, a) {
|
|
2637
|
+
e.push(i ? a.replace(io, "$1") : r || s);
|
|
2638
|
+
}), e;
|
|
2639
|
+
});
|
|
2640
|
+
const oo = ao;
|
|
2641
|
+
function co(n) {
|
|
2642
|
+
return n == null ? "" : rr(n);
|
|
2643
|
+
}
|
|
2644
|
+
function uo(n, e) {
|
|
2645
|
+
return dn(n) ? n : Ea(n, e) ? [n] : oo(co(n));
|
|
2646
|
+
}
|
|
2647
|
+
var ho = 1 / 0;
|
|
2648
|
+
function lo(n) {
|
|
2649
|
+
if (typeof n == "string" || pn(n))
|
|
2650
|
+
return n;
|
|
2651
|
+
var e = n + "";
|
|
2652
|
+
return e == "0" && 1 / n == -ho ? "-0" : e;
|
|
2653
|
+
}
|
|
2654
|
+
function po(n, e) {
|
|
2655
|
+
e = uo(e, n);
|
|
2656
|
+
for (var s = 0, r = e.length; n != null && s < r; )
|
|
2657
|
+
n = n[lo(e[s++])];
|
|
2658
|
+
return s && s == r ? n : void 0;
|
|
2659
|
+
}
|
|
2660
|
+
function or(n, e, s) {
|
|
2661
|
+
var r = n == null ? void 0 : po(n, e);
|
|
2662
|
+
return r === void 0 ? s : r;
|
|
2663
|
+
}
|
|
2664
|
+
function mo(n, e) {
|
|
2665
|
+
for (var s = -1, r = e.length, i = n.length; ++s < r; )
|
|
2666
|
+
n[i + s] = e[s];
|
|
2667
|
+
return n;
|
|
2668
|
+
}
|
|
2669
|
+
var Bs = $t ? $t.isConcatSpreadable : void 0;
|
|
2670
|
+
function fo(n) {
|
|
2671
|
+
return dn(n) || Sa(n) || !!(Bs && n && n[Bs]);
|
|
2672
|
+
}
|
|
2673
|
+
function cr(n, e, s, r, i) {
|
|
2674
|
+
var a = -1, u = n.length;
|
|
2675
|
+
for (s || (s = fo), i || (i = []); ++a < u; ) {
|
|
2676
|
+
var l = n[a];
|
|
2677
|
+
e > 0 && s(l) ? e > 1 ? cr(l, e - 1, s, r, i) : mo(i, l) : r || (i[i.length] = l);
|
|
2678
|
+
}
|
|
2679
|
+
return i;
|
|
2680
|
+
}
|
|
2681
|
+
function ur(n) {
|
|
2682
|
+
var e = n == null ? 0 : n.length;
|
|
2683
|
+
return e ? cr(n, 1) : [];
|
|
2684
|
+
}
|
|
2685
|
+
var go = function() {
|
|
2686
|
+
return ln.Date.now();
|
|
2687
|
+
};
|
|
2688
|
+
const xn = go;
|
|
2689
|
+
var _o = "Expected a function", vo = Math.max, bo = Math.min;
|
|
2690
|
+
function wo(n, e, s) {
|
|
2691
|
+
var r, i, a, u, l, w, p = 0, f = !1, v = !1, h = !0;
|
|
2692
|
+
if (typeof n != "function")
|
|
2693
|
+
throw new TypeError(_o);
|
|
2694
|
+
e = Ls(e) || 0, Ue(s) && (f = !!s.leading, v = "maxWait" in s, a = v ? vo(Ls(s.maxWait) || 0, e) : a, h = "trailing" in s ? !!s.trailing : h);
|
|
2695
|
+
function _(J) {
|
|
2696
|
+
var ht = r, gt = i;
|
|
2697
|
+
return r = i = void 0, p = J, u = n.apply(gt, ht), u;
|
|
2698
|
+
}
|
|
2699
|
+
function y(J) {
|
|
2700
|
+
return p = J, l = setTimeout(R, e), f ? _(J) : u;
|
|
2701
|
+
}
|
|
2702
|
+
function k(J) {
|
|
2703
|
+
var ht = J - w, gt = J - p, zt = e - ht;
|
|
2704
|
+
return v ? bo(zt, a - gt) : zt;
|
|
2705
|
+
}
|
|
2706
|
+
function T(J) {
|
|
2707
|
+
var ht = J - w, gt = J - p;
|
|
2708
|
+
return w === void 0 || ht >= e || ht < 0 || v && gt >= a;
|
|
2709
|
+
}
|
|
2710
|
+
function R() {
|
|
2711
|
+
var J = xn();
|
|
2712
|
+
if (T(J))
|
|
2713
|
+
return tt(J);
|
|
2714
|
+
l = setTimeout(R, k(J));
|
|
2715
|
+
}
|
|
2716
|
+
function tt(J) {
|
|
2717
|
+
return l = void 0, h && r ? _(J) : (r = i = void 0, u);
|
|
2718
|
+
}
|
|
2719
|
+
function M() {
|
|
2720
|
+
l !== void 0 && clearTimeout(l), p = 0, r = w = i = l = void 0;
|
|
2721
|
+
}
|
|
2722
|
+
function C() {
|
|
2723
|
+
return l === void 0 ? u : tt(xn());
|
|
2724
|
+
}
|
|
2725
|
+
function V() {
|
|
2726
|
+
var J = xn(), ht = T(J);
|
|
2727
|
+
if (r = arguments, i = this, w = J, ht) {
|
|
2728
|
+
if (l === void 0)
|
|
2729
|
+
return y(w);
|
|
2730
|
+
if (v)
|
|
2731
|
+
return clearTimeout(l), l = setTimeout(R, e), _(w);
|
|
2732
|
+
}
|
|
2733
|
+
return l === void 0 && (l = setTimeout(R, e)), u;
|
|
2734
|
+
}
|
|
2735
|
+
return V.cancel = M, V.flush = C, V;
|
|
2736
|
+
}
|
|
2737
|
+
class yo {
|
|
2738
|
+
constructor() {
|
|
2739
|
+
b(this, "logsObj"), b(this, "initPromise"), this.initPromise = this.init();
|
|
2740
|
+
}
|
|
2741
|
+
async init() {
|
|
2742
|
+
return this.logsObj = await xi(), this.logsObj;
|
|
2743
|
+
}
|
|
2744
|
+
get length() {
|
|
2745
|
+
var e, s;
|
|
2746
|
+
return (s = (e = this.logsObj) == null ? void 0 : e.length) != null ? s : 0;
|
|
2747
|
+
}
|
|
2748
|
+
getLogs() {
|
|
2749
|
+
var e;
|
|
2750
|
+
return ((e = this.logsObj) == null ? void 0 : e.logs) || [];
|
|
2751
|
+
}
|
|
2752
|
+
async cacheLog(e) {
|
|
2753
|
+
var s;
|
|
2754
|
+
await this.initPromise, await ((s = this.logsObj) == null ? void 0 : s.push(e));
|
|
2755
|
+
}
|
|
2756
|
+
async send(e) {
|
|
2757
|
+
var s;
|
|
2758
|
+
await this.initPromise;
|
|
2759
|
+
const r = await ((s = this.logsObj) == null ? void 0 : s.shift());
|
|
2760
|
+
r != null && r.length && await e(ur(r));
|
|
2761
|
+
}
|
|
2762
|
+
async sendByBeacon(e) {
|
|
2763
|
+
var s;
|
|
2764
|
+
await this.initPromise;
|
|
2765
|
+
const r = await ((s = this.logsObj) == null ? void 0 : s.shift());
|
|
2766
|
+
r != null && r.length && await e(r);
|
|
2767
|
+
}
|
|
2768
|
+
}
|
|
2769
|
+
function ko(n) {
|
|
2770
|
+
return gn(n, "String");
|
|
2771
|
+
}
|
|
2772
|
+
function To(n) {
|
|
2773
|
+
return gn(n, "Array");
|
|
2774
|
+
}
|
|
2775
|
+
function So(n) {
|
|
2776
|
+
return gn(n, "Object");
|
|
2777
|
+
}
|
|
2778
|
+
function Po(n) {
|
|
2779
|
+
return typeof n == "function";
|
|
2780
|
+
}
|
|
2781
|
+
function Cs(n, e = "Object") {
|
|
2782
|
+
return To(n) ? n.every((s) => gn(s, e)) : !1;
|
|
2783
|
+
}
|
|
2784
|
+
function gn(n, e = "Object") {
|
|
2785
|
+
return Object.prototype.toString.call(n) === `[object ${e}]`;
|
|
2786
|
+
}
|
|
2787
|
+
const Lo = window.indexedDB, Eo = /* @__PURE__ */ new Set(["add", "clear", "count", "delete", "get", "getAll", "getAllKeys", "getKey", "openCursor", "openKeyCursor", "put"]);
|
|
2788
|
+
function xo(n, e, ...s) {
|
|
2789
|
+
return new Promise(async (r, i) => {
|
|
2790
|
+
try {
|
|
2791
|
+
const a = (await this.createTransaction(n)).objectStore(n);
|
|
2792
|
+
let u = a[e].call(a, ...s);
|
|
2793
|
+
u ? (u.onsuccess = function(l) {
|
|
2794
|
+
r(or(l, "target.result"));
|
|
2795
|
+
}, u.onerror = function(l) {
|
|
2796
|
+
console.log("---storeOperate onerror", n, e, l), i(l);
|
|
2797
|
+
}) : r(void 0);
|
|
2798
|
+
} catch (a) {
|
|
2799
|
+
i(a);
|
|
2800
|
+
}
|
|
2801
|
+
});
|
|
2802
|
+
}
|
|
2803
|
+
function Bo(n) {
|
|
2804
|
+
const e = this;
|
|
2805
|
+
let s = {};
|
|
2806
|
+
return Eo.forEach((r) => {
|
|
2807
|
+
s[r] = function(...i) {
|
|
2808
|
+
var a;
|
|
2809
|
+
return (a = e == null ? void 0 : e.manager) == null ? void 0 : a.pushTask(
|
|
2810
|
+
() => xo.call(e, n, r, ...i)
|
|
2811
|
+
);
|
|
2812
|
+
};
|
|
2813
|
+
}), s;
|
|
2814
|
+
}
|
|
2815
|
+
class Co {
|
|
2816
|
+
constructor() {
|
|
2817
|
+
b(this, "dbManagerMap", /* @__PURE__ */ new Map());
|
|
2818
|
+
}
|
|
2819
|
+
getOrCreateDBManager(e) {
|
|
2820
|
+
if (this.dbManagerMap.has(e))
|
|
2821
|
+
return this.dbManagerMap.get(e);
|
|
2822
|
+
const s = new Mo(e);
|
|
2823
|
+
return this.dbManagerMap.set(e, s), s;
|
|
2824
|
+
}
|
|
2825
|
+
get(e) {
|
|
2826
|
+
return this.getOrCreateDBManager(e);
|
|
2827
|
+
}
|
|
2828
|
+
clear(e) {
|
|
2829
|
+
const s = this.dbManagerMap.get(e);
|
|
2830
|
+
!s || (s.close(), this.dbManagerMap.delete(e));
|
|
2831
|
+
}
|
|
2832
|
+
}
|
|
2833
|
+
class Mo {
|
|
2834
|
+
constructor(e) {
|
|
2835
|
+
b(this, "initPromise", Promise.resolve()), b(this, "openStatus", ""), b(this, "version", 0), b(this, "dbName"), b(this, "db", null), b(this, "isClose", !0), b(this, "task", Promise.resolve()), this.dbName = e, this.init();
|
|
2836
|
+
}
|
|
2837
|
+
pushTask(e) {
|
|
2838
|
+
if (this.isClose) {
|
|
2839
|
+
console.log("----task error, IndexDB is close");
|
|
2840
|
+
return;
|
|
2841
|
+
}
|
|
2842
|
+
let s = this.task.then(() => {
|
|
2843
|
+
try {
|
|
2844
|
+
return Po(e) ? e() : e;
|
|
2845
|
+
} catch (r) {
|
|
2846
|
+
console.log("----task error", r);
|
|
2847
|
+
}
|
|
2848
|
+
});
|
|
2849
|
+
return this.task = s, s;
|
|
2850
|
+
}
|
|
2851
|
+
close() {
|
|
2852
|
+
const e = () => {
|
|
2853
|
+
this.openStatus = "", this.version = 0, this.db && (this.db.close(), this.db = null);
|
|
2854
|
+
};
|
|
2855
|
+
if (this.isClose)
|
|
2856
|
+
e();
|
|
2857
|
+
else {
|
|
2858
|
+
let s = this.pushTask(e);
|
|
2859
|
+
return this.isClose = !0, s;
|
|
2860
|
+
}
|
|
2861
|
+
}
|
|
2862
|
+
transTransactionParam(e) {
|
|
2863
|
+
return ko(e) ? [{ storeName: e }] : Cs(e, "String") ? e.map((s) => ({ storeName: s })) : So(e) ? [e] : Cs(e) ? e : (console.warn("[transTransactionParam]\u5165\u53C2\u683C\u5F0F\u4E0D\u6B63\u786E", e), []);
|
|
2864
|
+
}
|
|
2865
|
+
async transaction(e, s = "readonly") {
|
|
2866
|
+
await this.initPromise;
|
|
2867
|
+
const r = this.transTransactionParam(e);
|
|
2868
|
+
if (!r.length)
|
|
2869
|
+
return;
|
|
2870
|
+
const i = [];
|
|
2871
|
+
return r.forEach((a) => {
|
|
2872
|
+
!this.db || this.db.objectStoreNames.contains(a.storeName) || i.push((u) => {
|
|
2873
|
+
u.createObjectStore(a.storeName, a.option);
|
|
2874
|
+
});
|
|
2875
|
+
}), i.length > 0 && await this.upgradeneeded(i), Bo.bind({
|
|
2876
|
+
manager: this,
|
|
2877
|
+
createTransaction: async (a) => {
|
|
2878
|
+
if (await this.initPromise, !!this.db)
|
|
2879
|
+
return this.db.transaction(a, s);
|
|
2880
|
+
}
|
|
2881
|
+
});
|
|
2882
|
+
}
|
|
2883
|
+
init(e, s) {
|
|
2884
|
+
let r = this.initPromise;
|
|
2885
|
+
this.initPromise = new Promise(async (i, a) => {
|
|
2886
|
+
await r, await this.close();
|
|
2887
|
+
const u = Lo.open(this.dbName, e);
|
|
2888
|
+
let l = setTimeout(() => {
|
|
2889
|
+
a(new Error("[IndexDB\u8FDE\u63A5\u8D85\u65F6] name: " + this.dbName + " \u8BF7\u5C1D\u8BD5\u5237\u65B0\u6216\u91CD\u542F\u6D4F\u89C8\u5668"));
|
|
2890
|
+
}, 1e4);
|
|
2891
|
+
u.onsuccess = () => {
|
|
2892
|
+
clearTimeout(l), this.openStatus = "success", this.db = u.result;
|
|
2893
|
+
const w = this.db;
|
|
2894
|
+
this.isClose = !1;
|
|
2895
|
+
const p = w.version;
|
|
2896
|
+
this.version = w.version, w.onclose = () => {
|
|
2897
|
+
this.isClose = !0, console.log("[indexDB\u5173\u95ED]", p);
|
|
2898
|
+
}, console.log(`[indexDB\u521D\u59CB\u5316]
|
|
2899
|
+
onsuccess name: ` + this.dbName + `
|
|
2900
|
+
version: ` + p), i();
|
|
2901
|
+
}, u.onupgradeneeded = (w) => {
|
|
2902
|
+
this.openStatus = "upgradeneeded";
|
|
2903
|
+
const p = or(w, "target.result");
|
|
2904
|
+
p ? (s && s(p), console.log("[indexDB\u521D\u59CB\u5316] onupgradeneeded name: " + this.dbName)) : console.error("[indexDB\u521D\u59CB\u5316\u5931\u8D25] onupgradeneeded name: " + this.dbName);
|
|
2905
|
+
}, u.onerror = (w) => {
|
|
2906
|
+
clearTimeout(l), console.error("[indexDB\u521D\u59CB\u5316\u5931\u8D25] name: " + this.dbName, w), i();
|
|
2907
|
+
};
|
|
2908
|
+
});
|
|
2909
|
+
}
|
|
2910
|
+
async upgradeneeded(e) {
|
|
2911
|
+
try {
|
|
2912
|
+
this.init(this.version + 1, function(s) {
|
|
2913
|
+
let r = e.length;
|
|
2914
|
+
for (; r--; )
|
|
2915
|
+
e[r](s);
|
|
2916
|
+
}), await this.initPromise;
|
|
2917
|
+
} catch (s) {
|
|
2918
|
+
console.error("[DBManager.upgradeneeded\u5931\u8D25]", s);
|
|
2919
|
+
}
|
|
2920
|
+
}
|
|
2921
|
+
}
|
|
2922
|
+
const Bn = new Co();
|
|
2923
|
+
class Ro {
|
|
2924
|
+
constructor(e = "logs") {
|
|
2925
|
+
b(this, "logs", []), b(this, "thisSize", 0), b(this, "dbLength", 0), b(this, "dbName", "apaas-track"), b(this, "storeName", "logs"), b(this, "maxSize", 1024 * 1024), this.storeName = e;
|
|
2926
|
+
}
|
|
2927
|
+
get length() {
|
|
2928
|
+
return this.dbLength + this.logs.length;
|
|
2929
|
+
}
|
|
2930
|
+
async init() {
|
|
2931
|
+
let e = [];
|
|
2932
|
+
const s = await (await Bn.get(this.dbName)).transaction(this.storeName, "readonly");
|
|
2933
|
+
s && (e = await s(this.storeName).getAllKeys()), this.dbLength = e.length;
|
|
2934
|
+
}
|
|
2935
|
+
async push(e) {
|
|
2936
|
+
try {
|
|
2937
|
+
const s = JSON.stringify(e).length;
|
|
2938
|
+
this.thisSize + s >= this.maxSize ? (await this.save(), this.logs.push(e), this.thisSize = s, s >= this.maxSize && await this.save()) : (this.logs.push(e), this.thisSize += JSON.stringify(e).length);
|
|
2939
|
+
} catch (s) {
|
|
2940
|
+
console.error(s);
|
|
2941
|
+
}
|
|
2942
|
+
}
|
|
2943
|
+
async compulsionSave() {
|
|
2944
|
+
this.logs.length !== 0 && await this.save();
|
|
2945
|
+
}
|
|
2946
|
+
clearArray() {
|
|
2947
|
+
this.logs.length = 0, this.thisSize = 0;
|
|
2948
|
+
}
|
|
2949
|
+
async save() {
|
|
2950
|
+
try {
|
|
2951
|
+
const e = this.logs;
|
|
2952
|
+
if (e.length === 0)
|
|
2953
|
+
return;
|
|
2954
|
+
const s = await (await Bn.get(this.dbName)).transaction(this.storeName, "readwrite");
|
|
2955
|
+
s && (await s(this.storeName).add(e, Date.now()), this.dbLength++, this.clearArray());
|
|
2956
|
+
} catch (e) {
|
|
2957
|
+
console.error(e);
|
|
2958
|
+
}
|
|
2959
|
+
}
|
|
2960
|
+
async shift(e = 1) {
|
|
2961
|
+
let s = [];
|
|
2962
|
+
if (this.dbLength !== 0 && (s = await this.shiftDB(e)), e - s.length > 0 && this.logs.length > 0) {
|
|
2963
|
+
let r = [...this.logs];
|
|
2964
|
+
this.clearArray(), s.push(r);
|
|
2965
|
+
}
|
|
2966
|
+
return s;
|
|
2967
|
+
}
|
|
2968
|
+
async shiftDB(e) {
|
|
2969
|
+
try {
|
|
2970
|
+
let s = [];
|
|
2971
|
+
const r = await (await Bn.get(this.dbName)).transaction(this.storeName, "readwrite");
|
|
2972
|
+
if (r) {
|
|
2973
|
+
const i = r(this.storeName);
|
|
2974
|
+
let a = await i.getAllKeys();
|
|
2975
|
+
if (a.length === 0)
|
|
2976
|
+
return [];
|
|
2977
|
+
const u = this.getRange(e, a), l = [];
|
|
2978
|
+
u.forEach((p) => {
|
|
2979
|
+
l.push(i.get(p));
|
|
2980
|
+
}), s = await Promise.all(l);
|
|
2981
|
+
const w = [];
|
|
2982
|
+
u.forEach((p) => {
|
|
2983
|
+
w.push(i.delete(p));
|
|
2984
|
+
}), await Promise.all(w), a = await i.getAllKeys(), this.dbLength = a.length;
|
|
2985
|
+
}
|
|
2986
|
+
return s;
|
|
2987
|
+
} catch (s) {
|
|
2988
|
+
return console.error(s), [];
|
|
2989
|
+
}
|
|
2990
|
+
}
|
|
2991
|
+
getRange(e, s) {
|
|
2992
|
+
const r = [];
|
|
2993
|
+
for (let i = 0; i < e && i < s.length; i++)
|
|
2994
|
+
r.push(s[i]);
|
|
2995
|
+
return r;
|
|
2996
|
+
}
|
|
2997
|
+
}
|
|
2998
|
+
async function Do(n) {
|
|
2999
|
+
const e = new Ro(n);
|
|
3000
|
+
return await e.init(), e;
|
|
3001
|
+
}
|
|
3002
|
+
class Ao {
|
|
3003
|
+
constructor() {
|
|
3004
|
+
b(this, "logsDB"), b(this, "initPromise"), this.initPromise = this.init();
|
|
3005
|
+
}
|
|
3006
|
+
async init() {
|
|
3007
|
+
return this.logsDB = await Do(), this.logsDB;
|
|
3008
|
+
}
|
|
3009
|
+
get length() {
|
|
3010
|
+
var e, s;
|
|
3011
|
+
return (s = (e = this.logsDB) == null ? void 0 : e.length) != null ? s : 0;
|
|
3012
|
+
}
|
|
3013
|
+
getLogs() {
|
|
3014
|
+
var e;
|
|
3015
|
+
return ((e = this.logsDB) == null ? void 0 : e.logs) || [];
|
|
3016
|
+
}
|
|
3017
|
+
async cacheLog(e) {
|
|
3018
|
+
var s;
|
|
3019
|
+
await this.initPromise, await ((s = this.logsDB) == null ? void 0 : s.push(e));
|
|
3020
|
+
}
|
|
3021
|
+
async send(e) {
|
|
3022
|
+
var s;
|
|
3023
|
+
await this.initPromise;
|
|
3024
|
+
const r = await ((s = this.logsDB) == null ? void 0 : s.shift(5));
|
|
3025
|
+
r != null && r.length && e(ur(r));
|
|
3026
|
+
}
|
|
3027
|
+
async sendByBeacon(e) {
|
|
3028
|
+
var s;
|
|
3029
|
+
await this.initPromise, await ((s = this.logsDB) == null ? void 0 : s.compulsionSave());
|
|
3030
|
+
}
|
|
3031
|
+
}
|
|
3032
|
+
class Bt extends hn {
|
|
3033
|
+
constructor(e) {
|
|
3034
|
+
super(e), b(this, "options"), b(this, "logsSender"), b(this, "nextTickLogs", []), b(this, "isStart", !1), b(this, "listenPostMessageHandler"), this.options = e, this.initStorageData(), this.initBrowserLog(), e.commonLog && this.initCommonLog(e.commonLog), console.log("this.options.useIndexDB", this.options.useIndexDB), this.options.useIndexDB ? this.logsSender = new Ao() : this.logsSender = new yo();
|
|
3035
|
+
}
|
|
3036
|
+
initStorageData() {
|
|
3037
|
+
const e = JSON.parse(
|
|
3038
|
+
localStorage.getItem("apaas-track") || "{}"
|
|
3039
|
+
);
|
|
3040
|
+
e.anonymousid || (e.anonymousid = be()), e.logs || (e.logs = []), e.distinctid = be(), localStorage.setItem("apaas-track", JSON.stringify(e));
|
|
3041
|
+
}
|
|
3042
|
+
getStorageData() {
|
|
3043
|
+
return JSON.parse(
|
|
3044
|
+
localStorage.getItem("apaas-track") || "{}"
|
|
3045
|
+
);
|
|
3046
|
+
}
|
|
3047
|
+
updateStorageData(e) {
|
|
3048
|
+
localStorage.setItem("apaas-track", JSON.stringify(e));
|
|
3049
|
+
}
|
|
3050
|
+
get anonymousid() {
|
|
3051
|
+
var e;
|
|
3052
|
+
return ((e = this.browserLog) == null ? void 0 : e.anonymousid) || this.getStorageData().anonymousid;
|
|
3053
|
+
}
|
|
3054
|
+
get distinctid() {
|
|
3055
|
+
var e;
|
|
3056
|
+
return ((e = this.browserLog) == null ? void 0 : e.distinctid) || this.getStorageData().distinctid;
|
|
3057
|
+
}
|
|
3058
|
+
initBrowserLog() {
|
|
3059
|
+
const e = new zn.exports.UAParser();
|
|
3060
|
+
e.setUA(navigator.userAgent);
|
|
3061
|
+
const s = e.getResult(), r = s.os.version || "", i = s.os.name || "", a = s.browser.name || "", u = s.browser.version || "", l = navigator.vendor, w = Zs.exports(
|
|
3062
|
+
`${i}${r}${l}${a}${u}`
|
|
3063
|
+
), p = location.href;
|
|
3064
|
+
this.browserLog = {
|
|
3065
|
+
system: i,
|
|
3066
|
+
systemver: r,
|
|
3067
|
+
manufacturer: l,
|
|
3068
|
+
browser: a,
|
|
3069
|
+
browserver: u,
|
|
3070
|
+
terminalid: w,
|
|
3071
|
+
anonymousid: this.anonymousid,
|
|
3072
|
+
distinctid: this.distinctid,
|
|
3073
|
+
url: p,
|
|
3074
|
+
logsdkver: sn
|
|
3075
|
+
};
|
|
3076
|
+
}
|
|
3077
|
+
start(...e) {
|
|
3078
|
+
if (this.isStart)
|
|
3079
|
+
return;
|
|
3080
|
+
let s = 0, r = 60 * 5 * 1e3, i = null, a = window.setInterval(() => {
|
|
3081
|
+
u();
|
|
3082
|
+
}, this.options.timer || 1e4);
|
|
3083
|
+
setTimeout(() => {
|
|
3084
|
+
u();
|
|
3085
|
+
}, 2e3);
|
|
3086
|
+
const u = () => {
|
|
3087
|
+
this.send().then(() => {
|
|
3088
|
+
s && (s = 0), i && (clearInterval(i), i = null), a || (a = window.setInterval(() => {
|
|
3089
|
+
u();
|
|
3090
|
+
}, this.options.timer || 1e4));
|
|
3091
|
+
}).catch((l) => {
|
|
3092
|
+
console.error("track send error", l), s++, s >= 5 && (a && clearInterval(a), a = null, i || (i = window.setInterval(() => {
|
|
3093
|
+
u();
|
|
3094
|
+
}, r)));
|
|
3095
|
+
});
|
|
3096
|
+
};
|
|
3097
|
+
super.start(), this.sendLegancyLogs(), this.isStart = !0, this.listenPostMessage();
|
|
3098
|
+
}
|
|
3099
|
+
getLegancyLogs() {
|
|
3100
|
+
return this.getStorageData().logs || [];
|
|
3101
|
+
}
|
|
3102
|
+
clearLegancyLogs() {
|
|
3103
|
+
const e = this.getStorageData();
|
|
3104
|
+
delete e.logs, this.updateStorageData(e);
|
|
3105
|
+
}
|
|
3106
|
+
sendLegancyLogs() {
|
|
3107
|
+
this.getLegancyLogs().forEach((e) => {
|
|
3108
|
+
this.addLogToQueue(e, !1, !1);
|
|
3109
|
+
}), this.clearLegancyLogs();
|
|
3110
|
+
}
|
|
3111
|
+
addToLegancyLog(e) {
|
|
3112
|
+
e = this.transformLog(e);
|
|
3113
|
+
const s = [...this.getLegancyLogs() || [], e], r = this.getStorageData();
|
|
3114
|
+
r.logs = s, this.updateStorageData(r);
|
|
3115
|
+
}
|
|
3116
|
+
listenPostMessage() {
|
|
3117
|
+
this.listenPostMessageHandler = (e) => {
|
|
3118
|
+
var s;
|
|
3119
|
+
const r = (e == null ? void 0 : e.data) || {};
|
|
3120
|
+
if (r.type === "getWebCommonParams") {
|
|
3121
|
+
const i = Array.from(document.querySelectorAll("iframe"));
|
|
3122
|
+
for (let a of i)
|
|
3123
|
+
(s = a == null ? void 0 : a.contentWindow) == null || s.postMessage(
|
|
3124
|
+
{
|
|
3125
|
+
type: "receiveWebCommonParams",
|
|
3126
|
+
data: {
|
|
3127
|
+
url: this.options.url,
|
|
3128
|
+
timer: this.options.timer || 1e4,
|
|
3129
|
+
zip: this.options.zip,
|
|
3130
|
+
commonLog: this.commonLog
|
|
3131
|
+
}
|
|
3132
|
+
},
|
|
3133
|
+
"*"
|
|
3134
|
+
);
|
|
3135
|
+
} else if (r.type === "sendApaasLog") {
|
|
3136
|
+
const i = r.data, { log: a, isImmediate: u } = i;
|
|
3137
|
+
this.sendLog(a, u);
|
|
3138
|
+
}
|
|
3139
|
+
}, window.addEventListener("message", this.listenPostMessageHandler);
|
|
3140
|
+
}
|
|
3141
|
+
divideLogsSend(e) {
|
|
3142
|
+
return this.options.useIndexDB ? on(this.options.url, e, this.getZip()) : Oo(e, {
|
|
3143
|
+
url: this.options.url,
|
|
3144
|
+
zip: this.getZip(),
|
|
3145
|
+
maxSize: this.getMaxSize()
|
|
3146
|
+
});
|
|
3147
|
+
}
|
|
3148
|
+
async sendByNextTick(e) {
|
|
3149
|
+
if (this.nextTickLogs.push(e), await On(), !this.nextTickLogs.length)
|
|
3150
|
+
return;
|
|
3151
|
+
const s = JSON.parse(JSON.stringify(this.nextTickLogs));
|
|
3152
|
+
this.divideLogsSend(this.nextTickLogs).catch((r) => {
|
|
3153
|
+
this.nextTickLogs = [...s, this.nextTickLogs];
|
|
3154
|
+
}), this.nextTickLogs.length = 0;
|
|
3155
|
+
}
|
|
3156
|
+
async send() {
|
|
3157
|
+
if (this.logsSender.length)
|
|
3158
|
+
try {
|
|
3159
|
+
await this.logsSender.send(this.divideLogsSend.bind(this));
|
|
3160
|
+
} catch {
|
|
3161
|
+
}
|
|
3162
|
+
}
|
|
3163
|
+
async sendLog(e, s = !1) {
|
|
3164
|
+
try {
|
|
3165
|
+
e = JSON.parse(JSON.stringify(e));
|
|
3166
|
+
} catch {
|
|
3167
|
+
}
|
|
3168
|
+
s ? this.sendByNextTick(e) : await this.logsSender.cacheLog(e);
|
|
3169
|
+
}
|
|
3170
|
+
getZip() {
|
|
3171
|
+
return this.options.zip !== void 0 ? this.options.zip : !0;
|
|
3172
|
+
}
|
|
3173
|
+
getMaxSize() {
|
|
3174
|
+
const e = this.options.zip !== void 0 ? this.options.zip : !0;
|
|
3175
|
+
return 1024 * 1024 / (e ? 2 : 1);
|
|
3176
|
+
}
|
|
3177
|
+
async sendByBeacon(e) {
|
|
3178
|
+
const s = async (r) => Li(
|
|
3179
|
+
`${this.options.url}`,
|
|
3180
|
+
r,
|
|
3181
|
+
e !== void 0 ? e : this.getZip()
|
|
3182
|
+
);
|
|
3183
|
+
this.logsSender.length && await this.logsSender.sendByBeacon(s.bind(this));
|
|
3184
|
+
}
|
|
3185
|
+
}
|
|
3186
|
+
function Oo(n, e) {
|
|
3187
|
+
const { url: s, zip: r, maxSize: i } = e;
|
|
3188
|
+
if (JSON.stringify(n).length <= i || n.length === 1)
|
|
3189
|
+
return on(s, n, r);
|
|
3190
|
+
{
|
|
3191
|
+
const a = ii(n, i), u = [];
|
|
3192
|
+
return a.forEach((l) => {
|
|
3193
|
+
u.push(on(s, l, r));
|
|
3194
|
+
}), Promise.all(u);
|
|
3195
|
+
}
|
|
3196
|
+
}
|
|
3197
|
+
class de extends at {
|
|
3198
|
+
constructor(e) {
|
|
3199
|
+
super(e, "click"), b(this, "paths", ""), b(this, "customProperties", {}), b(this, "name", "");
|
|
3200
|
+
}
|
|
3201
|
+
getProperties() {
|
|
3202
|
+
return {
|
|
3203
|
+
name: this.name,
|
|
3204
|
+
paths: this.paths,
|
|
3205
|
+
customProperties: this.customProperties
|
|
3206
|
+
};
|
|
3207
|
+
}
|
|
3208
|
+
setProperties(e) {
|
|
3209
|
+
e.paths && (this.paths = e.paths), e.name && (this.name = e.name), this.customProperties = e.customProperties;
|
|
3210
|
+
}
|
|
3211
|
+
}
|
|
3212
|
+
const zo = (n) => !n || n === document || n.tagName === "HTML" || !n.hasAttribute ? !1 : n.hasAttribute("apaas-track-click") && n.getAttribute("apaas-track-click") !== "false", Ms = (n) => {
|
|
3213
|
+
n.target;
|
|
3214
|
+
const e = n.composedPath();
|
|
3215
|
+
if (!e.length)
|
|
3216
|
+
return !1;
|
|
3217
|
+
for (let s = 0; s < e.length; s++) {
|
|
3218
|
+
const r = e[s];
|
|
3219
|
+
if (r === window)
|
|
3220
|
+
return !1;
|
|
3221
|
+
if (zo(r))
|
|
3222
|
+
return r;
|
|
3223
|
+
}
|
|
3224
|
+
return !1;
|
|
3225
|
+
}, In = (n) => {
|
|
3226
|
+
const e = n.tagName, s = n.id, r = n.className, i = (l, w, p) => `${l}${w ? "#" + w : ""}${p ? "." + p : ""}`;
|
|
3227
|
+
let a = i(e, s, r) + " > ", u = n.parentElement;
|
|
3228
|
+
for (; u; ) {
|
|
3229
|
+
const l = u.tagName, w = u.id, p = u.className;
|
|
3230
|
+
a += i(l, w, p) + " > ", u = u.parentElement;
|
|
3231
|
+
}
|
|
3232
|
+
return a = a.replace(/\s>\s$/, ""), a && (a = a.split(" > ").reverse().join(" > ")), a;
|
|
3233
|
+
}, Ho = (n, e) => {
|
|
3234
|
+
const s = (r, i) => r === i;
|
|
3235
|
+
if (n === document)
|
|
3236
|
+
return !0;
|
|
3237
|
+
{
|
|
3238
|
+
const r = e.target;
|
|
3239
|
+
if (s(n, r))
|
|
3240
|
+
return !0;
|
|
3241
|
+
let i = r.parentElement;
|
|
3242
|
+
if (!i)
|
|
3243
|
+
return !1;
|
|
3244
|
+
for (; i; ) {
|
|
3245
|
+
if (s(n, i))
|
|
3246
|
+
return !0;
|
|
3247
|
+
i = i.parentElement;
|
|
3248
|
+
}
|
|
3249
|
+
return !1;
|
|
3250
|
+
}
|
|
3251
|
+
}, Fo = (n, e) => {
|
|
3252
|
+
const s = () => !0, r = (a) => Ms(a), i = (a) => {
|
|
3253
|
+
a.target;
|
|
3254
|
+
const u = (e == null ? void 0 : e.collectSelectors) || [];
|
|
3255
|
+
if (!u.length)
|
|
3256
|
+
return null;
|
|
3257
|
+
let l = [];
|
|
3258
|
+
for (let p = 0; p < u.length; p++) {
|
|
3259
|
+
const { selector: f, name: v } = u[p], h = document.querySelectorAll(f);
|
|
3260
|
+
!h || !h.length || h.forEach((_) => {
|
|
3261
|
+
l.push({
|
|
3262
|
+
name: v,
|
|
3263
|
+
selector: f,
|
|
3264
|
+
element: _
|
|
3265
|
+
});
|
|
3266
|
+
});
|
|
3267
|
+
}
|
|
3268
|
+
if (!l.length)
|
|
3269
|
+
return null;
|
|
3270
|
+
let w = [];
|
|
3271
|
+
for (let p = 0; p < l.length; p++) {
|
|
3272
|
+
const {
|
|
3273
|
+
element: f,
|
|
3274
|
+
name: v,
|
|
3275
|
+
selector: h
|
|
3276
|
+
} = l[p];
|
|
3277
|
+
f && Ho(f, a) && w.push({
|
|
3278
|
+
name: v,
|
|
3279
|
+
selector: h,
|
|
3280
|
+
element: f
|
|
3281
|
+
});
|
|
3282
|
+
}
|
|
3283
|
+
return w;
|
|
3284
|
+
};
|
|
3285
|
+
e && document.addEventListener(
|
|
3286
|
+
"click",
|
|
3287
|
+
(a) => {
|
|
3288
|
+
if (!((e == null ? void 0 : e.collectUrl) || s)(location))
|
|
3289
|
+
return;
|
|
3290
|
+
const u = ((e == null ? void 0 : e.collectElement) || r)(a), l = i(a);
|
|
3291
|
+
if (!u && (!l || !l.length))
|
|
3292
|
+
return;
|
|
3293
|
+
const w = Ms(a);
|
|
3294
|
+
if (w) {
|
|
3295
|
+
let p = {};
|
|
3296
|
+
const f = (e == null ? void 0 : e.customProperty) || [], v = w.attributes;
|
|
3297
|
+
let h = "";
|
|
3298
|
+
const _ = v.getNamedItem("apaas-track-click");
|
|
3299
|
+
if (_ && _.nodeName === "apaas-track-click") {
|
|
3300
|
+
const T = _.nodeValue;
|
|
3301
|
+
T && T !== "false" && T !== "true" && (h = T);
|
|
3302
|
+
}
|
|
3303
|
+
for (let T of v) {
|
|
3304
|
+
let R = T.nodeName;
|
|
3305
|
+
const tt = T.nodeValue;
|
|
3306
|
+
R.startsWith("data-apaastrack-") ? p[R.replace("data-apaastrack-", "")] = tt || "" : f.length && f.forEach((M) => {
|
|
3307
|
+
if (R === M) {
|
|
3308
|
+
const C = R.replace(
|
|
3309
|
+
/-[A-Za-z]/,
|
|
3310
|
+
(V) => V[1].toUpperCase()
|
|
3311
|
+
);
|
|
3312
|
+
p[C] = tt || "";
|
|
3313
|
+
}
|
|
3314
|
+
});
|
|
3315
|
+
}
|
|
3316
|
+
let y = "";
|
|
3317
|
+
e != null && e.trackElementPath && (y = In(w));
|
|
3318
|
+
const k = new de(n);
|
|
3319
|
+
k.setProperties({
|
|
3320
|
+
name: p.name || h,
|
|
3321
|
+
paths: y,
|
|
3322
|
+
customProperties: p
|
|
3323
|
+
}), n.addLogByEvent(k);
|
|
3324
|
+
}
|
|
3325
|
+
if (l && l.length)
|
|
3326
|
+
for (let p of l) {
|
|
3327
|
+
let f = "";
|
|
3328
|
+
e != null && e.trackElementPath && (f = In(
|
|
3329
|
+
p.element
|
|
3330
|
+
));
|
|
3331
|
+
const v = new de(n);
|
|
3332
|
+
v.setProperties({
|
|
3333
|
+
name: p.name,
|
|
3334
|
+
paths: f,
|
|
3335
|
+
customProperties: {
|
|
3336
|
+
selector: p.selector,
|
|
3337
|
+
name: p.name
|
|
3338
|
+
}
|
|
3339
|
+
}), n.addLogByEvent(v);
|
|
3340
|
+
}
|
|
3341
|
+
},
|
|
3342
|
+
!0
|
|
3343
|
+
);
|
|
3344
|
+
}, Io = (n, e, s, r) => {
|
|
3345
|
+
const i = {
|
|
3346
|
+
paths: "",
|
|
3347
|
+
customProperties: {}
|
|
3348
|
+
};
|
|
3349
|
+
"customProperties" in e ? i.customProperties = e.customProperties : i.customProperties = e;
|
|
3350
|
+
const a = Ot(n, "click");
|
|
3351
|
+
let u = e.paths || "";
|
|
3352
|
+
r && !u && (s == null ? void 0 : s.trackElementPath) && (u = In(r.target), i.paths = u), a.setProperties(i), n.addLogByEvent(a);
|
|
3353
|
+
}, No = (n) => {
|
|
3354
|
+
n || (n = {}), de.eventOptions = n, de.initApaasTrackHook = (e) => {
|
|
3355
|
+
e.executeClickEvent = (s, r) => {
|
|
3356
|
+
Io(e, s, n, r);
|
|
3357
|
+
};
|
|
3358
|
+
}, de.startApaasTrackHook = (e) => {
|
|
3359
|
+
Fo(e, n);
|
|
3360
|
+
}, Bt.registerEvent("click", de);
|
|
3361
|
+
}, ge = [], hr = (n) => {
|
|
3362
|
+
ge.length || window.addEventListener("pagehide", (...e) => {
|
|
3363
|
+
ge.forEach((s) => {
|
|
3364
|
+
s(...e);
|
|
3365
|
+
});
|
|
3366
|
+
}), ge.push(n);
|
|
3367
|
+
}, jo = (n) => {
|
|
3368
|
+
for (let e = 0; e < ge.length; e++) {
|
|
3369
|
+
const s = ge[e];
|
|
3370
|
+
n === s && ge.splice(e, 1);
|
|
3371
|
+
}
|
|
3372
|
+
}, At = [], Uo = (n) => {
|
|
3373
|
+
At.length || (document.addEventListener("click", (...e) => {
|
|
3374
|
+
At.forEach((s) => {
|
|
3375
|
+
s(...e);
|
|
3376
|
+
});
|
|
3377
|
+
}), document.addEventListener("mouseover", (...e) => {
|
|
3378
|
+
At.forEach((s) => {
|
|
3379
|
+
s(...e);
|
|
3380
|
+
});
|
|
3381
|
+
}), document.addEventListener("scroll", (...e) => {
|
|
3382
|
+
At.forEach((s) => {
|
|
3383
|
+
s(...e);
|
|
3384
|
+
});
|
|
3385
|
+
}), document.addEventListener("keydown", (...e) => {
|
|
3386
|
+
At.forEach((s) => {
|
|
3387
|
+
s(...e);
|
|
3388
|
+
});
|
|
3389
|
+
})), At.push(n);
|
|
3390
|
+
}, qo = (n) => {
|
|
3391
|
+
for (let e = 0; e < At.length; e++) {
|
|
3392
|
+
const s = At[e];
|
|
3393
|
+
n === s && At.splice(e, 1);
|
|
3394
|
+
}
|
|
3395
|
+
};
|
|
3396
|
+
class Rs extends at {
|
|
3397
|
+
constructor(e) {
|
|
3398
|
+
super(e, "close");
|
|
3399
|
+
}
|
|
3400
|
+
}
|
|
3401
|
+
const $o = (n) => {
|
|
3402
|
+
hr((e) => {
|
|
3403
|
+
if (n) {
|
|
3404
|
+
n.sendByBeacon();
|
|
3405
|
+
const s = Ot(n, "close").getEventLog();
|
|
3406
|
+
n.addToLegancyLog(s);
|
|
3407
|
+
}
|
|
3408
|
+
});
|
|
3409
|
+
}, Jo = () => {
|
|
3410
|
+
Rs.startApaasTrackHook = (n) => {
|
|
3411
|
+
$o(n);
|
|
3412
|
+
}, Bt.registerEvent("close", Rs);
|
|
3413
|
+
};
|
|
3414
|
+
class Ds extends at {
|
|
3415
|
+
constructor(e) {
|
|
3416
|
+
super(e, "entermain"), b(this, "groupid", ""), b(this, "localtime", ""), b(this, "cheatinfo", {});
|
|
3417
|
+
}
|
|
3418
|
+
getProperties() {
|
|
3419
|
+
return {
|
|
3420
|
+
groupid: this.groupid,
|
|
3421
|
+
localtime: this.localtime,
|
|
3422
|
+
cheatinfo: this.cheatinfo
|
|
3423
|
+
};
|
|
3424
|
+
}
|
|
3425
|
+
setProperties(e) {
|
|
3426
|
+
this.groupid = e.groupid, this.localtime = Date.now().toString();
|
|
3427
|
+
}
|
|
3428
|
+
}
|
|
3429
|
+
const Go = () => {
|
|
3430
|
+
Ds.initApaasTrackHook = (n) => {
|
|
3431
|
+
n.executeEnterMainEvent = () => {
|
|
3432
|
+
const e = Ot(n, "entermain");
|
|
3433
|
+
e.setProperties({
|
|
3434
|
+
groupid: n.groupid
|
|
3435
|
+
}), n.addLogByEvent(e);
|
|
3436
|
+
};
|
|
3437
|
+
}, hn.registerEvent("entermain", Ds);
|
|
3438
|
+
}, Xo = (n, e = {}) => {
|
|
3439
|
+
Yt(e) || (e = {});
|
|
3440
|
+
let s = n ? n.split("?") : [];
|
|
3441
|
+
if (s.shift(), s.length > 0) {
|
|
3442
|
+
s = s.join("?").split("&");
|
|
3443
|
+
for (const r of s) {
|
|
3444
|
+
const i = r.split("=");
|
|
3445
|
+
try {
|
|
3446
|
+
e[i[0]] = decodeURIComponent(i[1]);
|
|
3447
|
+
} catch {
|
|
3448
|
+
e[i[0]] = i[1];
|
|
3449
|
+
}
|
|
3450
|
+
}
|
|
3451
|
+
}
|
|
3452
|
+
return e;
|
|
3453
|
+
}, Ie = (n, e) => {
|
|
3454
|
+
let s = "";
|
|
3455
|
+
switch (n) {
|
|
3456
|
+
case "":
|
|
3457
|
+
case "text":
|
|
3458
|
+
case "json":
|
|
3459
|
+
if (Je(e))
|
|
3460
|
+
try {
|
|
3461
|
+
s = JSON.parse(e), s = vs(s, {
|
|
3462
|
+
maxDepth: 10,
|
|
3463
|
+
keyMaxLen: 1e4,
|
|
3464
|
+
pretty: !0,
|
|
3465
|
+
standardJSON: !0
|
|
3466
|
+
});
|
|
3467
|
+
} catch {
|
|
3468
|
+
s = Qs(String(e), 1e4);
|
|
3469
|
+
}
|
|
3470
|
+
else
|
|
3471
|
+
Yt(e) || Et(e) ? s = vs(e, {
|
|
3472
|
+
maxDepth: 10,
|
|
3473
|
+
keyMaxLen: 1e4,
|
|
3474
|
+
pretty: !0,
|
|
3475
|
+
standardJSON: !0
|
|
3476
|
+
}) : typeof e < "u" && (s = Object.prototype.toString.call(e));
|
|
3477
|
+
break;
|
|
3478
|
+
case "blob":
|
|
3479
|
+
case "document":
|
|
3480
|
+
case "arraybuffer":
|
|
3481
|
+
case "formdata":
|
|
3482
|
+
default:
|
|
3483
|
+
typeof e < "u" && (s = Object.prototype.toString.call(e));
|
|
3484
|
+
break;
|
|
3485
|
+
}
|
|
3486
|
+
return s;
|
|
3487
|
+
}, lr = (n) => {
|
|
3488
|
+
if (!n)
|
|
3489
|
+
return null;
|
|
3490
|
+
let e = null;
|
|
3491
|
+
if (typeof n == "string")
|
|
3492
|
+
try {
|
|
3493
|
+
e = JSON.parse(n);
|
|
3494
|
+
} catch {
|
|
3495
|
+
const s = n.split("&");
|
|
3496
|
+
if (s.length === 1)
|
|
3497
|
+
e = n;
|
|
3498
|
+
else {
|
|
3499
|
+
e = {};
|
|
3500
|
+
for (let r of s) {
|
|
3501
|
+
const i = r.split("=");
|
|
3502
|
+
e[i[0]] = i[1] === void 0 ? "undefined" : i[1];
|
|
3503
|
+
}
|
|
3504
|
+
}
|
|
3505
|
+
}
|
|
3506
|
+
else if (Vr(n))
|
|
3507
|
+
if (e = {}, Et(n) && Gs(n[0]))
|
|
3508
|
+
e = n;
|
|
3509
|
+
else
|
|
3510
|
+
for (const [s, r] of n)
|
|
3511
|
+
e[s] = typeof r == "string" ? r : "[object Object]";
|
|
3512
|
+
else
|
|
3513
|
+
Zr(n) ? e = n : e = `[object ${Kr(n)}]`;
|
|
3514
|
+
return e;
|
|
3515
|
+
}, As = (n = "") => (n.startsWith("//") && (n = `${new URL(window.location.href).protocol}${n}`), n.startsWith("http") ? new URL(n) : new URL(n, window.location.href));
|
|
3516
|
+
class pr {
|
|
3517
|
+
constructor() {
|
|
3518
|
+
b(this, "id", ""), b(this, "name", ""), b(this, "method", ""), b(this, "url", ""), b(this, "status", 0), b(this, "statusText", ""), b(this, "cancelState", 0), b(this, "readyState", 0), b(this, "header", null), b(this, "responseType", ""), b(this, "requestType", "xhr"), b(this, "requestHeader", null), b(this, "response"), b(this, "responseSize", 0), b(this, "responseSizeText", ""), b(this, "startTime", 0), b(this, "startTimeText", ""), b(this, "endTime", 0), b(this, "costTime", 0), b(this, "getData", null), b(this, "postData", null), b(this, "postLength", 0), b(this, "actived", !1), b(this, "noVConsole", !1), b(this, "_XMLReq", null), this.id = be();
|
|
3519
|
+
}
|
|
3520
|
+
}
|
|
3521
|
+
class Wo {
|
|
3522
|
+
constructor(e, s, r) {
|
|
3523
|
+
b(this, "resp"), b(this, "item"), b(this, "onUpdateCallback"), this.resp = e, this.item = s, this.onUpdateCallback = r, this.mockReader();
|
|
3524
|
+
}
|
|
3525
|
+
set(e, s, r) {
|
|
3526
|
+
return Reflect.set(e, s, r);
|
|
3527
|
+
}
|
|
3528
|
+
get(e, s) {
|
|
3529
|
+
const r = Reflect.get(e, s);
|
|
3530
|
+
switch (s) {
|
|
3531
|
+
case "arrayBuffer":
|
|
3532
|
+
case "blob":
|
|
3533
|
+
case "formData":
|
|
3534
|
+
case "json":
|
|
3535
|
+
case "text":
|
|
3536
|
+
return () => (this.item.responseType = s.toLowerCase(), r.apply(e).then((i) => (this.item.response = Ie(
|
|
3537
|
+
this.item.responseType,
|
|
3538
|
+
i
|
|
3539
|
+
), this.onUpdateCallback(this.item), i)));
|
|
3540
|
+
}
|
|
3541
|
+
return typeof r == "function" ? r.bind(e) : r;
|
|
3542
|
+
}
|
|
3543
|
+
mockReader() {
|
|
3544
|
+
let e;
|
|
3545
|
+
if (!this.resp.body || typeof this.resp.body.getReader != "function")
|
|
3546
|
+
return;
|
|
3547
|
+
const s = this.resp.body.getReader;
|
|
3548
|
+
this.resp.body.getReader = () => {
|
|
3549
|
+
const r = s.apply(this.resp.body);
|
|
3550
|
+
if (this.item.readyState === 4)
|
|
3551
|
+
return r;
|
|
3552
|
+
const i = r.read, a = r.cancel;
|
|
3553
|
+
return this.item.responseType = "arraybuffer", r.read = () => i.apply(r).then(
|
|
3554
|
+
(u) => {
|
|
3555
|
+
if (!e)
|
|
3556
|
+
e = new Uint8Array(u.value);
|
|
3557
|
+
else {
|
|
3558
|
+
const l = new Uint8Array(
|
|
3559
|
+
e.length + u.value.length
|
|
3560
|
+
);
|
|
3561
|
+
l.set(e), l.set(
|
|
3562
|
+
u.value,
|
|
3563
|
+
e.length
|
|
3564
|
+
), e = l;
|
|
3565
|
+
}
|
|
3566
|
+
return this.item.endTime = Date.now(), this.item.costTime = this.item.endTime - (this.item.startTime || this.item.endTime), this.item.readyState = u.done ? 4 : 3, this.item.statusText = u.done ? String(this.item.status) : "Loading", this.item.responseSize = e.length, this.item.responseSizeText = je(
|
|
3567
|
+
this.item.responseSize
|
|
3568
|
+
), u.done && (this.item.response = Ie(
|
|
3569
|
+
this.item.responseType,
|
|
3570
|
+
e
|
|
3571
|
+
)), this.onUpdateCallback(this.item), u;
|
|
3572
|
+
}
|
|
3573
|
+
), r.cancel = (...u) => (this.item.cancelState = 2, this.item.statusText = "Cancel", this.item.endTime = Date.now(), this.item.costTime = this.item.endTime - (this.item.startTime || this.item.endTime), this.item.response = Ie(
|
|
3574
|
+
this.item.responseType,
|
|
3575
|
+
e
|
|
3576
|
+
), this.onUpdateCallback(this.item), a.apply(r, u)), r;
|
|
3577
|
+
};
|
|
3578
|
+
}
|
|
3579
|
+
}
|
|
3580
|
+
class Qo {
|
|
3581
|
+
constructor(e) {
|
|
3582
|
+
b(this, "onUpdateCallback"), this.onUpdateCallback = e;
|
|
3583
|
+
}
|
|
3584
|
+
apply(e, s, r) {
|
|
3585
|
+
const i = r[0], a = r[1], u = new pr();
|
|
3586
|
+
return this.beforeFetch(u, i, a), e.apply(window, r).then(this.afterFetch(u)).catch((l) => {
|
|
3587
|
+
throw u.endTime = Date.now(), u.costTime = u.endTime - (u.startTime || u.endTime), this.onUpdateCallback(u), l;
|
|
3588
|
+
});
|
|
3589
|
+
}
|
|
3590
|
+
beforeFetch(e, s, r) {
|
|
3591
|
+
let i, a = "GET", u = null;
|
|
3592
|
+
if (Je(s) ? (a = (r == null ? void 0 : r.method) || "GET", i = As(s), u = (r == null ? void 0 : r.headers) || null) : (a = s.method || "GET", i = As(s.url), u = s.headers), e.method = a, e.requestType = "fetch", e.requestHeader = u, e.url = i.toString(), e.name = (i.pathname.split("/").pop() || "") + i.search, e.status = 0, e.statusText = "Pending", e.readyState = 1, !e.startTime) {
|
|
3593
|
+
e.startTime = Date.now();
|
|
3594
|
+
const l = Js(e.startTime);
|
|
3595
|
+
e.startTimeText = `${l.year}-${l.month}-${l.day} ${l.hour}:${l.minute}:${l.second}.${l.millisecond}`;
|
|
3596
|
+
}
|
|
3597
|
+
if (Object.prototype.toString.call(u) === "[object Headers]") {
|
|
3598
|
+
e.requestHeader = {};
|
|
3599
|
+
for (const [l, w] of u)
|
|
3600
|
+
e.requestHeader[l] = w;
|
|
3601
|
+
} else
|
|
3602
|
+
e.requestHeader = u;
|
|
3603
|
+
if (i.search && i.searchParams) {
|
|
3604
|
+
e.getData = {};
|
|
3605
|
+
for (const [l, w] of i.searchParams)
|
|
3606
|
+
e.getData[l] = w;
|
|
3607
|
+
}
|
|
3608
|
+
r != null && r.body && (e.postData = lr(r.body)), this.onUpdateCallback(e);
|
|
3609
|
+
}
|
|
3610
|
+
afterFetch(e) {
|
|
3611
|
+
return (s) => {
|
|
3612
|
+
e.endTime = Date.now(), e.costTime = e.endTime - (e.startTime || e.endTime), e.status = s.status, e.statusText = String(s.status);
|
|
3613
|
+
let r = !1;
|
|
3614
|
+
e.header = {};
|
|
3615
|
+
for (const [i, a] of s.headers)
|
|
3616
|
+
e.header[i] = a, r = a.toLowerCase().indexOf("chunked") > -1 ? !0 : r;
|
|
3617
|
+
return r ? e.readyState = 3 : (e.readyState = 4, this.handleResponseBody(s.clone(), e).then(
|
|
3618
|
+
(i) => {
|
|
3619
|
+
e.responseSize = typeof i == "string" ? i.length : i.byteLength, e.responseSizeText = je(e.responseSize), e.response = Ie(
|
|
3620
|
+
e.responseType,
|
|
3621
|
+
i
|
|
3622
|
+
), this.onUpdateCallback(e);
|
|
3623
|
+
}
|
|
3624
|
+
)), this.onUpdateCallback(e), new Proxy(
|
|
3625
|
+
s,
|
|
3626
|
+
new Wo(s, e, this.onUpdateCallback)
|
|
3627
|
+
);
|
|
3628
|
+
};
|
|
3629
|
+
}
|
|
3630
|
+
handleResponseBody(e, s) {
|
|
3631
|
+
const r = e.headers.get("content-type");
|
|
3632
|
+
return r && r.includes("application/json") ? (s.responseType = "json", e.text()) : r && (r.includes("text/html") || r.includes("text/plain")) ? (s.responseType = "text", e.text()) : (s.responseType = "arraybuffer", e.arrayBuffer());
|
|
3633
|
+
}
|
|
3634
|
+
}
|
|
3635
|
+
class dr {
|
|
3636
|
+
static create(e) {
|
|
3637
|
+
return new Proxy(window.fetch, new Qo(e));
|
|
3638
|
+
}
|
|
3639
|
+
}
|
|
3640
|
+
b(dr, "origFetch", window.fetch);
|
|
3641
|
+
class Vo {
|
|
3642
|
+
constructor(e, s) {
|
|
3643
|
+
b(this, "XMLReq"), b(this, "item"), b(this, "onUpdateCallback"), this.XMLReq = e, this.XMLReq.onreadystatechange = () => {
|
|
3644
|
+
this.onReadyStateChange();
|
|
3645
|
+
}, this.XMLReq.onabort = () => {
|
|
3646
|
+
this.onAbort();
|
|
3647
|
+
}, this.XMLReq.ontimeout = () => {
|
|
3648
|
+
this.onTimeout();
|
|
3649
|
+
}, this.item = new pr(), this.item._XMLReq = e, this.item.requestType = "xhr", this.onUpdateCallback = s;
|
|
3650
|
+
}
|
|
3651
|
+
get(e, s) {
|
|
3652
|
+
switch (s) {
|
|
3653
|
+
case "_noVConsole":
|
|
3654
|
+
return this.item.noVConsole;
|
|
3655
|
+
case "open":
|
|
3656
|
+
return this.getOpen(e);
|
|
3657
|
+
case "send":
|
|
3658
|
+
return this.getSend(e);
|
|
3659
|
+
case "setRequestHeader":
|
|
3660
|
+
return this.getSetRequestHeader(e);
|
|
3661
|
+
default:
|
|
3662
|
+
const r = Reflect.get(e, s);
|
|
3663
|
+
return typeof r == "function" ? r.bind(e) : r;
|
|
3664
|
+
}
|
|
3665
|
+
}
|
|
3666
|
+
set(e, s, r) {
|
|
3667
|
+
switch (s) {
|
|
3668
|
+
case "_noVConsole":
|
|
3669
|
+
return this.item.noVConsole = !!r, !1;
|
|
3670
|
+
case "onreadystatechange":
|
|
3671
|
+
return this.setOnReadyStateChange(e, s, r);
|
|
3672
|
+
case "onabort":
|
|
3673
|
+
return this.setOnAbort(e, s, r);
|
|
3674
|
+
case "ontimeout":
|
|
3675
|
+
return this.setOnTimeout(e, s, r);
|
|
3676
|
+
}
|
|
3677
|
+
return Reflect.set(e, s, r);
|
|
3678
|
+
}
|
|
3679
|
+
onReadyStateChange() {
|
|
3680
|
+
this.item.readyState = this.XMLReq.readyState, this.item.responseType = this.XMLReq.responseType, this.item.endTime = Date.now(), this.item.costTime = this.item.endTime - this.item.startTime, this.updateItemByReadyState(), this.item.response = Ie(
|
|
3681
|
+
this.item.responseType,
|
|
3682
|
+
this.item.response
|
|
3683
|
+
), this.triggerUpdate();
|
|
3684
|
+
}
|
|
3685
|
+
onAbort() {
|
|
3686
|
+
this.item.cancelState = 1, this.item.statusText = "Abort", this.triggerUpdate();
|
|
3687
|
+
}
|
|
3688
|
+
onTimeout() {
|
|
3689
|
+
this.item.cancelState = 3, this.item.statusText = "Timeout", this.triggerUpdate();
|
|
3690
|
+
}
|
|
3691
|
+
triggerUpdate() {
|
|
3692
|
+
this.item.noVConsole || this.onUpdateCallback(this.item);
|
|
3693
|
+
}
|
|
3694
|
+
getOpen(e) {
|
|
3695
|
+
const s = Reflect.get(e, "open");
|
|
3696
|
+
return (...r) => {
|
|
3697
|
+
const i = r[0], a = r[1];
|
|
3698
|
+
return this.item.method = i ? i.toUpperCase() : "GET", this.item.url = a || "", this.item.name = this.item.url.replace(new RegExp("[/]*$"), "").split("/").pop() || "", this.item.getData = Xo(this.item.url, {}), this.triggerUpdate(), s.apply(e, r);
|
|
3699
|
+
};
|
|
3700
|
+
}
|
|
3701
|
+
getSend(e) {
|
|
3702
|
+
const s = Reflect.get(e, "send");
|
|
3703
|
+
return (...r) => {
|
|
3704
|
+
const i = r[0];
|
|
3705
|
+
return i && Object.prototype.hasOwnProperty.call(i, "length") && (this.item.postLength = i.length), this.item.postData = lr(i), this.triggerUpdate(), s.apply(e, r);
|
|
3706
|
+
};
|
|
3707
|
+
}
|
|
3708
|
+
getSetRequestHeader(e) {
|
|
3709
|
+
const s = Reflect.get(e, "setRequestHeader");
|
|
3710
|
+
return (...r) => (this.item.requestHeader || (this.item.requestHeader = {}), this.item.requestHeader[r[0]] = r[1], this.triggerUpdate(), s.apply(e, r));
|
|
3711
|
+
}
|
|
3712
|
+
setOnReadyStateChange(e, s, r) {
|
|
3713
|
+
return Reflect.set(e, s, (...i) => {
|
|
3714
|
+
this.onReadyStateChange(), r.apply(e, i);
|
|
3715
|
+
});
|
|
3716
|
+
}
|
|
3717
|
+
setOnAbort(e, s, r) {
|
|
3718
|
+
return Reflect.set(e, s, (...i) => {
|
|
3719
|
+
this.onAbort(), r.apply(e, i);
|
|
3720
|
+
});
|
|
3721
|
+
}
|
|
3722
|
+
setOnTimeout(e, s, r) {
|
|
3723
|
+
return Reflect.set(e, s, (...i) => {
|
|
3724
|
+
this.onTimeout(), r.apply(e, i);
|
|
3725
|
+
});
|
|
3726
|
+
}
|
|
3727
|
+
updateItemByReadyState() {
|
|
3728
|
+
switch (this.XMLReq.readyState) {
|
|
3729
|
+
case 0:
|
|
3730
|
+
case 1:
|
|
3731
|
+
if (this.item.status = 0, this.item.statusText = "Pending", !this.item.startTime) {
|
|
3732
|
+
this.item.startTime = Date.now();
|
|
3733
|
+
const r = Js(this.item.startTime);
|
|
3734
|
+
this.item.startTimeText = `${r.year}-${r.month}-${r.day} ${r.hour}:${r.minute}:${r.second}.${r.millisecond}`;
|
|
3735
|
+
}
|
|
3736
|
+
break;
|
|
3737
|
+
case 2:
|
|
3738
|
+
this.item.status = this.XMLReq.status, this.item.statusText = "Loading", this.item.header = {};
|
|
3739
|
+
const e = this.XMLReq.getAllResponseHeaders() || "", s = e.split(`
|
|
3740
|
+
`);
|
|
3741
|
+
for (let r = 0; r < s.length; r++) {
|
|
3742
|
+
const i = s[r];
|
|
3743
|
+
if (!i)
|
|
3744
|
+
continue;
|
|
3745
|
+
const a = i.split(": "), u = a[0], l = a.slice(1).join(": ");
|
|
3746
|
+
this.item.header[u] = l;
|
|
3747
|
+
}
|
|
3748
|
+
break;
|
|
3749
|
+
case 3:
|
|
3750
|
+
this.item.status = this.XMLReq.status, this.item.statusText = "Loading", !!this.XMLReq.response && this.XMLReq.response.length && (this.item.responseSize = this.XMLReq.response.length, this.item.responseSizeText = je(
|
|
3751
|
+
this.item.responseSize
|
|
3752
|
+
));
|
|
3753
|
+
break;
|
|
3754
|
+
case 4:
|
|
3755
|
+
this.item.status = this.XMLReq.status || this.item.status || 0, this.item.statusText = String(this.item.status), this.item.endTime = Date.now(), this.item.costTime = this.item.endTime - (this.item.startTime || this.item.endTime), this.item.response = this.XMLReq.response, !!this.XMLReq.response && this.XMLReq.response.length && (this.item.responseSize = this.XMLReq.response.length, this.item.responseSizeText = je(
|
|
3756
|
+
this.item.responseSize
|
|
3757
|
+
));
|
|
3758
|
+
break;
|
|
3759
|
+
default:
|
|
3760
|
+
this.item.status = this.XMLReq.status, this.item.statusText = "Unknown";
|
|
3761
|
+
break;
|
|
3762
|
+
}
|
|
3763
|
+
}
|
|
3764
|
+
}
|
|
3765
|
+
class mr {
|
|
3766
|
+
static create(e) {
|
|
3767
|
+
return new Proxy(XMLHttpRequest, {
|
|
3768
|
+
construct(s) {
|
|
3769
|
+
const r = new s();
|
|
3770
|
+
return new Proxy(
|
|
3771
|
+
r,
|
|
3772
|
+
new Vo(r, e)
|
|
3773
|
+
);
|
|
3774
|
+
}
|
|
3775
|
+
});
|
|
3776
|
+
}
|
|
3777
|
+
}
|
|
3778
|
+
b(mr, "origXMLHttpRequest", XMLHttpRequest);
|
|
3779
|
+
class rn extends at {
|
|
3780
|
+
constructor(e) {
|
|
3781
|
+
super(e, "http"), b(this, "url", ""), b(this, "method", ""), b(this, "startTime", 0), b(this, "endTime", 0), b(this, "requestContentLength", 0), b(this, "responseContentLength", 0), b(this, "statusCode", 0), b(this, "headers", {}), b(this, "trackOptions", {
|
|
3782
|
+
trackHeaders: !0
|
|
3783
|
+
});
|
|
3784
|
+
}
|
|
3785
|
+
setTrackOptions(e) {
|
|
3786
|
+
this.trackOptions = e;
|
|
3787
|
+
}
|
|
3788
|
+
getProperties() {
|
|
3789
|
+
return {
|
|
3790
|
+
url: this.url,
|
|
3791
|
+
method: this.method,
|
|
3792
|
+
header: this.trackOptions.trackHeaders ? this.headers : void 0,
|
|
3793
|
+
code: this.statusCode,
|
|
3794
|
+
duration: (this.endTime - this.startTime) * 1e6,
|
|
3795
|
+
reqcontentlength: this.requestContentLength,
|
|
3796
|
+
respcontentlength: this.responseContentLength,
|
|
3797
|
+
start: this.startTime * 1e6,
|
|
3798
|
+
end: this.endTime * 1e6
|
|
3799
|
+
};
|
|
3800
|
+
}
|
|
3801
|
+
start(e, s, r, i) {
|
|
3802
|
+
this.startTime = Date.now(), this.url = e, this.method = s, this.headers = i, this.requestContentLength = r;
|
|
3803
|
+
}
|
|
3804
|
+
end(e, s) {
|
|
3805
|
+
this.endTime = Date.now(), this.responseContentLength = e, this.statusCode = s;
|
|
3806
|
+
}
|
|
3807
|
+
setProperties(e) {
|
|
3808
|
+
this.url = e.url, this.method = e.method, this.startTime = e.startTime, this.endTime = e.endTime, this.requestContentLength = e.requestContentLength, this.responseContentLength = e.responseContentLength, this.statusCode = e.statusCode;
|
|
3809
|
+
let s = e.headers;
|
|
3810
|
+
s && (s = {
|
|
3811
|
+
...s,
|
|
3812
|
+
token: ""
|
|
3813
|
+
}), this.headers = s;
|
|
3814
|
+
}
|
|
3815
|
+
}
|
|
3816
|
+
const Ko = (n, e) => {
|
|
3817
|
+
const s = (r, i) => {
|
|
3818
|
+
if (i.readyState === 4 && i.url !== r.options.url) {
|
|
3819
|
+
const a = new rn(r);
|
|
3820
|
+
a.setTrackOptions(e), a.setProperties({
|
|
3821
|
+
url: i.url,
|
|
3822
|
+
method: i.method,
|
|
3823
|
+
startTime: i.startTime,
|
|
3824
|
+
endTime: i.endTime,
|
|
3825
|
+
requestContentLength: i.postLength,
|
|
3826
|
+
responseContentLength: i.responseSize,
|
|
3827
|
+
statusCode: i.status,
|
|
3828
|
+
headers: i.header || {}
|
|
3829
|
+
}), r.addLogByEvent(a);
|
|
3830
|
+
}
|
|
3831
|
+
};
|
|
3832
|
+
window.XMLHttpRequest = mr.create((r) => {
|
|
3833
|
+
s(n, r);
|
|
3834
|
+
}), window.fetch = dr.create((r) => {
|
|
3835
|
+
s(n, r);
|
|
3836
|
+
});
|
|
3837
|
+
}, Zo = (n) => {
|
|
3838
|
+
n || (n = {
|
|
3839
|
+
trackHeaders: !0
|
|
3840
|
+
}), rn.eventOptions = n, rn.startApaasTrackHook = (e) => {
|
|
3841
|
+
Ko(e, n);
|
|
3842
|
+
}, hn.registerEvent("http", rn);
|
|
3843
|
+
}, kt = (n, e = !1) => {
|
|
3844
|
+
let s = location.href.replace(/#\/.+$/, n);
|
|
3845
|
+
return e && (s = s.replace(/\?\S+$/, "")), s;
|
|
3846
|
+
}, fr = (n, e) => {
|
|
3847
|
+
let s = history.pushState, r = history.replaceState, i = kt(location.hash), a = null;
|
|
3848
|
+
history.pushState = function(...u) {
|
|
3849
|
+
const l = kt(location.hash), w = kt(u[2] || "");
|
|
3850
|
+
return i = w, n && (a = {
|
|
3851
|
+
newURL: w,
|
|
3852
|
+
oldURL: l,
|
|
3853
|
+
type: "push"
|
|
3854
|
+
}, On(() => {
|
|
3855
|
+
a && (e(a), a = null);
|
|
3856
|
+
})), s.apply(this, u);
|
|
3857
|
+
}, history.replaceState = function(...u) {
|
|
3858
|
+
if (n) {
|
|
3859
|
+
const l = kt(location.hash), w = kt(u[2] || "");
|
|
3860
|
+
a = {
|
|
3861
|
+
newURL: w,
|
|
3862
|
+
oldURL: l,
|
|
3863
|
+
type: "replace"
|
|
3864
|
+
}, i = w, On(() => {
|
|
3865
|
+
if (a && a.oldURL === l && a.newURL === w) {
|
|
3866
|
+
let p = kt(location.hash);
|
|
3867
|
+
l === w ? w !== p ? (a.newURL = p, a.type = "push") : a.type = "onload" : a.type = "replace", e(a), a = null;
|
|
3868
|
+
}
|
|
3869
|
+
});
|
|
3870
|
+
}
|
|
3871
|
+
return r.apply(this, u);
|
|
3872
|
+
}, window.addEventListener("popstate", (u) => {
|
|
3873
|
+
if (n) {
|
|
3874
|
+
const l = kt(location.hash);
|
|
3875
|
+
u.state && (a = {
|
|
3876
|
+
newURL: l,
|
|
3877
|
+
oldURL: i,
|
|
3878
|
+
type: u.state.forward ? "back" : "forward"
|
|
3879
|
+
}, i = l, e(a), a = null);
|
|
3880
|
+
}
|
|
3881
|
+
});
|
|
3882
|
+
};
|
|
3883
|
+
var Yo = function(n, e) {
|
|
3884
|
+
e === !0 && (e = 0);
|
|
3885
|
+
var s = "";
|
|
3886
|
+
if (typeof n == "string")
|
|
3887
|
+
try {
|
|
3888
|
+
s = new URL(n).protocol;
|
|
3889
|
+
} catch {
|
|
3890
|
+
}
|
|
3891
|
+
else
|
|
3892
|
+
n && n.constructor === URL && (s = n.protocol);
|
|
3893
|
+
var r = s.split(/\:|\+/).filter(Boolean);
|
|
3894
|
+
return typeof e == "number" ? r[e] : r;
|
|
3895
|
+
}, tc = Yo;
|
|
3896
|
+
function ec(n) {
|
|
3897
|
+
var e = {
|
|
3898
|
+
protocols: [],
|
|
3899
|
+
protocol: null,
|
|
3900
|
+
port: null,
|
|
3901
|
+
resource: "",
|
|
3902
|
+
host: "",
|
|
3903
|
+
user: "",
|
|
3904
|
+
password: "",
|
|
3905
|
+
pathname: "",
|
|
3906
|
+
hash: "",
|
|
3907
|
+
search: "",
|
|
3908
|
+
href: n,
|
|
3909
|
+
query: {},
|
|
3910
|
+
parse_failed: !1
|
|
3911
|
+
};
|
|
3912
|
+
try {
|
|
3913
|
+
var s = new URL(n);
|
|
3914
|
+
e.protocols = tc(s), e.protocol = e.protocols[0], e.port = s.port, e.resource = s.hostname, e.host = s.host, e.user = s.username || "", e.password = s.password || "", e.pathname = s.pathname, e.hash = s.hash.slice(1), e.search = s.search.slice(1), e.href = s.href, e.query = Object.fromEntries(s.searchParams);
|
|
3915
|
+
} catch {
|
|
3916
|
+
e.protocols = ["file"], e.protocol = e.protocols[0], e.port = "", e.resource = "", e.user = "", e.pathname = "", e.hash = "", e.search = "", e.href = n, e.query = {}, e.parse_failed = !0;
|
|
3917
|
+
}
|
|
3918
|
+
return e;
|
|
3919
|
+
}
|
|
3920
|
+
var nc = ec;
|
|
3921
|
+
const sc = "text/plain", rc = "us-ascii", Os = (n, e) => e.some((s) => s instanceof RegExp ? s.test(n) : s === n), ic = (n, { stripHash: e }) => {
|
|
3922
|
+
const s = /^data:(?<type>[^,]*?),(?<data>[^#]*?)(?:#(?<hash>.*))?$/.exec(n);
|
|
3923
|
+
if (!s)
|
|
3924
|
+
throw new Error(`Invalid URL: ${n}`);
|
|
3925
|
+
let { type: r, data: i, hash: a } = s.groups;
|
|
3926
|
+
const u = r.split(";");
|
|
3927
|
+
a = e ? "" : a;
|
|
3928
|
+
let l = !1;
|
|
3929
|
+
u[u.length - 1] === "base64" && (u.pop(), l = !0);
|
|
3930
|
+
const w = (u.shift() || "").toLowerCase(), p = [
|
|
3931
|
+
...u.map((f) => {
|
|
3932
|
+
let [v, h = ""] = f.split("=").map((_) => _.trim());
|
|
3933
|
+
return v === "charset" && (h = h.toLowerCase(), h === rc) ? "" : `${v}${h ? `=${h}` : ""}`;
|
|
3934
|
+
}).filter(Boolean)
|
|
3935
|
+
];
|
|
3936
|
+
return l && p.push("base64"), (p.length > 0 || w && w !== sc) && p.unshift(w), `data:${p.join(";")},${l ? i.trim() : i}${a ? `#${a}` : ""}`;
|
|
3937
|
+
};
|
|
3938
|
+
function ac(n, e) {
|
|
3939
|
+
if (e = {
|
|
3940
|
+
defaultProtocol: "http:",
|
|
3941
|
+
normalizeProtocol: !0,
|
|
3942
|
+
forceHttp: !1,
|
|
3943
|
+
forceHttps: !1,
|
|
3944
|
+
stripAuthentication: !0,
|
|
3945
|
+
stripHash: !1,
|
|
3946
|
+
stripTextFragment: !0,
|
|
3947
|
+
stripWWW: !0,
|
|
3948
|
+
removeQueryParameters: [/^utm_\w+/i],
|
|
3949
|
+
removeTrailingSlash: !0,
|
|
3950
|
+
removeSingleSlash: !0,
|
|
3951
|
+
removeDirectoryIndex: !1,
|
|
3952
|
+
sortQueryParameters: !0,
|
|
3953
|
+
...e
|
|
3954
|
+
}, n = n.trim(), /^data:/i.test(n))
|
|
3955
|
+
return ic(n, e);
|
|
3956
|
+
if (/^view-source:/i.test(n))
|
|
3957
|
+
throw new Error("`view-source:` is not supported as it is a non-standard protocol");
|
|
3958
|
+
const s = n.startsWith("//");
|
|
3959
|
+
!s && /^\.*\//.test(n) || (n = n.replace(/^(?!(?:\w+:)?\/\/)|^\/\//, e.defaultProtocol));
|
|
3960
|
+
const r = new URL(n);
|
|
3961
|
+
if (e.forceHttp && e.forceHttps)
|
|
3962
|
+
throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");
|
|
3963
|
+
if (e.forceHttp && r.protocol === "https:" && (r.protocol = "http:"), e.forceHttps && r.protocol === "http:" && (r.protocol = "https:"), e.stripAuthentication && (r.username = "", r.password = ""), e.stripHash ? r.hash = "" : e.stripTextFragment && (r.hash = r.hash.replace(/#?:~:text.*?$/i, "")), r.pathname) {
|
|
3964
|
+
const a = /\b[a-z][a-z\d+\-.]{1,50}:\/\//g;
|
|
3965
|
+
let u = 0, l = "";
|
|
3966
|
+
for (; ; ) {
|
|
3967
|
+
const w = a.exec(r.pathname);
|
|
3968
|
+
if (!w)
|
|
3969
|
+
break;
|
|
3970
|
+
const p = w[0], f = w.index;
|
|
3971
|
+
l += r.pathname.slice(u, f).replace(/\/{2,}/g, "/"), l += p, u = f + p.length;
|
|
3972
|
+
}
|
|
3973
|
+
l += r.pathname.slice(u, r.pathname.length).replace(/\/{2,}/g, "/"), r.pathname = l;
|
|
3974
|
+
}
|
|
3975
|
+
if (r.pathname)
|
|
3976
|
+
try {
|
|
3977
|
+
r.pathname = decodeURI(r.pathname);
|
|
3978
|
+
} catch {
|
|
3979
|
+
}
|
|
3980
|
+
if (e.removeDirectoryIndex === !0 && (e.removeDirectoryIndex = [/^index\.[a-z]+$/]), Array.isArray(e.removeDirectoryIndex) && e.removeDirectoryIndex.length > 0) {
|
|
3981
|
+
let a = r.pathname.split("/");
|
|
3982
|
+
const u = a[a.length - 1];
|
|
3983
|
+
Os(u, e.removeDirectoryIndex) && (a = a.slice(0, -1), r.pathname = a.slice(1).join("/") + "/");
|
|
3984
|
+
}
|
|
3985
|
+
if (r.hostname && (r.hostname = r.hostname.replace(/\.$/, ""), e.stripWWW && /^www\.(?!www\.)[a-z\-\d]{1,63}\.[a-z.\-\d]{2,63}$/.test(r.hostname) && (r.hostname = r.hostname.replace(/^www\./, ""))), Array.isArray(e.removeQueryParameters))
|
|
3986
|
+
for (const a of [...r.searchParams.keys()])
|
|
3987
|
+
Os(a, e.removeQueryParameters) && r.searchParams.delete(a);
|
|
3988
|
+
if (e.removeQueryParameters === !0 && (r.search = ""), e.sortQueryParameters) {
|
|
3989
|
+
r.searchParams.sort();
|
|
3990
|
+
try {
|
|
3991
|
+
r.search = decodeURIComponent(r.search);
|
|
3992
|
+
} catch {
|
|
3993
|
+
}
|
|
3994
|
+
}
|
|
3995
|
+
e.removeTrailingSlash && (r.pathname = r.pathname.replace(/\/$/, ""));
|
|
3996
|
+
const i = n;
|
|
3997
|
+
return n = r.toString(), !e.removeSingleSlash && r.pathname === "/" && !i.endsWith("/") && r.hash === "" && (n = n.replace(/\/$/, "")), (e.removeTrailingSlash || r.pathname === "/") && r.hash === "" && e.removeSingleSlash && (n = n.replace(/\/$/, "")), s && !e.normalizeProtocol && (n = n.replace(/^http:\/\//, "//")), e.stripProtocol && (n = n.replace(/^(?:https?:)?\/\//, "")), n;
|
|
3998
|
+
}
|
|
3999
|
+
const $e = (n, e = !1) => {
|
|
4000
|
+
const s = /^(?:([a-z_][a-z0-9_-]{0,31})@|https?:\/\/)([\w\.\-@]+)[\/:]([\~,\.\w,\-,\_,\/]+?(?:\.git|\/)?)$/, r = (a) => {
|
|
4001
|
+
const u = new Error(a);
|
|
4002
|
+
throw u.subject_url = n, u;
|
|
4003
|
+
};
|
|
4004
|
+
(typeof n != "string" || !n.trim()) && r("Invalid url."), n.length > $e.MAX_INPUT_LENGTH && r("Input exceeds maximum length. If needed, change the value of parseUrl.MAX_INPUT_LENGTH."), e && (typeof e != "object" && (e = {
|
|
4005
|
+
stripHash: !1
|
|
4006
|
+
}), n = ac(n, e));
|
|
4007
|
+
const i = nc(n);
|
|
4008
|
+
if (i.parse_failed) {
|
|
4009
|
+
const a = i.href.match(s);
|
|
4010
|
+
a ? (i.protocols = ["ssh"], i.protocol = "ssh", i.resource = a[2], i.host = a[2], i.user = a[1], i.pathname = `/${a[3]}`, i.parse_failed = !1) : r("URL parsing failed.");
|
|
4011
|
+
}
|
|
4012
|
+
return i;
|
|
4013
|
+
};
|
|
4014
|
+
$e.MAX_INPUT_LENGTH = 2048;
|
|
4015
|
+
$e.MAX_INPUT_LENGTH = 2048 * 1024;
|
|
4016
|
+
class _e extends at {
|
|
4017
|
+
constructor(e) {
|
|
4018
|
+
super(e, "online"), b(this, "url", ""), b(this, "duration", 0), b(this, "startTime", 0), b(this, "endTime", 0), b(this, "views", []);
|
|
4019
|
+
}
|
|
4020
|
+
getProperties() {
|
|
4021
|
+
return {
|
|
4022
|
+
url: this.url,
|
|
4023
|
+
duration: this.duration,
|
|
4024
|
+
startTime: this.startTime,
|
|
4025
|
+
endTime: this.endTime
|
|
4026
|
+
};
|
|
4027
|
+
}
|
|
4028
|
+
setProperties(e) {
|
|
4029
|
+
this.duration = e.duration, this.url = e.url, this.startTime = e.startTime, this.endTime = e.endTime, e.views && (this.views = e.views);
|
|
4030
|
+
}
|
|
4031
|
+
}
|
|
4032
|
+
let He = null;
|
|
4033
|
+
const zs = (n, e) => {
|
|
4034
|
+
const s = () => !0;
|
|
4035
|
+
let r = typeof e == "object" && e.collectUrl ? e.collectUrl : s;
|
|
4036
|
+
return (i) => {
|
|
4037
|
+
let a = $e(i.newURL), u = $e(i.oldURL), l = kt(`#${a.hash}`, !0);
|
|
4038
|
+
i.oldURL && kt(`#${u.hash}`, !0), He && (He.stop(), He.destroy(), He = null), r(location) && (He = new oc(n, l));
|
|
4039
|
+
};
|
|
4040
|
+
};
|
|
4041
|
+
class oc {
|
|
4042
|
+
constructor(e, s, r) {
|
|
4043
|
+
b(this, "url", ""), b(this, "duration", 0), b(this, "startTime", 0), b(this, "onlineOptions"), b(this, "apaasTrack"), b(this, "visibleChangeHandler"), b(this, "beforeUnLoadHandler"), b(this, "userActionHandler"), b(this, "onlineTimer", null), b(this, "stopTimeout", null), this.url = s, this.apaasTrack = e, this.onlineOptions = r || {
|
|
4044
|
+
collectUrl: void 0
|
|
4045
|
+
}, this.visibleChangeHandler = (i) => {
|
|
4046
|
+
const a = i.target.visibilityState;
|
|
4047
|
+
this.stopUserActionMonitor(), a === "visible" ? this.start() : this.startUserActionMonitor();
|
|
4048
|
+
}, this.beforeUnLoadHandler = (i) => {
|
|
4049
|
+
if (this.apaasTrack) {
|
|
4050
|
+
const a = Date.now() - this.startTime;
|
|
4051
|
+
this.saveOnlineData(a);
|
|
4052
|
+
const u = this.apaasTrack.getStorageData();
|
|
4053
|
+
if (u.onlineData)
|
|
4054
|
+
for (let l in u.onlineData) {
|
|
4055
|
+
const w = u.onlineData[l], p = new _e(this.apaasTrack);
|
|
4056
|
+
p.setProperties({
|
|
4057
|
+
duration: w.duration,
|
|
4058
|
+
url: l,
|
|
4059
|
+
startTime: w.startTime,
|
|
4060
|
+
endTime: w.lastTime,
|
|
4061
|
+
views: w.views
|
|
4062
|
+
});
|
|
4063
|
+
const f = p.getEventLog();
|
|
4064
|
+
e.addToLegancyLog(f);
|
|
4065
|
+
}
|
|
4066
|
+
this.cleanOnlineData();
|
|
4067
|
+
}
|
|
4068
|
+
}, this.userActionHandler = wo(
|
|
4069
|
+
(i) => {
|
|
4070
|
+
console.log("\u6709\u7528\u6237\u884C\u4E3A"), this.stopUserActionMonitor(), this.start(), this.startUserActionMonitor();
|
|
4071
|
+
},
|
|
4072
|
+
60 * 1e3,
|
|
4073
|
+
{
|
|
4074
|
+
leading: !0,
|
|
4075
|
+
trailing: !1
|
|
4076
|
+
}
|
|
4077
|
+
), hr(this.beforeUnLoadHandler), Uo(this.userActionHandler), this.init();
|
|
4078
|
+
}
|
|
4079
|
+
startUserActionMonitor() {
|
|
4080
|
+
console.log("startUserActionMonitor"), !this.stopTimeout && (this.stopTimeout = window.setTimeout(() => {
|
|
4081
|
+
this.onlineTimer && (console.log("\u65E0\u6548\u64CD\u4F5C\u65F6\u957F\uFF0C\u7528\u6237\u5DF2\u4E0B\u7EBF..."), clearInterval(this.onlineTimer), this.onlineTimer = null, this.saveOnlineData(this.duration), this.sendRecord(!1, this.url));
|
|
4082
|
+
}, 1e3 * 60));
|
|
4083
|
+
}
|
|
4084
|
+
stopUserActionMonitor() {
|
|
4085
|
+
console.log("stopUserActionMonitor"), this.stopTimeout && (clearTimeout(this.stopTimeout), this.stopTimeout = null);
|
|
4086
|
+
}
|
|
4087
|
+
init() {
|
|
4088
|
+
let e = this.apaasTrack.getStorageData();
|
|
4089
|
+
e || (this.apaasTrack.initStorageData(), e = this.apaasTrack.getStorageData()), e.onlineData ? this.cleanOnlineData() : e.onlineData = {}, localStorage.setItem("apaas-track", JSON.stringify(e)), document.addEventListener(
|
|
4090
|
+
"visibilitychange",
|
|
4091
|
+
this.visibleChangeHandler
|
|
4092
|
+
), this.start();
|
|
4093
|
+
const s = window.document.createEvent("MouseEvent");
|
|
4094
|
+
this.userActionHandler(s);
|
|
4095
|
+
}
|
|
4096
|
+
saveOnlineData(e, s) {
|
|
4097
|
+
const r = this.apaasTrack.getStorageData();
|
|
4098
|
+
let i = r.onlineData, a = i[this.url] || (i[this.url] = {
|
|
4099
|
+
duration: 0,
|
|
4100
|
+
lastTime: Date.now()
|
|
4101
|
+
});
|
|
4102
|
+
a.duration = e, a.lastTime = Date.now(), a.startTime = this.startTime, s && (a.views || (a.views = []), a.views.push({
|
|
4103
|
+
name: s.name,
|
|
4104
|
+
duration: s.duration
|
|
4105
|
+
})), r.onlineData[this.url] = a, localStorage.setItem("apaas-track", JSON.stringify(r));
|
|
4106
|
+
}
|
|
4107
|
+
getStorageOnlineData() {
|
|
4108
|
+
return this.apaasTrack.getStorageData().onlineData;
|
|
4109
|
+
}
|
|
4110
|
+
cleanOnlineData(e) {
|
|
4111
|
+
const s = this.apaasTrack.getStorageData();
|
|
4112
|
+
!s.onlineData || (e ? delete s.onlineData[e] : s.onlineData = {}, localStorage.setItem("apaas-track", JSON.stringify(s)));
|
|
4113
|
+
}
|
|
4114
|
+
start() {
|
|
4115
|
+
if (this.onlineTimer)
|
|
4116
|
+
return;
|
|
4117
|
+
this.startTime = Date.now(), this.duration = 0;
|
|
4118
|
+
let e = 10 * 1e3;
|
|
4119
|
+
this.onlineTimer = window.setInterval(() => {
|
|
4120
|
+
console.log("onlineTimer---"), this.duration += e, this.saveOnlineData(this.duration);
|
|
4121
|
+
}, e);
|
|
4122
|
+
}
|
|
4123
|
+
stop() {
|
|
4124
|
+
if (this.onlineTimer) {
|
|
4125
|
+
clearInterval(this.onlineTimer), this.onlineTimer = null;
|
|
4126
|
+
const e = Date.now() - this.startTime;
|
|
4127
|
+
this.duration = e, this.saveOnlineData(e), this.sendRecord(!1, this.url);
|
|
4128
|
+
}
|
|
4129
|
+
}
|
|
4130
|
+
destroy() {
|
|
4131
|
+
this.stopUserActionMonitor(), document.removeEventListener(
|
|
4132
|
+
"visibilitychange",
|
|
4133
|
+
this.visibleChangeHandler
|
|
4134
|
+
), this.beforeUnLoadHandler && jo(this.beforeUnLoadHandler), this.userActionHandler && qo(this.userActionHandler);
|
|
4135
|
+
}
|
|
4136
|
+
sendRecord(e = !1, s) {
|
|
4137
|
+
const r = this.getStorageOnlineData();
|
|
4138
|
+
if (r)
|
|
4139
|
+
if (s) {
|
|
4140
|
+
const i = r[s];
|
|
4141
|
+
if (i != null && i.duration) {
|
|
4142
|
+
const a = new _e(this.apaasTrack);
|
|
4143
|
+
a.setProperties({
|
|
4144
|
+
duration: i.duration,
|
|
4145
|
+
url: s,
|
|
4146
|
+
startTime: i.startTime,
|
|
4147
|
+
endTime: i.lastTime,
|
|
4148
|
+
views: i.views
|
|
4149
|
+
}), this.apaasTrack.addLogByEvent(a), e && this.apaasTrack.sendByBeacon();
|
|
4150
|
+
}
|
|
4151
|
+
this.cleanOnlineData(s);
|
|
4152
|
+
} else {
|
|
4153
|
+
for (let i in r) {
|
|
4154
|
+
const a = r[i];
|
|
4155
|
+
if (a.duration) {
|
|
4156
|
+
const u = new _e(this.apaasTrack);
|
|
4157
|
+
u.setProperties({
|
|
4158
|
+
duration: a.duration,
|
|
4159
|
+
url: i,
|
|
4160
|
+
startTime: a.startTime,
|
|
4161
|
+
endTime: a.lastTime,
|
|
4162
|
+
views: a.views
|
|
4163
|
+
}), this.apaasTrack.addLogByEvent(u), e && this.apaasTrack.sendByBeacon();
|
|
4164
|
+
}
|
|
4165
|
+
}
|
|
4166
|
+
this.cleanOnlineData();
|
|
4167
|
+
}
|
|
4168
|
+
this.duration = 0, this.startTime = 0;
|
|
4169
|
+
}
|
|
4170
|
+
}
|
|
4171
|
+
const cc = (n) => {
|
|
4172
|
+
console.log("registerOnlineEvent"), n || (n = {}), _e.eventOptions = n, _e.startApaasTrackHook = (e) => {
|
|
4173
|
+
console.log("registerOnlineEvent startApaasTrackHook");
|
|
4174
|
+
let s = null;
|
|
4175
|
+
fr(e, (a) => {
|
|
4176
|
+
console.log("online listenHistoryChange"), s || (s = zs(e)), s(a);
|
|
4177
|
+
});
|
|
4178
|
+
const r = () => {
|
|
4179
|
+
i && clearTimeout(i), s || (s = zs(e));
|
|
4180
|
+
const a = {
|
|
4181
|
+
newURL: kt(location.hash),
|
|
4182
|
+
oldURL: kt(location.hash),
|
|
4183
|
+
type: "onload"
|
|
4184
|
+
};
|
|
4185
|
+
s(a), window.removeEventListener("load", r);
|
|
4186
|
+
};
|
|
4187
|
+
let i = null;
|
|
4188
|
+
window.self !== window.top && (window.addEventListener("load", r), i = setTimeout(() => {
|
|
4189
|
+
r(), clearTimeout(i);
|
|
4190
|
+
}, 3e3));
|
|
4191
|
+
}, Bt.registerEvent("online", _e);
|
|
4192
|
+
};
|
|
4193
|
+
class Nn extends at {
|
|
4194
|
+
constructor(e) {
|
|
4195
|
+
super(e, "pageview", Vs.HIGH), b(this, "oldURL", ""), b(this, "newURL", ""), b(this, "entertype", "");
|
|
4196
|
+
}
|
|
4197
|
+
getProperties() {
|
|
4198
|
+
return {
|
|
4199
|
+
from: this.oldURL,
|
|
4200
|
+
to: this.newURL,
|
|
4201
|
+
entertype: this.entertype
|
|
4202
|
+
};
|
|
4203
|
+
}
|
|
4204
|
+
setProperties(e) {
|
|
4205
|
+
this.oldURL = e.oldURL, this.newURL = e.newURL, this.entertype = e.type;
|
|
4206
|
+
}
|
|
4207
|
+
}
|
|
4208
|
+
const uc = (n, e) => {
|
|
4209
|
+
const s = new Nn(n);
|
|
4210
|
+
s.setProperties(e);
|
|
4211
|
+
const r = s.getEventLog();
|
|
4212
|
+
n.addLogToQueue(r, !0);
|
|
4213
|
+
}, hc = () => {
|
|
4214
|
+
Nn.startApaasTrackHook = (n) => {
|
|
4215
|
+
fr(n, (e) => {
|
|
4216
|
+
uc(n, e);
|
|
4217
|
+
});
|
|
4218
|
+
}, Bt.registerEvent("pageview", Nn);
|
|
4219
|
+
};
|
|
4220
|
+
var qt, Ne, gr, cn, jn, _r = -1, se = function(n) {
|
|
4221
|
+
addEventListener("pageshow", function(e) {
|
|
4222
|
+
e.persisted && (_r = e.timeStamp, n(e));
|
|
4223
|
+
}, !0);
|
|
4224
|
+
}, Qn = function() {
|
|
4225
|
+
return window.performance && performance.getEntriesByType && performance.getEntriesByType("navigation")[0];
|
|
4226
|
+
}, _n = function() {
|
|
4227
|
+
var n = Qn();
|
|
4228
|
+
return n && n.activationStart || 0;
|
|
4229
|
+
}, mt = function(n, e) {
|
|
4230
|
+
var s = Qn(), r = "navigate";
|
|
4231
|
+
return _r >= 0 ? r = "back-forward-cache" : s && (r = document.prerendering || _n() > 0 ? "prerender" : document.wasDiscarded ? "restore" : s.type.replace(/_/g, "-")), { name: n, value: e === void 0 ? -1 : e, rating: "good", delta: 0, entries: [], id: "v3-".concat(Date.now(), "-").concat(Math.floor(8999999999999 * Math.random()) + 1e12), navigationType: r };
|
|
4232
|
+
}, ke = function(n, e, s) {
|
|
4233
|
+
try {
|
|
4234
|
+
if (PerformanceObserver.supportedEntryTypes.includes(n)) {
|
|
4235
|
+
var r = new PerformanceObserver(function(i) {
|
|
4236
|
+
Promise.resolve().then(function() {
|
|
4237
|
+
e(i.getEntries());
|
|
4238
|
+
});
|
|
4239
|
+
});
|
|
4240
|
+
return r.observe(Object.assign({ type: n, buffered: !0 }, s || {})), r;
|
|
4241
|
+
}
|
|
4242
|
+
} catch {
|
|
4243
|
+
}
|
|
4244
|
+
}, vn = function(n, e) {
|
|
4245
|
+
var s = function r(i) {
|
|
4246
|
+
i.type !== "pagehide" && document.visibilityState !== "hidden" || (n(i), e && (removeEventListener("visibilitychange", r, !0), removeEventListener("pagehide", r, !0)));
|
|
4247
|
+
};
|
|
4248
|
+
addEventListener("visibilitychange", s, !0), addEventListener("pagehide", s, !0);
|
|
4249
|
+
}, ft = function(n, e, s, r) {
|
|
4250
|
+
var i, a;
|
|
4251
|
+
return function(u) {
|
|
4252
|
+
e.value >= 0 && (u || r) && ((a = e.value - (i || 0)) || i === void 0) && (i = e.value, e.delta = a, e.rating = function(l, w) {
|
|
4253
|
+
return l > w[1] ? "poor" : l > w[0] ? "needs-improvement" : "good";
|
|
4254
|
+
}(e.value, s), n(e));
|
|
4255
|
+
};
|
|
4256
|
+
}, Vn = function(n) {
|
|
4257
|
+
requestAnimationFrame(function() {
|
|
4258
|
+
return requestAnimationFrame(function() {
|
|
4259
|
+
return n();
|
|
4260
|
+
});
|
|
4261
|
+
});
|
|
4262
|
+
}, Te = function(n) {
|
|
4263
|
+
document.prerendering ? addEventListener("prerenderingchange", function() {
|
|
4264
|
+
return n();
|
|
4265
|
+
}, !0) : n();
|
|
4266
|
+
}, me = -1, Hs = function() {
|
|
4267
|
+
return document.visibilityState !== "hidden" || document.prerendering ? 1 / 0 : 0;
|
|
4268
|
+
}, un = function(n) {
|
|
4269
|
+
document.visibilityState === "hidden" && me > -1 && (me = n.type === "visibilitychange" ? n.timeStamp : 0, lc());
|
|
4270
|
+
}, Fs = function() {
|
|
4271
|
+
addEventListener("visibilitychange", un, !0), addEventListener("prerenderingchange", un, !0);
|
|
4272
|
+
}, lc = function() {
|
|
4273
|
+
removeEventListener("visibilitychange", un, !0), removeEventListener("prerenderingchange", un, !0);
|
|
4274
|
+
}, Kn = function() {
|
|
4275
|
+
return me < 0 && (me = Hs(), Fs(), se(function() {
|
|
4276
|
+
setTimeout(function() {
|
|
4277
|
+
me = Hs(), Fs();
|
|
4278
|
+
}, 0);
|
|
4279
|
+
})), { get firstHiddenTime() {
|
|
4280
|
+
return me;
|
|
4281
|
+
} };
|
|
4282
|
+
}, vr = function(n, e) {
|
|
4283
|
+
e = e || {}, Te(function() {
|
|
4284
|
+
var s, r = [1800, 3e3], i = Kn(), a = mt("FCP"), u = ke("paint", function(l) {
|
|
4285
|
+
l.forEach(function(w) {
|
|
4286
|
+
w.name === "first-contentful-paint" && (u.disconnect(), w.startTime < i.firstHiddenTime && (a.value = Math.max(w.startTime - _n(), 0), a.entries.push(w), s(!0)));
|
|
4287
|
+
});
|
|
4288
|
+
});
|
|
4289
|
+
u && (s = ft(n, a, r, e.reportAllChanges), se(function(l) {
|
|
4290
|
+
a = mt("FCP"), s = ft(n, a, r, e.reportAllChanges), Vn(function() {
|
|
4291
|
+
a.value = performance.now() - l.timeStamp, s(!0);
|
|
4292
|
+
});
|
|
4293
|
+
}));
|
|
4294
|
+
});
|
|
4295
|
+
}, pc = function(n, e) {
|
|
4296
|
+
e = e || {}, Te(function() {
|
|
4297
|
+
var s, r = [0.1, 0.25], i = mt("CLS"), a = -1, u = 0, l = [], w = function(v) {
|
|
4298
|
+
a > -1 && n(v);
|
|
4299
|
+
}, p = function(v) {
|
|
4300
|
+
v.forEach(function(h) {
|
|
4301
|
+
if (!h.hadRecentInput) {
|
|
4302
|
+
var _ = l[0], y = l[l.length - 1];
|
|
4303
|
+
u && h.startTime - y.startTime < 1e3 && h.startTime - _.startTime < 5e3 ? (u += h.value, l.push(h)) : (u = h.value, l = [h]), u > i.value && (i.value = u, i.entries = l, s());
|
|
4304
|
+
}
|
|
4305
|
+
});
|
|
4306
|
+
}, f = ke("layout-shift", p);
|
|
4307
|
+
f && (s = ft(w, i, r, e.reportAllChanges), vr(function(v) {
|
|
4308
|
+
a = v.value, i.value < 0 && (i.value = 0, s());
|
|
4309
|
+
}), vn(function() {
|
|
4310
|
+
p(f.takeRecords()), s(!0);
|
|
4311
|
+
}), se(function() {
|
|
4312
|
+
u = 0, a = -1, i = mt("CLS", 0), s = ft(w, i, r, e.reportAllChanges), Vn(function() {
|
|
4313
|
+
return s();
|
|
4314
|
+
});
|
|
4315
|
+
}));
|
|
4316
|
+
});
|
|
4317
|
+
}, Fe = { passive: !0, capture: !0 }, dc = new Date(), Is = function(n, e) {
|
|
4318
|
+
qt || (qt = e, Ne = n, gr = new Date(), wr(removeEventListener), br());
|
|
4319
|
+
}, br = function() {
|
|
4320
|
+
if (Ne >= 0 && Ne < gr - dc) {
|
|
4321
|
+
var n = { entryType: "first-input", name: qt.type, target: qt.target, cancelable: qt.cancelable, startTime: qt.timeStamp, processingStart: qt.timeStamp + Ne };
|
|
4322
|
+
cn.forEach(function(e) {
|
|
4323
|
+
e(n);
|
|
4324
|
+
}), cn = [];
|
|
4325
|
+
}
|
|
4326
|
+
}, mc = function(n) {
|
|
4327
|
+
if (n.cancelable) {
|
|
4328
|
+
var e = (n.timeStamp > 1e12 ? new Date() : performance.now()) - n.timeStamp;
|
|
4329
|
+
n.type == "pointerdown" ? function(s, r) {
|
|
4330
|
+
var i = function() {
|
|
4331
|
+
Is(s, r), u();
|
|
4332
|
+
}, a = function() {
|
|
4333
|
+
u();
|
|
4334
|
+
}, u = function() {
|
|
4335
|
+
removeEventListener("pointerup", i, Fe), removeEventListener("pointercancel", a, Fe);
|
|
4336
|
+
};
|
|
4337
|
+
addEventListener("pointerup", i, Fe), addEventListener("pointercancel", a, Fe);
|
|
4338
|
+
}(e, n) : Is(e, n);
|
|
4339
|
+
}
|
|
4340
|
+
}, wr = function(n) {
|
|
4341
|
+
["mousedown", "keydown", "touchstart", "pointerdown"].forEach(function(e) {
|
|
4342
|
+
return n(e, mc, Fe);
|
|
4343
|
+
});
|
|
4344
|
+
}, fc = function(n, e) {
|
|
4345
|
+
e = e || {}, Te(function() {
|
|
4346
|
+
var s, r = [100, 300], i = Kn(), a = mt("FID"), u = function(p) {
|
|
4347
|
+
p.startTime < i.firstHiddenTime && (a.value = p.processingStart - p.startTime, a.entries.push(p), s(!0));
|
|
4348
|
+
}, l = function(p) {
|
|
4349
|
+
p.forEach(u);
|
|
4350
|
+
}, w = ke("first-input", l);
|
|
4351
|
+
s = ft(n, a, r, e.reportAllChanges), w && vn(function() {
|
|
4352
|
+
l(w.takeRecords()), w.disconnect();
|
|
4353
|
+
}, !0), w && se(function() {
|
|
4354
|
+
var p;
|
|
4355
|
+
a = mt("FID"), s = ft(n, a, r, e.reportAllChanges), cn = [], Ne = -1, qt = null, wr(addEventListener), p = u, cn.push(p), br();
|
|
4356
|
+
});
|
|
4357
|
+
});
|
|
4358
|
+
}, yr = 0, Cn = 1 / 0, nn = 0, gc = function(n) {
|
|
4359
|
+
n.forEach(function(e) {
|
|
4360
|
+
e.interactionId && (Cn = Math.min(Cn, e.interactionId), nn = Math.max(nn, e.interactionId), yr = nn ? (nn - Cn) / 7 + 1 : 0);
|
|
4361
|
+
});
|
|
4362
|
+
}, kr = function() {
|
|
4363
|
+
return jn ? yr : performance.interactionCount || 0;
|
|
4364
|
+
}, _c = function() {
|
|
4365
|
+
"interactionCount" in performance || jn || (jn = ke("event", gc, { type: "event", buffered: !0, durationThreshold: 0 }));
|
|
4366
|
+
}, Tr = 0, Ns = function() {
|
|
4367
|
+
return kr() - Tr;
|
|
4368
|
+
}, xt = [], Mn = {}, js = function(n) {
|
|
4369
|
+
var e = xt[xt.length - 1], s = Mn[n.interactionId];
|
|
4370
|
+
if (s || xt.length < 10 || n.duration > e.latency) {
|
|
4371
|
+
if (s)
|
|
4372
|
+
s.entries.push(n), s.latency = Math.max(s.latency, n.duration);
|
|
4373
|
+
else {
|
|
4374
|
+
var r = { id: n.interactionId, latency: n.duration, entries: [n] };
|
|
4375
|
+
Mn[r.id] = r, xt.push(r);
|
|
4376
|
+
}
|
|
4377
|
+
xt.sort(function(i, a) {
|
|
4378
|
+
return a.latency - i.latency;
|
|
4379
|
+
}), xt.splice(10).forEach(function(i) {
|
|
4380
|
+
delete Mn[i.id];
|
|
4381
|
+
});
|
|
4382
|
+
}
|
|
4383
|
+
}, vc = function(n, e) {
|
|
4384
|
+
e = e || {}, Te(function() {
|
|
4385
|
+
var s = [200, 500];
|
|
4386
|
+
_c();
|
|
4387
|
+
var r, i = mt("INP"), a = function(l) {
|
|
4388
|
+
l.forEach(function(f) {
|
|
4389
|
+
f.interactionId && js(f), f.entryType === "first-input" && !xt.some(function(v) {
|
|
4390
|
+
return v.entries.some(function(h) {
|
|
4391
|
+
return f.duration === h.duration && f.startTime === h.startTime;
|
|
4392
|
+
});
|
|
4393
|
+
}) && js(f);
|
|
4394
|
+
});
|
|
4395
|
+
var w, p = (w = Math.min(xt.length - 1, Math.floor(Ns() / 50)), xt[w]);
|
|
4396
|
+
p && p.latency !== i.value && (i.value = p.latency, i.entries = p.entries, r());
|
|
4397
|
+
}, u = ke("event", a, { durationThreshold: e.durationThreshold || 40 });
|
|
4398
|
+
r = ft(n, i, s, e.reportAllChanges), u && (u.observe({ type: "first-input", buffered: !0 }), vn(function() {
|
|
4399
|
+
a(u.takeRecords()), i.value < 0 && Ns() > 0 && (i.value = 0, i.entries = []), r(!0);
|
|
4400
|
+
}), se(function() {
|
|
4401
|
+
xt = [], Tr = kr(), i = mt("INP"), r = ft(n, i, s, e.reportAllChanges);
|
|
4402
|
+
}));
|
|
4403
|
+
});
|
|
4404
|
+
}, Rn = {}, bc = function(n, e) {
|
|
4405
|
+
e = e || {}, Te(function() {
|
|
4406
|
+
var s, r = [2500, 4e3], i = Kn(), a = mt("LCP"), u = function(p) {
|
|
4407
|
+
var f = p[p.length - 1];
|
|
4408
|
+
if (f) {
|
|
4409
|
+
var v = Math.max(f.startTime - _n(), 0);
|
|
4410
|
+
v < i.firstHiddenTime && (a.value = v, a.entries = [f], s());
|
|
4411
|
+
}
|
|
4412
|
+
}, l = ke("largest-contentful-paint", u);
|
|
4413
|
+
if (l) {
|
|
4414
|
+
s = ft(n, a, r, e.reportAllChanges);
|
|
4415
|
+
var w = function() {
|
|
4416
|
+
Rn[a.id] || (u(l.takeRecords()), l.disconnect(), Rn[a.id] = !0, s(!0));
|
|
4417
|
+
};
|
|
4418
|
+
["keydown", "click"].forEach(function(p) {
|
|
4419
|
+
addEventListener(p, w, { once: !0, capture: !0 });
|
|
4420
|
+
}), vn(w, !0), se(function(p) {
|
|
4421
|
+
a = mt("LCP"), s = ft(n, a, r, e.reportAllChanges), Vn(function() {
|
|
4422
|
+
a.value = performance.now() - p.timeStamp, Rn[a.id] = !0, s(!0);
|
|
4423
|
+
});
|
|
4424
|
+
});
|
|
4425
|
+
}
|
|
4426
|
+
});
|
|
4427
|
+
}, wc = function n(e) {
|
|
4428
|
+
document.prerendering ? Te(function() {
|
|
4429
|
+
return n(e);
|
|
4430
|
+
}) : document.readyState !== "complete" ? addEventListener("load", function() {
|
|
4431
|
+
return n(e);
|
|
4432
|
+
}, !0) : setTimeout(e, 0);
|
|
4433
|
+
}, yc = function(n, e) {
|
|
4434
|
+
e = e || {};
|
|
4435
|
+
var s = [800, 1800], r = mt("TTFB"), i = ft(n, r, s, e.reportAllChanges);
|
|
4436
|
+
wc(function() {
|
|
4437
|
+
var a = Qn();
|
|
4438
|
+
if (a) {
|
|
4439
|
+
var u = a.responseStart;
|
|
4440
|
+
if (u <= 0 || u > performance.now())
|
|
4441
|
+
return;
|
|
4442
|
+
r.value = Math.max(u - _n(), 0), r.entries = [a], i(!0), se(function() {
|
|
4443
|
+
r = mt("TTFB", 0), (i = ft(n, r, s, e.reportAllChanges))(!0);
|
|
4444
|
+
});
|
|
4445
|
+
}
|
|
4446
|
+
});
|
|
4447
|
+
};
|
|
4448
|
+
class Un extends at {
|
|
4449
|
+
constructor(e) {
|
|
4450
|
+
super(e, "performance"), b(this, "performanceData", null);
|
|
4451
|
+
}
|
|
4452
|
+
getProperties() {
|
|
4453
|
+
return {
|
|
4454
|
+
...this.performanceData
|
|
4455
|
+
};
|
|
4456
|
+
}
|
|
4457
|
+
setProperties(e) {
|
|
4458
|
+
this.performanceData = e;
|
|
4459
|
+
}
|
|
4460
|
+
track() {
|
|
4461
|
+
return new Promise((e, s) => {
|
|
4462
|
+
let r = {
|
|
4463
|
+
cls: null,
|
|
4464
|
+
lcp: null,
|
|
4465
|
+
ttfb: null,
|
|
4466
|
+
fcp: null,
|
|
4467
|
+
fid: null,
|
|
4468
|
+
inp: null
|
|
4469
|
+
};
|
|
4470
|
+
setTimeout(() => {
|
|
4471
|
+
const a = performance.timing, u = {
|
|
4472
|
+
...r,
|
|
4473
|
+
connectEnd: a.connectEnd,
|
|
4474
|
+
connectStart: a.connectStart,
|
|
4475
|
+
domComplete: a.domComplete,
|
|
4476
|
+
domContentLoadedEventEnd: a.domContentLoadedEventEnd,
|
|
4477
|
+
domContentLoadedEventStart: a.domContentLoadedEventStart,
|
|
4478
|
+
domInteractive: a.domInteractive,
|
|
4479
|
+
domLoading: a.domLoading,
|
|
4480
|
+
domainLookupEnd: a.domainLookupEnd,
|
|
4481
|
+
domainLookupStart: a.domainLookupStart,
|
|
4482
|
+
fetchStart: a.fetchStart,
|
|
4483
|
+
loadEventEnd: a.loadEventEnd,
|
|
4484
|
+
loadEventStart: a.loadEventStart,
|
|
4485
|
+
navigationStart: a.navigationStart,
|
|
4486
|
+
redirectEnd: a.redirectEnd,
|
|
4487
|
+
redirectStart: a.redirectStart,
|
|
4488
|
+
requestStart: a.requestStart,
|
|
4489
|
+
responseEnd: a.responseEnd,
|
|
4490
|
+
responseStart: a.responseStart,
|
|
4491
|
+
secureConnectionStart: a.secureConnectionStart,
|
|
4492
|
+
unloadEventEnd: a.unloadEventEnd,
|
|
4493
|
+
unloadEventStart: a.unloadEventStart
|
|
4494
|
+
};
|
|
4495
|
+
this.setProperties(u), e(u);
|
|
4496
|
+
}, 1e4), bc((a) => {
|
|
4497
|
+
i(a);
|
|
4498
|
+
}), pc((a) => {
|
|
4499
|
+
i(a);
|
|
4500
|
+
}), yc((a) => {
|
|
4501
|
+
i(a);
|
|
4502
|
+
}), vr((a) => {
|
|
4503
|
+
i(a);
|
|
4504
|
+
}), fc((a) => {
|
|
4505
|
+
i(a);
|
|
4506
|
+
}), vc((a) => {
|
|
4507
|
+
i(a);
|
|
4508
|
+
});
|
|
4509
|
+
const i = (a) => {
|
|
4510
|
+
a.name === "FID" ? r.fid = a.value : a.name === "CLS" ? r.cls = a.value : a.name === "FCP" ? r.fcp = a.value : a.name === "TTFB" ? r.ttfb = a.value : a.name === "LCP" ? r.lcp = a.value : a.name === "INP" && (r.inp = a.value);
|
|
4511
|
+
};
|
|
4512
|
+
});
|
|
4513
|
+
}
|
|
4514
|
+
}
|
|
4515
|
+
const kc = async (n) => {
|
|
4516
|
+
const e = new Un(n);
|
|
4517
|
+
await e.track(), n.addLogByEvent(e);
|
|
4518
|
+
}, Tc = () => {
|
|
4519
|
+
Un.startApaasTrackHook = (n) => {
|
|
4520
|
+
kc(n);
|
|
4521
|
+
}, Bt.registerEvent("performance", Un);
|
|
4522
|
+
};
|
|
4523
|
+
class Us extends at {
|
|
4524
|
+
constructor(e) {
|
|
4525
|
+
super(e, "throw"), b(this, "message", ""), b(this, "detailmessage", ""), b(this, "name", ""), b(this, "stack", []), b(this, "cause", {});
|
|
4526
|
+
}
|
|
4527
|
+
getProperties() {
|
|
4528
|
+
return {
|
|
4529
|
+
message: this.message,
|
|
4530
|
+
detailmessage: this.detailmessage,
|
|
4531
|
+
name: this.name,
|
|
4532
|
+
stack: this.stack,
|
|
4533
|
+
cause: this.cause
|
|
4534
|
+
};
|
|
4535
|
+
}
|
|
4536
|
+
setError(e) {
|
|
4537
|
+
const s = $n(e);
|
|
4538
|
+
this.message = s.message, this.detailmessage = s.detail, this.name = s.name, this.stack = s.stack;
|
|
4539
|
+
}
|
|
4540
|
+
}
|
|
4541
|
+
const Sc = (n) => {
|
|
4542
|
+
window.addEventListener("error", (e) => {
|
|
4543
|
+
const s = Ot(n, "throw");
|
|
4544
|
+
s.setError(e.error), n.addLogByEvent(s);
|
|
4545
|
+
}), window.addEventListener("unhandledrejection", (e) => {
|
|
4546
|
+
const s = Ot(n, "throw");
|
|
4547
|
+
s.setError(e.reason), n.addLogByEvent(s);
|
|
4548
|
+
});
|
|
4549
|
+
}, Pc = () => {
|
|
4550
|
+
Us.startApaasTrackHook = (n) => {
|
|
4551
|
+
Sc(n);
|
|
4552
|
+
}, Bt.registerEvent("throw", Us);
|
|
4553
|
+
}, Lc = () => {
|
|
4554
|
+
Tc(), Pc(), Go();
|
|
4555
|
+
}, Ec = (n) => {
|
|
4556
|
+
Lc(), hc(), Jo(), (n == null ? void 0 : n.http) !== !1 && Zo(), n != null && n.click && No(
|
|
4557
|
+
typeof n.click == "object" ? n.click : void 0
|
|
4558
|
+
), n != null && n.online && cc(
|
|
4559
|
+
typeof n.online == "object" ? n.online : void 0
|
|
4560
|
+
);
|
|
4561
|
+
}, xc = (n) => (Ec(n), Bc(n)), Bc = (n) => new Bt(n);
|
|
4562
|
+
class te {
|
|
4563
|
+
constructor(e, s, r) {
|
|
4564
|
+
b(this, "_level", 0), this.apaasTrack = e, this.type = s, r && (this._level = r);
|
|
4565
|
+
}
|
|
4566
|
+
getProperties() {
|
|
4567
|
+
return {};
|
|
4568
|
+
}
|
|
4569
|
+
setProperties(e) {
|
|
4570
|
+
}
|
|
4571
|
+
getEventLog(e) {
|
|
4572
|
+
const s = e || Date.now();
|
|
4573
|
+
return {
|
|
4574
|
+
...this.apaasTrack.baseLog,
|
|
4575
|
+
types: this.type,
|
|
4576
|
+
logtime: String(s),
|
|
4577
|
+
epochnanos: String(s) + "000000",
|
|
4578
|
+
event: this.type,
|
|
4579
|
+
properties: this.getProperties(),
|
|
4580
|
+
url: we()
|
|
4581
|
+
};
|
|
4582
|
+
}
|
|
4583
|
+
}
|
|
4584
|
+
b(te, "eventOptions"), b(te, "initApaasTrackHook"), b(te, "startApaasTrackHook"), b(te, "destroyApaasTrackHook");
|
|
4585
|
+
class Cc extends te {
|
|
4586
|
+
constructor(e) {
|
|
4587
|
+
super(e, "init");
|
|
4588
|
+
}
|
|
4589
|
+
getProperties() {
|
|
4590
|
+
const e = this.apaasTrack.baseLog;
|
|
4591
|
+
return {
|
|
4592
|
+
system: e.system || "",
|
|
4593
|
+
systemver: e.systemver || "",
|
|
4594
|
+
manufacturer: e.manufacturer || "",
|
|
4595
|
+
browser: e.browser || "",
|
|
4596
|
+
browserver: e.browserver || "",
|
|
4597
|
+
terminalid: e.terminalid || "",
|
|
4598
|
+
client: e.client || "",
|
|
4599
|
+
clientver: e.clientver || ""
|
|
4600
|
+
};
|
|
4601
|
+
}
|
|
4602
|
+
}
|
|
4603
|
+
class Mc extends te {
|
|
4604
|
+
constructor(e) {
|
|
4605
|
+
super(e, "custom"), b(this, "info", {});
|
|
4606
|
+
}
|
|
4607
|
+
setCustomType(e) {
|
|
4608
|
+
this.type = e;
|
|
4609
|
+
}
|
|
4610
|
+
getProperties() {
|
|
4611
|
+
return {
|
|
4612
|
+
...this.info
|
|
4613
|
+
};
|
|
4614
|
+
}
|
|
4615
|
+
setProperties(e) {
|
|
4616
|
+
this.info = e;
|
|
4617
|
+
}
|
|
4618
|
+
}
|
|
4619
|
+
const ve = {
|
|
4620
|
+
init: Cc,
|
|
4621
|
+
custom: Mc
|
|
4622
|
+
}, an = (n, e) => {
|
|
4623
|
+
const s = ve[e];
|
|
4624
|
+
return new s(n);
|
|
4625
|
+
}, Rc = (n, e, s) => {
|
|
4626
|
+
const r = s || Date.now(), i = an(n, e);
|
|
4627
|
+
return {
|
|
4628
|
+
...n.baseLog,
|
|
4629
|
+
types: e,
|
|
4630
|
+
logtime: String(r),
|
|
4631
|
+
epochnanos: String(r) + "000000",
|
|
4632
|
+
event: e,
|
|
4633
|
+
properties: i.getProperties(),
|
|
4634
|
+
url: we()
|
|
4635
|
+
};
|
|
4636
|
+
}, qs = (n, e, s) => {
|
|
4637
|
+
const r = s || Date.now();
|
|
4638
|
+
return {
|
|
4639
|
+
...n.baseLog,
|
|
4640
|
+
types: e.type,
|
|
4641
|
+
logtime: String(r),
|
|
4642
|
+
epochnanos: String(r) + "000000",
|
|
4643
|
+
event: e.type,
|
|
4644
|
+
properties: e.getProperties(),
|
|
4645
|
+
url: we()
|
|
4646
|
+
};
|
|
4647
|
+
}, Sr = (n, e) => {
|
|
4648
|
+
if (ve[n])
|
|
4649
|
+
throw Error(`\u8BE5\u4E8B\u4EF6${n} \u5DF2\u5B58\u5728\uFF0C\u6CE8\u518C\u5931\u8D25`);
|
|
4650
|
+
ve[n] = e;
|
|
4651
|
+
};
|
|
4652
|
+
class Dc {
|
|
4653
|
+
constructor(e, s) {
|
|
4654
|
+
b(this, "name", ""), b(this, "time", 0), b(this, "info", {}), e && (this.name = e), s && (this.info = s), this.time = Date.now();
|
|
4655
|
+
}
|
|
4656
|
+
get epochnanos() {
|
|
4657
|
+
return this.time * 1e6;
|
|
4658
|
+
}
|
|
4659
|
+
get attributes() {
|
|
4660
|
+
return this.getAttributes();
|
|
4661
|
+
}
|
|
4662
|
+
getAttributes() {
|
|
4663
|
+
return {};
|
|
4664
|
+
}
|
|
4665
|
+
getJson() {
|
|
4666
|
+
return {
|
|
4667
|
+
name: this.name,
|
|
4668
|
+
epochnanos: this.time * 1e6,
|
|
4669
|
+
attributes: this.getAttributes(),
|
|
4670
|
+
...this.info
|
|
4671
|
+
};
|
|
4672
|
+
}
|
|
4673
|
+
setInfo(e) {
|
|
4674
|
+
this.info = e || {};
|
|
4675
|
+
}
|
|
4676
|
+
}
|
|
4677
|
+
class Ac extends Dc {
|
|
4678
|
+
constructor() {
|
|
4679
|
+
super(...arguments), b(this, "name", "exception"), b(this, "exceptionType", ""), b(this, "exceptionMessage", ""), b(this, "exceptionStackTrace", "");
|
|
4680
|
+
}
|
|
4681
|
+
getAttributes() {
|
|
4682
|
+
return {
|
|
4683
|
+
"exception.type": this.exceptionType,
|
|
4684
|
+
"exception.message": this.exceptionMessage,
|
|
4685
|
+
"exception.stacktrace": this.exceptionStackTrace
|
|
4686
|
+
};
|
|
4687
|
+
}
|
|
4688
|
+
setInfo(e) {
|
|
4689
|
+
this.exceptionMessage = e.exceptionMessage, this.exceptionType = e.exceptionType, this.exceptionStackTrace = e.exceptionStackTrace;
|
|
4690
|
+
}
|
|
4691
|
+
}
|
|
4692
|
+
class Zn extends te {
|
|
4693
|
+
constructor(e, s, r) {
|
|
4694
|
+
super(e, "span"), b(this, "spanid", ""), b(this, "traceid", ""), b(this, "parentspanid", ""), b(this, "name", ""), b(this, "attributes", {}), b(this, "events", []), b(this, "statuscode", "OK"), b(this, "statusmessage", ""), b(this, "startTime", 0), b(this, "endTime", 0), this.name = s, this.traceid = be(), this.spanid = $s(), this.parentspanid = r || "", this.start();
|
|
4695
|
+
}
|
|
4696
|
+
trackLog() {
|
|
4697
|
+
this.apaasTrack.addLogByEvent(this);
|
|
4698
|
+
}
|
|
4699
|
+
createSpanEvent(e, s) {
|
|
4700
|
+
return new Zn(
|
|
4701
|
+
this.apaasTrack,
|
|
4702
|
+
e,
|
|
4703
|
+
s
|
|
4704
|
+
);
|
|
4705
|
+
}
|
|
4706
|
+
setAttribute(e) {
|
|
4707
|
+
const s = e.getAttributes();
|
|
4708
|
+
this.attributes = s;
|
|
4709
|
+
}
|
|
4710
|
+
addEvent(e) {
|
|
4711
|
+
this.events.push(e);
|
|
4712
|
+
}
|
|
4713
|
+
exception(e) {
|
|
4714
|
+
const s = new Ac();
|
|
4715
|
+
let r = "", i = "", a = "";
|
|
4716
|
+
if (e instanceof Error) {
|
|
4717
|
+
const u = $n(e);
|
|
4718
|
+
r = u.detail, i = u.name, a = u.stack.join(",");
|
|
4719
|
+
} else
|
|
4720
|
+
r = e.exceptionMessage, i = e.exceptionType, a = e.exceptionStackTrace;
|
|
4721
|
+
s.setInfo({
|
|
4722
|
+
exceptionMessage: r,
|
|
4723
|
+
exceptionType: i,
|
|
4724
|
+
exceptionStackTrace: a
|
|
4725
|
+
}), this.events.push(s);
|
|
4726
|
+
}
|
|
4727
|
+
start() {
|
|
4728
|
+
this.startTime = Date.now();
|
|
4729
|
+
}
|
|
4730
|
+
end(e, s) {
|
|
4731
|
+
e && (this.statusmessage = e), s && (this.statuscode = s), this.endTime = Date.now();
|
|
4732
|
+
}
|
|
4733
|
+
getProperties() {
|
|
4734
|
+
return {
|
|
4735
|
+
traceid: this.traceid,
|
|
4736
|
+
spanid: this.spanid,
|
|
4737
|
+
parentspanid: this.parentspanid,
|
|
4738
|
+
name: this.name,
|
|
4739
|
+
attributes: this.attributes,
|
|
4740
|
+
events: this.events.map((e) => e.getJson()),
|
|
4741
|
+
statuscode: this.statuscode,
|
|
4742
|
+
statusmessage: this.statusmessage,
|
|
4743
|
+
startepochnanos: this.startTime * 1e6,
|
|
4744
|
+
endepochnanos: this.endTime * 1e6,
|
|
4745
|
+
duration: (this.endTime - this.startTime) * 1e6
|
|
4746
|
+
};
|
|
4747
|
+
}
|
|
4748
|
+
}
|
|
4749
|
+
class Pr {
|
|
4750
|
+
constructor(e) {
|
|
4751
|
+
b(this, "_version", sn), b(this, "commonLog", null), b(this, "browserLog", null), b(this, "options"), this.options = e, typeof window < "u" && (window.__apaasTrackVersion__ = sn), typeof wx < "u" && !window && (wx.__apaasTrackVersion__ = sn), e.commonLog && this.initCommonLog(e.commonLog), this.runEventInitHooks();
|
|
4752
|
+
}
|
|
4753
|
+
registerEvent(e, s) {
|
|
4754
|
+
Sr(e, s), s.initApaasTrackHook && s.initApaasTrackHook(this), s.startApaasTrackHook && s.startApaasTrackHook(this);
|
|
4755
|
+
}
|
|
4756
|
+
get groupid() {
|
|
4757
|
+
var e;
|
|
4758
|
+
return (e = this.browserLog) == null ? void 0 : e.distinctid;
|
|
4759
|
+
}
|
|
4760
|
+
runEventInitHooks() {
|
|
4761
|
+
Object.values(ve).forEach(
|
|
4762
|
+
(e) => {
|
|
4763
|
+
e.initApaasTrackHook && e.initApaasTrackHook(this);
|
|
4764
|
+
}
|
|
4765
|
+
);
|
|
4766
|
+
}
|
|
4767
|
+
runEventStartHooks() {
|
|
4768
|
+
Object.values(ve).forEach(
|
|
4769
|
+
(e) => {
|
|
4770
|
+
e.startApaasTrackHook && e.startApaasTrackHook(this);
|
|
4771
|
+
}
|
|
4772
|
+
);
|
|
4773
|
+
}
|
|
4774
|
+
runEventDestroyHooks() {
|
|
4775
|
+
Object.values(ve).forEach(
|
|
4776
|
+
(e) => {
|
|
4777
|
+
e.destroyApaasTrackHook && e.destroyApaasTrackHook(this);
|
|
4778
|
+
}
|
|
4779
|
+
);
|
|
4780
|
+
}
|
|
4781
|
+
get anonymousid() {
|
|
4782
|
+
var e;
|
|
4783
|
+
return (e = this.browserLog) == null ? void 0 : e.anonymousid;
|
|
4784
|
+
}
|
|
4785
|
+
get distinctid() {
|
|
4786
|
+
var e;
|
|
4787
|
+
return (e = this.browserLog) == null ? void 0 : e.distinctid;
|
|
4788
|
+
}
|
|
4789
|
+
get baseLog() {
|
|
4790
|
+
return {
|
|
4791
|
+
...this.browserLog,
|
|
4792
|
+
...this.commonLog
|
|
4793
|
+
};
|
|
4794
|
+
}
|
|
4795
|
+
initCommonLog(e) {
|
|
4796
|
+
this.commonLog = e;
|
|
4797
|
+
}
|
|
4798
|
+
createEventLog(e, s) {
|
|
4799
|
+
return Rc(this, e, s);
|
|
4800
|
+
}
|
|
4801
|
+
addLogByType(e, s) {
|
|
4802
|
+
const r = this.createEventLog(e, s);
|
|
4803
|
+
this.addLogToQueue(r);
|
|
4804
|
+
}
|
|
4805
|
+
addLogByEvent(e, s) {
|
|
4806
|
+
const r = qs(this, e, s);
|
|
4807
|
+
this.addLogToQueue(r);
|
|
4808
|
+
}
|
|
4809
|
+
createCustomEvent(e) {
|
|
4810
|
+
const s = an(this, "custom");
|
|
4811
|
+
return s.setCustomType(e), s;
|
|
4812
|
+
}
|
|
4813
|
+
createSpanEvent(e, s) {
|
|
4814
|
+
return new Zn(this, e, s);
|
|
4815
|
+
}
|
|
4816
|
+
addLogByCustomEvent(e, s = {}, r) {
|
|
4817
|
+
const i = this.createCustomEvent(e);
|
|
4818
|
+
i.setProperties(s);
|
|
4819
|
+
const a = qs(this, i, r);
|
|
4820
|
+
this.addLogToQueue(a);
|
|
4821
|
+
}
|
|
4822
|
+
executeInitEvent() {
|
|
4823
|
+
const e = an(this, "init");
|
|
4824
|
+
e.setProperties({
|
|
4825
|
+
groupid: this.groupid
|
|
4826
|
+
}), this.addLogByEvent(e);
|
|
4827
|
+
}
|
|
4828
|
+
updateCommonLog(e) {
|
|
4829
|
+
this.commonLog = {
|
|
4830
|
+
...this.commonLog,
|
|
4831
|
+
...e
|
|
4832
|
+
};
|
|
4833
|
+
}
|
|
4834
|
+
trackEvent(e, s = {}, r) {
|
|
4835
|
+
const i = an(this, e);
|
|
4836
|
+
i.setProperties(s), this.addLogByEvent(i, r);
|
|
4837
|
+
}
|
|
4838
|
+
start(...e) {
|
|
4839
|
+
this.executeInitEvent(), this.runEventStartHooks();
|
|
4840
|
+
}
|
|
4841
|
+
destroy() {
|
|
4842
|
+
this.runEventDestroyHooks();
|
|
4843
|
+
}
|
|
4844
|
+
transformLog(e) {
|
|
4845
|
+
return e;
|
|
4846
|
+
}
|
|
4847
|
+
async addLogToQueue(e, s = !1, r = !0) {
|
|
4848
|
+
r && (e = this.transformLog(e)), await this.sendLog(e, s);
|
|
4849
|
+
}
|
|
4850
|
+
}
|
|
4851
|
+
b(Pr, "registerEvent", Sr);
|
|
4852
|
+
const Oc = async (n) => {
|
|
4853
|
+
var i;
|
|
4854
|
+
let e = await n.getWebInitParams();
|
|
4855
|
+
const s = location.origin + "/static/apaas-track/apaas-spu/lzma_worker.js";
|
|
4856
|
+
console.log("createApaasTrack lzma_worker", s), Pi(s);
|
|
4857
|
+
const r = xc({
|
|
4858
|
+
url: n.url || "",
|
|
4859
|
+
click: {
|
|
4860
|
+
trackElementPath: !0
|
|
4861
|
+
},
|
|
4862
|
+
commonLog: {
|
|
4863
|
+
client: "Web",
|
|
4864
|
+
...e
|
|
4865
|
+
},
|
|
4866
|
+
online: (n == null ? void 0 : n.online) || !1,
|
|
4867
|
+
pageview: !0,
|
|
4868
|
+
http: !0,
|
|
4869
|
+
zip: n.zip !== void 0 ? n.zip : !0,
|
|
4870
|
+
useIndexDB: (i = n == null ? void 0 : n.useIndexDB) != null ? i : !1
|
|
4871
|
+
});
|
|
4872
|
+
return r.sendLog = n.sendLog, r.start = function(...a) {
|
|
4873
|
+
return Pr.prototype.start.call(this, ...a);
|
|
4874
|
+
}, n.sendLog === Lr && (r.start = function(...a) {
|
|
4875
|
+
return Bt.prototype.start.call(this, ...a);
|
|
4876
|
+
}), n.startFn && (r.start = n.startFn), r;
|
|
4877
|
+
};
|
|
4878
|
+
let Dn = null;
|
|
4879
|
+
const Fc = async (n) => {
|
|
4880
|
+
var s, r;
|
|
4881
|
+
if (Dn)
|
|
4882
|
+
return Dn;
|
|
4883
|
+
const e = await Oc({
|
|
4884
|
+
url: (n == null ? void 0 : n.url) || "",
|
|
4885
|
+
sendLog: (n == null ? void 0 : n.sendLog) || Lr,
|
|
4886
|
+
startFn: (n == null ? void 0 : n.startFn) || null,
|
|
4887
|
+
online: (n == null ? void 0 : n.online) || !1,
|
|
4888
|
+
getWebInitParams: (n == null ? void 0 : n.getWebInitParams) || zc,
|
|
4889
|
+
zip: (s = n == null ? void 0 : n.zip) != null ? s : !0,
|
|
4890
|
+
useIndexDB: (r = n == null ? void 0 : n.useIndexDB) != null ? r : !1
|
|
4891
|
+
});
|
|
4892
|
+
return Dn = e, e;
|
|
4893
|
+
}, zc = () => new Promise((n, e) => {
|
|
4894
|
+
if (window.aPaaS && window.aPaaS.getWebInitParams) {
|
|
4895
|
+
const s = window.aPaaS.getWebInitParams(
|
|
4896
|
+
(r) => {
|
|
4897
|
+
n(r);
|
|
4898
|
+
}
|
|
4899
|
+
);
|
|
4900
|
+
s && s.then && s.then((r) => {
|
|
4901
|
+
n(r);
|
|
4902
|
+
});
|
|
4903
|
+
} else {
|
|
4904
|
+
window.parent.postMessage(
|
|
4905
|
+
{
|
|
4906
|
+
type: "getWebInitParams"
|
|
4907
|
+
},
|
|
4908
|
+
"*"
|
|
4909
|
+
);
|
|
4910
|
+
const s = (i) => {
|
|
4911
|
+
const a = (i == null ? void 0 : i.data) || {};
|
|
4912
|
+
if (a.type === "receiveWebInitParams")
|
|
4913
|
+
if (a.data) {
|
|
4914
|
+
const u = a.data;
|
|
4915
|
+
n(u), r && (clearTimeout(r), r = null), window.removeEventListener(
|
|
4916
|
+
"message",
|
|
4917
|
+
s
|
|
4918
|
+
);
|
|
4919
|
+
} else
|
|
4920
|
+
e(Error("receiveWebInitParams response null"));
|
|
4921
|
+
};
|
|
4922
|
+
window.addEventListener("message", s);
|
|
4923
|
+
let r = window.setTimeout(() => {
|
|
4924
|
+
e(Error("postMessage getWebInitParams timeout"));
|
|
4925
|
+
}, 2e3);
|
|
4926
|
+
}
|
|
4927
|
+
});
|
|
4928
|
+
function Ic(...n) {
|
|
4929
|
+
return Bt.prototype.start.call(this, n);
|
|
4930
|
+
}
|
|
4931
|
+
function Lr(n, e) {
|
|
4932
|
+
var s;
|
|
4933
|
+
return (s = window.aPaaS) != null && s.sendLog ? window.aPaaS.sendLog(n, e) : Bt.prototype.sendLog.call(this, n, e);
|
|
4934
|
+
}
|
|
4935
|
+
export {
|
|
4936
|
+
at as BaseEvent,
|
|
4937
|
+
Hc as BaseSpanAttribute,
|
|
4938
|
+
hn as BaseTrack,
|
|
4939
|
+
li as CustomEvent,
|
|
4940
|
+
Vs as EventLevel,
|
|
4941
|
+
fe as EventMap,
|
|
4942
|
+
mi as ExceptionSpanEvent,
|
|
4943
|
+
hi as InitEvent,
|
|
4944
|
+
Jn as SpanEvent,
|
|
4945
|
+
di as SpanPropertyEvent,
|
|
4946
|
+
ui as TaskQueue,
|
|
4947
|
+
Oc as createApaasTrack,
|
|
4948
|
+
Ot as createEvent,
|
|
4949
|
+
zc as defaultGetWebInitParams,
|
|
4950
|
+
Lr as defaultWebSendFunction,
|
|
4951
|
+
Ic as defaultWebStartFunction,
|
|
4952
|
+
Fc as getApaasSpuTrack,
|
|
4953
|
+
bs as getEventLog,
|
|
4954
|
+
pi as getEventLogByType,
|
|
4955
|
+
Ks as registerEvent
|
|
4956
|
+
};
|