dmzjDecrypt

解析 dmzj v4 api 返回数据

Tento skript by neměl být instalován přímo. Jedná se o knihovnu, kterou by měly jiné skripty využívat pomocí meta příkazu // @require https://update.greatest.deepsurf.us/scripts/467177/1207199/dmzjDecrypt.js

  1. !function(e, r) {
  2. "object" == typeof exports && "undefined" != typeof module ? module.exports = r() : "function" == typeof define && define.amd ? define(r) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dmzjDecrypt = r();
  3. }(this, (function() {
  4. var BI_RM = "0123456789abcdefghijklmnopqrstuvwxyz", dbits;
  5. function int2char(e) {
  6. return BI_RM.charAt(e);
  7. }
  8. function op_and(e, r) {
  9. return e & r;
  10. }
  11. function op_or(e, r) {
  12. return e | r;
  13. }
  14. function op_xor(e, r) {
  15. return e ^ r;
  16. }
  17. function op_andnot(e, r) {
  18. return e & ~r;
  19. }
  20. function lbit(e) {
  21. if (0 == e) return -1;
  22. var r = 0;
  23. return 0 == (65535 & e) && (e >>= 16, r += 16), 0 == (255 & e) && (e >>= 8, r += 8),
  24. 0 == (15 & e) && (e >>= 4, r += 4), 0 == (3 & e) && (e >>= 2, r += 2), 0 == (1 & e) && ++r,
  25. r;
  26. }
  27. function cbit(e) {
  28. for (var r = 0; 0 != e; ) e &= e - 1, ++r;
  29. return r;
  30. }
  31. var canary = 0xdeadbeefcafe, j_lm = 15715070 == (16777215 & canary), lowprimes = [ 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997 ], lplim = (1 << 26) / lowprimes[lowprimes.length - 1], BigInteger = function() {
  32. function BigInteger(e, r, i) {
  33. null != e && ("number" == typeof e ? this.fromNumber(e, r, i) : null == r && "string" != typeof e ? this.fromString(e, 256) : this.fromString(e, r));
  34. }
  35. return BigInteger.prototype.toString = function(e) {
  36. if (this.s < 0) return "-" + this.negate().toString(e);
  37. var r;
  38. if (16 == e) r = 4; else if (8 == e) r = 3; else if (2 == e) r = 1; else if (32 == e) r = 5; else {
  39. if (4 != e) return this.toRadix(e);
  40. r = 2;
  41. }
  42. var i, n = (1 << r) - 1, o = !1, s = "", a = this.t, u = this.DB - a * this.DB % r;
  43. if (a-- > 0) for (u < this.DB && (i = this[a] >> u) > 0 && (o = !0, s = int2char(i)); a >= 0; ) u < r ? (i = (this[a] & (1 << u) - 1) << r - u,
  44. i |= this[--a] >> (u += this.DB - r)) : (i = this[a] >> (u -= r) & n, u <= 0 && (u += this.DB,
  45. --a)), i > 0 && (o = !0), o && (s += int2char(i));
  46. return o ? s : "0";
  47. }, BigInteger.prototype.negate = function() {
  48. var e = nbi();
  49. return BigInteger.ZERO.subTo(this, e), e;
  50. }, BigInteger.prototype.abs = function() {
  51. return this.s < 0 ? this.negate() : this;
  52. }, BigInteger.prototype.compareTo = function(e) {
  53. var r = this.s - e.s;
  54. if (0 != r) return r;
  55. var i = this.t;
  56. if (0 != (r = i - e.t)) return this.s < 0 ? -r : r;
  57. for (;--i >= 0; ) if (0 != (r = this[i] - e[i])) return r;
  58. return 0;
  59. }, BigInteger.prototype.bitLength = function() {
  60. return this.t <= 0 ? 0 : this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ this.s & this.DM);
  61. }, BigInteger.prototype.mod = function(e) {
  62. var r = nbi();
  63. return this.abs().divRemTo(e, null, r), this.s < 0 && r.compareTo(BigInteger.ZERO) > 0 && e.subTo(r, r),
  64. r;
  65. }, BigInteger.prototype.modPowInt = function(e, r) {
  66. var i;
  67. return i = e < 256 || r.isEven() ? new Classic(r) : new Montgomery(r), this.exp(e, i);
  68. }, BigInteger.prototype.clone = function() {
  69. var e = nbi();
  70. return this.copyTo(e), e;
  71. }, BigInteger.prototype.intValue = function() {
  72. if (this.s < 0) {
  73. if (1 == this.t) return this[0] - this.DV;
  74. if (0 == this.t) return -1;
  75. } else {
  76. if (1 == this.t) return this[0];
  77. if (0 == this.t) return 0;
  78. }
  79. return (this[1] & (1 << 32 - this.DB) - 1) << this.DB | this[0];
  80. }, BigInteger.prototype.byteValue = function() {
  81. return 0 == this.t ? this.s : this[0] << 24 >> 24;
  82. }, BigInteger.prototype.shortValue = function() {
  83. return 0 == this.t ? this.s : this[0] << 16 >> 16;
  84. }, BigInteger.prototype.signum = function() {
  85. return this.s < 0 ? -1 : this.t <= 0 || 1 == this.t && this[0] <= 0 ? 0 : 1;
  86. }, BigInteger.prototype.toByteArray = function() {
  87. var e = this.t, r = [];
  88. r[0] = this.s;
  89. var i, n = this.DB - e * this.DB % 8, o = 0;
  90. if (e-- > 0) for (n < this.DB && (i = this[e] >> n) != (this.s & this.DM) >> n && (r[o++] = i | this.s << this.DB - n); e >= 0; ) n < 8 ? (i = (this[e] & (1 << n) - 1) << 8 - n,
  91. i |= this[--e] >> (n += this.DB - 8)) : (i = this[e] >> (n -= 8) & 255, n <= 0 && (n += this.DB,
  92. --e)), 0 != (128 & i) && (i |= -256), 0 == o && (128 & this.s) != (128 & i) && ++o,
  93. (o > 0 || i != this.s) && (r[o++] = i);
  94. return r;
  95. }, BigInteger.prototype.equals = function(e) {
  96. return 0 == this.compareTo(e);
  97. }, BigInteger.prototype.min = function(e) {
  98. return this.compareTo(e) < 0 ? this : e;
  99. }, BigInteger.prototype.max = function(e) {
  100. return this.compareTo(e) > 0 ? this : e;
  101. }, BigInteger.prototype.and = function(e) {
  102. var r = nbi();
  103. return this.bitwiseTo(e, op_and, r), r;
  104. }, BigInteger.prototype.or = function(e) {
  105. var r = nbi();
  106. return this.bitwiseTo(e, op_or, r), r;
  107. }, BigInteger.prototype.xor = function(e) {
  108. var r = nbi();
  109. return this.bitwiseTo(e, op_xor, r), r;
  110. }, BigInteger.prototype.andNot = function(e) {
  111. var r = nbi();
  112. return this.bitwiseTo(e, op_andnot, r), r;
  113. }, BigInteger.prototype.not = function() {
  114. for (var e = nbi(), r = 0; r < this.t; ++r) e[r] = this.DM & ~this[r];
  115. return e.t = this.t, e.s = ~this.s, e;
  116. }, BigInteger.prototype.shiftLeft = function(e) {
  117. var r = nbi();
  118. return e < 0 ? this.rShiftTo(-e, r) : this.lShiftTo(e, r), r;
  119. }, BigInteger.prototype.shiftRight = function(e) {
  120. var r = nbi();
  121. return e < 0 ? this.lShiftTo(-e, r) : this.rShiftTo(e, r), r;
  122. }, BigInteger.prototype.getLowestSetBit = function() {
  123. for (var e = 0; e < this.t; ++e) if (0 != this[e]) return e * this.DB + lbit(this[e]);
  124. return this.s < 0 ? this.t * this.DB : -1;
  125. }, BigInteger.prototype.bitCount = function() {
  126. for (var e = 0, r = this.s & this.DM, i = 0; i < this.t; ++i) e += cbit(this[i] ^ r);
  127. return e;
  128. }, BigInteger.prototype.testBit = function(e) {
  129. var r = Math.floor(e / this.DB);
  130. return r >= this.t ? 0 != this.s : 0 != (this[r] & 1 << e % this.DB);
  131. }, BigInteger.prototype.setBit = function(e) {
  132. return this.changeBit(e, op_or);
  133. }, BigInteger.prototype.clearBit = function(e) {
  134. return this.changeBit(e, op_andnot);
  135. }, BigInteger.prototype.flipBit = function(e) {
  136. return this.changeBit(e, op_xor);
  137. }, BigInteger.prototype.add = function(e) {
  138. var r = nbi();
  139. return this.addTo(e, r), r;
  140. }, BigInteger.prototype.subtract = function(e) {
  141. var r = nbi();
  142. return this.subTo(e, r), r;
  143. }, BigInteger.prototype.multiply = function(e) {
  144. var r = nbi();
  145. return this.multiplyTo(e, r), r;
  146. }, BigInteger.prototype.divide = function(e) {
  147. var r = nbi();
  148. return this.divRemTo(e, r, null), r;
  149. }, BigInteger.prototype.remainder = function(e) {
  150. var r = nbi();
  151. return this.divRemTo(e, null, r), r;
  152. }, BigInteger.prototype.divideAndRemainder = function(e) {
  153. var r = nbi(), i = nbi();
  154. return this.divRemTo(e, r, i), [ r, i ];
  155. }, BigInteger.prototype.modPow = function(e, r) {
  156. var i, n, o = e.bitLength(), s = nbv(1);
  157. if (o <= 0) return s;
  158. i = o < 18 ? 1 : o < 48 ? 3 : o < 144 ? 4 : o < 768 ? 5 : 6, n = o < 8 ? new Classic(r) : r.isEven() ? new Barrett(r) : new Montgomery(r);
  159. var a = [], u = 3, l = i - 1, f = (1 << i) - 1;
  160. if (a[1] = n.convert(this), i > 1) {
  161. var h = nbi();
  162. for (n.sqrTo(a[1], h); u <= f; ) a[u] = nbi(), n.mulTo(h, a[u - 2], a[u]), u += 2;
  163. }
  164. var p, c, d = e.t - 1, g = !0, m = nbi();
  165. for (o = nbits(e[d]) - 1; d >= 0; ) {
  166. for (o >= l ? p = e[d] >> o - l & f : (p = (e[d] & (1 << o + 1) - 1) << l - o, d > 0 && (p |= e[d - 1] >> this.DB + o - l)),
  167. u = i; 0 == (1 & p); ) p >>= 1, --u;
  168. if ((o -= u) < 0 && (o += this.DB, --d), g) a[p].copyTo(s), g = !1; else {
  169. for (;u > 1; ) n.sqrTo(s, m), n.sqrTo(m, s), u -= 2;
  170. u > 0 ? n.sqrTo(s, m) : (c = s, s = m, m = c), n.mulTo(m, a[p], s);
  171. }
  172. for (;d >= 0 && 0 == (e[d] & 1 << o); ) n.sqrTo(s, m), c = s, s = m, m = c, --o < 0 && (o = this.DB - 1,
  173. --d);
  174. }
  175. return n.revert(s);
  176. }, BigInteger.prototype.modInverse = function(e) {
  177. var r = e.isEven();
  178. if (this.isEven() && r || 0 == e.signum()) return BigInteger.ZERO;
  179. for (var i = e.clone(), n = this.clone(), o = nbv(1), s = nbv(0), a = nbv(0), u = nbv(1); 0 != i.signum(); ) {
  180. for (;i.isEven(); ) i.rShiftTo(1, i), r ? (o.isEven() && s.isEven() || (o.addTo(this, o),
  181. s.subTo(e, s)), o.rShiftTo(1, o)) : s.isEven() || s.subTo(e, s), s.rShiftTo(1, s);
  182. for (;n.isEven(); ) n.rShiftTo(1, n), r ? (a.isEven() && u.isEven() || (a.addTo(this, a),
  183. u.subTo(e, u)), a.rShiftTo(1, a)) : u.isEven() || u.subTo(e, u), u.rShiftTo(1, u);
  184. i.compareTo(n) >= 0 ? (i.subTo(n, i), r && o.subTo(a, o), s.subTo(u, s)) : (n.subTo(i, n),
  185. r && a.subTo(o, a), u.subTo(s, u));
  186. }
  187. return 0 != n.compareTo(BigInteger.ONE) ? BigInteger.ZERO : u.compareTo(e) >= 0 ? u.subtract(e) : u.signum() < 0 ? (u.addTo(e, u),
  188. u.signum() < 0 ? u.add(e) : u) : u;
  189. }, BigInteger.prototype.pow = function(e) {
  190. return this.exp(e, new NullExp);
  191. }, BigInteger.prototype.gcd = function(e) {
  192. var r = this.s < 0 ? this.negate() : this.clone(), i = e.s < 0 ? e.negate() : e.clone();
  193. if (r.compareTo(i) < 0) {
  194. var n = r;
  195. r = i, i = n;
  196. }
  197. var o = r.getLowestSetBit(), s = i.getLowestSetBit();
  198. if (s < 0) return r;
  199. for (o < s && (s = o), s > 0 && (r.rShiftTo(s, r), i.rShiftTo(s, i)); r.signum() > 0; ) (o = r.getLowestSetBit()) > 0 && r.rShiftTo(o, r),
  200. (o = i.getLowestSetBit()) > 0 && i.rShiftTo(o, i), r.compareTo(i) >= 0 ? (r.subTo(i, r),
  201. r.rShiftTo(1, r)) : (i.subTo(r, i), i.rShiftTo(1, i));
  202. return s > 0 && i.lShiftTo(s, i), i;
  203. }, BigInteger.prototype.isProbablePrime = function(e) {
  204. var r, i = this.abs();
  205. if (1 == i.t && i[0] <= lowprimes[lowprimes.length - 1]) {
  206. for (r = 0; r < lowprimes.length; ++r) if (i[0] == lowprimes[r]) return !0;
  207. return !1;
  208. }
  209. if (i.isEven()) return !1;
  210. for (r = 1; r < lowprimes.length; ) {
  211. for (var n = lowprimes[r], o = r + 1; o < lowprimes.length && n < lplim; ) n *= lowprimes[o++];
  212. for (n = i.modInt(n); r < o; ) if (n % lowprimes[r++] == 0) return !1;
  213. }
  214. return i.millerRabin(e);
  215. }, BigInteger.prototype.copyTo = function(e) {
  216. for (var r = this.t - 1; r >= 0; --r) e[r] = this[r];
  217. e.t = this.t, e.s = this.s;
  218. }, BigInteger.prototype.fromInt = function(e) {
  219. this.t = 1, this.s = e < 0 ? -1 : 0, e > 0 ? this[0] = e : e < -1 ? this[0] = e + this.DV : this.t = 0;
  220. }, BigInteger.prototype.fromString = function(e, r) {
  221. var i;
  222. if (16 == r) i = 4; else if (8 == r) i = 3; else if (256 == r) i = 8; else if (2 == r) i = 1; else if (32 == r) i = 5; else {
  223. if (4 != r) return void this.fromRadix(e, r);
  224. i = 2;
  225. }
  226. this.t = 0, this.s = 0;
  227. for (var n = e.length, o = !1, s = 0; --n >= 0; ) {
  228. var a = 8 == i ? 255 & +e[n] : intAt(e, n);
  229. a < 0 ? "-" == e.charAt(n) && (o = !0) : (o = !1, 0 == s ? this[this.t++] = a : s + i > this.DB ? (this[this.t - 1] |= (a & (1 << this.DB - s) - 1) << s,
  230. this[this.t++] = a >> this.DB - s) : this[this.t - 1] |= a << s, (s += i) >= this.DB && (s -= this.DB));
  231. }
  232. 8 == i && 0 != (128 & +e[0]) && (this.s = -1, s > 0 && (this[this.t - 1] |= (1 << this.DB - s) - 1 << s)),
  233. this.clamp(), o && BigInteger.ZERO.subTo(this, this);
  234. }, BigInteger.prototype.clamp = function() {
  235. for (var e = this.s & this.DM; this.t > 0 && this[this.t - 1] == e; ) --this.t;
  236. }, BigInteger.prototype.dlShiftTo = function(e, r) {
  237. var i;
  238. for (i = this.t - 1; i >= 0; --i) r[i + e] = this[i];
  239. for (i = e - 1; i >= 0; --i) r[i] = 0;
  240. r.t = this.t + e, r.s = this.s;
  241. }, BigInteger.prototype.drShiftTo = function(e, r) {
  242. for (var i = e; i < this.t; ++i) r[i - e] = this[i];
  243. r.t = Math.max(this.t - e, 0), r.s = this.s;
  244. }, BigInteger.prototype.lShiftTo = function(e, r) {
  245. for (var i = e % this.DB, n = this.DB - i, o = (1 << n) - 1, s = Math.floor(e / this.DB), a = this.s << i & this.DM, u = this.t - 1; u >= 0; --u) r[u + s + 1] = this[u] >> n | a,
  246. a = (this[u] & o) << i;
  247. for (u = s - 1; u >= 0; --u) r[u] = 0;
  248. r[s] = a, r.t = this.t + s + 1, r.s = this.s, r.clamp();
  249. }, BigInteger.prototype.rShiftTo = function(e, r) {
  250. r.s = this.s;
  251. var i = Math.floor(e / this.DB);
  252. if (i >= this.t) r.t = 0; else {
  253. var n = e % this.DB, o = this.DB - n, s = (1 << n) - 1;
  254. r[0] = this[i] >> n;
  255. for (var a = i + 1; a < this.t; ++a) r[a - i - 1] |= (this[a] & s) << o, r[a - i] = this[a] >> n;
  256. n > 0 && (r[this.t - i - 1] |= (this.s & s) << o), r.t = this.t - i, r.clamp();
  257. }
  258. }, BigInteger.prototype.subTo = function(e, r) {
  259. for (var i = 0, n = 0, o = Math.min(e.t, this.t); i < o; ) n += this[i] - e[i],
  260. r[i++] = n & this.DM, n >>= this.DB;
  261. if (e.t < this.t) {
  262. for (n -= e.s; i < this.t; ) n += this[i], r[i++] = n & this.DM, n >>= this.DB;
  263. n += this.s;
  264. } else {
  265. for (n += this.s; i < e.t; ) n -= e[i], r[i++] = n & this.DM, n >>= this.DB;
  266. n -= e.s;
  267. }
  268. r.s = n < 0 ? -1 : 0, n < -1 ? r[i++] = this.DV + n : n > 0 && (r[i++] = n), r.t = i,
  269. r.clamp();
  270. }, BigInteger.prototype.multiplyTo = function(e, r) {
  271. var i = this.abs(), n = e.abs(), o = i.t;
  272. for (r.t = o + n.t; --o >= 0; ) r[o] = 0;
  273. for (o = 0; o < n.t; ++o) r[o + i.t] = i.am(0, n[o], r, o, 0, i.t);
  274. r.s = 0, r.clamp(), this.s != e.s && BigInteger.ZERO.subTo(r, r);
  275. }, BigInteger.prototype.squareTo = function(e) {
  276. for (var r = this.abs(), i = e.t = 2 * r.t; --i >= 0; ) e[i] = 0;
  277. for (i = 0; i < r.t - 1; ++i) {
  278. var n = r.am(i, r[i], e, 2 * i, 0, 1);
  279. (e[i + r.t] += r.am(i + 1, 2 * r[i], e, 2 * i + 1, n, r.t - i - 1)) >= r.DV && (e[i + r.t] -= r.DV,
  280. e[i + r.t + 1] = 1);
  281. }
  282. e.t > 0 && (e[e.t - 1] += r.am(i, r[i], e, 2 * i, 0, 1)), e.s = 0, e.clamp();
  283. }, BigInteger.prototype.divRemTo = function(e, r, i) {
  284. var n = e.abs();
  285. if (!(n.t <= 0)) {
  286. var o = this.abs();
  287. if (o.t < n.t) return null != r && r.fromInt(0), void (null != i && this.copyTo(i));
  288. null == i && (i = nbi());
  289. var s = nbi(), a = this.s, u = e.s, l = this.DB - nbits(n[n.t - 1]);
  290. l > 0 ? (n.lShiftTo(l, s), o.lShiftTo(l, i)) : (n.copyTo(s), o.copyTo(i));
  291. var f = s.t, h = s[f - 1];
  292. if (0 != h) {
  293. var p = h * (1 << this.F1) + (f > 1 ? s[f - 2] >> this.F2 : 0), c = this.FV / p, d = (1 << this.F1) / p, g = 1 << this.F2, m = i.t, y = m - f, v = null == r ? nbi() : r;
  294. for (s.dlShiftTo(y, v), i.compareTo(v) >= 0 && (i[i.t++] = 1, i.subTo(v, i)), BigInteger.ONE.dlShiftTo(f, v),
  295. v.subTo(s, s); s.t < f; ) s[s.t++] = 0;
  296. for (;--y >= 0; ) {
  297. var b = i[--m] == h ? this.DM : Math.floor(i[m] * c + (i[m - 1] + g) * d);
  298. if ((i[m] += s.am(0, b, i, y, 0, f)) < b) for (s.dlShiftTo(y, v), i.subTo(v, i); i[m] < --b; ) i.subTo(v, i);
  299. }
  300. null != r && (i.drShiftTo(f, r), a != u && BigInteger.ZERO.subTo(r, r)), i.t = f,
  301. i.clamp(), l > 0 && i.rShiftTo(l, i), a < 0 && BigInteger.ZERO.subTo(i, i);
  302. }
  303. }
  304. }, BigInteger.prototype.invDigit = function() {
  305. if (this.t < 1) return 0;
  306. var e = this[0];
  307. if (0 == (1 & e)) return 0;
  308. var r = 3 & e;
  309. return (r = (r = (r = (r = r * (2 - (15 & e) * r) & 15) * (2 - (255 & e) * r) & 255) * (2 - ((65535 & e) * r & 65535)) & 65535) * (2 - e * r % this.DV) % this.DV) > 0 ? this.DV - r : -r;
  310. }, BigInteger.prototype.isEven = function() {
  311. return 0 == (this.t > 0 ? 1 & this[0] : this.s);
  312. }, BigInteger.prototype.exp = function(e, r) {
  313. if (e > 4294967295 || e < 1) return BigInteger.ONE;
  314. var i = nbi(), n = nbi(), o = r.convert(this), s = nbits(e) - 1;
  315. for (o.copyTo(i); --s >= 0; ) if (r.sqrTo(i, n), (e & 1 << s) > 0) r.mulTo(n, o, i); else {
  316. var a = i;
  317. i = n, n = a;
  318. }
  319. return r.revert(i);
  320. }, BigInteger.prototype.chunkSize = function(e) {
  321. return Math.floor(Math.LN2 * this.DB / Math.log(e));
  322. }, BigInteger.prototype.toRadix = function(e) {
  323. if (null == e && (e = 10), 0 == this.signum() || e < 2 || e > 36) return "0";
  324. var r = this.chunkSize(e), i = Math.pow(e, r), n = nbv(i), o = nbi(), s = nbi(), a = "";
  325. for (this.divRemTo(n, o, s); o.signum() > 0; ) a = (i + s.intValue()).toString(e).substr(1) + a,
  326. o.divRemTo(n, o, s);
  327. return s.intValue().toString(e) + a;
  328. }, BigInteger.prototype.fromRadix = function(e, r) {
  329. this.fromInt(0), null == r && (r = 10);
  330. for (var i = this.chunkSize(r), n = Math.pow(r, i), o = !1, s = 0, a = 0, u = 0; u < e.length; ++u) {
  331. var l = intAt(e, u);
  332. l < 0 ? "-" == e.charAt(u) && 0 == this.signum() && (o = !0) : (a = r * a + l, ++s >= i && (this.dMultiply(n),
  333. this.dAddOffset(a, 0), s = 0, a = 0));
  334. }
  335. s > 0 && (this.dMultiply(Math.pow(r, s)), this.dAddOffset(a, 0)), o && BigInteger.ZERO.subTo(this, this);
  336. }, BigInteger.prototype.fromNumber = function(e, r, i) {
  337. if ("number" == typeof r) if (e < 2) this.fromInt(1); else for (this.fromNumber(e, i),
  338. this.testBit(e - 1) || this.bitwiseTo(BigInteger.ONE.shiftLeft(e - 1), op_or, this),
  339. this.isEven() && this.dAddOffset(1, 0); !this.isProbablePrime(r); ) this.dAddOffset(2, 0),
  340. this.bitLength() > e && this.subTo(BigInteger.ONE.shiftLeft(e - 1), this); else {
  341. var n = [], o = 7 & e;
  342. n.length = 1 + (e >> 3), r.nextBytes(n), o > 0 ? n[0] &= (1 << o) - 1 : n[0] = 0,
  343. this.fromString(n, 256);
  344. }
  345. }, BigInteger.prototype.bitwiseTo = function(e, r, i) {
  346. var n, o, s = Math.min(e.t, this.t);
  347. for (n = 0; n < s; ++n) i[n] = r(this[n], e[n]);
  348. if (e.t < this.t) {
  349. for (o = e.s & this.DM, n = s; n < this.t; ++n) i[n] = r(this[n], o);
  350. i.t = this.t;
  351. } else {
  352. for (o = this.s & this.DM, n = s; n < e.t; ++n) i[n] = r(o, e[n]);
  353. i.t = e.t;
  354. }
  355. i.s = r(this.s, e.s), i.clamp();
  356. }, BigInteger.prototype.changeBit = function(e, r) {
  357. var i = BigInteger.ONE.shiftLeft(e);
  358. return this.bitwiseTo(i, r, i), i;
  359. }, BigInteger.prototype.addTo = function(e, r) {
  360. for (var i = 0, n = 0, o = Math.min(e.t, this.t); i < o; ) n += this[i] + e[i],
  361. r[i++] = n & this.DM, n >>= this.DB;
  362. if (e.t < this.t) {
  363. for (n += e.s; i < this.t; ) n += this[i], r[i++] = n & this.DM, n >>= this.DB;
  364. n += this.s;
  365. } else {
  366. for (n += this.s; i < e.t; ) n += e[i], r[i++] = n & this.DM, n >>= this.DB;
  367. n += e.s;
  368. }
  369. r.s = n < 0 ? -1 : 0, n > 0 ? r[i++] = n : n < -1 && (r[i++] = this.DV + n), r.t = i,
  370. r.clamp();
  371. }, BigInteger.prototype.dMultiply = function(e) {
  372. this[this.t] = this.am(0, e - 1, this, 0, 0, this.t), ++this.t, this.clamp();
  373. }, BigInteger.prototype.dAddOffset = function(e, r) {
  374. if (0 != e) {
  375. for (;this.t <= r; ) this[this.t++] = 0;
  376. for (this[r] += e; this[r] >= this.DV; ) this[r] -= this.DV, ++r >= this.t && (this[this.t++] = 0),
  377. ++this[r];
  378. }
  379. }, BigInteger.prototype.multiplyLowerTo = function(e, r, i) {
  380. var n = Math.min(this.t + e.t, r);
  381. for (i.s = 0, i.t = n; n > 0; ) i[--n] = 0;
  382. for (var o = i.t - this.t; n < o; ++n) i[n + this.t] = this.am(0, e[n], i, n, 0, this.t);
  383. for (o = Math.min(e.t, r); n < o; ++n) this.am(0, e[n], i, n, 0, r - n);
  384. i.clamp();
  385. }, BigInteger.prototype.multiplyUpperTo = function(e, r, i) {
  386. --r;
  387. var n = i.t = this.t + e.t - r;
  388. for (i.s = 0; --n >= 0; ) i[n] = 0;
  389. for (n = Math.max(r - this.t, 0); n < e.t; ++n) i[this.t + n - r] = this.am(r - n, e[n], i, 0, 0, this.t + n - r);
  390. i.clamp(), i.drShiftTo(1, i);
  391. }, BigInteger.prototype.modInt = function(e) {
  392. if (e <= 0) return 0;
  393. var r = this.DV % e, i = this.s < 0 ? e - 1 : 0;
  394. if (this.t > 0) if (0 == r) i = this[0] % e; else for (var n = this.t - 1; n >= 0; --n) i = (r * i + this[n]) % e;
  395. return i;
  396. }, BigInteger.prototype.millerRabin = function(e) {
  397. var r = this.subtract(BigInteger.ONE), i = r.getLowestSetBit();
  398. if (i <= 0) return !1;
  399. var n = r.shiftRight(i);
  400. (e = e + 1 >> 1) > lowprimes.length && (e = lowprimes.length);
  401. for (var o = nbi(), s = 0; s < e; ++s) {
  402. o.fromInt(lowprimes[Math.floor(Math.random() * lowprimes.length)]);
  403. var a = o.modPow(n, this);
  404. if (0 != a.compareTo(BigInteger.ONE) && 0 != a.compareTo(r)) {
  405. for (var u = 1; u++ < i && 0 != a.compareTo(r); ) if (0 == (a = a.modPowInt(2, this)).compareTo(BigInteger.ONE)) return !1;
  406. if (0 != a.compareTo(r)) return !1;
  407. }
  408. }
  409. return !0;
  410. }, BigInteger.prototype.square = function() {
  411. var e = nbi();
  412. return this.squareTo(e), e;
  413. }, BigInteger.prototype.gcda = function(e, r) {
  414. var i = this.s < 0 ? this.negate() : this.clone(), n = e.s < 0 ? e.negate() : e.clone();
  415. if (i.compareTo(n) < 0) {
  416. var o = i;
  417. i = n, n = o;
  418. }
  419. var s = i.getLowestSetBit(), a = n.getLowestSetBit();
  420. if (a < 0) r(i); else {
  421. s < a && (a = s), a > 0 && (i.rShiftTo(a, i), n.rShiftTo(a, n));
  422. var gcda1 = function() {
  423. (s = i.getLowestSetBit()) > 0 && i.rShiftTo(s, i), (s = n.getLowestSetBit()) > 0 && n.rShiftTo(s, n),
  424. i.compareTo(n) >= 0 ? (i.subTo(n, i), i.rShiftTo(1, i)) : (n.subTo(i, n), n.rShiftTo(1, n)),
  425. i.signum() > 0 ? setTimeout(gcda1, 0) : (a > 0 && n.lShiftTo(a, n), setTimeout((function() {
  426. r(n);
  427. }), 0));
  428. };
  429. setTimeout(gcda1, 10);
  430. }
  431. }, BigInteger.prototype.fromNumberAsync = function(e, r, i, n) {
  432. if ("number" == typeof r) if (e < 2) this.fromInt(1); else {
  433. this.fromNumber(e, i), this.testBit(e - 1) || this.bitwiseTo(BigInteger.ONE.shiftLeft(e - 1), op_or, this),
  434. this.isEven() && this.dAddOffset(1, 0);
  435. var o = this, bnpfn1_1 = function() {
  436. o.dAddOffset(2, 0), o.bitLength() > e && o.subTo(BigInteger.ONE.shiftLeft(e - 1), o),
  437. o.isProbablePrime(r) ? setTimeout((function() {
  438. n();
  439. }), 0) : setTimeout(bnpfn1_1, 0);
  440. };
  441. setTimeout(bnpfn1_1, 0);
  442. } else {
  443. var s = [], a = 7 & e;
  444. s.length = 1 + (e >> 3), r.nextBytes(s), a > 0 ? s[0] &= (1 << a) - 1 : s[0] = 0,
  445. this.fromString(s, 256);
  446. }
  447. }, BigInteger;
  448. }(), NullExp = function() {
  449. function NullExp() {}
  450. return NullExp.prototype.convert = function(e) {
  451. return e;
  452. }, NullExp.prototype.revert = function(e) {
  453. return e;
  454. }, NullExp.prototype.mulTo = function(e, r, i) {
  455. e.multiplyTo(r, i);
  456. }, NullExp.prototype.sqrTo = function(e, r) {
  457. e.squareTo(r);
  458. }, NullExp;
  459. }(), Classic = function() {
  460. function Classic(e) {
  461. this.m = e;
  462. }
  463. return Classic.prototype.convert = function(e) {
  464. return e.s < 0 || e.compareTo(this.m) >= 0 ? e.mod(this.m) : e;
  465. }, Classic.prototype.revert = function(e) {
  466. return e;
  467. }, Classic.prototype.reduce = function(e) {
  468. e.divRemTo(this.m, null, e);
  469. }, Classic.prototype.mulTo = function(e, r, i) {
  470. e.multiplyTo(r, i), this.reduce(i);
  471. }, Classic.prototype.sqrTo = function(e, r) {
  472. e.squareTo(r), this.reduce(r);
  473. }, Classic;
  474. }(), Montgomery = function() {
  475. function Montgomery(e) {
  476. this.m = e, this.mp = e.invDigit(), this.mpl = 32767 & this.mp, this.mph = this.mp >> 15,
  477. this.um = (1 << e.DB - 15) - 1, this.mt2 = 2 * e.t;
  478. }
  479. return Montgomery.prototype.convert = function(e) {
  480. var r = nbi();
  481. return e.abs().dlShiftTo(this.m.t, r), r.divRemTo(this.m, null, r), e.s < 0 && r.compareTo(BigInteger.ZERO) > 0 && this.m.subTo(r, r),
  482. r;
  483. }, Montgomery.prototype.revert = function(e) {
  484. var r = nbi();
  485. return e.copyTo(r), this.reduce(r), r;
  486. }, Montgomery.prototype.reduce = function(e) {
  487. for (;e.t <= this.mt2; ) e[e.t++] = 0;
  488. for (var r = 0; r < this.m.t; ++r) {
  489. var i = 32767 & e[r], n = i * this.mpl + ((i * this.mph + (e[r] >> 15) * this.mpl & this.um) << 15) & e.DM;
  490. for (e[i = r + this.m.t] += this.m.am(0, n, e, r, 0, this.m.t); e[i] >= e.DV; ) e[i] -= e.DV,
  491. e[++i]++;
  492. }
  493. e.clamp(), e.drShiftTo(this.m.t, e), e.compareTo(this.m) >= 0 && e.subTo(this.m, e);
  494. }, Montgomery.prototype.mulTo = function(e, r, i) {
  495. e.multiplyTo(r, i), this.reduce(i);
  496. }, Montgomery.prototype.sqrTo = function(e, r) {
  497. e.squareTo(r), this.reduce(r);
  498. }, Montgomery;
  499. }(), Barrett = function() {
  500. function Barrett(e) {
  501. this.m = e, this.r2 = nbi(), this.q3 = nbi(), BigInteger.ONE.dlShiftTo(2 * e.t, this.r2),
  502. this.mu = this.r2.divide(e);
  503. }
  504. return Barrett.prototype.convert = function(e) {
  505. if (e.s < 0 || e.t > 2 * this.m.t) return e.mod(this.m);
  506. if (e.compareTo(this.m) < 0) return e;
  507. var r = nbi();
  508. return e.copyTo(r), this.reduce(r), r;
  509. }, Barrett.prototype.revert = function(e) {
  510. return e;
  511. }, Barrett.prototype.reduce = function(e) {
  512. for (e.drShiftTo(this.m.t - 1, this.r2), e.t > this.m.t + 1 && (e.t = this.m.t + 1,
  513. e.clamp()), this.mu.multiplyUpperTo(this.r2, this.m.t + 1, this.q3), this.m.multiplyLowerTo(this.q3, this.m.t + 1, this.r2); e.compareTo(this.r2) < 0; ) e.dAddOffset(1, this.m.t + 1);
  514. for (e.subTo(this.r2, e); e.compareTo(this.m) >= 0; ) e.subTo(this.m, e);
  515. }, Barrett.prototype.mulTo = function(e, r, i) {
  516. e.multiplyTo(r, i), this.reduce(i);
  517. }, Barrett.prototype.sqrTo = function(e, r) {
  518. e.squareTo(r), this.reduce(r);
  519. }, Barrett;
  520. }();
  521. function nbi() {
  522. return new BigInteger(null);
  523. }
  524. function parseBigInt(e, r) {
  525. return new BigInteger(e, r);
  526. }
  527. var inBrowser = "undefined" != typeof navigator;
  528. inBrowser && j_lm && "Microsoft Internet Explorer" == navigator.appName ? (BigInteger.prototype.am = function am2(e, r, i, n, o, s) {
  529. for (var a = 32767 & r, u = r >> 15; --s >= 0; ) {
  530. var l = 32767 & this[e], f = this[e++] >> 15, h = u * l + f * a;
  531. o = ((l = a * l + ((32767 & h) << 15) + i[n] + (1073741823 & o)) >>> 30) + (h >>> 15) + u * f + (o >>> 30),
  532. i[n++] = 1073741823 & l;
  533. }
  534. return o;
  535. }, dbits = 30) : inBrowser && j_lm && "Netscape" != navigator.appName ? (BigInteger.prototype.am = function am1(e, r, i, n, o, s) {
  536. for (;--s >= 0; ) {
  537. var a = r * this[e++] + i[n] + o;
  538. o = Math.floor(a / 67108864), i[n++] = 67108863 & a;
  539. }
  540. return o;
  541. }, dbits = 26) : (BigInteger.prototype.am = function am3(e, r, i, n, o, s) {
  542. for (var a = 16383 & r, u = r >> 14; --s >= 0; ) {
  543. var l = 16383 & this[e], f = this[e++] >> 14, h = u * l + f * a;
  544. o = ((l = a * l + ((16383 & h) << 14) + i[n] + o) >> 28) + (h >> 14) + u * f, i[n++] = 268435455 & l;
  545. }
  546. return o;
  547. }, dbits = 28), BigInteger.prototype.DB = dbits, BigInteger.prototype.DM = (1 << dbits) - 1,
  548. BigInteger.prototype.DV = 1 << dbits;
  549. var BI_FP = 52;
  550. BigInteger.prototype.FV = Math.pow(2, BI_FP), BigInteger.prototype.F1 = BI_FP - dbits,
  551. BigInteger.prototype.F2 = 2 * dbits - BI_FP;
  552. var BI_RC = [], rr, vv;
  553. for (rr = "0".charCodeAt(0), vv = 0; vv <= 9; ++vv) BI_RC[rr++] = vv;
  554. for (rr = "a".charCodeAt(0), vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;
  555. for (rr = "A".charCodeAt(0), vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;
  556. function intAt(e, r) {
  557. var i = BI_RC[e.charCodeAt(r)];
  558. return null == i ? -1 : i;
  559. }
  560. function nbv(e) {
  561. var r = nbi();
  562. return r.fromInt(e), r;
  563. }
  564. function nbits(e) {
  565. var r, i = 1;
  566. return 0 != (r = e >>> 16) && (e = r, i += 16), 0 != (r = e >> 8) && (e = r, i += 8),
  567. 0 != (r = e >> 4) && (e = r, i += 4), 0 != (r = e >> 2) && (e = r, i += 2), 0 != (r = e >> 1) && (e = r,
  568. i += 1), i;
  569. }
  570. BigInteger.ZERO = nbv(0), BigInteger.ONE = nbv(1);
  571. var b64map = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", b64pad = "=", decoder$1;
  572. function hex2b64(e) {
  573. var r, i, n = "";
  574. for (r = 0; r + 3 <= e.length; r += 3) i = parseInt(e.substring(r, r + 3), 16),
  575. n += b64map.charAt(i >> 6) + b64map.charAt(63 & i);
  576. for (r + 1 == e.length ? (i = parseInt(e.substring(r, r + 1), 16), n += b64map.charAt(i << 2)) : r + 2 == e.length && (i = parseInt(e.substring(r, r + 2), 16),
  577. n += b64map.charAt(i >> 2) + b64map.charAt((3 & i) << 4)); (3 & n.length) > 0; ) n += b64pad;
  578. return n;
  579. }
  580. function b64tohex(e) {
  581. var r, i = "", n = 0, o = 0;
  582. for (r = 0; r < e.length && e.charAt(r) != b64pad; ++r) {
  583. var s = b64map.indexOf(e.charAt(r));
  584. s < 0 || (0 == n ? (i += int2char(s >> 2), o = 3 & s, n = 1) : 1 == n ? (i += int2char(o << 2 | s >> 4),
  585. o = 15 & s, n = 2) : 2 == n ? (i += int2char(o), i += int2char(s >> 2), o = 3 & s,
  586. n = 3) : (i += int2char(o << 2 | s >> 4), i += int2char(15 & s), n = 0));
  587. }
  588. return 1 == n && (i += int2char(o << 2)), i;
  589. }
  590. var Hex = {
  591. decode: function(e) {
  592. var r;
  593. if (void 0 === decoder$1) {
  594. var i = "0123456789ABCDEF", n = " \f\n\r\t \u2028\u2029";
  595. for (decoder$1 = {}, r = 0; r < 16; ++r) decoder$1[i.charAt(r)] = r;
  596. for (i = i.toLowerCase(), r = 10; r < 16; ++r) decoder$1[i.charAt(r)] = r;
  597. for (r = 0; r < 8; ++r) decoder$1[n.charAt(r)] = -1;
  598. }
  599. var o = [], s = 0, a = 0;
  600. for (r = 0; r < e.length; ++r) {
  601. var u = e.charAt(r);
  602. if ("=" == u) break;
  603. if (-1 != (u = decoder$1[u])) {
  604. if (void 0 === u) throw new Error("Illegal character at offset " + r);
  605. s |= u, ++a >= 2 ? (o[o.length] = s, s = 0, a = 0) : s <<= 4;
  606. }
  607. }
  608. if (a) throw new Error("Hex encoding incomplete: 4 bits missing");
  609. return o;
  610. }
  611. }, decoder, Base64 = {
  612. decode: function(e) {
  613. var r;
  614. if (void 0 === decoder) {
  615. var i = "= \f\n\r\t \u2028\u2029";
  616. for (decoder = Object.create(null), r = 0; r < 64; ++r) decoder["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(r)] = r;
  617. for (decoder["-"] = 62, decoder._ = 63, r = 0; r < 9; ++r) decoder[i.charAt(r)] = -1;
  618. }
  619. var n = [], o = 0, s = 0;
  620. for (r = 0; r < e.length; ++r) {
  621. var a = e.charAt(r);
  622. if ("=" == a) break;
  623. if (-1 != (a = decoder[a])) {
  624. if (void 0 === a) throw new Error("Illegal character at offset " + r);
  625. o |= a, ++s >= 4 ? (n[n.length] = o >> 16, n[n.length] = o >> 8 & 255, n[n.length] = 255 & o,
  626. o = 0, s = 0) : o <<= 6;
  627. }
  628. }
  629. switch (s) {
  630. case 1:
  631. throw new Error("Base64 encoding incomplete: at least 2 bits missing");
  632.  
  633. case 2:
  634. n[n.length] = o >> 10;
  635. break;
  636.  
  637. case 3:
  638. n[n.length] = o >> 16, n[n.length] = o >> 8 & 255;
  639. }
  640. return n;
  641. },
  642. re: /-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,
  643. unarmor: function(e) {
  644. var r = Base64.re.exec(e);
  645. if (r) if (r[1]) e = r[1]; else {
  646. if (!r[2]) throw new Error("RegExp out of sync");
  647. e = r[2];
  648. }
  649. return Base64.decode(e);
  650. }
  651. }, max = 1e13, Int10 = function() {
  652. function Int10(e) {
  653. this.buf = [ +e || 0 ];
  654. }
  655. return Int10.prototype.mulAdd = function(e, r) {
  656. var i, n, o = this.buf, s = o.length;
  657. for (i = 0; i < s; ++i) (n = o[i] * e + r) < max ? r = 0 : n -= (r = 0 | n / max) * max,
  658. o[i] = n;
  659. r > 0 && (o[i] = r);
  660. }, Int10.prototype.sub = function(e) {
  661. var r, i, n = this.buf, o = n.length;
  662. for (r = 0; r < o; ++r) (i = n[r] - e) < 0 ? (i += max, e = 1) : e = 0, n[r] = i;
  663. for (;0 === n[n.length - 1]; ) n.pop();
  664. }, Int10.prototype.toString = function(e) {
  665. if (10 != (e || 10)) throw new Error("only base 10 is supported");
  666. for (var r = this.buf, i = r[r.length - 1].toString(), n = r.length - 2; n >= 0; --n) i += (max + r[n]).toString().substring(1);
  667. return i;
  668. }, Int10.prototype.valueOf = function() {
  669. for (var e = this.buf, r = 0, i = e.length - 1; i >= 0; --i) r = r * max + e[i];
  670. return r;
  671. }, Int10.prototype.simplify = function() {
  672. var e = this.buf;
  673. return 1 == e.length ? e[0] : this;
  674. }, Int10;
  675. }(), ellipsis = "…", reTimeS = /^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/, reTimeL = /^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;
  676. function stringCut(e, r) {
  677. return e.length > r && (e = e.substring(0, r) + ellipsis), e;
  678. }
  679. var Stream = function() {
  680. function Stream(e, r) {
  681. this.hexDigits = "0123456789ABCDEF", e instanceof Stream ? (this.enc = e.enc, this.pos = e.pos) : (this.enc = e,
  682. this.pos = r);
  683. }
  684. return Stream.prototype.get = function(e) {
  685. if (void 0 === e && (e = this.pos++), e >= this.enc.length) throw new Error("Requesting byte offset ".concat(e, " on a stream of length ").concat(this.enc.length));
  686. return "string" == typeof this.enc ? this.enc.charCodeAt(e) : this.enc[e];
  687. }, Stream.prototype.hexByte = function(e) {
  688. return this.hexDigits.charAt(e >> 4 & 15) + this.hexDigits.charAt(15 & e);
  689. }, Stream.prototype.hexDump = function(e, r, i) {
  690. for (var n = "", o = e; o < r; ++o) if (n += this.hexByte(this.get(o)), !0 !== i) switch (15 & o) {
  691. case 7:
  692. n += " ";
  693. break;
  694.  
  695. case 15:
  696. n += "\n";
  697. break;
  698.  
  699. default:
  700. n += " ";
  701. }
  702. return n;
  703. }, Stream.prototype.isASCII = function(e, r) {
  704. for (var i = e; i < r; ++i) {
  705. var n = this.get(i);
  706. if (n < 32 || n > 176) return !1;
  707. }
  708. return !0;
  709. }, Stream.prototype.parseStringISO = function(e, r) {
  710. for (var i = "", n = e; n < r; ++n) i += String.fromCharCode(this.get(n));
  711. return i;
  712. }, Stream.prototype.parseStringUTF = function(e, r) {
  713. for (var i = "", n = e; n < r; ) {
  714. var o = this.get(n++);
  715. i += o < 128 ? String.fromCharCode(o) : o > 191 && o < 224 ? String.fromCharCode((31 & o) << 6 | 63 & this.get(n++)) : String.fromCharCode((15 & o) << 12 | (63 & this.get(n++)) << 6 | 63 & this.get(n++));
  716. }
  717. return i;
  718. }, Stream.prototype.parseStringBMP = function(e, r) {
  719. for (var i, n, o = "", s = e; s < r; ) i = this.get(s++), n = this.get(s++), o += String.fromCharCode(i << 8 | n);
  720. return o;
  721. }, Stream.prototype.parseTime = function(e, r, i) {
  722. var n = this.parseStringISO(e, r), o = (i ? reTimeS : reTimeL).exec(n);
  723. return o ? (i && (o[1] = +o[1], o[1] += +o[1] < 70 ? 2e3 : 1900), n = o[1] + "-" + o[2] + "-" + o[3] + " " + o[4],
  724. o[5] && (n += ":" + o[5], o[6] && (n += ":" + o[6], o[7] && (n += "." + o[7]))),
  725. o[8] && (n += " UTC", "Z" != o[8] && (n += o[8], o[9] && (n += ":" + o[9]))), n) : "Unrecognized time: " + n;
  726. }, Stream.prototype.parseInteger = function(e, r) {
  727. for (var i, n = this.get(e), o = n > 127, s = o ? 255 : 0, a = ""; n == s && ++e < r; ) n = this.get(e);
  728. if (0 === (i = r - e)) return o ? -1 : 0;
  729. if (i > 4) {
  730. for (a = n, i <<= 3; 0 == (128 & (+a ^ s)); ) a = +a << 1, --i;
  731. a = "(" + i + " bit)\n";
  732. }
  733. o && (n -= 256);
  734. for (var u = new Int10(n), l = e + 1; l < r; ++l) u.mulAdd(256, this.get(l));
  735. return a + u.toString();
  736. }, Stream.prototype.parseBitString = function(e, r, i) {
  737. for (var n = this.get(e), o = "(" + ((r - e - 1 << 3) - n) + " bit)\n", s = "", a = e + 1; a < r; ++a) {
  738. for (var u = this.get(a), l = a == r - 1 ? n : 0, f = 7; f >= l; --f) s += u >> f & 1 ? "1" : "0";
  739. if (s.length > i) return o + stringCut(s, i);
  740. }
  741. return o + s;
  742. }, Stream.prototype.parseOctetString = function(e, r, i) {
  743. if (this.isASCII(e, r)) return stringCut(this.parseStringISO(e, r), i);
  744. var n = r - e, o = "(" + n + " byte)\n";
  745. n > (i /= 2) && (r = e + i);
  746. for (var s = e; s < r; ++s) o += this.hexByte(this.get(s));
  747. return n > i && (o += ellipsis), o;
  748. }, Stream.prototype.parseOID = function(e, r, i) {
  749. for (var n = "", o = new Int10, s = 0, a = e; a < r; ++a) {
  750. var u = this.get(a);
  751. if (o.mulAdd(128, 127 & u), s += 7, !(128 & u)) {
  752. if ("" === n) if ((o = o.simplify()) instanceof Int10) o.sub(80), n = "2." + o.toString(); else {
  753. var l = o < 80 ? o < 40 ? 0 : 1 : 2;
  754. n = l + "." + (o - 40 * l);
  755. } else n += "." + o.toString();
  756. if (n.length > i) return stringCut(n, i);
  757. o = new Int10, s = 0;
  758. }
  759. }
  760. return s > 0 && (n += ".incomplete"), n;
  761. }, Stream;
  762. }(), ASN1 = function() {
  763. function ASN1(e, r, i, n, o) {
  764. if (!(n instanceof ASN1Tag)) throw new Error("Invalid tag value.");
  765. this.stream = e, this.header = r, this.length = i, this.tag = n, this.sub = o;
  766. }
  767. return ASN1.prototype.typeName = function() {
  768. switch (this.tag.tagClass) {
  769. case 0:
  770. switch (this.tag.tagNumber) {
  771. case 0:
  772. return "EOC";
  773.  
  774. case 1:
  775. return "BOOLEAN";
  776.  
  777. case 2:
  778. return "INTEGER";
  779.  
  780. case 3:
  781. return "BIT_STRING";
  782.  
  783. case 4:
  784. return "OCTET_STRING";
  785.  
  786. case 5:
  787. return "NULL";
  788.  
  789. case 6:
  790. return "OBJECT_IDENTIFIER";
  791.  
  792. case 7:
  793. return "ObjectDescriptor";
  794.  
  795. case 8:
  796. return "EXTERNAL";
  797.  
  798. case 9:
  799. return "REAL";
  800.  
  801. case 10:
  802. return "ENUMERATED";
  803.  
  804. case 11:
  805. return "EMBEDDED_PDV";
  806.  
  807. case 12:
  808. return "UTF8String";
  809.  
  810. case 16:
  811. return "SEQUENCE";
  812.  
  813. case 17:
  814. return "SET";
  815.  
  816. case 18:
  817. return "NumericString";
  818.  
  819. case 19:
  820. return "PrintableString";
  821.  
  822. case 20:
  823. return "TeletexString";
  824.  
  825. case 21:
  826. return "VideotexString";
  827.  
  828. case 22:
  829. return "IA5String";
  830.  
  831. case 23:
  832. return "UTCTime";
  833.  
  834. case 24:
  835. return "GeneralizedTime";
  836.  
  837. case 25:
  838. return "GraphicString";
  839.  
  840. case 26:
  841. return "VisibleString";
  842.  
  843. case 27:
  844. return "GeneralString";
  845.  
  846. case 28:
  847. return "UniversalString";
  848.  
  849. case 30:
  850. return "BMPString";
  851. }
  852. return "Universal_" + this.tag.tagNumber.toString();
  853.  
  854. case 1:
  855. return "Application_" + this.tag.tagNumber.toString();
  856.  
  857. case 2:
  858. return "[" + this.tag.tagNumber.toString() + "]";
  859.  
  860. case 3:
  861. return "Private_" + this.tag.tagNumber.toString();
  862. }
  863. }, ASN1.prototype.content = function(e) {
  864. if (void 0 === this.tag) return null;
  865. void 0 === e && (e = 1 / 0);
  866. var r = this.posContent(), i = Math.abs(this.length);
  867. if (!this.tag.isUniversal()) return null !== this.sub ? "(" + this.sub.length + " elem)" : this.stream.parseOctetString(r, r + i, e);
  868. switch (this.tag.tagNumber) {
  869. case 1:
  870. return 0 === this.stream.get(r) ? "false" : "true";
  871.  
  872. case 2:
  873. return this.stream.parseInteger(r, r + i);
  874.  
  875. case 3:
  876. return this.sub ? "(" + this.sub.length + " elem)" : this.stream.parseBitString(r, r + i, e);
  877.  
  878. case 4:
  879. return this.sub ? "(" + this.sub.length + " elem)" : this.stream.parseOctetString(r, r + i, e);
  880.  
  881. case 6:
  882. return this.stream.parseOID(r, r + i, e);
  883.  
  884. case 16:
  885. case 17:
  886. return null !== this.sub ? "(" + this.sub.length + " elem)" : "(no elem)";
  887.  
  888. case 12:
  889. return stringCut(this.stream.parseStringUTF(r, r + i), e);
  890.  
  891. case 18:
  892. case 19:
  893. case 20:
  894. case 21:
  895. case 22:
  896. case 26:
  897. return stringCut(this.stream.parseStringISO(r, r + i), e);
  898.  
  899. case 30:
  900. return stringCut(this.stream.parseStringBMP(r, r + i), e);
  901.  
  902. case 23:
  903. case 24:
  904. return this.stream.parseTime(r, r + i, 23 == this.tag.tagNumber);
  905. }
  906. return null;
  907. }, ASN1.prototype.toString = function() {
  908. return this.typeName() + "@" + this.stream.pos + "[header:" + this.header + ",length:" + this.length + ",sub:" + (null === this.sub ? "null" : this.sub.length) + "]";
  909. }, ASN1.prototype.toPrettyString = function(e) {
  910. void 0 === e && (e = "");
  911. var r = e + this.typeName() + " @" + this.stream.pos;
  912. if (this.length >= 0 && (r += "+"), r += this.length, this.tag.tagConstructed ? r += " (constructed)" : !this.tag.isUniversal() || 3 != this.tag.tagNumber && 4 != this.tag.tagNumber || null === this.sub || (r += " (encapsulates)"),
  913. r += "\n", null !== this.sub) {
  914. e += " ";
  915. for (var i = 0, n = this.sub.length; i < n; ++i) r += this.sub[i].toPrettyString(e);
  916. }
  917. return r;
  918. }, ASN1.prototype.posStart = function() {
  919. return this.stream.pos;
  920. }, ASN1.prototype.posContent = function() {
  921. return this.stream.pos + this.header;
  922. }, ASN1.prototype.posEnd = function() {
  923. return this.stream.pos + this.header + Math.abs(this.length);
  924. }, ASN1.prototype.toHexString = function() {
  925. return this.stream.hexDump(this.posStart(), this.posEnd(), !0);
  926. }, ASN1.decodeLength = function(e) {
  927. var r = e.get(), i = 127 & r;
  928. if (i == r) return i;
  929. if (i > 6) throw new Error("Length over 48 bits not supported at position " + (e.pos - 1));
  930. if (0 === i) return null;
  931. r = 0;
  932. for (var n = 0; n < i; ++n) r = 256 * r + e.get();
  933. return r;
  934. }, ASN1.prototype.getHexStringValue = function() {
  935. var e = this.toHexString(), r = 2 * this.header, i = 2 * this.length;
  936. return e.substr(r, i);
  937. }, ASN1.decode = function(e) {
  938. var r;
  939. r = e instanceof Stream ? e : new Stream(e, 0);
  940. var i = new Stream(r), n = new ASN1Tag(r), o = ASN1.decodeLength(r), s = r.pos, a = s - i.pos, u = null, getSub = function() {
  941. var e = [];
  942. if (null !== o) {
  943. for (var i = s + o; r.pos < i; ) e[e.length] = ASN1.decode(r);
  944. if (r.pos != i) throw new Error("Content size is not correct for container starting at offset " + s);
  945. } else try {
  946. for (;;) {
  947. var n = ASN1.decode(r);
  948. if (n.tag.isEOC()) break;
  949. e[e.length] = n;
  950. }
  951. o = s - r.pos;
  952. } catch (e) {
  953. throw new Error("Exception while decoding undefined length content: " + e);
  954. }
  955. return e;
  956. };
  957. if (n.tagConstructed) u = getSub(); else if (n.isUniversal() && (3 == n.tagNumber || 4 == n.tagNumber)) try {
  958. if (3 == n.tagNumber && 0 != r.get()) throw new Error("BIT STRINGs with unused bits cannot encapsulate.");
  959. u = getSub();
  960. for (var l = 0; l < u.length; ++l) if (u[l].tag.isEOC()) throw new Error("EOC is not supposed to be actual content.");
  961. } catch (e) {
  962. u = null;
  963. }
  964. if (null === u) {
  965. if (null === o) throw new Error("We can't skip over an invalid tag with undefined length at offset " + s);
  966. r.pos = s + Math.abs(o);
  967. }
  968. return new ASN1(i, a, o, n, u);
  969. }, ASN1;
  970. }(), ASN1Tag = function() {
  971. function ASN1Tag(e) {
  972. var r = e.get();
  973. if (this.tagClass = r >> 6, this.tagConstructed = 0 != (32 & r), this.tagNumber = 31 & r,
  974. 31 == this.tagNumber) {
  975. var i = new Int10;
  976. do {
  977. r = e.get(), i.mulAdd(128, 127 & r);
  978. } while (128 & r);
  979. this.tagNumber = i.simplify();
  980. }
  981. }
  982. return ASN1Tag.prototype.isUniversal = function() {
  983. return 0 === this.tagClass;
  984. }, ASN1Tag.prototype.isEOC = function() {
  985. return 0 === this.tagClass && 0 === this.tagNumber;
  986. }, ASN1Tag;
  987. }(), Arcfour = function() {
  988. function Arcfour() {
  989. this.i = 0, this.j = 0, this.S = [];
  990. }
  991. return Arcfour.prototype.init = function(e) {
  992. var r, i, n;
  993. for (r = 0; r < 256; ++r) this.S[r] = r;
  994. for (i = 0, r = 0; r < 256; ++r) i = i + this.S[r] + e[r % e.length] & 255, n = this.S[r],
  995. this.S[r] = this.S[i], this.S[i] = n;
  996. this.i = 0, this.j = 0;
  997. }, Arcfour.prototype.next = function() {
  998. var e;
  999. return this.i = this.i + 1 & 255, this.j = this.j + this.S[this.i] & 255, e = this.S[this.i],
  1000. this.S[this.i] = this.S[this.j], this.S[this.j] = e, this.S[e + this.S[this.i] & 255];
  1001. }, Arcfour;
  1002. }();
  1003. function prng_newstate() {
  1004. return new Arcfour;
  1005. }
  1006. var rng_psize = 256, rng_state, rng_pool = null, rng_pptr;
  1007. if (null == rng_pool) {
  1008. rng_pool = [], rng_pptr = 0;
  1009. var t = void 0;
  1010. if ("undefined" != typeof window && window.crypto && window.crypto.getRandomValues) {
  1011. var z = new Uint32Array(256);
  1012. for (window.crypto.getRandomValues(z), t = 0; t < z.length; ++t) rng_pool[rng_pptr++] = 255 & z[t];
  1013. }
  1014. var count = 0, onMouseMoveListener_1 = function(e) {
  1015. if ((count = count || 0) >= 256 || rng_pptr >= rng_psize) window.removeEventListener ? window.removeEventListener("mousemove", onMouseMoveListener_1, !1) : window.detachEvent && window.detachEvent("onmousemove", onMouseMoveListener_1); else try {
  1016. var r = e.x + e.y;
  1017. rng_pool[rng_pptr++] = 255 & r, count += 1;
  1018. } catch (e) {}
  1019. };
  1020. "undefined" != typeof window && (window.addEventListener ? window.addEventListener("mousemove", onMouseMoveListener_1, !1) : window.attachEvent && window.attachEvent("onmousemove", onMouseMoveListener_1));
  1021. }
  1022. function rng_get_byte() {
  1023. if (null == rng_state) {
  1024. for (rng_state = prng_newstate(); rng_pptr < rng_psize; ) {
  1025. var e = Math.floor(65536 * Math.random());
  1026. rng_pool[rng_pptr++] = 255 & e;
  1027. }
  1028. for (rng_state.init(rng_pool), rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr) rng_pool[rng_pptr] = 0;
  1029. rng_pptr = 0;
  1030. }
  1031. return rng_state.next();
  1032. }
  1033. var SecureRandom = function() {
  1034. function SecureRandom() {}
  1035. return SecureRandom.prototype.nextBytes = function(e) {
  1036. for (var r = 0; r < e.length; ++r) e[r] = rng_get_byte();
  1037. }, SecureRandom;
  1038. }();
  1039. function pkcs1pad1(e, r) {
  1040. if (r < e.length + 22) return console.error("Message too long for RSA"), null;
  1041. for (var i = r - e.length - 6, n = "", o = 0; o < i; o += 2) n += "ff";
  1042. return parseBigInt("0001" + n + "00" + e, 16);
  1043. }
  1044. function pkcs1pad2(e, r) {
  1045. if (r < e.length + 11) return console.error("Message too long for RSA"), null;
  1046. for (var i = [], n = e.length - 1; n >= 0 && r > 0; ) {
  1047. var o = e.charCodeAt(n--);
  1048. o < 128 ? i[--r] = o : o > 127 && o < 2048 ? (i[--r] = 63 & o | 128, i[--r] = o >> 6 | 192) : (i[--r] = 63 & o | 128,
  1049. i[--r] = o >> 6 & 63 | 128, i[--r] = o >> 12 | 224);
  1050. }
  1051. i[--r] = 0;
  1052. for (var s = new SecureRandom, a = []; r > 2; ) {
  1053. for (a[0] = 0; 0 == a[0]; ) s.nextBytes(a);
  1054. i[--r] = a[0];
  1055. }
  1056. return i[--r] = 2, i[--r] = 0, new BigInteger(i);
  1057. }
  1058. var RSAKey = function() {
  1059. function RSAKey() {
  1060. this.n = null, this.e = 0, this.d = null, this.p = null, this.q = null, this.dmp1 = null,
  1061. this.dmq1 = null, this.coeff = null;
  1062. }
  1063. return RSAKey.prototype.doPublic = function(e) {
  1064. return e.modPowInt(this.e, this.n);
  1065. }, RSAKey.prototype.doPrivate = function(e) {
  1066. if (null == this.p || null == this.q) return e.modPow(this.d, this.n);
  1067. for (var r = e.mod(this.p).modPow(this.dmp1, this.p), i = e.mod(this.q).modPow(this.dmq1, this.q); r.compareTo(i) < 0; ) r = r.add(this.p);
  1068. return r.subtract(i).multiply(this.coeff).mod(this.p).multiply(this.q).add(i);
  1069. }, RSAKey.prototype.setPublic = function(e, r) {
  1070. null != e && null != r && e.length > 0 && r.length > 0 ? (this.n = parseBigInt(e, 16),
  1071. this.e = parseInt(r, 16)) : console.error("Invalid RSA public key");
  1072. }, RSAKey.prototype.encrypt = function(e) {
  1073. var r = this.n.bitLength() + 7 >> 3, i = pkcs1pad2(e, r);
  1074. if (null == i) return null;
  1075. var n = this.doPublic(i);
  1076. if (null == n) return null;
  1077. for (var o = n.toString(16), s = o.length, a = 0; a < 2 * r - s; a++) o = "0" + o;
  1078. return o;
  1079. }, RSAKey.prototype.setPrivate = function(e, r, i) {
  1080. null != e && null != r && e.length > 0 && r.length > 0 ? (this.n = parseBigInt(e, 16),
  1081. this.e = parseInt(r, 16), this.d = parseBigInt(i, 16)) : console.error("Invalid RSA private key");
  1082. }, RSAKey.prototype.setPrivateEx = function(e, r, i, n, o, s, a, u) {
  1083. null != e && null != r && e.length > 0 && r.length > 0 ? (this.n = parseBigInt(e, 16),
  1084. this.e = parseInt(r, 16), this.d = parseBigInt(i, 16), this.p = parseBigInt(n, 16),
  1085. this.q = parseBigInt(o, 16), this.dmp1 = parseBigInt(s, 16), this.dmq1 = parseBigInt(a, 16),
  1086. this.coeff = parseBigInt(u, 16)) : console.error("Invalid RSA private key");
  1087. }, RSAKey.prototype.generate = function(e, r) {
  1088. var i = new SecureRandom, n = e >> 1;
  1089. this.e = parseInt(r, 16);
  1090. for (var o = new BigInteger(r, 16); ;) {
  1091. for (;this.p = new BigInteger(e - n, 1, i), 0 != this.p.subtract(BigInteger.ONE).gcd(o).compareTo(BigInteger.ONE) || !this.p.isProbablePrime(10); ) ;
  1092. for (;this.q = new BigInteger(n, 1, i), 0 != this.q.subtract(BigInteger.ONE).gcd(o).compareTo(BigInteger.ONE) || !this.q.isProbablePrime(10); ) ;
  1093. if (this.p.compareTo(this.q) <= 0) {
  1094. var s = this.p;
  1095. this.p = this.q, this.q = s;
  1096. }
  1097. var a = this.p.subtract(BigInteger.ONE), u = this.q.subtract(BigInteger.ONE), l = a.multiply(u);
  1098. if (0 == l.gcd(o).compareTo(BigInteger.ONE)) {
  1099. this.n = this.p.multiply(this.q), this.d = o.modInverse(l), this.dmp1 = this.d.mod(a),
  1100. this.dmq1 = this.d.mod(u), this.coeff = this.q.modInverse(this.p);
  1101. break;
  1102. }
  1103. }
  1104. }, RSAKey.prototype.decrypt = function(e) {
  1105. var r = parseBigInt(e, 16), i = this.doPrivate(r);
  1106. return null == i ? null : pkcs1unpad2$1(i, this.n.bitLength() + 7 >> 3);
  1107. }, RSAKey.prototype.generateAsync = function(e, r, i) {
  1108. var n = new SecureRandom, o = e >> 1;
  1109. this.e = parseInt(r, 16);
  1110. var s = new BigInteger(r, 16), a = this, loop1 = function() {
  1111. var loop4 = function() {
  1112. if (a.p.compareTo(a.q) <= 0) {
  1113. var e = a.p;
  1114. a.p = a.q, a.q = e;
  1115. }
  1116. var r = a.p.subtract(BigInteger.ONE), n = a.q.subtract(BigInteger.ONE), o = r.multiply(n);
  1117. 0 == o.gcd(s).compareTo(BigInteger.ONE) ? (a.n = a.p.multiply(a.q), a.d = s.modInverse(o),
  1118. a.dmp1 = a.d.mod(r), a.dmq1 = a.d.mod(n), a.coeff = a.q.modInverse(a.p), setTimeout((function() {
  1119. i();
  1120. }), 0)) : setTimeout(loop1, 0);
  1121. }, loop3 = function() {
  1122. a.q = nbi(), a.q.fromNumberAsync(o, 1, n, (function() {
  1123. a.q.subtract(BigInteger.ONE).gcda(s, (function(e) {
  1124. 0 == e.compareTo(BigInteger.ONE) && a.q.isProbablePrime(10) ? setTimeout(loop4, 0) : setTimeout(loop3, 0);
  1125. }));
  1126. }));
  1127. }, loop2 = function() {
  1128. a.p = nbi(), a.p.fromNumberAsync(e - o, 1, n, (function() {
  1129. a.p.subtract(BigInteger.ONE).gcda(s, (function(e) {
  1130. 0 == e.compareTo(BigInteger.ONE) && a.p.isProbablePrime(10) ? setTimeout(loop3, 0) : setTimeout(loop2, 0);
  1131. }));
  1132. }));
  1133. };
  1134. setTimeout(loop2, 0);
  1135. };
  1136. setTimeout(loop1, 0);
  1137. }, RSAKey.prototype.sign = function(e, r, i) {
  1138. var n = pkcs1pad1(getDigestHeader(i) + r(e).toString(), this.n.bitLength() / 4);
  1139. if (null == n) return null;
  1140. var o = this.doPrivate(n);
  1141. if (null == o) return null;
  1142. var s = o.toString(16);
  1143. return 0 == (1 & s.length) ? s : "0" + s;
  1144. }, RSAKey.prototype.verify = function(e, r, i) {
  1145. var n = parseBigInt(r, 16), o = this.doPublic(n);
  1146. return null == o ? null : removeDigestHeader(o.toString(16).replace(/^1f+00/, "")) == i(e).toString();
  1147. }, RSAKey;
  1148. }();
  1149. function pkcs1unpad2$1(e, r) {
  1150. for (var i = e.toByteArray(), n = 0; n < i.length && 0 == i[n]; ) ++n;
  1151. if (i.length - n != r - 1 || 2 != i[n]) return null;
  1152. for (++n; 0 != i[n]; ) if (++n >= i.length) return null;
  1153. for (var o = ""; ++n < i.length; ) {
  1154. var s = 255 & i[n];
  1155. s < 128 ? o += String.fromCharCode(s) : s > 191 && s < 224 ? (o += String.fromCharCode((31 & s) << 6 | 63 & i[n + 1]),
  1156. ++n) : (o += String.fromCharCode((15 & s) << 12 | (63 & i[n + 1]) << 6 | 63 & i[n + 2]),
  1157. n += 2);
  1158. }
  1159. return o;
  1160. }
  1161. var DIGEST_HEADERS = {
  1162. md2: "3020300c06082a864886f70d020205000410",
  1163. md5: "3020300c06082a864886f70d020505000410",
  1164. sha1: "3021300906052b0e03021a05000414",
  1165. sha224: "302d300d06096086480165030402040500041c",
  1166. sha256: "3031300d060960864801650304020105000420",
  1167. sha384: "3041300d060960864801650304020205000430",
  1168. sha512: "3051300d060960864801650304020305000440",
  1169. ripemd160: "3021300906052b2403020105000414"
  1170. };
  1171. function getDigestHeader(e) {
  1172. return DIGEST_HEADERS[e] || "";
  1173. }
  1174. function removeDigestHeader(e) {
  1175. for (var r in DIGEST_HEADERS) if (DIGEST_HEADERS.hasOwnProperty(r)) {
  1176. var i = DIGEST_HEADERS[r], n = i.length;
  1177. if (e.substr(0, n) == i) return e.substr(n);
  1178. }
  1179. return e;
  1180. }
  1181. /*!
  1182. Copyright (c) 2011, Yahoo! Inc. All rights reserved.
  1183. Code licensed under the BSD License:
  1184. http://developer.yahoo.com/yui/license.html
  1185. version: 2.9.0
  1186. */ var YAHOO = {};
  1187. YAHOO.lang = {
  1188. extend: function(e, r, i) {
  1189. if (!r || !e) throw new Error("YAHOO.lang.extend failed, please check that all dependencies are included.");
  1190. var F = function() {};
  1191. if (F.prototype = r.prototype, e.prototype = new F, e.prototype.constructor = e,
  1192. e.superclass = r.prototype, r.prototype.constructor == Object.prototype.constructor && (r.prototype.constructor = r),
  1193. i) {
  1194. var n;
  1195. for (n in i) e.prototype[n] = i[n];
  1196. var _IEEnumFix = function() {}, o = [ "toString", "valueOf" ];
  1197. try {
  1198. /MSIE/.test(navigator.userAgent) && (_IEEnumFix = function(e, r) {
  1199. for (n = 0; n < o.length; n += 1) {
  1200. var i = o[n], s = r[i];
  1201. "function" == typeof s && s != Object.prototype[i] && (e[i] = s);
  1202. }
  1203. });
  1204. } catch (e) {}
  1205. _IEEnumFix(e.prototype, i);
  1206. }
  1207. }
  1208. };
  1209. /**
  1210. * @fileOverview
  1211. * @name asn1-1.0.js
  1212. * @author Kenji Urushima kenji.urushima@gmail.com
  1213. * @version asn1 1.0.13 (2017-Jun-02)
  1214. * @since jsrsasign 2.1
  1215. * @license <a href="https://kjur.github.io/jsrsasign/license/">MIT License</a>
  1216. */
  1217. var KJUR = {};
  1218. void 0 !== KJUR.asn1 && KJUR.asn1 || (KJUR.asn1 = {}), KJUR.asn1.ASN1Util = new function() {
  1219. this.integerToByteHex = function(e) {
  1220. var r = e.toString(16);
  1221. return r.length % 2 == 1 && (r = "0" + r), r;
  1222. }, this.bigIntToMinTwosComplementsHex = function(e) {
  1223. var r = e.toString(16);
  1224. if ("-" != r.substr(0, 1)) r.length % 2 == 1 ? r = "0" + r : r.match(/^[0-7]/) || (r = "00" + r); else {
  1225. var i = r.substr(1).length;
  1226. i % 2 == 1 ? i += 1 : r.match(/^[0-7]/) || (i += 2);
  1227. for (var n = "", o = 0; o < i; o++) n += "f";
  1228. r = new BigInteger(n, 16).xor(e).add(BigInteger.ONE).toString(16).replace(/^-/, "");
  1229. }
  1230. return r;
  1231. }, this.getPEMStringFromHex = function(e, r) {
  1232. return hextopem(e, r);
  1233. }, this.newObject = function(e) {
  1234. var r = KJUR.asn1, i = r.DERBoolean, n = r.DERInteger, o = r.DERBitString, s = r.DEROctetString, a = r.DERNull, u = r.DERObjectIdentifier, l = r.DEREnumerated, f = r.DERUTF8String, h = r.DERNumericString, p = r.DERPrintableString, c = r.DERTeletexString, d = r.DERIA5String, g = r.DERUTCTime, m = r.DERGeneralizedTime, y = r.DERSequence, v = r.DERSet, b = r.DERTaggedObject, S = r.ASN1Util.newObject, w = Object.keys(e);
  1235. if (1 != w.length) throw "key of param shall be only one.";
  1236. var R = w[0];
  1237. if (-1 == ":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":" + R + ":")) throw "undefined key: " + R;
  1238. if ("bool" == R) return new i(e[R]);
  1239. if ("int" == R) return new n(e[R]);
  1240. if ("bitstr" == R) return new o(e[R]);
  1241. if ("octstr" == R) return new s(e[R]);
  1242. if ("null" == R) return new a(e[R]);
  1243. if ("oid" == R) return new u(e[R]);
  1244. if ("enum" == R) return new l(e[R]);
  1245. if ("utf8str" == R) return new f(e[R]);
  1246. if ("numstr" == R) return new h(e[R]);
  1247. if ("prnstr" == R) return new p(e[R]);
  1248. if ("telstr" == R) return new c(e[R]);
  1249. if ("ia5str" == R) return new d(e[R]);
  1250. if ("utctime" == R) return new g(e[R]);
  1251. if ("gentime" == R) return new m(e[R]);
  1252. if ("seq" == R) {
  1253. for (var O = e[R], B = [], T = 0; T < O.length; T++) {
  1254. var E = S(O[T]);
  1255. B.push(E);
  1256. }
  1257. return new y({
  1258. array: B
  1259. });
  1260. }
  1261. if ("set" == R) {
  1262. for (O = e[R], B = [], T = 0; T < O.length; T++) {
  1263. E = S(O[T]);
  1264. B.push(E);
  1265. }
  1266. return new v({
  1267. array: B
  1268. });
  1269. }
  1270. if ("tag" == R) {
  1271. var A = e[R];
  1272. if ("[object Array]" === Object.prototype.toString.call(A) && 3 == A.length) {
  1273. var _ = S(A[2]);
  1274. return new b({
  1275. tag: A[0],
  1276. explicit: A[1],
  1277. obj: _
  1278. });
  1279. }
  1280. var I = {};
  1281. if (void 0 !== A.explicit && (I.explicit = A.explicit), void 0 !== A.tag && (I.tag = A.tag),
  1282. void 0 === A.obj) throw "obj shall be specified for 'tag'.";
  1283. return I.obj = S(A.obj), new b(I);
  1284. }
  1285. }, this.jsonToASN1HEX = function(e) {
  1286. return this.newObject(e).getEncodedHex();
  1287. };
  1288. }, KJUR.asn1.ASN1Util.oidHexToInt = function(e) {
  1289. for (var r = "", i = parseInt(e.substr(0, 2), 16), n = (r = Math.floor(i / 40) + "." + i % 40,
  1290. ""), o = 2; o < e.length; o += 2) {
  1291. var s = ("00000000" + parseInt(e.substr(o, 2), 16).toString(2)).slice(-8);
  1292. if (n += s.substr(1, 7), "0" == s.substr(0, 1)) r = r + "." + new BigInteger(n, 2).toString(10),
  1293. n = "";
  1294. }
  1295. return r;
  1296. }, KJUR.asn1.ASN1Util.oidIntToHex = function(e) {
  1297. var itox = function(e) {
  1298. var r = e.toString(16);
  1299. return 1 == r.length && (r = "0" + r), r;
  1300. }, roidtox = function(e) {
  1301. var r = "", i = new BigInteger(e, 10).toString(2), n = 7 - i.length % 7;
  1302. 7 == n && (n = 0);
  1303. for (var o = "", s = 0; s < n; s++) o += "0";
  1304. i = o + i;
  1305. for (s = 0; s < i.length - 1; s += 7) {
  1306. var a = i.substr(s, 7);
  1307. s != i.length - 7 && (a = "1" + a), r += itox(parseInt(a, 2));
  1308. }
  1309. return r;
  1310. };
  1311. if (!e.match(/^[0-9.]+$/)) throw "malformed oid string: " + e;
  1312. var r = "", i = e.split("."), n = 40 * parseInt(i[0]) + parseInt(i[1]);
  1313. r += itox(n), i.splice(0, 2);
  1314. for (var o = 0; o < i.length; o++) r += roidtox(i[o]);
  1315. return r;
  1316. }, KJUR.asn1.ASN1Object = function() {
  1317. this.getLengthHexFromValue = function() {
  1318. if (void 0 === this.hV || null == this.hV) throw "this.hV is null or undefined.";
  1319. if (this.hV.length % 2 == 1) throw "value hex must be even length: n=0,v=" + this.hV;
  1320. var e = this.hV.length / 2, r = e.toString(16);
  1321. if (r.length % 2 == 1 && (r = "0" + r), e < 128) return r;
  1322. var i = r.length / 2;
  1323. if (i > 15) throw "ASN.1 length too long to represent by 8x: n = " + e.toString(16);
  1324. return (128 + i).toString(16) + r;
  1325. }, this.getEncodedHex = function() {
  1326. return (null == this.hTLV || this.isModified) && (this.hV = this.getFreshValueHex(),
  1327. this.hL = this.getLengthHexFromValue(), this.hTLV = this.hT + this.hL + this.hV,
  1328. this.isModified = !1), this.hTLV;
  1329. }, this.getValueHex = function() {
  1330. return this.getEncodedHex(), this.hV;
  1331. }, this.getFreshValueHex = function() {
  1332. return "";
  1333. };
  1334. }, KJUR.asn1.DERAbstractString = function(e) {
  1335. KJUR.asn1.DERAbstractString.superclass.constructor.call(this), this.getString = function() {
  1336. return this.s;
  1337. }, this.setString = function(e) {
  1338. this.hTLV = null, this.isModified = !0, this.s = e, this.hV = stohex(this.s);
  1339. }, this.setStringHex = function(e) {
  1340. this.hTLV = null, this.isModified = !0, this.s = null, this.hV = e;
  1341. }, this.getFreshValueHex = function() {
  1342. return this.hV;
  1343. }, void 0 !== e && ("string" == typeof e ? this.setString(e) : void 0 !== e.str ? this.setString(e.str) : void 0 !== e.hex && this.setStringHex(e.hex));
  1344. }, YAHOO.lang.extend(KJUR.asn1.DERAbstractString, KJUR.asn1.ASN1Object), KJUR.asn1.DERAbstractTime = function(e) {
  1345. KJUR.asn1.DERAbstractTime.superclass.constructor.call(this), this.localDateToUTC = function(e) {
  1346. return utc = e.getTime() + 6e4 * e.getTimezoneOffset(), new Date(utc);
  1347. }, this.formatDate = function(e, r, i) {
  1348. var n = this.zeroPadding, o = this.localDateToUTC(e), s = String(o.getFullYear());
  1349. "utc" == r && (s = s.substr(2, 2));
  1350. var a = s + n(String(o.getMonth() + 1), 2) + n(String(o.getDate()), 2) + n(String(o.getHours()), 2) + n(String(o.getMinutes()), 2) + n(String(o.getSeconds()), 2);
  1351. if (!0 === i) {
  1352. var u = o.getMilliseconds();
  1353. if (0 != u) {
  1354. var l = n(String(u), 3);
  1355. a = a + "." + (l = l.replace(/[0]+$/, ""));
  1356. }
  1357. }
  1358. return a + "Z";
  1359. }, this.zeroPadding = function(e, r) {
  1360. return e.length >= r ? e : new Array(r - e.length + 1).join("0") + e;
  1361. }, this.getString = function() {
  1362. return this.s;
  1363. }, this.setString = function(e) {
  1364. this.hTLV = null, this.isModified = !0, this.s = e, this.hV = stohex(e);
  1365. }, this.setByDateValue = function(e, r, i, n, o, s) {
  1366. var a = new Date(Date.UTC(e, r - 1, i, n, o, s, 0));
  1367. this.setByDate(a);
  1368. }, this.getFreshValueHex = function() {
  1369. return this.hV;
  1370. };
  1371. }, YAHOO.lang.extend(KJUR.asn1.DERAbstractTime, KJUR.asn1.ASN1Object), KJUR.asn1.DERAbstractStructured = function(e) {
  1372. KJUR.asn1.DERAbstractString.superclass.constructor.call(this), this.setByASN1ObjectArray = function(e) {
  1373. this.hTLV = null, this.isModified = !0, this.asn1Array = e;
  1374. }, this.appendASN1Object = function(e) {
  1375. this.hTLV = null, this.isModified = !0, this.asn1Array.push(e);
  1376. }, this.asn1Array = new Array, void 0 !== e && void 0 !== e.array && (this.asn1Array = e.array);
  1377. }, YAHOO.lang.extend(KJUR.asn1.DERAbstractStructured, KJUR.asn1.ASN1Object), KJUR.asn1.DERBoolean = function() {
  1378. KJUR.asn1.DERBoolean.superclass.constructor.call(this), this.hT = "01", this.hTLV = "0101ff";
  1379. }, YAHOO.lang.extend(KJUR.asn1.DERBoolean, KJUR.asn1.ASN1Object), KJUR.asn1.DERInteger = function(e) {
  1380. KJUR.asn1.DERInteger.superclass.constructor.call(this), this.hT = "02", this.setByBigInteger = function(e) {
  1381. this.hTLV = null, this.isModified = !0, this.hV = KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e);
  1382. }, this.setByInteger = function(e) {
  1383. var r = new BigInteger(String(e), 10);
  1384. this.setByBigInteger(r);
  1385. }, this.setValueHex = function(e) {
  1386. this.hV = e;
  1387. }, this.getFreshValueHex = function() {
  1388. return this.hV;
  1389. }, void 0 !== e && (void 0 !== e.bigint ? this.setByBigInteger(e.bigint) : void 0 !== e.int ? this.setByInteger(e.int) : "number" == typeof e ? this.setByInteger(e) : void 0 !== e.hex && this.setValueHex(e.hex));
  1390. }, YAHOO.lang.extend(KJUR.asn1.DERInteger, KJUR.asn1.ASN1Object), KJUR.asn1.DERBitString = function(e) {
  1391. if (void 0 !== e && void 0 !== e.obj) {
  1392. var r = KJUR.asn1.ASN1Util.newObject(e.obj);
  1393. e.hex = "00" + r.getEncodedHex();
  1394. }
  1395. KJUR.asn1.DERBitString.superclass.constructor.call(this), this.hT = "03", this.setHexValueIncludingUnusedBits = function(e) {
  1396. this.hTLV = null, this.isModified = !0, this.hV = e;
  1397. }, this.setUnusedBitsAndHexValue = function(e, r) {
  1398. if (e < 0 || 7 < e) throw "unused bits shall be from 0 to 7: u = " + e;
  1399. var i = "0" + e;
  1400. this.hTLV = null, this.isModified = !0, this.hV = i + r;
  1401. }, this.setByBinaryString = function(e) {
  1402. var r = 8 - (e = e.replace(/0+$/, "")).length % 8;
  1403. 8 == r && (r = 0);
  1404. for (var i = 0; i <= r; i++) e += "0";
  1405. var n = "";
  1406. for (i = 0; i < e.length - 1; i += 8) {
  1407. var o = e.substr(i, 8), s = parseInt(o, 2).toString(16);
  1408. 1 == s.length && (s = "0" + s), n += s;
  1409. }
  1410. this.hTLV = null, this.isModified = !0, this.hV = "0" + r + n;
  1411. }, this.setByBooleanArray = function(e) {
  1412. for (var r = "", i = 0; i < e.length; i++) 1 == e[i] ? r += "1" : r += "0";
  1413. this.setByBinaryString(r);
  1414. }, this.newFalseArray = function(e) {
  1415. for (var r = new Array(e), i = 0; i < e; i++) r[i] = !1;
  1416. return r;
  1417. }, this.getFreshValueHex = function() {
  1418. return this.hV;
  1419. }, void 0 !== e && ("string" == typeof e && e.toLowerCase().match(/^[0-9a-f]+$/) ? this.setHexValueIncludingUnusedBits(e) : void 0 !== e.hex ? this.setHexValueIncludingUnusedBits(e.hex) : void 0 !== e.bin ? this.setByBinaryString(e.bin) : void 0 !== e.array && this.setByBooleanArray(e.array));
  1420. }, YAHOO.lang.extend(KJUR.asn1.DERBitString, KJUR.asn1.ASN1Object), KJUR.asn1.DEROctetString = function(e) {
  1421. if (void 0 !== e && void 0 !== e.obj) {
  1422. var r = KJUR.asn1.ASN1Util.newObject(e.obj);
  1423. e.hex = r.getEncodedHex();
  1424. }
  1425. KJUR.asn1.DEROctetString.superclass.constructor.call(this, e), this.hT = "04";
  1426. }, YAHOO.lang.extend(KJUR.asn1.DEROctetString, KJUR.asn1.DERAbstractString), KJUR.asn1.DERNull = function() {
  1427. KJUR.asn1.DERNull.superclass.constructor.call(this), this.hT = "05", this.hTLV = "0500";
  1428. }, YAHOO.lang.extend(KJUR.asn1.DERNull, KJUR.asn1.ASN1Object), KJUR.asn1.DERObjectIdentifier = function(e) {
  1429. var itox = function(e) {
  1430. var r = e.toString(16);
  1431. return 1 == r.length && (r = "0" + r), r;
  1432. }, roidtox = function(e) {
  1433. var r = "", i = new BigInteger(e, 10).toString(2), n = 7 - i.length % 7;
  1434. 7 == n && (n = 0);
  1435. for (var o = "", s = 0; s < n; s++) o += "0";
  1436. i = o + i;
  1437. for (s = 0; s < i.length - 1; s += 7) {
  1438. var a = i.substr(s, 7);
  1439. s != i.length - 7 && (a = "1" + a), r += itox(parseInt(a, 2));
  1440. }
  1441. return r;
  1442. };
  1443. KJUR.asn1.DERObjectIdentifier.superclass.constructor.call(this), this.hT = "06",
  1444. this.setValueHex = function(e) {
  1445. this.hTLV = null, this.isModified = !0, this.s = null, this.hV = e;
  1446. }, this.setValueOidString = function(e) {
  1447. if (!e.match(/^[0-9.]+$/)) throw "malformed oid string: " + e;
  1448. var r = "", i = e.split("."), n = 40 * parseInt(i[0]) + parseInt(i[1]);
  1449. r += itox(n), i.splice(0, 2);
  1450. for (var o = 0; o < i.length; o++) r += roidtox(i[o]);
  1451. this.hTLV = null, this.isModified = !0, this.s = null, this.hV = r;
  1452. }, this.setValueName = function(e) {
  1453. var r = KJUR.asn1.x509.OID.name2oid(e);
  1454. if ("" === r) throw "DERObjectIdentifier oidName undefined: " + e;
  1455. this.setValueOidString(r);
  1456. }, this.getFreshValueHex = function() {
  1457. return this.hV;
  1458. }, void 0 !== e && ("string" == typeof e ? e.match(/^[0-2].[0-9.]+$/) ? this.setValueOidString(e) : this.setValueName(e) : void 0 !== e.oid ? this.setValueOidString(e.oid) : void 0 !== e.hex ? this.setValueHex(e.hex) : void 0 !== e.name && this.setValueName(e.name));
  1459. }, YAHOO.lang.extend(KJUR.asn1.DERObjectIdentifier, KJUR.asn1.ASN1Object), KJUR.asn1.DEREnumerated = function(e) {
  1460. KJUR.asn1.DEREnumerated.superclass.constructor.call(this), this.hT = "0a", this.setByBigInteger = function(e) {
  1461. this.hTLV = null, this.isModified = !0, this.hV = KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e);
  1462. }, this.setByInteger = function(e) {
  1463. var r = new BigInteger(String(e), 10);
  1464. this.setByBigInteger(r);
  1465. }, this.setValueHex = function(e) {
  1466. this.hV = e;
  1467. }, this.getFreshValueHex = function() {
  1468. return this.hV;
  1469. }, void 0 !== e && (void 0 !== e.int ? this.setByInteger(e.int) : "number" == typeof e ? this.setByInteger(e) : void 0 !== e.hex && this.setValueHex(e.hex));
  1470. }, YAHOO.lang.extend(KJUR.asn1.DEREnumerated, KJUR.asn1.ASN1Object), KJUR.asn1.DERUTF8String = function(e) {
  1471. KJUR.asn1.DERUTF8String.superclass.constructor.call(this, e), this.hT = "0c";
  1472. }, YAHOO.lang.extend(KJUR.asn1.DERUTF8String, KJUR.asn1.DERAbstractString), KJUR.asn1.DERNumericString = function(e) {
  1473. KJUR.asn1.DERNumericString.superclass.constructor.call(this, e), this.hT = "12";
  1474. }, YAHOO.lang.extend(KJUR.asn1.DERNumericString, KJUR.asn1.DERAbstractString), KJUR.asn1.DERPrintableString = function(e) {
  1475. KJUR.asn1.DERPrintableString.superclass.constructor.call(this, e), this.hT = "13";
  1476. }, YAHOO.lang.extend(KJUR.asn1.DERPrintableString, KJUR.asn1.DERAbstractString),
  1477. KJUR.asn1.DERTeletexString = function(e) {
  1478. KJUR.asn1.DERTeletexString.superclass.constructor.call(this, e), this.hT = "14";
  1479. }, YAHOO.lang.extend(KJUR.asn1.DERTeletexString, KJUR.asn1.DERAbstractString), KJUR.asn1.DERIA5String = function(e) {
  1480. KJUR.asn1.DERIA5String.superclass.constructor.call(this, e), this.hT = "16";
  1481. }, YAHOO.lang.extend(KJUR.asn1.DERIA5String, KJUR.asn1.DERAbstractString), KJUR.asn1.DERUTCTime = function(e) {
  1482. KJUR.asn1.DERUTCTime.superclass.constructor.call(this, e), this.hT = "17", this.setByDate = function(e) {
  1483. this.hTLV = null, this.isModified = !0, this.date = e, this.s = this.formatDate(this.date, "utc"),
  1484. this.hV = stohex(this.s);
  1485. }, this.getFreshValueHex = function() {
  1486. return void 0 === this.date && void 0 === this.s && (this.date = new Date, this.s = this.formatDate(this.date, "utc"),
  1487. this.hV = stohex(this.s)), this.hV;
  1488. }, void 0 !== e && (void 0 !== e.str ? this.setString(e.str) : "string" == typeof e && e.match(/^[0-9]{12}Z$/) ? this.setString(e) : void 0 !== e.hex ? this.setStringHex(e.hex) : void 0 !== e.date && this.setByDate(e.date));
  1489. }, YAHOO.lang.extend(KJUR.asn1.DERUTCTime, KJUR.asn1.DERAbstractTime), KJUR.asn1.DERGeneralizedTime = function(e) {
  1490. KJUR.asn1.DERGeneralizedTime.superclass.constructor.call(this, e), this.hT = "18",
  1491. this.withMillis = !1, this.setByDate = function(e) {
  1492. this.hTLV = null, this.isModified = !0, this.date = e, this.s = this.formatDate(this.date, "gen", this.withMillis),
  1493. this.hV = stohex(this.s);
  1494. }, this.getFreshValueHex = function() {
  1495. return void 0 === this.date && void 0 === this.s && (this.date = new Date, this.s = this.formatDate(this.date, "gen", this.withMillis),
  1496. this.hV = stohex(this.s)), this.hV;
  1497. }, void 0 !== e && (void 0 !== e.str ? this.setString(e.str) : "string" == typeof e && e.match(/^[0-9]{14}Z$/) ? this.setString(e) : void 0 !== e.hex ? this.setStringHex(e.hex) : void 0 !== e.date && this.setByDate(e.date),
  1498. !0 === e.millis && (this.withMillis = !0));
  1499. }, YAHOO.lang.extend(KJUR.asn1.DERGeneralizedTime, KJUR.asn1.DERAbstractTime), KJUR.asn1.DERSequence = function(e) {
  1500. KJUR.asn1.DERSequence.superclass.constructor.call(this, e), this.hT = "30", this.getFreshValueHex = function() {
  1501. for (var e = "", r = 0; r < this.asn1Array.length; r++) {
  1502. e += this.asn1Array[r].getEncodedHex();
  1503. }
  1504. return this.hV = e, this.hV;
  1505. };
  1506. }, YAHOO.lang.extend(KJUR.asn1.DERSequence, KJUR.asn1.DERAbstractStructured), KJUR.asn1.DERSet = function(e) {
  1507. KJUR.asn1.DERSet.superclass.constructor.call(this, e), this.hT = "31", this.sortFlag = !0,
  1508. this.getFreshValueHex = function() {
  1509. for (var e = new Array, r = 0; r < this.asn1Array.length; r++) {
  1510. var i = this.asn1Array[r];
  1511. e.push(i.getEncodedHex());
  1512. }
  1513. return 1 == this.sortFlag && e.sort(), this.hV = e.join(""), this.hV;
  1514. }, void 0 !== e && void 0 !== e.sortflag && 0 == e.sortflag && (this.sortFlag = !1);
  1515. }, YAHOO.lang.extend(KJUR.asn1.DERSet, KJUR.asn1.DERAbstractStructured), KJUR.asn1.DERTaggedObject = function(e) {
  1516. KJUR.asn1.DERTaggedObject.superclass.constructor.call(this), this.hT = "a0", this.hV = "",
  1517. this.isExplicit = !0, this.asn1Object = null, this.setASN1Object = function(e, r, i) {
  1518. this.hT = r, this.isExplicit = e, this.asn1Object = i, this.isExplicit ? (this.hV = this.asn1Object.getEncodedHex(),
  1519. this.hTLV = null, this.isModified = !0) : (this.hV = null, this.hTLV = i.getEncodedHex(),
  1520. this.hTLV = this.hTLV.replace(/^../, r), this.isModified = !1);
  1521. }, this.getFreshValueHex = function() {
  1522. return this.hV;
  1523. }, void 0 !== e && (void 0 !== e.tag && (this.hT = e.tag), void 0 !== e.explicit && (this.isExplicit = e.explicit),
  1524. void 0 !== e.obj && (this.asn1Object = e.obj, this.setASN1Object(this.isExplicit, this.hT, this.asn1Object)));
  1525. }, YAHOO.lang.extend(KJUR.asn1.DERTaggedObject, KJUR.asn1.ASN1Object);
  1526. var __extends = (extendStatics = function(e, r) {
  1527. return extendStatics = Object.setPrototypeOf || {
  1528. __proto__: []
  1529. } instanceof Array && function(e, r) {
  1530. e.__proto__ = r;
  1531. } || function(e, r) {
  1532. for (var i in r) Object.prototype.hasOwnProperty.call(r, i) && (e[i] = r[i]);
  1533. }, extendStatics(e, r);
  1534. }, function(e, r) {
  1535. if ("function" != typeof r && null !== r) throw new TypeError("Class extends value " + String(r) + " is not a constructor or null");
  1536. function __() {
  1537. this.constructor = e;
  1538. }
  1539. extendStatics(e, r), e.prototype = null === r ? Object.create(r) : (__.prototype = r.prototype,
  1540. new __);
  1541. }), extendStatics, JSEncryptRSAKey = function(e) {
  1542. function JSEncryptRSAKey(r) {
  1543. var i = e.call(this) || this;
  1544. return r && ("string" == typeof r ? i.parseKey(r) : (JSEncryptRSAKey.hasPrivateKeyProperty(r) || JSEncryptRSAKey.hasPublicKeyProperty(r)) && i.parsePropertiesFrom(r)),
  1545. i;
  1546. }
  1547. return __extends(JSEncryptRSAKey, e), JSEncryptRSAKey.prototype.parseKey = function(e) {
  1548. try {
  1549. var r = 0, i = 0, n = /^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/.test(e) ? Hex.decode(e) : Base64.unarmor(e), o = ASN1.decode(n);
  1550. if (3 === o.sub.length && (o = o.sub[2].sub[0]), 9 === o.sub.length) {
  1551. r = o.sub[1].getHexStringValue(), this.n = parseBigInt(r, 16), i = o.sub[2].getHexStringValue(),
  1552. this.e = parseInt(i, 16);
  1553. var s = o.sub[3].getHexStringValue();
  1554. this.d = parseBigInt(s, 16);
  1555. var a = o.sub[4].getHexStringValue();
  1556. this.p = parseBigInt(a, 16);
  1557. var u = o.sub[5].getHexStringValue();
  1558. this.q = parseBigInt(u, 16);
  1559. var l = o.sub[6].getHexStringValue();
  1560. this.dmp1 = parseBigInt(l, 16);
  1561. var f = o.sub[7].getHexStringValue();
  1562. this.dmq1 = parseBigInt(f, 16);
  1563. var h = o.sub[8].getHexStringValue();
  1564. this.coeff = parseBigInt(h, 16);
  1565. } else {
  1566. if (2 !== o.sub.length) return !1;
  1567. if (o.sub[0].sub) {
  1568. var p = o.sub[1].sub[0];
  1569. r = p.sub[0].getHexStringValue(), this.n = parseBigInt(r, 16), i = p.sub[1].getHexStringValue(),
  1570. this.e = parseInt(i, 16);
  1571. } else r = o.sub[0].getHexStringValue(), this.n = parseBigInt(r, 16), i = o.sub[1].getHexStringValue(),
  1572. this.e = parseInt(i, 16);
  1573. }
  1574. return !0;
  1575. } catch (e) {
  1576. return !1;
  1577. }
  1578. }, JSEncryptRSAKey.prototype.getPrivateBaseKey = function() {
  1579. var e = {
  1580. array: [ new KJUR.asn1.DERInteger({
  1581. int: 0
  1582. }), new KJUR.asn1.DERInteger({
  1583. bigint: this.n
  1584. }), new KJUR.asn1.DERInteger({
  1585. int: this.e
  1586. }), new KJUR.asn1.DERInteger({
  1587. bigint: this.d
  1588. }), new KJUR.asn1.DERInteger({
  1589. bigint: this.p
  1590. }), new KJUR.asn1.DERInteger({
  1591. bigint: this.q
  1592. }), new KJUR.asn1.DERInteger({
  1593. bigint: this.dmp1
  1594. }), new KJUR.asn1.DERInteger({
  1595. bigint: this.dmq1
  1596. }), new KJUR.asn1.DERInteger({
  1597. bigint: this.coeff
  1598. }) ]
  1599. };
  1600. return new KJUR.asn1.DERSequence(e).getEncodedHex();
  1601. }, JSEncryptRSAKey.prototype.getPrivateBaseKeyB64 = function() {
  1602. return hex2b64(this.getPrivateBaseKey());
  1603. }, JSEncryptRSAKey.prototype.getPublicBaseKey = function() {
  1604. var e = new KJUR.asn1.DERSequence({
  1605. array: [ new KJUR.asn1.DERObjectIdentifier({
  1606. oid: "1.2.840.113549.1.1.1"
  1607. }), new KJUR.asn1.DERNull ]
  1608. }), r = new KJUR.asn1.DERSequence({
  1609. array: [ new KJUR.asn1.DERInteger({
  1610. bigint: this.n
  1611. }), new KJUR.asn1.DERInteger({
  1612. int: this.e
  1613. }) ]
  1614. }), i = new KJUR.asn1.DERBitString({
  1615. hex: "00" + r.getEncodedHex()
  1616. });
  1617. return new KJUR.asn1.DERSequence({
  1618. array: [ e, i ]
  1619. }).getEncodedHex();
  1620. }, JSEncryptRSAKey.prototype.getPublicBaseKeyB64 = function() {
  1621. return hex2b64(this.getPublicBaseKey());
  1622. }, JSEncryptRSAKey.wordwrap = function(e, r) {
  1623. if (!e) return e;
  1624. var i = "(.{1," + (r = r || 64) + "})( +|$\n?)|(.{1," + r + "})";
  1625. return e.match(RegExp(i, "g")).join("\n");
  1626. }, JSEncryptRSAKey.prototype.getPrivateKey = function() {
  1627. var e = "-----BEGIN RSA PRIVATE KEY-----\n";
  1628. return e += JSEncryptRSAKey.wordwrap(this.getPrivateBaseKeyB64()) + "\n", e += "-----END RSA PRIVATE KEY-----";
  1629. }, JSEncryptRSAKey.prototype.getPublicKey = function() {
  1630. var e = "-----BEGIN PUBLIC KEY-----\n";
  1631. return e += JSEncryptRSAKey.wordwrap(this.getPublicBaseKeyB64()) + "\n", e += "-----END PUBLIC KEY-----";
  1632. }, JSEncryptRSAKey.hasPublicKeyProperty = function(e) {
  1633. return (e = e || {}).hasOwnProperty("n") && e.hasOwnProperty("e");
  1634. }, JSEncryptRSAKey.hasPrivateKeyProperty = function(e) {
  1635. return (e = e || {}).hasOwnProperty("n") && e.hasOwnProperty("e") && e.hasOwnProperty("d") && e.hasOwnProperty("p") && e.hasOwnProperty("q") && e.hasOwnProperty("dmp1") && e.hasOwnProperty("dmq1") && e.hasOwnProperty("coeff");
  1636. }, JSEncryptRSAKey.prototype.parsePropertiesFrom = function(e) {
  1637. this.n = e.n, this.e = e.e, e.hasOwnProperty("d") && (this.d = e.d, this.p = e.p,
  1638. this.q = e.q, this.dmp1 = e.dmp1, this.dmq1 = e.dmq1, this.coeff = e.coeff);
  1639. }, JSEncryptRSAKey;
  1640. }(RSAKey), commonjsGlobal = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {}, src = {
  1641. exports: {}
  1642. }, indexLight = {
  1643. exports: {}
  1644. }, indexMinimal = {}, minimal = {}, aspromise, hasRequiredAspromise;
  1645. function requireAspromise() {
  1646. if (hasRequiredAspromise) return aspromise;
  1647. return hasRequiredAspromise = 1, aspromise = function asPromise(e, r) {
  1648. var i = new Array(arguments.length - 1), n = 0, o = 2, s = !0;
  1649. for (;o < arguments.length; ) i[n++] = arguments[o++];
  1650. return new Promise((function executor(o, a) {
  1651. i[n] = function callback(e) {
  1652. if (s) if (s = !1, e) a(e); else {
  1653. for (var r = new Array(arguments.length - 1), i = 0; i < r.length; ) r[i++] = arguments[i];
  1654. o.apply(null, r);
  1655. }
  1656. };
  1657. try {
  1658. e.apply(r || null, i);
  1659. } catch (e) {
  1660. s && (s = !1, a(e));
  1661. }
  1662. }));
  1663. }, aspromise;
  1664. }
  1665. var base64$1 = {}, hasRequiredBase64, eventemitter, hasRequiredEventemitter, float, hasRequiredFloat, inquire_1, hasRequiredInquire;
  1666. function requireBase64() {
  1667. return hasRequiredBase64 || (hasRequiredBase64 = 1, function(e) {
  1668. var r = e;
  1669. r.length = function length(e) {
  1670. var r = e.length;
  1671. if (!r) return 0;
  1672. for (var i = 0; --r % 4 > 1 && "=" === e.charAt(r); ) ++i;
  1673. return Math.ceil(3 * e.length) / 4 - i;
  1674. };
  1675. for (var i = new Array(64), n = new Array(123), o = 0; o < 64; ) n[i[o] = o < 26 ? o + 65 : o < 52 ? o + 71 : o < 62 ? o - 4 : o - 59 | 43] = o++;
  1676. r.encode = function encode(e, r, n) {
  1677. for (var o, s = null, a = [], u = 0, l = 0; r < n; ) {
  1678. var f = e[r++];
  1679. switch (l) {
  1680. case 0:
  1681. a[u++] = i[f >> 2], o = (3 & f) << 4, l = 1;
  1682. break;
  1683.  
  1684. case 1:
  1685. a[u++] = i[o | f >> 4], o = (15 & f) << 2, l = 2;
  1686. break;
  1687.  
  1688. case 2:
  1689. a[u++] = i[o | f >> 6], a[u++] = i[63 & f], l = 0;
  1690. }
  1691. u > 8191 && ((s || (s = [])).push(String.fromCharCode.apply(String, a)), u = 0);
  1692. }
  1693. return l && (a[u++] = i[o], a[u++] = 61, 1 === l && (a[u++] = 61)), s ? (u && s.push(String.fromCharCode.apply(String, a.slice(0, u))),
  1694. s.join("")) : String.fromCharCode.apply(String, a.slice(0, u));
  1695. };
  1696. var s = "invalid encoding";
  1697. r.decode = function decode(e, r, i) {
  1698. for (var o, a = i, u = 0, l = 0; l < e.length; ) {
  1699. var f = e.charCodeAt(l++);
  1700. if (61 === f && u > 1) break;
  1701. if (void 0 === (f = n[f])) throw Error(s);
  1702. switch (u) {
  1703. case 0:
  1704. o = f, u = 1;
  1705. break;
  1706.  
  1707. case 1:
  1708. r[i++] = o << 2 | (48 & f) >> 4, o = f, u = 2;
  1709. break;
  1710.  
  1711. case 2:
  1712. r[i++] = (15 & o) << 4 | (60 & f) >> 2, o = f, u = 3;
  1713. break;
  1714.  
  1715. case 3:
  1716. r[i++] = (3 & o) << 6 | f, u = 0;
  1717. }
  1718. }
  1719. if (1 === u) throw Error(s);
  1720. return i - a;
  1721. }, r.test = function test(e) {
  1722. return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e);
  1723. };
  1724. }(base64$1)), base64$1;
  1725. }
  1726. function requireEventemitter() {
  1727. if (hasRequiredEventemitter) return eventemitter;
  1728. function EventEmitter() {
  1729. this._listeners = {};
  1730. }
  1731. return hasRequiredEventemitter = 1, eventemitter = EventEmitter, EventEmitter.prototype.on = function on(e, r, i) {
  1732. return (this._listeners[e] || (this._listeners[e] = [])).push({
  1733. fn: r,
  1734. ctx: i || this
  1735. }), this;
  1736. }, EventEmitter.prototype.off = function off(e, r) {
  1737. if (void 0 === e) this._listeners = {}; else if (void 0 === r) this._listeners[e] = []; else for (var i = this._listeners[e], n = 0; n < i.length; ) i[n].fn === r ? i.splice(n, 1) : ++n;
  1738. return this;
  1739. }, EventEmitter.prototype.emit = function emit(e) {
  1740. var r = this._listeners[e];
  1741. if (r) {
  1742. for (var i = [], n = 1; n < arguments.length; ) i.push(arguments[n++]);
  1743. for (n = 0; n < r.length; ) r[n].fn.apply(r[n++].ctx, i);
  1744. }
  1745. return this;
  1746. }, eventemitter;
  1747. }
  1748. function requireFloat() {
  1749. if (hasRequiredFloat) return float;
  1750. function factory(e) {
  1751. return "undefined" != typeof Float32Array ? function() {
  1752. var r = new Float32Array([ -0 ]), i = new Uint8Array(r.buffer), n = 128 === i[3];
  1753. function writeFloat_f32_cpy(e, n, o) {
  1754. r[0] = e, n[o] = i[0], n[o + 1] = i[1], n[o + 2] = i[2], n[o + 3] = i[3];
  1755. }
  1756. function writeFloat_f32_rev(e, n, o) {
  1757. r[0] = e, n[o] = i[3], n[o + 1] = i[2], n[o + 2] = i[1], n[o + 3] = i[0];
  1758. }
  1759. function readFloat_f32_cpy(e, n) {
  1760. return i[0] = e[n], i[1] = e[n + 1], i[2] = e[n + 2], i[3] = e[n + 3], r[0];
  1761. }
  1762. function readFloat_f32_rev(e, n) {
  1763. return i[3] = e[n], i[2] = e[n + 1], i[1] = e[n + 2], i[0] = e[n + 3], r[0];
  1764. }
  1765. e.writeFloatLE = n ? writeFloat_f32_cpy : writeFloat_f32_rev, e.writeFloatBE = n ? writeFloat_f32_rev : writeFloat_f32_cpy,
  1766. e.readFloatLE = n ? readFloat_f32_cpy : readFloat_f32_rev, e.readFloatBE = n ? readFloat_f32_rev : readFloat_f32_cpy;
  1767. }() : function() {
  1768. function writeFloat_ieee754(e, r, i, n) {
  1769. var o = r < 0 ? 1 : 0;
  1770. if (o && (r = -r), 0 === r) e(1 / r > 0 ? 0 : 2147483648, i, n); else if (isNaN(r)) e(2143289344, i, n); else if (r > 34028234663852886e22) e((o << 31 | 2139095040) >>> 0, i, n); else if (r < 11754943508222875e-54) e((o << 31 | Math.round(r / 1401298464324817e-60)) >>> 0, i, n); else {
  1771. var s = Math.floor(Math.log(r) / Math.LN2);
  1772. e((o << 31 | s + 127 << 23 | 8388607 & Math.round(r * Math.pow(2, -s) * 8388608)) >>> 0, i, n);
  1773. }
  1774. }
  1775. function readFloat_ieee754(e, r, i) {
  1776. var n = e(r, i), o = 2 * (n >> 31) + 1, s = n >>> 23 & 255, a = 8388607 & n;
  1777. return 255 === s ? a ? NaN : o * (1 / 0) : 0 === s ? 1401298464324817e-60 * o * a : o * Math.pow(2, s - 150) * (a + 8388608);
  1778. }
  1779. e.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE), e.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE),
  1780. e.readFloatLE = readFloat_ieee754.bind(null, readUintLE), e.readFloatBE = readFloat_ieee754.bind(null, readUintBE);
  1781. }(), "undefined" != typeof Float64Array ? function() {
  1782. var r = new Float64Array([ -0 ]), i = new Uint8Array(r.buffer), n = 128 === i[7];
  1783. function writeDouble_f64_cpy(e, n, o) {
  1784. r[0] = e, n[o] = i[0], n[o + 1] = i[1], n[o + 2] = i[2], n[o + 3] = i[3], n[o + 4] = i[4],
  1785. n[o + 5] = i[5], n[o + 6] = i[6], n[o + 7] = i[7];
  1786. }
  1787. function writeDouble_f64_rev(e, n, o) {
  1788. r[0] = e, n[o] = i[7], n[o + 1] = i[6], n[o + 2] = i[5], n[o + 3] = i[4], n[o + 4] = i[3],
  1789. n[o + 5] = i[2], n[o + 6] = i[1], n[o + 7] = i[0];
  1790. }
  1791. function readDouble_f64_cpy(e, n) {
  1792. return i[0] = e[n], i[1] = e[n + 1], i[2] = e[n + 2], i[3] = e[n + 3], i[4] = e[n + 4],
  1793. i[5] = e[n + 5], i[6] = e[n + 6], i[7] = e[n + 7], r[0];
  1794. }
  1795. function readDouble_f64_rev(e, n) {
  1796. return i[7] = e[n], i[6] = e[n + 1], i[5] = e[n + 2], i[4] = e[n + 3], i[3] = e[n + 4],
  1797. i[2] = e[n + 5], i[1] = e[n + 6], i[0] = e[n + 7], r[0];
  1798. }
  1799. e.writeDoubleLE = n ? writeDouble_f64_cpy : writeDouble_f64_rev, e.writeDoubleBE = n ? writeDouble_f64_rev : writeDouble_f64_cpy,
  1800. e.readDoubleLE = n ? readDouble_f64_cpy : readDouble_f64_rev, e.readDoubleBE = n ? readDouble_f64_rev : readDouble_f64_cpy;
  1801. }() : function() {
  1802. function writeDouble_ieee754(e, r, i, n, o, s) {
  1803. var a = n < 0 ? 1 : 0;
  1804. if (a && (n = -n), 0 === n) e(0, o, s + r), e(1 / n > 0 ? 0 : 2147483648, o, s + i); else if (isNaN(n)) e(0, o, s + r),
  1805. e(2146959360, o, s + i); else if (n > 17976931348623157e292) e(0, o, s + r), e((a << 31 | 2146435072) >>> 0, o, s + i); else {
  1806. var u;
  1807. if (n < 22250738585072014e-324) e((u = n / 5e-324) >>> 0, o, s + r), e((a << 31 | u / 4294967296) >>> 0, o, s + i); else {
  1808. var l = Math.floor(Math.log(n) / Math.LN2);
  1809. 1024 === l && (l = 1023), e(4503599627370496 * (u = n * Math.pow(2, -l)) >>> 0, o, s + r),
  1810. e((a << 31 | l + 1023 << 20 | 1048576 * u & 1048575) >>> 0, o, s + i);
  1811. }
  1812. }
  1813. }
  1814. function readDouble_ieee754(e, r, i, n, o) {
  1815. var s = e(n, o + r), a = e(n, o + i), u = 2 * (a >> 31) + 1, l = a >>> 20 & 2047, f = 4294967296 * (1048575 & a) + s;
  1816. return 2047 === l ? f ? NaN : u * (1 / 0) : 0 === l ? 5e-324 * u * f : u * Math.pow(2, l - 1075) * (f + 4503599627370496);
  1817. }
  1818. e.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4), e.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0),
  1819. e.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4), e.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0);
  1820. }(), e;
  1821. }
  1822. function writeUintLE(e, r, i) {
  1823. r[i] = 255 & e, r[i + 1] = e >>> 8 & 255, r[i + 2] = e >>> 16 & 255, r[i + 3] = e >>> 24;
  1824. }
  1825. function writeUintBE(e, r, i) {
  1826. r[i] = e >>> 24, r[i + 1] = e >>> 16 & 255, r[i + 2] = e >>> 8 & 255, r[i + 3] = 255 & e;
  1827. }
  1828. function readUintLE(e, r) {
  1829. return (e[r] | e[r + 1] << 8 | e[r + 2] << 16 | e[r + 3] << 24) >>> 0;
  1830. }
  1831. function readUintBE(e, r) {
  1832. return (e[r] << 24 | e[r + 1] << 16 | e[r + 2] << 8 | e[r + 3]) >>> 0;
  1833. }
  1834. return hasRequiredFloat = 1, float = factory(factory);
  1835. }
  1836. function requireInquire() {
  1837. if (hasRequiredInquire) return inquire_1;
  1838. function inquire(moduleName) {
  1839. try {
  1840. var mod = eval("quire".replace(/^/, "re"))(moduleName);
  1841. if (mod && (mod.length || Object.keys(mod).length)) return mod;
  1842. } catch (e) {}
  1843. return null;
  1844. }
  1845. return hasRequiredInquire = 1, inquire_1 = inquire, inquire_1;
  1846. }
  1847. var utf8$2 = {}, hasRequiredUtf8, pool_1, hasRequiredPool, longbits, hasRequiredLongbits, hasRequiredMinimal;
  1848. function requireUtf8() {
  1849. return hasRequiredUtf8 || (hasRequiredUtf8 = 1, function(e) {
  1850. var r = e;
  1851. r.length = function utf8_length(e) {
  1852. for (var r = 0, i = 0, n = 0; n < e.length; ++n) (i = e.charCodeAt(n)) < 128 ? r += 1 : i < 2048 ? r += 2 : 55296 == (64512 & i) && 56320 == (64512 & e.charCodeAt(n + 1)) ? (++n,
  1853. r += 4) : r += 3;
  1854. return r;
  1855. }, r.read = function utf8_read(e, r, i) {
  1856. if (i - r < 1) return "";
  1857. for (var n, o = null, s = [], a = 0; r < i; ) (n = e[r++]) < 128 ? s[a++] = n : n > 191 && n < 224 ? s[a++] = (31 & n) << 6 | 63 & e[r++] : n > 239 && n < 365 ? (n = ((7 & n) << 18 | (63 & e[r++]) << 12 | (63 & e[r++]) << 6 | 63 & e[r++]) - 65536,
  1858. s[a++] = 55296 + (n >> 10), s[a++] = 56320 + (1023 & n)) : s[a++] = (15 & n) << 12 | (63 & e[r++]) << 6 | 63 & e[r++],
  1859. a > 8191 && ((o || (o = [])).push(String.fromCharCode.apply(String, s)), a = 0);
  1860. return o ? (a && o.push(String.fromCharCode.apply(String, s.slice(0, a))), o.join("")) : String.fromCharCode.apply(String, s.slice(0, a));
  1861. }, r.write = function utf8_write(e, r, i) {
  1862. for (var n, o, s = i, a = 0; a < e.length; ++a) (n = e.charCodeAt(a)) < 128 ? r[i++] = n : n < 2048 ? (r[i++] = n >> 6 | 192,
  1863. r[i++] = 63 & n | 128) : 55296 == (64512 & n) && 56320 == (64512 & (o = e.charCodeAt(a + 1))) ? (n = 65536 + ((1023 & n) << 10) + (1023 & o),
  1864. ++a, r[i++] = n >> 18 | 240, r[i++] = n >> 12 & 63 | 128, r[i++] = n >> 6 & 63 | 128,
  1865. r[i++] = 63 & n | 128) : (r[i++] = n >> 12 | 224, r[i++] = n >> 6 & 63 | 128, r[i++] = 63 & n | 128);
  1866. return i - s;
  1867. };
  1868. }(utf8$2)), utf8$2;
  1869. }
  1870. function requirePool() {
  1871. if (hasRequiredPool) return pool_1;
  1872. return hasRequiredPool = 1, pool_1 = function pool(e, r, i) {
  1873. var n = i || 8192, o = n >>> 1, s = null, a = n;
  1874. return function pool_alloc(i) {
  1875. if (i < 1 || i > o) return e(i);
  1876. a + i > n && (s = e(n), a = 0);
  1877. var u = r.call(s, a, a += i);
  1878. return 7 & a && (a = 1 + (7 | a)), u;
  1879. };
  1880. };
  1881. }
  1882. function requireLongbits() {
  1883. if (hasRequiredLongbits) return longbits;
  1884. hasRequiredLongbits = 1, longbits = LongBits;
  1885. var e = requireMinimal();
  1886. function LongBits(e, r) {
  1887. this.lo = e >>> 0, this.hi = r >>> 0;
  1888. }
  1889. var r = LongBits.zero = new LongBits(0, 0);
  1890. r.toNumber = function() {
  1891. return 0;
  1892. }, r.zzEncode = r.zzDecode = function() {
  1893. return this;
  1894. }, r.length = function() {
  1895. return 1;
  1896. };
  1897. var i = LongBits.zeroHash = "\0\0\0\0\0\0\0\0";
  1898. LongBits.fromNumber = function fromNumber(e) {
  1899. if (0 === e) return r;
  1900. var i = e < 0;
  1901. i && (e = -e);
  1902. var n = e >>> 0, o = (e - n) / 4294967296 >>> 0;
  1903. return i && (o = ~o >>> 0, n = ~n >>> 0, ++n > 4294967295 && (n = 0, ++o > 4294967295 && (o = 0))),
  1904. new LongBits(n, o);
  1905. }, LongBits.from = function from(i) {
  1906. if ("number" == typeof i) return LongBits.fromNumber(i);
  1907. if (e.isString(i)) {
  1908. if (!e.Long) return LongBits.fromNumber(parseInt(i, 10));
  1909. i = e.Long.fromString(i);
  1910. }
  1911. return i.low || i.high ? new LongBits(i.low >>> 0, i.high >>> 0) : r;
  1912. }, LongBits.prototype.toNumber = function toNumber(e) {
  1913. if (!e && this.hi >>> 31) {
  1914. var r = 1 + ~this.lo >>> 0, i = ~this.hi >>> 0;
  1915. return r || (i = i + 1 >>> 0), -(r + 4294967296 * i);
  1916. }
  1917. return this.lo + 4294967296 * this.hi;
  1918. }, LongBits.prototype.toLong = function toLong(r) {
  1919. return e.Long ? new e.Long(0 | this.lo, 0 | this.hi, Boolean(r)) : {
  1920. low: 0 | this.lo,
  1921. high: 0 | this.hi,
  1922. unsigned: Boolean(r)
  1923. };
  1924. };
  1925. var n = String.prototype.charCodeAt;
  1926. return LongBits.fromHash = function fromHash(e) {
  1927. return e === i ? r : new LongBits((n.call(e, 0) | n.call(e, 1) << 8 | n.call(e, 2) << 16 | n.call(e, 3) << 24) >>> 0, (n.call(e, 4) | n.call(e, 5) << 8 | n.call(e, 6) << 16 | n.call(e, 7) << 24) >>> 0);
  1928. }, LongBits.prototype.toHash = function toHash() {
  1929. return String.fromCharCode(255 & this.lo, this.lo >>> 8 & 255, this.lo >>> 16 & 255, this.lo >>> 24, 255 & this.hi, this.hi >>> 8 & 255, this.hi >>> 16 & 255, this.hi >>> 24);
  1930. }, LongBits.prototype.zzEncode = function zzEncode() {
  1931. var e = this.hi >> 31;
  1932. return this.hi = ((this.hi << 1 | this.lo >>> 31) ^ e) >>> 0, this.lo = (this.lo << 1 ^ e) >>> 0,
  1933. this;
  1934. }, LongBits.prototype.zzDecode = function zzDecode() {
  1935. var e = -(1 & this.lo);
  1936. return this.lo = ((this.lo >>> 1 | this.hi << 31) ^ e) >>> 0, this.hi = (this.hi >>> 1 ^ e) >>> 0,
  1937. this;
  1938. }, LongBits.prototype.length = function length() {
  1939. var e = this.lo, r = (this.lo >>> 28 | this.hi << 4) >>> 0, i = this.hi >>> 24;
  1940. return 0 === i ? 0 === r ? e < 16384 ? e < 128 ? 1 : 2 : e < 2097152 ? 3 : 4 : r < 16384 ? r < 128 ? 5 : 6 : r < 2097152 ? 7 : 8 : i < 128 ? 9 : 10;
  1941. }, longbits;
  1942. }
  1943. function requireMinimal() {
  1944. return hasRequiredMinimal || (hasRequiredMinimal = 1, function(e) {
  1945. var r = e;
  1946. function merge(e, r, i) {
  1947. for (var n = Object.keys(r), o = 0; o < n.length; ++o) void 0 !== e[n[o]] && i || (e[n[o]] = r[n[o]]);
  1948. return e;
  1949. }
  1950. function newError(e) {
  1951. function CustomError(e, r) {
  1952. if (!(this instanceof CustomError)) return new CustomError(e, r);
  1953. Object.defineProperty(this, "message", {
  1954. get: function() {
  1955. return e;
  1956. }
  1957. }), Error.captureStackTrace ? Error.captureStackTrace(this, CustomError) : Object.defineProperty(this, "stack", {
  1958. value: (new Error).stack || ""
  1959. }), r && merge(this, r);
  1960. }
  1961. return CustomError.prototype = Object.create(Error.prototype, {
  1962. constructor: {
  1963. value: CustomError,
  1964. writable: !0,
  1965. enumerable: !1,
  1966. configurable: !0
  1967. },
  1968. name: {
  1969. get: function get() {
  1970. return e;
  1971. },
  1972. set: void 0,
  1973. enumerable: !1,
  1974. configurable: !0
  1975. },
  1976. toString: {
  1977. value: function value() {
  1978. return this.name + ": " + this.message;
  1979. },
  1980. writable: !0,
  1981. enumerable: !1,
  1982. configurable: !0
  1983. }
  1984. }), CustomError;
  1985. }
  1986. r.asPromise = requireAspromise(), r.base64 = requireBase64(), r.EventEmitter = requireEventemitter(),
  1987. r.float = requireFloat(), r.inquire = requireInquire(), r.utf8 = requireUtf8(),
  1988. r.pool = requirePool(), r.LongBits = requireLongbits(), r.isNode = Boolean(void 0 !== commonjsGlobal && commonjsGlobal && commonjsGlobal.process && commonjsGlobal.process.versions && commonjsGlobal.process.versions.node),
  1989. r.global = r.isNode && commonjsGlobal || "undefined" != typeof window && window || "undefined" != typeof self && self || commonjsGlobal,
  1990. r.emptyArray = Object.freeze ? Object.freeze([]) : [], r.emptyObject = Object.freeze ? Object.freeze({}) : {},
  1991. r.isInteger = Number.isInteger || function isInteger(e) {
  1992. return "number" == typeof e && isFinite(e) && Math.floor(e) === e;
  1993. }, r.isString = function isString(e) {
  1994. return "string" == typeof e || e instanceof String;
  1995. }, r.isObject = function isObject(e) {
  1996. return e && "object" == typeof e;
  1997. }, r.isset = r.isSet = function isSet(e, r) {
  1998. var i = e[r];
  1999. return !(null == i || !e.hasOwnProperty(r)) && ("object" != typeof i || (Array.isArray(i) ? i.length : Object.keys(i).length) > 0);
  2000. }, r.Buffer = function() {
  2001. try {
  2002. var e = r.inquire("buffer").Buffer;
  2003. return e.prototype.utf8Write ? e : null;
  2004. } catch (e) {
  2005. return null;
  2006. }
  2007. }(), r._Buffer_from = null, r._Buffer_allocUnsafe = null, r.newBuffer = function newBuffer(e) {
  2008. return "number" == typeof e ? r.Buffer ? r._Buffer_allocUnsafe(e) : new r.Array(e) : r.Buffer ? r._Buffer_from(e) : "undefined" == typeof Uint8Array ? e : new Uint8Array(e);
  2009. }, r.Array = "undefined" != typeof Uint8Array ? Uint8Array : Array, r.Long = r.global.dcodeIO && r.global.dcodeIO.Long || r.global.Long || r.inquire("long"),
  2010. r.key2Re = /^true|false|0|1$/, r.key32Re = /^-?(?:0|[1-9][0-9]*)$/, r.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,
  2011. r.longToHash = function longToHash(e) {
  2012. return e ? r.LongBits.from(e).toHash() : r.LongBits.zeroHash;
  2013. }, r.longFromHash = function longFromHash(e, i) {
  2014. var n = r.LongBits.fromHash(e);
  2015. return r.Long ? r.Long.fromBits(n.lo, n.hi, i) : n.toNumber(Boolean(i));
  2016. }, r.merge = merge, r.lcFirst = function lcFirst(e) {
  2017. return e.charAt(0).toLowerCase() + e.substring(1);
  2018. }, r.newError = newError, r.ProtocolError = newError("ProtocolError"), r.oneOfGetter = function getOneOf(e) {
  2019. for (var r = {}, i = 0; i < e.length; ++i) r[e[i]] = 1;
  2020. return function() {
  2021. for (var e = Object.keys(this), i = e.length - 1; i > -1; --i) if (1 === r[e[i]] && void 0 !== this[e[i]] && null !== this[e[i]]) return e[i];
  2022. };
  2023. }, r.oneOfSetter = function setOneOf(e) {
  2024. return function(r) {
  2025. for (var i = 0; i < e.length; ++i) e[i] !== r && delete this[e[i]];
  2026. };
  2027. }, r.toJSONOptions = {
  2028. longs: String,
  2029. enums: String,
  2030. bytes: String,
  2031. json: !0
  2032. }, r._configure = function() {
  2033. var e = r.Buffer;
  2034. e ? (r._Buffer_from = e.from !== Uint8Array.from && e.from || function Buffer_from(r, i) {
  2035. return new e(r, i);
  2036. }, r._Buffer_allocUnsafe = e.allocUnsafe || function Buffer_allocUnsafe(r) {
  2037. return new e(r);
  2038. }) : r._Buffer_from = r._Buffer_allocUnsafe = null;
  2039. };
  2040. }(minimal)), minimal;
  2041. }
  2042. var writer = Writer$1, util$7 = requireMinimal(), BufferWriter$1, LongBits$1 = util$7.LongBits, base64 = util$7.base64, utf8$1 = util$7.utf8;
  2043. function Op(e, r, i) {
  2044. this.fn = e, this.len = r, this.next = void 0, this.val = i;
  2045. }
  2046. function noop() {}
  2047. function State(e) {
  2048. this.head = e.head, this.tail = e.tail, this.len = e.len, this.next = e.states;
  2049. }
  2050. function Writer$1() {
  2051. this.len = 0, this.head = new Op(noop, 0, 0), this.tail = this.head, this.states = null;
  2052. }
  2053. var create$1 = function create() {
  2054. return util$7.Buffer ? function create_buffer_setup() {
  2055. return (Writer$1.create = function create_buffer() {
  2056. return new BufferWriter$1;
  2057. })();
  2058. } : function create_array() {
  2059. return new Writer$1;
  2060. };
  2061. };
  2062. function writeByte(e, r, i) {
  2063. r[i] = 255 & e;
  2064. }
  2065. function writeVarint32(e, r, i) {
  2066. for (;e > 127; ) r[i++] = 127 & e | 128, e >>>= 7;
  2067. r[i] = e;
  2068. }
  2069. function VarintOp(e, r) {
  2070. this.len = e, this.next = void 0, this.val = r;
  2071. }
  2072. function writeVarint64(e, r, i) {
  2073. for (;e.hi; ) r[i++] = 127 & e.lo | 128, e.lo = (e.lo >>> 7 | e.hi << 25) >>> 0,
  2074. e.hi >>>= 7;
  2075. for (;e.lo > 127; ) r[i++] = 127 & e.lo | 128, e.lo = e.lo >>> 7;
  2076. r[i++] = e.lo;
  2077. }
  2078. function writeFixed32(e, r, i) {
  2079. r[i] = 255 & e, r[i + 1] = e >>> 8 & 255, r[i + 2] = e >>> 16 & 255, r[i + 3] = e >>> 24;
  2080. }
  2081. Writer$1.create = create$1(), Writer$1.alloc = function alloc(e) {
  2082. return new util$7.Array(e);
  2083. }, util$7.Array !== Array && (Writer$1.alloc = util$7.pool(Writer$1.alloc, util$7.Array.prototype.subarray)),
  2084. Writer$1.prototype._push = function push(e, r, i) {
  2085. return this.tail = this.tail.next = new Op(e, r, i), this.len += r, this;
  2086. }, VarintOp.prototype = Object.create(Op.prototype), VarintOp.prototype.fn = writeVarint32,
  2087. Writer$1.prototype.uint32 = function write_uint32(e) {
  2088. return this.len += (this.tail = this.tail.next = new VarintOp((e >>>= 0) < 128 ? 1 : e < 16384 ? 2 : e < 2097152 ? 3 : e < 268435456 ? 4 : 5, e)).len,
  2089. this;
  2090. }, Writer$1.prototype.int32 = function write_int32(e) {
  2091. return e < 0 ? this._push(writeVarint64, 10, LongBits$1.fromNumber(e)) : this.uint32(e);
  2092. }, Writer$1.prototype.sint32 = function write_sint32(e) {
  2093. return this.uint32((e << 1 ^ e >> 31) >>> 0);
  2094. }, Writer$1.prototype.uint64 = function write_uint64(e) {
  2095. var r = LongBits$1.from(e);
  2096. return this._push(writeVarint64, r.length(), r);
  2097. }, Writer$1.prototype.int64 = Writer$1.prototype.uint64, Writer$1.prototype.sint64 = function write_sint64(e) {
  2098. var r = LongBits$1.from(e).zzEncode();
  2099. return this._push(writeVarint64, r.length(), r);
  2100. }, Writer$1.prototype.bool = function write_bool(e) {
  2101. return this._push(writeByte, 1, e ? 1 : 0);
  2102. }, Writer$1.prototype.fixed32 = function write_fixed32(e) {
  2103. return this._push(writeFixed32, 4, e >>> 0);
  2104. }, Writer$1.prototype.sfixed32 = Writer$1.prototype.fixed32, Writer$1.prototype.fixed64 = function write_fixed64(e) {
  2105. var r = LongBits$1.from(e);
  2106. return this._push(writeFixed32, 4, r.lo)._push(writeFixed32, 4, r.hi);
  2107. }, Writer$1.prototype.sfixed64 = Writer$1.prototype.fixed64, Writer$1.prototype.float = function write_float(e) {
  2108. return this._push(util$7.float.writeFloatLE, 4, e);
  2109. }, Writer$1.prototype.double = function write_double(e) {
  2110. return this._push(util$7.float.writeDoubleLE, 8, e);
  2111. };
  2112. var writeBytes = util$7.Array.prototype.set ? function writeBytes_set(e, r, i) {
  2113. r.set(e, i);
  2114. } : function writeBytes_for(e, r, i) {
  2115. for (var n = 0; n < e.length; ++n) r[i + n] = e[n];
  2116. };
  2117. Writer$1.prototype.bytes = function write_bytes(e) {
  2118. var r = e.length >>> 0;
  2119. if (!r) return this._push(writeByte, 1, 0);
  2120. if (util$7.isString(e)) {
  2121. var i = Writer$1.alloc(r = base64.length(e));
  2122. base64.decode(e, i, 0), e = i;
  2123. }
  2124. return this.uint32(r)._push(writeBytes, r, e);
  2125. }, Writer$1.prototype.string = function write_string(e) {
  2126. var r = utf8$1.length(e);
  2127. return r ? this.uint32(r)._push(utf8$1.write, r, e) : this._push(writeByte, 1, 0);
  2128. }, Writer$1.prototype.fork = function fork() {
  2129. return this.states = new State(this), this.head = this.tail = new Op(noop, 0, 0),
  2130. this.len = 0, this;
  2131. }, Writer$1.prototype.reset = function reset() {
  2132. return this.states ? (this.head = this.states.head, this.tail = this.states.tail,
  2133. this.len = this.states.len, this.states = this.states.next) : (this.head = this.tail = new Op(noop, 0, 0),
  2134. this.len = 0), this;
  2135. }, Writer$1.prototype.ldelim = function ldelim() {
  2136. var e = this.head, r = this.tail, i = this.len;
  2137. return this.reset().uint32(i), i && (this.tail.next = e.next, this.tail = r, this.len += i),
  2138. this;
  2139. }, Writer$1.prototype.finish = function finish() {
  2140. for (var e = this.head.next, r = this.constructor.alloc(this.len), i = 0; e; ) e.fn(e.val, r, i),
  2141. i += e.len, e = e.next;
  2142. return r;
  2143. }, Writer$1._configure = function(e) {
  2144. BufferWriter$1 = e, Writer$1.create = create$1(), BufferWriter$1._configure();
  2145. };
  2146. var writer_buffer = BufferWriter, Writer = writer;
  2147. (BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter;
  2148. var util$6 = requireMinimal();
  2149. function BufferWriter() {
  2150. Writer.call(this);
  2151. }
  2152. function writeStringBuffer(e, r, i) {
  2153. e.length < 40 ? util$6.utf8.write(e, r, i) : r.utf8Write ? r.utf8Write(e, i) : r.write(e, i);
  2154. }
  2155. BufferWriter._configure = function() {
  2156. BufferWriter.alloc = util$6._Buffer_allocUnsafe, BufferWriter.writeBytesBuffer = util$6.Buffer && util$6.Buffer.prototype instanceof Uint8Array && "set" === util$6.Buffer.prototype.set.name ? function writeBytesBuffer_set(e, r, i) {
  2157. r.set(e, i);
  2158. } : function writeBytesBuffer_copy(e, r, i) {
  2159. if (e.copy) e.copy(r, i, 0, e.length); else for (var n = 0; n < e.length; ) r[i++] = e[n++];
  2160. };
  2161. }, BufferWriter.prototype.bytes = function write_bytes_buffer(e) {
  2162. util$6.isString(e) && (e = util$6._Buffer_from(e, "base64"));
  2163. var r = e.length >>> 0;
  2164. return this.uint32(r), r && this._push(BufferWriter.writeBytesBuffer, r, e), this;
  2165. }, BufferWriter.prototype.string = function write_string_buffer(e) {
  2166. var r = util$6.Buffer.byteLength(e);
  2167. return this.uint32(r), r && this._push(writeStringBuffer, r, e), this;
  2168. }, BufferWriter._configure();
  2169. var reader = Reader$1, util$5 = requireMinimal(), BufferReader$1, LongBits = util$5.LongBits, utf8 = util$5.utf8;
  2170. function indexOutOfRange(e, r) {
  2171. return RangeError("index out of range: " + e.pos + " + " + (r || 1) + " > " + e.len);
  2172. }
  2173. function Reader$1(e) {
  2174. this.buf = e, this.pos = 0, this.len = e.length;
  2175. }
  2176. var create_array = "undefined" != typeof Uint8Array ? function create_typed_array(e) {
  2177. if (e instanceof Uint8Array || Array.isArray(e)) return new Reader$1(e);
  2178. throw Error("illegal buffer");
  2179. } : function create_array(e) {
  2180. if (Array.isArray(e)) return new Reader$1(e);
  2181. throw Error("illegal buffer");
  2182. }, create = function create() {
  2183. return util$5.Buffer ? function create_buffer_setup(e) {
  2184. return (Reader$1.create = function create_buffer(e) {
  2185. return util$5.Buffer.isBuffer(e) ? new BufferReader$1(e) : create_array(e);
  2186. })(e);
  2187. } : create_array;
  2188. };
  2189. function readLongVarint() {
  2190. var e = new LongBits(0, 0), r = 0;
  2191. if (!(this.len - this.pos > 4)) {
  2192. for (;r < 3; ++r) {
  2193. if (this.pos >= this.len) throw indexOutOfRange(this);
  2194. if (e.lo = (e.lo | (127 & this.buf[this.pos]) << 7 * r) >>> 0, this.buf[this.pos++] < 128) return e;
  2195. }
  2196. return e.lo = (e.lo | (127 & this.buf[this.pos++]) << 7 * r) >>> 0, e;
  2197. }
  2198. for (;r < 4; ++r) if (e.lo = (e.lo | (127 & this.buf[this.pos]) << 7 * r) >>> 0,
  2199. this.buf[this.pos++] < 128) return e;
  2200. if (e.lo = (e.lo | (127 & this.buf[this.pos]) << 28) >>> 0, e.hi = (e.hi | (127 & this.buf[this.pos]) >> 4) >>> 0,
  2201. this.buf[this.pos++] < 128) return e;
  2202. if (r = 0, this.len - this.pos > 4) {
  2203. for (;r < 5; ++r) if (e.hi = (e.hi | (127 & this.buf[this.pos]) << 7 * r + 3) >>> 0,
  2204. this.buf[this.pos++] < 128) return e;
  2205. } else for (;r < 5; ++r) {
  2206. if (this.pos >= this.len) throw indexOutOfRange(this);
  2207. if (e.hi = (e.hi | (127 & this.buf[this.pos]) << 7 * r + 3) >>> 0, this.buf[this.pos++] < 128) return e;
  2208. }
  2209. throw Error("invalid varint encoding");
  2210. }
  2211. function readFixed32_end(e, r) {
  2212. return (e[r - 4] | e[r - 3] << 8 | e[r - 2] << 16 | e[r - 1] << 24) >>> 0;
  2213. }
  2214. function readFixed64() {
  2215. if (this.pos + 8 > this.len) throw indexOutOfRange(this, 8);
  2216. return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4));
  2217. }
  2218. Reader$1.create = create(), Reader$1.prototype._slice = util$5.Array.prototype.subarray || util$5.Array.prototype.slice,
  2219. Reader$1.prototype.uint32 = function read_uint32_setup() {
  2220. var e = 4294967295;
  2221. return function read_uint32() {
  2222. if (e = (127 & this.buf[this.pos]) >>> 0, this.buf[this.pos++] < 128) return e;
  2223. if (e = (e | (127 & this.buf[this.pos]) << 7) >>> 0, this.buf[this.pos++] < 128) return e;
  2224. if (e = (e | (127 & this.buf[this.pos]) << 14) >>> 0, this.buf[this.pos++] < 128) return e;
  2225. if (e = (e | (127 & this.buf[this.pos]) << 21) >>> 0, this.buf[this.pos++] < 128) return e;
  2226. if (e = (e | (15 & this.buf[this.pos]) << 28) >>> 0, this.buf[this.pos++] < 128) return e;
  2227. if ((this.pos += 5) > this.len) throw this.pos = this.len, indexOutOfRange(this, 10);
  2228. return e;
  2229. };
  2230. }(), Reader$1.prototype.int32 = function read_int32() {
  2231. return 0 | this.uint32();
  2232. }, Reader$1.prototype.sint32 = function read_sint32() {
  2233. var e = this.uint32();
  2234. return e >>> 1 ^ -(1 & e) | 0;
  2235. }, Reader$1.prototype.bool = function read_bool() {
  2236. return 0 !== this.uint32();
  2237. }, Reader$1.prototype.fixed32 = function read_fixed32() {
  2238. if (this.pos + 4 > this.len) throw indexOutOfRange(this, 4);
  2239. return readFixed32_end(this.buf, this.pos += 4);
  2240. }, Reader$1.prototype.sfixed32 = function read_sfixed32() {
  2241. if (this.pos + 4 > this.len) throw indexOutOfRange(this, 4);
  2242. return 0 | readFixed32_end(this.buf, this.pos += 4);
  2243. }, Reader$1.prototype.float = function read_float() {
  2244. if (this.pos + 4 > this.len) throw indexOutOfRange(this, 4);
  2245. var e = util$5.float.readFloatLE(this.buf, this.pos);
  2246. return this.pos += 4, e;
  2247. }, Reader$1.prototype.double = function read_double() {
  2248. if (this.pos + 8 > this.len) throw indexOutOfRange(this, 4);
  2249. var e = util$5.float.readDoubleLE(this.buf, this.pos);
  2250. return this.pos += 8, e;
  2251. }, Reader$1.prototype.bytes = function read_bytes() {
  2252. var e = this.uint32(), r = this.pos, i = this.pos + e;
  2253. if (i > this.len) throw indexOutOfRange(this, e);
  2254. return this.pos += e, Array.isArray(this.buf) ? this.buf.slice(r, i) : r === i ? new this.buf.constructor(0) : this._slice.call(this.buf, r, i);
  2255. }, Reader$1.prototype.string = function read_string() {
  2256. var e = this.bytes();
  2257. return utf8.read(e, 0, e.length);
  2258. }, Reader$1.prototype.skip = function skip(e) {
  2259. if ("number" == typeof e) {
  2260. if (this.pos + e > this.len) throw indexOutOfRange(this, e);
  2261. this.pos += e;
  2262. } else do {
  2263. if (this.pos >= this.len) throw indexOutOfRange(this);
  2264. } while (128 & this.buf[this.pos++]);
  2265. return this;
  2266. }, Reader$1.prototype.skipType = function(e) {
  2267. switch (e) {
  2268. case 0:
  2269. this.skip();
  2270. break;
  2271.  
  2272. case 1:
  2273. this.skip(8);
  2274. break;
  2275.  
  2276. case 2:
  2277. this.skip(this.uint32());
  2278. break;
  2279.  
  2280. case 3:
  2281. for (;4 != (e = 7 & this.uint32()); ) this.skipType(e);
  2282. break;
  2283.  
  2284. case 5:
  2285. this.skip(4);
  2286. break;
  2287.  
  2288. default:
  2289. throw Error("invalid wire type " + e + " at offset " + this.pos);
  2290. }
  2291. return this;
  2292. }, Reader$1._configure = function(e) {
  2293. BufferReader$1 = e, Reader$1.create = create(), BufferReader$1._configure();
  2294. var r = util$5.Long ? "toLong" : "toNumber";
  2295. util$5.merge(Reader$1.prototype, {
  2296. int64: function read_int64() {
  2297. return readLongVarint.call(this)[r](!1);
  2298. },
  2299. uint64: function read_uint64() {
  2300. return readLongVarint.call(this)[r](!0);
  2301. },
  2302. sint64: function read_sint64() {
  2303. return readLongVarint.call(this).zzDecode()[r](!1);
  2304. },
  2305. fixed64: function read_fixed64() {
  2306. return readFixed64.call(this)[r](!0);
  2307. },
  2308. sfixed64: function read_sfixed64() {
  2309. return readFixed64.call(this)[r](!1);
  2310. }
  2311. });
  2312. };
  2313. var reader_buffer = BufferReader, Reader = reader;
  2314. (BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader;
  2315. var util$4 = requireMinimal();
  2316. function BufferReader(e) {
  2317. Reader.call(this, e);
  2318. }
  2319. BufferReader._configure = function() {
  2320. util$4.Buffer && (BufferReader.prototype._slice = util$4.Buffer.prototype.slice);
  2321. }, BufferReader.prototype.string = function read_string_buffer() {
  2322. var e = this.uint32();
  2323. return this.buf.utf8Slice ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + e, this.len)) : this.buf.toString("utf-8", this.pos, this.pos = Math.min(this.pos + e, this.len));
  2324. }, BufferReader._configure();
  2325. var rpc = {}, service$1 = Service$1, util$3 = requireMinimal();
  2326. function Service$1(e, r, i) {
  2327. if ("function" != typeof e) throw TypeError("rpcImpl must be a function");
  2328. util$3.EventEmitter.call(this), this.rpcImpl = e, this.requestDelimited = Boolean(r),
  2329. this.responseDelimited = Boolean(i);
  2330. }
  2331. (Service$1.prototype = Object.create(util$3.EventEmitter.prototype)).constructor = Service$1,
  2332. Service$1.prototype.rpcCall = function rpcCall(e, r, i, n, o) {
  2333. if (!n) throw TypeError("request must be specified");
  2334. var s = this;
  2335. if (!o) return util$3.asPromise(rpcCall, s, e, r, i, n);
  2336. if (s.rpcImpl) try {
  2337. return s.rpcImpl(e, r[s.requestDelimited ? "encodeDelimited" : "encode"](n).finish(), (function rpcCallback(r, n) {
  2338. if (r) return s.emit("error", r, e), o(r);
  2339. if (null !== n) {
  2340. if (!(n instanceof i)) try {
  2341. n = i[s.responseDelimited ? "decodeDelimited" : "decode"](n);
  2342. } catch (r) {
  2343. return s.emit("error", r, e), o(r);
  2344. }
  2345. return s.emit("data", n, e), o(null, n);
  2346. }
  2347. s.end(!0);
  2348. }));
  2349. } catch (r) {
  2350. return s.emit("error", r, e), void setTimeout((function() {
  2351. o(r);
  2352. }), 0);
  2353. } else setTimeout((function() {
  2354. o(Error("already ended"));
  2355. }), 0);
  2356. }, Service$1.prototype.end = function end(e) {
  2357. return this.rpcImpl && (e || this.rpcImpl(null, null, null), this.rpcImpl = null,
  2358. this.emit("end").off()), this;
  2359. }, function(e) {
  2360. e.Service = service$1;
  2361. }(rpc);
  2362. var roots = {};
  2363. !function(e) {
  2364. var r = e;
  2365. function configure() {
  2366. r.util._configure(), r.Writer._configure(r.BufferWriter), r.Reader._configure(r.BufferReader);
  2367. }
  2368. r.build = "minimal", r.Writer = writer, r.BufferWriter = writer_buffer, r.Reader = reader,
  2369. r.BufferReader = reader_buffer, r.util = requireMinimal(), r.rpc = rpc, r.roots = roots,
  2370. r.configure = configure, configure();
  2371. }(indexMinimal);
  2372. var util$2 = {
  2373. exports: {}
  2374. }, codegen_1 = codegen;
  2375. function codegen(e, r) {
  2376. "string" == typeof e && (r = e, e = void 0);
  2377. var i = [];
  2378. function Codegen(e) {
  2379. if ("string" != typeof e) {
  2380. var r = toString();
  2381. if (codegen.verbose && console.log("codegen: " + r), r = "return " + r, e) {
  2382. for (var n = Object.keys(e), o = new Array(n.length + 1), s = new Array(n.length), a = 0; a < n.length; ) o[a] = n[a],
  2383. s[a] = e[n[a++]];
  2384. return o[a] = r, Function.apply(null, o).apply(null, s);
  2385. }
  2386. return Function(r)();
  2387. }
  2388. for (var u = new Array(arguments.length - 1), l = 0; l < u.length; ) u[l] = arguments[++l];
  2389. if (l = 0, e = e.replace(/%([%dfijs])/g, (function replace(e, r) {
  2390. var i = u[l++];
  2391. switch (r) {
  2392. case "d":
  2393. case "f":
  2394. return String(Number(i));
  2395.  
  2396. case "i":
  2397. return String(Math.floor(i));
  2398.  
  2399. case "j":
  2400. return JSON.stringify(i);
  2401.  
  2402. case "s":
  2403. return String(i);
  2404. }
  2405. return "%";
  2406. })), l !== u.length) throw Error("parameter count mismatch");
  2407. return i.push(e), Codegen;
  2408. }
  2409. function toString(n) {
  2410. return "function " + (n || r || "") + "(" + (e && e.join(",") || "") + "){\n " + i.join("\n ") + "\n}";
  2411. }
  2412. return Codegen.toString = toString, Codegen;
  2413. }
  2414. codegen.verbose = !1;
  2415. var fetch_1 = fetch, asPromise = requireAspromise(), inquire = requireInquire(), fs = inquire("fs");
  2416. function fetch(e, r, i) {
  2417. return "function" == typeof r ? (i = r, r = {}) : r || (r = {}), i ? !r.xhr && fs && fs.readFile ? fs.readFile(e, (function fetchReadFileCallback(n, o) {
  2418. return n && "undefined" != typeof XMLHttpRequest ? fetch.xhr(e, r, i) : n ? i(n) : i(null, r.binary ? o : o.toString("utf8"));
  2419. })) : fetch.xhr(e, r, i) : asPromise(fetch, this, e, r);
  2420. }
  2421. fetch.xhr = function fetch_xhr(e, r, i) {
  2422. var n = new XMLHttpRequest;
  2423. n.onreadystatechange = function fetchOnReadyStateChange() {
  2424. if (4 === n.readyState) {
  2425. if (0 !== n.status && 200 !== n.status) return i(Error("status " + n.status));
  2426. if (r.binary) {
  2427. var e = n.response;
  2428. if (!e) {
  2429. e = [];
  2430. for (var o = 0; o < n.responseText.length; ++o) e.push(255 & n.responseText.charCodeAt(o));
  2431. }
  2432. return i(null, "undefined" != typeof Uint8Array ? new Uint8Array(e) : e);
  2433. }
  2434. return i(null, n.responseText);
  2435. }
  2436. }, r.binary && ("overrideMimeType" in n && n.overrideMimeType("text/plain; charset=x-user-defined"),
  2437. n.responseType = "arraybuffer"), n.open("GET", e), n.send();
  2438. };
  2439. var path = {};
  2440. !function(e) {
  2441. var r = e, i = r.isAbsolute = function isAbsolute(e) {
  2442. return /^(?:\/|\w+:)/.test(e);
  2443. }, n = r.normalize = function normalize(e) {
  2444. var r = (e = e.replace(/\\/g, "/").replace(/\/{2,}/g, "/")).split("/"), n = i(e), o = "";
  2445. n && (o = r.shift() + "/");
  2446. for (var s = 0; s < r.length; ) ".." === r[s] ? s > 0 && ".." !== r[s - 1] ? r.splice(--s, 2) : n ? r.splice(s, 1) : ++s : "." === r[s] ? r.splice(s, 1) : ++s;
  2447. return o + r.join("/");
  2448. };
  2449. r.resolve = function resolve(e, r, o) {
  2450. return o || (r = n(r)), i(r) ? r : (o || (e = n(e)), (e = e.replace(/(?:\/|^)[^/]+$/, "")).length ? n(e + "/" + r) : r);
  2451. };
  2452. }(path);
  2453. var types$1 = {}, hasRequiredTypes, field, hasRequiredField, oneof, hasRequiredOneof, namespace, hasRequiredNamespace, mapfield, hasRequiredMapfield, method, hasRequiredMethod, service, hasRequiredService;
  2454. function requireTypes() {
  2455. return hasRequiredTypes || (hasRequiredTypes = 1, function(e) {
  2456. var r = e, i = requireUtil(), n = [ "double", "float", "int32", "uint32", "sint32", "fixed32", "sfixed32", "int64", "uint64", "sint64", "fixed64", "sfixed64", "bool", "string", "bytes" ];
  2457. function bake(e, r) {
  2458. var i = 0, o = {};
  2459. for (r |= 0; i < e.length; ) o[n[i + r]] = e[i++];
  2460. return o;
  2461. }
  2462. r.basic = bake([ 1, 5, 0, 0, 0, 5, 5, 0, 0, 0, 1, 1, 0, 2, 2 ]), r.defaults = bake([ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, !1, "", i.emptyArray, null ]),
  2463. r.long = bake([ 0, 0, 0, 1, 1 ], 7), r.mapKey = bake([ 0, 0, 0, 5, 5, 0, 0, 0, 1, 1, 0, 2 ], 2),
  2464. r.packed = bake([ 1, 5, 0, 0, 0, 5, 5, 0, 0, 0, 1, 1, 0 ]);
  2465. }(types$1)), types$1;
  2466. }
  2467. function requireField() {
  2468. if (hasRequiredField) return field;
  2469. hasRequiredField = 1, field = Field;
  2470. var e = requireObject();
  2471. ((Field.prototype = Object.create(e.prototype)).constructor = Field).className = "Field";
  2472. var r, i = require_enum(), n = requireTypes(), o = requireUtil(), s = /^required|optional|repeated$/;
  2473. function Field(r, i, a, u, l, f, h) {
  2474. if (o.isObject(u) ? (h = l, f = u, u = l = void 0) : o.isObject(l) && (h = f, f = l,
  2475. l = void 0), e.call(this, r, f), !o.isInteger(i) || i < 0) throw TypeError("id must be a non-negative integer");
  2476. if (!o.isString(a)) throw TypeError("type must be a string");
  2477. if (void 0 !== u && !s.test(u = u.toString().toLowerCase())) throw TypeError("rule must be a string rule");
  2478. if (void 0 !== l && !o.isString(l)) throw TypeError("extend must be a string");
  2479. "proto3_optional" === u && (u = "optional"), this.rule = u && "optional" !== u ? u : void 0,
  2480. this.type = a, this.id = i, this.extend = l || void 0, this.required = "required" === u,
  2481. this.optional = !this.required, this.repeated = "repeated" === u, this.map = !1,
  2482. this.message = null, this.partOf = null, this.typeDefault = null, this.defaultValue = null,
  2483. this.long = !!o.Long && void 0 !== n.long[a], this.bytes = "bytes" === a, this.resolvedType = null,
  2484. this.extensionField = null, this.declaringField = null, this._packed = null, this.comment = h;
  2485. }
  2486. return Field.fromJSON = function fromJSON(e, r) {
  2487. return new Field(e, r.id, r.type, r.rule, r.extend, r.options, r.comment);
  2488. }, Object.defineProperty(Field.prototype, "packed", {
  2489. get: function() {
  2490. return null === this._packed && (this._packed = !1 !== this.getOption("packed")),
  2491. this._packed;
  2492. }
  2493. }), Field.prototype.setOption = function setOption(r, i, n) {
  2494. return "packed" === r && (this._packed = null), e.prototype.setOption.call(this, r, i, n);
  2495. }, Field.prototype.toJSON = function toJSON(e) {
  2496. var r = !!e && Boolean(e.keepComments);
  2497. return o.toObject([ "rule", "optional" !== this.rule && this.rule || void 0, "type", this.type, "id", this.id, "extend", this.extend, "options", this.options, "comment", r ? this.comment : void 0 ]);
  2498. }, Field.prototype.resolve = function resolve() {
  2499. if (this.resolved) return this;
  2500. if (void 0 === (this.typeDefault = n.defaults[this.type]) ? (this.resolvedType = (this.declaringField ? this.declaringField.parent : this.parent).lookupTypeOrEnum(this.type),
  2501. this.resolvedType instanceof r ? this.typeDefault = null : this.typeDefault = this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]) : this.options && this.options.proto3_optional && (this.typeDefault = null),
  2502. this.options && null != this.options.default && (this.typeDefault = this.options.default,
  2503. this.resolvedType instanceof i && "string" == typeof this.typeDefault && (this.typeDefault = this.resolvedType.values[this.typeDefault])),
  2504. this.options && (!0 !== this.options.packed && (void 0 === this.options.packed || !this.resolvedType || this.resolvedType instanceof i) || delete this.options.packed,
  2505. Object.keys(this.options).length || (this.options = void 0)), this.long) this.typeDefault = o.Long.fromNumber(this.typeDefault, "u" === this.type.charAt(0)),
  2506. Object.freeze && Object.freeze(this.typeDefault); else if (this.bytes && "string" == typeof this.typeDefault) {
  2507. var s;
  2508. o.base64.test(this.typeDefault) ? o.base64.decode(this.typeDefault, s = o.newBuffer(o.base64.length(this.typeDefault)), 0) : o.utf8.write(this.typeDefault, s = o.newBuffer(o.utf8.length(this.typeDefault)), 0),
  2509. this.typeDefault = s;
  2510. }
  2511. return this.map ? this.defaultValue = o.emptyObject : this.repeated ? this.defaultValue = o.emptyArray : this.defaultValue = this.typeDefault,
  2512. this.parent instanceof r && (this.parent.ctor.prototype[this.name] = this.defaultValue),
  2513. e.prototype.resolve.call(this);
  2514. }, Field.d = function decorateField(e, r, i, n) {
  2515. return "function" == typeof r ? r = o.decorateType(r).name : r && "object" == typeof r && (r = o.decorateEnum(r).name),
  2516. function fieldDecorator(s, a) {
  2517. o.decorateType(s.constructor).add(new Field(a, e, r, i, {
  2518. default: n
  2519. }));
  2520. };
  2521. }, Field._configure = function configure(e) {
  2522. r = e;
  2523. }, field;
  2524. }
  2525. function requireOneof() {
  2526. if (hasRequiredOneof) return oneof;
  2527. hasRequiredOneof = 1, oneof = OneOf;
  2528. var e = requireObject();
  2529. ((OneOf.prototype = Object.create(e.prototype)).constructor = OneOf).className = "OneOf";
  2530. var r = requireField(), i = requireUtil();
  2531. function OneOf(r, i, n, o) {
  2532. if (Array.isArray(i) || (n = i, i = void 0), e.call(this, r, n), void 0 !== i && !Array.isArray(i)) throw TypeError("fieldNames must be an Array");
  2533. this.oneof = i || [], this.fieldsArray = [], this.comment = o;
  2534. }
  2535. function addFieldsToParent(e) {
  2536. if (e.parent) for (var r = 0; r < e.fieldsArray.length; ++r) e.fieldsArray[r].parent || e.parent.add(e.fieldsArray[r]);
  2537. }
  2538. return OneOf.fromJSON = function fromJSON(e, r) {
  2539. return new OneOf(e, r.oneof, r.options, r.comment);
  2540. }, OneOf.prototype.toJSON = function toJSON(e) {
  2541. var r = !!e && Boolean(e.keepComments);
  2542. return i.toObject([ "options", this.options, "oneof", this.oneof, "comment", r ? this.comment : void 0 ]);
  2543. }, OneOf.prototype.add = function add(e) {
  2544. if (!(e instanceof r)) throw TypeError("field must be a Field");
  2545. return e.parent && e.parent !== this.parent && e.parent.remove(e), this.oneof.push(e.name),
  2546. this.fieldsArray.push(e), e.partOf = this, addFieldsToParent(this), this;
  2547. }, OneOf.prototype.remove = function remove(e) {
  2548. if (!(e instanceof r)) throw TypeError("field must be a Field");
  2549. var i = this.fieldsArray.indexOf(e);
  2550. if (i < 0) throw Error(e + " is not a member of " + this);
  2551. return this.fieldsArray.splice(i, 1), (i = this.oneof.indexOf(e.name)) > -1 && this.oneof.splice(i, 1),
  2552. e.partOf = null, this;
  2553. }, OneOf.prototype.onAdd = function onAdd(r) {
  2554. e.prototype.onAdd.call(this, r);
  2555. for (var i = 0; i < this.oneof.length; ++i) {
  2556. var n = r.get(this.oneof[i]);
  2557. n && !n.partOf && (n.partOf = this, this.fieldsArray.push(n));
  2558. }
  2559. addFieldsToParent(this);
  2560. }, OneOf.prototype.onRemove = function onRemove(r) {
  2561. for (var i, n = 0; n < this.fieldsArray.length; ++n) (i = this.fieldsArray[n]).parent && i.parent.remove(i);
  2562. e.prototype.onRemove.call(this, r);
  2563. }, OneOf.d = function decorateOneOf() {
  2564. for (var e = new Array(arguments.length), r = 0; r < arguments.length; ) e[r] = arguments[r++];
  2565. return function oneOfDecorator(r, n) {
  2566. i.decorateType(r.constructor).add(new OneOf(n, e)), Object.defineProperty(r, n, {
  2567. get: i.oneOfGetter(e),
  2568. set: i.oneOfSetter(e)
  2569. });
  2570. };
  2571. }, oneof;
  2572. }
  2573. function requireNamespace() {
  2574. if (hasRequiredNamespace) return namespace;
  2575. hasRequiredNamespace = 1, namespace = Namespace;
  2576. var e = requireObject();
  2577. ((Namespace.prototype = Object.create(e.prototype)).constructor = Namespace).className = "Namespace";
  2578. var r, i, n, o = requireField(), s = requireUtil(), a = requireOneof();
  2579. function arrayToJSON(e, r) {
  2580. if (e && e.length) {
  2581. for (var i = {}, n = 0; n < e.length; ++n) i[e[n].name] = e[n].toJSON(r);
  2582. return i;
  2583. }
  2584. }
  2585. function Namespace(r, i) {
  2586. e.call(this, r, i), this.nested = void 0, this._nestedArray = null;
  2587. }
  2588. function clearCache(e) {
  2589. return e._nestedArray = null, e;
  2590. }
  2591. return Namespace.fromJSON = function fromJSON(e, r) {
  2592. return new Namespace(e, r.options).addJSON(r.nested);
  2593. }, Namespace.arrayToJSON = arrayToJSON, Namespace.isReservedId = function isReservedId(e, r) {
  2594. if (e) for (var i = 0; i < e.length; ++i) if ("string" != typeof e[i] && e[i][0] <= r && e[i][1] > r) return !0;
  2595. return !1;
  2596. }, Namespace.isReservedName = function isReservedName(e, r) {
  2597. if (e) for (var i = 0; i < e.length; ++i) if (e[i] === r) return !0;
  2598. return !1;
  2599. }, Object.defineProperty(Namespace.prototype, "nestedArray", {
  2600. get: function() {
  2601. return this._nestedArray || (this._nestedArray = s.toArray(this.nested));
  2602. }
  2603. }), Namespace.prototype.toJSON = function toJSON(e) {
  2604. return s.toObject([ "options", this.options, "nested", arrayToJSON(this.nestedArray, e) ]);
  2605. }, Namespace.prototype.addJSON = function addJSON(e) {
  2606. if (e) for (var s, a = Object.keys(e), u = 0; u < a.length; ++u) s = e[a[u]], this.add((void 0 !== s.fields ? r.fromJSON : void 0 !== s.values ? n.fromJSON : void 0 !== s.methods ? i.fromJSON : void 0 !== s.id ? o.fromJSON : Namespace.fromJSON)(a[u], s));
  2607. return this;
  2608. }, Namespace.prototype.get = function get(e) {
  2609. return this.nested && this.nested[e] || null;
  2610. }, Namespace.prototype.getEnum = function getEnum(e) {
  2611. if (this.nested && this.nested[e] instanceof n) return this.nested[e].values;
  2612. throw Error("no such enum: " + e);
  2613. }, Namespace.prototype.add = function add(e) {
  2614. if (!(e instanceof o && void 0 !== e.extend || e instanceof r || e instanceof a || e instanceof n || e instanceof i || e instanceof Namespace)) throw TypeError("object must be a valid nested object");
  2615. if (this.nested) {
  2616. var s = this.get(e.name);
  2617. if (s) {
  2618. if (!(s instanceof Namespace && e instanceof Namespace) || s instanceof r || s instanceof i) throw Error("duplicate name '" + e.name + "' in " + this);
  2619. for (var u = s.nestedArray, l = 0; l < u.length; ++l) e.add(u[l]);
  2620. this.remove(s), this.nested || (this.nested = {}), e.setOptions(s.options, !0);
  2621. }
  2622. } else this.nested = {};
  2623. return this.nested[e.name] = e, e.onAdd(this), clearCache(this);
  2624. }, Namespace.prototype.remove = function remove(r) {
  2625. if (!(r instanceof e)) throw TypeError("object must be a ReflectionObject");
  2626. if (r.parent !== this) throw Error(r + " is not a member of " + this);
  2627. return delete this.nested[r.name], Object.keys(this.nested).length || (this.nested = void 0),
  2628. r.onRemove(this), clearCache(this);
  2629. }, Namespace.prototype.define = function define(e, r) {
  2630. if (s.isString(e)) e = e.split("."); else if (!Array.isArray(e)) throw TypeError("illegal path");
  2631. if (e && e.length && "" === e[0]) throw Error("path must be relative");
  2632. for (var i = this; e.length > 0; ) {
  2633. var n = e.shift();
  2634. if (i.nested && i.nested[n]) {
  2635. if (!((i = i.nested[n]) instanceof Namespace)) throw Error("path conflicts with non-namespace objects");
  2636. } else i.add(i = new Namespace(n));
  2637. }
  2638. return r && i.addJSON(r), i;
  2639. }, Namespace.prototype.resolveAll = function resolveAll() {
  2640. for (var e = this.nestedArray, r = 0; r < e.length; ) e[r] instanceof Namespace ? e[r++].resolveAll() : e[r++].resolve();
  2641. return this.resolve();
  2642. }, Namespace.prototype.lookup = function lookup(e, r, i) {
  2643. if ("boolean" == typeof r ? (i = r, r = void 0) : r && !Array.isArray(r) && (r = [ r ]),
  2644. s.isString(e) && e.length) {
  2645. if ("." === e) return this.root;
  2646. e = e.split(".");
  2647. } else if (!e.length) return this;
  2648. if ("" === e[0]) return this.root.lookup(e.slice(1), r);
  2649. var n = this.get(e[0]);
  2650. if (n) {
  2651. if (1 === e.length) {
  2652. if (!r || r.indexOf(n.constructor) > -1) return n;
  2653. } else if (n instanceof Namespace && (n = n.lookup(e.slice(1), r, !0))) return n;
  2654. } else for (var o = 0; o < this.nestedArray.length; ++o) if (this._nestedArray[o] instanceof Namespace && (n = this._nestedArray[o].lookup(e, r, !0))) return n;
  2655. return null === this.parent || i ? null : this.parent.lookup(e, r);
  2656. }, Namespace.prototype.lookupType = function lookupType(e) {
  2657. var i = this.lookup(e, [ r ]);
  2658. if (!i) throw Error("no such type: " + e);
  2659. return i;
  2660. }, Namespace.prototype.lookupEnum = function lookupEnum(e) {
  2661. var r = this.lookup(e, [ n ]);
  2662. if (!r) throw Error("no such Enum '" + e + "' in " + this);
  2663. return r;
  2664. }, Namespace.prototype.lookupTypeOrEnum = function lookupTypeOrEnum(e) {
  2665. var i = this.lookup(e, [ r, n ]);
  2666. if (!i) throw Error("no such Type or Enum '" + e + "' in " + this);
  2667. return i;
  2668. }, Namespace.prototype.lookupService = function lookupService(e) {
  2669. var r = this.lookup(e, [ i ]);
  2670. if (!r) throw Error("no such Service '" + e + "' in " + this);
  2671. return r;
  2672. }, Namespace._configure = function(e, o, s) {
  2673. r = e, i = o, n = s;
  2674. }, namespace;
  2675. }
  2676. function requireMapfield() {
  2677. if (hasRequiredMapfield) return mapfield;
  2678. hasRequiredMapfield = 1, mapfield = MapField;
  2679. var e = requireField();
  2680. ((MapField.prototype = Object.create(e.prototype)).constructor = MapField).className = "MapField";
  2681. var r = requireTypes(), i = requireUtil();
  2682. function MapField(r, n, o, s, a, u) {
  2683. if (e.call(this, r, n, s, void 0, void 0, a, u), !i.isString(o)) throw TypeError("keyType must be a string");
  2684. this.keyType = o, this.resolvedKeyType = null, this.map = !0;
  2685. }
  2686. return MapField.fromJSON = function fromJSON(e, r) {
  2687. return new MapField(e, r.id, r.keyType, r.type, r.options, r.comment);
  2688. }, MapField.prototype.toJSON = function toJSON(e) {
  2689. var r = !!e && Boolean(e.keepComments);
  2690. return i.toObject([ "keyType", this.keyType, "type", this.type, "id", this.id, "extend", this.extend, "options", this.options, "comment", r ? this.comment : void 0 ]);
  2691. }, MapField.prototype.resolve = function resolve() {
  2692. if (this.resolved) return this;
  2693. if (void 0 === r.mapKey[this.keyType]) throw Error("invalid key type: " + this.keyType);
  2694. return e.prototype.resolve.call(this);
  2695. }, MapField.d = function decorateMapField(e, r, n) {
  2696. return "function" == typeof n ? n = i.decorateType(n).name : n && "object" == typeof n && (n = i.decorateEnum(n).name),
  2697. function mapFieldDecorator(o, s) {
  2698. i.decorateType(o.constructor).add(new MapField(s, e, r, n));
  2699. };
  2700. }, mapfield;
  2701. }
  2702. function requireMethod() {
  2703. if (hasRequiredMethod) return method;
  2704. hasRequiredMethod = 1, method = Method;
  2705. var e = requireObject();
  2706. ((Method.prototype = Object.create(e.prototype)).constructor = Method).className = "Method";
  2707. var r = requireUtil();
  2708. function Method(i, n, o, s, a, u, l, f, h) {
  2709. if (r.isObject(a) ? (l = a, a = u = void 0) : r.isObject(u) && (l = u, u = void 0),
  2710. void 0 !== n && !r.isString(n)) throw TypeError("type must be a string");
  2711. if (!r.isString(o)) throw TypeError("requestType must be a string");
  2712. if (!r.isString(s)) throw TypeError("responseType must be a string");
  2713. e.call(this, i, l), this.type = n || "rpc", this.requestType = o, this.requestStream = !!a || void 0,
  2714. this.responseType = s, this.responseStream = !!u || void 0, this.resolvedRequestType = null,
  2715. this.resolvedResponseType = null, this.comment = f, this.parsedOptions = h;
  2716. }
  2717. return Method.fromJSON = function fromJSON(e, r) {
  2718. return new Method(e, r.type, r.requestType, r.responseType, r.requestStream, r.responseStream, r.options, r.comment, r.parsedOptions);
  2719. }, Method.prototype.toJSON = function toJSON(e) {
  2720. var i = !!e && Boolean(e.keepComments);
  2721. return r.toObject([ "type", "rpc" !== this.type && this.type || void 0, "requestType", this.requestType, "requestStream", this.requestStream, "responseType", this.responseType, "responseStream", this.responseStream, "options", this.options, "comment", i ? this.comment : void 0, "parsedOptions", this.parsedOptions ]);
  2722. }, Method.prototype.resolve = function resolve() {
  2723. return this.resolved ? this : (this.resolvedRequestType = this.parent.lookupType(this.requestType),
  2724. this.resolvedResponseType = this.parent.lookupType(this.responseType), e.prototype.resolve.call(this));
  2725. }, method;
  2726. }
  2727. function requireService() {
  2728. if (hasRequiredService) return service;
  2729. hasRequiredService = 1, service = Service;
  2730. var e = requireNamespace();
  2731. ((Service.prototype = Object.create(e.prototype)).constructor = Service).className = "Service";
  2732. var r = requireMethod(), i = requireUtil(), n = rpc;
  2733. function Service(r, i) {
  2734. e.call(this, r, i), this.methods = {}, this._methodsArray = null;
  2735. }
  2736. function clearCache(e) {
  2737. return e._methodsArray = null, e;
  2738. }
  2739. return Service.fromJSON = function fromJSON(e, i) {
  2740. var n = new Service(e, i.options);
  2741. if (i.methods) for (var o = Object.keys(i.methods), s = 0; s < o.length; ++s) n.add(r.fromJSON(o[s], i.methods[o[s]]));
  2742. return i.nested && n.addJSON(i.nested), n.comment = i.comment, n;
  2743. }, Service.prototype.toJSON = function toJSON(r) {
  2744. var n = e.prototype.toJSON.call(this, r), o = !!r && Boolean(r.keepComments);
  2745. return i.toObject([ "options", n && n.options || void 0, "methods", e.arrayToJSON(this.methodsArray, r) || {}, "nested", n && n.nested || void 0, "comment", o ? this.comment : void 0 ]);
  2746. }, Object.defineProperty(Service.prototype, "methodsArray", {
  2747. get: function() {
  2748. return this._methodsArray || (this._methodsArray = i.toArray(this.methods));
  2749. }
  2750. }), Service.prototype.get = function get(r) {
  2751. return this.methods[r] || e.prototype.get.call(this, r);
  2752. }, Service.prototype.resolveAll = function resolveAll() {
  2753. for (var r = this.methodsArray, i = 0; i < r.length; ++i) r[i].resolve();
  2754. return e.prototype.resolve.call(this);
  2755. }, Service.prototype.add = function add(i) {
  2756. if (this.get(i.name)) throw Error("duplicate name '" + i.name + "' in " + this);
  2757. return i instanceof r ? (this.methods[i.name] = i, i.parent = this, clearCache(this)) : e.prototype.add.call(this, i);
  2758. }, Service.prototype.remove = function remove(i) {
  2759. if (i instanceof r) {
  2760. if (this.methods[i.name] !== i) throw Error(i + " is not a member of " + this);
  2761. return delete this.methods[i.name], i.parent = null, clearCache(this);
  2762. }
  2763. return e.prototype.remove.call(this, i);
  2764. }, Service.prototype.create = function create(e, r, o) {
  2765. for (var s, a = new n.Service(e, r, o), u = 0; u < this.methodsArray.length; ++u) {
  2766. var l = i.lcFirst((s = this._methodsArray[u]).resolve().name).replace(/[^$\w_]/g, "");
  2767. a[l] = i.codegen([ "r", "c" ], i.isReserved(l) ? l + "_" : l)("return this.rpcCall(m,q,s,r,c)")({
  2768. m: s,
  2769. q: s.resolvedRequestType.ctor,
  2770. s: s.resolvedResponseType.ctor
  2771. });
  2772. }
  2773. return a;
  2774. }, service;
  2775. }
  2776. var message$1 = Message, util$1 = requireMinimal(), decoder_1, hasRequiredDecoder, verifier_1, hasRequiredVerifier;
  2777. function Message(e) {
  2778. if (e) for (var r = Object.keys(e), i = 0; i < r.length; ++i) this[r[i]] = e[r[i]];
  2779. }
  2780. function requireDecoder() {
  2781. if (hasRequiredDecoder) return decoder_1;
  2782. hasRequiredDecoder = 1, decoder_1 = function decoder(n) {
  2783. var o = i.codegen([ "r", "l" ], n.name + "$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor" + (n.fieldsArray.filter((function(e) {
  2784. return e.map;
  2785. })).length ? ",k,value" : ""))("while(r.pos<c){")("var t=r.uint32()");
  2786. n.group && o("if((t&7)===4)")("break");
  2787. o("switch(t>>>3){");
  2788. for (var s = 0; s < n.fieldsArray.length; ++s) {
  2789. var a = n._fieldsArray[s].resolve(), u = a.resolvedType instanceof e ? "int32" : a.type, l = "m" + i.safeProp(a.name);
  2790. o("case %i: {", a.id), a.map ? (o("if(%s===util.emptyObject)", l)("%s={}", l)("var c2 = r.uint32()+r.pos"),
  2791. void 0 !== r.defaults[a.keyType] ? o("k=%j", r.defaults[a.keyType]) : o("k=null"),
  2792. void 0 !== r.defaults[u] ? o("value=%j", r.defaults[u]) : o("value=null"), o("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break", a.keyType)("case 2:"),
  2793. void 0 === r.basic[u] ? o("value=types[%i].decode(r,r.uint32())", s) : o("value=r.%s()", u),
  2794. o("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"), void 0 !== r.long[a.keyType] ? o('%s[typeof k==="object"?util.longToHash(k):k]=value', l) : o("%s[k]=value", l)) : a.repeated ? (o("if(!(%s&&%s.length))", l, l)("%s=[]", l),
  2795. void 0 !== r.packed[u] && o("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())", l, u)("}else"),
  2796. void 0 === r.basic[u] ? o(a.resolvedType.group ? "%s.push(types[%i].decode(r))" : "%s.push(types[%i].decode(r,r.uint32()))", l, s) : o("%s.push(r.%s())", l, u)) : void 0 === r.basic[u] ? o(a.resolvedType.group ? "%s=types[%i].decode(r)" : "%s=types[%i].decode(r,r.uint32())", l, s) : o("%s=r.%s()", l, u),
  2797. o("break")("}");
  2798. }
  2799. for (o("default:")("r.skipType(t&7)")("break")("}")("}"), s = 0; s < n._fieldsArray.length; ++s) {
  2800. var f = n._fieldsArray[s];
  2801. f.required && o("if(!m.hasOwnProperty(%j))", f.name)("throw util.ProtocolError(%j,{instance:m})", missing(f));
  2802. }
  2803. return o("return m");
  2804. };
  2805. var e = require_enum(), r = requireTypes(), i = requireUtil();
  2806. function missing(e) {
  2807. return "missing required '" + e.name + "'";
  2808. }
  2809. return decoder_1;
  2810. }
  2811. function requireVerifier() {
  2812. if (hasRequiredVerifier) return verifier_1;
  2813. hasRequiredVerifier = 1, verifier_1 = function verifier(e) {
  2814. var i = r.codegen([ "m" ], e.name + "$verify")('if(typeof m!=="object"||m===null)')("return%j", "object expected"), n = e.oneofsArray, o = {};
  2815. n.length && i("var p={}");
  2816. for (var s = 0; s < e.fieldsArray.length; ++s) {
  2817. var a = e._fieldsArray[s].resolve(), u = "m" + r.safeProp(a.name);
  2818. if (a.optional && i("if(%s!=null&&m.hasOwnProperty(%j)){", u, a.name), a.map) i("if(!util.isObject(%s))", u)("return%j", invalid(a, "object"))("var k=Object.keys(%s)", u)("for(var i=0;i<k.length;++i){"),
  2819. genVerifyKey(i, a, "k[i]"), genVerifyValue(i, a, s, u + "[k[i]]")("}"); else if (a.repeated) i("if(!Array.isArray(%s))", u)("return%j", invalid(a, "array"))("for(var i=0;i<%s.length;++i){", u),
  2820. genVerifyValue(i, a, s, u + "[i]")("}"); else {
  2821. if (a.partOf) {
  2822. var l = r.safeProp(a.partOf.name);
  2823. 1 === o[a.partOf.name] && i("if(p%s===1)", l)("return%j", a.partOf.name + ": multiple values"),
  2824. o[a.partOf.name] = 1, i("p%s=1", l);
  2825. }
  2826. genVerifyValue(i, a, s, u);
  2827. }
  2828. a.optional && i("}");
  2829. }
  2830. return i("return null");
  2831. };
  2832. var e = require_enum(), r = requireUtil();
  2833. function invalid(e, r) {
  2834. return e.name + ": " + r + (e.repeated && "array" !== r ? "[]" : e.map && "object" !== r ? "{k:" + e.keyType + "}" : "") + " expected";
  2835. }
  2836. function genVerifyValue(r, i, n, o) {
  2837. if (i.resolvedType) if (i.resolvedType instanceof e) {
  2838. r("switch(%s){", o)("default:")("return%j", invalid(i, "enum value"));
  2839. for (var s = Object.keys(i.resolvedType.values), a = 0; a < s.length; ++a) r("case %i:", i.resolvedType.values[s[a]]);
  2840. r("break")("}");
  2841. } else r("{")("var e=types[%i].verify(%s);", n, o)("if(e)")("return%j+e", i.name + ".")("}"); else switch (i.type) {
  2842. case "int32":
  2843. case "uint32":
  2844. case "sint32":
  2845. case "fixed32":
  2846. case "sfixed32":
  2847. r("if(!util.isInteger(%s))", o)("return%j", invalid(i, "integer"));
  2848. break;
  2849.  
  2850. case "int64":
  2851. case "uint64":
  2852. case "sint64":
  2853. case "fixed64":
  2854. case "sfixed64":
  2855. r("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))", o, o, o, o)("return%j", invalid(i, "integer|Long"));
  2856. break;
  2857.  
  2858. case "float":
  2859. case "double":
  2860. r('if(typeof %s!=="number")', o)("return%j", invalid(i, "number"));
  2861. break;
  2862.  
  2863. case "bool":
  2864. r('if(typeof %s!=="boolean")', o)("return%j", invalid(i, "boolean"));
  2865. break;
  2866.  
  2867. case "string":
  2868. r("if(!util.isString(%s))", o)("return%j", invalid(i, "string"));
  2869. break;
  2870.  
  2871. case "bytes":
  2872. r('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))', o, o, o)("return%j", invalid(i, "buffer"));
  2873. }
  2874. return r;
  2875. }
  2876. function genVerifyKey(e, r, i) {
  2877. switch (r.keyType) {
  2878. case "int32":
  2879. case "uint32":
  2880. case "sint32":
  2881. case "fixed32":
  2882. case "sfixed32":
  2883. e("if(!util.key32Re.test(%s))", i)("return%j", invalid(r, "integer key"));
  2884. break;
  2885.  
  2886. case "int64":
  2887. case "uint64":
  2888. case "sint64":
  2889. case "fixed64":
  2890. case "sfixed64":
  2891. e("if(!util.key64Re.test(%s))", i)("return%j", invalid(r, "integer|Long key"));
  2892. break;
  2893.  
  2894. case "bool":
  2895. e("if(!util.key2Re.test(%s))", i)("return%j", invalid(r, "boolean key"));
  2896. }
  2897. return e;
  2898. }
  2899. return verifier_1;
  2900. }
  2901. Message.create = function create(e) {
  2902. return this.$type.create(e);
  2903. }, Message.encode = function encode(e, r) {
  2904. return this.$type.encode(e, r);
  2905. }, Message.encodeDelimited = function encodeDelimited(e, r) {
  2906. return this.$type.encodeDelimited(e, r);
  2907. }, Message.decode = function decode(e) {
  2908. return this.$type.decode(e);
  2909. }, Message.decodeDelimited = function decodeDelimited(e) {
  2910. return this.$type.decodeDelimited(e);
  2911. }, Message.verify = function verify(e) {
  2912. return this.$type.verify(e);
  2913. }, Message.fromObject = function fromObject(e) {
  2914. return this.$type.fromObject(e);
  2915. }, Message.toObject = function toObject(e, r) {
  2916. return this.$type.toObject(e, r);
  2917. }, Message.prototype.toJSON = function toJSON() {
  2918. return this.$type.toObject(this, util$1.toJSONOptions);
  2919. };
  2920. var converter = {}, hasRequiredConverter;
  2921. function requireConverter() {
  2922. return hasRequiredConverter || (hasRequiredConverter = 1, function(e) {
  2923. var r = e, i = require_enum(), n = requireUtil();
  2924. function genValuePartial_fromObject(e, r, n, o) {
  2925. var s = !1;
  2926. if (r.resolvedType) if (r.resolvedType instanceof i) {
  2927. e("switch(d%s){", o);
  2928. for (var a = r.resolvedType.values, u = Object.keys(a), l = 0; l < u.length; ++l) a[u[l]] !== r.typeDefault || s || (e("default:")('if(typeof(d%s)==="number"){m%s=d%s;break}', o, o, o),
  2929. r.repeated || e("break"), s = !0), e("case%j:", u[l])("case %i:", a[u[l]])("m%s=%j", o, a[u[l]])("break");
  2930. e("}");
  2931. } else e('if(typeof d%s!=="object")', o)("throw TypeError(%j)", r.fullName + ": object expected")("m%s=types[%i].fromObject(d%s)", o, n, o); else {
  2932. var f = !1;
  2933. switch (r.type) {
  2934. case "double":
  2935. case "float":
  2936. e("m%s=Number(d%s)", o, o);
  2937. break;
  2938.  
  2939. case "uint32":
  2940. case "fixed32":
  2941. e("m%s=d%s>>>0", o, o);
  2942. break;
  2943.  
  2944. case "int32":
  2945. case "sint32":
  2946. case "sfixed32":
  2947. e("m%s=d%s|0", o, o);
  2948. break;
  2949.  
  2950. case "uint64":
  2951. f = !0;
  2952.  
  2953. case "int64":
  2954. case "sint64":
  2955. case "fixed64":
  2956. case "sfixed64":
  2957. e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j", o, o, f)('else if(typeof d%s==="string")', o)("m%s=parseInt(d%s,10)", o, o)('else if(typeof d%s==="number")', o)("m%s=d%s", o, o)('else if(typeof d%s==="object")', o)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)", o, o, o, f ? "true" : "");
  2958. break;
  2959.  
  2960. case "bytes":
  2961. e('if(typeof d%s==="string")', o)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)", o, o, o)("else if(d%s.length >= 0)", o)("m%s=d%s", o, o);
  2962. break;
  2963.  
  2964. case "string":
  2965. e("m%s=String(d%s)", o, o);
  2966. break;
  2967.  
  2968. case "bool":
  2969. e("m%s=Boolean(d%s)", o, o);
  2970. }
  2971. }
  2972. return e;
  2973. }
  2974. function genValuePartial_toObject(e, r, n, o) {
  2975. if (r.resolvedType) r.resolvedType instanceof i ? e("d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s", o, n, o, o, n, o, o) : e("d%s=types[%i].toObject(m%s,o)", o, n, o); else {
  2976. var s = !1;
  2977. switch (r.type) {
  2978. case "double":
  2979. case "float":
  2980. e("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s", o, o, o, o);
  2981. break;
  2982.  
  2983. case "uint64":
  2984. s = !0;
  2985.  
  2986. case "int64":
  2987. case "sint64":
  2988. case "fixed64":
  2989. case "sfixed64":
  2990. e('if(typeof m%s==="number")', o)("d%s=o.longs===String?String(m%s):m%s", o, o, o)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s", o, o, o, o, s ? "true" : "", o);
  2991. break;
  2992.  
  2993. case "bytes":
  2994. e("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s", o, o, o, o, o);
  2995. break;
  2996.  
  2997. default:
  2998. e("d%s=m%s", o, o);
  2999. }
  3000. }
  3001. return e;
  3002. }
  3003. r.fromObject = function fromObject(e) {
  3004. var r = e.fieldsArray, o = n.codegen([ "d" ], e.name + "$fromObject")("if(d instanceof this.ctor)")("return d");
  3005. if (!r.length) return o("return new this.ctor");
  3006. o("var m=new this.ctor");
  3007. for (var s = 0; s < r.length; ++s) {
  3008. var a = r[s].resolve(), u = n.safeProp(a.name);
  3009. a.map ? (o("if(d%s){", u)('if(typeof d%s!=="object")', u)("throw TypeError(%j)", a.fullName + ": object expected")("m%s={}", u)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){", u),
  3010. genValuePartial_fromObject(o, a, s, u + "[ks[i]]")("}")("}")) : a.repeated ? (o("if(d%s){", u)("if(!Array.isArray(d%s))", u)("throw TypeError(%j)", a.fullName + ": array expected")("m%s=[]", u)("for(var i=0;i<d%s.length;++i){", u),
  3011. genValuePartial_fromObject(o, a, s, u + "[i]")("}")("}")) : (a.resolvedType instanceof i || o("if(d%s!=null){", u),
  3012. genValuePartial_fromObject(o, a, s, u), a.resolvedType instanceof i || o("}"));
  3013. }
  3014. return o("return m");
  3015. }, r.toObject = function toObject(e) {
  3016. var r = e.fieldsArray.slice().sort(n.compareFieldsById);
  3017. if (!r.length) return n.codegen()("return {}");
  3018. for (var o = n.codegen([ "m", "o" ], e.name + "$toObject")("if(!o)")("o={}")("var d={}"), s = [], a = [], u = [], l = 0; l < r.length; ++l) r[l].partOf || (r[l].resolve().repeated ? s : r[l].map ? a : u).push(r[l]);
  3019. if (s.length) {
  3020. for (o("if(o.arrays||o.defaults){"), l = 0; l < s.length; ++l) o("d%s=[]", n.safeProp(s[l].name));
  3021. o("}");
  3022. }
  3023. if (a.length) {
  3024. for (o("if(o.objects||o.defaults){"), l = 0; l < a.length; ++l) o("d%s={}", n.safeProp(a[l].name));
  3025. o("}");
  3026. }
  3027. if (u.length) {
  3028. for (o("if(o.defaults){"), l = 0; l < u.length; ++l) {
  3029. var f = u[l], h = n.safeProp(f.name);
  3030. if (f.resolvedType instanceof i) o("d%s=o.enums===String?%j:%j", h, f.resolvedType.valuesById[f.typeDefault], f.typeDefault); else if (f.long) o("if(util.Long){")("var n=new util.Long(%i,%i,%j)", f.typeDefault.low, f.typeDefault.high, f.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n", h)("}else")("d%s=o.longs===String?%j:%i", h, f.typeDefault.toString(), f.typeDefault.toNumber()); else if (f.bytes) {
  3031. var p = "[" + Array.prototype.slice.call(f.typeDefault).join(",") + "]";
  3032. o("if(o.bytes===String)d%s=%j", h, String.fromCharCode.apply(String, f.typeDefault))("else{")("d%s=%s", h, p)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)", h, h)("}");
  3033. } else o("d%s=%j", h, f.typeDefault);
  3034. }
  3035. o("}");
  3036. }
  3037. var c = !1;
  3038. for (l = 0; l < r.length; ++l) {
  3039. f = r[l];
  3040. var d = e._fieldsArray.indexOf(f);
  3041. h = n.safeProp(f.name);
  3042. f.map ? (c || (c = !0, o("var ks2")), o("if(m%s&&(ks2=Object.keys(m%s)).length){", h, h)("d%s={}", h)("for(var j=0;j<ks2.length;++j){"),
  3043. genValuePartial_toObject(o, f, d, h + "[ks2[j]]")("}")) : f.repeated ? (o("if(m%s&&m%s.length){", h, h)("d%s=[]", h)("for(var j=0;j<m%s.length;++j){", h),
  3044. genValuePartial_toObject(o, f, d, h + "[j]")("}")) : (o("if(m%s!=null&&m.hasOwnProperty(%j)){", h, f.name),
  3045. genValuePartial_toObject(o, f, d, h), f.partOf && o("if(o.oneofs)")("d%s=%j", n.safeProp(f.partOf.name), f.name)),
  3046. o("}");
  3047. }
  3048. return o("return d");
  3049. };
  3050. }(converter)), converter;
  3051. }
  3052. var wrappers = {}, type, hasRequiredType, root, hasRequiredRoot, hasRequiredUtil, object, hasRequiredObject, _enum, hasRequired_enum, encoder_1, hasRequiredEncoder;
  3053. function requireType() {
  3054. if (hasRequiredType) return type;
  3055. hasRequiredType = 1, type = Type;
  3056. var e = requireNamespace();
  3057. ((Type.prototype = Object.create(e.prototype)).constructor = Type).className = "Type";
  3058. var r = require_enum(), i = requireOneof(), n = requireField(), o = requireMapfield(), s = requireService(), a = message$1, u = reader, l = writer, f = requireUtil(), h = requireEncoder(), p = requireDecoder(), c = requireVerifier(), d = requireConverter(), g = wrappers;
  3059. function Type(r, i) {
  3060. e.call(this, r, i), this.fields = {}, this.oneofs = void 0, this.extensions = void 0,
  3061. this.reserved = void 0, this.group = void 0, this._fieldsById = null, this._fieldsArray = null,
  3062. this._oneofsArray = null, this._ctor = null;
  3063. }
  3064. function clearCache(e) {
  3065. return e._fieldsById = e._fieldsArray = e._oneofsArray = null, delete e.encode,
  3066. delete e.decode, delete e.verify, e;
  3067. }
  3068. return Object.defineProperties(Type.prototype, {
  3069. fieldsById: {
  3070. get: function() {
  3071. if (this._fieldsById) return this._fieldsById;
  3072. this._fieldsById = {};
  3073. for (var e = Object.keys(this.fields), r = 0; r < e.length; ++r) {
  3074. var i = this.fields[e[r]], n = i.id;
  3075. if (this._fieldsById[n]) throw Error("duplicate id " + n + " in " + this);
  3076. this._fieldsById[n] = i;
  3077. }
  3078. return this._fieldsById;
  3079. }
  3080. },
  3081. fieldsArray: {
  3082. get: function() {
  3083. return this._fieldsArray || (this._fieldsArray = f.toArray(this.fields));
  3084. }
  3085. },
  3086. oneofsArray: {
  3087. get: function() {
  3088. return this._oneofsArray || (this._oneofsArray = f.toArray(this.oneofs));
  3089. }
  3090. },
  3091. ctor: {
  3092. get: function() {
  3093. return this._ctor || (this.ctor = Type.generateConstructor(this)());
  3094. },
  3095. set: function(e) {
  3096. var r = e.prototype;
  3097. r instanceof a || ((e.prototype = new a).constructor = e, f.merge(e.prototype, r)),
  3098. e.$type = e.prototype.$type = this, f.merge(e, a, !0), this._ctor = e;
  3099. for (var i = 0; i < this.fieldsArray.length; ++i) this._fieldsArray[i].resolve();
  3100. var n = {};
  3101. for (i = 0; i < this.oneofsArray.length; ++i) n[this._oneofsArray[i].resolve().name] = {
  3102. get: f.oneOfGetter(this._oneofsArray[i].oneof),
  3103. set: f.oneOfSetter(this._oneofsArray[i].oneof)
  3104. };
  3105. i && Object.defineProperties(e.prototype, n);
  3106. }
  3107. }
  3108. }), Type.generateConstructor = function generateConstructor(e) {
  3109. for (var r, i = f.codegen([ "p" ], e.name), n = 0; n < e.fieldsArray.length; ++n) (r = e._fieldsArray[n]).map ? i("this%s={}", f.safeProp(r.name)) : r.repeated && i("this%s=[]", f.safeProp(r.name));
  3110. return i("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]");
  3111. }, Type.fromJSON = function fromJSON(a, u) {
  3112. var l = new Type(a, u.options);
  3113. l.extensions = u.extensions, l.reserved = u.reserved;
  3114. for (var f = Object.keys(u.fields), h = 0; h < f.length; ++h) l.add((void 0 !== u.fields[f[h]].keyType ? o.fromJSON : n.fromJSON)(f[h], u.fields[f[h]]));
  3115. if (u.oneofs) for (f = Object.keys(u.oneofs), h = 0; h < f.length; ++h) l.add(i.fromJSON(f[h], u.oneofs[f[h]]));
  3116. if (u.nested) for (f = Object.keys(u.nested), h = 0; h < f.length; ++h) {
  3117. var p = u.nested[f[h]];
  3118. l.add((void 0 !== p.id ? n.fromJSON : void 0 !== p.fields ? Type.fromJSON : void 0 !== p.values ? r.fromJSON : void 0 !== p.methods ? s.fromJSON : e.fromJSON)(f[h], p));
  3119. }
  3120. return u.extensions && u.extensions.length && (l.extensions = u.extensions), u.reserved && u.reserved.length && (l.reserved = u.reserved),
  3121. u.group && (l.group = !0), u.comment && (l.comment = u.comment), l;
  3122. }, Type.prototype.toJSON = function toJSON(r) {
  3123. var i = e.prototype.toJSON.call(this, r), n = !!r && Boolean(r.keepComments);
  3124. return f.toObject([ "options", i && i.options || void 0, "oneofs", e.arrayToJSON(this.oneofsArray, r), "fields", e.arrayToJSON(this.fieldsArray.filter((function(e) {
  3125. return !e.declaringField;
  3126. })), r) || {}, "extensions", this.extensions && this.extensions.length ? this.extensions : void 0, "reserved", this.reserved && this.reserved.length ? this.reserved : void 0, "group", this.group || void 0, "nested", i && i.nested || void 0, "comment", n ? this.comment : void 0 ]);
  3127. }, Type.prototype.resolveAll = function resolveAll() {
  3128. for (var r = this.fieldsArray, i = 0; i < r.length; ) r[i++].resolve();
  3129. var n = this.oneofsArray;
  3130. for (i = 0; i < n.length; ) n[i++].resolve();
  3131. return e.prototype.resolveAll.call(this);
  3132. }, Type.prototype.get = function get(e) {
  3133. return this.fields[e] || this.oneofs && this.oneofs[e] || this.nested && this.nested[e] || null;
  3134. }, Type.prototype.add = function add(r) {
  3135. if (this.get(r.name)) throw Error("duplicate name '" + r.name + "' in " + this);
  3136. if (r instanceof n && void 0 === r.extend) {
  3137. if (this._fieldsById ? this._fieldsById[r.id] : this.fieldsById[r.id]) throw Error("duplicate id " + r.id + " in " + this);
  3138. if (this.isReservedId(r.id)) throw Error("id " + r.id + " is reserved in " + this);
  3139. if (this.isReservedName(r.name)) throw Error("name '" + r.name + "' is reserved in " + this);
  3140. return r.parent && r.parent.remove(r), this.fields[r.name] = r, r.message = this,
  3141. r.onAdd(this), clearCache(this);
  3142. }
  3143. return r instanceof i ? (this.oneofs || (this.oneofs = {}), this.oneofs[r.name] = r,
  3144. r.onAdd(this), clearCache(this)) : e.prototype.add.call(this, r);
  3145. }, Type.prototype.remove = function remove(r) {
  3146. if (r instanceof n && void 0 === r.extend) {
  3147. if (!this.fields || this.fields[r.name] !== r) throw Error(r + " is not a member of " + this);
  3148. return delete this.fields[r.name], r.parent = null, r.onRemove(this), clearCache(this);
  3149. }
  3150. if (r instanceof i) {
  3151. if (!this.oneofs || this.oneofs[r.name] !== r) throw Error(r + " is not a member of " + this);
  3152. return delete this.oneofs[r.name], r.parent = null, r.onRemove(this), clearCache(this);
  3153. }
  3154. return e.prototype.remove.call(this, r);
  3155. }, Type.prototype.isReservedId = function isReservedId(r) {
  3156. return e.isReservedId(this.reserved, r);
  3157. }, Type.prototype.isReservedName = function isReservedName(r) {
  3158. return e.isReservedName(this.reserved, r);
  3159. }, Type.prototype.create = function create(e) {
  3160. return new this.ctor(e);
  3161. }, Type.prototype.setup = function setup() {
  3162. for (var e = this.fullName, r = [], i = 0; i < this.fieldsArray.length; ++i) r.push(this._fieldsArray[i].resolve().resolvedType);
  3163. this.encode = h(this)({
  3164. Writer: l,
  3165. types: r,
  3166. util: f
  3167. }), this.decode = p(this)({
  3168. Reader: u,
  3169. types: r,
  3170. util: f
  3171. }), this.verify = c(this)({
  3172. types: r,
  3173. util: f
  3174. }), this.fromObject = d.fromObject(this)({
  3175. types: r,
  3176. util: f
  3177. }), this.toObject = d.toObject(this)({
  3178. types: r,
  3179. util: f
  3180. });
  3181. var n = g[e];
  3182. if (n) {
  3183. var o = Object.create(this);
  3184. o.fromObject = this.fromObject, this.fromObject = n.fromObject.bind(o), o.toObject = this.toObject,
  3185. this.toObject = n.toObject.bind(o);
  3186. }
  3187. return this;
  3188. }, Type.prototype.encode = function encode_setup(e, r) {
  3189. return this.setup().encode(e, r);
  3190. }, Type.prototype.encodeDelimited = function encodeDelimited(e, r) {
  3191. return this.encode(e, r && r.len ? r.fork() : r).ldelim();
  3192. }, Type.prototype.decode = function decode_setup(e, r) {
  3193. return this.setup().decode(e, r);
  3194. }, Type.prototype.decodeDelimited = function decodeDelimited(e) {
  3195. return e instanceof u || (e = u.create(e)), this.decode(e, e.uint32());
  3196. }, Type.prototype.verify = function verify_setup(e) {
  3197. return this.setup().verify(e);
  3198. }, Type.prototype.fromObject = function fromObject(e) {
  3199. return this.setup().fromObject(e);
  3200. }, Type.prototype.toObject = function toObject(e, r) {
  3201. return this.setup().toObject(e, r);
  3202. }, Type.d = function decorateType(e) {
  3203. return function typeDecorator(r) {
  3204. f.decorateType(r, e);
  3205. };
  3206. }, type;
  3207. }
  3208. function requireRoot() {
  3209. if (hasRequiredRoot) return root;
  3210. hasRequiredRoot = 1, root = Root;
  3211. var e = requireNamespace();
  3212. ((Root.prototype = Object.create(e.prototype)).constructor = Root).className = "Root";
  3213. var r, i, n, o = requireField(), s = require_enum(), a = requireOneof(), u = requireUtil();
  3214. function Root(r) {
  3215. e.call(this, "", r), this.deferred = [], this.files = [];
  3216. }
  3217. function SYNC() {}
  3218. Root.fromJSON = function fromJSON(e, r) {
  3219. return r || (r = new Root), e.options && r.setOptions(e.options), r.addJSON(e.nested);
  3220. }, Root.prototype.resolvePath = u.path.resolve, Root.prototype.fetch = u.fetch,
  3221. Root.prototype.load = function load(e, r, o) {
  3222. "function" == typeof r && (o = r, r = void 0);
  3223. var s = this;
  3224. if (!o) return u.asPromise(load, s, e, r);
  3225. var a = o === SYNC;
  3226. function finish(e, r) {
  3227. if (o) {
  3228. var i = o;
  3229. if (o = null, a) throw e;
  3230. i(e, r);
  3231. }
  3232. }
  3233. function getBundledFileName(e) {
  3234. var r = e.lastIndexOf("google/protobuf/");
  3235. if (r > -1) {
  3236. var i = e.substring(r);
  3237. if (i in n) return i;
  3238. }
  3239. return null;
  3240. }
  3241. function process(e, n) {
  3242. try {
  3243. if (u.isString(n) && "{" === n.charAt(0) && (n = JSON.parse(n)), u.isString(n)) {
  3244. i.filename = e;
  3245. var o, f = i(n, s, r), h = 0;
  3246. if (f.imports) for (;h < f.imports.length; ++h) (o = getBundledFileName(f.imports[h]) || s.resolvePath(e, f.imports[h])) && fetch(o);
  3247. if (f.weakImports) for (h = 0; h < f.weakImports.length; ++h) (o = getBundledFileName(f.weakImports[h]) || s.resolvePath(e, f.weakImports[h])) && fetch(o, !0);
  3248. } else s.setOptions(n.options).addJSON(n.nested);
  3249. } catch (e) {
  3250. finish(e);
  3251. }
  3252. a || l || finish(null, s);
  3253. }
  3254. function fetch(e, r) {
  3255. if (e = getBundledFileName(e) || e, !(s.files.indexOf(e) > -1)) if (s.files.push(e),
  3256. e in n) a ? process(e, n[e]) : (++l, setTimeout((function() {
  3257. --l, process(e, n[e]);
  3258. }))); else if (a) {
  3259. var i;
  3260. try {
  3261. i = u.fs.readFileSync(e).toString("utf8");
  3262. } catch (e) {
  3263. return void (r || finish(e));
  3264. }
  3265. process(e, i);
  3266. } else ++l, s.fetch(e, (function(i, n) {
  3267. --l, o && (i ? r ? l || finish(null, s) : finish(i) : process(e, n));
  3268. }));
  3269. }
  3270. var l = 0;
  3271. u.isString(e) && (e = [ e ]);
  3272. for (var f, h = 0; h < e.length; ++h) (f = s.resolvePath("", e[h])) && fetch(f);
  3273. if (a) return s;
  3274. l || finish(null, s);
  3275. }, Root.prototype.loadSync = function loadSync(e, r) {
  3276. if (!u.isNode) throw Error("not supported");
  3277. return this.load(e, r, SYNC);
  3278. }, Root.prototype.resolveAll = function resolveAll() {
  3279. if (this.deferred.length) throw Error("unresolvable extensions: " + this.deferred.map((function(e) {
  3280. return "'extend " + e.extend + "' in " + e.parent.fullName;
  3281. })).join(", "));
  3282. return e.prototype.resolveAll.call(this);
  3283. };
  3284. var l = /^[A-Z]/;
  3285. function tryHandleExtension(e, r) {
  3286. var i = r.parent.lookup(r.extend);
  3287. if (i) {
  3288. var n = new o(r.fullName, r.id, r.type, r.rule, void 0, r.options);
  3289. return i.get(n.name) || (n.declaringField = r, r.extensionField = n, i.add(n)),
  3290. !0;
  3291. }
  3292. return !1;
  3293. }
  3294. return Root.prototype._handleAdd = function _handleAdd(e) {
  3295. if (e instanceof o) void 0 === e.extend || e.extensionField || tryHandleExtension(0, e) || this.deferred.push(e); else if (e instanceof s) l.test(e.name) && (e.parent[e.name] = e.values); else if (!(e instanceof a)) {
  3296. if (e instanceof r) for (var i = 0; i < this.deferred.length; ) tryHandleExtension(0, this.deferred[i]) ? this.deferred.splice(i, 1) : ++i;
  3297. for (var n = 0; n < e.nestedArray.length; ++n) this._handleAdd(e._nestedArray[n]);
  3298. l.test(e.name) && (e.parent[e.name] = e);
  3299. }
  3300. }, Root.prototype._handleRemove = function _handleRemove(r) {
  3301. if (r instanceof o) {
  3302. if (void 0 !== r.extend) if (r.extensionField) r.extensionField.parent.remove(r.extensionField),
  3303. r.extensionField = null; else {
  3304. var i = this.deferred.indexOf(r);
  3305. i > -1 && this.deferred.splice(i, 1);
  3306. }
  3307. } else if (r instanceof s) l.test(r.name) && delete r.parent[r.name]; else if (r instanceof e) {
  3308. for (var n = 0; n < r.nestedArray.length; ++n) this._handleRemove(r._nestedArray[n]);
  3309. l.test(r.name) && delete r.parent[r.name];
  3310. }
  3311. }, Root._configure = function(e, o, s) {
  3312. r = e, i = o, n = s;
  3313. }, root;
  3314. }
  3315. function requireUtil() {
  3316. if (hasRequiredUtil) return util$2.exports;
  3317. hasRequiredUtil = 1;
  3318. var e, r, i = util$2.exports = requireMinimal(), n = roots;
  3319. i.codegen = codegen_1, i.fetch = fetch_1, i.path = path, i.fs = i.inquire("fs"),
  3320. i.toArray = function toArray(e) {
  3321. if (e) {
  3322. for (var r = Object.keys(e), i = new Array(r.length), n = 0; n < r.length; ) i[n] = e[r[n++]];
  3323. return i;
  3324. }
  3325. return [];
  3326. }, i.toObject = function toObject(e) {
  3327. for (var r = {}, i = 0; i < e.length; ) {
  3328. var n = e[i++], o = e[i++];
  3329. void 0 !== o && (r[n] = o);
  3330. }
  3331. return r;
  3332. };
  3333. var o = /\\/g, s = /"/g;
  3334. i.isReserved = function isReserved(e) {
  3335. 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(e);
  3336. }, i.safeProp = function safeProp(e) {
  3337. return !/^[$\w_]+$/.test(e) || i.isReserved(e) ? '["' + e.replace(o, "\\\\").replace(s, '\\"') + '"]' : "." + e;
  3338. }, i.ucFirst = function ucFirst(e) {
  3339. return e.charAt(0).toUpperCase() + e.substring(1);
  3340. };
  3341. var a = /_([a-z])/g;
  3342. i.camelCase = function camelCase(e) {
  3343. return e.substring(0, 1) + e.substring(1).replace(a, (function(e, r) {
  3344. return r.toUpperCase();
  3345. }));
  3346. }, i.compareFieldsById = function compareFieldsById(e, r) {
  3347. return e.id - r.id;
  3348. }, i.decorateType = function decorateType(r, n) {
  3349. if (r.$type) return n && r.$type.name !== n && (i.decorateRoot.remove(r.$type),
  3350. r.$type.name = n, i.decorateRoot.add(r.$type)), r.$type;
  3351. e || (e = requireType());
  3352. var o = new e(n || r.name);
  3353. return i.decorateRoot.add(o), o.ctor = r, Object.defineProperty(r, "$type", {
  3354. value: o,
  3355. enumerable: !1
  3356. }), Object.defineProperty(r.prototype, "$type", {
  3357. value: o,
  3358. enumerable: !1
  3359. }), o;
  3360. };
  3361. var u = 0;
  3362. return i.decorateEnum = function decorateEnum(e) {
  3363. if (e.$type) return e.$type;
  3364. r || (r = require_enum());
  3365. var n = new r("Enum" + u++, e);
  3366. return i.decorateRoot.add(n), Object.defineProperty(e, "$type", {
  3367. value: n,
  3368. enumerable: !1
  3369. }), n;
  3370. }, i.setProperty = function setProperty(e, r, i) {
  3371. if ("object" != typeof e) throw TypeError("dst must be an object");
  3372. if (!r) throw TypeError("path must be specified");
  3373. return function setProp(e, r, i) {
  3374. var n = r.shift();
  3375. if ("__proto__" === n) return e;
  3376. if (r.length > 0) e[n] = setProp(e[n] || {}, r, i); else {
  3377. var o = e[n];
  3378. o && (i = [].concat(o).concat(i)), e[n] = i;
  3379. }
  3380. return e;
  3381. }(e, r = r.split("."), i);
  3382. }, Object.defineProperty(i, "decorateRoot", {
  3383. get: function() {
  3384. return n.decorated || (n.decorated = new (requireRoot()));
  3385. }
  3386. }), util$2.exports;
  3387. }
  3388. function requireObject() {
  3389. if (hasRequiredObject) return object;
  3390. hasRequiredObject = 1, object = ReflectionObject, ReflectionObject.className = "ReflectionObject";
  3391. var e, r = requireUtil();
  3392. function ReflectionObject(e, i) {
  3393. if (!r.isString(e)) throw TypeError("name must be a string");
  3394. if (i && !r.isObject(i)) throw TypeError("options must be an object");
  3395. this.options = i, this.parsedOptions = null, this.name = e, this.parent = null,
  3396. this.resolved = !1, this.comment = null, this.filename = null;
  3397. }
  3398. return Object.defineProperties(ReflectionObject.prototype, {
  3399. root: {
  3400. get: function() {
  3401. for (var e = this; null !== e.parent; ) e = e.parent;
  3402. return e;
  3403. }
  3404. },
  3405. fullName: {
  3406. get: function() {
  3407. for (var e = [ this.name ], r = this.parent; r; ) e.unshift(r.name), r = r.parent;
  3408. return e.join(".");
  3409. }
  3410. }
  3411. }), ReflectionObject.prototype.toJSON = function toJSON() {
  3412. throw Error();
  3413. }, ReflectionObject.prototype.onAdd = function onAdd(r) {
  3414. this.parent && this.parent !== r && this.parent.remove(this), this.parent = r, this.resolved = !1;
  3415. var i = r.root;
  3416. i instanceof e && i._handleAdd(this);
  3417. }, ReflectionObject.prototype.onRemove = function onRemove(r) {
  3418. var i = r.root;
  3419. i instanceof e && i._handleRemove(this), this.parent = null, this.resolved = !1;
  3420. }, ReflectionObject.prototype.resolve = function resolve() {
  3421. return this.resolved || this.root instanceof e && (this.resolved = !0), this;
  3422. }, ReflectionObject.prototype.getOption = function getOption(e) {
  3423. if (this.options) return this.options[e];
  3424. }, ReflectionObject.prototype.setOption = function setOption(e, r, i) {
  3425. return i && this.options && void 0 !== this.options[e] || ((this.options || (this.options = {}))[e] = r),
  3426. this;
  3427. }, ReflectionObject.prototype.setParsedOption = function setParsedOption(e, i, n) {
  3428. this.parsedOptions || (this.parsedOptions = []);
  3429. var o = this.parsedOptions;
  3430. if (n) {
  3431. var s = o.find((function(r) {
  3432. return Object.prototype.hasOwnProperty.call(r, e);
  3433. }));
  3434. if (s) {
  3435. var a = s[e];
  3436. r.setProperty(a, n, i);
  3437. } else (s = {})[e] = r.setProperty({}, n, i), o.push(s);
  3438. } else {
  3439. var u = {};
  3440. u[e] = i, o.push(u);
  3441. }
  3442. return this;
  3443. }, ReflectionObject.prototype.setOptions = function setOptions(e, r) {
  3444. if (e) for (var i = Object.keys(e), n = 0; n < i.length; ++n) this.setOption(i[n], e[i[n]], r);
  3445. return this;
  3446. }, ReflectionObject.prototype.toString = function toString() {
  3447. var e = this.constructor.className, r = this.fullName;
  3448. return r.length ? e + " " + r : e;
  3449. }, ReflectionObject._configure = function(r) {
  3450. e = r;
  3451. }, object;
  3452. }
  3453. function require_enum() {
  3454. if (hasRequired_enum) return _enum;
  3455. hasRequired_enum = 1, _enum = Enum;
  3456. var e = requireObject();
  3457. ((Enum.prototype = Object.create(e.prototype)).constructor = Enum).className = "Enum";
  3458. var r = requireNamespace(), i = requireUtil();
  3459. function Enum(r, i, n, o, s, a) {
  3460. if (e.call(this, r, n), i && "object" != typeof i) throw TypeError("values must be an object");
  3461. if (this.valuesById = {}, this.values = Object.create(this.valuesById), this.comment = o,
  3462. this.comments = s || {}, this.valuesOptions = a, this.reserved = void 0, i) for (var u = Object.keys(i), l = 0; l < u.length; ++l) "number" == typeof i[u[l]] && (this.valuesById[this.values[u[l]] = i[u[l]]] = u[l]);
  3463. }
  3464. return Enum.fromJSON = function fromJSON(e, r) {
  3465. var i = new Enum(e, r.values, r.options, r.comment, r.comments);
  3466. return i.reserved = r.reserved, i;
  3467. }, Enum.prototype.toJSON = function toJSON(e) {
  3468. var r = !!e && Boolean(e.keepComments);
  3469. return i.toObject([ "options", this.options, "valuesOptions", this.valuesOptions, "values", this.values, "reserved", this.reserved && this.reserved.length ? this.reserved : void 0, "comment", r ? this.comment : void 0, "comments", r ? this.comments : void 0 ]);
  3470. }, Enum.prototype.add = function add(e, r, n, o) {
  3471. if (!i.isString(e)) throw TypeError("name must be a string");
  3472. if (!i.isInteger(r)) throw TypeError("id must be an integer");
  3473. if (void 0 !== this.values[e]) throw Error("duplicate name '" + e + "' in " + this);
  3474. if (this.isReservedId(r)) throw Error("id " + r + " is reserved in " + this);
  3475. if (this.isReservedName(e)) throw Error("name '" + e + "' is reserved in " + this);
  3476. if (void 0 !== this.valuesById[r]) {
  3477. if (!this.options || !this.options.allow_alias) throw Error("duplicate id " + r + " in " + this);
  3478. this.values[e] = r;
  3479. } else this.valuesById[this.values[e] = r] = e;
  3480. return o && (void 0 === this.valuesOptions && (this.valuesOptions = {}), this.valuesOptions[e] = o || null),
  3481. this.comments[e] = n || null, this;
  3482. }, Enum.prototype.remove = function remove(e) {
  3483. if (!i.isString(e)) throw TypeError("name must be a string");
  3484. var r = this.values[e];
  3485. if (null == r) throw Error("name '" + e + "' does not exist in " + this);
  3486. return delete this.valuesById[r], delete this.values[e], delete this.comments[e],
  3487. this.valuesOptions && delete this.valuesOptions[e], this;
  3488. }, Enum.prototype.isReservedId = function isReservedId(e) {
  3489. return r.isReservedId(this.reserved, e);
  3490. }, Enum.prototype.isReservedName = function isReservedName(e) {
  3491. return r.isReservedName(this.reserved, e);
  3492. }, _enum;
  3493. }
  3494. function requireEncoder() {
  3495. if (hasRequiredEncoder) return encoder_1;
  3496. hasRequiredEncoder = 1, encoder_1 = function encoder(n) {
  3497. for (var o, s = i.codegen([ "m", "w" ], n.name + "$encode")("if(!w)")("w=Writer.create()"), a = n.fieldsArray.slice().sort(i.compareFieldsById), u = 0; u < a.length; ++u) {
  3498. var l = a[u].resolve(), f = n._fieldsArray.indexOf(l), h = l.resolvedType instanceof e ? "int32" : l.type, p = r.basic[h];
  3499. o = "m" + i.safeProp(l.name), l.map ? (s("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){", o, l.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){", o)("w.uint32(%i).fork().uint32(%i).%s(ks[i])", (l.id << 3 | 2) >>> 0, 8 | r.mapKey[l.keyType], l.keyType),
  3500. void 0 === p ? s("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()", f, o) : s(".uint32(%i).%s(%s[ks[i]]).ldelim()", 16 | p, h, o),
  3501. s("}")("}")) : l.repeated ? (s("if(%s!=null&&%s.length){", o, o), l.packed && void 0 !== r.packed[h] ? s("w.uint32(%i).fork()", (l.id << 3 | 2) >>> 0)("for(var i=0;i<%s.length;++i)", o)("w.%s(%s[i])", h, o)("w.ldelim()") : (s("for(var i=0;i<%s.length;++i)", o),
  3502. void 0 === p ? genTypePartial(s, l, f, o + "[i]") : s("w.uint32(%i).%s(%s[i])", (l.id << 3 | p) >>> 0, h, o)),
  3503. s("}")) : (l.optional && s("if(%s!=null&&Object.hasOwnProperty.call(m,%j))", o, l.name),
  3504. void 0 === p ? genTypePartial(s, l, f, o) : s("w.uint32(%i).%s(%s)", (l.id << 3 | p) >>> 0, h, o));
  3505. }
  3506. return s("return w");
  3507. };
  3508. var e = require_enum(), r = requireTypes(), i = requireUtil();
  3509. function genTypePartial(e, r, i, n) {
  3510. return r.resolvedType.group ? e("types[%i].encode(%s,w.uint32(%i)).uint32(%i)", i, n, (r.id << 3 | 3) >>> 0, (r.id << 3 | 4) >>> 0) : e("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()", i, n, (r.id << 3 | 2) >>> 0);
  3511. }
  3512. return encoder_1;
  3513. }
  3514. !function(e) {
  3515. var r = message$1;
  3516. e[".google.protobuf.Any"] = {
  3517. fromObject: function(e) {
  3518. if (e && e["@type"]) {
  3519. var r = e["@type"].substring(e["@type"].lastIndexOf("/") + 1), i = this.lookup(r);
  3520. if (i) {
  3521. var n = "." === e["@type"].charAt(0) ? e["@type"].slice(1) : e["@type"];
  3522. return -1 === n.indexOf("/") && (n = "/" + n), this.create({
  3523. type_url: n,
  3524. value: i.encode(i.fromObject(e)).finish()
  3525. });
  3526. }
  3527. }
  3528. return this.fromObject(e);
  3529. },
  3530. toObject: function(e, i) {
  3531. var n = "", o = "";
  3532. if (i && i.json && e.type_url && e.value) {
  3533. o = e.type_url.substring(e.type_url.lastIndexOf("/") + 1), n = e.type_url.substring(0, e.type_url.lastIndexOf("/") + 1);
  3534. var s = this.lookup(o);
  3535. s && (e = s.decode(e.value));
  3536. }
  3537. if (!(e instanceof this.ctor) && e instanceof r) {
  3538. var a = e.$type.toObject(e, i);
  3539. return "" === n && (n = "type.googleapis.com/"), o = n + ("." === e.$type.fullName[0] ? e.$type.fullName.slice(1) : e.$type.fullName),
  3540. a["@type"] = o, a;
  3541. }
  3542. return this.toObject(e, i);
  3543. }
  3544. };
  3545. }(wrappers);
  3546. var protobuf$1 = indexLight.exports = indexMinimal;
  3547. function load(e, r, i) {
  3548. return "function" == typeof r ? (i = r, r = new protobuf$1.Root) : r || (r = new protobuf$1.Root),
  3549. r.load(e, i);
  3550. }
  3551. function loadSync(e, r) {
  3552. return r || (r = new protobuf$1.Root), r.loadSync(e);
  3553. }
  3554. protobuf$1.build = "light", protobuf$1.load = load, protobuf$1.loadSync = loadSync,
  3555. protobuf$1.encoder = requireEncoder(), protobuf$1.decoder = requireDecoder(), protobuf$1.verifier = requireVerifier(),
  3556. protobuf$1.converter = requireConverter(), protobuf$1.ReflectionObject = requireObject(),
  3557. protobuf$1.Namespace = requireNamespace(), protobuf$1.Root = requireRoot(), protobuf$1.Enum = require_enum(),
  3558. protobuf$1.Type = requireType(), protobuf$1.Field = requireField(), protobuf$1.OneOf = requireOneof(),
  3559. protobuf$1.MapField = requireMapfield(), protobuf$1.Service = requireService(),
  3560. protobuf$1.Method = requireMethod(), protobuf$1.Message = message$1, protobuf$1.wrappers = wrappers,
  3561. protobuf$1.types = requireTypes(), protobuf$1.util = requireUtil(), protobuf$1.ReflectionObject._configure(protobuf$1.Root),
  3562. protobuf$1.Namespace._configure(protobuf$1.Type, protobuf$1.Service, protobuf$1.Enum),
  3563. protobuf$1.Root._configure(protobuf$1.Type), protobuf$1.Field._configure(protobuf$1.Type);
  3564. var indexLightExports = indexLight.exports, tokenize_1 = tokenize$1, delimRe = /[\s{}=;:[\],'"()<>]/g, stringDoubleRe = /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g, stringSingleRe = /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g, setCommentRe = /^ *[*/]+ */, setCommentAltRe = /^\s*\*?\/*/, setCommentSplitRe = /\n/g, whitespaceRe = /\s/, unescapeRe = /\\(.?)/g, unescapeMap = {
  3565. 0: "\0",
  3566. r: "\r",
  3567. n: "\n",
  3568. t: "\t"
  3569. };
  3570. function unescape(e) {
  3571. return e.replace(unescapeRe, (function(e, r) {
  3572. switch (r) {
  3573. case "\\":
  3574. case "":
  3575. return r;
  3576.  
  3577. default:
  3578. return unescapeMap[r] || "";
  3579. }
  3580. }));
  3581. }
  3582. function tokenize$1(e, r) {
  3583. e = e.toString();
  3584. var i = 0, n = e.length, o = 1, s = 0, a = {}, u = [], l = null;
  3585. function illegal(e) {
  3586. return Error("illegal " + e + " (line " + o + ")");
  3587. }
  3588. function charAt(r) {
  3589. return e.charAt(r);
  3590. }
  3591. function setComment(i, n, u) {
  3592. var l, f = {
  3593. type: e.charAt(i++),
  3594. lineEmpty: !1,
  3595. leading: u
  3596. }, h = i - (r ? 2 : 3);
  3597. do {
  3598. if (--h < 0 || "\n" === (l = e.charAt(h))) {
  3599. f.lineEmpty = !0;
  3600. break;
  3601. }
  3602. } while (" " === l || "\t" === l);
  3603. for (var p = e.substring(i, n).split(setCommentSplitRe), c = 0; c < p.length; ++c) p[c] = p[c].replace(r ? setCommentAltRe : setCommentRe, "").trim();
  3604. f.text = p.join("\n").trim(), a[o] = f, s = o;
  3605. }
  3606. function isDoubleSlashCommentLine(r) {
  3607. var i = findEndOfLine(r), n = e.substring(r, i);
  3608. return /^\s*\/{1,2}/.test(n);
  3609. }
  3610. function findEndOfLine(e) {
  3611. for (var r = e; r < n && "\n" !== charAt(r); ) r++;
  3612. return r;
  3613. }
  3614. function next() {
  3615. if (u.length > 0) return u.shift();
  3616. if (l) return function readString() {
  3617. var r = "'" === l ? stringSingleRe : stringDoubleRe;
  3618. r.lastIndex = i - 1;
  3619. var n = r.exec(e);
  3620. if (!n) throw illegal("string");
  3621. return i = r.lastIndex, push(l), l = null, unescape(n[1]);
  3622. }();
  3623. var s, a, f, h, p, c = 0 === i;
  3624. do {
  3625. if (i === n) return null;
  3626. for (s = !1; whitespaceRe.test(f = charAt(i)); ) if ("\n" === f && (c = !0, ++o),
  3627. ++i === n) return null;
  3628. if ("/" === charAt(i)) {
  3629. if (++i === n) throw illegal("comment");
  3630. if ("/" === charAt(i)) if (r) {
  3631. if (h = i, p = !1, isDoubleSlashCommentLine(i)) {
  3632. p = !0;
  3633. do {
  3634. if ((i = findEndOfLine(i)) === n) break;
  3635. if (i++, !c) break;
  3636. } while (isDoubleSlashCommentLine(i));
  3637. } else i = Math.min(n, findEndOfLine(i) + 1);
  3638. p && (setComment(h, i, c), c = !0), o++, s = !0;
  3639. } else {
  3640. for (p = "/" === charAt(h = i + 1); "\n" !== charAt(++i); ) if (i === n) return null;
  3641. ++i, p && (setComment(h, i - 1, c), c = !0), ++o, s = !0;
  3642. } else {
  3643. if ("*" !== (f = charAt(i))) return "/";
  3644. h = i + 1, p = r || "*" === charAt(h);
  3645. do {
  3646. if ("\n" === f && ++o, ++i === n) throw illegal("comment");
  3647. a = f, f = charAt(i);
  3648. } while ("*" !== a || "/" !== f);
  3649. ++i, p && (setComment(h, i - 2, c), c = !0), s = !0;
  3650. }
  3651. }
  3652. } while (s);
  3653. var d = i;
  3654. if (delimRe.lastIndex = 0, !delimRe.test(charAt(d++))) for (;d < n && !delimRe.test(charAt(d)); ) ++d;
  3655. var g = e.substring(i, i = d);
  3656. return '"' !== g && "'" !== g || (l = g), g;
  3657. }
  3658. function push(e) {
  3659. u.push(e);
  3660. }
  3661. function peek() {
  3662. if (!u.length) {
  3663. var e = next();
  3664. if (null === e) return null;
  3665. push(e);
  3666. }
  3667. return u[0];
  3668. }
  3669. return Object.defineProperty({
  3670. next,
  3671. peek,
  3672. push,
  3673. skip: function skip(e, r) {
  3674. var i = peek();
  3675. if (i === e) return next(), !0;
  3676. if (!r) throw illegal("token '" + i + "', '" + e + "' expected");
  3677. return !1;
  3678. },
  3679. cmnt: function cmnt(e) {
  3680. var i, n = null;
  3681. return void 0 === e ? (i = a[o - 1], delete a[o - 1], i && (r || "*" === i.type || i.lineEmpty) && (n = i.leading ? i.text : null)) : (s < e && peek(),
  3682. i = a[e], delete a[e], !i || i.lineEmpty || !r && "/" !== i.type || (n = i.leading ? null : i.text)),
  3683. n;
  3684. }
  3685. }, "line", {
  3686. get: function() {
  3687. return o;
  3688. }
  3689. });
  3690. }
  3691. tokenize$1.unescape = unescape;
  3692. var parse_1 = parse;
  3693. parse.filename = null, parse.defaults = {
  3694. keepCase: !1
  3695. };
  3696. 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]*)+$/;
  3697. function parse(e, r, i) {
  3698. r instanceof Root || (i = r, r = new Root), i || (i = parse.defaults);
  3699. var n, o, s, a, u, l = i.preferTrailingComment || !1, f = tokenize(e, i.alternateCommentMode || !1), h = f.next, p = f.push, c = f.peek, d = f.skip, g = f.cmnt, m = !0, y = !1, v = r, b = i.keepCase ? function(e) {
  3700. return e;
  3701. } : util.camelCase;
  3702. function illegal(e, r, i) {
  3703. var n = parse.filename;
  3704. return i || (parse.filename = null), Error("illegal " + (r || "token") + " '" + e + "' (" + (n ? n + ", " : "") + "line " + f.line + ")");
  3705. }
  3706. function readString() {
  3707. var e, r = [];
  3708. do {
  3709. if ('"' !== (e = h()) && "'" !== e) throw illegal(e);
  3710. r.push(h()), d(e), e = c();
  3711. } while ('"' === e || "'" === e);
  3712. return r.join("");
  3713. }
  3714. function readValue(e) {
  3715. var r = h();
  3716. switch (r) {
  3717. case "'":
  3718. case '"':
  3719. return p(r), readString();
  3720.  
  3721. case "true":
  3722. case "TRUE":
  3723. return !0;
  3724.  
  3725. case "false":
  3726. case "FALSE":
  3727. return !1;
  3728. }
  3729. try {
  3730. return function parseNumber(e, r) {
  3731. var i = 1;
  3732. "-" === e.charAt(0) && (i = -1, e = e.substring(1));
  3733. switch (e) {
  3734. case "inf":
  3735. case "INF":
  3736. case "Inf":
  3737. return i * (1 / 0);
  3738.  
  3739. case "nan":
  3740. case "NAN":
  3741. case "Nan":
  3742. case "NaN":
  3743. return NaN;
  3744.  
  3745. case "0":
  3746. return 0;
  3747. }
  3748. if (base10Re.test(e)) return i * parseInt(e, 10);
  3749. if (base16Re.test(e)) return i * parseInt(e, 16);
  3750. if (base8Re.test(e)) return i * parseInt(e, 8);
  3751. if (numberRe.test(e)) return i * parseFloat(e);
  3752. throw illegal(e, "number", r);
  3753. }(r, !0);
  3754. } catch (i) {
  3755. if (e && typeRefRe.test(r)) return r;
  3756. throw illegal(r, "value");
  3757. }
  3758. }
  3759. function readRanges(e, r) {
  3760. var i, n;
  3761. do {
  3762. !r || '"' !== (i = c()) && "'" !== i ? e.push([ n = parseId(h()), d("to", !0) ? parseId(h()) : n ]) : e.push(readString());
  3763. } while (d(",", !0));
  3764. d(";");
  3765. }
  3766. function parseId(e, r) {
  3767. switch (e) {
  3768. case "max":
  3769. case "MAX":
  3770. case "Max":
  3771. return 536870911;
  3772.  
  3773. case "0":
  3774. return 0;
  3775. }
  3776. if (!r && "-" === e.charAt(0)) throw illegal(e, "id");
  3777. if (base10NegRe.test(e)) return parseInt(e, 10);
  3778. if (base16NegRe.test(e)) return parseInt(e, 16);
  3779. if (base8NegRe.test(e)) return parseInt(e, 8);
  3780. throw illegal(e, "id");
  3781. }
  3782. function parsePackage() {
  3783. if (void 0 !== n) throw illegal("package");
  3784. if (n = h(), !typeRefRe.test(n)) throw illegal(n, "name");
  3785. v = v.define(n), d(";");
  3786. }
  3787. function parseImport() {
  3788. var e, r = c();
  3789. switch (r) {
  3790. case "weak":
  3791. e = s || (s = []), h();
  3792. break;
  3793.  
  3794. case "public":
  3795. h();
  3796.  
  3797. default:
  3798. e = o || (o = []);
  3799. }
  3800. r = readString(), d(";"), e.push(r);
  3801. }
  3802. function parseSyntax() {
  3803. if (d("="), a = readString(), !(y = "proto3" === a) && "proto2" !== a) throw illegal(a, "syntax");
  3804. d(";");
  3805. }
  3806. function parseCommon(e, r) {
  3807. switch (r) {
  3808. case "option":
  3809. return parseOption(e, r), d(";"), !0;
  3810.  
  3811. case "message":
  3812. return parseType(e, r), !0;
  3813.  
  3814. case "enum":
  3815. return parseEnum(e, r), !0;
  3816.  
  3817. case "service":
  3818. return function parseService(e, r) {
  3819. if (!nameRe.test(r = h())) throw illegal(r, "service name");
  3820. var i = new Service(r);
  3821. ifBlock(i, (function parseService_block(e) {
  3822. if (!parseCommon(i, e)) {
  3823. if ("rpc" !== e) throw illegal(e);
  3824. !function parseMethod(e, r) {
  3825. var i = g(), n = r;
  3826. if (!nameRe.test(r = h())) throw illegal(r, "name");
  3827. var o, s, a, u, l = r;
  3828. d("("), d("stream", !0) && (s = !0);
  3829. if (!typeRefRe.test(r = h())) throw illegal(r);
  3830. o = r, d(")"), d("returns"), d("("), d("stream", !0) && (u = !0);
  3831. if (!typeRefRe.test(r = h())) throw illegal(r);
  3832. a = r, d(")");
  3833. var f = new Method(l, n, o, a, s, u);
  3834. f.comment = i, ifBlock(f, (function parseMethod_block(e) {
  3835. if ("option" !== e) throw illegal(e);
  3836. parseOption(f, e), d(";");
  3837. })), e.add(f);
  3838. }(i, e);
  3839. }
  3840. })), e.add(i);
  3841. }(e, r), !0;
  3842.  
  3843. case "extend":
  3844. return function parseExtension(e, r) {
  3845. if (!typeRefRe.test(r = h())) throw illegal(r, "reference");
  3846. var i = r;
  3847. ifBlock(null, (function parseExtension_block(r) {
  3848. switch (r) {
  3849. case "required":
  3850. case "repeated":
  3851. parseField(e, r, i);
  3852. break;
  3853.  
  3854. case "optional":
  3855. parseField(e, y ? "proto3_optional" : "optional", i);
  3856. break;
  3857.  
  3858. default:
  3859. if (!y || !typeRefRe.test(r)) throw illegal(r);
  3860. p(r), parseField(e, "optional", i);
  3861. }
  3862. }));
  3863. }(e, r), !0;
  3864. }
  3865. return !1;
  3866. }
  3867. function ifBlock(e, r, i) {
  3868. var n = f.line;
  3869. if (e && ("string" != typeof e.comment && (e.comment = g()), e.filename = parse.filename),
  3870. d("{", !0)) {
  3871. for (var o; "}" !== (o = h()); ) r(o);
  3872. d(";", !0);
  3873. } else i && i(), d(";"), e && ("string" != typeof e.comment || l) && (e.comment = g(n) || e.comment);
  3874. }
  3875. function parseType(e, r) {
  3876. if (!nameRe.test(r = h())) throw illegal(r, "type name");
  3877. var i = new Type(r);
  3878. ifBlock(i, (function parseType_block(e) {
  3879. if (!parseCommon(i, e)) switch (e) {
  3880. case "map":
  3881. !function parseMapField(e) {
  3882. d("<");
  3883. var r = h();
  3884. if (void 0 === types.mapKey[r]) throw illegal(r, "type");
  3885. d(",");
  3886. var i = h();
  3887. if (!typeRefRe.test(i)) throw illegal(i, "type");
  3888. d(">");
  3889. var n = h();
  3890. if (!nameRe.test(n)) throw illegal(n, "name");
  3891. d("=");
  3892. var o = new MapField(b(n), parseId(h()), r, i);
  3893. ifBlock(o, (function parseMapField_block(e) {
  3894. if ("option" !== e) throw illegal(e);
  3895. parseOption(o, e), d(";");
  3896. }), (function parseMapField_line() {
  3897. parseInlineOptions(o);
  3898. })), e.add(o);
  3899. }(i);
  3900. break;
  3901.  
  3902. case "required":
  3903. case "repeated":
  3904. parseField(i, e);
  3905. break;
  3906.  
  3907. case "optional":
  3908. parseField(i, y ? "proto3_optional" : "optional");
  3909. break;
  3910.  
  3911. case "oneof":
  3912. !function parseOneOf(e, r) {
  3913. if (!nameRe.test(r = h())) throw illegal(r, "name");
  3914. var i = new OneOf(b(r));
  3915. ifBlock(i, (function parseOneOf_block(e) {
  3916. "option" === e ? (parseOption(i, e), d(";")) : (p(e), parseField(i, "optional"));
  3917. })), e.add(i);
  3918. }(i, e);
  3919. break;
  3920.  
  3921. case "extensions":
  3922. readRanges(i.extensions || (i.extensions = []));
  3923. break;
  3924.  
  3925. case "reserved":
  3926. readRanges(i.reserved || (i.reserved = []), !0);
  3927. break;
  3928.  
  3929. default:
  3930. if (!y || !typeRefRe.test(e)) throw illegal(e);
  3931. p(e), parseField(i, "optional");
  3932. }
  3933. })), e.add(i);
  3934. }
  3935. function parseField(e, r, i) {
  3936. var n = h();
  3937. if ("group" !== n) {
  3938. for (;n.endsWith(".") || c().startsWith("."); ) n += h();
  3939. if (!typeRefRe.test(n)) throw illegal(n, "type");
  3940. var o = h();
  3941. if (!nameRe.test(o)) throw illegal(o, "name");
  3942. o = b(o), d("=");
  3943. var s = new Field(o, parseId(h()), n, r, i);
  3944. if (ifBlock(s, (function parseField_block(e) {
  3945. if ("option" !== e) throw illegal(e);
  3946. parseOption(s, e), d(";");
  3947. }), (function parseField_line() {
  3948. parseInlineOptions(s);
  3949. })), "proto3_optional" === r) {
  3950. var a = new OneOf("_" + o);
  3951. s.setOption("proto3_optional", !0), a.add(s), e.add(a);
  3952. } else e.add(s);
  3953. y || !s.repeated || void 0 === types.packed[n] && void 0 !== types.basic[n] || s.setOption("packed", !1, !0);
  3954. } else (function parseGroup(e, r) {
  3955. var i = h();
  3956. if (!nameRe.test(i)) throw illegal(i, "name");
  3957. var n = util.lcFirst(i);
  3958. i === n && (i = util.ucFirst(i));
  3959. d("=");
  3960. var o = parseId(h()), s = new Type(i);
  3961. s.group = !0;
  3962. var a = new Field(n, o, i, r);
  3963. a.filename = parse.filename, ifBlock(s, (function parseGroup_block(e) {
  3964. switch (e) {
  3965. case "option":
  3966. parseOption(s, e), d(";");
  3967. break;
  3968.  
  3969. case "required":
  3970. case "repeated":
  3971. parseField(s, e);
  3972. break;
  3973.  
  3974. case "optional":
  3975. parseField(s, y ? "proto3_optional" : "optional");
  3976. break;
  3977.  
  3978. case "message":
  3979. parseType(s, e);
  3980. break;
  3981.  
  3982. case "enum":
  3983. parseEnum(s, e);
  3984. break;
  3985.  
  3986. default:
  3987. throw illegal(e);
  3988. }
  3989. })), e.add(s).add(a);
  3990. })(e, r);
  3991. }
  3992. function parseEnum(e, r) {
  3993. if (!nameRe.test(r = h())) throw illegal(r, "name");
  3994. var i = new Enum(r);
  3995. ifBlock(i, (function parseEnum_block(e) {
  3996. switch (e) {
  3997. case "option":
  3998. parseOption(i, e), d(";");
  3999. break;
  4000.  
  4001. case "reserved":
  4002. readRanges(i.reserved || (i.reserved = []), !0);
  4003. break;
  4004.  
  4005. default:
  4006. !function parseEnumValue(e, r) {
  4007. if (!nameRe.test(r)) throw illegal(r, "name");
  4008. d("=");
  4009. var i = parseId(h(), !0), n = {
  4010. options: void 0,
  4011. setOption: function(e, r) {
  4012. void 0 === this.options && (this.options = {}), this.options[e] = r;
  4013. }
  4014. };
  4015. ifBlock(n, (function parseEnumValue_block(e) {
  4016. if ("option" !== e) throw illegal(e);
  4017. parseOption(n, e), d(";");
  4018. }), (function parseEnumValue_line() {
  4019. parseInlineOptions(n);
  4020. })), e.add(r, i, n.comment, n.options);
  4021. }(i, e);
  4022. }
  4023. })), e.add(i);
  4024. }
  4025. function parseOption(e, r) {
  4026. var i = d("(", !0);
  4027. if (!typeRefRe.test(r = h())) throw illegal(r, "name");
  4028. var n, o = r, s = o;
  4029. i && (d(")"), s = o = "(" + o + ")", r = c(), fqTypeRefRe.test(r) && (n = r.slice(1),
  4030. o += r, h())), d("="), function setParsedOption(e, r, i, n) {
  4031. e.setParsedOption && e.setParsedOption(r, i, n);
  4032. }(e, s, parseOptionValue(e, o), n);
  4033. }
  4034. function parseOptionValue(e, r) {
  4035. if (d("{", !0)) {
  4036. for (var i = {}; !d("}", !0); ) {
  4037. if (!nameRe.test(u = h())) throw illegal(u, "name");
  4038. var n, o = u;
  4039. if (d(":", !0), "{" === c()) n = parseOptionValue(e, r + "." + u); else if ("[" === c()) {
  4040. var s;
  4041. if (n = [], d("[", !0)) {
  4042. do {
  4043. s = readValue(!0), n.push(s);
  4044. } while (d(",", !0));
  4045. d("]"), void 0 !== s && setOption(e, r + "." + u, s);
  4046. }
  4047. } else n = readValue(!0), setOption(e, r + "." + u, n);
  4048. var a = i[o];
  4049. a && (n = [].concat(a).concat(n)), i[o] = n, d(",", !0), d(";", !0);
  4050. }
  4051. return i;
  4052. }
  4053. var l = readValue(!0);
  4054. return setOption(e, r, l), l;
  4055. }
  4056. function setOption(e, r, i) {
  4057. e.setOption && e.setOption(r, i);
  4058. }
  4059. function parseInlineOptions(e) {
  4060. if (d("[", !0)) {
  4061. do {
  4062. parseOption(e, "option");
  4063. } while (d(",", !0));
  4064. d("]");
  4065. }
  4066. return e;
  4067. }
  4068. for (;null !== (u = h()); ) switch (u) {
  4069. case "package":
  4070. if (!m) throw illegal(u);
  4071. parsePackage();
  4072. break;
  4073.  
  4074. case "import":
  4075. if (!m) throw illegal(u);
  4076. parseImport();
  4077. break;
  4078.  
  4079. case "syntax":
  4080. if (!m) throw illegal(u);
  4081. parseSyntax();
  4082. break;
  4083.  
  4084. case "option":
  4085. parseOption(v, u), d(";");
  4086. break;
  4087.  
  4088. default:
  4089. if (parseCommon(v, u)) {
  4090. m = !1;
  4091. continue;
  4092. }
  4093. throw illegal(u);
  4094. }
  4095. return parse.filename = null, {
  4096. package: n,
  4097. imports: o,
  4098. weakImports: s,
  4099. syntax: a,
  4100. root: r
  4101. };
  4102. }
  4103. var common_1 = common, commonRe = /\/|\./, timeType;
  4104. function common(e, r) {
  4105. commonRe.test(e) || (e = "google/protobuf/" + e + ".proto", r = {
  4106. nested: {
  4107. google: {
  4108. nested: {
  4109. protobuf: {
  4110. nested: r
  4111. }
  4112. }
  4113. }
  4114. }
  4115. }), common[e] = r;
  4116. }
  4117. common("any", {
  4118. Any: {
  4119. fields: {
  4120. type_url: {
  4121. type: "string",
  4122. id: 1
  4123. },
  4124. value: {
  4125. type: "bytes",
  4126. id: 2
  4127. }
  4128. }
  4129. }
  4130. }), common("duration", {
  4131. Duration: timeType = {
  4132. fields: {
  4133. seconds: {
  4134. type: "int64",
  4135. id: 1
  4136. },
  4137. nanos: {
  4138. type: "int32",
  4139. id: 2
  4140. }
  4141. }
  4142. }
  4143. }), common("timestamp", {
  4144. Timestamp: timeType
  4145. }), common("empty", {
  4146. Empty: {
  4147. fields: {}
  4148. }
  4149. }), common("struct", {
  4150. Struct: {
  4151. fields: {
  4152. fields: {
  4153. keyType: "string",
  4154. type: "Value",
  4155. id: 1
  4156. }
  4157. }
  4158. },
  4159. Value: {
  4160. oneofs: {
  4161. kind: {
  4162. oneof: [ "nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue" ]
  4163. }
  4164. },
  4165. fields: {
  4166. nullValue: {
  4167. type: "NullValue",
  4168. id: 1
  4169. },
  4170. numberValue: {
  4171. type: "double",
  4172. id: 2
  4173. },
  4174. stringValue: {
  4175. type: "string",
  4176. id: 3
  4177. },
  4178. boolValue: {
  4179. type: "bool",
  4180. id: 4
  4181. },
  4182. structValue: {
  4183. type: "Struct",
  4184. id: 5
  4185. },
  4186. listValue: {
  4187. type: "ListValue",
  4188. id: 6
  4189. }
  4190. }
  4191. },
  4192. NullValue: {
  4193. values: {
  4194. NULL_VALUE: 0
  4195. }
  4196. },
  4197. ListValue: {
  4198. fields: {
  4199. values: {
  4200. rule: "repeated",
  4201. type: "Value",
  4202. id: 1
  4203. }
  4204. }
  4205. }
  4206. }), common("wrappers", {
  4207. DoubleValue: {
  4208. fields: {
  4209. value: {
  4210. type: "double",
  4211. id: 1
  4212. }
  4213. }
  4214. },
  4215. FloatValue: {
  4216. fields: {
  4217. value: {
  4218. type: "float",
  4219. id: 1
  4220. }
  4221. }
  4222. },
  4223. Int64Value: {
  4224. fields: {
  4225. value: {
  4226. type: "int64",
  4227. id: 1
  4228. }
  4229. }
  4230. },
  4231. UInt64Value: {
  4232. fields: {
  4233. value: {
  4234. type: "uint64",
  4235. id: 1
  4236. }
  4237. }
  4238. },
  4239. Int32Value: {
  4240. fields: {
  4241. value: {
  4242. type: "int32",
  4243. id: 1
  4244. }
  4245. }
  4246. },
  4247. UInt32Value: {
  4248. fields: {
  4249. value: {
  4250. type: "uint32",
  4251. id: 1
  4252. }
  4253. }
  4254. },
  4255. BoolValue: {
  4256. fields: {
  4257. value: {
  4258. type: "bool",
  4259. id: 1
  4260. }
  4261. }
  4262. },
  4263. StringValue: {
  4264. fields: {
  4265. value: {
  4266. type: "string",
  4267. id: 1
  4268. }
  4269. }
  4270. },
  4271. BytesValue: {
  4272. fields: {
  4273. value: {
  4274. type: "bytes",
  4275. id: 1
  4276. }
  4277. }
  4278. }
  4279. }), common("field_mask", {
  4280. FieldMask: {
  4281. fields: {
  4282. paths: {
  4283. rule: "repeated",
  4284. type: "string",
  4285. id: 1
  4286. }
  4287. }
  4288. }
  4289. }), common.get = function get(e) {
  4290. return common[e] || null;
  4291. };
  4292. var protobuf = src.exports = indexLightExports;
  4293. protobuf.build = "full", protobuf.tokenize = tokenize_1, protobuf.parse = parse_1,
  4294. protobuf.common = common_1, protobuf.Root._configure(protobuf.Type, protobuf.parse, protobuf.common);
  4295. var srcExports = src.exports, protobufjs = srcExports;
  4296. const V4_PRIVATE_KEY = "MIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBAK8nNR1lTnIfIes6oRWJNj3mB6OssDGx0uGMpgpbVCpf6+VwnuI2stmhZNoQcM417Iz7WqlPzbUmu9R4dEKmLGEEqOhOdVaeh9Xk2IPPjqIu5TbkLZRxkY3dJM1htbz57d/roesJLkZXqssfG5EJauNc+RcABTfLb4IiFjSMlTsnAgMBAAECgYEAiz/pi2hKOJKlvcTL4jpHJGjn8+lL3wZX+LeAHkXDoTjHa47g0knYYQteCbv+YwMeAGupBWiLy5RyyhXFoGNKbbnvftMYK56hH+iqxjtDLnjSDKWnhcB7089sNKaEM9Ilil6uxWMrMMBH9v2PLdYsqMBHqPutKu/SigeGPeiB7VECQQDizVlNv67go99QAIv2n/ga4e0wLizVuaNBXE88AdOnaZ0LOTeniVEqvPtgUk63zbjl0P/pzQzyjitwe6HoCAIpAkEAxbOtnCm1uKEp5HsNaXEJTwE7WQf7PrLD4+BpGtNKkgja6f6F4ld4QZ2TQ6qvsCizSGJrjOpNdjVGJ7bgYMcczwJBALvJWPLmDi7ToFfGTB0EsNHZVKE66kZ/8Stx+ezueke4S556XplqOflQBjbnj2PigwBN/0afT+QZUOBOjWzoDJkCQClzo+oDQMvGVs9GEajS/32mJ3hiWQZrWvEzgzYRqSf3XVcEe7PaXSd8z3y3lACeeACsShqQoc8wGlaHXIJOHTcCQQCZw5127ZGs8ZDTSrogrH73Kw/HvX55wGAeirKYcv28eauveCG7iyFR0PFB/P/EDZnyb+ifvyEFlucPUI0+Y87F", ComicDetailInfoProto = {
  4297. nested: {
  4298. proto: {
  4299. fields: {
  4300. comicInfo: {
  4301. type: "ComicInfo",
  4302. id: 3
  4303. }
  4304. }
  4305. },
  4306. ComicInfo: {
  4307. fields: {
  4308. id: {
  4309. type: "int64",
  4310. id: 1
  4311. },
  4312. title: {
  4313. type: "string",
  4314. id: 2
  4315. },
  4316. direction: {
  4317. type: "int64",
  4318. id: 3
  4319. },
  4320. islong: {
  4321. type: "int64",
  4322. id: 4
  4323. },
  4324. cover: {
  4325. type: "string",
  4326. id: 6
  4327. },
  4328. description: {
  4329. type: "string",
  4330. id: 7
  4331. },
  4332. last_updatetime: {
  4333. type: "int64",
  4334. id: 8
  4335. },
  4336. last_update_chapter_name: {
  4337. type: "string",
  4338. id: 9
  4339. },
  4340. first_letter: {
  4341. type: "string",
  4342. id: 11
  4343. },
  4344. comic_py: {
  4345. type: "string",
  4346. id: 12
  4347. },
  4348. hidden: {
  4349. type: "int64",
  4350. id: 13
  4351. },
  4352. hot_num: {
  4353. type: "int64",
  4354. id: 14
  4355. },
  4356. hit_num: {
  4357. type: "int64",
  4358. id: 15
  4359. },
  4360. last_update_chapter_id: {
  4361. type: "int64",
  4362. id: 18
  4363. },
  4364. types: {
  4365. type: "Types",
  4366. id: 19,
  4367. rule: "repeated"
  4368. },
  4369. status: {
  4370. type: "Status",
  4371. id: 20
  4372. },
  4373. authors: {
  4374. type: "Authors",
  4375. id: 21,
  4376. rule: "repeated"
  4377. },
  4378. subscribe_num: {
  4379. type: "int64",
  4380. id: 22
  4381. },
  4382. chapters: {
  4383. type: "Chapters",
  4384. id: 23,
  4385. rule: "repeated"
  4386. },
  4387. is_need_login: {
  4388. type: "int64",
  4389. id: 24
  4390. },
  4391. dh_url_links: {
  4392. type: "DhUrlLink",
  4393. id: 27,
  4394. rule: "repeated"
  4395. }
  4396. }
  4397. },
  4398. Types: {
  4399. fields: {
  4400. tag_id: {
  4401. type: "int64",
  4402. id: 1
  4403. },
  4404. tag_name: {
  4405. type: "string",
  4406. id: 2
  4407. }
  4408. }
  4409. },
  4410. Status: {
  4411. fields: {
  4412. tag_id: {
  4413. type: "int64",
  4414. id: 1
  4415. },
  4416. tag_name: {
  4417. type: "string",
  4418. id: 2
  4419. }
  4420. }
  4421. },
  4422. Authors: {
  4423. fields: {
  4424. tag_id: {
  4425. type: "int64",
  4426. id: 1
  4427. },
  4428. tag_name: {
  4429. type: "string",
  4430. id: 2
  4431. }
  4432. }
  4433. },
  4434. Data: {
  4435. fields: {
  4436. chapter_id: {
  4437. type: "int64",
  4438. id: 1
  4439. },
  4440. chapter_title: {
  4441. type: "string",
  4442. id: 2
  4443. },
  4444. updatetime: {
  4445. type: "int64",
  4446. id: 3
  4447. },
  4448. filesize: {
  4449. type: "int64",
  4450. id: 4
  4451. },
  4452. chapter_order: {
  4453. type: "int64",
  4454. id: 5
  4455. }
  4456. }
  4457. },
  4458. Chapters: {
  4459. fields: {
  4460. title: {
  4461. type: "string",
  4462. id: 1
  4463. },
  4464. data: {
  4465. type: "Data",
  4466. id: 2,
  4467. rule: "repeated"
  4468. }
  4469. }
  4470. },
  4471. DhUrlLink: {
  4472. fields: {
  4473. title: {
  4474. type: "string",
  4475. id: 1
  4476. }
  4477. }
  4478. }
  4479. }
  4480. }, key = new JSEncryptRSAKey(V4_PRIVATE_KEY), message = protobufjs.Root.fromJSON(ComicDetailInfoProto).lookupType("proto"), base64ToArrayBuffer = e => {
  4481. const r = window.atob(e), i = new Uint8Array(r.length);
  4482. for (let e = 0; e < r.length; e++) i[e] = r.charCodeAt(e);
  4483. return i;
  4484. }, arrayBufferToBase64 = e => {
  4485. let r = "";
  4486. const i = new Uint8Array(e), n = i.byteLength;
  4487. for (let e = 0; e < n; e++) r += String.fromCharCode(i[e]);
  4488. return window.btoa(r);
  4489. }, pkcs1unpad2 = (e, r) => {
  4490. const i = e.toByteArray();
  4491. let n = 0;
  4492. for (;n < i.length && 0 === i[n]; ) ++n;
  4493. if (i.length - n != r - 1 || 2 !== i[n]) return null;
  4494. for (++n; 0 !== i[n]; ) if (++n >= i.length) return null;
  4495. const o = [];
  4496. for (;++n < i.length; ) o.push(i[n]);
  4497. return o;
  4498. }, customDecrypt = e => {
  4499. const r = parseBigInt(e, 16), i = key.doPrivate(r);
  4500. return null == i ? null : pkcs1unpad2(i, key.n.bitLength() + 7 >> 3);
  4501. }, utilsDmzjDecrypt = e => {
  4502. const r = base64ToArrayBuffer(e), {length: i} = r;
  4503. let n = 0, o = 0, s = [];
  4504. for (;i - n > 0; ) s = s.concat(customDecrypt(b64tohex(arrayBufferToBase64(r.slice(n, n + 128))))),
  4505. o++, n = 128 * o;
  4506. return Uint8Array.from(s);
  4507. }, dmzjDecrypt = e => {
  4508. const r = utilsDmzjDecrypt(e);
  4509. return message.decode(r);
  4510. };
  4511. return dmzjDecrypt;
  4512. }));