gws-client 1.0.3 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,314 +1,314 @@
1
- var xe = Object.defineProperty, Be = Object.defineProperties;
2
- var Se = Object.getOwnPropertyDescriptors;
3
- var ee = Object.getOwnPropertySymbols;
4
- var $e = Object.prototype.hasOwnProperty, Ie = Object.prototype.propertyIsEnumerable;
5
- var J = (n, e, t) => e in n ? xe(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, D = (n, e) => {
1
+ var xe = Object.defineProperty, Pe = Object.defineProperties;
2
+ var $e = Object.getOwnPropertyDescriptors;
3
+ var re = Object.getOwnPropertySymbols;
4
+ var Ne = Object.prototype.hasOwnProperty, Le = Object.prototype.propertyIsEnumerable;
5
+ var K = (s, e, t) => e in s ? xe(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, S = (s, e) => {
6
6
  for (var t in e || (e = {}))
7
- $e.call(e, t) && J(n, t, e[t]);
8
- if (ee)
9
- for (var t of ee(e))
10
- Ie.call(e, t) && J(n, t, e[t]);
11
- return n;
12
- }, B = (n, e) => Be(n, Se(e));
13
- var i = (n, e, t) => J(n, typeof e != "symbol" ? e + "" : e, t);
14
- var l = (n, e, t) => new Promise((s, r) => {
7
+ Ne.call(e, t) && K(s, t, e[t]);
8
+ if (re)
9
+ for (var t of re(e))
10
+ Le.call(e, t) && K(s, t, e[t]);
11
+ return s;
12
+ }, E = (s, e) => Pe(s, $e(e));
13
+ var o = (s, e, t) => K(s, typeof e != "symbol" ? e + "" : e, t);
14
+ var l = (s, e, t) => new Promise((n, r) => {
15
15
  var a = (d) => {
16
16
  try {
17
- u(t.next(d));
18
- } catch (h) {
19
- r(h);
17
+ c(t.next(d));
18
+ } catch (u) {
19
+ r(u);
20
20
  }
21
- }, o = (d) => {
21
+ }, i = (d) => {
22
22
  try {
23
- u(t.throw(d));
24
- } catch (h) {
25
- r(h);
23
+ c(t.throw(d));
24
+ } catch (u) {
25
+ r(u);
26
26
  }
27
- }, u = (d) => d.done ? s(d.value) : Promise.resolve(d.value).then(a, o);
28
- u((t = t.apply(n, e)).next());
27
+ }, c = (d) => d.done ? n(d.value) : Promise.resolve(d.value).then(a, i);
28
+ c((t = t.apply(s, e)).next());
29
29
  });
30
- const Ae = window.location.href.includes("https") ? "wss://localhost:19528" : "ws://localhost:9527", te = "1", ne = "2";
31
- var ge = /* @__PURE__ */ ((n) => (n[n.MIN = 0] = "MIN", n[n.LOW = 1] = "LOW", n[n.MIDDLE = 2] = "MIDDLE", n[n.HIGH = 3] = "HIGH", n))(ge || {});
32
- const Ee = "00000001";
33
- function _e(n) {
34
- return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
30
+ const Te = window.location.href.includes("https") ? "wss://localhost:19528" : "ws://localhost:9527", ae = "1", ie = "2";
31
+ var Se = /* @__PURE__ */ ((s) => (s.MIN = "0", s.LOW = "1", s.MIDDLE = "2", s.HIGH = "3", s))(Se || {});
32
+ const Me = "00000001", Y = "NO_SEAL_AVAILABLE", Fe = "CERTIFICATE_NOT_FOUND", Ge = "CLIENT_CONNECTION_FAILED";
33
+ function Oe(s) {
34
+ return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s;
35
35
  }
36
- var G = {}, se;
37
- function Le() {
38
- if (se) return G;
39
- se = 1, G.byteLength = u, G.toByteArray = h, G.fromByteArray = p;
40
- for (var n = [], e = [], t = typeof Uint8Array != "undefined" ? Uint8Array : Array, s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", r = 0, a = s.length; r < a; ++r)
41
- n[r] = s[r], e[s.charCodeAt(r)] = r;
36
+ var M = {}, oe;
37
+ function He() {
38
+ if (oe) return M;
39
+ oe = 1, M.byteLength = c, M.toByteArray = u, M.fromByteArray = m;
40
+ for (var s = [], e = [], t = typeof Uint8Array != "undefined" ? Uint8Array : Array, n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", r = 0, a = n.length; r < a; ++r)
41
+ s[r] = n[r], e[n.charCodeAt(r)] = r;
42
42
  e[45] = 62, e[95] = 63;
43
- function o(y) {
44
- var c = y.length;
45
- if (c % 4 > 0)
43
+ function i(h) {
44
+ var f = h.length;
45
+ if (f % 4 > 0)
46
46
  throw new Error("Invalid string. Length must be a multiple of 4");
47
- var g = y.indexOf("=");
48
- g === -1 && (g = c);
49
- var w = g === c ? 0 : 4 - g % 4;
50
- return [g, w];
47
+ var w = h.indexOf("=");
48
+ w === -1 && (w = f);
49
+ var y = w === f ? 0 : 4 - w % 4;
50
+ return [w, y];
51
51
  }
52
- function u(y) {
53
- var c = o(y), g = c[0], w = c[1];
54
- return (g + w) * 3 / 4 - w;
52
+ function c(h) {
53
+ var f = i(h), w = f[0], y = f[1];
54
+ return (w + y) * 3 / 4 - y;
55
55
  }
56
- function d(y, c, g) {
57
- return (c + g) * 3 / 4 - g;
56
+ function d(h, f, w) {
57
+ return (f + w) * 3 / 4 - w;
58
58
  }
59
- function h(y) {
60
- var c, g = o(y), w = g[0], m = g[1], v = new t(d(y, w, m)), b = 0, E = m > 0 ? w - 4 : w, k;
61
- for (k = 0; k < E; k += 4)
62
- c = e[y.charCodeAt(k)] << 18 | e[y.charCodeAt(k + 1)] << 12 | e[y.charCodeAt(k + 2)] << 6 | e[y.charCodeAt(k + 3)], v[b++] = c >> 16 & 255, v[b++] = c >> 8 & 255, v[b++] = c & 255;
63
- return m === 2 && (c = e[y.charCodeAt(k)] << 2 | e[y.charCodeAt(k + 1)] >> 4, v[b++] = c & 255), m === 1 && (c = e[y.charCodeAt(k)] << 10 | e[y.charCodeAt(k + 1)] << 4 | e[y.charCodeAt(k + 2)] >> 2, v[b++] = c >> 8 & 255, v[b++] = c & 255), v;
59
+ function u(h) {
60
+ var f, w = i(h), y = w[0], p = w[1], v = new t(d(h, y, p)), I = 0, b = p > 0 ? y - 4 : y, k;
61
+ for (k = 0; k < b; k += 4)
62
+ f = e[h.charCodeAt(k)] << 18 | e[h.charCodeAt(k + 1)] << 12 | e[h.charCodeAt(k + 2)] << 6 | e[h.charCodeAt(k + 3)], v[I++] = f >> 16 & 255, v[I++] = f >> 8 & 255, v[I++] = f & 255;
63
+ return p === 2 && (f = e[h.charCodeAt(k)] << 2 | e[h.charCodeAt(k + 1)] >> 4, v[I++] = f & 255), p === 1 && (f = e[h.charCodeAt(k)] << 10 | e[h.charCodeAt(k + 1)] << 4 | e[h.charCodeAt(k + 2)] >> 2, v[I++] = f >> 8 & 255, v[I++] = f & 255), v;
64
64
  }
65
- function f(y) {
66
- return n[y >> 18 & 63] + n[y >> 12 & 63] + n[y >> 6 & 63] + n[y & 63];
65
+ function C(h) {
66
+ return s[h >> 18 & 63] + s[h >> 12 & 63] + s[h >> 6 & 63] + s[h & 63];
67
67
  }
68
- function C(y, c, g) {
69
- for (var w, m = [], v = c; v < g; v += 3)
70
- w = (y[v] << 16 & 16711680) + (y[v + 1] << 8 & 65280) + (y[v + 2] & 255), m.push(f(w));
71
- return m.join("");
68
+ function g(h, f, w) {
69
+ for (var y, p = [], v = f; v < w; v += 3)
70
+ y = (h[v] << 16 & 16711680) + (h[v + 1] << 8 & 65280) + (h[v + 2] & 255), p.push(C(y));
71
+ return p.join("");
72
72
  }
73
- function p(y) {
74
- for (var c, g = y.length, w = g % 3, m = [], v = 16383, b = 0, E = g - w; b < E; b += v)
75
- m.push(C(y, b, b + v > E ? E : b + v));
76
- return w === 1 ? (c = y[g - 1], m.push(
77
- n[c >> 2] + n[c << 4 & 63] + "=="
78
- )) : w === 2 && (c = (y[g - 2] << 8) + y[g - 1], m.push(
79
- n[c >> 10] + n[c >> 4 & 63] + n[c << 2 & 63] + "="
80
- )), m.join("");
73
+ function m(h) {
74
+ for (var f, w = h.length, y = w % 3, p = [], v = 16383, I = 0, b = w - y; I < b; I += v)
75
+ p.push(g(h, I, I + v > b ? b : I + v));
76
+ return y === 1 ? (f = h[w - 1], p.push(
77
+ s[f >> 2] + s[f << 4 & 63] + "=="
78
+ )) : y === 2 && (f = (h[w - 2] << 8) + h[w - 1], p.push(
79
+ s[f >> 10] + s[f >> 4 & 63] + s[f << 2 & 63] + "="
80
+ )), p.join("");
81
81
  }
82
- return G;
82
+ return M;
83
83
  }
84
- var Pe = Le();
85
- const re = /* @__PURE__ */ _e(Pe);
86
- class Te {
84
+ var Ze = He();
85
+ const ce = /* @__PURE__ */ Oe(Ze);
86
+ class Ve {
87
87
  constructor() {
88
- i(this, "deps", /* @__PURE__ */ new Map());
88
+ o(this, "deps", /* @__PURE__ */ new Map());
89
89
  }
90
90
  on(e, t) {
91
91
  this.deps.set(e, t);
92
92
  }
93
93
  emit(e, t) {
94
- const s = this.deps.get(e);
95
- s && s(t);
94
+ const n = this.deps.get(e);
95
+ n == null || n(t);
96
96
  }
97
97
  }
98
98
  (function() {
99
99
  try {
100
- var n = document.createElement("style");
101
- n.appendChild(document.createTextNode("button.svelte-oivou{background-color:transparent;border:none;padding:0;margin:0;font-family:inherit;font-size:inherit;color:inherit;cursor:pointer;outline:none}.modal-background.svelte-oivou{display:none;position:fixed;z-index:10000;left:0;top:0;width:100%;height:100%;background-color:#00000080;align-items:center;justify-content:center}.modal-content.svelte-oivou{background-color:#fff;padding:1.42857rem;border-radius:.35714rem;width:40%}.model-title.svelte-oivou{color:#303133;font-size:1.28571rem;margin-bottom:1.14286rem}.modal-visible.svelte-oivou{display:flex}.modal-footer.svelte-oivou{display:flex;align-items:center;justify-content:flex-end;margin-top:1.14286rem}.modal-btn.svelte-oivou{padding:.57143rem 1.07143rem;border-radius:.28571rem;font-size:1rem;border:.07143rem solid #dcdfe6}.success.svelte-oivou{margin-left:.85714rem;color:#fff}.slot.svelte-oivou{max-height:14.28571rem;overflow-y:scroll}.slot.svelte-oivou::-webkit-scrollbar{display:none}.cert-item.svelte-jtc2v4.svelte-jtc2v4{padding:1.14286rem;display:flex;align-items:center;cursor:pointer;border-bottom:.07143rem solid #ebeef5;font-size:1rem}.cert-item-selected.svelte-jtc2v4.svelte-jtc2v4{background-color:#f1f1f1}.cert-item-first.svelte-jtc2v4.svelte-jtc2v4{border-top:.07143rem solid #ebeef5}.cert-item.svelte-jtc2v4 span.svelte-jtc2v4{display:inline-block;color:#606266}.cert-item.svelte-jtc2v4 span.svelte-jtc2v4:first-child{width:30%}.seal-wrapper.svelte-1w19fs3.svelte-1w19fs3{display:flex;flex-direction:row;align-items:center;flex-wrap:wrap}.seal-item.svelte-1w19fs3.svelte-1w19fs3{width:12.85714rem;height:12.85714rem;display:flex;flex-direction:column;align-items:center;justify-content:center;border:.07143rem solid #ccc;margin-top:.71429rem;margin-right:.71429rem;border-radius:.28571rem}.seal-item.svelte-1w19fs3 img.svelte-1w19fs3{width:7.14286rem;height:7.14286rem}.seal-item-selected.svelte-1w19fs3.svelte-1w19fs3{background-color:#f1f1f1}.seal-name.svelte-1w19fs3.svelte-1w19fs3{margin-top:.71429rem;color:#333}")), document.head.appendChild(n);
100
+ var s = document.createElement("style");
101
+ s.appendChild(document.createTextNode("button.svelte-16iv9d0{background-color:transparent;border:none;padding:0;margin:0;font-family:inherit;font-size:inherit;color:inherit;cursor:pointer;outline:none}.modal-background.svelte-16iv9d0{display:none;position:fixed;z-index:10000;left:0;top:0;width:100%;height:100%;background-color:#00000080;align-items:center;justify-content:center}.modal-content.svelte-16iv9d0{background-color:#fff;padding:1.25rem;border-radius:.3125rem;width:40%}.model-title.svelte-16iv9d0{color:#303133;font-size:1.125rem;margin-bottom:1.125rem}.modal-visible.svelte-16iv9d0{display:flex}.modal-footer.svelte-16iv9d0{display:flex;align-items:center;justify-content:flex-end;margin-top:1rem}.modal-btn.svelte-16iv9d0{padding:.5rem .9375rem;border-radius:.25rem;font-size:.875rem;border:.0625rem solid #dcdfe6}.success.svelte-16iv9d0{margin-left:.75rem;color:#fff}.slot.svelte-16iv9d0{max-height:12.5rem;overflow-y:scroll}.slot.svelte-16iv9d0::-webkit-scrollbar{display:none}.seal-wrapper.svelte-1w19fs3.svelte-1w19fs3{display:flex;flex-direction:row;align-items:center;flex-wrap:wrap}.seal-item.svelte-1w19fs3.svelte-1w19fs3{width:11.25rem;height:11.25rem;display:flex;flex-direction:column;align-items:center;justify-content:center;border:.0625rem solid #ccc;margin-top:.625rem;margin-right:.625rem;border-radius:.25rem}.seal-item.svelte-1w19fs3 img.svelte-1w19fs3{width:6.25rem;height:6.25rem}.seal-item-selected.svelte-1w19fs3.svelte-1w19fs3{background-color:#f1f1f1}.seal-name.svelte-1w19fs3.svelte-1w19fs3{margin-top:.625rem;color:#333}.cert-item.svelte-1kh75ag.svelte-1kh75ag{padding:1rem;display:flex;align-items:center;cursor:pointer;border-bottom:.0625rem solid #ebeef5;font-size:1rem}.cert-item.svelte-1kh75ag>div.svelte-1kh75ag{word-break:break-all;color:#373a40}.cert-item.svelte-1kh75ag>div.svelte-1kh75ag:nth-child(1){padding-right:.5rem}.cert-item-selected.svelte-1kh75ag.svelte-1kh75ag{background-color:#f1f1f1}.cert-item-first.svelte-1kh75ag.svelte-1kh75ag{border-top:.0625rem solid #ebeef5}")), document.head.appendChild(s);
102
102
  } catch (e) {
103
103
  console.error("vite-plugin-css-injected-by-js", e);
104
104
  }
105
105
  })();
106
- var He = Object.defineProperty, Me = (n, e, t) => e in n ? He(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, ae = (n, e, t) => Me(n, typeof e != "symbol" ? e + "" : e, t);
107
- function W() {
106
+ var je = Object.defineProperty, Ue = (s, e, t) => e in s ? je(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, le = (s, e, t) => Ue(s, typeof e != "symbol" ? e + "" : e, t);
107
+ function X() {
108
108
  }
109
- function Ge(n, e) {
110
- for (const t in e) n[t] = e[t];
109
+ function ze(s, e) {
110
+ for (const t in e) s[t] = e[t];
111
111
  return (
112
112
  /** @type {T & S} */
113
- n
113
+ s
114
114
  );
115
115
  }
116
- function fe(n) {
117
- return n();
116
+ function pe(s) {
117
+ return s();
118
118
  }
119
- function oe() {
119
+ function ue() {
120
120
  return /* @__PURE__ */ Object.create(null);
121
121
  }
122
- function V(n) {
123
- n.forEach(fe);
122
+ function Z(s) {
123
+ s.forEach(pe);
124
124
  }
125
- function j(n) {
126
- return typeof n == "function";
125
+ function G(s) {
126
+ return typeof s == "function";
127
127
  }
128
- function pe(n, e) {
129
- return n != n ? e == e : n !== e || n && typeof n == "object" || typeof n == "function";
128
+ function ke(s, e) {
129
+ return s != s ? e == e : s !== e || s && typeof s == "object" || typeof s == "function";
130
130
  }
131
- function Fe(n) {
132
- return Object.keys(n).length === 0;
131
+ function Je(s) {
132
+ return Object.keys(s).length === 0;
133
133
  }
134
- function je(n, e, t, s) {
135
- if (n) {
136
- const r = me(n, e, t, s);
137
- return n[0](r);
134
+ function Qe(s, e, t, n) {
135
+ if (s) {
136
+ const r = ve(s, e, t, n);
137
+ return s[0](r);
138
138
  }
139
139
  }
140
- function me(n, e, t, s) {
141
- return n[1] && s ? Ge(t.ctx.slice(), n[1](s(e))) : t.ctx;
140
+ function ve(s, e, t, n) {
141
+ return s[1] && n ? ze(t.ctx.slice(), s[1](n(e))) : t.ctx;
142
142
  }
143
- function Ne(n, e, t, s) {
144
- if (n[2] && s) {
145
- const r = n[2](s(t));
143
+ function We(s, e, t, n) {
144
+ if (s[2] && n) {
145
+ const r = s[2](n(t));
146
146
  if (e.dirty === void 0)
147
147
  return r;
148
148
  if (typeof r == "object") {
149
- const a = [], o = Math.max(e.dirty.length, r.length);
150
- for (let u = 0; u < o; u += 1)
151
- a[u] = e.dirty[u] | r[u];
149
+ const a = [], i = Math.max(e.dirty.length, r.length);
150
+ for (let c = 0; c < i; c += 1)
151
+ a[c] = e.dirty[c] | r[c];
152
152
  return a;
153
153
  }
154
154
  return e.dirty | r;
155
155
  }
156
156
  return e.dirty;
157
157
  }
158
- function Oe(n, e, t, s, r, a) {
158
+ function qe(s, e, t, n, r, a) {
159
159
  if (r) {
160
- const o = me(e, t, s, a);
161
- n.p(o, r);
160
+ const i = ve(e, t, n, a);
161
+ s.p(i, r);
162
162
  }
163
163
  }
164
- function Ze(n) {
165
- if (n.ctx.length > 32) {
166
- const e = [], t = n.ctx.length / 32;
167
- for (let s = 0; s < t; s++)
168
- e[s] = -1;
164
+ function Ke(s) {
165
+ if (s.ctx.length > 32) {
166
+ const e = [], t = s.ctx.length / 32;
167
+ for (let n = 0; n < t; n++)
168
+ e[n] = -1;
169
169
  return e;
170
170
  }
171
171
  return -1;
172
172
  }
173
- function ie(n) {
174
- return n == null ? "" : n;
173
+ function de(s) {
174
+ return s == null ? "" : s;
175
175
  }
176
- function x(n, e) {
177
- n.appendChild(e);
176
+ function B(s, e) {
177
+ s.appendChild(e);
178
178
  }
179
- function Q(n, e, t) {
180
- n.insertBefore(e, t || null);
179
+ function q(s, e, t) {
180
+ s.insertBefore(e, t || null);
181
181
  }
182
- function U(n) {
183
- n.parentNode && n.parentNode.removeChild(n);
182
+ function V(s) {
183
+ s.parentNode && s.parentNode.removeChild(s);
184
184
  }
185
- function Ve(n, e) {
186
- for (let t = 0; t < n.length; t += 1)
187
- n[t] && n[t].d(e);
185
+ function Ie(s, e) {
186
+ for (let t = 0; t < s.length; t += 1)
187
+ s[t] && s[t].d(e);
188
188
  }
189
- function I(n) {
190
- return document.createElement(n);
189
+ function _(s) {
190
+ return document.createElement(s);
191
191
  }
192
- function A(n) {
193
- return document.createTextNode(n);
192
+ function L(s) {
193
+ return document.createTextNode(s);
194
194
  }
195
- function N() {
196
- return A(" ");
195
+ function j() {
196
+ return L(" ");
197
197
  }
198
- function Re() {
199
- return A("");
198
+ function Ye() {
199
+ return L("");
200
200
  }
201
- function F(n, e, t, s) {
202
- return n.addEventListener(e, t, s), () => n.removeEventListener(e, t, s);
201
+ function F(s, e, t, n) {
202
+ return s.addEventListener(e, t, n), () => s.removeEventListener(e, t, n);
203
203
  }
204
- function S(n, e, t) {
205
- t == null ? n.removeAttribute(e) : n.getAttribute(e) !== t && n.setAttribute(e, t);
204
+ function D(s, e, t) {
205
+ t == null ? s.removeAttribute(e) : s.getAttribute(e) !== t && s.setAttribute(e, t);
206
206
  }
207
- function Ue(n) {
208
- return Array.from(n.childNodes);
207
+ function Re(s) {
208
+ return Array.from(s.childNodes);
209
209
  }
210
- function H(n, e) {
211
- e = "" + e, n.data !== e && (n.data = /** @type {string} */
210
+ function U(s, e) {
211
+ e = "" + e, s.data !== e && (s.data = /** @type {string} */
212
212
  e);
213
213
  }
214
- function ce(n, e, t, s) {
215
- t == null ? n.style.removeProperty(e) : n.style.setProperty(e, t, "");
214
+ function Q(s, e, t, n) {
215
+ t == null ? s.style.removeProperty(e) : s.style.setProperty(e, t, "");
216
216
  }
217
- let X;
218
- function O(n) {
219
- X = n;
217
+ let ne;
218
+ function O(s) {
219
+ ne = s;
220
220
  }
221
- const P = [], le = [];
222
- let M = [];
223
- const ue = [], Je = /* @__PURE__ */ Promise.resolve();
224
- let q = !1;
225
- function ze() {
226
- q || (q = !0, Je.then(Ce));
221
+ const $ = [], he = [];
222
+ let T = [];
223
+ const ge = [], Xe = /* @__PURE__ */ Promise.resolve();
224
+ let ee = !1;
225
+ function et() {
226
+ ee || (ee = !0, Xe.then(Ee));
227
227
  }
228
- function K(n) {
229
- M.push(n);
228
+ function te(s) {
229
+ T.push(s);
230
230
  }
231
- const z = /* @__PURE__ */ new Set();
232
- let L = 0;
233
- function Ce() {
234
- if (L !== 0)
231
+ const R = /* @__PURE__ */ new Set();
232
+ let P = 0;
233
+ function Ee() {
234
+ if (P !== 0)
235
235
  return;
236
- const n = X;
236
+ const s = ne;
237
237
  do {
238
238
  try {
239
- for (; L < P.length; ) {
240
- const e = P[L];
241
- L++, O(e), We(e.$$);
239
+ for (; P < $.length; ) {
240
+ const e = $[P];
241
+ P++, O(e), tt(e.$$);
242
242
  }
243
243
  } catch (e) {
244
- throw P.length = 0, L = 0, e;
244
+ throw $.length = 0, P = 0, e;
245
245
  }
246
- for (O(null), P.length = 0, L = 0; le.length; ) le.pop()();
247
- for (let e = 0; e < M.length; e += 1) {
248
- const t = M[e];
249
- z.has(t) || (z.add(t), t());
246
+ for (O(null), $.length = 0, P = 0; he.length; ) he.pop()();
247
+ for (let e = 0; e < T.length; e += 1) {
248
+ const t = T[e];
249
+ R.has(t) || (R.add(t), t());
250
250
  }
251
- M.length = 0;
252
- } while (P.length);
253
- for (; ue.length; )
254
- ue.pop()();
255
- q = !1, z.clear(), O(n);
251
+ T.length = 0;
252
+ } while ($.length);
253
+ for (; ge.length; )
254
+ ge.pop()();
255
+ ee = !1, R.clear(), O(s);
256
256
  }
257
- function We(n) {
258
- if (n.fragment !== null) {
259
- n.update(), V(n.before_update);
260
- const e = n.dirty;
261
- n.dirty = [-1], n.fragment && n.fragment.p(n.ctx, e), n.after_update.forEach(K);
257
+ function tt(s) {
258
+ if (s.fragment !== null) {
259
+ s.update(), Z(s.before_update);
260
+ const e = s.dirty;
261
+ s.dirty = [-1], s.fragment && s.fragment.p(s.ctx, e), s.after_update.forEach(te);
262
262
  }
263
263
  }
264
- function qe(n) {
264
+ function nt(s) {
265
265
  const e = [], t = [];
266
- M.forEach((s) => n.indexOf(s) === -1 ? e.push(s) : t.push(s)), t.forEach((s) => s()), M = e;
266
+ T.forEach((n) => s.indexOf(n) === -1 ? e.push(n) : t.push(n)), t.forEach((n) => n()), T = e;
267
267
  }
268
- const R = /* @__PURE__ */ new Set();
269
- let Ke;
270
- function Y(n, e) {
271
- n && n.i && (R.delete(n), n.i(e));
268
+ const z = /* @__PURE__ */ new Set();
269
+ let st;
270
+ function se(s, e) {
271
+ s && s.i && (z.delete(s), s.i(e));
272
272
  }
273
- function ve(n, e, t, s) {
274
- if (n && n.o) {
275
- if (R.has(n)) return;
276
- R.add(n), Ke.c.push(() => {
277
- R.delete(n);
278
- }), n.o(e);
273
+ function Be(s, e, t, n) {
274
+ if (s && s.o) {
275
+ if (z.has(s)) return;
276
+ z.add(s), st.c.push(() => {
277
+ z.delete(s);
278
+ }), s.o(e);
279
279
  }
280
280
  }
281
- function de(n) {
282
- return (n == null ? void 0 : n.length) !== void 0 ? n : Array.from(n);
281
+ function W(s) {
282
+ return (s == null ? void 0 : s.length) !== void 0 ? s : Array.from(s);
283
283
  }
284
- function Qe(n) {
285
- n && n.c();
284
+ function rt(s) {
285
+ s && s.c();
286
286
  }
287
- function we(n, e, t) {
288
- const { fragment: s, after_update: r } = n.$$;
289
- s && s.m(e, t), K(() => {
290
- const a = n.$$.on_mount.map(fe).filter(j);
291
- n.$$.on_destroy ? n.$$.on_destroy.push(...a) : V(a), n.$$.on_mount = [];
292
- }), r.forEach(K);
287
+ function Ae(s, e, t) {
288
+ const { fragment: n, after_update: r } = s.$$;
289
+ n && n.m(e, t), te(() => {
290
+ const a = s.$$.on_mount.map(pe).filter(G);
291
+ s.$$.on_destroy ? s.$$.on_destroy.push(...a) : Z(a), s.$$.on_mount = [];
292
+ }), r.forEach(te);
293
293
  }
294
- function ke(n, e) {
295
- const t = n.$$;
296
- t.fragment !== null && (qe(t.after_update), V(t.on_destroy), t.fragment && t.fragment.d(e), t.on_destroy = t.fragment = null, t.ctx = []);
294
+ function De(s, e) {
295
+ const t = s.$$;
296
+ t.fragment !== null && (nt(t.after_update), Z(t.on_destroy), t.fragment && t.fragment.d(e), t.on_destroy = t.fragment = null, t.ctx = []);
297
297
  }
298
- function Xe(n, e) {
299
- n.$$.dirty[0] === -1 && (P.push(n), ze(), n.$$.dirty.fill(0)), n.$$.dirty[e / 31 | 0] |= 1 << e % 31;
298
+ function at(s, e) {
299
+ s.$$.dirty[0] === -1 && ($.push(s), et(), s.$$.dirty.fill(0)), s.$$.dirty[e / 31 | 0] |= 1 << e % 31;
300
300
  }
301
- function be(n, e, t, s, r, a, o = null, u = [-1]) {
302
- const d = X;
303
- O(n);
304
- const h = n.$$ = {
301
+ function be(s, e, t, n, r, a, i = null, c = [-1]) {
302
+ const d = ne;
303
+ O(s);
304
+ const u = s.$$ = {
305
305
  fragment: null,
306
306
  ctx: [],
307
307
  // state
308
308
  props: a,
309
- update: W,
309
+ update: X,
310
310
  not_equal: r,
311
- bound: oe(),
311
+ bound: ue(),
312
312
  // lifecycle
313
313
  on_mount: [],
314
314
  on_destroy: [],
@@ -317,33 +317,33 @@ function be(n, e, t, s, r, a, o = null, u = [-1]) {
317
317
  after_update: [],
318
318
  context: new Map(e.context || (d ? d.$$.context : [])),
319
319
  // everything else
320
- callbacks: oe(),
321
- dirty: u,
320
+ callbacks: ue(),
321
+ dirty: c,
322
322
  skip_bound: !1,
323
323
  root: e.target || d.$$.root
324
324
  };
325
- o && o(h.root);
326
- let f = !1;
327
- if (h.ctx = t ? t(n, e.props || {}, (C, p, ...y) => {
328
- const c = y.length ? y[0] : p;
329
- return h.ctx && r(h.ctx[C], h.ctx[C] = c) && (!h.skip_bound && h.bound[C] && h.bound[C](c), f && Xe(n, C)), p;
330
- }) : [], h.update(), f = !0, V(h.before_update), h.fragment = s ? s(h.ctx) : !1, e.target) {
325
+ i && i(u.root);
326
+ let C = !1;
327
+ if (u.ctx = t ? t(s, e.props || {}, (g, m, ...h) => {
328
+ const f = h.length ? h[0] : m;
329
+ return u.ctx && r(u.ctx[g], u.ctx[g] = f) && (!u.skip_bound && u.bound[g] && u.bound[g](f), C && at(s, g)), m;
330
+ }) : [], u.update(), C = !0, Z(u.before_update), u.fragment = n ? n(u.ctx) : !1, e.target) {
331
331
  if (e.hydrate) {
332
- const C = Ue(e.target);
333
- h.fragment && h.fragment.l(C), C.forEach(U);
332
+ const g = Re(e.target);
333
+ u.fragment && u.fragment.l(g), g.forEach(V);
334
334
  } else
335
- h.fragment && h.fragment.c();
336
- e.intro && Y(n.$$.fragment), we(n, e.target, e.anchor), Ce();
335
+ u.fragment && u.fragment.c();
336
+ e.intro && se(s.$$.fragment), Ae(s, e.target, e.anchor), Ee();
337
337
  }
338
338
  O(d);
339
339
  }
340
- class De {
340
+ class _e {
341
341
  constructor() {
342
- ae(this, "$$"), ae(this, "$$set");
342
+ le(this, "$$"), le(this, "$$set");
343
343
  }
344
344
  /** @returns {void} */
345
345
  $destroy() {
346
- ke(this, 1), this.$destroy = W;
346
+ De(this, 1), this.$destroy = X;
347
347
  }
348
348
  /**
349
349
  * @template {Extract<keyof Events, string>} K
@@ -352,12 +352,12 @@ class De {
352
352
  * @returns {() => void}
353
353
  */
354
354
  $on(e, t) {
355
- if (!j(t))
356
- return W;
357
- const s = this.$$.callbacks[e] || (this.$$.callbacks[e] = []);
358
- return s.push(t), () => {
359
- const r = s.indexOf(t);
360
- r !== -1 && s.splice(r, 1);
355
+ if (!G(t))
356
+ return X;
357
+ const n = this.$$.callbacks[e] || (this.$$.callbacks[e] = []);
358
+ return n.push(t), () => {
359
+ const r = n.indexOf(t);
360
+ r !== -1 && n.splice(r, 1);
361
361
  };
362
362
  }
363
363
  /**
@@ -365,118 +365,118 @@ class De {
365
365
  * @returns {void}
366
366
  */
367
367
  $set(e) {
368
- this.$$set && !Fe(e) && (this.$$.skip_bound = !0, this.$$set(e), this.$$.skip_bound = !1);
368
+ this.$$set && !Je(e) && (this.$$.skip_bound = !0, this.$$set(e), this.$$.skip_bound = !1);
369
369
  }
370
370
  }
371
- const Ye = "4";
372
- typeof window != "undefined" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(Ye);
373
- function et(n) {
374
- let e, t, s, r = (
371
+ const it = "4";
372
+ typeof window != "undefined" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(it);
373
+ function ot(s) {
374
+ let e, t, n, r = (
375
375
  /*title*/
376
- (n[1] || "标题") + ""
377
- ), a, o, u, d, h, f, C = (
376
+ (s[1] || "标题") + ""
377
+ ), a, i, c, d, u, C, g = (
378
378
  /*cancelText*/
379
- (n[4] || "取消") + ""
380
- ), p, y, c, g = (
379
+ (s[4] || "取消") + ""
380
+ ), m, h, f, w = (
381
381
  /*okText*/
382
- (n[5] || "确认") + ""
383
- ), w, m, v, b;
384
- const E = (
382
+ (s[5] || "确认") + ""
383
+ ), y, p, v, I;
384
+ const b = (
385
385
  /*#slots*/
386
- n[8].default
387
- ), k = je(
388
- E,
389
- n,
386
+ s[8].default
387
+ ), k = Qe(
388
+ b,
389
+ s,
390
390
  /*$$scope*/
391
- n[7],
391
+ s[7],
392
392
  null
393
393
  );
394
394
  return {
395
395
  c() {
396
- e = I("div"), t = I("div"), s = I("div"), a = A(r), o = N(), u = I("div"), k && k.c(), d = N(), h = I("div"), f = I("button"), p = A(C), y = N(), c = I("button"), w = A(g), S(s, "class", "model-title svelte-oivou"), S(u, "class", "slot svelte-oivou"), S(f, "class", "modal-btn svelte-oivou"), S(c, "class", "modal-btn success svelte-oivou"), ce(
397
- c,
396
+ e = _("div"), t = _("div"), n = _("div"), a = L(r), i = j(), c = _("div"), k && k.c(), d = j(), u = _("div"), C = _("button"), m = L(g), h = j(), f = _("button"), y = L(w), D(n, "class", "model-title svelte-16iv9d0"), D(c, "class", "slot svelte-16iv9d0"), D(C, "class", "modal-btn svelte-16iv9d0"), D(f, "class", "modal-btn success svelte-16iv9d0"), Q(
397
+ f,
398
398
  "background-color",
399
399
  /*theme*/
400
- n[6]
401
- ), S(h, "class", "modal-footer svelte-oivou"), S(t, "class", "modal-content svelte-oivou"), S(e, "class", "modal-background modal-visible svelte-oivou");
400
+ s[6]
401
+ ), D(u, "class", "modal-footer svelte-16iv9d0"), D(t, "class", "modal-content svelte-16iv9d0"), D(e, "class", "modal-background modal-visible svelte-16iv9d0");
402
402
  },
403
- m($, _) {
404
- Q($, e, _), x(e, t), x(t, s), x(s, a), x(t, o), x(t, u), k && k.m(u, null), x(t, d), x(t, h), x(h, f), x(f, p), x(h, y), x(h, c), x(c, w), m = !0, v || (b = [
405
- F(f, "click", function() {
406
- j(
403
+ m(A, x) {
404
+ q(A, e, x), B(e, t), B(t, n), B(n, a), B(t, i), B(t, c), k && k.m(c, null), B(t, d), B(t, u), B(u, C), B(C, m), B(u, h), B(u, f), B(f, y), p = !0, v || (I = [
405
+ F(C, "click", function() {
406
+ G(
407
407
  /*onCancel*/
408
- n[0]
409
- ) && n[0].apply(this, arguments);
408
+ s[0]
409
+ ) && s[0].apply(this, arguments);
410
410
  }),
411
- F(c, "click", function() {
412
- j(
411
+ F(f, "click", function() {
412
+ G(
413
413
  /*onOk*/
414
- n[2]
415
- ) && n[2].apply(this, arguments);
414
+ s[2]
415
+ ) && s[2].apply(this, arguments);
416
416
  }),
417
- F(t, "click", tt),
417
+ F(t, "click", ct),
418
418
  F(e, "click", function() {
419
- j(
419
+ G(
420
420
  /*onClose*/
421
- n[3]
422
- ) && n[3].apply(this, arguments);
421
+ s[3]
422
+ ) && s[3].apply(this, arguments);
423
423
  })
424
424
  ], v = !0);
425
425
  },
426
- p($, [_]) {
427
- n = $, (!m || _ & /*title*/
426
+ p(A, [x]) {
427
+ s = A, (!p || x & /*title*/
428
428
  2) && r !== (r = /*title*/
429
- (n[1] || "标题") + "") && H(a, r), k && k.p && (!m || _ & /*$$scope*/
430
- 128) && Oe(
429
+ (s[1] || "标题") + "") && U(a, r), k && k.p && (!p || x & /*$$scope*/
430
+ 128) && qe(
431
431
  k,
432
- E,
433
- n,
432
+ b,
433
+ s,
434
434
  /*$$scope*/
435
- n[7],
436
- m ? Ne(
437
- E,
435
+ s[7],
436
+ p ? We(
437
+ b,
438
438
  /*$$scope*/
439
- n[7],
440
- _,
439
+ s[7],
440
+ x,
441
441
  null
442
- ) : Ze(
442
+ ) : Ke(
443
443
  /*$$scope*/
444
- n[7]
444
+ s[7]
445
445
  ),
446
446
  null
447
- ), (!m || _ & /*cancelText*/
448
- 16) && C !== (C = /*cancelText*/
449
- (n[4] || "取消") + "") && H(p, C), (!m || _ & /*okText*/
450
- 32) && g !== (g = /*okText*/
451
- (n[5] || "确认") + "") && H(w, g), (!m || _ & /*theme*/
452
- 64) && ce(
453
- c,
447
+ ), (!p || x & /*cancelText*/
448
+ 16) && g !== (g = /*cancelText*/
449
+ (s[4] || "取消") + "") && U(m, g), (!p || x & /*okText*/
450
+ 32) && w !== (w = /*okText*/
451
+ (s[5] || "确认") + "") && U(y, w), (!p || x & /*theme*/
452
+ 64) && Q(
453
+ f,
454
454
  "background-color",
455
455
  /*theme*/
456
- n[6]
456
+ s[6]
457
457
  );
458
458
  },
459
- i($) {
460
- m || (Y(k, $), m = !0);
459
+ i(A) {
460
+ p || (se(k, A), p = !0);
461
461
  },
462
- o($) {
463
- ve(k, $), m = !1;
462
+ o(A) {
463
+ Be(k, A), p = !1;
464
464
  },
465
- d($) {
466
- $ && U(e), k && k.d($), v = !1, V(b);
465
+ d(A) {
466
+ A && V(e), k && k.d(A), v = !1, Z(I);
467
467
  }
468
468
  };
469
469
  }
470
- const tt = (n) => n.stopPropagation();
471
- function nt(n, e, t) {
472
- let { $$slots: s = {}, $$scope: r } = e, { onCancel: a } = e, { title: o } = e, { onOk: u } = e, { onClose: d } = e, { cancelText: h } = e, { okText: f } = e, { theme: C } = e;
473
- return n.$$set = (p) => {
474
- "onCancel" in p && t(0, a = p.onCancel), "title" in p && t(1, o = p.title), "onOk" in p && t(2, u = p.onOk), "onClose" in p && t(3, d = p.onClose), "cancelText" in p && t(4, h = p.cancelText), "okText" in p && t(5, f = p.okText), "theme" in p && t(6, C = p.theme), "$$scope" in p && t(7, r = p.$$scope);
475
- }, [a, o, u, d, h, f, C, r, s];
470
+ const ct = (s) => s.stopPropagation();
471
+ function lt(s, e, t) {
472
+ let { $$slots: n = {}, $$scope: r } = e, { onCancel: a } = e, { title: i } = e, { onOk: c } = e, { onClose: d } = e, { cancelText: u } = e, { okText: C } = e, { theme: g } = e;
473
+ return s.$$set = (m) => {
474
+ "onCancel" in m && t(0, a = m.onCancel), "title" in m && t(1, i = m.title), "onOk" in m && t(2, c = m.onOk), "onClose" in m && t(3, d = m.onClose), "cancelText" in m && t(4, u = m.cancelText), "okText" in m && t(5, C = m.okText), "theme" in m && t(6, g = m.theme), "$$scope" in m && t(7, r = m.$$scope);
475
+ }, [a, i, c, d, u, C, g, r, n];
476
476
  }
477
- class st extends De {
477
+ class ut extends _e {
478
478
  constructor(e) {
479
- super(), be(this, e, nt, et, pe, {
479
+ super(), be(this, e, lt, ot, ke, {
480
480
  onCancel: 0,
481
481
  title: 1,
482
482
  onOk: 2,
@@ -487,206 +487,279 @@ class st extends De {
487
487
  });
488
488
  }
489
489
  }
490
- function he(n, e, t) {
491
- const s = n.slice();
492
- return s[11] = e[t], s[13] = t, s;
490
+ function ye(s, e, t) {
491
+ const n = s.slice();
492
+ return n[13] = e[t], n[15] = t, n;
493
493
  }
494
- function ye(n) {
495
- let e, t, s = (
496
- /*item*/
497
- n[11].CN + ""
498
- ), r, a, o, u = (
499
- /*item*/
500
- n[11].DevClass + ""
501
- ), d, h, f = (
502
- /*item*/
503
- n[11].sn + ""
504
- ), C, p, y, c, g, w;
505
- function m() {
494
+ function fe(s, e, t) {
495
+ const n = s.slice();
496
+ return n[16] = e[t], n;
497
+ }
498
+ function Ce(s) {
499
+ let e, t = (
500
+ /*col*/
501
+ (s[16].format ? (
502
+ /*col*/
503
+ s[16].format(
504
+ /*row*/
505
+ s[13]
506
+ )
507
+ ) : (
508
+ /*row*/
509
+ s[13][
510
+ /*col*/
511
+ s[16].key
512
+ ]
513
+ )) + ""
514
+ ), n;
515
+ return {
516
+ c() {
517
+ e = _("div"), n = L(t), D(e, "class", "svelte-1kh75ag"), Q(e, "width", `${100 / /*columns*/
518
+ s[1].length}%`);
519
+ },
520
+ m(r, a) {
521
+ q(r, e, a), B(e, n);
522
+ },
523
+ p(r, a) {
524
+ a & /*columns, data*/
525
+ 3 && t !== (t = /*col*/
526
+ (r[16].format ? (
527
+ /*col*/
528
+ r[16].format(
529
+ /*row*/
530
+ r[13]
531
+ )
532
+ ) : (
533
+ /*row*/
534
+ r[13][
535
+ /*col*/
536
+ r[16].key
537
+ ]
538
+ )) + "") && U(n, t), a & /*columns*/
539
+ 2 && Q(e, "width", `${100 / /*columns*/
540
+ r[1].length}%`);
541
+ },
542
+ d(r) {
543
+ r && V(e);
544
+ }
545
+ };
546
+ }
547
+ function me(s) {
548
+ let e, t, n, r, a, i = W(
549
+ /*columns*/
550
+ s[1]
551
+ ), c = [];
552
+ for (let u = 0; u < i.length; u += 1)
553
+ c[u] = Ce(fe(s, i, u));
554
+ function d() {
506
555
  return (
507
556
  /*click_handler*/
508
- n[10](
557
+ s[12](
509
558
  /*index*/
510
- n[13]
559
+ s[15]
511
560
  )
512
561
  );
513
562
  }
514
563
  return {
515
564
  c() {
516
- e = I("div"), t = I("span"), r = A(s), a = N(), o = I("span"), d = A(u), h = A("("), C = A(f), p = A(")"), y = N(), S(t, "class", "svelte-jtc2v4"), S(o, "class", "svelte-jtc2v4"), S(e, "class", c = ie(`cert-item ${/*index*/
517
- n[13] === 0 ? "cert-item-first" : ""} ${/*index*/
518
- n[13] === /*selectedIndex*/
519
- n[5] ? "cert-item-selected" : ""}`) + " svelte-jtc2v4");
565
+ e = _("div");
566
+ for (let u = 0; u < c.length; u += 1)
567
+ c[u].c();
568
+ t = j(), D(e, "class", n = de(`cert-item ${/*index*/
569
+ s[15] === 0 ? "cert-item-first" : ""} ${/*index*/
570
+ s[15] === /*selectedIndex*/
571
+ s[7] ? "cert-item-selected" : ""}`) + " svelte-1kh75ag");
520
572
  },
521
- m(v, b) {
522
- Q(v, e, b), x(e, t), x(t, r), x(e, a), x(e, o), x(o, d), x(o, h), x(o, C), x(o, p), x(e, y), g || (w = F(e, "click", m), g = !0);
573
+ m(u, C) {
574
+ q(u, e, C);
575
+ for (let g = 0; g < c.length; g += 1)
576
+ c[g] && c[g].m(e, null);
577
+ B(e, t), r || (a = F(e, "click", d), r = !0);
523
578
  },
524
- p(v, b) {
525
- n = v, b & /*certList*/
526
- 1 && s !== (s = /*item*/
527
- n[11].CN + "") && H(r, s), b & /*certList*/
528
- 1 && u !== (u = /*item*/
529
- n[11].DevClass + "") && H(d, u), b & /*certList*/
530
- 1 && f !== (f = /*item*/
531
- n[11].sn + "") && H(C, f), b & /*selectedIndex*/
532
- 32 && c !== (c = ie(`cert-item ${/*index*/
533
- n[13] === 0 ? "cert-item-first" : ""} ${/*index*/
534
- n[13] === /*selectedIndex*/
535
- n[5] ? "cert-item-selected" : ""}`) + " svelte-jtc2v4") && S(e, "class", c);
579
+ p(u, C) {
580
+ if (s = u, C & /*columns, data*/
581
+ 3) {
582
+ i = W(
583
+ /*columns*/
584
+ s[1]
585
+ );
586
+ let g;
587
+ for (g = 0; g < i.length; g += 1) {
588
+ const m = fe(s, i, g);
589
+ c[g] ? c[g].p(m, C) : (c[g] = Ce(m), c[g].c(), c[g].m(e, t));
590
+ }
591
+ for (; g < c.length; g += 1)
592
+ c[g].d(1);
593
+ c.length = i.length;
594
+ }
595
+ C & /*selectedIndex*/
596
+ 128 && n !== (n = de(`cert-item ${/*index*/
597
+ s[15] === 0 ? "cert-item-first" : ""} ${/*index*/
598
+ s[15] === /*selectedIndex*/
599
+ s[7] ? "cert-item-selected" : ""}`) + " svelte-1kh75ag") && D(e, "class", n);
536
600
  },
537
- d(v) {
538
- v && U(e), g = !1, w();
601
+ d(u) {
602
+ u && V(e), Ie(c, u), r = !1, a();
539
603
  }
540
604
  };
541
605
  }
542
- function rt(n) {
543
- let e, t = de(
544
- /*certList*/
545
- n[0]
546
- ), s = [];
606
+ function dt(s) {
607
+ let e, t = W(
608
+ /*data*/
609
+ s[0]
610
+ ), n = [];
547
611
  for (let r = 0; r < t.length; r += 1)
548
- s[r] = ye(he(n, t, r));
612
+ n[r] = me(ye(s, t, r));
549
613
  return {
550
614
  c() {
551
- for (let r = 0; r < s.length; r += 1)
552
- s[r].c();
553
- e = Re();
615
+ for (let r = 0; r < n.length; r += 1)
616
+ n[r].c();
617
+ e = Ye();
554
618
  },
555
619
  m(r, a) {
556
- for (let o = 0; o < s.length; o += 1)
557
- s[o] && s[o].m(r, a);
558
- Q(r, e, a);
620
+ for (let i = 0; i < n.length; i += 1)
621
+ n[i] && n[i].m(r, a);
622
+ q(r, e, a);
559
623
  },
560
624
  p(r, a) {
561
- if (a & /*selectedIndex, certList*/
562
- 33) {
563
- t = de(
564
- /*certList*/
625
+ if (a & /*selectedIndex, columns, data*/
626
+ 131) {
627
+ t = W(
628
+ /*data*/
565
629
  r[0]
566
630
  );
567
- let o;
568
- for (o = 0; o < t.length; o += 1) {
569
- const u = he(r, t, o);
570
- s[o] ? s[o].p(u, a) : (s[o] = ye(u), s[o].c(), s[o].m(e.parentNode, e));
631
+ let i;
632
+ for (i = 0; i < t.length; i += 1) {
633
+ const c = ye(r, t, i);
634
+ n[i] ? n[i].p(c, a) : (n[i] = me(c), n[i].c(), n[i].m(e.parentNode, e));
571
635
  }
572
- for (; o < s.length; o += 1)
573
- s[o].d(1);
574
- s.length = t.length;
636
+ for (; i < n.length; i += 1)
637
+ n[i].d(1);
638
+ n.length = t.length;
575
639
  }
576
640
  },
577
641
  d(r) {
578
- r && U(e), Ve(s, r);
642
+ r && V(e), Ie(n, r);
579
643
  }
580
644
  };
581
645
  }
582
- function at(n) {
646
+ function ht(s) {
583
647
  let e, t;
584
- return e = new st({
648
+ return e = new ut({
585
649
  props: {
586
650
  onOk: (
587
651
  /*handleOk*/
588
- n[7]
652
+ s[9]
589
653
  ),
590
654
  onClose: (
591
655
  /*onClose*/
592
- n[1]
656
+ s[2]
593
657
  ),
594
658
  onCancel: (
595
659
  /*handleCancel*/
596
- n[6]
660
+ s[8]
597
661
  ),
598
662
  cancelText: (
599
663
  /*cancelText*/
600
- n[2]
664
+ s[3]
601
665
  ),
602
666
  okText: (
603
667
  /*okText*/
604
- n[3]
668
+ s[4]
669
+ ),
670
+ title: (
671
+ /*title*/
672
+ s[6]
605
673
  ),
606
- title: "选择证书",
607
674
  theme: (
608
675
  /*theme*/
609
- n[4]
676
+ s[5]
610
677
  ),
611
- $$slots: { default: [rt] },
612
- $$scope: { ctx: n }
678
+ $$slots: { default: [dt] },
679
+ $$scope: { ctx: s }
613
680
  }
614
681
  }), {
615
682
  c() {
616
- Qe(e.$$.fragment);
683
+ rt(e.$$.fragment);
617
684
  },
618
- m(s, r) {
619
- we(e, s, r), t = !0;
685
+ m(n, r) {
686
+ Ae(e, n, r), t = !0;
620
687
  },
621
- p(s, [r]) {
688
+ p(n, [r]) {
622
689
  const a = {};
623
690
  r & /*onClose*/
624
- 2 && (a.onClose = /*onClose*/
625
- s[1]), r & /*cancelText*/
626
- 4 && (a.cancelText = /*cancelText*/
627
- s[2]), r & /*okText*/
628
- 8 && (a.okText = /*okText*/
629
- s[3]), r & /*theme*/
630
- 16 && (a.theme = /*theme*/
631
- s[4]), r & /*$$scope, certList, selectedIndex*/
632
- 16417 && (a.$$scope = { dirty: r, ctx: s }), e.$set(a);
691
+ 4 && (a.onClose = /*onClose*/
692
+ n[2]), r & /*cancelText*/
693
+ 8 && (a.cancelText = /*cancelText*/
694
+ n[3]), r & /*okText*/
695
+ 16 && (a.okText = /*okText*/
696
+ n[4]), r & /*title*/
697
+ 64 && (a.title = /*title*/
698
+ n[6]), r & /*theme*/
699
+ 32 && (a.theme = /*theme*/
700
+ n[5]), r & /*$$scope, data, selectedIndex, columns*/
701
+ 524419 && (a.$$scope = { dirty: r, ctx: n }), e.$set(a);
633
702
  },
634
- i(s) {
635
- t || (Y(e.$$.fragment, s), t = !0);
703
+ i(n) {
704
+ t || (se(e.$$.fragment, n), t = !0);
636
705
  },
637
- o(s) {
638
- ve(e.$$.fragment, s), t = !1;
706
+ o(n) {
707
+ Be(e.$$.fragment, n), t = !1;
639
708
  },
640
- d(s) {
641
- ke(e, s);
709
+ d(n) {
710
+ De(e, n);
642
711
  }
643
712
  };
644
713
  }
645
- function ot(n, e, t) {
646
- let { certList: s = [] } = e, { onCancel: r } = e, { onOk: a } = e, { onClose: o } = e, { cancelText: u = "" } = e, { okText: d = "" } = e, { theme: h = "#409eff" } = e, f = 0;
647
- const C = () => {
648
- r("未选择证书"), o == null || o();
649
- }, p = () => {
650
- a == null || a(s[f]), o == null || o();
651
- }, y = (c) => t(5, f = c);
652
- return n.$$set = (c) => {
653
- "certList" in c && t(0, s = c.certList), "onCancel" in c && t(8, r = c.onCancel), "onOk" in c && t(9, a = c.onOk), "onClose" in c && t(1, o = c.onClose), "cancelText" in c && t(2, u = c.cancelText), "okText" in c && t(3, d = c.okText), "theme" in c && t(4, h = c.theme);
714
+ function gt(s, e, t) {
715
+ let { data: n = [] } = e, { columns: r = [] } = e, { onCancel: a } = e, { onOk: i } = e, { onClose: c } = e, { cancelText: d = "" } = e, { okText: u = "" } = e, { theme: C = "#409eff" } = e, { title: g = "" } = e, m = 0;
716
+ const h = () => {
717
+ a(`${g}失败`), c == null || c();
718
+ }, f = () => {
719
+ i == null || i(n[m]), c == null || c();
720
+ }, w = (y) => t(7, m = y);
721
+ return s.$$set = (y) => {
722
+ "data" in y && t(0, n = y.data), "columns" in y && t(1, r = y.columns), "onCancel" in y && t(10, a = y.onCancel), "onOk" in y && t(11, i = y.onOk), "onClose" in y && t(2, c = y.onClose), "cancelText" in y && t(3, d = y.cancelText), "okText" in y && t(4, u = y.okText), "theme" in y && t(5, C = y.theme), "title" in y && t(6, g = y.title);
654
723
  }, [
655
- s,
656
- o,
657
- u,
724
+ n,
725
+ r,
726
+ c,
658
727
  d,
728
+ u,
729
+ C,
730
+ g,
731
+ m,
659
732
  h,
660
733
  f,
661
- C,
662
- p,
663
- r,
664
734
  a,
665
- y
735
+ i,
736
+ w
666
737
  ];
667
738
  }
668
- class it extends De {
739
+ class yt extends _e {
669
740
  constructor(e) {
670
- super(), be(this, e, ot, at, pe, {
671
- certList: 0,
672
- onCancel: 8,
673
- onOk: 9,
674
- onClose: 1,
675
- cancelText: 2,
676
- okText: 3,
677
- theme: 4
741
+ super(), be(this, e, gt, ht, ke, {
742
+ data: 0,
743
+ columns: 1,
744
+ onCancel: 10,
745
+ onOk: 11,
746
+ onClose: 2,
747
+ cancelText: 3,
748
+ okText: 4,
749
+ theme: 5,
750
+ title: 6
678
751
  });
679
752
  }
680
753
  }
681
- class ct {
754
+ class ft {
682
755
  constructor() {
683
- i(this, "modalInstance", { current: null });
684
- i(this, "open", (e) => new Promise((t, s) => {
685
- this.modalInstance.current = new it({
756
+ o(this, "modalInstance", { current: null });
757
+ o(this, "open", (e) => new Promise((t, n) => {
758
+ this.modalInstance.current = new yt({
686
759
  target: document.body,
687
- props: B(D({}, e), {
760
+ props: E(S({}, e), {
688
761
  onCancel: (r) => {
689
- s({
762
+ n({
690
763
  code: -1,
691
764
  msg: r
692
765
  });
@@ -700,7 +773,7 @@ class ct {
700
773
  })
701
774
  });
702
775
  }));
703
- i(this, "close", () => {
776
+ o(this, "close", () => {
704
777
  setTimeout(() => {
705
778
  var e;
706
779
  (e = this.modalInstance.current) == null || e.$destroy();
@@ -708,77 +781,132 @@ class ct {
708
781
  });
709
782
  }
710
783
  }
711
- const lt = new ct();
712
- class ut {
784
+ const J = new ft();
785
+ function Ct(s = 32, e = !0, t = 0) {
786
+ const n = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""), r = [];
787
+ if (t = t || n.length, s)
788
+ for (let a = 0; a < s; a++) r[a] = n[0 | Math.random() * t];
789
+ else {
790
+ let a;
791
+ r[8] = r[13] = r[18] = r[23] = "-", r[14] = "4";
792
+ for (let i = 0; i < 36; i++)
793
+ r[i] || (a = 0 | Math.random() * 16, r[i] = n[i === 19 ? a & 3 | 8 : a]);
794
+ }
795
+ return e ? (r.shift(), `u${r.join("")}`) : r.join("");
796
+ }
797
+ const mt = [
798
+ {
799
+ key: "CN"
800
+ },
801
+ {
802
+ format: (s) => `${s.DevClass}(${s.sn})`
803
+ }
804
+ ], wt = [
805
+ {
806
+ key: "SealId"
807
+ },
808
+ {
809
+ key: "Vid"
810
+ },
811
+ {
812
+ format: (s) => `${s.FileName}(${s.FileSize}B)`
813
+ }
814
+ ], we = [
815
+ {
816
+ key: "SealId"
817
+ }
818
+ ];
819
+ class St {
713
820
  constructor(e) {
714
- i(this, "socketInstance", null);
715
- i(this, "eventBus", new Te());
716
- i(this, "isRememberPin", !1);
717
- i(this, "pinPolicy");
718
- i(this, "socketConfig", null);
719
- i(this, "getSocketReadyState", () => {
821
+ o(this, "socketInstance", null);
822
+ o(this, "eventBus", new Ve());
823
+ o(this, "isRememberPin", !1);
824
+ o(this, "pinPolicy");
825
+ o(this, "socketConfig", null);
826
+ o(this, "isConnecting", !1);
827
+ o(this, "messageQueue", []);
828
+ o(this, "getSocketReadyState", () => {
720
829
  var e;
721
830
  return (e = this.socketInstance) == null ? void 0 : e.readyState;
722
831
  });
723
- i(this, "destroy", () => {
832
+ o(this, "destroy", () => {
724
833
  var e;
725
834
  (e = this.socketInstance) == null || e.close();
726
835
  });
727
- i(this, "sendMessage", (e, t) => new Promise((s, r) => {
728
- var o, u;
729
- if (((o = this.socketInstance) == null ? void 0 : o.readyState) !== WebSocket.OPEN) {
730
- r({
731
- errCode: -1,
732
- msg: "数字证书客户端连接失败"
733
- });
836
+ o(this, "sendMessage", (e, t) => new Promise((n, r) => {
837
+ var i;
838
+ const a = () => {
839
+ var C, g;
840
+ if (((C = this.socketInstance) == null ? void 0 : C.readyState) !== WebSocket.OPEN) {
841
+ r({
842
+ errCode: Ge,
843
+ msg: "数字证书客户端连接失败"
844
+ });
845
+ return;
846
+ }
847
+ const c = Ct(), d = (m) => {
848
+ m.success ? n(m.data) : r(m);
849
+ }, u = {
850
+ function: e,
851
+ args: [t != null ? t : {}],
852
+ msgid: c
853
+ };
854
+ (g = this.socketInstance) == null || g.send(JSON.stringify(u)), this.eventBus.on(e, d), this.eventBus.on(c, d);
855
+ };
856
+ if (((i = this.socketInstance) == null ? void 0 : i.readyState) === WebSocket.OPEN) {
857
+ a();
734
858
  return;
735
859
  }
736
- const a = {
737
- function: e,
738
- args: [t != null ? t : {}]
739
- };
740
- (u = this.socketInstance) == null || u.send(JSON.stringify(a)), this.eventBus.on(e, (d) => {
741
- d.success ? s(d.data) : r(d);
742
- });
860
+ this.messageQueue.push(a), this.isConnecting || this.initSocket(this.socketConfig);
743
861
  }));
744
- i(this, "handleEventData", (e) => l(this, null, function* () {
745
- var t, s, r, a, o, u, d, h, f, C;
862
+ o(this, "flushMsgQueue", () => {
863
+ var e;
864
+ (e = this.messageQueue) == null || e.forEach((t) => t()), this.messageQueue = [];
865
+ });
866
+ o(this, "handleEventData", (e) => l(this, null, function* () {
867
+ var t, n, r, a, i, c, d, u;
746
868
  if (e.data instanceof Blob) {
747
- const p = yield e.data.arrayBuffer(), c = new TextDecoder("gbk").decode(p), g = JSON.parse(c), w = {
748
- success: (t = g.result) == null ? void 0 : t.success,
749
- msg: (s = g.result) == null ? void 0 : s.msg,
750
- errCode: (r = g.result) == null ? void 0 : r.errCode,
751
- data: g.data
752
- }, m = (a = g.result) == null ? void 0 : a.function;
753
- m === "GZCA_OnDeviceChange" ? (h = (o = this.socketConfig) == null ? void 0 : o.onUkeyChange) == null || h.call(o, B(D({}, w), {
754
- type: (u = g.result) == null ? void 0 : u.event,
755
- data: (d = g.data) == null ? void 0 : d[0]
756
- })) : this.eventBus.emit(m, w), (C = (f = this.socketConfig) == null ? void 0 : f.onMessage) == null || C.call(f, w);
869
+ const C = yield e.data.arrayBuffer(), m = new TextDecoder("gbk").decode(C), h = JSON.parse(m), f = {
870
+ success: (t = h.result) == null ? void 0 : t.success,
871
+ msg: (n = h.result) == null ? void 0 : n.msg,
872
+ errCode: (r = h.result) == null ? void 0 : r.errCode,
873
+ data: h.data,
874
+ type: (a = h.result) == null ? void 0 : a.event
875
+ }, w = (i = h.result) == null ? void 0 : i.function, y = (c = h.result) == null ? void 0 : c.msgid;
876
+ y ? this.eventBus.emit(y, f) : this.eventBus.emit(w, f), (u = (d = this.socketConfig) == null ? void 0 : d.onMessage) == null || u.call(d, f);
757
877
  }
758
878
  }));
759
- i(this, "base64Encode", (e) => {
879
+ o(this, "base64Encode", (e) => {
760
880
  const t = new TextEncoder().encode(e);
761
- return re.fromByteArray(t);
881
+ return ce.fromByteArray(t);
762
882
  });
763
- i(this, "base64Decode", (e) => {
764
- const t = re.toByteArray(e);
883
+ o(this, "base64Decode", (e) => {
884
+ const t = ce.toByteArray(e);
765
885
  return new TextDecoder().decode(t);
766
886
  });
767
- i(this, "changeIsRememberPin", (e) => l(this, null, function* () {
887
+ o(this, "changeIsRememberPin", (e) => l(this, null, function* () {
768
888
  this.isRememberPin = e;
769
889
  }));
770
- i(this, "changePinPolicy", (e) => l(this, null, function* () {
890
+ o(this, "changePinPolicy", (e) => l(this, null, function* () {
771
891
  this.pinPolicy = e;
772
892
  }));
773
- i(this, "checkCertIsLogin", (e) => l(this, null, function* () {
893
+ o(this, "checkCertIsLogin", (e) => l(this, null, function* () {
774
894
  return yield this.sendMessage("GZCA_IsLogin", e);
775
895
  }));
776
- i(this, "addUkeyEvents", () => l(this, null, function* () {
896
+ o(this, "addUkeyEvents", () => l(this, null, function* () {
777
897
  this.sendMessage("GZCA_WaitForDevEvent", {
778
- Type: Ee
779
- });
898
+ Type: Me
899
+ }), this.eventBus.on(
900
+ "GZCA_OnDeviceChange",
901
+ (e) => {
902
+ var t, n, r;
903
+ (r = (t = this.socketConfig) == null ? void 0 : t.onUkeyChange) == null || r.call(t, E(S({}, e), {
904
+ data: (n = e.data) == null ? void 0 : n[0]
905
+ }));
906
+ }
907
+ );
780
908
  }));
781
- i(this, "certLogin", (e) => l(this, null, function* () {
909
+ o(this, "certLogin", (e) => l(this, null, function* () {
782
910
  const t = yield this.checkCertIsLogin({
783
911
  ContainerName: e
784
912
  });
@@ -789,384 +917,567 @@ class ut {
789
917
  PinPolicy: this.pinPolicy
790
918
  }));
791
919
  }));
792
- i(this, "getCert", (e, t) => l(this, null, function* () {
793
- const s = t != null ? t : yield this.chooseCert(e);
794
- return this.isRememberPin && (yield this.certLogin(s.ContainerName)), s;
920
+ o(this, "getCert", (e, t, n) => l(this, null, function* () {
921
+ const r = t != null ? t : yield this.chooseCert(e);
922
+ return this.isRememberPin && n && (yield this.certLogin(r.ContainerName)), r;
795
923
  }));
796
- i(this, "chooseCert", (e) => l(this, null, function* () {
924
+ o(this, "chooseCert", (e) => l(this, null, function* () {
797
925
  var r;
798
926
  const t = yield this.getCertList(e);
799
- return (t == null ? void 0 : t.length) === 1 ? t[0] : yield lt.open({
800
- certList: t,
927
+ return t != null && t.length ? (t == null ? void 0 : t.length) === 1 ? t[0] : yield J.open({
928
+ title: "选择证书",
929
+ data: t,
930
+ columns: mt,
801
931
  theme: (r = this.socketConfig) == null ? void 0 : r.theme
932
+ }) : Promise.reject({
933
+ errCode: Fe,
934
+ msg: "暂无证书"
802
935
  });
803
936
  }));
804
- i(this, "getCertList", (e) => l(this, null, function* () {
937
+ o(this, "getCertList", (e) => l(this, null, function* () {
805
938
  return yield this.sendMessage(
806
939
  "GZCA_GetCertList",
807
940
  e
808
941
  );
809
942
  }));
810
- i(this, "pkcs1Sign", (e) => l(this, null, function* () {
811
- return yield this.sendMessage("GZCA_Pkcs1SignData", D({
943
+ o(this, "pkcs1Sign", (e) => l(this, null, function* () {
944
+ return yield this.sendMessage("GZCA_Pkcs1SignData", S({
945
+ IsLogin: this.getIsLogin(),
946
+ PinPolicy: this.pinPolicy
947
+ }, e != null ? e : {}));
948
+ }));
949
+ o(this, "pkcs1Base64Sign", (e) => l(this, null, function* () {
950
+ return yield this.sendMessage("GZCA_Pkcs1SignDataEx", S({
812
951
  IsLogin: this.getIsLogin(),
813
952
  PinPolicy: this.pinPolicy
814
953
  }, e != null ? e : {}));
815
954
  }));
816
- i(this, "pkcs1Base64Sign", (e) => l(this, null, function* () {
817
- return yield this.sendMessage("GZCA_Pkcs1SignDataEx", D({
955
+ o(this, "batchPkcs1Base64Sign", (e) => l(this, null, function* () {
956
+ return yield this.sendMessage("GZCA_BatchPkcs1SignDataEx", S({
818
957
  IsLogin: this.getIsLogin(),
819
958
  PinPolicy: this.pinPolicy
820
959
  }, e != null ? e : {}));
821
960
  }));
822
- i(this, "pkcs1VerifySignature", (e) => l(this, null, function* () {
961
+ o(this, "pkcs1VerifySignature", (e) => l(this, null, function* () {
823
962
  return yield this.sendMessage("GZCA_Pkcs1VerifySign", e);
824
963
  }));
825
- i(this, "pkcs1Base64VerifySignature", (e) => l(this, null, function* () {
964
+ o(this, "pkcs1Base64VerifySignature", (e) => l(this, null, function* () {
826
965
  return yield this.sendMessage("GZCA_Pkcs1VerifySignEx", e);
827
966
  }));
828
- i(this, "getSealList", (e) => l(this, null, function* () {
829
- return yield this.sendMessage("GZCA_EnumSeals", D({
967
+ o(this, "getSealList", (e) => l(this, null, function* () {
968
+ return yield this.sendMessage("GZCA_EnumSeals", S({
969
+ IsLogin: this.getIsLogin()
970
+ }, e != null ? e : {}));
971
+ }));
972
+ o(this, "writeSeal", (e) => l(this, null, function* () {
973
+ return yield this.sendMessage("GZCA_WriteSeal", S({
974
+ IsLogin: this.getIsLogin()
975
+ }, e != null ? e : {}));
976
+ }));
977
+ o(this, "deleteSeal", (e) => l(this, null, function* () {
978
+ return yield this.sendMessage("GZCA_DeleteSeal", S({
979
+ IsLogin: this.getIsLogin()
980
+ }, e != null ? e : {}));
981
+ }));
982
+ o(this, "getSealInfo", (e) => l(this, null, function* () {
983
+ return yield this.sendMessage("GZCA_ReadSeal", S({
830
984
  IsLogin: this.getIsLogin()
831
985
  }, e != null ? e : {}));
832
986
  }));
833
- i(this, "sm2SignPreprocess1", (e) => l(this, null, function* () {
987
+ o(this, "getTPSealList", (e) => l(this, null, function* () {
988
+ return yield this.sendMessage("GZCA_GetSealPicList", S({
989
+ IsLogin: this.getIsLogin()
990
+ }, e != null ? e : {}));
991
+ }));
992
+ o(this, "getTPSealPic", (e) => l(this, null, function* () {
993
+ var n;
994
+ return yield this.sendMessage("GZCA_GetSealPicData", S({
995
+ IsLogin: (n = e.IsLogin) != null ? n : this.getIsLogin()
996
+ }, e != null ? e : {}));
997
+ }));
998
+ o(this, "sm2SignPreprocess1", (e) => l(this, null, function* () {
834
999
  return yield this.sendMessage("GZCA_PrepareSm2SignStep1", e);
835
1000
  }));
836
- i(this, "sm2SignPreprocess2", (e) => l(this, null, function* () {
1001
+ o(this, "sm2SignPreprocess2", (e) => l(this, null, function* () {
837
1002
  return yield this.sendMessage("GZCA_PrepareSm2SignStep2", e);
838
1003
  }));
839
- i(this, "pkcs1HashSign", (e) => l(this, null, function* () {
840
- return yield this.sendMessage("GZCA_Pkcs1SignDataForHash", D({
1004
+ o(this, "pkcs1HashSign", (e) => l(this, null, function* () {
1005
+ return yield this.sendMessage("GZCA_Pkcs1SignDataForHash", S({
841
1006
  IsLogin: this.getIsLogin(),
842
1007
  PinPolicy: this.pinPolicy
843
1008
  }, e != null ? e : {}));
844
1009
  }));
845
- i(this, "pkcs1HashVerifySignature", (e) => l(this, null, function* () {
1010
+ o(this, "pkcs1HashVerifySignature", (e) => l(this, null, function* () {
846
1011
  return yield this.sendMessage("GZCA_Pkcs1VerifySignForHash", e);
847
1012
  }));
848
- i(this, "pkcs7Sign", (e) => l(this, null, function* () {
849
- return yield this.sendMessage("GZCA_Pkcs7SignData", D({
1013
+ o(this, "pkcs7Sign", (e) => l(this, null, function* () {
1014
+ return yield this.sendMessage("GZCA_Pkcs7SignData", S({
850
1015
  IsLogin: this.getIsLogin(),
851
1016
  IsAuthAttr: "Y",
852
1017
  PinPolicy: this.pinPolicy
853
1018
  }, e != null ? e : {}));
854
1019
  }));
855
- i(this, "pkcs7VerifySignature", (e) => l(this, null, function* () {
1020
+ o(this, "pkcs7VerifySignature", (e) => l(this, null, function* () {
856
1021
  return yield this.sendMessage("GZCA_Pkcs7VerifySign", e);
857
1022
  }));
858
- i(this, "sm3Hash", (e) => l(this, null, function* () {
1023
+ o(this, "sm3Hash", (e) => l(this, null, function* () {
859
1024
  return yield this.sendMessage("GZCA_HashData", e);
860
1025
  }));
861
- i(this, "sm3HexHash", (e) => l(this, null, function* () {
1026
+ o(this, "sm3HexHash", (e) => l(this, null, function* () {
862
1027
  return yield this.sendMessage("GZCA_HashDataEx", e);
863
1028
  }));
864
- i(this, "sm3FileHash", (e) => l(this, null, function* () {
1029
+ o(this, "sm3FileHash", (e) => l(this, null, function* () {
865
1030
  return yield this.sendMessage("GZCA_HashFile", e);
866
1031
  }));
867
- i(this, "sm3HashEncryption", (e) => l(this, null, function* () {
1032
+ o(this, "sm3HashEncryption", (e) => l(this, null, function* () {
868
1033
  return yield this.sendMessage("GZCA_HMac", e);
869
1034
  }));
870
- i(this, "pkcs7Encryption", (e) => l(this, null, function* () {
1035
+ o(this, "pkcs7Encryption", (e) => l(this, null, function* () {
871
1036
  return yield this.sendMessage("GZCA_Pkcs7EncryptData", e);
872
1037
  }));
873
- i(this, "pkcs7Decryption", (e) => l(this, null, function* () {
874
- return yield this.sendMessage("GZCA_Pkcs7DecryptData", D({
1038
+ o(this, "pkcs7Decryption", (e) => l(this, null, function* () {
1039
+ return yield this.sendMessage("GZCA_Pkcs7DecryptData", S({
875
1040
  IsLogin: this.getIsLogin()
876
1041
  }, e != null ? e : {}));
877
1042
  }));
878
- i(this, "asymmetricEncryption", (e) => l(this, null, function* () {
1043
+ o(this, "pkcs7FileEncryption", (e) => l(this, null, function* () {
1044
+ return yield this.sendMessage("GZCA_EnvelopeSealFileEx_qyzc", e);
1045
+ }));
1046
+ o(this, "pkcs7FileDecryption", (e) => l(this, null, function* () {
1047
+ return yield this.sendMessage("GZCA_EnvelopeOpenFileEx_qyzc", S({
1048
+ IsLogin: this.getIsLogin()
1049
+ }, e != null ? e : {}));
1050
+ }));
1051
+ o(this, "asymmetricEncryption", (e) => l(this, null, function* () {
879
1052
  return yield this.sendMessage("GZCA_AsymEncryptData", e);
880
1053
  }));
881
- i(this, "asymmetricDecryption", (e) => l(this, null, function* () {
882
- return yield this.sendMessage("GZCA_AsymDecryptData", D({
1054
+ o(this, "asymmetricDecryption", (e) => l(this, null, function* () {
1055
+ return yield this.sendMessage("GZCA_AsymDecryptData", S({
883
1056
  IsLogin: this.getIsLogin()
884
1057
  }, e != null ? e : {}));
885
1058
  }));
886
- i(this, "sm4Encryption", (e) => l(this, null, function* () {
1059
+ o(this, "sm4Encryption", (e) => l(this, null, function* () {
887
1060
  return yield this.sendMessage("GZCA_EncryptDataEx", e);
888
1061
  }));
889
- i(this, "sm4Decryption", (e) => l(this, null, function* () {
1062
+ o(this, "sm4Decryption", (e) => l(this, null, function* () {
890
1063
  return yield this.sendMessage("GZCA_DecryptDataEx", e);
891
1064
  }));
892
- i(this, "getCertInfo", (e) => l(this, null, function* () {
1065
+ o(this, "getCertInfo", (e) => l(this, null, function* () {
893
1066
  return yield this.sendMessage("GZCA_GetCertInfo", e);
894
1067
  }));
895
- i(this, "getCertInfoByOid", (e) => l(this, null, function* () {
1068
+ o(this, "getCertInfoByOid", (e) => l(this, null, function* () {
896
1069
  return yield this.sendMessage("GZCA_GetCertInfoByOid", e);
897
1070
  }));
898
- var t, s;
899
- this.socketConfig = e, this.socketInstance = this.createSocket(e), this.isRememberPin = (t = e.isRememberPin) != null ? t : !1, this.pinPolicy = (s = e.pinPolicy) != null ? s : ge.MIN;
1071
+ o(this, "getSealVendor", (e) => l(this, null, function* () {
1072
+ return yield this.sendMessage("GZCA_GetSealIssuer", e);
1073
+ }));
1074
+ o(this, "deleteAllSealByVendor", (e) => l(this, null, function* () {
1075
+ return yield this.sendMessage("GZCA_ClearSeal", S({
1076
+ IsLogin: this.getIsLogin()
1077
+ }, e != null ? e : {}));
1078
+ }));
1079
+ var t, n;
1080
+ this.socketConfig = e, this.initSocket(e), this.isRememberPin = (t = e.isRememberPin) != null ? t : !1, this.pinPolicy = (n = e.pinPolicy) != null ? n : Se.MIN;
900
1081
  }
901
- createSocket(e) {
1082
+ initSocket(e) {
1083
+ this.isConnecting = !0;
902
1084
  const t = new WebSocket(e.url);
903
- return t.onerror = (s) => {
1085
+ return t.onerror = (n) => {
904
1086
  var r;
905
- (r = e.onError) == null || r.call(e, s);
906
- }, t.onopen = (s) => {
1087
+ this.isConnecting = !1, (r = e.onError) == null || r.call(e, n), this.flushMsgQueue();
1088
+ }, t.onopen = (n) => {
907
1089
  var r;
908
- (r = e.onOpen) == null || r.call(e, s), e.onUkeyChange && this.addUkeyEvents();
909
- }, t.onmessage = (s) => {
910
- this.handleEventData(s);
911
- }, t.onclose = (s) => {
1090
+ this.isConnecting = !1, (r = e.onOpen) == null || r.call(e, n), e.onUkeyChange && this.addUkeyEvents(), this.flushMsgQueue();
1091
+ }, t.onmessage = (n) => {
1092
+ this.handleEventData(n);
1093
+ }, t.onclose = (n) => {
912
1094
  var r;
913
- (r = e.onClose) == null || r.call(e, s);
914
- }, t;
1095
+ this.isConnecting = !1, (r = e.onClose) == null || r.call(e, n);
1096
+ }, this.socketInstance = t, t;
915
1097
  }
916
1098
  getIsLogin() {
917
1099
  return this.isRememberPin ? "Y" : "N";
918
1100
  }
919
1101
  }
920
- const T = class T {
1102
+ const N = class N {
921
1103
  constructor(e) {
922
- i(this, "coreInstance", null);
923
- i(this, "gwsConfig", {});
924
- i(this, "createGwsCore", (e) => {
925
- this.gwsConfig = e != null ? e : {}, this.coreInstance = new ut(B(D({}, e != null ? e : {}), {
926
- url: Ae
1104
+ o(this, "coreInstance", null);
1105
+ o(this, "gwsConfig", {});
1106
+ o(this, "createGwsCore", (e) => {
1107
+ this.gwsConfig = e != null ? e : {}, this.coreInstance = new St(E(S({}, e != null ? e : {}), {
1108
+ url: Te
927
1109
  }));
928
1110
  });
929
- i(this, "appendCertBase64", (e, t = !0) => l(this, null, function* () {
1111
+ o(this, "appendCertBase64", (e, t = !0) => l(this, null, function* () {
930
1112
  if (e.CertB64) return e;
931
- const s = t ? yield this.getSignatureCert() : yield this.getEncryptionCert();
932
- return B(D({}, e != null ? e : {}), { CertB64: s == null ? void 0 : s.CertB64 });
1113
+ const n = t ? yield this.getSignatureCert() : yield this.getEncryptionCert();
1114
+ return E(S({}, e != null ? e : {}), { CertB64: n == null ? void 0 : n.CertB64 });
933
1115
  }));
934
- i(this, "destroy", () => {
1116
+ o(this, "destroy", () => {
935
1117
  var e;
936
1118
  (e = this.coreInstance) == null || e.destroy(), this.coreInstance = null;
937
1119
  });
938
- i(this, "restart", (e) => {
1120
+ o(this, "restart", (e) => {
939
1121
  this.coreInstance && this.destroy(), this.gwsConfig = e != null ? e : this.gwsConfig, this.createGwsCore(e);
940
1122
  });
941
- i(this, "getSocketReadyState", () => {
1123
+ o(this, "getSocketReadyState", () => {
942
1124
  var e;
943
1125
  return (e = this.coreInstance) == null ? void 0 : e.getSocketReadyState();
944
1126
  });
945
- i(this, "getSignatureCert", (e) => l(this, null, function* () {
946
- var s;
947
- return yield (s = this.coreInstance) == null ? void 0 : s.getCert(
948
- { CertType: te },
949
- e
1127
+ o(this, "getSignatureCert", (e, t = !0) => l(this, null, function* () {
1128
+ var r;
1129
+ return yield (r = this.coreInstance) == null ? void 0 : r.getCert(
1130
+ { CertType: ae },
1131
+ e,
1132
+ t
950
1133
  );
951
1134
  }));
952
- i(this, "getSignatureCertList", () => l(this, null, function* () {
1135
+ o(this, "getSignatureCertList", () => l(this, null, function* () {
953
1136
  var t;
954
- return yield (t = this.coreInstance) == null ? void 0 : t.getCertList(
955
- { CertType: te }
956
- );
1137
+ return yield (t = this.coreInstance) == null ? void 0 : t.getCertList({
1138
+ CertType: ae
1139
+ });
957
1140
  }));
958
- i(this, "getEncryptionCert", (e) => l(this, null, function* () {
959
- var s;
960
- return yield (s = this.coreInstance) == null ? void 0 : s.getCert(
961
- { CertType: ne },
962
- e
1141
+ o(this, "getEncryptionCert", (e, t = !0) => l(this, null, function* () {
1142
+ var r;
1143
+ return yield (r = this.coreInstance) == null ? void 0 : r.getCert(
1144
+ { CertType: ie },
1145
+ e,
1146
+ t
963
1147
  );
964
1148
  }));
965
- i(this, "getEncryptionCertList", () => l(this, null, function* () {
1149
+ o(this, "getEncryptionCertList", () => l(this, null, function* () {
966
1150
  var t;
967
- return yield (t = this.coreInstance) == null ? void 0 : t.getCertList(
968
- { CertType: ne }
969
- );
1151
+ return yield (t = this.coreInstance) == null ? void 0 : t.getCertList({
1152
+ CertType: ie
1153
+ });
970
1154
  }));
971
- i(this, "base64Encode", (e) => {
1155
+ o(this, "base64Encode", (e) => {
972
1156
  var t;
973
1157
  return (t = this.coreInstance) == null ? void 0 : t.base64Encode(e.Data);
974
1158
  });
975
- i(this, "base64Decode", (e) => {
1159
+ o(this, "base64Decode", (e) => {
976
1160
  var t;
977
1161
  return (t = this.coreInstance) == null ? void 0 : t.base64Decode(e.DataB64);
978
1162
  });
979
- i(this, "changeIsRememberPin", (e) => {
1163
+ o(this, "changeIsRememberPin", (e) => {
980
1164
  var t;
981
1165
  (t = this.coreInstance) == null || t.changeIsRememberPin(e);
982
1166
  });
983
- i(this, "changePinPolicy", (e) => {
1167
+ o(this, "changePinPolicy", (e) => {
984
1168
  var t;
985
1169
  (t = this.coreInstance) == null || t.changePinPolicy(e);
986
1170
  });
987
- i(this, "pkcs1Sign", (e, t) => l(this, null, function* () {
988
- var a, o, u;
989
- const s = yield this.getSignatureCert(t), r = yield (o = this.coreInstance) == null ? void 0 : o.pkcs1Sign(B(D({}, e != null ? e : {}), {
990
- ContainerName: (a = s == null ? void 0 : s.ContainerName) != null ? a : ""
1171
+ o(this, "pkcs1Sign", (e, t) => l(this, null, function* () {
1172
+ var a, i, c;
1173
+ const n = yield this.getSignatureCert(t), r = yield (i = this.coreInstance) == null ? void 0 : i.pkcs1Sign(E(S({}, e != null ? e : {}), {
1174
+ ContainerName: (a = n == null ? void 0 : n.ContainerName) != null ? a : ""
991
1175
  }));
992
- return (u = r == null ? void 0 : r[0]) == null ? void 0 : u.SignData;
1176
+ return (c = r == null ? void 0 : r[0]) == null ? void 0 : c.SignData;
993
1177
  }));
994
- i(this, "pkcs1VerifySignature", (e) => l(this, null, function* () {
1178
+ o(this, "pkcs1VerifySignature", (e) => l(this, null, function* () {
995
1179
  var r;
996
- const t = yield this.appendCertBase64(e), s = yield (r = this.coreInstance) == null ? void 0 : r.pkcs1VerifySignature(t);
997
- return Array.isArray(s);
1180
+ const t = yield this.appendCertBase64(e), n = yield (r = this.coreInstance) == null ? void 0 : r.pkcs1VerifySignature(t);
1181
+ return Array.isArray(n);
998
1182
  }));
999
- i(this, "pkcs1Base64Sign", (e, t) => l(this, null, function* () {
1000
- var o, u, d, h, f;
1001
- const s = yield this.getSignatureCert(t), r = (u = e.DataB64) != null ? u : this.base64Encode({ Data: (o = e.Data) != null ? o : "" }), a = yield (h = this.coreInstance) == null ? void 0 : h.pkcs1Base64Sign(B(D({}, e != null ? e : {}), {
1002
- ContainerName: (d = s == null ? void 0 : s.ContainerName) != null ? d : "",
1183
+ o(this, "pkcs1Base64Sign", (e, t) => l(this, null, function* () {
1184
+ var i, c, d, u, C;
1185
+ const n = yield this.getSignatureCert(t), r = (c = e.DataB64) != null ? c : this.base64Encode({ Data: (i = e.Data) != null ? i : "" }), a = yield (u = this.coreInstance) == null ? void 0 : u.pkcs1Base64Sign(E(S({}, e != null ? e : {}), {
1186
+ ContainerName: (d = n == null ? void 0 : n.ContainerName) != null ? d : "",
1003
1187
  DataB64: r
1004
1188
  }));
1005
- return (f = a == null ? void 0 : a[0]) == null ? void 0 : f.SignData;
1189
+ return (C = a == null ? void 0 : a[0]) == null ? void 0 : C.SignData;
1190
+ }));
1191
+ o(this, "batchPkcs1Base64Sign", (e, t) => l(this, null, function* () {
1192
+ var C, g, m, h, f, w;
1193
+ const n = "|", r = (g = e.DataB64) != null ? g : (C = e.Data) == null ? void 0 : C.map((y) => this.base64Encode({ Data: y })), a = yield this.getSignatureCert(t);
1194
+ let i = "";
1195
+ i = Array.isArray(r) ? r == null ? void 0 : r.map((y, p) => `${p}:${y}`).join(n) : "";
1196
+ const c = yield (h = this.coreInstance) == null ? void 0 : h.batchPkcs1Base64Sign({
1197
+ ContainerName: (m = a == null ? void 0 : a.ContainerName) != null ? m : "",
1198
+ DataB64: i
1199
+ }), d = (w = (f = c == null ? void 0 : c[0]) == null ? void 0 : f.SignData) == null ? void 0 : w.split(n), u = [];
1200
+ return d.forEach((y) => {
1201
+ const p = y.split(":"), v = Number(p[0]), I = p[1];
1202
+ u[v] = I;
1203
+ }), u;
1006
1204
  }));
1007
- i(this, "pkcs1Base64VerifySignature", (e) => l(this, null, function* () {
1008
- var a, o, u;
1009
- const t = (o = e.DataB64) != null ? o : this.base64Encode({ Data: (a = e.Data) != null ? a : "" }), s = yield this.appendCertBase64(e);
1010
- return !!(yield (u = this.coreInstance) == null ? void 0 : u.pkcs1Base64VerifySignature({
1011
- CertB64: s.CertB64,
1205
+ o(this, "pkcs1Base64VerifySignature", (e) => l(this, null, function* () {
1206
+ var a, i, c;
1207
+ const t = (i = e.DataB64) != null ? i : this.base64Encode({ Data: (a = e.Data) != null ? a : "" }), n = yield this.appendCertBase64(e);
1208
+ return !!(yield (c = this.coreInstance) == null ? void 0 : c.pkcs1Base64VerifySignature({
1209
+ CertB64: n.CertB64,
1012
1210
  DataB64: t,
1013
- SignData: s.SignData
1211
+ SignData: n.SignData
1014
1212
  }));
1015
1213
  }));
1016
- i(this, "getSealList", (e) => l(this, null, function* () {
1214
+ o(this, "writeSeal", (e, t) => l(this, null, function* () {
1215
+ var a, i;
1216
+ const n = yield this.getSignatureCert(t);
1217
+ return !!(yield (i = this.coreInstance) == null ? void 0 : i.writeSeal(E(S({}, e != null ? e : {}), {
1218
+ ContainerName: (a = n == null ? void 0 : n.ContainerName) != null ? a : ""
1219
+ })));
1220
+ }));
1221
+ o(this, "deleteSeal", (e) => l(this, null, function* () {
1222
+ var a, i, c, d, u;
1223
+ const t = yield this.getSealList(e);
1224
+ if (!((a = t == null ? void 0 : t.data) != null && a.length))
1225
+ return Promise.reject({
1226
+ errCode: Y,
1227
+ msg: "暂无印章"
1228
+ });
1229
+ const n = yield J.open({
1230
+ title: "删除印章",
1231
+ data: t == null ? void 0 : t.data,
1232
+ columns: we,
1233
+ okText: "删除"
1234
+ });
1235
+ return !!(yield (u = this.coreInstance) == null ? void 0 : u.deleteSeal({
1236
+ ContainerName: (c = (i = t == null ? void 0 : t.cert) == null ? void 0 : i.ContainerName) != null ? c : "",
1237
+ SealId: (d = n == null ? void 0 : n.SealId) != null ? d : ""
1238
+ }));
1239
+ }));
1240
+ o(this, "getSealList", (e) => l(this, null, function* () {
1017
1241
  var r, a;
1018
- const t = yield this.getSignatureCert(e), s = yield (a = this.coreInstance) == null ? void 0 : a.getSealList({
1019
- ContainerName: (r = t == null ? void 0 : t.ContainerName) != null ? r : ""
1242
+ const t = yield this.getSignatureCert(e), n = yield (a = this.coreInstance) == null ? void 0 : a.getSealList({
1243
+ ContainerName: (r = t == null ? void 0 : t.ContainerName) != null ? r : "",
1244
+ IsLogin: "Y"
1020
1245
  });
1021
1246
  return {
1022
1247
  cert: t,
1023
- sealList: s
1248
+ data: n
1249
+ };
1250
+ }));
1251
+ o(this, "getSealInfo", (e) => l(this, null, function* () {
1252
+ var a, i, c, d, u, C, g;
1253
+ const t = yield this.getSealList(e);
1254
+ if (!((a = t == null ? void 0 : t.data) != null && a.length))
1255
+ return Promise.reject({
1256
+ errCode: Y,
1257
+ msg: "暂无印章"
1258
+ });
1259
+ const n = ((i = t == null ? void 0 : t.data) == null ? void 0 : i.length) > 1 ? yield J.open({
1260
+ title: "选择印章",
1261
+ data: t == null ? void 0 : t.data,
1262
+ columns: we,
1263
+ theme: (c = this.gwsConfig) == null ? void 0 : c.theme
1264
+ }) : t == null ? void 0 : t.data[0], r = yield (g = this.coreInstance) == null ? void 0 : g.getSealInfo({
1265
+ ContainerName: (u = (d = t == null ? void 0 : t.cert) == null ? void 0 : d.ContainerName) != null ? u : "",
1266
+ SealId: (C = n == null ? void 0 : n.SealId) != null ? C : ""
1267
+ });
1268
+ return r == null ? void 0 : r[0];
1269
+ }));
1270
+ o(this, "getTPSealList", (e, t) => l(this, null, function* () {
1271
+ var a, i;
1272
+ const n = yield this.getSignatureCert(t), r = yield (i = this.coreInstance) == null ? void 0 : i.getTPSealList({
1273
+ ContainerName: (a = n == null ? void 0 : n.ContainerName) != null ? a : "",
1274
+ Vid: e == null ? void 0 : e.Vid
1275
+ });
1276
+ return {
1277
+ cert: n,
1278
+ data: r
1279
+ };
1280
+ }));
1281
+ o(this, "getTPSeal", (e, t) => l(this, null, function* () {
1282
+ var a, i, c;
1283
+ const n = yield this.getTPSealList(e, t);
1284
+ if (!((a = n == null ? void 0 : n.data) != null && a.length))
1285
+ return Promise.reject({
1286
+ errCode: Y,
1287
+ msg: "暂无印章"
1288
+ });
1289
+ const r = ((i = n == null ? void 0 : n.data) == null ? void 0 : i.length) === 1 ? n == null ? void 0 : n.data[0] : yield J.open({
1290
+ title: "选择印章",
1291
+ data: n == null ? void 0 : n.data,
1292
+ columns: wt,
1293
+ theme: (c = this.gwsConfig) == null ? void 0 : c.theme
1294
+ });
1295
+ return {
1296
+ cert: n == null ? void 0 : n.cert,
1297
+ data: r
1024
1298
  };
1025
1299
  }));
1026
- i(this, "sm2SignPreprocess1", (e) => l(this, null, function* () {
1300
+ o(this, "getTPSealPic", (e, t) => l(this, null, function* () {
1301
+ var a, i, c, d, u;
1302
+ const n = yield this.getTPSeal(e, t), r = yield (u = this.coreInstance) == null ? void 0 : u.getTPSealPic(E(S({
1303
+ ContainerName: (i = (a = n == null ? void 0 : n.cert) == null ? void 0 : a.ContainerName) != null ? i : ""
1304
+ }, (c = n == null ? void 0 : n.data) != null ? c : {}), {
1305
+ FileSize: String((d = n == null ? void 0 : n.data) == null ? void 0 : d.FileSize)
1306
+ }));
1307
+ return r == null ? void 0 : r[0];
1308
+ }));
1309
+ o(this, "sm2SignPreprocess1", (e) => l(this, null, function* () {
1027
1310
  var r, a;
1028
- const t = yield this.appendCertBase64(e), s = yield (r = this.coreInstance) == null ? void 0 : r.sm2SignPreprocess1(t);
1029
- return (a = s == null ? void 0 : s[0]) == null ? void 0 : a.Z;
1311
+ const t = yield this.appendCertBase64(e), n = yield (r = this.coreInstance) == null ? void 0 : r.sm2SignPreprocess1(t);
1312
+ return (a = n == null ? void 0 : n[0]) == null ? void 0 : a.Z;
1030
1313
  }));
1031
- i(this, "sm2SignPreprocess2", (e) => l(this, null, function* () {
1032
- var a, o;
1033
- const t = this.base64Encode({ Data: (a = e.Data) != null ? a : "" }), s = yield this.appendCertBase64(e), r = yield (o = this.coreInstance) == null ? void 0 : o.sm2SignPreprocess2({
1034
- CertB64: s.CertB64,
1314
+ o(this, "sm2SignPreprocess2", (e) => l(this, null, function* () {
1315
+ var a, i;
1316
+ const t = this.base64Encode({ Data: (a = e.Data) != null ? a : "" }), n = yield this.appendCertBase64(e), r = yield (i = this.coreInstance) == null ? void 0 : i.sm2SignPreprocess2({
1317
+ CertB64: n.CertB64,
1035
1318
  DataB64: t
1036
1319
  });
1037
1320
  return r == null ? void 0 : r[0].H;
1038
1321
  }));
1039
- i(this, "pkcs1HashSign", (e, t) => l(this, null, function* () {
1040
- var a, o, u, d;
1041
- const s = yield this.getSignatureCert(t), r = yield (u = this.coreInstance) == null ? void 0 : u.pkcs1HashSign({
1042
- ContainerName: (a = s == null ? void 0 : s.ContainerName) != null ? a : "",
1322
+ o(this, "pkcs1HashSign", (e, t) => l(this, null, function* () {
1323
+ var a, i, c, d;
1324
+ const n = yield this.getSignatureCert(t), r = yield (c = this.coreInstance) == null ? void 0 : c.pkcs1HashSign({
1325
+ ContainerName: (a = n == null ? void 0 : n.ContainerName) != null ? a : "",
1043
1326
  DataB64: e.DataB64,
1044
- HashAlg: (o = e.HashAlg) != null ? o : "sm3"
1327
+ HashAlg: (i = e.HashAlg) != null ? i : "sm3"
1045
1328
  });
1046
1329
  return (d = r == null ? void 0 : r[0]) == null ? void 0 : d.SignData;
1047
1330
  }));
1048
- i(this, "pkcs1HashVerifySignature", (e) => l(this, null, function* () {
1331
+ o(this, "pkcs1HashVerifySignature", (e) => l(this, null, function* () {
1049
1332
  var r, a;
1050
1333
  const t = yield this.appendCertBase64(e);
1051
- return !!(yield (a = this.coreInstance) == null ? void 0 : a.pkcs1HashVerifySignature(B(D({}, t), {
1334
+ return !!(yield (a = this.coreInstance) == null ? void 0 : a.pkcs1HashVerifySignature(E(S({}, t), {
1052
1335
  HashAlg: (r = t.HashAlg) != null ? r : "sm3"
1053
1336
  })));
1054
1337
  }));
1055
- i(this, "pkcs7Sign", (e, t) => l(this, null, function* () {
1056
- var o, u, d, h, f;
1057
- const s = (u = e.DataB64) != null ? u : this.base64Encode({ Data: (o = e.Data) != null ? o : "" }), r = yield this.getSignatureCert(t), a = yield (h = this.coreInstance) == null ? void 0 : h.pkcs7Sign(B(D({}, e != null ? e : {}), {
1338
+ o(this, "pkcs7Sign", (e, t) => l(this, null, function* () {
1339
+ var i, c, d, u, C;
1340
+ const n = (c = e.DataB64) != null ? c : this.base64Encode({ Data: (i = e.Data) != null ? i : "" }), r = yield this.getSignatureCert(t), a = yield (u = this.coreInstance) == null ? void 0 : u.pkcs7Sign(E(S({}, e != null ? e : {}), {
1058
1341
  ContainerName: (d = r == null ? void 0 : r.ContainerName) != null ? d : "",
1059
- DataB64: s
1342
+ DataB64: n
1060
1343
  }));
1061
- return (f = a == null ? void 0 : a[0]) == null ? void 0 : f.SignData;
1344
+ return (C = a == null ? void 0 : a[0]) == null ? void 0 : C.SignData;
1062
1345
  }));
1063
- i(this, "pkcs7VerifySignature", (e) => l(this, null, function* () {
1064
- var r, a, o;
1346
+ o(this, "pkcs7VerifySignature", (e) => l(this, null, function* () {
1347
+ var r, a, i;
1065
1348
  const t = (a = e.DataB64) != null ? a : this.base64Encode({ Data: (r = e.Data) != null ? r : "" });
1066
- return !!(yield (o = this.coreInstance) == null ? void 0 : o.pkcs7VerifySignature({
1349
+ return !!(yield (i = this.coreInstance) == null ? void 0 : i.pkcs7VerifySignature({
1067
1350
  DataB64: t,
1068
1351
  SignData: e.SignData
1069
1352
  }));
1070
1353
  }));
1071
- i(this, "sm3Hash", (e) => l(this, null, function* () {
1072
- var s, r;
1073
- const t = yield (s = this.coreInstance) == null ? void 0 : s.sm3Hash(e);
1354
+ o(this, "sm3Hash", (e) => l(this, null, function* () {
1355
+ var n, r;
1356
+ const t = yield (n = this.coreInstance) == null ? void 0 : n.sm3Hash(e);
1074
1357
  return (r = t == null ? void 0 : t[0]) == null ? void 0 : r.HashB64;
1075
1358
  }));
1076
- i(this, "sm3HexHash", (e) => l(this, null, function* () {
1077
- var s, r;
1078
- const t = yield (s = this.coreInstance) == null ? void 0 : s.sm3HexHash(e);
1359
+ o(this, "sm3HexHash", (e) => l(this, null, function* () {
1360
+ var n, r;
1361
+ const t = yield (n = this.coreInstance) == null ? void 0 : n.sm3HexHash(e);
1079
1362
  return (r = t == null ? void 0 : t[0]) == null ? void 0 : r.HashB64;
1080
1363
  }));
1081
- i(this, "sm3FileHash", (e) => l(this, null, function* () {
1082
- var s, r;
1083
- const t = yield (s = this.coreInstance) == null ? void 0 : s.sm3FileHash(e);
1364
+ o(this, "sm3FileHash", (e) => l(this, null, function* () {
1365
+ var n, r;
1366
+ const t = yield (n = this.coreInstance) == null ? void 0 : n.sm3FileHash(e);
1084
1367
  return (r = t == null ? void 0 : t[0]) == null ? void 0 : r.HashB64;
1085
1368
  }));
1086
- i(this, "sm3HashEncryption", (e) => l(this, null, function* () {
1087
- var a, o, u, d, h, f;
1088
- const t = (o = e.DataB64) != null ? o : this.base64Encode({ Data: (a = e.Data) != null ? a : "" }), s = (d = e.KeyB64) != null ? d : this.base64Encode({ Data: (u = e.Key) != null ? u : "" }), r = yield (h = this.coreInstance) == null ? void 0 : h.sm3HashEncryption({
1369
+ o(this, "sm3HashEncryption", (e) => l(this, null, function* () {
1370
+ var a, i, c, d, u, C;
1371
+ const t = (i = e.DataB64) != null ? i : this.base64Encode({ Data: (a = e.Data) != null ? a : "" }), n = (d = e.KeyB64) != null ? d : this.base64Encode({ Data: (c = e.Key) != null ? c : "" }), r = yield (u = this.coreInstance) == null ? void 0 : u.sm3HashEncryption({
1089
1372
  dataB64: t,
1090
- keyB64: s,
1373
+ keyB64: n,
1091
1374
  alg: "sm3"
1092
1375
  });
1093
- return (f = r == null ? void 0 : r[0]) == null ? void 0 : f.DataB64;
1376
+ return (C = r == null ? void 0 : r[0]) == null ? void 0 : C.DataB64;
1094
1377
  }));
1095
- i(this, "pkcs7Encryption", (e) => l(this, null, function* () {
1096
- var r, a, o, u;
1378
+ o(this, "pkcs7Encryption", (e) => l(this, null, function* () {
1379
+ var r, a, i, c;
1097
1380
  if (!e.CertB64List) {
1098
1381
  const d = yield this.getEncryptionCert();
1099
1382
  e.CertB64List = d == null ? void 0 : d.CertB64;
1100
1383
  }
1101
- const t = (a = e.DataB64) != null ? a : this.base64Encode({ Data: (r = e.Data) != null ? r : "" }), s = yield (o = this.coreInstance) == null ? void 0 : o.pkcs7Encryption({
1384
+ const t = (a = e.DataB64) != null ? a : this.base64Encode({ Data: (r = e.Data) != null ? r : "" }), n = yield (i = this.coreInstance) == null ? void 0 : i.pkcs7Encryption({
1102
1385
  DataB64: t,
1103
1386
  CertB64List: e.CertB64List
1104
1387
  });
1105
- return (u = s == null ? void 0 : s[0]) == null ? void 0 : u.DataB64;
1388
+ return (c = n == null ? void 0 : n[0]) == null ? void 0 : c.DataB64;
1106
1389
  }));
1107
- i(this, "pkcs7Decryption", (e) => l(this, null, function* () {
1108
- var a, o;
1109
- const t = yield this.getEncryptionCert(), s = yield (a = this.coreInstance) == null ? void 0 : a.pkcs7Decryption(B(D({}, e != null ? e : {}), {
1390
+ o(this, "pkcs7Decryption", (e) => l(this, null, function* () {
1391
+ var a, i;
1392
+ const t = yield this.getEncryptionCert(), n = yield (a = this.coreInstance) == null ? void 0 : a.pkcs7Decryption(E(S({}, e != null ? e : {}), {
1110
1393
  ContainerName: t == null ? void 0 : t.ContainerName
1111
- })), r = (o = s == null ? void 0 : s[0]) == null ? void 0 : o.DataB64;
1394
+ })), r = (i = n == null ? void 0 : n[0]) == null ? void 0 : i.DataB64;
1112
1395
  return e.shouldDecodeBase64 ? this.base64Decode({ DataB64: r }) : r;
1113
1396
  }));
1114
- i(this, "asymmetricEncryption", (e) => l(this, null, function* () {
1397
+ o(this, "pkcs7FileEncryption", (e) => l(this, null, function* () {
1398
+ var r, a;
1399
+ const t = yield this.appendCertBase64(e, !1), n = yield (r = this.coreInstance) == null ? void 0 : r.pkcs7FileEncryption(t);
1400
+ return (a = n == null ? void 0 : n[0]) == null ? void 0 : a.DataB64;
1401
+ }));
1402
+ o(this, "pkcs7FileDecryption", (e) => l(this, null, function* () {
1403
+ var r, a, i;
1404
+ const t = yield this.getEncryptionCert(), n = yield (a = this.coreInstance) == null ? void 0 : a.pkcs7FileDecryption({
1405
+ SrcFile: e.SrcFile,
1406
+ DstFile: (r = e.DstFile) != null ? r : e.SrcFile.slice(0, -4),
1407
+ ContainerName: t == null ? void 0 : t.ContainerName
1408
+ });
1409
+ return (i = n == null ? void 0 : n[0]) == null ? void 0 : i.DataB64;
1410
+ }));
1411
+ o(this, "asymmetricEncryption", (e) => l(this, null, function* () {
1115
1412
  var r, a;
1116
- const t = yield this.appendCertBase64(e, !1), s = yield (r = this.coreInstance) == null ? void 0 : r.asymmetricEncryption(t);
1117
- return (a = s == null ? void 0 : s[0]) == null ? void 0 : a.Data;
1413
+ const t = yield this.appendCertBase64(e, !1), n = yield (r = this.coreInstance) == null ? void 0 : r.asymmetricEncryption(t);
1414
+ return (a = n == null ? void 0 : n[0]) == null ? void 0 : a.Data;
1118
1415
  }));
1119
- i(this, "asymmetricDecryption", (e, t) => l(this, null, function* () {
1120
- var a, o;
1121
- const s = yield this.getEncryptionCert(t), r = yield (a = this.coreInstance) == null ? void 0 : a.asymmetricDecryption(B(D({}, e != null ? e : {}), {
1122
- ContainerName: s == null ? void 0 : s.ContainerName
1416
+ o(this, "asymmetricDecryption", (e, t) => l(this, null, function* () {
1417
+ var a, i;
1418
+ const n = yield this.getEncryptionCert(t), r = yield (a = this.coreInstance) == null ? void 0 : a.asymmetricDecryption(E(S({}, e != null ? e : {}), {
1419
+ ContainerName: n == null ? void 0 : n.ContainerName
1123
1420
  }));
1124
- return (o = r == null ? void 0 : r[0]) == null ? void 0 : o.Data;
1421
+ return (i = r == null ? void 0 : r[0]) == null ? void 0 : i.Data;
1125
1422
  }));
1126
- i(this, "sm4Encryption", (e) => l(this, null, function* () {
1127
- var s;
1128
- const t = yield (s = this.coreInstance) == null ? void 0 : s.sm4Encryption(e);
1423
+ o(this, "sm4Encryption", (e) => l(this, null, function* () {
1424
+ var n;
1425
+ const t = yield (n = this.coreInstance) == null ? void 0 : n.sm4Encryption(e);
1129
1426
  return t == null ? void 0 : t[0];
1130
1427
  }));
1131
- i(this, "sm4Decryption", (e) => l(this, null, function* () {
1132
- var s, r;
1133
- const t = yield (s = this.coreInstance) == null ? void 0 : s.sm4Decryption(e);
1428
+ o(this, "sm4Decryption", (e) => l(this, null, function* () {
1429
+ var n, r;
1430
+ const t = yield (n = this.coreInstance) == null ? void 0 : n.sm4Decryption(e);
1134
1431
  return (r = t == null ? void 0 : t[0]) == null ? void 0 : r.Data;
1135
1432
  }));
1136
- i(this, "getCertInfo", (e) => l(this, null, function* () {
1137
- var s, r;
1138
- const t = yield (s = this.coreInstance) == null ? void 0 : s.getCertInfo(e);
1139
- return D({}, (r = t == null ? void 0 : t[0]) != null ? r : {});
1433
+ o(this, "getCertInfo", (e) => l(this, null, function* () {
1434
+ var n, r;
1435
+ const t = yield (n = this.coreInstance) == null ? void 0 : n.getCertInfo(e);
1436
+ return S({}, (r = t == null ? void 0 : t[0]) != null ? r : {});
1140
1437
  }));
1141
- i(this, "getCertInfoByOid", (e) => l(this, null, function* () {
1142
- var s, r;
1143
- const t = yield (s = this.coreInstance) == null ? void 0 : s.getCertInfoByOid(D({}, e != null ? e : {}));
1438
+ o(this, "getCertInfoByOid", (e) => l(this, null, function* () {
1439
+ var n, r;
1440
+ const t = yield (n = this.coreInstance) == null ? void 0 : n.getCertInfoByOid(S({}, e != null ? e : {}));
1144
1441
  return (r = t == null ? void 0 : t[0]) == null ? void 0 : r.OidValue;
1145
1442
  }));
1146
- return T.instance && !(e != null && e.isCreateNew) ? T.instance : (this.createGwsCore(e), T.instance = this, this);
1443
+ o(this, "getSealVendor", (e) => l(this, null, function* () {
1444
+ var r;
1445
+ const t = yield this.getSignatureCert(e), n = yield (r = this.coreInstance) == null ? void 0 : r.getSealVendor({
1446
+ ContainerName: t == null ? void 0 : t.ContainerName
1447
+ });
1448
+ return n == null ? void 0 : n[0];
1449
+ }));
1450
+ o(this, "deleteAllSealByVendor", (e, t) => l(this, null, function* () {
1451
+ var a;
1452
+ const n = yield this.getSignatureCert(t), r = yield (a = this.coreInstance) == null ? void 0 : a.deleteAllSealByVendor(E(S({}, e != null ? e : {}), {
1453
+ ContainerName: n == null ? void 0 : n.ContainerName
1454
+ }));
1455
+ return r == null ? void 0 : r[0];
1456
+ }));
1457
+ return N.instance && !(e != null && e.isCreateNew) ? N.instance : (this.createGwsCore(e), N.instance = this, this);
1147
1458
  }
1148
1459
  };
1149
- i(T, "instance", null);
1150
- let Z = T;
1151
- function ht(n) {
1460
+ o(N, "instance", null);
1461
+ let H = N;
1462
+ function kt(s) {
1152
1463
  return new Promise((e, t) => {
1153
- if (Z.instance && !(n != null && n.isCreateNew))
1154
- e(Z.instance);
1464
+ if (H.instance && !(s != null && s.isCreateNew))
1465
+ e(H.instance);
1155
1466
  else {
1156
- const s = new Z(B(D({}, n != null ? n : {}), {
1467
+ const n = new H(E(S({}, s != null ? s : {}), {
1157
1468
  onOpen(r) {
1158
1469
  var a;
1159
- e(s), (a = n == null ? void 0 : n.onOpen) == null || a.call(n, r);
1470
+ e(n), (a = s == null ? void 0 : s.onOpen) == null || a.call(s, r);
1160
1471
  },
1161
1472
  onClose(r) {
1162
1473
  var a;
1163
- t(r), (a = n == null ? void 0 : n.onClose) == null || a.call(n, r);
1474
+ t(r), (a = s == null ? void 0 : s.onClose) == null || a.call(s, r);
1164
1475
  }
1165
1476
  }));
1166
1477
  }
1167
1478
  });
1168
1479
  }
1169
1480
  export {
1170
- Z as GwsService,
1171
- ht as createService
1481
+ H as GwsService,
1482
+ kt as createService
1172
1483
  };