@poor-knight/cesium-utils 0.3.6 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cesium-utils.cjs +15 -15
- package/dist/cesium-utils.d.ts +20 -8
- package/dist/cesium-utils.js +1036 -1012
- package/dist/cesium-utils.umd.cjs +15 -15
- package/package.json +1 -1
package/dist/cesium-utils.js
CHANGED
|
@@ -2,18 +2,18 @@ var ue = Object.defineProperty;
|
|
|
2
2
|
var le = (s, i, r) => i in s ? ue(s, i, { enumerable: !0, configurable: !0, writable: !0, value: r }) : s[i] = r;
|
|
3
3
|
var z = (s, i, r) => le(s, typeof i != "symbol" ? i + "" : i, r);
|
|
4
4
|
import * as Cesium from "cesium";
|
|
5
|
-
import { Cartesian2, Cartesian3, VerticalOrigin, HorizontalOrigin, Color, LabelStyle, defined, DeveloperError, Event, Credit, Ellipsoid, GeographicTilingScheme, TerrainProvider, HeightmapTerrainData, Resource, Rectangle as Rectangle$1,
|
|
5
|
+
import { Cartesian2, Cartesian3, VerticalOrigin, HorizontalOrigin, Color, LabelStyle, defined, DeveloperError, Event, Credit, Ellipsoid, GeographicTilingScheme, TerrainProvider, HeightmapTerrainData, Resource, Rectangle as Rectangle$1, ScreenSpaceEventHandler, ScreenSpaceEventType, ImageryLayer, WebMapServiceImageryProvider, HeightReference, NearFarScalar, SceneMode, BoundingSphere, Occluder, SceneTransforms } from "cesium";
|
|
6
6
|
var commonjsGlobal = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, inflate$2 = {};
|
|
7
7
|
const adler32$1 = (s, i, r, u) => {
|
|
8
|
-
let
|
|
8
|
+
let h = s & 65535 | 0, o = s >>> 16 & 65535 | 0, l = 0;
|
|
9
9
|
for (; r !== 0; ) {
|
|
10
10
|
l = r > 2e3 ? 2e3 : r, r -= l;
|
|
11
11
|
do
|
|
12
|
-
|
|
12
|
+
h = h + i[u++] | 0, o = o + h | 0;
|
|
13
13
|
while (--l);
|
|
14
|
-
|
|
14
|
+
h %= 65521, o %= 65521;
|
|
15
15
|
}
|
|
16
|
-
return
|
|
16
|
+
return h | o << 16 | 0;
|
|
17
17
|
};
|
|
18
18
|
var adler32_1 = adler32$1;
|
|
19
19
|
const makeTable = () => {
|
|
@@ -26,77 +26,77 @@ const makeTable = () => {
|
|
|
26
26
|
}
|
|
27
27
|
return i;
|
|
28
28
|
}, crcTable = new Uint32Array(makeTable()), crc32$1 = (s, i, r, u) => {
|
|
29
|
-
const
|
|
29
|
+
const h = crcTable, o = u + r;
|
|
30
30
|
s ^= -1;
|
|
31
31
|
for (let l = u; l < o; l++)
|
|
32
|
-
s = s >>> 8 ^
|
|
32
|
+
s = s >>> 8 ^ h[(s ^ i[l]) & 255];
|
|
33
33
|
return s ^ -1;
|
|
34
34
|
};
|
|
35
35
|
var crc32_1 = crc32$1;
|
|
36
36
|
const BAD$1 = 16209, TYPE$1 = 16191;
|
|
37
37
|
var inffast = function(i, r) {
|
|
38
|
-
let u,
|
|
38
|
+
let u, h, o, l, c, d, a, m, y, g, p, v, b, _, T, w, x, O, E, R, S, P, C, D;
|
|
39
39
|
const I = i.state;
|
|
40
|
-
u = i.next_in, C = i.input,
|
|
40
|
+
u = i.next_in, C = i.input, h = u + (i.avail_in - 5), o = i.next_out, D = i.output, l = o - (r - i.avail_out), c = o + (i.avail_out - 257), d = I.dmax, a = I.wsize, m = I.whave, y = I.wnext, g = I.window, p = I.hold, v = I.bits, b = I.lencode, _ = I.distcode, T = (1 << I.lenbits) - 1, w = (1 << I.distbits) - 1;
|
|
41
41
|
e: do {
|
|
42
|
-
v < 15 && (
|
|
42
|
+
v < 15 && (p += C[u++] << v, v += 8, p += C[u++] << v, v += 8), x = b[p & T];
|
|
43
43
|
t: for (; ; ) {
|
|
44
|
-
if (O = x >>> 24,
|
|
44
|
+
if (O = x >>> 24, p >>>= O, v -= O, O = x >>> 16 & 255, O === 0)
|
|
45
45
|
D[o++] = x & 65535;
|
|
46
46
|
else if (O & 16) {
|
|
47
|
-
|
|
47
|
+
E = x & 65535, O &= 15, O && (v < O && (p += C[u++] << v, v += 8), E += p & (1 << O) - 1, p >>>= O, v -= O), v < 15 && (p += C[u++] << v, v += 8, p += C[u++] << v, v += 8), x = _[p & w];
|
|
48
48
|
r: for (; ; ) {
|
|
49
|
-
if (O = x >>> 24,
|
|
50
|
-
if (
|
|
49
|
+
if (O = x >>> 24, p >>>= O, v -= O, O = x >>> 16 & 255, O & 16) {
|
|
50
|
+
if (R = x & 65535, O &= 15, v < O && (p += C[u++] << v, v += 8, v < O && (p += C[u++] << v, v += 8)), R += p & (1 << O) - 1, R > d) {
|
|
51
51
|
i.msg = "invalid distance too far back", I.mode = BAD$1;
|
|
52
52
|
break e;
|
|
53
53
|
}
|
|
54
|
-
if (
|
|
55
|
-
if (O =
|
|
54
|
+
if (p >>>= O, v -= O, O = o - l, R > O) {
|
|
55
|
+
if (O = R - O, O > m && I.sane) {
|
|
56
56
|
i.msg = "invalid distance too far back", I.mode = BAD$1;
|
|
57
57
|
break e;
|
|
58
58
|
}
|
|
59
59
|
if (S = 0, P = g, y === 0) {
|
|
60
|
-
if (S += a - O, O <
|
|
61
|
-
|
|
60
|
+
if (S += a - O, O < E) {
|
|
61
|
+
E -= O;
|
|
62
62
|
do
|
|
63
63
|
D[o++] = g[S++];
|
|
64
64
|
while (--O);
|
|
65
|
-
S = o -
|
|
65
|
+
S = o - R, P = D;
|
|
66
66
|
}
|
|
67
67
|
} else if (y < O) {
|
|
68
|
-
if (S += a + y - O, O -= y, O <
|
|
69
|
-
|
|
68
|
+
if (S += a + y - O, O -= y, O < E) {
|
|
69
|
+
E -= O;
|
|
70
70
|
do
|
|
71
71
|
D[o++] = g[S++];
|
|
72
72
|
while (--O);
|
|
73
|
-
if (S = 0, y <
|
|
74
|
-
O = y,
|
|
73
|
+
if (S = 0, y < E) {
|
|
74
|
+
O = y, E -= O;
|
|
75
75
|
do
|
|
76
76
|
D[o++] = g[S++];
|
|
77
77
|
while (--O);
|
|
78
|
-
S = o -
|
|
78
|
+
S = o - R, P = D;
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
} else if (S += y - O, O <
|
|
82
|
-
|
|
81
|
+
} else if (S += y - O, O < E) {
|
|
82
|
+
E -= O;
|
|
83
83
|
do
|
|
84
84
|
D[o++] = g[S++];
|
|
85
85
|
while (--O);
|
|
86
|
-
S = o -
|
|
86
|
+
S = o - R, P = D;
|
|
87
87
|
}
|
|
88
|
-
for (;
|
|
89
|
-
D[o++] = P[S++], D[o++] = P[S++], D[o++] = P[S++],
|
|
90
|
-
|
|
88
|
+
for (; E > 2; )
|
|
89
|
+
D[o++] = P[S++], D[o++] = P[S++], D[o++] = P[S++], E -= 3;
|
|
90
|
+
E && (D[o++] = P[S++], E > 1 && (D[o++] = P[S++]));
|
|
91
91
|
} else {
|
|
92
|
-
S = o -
|
|
92
|
+
S = o - R;
|
|
93
93
|
do
|
|
94
|
-
D[o++] = D[S++], D[o++] = D[S++], D[o++] = D[S++],
|
|
95
|
-
while (
|
|
96
|
-
|
|
94
|
+
D[o++] = D[S++], D[o++] = D[S++], D[o++] = D[S++], E -= 3;
|
|
95
|
+
while (E > 2);
|
|
96
|
+
E && (D[o++] = D[S++], E > 1 && (D[o++] = D[S++]));
|
|
97
97
|
}
|
|
98
98
|
} else if ((O & 64) === 0) {
|
|
99
|
-
x = _[(x & 65535) + (
|
|
99
|
+
x = _[(x & 65535) + (p & (1 << O) - 1)];
|
|
100
100
|
continue r;
|
|
101
101
|
} else {
|
|
102
102
|
i.msg = "invalid distance code", I.mode = BAD$1;
|
|
@@ -105,7 +105,7 @@ var inffast = function(i, r) {
|
|
|
105
105
|
break;
|
|
106
106
|
}
|
|
107
107
|
} else if ((O & 64) === 0) {
|
|
108
|
-
x = b[(x & 65535) + (
|
|
108
|
+
x = b[(x & 65535) + (p & (1 << O) - 1)];
|
|
109
109
|
continue t;
|
|
110
110
|
} else if (O & 32) {
|
|
111
111
|
I.mode = TYPE$1;
|
|
@@ -116,8 +116,8 @@ var inffast = function(i, r) {
|
|
|
116
116
|
}
|
|
117
117
|
break;
|
|
118
118
|
}
|
|
119
|
-
} while (u <
|
|
120
|
-
|
|
119
|
+
} while (u < h && o < c);
|
|
120
|
+
E = v >> 3, u -= E, v -= E << 3, p &= (1 << v) - 1, i.next_in = u, i.next_out = o, i.avail_in = u < h ? 5 + (h - u) : 5 - (u - h), i.avail_out = o < c ? 257 + (c - o) : 257 - (o - c), I.hold = p, I.bits = v;
|
|
121
121
|
};
|
|
122
122
|
const MAXBITS = 15, ENOUGH_LENS$1 = 852, ENOUGH_DISTS$1 = 592, CODES$1 = 0, LENS$1 = 1, DISTS$1 = 2, lbase = new Uint16Array([
|
|
123
123
|
/* Length codes 257..285 base */
|
|
@@ -253,53 +253,53 @@ const MAXBITS = 15, ENOUGH_LENS$1 = 852, ENOUGH_DISTS$1 = 592, CODES$1 = 0, LENS
|
|
|
253
253
|
29,
|
|
254
254
|
64,
|
|
255
255
|
64
|
|
256
|
-
]), inflate_table$1 = (s, i, r, u,
|
|
256
|
+
]), inflate_table$1 = (s, i, r, u, h, o, l, c) => {
|
|
257
257
|
const d = c.bits;
|
|
258
|
-
let a = 0,
|
|
258
|
+
let a = 0, m = 0, y = 0, g = 0, p = 0, v = 0, b = 0, _ = 0, T = 0, w = 0, x, O, E, R, S, P = null, C;
|
|
259
259
|
const D = new Uint16Array(MAXBITS + 1), I = new Uint16Array(MAXBITS + 1);
|
|
260
|
-
let
|
|
260
|
+
let M = null, q, F, U;
|
|
261
261
|
for (a = 0; a <= MAXBITS; a++)
|
|
262
262
|
D[a] = 0;
|
|
263
|
-
for (
|
|
264
|
-
D[i[r +
|
|
265
|
-
for (
|
|
263
|
+
for (m = 0; m < u; m++)
|
|
264
|
+
D[i[r + m]]++;
|
|
265
|
+
for (p = d, g = MAXBITS; g >= 1 && D[g] === 0; g--)
|
|
266
266
|
;
|
|
267
|
-
if (
|
|
268
|
-
return
|
|
267
|
+
if (p > g && (p = g), g === 0)
|
|
268
|
+
return h[o++] = 1 << 24 | 64 << 16 | 0, h[o++] = 1 << 24 | 64 << 16 | 0, c.bits = 1, 0;
|
|
269
269
|
for (y = 1; y < g && D[y] === 0; y++)
|
|
270
270
|
;
|
|
271
|
-
for (
|
|
271
|
+
for (p < y && (p = y), _ = 1, a = 1; a <= MAXBITS; a++)
|
|
272
272
|
if (_ <<= 1, _ -= D[a], _ < 0)
|
|
273
273
|
return -1;
|
|
274
274
|
if (_ > 0 && (s === CODES$1 || g !== 1))
|
|
275
275
|
return -1;
|
|
276
276
|
for (I[1] = 0, a = 1; a < MAXBITS; a++)
|
|
277
277
|
I[a + 1] = I[a] + D[a];
|
|
278
|
-
for (
|
|
279
|
-
i[r +
|
|
280
|
-
if (s === CODES$1 ? (P =
|
|
278
|
+
for (m = 0; m < u; m++)
|
|
279
|
+
i[r + m] !== 0 && (l[I[i[r + m]]++] = m);
|
|
280
|
+
if (s === CODES$1 ? (P = M = l, C = 20) : s === LENS$1 ? (P = lbase, M = lext, C = 257) : (P = dbase, M = dext, C = 0), w = 0, m = 0, a = y, S = o, v = p, b = 0, E = -1, T = 1 << p, R = T - 1, s === LENS$1 && T > ENOUGH_LENS$1 || s === DISTS$1 && T > ENOUGH_DISTS$1)
|
|
281
281
|
return 1;
|
|
282
282
|
for (; ; ) {
|
|
283
|
-
q = a - b, l[
|
|
283
|
+
q = a - b, l[m] + 1 < C ? (F = 0, U = l[m]) : l[m] >= C ? (F = M[l[m] - C], U = P[l[m] - C]) : (F = 96, U = 0), x = 1 << a - b, O = 1 << v, y = O;
|
|
284
284
|
do
|
|
285
|
-
O -= x,
|
|
285
|
+
O -= x, h[S + (w >> b) + O] = q << 24 | F << 16 | U | 0;
|
|
286
286
|
while (O !== 0);
|
|
287
287
|
for (x = 1 << a - 1; w & x; )
|
|
288
288
|
x >>= 1;
|
|
289
|
-
if (x !== 0 ? (w &= x - 1, w += x) : w = 0,
|
|
289
|
+
if (x !== 0 ? (w &= x - 1, w += x) : w = 0, m++, --D[a] === 0) {
|
|
290
290
|
if (a === g)
|
|
291
291
|
break;
|
|
292
|
-
a = i[r + l[
|
|
292
|
+
a = i[r + l[m]];
|
|
293
293
|
}
|
|
294
|
-
if (a >
|
|
295
|
-
for (b === 0 && (b =
|
|
294
|
+
if (a > p && (w & R) !== E) {
|
|
295
|
+
for (b === 0 && (b = p), S += y, v = a - b, _ = 1 << v; v + b < g && (_ -= D[v + b], !(_ <= 0)); )
|
|
296
296
|
v++, _ <<= 1;
|
|
297
297
|
if (T += 1 << v, s === LENS$1 && T > ENOUGH_LENS$1 || s === DISTS$1 && T > ENOUGH_DISTS$1)
|
|
298
298
|
return 1;
|
|
299
|
-
|
|
299
|
+
E = w & R, h[E] = p << 24 | v << 16 | S - o | 0;
|
|
300
300
|
}
|
|
301
301
|
}
|
|
302
|
-
return w !== 0 && (
|
|
302
|
+
return w !== 0 && (h[S + w] = a - b << 24 | 64 << 16 | 0), c.bits = p, 0;
|
|
303
303
|
};
|
|
304
304
|
var inftrees = inflate_table$1, constants = {
|
|
305
305
|
/* Allowed flush values; see deflate() and inflate() below for details */
|
|
@@ -389,20 +389,20 @@ const fixedtables = (s) => {
|
|
|
389
389
|
}
|
|
390
390
|
s.lencode = lenfix, s.lenbits = 9, s.distcode = distfix, s.distbits = 5;
|
|
391
391
|
}, updatewindow = (s, i, r, u) => {
|
|
392
|
-
let
|
|
392
|
+
let h;
|
|
393
393
|
const o = s.state;
|
|
394
|
-
return o.window === null && (o.wsize = 1 << o.wbits, o.wnext = 0, o.whave = 0, o.window = new Uint8Array(o.wsize)), u >= o.wsize ? (o.window.set(i.subarray(r - o.wsize, r), 0), o.wnext = 0, o.whave = o.wsize) : (
|
|
394
|
+
return o.window === null && (o.wsize = 1 << o.wbits, o.wnext = 0, o.whave = 0, o.window = new Uint8Array(o.wsize)), u >= o.wsize ? (o.window.set(i.subarray(r - o.wsize, r), 0), o.wnext = 0, o.whave = o.wsize) : (h = o.wsize - o.wnext, h > u && (h = u), o.window.set(i.subarray(r - u, r - u + h), o.wnext), u -= h, u ? (o.window.set(i.subarray(r - u, r), 0), o.wnext = u, o.whave = o.wsize) : (o.wnext += h, o.wnext === o.wsize && (o.wnext = 0), o.whave < o.wsize && (o.whave += h))), 0;
|
|
395
395
|
}, inflate$1 = (s, i) => {
|
|
396
|
-
let r, u,
|
|
396
|
+
let r, u, h, o, l, c, d, a, m, y, g, p, v, b, _ = 0, T, w, x, O, E, R, S, P;
|
|
397
397
|
const C = new Uint8Array(4);
|
|
398
398
|
let D, I;
|
|
399
|
-
const
|
|
399
|
+
const M = (
|
|
400
400
|
/* permutation of code lengths */
|
|
401
401
|
new Uint8Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15])
|
|
402
402
|
);
|
|
403
403
|
if (inflateStateCheck(s) || !s.output || !s.input && s.avail_in !== 0)
|
|
404
404
|
return Z_STREAM_ERROR$1;
|
|
405
|
-
r = s.state, r.mode === TYPE && (r.mode = TYPEDO), l = s.next_out,
|
|
405
|
+
r = s.state, r.mode === TYPE && (r.mode = TYPEDO), l = s.next_out, h = s.output, d = s.avail_out, o = s.next_in, u = s.input, c = s.avail_in, a = r.hold, m = r.bits, y = c, g = d, P = Z_OK$1;
|
|
406
406
|
e: for (; ; )
|
|
407
407
|
switch (r.mode) {
|
|
408
408
|
case HEAD:
|
|
@@ -410,13 +410,13 @@ const fixedtables = (s) => {
|
|
|
410
410
|
r.mode = TYPEDO;
|
|
411
411
|
break;
|
|
412
412
|
}
|
|
413
|
-
for (;
|
|
413
|
+
for (; m < 16; ) {
|
|
414
414
|
if (c === 0)
|
|
415
415
|
break e;
|
|
416
|
-
c--, a += u[o++] <<
|
|
416
|
+
c--, a += u[o++] << m, m += 8;
|
|
417
417
|
}
|
|
418
418
|
if (r.wrap & 2 && a === 35615) {
|
|
419
|
-
r.wbits === 0 && (r.wbits = 15), r.check = 0, C[0] = a & 255, C[1] = a >>> 8 & 255, r.check = crc32(r.check, C, 2, 0), a = 0,
|
|
419
|
+
r.wbits === 0 && (r.wbits = 15), r.check = 0, C[0] = a & 255, C[1] = a >>> 8 & 255, r.check = crc32(r.check, C, 2, 0), a = 0, m = 0, r.mode = FLAGS;
|
|
420
420
|
break;
|
|
421
421
|
}
|
|
422
422
|
if (r.head && (r.head.done = !1), !(r.wrap & 1) || (((a & 255) << 8) + (a >> 8)) % 31) {
|
|
@@ -427,17 +427,17 @@ const fixedtables = (s) => {
|
|
|
427
427
|
s.msg = "unknown compression method", r.mode = BAD;
|
|
428
428
|
break;
|
|
429
429
|
}
|
|
430
|
-
if (a >>>= 4,
|
|
430
|
+
if (a >>>= 4, m -= 4, S = (a & 15) + 8, r.wbits === 0 && (r.wbits = S), S > 15 || S > r.wbits) {
|
|
431
431
|
s.msg = "invalid window size", r.mode = BAD;
|
|
432
432
|
break;
|
|
433
433
|
}
|
|
434
|
-
r.dmax = 1 << r.wbits, r.flags = 0, s.adler = r.check = 1, r.mode = a & 512 ? DICTID : TYPE, a = 0,
|
|
434
|
+
r.dmax = 1 << r.wbits, r.flags = 0, s.adler = r.check = 1, r.mode = a & 512 ? DICTID : TYPE, a = 0, m = 0;
|
|
435
435
|
break;
|
|
436
436
|
case FLAGS:
|
|
437
|
-
for (;
|
|
437
|
+
for (; m < 16; ) {
|
|
438
438
|
if (c === 0)
|
|
439
439
|
break e;
|
|
440
|
-
c--, a += u[o++] <<
|
|
440
|
+
c--, a += u[o++] << m, m += 8;
|
|
441
441
|
}
|
|
442
442
|
if (r.flags = a, (r.flags & 255) !== Z_DEFLATED) {
|
|
443
443
|
s.msg = "unknown compression method", r.mode = BAD;
|
|
@@ -447,45 +447,45 @@ const fixedtables = (s) => {
|
|
|
447
447
|
s.msg = "unknown header flags set", r.mode = BAD;
|
|
448
448
|
break;
|
|
449
449
|
}
|
|
450
|
-
r.head && (r.head.text = a >> 8 & 1), r.flags & 512 && r.wrap & 4 && (C[0] = a & 255, C[1] = a >>> 8 & 255, r.check = crc32(r.check, C, 2, 0)), a = 0,
|
|
450
|
+
r.head && (r.head.text = a >> 8 & 1), r.flags & 512 && r.wrap & 4 && (C[0] = a & 255, C[1] = a >>> 8 & 255, r.check = crc32(r.check, C, 2, 0)), a = 0, m = 0, r.mode = TIME;
|
|
451
451
|
/* falls through */
|
|
452
452
|
case TIME:
|
|
453
|
-
for (;
|
|
453
|
+
for (; m < 32; ) {
|
|
454
454
|
if (c === 0)
|
|
455
455
|
break e;
|
|
456
|
-
c--, a += u[o++] <<
|
|
456
|
+
c--, a += u[o++] << m, m += 8;
|
|
457
457
|
}
|
|
458
|
-
r.head && (r.head.time = a), r.flags & 512 && r.wrap & 4 && (C[0] = a & 255, C[1] = a >>> 8 & 255, C[2] = a >>> 16 & 255, C[3] = a >>> 24 & 255, r.check = crc32(r.check, C, 4, 0)), a = 0,
|
|
458
|
+
r.head && (r.head.time = a), r.flags & 512 && r.wrap & 4 && (C[0] = a & 255, C[1] = a >>> 8 & 255, C[2] = a >>> 16 & 255, C[3] = a >>> 24 & 255, r.check = crc32(r.check, C, 4, 0)), a = 0, m = 0, r.mode = OS;
|
|
459
459
|
/* falls through */
|
|
460
460
|
case OS:
|
|
461
|
-
for (;
|
|
461
|
+
for (; m < 16; ) {
|
|
462
462
|
if (c === 0)
|
|
463
463
|
break e;
|
|
464
|
-
c--, a += u[o++] <<
|
|
464
|
+
c--, a += u[o++] << m, m += 8;
|
|
465
465
|
}
|
|
466
|
-
r.head && (r.head.xflags = a & 255, r.head.os = a >> 8), r.flags & 512 && r.wrap & 4 && (C[0] = a & 255, C[1] = a >>> 8 & 255, r.check = crc32(r.check, C, 2, 0)), a = 0,
|
|
466
|
+
r.head && (r.head.xflags = a & 255, r.head.os = a >> 8), r.flags & 512 && r.wrap & 4 && (C[0] = a & 255, C[1] = a >>> 8 & 255, r.check = crc32(r.check, C, 2, 0)), a = 0, m = 0, r.mode = EXLEN;
|
|
467
467
|
/* falls through */
|
|
468
468
|
case EXLEN:
|
|
469
469
|
if (r.flags & 1024) {
|
|
470
|
-
for (;
|
|
470
|
+
for (; m < 16; ) {
|
|
471
471
|
if (c === 0)
|
|
472
472
|
break e;
|
|
473
|
-
c--, a += u[o++] <<
|
|
473
|
+
c--, a += u[o++] << m, m += 8;
|
|
474
474
|
}
|
|
475
|
-
r.length = a, r.head && (r.head.extra_len = a), r.flags & 512 && r.wrap & 4 && (C[0] = a & 255, C[1] = a >>> 8 & 255, r.check = crc32(r.check, C, 2, 0)), a = 0,
|
|
475
|
+
r.length = a, r.head && (r.head.extra_len = a), r.flags & 512 && r.wrap & 4 && (C[0] = a & 255, C[1] = a >>> 8 & 255, r.check = crc32(r.check, C, 2, 0)), a = 0, m = 0;
|
|
476
476
|
} else r.head && (r.head.extra = null);
|
|
477
477
|
r.mode = EXTRA;
|
|
478
478
|
/* falls through */
|
|
479
479
|
case EXTRA:
|
|
480
|
-
if (r.flags & 1024 && (
|
|
480
|
+
if (r.flags & 1024 && (p = r.length, p > c && (p = c), p && (r.head && (S = r.head.extra_len - r.length, r.head.extra || (r.head.extra = new Uint8Array(r.head.extra_len)), r.head.extra.set(
|
|
481
481
|
u.subarray(
|
|
482
482
|
o,
|
|
483
483
|
// extra field is limited to 65536 bytes
|
|
484
484
|
// - no need for additional size check
|
|
485
|
-
o +
|
|
485
|
+
o + p
|
|
486
486
|
),
|
|
487
487
|
S
|
|
488
|
-
)), r.flags & 512 && r.wrap & 4 && (r.check = crc32(r.check, u,
|
|
488
|
+
)), r.flags & 512 && r.wrap & 4 && (r.check = crc32(r.check, u, p, o)), c -= p, o += p, r.length -= p), r.length))
|
|
489
489
|
break e;
|
|
490
490
|
r.length = 0, r.mode = NAME;
|
|
491
491
|
/* falls through */
|
|
@@ -493,11 +493,11 @@ const fixedtables = (s) => {
|
|
|
493
493
|
if (r.flags & 2048) {
|
|
494
494
|
if (c === 0)
|
|
495
495
|
break e;
|
|
496
|
-
|
|
496
|
+
p = 0;
|
|
497
497
|
do
|
|
498
|
-
S = u[o +
|
|
499
|
-
while (S &&
|
|
500
|
-
if (r.flags & 512 && r.wrap & 4 && (r.check = crc32(r.check, u,
|
|
498
|
+
S = u[o + p++], r.head && S && r.length < 65536 && (r.head.name += String.fromCharCode(S));
|
|
499
|
+
while (S && p < c);
|
|
500
|
+
if (r.flags & 512 && r.wrap & 4 && (r.check = crc32(r.check, u, p, o)), c -= p, o += p, S)
|
|
501
501
|
break e;
|
|
502
502
|
} else r.head && (r.head.name = null);
|
|
503
503
|
r.length = 0, r.mode = COMMENT;
|
|
@@ -506,41 +506,41 @@ const fixedtables = (s) => {
|
|
|
506
506
|
if (r.flags & 4096) {
|
|
507
507
|
if (c === 0)
|
|
508
508
|
break e;
|
|
509
|
-
|
|
509
|
+
p = 0;
|
|
510
510
|
do
|
|
511
|
-
S = u[o +
|
|
512
|
-
while (S &&
|
|
513
|
-
if (r.flags & 512 && r.wrap & 4 && (r.check = crc32(r.check, u,
|
|
511
|
+
S = u[o + p++], r.head && S && r.length < 65536 && (r.head.comment += String.fromCharCode(S));
|
|
512
|
+
while (S && p < c);
|
|
513
|
+
if (r.flags & 512 && r.wrap & 4 && (r.check = crc32(r.check, u, p, o)), c -= p, o += p, S)
|
|
514
514
|
break e;
|
|
515
515
|
} else r.head && (r.head.comment = null);
|
|
516
516
|
r.mode = HCRC;
|
|
517
517
|
/* falls through */
|
|
518
518
|
case HCRC:
|
|
519
519
|
if (r.flags & 512) {
|
|
520
|
-
for (;
|
|
520
|
+
for (; m < 16; ) {
|
|
521
521
|
if (c === 0)
|
|
522
522
|
break e;
|
|
523
|
-
c--, a += u[o++] <<
|
|
523
|
+
c--, a += u[o++] << m, m += 8;
|
|
524
524
|
}
|
|
525
525
|
if (r.wrap & 4 && a !== (r.check & 65535)) {
|
|
526
526
|
s.msg = "header crc mismatch", r.mode = BAD;
|
|
527
527
|
break;
|
|
528
528
|
}
|
|
529
|
-
a = 0,
|
|
529
|
+
a = 0, m = 0;
|
|
530
530
|
}
|
|
531
531
|
r.head && (r.head.hcrc = r.flags >> 9 & 1, r.head.done = !0), s.adler = r.check = 0, r.mode = TYPE;
|
|
532
532
|
break;
|
|
533
533
|
case DICTID:
|
|
534
|
-
for (;
|
|
534
|
+
for (; m < 32; ) {
|
|
535
535
|
if (c === 0)
|
|
536
536
|
break e;
|
|
537
|
-
c--, a += u[o++] <<
|
|
537
|
+
c--, a += u[o++] << m, m += 8;
|
|
538
538
|
}
|
|
539
|
-
s.adler = r.check = zswap32(a), a = 0,
|
|
539
|
+
s.adler = r.check = zswap32(a), a = 0, m = 0, r.mode = DICT;
|
|
540
540
|
/* falls through */
|
|
541
541
|
case DICT:
|
|
542
542
|
if (r.havedict === 0)
|
|
543
|
-
return s.next_out = l, s.avail_out = d, s.next_in = o, s.avail_in = c, r.hold = a, r.bits =
|
|
543
|
+
return s.next_out = l, s.avail_out = d, s.next_in = o, s.avail_in = c, r.hold = a, r.bits = m, Z_NEED_DICT$1;
|
|
544
544
|
s.adler = r.check = 1, r.mode = TYPE;
|
|
545
545
|
/* falls through */
|
|
546
546
|
case TYPE:
|
|
@@ -549,21 +549,21 @@ const fixedtables = (s) => {
|
|
|
549
549
|
/* falls through */
|
|
550
550
|
case TYPEDO:
|
|
551
551
|
if (r.last) {
|
|
552
|
-
a >>>=
|
|
552
|
+
a >>>= m & 7, m -= m & 7, r.mode = CHECK;
|
|
553
553
|
break;
|
|
554
554
|
}
|
|
555
|
-
for (;
|
|
555
|
+
for (; m < 3; ) {
|
|
556
556
|
if (c === 0)
|
|
557
557
|
break e;
|
|
558
|
-
c--, a += u[o++] <<
|
|
558
|
+
c--, a += u[o++] << m, m += 8;
|
|
559
559
|
}
|
|
560
|
-
switch (r.last = a & 1, a >>>= 1,
|
|
560
|
+
switch (r.last = a & 1, a >>>= 1, m -= 1, a & 3) {
|
|
561
561
|
case 0:
|
|
562
562
|
r.mode = STORED;
|
|
563
563
|
break;
|
|
564
564
|
case 1:
|
|
565
565
|
if (fixedtables(r), r.mode = LEN_, i === Z_TREES) {
|
|
566
|
-
a >>>= 2,
|
|
566
|
+
a >>>= 2, m -= 2;
|
|
567
567
|
break e;
|
|
568
568
|
}
|
|
569
569
|
break;
|
|
@@ -573,40 +573,40 @@ const fixedtables = (s) => {
|
|
|
573
573
|
case 3:
|
|
574
574
|
s.msg = "invalid block type", r.mode = BAD;
|
|
575
575
|
}
|
|
576
|
-
a >>>= 2,
|
|
576
|
+
a >>>= 2, m -= 2;
|
|
577
577
|
break;
|
|
578
578
|
case STORED:
|
|
579
|
-
for (a >>>=
|
|
579
|
+
for (a >>>= m & 7, m -= m & 7; m < 32; ) {
|
|
580
580
|
if (c === 0)
|
|
581
581
|
break e;
|
|
582
|
-
c--, a += u[o++] <<
|
|
582
|
+
c--, a += u[o++] << m, m += 8;
|
|
583
583
|
}
|
|
584
584
|
if ((a & 65535) !== (a >>> 16 ^ 65535)) {
|
|
585
585
|
s.msg = "invalid stored block lengths", r.mode = BAD;
|
|
586
586
|
break;
|
|
587
587
|
}
|
|
588
|
-
if (r.length = a & 65535, a = 0,
|
|
588
|
+
if (r.length = a & 65535, a = 0, m = 0, r.mode = COPY_, i === Z_TREES)
|
|
589
589
|
break e;
|
|
590
590
|
/* falls through */
|
|
591
591
|
case COPY_:
|
|
592
592
|
r.mode = COPY;
|
|
593
593
|
/* falls through */
|
|
594
594
|
case COPY:
|
|
595
|
-
if (
|
|
596
|
-
if (
|
|
595
|
+
if (p = r.length, p) {
|
|
596
|
+
if (p > c && (p = c), p > d && (p = d), p === 0)
|
|
597
597
|
break e;
|
|
598
|
-
|
|
598
|
+
h.set(u.subarray(o, o + p), l), c -= p, o += p, d -= p, l += p, r.length -= p;
|
|
599
599
|
break;
|
|
600
600
|
}
|
|
601
601
|
r.mode = TYPE;
|
|
602
602
|
break;
|
|
603
603
|
case TABLE:
|
|
604
|
-
for (;
|
|
604
|
+
for (; m < 14; ) {
|
|
605
605
|
if (c === 0)
|
|
606
606
|
break e;
|
|
607
|
-
c--, a += u[o++] <<
|
|
607
|
+
c--, a += u[o++] << m, m += 8;
|
|
608
608
|
}
|
|
609
|
-
if (r.nlen = (a & 31) + 257, a >>>= 5,
|
|
609
|
+
if (r.nlen = (a & 31) + 257, a >>>= 5, m -= 5, r.ndist = (a & 31) + 1, a >>>= 5, m -= 5, r.ncode = (a & 15) + 4, a >>>= 4, m -= 4, r.nlen > 286 || r.ndist > 30) {
|
|
610
610
|
s.msg = "too many length or distance symbols", r.mode = BAD;
|
|
611
611
|
break;
|
|
612
612
|
}
|
|
@@ -614,15 +614,15 @@ const fixedtables = (s) => {
|
|
|
614
614
|
/* falls through */
|
|
615
615
|
case LENLENS:
|
|
616
616
|
for (; r.have < r.ncode; ) {
|
|
617
|
-
for (;
|
|
617
|
+
for (; m < 3; ) {
|
|
618
618
|
if (c === 0)
|
|
619
619
|
break e;
|
|
620
|
-
c--, a += u[o++] <<
|
|
620
|
+
c--, a += u[o++] << m, m += 8;
|
|
621
621
|
}
|
|
622
|
-
r.lens[
|
|
622
|
+
r.lens[M[r.have++]] = a & 7, a >>>= 3, m -= 3;
|
|
623
623
|
}
|
|
624
624
|
for (; r.have < 19; )
|
|
625
|
-
r.lens[
|
|
625
|
+
r.lens[M[r.have++]] = 0;
|
|
626
626
|
if (r.lencode = r.lendyn, r.lenbits = 7, D = {
|
|
627
627
|
bits: r.lenbits
|
|
628
628
|
}, P = inflate_table(CODES, r.lens, 0, 19, r.lencode, 0, r.work, D), r.lenbits = D.bits, P) {
|
|
@@ -633,45 +633,45 @@ const fixedtables = (s) => {
|
|
|
633
633
|
/* falls through */
|
|
634
634
|
case CODELENS:
|
|
635
635
|
for (; r.have < r.nlen + r.ndist; ) {
|
|
636
|
-
for (; _ = r.lencode[a & (1 << r.lenbits) - 1], T = _ >>> 24, w = _ >>> 16 & 255, x = _ & 65535, !(T <=
|
|
636
|
+
for (; _ = r.lencode[a & (1 << r.lenbits) - 1], T = _ >>> 24, w = _ >>> 16 & 255, x = _ & 65535, !(T <= m); ) {
|
|
637
637
|
if (c === 0)
|
|
638
638
|
break e;
|
|
639
|
-
c--, a += u[o++] <<
|
|
639
|
+
c--, a += u[o++] << m, m += 8;
|
|
640
640
|
}
|
|
641
641
|
if (x < 16)
|
|
642
|
-
a >>>= T,
|
|
642
|
+
a >>>= T, m -= T, r.lens[r.have++] = x;
|
|
643
643
|
else {
|
|
644
644
|
if (x === 16) {
|
|
645
|
-
for (I = T + 2;
|
|
645
|
+
for (I = T + 2; m < I; ) {
|
|
646
646
|
if (c === 0)
|
|
647
647
|
break e;
|
|
648
|
-
c--, a += u[o++] <<
|
|
648
|
+
c--, a += u[o++] << m, m += 8;
|
|
649
649
|
}
|
|
650
|
-
if (a >>>= T,
|
|
650
|
+
if (a >>>= T, m -= T, r.have === 0) {
|
|
651
651
|
s.msg = "invalid bit length repeat", r.mode = BAD;
|
|
652
652
|
break;
|
|
653
653
|
}
|
|
654
|
-
S = r.lens[r.have - 1],
|
|
654
|
+
S = r.lens[r.have - 1], p = 3 + (a & 3), a >>>= 2, m -= 2;
|
|
655
655
|
} else if (x === 17) {
|
|
656
|
-
for (I = T + 3;
|
|
656
|
+
for (I = T + 3; m < I; ) {
|
|
657
657
|
if (c === 0)
|
|
658
658
|
break e;
|
|
659
|
-
c--, a += u[o++] <<
|
|
659
|
+
c--, a += u[o++] << m, m += 8;
|
|
660
660
|
}
|
|
661
|
-
a >>>= T,
|
|
661
|
+
a >>>= T, m -= T, S = 0, p = 3 + (a & 7), a >>>= 3, m -= 3;
|
|
662
662
|
} else {
|
|
663
|
-
for (I = T + 7;
|
|
663
|
+
for (I = T + 7; m < I; ) {
|
|
664
664
|
if (c === 0)
|
|
665
665
|
break e;
|
|
666
|
-
c--, a += u[o++] <<
|
|
666
|
+
c--, a += u[o++] << m, m += 8;
|
|
667
667
|
}
|
|
668
|
-
a >>>= T,
|
|
668
|
+
a >>>= T, m -= T, S = 0, p = 11 + (a & 127), a >>>= 7, m -= 7;
|
|
669
669
|
}
|
|
670
|
-
if (r.have +
|
|
670
|
+
if (r.have + p > r.nlen + r.ndist) {
|
|
671
671
|
s.msg = "invalid bit length repeat", r.mode = BAD;
|
|
672
672
|
break;
|
|
673
673
|
}
|
|
674
|
-
for (;
|
|
674
|
+
for (; p--; )
|
|
675
675
|
r.lens[r.have++] = S;
|
|
676
676
|
}
|
|
677
677
|
}
|
|
@@ -710,23 +710,23 @@ const fixedtables = (s) => {
|
|
|
710
710
|
/* falls through */
|
|
711
711
|
case LEN:
|
|
712
712
|
if (c >= 6 && d >= 258) {
|
|
713
|
-
s.next_out = l, s.avail_out = d, s.next_in = o, s.avail_in = c, r.hold = a, r.bits =
|
|
713
|
+
s.next_out = l, s.avail_out = d, s.next_in = o, s.avail_in = c, r.hold = a, r.bits = m, inflate_fast(s, g), l = s.next_out, h = s.output, d = s.avail_out, o = s.next_in, u = s.input, c = s.avail_in, a = r.hold, m = r.bits, r.mode === TYPE && (r.back = -1);
|
|
714
714
|
break;
|
|
715
715
|
}
|
|
716
|
-
for (r.back = 0; _ = r.lencode[a & (1 << r.lenbits) - 1], T = _ >>> 24, w = _ >>> 16 & 255, x = _ & 65535, !(T <=
|
|
716
|
+
for (r.back = 0; _ = r.lencode[a & (1 << r.lenbits) - 1], T = _ >>> 24, w = _ >>> 16 & 255, x = _ & 65535, !(T <= m); ) {
|
|
717
717
|
if (c === 0)
|
|
718
718
|
break e;
|
|
719
|
-
c--, a += u[o++] <<
|
|
719
|
+
c--, a += u[o++] << m, m += 8;
|
|
720
720
|
}
|
|
721
721
|
if (w && (w & 240) === 0) {
|
|
722
|
-
for (O = T,
|
|
722
|
+
for (O = T, E = w, R = x; _ = r.lencode[R + ((a & (1 << O + E) - 1) >> O)], T = _ >>> 24, w = _ >>> 16 & 255, x = _ & 65535, !(O + T <= m); ) {
|
|
723
723
|
if (c === 0)
|
|
724
724
|
break e;
|
|
725
|
-
c--, a += u[o++] <<
|
|
725
|
+
c--, a += u[o++] << m, m += 8;
|
|
726
726
|
}
|
|
727
|
-
a >>>= O,
|
|
727
|
+
a >>>= O, m -= O, r.back += O;
|
|
728
728
|
}
|
|
729
|
-
if (a >>>= T,
|
|
729
|
+
if (a >>>= T, m -= T, r.back += T, r.length = x, w === 0) {
|
|
730
730
|
r.mode = LIT;
|
|
731
731
|
break;
|
|
732
732
|
}
|
|
@@ -742,30 +742,30 @@ const fixedtables = (s) => {
|
|
|
742
742
|
/* falls through */
|
|
743
743
|
case LENEXT:
|
|
744
744
|
if (r.extra) {
|
|
745
|
-
for (I = r.extra;
|
|
745
|
+
for (I = r.extra; m < I; ) {
|
|
746
746
|
if (c === 0)
|
|
747
747
|
break e;
|
|
748
|
-
c--, a += u[o++] <<
|
|
748
|
+
c--, a += u[o++] << m, m += 8;
|
|
749
749
|
}
|
|
750
|
-
r.length += a & (1 << r.extra) - 1, a >>>= r.extra,
|
|
750
|
+
r.length += a & (1 << r.extra) - 1, a >>>= r.extra, m -= r.extra, r.back += r.extra;
|
|
751
751
|
}
|
|
752
752
|
r.was = r.length, r.mode = DIST;
|
|
753
753
|
/* falls through */
|
|
754
754
|
case DIST:
|
|
755
|
-
for (; _ = r.distcode[a & (1 << r.distbits) - 1], T = _ >>> 24, w = _ >>> 16 & 255, x = _ & 65535, !(T <=
|
|
755
|
+
for (; _ = r.distcode[a & (1 << r.distbits) - 1], T = _ >>> 24, w = _ >>> 16 & 255, x = _ & 65535, !(T <= m); ) {
|
|
756
756
|
if (c === 0)
|
|
757
757
|
break e;
|
|
758
|
-
c--, a += u[o++] <<
|
|
758
|
+
c--, a += u[o++] << m, m += 8;
|
|
759
759
|
}
|
|
760
760
|
if ((w & 240) === 0) {
|
|
761
|
-
for (O = T,
|
|
761
|
+
for (O = T, E = w, R = x; _ = r.distcode[R + ((a & (1 << O + E) - 1) >> O)], T = _ >>> 24, w = _ >>> 16 & 255, x = _ & 65535, !(O + T <= m); ) {
|
|
762
762
|
if (c === 0)
|
|
763
763
|
break e;
|
|
764
|
-
c--, a += u[o++] <<
|
|
764
|
+
c--, a += u[o++] << m, m += 8;
|
|
765
765
|
}
|
|
766
|
-
a >>>= O,
|
|
766
|
+
a >>>= O, m -= O, r.back += O;
|
|
767
767
|
}
|
|
768
|
-
if (a >>>= T,
|
|
768
|
+
if (a >>>= T, m -= T, r.back += T, w & 64) {
|
|
769
769
|
s.msg = "invalid distance code", r.mode = BAD;
|
|
770
770
|
break;
|
|
771
771
|
}
|
|
@@ -773,12 +773,12 @@ const fixedtables = (s) => {
|
|
|
773
773
|
/* falls through */
|
|
774
774
|
case DISTEXT:
|
|
775
775
|
if (r.extra) {
|
|
776
|
-
for (I = r.extra;
|
|
776
|
+
for (I = r.extra; m < I; ) {
|
|
777
777
|
if (c === 0)
|
|
778
778
|
break e;
|
|
779
|
-
c--, a += u[o++] <<
|
|
779
|
+
c--, a += u[o++] << m, m += 8;
|
|
780
780
|
}
|
|
781
|
-
r.offset += a & (1 << r.extra) - 1, a >>>= r.extra,
|
|
781
|
+
r.offset += a & (1 << r.extra) - 1, a >>>= r.extra, m -= r.extra, r.back += r.extra;
|
|
782
782
|
}
|
|
783
783
|
if (r.offset > r.dmax) {
|
|
784
784
|
s.msg = "invalid distance too far back", r.mode = BAD;
|
|
@@ -789,53 +789,53 @@ const fixedtables = (s) => {
|
|
|
789
789
|
case MATCH:
|
|
790
790
|
if (d === 0)
|
|
791
791
|
break e;
|
|
792
|
-
if (
|
|
793
|
-
if (
|
|
792
|
+
if (p = g - d, r.offset > p) {
|
|
793
|
+
if (p = r.offset - p, p > r.whave && r.sane) {
|
|
794
794
|
s.msg = "invalid distance too far back", r.mode = BAD;
|
|
795
795
|
break;
|
|
796
796
|
}
|
|
797
|
-
|
|
797
|
+
p > r.wnext ? (p -= r.wnext, v = r.wsize - p) : v = r.wnext - p, p > r.length && (p = r.length), b = r.window;
|
|
798
798
|
} else
|
|
799
|
-
b =
|
|
800
|
-
|
|
799
|
+
b = h, v = l - r.offset, p = r.length;
|
|
800
|
+
p > d && (p = d), d -= p, r.length -= p;
|
|
801
801
|
do
|
|
802
|
-
|
|
803
|
-
while (--
|
|
802
|
+
h[l++] = b[v++];
|
|
803
|
+
while (--p);
|
|
804
804
|
r.length === 0 && (r.mode = LEN);
|
|
805
805
|
break;
|
|
806
806
|
case LIT:
|
|
807
807
|
if (d === 0)
|
|
808
808
|
break e;
|
|
809
|
-
|
|
809
|
+
h[l++] = r.length, d--, r.mode = LEN;
|
|
810
810
|
break;
|
|
811
811
|
case CHECK:
|
|
812
812
|
if (r.wrap) {
|
|
813
|
-
for (;
|
|
813
|
+
for (; m < 32; ) {
|
|
814
814
|
if (c === 0)
|
|
815
815
|
break e;
|
|
816
|
-
c--, a |= u[o++] <<
|
|
816
|
+
c--, a |= u[o++] << m, m += 8;
|
|
817
817
|
}
|
|
818
818
|
if (g -= d, s.total_out += g, r.total += g, r.wrap & 4 && g && (s.adler = r.check = /*UPDATE_CHECK(state.check, put - _out, _out);*/
|
|
819
|
-
r.flags ? crc32(r.check,
|
|
819
|
+
r.flags ? crc32(r.check, h, g, l - g) : adler32(r.check, h, g, l - g)), g = d, r.wrap & 4 && (r.flags ? a : zswap32(a)) !== r.check) {
|
|
820
820
|
s.msg = "incorrect data check", r.mode = BAD;
|
|
821
821
|
break;
|
|
822
822
|
}
|
|
823
|
-
a = 0,
|
|
823
|
+
a = 0, m = 0;
|
|
824
824
|
}
|
|
825
825
|
r.mode = LENGTH;
|
|
826
826
|
/* falls through */
|
|
827
827
|
case LENGTH:
|
|
828
828
|
if (r.wrap && r.flags) {
|
|
829
|
-
for (;
|
|
829
|
+
for (; m < 32; ) {
|
|
830
830
|
if (c === 0)
|
|
831
831
|
break e;
|
|
832
|
-
c--, a += u[o++] <<
|
|
832
|
+
c--, a += u[o++] << m, m += 8;
|
|
833
833
|
}
|
|
834
834
|
if (r.wrap & 4 && a !== (r.total & 4294967295)) {
|
|
835
835
|
s.msg = "incorrect length check", r.mode = BAD;
|
|
836
836
|
break;
|
|
837
837
|
}
|
|
838
|
-
a = 0,
|
|
838
|
+
a = 0, m = 0;
|
|
839
839
|
}
|
|
840
840
|
r.mode = DONE;
|
|
841
841
|
/* falls through */
|
|
@@ -852,8 +852,8 @@ const fixedtables = (s) => {
|
|
|
852
852
|
default:
|
|
853
853
|
return Z_STREAM_ERROR$1;
|
|
854
854
|
}
|
|
855
|
-
return s.next_out = l, s.avail_out = d, s.next_in = o, s.avail_in = c, r.hold = a, r.bits =
|
|
856
|
-
r.flags ? crc32(r.check,
|
|
855
|
+
return s.next_out = l, s.avail_out = d, s.next_in = o, s.avail_in = c, r.hold = a, r.bits = m, (r.wsize || g !== s.avail_out && r.mode < BAD && (r.mode < CHECK || i !== Z_FINISH$1)) && updatewindow(s, s.output, s.next_out, g - s.avail_out), y -= s.avail_in, g -= s.avail_out, s.total_in += y, s.total_out += g, r.total += g, r.wrap & 4 && g && (s.adler = r.check = /*UPDATE_CHECK(state.check, strm.next_out - _out, _out);*/
|
|
856
|
+
r.flags ? crc32(r.check, h, g, s.next_out - g) : adler32(r.check, h, g, s.next_out - g)), s.data_type = r.bits + (r.last ? 64 : 0) + (r.mode === TYPE ? 128 : 0) + (r.mode === LEN_ || r.mode === COPY_ ? 256 : 0), (y === 0 && g === 0 || i === Z_FINISH$1) && P === Z_OK$1 && (P = Z_BUF_ERROR), P;
|
|
857
857
|
}, inflateEnd = (s) => {
|
|
858
858
|
if (inflateStateCheck(s))
|
|
859
859
|
return Z_STREAM_ERROR$1;
|
|
@@ -866,8 +866,8 @@ const fixedtables = (s) => {
|
|
|
866
866
|
return (r.wrap & 2) === 0 ? Z_STREAM_ERROR$1 : (r.head = i, i.done = !1, Z_OK$1);
|
|
867
867
|
}, inflateSetDictionary = (s, i) => {
|
|
868
868
|
const r = i.length;
|
|
869
|
-
let u,
|
|
870
|
-
return inflateStateCheck(s) || (u = s.state, u.wrap !== 0 && u.mode !== DICT) ? Z_STREAM_ERROR$1 : u.mode === DICT && (
|
|
869
|
+
let u, h, o;
|
|
870
|
+
return inflateStateCheck(s) || (u = s.state, u.wrap !== 0 && u.mode !== DICT) ? Z_STREAM_ERROR$1 : u.mode === DICT && (h = 1, h = adler32(h, i, r, 0), h !== u.check) ? Z_DATA_ERROR$1 : (o = updatewindow(s, i, r, r), o ? (u.mode = MEM, Z_MEM_ERROR$1) : (u.havedict = 1, Z_OK$1));
|
|
871
871
|
};
|
|
872
872
|
inflate$2.inflateReset = inflateReset;
|
|
873
873
|
inflate$2.inflateReset2 = inflateReset2;
|
|
@@ -896,12 +896,12 @@ common$1.assign = function(s) {
|
|
|
896
896
|
};
|
|
897
897
|
common$1.flattenChunks = (s) => {
|
|
898
898
|
let i = 0;
|
|
899
|
-
for (let u = 0,
|
|
899
|
+
for (let u = 0, h = s.length; u < h; u++)
|
|
900
900
|
i += s[u].length;
|
|
901
901
|
const r = new Uint8Array(i);
|
|
902
|
-
for (let u = 0,
|
|
902
|
+
for (let u = 0, h = 0, o = s.length; u < o; u++) {
|
|
903
903
|
let l = s[u];
|
|
904
|
-
r.set(l,
|
|
904
|
+
r.set(l, h), h += l.length;
|
|
905
905
|
}
|
|
906
906
|
return r;
|
|
907
907
|
};
|
|
@@ -919,11 +919,11 @@ _utf8len[254] = _utf8len[254] = 1;
|
|
|
919
919
|
strings$1.string2buf = (s) => {
|
|
920
920
|
if (typeof TextEncoder == "function" && TextEncoder.prototype.encode)
|
|
921
921
|
return new TextEncoder().encode(s);
|
|
922
|
-
let i, r, u,
|
|
923
|
-
for (
|
|
924
|
-
r = s.charCodeAt(
|
|
925
|
-
for (i = new Uint8Array(c), o = 0,
|
|
926
|
-
r = s.charCodeAt(
|
|
922
|
+
let i, r, u, h, o, l = s.length, c = 0;
|
|
923
|
+
for (h = 0; h < l; h++)
|
|
924
|
+
r = s.charCodeAt(h), (r & 64512) === 55296 && h + 1 < l && (u = s.charCodeAt(h + 1), (u & 64512) === 56320 && (r = 65536 + (r - 55296 << 10) + (u - 56320), h++)), c += r < 128 ? 1 : r < 2048 ? 2 : r < 65536 ? 3 : 4;
|
|
925
|
+
for (i = new Uint8Array(c), o = 0, h = 0; o < c; h++)
|
|
926
|
+
r = s.charCodeAt(h), (r & 64512) === 55296 && h + 1 < l && (u = s.charCodeAt(h + 1), (u & 64512) === 56320 && (r = 65536 + (r - 55296 << 10) + (u - 56320), h++)), r < 128 ? i[o++] = r : r < 2048 ? (i[o++] = 192 | r >>> 6, i[o++] = 128 | r & 63) : r < 65536 ? (i[o++] = 224 | r >>> 12, i[o++] = 128 | r >>> 6 & 63, i[o++] = 128 | r & 63) : (i[o++] = 240 | r >>> 18, i[o++] = 128 | r >>> 12 & 63, i[o++] = 128 | r >>> 6 & 63, i[o++] = 128 | r & 63);
|
|
927
927
|
return i;
|
|
928
928
|
};
|
|
929
929
|
const buf2binstring = (s, i) => {
|
|
@@ -938,28 +938,28 @@ strings$1.buf2string = (s, i) => {
|
|
|
938
938
|
const r = i || s.length;
|
|
939
939
|
if (typeof TextDecoder == "function" && TextDecoder.prototype.decode)
|
|
940
940
|
return new TextDecoder().decode(s.subarray(0, i));
|
|
941
|
-
let u,
|
|
941
|
+
let u, h;
|
|
942
942
|
const o = new Array(r * 2);
|
|
943
|
-
for (
|
|
943
|
+
for (h = 0, u = 0; u < r; ) {
|
|
944
944
|
let l = s[u++];
|
|
945
945
|
if (l < 128) {
|
|
946
|
-
o[
|
|
946
|
+
o[h++] = l;
|
|
947
947
|
continue;
|
|
948
948
|
}
|
|
949
949
|
let c = _utf8len[l];
|
|
950
950
|
if (c > 4) {
|
|
951
|
-
o[
|
|
951
|
+
o[h++] = 65533, u += c - 1;
|
|
952
952
|
continue;
|
|
953
953
|
}
|
|
954
954
|
for (l &= c === 2 ? 31 : c === 3 ? 15 : 7; c > 1 && u < r; )
|
|
955
955
|
l = l << 6 | s[u++] & 63, c--;
|
|
956
956
|
if (c > 1) {
|
|
957
|
-
o[
|
|
957
|
+
o[h++] = 65533;
|
|
958
958
|
continue;
|
|
959
959
|
}
|
|
960
|
-
l < 65536 ? o[
|
|
960
|
+
l < 65536 ? o[h++] = l : (l -= 65536, o[h++] = 55296 | l >> 10 & 1023, o[h++] = 56320 | l & 1023);
|
|
961
961
|
}
|
|
962
|
-
return buf2binstring(o,
|
|
962
|
+
return buf2binstring(o, h);
|
|
963
963
|
};
|
|
964
964
|
strings$1.utf8border = (s, i) => {
|
|
965
965
|
i = i || s.length, i > s.length && (i = s.length);
|
|
@@ -1023,11 +1023,11 @@ function Inflate(s) {
|
|
|
1023
1023
|
throw new Error(msg[r]);
|
|
1024
1024
|
}
|
|
1025
1025
|
Inflate.prototype.push = function(s, i) {
|
|
1026
|
-
const r = this.strm, u = this.options.chunkSize,
|
|
1026
|
+
const r = this.strm, u = this.options.chunkSize, h = this.options.dictionary;
|
|
1027
1027
|
let o, l, c;
|
|
1028
1028
|
if (this.ended) return !1;
|
|
1029
1029
|
for (i === ~~i ? l = i : l = i === !0 ? Z_FINISH : Z_NO_FLUSH, toString.call(s) === "[object ArrayBuffer]" ? r.input = new Uint8Array(s) : r.input = s, r.next_in = 0, r.avail_in = r.input.length; ; ) {
|
|
1030
|
-
for (r.avail_out === 0 && (r.output = new Uint8Array(u), r.next_out = 0, r.avail_out = u), o = zlib_inflate.inflate(r, l), o === Z_NEED_DICT &&
|
|
1030
|
+
for (r.avail_out === 0 && (r.output = new Uint8Array(u), r.next_out = 0, r.avail_out = u), o = zlib_inflate.inflate(r, l), o === Z_NEED_DICT && h && (o = zlib_inflate.inflateSetDictionary(r, h), o === Z_OK ? o = zlib_inflate.inflate(r, l) : o === Z_DATA_ERROR && (o = Z_NEED_DICT)); r.avail_in > 0 && o === Z_STREAM_END && r.state.wrap > 0 && s[r.next_in] !== 0; )
|
|
1031
1031
|
zlib_inflate.inflateReset(r), o = zlib_inflate.inflate(r, l);
|
|
1032
1032
|
switch (o) {
|
|
1033
1033
|
case Z_STREAM_ERROR:
|
|
@@ -1038,8 +1038,8 @@ Inflate.prototype.push = function(s, i) {
|
|
|
1038
1038
|
}
|
|
1039
1039
|
if (c = r.avail_out, r.next_out && (r.avail_out === 0 || o === Z_STREAM_END))
|
|
1040
1040
|
if (this.options.to === "string") {
|
|
1041
|
-
let d = strings.utf8border(r.output, r.next_out), a = r.next_out - d,
|
|
1042
|
-
r.next_out = a, r.avail_out = u - a, a && r.output.set(r.output.subarray(d, d + a), 0), this.onData(
|
|
1041
|
+
let d = strings.utf8border(r.output, r.next_out), a = r.next_out - d, m = strings.buf2string(r.output, d);
|
|
1042
|
+
r.next_out = a, r.avail_out = u - a, a && r.output.set(r.output.subarray(d, d + a), 0), this.onData(m);
|
|
1043
1043
|
} else
|
|
1044
1044
|
this.onData(
|
|
1045
1045
|
r.output.length === r.next_out ? r.output : r.output.subarray(0, r.next_out)
|
|
@@ -1064,8 +1064,8 @@ function inflate(s, i) {
|
|
|
1064
1064
|
return r.result;
|
|
1065
1065
|
}
|
|
1066
1066
|
var inflate_2 = inflate;
|
|
1067
|
-
function f(s, i, r, u,
|
|
1068
|
-
let l = s.tileXYToRectangle(r, u,
|
|
1067
|
+
function f(s, i, r, u, h, o) {
|
|
1068
|
+
let l = s.tileXYToRectangle(r, u, h);
|
|
1069
1069
|
return defined(Rectangle$1.intersection(l, i, o));
|
|
1070
1070
|
}
|
|
1071
1071
|
class GeoTerrainProvider {
|
|
@@ -1113,7 +1113,7 @@ class GeoTerrainProvider {
|
|
|
1113
1113
|
this._tilingScheme.getNumberOfXTilesAtLevel(0)
|
|
1114
1114
|
), this._ready = !0, this._topLevel = i.topLevel ?? 5, this._bottomLevel = i.bottomLevel ?? 25;
|
|
1115
1115
|
}
|
|
1116
|
-
requestTileGeometry(i, r, u,
|
|
1116
|
+
requestTileGeometry(i, r, u, h) {
|
|
1117
1117
|
if (!this.ready)
|
|
1118
1118
|
throw new DeveloperError("requestTileGeometry must not be called before ready returns true.");
|
|
1119
1119
|
if (u >= this._bottomLevel) return Promise.reject(`${u}该级别不发送请求!`);
|
|
@@ -1131,7 +1131,7 @@ class GeoTerrainProvider {
|
|
|
1131
1131
|
Array.isArray(this._subdomains) && this._subdomains.length && (o = this._subdomains[(i + r) % this._subdomains.length], l = l.replace("{s}", o)), l = l.replace("{token}", this._token).replace("{x}", i).replace("{y}", r).replace("{z}", u + 1);
|
|
1132
1132
|
const c = Resource.fetchArrayBuffer({
|
|
1133
1133
|
url: l,
|
|
1134
|
-
request:
|
|
1134
|
+
request: h
|
|
1135
1135
|
});
|
|
1136
1136
|
if (c)
|
|
1137
1137
|
return c.then((d) => d.byteLength < 1e3 ? Promise.reject("无效数据") : inflate_2(d)).then((d) => {
|
|
@@ -1158,11 +1158,11 @@ class GeoTerrainProvider {
|
|
|
1158
1158
|
this._dataType === "int" ? r = 2 : this._dataType === "float" && (r = 4);
|
|
1159
1159
|
let u = i;
|
|
1160
1160
|
if (u.length !== 22500 * r) return null;
|
|
1161
|
-
let
|
|
1162
|
-
for (let
|
|
1163
|
-
for (let v = 0; v <
|
|
1164
|
-
l = parseInt(149 *
|
|
1165
|
-
let b = (
|
|
1161
|
+
let h, o, l, c, d = new ArrayBuffer(r), a = new DataView(d), m = this._heightmapWidth, y = this._heightmapHeight, g = new Uint8Array(m * y * 4);
|
|
1162
|
+
for (let p = 0; p < y; p++)
|
|
1163
|
+
for (let v = 0; v < m; v++) {
|
|
1164
|
+
l = parseInt(149 * p / (y - 1)), c = parseInt(149 * v / (m - 1)), o = r * (150 * l + c), r === 4 ? (a.setInt8(0, u[o]), a.setInt8(1, u[o + 1]), a.setInt8(2, u[o + 2]), a.setInt8(3, u[o + 3]), h = a.getFloat32(0, !0)) : h = u[o] + 256 * u[o + 1], (1e4 < h || h < -2e3) && (h = 0);
|
|
1165
|
+
let b = (h + 1e3) / 1e-3, _ = 4 * (p * m + v);
|
|
1166
1166
|
g[_] = b / 65536, g[1 + _] = (b - 256 * g[_] * 256) / 256, g[2 + _] = b - 256 * g[_] * 256 - 256 * g[1 + _], g[3 + _] = 255;
|
|
1167
1167
|
}
|
|
1168
1168
|
return g;
|
|
@@ -1178,12 +1178,12 @@ class GeoTerrainProvider {
|
|
|
1178
1178
|
return i;
|
|
1179
1179
|
}
|
|
1180
1180
|
getChildTileMask(i, r, u) {
|
|
1181
|
-
let
|
|
1181
|
+
let h = new Rectangle$1(), o = this._tilingScheme, l = this._rectangles, c = o.tileXYToRectangle(i, r, u), d = 0;
|
|
1182
1182
|
for (let a = 0; a < l.length && d !== 15; ++a) {
|
|
1183
|
-
let
|
|
1184
|
-
if (!(
|
|
1185
|
-
let y =
|
|
1186
|
-
defined(g) && (f(o, y, 2 * i, 2 * r, u + 1,
|
|
1183
|
+
let m = l[a];
|
|
1184
|
+
if (!(m.maxLevel <= u)) {
|
|
1185
|
+
let y = m.rectangle, g = Rectangle$1.intersection(y, c, h);
|
|
1186
|
+
defined(g) && (f(o, y, 2 * i, 2 * r, u + 1, h) && (d |= 4), f(o, y, 2 * i + 1, 2 * r, u + 1, h) && (d |= 8), f(o, y, 2 * i, 2 * r + 1, u + 1, h) && (d |= 1), f(o, y, 2 * i + 1, 2 * r + 1, u + 1, h) && (d |= 2));
|
|
1187
1187
|
}
|
|
1188
1188
|
}
|
|
1189
1189
|
return d;
|
|
@@ -1194,20 +1194,20 @@ function requireAspromise() {
|
|
|
1194
1194
|
if (hasRequiredAspromise) return aspromise;
|
|
1195
1195
|
hasRequiredAspromise = 1, aspromise = s;
|
|
1196
1196
|
function s(i, r) {
|
|
1197
|
-
for (var u = new Array(arguments.length - 1),
|
|
1197
|
+
for (var u = new Array(arguments.length - 1), h = 0, o = 2, l = !0; o < arguments.length; ) u[h++] = arguments[o++];
|
|
1198
1198
|
return new Promise(function(d, a) {
|
|
1199
|
-
u[
|
|
1199
|
+
u[h] = function(y) {
|
|
1200
1200
|
if (l)
|
|
1201
1201
|
if (l = !1, y) a(y);
|
|
1202
1202
|
else {
|
|
1203
|
-
for (var g = new Array(arguments.length - 1),
|
|
1203
|
+
for (var g = new Array(arguments.length - 1), p = 0; p < g.length; ) g[p++] = arguments[p];
|
|
1204
1204
|
d.apply(null, g);
|
|
1205
1205
|
}
|
|
1206
1206
|
};
|
|
1207
1207
|
try {
|
|
1208
1208
|
i.apply(r || null, u);
|
|
1209
|
-
} catch (
|
|
1210
|
-
l && (l = !1, a(
|
|
1209
|
+
} catch (m) {
|
|
1210
|
+
l && (l = !1, a(m));
|
|
1211
1211
|
}
|
|
1212
1212
|
});
|
|
1213
1213
|
}
|
|
@@ -1223,30 +1223,30 @@ function requireBase64() {
|
|
|
1223
1223
|
for (var a = 0; --d % 4 > 1 && c.charAt(d) === "="; ) ++a;
|
|
1224
1224
|
return Math.ceil(c.length * 3) / 4 - a;
|
|
1225
1225
|
};
|
|
1226
|
-
for (var r = new Array(64), u = new Array(123),
|
|
1227
|
-
u[r[
|
|
1226
|
+
for (var r = new Array(64), u = new Array(123), h = 0; h < 64; )
|
|
1227
|
+
u[r[h] = h < 26 ? h + 65 : h < 52 ? h + 71 : h < 62 ? h - 4 : h - 59 | 43] = h++;
|
|
1228
1228
|
i.encode = function(c, d, a) {
|
|
1229
|
-
for (var
|
|
1229
|
+
for (var m = null, y = [], g = 0, p = 0, v; d < a; ) {
|
|
1230
1230
|
var b = c[d++];
|
|
1231
|
-
switch (
|
|
1231
|
+
switch (p) {
|
|
1232
1232
|
case 0:
|
|
1233
|
-
y[g++] = r[b >> 2], v = (b & 3) << 4,
|
|
1233
|
+
y[g++] = r[b >> 2], v = (b & 3) << 4, p = 1;
|
|
1234
1234
|
break;
|
|
1235
1235
|
case 1:
|
|
1236
|
-
y[g++] = r[v | b >> 4], v = (b & 15) << 2,
|
|
1236
|
+
y[g++] = r[v | b >> 4], v = (b & 15) << 2, p = 2;
|
|
1237
1237
|
break;
|
|
1238
1238
|
case 2:
|
|
1239
|
-
y[g++] = r[v | b >> 6], y[g++] = r[b & 63],
|
|
1239
|
+
y[g++] = r[v | b >> 6], y[g++] = r[b & 63], p = 0;
|
|
1240
1240
|
break;
|
|
1241
1241
|
}
|
|
1242
|
-
g > 8191 && ((
|
|
1242
|
+
g > 8191 && ((m || (m = [])).push(String.fromCharCode.apply(String, y)), g = 0);
|
|
1243
1243
|
}
|
|
1244
|
-
return
|
|
1244
|
+
return p && (y[g++] = r[v], y[g++] = 61, p === 1 && (y[g++] = 61)), m ? (g && m.push(String.fromCharCode.apply(String, y.slice(0, g))), m.join("")) : String.fromCharCode.apply(String, y.slice(0, g));
|
|
1245
1245
|
};
|
|
1246
1246
|
var o = "invalid encoding";
|
|
1247
1247
|
i.decode = function(c, d, a) {
|
|
1248
|
-
for (var
|
|
1249
|
-
var v = c.charCodeAt(
|
|
1248
|
+
for (var m = a, y = 0, g, p = 0; p < c.length; ) {
|
|
1249
|
+
var v = c.charCodeAt(p++);
|
|
1250
1250
|
if (v === 61 && y > 1) break;
|
|
1251
1251
|
if ((v = u[v]) === void 0) throw Error(o);
|
|
1252
1252
|
switch (y) {
|
|
@@ -1265,7 +1265,7 @@ function requireBase64() {
|
|
|
1265
1265
|
}
|
|
1266
1266
|
}
|
|
1267
1267
|
if (y === 1) throw Error(o);
|
|
1268
|
-
return a -
|
|
1268
|
+
return a - m;
|
|
1269
1269
|
}, i.test = function(c) {
|
|
1270
1270
|
return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(c);
|
|
1271
1271
|
};
|
|
@@ -1278,23 +1278,23 @@ function requireEventemitter() {
|
|
|
1278
1278
|
function s() {
|
|
1279
1279
|
this._listeners = {};
|
|
1280
1280
|
}
|
|
1281
|
-
return s.prototype.on = function(r, u,
|
|
1281
|
+
return s.prototype.on = function(r, u, h) {
|
|
1282
1282
|
return (this._listeners[r] || (this._listeners[r] = [])).push({
|
|
1283
1283
|
fn: u,
|
|
1284
|
-
ctx:
|
|
1284
|
+
ctx: h || this
|
|
1285
1285
|
}), this;
|
|
1286
1286
|
}, s.prototype.off = function(r, u) {
|
|
1287
1287
|
if (r === void 0) this._listeners = {};
|
|
1288
1288
|
else if (u === void 0) this._listeners[r] = [];
|
|
1289
1289
|
else
|
|
1290
|
-
for (var
|
|
1291
|
-
|
|
1290
|
+
for (var h = this._listeners[r], o = 0; o < h.length; )
|
|
1291
|
+
h[o].fn === u ? h.splice(o, 1) : ++o;
|
|
1292
1292
|
return this;
|
|
1293
1293
|
}, s.prototype.emit = function(r) {
|
|
1294
1294
|
var u = this._listeners[r];
|
|
1295
1295
|
if (u) {
|
|
1296
|
-
for (var
|
|
1297
|
-
for (o = 0; o < u.length; ) u[o].fn.apply(u[o++].ctx,
|
|
1296
|
+
for (var h = [], o = 1; o < arguments.length; ) h.push(arguments[o++]);
|
|
1297
|
+
for (o = 0; o < u.length; ) u[o].fn.apply(u[o++].ctx, h);
|
|
1298
1298
|
}
|
|
1299
1299
|
return this;
|
|
1300
1300
|
}, eventemitter;
|
|
@@ -1306,22 +1306,22 @@ function requireFloat() {
|
|
|
1306
1306
|
function s(o) {
|
|
1307
1307
|
return typeof Float32Array < "u" ? function() {
|
|
1308
1308
|
var l = new Float32Array([-0]), c = new Uint8Array(l.buffer), d = c[3] === 128;
|
|
1309
|
-
function a(
|
|
1310
|
-
l[0] =
|
|
1309
|
+
function a(p, v, b) {
|
|
1310
|
+
l[0] = p, v[b] = c[0], v[b + 1] = c[1], v[b + 2] = c[2], v[b + 3] = c[3];
|
|
1311
1311
|
}
|
|
1312
|
-
function p
|
|
1313
|
-
l[0] =
|
|
1312
|
+
function m(p, v, b) {
|
|
1313
|
+
l[0] = p, v[b] = c[3], v[b + 1] = c[2], v[b + 2] = c[1], v[b + 3] = c[0];
|
|
1314
1314
|
}
|
|
1315
|
-
o.writeFloatLE = d ? a :
|
|
1316
|
-
function y(
|
|
1317
|
-
return c[0] =
|
|
1315
|
+
o.writeFloatLE = d ? a : m, o.writeFloatBE = d ? m : a;
|
|
1316
|
+
function y(p, v) {
|
|
1317
|
+
return c[0] = p[v], c[1] = p[v + 1], c[2] = p[v + 2], c[3] = p[v + 3], l[0];
|
|
1318
1318
|
}
|
|
1319
|
-
function g(
|
|
1320
|
-
return c[3] =
|
|
1319
|
+
function g(p, v) {
|
|
1320
|
+
return c[3] = p[v], c[2] = p[v + 1], c[1] = p[v + 2], c[0] = p[v + 3], l[0];
|
|
1321
1321
|
}
|
|
1322
1322
|
o.readFloatLE = d ? y : g, o.readFloatBE = d ? g : y;
|
|
1323
1323
|
}() : function() {
|
|
1324
|
-
function l(d, a,
|
|
1324
|
+
function l(d, a, m, y) {
|
|
1325
1325
|
var g = a < 0 ? 1 : 0;
|
|
1326
1326
|
if (g && (a = -a), a === 0)
|
|
1327
1327
|
d(1 / a > 0 ? (
|
|
@@ -1330,74 +1330,74 @@ function requireFloat() {
|
|
|
1330
1330
|
) : (
|
|
1331
1331
|
/* negative 0 */
|
|
1332
1332
|
2147483648
|
|
1333
|
-
),
|
|
1334
|
-
else if (isNaN(a)) d(2143289344,
|
|
1333
|
+
), m, y);
|
|
1334
|
+
else if (isNaN(a)) d(2143289344, m, y);
|
|
1335
1335
|
else if (a > 34028234663852886e22)
|
|
1336
|
-
d((g << 31 | 2139095040) >>> 0,
|
|
1336
|
+
d((g << 31 | 2139095040) >>> 0, m, y);
|
|
1337
1337
|
else if (a < 11754943508222875e-54)
|
|
1338
|
-
d((g << 31 | Math.round(a / 1401298464324817e-60)) >>> 0,
|
|
1338
|
+
d((g << 31 | Math.round(a / 1401298464324817e-60)) >>> 0, m, y);
|
|
1339
1339
|
else {
|
|
1340
|
-
var
|
|
1341
|
-
d((g << 31 |
|
|
1340
|
+
var p = Math.floor(Math.log(a) / Math.LN2), v = Math.round(a * Math.pow(2, -p) * 8388608) & 8388607;
|
|
1341
|
+
d((g << 31 | p + 127 << 23 | v) >>> 0, m, y);
|
|
1342
1342
|
}
|
|
1343
1343
|
}
|
|
1344
1344
|
o.writeFloatLE = l.bind(null, i), o.writeFloatBE = l.bind(null, r);
|
|
1345
|
-
function c(d, a,
|
|
1346
|
-
var y = d(a,
|
|
1347
|
-
return
|
|
1345
|
+
function c(d, a, m) {
|
|
1346
|
+
var y = d(a, m), g = (y >> 31) * 2 + 1, p = y >>> 23 & 255, v = y & 8388607;
|
|
1347
|
+
return p === 255 ? v ? NaN : g * (1 / 0) : p === 0 ? g * 1401298464324817e-60 * v : g * Math.pow(2, p - 150) * (v + 8388608);
|
|
1348
1348
|
}
|
|
1349
|
-
o.readFloatLE = c.bind(null, u), o.readFloatBE = c.bind(null,
|
|
1349
|
+
o.readFloatLE = c.bind(null, u), o.readFloatBE = c.bind(null, h);
|
|
1350
1350
|
}(), typeof Float64Array < "u" ? function() {
|
|
1351
1351
|
var l = new Float64Array([-0]), c = new Uint8Array(l.buffer), d = c[7] === 128;
|
|
1352
|
-
function a(
|
|
1353
|
-
l[0] =
|
|
1352
|
+
function a(p, v, b) {
|
|
1353
|
+
l[0] = p, v[b] = c[0], v[b + 1] = c[1], v[b + 2] = c[2], v[b + 3] = c[3], v[b + 4] = c[4], v[b + 5] = c[5], v[b + 6] = c[6], v[b + 7] = c[7];
|
|
1354
1354
|
}
|
|
1355
|
-
function p
|
|
1356
|
-
l[0] =
|
|
1355
|
+
function m(p, v, b) {
|
|
1356
|
+
l[0] = p, v[b] = c[7], v[b + 1] = c[6], v[b + 2] = c[5], v[b + 3] = c[4], v[b + 4] = c[3], v[b + 5] = c[2], v[b + 6] = c[1], v[b + 7] = c[0];
|
|
1357
1357
|
}
|
|
1358
|
-
o.writeDoubleLE = d ? a :
|
|
1359
|
-
function y(
|
|
1360
|
-
return c[0] =
|
|
1358
|
+
o.writeDoubleLE = d ? a : m, o.writeDoubleBE = d ? m : a;
|
|
1359
|
+
function y(p, v) {
|
|
1360
|
+
return c[0] = p[v], c[1] = p[v + 1], c[2] = p[v + 2], c[3] = p[v + 3], c[4] = p[v + 4], c[5] = p[v + 5], c[6] = p[v + 6], c[7] = p[v + 7], l[0];
|
|
1361
1361
|
}
|
|
1362
|
-
function g(
|
|
1363
|
-
return c[7] =
|
|
1362
|
+
function g(p, v) {
|
|
1363
|
+
return c[7] = p[v], c[6] = p[v + 1], c[5] = p[v + 2], c[4] = p[v + 3], c[3] = p[v + 4], c[2] = p[v + 5], c[1] = p[v + 6], c[0] = p[v + 7], l[0];
|
|
1364
1364
|
}
|
|
1365
1365
|
o.readDoubleLE = d ? y : g, o.readDoubleBE = d ? g : y;
|
|
1366
1366
|
}() : function() {
|
|
1367
|
-
function l(d, a,
|
|
1367
|
+
function l(d, a, m, y, g, p) {
|
|
1368
1368
|
var v = y < 0 ? 1 : 0;
|
|
1369
1369
|
if (v && (y = -y), y === 0)
|
|
1370
|
-
d(0, g,
|
|
1370
|
+
d(0, g, p + a), d(1 / y > 0 ? (
|
|
1371
1371
|
/* positive */
|
|
1372
1372
|
0
|
|
1373
1373
|
) : (
|
|
1374
1374
|
/* negative 0 */
|
|
1375
1375
|
2147483648
|
|
1376
|
-
), g,
|
|
1376
|
+
), g, p + m);
|
|
1377
1377
|
else if (isNaN(y))
|
|
1378
|
-
d(0, g,
|
|
1378
|
+
d(0, g, p + a), d(2146959360, g, p + m);
|
|
1379
1379
|
else if (y > 17976931348623157e292)
|
|
1380
|
-
d(0, g,
|
|
1380
|
+
d(0, g, p + a), d((v << 31 | 2146435072) >>> 0, g, p + m);
|
|
1381
1381
|
else {
|
|
1382
1382
|
var b;
|
|
1383
1383
|
if (y < 22250738585072014e-324)
|
|
1384
|
-
b = y / 5e-324, d(b >>> 0, g,
|
|
1384
|
+
b = y / 5e-324, d(b >>> 0, g, p + a), d((v << 31 | b / 4294967296) >>> 0, g, p + m);
|
|
1385
1385
|
else {
|
|
1386
1386
|
var _ = Math.floor(Math.log(y) / Math.LN2);
|
|
1387
|
-
_ === 1024 && (_ = 1023), b = y * Math.pow(2, -_), d(b * 4503599627370496 >>> 0, g,
|
|
1387
|
+
_ === 1024 && (_ = 1023), b = y * Math.pow(2, -_), d(b * 4503599627370496 >>> 0, g, p + a), d(
|
|
1388
1388
|
(v << 31 | _ + 1023 << 20 | b * 1048576 & 1048575) >>> 0,
|
|
1389
1389
|
g,
|
|
1390
|
-
|
|
1390
|
+
p + m
|
|
1391
1391
|
);
|
|
1392
1392
|
}
|
|
1393
1393
|
}
|
|
1394
1394
|
}
|
|
1395
1395
|
o.writeDoubleLE = l.bind(null, i, 0, 4), o.writeDoubleBE = l.bind(null, r, 4, 0);
|
|
1396
|
-
function c(d, a,
|
|
1397
|
-
var
|
|
1396
|
+
function c(d, a, m, y, g) {
|
|
1397
|
+
var p = d(y, g + a), v = d(y, g + m), b = (v >> 31) * 2 + 1, _ = v >>> 20 & 2047, T = 4294967296 * (v & 1048575) + p;
|
|
1398
1398
|
return _ === 2047 ? T ? NaN : b * (1 / 0) : _ === 0 ? b * 5e-324 * T : b * Math.pow(2, _ - 1075) * (T + 4503599627370496);
|
|
1399
1399
|
}
|
|
1400
|
-
o.readDoubleLE = c.bind(null, u, 0, 4), o.readDoubleBE = c.bind(null,
|
|
1400
|
+
o.readDoubleLE = c.bind(null, u, 0, 4), o.readDoubleBE = c.bind(null, h, 4, 0);
|
|
1401
1401
|
}(), o;
|
|
1402
1402
|
}
|
|
1403
1403
|
function i(o, l, c) {
|
|
@@ -1409,7 +1409,7 @@ function requireFloat() {
|
|
|
1409
1409
|
function u(o, l) {
|
|
1410
1410
|
return (o[l] | o[l + 1] << 8 | o[l + 2] << 16 | o[l + 3] << 24) >>> 0;
|
|
1411
1411
|
}
|
|
1412
|
-
function
|
|
1412
|
+
function h(o, l) {
|
|
1413
1413
|
return (o[l] << 24 | o[l + 1] << 16 | o[l + 2] << 8 | o[l + 3]) >>> 0;
|
|
1414
1414
|
}
|
|
1415
1415
|
return float;
|
|
@@ -1433,18 +1433,18 @@ function requireUtf8() {
|
|
|
1433
1433
|
return hasRequiredUtf8 || (hasRequiredUtf8 = 1, function(s) {
|
|
1434
1434
|
var i = s;
|
|
1435
1435
|
i.length = function(u) {
|
|
1436
|
-
for (var
|
|
1437
|
-
o = u.charCodeAt(l), o < 128 ?
|
|
1438
|
-
return
|
|
1439
|
-
}, i.read = function(u,
|
|
1440
|
-
var l = o -
|
|
1436
|
+
for (var h = 0, o = 0, l = 0; l < u.length; ++l)
|
|
1437
|
+
o = u.charCodeAt(l), o < 128 ? h += 1 : o < 2048 ? h += 2 : (o & 64512) === 55296 && (u.charCodeAt(l + 1) & 64512) === 56320 ? (++l, h += 4) : h += 3;
|
|
1438
|
+
return h;
|
|
1439
|
+
}, i.read = function(u, h, o) {
|
|
1440
|
+
var l = o - h;
|
|
1441
1441
|
if (l < 1) return "";
|
|
1442
|
-
for (var c = null, d = [], a = 0,
|
|
1443
|
-
|
|
1442
|
+
for (var c = null, d = [], a = 0, m; h < o; )
|
|
1443
|
+
m = u[h++], m < 128 ? d[a++] = m : m > 191 && m < 224 ? d[a++] = (m & 31) << 6 | u[h++] & 63 : m > 239 && m < 365 ? (m = ((m & 7) << 18 | (u[h++] & 63) << 12 | (u[h++] & 63) << 6 | u[h++] & 63) - 65536, d[a++] = 55296 + (m >> 10), d[a++] = 56320 + (m & 1023)) : d[a++] = (m & 15) << 12 | (u[h++] & 63) << 6 | u[h++] & 63, a > 8191 && ((c || (c = [])).push(String.fromCharCode.apply(String, d)), a = 0);
|
|
1444
1444
|
return c ? (a && c.push(String.fromCharCode.apply(String, d.slice(0, a))), c.join("")) : String.fromCharCode.apply(String, d.slice(0, a));
|
|
1445
|
-
}, i.write = function(u,
|
|
1445
|
+
}, i.write = function(u, h, o) {
|
|
1446
1446
|
for (var l = o, c, d, a = 0; a < u.length; ++a)
|
|
1447
|
-
c = u.charCodeAt(a), c < 128 ?
|
|
1447
|
+
c = u.charCodeAt(a), c < 128 ? h[o++] = c : c < 2048 ? (h[o++] = c >> 6 | 192, h[o++] = c & 63 | 128) : (c & 64512) === 55296 && ((d = u.charCodeAt(a + 1)) & 64512) === 56320 ? (c = 65536 + ((c & 1023) << 10) + (d & 1023), ++a, h[o++] = c >> 18 | 240, h[o++] = c >> 12 & 63 | 128, h[o++] = c >> 6 & 63 | 128, h[o++] = c & 63 | 128) : (h[o++] = c >> 12 | 224, h[o++] = c >> 6 & 63 | 128, h[o++] = c & 63 | 128);
|
|
1448
1448
|
return o - l;
|
|
1449
1449
|
};
|
|
1450
1450
|
}(utf8$2)), utf8$2;
|
|
@@ -1454,12 +1454,12 @@ function requirePool() {
|
|
|
1454
1454
|
if (hasRequiredPool) return pool_1;
|
|
1455
1455
|
hasRequiredPool = 1, pool_1 = s;
|
|
1456
1456
|
function s(i, r, u) {
|
|
1457
|
-
var
|
|
1457
|
+
var h = u || 8192, o = h >>> 1, l = null, c = h;
|
|
1458
1458
|
return function(a) {
|
|
1459
1459
|
if (a < 1 || a > o) return i(a);
|
|
1460
|
-
c + a >
|
|
1461
|
-
var
|
|
1462
|
-
return c & 7 && (c = (c | 7) + 1),
|
|
1460
|
+
c + a > h && (l = i(h), c = 0);
|
|
1461
|
+
var m = r.call(l, c, c += a);
|
|
1462
|
+
return c & 7 && (c = (c | 7) + 1), m;
|
|
1463
1463
|
};
|
|
1464
1464
|
}
|
|
1465
1465
|
return pool_1;
|
|
@@ -1509,11 +1509,11 @@ function requireLongbits() {
|
|
|
1509
1509
|
}
|
|
1510
1510
|
);
|
|
1511
1511
|
};
|
|
1512
|
-
var
|
|
1512
|
+
var h = String.prototype.charCodeAt;
|
|
1513
1513
|
return i.fromHash = function(l) {
|
|
1514
1514
|
return l === u ? r : new i(
|
|
1515
|
-
(
|
|
1516
|
-
(
|
|
1515
|
+
(h.call(l, 0) | h.call(l, 1) << 8 | h.call(l, 2) << 16 | h.call(l, 3) << 24) >>> 0,
|
|
1516
|
+
(h.call(l, 4) | h.call(l, 5) << 8 | h.call(l, 6) << 16 | h.call(l, 7) << 24) >>> 0
|
|
1517
1517
|
);
|
|
1518
1518
|
}, i.prototype.toHash = function() {
|
|
1519
1519
|
return String.fromCharCode(
|
|
@@ -1565,8 +1565,8 @@ function requireMinimal() {
|
|
|
1565
1565
|
return c != null && o.hasOwnProperty(l) ? typeof c != "object" || (Array.isArray(c) ? c.length : Object.keys(c).length) > 0 : !1;
|
|
1566
1566
|
}, i.Buffer = function() {
|
|
1567
1567
|
try {
|
|
1568
|
-
var
|
|
1569
|
-
return
|
|
1568
|
+
var h = i.inquire("buffer").Buffer;
|
|
1569
|
+
return h.prototype.utf8Write ? h : (
|
|
1570
1570
|
/* istanbul ignore next */
|
|
1571
1571
|
null
|
|
1572
1572
|
);
|
|
@@ -1584,15 +1584,15 @@ function requireMinimal() {
|
|
|
1584
1584
|
var c = i.LongBits.fromHash(o);
|
|
1585
1585
|
return i.Long ? i.Long.fromBits(c.lo, c.hi, l) : c.toNumber(!!l);
|
|
1586
1586
|
};
|
|
1587
|
-
function r(
|
|
1587
|
+
function r(h, o, l) {
|
|
1588
1588
|
for (var c = Object.keys(o), d = 0; d < c.length; ++d)
|
|
1589
|
-
(
|
|
1590
|
-
return
|
|
1589
|
+
(h[c[d]] === void 0 || !l) && (h[c[d]] = o[c[d]]);
|
|
1590
|
+
return h;
|
|
1591
1591
|
}
|
|
1592
1592
|
i.merge = r, i.lcFirst = function(o) {
|
|
1593
1593
|
return o.charAt(0).toLowerCase() + o.substring(1);
|
|
1594
1594
|
};
|
|
1595
|
-
function u(
|
|
1595
|
+
function u(h) {
|
|
1596
1596
|
function o(l, c) {
|
|
1597
1597
|
if (!(this instanceof o)) return new o(l, c);
|
|
1598
1598
|
Object.defineProperty(this, "message", {
|
|
@@ -1612,7 +1612,7 @@ function requireMinimal() {
|
|
|
1612
1612
|
},
|
|
1613
1613
|
name: {
|
|
1614
1614
|
get: function() {
|
|
1615
|
-
return
|
|
1615
|
+
return h;
|
|
1616
1616
|
},
|
|
1617
1617
|
set: void 0,
|
|
1618
1618
|
enumerable: !1,
|
|
@@ -1650,15 +1650,15 @@ function requireMinimal() {
|
|
|
1650
1650
|
bytes: String,
|
|
1651
1651
|
json: !0
|
|
1652
1652
|
}, i._configure = function() {
|
|
1653
|
-
var
|
|
1654
|
-
if (!
|
|
1653
|
+
var h = i.Buffer;
|
|
1654
|
+
if (!h) {
|
|
1655
1655
|
i._Buffer_from = i._Buffer_allocUnsafe = null;
|
|
1656
1656
|
return;
|
|
1657
1657
|
}
|
|
1658
|
-
i._Buffer_from =
|
|
1659
|
-
return new
|
|
1660
|
-
}, i._Buffer_allocUnsafe =
|
|
1661
|
-
return new
|
|
1658
|
+
i._Buffer_from = h.from !== Uint8Array.from && h.from || function(l, c) {
|
|
1659
|
+
return new h(l, c);
|
|
1660
|
+
}, i._Buffer_allocUnsafe = h.allocUnsafe || function(l) {
|
|
1661
|
+
return new h(l);
|
|
1662
1662
|
};
|
|
1663
1663
|
};
|
|
1664
1664
|
}(minimal)), minimal;
|
|
@@ -1762,7 +1762,7 @@ var writeBytes = util$7.Array.prototype.set ? function s(i, r, u) {
|
|
|
1762
1762
|
} : (
|
|
1763
1763
|
/* istanbul ignore next */
|
|
1764
1764
|
function s(i, r, u) {
|
|
1765
|
-
for (var
|
|
1765
|
+
for (var h = 0; h < i.length; ++h) r[u + h] = i[h];
|
|
1766
1766
|
}
|
|
1767
1767
|
);
|
|
1768
1768
|
Writer$1.prototype.bytes = function s(i) {
|
|
@@ -1811,8 +1811,8 @@ BufferWriter._configure = function() {
|
|
|
1811
1811
|
if (i.copy)
|
|
1812
1812
|
i.copy(r, u, 0, i.length);
|
|
1813
1813
|
else
|
|
1814
|
-
for (var
|
|
1815
|
-
r[u++] = i[
|
|
1814
|
+
for (var h = 0; h < i.length; )
|
|
1815
|
+
r[u++] = i[h++];
|
|
1816
1816
|
}
|
|
1817
1817
|
);
|
|
1818
1818
|
};
|
|
@@ -1849,10 +1849,10 @@ var create_array = typeof Uint8Array < "u" ? function s(i) {
|
|
|
1849
1849
|
}
|
|
1850
1850
|
), create = function s() {
|
|
1851
1851
|
return util$5.Buffer ? function(r) {
|
|
1852
|
-
return (Reader$1.create = function(
|
|
1853
|
-
return util$5.Buffer.isBuffer(
|
|
1852
|
+
return (Reader$1.create = function(h) {
|
|
1853
|
+
return util$5.Buffer.isBuffer(h) ? new BufferReader$1(h) : (
|
|
1854
1854
|
/* istanbul ignore next */
|
|
1855
|
-
create_array(
|
|
1855
|
+
create_array(h)
|
|
1856
1856
|
);
|
|
1857
1857
|
})(r);
|
|
1858
1858
|
} : (
|
|
@@ -1940,8 +1940,8 @@ Reader$1.prototype.bytes = function s() {
|
|
|
1940
1940
|
if (this.pos += i, Array.isArray(this.buf))
|
|
1941
1941
|
return this.buf.slice(r, u);
|
|
1942
1942
|
if (r === u) {
|
|
1943
|
-
var
|
|
1944
|
-
return
|
|
1943
|
+
var h = util$5.Buffer;
|
|
1944
|
+
return h ? h.alloc(0) : new this.buf.constructor(0);
|
|
1945
1945
|
}
|
|
1946
1946
|
return this._slice.call(this.buf, r, u);
|
|
1947
1947
|
};
|
|
@@ -2027,10 +2027,10 @@ function Service$1(s, i, r) {
|
|
|
2027
2027
|
if (typeof s != "function") throw TypeError("rpcImpl must be a function");
|
|
2028
2028
|
util$3.EventEmitter.call(this), this.rpcImpl = s, this.requestDelimited = !!i, this.responseDelimited = !!r;
|
|
2029
2029
|
}
|
|
2030
|
-
Service$1.prototype.rpcCall = function s(i, r, u,
|
|
2031
|
-
if (!
|
|
2030
|
+
Service$1.prototype.rpcCall = function s(i, r, u, h, o) {
|
|
2031
|
+
if (!h) throw TypeError("request must be specified");
|
|
2032
2032
|
var l = this;
|
|
2033
|
-
if (!o) return util$3.asPromise(s, l, i, r, u,
|
|
2033
|
+
if (!o) return util$3.asPromise(s, l, i, r, u, h);
|
|
2034
2034
|
if (!l.rpcImpl) {
|
|
2035
2035
|
setTimeout(function() {
|
|
2036
2036
|
o(Error("already ended"));
|
|
@@ -2040,7 +2040,7 @@ Service$1.prototype.rpcCall = function s(i, r, u, m, o) {
|
|
|
2040
2040
|
try {
|
|
2041
2041
|
return l.rpcImpl(
|
|
2042
2042
|
i,
|
|
2043
|
-
r[l.requestDelimited ? "encodeDelimited" : "encode"](
|
|
2043
|
+
r[l.requestDelimited ? "encodeDelimited" : "encode"](h).finish(),
|
|
2044
2044
|
function(d, a) {
|
|
2045
2045
|
if (d)
|
|
2046
2046
|
return l.emit("error", d, i), o(d);
|
|
@@ -2054,8 +2054,8 @@ Service$1.prototype.rpcCall = function s(i, r, u, m, o) {
|
|
|
2054
2054
|
if (!(a instanceof u))
|
|
2055
2055
|
try {
|
|
2056
2056
|
a = u[l.responseDelimited ? "decodeDelimited" : "decode"](a);
|
|
2057
|
-
} catch (
|
|
2058
|
-
return l.emit("error",
|
|
2057
|
+
} catch (m) {
|
|
2058
|
+
return l.emit("error", m, i), o(m);
|
|
2059
2059
|
}
|
|
2060
2060
|
return l.emit("data", a, i), o(null, a);
|
|
2061
2061
|
}
|
|
@@ -2089,11 +2089,11 @@ function codegen(s, i) {
|
|
|
2089
2089
|
var r = [];
|
|
2090
2090
|
function u(o) {
|
|
2091
2091
|
if (typeof o != "string") {
|
|
2092
|
-
var l =
|
|
2092
|
+
var l = h();
|
|
2093
2093
|
if (codegen.verbose && console.warn("codegen: " + l), l = "return " + l, o) {
|
|
2094
|
-
for (var c = Object.keys(o), d = new Array(c.length + 1), a = new Array(c.length),
|
|
2095
|
-
d[
|
|
2096
|
-
return d[
|
|
2094
|
+
for (var c = Object.keys(o), d = new Array(c.length + 1), a = new Array(c.length), m = 0; m < c.length; )
|
|
2095
|
+
d[m] = c[m], a[m] = o[c[m++]];
|
|
2096
|
+
return d[m] = l, Function.apply(null, d).apply(null, a);
|
|
2097
2097
|
}
|
|
2098
2098
|
return Function(l)();
|
|
2099
2099
|
}
|
|
@@ -2116,38 +2116,38 @@ function codegen(s, i) {
|
|
|
2116
2116
|
}), g !== y.length) throw Error("parameter count mismatch");
|
|
2117
2117
|
return r.push(o), u;
|
|
2118
2118
|
}
|
|
2119
|
-
function
|
|
2119
|
+
function h(o) {
|
|
2120
2120
|
return "function " + (o || i || "") + "(" + (s && s.join(",") || "") + `){
|
|
2121
2121
|
` + r.join(`
|
|
2122
2122
|
`) + `
|
|
2123
2123
|
}`;
|
|
2124
2124
|
}
|
|
2125
|
-
return u.toString =
|
|
2125
|
+
return u.toString = h, u;
|
|
2126
2126
|
}
|
|
2127
2127
|
codegen.verbose = !1;
|
|
2128
2128
|
var fetch_1 = fetch, asPromise = requireAspromise(), inquire = requireInquire(), fs = inquire("fs");
|
|
2129
2129
|
function fetch(s, i, r) {
|
|
2130
|
-
return typeof i == "function" ? (r = i, i = {}) : i || (i = {}), r ? !i.xhr && fs && fs.readFile ? fs.readFile(s, function(
|
|
2131
|
-
return
|
|
2130
|
+
return typeof i == "function" ? (r = i, i = {}) : i || (i = {}), r ? !i.xhr && fs && fs.readFile ? fs.readFile(s, function(h, o) {
|
|
2131
|
+
return h && typeof XMLHttpRequest < "u" ? fetch.xhr(s, i, r) : h ? r(h) : r(null, i.binary ? o : o.toString("utf8"));
|
|
2132
2132
|
}) : fetch.xhr(s, i, r) : asPromise(fetch, this, s, i);
|
|
2133
2133
|
}
|
|
2134
2134
|
fetch.xhr = function s(i, r, u) {
|
|
2135
|
-
var
|
|
2136
|
-
|
|
2137
|
-
if (
|
|
2138
|
-
if (
|
|
2135
|
+
var h = new XMLHttpRequest();
|
|
2136
|
+
h.onreadystatechange = function() {
|
|
2137
|
+
if (h.readyState === 4) {
|
|
2138
|
+
if (h.status !== 0 && h.status !== 200) return u(Error("status " + h.status));
|
|
2139
2139
|
if (r.binary) {
|
|
2140
|
-
var l =
|
|
2140
|
+
var l = h.response;
|
|
2141
2141
|
if (!l) {
|
|
2142
2142
|
l = [];
|
|
2143
|
-
for (var c = 0; c <
|
|
2144
|
-
l.push(
|
|
2143
|
+
for (var c = 0; c < h.responseText.length; ++c)
|
|
2144
|
+
l.push(h.responseText.charCodeAt(c) & 255);
|
|
2145
2145
|
}
|
|
2146
2146
|
return u(null, typeof Uint8Array < "u" ? new Uint8Array(l) : l);
|
|
2147
2147
|
}
|
|
2148
|
-
return u(null,
|
|
2148
|
+
return u(null, h.responseText);
|
|
2149
2149
|
}
|
|
2150
|
-
}, r.binary && ("overrideMimeType" in
|
|
2150
|
+
}, r.binary && ("overrideMimeType" in h && h.overrideMimeType("text/plain; charset=x-user-defined"), h.responseType = "arraybuffer"), h.open("GET", i), h.send();
|
|
2151
2151
|
};
|
|
2152
2152
|
var path = {};
|
|
2153
2153
|
(function(s) {
|
|
@@ -2214,12 +2214,12 @@ function requireTypes() {
|
|
|
2214
2214
|
"bytes"
|
|
2215
2215
|
// 14
|
|
2216
2216
|
];
|
|
2217
|
-
function
|
|
2217
|
+
function h(o, l) {
|
|
2218
2218
|
var c = 0, d = {};
|
|
2219
2219
|
for (l |= 0; c < o.length; ) d[u[c + l]] = o[c++];
|
|
2220
2220
|
return d;
|
|
2221
2221
|
}
|
|
2222
|
-
i.basic =
|
|
2222
|
+
i.basic = h([
|
|
2223
2223
|
/* double */
|
|
2224
2224
|
1,
|
|
2225
2225
|
/* float */
|
|
@@ -2250,7 +2250,7 @@ function requireTypes() {
|
|
|
2250
2250
|
2,
|
|
2251
2251
|
/* bytes */
|
|
2252
2252
|
2
|
|
2253
|
-
]), i.defaults =
|
|
2253
|
+
]), i.defaults = h([
|
|
2254
2254
|
/* double */
|
|
2255
2255
|
0,
|
|
2256
2256
|
/* float */
|
|
@@ -2283,7 +2283,7 @@ function requireTypes() {
|
|
|
2283
2283
|
r.emptyArray,
|
|
2284
2284
|
/* message */
|
|
2285
2285
|
null
|
|
2286
|
-
]), i.long =
|
|
2286
|
+
]), i.long = h(
|
|
2287
2287
|
[
|
|
2288
2288
|
/* int64 */
|
|
2289
2289
|
0,
|
|
@@ -2297,7 +2297,7 @@ function requireTypes() {
|
|
|
2297
2297
|
1
|
|
2298
2298
|
],
|
|
2299
2299
|
7
|
|
2300
|
-
), i.mapKey =
|
|
2300
|
+
), i.mapKey = h(
|
|
2301
2301
|
[
|
|
2302
2302
|
/* int32 */
|
|
2303
2303
|
0,
|
|
@@ -2325,7 +2325,7 @@ function requireTypes() {
|
|
|
2325
2325
|
2
|
|
2326
2326
|
],
|
|
2327
2327
|
2
|
|
2328
|
-
), i.packed =
|
|
2328
|
+
), i.packed = h([
|
|
2329
2329
|
/* double */
|
|
2330
2330
|
1,
|
|
2331
2331
|
/* float */
|
|
@@ -2361,27 +2361,27 @@ function requireField() {
|
|
|
2361
2361
|
hasRequiredField = 1, field = l;
|
|
2362
2362
|
var s = requireObject();
|
|
2363
2363
|
((l.prototype = Object.create(s.prototype)).constructor = l).className = "Field";
|
|
2364
|
-
var i = require_enum(), r = requireTypes(), u = requireUtil(),
|
|
2364
|
+
var i = require_enum(), r = requireTypes(), u = requireUtil(), h, o = /^required|optional|repeated$/;
|
|
2365
2365
|
l.fromJSON = function(d, a) {
|
|
2366
2366
|
return new l(d, a.id, a.type, a.rule, a.extend, a.options, a.comment);
|
|
2367
2367
|
};
|
|
2368
|
-
function l(c, d, a,
|
|
2369
|
-
if (u.isObject(
|
|
2368
|
+
function l(c, d, a, m, y, g, p) {
|
|
2369
|
+
if (u.isObject(m) ? (p = y, g = m, m = y = void 0) : u.isObject(y) && (p = g, g = y, y = void 0), s.call(this, c, g), !u.isInteger(d) || d < 0) throw TypeError("id must be a non-negative integer");
|
|
2370
2370
|
if (!u.isString(a)) throw TypeError("type must be a string");
|
|
2371
|
-
if (
|
|
2371
|
+
if (m !== void 0 && !o.test(m = m.toString().toLowerCase()))
|
|
2372
2372
|
throw TypeError("rule must be a string rule");
|
|
2373
2373
|
if (y !== void 0 && !u.isString(y)) throw TypeError("extend must be a string");
|
|
2374
|
-
|
|
2374
|
+
m === "proto3_optional" && (m = "optional"), this.rule = m && m !== "optional" ? m : void 0, this.type = a, this.id = d, this.extend = y || void 0, this.required = m === "required", this.optional = !this.required, this.repeated = m === "repeated", this.map = !1, this.message = null, this.partOf = null, this.typeDefault = null, this.defaultValue = null, this.long = u.Long ? r.long[a] !== void 0 : (
|
|
2375
2375
|
/* istanbul ignore next */
|
|
2376
2376
|
!1
|
|
2377
|
-
), this.bytes = a === "bytes", this.resolvedType = null, this.extensionField = null, this.declaringField = null, this._packed = null, this.comment =
|
|
2377
|
+
), this.bytes = a === "bytes", this.resolvedType = null, this.extensionField = null, this.declaringField = null, this._packed = null, this.comment = p;
|
|
2378
2378
|
}
|
|
2379
2379
|
return Object.defineProperty(l.prototype, "packed", {
|
|
2380
2380
|
get: function() {
|
|
2381
2381
|
return this._packed === null && (this._packed = this.getOption("packed") !== !1), this._packed;
|
|
2382
2382
|
}
|
|
2383
|
-
}), l.prototype.setOption = function(d, a,
|
|
2384
|
-
return d === "packed" && (this._packed = null), s.prototype.setOption.call(this, d, a,
|
|
2383
|
+
}), l.prototype.setOption = function(d, a, m) {
|
|
2384
|
+
return d === "packed" && (this._packed = null), s.prototype.setOption.call(this, d, a, m);
|
|
2385
2385
|
}, l.prototype.toJSON = function(d) {
|
|
2386
2386
|
var a = d ? !!d.keepComments : !1;
|
|
2387
2387
|
return u.toObject([
|
|
@@ -2400,7 +2400,7 @@ function requireField() {
|
|
|
2400
2400
|
]);
|
|
2401
2401
|
}, l.prototype.resolve = function() {
|
|
2402
2402
|
if (this.resolved) return this;
|
|
2403
|
-
if ((this.typeDefault = r.defaults[this.type]) === void 0 ? (this.resolvedType = (this.declaringField ? this.declaringField.parent : this.parent).lookupTypeOrEnum(this.type), this.resolvedType instanceof
|
|
2403
|
+
if ((this.typeDefault = r.defaults[this.type]) === void 0 ? (this.resolvedType = (this.declaringField ? this.declaringField.parent : this.parent).lookupTypeOrEnum(this.type), this.resolvedType instanceof h ? this.typeDefault = null : this.typeDefault = this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]) : this.options && this.options.proto3_optional && (this.typeDefault = null), this.options && this.options.default != null && (this.typeDefault = this.options.default, this.resolvedType instanceof i && typeof this.typeDefault == "string" && (this.typeDefault = this.resolvedType.values[this.typeDefault])), this.options && ((this.options.packed === !0 || this.options.packed !== void 0 && this.resolvedType && !(this.resolvedType instanceof i)) && delete this.options.packed, Object.keys(this.options).length || (this.options = void 0)), this.long)
|
|
2404
2404
|
this.typeDefault = u.Long.fromNumber(this.typeDefault, this.type.charAt(0) === "u"), Object.freeze && Object.freeze(this.typeDefault);
|
|
2405
2405
|
else if (this.bytes && typeof this.typeDefault == "string") {
|
|
2406
2406
|
var d;
|
|
@@ -2414,17 +2414,17 @@ function requireField() {
|
|
|
2414
2414
|
0
|
|
2415
2415
|
), this.typeDefault = d;
|
|
2416
2416
|
}
|
|
2417
|
-
return this.map ? this.defaultValue = u.emptyObject : this.repeated ? this.defaultValue = u.emptyArray : this.defaultValue = this.typeDefault, this.parent instanceof
|
|
2418
|
-
}, l.d = function(d, a,
|
|
2419
|
-
return typeof a == "function" ? a = u.decorateType(a).name : a && typeof a == "object" && (a = u.decorateEnum(a).name), function(
|
|
2420
|
-
u.decorateType(
|
|
2421
|
-
new l(v, d, a,
|
|
2417
|
+
return this.map ? this.defaultValue = u.emptyObject : this.repeated ? this.defaultValue = u.emptyArray : this.defaultValue = this.typeDefault, this.parent instanceof h && (this.parent.ctor.prototype[this.name] = this.defaultValue), s.prototype.resolve.call(this);
|
|
2418
|
+
}, l.d = function(d, a, m, y) {
|
|
2419
|
+
return typeof a == "function" ? a = u.decorateType(a).name : a && typeof a == "object" && (a = u.decorateEnum(a).name), function(p, v) {
|
|
2420
|
+
u.decorateType(p.constructor).add(
|
|
2421
|
+
new l(v, d, a, m, {
|
|
2422
2422
|
default: y
|
|
2423
2423
|
})
|
|
2424
2424
|
);
|
|
2425
2425
|
};
|
|
2426
2426
|
}, l._configure = function(d) {
|
|
2427
|
-
|
|
2427
|
+
h = d;
|
|
2428
2428
|
}, field;
|
|
2429
2429
|
}
|
|
2430
2430
|
var oneof, hasRequiredOneof;
|
|
@@ -2452,14 +2452,14 @@ function requireOneof() {
|
|
|
2452
2452
|
c ? this.comment : void 0
|
|
2453
2453
|
]);
|
|
2454
2454
|
};
|
|
2455
|
-
function
|
|
2455
|
+
function h(o) {
|
|
2456
2456
|
if (o.parent)
|
|
2457
2457
|
for (var l = 0; l < o.fieldsArray.length; ++l)
|
|
2458
2458
|
o.fieldsArray[l].parent || o.parent.add(o.fieldsArray[l]);
|
|
2459
2459
|
}
|
|
2460
2460
|
return u.prototype.add = function(l) {
|
|
2461
2461
|
if (!(l instanceof i)) throw TypeError("field must be a Field");
|
|
2462
|
-
return l.parent && l.parent !== this.parent && l.parent.remove(l), this.oneof.push(l.name), this.fieldsArray.push(l), l.partOf = this,
|
|
2462
|
+
return l.parent && l.parent !== this.parent && l.parent.remove(l), this.oneof.push(l.name), this.fieldsArray.push(l), l.partOf = this, h(this), this;
|
|
2463
2463
|
}, u.prototype.remove = function(l) {
|
|
2464
2464
|
if (!(l instanceof i)) throw TypeError("field must be a Field");
|
|
2465
2465
|
var c = this.fieldsArray.indexOf(l);
|
|
@@ -2471,15 +2471,15 @@ function requireOneof() {
|
|
|
2471
2471
|
var a = l.get(this.oneof[d]);
|
|
2472
2472
|
a && !a.partOf && (a.partOf = c, c.fieldsArray.push(a));
|
|
2473
2473
|
}
|
|
2474
|
-
|
|
2474
|
+
h(this);
|
|
2475
2475
|
}, u.prototype.onRemove = function(l) {
|
|
2476
2476
|
for (var c = 0, d; c < this.fieldsArray.length; ++c)
|
|
2477
2477
|
(d = this.fieldsArray[c]).parent && d.parent.remove(d);
|
|
2478
2478
|
s.prototype.onRemove.call(this, l);
|
|
2479
2479
|
}, u.d = function() {
|
|
2480
2480
|
for (var l = new Array(arguments.length), c = 0; c < arguments.length; ) l[c] = arguments[c++];
|
|
2481
|
-
return function(a,
|
|
2482
|
-
r.decorateType(a.constructor).add(new u(
|
|
2481
|
+
return function(a, m) {
|
|
2482
|
+
r.decorateType(a.constructor).add(new u(m, l)), Object.defineProperty(a, m, {
|
|
2483
2483
|
get: r.oneOfGetter(l),
|
|
2484
2484
|
set: r.oneOfSetter(l)
|
|
2485
2485
|
});
|
|
@@ -2492,34 +2492,34 @@ function requireNamespace() {
|
|
|
2492
2492
|
hasRequiredNamespace = 1, namespace = d;
|
|
2493
2493
|
var s = requireObject();
|
|
2494
2494
|
((d.prototype = Object.create(s.prototype)).constructor = d).className = "Namespace";
|
|
2495
|
-
var i = requireField(), r = requireUtil(), u = requireOneof(),
|
|
2495
|
+
var i = requireField(), r = requireUtil(), u = requireOneof(), h, o, l;
|
|
2496
2496
|
d.fromJSON = function(y, g) {
|
|
2497
2497
|
return new d(y, g.options).addJSON(g.nested);
|
|
2498
2498
|
};
|
|
2499
|
-
function c(
|
|
2500
|
-
if (
|
|
2501
|
-
for (var g = {},
|
|
2499
|
+
function c(m, y) {
|
|
2500
|
+
if (m && m.length) {
|
|
2501
|
+
for (var g = {}, p = 0; p < m.length; ++p) g[m[p].name] = m[p].toJSON(y);
|
|
2502
2502
|
return g;
|
|
2503
2503
|
}
|
|
2504
2504
|
}
|
|
2505
2505
|
d.arrayToJSON = c, d.isReservedId = function(y, g) {
|
|
2506
2506
|
if (y) {
|
|
2507
|
-
for (var
|
|
2508
|
-
if (typeof y[
|
|
2507
|
+
for (var p = 0; p < y.length; ++p)
|
|
2508
|
+
if (typeof y[p] != "string" && y[p][0] <= g && y[p][1] > g)
|
|
2509
2509
|
return !0;
|
|
2510
2510
|
}
|
|
2511
2511
|
return !1;
|
|
2512
2512
|
}, d.isReservedName = function(y, g) {
|
|
2513
2513
|
if (y) {
|
|
2514
|
-
for (var
|
|
2514
|
+
for (var p = 0; p < y.length; ++p) if (y[p] === g) return !0;
|
|
2515
2515
|
}
|
|
2516
2516
|
return !1;
|
|
2517
2517
|
};
|
|
2518
|
-
function d(
|
|
2519
|
-
s.call(this,
|
|
2518
|
+
function d(m, y) {
|
|
2519
|
+
s.call(this, m, y), this.nested = void 0, this._nestedArray = null;
|
|
2520
2520
|
}
|
|
2521
|
-
function a(
|
|
2522
|
-
return
|
|
2521
|
+
function a(m) {
|
|
2522
|
+
return m._nestedArray = null, m;
|
|
2523
2523
|
}
|
|
2524
2524
|
return Object.defineProperty(d.prototype, "nestedArray", {
|
|
2525
2525
|
get: function() {
|
|
@@ -2535,10 +2535,10 @@ function requireNamespace() {
|
|
|
2535
2535
|
}, d.prototype.addJSON = function(y) {
|
|
2536
2536
|
var g = this;
|
|
2537
2537
|
if (y)
|
|
2538
|
-
for (var
|
|
2539
|
-
b = y[
|
|
2538
|
+
for (var p = Object.keys(y), v = 0, b; v < p.length; ++v)
|
|
2539
|
+
b = y[p[v]], g.add(
|
|
2540
2540
|
// most to least likely
|
|
2541
|
-
(b.fields !== void 0 ?
|
|
2541
|
+
(b.fields !== void 0 ? h.fromJSON : b.values !== void 0 ? l.fromJSON : b.methods !== void 0 ? o.fromJSON : b.id !== void 0 ? i.fromJSON : d.fromJSON)(p[v], b)
|
|
2542
2542
|
);
|
|
2543
2543
|
return this;
|
|
2544
2544
|
}, d.prototype.get = function(y) {
|
|
@@ -2547,14 +2547,14 @@ function requireNamespace() {
|
|
|
2547
2547
|
if (this.nested && this.nested[y] instanceof l) return this.nested[y].values;
|
|
2548
2548
|
throw Error("no such enum: " + y);
|
|
2549
2549
|
}, d.prototype.add = function(y) {
|
|
2550
|
-
if (!(y instanceof i && y.extend !== void 0 || y instanceof
|
|
2550
|
+
if (!(y instanceof i && y.extend !== void 0 || y instanceof h || y instanceof u || y instanceof l || y instanceof o || y instanceof d))
|
|
2551
2551
|
throw TypeError("object must be a valid nested object");
|
|
2552
2552
|
if (!this.nested) this.nested = {};
|
|
2553
2553
|
else {
|
|
2554
2554
|
var g = this.get(y.name);
|
|
2555
2555
|
if (g)
|
|
2556
|
-
if (g instanceof d && y instanceof d && !(g instanceof
|
|
2557
|
-
for (var
|
|
2556
|
+
if (g instanceof d && y instanceof d && !(g instanceof h || g instanceof o)) {
|
|
2557
|
+
for (var p = g.nestedArray, v = 0; v < p.length; ++v) y.add(p[v]);
|
|
2558
2558
|
this.remove(g), this.nested || (this.nested = {}), y.setOptions(g.options, !0);
|
|
2559
2559
|
} else throw Error("duplicate name '" + y.name + "' in " + this);
|
|
2560
2560
|
}
|
|
@@ -2567,19 +2567,19 @@ function requireNamespace() {
|
|
|
2567
2567
|
if (r.isString(y)) y = y.split(".");
|
|
2568
2568
|
else if (!Array.isArray(y)) throw TypeError("illegal path");
|
|
2569
2569
|
if (y && y.length && y[0] === "") throw Error("path must be relative");
|
|
2570
|
-
for (var
|
|
2570
|
+
for (var p = this; y.length > 0; ) {
|
|
2571
2571
|
var v = y.shift();
|
|
2572
|
-
if (
|
|
2573
|
-
if (
|
|
2574
|
-
} else
|
|
2572
|
+
if (p.nested && p.nested[v]) {
|
|
2573
|
+
if (p = p.nested[v], !(p instanceof d)) throw Error("path conflicts with non-namespace objects");
|
|
2574
|
+
} else p.add(p = new d(v));
|
|
2575
2575
|
}
|
|
2576
|
-
return g &&
|
|
2576
|
+
return g && p.addJSON(g), p;
|
|
2577
2577
|
}, d.prototype.resolveAll = function() {
|
|
2578
2578
|
for (var y = this.nestedArray, g = 0; g < y.length; )
|
|
2579
2579
|
y[g] instanceof d ? y[g++].resolveAll() : y[g++].resolve();
|
|
2580
2580
|
return this.resolve();
|
|
2581
|
-
}, d.prototype.lookup = function(y, g,
|
|
2582
|
-
if (typeof g == "boolean" ? (
|
|
2581
|
+
}, d.prototype.lookup = function(y, g, p) {
|
|
2582
|
+
if (typeof g == "boolean" ? (p = g, g = void 0) : g && !Array.isArray(g) && (g = [g]), r.isString(y) && y.length) {
|
|
2583
2583
|
if (y === ".") return this.root;
|
|
2584
2584
|
y = y.split(".");
|
|
2585
2585
|
} else if (!y.length) return this;
|
|
@@ -2594,9 +2594,9 @@ function requireNamespace() {
|
|
|
2594
2594
|
for (var b = 0; b < this.nestedArray.length; ++b)
|
|
2595
2595
|
if (this._nestedArray[b] instanceof d && (v = this._nestedArray[b].lookup(y, g, !0)))
|
|
2596
2596
|
return v;
|
|
2597
|
-
return this.parent === null ||
|
|
2597
|
+
return this.parent === null || p ? null : this.parent.lookup(y, g);
|
|
2598
2598
|
}, d.prototype.lookupType = function(y) {
|
|
2599
|
-
var g = this.lookup(y, [
|
|
2599
|
+
var g = this.lookup(y, [h]);
|
|
2600
2600
|
if (!g) throw Error("no such type: " + y);
|
|
2601
2601
|
return g;
|
|
2602
2602
|
}, d.prototype.lookupEnum = function(y) {
|
|
@@ -2604,15 +2604,15 @@ function requireNamespace() {
|
|
|
2604
2604
|
if (!g) throw Error("no such Enum '" + y + "' in " + this);
|
|
2605
2605
|
return g;
|
|
2606
2606
|
}, d.prototype.lookupTypeOrEnum = function(y) {
|
|
2607
|
-
var g = this.lookup(y, [
|
|
2607
|
+
var g = this.lookup(y, [h, l]);
|
|
2608
2608
|
if (!g) throw Error("no such Type or Enum '" + y + "' in " + this);
|
|
2609
2609
|
return g;
|
|
2610
2610
|
}, d.prototype.lookupService = function(y) {
|
|
2611
2611
|
var g = this.lookup(y, [o]);
|
|
2612
2612
|
if (!g) throw Error("no such Service '" + y + "' in " + this);
|
|
2613
2613
|
return g;
|
|
2614
|
-
}, d._configure = function(
|
|
2615
|
-
|
|
2614
|
+
}, d._configure = function(m, y, g) {
|
|
2615
|
+
h = m, o = y, l = g;
|
|
2616
2616
|
}, namespace;
|
|
2617
2617
|
}
|
|
2618
2618
|
var mapfield, hasRequiredMapfield;
|
|
@@ -2622,8 +2622,8 @@ function requireMapfield() {
|
|
|
2622
2622
|
var s = requireField();
|
|
2623
2623
|
((u.prototype = Object.create(s.prototype)).constructor = u).className = "MapField";
|
|
2624
2624
|
var i = requireTypes(), r = requireUtil();
|
|
2625
|
-
function u(
|
|
2626
|
-
if (s.call(this,
|
|
2625
|
+
function u(h, o, l, c, d, a) {
|
|
2626
|
+
if (s.call(this, h, o, c, void 0, void 0, d, a), !r.isString(l)) throw TypeError("keyType must be a string");
|
|
2627
2627
|
this.keyType = l, this.resolvedKeyType = null, this.map = !0;
|
|
2628
2628
|
}
|
|
2629
2629
|
return u.fromJSON = function(o, l) {
|
|
@@ -2649,8 +2649,8 @@ function requireMapfield() {
|
|
|
2649
2649
|
if (i.mapKey[this.keyType] === void 0) throw Error("invalid key type: " + this.keyType);
|
|
2650
2650
|
return s.prototype.resolve.call(this);
|
|
2651
2651
|
}, u.d = function(o, l, c) {
|
|
2652
|
-
return typeof c == "function" ? c = r.decorateType(c).name : c && typeof c == "object" && (c = r.decorateEnum(c).name), function(a,
|
|
2653
|
-
r.decorateType(a.constructor).add(new u(
|
|
2652
|
+
return typeof c == "function" ? c = r.decorateType(c).name : c && typeof c == "object" && (c = r.decorateEnum(c).name), function(a, m) {
|
|
2653
|
+
r.decorateType(a.constructor).add(new u(m, o, l, c));
|
|
2654
2654
|
};
|
|
2655
2655
|
}, mapfield;
|
|
2656
2656
|
}
|
|
@@ -2661,15 +2661,15 @@ function requireMethod() {
|
|
|
2661
2661
|
var s = requireObject();
|
|
2662
2662
|
((r.prototype = Object.create(s.prototype)).constructor = r).className = "Method";
|
|
2663
2663
|
var i = requireUtil();
|
|
2664
|
-
function r(u,
|
|
2665
|
-
if (i.isObject(c) ? (a = c, c = d = void 0) : i.isObject(d) && (a = d, d = void 0), !(
|
|
2664
|
+
function r(u, h, o, l, c, d, a, m, y) {
|
|
2665
|
+
if (i.isObject(c) ? (a = c, c = d = void 0) : i.isObject(d) && (a = d, d = void 0), !(h === void 0 || i.isString(h))) throw TypeError("type must be a string");
|
|
2666
2666
|
if (!i.isString(o)) throw TypeError("requestType must be a string");
|
|
2667
2667
|
if (!i.isString(l)) throw TypeError("responseType must be a string");
|
|
2668
|
-
s.call(this, u, a), this.type =
|
|
2668
|
+
s.call(this, u, a), this.type = h || "rpc", this.requestType = o, this.requestStream = c ? !0 : void 0, this.responseType = l, this.responseStream = d ? !0 : void 0, this.resolvedRequestType = null, this.resolvedResponseType = null, this.comment = m, this.parsedOptions = y;
|
|
2669
2669
|
}
|
|
2670
|
-
return r.fromJSON = function(
|
|
2670
|
+
return r.fromJSON = function(h, o) {
|
|
2671
2671
|
return new r(
|
|
2672
|
-
|
|
2672
|
+
h,
|
|
2673
2673
|
o.type,
|
|
2674
2674
|
o.requestType,
|
|
2675
2675
|
o.responseType,
|
|
@@ -2679,8 +2679,8 @@ function requireMethod() {
|
|
|
2679
2679
|
o.comment,
|
|
2680
2680
|
o.parsedOptions
|
|
2681
2681
|
);
|
|
2682
|
-
}, r.prototype.toJSON = function(
|
|
2683
|
-
var o =
|
|
2682
|
+
}, r.prototype.toJSON = function(h) {
|
|
2683
|
+
var o = h ? !!h.keepComments : !1;
|
|
2684
2684
|
return i.toObject([
|
|
2685
2685
|
"type",
|
|
2686
2686
|
this.type !== "rpc" && /* istanbul ignore next */
|
|
@@ -2707,20 +2707,20 @@ function requireMethod() {
|
|
|
2707
2707
|
var service, hasRequiredService;
|
|
2708
2708
|
function requireService() {
|
|
2709
2709
|
if (hasRequiredService) return service;
|
|
2710
|
-
hasRequiredService = 1, service =
|
|
2710
|
+
hasRequiredService = 1, service = h;
|
|
2711
2711
|
var s = requireNamespace();
|
|
2712
|
-
((
|
|
2712
|
+
((h.prototype = Object.create(s.prototype)).constructor = h).className = "Service";
|
|
2713
2713
|
var i = requireMethod(), r = requireUtil(), u = rpc;
|
|
2714
|
-
function
|
|
2714
|
+
function h(l, c) {
|
|
2715
2715
|
s.call(this, l, c), this.methods = {}, this._methodsArray = null;
|
|
2716
2716
|
}
|
|
2717
|
-
|
|
2718
|
-
var a = new
|
|
2717
|
+
h.fromJSON = function(c, d) {
|
|
2718
|
+
var a = new h(c, d.options);
|
|
2719
2719
|
if (d.methods)
|
|
2720
|
-
for (var
|
|
2721
|
-
a.add(i.fromJSON(
|
|
2720
|
+
for (var m = Object.keys(d.methods), y = 0; y < m.length; ++y)
|
|
2721
|
+
a.add(i.fromJSON(m[y], d.methods[m[y]]));
|
|
2722
2722
|
return d.nested && a.addJSON(d.nested), a.comment = d.comment, a;
|
|
2723
|
-
},
|
|
2723
|
+
}, h.prototype.toJSON = function(c) {
|
|
2724
2724
|
var d = s.prototype.toJSON.call(this, c), a = c ? !!c.keepComments : !1;
|
|
2725
2725
|
return r.toObject([
|
|
2726
2726
|
"options",
|
|
@@ -2733,7 +2733,7 @@ function requireService() {
|
|
|
2733
2733
|
"comment",
|
|
2734
2734
|
a ? this.comment : void 0
|
|
2735
2735
|
]);
|
|
2736
|
-
}, Object.defineProperty(
|
|
2736
|
+
}, Object.defineProperty(h.prototype, "methodsArray", {
|
|
2737
2737
|
get: function() {
|
|
2738
2738
|
return this._methodsArray || (this._methodsArray = r.toArray(this.methods));
|
|
2739
2739
|
}
|
|
@@ -2741,34 +2741,34 @@ function requireService() {
|
|
|
2741
2741
|
function o(l) {
|
|
2742
2742
|
return l._methodsArray = null, l;
|
|
2743
2743
|
}
|
|
2744
|
-
return
|
|
2744
|
+
return h.prototype.get = function(c) {
|
|
2745
2745
|
return this.methods[c] || s.prototype.get.call(this, c);
|
|
2746
|
-
},
|
|
2746
|
+
}, h.prototype.resolveAll = function() {
|
|
2747
2747
|
for (var c = this.methodsArray, d = 0; d < c.length; ++d) c[d].resolve();
|
|
2748
2748
|
return s.prototype.resolve.call(this);
|
|
2749
|
-
},
|
|
2749
|
+
}, h.prototype.add = function(c) {
|
|
2750
2750
|
if (this.get(c.name)) throw Error("duplicate name '" + c.name + "' in " + this);
|
|
2751
2751
|
return c instanceof i ? (this.methods[c.name] = c, c.parent = this, o(this)) : s.prototype.add.call(this, c);
|
|
2752
|
-
},
|
|
2752
|
+
}, h.prototype.remove = function(c) {
|
|
2753
2753
|
if (c instanceof i) {
|
|
2754
2754
|
if (this.methods[c.name] !== c) throw Error(c + " is not a member of " + this);
|
|
2755
2755
|
return delete this.methods[c.name], c.parent = null, o(this);
|
|
2756
2756
|
}
|
|
2757
2757
|
return s.prototype.remove.call(this, c);
|
|
2758
|
-
},
|
|
2759
|
-
for (var
|
|
2758
|
+
}, h.prototype.create = function(c, d, a) {
|
|
2759
|
+
for (var m = new u.Service(c, d, a), y = 0, g; y < /* initializes */
|
|
2760
2760
|
this.methodsArray.length; ++y) {
|
|
2761
|
-
var
|
|
2762
|
-
p
|
|
2761
|
+
var p = r.lcFirst((g = this._methodsArray[y]).resolve().name).replace(/[^$\w_]/g, "");
|
|
2762
|
+
m[p] = r.codegen(
|
|
2763
2763
|
["r", "c"],
|
|
2764
|
-
r.isReserved(
|
|
2764
|
+
r.isReserved(p) ? p + "_" : p
|
|
2765
2765
|
)("return this.rpcCall(m,q,s,r,c)")({
|
|
2766
2766
|
m: g,
|
|
2767
2767
|
q: g.resolvedRequestType.ctor,
|
|
2768
2768
|
s: g.resolvedResponseType.ctor
|
|
2769
2769
|
});
|
|
2770
2770
|
}
|
|
2771
|
-
return
|
|
2771
|
+
return m;
|
|
2772
2772
|
}, service;
|
|
2773
2773
|
}
|
|
2774
2774
|
var message = Message, util$1 = requireMinimal();
|
|
@@ -2807,12 +2807,12 @@ Message.prototype.toJSON = function s() {
|
|
|
2807
2807
|
var decoder_1, hasRequiredDecoder;
|
|
2808
2808
|
function requireDecoder() {
|
|
2809
2809
|
if (hasRequiredDecoder) return decoder_1;
|
|
2810
|
-
hasRequiredDecoder = 1, decoder_1 =
|
|
2810
|
+
hasRequiredDecoder = 1, decoder_1 = h;
|
|
2811
2811
|
var s = require_enum(), i = requireTypes(), r = requireUtil();
|
|
2812
2812
|
function u(o) {
|
|
2813
2813
|
return "missing required '" + o.name + "'";
|
|
2814
2814
|
}
|
|
2815
|
-
function
|
|
2815
|
+
function h(o) {
|
|
2816
2816
|
var l = r.codegen(["r", "l"], o.name + "$decode")("if(!(r instanceof Reader))")(
|
|
2817
2817
|
"r=Reader.create(r)"
|
|
2818
2818
|
)(
|
|
@@ -2823,23 +2823,23 @@ function requireDecoder() {
|
|
|
2823
2823
|
o.group && l("if((t&7)===4)")("break"), l("switch(t>>>3){");
|
|
2824
2824
|
for (var c = 0; c < /* initializes */
|
|
2825
2825
|
o.fieldsArray.length; ++c) {
|
|
2826
|
-
var d = o._fieldsArray[c].resolve(), a = d.resolvedType instanceof s ? "int32" : d.type,
|
|
2827
|
-
l("case %i: {", d.id), d.map ? (l("if(%s===util.emptyObject)",
|
|
2826
|
+
var d = o._fieldsArray[c].resolve(), a = d.resolvedType instanceof s ? "int32" : d.type, m = "m" + r.safeProp(d.name);
|
|
2827
|
+
l("case %i: {", d.id), d.map ? (l("if(%s===util.emptyObject)", m)("%s={}", m)("var c2 = r.uint32()+r.pos"), i.defaults[d.keyType] !== void 0 ? l("k=%j", i.defaults[d.keyType]) : l("k=null"), i.defaults[a] !== void 0 ? l("value=%j", i.defaults[a]) : l("value=null"), l("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")(
|
|
2828
2828
|
"case 1: k=r.%s(); break",
|
|
2829
2829
|
d.keyType
|
|
2830
|
-
)("case 2:"), i.basic[a] === void 0 ? l("value=types[%i].decode(r,r.uint32())", c) : l("value=r.%s()", a), l("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"), i.long[d.keyType] !== void 0 ? l('%s[typeof k==="object"?util.longToHash(k):k]=value',
|
|
2830
|
+
)("case 2:"), i.basic[a] === void 0 ? l("value=types[%i].decode(r,r.uint32())", c) : l("value=r.%s()", a), l("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"), i.long[d.keyType] !== void 0 ? l('%s[typeof k==="object"?util.longToHash(k):k]=value', m) : l("%s[k]=value", m)) : d.repeated ? (l("if(!(%s&&%s.length))", m, m)("%s=[]", m), i.packed[a] !== void 0 && l("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")(
|
|
2831
2831
|
"%s.push(r.%s())",
|
|
2832
|
-
|
|
2832
|
+
m,
|
|
2833
2833
|
a
|
|
2834
2834
|
)("}else"), i.basic[a] === void 0 ? l(
|
|
2835
2835
|
d.resolvedType.group ? "%s.push(types[%i].decode(r))" : "%s.push(types[%i].decode(r,r.uint32()))",
|
|
2836
|
-
|
|
2836
|
+
m,
|
|
2837
2837
|
c
|
|
2838
|
-
) : l("%s.push(r.%s())",
|
|
2838
|
+
) : l("%s.push(r.%s())", m, a)) : i.basic[a] === void 0 ? l(
|
|
2839
2839
|
d.resolvedType.group ? "%s=types[%i].decode(r)" : "%s=types[%i].decode(r,r.uint32())",
|
|
2840
|
-
|
|
2840
|
+
m,
|
|
2841
2841
|
c
|
|
2842
|
-
) : l("%s=r.%s()",
|
|
2842
|
+
) : l("%s=r.%s()", m, a), l("break")("}");
|
|
2843
2843
|
}
|
|
2844
2844
|
for (l("default:")("r.skipType(t&7)")("break")("}")("}"), c = 0; c < o._fieldsArray.length; ++c) {
|
|
2845
2845
|
var y = o._fieldsArray[c];
|
|
@@ -2864,8 +2864,8 @@ function requireVerifier() {
|
|
|
2864
2864
|
if (c.resolvedType)
|
|
2865
2865
|
if (c.resolvedType instanceof s) {
|
|
2866
2866
|
l("switch(%s){", a)("default:")("return%j", r(c, "enum value"));
|
|
2867
|
-
for (var
|
|
2868
|
-
l("case %i:", c.resolvedType.values[
|
|
2867
|
+
for (var m = Object.keys(c.resolvedType.values), y = 0; y < m.length; ++y)
|
|
2868
|
+
l("case %i:", c.resolvedType.values[m[y]]);
|
|
2869
2869
|
l("break")("}");
|
|
2870
2870
|
} else
|
|
2871
2871
|
l("{")("var e=types[%i].verify(%s);", d, a)("if(e)")(
|
|
@@ -2915,7 +2915,7 @@ function requireVerifier() {
|
|
|
2915
2915
|
}
|
|
2916
2916
|
return l;
|
|
2917
2917
|
}
|
|
2918
|
-
function
|
|
2918
|
+
function h(l, c, d) {
|
|
2919
2919
|
switch (c.keyType) {
|
|
2920
2920
|
case "int32":
|
|
2921
2921
|
case "uint32":
|
|
@@ -2947,25 +2947,25 @@ function requireVerifier() {
|
|
|
2947
2947
|
"object expected"
|
|
2948
2948
|
), d = l.oneofsArray, a = {};
|
|
2949
2949
|
d.length && c("var p={}");
|
|
2950
|
-
for (var
|
|
2951
|
-
l.fieldsArray.length; ++
|
|
2952
|
-
var y = l._fieldsArray[
|
|
2950
|
+
for (var m = 0; m < /* initializes */
|
|
2951
|
+
l.fieldsArray.length; ++m) {
|
|
2952
|
+
var y = l._fieldsArray[m].resolve(), g = "m" + i.safeProp(y.name);
|
|
2953
2953
|
if (y.optional && c("if(%s!=null&&m.hasOwnProperty(%j)){", g, y.name), y.map)
|
|
2954
2954
|
c("if(!util.isObject(%s))", g)("return%j", r(y, "object"))(
|
|
2955
2955
|
"var k=Object.keys(%s)",
|
|
2956
2956
|
g
|
|
2957
|
-
)("for(var i=0;i<k.length;++i){"),
|
|
2957
|
+
)("for(var i=0;i<k.length;++i){"), h(c, y, "k[i]"), u(c, y, m, g + "[k[i]]")("}");
|
|
2958
2958
|
else if (y.repeated)
|
|
2959
2959
|
c("if(!Array.isArray(%s))", g)("return%j", r(y, "array"))(
|
|
2960
2960
|
"for(var i=0;i<%s.length;++i){",
|
|
2961
2961
|
g
|
|
2962
|
-
), u(c, y,
|
|
2962
|
+
), u(c, y, m, g + "[i]")("}");
|
|
2963
2963
|
else {
|
|
2964
2964
|
if (y.partOf) {
|
|
2965
|
-
var
|
|
2966
|
-
a[y.partOf.name] === 1 && c("if(p%s===1)",
|
|
2965
|
+
var p = i.safeProp(y.partOf.name);
|
|
2966
|
+
a[y.partOf.name] === 1 && c("if(p%s===1)", p)("return%j", y.partOf.name + ": multiple values"), a[y.partOf.name] = 1, c("p%s=1", p);
|
|
2967
2967
|
}
|
|
2968
|
-
u(c, y,
|
|
2968
|
+
u(c, y, m, g);
|
|
2969
2969
|
}
|
|
2970
2970
|
y.optional && c("}");
|
|
2971
2971
|
}
|
|
@@ -2977,17 +2977,17 @@ var converter = {}, hasRequiredConverter;
|
|
|
2977
2977
|
function requireConverter() {
|
|
2978
2978
|
return hasRequiredConverter || (hasRequiredConverter = 1, function(s) {
|
|
2979
2979
|
var i = s, r = require_enum(), u = requireUtil();
|
|
2980
|
-
function
|
|
2981
|
-
var
|
|
2980
|
+
function h(l, c, d, a) {
|
|
2981
|
+
var m = !1;
|
|
2982
2982
|
if (c.resolvedType)
|
|
2983
2983
|
if (c.resolvedType instanceof r) {
|
|
2984
2984
|
l("switch(d%s){", a);
|
|
2985
|
-
for (var y = c.resolvedType.values, g = Object.keys(y),
|
|
2986
|
-
y[g[
|
|
2985
|
+
for (var y = c.resolvedType.values, g = Object.keys(y), p = 0; p < g.length; ++p)
|
|
2986
|
+
y[g[p]] === c.typeDefault && !m && (l("default:")('if(typeof(d%s)==="number"){m%s=d%s;break}', a, a, a), c.repeated || l(
|
|
2987
2987
|
// fallback to default value only for
|
|
2988
2988
|
// arrays, to avoid leaving holes.
|
|
2989
2989
|
"break"
|
|
2990
|
-
),
|
|
2990
|
+
), m = !0), l("case%j:", g[p])("case %i:", y[g[p]])("m%s=%j", a, y[g[p]])(
|
|
2991
2991
|
"break"
|
|
2992
2992
|
);
|
|
2993
2993
|
l("}");
|
|
@@ -3063,35 +3063,35 @@ function requireConverter() {
|
|
|
3063
3063
|
);
|
|
3064
3064
|
if (!d.length) return a("return new this.ctor");
|
|
3065
3065
|
a("var m=new this.ctor");
|
|
3066
|
-
for (var
|
|
3067
|
-
var y = d[
|
|
3066
|
+
for (var m = 0; m < d.length; ++m) {
|
|
3067
|
+
var y = d[m].resolve(), g = u.safeProp(y.name);
|
|
3068
3068
|
y.map ? (a("if(d%s){", g)('if(typeof d%s!=="object")', g)(
|
|
3069
3069
|
"throw TypeError(%j)",
|
|
3070
3070
|
y.fullName + ": object expected"
|
|
3071
|
-
)("m%s={}", g)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){", g),
|
|
3071
|
+
)("m%s={}", g)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){", g), h(
|
|
3072
3072
|
a,
|
|
3073
3073
|
y,
|
|
3074
3074
|
/* not sorted */
|
|
3075
|
-
|
|
3075
|
+
m,
|
|
3076
3076
|
g + "[ks[i]]"
|
|
3077
3077
|
)("}")("}")) : y.repeated ? (a("if(d%s){", g)("if(!Array.isArray(d%s))", g)(
|
|
3078
3078
|
"throw TypeError(%j)",
|
|
3079
3079
|
y.fullName + ": array expected"
|
|
3080
|
-
)("m%s=[]", g)("for(var i=0;i<d%s.length;++i){", g),
|
|
3080
|
+
)("m%s=[]", g)("for(var i=0;i<d%s.length;++i){", g), h(
|
|
3081
3081
|
a,
|
|
3082
3082
|
y,
|
|
3083
3083
|
/* not sorted */
|
|
3084
|
-
|
|
3084
|
+
m,
|
|
3085
3085
|
g + "[i]"
|
|
3086
3086
|
)("}")("}")) : (y.resolvedType instanceof r || a(
|
|
3087
3087
|
// no need to test for null/undefined if an enum (uses switch)
|
|
3088
3088
|
"if(d%s!=null){",
|
|
3089
3089
|
g
|
|
3090
|
-
),
|
|
3090
|
+
), h(
|
|
3091
3091
|
a,
|
|
3092
3092
|
y,
|
|
3093
3093
|
/* not sorted */
|
|
3094
|
-
|
|
3094
|
+
m,
|
|
3095
3095
|
g
|
|
3096
3096
|
), y.resolvedType instanceof r || a("}"));
|
|
3097
3097
|
}
|
|
@@ -3110,14 +3110,14 @@ function requireConverter() {
|
|
|
3110
3110
|
a
|
|
3111
3111
|
) : l("d%s=types[%i].toObject(m%s,o)", a, d, a);
|
|
3112
3112
|
else {
|
|
3113
|
-
var
|
|
3113
|
+
var m = !1;
|
|
3114
3114
|
switch (c.type) {
|
|
3115
3115
|
case "double":
|
|
3116
3116
|
case "float":
|
|
3117
3117
|
l("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s", a, a, a, a);
|
|
3118
3118
|
break;
|
|
3119
3119
|
case "uint64":
|
|
3120
|
-
|
|
3120
|
+
m = !0;
|
|
3121
3121
|
case "int64":
|
|
3122
3122
|
case "sint64":
|
|
3123
3123
|
case "fixed64":
|
|
@@ -3134,7 +3134,7 @@ function requireConverter() {
|
|
|
3134
3134
|
a,
|
|
3135
3135
|
a,
|
|
3136
3136
|
a,
|
|
3137
|
-
|
|
3137
|
+
m ? "true" : "",
|
|
3138
3138
|
a
|
|
3139
3139
|
);
|
|
3140
3140
|
break;
|
|
@@ -3158,20 +3158,20 @@ function requireConverter() {
|
|
|
3158
3158
|
i.toObject = function(c) {
|
|
3159
3159
|
var d = c.fieldsArray.slice().sort(u.compareFieldsById);
|
|
3160
3160
|
if (!d.length) return u.codegen()("return {}");
|
|
3161
|
-
for (var a = u.codegen(["m", "o"], c.name + "$toObject")("if(!o)")("o={}")("var d={}"),
|
|
3162
|
-
d[
|
|
3163
|
-
if (
|
|
3164
|
-
for (a("if(o.arrays||o.defaults){"),
|
|
3165
|
-
a("d%s=[]", u.safeProp(p
|
|
3161
|
+
for (var a = u.codegen(["m", "o"], c.name + "$toObject")("if(!o)")("o={}")("var d={}"), m = [], y = [], g = [], p = 0; p < d.length; ++p)
|
|
3162
|
+
d[p].partOf || (d[p].resolve().repeated ? m : d[p].map ? y : g).push(d[p]);
|
|
3163
|
+
if (m.length) {
|
|
3164
|
+
for (a("if(o.arrays||o.defaults){"), p = 0; p < m.length; ++p)
|
|
3165
|
+
a("d%s=[]", u.safeProp(m[p].name));
|
|
3166
3166
|
a("}");
|
|
3167
3167
|
}
|
|
3168
3168
|
if (y.length) {
|
|
3169
|
-
for (a("if(o.objects||o.defaults){"),
|
|
3169
|
+
for (a("if(o.objects||o.defaults){"), p = 0; p < y.length; ++p) a("d%s={}", u.safeProp(y[p].name));
|
|
3170
3170
|
a("}");
|
|
3171
3171
|
}
|
|
3172
3172
|
if (g.length) {
|
|
3173
|
-
for (a("if(o.defaults){"),
|
|
3174
|
-
var v = g[
|
|
3173
|
+
for (a("if(o.defaults){"), p = 0; p < g.length; ++p) {
|
|
3174
|
+
var v = g[p], b = u.safeProp(v.name);
|
|
3175
3175
|
if (v.resolvedType instanceof r)
|
|
3176
3176
|
a(
|
|
3177
3177
|
"d%s=o.enums===String?%j:%j",
|
|
@@ -3210,8 +3210,8 @@ function requireConverter() {
|
|
|
3210
3210
|
a("}");
|
|
3211
3211
|
}
|
|
3212
3212
|
var T = !1;
|
|
3213
|
-
for (
|
|
3214
|
-
var v = d[
|
|
3213
|
+
for (p = 0; p < d.length; ++p) {
|
|
3214
|
+
var v = d[p], w = c._fieldsArray.indexOf(v), b = u.safeProp(v.name);
|
|
3215
3215
|
v.map ? (T || (T = !0, a("var ks2")), a("if(m%s&&(ks2=Object.keys(m%s)).length){", b, b)("d%s={}", b)(
|
|
3216
3216
|
"for(var j=0;j<ks2.length;++j){"
|
|
3217
3217
|
), o(
|
|
@@ -3247,7 +3247,7 @@ var wrappers = {};
|
|
|
3247
3247
|
i[".google.protobuf.Any"] = {
|
|
3248
3248
|
fromObject: function(u) {
|
|
3249
3249
|
if (u && u["@type"]) {
|
|
3250
|
-
var
|
|
3250
|
+
var h = u["@type"].substring(u["@type"].lastIndexOf("/") + 1), o = this.lookup(h);
|
|
3251
3251
|
if (o) {
|
|
3252
3252
|
var l = u["@type"].charAt(0) === "." ? u["@type"].slice(1) : u["@type"];
|
|
3253
3253
|
return l.indexOf("/") === -1 && (l = "/" + l), this.create({
|
|
@@ -3258,18 +3258,18 @@ var wrappers = {};
|
|
|
3258
3258
|
}
|
|
3259
3259
|
return this.fromObject(u);
|
|
3260
3260
|
},
|
|
3261
|
-
toObject: function(u,
|
|
3261
|
+
toObject: function(u, h) {
|
|
3262
3262
|
var o = "type.googleapis.com/", l = "", c = "";
|
|
3263
|
-
if (
|
|
3263
|
+
if (h && h.json && u.type_url && u.value) {
|
|
3264
3264
|
c = u.type_url.substring(u.type_url.lastIndexOf("/") + 1), l = u.type_url.substring(0, u.type_url.lastIndexOf("/") + 1);
|
|
3265
3265
|
var d = this.lookup(c);
|
|
3266
3266
|
d && (u = d.decode(u.value));
|
|
3267
3267
|
}
|
|
3268
3268
|
if (!(u instanceof this.ctor) && u instanceof r) {
|
|
3269
|
-
var a = u.$type.toObject(u,
|
|
3270
|
-
return l === "" && (l = o), c = l +
|
|
3269
|
+
var a = u.$type.toObject(u, h), m = u.$type.fullName[0] === "." ? u.$type.fullName.slice(1) : u.$type.fullName;
|
|
3270
|
+
return l === "" && (l = o), c = l + m, a["@type"] = c, a;
|
|
3271
3271
|
}
|
|
3272
|
-
return this.toObject(u,
|
|
3272
|
+
return this.toObject(u, h);
|
|
3273
3273
|
}
|
|
3274
3274
|
};
|
|
3275
3275
|
})(wrappers);
|
|
@@ -3279,7 +3279,7 @@ function requireType() {
|
|
|
3279
3279
|
hasRequiredType = 1, type = b;
|
|
3280
3280
|
var s = requireNamespace();
|
|
3281
3281
|
((b.prototype = Object.create(s.prototype)).constructor = b).className = "Type";
|
|
3282
|
-
var i = require_enum(), r = requireOneof(), u = requireField(),
|
|
3282
|
+
var i = require_enum(), r = requireOneof(), u = requireField(), h = requireMapfield(), o = requireService(), l = message, c = reader, d = writer, a = requireUtil(), m = requireEncoder(), y = requireDecoder(), g = requireVerifier(), p = requireConverter(), v = wrappers;
|
|
3283
3283
|
function b(T, w) {
|
|
3284
3284
|
s.call(this, T, w), this.fields = {}, this.oneofs = void 0, this.extensions = void 0, this.reserved = void 0, this.group = void 0, this._fieldsById = null, this._fieldsArray = null, this._oneofsArray = null, this._ctor = null;
|
|
3285
3285
|
}
|
|
@@ -3350,8 +3350,8 @@ function requireType() {
|
|
|
3350
3350
|
}
|
|
3351
3351
|
}
|
|
3352
3352
|
}), b.generateConstructor = function(w) {
|
|
3353
|
-
for (var x = a.codegen(["p"], w.name), O = 0,
|
|
3354
|
-
(
|
|
3353
|
+
for (var x = a.codegen(["p"], w.name), O = 0, E; O < w.fieldsArray.length; ++O)
|
|
3354
|
+
(E = w._fieldsArray[O]).map ? x("this%s={}", a.safeProp(E.name)) : E.repeated && x("this%s=[]", a.safeProp(E.name));
|
|
3355
3355
|
return x("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")(
|
|
3356
3356
|
// omit undefined or null
|
|
3357
3357
|
"this[ks[i]]=p[ks[i]]"
|
|
@@ -3363,22 +3363,22 @@ function requireType() {
|
|
|
3363
3363
|
return b.fromJSON = function(w, x) {
|
|
3364
3364
|
var O = new b(w, x.options);
|
|
3365
3365
|
O.extensions = x.extensions, O.reserved = x.reserved;
|
|
3366
|
-
for (var
|
|
3366
|
+
for (var E = Object.keys(x.fields), R = 0; R < E.length; ++R)
|
|
3367
3367
|
O.add(
|
|
3368
|
-
(typeof x.fields[R
|
|
3369
|
-
R
|
|
3370
|
-
x.fields[R
|
|
3368
|
+
(typeof x.fields[E[R]].keyType < "u" ? h.fromJSON : u.fromJSON)(
|
|
3369
|
+
E[R],
|
|
3370
|
+
x.fields[E[R]]
|
|
3371
3371
|
)
|
|
3372
3372
|
);
|
|
3373
3373
|
if (x.oneofs)
|
|
3374
|
-
for (
|
|
3375
|
-
O.add(r.fromJSON(R
|
|
3374
|
+
for (E = Object.keys(x.oneofs), R = 0; R < E.length; ++R)
|
|
3375
|
+
O.add(r.fromJSON(E[R], x.oneofs[E[R]]));
|
|
3376
3376
|
if (x.nested)
|
|
3377
|
-
for (
|
|
3378
|
-
var S = x.nested[R
|
|
3377
|
+
for (E = Object.keys(x.nested), R = 0; R < E.length; ++R) {
|
|
3378
|
+
var S = x.nested[E[R]];
|
|
3379
3379
|
O.add(
|
|
3380
3380
|
// most to least likely
|
|
3381
|
-
(S.id !== void 0 ? u.fromJSON : S.fields !== void 0 ? b.fromJSON : S.values !== void 0 ? i.fromJSON : S.methods !== void 0 ? o.fromJSON : s.fromJSON)(R
|
|
3381
|
+
(S.id !== void 0 ? u.fromJSON : S.fields !== void 0 ? b.fromJSON : S.values !== void 0 ? i.fromJSON : S.methods !== void 0 ? o.fromJSON : s.fromJSON)(E[R], S)
|
|
3382
3382
|
);
|
|
3383
3383
|
}
|
|
3384
3384
|
return x.extensions && x.extensions.length && (O.extensions = x.extensions), x.reserved && x.reserved.length && (O.reserved = x.reserved), x.group && (O.group = !0), x.comment && (O.comment = x.comment), O;
|
|
@@ -3391,8 +3391,8 @@ function requireType() {
|
|
|
3391
3391
|
s.arrayToJSON(this.oneofsArray, w),
|
|
3392
3392
|
"fields",
|
|
3393
3393
|
s.arrayToJSON(
|
|
3394
|
-
this.fieldsArray.filter(function(
|
|
3395
|
-
return !
|
|
3394
|
+
this.fieldsArray.filter(function(E) {
|
|
3395
|
+
return !E.declaringField;
|
|
3396
3396
|
}),
|
|
3397
3397
|
w
|
|
3398
3398
|
) || {},
|
|
@@ -3450,7 +3450,7 @@ function requireType() {
|
|
|
3450
3450
|
for (var w = this.fullName, x = [], O = 0; O < /* initializes */
|
|
3451
3451
|
this.fieldsArray.length; ++O)
|
|
3452
3452
|
x.push(this._fieldsArray[O].resolve().resolvedType);
|
|
3453
|
-
this.encode =
|
|
3453
|
+
this.encode = m(this)({
|
|
3454
3454
|
Writer: d,
|
|
3455
3455
|
types: x,
|
|
3456
3456
|
util: a
|
|
@@ -3461,17 +3461,17 @@ function requireType() {
|
|
|
3461
3461
|
}), this.verify = g(this)({
|
|
3462
3462
|
types: x,
|
|
3463
3463
|
util: a
|
|
3464
|
-
}), this.fromObject =
|
|
3464
|
+
}), this.fromObject = p.fromObject(this)({
|
|
3465
3465
|
types: x,
|
|
3466
3466
|
util: a
|
|
3467
|
-
}), this.toObject =
|
|
3467
|
+
}), this.toObject = p.toObject(this)({
|
|
3468
3468
|
types: x,
|
|
3469
3469
|
util: a
|
|
3470
3470
|
});
|
|
3471
|
-
var
|
|
3472
|
-
if (
|
|
3473
|
-
var
|
|
3474
|
-
|
|
3471
|
+
var E = v[w];
|
|
3472
|
+
if (E) {
|
|
3473
|
+
var R = Object.create(this);
|
|
3474
|
+
R.fromObject = this.fromObject, this.fromObject = E.fromObject.bind(R), R.toObject = this.toObject, this.toObject = E.toObject.bind(R);
|
|
3475
3475
|
}
|
|
3476
3476
|
return this;
|
|
3477
3477
|
}, b.prototype.encode = function(w, x) {
|
|
@@ -3500,19 +3500,19 @@ function requireRoot() {
|
|
|
3500
3500
|
hasRequiredRoot = 1, root$1 = d;
|
|
3501
3501
|
var s = requireNamespace();
|
|
3502
3502
|
((d.prototype = Object.create(s.prototype)).constructor = d).className = "Root";
|
|
3503
|
-
var i = requireField(), r = require_enum(), u = requireOneof(),
|
|
3503
|
+
var i = requireField(), r = require_enum(), u = requireOneof(), h = requireUtil(), o, l, c;
|
|
3504
3504
|
function d(g) {
|
|
3505
3505
|
s.call(this, "", g), this.deferred = [], this.files = [];
|
|
3506
3506
|
}
|
|
3507
|
-
d.fromJSON = function(
|
|
3508
|
-
return v || (v = new d()),
|
|
3509
|
-
}, d.prototype.resolvePath =
|
|
3507
|
+
d.fromJSON = function(p, v) {
|
|
3508
|
+
return v || (v = new d()), p.options && v.setOptions(p.options), v.addJSON(p.nested);
|
|
3509
|
+
}, d.prototype.resolvePath = h.path.resolve, d.prototype.fetch = h.fetch;
|
|
3510
3510
|
function a() {
|
|
3511
3511
|
}
|
|
3512
|
-
d.prototype.load = function g(
|
|
3512
|
+
d.prototype.load = function g(p, v, b) {
|
|
3513
3513
|
typeof v == "function" && (b = v, v = void 0);
|
|
3514
3514
|
var _ = this;
|
|
3515
|
-
if (!b) return
|
|
3515
|
+
if (!b) return h.asPromise(g, _, p, v);
|
|
3516
3516
|
var T = b === a;
|
|
3517
3517
|
function w(C, D) {
|
|
3518
3518
|
if (b) {
|
|
@@ -3531,44 +3531,44 @@ function requireRoot() {
|
|
|
3531
3531
|
}
|
|
3532
3532
|
function O(C, D) {
|
|
3533
3533
|
try {
|
|
3534
|
-
if (
|
|
3534
|
+
if (h.isString(D) && D.charAt(0) === "{" && (D = JSON.parse(D)), !h.isString(D)) _.setOptions(D.options).addJSON(D.nested);
|
|
3535
3535
|
else {
|
|
3536
3536
|
l.filename = C;
|
|
3537
|
-
var I = l(D, _, v),
|
|
3537
|
+
var I = l(D, _, v), M, q = 0;
|
|
3538
3538
|
if (I.imports)
|
|
3539
3539
|
for (; q < I.imports.length; ++q)
|
|
3540
|
-
(
|
|
3540
|
+
(M = x(I.imports[q]) || _.resolvePath(C, I.imports[q])) && E(M);
|
|
3541
3541
|
if (I.weakImports)
|
|
3542
3542
|
for (q = 0; q < I.weakImports.length; ++q)
|
|
3543
|
-
(
|
|
3543
|
+
(M = x(I.weakImports[q]) || _.resolvePath(C, I.weakImports[q])) && E(M, !0);
|
|
3544
3544
|
}
|
|
3545
3545
|
} catch (F) {
|
|
3546
3546
|
w(F);
|
|
3547
3547
|
}
|
|
3548
|
-
!T && !
|
|
3548
|
+
!T && !R && w(null, _);
|
|
3549
3549
|
}
|
|
3550
|
-
function
|
|
3550
|
+
function E(C, D) {
|
|
3551
3551
|
if (C = x(C) || C, !(_.files.indexOf(C) > -1)) {
|
|
3552
3552
|
if (_.files.push(C), C in c) {
|
|
3553
|
-
T ? O(C, c[C]) : (++
|
|
3554
|
-
--
|
|
3553
|
+
T ? O(C, c[C]) : (++R, setTimeout(function() {
|
|
3554
|
+
--R, O(C, c[C]);
|
|
3555
3555
|
}));
|
|
3556
3556
|
return;
|
|
3557
3557
|
}
|
|
3558
3558
|
if (T) {
|
|
3559
3559
|
var I;
|
|
3560
3560
|
try {
|
|
3561
|
-
I =
|
|
3562
|
-
} catch (
|
|
3563
|
-
D || w(
|
|
3561
|
+
I = h.fs.readFileSync(C).toString("utf8");
|
|
3562
|
+
} catch (M) {
|
|
3563
|
+
D || w(M);
|
|
3564
3564
|
return;
|
|
3565
3565
|
}
|
|
3566
3566
|
O(C, I);
|
|
3567
3567
|
} else
|
|
3568
|
-
++
|
|
3569
|
-
if (--
|
|
3570
|
-
if (
|
|
3571
|
-
D ?
|
|
3568
|
+
++R, _.fetch(C, function(M, q) {
|
|
3569
|
+
if (--R, !!b) {
|
|
3570
|
+
if (M) {
|
|
3571
|
+
D ? R || w(null, _) : w(M);
|
|
3572
3572
|
return;
|
|
3573
3573
|
}
|
|
3574
3574
|
O(C, q);
|
|
@@ -3576,81 +3576,81 @@ function requireRoot() {
|
|
|
3576
3576
|
});
|
|
3577
3577
|
}
|
|
3578
3578
|
}
|
|
3579
|
-
var
|
|
3580
|
-
|
|
3581
|
-
for (var S = 0, P; S <
|
|
3582
|
-
(P = _.resolvePath("",
|
|
3579
|
+
var R = 0;
|
|
3580
|
+
h.isString(p) && (p = [p]);
|
|
3581
|
+
for (var S = 0, P; S < p.length; ++S)
|
|
3582
|
+
(P = _.resolvePath("", p[S])) && E(P);
|
|
3583
3583
|
if (T) return _;
|
|
3584
|
-
|
|
3585
|
-
}, d.prototype.loadSync = function(
|
|
3586
|
-
if (!
|
|
3587
|
-
return this.load(
|
|
3584
|
+
R || w(null, _);
|
|
3585
|
+
}, d.prototype.loadSync = function(p, v) {
|
|
3586
|
+
if (!h.isNode) throw Error("not supported");
|
|
3587
|
+
return this.load(p, v, a);
|
|
3588
3588
|
}, d.prototype.resolveAll = function() {
|
|
3589
3589
|
if (this.deferred.length)
|
|
3590
3590
|
throw Error(
|
|
3591
|
-
"unresolvable extensions: " + this.deferred.map(function(
|
|
3592
|
-
return "'extend " +
|
|
3591
|
+
"unresolvable extensions: " + this.deferred.map(function(p) {
|
|
3592
|
+
return "'extend " + p.extend + "' in " + p.parent.fullName;
|
|
3593
3593
|
}).join(", ")
|
|
3594
3594
|
);
|
|
3595
3595
|
return s.prototype.resolveAll.call(this);
|
|
3596
3596
|
};
|
|
3597
|
-
var
|
|
3598
|
-
function y(g,
|
|
3599
|
-
var v =
|
|
3597
|
+
var m = /^[A-Z]/;
|
|
3598
|
+
function y(g, p) {
|
|
3599
|
+
var v = p.parent.lookup(p.extend);
|
|
3600
3600
|
if (v) {
|
|
3601
3601
|
var b = new i(
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3602
|
+
p.fullName,
|
|
3603
|
+
p.id,
|
|
3604
|
+
p.type,
|
|
3605
|
+
p.rule,
|
|
3606
3606
|
void 0,
|
|
3607
|
-
|
|
3607
|
+
p.options
|
|
3608
3608
|
);
|
|
3609
|
-
return v.get(b.name) || (b.declaringField =
|
|
3609
|
+
return v.get(b.name) || (b.declaringField = p, p.extensionField = b, v.add(b)), !0;
|
|
3610
3610
|
}
|
|
3611
3611
|
return !1;
|
|
3612
3612
|
}
|
|
3613
|
-
return d.prototype._handleAdd = function(
|
|
3614
|
-
if (
|
|
3613
|
+
return d.prototype._handleAdd = function(p) {
|
|
3614
|
+
if (p instanceof i)
|
|
3615
3615
|
/* an extension field (implies not part of a oneof) */
|
|
3616
|
-
|
|
3617
|
-
!
|
|
3618
|
-
else if (
|
|
3619
|
-
|
|
3620
|
-
else if (!(
|
|
3621
|
-
if (
|
|
3616
|
+
p.extend !== void 0 && /* not already handled */
|
|
3617
|
+
!p.extensionField && (y(this, p) || this.deferred.push(p));
|
|
3618
|
+
else if (p instanceof r)
|
|
3619
|
+
m.test(p.name) && (p.parent[p.name] = p.values);
|
|
3620
|
+
else if (!(p instanceof u)) {
|
|
3621
|
+
if (p instanceof o)
|
|
3622
3622
|
for (var v = 0; v < this.deferred.length; )
|
|
3623
3623
|
y(this, this.deferred[v]) ? this.deferred.splice(v, 1) : ++v;
|
|
3624
3624
|
for (var b = 0; b < /* initializes */
|
|
3625
|
-
|
|
3626
|
-
this._handleAdd(
|
|
3627
|
-
|
|
3625
|
+
p.nestedArray.length; ++b)
|
|
3626
|
+
this._handleAdd(p._nestedArray[b]);
|
|
3627
|
+
m.test(p.name) && (p.parent[p.name] = p);
|
|
3628
3628
|
}
|
|
3629
|
-
}, d.prototype._handleRemove = function(
|
|
3630
|
-
if (
|
|
3629
|
+
}, d.prototype._handleRemove = function(p) {
|
|
3630
|
+
if (p instanceof i) {
|
|
3631
3631
|
if (
|
|
3632
3632
|
/* an extension field */
|
|
3633
|
-
|
|
3633
|
+
p.extend !== void 0
|
|
3634
3634
|
)
|
|
3635
3635
|
if (
|
|
3636
3636
|
/* already handled */
|
|
3637
|
-
|
|
3637
|
+
p.extensionField
|
|
3638
3638
|
)
|
|
3639
|
-
|
|
3639
|
+
p.extensionField.parent.remove(p.extensionField), p.extensionField = null;
|
|
3640
3640
|
else {
|
|
3641
|
-
var v = this.deferred.indexOf(
|
|
3641
|
+
var v = this.deferred.indexOf(p);
|
|
3642
3642
|
v > -1 && this.deferred.splice(v, 1);
|
|
3643
3643
|
}
|
|
3644
|
-
} else if (
|
|
3645
|
-
|
|
3646
|
-
else if (
|
|
3644
|
+
} else if (p instanceof r)
|
|
3645
|
+
m.test(p.name) && delete p.parent[p.name];
|
|
3646
|
+
else if (p instanceof s) {
|
|
3647
3647
|
for (var b = 0; b < /* initializes */
|
|
3648
|
-
|
|
3649
|
-
this._handleRemove(
|
|
3650
|
-
|
|
3648
|
+
p.nestedArray.length; ++b)
|
|
3649
|
+
this._handleRemove(p._nestedArray[b]);
|
|
3650
|
+
m.test(p.name) && delete p.parent[p.name];
|
|
3651
3651
|
}
|
|
3652
|
-
}, d._configure = function(g,
|
|
3653
|
-
o = g, l =
|
|
3652
|
+
}, d._configure = function(g, p, v) {
|
|
3653
|
+
o = g, l = p, c = v;
|
|
3654
3654
|
}, root$1;
|
|
3655
3655
|
}
|
|
3656
3656
|
var hasRequiredUtil;
|
|
@@ -3660,39 +3660,39 @@ function requireUtil() {
|
|
|
3660
3660
|
var s = util$2.exports = requireMinimal(), i = roots, r, u;
|
|
3661
3661
|
s.codegen = codegen_1, s.fetch = fetch_1, s.path = path, s.fs = s.inquire("fs"), s.toArray = function(a) {
|
|
3662
3662
|
if (a) {
|
|
3663
|
-
for (var
|
|
3663
|
+
for (var m = Object.keys(a), y = new Array(m.length), g = 0; g < m.length; ) y[g] = a[m[g++]];
|
|
3664
3664
|
return y;
|
|
3665
3665
|
}
|
|
3666
3666
|
return [];
|
|
3667
3667
|
}, s.toObject = function(a) {
|
|
3668
|
-
for (var
|
|
3669
|
-
var g = a[y++],
|
|
3670
|
-
|
|
3668
|
+
for (var m = {}, y = 0; y < a.length; ) {
|
|
3669
|
+
var g = a[y++], p = a[y++];
|
|
3670
|
+
p !== void 0 && (m[g] = p);
|
|
3671
3671
|
}
|
|
3672
|
-
return
|
|
3672
|
+
return m;
|
|
3673
3673
|
};
|
|
3674
|
-
var
|
|
3674
|
+
var h = /\\/g, o = /"/g;
|
|
3675
3675
|
s.isReserved = function(a) {
|
|
3676
3676
|
return /^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(
|
|
3677
3677
|
a
|
|
3678
3678
|
);
|
|
3679
3679
|
}, s.safeProp = function(a) {
|
|
3680
|
-
return !/^[$\w_]+$/.test(a) || s.isReserved(a) ? '["' + a.replace(
|
|
3680
|
+
return !/^[$\w_]+$/.test(a) || s.isReserved(a) ? '["' + a.replace(h, "\\\\").replace(o, '\\"') + '"]' : "." + a;
|
|
3681
3681
|
}, s.ucFirst = function(a) {
|
|
3682
3682
|
return a.charAt(0).toUpperCase() + a.substring(1);
|
|
3683
3683
|
};
|
|
3684
3684
|
var l = /_([a-z])/g;
|
|
3685
3685
|
s.camelCase = function(a) {
|
|
3686
|
-
return a.substring(0, 1) + a.substring(1).replace(l, function(
|
|
3686
|
+
return a.substring(0, 1) + a.substring(1).replace(l, function(m, y) {
|
|
3687
3687
|
return y.toUpperCase();
|
|
3688
3688
|
});
|
|
3689
|
-
}, s.compareFieldsById = function(a,
|
|
3690
|
-
return a.id -
|
|
3691
|
-
}, s.decorateType = function(a,
|
|
3689
|
+
}, s.compareFieldsById = function(a, m) {
|
|
3690
|
+
return a.id - m.id;
|
|
3691
|
+
}, s.decorateType = function(a, m) {
|
|
3692
3692
|
if (a.$type)
|
|
3693
|
-
return
|
|
3693
|
+
return m && a.$type.name !== m && (s.decorateRoot.remove(a.$type), a.$type.name = m, s.decorateRoot.add(a.$type)), a.$type;
|
|
3694
3694
|
r || (r = requireType());
|
|
3695
|
-
var y = new r(
|
|
3695
|
+
var y = new r(m || a.name);
|
|
3696
3696
|
return s.decorateRoot.add(y), y.ctor = a, Object.defineProperty(a, "$type", {
|
|
3697
3697
|
value: y,
|
|
3698
3698
|
enumerable: !1
|
|
@@ -3705,27 +3705,27 @@ function requireUtil() {
|
|
|
3705
3705
|
return s.decorateEnum = function(a) {
|
|
3706
3706
|
if (a.$type) return a.$type;
|
|
3707
3707
|
u || (u = require_enum());
|
|
3708
|
-
var
|
|
3709
|
-
return s.decorateRoot.add(
|
|
3710
|
-
value:
|
|
3708
|
+
var m = new u("Enum" + c++, a);
|
|
3709
|
+
return s.decorateRoot.add(m), Object.defineProperty(a, "$type", {
|
|
3710
|
+
value: m,
|
|
3711
3711
|
enumerable: !1
|
|
3712
|
-
}),
|
|
3713
|
-
}, s.setProperty = function(a,
|
|
3714
|
-
function g(
|
|
3712
|
+
}), m;
|
|
3713
|
+
}, s.setProperty = function(a, m, y) {
|
|
3714
|
+
function g(p, v, b) {
|
|
3715
3715
|
var _ = v.shift();
|
|
3716
3716
|
if (_ === "__proto__" || _ === "prototype")
|
|
3717
|
-
return
|
|
3717
|
+
return p;
|
|
3718
3718
|
if (v.length > 0)
|
|
3719
|
-
|
|
3719
|
+
p[_] = g(p[_] || {}, v, b);
|
|
3720
3720
|
else {
|
|
3721
|
-
var T =
|
|
3722
|
-
T && (b = [].concat(T).concat(b)),
|
|
3721
|
+
var T = p[_];
|
|
3722
|
+
T && (b = [].concat(T).concat(b)), p[_] = b;
|
|
3723
3723
|
}
|
|
3724
|
-
return
|
|
3724
|
+
return p;
|
|
3725
3725
|
}
|
|
3726
3726
|
if (typeof a != "object") throw TypeError("dst must be an object");
|
|
3727
|
-
if (!
|
|
3728
|
-
return
|
|
3727
|
+
if (!m) throw TypeError("path must be specified");
|
|
3728
|
+
return m = m.split("."), g(a, m, y);
|
|
3729
3729
|
}, Object.defineProperty(s, "decorateRoot", {
|
|
3730
3730
|
get: function() {
|
|
3731
3731
|
return i.decorated || (i.decorated = new (requireRoot())());
|
|
@@ -3737,10 +3737,10 @@ function requireObject() {
|
|
|
3737
3737
|
if (hasRequiredObject) return object;
|
|
3738
3738
|
hasRequiredObject = 1, object = r, r.className = "ReflectionObject";
|
|
3739
3739
|
var s = requireUtil(), i;
|
|
3740
|
-
function r(u,
|
|
3740
|
+
function r(u, h) {
|
|
3741
3741
|
if (!s.isString(u)) throw TypeError("name must be a string");
|
|
3742
|
-
if (
|
|
3743
|
-
this.options =
|
|
3742
|
+
if (h && !s.isObject(h)) throw TypeError("options must be an object");
|
|
3743
|
+
this.options = h, this.parsedOptions = null, this.name = u, this.parent = null, this.resolved = !1, this.comment = null, this.filename = null;
|
|
3744
3744
|
}
|
|
3745
3745
|
return Object.defineProperties(r.prototype, {
|
|
3746
3746
|
/**
|
|
@@ -3763,52 +3763,52 @@ function requireObject() {
|
|
|
3763
3763
|
*/
|
|
3764
3764
|
fullName: {
|
|
3765
3765
|
get: function() {
|
|
3766
|
-
for (var u = [this.name],
|
|
3767
|
-
u.unshift(
|
|
3766
|
+
for (var u = [this.name], h = this.parent; h; )
|
|
3767
|
+
u.unshift(h.name), h = h.parent;
|
|
3768
3768
|
return u.join(".");
|
|
3769
3769
|
}
|
|
3770
3770
|
}
|
|
3771
3771
|
}), r.prototype.toJSON = /* istanbul ignore next */
|
|
3772
3772
|
function() {
|
|
3773
3773
|
throw Error();
|
|
3774
|
-
}, r.prototype.onAdd = function(
|
|
3775
|
-
this.parent && this.parent !==
|
|
3776
|
-
var o =
|
|
3774
|
+
}, r.prototype.onAdd = function(h) {
|
|
3775
|
+
this.parent && this.parent !== h && this.parent.remove(this), this.parent = h, this.resolved = !1;
|
|
3776
|
+
var o = h.root;
|
|
3777
3777
|
o instanceof i && o._handleAdd(this);
|
|
3778
|
-
}, r.prototype.onRemove = function(
|
|
3779
|
-
var o =
|
|
3778
|
+
}, r.prototype.onRemove = function(h) {
|
|
3779
|
+
var o = h.root;
|
|
3780
3780
|
o instanceof i && o._handleRemove(this), this.parent = null, this.resolved = !1;
|
|
3781
3781
|
}, r.prototype.resolve = function() {
|
|
3782
3782
|
return this.resolved ? this : (this.root instanceof i && (this.resolved = !0), this);
|
|
3783
|
-
}, r.prototype.getOption = function(
|
|
3784
|
-
if (this.options) return this.options[
|
|
3785
|
-
}, r.prototype.setOption = function(
|
|
3786
|
-
return (!l || !this.options || this.options[
|
|
3787
|
-
}, r.prototype.setParsedOption = function(
|
|
3783
|
+
}, r.prototype.getOption = function(h) {
|
|
3784
|
+
if (this.options) return this.options[h];
|
|
3785
|
+
}, r.prototype.setOption = function(h, o, l) {
|
|
3786
|
+
return (!l || !this.options || this.options[h] === void 0) && ((this.options || (this.options = {}))[h] = o), this;
|
|
3787
|
+
}, r.prototype.setParsedOption = function(h, o, l) {
|
|
3788
3788
|
this.parsedOptions || (this.parsedOptions = []);
|
|
3789
3789
|
var c = this.parsedOptions;
|
|
3790
3790
|
if (l) {
|
|
3791
3791
|
var d = c.find(function(y) {
|
|
3792
|
-
return Object.prototype.hasOwnProperty.call(y,
|
|
3792
|
+
return Object.prototype.hasOwnProperty.call(y, h);
|
|
3793
3793
|
});
|
|
3794
3794
|
if (d) {
|
|
3795
|
-
var a = d[
|
|
3795
|
+
var a = d[h];
|
|
3796
3796
|
s.setProperty(a, l, o);
|
|
3797
3797
|
} else
|
|
3798
|
-
d = {}, d[
|
|
3798
|
+
d = {}, d[h] = s.setProperty({}, l, o), c.push(d);
|
|
3799
3799
|
} else {
|
|
3800
|
-
var
|
|
3801
|
-
|
|
3800
|
+
var m = {};
|
|
3801
|
+
m[h] = o, c.push(m);
|
|
3802
3802
|
}
|
|
3803
3803
|
return this;
|
|
3804
|
-
}, r.prototype.setOptions = function(
|
|
3805
|
-
if (
|
|
3806
|
-
for (var l = Object.keys(
|
|
3807
|
-
this.setOption(l[c],
|
|
3804
|
+
}, r.prototype.setOptions = function(h, o) {
|
|
3805
|
+
if (h)
|
|
3806
|
+
for (var l = Object.keys(h), c = 0; c < l.length; ++c)
|
|
3807
|
+
this.setOption(l[c], h[l[c]], o);
|
|
3808
3808
|
return this;
|
|
3809
3809
|
}, r.prototype.toString = function() {
|
|
3810
|
-
var
|
|
3811
|
-
return o.length ?
|
|
3810
|
+
var h = this.constructor.className, o = this.fullName;
|
|
3811
|
+
return o.length ? h + " " + o : h;
|
|
3812
3812
|
}, r._configure = function(u) {
|
|
3813
3813
|
i = u;
|
|
3814
3814
|
}, object;
|
|
@@ -3820,11 +3820,11 @@ function require_enum() {
|
|
|
3820
3820
|
var s = requireObject();
|
|
3821
3821
|
((u.prototype = Object.create(s.prototype)).constructor = u).className = "Enum";
|
|
3822
3822
|
var i = requireNamespace(), r = requireUtil();
|
|
3823
|
-
function u(
|
|
3824
|
-
if (s.call(this,
|
|
3823
|
+
function u(h, o, l, c, d, a) {
|
|
3824
|
+
if (s.call(this, h, l), o && typeof o != "object") throw TypeError("values must be an object");
|
|
3825
3825
|
if (this.valuesById = {}, this.values = Object.create(this.valuesById), this.comment = c, this.comments = d || {}, this.valuesOptions = a, this.reserved = void 0, o)
|
|
3826
|
-
for (var
|
|
3827
|
-
typeof o[
|
|
3826
|
+
for (var m = Object.keys(o), y = 0; y < m.length; ++y)
|
|
3827
|
+
typeof o[m[y]] == "number" && (this.valuesById[this.values[m[y]] = o[m[y]]] = m[y]);
|
|
3828
3828
|
}
|
|
3829
3829
|
return u.fromJSON = function(o, l) {
|
|
3830
3830
|
var c = new u(o, l.values, l.options, l.comment, l.comments);
|
|
@@ -3871,7 +3871,7 @@ function require_enum() {
|
|
|
3871
3871
|
var encoder_1, hasRequiredEncoder;
|
|
3872
3872
|
function requireEncoder() {
|
|
3873
3873
|
if (hasRequiredEncoder) return encoder_1;
|
|
3874
|
-
hasRequiredEncoder = 1, encoder_1 =
|
|
3874
|
+
hasRequiredEncoder = 1, encoder_1 = h;
|
|
3875
3875
|
var s = require_enum(), i = requireTypes(), r = requireUtil();
|
|
3876
3876
|
function u(o, l, c, d) {
|
|
3877
3877
|
return l.resolvedType.group ? o(
|
|
@@ -3887,33 +3887,33 @@ function requireEncoder() {
|
|
|
3887
3887
|
(l.id << 3 | 2) >>> 0
|
|
3888
3888
|
);
|
|
3889
3889
|
}
|
|
3890
|
-
function
|
|
3890
|
+
function h(o) {
|
|
3891
3891
|
for (var l = r.codegen(["m", "w"], o.name + "$encode")("if(!w)")("w=Writer.create()"), c, d, a = (
|
|
3892
3892
|
/* initializes */
|
|
3893
3893
|
o.fieldsArray.slice().sort(r.compareFieldsById)
|
|
3894
3894
|
), c = 0; c < a.length; ++c) {
|
|
3895
|
-
var
|
|
3896
|
-
d = "m" + r.safeProp(
|
|
3895
|
+
var m = a[c].resolve(), y = o._fieldsArray.indexOf(m), g = m.resolvedType instanceof s ? "int32" : m.type, p = i.basic[g];
|
|
3896
|
+
d = "m" + r.safeProp(m.name), m.map ? (l(
|
|
3897
3897
|
"if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",
|
|
3898
3898
|
d,
|
|
3899
|
-
|
|
3899
|
+
m.name
|
|
3900
3900
|
)(
|
|
3901
3901
|
// !== undefined && !== null
|
|
3902
3902
|
"for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",
|
|
3903
3903
|
d
|
|
3904
3904
|
)(
|
|
3905
3905
|
"w.uint32(%i).fork().uint32(%i).%s(ks[i])",
|
|
3906
|
-
(
|
|
3907
|
-
8 | i.mapKey[
|
|
3908
|
-
|
|
3909
|
-
),
|
|
3906
|
+
(m.id << 3 | 2) >>> 0,
|
|
3907
|
+
8 | i.mapKey[m.keyType],
|
|
3908
|
+
m.keyType
|
|
3909
|
+
), p === void 0 ? l("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()", y, d) : l(".uint32(%i).%s(%s[ks[i]]).ldelim()", 16 | p, g, d), l("}")("}")) : m.repeated ? (l("if(%s!=null&&%s.length){", d, d), m.packed && i.packed[g] !== void 0 ? l("w.uint32(%i).fork()", (m.id << 3 | 2) >>> 0)(
|
|
3910
3910
|
"for(var i=0;i<%s.length;++i)",
|
|
3911
3911
|
d
|
|
3912
3912
|
)(
|
|
3913
3913
|
"w.%s(%s[i])",
|
|
3914
3914
|
g,
|
|
3915
3915
|
d
|
|
3916
|
-
)("w.ldelim()") : (l("for(var i=0;i<%s.length;++i)", d),
|
|
3916
|
+
)("w.ldelim()") : (l("for(var i=0;i<%s.length;++i)", d), p === void 0 ? u(l, m, y, d + "[i]") : l("w.uint32(%i).%s(%s[i])", (m.id << 3 | p) >>> 0, g, d)), l("}")) : (m.optional && l("if(%s!=null&&Object.hasOwnProperty.call(m,%j))", d, m.name), p === void 0 ? u(l, m, y, d) : l("w.uint32(%i).%s(%s)", (m.id << 3 | p) >>> 0, g, d));
|
|
3917
3917
|
}
|
|
3918
3918
|
return l("return w");
|
|
3919
3919
|
}
|
|
@@ -3972,25 +3972,25 @@ function unescape(s) {
|
|
|
3972
3972
|
tokenize$1.unescape = unescape;
|
|
3973
3973
|
function tokenize$1(s, i) {
|
|
3974
3974
|
s = s.toString();
|
|
3975
|
-
var r = 0, u = s.length,
|
|
3975
|
+
var r = 0, u = s.length, h = 1, o = 0, l = {}, c = [], d = null;
|
|
3976
3976
|
function a(O) {
|
|
3977
|
-
return Error("illegal " + O + " (line " +
|
|
3977
|
+
return Error("illegal " + O + " (line " + h + ")");
|
|
3978
3978
|
}
|
|
3979
|
-
function
|
|
3979
|
+
function m() {
|
|
3980
3980
|
var O = d === "'" ? stringSingleRe : stringDoubleRe;
|
|
3981
3981
|
O.lastIndex = r - 1;
|
|
3982
|
-
var
|
|
3983
|
-
if (!
|
|
3984
|
-
return r = O.lastIndex, _(d), d = null, unescape(
|
|
3982
|
+
var E = O.exec(s);
|
|
3983
|
+
if (!E) throw a("string");
|
|
3984
|
+
return r = O.lastIndex, _(d), d = null, unescape(E[1]);
|
|
3985
3985
|
}
|
|
3986
3986
|
function y(O) {
|
|
3987
3987
|
return s.charAt(O);
|
|
3988
3988
|
}
|
|
3989
|
-
function g(O,
|
|
3989
|
+
function g(O, E, R) {
|
|
3990
3990
|
var S = {
|
|
3991
3991
|
type: s.charAt(O++),
|
|
3992
3992
|
lineEmpty: !1,
|
|
3993
|
-
leading:
|
|
3993
|
+
leading: R
|
|
3994
3994
|
}, P;
|
|
3995
3995
|
i ? P = 2 : P = 3;
|
|
3996
3996
|
var C = O - P, D;
|
|
@@ -4001,59 +4001,59 @@ function tokenize$1(s, i) {
|
|
|
4001
4001
|
break;
|
|
4002
4002
|
}
|
|
4003
4003
|
while (D === " " || D === " ");
|
|
4004
|
-
for (var I = s.substring(O,
|
|
4005
|
-
I[
|
|
4004
|
+
for (var I = s.substring(O, E).split(setCommentSplitRe), M = 0; M < I.length; ++M)
|
|
4005
|
+
I[M] = I[M].replace(i ? setCommentAltRe : setCommentRe, "").trim();
|
|
4006
4006
|
S.text = I.join(`
|
|
4007
|
-
`).trim(), l[
|
|
4007
|
+
`).trim(), l[h] = S, o = h;
|
|
4008
4008
|
}
|
|
4009
|
-
function
|
|
4010
|
-
var
|
|
4009
|
+
function p(O) {
|
|
4010
|
+
var E = v(O), R = s.substring(O, E), S = /^\s*\/\//.test(R);
|
|
4011
4011
|
return S;
|
|
4012
4012
|
}
|
|
4013
4013
|
function v(O) {
|
|
4014
|
-
for (var
|
|
4014
|
+
for (var E = O; E < u && y(E) !== `
|
|
4015
4015
|
`; )
|
|
4016
|
-
|
|
4017
|
-
return
|
|
4016
|
+
E++;
|
|
4017
|
+
return E;
|
|
4018
4018
|
}
|
|
4019
4019
|
function b() {
|
|
4020
4020
|
if (c.length > 0) return c.shift();
|
|
4021
|
-
if (d) return
|
|
4022
|
-
var O,
|
|
4021
|
+
if (d) return m();
|
|
4022
|
+
var O, E, R, S, P, C = r === 0;
|
|
4023
4023
|
do {
|
|
4024
4024
|
if (r === u) return null;
|
|
4025
|
-
for (O = !1; whitespaceRe.test(
|
|
4026
|
-
if (
|
|
4027
|
-
` && (C = !0, ++
|
|
4025
|
+
for (O = !1; whitespaceRe.test(R = y(r)); )
|
|
4026
|
+
if (R === `
|
|
4027
|
+
` && (C = !0, ++h), ++r === u) return null;
|
|
4028
4028
|
if (y(r) === "/") {
|
|
4029
4029
|
if (++r === u)
|
|
4030
4030
|
throw a("comment");
|
|
4031
4031
|
if (y(r) === "/")
|
|
4032
4032
|
if (i) {
|
|
4033
|
-
if (S = r, P = !1,
|
|
4033
|
+
if (S = r, P = !1, p(r - 1)) {
|
|
4034
4034
|
P = !0;
|
|
4035
4035
|
do
|
|
4036
4036
|
if (r = v(r), r === u || (r++, !C))
|
|
4037
4037
|
break;
|
|
4038
|
-
while (
|
|
4038
|
+
while (p(r));
|
|
4039
4039
|
} else
|
|
4040
4040
|
r = Math.min(u, v(r) + 1);
|
|
4041
|
-
P && (g(S, r, C), C = !0),
|
|
4041
|
+
P && (g(S, r, C), C = !0), h++, O = !0;
|
|
4042
4042
|
} else {
|
|
4043
4043
|
for (P = y(S = r + 1) === "/"; y(++r) !== `
|
|
4044
4044
|
`; )
|
|
4045
4045
|
if (r === u)
|
|
4046
4046
|
return null;
|
|
4047
|
-
++r, P && (g(S, r - 1, C), C = !0), ++
|
|
4047
|
+
++r, P && (g(S, r - 1, C), C = !0), ++h, O = !0;
|
|
4048
4048
|
}
|
|
4049
|
-
else if ((
|
|
4049
|
+
else if ((R = y(r)) === "*") {
|
|
4050
4050
|
S = r + 1, P = i || y(S) === "*";
|
|
4051
4051
|
do {
|
|
4052
|
-
if (
|
|
4053
|
-
` && ++
|
|
4052
|
+
if (R === `
|
|
4053
|
+
` && ++h, ++r === u)
|
|
4054
4054
|
throw a("comment");
|
|
4055
|
-
|
|
4056
|
-
} while (
|
|
4055
|
+
E = R, R = y(r);
|
|
4056
|
+
} while (E !== "*" || R !== "/");
|
|
4057
4057
|
++r, P && (g(S, r - 2, C), C = !0), O = !0;
|
|
4058
4058
|
} else
|
|
4059
4059
|
return "/";
|
|
@@ -4063,8 +4063,8 @@ function tokenize$1(s, i) {
|
|
|
4063
4063
|
delimRe.lastIndex = 0;
|
|
4064
4064
|
var I = delimRe.test(y(D++));
|
|
4065
4065
|
if (!I) for (; D < u && !delimRe.test(y(D)); ) ++D;
|
|
4066
|
-
var
|
|
4067
|
-
return (
|
|
4066
|
+
var M = s.substring(r, r = D);
|
|
4067
|
+
return (M === '"' || M === "'") && (d = M), M;
|
|
4068
4068
|
}
|
|
4069
4069
|
function _(O) {
|
|
4070
4070
|
c.push(O);
|
|
@@ -4077,16 +4077,16 @@ function tokenize$1(s, i) {
|
|
|
4077
4077
|
}
|
|
4078
4078
|
return c[0];
|
|
4079
4079
|
}
|
|
4080
|
-
function w(O,
|
|
4081
|
-
var
|
|
4080
|
+
function w(O, E) {
|
|
4081
|
+
var R = T(), S = R === O;
|
|
4082
4082
|
if (S)
|
|
4083
4083
|
return b(), !0;
|
|
4084
|
-
if (!
|
|
4084
|
+
if (!E) throw a("token '" + R + "', '" + O + "' expected");
|
|
4085
4085
|
return !1;
|
|
4086
4086
|
}
|
|
4087
4087
|
function x(O) {
|
|
4088
|
-
var
|
|
4089
|
-
return O === void 0 ? (
|
|
4088
|
+
var E = null, R;
|
|
4089
|
+
return O === void 0 ? (R = l[h - 1], delete l[h - 1], R && (i || R.type === "*" || R.lineEmpty) && (E = R.leading ? R.text : null)) : (o < O && T(), R = l[O], delete l[O], R && !R.lineEmpty && (i || R.type === "/") && (E = R.leading ? null : R.text)), E;
|
|
4090
4090
|
}
|
|
4091
4091
|
return Object.defineProperty(
|
|
4092
4092
|
{
|
|
@@ -4099,7 +4099,7 @@ function tokenize$1(s, i) {
|
|
|
4099
4099
|
"line",
|
|
4100
4100
|
{
|
|
4101
4101
|
get: function() {
|
|
4102
|
-
return
|
|
4102
|
+
return h;
|
|
4103
4103
|
}
|
|
4104
4104
|
}
|
|
4105
4105
|
);
|
|
@@ -4112,13 +4112,13 @@ parse.defaults = {
|
|
|
4112
4112
|
var tokenize = tokenize_1, Root = requireRoot(), Type = requireType(), Field = requireField(), MapField = requireMapfield(), OneOf = requireOneof(), Enum = require_enum(), Service = requireService(), Method = requireMethod(), types = requireTypes(), util = requireUtil(), base10Re = /^[1-9][0-9]*$/, base10NegRe = /^-?[1-9][0-9]*$/, base16Re = /^0[x][0-9a-fA-F]+$/, base16NegRe = /^-?0[x][0-9a-fA-F]+$/, base8Re = /^0[0-7]+$/, base8NegRe = /^-?0[0-7]+$/, numberRe = /^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/, nameRe = /^[a-zA-Z_][a-zA-Z_0-9]*$/, typeRefRe = /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/, fqTypeRefRe = /^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/;
|
|
4113
4113
|
function parse(s, i, r) {
|
|
4114
4114
|
i instanceof Root || (r = i, i = new Root()), r || (r = parse.defaults);
|
|
4115
|
-
var u = r.preferTrailingComment || !1,
|
|
4115
|
+
var u = r.preferTrailingComment || !1, h = tokenize(s, r.alternateCommentMode || !1), o = h.next, l = h.push, c = h.peek, d = h.skip, a = h.cmnt, m = !0, y, g, p, v, b = !1, _ = i, T = r.keepCase ? function(A) {
|
|
4116
4116
|
return A;
|
|
4117
4117
|
} : util.camelCase;
|
|
4118
4118
|
function w(A, k, N) {
|
|
4119
4119
|
var L = parse.filename;
|
|
4120
4120
|
return N || (parse.filename = null), Error(
|
|
4121
|
-
"illegal " + (k || "token") + " '" + A + "' (" + (L ? L + ", " : "") + "line " +
|
|
4121
|
+
"illegal " + (k || "token") + " '" + A + "' (" + (L ? L + ", " : "") + "line " + h.line + ")"
|
|
4122
4122
|
);
|
|
4123
4123
|
}
|
|
4124
4124
|
function x() {
|
|
@@ -4143,7 +4143,7 @@ function parse(s, i, r) {
|
|
|
4143
4143
|
return !1;
|
|
4144
4144
|
}
|
|
4145
4145
|
try {
|
|
4146
|
-
return
|
|
4146
|
+
return R(
|
|
4147
4147
|
A,
|
|
4148
4148
|
/* insideTryCatch */
|
|
4149
4149
|
!0
|
|
@@ -4153,7 +4153,7 @@ function parse(s, i, r) {
|
|
|
4153
4153
|
throw w(A, "value");
|
|
4154
4154
|
}
|
|
4155
4155
|
}
|
|
4156
|
-
function
|
|
4156
|
+
function E(A, k) {
|
|
4157
4157
|
var N, L;
|
|
4158
4158
|
do
|
|
4159
4159
|
k && ((N = c()) === '"' || N === "'") ? A.push(x()) : A.push([L = S(o()), d("to", !0) ? S(o()) : L]);
|
|
@@ -4161,9 +4161,9 @@ function parse(s, i, r) {
|
|
|
4161
4161
|
var B = {
|
|
4162
4162
|
options: void 0
|
|
4163
4163
|
};
|
|
4164
|
-
B.setOption = function(
|
|
4165
|
-
this.options === void 0 && (this.options = {}), this.options[
|
|
4166
|
-
},
|
|
4164
|
+
B.setOption = function($, j) {
|
|
4165
|
+
this.options === void 0 && (this.options = {}), this.options[$] = j;
|
|
4166
|
+
}, M(
|
|
4167
4167
|
B,
|
|
4168
4168
|
function(j) {
|
|
4169
4169
|
if (j === "option")
|
|
@@ -4175,7 +4175,7 @@ function parse(s, i, r) {
|
|
|
4175
4175
|
}
|
|
4176
4176
|
);
|
|
4177
4177
|
}
|
|
4178
|
-
function
|
|
4178
|
+
function R(A, k) {
|
|
4179
4179
|
var N = 1;
|
|
4180
4180
|
switch (A.charAt(0) === "-" && (N = -1, A = A.substring(1)), A) {
|
|
4181
4181
|
case "inf":
|
|
@@ -4220,7 +4220,7 @@ function parse(s, i, r) {
|
|
|
4220
4220
|
var A = c(), k;
|
|
4221
4221
|
switch (A) {
|
|
4222
4222
|
case "weak":
|
|
4223
|
-
k =
|
|
4223
|
+
k = p || (p = []), o();
|
|
4224
4224
|
break;
|
|
4225
4225
|
case "public":
|
|
4226
4226
|
o();
|
|
@@ -4249,8 +4249,8 @@ function parse(s, i, r) {
|
|
|
4249
4249
|
}
|
|
4250
4250
|
return !1;
|
|
4251
4251
|
}
|
|
4252
|
-
function
|
|
4253
|
-
var L =
|
|
4252
|
+
function M(A, k, N) {
|
|
4253
|
+
var L = h.line;
|
|
4254
4254
|
if (A && (typeof A.comment != "string" && (A.comment = a()), A.filename = parse.filename), d("{", !0)) {
|
|
4255
4255
|
for (var B; (B = o()) !== "}"; ) k(B);
|
|
4256
4256
|
d(";", !0);
|
|
@@ -4260,7 +4260,7 @@ function parse(s, i, r) {
|
|
|
4260
4260
|
function q(A, k) {
|
|
4261
4261
|
if (!nameRe.test(k = o())) throw w(k, "type name");
|
|
4262
4262
|
var N = new Type(k);
|
|
4263
|
-
|
|
4263
|
+
M(N, function(B) {
|
|
4264
4264
|
if (!I(N, B))
|
|
4265
4265
|
switch (B) {
|
|
4266
4266
|
case "map":
|
|
@@ -4277,10 +4277,10 @@ function parse(s, i, r) {
|
|
|
4277
4277
|
re(N, B);
|
|
4278
4278
|
break;
|
|
4279
4279
|
case "extensions":
|
|
4280
|
-
|
|
4280
|
+
E(N.extensions || (N.extensions = []));
|
|
4281
4281
|
break;
|
|
4282
4282
|
case "reserved":
|
|
4283
|
-
|
|
4283
|
+
E(N.reserved || (N.reserved = []), !0);
|
|
4284
4284
|
break;
|
|
4285
4285
|
default:
|
|
4286
4286
|
if (!b || !typeRefRe.test(B)) throw w(B);
|
|
@@ -4301,23 +4301,23 @@ function parse(s, i, r) {
|
|
|
4301
4301
|
var B = o();
|
|
4302
4302
|
if (!nameRe.test(B)) throw w(B, "name");
|
|
4303
4303
|
B = T(B), d("=");
|
|
4304
|
-
var
|
|
4305
|
-
if (
|
|
4306
|
-
|
|
4304
|
+
var $ = new Field(B, S(o()), L, k, N);
|
|
4305
|
+
if (M(
|
|
4306
|
+
$,
|
|
4307
4307
|
function(W) {
|
|
4308
4308
|
if (W === "option")
|
|
4309
|
-
Z(
|
|
4309
|
+
Z($, W), d(";");
|
|
4310
4310
|
else throw w(W);
|
|
4311
4311
|
},
|
|
4312
4312
|
function() {
|
|
4313
|
-
X(
|
|
4313
|
+
X($);
|
|
4314
4314
|
}
|
|
4315
4315
|
), k === "proto3_optional") {
|
|
4316
4316
|
var j = new OneOf("_" + B);
|
|
4317
|
-
|
|
4317
|
+
$.setOption("proto3_optional", !0), j.add($), A.add(j);
|
|
4318
4318
|
} else
|
|
4319
|
-
A.add(
|
|
4320
|
-
!b &&
|
|
4319
|
+
A.add($);
|
|
4320
|
+
!b && $.repeated && (types.packed[L] !== void 0 || types.basic[L] === void 0) && $.setOption(
|
|
4321
4321
|
"packed",
|
|
4322
4322
|
!1,
|
|
4323
4323
|
/* ifNotSet */
|
|
@@ -4329,32 +4329,32 @@ function parse(s, i, r) {
|
|
|
4329
4329
|
if (!nameRe.test(N)) throw w(N, "name");
|
|
4330
4330
|
var L = util.lcFirst(N);
|
|
4331
4331
|
N === L && (N = util.ucFirst(N)), d("=");
|
|
4332
|
-
var B = S(o()),
|
|
4333
|
-
|
|
4332
|
+
var B = S(o()), $ = new Type(N);
|
|
4333
|
+
$.group = !0;
|
|
4334
4334
|
var j = new Field(L, B, N, k);
|
|
4335
|
-
j.filename = parse.filename,
|
|
4335
|
+
j.filename = parse.filename, M($, function(W) {
|
|
4336
4336
|
switch (W) {
|
|
4337
4337
|
case "option":
|
|
4338
|
-
Z(
|
|
4338
|
+
Z($, W), d(";");
|
|
4339
4339
|
break;
|
|
4340
4340
|
case "required":
|
|
4341
4341
|
case "repeated":
|
|
4342
|
-
F(
|
|
4342
|
+
F($, W);
|
|
4343
4343
|
break;
|
|
4344
4344
|
case "optional":
|
|
4345
|
-
b ? F(
|
|
4345
|
+
b ? F($, "proto3_optional") : F($, "optional");
|
|
4346
4346
|
break;
|
|
4347
4347
|
case "message":
|
|
4348
|
-
q(
|
|
4348
|
+
q($, W);
|
|
4349
4349
|
break;
|
|
4350
4350
|
case "enum":
|
|
4351
|
-
Q(
|
|
4351
|
+
Q($, W);
|
|
4352
4352
|
break;
|
|
4353
4353
|
/* istanbul ignore next */
|
|
4354
4354
|
default:
|
|
4355
4355
|
throw w(W);
|
|
4356
4356
|
}
|
|
4357
|
-
}), A.add(
|
|
4357
|
+
}), A.add($).add(j);
|
|
4358
4358
|
}
|
|
4359
4359
|
function te(A) {
|
|
4360
4360
|
d("<");
|
|
@@ -4368,7 +4368,7 @@ function parse(s, i, r) {
|
|
|
4368
4368
|
if (!nameRe.test(L)) throw w(L, "name");
|
|
4369
4369
|
d("=");
|
|
4370
4370
|
var B = new MapField(T(L), S(o()), k, N);
|
|
4371
|
-
|
|
4371
|
+
M(
|
|
4372
4372
|
B,
|
|
4373
4373
|
function(j) {
|
|
4374
4374
|
if (j === "option")
|
|
@@ -4383,20 +4383,20 @@ function parse(s, i, r) {
|
|
|
4383
4383
|
function re(A, k) {
|
|
4384
4384
|
if (!nameRe.test(k = o())) throw w(k, "name");
|
|
4385
4385
|
var N = new OneOf(T(k));
|
|
4386
|
-
|
|
4386
|
+
M(N, function(B) {
|
|
4387
4387
|
B === "option" ? (Z(N, B), d(";")) : (l(B), F(N, "optional"));
|
|
4388
4388
|
}), A.add(N);
|
|
4389
4389
|
}
|
|
4390
4390
|
function Q(A, k) {
|
|
4391
4391
|
if (!nameRe.test(k = o())) throw w(k, "name");
|
|
4392
4392
|
var N = new Enum(k);
|
|
4393
|
-
|
|
4393
|
+
M(N, function(B) {
|
|
4394
4394
|
switch (B) {
|
|
4395
4395
|
case "option":
|
|
4396
4396
|
Z(N, B), d(";");
|
|
4397
4397
|
break;
|
|
4398
4398
|
case "reserved":
|
|
4399
|
-
|
|
4399
|
+
E(N.reserved || (N.reserved = []), !0);
|
|
4400
4400
|
break;
|
|
4401
4401
|
default:
|
|
4402
4402
|
ie(N, B);
|
|
@@ -4409,14 +4409,14 @@ function parse(s, i, r) {
|
|
|
4409
4409
|
var N = S(o(), !0), L = {
|
|
4410
4410
|
options: void 0
|
|
4411
4411
|
};
|
|
4412
|
-
L.setOption = function(B,
|
|
4413
|
-
this.options === void 0 && (this.options = {}), this.options[B] =
|
|
4414
|
-
},
|
|
4412
|
+
L.setOption = function(B, $) {
|
|
4413
|
+
this.options === void 0 && (this.options = {}), this.options[B] = $;
|
|
4414
|
+
}, M(
|
|
4415
4415
|
L,
|
|
4416
|
-
function(
|
|
4417
|
-
if (
|
|
4418
|
-
Z(L,
|
|
4419
|
-
else throw w(
|
|
4416
|
+
function($) {
|
|
4417
|
+
if ($ === "option")
|
|
4418
|
+
Z(L, $), d(";");
|
|
4419
|
+
else throw w($);
|
|
4420
4420
|
},
|
|
4421
4421
|
function() {
|
|
4422
4422
|
X(L);
|
|
@@ -4426,10 +4426,10 @@ function parse(s, i, r) {
|
|
|
4426
4426
|
function Z(A, k) {
|
|
4427
4427
|
var N = d("(", !0);
|
|
4428
4428
|
if (!typeRefRe.test(k = o())) throw w(k, "name");
|
|
4429
|
-
var L = k, B = L,
|
|
4430
|
-
N && (d(")"), L = "(" + L + ")", B = L, k = c(), fqTypeRefRe.test(k) && (
|
|
4429
|
+
var L = k, B = L, $;
|
|
4430
|
+
N && (d(")"), L = "(" + L + ")", B = L, k = c(), fqTypeRefRe.test(k) && ($ = k.slice(1), L += k, o())), d("=");
|
|
4431
4431
|
var j = ee(A, L);
|
|
4432
|
-
ne(A, B, j,
|
|
4432
|
+
ne(A, B, j, $);
|
|
4433
4433
|
}
|
|
4434
4434
|
function ee(A, k) {
|
|
4435
4435
|
if (d("{", !0)) {
|
|
@@ -4442,12 +4442,12 @@ function parse(s, i, r) {
|
|
|
4442
4442
|
if (d(":", !0), c() === "{") L = ee(A, k + "." + H);
|
|
4443
4443
|
else if (c() === "[") {
|
|
4444
4444
|
L = [];
|
|
4445
|
-
var
|
|
4445
|
+
var $;
|
|
4446
4446
|
if (d("[", !0)) {
|
|
4447
4447
|
do
|
|
4448
|
-
|
|
4448
|
+
$ = O(), L.push($);
|
|
4449
4449
|
while (d(",", !0));
|
|
4450
|
-
d("]"), typeof
|
|
4450
|
+
d("]"), typeof $ < "u" && K(A, k + "." + H, $);
|
|
4451
4451
|
}
|
|
4452
4452
|
} else
|
|
4453
4453
|
L = O(), K(A, k + "." + H, L);
|
|
@@ -4477,7 +4477,7 @@ function parse(s, i, r) {
|
|
|
4477
4477
|
function se(A, k) {
|
|
4478
4478
|
if (!nameRe.test(k = o())) throw w(k, "service name");
|
|
4479
4479
|
var N = new Service(k);
|
|
4480
|
-
|
|
4480
|
+
M(N, function(B) {
|
|
4481
4481
|
if (!I(N, B))
|
|
4482
4482
|
if (B === "rpc") ae(N, B);
|
|
4483
4483
|
else throw w(B);
|
|
@@ -4486,11 +4486,11 @@ function parse(s, i, r) {
|
|
|
4486
4486
|
function ae(A, k) {
|
|
4487
4487
|
var N = a(), L = k;
|
|
4488
4488
|
if (!nameRe.test(k = o())) throw w(k, "name");
|
|
4489
|
-
var B = k,
|
|
4490
|
-
if (d("("), d("stream", !0) && (j = !0), !typeRefRe.test(k = o()) || (
|
|
4489
|
+
var B = k, $, j, V, W;
|
|
4490
|
+
if (d("("), d("stream", !0) && (j = !0), !typeRefRe.test(k = o()) || ($ = k, d(")"), d("returns"), d("("), d("stream", !0) && (W = !0), !typeRefRe.test(k = o()))) throw w(k);
|
|
4491
4491
|
V = k, d(")");
|
|
4492
|
-
var J = new Method(B, L,
|
|
4493
|
-
J.comment = N,
|
|
4492
|
+
var J = new Method(B, L, $, V, j, W);
|
|
4493
|
+
J.comment = N, M(J, function(Y) {
|
|
4494
4494
|
if (Y === "option")
|
|
4495
4495
|
Z(J, Y), d(";");
|
|
4496
4496
|
else throw w(Y);
|
|
@@ -4499,7 +4499,7 @@ function parse(s, i, r) {
|
|
|
4499
4499
|
function oe(A, k) {
|
|
4500
4500
|
if (!typeRefRe.test(k = o())) throw w(k, "reference");
|
|
4501
4501
|
var N = k;
|
|
4502
|
-
|
|
4502
|
+
M(null, function(B) {
|
|
4503
4503
|
switch (B) {
|
|
4504
4504
|
case "required":
|
|
4505
4505
|
case "repeated":
|
|
@@ -4518,15 +4518,15 @@ function parse(s, i, r) {
|
|
|
4518
4518
|
for (var H; (H = o()) !== null; )
|
|
4519
4519
|
switch (H) {
|
|
4520
4520
|
case "package":
|
|
4521
|
-
if (!
|
|
4521
|
+
if (!m) throw w(H);
|
|
4522
4522
|
P();
|
|
4523
4523
|
break;
|
|
4524
4524
|
case "import":
|
|
4525
|
-
if (!
|
|
4525
|
+
if (!m) throw w(H);
|
|
4526
4526
|
C();
|
|
4527
4527
|
break;
|
|
4528
4528
|
case "syntax":
|
|
4529
|
-
if (!
|
|
4529
|
+
if (!m) throw w(H);
|
|
4530
4530
|
D();
|
|
4531
4531
|
break;
|
|
4532
4532
|
case "option":
|
|
@@ -4534,7 +4534,7 @@ function parse(s, i, r) {
|
|
|
4534
4534
|
break;
|
|
4535
4535
|
default:
|
|
4536
4536
|
if (I(_, H)) {
|
|
4537
|
-
|
|
4537
|
+
m = !1;
|
|
4538
4538
|
continue;
|
|
4539
4539
|
}
|
|
4540
4540
|
throw w(H);
|
|
@@ -4542,7 +4542,7 @@ function parse(s, i, r) {
|
|
|
4542
4542
|
return parse.filename = null, {
|
|
4543
4543
|
package: y,
|
|
4544
4544
|
imports: g,
|
|
4545
|
-
weakImports:
|
|
4545
|
+
weakImports: p,
|
|
4546
4546
|
syntax: v,
|
|
4547
4547
|
root: i
|
|
4548
4548
|
};
|
|
@@ -4894,16 +4894,39 @@ HorizontalOrigin.CENTER, VerticalOrigin.CENTER, Cartesian3.ZERO, Cartesian2.ZERO
|
|
|
4894
4894
|
var index = {
|
|
4895
4895
|
GeoTerrainProvider
|
|
4896
4896
|
};
|
|
4897
|
+
function invertToCanvas(s) {
|
|
4898
|
+
var c;
|
|
4899
|
+
const i = s.width, r = s.height, u = document.createElement("canvas");
|
|
4900
|
+
u.width = i, u.height = r;
|
|
4901
|
+
const h = u.getContext("2d");
|
|
4902
|
+
h.translate(0, r), h.scale(1, -1), h.drawImage(s, 0, 0);
|
|
4903
|
+
const o = h.getImageData(0, 0, i, r), l = o.data;
|
|
4904
|
+
for (let d = 0; d < l.length; d += 4)
|
|
4905
|
+
l[d] = 255 - l[d], l[d + 1] = 255 - l[d + 1], l[d + 2] = 255 - l[d + 2];
|
|
4906
|
+
return h.putImageData(o, 0, 0), "close" in s && ((c = s.close) == null || c.call(s)), u;
|
|
4907
|
+
}
|
|
4908
|
+
class CustomWebMapTileServiceImageryProvider extends Cesium.WebMapTileServiceImageryProvider {
|
|
4909
|
+
constructor(i) {
|
|
4910
|
+
super(i), this.options = i;
|
|
4911
|
+
}
|
|
4912
|
+
requestImage(i, r, u, h) {
|
|
4913
|
+
const o = super.requestImage(i, r, u, h);
|
|
4914
|
+
return o && o.then((l) => {
|
|
4915
|
+
var c, d;
|
|
4916
|
+
return ((d = (c = this.options).requestInterceptor) == null ? void 0 : d.call(c, l)) ?? l;
|
|
4917
|
+
});
|
|
4918
|
+
}
|
|
4919
|
+
}
|
|
4897
4920
|
function createTdtProvider(s, i) {
|
|
4898
4921
|
const { token: r, ...u } = i;
|
|
4899
|
-
return new
|
|
4922
|
+
return new CustomWebMapTileServiceImageryProvider({
|
|
4900
4923
|
url: `https://t0.tianditu.gov.cn/${s}_w/wmts?tk=${r}`,
|
|
4901
4924
|
layer: s,
|
|
4902
4925
|
style: "default",
|
|
4903
4926
|
format: "tiles",
|
|
4904
4927
|
tileMatrixSetID: "w",
|
|
4905
4928
|
maximumLevel: 18,
|
|
4906
|
-
credit: new Credit("TianDiTu"),
|
|
4929
|
+
credit: new Cesium.Credit("TianDiTu"),
|
|
4907
4930
|
...u
|
|
4908
4931
|
});
|
|
4909
4932
|
}
|
|
@@ -4923,8 +4946,8 @@ function getRawTag(s) {
|
|
|
4923
4946
|
var u = !0;
|
|
4924
4947
|
} catch {
|
|
4925
4948
|
}
|
|
4926
|
-
var
|
|
4927
|
-
return u && (i ? s[symToStringTag$1] = r : delete s[symToStringTag$1]),
|
|
4949
|
+
var h = nativeObjectToString$1.call(s);
|
|
4950
|
+
return u && (i ? s[symToStringTag$1] = r : delete s[symToStringTag$1]), h;
|
|
4928
4951
|
}
|
|
4929
4952
|
var objectProto$7 = Object.prototype, nativeObjectToString = objectProto$7.toString;
|
|
4930
4953
|
function objectToString(s) {
|
|
@@ -5035,8 +5058,8 @@ var HOT_COUNT = 800, HOT_SPAN = 16, nativeNow = Date.now;
|
|
|
5035
5058
|
function shortOut(s) {
|
|
5036
5059
|
var i = 0, r = 0;
|
|
5037
5060
|
return function() {
|
|
5038
|
-
var u = nativeNow(),
|
|
5039
|
-
if (r = u,
|
|
5061
|
+
var u = nativeNow(), h = HOT_SPAN - (u - r);
|
|
5062
|
+
if (r = u, h > 0) {
|
|
5040
5063
|
if (++i >= HOT_COUNT)
|
|
5041
5064
|
return arguments[0];
|
|
5042
5065
|
} else
|
|
@@ -5073,11 +5096,11 @@ function eq(s, i) {
|
|
|
5073
5096
|
var nativeMax$1 = Math.max;
|
|
5074
5097
|
function overRest(s, i, r) {
|
|
5075
5098
|
return i = nativeMax$1(i === void 0 ? s.length - 1 : i, 0), function() {
|
|
5076
|
-
for (var u = arguments,
|
|
5077
|
-
l[
|
|
5078
|
-
|
|
5079
|
-
for (var c = Array(i + 1); ++
|
|
5080
|
-
c[
|
|
5099
|
+
for (var u = arguments, h = -1, o = nativeMax$1(u.length - i, 0), l = Array(o); ++h < o; )
|
|
5100
|
+
l[h] = u[i + h];
|
|
5101
|
+
h = -1;
|
|
5102
|
+
for (var c = Array(i + 1); ++h < i; )
|
|
5103
|
+
c[h] = u[h];
|
|
5081
5104
|
return c[i] = r(l), apply(s, this, c);
|
|
5082
5105
|
};
|
|
5083
5106
|
}
|
|
@@ -5138,11 +5161,11 @@ var freeExports = typeof exports == "object" && exports && !exports.nodeType &&
|
|
|
5138
5161
|
}
|
|
5139
5162
|
}(), nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray, isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
|
5140
5163
|
function arrayLikeKeys(s, i) {
|
|
5141
|
-
var r = isArray(s), u = !r && isArguments(s),
|
|
5164
|
+
var r = isArray(s), u = !r && isArguments(s), h = !r && !u && isBuffer(s), o = !r && !u && !h && isTypedArray(s), l = r || u || h || o, c = l ? baseTimes(s.length, String) : [], d = c.length;
|
|
5142
5165
|
for (var a in s)
|
|
5143
5166
|
l && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
5144
5167
|
(a == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
5145
|
-
|
|
5168
|
+
h && (a == "offset" || a == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
5146
5169
|
o && (a == "buffer" || a == "byteLength" || a == "byteOffset") || // Skip index properties.
|
|
5147
5170
|
isIndex(a, d)) || c.push(a);
|
|
5148
5171
|
return c;
|
|
@@ -5292,11 +5315,11 @@ function memoize(s, i) {
|
|
|
5292
5315
|
if (typeof s != "function" || i != null && typeof i != "function")
|
|
5293
5316
|
throw new TypeError(FUNC_ERROR_TEXT$1);
|
|
5294
5317
|
var r = function() {
|
|
5295
|
-
var u = arguments,
|
|
5296
|
-
if (o.has(
|
|
5297
|
-
return o.get(
|
|
5318
|
+
var u = arguments, h = i ? i.apply(this, u) : u[0], o = r.cache;
|
|
5319
|
+
if (o.has(h))
|
|
5320
|
+
return o.get(h);
|
|
5298
5321
|
var l = s.apply(this, u);
|
|
5299
|
-
return r.cache = o.set(
|
|
5322
|
+
return r.cache = o.set(h, l) || o, l;
|
|
5300
5323
|
};
|
|
5301
5324
|
return r.cache = new (memoize.Cache || MapCache)(), r;
|
|
5302
5325
|
}
|
|
@@ -5305,59 +5328,59 @@ var now = function() {
|
|
|
5305
5328
|
return root.Date.now();
|
|
5306
5329
|
}, FUNC_ERROR_TEXT = "Expected a function", nativeMax = Math.max, nativeMin = Math.min;
|
|
5307
5330
|
function debounce(s, i, r) {
|
|
5308
|
-
var u,
|
|
5331
|
+
var u, h, o, l, c, d, a = 0, m = !1, y = !1, g = !0;
|
|
5309
5332
|
if (typeof s != "function")
|
|
5310
5333
|
throw new TypeError(FUNC_ERROR_TEXT);
|
|
5311
|
-
i = toNumber(i) || 0, isObject(r) && (
|
|
5312
|
-
function
|
|
5313
|
-
var S = u, P =
|
|
5314
|
-
return u =
|
|
5334
|
+
i = toNumber(i) || 0, isObject(r) && (m = !!r.leading, y = "maxWait" in r, o = y ? nativeMax(toNumber(r.maxWait) || 0, i) : o, g = "trailing" in r ? !!r.trailing : g);
|
|
5335
|
+
function p(R) {
|
|
5336
|
+
var S = u, P = h;
|
|
5337
|
+
return u = h = void 0, a = R, l = s.apply(P, S), l;
|
|
5315
5338
|
}
|
|
5316
|
-
function v(
|
|
5317
|
-
return a =
|
|
5339
|
+
function v(R) {
|
|
5340
|
+
return a = R, c = setTimeout(T, i), m ? p(R) : l;
|
|
5318
5341
|
}
|
|
5319
|
-
function b(
|
|
5320
|
-
var S =
|
|
5342
|
+
function b(R) {
|
|
5343
|
+
var S = R - d, P = R - a, C = i - S;
|
|
5321
5344
|
return y ? nativeMin(C, o - P) : C;
|
|
5322
5345
|
}
|
|
5323
|
-
function _(
|
|
5324
|
-
var S =
|
|
5346
|
+
function _(R) {
|
|
5347
|
+
var S = R - d, P = R - a;
|
|
5325
5348
|
return d === void 0 || S >= i || S < 0 || y && P >= o;
|
|
5326
5349
|
}
|
|
5327
5350
|
function T() {
|
|
5328
|
-
var
|
|
5329
|
-
if (_(
|
|
5330
|
-
return w(
|
|
5331
|
-
c = setTimeout(T, b(
|
|
5351
|
+
var R = now();
|
|
5352
|
+
if (_(R))
|
|
5353
|
+
return w(R);
|
|
5354
|
+
c = setTimeout(T, b(R));
|
|
5332
5355
|
}
|
|
5333
|
-
function w(
|
|
5334
|
-
return c = void 0, g && u ?
|
|
5356
|
+
function w(R) {
|
|
5357
|
+
return c = void 0, g && u ? p(R) : (u = h = void 0, l);
|
|
5335
5358
|
}
|
|
5336
5359
|
function x() {
|
|
5337
|
-
c !== void 0 && clearTimeout(c), a = 0, u = d =
|
|
5360
|
+
c !== void 0 && clearTimeout(c), a = 0, u = d = h = c = void 0;
|
|
5338
5361
|
}
|
|
5339
5362
|
function O() {
|
|
5340
5363
|
return c === void 0 ? l : w(now());
|
|
5341
5364
|
}
|
|
5342
|
-
function
|
|
5343
|
-
var
|
|
5344
|
-
if (u = arguments,
|
|
5365
|
+
function E() {
|
|
5366
|
+
var R = now(), S = _(R);
|
|
5367
|
+
if (u = arguments, h = this, d = R, S) {
|
|
5345
5368
|
if (c === void 0)
|
|
5346
5369
|
return v(d);
|
|
5347
5370
|
if (y)
|
|
5348
|
-
return clearTimeout(c), c = setTimeout(T, i),
|
|
5371
|
+
return clearTimeout(c), c = setTimeout(T, i), p(d);
|
|
5349
5372
|
}
|
|
5350
5373
|
return c === void 0 && (c = setTimeout(T, i)), l;
|
|
5351
5374
|
}
|
|
5352
|
-
return
|
|
5375
|
+
return E.cancel = x, E.flush = O, E;
|
|
5353
5376
|
}
|
|
5354
5377
|
var objectProto = Object.prototype, hasOwnProperty = objectProto.hasOwnProperty, defaults = baseRest(function(s, i) {
|
|
5355
5378
|
s = Object(s);
|
|
5356
|
-
var r = -1, u = i.length,
|
|
5357
|
-
for (
|
|
5379
|
+
var r = -1, u = i.length, h = u > 2 ? i[2] : void 0;
|
|
5380
|
+
for (h && isIterateeCall(i[0], i[1], h) && (u = 1); ++r < u; )
|
|
5358
5381
|
for (var o = i[r], l = keysIn(o), c = -1, d = l.length; ++c < d; ) {
|
|
5359
|
-
var a = l[c],
|
|
5360
|
-
(
|
|
5382
|
+
var a = l[c], m = s[a];
|
|
5383
|
+
(m === void 0 || eq(m, objectProto[a]) && !hasOwnProperty.call(s, a)) && (s[a] = o[a]);
|
|
5361
5384
|
}
|
|
5362
5385
|
return s;
|
|
5363
5386
|
});
|
|
@@ -5371,14 +5394,14 @@ function requireEventemitter3() {
|
|
|
5371
5394
|
function u() {
|
|
5372
5395
|
}
|
|
5373
5396
|
Object.create && (u.prototype = /* @__PURE__ */ Object.create(null), new u().__proto__ || (r = !1));
|
|
5374
|
-
function
|
|
5375
|
-
this.fn = d, this.context = a, this.once =
|
|
5397
|
+
function h(d, a, m) {
|
|
5398
|
+
this.fn = d, this.context = a, this.once = m || !1;
|
|
5376
5399
|
}
|
|
5377
|
-
function o(d, a,
|
|
5378
|
-
if (typeof
|
|
5400
|
+
function o(d, a, m, y, g) {
|
|
5401
|
+
if (typeof m != "function")
|
|
5379
5402
|
throw new TypeError("The listener must be a function");
|
|
5380
|
-
var
|
|
5381
|
-
return d._events[v] ? d._events[v].fn ? d._events[v] = [d._events[v],
|
|
5403
|
+
var p = new h(m, y || d, g), v = r ? r + a : a;
|
|
5404
|
+
return d._events[v] ? d._events[v].fn ? d._events[v] = [d._events[v], p] : d._events[v].push(p) : (d._events[v] = p, d._eventsCount++), d;
|
|
5382
5405
|
}
|
|
5383
5406
|
function l(d, a) {
|
|
5384
5407
|
--d._eventsCount === 0 ? d._events = new u() : delete d._events[a];
|
|
@@ -5387,22 +5410,22 @@ function requireEventemitter3() {
|
|
|
5387
5410
|
this._events = new u(), this._eventsCount = 0;
|
|
5388
5411
|
}
|
|
5389
5412
|
c.prototype.eventNames = function() {
|
|
5390
|
-
var a = [],
|
|
5413
|
+
var a = [], m, y;
|
|
5391
5414
|
if (this._eventsCount === 0) return a;
|
|
5392
|
-
for (y in
|
|
5393
|
-
i.call(
|
|
5394
|
-
return Object.getOwnPropertySymbols ? a.concat(Object.getOwnPropertySymbols(
|
|
5415
|
+
for (y in m = this._events)
|
|
5416
|
+
i.call(m, y) && a.push(r ? y.slice(1) : y);
|
|
5417
|
+
return Object.getOwnPropertySymbols ? a.concat(Object.getOwnPropertySymbols(m)) : a;
|
|
5395
5418
|
}, c.prototype.listeners = function(a) {
|
|
5396
|
-
var
|
|
5419
|
+
var m = r ? r + a : a, y = this._events[m];
|
|
5397
5420
|
if (!y) return [];
|
|
5398
5421
|
if (y.fn) return [y.fn];
|
|
5399
|
-
for (var g = 0,
|
|
5422
|
+
for (var g = 0, p = y.length, v = new Array(p); g < p; g++)
|
|
5400
5423
|
v[g] = y[g].fn;
|
|
5401
5424
|
return v;
|
|
5402
5425
|
}, c.prototype.listenerCount = function(a) {
|
|
5403
|
-
var
|
|
5426
|
+
var m = r ? r + a : a, y = this._events[m];
|
|
5404
5427
|
return y ? y.fn ? 1 : y.length : 0;
|
|
5405
|
-
}, c.prototype.emit = function(a,
|
|
5428
|
+
}, c.prototype.emit = function(a, m, y, g, p, v) {
|
|
5406
5429
|
var b = r ? r + a : a;
|
|
5407
5430
|
if (!this._events[b]) return !1;
|
|
5408
5431
|
var _ = this._events[b], T = arguments.length, w, x;
|
|
@@ -5411,71 +5434,71 @@ function requireEventemitter3() {
|
|
|
5411
5434
|
case 1:
|
|
5412
5435
|
return _.fn.call(_.context), !0;
|
|
5413
5436
|
case 2:
|
|
5414
|
-
return _.fn.call(_.context,
|
|
5437
|
+
return _.fn.call(_.context, m), !0;
|
|
5415
5438
|
case 3:
|
|
5416
|
-
return _.fn.call(_.context,
|
|
5439
|
+
return _.fn.call(_.context, m, y), !0;
|
|
5417
5440
|
case 4:
|
|
5418
|
-
return _.fn.call(_.context,
|
|
5441
|
+
return _.fn.call(_.context, m, y, g), !0;
|
|
5419
5442
|
case 5:
|
|
5420
|
-
return _.fn.call(_.context,
|
|
5443
|
+
return _.fn.call(_.context, m, y, g, p), !0;
|
|
5421
5444
|
case 6:
|
|
5422
|
-
return _.fn.call(_.context,
|
|
5445
|
+
return _.fn.call(_.context, m, y, g, p, v), !0;
|
|
5423
5446
|
}
|
|
5424
5447
|
for (x = 1, w = new Array(T - 1); x < T; x++)
|
|
5425
5448
|
w[x - 1] = arguments[x];
|
|
5426
5449
|
_.fn.apply(_.context, w);
|
|
5427
5450
|
} else {
|
|
5428
|
-
var O = _.length,
|
|
5451
|
+
var O = _.length, E;
|
|
5429
5452
|
for (x = 0; x < O; x++)
|
|
5430
5453
|
switch (_[x].once && this.removeListener(a, _[x].fn, void 0, !0), T) {
|
|
5431
5454
|
case 1:
|
|
5432
5455
|
_[x].fn.call(_[x].context);
|
|
5433
5456
|
break;
|
|
5434
5457
|
case 2:
|
|
5435
|
-
_[x].fn.call(_[x].context,
|
|
5458
|
+
_[x].fn.call(_[x].context, m);
|
|
5436
5459
|
break;
|
|
5437
5460
|
case 3:
|
|
5438
|
-
_[x].fn.call(_[x].context,
|
|
5461
|
+
_[x].fn.call(_[x].context, m, y);
|
|
5439
5462
|
break;
|
|
5440
5463
|
case 4:
|
|
5441
|
-
_[x].fn.call(_[x].context,
|
|
5464
|
+
_[x].fn.call(_[x].context, m, y, g);
|
|
5442
5465
|
break;
|
|
5443
5466
|
default:
|
|
5444
|
-
if (!w) for (
|
|
5445
|
-
w[
|
|
5467
|
+
if (!w) for (E = 1, w = new Array(T - 1); E < T; E++)
|
|
5468
|
+
w[E - 1] = arguments[E];
|
|
5446
5469
|
_[x].fn.apply(_[x].context, w);
|
|
5447
5470
|
}
|
|
5448
5471
|
}
|
|
5449
5472
|
return !0;
|
|
5450
|
-
}, c.prototype.on = function(a,
|
|
5451
|
-
return o(this, a,
|
|
5452
|
-
}, c.prototype.once = function(a,
|
|
5453
|
-
return o(this, a,
|
|
5454
|
-
}, c.prototype.removeListener = function(a,
|
|
5455
|
-
var
|
|
5456
|
-
if (!this._events[
|
|
5457
|
-
if (!
|
|
5458
|
-
return l(this,
|
|
5459
|
-
var v = this._events[
|
|
5473
|
+
}, c.prototype.on = function(a, m, y) {
|
|
5474
|
+
return o(this, a, m, y, !1);
|
|
5475
|
+
}, c.prototype.once = function(a, m, y) {
|
|
5476
|
+
return o(this, a, m, y, !0);
|
|
5477
|
+
}, c.prototype.removeListener = function(a, m, y, g) {
|
|
5478
|
+
var p = r ? r + a : a;
|
|
5479
|
+
if (!this._events[p]) return this;
|
|
5480
|
+
if (!m)
|
|
5481
|
+
return l(this, p), this;
|
|
5482
|
+
var v = this._events[p];
|
|
5460
5483
|
if (v.fn)
|
|
5461
|
-
v.fn ===
|
|
5484
|
+
v.fn === m && (!g || v.once) && (!y || v.context === y) && l(this, p);
|
|
5462
5485
|
else {
|
|
5463
5486
|
for (var b = 0, _ = [], T = v.length; b < T; b++)
|
|
5464
|
-
(v[b].fn !==
|
|
5465
|
-
_.length ? this._events[
|
|
5487
|
+
(v[b].fn !== m || g && !v[b].once || y && v[b].context !== y) && _.push(v[b]);
|
|
5488
|
+
_.length ? this._events[p] = _.length === 1 ? _[0] : _ : l(this, p);
|
|
5466
5489
|
}
|
|
5467
5490
|
return this;
|
|
5468
5491
|
}, c.prototype.removeAllListeners = function(a) {
|
|
5469
|
-
var
|
|
5470
|
-
return a ? (
|
|
5492
|
+
var m;
|
|
5493
|
+
return a ? (m = r ? r + a : a, this._events[m] && l(this, m)) : (this._events = new u(), this._eventsCount = 0), this;
|
|
5471
5494
|
}, c.prototype.off = c.prototype.removeListener, c.prototype.addListener = c.prototype.on, c.prefixed = r, c.EventEmitter = c, s.exports = c;
|
|
5472
5495
|
}(eventemitter3)), eventemitter3.exports;
|
|
5473
5496
|
}
|
|
5474
5497
|
var eventemitter3Exports = requireEventemitter3();
|
|
5475
5498
|
const EventEmitter = /* @__PURE__ */ getDefaultExportFromCjs(eventemitter3Exports);
|
|
5476
5499
|
class WmsLayer {
|
|
5477
|
-
constructor(i, r, u,
|
|
5478
|
-
this.ctrl = i, this.key = r, this.layer = u, this.zIndex =
|
|
5500
|
+
constructor(i, r, u, h = 1 / 0) {
|
|
5501
|
+
this.ctrl = i, this.key = r, this.layer = u, this.zIndex = h, this.ctrl.registerLayer(this);
|
|
5479
5502
|
}
|
|
5480
5503
|
show(i) {
|
|
5481
5504
|
this.ctrl.showLayer(i, this.key);
|
|
@@ -5524,18 +5547,18 @@ class WmsLayerController extends EventEmitter {
|
|
|
5524
5547
|
showLayer(r, u) {
|
|
5525
5548
|
if (!this.layerMap.has(u))
|
|
5526
5549
|
throw new Error(`Layer with key 【${u}】 is not registered`);
|
|
5527
|
-
this.showLayers.push(u), this.showLayers.sort((
|
|
5528
|
-
const l = this.layerMap.get(
|
|
5550
|
+
this.showLayers.push(u), this.showLayers.sort((h, o) => {
|
|
5551
|
+
const l = this.layerMap.get(h).zIndex, c = this.layerMap.get(o).zIndex;
|
|
5529
5552
|
return l - c;
|
|
5530
5553
|
}), this.update(r);
|
|
5531
5554
|
}
|
|
5532
5555
|
hideLayer(r, u) {
|
|
5533
|
-
const
|
|
5534
|
-
|
|
5556
|
+
const h = this.showLayers.indexOf(u);
|
|
5557
|
+
h !== -1 && (this.showLayers.splice(h, 1), this.update(r));
|
|
5535
5558
|
}
|
|
5536
5559
|
hookClickEvent(r) {
|
|
5537
5560
|
this.handler = new ScreenSpaceEventHandler(r.scene.canvas), this.handler.setInputAction(async (u) => {
|
|
5538
|
-
const
|
|
5561
|
+
const h = r.scene, o = h.camera.getPickRay(u.position), l = await h.imageryLayers.pickImageryLayerFeatures(o, r.scene);
|
|
5539
5562
|
this.emit("click", l);
|
|
5540
5563
|
}, ScreenSpaceEventType.LEFT_CLICK);
|
|
5541
5564
|
}
|
|
@@ -5581,8 +5604,8 @@ const createShipIconUrl = memoize(
|
|
|
5581
5604
|
(s, i) => `${s},${i}`
|
|
5582
5605
|
), createShipIconV2 = memoize(
|
|
5583
5606
|
(s) => {
|
|
5584
|
-
const i = s.designBeam, r = s.designLength, u = s.aisFromBow != null && s.aisFromCenter != null ? { x: s.aisFromCenter, y: s.designLength - s.aisFromBow } : { x: 0, y: r / 2 },
|
|
5585
|
-
C${
|
|
5607
|
+
const i = s.designBeam, r = s.designLength, u = s.aisFromBow != null && s.aisFromCenter != null ? { x: s.aisFromCenter, y: s.designLength - s.aisFromBow } : { x: 0, y: r / 2 }, h = `${i / 2 + u.x} ${u.y}`, o = `${-i / 2 + u.x} ${u.y}`, l = `${u.x} ${u.y}`, c = `${u.x} ${-r + u.y}`, d = Math.floor(r * 4 / 5), a = Math.floor((r - d) * 2 / 3), m = `M${l}
|
|
5608
|
+
C${h} ${h} ${i / 2 + u.x} ${u.y - 3}
|
|
5586
5609
|
V${-d + u.y}
|
|
5587
5610
|
C${i / 2 + u.x} ${u.y - d - a} ${2 + u.x} ${-r + u.y} ${c}
|
|
5588
5611
|
C${-2 + u.x} ${-r + u.y} ${-i / 2 + u.x} ${u.y - d - a} ${-i / 2 + u.x} ${-d + u.y}
|
|
@@ -5590,8 +5613,8 @@ const createShipIconUrl = memoize(
|
|
|
5590
5613
|
C${o} ${o} ${l}`, y = Math.max(Math.abs(i / 2 + u.x), Math.abs(-i / 2 + u.x)), g = Math.max(
|
|
5591
5614
|
Math.abs(-r + u.y + (s.isMoving ? -5 : 0)),
|
|
5592
5615
|
Math.abs(u.y + (s.isMoving ? 146 / 124 * i : 0))
|
|
5593
|
-
),
|
|
5594
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="${
|
|
5616
|
+
), p = [-y * 1.2, -g, 2 * y * 1.2, 2 * g], v = { x: 2 * 1.2 * y / i, y: 2 * g / r }, b = `<?xml version="1.0" encoding="UTF-8"?>
|
|
5617
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="${p.join(" ")}">
|
|
5595
5618
|
<defs>
|
|
5596
5619
|
<style>
|
|
5597
5620
|
#svg_1,
|
|
@@ -5617,11 +5640,11 @@ const createShipIconUrl = memoize(
|
|
|
5617
5640
|
</defs>
|
|
5618
5641
|
<g>
|
|
5619
5642
|
<path id="svg_1" data-name="svg 1" class="cls-2" d="M${c}v-5"/>
|
|
5620
|
-
<path id="svg_4" data-name="svg 4" class="cls-1" d="${
|
|
5643
|
+
<path id="svg_4" data-name="svg 4" class="cls-1" d="${m}"/>
|
|
5621
5644
|
</g>
|
|
5622
5645
|
<image id="img_1" width="${i}" height="${146 / 124 * i}" transform="translate(${-i / 2 + u.x} ${u.y})" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHwAAACSCAMAAACwjl5+AAAAq1BMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Nr6iZAAAAOXRSTlMABRshFgkSZg5qJmFdWlEqOXBFPYVJQYB1VXtNLpc1mzKguZCKtJONxc69yaukwa/SqN/k1trs6fBhRQqRAAAVcElEQVR42rSX3ZKaQBCFgxoIICh/ggjiIMPPMAOy6yZ5/yfLaTBVSa5istu1Vepe+M3p7jkHPz1Vmqav99umYLxsh7bvO6oeb8ZR1XUS7TaftU8fVdqX9cWpGBt5WeJvKbwbOJvyujEPlv5RcLBXZyesc1lyMSk5qWmS0zQxNQrGVF2Fpv9hdOg+2HFzZZwPQjFWFAxV4FUNJd5VcWr4u4+hgx0YcVgVchRtOSmW50wpVoA+lS0vWB6mifkxdE2H7jSOazaVfYtJo91yHKVSUmLq/Yihp2Zi09a9N1rb7Hxi07oN/dAOgnMwB4F9E3jtW1Y1oWea2yhbve/Oa583WWR4SRLnGHAPVkd3bblpA70XvcjDKjVs24ku70rX9NU5OgIeV9ect0L03a3rbve3l5e3+6273Vp0opVVmnrG1jkFl9UX7R3HfY5c2zCTOLxKNHzobzdCv3779voK/ls3tOi+ihPPcI5uFGRrXdPeZ8t16+y7zpbgVcHFWLb9fUZ/RX0D/e2txew5zxPTcNzIP+xBR+vfgb2x9oeTe3Rs04sLXuKmDWg5sb+jFnqH9ZejrL3t1o0Oh+CcrWG1/4v//GW1OwfR6XRybC+5SrBLPnTd/YXYC/3l7XYfJB+VVA3aHgX7/fli/TddA3ud7Q++758cI6kUVwo3rOu7t9/ht46rETe/iA3Az5cs261X+hfQ/4Otb9a7bB/sA9+1zbCYGIOx4FID/voV9AWOje8GxSaY3jW1XYzcsnbWf9E1DfNeW1l2yc6B75hxDjNVk6Q4Rdtp3x4zv3dt23Oy+bquUvsUZNYatdro/9p5DT3XV+vdzoL2w8mAvxQ5myYOV8Nd+3Xbcc/FMMi8YHVThcnWP6PpKEj/RzqxN6sVFFhZcLLTpr5emWLY9bKEdOz7y+sr7jnYHdlsK1id502cpiboFmRvdP0f6doM36yAt86nbRI2VZNDOhKNC4E2d2RwZHFd3w/0SNGWeQh/T5LEcP3LekZ/Ibj2D2zAddIOtu2lYVhBe46m0zMM3LSH+Du5a48dIIsR7djEYZh6nrk9+hnoQKOI/jx7hsNiItwyBFrYNLUSw5xipRiIjuoQK2I+Ec7FwjROPdNAugSXtb6wn4VrgC/0DXTD29BL0l4AywXAC7z7CUemcVGWguepl3j2duu4fgDtRNeonkE/lGPbd/uDC1f3AE/DRopyxLy7dhF+R6Ht6Hvfl0LAfiaKdANsN6KVJ7r2DF2b8UQn9vlwOm4Nw/C8JG0Y59O86X1PaAQKbJ0cBp96gYONYxFTpB+jU3QILkR/Dg70DH9Yq++6jjNrjwspmSxFf7+haNdfUbTvd3y80aOVUqpOwJ7DBelikckR+pmpL2xY6yXwoyiCr9tmWk9TAe0DdRua6ZajwId8/KsT6EtRFNdk60L3/nwm+Op5kyO2DmslX/UPCJWtnTQKXy1H3kPmA/2VCnyoB73lUsLd89A8Rj5kZxdKF1y4ZzeOdK8g/LzfI9NcxGmY44uVlAIr/gb0w9oX+uvcezFNKr9em9RwoTzbWZa1pnQh+rPuBjgOf4H4E1KlZvm1UArCO8DB/hmpRCc4nuQ4Q9erKgQdcEITXMfGPwfXdfJVJCP2PXI8/FBpmpwxJfr+Tzgpn1O1E6ou6iqGzxgu7fqKavOUv2soEo4Cn/bdTMMqrBAbBcdzKsFfCL7Uo+1ksy2vq2sTpgmM5rTPMPCNjlou+xMTJ2PdIFHpott4ao3jqq7rSQyI0+7nri/o5b6BDZdVOCS5u2c6PugbkDHzv/fYh79QAZ4FEaVKnMLZYTJi5PQksaw7isiERra1A5KN5yEOCrZpH/39brUE27PwxdjBPm3JW6EdMx/LceJwmY7w4FMRmVynF/T8yuU1TuPEtJEt7gGp/uj5X8G1GQ42iYe7BtHR9lApsrKZypFN40hhPofKfanbPO4WB5OTlKpKEsC3DmJ1pgP+t/SHsxKc2DB22zChHXTGR8YmGCzEi2E+AaoHeBAlShZMqUnm1HWyWPr1cAH9eTjYtGwzfKbHteSqUIyNUDhyjgBdCmDORym5hAnR6a7JD8bMdrtJKIii/lBZCMQQsHxEQggUXJqsmPd/OfeZIU2rxeSk1ja6upnLvXPm0ABfqxj1iS6ct0fpOIDQ3uC+cMIJKkkSAa/705HWDv4Zgio8nl1wL6eTZupubJlgu3bA0ZWaNsDlbDP9sboRa/5FprJarWzh04GiTecj5tHBv8wyckt0Pp+apuPrZizCpAKeZdkaczH6h4fgXrvYu6cNtszCK6Q1/FDq5kEU5tEiqnfB5lu4Z25L02l2n4qAZd+4s321Lf8Q29CwMZX1EzJHS4u+bUbVrsPG0r6Urk++JK2yzImHQz67RxW2uvtObCK6PEaX689uChxhKnEclJrZR4iXw0FPYcD5TT+6Lnrrogh5YlXGKc8Lmbo5G97mvnofjjyoEFN2+/06+8YEJ1uxof30rCcxR5i+3w/88b2uC7FHgzL0CWspA2ZImQuazQX8vdLd0MzPFJP0NKTOEa29Of903O2g3Q4bH37YJ1lLqscE26ed1hx9fIiuG+4hCfr3vTW4moYJfOpPz4fzQVg1GboM+qVPhCXe8As7n/qcVae5z3TB5VHe6e7nFODQZeWbKgiZmens0Nvz8/kMG5j3N17+SU2OrPgsHRscsKBwJuiKvAoctKc2dN/QoIMXOzJXofIi7y/MaKwtGEO/Fnj4uvvsx77mctMgthFadNj3fdU9xa2cLbfH0WgvKaWzg4YO02BT/RRb6N8vEl3vHrzdtTkXnOItMa3GogPsx+HQ1eBWZipBWgrfXI5dd4MjB+tjLv2n0HooW4fKa9WqqlZbp4NG9+GIdZeTJ8AjZRU04BgaXg/XG/5afte56RddYUfpZJwoxluY4DP56mehpUX0Sz6kyexlKlGs2nHIMqeB9vRXAot2OnQTWORs3tfD4I5e2BdYi+DfkMxFLc7pd3KKtjv50DwliWNb+GKkb41tQ3tFhne+yw4b7x+s74+0pDqIY+D4Grlprdj0EPyTxaS1DI1VS7TwYdE3Yz70Y4950Nqcj37wQkY+2DlracPjwMEsbZzYQJa1Qb9/1JBn00yGZo4WRUE5jH0OPJ86NhSbTjrc5GD907EbcuoGXoTxSpFNDwTdV4Hfvedycj32Yxag+iROopLZcSjUZ0Z8FS/Fy9TdX8Q35uqytImrHApUh8lWeRGH2O08tIn+/7Rwc1MuQDc9LAaVYpN7O/Zj00rdG7USzkdaymu1pLrEWjhoegpriVHWptrvZ1NzU6q3QaIWWD5VjCOeMUym/o3sHYpmbyivQC/pM+7p+68I+J3cdM2mhEMCosNDSysKAuVgMYwA4Xr7NwLLIjFIhKWuFWOLKh00C4xyN4cvsy0e4qWyU1Y9DtRcVXtZ5uPEWtLr0/cFTNR8wFVqWYsezkBnt10T4zLd46HsTNJ93yZ0GO6eF0XrKOs0Igi9VRDNSoMIC8yhp6lKp8tpiF07nI69bOpeuKwcsfRKxrBT8Ah2M9T6gWmUzIrn11UBIQnzZ1PUqXw45KTgLZudx9WP17z6LtvhEnCbI7RyobFr20o1lxJcyf7p9k0V63+XrHs/lGYIQVUB/6aJYrb0pbB8tXLJn0Kps0bmaUSGOfSnpVIYLf8vxRJeZvCpz21vBDENmoXPCE0sOVpwNhU+26k2fEZ/MQI/hDLyhgOs81PUeCUBSh3fdf1a/qerq6m8n4pU73LWVnJVjI3KYQuOFuCiW2uvYMeWF9IQX2HRgdfsPE1ntre1tP7y/c/bhQ65OsGAs6BI1kJgtNo/O1taiofQxd4Cjz2lhVE5NSPdhQPNXiql+l+VqJig85+g55hqECixbdXib8a2AP9kcNnpHBCrxCeZnACk85tPjOSu/G/5u712ZT5IRaitANyU3YwN9hKcNbfWVjEECR5YZJhyFT6QBwaX+qu1VGRfDaa+ha7Dhhtg6RzzrRz9m8VV6P+p3C1NdmrTl+VTevsweW35yDQziwTxSjR9F84yFaIP9GEs3eJilsHPdqSXJU8XXAFRbRUj3/Jh+z1gAwlMQRPGJayD21cS39SPXUN7LVQ4+zBWDbL0eaKQsS2uO3ZqVi5t9LAZdjGbWk3h4+glvwOX7LoovRS9AK4Jdk7K/PHf8y1VDpuB+WnDK3vaasPTqyFD1yZutOg39nt0ZdlmoCH671pEF3wvo8TVvyxMFNZc9Zh5nZk2Gh9lFMU8GwycdYOP/6BFN75fXK8l97wWRBw27rdccjmp+xwhP9lpkbThV2KXYEGXHDf96OkP4+a6szQQRdEfairpFBFDTcUQEo2+/xu61tkTS6Fetn6lBXTN5cy5zCgufh34p27bOkyfK+fohnTYRRdOoORnN5kSnuPDu2ewd+F0PHUas3cwh3QFaW/iX5T3f7oGf8S1u/1bS/2adWa43E1nksSYR7iXILx8Oz5TvkXDt2/uqgLvGVRfXdt7/GDV0t8/SweOzbZjdZ1Og98r1GWviYTnC6x064Wh4gphlZVbS311MvEruefTfqd51io/MGce7i0Ty43NwE02swuvoQHu9r4xzSxKk3XpWKnyF5fx70uupknnGXIDovsDTB/Fg5GFbu8kFLKFSweejUc1Ch/aR3jmwq67L3+V9uE+rSncZD6Ac79a+rgVmX6/34VDF89yc8InR4zGwx7oC4mR+SE56d9k3mFJ7fokj2kDxk5QNa5BF76TTwg3jXHa8XE0Vq+80HTYHCAziobWwQYMJV72dNCrQTfm4lzbYFybZ+GVzqwx/TWTEO6g42DIAJbRcWPQ+w4LFjC2B1XQRf2pz9OItRy0UwZ+qjp5xmUZ1xJUw94NqJ5fnum5g8WkSXSDhdCK1eqqEW2rFxT156qph5EX6M4PDmYxrlGpWq6Sxa5BVXzYqtipEYksFGq612nC0mGP5CR4PFODrtzNmydvptH9CMfMiTpelzrgw3GsYe2159lxxdJPcA0sTvxybBQNOqrGkuFQfEY4/vygCgS+pWZ1aY1RW4AP0JfL5ZjTRU4Hjeid/oez01P9ZSfhDuOg/bbRFdPG6xxil6X3eo9swHmxQLPewPzoOqMoHK95A25k2YVXYe755afbjQYw824/1nnJOHnfzrIDN/ggr6pe0v3raNcZeMWsm8CdrJEJqS9hTfQa1O6nG9+52QXymUqchwoOlBDLHPiKW3u+ws9tmC7O/WAG6T9Qo+eUyXiv/UJZth0HDtrA4gQycybpYxm5Zjyj4GuyHezcBR34PPF95szI4MpcznzugL/Bf+3Dy9RpWgJv4Ow/Rg2f4/XcNUd1t3lUl+OAU7W1iPVpiV7wFIE7cDsOXDk8NfNnklc00OXFblDyYQZbnTdPSTwtGMmZq+u2wmopcJw3l6QTzwVqon0F9TvsY1UN5iKyMbulexYux67c5Fb5zgR8gL60jBYnXCfqVPv8VhnXNvDs8Ecaxt2lBsyqwSboMPRX8peuCXHx2qWHMxz1pi6Dsz/Htb5Jp1Ui+lNEjarnfR8O+Ii1mRfQC913aK3x8ygr9PUTF8nIiLvpfcUiWWyOu31Ga5EeduC2q8MxOGyHIbQHzbKUXjgFklj3pSqLvagW1VdqQ2N0EBoR1YVQeRSAIu/Aiaj8hq2n0XuSQ2Yoa7UfBKU2/6P89OD14E4UYKaIBK68AfRYOnqFI+H0G7hrl8gK/GqIMnonLVKHVZv7UjmlwUcHXrs5n+534XFvgGVv4CoWD5uVhuYkQNNQkMG9b8l/1WA0KfjHFAzXrLQ4rxQsXU/RPLtwZO7GgBv2XoeZmVrhDP4/6H6crhvVTCQqrpzWgsWgFj1vdVfZ4FYpv4Abpa9T7bMVX1/7r55rm1DLMprmNp/jY8D3roe+iWmyM+NGn9g70dk0TBturfr0b3h9rax+qHNsTDeuHXxmPfS9Q0zheliC/2ypOrlWm3xNqfTXGY/JuZuDCk4vgJfnNK5I3+m51vbbuwNH87G7DfiY23/J2Y4TEs6ZIqpSDTzqA/9ywPAWquh4d3S6LCg+02nP9PtrR/UB8r5Ni9k31wv/WgYJx3/tnen+HvVEFo9xNbrKoY+JFgxjuoPGyJt4u/UdRTvbom9G2romVOMNHeVUdSeqgbeBTn1K1asxNIctrQYBTQ/aPijVmqk3fxj4rG9zsg0rMLi+Bhbhyi+kWCWymUVXWgw8KXuPpj4oHxXEh8dJeLLAZMwOaHZfs/e8F1j8gi/Q4bNBUhbfvTy9iDIUzCaKLlu53yrVxcoaT20eOPQ/wUHzacFJZJOemstSrhfLla/ykmRO5b3+cbXG/AEnbfYWcws8brQv9RUOVDKqrhvbNHd3aPA6RuRiPeqm1Obdas+cHahEszgXu2aPxb97hqvesFoT+kP4LlHgs6i7P6voU3R/VL6WhBW8fx7vVlMuXMnewHuIDzzeBrye1mTW7n94kh/428uTgJaZSdezKkcdePQCh42EO+mhO10eeRiMuckRVcnHVXDymg9sr/+pwcn7qmfdepdNWFsbI3w1d3ukv/v6qzoz2lEQBqJoVjQx/P8Hb6/nwoUyK9Xwskd3LYVynNrOxKgoxM3Q6MjZRrM6n5NgvIsjz2oP3u+CMkSuXcffebSnDvQEOtOh0iw5drqT1Yfks9yT4kdgpAmHTkwzw1zLWq/GPyVvWszAO9nMum6hxZSJQ32gXV3hkKkTjTaYzOrI//hJUXKGU+DyoUnVcS+OGe2ZW0PXWO906Y94rXMdY5YABCbu4YZtPqSlPsmx64Xvplz1LO3rrHOjfG/jDq5JGBs0OeCQBtF71SyhNyxf8kwdeOQa4zlDLjC+gcGWK2Ts28jL0JPhCzn2sO/ozmveHLrlOktNQx573Mrw+pMcptd48guaPelIl985n7aOWTGKGmq58jvR42HmeO8fwQBG61bMeuSxJ8NC5I4g8sm4lYamx829vb04/eR33KOc/L6VW0YES0Rn4JY1C/3FstgqeZCcVe3BLmXB5U11GlLXwsxYy5c9Hio3S57gb1DVz/lAd83s2J0ipEaOC3lZW4TlhG8Q5B2khLvZIa/+2GbrLkNdy7Ez89SIL8C9+7yRk0137n7DEXrsPE2a4XD+FjcLXchdE3sv75lug50pZnaf2rPbBfIvwA2jcoh9iZ//PGjxKPu4HHe3yc7cWfPU9+9hlRfZpSZyIH4gkGGezDecu9kGsSt+eGeoScy4R+Ry93v+oWfNozrDEIaiHXRD7DXkDONmzdY7oGbuAxPH/wEwphW49aD/MlAP40uv1I7bCf2a+KP+wF2p1f3pdBHHJfycnf43/AJwK37vPZnSygAAAABJRU5ErkJggg=="/>
|
|
5623
5646
|
</svg>`;
|
|
5624
|
-
return { url: URL.createObjectURL(new Blob([b], { type: "image/svg+xml" })), viewBox:
|
|
5647
|
+
return { url: URL.createObjectURL(new Blob([b], { type: "image/svg+xml" })), viewBox: p, scale: v };
|
|
5625
5648
|
},
|
|
5626
5649
|
(s) => `${s.color},${s.isMoving},${s.designBeam ?? 0},${s.designLength ?? 0},${s.aisFromBow ?? 0},${s.aisFromCenter ?? 0}`
|
|
5627
5650
|
), shipTypeColorMap = /* @__PURE__ */ new Map([
|
|
@@ -5673,144 +5696,147 @@ const createShipIconUrl = memoize(
|
|
|
5673
5696
|
// 油船
|
|
5674
5697
|
]);
|
|
5675
5698
|
function createAlphaSampled(s) {
|
|
5676
|
-
const i = new Cesium.SampledProperty(Cesium.Color), r = (s == null ? void 0 : s.startTime) ?? Cesium.JulianDate.now(), u = Cesium.JulianDate.addMinutes(r, 1, new Cesium.JulianDate()),
|
|
5677
|
-
return i.addSample(r, l.withAlpha(1)), i.addSample(u, l.withAlpha(1)), i.addSample(
|
|
5699
|
+
const i = new Cesium.SampledProperty(Cesium.Color), r = (s == null ? void 0 : s.startTime) ?? Cesium.JulianDate.now(), u = Cesium.JulianDate.addMinutes(r, 1, new Cesium.JulianDate()), h = Cesium.JulianDate.addMinutes(r, 5, new Cesium.JulianDate()), o = Cesium.JulianDate.fromIso8601("2100-01-01T00:00:00Z"), l = (s == null ? void 0 : s.color) ?? Cesium.Color.WHITE;
|
|
5700
|
+
return i.addSample(r, l.withAlpha(1)), i.addSample(u, l.withAlpha(1)), i.addSample(h, l.withAlpha(0.2)), i.addSample(o, l.withAlpha(0.1)), i;
|
|
5678
5701
|
}
|
|
5679
5702
|
function getHideAfterFiveMinutesProperty(s) {
|
|
5680
5703
|
const i = s ?? Cesium.JulianDate.now(), r = Cesium.JulianDate.addMinutes(i, 5, new Cesium.JulianDate());
|
|
5681
5704
|
return new Cesium.CallbackProperty((u) => u ? Cesium.JulianDate.lessThan(u, r) : !0, !1);
|
|
5682
5705
|
}
|
|
5683
|
-
class ShipLayer {
|
|
5684
|
-
constructor(
|
|
5706
|
+
class ShipLayer extends EventEmitter {
|
|
5707
|
+
constructor(r, u) {
|
|
5708
|
+
super();
|
|
5685
5709
|
z(this, "db");
|
|
5686
5710
|
z(this, "isMounted", !1);
|
|
5687
5711
|
z(this, "_viewer", null);
|
|
5688
5712
|
z(this, "entityMap", /* @__PURE__ */ new Map());
|
|
5689
5713
|
z(this, "IS_MOVING_THRESHOLD", 1);
|
|
5690
5714
|
z(this, "shadowEntityMap", /* @__PURE__ */ new WeakMap());
|
|
5691
|
-
|
|
5715
|
+
/**显隐entity,回调返回显示隐藏的状态,不传Fn时默认显示所有 */
|
|
5716
|
+
z(this, "hookFilterEntityFn");
|
|
5717
|
+
this.key = r, this.zIndex = u, this.db = new Cesium.CustomDataSource(r);
|
|
5692
5718
|
}
|
|
5693
|
-
show(
|
|
5694
|
-
this.isMounted || (
|
|
5719
|
+
show(r) {
|
|
5720
|
+
this.isMounted || (r.dataSources.add(this.db), this._viewer = r, this.isMounted = !0), this.db.show = !0;
|
|
5695
5721
|
}
|
|
5696
5722
|
hide() {
|
|
5697
5723
|
this.isMounted && (this.db.show = !1);
|
|
5698
5724
|
}
|
|
5699
5725
|
/**生成entity, geojson的id优先和mmsi保持一致,没有mmsi的情况下,使用nanoid生成 */
|
|
5700
|
-
render(
|
|
5701
|
-
|
|
5702
|
-
this.renderFeature(
|
|
5726
|
+
render(r) {
|
|
5727
|
+
r.features.forEach((u) => {
|
|
5728
|
+
this.renderFeature(u);
|
|
5703
5729
|
});
|
|
5704
5730
|
}
|
|
5705
5731
|
/**渲染feature */
|
|
5706
|
-
renderFeature(
|
|
5707
|
-
var
|
|
5708
|
-
const
|
|
5709
|
-
|
|
5710
|
-
const
|
|
5711
|
-
|
|
5712
|
-
|
|
5732
|
+
renderFeature(r) {
|
|
5733
|
+
var d, a;
|
|
5734
|
+
const u = String(r.id), h = new Cesium.SampledPositionProperty();
|
|
5735
|
+
h.backwardExtrapolationType = Cesium.ExtrapolationType.HOLD, h.forwardExtrapolationType = Cesium.ExtrapolationType.HOLD;
|
|
5736
|
+
const o = Cesium.Cartesian3.fromDegrees(
|
|
5737
|
+
r.geometry.coordinates[0],
|
|
5738
|
+
r.geometry.coordinates[1]
|
|
5713
5739
|
);
|
|
5714
|
-
|
|
5715
|
-
const
|
|
5716
|
-
id:
|
|
5717
|
-
position:
|
|
5740
|
+
h.addSample(((d = this._viewer) == null ? void 0 : d.clock.currentTime) ?? Cesium.JulianDate.now(), o);
|
|
5741
|
+
const l = ((a = r.properties) == null ? void 0 : a.courseOverGroundTrue) ?? 0, c = new Cesium.Entity({
|
|
5742
|
+
id: u,
|
|
5743
|
+
position: h,
|
|
5718
5744
|
orientation: new Cesium.ConstantProperty(
|
|
5719
5745
|
Cesium.Transforms.headingPitchRollQuaternion(
|
|
5720
|
-
|
|
5721
|
-
new Cesium.HeadingPitchRoll(
|
|
5746
|
+
o,
|
|
5747
|
+
new Cesium.HeadingPitchRoll(l, 0, 0)
|
|
5722
5748
|
)
|
|
5723
5749
|
),
|
|
5724
|
-
properties:
|
|
5750
|
+
properties: r.properties ?? {}
|
|
5725
5751
|
});
|
|
5726
|
-
this.entityMap.set(
|
|
5752
|
+
this.entityMap.set(u, c), this.db.entities.add(c), this.renderEntity(c), this.emit("createEntity", c);
|
|
5727
5753
|
}
|
|
5728
5754
|
/**更新or新增feature */
|
|
5729
|
-
update(
|
|
5730
|
-
var
|
|
5731
|
-
const
|
|
5732
|
-
if (
|
|
5733
|
-
const
|
|
5734
|
-
if (
|
|
5735
|
-
Cesium.JulianDate.addSeconds(
|
|
5736
|
-
|
|
5737
|
-
),
|
|
5738
|
-
for (const [R,
|
|
5755
|
+
update(r) {
|
|
5756
|
+
var h, o, l, c, d, a, m, y;
|
|
5757
|
+
const u = this.db.entities.getById(String(r.id));
|
|
5758
|
+
if (u) {
|
|
5759
|
+
const g = this.shadowEntityMap.get(u), p = ((h = r.properties) == null ? void 0 : h.shipTypeId) ?? -1, v = shipTypeColorMap.get(p) ?? shipTypeColorMap.get(-1), [b, _] = r.geometry.coordinates, T = ((o = this._viewer) == null ? void 0 : o.clock.currentTime) ?? Cesium.JulianDate.now(), w = (l = u.position) == null ? void 0 : l.getValue(T), x = Cesium.JulianDate.addSeconds(T, 3, new Cesium.JulianDate()), O = Cesium.Cartesian3.fromDegrees(b, _), E = new Cesium.SampledPositionProperty();
|
|
5760
|
+
if (E.backwardExtrapolationType = Cesium.ExtrapolationType.HOLD, E.forwardExtrapolationType = Cesium.ExtrapolationType.HOLD, E instanceof Cesium.SampledPositionProperty && (E.addSample(
|
|
5761
|
+
Cesium.JulianDate.addSeconds(T, 1, new Cesium.JulianDate()),
|
|
5762
|
+
w ?? O
|
|
5763
|
+
), E.addSample(x, O)), u.position = E, g && (g.position = E), u.properties)
|
|
5764
|
+
for (const [R, S] of Object.entries(r.properties ?? {})) {
|
|
5739
5765
|
if (R == "speedOverGround") {
|
|
5740
|
-
const
|
|
5741
|
-
if (
|
|
5742
|
-
createShipIconUrl(
|
|
5743
|
-
)),
|
|
5744
|
-
const
|
|
5745
|
-
color:
|
|
5746
|
-
isMoving:
|
|
5747
|
-
...
|
|
5748
|
-
designBeam:
|
|
5749
|
-
designLength:
|
|
5750
|
-
}),
|
|
5751
|
-
|
|
5752
|
-
new Cesium.Cartesian2(
|
|
5753
|
-
)),
|
|
5754
|
-
() => new Cesium.Cartesian2(
|
|
5766
|
+
const P = u.properties.getValue().speedOverGround ?? 0, C = Number(P) > this.IS_MOVING_THRESHOLD, D = Number(S) > this.IS_MOVING_THRESHOLD;
|
|
5767
|
+
if (C !== D && (u.billboard && (u.billboard.image = new Cesium.ConstantProperty(
|
|
5768
|
+
createShipIconUrl(v, D)
|
|
5769
|
+
)), g != null && g.plane)) {
|
|
5770
|
+
const I = ((c = r.properties) == null ? void 0 : c.designBeam) ?? 8, M = ((d = r.properties) == null ? void 0 : d.designLength) ?? 20, q = createShipIconV2({
|
|
5771
|
+
color: v,
|
|
5772
|
+
isMoving: D,
|
|
5773
|
+
...r.properties,
|
|
5774
|
+
designBeam: I,
|
|
5775
|
+
designLength: M
|
|
5776
|
+
}), F = (a = g.plane) == null ? void 0 : a.material;
|
|
5777
|
+
F && (F.image = new Cesium.ConstantProperty(q.url), g.plane.dimensions = new Cesium.ConstantProperty(
|
|
5778
|
+
new Cesium.Cartesian2(I * q.scale.x, M * q.scale.y)
|
|
5779
|
+
)), g.plane.dimensions = new Cesium.CallbackProperty(
|
|
5780
|
+
() => new Cesium.Cartesian2(I * q.scale.x, M * q.scale.y),
|
|
5755
5781
|
!0
|
|
5756
5782
|
);
|
|
5757
5783
|
}
|
|
5758
5784
|
}
|
|
5759
5785
|
if (R == "courseOverGroundTrue") {
|
|
5760
|
-
const
|
|
5761
|
-
|
|
5762
|
-
typeof
|
|
5786
|
+
const P = ((m = r.properties) == null ? void 0 : m.courseOverGroundTrue) ?? 0;
|
|
5787
|
+
u.billboard.rotation = new Cesium.ConstantProperty(
|
|
5788
|
+
typeof S == "number" ? -1 * S : 0
|
|
5763
5789
|
);
|
|
5764
|
-
const
|
|
5790
|
+
const C = new Cesium.ConstantProperty(
|
|
5765
5791
|
Cesium.Transforms.headingPitchRollQuaternion(
|
|
5766
|
-
|
|
5767
|
-
new Cesium.HeadingPitchRoll(
|
|
5792
|
+
O,
|
|
5793
|
+
new Cesium.HeadingPitchRoll(P, 0, 0)
|
|
5768
5794
|
)
|
|
5769
5795
|
);
|
|
5770
|
-
|
|
5796
|
+
g && (g.orientation = C);
|
|
5771
5797
|
}
|
|
5772
5798
|
if (R == "updateTime") {
|
|
5773
|
-
const
|
|
5774
|
-
|
|
5775
|
-
startTime:
|
|
5799
|
+
const P = Cesium.JulianDate.fromDate(new Date(S));
|
|
5800
|
+
u.billboard.color = createAlphaSampled({
|
|
5801
|
+
startTime: P
|
|
5776
5802
|
});
|
|
5777
|
-
const
|
|
5778
|
-
|
|
5779
|
-
startTime:
|
|
5803
|
+
const C = (y = g == null ? void 0 : g.plane) == null ? void 0 : y.material;
|
|
5804
|
+
C && (C.color = createAlphaSampled({
|
|
5805
|
+
startTime: P
|
|
5780
5806
|
}));
|
|
5781
|
-
const
|
|
5782
|
-
|
|
5807
|
+
const D = getHideAfterFiveMinutesProperty(P);
|
|
5808
|
+
u.label.show = D, u.point.show = D;
|
|
5783
5809
|
}
|
|
5784
|
-
|
|
5810
|
+
u.properties[R] = S, g != null && g.properties && (g.properties[R] = S);
|
|
5785
5811
|
}
|
|
5786
5812
|
} else
|
|
5787
|
-
this.renderFeature(
|
|
5813
|
+
this.renderFeature(r);
|
|
5788
5814
|
}
|
|
5789
5815
|
// 判定移动的速度阈值(米/秒)
|
|
5790
|
-
renderEntity(
|
|
5791
|
-
var
|
|
5792
|
-
const
|
|
5793
|
-
|
|
5816
|
+
renderEntity(r) {
|
|
5817
|
+
var m, y, g, p, v, b, _;
|
|
5818
|
+
const u = (m = r.properties) == null ? void 0 : m.getValue(), h = (u == null ? void 0 : u.shipTypeId) ?? -1, o = shipTypeColorMap.get(h) ?? shipTypeColorMap.get(-1), l = Number((u == null ? void 0 : u.speedOverGround) ?? 0), c = u != null && u.updateTime ? new Date(u.updateTime) : /* @__PURE__ */ new Date(), d = Cesium.JulianDate.fromDate(c), a = createShipIconUrl(o, l > this.IS_MOVING_THRESHOLD);
|
|
5819
|
+
r.point = new Cesium.PointGraphics({
|
|
5794
5820
|
pixelSize: 4,
|
|
5795
5821
|
color: Cesium.Color.fromCssColorString("#8AF22C"),
|
|
5796
5822
|
disableDepthTestDistance: 3e6,
|
|
5797
5823
|
distanceDisplayCondition: new Cesium.DistanceDisplayCondition(15e3),
|
|
5798
|
-
show: getHideAfterFiveMinutesProperty(
|
|
5799
|
-
}),
|
|
5800
|
-
image:
|
|
5824
|
+
show: getHideAfterFiveMinutesProperty(d)
|
|
5825
|
+
}), r.billboard = new Cesium.BillboardGraphics({
|
|
5826
|
+
image: a,
|
|
5801
5827
|
width: 14,
|
|
5802
5828
|
height: 70,
|
|
5803
5829
|
disableDepthTestDistance: 3e6,
|
|
5804
5830
|
distanceDisplayCondition: new Cesium.DistanceDisplayCondition(4e3, 15e3),
|
|
5805
5831
|
pixelOffset: new Cesium.Cartesian2(0, 0),
|
|
5806
5832
|
alignedAxis: Cesium.Cartesian3.UNIT_Z,
|
|
5807
|
-
color: createAlphaSampled({ startTime:
|
|
5833
|
+
color: createAlphaSampled({ startTime: d }),
|
|
5808
5834
|
// 设置透明度
|
|
5809
5835
|
rotation: new Cesium.ConstantProperty(
|
|
5810
|
-
(
|
|
5836
|
+
(g = (y = r.properties) == null ? void 0 : y.getValue()) != null && g.courseOverGroundTrue ? -1 * r.properties.getValue().courseOverGroundTrue : 0
|
|
5811
5837
|
)
|
|
5812
5838
|
// 根据航向设置旋转角度
|
|
5813
|
-
}),
|
|
5839
|
+
}), r.label = new Cesium.LabelGraphics({
|
|
5814
5840
|
font: '12px normal "微软雅黑"',
|
|
5815
5841
|
backgroundColor: Cesium.Color.fromCssColorString("#E9F4FC"),
|
|
5816
5842
|
fillColor: Cesium.Color.BLACK,
|
|
@@ -5822,61 +5848,58 @@ class ShipLayer {
|
|
|
5822
5848
|
pixelOffset: new Cesium.Cartesian2(0, -20),
|
|
5823
5849
|
scale: 1,
|
|
5824
5850
|
scaleByDistance: new Cesium.NearFarScalar(3e3, 1, 1e4, 0.55),
|
|
5825
|
-
text: ((
|
|
5851
|
+
text: ((v = (p = r.properties) == null ? void 0 : p.getValue()) == null ? void 0 : v.name) ?? ((b = r.properties) != null && b.getValue().mmsi ? "mmsi:" + ((_ = r.properties) == null ? void 0 : _.getValue().mmsi) : "未知"),
|
|
5826
5852
|
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
|
|
5827
5853
|
distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 15e3),
|
|
5828
5854
|
disableDepthTestDistance: 5e3,
|
|
5829
|
-
show: getHideAfterFiveMinutesProperty(
|
|
5830
|
-
}), this.createShipPlane(
|
|
5831
|
-
}
|
|
5832
|
-
createShipPlane(
|
|
5833
|
-
var
|
|
5834
|
-
const
|
|
5835
|
-
id:
|
|
5836
|
-
position:
|
|
5837
|
-
orientation:
|
|
5838
|
-
properties:
|
|
5855
|
+
show: getHideAfterFiveMinutesProperty(d)
|
|
5856
|
+
}), this.createShipPlane(r);
|
|
5857
|
+
}
|
|
5858
|
+
createShipPlane(r) {
|
|
5859
|
+
var p;
|
|
5860
|
+
const u = new Cesium.Entity({
|
|
5861
|
+
id: r.id + "_shadow",
|
|
5862
|
+
position: r.position,
|
|
5863
|
+
orientation: r.orientation,
|
|
5864
|
+
properties: r.properties
|
|
5839
5865
|
});
|
|
5840
|
-
this.shadowEntityMap.set(
|
|
5841
|
-
const
|
|
5842
|
-
color:
|
|
5843
|
-
isMoving:
|
|
5844
|
-
...
|
|
5845
|
-
designBeam: (
|
|
5846
|
-
designLength: (
|
|
5866
|
+
this.shadowEntityMap.set(r, u), this.db.entities.add(u);
|
|
5867
|
+
const h = (p = r.properties) == null ? void 0 : p.getValue(), o = h != null && h.updateTime ? new Date(h.updateTime) : /* @__PURE__ */ new Date(), l = Cesium.JulianDate.fromDate(o), c = Number((h == null ? void 0 : h.speedOverGround) ?? 0), d = (h == null ? void 0 : h.designLength) ?? 20, a = (h == null ? void 0 : h.designBeam) ?? 8, m = (h == null ? void 0 : h.shipTypeId) ?? -1, y = shipTypeColorMap.get(m) ?? shipTypeColorMap.get(-1), g = createShipIconV2({
|
|
5868
|
+
color: y,
|
|
5869
|
+
isMoving: c > this.IS_MOVING_THRESHOLD,
|
|
5870
|
+
...h,
|
|
5871
|
+
designBeam: (h == null ? void 0 : h.designBeam) ?? 8,
|
|
5872
|
+
designLength: (h == null ? void 0 : h.designLength) ?? 20
|
|
5847
5873
|
});
|
|
5848
|
-
|
|
5874
|
+
u.plane = new Cesium.PlaneGraphics({
|
|
5849
5875
|
plane: new Cesium.Plane(Cesium.Cartesian3.UNIT_Z, 0),
|
|
5850
|
-
dimensions: new Cesium.Cartesian2(
|
|
5876
|
+
dimensions: new Cesium.Cartesian2(a * g.scale.x, d * g.scale.y),
|
|
5851
5877
|
show: new Cesium.CallbackProperty(() => {
|
|
5852
|
-
var
|
|
5878
|
+
var T;
|
|
5853
5879
|
if (!this._viewer) return !0;
|
|
5854
|
-
const
|
|
5855
|
-
return
|
|
5880
|
+
const v = this._viewer.clock.currentTime, b = (T = r.position) == null ? void 0 : T.getValue(v);
|
|
5881
|
+
return b ? Cesium.Cartesian3.distance(this._viewer.camera.positionWC, b) <= 4e3 : !1;
|
|
5856
5882
|
}, !1),
|
|
5857
5883
|
// 用回调按距离控制显示
|
|
5858
5884
|
material: new Cesium.ImageMaterialProperty({
|
|
5859
|
-
image:
|
|
5885
|
+
image: g.url,
|
|
5860
5886
|
transparent: !0,
|
|
5861
5887
|
// 关键:让 alpha 生效
|
|
5862
5888
|
repeat: new Cesium.Cartesian2(1, 1),
|
|
5863
|
-
color: createAlphaSampled({ startTime:
|
|
5889
|
+
color: createAlphaSampled({ startTime: l })
|
|
5864
5890
|
})
|
|
5865
5891
|
});
|
|
5866
5892
|
}
|
|
5867
|
-
|
|
5868
|
-
|
|
5869
|
-
|
|
5870
|
-
|
|
5871
|
-
|
|
5872
|
-
|
|
5873
|
-
|
|
5874
|
-
|
|
5875
|
-
|
|
5876
|
-
|
|
5877
|
-
this.db.entities.values.forEach((i) => {
|
|
5878
|
-
i.show = !0;
|
|
5879
|
-
});
|
|
5893
|
+
hideEntityByCondition(r) {
|
|
5894
|
+
this.hookFilterEntityFn && this.off("createEntity", this.hookFilterEntityFn), this.hookFilterEntityFn = (u) => {
|
|
5895
|
+
const h = (r == null ? void 0 : r(u)) ?? !0;
|
|
5896
|
+
u.show = h;
|
|
5897
|
+
const o = this.shadowEntityMap.get(u);
|
|
5898
|
+
o && (o.show = h);
|
|
5899
|
+
}, this.db.entities.values.forEach((u) => {
|
|
5900
|
+
var h;
|
|
5901
|
+
(h = this.hookFilterEntityFn) == null || h.call(this, u);
|
|
5902
|
+
}), r && this.on("createEntity", this.hookFilterEntityFn);
|
|
5880
5903
|
}
|
|
5881
5904
|
}
|
|
5882
5905
|
Color.fromCssColorString("#FC4C02");
|
|
@@ -5886,8 +5909,8 @@ new Array(4);
|
|
|
5886
5909
|
var e$2 = [], t$2 = [];
|
|
5887
5910
|
function n$2(s, i) {
|
|
5888
5911
|
if (s && typeof document < "u") {
|
|
5889
|
-
var r, u = i.prepend === !0 ? "prepend" : "append",
|
|
5890
|
-
if (
|
|
5912
|
+
var r, u = i.prepend === !0 ? "prepend" : "append", h = i.singleTag === !0, o = typeof i.container == "string" ? document.querySelector(i.container) : document.getElementsByTagName("head")[0];
|
|
5913
|
+
if (h) {
|
|
5891
5914
|
var l = e$2.indexOf(o);
|
|
5892
5915
|
l === -1 && (l = e$2.push(o) - 1, t$2[l] = {}), r = t$2[l] && t$2[l][u] ? t$2[l][u] : t$2[l][u] = c();
|
|
5893
5916
|
} else r = c();
|
|
@@ -5895,7 +5918,7 @@ function n$2(s, i) {
|
|
|
5895
5918
|
}
|
|
5896
5919
|
function c() {
|
|
5897
5920
|
var d = document.createElement("style");
|
|
5898
|
-
if (d.setAttribute("type", "text/css"), i.attributes) for (var a = Object.keys(i.attributes),
|
|
5921
|
+
if (d.setAttribute("type", "text/css"), i.attributes) for (var a = Object.keys(i.attributes), m = 0; m < a.length; m++) d.setAttribute(a[m], i.attributes[a[m]]);
|
|
5899
5922
|
var y = u === "prepend" ? "afterbegin" : "beforeend";
|
|
5900
5923
|
return o.insertAdjacentElement(y, d), d;
|
|
5901
5924
|
}
|
|
@@ -5919,11 +5942,11 @@ class Popup {
|
|
|
5919
5942
|
z(this, "setPosition", () => {
|
|
5920
5943
|
if (this._position && this._viewer && this._position) {
|
|
5921
5944
|
if (this._viewer.scene.mode === SceneMode.SCENE3D) {
|
|
5922
|
-
const u = this._viewer.scene.camera.position,
|
|
5945
|
+
const u = this._viewer.scene.camera.position, h = new BoundingSphere(
|
|
5923
5946
|
new Cartesian3(0, 0, 0),
|
|
5924
5947
|
635e4
|
|
5925
5948
|
);
|
|
5926
|
-
if (!new Occluder(
|
|
5949
|
+
if (!new Occluder(h, u).isPointVisible(this._position)) {
|
|
5927
5950
|
this.switchElementShow(!1);
|
|
5928
5951
|
return;
|
|
5929
5952
|
}
|
|
@@ -5936,16 +5959,16 @@ class Popup {
|
|
|
5936
5959
|
if (this._screenPosition && this._screenPosition.x === i.x && this._screenPosition.y === i.y)
|
|
5937
5960
|
return;
|
|
5938
5961
|
this.switchElementShow(!0);
|
|
5939
|
-
const u = i.x - r.clientWidth / 2 + this._offset[0],
|
|
5940
|
-
r.style.left = `${u}px`, r.style.top = `${
|
|
5962
|
+
const u = i.x - r.clientWidth / 2 + this._offset[0], h = i.y - r.clientHeight + this._offset[1];
|
|
5963
|
+
r.style.left = `${u}px`, r.style.top = `${h}px`, this._screenPosition = i;
|
|
5941
5964
|
}
|
|
5942
5965
|
}
|
|
5943
5966
|
});
|
|
5944
5967
|
this._viewer = i, this._options = r;
|
|
5945
|
-
const { position: u, element:
|
|
5946
|
-
if (!
|
|
5968
|
+
const { position: u, element: h, offset: o } = r;
|
|
5969
|
+
if (!h)
|
|
5947
5970
|
throw Error("no element!");
|
|
5948
|
-
this._position = u ? Cartesian3.fromDegrees(u[0], u[1], u[2]) : null, this._element =
|
|
5971
|
+
this._position = u ? Cartesian3.fromDegrees(u[0], u[1], u[2]) : null, this._element = h, this._offset = [(o == null ? void 0 : o[0]) ?? 0, (o == null ? void 0 : o[1]) ?? 0], this.addMapListener();
|
|
5949
5972
|
}
|
|
5950
5973
|
set position(i) {
|
|
5951
5974
|
if (!i) {
|
|
@@ -5977,8 +6000,8 @@ class Popup {
|
|
|
5977
6000
|
var e$1 = [], t$1 = [];
|
|
5978
6001
|
function n$1(s, i) {
|
|
5979
6002
|
if (s && typeof document < "u") {
|
|
5980
|
-
var r, u = i.prepend === !0 ? "prepend" : "append",
|
|
5981
|
-
if (
|
|
6003
|
+
var r, u = i.prepend === !0 ? "prepend" : "append", h = i.singleTag === !0, o = typeof i.container == "string" ? document.querySelector(i.container) : document.getElementsByTagName("head")[0];
|
|
6004
|
+
if (h) {
|
|
5982
6005
|
var l = e$1.indexOf(o);
|
|
5983
6006
|
l === -1 && (l = e$1.push(o) - 1, t$1[l] = {}), r = t$1[l] && t$1[l][u] ? t$1[l][u] : t$1[l][u] = c();
|
|
5984
6007
|
} else r = c();
|
|
@@ -5986,7 +6009,7 @@ function n$1(s, i) {
|
|
|
5986
6009
|
}
|
|
5987
6010
|
function c() {
|
|
5988
6011
|
var d = document.createElement("style");
|
|
5989
|
-
if (d.setAttribute("type", "text/css"), i.attributes) for (var a = Object.keys(i.attributes),
|
|
6012
|
+
if (d.setAttribute("type", "text/css"), i.attributes) for (var a = Object.keys(i.attributes), m = 0; m < a.length; m++) d.setAttribute(a[m], i.attributes[a[m]]);
|
|
5990
6013
|
var y = u === "prepend" ? "afterbegin" : "beforeend";
|
|
5991
6014
|
return o.insertAdjacentElement(y, d), d;
|
|
5992
6015
|
}
|
|
@@ -5996,8 +6019,8 @@ n$1(css$1, {});
|
|
|
5996
6019
|
var e = [], t = [];
|
|
5997
6020
|
function n(s, i) {
|
|
5998
6021
|
if (s && typeof document < "u") {
|
|
5999
|
-
var r, u = i.prepend === !0 ? "prepend" : "append",
|
|
6000
|
-
if (
|
|
6022
|
+
var r, u = i.prepend === !0 ? "prepend" : "append", h = i.singleTag === !0, o = typeof i.container == "string" ? document.querySelector(i.container) : document.getElementsByTagName("head")[0];
|
|
6023
|
+
if (h) {
|
|
6001
6024
|
var l = e.indexOf(o);
|
|
6002
6025
|
l === -1 && (l = e.push(o) - 1, t[l] = {}), r = t[l] && t[l][u] ? t[l][u] : t[l][u] = c();
|
|
6003
6026
|
} else r = c();
|
|
@@ -6005,7 +6028,7 @@ function n(s, i) {
|
|
|
6005
6028
|
}
|
|
6006
6029
|
function c() {
|
|
6007
6030
|
var d = document.createElement("style");
|
|
6008
|
-
if (d.setAttribute("type", "text/css"), i.attributes) for (var a = Object.keys(i.attributes),
|
|
6031
|
+
if (d.setAttribute("type", "text/css"), i.attributes) for (var a = Object.keys(i.attributes), m = 0; m < a.length; m++) d.setAttribute(a[m], i.attributes[a[m]]);
|
|
6009
6032
|
var y = u === "prepend" ? "afterbegin" : "beforeend";
|
|
6010
6033
|
return o.insertAdjacentElement(y, d), d;
|
|
6011
6034
|
}
|
|
@@ -6032,15 +6055,15 @@ function requireHeatmap() {
|
|
|
6032
6055
|
}, r = function() {
|
|
6033
6056
|
var a = function(g) {
|
|
6034
6057
|
this._coordinator = {}, this._data = [], this._radi = [], this._min = 10, this._max = 1, this._xField = g.xField || g.defaultXField, this._yField = g.yField || g.defaultYField, this._valueField = g.valueField || g.defaultValueField, g.radius && (this._cfgRadius = g.radius);
|
|
6035
|
-
},
|
|
6058
|
+
}, m = i.defaultRadius;
|
|
6036
6059
|
return a.prototype = {
|
|
6037
6060
|
// when forceRender = false -> called from setData, omits renderall event
|
|
6038
6061
|
_organiseData: function(y, g) {
|
|
6039
|
-
var
|
|
6040
|
-
_[
|
|
6041
|
-
var
|
|
6042
|
-
return
|
|
6043
|
-
x:
|
|
6062
|
+
var p = y[this._xField], v = y[this._yField], b = this._radi, _ = this._data, T = this._max, w = this._min, x = y[this._valueField] || 1, O = y.radius || this._cfgRadius || m;
|
|
6063
|
+
_[p] || (_[p] = [], b[p] = []), _[p][v] ? _[p][v] += x : (_[p][v] = x, b[p][v] = O);
|
|
6064
|
+
var E = _[p][v];
|
|
6065
|
+
return E > T ? (g ? this.setDataMax(E) : this._max = E, !1) : E < w ? (g ? this.setDataMin(E) : this._min = E, !1) : {
|
|
6066
|
+
x: p,
|
|
6044
6067
|
y: v,
|
|
6045
6068
|
value: x,
|
|
6046
6069
|
radius: O,
|
|
@@ -6049,13 +6072,13 @@ function requireHeatmap() {
|
|
|
6049
6072
|
};
|
|
6050
6073
|
},
|
|
6051
6074
|
_unOrganizeData: function() {
|
|
6052
|
-
var y = [], g = this._data,
|
|
6075
|
+
var y = [], g = this._data, p = this._radi;
|
|
6053
6076
|
for (var v in g)
|
|
6054
6077
|
for (var b in g[v])
|
|
6055
6078
|
y.push({
|
|
6056
6079
|
x: v,
|
|
6057
6080
|
y: b,
|
|
6058
|
-
radius:
|
|
6081
|
+
radius: p[v][b],
|
|
6059
6082
|
value: g[v][b]
|
|
6060
6083
|
});
|
|
6061
6084
|
return {
|
|
@@ -6075,19 +6098,19 @@ function requireHeatmap() {
|
|
|
6075
6098
|
for (var y = arguments[0], g = y.length; g--; )
|
|
6076
6099
|
this.addData.call(this, y[g]);
|
|
6077
6100
|
else {
|
|
6078
|
-
var
|
|
6079
|
-
|
|
6101
|
+
var p = this._organiseData(arguments[0], !0);
|
|
6102
|
+
p && (this._data.length === 0 && (this._min = this._max = p.value), this._coordinator.emit("renderpartial", {
|
|
6080
6103
|
min: this._min,
|
|
6081
6104
|
max: this._max,
|
|
6082
|
-
data: [
|
|
6105
|
+
data: [p]
|
|
6083
6106
|
}));
|
|
6084
6107
|
}
|
|
6085
6108
|
return this;
|
|
6086
6109
|
},
|
|
6087
6110
|
setData: function(y) {
|
|
6088
|
-
var g = y.data,
|
|
6111
|
+
var g = y.data, p = g.length;
|
|
6089
6112
|
this._data = [], this._radi = [];
|
|
6090
|
-
for (var v = 0; v <
|
|
6113
|
+
for (var v = 0; v < p; v++)
|
|
6091
6114
|
this._organiseData(g[v], !1);
|
|
6092
6115
|
return this._max = y.max, this._min = y.min || 0, this._onExtremaChange(), this._coordinator.emit("renderall", this._getInternalData()), this;
|
|
6093
6116
|
},
|
|
@@ -6154,28 +6177,28 @@ function requireHeatmap() {
|
|
|
6154
6177
|
}*/
|
|
6155
6178
|
}, a;
|
|
6156
6179
|
}(), u = function() {
|
|
6157
|
-
var a = function(
|
|
6158
|
-
var v =
|
|
6180
|
+
var a = function(p) {
|
|
6181
|
+
var v = p.gradient || p.defaultGradient, b = document.createElement("canvas"), _ = b.getContext("2d", { willReadFrequently: !0 });
|
|
6159
6182
|
b.width = 256, b.height = 1;
|
|
6160
6183
|
var T = _.createLinearGradient(0, 0, 256, 1);
|
|
6161
6184
|
for (var w in v)
|
|
6162
6185
|
T.addColorStop(w, v[w]);
|
|
6163
6186
|
return _.fillStyle = T, _.fillRect(0, 0, 256, 1), _.getImageData(0, 0, 256, 1).data;
|
|
6164
|
-
},
|
|
6165
|
-
var b = document.createElement("canvas"), _ = b.getContext("2d", { willReadFrequently: !0 }), T =
|
|
6166
|
-
if (b.width = b.height =
|
|
6167
|
-
_.beginPath(), _.arc(T, w,
|
|
6187
|
+
}, m = function(p, v) {
|
|
6188
|
+
var b = document.createElement("canvas"), _ = b.getContext("2d", { willReadFrequently: !0 }), T = p, w = p;
|
|
6189
|
+
if (b.width = b.height = p * 2, v == 1)
|
|
6190
|
+
_.beginPath(), _.arc(T, w, p, 0, 2 * Math.PI, !1), _.fillStyle = "rgba(0,0,0,1)", _.fill();
|
|
6168
6191
|
else {
|
|
6169
|
-
var x = _.createRadialGradient(T, w,
|
|
6170
|
-
x.addColorStop(0, "rgba(0,0,0,1)"), x.addColorStop(1, "rgba(0,0,0,0)"), _.fillStyle = x, _.fillRect(0, 0, 2 *
|
|
6192
|
+
var x = _.createRadialGradient(T, w, p * v, T, w, p);
|
|
6193
|
+
x.addColorStop(0, "rgba(0,0,0,1)"), x.addColorStop(1, "rgba(0,0,0,0)"), _.fillStyle = x, _.fillRect(0, 0, 2 * p, 2 * p);
|
|
6171
6194
|
}
|
|
6172
6195
|
return b;
|
|
6173
6196
|
}, y = function(w) {
|
|
6174
6197
|
for (var v = [], b = w.min, _ = w.max, T = w.radi, w = w.data, x = Object.keys(w), O = x.length; O--; )
|
|
6175
|
-
for (var
|
|
6176
|
-
var P =
|
|
6198
|
+
for (var E = x[O], R = Object.keys(w[E]), S = R.length; S--; ) {
|
|
6199
|
+
var P = R[S], C = w[E][P], D = T[E][P];
|
|
6177
6200
|
v.push({
|
|
6178
|
-
x:
|
|
6201
|
+
x: E,
|
|
6179
6202
|
y: P,
|
|
6180
6203
|
value: C,
|
|
6181
6204
|
radius: D
|
|
@@ -6187,69 +6210,69 @@ function requireHeatmap() {
|
|
|
6187
6210
|
data: v
|
|
6188
6211
|
};
|
|
6189
6212
|
};
|
|
6190
|
-
function g(
|
|
6191
|
-
var v =
|
|
6213
|
+
function g(p) {
|
|
6214
|
+
var v = p.container, b = this.shadowCanvas = document.createElement("canvas"), _ = this.canvas = p.canvas || document.createElement("canvas");
|
|
6192
6215
|
this._renderBoundaries = [1e4, 1e4, 0, 0];
|
|
6193
|
-
var T = getComputedStyle(
|
|
6194
|
-
_.className = "heatmap-canvas", this._width = _.width = b.width =
|
|
6216
|
+
var T = getComputedStyle(p.container) || {};
|
|
6217
|
+
_.className = "heatmap-canvas", this._width = _.width = b.width = p.width || +T.width.replace(/px/, ""), this._height = _.height = b.height = p.height || +T.height.replace(/px/, ""), this.shadowCtx = b.getContext("2d", { willReadFrequently: !0 }), this.ctx = _.getContext("2d", { willReadFrequently: !0 }), _.style.cssText = b.style.cssText = "position:absolute;left:0;top:0;", v.style.position = "relative", v.appendChild(_), this._palette = a(p), this._templates = {}, this._setStyles(p);
|
|
6195
6218
|
}
|
|
6196
6219
|
return g.prototype = {
|
|
6197
|
-
renderPartial: function(
|
|
6198
|
-
|
|
6220
|
+
renderPartial: function(p) {
|
|
6221
|
+
p.data.length > 0 && (this._drawAlpha(p), this._colorize());
|
|
6199
6222
|
},
|
|
6200
|
-
renderAll: function(
|
|
6201
|
-
this._clear(),
|
|
6223
|
+
renderAll: function(p) {
|
|
6224
|
+
this._clear(), p.data.length > 0 && (this._drawAlpha(y(p)), this._colorize());
|
|
6202
6225
|
},
|
|
6203
|
-
_updateGradient: function(
|
|
6204
|
-
this._palette = a(
|
|
6226
|
+
_updateGradient: function(p) {
|
|
6227
|
+
this._palette = a(p);
|
|
6205
6228
|
},
|
|
6206
|
-
updateConfig: function(
|
|
6207
|
-
|
|
6229
|
+
updateConfig: function(p) {
|
|
6230
|
+
p.gradient && this._updateGradient(p), this._setStyles(p);
|
|
6208
6231
|
},
|
|
6209
|
-
setDimensions: function(
|
|
6210
|
-
this._width =
|
|
6232
|
+
setDimensions: function(p, v) {
|
|
6233
|
+
this._width = p, this._height = v, this.canvas.width = this.shadowCanvas.width = p, this.canvas.height = this.shadowCanvas.height = v;
|
|
6211
6234
|
},
|
|
6212
6235
|
_clear: function() {
|
|
6213
6236
|
this.shadowCtx.clearRect(0, 0, this._width, this._height), this.ctx.clearRect(0, 0, this._width, this._height);
|
|
6214
6237
|
},
|
|
6215
|
-
_setStyles: function(
|
|
6216
|
-
this._blur =
|
|
6238
|
+
_setStyles: function(p) {
|
|
6239
|
+
this._blur = p.blur == 0 ? 0 : p.blur || p.defaultBlur, p.backgroundColor && (this.canvas.style.backgroundColor = p.backgroundColor), this._width = this.canvas.width = this.shadowCanvas.width = p.width || this._width, this._height = this.canvas.height = this.shadowCanvas.height = p.height || this._height, this._opacity = (p.opacity || 0) * 255, this._maxOpacity = (p.maxOpacity || p.defaultMaxOpacity) * 255, this._minOpacity = (p.minOpacity || p.defaultMinOpacity) * 255, this._useGradientOpacity = !!p.useGradientOpacity;
|
|
6217
6240
|
},
|
|
6218
6241
|
_drawAlpha: function(_) {
|
|
6219
6242
|
for (var v = this._min = _.min, b = this._max = _.max, _ = _.data || [], T = _.length, w = 1 - this._blur; T--; ) {
|
|
6220
|
-
var x = _[T], O = x.x,
|
|
6221
|
-
this._templates[
|
|
6222
|
-
var
|
|
6223
|
-
D.globalAlpha =
|
|
6243
|
+
var x = _[T], O = x.x, E = x.y, R = x.radius, S = Math.min(x.value, b), P = O - R, C = E - R, D = this.shadowCtx, I;
|
|
6244
|
+
this._templates[R] ? I = this._templates[R] : this._templates[R] = I = m(R, w);
|
|
6245
|
+
var M = (S - v) / (b - v);
|
|
6246
|
+
D.globalAlpha = M < 0.01 ? 0.01 : M, D.drawImage(I, P, C), P < this._renderBoundaries[0] && (this._renderBoundaries[0] = P), C < this._renderBoundaries[1] && (this._renderBoundaries[1] = C), P + 2 * R > this._renderBoundaries[2] && (this._renderBoundaries[2] = P + 2 * R), C + 2 * R > this._renderBoundaries[3] && (this._renderBoundaries[3] = C + 2 * R);
|
|
6224
6247
|
}
|
|
6225
6248
|
},
|
|
6226
6249
|
_colorize: function() {
|
|
6227
|
-
var
|
|
6228
|
-
|
|
6229
|
-
for (var S = this.shadowCtx.getImageData(
|
|
6230
|
-
var
|
|
6250
|
+
var p = this._renderBoundaries[0], v = this._renderBoundaries[1], b = this._renderBoundaries[2] - p, _ = this._renderBoundaries[3] - v, T = this._width, w = this._height, x = this._opacity, O = this._maxOpacity, E = this._minOpacity, R = this._useGradientOpacity;
|
|
6251
|
+
p < 0 && (p = 0), v < 0 && (v = 0), p + b > T && (b = T - p), v + _ > w && (_ = w - v);
|
|
6252
|
+
for (var S = this.shadowCtx.getImageData(p, v, b, _), P = S.data, C = P.length, D = this._palette, I = 3; I < C; I += 4) {
|
|
6253
|
+
var M = P[I], q = M * 4;
|
|
6231
6254
|
if (q) {
|
|
6232
6255
|
var F;
|
|
6233
|
-
x > 0 ? F = x :
|
|
6256
|
+
x > 0 ? F = x : M < O ? M < E ? F = E : F = M : F = O, P[I - 3] = D[q], P[I - 2] = D[q + 1], P[I - 1] = D[q + 2], P[I] = R ? D[q + 3] : F;
|
|
6234
6257
|
}
|
|
6235
6258
|
}
|
|
6236
|
-
this.ctx.putImageData(S,
|
|
6259
|
+
this.ctx.putImageData(S, p, v), this._renderBoundaries = [1e3, 1e3, 0, 0];
|
|
6237
6260
|
},
|
|
6238
|
-
getValueAt: function(
|
|
6239
|
-
var v, b = this.shadowCtx, _ = b.getImageData(
|
|
6261
|
+
getValueAt: function(p) {
|
|
6262
|
+
var v, b = this.shadowCtx, _ = b.getImageData(p.x, p.y, 1, 1), T = _.data[3], w = this._max, x = this._min;
|
|
6240
6263
|
return v = Math.abs(w - x) * (T / 255) >> 0, v;
|
|
6241
6264
|
},
|
|
6242
6265
|
getDataURL: function() {
|
|
6243
6266
|
return this.canvas.toDataURL();
|
|
6244
6267
|
}
|
|
6245
6268
|
}, g;
|
|
6246
|
-
}(),
|
|
6269
|
+
}(), h = function() {
|
|
6247
6270
|
var a = !1;
|
|
6248
6271
|
return i.defaultRenderer === "canvas2d" && (a = u), a;
|
|
6249
6272
|
}(), o = {
|
|
6250
6273
|
merge: function() {
|
|
6251
|
-
for (var d = {}, a = arguments.length,
|
|
6252
|
-
var y = arguments[
|
|
6274
|
+
for (var d = {}, a = arguments.length, m = 0; m < a; m++) {
|
|
6275
|
+
var y = arguments[m];
|
|
6253
6276
|
for (var g in y)
|
|
6254
6277
|
d[g] = y[g];
|
|
6255
6278
|
}
|
|
@@ -6257,10 +6280,10 @@ function requireHeatmap() {
|
|
|
6257
6280
|
}
|
|
6258
6281
|
}, l = function() {
|
|
6259
6282
|
var a = function() {
|
|
6260
|
-
function
|
|
6283
|
+
function p() {
|
|
6261
6284
|
this.cStore = {};
|
|
6262
6285
|
}
|
|
6263
|
-
return
|
|
6286
|
+
return p.prototype = {
|
|
6264
6287
|
on: function(v, b, _) {
|
|
6265
6288
|
var T = this.cStore;
|
|
6266
6289
|
T[v] || (T[v] = []), T[v].push(function(w) {
|
|
@@ -6275,10 +6298,10 @@ function requireHeatmap() {
|
|
|
6275
6298
|
x(b);
|
|
6276
6299
|
}
|
|
6277
6300
|
}
|
|
6278
|
-
},
|
|
6279
|
-
}(),
|
|
6280
|
-
var
|
|
6281
|
-
v.on("renderpartial",
|
|
6301
|
+
}, p;
|
|
6302
|
+
}(), m = function(g) {
|
|
6303
|
+
var p = g._renderer, v = g._coordinator, b = g._store;
|
|
6304
|
+
v.on("renderpartial", p.renderPartial, p), v.on("renderall", p.renderAll, p), v.on("extremachange", function(_) {
|
|
6282
6305
|
g._config.onExtremaChange && g._config.onExtremaChange({
|
|
6283
6306
|
min: _.min,
|
|
6284
6307
|
max: _.max,
|
|
@@ -6289,15 +6312,15 @@ function requireHeatmap() {
|
|
|
6289
6312
|
function y() {
|
|
6290
6313
|
var g = this._config = o.merge(i, arguments[0] || {});
|
|
6291
6314
|
if (this._coordinator = new a(), g.plugin) {
|
|
6292
|
-
var
|
|
6293
|
-
if (i.plugins[
|
|
6294
|
-
var v = i.plugins[
|
|
6315
|
+
var p = g.plugin;
|
|
6316
|
+
if (i.plugins[p]) {
|
|
6317
|
+
var v = i.plugins[p];
|
|
6295
6318
|
this._renderer = new v.renderer(g), this._store = new v.store(g);
|
|
6296
6319
|
} else
|
|
6297
|
-
throw new Error("Plugin '" +
|
|
6320
|
+
throw new Error("Plugin '" + p + "' not found. Maybe it was not registered.");
|
|
6298
6321
|
} else
|
|
6299
|
-
this._renderer = new
|
|
6300
|
-
|
|
6322
|
+
this._renderer = new h(g), this._store = new r(g);
|
|
6323
|
+
m(this);
|
|
6301
6324
|
}
|
|
6302
6325
|
return y.prototype = {
|
|
6303
6326
|
addData: function() {
|
|
@@ -6356,10 +6379,10 @@ const G = class G extends EventEmitter {
|
|
|
6356
6379
|
var c;
|
|
6357
6380
|
const u = r.element;
|
|
6358
6381
|
u.style.position = "absolute";
|
|
6359
|
-
const
|
|
6360
|
-
l && (l.destroy(),
|
|
6382
|
+
const h = r.viewer.container, o = () => {
|
|
6383
|
+
l && (l.destroy(), h.removeChild(u), this.popupMap.delete(r.id), this.emit("onUnmount", r.id));
|
|
6361
6384
|
};
|
|
6362
|
-
|
|
6385
|
+
h.appendChild(u), this.emit("onMount", r.id), (c = this.popupMap.get(r.id)) == null || c.destroy();
|
|
6363
6386
|
const l = new Popup(r.viewer, {
|
|
6364
6387
|
position: r.position,
|
|
6365
6388
|
offset: r.offset ?? [0, 0],
|
|
@@ -6420,5 +6443,6 @@ export {
|
|
|
6420
6443
|
createTdtProvider,
|
|
6421
6444
|
createTdtTerrain,
|
|
6422
6445
|
flyToCameraParams,
|
|
6446
|
+
invertToCanvas,
|
|
6423
6447
|
saveCameraParams
|
|
6424
6448
|
};
|