@nano-lib/util 1.0.14 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.mjs CHANGED
@@ -1,273 +1,290 @@
1
- const H = (e, t, n, r) => (e /= r / 2, e < 1 ? n / 2 * e * e + t : (e--, -n / 2 * (e * (e - 2) - 1) + t)), N = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.msRequestAnimationFrame || ((e) => window.setTimeout(e, 16.666666666666668));
2
- function P(e, t) {
3
- if (t) {
4
- document.querySelector(t).scrollTop = e;
1
+ const kn = (t, i, o, s) => (t /= s / 2, t < 1 ? o / 2 * t * t + i : (t--, -o / 2 * (t * (t - 2) - 1) + i)), Vn = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.msRequestAnimationFrame || ((t) => window.setTimeout(t, 16.666666666666668));
2
+ function $n(t, i) {
3
+ if (i) {
4
+ document.querySelector(i).scrollTop = t;
5
5
  return;
6
6
  }
7
- document.documentElement.scrollTop = e, document.body.parentNode.scrollTop = e, document.body.scrollTop = e;
8
- }
9
- function B(e) {
10
- return e ? document.querySelector(e).scrollTop : document.documentElement.scrollTop || document.body.parentNode.scrollTop || document.body.scrollTop;
11
- }
12
- function q(e) {
13
- const { target: t, to: n = 0, duration: r = 500, callback: o } = e ?? {}, i = B(t), s = n - i, c = 20;
14
- let a = 0;
15
- const u = function() {
16
- a += c;
17
- const f = H(a, i, s, r);
18
- P(f, t), a < r ? N(u) : o && o();
7
+ document.documentElement.scrollTop = t, document.body.parentNode.scrollTop = t, document.body.scrollTop = t;
8
+ }
9
+ function jn(t) {
10
+ return t ? document.querySelector(t).scrollTop : document.documentElement.scrollTop || document.body.parentNode.scrollTop || document.body.scrollTop;
11
+ }
12
+ function Un(t) {
13
+ const { target: i, to: o = 0, duration: s = 500, callback: u } = t ?? {}, f = jn(i), d = o - f, a = 20;
14
+ let b = 0;
15
+ const m = function() {
16
+ b += a;
17
+ const v = kn(b, f, d, s);
18
+ $n(v, i), b < s ? Vn(m) : u && u();
19
19
  };
20
- u();
20
+ m();
21
21
  }
22
- function j(e, t) {
22
+ function Zn(t, i) {
23
23
  switch (arguments.length) {
24
24
  case 1:
25
- return parseInt((Math.random() * e + 1).toString(), 10);
25
+ return parseInt((Math.random() * t + 1).toString(), 10);
26
26
  case 2:
27
- return parseInt((Math.random() * (t - e + 1) + e).toString(), 10);
27
+ return parseInt((Math.random() * (i - t + 1) + t).toString(), 10);
28
28
  default:
29
29
  return 0;
30
30
  }
31
31
  }
32
- function G() {
33
- let e = "";
34
- const t = [];
35
- for (let n = 0; n <= 15; n++)
36
- t[n] = n.toString(16);
37
- for (let n = 1; n <= 36; n++)
38
- n === 9 || n === 14 || n === 19 || n === 24 ? e += "-" : n === 15 ? e += 4 : n === 20 ? e += t[Math.random() * 4 | 8] : e += t[Math.random() * 16 | 0];
39
- return e;
40
- }
41
- function m(e, t) {
42
- if (!e) return "-";
43
- e.toString().length === 10 && (e = +e * 1e3), t ?? (t = "YYYY-MM-DD HH:mm:ss");
44
- const n = new Date(e), r = (s, c, a = " ") => {
45
- if (s.length >= c) return s;
46
- const u = c - s.length;
47
- let f = Math.ceil(u / a.length);
48
- for (; f >>= 1; )
49
- a += a, f === 1 && (a += a);
50
- return a.slice(0, u) + s;
51
- };
52
- let o;
53
- const i = {
54
- "Y+": n.getFullYear().toString(),
55
- "M+": (n.getMonth() + 1).toString(),
56
- "D+": n.getDate().toString(),
57
- "H+": n.getHours().toString(),
58
- "m+": n.getMinutes().toString(),
59
- "s+": n.getSeconds().toString()
60
- };
61
- for (const s in i)
62
- o = new RegExp("(" + s + ")").exec(t), o && (t = t.replace(o[1], o[1].length == 1 ? i[s] : r(i[s], o[1].length, "0")));
32
+ function Gn() {
33
+ let t = "";
34
+ const i = [];
35
+ for (let o = 0; o <= 15; o++)
36
+ i[o] = o.toString(16);
37
+ for (let o = 1; o <= 36; o++)
38
+ o === 9 || o === 14 || o === 19 || o === 24 ? t += "-" : o === 15 ? t += 4 : o === 20 ? t += i[Math.random() * 4 | 8] : t += i[Math.random() * 16 | 0];
63
39
  return t;
64
40
  }
65
- function U(e, t) {
66
- `${e}`.length === 10 ? e = parseInt(e + "") * 1e3 : e = +e;
67
- const n = new Date(e), o = (Date.now() - Number(n)) / 1e3;
68
- return o < 30 ? "刚刚" : o < 3600 ? `${Math.ceil(o / 60)}分钟前` : o < 3600 * 24 ? `${Math.ceil(o / 3600)}小时前` : o < 3600 * 24 * 2 ? "1天前" : t ? m(e, t) : `${n.getMonth() + 1}月${n.getDate()}日${n.getHours()}时${n.getMinutes()}分`;
69
- }
70
- function Z(e) {
71
- const t = e || /* @__PURE__ */ new Date(), n = new Date(t), r = new Date(t);
72
- return n.setHours(0, 0, 0), r.setHours(23, 59, 59), {
73
- dateRange: [m(n), m(r)],
74
- timestampRange: [n.getTime(), r.getTime()]
41
+ function xt(t, i) {
42
+ if (!t) return "-";
43
+ t.toString().length === 10 && (t = +t * 1e3), i ?? (i = "YYYY-MM-DD HH:mm:ss");
44
+ const o = new Date(t), s = (d, a, b = " ") => {
45
+ if (d.length >= a) return d;
46
+ const m = a - d.length;
47
+ let v = Math.ceil(m / b.length);
48
+ for (; v >>= 1; )
49
+ b += b, v === 1 && (b += b);
50
+ return b.slice(0, m) + d;
51
+ };
52
+ let u;
53
+ const f = {
54
+ "Y+": o.getFullYear().toString(),
55
+ "M+": (o.getMonth() + 1).toString(),
56
+ "D+": o.getDate().toString(),
57
+ "H+": o.getHours().toString(),
58
+ "m+": o.getMinutes().toString(),
59
+ "s+": o.getSeconds().toString()
60
+ };
61
+ for (const d in f)
62
+ u = new RegExp("(" + d + ")").exec(i), u && (i = i.replace(u[1], u[1].length == 1 ? f[d] : s(f[d], u[1].length, "0")));
63
+ return i;
64
+ }
65
+ function Wn(t, i) {
66
+ `${t}`.length === 10 ? t = parseInt(t + "") * 1e3 : t = +t;
67
+ const o = new Date(t), u = (Date.now() - Number(o)) / 1e3;
68
+ return u < 30 ? "刚刚" : u < 3600 ? `${Math.ceil(u / 60)}分钟前` : u < 3600 * 24 ? `${Math.ceil(u / 3600)}小时前` : u < 3600 * 24 * 2 ? "1天前" : i ? xt(t, i) : `${o.getMonth() + 1}月${o.getDate()}日${o.getHours()}时${o.getMinutes()}分`;
69
+ }
70
+ function Jn(t) {
71
+ const i = t || /* @__PURE__ */ new Date(), o = new Date(i), s = new Date(i);
72
+ return o.setHours(0, 0, 0), s.setHours(23, 59, 59), {
73
+ dateRange: [xt(o), xt(s)],
74
+ timestampRange: [o.getTime(), s.getTime()]
75
75
  };
76
76
  }
77
- const J = {
78
- set(e, t) {
79
- sessionStorage && e && t && sessionStorage.setItem(e, t);
77
+ const Xn = {
78
+ set(t, i) {
79
+ sessionStorage && t && i && sessionStorage.setItem(t, i);
80
80
  },
81
- get(e) {
82
- return !sessionStorage || !e ? null : sessionStorage.getItem(e);
81
+ get(t) {
82
+ return !sessionStorage || !t ? null : sessionStorage.getItem(t);
83
83
  },
84
- setJSON(e, t) {
85
- t && this.set(e, JSON.stringify(t));
84
+ setJSON(t, i) {
85
+ i && this.set(t, JSON.stringify(i));
86
86
  },
87
- getJSON(e) {
88
- const t = this.get(e);
89
- return t ? JSON.parse(t) : null;
87
+ getJSON(t) {
88
+ const i = this.get(t);
89
+ return i ? JSON.parse(i) : null;
90
90
  },
91
- remove(e) {
92
- sessionStorage.removeItem(e);
91
+ remove(t) {
92
+ sessionStorage.removeItem(t);
93
93
  },
94
94
  clear() {
95
95
  sessionStorage.clear();
96
96
  }
97
- }, W = {
98
- set(e, t) {
99
- localStorage && e && t && localStorage.setItem(e, t);
97
+ }, Kn = {
98
+ set(t, i) {
99
+ localStorage && t && i && localStorage.setItem(t, i);
100
100
  },
101
- get(e) {
102
- return !localStorage || !e ? null : localStorage.getItem(e);
101
+ get(t) {
102
+ return !localStorage || !t ? null : localStorage.getItem(t);
103
103
  },
104
- setJSON(e, t) {
105
- t && this.set(e, JSON.stringify(t));
104
+ setJSON(t, i) {
105
+ i && this.set(t, JSON.stringify(i));
106
106
  },
107
- getJSON(e) {
108
- const t = this.get(e);
109
- return t ? JSON.parse(t) : null;
107
+ getJSON(t) {
108
+ const i = this.get(t);
109
+ return i ? JSON.parse(i) : null;
110
110
  },
111
- remove(e) {
112
- localStorage.removeItem(e);
111
+ remove(t) {
112
+ localStorage.removeItem(t);
113
113
  },
114
114
  clear() {
115
115
  localStorage.clear();
116
116
  }
117
117
  };
118
- function V(e, t) {
119
- if (!e || !t)
118
+ function Qn(t, i) {
119
+ if (!t || !i)
120
120
  return;
121
- let n = e.className;
122
- const r = n.indexOf(t);
123
- r === -1 ? n += `${t}` : n = n.substring(0, r) + n.substring(r + t.length), e.className = n;
121
+ let o = t.className;
122
+ const s = o.indexOf(i);
123
+ s === -1 ? o += `${i}` : o = o.substring(0, s) + o.substring(s + i.length), t.className = o;
124
124
  }
125
- function E(e, t) {
126
- return e.className.match(new RegExp("(?:\\s|^)" + t + "(?:\\s|$)"));
125
+ function Ct(t, i) {
126
+ return t.className.match(new RegExp("(?:\\s|^)" + i + "(?:\\s|$)"));
127
127
  }
128
- function X(e, t) {
129
- E(e, t) || (e.className += ` ${t}`);
128
+ function tr(t, i) {
129
+ Ct(t, i) || (t.className += ` ${i}`);
130
130
  }
131
- function Q(e, t) {
132
- if (E(e, t)) {
133
- const n = new RegExp("(?:\\s|^)" + t + "(?:\\s|$)");
134
- e.className = e.className.replace(n, " ");
131
+ function er(t, i) {
132
+ if (Ct(t, i)) {
133
+ const o = new RegExp("(?:\\s|^)" + i + "(?:\\s|$)");
134
+ t.className = t.className.replace(o, " ");
135
135
  }
136
136
  }
137
- function K(e) {
138
- let t = !1;
139
- return function(...n) {
140
- t || (t = !0, window.requestAnimationFrame(() => {
141
- e.apply(this, n), t = !1;
137
+ function nr(t) {
138
+ let i = !1;
139
+ return function(...o) {
140
+ i || (i = !0, window.requestAnimationFrame(() => {
141
+ t.apply(this, o), i = !1;
142
142
  }));
143
143
  };
144
144
  }
145
- function ee(e) {
146
- e && (e.oncontextmenu = () => !1);
145
+ function rr(t) {
146
+ t && (t.oncontextmenu = () => !1);
147
147
  }
148
- function te(e) {
149
- return /^(http(s)?:\/\/)/.test(e);
148
+ function ir(t) {
149
+ return /^(http(s)?:\/\/)/.test(t);
150
150
  }
151
- function ne(e) {
152
- return /^(https?:|mailto:|tel:)/.test(e);
151
+ function or(t) {
152
+ return /^(https?:|mailto:|tel:)/.test(t);
153
153
  }
154
- function re(e) {
155
- return Object.prototype.toString.call(e) === "[object String]";
154
+ function sr(t) {
155
+ return Object.prototype.toString.call(t) === "[object String]";
156
156
  }
157
- function oe(e) {
158
- return /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g.test(e);
157
+ function fr(t) {
158
+ return /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g.test(t);
159
159
  }
160
- function ie(e) {
161
- return !Object.keys(e).length;
160
+ function cr(t) {
161
+ return !Object.keys(t).length;
162
162
  }
163
- function se(e) {
164
- return /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/.test(e);
163
+ function ur(t) {
164
+ return /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/.test(t);
165
165
  }
166
- function ce(e, t = 8) {
167
- return new RegExp(`^S*(?=S{${t}},})(?=S*d)(?=S*[A-Z])(?=S*[a-z])(?=S*[!@#$%^&*?])S*$`).test(e);
166
+ function ar(t, i = 8) {
167
+ return new RegExp(`^S*(?=S{${i}},})(?=S*d)(?=S*[A-Z])(?=S*[a-z])(?=S*[!@#$%^&*?])S*$`).test(t);
168
168
  }
169
- function ae(e) {
170
- return /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e);
169
+ function hr(t) {
170
+ return /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(t);
171
171
  }
172
- function O(e) {
173
- return /^\d{6}((((((19|20)\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|(((19|20)\d{2})(0[13578]|1[02])31)|((19|20)\d{2})02(0[1-9]|1\d|2[0-8])|((((19|20)([13579][26]|[2468][048]|0[48]))|(2000))0229))\d{3})|((((\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|((\d{2})(0[13578]|1[02])31)|((\d{2})02(0[1-9]|1\d|2[0-8]))|(([13579][26]|[2468][048]|0[048])0229))\d{2}))(\d|X|x)$/.test(e);
172
+ function Pt(t) {
173
+ return /^\d{6}((((((19|20)\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|(((19|20)\d{2})(0[13578]|1[02])31)|((19|20)\d{2})02(0[1-9]|1\d|2[0-8])|((((19|20)([13579][26]|[2468][048]|0[48]))|(2000))0229))\d{3})|((((\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|((\d{2})(0[13578]|1[02])31)|((\d{2})02(0[1-9]|1\d|2[0-8]))|(([13579][26]|[2468][048]|0[048])0229))\d{2}))(\d|X|x)$/.test(t);
174
174
  }
175
- function ue(e) {
176
- return /^0\d{2,3}-?\d{7,8}$/.test(e);
175
+ function lr(t) {
176
+ return /^0\d{2,3}-?\d{7,8}$/.test(t);
177
177
  }
178
- function fe(e) {
179
- return /^1[3-9]\d{9}$/.test(e);
178
+ function dr(t) {
179
+ return /^1[3-9]\d{9}$/.test(t);
180
180
  }
181
- const M = () => {
181
+ const $t = () => {
182
182
  };
183
- function ct(e) {
184
- return new Promise((t) => setTimeout(t, e));
185
- }
186
- function at(e, t) {
187
- return new Promise((n) => {
188
- const r = setInterval(() => {
189
- if (e === 0)
190
- return clearInterval(r), n(!0), !1;
191
- t && t(e), e--;
183
+ function vi(t) {
184
+ return new Promise((i) => setTimeout(i, t));
185
+ }
186
+ function yi(t, i) {
187
+ return new Promise((o) => {
188
+ const s = setInterval(() => {
189
+ if (t === 0)
190
+ return clearInterval(s), o(!0), !1;
191
+ i && i(t), t--;
192
192
  }, 1e3);
193
193
  });
194
194
  }
195
- function ut(e, t) {
196
- const n = e.slice(), r = [];
197
- let o = n.length;
198
- const i = [];
199
- if (t > o) return null;
200
- for (; t--; ) {
201
- const s = Math.floor(Math.random() * o);
202
- r[t] = n[s in i ? i[s] : s], i[s] = --o in i ? i[o] : o;
203
- }
204
- return r;
205
- }
206
- function ft(e, t) {
207
- let n = null;
208
- return function(...r) {
209
- n !== null && clearTimeout(n), n = setTimeout(() => {
210
- e.apply(this, r), n = null;
211
- }, t);
195
+ function bi(t, i) {
196
+ const o = t.slice(), s = [];
197
+ let u = o.length;
198
+ const f = [];
199
+ if (i > u) return null;
200
+ for (; i--; ) {
201
+ const d = Math.floor(Math.random() * u);
202
+ s[i] = o[d in f ? f[d] : d], f[d] = --u in f ? f[u] : u;
203
+ }
204
+ return s;
205
+ }
206
+ function wi(t, i) {
207
+ let o = null;
208
+ return function(...s) {
209
+ o !== null && clearTimeout(o), o = setTimeout(() => {
210
+ t.apply(this, s), o = null;
211
+ }, i);
212
212
  };
213
213
  }
214
- function lt(e) {
215
- if (!O(e))
214
+ function Ti(t) {
215
+ if (!Pt(t))
216
216
  throw new Error("Please provide a valid ID number!");
217
- const t = e.length, n = t === 15 ? e[t - 1] : e[t - 2];
218
- return parseInt(n) % 2 === 1 ? "1" : "2";
217
+ const i = t.length, o = i === 15 ? t[i - 1] : t[i - 2];
218
+ return parseInt(o) % 2 === 1 ? "1" : "2";
219
219
  }
220
- function dt(e) {
221
- if (!O(e))
220
+ function Fi(t) {
221
+ if (!Pt(t))
222
222
  throw new Error("Please provide a valid ID number!");
223
- return e.substring(6, 10) + "-" + e.substring(10, 12) + "-" + e.substring(12, 14);
224
- }
225
- const le = (e, t = "") => {
226
- t || (t = location.origin);
227
- const n = new RegExp(/^http(s)?:\/\//), r = new RegExp(/^((?:[a-z]+:)?\/\/|data:image\/)(.*)/i);
228
- return n.test(e) || r.test(e) ? e : t + e;
229
- }, ht = (e, t = "") => {
230
- typeof e == "string" && (e = e === "" ? [] : e.split(","));
231
- for (const n in e)
232
- e[n] = le(e[n], t);
233
- return e;
223
+ return t.substring(6, 10) + "-" + t.substring(10, 12) + "-" + t.substring(12, 14);
224
+ }
225
+ const pr = (t, i = "") => {
226
+ i || (i = location.origin);
227
+ const o = new RegExp(/^http(s)?:\/\//), s = new RegExp(/^((?:[a-z]+:)?\/\/|data:image\/)(.*)/i);
228
+ return o.test(t) || s.test(t) ? t : i + t;
229
+ }, Si = (t, i = "") => {
230
+ typeof t == "string" && (t = t === "" ? [] : t.split(","));
231
+ for (const o in t)
232
+ t[o] = pr(t[o], i);
233
+ return t;
234
234
  };
235
- function pt(e) {
236
- let t = M;
237
- return (...n) => new Promise((r, o) => {
238
- t(), t = () => {
239
- r = o = M;
240
- }, e(...n).then(
241
- (i) => r(i),
242
- (i) => o(i)
235
+ function Ei(t) {
236
+ if (!t.length)
237
+ return;
238
+ let i = 0;
239
+ function o() {
240
+ requestIdleCallback((s) => {
241
+ for (; i < t.length && s.timeRemaining() > 0; )
242
+ t[i++]();
243
+ i < t.length && o();
244
+ });
245
+ }
246
+ o();
247
+ }
248
+ function Bi(t) {
249
+ let i = $t;
250
+ return (...o) => new Promise((s, u) => {
251
+ i(), i = () => {
252
+ s = u = $t;
253
+ }, t(...o).then(
254
+ (f) => s(f),
255
+ (f) => u(f)
243
256
  );
244
257
  });
245
258
  }
246
- function gt(e, t) {
247
- const n = document.createElement("a");
248
- n.download = t, n.href = e, n.click();
249
- }
250
- function de(e) {
251
- const t = [];
252
- for (let n = 0; n < e.length; n++)
253
- e[n] && t.push(e[n]);
254
- return t;
255
- }
256
- function mt(e, t, n = !1) {
257
- let r = Math.round(e / t * 1e4) / 100;
258
- return Number.isNaN(r) && (r = 0), n ? Math.floor(r) : r;
259
+ function _i(t, i) {
260
+ const o = document.createElement("a");
261
+ o.download = i, o.href = t, o.click();
259
262
  }
260
- function vt(e) {
261
- const t = document.createElement("link");
262
- t.rel = "stylesheet", t.href = e, t.crossOrigin = "anonymous", document.getElementsByTagName("head")[0].appendChild(t);
263
- }
264
- function _t(e) {
265
- return new Promise((t, n) => {
266
- const r = document.createElement("script");
267
- r.type = "text/javascript", r.src = e, r.onload = () => t(), r.onerror = (o) => n(o), document.getElementsByTagName("head")[0].appendChild(r);
263
+ function gr(t) {
264
+ const i = [];
265
+ for (let o = 0; o < t.length; o++)
266
+ t[o] && i.push(t[o]);
267
+ return i;
268
+ }
269
+ function Ri(t, i, o = !1) {
270
+ let s = Math.round(t / i * 1e4) / 100;
271
+ return Number.isNaN(s) && (s = 0), o ? Math.floor(s) : s;
272
+ }
273
+ function Di(t) {
274
+ const i = document.createElement("link");
275
+ i.rel = "stylesheet", i.href = t, i.crossOrigin = "anonymous", document.getElementsByTagName("head")[0].appendChild(i);
276
+ }
277
+ function Ai(t) {
278
+ return new Promise((i, o) => {
279
+ const s = document.createElement("script");
280
+ s.type = "text/javascript", s.src = t, s.onload = () => i(), s.onerror = (u) => o(u), document.getElementsByTagName("head")[0].appendChild(s);
268
281
  });
269
282
  }
270
- const he = [
283
+ function Ii(t, i = 48, o = 48) {
284
+ const s = t.replace("#", "");
285
+ return `data:image/svg+xml;utf8,<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="${i}" height="${o}"><path d="M787.510356 387.850445c0-152.160515-123.350352-275.511891-275.510868-275.511891S236.487597 235.68993 236.487597 387.850445c0 44.665269 10.640338 86.841857 29.507034 124.151601l-0.010233-0.001023 0.059352 0.100284c5.548366 10.962679 11.812023 21.500687 18.723434 31.56081L511.999488 926.678464l227.234351-383.021463c6.909363-10.057053 13.170974-20.593014 18.71934-31.552623l0.062422-0.104377-0.011256 0.002047C776.870018 474.692303 787.510356 432.515714 787.510356 387.850445zM511.999488 506.802628c-74.596975 0-135.070278-60.47228-135.070278-135.070278 0-74.595952 60.47228-135.069255 135.070278-135.069255 74.595952 0 135.069255 60.473303 135.069255 135.069255C647.068743 446.330348 586.59544 506.802628 511.999488 506.802628z" fill="%23${s}"></path></svg>`;
286
+ }
287
+ const xr = [
271
288
  ["date", "YYYY-MM-DD"],
272
289
  ["daterange", "YYYY-MM-DD"],
273
290
  ["datetime", "YYYY-MM-DD HH:mm:ss"],
@@ -277,7 +294,7 @@ const he = [
277
294
  ["year", "YYYY"],
278
295
  ["yearrange", "YYYY"],
279
296
  ["time", "HH:mm:ss"]
280
- ], pe = {
297
+ ], mr = {
281
298
  view: "查看",
282
299
  add: "添加",
283
300
  edit: "编辑",
@@ -326,7 +343,7 @@ const he = [
326
343
  export: "导出",
327
344
  import: "导入",
328
345
  defaultErrorCode: "系统未知错误,请反馈给管理员"
329
- }, ge = {
346
+ }, vr = {
330
347
  400: "请求失败,请您稍后重试!",
331
348
  401: "认证失败,无法访问系统资源!",
332
349
  403: "当前操作没有权限!",
@@ -337,115 +354,115 @@ const he = [
337
354
  502: "网关错误!",
338
355
  503: "服务不可用!",
339
356
  504: "网关超时!"
340
- }, me = new Map(he), l = pe, ve = ge, x = ["jpg", "jpeg", "png", "bmp", "gif"], D = ["mp3", "mp4", "webm", "ogg", "3gp"], Y = ["doc", "docx", "xls", "xlsx", "ppt", "txt", "pdf", "zip"], _e = [...x, ...D, ...Y];
341
- function be(e) {
342
- return ve[e] ?? l.defaultErrorCode;
357
+ }, yr = new Map(xr), et = mr, br = vr, ie = ["jpg", "jpeg", "png", "bmp", "gif"], oe = ["mp3", "mp4", "webm", "ogg", "3gp"], se = ["doc", "docx", "xls", "xlsx", "ppt", "txt", "pdf", "zip"], wr = [...ie, ...oe, ...se];
358
+ function Tr(t) {
359
+ return br[t] ?? et.defaultErrorCode;
343
360
  }
344
- function ye(e) {
345
- return e == null ? l.unfilled : (e = typeof e == "number" ? `${e}` : e, e === "1" ? l.yes : l.no);
361
+ function Fr(t) {
362
+ return t == null ? et.unfilled : (t = typeof t == "number" ? `${t}` : t, t === "1" ? et.yes : et.no);
346
363
  }
347
- function we(e) {
348
- return e == null ? l.unfilled : (e = typeof e == "number" ? `${e}` : e, e === "1" ? l.have : l.noHave);
364
+ function Sr(t) {
365
+ return t == null ? et.unfilled : (t = typeof t == "number" ? `${t}` : t, t === "1" ? et.have : et.noHave);
349
366
  }
350
- function Ee(e) {
351
- return e ? e.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2") : "";
367
+ function Er(t) {
368
+ return t ? t.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2") : "";
352
369
  }
353
- function Oe(e, t, n) {
354
- if (t ?? (t = 4), n ?? (n = 4), e) {
355
- const r = e.length;
356
- return e.substring(0, t) + "*".repeat(r - t - n) + e.substring(r - n);
370
+ function Br(t, i, o) {
371
+ if (i ?? (i = 4), o ?? (o = 4), t) {
372
+ const s = t.length;
373
+ return t.substring(0, i) + "*".repeat(s - i - o) + t.substring(s - o);
357
374
  }
358
375
  return "";
359
376
  }
360
- function Me(e) {
361
- return e.replace(/( |^)[a-z]/g, (t) => t.toUpperCase());
377
+ function _r(t) {
378
+ return t.replace(/( |^)[a-z]/g, (i) => i.toUpperCase());
362
379
  }
363
- function Te(e) {
364
- return e.replace(/( |^)[A-Z]/g, (t) => t.toLowerCase());
380
+ function Rr(t) {
381
+ return t.replace(/( |^)[A-Z]/g, (i) => i.toLowerCase());
365
382
  }
366
- function Re(e, t) {
367
- const n = e.find((r) => r.value === t);
368
- return n ? n.label : "";
383
+ function Dr(t, i) {
384
+ const o = t.find((s) => s.value === i);
385
+ return o ? o.label : "";
369
386
  }
370
- function Ae(e, t, n) {
371
- const r = [], o = t.split(","), i = n.split(",");
372
- return Array.from(new Set(o)).forEach((c) => {
373
- const a = e.find((u) => u.value === c);
374
- a && i.forEach((u) => {
375
- var p;
376
- const f = (p = a.children) == null ? void 0 : p.find((F) => F.value === u);
377
- f && r.push(f);
387
+ function Ar(t, i, o) {
388
+ const s = [], u = i.split(","), f = o.split(",");
389
+ return Array.from(new Set(u)).forEach((a) => {
390
+ const b = t.find((m) => m.value === a);
391
+ b && f.forEach((m) => {
392
+ var B;
393
+ const v = (B = b.children) == null ? void 0 : B.find((_) => _.value === m);
394
+ v && s.push(v);
378
395
  });
379
- }), r.map((c) => c.label).join();
396
+ }), s.map((a) => a.label).join();
380
397
  }
381
- function z(e, t, n) {
382
- var i;
398
+ function fe(t, i, o) {
399
+ var f;
400
+ if (!i) return "";
401
+ const s = i.split(","), u = o.find((d) => d.value === s[t]);
402
+ return u ? ((f = u.children) != null && f.length && fe(t + 1, i, u.children), u.label) : "";
403
+ }
404
+ function Ir(t, i, o) {
383
405
  if (!t) return "";
384
- const r = t.split(","), o = n.find((s) => s.value === r[e]);
385
- return o ? ((i = o.children) != null && i.length && z(e + 1, t, o.children), o.label) : "";
386
- }
387
- function Se(e, t, n) {
388
- if (!e) return "";
389
- const r = e.split(","), o = [], i = r.length - 1, s = r.findIndex((c) => c === n);
390
- if (s !== -1) {
391
- const c = r[i] === n;
392
- r.splice(c ? 0 : s, c ? i : 1);
393
- }
394
- return r.forEach((c) => {
395
- const a = t.find((u) => u.value === c);
396
- a && o.push(a);
397
- }), o.map((c) => c.label).join();
398
- }
399
- function xe(e) {
400
- let t = "";
401
- for (const n of Object.keys(e)) {
402
- const r = e[n], o = `${encodeURIComponent(n)}=`;
403
- if (r !== null && typeof r < "u")
404
- if (typeof r == "object") {
405
- for (const i of Object.keys(r))
406
- if (r[i] !== null && typeof r[i] < "u") {
407
- const s = `${n}[${i}]`, c = `${encodeURIComponent(s)}=`;
408
- t += `${c + encodeURIComponent(r[i])}&`;
406
+ const s = t.split(","), u = [], f = s.length - 1, d = s.findIndex((a) => a === o);
407
+ if (d !== -1) {
408
+ const a = s[f] === o;
409
+ s.splice(a ? 0 : d, a ? f : 1);
410
+ }
411
+ return s.forEach((a) => {
412
+ const b = i.find((m) => m.value === a);
413
+ b && u.push(b);
414
+ }), u.map((a) => a.label).join();
415
+ }
416
+ function Mr(t) {
417
+ let i = "";
418
+ for (const o of Object.keys(t)) {
419
+ const s = t[o], u = `${encodeURIComponent(o)}=`;
420
+ if (s !== null && typeof s < "u")
421
+ if (typeof s == "object") {
422
+ for (const f of Object.keys(s))
423
+ if (s[f] !== null && typeof s[f] < "u") {
424
+ const d = `${o}[${f}]`, a = `${encodeURIComponent(d)}=`;
425
+ i += `${a + encodeURIComponent(s[f])}&`;
409
426
  }
410
427
  } else
411
- t += `${o + encodeURIComponent(r)}&`;
428
+ i += `${u + encodeURIComponent(s)}&`;
412
429
  }
413
- return t;
430
+ return i;
414
431
  }
415
- function De(e) {
416
- return e ? de(
417
- Object.keys(e).map((t) => e[t] === void 0 ? "" : `${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`)
432
+ function Or(t) {
433
+ return t ? gr(
434
+ Object.keys(t).map((i) => t[i] === void 0 ? "" : `${encodeURIComponent(i)}=${encodeURIComponent(t[i])}`)
418
435
  ).join("&") : "";
419
436
  }
420
- function Ye(e) {
421
- const t = decodeURIComponent(e.split("?")[1]).replace(/\+/g, " ");
422
- if (!t)
437
+ function qr(t) {
438
+ const i = decodeURIComponent(t.split("?")[1]).replace(/\+/g, " ");
439
+ if (!i)
423
440
  return {};
424
- const n = {};
425
- return t.split("&").forEach((o) => {
426
- const i = o.indexOf("=");
427
- if (i !== -1) {
428
- const s = o.substring(0, i), c = o.substring(i + 1, o.length);
429
- n[s] = c;
441
+ const o = {};
442
+ return i.split("&").forEach((u) => {
443
+ const f = u.indexOf("=");
444
+ if (f !== -1) {
445
+ const d = u.substring(0, f), a = u.substring(f + 1, u.length);
446
+ o[d] = a;
430
447
  }
431
- }), n;
448
+ }), o;
432
449
  }
433
- var I = function() {
450
+ var ce = function() {
434
451
  if (typeof Map < "u")
435
452
  return Map;
436
- function e(t, n) {
437
- var r = -1;
438
- return t.some(function(o, i) {
439
- return o[0] === n ? (r = i, !0) : !1;
440
- }), r;
453
+ function t(i, o) {
454
+ var s = -1;
455
+ return i.some(function(u, f) {
456
+ return u[0] === o ? (s = f, !0) : !1;
457
+ }), s;
441
458
  }
442
459
  return (
443
460
  /** @class */
444
461
  function() {
445
- function t() {
462
+ function i() {
446
463
  this.__entries__ = [];
447
464
  }
448
- return Object.defineProperty(t.prototype, "size", {
465
+ return Object.defineProperty(i.prototype, "size", {
449
466
  /**
450
467
  * @returns {boolean}
451
468
  */
@@ -454,433 +471,2160 @@ var I = function() {
454
471
  },
455
472
  enumerable: !0,
456
473
  configurable: !0
457
- }), t.prototype.get = function(n) {
458
- var r = e(this.__entries__, n), o = this.__entries__[r];
459
- return o && o[1];
460
- }, t.prototype.set = function(n, r) {
461
- var o = e(this.__entries__, n);
462
- ~o ? this.__entries__[o][1] = r : this.__entries__.push([n, r]);
463
- }, t.prototype.delete = function(n) {
464
- var r = this.__entries__, o = e(r, n);
465
- ~o && r.splice(o, 1);
466
- }, t.prototype.has = function(n) {
467
- return !!~e(this.__entries__, n);
468
- }, t.prototype.clear = function() {
474
+ }), i.prototype.get = function(o) {
475
+ var s = t(this.__entries__, o), u = this.__entries__[s];
476
+ return u && u[1];
477
+ }, i.prototype.set = function(o, s) {
478
+ var u = t(this.__entries__, o);
479
+ ~u ? this.__entries__[u][1] = s : this.__entries__.push([o, s]);
480
+ }, i.prototype.delete = function(o) {
481
+ var s = this.__entries__, u = t(s, o);
482
+ ~u && s.splice(u, 1);
483
+ }, i.prototype.has = function(o) {
484
+ return !!~t(this.__entries__, o);
485
+ }, i.prototype.clear = function() {
469
486
  this.__entries__.splice(0);
470
- }, t.prototype.forEach = function(n, r) {
471
- r === void 0 && (r = null);
472
- for (var o = 0, i = this.__entries__; o < i.length; o++) {
473
- var s = i[o];
474
- n.call(r, s[1], s[0]);
487
+ }, i.prototype.forEach = function(o, s) {
488
+ s === void 0 && (s = null);
489
+ for (var u = 0, f = this.__entries__; u < f.length; u++) {
490
+ var d = f[u];
491
+ o.call(s, d[1], d[0]);
475
492
  }
476
- }, t;
493
+ }, i;
477
494
  }()
478
495
  );
479
- }(), w = typeof window < "u" && typeof document < "u" && window.document === document, v = function() {
496
+ }(), qt = typeof window < "u" && typeof document < "u" && window.document === document, mt = function() {
480
497
  return typeof global < "u" && global.Math === Math ? global : typeof self < "u" && self.Math === Math ? self : typeof window < "u" && window.Math === Math ? window : Function("return this")();
481
- }(), ze = function() {
482
- return typeof requestAnimationFrame == "function" ? requestAnimationFrame.bind(v) : function(e) {
498
+ }(), Cr = function() {
499
+ return typeof requestAnimationFrame == "function" ? requestAnimationFrame.bind(mt) : function(t) {
483
500
  return setTimeout(function() {
484
- return e(Date.now());
501
+ return t(Date.now());
485
502
  }, 1e3 / 60);
486
503
  };
487
- }(), Ie = 2;
488
- function Ce(e, t) {
489
- var n = !1, r = !1, o = 0;
490
- function i() {
491
- n && (n = !1, e()), r && c();
492
- }
493
- function s() {
494
- ze(i);
495
- }
496
- function c() {
497
- var a = Date.now();
498
- if (n) {
499
- if (a - o < Ie)
504
+ }(), Pr = 2;
505
+ function zr(t, i) {
506
+ var o = !1, s = !1, u = 0;
507
+ function f() {
508
+ o && (o = !1, t()), s && a();
509
+ }
510
+ function d() {
511
+ Cr(f);
512
+ }
513
+ function a() {
514
+ var b = Date.now();
515
+ if (o) {
516
+ if (b - u < Pr)
500
517
  return;
501
- r = !0;
518
+ s = !0;
502
519
  } else
503
- n = !0, r = !1, setTimeout(s, t);
504
- o = a;
520
+ o = !0, s = !1, setTimeout(d, i);
521
+ u = b;
505
522
  }
506
- return c;
523
+ return a;
507
524
  }
508
- var $e = 20, Le = ["top", "right", "bottom", "left", "width", "height", "size", "weight"], ke = typeof MutationObserver < "u", Fe = (
525
+ var Hr = 20, Lr = ["top", "right", "bottom", "left", "width", "height", "size", "weight"], Nr = typeof MutationObserver < "u", Yr = (
509
526
  /** @class */
510
527
  function() {
511
- function e() {
512
- this.connected_ = !1, this.mutationEventsAdded_ = !1, this.mutationsObserver_ = null, this.observers_ = [], this.onTransitionEnd_ = this.onTransitionEnd_.bind(this), this.refresh = Ce(this.refresh.bind(this), $e);
513
- }
514
- return e.prototype.addObserver = function(t) {
515
- ~this.observers_.indexOf(t) || this.observers_.push(t), this.connected_ || this.connect_();
516
- }, e.prototype.removeObserver = function(t) {
517
- var n = this.observers_, r = n.indexOf(t);
518
- ~r && n.splice(r, 1), !n.length && this.connected_ && this.disconnect_();
519
- }, e.prototype.refresh = function() {
520
- var t = this.updateObservers_();
521
- t && this.refresh();
522
- }, e.prototype.updateObservers_ = function() {
523
- var t = this.observers_.filter(function(n) {
524
- return n.gatherActive(), n.hasActive();
528
+ function t() {
529
+ this.connected_ = !1, this.mutationEventsAdded_ = !1, this.mutationsObserver_ = null, this.observers_ = [], this.onTransitionEnd_ = this.onTransitionEnd_.bind(this), this.refresh = zr(this.refresh.bind(this), Hr);
530
+ }
531
+ return t.prototype.addObserver = function(i) {
532
+ ~this.observers_.indexOf(i) || this.observers_.push(i), this.connected_ || this.connect_();
533
+ }, t.prototype.removeObserver = function(i) {
534
+ var o = this.observers_, s = o.indexOf(i);
535
+ ~s && o.splice(s, 1), !o.length && this.connected_ && this.disconnect_();
536
+ }, t.prototype.refresh = function() {
537
+ var i = this.updateObservers_();
538
+ i && this.refresh();
539
+ }, t.prototype.updateObservers_ = function() {
540
+ var i = this.observers_.filter(function(o) {
541
+ return o.gatherActive(), o.hasActive();
525
542
  });
526
- return t.forEach(function(n) {
527
- return n.broadcastActive();
528
- }), t.length > 0;
529
- }, e.prototype.connect_ = function() {
530
- !w || this.connected_ || (document.addEventListener("transitionend", this.onTransitionEnd_), window.addEventListener("resize", this.refresh), ke ? (this.mutationsObserver_ = new MutationObserver(this.refresh), this.mutationsObserver_.observe(document, {
543
+ return i.forEach(function(o) {
544
+ return o.broadcastActive();
545
+ }), i.length > 0;
546
+ }, t.prototype.connect_ = function() {
547
+ !qt || this.connected_ || (document.addEventListener("transitionend", this.onTransitionEnd_), window.addEventListener("resize", this.refresh), Nr ? (this.mutationsObserver_ = new MutationObserver(this.refresh), this.mutationsObserver_.observe(document, {
531
548
  attributes: !0,
532
549
  childList: !0,
533
550
  characterData: !0,
534
551
  subtree: !0
535
552
  })) : (document.addEventListener("DOMSubtreeModified", this.refresh), this.mutationEventsAdded_ = !0), this.connected_ = !0);
536
- }, e.prototype.disconnect_ = function() {
537
- !w || !this.connected_ || (document.removeEventListener("transitionend", this.onTransitionEnd_), window.removeEventListener("resize", this.refresh), this.mutationsObserver_ && this.mutationsObserver_.disconnect(), this.mutationEventsAdded_ && document.removeEventListener("DOMSubtreeModified", this.refresh), this.mutationsObserver_ = null, this.mutationEventsAdded_ = !1, this.connected_ = !1);
538
- }, e.prototype.onTransitionEnd_ = function(t) {
539
- var n = t.propertyName, r = n === void 0 ? "" : n, o = Le.some(function(i) {
540
- return !!~r.indexOf(i);
553
+ }, t.prototype.disconnect_ = function() {
554
+ !qt || !this.connected_ || (document.removeEventListener("transitionend", this.onTransitionEnd_), window.removeEventListener("resize", this.refresh), this.mutationsObserver_ && this.mutationsObserver_.disconnect(), this.mutationEventsAdded_ && document.removeEventListener("DOMSubtreeModified", this.refresh), this.mutationsObserver_ = null, this.mutationEventsAdded_ = !1, this.connected_ = !1);
555
+ }, t.prototype.onTransitionEnd_ = function(i) {
556
+ var o = i.propertyName, s = o === void 0 ? "" : o, u = Lr.some(function(f) {
557
+ return !!~s.indexOf(f);
541
558
  });
542
- o && this.refresh();
543
- }, e.getInstance = function() {
544
- return this.instance_ || (this.instance_ = new e()), this.instance_;
545
- }, e.instance_ = null, e;
559
+ u && this.refresh();
560
+ }, t.getInstance = function() {
561
+ return this.instance_ || (this.instance_ = new t()), this.instance_;
562
+ }, t.instance_ = null, t;
546
563
  }()
547
- ), C = function(e, t) {
548
- for (var n = 0, r = Object.keys(t); n < r.length; n++) {
549
- var o = r[n];
550
- Object.defineProperty(e, o, {
551
- value: t[o],
564
+ ), ue = function(t, i) {
565
+ for (var o = 0, s = Object.keys(i); o < s.length; o++) {
566
+ var u = s[o];
567
+ Object.defineProperty(t, u, {
568
+ value: i[u],
552
569
  enumerable: !1,
553
570
  writable: !1,
554
571
  configurable: !0
555
572
  });
556
573
  }
557
- return e;
558
- }, d = function(e) {
559
- var t = e && e.ownerDocument && e.ownerDocument.defaultView;
560
- return t || v;
561
- }, $ = b(0, 0, 0, 0);
562
- function _(e) {
563
- return parseFloat(e) || 0;
564
- }
565
- function T(e) {
566
- for (var t = [], n = 1; n < arguments.length; n++)
567
- t[n - 1] = arguments[n];
568
- return t.reduce(function(r, o) {
569
- var i = e["border-" + o + "-width"];
570
- return r + _(i);
574
+ return t;
575
+ }, ot = function(t) {
576
+ var i = t && t.ownerDocument && t.ownerDocument.defaultView;
577
+ return i || mt;
578
+ }, ae = yt(0, 0, 0, 0);
579
+ function vt(t) {
580
+ return parseFloat(t) || 0;
581
+ }
582
+ function jt(t) {
583
+ for (var i = [], o = 1; o < arguments.length; o++)
584
+ i[o - 1] = arguments[o];
585
+ return i.reduce(function(s, u) {
586
+ var f = t["border-" + u + "-width"];
587
+ return s + vt(f);
571
588
  }, 0);
572
589
  }
573
- function He(e) {
574
- for (var t = ["top", "right", "bottom", "left"], n = {}, r = 0, o = t; r < o.length; r++) {
575
- var i = o[r], s = e["padding-" + i];
576
- n[i] = _(s);
577
- }
578
- return n;
579
- }
580
- function Ne(e) {
581
- var t = e.getBBox();
582
- return b(0, 0, t.width, t.height);
583
- }
584
- function Pe(e) {
585
- var t = e.clientWidth, n = e.clientHeight;
586
- if (!t && !n)
587
- return $;
588
- var r = d(e).getComputedStyle(e), o = He(r), i = o.left + o.right, s = o.top + o.bottom, c = _(r.width), a = _(r.height);
589
- if (r.boxSizing === "border-box" && (Math.round(c + i) !== t && (c -= T(r, "left", "right") + i), Math.round(a + s) !== n && (a -= T(r, "top", "bottom") + s)), !qe(e)) {
590
- var u = Math.round(c + i) - t, f = Math.round(a + s) - n;
591
- Math.abs(u) !== 1 && (c -= u), Math.abs(f) !== 1 && (a -= f);
592
- }
593
- return b(o.left, o.top, c, a);
594
- }
595
- var Be = /* @__PURE__ */ function() {
596
- return typeof SVGGraphicsElement < "u" ? function(e) {
597
- return e instanceof d(e).SVGGraphicsElement;
598
- } : function(e) {
599
- return e instanceof d(e).SVGElement && typeof e.getBBox == "function";
590
+ function kr(t) {
591
+ for (var i = ["top", "right", "bottom", "left"], o = {}, s = 0, u = i; s < u.length; s++) {
592
+ var f = u[s], d = t["padding-" + f];
593
+ o[f] = vt(d);
594
+ }
595
+ return o;
596
+ }
597
+ function Vr(t) {
598
+ var i = t.getBBox();
599
+ return yt(0, 0, i.width, i.height);
600
+ }
601
+ function $r(t) {
602
+ var i = t.clientWidth, o = t.clientHeight;
603
+ if (!i && !o)
604
+ return ae;
605
+ var s = ot(t).getComputedStyle(t), u = kr(s), f = u.left + u.right, d = u.top + u.bottom, a = vt(s.width), b = vt(s.height);
606
+ if (s.boxSizing === "border-box" && (Math.round(a + f) !== i && (a -= jt(s, "left", "right") + f), Math.round(b + d) !== o && (b -= jt(s, "top", "bottom") + d)), !Ur(t)) {
607
+ var m = Math.round(a + f) - i, v = Math.round(b + d) - o;
608
+ Math.abs(m) !== 1 && (a -= m), Math.abs(v) !== 1 && (b -= v);
609
+ }
610
+ return yt(u.left, u.top, a, b);
611
+ }
612
+ var jr = /* @__PURE__ */ function() {
613
+ return typeof SVGGraphicsElement < "u" ? function(t) {
614
+ return t instanceof ot(t).SVGGraphicsElement;
615
+ } : function(t) {
616
+ return t instanceof ot(t).SVGElement && typeof t.getBBox == "function";
600
617
  };
601
618
  }();
602
- function qe(e) {
603
- return e === d(e).document.documentElement;
604
- }
605
- function je(e) {
606
- return w ? Be(e) ? Ne(e) : Pe(e) : $;
607
- }
608
- function Ge(e) {
609
- var t = e.x, n = e.y, r = e.width, o = e.height, i = typeof DOMRectReadOnly < "u" ? DOMRectReadOnly : Object, s = Object.create(i.prototype);
610
- return C(s, {
611
- x: t,
612
- y: n,
613
- width: r,
614
- height: o,
615
- top: n,
616
- right: t + r,
617
- bottom: o + n,
618
- left: t
619
- }), s;
620
- }
621
- function b(e, t, n, r) {
622
- return { x: e, y: t, width: n, height: r };
623
- }
624
- var Ue = (
619
+ function Ur(t) {
620
+ return t === ot(t).document.documentElement;
621
+ }
622
+ function Zr(t) {
623
+ return qt ? jr(t) ? Vr(t) : $r(t) : ae;
624
+ }
625
+ function Gr(t) {
626
+ var i = t.x, o = t.y, s = t.width, u = t.height, f = typeof DOMRectReadOnly < "u" ? DOMRectReadOnly : Object, d = Object.create(f.prototype);
627
+ return ue(d, {
628
+ x: i,
629
+ y: o,
630
+ width: s,
631
+ height: u,
632
+ top: o,
633
+ right: i + s,
634
+ bottom: u + o,
635
+ left: i
636
+ }), d;
637
+ }
638
+ function yt(t, i, o, s) {
639
+ return { x: t, y: i, width: o, height: s };
640
+ }
641
+ var Wr = (
625
642
  /** @class */
626
643
  function() {
627
- function e(t) {
628
- this.broadcastWidth = 0, this.broadcastHeight = 0, this.contentRect_ = b(0, 0, 0, 0), this.target = t;
629
- }
630
- return e.prototype.isActive = function() {
631
- var t = je(this.target);
632
- return this.contentRect_ = t, t.width !== this.broadcastWidth || t.height !== this.broadcastHeight;
633
- }, e.prototype.broadcastRect = function() {
634
- var t = this.contentRect_;
635
- return this.broadcastWidth = t.width, this.broadcastHeight = t.height, t;
636
- }, e;
644
+ function t(i) {
645
+ this.broadcastWidth = 0, this.broadcastHeight = 0, this.contentRect_ = yt(0, 0, 0, 0), this.target = i;
646
+ }
647
+ return t.prototype.isActive = function() {
648
+ var i = Zr(this.target);
649
+ return this.contentRect_ = i, i.width !== this.broadcastWidth || i.height !== this.broadcastHeight;
650
+ }, t.prototype.broadcastRect = function() {
651
+ var i = this.contentRect_;
652
+ return this.broadcastWidth = i.width, this.broadcastHeight = i.height, i;
653
+ }, t;
637
654
  }()
638
- ), Ze = (
655
+ ), Jr = (
639
656
  /** @class */
640
657
  /* @__PURE__ */ function() {
641
- function e(t, n) {
642
- var r = Ge(n);
643
- C(this, { target: t, contentRect: r });
658
+ function t(i, o) {
659
+ var s = Gr(o);
660
+ ue(this, { target: i, contentRect: s });
644
661
  }
645
- return e;
662
+ return t;
646
663
  }()
647
- ), Je = (
664
+ ), Xr = (
648
665
  /** @class */
649
666
  function() {
650
- function e(t, n, r) {
651
- if (this.activeObservations_ = [], this.observations_ = new I(), typeof t != "function")
667
+ function t(i, o, s) {
668
+ if (this.activeObservations_ = [], this.observations_ = new ce(), typeof i != "function")
652
669
  throw new TypeError("The callback provided as parameter 1 is not a function.");
653
- this.callback_ = t, this.controller_ = n, this.callbackCtx_ = r;
670
+ this.callback_ = i, this.controller_ = o, this.callbackCtx_ = s;
654
671
  }
655
- return e.prototype.observe = function(t) {
672
+ return t.prototype.observe = function(i) {
656
673
  if (!arguments.length)
657
674
  throw new TypeError("1 argument required, but only 0 present.");
658
675
  if (!(typeof Element > "u" || !(Element instanceof Object))) {
659
- if (!(t instanceof d(t).Element))
676
+ if (!(i instanceof ot(i).Element))
660
677
  throw new TypeError('parameter 1 is not of type "Element".');
661
- var n = this.observations_;
662
- n.has(t) || (n.set(t, new Ue(t)), this.controller_.addObserver(this), this.controller_.refresh());
678
+ var o = this.observations_;
679
+ o.has(i) || (o.set(i, new Wr(i)), this.controller_.addObserver(this), this.controller_.refresh());
663
680
  }
664
- }, e.prototype.unobserve = function(t) {
681
+ }, t.prototype.unobserve = function(i) {
665
682
  if (!arguments.length)
666
683
  throw new TypeError("1 argument required, but only 0 present.");
667
684
  if (!(typeof Element > "u" || !(Element instanceof Object))) {
668
- if (!(t instanceof d(t).Element))
685
+ if (!(i instanceof ot(i).Element))
669
686
  throw new TypeError('parameter 1 is not of type "Element".');
670
- var n = this.observations_;
671
- n.has(t) && (n.delete(t), n.size || this.controller_.removeObserver(this));
687
+ var o = this.observations_;
688
+ o.has(i) && (o.delete(i), o.size || this.controller_.removeObserver(this));
672
689
  }
673
- }, e.prototype.disconnect = function() {
690
+ }, t.prototype.disconnect = function() {
674
691
  this.clearActive(), this.observations_.clear(), this.controller_.removeObserver(this);
675
- }, e.prototype.gatherActive = function() {
676
- var t = this;
677
- this.clearActive(), this.observations_.forEach(function(n) {
678
- n.isActive() && t.activeObservations_.push(n);
692
+ }, t.prototype.gatherActive = function() {
693
+ var i = this;
694
+ this.clearActive(), this.observations_.forEach(function(o) {
695
+ o.isActive() && i.activeObservations_.push(o);
679
696
  });
680
- }, e.prototype.broadcastActive = function() {
697
+ }, t.prototype.broadcastActive = function() {
681
698
  if (this.hasActive()) {
682
- var t = this.callbackCtx_, n = this.activeObservations_.map(function(r) {
683
- return new Ze(r.target, r.broadcastRect());
699
+ var i = this.callbackCtx_, o = this.activeObservations_.map(function(s) {
700
+ return new Jr(s.target, s.broadcastRect());
684
701
  });
685
- this.callback_.call(t, n, t), this.clearActive();
702
+ this.callback_.call(i, o, i), this.clearActive();
686
703
  }
687
- }, e.prototype.clearActive = function() {
704
+ }, t.prototype.clearActive = function() {
688
705
  this.activeObservations_.splice(0);
689
- }, e.prototype.hasActive = function() {
706
+ }, t.prototype.hasActive = function() {
690
707
  return this.activeObservations_.length > 0;
691
- }, e;
708
+ }, t;
692
709
  }()
693
- ), L = typeof WeakMap < "u" ? /* @__PURE__ */ new WeakMap() : new I(), k = (
710
+ ), he = typeof WeakMap < "u" ? /* @__PURE__ */ new WeakMap() : new ce(), le = (
694
711
  /** @class */
695
712
  /* @__PURE__ */ function() {
696
- function e(t) {
697
- if (!(this instanceof e))
713
+ function t(i) {
714
+ if (!(this instanceof t))
698
715
  throw new TypeError("Cannot call a class as a function.");
699
716
  if (!arguments.length)
700
717
  throw new TypeError("1 argument required, but only 0 present.");
701
- var n = Fe.getInstance(), r = new Je(t, n, this);
702
- L.set(this, r);
718
+ var o = Yr.getInstance(), s = new Xr(i, o, this);
719
+ he.set(this, s);
703
720
  }
704
- return e;
721
+ return t;
705
722
  }()
706
723
  );
707
724
  [
708
725
  "observe",
709
726
  "unobserve",
710
727
  "disconnect"
711
- ].forEach(function(e) {
712
- k.prototype[e] = function() {
713
- var t;
714
- return (t = L.get(this))[e].apply(t, arguments);
728
+ ].forEach(function(t) {
729
+ le.prototype[t] = function() {
730
+ var i;
731
+ return (i = he.get(this))[t].apply(i, arguments);
715
732
  };
716
733
  });
717
- var We = function() {
718
- return typeof v.ResizeObserver < "u" ? v.ResizeObserver : k;
734
+ var Kr = function() {
735
+ return typeof mt.ResizeObserver < "u" ? mt.ResizeObserver : le;
719
736
  }();
720
- function Ve(e) {
721
- for (const t of e) {
722
- const n = t.target.__resizeListeners__ || [];
723
- n.length && n.forEach((r) => r());
737
+ function Qr(t) {
738
+ for (const i of t) {
739
+ const o = i.target.__resizeListeners__ || [];
740
+ o.length && o.forEach((s) => s());
724
741
  }
725
742
  }
726
- function bt(e, t) {
727
- typeof window > "u" || (e.__resizeListeners__ || (e.__resizeListeners__ = [], e.__ro__ = new We(Ve), e.__ro__.observe(e)), e.__resizeListeners__.push(t));
743
+ function Mi(t, i) {
744
+ typeof window > "u" || (t.__resizeListeners__ || (t.__resizeListeners__ = [], t.__ro__ = new Kr(Qr), t.__ro__.observe(t)), t.__resizeListeners__.push(i));
728
745
  }
729
- function yt(e, t) {
730
- !e || !e.__resizeListeners__ || (e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t), 1), e.__resizeListeners__.length || e.__ro__.disconnect());
746
+ function Oi(t, i) {
747
+ !t || !t.__resizeListeners__ || (t.__resizeListeners__.splice(t.__resizeListeners__.indexOf(i), 1), t.__resizeListeners__.length || t.__ro__.disconnect());
731
748
  }
732
- let h = [], Xe = { consecutiveFrames: 0, lastBlinkTime: 0 }, Qe = { consecutiveFrames: 0, lastBlinkTime: 0 };
733
- const Ke = /* @__PURE__ */ new Map([
734
- ["nod", [st, 30, 100]],
735
- ["shake", [it, 7, 100]],
736
- ["mouth", [ot, 0.35, 100]],
737
- ["eye", [rt, 0.3, 100]]
738
- ]), wt = ["nod", "shake", "mouth", "eye"], Et = {
749
+ var gt = { exports: {} }, ti = gt.exports, Ut;
750
+ function bt() {
751
+ return Ut || (Ut = 1, function(t, i) {
752
+ (function() {
753
+ var o, s = 244837814094590, u = (s & 16777215) == 15715070;
754
+ function f(e, n, r) {
755
+ e != null && (typeof e == "number" ? this.fromNumber(e, n, r) : n == null && typeof e != "string" ? this.fromString(e, 256) : this.fromString(e, n));
756
+ }
757
+ function d() {
758
+ return new f(null);
759
+ }
760
+ function a(e, n, r, c, x, y) {
761
+ for (; --y >= 0; ) {
762
+ var S = n * this[e++] + r[c] + x;
763
+ x = Math.floor(S / 67108864), r[c++] = S & 67108863;
764
+ }
765
+ return x;
766
+ }
767
+ function b(e, n, r, c, x, y) {
768
+ for (var S = n & 32767, E = n >> 15; --y >= 0; ) {
769
+ var N = this[e] & 32767, k = this[e++] >> 15, Z = E * N + k * S;
770
+ N = S * N + ((Z & 32767) << 15) + r[c] + (x & 1073741823), x = (N >>> 30) + (Z >>> 15) + E * k + (x >>> 30), r[c++] = N & 1073741823;
771
+ }
772
+ return x;
773
+ }
774
+ function m(e, n, r, c, x, y) {
775
+ for (var S = n & 16383, E = n >> 14; --y >= 0; ) {
776
+ var N = this[e] & 16383, k = this[e++] >> 14, Z = E * N + k * S;
777
+ N = S * N + ((Z & 16383) << 14) + r[c] + x, x = (N >> 28) + (Z >> 14) + E * k, r[c++] = N & 268435455;
778
+ }
779
+ return x;
780
+ }
781
+ var v = typeof navigator < "u";
782
+ v && u && navigator.appName == "Microsoft Internet Explorer" ? (f.prototype.am = b, o = 30) : v && u && navigator.appName != "Netscape" ? (f.prototype.am = a, o = 26) : (f.prototype.am = m, o = 28), f.prototype.DB = o, f.prototype.DM = (1 << o) - 1, f.prototype.DV = 1 << o;
783
+ var B = 52;
784
+ f.prototype.FV = Math.pow(2, B), f.prototype.F1 = B - o, f.prototype.F2 = 2 * o - B;
785
+ var _ = "0123456789abcdefghijklmnopqrstuvwxyz", M = new Array(), R, q;
786
+ for (R = 48, q = 0; q <= 9; ++q) M[R++] = q;
787
+ for (R = 97, q = 10; q < 36; ++q) M[R++] = q;
788
+ for (R = 65, q = 10; q < 36; ++q) M[R++] = q;
789
+ function p(e) {
790
+ return _.charAt(e);
791
+ }
792
+ function w(e, n) {
793
+ var r = M[e.charCodeAt(n)];
794
+ return r ?? -1;
795
+ }
796
+ function g(e) {
797
+ for (var n = this.t - 1; n >= 0; --n) e[n] = this[n];
798
+ e.t = this.t, e.s = this.s;
799
+ }
800
+ function l(e) {
801
+ this.t = 1, this.s = e < 0 ? -1 : 0, e > 0 ? this[0] = e : e < -1 ? this[0] = e + this.DV : this.t = 0;
802
+ }
803
+ function T(e) {
804
+ var n = d();
805
+ return n.fromInt(e), n;
806
+ }
807
+ function h(e, n) {
808
+ var r;
809
+ if (n == 16) r = 4;
810
+ else if (n == 8) r = 3;
811
+ else if (n == 256) r = 8;
812
+ else if (n == 2) r = 1;
813
+ else if (n == 32) r = 5;
814
+ else if (n == 4) r = 2;
815
+ else {
816
+ this.fromRadix(e, n);
817
+ return;
818
+ }
819
+ this.t = 0, this.s = 0;
820
+ for (var c = e.length, x = !1, y = 0; --c >= 0; ) {
821
+ var S = r == 8 ? e[c] & 255 : w(e, c);
822
+ if (S < 0) {
823
+ e.charAt(c) == "-" && (x = !0);
824
+ continue;
825
+ }
826
+ x = !1, y == 0 ? this[this.t++] = S : y + r > this.DB ? (this[this.t - 1] |= (S & (1 << this.DB - y) - 1) << y, this[this.t++] = S >> this.DB - y) : this[this.t - 1] |= S << y, y += r, y >= this.DB && (y -= this.DB);
827
+ }
828
+ r == 8 && (e[0] & 128) != 0 && (this.s = -1, y > 0 && (this[this.t - 1] |= (1 << this.DB - y) - 1 << y)), this.clamp(), x && f.ZERO.subTo(this, this);
829
+ }
830
+ function F() {
831
+ for (var e = this.s & this.DM; this.t > 0 && this[this.t - 1] == e; ) --this.t;
832
+ }
833
+ function A(e) {
834
+ if (this.s < 0) return "-" + this.negate().toString(e);
835
+ var n;
836
+ if (e == 16) n = 4;
837
+ else if (e == 8) n = 3;
838
+ else if (e == 2) n = 1;
839
+ else if (e == 32) n = 5;
840
+ else if (e == 4) n = 2;
841
+ else return this.toRadix(e);
842
+ var r = (1 << n) - 1, c, x = !1, y = "", S = this.t, E = this.DB - S * this.DB % n;
843
+ if (S-- > 0)
844
+ for (E < this.DB && (c = this[S] >> E) > 0 && (x = !0, y = p(c)); S >= 0; )
845
+ E < n ? (c = (this[S] & (1 << E) - 1) << n - E, c |= this[--S] >> (E += this.DB - n)) : (c = this[S] >> (E -= n) & r, E <= 0 && (E += this.DB, --S)), c > 0 && (x = !0), x && (y += p(c));
846
+ return x ? y : "0";
847
+ }
848
+ function O() {
849
+ var e = d();
850
+ return f.ZERO.subTo(this, e), e;
851
+ }
852
+ function C() {
853
+ return this.s < 0 ? this.negate() : this;
854
+ }
855
+ function H(e) {
856
+ var n = this.s - e.s;
857
+ if (n != 0) return n;
858
+ var r = this.t;
859
+ if (n = r - e.t, n != 0) return this.s < 0 ? -n : n;
860
+ for (; --r >= 0; ) if ((n = this[r] - e[r]) != 0) return n;
861
+ return 0;
862
+ }
863
+ function D(e) {
864
+ var n = 1, r;
865
+ return (r = e >>> 16) != 0 && (e = r, n += 16), (r = e >> 8) != 0 && (e = r, n += 8), (r = e >> 4) != 0 && (e = r, n += 4), (r = e >> 2) != 0 && (e = r, n += 2), (r = e >> 1) != 0 && (e = r, n += 1), n;
866
+ }
867
+ function P() {
868
+ return this.t <= 0 ? 0 : this.DB * (this.t - 1) + D(this[this.t - 1] ^ this.s & this.DM);
869
+ }
870
+ function z(e, n) {
871
+ var r;
872
+ for (r = this.t - 1; r >= 0; --r) n[r + e] = this[r];
873
+ for (r = e - 1; r >= 0; --r) n[r] = 0;
874
+ n.t = this.t + e, n.s = this.s;
875
+ }
876
+ function L(e, n) {
877
+ for (var r = e; r < this.t; ++r) n[r - e] = this[r];
878
+ n.t = Math.max(this.t - e, 0), n.s = this.s;
879
+ }
880
+ function $(e, n) {
881
+ var r = e % this.DB, c = this.DB - r, x = (1 << c) - 1, y = Math.floor(e / this.DB), S = this.s << r & this.DM, E;
882
+ for (E = this.t - 1; E >= 0; --E)
883
+ n[E + y + 1] = this[E] >> c | S, S = (this[E] & x) << r;
884
+ for (E = y - 1; E >= 0; --E) n[E] = 0;
885
+ n[y] = S, n.t = this.t + y + 1, n.s = this.s, n.clamp();
886
+ }
887
+ function K(e, n) {
888
+ n.s = this.s;
889
+ var r = Math.floor(e / this.DB);
890
+ if (r >= this.t) {
891
+ n.t = 0;
892
+ return;
893
+ }
894
+ var c = e % this.DB, x = this.DB - c, y = (1 << c) - 1;
895
+ n[0] = this[r] >> c;
896
+ for (var S = r + 1; S < this.t; ++S)
897
+ n[S - r - 1] |= (this[S] & y) << x, n[S - r] = this[S] >> c;
898
+ c > 0 && (n[this.t - r - 1] |= (this.s & y) << x), n.t = this.t - r, n.clamp();
899
+ }
900
+ function G(e, n) {
901
+ for (var r = 0, c = 0, x = Math.min(e.t, this.t); r < x; )
902
+ c += this[r] - e[r], n[r++] = c & this.DM, c >>= this.DB;
903
+ if (e.t < this.t) {
904
+ for (c -= e.s; r < this.t; )
905
+ c += this[r], n[r++] = c & this.DM, c >>= this.DB;
906
+ c += this.s;
907
+ } else {
908
+ for (c += this.s; r < e.t; )
909
+ c -= e[r], n[r++] = c & this.DM, c >>= this.DB;
910
+ c -= e.s;
911
+ }
912
+ n.s = c < 0 ? -1 : 0, c < -1 ? n[r++] = this.DV + c : c > 0 && (n[r++] = c), n.t = r, n.clamp();
913
+ }
914
+ function it(e, n) {
915
+ var r = this.abs(), c = e.abs(), x = r.t;
916
+ for (n.t = x + c.t; --x >= 0; ) n[x] = 0;
917
+ for (x = 0; x < c.t; ++x) n[x + r.t] = r.am(0, c[x], n, x, 0, r.t);
918
+ n.s = 0, n.clamp(), this.s != e.s && f.ZERO.subTo(n, n);
919
+ }
920
+ function ct(e) {
921
+ for (var n = this.abs(), r = e.t = 2 * n.t; --r >= 0; ) e[r] = 0;
922
+ for (r = 0; r < n.t - 1; ++r) {
923
+ var c = n.am(r, n[r], e, 2 * r, 0, 1);
924
+ (e[r + n.t] += n.am(r + 1, 2 * n[r], e, 2 * r + 1, c, n.t - r - 1)) >= n.DV && (e[r + n.t] -= n.DV, e[r + n.t + 1] = 1);
925
+ }
926
+ e.t > 0 && (e[e.t - 1] += n.am(r, n[r], e, 2 * r, 0, 1)), e.s = 0, e.clamp();
927
+ }
928
+ function ut(e, n, r) {
929
+ var c = e.abs();
930
+ if (!(c.t <= 0)) {
931
+ var x = this.abs();
932
+ if (x.t < c.t) {
933
+ n != null && n.fromInt(0), r != null && this.copyTo(r);
934
+ return;
935
+ }
936
+ r == null && (r = d());
937
+ var y = d(), S = this.s, E = e.s, N = this.DB - D(c[c.t - 1]);
938
+ N > 0 ? (c.lShiftTo(N, y), x.lShiftTo(N, r)) : (c.copyTo(y), x.copyTo(r));
939
+ var k = y.t, Z = y[k - 1];
940
+ if (Z != 0) {
941
+ var U = Z * (1 << this.F1) + (k > 1 ? y[k - 2] >> this.F2 : 0), Q = this.FV / U, lt = (1 << this.F1) / U, J = 1 << this.F2, X = r.t, dt = X - k, tt = n ?? d();
942
+ for (y.dlShiftTo(dt, tt), r.compareTo(tt) >= 0 && (r[r.t++] = 1, r.subTo(tt, r)), f.ONE.dlShiftTo(k, tt), tt.subTo(y, y); y.t < k; ) y[y.t++] = 0;
943
+ for (; --dt >= 0; ) {
944
+ var St = r[--X] == Z ? this.DM : Math.floor(r[X] * Q + (r[X - 1] + J) * lt);
945
+ if ((r[X] += y.am(0, St, r, dt, 0, k)) < St)
946
+ for (y.dlShiftTo(dt, tt), r.subTo(tt, r); r[X] < --St; ) r.subTo(tt, r);
947
+ }
948
+ n != null && (r.drShiftTo(k, n), S != E && f.ZERO.subTo(n, n)), r.t = k, r.clamp(), N > 0 && r.rShiftTo(N, r), S < 0 && f.ZERO.subTo(r, r);
949
+ }
950
+ }
951
+ }
952
+ function at(e) {
953
+ var n = d();
954
+ return this.abs().divRemTo(e, null, n), this.s < 0 && n.compareTo(f.ZERO) > 0 && e.subTo(n, n), n;
955
+ }
956
+ function I(e) {
957
+ this.m = e;
958
+ }
959
+ function me(e) {
960
+ return e.s < 0 || e.compareTo(this.m) >= 0 ? e.mod(this.m) : e;
961
+ }
962
+ function ve(e) {
963
+ return e;
964
+ }
965
+ function ye(e) {
966
+ e.divRemTo(this.m, null, e);
967
+ }
968
+ function be(e, n, r) {
969
+ e.multiplyTo(n, r), this.reduce(r);
970
+ }
971
+ function we(e, n) {
972
+ e.squareTo(n), this.reduce(n);
973
+ }
974
+ I.prototype.convert = me, I.prototype.revert = ve, I.prototype.reduce = ye, I.prototype.mulTo = be, I.prototype.sqrTo = we;
975
+ function Te() {
976
+ if (this.t < 1) return 0;
977
+ var e = this[0];
978
+ if ((e & 1) == 0) return 0;
979
+ var n = e & 3;
980
+ return n = n * (2 - (e & 15) * n) & 15, n = n * (2 - (e & 255) * n) & 255, n = n * (2 - ((e & 65535) * n & 65535)) & 65535, n = n * (2 - e * n % this.DV) % this.DV, n > 0 ? this.DV - n : -n;
981
+ }
982
+ function nt(e) {
983
+ this.m = e, this.mp = e.invDigit(), this.mpl = this.mp & 32767, this.mph = this.mp >> 15, this.um = (1 << e.DB - 15) - 1, this.mt2 = 2 * e.t;
984
+ }
985
+ function Fe(e) {
986
+ var n = d();
987
+ return e.abs().dlShiftTo(this.m.t, n), n.divRemTo(this.m, null, n), e.s < 0 && n.compareTo(f.ZERO) > 0 && this.m.subTo(n, n), n;
988
+ }
989
+ function Se(e) {
990
+ var n = d();
991
+ return e.copyTo(n), this.reduce(n), n;
992
+ }
993
+ function Ee(e) {
994
+ for (; e.t <= this.mt2; )
995
+ e[e.t++] = 0;
996
+ for (var n = 0; n < this.m.t; ++n) {
997
+ var r = e[n] & 32767, c = r * this.mpl + ((r * this.mph + (e[n] >> 15) * this.mpl & this.um) << 15) & e.DM;
998
+ for (r = n + this.m.t, e[r] += this.m.am(0, c, e, n, 0, this.m.t); e[r] >= e.DV; )
999
+ e[r] -= e.DV, e[++r]++;
1000
+ }
1001
+ e.clamp(), e.drShiftTo(this.m.t, e), e.compareTo(this.m) >= 0 && e.subTo(this.m, e);
1002
+ }
1003
+ function Be(e, n) {
1004
+ e.squareTo(n), this.reduce(n);
1005
+ }
1006
+ function _e(e, n, r) {
1007
+ e.multiplyTo(n, r), this.reduce(r);
1008
+ }
1009
+ nt.prototype.convert = Fe, nt.prototype.revert = Se, nt.prototype.reduce = Ee, nt.prototype.mulTo = _e, nt.prototype.sqrTo = Be;
1010
+ function Re() {
1011
+ return (this.t > 0 ? this[0] & 1 : this.s) == 0;
1012
+ }
1013
+ function De(e, n) {
1014
+ if (e > 4294967295 || e < 1) return f.ONE;
1015
+ var r = d(), c = d(), x = n.convert(this), y = D(e) - 1;
1016
+ for (x.copyTo(r); --y >= 0; )
1017
+ if (n.sqrTo(r, c), (e & 1 << y) > 0) n.mulTo(c, x, r);
1018
+ else {
1019
+ var S = r;
1020
+ r = c, c = S;
1021
+ }
1022
+ return n.revert(r);
1023
+ }
1024
+ function Ae(e, n) {
1025
+ var r;
1026
+ return e < 256 || n.isEven() ? r = new I(n) : r = new nt(n), this.exp(e, r);
1027
+ }
1028
+ f.prototype.copyTo = g, f.prototype.fromInt = l, f.prototype.fromString = h, f.prototype.clamp = F, f.prototype.dlShiftTo = z, f.prototype.drShiftTo = L, f.prototype.lShiftTo = $, f.prototype.rShiftTo = K, f.prototype.subTo = G, f.prototype.multiplyTo = it, f.prototype.squareTo = ct, f.prototype.divRemTo = ut, f.prototype.invDigit = Te, f.prototype.isEven = Re, f.prototype.exp = De, f.prototype.toString = A, f.prototype.negate = O, f.prototype.abs = C, f.prototype.compareTo = H, f.prototype.bitLength = P, f.prototype.mod = at, f.prototype.modPowInt = Ae, f.ZERO = T(0), f.ONE = T(1);
1029
+ function Ie() {
1030
+ var e = d();
1031
+ return this.copyTo(e), e;
1032
+ }
1033
+ function Me() {
1034
+ if (this.s < 0) {
1035
+ if (this.t == 1) return this[0] - this.DV;
1036
+ if (this.t == 0) return -1;
1037
+ } else {
1038
+ if (this.t == 1) return this[0];
1039
+ if (this.t == 0) return 0;
1040
+ }
1041
+ return (this[1] & (1 << 32 - this.DB) - 1) << this.DB | this[0];
1042
+ }
1043
+ function Oe() {
1044
+ return this.t == 0 ? this.s : this[0] << 24 >> 24;
1045
+ }
1046
+ function qe() {
1047
+ return this.t == 0 ? this.s : this[0] << 16 >> 16;
1048
+ }
1049
+ function Ce(e) {
1050
+ return Math.floor(Math.LN2 * this.DB / Math.log(e));
1051
+ }
1052
+ function Pe() {
1053
+ return this.s < 0 ? -1 : this.t <= 0 || this.t == 1 && this[0] <= 0 ? 0 : 1;
1054
+ }
1055
+ function ze(e) {
1056
+ if (e == null && (e = 10), this.signum() == 0 || e < 2 || e > 36) return "0";
1057
+ var n = this.chunkSize(e), r = Math.pow(e, n), c = T(r), x = d(), y = d(), S = "";
1058
+ for (this.divRemTo(c, x, y); x.signum() > 0; )
1059
+ S = (r + y.intValue()).toString(e).substr(1) + S, x.divRemTo(c, x, y);
1060
+ return y.intValue().toString(e) + S;
1061
+ }
1062
+ function He(e, n) {
1063
+ this.fromInt(0), n == null && (n = 10);
1064
+ for (var r = this.chunkSize(n), c = Math.pow(n, r), x = !1, y = 0, S = 0, E = 0; E < e.length; ++E) {
1065
+ var N = w(e, E);
1066
+ if (N < 0) {
1067
+ e.charAt(E) == "-" && this.signum() == 0 && (x = !0);
1068
+ continue;
1069
+ }
1070
+ S = n * S + N, ++y >= r && (this.dMultiply(c), this.dAddOffset(S, 0), y = 0, S = 0);
1071
+ }
1072
+ y > 0 && (this.dMultiply(Math.pow(n, y)), this.dAddOffset(S, 0)), x && f.ZERO.subTo(this, this);
1073
+ }
1074
+ function Le(e, n, r) {
1075
+ if (typeof n == "number")
1076
+ if (e < 2) this.fromInt(1);
1077
+ else
1078
+ for (this.fromNumber(e, r), this.testBit(e - 1) || this.bitwiseTo(f.ONE.shiftLeft(e - 1), wt, this), this.isEven() && this.dAddOffset(1, 0); !this.isProbablePrime(n); )
1079
+ this.dAddOffset(2, 0), this.bitLength() > e && this.subTo(f.ONE.shiftLeft(e - 1), this);
1080
+ else {
1081
+ var c = new Array(), x = e & 7;
1082
+ c.length = (e >> 3) + 1, n.nextBytes(c), x > 0 ? c[0] &= (1 << x) - 1 : c[0] = 0, this.fromString(c, 256);
1083
+ }
1084
+ }
1085
+ function Ne() {
1086
+ var e = this.t, n = new Array();
1087
+ n[0] = this.s;
1088
+ var r = this.DB - e * this.DB % 8, c, x = 0;
1089
+ if (e-- > 0)
1090
+ for (r < this.DB && (c = this[e] >> r) != (this.s & this.DM) >> r && (n[x++] = c | this.s << this.DB - r); e >= 0; )
1091
+ r < 8 ? (c = (this[e] & (1 << r) - 1) << 8 - r, c |= this[--e] >> (r += this.DB - 8)) : (c = this[e] >> (r -= 8) & 255, r <= 0 && (r += this.DB, --e)), (c & 128) != 0 && (c |= -256), x == 0 && (this.s & 128) != (c & 128) && ++x, (x > 0 || c != this.s) && (n[x++] = c);
1092
+ return n;
1093
+ }
1094
+ function Ye(e) {
1095
+ return this.compareTo(e) == 0;
1096
+ }
1097
+ function ke(e) {
1098
+ return this.compareTo(e) < 0 ? this : e;
1099
+ }
1100
+ function Ve(e) {
1101
+ return this.compareTo(e) > 0 ? this : e;
1102
+ }
1103
+ function $e(e, n, r) {
1104
+ var c, x, y = Math.min(e.t, this.t);
1105
+ for (c = 0; c < y; ++c) r[c] = n(this[c], e[c]);
1106
+ if (e.t < this.t) {
1107
+ for (x = e.s & this.DM, c = y; c < this.t; ++c) r[c] = n(this[c], x);
1108
+ r.t = this.t;
1109
+ } else {
1110
+ for (x = this.s & this.DM, c = y; c < e.t; ++c) r[c] = n(x, e[c]);
1111
+ r.t = e.t;
1112
+ }
1113
+ r.s = n(this.s, e.s), r.clamp();
1114
+ }
1115
+ function je(e, n) {
1116
+ return e & n;
1117
+ }
1118
+ function Ue(e) {
1119
+ var n = d();
1120
+ return this.bitwiseTo(e, je, n), n;
1121
+ }
1122
+ function wt(e, n) {
1123
+ return e | n;
1124
+ }
1125
+ function Ze(e) {
1126
+ var n = d();
1127
+ return this.bitwiseTo(e, wt, n), n;
1128
+ }
1129
+ function zt(e, n) {
1130
+ return e ^ n;
1131
+ }
1132
+ function Ge(e) {
1133
+ var n = d();
1134
+ return this.bitwiseTo(e, zt, n), n;
1135
+ }
1136
+ function Ht(e, n) {
1137
+ return e & ~n;
1138
+ }
1139
+ function We(e) {
1140
+ var n = d();
1141
+ return this.bitwiseTo(e, Ht, n), n;
1142
+ }
1143
+ function Je() {
1144
+ for (var e = d(), n = 0; n < this.t; ++n) e[n] = this.DM & ~this[n];
1145
+ return e.t = this.t, e.s = ~this.s, e;
1146
+ }
1147
+ function Xe(e) {
1148
+ var n = d();
1149
+ return e < 0 ? this.rShiftTo(-e, n) : this.lShiftTo(e, n), n;
1150
+ }
1151
+ function Ke(e) {
1152
+ var n = d();
1153
+ return e < 0 ? this.lShiftTo(-e, n) : this.rShiftTo(e, n), n;
1154
+ }
1155
+ function Qe(e) {
1156
+ if (e == 0) return -1;
1157
+ var n = 0;
1158
+ return (e & 65535) == 0 && (e >>= 16, n += 16), (e & 255) == 0 && (e >>= 8, n += 8), (e & 15) == 0 && (e >>= 4, n += 4), (e & 3) == 0 && (e >>= 2, n += 2), (e & 1) == 0 && ++n, n;
1159
+ }
1160
+ function tn() {
1161
+ for (var e = 0; e < this.t; ++e)
1162
+ if (this[e] != 0) return e * this.DB + Qe(this[e]);
1163
+ return this.s < 0 ? this.t * this.DB : -1;
1164
+ }
1165
+ function en(e) {
1166
+ for (var n = 0; e != 0; )
1167
+ e &= e - 1, ++n;
1168
+ return n;
1169
+ }
1170
+ function nn() {
1171
+ for (var e = 0, n = this.s & this.DM, r = 0; r < this.t; ++r) e += en(this[r] ^ n);
1172
+ return e;
1173
+ }
1174
+ function rn(e) {
1175
+ var n = Math.floor(e / this.DB);
1176
+ return n >= this.t ? this.s != 0 : (this[n] & 1 << e % this.DB) != 0;
1177
+ }
1178
+ function on(e, n) {
1179
+ var r = f.ONE.shiftLeft(e);
1180
+ return this.bitwiseTo(r, n, r), r;
1181
+ }
1182
+ function sn(e) {
1183
+ return this.changeBit(e, wt);
1184
+ }
1185
+ function fn(e) {
1186
+ return this.changeBit(e, Ht);
1187
+ }
1188
+ function cn(e) {
1189
+ return this.changeBit(e, zt);
1190
+ }
1191
+ function un(e, n) {
1192
+ for (var r = 0, c = 0, x = Math.min(e.t, this.t); r < x; )
1193
+ c += this[r] + e[r], n[r++] = c & this.DM, c >>= this.DB;
1194
+ if (e.t < this.t) {
1195
+ for (c += e.s; r < this.t; )
1196
+ c += this[r], n[r++] = c & this.DM, c >>= this.DB;
1197
+ c += this.s;
1198
+ } else {
1199
+ for (c += this.s; r < e.t; )
1200
+ c += e[r], n[r++] = c & this.DM, c >>= this.DB;
1201
+ c += e.s;
1202
+ }
1203
+ n.s = c < 0 ? -1 : 0, c > 0 ? n[r++] = c : c < -1 && (n[r++] = this.DV + c), n.t = r, n.clamp();
1204
+ }
1205
+ function an(e) {
1206
+ var n = d();
1207
+ return this.addTo(e, n), n;
1208
+ }
1209
+ function hn(e) {
1210
+ var n = d();
1211
+ return this.subTo(e, n), n;
1212
+ }
1213
+ function ln(e) {
1214
+ var n = d();
1215
+ return this.multiplyTo(e, n), n;
1216
+ }
1217
+ function dn() {
1218
+ var e = d();
1219
+ return this.squareTo(e), e;
1220
+ }
1221
+ function pn(e) {
1222
+ var n = d();
1223
+ return this.divRemTo(e, n, null), n;
1224
+ }
1225
+ function gn(e) {
1226
+ var n = d();
1227
+ return this.divRemTo(e, null, n), n;
1228
+ }
1229
+ function xn(e) {
1230
+ var n = d(), r = d();
1231
+ return this.divRemTo(e, n, r), new Array(n, r);
1232
+ }
1233
+ function mn(e) {
1234
+ this[this.t] = this.am(0, e - 1, this, 0, 0, this.t), ++this.t, this.clamp();
1235
+ }
1236
+ function vn(e, n) {
1237
+ if (e != 0) {
1238
+ for (; this.t <= n; ) this[this.t++] = 0;
1239
+ for (this[n] += e; this[n] >= this.DV; )
1240
+ this[n] -= this.DV, ++n >= this.t && (this[this.t++] = 0), ++this[n];
1241
+ }
1242
+ }
1243
+ function st() {
1244
+ }
1245
+ function Lt(e) {
1246
+ return e;
1247
+ }
1248
+ function yn(e, n, r) {
1249
+ e.multiplyTo(n, r);
1250
+ }
1251
+ function bn(e, n) {
1252
+ e.squareTo(n);
1253
+ }
1254
+ st.prototype.convert = Lt, st.prototype.revert = Lt, st.prototype.mulTo = yn, st.prototype.sqrTo = bn;
1255
+ function wn(e) {
1256
+ return this.exp(e, new st());
1257
+ }
1258
+ function Tn(e, n, r) {
1259
+ var c = Math.min(this.t + e.t, n);
1260
+ for (r.s = 0, r.t = c; c > 0; ) r[--c] = 0;
1261
+ var x;
1262
+ for (x = r.t - this.t; c < x; ++c) r[c + this.t] = this.am(0, e[c], r, c, 0, this.t);
1263
+ for (x = Math.min(e.t, n); c < x; ++c) this.am(0, e[c], r, c, 0, n - c);
1264
+ r.clamp();
1265
+ }
1266
+ function Fn(e, n, r) {
1267
+ --n;
1268
+ var c = r.t = this.t + e.t - n;
1269
+ for (r.s = 0; --c >= 0; ) r[c] = 0;
1270
+ for (c = Math.max(n - this.t, 0); c < e.t; ++c)
1271
+ r[this.t + c - n] = this.am(n - c, e[c], r, 0, 0, this.t + c - n);
1272
+ r.clamp(), r.drShiftTo(1, r);
1273
+ }
1274
+ function rt(e) {
1275
+ this.r2 = d(), this.q3 = d(), f.ONE.dlShiftTo(2 * e.t, this.r2), this.mu = this.r2.divide(e), this.m = e;
1276
+ }
1277
+ function Sn(e) {
1278
+ if (e.s < 0 || e.t > 2 * this.m.t) return e.mod(this.m);
1279
+ if (e.compareTo(this.m) < 0) return e;
1280
+ var n = d();
1281
+ return e.copyTo(n), this.reduce(n), n;
1282
+ }
1283
+ function En(e) {
1284
+ return e;
1285
+ }
1286
+ function Bn(e) {
1287
+ for (e.drShiftTo(this.m.t - 1, this.r2), e.t > this.m.t + 1 && (e.t = this.m.t + 1, e.clamp()), this.mu.multiplyUpperTo(this.r2, this.m.t + 1, this.q3), this.m.multiplyLowerTo(this.q3, this.m.t + 1, this.r2); e.compareTo(this.r2) < 0; ) e.dAddOffset(1, this.m.t + 1);
1288
+ for (e.subTo(this.r2, e); e.compareTo(this.m) >= 0; ) e.subTo(this.m, e);
1289
+ }
1290
+ function _n(e, n) {
1291
+ e.squareTo(n), this.reduce(n);
1292
+ }
1293
+ function Rn(e, n, r) {
1294
+ e.multiplyTo(n, r), this.reduce(r);
1295
+ }
1296
+ rt.prototype.convert = Sn, rt.prototype.revert = En, rt.prototype.reduce = Bn, rt.prototype.mulTo = Rn, rt.prototype.sqrTo = _n;
1297
+ function Dn(e, n) {
1298
+ var r = e.bitLength(), c, x = T(1), y;
1299
+ if (r <= 0) return x;
1300
+ r < 18 ? c = 1 : r < 48 ? c = 3 : r < 144 ? c = 4 : r < 768 ? c = 5 : c = 6, r < 8 ? y = new I(n) : n.isEven() ? y = new rt(n) : y = new nt(n);
1301
+ var S = new Array(), E = 3, N = c - 1, k = (1 << c) - 1;
1302
+ if (S[1] = y.convert(this), c > 1) {
1303
+ var Z = d();
1304
+ for (y.sqrTo(S[1], Z); E <= k; )
1305
+ S[E] = d(), y.mulTo(Z, S[E - 2], S[E]), E += 2;
1306
+ }
1307
+ var U = e.t - 1, Q, lt = !0, J = d(), X;
1308
+ for (r = D(e[U]) - 1; U >= 0; ) {
1309
+ for (r >= N ? Q = e[U] >> r - N & k : (Q = (e[U] & (1 << r + 1) - 1) << N - r, U > 0 && (Q |= e[U - 1] >> this.DB + r - N)), E = c; (Q & 1) == 0; )
1310
+ Q >>= 1, --E;
1311
+ if ((r -= E) < 0 && (r += this.DB, --U), lt)
1312
+ S[Q].copyTo(x), lt = !1;
1313
+ else {
1314
+ for (; E > 1; )
1315
+ y.sqrTo(x, J), y.sqrTo(J, x), E -= 2;
1316
+ E > 0 ? y.sqrTo(x, J) : (X = x, x = J, J = X), y.mulTo(J, S[Q], x);
1317
+ }
1318
+ for (; U >= 0 && (e[U] & 1 << r) == 0; )
1319
+ y.sqrTo(x, J), X = x, x = J, J = X, --r < 0 && (r = this.DB - 1, --U);
1320
+ }
1321
+ return y.revert(x);
1322
+ }
1323
+ function An(e) {
1324
+ var n = this.s < 0 ? this.negate() : this.clone(), r = e.s < 0 ? e.negate() : e.clone();
1325
+ if (n.compareTo(r) < 0) {
1326
+ var c = n;
1327
+ n = r, r = c;
1328
+ }
1329
+ var x = n.getLowestSetBit(), y = r.getLowestSetBit();
1330
+ if (y < 0) return n;
1331
+ for (x < y && (y = x), y > 0 && (n.rShiftTo(y, n), r.rShiftTo(y, r)); n.signum() > 0; )
1332
+ (x = n.getLowestSetBit()) > 0 && n.rShiftTo(x, n), (x = r.getLowestSetBit()) > 0 && r.rShiftTo(x, r), n.compareTo(r) >= 0 ? (n.subTo(r, n), n.rShiftTo(1, n)) : (r.subTo(n, r), r.rShiftTo(1, r));
1333
+ return y > 0 && r.lShiftTo(y, r), r;
1334
+ }
1335
+ function In(e) {
1336
+ if (e <= 0) return 0;
1337
+ var n = this.DV % e, r = this.s < 0 ? e - 1 : 0;
1338
+ if (this.t > 0)
1339
+ if (n == 0) r = this[0] % e;
1340
+ else for (var c = this.t - 1; c >= 0; --c) r = (n * r + this[c]) % e;
1341
+ return r;
1342
+ }
1343
+ function Mn(e) {
1344
+ var n = e.isEven();
1345
+ if (this.isEven() && n || e.signum() == 0) return f.ZERO;
1346
+ for (var r = e.clone(), c = this.clone(), x = T(1), y = T(0), S = T(0), E = T(1); r.signum() != 0; ) {
1347
+ for (; r.isEven(); )
1348
+ r.rShiftTo(1, r), n ? ((!x.isEven() || !y.isEven()) && (x.addTo(this, x), y.subTo(e, y)), x.rShiftTo(1, x)) : y.isEven() || y.subTo(e, y), y.rShiftTo(1, y);
1349
+ for (; c.isEven(); )
1350
+ c.rShiftTo(1, c), n ? ((!S.isEven() || !E.isEven()) && (S.addTo(this, S), E.subTo(e, E)), S.rShiftTo(1, S)) : E.isEven() || E.subTo(e, E), E.rShiftTo(1, E);
1351
+ r.compareTo(c) >= 0 ? (r.subTo(c, r), n && x.subTo(S, x), y.subTo(E, y)) : (c.subTo(r, c), n && S.subTo(x, S), E.subTo(y, E));
1352
+ }
1353
+ if (c.compareTo(f.ONE) != 0) return f.ZERO;
1354
+ if (E.compareTo(e) >= 0) return E.subtract(e);
1355
+ if (E.signum() < 0) E.addTo(e, E);
1356
+ else return E;
1357
+ return E.signum() < 0 ? E.add(e) : E;
1358
+ }
1359
+ var V = [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], On = (1 << 26) / V[V.length - 1];
1360
+ function qn(e) {
1361
+ var n, r = this.abs();
1362
+ if (r.t == 1 && r[0] <= V[V.length - 1]) {
1363
+ for (n = 0; n < V.length; ++n)
1364
+ if (r[0] == V[n]) return !0;
1365
+ return !1;
1366
+ }
1367
+ if (r.isEven()) return !1;
1368
+ for (n = 1; n < V.length; ) {
1369
+ for (var c = V[n], x = n + 1; x < V.length && c < On; ) c *= V[x++];
1370
+ for (c = r.modInt(c); n < x; ) if (c % V[n++] == 0) return !1;
1371
+ }
1372
+ return r.millerRabin(e);
1373
+ }
1374
+ function Cn(e) {
1375
+ var n = this.subtract(f.ONE), r = n.getLowestSetBit();
1376
+ if (r <= 0) return !1;
1377
+ var c = n.shiftRight(r);
1378
+ e = e + 1 >> 1, e > V.length && (e = V.length);
1379
+ for (var x = d(), y = 0; y < e; ++y) {
1380
+ x.fromInt(V[Math.floor(Math.random() * V.length)]);
1381
+ var S = x.modPow(c, this);
1382
+ if (S.compareTo(f.ONE) != 0 && S.compareTo(n) != 0) {
1383
+ for (var E = 1; E++ < r && S.compareTo(n) != 0; )
1384
+ if (S = S.modPowInt(2, this), S.compareTo(f.ONE) == 0) return !1;
1385
+ if (S.compareTo(n) != 0) return !1;
1386
+ }
1387
+ }
1388
+ return !0;
1389
+ }
1390
+ f.prototype.chunkSize = Ce, f.prototype.toRadix = ze, f.prototype.fromRadix = He, f.prototype.fromNumber = Le, f.prototype.bitwiseTo = $e, f.prototype.changeBit = on, f.prototype.addTo = un, f.prototype.dMultiply = mn, f.prototype.dAddOffset = vn, f.prototype.multiplyLowerTo = Tn, f.prototype.multiplyUpperTo = Fn, f.prototype.modInt = In, f.prototype.millerRabin = Cn, f.prototype.clone = Ie, f.prototype.intValue = Me, f.prototype.byteValue = Oe, f.prototype.shortValue = qe, f.prototype.signum = Pe, f.prototype.toByteArray = Ne, f.prototype.equals = Ye, f.prototype.min = ke, f.prototype.max = Ve, f.prototype.and = Ue, f.prototype.or = Ze, f.prototype.xor = Ge, f.prototype.andNot = We, f.prototype.not = Je, f.prototype.shiftLeft = Xe, f.prototype.shiftRight = Ke, f.prototype.getLowestSetBit = tn, f.prototype.bitCount = nn, f.prototype.testBit = rn, f.prototype.setBit = sn, f.prototype.clearBit = fn, f.prototype.flipBit = cn, f.prototype.add = an, f.prototype.subtract = hn, f.prototype.multiply = ln, f.prototype.divide = pn, f.prototype.remainder = gn, f.prototype.divideAndRemainder = xn, f.prototype.modPow = Dn, f.prototype.modInverse = Mn, f.prototype.pow = wn, f.prototype.gcd = An, f.prototype.isProbablePrime = qn, f.prototype.square = dn, f.prototype.Barrett = rt;
1391
+ var ht, j, Y;
1392
+ function Pn(e) {
1393
+ j[Y++] ^= e & 255, j[Y++] ^= e >> 8 & 255, j[Y++] ^= e >> 16 & 255, j[Y++] ^= e >> 24 & 255, Y >= Ft && (Y -= Ft);
1394
+ }
1395
+ function Nt() {
1396
+ Pn((/* @__PURE__ */ new Date()).getTime());
1397
+ }
1398
+ if (j == null) {
1399
+ j = new Array(), Y = 0;
1400
+ var W;
1401
+ if (typeof window < "u" && window.crypto) {
1402
+ if (window.crypto.getRandomValues) {
1403
+ var Yt = new Uint8Array(32);
1404
+ for (window.crypto.getRandomValues(Yt), W = 0; W < 32; ++W)
1405
+ j[Y++] = Yt[W];
1406
+ } else if (navigator.appName == "Netscape" && navigator.appVersion < "5") {
1407
+ var kt = window.crypto.random(32);
1408
+ for (W = 0; W < kt.length; ++W)
1409
+ j[Y++] = kt.charCodeAt(W) & 255;
1410
+ }
1411
+ }
1412
+ for (; Y < Ft; )
1413
+ W = Math.floor(65536 * Math.random()), j[Y++] = W >>> 8, j[Y++] = W & 255;
1414
+ Y = 0, Nt();
1415
+ }
1416
+ function zn() {
1417
+ if (ht == null) {
1418
+ for (Nt(), ht = Yn(), ht.init(j), Y = 0; Y < j.length; ++Y)
1419
+ j[Y] = 0;
1420
+ Y = 0;
1421
+ }
1422
+ return ht.next();
1423
+ }
1424
+ function Hn(e) {
1425
+ var n;
1426
+ for (n = 0; n < e.length; ++n) e[n] = zn();
1427
+ }
1428
+ function Vt() {
1429
+ }
1430
+ Vt.prototype.nextBytes = Hn;
1431
+ function Tt() {
1432
+ this.i = 0, this.j = 0, this.S = new Array();
1433
+ }
1434
+ function Ln(e) {
1435
+ var n, r, c;
1436
+ for (n = 0; n < 256; ++n)
1437
+ this.S[n] = n;
1438
+ for (r = 0, n = 0; n < 256; ++n)
1439
+ r = r + this.S[n] + e[n % e.length] & 255, c = this.S[n], this.S[n] = this.S[r], this.S[r] = c;
1440
+ this.i = 0, this.j = 0;
1441
+ }
1442
+ function Nn() {
1443
+ var e;
1444
+ return this.i = this.i + 1 & 255, this.j = this.j + this.S[this.i] & 255, e = this.S[this.i], this.S[this.i] = this.S[this.j], this.S[this.j] = e, this.S[e + this.S[this.i] & 255];
1445
+ }
1446
+ Tt.prototype.init = Ln, Tt.prototype.next = Nn;
1447
+ function Yn() {
1448
+ return new Tt();
1449
+ }
1450
+ var Ft = 256;
1451
+ t.exports = {
1452
+ default: f,
1453
+ BigInteger: f,
1454
+ SecureRandom: Vt
1455
+ };
1456
+ }).call(ti);
1457
+ }(gt)), gt.exports;
1458
+ }
1459
+ var Et, Zt;
1460
+ function ei() {
1461
+ if (Zt) return Et;
1462
+ Zt = 1;
1463
+ const { BigInteger: t } = bt();
1464
+ function i(b) {
1465
+ let m = b.toString(16);
1466
+ if (m[0] !== "-")
1467
+ m.length % 2 === 1 ? m = "0" + m : m.match(/^[0-7]/) || (m = "00" + m);
1468
+ else {
1469
+ m = m.substr(1);
1470
+ let v = m.length;
1471
+ v % 2 === 1 ? v += 1 : m.match(/^[0-7]/) || (v += 2);
1472
+ let B = "";
1473
+ for (let _ = 0; _ < v; _++) B += "f";
1474
+ B = new t(B, 16), m = B.xor(b).add(t.ONE), m = m.toString(16).replace(/^-/, "");
1475
+ }
1476
+ return m;
1477
+ }
1478
+ class o {
1479
+ constructor() {
1480
+ this.tlv = null, this.t = "00", this.l = "00", this.v = "";
1481
+ }
1482
+ /**
1483
+ * 获取 der 编码比特流16进制串
1484
+ */
1485
+ getEncodedHex() {
1486
+ return this.tlv || (this.v = this.getValue(), this.l = this.getLength(), this.tlv = this.t + this.l + this.v), this.tlv;
1487
+ }
1488
+ getLength() {
1489
+ const m = this.v.length / 2;
1490
+ let v = m.toString(16);
1491
+ return v.length % 2 === 1 && (v = "0" + v), m < 128 ? v : (128 + v.length / 2).toString(16) + v;
1492
+ }
1493
+ getValue() {
1494
+ return "";
1495
+ }
1496
+ }
1497
+ class s extends o {
1498
+ constructor(m) {
1499
+ super(), this.t = "02", m && (this.v = i(m));
1500
+ }
1501
+ getValue() {
1502
+ return this.v;
1503
+ }
1504
+ }
1505
+ class u extends o {
1506
+ constructor(m) {
1507
+ super(), this.t = "30", this.asn1Array = m;
1508
+ }
1509
+ getValue() {
1510
+ return this.v = this.asn1Array.map((m) => m.getEncodedHex()).join(""), this.v;
1511
+ }
1512
+ }
1513
+ function f(b, m) {
1514
+ return +b[m + 2] < 8 ? 1 : +b.substr(m + 2, 2) & 128;
1515
+ }
1516
+ function d(b, m) {
1517
+ const v = f(b, m), B = b.substr(m + 2, v * 2);
1518
+ return B ? (+B[0] < 8 ? new t(B, 16) : new t(B.substr(2), 16)).intValue() : -1;
1519
+ }
1520
+ function a(b, m) {
1521
+ const v = f(b, m);
1522
+ return m + (v + 1) * 2;
1523
+ }
1524
+ return Et = {
1525
+ /**
1526
+ * ASN.1 der 编码,针对 sm2 签名
1527
+ */
1528
+ encodeDer(b, m) {
1529
+ const v = new s(b), B = new s(m);
1530
+ return new u([v, B]).getEncodedHex();
1531
+ },
1532
+ /**
1533
+ * 解析 ASN.1 der,针对 sm2 验签
1534
+ */
1535
+ decodeDer(b) {
1536
+ const m = a(b, 0), v = a(b, m), B = d(b, m), _ = b.substr(v, B * 2), M = v + _.length, R = a(b, M), q = d(b, M), p = b.substr(R, q * 2), w = new t(_, 16), g = new t(p, 16);
1537
+ return { r: w, s: g };
1538
+ }
1539
+ }, Et;
1540
+ }
1541
+ var Bt, Gt;
1542
+ function ni() {
1543
+ if (Gt) return Bt;
1544
+ Gt = 1;
1545
+ const { BigInteger: t } = bt(), i = new t("2"), o = new t("3");
1546
+ class s {
1547
+ constructor(a, b) {
1548
+ this.x = b, this.q = a;
1549
+ }
1550
+ /**
1551
+ * 判断相等
1552
+ */
1553
+ equals(a) {
1554
+ return a === this ? !0 : this.q.equals(a.q) && this.x.equals(a.x);
1555
+ }
1556
+ /**
1557
+ * 返回具体数值
1558
+ */
1559
+ toBigInteger() {
1560
+ return this.x;
1561
+ }
1562
+ /**
1563
+ * 取反
1564
+ */
1565
+ negate() {
1566
+ return new s(this.q, this.x.negate().mod(this.q));
1567
+ }
1568
+ /**
1569
+ * 相加
1570
+ */
1571
+ add(a) {
1572
+ return new s(this.q, this.x.add(a.toBigInteger()).mod(this.q));
1573
+ }
1574
+ /**
1575
+ * 相减
1576
+ */
1577
+ subtract(a) {
1578
+ return new s(this.q, this.x.subtract(a.toBigInteger()).mod(this.q));
1579
+ }
1580
+ /**
1581
+ * 相乘
1582
+ */
1583
+ multiply(a) {
1584
+ return new s(this.q, this.x.multiply(a.toBigInteger()).mod(this.q));
1585
+ }
1586
+ /**
1587
+ * 相除
1588
+ */
1589
+ divide(a) {
1590
+ return new s(this.q, this.x.multiply(a.toBigInteger().modInverse(this.q)).mod(this.q));
1591
+ }
1592
+ /**
1593
+ * 平方
1594
+ */
1595
+ square() {
1596
+ return new s(this.q, this.x.square().mod(this.q));
1597
+ }
1598
+ }
1599
+ class u {
1600
+ constructor(a, b, m, v) {
1601
+ this.curve = a, this.x = b, this.y = m, this.z = v ?? t.ONE, this.zinv = null;
1602
+ }
1603
+ getX() {
1604
+ return this.zinv === null && (this.zinv = this.z.modInverse(this.curve.q)), this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q));
1605
+ }
1606
+ getY() {
1607
+ return this.zinv === null && (this.zinv = this.z.modInverse(this.curve.q)), this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q));
1608
+ }
1609
+ /**
1610
+ * 判断相等
1611
+ */
1612
+ equals(a) {
1613
+ return a === this ? !0 : this.isInfinity() ? a.isInfinity() : a.isInfinity() ? this.isInfinity() : a.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(a.z)).mod(this.curve.q).equals(t.ZERO) ? a.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(a.z)).mod(this.curve.q).equals(t.ZERO) : !1;
1614
+ }
1615
+ /**
1616
+ * 是否是无穷远点
1617
+ */
1618
+ isInfinity() {
1619
+ return this.x === null && this.y === null ? !0 : this.z.equals(t.ZERO) && !this.y.toBigInteger().equals(t.ZERO);
1620
+ }
1621
+ /**
1622
+ * 取反,x 轴对称点
1623
+ */
1624
+ negate() {
1625
+ return new u(this.curve, this.x, this.y.negate(), this.z);
1626
+ }
1627
+ /**
1628
+ * 相加
1629
+ *
1630
+ * 标准射影坐标系:
1631
+ *
1632
+ * λ1 = x1 * z2
1633
+ * λ2 = x2 * z1
1634
+ * λ3 = λ1 − λ2
1635
+ * λ4 = y1 * z2
1636
+ * λ5 = y2 * z1
1637
+ * λ6 = λ4 − λ5
1638
+ * λ7 = λ1 + λ2
1639
+ * λ8 = z1 * z2
1640
+ * λ9 = λ3^2
1641
+ * λ10 = λ3 * λ9
1642
+ * λ11 = λ8 * λ6^2 − λ7 * λ9
1643
+ * x3 = λ3 * λ11
1644
+ * y3 = λ6 * (λ9 * λ1 − λ11) − λ4 * λ10
1645
+ * z3 = λ10 * λ8
1646
+ */
1647
+ add(a) {
1648
+ if (this.isInfinity()) return a;
1649
+ if (a.isInfinity()) return this;
1650
+ const b = this.x.toBigInteger(), m = this.y.toBigInteger(), v = this.z, B = a.x.toBigInteger(), _ = a.y.toBigInteger(), M = a.z, R = this.curve.q, q = b.multiply(M).mod(R), p = B.multiply(v).mod(R), w = q.subtract(p), g = m.multiply(M).mod(R), l = _.multiply(v).mod(R), T = g.subtract(l);
1651
+ if (t.ZERO.equals(w))
1652
+ return t.ZERO.equals(T) ? this.twice() : this.curve.infinity;
1653
+ const h = q.add(p), F = v.multiply(M).mod(R), A = w.square().mod(R), O = w.multiply(A).mod(R), C = F.multiply(T.square()).subtract(h.multiply(A)).mod(R), H = w.multiply(C).mod(R), D = T.multiply(A.multiply(q).subtract(C)).subtract(g.multiply(O)).mod(R), P = O.multiply(F).mod(R);
1654
+ return new u(this.curve, this.curve.fromBigInteger(H), this.curve.fromBigInteger(D), P);
1655
+ }
1656
+ /**
1657
+ * 自加
1658
+ *
1659
+ * 标准射影坐标系:
1660
+ *
1661
+ * λ1 = 3 * x1^2 + a * z1^2
1662
+ * λ2 = 2 * y1 * z1
1663
+ * λ3 = y1^2
1664
+ * λ4 = λ3 * x1 * z1
1665
+ * λ5 = λ2^2
1666
+ * λ6 = λ1^2 − 8 * λ4
1667
+ * x3 = λ2 * λ6
1668
+ * y3 = λ1 * (4 * λ4 − λ6) − 2 * λ5 * λ3
1669
+ * z3 = λ2 * λ5
1670
+ */
1671
+ twice() {
1672
+ if (this.isInfinity()) return this;
1673
+ if (!this.y.toBigInteger().signum()) return this.curve.infinity;
1674
+ const a = this.x.toBigInteger(), b = this.y.toBigInteger(), m = this.z, v = this.curve.q, B = this.curve.a.toBigInteger(), _ = a.square().multiply(o).add(B.multiply(m.square())).mod(v), M = b.shiftLeft(1).multiply(m).mod(v), R = b.square().mod(v), q = R.multiply(a).multiply(m).mod(v), p = M.square().mod(v), w = _.square().subtract(q.shiftLeft(3)).mod(v), g = M.multiply(w).mod(v), l = _.multiply(q.shiftLeft(2).subtract(w)).subtract(p.shiftLeft(1).multiply(R)).mod(v), T = M.multiply(p).mod(v);
1675
+ return new u(this.curve, this.curve.fromBigInteger(g), this.curve.fromBigInteger(l), T);
1676
+ }
1677
+ /**
1678
+ * 倍点计算
1679
+ */
1680
+ multiply(a) {
1681
+ if (this.isInfinity()) return this;
1682
+ if (!a.signum()) return this.curve.infinity;
1683
+ const b = a.multiply(o), m = this.negate();
1684
+ let v = this;
1685
+ for (let B = b.bitLength() - 2; B > 0; B--) {
1686
+ v = v.twice();
1687
+ const _ = b.testBit(B), M = a.testBit(B);
1688
+ _ !== M && (v = v.add(_ ? this : m));
1689
+ }
1690
+ return v;
1691
+ }
1692
+ }
1693
+ class f {
1694
+ constructor(a, b, m) {
1695
+ this.q = a, this.a = this.fromBigInteger(b), this.b = this.fromBigInteger(m), this.infinity = new u(this, null, null);
1696
+ }
1697
+ /**
1698
+ * 判断两个椭圆曲线是否相等
1699
+ */
1700
+ equals(a) {
1701
+ return a === this ? !0 : this.q.equals(a.q) && this.a.equals(a.a) && this.b.equals(a.b);
1702
+ }
1703
+ /**
1704
+ * 生成椭圆曲线域元素
1705
+ */
1706
+ fromBigInteger(a) {
1707
+ return new s(this.q, a);
1708
+ }
1709
+ /**
1710
+ * 解析 16 进制串为椭圆曲线点
1711
+ */
1712
+ decodePointHex(a) {
1713
+ switch (parseInt(a.substr(0, 2), 16)) {
1714
+ // 第一个字节
1715
+ case 0:
1716
+ return this.infinity;
1717
+ case 2:
1718
+ case 3:
1719
+ const b = this.fromBigInteger(new t(a.substr(2), 16));
1720
+ let m = this.fromBigInteger(b.multiply(b.square()).add(
1721
+ b.multiply(this.a)
1722
+ ).add(this.b).toBigInteger().modPow(
1723
+ this.q.divide(new t("4")).add(t.ONE),
1724
+ this.q
1725
+ ));
1726
+ return m.toBigInteger().mod(i).equals(new t(a.substr(0, 2), 16).subtract(i)) || (m = m.negate()), new u(this, b, m);
1727
+ case 4:
1728
+ case 6:
1729
+ case 7:
1730
+ const v = (a.length - 2) / 2, B = a.substr(2, v), _ = a.substr(v + 2, v);
1731
+ return new u(this, this.fromBigInteger(new t(B, 16)), this.fromBigInteger(new t(_, 16)));
1732
+ default:
1733
+ return null;
1734
+ }
1735
+ }
1736
+ }
1737
+ return Bt = {
1738
+ ECPointFp: u,
1739
+ ECCurveFp: f
1740
+ }, Bt;
1741
+ }
1742
+ var _t, Wt;
1743
+ function ri() {
1744
+ if (Wt) return _t;
1745
+ Wt = 1;
1746
+ const { BigInteger: t, SecureRandom: i } = bt(), { ECCurveFp: o } = ni(), s = new i(), { curve: u, G: f, n: d } = b();
1747
+ function a() {
1748
+ return u;
1749
+ }
1750
+ function b() {
1751
+ const g = new t("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF", 16), l = new t("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC", 16), T = new t("28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93", 16), h = new o(g, l, T), O = h.decodePointHex("04" + "32C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7" + "BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0"), C = new t("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123", 16);
1752
+ return { curve: h, G: O, n: C };
1753
+ }
1754
+ function m(g, l, T) {
1755
+ const F = (g ? new t(g, l, T) : new t(d.bitLength(), s)).mod(d.subtract(t.ONE)).add(t.ONE), A = _(F.toString(16), 64), O = f.multiply(F), C = _(O.getX().toBigInteger().toString(16), 64), H = _(O.getY().toBigInteger().toString(16), 64), D = "04" + C + H;
1756
+ return { privateKey: A, publicKey: D };
1757
+ }
1758
+ function v(g) {
1759
+ if (g.length !== 130) throw new Error("Invalid public key to compress");
1760
+ const l = (g.length - 2) / 2, T = g.substr(2, l), h = new t(g.substr(l + 2, l), 16);
1761
+ let F = "03";
1762
+ return h.mod(new t("2")).equals(t.ZERO) && (F = "02"), F + T;
1763
+ }
1764
+ function B(g) {
1765
+ g = unescape(encodeURIComponent(g));
1766
+ const l = g.length, T = [];
1767
+ for (let F = 0; F < l; F++)
1768
+ T[F >>> 2] |= (g.charCodeAt(F) & 255) << 24 - F % 4 * 8;
1769
+ const h = [];
1770
+ for (let F = 0; F < l; F++) {
1771
+ const A = T[F >>> 2] >>> 24 - F % 4 * 8 & 255;
1772
+ h.push((A >>> 4).toString(16)), h.push((A & 15).toString(16));
1773
+ }
1774
+ return h.join("");
1775
+ }
1776
+ function _(g, l) {
1777
+ return g.length >= l ? g : new Array(l - g.length + 1).join("0") + g;
1778
+ }
1779
+ function M(g) {
1780
+ return g.map((l) => (l = l.toString(16), l.length === 1 ? "0" + l : l)).join("");
1781
+ }
1782
+ function R(g) {
1783
+ const l = [];
1784
+ let T = 0;
1785
+ for (let h = 0; h < g.length * 2; h += 2)
1786
+ l[h >>> 3] |= parseInt(g[T], 10) << 24 - h % 8 * 4, T++;
1787
+ try {
1788
+ const h = [];
1789
+ for (let F = 0; F < g.length; F++) {
1790
+ const A = l[F >>> 2] >>> 24 - F % 4 * 8 & 255;
1791
+ h.push(String.fromCharCode(A));
1792
+ }
1793
+ return decodeURIComponent(escape(h.join("")));
1794
+ } catch {
1795
+ throw new Error("Malformed UTF-8 data");
1796
+ }
1797
+ }
1798
+ function q(g) {
1799
+ const l = [];
1800
+ let T = g.length;
1801
+ T % 2 !== 0 && (g = _(g, T + 1)), T = g.length;
1802
+ for (let h = 0; h < T; h += 2)
1803
+ l.push(parseInt(g.substr(h, 2), 16));
1804
+ return l;
1805
+ }
1806
+ function p(g) {
1807
+ const l = u.decodePointHex(g);
1808
+ if (!l) return !1;
1809
+ const T = l.getX();
1810
+ return l.getY().square().equals(T.multiply(T.square()).add(T.multiply(u.a)).add(u.b));
1811
+ }
1812
+ function w(g, l) {
1813
+ const T = u.decodePointHex(g);
1814
+ if (!T) return !1;
1815
+ const h = u.decodePointHex(l);
1816
+ return h ? T.equals(h) : !1;
1817
+ }
1818
+ return _t = {
1819
+ getGlobalCurve: a,
1820
+ generateEcparam: b,
1821
+ generateKeyPairHex: m,
1822
+ compressPublicKeyHex: v,
1823
+ utf8ToHex: B,
1824
+ leftPad: _,
1825
+ arrayToHex: M,
1826
+ arrayToUtf8: R,
1827
+ hexToArray: q,
1828
+ verifyPublicKey: p,
1829
+ comparePublicKeyHex: w
1830
+ }, _t;
1831
+ }
1832
+ var Rt, Jt;
1833
+ function de() {
1834
+ if (Jt) return Rt;
1835
+ Jt = 1;
1836
+ const t = new Uint32Array(68), i = new Uint32Array(64);
1837
+ function o(B, _) {
1838
+ const M = _ & 31;
1839
+ return B << M | B >>> 32 - M;
1840
+ }
1841
+ function s(B, _) {
1842
+ const M = [];
1843
+ for (let R = B.length - 1; R >= 0; R--) M[R] = (B[R] ^ _[R]) & 255;
1844
+ return M;
1845
+ }
1846
+ function u(B) {
1847
+ return B ^ o(B, 9) ^ o(B, 17);
1848
+ }
1849
+ function f(B) {
1850
+ return B ^ o(B, 15) ^ o(B, 23);
1851
+ }
1852
+ function d(B) {
1853
+ let _ = B.length * 8, M = _ % 512;
1854
+ M = M >= 448 ? 512 - M % 448 - 1 : 448 - M - 1;
1855
+ const R = new Array((M - 7) / 8), q = new Array(8);
1856
+ for (let h = 0, F = R.length; h < F; h++) R[h] = 0;
1857
+ for (let h = 0, F = q.length; h < F; h++) q[h] = 0;
1858
+ _ = _.toString(2);
1859
+ for (let h = 7; h >= 0; h--)
1860
+ if (_.length > 8) {
1861
+ const F = _.length - 8;
1862
+ q[h] = parseInt(_.substr(F), 2), _ = _.substr(0, F);
1863
+ } else _.length > 0 && (q[h] = parseInt(_, 2), _ = "");
1864
+ const p = new Uint8Array([...B, 128, ...R, ...q]), w = new DataView(p.buffer, 0), g = p.length / 64, l = new Uint32Array([1937774191, 1226093241, 388252375, 3666478592, 2842636476, 372324522, 3817729613, 2969243214]);
1865
+ for (let h = 0; h < g; h++) {
1866
+ t.fill(0), i.fill(0);
1867
+ const F = 16 * h;
1868
+ for (let I = 0; I < 16; I++)
1869
+ t[I] = w.getUint32((F + I) * 4, !1);
1870
+ for (let I = 16; I < 68; I++)
1871
+ t[I] = f(t[I - 16] ^ t[I - 9] ^ o(t[I - 3], 15)) ^ o(t[I - 13], 7) ^ t[I - 6];
1872
+ for (let I = 0; I < 64; I++)
1873
+ i[I] = t[I] ^ t[I + 4];
1874
+ const A = 2043430169, O = 2055708042;
1875
+ let C = l[0], H = l[1], D = l[2], P = l[3], z = l[4], L = l[5], $ = l[6], K = l[7], G, it, ct, ut, at;
1876
+ for (let I = 0; I < 64; I++)
1877
+ at = I >= 0 && I <= 15 ? A : O, G = o(o(C, 12) + z + o(at, I), 7), it = G ^ o(C, 12), ct = (I >= 0 && I <= 15 ? C ^ H ^ D : C & H | C & D | H & D) + P + it + i[I], ut = (I >= 0 && I <= 15 ? z ^ L ^ $ : z & L | ~z & $) + K + G + t[I], P = D, D = o(H, 9), H = C, C = ct, K = $, $ = o(L, 19), L = z, z = u(ut);
1878
+ l[0] ^= C, l[1] ^= H, l[2] ^= D, l[3] ^= P, l[4] ^= z, l[5] ^= L, l[6] ^= $, l[7] ^= K;
1879
+ }
1880
+ const T = [];
1881
+ for (let h = 0, F = l.length; h < F; h++) {
1882
+ const A = l[h];
1883
+ T.push((A & 4278190080) >>> 24, (A & 16711680) >>> 16, (A & 65280) >>> 8, A & 255);
1884
+ }
1885
+ return T;
1886
+ }
1887
+ const a = 64, b = new Uint8Array(a), m = new Uint8Array(a);
1888
+ for (let B = 0; B < a; B++)
1889
+ b[B] = 54, m[B] = 92;
1890
+ function v(B, _) {
1891
+ for (_.length > a && (_ = d(_)); _.length < a; ) _.push(0);
1892
+ const M = s(_, b), R = s(_, m), q = d([...M, ...B]);
1893
+ return d([...R, ...q]);
1894
+ }
1895
+ return Rt = {
1896
+ sm3: d,
1897
+ hmac: v
1898
+ }, Rt;
1899
+ }
1900
+ var Dt, Xt;
1901
+ function ii() {
1902
+ if (Xt) return Dt;
1903
+ Xt = 1;
1904
+ const { BigInteger: t } = bt(), { encodeDer: i, decodeDer: o } = ei(), s = ri(), u = de().sm3, { G: f, curve: d, n: a } = s.generateEcparam(), b = 0;
1905
+ function m(p, w, g = 1) {
1906
+ p = typeof p == "string" ? s.hexToArray(s.utf8ToHex(p)) : Array.prototype.slice.call(p), w = s.getGlobalCurve().decodePointHex(w);
1907
+ const l = s.generateKeyPairHex(), T = new t(l.privateKey, 16);
1908
+ let h = l.publicKey;
1909
+ h.length > 128 && (h = h.substr(h.length - 128));
1910
+ const F = w.multiply(T), A = s.hexToArray(s.leftPad(F.getX().toBigInteger().toRadix(16), 64)), O = s.hexToArray(s.leftPad(F.getY().toBigInteger().toRadix(16), 64)), C = s.arrayToHex(u([].concat(A, p, O)));
1911
+ let H = 1, D = 0, P = [];
1912
+ const z = [].concat(A, O), L = () => {
1913
+ P = u([...z, H >> 24 & 255, H >> 16 & 255, H >> 8 & 255, H & 255]), H++, D = 0;
1914
+ };
1915
+ L();
1916
+ for (let K = 0, G = p.length; K < G; K++)
1917
+ D === P.length && L(), p[K] ^= P[D++] & 255;
1918
+ const $ = s.arrayToHex(p);
1919
+ return g === b ? h + $ + C : h + C + $;
1920
+ }
1921
+ function v(p, w, g = 1, {
1922
+ output: l = "string"
1923
+ } = {}) {
1924
+ w = new t(w, 16);
1925
+ let T = p.substr(128, 64), h = p.substr(192);
1926
+ g === b && (T = p.substr(p.length - 64), h = p.substr(128, p.length - 128 - 64));
1927
+ const F = s.hexToArray(h), O = s.getGlobalCurve().decodePointHex("04" + p.substr(0, 128)).multiply(w), C = s.hexToArray(s.leftPad(O.getX().toBigInteger().toRadix(16), 64)), H = s.hexToArray(s.leftPad(O.getY().toBigInteger().toRadix(16), 64));
1928
+ let D = 1, P = 0, z = [];
1929
+ const L = [].concat(C, H), $ = () => {
1930
+ z = u([...L, D >> 24 & 255, D >> 16 & 255, D >> 8 & 255, D & 255]), D++, P = 0;
1931
+ };
1932
+ $();
1933
+ for (let G = 0, it = F.length; G < it; G++)
1934
+ P === z.length && $(), F[G] ^= z[P++] & 255;
1935
+ return s.arrayToHex(u([].concat(C, F, H))) === T.toLowerCase() ? l === "array" ? F : s.arrayToUtf8(F) : l === "array" ? [] : "";
1936
+ }
1937
+ function B(p, w, {
1938
+ pointPool: g,
1939
+ der: l,
1940
+ hash: T,
1941
+ publicKey: h,
1942
+ userId: F
1943
+ } = {}) {
1944
+ let A = typeof p == "string" ? s.utf8ToHex(p) : s.arrayToHex(p);
1945
+ T && (h = h || R(w), A = M(A, h, F));
1946
+ const O = new t(w, 16), C = new t(A, 16);
1947
+ let H = null, D = null, P = null;
1948
+ do {
1949
+ do {
1950
+ let z;
1951
+ g && g.length ? z = g.pop() : z = q(), H = z.k, D = C.add(z.x1).mod(a);
1952
+ } while (D.equals(t.ZERO) || D.add(H).equals(a));
1953
+ P = O.add(t.ONE).modInverse(a).multiply(H.subtract(D.multiply(O))).mod(a);
1954
+ } while (P.equals(t.ZERO));
1955
+ return l ? i(D, P) : s.leftPad(D.toString(16), 64) + s.leftPad(P.toString(16), 64);
1956
+ }
1957
+ function _(p, w, g, { der: l, hash: T, userId: h } = {}) {
1958
+ let F = typeof p == "string" ? s.utf8ToHex(p) : s.arrayToHex(p);
1959
+ T && (F = M(F, g, h));
1960
+ let A, O;
1961
+ if (l) {
1962
+ const L = o(w);
1963
+ A = L.r, O = L.s;
1964
+ } else
1965
+ A = new t(w.substring(0, 64), 16), O = new t(w.substring(64), 16);
1966
+ const C = d.decodePointHex(g), H = new t(F, 16), D = A.add(O).mod(a);
1967
+ if (D.equals(t.ZERO)) return !1;
1968
+ const P = f.multiply(O).add(C.multiply(D)), z = H.add(P.getX().toBigInteger()).mod(a);
1969
+ return A.equals(z);
1970
+ }
1971
+ function M(p, w, g = "1234567812345678") {
1972
+ g = s.utf8ToHex(g);
1973
+ const l = s.leftPad(f.curve.a.toBigInteger().toRadix(16), 64), T = s.leftPad(f.curve.b.toBigInteger().toRadix(16), 64), h = s.leftPad(f.getX().toBigInteger().toRadix(16), 64), F = s.leftPad(f.getY().toBigInteger().toRadix(16), 64);
1974
+ let A, O;
1975
+ if (w.length === 128)
1976
+ A = w.substr(0, 64), O = w.substr(64, 64);
1977
+ else {
1978
+ const P = f.curve.decodePointHex(w);
1979
+ A = s.leftPad(P.getX().toBigInteger().toRadix(16), 64), O = s.leftPad(P.getY().toBigInteger().toRadix(16), 64);
1980
+ }
1981
+ const C = s.hexToArray(g + l + T + h + F + A + O), H = g.length * 4;
1982
+ C.unshift(H & 255), C.unshift(H >> 8 & 255);
1983
+ const D = u(C);
1984
+ return s.arrayToHex(u(D.concat(s.hexToArray(p))));
1985
+ }
1986
+ function R(p) {
1987
+ const w = f.multiply(new t(p, 16)), g = s.leftPad(w.getX().toBigInteger().toString(16), 64), l = s.leftPad(w.getY().toBigInteger().toString(16), 64);
1988
+ return "04" + g + l;
1989
+ }
1990
+ function q() {
1991
+ const p = s.generateKeyPairHex(), w = d.decodePointHex(p.publicKey);
1992
+ return p.k = new t(p.privateKey, 16), p.x1 = w.getX().toBigInteger(), p;
1993
+ }
1994
+ return Dt = {
1995
+ generateKeyPairHex: s.generateKeyPairHex,
1996
+ compressPublicKeyHex: s.compressPublicKeyHex,
1997
+ comparePublicKeyHex: s.comparePublicKeyHex,
1998
+ doEncrypt: m,
1999
+ doDecrypt: v,
2000
+ doSignature: B,
2001
+ doVerifySignature: _,
2002
+ getPublicKeyFromPrivateKey: R,
2003
+ getPoint: q,
2004
+ verifyPublicKey: s.verifyPublicKey
2005
+ }, Dt;
2006
+ }
2007
+ var At, Kt;
2008
+ function oi() {
2009
+ if (Kt) return At;
2010
+ Kt = 1;
2011
+ const { sm3: t, hmac: i } = de();
2012
+ function o(d, a) {
2013
+ return d.length >= a ? d : new Array(a - d.length + 1).join("0") + d;
2014
+ }
2015
+ function s(d) {
2016
+ return d.map((a) => (a = a.toString(16), a.length === 1 ? "0" + a : a)).join("");
2017
+ }
2018
+ function u(d) {
2019
+ const a = [];
2020
+ let b = d.length;
2021
+ b % 2 !== 0 && (d = o(d, b + 1)), b = d.length;
2022
+ for (let m = 0; m < b; m += 2)
2023
+ a.push(parseInt(d.substr(m, 2), 16));
2024
+ return a;
2025
+ }
2026
+ function f(d) {
2027
+ const a = [];
2028
+ for (let b = 0, m = d.length; b < m; b++) {
2029
+ const v = d.codePointAt(b);
2030
+ if (v <= 127)
2031
+ a.push(v);
2032
+ else if (v <= 2047)
2033
+ a.push(192 | v >>> 6), a.push(128 | v & 63);
2034
+ else if (v <= 55295 || v >= 57344 && v <= 65535)
2035
+ a.push(224 | v >>> 12), a.push(128 | v >>> 6 & 63), a.push(128 | v & 63);
2036
+ else if (v >= 65536 && v <= 1114111)
2037
+ b++, a.push(240 | v >>> 18 & 28), a.push(128 | v >>> 12 & 63), a.push(128 | v >>> 6 & 63), a.push(128 | v & 63);
2038
+ else
2039
+ throw a.push(v), new Error("input is not supported");
2040
+ }
2041
+ return a;
2042
+ }
2043
+ return At = function(d, a) {
2044
+ if (d = typeof d == "string" ? f(d) : Array.prototype.slice.call(d), a) {
2045
+ if ((a.mode || "hmac") !== "hmac") throw new Error("invalid mode");
2046
+ let m = a.key;
2047
+ if (!m) throw new Error("invalid key");
2048
+ return m = typeof m == "string" ? u(m) : Array.prototype.slice.call(m), s(i(d, m));
2049
+ }
2050
+ return s(t(d));
2051
+ }, At;
2052
+ }
2053
+ var It, Qt;
2054
+ function si() {
2055
+ if (Qt) return It;
2056
+ Qt = 1;
2057
+ const t = 0, i = 32, o = 16, s = [
2058
+ 214,
2059
+ 144,
2060
+ 233,
2061
+ 254,
2062
+ 204,
2063
+ 225,
2064
+ 61,
2065
+ 183,
2066
+ 22,
2067
+ 182,
2068
+ 20,
2069
+ 194,
2070
+ 40,
2071
+ 251,
2072
+ 44,
2073
+ 5,
2074
+ 43,
2075
+ 103,
2076
+ 154,
2077
+ 118,
2078
+ 42,
2079
+ 190,
2080
+ 4,
2081
+ 195,
2082
+ 170,
2083
+ 68,
2084
+ 19,
2085
+ 38,
2086
+ 73,
2087
+ 134,
2088
+ 6,
2089
+ 153,
2090
+ 156,
2091
+ 66,
2092
+ 80,
2093
+ 244,
2094
+ 145,
2095
+ 239,
2096
+ 152,
2097
+ 122,
2098
+ 51,
2099
+ 84,
2100
+ 11,
2101
+ 67,
2102
+ 237,
2103
+ 207,
2104
+ 172,
2105
+ 98,
2106
+ 228,
2107
+ 179,
2108
+ 28,
2109
+ 169,
2110
+ 201,
2111
+ 8,
2112
+ 232,
2113
+ 149,
2114
+ 128,
2115
+ 223,
2116
+ 148,
2117
+ 250,
2118
+ 117,
2119
+ 143,
2120
+ 63,
2121
+ 166,
2122
+ 71,
2123
+ 7,
2124
+ 167,
2125
+ 252,
2126
+ 243,
2127
+ 115,
2128
+ 23,
2129
+ 186,
2130
+ 131,
2131
+ 89,
2132
+ 60,
2133
+ 25,
2134
+ 230,
2135
+ 133,
2136
+ 79,
2137
+ 168,
2138
+ 104,
2139
+ 107,
2140
+ 129,
2141
+ 178,
2142
+ 113,
2143
+ 100,
2144
+ 218,
2145
+ 139,
2146
+ 248,
2147
+ 235,
2148
+ 15,
2149
+ 75,
2150
+ 112,
2151
+ 86,
2152
+ 157,
2153
+ 53,
2154
+ 30,
2155
+ 36,
2156
+ 14,
2157
+ 94,
2158
+ 99,
2159
+ 88,
2160
+ 209,
2161
+ 162,
2162
+ 37,
2163
+ 34,
2164
+ 124,
2165
+ 59,
2166
+ 1,
2167
+ 33,
2168
+ 120,
2169
+ 135,
2170
+ 212,
2171
+ 0,
2172
+ 70,
2173
+ 87,
2174
+ 159,
2175
+ 211,
2176
+ 39,
2177
+ 82,
2178
+ 76,
2179
+ 54,
2180
+ 2,
2181
+ 231,
2182
+ 160,
2183
+ 196,
2184
+ 200,
2185
+ 158,
2186
+ 234,
2187
+ 191,
2188
+ 138,
2189
+ 210,
2190
+ 64,
2191
+ 199,
2192
+ 56,
2193
+ 181,
2194
+ 163,
2195
+ 247,
2196
+ 242,
2197
+ 206,
2198
+ 249,
2199
+ 97,
2200
+ 21,
2201
+ 161,
2202
+ 224,
2203
+ 174,
2204
+ 93,
2205
+ 164,
2206
+ 155,
2207
+ 52,
2208
+ 26,
2209
+ 85,
2210
+ 173,
2211
+ 147,
2212
+ 50,
2213
+ 48,
2214
+ 245,
2215
+ 140,
2216
+ 177,
2217
+ 227,
2218
+ 29,
2219
+ 246,
2220
+ 226,
2221
+ 46,
2222
+ 130,
2223
+ 102,
2224
+ 202,
2225
+ 96,
2226
+ 192,
2227
+ 41,
2228
+ 35,
2229
+ 171,
2230
+ 13,
2231
+ 83,
2232
+ 78,
2233
+ 111,
2234
+ 213,
2235
+ 219,
2236
+ 55,
2237
+ 69,
2238
+ 222,
2239
+ 253,
2240
+ 142,
2241
+ 47,
2242
+ 3,
2243
+ 255,
2244
+ 106,
2245
+ 114,
2246
+ 109,
2247
+ 108,
2248
+ 91,
2249
+ 81,
2250
+ 141,
2251
+ 27,
2252
+ 175,
2253
+ 146,
2254
+ 187,
2255
+ 221,
2256
+ 188,
2257
+ 127,
2258
+ 17,
2259
+ 217,
2260
+ 92,
2261
+ 65,
2262
+ 31,
2263
+ 16,
2264
+ 90,
2265
+ 216,
2266
+ 10,
2267
+ 193,
2268
+ 49,
2269
+ 136,
2270
+ 165,
2271
+ 205,
2272
+ 123,
2273
+ 189,
2274
+ 45,
2275
+ 116,
2276
+ 208,
2277
+ 18,
2278
+ 184,
2279
+ 229,
2280
+ 180,
2281
+ 176,
2282
+ 137,
2283
+ 105,
2284
+ 151,
2285
+ 74,
2286
+ 12,
2287
+ 150,
2288
+ 119,
2289
+ 126,
2290
+ 101,
2291
+ 185,
2292
+ 241,
2293
+ 9,
2294
+ 197,
2295
+ 110,
2296
+ 198,
2297
+ 132,
2298
+ 24,
2299
+ 240,
2300
+ 125,
2301
+ 236,
2302
+ 58,
2303
+ 220,
2304
+ 77,
2305
+ 32,
2306
+ 121,
2307
+ 238,
2308
+ 95,
2309
+ 62,
2310
+ 215,
2311
+ 203,
2312
+ 57,
2313
+ 72
2314
+ ], u = [
2315
+ 462357,
2316
+ 472066609,
2317
+ 943670861,
2318
+ 1415275113,
2319
+ 1886879365,
2320
+ 2358483617,
2321
+ 2830087869,
2322
+ 3301692121,
2323
+ 3773296373,
2324
+ 4228057617,
2325
+ 404694573,
2326
+ 876298825,
2327
+ 1347903077,
2328
+ 1819507329,
2329
+ 2291111581,
2330
+ 2762715833,
2331
+ 3234320085,
2332
+ 3705924337,
2333
+ 4177462797,
2334
+ 337322537,
2335
+ 808926789,
2336
+ 1280531041,
2337
+ 1752135293,
2338
+ 2223739545,
2339
+ 2695343797,
2340
+ 3166948049,
2341
+ 3638552301,
2342
+ 4110090761,
2343
+ 269950501,
2344
+ 741554753,
2345
+ 1213159005,
2346
+ 1684763257
2347
+ ];
2348
+ function f(p) {
2349
+ const w = [];
2350
+ for (let g = 0, l = p.length; g < l; g += 2)
2351
+ w.push(parseInt(p.substr(g, 2), 16));
2352
+ return w;
2353
+ }
2354
+ function d(p) {
2355
+ return p.map((w) => (w = w.toString(16), w.length === 1 ? "0" + w : w)).join("");
2356
+ }
2357
+ function a(p) {
2358
+ const w = [];
2359
+ for (let g = 0, l = p.length; g < l; g++) {
2360
+ const T = p.codePointAt(g);
2361
+ if (T <= 127)
2362
+ w.push(T);
2363
+ else if (T <= 2047)
2364
+ w.push(192 | T >>> 6), w.push(128 | T & 63);
2365
+ else if (T <= 55295 || T >= 57344 && T <= 65535)
2366
+ w.push(224 | T >>> 12), w.push(128 | T >>> 6 & 63), w.push(128 | T & 63);
2367
+ else if (T >= 65536 && T <= 1114111)
2368
+ g++, w.push(240 | T >>> 18 & 28), w.push(128 | T >>> 12 & 63), w.push(128 | T >>> 6 & 63), w.push(128 | T & 63);
2369
+ else
2370
+ throw w.push(T), new Error("input is not supported");
2371
+ }
2372
+ return w;
2373
+ }
2374
+ function b(p) {
2375
+ const w = [];
2376
+ for (let g = 0, l = p.length; g < l; g++)
2377
+ p[g] >= 240 && p[g] <= 247 ? (w.push(String.fromCodePoint(((p[g] & 7) << 18) + ((p[g + 1] & 63) << 12) + ((p[g + 2] & 63) << 6) + (p[g + 3] & 63))), g += 3) : p[g] >= 224 && p[g] <= 239 ? (w.push(String.fromCodePoint(((p[g] & 15) << 12) + ((p[g + 1] & 63) << 6) + (p[g + 2] & 63))), g += 2) : p[g] >= 192 && p[g] <= 223 ? (w.push(String.fromCodePoint(((p[g] & 31) << 6) + (p[g + 1] & 63))), g++) : w.push(String.fromCodePoint(p[g]));
2378
+ return w.join("");
2379
+ }
2380
+ function m(p, w) {
2381
+ const g = w & 31;
2382
+ return p << g | p >>> 32 - g;
2383
+ }
2384
+ function v(p) {
2385
+ return (s[p >>> 24 & 255] & 255) << 24 | (s[p >>> 16 & 255] & 255) << 16 | (s[p >>> 8 & 255] & 255) << 8 | s[p & 255] & 255;
2386
+ }
2387
+ function B(p) {
2388
+ return p ^ m(p, 2) ^ m(p, 10) ^ m(p, 18) ^ m(p, 24);
2389
+ }
2390
+ function _(p) {
2391
+ return p ^ m(p, 13) ^ m(p, 23);
2392
+ }
2393
+ function M(p, w, g) {
2394
+ const l = new Array(4), T = new Array(4);
2395
+ for (let h = 0; h < 4; h++)
2396
+ T[0] = p[4 * h] & 255, T[1] = p[4 * h + 1] & 255, T[2] = p[4 * h + 2] & 255, T[3] = p[4 * h + 3] & 255, l[h] = T[0] << 24 | T[1] << 16 | T[2] << 8 | T[3];
2397
+ for (let h = 0, F; h < 32; h += 4)
2398
+ F = l[1] ^ l[2] ^ l[3] ^ g[h + 0], l[0] ^= B(v(F)), F = l[2] ^ l[3] ^ l[0] ^ g[h + 1], l[1] ^= B(v(F)), F = l[3] ^ l[0] ^ l[1] ^ g[h + 2], l[2] ^= B(v(F)), F = l[0] ^ l[1] ^ l[2] ^ g[h + 3], l[3] ^= B(v(F));
2399
+ for (let h = 0; h < 16; h += 4)
2400
+ w[h] = l[3 - h / 4] >>> 24 & 255, w[h + 1] = l[3 - h / 4] >>> 16 & 255, w[h + 2] = l[3 - h / 4] >>> 8 & 255, w[h + 3] = l[3 - h / 4] & 255;
2401
+ }
2402
+ function R(p, w, g) {
2403
+ const l = new Array(4), T = new Array(4);
2404
+ for (let h = 0; h < 4; h++)
2405
+ T[0] = p[0 + 4 * h] & 255, T[1] = p[1 + 4 * h] & 255, T[2] = p[2 + 4 * h] & 255, T[3] = p[3 + 4 * h] & 255, l[h] = T[0] << 24 | T[1] << 16 | T[2] << 8 | T[3];
2406
+ l[0] ^= 2746333894, l[1] ^= 1453994832, l[2] ^= 1736282519, l[3] ^= 2993693404;
2407
+ for (let h = 0, F; h < 32; h += 4)
2408
+ F = l[1] ^ l[2] ^ l[3] ^ u[h + 0], w[h + 0] = l[0] ^= _(v(F)), F = l[2] ^ l[3] ^ l[0] ^ u[h + 1], w[h + 1] = l[1] ^= _(v(F)), F = l[3] ^ l[0] ^ l[1] ^ u[h + 2], w[h + 2] = l[2] ^= _(v(F)), F = l[0] ^ l[1] ^ l[2] ^ u[h + 3], w[h + 3] = l[3] ^= _(v(F));
2409
+ if (g === t)
2410
+ for (let h = 0, F; h < 16; h++)
2411
+ F = w[h], w[h] = w[31 - h], w[31 - h] = F;
2412
+ }
2413
+ function q(p, w, g, {
2414
+ padding: l = "pkcs#7",
2415
+ mode: T,
2416
+ iv: h = [],
2417
+ output: F = "string"
2418
+ } = {}) {
2419
+ if (T === "cbc" && (typeof h == "string" && (h = f(h)), h.length !== 128 / 8))
2420
+ throw new Error("iv is invalid");
2421
+ if (typeof w == "string" && (w = f(w)), w.length !== 128 / 8)
2422
+ throw new Error("key is invalid");
2423
+ if (typeof p == "string" ? g !== t ? p = a(p) : p = f(p) : p = [...p], (l === "pkcs#5" || l === "pkcs#7") && g !== t) {
2424
+ const P = o - p.length % o;
2425
+ for (let z = 0; z < P; z++) p.push(P);
2426
+ }
2427
+ const A = new Array(i);
2428
+ R(w, A, g);
2429
+ const O = [];
2430
+ let C = h, H = p.length, D = 0;
2431
+ for (; H >= o; ) {
2432
+ const P = p.slice(D, D + 16), z = new Array(16);
2433
+ if (T === "cbc")
2434
+ for (let L = 0; L < o; L++)
2435
+ g !== t && (P[L] ^= C[L]);
2436
+ M(P, z, A);
2437
+ for (let L = 0; L < o; L++)
2438
+ T === "cbc" && g === t && (z[L] ^= C[L]), O[D + L] = z[L];
2439
+ T === "cbc" && (g !== t ? C = z : C = P), H -= o, D += o;
2440
+ }
2441
+ if ((l === "pkcs#5" || l === "pkcs#7") && g === t) {
2442
+ const P = O.length, z = O[P - 1];
2443
+ for (let L = 1; L <= z; L++)
2444
+ if (O[P - L] !== z) throw new Error("padding is invalid");
2445
+ O.splice(P - z, z);
2446
+ }
2447
+ return F !== "array" ? g !== t ? d(O) : b(O) : O;
2448
+ }
2449
+ return It = {
2450
+ encrypt(p, w, g) {
2451
+ return q(p, w, 1, g);
2452
+ },
2453
+ decrypt(p, w, g) {
2454
+ return q(p, w, 0, g);
2455
+ }
2456
+ }, It;
2457
+ }
2458
+ var Mt, te;
2459
+ function fi() {
2460
+ return te || (te = 1, Mt = {
2461
+ sm2: ii(),
2462
+ sm3: oi(),
2463
+ sm4: si()
2464
+ }), Mt;
2465
+ }
2466
+ var pe = fi();
2467
+ const ge = pe.sm2, xe = pe.sm4, qi = (t, i, o = "04") => o + ge.doEncrypt(t, i), Ci = (t, i, o = "04") => ge.doDecrypt(t.startsWith(o) ? t.slice(2) : t, i), Pi = (t, i) => xe.encrypt(t, i), zi = (t, i) => xe.decrypt(t, i);
2468
+ let ft = [], ci = { consecutiveFrames: 0, lastBlinkTime: 0 }, ui = { consecutiveFrames: 0, lastBlinkTime: 0 };
2469
+ const ai = /* @__PURE__ */ new Map([
2470
+ ["nod", [mi, 30, 100]],
2471
+ ["shake", [xi, 7, 100]],
2472
+ ["mouth", [gi, 0.35, 100]],
2473
+ ["eye", [pi, 0.3, 100]]
2474
+ ]), Hi = ["nod", "shake", "mouth", "eye"], Li = {
739
2475
  nod: "请点点头",
740
2476
  shake: "请摇摇头",
741
2477
  mouth: "请张张嘴",
742
2478
  eye: "请眨眨眼"
743
2479
  };
744
- function R(e, t) {
745
- if (e.length !== t.length) throw new Error("euclideanDistance: arr1.length !== arr2.length");
746
- const n = Array.from(e), r = Array.from(t);
2480
+ function ee(t, i) {
2481
+ if (t.length !== i.length) throw new Error("euclideanDistance: arr1.length !== arr2.length");
2482
+ const o = Array.from(t), s = Array.from(i);
747
2483
  return Math.sqrt(
748
- n.map((o, i) => o - r[i]).reduce((o, i) => o + Math.pow(i, 2), 0)
2484
+ o.map((u, f) => u - s[f]).reduce((u, f) => u + Math.pow(f, 2), 0)
749
2485
  );
750
2486
  }
751
- function* et(e, t, n = 8, r = 0) {
752
- for (let o = n; o > 0; o--)
753
- yield e(t, 0.5, r);
2487
+ function* hi(t, i, o = 8, s = 0) {
2488
+ for (let u = o; u > 0; u--)
2489
+ yield t(i, 0.5, s);
754
2490
  }
755
- function g(e) {
756
- return [e.x, e.y];
2491
+ function pt(t) {
2492
+ return [t.x, t.y];
757
2493
  }
758
- function y(e, t) {
759
- const n = e.x - t.x, r = e.y - t.y;
760
- return Math.sqrt(n * n + r * r);
2494
+ function Ot(t, i) {
2495
+ const o = t.x - i.x, s = t.y - i.y;
2496
+ return Math.sqrt(o * o + s * s);
761
2497
  }
762
- function A(e) {
763
- const t = y(e[1], e[5]), n = y(e[2], e[4]), r = y(e[0], e[3]);
764
- return (t + n) / (2 * r);
2498
+ function ne(t) {
2499
+ const i = Ot(t[1], t[5]), o = Ot(t[2], t[4]), s = Ot(t[0], t[3]);
2500
+ return (i + o) / (2 * s);
765
2501
  }
766
- function tt(e) {
767
- const t = R(g(e[13]), g(e[19])), n = R(g(e[0]), g(e[6]));
768
- return t / n;
2502
+ function li(t) {
2503
+ const i = ee(pt(t[13]), pt(t[19])), o = ee(pt(t[0]), pt(t[6]));
2504
+ return i / o;
769
2505
  }
770
- function nt(e) {
771
- const t = e.positions[30], n = e.positions[36], r = e.positions[45], o = (n.x + r.x) / 2;
772
- return (t.x - o) / (r.x - n.x) * 30;
2506
+ function di(t) {
2507
+ const i = t.positions[30], o = t.positions[36], s = t.positions[45], u = (o.x + s.x) / 2;
2508
+ return (i.x - u) / (s.x - o.x) * 30;
773
2509
  }
774
- function rt(e, t) {
775
- const n = Date.now(), r = S(A(e.getLeftEye()), t, Xe, n), o = S(A(e.getRightEye()), t, Qe, n);
776
- return !!(r || o);
2510
+ function pi(t, i) {
2511
+ const o = Date.now(), s = re(ne(t.getLeftEye()), i, ci, o), u = re(ne(t.getRightEye()), i, ui, o);
2512
+ return !!(s || u);
777
2513
  }
778
- function S(e, t, n, r) {
779
- if (e < t)
780
- n.consecutiveFrames++;
781
- else if (n.consecutiveFrames >= 3 && r - n.lastBlinkTime > 500)
782
- return n.lastBlinkTime = r, n.consecutiveFrames = 0, !0;
2514
+ function re(t, i, o, s) {
2515
+ if (t < i)
2516
+ o.consecutiveFrames++;
2517
+ else if (o.consecutiveFrames >= 3 && s - o.lastBlinkTime > 500)
2518
+ return o.lastBlinkTime = s, o.consecutiveFrames = 0, !0;
783
2519
  return !1;
784
2520
  }
785
- function ot(e, t) {
786
- return tt(e.getMouth()) > t;
2521
+ function gi(t, i) {
2522
+ return li(t.getMouth()) > i;
787
2523
  }
788
- function it(e, t) {
789
- const n = nt(e);
790
- return Math.abs(n) > t;
2524
+ function xi(t, i) {
2525
+ const o = di(t);
2526
+ return Math.abs(o) > i;
791
2527
  }
792
- function st(e, t) {
793
- const n = h.length, r = e.positions[33];
794
- if (n < 5)
795
- h.push(r.y);
796
- else if (n === 5) {
797
- const o = Math.min(...h);
798
- if (Math.max(...h) - o > t)
2528
+ function mi(t, i) {
2529
+ const o = ft.length, s = t.positions[33];
2530
+ if (o < 5)
2531
+ ft.push(s.y);
2532
+ else if (o === 5) {
2533
+ const u = Math.min(...ft);
2534
+ if (Math.max(...ft) - u > i)
799
2535
  return !0;
800
- h = [];
2536
+ ft = [];
801
2537
  }
802
2538
  return !1;
803
2539
  }
804
- function Ot(e, t = "blob", n = 1) {
805
- return new Promise((r) => {
806
- const o = document.createElement("canvas"), i = o.getContext("2d");
807
- o.width = e.videoWidth, o.height = e.videoHeight, i == null || i.drawImage(e, 0, 0, o.width, o.height), t === "blob" ? o.toBlob(
808
- (s) => {
809
- const c = new FileReader();
810
- c.onload = () => r(c.result), c.readAsArrayBuffer(s);
2540
+ function Ni(t, i = "blob", o = 1) {
2541
+ return new Promise((s) => {
2542
+ const u = document.createElement("canvas"), f = u.getContext("2d");
2543
+ u.width = t.videoWidth, u.height = t.videoHeight, f == null || f.drawImage(t, 0, 0, u.width, u.height), i === "blob" ? u.toBlob(
2544
+ (d) => {
2545
+ const a = new FileReader();
2546
+ a.onload = () => s(a.result), a.readAsArrayBuffer(d);
811
2547
  },
812
2548
  "image/png",
813
- n
814
- ) : r(o.toDataURL("image/png", n));
2549
+ o
2550
+ ) : s(u.toDataURL("image/png", o));
815
2551
  });
816
2552
  }
817
- async function Mt(e, t, n, r = 5) {
818
- const [o, i, s] = Ke.get(n);
819
- if (!o) return !1;
820
- const c = [], a = et(e, t, r, s);
821
- for (const u of a) {
822
- const f = await u;
823
- if (!f) continue;
824
- const p = o(f.landmarks, i);
825
- c.push(p);
826
- }
827
- return c.includes(!0);
828
- }
829
- const Tt = { DATE_VALUE_FORMAT: me, COMMON_TEXT: l, IMAGE_TYPE: x, MEDIA_TYPE: D, DOC_TYPE: Y, FILE_TYPE: _e }, Rt = {
830
- encodeURIToParams: xe,
831
- paramsToQueryString: De,
832
- queryStringToParams: Ye,
833
- errorCodeToString: be,
834
- YNToString: ye,
835
- HNToString: we,
836
- valueToLabel: Re,
837
- chargeToLabel: Ae,
838
- cascaderToLabel: z,
839
- multipleSelectToLabel: Se,
840
- phoneToAsterisk: Ee,
841
- idNumberToAsterisk: Oe,
842
- firstLetterToUpperCase: Me,
843
- firstLetterToLowerCase: Te
844
- }, At = {
845
- validHttp: te,
846
- validExternal: ne,
847
- validString: re,
848
- validNumberStr: oe,
849
- validEmptyObject: ie,
850
- validURL: se,
851
- validPassword: ce,
852
- validEmail: ae,
853
- validIdNumber: O,
854
- validPhone: fe,
855
- validTel: ue
856
- }, St = { scrollTo: q, addClass: X, removeClass: Q, hasClass: E, toggleClass: V, noContextmenu: ee, useRafThrottle: K }, xt = { parseTime: m, getTimeDistance: U, getDayRange: Z }, Dt = { local: W, session: J }, Yt = { uuid: G, randomNum: j };
2553
+ async function Yi(t, i, o, s = 5) {
2554
+ const [u, f, d] = ai.get(o);
2555
+ if (!u) return !1;
2556
+ const a = [], b = hi(t, i, s, d);
2557
+ for (const m of b) {
2558
+ const v = await m;
2559
+ if (!v) continue;
2560
+ const B = u(v.landmarks, f);
2561
+ a.push(B);
2562
+ }
2563
+ return a.includes(!0);
2564
+ }
2565
+ const ki = { DATE_VALUE_FORMAT: yr, COMMON_TEXT: et, IMAGE_TYPE: ie, MEDIA_TYPE: oe, DOC_TYPE: se, FILE_TYPE: wr }, Vi = {
2566
+ encodeURIToParams: Mr,
2567
+ paramsToQueryString: Or,
2568
+ queryStringToParams: qr,
2569
+ errorCodeToString: Tr,
2570
+ YNToString: Fr,
2571
+ HNToString: Sr,
2572
+ valueToLabel: Dr,
2573
+ chargeToLabel: Ar,
2574
+ cascaderToLabel: fe,
2575
+ multipleSelectToLabel: Ir,
2576
+ phoneToAsterisk: Er,
2577
+ idNumberToAsterisk: Br,
2578
+ firstLetterToUpperCase: _r,
2579
+ firstLetterToLowerCase: Rr
2580
+ }, $i = {
2581
+ validHttp: ir,
2582
+ validExternal: or,
2583
+ validString: sr,
2584
+ validNumberStr: fr,
2585
+ validEmptyObject: cr,
2586
+ validURL: ur,
2587
+ validPassword: ar,
2588
+ validEmail: hr,
2589
+ validIdNumber: Pt,
2590
+ validPhone: dr,
2591
+ validTel: lr
2592
+ }, ji = { scrollTo: Un, addClass: tr, removeClass: er, hasClass: Ct, toggleClass: Qn, noContextmenu: rr, useRafThrottle: nr }, Ui = { parseTime: xt, getTimeDistance: Wn, getDayRange: Jn }, Zi = { local: Kn, session: Xn }, Gi = { uuid: Gn, randomNum: Zn };
857
2593
  export {
858
- Tt as CONSTANTS,
859
- M as NOOP,
860
- bt as addResizeListener,
861
- Dt as cacheUtil,
862
- at as countdownTimer,
863
- pt as creatCancelTask,
864
- xt as dateUtil,
865
- ft as debounce,
866
- gt as downloadFile,
867
- St as elementUtil,
868
- wt as faceLivingEvent,
869
- Et as faceLivingEventHint,
870
- ht as getArrayFullUrl,
871
- dt as getBirthdayByIdNumber,
872
- Mt as getFaceGestureResult,
873
- Ot as getFaceVideoFrame,
874
- le as getFullUrl,
875
- lt as getGenderByIdNumber,
876
- mt as getPercentage,
877
- ut as getRandomItemInArray,
878
- vt as loadCss,
879
- _t as loadJs,
880
- Yt as randomUtil,
881
- yt as removeResizeListener,
882
- ct as sleep,
883
- Rt as toUtil,
884
- de as trimArray,
885
- At as validUtil
2594
+ ki as CONSTANTS,
2595
+ $t as NOOP,
2596
+ Mi as addResizeListener,
2597
+ Zi as cacheUtil,
2598
+ yi as countdownTimer,
2599
+ Bi as creatCancelTask,
2600
+ Ui as dateUtil,
2601
+ wi as debounce,
2602
+ _i as downloadFile,
2603
+ ji as elementUtil,
2604
+ Hi as faceLivingEvent,
2605
+ Li as faceLivingEventHint,
2606
+ Si as getArrayFullUrl,
2607
+ Fi as getBirthdayByIdNumber,
2608
+ Yi as getFaceGestureResult,
2609
+ Ni as getFaceVideoFrame,
2610
+ pr as getFullUrl,
2611
+ Ti as getGenderByIdNumber,
2612
+ Ii as getMapLocationIcon,
2613
+ Ri as getPercentage,
2614
+ bi as getRandomItemInArray,
2615
+ Di as loadCss,
2616
+ Ai as loadJs,
2617
+ Gi as randomUtil,
2618
+ Oi as removeResizeListener,
2619
+ Ei as ricTask,
2620
+ vi as sleep,
2621
+ ge as sm2Crypto,
2622
+ Ci as sm2Decrypt,
2623
+ qi as sm2Encrypt,
2624
+ xe as sm4Crypto,
2625
+ zi as sm4Decrypt,
2626
+ Pi as sm4Encrypt,
2627
+ Vi as toUtil,
2628
+ gr as trimArray,
2629
+ $i as validUtil
886
2630
  };