ss-component-new 1.3.614 → 1.3.615
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/JSEncrypt-B36c1iN5.js +1983 -0
- package/dist/{MTLLoader-B6ottYFV.js → MTLLoader-BL2uYkTJ.js} +2 -2
- package/dist/{OrbitControls-BFVKU7s-.js → OrbitControls-Zyj23qrC.js} +1 -1
- package/dist/{URDFLoader-CH-7Pzmq.js → URDFLoader-CRx5L75v.js} +584 -589
- package/dist/{animationData-F0z3GN7j.js → animationData-CJQE6_nu.js} +3 -3
- package/dist/{array-DZZ1aQEC.js → array-CKTk7Sq_.js} +14 -13
- package/dist/{clone-MyfSNInd.js → clone-ESeDvnJv.js} +1 -1
- package/dist/{eleIcon-BoKZ_PzU.js → eleIcon-C7Pz9jha.js} +2 -2
- package/dist/{iconfont-BJYdStg5.js → iconfont-DZGSkx-_.js} +247 -396
- package/dist/{index-CbFYfzNE.js → index--FPbFJB2.js} +6 -6
- package/dist/{index-DJrzqi4-.js → index-11kpzK0A.js} +17 -17
- package/dist/{index-BvtOLltL.js → index-B0M1YCUY.js} +7 -7
- package/dist/{index-aTEfnfYn.js → index-BA1kJZth.js} +40 -36
- package/dist/{index-CT1LWsrT.js → index-BBBCr4Oo.js} +2 -2
- package/dist/{index-dD-mKgue.js → index-BHtNKL1L.js} +2 -2
- package/dist/{index-CznUP1Ek.js → index-BJFXtH-X.js} +3 -3
- package/dist/{index-DcPtyCDm.js → index-BUqviBFi.js} +35 -29
- package/dist/{index-B2LYEScO.js → index-BXh02EAd.js} +4 -4
- package/dist/{index-CkO7j_i1.js → index-B_fRppeJ.js} +8 -8
- package/dist/index-BmaW6Me9.js +572 -0
- package/dist/{index-6qXeMn6b.js → index-BvkIoiVW.js} +3 -3
- package/dist/{index-DIVct0z6.js → index-C3pboX9W.js} +5 -5
- package/dist/{index-BkkvdZXm.js → index-CPW7tdrA.js} +20 -17
- package/dist/{index-CXqqIuf-.js → index-CTicGWoS.js} +3 -3
- package/dist/{index-BybrpYzx.js → index-CX8Apbo7.js} +1 -1
- package/dist/{index-DI44qg1B.js → index-Cn33Gz2z.js} +616 -587
- package/dist/{index-DmILGKv9.js → index-D1E8EPxn.js} +61 -57
- package/dist/{index-B8NQAdR4.js → index-D8UY4uNQ.js} +967 -966
- package/dist/{index-CYjsE5Gs.js → index-D9xMYIes.js} +3 -3
- package/dist/{index-C6H6VzYm.js → index-DAs4L0hx.js} +6436 -6878
- package/dist/{index-IT-HvgkV.js → index-Dd-8nw2f.js} +20 -18
- package/dist/{index-pMtaHLbt.js → index-DjSJhlad.js} +62 -60
- package/dist/{index-hg0CdgKe.js → index-DkumSU1-.js} +4 -4
- package/dist/{index-CvZcm-Tt.js → index-DlQXFCw8.js} +8 -7
- package/dist/{index-BvyM6d06.js → index-DsdWSuDi.js} +483 -482
- package/dist/{index-DCY5J8nu.js → index-XvX6TMzr.js} +1 -1
- package/dist/{index-B4NcYIuS.js → index-YvUJL9Us.js} +1 -1
- package/dist/{index-BskHs38T.js → index-cYgzND1g.js} +8594 -8615
- package/dist/{index-BFS4iFyT.js → index-gXFBfuoD.js} +8 -8
- package/dist/{index-TgVsU-aK.js → index-obXIOkF7.js} +4 -4
- package/dist/{index-BFqUz4pN.js → index-rlStojTL.js} +1 -1
- package/dist/{index-DEbrqw2f.js → index-t9LvhXac.js} +5 -5
- package/dist/{index-CM6aWexA.js → index-tMqKF2l6.js} +2 -2
- package/dist/{index-BCb4e7gH.js → index-tniD_xHN.js} +157 -148
- package/dist/{index.vue_vue_type_script_setup_true_lang-DwbHXtUp.js → index.vue_vue_type_script_setup_true_lang-DRzriV-s.js} +2 -2
- package/dist/{index.vue_vue_type_style_index_0_scoped_39e1db95_lang-Dp7tIi0S.js → index.vue_vue_type_style_index_0_scoped_39e1db95_lang-X_k372gl.js} +27735 -27760
- package/dist/isString-BlNsHiyU.js +8 -0
- package/dist/{localIcon-CoJHw5ss.js → localIcon-D5UoFBU5.js} +1 -1
- package/dist/{main-DMRXk1rO.js → main-DgwLoFSd.js} +9 -9
- package/dist/{menuIndex-BiUB7t5q.js → menuIndex-DAW9B-9g.js} +1 -1
- package/dist/obj/model.mtl +42 -0
- package/dist/obj/model.obj +26110 -0
- package/dist/{request-BfrhYBTM.js → request-B1c8BUkR.js} +3075 -3493
- package/dist/ss-component.css +3 -3
- package/dist/ss-component.js +14 -14
- package/dist/ss-component2.js +13 -13
- package/dist/ss-component3.js +1 -1
- package/dist/svgIcon-4u4PW7Is.js +42 -0
- package/dist/{threeModel-gP4XEBBx.js → threeModel-Df46gQvy.js} +174 -174
- package/dist/{threePreview-CpcrqmFS.js → threePreview-C4Ra7sjU.js} +554 -554
- package/dist/threeSceneView-tLPMhgrS.js +1291 -0
- package/dist/{threeSceneViewForCPMPIP-DuORHSj3.js → threeSceneViewForCPMPIP-DZ5wkTWo.js} +208 -207
- package/dist/{threeTrackPathView-Bw6e-quT.js → threeTrackPathView-DT80eKxv.js} +25 -25
- package/dist/{threeViewerHost-BPdmCSow.js → threeViewerHost-t6BRTmw8.js} +4 -4
- package/dist/urdfTree-Bu7OVUsr.js +404 -0
- package/dist/{workpieceTreePanel-XH9mYAT2.js → workpieceTreePanel-CuXFoEjJ.js} +60 -56
- package/package.json +1 -1
- package/public/obj/model.mtl +42 -0
- package/public/obj/model.obj +26110 -0
- package/dist/index-BmHnPjUq.js +0 -2623
- package/dist/isString-Dxm3W5iX.js +0 -8
- package/dist/svgIcon-4m2zaZkj.js +0 -42
- package/dist/threeSceneView-CWlU0pao.js +0 -1290
- package/dist/urdfTree-DU02c_91.js +0 -254
package/dist/index-BmHnPjUq.js
DELETED
|
@@ -1,2623 +0,0 @@
|
|
|
1
|
-
import { ref as O, computed as it, reactive as $t, defineComponent as Gt, watch as Jt, openBlock as j, createElementBlock as dt, createVNode as K, withCtx as C, createTextVNode as xt, toDisplayString as vt, createCommentVNode as ve, resolveComponent as st, createBlock as St, Fragment as ge, renderList as ye, createElementVNode as me, normalizeStyle as be } from "vue";
|
|
2
|
-
import { c7 as Se, c8 as Te, c9 as we, E as rt } from "./request-BfrhYBTM.js";
|
|
3
|
-
import { s as Wt, c as Ee, b as De, p as Yt, u as xe, e as Ae } from "./index-B8NQAdR4.js";
|
|
4
|
-
import { g as Qt, u as Re } from "./index-B4NcYIuS.js";
|
|
5
|
-
import { a5 as Be } from "./index-BvyM6d06.js";
|
|
6
|
-
import { A as Ie } from "./index-aTEfnfYn.js";
|
|
7
|
-
import { u as Xt, l as Oe } from "./index-C6H6VzYm.js";
|
|
8
|
-
import { _ as te } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
9
|
-
import { S as Tt } from "./index-dD-mKgue.js";
|
|
10
|
-
var Ve = "0123456789abcdefghijklmnopqrstuvwxyz";
|
|
11
|
-
function M(i) {
|
|
12
|
-
return Ve.charAt(i);
|
|
13
|
-
}
|
|
14
|
-
function Ne(i, t) {
|
|
15
|
-
return i & t;
|
|
16
|
-
}
|
|
17
|
-
function ot(i, t) {
|
|
18
|
-
return i | t;
|
|
19
|
-
}
|
|
20
|
-
function Ct(i, t) {
|
|
21
|
-
return i ^ t;
|
|
22
|
-
}
|
|
23
|
-
function Pt(i, t) {
|
|
24
|
-
return i & ~t;
|
|
25
|
-
}
|
|
26
|
-
function _e(i) {
|
|
27
|
-
if (i == 0)
|
|
28
|
-
return -1;
|
|
29
|
-
var t = 0;
|
|
30
|
-
return (i & 65535) == 0 && (i >>= 16, t += 16), (i & 255) == 0 && (i >>= 8, t += 8), (i & 15) == 0 && (i >>= 4, t += 4), (i & 3) == 0 && (i >>= 2, t += 2), (i & 1) == 0 && ++t, t;
|
|
31
|
-
}
|
|
32
|
-
function Ce(i) {
|
|
33
|
-
for (var t = 0; i != 0; )
|
|
34
|
-
i &= i - 1, ++t;
|
|
35
|
-
return t;
|
|
36
|
-
}
|
|
37
|
-
var G = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", ee = "=";
|
|
38
|
-
function tt(i) {
|
|
39
|
-
var t, e, r = "";
|
|
40
|
-
for (t = 0; t + 3 <= i.length; t += 3)
|
|
41
|
-
e = parseInt(i.substring(t, t + 3), 16), r += G.charAt(e >> 6) + G.charAt(e & 63);
|
|
42
|
-
for (t + 1 == i.length ? (e = parseInt(i.substring(t, t + 1), 16), r += G.charAt(e << 2)) : t + 2 == i.length && (e = parseInt(i.substring(t, t + 2), 16), r += G.charAt(e >> 2) + G.charAt((e & 3) << 4)); (r.length & 3) > 0; )
|
|
43
|
-
r += ee;
|
|
44
|
-
return r;
|
|
45
|
-
}
|
|
46
|
-
function Mt(i) {
|
|
47
|
-
var t = "", e, r = 0, n = 0;
|
|
48
|
-
for (e = 0; e < i.length && i.charAt(e) != ee; ++e) {
|
|
49
|
-
var s = G.indexOf(i.charAt(e));
|
|
50
|
-
s < 0 || (r == 0 ? (t += M(s >> 2), n = s & 3, r = 1) : r == 1 ? (t += M(n << 2 | s >> 4), n = s & 15, r = 2) : r == 2 ? (t += M(n), t += M(s >> 2), n = s & 3, r = 3) : (t += M(n << 2 | s >> 4), t += M(s & 15), r = 0));
|
|
51
|
-
}
|
|
52
|
-
return r == 1 && (t += M(n << 2)), t;
|
|
53
|
-
}
|
|
54
|
-
var Z, Pe = {
|
|
55
|
-
decode: function(i) {
|
|
56
|
-
var t;
|
|
57
|
-
if (Z === void 0) {
|
|
58
|
-
var e = "0123456789ABCDEF", r = ` \f
|
|
59
|
-
\r \u2028\u2029`;
|
|
60
|
-
for (Z = {}, t = 0; t < 16; ++t)
|
|
61
|
-
Z[e.charAt(t)] = t;
|
|
62
|
-
for (e = e.toLowerCase(), t = 10; t < 16; ++t)
|
|
63
|
-
Z[e.charAt(t)] = t;
|
|
64
|
-
for (t = 0; t < r.length; ++t)
|
|
65
|
-
Z[r.charAt(t)] = -1;
|
|
66
|
-
}
|
|
67
|
-
var n = [], s = 0, o = 0;
|
|
68
|
-
for (t = 0; t < i.length; ++t) {
|
|
69
|
-
var a = i.charAt(t);
|
|
70
|
-
if (a == "=")
|
|
71
|
-
break;
|
|
72
|
-
if (a = Z[a], a != -1) {
|
|
73
|
-
if (a === void 0)
|
|
74
|
-
throw new Error("Illegal character at offset " + t);
|
|
75
|
-
s |= a, ++o >= 2 ? (n[n.length] = s, s = 0, o = 0) : s <<= 4;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
if (o)
|
|
79
|
-
throw new Error("Hex encoding incomplete: 4 bits missing");
|
|
80
|
-
return n;
|
|
81
|
-
}
|
|
82
|
-
}, L, At = {
|
|
83
|
-
decode: function(i) {
|
|
84
|
-
var t;
|
|
85
|
-
if (L === void 0) {
|
|
86
|
-
var e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", r = `= \f
|
|
87
|
-
\r \u2028\u2029`;
|
|
88
|
-
for (L = /* @__PURE__ */ Object.create(null), t = 0; t < 64; ++t)
|
|
89
|
-
L[e.charAt(t)] = t;
|
|
90
|
-
for (L["-"] = 62, L._ = 63, t = 0; t < r.length; ++t)
|
|
91
|
-
L[r.charAt(t)] = -1;
|
|
92
|
-
}
|
|
93
|
-
var n = [], s = 0, o = 0;
|
|
94
|
-
for (t = 0; t < i.length; ++t) {
|
|
95
|
-
var a = i.charAt(t);
|
|
96
|
-
if (a == "=")
|
|
97
|
-
break;
|
|
98
|
-
if (a = L[a], a != -1) {
|
|
99
|
-
if (a === void 0)
|
|
100
|
-
throw new Error("Illegal character at offset " + t);
|
|
101
|
-
s |= a, ++o >= 4 ? (n[n.length] = s >> 16, n[n.length] = s >> 8 & 255, n[n.length] = s & 255, s = 0, o = 0) : s <<= 6;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
switch (o) {
|
|
105
|
-
case 1:
|
|
106
|
-
throw new Error("Base64 encoding incomplete: at least 2 bits missing");
|
|
107
|
-
case 2:
|
|
108
|
-
n[n.length] = s >> 10;
|
|
109
|
-
break;
|
|
110
|
-
case 3:
|
|
111
|
-
n[n.length] = s >> 16, n[n.length] = s >> 8 & 255;
|
|
112
|
-
break;
|
|
113
|
-
}
|
|
114
|
-
return n;
|
|
115
|
-
},
|
|
116
|
-
re: /-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,
|
|
117
|
-
unarmor: function(i) {
|
|
118
|
-
var t = At.re.exec(i);
|
|
119
|
-
if (t)
|
|
120
|
-
if (t[1])
|
|
121
|
-
i = t[1];
|
|
122
|
-
else if (t[2])
|
|
123
|
-
i = t[2];
|
|
124
|
-
else
|
|
125
|
-
throw new Error("RegExp out of sync");
|
|
126
|
-
return At.decode(i);
|
|
127
|
-
}
|
|
128
|
-
}, $ = 1e13, X = (
|
|
129
|
-
/** @class */
|
|
130
|
-
(function() {
|
|
131
|
-
function i(t) {
|
|
132
|
-
this.buf = [+t || 0];
|
|
133
|
-
}
|
|
134
|
-
return i.prototype.mulAdd = function(t, e) {
|
|
135
|
-
var r = this.buf, n = r.length, s, o;
|
|
136
|
-
for (s = 0; s < n; ++s)
|
|
137
|
-
o = r[s] * t + e, o < $ ? e = 0 : (e = 0 | o / $, o -= e * $), r[s] = o;
|
|
138
|
-
e > 0 && (r[s] = e);
|
|
139
|
-
}, i.prototype.sub = function(t) {
|
|
140
|
-
var e = this.buf, r = e.length, n, s;
|
|
141
|
-
for (n = 0; n < r; ++n)
|
|
142
|
-
s = e[n] - t, s < 0 ? (s += $, t = 1) : t = 0, e[n] = s;
|
|
143
|
-
for (; e[e.length - 1] === 0; )
|
|
144
|
-
e.pop();
|
|
145
|
-
}, i.prototype.toString = function(t) {
|
|
146
|
-
if ((t || 10) != 10)
|
|
147
|
-
throw new Error("only base 10 is supported");
|
|
148
|
-
for (var e = this.buf, r = e[e.length - 1].toString(), n = e.length - 2; n >= 0; --n)
|
|
149
|
-
r += ($ + e[n]).toString().substring(1);
|
|
150
|
-
return r;
|
|
151
|
-
}, i.prototype.valueOf = function() {
|
|
152
|
-
for (var t = this.buf, e = 0, r = t.length - 1; r >= 0; --r)
|
|
153
|
-
e = e * $ + t[r];
|
|
154
|
-
return e;
|
|
155
|
-
}, i.prototype.simplify = function() {
|
|
156
|
-
var t = this.buf;
|
|
157
|
-
return t.length == 1 ? t[0] : this;
|
|
158
|
-
}, i;
|
|
159
|
-
})()
|
|
160
|
-
), re = "…", Me = /^(\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)?)?$/, ke = /^(\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)?)?$/;
|
|
161
|
-
function J(i, t) {
|
|
162
|
-
return i.length > t && (i = i.substring(0, t) + re), i;
|
|
163
|
-
}
|
|
164
|
-
var wt = (
|
|
165
|
-
/** @class */
|
|
166
|
-
(function() {
|
|
167
|
-
function i(t, e) {
|
|
168
|
-
this.hexDigits = "0123456789ABCDEF", t instanceof i ? (this.enc = t.enc, this.pos = t.pos) : (this.enc = t, this.pos = e);
|
|
169
|
-
}
|
|
170
|
-
return i.prototype.get = function(t) {
|
|
171
|
-
if (t === void 0 && (t = this.pos++), t >= this.enc.length)
|
|
172
|
-
throw new Error("Requesting byte offset ".concat(t, " on a stream of length ").concat(this.enc.length));
|
|
173
|
-
return typeof this.enc == "string" ? this.enc.charCodeAt(t) : this.enc[t];
|
|
174
|
-
}, i.prototype.hexByte = function(t) {
|
|
175
|
-
return this.hexDigits.charAt(t >> 4 & 15) + this.hexDigits.charAt(t & 15);
|
|
176
|
-
}, i.prototype.hexDump = function(t, e, r) {
|
|
177
|
-
for (var n = "", s = t; s < e; ++s)
|
|
178
|
-
if (n += this.hexByte(this.get(s)), r !== !0)
|
|
179
|
-
switch (s & 15) {
|
|
180
|
-
case 7:
|
|
181
|
-
n += " ";
|
|
182
|
-
break;
|
|
183
|
-
case 15:
|
|
184
|
-
n += `
|
|
185
|
-
`;
|
|
186
|
-
break;
|
|
187
|
-
default:
|
|
188
|
-
n += " ";
|
|
189
|
-
}
|
|
190
|
-
return n;
|
|
191
|
-
}, i.prototype.isASCII = function(t, e) {
|
|
192
|
-
for (var r = t; r < e; ++r) {
|
|
193
|
-
var n = this.get(r);
|
|
194
|
-
if (n < 32 || n > 176)
|
|
195
|
-
return !1;
|
|
196
|
-
}
|
|
197
|
-
return !0;
|
|
198
|
-
}, i.prototype.parseStringISO = function(t, e) {
|
|
199
|
-
for (var r = "", n = t; n < e; ++n)
|
|
200
|
-
r += String.fromCharCode(this.get(n));
|
|
201
|
-
return r;
|
|
202
|
-
}, i.prototype.parseStringUTF = function(t, e) {
|
|
203
|
-
for (var r = "", n = t; n < e; ) {
|
|
204
|
-
var s = this.get(n++);
|
|
205
|
-
s < 128 ? r += String.fromCharCode(s) : s > 191 && s < 224 ? r += String.fromCharCode((s & 31) << 6 | this.get(n++) & 63) : r += String.fromCharCode((s & 15) << 12 | (this.get(n++) & 63) << 6 | this.get(n++) & 63);
|
|
206
|
-
}
|
|
207
|
-
return r;
|
|
208
|
-
}, i.prototype.parseStringBMP = function(t, e) {
|
|
209
|
-
for (var r = "", n, s, o = t; o < e; )
|
|
210
|
-
n = this.get(o++), s = this.get(o++), r += String.fromCharCode(n << 8 | s);
|
|
211
|
-
return r;
|
|
212
|
-
}, i.prototype.parseTime = function(t, e, r) {
|
|
213
|
-
var n = this.parseStringISO(t, e), s = (r ? Me : ke).exec(n);
|
|
214
|
-
return s ? (r && (s[1] = +s[1], s[1] += +s[1] < 70 ? 2e3 : 1900), n = s[1] + "-" + s[2] + "-" + s[3] + " " + s[4], s[5] && (n += ":" + s[5], s[6] && (n += ":" + s[6], s[7] && (n += "." + s[7]))), s[8] && (n += " UTC", s[8] != "Z" && (n += s[8], s[9] && (n += ":" + s[9]))), n) : "Unrecognized time: " + n;
|
|
215
|
-
}, i.prototype.parseInteger = function(t, e) {
|
|
216
|
-
for (var r = this.get(t), n = r > 127, s = n ? 255 : 0, o, a = ""; r == s && ++t < e; )
|
|
217
|
-
r = this.get(t);
|
|
218
|
-
if (o = e - t, o === 0)
|
|
219
|
-
return n ? -1 : 0;
|
|
220
|
-
if (o > 4) {
|
|
221
|
-
for (a = r, o <<= 3; ((+a ^ s) & 128) == 0; )
|
|
222
|
-
a = +a << 1, --o;
|
|
223
|
-
a = "(" + o + ` bit)
|
|
224
|
-
`;
|
|
225
|
-
}
|
|
226
|
-
n && (r = r - 256);
|
|
227
|
-
for (var h = new X(r), f = t + 1; f < e; ++f)
|
|
228
|
-
h.mulAdd(256, this.get(f));
|
|
229
|
-
return a + h.toString();
|
|
230
|
-
}, i.prototype.parseBitString = function(t, e, r) {
|
|
231
|
-
for (var n = this.get(t), s = (e - t - 1 << 3) - n, o = "(" + s + ` bit)
|
|
232
|
-
`, a = "", h = t + 1; h < e; ++h) {
|
|
233
|
-
for (var f = this.get(h), c = h == e - 1 ? n : 0, l = 7; l >= c; --l)
|
|
234
|
-
a += f >> l & 1 ? "1" : "0";
|
|
235
|
-
if (a.length > r)
|
|
236
|
-
return o + J(a, r);
|
|
237
|
-
}
|
|
238
|
-
return o + a;
|
|
239
|
-
}, i.prototype.parseOctetString = function(t, e, r) {
|
|
240
|
-
if (this.isASCII(t, e))
|
|
241
|
-
return J(this.parseStringISO(t, e), r);
|
|
242
|
-
var n = e - t, s = "(" + n + ` byte)
|
|
243
|
-
`;
|
|
244
|
-
r /= 2, n > r && (e = t + r);
|
|
245
|
-
for (var o = t; o < e; ++o)
|
|
246
|
-
s += this.hexByte(this.get(o));
|
|
247
|
-
return n > r && (s += re), s;
|
|
248
|
-
}, i.prototype.parseOID = function(t, e, r) {
|
|
249
|
-
for (var n = "", s = new X(), o = 0, a = t; a < e; ++a) {
|
|
250
|
-
var h = this.get(a);
|
|
251
|
-
if (s.mulAdd(128, h & 127), o += 7, !(h & 128)) {
|
|
252
|
-
if (n === "")
|
|
253
|
-
if (s = s.simplify(), s instanceof X)
|
|
254
|
-
s.sub(80), n = "2." + s.toString();
|
|
255
|
-
else {
|
|
256
|
-
var f = s < 80 ? s < 40 ? 0 : 1 : 2;
|
|
257
|
-
n = f + "." + (s - f * 40);
|
|
258
|
-
}
|
|
259
|
-
else
|
|
260
|
-
n += "." + s.toString();
|
|
261
|
-
if (n.length > r)
|
|
262
|
-
return J(n, r);
|
|
263
|
-
s = new X(), o = 0;
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
return o > 0 && (n += ".incomplete"), n;
|
|
267
|
-
}, i;
|
|
268
|
-
})()
|
|
269
|
-
), qe = (
|
|
270
|
-
/** @class */
|
|
271
|
-
(function() {
|
|
272
|
-
function i(t, e, r, n, s) {
|
|
273
|
-
if (!(n instanceof kt))
|
|
274
|
-
throw new Error("Invalid tag value.");
|
|
275
|
-
this.stream = t, this.header = e, this.length = r, this.tag = n, this.sub = s;
|
|
276
|
-
}
|
|
277
|
-
return i.prototype.typeName = function() {
|
|
278
|
-
switch (this.tag.tagClass) {
|
|
279
|
-
case 0:
|
|
280
|
-
switch (this.tag.tagNumber) {
|
|
281
|
-
case 0:
|
|
282
|
-
return "EOC";
|
|
283
|
-
case 1:
|
|
284
|
-
return "BOOLEAN";
|
|
285
|
-
case 2:
|
|
286
|
-
return "INTEGER";
|
|
287
|
-
case 3:
|
|
288
|
-
return "BIT_STRING";
|
|
289
|
-
case 4:
|
|
290
|
-
return "OCTET_STRING";
|
|
291
|
-
case 5:
|
|
292
|
-
return "NULL";
|
|
293
|
-
case 6:
|
|
294
|
-
return "OBJECT_IDENTIFIER";
|
|
295
|
-
case 7:
|
|
296
|
-
return "ObjectDescriptor";
|
|
297
|
-
case 8:
|
|
298
|
-
return "EXTERNAL";
|
|
299
|
-
case 9:
|
|
300
|
-
return "REAL";
|
|
301
|
-
case 10:
|
|
302
|
-
return "ENUMERATED";
|
|
303
|
-
case 11:
|
|
304
|
-
return "EMBEDDED_PDV";
|
|
305
|
-
case 12:
|
|
306
|
-
return "UTF8String";
|
|
307
|
-
case 16:
|
|
308
|
-
return "SEQUENCE";
|
|
309
|
-
case 17:
|
|
310
|
-
return "SET";
|
|
311
|
-
case 18:
|
|
312
|
-
return "NumericString";
|
|
313
|
-
case 19:
|
|
314
|
-
return "PrintableString";
|
|
315
|
-
// ASCII subset
|
|
316
|
-
case 20:
|
|
317
|
-
return "TeletexString";
|
|
318
|
-
// aka T61String
|
|
319
|
-
case 21:
|
|
320
|
-
return "VideotexString";
|
|
321
|
-
case 22:
|
|
322
|
-
return "IA5String";
|
|
323
|
-
// ASCII
|
|
324
|
-
case 23:
|
|
325
|
-
return "UTCTime";
|
|
326
|
-
case 24:
|
|
327
|
-
return "GeneralizedTime";
|
|
328
|
-
case 25:
|
|
329
|
-
return "GraphicString";
|
|
330
|
-
case 26:
|
|
331
|
-
return "VisibleString";
|
|
332
|
-
// ASCII subset
|
|
333
|
-
case 27:
|
|
334
|
-
return "GeneralString";
|
|
335
|
-
case 28:
|
|
336
|
-
return "UniversalString";
|
|
337
|
-
case 30:
|
|
338
|
-
return "BMPString";
|
|
339
|
-
}
|
|
340
|
-
return "Universal_" + this.tag.tagNumber.toString();
|
|
341
|
-
case 1:
|
|
342
|
-
return "Application_" + this.tag.tagNumber.toString();
|
|
343
|
-
case 2:
|
|
344
|
-
return "[" + this.tag.tagNumber.toString() + "]";
|
|
345
|
-
// Context
|
|
346
|
-
case 3:
|
|
347
|
-
return "Private_" + this.tag.tagNumber.toString();
|
|
348
|
-
}
|
|
349
|
-
}, i.prototype.content = function(t) {
|
|
350
|
-
if (this.tag === void 0)
|
|
351
|
-
return null;
|
|
352
|
-
t === void 0 && (t = 1 / 0);
|
|
353
|
-
var e = this.posContent(), r = Math.abs(this.length);
|
|
354
|
-
if (!this.tag.isUniversal())
|
|
355
|
-
return this.sub !== null ? "(" + this.sub.length + " elem)" : this.stream.parseOctetString(e, e + r, t);
|
|
356
|
-
switch (this.tag.tagNumber) {
|
|
357
|
-
case 1:
|
|
358
|
-
return this.stream.get(e) === 0 ? "false" : "true";
|
|
359
|
-
case 2:
|
|
360
|
-
return this.stream.parseInteger(e, e + r);
|
|
361
|
-
case 3:
|
|
362
|
-
return this.sub ? "(" + this.sub.length + " elem)" : this.stream.parseBitString(e, e + r, t);
|
|
363
|
-
case 4:
|
|
364
|
-
return this.sub ? "(" + this.sub.length + " elem)" : this.stream.parseOctetString(e, e + r, t);
|
|
365
|
-
// case 0x05: // NULL
|
|
366
|
-
case 6:
|
|
367
|
-
return this.stream.parseOID(e, e + r, t);
|
|
368
|
-
// case 0x07: // ObjectDescriptor
|
|
369
|
-
// case 0x08: // EXTERNAL
|
|
370
|
-
// case 0x09: // REAL
|
|
371
|
-
// case 0x0A: // ENUMERATED
|
|
372
|
-
// case 0x0B: // EMBEDDED_PDV
|
|
373
|
-
case 16:
|
|
374
|
-
// SEQUENCE
|
|
375
|
-
case 17:
|
|
376
|
-
return this.sub !== null ? "(" + this.sub.length + " elem)" : "(no elem)";
|
|
377
|
-
case 12:
|
|
378
|
-
return J(this.stream.parseStringUTF(e, e + r), t);
|
|
379
|
-
case 18:
|
|
380
|
-
// NumericString
|
|
381
|
-
case 19:
|
|
382
|
-
// PrintableString
|
|
383
|
-
case 20:
|
|
384
|
-
// TeletexString
|
|
385
|
-
case 21:
|
|
386
|
-
// VideotexString
|
|
387
|
-
case 22:
|
|
388
|
-
// IA5String
|
|
389
|
-
// case 0x19: // GraphicString
|
|
390
|
-
case 26:
|
|
391
|
-
return J(this.stream.parseStringISO(e, e + r), t);
|
|
392
|
-
case 30:
|
|
393
|
-
return J(this.stream.parseStringBMP(e, e + r), t);
|
|
394
|
-
case 23:
|
|
395
|
-
// UTCTime
|
|
396
|
-
case 24:
|
|
397
|
-
return this.stream.parseTime(e, e + r, this.tag.tagNumber == 23);
|
|
398
|
-
}
|
|
399
|
-
return null;
|
|
400
|
-
}, i.prototype.toString = function() {
|
|
401
|
-
return this.typeName() + "@" + this.stream.pos + "[header:" + this.header + ",length:" + this.length + ",sub:" + (this.sub === null ? "null" : this.sub.length) + "]";
|
|
402
|
-
}, i.prototype.toPrettyString = function(t) {
|
|
403
|
-
t === void 0 && (t = "");
|
|
404
|
-
var e = t + this.typeName() + " @" + this.stream.pos;
|
|
405
|
-
if (this.length >= 0 && (e += "+"), e += this.length, this.tag.tagConstructed ? e += " (constructed)" : this.tag.isUniversal() && (this.tag.tagNumber == 3 || this.tag.tagNumber == 4) && this.sub !== null && (e += " (encapsulates)"), e += `
|
|
406
|
-
`, this.sub !== null) {
|
|
407
|
-
t += " ";
|
|
408
|
-
for (var r = 0, n = this.sub.length; r < n; ++r)
|
|
409
|
-
e += this.sub[r].toPrettyString(t);
|
|
410
|
-
}
|
|
411
|
-
return e;
|
|
412
|
-
}, i.prototype.posStart = function() {
|
|
413
|
-
return this.stream.pos;
|
|
414
|
-
}, i.prototype.posContent = function() {
|
|
415
|
-
return this.stream.pos + this.header;
|
|
416
|
-
}, i.prototype.posEnd = function() {
|
|
417
|
-
return this.stream.pos + this.header + Math.abs(this.length);
|
|
418
|
-
}, i.prototype.toHexString = function() {
|
|
419
|
-
return this.stream.hexDump(this.posStart(), this.posEnd(), !0);
|
|
420
|
-
}, i.decodeLength = function(t) {
|
|
421
|
-
var e = t.get(), r = e & 127;
|
|
422
|
-
if (r == e)
|
|
423
|
-
return r;
|
|
424
|
-
if (r > 6)
|
|
425
|
-
throw new Error("Length over 48 bits not supported at position " + (t.pos - 1));
|
|
426
|
-
if (r === 0)
|
|
427
|
-
return null;
|
|
428
|
-
e = 0;
|
|
429
|
-
for (var n = 0; n < r; ++n)
|
|
430
|
-
e = e * 256 + t.get();
|
|
431
|
-
return e;
|
|
432
|
-
}, i.prototype.getHexStringValue = function() {
|
|
433
|
-
var t = this.toHexString(), e = this.header * 2, r = this.length * 2;
|
|
434
|
-
return t.substring(e, e + r);
|
|
435
|
-
}, i.decode = function(t) {
|
|
436
|
-
var e;
|
|
437
|
-
t instanceof wt ? e = t : e = new wt(t, 0);
|
|
438
|
-
var r = new wt(e), n = new kt(e), s = i.decodeLength(e), o = e.pos, a = o - r.pos, h = null, f = function() {
|
|
439
|
-
var l = [];
|
|
440
|
-
if (s !== null) {
|
|
441
|
-
for (var g = o + s; e.pos < g; )
|
|
442
|
-
l[l.length] = i.decode(e);
|
|
443
|
-
if (e.pos != g)
|
|
444
|
-
throw new Error("Content size is not correct for container starting at offset " + o);
|
|
445
|
-
} else
|
|
446
|
-
try {
|
|
447
|
-
for (; ; ) {
|
|
448
|
-
var v = i.decode(e);
|
|
449
|
-
if (v.tag.isEOC())
|
|
450
|
-
break;
|
|
451
|
-
l[l.length] = v;
|
|
452
|
-
}
|
|
453
|
-
s = o - e.pos;
|
|
454
|
-
} catch (d) {
|
|
455
|
-
throw new Error("Exception while decoding undefined length content: " + d);
|
|
456
|
-
}
|
|
457
|
-
return l;
|
|
458
|
-
};
|
|
459
|
-
if (n.tagConstructed)
|
|
460
|
-
h = f();
|
|
461
|
-
else if (n.isUniversal() && (n.tagNumber == 3 || n.tagNumber == 4))
|
|
462
|
-
try {
|
|
463
|
-
if (n.tagNumber == 3 && e.get() != 0)
|
|
464
|
-
throw new Error("BIT STRINGs with unused bits cannot encapsulate.");
|
|
465
|
-
h = f();
|
|
466
|
-
for (var c = 0; c < h.length; ++c)
|
|
467
|
-
if (h[c].tag.isEOC())
|
|
468
|
-
throw new Error("EOC is not supposed to be actual content.");
|
|
469
|
-
} catch {
|
|
470
|
-
h = null;
|
|
471
|
-
}
|
|
472
|
-
if (h === null) {
|
|
473
|
-
if (s === null)
|
|
474
|
-
throw new Error("We can't skip over an invalid tag with undefined length at offset " + o);
|
|
475
|
-
e.pos = o + Math.abs(s);
|
|
476
|
-
}
|
|
477
|
-
return new i(r, a, s, n, h);
|
|
478
|
-
}, i;
|
|
479
|
-
})()
|
|
480
|
-
), kt = (
|
|
481
|
-
/** @class */
|
|
482
|
-
(function() {
|
|
483
|
-
function i(t) {
|
|
484
|
-
var e = t.get();
|
|
485
|
-
if (this.tagClass = e >> 6, this.tagConstructed = (e & 32) !== 0, this.tagNumber = e & 31, this.tagNumber == 31) {
|
|
486
|
-
var r = new X();
|
|
487
|
-
do
|
|
488
|
-
e = t.get(), r.mulAdd(128, e & 127);
|
|
489
|
-
while (e & 128);
|
|
490
|
-
this.tagNumber = r.simplify();
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
return i.prototype.isUniversal = function() {
|
|
494
|
-
return this.tagClass === 0;
|
|
495
|
-
}, i.prototype.isEOC = function() {
|
|
496
|
-
return this.tagClass === 0 && this.tagNumber === 0;
|
|
497
|
-
}, i;
|
|
498
|
-
})()
|
|
499
|
-
), H, Fe = 244837814094590, qt = (Fe & 16777215) == 15715070, B = [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], He = (1 << 26) / B[B.length - 1], y = (
|
|
500
|
-
/** @class */
|
|
501
|
-
(function() {
|
|
502
|
-
function i(t, e, r) {
|
|
503
|
-
t != null && (typeof t == "number" ? this.fromNumber(t, e, r) : e == null && typeof t != "string" ? this.fromString(t, 256) : this.fromString(t, e));
|
|
504
|
-
}
|
|
505
|
-
return i.prototype.toString = function(t) {
|
|
506
|
-
if (this.s < 0)
|
|
507
|
-
return "-" + this.negate().toString(t);
|
|
508
|
-
var e;
|
|
509
|
-
if (t == 16)
|
|
510
|
-
e = 4;
|
|
511
|
-
else if (t == 8)
|
|
512
|
-
e = 3;
|
|
513
|
-
else if (t == 2)
|
|
514
|
-
e = 1;
|
|
515
|
-
else if (t == 32)
|
|
516
|
-
e = 5;
|
|
517
|
-
else if (t == 4)
|
|
518
|
-
e = 2;
|
|
519
|
-
else
|
|
520
|
-
return this.toRadix(t);
|
|
521
|
-
var r = (1 << e) - 1, n, s = !1, o = "", a = this.t, h = this.DB - a * this.DB % e;
|
|
522
|
-
if (a-- > 0)
|
|
523
|
-
for (h < this.DB && (n = this[a] >> h) > 0 && (s = !0, o = M(n)); a >= 0; )
|
|
524
|
-
h < e ? (n = (this[a] & (1 << h) - 1) << e - h, n |= this[--a] >> (h += this.DB - e)) : (n = this[a] >> (h -= e) & r, h <= 0 && (h += this.DB, --a)), n > 0 && (s = !0), s && (o += M(n));
|
|
525
|
-
return s ? o : "0";
|
|
526
|
-
}, i.prototype.negate = function() {
|
|
527
|
-
var t = S();
|
|
528
|
-
return i.ZERO.subTo(this, t), t;
|
|
529
|
-
}, i.prototype.abs = function() {
|
|
530
|
-
return this.s < 0 ? this.negate() : this;
|
|
531
|
-
}, i.prototype.compareTo = function(t) {
|
|
532
|
-
var e = this.s - t.s;
|
|
533
|
-
if (e != 0)
|
|
534
|
-
return e;
|
|
535
|
-
var r = this.t;
|
|
536
|
-
if (e = r - t.t, e != 0)
|
|
537
|
-
return this.s < 0 ? -e : e;
|
|
538
|
-
for (; --r >= 0; )
|
|
539
|
-
if ((e = this[r] - t[r]) != 0)
|
|
540
|
-
return e;
|
|
541
|
-
return 0;
|
|
542
|
-
}, i.prototype.bitLength = function() {
|
|
543
|
-
return this.t <= 0 ? 0 : this.DB * (this.t - 1) + at(this[this.t - 1] ^ this.s & this.DM);
|
|
544
|
-
}, i.prototype.mod = function(t) {
|
|
545
|
-
var e = S();
|
|
546
|
-
return this.abs().divRemTo(t, null, e), this.s < 0 && e.compareTo(i.ZERO) > 0 && t.subTo(e, e), e;
|
|
547
|
-
}, i.prototype.modPowInt = function(t, e) {
|
|
548
|
-
var r;
|
|
549
|
-
return t < 256 || e.isEven() ? r = new Ft(e) : r = new Ht(e), this.exp(t, r);
|
|
550
|
-
}, i.prototype.clone = function() {
|
|
551
|
-
var t = S();
|
|
552
|
-
return this.copyTo(t), t;
|
|
553
|
-
}, i.prototype.intValue = function() {
|
|
554
|
-
if (this.s < 0) {
|
|
555
|
-
if (this.t == 1)
|
|
556
|
-
return this[0] - this.DV;
|
|
557
|
-
if (this.t == 0)
|
|
558
|
-
return -1;
|
|
559
|
-
} else {
|
|
560
|
-
if (this.t == 1)
|
|
561
|
-
return this[0];
|
|
562
|
-
if (this.t == 0)
|
|
563
|
-
return 0;
|
|
564
|
-
}
|
|
565
|
-
return (this[1] & (1 << 32 - this.DB) - 1) << this.DB | this[0];
|
|
566
|
-
}, i.prototype.byteValue = function() {
|
|
567
|
-
return this.t == 0 ? this.s : this[0] << 24 >> 24;
|
|
568
|
-
}, i.prototype.shortValue = function() {
|
|
569
|
-
return this.t == 0 ? this.s : this[0] << 16 >> 16;
|
|
570
|
-
}, i.prototype.signum = function() {
|
|
571
|
-
return this.s < 0 ? -1 : this.t <= 0 || this.t == 1 && this[0] <= 0 ? 0 : 1;
|
|
572
|
-
}, i.prototype.toByteArray = function() {
|
|
573
|
-
var t = this.t, e = [];
|
|
574
|
-
e[0] = this.s;
|
|
575
|
-
var r = this.DB - t * this.DB % 8, n, s = 0;
|
|
576
|
-
if (t-- > 0)
|
|
577
|
-
for (r < this.DB && (n = this[t] >> r) != (this.s & this.DM) >> r && (e[s++] = n | this.s << this.DB - r); t >= 0; )
|
|
578
|
-
r < 8 ? (n = (this[t] & (1 << r) - 1) << 8 - r, n |= this[--t] >> (r += this.DB - 8)) : (n = this[t] >> (r -= 8) & 255, r <= 0 && (r += this.DB, --t)), (n & 128) != 0 && (n |= -256), s == 0 && (this.s & 128) != (n & 128) && ++s, (s > 0 || n != this.s) && (e[s++] = n);
|
|
579
|
-
return e;
|
|
580
|
-
}, i.prototype.equals = function(t) {
|
|
581
|
-
return this.compareTo(t) == 0;
|
|
582
|
-
}, i.prototype.min = function(t) {
|
|
583
|
-
return this.compareTo(t) < 0 ? this : t;
|
|
584
|
-
}, i.prototype.max = function(t) {
|
|
585
|
-
return this.compareTo(t) > 0 ? this : t;
|
|
586
|
-
}, i.prototype.and = function(t) {
|
|
587
|
-
var e = S();
|
|
588
|
-
return this.bitwiseTo(t, Ne, e), e;
|
|
589
|
-
}, i.prototype.or = function(t) {
|
|
590
|
-
var e = S();
|
|
591
|
-
return this.bitwiseTo(t, ot, e), e;
|
|
592
|
-
}, i.prototype.xor = function(t) {
|
|
593
|
-
var e = S();
|
|
594
|
-
return this.bitwiseTo(t, Ct, e), e;
|
|
595
|
-
}, i.prototype.andNot = function(t) {
|
|
596
|
-
var e = S();
|
|
597
|
-
return this.bitwiseTo(t, Pt, e), e;
|
|
598
|
-
}, i.prototype.not = function() {
|
|
599
|
-
for (var t = S(), e = 0; e < this.t; ++e)
|
|
600
|
-
t[e] = this.DM & ~this[e];
|
|
601
|
-
return t.t = this.t, t.s = ~this.s, t;
|
|
602
|
-
}, i.prototype.shiftLeft = function(t) {
|
|
603
|
-
var e = S();
|
|
604
|
-
return t < 0 ? this.rShiftTo(-t, e) : this.lShiftTo(t, e), e;
|
|
605
|
-
}, i.prototype.shiftRight = function(t) {
|
|
606
|
-
var e = S();
|
|
607
|
-
return t < 0 ? this.lShiftTo(-t, e) : this.rShiftTo(t, e), e;
|
|
608
|
-
}, i.prototype.getLowestSetBit = function() {
|
|
609
|
-
for (var t = 0; t < this.t; ++t)
|
|
610
|
-
if (this[t] != 0)
|
|
611
|
-
return t * this.DB + _e(this[t]);
|
|
612
|
-
return this.s < 0 ? this.t * this.DB : -1;
|
|
613
|
-
}, i.prototype.bitCount = function() {
|
|
614
|
-
for (var t = 0, e = this.s & this.DM, r = 0; r < this.t; ++r)
|
|
615
|
-
t += Ce(this[r] ^ e);
|
|
616
|
-
return t;
|
|
617
|
-
}, i.prototype.testBit = function(t) {
|
|
618
|
-
var e = Math.floor(t / this.DB);
|
|
619
|
-
return e >= this.t ? this.s != 0 : (this[e] & 1 << t % this.DB) != 0;
|
|
620
|
-
}, i.prototype.setBit = function(t) {
|
|
621
|
-
return this.changeBit(t, ot);
|
|
622
|
-
}, i.prototype.clearBit = function(t) {
|
|
623
|
-
return this.changeBit(t, Pt);
|
|
624
|
-
}, i.prototype.flipBit = function(t) {
|
|
625
|
-
return this.changeBit(t, Ct);
|
|
626
|
-
}, i.prototype.add = function(t) {
|
|
627
|
-
var e = S();
|
|
628
|
-
return this.addTo(t, e), e;
|
|
629
|
-
}, i.prototype.subtract = function(t) {
|
|
630
|
-
var e = S();
|
|
631
|
-
return this.subTo(t, e), e;
|
|
632
|
-
}, i.prototype.multiply = function(t) {
|
|
633
|
-
var e = S();
|
|
634
|
-
return this.multiplyTo(t, e), e;
|
|
635
|
-
}, i.prototype.divide = function(t) {
|
|
636
|
-
var e = S();
|
|
637
|
-
return this.divRemTo(t, e, null), e;
|
|
638
|
-
}, i.prototype.remainder = function(t) {
|
|
639
|
-
var e = S();
|
|
640
|
-
return this.divRemTo(t, null, e), e;
|
|
641
|
-
}, i.prototype.divideAndRemainder = function(t) {
|
|
642
|
-
var e = S(), r = S();
|
|
643
|
-
return this.divRemTo(t, e, r), [e, r];
|
|
644
|
-
}, i.prototype.modPow = function(t, e) {
|
|
645
|
-
var r = t.bitLength(), n, s = q(1), o;
|
|
646
|
-
if (r <= 0)
|
|
647
|
-
return s;
|
|
648
|
-
r < 18 ? n = 1 : r < 48 ? n = 3 : r < 144 ? n = 4 : r < 768 ? n = 5 : n = 6, r < 8 ? o = new Ft(e) : e.isEven() ? o = new Le(e) : o = new Ht(e);
|
|
649
|
-
var a = [], h = 3, f = n - 1, c = (1 << n) - 1;
|
|
650
|
-
if (a[1] = o.convert(this), n > 1) {
|
|
651
|
-
var l = S();
|
|
652
|
-
for (o.sqrTo(a[1], l); h <= c; )
|
|
653
|
-
a[h] = S(), o.mulTo(l, a[h - 2], a[h]), h += 2;
|
|
654
|
-
}
|
|
655
|
-
var g = t.t - 1, v, d = !0, p = S(), T;
|
|
656
|
-
for (r = at(t[g]) - 1; g >= 0; ) {
|
|
657
|
-
for (r >= f ? v = t[g] >> r - f & c : (v = (t[g] & (1 << r + 1) - 1) << f - r, g > 0 && (v |= t[g - 1] >> this.DB + r - f)), h = n; (v & 1) == 0; )
|
|
658
|
-
v >>= 1, --h;
|
|
659
|
-
if ((r -= h) < 0 && (r += this.DB, --g), d)
|
|
660
|
-
a[v].copyTo(s), d = !1;
|
|
661
|
-
else {
|
|
662
|
-
for (; h > 1; )
|
|
663
|
-
o.sqrTo(s, p), o.sqrTo(p, s), h -= 2;
|
|
664
|
-
h > 0 ? o.sqrTo(s, p) : (T = s, s = p, p = T), o.mulTo(p, a[v], s);
|
|
665
|
-
}
|
|
666
|
-
for (; g >= 0 && (t[g] & 1 << r) == 0; )
|
|
667
|
-
o.sqrTo(s, p), T = s, s = p, p = T, --r < 0 && (r = this.DB - 1, --g);
|
|
668
|
-
}
|
|
669
|
-
return o.revert(s);
|
|
670
|
-
}, i.prototype.modInverse = function(t) {
|
|
671
|
-
var e = t.isEven();
|
|
672
|
-
if (this.isEven() && e || t.signum() == 0)
|
|
673
|
-
return i.ZERO;
|
|
674
|
-
for (var r = t.clone(), n = this.clone(), s = q(1), o = q(0), a = q(0), h = q(1); r.signum() != 0; ) {
|
|
675
|
-
for (; r.isEven(); )
|
|
676
|
-
r.rShiftTo(1, r), e ? ((!s.isEven() || !o.isEven()) && (s.addTo(this, s), o.subTo(t, o)), s.rShiftTo(1, s)) : o.isEven() || o.subTo(t, o), o.rShiftTo(1, o);
|
|
677
|
-
for (; n.isEven(); )
|
|
678
|
-
n.rShiftTo(1, n), e ? ((!a.isEven() || !h.isEven()) && (a.addTo(this, a), h.subTo(t, h)), a.rShiftTo(1, a)) : h.isEven() || h.subTo(t, h), h.rShiftTo(1, h);
|
|
679
|
-
r.compareTo(n) >= 0 ? (r.subTo(n, r), e && s.subTo(a, s), o.subTo(h, o)) : (n.subTo(r, n), e && a.subTo(s, a), h.subTo(o, h));
|
|
680
|
-
}
|
|
681
|
-
if (n.compareTo(i.ONE) != 0)
|
|
682
|
-
return i.ZERO;
|
|
683
|
-
if (h.compareTo(t) >= 0)
|
|
684
|
-
return h.subtract(t);
|
|
685
|
-
if (h.signum() < 0)
|
|
686
|
-
h.addTo(t, h);
|
|
687
|
-
else
|
|
688
|
-
return h;
|
|
689
|
-
return h.signum() < 0 ? h.add(t) : h;
|
|
690
|
-
}, i.prototype.pow = function(t) {
|
|
691
|
-
return this.exp(t, new Ue());
|
|
692
|
-
}, i.prototype.gcd = function(t) {
|
|
693
|
-
var e = this.s < 0 ? this.negate() : this.clone(), r = t.s < 0 ? t.negate() : t.clone();
|
|
694
|
-
if (e.compareTo(r) < 0) {
|
|
695
|
-
var n = e;
|
|
696
|
-
e = r, r = n;
|
|
697
|
-
}
|
|
698
|
-
var s = e.getLowestSetBit(), o = r.getLowestSetBit();
|
|
699
|
-
if (o < 0)
|
|
700
|
-
return e;
|
|
701
|
-
for (s < o && (o = s), o > 0 && (e.rShiftTo(o, e), r.rShiftTo(o, r)); e.signum() > 0; )
|
|
702
|
-
(s = e.getLowestSetBit()) > 0 && e.rShiftTo(s, e), (s = r.getLowestSetBit()) > 0 && r.rShiftTo(s, r), e.compareTo(r) >= 0 ? (e.subTo(r, e), e.rShiftTo(1, e)) : (r.subTo(e, r), r.rShiftTo(1, r));
|
|
703
|
-
return o > 0 && r.lShiftTo(o, r), r;
|
|
704
|
-
}, i.prototype.isProbablePrime = function(t) {
|
|
705
|
-
var e, r = this.abs();
|
|
706
|
-
if (r.t == 1 && r[0] <= B[B.length - 1]) {
|
|
707
|
-
for (e = 0; e < B.length; ++e)
|
|
708
|
-
if (r[0] == B[e])
|
|
709
|
-
return !0;
|
|
710
|
-
return !1;
|
|
711
|
-
}
|
|
712
|
-
if (r.isEven())
|
|
713
|
-
return !1;
|
|
714
|
-
for (e = 1; e < B.length; ) {
|
|
715
|
-
for (var n = B[e], s = e + 1; s < B.length && n < He; )
|
|
716
|
-
n *= B[s++];
|
|
717
|
-
for (n = r.modInt(n); e < s; )
|
|
718
|
-
if (n % B[e++] == 0)
|
|
719
|
-
return !1;
|
|
720
|
-
}
|
|
721
|
-
return r.millerRabin(t);
|
|
722
|
-
}, i.prototype.copyTo = function(t) {
|
|
723
|
-
for (var e = this.t - 1; e >= 0; --e)
|
|
724
|
-
t[e] = this[e];
|
|
725
|
-
t.t = this.t, t.s = this.s;
|
|
726
|
-
}, i.prototype.fromInt = function(t) {
|
|
727
|
-
this.t = 1, this.s = t < 0 ? -1 : 0, t > 0 ? this[0] = t : t < -1 ? this[0] = t + this.DV : this.t = 0;
|
|
728
|
-
}, i.prototype.fromString = function(t, e) {
|
|
729
|
-
var r;
|
|
730
|
-
if (e == 16)
|
|
731
|
-
r = 4;
|
|
732
|
-
else if (e == 8)
|
|
733
|
-
r = 3;
|
|
734
|
-
else if (e == 256)
|
|
735
|
-
r = 8;
|
|
736
|
-
else if (e == 2)
|
|
737
|
-
r = 1;
|
|
738
|
-
else if (e == 32)
|
|
739
|
-
r = 5;
|
|
740
|
-
else if (e == 4)
|
|
741
|
-
r = 2;
|
|
742
|
-
else {
|
|
743
|
-
this.fromRadix(t, e);
|
|
744
|
-
return;
|
|
745
|
-
}
|
|
746
|
-
this.t = 0, this.s = 0;
|
|
747
|
-
for (var n = t.length, s = !1, o = 0; --n >= 0; ) {
|
|
748
|
-
var a = r == 8 ? +t[n] & 255 : Lt(t, n);
|
|
749
|
-
if (a < 0) {
|
|
750
|
-
t.charAt(n) == "-" && (s = !0);
|
|
751
|
-
continue;
|
|
752
|
-
}
|
|
753
|
-
s = !1, o == 0 ? this[this.t++] = a : o + r > this.DB ? (this[this.t - 1] |= (a & (1 << this.DB - o) - 1) << o, this[this.t++] = a >> this.DB - o) : this[this.t - 1] |= a << o, o += r, o >= this.DB && (o -= this.DB);
|
|
754
|
-
}
|
|
755
|
-
r == 8 && (+t[0] & 128) != 0 && (this.s = -1, o > 0 && (this[this.t - 1] |= (1 << this.DB - o) - 1 << o)), this.clamp(), s && i.ZERO.subTo(this, this);
|
|
756
|
-
}, i.prototype.clamp = function() {
|
|
757
|
-
for (var t = this.s & this.DM; this.t > 0 && this[this.t - 1] == t; )
|
|
758
|
-
--this.t;
|
|
759
|
-
}, i.prototype.dlShiftTo = function(t, e) {
|
|
760
|
-
var r;
|
|
761
|
-
for (r = this.t - 1; r >= 0; --r)
|
|
762
|
-
e[r + t] = this[r];
|
|
763
|
-
for (r = t - 1; r >= 0; --r)
|
|
764
|
-
e[r] = 0;
|
|
765
|
-
e.t = this.t + t, e.s = this.s;
|
|
766
|
-
}, i.prototype.drShiftTo = function(t, e) {
|
|
767
|
-
for (var r = t; r < this.t; ++r)
|
|
768
|
-
e[r - t] = this[r];
|
|
769
|
-
e.t = Math.max(this.t - t, 0), e.s = this.s;
|
|
770
|
-
}, i.prototype.lShiftTo = function(t, e) {
|
|
771
|
-
for (var r = t % this.DB, n = this.DB - r, s = (1 << n) - 1, o = Math.floor(t / this.DB), a = this.s << r & this.DM, h = this.t - 1; h >= 0; --h)
|
|
772
|
-
e[h + o + 1] = this[h] >> n | a, a = (this[h] & s) << r;
|
|
773
|
-
for (var h = o - 1; h >= 0; --h)
|
|
774
|
-
e[h] = 0;
|
|
775
|
-
e[o] = a, e.t = this.t + o + 1, e.s = this.s, e.clamp();
|
|
776
|
-
}, i.prototype.rShiftTo = function(t, e) {
|
|
777
|
-
e.s = this.s;
|
|
778
|
-
var r = Math.floor(t / this.DB);
|
|
779
|
-
if (r >= this.t) {
|
|
780
|
-
e.t = 0;
|
|
781
|
-
return;
|
|
782
|
-
}
|
|
783
|
-
var n = t % this.DB, s = this.DB - n, o = (1 << n) - 1;
|
|
784
|
-
e[0] = this[r] >> n;
|
|
785
|
-
for (var a = r + 1; a < this.t; ++a)
|
|
786
|
-
e[a - r - 1] |= (this[a] & o) << s, e[a - r] = this[a] >> n;
|
|
787
|
-
n > 0 && (e[this.t - r - 1] |= (this.s & o) << s), e.t = this.t - r, e.clamp();
|
|
788
|
-
}, i.prototype.subTo = function(t, e) {
|
|
789
|
-
for (var r = 0, n = 0, s = Math.min(t.t, this.t); r < s; )
|
|
790
|
-
n += this[r] - t[r], e[r++] = n & this.DM, n >>= this.DB;
|
|
791
|
-
if (t.t < this.t) {
|
|
792
|
-
for (n -= t.s; r < this.t; )
|
|
793
|
-
n += this[r], e[r++] = n & this.DM, n >>= this.DB;
|
|
794
|
-
n += this.s;
|
|
795
|
-
} else {
|
|
796
|
-
for (n += this.s; r < t.t; )
|
|
797
|
-
n -= t[r], e[r++] = n & this.DM, n >>= this.DB;
|
|
798
|
-
n -= t.s;
|
|
799
|
-
}
|
|
800
|
-
e.s = n < 0 ? -1 : 0, n < -1 ? e[r++] = this.DV + n : n > 0 && (e[r++] = n), e.t = r, e.clamp();
|
|
801
|
-
}, i.prototype.multiplyTo = function(t, e) {
|
|
802
|
-
var r = this.abs(), n = t.abs(), s = r.t;
|
|
803
|
-
for (e.t = s + n.t; --s >= 0; )
|
|
804
|
-
e[s] = 0;
|
|
805
|
-
for (s = 0; s < n.t; ++s)
|
|
806
|
-
e[s + r.t] = r.am(0, n[s], e, s, 0, r.t);
|
|
807
|
-
e.s = 0, e.clamp(), this.s != t.s && i.ZERO.subTo(e, e);
|
|
808
|
-
}, i.prototype.squareTo = function(t) {
|
|
809
|
-
for (var e = this.abs(), r = t.t = 2 * e.t; --r >= 0; )
|
|
810
|
-
t[r] = 0;
|
|
811
|
-
for (r = 0; r < e.t - 1; ++r) {
|
|
812
|
-
var n = e.am(r, e[r], t, 2 * r, 0, 1);
|
|
813
|
-
(t[r + e.t] += e.am(r + 1, 2 * e[r], t, 2 * r + 1, n, e.t - r - 1)) >= e.DV && (t[r + e.t] -= e.DV, t[r + e.t + 1] = 1);
|
|
814
|
-
}
|
|
815
|
-
t.t > 0 && (t[t.t - 1] += e.am(r, e[r], t, 2 * r, 0, 1)), t.s = 0, t.clamp();
|
|
816
|
-
}, i.prototype.divRemTo = function(t, e, r) {
|
|
817
|
-
var n = t.abs();
|
|
818
|
-
if (!(n.t <= 0)) {
|
|
819
|
-
var s = this.abs();
|
|
820
|
-
if (s.t < n.t) {
|
|
821
|
-
e != null && e.fromInt(0), r != null && this.copyTo(r);
|
|
822
|
-
return;
|
|
823
|
-
}
|
|
824
|
-
r == null && (r = S());
|
|
825
|
-
var o = S(), a = this.s, h = t.s, f = this.DB - at(n[n.t - 1]);
|
|
826
|
-
f > 0 ? (n.lShiftTo(f, o), s.lShiftTo(f, r)) : (n.copyTo(o), s.copyTo(r));
|
|
827
|
-
var c = o.t, l = o[c - 1];
|
|
828
|
-
if (l != 0) {
|
|
829
|
-
var g = l * (1 << this.F1) + (c > 1 ? o[c - 2] >> this.F2 : 0), v = this.FV / g, d = (1 << this.F1) / g, p = 1 << this.F2, T = r.t, E = T - c, w = e ?? S();
|
|
830
|
-
for (o.dlShiftTo(E, w), r.compareTo(w) >= 0 && (r[r.t++] = 1, r.subTo(w, r)), i.ONE.dlShiftTo(c, w), w.subTo(o, o); o.t < c; )
|
|
831
|
-
o[o.t++] = 0;
|
|
832
|
-
for (; --E >= 0; ) {
|
|
833
|
-
var I = r[--T] == l ? this.DM : Math.floor(r[T] * v + (r[T - 1] + p) * d);
|
|
834
|
-
if ((r[T] += o.am(0, I, r, E, 0, c)) < I)
|
|
835
|
-
for (o.dlShiftTo(E, w), r.subTo(w, r); r[T] < --I; )
|
|
836
|
-
r.subTo(w, r);
|
|
837
|
-
}
|
|
838
|
-
e != null && (r.drShiftTo(c, e), a != h && i.ZERO.subTo(e, e)), r.t = c, r.clamp(), f > 0 && r.rShiftTo(f, r), a < 0 && i.ZERO.subTo(r, r);
|
|
839
|
-
}
|
|
840
|
-
}
|
|
841
|
-
}, i.prototype.invDigit = function() {
|
|
842
|
-
if (this.t < 1)
|
|
843
|
-
return 0;
|
|
844
|
-
var t = this[0];
|
|
845
|
-
if ((t & 1) == 0)
|
|
846
|
-
return 0;
|
|
847
|
-
var e = t & 3;
|
|
848
|
-
return e = e * (2 - (t & 15) * e) & 15, e = e * (2 - (t & 255) * e) & 255, e = e * (2 - ((t & 65535) * e & 65535)) & 65535, e = e * (2 - t * e % this.DV) % this.DV, e > 0 ? this.DV - e : -e;
|
|
849
|
-
}, i.prototype.isEven = function() {
|
|
850
|
-
return (this.t > 0 ? this[0] & 1 : this.s) == 0;
|
|
851
|
-
}, i.prototype.exp = function(t, e) {
|
|
852
|
-
if (t > 4294967295 || t < 1)
|
|
853
|
-
return i.ONE;
|
|
854
|
-
var r = S(), n = S(), s = e.convert(this), o = at(t) - 1;
|
|
855
|
-
for (s.copyTo(r); --o >= 0; )
|
|
856
|
-
if (e.sqrTo(r, n), (t & 1 << o) > 0)
|
|
857
|
-
e.mulTo(n, s, r);
|
|
858
|
-
else {
|
|
859
|
-
var a = r;
|
|
860
|
-
r = n, n = a;
|
|
861
|
-
}
|
|
862
|
-
return e.revert(r);
|
|
863
|
-
}, i.prototype.chunkSize = function(t) {
|
|
864
|
-
return Math.floor(Math.LN2 * this.DB / Math.log(t));
|
|
865
|
-
}, i.prototype.toRadix = function(t) {
|
|
866
|
-
if (t == null && (t = 10), this.signum() == 0 || t < 2 || t > 36)
|
|
867
|
-
return "0";
|
|
868
|
-
var e = this.chunkSize(t), r = Math.pow(t, e), n = q(r), s = S(), o = S(), a = "";
|
|
869
|
-
for (this.divRemTo(n, s, o); s.signum() > 0; )
|
|
870
|
-
a = (r + o.intValue()).toString(t).substring(1) + a, s.divRemTo(n, s, o);
|
|
871
|
-
return o.intValue().toString(t) + a;
|
|
872
|
-
}, i.prototype.fromRadix = function(t, e) {
|
|
873
|
-
this.fromInt(0), e == null && (e = 10);
|
|
874
|
-
for (var r = this.chunkSize(e), n = Math.pow(e, r), s = !1, o = 0, a = 0, h = 0; h < t.length; ++h) {
|
|
875
|
-
var f = Lt(t, h);
|
|
876
|
-
if (f < 0) {
|
|
877
|
-
t.charAt(h) == "-" && this.signum() == 0 && (s = !0);
|
|
878
|
-
continue;
|
|
879
|
-
}
|
|
880
|
-
a = e * a + f, ++o >= r && (this.dMultiply(n), this.dAddOffset(a, 0), o = 0, a = 0);
|
|
881
|
-
}
|
|
882
|
-
o > 0 && (this.dMultiply(Math.pow(e, o)), this.dAddOffset(a, 0)), s && i.ZERO.subTo(this, this);
|
|
883
|
-
}, i.prototype.fromNumber = function(t, e, r) {
|
|
884
|
-
if (typeof e == "number")
|
|
885
|
-
if (t < 2)
|
|
886
|
-
this.fromInt(1);
|
|
887
|
-
else
|
|
888
|
-
for (this.fromNumber(t, r), this.testBit(t - 1) || this.bitwiseTo(i.ONE.shiftLeft(t - 1), ot, this), this.isEven() && this.dAddOffset(1, 0); !this.isProbablePrime(e); )
|
|
889
|
-
this.dAddOffset(2, 0), this.bitLength() > t && this.subTo(i.ONE.shiftLeft(t - 1), this);
|
|
890
|
-
else {
|
|
891
|
-
var n = [], s = t & 7;
|
|
892
|
-
n.length = (t >> 3) + 1, e.nextBytes(n), s > 0 ? n[0] &= (1 << s) - 1 : n[0] = 0, this.fromString(n, 256);
|
|
893
|
-
}
|
|
894
|
-
}, i.prototype.bitwiseTo = function(t, e, r) {
|
|
895
|
-
var n, s, o = Math.min(t.t, this.t);
|
|
896
|
-
for (n = 0; n < o; ++n)
|
|
897
|
-
r[n] = e(this[n], t[n]);
|
|
898
|
-
if (t.t < this.t) {
|
|
899
|
-
for (s = t.s & this.DM, n = o; n < this.t; ++n)
|
|
900
|
-
r[n] = e(this[n], s);
|
|
901
|
-
r.t = this.t;
|
|
902
|
-
} else {
|
|
903
|
-
for (s = this.s & this.DM, n = o; n < t.t; ++n)
|
|
904
|
-
r[n] = e(s, t[n]);
|
|
905
|
-
r.t = t.t;
|
|
906
|
-
}
|
|
907
|
-
r.s = e(this.s, t.s), r.clamp();
|
|
908
|
-
}, i.prototype.changeBit = function(t, e) {
|
|
909
|
-
var r = i.ONE.shiftLeft(t);
|
|
910
|
-
return this.bitwiseTo(r, e, r), r;
|
|
911
|
-
}, i.prototype.addTo = function(t, e) {
|
|
912
|
-
for (var r = 0, n = 0, s = Math.min(t.t, this.t); r < s; )
|
|
913
|
-
n += this[r] + t[r], e[r++] = n & this.DM, n >>= this.DB;
|
|
914
|
-
if (t.t < this.t) {
|
|
915
|
-
for (n += t.s; r < this.t; )
|
|
916
|
-
n += this[r], e[r++] = n & this.DM, n >>= this.DB;
|
|
917
|
-
n += this.s;
|
|
918
|
-
} else {
|
|
919
|
-
for (n += this.s; r < t.t; )
|
|
920
|
-
n += t[r], e[r++] = n & this.DM, n >>= this.DB;
|
|
921
|
-
n += t.s;
|
|
922
|
-
}
|
|
923
|
-
e.s = n < 0 ? -1 : 0, n > 0 ? e[r++] = n : n < -1 && (e[r++] = this.DV + n), e.t = r, e.clamp();
|
|
924
|
-
}, i.prototype.dMultiply = function(t) {
|
|
925
|
-
this[this.t] = this.am(0, t - 1, this, 0, 0, this.t), ++this.t, this.clamp();
|
|
926
|
-
}, i.prototype.dAddOffset = function(t, e) {
|
|
927
|
-
if (t != 0) {
|
|
928
|
-
for (; this.t <= e; )
|
|
929
|
-
this[this.t++] = 0;
|
|
930
|
-
for (this[e] += t; this[e] >= this.DV; )
|
|
931
|
-
this[e] -= this.DV, ++e >= this.t && (this[this.t++] = 0), ++this[e];
|
|
932
|
-
}
|
|
933
|
-
}, i.prototype.multiplyLowerTo = function(t, e, r) {
|
|
934
|
-
var n = Math.min(this.t + t.t, e);
|
|
935
|
-
for (r.s = 0, r.t = n; n > 0; )
|
|
936
|
-
r[--n] = 0;
|
|
937
|
-
for (var s = r.t - this.t; n < s; ++n)
|
|
938
|
-
r[n + this.t] = this.am(0, t[n], r, n, 0, this.t);
|
|
939
|
-
for (var s = Math.min(t.t, e); n < s; ++n)
|
|
940
|
-
this.am(0, t[n], r, n, 0, e - n);
|
|
941
|
-
r.clamp();
|
|
942
|
-
}, i.prototype.multiplyUpperTo = function(t, e, r) {
|
|
943
|
-
--e;
|
|
944
|
-
var n = r.t = this.t + t.t - e;
|
|
945
|
-
for (r.s = 0; --n >= 0; )
|
|
946
|
-
r[n] = 0;
|
|
947
|
-
for (n = Math.max(e - this.t, 0); n < t.t; ++n)
|
|
948
|
-
r[this.t + n - e] = this.am(e - n, t[n], r, 0, 0, this.t + n - e);
|
|
949
|
-
r.clamp(), r.drShiftTo(1, r);
|
|
950
|
-
}, i.prototype.modInt = function(t) {
|
|
951
|
-
if (t <= 0)
|
|
952
|
-
return 0;
|
|
953
|
-
var e = this.DV % t, r = this.s < 0 ? t - 1 : 0;
|
|
954
|
-
if (this.t > 0)
|
|
955
|
-
if (e == 0)
|
|
956
|
-
r = this[0] % t;
|
|
957
|
-
else
|
|
958
|
-
for (var n = this.t - 1; n >= 0; --n)
|
|
959
|
-
r = (e * r + this[n]) % t;
|
|
960
|
-
return r;
|
|
961
|
-
}, i.prototype.millerRabin = function(t) {
|
|
962
|
-
var e = this.subtract(i.ONE), r = e.getLowestSetBit();
|
|
963
|
-
if (r <= 0)
|
|
964
|
-
return !1;
|
|
965
|
-
var n = e.shiftRight(r);
|
|
966
|
-
t = t + 1 >> 1, t > B.length && (t = B.length);
|
|
967
|
-
for (var s = S(), o = 0; o < t; ++o) {
|
|
968
|
-
s.fromInt(B[Math.floor(Math.random() * B.length)]);
|
|
969
|
-
var a = s.modPow(n, this);
|
|
970
|
-
if (a.compareTo(i.ONE) != 0 && a.compareTo(e) != 0) {
|
|
971
|
-
for (var h = 1; h++ < r && a.compareTo(e) != 0; )
|
|
972
|
-
if (a = a.modPowInt(2, this), a.compareTo(i.ONE) == 0)
|
|
973
|
-
return !1;
|
|
974
|
-
if (a.compareTo(e) != 0)
|
|
975
|
-
return !1;
|
|
976
|
-
}
|
|
977
|
-
}
|
|
978
|
-
return !0;
|
|
979
|
-
}, i.prototype.square = function() {
|
|
980
|
-
var t = S();
|
|
981
|
-
return this.squareTo(t), t;
|
|
982
|
-
}, i.prototype.gcda = function(t, e) {
|
|
983
|
-
var r = this.s < 0 ? this.negate() : this.clone(), n = t.s < 0 ? t.negate() : t.clone();
|
|
984
|
-
if (r.compareTo(n) < 0) {
|
|
985
|
-
var s = r;
|
|
986
|
-
r = n, n = s;
|
|
987
|
-
}
|
|
988
|
-
var o = r.getLowestSetBit(), a = n.getLowestSetBit();
|
|
989
|
-
if (a < 0) {
|
|
990
|
-
e(r);
|
|
991
|
-
return;
|
|
992
|
-
}
|
|
993
|
-
o < a && (a = o), a > 0 && (r.rShiftTo(a, r), n.rShiftTo(a, n));
|
|
994
|
-
var h = function() {
|
|
995
|
-
(o = r.getLowestSetBit()) > 0 && r.rShiftTo(o, r), (o = n.getLowestSetBit()) > 0 && n.rShiftTo(o, n), r.compareTo(n) >= 0 ? (r.subTo(n, r), r.rShiftTo(1, r)) : (n.subTo(r, n), n.rShiftTo(1, n)), r.signum() > 0 ? setTimeout(h, 0) : (a > 0 && n.lShiftTo(a, n), setTimeout(function() {
|
|
996
|
-
e(n);
|
|
997
|
-
}, 0));
|
|
998
|
-
};
|
|
999
|
-
setTimeout(h, 10);
|
|
1000
|
-
}, i.prototype.fromNumberAsync = function(t, e, r, n) {
|
|
1001
|
-
if (typeof e == "number")
|
|
1002
|
-
if (t < 2)
|
|
1003
|
-
this.fromInt(1);
|
|
1004
|
-
else {
|
|
1005
|
-
this.fromNumber(t, r), this.testBit(t - 1) || this.bitwiseTo(i.ONE.shiftLeft(t - 1), ot, this), this.isEven() && this.dAddOffset(1, 0);
|
|
1006
|
-
var s = this, o = function() {
|
|
1007
|
-
s.dAddOffset(2, 0), s.bitLength() > t && s.subTo(i.ONE.shiftLeft(t - 1), s), s.isProbablePrime(e) ? setTimeout(function() {
|
|
1008
|
-
n();
|
|
1009
|
-
}, 0) : setTimeout(o, 0);
|
|
1010
|
-
};
|
|
1011
|
-
setTimeout(o, 0);
|
|
1012
|
-
}
|
|
1013
|
-
else {
|
|
1014
|
-
var a = [], h = t & 7;
|
|
1015
|
-
a.length = (t >> 3) + 1, e.nextBytes(a), h > 0 ? a[0] &= (1 << h) - 1 : a[0] = 0, this.fromString(a, 256);
|
|
1016
|
-
}
|
|
1017
|
-
}, i;
|
|
1018
|
-
})()
|
|
1019
|
-
), Ue = (
|
|
1020
|
-
/** @class */
|
|
1021
|
-
(function() {
|
|
1022
|
-
function i() {
|
|
1023
|
-
}
|
|
1024
|
-
return i.prototype.convert = function(t) {
|
|
1025
|
-
return t;
|
|
1026
|
-
}, i.prototype.revert = function(t) {
|
|
1027
|
-
return t;
|
|
1028
|
-
}, i.prototype.mulTo = function(t, e, r) {
|
|
1029
|
-
t.multiplyTo(e, r);
|
|
1030
|
-
}, i.prototype.sqrTo = function(t, e) {
|
|
1031
|
-
t.squareTo(e);
|
|
1032
|
-
}, i;
|
|
1033
|
-
})()
|
|
1034
|
-
), Ft = (
|
|
1035
|
-
/** @class */
|
|
1036
|
-
(function() {
|
|
1037
|
-
function i(t) {
|
|
1038
|
-
this.m = t;
|
|
1039
|
-
}
|
|
1040
|
-
return i.prototype.convert = function(t) {
|
|
1041
|
-
return t.s < 0 || t.compareTo(this.m) >= 0 ? t.mod(this.m) : t;
|
|
1042
|
-
}, i.prototype.revert = function(t) {
|
|
1043
|
-
return t;
|
|
1044
|
-
}, i.prototype.reduce = function(t) {
|
|
1045
|
-
t.divRemTo(this.m, null, t);
|
|
1046
|
-
}, i.prototype.mulTo = function(t, e, r) {
|
|
1047
|
-
t.multiplyTo(e, r), this.reduce(r);
|
|
1048
|
-
}, i.prototype.sqrTo = function(t, e) {
|
|
1049
|
-
t.squareTo(e), this.reduce(e);
|
|
1050
|
-
}, i;
|
|
1051
|
-
})()
|
|
1052
|
-
), Ht = (
|
|
1053
|
-
/** @class */
|
|
1054
|
-
(function() {
|
|
1055
|
-
function i(t) {
|
|
1056
|
-
this.m = t, this.mp = t.invDigit(), this.mpl = this.mp & 32767, this.mph = this.mp >> 15, this.um = (1 << t.DB - 15) - 1, this.mt2 = 2 * t.t;
|
|
1057
|
-
}
|
|
1058
|
-
return i.prototype.convert = function(t) {
|
|
1059
|
-
var e = S();
|
|
1060
|
-
return t.abs().dlShiftTo(this.m.t, e), e.divRemTo(this.m, null, e), t.s < 0 && e.compareTo(y.ZERO) > 0 && this.m.subTo(e, e), e;
|
|
1061
|
-
}, i.prototype.revert = function(t) {
|
|
1062
|
-
var e = S();
|
|
1063
|
-
return t.copyTo(e), this.reduce(e), e;
|
|
1064
|
-
}, i.prototype.reduce = function(t) {
|
|
1065
|
-
for (; t.t <= this.mt2; )
|
|
1066
|
-
t[t.t++] = 0;
|
|
1067
|
-
for (var e = 0; e < this.m.t; ++e) {
|
|
1068
|
-
var r = t[e] & 32767, n = r * this.mpl + ((r * this.mph + (t[e] >> 15) * this.mpl & this.um) << 15) & t.DM;
|
|
1069
|
-
for (r = e + this.m.t, t[r] += this.m.am(0, n, t, e, 0, this.m.t); t[r] >= t.DV; )
|
|
1070
|
-
t[r] -= t.DV, t[++r]++;
|
|
1071
|
-
}
|
|
1072
|
-
t.clamp(), t.drShiftTo(this.m.t, t), t.compareTo(this.m) >= 0 && t.subTo(this.m, t);
|
|
1073
|
-
}, i.prototype.mulTo = function(t, e, r) {
|
|
1074
|
-
t.multiplyTo(e, r), this.reduce(r);
|
|
1075
|
-
}, i.prototype.sqrTo = function(t, e) {
|
|
1076
|
-
t.squareTo(e), this.reduce(e);
|
|
1077
|
-
}, i;
|
|
1078
|
-
})()
|
|
1079
|
-
), Le = (
|
|
1080
|
-
/** @class */
|
|
1081
|
-
(function() {
|
|
1082
|
-
function i(t) {
|
|
1083
|
-
this.m = t, this.r2 = S(), this.q3 = S(), y.ONE.dlShiftTo(2 * t.t, this.r2), this.mu = this.r2.divide(t);
|
|
1084
|
-
}
|
|
1085
|
-
return i.prototype.convert = function(t) {
|
|
1086
|
-
if (t.s < 0 || t.t > 2 * this.m.t)
|
|
1087
|
-
return t.mod(this.m);
|
|
1088
|
-
if (t.compareTo(this.m) < 0)
|
|
1089
|
-
return t;
|
|
1090
|
-
var e = S();
|
|
1091
|
-
return t.copyTo(e), this.reduce(e), e;
|
|
1092
|
-
}, i.prototype.revert = function(t) {
|
|
1093
|
-
return t;
|
|
1094
|
-
}, i.prototype.reduce = function(t) {
|
|
1095
|
-
for (t.drShiftTo(this.m.t - 1, this.r2), t.t > this.m.t + 1 && (t.t = this.m.t + 1, t.clamp()), this.mu.multiplyUpperTo(this.r2, this.m.t + 1, this.q3), this.m.multiplyLowerTo(this.q3, this.m.t + 1, this.r2); t.compareTo(this.r2) < 0; )
|
|
1096
|
-
t.dAddOffset(1, this.m.t + 1);
|
|
1097
|
-
for (t.subTo(this.r2, t); t.compareTo(this.m) >= 0; )
|
|
1098
|
-
t.subTo(this.m, t);
|
|
1099
|
-
}, i.prototype.mulTo = function(t, e, r) {
|
|
1100
|
-
t.multiplyTo(e, r), this.reduce(r);
|
|
1101
|
-
}, i.prototype.sqrTo = function(t, e) {
|
|
1102
|
-
t.squareTo(e), this.reduce(e);
|
|
1103
|
-
}, i;
|
|
1104
|
-
})()
|
|
1105
|
-
);
|
|
1106
|
-
function S() {
|
|
1107
|
-
return new y(null);
|
|
1108
|
-
}
|
|
1109
|
-
function x(i, t) {
|
|
1110
|
-
return new y(i, t);
|
|
1111
|
-
}
|
|
1112
|
-
var Ut = typeof navigator < "u";
|
|
1113
|
-
Ut && qt && navigator.appName == "Microsoft Internet Explorer" ? (y.prototype.am = function(t, e, r, n, s, o) {
|
|
1114
|
-
for (var a = e & 32767, h = e >> 15; --o >= 0; ) {
|
|
1115
|
-
var f = this[t] & 32767, c = this[t++] >> 15, l = h * f + c * a;
|
|
1116
|
-
f = a * f + ((l & 32767) << 15) + r[n] + (s & 1073741823), s = (f >>> 30) + (l >>> 15) + h * c + (s >>> 30), r[n++] = f & 1073741823;
|
|
1117
|
-
}
|
|
1118
|
-
return s;
|
|
1119
|
-
}, H = 30) : Ut && qt && navigator.appName != "Netscape" ? (y.prototype.am = function(t, e, r, n, s, o) {
|
|
1120
|
-
for (; --o >= 0; ) {
|
|
1121
|
-
var a = e * this[t++] + r[n] + s;
|
|
1122
|
-
s = Math.floor(a / 67108864), r[n++] = a & 67108863;
|
|
1123
|
-
}
|
|
1124
|
-
return s;
|
|
1125
|
-
}, H = 26) : (y.prototype.am = function(t, e, r, n, s, o) {
|
|
1126
|
-
for (var a = e & 16383, h = e >> 14; --o >= 0; ) {
|
|
1127
|
-
var f = this[t] & 16383, c = this[t++] >> 14, l = h * f + c * a;
|
|
1128
|
-
f = a * f + ((l & 16383) << 14) + r[n] + s, s = (f >> 28) + (l >> 14) + h * c, r[n++] = f & 268435455;
|
|
1129
|
-
}
|
|
1130
|
-
return s;
|
|
1131
|
-
}, H = 28);
|
|
1132
|
-
y.prototype.DB = H;
|
|
1133
|
-
y.prototype.DM = (1 << H) - 1;
|
|
1134
|
-
y.prototype.DV = 1 << H;
|
|
1135
|
-
var It = 52;
|
|
1136
|
-
y.prototype.FV = Math.pow(2, It);
|
|
1137
|
-
y.prototype.F1 = It - H;
|
|
1138
|
-
y.prototype.F2 = 2 * H - It;
|
|
1139
|
-
var yt = [], W, V;
|
|
1140
|
-
W = 48;
|
|
1141
|
-
for (V = 0; V <= 9; ++V)
|
|
1142
|
-
yt[W++] = V;
|
|
1143
|
-
W = 97;
|
|
1144
|
-
for (V = 10; V < 36; ++V)
|
|
1145
|
-
yt[W++] = V;
|
|
1146
|
-
W = 65;
|
|
1147
|
-
for (V = 10; V < 36; ++V)
|
|
1148
|
-
yt[W++] = V;
|
|
1149
|
-
function Lt(i, t) {
|
|
1150
|
-
var e = yt[i.charCodeAt(t)];
|
|
1151
|
-
return e ?? -1;
|
|
1152
|
-
}
|
|
1153
|
-
function q(i) {
|
|
1154
|
-
var t = S();
|
|
1155
|
-
return t.fromInt(i), t;
|
|
1156
|
-
}
|
|
1157
|
-
function at(i) {
|
|
1158
|
-
var t = 1, e;
|
|
1159
|
-
return (e = i >>> 16) != 0 && (i = e, t += 16), (e = i >> 8) != 0 && (i = e, t += 8), (e = i >> 4) != 0 && (i = e, t += 4), (e = i >> 2) != 0 && (i = e, t += 2), (e = i >> 1) != 0 && (i = e, t += 1), t;
|
|
1160
|
-
}
|
|
1161
|
-
y.ZERO = q(0);
|
|
1162
|
-
y.ONE = q(1);
|
|
1163
|
-
var Ke = (
|
|
1164
|
-
/** @class */
|
|
1165
|
-
(function() {
|
|
1166
|
-
function i() {
|
|
1167
|
-
this.i = 0, this.j = 0, this.S = [];
|
|
1168
|
-
}
|
|
1169
|
-
return i.prototype.init = function(t) {
|
|
1170
|
-
var e, r, n;
|
|
1171
|
-
for (e = 0; e < 256; ++e)
|
|
1172
|
-
this.S[e] = e;
|
|
1173
|
-
for (r = 0, e = 0; e < 256; ++e)
|
|
1174
|
-
r = r + this.S[e] + t[e % t.length] & 255, n = this.S[e], this.S[e] = this.S[r], this.S[r] = n;
|
|
1175
|
-
this.i = 0, this.j = 0;
|
|
1176
|
-
}, i.prototype.next = function() {
|
|
1177
|
-
var t;
|
|
1178
|
-
return this.i = this.i + 1 & 255, this.j = this.j + this.S[this.i] & 255, t = this.S[this.i], this.S[this.i] = this.S[this.j], this.S[this.j] = t, this.S[t + this.S[this.i] & 255];
|
|
1179
|
-
}, i;
|
|
1180
|
-
})()
|
|
1181
|
-
);
|
|
1182
|
-
function je() {
|
|
1183
|
-
return new Ke();
|
|
1184
|
-
}
|
|
1185
|
-
var ie = 256, ht, F = null, _;
|
|
1186
|
-
if (F == null) {
|
|
1187
|
-
F = [], _ = 0;
|
|
1188
|
-
var ut = void 0;
|
|
1189
|
-
if (typeof window < "u" && self.crypto && self.crypto.getRandomValues) {
|
|
1190
|
-
var Et = new Uint32Array(256);
|
|
1191
|
-
for (self.crypto.getRandomValues(Et), ut = 0; ut < Et.length; ++ut)
|
|
1192
|
-
F[_++] = Et[ut] & 255;
|
|
1193
|
-
}
|
|
1194
|
-
var ft = 0, lt = function(i) {
|
|
1195
|
-
if (ft = ft || 0, ft >= 256 || _ >= ie) {
|
|
1196
|
-
self.removeEventListener ? self.removeEventListener("mousemove", lt, !1) : self.detachEvent && self.detachEvent("onmousemove", lt);
|
|
1197
|
-
return;
|
|
1198
|
-
}
|
|
1199
|
-
try {
|
|
1200
|
-
var t = i.x + i.y;
|
|
1201
|
-
F[_++] = t & 255, ft += 1;
|
|
1202
|
-
} catch {
|
|
1203
|
-
}
|
|
1204
|
-
};
|
|
1205
|
-
typeof window < "u" && (self.addEventListener ? self.addEventListener("mousemove", lt, !1) : self.attachEvent && self.attachEvent("onmousemove", lt));
|
|
1206
|
-
}
|
|
1207
|
-
function ze() {
|
|
1208
|
-
if (ht == null) {
|
|
1209
|
-
for (ht = je(); _ < ie; ) {
|
|
1210
|
-
var i = Math.floor(65536 * Math.random());
|
|
1211
|
-
F[_++] = i & 255;
|
|
1212
|
-
}
|
|
1213
|
-
for (ht.init(F), _ = 0; _ < F.length; ++_)
|
|
1214
|
-
F[_] = 0;
|
|
1215
|
-
_ = 0;
|
|
1216
|
-
}
|
|
1217
|
-
return ht.next();
|
|
1218
|
-
}
|
|
1219
|
-
var gt = (
|
|
1220
|
-
/** @class */
|
|
1221
|
-
(function() {
|
|
1222
|
-
function i() {
|
|
1223
|
-
}
|
|
1224
|
-
return i.prototype.nextBytes = function(t) {
|
|
1225
|
-
for (var e = 0; e < t.length; ++e)
|
|
1226
|
-
t[e] = ze();
|
|
1227
|
-
}, i;
|
|
1228
|
-
})()
|
|
1229
|
-
);
|
|
1230
|
-
function Rt(i) {
|
|
1231
|
-
return $e(er(Ze(i), i.length * 8));
|
|
1232
|
-
}
|
|
1233
|
-
function Kt(i) {
|
|
1234
|
-
for (var t = "0123456789abcdef", e = "", r = 0; r < i.length; r++) {
|
|
1235
|
-
var n = i.charCodeAt(r);
|
|
1236
|
-
e += t.charAt(n >>> 4 & 15) + t.charAt(n & 15);
|
|
1237
|
-
}
|
|
1238
|
-
return e;
|
|
1239
|
-
}
|
|
1240
|
-
function Ze(i) {
|
|
1241
|
-
for (var t = Array(i.length >> 2), e = 0; e < t.length; e++)
|
|
1242
|
-
t[e] = 0;
|
|
1243
|
-
for (var e = 0; e < i.length * 8; e += 8)
|
|
1244
|
-
t[e >> 5] |= (i.charCodeAt(e / 8) & 255) << 24 - e % 32;
|
|
1245
|
-
return t;
|
|
1246
|
-
}
|
|
1247
|
-
function $e(i) {
|
|
1248
|
-
for (var t = "", e = 0; e < i.length * 32; e += 8)
|
|
1249
|
-
t += String.fromCharCode(i[e >> 5] >>> 24 - e % 32 & 255);
|
|
1250
|
-
return t;
|
|
1251
|
-
}
|
|
1252
|
-
function P(i, t) {
|
|
1253
|
-
return i >>> t | i << 32 - t;
|
|
1254
|
-
}
|
|
1255
|
-
function ne(i, t) {
|
|
1256
|
-
return i >>> t;
|
|
1257
|
-
}
|
|
1258
|
-
function Ge(i, t, e) {
|
|
1259
|
-
return i & t ^ ~i & e;
|
|
1260
|
-
}
|
|
1261
|
-
function Je(i, t, e) {
|
|
1262
|
-
return i & t ^ i & e ^ t & e;
|
|
1263
|
-
}
|
|
1264
|
-
function We(i) {
|
|
1265
|
-
return P(i, 2) ^ P(i, 13) ^ P(i, 22);
|
|
1266
|
-
}
|
|
1267
|
-
function Ye(i) {
|
|
1268
|
-
return P(i, 6) ^ P(i, 11) ^ P(i, 25);
|
|
1269
|
-
}
|
|
1270
|
-
function Qe(i) {
|
|
1271
|
-
return P(i, 7) ^ P(i, 18) ^ ne(i, 3);
|
|
1272
|
-
}
|
|
1273
|
-
function Xe(i) {
|
|
1274
|
-
return P(i, 17) ^ P(i, 19) ^ ne(i, 10);
|
|
1275
|
-
}
|
|
1276
|
-
var tr = new Array(1116352408, 1899447441, -1245643825, -373957723, 961987163, 1508970993, -1841331548, -1424204075, -670586216, 310598401, 607225278, 1426881987, 1925078388, -2132889090, -1680079193, -1046744716, -459576895, -272742522, 264347078, 604807628, 770255983, 1249150122, 1555081692, 1996064986, -1740746414, -1473132947, -1341970488, -1084653625, -958395405, -710438585, 113926993, 338241895, 666307205, 773529912, 1294757372, 1396182291, 1695183700, 1986661051, -2117940946, -1838011259, -1564481375, -1474664885, -1035236496, -949202525, -778901479, -694614492, -200395387, 275423344, 430227734, 506948616, 659060556, 883997877, 958139571, 1322822218, 1537002063, 1747873779, 1955562222, 2024104815, -2067236844, -1933114872, -1866530822, -1538233109, -1090935817, -965641998);
|
|
1277
|
-
function er(i, t) {
|
|
1278
|
-
var e = new Array(1779033703, -1150833019, 1013904242, -1521486534, 1359893119, -1694144372, 528734635, 1541459225), r = new Array(64), n, s, o, a, h, f, c, l, g, v, d, p;
|
|
1279
|
-
for (i[t >> 5] |= 128 << 24 - t % 32, i[(t + 64 >> 9 << 4) + 15] = t, g = 0; g < i.length; g += 16) {
|
|
1280
|
-
for (n = e[0], s = e[1], o = e[2], a = e[3], h = e[4], f = e[5], c = e[6], l = e[7], v = 0; v < 64; v++)
|
|
1281
|
-
v < 16 ? r[v] = i[v + g] : r[v] = R(R(R(Xe(r[v - 2]), r[v - 7]), Qe(r[v - 15])), r[v - 16]), d = R(R(R(R(l, Ye(h)), Ge(h, f, c)), tr[v]), r[v]), p = R(We(n), Je(n, s, o)), l = c, c = f, f = h, h = R(a, d), a = o, o = s, s = n, n = R(d, p);
|
|
1282
|
-
e[0] = R(n, e[0]), e[1] = R(s, e[1]), e[2] = R(o, e[2]), e[3] = R(a, e[3]), e[4] = R(h, e[4]), e[5] = R(f, e[5]), e[6] = R(c, e[6]), e[7] = R(l, e[7]);
|
|
1283
|
-
}
|
|
1284
|
-
return e;
|
|
1285
|
-
}
|
|
1286
|
-
function R(i, t) {
|
|
1287
|
-
var e = (i & 65535) + (t & 65535), r = (i >> 16) + (t >> 16) + (e >> 16);
|
|
1288
|
-
return r << 16 | e & 65535;
|
|
1289
|
-
}
|
|
1290
|
-
function rr(i, t) {
|
|
1291
|
-
if (t < i.length + 22)
|
|
1292
|
-
return console.error("Message too long for RSA"), null;
|
|
1293
|
-
for (var e = t - i.length - 6, r = "", n = 0; n < e; n += 2)
|
|
1294
|
-
r += "ff";
|
|
1295
|
-
var s = "0001" + r + "00" + i;
|
|
1296
|
-
return x(s, 16);
|
|
1297
|
-
}
|
|
1298
|
-
function ir(i, t) {
|
|
1299
|
-
if (t < i.length + 11)
|
|
1300
|
-
return console.error("Message too long for RSA"), null;
|
|
1301
|
-
for (var e = [], r = i.length - 1; r >= 0 && t > 0; ) {
|
|
1302
|
-
var n = i.charCodeAt(r--);
|
|
1303
|
-
n < 128 ? e[--t] = n : n > 127 && n < 2048 ? (e[--t] = n & 63 | 128, e[--t] = n >> 6 | 192) : (e[--t] = n & 63 | 128, e[--t] = n >> 6 & 63 | 128, e[--t] = n >> 12 | 224);
|
|
1304
|
-
}
|
|
1305
|
-
e[--t] = 0;
|
|
1306
|
-
for (var s = new gt(), o = []; t > 2; ) {
|
|
1307
|
-
for (o[0] = 0; o[0] == 0; )
|
|
1308
|
-
s.nextBytes(o);
|
|
1309
|
-
e[--t] = o[0];
|
|
1310
|
-
}
|
|
1311
|
-
return e[--t] = 2, e[--t] = 0, new y(e);
|
|
1312
|
-
}
|
|
1313
|
-
function jt(i, t, e) {
|
|
1314
|
-
for (var r = "", n = 0; r.length < t; )
|
|
1315
|
-
r += e(String.fromCharCode.apply(String, i.concat([
|
|
1316
|
-
(n & 4278190080) >> 24,
|
|
1317
|
-
(n & 16711680) >> 16,
|
|
1318
|
-
(n & 65280) >> 8,
|
|
1319
|
-
n & 255
|
|
1320
|
-
]))), n += 1;
|
|
1321
|
-
return r;
|
|
1322
|
-
}
|
|
1323
|
-
var nr = 32;
|
|
1324
|
-
function sr(i, t) {
|
|
1325
|
-
var e = nr, r = Rt;
|
|
1326
|
-
if (i.length + 2 * e + 2 > t)
|
|
1327
|
-
throw "Message too long for RSA";
|
|
1328
|
-
var n = "", s;
|
|
1329
|
-
for (s = 0; s < t - i.length - 2 * e - 2; s += 1)
|
|
1330
|
-
n += "\0";
|
|
1331
|
-
var o = r("") + n + "" + i, a = new Array(e);
|
|
1332
|
-
new gt().nextBytes(a);
|
|
1333
|
-
var h = jt(a, o.length, r), f = [];
|
|
1334
|
-
for (s = 0; s < o.length; s += 1)
|
|
1335
|
-
f[s] = o.charCodeAt(s) ^ h.charCodeAt(s);
|
|
1336
|
-
var c = jt(f, a.length, r), l = [0];
|
|
1337
|
-
for (s = 0; s < a.length; s += 1)
|
|
1338
|
-
l[s + 1] = a[s] ^ c.charCodeAt(s);
|
|
1339
|
-
return new y(l.concat(f));
|
|
1340
|
-
}
|
|
1341
|
-
var or = (
|
|
1342
|
-
/** @class */
|
|
1343
|
-
(function() {
|
|
1344
|
-
function i() {
|
|
1345
|
-
this.n = null, this.e = 0, this.d = null, this.p = null, this.q = null, this.dmp1 = null, this.dmq1 = null, this.coeff = null;
|
|
1346
|
-
}
|
|
1347
|
-
return i.prototype.doPublic = function(t) {
|
|
1348
|
-
return t.modPowInt(this.e, this.n);
|
|
1349
|
-
}, i.prototype.doPrivate = function(t) {
|
|
1350
|
-
if (this.p == null || this.q == null)
|
|
1351
|
-
return t.modPow(this.d, this.n);
|
|
1352
|
-
for (var e = t.mod(this.p).modPow(this.dmp1, this.p), r = t.mod(this.q).modPow(this.dmq1, this.q); e.compareTo(r) < 0; )
|
|
1353
|
-
e = e.add(this.p);
|
|
1354
|
-
return e.subtract(r).multiply(this.coeff).mod(this.p).multiply(this.q).add(r);
|
|
1355
|
-
}, i.prototype.setPublic = function(t, e) {
|
|
1356
|
-
t != null && e != null && t.length > 0 && e.length > 0 ? (this.n = x(t, 16), this.e = parseInt(e, 16)) : console.error("Invalid RSA public key");
|
|
1357
|
-
}, i.prototype.encrypt = function(t, e) {
|
|
1358
|
-
typeof e > "u" && (e = ir);
|
|
1359
|
-
var r = this.n.bitLength() + 7 >> 3, n = e(t, r);
|
|
1360
|
-
if (n == null)
|
|
1361
|
-
return null;
|
|
1362
|
-
var s = this.doPublic(n);
|
|
1363
|
-
if (s == null)
|
|
1364
|
-
return null;
|
|
1365
|
-
for (var o = s.toString(16), a = o.length, h = 0; h < r * 2 - a; h++)
|
|
1366
|
-
o = "0" + o;
|
|
1367
|
-
return o;
|
|
1368
|
-
}, i.prototype.setPrivate = function(t, e, r) {
|
|
1369
|
-
t != null && e != null && t.length > 0 && e.length > 0 ? (this.n = x(t, 16), this.e = parseInt(e, 16), this.d = x(r, 16)) : console.error("Invalid RSA private key");
|
|
1370
|
-
}, i.prototype.setPrivateEx = function(t, e, r, n, s, o, a, h) {
|
|
1371
|
-
t != null && e != null && t.length > 0 && e.length > 0 ? (this.n = x(t, 16), this.e = parseInt(e, 16), this.d = x(r, 16), this.p = x(n, 16), this.q = x(s, 16), this.dmp1 = x(o, 16), this.dmq1 = x(a, 16), this.coeff = x(h, 16)) : console.error("Invalid RSA private key");
|
|
1372
|
-
}, i.prototype.generate = function(t, e) {
|
|
1373
|
-
var r = new gt(), n = t >> 1;
|
|
1374
|
-
this.e = parseInt(e, 16);
|
|
1375
|
-
for (var s = new y(e, 16); ; ) {
|
|
1376
|
-
for (; this.p = new y(t - n, 1, r), !(this.p.subtract(y.ONE).gcd(s).compareTo(y.ONE) == 0 && this.p.isProbablePrime(10)); )
|
|
1377
|
-
;
|
|
1378
|
-
for (; this.q = new y(n, 1, r), !(this.q.subtract(y.ONE).gcd(s).compareTo(y.ONE) == 0 && this.q.isProbablePrime(10)); )
|
|
1379
|
-
;
|
|
1380
|
-
if (this.p.compareTo(this.q) <= 0) {
|
|
1381
|
-
var o = this.p;
|
|
1382
|
-
this.p = this.q, this.q = o;
|
|
1383
|
-
}
|
|
1384
|
-
var a = this.p.subtract(y.ONE), h = this.q.subtract(y.ONE), f = a.multiply(h);
|
|
1385
|
-
if (f.gcd(s).compareTo(y.ONE) == 0) {
|
|
1386
|
-
this.n = this.p.multiply(this.q), this.d = s.modInverse(f), this.dmp1 = this.d.mod(a), this.dmq1 = this.d.mod(h), this.coeff = this.q.modInverse(this.p);
|
|
1387
|
-
break;
|
|
1388
|
-
}
|
|
1389
|
-
}
|
|
1390
|
-
}, i.prototype.decrypt = function(t) {
|
|
1391
|
-
var e = x(t, 16), r = this.doPrivate(e);
|
|
1392
|
-
return r == null ? null : ar(r, this.n.bitLength() + 7 >> 3);
|
|
1393
|
-
}, i.prototype.generateAsync = function(t, e, r) {
|
|
1394
|
-
var n = new gt(), s = t >> 1;
|
|
1395
|
-
this.e = parseInt(e, 16);
|
|
1396
|
-
var o = new y(e, 16), a = this, h = function() {
|
|
1397
|
-
var f = function() {
|
|
1398
|
-
if (a.p.compareTo(a.q) <= 0) {
|
|
1399
|
-
var g = a.p;
|
|
1400
|
-
a.p = a.q, a.q = g;
|
|
1401
|
-
}
|
|
1402
|
-
var v = a.p.subtract(y.ONE), d = a.q.subtract(y.ONE), p = v.multiply(d);
|
|
1403
|
-
p.gcd(o).compareTo(y.ONE) == 0 ? (a.n = a.p.multiply(a.q), a.d = o.modInverse(p), a.dmp1 = a.d.mod(v), a.dmq1 = a.d.mod(d), a.coeff = a.q.modInverse(a.p), setTimeout(function() {
|
|
1404
|
-
r();
|
|
1405
|
-
}, 0)) : setTimeout(h, 0);
|
|
1406
|
-
}, c = function() {
|
|
1407
|
-
a.q = S(), a.q.fromNumberAsync(s, 1, n, function() {
|
|
1408
|
-
a.q.subtract(y.ONE).gcda(o, function(g) {
|
|
1409
|
-
g.compareTo(y.ONE) == 0 && a.q.isProbablePrime(10) ? setTimeout(f, 0) : setTimeout(c, 0);
|
|
1410
|
-
});
|
|
1411
|
-
});
|
|
1412
|
-
}, l = function() {
|
|
1413
|
-
a.p = S(), a.p.fromNumberAsync(t - s, 1, n, function() {
|
|
1414
|
-
a.p.subtract(y.ONE).gcda(o, function(g) {
|
|
1415
|
-
g.compareTo(y.ONE) == 0 && a.p.isProbablePrime(10) ? setTimeout(c, 0) : setTimeout(l, 0);
|
|
1416
|
-
});
|
|
1417
|
-
});
|
|
1418
|
-
};
|
|
1419
|
-
setTimeout(l, 0);
|
|
1420
|
-
};
|
|
1421
|
-
setTimeout(h, 0);
|
|
1422
|
-
}, i.prototype.sign = function(t, e, r) {
|
|
1423
|
-
var n = hr(r), s = n + e(t).toString(), o = this.n.bitLength() / 4, a = rr(s, o);
|
|
1424
|
-
if (a == null)
|
|
1425
|
-
return null;
|
|
1426
|
-
var h = this.doPrivate(a);
|
|
1427
|
-
if (h == null)
|
|
1428
|
-
return null;
|
|
1429
|
-
for (var f = h.toString(16), c = f.length, l = 0; l < o - c; l++)
|
|
1430
|
-
f = "0" + f;
|
|
1431
|
-
return f;
|
|
1432
|
-
}, i.prototype.verify = function(t, e, r) {
|
|
1433
|
-
var n = x(e, 16), s = this.doPublic(n);
|
|
1434
|
-
if (s == null)
|
|
1435
|
-
return null;
|
|
1436
|
-
var o = s.toString(16).replace(/^1f+00/, ""), a = ur(o);
|
|
1437
|
-
return a == r(t).toString();
|
|
1438
|
-
}, i;
|
|
1439
|
-
})()
|
|
1440
|
-
);
|
|
1441
|
-
function ar(i, t) {
|
|
1442
|
-
for (var e = i.toByteArray(), r = 0; r < e.length && e[r] == 0; )
|
|
1443
|
-
++r;
|
|
1444
|
-
if (e.length - r != t - 1 || e[r] != 2)
|
|
1445
|
-
return null;
|
|
1446
|
-
for (++r; e[r] != 0; )
|
|
1447
|
-
if (++r >= e.length)
|
|
1448
|
-
return null;
|
|
1449
|
-
for (var n = ""; ++r < e.length; ) {
|
|
1450
|
-
var s = e[r] & 255;
|
|
1451
|
-
s < 128 ? n += String.fromCharCode(s) : s > 191 && s < 224 ? (n += String.fromCharCode((s & 31) << 6 | e[r + 1] & 63), ++r) : (n += String.fromCharCode((s & 15) << 12 | (e[r + 1] & 63) << 6 | e[r + 2] & 63), r += 2);
|
|
1452
|
-
}
|
|
1453
|
-
return n;
|
|
1454
|
-
}
|
|
1455
|
-
var ct = {
|
|
1456
|
-
md2: "3020300c06082a864886f70d020205000410",
|
|
1457
|
-
md5: "3020300c06082a864886f70d020505000410",
|
|
1458
|
-
sha1: "3021300906052b0e03021a05000414",
|
|
1459
|
-
sha224: "302d300d06096086480165030402040500041c",
|
|
1460
|
-
sha256: "3031300d060960864801650304020105000420",
|
|
1461
|
-
sha384: "3041300d060960864801650304020205000430",
|
|
1462
|
-
sha512: "3051300d060960864801650304020305000440",
|
|
1463
|
-
ripemd160: "3021300906052b2403020105000414"
|
|
1464
|
-
};
|
|
1465
|
-
function hr(i) {
|
|
1466
|
-
return ct[i] || "";
|
|
1467
|
-
}
|
|
1468
|
-
function ur(i) {
|
|
1469
|
-
for (var t in ct)
|
|
1470
|
-
if (ct.hasOwnProperty(t)) {
|
|
1471
|
-
var e = ct[t], r = e.length;
|
|
1472
|
-
if (i.substring(0, r) == e)
|
|
1473
|
-
return i.substring(r);
|
|
1474
|
-
}
|
|
1475
|
-
return i;
|
|
1476
|
-
}
|
|
1477
|
-
function A(i, t, e) {
|
|
1478
|
-
if (!t || !i)
|
|
1479
|
-
throw new Error("extend failed, please check that all dependencies are included.");
|
|
1480
|
-
var r = function() {
|
|
1481
|
-
};
|
|
1482
|
-
r.prototype = t.prototype, i.prototype = new r(), i.prototype.constructor = i, i.superclass = t.prototype, t.prototype.constructor == Object.prototype.constructor && (t.prototype.constructor = t);
|
|
1483
|
-
}
|
|
1484
|
-
/**
|
|
1485
|
-
* @fileOverview
|
|
1486
|
-
* @name asn1-1.0.js
|
|
1487
|
-
* @author Kenji Urushima kenji.urushima@gmail.com
|
|
1488
|
-
* @version asn1 1.0.13 (2017-Jun-02)
|
|
1489
|
-
* @since jsrsasign 2.1
|
|
1490
|
-
* @license <a href="https://kjur.github.io/jsrsasign/license/">MIT License</a>
|
|
1491
|
-
*/
|
|
1492
|
-
var u = {};
|
|
1493
|
-
(typeof u.asn1 > "u" || !u.asn1) && (u.asn1 = {});
|
|
1494
|
-
u.asn1.ASN1Util = new function() {
|
|
1495
|
-
this.integerToByteHex = function(i) {
|
|
1496
|
-
var t = i.toString(16);
|
|
1497
|
-
return t.length % 2 == 1 && (t = "0" + t), t;
|
|
1498
|
-
}, this.bigIntToMinTwosComplementsHex = function(i) {
|
|
1499
|
-
var t = i.toString(16);
|
|
1500
|
-
if (t.substring(0, 1) != "-")
|
|
1501
|
-
t.length % 2 == 1 ? t = "0" + t : t.match(/^[0-7]/) || (t = "00" + t);
|
|
1502
|
-
else {
|
|
1503
|
-
var e = t.substring(1), r = e.length;
|
|
1504
|
-
r % 2 == 1 ? r += 1 : t.match(/^[0-7]/) || (r += 2);
|
|
1505
|
-
for (var n = "", s = 0; s < r; s++)
|
|
1506
|
-
n += "f";
|
|
1507
|
-
var o = new y(n, 16), a = o.xor(i).add(y.ONE);
|
|
1508
|
-
t = a.toString(16).replace(/^-/, "");
|
|
1509
|
-
}
|
|
1510
|
-
return t;
|
|
1511
|
-
}, this.getPEMStringFromHex = function(i, t) {
|
|
1512
|
-
return hextopem(i, t);
|
|
1513
|
-
}, this.newObject = function(i) {
|
|
1514
|
-
var t = u, e = t.asn1, r = e.DERBoolean, n = e.DERInteger, s = e.DERBitString, o = e.DEROctetString, a = e.DERNull, h = e.DERObjectIdentifier, f = e.DEREnumerated, c = e.DERUTF8String, l = e.DERNumericString, g = e.DERPrintableString, v = e.DERTeletexString, d = e.DERIA5String, p = e.DERUTCTime, T = e.DERGeneralizedTime, E = e.DERSequence, w = e.DERSet, I = e.DERTaggedObject, m = e.ASN1Util.newObject, k = Object.keys(i);
|
|
1515
|
-
if (k.length != 1)
|
|
1516
|
-
throw "key of param shall be only one.";
|
|
1517
|
-
var b = k[0];
|
|
1518
|
-
if (":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":" + b + ":") == -1)
|
|
1519
|
-
throw "undefined key: " + b;
|
|
1520
|
-
if (b == "bool")
|
|
1521
|
-
return new r(i[b]);
|
|
1522
|
-
if (b == "int")
|
|
1523
|
-
return new n(i[b]);
|
|
1524
|
-
if (b == "bitstr")
|
|
1525
|
-
return new s(i[b]);
|
|
1526
|
-
if (b == "octstr")
|
|
1527
|
-
return new o(i[b]);
|
|
1528
|
-
if (b == "null")
|
|
1529
|
-
return new a(i[b]);
|
|
1530
|
-
if (b == "oid")
|
|
1531
|
-
return new h(i[b]);
|
|
1532
|
-
if (b == "enum")
|
|
1533
|
-
return new f(i[b]);
|
|
1534
|
-
if (b == "utf8str")
|
|
1535
|
-
return new c(i[b]);
|
|
1536
|
-
if (b == "numstr")
|
|
1537
|
-
return new l(i[b]);
|
|
1538
|
-
if (b == "prnstr")
|
|
1539
|
-
return new g(i[b]);
|
|
1540
|
-
if (b == "telstr")
|
|
1541
|
-
return new v(i[b]);
|
|
1542
|
-
if (b == "ia5str")
|
|
1543
|
-
return new d(i[b]);
|
|
1544
|
-
if (b == "utctime")
|
|
1545
|
-
return new p(i[b]);
|
|
1546
|
-
if (b == "gentime")
|
|
1547
|
-
return new T(i[b]);
|
|
1548
|
-
if (b == "seq") {
|
|
1549
|
-
for (var Y = i[b], Q = [], U = 0; U < Y.length; U++) {
|
|
1550
|
-
var bt = m(Y[U]);
|
|
1551
|
-
Q.push(bt);
|
|
1552
|
-
}
|
|
1553
|
-
return new E({ array: Q });
|
|
1554
|
-
}
|
|
1555
|
-
if (b == "set") {
|
|
1556
|
-
for (var Y = i[b], Q = [], U = 0; U < Y.length; U++) {
|
|
1557
|
-
var bt = m(Y[U]);
|
|
1558
|
-
Q.push(bt);
|
|
1559
|
-
}
|
|
1560
|
-
return new w({ array: Q });
|
|
1561
|
-
}
|
|
1562
|
-
if (b == "tag") {
|
|
1563
|
-
var N = i[b];
|
|
1564
|
-
if (Object.prototype.toString.call(N) === "[object Array]" && N.length == 3) {
|
|
1565
|
-
var de = m(N[2]);
|
|
1566
|
-
return new I({
|
|
1567
|
-
tag: N[0],
|
|
1568
|
-
explicit: N[1],
|
|
1569
|
-
obj: de
|
|
1570
|
-
});
|
|
1571
|
-
} else {
|
|
1572
|
-
var nt = {};
|
|
1573
|
-
if (N.explicit !== void 0 && (nt.explicit = N.explicit), N.tag !== void 0 && (nt.tag = N.tag), N.obj === void 0)
|
|
1574
|
-
throw "obj shall be specified for 'tag'.";
|
|
1575
|
-
return nt.obj = m(N.obj), new I(nt);
|
|
1576
|
-
}
|
|
1577
|
-
}
|
|
1578
|
-
}, this.jsonToASN1HEX = function(i) {
|
|
1579
|
-
var t = this.newObject(i);
|
|
1580
|
-
return t.getEncodedHex();
|
|
1581
|
-
};
|
|
1582
|
-
}();
|
|
1583
|
-
u.asn1.ASN1Util.oidHexToInt = function(i) {
|
|
1584
|
-
for (var n = "", t = parseInt(i.substring(0, 2), 16), e = Math.floor(t / 40), r = t % 40, n = e + "." + r, s = "", o = 2; o < i.length; o += 2) {
|
|
1585
|
-
var a = parseInt(i.substring(o, o + 2), 16), h = ("00000000" + a.toString(2)).slice(-8);
|
|
1586
|
-
if (s = s + h.substring(1, 8), h.substring(0, 1) == "0") {
|
|
1587
|
-
var f = new y(s, 2);
|
|
1588
|
-
n = n + "." + f.toString(10), s = "";
|
|
1589
|
-
}
|
|
1590
|
-
}
|
|
1591
|
-
return n;
|
|
1592
|
-
};
|
|
1593
|
-
u.asn1.ASN1Util.oidIntToHex = function(i) {
|
|
1594
|
-
var t = function(a) {
|
|
1595
|
-
var h = a.toString(16);
|
|
1596
|
-
return h.length == 1 && (h = "0" + h), h;
|
|
1597
|
-
}, e = function(a) {
|
|
1598
|
-
var h = "", f = new y(a, 10), c = f.toString(2), l = 7 - c.length % 7;
|
|
1599
|
-
l == 7 && (l = 0);
|
|
1600
|
-
for (var g = "", v = 0; v < l; v++)
|
|
1601
|
-
g += "0";
|
|
1602
|
-
c = g + c;
|
|
1603
|
-
for (var v = 0; v < c.length - 1; v += 7) {
|
|
1604
|
-
var d = c.substring(v, v + 7);
|
|
1605
|
-
v != c.length - 7 && (d = "1" + d), h += t(parseInt(d, 2));
|
|
1606
|
-
}
|
|
1607
|
-
return h;
|
|
1608
|
-
};
|
|
1609
|
-
if (!i.match(/^[0-9.]+$/))
|
|
1610
|
-
throw "malformed oid string: " + i;
|
|
1611
|
-
var r = "", n = i.split("."), s = parseInt(n[0]) * 40 + parseInt(n[1]);
|
|
1612
|
-
r += t(s), n.splice(0, 2);
|
|
1613
|
-
for (var o = 0; o < n.length; o++)
|
|
1614
|
-
r += e(n[o]);
|
|
1615
|
-
return r;
|
|
1616
|
-
};
|
|
1617
|
-
u.asn1.ASN1Object = function() {
|
|
1618
|
-
var i = "";
|
|
1619
|
-
this.getLengthHexFromValue = function() {
|
|
1620
|
-
if (typeof this.hV > "u" || this.hV == null)
|
|
1621
|
-
throw "this.hV is null or undefined.";
|
|
1622
|
-
if (this.hV.length % 2 == 1)
|
|
1623
|
-
throw "value hex must be even length: n=" + i.length + ",v=" + this.hV;
|
|
1624
|
-
var t = this.hV.length / 2, e = t.toString(16);
|
|
1625
|
-
if (e.length % 2 == 1 && (e = "0" + e), t < 128)
|
|
1626
|
-
return e;
|
|
1627
|
-
var r = e.length / 2;
|
|
1628
|
-
if (r > 15)
|
|
1629
|
-
throw "ASN.1 length too long to represent by 8x: n = " + t.toString(16);
|
|
1630
|
-
var n = 128 + r;
|
|
1631
|
-
return n.toString(16) + e;
|
|
1632
|
-
}, this.getEncodedHex = function() {
|
|
1633
|
-
return (this.hTLV == null || this.isModified) && (this.hV = this.getFreshValueHex(), this.hL = this.getLengthHexFromValue(), this.hTLV = this.hT + this.hL + this.hV, this.isModified = !1), this.hTLV;
|
|
1634
|
-
}, this.getValueHex = function() {
|
|
1635
|
-
return this.getEncodedHex(), this.hV;
|
|
1636
|
-
}, this.getFreshValueHex = function() {
|
|
1637
|
-
return "";
|
|
1638
|
-
};
|
|
1639
|
-
};
|
|
1640
|
-
u.asn1.DERAbstractString = function(i) {
|
|
1641
|
-
u.asn1.DERAbstractString.superclass.constructor.call(this), this.getString = function() {
|
|
1642
|
-
return this.s;
|
|
1643
|
-
}, this.setString = function(t) {
|
|
1644
|
-
this.hTLV = null, this.isModified = !0, this.s = t, this.hV = stohex(this.s);
|
|
1645
|
-
}, this.setStringHex = function(t) {
|
|
1646
|
-
this.hTLV = null, this.isModified = !0, this.s = null, this.hV = t;
|
|
1647
|
-
}, this.getFreshValueHex = function() {
|
|
1648
|
-
return this.hV;
|
|
1649
|
-
}, typeof i < "u" && (typeof i == "string" ? this.setString(i) : typeof i.str < "u" ? this.setString(i.str) : typeof i.hex < "u" && this.setStringHex(i.hex));
|
|
1650
|
-
};
|
|
1651
|
-
A(u.asn1.DERAbstractString, u.asn1.ASN1Object);
|
|
1652
|
-
u.asn1.DERAbstractTime = function(i) {
|
|
1653
|
-
u.asn1.DERAbstractTime.superclass.constructor.call(this), this.localDateToUTC = function(t) {
|
|
1654
|
-
utc = t.getTime() + t.getTimezoneOffset() * 6e4;
|
|
1655
|
-
var e = new Date(utc);
|
|
1656
|
-
return e;
|
|
1657
|
-
}, this.formatDate = function(t, e, r) {
|
|
1658
|
-
var n = this.zeroPadding, s = this.localDateToUTC(t), o = String(s.getFullYear());
|
|
1659
|
-
e == "utc" && (o = o.substring(2, 4));
|
|
1660
|
-
var a = n(String(s.getMonth() + 1), 2), h = n(String(s.getDate()), 2), f = n(String(s.getHours()), 2), c = n(String(s.getMinutes()), 2), l = n(String(s.getSeconds()), 2), g = o + a + h + f + c + l;
|
|
1661
|
-
if (r === !0) {
|
|
1662
|
-
var v = s.getMilliseconds();
|
|
1663
|
-
if (v != 0) {
|
|
1664
|
-
var d = n(String(v), 3);
|
|
1665
|
-
d = d.replace(/[0]+$/, ""), g = g + "." + d;
|
|
1666
|
-
}
|
|
1667
|
-
}
|
|
1668
|
-
return g + "Z";
|
|
1669
|
-
}, this.zeroPadding = function(t, e) {
|
|
1670
|
-
return t.length >= e ? t : new Array(e - t.length + 1).join("0") + t;
|
|
1671
|
-
}, this.getString = function() {
|
|
1672
|
-
return this.s;
|
|
1673
|
-
}, this.setString = function(t) {
|
|
1674
|
-
this.hTLV = null, this.isModified = !0, this.s = t, this.hV = stohex(t);
|
|
1675
|
-
}, this.setByDateValue = function(t, e, r, n, s, o) {
|
|
1676
|
-
var a = new Date(Date.UTC(t, e - 1, r, n, s, o, 0));
|
|
1677
|
-
this.setByDate(a);
|
|
1678
|
-
}, this.getFreshValueHex = function() {
|
|
1679
|
-
return this.hV;
|
|
1680
|
-
};
|
|
1681
|
-
};
|
|
1682
|
-
A(u.asn1.DERAbstractTime, u.asn1.ASN1Object);
|
|
1683
|
-
u.asn1.DERAbstractStructured = function(i) {
|
|
1684
|
-
u.asn1.DERAbstractString.superclass.constructor.call(this), this.setByASN1ObjectArray = function(t) {
|
|
1685
|
-
this.hTLV = null, this.isModified = !0, this.asn1Array = t;
|
|
1686
|
-
}, this.appendASN1Object = function(t) {
|
|
1687
|
-
this.hTLV = null, this.isModified = !0, this.asn1Array.push(t);
|
|
1688
|
-
}, this.asn1Array = new Array(), typeof i < "u" && typeof i.array < "u" && (this.asn1Array = i.array);
|
|
1689
|
-
};
|
|
1690
|
-
A(u.asn1.DERAbstractStructured, u.asn1.ASN1Object);
|
|
1691
|
-
u.asn1.DERBoolean = function() {
|
|
1692
|
-
u.asn1.DERBoolean.superclass.constructor.call(this), this.hT = "01", this.hTLV = "0101ff";
|
|
1693
|
-
};
|
|
1694
|
-
A(u.asn1.DERBoolean, u.asn1.ASN1Object);
|
|
1695
|
-
u.asn1.DERInteger = function(i) {
|
|
1696
|
-
u.asn1.DERInteger.superclass.constructor.call(this), this.hT = "02", this.setByBigInteger = function(t) {
|
|
1697
|
-
this.hTLV = null, this.isModified = !0, this.hV = u.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t);
|
|
1698
|
-
}, this.setByInteger = function(t) {
|
|
1699
|
-
var e = new y(String(t), 10);
|
|
1700
|
-
this.setByBigInteger(e);
|
|
1701
|
-
}, this.setValueHex = function(t) {
|
|
1702
|
-
this.hV = t;
|
|
1703
|
-
}, this.getFreshValueHex = function() {
|
|
1704
|
-
return this.hV;
|
|
1705
|
-
}, typeof i < "u" && (typeof i.bigint < "u" ? this.setByBigInteger(i.bigint) : typeof i.int < "u" ? this.setByInteger(i.int) : typeof i == "number" ? this.setByInteger(i) : typeof i.hex < "u" && this.setValueHex(i.hex));
|
|
1706
|
-
};
|
|
1707
|
-
A(u.asn1.DERInteger, u.asn1.ASN1Object);
|
|
1708
|
-
u.asn1.DERBitString = function(i) {
|
|
1709
|
-
if (i !== void 0 && typeof i.obj < "u") {
|
|
1710
|
-
var t = u.asn1.ASN1Util.newObject(i.obj);
|
|
1711
|
-
i.hex = "00" + t.getEncodedHex();
|
|
1712
|
-
}
|
|
1713
|
-
u.asn1.DERBitString.superclass.constructor.call(this), this.hT = "03", this.setHexValueIncludingUnusedBits = function(e) {
|
|
1714
|
-
this.hTLV = null, this.isModified = !0, this.hV = e;
|
|
1715
|
-
}, this.setUnusedBitsAndHexValue = function(e, r) {
|
|
1716
|
-
if (e < 0 || 7 < e)
|
|
1717
|
-
throw "unused bits shall be from 0 to 7: u = " + e;
|
|
1718
|
-
var n = "0" + e;
|
|
1719
|
-
this.hTLV = null, this.isModified = !0, this.hV = n + r;
|
|
1720
|
-
}, this.setByBinaryString = function(e) {
|
|
1721
|
-
e = e.replace(/0+$/, "");
|
|
1722
|
-
var r = 8 - e.length % 8;
|
|
1723
|
-
r == 8 && (r = 0);
|
|
1724
|
-
for (var n = 0; n <= r; n++)
|
|
1725
|
-
e += "0";
|
|
1726
|
-
for (var s = "", n = 0; n < e.length - 1; n += 8) {
|
|
1727
|
-
var o = e.substring(n, n + 8), a = parseInt(o, 2).toString(16);
|
|
1728
|
-
a.length == 1 && (a = "0" + a), s += a;
|
|
1729
|
-
}
|
|
1730
|
-
this.hTLV = null, this.isModified = !0, this.hV = "0" + r + s;
|
|
1731
|
-
}, this.setByBooleanArray = function(e) {
|
|
1732
|
-
for (var r = "", n = 0; n < e.length; n++)
|
|
1733
|
-
e[n] == !0 ? r += "1" : r += "0";
|
|
1734
|
-
this.setByBinaryString(r);
|
|
1735
|
-
}, this.newFalseArray = function(e) {
|
|
1736
|
-
for (var r = new Array(e), n = 0; n < e; n++)
|
|
1737
|
-
r[n] = !1;
|
|
1738
|
-
return r;
|
|
1739
|
-
}, this.getFreshValueHex = function() {
|
|
1740
|
-
return this.hV;
|
|
1741
|
-
}, typeof i < "u" && (typeof i == "string" && i.toLowerCase().match(/^[0-9a-f]+$/) ? this.setHexValueIncludingUnusedBits(i) : typeof i.hex < "u" ? this.setHexValueIncludingUnusedBits(i.hex) : typeof i.bin < "u" ? this.setByBinaryString(i.bin) : typeof i.array < "u" && this.setByBooleanArray(i.array));
|
|
1742
|
-
};
|
|
1743
|
-
A(u.asn1.DERBitString, u.asn1.ASN1Object);
|
|
1744
|
-
u.asn1.DEROctetString = function(i) {
|
|
1745
|
-
if (i !== void 0 && typeof i.obj < "u") {
|
|
1746
|
-
var t = u.asn1.ASN1Util.newObject(i.obj);
|
|
1747
|
-
i.hex = t.getEncodedHex();
|
|
1748
|
-
}
|
|
1749
|
-
u.asn1.DEROctetString.superclass.constructor.call(this, i), this.hT = "04";
|
|
1750
|
-
};
|
|
1751
|
-
A(u.asn1.DEROctetString, u.asn1.DERAbstractString);
|
|
1752
|
-
u.asn1.DERNull = function() {
|
|
1753
|
-
u.asn1.DERNull.superclass.constructor.call(this), this.hT = "05", this.hTLV = "0500";
|
|
1754
|
-
};
|
|
1755
|
-
A(u.asn1.DERNull, u.asn1.ASN1Object);
|
|
1756
|
-
u.asn1.DERObjectIdentifier = function(i) {
|
|
1757
|
-
var t = function(r) {
|
|
1758
|
-
var n = r.toString(16);
|
|
1759
|
-
return n.length == 1 && (n = "0" + n), n;
|
|
1760
|
-
}, e = function(r) {
|
|
1761
|
-
var n = "", s = new y(r, 10), o = s.toString(2), a = 7 - o.length % 7;
|
|
1762
|
-
a == 7 && (a = 0);
|
|
1763
|
-
for (var h = "", f = 0; f < a; f++)
|
|
1764
|
-
h += "0";
|
|
1765
|
-
o = h + o;
|
|
1766
|
-
for (var f = 0; f < o.length - 1; f += 7) {
|
|
1767
|
-
var c = o.substring(f, f + 7);
|
|
1768
|
-
f != o.length - 7 && (c = "1" + c), n += t(parseInt(c, 2));
|
|
1769
|
-
}
|
|
1770
|
-
return n;
|
|
1771
|
-
};
|
|
1772
|
-
u.asn1.DERObjectIdentifier.superclass.constructor.call(this), this.hT = "06", this.setValueHex = function(r) {
|
|
1773
|
-
this.hTLV = null, this.isModified = !0, this.s = null, this.hV = r;
|
|
1774
|
-
}, this.setValueOidString = function(r) {
|
|
1775
|
-
if (!r.match(/^[0-9.]+$/))
|
|
1776
|
-
throw "malformed oid string: " + r;
|
|
1777
|
-
var n = "", s = r.split("."), o = parseInt(s[0]) * 40 + parseInt(s[1]);
|
|
1778
|
-
n += t(o), s.splice(0, 2);
|
|
1779
|
-
for (var a = 0; a < s.length; a++)
|
|
1780
|
-
n += e(s[a]);
|
|
1781
|
-
this.hTLV = null, this.isModified = !0, this.s = null, this.hV = n;
|
|
1782
|
-
}, this.setValueName = function(r) {
|
|
1783
|
-
var n = u.asn1.x509.OID.name2oid(r);
|
|
1784
|
-
if (n !== "")
|
|
1785
|
-
this.setValueOidString(n);
|
|
1786
|
-
else
|
|
1787
|
-
throw "DERObjectIdentifier oidName undefined: " + r;
|
|
1788
|
-
}, this.getFreshValueHex = function() {
|
|
1789
|
-
return this.hV;
|
|
1790
|
-
}, i !== void 0 && (typeof i == "string" ? i.match(/^[0-2].[0-9.]+$/) ? this.setValueOidString(i) : this.setValueName(i) : i.oid !== void 0 ? this.setValueOidString(i.oid) : i.hex !== void 0 ? this.setValueHex(i.hex) : i.name !== void 0 && this.setValueName(i.name));
|
|
1791
|
-
};
|
|
1792
|
-
A(u.asn1.DERObjectIdentifier, u.asn1.ASN1Object);
|
|
1793
|
-
u.asn1.DEREnumerated = function(i) {
|
|
1794
|
-
u.asn1.DEREnumerated.superclass.constructor.call(this), this.hT = "0a", this.setByBigInteger = function(t) {
|
|
1795
|
-
this.hTLV = null, this.isModified = !0, this.hV = u.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t);
|
|
1796
|
-
}, this.setByInteger = function(t) {
|
|
1797
|
-
var e = new y(String(t), 10);
|
|
1798
|
-
this.setByBigInteger(e);
|
|
1799
|
-
}, this.setValueHex = function(t) {
|
|
1800
|
-
this.hV = t;
|
|
1801
|
-
}, this.getFreshValueHex = function() {
|
|
1802
|
-
return this.hV;
|
|
1803
|
-
}, typeof i < "u" && (typeof i.int < "u" ? this.setByInteger(i.int) : typeof i == "number" ? this.setByInteger(i) : typeof i.hex < "u" && this.setValueHex(i.hex));
|
|
1804
|
-
};
|
|
1805
|
-
A(u.asn1.DEREnumerated, u.asn1.ASN1Object);
|
|
1806
|
-
u.asn1.DERUTF8String = function(i) {
|
|
1807
|
-
u.asn1.DERUTF8String.superclass.constructor.call(this, i), this.hT = "0c";
|
|
1808
|
-
};
|
|
1809
|
-
A(u.asn1.DERUTF8String, u.asn1.DERAbstractString);
|
|
1810
|
-
u.asn1.DERNumericString = function(i) {
|
|
1811
|
-
u.asn1.DERNumericString.superclass.constructor.call(this, i), this.hT = "12";
|
|
1812
|
-
};
|
|
1813
|
-
A(u.asn1.DERNumericString, u.asn1.DERAbstractString);
|
|
1814
|
-
u.asn1.DERPrintableString = function(i) {
|
|
1815
|
-
u.asn1.DERPrintableString.superclass.constructor.call(this, i), this.hT = "13";
|
|
1816
|
-
};
|
|
1817
|
-
A(u.asn1.DERPrintableString, u.asn1.DERAbstractString);
|
|
1818
|
-
u.asn1.DERTeletexString = function(i) {
|
|
1819
|
-
u.asn1.DERTeletexString.superclass.constructor.call(this, i), this.hT = "14";
|
|
1820
|
-
};
|
|
1821
|
-
A(u.asn1.DERTeletexString, u.asn1.DERAbstractString);
|
|
1822
|
-
u.asn1.DERIA5String = function(i) {
|
|
1823
|
-
u.asn1.DERIA5String.superclass.constructor.call(this, i), this.hT = "16";
|
|
1824
|
-
};
|
|
1825
|
-
A(u.asn1.DERIA5String, u.asn1.DERAbstractString);
|
|
1826
|
-
u.asn1.DERUTCTime = function(i) {
|
|
1827
|
-
u.asn1.DERUTCTime.superclass.constructor.call(this, i), this.hT = "17", this.setByDate = function(t) {
|
|
1828
|
-
this.hTLV = null, this.isModified = !0, this.date = t, this.s = this.formatDate(this.date, "utc"), this.hV = stohex(this.s);
|
|
1829
|
-
}, this.getFreshValueHex = function() {
|
|
1830
|
-
return typeof this.date > "u" && typeof this.s > "u" && (this.date = /* @__PURE__ */ new Date(), this.s = this.formatDate(this.date, "utc"), this.hV = stohex(this.s)), this.hV;
|
|
1831
|
-
}, i !== void 0 && (i.str !== void 0 ? this.setString(i.str) : typeof i == "string" && i.match(/^[0-9]{12}Z$/) ? this.setString(i) : i.hex !== void 0 ? this.setStringHex(i.hex) : i.date !== void 0 && this.setByDate(i.date));
|
|
1832
|
-
};
|
|
1833
|
-
A(u.asn1.DERUTCTime, u.asn1.DERAbstractTime);
|
|
1834
|
-
u.asn1.DERGeneralizedTime = function(i) {
|
|
1835
|
-
u.asn1.DERGeneralizedTime.superclass.constructor.call(this, i), this.hT = "18", this.withMillis = !1, this.setByDate = function(t) {
|
|
1836
|
-
this.hTLV = null, this.isModified = !0, this.date = t, this.s = this.formatDate(this.date, "gen", this.withMillis), this.hV = stohex(this.s);
|
|
1837
|
-
}, this.getFreshValueHex = function() {
|
|
1838
|
-
return this.date === void 0 && this.s === void 0 && (this.date = /* @__PURE__ */ new Date(), this.s = this.formatDate(this.date, "gen", this.withMillis), this.hV = stohex(this.s)), this.hV;
|
|
1839
|
-
}, i !== void 0 && (i.str !== void 0 ? this.setString(i.str) : typeof i == "string" && i.match(/^[0-9]{14}Z$/) ? this.setString(i) : i.hex !== void 0 ? this.setStringHex(i.hex) : i.date !== void 0 && this.setByDate(i.date), i.millis === !0 && (this.withMillis = !0));
|
|
1840
|
-
};
|
|
1841
|
-
A(u.asn1.DERGeneralizedTime, u.asn1.DERAbstractTime);
|
|
1842
|
-
u.asn1.DERSequence = function(i) {
|
|
1843
|
-
u.asn1.DERSequence.superclass.constructor.call(this, i), this.hT = "30", this.getFreshValueHex = function() {
|
|
1844
|
-
for (var t = "", e = 0; e < this.asn1Array.length; e++) {
|
|
1845
|
-
var r = this.asn1Array[e];
|
|
1846
|
-
t += r.getEncodedHex();
|
|
1847
|
-
}
|
|
1848
|
-
return this.hV = t, this.hV;
|
|
1849
|
-
};
|
|
1850
|
-
};
|
|
1851
|
-
A(u.asn1.DERSequence, u.asn1.DERAbstractStructured);
|
|
1852
|
-
u.asn1.DERSet = function(i) {
|
|
1853
|
-
u.asn1.DERSet.superclass.constructor.call(this, i), this.hT = "31", this.sortFlag = !0, this.getFreshValueHex = function() {
|
|
1854
|
-
for (var t = new Array(), e = 0; e < this.asn1Array.length; e++) {
|
|
1855
|
-
var r = this.asn1Array[e];
|
|
1856
|
-
t.push(r.getEncodedHex());
|
|
1857
|
-
}
|
|
1858
|
-
return this.sortFlag == !0 && t.sort(), this.hV = t.join(""), this.hV;
|
|
1859
|
-
}, typeof i < "u" && typeof i.sortflag < "u" && i.sortflag == !1 && (this.sortFlag = !1);
|
|
1860
|
-
};
|
|
1861
|
-
A(u.asn1.DERSet, u.asn1.DERAbstractStructured);
|
|
1862
|
-
u.asn1.DERTaggedObject = function(i) {
|
|
1863
|
-
u.asn1.DERTaggedObject.superclass.constructor.call(this), this.hT = "a0", this.hV = "", this.isExplicit = !0, this.asn1Object = null, this.setASN1Object = function(t, e, r) {
|
|
1864
|
-
this.hT = e, this.isExplicit = t, this.asn1Object = r, this.isExplicit ? (this.hV = this.asn1Object.getEncodedHex(), this.hTLV = null, this.isModified = !0) : (this.hV = null, this.hTLV = r.getEncodedHex(), this.hTLV = this.hTLV.replace(/^../, e), this.isModified = !1);
|
|
1865
|
-
}, this.getFreshValueHex = function() {
|
|
1866
|
-
return this.hV;
|
|
1867
|
-
}, typeof i < "u" && (typeof i.tag < "u" && (this.hT = i.tag), typeof i.explicit < "u" && (this.isExplicit = i.explicit), typeof i.obj < "u" && (this.asn1Object = i.obj, this.setASN1Object(this.isExplicit, this.hT, this.asn1Object)));
|
|
1868
|
-
};
|
|
1869
|
-
A(u.asn1.DERTaggedObject, u.asn1.ASN1Object);
|
|
1870
|
-
var fr = /* @__PURE__ */ (function() {
|
|
1871
|
-
var i = function(t, e) {
|
|
1872
|
-
return i = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, n) {
|
|
1873
|
-
r.__proto__ = n;
|
|
1874
|
-
} || function(r, n) {
|
|
1875
|
-
for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && (r[s] = n[s]);
|
|
1876
|
-
}, i(t, e);
|
|
1877
|
-
};
|
|
1878
|
-
return function(t, e) {
|
|
1879
|
-
if (typeof e != "function" && e !== null)
|
|
1880
|
-
throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
|
|
1881
|
-
i(t, e);
|
|
1882
|
-
function r() {
|
|
1883
|
-
this.constructor = t;
|
|
1884
|
-
}
|
|
1885
|
-
t.prototype = e === null ? Object.create(e) : (r.prototype = e.prototype, new r());
|
|
1886
|
-
};
|
|
1887
|
-
})(), zt = (
|
|
1888
|
-
/** @class */
|
|
1889
|
-
(function(i) {
|
|
1890
|
-
fr(t, i);
|
|
1891
|
-
function t(e) {
|
|
1892
|
-
var r = i.call(this) || this;
|
|
1893
|
-
return e && (typeof e == "string" ? r.parseKey(e) : (t.hasPrivateKeyProperty(e) || t.hasPublicKeyProperty(e)) && r.parsePropertiesFrom(e)), r;
|
|
1894
|
-
}
|
|
1895
|
-
return t.prototype.parseKey = function(e) {
|
|
1896
|
-
try {
|
|
1897
|
-
var r = 0, n = 0, s = /^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/, o = s.test(e) ? Pe.decode(e) : At.unarmor(e), a = qe.decode(o);
|
|
1898
|
-
if (a.sub.length === 3 && (a = a.sub[2].sub[0]), a.sub.length === 9) {
|
|
1899
|
-
r = a.sub[1].getHexStringValue(), this.n = x(r, 16), n = a.sub[2].getHexStringValue(), this.e = parseInt(n, 16);
|
|
1900
|
-
var h = a.sub[3].getHexStringValue();
|
|
1901
|
-
this.d = x(h, 16);
|
|
1902
|
-
var f = a.sub[4].getHexStringValue();
|
|
1903
|
-
this.p = x(f, 16);
|
|
1904
|
-
var c = a.sub[5].getHexStringValue();
|
|
1905
|
-
this.q = x(c, 16);
|
|
1906
|
-
var l = a.sub[6].getHexStringValue();
|
|
1907
|
-
this.dmp1 = x(l, 16);
|
|
1908
|
-
var g = a.sub[7].getHexStringValue();
|
|
1909
|
-
this.dmq1 = x(g, 16);
|
|
1910
|
-
var v = a.sub[8].getHexStringValue();
|
|
1911
|
-
this.coeff = x(v, 16);
|
|
1912
|
-
} else if (a.sub.length === 2)
|
|
1913
|
-
if (a.sub[0].sub) {
|
|
1914
|
-
var d = a.sub[1], p = d.sub[0];
|
|
1915
|
-
r = p.sub[0].getHexStringValue(), this.n = x(r, 16), n = p.sub[1].getHexStringValue(), this.e = parseInt(n, 16);
|
|
1916
|
-
} else
|
|
1917
|
-
r = a.sub[0].getHexStringValue(), this.n = x(r, 16), n = a.sub[1].getHexStringValue(), this.e = parseInt(n, 16);
|
|
1918
|
-
else
|
|
1919
|
-
return !1;
|
|
1920
|
-
return !0;
|
|
1921
|
-
} catch {
|
|
1922
|
-
return !1;
|
|
1923
|
-
}
|
|
1924
|
-
}, t.prototype.getPrivateBaseKey = function() {
|
|
1925
|
-
var e = {
|
|
1926
|
-
array: [
|
|
1927
|
-
new u.asn1.DERInteger({ int: 0 }),
|
|
1928
|
-
new u.asn1.DERInteger({ bigint: this.n }),
|
|
1929
|
-
new u.asn1.DERInteger({ int: this.e }),
|
|
1930
|
-
new u.asn1.DERInteger({ bigint: this.d }),
|
|
1931
|
-
new u.asn1.DERInteger({ bigint: this.p }),
|
|
1932
|
-
new u.asn1.DERInteger({ bigint: this.q }),
|
|
1933
|
-
new u.asn1.DERInteger({ bigint: this.dmp1 }),
|
|
1934
|
-
new u.asn1.DERInteger({ bigint: this.dmq1 }),
|
|
1935
|
-
new u.asn1.DERInteger({ bigint: this.coeff })
|
|
1936
|
-
]
|
|
1937
|
-
}, r = new u.asn1.DERSequence(e);
|
|
1938
|
-
return r.getEncodedHex();
|
|
1939
|
-
}, t.prototype.getPrivateBaseKeyB64 = function() {
|
|
1940
|
-
return tt(this.getPrivateBaseKey());
|
|
1941
|
-
}, t.prototype.getPublicBaseKey = function() {
|
|
1942
|
-
var e = new u.asn1.DERSequence({
|
|
1943
|
-
array: [
|
|
1944
|
-
new u.asn1.DERObjectIdentifier({ oid: "1.2.840.113549.1.1.1" }),
|
|
1945
|
-
// RSA Encryption pkcs #1 oid
|
|
1946
|
-
new u.asn1.DERNull()
|
|
1947
|
-
]
|
|
1948
|
-
}), r = new u.asn1.DERSequence({
|
|
1949
|
-
array: [
|
|
1950
|
-
new u.asn1.DERInteger({ bigint: this.n }),
|
|
1951
|
-
new u.asn1.DERInteger({ int: this.e })
|
|
1952
|
-
]
|
|
1953
|
-
}), n = new u.asn1.DERBitString({
|
|
1954
|
-
hex: "00" + r.getEncodedHex()
|
|
1955
|
-
}), s = new u.asn1.DERSequence({
|
|
1956
|
-
array: [e, n]
|
|
1957
|
-
});
|
|
1958
|
-
return s.getEncodedHex();
|
|
1959
|
-
}, t.prototype.getPublicBaseKeyB64 = function() {
|
|
1960
|
-
return tt(this.getPublicBaseKey());
|
|
1961
|
-
}, t.wordwrap = function(e, r) {
|
|
1962
|
-
if (r = r || 64, !e)
|
|
1963
|
-
return e;
|
|
1964
|
-
var n = "(.{1," + r + `})( +|$
|
|
1965
|
-
?)|(.{1,` + r + "})";
|
|
1966
|
-
return e.match(RegExp(n, "g")).join(`
|
|
1967
|
-
`);
|
|
1968
|
-
}, t.prototype.getPrivateKey = function() {
|
|
1969
|
-
var e = `-----BEGIN RSA PRIVATE KEY-----
|
|
1970
|
-
`;
|
|
1971
|
-
return e += t.wordwrap(this.getPrivateBaseKeyB64()) + `
|
|
1972
|
-
`, e += "-----END RSA PRIVATE KEY-----", e;
|
|
1973
|
-
}, t.prototype.getPublicKey = function() {
|
|
1974
|
-
var e = `-----BEGIN PUBLIC KEY-----
|
|
1975
|
-
`;
|
|
1976
|
-
return e += t.wordwrap(this.getPublicBaseKeyB64()) + `
|
|
1977
|
-
`, e += "-----END PUBLIC KEY-----", e;
|
|
1978
|
-
}, t.hasPublicKeyProperty = function(e) {
|
|
1979
|
-
return e = e || {}, e.hasOwnProperty("n") && e.hasOwnProperty("e");
|
|
1980
|
-
}, t.hasPrivateKeyProperty = function(e) {
|
|
1981
|
-
return e = 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");
|
|
1982
|
-
}, t.prototype.parsePropertiesFrom = function(e) {
|
|
1983
|
-
this.n = e.n, this.e = e.e, e.hasOwnProperty("d") && (this.d = e.d, this.p = e.p, this.q = e.q, this.dmp1 = e.dmp1, this.dmq1 = e.dmq1, this.coeff = e.coeff);
|
|
1984
|
-
}, t;
|
|
1985
|
-
})(or)
|
|
1986
|
-
), Dt, lr = typeof process < "u" ? (Dt = process.env) === null || Dt === void 0 ? void 0 : Dt.npm_package_version : void 0, se = (
|
|
1987
|
-
/** @class */
|
|
1988
|
-
(function() {
|
|
1989
|
-
function i(t) {
|
|
1990
|
-
t === void 0 && (t = {}), this.default_key_size = t.default_key_size ? parseInt(t.default_key_size, 10) : 1024, this.default_public_exponent = t.default_public_exponent || "010001", this.log = t.log || !1, this.key = t.key || null;
|
|
1991
|
-
}
|
|
1992
|
-
return i.prototype.setKey = function(t) {
|
|
1993
|
-
t ? (this.log && this.key && console.warn("A key was already set, overriding existing."), this.key = new zt(t)) : !this.key && this.log && console.error("A key was not set.");
|
|
1994
|
-
}, i.prototype.setPrivateKey = function(t) {
|
|
1995
|
-
this.setKey(t);
|
|
1996
|
-
}, i.prototype.setPublicKey = function(t) {
|
|
1997
|
-
this.setKey(t);
|
|
1998
|
-
}, i.prototype.decrypt = function(t) {
|
|
1999
|
-
try {
|
|
2000
|
-
return this.getKey().decrypt(Mt(t));
|
|
2001
|
-
} catch {
|
|
2002
|
-
return !1;
|
|
2003
|
-
}
|
|
2004
|
-
}, i.prototype.encrypt = function(t) {
|
|
2005
|
-
try {
|
|
2006
|
-
return tt(this.getKey().encrypt(t));
|
|
2007
|
-
} catch {
|
|
2008
|
-
return !1;
|
|
2009
|
-
}
|
|
2010
|
-
}, i.prototype.encryptOAEP = function(t) {
|
|
2011
|
-
try {
|
|
2012
|
-
return tt(this.getKey().encrypt(t, sr));
|
|
2013
|
-
} catch {
|
|
2014
|
-
return !1;
|
|
2015
|
-
}
|
|
2016
|
-
}, i.prototype.sign = function(t, e, r) {
|
|
2017
|
-
e === void 0 && (e = function(n) {
|
|
2018
|
-
return n;
|
|
2019
|
-
}), r === void 0 && (r = "");
|
|
2020
|
-
try {
|
|
2021
|
-
return tt(this.getKey().sign(t, e, r));
|
|
2022
|
-
} catch {
|
|
2023
|
-
return !1;
|
|
2024
|
-
}
|
|
2025
|
-
}, i.prototype.signSha256 = function(t) {
|
|
2026
|
-
return this.sign(t, function(e) {
|
|
2027
|
-
return Kt(Rt(e));
|
|
2028
|
-
}, "sha256");
|
|
2029
|
-
}, i.prototype.verify = function(t, e, r) {
|
|
2030
|
-
r === void 0 && (r = function(n) {
|
|
2031
|
-
return n;
|
|
2032
|
-
});
|
|
2033
|
-
try {
|
|
2034
|
-
return this.getKey().verify(t, Mt(e), r);
|
|
2035
|
-
} catch {
|
|
2036
|
-
return !1;
|
|
2037
|
-
}
|
|
2038
|
-
}, i.prototype.verifySha256 = function(t, e) {
|
|
2039
|
-
return this.verify(t, e, function(r) {
|
|
2040
|
-
return Kt(Rt(r));
|
|
2041
|
-
});
|
|
2042
|
-
}, i.prototype.getKey = function(t) {
|
|
2043
|
-
if (!this.key) {
|
|
2044
|
-
if (this.key = new zt(), t && {}.toString.call(t) === "[object Function]") {
|
|
2045
|
-
this.key.generateAsync(this.default_key_size, this.default_public_exponent, t);
|
|
2046
|
-
return;
|
|
2047
|
-
}
|
|
2048
|
-
this.key.generate(this.default_key_size, this.default_public_exponent);
|
|
2049
|
-
}
|
|
2050
|
-
return this.key;
|
|
2051
|
-
}, i.prototype.getPrivateKey = function() {
|
|
2052
|
-
return this.getKey().getPrivateKey();
|
|
2053
|
-
}, i.prototype.getPrivateKeyB64 = function() {
|
|
2054
|
-
return this.getKey().getPrivateBaseKeyB64();
|
|
2055
|
-
}, i.prototype.getPublicKey = function() {
|
|
2056
|
-
return this.getKey().getPublicKey();
|
|
2057
|
-
}, i.prototype.getPublicKeyB64 = function() {
|
|
2058
|
-
return this.getKey().getPublicBaseKeyB64();
|
|
2059
|
-
}, i.version = lr, i;
|
|
2060
|
-
})()
|
|
2061
|
-
);
|
|
2062
|
-
function cr(i, t) {
|
|
2063
|
-
const e = new se();
|
|
2064
|
-
return e.setPublicKey(t), e.encrypt(i) || "";
|
|
2065
|
-
}
|
|
2066
|
-
function pr(i, t) {
|
|
2067
|
-
const e = new se();
|
|
2068
|
-
return e.setPrivateKey(t), e.decrypt(i) || "";
|
|
2069
|
-
}
|
|
2070
|
-
const Ot = De(Yt), { loginUserInfo: D, cryptoInfo: pt } = Wt(Ot), dr = xe(Yt), { activeMenuPath: z } = Wt(dr), vr = O(0), oe = it(() => {
|
|
2071
|
-
var i, t, e, r, n, s, o, a, h, f, c;
|
|
2072
|
-
return [
|
|
2073
|
-
{
|
|
2074
|
-
label: "",
|
|
2075
|
-
// name: 'account',
|
|
2076
|
-
name: "账号",
|
|
2077
|
-
prop: "账号",
|
|
2078
|
-
value: ((i = D.value) == null ? void 0 : i.account) || (((t = D.value) == null ? void 0 : t.账号) ?? "未知")
|
|
2079
|
-
},
|
|
2080
|
-
{
|
|
2081
|
-
label: "",
|
|
2082
|
-
// name: 'userRoles',
|
|
2083
|
-
name: "角色名称",
|
|
2084
|
-
prop: "角色名称",
|
|
2085
|
-
// value: loginUserInfo.value?.userRoles?.join('、')
|
|
2086
|
-
value: ((e = D.value) == null ? void 0 : e.layer) === "superAdmin" ? "超级管理员" : (r = D.value) == null ? void 0 : r.角色名称
|
|
2087
|
-
},
|
|
2088
|
-
{
|
|
2089
|
-
label: "",
|
|
2090
|
-
// name: 'userDept',
|
|
2091
|
-
name: "部门名称",
|
|
2092
|
-
prop: "部门名称",
|
|
2093
|
-
value: ((n = D.value) == null ? void 0 : n.部门名称) ?? "未知"
|
|
2094
|
-
},
|
|
2095
|
-
{
|
|
2096
|
-
label: "",
|
|
2097
|
-
// name: 'userDept',
|
|
2098
|
-
name: "状态",
|
|
2099
|
-
prop: "状态",
|
|
2100
|
-
value: ((s = D.value) == null ? void 0 : s.layer) === "superAdmin" ? "启用" : ((o = D.value) == null ? void 0 : o.状态) ?? "未知"
|
|
2101
|
-
},
|
|
2102
|
-
{
|
|
2103
|
-
label: "",
|
|
2104
|
-
prop: "头像",
|
|
2105
|
-
isFormColHidden: !0,
|
|
2106
|
-
value: ((a = D.value) == null ? void 0 : a.layer) === "superAdmin" ? "启用" : ((h = D.value) == null ? void 0 : h.状态) ?? "未知"
|
|
2107
|
-
},
|
|
2108
|
-
{
|
|
2109
|
-
label: "",
|
|
2110
|
-
prop: "签名",
|
|
2111
|
-
isFormColHidden: !0,
|
|
2112
|
-
value: ((f = D.value) == null ? void 0 : f.layer) === "superAdmin" ? "启用" : ((c = D.value) == null ? void 0 : c.状态) ?? "未知"
|
|
2113
|
-
}
|
|
2114
|
-
];
|
|
2115
|
-
}), gr = () => {
|
|
2116
|
-
}, Vt = O(!1), mt = $t({
|
|
2117
|
-
dialogTitle: "电子签名",
|
|
2118
|
-
dialogWidth: "30",
|
|
2119
|
-
dialogShow: !1,
|
|
2120
|
-
url: ""
|
|
2121
|
-
}), Bt = O([
|
|
2122
|
-
{
|
|
2123
|
-
label: "签字版",
|
|
2124
|
-
icon: Se,
|
|
2125
|
-
type: "button",
|
|
2126
|
-
disabled: !1
|
|
2127
|
-
},
|
|
2128
|
-
{
|
|
2129
|
-
label: "电子签名",
|
|
2130
|
-
icon: Te,
|
|
2131
|
-
type: "button",
|
|
2132
|
-
disabled: !1
|
|
2133
|
-
},
|
|
2134
|
-
{
|
|
2135
|
-
label: "上传手写签名",
|
|
2136
|
-
icon: we,
|
|
2137
|
-
type: "buttonUpload",
|
|
2138
|
-
disabled: !1
|
|
2139
|
-
}
|
|
2140
|
-
]), Nt = O(!1), _t = O(!1), ae = O(!1), he = it(() => {
|
|
2141
|
-
var r, n, s;
|
|
2142
|
-
const i = sessionStorage.getItem("authority"), t = JSON.parse(i || ""), e = (r = z.value) != null && r.startsWith("/") ? (n = z.value) == null ? void 0 : n.substring(1) : z.value;
|
|
2143
|
-
return Array.isArray(t) ? (ae.value = !(t != null && t.includes(`${e}/上传头像`)), (s = Bt.value) == null ? void 0 : s.map((o) => ({
|
|
2144
|
-
...o,
|
|
2145
|
-
disabled: !(t != null && t.includes(`${e}/签名`))
|
|
2146
|
-
}))) : typeof t == "string" && (t == null ? void 0 : t.toUpperCase()) === "SUPERADMIN" ? Bt.value : [];
|
|
2147
|
-
}), yr = it(() => [
|
|
2148
|
-
{
|
|
2149
|
-
key: "signConfig",
|
|
2150
|
-
contents: mt
|
|
2151
|
-
},
|
|
2152
|
-
{
|
|
2153
|
-
key: "signTypeList",
|
|
2154
|
-
contents: he.value
|
|
2155
|
-
}
|
|
2156
|
-
]), mr = (i) => {
|
|
2157
|
-
mt.dialogShow = i.label === "电子签名";
|
|
2158
|
-
}, ue = () => {
|
|
2159
|
-
mt.dialogShow = !1;
|
|
2160
|
-
}, fe = async (i) => {
|
|
2161
|
-
var e, r, n, s, o, a, h, f, c;
|
|
2162
|
-
const t = await Qt({
|
|
2163
|
-
id: i
|
|
2164
|
-
// key: {
|
|
2165
|
-
// systemKey: sessionStorage.getItem("systemKey"),
|
|
2166
|
-
// type: "data",
|
|
2167
|
-
// // pageKey: '/系统管理/用户管理',
|
|
2168
|
-
// pageKey: '系统管理/用户管理',
|
|
2169
|
-
// }
|
|
2170
|
-
});
|
|
2171
|
-
if (((e = t == null ? void 0 : t.data) == null ? void 0 : e.code) === 200 && t.data.result && Array.isArray(t.data.result) && t.data.result.length > 0) {
|
|
2172
|
-
const l = {
|
|
2173
|
-
...(s = (n = (r = t.data.result) == null ? void 0 : r[0]) == null ? void 0 : n.value) == null ? void 0 : s.tableData,
|
|
2174
|
-
id: (a = (o = t.data.result) == null ? void 0 : o[0]) == null ? void 0 : a.id,
|
|
2175
|
-
layer: (c = (f = (h = t.data.result) == null ? void 0 : h[0]) == null ? void 0 : f.key) == null ? void 0 : c.layer
|
|
2176
|
-
};
|
|
2177
|
-
Ot.setLoginUserInfo(l);
|
|
2178
|
-
}
|
|
2179
|
-
}, le = async (i, t) => {
|
|
2180
|
-
var r, n, s;
|
|
2181
|
-
const e = Ee(i);
|
|
2182
|
-
e == null || delete e.id;
|
|
2183
|
-
try {
|
|
2184
|
-
const o = await Re({
|
|
2185
|
-
id: (r = D.value) == null ? void 0 : r.id,
|
|
2186
|
-
value: {
|
|
2187
|
-
tableData: e
|
|
2188
|
-
}
|
|
2189
|
-
});
|
|
2190
|
-
((n = o == null ? void 0 : o.data) == null ? void 0 : n.code) === 200 && (ue(), rt.success("修改成功"), await fe((s = D.value) == null ? void 0 : s.id), await Ot.setLogRecordAsync({
|
|
2191
|
-
type: t,
|
|
2192
|
-
data: i
|
|
2193
|
-
}, z.value));
|
|
2194
|
-
} catch {
|
|
2195
|
-
rt.error("修改响应失败");
|
|
2196
|
-
} finally {
|
|
2197
|
-
Vt.value = !1, Nt.value = !1, _t.value = !1;
|
|
2198
|
-
}
|
|
2199
|
-
}, br = async (i, t) => {
|
|
2200
|
-
var n;
|
|
2201
|
-
const e = i === "avatarUrl" ? "头像" : "签名", r = {
|
|
2202
|
-
...D.value,
|
|
2203
|
-
status: ((n = D.value) == null ? void 0 : n.status) ?? "启用",
|
|
2204
|
-
// password: encryptData(loginUserInfo.value?.password, cryptoInfo?.publicKey),
|
|
2205
|
-
// [prop]: url
|
|
2206
|
-
[e]: t
|
|
2207
|
-
};
|
|
2208
|
-
Nt.value = i === "avatarUrl", _t.value = i === "signature", await le(r, "图片修改");
|
|
2209
|
-
}, et = $t({
|
|
2210
|
-
baseCols: [],
|
|
2211
|
-
otherCols: []
|
|
2212
|
-
}), ce = O([]), pe = O(), Sr = (i, t, e) => {
|
|
2213
|
-
var s, o, a, h, f, c;
|
|
2214
|
-
let r;
|
|
2215
|
-
const n = t;
|
|
2216
|
-
((o = (s = D.value) == null ? void 0 : s.layer) == null ? void 0 : o.toUpperCase()) !== "SUPERADMIN" ? r = (a = D.value) != null && a.password ? pr((h = D.value) == null ? void 0 : h.password, (f = pt == null ? void 0 : pt.value) == null ? void 0 : f.privateKey) : Be : r = (c = D.value) == null ? void 0 : c.password, r === n ? e() : e(new Error("输入的密码与原密码不匹配,请重新输入"));
|
|
2217
|
-
}, Tr = (i, t, e) => {
|
|
2218
|
-
t ? e() : e(new Error("请输入密码"));
|
|
2219
|
-
}, wr = (i, t, e) => {
|
|
2220
|
-
var r;
|
|
2221
|
-
t !== ((r = pe.value) == null ? void 0 : r.newtPass) ? e(new Error("两次输入的密码不一致")) : e();
|
|
2222
|
-
}, Er = async () => {
|
|
2223
|
-
var t, e, r, n, s, o, a, h, f, c;
|
|
2224
|
-
const i = await Qt({
|
|
2225
|
-
key: {
|
|
2226
|
-
systemKey: sessionStorage.getItem("systemKey"),
|
|
2227
|
-
type: "structure",
|
|
2228
|
-
// pageKey: "/系统管理/用户管理"
|
|
2229
|
-
pageKey: "系统管理/用户管理"
|
|
2230
|
-
}
|
|
2231
|
-
});
|
|
2232
|
-
if (((t = i == null ? void 0 : i.data) == null ? void 0 : t.code) === 200 && i.data.result && ((e = i.data.result) == null ? void 0 : e.length) > 0) {
|
|
2233
|
-
const l = (a = (o = (s = (n = (r = i.data.result) == null ? void 0 : r[0]) == null ? void 0 : n.value) == null ? void 0 : s.pageData) == null ? void 0 : o.compData) == null ? void 0 : a.find((p) => (p == null ? void 0 : p.key) === "header"), g = (h = oe.value) == null ? void 0 : h.map((p) => p == null ? void 0 : p.prop);
|
|
2234
|
-
et.baseCols = l && ((f = l.contents) == null ? void 0 : f.map((p) => ({
|
|
2235
|
-
...p,
|
|
2236
|
-
isFormColHidden: (g == null ? void 0 : g.includes(p == null ? void 0 : p.prop)) || (p == null ? void 0 : p.label) === "操作"
|
|
2237
|
-
})));
|
|
2238
|
-
const v = (c = l.contents) == null ? void 0 : c.find((p) => (p == null ? void 0 : p.prop) === "password"), d = [
|
|
2239
|
-
{
|
|
2240
|
-
...v,
|
|
2241
|
-
label: "当前密码",
|
|
2242
|
-
prop: "currentPass",
|
|
2243
|
-
validator: Sr
|
|
2244
|
-
},
|
|
2245
|
-
{
|
|
2246
|
-
...v,
|
|
2247
|
-
label: "新密码",
|
|
2248
|
-
prop: "newtPass",
|
|
2249
|
-
validator: Tr
|
|
2250
|
-
},
|
|
2251
|
-
{
|
|
2252
|
-
...v,
|
|
2253
|
-
label: "确认密码",
|
|
2254
|
-
prop: "confirmNewPass",
|
|
2255
|
-
validator: wr
|
|
2256
|
-
}
|
|
2257
|
-
];
|
|
2258
|
-
et.otherCols = d, Ar(D.value);
|
|
2259
|
-
}
|
|
2260
|
-
}, Dr = (i) => {
|
|
2261
|
-
pe.value = i;
|
|
2262
|
-
}, xr = async ({ content: i, buttonName: t }) => {
|
|
2263
|
-
var r, n, s, o, a;
|
|
2264
|
-
let e;
|
|
2265
|
-
t === "确定" && (e = {
|
|
2266
|
-
...D.value,
|
|
2267
|
-
status: ((r = D.value) == null ? void 0 : r.status) ?? "启用",
|
|
2268
|
-
// 目前是超管密码明文传输,非超管用户密码加密传输
|
|
2269
|
-
password: ((s = (n = D.value) == null ? void 0 : n.layer) == null ? void 0 : s.toUpperCase()) === "SUPERADMIN" ? i == null ? void 0 : i.confirmNewPass : cr(i == null ? void 0 : i.confirmNewPass, (o = pt.value) == null ? void 0 : o.publicKey)
|
|
2270
|
-
}), t === "保存基本信息" && (e = {
|
|
2271
|
-
...D.value,
|
|
2272
|
-
...i,
|
|
2273
|
-
status: ((a = D.value) == null ? void 0 : a.status) ?? "启用"
|
|
2274
|
-
}), Vt.value = !0, await le(e, t);
|
|
2275
|
-
}, Zt = () => {
|
|
2276
|
-
var r, n;
|
|
2277
|
-
const i = {
|
|
2278
|
-
base: [
|
|
2279
|
-
{
|
|
2280
|
-
label: "保存基本信息"
|
|
2281
|
-
}
|
|
2282
|
-
],
|
|
2283
|
-
other: [
|
|
2284
|
-
{
|
|
2285
|
-
label: "重置",
|
|
2286
|
-
background: "#b7b8b8"
|
|
2287
|
-
},
|
|
2288
|
-
{
|
|
2289
|
-
label: "确定"
|
|
2290
|
-
}
|
|
2291
|
-
]
|
|
2292
|
-
}, t = sessionStorage.getItem("authority"), e = JSON.parse(t || "");
|
|
2293
|
-
if (Array.isArray(e)) {
|
|
2294
|
-
const s = (r = z.value) != null && r.startsWith("/") ? (n = z.value) == null ? void 0 : n.substring(1) : z.value, o = e != null && e.includes(`${s}/基本信息`) ? i == null ? void 0 : i.base : [], a = e != null && e.includes(`${s}/修改密码`) ? i == null ? void 0 : i.other : [];
|
|
2295
|
-
return {
|
|
2296
|
-
base: o,
|
|
2297
|
-
other: a
|
|
2298
|
-
};
|
|
2299
|
-
} else return typeof e == "string" && (e == null ? void 0 : e.toUpperCase()) === "SUPERADMIN" ? i : null;
|
|
2300
|
-
}, Ar = (i) => {
|
|
2301
|
-
var t, e, r, n, s;
|
|
2302
|
-
ce.value = [
|
|
2303
|
-
{
|
|
2304
|
-
value: "基础信息",
|
|
2305
|
-
label: "基础信息",
|
|
2306
|
-
children: [
|
|
2307
|
-
{
|
|
2308
|
-
type: "form",
|
|
2309
|
-
content: {
|
|
2310
|
-
rowContents: (t = et.baseCols) == null ? void 0 : t.map((o) => ({
|
|
2311
|
-
...o,
|
|
2312
|
-
width: 2,
|
|
2313
|
-
type: o == null ? void 0 : o.formType,
|
|
2314
|
-
name: o == null ? void 0 : o.prop,
|
|
2315
|
-
prop: o == null ? void 0 : o.prop,
|
|
2316
|
-
contents: o == null ? void 0 : o.options,
|
|
2317
|
-
value: i[o == null ? void 0 : o.prop]
|
|
2318
|
-
})),
|
|
2319
|
-
formRules: {
|
|
2320
|
-
userName: [
|
|
2321
|
-
{ required: !0, message: "输入不能为空", trigger: "blur" }
|
|
2322
|
-
],
|
|
2323
|
-
birthDay: [
|
|
2324
|
-
{ required: !0, message: "输入不能为空", trigger: "blur" }
|
|
2325
|
-
],
|
|
2326
|
-
phone: [
|
|
2327
|
-
{ required: !0, message: "输入不能为空", trigger: "blur" }
|
|
2328
|
-
]
|
|
2329
|
-
},
|
|
2330
|
-
buttonValue: (e = Zt()) == null ? void 0 : e.base,
|
|
2331
|
-
isEnableWrap: !1,
|
|
2332
|
-
isButtonRow: !1
|
|
2333
|
-
},
|
|
2334
|
-
value: ""
|
|
2335
|
-
}
|
|
2336
|
-
]
|
|
2337
|
-
},
|
|
2338
|
-
{
|
|
2339
|
-
value: "修改密码",
|
|
2340
|
-
label: "修改密码",
|
|
2341
|
-
children: [
|
|
2342
|
-
{
|
|
2343
|
-
type: "form",
|
|
2344
|
-
content: {
|
|
2345
|
-
rowContents: (r = et.otherCols) == null ? void 0 : r.map((o) => ({
|
|
2346
|
-
...o,
|
|
2347
|
-
width: 1,
|
|
2348
|
-
type: o == null ? void 0 : o.formType,
|
|
2349
|
-
name: o == null ? void 0 : o.prop,
|
|
2350
|
-
contents: o == null ? void 0 : o.options
|
|
2351
|
-
})),
|
|
2352
|
-
formRules: (n = et.otherCols) == null ? void 0 : n.reduce((o, a) => (o[a.prop] = [
|
|
2353
|
-
{ required: !0, message: "输入有误", trigger: "change" },
|
|
2354
|
-
{
|
|
2355
|
-
validator: (h, f, c) => a.validator(h, f, c),
|
|
2356
|
-
trigger: "blur"
|
|
2357
|
-
}
|
|
2358
|
-
], o), {}),
|
|
2359
|
-
buttonValue: (s = Zt()) == null ? void 0 : s.other,
|
|
2360
|
-
isEnableWrap: !1
|
|
2361
|
-
},
|
|
2362
|
-
value: ""
|
|
2363
|
-
}
|
|
2364
|
-
]
|
|
2365
|
-
}
|
|
2366
|
-
];
|
|
2367
|
-
}, Hr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2368
|
-
__proto__: null,
|
|
2369
|
-
avatarLoading: Nt,
|
|
2370
|
-
beforeSignDestroy: ue,
|
|
2371
|
-
changeFormTrigger: Dr,
|
|
2372
|
-
clickFormButton: gr,
|
|
2373
|
-
clickSignButton: mr,
|
|
2374
|
-
clickTabButton: xr,
|
|
2375
|
-
getUserTableHeadersAsync: Er,
|
|
2376
|
-
itemData: yr,
|
|
2377
|
-
loading: Vt,
|
|
2378
|
-
refreshLoginUserInfoAsync: fe,
|
|
2379
|
-
rowContents: oe,
|
|
2380
|
-
signPadInfo: mt,
|
|
2381
|
-
signTypes: he,
|
|
2382
|
-
signatureLoading: _t,
|
|
2383
|
-
submitImageAsync: br,
|
|
2384
|
-
tabKey: vr,
|
|
2385
|
-
tabsContents: ce,
|
|
2386
|
-
tempSignTypes: Bt,
|
|
2387
|
-
uploadDisabled: ae
|
|
2388
|
-
}, Symbol.toStringTag, { value: "Module" })), Rr = { class: "avatar-model-wrap" }, Br = { key: 0 }, Ir = /* @__PURE__ */ Gt({
|
|
2389
|
-
__name: "index",
|
|
2390
|
-
props: {
|
|
2391
|
-
disabled: {
|
|
2392
|
-
type: Boolean,
|
|
2393
|
-
default: !1
|
|
2394
|
-
},
|
|
2395
|
-
avatarUrl: {
|
|
2396
|
-
type: String,
|
|
2397
|
-
default: ""
|
|
2398
|
-
},
|
|
2399
|
-
size: {
|
|
2400
|
-
type: [String, Number],
|
|
2401
|
-
default: "large"
|
|
2402
|
-
},
|
|
2403
|
-
userInfo: {
|
|
2404
|
-
type: Object,
|
|
2405
|
-
default: {}
|
|
2406
|
-
},
|
|
2407
|
-
clickStop: {
|
|
2408
|
-
type: Boolean,
|
|
2409
|
-
default: !0
|
|
2410
|
-
}
|
|
2411
|
-
},
|
|
2412
|
-
emits: ["submitImage", "deleteImage"],
|
|
2413
|
-
setup(i, { emit: t }) {
|
|
2414
|
-
const e = i, r = t, n = it(() => "http://222.92.178.198:62001"), s = O(""), o = O(""), a = O();
|
|
2415
|
-
Jt(() => {
|
|
2416
|
-
var l;
|
|
2417
|
-
return (l = e.userInfo) == null ? void 0 : l.头像;
|
|
2418
|
-
}, (l) => {
|
|
2419
|
-
o.value = l ? n.value + "/" + l : "";
|
|
2420
|
-
}, { immediate: !0 });
|
|
2421
|
-
const h = async () => {
|
|
2422
|
-
if (!(e != null && e.disabled))
|
|
2423
|
-
try {
|
|
2424
|
-
const l = await Ae({
|
|
2425
|
-
url: s.value
|
|
2426
|
-
// url: props.avatarUrl
|
|
2427
|
-
});
|
|
2428
|
-
if (l.status !== 200)
|
|
2429
|
-
throw new Error(`HTTP error! status: ${l.status}`);
|
|
2430
|
-
const g = new Blob([l.data], { type: l.headers["content-type"] });
|
|
2431
|
-
a.value = g;
|
|
2432
|
-
} catch (l) {
|
|
2433
|
-
throw new Error(l);
|
|
2434
|
-
}
|
|
2435
|
-
}, f = async (l) => {
|
|
2436
|
-
var g, v, d, p, T;
|
|
2437
|
-
try {
|
|
2438
|
-
const E = await Xt(l);
|
|
2439
|
-
((g = E == null ? void 0 : E.data) == null ? void 0 : g.code) === 200 && (o.value = n.value + "/" + ((d = (v = E.data) == null ? void 0 : v.result) == null ? void 0 : d.url), s.value = (T = (p = E.data) == null ? void 0 : p.result) == null ? void 0 : T.url, r("submitImage", s.value));
|
|
2440
|
-
} catch (E) {
|
|
2441
|
-
rt.error(E);
|
|
2442
|
-
}
|
|
2443
|
-
}, c = async () => {
|
|
2444
|
-
try {
|
|
2445
|
-
if (!o.value) return;
|
|
2446
|
-
} catch (l) {
|
|
2447
|
-
rt.error(l);
|
|
2448
|
-
}
|
|
2449
|
-
};
|
|
2450
|
-
return (l, g) => {
|
|
2451
|
-
var v, d;
|
|
2452
|
-
return j(), dt("div", Rr, [
|
|
2453
|
-
K(Ie, {
|
|
2454
|
-
avatarUrl: o.value ?? "",
|
|
2455
|
-
avatarBlob: a.value,
|
|
2456
|
-
size: i.size,
|
|
2457
|
-
onClickAvatar: h,
|
|
2458
|
-
onSubmitImage: f,
|
|
2459
|
-
onDeleteImage: c,
|
|
2460
|
-
clickStop: e == null ? void 0 : e.clickStop
|
|
2461
|
-
}, {
|
|
2462
|
-
avatarDefault: C(() => {
|
|
2463
|
-
var p, T, E, w;
|
|
2464
|
-
return [
|
|
2465
|
-
xt(vt(((T = (p = i.userInfo) == null ? void 0 : p.account) == null ? void 0 : T.charAt(0)) || ((w = (E = i.userInfo) == null ? void 0 : E.姓名) == null ? void 0 : w.charAt(0)) || ""), 1)
|
|
2466
|
-
];
|
|
2467
|
-
}),
|
|
2468
|
-
_: 1
|
|
2469
|
-
}, 8, ["avatarUrl", "avatarBlob", "size", "clickStop"]),
|
|
2470
|
-
i.disabled ? ve("", !0) : (j(), dt("span", Br, vt(((v = i.userInfo) == null ? void 0 : v.account) || ((d = i.userInfo) == null ? void 0 : d.账号) || "未知"), 1))
|
|
2471
|
-
]);
|
|
2472
|
-
};
|
|
2473
|
-
}
|
|
2474
|
-
}), Ur = /* @__PURE__ */ te(Ir, [["__scopeId", "data-v-1a1f2575"]]), Or = /* @__PURE__ */ Gt({
|
|
2475
|
-
__name: "index",
|
|
2476
|
-
props: {
|
|
2477
|
-
itemData: {
|
|
2478
|
-
type: Array,
|
|
2479
|
-
default: () => []
|
|
2480
|
-
},
|
|
2481
|
-
childItemData: {
|
|
2482
|
-
type: Array,
|
|
2483
|
-
default: () => []
|
|
2484
|
-
},
|
|
2485
|
-
userInfo: {
|
|
2486
|
-
type: Object,
|
|
2487
|
-
default: {}
|
|
2488
|
-
}
|
|
2489
|
-
},
|
|
2490
|
-
emits: ["clickSignButton", "clickSubmitSign", "beforeDestroy"],
|
|
2491
|
-
setup(i, { emit: t }) {
|
|
2492
|
-
const e = i, r = O({}), n = O([]), s = t, o = (d) => {
|
|
2493
|
-
r.value.dialogShow = (d == null ? void 0 : d.label) === "电子签名", s("clickSignButton", d);
|
|
2494
|
-
}, a = () => {
|
|
2495
|
-
r.value.dialogShow = !1, s("beforeDestroy");
|
|
2496
|
-
}, h = it(() => "http://222.92.178.198:62001"), f = (d) => {
|
|
2497
|
-
var m;
|
|
2498
|
-
const p = d.split(","), T = (m = p == null ? void 0 : p[0]) == null ? void 0 : m.match(/:(.*?);/)[1], E = atob(p[1]);
|
|
2499
|
-
let w = E.length;
|
|
2500
|
-
const I = new Uint8Array(w);
|
|
2501
|
-
for (; w--; )
|
|
2502
|
-
I[w] = E.charCodeAt(w);
|
|
2503
|
-
return new Blob([I], { type: T });
|
|
2504
|
-
}, c = async (d) => {
|
|
2505
|
-
var p, T, E;
|
|
2506
|
-
try {
|
|
2507
|
-
const w = await Xt(d);
|
|
2508
|
-
((p = w == null ? void 0 : w.data) == null ? void 0 : p.code) === 200 && s("clickSubmitSign", (E = (T = w.data) == null ? void 0 : T.result) == null ? void 0 : E.url);
|
|
2509
|
-
} catch (w) {
|
|
2510
|
-
rt.error(w);
|
|
2511
|
-
}
|
|
2512
|
-
}, l = O(""), g = (d) => {
|
|
2513
|
-
l.value = d, r.value.dialogShow = !1;
|
|
2514
|
-
const p = new FormData(), T = f(d);
|
|
2515
|
-
p.append("file", T, "image.png"), c(p);
|
|
2516
|
-
}, v = (d) => {
|
|
2517
|
-
const p = new FormData();
|
|
2518
|
-
p.append("file", d == null ? void 0 : d.file), c(p);
|
|
2519
|
-
};
|
|
2520
|
-
return Jt(() => e == null ? void 0 : e.itemData, (d) => {
|
|
2521
|
-
var T, E, w, I;
|
|
2522
|
-
l.value = "", (T = r.value) != null && T.dialogShow && (r.value.dialogShow = !1);
|
|
2523
|
-
const p = (E = d == null ? void 0 : d.find((m) => (m == null ? void 0 : m.key) === "signConfig")) == null ? void 0 : E.contents;
|
|
2524
|
-
p && Object.keys(p).forEach((m) => {
|
|
2525
|
-
(p[m] === void 0 || p[m] === null || p[m] === "") && delete p[m];
|
|
2526
|
-
}), r.value = (w = d == null ? void 0 : d.find((m) => (m == null ? void 0 : m.key) === "signConfig")) == null ? void 0 : w.contents, n.value = (I = d == null ? void 0 : d.find((m) => (m == null ? void 0 : m.key) === "signTypeList")) == null ? void 0 : I.contents;
|
|
2527
|
-
}, {
|
|
2528
|
-
immediate: !0
|
|
2529
|
-
}), (d, p) => {
|
|
2530
|
-
const T = st("el-empty"), E = st("el-image"), w = st("el-button"), I = st("el-upload");
|
|
2531
|
-
return j(), St(Oe, {
|
|
2532
|
-
signPadInfo: r.value,
|
|
2533
|
-
onBeforeDestroy: a,
|
|
2534
|
-
onClickSubmitSign: g
|
|
2535
|
-
}, {
|
|
2536
|
-
signatureRender: C(() => {
|
|
2537
|
-
var m, k;
|
|
2538
|
-
return [
|
|
2539
|
-
me("div", {
|
|
2540
|
-
class: "signature-render",
|
|
2541
|
-
style: be({ width: `${(m = r.value) == null ? void 0 : m.signPadWidth}%` })
|
|
2542
|
-
}, [
|
|
2543
|
-
K(E, {
|
|
2544
|
-
src: l.value ? l.value : h.value + "/" + ((k = i.userInfo) == null ? void 0 : k.签名),
|
|
2545
|
-
fit: "contain"
|
|
2546
|
-
}, {
|
|
2547
|
-
error: C(() => [
|
|
2548
|
-
K(T, {
|
|
2549
|
-
"image-size": 60,
|
|
2550
|
-
description: " "
|
|
2551
|
-
}, {
|
|
2552
|
-
image: C(() => [
|
|
2553
|
-
K(Tt, { name: "emptyImg" })
|
|
2554
|
-
]),
|
|
2555
|
-
_: 1
|
|
2556
|
-
})
|
|
2557
|
-
]),
|
|
2558
|
-
_: 1
|
|
2559
|
-
}, 8, ["src"])
|
|
2560
|
-
], 4)
|
|
2561
|
-
];
|
|
2562
|
-
}),
|
|
2563
|
-
signatureTypes: C(() => [
|
|
2564
|
-
(j(!0), dt(ge, null, ye(n.value, (m) => {
|
|
2565
|
-
var k;
|
|
2566
|
-
return j(), dt("div", {
|
|
2567
|
-
key: m.label,
|
|
2568
|
-
class: "signature-button"
|
|
2569
|
-
}, [
|
|
2570
|
-
(k = m.label) != null && k.includes("上传") ? (j(), St(I, {
|
|
2571
|
-
key: 0,
|
|
2572
|
-
ref_for: !0,
|
|
2573
|
-
ref: "uploadRef",
|
|
2574
|
-
"http-request": v,
|
|
2575
|
-
"show-file-list": !1
|
|
2576
|
-
}, {
|
|
2577
|
-
trigger: C(() => [
|
|
2578
|
-
K(w, {
|
|
2579
|
-
disabled: m.disabled,
|
|
2580
|
-
id: "themeButton"
|
|
2581
|
-
}, {
|
|
2582
|
-
default: C(() => [
|
|
2583
|
-
xt(vt(m.label), 1)
|
|
2584
|
-
]),
|
|
2585
|
-
icon: C(() => [
|
|
2586
|
-
K(Tt, {
|
|
2587
|
-
name: m.icon ?? ""
|
|
2588
|
-
}, null, 8, ["name"])
|
|
2589
|
-
]),
|
|
2590
|
-
_: 2
|
|
2591
|
-
}, 1032, ["disabled"])
|
|
2592
|
-
]),
|
|
2593
|
-
_: 2
|
|
2594
|
-
}, 1536)) : (j(), St(w, {
|
|
2595
|
-
key: 1,
|
|
2596
|
-
id: "themeButton",
|
|
2597
|
-
disabled: m.disabled,
|
|
2598
|
-
onClick: (b) => o(m)
|
|
2599
|
-
}, {
|
|
2600
|
-
default: C(() => [
|
|
2601
|
-
xt(vt(m.label), 1)
|
|
2602
|
-
]),
|
|
2603
|
-
icon: C(() => [
|
|
2604
|
-
K(Tt, {
|
|
2605
|
-
name: m.icon ?? ""
|
|
2606
|
-
}, null, 8, ["name"])
|
|
2607
|
-
]),
|
|
2608
|
-
_: 2
|
|
2609
|
-
}, 1032, ["disabled", "onClick"]))
|
|
2610
|
-
]);
|
|
2611
|
-
}), 128))
|
|
2612
|
-
]),
|
|
2613
|
-
_: 1
|
|
2614
|
-
}, 8, ["signPadInfo"]);
|
|
2615
|
-
};
|
|
2616
|
-
}
|
|
2617
|
-
}), Lr = /* @__PURE__ */ te(Or, [["__scopeId", "data-v-ce5a2314"]]);
|
|
2618
|
-
export {
|
|
2619
|
-
Hr as S,
|
|
2620
|
-
Lr as a,
|
|
2621
|
-
Ur as s,
|
|
2622
|
-
vr as t
|
|
2623
|
-
};
|