@10yun/open-sdk 0.3.150 → 0.3.151

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.
@@ -1,2688 +0,0 @@
1
- import { C as e, E as t, T as n, _ as r, h as i, u as a, v as o, y as s } from "./opensdk-v3-BdP48pba.js";
2
- import { t as c } from "./_plugin-vue_export-helper-B52Kst-M.js";
3
- import { createBlock as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createTextVNode as p, createVNode as m, openBlock as h, resolveComponent as g, toDisplayString as _, withCtx as v, withKeys as y } from "vue";
4
- //#region layout/svg/MenuQrcode.vue
5
- var b = {}, ee = {
6
- xmlns: "http://www.w3.org/2000/svg",
7
- viewBox: "0 0 1024 1024"
8
- };
9
- function x(e, t) {
10
- return h(), d("svg", ee, [...t[0] ||= [f("path", {
11
- d: "M384 554.666667a85.333333 85.333333 0 0 1 85.333333 85.333333v234.666667a85.333333 85.333333 0 0 1-85.333333 85.333333H149.333333a85.333333 85.333333 0 0 1-85.333333-85.333333V640a85.333333 85.333333 0 0 1 85.333333-85.333333h234.666667z m226.133333 277.333333c4.693333 0 8.533333 3.84 8.533334 8.533333V896h183.466666c4.693333 0 8.533333 3.84 8.533334 8.533333v46.933334a8.533333 8.533333 0 0 1-8.533334 8.533333H563.2a8.533333 8.533333 0 0 1-8.533333-8.533333v-110.933334c0-4.693333 3.84-8.533333 8.533333-8.533333h46.933333z m341.333334 0c4.693333 0 8.533333 3.84 8.533333 8.533333v110.933334a8.533333 8.533333 0 0 1-8.533333 8.533333h-46.933334a8.533333 8.533333 0 0 1-8.533333-8.533333v-110.933334c0-4.693333 3.84-8.533333 8.533333-8.533333h46.933334zM384 618.666667H149.333333a21.333333 21.333333 0 0 0-21.184 18.837333L128 640v234.666667a21.333333 21.333333 0 0 0 18.837333 21.184L149.333333 896h234.666667a21.333333 21.333333 0 0 0 21.184-18.837333L405.333333 874.666667V640a21.333333 21.333333 0 0 0-18.837333-21.184L384 618.666667z m418.133333 149.333333c4.693333 0 8.533333 3.84 8.533334 8.533333v46.933334a8.533333 8.533333 0 0 1-8.533334 8.533333h-46.933333a8.533333 8.533333 0 0 1-8.533333-8.533333v-46.933334c0-4.693333 3.84-8.533333 8.533333-8.533333h46.933333zM298.666667 704a21.333333 21.333333 0 0 1 21.333333 21.333333v64a21.333333 21.333333 0 0 1-21.333333 21.333334h-64a21.333333 21.333333 0 0 1-21.333334-21.333334v-64a21.333333 21.333333 0 0 1 21.333334-21.333333h64z m503.466666-149.333333c4.693333 0 8.533333 3.84 8.533334 8.533333v46.933333a8.533333 8.533333 0 0 1-8.533334 8.533334H618.666667v64h119.466666c4.693333 0 8.533333 3.84 8.533334 8.533333v46.933333a8.533333 8.533333 0 0 1-8.533334 8.533334h-174.933333a8.533333 8.533333 0 0 1-8.533333-8.533334v-174.933333c0-4.693333 3.84-8.533333 8.533333-8.533333h238.933333z m149.333334 128c4.693333 0 8.533333 3.84 8.533333 8.533333v46.933333a8.533333 8.533333 0 0 1-8.533333 8.533334h-132.266667a8.533333 8.533333 0 0 1-8.533333-8.533334v-46.933333c0-4.693333 3.84-8.533333 8.533333-8.533333h132.266667z m0-128c4.693333 0 8.533333 3.84 8.533333 8.533333v46.933333a8.533333 8.533333 0 0 1-8.533333 8.533334h-46.933334a8.533333 8.533333 0 0 1-8.533333-8.533334v-46.933333c0-4.693333 3.84-8.533333 8.533333-8.533333h46.933334zM384 64a85.333333 85.333333 0 0 1 85.333333 85.333333v234.666667a85.333333 85.333333 0 0 1-85.333333 85.333333H149.333333a85.333333 85.333333 0 0 1-85.333333-85.333333V149.333333a85.333333 85.333333 0 0 1 85.333333-85.333333h234.666667z m490.666667 0a85.333333 85.333333 0 0 1 85.333333 85.333333v234.666667a85.333333 85.333333 0 0 1-85.333333 85.333333H640a85.333333 85.333333 0 0 1-85.333333-85.333333V149.333333a85.333333 85.333333 0 0 1 85.333333-85.333333h234.666667zM384 128H149.333333a21.333333 21.333333 0 0 0-21.184 18.837333L128 149.333333v234.666667a21.333333 21.333333 0 0 0 18.837333 21.184L149.333333 405.333333h234.666667a21.333333 21.333333 0 0 0 21.184-18.837333L405.333333 384V149.333333a21.333333 21.333333 0 0 0-18.837333-21.184L384 128z m490.666667 0H640a21.333333 21.333333 0 0 0-21.184 18.837333L618.666667 149.333333v234.666667a21.333333 21.333333 0 0 0 18.837333 21.184L640 405.333333h234.666667a21.333333 21.333333 0 0 0 21.184-18.837333L896 384V149.333333a21.333333 21.333333 0 0 0-18.837333-21.184L874.666667 128z m-576 85.333333a21.333333 21.333333 0 0 1 21.333333 21.333334v64a21.333333 21.333333 0 0 1-21.333333 21.333333h-64a21.333333 21.333333 0 0 1-21.333334-21.333333v-64a21.333333 21.333333 0 0 1 21.333334-21.333334h64z m490.666666 0a21.333333 21.333333 0 0 1 21.333334 21.333334v64a21.333333 21.333333 0 0 1-21.333334 21.333333h-64a21.333333 21.333333 0 0 1-21.333333-21.333333v-64a21.333333 21.333333 0 0 1 21.333333-21.333334h64z",
12
- fill: "currentColor",
13
- "p-id": "27545"
14
- }, null, -1)]]);
15
- }
16
- var S = /* @__PURE__ */ c(b, [["render", x]]), C = {}, w = {
17
- xmlns: "http://www.w3.org/2000/svg",
18
- viewBox: "0 0 24 24"
19
- };
20
- function T(e, t) {
21
- return h(), d("svg", w, [...t[0] ||= [f("path", {
22
- d: "M23 16a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h18a2 2 0 0 1 2 2v12ZM21 4H3v9h18V4ZM3 15v1h18v-1H3Zm3 6a1 1 0 0 1 1-1h10a1 1 0 1 1 0 2H7a1 1 0 0 1-1-1Z",
23
- fill: "currentColor"
24
- }, null, -1)]]);
25
- }
26
- var E = /* @__PURE__ */ c(C, [["render", T]]), D = {}, O = {
27
- xmlns: "http://www.w3.org/2000/svg",
28
- viewBox: "0 0 1024 1024"
29
- };
30
- function k(e, t) {
31
- return h(), d("svg", O, [...t[0] ||= [f("path", {
32
- d: "M128 669.866667v154.133333a72 72 0 0 0 67.776 71.893333l4.224 0.106667H354.133333c4.693333 0 8.533333 3.84 8.533334 8.533333v46.933334a8.533333 8.533333 0 0 1-8.533334 8.533333H205.482667A141.482667 141.482667 0 0 1 64 818.517333V669.866667c0-4.693333 3.84-8.533333 8.533333-8.533334h46.933334c4.693333 0 8.533333 3.84 8.533333 8.533334z m832 0v148.650666A141.482667 141.482667 0 0 1 818.517333 960H669.866667a8.533333 8.533333 0 0 1-8.533334-8.533333v-46.933334c0-4.693333 3.84-8.533333 8.533334-8.533333h154.133333a72 72 0 0 0 71.893333-67.776l0.106667-4.224V669.866667c0-4.693333 3.84-8.533333 8.533333-8.533334h46.933334c4.693333 0 8.533333 3.84 8.533333 8.533334z m0-170.666667v46.933333a8.533333 8.533333 0 0 1-8.533333 8.533334H72.533333a8.533333 8.533333 0 0 1-8.533333-8.533334v-46.933333c0-4.693333 3.84-8.533333 8.533333-8.533333h878.933334c4.693333 0 8.533333 3.84 8.533333 8.533333z m-597.333333-426.666667v46.933334a8.533333 8.533333 0 0 1-8.533334 8.533333H200a72 72 0 0 0-71.893333 67.776L128 200V354.133333a8.533333 8.533333 0 0 1-8.533333 8.533334H72.533333a8.533333 8.533333 0 0 1-8.533333-8.533334V205.482667A141.482667 141.482667 0 0 1 205.482667 64H354.133333c4.693333 0 8.533333 3.84 8.533334 8.533333zM818.517333 64A141.482667 141.482667 0 0 1 960 205.482667V354.133333a8.533333 8.533333 0 0 1-8.533333 8.533334h-46.933334a8.533333 8.533333 0 0 1-8.533333-8.533334V200a72 72 0 0 0-67.776-71.893333L824 128H669.866667a8.533333 8.533333 0 0 1-8.533334-8.533333V72.533333c0-4.693333 3.84-8.533333 8.533334-8.533333h148.650666z",
33
- fill: "currentColor"
34
- }, null, -1)]]);
35
- }
36
- var A = /* @__PURE__ */ c(D, [["render", k]]), j = /* @__PURE__ */ t((/* @__PURE__ */ n(((e, t) => {
37
- var n;
38
- (function(n, r) {
39
- typeof e == "object" ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : n.QRCode = r();
40
- })(e, function() {
41
- function e(e) {
42
- this.mode = r.MODE_8BIT_BYTE, this.data = e, this.parsedData = [];
43
- for (var t = 0, n = this.data.length; t < n; t++) {
44
- var i = [], a = this.data.charCodeAt(t);
45
- a > 65536 ? (i[0] = 240 | (a & 1835008) >>> 18, i[1] = 128 | (a & 258048) >>> 12, i[2] = 128 | (a & 4032) >>> 6, i[3] = 128 | a & 63) : a > 2048 ? (i[0] = 224 | (a & 61440) >>> 12, i[1] = 128 | (a & 4032) >>> 6, i[2] = 128 | a & 63) : a > 128 ? (i[0] = 192 | (a & 1984) >>> 6, i[1] = 128 | a & 63) : i[0] = a, this.parsedData.push(i);
46
- }
47
- this.parsedData = Array.prototype.concat.apply([], this.parsedData), this.parsedData.length != this.data.length && (this.parsedData.unshift(191), this.parsedData.unshift(187), this.parsedData.unshift(239));
48
- }
49
- e.prototype = {
50
- getLength: function(e) {
51
- return this.parsedData.length;
52
- },
53
- write: function(e) {
54
- for (var t = 0, n = this.parsedData.length; t < n; t++) e.put(this.parsedData[t], 8);
55
- }
56
- };
57
- function t(e, t) {
58
- this.typeNumber = e, this.errorCorrectLevel = t, this.modules = null, this.moduleCount = 0, this.dataCache = null, this.dataList = [];
59
- }
60
- t.prototype = {
61
- addData: function(t) {
62
- var n = new e(t);
63
- this.dataList.push(n), this.dataCache = null;
64
- },
65
- isDark: function(e, t) {
66
- if (e < 0 || this.moduleCount <= e || t < 0 || this.moduleCount <= t) throw Error(e + "," + t);
67
- return this.modules[e][t];
68
- },
69
- getModuleCount: function() {
70
- return this.moduleCount;
71
- },
72
- make: function() {
73
- this.makeImpl(!1, this.getBestMaskPattern());
74
- },
75
- makeImpl: function(e, n) {
76
- this.moduleCount = this.typeNumber * 4 + 17, this.modules = Array(this.moduleCount);
77
- for (var r = 0; r < this.moduleCount; r++) {
78
- this.modules[r] = Array(this.moduleCount);
79
- for (var i = 0; i < this.moduleCount; i++) this.modules[r][i] = null;
80
- }
81
- this.setupPositionProbePattern(0, 0), this.setupPositionProbePattern(this.moduleCount - 7, 0), this.setupPositionProbePattern(0, this.moduleCount - 7), this.setupPositionAdjustPattern(), this.setupTimingPattern(), this.setupTypeInfo(e, n), this.typeNumber >= 7 && this.setupTypeNumber(e), this.dataCache ??= t.createData(this.typeNumber, this.errorCorrectLevel, this.dataList), this.mapData(this.dataCache, n);
82
- },
83
- setupPositionProbePattern: function(e, t) {
84
- for (var n = -1; n <= 7; n++) if (!(e + n <= -1 || this.moduleCount <= e + n)) for (var r = -1; r <= 7; r++) t + r <= -1 || this.moduleCount <= t + r || (0 <= n && n <= 6 && (r == 0 || r == 6) || 0 <= r && r <= 6 && (n == 0 || n == 6) || 2 <= n && n <= 4 && 2 <= r && r <= 4 ? this.modules[e + n][t + r] = !0 : this.modules[e + n][t + r] = !1);
85
- },
86
- getBestMaskPattern: function() {
87
- for (var e = 0, t = 0, n = 0; n < 8; n++) {
88
- this.makeImpl(!0, n);
89
- var r = o.getLostPoint(this);
90
- (n == 0 || e > r) && (e = r, t = n);
91
- }
92
- return t;
93
- },
94
- createMovieClip: function(e, t, n) {
95
- var r = e.createEmptyMovieClip(t, n), i = 1;
96
- this.make();
97
- for (var a = 0; a < this.modules.length; a++) for (var o = a * i, s = 0; s < this.modules[a].length; s++) {
98
- var c = s * i;
99
- this.modules[a][s] && (r.beginFill(0, 100), r.moveTo(c, o), r.lineTo(c + i, o), r.lineTo(c + i, o + i), r.lineTo(c, o + i), r.endFill());
100
- }
101
- return r;
102
- },
103
- setupTimingPattern: function() {
104
- for (var e = 8; e < this.moduleCount - 8; e++) this.modules[e][6] ?? (this.modules[e][6] = e % 2 == 0);
105
- for (var t = 8; t < this.moduleCount - 8; t++) this.modules[6][t] ?? (this.modules[6][t] = t % 2 == 0);
106
- },
107
- setupPositionAdjustPattern: function() {
108
- for (var e = o.getPatternPosition(this.typeNumber), t = 0; t < e.length; t++) for (var n = 0; n < e.length; n++) {
109
- var r = e[t], i = e[n];
110
- if (this.modules[r][i] == null) for (var a = -2; a <= 2; a++) for (var s = -2; s <= 2; s++) a == -2 || a == 2 || s == -2 || s == 2 || a == 0 && s == 0 ? this.modules[r + a][i + s] = !0 : this.modules[r + a][i + s] = !1;
111
- }
112
- },
113
- setupTypeNumber: function(e) {
114
- for (var t = o.getBCHTypeNumber(this.typeNumber), n = 0; n < 18; n++) {
115
- var r = !e && (t >> n & 1) == 1;
116
- this.modules[Math.floor(n / 3)][n % 3 + this.moduleCount - 8 - 3] = r;
117
- }
118
- for (var n = 0; n < 18; n++) {
119
- var r = !e && (t >> n & 1) == 1;
120
- this.modules[n % 3 + this.moduleCount - 8 - 3][Math.floor(n / 3)] = r;
121
- }
122
- },
123
- setupTypeInfo: function(e, t) {
124
- for (var n = this.errorCorrectLevel << 3 | t, r = o.getBCHTypeInfo(n), i = 0; i < 15; i++) {
125
- var a = !e && (r >> i & 1) == 1;
126
- i < 6 ? this.modules[i][8] = a : i < 8 ? this.modules[i + 1][8] = a : this.modules[this.moduleCount - 15 + i][8] = a;
127
- }
128
- for (var i = 0; i < 15; i++) {
129
- var a = !e && (r >> i & 1) == 1;
130
- i < 8 ? this.modules[8][this.moduleCount - i - 1] = a : i < 9 ? this.modules[8][15 - i - 1 + 1] = a : this.modules[8][15 - i - 1] = a;
131
- }
132
- this.modules[this.moduleCount - 8][8] = !e;
133
- },
134
- mapData: function(e, t) {
135
- for (var n = -1, r = this.moduleCount - 1, i = 7, a = 0, s = this.moduleCount - 1; s > 0; s -= 2) for (s == 6 && s--;;) {
136
- for (var c = 0; c < 2; c++) if (this.modules[r][s - c] == null) {
137
- var l = !1;
138
- a < e.length && (l = (e[a] >>> i & 1) == 1), o.getMask(t, r, s - c) && (l = !l), this.modules[r][s - c] = l, i--, i == -1 && (a++, i = 7);
139
- }
140
- if (r += n, r < 0 || this.moduleCount <= r) {
141
- r -= n, n = -n;
142
- break;
143
- }
144
- }
145
- }
146
- }, t.PAD0 = 236, t.PAD1 = 17, t.createData = function(e, n, r) {
147
- for (var i = u.getRSBlocks(e, n), a = new d(), s = 0; s < r.length; s++) {
148
- var c = r[s];
149
- a.put(c.mode, 4), a.put(c.getLength(), o.getLengthInBits(c.mode, e)), c.write(a);
150
- }
151
- for (var l = 0, s = 0; s < i.length; s++) l += i[s].dataCount;
152
- if (a.getLengthInBits() > l * 8) throw Error("code length overflow. (" + a.getLengthInBits() + ">" + l * 8 + ")");
153
- for (a.getLengthInBits() + 4 <= l * 8 && a.put(0, 4); a.getLengthInBits() % 8 != 0;) a.putBit(!1);
154
- for (; !(a.getLengthInBits() >= l * 8 || (a.put(t.PAD0, 8), a.getLengthInBits() >= l * 8));) a.put(t.PAD1, 8);
155
- return t.createBytes(a, i);
156
- }, t.createBytes = function(e, t) {
157
- for (var n = 0, r = 0, i = 0, a = Array(t.length), s = Array(t.length), c = 0; c < t.length; c++) {
158
- var u = t[c].dataCount, d = t[c].totalCount - u;
159
- r = Math.max(r, u), i = Math.max(i, d), a[c] = Array(u);
160
- for (var f = 0; f < a[c].length; f++) a[c][f] = 255 & e.buffer[f + n];
161
- n += u;
162
- var p = o.getErrorCorrectPolynomial(d), m = new l(a[c], p.getLength() - 1).mod(p);
163
- s[c] = Array(p.getLength() - 1);
164
- for (var f = 0; f < s[c].length; f++) {
165
- var h = f + m.getLength() - s[c].length;
166
- s[c][f] = h >= 0 ? m.get(h) : 0;
167
- }
168
- }
169
- for (var g = 0, f = 0; f < t.length; f++) g += t[f].totalCount;
170
- for (var _ = Array(g), v = 0, f = 0; f < r; f++) for (var c = 0; c < t.length; c++) f < a[c].length && (_[v++] = a[c][f]);
171
- for (var f = 0; f < i; f++) for (var c = 0; c < t.length; c++) f < s[c].length && (_[v++] = s[c][f]);
172
- return _;
173
- };
174
- for (var r = {
175
- MODE_NUMBER: 1,
176
- MODE_ALPHA_NUM: 2,
177
- MODE_8BIT_BYTE: 4,
178
- MODE_KANJI: 8
179
- }, i = {
180
- L: 1,
181
- M: 0,
182
- Q: 3,
183
- H: 2
184
- }, a = {
185
- PATTERN000: 0,
186
- PATTERN001: 1,
187
- PATTERN010: 2,
188
- PATTERN011: 3,
189
- PATTERN100: 4,
190
- PATTERN101: 5,
191
- PATTERN110: 6,
192
- PATTERN111: 7
193
- }, o = {
194
- PATTERN_POSITION_TABLE: [
195
- [],
196
- [6, 18],
197
- [6, 22],
198
- [6, 26],
199
- [6, 30],
200
- [6, 34],
201
- [
202
- 6,
203
- 22,
204
- 38
205
- ],
206
- [
207
- 6,
208
- 24,
209
- 42
210
- ],
211
- [
212
- 6,
213
- 26,
214
- 46
215
- ],
216
- [
217
- 6,
218
- 28,
219
- 50
220
- ],
221
- [
222
- 6,
223
- 30,
224
- 54
225
- ],
226
- [
227
- 6,
228
- 32,
229
- 58
230
- ],
231
- [
232
- 6,
233
- 34,
234
- 62
235
- ],
236
- [
237
- 6,
238
- 26,
239
- 46,
240
- 66
241
- ],
242
- [
243
- 6,
244
- 26,
245
- 48,
246
- 70
247
- ],
248
- [
249
- 6,
250
- 26,
251
- 50,
252
- 74
253
- ],
254
- [
255
- 6,
256
- 30,
257
- 54,
258
- 78
259
- ],
260
- [
261
- 6,
262
- 30,
263
- 56,
264
- 82
265
- ],
266
- [
267
- 6,
268
- 30,
269
- 58,
270
- 86
271
- ],
272
- [
273
- 6,
274
- 34,
275
- 62,
276
- 90
277
- ],
278
- [
279
- 6,
280
- 28,
281
- 50,
282
- 72,
283
- 94
284
- ],
285
- [
286
- 6,
287
- 26,
288
- 50,
289
- 74,
290
- 98
291
- ],
292
- [
293
- 6,
294
- 30,
295
- 54,
296
- 78,
297
- 102
298
- ],
299
- [
300
- 6,
301
- 28,
302
- 54,
303
- 80,
304
- 106
305
- ],
306
- [
307
- 6,
308
- 32,
309
- 58,
310
- 84,
311
- 110
312
- ],
313
- [
314
- 6,
315
- 30,
316
- 58,
317
- 86,
318
- 114
319
- ],
320
- [
321
- 6,
322
- 34,
323
- 62,
324
- 90,
325
- 118
326
- ],
327
- [
328
- 6,
329
- 26,
330
- 50,
331
- 74,
332
- 98,
333
- 122
334
- ],
335
- [
336
- 6,
337
- 30,
338
- 54,
339
- 78,
340
- 102,
341
- 126
342
- ],
343
- [
344
- 6,
345
- 26,
346
- 52,
347
- 78,
348
- 104,
349
- 130
350
- ],
351
- [
352
- 6,
353
- 30,
354
- 56,
355
- 82,
356
- 108,
357
- 134
358
- ],
359
- [
360
- 6,
361
- 34,
362
- 60,
363
- 86,
364
- 112,
365
- 138
366
- ],
367
- [
368
- 6,
369
- 30,
370
- 58,
371
- 86,
372
- 114,
373
- 142
374
- ],
375
- [
376
- 6,
377
- 34,
378
- 62,
379
- 90,
380
- 118,
381
- 146
382
- ],
383
- [
384
- 6,
385
- 30,
386
- 54,
387
- 78,
388
- 102,
389
- 126,
390
- 150
391
- ],
392
- [
393
- 6,
394
- 24,
395
- 50,
396
- 76,
397
- 102,
398
- 128,
399
- 154
400
- ],
401
- [
402
- 6,
403
- 28,
404
- 54,
405
- 80,
406
- 106,
407
- 132,
408
- 158
409
- ],
410
- [
411
- 6,
412
- 32,
413
- 58,
414
- 84,
415
- 110,
416
- 136,
417
- 162
418
- ],
419
- [
420
- 6,
421
- 26,
422
- 54,
423
- 82,
424
- 110,
425
- 138,
426
- 166
427
- ],
428
- [
429
- 6,
430
- 30,
431
- 58,
432
- 86,
433
- 114,
434
- 142,
435
- 170
436
- ]
437
- ],
438
- G15: 1335,
439
- G18: 7973,
440
- G15_MASK: 21522,
441
- getBCHTypeInfo: function(e) {
442
- for (var t = e << 10; o.getBCHDigit(t) - o.getBCHDigit(o.G15) >= 0;) t ^= o.G15 << o.getBCHDigit(t) - o.getBCHDigit(o.G15);
443
- return (e << 10 | t) ^ o.G15_MASK;
444
- },
445
- getBCHTypeNumber: function(e) {
446
- for (var t = e << 12; o.getBCHDigit(t) - o.getBCHDigit(o.G18) >= 0;) t ^= o.G18 << o.getBCHDigit(t) - o.getBCHDigit(o.G18);
447
- return e << 12 | t;
448
- },
449
- getBCHDigit: function(e) {
450
- for (var t = 0; e != 0;) t++, e >>>= 1;
451
- return t;
452
- },
453
- getPatternPosition: function(e) {
454
- return o.PATTERN_POSITION_TABLE[e - 1];
455
- },
456
- getMask: function(e, t, n) {
457
- switch (e) {
458
- case a.PATTERN000: return (t + n) % 2 == 0;
459
- case a.PATTERN001: return t % 2 == 0;
460
- case a.PATTERN010: return n % 3 == 0;
461
- case a.PATTERN011: return (t + n) % 3 == 0;
462
- case a.PATTERN100: return (Math.floor(t / 2) + Math.floor(n / 3)) % 2 == 0;
463
- case a.PATTERN101: return t * n % 2 + t * n % 3 == 0;
464
- case a.PATTERN110: return (t * n % 2 + t * n % 3) % 2 == 0;
465
- case a.PATTERN111: return (t * n % 3 + (t + n) % 2) % 2 == 0;
466
- default: throw Error("bad maskPattern:" + e);
467
- }
468
- },
469
- getErrorCorrectPolynomial: function(e) {
470
- for (var t = new l([1], 0), n = 0; n < e; n++) t = t.multiply(new l([1, s.gexp(n)], 0));
471
- return t;
472
- },
473
- getLengthInBits: function(e, t) {
474
- if (1 <= t && t < 10) switch (e) {
475
- case r.MODE_NUMBER: return 10;
476
- case r.MODE_ALPHA_NUM: return 9;
477
- case r.MODE_8BIT_BYTE: return 8;
478
- case r.MODE_KANJI: return 8;
479
- default: throw Error("mode:" + e);
480
- }
481
- else if (t < 27) switch (e) {
482
- case r.MODE_NUMBER: return 12;
483
- case r.MODE_ALPHA_NUM: return 11;
484
- case r.MODE_8BIT_BYTE: return 16;
485
- case r.MODE_KANJI: return 10;
486
- default: throw Error("mode:" + e);
487
- }
488
- else if (t < 41) switch (e) {
489
- case r.MODE_NUMBER: return 14;
490
- case r.MODE_ALPHA_NUM: return 13;
491
- case r.MODE_8BIT_BYTE: return 16;
492
- case r.MODE_KANJI: return 12;
493
- default: throw Error("mode:" + e);
494
- }
495
- else throw Error("type:" + t);
496
- },
497
- getLostPoint: function(e) {
498
- for (var t = e.getModuleCount(), n = 0, r = 0; r < t; r++) for (var i = 0; i < t; i++) {
499
- for (var a = 0, o = e.isDark(r, i), s = -1; s <= 1; s++) if (!(r + s < 0 || t <= r + s)) for (var c = -1; c <= 1; c++) i + c < 0 || t <= i + c || s == 0 && c == 0 || o == e.isDark(r + s, i + c) && a++;
500
- a > 5 && (n += 3 + a - 5);
501
- }
502
- for (var r = 0; r < t - 1; r++) for (var i = 0; i < t - 1; i++) {
503
- var l = 0;
504
- e.isDark(r, i) && l++, e.isDark(r + 1, i) && l++, e.isDark(r, i + 1) && l++, e.isDark(r + 1, i + 1) && l++, (l == 0 || l == 4) && (n += 3);
505
- }
506
- for (var r = 0; r < t; r++) for (var i = 0; i < t - 6; i++) e.isDark(r, i) && !e.isDark(r, i + 1) && e.isDark(r, i + 2) && e.isDark(r, i + 3) && e.isDark(r, i + 4) && !e.isDark(r, i + 5) && e.isDark(r, i + 6) && (n += 40);
507
- for (var i = 0; i < t; i++) for (var r = 0; r < t - 6; r++) e.isDark(r, i) && !e.isDark(r + 1, i) && e.isDark(r + 2, i) && e.isDark(r + 3, i) && e.isDark(r + 4, i) && !e.isDark(r + 5, i) && e.isDark(r + 6, i) && (n += 40);
508
- for (var u = 0, i = 0; i < t; i++) for (var r = 0; r < t; r++) e.isDark(r, i) && u++;
509
- var d = Math.abs(100 * u / t / t - 50) / 5;
510
- return n += d * 10, n;
511
- }
512
- }, s = {
513
- glog: function(e) {
514
- if (e < 1) throw Error("glog(" + e + ")");
515
- return s.LOG_TABLE[e];
516
- },
517
- gexp: function(e) {
518
- for (; e < 0;) e += 255;
519
- for (; e >= 256;) e -= 255;
520
- return s.EXP_TABLE[e];
521
- },
522
- EXP_TABLE: Array(256),
523
- LOG_TABLE: Array(256)
524
- }, c = 0; c < 8; c++) s.EXP_TABLE[c] = 1 << c;
525
- for (var c = 8; c < 256; c++) s.EXP_TABLE[c] = s.EXP_TABLE[c - 4] ^ s.EXP_TABLE[c - 5] ^ s.EXP_TABLE[c - 6] ^ s.EXP_TABLE[c - 8];
526
- for (var c = 0; c < 255; c++) s.LOG_TABLE[s.EXP_TABLE[c]] = c;
527
- function l(e, t) {
528
- if (e.length == null) throw Error(e.length + "/" + t);
529
- for (var n = 0; n < e.length && e[n] == 0;) n++;
530
- this.num = Array(e.length - n + t);
531
- for (var r = 0; r < e.length - n; r++) this.num[r] = e[r + n];
532
- }
533
- l.prototype = {
534
- get: function(e) {
535
- return this.num[e];
536
- },
537
- getLength: function() {
538
- return this.num.length;
539
- },
540
- multiply: function(e) {
541
- for (var t = Array(this.getLength() + e.getLength() - 1), n = 0; n < this.getLength(); n++) for (var r = 0; r < e.getLength(); r++) t[n + r] ^= s.gexp(s.glog(this.get(n)) + s.glog(e.get(r)));
542
- return new l(t, 0);
543
- },
544
- mod: function(e) {
545
- if (this.getLength() - e.getLength() < 0) return this;
546
- for (var t = s.glog(this.get(0)) - s.glog(e.get(0)), n = Array(this.getLength()), r = 0; r < this.getLength(); r++) n[r] = this.get(r);
547
- for (var r = 0; r < e.getLength(); r++) n[r] ^= s.gexp(s.glog(e.get(r)) + t);
548
- return new l(n, 0).mod(e);
549
- }
550
- };
551
- function u(e, t) {
552
- this.totalCount = e, this.dataCount = t;
553
- }
554
- u.RS_BLOCK_TABLE = [
555
- [
556
- 1,
557
- 26,
558
- 19
559
- ],
560
- [
561
- 1,
562
- 26,
563
- 16
564
- ],
565
- [
566
- 1,
567
- 26,
568
- 13
569
- ],
570
- [
571
- 1,
572
- 26,
573
- 9
574
- ],
575
- [
576
- 1,
577
- 44,
578
- 34
579
- ],
580
- [
581
- 1,
582
- 44,
583
- 28
584
- ],
585
- [
586
- 1,
587
- 44,
588
- 22
589
- ],
590
- [
591
- 1,
592
- 44,
593
- 16
594
- ],
595
- [
596
- 1,
597
- 70,
598
- 55
599
- ],
600
- [
601
- 1,
602
- 70,
603
- 44
604
- ],
605
- [
606
- 2,
607
- 35,
608
- 17
609
- ],
610
- [
611
- 2,
612
- 35,
613
- 13
614
- ],
615
- [
616
- 1,
617
- 100,
618
- 80
619
- ],
620
- [
621
- 2,
622
- 50,
623
- 32
624
- ],
625
- [
626
- 2,
627
- 50,
628
- 24
629
- ],
630
- [
631
- 4,
632
- 25,
633
- 9
634
- ],
635
- [
636
- 1,
637
- 134,
638
- 108
639
- ],
640
- [
641
- 2,
642
- 67,
643
- 43
644
- ],
645
- [
646
- 2,
647
- 33,
648
- 15,
649
- 2,
650
- 34,
651
- 16
652
- ],
653
- [
654
- 2,
655
- 33,
656
- 11,
657
- 2,
658
- 34,
659
- 12
660
- ],
661
- [
662
- 2,
663
- 86,
664
- 68
665
- ],
666
- [
667
- 4,
668
- 43,
669
- 27
670
- ],
671
- [
672
- 4,
673
- 43,
674
- 19
675
- ],
676
- [
677
- 4,
678
- 43,
679
- 15
680
- ],
681
- [
682
- 2,
683
- 98,
684
- 78
685
- ],
686
- [
687
- 4,
688
- 49,
689
- 31
690
- ],
691
- [
692
- 2,
693
- 32,
694
- 14,
695
- 4,
696
- 33,
697
- 15
698
- ],
699
- [
700
- 4,
701
- 39,
702
- 13,
703
- 1,
704
- 40,
705
- 14
706
- ],
707
- [
708
- 2,
709
- 121,
710
- 97
711
- ],
712
- [
713
- 2,
714
- 60,
715
- 38,
716
- 2,
717
- 61,
718
- 39
719
- ],
720
- [
721
- 4,
722
- 40,
723
- 18,
724
- 2,
725
- 41,
726
- 19
727
- ],
728
- [
729
- 4,
730
- 40,
731
- 14,
732
- 2,
733
- 41,
734
- 15
735
- ],
736
- [
737
- 2,
738
- 146,
739
- 116
740
- ],
741
- [
742
- 3,
743
- 58,
744
- 36,
745
- 2,
746
- 59,
747
- 37
748
- ],
749
- [
750
- 4,
751
- 36,
752
- 16,
753
- 4,
754
- 37,
755
- 17
756
- ],
757
- [
758
- 4,
759
- 36,
760
- 12,
761
- 4,
762
- 37,
763
- 13
764
- ],
765
- [
766
- 2,
767
- 86,
768
- 68,
769
- 2,
770
- 87,
771
- 69
772
- ],
773
- [
774
- 4,
775
- 69,
776
- 43,
777
- 1,
778
- 70,
779
- 44
780
- ],
781
- [
782
- 6,
783
- 43,
784
- 19,
785
- 2,
786
- 44,
787
- 20
788
- ],
789
- [
790
- 6,
791
- 43,
792
- 15,
793
- 2,
794
- 44,
795
- 16
796
- ],
797
- [
798
- 4,
799
- 101,
800
- 81
801
- ],
802
- [
803
- 1,
804
- 80,
805
- 50,
806
- 4,
807
- 81,
808
- 51
809
- ],
810
- [
811
- 4,
812
- 50,
813
- 22,
814
- 4,
815
- 51,
816
- 23
817
- ],
818
- [
819
- 3,
820
- 36,
821
- 12,
822
- 8,
823
- 37,
824
- 13
825
- ],
826
- [
827
- 2,
828
- 116,
829
- 92,
830
- 2,
831
- 117,
832
- 93
833
- ],
834
- [
835
- 6,
836
- 58,
837
- 36,
838
- 2,
839
- 59,
840
- 37
841
- ],
842
- [
843
- 4,
844
- 46,
845
- 20,
846
- 6,
847
- 47,
848
- 21
849
- ],
850
- [
851
- 7,
852
- 42,
853
- 14,
854
- 4,
855
- 43,
856
- 15
857
- ],
858
- [
859
- 4,
860
- 133,
861
- 107
862
- ],
863
- [
864
- 8,
865
- 59,
866
- 37,
867
- 1,
868
- 60,
869
- 38
870
- ],
871
- [
872
- 8,
873
- 44,
874
- 20,
875
- 4,
876
- 45,
877
- 21
878
- ],
879
- [
880
- 12,
881
- 33,
882
- 11,
883
- 4,
884
- 34,
885
- 12
886
- ],
887
- [
888
- 3,
889
- 145,
890
- 115,
891
- 1,
892
- 146,
893
- 116
894
- ],
895
- [
896
- 4,
897
- 64,
898
- 40,
899
- 5,
900
- 65,
901
- 41
902
- ],
903
- [
904
- 11,
905
- 36,
906
- 16,
907
- 5,
908
- 37,
909
- 17
910
- ],
911
- [
912
- 11,
913
- 36,
914
- 12,
915
- 5,
916
- 37,
917
- 13
918
- ],
919
- [
920
- 5,
921
- 109,
922
- 87,
923
- 1,
924
- 110,
925
- 88
926
- ],
927
- [
928
- 5,
929
- 65,
930
- 41,
931
- 5,
932
- 66,
933
- 42
934
- ],
935
- [
936
- 5,
937
- 54,
938
- 24,
939
- 7,
940
- 55,
941
- 25
942
- ],
943
- [
944
- 11,
945
- 36,
946
- 12
947
- ],
948
- [
949
- 5,
950
- 122,
951
- 98,
952
- 1,
953
- 123,
954
- 99
955
- ],
956
- [
957
- 7,
958
- 73,
959
- 45,
960
- 3,
961
- 74,
962
- 46
963
- ],
964
- [
965
- 15,
966
- 43,
967
- 19,
968
- 2,
969
- 44,
970
- 20
971
- ],
972
- [
973
- 3,
974
- 45,
975
- 15,
976
- 13,
977
- 46,
978
- 16
979
- ],
980
- [
981
- 1,
982
- 135,
983
- 107,
984
- 5,
985
- 136,
986
- 108
987
- ],
988
- [
989
- 10,
990
- 74,
991
- 46,
992
- 1,
993
- 75,
994
- 47
995
- ],
996
- [
997
- 1,
998
- 50,
999
- 22,
1000
- 15,
1001
- 51,
1002
- 23
1003
- ],
1004
- [
1005
- 2,
1006
- 42,
1007
- 14,
1008
- 17,
1009
- 43,
1010
- 15
1011
- ],
1012
- [
1013
- 5,
1014
- 150,
1015
- 120,
1016
- 1,
1017
- 151,
1018
- 121
1019
- ],
1020
- [
1021
- 9,
1022
- 69,
1023
- 43,
1024
- 4,
1025
- 70,
1026
- 44
1027
- ],
1028
- [
1029
- 17,
1030
- 50,
1031
- 22,
1032
- 1,
1033
- 51,
1034
- 23
1035
- ],
1036
- [
1037
- 2,
1038
- 42,
1039
- 14,
1040
- 19,
1041
- 43,
1042
- 15
1043
- ],
1044
- [
1045
- 3,
1046
- 141,
1047
- 113,
1048
- 4,
1049
- 142,
1050
- 114
1051
- ],
1052
- [
1053
- 3,
1054
- 70,
1055
- 44,
1056
- 11,
1057
- 71,
1058
- 45
1059
- ],
1060
- [
1061
- 17,
1062
- 47,
1063
- 21,
1064
- 4,
1065
- 48,
1066
- 22
1067
- ],
1068
- [
1069
- 9,
1070
- 39,
1071
- 13,
1072
- 16,
1073
- 40,
1074
- 14
1075
- ],
1076
- [
1077
- 3,
1078
- 135,
1079
- 107,
1080
- 5,
1081
- 136,
1082
- 108
1083
- ],
1084
- [
1085
- 3,
1086
- 67,
1087
- 41,
1088
- 13,
1089
- 68,
1090
- 42
1091
- ],
1092
- [
1093
- 15,
1094
- 54,
1095
- 24,
1096
- 5,
1097
- 55,
1098
- 25
1099
- ],
1100
- [
1101
- 15,
1102
- 43,
1103
- 15,
1104
- 10,
1105
- 44,
1106
- 16
1107
- ],
1108
- [
1109
- 4,
1110
- 144,
1111
- 116,
1112
- 4,
1113
- 145,
1114
- 117
1115
- ],
1116
- [
1117
- 17,
1118
- 68,
1119
- 42
1120
- ],
1121
- [
1122
- 17,
1123
- 50,
1124
- 22,
1125
- 6,
1126
- 51,
1127
- 23
1128
- ],
1129
- [
1130
- 19,
1131
- 46,
1132
- 16,
1133
- 6,
1134
- 47,
1135
- 17
1136
- ],
1137
- [
1138
- 2,
1139
- 139,
1140
- 111,
1141
- 7,
1142
- 140,
1143
- 112
1144
- ],
1145
- [
1146
- 17,
1147
- 74,
1148
- 46
1149
- ],
1150
- [
1151
- 7,
1152
- 54,
1153
- 24,
1154
- 16,
1155
- 55,
1156
- 25
1157
- ],
1158
- [
1159
- 34,
1160
- 37,
1161
- 13
1162
- ],
1163
- [
1164
- 4,
1165
- 151,
1166
- 121,
1167
- 5,
1168
- 152,
1169
- 122
1170
- ],
1171
- [
1172
- 4,
1173
- 75,
1174
- 47,
1175
- 14,
1176
- 76,
1177
- 48
1178
- ],
1179
- [
1180
- 11,
1181
- 54,
1182
- 24,
1183
- 14,
1184
- 55,
1185
- 25
1186
- ],
1187
- [
1188
- 16,
1189
- 45,
1190
- 15,
1191
- 14,
1192
- 46,
1193
- 16
1194
- ],
1195
- [
1196
- 6,
1197
- 147,
1198
- 117,
1199
- 4,
1200
- 148,
1201
- 118
1202
- ],
1203
- [
1204
- 6,
1205
- 73,
1206
- 45,
1207
- 14,
1208
- 74,
1209
- 46
1210
- ],
1211
- [
1212
- 11,
1213
- 54,
1214
- 24,
1215
- 16,
1216
- 55,
1217
- 25
1218
- ],
1219
- [
1220
- 30,
1221
- 46,
1222
- 16,
1223
- 2,
1224
- 47,
1225
- 17
1226
- ],
1227
- [
1228
- 8,
1229
- 132,
1230
- 106,
1231
- 4,
1232
- 133,
1233
- 107
1234
- ],
1235
- [
1236
- 8,
1237
- 75,
1238
- 47,
1239
- 13,
1240
- 76,
1241
- 48
1242
- ],
1243
- [
1244
- 7,
1245
- 54,
1246
- 24,
1247
- 22,
1248
- 55,
1249
- 25
1250
- ],
1251
- [
1252
- 22,
1253
- 45,
1254
- 15,
1255
- 13,
1256
- 46,
1257
- 16
1258
- ],
1259
- [
1260
- 10,
1261
- 142,
1262
- 114,
1263
- 2,
1264
- 143,
1265
- 115
1266
- ],
1267
- [
1268
- 19,
1269
- 74,
1270
- 46,
1271
- 4,
1272
- 75,
1273
- 47
1274
- ],
1275
- [
1276
- 28,
1277
- 50,
1278
- 22,
1279
- 6,
1280
- 51,
1281
- 23
1282
- ],
1283
- [
1284
- 33,
1285
- 46,
1286
- 16,
1287
- 4,
1288
- 47,
1289
- 17
1290
- ],
1291
- [
1292
- 8,
1293
- 152,
1294
- 122,
1295
- 4,
1296
- 153,
1297
- 123
1298
- ],
1299
- [
1300
- 22,
1301
- 73,
1302
- 45,
1303
- 3,
1304
- 74,
1305
- 46
1306
- ],
1307
- [
1308
- 8,
1309
- 53,
1310
- 23,
1311
- 26,
1312
- 54,
1313
- 24
1314
- ],
1315
- [
1316
- 12,
1317
- 45,
1318
- 15,
1319
- 28,
1320
- 46,
1321
- 16
1322
- ],
1323
- [
1324
- 3,
1325
- 147,
1326
- 117,
1327
- 10,
1328
- 148,
1329
- 118
1330
- ],
1331
- [
1332
- 3,
1333
- 73,
1334
- 45,
1335
- 23,
1336
- 74,
1337
- 46
1338
- ],
1339
- [
1340
- 4,
1341
- 54,
1342
- 24,
1343
- 31,
1344
- 55,
1345
- 25
1346
- ],
1347
- [
1348
- 11,
1349
- 45,
1350
- 15,
1351
- 31,
1352
- 46,
1353
- 16
1354
- ],
1355
- [
1356
- 7,
1357
- 146,
1358
- 116,
1359
- 7,
1360
- 147,
1361
- 117
1362
- ],
1363
- [
1364
- 21,
1365
- 73,
1366
- 45,
1367
- 7,
1368
- 74,
1369
- 46
1370
- ],
1371
- [
1372
- 1,
1373
- 53,
1374
- 23,
1375
- 37,
1376
- 54,
1377
- 24
1378
- ],
1379
- [
1380
- 19,
1381
- 45,
1382
- 15,
1383
- 26,
1384
- 46,
1385
- 16
1386
- ],
1387
- [
1388
- 5,
1389
- 145,
1390
- 115,
1391
- 10,
1392
- 146,
1393
- 116
1394
- ],
1395
- [
1396
- 19,
1397
- 75,
1398
- 47,
1399
- 10,
1400
- 76,
1401
- 48
1402
- ],
1403
- [
1404
- 15,
1405
- 54,
1406
- 24,
1407
- 25,
1408
- 55,
1409
- 25
1410
- ],
1411
- [
1412
- 23,
1413
- 45,
1414
- 15,
1415
- 25,
1416
- 46,
1417
- 16
1418
- ],
1419
- [
1420
- 13,
1421
- 145,
1422
- 115,
1423
- 3,
1424
- 146,
1425
- 116
1426
- ],
1427
- [
1428
- 2,
1429
- 74,
1430
- 46,
1431
- 29,
1432
- 75,
1433
- 47
1434
- ],
1435
- [
1436
- 42,
1437
- 54,
1438
- 24,
1439
- 1,
1440
- 55,
1441
- 25
1442
- ],
1443
- [
1444
- 23,
1445
- 45,
1446
- 15,
1447
- 28,
1448
- 46,
1449
- 16
1450
- ],
1451
- [
1452
- 17,
1453
- 145,
1454
- 115
1455
- ],
1456
- [
1457
- 10,
1458
- 74,
1459
- 46,
1460
- 23,
1461
- 75,
1462
- 47
1463
- ],
1464
- [
1465
- 10,
1466
- 54,
1467
- 24,
1468
- 35,
1469
- 55,
1470
- 25
1471
- ],
1472
- [
1473
- 19,
1474
- 45,
1475
- 15,
1476
- 35,
1477
- 46,
1478
- 16
1479
- ],
1480
- [
1481
- 17,
1482
- 145,
1483
- 115,
1484
- 1,
1485
- 146,
1486
- 116
1487
- ],
1488
- [
1489
- 14,
1490
- 74,
1491
- 46,
1492
- 21,
1493
- 75,
1494
- 47
1495
- ],
1496
- [
1497
- 29,
1498
- 54,
1499
- 24,
1500
- 19,
1501
- 55,
1502
- 25
1503
- ],
1504
- [
1505
- 11,
1506
- 45,
1507
- 15,
1508
- 46,
1509
- 46,
1510
- 16
1511
- ],
1512
- [
1513
- 13,
1514
- 145,
1515
- 115,
1516
- 6,
1517
- 146,
1518
- 116
1519
- ],
1520
- [
1521
- 14,
1522
- 74,
1523
- 46,
1524
- 23,
1525
- 75,
1526
- 47
1527
- ],
1528
- [
1529
- 44,
1530
- 54,
1531
- 24,
1532
- 7,
1533
- 55,
1534
- 25
1535
- ],
1536
- [
1537
- 59,
1538
- 46,
1539
- 16,
1540
- 1,
1541
- 47,
1542
- 17
1543
- ],
1544
- [
1545
- 12,
1546
- 151,
1547
- 121,
1548
- 7,
1549
- 152,
1550
- 122
1551
- ],
1552
- [
1553
- 12,
1554
- 75,
1555
- 47,
1556
- 26,
1557
- 76,
1558
- 48
1559
- ],
1560
- [
1561
- 39,
1562
- 54,
1563
- 24,
1564
- 14,
1565
- 55,
1566
- 25
1567
- ],
1568
- [
1569
- 22,
1570
- 45,
1571
- 15,
1572
- 41,
1573
- 46,
1574
- 16
1575
- ],
1576
- [
1577
- 6,
1578
- 151,
1579
- 121,
1580
- 14,
1581
- 152,
1582
- 122
1583
- ],
1584
- [
1585
- 6,
1586
- 75,
1587
- 47,
1588
- 34,
1589
- 76,
1590
- 48
1591
- ],
1592
- [
1593
- 46,
1594
- 54,
1595
- 24,
1596
- 10,
1597
- 55,
1598
- 25
1599
- ],
1600
- [
1601
- 2,
1602
- 45,
1603
- 15,
1604
- 64,
1605
- 46,
1606
- 16
1607
- ],
1608
- [
1609
- 17,
1610
- 152,
1611
- 122,
1612
- 4,
1613
- 153,
1614
- 123
1615
- ],
1616
- [
1617
- 29,
1618
- 74,
1619
- 46,
1620
- 14,
1621
- 75,
1622
- 47
1623
- ],
1624
- [
1625
- 49,
1626
- 54,
1627
- 24,
1628
- 10,
1629
- 55,
1630
- 25
1631
- ],
1632
- [
1633
- 24,
1634
- 45,
1635
- 15,
1636
- 46,
1637
- 46,
1638
- 16
1639
- ],
1640
- [
1641
- 4,
1642
- 152,
1643
- 122,
1644
- 18,
1645
- 153,
1646
- 123
1647
- ],
1648
- [
1649
- 13,
1650
- 74,
1651
- 46,
1652
- 32,
1653
- 75,
1654
- 47
1655
- ],
1656
- [
1657
- 48,
1658
- 54,
1659
- 24,
1660
- 14,
1661
- 55,
1662
- 25
1663
- ],
1664
- [
1665
- 42,
1666
- 45,
1667
- 15,
1668
- 32,
1669
- 46,
1670
- 16
1671
- ],
1672
- [
1673
- 20,
1674
- 147,
1675
- 117,
1676
- 4,
1677
- 148,
1678
- 118
1679
- ],
1680
- [
1681
- 40,
1682
- 75,
1683
- 47,
1684
- 7,
1685
- 76,
1686
- 48
1687
- ],
1688
- [
1689
- 43,
1690
- 54,
1691
- 24,
1692
- 22,
1693
- 55,
1694
- 25
1695
- ],
1696
- [
1697
- 10,
1698
- 45,
1699
- 15,
1700
- 67,
1701
- 46,
1702
- 16
1703
- ],
1704
- [
1705
- 19,
1706
- 148,
1707
- 118,
1708
- 6,
1709
- 149,
1710
- 119
1711
- ],
1712
- [
1713
- 18,
1714
- 75,
1715
- 47,
1716
- 31,
1717
- 76,
1718
- 48
1719
- ],
1720
- [
1721
- 34,
1722
- 54,
1723
- 24,
1724
- 34,
1725
- 55,
1726
- 25
1727
- ],
1728
- [
1729
- 20,
1730
- 45,
1731
- 15,
1732
- 61,
1733
- 46,
1734
- 16
1735
- ]
1736
- ], u.getRSBlocks = function(e, t) {
1737
- var n = u.getRsBlockTable(e, t);
1738
- if (n == null) throw Error("bad rs block @ typeNumber:" + e + "/errorCorrectLevel:" + t);
1739
- for (var r = n.length / 3, i = [], a = 0; a < r; a++) for (var o = n[a * 3 + 0], s = n[a * 3 + 1], c = n[a * 3 + 2], l = 0; l < o; l++) i.push(new u(s, c));
1740
- return i;
1741
- }, u.getRsBlockTable = function(e, t) {
1742
- switch (t) {
1743
- case i.L: return u.RS_BLOCK_TABLE[(e - 1) * 4 + 0];
1744
- case i.M: return u.RS_BLOCK_TABLE[(e - 1) * 4 + 1];
1745
- case i.Q: return u.RS_BLOCK_TABLE[(e - 1) * 4 + 2];
1746
- case i.H: return u.RS_BLOCK_TABLE[(e - 1) * 4 + 3];
1747
- default: return;
1748
- }
1749
- };
1750
- function d() {
1751
- this.buffer = [], this.length = 0;
1752
- }
1753
- d.prototype = {
1754
- get: function(e) {
1755
- var t = Math.floor(e / 8);
1756
- return (this.buffer[t] >>> 7 - e % 8 & 1) == 1;
1757
- },
1758
- put: function(e, t) {
1759
- for (var n = 0; n < t; n++) this.putBit((e >>> t - n - 1 & 1) == 1);
1760
- },
1761
- getLengthInBits: function() {
1762
- return this.length;
1763
- },
1764
- putBit: function(e) {
1765
- var t = Math.floor(this.length / 8);
1766
- this.buffer.length <= t && this.buffer.push(0), e && (this.buffer[t] |= 128 >>> this.length % 8), this.length++;
1767
- }
1768
- };
1769
- var f = [
1770
- [
1771
- 17,
1772
- 14,
1773
- 11,
1774
- 7
1775
- ],
1776
- [
1777
- 32,
1778
- 26,
1779
- 20,
1780
- 14
1781
- ],
1782
- [
1783
- 53,
1784
- 42,
1785
- 32,
1786
- 24
1787
- ],
1788
- [
1789
- 78,
1790
- 62,
1791
- 46,
1792
- 34
1793
- ],
1794
- [
1795
- 106,
1796
- 84,
1797
- 60,
1798
- 44
1799
- ],
1800
- [
1801
- 134,
1802
- 106,
1803
- 74,
1804
- 58
1805
- ],
1806
- [
1807
- 154,
1808
- 122,
1809
- 86,
1810
- 64
1811
- ],
1812
- [
1813
- 192,
1814
- 152,
1815
- 108,
1816
- 84
1817
- ],
1818
- [
1819
- 230,
1820
- 180,
1821
- 130,
1822
- 98
1823
- ],
1824
- [
1825
- 271,
1826
- 213,
1827
- 151,
1828
- 119
1829
- ],
1830
- [
1831
- 321,
1832
- 251,
1833
- 177,
1834
- 137
1835
- ],
1836
- [
1837
- 367,
1838
- 287,
1839
- 203,
1840
- 155
1841
- ],
1842
- [
1843
- 425,
1844
- 331,
1845
- 241,
1846
- 177
1847
- ],
1848
- [
1849
- 458,
1850
- 362,
1851
- 258,
1852
- 194
1853
- ],
1854
- [
1855
- 520,
1856
- 412,
1857
- 292,
1858
- 220
1859
- ],
1860
- [
1861
- 586,
1862
- 450,
1863
- 322,
1864
- 250
1865
- ],
1866
- [
1867
- 644,
1868
- 504,
1869
- 364,
1870
- 280
1871
- ],
1872
- [
1873
- 718,
1874
- 560,
1875
- 394,
1876
- 310
1877
- ],
1878
- [
1879
- 792,
1880
- 624,
1881
- 442,
1882
- 338
1883
- ],
1884
- [
1885
- 858,
1886
- 666,
1887
- 482,
1888
- 382
1889
- ],
1890
- [
1891
- 929,
1892
- 711,
1893
- 509,
1894
- 403
1895
- ],
1896
- [
1897
- 1003,
1898
- 779,
1899
- 565,
1900
- 439
1901
- ],
1902
- [
1903
- 1091,
1904
- 857,
1905
- 611,
1906
- 461
1907
- ],
1908
- [
1909
- 1171,
1910
- 911,
1911
- 661,
1912
- 511
1913
- ],
1914
- [
1915
- 1273,
1916
- 997,
1917
- 715,
1918
- 535
1919
- ],
1920
- [
1921
- 1367,
1922
- 1059,
1923
- 751,
1924
- 593
1925
- ],
1926
- [
1927
- 1465,
1928
- 1125,
1929
- 805,
1930
- 625
1931
- ],
1932
- [
1933
- 1528,
1934
- 1190,
1935
- 868,
1936
- 658
1937
- ],
1938
- [
1939
- 1628,
1940
- 1264,
1941
- 908,
1942
- 698
1943
- ],
1944
- [
1945
- 1732,
1946
- 1370,
1947
- 982,
1948
- 742
1949
- ],
1950
- [
1951
- 1840,
1952
- 1452,
1953
- 1030,
1954
- 790
1955
- ],
1956
- [
1957
- 1952,
1958
- 1538,
1959
- 1112,
1960
- 842
1961
- ],
1962
- [
1963
- 2068,
1964
- 1628,
1965
- 1168,
1966
- 898
1967
- ],
1968
- [
1969
- 2188,
1970
- 1722,
1971
- 1228,
1972
- 958
1973
- ],
1974
- [
1975
- 2303,
1976
- 1809,
1977
- 1283,
1978
- 983
1979
- ],
1980
- [
1981
- 2431,
1982
- 1911,
1983
- 1351,
1984
- 1051
1985
- ],
1986
- [
1987
- 2563,
1988
- 1989,
1989
- 1423,
1990
- 1093
1991
- ],
1992
- [
1993
- 2699,
1994
- 2099,
1995
- 1499,
1996
- 1139
1997
- ],
1998
- [
1999
- 2809,
2000
- 2213,
2001
- 1579,
2002
- 1219
2003
- ],
2004
- [
2005
- 2953,
2006
- 2331,
2007
- 1663,
2008
- 1273
2009
- ]
2010
- ];
2011
- function p() {
2012
- return typeof CanvasRenderingContext2D < "u";
2013
- }
2014
- function m() {
2015
- var e = !1, t = navigator.userAgent;
2016
- if (/android/i.test(t)) {
2017
- e = !0;
2018
- var n = t.toString().match(/android ([0-9]\.[0-9])/i);
2019
- n && n[1] && (e = parseFloat(n[1]));
2020
- }
2021
- return e;
2022
- }
2023
- var h = (function() {
2024
- var e = function(e, t) {
2025
- this._el = e, this._htOption = t;
2026
- };
2027
- return e.prototype.draw = function(e) {
2028
- var t = this._htOption, n = this._el, r = e.getModuleCount();
2029
- Math.floor(t.width / r), Math.floor(t.height / r), this.clear();
2030
- function i(e, t) {
2031
- var n = document.createElementNS("http://www.w3.org/2000/svg", e);
2032
- for (var r in t) t.hasOwnProperty(r) && n.setAttribute(r, t[r]);
2033
- return n;
2034
- }
2035
- var a = i("svg", {
2036
- viewBox: "0 0 " + String(r) + " " + String(r),
2037
- width: "100%",
2038
- height: "100%",
2039
- fill: t.colorLight
2040
- });
2041
- a.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:xlink", "http://www.w3.org/1999/xlink"), n.appendChild(a), a.appendChild(i("rect", {
2042
- fill: t.colorLight,
2043
- width: "100%",
2044
- height: "100%"
2045
- })), a.appendChild(i("rect", {
2046
- fill: t.colorDark,
2047
- width: "1",
2048
- height: "1",
2049
- id: "template"
2050
- }));
2051
- for (var o = 0; o < r; o++) for (var s = 0; s < r; s++) if (e.isDark(o, s)) {
2052
- var c = i("use", {
2053
- x: String(s),
2054
- y: String(o)
2055
- });
2056
- c.setAttributeNS("http://www.w3.org/1999/xlink", "href", "#template"), a.appendChild(c);
2057
- }
2058
- }, e.prototype.clear = function() {
2059
- for (; this._el.hasChildNodes();) this._el.removeChild(this._el.lastChild);
2060
- }, e;
2061
- })(), g = document.documentElement.tagName.toLowerCase() === "svg" ? h : p() ? (function() {
2062
- function e() {
2063
- this._elImage.src = this._elCanvas.toDataURL("image/png"), this._elImage.style.display = "block", this._elCanvas.style.display = "none";
2064
- }
2065
- if (this && this._android && this._android <= 2.1) {
2066
- var t = 1 / window.devicePixelRatio, n = CanvasRenderingContext2D.prototype.drawImage;
2067
- CanvasRenderingContext2D.prototype.drawImage = function(e, r, i, a, o, s, c, l, u) {
2068
- if ("nodeName" in e && /img/i.test(e.nodeName)) for (var d = arguments.length - 1; d >= 1; d--) arguments[d] = arguments[d] * t;
2069
- else l === void 0 && (arguments[1] *= t, arguments[2] *= t, arguments[3] *= t, arguments[4] *= t);
2070
- n.apply(this, arguments);
2071
- };
2072
- }
2073
- function r(e, t) {
2074
- var n = this;
2075
- if (n._fFail = t, n._fSuccess = e, n._bSupportDataURI === null) {
2076
- var r = document.createElement("img"), i = function() {
2077
- n._bSupportDataURI = !1, n._fFail && n._fFail.call(n);
2078
- };
2079
- r.onabort = i, r.onerror = i, r.onload = function() {
2080
- n._bSupportDataURI = !0, n._fSuccess && n._fSuccess.call(n);
2081
- }, r.src = "data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==";
2082
- return;
2083
- } else n._bSupportDataURI === !0 && n._fSuccess ? n._fSuccess.call(n) : n._bSupportDataURI === !1 && n._fFail && n._fFail.call(n);
2084
- }
2085
- var i = function(e, t) {
2086
- this._bIsPainted = !1, this._android = m(), this._htOption = t, this._elCanvas = document.createElement("canvas"), this._elCanvas.width = t.width, this._elCanvas.height = t.height, e.appendChild(this._elCanvas), this._el = e, this._oContext = this._elCanvas.getContext("2d"), this._bIsPainted = !1, this._elImage = document.createElement("img"), this._elImage.alt = "Scan me!", this._elImage.style.display = "none", this._el.appendChild(this._elImage), this._bSupportDataURI = null;
2087
- };
2088
- return i.prototype.draw = function(e) {
2089
- var t = this._elImage, n = this._oContext, r = this._htOption, i = e.getModuleCount(), a = r.width / i, o = r.height / i, s = Math.round(a), c = Math.round(o);
2090
- t.style.display = "none", this.clear();
2091
- for (var l = 0; l < i; l++) for (var u = 0; u < i; u++) {
2092
- var d = e.isDark(l, u), f = u * a, p = l * o;
2093
- n.strokeStyle = d ? r.colorDark : r.colorLight, n.lineWidth = 1, n.fillStyle = d ? r.colorDark : r.colorLight, n.fillRect(f, p, a, o), n.strokeRect(Math.floor(f) + .5, Math.floor(p) + .5, s, c), n.strokeRect(Math.ceil(f) - .5, Math.ceil(p) - .5, s, c);
2094
- }
2095
- this._bIsPainted = !0;
2096
- }, i.prototype.makeImage = function() {
2097
- this._bIsPainted && r.call(this, e);
2098
- }, i.prototype.isPainted = function() {
2099
- return this._bIsPainted;
2100
- }, i.prototype.clear = function() {
2101
- this._oContext.clearRect(0, 0, this._elCanvas.width, this._elCanvas.height), this._bIsPainted = !1;
2102
- }, i.prototype.round = function(e) {
2103
- return e && Math.floor(e * 1e3) / 1e3;
2104
- }, i;
2105
- })() : (function() {
2106
- var e = function(e, t) {
2107
- this._el = e, this._htOption = t;
2108
- };
2109
- return e.prototype.draw = function(e) {
2110
- for (var t = this._htOption, n = this._el, r = e.getModuleCount(), i = Math.floor(t.width / r), a = Math.floor(t.height / r), o = ["<table style=\"border:0;border-collapse:collapse;\">"], s = 0; s < r; s++) {
2111
- o.push("<tr>");
2112
- for (var c = 0; c < r; c++) o.push("<td style=\"border:0;border-collapse:collapse;padding:0;margin:0;width:" + i + "px;height:" + a + "px;background-color:" + (e.isDark(s, c) ? t.colorDark : t.colorLight) + ";\"></td>");
2113
- o.push("</tr>");
2114
- }
2115
- o.push("</table>"), n.innerHTML = o.join("");
2116
- var l = n.childNodes[0], u = (t.width - l.offsetWidth) / 2, d = (t.height - l.offsetHeight) / 2;
2117
- u > 0 && d > 0 && (l.style.margin = d + "px " + u + "px");
2118
- }, e.prototype.clear = function() {
2119
- this._el.innerHTML = "";
2120
- }, e;
2121
- })();
2122
- function _(e, t) {
2123
- for (var n = 1, r = v(e), a = 0, o = f.length; a <= o; a++) {
2124
- var s = 0;
2125
- switch (t) {
2126
- case i.L:
2127
- s = f[a][0];
2128
- break;
2129
- case i.M:
2130
- s = f[a][1];
2131
- break;
2132
- case i.Q:
2133
- s = f[a][2];
2134
- break;
2135
- case i.H:
2136
- s = f[a][3];
2137
- break;
2138
- }
2139
- if (r <= s) break;
2140
- n++;
2141
- }
2142
- if (n > f.length) throw Error("Too long data");
2143
- return n;
2144
- }
2145
- function v(e) {
2146
- var t = encodeURI(e).toString().replace(/\%[0-9a-fA-F]{2}/g, "a");
2147
- return t.length + (t.length == e ? 0 : 3);
2148
- }
2149
- return n = function(e, t) {
2150
- if (this._htOption = {
2151
- width: 256,
2152
- height: 256,
2153
- typeNumber: 4,
2154
- colorDark: "#000000",
2155
- colorLight: "#ffffff",
2156
- correctLevel: i.H
2157
- }, typeof t == "string" && (t = { text: t }), t) for (var n in t) this._htOption[n] = t[n];
2158
- typeof e == "string" && (e = document.getElementById(e)), this._htOption.useSVG && (g = h), this._android = m(), this._el = e, this._oQRCode = null, this._oDrawing = new g(this._el, this._htOption), this._htOption.text && this.makeCode(this._htOption.text);
2159
- }, n.prototype.makeCode = function(e) {
2160
- this._oQRCode = new t(_(e, this._htOption.correctLevel), this._htOption.correctLevel), this._oQRCode.addData(e), this._oQRCode.make(), this._el.title = e, this._oDrawing.draw(this._oQRCode), this.makeImage();
2161
- }, n.prototype.makeImage = function() {
2162
- typeof this._oDrawing.makeImage == "function" && (!this._android || this._android >= 3) && this._oDrawing.makeImage();
2163
- }, n.prototype.clear = function() {
2164
- this._oDrawing.clear();
2165
- }, n.CorrectLevel = i, n;
2166
- });
2167
- })))()), M = { class: "cloud-login-wrap" }, N = {
2168
- key: 0,
2169
- class: "cloud-login-main"
2170
- }, P = { class: "cloud-login-logo no-dark-content can-click" }, F = ["src"], I = {
2171
- key: 0,
2172
- class: "cloud-login-box"
2173
- }, L = { class: "login-title" }, R = { class: "login-subtitle" }, z = { class: "cloud-login-mode-access" }, B = { class: "login-switch" }, te = {
2174
- key: 1,
2175
- class: "cloud-login-box"
2176
- }, V = { class: "login-mode-switch" }, H = { class: "login-mode-switch-box" }, U = { class: "login-title" }, W = { class: "login-subtitle" }, G = { class: "cloud-login-mode-access" }, K = {
2177
- key: 0,
2178
- class: "code-load"
2179
- }, q = {
2180
- key: 1,
2181
- class: "code-error"
2182
- }, J = ["src"], Y = { class: "cloud-login-other" }, X = { class: "cloud-login-other" }, Z = {
2183
- key: 0,
2184
- class: "login-switch"
2185
- }, Q = {
2186
- key: 1,
2187
- class: "page-login-oauth"
2188
- }, ne = {
2189
- key: 2,
2190
- class: "cloud-login-box"
2191
- }, re = { class: "login-mode-switch" }, ie = { class: "login-mode-switch-box" }, ae = { class: "login-title" }, oe = { class: "login-subtitle" }, $ = {
2192
- id: "qrcode",
2193
- ref: "qrCodeUrl"
2194
- }, se = {
2195
- key: 3,
2196
- class: "cloud-login-box"
2197
- }, ce = { class: "login-title" }, le = { class: "login-subtitle" }, ue = { class: "cloud-login-mode-access" }, de = { class: "page-login-oauth" }, fe = /* @__PURE__ */ Object.assign({
2198
- data() {
2199
- return {
2200
- loadOngoing: !1,
2201
- loginMode: "access",
2202
- loginJump: !1,
2203
- cache_remember: "off",
2204
- cache_privacy: "off",
2205
- account_mobile: "",
2206
- account_password: "",
2207
- account_password2: "",
2208
- captcha_code: "",
2209
- sms_code: "",
2210
- account_business_id: 0,
2211
- reg_invite: "",
2212
- regInviteNeed: !1,
2213
- codeNeed: !1,
2214
- codeLoad: 0,
2215
- codeKey: "",
2216
- codeUrl: "",
2217
- chainShowFlag: !1,
2218
- chainAccountList: [],
2219
- chainTempToken: "",
2220
- qrcodeExpiredShow: !1,
2221
- qrcodeTimer: null,
2222
- qrcodeLoad: !1,
2223
- qrcodeScanVernum: 15,
2224
- qrcodeScanVererr: 0,
2225
- copyright_info: ""
2226
- };
2227
- },
2228
- watch: {
2229
- $route({ query: e }) {
2230
- e.type == "reg" && this.$nextTick(() => {
2231
- this.loginMode = "reg";
2232
- });
2233
- },
2234
- account_mobile(e) {
2235
- this.$nextTick(() => {
2236
- let e = this.$refs.account_mobile?.$el?.querySelector("input");
2237
- if (e) {
2238
- let t = getComputedStyle(e).background.match(/rgb\((\d+,\s*\d+,\s*\d+)\)/);
2239
- t && t[0] === "rgb(232, 240, 254)" && this.onBlur();
2240
- }
2241
- });
2242
- },
2243
- loginMode(e) {
2244
- e == "reg" && (this.regInviteNeed = !!this.cacheInstConfig.reg_invite_need);
2245
- }
2246
- },
2247
- computed: {},
2248
- created() {
2249
- this.cache_remember = localStorage.getItem("cacheLoginRemember") || "off", this.cache_privacy = localStorage.getItem("cacheLoginPrivacy") || "off", this.account_mobile = localStorage.getItem("cacheLoginMobile") || "";
2250
- },
2251
- async mounted() {
2252
- this.loginMode = this.$route.query.type === "reg" ? "reg" : "access", this.$Electron && (this.$Electron.sendMessage("webTabDestroyAll"), this.$Electron.sendMessage("childWindowDestroyAll")), r().$subscribe((e, t) => {
2253
- e.events.key == "useSSOLogin" && t.useSSOLogin == 1 && this.inputServerUrl();
2254
- });
2255
- },
2256
- beforeDestroy() {
2257
- clearInterval(this.qrcodeTimer), this.loginJump = !1, this.account_password = "", this.account_password2 = "", this.captcha_code = "", this.reg_invite = "";
2258
- },
2259
- methods: {
2260
- handleRemember(e) {
2261
- e == "on" ? localStorage.setItem("cacheLoginRemember", e) : localStorage.removeItem("cacheLoginRemember");
2262
- },
2263
- handleRrivacy(e) {
2264
- e == "on" ? (localStorage.setItem("cacheLoginPrivacy", e), this.chackServerUrl().catch((e) => {})) : localStorage.removeItem("cacheLoginPrivacy"), this.cache_privacy = e;
2265
- },
2266
- handleForgot() {
2267
- this.$message.warning("请联系管理员!");
2268
- },
2269
- chackServerUrl(e) {
2270
- return new Promise((e, t) => {
2271
- e();
2272
- });
2273
- },
2274
- switchLoginMode(e) {
2275
- this.chackServerUrl(!0).then(() => {
2276
- clearInterval(this.qrcodeTimer), e === "qrcode" ? (this.loginMode = "qrcode", this.scanQrcodeRefresh()) : e === "access" ? this.loginMode = "access" : e === "smsLogin" ? (this.loginMode = "smsLogin", this.refreshCode()) : this.loginMode = e;
2277
- });
2278
- },
2279
- refreshCode() {
2280
- this.captcha_code = "", !(this.codeLoad > 0) && (setTimeout((e) => {
2281
- this.codeLoad++;
2282
- }, 600), this.$request.flagGet("BASE_PASSPORT_CODE_DATA", { account_mobile: this.account_mobile }).then(({ data: e }) => {
2283
- this.codeKey = e.key, this.codeUrl = e.img, this.$refs.captcha_code?.focus();
2284
- }).catch((e) => {
2285
- this.codeUrl = "error";
2286
- }).finally((e) => {
2287
- this.codeLoad--;
2288
- }));
2289
- },
2290
- onBlur() {
2291
- if (!this.account_mobile) {
2292
- this.codeNeed = !1;
2293
- return;
2294
- }
2295
- this.loadOngoing = !0, this.$request.flagGet("BASE_PASSPORT_CODE_NEED", { account_mobile: this.account_mobile }).then((e) => {
2296
- this.loadOngoing = !1, e.data == "need" ? (this.refreshCode(), this.codeNeed = !0) : this.codeNeed = !1;
2297
- }).catch((e) => {
2298
- this.loadOngoing = !1;
2299
- }).finally((e) => {
2300
- this.loadOngoing = !1;
2301
- });
2302
- },
2303
- accessLoginFunc() {
2304
- if (this.loadOngoing) return this.$message({
2305
- type: "warning",
2306
- message: "正在登录中,请勿重新确认~"
2307
- }), !1;
2308
- this.chackServerUrl(!0).then(() => {
2309
- if (this.account_mobile = cvUtils.strTrimAll(this.account_mobile), this.account_password = cvUtils.strTrimAll(this.account_password), this.account_password2 = cvUtils.strTrimAll(this.account_password2), this.captcha_code = cvUtils.strTrimAll(this.captcha_code), this.reg_invite = cvUtils.strTrimAll(this.reg_invite), this.cache_privacy != "on") {
2310
- this.$message.warning("请同意协议");
2311
- return;
2312
- }
2313
- if (!cvUtils.isMobile(this.account_mobile)) {
2314
- this.$message.warning("请输入正确的手机号码"), this.$refs.account_mobile.focus();
2315
- return;
2316
- }
2317
- if (!this.account_password) {
2318
- this.$message.warning("请输入密码"), this.$refs.account_password.focus();
2319
- return;
2320
- }
2321
- if (this.loginMode == "reg" && this.account_password != this.account_password2) {
2322
- this.$message.warning("确认密码输入不一致"), this.$refs.account_password2.focus();
2323
- return;
2324
- }
2325
- if (this.codeNeed && !this.captcha_code) {
2326
- this.$message.warning("请输入验证码"), this.$refs.captcha_code.focus();
2327
- return;
2328
- }
2329
- let e = {};
2330
- this.loginMode == "access" ? e = {
2331
- handleType: "MobilePwdLogin",
2332
- account_mobile: this.account_mobile,
2333
- business_id: this.account_business_id,
2334
- account_password: this.account_password,
2335
- captcha_code: this.captcha_code,
2336
- captcha_key: this.codeKey
2337
- } : this.loginMode == "reg" && (e = {
2338
- handleType: "MobilePwdLogin",
2339
- account_mobile: this.account_mobile,
2340
- business_id: this.account_business_id,
2341
- account_password: this.account_password,
2342
- captcha_code: this.captcha_code,
2343
- captcha_key: this.codeKey,
2344
- reg_invite: this.reg_invite
2345
- }), this.commonLoginIng(e);
2346
- });
2347
- },
2348
- chainBusinessCheck(e) {
2349
- this.account_mobile = e.account_mobile_show, this.account_business_id = e.business_id, (e.acc_rules_type == "sy-org-admin" || e.acc_rules_type == "sy-org-staff") && this.commonLoginIng({
2350
- handleType: "OrgTokenLogin",
2351
- account_mobile: this.account_mobile,
2352
- business_id: this.account_business_id,
2353
- temp_token: this.chainTempToken || ""
2354
- });
2355
- },
2356
- commonLoginIng(e) {
2357
- let t = this.$message({
2358
- iconClass: "ElIconLoading",
2359
- message: "正在登录...",
2360
- duration: 0
2361
- });
2362
- this.loadOngoing = !0, localStorage.setItem("cacheLoginMobile", this.account_mobile);
2363
- try {
2364
- this.$request.setOptions({ timeout: 1e4 }).flagPost("BASE_PASSPORT_PASSPORT", { ...e }).then((e) => {
2365
- t.close(), this.loadOngoing = !1, e.code == 0 ? this.commonLoginSucc(e) : e.code == 400130 ? (this.$message.error("验证码有误!"), this.refreshCode(), this.codeNeed = !0) : (this.$message.error(e.message), this.refreshCode());
2366
- }).catch((e) => {
2367
- this.loadOngoing = !1, this.chainShowFlag = !1, t.close(), this.refreshCode(), this.codeNeed = !0;
2368
- });
2369
- } catch {
2370
- this.$message.error("登录异常"), t.close(), this.loadOngoing = !1, this.refreshCode();
2371
- }
2372
- },
2373
- async commonLoginSucc(e) {
2374
- let t = e.data || {};
2375
- if (t.result_type == "chain") this.chainAccountList = t.result_data || [], this.chainShowFlag = !0, this.chainTempToken = t.result_token || "";
2376
- else {
2377
- let e = t.result_data || {};
2378
- await o().SA_ACCOUNT_SIGNIN(e), this.codeNeed = !1, this.$message({
2379
- type: "success",
2380
- message: "登录成功...",
2381
- duration: 800,
2382
- onClose: () => {
2383
- this.goNext();
2384
- }
2385
- });
2386
- }
2387
- },
2388
- chainReselection() {
2389
- this.refreshCode(), this.chainShowFlag = !1;
2390
- },
2391
- scanCreate(e) {
2392
- new j.default(this.$refs.qrCodeUrl, {
2393
- text: e,
2394
- width: 180,
2395
- height: 180,
2396
- margin: 2,
2397
- colorDark: "#000000",
2398
- colorLight: "#ffffff",
2399
- correctLevel: j.default.CorrectLevel.L
2400
- });
2401
- },
2402
- scanQrcodeRefresh() {
2403
- if (this.loginMode != "qrcode" || this.qrcodeLoad) return !1;
2404
- this.qrcodeExpiredShow = !1, this.qrcodeScanVererr = 0, this.$nextTick(() => {
2405
- document.getElementById("qrcode").innerHTML = "", clearInterval(this.qrcodeTimer), this.qrcodeLoad = !0, this.$request.flagGet("BASE_PASSPORT_SCAN_QRCODE", {
2406
- name: "app",
2407
- fun: "scanQrcode"
2408
- }).then((e) => {
2409
- this.scanCreate(e?.data?.checkLogin), this.qrcodeTimer = window.setInterval(() => {
2410
- this.scanCheckFunc(e?.data?.scanCode);
2411
- }, 3e3);
2412
- }).catch((e) => {}).finally((e) => {
2413
- this.qrcodeLoad = !1;
2414
- });
2415
- });
2416
- },
2417
- scanCheckFunc(e) {
2418
- if (this.qrcodeScanVererr++, this.qrcodeScanVererr > this.qrcodeScanVernum) return clearInterval(this.qrcodeTimer), this.qrcodeExpiredShow = !0, !1;
2419
- this.$request.flagPost("BASE_PASSPORT_SCAN_CHECK", {
2420
- name: "app",
2421
- fun: "scanCheck",
2422
- scanCode: e || ""
2423
- }).then((t) => {
2424
- t.code == 200 ? (t.msg && t?.data?.scanCVal || "") != "" && (clearInterval(this.qrcodeTimer), this.scanLoginFunc(e, t?.data?.scanCVal)) : t.code == 405 && (clearInterval(this.qrcodeTimer), this.qrcodeExpiredShow = !0);
2425
- }).catch(() => {});
2426
- },
2427
- scanLoginFunc(e, t) {
2428
- this.$message({
2429
- type: "success",
2430
- message: "扫码成功,请稍后...",
2431
- duration: 1500
2432
- }), this.$request.flagPost("BASE_PASSPORT_SCAN_LOGIN", {
2433
- name: "app",
2434
- fun: "scanLogin",
2435
- scanCode: e,
2436
- scanCVal: t
2437
- }).then((e) => {
2438
- let t = this.$message({
2439
- iconClass: "ElIconLoading",
2440
- message: "正在安全登录中,请稍后...",
2441
- duration: 0
2442
- });
2443
- setTimeout(() => {
2444
- t.close(), this.$message({
2445
- message: e.msg,
2446
- type: e.success ? "success" : "error"
2447
- });
2448
- }, 2e3);
2449
- }).catch(() => {});
2450
- },
2451
- goNext() {
2452
- console.log("--到这里111"), this.loginJump = !0;
2453
- let t = cvUtils.cc_url_get_params(null, this.$route.query), n = decodeURIComponent(t.from || "");
2454
- n ? (console.log("--到这里222", n), e.idbSetItem("clearCache", "login").then((e) => {
2455
- window.location.replace(n);
2456
- })) : (console.log("--到这里333"), this.$router.push({ path: "/" }));
2457
- },
2458
- setLanguage(e) {
2459
- i().SA_LANGUAGE_SET(e);
2460
- },
2461
- inputServerUrl() {},
2462
- inputServerChack(e) {
2463
- return new Promise((t, n) => {
2464
- let i = e;
2465
- /\/api\/$/.test(i) || (i += cvUtils.strRightExists(i, "/") ? "api/" : "/api/"), /^https*:\/\//i.test(i) || (i = `https://${i}`), s.setOptions({ checkNetwork: !1 }).flagGet("SYS_SETT_ALL", {}).then(async ({ data: a }) => {
2466
- a.server_version === void 0 && a.all_group_mute === void 0 ? n(`服务器(${cvUtils.cc_url_get_domain(e)})版本过低`) : (i != this.sysServerUrl && (r().SA_SERVER_URL_SET(i), window.location.reload()), t());
2467
- }).catch(({ ret: r, msg: i }) => {
2468
- if (r === -1001) {
2469
- if (!/^https*:\/\//i.test(e)) {
2470
- this.inputServerChack(`http://${e}`).then(t).catch(n);
2471
- return;
2472
- }
2473
- i = "服务器地址无效";
2474
- }
2475
- n(i);
2476
- });
2477
- });
2478
- }
2479
- }
2480
- }, {
2481
- __name: "login",
2482
- setup(e) {
2483
- return (e, t) => {
2484
- let n = g("el-input"), r = g("el-button"), i = g("el-icon"), o = g("el-tooltip"), s = g("cv-icons"), c = g("ElIconLoading"), b = g("el-checkbox");
2485
- return h(), d("div", M, [e.chainShowFlag ? u("", !0) : (h(), d("div", N, [
2486
- f("div", P, [f("img", {
2487
- src: e.cacheInstInfo.LAST_IP_LOGO,
2488
- alt: ""
2489
- }, null, 8, F)]),
2490
- e.loginMode == "reg" ? (h(), d("div", I, [
2491
- f("div", L, _(e.cacheInstInfo.LAST_IP_TITLE), 1),
2492
- f("div", R, _(e.$t("输入您的信息以创建帐户。")), 1),
2493
- f("div", z, [
2494
- f("form", null, [m(n, {
2495
- modelValue: e.account_password2,
2496
- "onUpdate:modelValue": t[0] ||= (t) => e.account_password2 = t,
2497
- ref: "account_password2",
2498
- "prefix-icon": "ElIconLock",
2499
- placeholder: e.$t("输入确认密码"),
2500
- type: "password",
2501
- size: "large",
2502
- clearable: ""
2503
- }, null, 8, ["modelValue", "placeholder"]), e.regInviteNeed ? (h(), l(n, {
2504
- key: 0,
2505
- modelValue: e.reg_invite,
2506
- "onUpdate:modelValue": t[1] ||= (t) => e.reg_invite = t,
2507
- ref: "reg_invite",
2508
- class: "login-code",
2509
- placeholder: e.$t("请输入注册邀请码"),
2510
- type: "text",
2511
- size: "large",
2512
- clearable: ""
2513
- }, {
2514
- prepend: v(() => [p("\xA0" + _(e.$t("邀请码")) + "\xA0", 1)]),
2515
- _: 1
2516
- }, 8, ["modelValue", "placeholder"])) : u("", !0)]),
2517
- m(r, null, {
2518
- default: v(() => [p(_(e.loginJump ? "注册成功" : "注册"), 1)]),
2519
- _: 1
2520
- }),
2521
- f("div", B, [p(_(e.$t("已经有帐号?")) + " ", 1), f("a", {
2522
- href: "javascript:void(0)",
2523
- onClick: t[2] ||= (t) => e.switchLoginMode("access")
2524
- }, _(e.$t("登录帐号")), 1)])
2525
- ])
2526
- ])) : u("", !0),
2527
- e.loginMode == "access" ? (h(), d("div", te, [
2528
- f("div", V, [f("div", H, [m(o, {
2529
- content: "扫码登录",
2530
- placement: "left"
2531
- }, {
2532
- default: v(() => [f("span", {
2533
- class: "login-mode-switch-icon",
2534
- onClick: t[3] ||= (t) => e.switchLoginMode("qrcode")
2535
- }, [m(i, { size: "45" }, {
2536
- default: v(() => [m(S)]),
2537
- _: 1
2538
- })])]),
2539
- _: 1
2540
- })])]),
2541
- f("div", U, _(e.cacheInstInfo.LAST_IP_TITLE), 1),
2542
- f("div", W, _(e.$t("输入您的凭证以访问您的帐户。")), 1),
2543
- f("div", G, [
2544
- f("form", null, [
2545
- m(n, {
2546
- modelValue: e.account_mobile,
2547
- "onUpdate:modelValue": t[4] ||= (t) => e.account_mobile = t,
2548
- ref: "account_mobile",
2549
- "prefix-icon": "ElIconUser",
2550
- placeholder: e.$t("输入您的手机账号"),
2551
- type: "text",
2552
- size: "large",
2553
- maxlength: "11",
2554
- onBlur: e.onBlur,
2555
- clearable: ""
2556
- }, null, 8, [
2557
- "modelValue",
2558
- "placeholder",
2559
- "onBlur"
2560
- ]),
2561
- m(n, {
2562
- modelValue: e.account_password,
2563
- "onUpdate:modelValue": t[5] ||= (t) => e.account_password = t,
2564
- ref: "account_password",
2565
- "prefix-icon": "ElIconLock",
2566
- placeholder: e.$t("输入您的密码"),
2567
- type: "password",
2568
- size: "large",
2569
- clearable: "",
2570
- onKeydown: y(e.accessLoginFunc, ["enter"])
2571
- }, null, 8, [
2572
- "modelValue",
2573
- "placeholder",
2574
- "onKeydown"
2575
- ]),
2576
- e.codeNeed ? (h(), l(n, {
2577
- key: 0,
2578
- modelValue: e.captcha_code,
2579
- "onUpdate:modelValue": t[7] ||= (t) => e.captcha_code = t,
2580
- ref: "captcha_code",
2581
- class: "login-code",
2582
- placeholder: e.$t("输入图形验证码"),
2583
- type: "text",
2584
- size: "large",
2585
- clearable: "",
2586
- maxlength: "6"
2587
- }, {
2588
- prefix: v(() => [m(s, { type: "circleSuccess" })]),
2589
- append: v(() => [f("div", {
2590
- class: "login-code-end",
2591
- onClick: t[6] ||= (...t) => e.refreshCode && e.refreshCode(...t)
2592
- }, [e.codeLoad > 0 ? (h(), d("div", K, [m(c)])) : e.codeUrl === "error" ? (h(), d("span", q, _(e.$t("加载失败")), 1)) : (h(), d("img", {
2593
- key: 2,
2594
- src: e.codeUrl
2595
- }, null, 8, J))])]),
2596
- _: 1
2597
- }, 8, ["modelValue", "placeholder"])) : u("", !0)
2598
- ]),
2599
- m(r, {
2600
- type: "primary",
2601
- loading: e.loadOngoing || e.loginJump,
2602
- size: "large",
2603
- style: {
2604
- width: "100%",
2605
- "margin-bottom": "15px"
2606
- },
2607
- onClick: e.accessLoginFunc
2608
- }, {
2609
- default: v(() => [p(_(e.loginJump ? "登录成功" : "登录"), 1)]),
2610
- _: 1
2611
- }, 8, ["loading", "onClick"]),
2612
- f("div", Y, [m(b, {
2613
- modelValue: e.cache_privacy,
2614
- "onUpdate:modelValue": t[9] ||= (t) => e.cache_privacy = t,
2615
- "true-value": "on",
2616
- "false-value": "off",
2617
- onChange: e.handleRrivacy
2618
- }, {
2619
- default: v(() => [t[17] ||= p(" 同意 ", -1), f("a", {
2620
- onClick: t[8] ||= (t) => e.jumpsXieyi("privacy"),
2621
- target: "_blank"
2622
- }, "《隐私条款》")]),
2623
- _: 1
2624
- }, 8, ["modelValue", "onChange"]), f("a", {
2625
- href: "javascript:void(0)",
2626
- onClick: t[10] ||= (...t) => e.handleForgot && e.handleForgot(...t)
2627
- }, _(e.$t("忘记密码了?")), 1)]),
2628
- f("div", X, [e.cacheInstConfig.open_business_reg == "on" ? (h(), d("div", Z, [p(_(e.$t("还没有帐号?")) + " ", 1), f("a", {
2629
- href: "javascript:void(0)",
2630
- onClick: t[11] ||= (t) => e.switchLoginMode("reg")
2631
- }, _(e.$t("注册帐号")), 1)])) : u("", !0), e.cacheInstConfig.open_business_oauth2 == "on" ? (h(), d("div", Q, [f("a", {
2632
- href: "javascript:void(0)",
2633
- onClick: t[12] ||= (t) => e.switchLoginMode("oauth2")
2634
- }, _(e.$t("OAuth2授权登陆")), 1)])) : u("", !0)])
2635
- ])
2636
- ])) : u("", !0),
2637
- e.loginMode == "qrcode" ? (h(), d("div", ne, [
2638
- f("div", re, [f("div", ie, [m(o, {
2639
- content: "帐号登录",
2640
- placement: "left"
2641
- }, {
2642
- default: v(() => [f("span", {
2643
- class: "login-mode-switch-icon",
2644
- onClick: t[13] ||= (t) => e.switchLoginMode("access")
2645
- }, [m(i, { size: "45" }, {
2646
- default: v(() => [m(E)]),
2647
- _: 1
2648
- })])]),
2649
- _: 1
2650
- })])]),
2651
- f("div", ae, _(e.$t("扫码登录")), 1),
2652
- f("div", oe, [m(i, {
2653
- size: "20",
2654
- style: { "margin-right": "10px" }
2655
- }, {
2656
- default: v(() => [m(A)]),
2657
- _: 1
2658
- }), p(" " + _(e.$t(`请使用【${e.cacheInstInfo.LAST_IP_BRAND}】移动端扫描二维码`)), 1)]),
2659
- f("div", {
2660
- class: "login-qrcode",
2661
- onClick: t[14] ||= (...t) => e.scanQrcodeRefresh && e.scanQrcodeRefresh(...t)
2662
- }, [f("div", $, null, 512)])
2663
- ])) : u("", !0),
2664
- e.loginMode == "oauth2" ? (h(), d("div", se, [
2665
- f("div", ce, _(e.cacheInstInfo.LAST_IP_TITLE), 1),
2666
- f("div", le, _(e.$t("输入您的信息以创建帐户。")), 1),
2667
- f("div", ue, [f("div", de, [f("a", {
2668
- href: "javascript:void(0)",
2669
- onClick: t[15] ||= (t) => e.switchLoginMode("access")
2670
- }, _(e.$t("帐号登录")), 1)])])
2671
- ])) : u("", !0)
2672
- ])), e.chainShowFlag ? (h(), l(a, {
2673
- key: 1,
2674
- modelValue: e.chainAccountList,
2675
- "onUpdate:modelValue": t[16] ||= (t) => e.chainAccountList = t,
2676
- reselectTitle: "重新登录",
2677
- onReselectFunc: e.chainReselection,
2678
- onSelectFunc: e.chainBusinessCheck
2679
- }, null, 8, [
2680
- "modelValue",
2681
- "onReselectFunc",
2682
- "onSelectFunc"
2683
- ])) : u("", !0)]);
2684
- };
2685
- }
2686
- });
2687
- //#endregion
2688
- export { fe as default };