@vtj/parser 0.17.8 → 0.18.1
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.cjs +28 -17
- package/dist/index.mjs +2013 -1142
- package/package.json +8 -6
- package/types/shared/utils.d.ts +6 -0
- package/types/version.d.ts +2 -2
- package/types/vue/composition/index.d.ts +3 -0
- package/types/vue/composition/reverseGlobalApi.d.ts +30 -0
- package/types/vue/composition/reverseSymbolTable.d.ts +35 -0
- package/types/vue/composition/reverseTransformer.d.ts +2 -0
- package/types/vue/compositionPatch.d.ts +46 -0
- package/types/vue/scriptSetup.d.ts +31 -0
- package/types/vue/utils.d.ts +0 -20
package/dist/index.mjs
CHANGED
|
@@ -1,41 +1,42 @@
|
|
|
1
|
-
import { parse as
|
|
2
|
-
import { parse as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { BlockModel as
|
|
6
|
-
import { tsFormatter as
|
|
7
|
-
import { NodeTypes as
|
|
8
|
-
import { upperFirstCamelCase as
|
|
9
|
-
import
|
|
10
|
-
import * as
|
|
11
|
-
import * as
|
|
1
|
+
import { parse as Uu, compileTemplate as Gu } from "@vue/compiler-sfc";
|
|
2
|
+
import { parse as me } from "@babel/parser";
|
|
3
|
+
import vu from "@babel/traverse";
|
|
4
|
+
import Eu from "@babel/generator";
|
|
5
|
+
import { BlockModel as Hu } from "@vtj/core";
|
|
6
|
+
import { GLOBAL_API_MAP as gu, UI_PACKAGES as xe, UI_GLOBAL_API_MAPS as Wu, tsFormatter as ru } from "@vtj/coder";
|
|
7
|
+
import { NodeTypes as v } from "@vue/compiler-core";
|
|
8
|
+
import { upperFirstCamelCase as ge, unBase64 as ye, uid as nu } from "@vtj/base";
|
|
9
|
+
import Se from "postcss";
|
|
10
|
+
import * as ve from "sass";
|
|
11
|
+
import * as q from "@babel/types";
|
|
12
12
|
/**!
|
|
13
13
|
* Copyright (c) 2026, VTJ.PRO All rights reserved.
|
|
14
14
|
* @name @vtj/parser
|
|
15
15
|
* @author CHC chenhuachun1549@dingtalk.com
|
|
16
|
-
* @version 0.
|
|
16
|
+
* @version 0.18.1
|
|
17
17
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
|
18
18
|
*/
|
|
19
|
-
const
|
|
20
|
-
function
|
|
21
|
-
const { descriptor: u, errors: t } =
|
|
19
|
+
const l0 = "0.18.1";
|
|
20
|
+
function P(e) {
|
|
21
|
+
const { descriptor: u, errors: t } = Uu(e), a = u.template?.content || "", r = !!u.scriptSetup, n = (u.scriptSetup || u.script)?.content || "", i = u.styles.map((s) => s.content);
|
|
22
22
|
return {
|
|
23
23
|
template: a,
|
|
24
|
-
script:
|
|
25
|
-
styles:
|
|
26
|
-
errors: t
|
|
24
|
+
script: n,
|
|
25
|
+
styles: i,
|
|
26
|
+
errors: t,
|
|
27
|
+
isScriptSetup: r
|
|
27
28
|
};
|
|
28
29
|
}
|
|
29
|
-
function
|
|
30
|
-
return
|
|
30
|
+
function B(e) {
|
|
31
|
+
return me(e, { sourceType: "module", plugins: ["typescript"] });
|
|
31
32
|
}
|
|
32
|
-
function
|
|
33
|
-
return (
|
|
33
|
+
function J(e, u) {
|
|
34
|
+
return (vu.default || vu)(e, u);
|
|
34
35
|
}
|
|
35
|
-
function
|
|
36
|
+
function A(e) {
|
|
36
37
|
if (!e) return "";
|
|
37
38
|
try {
|
|
38
|
-
return (
|
|
39
|
+
return au(e), (Eu.default || Eu)(e, {
|
|
39
40
|
comments: !1,
|
|
40
41
|
concise: !0,
|
|
41
42
|
retainLines: !1,
|
|
@@ -47,169 +48,236 @@ function B(e) {
|
|
|
47
48
|
return console.error("代码生成错误", u), "";
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
|
-
|
|
51
|
+
const Ee = /* @__PURE__ */ new Set([
|
|
52
|
+
"TSAsExpression",
|
|
53
|
+
"TSTypeAssertion",
|
|
54
|
+
"TSNonNullExpression"
|
|
55
|
+
]);
|
|
56
|
+
function au(e) {
|
|
57
|
+
if (!(!e || typeof e != "object")) {
|
|
58
|
+
if (Array.isArray(e)) {
|
|
59
|
+
for (const u of e) au(u);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
if (Ee.has(e.type) && e.expression) {
|
|
63
|
+
const u = e.expression;
|
|
64
|
+
au(u);
|
|
65
|
+
const t = {
|
|
66
|
+
start: e.start,
|
|
67
|
+
end: e.end,
|
|
68
|
+
loc: e.loc
|
|
69
|
+
};
|
|
70
|
+
for (const a of Object.keys(u))
|
|
71
|
+
a === "type" || a === "loc" || a === "start" || a === "end" || a === "extra" || a === "leadingComments" || a === "trailingComments" || a === "innerComments" || (e[a] = u[a]);
|
|
72
|
+
e.type = u.type, e.start = t.start, e.end = t.end, e.loc = t.loc, delete e.typeAnnotation, delete e.typeParameters;
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
delete e.typeAnnotation, delete e.returnType, delete e.typeParameters, e.type === "Identifier" && delete e.optional;
|
|
76
|
+
for (const u of Object.keys(e))
|
|
77
|
+
u === "type" || u === "loc" || u === "start" || u === "end" || u === "extra" || u === "leadingComments" || u === "trailingComments" || u === "innerComments" || u === "errors" || au(e[u]);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function iu(e) {
|
|
51
81
|
return !!e && e.type === "JSExpression";
|
|
52
82
|
}
|
|
53
|
-
function
|
|
83
|
+
function we(e) {
|
|
54
84
|
return typeof e == "object" && !!e && e.type === "JSFunction";
|
|
55
85
|
}
|
|
56
86
|
function du(e) {
|
|
57
|
-
return !!
|
|
87
|
+
return !!iu(e) || !!we(e);
|
|
58
88
|
}
|
|
59
|
-
function
|
|
60
|
-
return !!e && !
|
|
89
|
+
function Ie(e) {
|
|
90
|
+
return !!e && !iu(e) && typeof e != "string";
|
|
61
91
|
}
|
|
62
|
-
function
|
|
92
|
+
function Ju(e, u) {
|
|
63
93
|
try {
|
|
64
|
-
const t =
|
|
65
|
-
return
|
|
94
|
+
const t = B(e);
|
|
95
|
+
return J(t, u), A(t) || "";
|
|
66
96
|
} catch {
|
|
67
97
|
return "";
|
|
68
98
|
}
|
|
69
99
|
}
|
|
70
|
-
function
|
|
100
|
+
function Ae(e) {
|
|
101
|
+
if (!e) return "";
|
|
102
|
+
try {
|
|
103
|
+
const u = B(e);
|
|
104
|
+
return J(u, {
|
|
105
|
+
// TS as 断言 / <T> 断言 / 非空断言 → 只保留表达式本身
|
|
106
|
+
TSAsExpression: (t) => {
|
|
107
|
+
t.replaceWith(t.node.expression);
|
|
108
|
+
},
|
|
109
|
+
TSTypeAssertion: (t) => {
|
|
110
|
+
t.replaceWith(t.node.expression);
|
|
111
|
+
},
|
|
112
|
+
TSNonNullExpression: (t) => {
|
|
113
|
+
t.replaceWith(t.node.expression);
|
|
114
|
+
},
|
|
115
|
+
// TS 类型声明整体移除
|
|
116
|
+
TSInterfaceDeclaration: (t) => {
|
|
117
|
+
t.remove();
|
|
118
|
+
},
|
|
119
|
+
TSTypeAliasDeclaration: (t) => {
|
|
120
|
+
t.remove();
|
|
121
|
+
},
|
|
122
|
+
TSModuleDeclaration: (t) => {
|
|
123
|
+
t.remove();
|
|
124
|
+
},
|
|
125
|
+
TSEnumDeclaration: (t) => {
|
|
126
|
+
t.remove();
|
|
127
|
+
},
|
|
128
|
+
// 退出节点时统一删除残留的 TS 属性
|
|
129
|
+
exit: (t) => {
|
|
130
|
+
const a = t.node;
|
|
131
|
+
a && (delete a.typeAnnotation, delete a.returnType, delete a.typeParameters, a.type === "Identifier" && delete a.optional);
|
|
132
|
+
}
|
|
133
|
+
}), A(u) || "";
|
|
134
|
+
} catch {
|
|
135
|
+
return e;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
function ke(e, u) {
|
|
71
139
|
const t = [];
|
|
72
140
|
try {
|
|
73
|
-
const { descriptor: a, errors:
|
|
74
|
-
if (
|
|
75
|
-
const
|
|
141
|
+
const { descriptor: a, errors: r } = Uu(e);
|
|
142
|
+
if (r && r.length > 0 && r.forEach((i) => {
|
|
143
|
+
const s = i.message || String(i), o = i.loc;
|
|
76
144
|
o && o.start ? t.push(
|
|
77
|
-
`Vue SFC 错误: ${
|
|
78
|
-
) : t.push(`Vue SFC 错误: ${
|
|
145
|
+
`Vue SFC 错误: ${s} (位置: ${o.start.line}:${o.start.column})`
|
|
146
|
+
) : t.push(`Vue SFC 错误: ${s}`);
|
|
79
147
|
}), a.template)
|
|
80
148
|
try {
|
|
81
|
-
const
|
|
149
|
+
const i = Gu({
|
|
82
150
|
id: "validation",
|
|
83
151
|
filename: u,
|
|
84
152
|
source: a.template.content,
|
|
85
153
|
isProd: !1
|
|
86
154
|
});
|
|
87
|
-
|
|
88
|
-
const o = typeof
|
|
89
|
-
|
|
90
|
-
`模板编译错误: ${o} (位置: ${
|
|
155
|
+
i.errors && i.errors.length > 0 && i.errors.forEach((s) => {
|
|
156
|
+
const o = typeof s == "string" ? s : s.message, c = typeof s == "string" ? null : s.loc;
|
|
157
|
+
c && c.start ? t.push(
|
|
158
|
+
`模板编译错误: ${o} (位置: ${c.start.line}:${c.start.column})`
|
|
91
159
|
) : t.push(`模板编译错误: ${o}`);
|
|
92
160
|
});
|
|
93
|
-
} catch (
|
|
94
|
-
t.push(`模板编译错误: ${
|
|
161
|
+
} catch (i) {
|
|
162
|
+
t.push(`模板编译错误: ${i.message}`);
|
|
95
163
|
}
|
|
96
|
-
const
|
|
97
|
-
if (
|
|
164
|
+
const n = (a.scriptSetup || a.script)?.content;
|
|
165
|
+
if (n)
|
|
98
166
|
try {
|
|
99
|
-
|
|
100
|
-
} catch (
|
|
101
|
-
t.push(`脚本语法错误: ${
|
|
167
|
+
B(n);
|
|
168
|
+
} catch (i) {
|
|
169
|
+
t.push(`脚本语法错误: ${i.message}`);
|
|
102
170
|
}
|
|
103
171
|
} catch (a) {
|
|
104
172
|
t.push(`Vue SFC 解析错误: ${a.message}`);
|
|
105
173
|
}
|
|
106
174
|
return t.length > 0 ? t : null;
|
|
107
175
|
}
|
|
108
|
-
function
|
|
109
|
-
const u =
|
|
110
|
-
return u.styles && (a.css = u.styles[0] || ""),
|
|
111
|
-
CallExpression(
|
|
112
|
-
const
|
|
113
|
-
if (
|
|
114
|
-
const
|
|
115
|
-
|
|
176
|
+
function f0(e) {
|
|
177
|
+
const u = P(e), t = B(u.script), a = {};
|
|
178
|
+
return u.styles && (a.css = u.styles[0] || ""), J(t, {
|
|
179
|
+
CallExpression(r) {
|
|
180
|
+
const n = r.node.callee?.name;
|
|
181
|
+
if (n) {
|
|
182
|
+
const i = A(r.node.arguments[0]);
|
|
183
|
+
i && (a[n] = {
|
|
116
184
|
type: "JSFunction",
|
|
117
|
-
value:
|
|
185
|
+
value: i
|
|
118
186
|
});
|
|
119
187
|
}
|
|
120
188
|
}
|
|
121
189
|
}), a;
|
|
122
190
|
}
|
|
123
|
-
function
|
|
191
|
+
function R(e, u, t) {
|
|
124
192
|
if (!e.includes(u)) return e;
|
|
125
193
|
try {
|
|
126
|
-
return
|
|
194
|
+
return Te(e, u, t);
|
|
127
195
|
} catch {
|
|
128
196
|
return e;
|
|
129
197
|
}
|
|
130
198
|
}
|
|
131
|
-
function
|
|
132
|
-
let a,
|
|
199
|
+
function Te(e, u, t) {
|
|
200
|
+
let a, r = 0;
|
|
133
201
|
try {
|
|
134
|
-
a =
|
|
202
|
+
a = B(e);
|
|
135
203
|
} catch {
|
|
136
|
-
const
|
|
137
|
-
a =
|
|
204
|
+
const s = "(()=>{", c = s + e + "})";
|
|
205
|
+
a = B(c), r = s.length;
|
|
138
206
|
}
|
|
139
|
-
const
|
|
140
|
-
if (
|
|
141
|
-
Identifier(
|
|
142
|
-
const o =
|
|
207
|
+
const n = [];
|
|
208
|
+
if (J(a, {
|
|
209
|
+
Identifier(s) {
|
|
210
|
+
const o = s.node;
|
|
143
211
|
if (o.name !== u) return;
|
|
144
|
-
const
|
|
145
|
-
if (
|
|
146
|
-
const
|
|
147
|
-
if (
|
|
148
|
-
const
|
|
149
|
-
|
|
212
|
+
const c = Ve(s);
|
|
213
|
+
if (c === "skip") return;
|
|
214
|
+
const d = (o.start ?? 0) - r, l = (o.end ?? 0) - r;
|
|
215
|
+
if (d < 0 || l > e.length) return;
|
|
216
|
+
const p = c === "expand" ? `${u}: ${t}` : t;
|
|
217
|
+
n.some((b) => b.start === d && b.end === l) || n.push({ start: d, end: l, text: p });
|
|
150
218
|
},
|
|
151
|
-
StringLiteral(
|
|
152
|
-
|
|
219
|
+
StringLiteral(s) {
|
|
220
|
+
Ne(s, u, t, r, e, n);
|
|
153
221
|
},
|
|
154
|
-
TemplateLiteral(
|
|
155
|
-
|
|
222
|
+
TemplateLiteral(s) {
|
|
223
|
+
je(s, u, t, r, e, n);
|
|
156
224
|
},
|
|
157
|
-
MemberExpression(
|
|
158
|
-
|
|
225
|
+
MemberExpression(s) {
|
|
226
|
+
wu(s, u, t, r, e, n);
|
|
159
227
|
},
|
|
160
|
-
OptionalMemberExpression(
|
|
161
|
-
|
|
162
|
-
}
|
|
163
|
-
}),
|
|
164
|
-
|
|
165
|
-
let
|
|
166
|
-
for (const { start:
|
|
167
|
-
|
|
168
|
-
return
|
|
169
|
-
}
|
|
170
|
-
function fe(e, u, t, a, i, r) {
|
|
171
|
-
const s = e.node;
|
|
172
|
-
if (!s.value.includes(u)) return;
|
|
173
|
-
const c = e.parent;
|
|
174
|
-
if (c?.type !== "NewExpression" || c?.callee?.name !== "RegExp")
|
|
175
|
-
return;
|
|
176
|
-
const o = s.value;
|
|
177
|
-
let n = 0;
|
|
178
|
-
for (; n < o.length; ) {
|
|
179
|
-
const f = o.indexOf(u, n);
|
|
180
|
-
if (f === -1) break;
|
|
181
|
-
const l = 1 + f, m = (s.start ?? 0) - a + l, h = m + u.length;
|
|
182
|
-
m >= 0 && h <= i.length && !r.some((I) => I.start === m && I.end === h) && r.push({ start: m, end: h, text: t }), n = f + u.length;
|
|
183
|
-
}
|
|
228
|
+
OptionalMemberExpression(s) {
|
|
229
|
+
wu(s, u, t, r, e, n);
|
|
230
|
+
}
|
|
231
|
+
}), n.length === 0) return e;
|
|
232
|
+
n.sort((s, o) => o.start - s.start);
|
|
233
|
+
let i = e;
|
|
234
|
+
for (const { start: s, end: o, text: c } of n)
|
|
235
|
+
i = i.slice(0, s) + c + i.slice(o);
|
|
236
|
+
return i;
|
|
184
237
|
}
|
|
185
|
-
function
|
|
238
|
+
function Ne(e, u, t, a, r, n) {
|
|
239
|
+
const i = e.node;
|
|
240
|
+
if (!i.value.includes(u)) return;
|
|
186
241
|
const s = e.parent;
|
|
187
242
|
if (s?.type !== "NewExpression" || s?.callee?.name !== "RegExp")
|
|
188
243
|
return;
|
|
244
|
+
const o = i.value;
|
|
245
|
+
let c = 0;
|
|
246
|
+
for (; c < o.length; ) {
|
|
247
|
+
const d = o.indexOf(u, c);
|
|
248
|
+
if (d === -1) break;
|
|
249
|
+
const l = 1 + d, p = (i.start ?? 0) - a + l, b = p + u.length;
|
|
250
|
+
p >= 0 && b <= r.length && !n.some((h) => h.start === p && h.end === b) && n.push({ start: p, end: b, text: t }), c = d + u.length;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
function je(e, u, t, a, r, n) {
|
|
254
|
+
const i = e.parent;
|
|
255
|
+
if (i?.type !== "NewExpression" || i?.callee?.name !== "RegExp")
|
|
256
|
+
return;
|
|
189
257
|
const o = e.node.quasis ?? [];
|
|
190
|
-
for (const
|
|
191
|
-
const
|
|
192
|
-
if (!
|
|
258
|
+
for (const c of o) {
|
|
259
|
+
const d = c.value?.raw ?? "";
|
|
260
|
+
if (!d.includes(u)) continue;
|
|
193
261
|
let l = 0;
|
|
194
|
-
for (; l <
|
|
195
|
-
const
|
|
196
|
-
if (
|
|
197
|
-
const
|
|
198
|
-
if (
|
|
199
|
-
const
|
|
200
|
-
|
|
262
|
+
for (; l < d.length; ) {
|
|
263
|
+
const p = d.indexOf(u, l);
|
|
264
|
+
if (p === -1) break;
|
|
265
|
+
const b = (c.start ?? 0) - a;
|
|
266
|
+
if (b < 0 || b > r.length) break;
|
|
267
|
+
const h = b + p, S = h + u.length;
|
|
268
|
+
h >= 0 && S <= r.length && !n.some((E) => E.start === h && E.end === S) && n.push({ start: h, end: S, text: t }), l = p + u.length;
|
|
201
269
|
}
|
|
202
270
|
}
|
|
203
271
|
}
|
|
204
|
-
function
|
|
205
|
-
const
|
|
206
|
-
if (
|
|
272
|
+
function wu(e, u, t, a, r, n) {
|
|
273
|
+
const i = e.node;
|
|
274
|
+
if (i.object?.type !== "ThisExpression" || i.computed || i.property?.type !== "Identifier" || i.property.name !== u)
|
|
207
275
|
return;
|
|
208
|
-
const
|
|
209
|
-
|
|
276
|
+
const s = (i.start ?? 0) - a, o = (i.end ?? 0) - a;
|
|
277
|
+
s < 0 || o > r.length || n.some((c) => c.start === s && c.end === o) || n.push({ start: s, end: o, text: t });
|
|
210
278
|
}
|
|
211
|
-
function
|
|
212
|
-
const t = e.parent, a = t?.type ?? "",
|
|
279
|
+
function Ve(e, u) {
|
|
280
|
+
const t = e.parent, a = t?.type ?? "", r = e.parentPath?.parent;
|
|
213
281
|
switch (a) {
|
|
214
282
|
// 成员访问 obj.key / obj[key] / obj?.key / obj?.[key]
|
|
215
283
|
case "MemberExpression":
|
|
@@ -223,9 +291,9 @@ function be(e, u) {
|
|
|
223
291
|
// 对象属性 { key: val } / { key } / { [key]: val }
|
|
224
292
|
case "ObjectProperty": {
|
|
225
293
|
if (t.key === e.node)
|
|
226
|
-
return t.computed ? "replace" : t.shorthand ?
|
|
294
|
+
return t.computed ? "replace" : t.shorthand ? r && r?.type === "ObjectPattern" ? "skip" : "expand" : "skip";
|
|
227
295
|
if (t.value === e.node)
|
|
228
|
-
return
|
|
296
|
+
return r && r?.type === "ObjectPattern" ? "skip" : "replace";
|
|
229
297
|
break;
|
|
230
298
|
}
|
|
231
299
|
// 变量声明 const/let/var key = ...
|
|
@@ -315,9 +383,9 @@ function be(e, u) {
|
|
|
315
383
|
break;
|
|
316
384
|
}
|
|
317
385
|
}
|
|
318
|
-
return
|
|
386
|
+
return qe(e) || De(e) ? "skip" : "replace";
|
|
319
387
|
}
|
|
320
|
-
function
|
|
388
|
+
function qe(e) {
|
|
321
389
|
let u = e.parentPath;
|
|
322
390
|
for (; u; ) {
|
|
323
391
|
const t = u.node, a = t?.type ?? "";
|
|
@@ -329,7 +397,7 @@ function he(e) {
|
|
|
329
397
|
}
|
|
330
398
|
return !1;
|
|
331
399
|
}
|
|
332
|
-
function
|
|
400
|
+
function De(e) {
|
|
333
401
|
let u = e.parentPath;
|
|
334
402
|
for (; u; ) {
|
|
335
403
|
const t = u.node?.type ?? "";
|
|
@@ -340,45 +408,45 @@ function pe(e) {
|
|
|
340
408
|
}
|
|
341
409
|
return !1;
|
|
342
410
|
}
|
|
343
|
-
function
|
|
411
|
+
function Iu(e, u, t) {
|
|
344
412
|
const {
|
|
345
413
|
context: a = {},
|
|
346
|
-
computed:
|
|
347
|
-
libs:
|
|
348
|
-
members:
|
|
349
|
-
props:
|
|
414
|
+
computed: r = [],
|
|
415
|
+
libs: n = {},
|
|
416
|
+
members: i = [],
|
|
417
|
+
props: s = [],
|
|
350
418
|
platform: o
|
|
351
|
-
} = t || {},
|
|
352
|
-
if (
|
|
353
|
-
for (const
|
|
354
|
-
e =
|
|
355
|
-
for (const
|
|
356
|
-
e.includes(`this.${
|
|
357
|
-
for (const
|
|
358
|
-
e =
|
|
359
|
-
for (const [
|
|
360
|
-
e =
|
|
361
|
-
for (const
|
|
362
|
-
e =
|
|
419
|
+
} = t || {}, c = Array.from(a[u || ""] || /* @__PURE__ */ new Set());
|
|
420
|
+
if (c)
|
|
421
|
+
for (const d of c)
|
|
422
|
+
e = R(e, d, `this.context.${d}`);
|
|
423
|
+
for (const d of r)
|
|
424
|
+
e.includes(`this.${d}.value`) || (e = R(e, d, `this.${d}.value`));
|
|
425
|
+
for (const d of s)
|
|
426
|
+
e = R(e, d, `this.${d}`);
|
|
427
|
+
for (const [d, l] of Object.entries(n))
|
|
428
|
+
e = R(e, d, `this.$libs.${l}.${d}`), e = R(e, `this.${d}`, `this.$libs.${l}.${d}`);
|
|
429
|
+
for (const d of i)
|
|
430
|
+
e = R(e, d, `this.${d}`);
|
|
363
431
|
if (o === "uniapp") {
|
|
364
|
-
const
|
|
365
|
-
e = e.replace(
|
|
432
|
+
const d = /\suni\./g;
|
|
433
|
+
e = e.replace(d, "this.$libs.UniH5.uni.");
|
|
366
434
|
}
|
|
367
435
|
return e = e.replace(/_ctx\./g, "this."), e = e.replace(/this\.this\./g, "this."), e;
|
|
368
436
|
}
|
|
369
|
-
function
|
|
437
|
+
function T(e) {
|
|
370
438
|
return {
|
|
371
439
|
type: "JSExpression",
|
|
372
440
|
value: /^\{[\w\W]*\}$/.test(e) ? `(${e})` : e
|
|
373
441
|
};
|
|
374
442
|
}
|
|
375
|
-
function
|
|
443
|
+
function C(e) {
|
|
376
444
|
return {
|
|
377
445
|
type: "JSFunction",
|
|
378
446
|
value: e
|
|
379
447
|
};
|
|
380
448
|
}
|
|
381
|
-
const
|
|
449
|
+
const Re = [
|
|
382
450
|
"beforeCreate",
|
|
383
451
|
"created",
|
|
384
452
|
"beforeMount",
|
|
@@ -392,46 +460,46 @@ const me = [
|
|
|
392
460
|
"renderTriggered",
|
|
393
461
|
"activated",
|
|
394
462
|
"deactivated"
|
|
395
|
-
],
|
|
463
|
+
], Ce = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot,svg,path,circle,rect,polygon".split(
|
|
396
464
|
","
|
|
397
|
-
),
|
|
465
|
+
), _e = "component,slot,template".split(","), Le = "view,swiper,progress,icon,text,button,checkbox,editor,form,input,label,picker,radio,slider,switch,textarea,audio,camera,image,video,map,canvas".split(
|
|
398
466
|
","
|
|
399
467
|
);
|
|
400
|
-
function
|
|
401
|
-
return u === "uniapp" &&
|
|
468
|
+
function Pe(e, u = "web") {
|
|
469
|
+
return u === "uniapp" && Le.includes(e);
|
|
402
470
|
}
|
|
403
|
-
function
|
|
404
|
-
return (
|
|
471
|
+
function Xu(e, u = "web") {
|
|
472
|
+
return (Ce.includes(e) || _e.includes(e)) && !Pe(e, u) ? e : ge(e);
|
|
405
473
|
}
|
|
406
|
-
function
|
|
474
|
+
function zu(e) {
|
|
407
475
|
return e.replace(/\s+/g, " ").split(";").reduce((t, a) => {
|
|
408
|
-
const [
|
|
409
|
-
return
|
|
476
|
+
const [r, n] = a.split(":").map((i) => i.trim());
|
|
477
|
+
return r && n && (t[r] = n), t;
|
|
410
478
|
}, {});
|
|
411
479
|
}
|
|
412
|
-
function
|
|
480
|
+
function Me(e, u, t) {
|
|
413
481
|
if (t === "ObjectExpression")
|
|
414
|
-
return `(Object.assign({${e.split(" ").map((
|
|
482
|
+
return `(Object.assign({${e.split(" ").map((r) => `'${r}': true`).join(",")}}, ${u}))`;
|
|
415
483
|
if (t === "ArrayExpression")
|
|
416
|
-
return `([${e.split(" ").map((
|
|
484
|
+
return `([${e.split(" ").map((r) => `'${r}'`).join(",")}].concat(${u}))`;
|
|
417
485
|
}
|
|
418
|
-
function
|
|
486
|
+
function Qu(e = "") {
|
|
419
487
|
const t = e.trim().match(/DataSource:\s*([^\n=]+={0,2})/)?.[1] || "";
|
|
420
488
|
try {
|
|
421
|
-
return t ? JSON.parse(
|
|
489
|
+
return t ? JSON.parse(ye(t)) : null;
|
|
422
490
|
} catch (a) {
|
|
423
491
|
return console.warn("extractDataSource fail", a), null;
|
|
424
492
|
}
|
|
425
493
|
}
|
|
426
|
-
const
|
|
494
|
+
const Oe = /* @__PURE__ */ new Uint16Array(
|
|
427
495
|
// prettier-ignore
|
|
428
496
|
/* @__PURE__ */ 'ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map((e) => e.charCodeAt(0))
|
|
429
|
-
),
|
|
497
|
+
), Be = /* @__PURE__ */ new Uint16Array(
|
|
430
498
|
// prettier-ignore
|
|
431
499
|
/* @__PURE__ */ "Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map((e) => e.charCodeAt(0))
|
|
432
500
|
);
|
|
433
|
-
var
|
|
434
|
-
const
|
|
501
|
+
var fu;
|
|
502
|
+
const Fe = /* @__PURE__ */ new Map([
|
|
435
503
|
[0, 65533],
|
|
436
504
|
// C1 Unicode control character reference replacements
|
|
437
505
|
[128, 8364],
|
|
@@ -461,53 +529,53 @@ const Ae = /* @__PURE__ */ new Map([
|
|
|
461
529
|
[156, 339],
|
|
462
530
|
[158, 382],
|
|
463
531
|
[159, 376]
|
|
464
|
-
]),
|
|
532
|
+
]), Au = (
|
|
465
533
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, n/no-unsupported-features/es-builtins
|
|
466
|
-
(
|
|
534
|
+
(fu = String.fromCodePoint) !== null && fu !== void 0 ? fu : function(e) {
|
|
467
535
|
let u = "";
|
|
468
536
|
return e > 65535 && (e -= 65536, u += String.fromCharCode(e >>> 10 & 1023 | 55296), e = 56320 | e & 1023), u += String.fromCharCode(e), u;
|
|
469
537
|
}
|
|
470
538
|
);
|
|
471
|
-
function
|
|
539
|
+
function $e(e) {
|
|
472
540
|
var u;
|
|
473
|
-
return e >= 55296 && e <= 57343 || e > 1114111 ? 65533 : (u =
|
|
541
|
+
return e >= 55296 && e <= 57343 || e > 1114111 ? 65533 : (u = Fe.get(e)) !== null && u !== void 0 ? u : e;
|
|
474
542
|
}
|
|
475
|
-
var
|
|
543
|
+
var V;
|
|
476
544
|
(function(e) {
|
|
477
545
|
e[e.NUM = 35] = "NUM", e[e.SEMI = 59] = "SEMI", e[e.EQUALS = 61] = "EQUALS", e[e.ZERO = 48] = "ZERO", e[e.NINE = 57] = "NINE", e[e.LOWER_A = 97] = "LOWER_A", e[e.LOWER_F = 102] = "LOWER_F", e[e.LOWER_X = 120] = "LOWER_X", e[e.LOWER_Z = 122] = "LOWER_Z", e[e.UPPER_A = 65] = "UPPER_A", e[e.UPPER_F = 70] = "UPPER_F", e[e.UPPER_Z = 90] = "UPPER_Z";
|
|
478
|
-
})(
|
|
479
|
-
const
|
|
480
|
-
var
|
|
546
|
+
})(V || (V = {}));
|
|
547
|
+
const Ue = 32;
|
|
548
|
+
var W;
|
|
481
549
|
(function(e) {
|
|
482
550
|
e[e.VALUE_LENGTH = 49152] = "VALUE_LENGTH", e[e.BRANCH_LENGTH = 16256] = "BRANCH_LENGTH", e[e.JUMP_TABLE = 127] = "JUMP_TABLE";
|
|
483
|
-
})(
|
|
484
|
-
function
|
|
485
|
-
return e >=
|
|
551
|
+
})(W || (W = {}));
|
|
552
|
+
function pu(e) {
|
|
553
|
+
return e >= V.ZERO && e <= V.NINE;
|
|
486
554
|
}
|
|
487
|
-
function
|
|
488
|
-
return e >=
|
|
555
|
+
function Ge(e) {
|
|
556
|
+
return e >= V.UPPER_A && e <= V.UPPER_F || e >= V.LOWER_A && e <= V.LOWER_F;
|
|
489
557
|
}
|
|
490
|
-
function
|
|
491
|
-
return e >=
|
|
558
|
+
function He(e) {
|
|
559
|
+
return e >= V.UPPER_A && e <= V.UPPER_Z || e >= V.LOWER_A && e <= V.LOWER_Z || pu(e);
|
|
492
560
|
}
|
|
493
|
-
function
|
|
494
|
-
return e ===
|
|
561
|
+
function We(e) {
|
|
562
|
+
return e === V.EQUALS || He(e);
|
|
495
563
|
}
|
|
496
|
-
var
|
|
564
|
+
var j;
|
|
497
565
|
(function(e) {
|
|
498
566
|
e[e.EntityStart = 0] = "EntityStart", e[e.NumericStart = 1] = "NumericStart", e[e.NumericDecimal = 2] = "NumericDecimal", e[e.NumericHex = 3] = "NumericHex", e[e.NamedEntity = 4] = "NamedEntity";
|
|
499
|
-
})(
|
|
500
|
-
var
|
|
567
|
+
})(j || (j = {}));
|
|
568
|
+
var M;
|
|
501
569
|
(function(e) {
|
|
502
570
|
e[e.Legacy = 0] = "Legacy", e[e.Strict = 1] = "Strict", e[e.Attribute = 2] = "Attribute";
|
|
503
|
-
})(
|
|
504
|
-
class
|
|
571
|
+
})(M || (M = {}));
|
|
572
|
+
class Je {
|
|
505
573
|
constructor(u, t, a) {
|
|
506
|
-
this.decodeTree = u, this.emitCodePoint = t, this.errors = a, this.state =
|
|
574
|
+
this.decodeTree = u, this.emitCodePoint = t, this.errors = a, this.state = j.EntityStart, this.consumed = 1, this.result = 0, this.treeIndex = 0, this.excess = 1, this.decodeMode = M.Strict;
|
|
507
575
|
}
|
|
508
576
|
/** Resets the instance to make it reusable. */
|
|
509
577
|
startEntity(u) {
|
|
510
|
-
this.decodeMode = u, this.state =
|
|
578
|
+
this.decodeMode = u, this.state = j.EntityStart, this.result = 0, this.treeIndex = 0, this.excess = 1, this.consumed = 1;
|
|
511
579
|
}
|
|
512
580
|
/**
|
|
513
581
|
* Write an entity to the decoder. This can be called multiple times with partial entities.
|
|
@@ -522,15 +590,15 @@ class je {
|
|
|
522
590
|
*/
|
|
523
591
|
write(u, t) {
|
|
524
592
|
switch (this.state) {
|
|
525
|
-
case
|
|
526
|
-
return u.charCodeAt(t) ===
|
|
527
|
-
case
|
|
593
|
+
case j.EntityStart:
|
|
594
|
+
return u.charCodeAt(t) === V.NUM ? (this.state = j.NumericStart, this.consumed += 1, this.stateNumericStart(u, t + 1)) : (this.state = j.NamedEntity, this.stateNamedEntity(u, t));
|
|
595
|
+
case j.NumericStart:
|
|
528
596
|
return this.stateNumericStart(u, t);
|
|
529
|
-
case
|
|
597
|
+
case j.NumericDecimal:
|
|
530
598
|
return this.stateNumericDecimal(u, t);
|
|
531
|
-
case
|
|
599
|
+
case j.NumericHex:
|
|
532
600
|
return this.stateNumericHex(u, t);
|
|
533
|
-
case
|
|
601
|
+
case j.NamedEntity:
|
|
534
602
|
return this.stateNamedEntity(u, t);
|
|
535
603
|
}
|
|
536
604
|
}
|
|
@@ -544,12 +612,12 @@ class je {
|
|
|
544
612
|
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
|
545
613
|
*/
|
|
546
614
|
stateNumericStart(u, t) {
|
|
547
|
-
return t >= u.length ? -1 : (u.charCodeAt(t) |
|
|
615
|
+
return t >= u.length ? -1 : (u.charCodeAt(t) | Ue) === V.LOWER_X ? (this.state = j.NumericHex, this.consumed += 1, this.stateNumericHex(u, t + 1)) : (this.state = j.NumericDecimal, this.stateNumericDecimal(u, t));
|
|
548
616
|
}
|
|
549
|
-
addToNumericResult(u, t, a,
|
|
617
|
+
addToNumericResult(u, t, a, r) {
|
|
550
618
|
if (t !== a) {
|
|
551
|
-
const
|
|
552
|
-
this.result = this.result * Math.pow(
|
|
619
|
+
const n = a - t;
|
|
620
|
+
this.result = this.result * Math.pow(r, n) + Number.parseInt(u.substr(t, n), r), this.consumed += n;
|
|
553
621
|
}
|
|
554
622
|
}
|
|
555
623
|
/**
|
|
@@ -564,11 +632,11 @@ class je {
|
|
|
564
632
|
stateNumericHex(u, t) {
|
|
565
633
|
const a = t;
|
|
566
634
|
for (; t < u.length; ) {
|
|
567
|
-
const
|
|
568
|
-
if (
|
|
635
|
+
const r = u.charCodeAt(t);
|
|
636
|
+
if (pu(r) || Ge(r))
|
|
569
637
|
t += 1;
|
|
570
638
|
else
|
|
571
|
-
return this.addToNumericResult(u, a, t, 16), this.emitNumericEntity(
|
|
639
|
+
return this.addToNumericResult(u, a, t, 16), this.emitNumericEntity(r, 3);
|
|
572
640
|
}
|
|
573
641
|
return this.addToNumericResult(u, a, t, 16), -1;
|
|
574
642
|
}
|
|
@@ -584,11 +652,11 @@ class je {
|
|
|
584
652
|
stateNumericDecimal(u, t) {
|
|
585
653
|
const a = t;
|
|
586
654
|
for (; t < u.length; ) {
|
|
587
|
-
const
|
|
588
|
-
if (
|
|
655
|
+
const r = u.charCodeAt(t);
|
|
656
|
+
if (pu(r))
|
|
589
657
|
t += 1;
|
|
590
658
|
else
|
|
591
|
-
return this.addToNumericResult(u, a, t, 10), this.emitNumericEntity(
|
|
659
|
+
return this.addToNumericResult(u, a, t, 10), this.emitNumericEntity(r, 2);
|
|
592
660
|
}
|
|
593
661
|
return this.addToNumericResult(u, a, t, 10), -1;
|
|
594
662
|
}
|
|
@@ -609,11 +677,11 @@ class je {
|
|
|
609
677
|
var a;
|
|
610
678
|
if (this.consumed <= t)
|
|
611
679
|
return (a = this.errors) === null || a === void 0 || a.absenceOfDigitsInNumericCharacterReference(this.consumed), 0;
|
|
612
|
-
if (u ===
|
|
680
|
+
if (u === V.SEMI)
|
|
613
681
|
this.consumed += 1;
|
|
614
|
-
else if (this.decodeMode ===
|
|
682
|
+
else if (this.decodeMode === M.Strict)
|
|
615
683
|
return 0;
|
|
616
|
-
return this.emitCodePoint(
|
|
684
|
+
return this.emitCodePoint($e(this.result), this.consumed), this.errors && (u !== V.SEMI && this.errors.missingSemicolonAfterCharacterReference(), this.errors.validateNumericCharacterReference(this.result)), this.consumed;
|
|
617
685
|
}
|
|
618
686
|
/**
|
|
619
687
|
* Parses a named entity.
|
|
@@ -626,18 +694,18 @@ class je {
|
|
|
626
694
|
*/
|
|
627
695
|
stateNamedEntity(u, t) {
|
|
628
696
|
const { decodeTree: a } = this;
|
|
629
|
-
let
|
|
697
|
+
let r = a[this.treeIndex], n = (r & W.VALUE_LENGTH) >> 14;
|
|
630
698
|
for (; t < u.length; t++, this.excess++) {
|
|
631
|
-
const
|
|
632
|
-
if (this.treeIndex =
|
|
699
|
+
const i = u.charCodeAt(t);
|
|
700
|
+
if (this.treeIndex = Xe(a, r, this.treeIndex + Math.max(1, n), i), this.treeIndex < 0)
|
|
633
701
|
return this.result === 0 || // If we are parsing an attribute
|
|
634
|
-
this.decodeMode ===
|
|
635
|
-
(
|
|
636
|
-
|
|
637
|
-
if (
|
|
638
|
-
if (
|
|
639
|
-
return this.emitNamedEntityData(this.treeIndex,
|
|
640
|
-
this.decodeMode !==
|
|
702
|
+
this.decodeMode === M.Attribute && // We shouldn't have consumed any characters after the entity,
|
|
703
|
+
(n === 0 || // And there should be no invalid characters.
|
|
704
|
+
We(i)) ? 0 : this.emitNotTerminatedNamedEntity();
|
|
705
|
+
if (r = a[this.treeIndex], n = (r & W.VALUE_LENGTH) >> 14, n !== 0) {
|
|
706
|
+
if (i === V.SEMI)
|
|
707
|
+
return this.emitNamedEntityData(this.treeIndex, n, this.consumed + this.excess);
|
|
708
|
+
this.decodeMode !== M.Strict && (this.result = this.treeIndex, this.consumed += this.excess, this.excess = 0);
|
|
641
709
|
}
|
|
642
710
|
}
|
|
643
711
|
return -1;
|
|
@@ -649,8 +717,8 @@ class je {
|
|
|
649
717
|
*/
|
|
650
718
|
emitNotTerminatedNamedEntity() {
|
|
651
719
|
var u;
|
|
652
|
-
const { result: t, decodeTree: a } = this,
|
|
653
|
-
return this.emitNamedEntityData(t,
|
|
720
|
+
const { result: t, decodeTree: a } = this, r = (a[t] & W.VALUE_LENGTH) >> 14;
|
|
721
|
+
return this.emitNamedEntityData(t, r, this.consumed), (u = this.errors) === null || u === void 0 || u.missingSemicolonAfterCharacterReference(), this.consumed;
|
|
654
722
|
}
|
|
655
723
|
/**
|
|
656
724
|
* Emit a named entity.
|
|
@@ -662,8 +730,8 @@ class je {
|
|
|
662
730
|
* @returns The number of characters consumed.
|
|
663
731
|
*/
|
|
664
732
|
emitNamedEntityData(u, t, a) {
|
|
665
|
-
const { decodeTree:
|
|
666
|
-
return this.emitCodePoint(t === 1 ?
|
|
733
|
+
const { decodeTree: r } = this;
|
|
734
|
+
return this.emitCodePoint(t === 1 ? r[u] & ~W.VALUE_LENGTH : r[u + 1], a), t === 3 && this.emitCodePoint(r[u + 2], a), a;
|
|
667
735
|
}
|
|
668
736
|
/**
|
|
669
737
|
* Signal to the parser that the end of the input was reached.
|
|
@@ -675,62 +743,62 @@ class je {
|
|
|
675
743
|
end() {
|
|
676
744
|
var u;
|
|
677
745
|
switch (this.state) {
|
|
678
|
-
case
|
|
679
|
-
return this.result !== 0 && (this.decodeMode !==
|
|
746
|
+
case j.NamedEntity:
|
|
747
|
+
return this.result !== 0 && (this.decodeMode !== M.Attribute || this.result === this.treeIndex) ? this.emitNotTerminatedNamedEntity() : 0;
|
|
680
748
|
// Otherwise, emit a numeric entity if we have one.
|
|
681
|
-
case
|
|
749
|
+
case j.NumericDecimal:
|
|
682
750
|
return this.emitNumericEntity(0, 2);
|
|
683
|
-
case
|
|
751
|
+
case j.NumericHex:
|
|
684
752
|
return this.emitNumericEntity(0, 3);
|
|
685
|
-
case
|
|
753
|
+
case j.NumericStart:
|
|
686
754
|
return (u = this.errors) === null || u === void 0 || u.absenceOfDigitsInNumericCharacterReference(this.consumed), 0;
|
|
687
|
-
case
|
|
755
|
+
case j.EntityStart:
|
|
688
756
|
return 0;
|
|
689
757
|
}
|
|
690
758
|
}
|
|
691
759
|
}
|
|
692
|
-
function
|
|
693
|
-
const
|
|
694
|
-
if (
|
|
695
|
-
return
|
|
696
|
-
if (
|
|
697
|
-
const o = a -
|
|
698
|
-
return o < 0 || o >=
|
|
760
|
+
function Xe(e, u, t, a) {
|
|
761
|
+
const r = (u & W.BRANCH_LENGTH) >> 7, n = u & W.JUMP_TABLE;
|
|
762
|
+
if (r === 0)
|
|
763
|
+
return n !== 0 && a === n ? t : -1;
|
|
764
|
+
if (n) {
|
|
765
|
+
const o = a - n;
|
|
766
|
+
return o < 0 || o >= r ? -1 : e[t + o] - 1;
|
|
699
767
|
}
|
|
700
|
-
let
|
|
701
|
-
for (;
|
|
702
|
-
const o =
|
|
703
|
-
if (
|
|
704
|
-
|
|
705
|
-
else if (
|
|
706
|
-
|
|
768
|
+
let i = t, s = i + r - 1;
|
|
769
|
+
for (; i <= s; ) {
|
|
770
|
+
const o = i + s >>> 1, c = e[o];
|
|
771
|
+
if (c < a)
|
|
772
|
+
i = o + 1;
|
|
773
|
+
else if (c > a)
|
|
774
|
+
s = o - 1;
|
|
707
775
|
else
|
|
708
|
-
return e[o +
|
|
776
|
+
return e[o + r];
|
|
709
777
|
}
|
|
710
778
|
return -1;
|
|
711
779
|
}
|
|
712
|
-
var
|
|
780
|
+
var g;
|
|
713
781
|
(function(e) {
|
|
714
782
|
e[e.Tab = 9] = "Tab", e[e.NewLine = 10] = "NewLine", e[e.FormFeed = 12] = "FormFeed", e[e.CarriageReturn = 13] = "CarriageReturn", e[e.Space = 32] = "Space", e[e.ExclamationMark = 33] = "ExclamationMark", e[e.Number = 35] = "Number", e[e.Amp = 38] = "Amp", e[e.SingleQuote = 39] = "SingleQuote", e[e.DoubleQuote = 34] = "DoubleQuote", e[e.Dash = 45] = "Dash", e[e.Slash = 47] = "Slash", e[e.Zero = 48] = "Zero", e[e.Nine = 57] = "Nine", e[e.Semi = 59] = "Semi", e[e.Lt = 60] = "Lt", e[e.Eq = 61] = "Eq", e[e.Gt = 62] = "Gt", e[e.Questionmark = 63] = "Questionmark", e[e.UpperA = 65] = "UpperA", e[e.LowerA = 97] = "LowerA", e[e.UpperF = 70] = "UpperF", e[e.LowerF = 102] = "LowerF", e[e.UpperZ = 90] = "UpperZ", e[e.LowerZ = 122] = "LowerZ", e[e.LowerX = 120] = "LowerX", e[e.OpeningSquareBracket = 91] = "OpeningSquareBracket";
|
|
715
|
-
})(
|
|
716
|
-
var
|
|
783
|
+
})(g || (g = {}));
|
|
784
|
+
var f;
|
|
717
785
|
(function(e) {
|
|
718
786
|
e[e.Text = 1] = "Text", e[e.BeforeTagName = 2] = "BeforeTagName", e[e.InTagName = 3] = "InTagName", e[e.InSelfClosingTag = 4] = "InSelfClosingTag", e[e.BeforeClosingTagName = 5] = "BeforeClosingTagName", e[e.InClosingTagName = 6] = "InClosingTagName", e[e.AfterClosingTagName = 7] = "AfterClosingTagName", e[e.BeforeAttributeName = 8] = "BeforeAttributeName", e[e.InAttributeName = 9] = "InAttributeName", e[e.AfterAttributeName = 10] = "AfterAttributeName", e[e.BeforeAttributeValue = 11] = "BeforeAttributeValue", e[e.InAttributeValueDq = 12] = "InAttributeValueDq", e[e.InAttributeValueSq = 13] = "InAttributeValueSq", e[e.InAttributeValueNq = 14] = "InAttributeValueNq", e[e.BeforeDeclaration = 15] = "BeforeDeclaration", e[e.InDeclaration = 16] = "InDeclaration", e[e.InProcessingInstruction = 17] = "InProcessingInstruction", e[e.BeforeComment = 18] = "BeforeComment", e[e.CDATASequence = 19] = "CDATASequence", e[e.InSpecialComment = 20] = "InSpecialComment", e[e.InCommentLike = 21] = "InCommentLike", e[e.BeforeSpecialS = 22] = "BeforeSpecialS", e[e.BeforeSpecialT = 23] = "BeforeSpecialT", e[e.SpecialStartSequence = 24] = "SpecialStartSequence", e[e.InSpecialTag = 25] = "InSpecialTag", e[e.InEntity = 26] = "InEntity";
|
|
719
|
-
})(
|
|
720
|
-
function
|
|
721
|
-
return e ===
|
|
787
|
+
})(f || (f = {}));
|
|
788
|
+
function U(e) {
|
|
789
|
+
return e === g.Space || e === g.NewLine || e === g.Tab || e === g.FormFeed || e === g.CarriageReturn;
|
|
722
790
|
}
|
|
723
|
-
function
|
|
724
|
-
return e ===
|
|
791
|
+
function tu(e) {
|
|
792
|
+
return e === g.Slash || e === g.Gt || U(e);
|
|
725
793
|
}
|
|
726
|
-
function
|
|
727
|
-
return e >=
|
|
794
|
+
function ze(e) {
|
|
795
|
+
return e >= g.LowerA && e <= g.LowerZ || e >= g.UpperA && e <= g.UpperZ;
|
|
728
796
|
}
|
|
729
|
-
var
|
|
797
|
+
var O;
|
|
730
798
|
(function(e) {
|
|
731
799
|
e[e.NoValue = 0] = "NoValue", e[e.Unquoted = 1] = "Unquoted", e[e.Single = 2] = "Single", e[e.Double = 3] = "Double";
|
|
732
|
-
})(
|
|
733
|
-
const
|
|
800
|
+
})(O || (O = {}));
|
|
801
|
+
const N = {
|
|
734
802
|
Cdata: new Uint8Array([67, 68, 65, 84, 65, 91]),
|
|
735
803
|
// CDATA[
|
|
736
804
|
CdataEnd: new Uint8Array([93, 93, 62]),
|
|
@@ -759,12 +827,12 @@ const w = {
|
|
|
759
827
|
XmpEnd: new Uint8Array([60, 47, 120, 109, 112])
|
|
760
828
|
// `</xmp`
|
|
761
829
|
};
|
|
762
|
-
class
|
|
830
|
+
class Qe {
|
|
763
831
|
constructor({ xmlMode: u = !1, decodeEntities: t = !0 }, a) {
|
|
764
|
-
this.cbs = a, this.state =
|
|
832
|
+
this.cbs = a, this.state = f.Text, this.buffer = "", this.sectionStart = 0, this.index = 0, this.entityStart = 0, this.baseState = f.Text, this.isSpecial = !1, this.running = !0, this.offset = 0, this.currentSequence = void 0, this.sequenceIndex = 0, this.xmlMode = u, this.decodeEntities = t, this.entityDecoder = new Je(u ? Be : Oe, (r, n) => this.emitCodePoint(r, n));
|
|
765
833
|
}
|
|
766
834
|
reset() {
|
|
767
|
-
this.state =
|
|
835
|
+
this.state = f.Text, this.buffer = "", this.sectionStart = 0, this.index = 0, this.baseState = f.Text, this.currentSequence = void 0, this.running = !0, this.offset = 0;
|
|
768
836
|
}
|
|
769
837
|
write(u) {
|
|
770
838
|
this.offset += this.buffer.length, this.buffer = u, this.parse();
|
|
@@ -779,13 +847,13 @@ class Le {
|
|
|
779
847
|
this.running = !0, this.index < this.buffer.length + this.offset && this.parse();
|
|
780
848
|
}
|
|
781
849
|
stateText(u) {
|
|
782
|
-
u ===
|
|
850
|
+
u === g.Lt || !this.decodeEntities && this.fastForwardTo(g.Lt) ? (this.index > this.sectionStart && this.cbs.ontext(this.sectionStart, this.index), this.state = f.BeforeTagName, this.sectionStart = this.index) : this.decodeEntities && u === g.Amp && this.startEntity();
|
|
783
851
|
}
|
|
784
852
|
stateSpecialStartSequence(u) {
|
|
785
853
|
const t = this.sequenceIndex === this.currentSequence.length;
|
|
786
854
|
if (!(t ? (
|
|
787
855
|
// If we are at the end of the sequence, make sure the tag name has ended
|
|
788
|
-
|
|
856
|
+
tu(u)
|
|
789
857
|
) : (
|
|
790
858
|
// Otherwise, do a case-insensitive comparison
|
|
791
859
|
(u | 32) === this.currentSequence[this.sequenceIndex]
|
|
@@ -795,12 +863,12 @@ class Le {
|
|
|
795
863
|
this.sequenceIndex++;
|
|
796
864
|
return;
|
|
797
865
|
}
|
|
798
|
-
this.sequenceIndex = 0, this.state =
|
|
866
|
+
this.sequenceIndex = 0, this.state = f.InTagName, this.stateInTagName(u);
|
|
799
867
|
}
|
|
800
868
|
/** Look for an end tag. For <title> tags, also decode entities. */
|
|
801
869
|
stateInSpecialTag(u) {
|
|
802
870
|
if (this.sequenceIndex === this.currentSequence.length) {
|
|
803
|
-
if (u ===
|
|
871
|
+
if (u === g.Gt || U(u)) {
|
|
804
872
|
const t = this.index - this.currentSequence.length;
|
|
805
873
|
if (this.sectionStart < t) {
|
|
806
874
|
const a = this.index;
|
|
@@ -811,10 +879,10 @@ class Le {
|
|
|
811
879
|
}
|
|
812
880
|
this.sequenceIndex = 0;
|
|
813
881
|
}
|
|
814
|
-
(u | 32) === this.currentSequence[this.sequenceIndex] ? this.sequenceIndex += 1 : this.sequenceIndex === 0 ? this.currentSequence ===
|
|
882
|
+
(u | 32) === this.currentSequence[this.sequenceIndex] ? this.sequenceIndex += 1 : this.sequenceIndex === 0 ? this.currentSequence === N.TitleEnd ? this.decodeEntities && u === g.Amp && this.startEntity() : this.fastForwardTo(g.Lt) && (this.sequenceIndex = 1) : this.sequenceIndex = +(u === g.Lt);
|
|
815
883
|
}
|
|
816
884
|
stateCDATASequence(u) {
|
|
817
|
-
u ===
|
|
885
|
+
u === N.Cdata[this.sequenceIndex] ? ++this.sequenceIndex === N.Cdata.length && (this.state = f.InCommentLike, this.currentSequence = N.CdataEnd, this.sequenceIndex = 0, this.sectionStart = this.index + 1) : (this.sequenceIndex = 0, this.state = f.InDeclaration, this.stateInDeclaration(u));
|
|
818
886
|
}
|
|
819
887
|
/**
|
|
820
888
|
* When we wait for one specific character, we can speed things up
|
|
@@ -837,7 +905,7 @@ class Le {
|
|
|
837
905
|
* - All characters but the start character of the sequence can be skipped.
|
|
838
906
|
*/
|
|
839
907
|
stateInCommentLike(u) {
|
|
840
|
-
u === this.currentSequence[this.sequenceIndex] ? ++this.sequenceIndex === this.currentSequence.length && (this.currentSequence ===
|
|
908
|
+
u === this.currentSequence[this.sequenceIndex] ? ++this.sequenceIndex === this.currentSequence.length && (this.currentSequence === N.CdataEnd ? this.cbs.oncdata(this.sectionStart, this.index, 2) : this.cbs.oncomment(this.sectionStart, this.index, 2), this.sequenceIndex = 0, this.sectionStart = this.index + 1, this.state = f.Text) : this.sequenceIndex === 0 ? this.fastForwardTo(this.currentSequence[0]) && (this.sequenceIndex = 1) : u !== this.currentSequence[this.sequenceIndex - 1] && (this.sequenceIndex = 0);
|
|
841
909
|
}
|
|
842
910
|
/**
|
|
843
911
|
* HTML only allows ASCII alpha characters (a-z and A-Z) at the beginning of a tag name.
|
|
@@ -846,99 +914,99 @@ class Le {
|
|
|
846
914
|
* We allow anything that wouldn't end the tag.
|
|
847
915
|
*/
|
|
848
916
|
isTagStartChar(u) {
|
|
849
|
-
return this.xmlMode ? !
|
|
917
|
+
return this.xmlMode ? !tu(u) : ze(u);
|
|
850
918
|
}
|
|
851
919
|
startSpecial(u, t) {
|
|
852
|
-
this.isSpecial = !0, this.currentSequence = u, this.sequenceIndex = t, this.state =
|
|
920
|
+
this.isSpecial = !0, this.currentSequence = u, this.sequenceIndex = t, this.state = f.SpecialStartSequence;
|
|
853
921
|
}
|
|
854
922
|
stateBeforeTagName(u) {
|
|
855
|
-
if (u ===
|
|
856
|
-
this.state =
|
|
857
|
-
else if (u ===
|
|
858
|
-
this.state =
|
|
923
|
+
if (u === g.ExclamationMark)
|
|
924
|
+
this.state = f.BeforeDeclaration, this.sectionStart = this.index + 1;
|
|
925
|
+
else if (u === g.Questionmark)
|
|
926
|
+
this.state = f.InProcessingInstruction, this.sectionStart = this.index + 1;
|
|
859
927
|
else if (this.isTagStartChar(u)) {
|
|
860
928
|
const t = u | 32;
|
|
861
|
-
this.sectionStart = this.index, this.xmlMode ? this.state =
|
|
862
|
-
} else u ===
|
|
929
|
+
this.sectionStart = this.index, this.xmlMode ? this.state = f.InTagName : t === N.ScriptEnd[2] ? this.state = f.BeforeSpecialS : t === N.TitleEnd[2] || t === N.XmpEnd[2] ? this.state = f.BeforeSpecialT : this.state = f.InTagName;
|
|
930
|
+
} else u === g.Slash ? this.state = f.BeforeClosingTagName : (this.state = f.Text, this.stateText(u));
|
|
863
931
|
}
|
|
864
932
|
stateInTagName(u) {
|
|
865
|
-
|
|
933
|
+
tu(u) && (this.cbs.onopentagname(this.sectionStart, this.index), this.sectionStart = -1, this.state = f.BeforeAttributeName, this.stateBeforeAttributeName(u));
|
|
866
934
|
}
|
|
867
935
|
stateBeforeClosingTagName(u) {
|
|
868
|
-
|
|
936
|
+
U(u) || (u === g.Gt ? this.state = f.Text : (this.state = this.isTagStartChar(u) ? f.InClosingTagName : f.InSpecialComment, this.sectionStart = this.index));
|
|
869
937
|
}
|
|
870
938
|
stateInClosingTagName(u) {
|
|
871
|
-
(u ===
|
|
939
|
+
(u === g.Gt || U(u)) && (this.cbs.onclosetag(this.sectionStart, this.index), this.sectionStart = -1, this.state = f.AfterClosingTagName, this.stateAfterClosingTagName(u));
|
|
872
940
|
}
|
|
873
941
|
stateAfterClosingTagName(u) {
|
|
874
|
-
(u ===
|
|
942
|
+
(u === g.Gt || this.fastForwardTo(g.Gt)) && (this.state = f.Text, this.sectionStart = this.index + 1);
|
|
875
943
|
}
|
|
876
944
|
stateBeforeAttributeName(u) {
|
|
877
|
-
u ===
|
|
945
|
+
u === g.Gt ? (this.cbs.onopentagend(this.index), this.isSpecial ? (this.state = f.InSpecialTag, this.sequenceIndex = 0) : this.state = f.Text, this.sectionStart = this.index + 1) : u === g.Slash ? this.state = f.InSelfClosingTag : U(u) || (this.state = f.InAttributeName, this.sectionStart = this.index);
|
|
878
946
|
}
|
|
879
947
|
stateInSelfClosingTag(u) {
|
|
880
|
-
u ===
|
|
948
|
+
u === g.Gt ? (this.cbs.onselfclosingtag(this.index), this.state = f.Text, this.sectionStart = this.index + 1, this.isSpecial = !1) : U(u) || (this.state = f.BeforeAttributeName, this.stateBeforeAttributeName(u));
|
|
881
949
|
}
|
|
882
950
|
stateInAttributeName(u) {
|
|
883
|
-
(u ===
|
|
951
|
+
(u === g.Eq || tu(u)) && (this.cbs.onattribname(this.sectionStart, this.index), this.sectionStart = this.index, this.state = f.AfterAttributeName, this.stateAfterAttributeName(u));
|
|
884
952
|
}
|
|
885
953
|
stateAfterAttributeName(u) {
|
|
886
|
-
u ===
|
|
954
|
+
u === g.Eq ? this.state = f.BeforeAttributeValue : u === g.Slash || u === g.Gt ? (this.cbs.onattribend(O.NoValue, this.sectionStart), this.sectionStart = -1, this.state = f.BeforeAttributeName, this.stateBeforeAttributeName(u)) : U(u) || (this.cbs.onattribend(O.NoValue, this.sectionStart), this.state = f.InAttributeName, this.sectionStart = this.index);
|
|
887
955
|
}
|
|
888
956
|
stateBeforeAttributeValue(u) {
|
|
889
|
-
u ===
|
|
957
|
+
u === g.DoubleQuote ? (this.state = f.InAttributeValueDq, this.sectionStart = this.index + 1) : u === g.SingleQuote ? (this.state = f.InAttributeValueSq, this.sectionStart = this.index + 1) : U(u) || (this.sectionStart = this.index, this.state = f.InAttributeValueNq, this.stateInAttributeValueNoQuotes(u));
|
|
890
958
|
}
|
|
891
959
|
handleInAttributeValue(u, t) {
|
|
892
|
-
u === t || !this.decodeEntities && this.fastForwardTo(t) ? (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = -1, this.cbs.onattribend(t ===
|
|
960
|
+
u === t || !this.decodeEntities && this.fastForwardTo(t) ? (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = -1, this.cbs.onattribend(t === g.DoubleQuote ? O.Double : O.Single, this.index + 1), this.state = f.BeforeAttributeName) : this.decodeEntities && u === g.Amp && this.startEntity();
|
|
893
961
|
}
|
|
894
962
|
stateInAttributeValueDoubleQuotes(u) {
|
|
895
|
-
this.handleInAttributeValue(u,
|
|
963
|
+
this.handleInAttributeValue(u, g.DoubleQuote);
|
|
896
964
|
}
|
|
897
965
|
stateInAttributeValueSingleQuotes(u) {
|
|
898
|
-
this.handleInAttributeValue(u,
|
|
966
|
+
this.handleInAttributeValue(u, g.SingleQuote);
|
|
899
967
|
}
|
|
900
968
|
stateInAttributeValueNoQuotes(u) {
|
|
901
|
-
|
|
969
|
+
U(u) || u === g.Gt ? (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = -1, this.cbs.onattribend(O.Unquoted, this.index), this.state = f.BeforeAttributeName, this.stateBeforeAttributeName(u)) : this.decodeEntities && u === g.Amp && this.startEntity();
|
|
902
970
|
}
|
|
903
971
|
stateBeforeDeclaration(u) {
|
|
904
|
-
u ===
|
|
972
|
+
u === g.OpeningSquareBracket ? (this.state = f.CDATASequence, this.sequenceIndex = 0) : this.state = u === g.Dash ? f.BeforeComment : f.InDeclaration;
|
|
905
973
|
}
|
|
906
974
|
stateInDeclaration(u) {
|
|
907
|
-
(u ===
|
|
975
|
+
(u === g.Gt || this.fastForwardTo(g.Gt)) && (this.cbs.ondeclaration(this.sectionStart, this.index), this.state = f.Text, this.sectionStart = this.index + 1);
|
|
908
976
|
}
|
|
909
977
|
stateInProcessingInstruction(u) {
|
|
910
|
-
(u ===
|
|
978
|
+
(u === g.Gt || this.fastForwardTo(g.Gt)) && (this.cbs.onprocessinginstruction(this.sectionStart, this.index), this.state = f.Text, this.sectionStart = this.index + 1);
|
|
911
979
|
}
|
|
912
980
|
stateBeforeComment(u) {
|
|
913
|
-
u ===
|
|
981
|
+
u === g.Dash ? (this.state = f.InCommentLike, this.currentSequence = N.CommentEnd, this.sequenceIndex = 2, this.sectionStart = this.index + 1) : this.state = f.InDeclaration;
|
|
914
982
|
}
|
|
915
983
|
stateInSpecialComment(u) {
|
|
916
|
-
(u ===
|
|
984
|
+
(u === g.Gt || this.fastForwardTo(g.Gt)) && (this.cbs.oncomment(this.sectionStart, this.index, 0), this.state = f.Text, this.sectionStart = this.index + 1);
|
|
917
985
|
}
|
|
918
986
|
stateBeforeSpecialS(u) {
|
|
919
987
|
const t = u | 32;
|
|
920
|
-
t ===
|
|
988
|
+
t === N.ScriptEnd[3] ? this.startSpecial(N.ScriptEnd, 4) : t === N.StyleEnd[3] ? this.startSpecial(N.StyleEnd, 4) : (this.state = f.InTagName, this.stateInTagName(u));
|
|
921
989
|
}
|
|
922
990
|
stateBeforeSpecialT(u) {
|
|
923
991
|
switch (u | 32) {
|
|
924
|
-
case
|
|
925
|
-
this.startSpecial(
|
|
992
|
+
case N.TitleEnd[3]: {
|
|
993
|
+
this.startSpecial(N.TitleEnd, 4);
|
|
926
994
|
break;
|
|
927
995
|
}
|
|
928
|
-
case
|
|
929
|
-
this.startSpecial(
|
|
996
|
+
case N.TextareaEnd[3]: {
|
|
997
|
+
this.startSpecial(N.TextareaEnd, 4);
|
|
930
998
|
break;
|
|
931
999
|
}
|
|
932
|
-
case
|
|
933
|
-
this.startSpecial(
|
|
1000
|
+
case N.XmpEnd[3]: {
|
|
1001
|
+
this.startSpecial(N.XmpEnd, 4);
|
|
934
1002
|
break;
|
|
935
1003
|
}
|
|
936
1004
|
default:
|
|
937
|
-
this.state =
|
|
1005
|
+
this.state = f.InTagName, this.stateInTagName(u);
|
|
938
1006
|
}
|
|
939
1007
|
}
|
|
940
1008
|
startEntity() {
|
|
941
|
-
this.baseState = this.state, this.state =
|
|
1009
|
+
this.baseState = this.state, this.state = f.InEntity, this.entityStart = this.index, this.entityDecoder.startEntity(this.xmlMode ? M.Strict : this.baseState === f.Text || this.baseState === f.InSpecialTag ? M.Legacy : M.Attribute);
|
|
942
1010
|
}
|
|
943
1011
|
stateInEntity() {
|
|
944
1012
|
const u = this.entityDecoder.write(this.buffer, this.index - this.offset);
|
|
@@ -948,7 +1016,7 @@ class Le {
|
|
|
948
1016
|
* Remove data that has already been consumed from the buffer.
|
|
949
1017
|
*/
|
|
950
1018
|
cleanup() {
|
|
951
|
-
this.running && this.sectionStart !== this.index && (this.state ===
|
|
1019
|
+
this.running && this.sectionStart !== this.index && (this.state === f.Text || this.state === f.InSpecialTag && this.sequenceIndex === 0 ? (this.cbs.ontext(this.sectionStart, this.index), this.sectionStart = this.index) : (this.state === f.InAttributeValueDq || this.state === f.InAttributeValueSq || this.state === f.InAttributeValueNq) && (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = this.index));
|
|
952
1020
|
}
|
|
953
1021
|
shouldContinue() {
|
|
954
1022
|
return this.index < this.buffer.length + this.offset && this.running;
|
|
@@ -962,107 +1030,107 @@ class Le {
|
|
|
962
1030
|
for (; this.shouldContinue(); ) {
|
|
963
1031
|
const u = this.buffer.charCodeAt(this.index - this.offset);
|
|
964
1032
|
switch (this.state) {
|
|
965
|
-
case
|
|
1033
|
+
case f.Text: {
|
|
966
1034
|
this.stateText(u);
|
|
967
1035
|
break;
|
|
968
1036
|
}
|
|
969
|
-
case
|
|
1037
|
+
case f.SpecialStartSequence: {
|
|
970
1038
|
this.stateSpecialStartSequence(u);
|
|
971
1039
|
break;
|
|
972
1040
|
}
|
|
973
|
-
case
|
|
1041
|
+
case f.InSpecialTag: {
|
|
974
1042
|
this.stateInSpecialTag(u);
|
|
975
1043
|
break;
|
|
976
1044
|
}
|
|
977
|
-
case
|
|
1045
|
+
case f.CDATASequence: {
|
|
978
1046
|
this.stateCDATASequence(u);
|
|
979
1047
|
break;
|
|
980
1048
|
}
|
|
981
|
-
case
|
|
1049
|
+
case f.InAttributeValueDq: {
|
|
982
1050
|
this.stateInAttributeValueDoubleQuotes(u);
|
|
983
1051
|
break;
|
|
984
1052
|
}
|
|
985
|
-
case
|
|
1053
|
+
case f.InAttributeName: {
|
|
986
1054
|
this.stateInAttributeName(u);
|
|
987
1055
|
break;
|
|
988
1056
|
}
|
|
989
|
-
case
|
|
1057
|
+
case f.InCommentLike: {
|
|
990
1058
|
this.stateInCommentLike(u);
|
|
991
1059
|
break;
|
|
992
1060
|
}
|
|
993
|
-
case
|
|
1061
|
+
case f.InSpecialComment: {
|
|
994
1062
|
this.stateInSpecialComment(u);
|
|
995
1063
|
break;
|
|
996
1064
|
}
|
|
997
|
-
case
|
|
1065
|
+
case f.BeforeAttributeName: {
|
|
998
1066
|
this.stateBeforeAttributeName(u);
|
|
999
1067
|
break;
|
|
1000
1068
|
}
|
|
1001
|
-
case
|
|
1069
|
+
case f.InTagName: {
|
|
1002
1070
|
this.stateInTagName(u);
|
|
1003
1071
|
break;
|
|
1004
1072
|
}
|
|
1005
|
-
case
|
|
1073
|
+
case f.InClosingTagName: {
|
|
1006
1074
|
this.stateInClosingTagName(u);
|
|
1007
1075
|
break;
|
|
1008
1076
|
}
|
|
1009
|
-
case
|
|
1077
|
+
case f.BeforeTagName: {
|
|
1010
1078
|
this.stateBeforeTagName(u);
|
|
1011
1079
|
break;
|
|
1012
1080
|
}
|
|
1013
|
-
case
|
|
1081
|
+
case f.AfterAttributeName: {
|
|
1014
1082
|
this.stateAfterAttributeName(u);
|
|
1015
1083
|
break;
|
|
1016
1084
|
}
|
|
1017
|
-
case
|
|
1085
|
+
case f.InAttributeValueSq: {
|
|
1018
1086
|
this.stateInAttributeValueSingleQuotes(u);
|
|
1019
1087
|
break;
|
|
1020
1088
|
}
|
|
1021
|
-
case
|
|
1089
|
+
case f.BeforeAttributeValue: {
|
|
1022
1090
|
this.stateBeforeAttributeValue(u);
|
|
1023
1091
|
break;
|
|
1024
1092
|
}
|
|
1025
|
-
case
|
|
1093
|
+
case f.BeforeClosingTagName: {
|
|
1026
1094
|
this.stateBeforeClosingTagName(u);
|
|
1027
1095
|
break;
|
|
1028
1096
|
}
|
|
1029
|
-
case
|
|
1097
|
+
case f.AfterClosingTagName: {
|
|
1030
1098
|
this.stateAfterClosingTagName(u);
|
|
1031
1099
|
break;
|
|
1032
1100
|
}
|
|
1033
|
-
case
|
|
1101
|
+
case f.BeforeSpecialS: {
|
|
1034
1102
|
this.stateBeforeSpecialS(u);
|
|
1035
1103
|
break;
|
|
1036
1104
|
}
|
|
1037
|
-
case
|
|
1105
|
+
case f.BeforeSpecialT: {
|
|
1038
1106
|
this.stateBeforeSpecialT(u);
|
|
1039
1107
|
break;
|
|
1040
1108
|
}
|
|
1041
|
-
case
|
|
1109
|
+
case f.InAttributeValueNq: {
|
|
1042
1110
|
this.stateInAttributeValueNoQuotes(u);
|
|
1043
1111
|
break;
|
|
1044
1112
|
}
|
|
1045
|
-
case
|
|
1113
|
+
case f.InSelfClosingTag: {
|
|
1046
1114
|
this.stateInSelfClosingTag(u);
|
|
1047
1115
|
break;
|
|
1048
1116
|
}
|
|
1049
|
-
case
|
|
1117
|
+
case f.InDeclaration: {
|
|
1050
1118
|
this.stateInDeclaration(u);
|
|
1051
1119
|
break;
|
|
1052
1120
|
}
|
|
1053
|
-
case
|
|
1121
|
+
case f.BeforeDeclaration: {
|
|
1054
1122
|
this.stateBeforeDeclaration(u);
|
|
1055
1123
|
break;
|
|
1056
1124
|
}
|
|
1057
|
-
case
|
|
1125
|
+
case f.BeforeComment: {
|
|
1058
1126
|
this.stateBeforeComment(u);
|
|
1059
1127
|
break;
|
|
1060
1128
|
}
|
|
1061
|
-
case
|
|
1129
|
+
case f.InProcessingInstruction: {
|
|
1062
1130
|
this.stateInProcessingInstruction(u);
|
|
1063
1131
|
break;
|
|
1064
1132
|
}
|
|
1065
|
-
case
|
|
1133
|
+
case f.InEntity: {
|
|
1066
1134
|
this.stateInEntity();
|
|
1067
1135
|
break;
|
|
1068
1136
|
}
|
|
@@ -1072,18 +1140,18 @@ class Le {
|
|
|
1072
1140
|
this.cleanup();
|
|
1073
1141
|
}
|
|
1074
1142
|
finish() {
|
|
1075
|
-
this.state ===
|
|
1143
|
+
this.state === f.InEntity && (this.entityDecoder.end(), this.state = this.baseState), this.handleTrailingData(), this.cbs.onend();
|
|
1076
1144
|
}
|
|
1077
1145
|
/** Handle any trailing data. */
|
|
1078
1146
|
handleTrailingData() {
|
|
1079
1147
|
const u = this.buffer.length + this.offset;
|
|
1080
|
-
this.sectionStart >= u || (this.state ===
|
|
1148
|
+
this.sectionStart >= u || (this.state === f.InCommentLike ? this.currentSequence === N.CdataEnd ? this.cbs.oncdata(this.sectionStart, u, 0) : this.cbs.oncomment(this.sectionStart, u, 0) : this.state === f.InTagName || this.state === f.BeforeAttributeName || this.state === f.BeforeAttributeValue || this.state === f.AfterAttributeName || this.state === f.InAttributeName || this.state === f.InAttributeValueSq || this.state === f.InAttributeValueDq || this.state === f.InAttributeValueNq || this.state === f.InClosingTagName || this.cbs.ontext(this.sectionStart, u));
|
|
1081
1149
|
}
|
|
1082
1150
|
emitCodePoint(u, t) {
|
|
1083
|
-
this.baseState !==
|
|
1151
|
+
this.baseState !== f.Text && this.baseState !== f.InSpecialTag ? (this.sectionStart < this.entityStart && this.cbs.onattribdata(this.sectionStart, this.entityStart), this.sectionStart = this.entityStart + t, this.index = this.sectionStart - 1, this.cbs.onattribentity(u)) : (this.sectionStart < this.entityStart && this.cbs.ontext(this.sectionStart, this.entityStart), this.sectionStart = this.entityStart + t, this.index = this.sectionStart - 1, this.cbs.ontextentity(u, this.sectionStart));
|
|
1084
1152
|
}
|
|
1085
1153
|
}
|
|
1086
|
-
const
|
|
1154
|
+
const z = /* @__PURE__ */ new Set([
|
|
1087
1155
|
"input",
|
|
1088
1156
|
"option",
|
|
1089
1157
|
"optgroup",
|
|
@@ -1091,55 +1159,55 @@ const W = /* @__PURE__ */ new Set([
|
|
|
1091
1159
|
"button",
|
|
1092
1160
|
"datalist",
|
|
1093
1161
|
"textarea"
|
|
1094
|
-
]),
|
|
1162
|
+
]), k = /* @__PURE__ */ new Set(["p"]), ku = /* @__PURE__ */ new Set(["thead", "tbody"]), Tu = /* @__PURE__ */ new Set(["dd", "dt"]), Nu = /* @__PURE__ */ new Set(["rt", "rp"]), Ze = /* @__PURE__ */ new Map([
|
|
1095
1163
|
["tr", /* @__PURE__ */ new Set(["tr", "th", "td"])],
|
|
1096
1164
|
["th", /* @__PURE__ */ new Set(["th"])],
|
|
1097
1165
|
["td", /* @__PURE__ */ new Set(["thead", "th", "td"])],
|
|
1098
1166
|
["body", /* @__PURE__ */ new Set(["head", "link", "script"])],
|
|
1099
1167
|
["li", /* @__PURE__ */ new Set(["li"])],
|
|
1100
|
-
["p",
|
|
1101
|
-
["h1",
|
|
1102
|
-
["h2",
|
|
1103
|
-
["h3",
|
|
1104
|
-
["h4",
|
|
1105
|
-
["h5",
|
|
1106
|
-
["h6",
|
|
1107
|
-
["select",
|
|
1108
|
-
["input",
|
|
1109
|
-
["output",
|
|
1110
|
-
["button",
|
|
1111
|
-
["datalist",
|
|
1112
|
-
["textarea",
|
|
1168
|
+
["p", k],
|
|
1169
|
+
["h1", k],
|
|
1170
|
+
["h2", k],
|
|
1171
|
+
["h3", k],
|
|
1172
|
+
["h4", k],
|
|
1173
|
+
["h5", k],
|
|
1174
|
+
["h6", k],
|
|
1175
|
+
["select", z],
|
|
1176
|
+
["input", z],
|
|
1177
|
+
["output", z],
|
|
1178
|
+
["button", z],
|
|
1179
|
+
["datalist", z],
|
|
1180
|
+
["textarea", z],
|
|
1113
1181
|
["option", /* @__PURE__ */ new Set(["option"])],
|
|
1114
1182
|
["optgroup", /* @__PURE__ */ new Set(["optgroup", "option"])],
|
|
1115
|
-
["dd",
|
|
1116
|
-
["dt",
|
|
1117
|
-
["address",
|
|
1118
|
-
["article",
|
|
1119
|
-
["aside",
|
|
1120
|
-
["blockquote",
|
|
1121
|
-
["details",
|
|
1122
|
-
["div",
|
|
1123
|
-
["dl",
|
|
1124
|
-
["fieldset",
|
|
1125
|
-
["figcaption",
|
|
1126
|
-
["figure",
|
|
1127
|
-
["footer",
|
|
1128
|
-
["form",
|
|
1129
|
-
["header",
|
|
1130
|
-
["hr",
|
|
1131
|
-
["main",
|
|
1132
|
-
["nav",
|
|
1133
|
-
["ol",
|
|
1134
|
-
["pre",
|
|
1135
|
-
["section",
|
|
1136
|
-
["table",
|
|
1137
|
-
["ul",
|
|
1138
|
-
["rt",
|
|
1139
|
-
["rp",
|
|
1140
|
-
["tbody",
|
|
1141
|
-
["tfoot",
|
|
1142
|
-
]),
|
|
1183
|
+
["dd", Tu],
|
|
1184
|
+
["dt", Tu],
|
|
1185
|
+
["address", k],
|
|
1186
|
+
["article", k],
|
|
1187
|
+
["aside", k],
|
|
1188
|
+
["blockquote", k],
|
|
1189
|
+
["details", k],
|
|
1190
|
+
["div", k],
|
|
1191
|
+
["dl", k],
|
|
1192
|
+
["fieldset", k],
|
|
1193
|
+
["figcaption", k],
|
|
1194
|
+
["figure", k],
|
|
1195
|
+
["footer", k],
|
|
1196
|
+
["form", k],
|
|
1197
|
+
["header", k],
|
|
1198
|
+
["hr", k],
|
|
1199
|
+
["main", k],
|
|
1200
|
+
["nav", k],
|
|
1201
|
+
["ol", k],
|
|
1202
|
+
["pre", k],
|
|
1203
|
+
["section", k],
|
|
1204
|
+
["table", k],
|
|
1205
|
+
["ul", k],
|
|
1206
|
+
["rt", Nu],
|
|
1207
|
+
["rp", Nu],
|
|
1208
|
+
["tbody", ku],
|
|
1209
|
+
["tfoot", ku]
|
|
1210
|
+
]), Ke = /* @__PURE__ */ new Set([
|
|
1143
1211
|
"area",
|
|
1144
1212
|
"base",
|
|
1145
1213
|
"basefont",
|
|
@@ -1159,7 +1227,7 @@ const W = /* @__PURE__ */ new Set([
|
|
|
1159
1227
|
"source",
|
|
1160
1228
|
"track",
|
|
1161
1229
|
"wbr"
|
|
1162
|
-
]),
|
|
1230
|
+
]), ju = /* @__PURE__ */ new Set(["math", "svg"]), Vu = /* @__PURE__ */ new Set([
|
|
1163
1231
|
"mi",
|
|
1164
1232
|
"mo",
|
|
1165
1233
|
"mn",
|
|
@@ -1169,30 +1237,30 @@ const W = /* @__PURE__ */ new Set([
|
|
|
1169
1237
|
"foreignobject",
|
|
1170
1238
|
"desc",
|
|
1171
1239
|
"title"
|
|
1172
|
-
]),
|
|
1173
|
-
class
|
|
1240
|
+
]), Ye = /\s|\//;
|
|
1241
|
+
class ut {
|
|
1174
1242
|
constructor(u, t = {}) {
|
|
1175
|
-
var a,
|
|
1176
|
-
this.options = t, this.startIndex = 0, this.endIndex = 0, this.openTagStart = 0, this.tagname = "", this.attribname = "", this.attribvalue = "", this.attribs = null, this.stack = [], this.buffers = [], this.bufferOffset = 0, this.writeIndex = 0, this.ended = !1, this.cbs = u ?? {}, this.htmlMode = !this.options.xmlMode, this.lowerCaseTagNames = (a = t.lowerCaseTags) !== null && a !== void 0 ? a : this.htmlMode, this.lowerCaseAttributeNames = (
|
|
1243
|
+
var a, r, n, i, s, o;
|
|
1244
|
+
this.options = t, this.startIndex = 0, this.endIndex = 0, this.openTagStart = 0, this.tagname = "", this.attribname = "", this.attribvalue = "", this.attribs = null, this.stack = [], this.buffers = [], this.bufferOffset = 0, this.writeIndex = 0, this.ended = !1, this.cbs = u ?? {}, this.htmlMode = !this.options.xmlMode, this.lowerCaseTagNames = (a = t.lowerCaseTags) !== null && a !== void 0 ? a : this.htmlMode, this.lowerCaseAttributeNames = (r = t.lowerCaseAttributeNames) !== null && r !== void 0 ? r : this.htmlMode, this.recognizeSelfClosing = (n = t.recognizeSelfClosing) !== null && n !== void 0 ? n : !this.htmlMode, this.tokenizer = new ((i = t.Tokenizer) !== null && i !== void 0 ? i : Qe)(this.options, this), this.foreignContext = [!this.htmlMode], (o = (s = this.cbs).onparserinit) === null || o === void 0 || o.call(s, this);
|
|
1177
1245
|
}
|
|
1178
1246
|
// Tokenizer event handlers
|
|
1179
1247
|
/** @internal */
|
|
1180
1248
|
ontext(u, t) {
|
|
1181
|
-
var a,
|
|
1182
|
-
const
|
|
1183
|
-
this.endIndex = t - 1, (
|
|
1249
|
+
var a, r;
|
|
1250
|
+
const n = this.getSlice(u, t);
|
|
1251
|
+
this.endIndex = t - 1, (r = (a = this.cbs).ontext) === null || r === void 0 || r.call(a, n), this.startIndex = t;
|
|
1184
1252
|
}
|
|
1185
1253
|
/** @internal */
|
|
1186
1254
|
ontextentity(u, t) {
|
|
1187
|
-
var a,
|
|
1188
|
-
this.endIndex = t - 1, (
|
|
1255
|
+
var a, r;
|
|
1256
|
+
this.endIndex = t - 1, (r = (a = this.cbs).ontext) === null || r === void 0 || r.call(a, Au(u)), this.startIndex = t;
|
|
1189
1257
|
}
|
|
1190
1258
|
/**
|
|
1191
1259
|
* Checks if the current tag is a void element. Override this if you want
|
|
1192
1260
|
* to specify your own additional void elements.
|
|
1193
1261
|
*/
|
|
1194
1262
|
isVoidElement(u) {
|
|
1195
|
-
return this.htmlMode &&
|
|
1263
|
+
return this.htmlMode && Ke.has(u);
|
|
1196
1264
|
}
|
|
1197
1265
|
/** @internal */
|
|
1198
1266
|
onopentagname(u, t) {
|
|
@@ -1201,15 +1269,15 @@ class Pe {
|
|
|
1201
1269
|
this.lowerCaseTagNames && (a = a.toLowerCase()), this.emitOpenTag(a);
|
|
1202
1270
|
}
|
|
1203
1271
|
emitOpenTag(u) {
|
|
1204
|
-
var t, a,
|
|
1272
|
+
var t, a, r, n;
|
|
1205
1273
|
this.openTagStart = this.startIndex, this.tagname = u;
|
|
1206
|
-
const
|
|
1207
|
-
if (
|
|
1208
|
-
for (; this.stack.length > 0 &&
|
|
1209
|
-
const
|
|
1210
|
-
(a = (t = this.cbs).onclosetag) === null || a === void 0 || a.call(t,
|
|
1274
|
+
const i = this.htmlMode && Ze.get(u);
|
|
1275
|
+
if (i)
|
|
1276
|
+
for (; this.stack.length > 0 && i.has(this.stack[0]); ) {
|
|
1277
|
+
const s = this.stack.shift();
|
|
1278
|
+
(a = (t = this.cbs).onclosetag) === null || a === void 0 || a.call(t, s, !0);
|
|
1211
1279
|
}
|
|
1212
|
-
this.isVoidElement(u) || (this.stack.unshift(u), this.htmlMode && (
|
|
1280
|
+
this.isVoidElement(u) || (this.stack.unshift(u), this.htmlMode && (ju.has(u) ? this.foreignContext.unshift(!0) : Vu.has(u) && this.foreignContext.unshift(!1))), (n = (r = this.cbs).onopentagname) === null || n === void 0 || n.call(r, u), this.cbs.onopentag && (this.attribs = {});
|
|
1213
1281
|
}
|
|
1214
1282
|
endOpenTag(u) {
|
|
1215
1283
|
var t, a;
|
|
@@ -1221,17 +1289,17 @@ class Pe {
|
|
|
1221
1289
|
}
|
|
1222
1290
|
/** @internal */
|
|
1223
1291
|
onclosetag(u, t) {
|
|
1224
|
-
var a,
|
|
1292
|
+
var a, r, n, i, s, o, c, d;
|
|
1225
1293
|
this.endIndex = t;
|
|
1226
1294
|
let l = this.getSlice(u, t);
|
|
1227
|
-
if (this.lowerCaseTagNames && (l = l.toLowerCase()), this.htmlMode && (
|
|
1228
|
-
this.htmlMode && l === "br" && ((
|
|
1295
|
+
if (this.lowerCaseTagNames && (l = l.toLowerCase()), this.htmlMode && (ju.has(l) || Vu.has(l)) && this.foreignContext.shift(), this.isVoidElement(l))
|
|
1296
|
+
this.htmlMode && l === "br" && ((i = (n = this.cbs).onopentagname) === null || i === void 0 || i.call(n, "br"), (o = (s = this.cbs).onopentag) === null || o === void 0 || o.call(s, "br", {}, !0), (d = (c = this.cbs).onclosetag) === null || d === void 0 || d.call(c, "br", !1));
|
|
1229
1297
|
else {
|
|
1230
|
-
const
|
|
1231
|
-
if (
|
|
1232
|
-
for (let
|
|
1233
|
-
const
|
|
1234
|
-
(
|
|
1298
|
+
const p = this.stack.indexOf(l);
|
|
1299
|
+
if (p !== -1)
|
|
1300
|
+
for (let b = 0; b <= p; b++) {
|
|
1301
|
+
const h = this.stack.shift();
|
|
1302
|
+
(r = (a = this.cbs).onclosetag) === null || r === void 0 || r.call(a, h, b !== p);
|
|
1235
1303
|
}
|
|
1236
1304
|
else this.htmlMode && l === "p" && (this.emitOpenTag("p"), this.closeCurrentTag(!0));
|
|
1237
1305
|
}
|
|
@@ -1243,8 +1311,8 @@ class Pe {
|
|
|
1243
1311
|
}
|
|
1244
1312
|
closeCurrentTag(u) {
|
|
1245
1313
|
var t, a;
|
|
1246
|
-
const
|
|
1247
|
-
this.endOpenTag(u), this.stack[0] ===
|
|
1314
|
+
const r = this.tagname;
|
|
1315
|
+
this.endOpenTag(u), this.stack[0] === r && ((a = (t = this.cbs).onclosetag) === null || a === void 0 || a.call(t, r, !u), this.stack.shift());
|
|
1248
1316
|
}
|
|
1249
1317
|
/** @internal */
|
|
1250
1318
|
onattribname(u, t) {
|
|
@@ -1258,15 +1326,15 @@ class Pe {
|
|
|
1258
1326
|
}
|
|
1259
1327
|
/** @internal */
|
|
1260
1328
|
onattribentity(u) {
|
|
1261
|
-
this.attribvalue +=
|
|
1329
|
+
this.attribvalue += Au(u);
|
|
1262
1330
|
}
|
|
1263
1331
|
/** @internal */
|
|
1264
1332
|
onattribend(u, t) {
|
|
1265
|
-
var a,
|
|
1266
|
-
this.endIndex = t, (
|
|
1333
|
+
var a, r;
|
|
1334
|
+
this.endIndex = t, (r = (a = this.cbs).onattribute) === null || r === void 0 || r.call(a, this.attribname, this.attribvalue, u === O.Double ? '"' : u === O.Single ? "'" : u === O.NoValue ? void 0 : null), this.attribs && !Object.prototype.hasOwnProperty.call(this.attribs, this.attribname) && (this.attribs[this.attribname] = this.attribvalue), this.attribvalue = "";
|
|
1267
1335
|
}
|
|
1268
1336
|
getInstructionName(u) {
|
|
1269
|
-
const t = u.search(
|
|
1337
|
+
const t = u.search(Ye);
|
|
1270
1338
|
let a = t < 0 ? u : u.substr(0, t);
|
|
1271
1339
|
return this.lowerCaseTagNames && (a = a.toLowerCase()), a;
|
|
1272
1340
|
}
|
|
@@ -1275,8 +1343,8 @@ class Pe {
|
|
|
1275
1343
|
this.endIndex = t;
|
|
1276
1344
|
const a = this.getSlice(u, t);
|
|
1277
1345
|
if (this.cbs.onprocessinginstruction) {
|
|
1278
|
-
const
|
|
1279
|
-
this.cbs.onprocessinginstruction(`!${
|
|
1346
|
+
const r = this.getInstructionName(a);
|
|
1347
|
+
this.cbs.onprocessinginstruction(`!${r}`, `!${a}`);
|
|
1280
1348
|
}
|
|
1281
1349
|
this.startIndex = t + 1;
|
|
1282
1350
|
}
|
|
@@ -1285,22 +1353,22 @@ class Pe {
|
|
|
1285
1353
|
this.endIndex = t;
|
|
1286
1354
|
const a = this.getSlice(u, t);
|
|
1287
1355
|
if (this.cbs.onprocessinginstruction) {
|
|
1288
|
-
const
|
|
1289
|
-
this.cbs.onprocessinginstruction(`?${
|
|
1356
|
+
const r = this.getInstructionName(a);
|
|
1357
|
+
this.cbs.onprocessinginstruction(`?${r}`, `?${a}`);
|
|
1290
1358
|
}
|
|
1291
1359
|
this.startIndex = t + 1;
|
|
1292
1360
|
}
|
|
1293
1361
|
/** @internal */
|
|
1294
1362
|
oncomment(u, t, a) {
|
|
1295
|
-
var
|
|
1296
|
-
this.endIndex = t, (
|
|
1363
|
+
var r, n, i, s;
|
|
1364
|
+
this.endIndex = t, (n = (r = this.cbs).oncomment) === null || n === void 0 || n.call(r, this.getSlice(u, t - a)), (s = (i = this.cbs).oncommentend) === null || s === void 0 || s.call(i), this.startIndex = t + 1;
|
|
1297
1365
|
}
|
|
1298
1366
|
/** @internal */
|
|
1299
1367
|
oncdata(u, t, a) {
|
|
1300
|
-
var
|
|
1368
|
+
var r, n, i, s, o, c, d, l, p, b;
|
|
1301
1369
|
this.endIndex = t;
|
|
1302
|
-
const
|
|
1303
|
-
!this.htmlMode || this.options.recognizeCDATA ? ((
|
|
1370
|
+
const h = this.getSlice(u, t - a);
|
|
1371
|
+
!this.htmlMode || this.options.recognizeCDATA ? ((n = (r = this.cbs).oncdatastart) === null || n === void 0 || n.call(r), (s = (i = this.cbs).ontext) === null || s === void 0 || s.call(i, h), (c = (o = this.cbs).oncdataend) === null || c === void 0 || c.call(o)) : ((l = (d = this.cbs).oncomment) === null || l === void 0 || l.call(d, `[CDATA[${h}]]`), (b = (p = this.cbs).oncommentend) === null || b === void 0 || b.call(p)), this.startIndex = t + 1;
|
|
1304
1372
|
}
|
|
1305
1373
|
/** @internal */
|
|
1306
1374
|
onend() {
|
|
@@ -1316,8 +1384,8 @@ class Pe {
|
|
|
1316
1384
|
* Resets the parser to a blank state, ready to parse a new HTML document
|
|
1317
1385
|
*/
|
|
1318
1386
|
reset() {
|
|
1319
|
-
var u, t, a,
|
|
1320
|
-
(t = (u = this.cbs).onreset) === null || t === void 0 || t.call(u), this.tokenizer.reset(), this.tagname = "", this.attribname = "", this.attribs = null, this.stack.length = 0, this.startIndex = 0, this.endIndex = 0, (
|
|
1387
|
+
var u, t, a, r;
|
|
1388
|
+
(t = (u = this.cbs).onreset) === null || t === void 0 || t.call(u), this.tokenizer.reset(), this.tagname = "", this.attribname = "", this.attribs = null, this.stack.length = 0, this.startIndex = 0, this.endIndex = 0, (r = (a = this.cbs).onparserinit) === null || r === void 0 || r.call(a, this), this.buffers.length = 0, this.foreignContext.length = 0, this.foreignContext.unshift(!this.htmlMode), this.bufferOffset = 0, this.writeIndex = 0, this.ended = !1;
|
|
1321
1389
|
}
|
|
1322
1390
|
/**
|
|
1323
1391
|
* Resets the parser, then parses a complete document and
|
|
@@ -1398,140 +1466,140 @@ class Pe {
|
|
|
1398
1466
|
this.end(u);
|
|
1399
1467
|
}
|
|
1400
1468
|
}
|
|
1401
|
-
function
|
|
1469
|
+
function qu(e, u = "web") {
|
|
1402
1470
|
const t = { name: "", children: [] }, a = [t];
|
|
1403
|
-
let
|
|
1404
|
-
const
|
|
1471
|
+
let r = "";
|
|
1472
|
+
const n = new ut(
|
|
1405
1473
|
{
|
|
1406
|
-
onopentag: (
|
|
1407
|
-
const
|
|
1408
|
-
|
|
1474
|
+
onopentag: (i, s, o) => {
|
|
1475
|
+
const c = a[a.length - 1];
|
|
1476
|
+
r.trim() && (Array.isArray(c.children) ? c.children.push({
|
|
1409
1477
|
name: "span",
|
|
1410
|
-
children:
|
|
1411
|
-
}) :
|
|
1412
|
-
const
|
|
1413
|
-
(
|
|
1414
|
-
let [
|
|
1415
|
-
return
|
|
1478
|
+
children: r.trim()
|
|
1479
|
+
}) : c.children = r.trim(), r = "");
|
|
1480
|
+
const d = Object.entries(s || {}).reduce(
|
|
1481
|
+
(p, b) => {
|
|
1482
|
+
let [h = "", S = ""] = b;
|
|
1483
|
+
return h && (p[h] = S), p;
|
|
1416
1484
|
},
|
|
1417
1485
|
{}
|
|
1418
1486
|
);
|
|
1419
|
-
|
|
1487
|
+
d.style && (d.style = zu(d.style));
|
|
1420
1488
|
const l = {
|
|
1421
|
-
name:
|
|
1422
|
-
props:
|
|
1489
|
+
name: Xu(i, u),
|
|
1490
|
+
props: d
|
|
1423
1491
|
};
|
|
1424
|
-
Array.isArray(
|
|
1492
|
+
Array.isArray(c.children) ? c.children.push(l) : c.children ? c.children = [
|
|
1425
1493
|
{
|
|
1426
1494
|
name: "span",
|
|
1427
|
-
children:
|
|
1495
|
+
children: c.children
|
|
1428
1496
|
},
|
|
1429
1497
|
l
|
|
1430
|
-
] :
|
|
1498
|
+
] : c.children = [l], o || a.push(l);
|
|
1431
1499
|
},
|
|
1432
|
-
ontext: (
|
|
1433
|
-
const
|
|
1434
|
-
|
|
1500
|
+
ontext: (i) => {
|
|
1501
|
+
const s = i.trim();
|
|
1502
|
+
s && s !== '"' && (r += s);
|
|
1435
1503
|
},
|
|
1436
1504
|
onclosetag: () => {
|
|
1437
|
-
const
|
|
1438
|
-
|
|
1505
|
+
const i = a.pop();
|
|
1506
|
+
r.trim() && (Array.isArray(i?.children) ? i.children.push({
|
|
1439
1507
|
name: "span",
|
|
1440
|
-
children:
|
|
1441
|
-
}) :
|
|
1508
|
+
children: r.trim()
|
|
1509
|
+
}) : i && (i.children = r.trim()), r = "");
|
|
1442
1510
|
}
|
|
1443
1511
|
},
|
|
1444
1512
|
{ decodeEntities: !0 }
|
|
1445
1513
|
);
|
|
1446
|
-
return
|
|
1514
|
+
return n.write(e.replace(/\\"/g, '"')), n.end(), t.children || [];
|
|
1447
1515
|
}
|
|
1448
|
-
function
|
|
1516
|
+
function et(e, u) {
|
|
1449
1517
|
const a = {
|
|
1450
|
-
imports:
|
|
1518
|
+
imports: tt(e),
|
|
1451
1519
|
emits: [],
|
|
1452
1520
|
errors: []
|
|
1453
|
-
},
|
|
1454
|
-
return
|
|
1455
|
-
ExportDefaultDeclaration(
|
|
1456
|
-
const
|
|
1457
|
-
if (
|
|
1458
|
-
const
|
|
1459
|
-
if (
|
|
1460
|
-
const o =
|
|
1521
|
+
}, r = B(e);
|
|
1522
|
+
return J(r, {
|
|
1523
|
+
ExportDefaultDeclaration(n) {
|
|
1524
|
+
const i = n.node.declaration;
|
|
1525
|
+
if (i.type !== "CallExpression") return;
|
|
1526
|
+
const s = i.arguments[0];
|
|
1527
|
+
if (s?.type !== "ObjectExpression") return;
|
|
1528
|
+
const o = s.properties.filter(
|
|
1461
1529
|
(l) => l.type === "ObjectProperty"
|
|
1462
|
-
),
|
|
1530
|
+
), c = s.properties.filter(
|
|
1463
1531
|
(l) => l.type == "ObjectMethod"
|
|
1464
|
-
),
|
|
1532
|
+
), d = o.find(
|
|
1465
1533
|
(l) => l.key.name === "computed"
|
|
1466
1534
|
);
|
|
1467
|
-
|
|
1535
|
+
d && (a.computed = Zu(d.value), a.watchers = ct(d.value));
|
|
1468
1536
|
for (const l of o)
|
|
1469
1537
|
switch (l.key.name) {
|
|
1470
1538
|
case "name":
|
|
1471
1539
|
a.name = l.value.value;
|
|
1472
1540
|
break;
|
|
1473
1541
|
case "methods":
|
|
1474
|
-
a.handlers =
|
|
1542
|
+
a.handlers = st(l.value), a.methods = it(l.value), a.dataSources = nt(
|
|
1475
1543
|
l.value,
|
|
1476
1544
|
u
|
|
1477
1545
|
);
|
|
1478
1546
|
break;
|
|
1479
1547
|
case "watch":
|
|
1480
|
-
a.watch =
|
|
1548
|
+
a.watch = ot(
|
|
1481
1549
|
l.value,
|
|
1482
1550
|
a.watchers
|
|
1483
1551
|
);
|
|
1484
1552
|
break;
|
|
1485
1553
|
case "props":
|
|
1486
|
-
a.props =
|
|
1554
|
+
a.props = ft(l.value);
|
|
1487
1555
|
break;
|
|
1488
1556
|
case "inject":
|
|
1489
|
-
a.inject =
|
|
1557
|
+
a.inject = pt(l.value);
|
|
1490
1558
|
break;
|
|
1491
1559
|
case "expose":
|
|
1492
|
-
a.expose =
|
|
1560
|
+
a.expose = ht(l.value);
|
|
1493
1561
|
break;
|
|
1494
1562
|
case "directives":
|
|
1495
|
-
a.directives =
|
|
1563
|
+
a.directives = xt(l.value);
|
|
1496
1564
|
break;
|
|
1497
1565
|
}
|
|
1498
|
-
for (const l of
|
|
1566
|
+
for (const l of c)
|
|
1499
1567
|
switch (l.key.name) {
|
|
1500
1568
|
case "setup":
|
|
1501
|
-
a.state =
|
|
1569
|
+
a.state = rt(l.body);
|
|
1502
1570
|
break;
|
|
1503
1571
|
}
|
|
1504
|
-
a.lifeCycles =
|
|
1572
|
+
a.lifeCycles = dt(c);
|
|
1505
1573
|
},
|
|
1506
|
-
CallExpression(
|
|
1507
|
-
const
|
|
1508
|
-
if (
|
|
1509
|
-
for (let
|
|
1510
|
-
a.emits?.find((
|
|
1574
|
+
CallExpression(n) {
|
|
1575
|
+
const i = bt(n.node);
|
|
1576
|
+
if (i.length)
|
|
1577
|
+
for (let s of i)
|
|
1578
|
+
a.emits?.find((c) => c.name === s.name) || a.emits?.push(s);
|
|
1511
1579
|
}
|
|
1512
1580
|
}), a;
|
|
1513
1581
|
}
|
|
1514
|
-
function
|
|
1515
|
-
const u = /import\s+{(.+?)}\s+from\s+['"](.+?)['"]/g, t = /import\s+(.+?)\s+from\s+['"](.+?)['"]/g, a = /^{(.+?)}$/,
|
|
1516
|
-
let
|
|
1517
|
-
const
|
|
1518
|
-
for (; (
|
|
1519
|
-
const
|
|
1520
|
-
|
|
1521
|
-
from:
|
|
1522
|
-
imports:
|
|
1582
|
+
function tt(e) {
|
|
1583
|
+
const u = /import\s+{(.+?)}\s+from\s+['"](.+?)['"]/g, t = /import\s+(.+?)\s+from\s+['"](.+?)['"]/g, a = /^{(.+?)}$/, r = [];
|
|
1584
|
+
let n;
|
|
1585
|
+
const i = e.replace(/\n/g, " ");
|
|
1586
|
+
for (; (n = u.exec(i)) !== null; ) {
|
|
1587
|
+
const s = n[2] === "@element-plus/icons-vue" ? "@vtj/icons" : n[2];
|
|
1588
|
+
r.push({
|
|
1589
|
+
from: s,
|
|
1590
|
+
imports: n[1].split(",").map((o) => o.trim())
|
|
1523
1591
|
});
|
|
1524
1592
|
}
|
|
1525
|
-
for (; (
|
|
1526
|
-
const
|
|
1527
|
-
|
|
1593
|
+
for (; (n = t.exec(i)) !== null; ) {
|
|
1594
|
+
const s = n[1], o = n[2];
|
|
1595
|
+
s && !a.test(s) && r.push({
|
|
1528
1596
|
from: o,
|
|
1529
|
-
imports:
|
|
1597
|
+
imports: s
|
|
1530
1598
|
});
|
|
1531
1599
|
}
|
|
1532
|
-
return
|
|
1600
|
+
return r;
|
|
1533
1601
|
}
|
|
1534
|
-
function
|
|
1602
|
+
function at(e) {
|
|
1535
1603
|
for (const u of e.body)
|
|
1536
1604
|
if (u.type === "VariableDeclaration" && u.kind == "const") {
|
|
1537
1605
|
const { id: t, init: a } = u.declarations[0];
|
|
@@ -1540,617 +1608,1139 @@ function Me(e) {
|
|
|
1540
1608
|
}
|
|
1541
1609
|
return null;
|
|
1542
1610
|
}
|
|
1543
|
-
function
|
|
1544
|
-
const u =
|
|
1611
|
+
function rt(e) {
|
|
1612
|
+
const u = at(e);
|
|
1545
1613
|
if (!u) return {};
|
|
1546
1614
|
const t = {};
|
|
1547
1615
|
for (const a of u.properties)
|
|
1548
1616
|
if (a.type === "ObjectProperty") {
|
|
1549
|
-
const { key:
|
|
1550
|
-
if (
|
|
1551
|
-
const
|
|
1552
|
-
t[
|
|
1617
|
+
const { key: r, value: n } = a;
|
|
1618
|
+
if (r.type === "Identifier") {
|
|
1619
|
+
const i = A(n);
|
|
1620
|
+
t[r.name] = T(i);
|
|
1553
1621
|
}
|
|
1554
1622
|
} else if (a.type === "ObjectMethod") {
|
|
1555
|
-
const { key:
|
|
1556
|
-
if (
|
|
1557
|
-
const
|
|
1558
|
-
t[
|
|
1623
|
+
const { key: r, params: n, body: i } = a;
|
|
1624
|
+
if (r.type === "Identifier") {
|
|
1625
|
+
const s = A(i), c = `(${n.map((d) => d.name || "none").join(",")}) => ${s}`;
|
|
1626
|
+
t[r.name] = T(c);
|
|
1559
1627
|
}
|
|
1560
1628
|
}
|
|
1561
1629
|
return t;
|
|
1562
1630
|
}
|
|
1563
|
-
function
|
|
1564
|
-
const { key: u, async: t, params: a, body:
|
|
1631
|
+
function X(e) {
|
|
1632
|
+
const { key: u, async: t, params: a, body: r } = e, n = a?.map((i) => i.type === "ObjectPattern" ? `{${i.properties.map((o) => o.key?.name || o.name).join(",")}}` : i.type === "AssignmentPattern" ? i.left.name + "=" + (i.right?.extra?.raw || "null") : i.name).join(", ");
|
|
1565
1633
|
if (u.type === "Identifier") {
|
|
1566
|
-
const
|
|
1567
|
-
let
|
|
1568
|
-
|
|
1634
|
+
const i = u.name;
|
|
1635
|
+
let s = "{}";
|
|
1636
|
+
r && (s = A(r) || "{}");
|
|
1569
1637
|
const o = e.value;
|
|
1570
1638
|
if (o && o.type === "CallExpression") {
|
|
1571
|
-
let
|
|
1572
|
-
|
|
1639
|
+
let b = A(o) || "";
|
|
1640
|
+
b = b.replace("function () {", "() => {"), s = `{ return (${b})}`;
|
|
1573
1641
|
}
|
|
1574
|
-
const
|
|
1642
|
+
const d = `${t ? "async " : ""}(${n}) => ${s}`, l = i.startsWith("watcher_");
|
|
1575
1643
|
return {
|
|
1576
|
-
id: l ?
|
|
1577
|
-
name:
|
|
1644
|
+
id: l ? i.replace("watcher_", "") : "",
|
|
1645
|
+
name: i,
|
|
1578
1646
|
watcher: l,
|
|
1579
|
-
exp:
|
|
1647
|
+
exp: C(d)
|
|
1580
1648
|
};
|
|
1581
1649
|
}
|
|
1582
1650
|
}
|
|
1583
|
-
function
|
|
1651
|
+
function Zu(e) {
|
|
1584
1652
|
if (!e) return {};
|
|
1585
1653
|
const u = {};
|
|
1586
1654
|
for (const t of e.properties) {
|
|
1587
|
-
const a =
|
|
1655
|
+
const a = X(t);
|
|
1588
1656
|
a && !a.watcher && !a.exp.value.includes("this.provider.createMock") && !a.exp.value.includes("this.provider.apis") && (u[a.name] = a.exp);
|
|
1589
1657
|
}
|
|
1590
1658
|
return u;
|
|
1591
1659
|
}
|
|
1592
|
-
function
|
|
1660
|
+
function nt(e, u) {
|
|
1593
1661
|
if (!e) return {};
|
|
1594
|
-
const t = {}, a = /apis\[
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1662
|
+
const t = {}, a = /apis\['([\w]*)'\]/, r = (n) => {
|
|
1663
|
+
const i = n.indexOf(".then(");
|
|
1664
|
+
if (i === -1) return null;
|
|
1665
|
+
let s = 1, o = i + 6;
|
|
1666
|
+
for (; o < n.length && s > 0; ) {
|
|
1667
|
+
const c = n[o];
|
|
1668
|
+
c === "(" ? s++ : c === ")" && s--, o++;
|
|
1669
|
+
}
|
|
1670
|
+
return n.substring(i + 6, o - 1).trim();
|
|
1671
|
+
};
|
|
1672
|
+
for (const n of e.properties) {
|
|
1673
|
+
const i = X(n), s = n.body.body?.[0], o = (s?.leadingComments?.[0].value || "").trim(), c = Qu(o);
|
|
1674
|
+
if (i && i.exp.value.includes("this.provider.apis")) {
|
|
1675
|
+
const l = (i.exp.value.match(a) || [])[1];
|
|
1599
1676
|
if (!l) continue;
|
|
1600
|
-
const
|
|
1601
|
-
if (!
|
|
1602
|
-
const
|
|
1603
|
-
t[
|
|
1677
|
+
const p = mt(u, l);
|
|
1678
|
+
if (!p) continue;
|
|
1679
|
+
const b = r(i.exp.value);
|
|
1680
|
+
t[i.name] = {
|
|
1604
1681
|
ref: l,
|
|
1605
|
-
name:
|
|
1606
|
-
test:
|
|
1682
|
+
name: i.name,
|
|
1683
|
+
test: c?.test || {
|
|
1607
1684
|
type: "JSFunction",
|
|
1608
1685
|
value: `() => this.runApi({
|
|
1609
1686
|
/* 在这里可输入接口参数 */
|
|
1610
1687
|
})`
|
|
1611
1688
|
},
|
|
1612
1689
|
type: "api",
|
|
1613
|
-
label:
|
|
1690
|
+
label: p.label,
|
|
1614
1691
|
transform: {
|
|
1615
1692
|
type: "JSFunction",
|
|
1616
|
-
value:
|
|
1693
|
+
value: b || `(res) => {
|
|
1617
1694
|
return res;
|
|
1618
1695
|
}`
|
|
1619
1696
|
},
|
|
1620
|
-
mockTemplate:
|
|
1697
|
+
mockTemplate: p.mockTemplate
|
|
1621
1698
|
};
|
|
1622
1699
|
}
|
|
1623
|
-
if (
|
|
1624
|
-
const
|
|
1625
|
-
t[
|
|
1700
|
+
if (i && i.exp.value.includes("this.provider.createMock")) {
|
|
1701
|
+
const d = s?.declarations?.[0]?.init?.arguments?.[0], l = r(i.exp.value);
|
|
1702
|
+
t[i.name] = {
|
|
1626
1703
|
ref: "",
|
|
1627
|
-
name:
|
|
1628
|
-
test:
|
|
1704
|
+
name: i.name,
|
|
1705
|
+
test: c?.test || {
|
|
1629
1706
|
type: "JSFunction",
|
|
1630
1707
|
value: `() => this.runApi({
|
|
1631
1708
|
/* 在这里可输入接口参数 */
|
|
1632
1709
|
})`
|
|
1633
1710
|
},
|
|
1634
1711
|
type: "mock",
|
|
1635
|
-
label:
|
|
1636
|
-
transform:
|
|
1712
|
+
label: c?.label || "",
|
|
1713
|
+
transform: c?.transform || {
|
|
1637
1714
|
type: "JSFunction",
|
|
1638
1715
|
value: l || `(res) => {
|
|
1639
1716
|
return res;
|
|
1640
1717
|
}`
|
|
1641
1718
|
},
|
|
1642
|
-
mockTemplate:
|
|
1719
|
+
mockTemplate: c?.mockTemplate || {
|
|
1643
1720
|
type: "JSFunction",
|
|
1644
|
-
value:
|
|
1721
|
+
value: d ? A(d) : ""
|
|
1645
1722
|
}
|
|
1646
1723
|
};
|
|
1647
1724
|
}
|
|
1648
1725
|
}
|
|
1649
1726
|
return t;
|
|
1650
1727
|
}
|
|
1651
|
-
function
|
|
1652
|
-
const u =
|
|
1653
|
-
for (const
|
|
1654
|
-
t.test(
|
|
1728
|
+
function it(e) {
|
|
1729
|
+
const u = Zu(e), t = /\_([\w]{5,})$/, a = {};
|
|
1730
|
+
for (const r of Object.keys(u))
|
|
1731
|
+
t.test(r) || (a[r] = u[r]);
|
|
1655
1732
|
return a;
|
|
1656
1733
|
}
|
|
1657
|
-
function
|
|
1734
|
+
function st(e) {
|
|
1658
1735
|
if (!e) return {};
|
|
1659
1736
|
const u = {}, t = /\_([\w]{5,})$/;
|
|
1660
1737
|
for (const a of e.properties) {
|
|
1661
|
-
const
|
|
1662
|
-
if (t.test(
|
|
1738
|
+
const r = a.key.name;
|
|
1739
|
+
if (t.test(r))
|
|
1663
1740
|
try {
|
|
1664
1741
|
if (a.body.body[0]?.argument) {
|
|
1665
|
-
const
|
|
1742
|
+
const n = A(
|
|
1666
1743
|
a.body.body[0].argument.callee.object
|
|
1667
1744
|
);
|
|
1668
|
-
u[
|
|
1745
|
+
u[r] = C(n);
|
|
1669
1746
|
} else
|
|
1670
|
-
u[
|
|
1671
|
-
} catch (
|
|
1672
|
-
console.warn(
|
|
1747
|
+
u[r] = X(a)?.exp;
|
|
1748
|
+
} catch (n) {
|
|
1749
|
+
console.warn(n);
|
|
1673
1750
|
}
|
|
1674
1751
|
}
|
|
1675
1752
|
return u;
|
|
1676
1753
|
}
|
|
1677
|
-
function
|
|
1754
|
+
function ct(e) {
|
|
1678
1755
|
if (!e) return {};
|
|
1679
1756
|
const u = {};
|
|
1680
1757
|
for (const t of e.properties) {
|
|
1681
|
-
const a =
|
|
1758
|
+
const a = X(t);
|
|
1682
1759
|
a && a.watcher && (u[a.name] = a.exp);
|
|
1683
1760
|
}
|
|
1684
1761
|
return u;
|
|
1685
1762
|
}
|
|
1686
|
-
function
|
|
1687
|
-
return !!
|
|
1763
|
+
function Y(e, u) {
|
|
1764
|
+
return !!Ku(e, u);
|
|
1688
1765
|
}
|
|
1689
|
-
function
|
|
1766
|
+
function Ku(e, u) {
|
|
1690
1767
|
return e?.find(
|
|
1691
1768
|
(a) => a.key?.name === u
|
|
1692
1769
|
)?.value?.value;
|
|
1693
1770
|
}
|
|
1694
|
-
function
|
|
1771
|
+
function Du(e, u) {
|
|
1695
1772
|
const t = e?.find(
|
|
1696
1773
|
(a) => a.key?.name === u
|
|
1697
1774
|
);
|
|
1698
1775
|
if (t)
|
|
1699
|
-
return
|
|
1776
|
+
return X(t)?.exp;
|
|
1700
1777
|
}
|
|
1701
|
-
function
|
|
1778
|
+
function ot(e, u = {}) {
|
|
1702
1779
|
const t = [];
|
|
1703
1780
|
for (const a of e.properties) {
|
|
1704
|
-
const { key:
|
|
1705
|
-
if (u[
|
|
1706
|
-
const
|
|
1781
|
+
const { key: r, value: n } = a, i = r.value || r.name || "";
|
|
1782
|
+
if (u[i]) {
|
|
1783
|
+
const s = n.properties;
|
|
1707
1784
|
t.push({
|
|
1708
|
-
id:
|
|
1709
|
-
source: u[
|
|
1710
|
-
deep:
|
|
1711
|
-
immediate:
|
|
1712
|
-
handler:
|
|
1785
|
+
id: i.replace("watcher_", ""),
|
|
1786
|
+
source: u[i],
|
|
1787
|
+
deep: Y(s, "deep"),
|
|
1788
|
+
immediate: Y(s, "immediate"),
|
|
1789
|
+
handler: Du(s, "handler")
|
|
1713
1790
|
});
|
|
1714
1791
|
} else if (a.type === "ObjectMethod" && t.push({
|
|
1715
|
-
id:
|
|
1792
|
+
id: nu(),
|
|
1716
1793
|
source: {
|
|
1717
1794
|
type: "JSFunction",
|
|
1718
|
-
value: `() => { return this.${
|
|
1795
|
+
value: `() => { return this.${i}; }`
|
|
1719
1796
|
},
|
|
1720
1797
|
deep: !1,
|
|
1721
1798
|
immediate: !1,
|
|
1722
|
-
handler:
|
|
1799
|
+
handler: X(a)?.exp
|
|
1723
1800
|
}), a.type === "ObjectProperty") {
|
|
1724
|
-
const
|
|
1801
|
+
const s = n.properties;
|
|
1725
1802
|
t.push({
|
|
1726
|
-
id:
|
|
1803
|
+
id: nu(),
|
|
1727
1804
|
source: {
|
|
1728
1805
|
type: "JSFunction",
|
|
1729
|
-
value: `() => { return this.${
|
|
1806
|
+
value: `() => { return this.${i}; }`
|
|
1730
1807
|
},
|
|
1731
|
-
deep:
|
|
1732
|
-
immediate:
|
|
1733
|
-
handler:
|
|
1808
|
+
deep: Y(s, "deep"),
|
|
1809
|
+
immediate: Y(s, "immediate"),
|
|
1810
|
+
handler: Du(s, "handler")
|
|
1734
1811
|
});
|
|
1735
1812
|
}
|
|
1736
1813
|
}
|
|
1737
1814
|
return t;
|
|
1738
1815
|
}
|
|
1739
|
-
function
|
|
1816
|
+
function dt(e) {
|
|
1740
1817
|
const u = {};
|
|
1741
1818
|
for (const t of e) {
|
|
1742
1819
|
const a = t.key.name;
|
|
1743
|
-
if (
|
|
1744
|
-
const
|
|
1745
|
-
|
|
1820
|
+
if (Re.includes(a)) {
|
|
1821
|
+
const r = X(t);
|
|
1822
|
+
r && (u[r.name] = r.exp);
|
|
1746
1823
|
}
|
|
1747
1824
|
}
|
|
1748
1825
|
return u;
|
|
1749
1826
|
}
|
|
1750
|
-
function
|
|
1827
|
+
function lt(e) {
|
|
1751
1828
|
const u = e?.find(
|
|
1752
1829
|
(t) => t.key?.name === "type"
|
|
1753
1830
|
);
|
|
1754
1831
|
if (u)
|
|
1755
1832
|
return u.value.type === "ArrayExpression" ? u.value.elements.map((t) => t.name) : u.value.name;
|
|
1756
1833
|
}
|
|
1757
|
-
function
|
|
1834
|
+
function Yu(e) {
|
|
1758
1835
|
const u = e?.find(
|
|
1759
1836
|
(t) => t.key?.name === "default"
|
|
1760
1837
|
);
|
|
1761
1838
|
if (u)
|
|
1762
|
-
return
|
|
1839
|
+
return T(A(u.value));
|
|
1763
1840
|
}
|
|
1764
|
-
function
|
|
1841
|
+
function ft(e) {
|
|
1765
1842
|
if (!e) return [];
|
|
1766
1843
|
let u = [];
|
|
1767
1844
|
return e.type === "ArrayExpression" ? u = e.elements.map((t) => t.value) : e.type === "ObjectExpression" && (u = e.properties?.map((t) => {
|
|
1768
|
-
const { key: a, value:
|
|
1845
|
+
const { key: a, value: r } = t, n = r.properties || [];
|
|
1769
1846
|
return {
|
|
1770
1847
|
name: a.name,
|
|
1771
|
-
required:
|
|
1772
|
-
type:
|
|
1773
|
-
default:
|
|
1848
|
+
required: Y(n, "required"),
|
|
1849
|
+
type: lt(n),
|
|
1850
|
+
default: Yu(n)
|
|
1774
1851
|
};
|
|
1775
1852
|
})), u;
|
|
1776
1853
|
}
|
|
1777
|
-
function
|
|
1854
|
+
function bt(e) {
|
|
1778
1855
|
const u = [];
|
|
1779
1856
|
if (e.callee.type === "MemberExpression" && e.callee.property?.name === "$emit") {
|
|
1780
|
-
const [a, ...
|
|
1781
|
-
(
|
|
1857
|
+
const [a, ...r] = (e.arguments || []).map(
|
|
1858
|
+
(n) => n.value || n.name
|
|
1782
1859
|
);
|
|
1783
1860
|
a && u.push({
|
|
1784
1861
|
name: a,
|
|
1785
|
-
params:
|
|
1862
|
+
params: r.filter((n) => !!n)
|
|
1786
1863
|
});
|
|
1787
1864
|
}
|
|
1788
1865
|
return u;
|
|
1789
1866
|
}
|
|
1790
|
-
function
|
|
1867
|
+
function pt(e) {
|
|
1791
1868
|
let u = [];
|
|
1792
1869
|
return e.type === "ObjectExpression" && (u = e.properties?.map((t) => {
|
|
1793
|
-
const { key: a, value:
|
|
1870
|
+
const { key: a, value: r } = t, n = r.properties, i = a.name, s = Ku(n, "from"), o = Yu(n);
|
|
1794
1871
|
return {
|
|
1795
|
-
name:
|
|
1796
|
-
from:
|
|
1872
|
+
name: i,
|
|
1873
|
+
from: s || i,
|
|
1797
1874
|
default: o
|
|
1798
1875
|
};
|
|
1799
1876
|
})), u;
|
|
1800
1877
|
}
|
|
1801
|
-
function
|
|
1878
|
+
function ht(e) {
|
|
1802
1879
|
return e && e.elements ? e.elements.map((u) => u?.type === "StringLiteral" ? u.value : "").filter((u) => !!u) : [];
|
|
1803
1880
|
}
|
|
1804
|
-
function
|
|
1881
|
+
function mt(e, u) {
|
|
1805
1882
|
return (e.apis || []).find((t) => t.id === u || t.name === u);
|
|
1806
1883
|
}
|
|
1807
|
-
function
|
|
1884
|
+
function xt(e) {
|
|
1808
1885
|
if (!e?.properties) return {};
|
|
1809
1886
|
const u = {};
|
|
1810
1887
|
for (const t of e.properties) {
|
|
1811
|
-
const { key: a, value:
|
|
1812
|
-
a?.name &&
|
|
1888
|
+
const { key: a, value: r } = t;
|
|
1889
|
+
a?.name && r?.name && (u[a.name] = u[a.name.toLowerCase()] = {
|
|
1813
1890
|
type: "JSExpression",
|
|
1814
|
-
value:
|
|
1891
|
+
value: r.name
|
|
1815
1892
|
});
|
|
1816
1893
|
}
|
|
1817
1894
|
return u;
|
|
1818
1895
|
}
|
|
1819
|
-
let
|
|
1820
|
-
function
|
|
1821
|
-
|
|
1822
|
-
const
|
|
1896
|
+
let hu = [], su = {}, ue = {}, ee = {}, te = {}, cu = "web", ae = [];
|
|
1897
|
+
function re(e, u, t = "", a) {
|
|
1898
|
+
hu = [], su = {}, ue = a?.handlers || {}, te = a?.styles || {}, cu = a?.platform || "web", ae = a?.imports || [], ee = a?.directives || {};
|
|
1899
|
+
const n = Gu({
|
|
1823
1900
|
id: e,
|
|
1824
1901
|
filename: u,
|
|
1825
1902
|
source: t,
|
|
1826
1903
|
isProd: !0,
|
|
1827
1904
|
slotted: !0
|
|
1828
|
-
}).ast?.children || [],
|
|
1829
|
-
for (const
|
|
1830
|
-
const o =
|
|
1831
|
-
Array.isArray(o) ?
|
|
1905
|
+
}).ast?.children || [], i = [];
|
|
1906
|
+
for (const s of n) {
|
|
1907
|
+
const o = Q(s);
|
|
1908
|
+
Array.isArray(o) ? i.push(...o) : i.push(o);
|
|
1832
1909
|
}
|
|
1833
1910
|
return {
|
|
1834
|
-
nodes:
|
|
1835
|
-
slots:
|
|
1836
|
-
context:
|
|
1911
|
+
nodes: i.filter((s) => !!s),
|
|
1912
|
+
slots: hu,
|
|
1913
|
+
context: su
|
|
1837
1914
|
};
|
|
1838
1915
|
}
|
|
1839
|
-
function
|
|
1916
|
+
function gt(e) {
|
|
1840
1917
|
if (e.name === "slot") {
|
|
1841
1918
|
let u = "default";
|
|
1842
1919
|
const t = [];
|
|
1843
|
-
for (const [a,
|
|
1844
|
-
a === "name" ? u =
|
|
1845
|
-
|
|
1920
|
+
for (const [a, r] of Object.entries(e.props || {}))
|
|
1921
|
+
a === "name" ? u = r : t.push(a);
|
|
1922
|
+
hu.push({
|
|
1846
1923
|
name: u,
|
|
1847
1924
|
params: t
|
|
1848
1925
|
});
|
|
1849
1926
|
}
|
|
1850
1927
|
}
|
|
1851
|
-
function
|
|
1928
|
+
function yt(e) {
|
|
1852
1929
|
const u = {};
|
|
1853
1930
|
for (const t of e) {
|
|
1854
|
-
if (t.type ===
|
|
1931
|
+
if (t.type === v.ATTRIBUTE)
|
|
1855
1932
|
if (t.name === "class") {
|
|
1856
|
-
const a = t.value?.content || "",
|
|
1857
|
-
|
|
1933
|
+
const a = t.value?.content || "", r = /[\w]+_[\w]{5,}/, n = a.match(r)?.[0] || "", i = a.split(" ").filter((o) => o !== n), s = te[`.${n}`];
|
|
1934
|
+
s && (u.style = s), i.length && (u.class = i.join(" "));
|
|
1858
1935
|
} else if (t.name === "style") {
|
|
1859
1936
|
const a = t.value?.content || "";
|
|
1860
|
-
a && (u.style =
|
|
1937
|
+
a && (u.style = zu(a));
|
|
1861
1938
|
} else
|
|
1862
1939
|
u[t.name] = t.value?.content || "";
|
|
1863
|
-
if (t.type ===
|
|
1940
|
+
if (t.type === v.DIRECTIVE && t.name === "bind" && (t.exp?.type === v.SIMPLE_EXPRESSION && t.arg?.type === v.SIMPLE_EXPRESSION && (u[t.arg.content] = T(`(${t.exp.content})`)), t.exp?.type === v.COMPOUND_EXPRESSION && t.arg?.type === v.SIMPLE_EXPRESSION))
|
|
1864
1941
|
if (t.arg.content === "class" && u.class) {
|
|
1865
|
-
const a = t.exp.ast.type,
|
|
1942
|
+
const a = t.exp.ast.type, r = Me(
|
|
1866
1943
|
u.class,
|
|
1867
1944
|
t.exp.loc.source,
|
|
1868
1945
|
a
|
|
1869
1946
|
);
|
|
1870
|
-
|
|
1947
|
+
r && (u[t.arg.content] = T(r));
|
|
1871
1948
|
} else
|
|
1872
|
-
u[t.arg.content] =
|
|
1949
|
+
u[t.arg.content] = T(
|
|
1873
1950
|
`(${t.exp.loc.source})`
|
|
1874
1951
|
);
|
|
1875
1952
|
}
|
|
1876
1953
|
return u;
|
|
1877
1954
|
}
|
|
1878
|
-
function
|
|
1955
|
+
function St(e = {}) {
|
|
1879
1956
|
const u = {};
|
|
1880
1957
|
for (const [t, a] of Object.entries(e))
|
|
1881
1958
|
u[t === "tap" ? "click" : t] = a;
|
|
1882
1959
|
return u;
|
|
1883
1960
|
}
|
|
1884
|
-
function
|
|
1961
|
+
function vt(e, u = {}) {
|
|
1885
1962
|
const t = {};
|
|
1886
1963
|
for (const a of e)
|
|
1887
|
-
if (a.type ===
|
|
1888
|
-
const
|
|
1889
|
-
(
|
|
1964
|
+
if (a.type === v.DIRECTIVE && a.name === "on" && a.arg?.type === v.SIMPLE_EXPRESSION) {
|
|
1965
|
+
const r = a.modifiers.reduce(
|
|
1966
|
+
(c, d) => (d.content && (c[d.content] = !0), c),
|
|
1890
1967
|
{}
|
|
1891
1968
|
);
|
|
1892
|
-
let
|
|
1893
|
-
|
|
1894
|
-
const
|
|
1895
|
-
if (
|
|
1969
|
+
let n = a.exp?.loc.source || "";
|
|
1970
|
+
n || (n = "() => {}");
|
|
1971
|
+
const i = new RegExp(`${a.arg.content}_[\\w]{5,}`), s = n.match(i)?.[0] || "", o = u[s];
|
|
1972
|
+
if (s && o)
|
|
1896
1973
|
t[a.arg.content] = {
|
|
1897
1974
|
name: a.arg.content,
|
|
1898
1975
|
handler: o,
|
|
1899
|
-
modifiers:
|
|
1976
|
+
modifiers: r
|
|
1900
1977
|
};
|
|
1901
1978
|
else {
|
|
1902
|
-
const
|
|
1979
|
+
const c = a.exp?.ast?.type === "CallExpression";
|
|
1903
1980
|
t[a.arg.content] = {
|
|
1904
1981
|
name: a.arg.content,
|
|
1905
|
-
handler:
|
|
1906
|
-
modifiers:
|
|
1982
|
+
handler: c ? T(n) : C(n),
|
|
1983
|
+
modifiers: r
|
|
1907
1984
|
};
|
|
1908
1985
|
}
|
|
1909
1986
|
}
|
|
1910
|
-
return
|
|
1987
|
+
return St(t);
|
|
1911
1988
|
}
|
|
1912
|
-
function
|
|
1989
|
+
function eu(e, u) {
|
|
1913
1990
|
const t = [], a = ["if", "for", "model", "show", "bind", "html"];
|
|
1914
|
-
if (u && (e.type ===
|
|
1915
|
-
if (e ===
|
|
1916
|
-
const
|
|
1991
|
+
if (u && (e.type === v.IF_BRANCH || e.type === v.IF) && u.forEach((r, n) => {
|
|
1992
|
+
if (e === r) {
|
|
1993
|
+
const i = n === 0 ? "vIf" : r.condition ? "vElseIf" : "vElse", s = r.condition?.loc.source || "";
|
|
1917
1994
|
t.push({
|
|
1918
|
-
name:
|
|
1919
|
-
value:
|
|
1995
|
+
name: i,
|
|
1996
|
+
value: i === "vElse" ? !0 : T(s)
|
|
1920
1997
|
});
|
|
1921
1998
|
const o = e.children?.[0];
|
|
1922
1999
|
if (o) {
|
|
1923
|
-
const
|
|
1924
|
-
t.push(...
|
|
2000
|
+
const c = eu(o);
|
|
2001
|
+
t.push(...c);
|
|
1925
2002
|
}
|
|
1926
2003
|
}
|
|
1927
|
-
}), e.type ===
|
|
2004
|
+
}), e.type === v.FOR && t.push({
|
|
1928
2005
|
name: "vFor",
|
|
1929
|
-
value:
|
|
2006
|
+
value: T(e.source.loc.source),
|
|
1930
2007
|
iterator: {
|
|
1931
2008
|
item: e.valueAlias?.loc.source || "item",
|
|
1932
2009
|
index: e.keyAlias?.loc.source || "index"
|
|
1933
2010
|
}
|
|
1934
|
-
}), e.type ===
|
|
1935
|
-
const
|
|
1936
|
-
(
|
|
1937
|
-
),
|
|
1938
|
-
|
|
2011
|
+
}), e.type === v.ELEMENT) {
|
|
2012
|
+
const r = e.props.filter(
|
|
2013
|
+
(d) => d.type === v.DIRECTIVE
|
|
2014
|
+
), n = r.filter((d) => d.name === "model");
|
|
2015
|
+
n.length && n.forEach((d) => {
|
|
1939
2016
|
t.push({
|
|
1940
2017
|
name: "vModel",
|
|
1941
|
-
arg:
|
|
1942
|
-
value:
|
|
2018
|
+
arg: d.arg?.content,
|
|
2019
|
+
value: T(d.exp?.loc.source || "")
|
|
1943
2020
|
});
|
|
1944
2021
|
});
|
|
1945
|
-
const
|
|
1946
|
-
|
|
2022
|
+
const i = r.find((d) => d.name === "show");
|
|
2023
|
+
i && t.push({
|
|
1947
2024
|
name: "vShow",
|
|
1948
|
-
value:
|
|
2025
|
+
value: T(i.exp?.loc.source || "")
|
|
1949
2026
|
});
|
|
1950
|
-
const
|
|
1951
|
-
|
|
2027
|
+
const s = r.find((d) => d.name === "bind" && !d.arg);
|
|
2028
|
+
s && t.push({
|
|
1952
2029
|
name: "vBind",
|
|
1953
|
-
value:
|
|
2030
|
+
value: T(s.exp?.loc.source || "")
|
|
1954
2031
|
});
|
|
1955
|
-
const o =
|
|
2032
|
+
const o = r.find((d) => d.name === "html");
|
|
1956
2033
|
o && t.push({
|
|
1957
2034
|
name: "vHtml",
|
|
1958
|
-
value:
|
|
2035
|
+
value: T(o.exp?.loc.source || "")
|
|
1959
2036
|
});
|
|
1960
|
-
const
|
|
1961
|
-
for (const
|
|
1962
|
-
const l = (
|
|
1963
|
-
(
|
|
2037
|
+
const c = r.filter((d) => !a.includes(d.name));
|
|
2038
|
+
for (const d of c) {
|
|
2039
|
+
const l = (d.modifiers || []).reduce(
|
|
2040
|
+
(h, S) => (h[S.content] = !0, h),
|
|
1964
2041
|
{}
|
|
1965
|
-
),
|
|
1966
|
-
|
|
1967
|
-
name:
|
|
1968
|
-
value:
|
|
1969
|
-
arg:
|
|
2042
|
+
), p = d.arg?.content || void 0, b = ee[d.name];
|
|
2043
|
+
b && t.push({
|
|
2044
|
+
name: b,
|
|
2045
|
+
value: T(d.exp?.loc.source || ""),
|
|
2046
|
+
arg: p,
|
|
1970
2047
|
modifiers: l
|
|
1971
2048
|
});
|
|
1972
2049
|
}
|
|
1973
2050
|
}
|
|
1974
2051
|
return t;
|
|
1975
2052
|
}
|
|
1976
|
-
function
|
|
2053
|
+
function ne(e) {
|
|
1977
2054
|
let u = "";
|
|
1978
|
-
if (e.type ===
|
|
2055
|
+
if (e.type === v.ELEMENT) {
|
|
1979
2056
|
const { props: t = [], tag: a } = e;
|
|
1980
|
-
for (const
|
|
1981
|
-
if (
|
|
1982
|
-
const
|
|
1983
|
-
u =
|
|
1984
|
-
} else if (
|
|
1985
|
-
const
|
|
1986
|
-
u =
|
|
2057
|
+
for (const r of t)
|
|
2058
|
+
if (r.name === "class") {
|
|
2059
|
+
const n = r.value?.content || "", i = new RegExp(`${a}_([\\w]+)`);
|
|
2060
|
+
u = n.match(i)?.[1] || "";
|
|
2061
|
+
} else if (r.type === v.DIRECTIVE && r.name === "on") {
|
|
2062
|
+
const n = r.arg?.loc?.source || "", i = r.exp?.loc?.source || "", s = new RegExp(`${n}_([\\w]+)`);
|
|
2063
|
+
u = i.match(s)?.[1] || "";
|
|
1987
2064
|
}
|
|
1988
2065
|
}
|
|
1989
|
-
return u ||
|
|
2066
|
+
return u || nu();
|
|
1990
2067
|
}
|
|
1991
|
-
function
|
|
2068
|
+
function Et(e) {
|
|
1992
2069
|
const u = /\.\/(.+?)\.vue/;
|
|
1993
|
-
for (const { from: t, imports: a } of
|
|
2070
|
+
for (const { from: t, imports: a } of ae) {
|
|
1994
2071
|
if (Array.isArray(a) && a.includes(e))
|
|
1995
2072
|
return t;
|
|
1996
2073
|
if (a === e) {
|
|
1997
|
-
const
|
|
1998
|
-
if (
|
|
2074
|
+
const r = t.match(u)?.[1];
|
|
2075
|
+
if (r)
|
|
1999
2076
|
return {
|
|
2000
2077
|
type: "Schema",
|
|
2001
|
-
id:
|
|
2078
|
+
id: r
|
|
2002
2079
|
};
|
|
2003
2080
|
}
|
|
2004
2081
|
}
|
|
2005
2082
|
}
|
|
2006
|
-
function
|
|
2007
|
-
const t = new Set(u?.id ?
|
|
2008
|
-
let
|
|
2083
|
+
function mu(e, u) {
|
|
2084
|
+
const t = new Set(u?.id ? su[u.id] : []), a = (e.directives || []).find((i) => i.name === "vFor");
|
|
2085
|
+
let r = new Set(Array.from(t));
|
|
2009
2086
|
if (a) {
|
|
2010
|
-
const { item:
|
|
2011
|
-
|
|
2012
|
-
}
|
|
2013
|
-
const
|
|
2014
|
-
if (
|
|
2015
|
-
const
|
|
2016
|
-
|
|
2017
|
-
}
|
|
2018
|
-
|
|
2019
|
-
}
|
|
2020
|
-
function
|
|
2021
|
-
const
|
|
2022
|
-
name:
|
|
2023
|
-
from:
|
|
2024
|
-
props:
|
|
2025
|
-
events:
|
|
2026
|
-
directives:
|
|
2087
|
+
const { item: i = "item", index: s = "index" } = a.iterator || {};
|
|
2088
|
+
r = /* @__PURE__ */ new Set([i, s, ...Array.from(r)]);
|
|
2089
|
+
}
|
|
2090
|
+
const n = e.slot;
|
|
2091
|
+
if (n) {
|
|
2092
|
+
const i = typeof n == "string" ? [] : n.params || [], s = i.length ? i : [`scope_${u?.id}`];
|
|
2093
|
+
r = /* @__PURE__ */ new Set([...s, ...Array.from(r)]);
|
|
2094
|
+
}
|
|
2095
|
+
su[e.id] = r;
|
|
2096
|
+
}
|
|
2097
|
+
function bu(e, u, t, a) {
|
|
2098
|
+
const r = {
|
|
2099
|
+
name: Xu(e.tag, cu),
|
|
2100
|
+
from: Et(e.tag),
|
|
2101
|
+
props: yt(e.props),
|
|
2102
|
+
events: vt(e.props, ue),
|
|
2103
|
+
directives: eu(t || e, a)
|
|
2027
2104
|
};
|
|
2028
|
-
|
|
2029
|
-
const
|
|
2030
|
-
return
|
|
2031
|
-
}
|
|
2032
|
-
function
|
|
2033
|
-
return e.map((t) =>
|
|
2034
|
-
}
|
|
2035
|
-
function
|
|
2036
|
-
if (e.type ===
|
|
2037
|
-
return
|
|
2038
|
-
if (e.type ===
|
|
2039
|
-
return
|
|
2040
|
-
if (t && e.type ===
|
|
2105
|
+
r.id = ne(e), mu(r, u);
|
|
2106
|
+
const n = ou(r, e.children);
|
|
2107
|
+
return mu(r, u), gt(n), n;
|
|
2108
|
+
}
|
|
2109
|
+
function wt(e = [], u) {
|
|
2110
|
+
return e.map((t) => Q(t, u, e));
|
|
2111
|
+
}
|
|
2112
|
+
function Q(e, u, t) {
|
|
2113
|
+
if (e.type === v.ELEMENT)
|
|
2114
|
+
return bu(e, u);
|
|
2115
|
+
if (e.type === v.IF)
|
|
2116
|
+
return It(e);
|
|
2117
|
+
if (t && e.type === v.IF_BRANCH) {
|
|
2041
2118
|
const a = e.children.find(
|
|
2042
|
-
(
|
|
2119
|
+
(r) => r.type === v.ELEMENT || r.type === v.FOR
|
|
2043
2120
|
);
|
|
2044
2121
|
if (a) {
|
|
2045
|
-
if (a.type ===
|
|
2046
|
-
return
|
|
2047
|
-
if (a.type ===
|
|
2048
|
-
const
|
|
2049
|
-
return
|
|
2122
|
+
if (a.type === v.ELEMENT)
|
|
2123
|
+
return bu(a, u, e, t);
|
|
2124
|
+
if (a.type === v.FOR) {
|
|
2125
|
+
const n = { name: "div", directives: eu(e) };
|
|
2126
|
+
return ou(n, e.children || []);
|
|
2050
2127
|
}
|
|
2051
2128
|
}
|
|
2052
2129
|
return "";
|
|
2053
2130
|
}
|
|
2054
|
-
if (e.type ===
|
|
2131
|
+
if (e.type === v.FOR) {
|
|
2055
2132
|
const a = e.children[0];
|
|
2056
|
-
if (e.children.length > 1 || a.type !==
|
|
2057
|
-
const
|
|
2058
|
-
return
|
|
2133
|
+
if (e.children.length > 1 || a.type !== v.ELEMENT) {
|
|
2134
|
+
const n = { name: "span", directives: eu(e) };
|
|
2135
|
+
return ou(n, e.children);
|
|
2059
2136
|
} else
|
|
2060
|
-
return
|
|
2137
|
+
return bu(a, u, e);
|
|
2061
2138
|
}
|
|
2062
|
-
if (e.type ===
|
|
2063
|
-
return e.content.type ==
|
|
2139
|
+
if (e.type === v.TEXT_CALL)
|
|
2140
|
+
return e.content.type == v.TEXT ? e.content.content : e.content.type === v.INTERPOLATION ? T(e.content.content.loc.source) : e.content.type === v.COMPOUND_EXPRESSION ? Ru(
|
|
2064
2141
|
e.content.children
|
|
2065
2142
|
) : "";
|
|
2066
|
-
if (e.type ===
|
|
2143
|
+
if (e.type === v.TEXT)
|
|
2067
2144
|
return e.content;
|
|
2068
|
-
if (e.type ===
|
|
2069
|
-
return
|
|
2070
|
-
if (e.type ===
|
|
2071
|
-
return
|
|
2145
|
+
if (e.type === v.INTERPOLATION && (e.content.type === v.SIMPLE_EXPRESSION || e.content.type === v.COMPOUND_EXPRESSION))
|
|
2146
|
+
return T(e.content.loc.source);
|
|
2147
|
+
if (e.type === v.COMPOUND_EXPRESSION)
|
|
2148
|
+
return Ru(
|
|
2072
2149
|
e.children
|
|
2073
2150
|
);
|
|
2074
|
-
e.type !==
|
|
2151
|
+
e.type !== v.COMMENT && console.warn("未处理", e.type);
|
|
2075
2152
|
}
|
|
2076
|
-
function
|
|
2153
|
+
function Ru(e = []) {
|
|
2077
2154
|
const u = e.filter((a) => typeof a != "string"), t = [];
|
|
2078
2155
|
for (const a of u)
|
|
2079
2156
|
t.push({
|
|
2080
2157
|
name: "span",
|
|
2081
|
-
children: a.type ===
|
|
2158
|
+
children: a.type === v.TEXT ? a.loc.source : T(a.content?.loc.source)
|
|
2082
2159
|
});
|
|
2083
2160
|
return {
|
|
2084
2161
|
name: "span",
|
|
2085
2162
|
children: t
|
|
2086
2163
|
};
|
|
2087
2164
|
}
|
|
2088
|
-
function
|
|
2165
|
+
function ou(e, u = []) {
|
|
2089
2166
|
const t = [];
|
|
2090
2167
|
for (const a of u)
|
|
2091
|
-
if (a.type ===
|
|
2092
|
-
const
|
|
2093
|
-
if (
|
|
2094
|
-
const
|
|
2095
|
-
t.push(...
|
|
2168
|
+
if (a.type === v.ELEMENT && a.codegenNode?.value?.arguments) {
|
|
2169
|
+
const r = a.codegenNode.value.arguments[0];
|
|
2170
|
+
if (r) {
|
|
2171
|
+
const n = qu(r, cu);
|
|
2172
|
+
t.push(...n);
|
|
2096
2173
|
}
|
|
2097
|
-
} else if (a.type ===
|
|
2098
|
-
const
|
|
2099
|
-
for (const
|
|
2100
|
-
const
|
|
2174
|
+
} else if (a.type === v.ELEMENT && a.tag === "template") {
|
|
2175
|
+
const r = a.props.find((n) => n.name === "slot");
|
|
2176
|
+
for (const n of a.children) {
|
|
2177
|
+
const i = n.type === v.TEXT || n.type === v.TEXT_CALL ? {
|
|
2101
2178
|
name: "span",
|
|
2102
|
-
children:
|
|
2103
|
-
} :
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
name:
|
|
2107
|
-
params:
|
|
2108
|
-
scope:
|
|
2109
|
-
},
|
|
2179
|
+
children: Q(n, e)
|
|
2180
|
+
} : Q(n, e);
|
|
2181
|
+
i && (Array.isArray(i) ? i : [i]).forEach((o) => {
|
|
2182
|
+
Ie(o) && r?.type === v.DIRECTIVE && (o.id = ne(n), o.slot = {
|
|
2183
|
+
name: r.arg?.content || "default",
|
|
2184
|
+
params: r.exp?.identifiers || [],
|
|
2185
|
+
scope: r.exp?.type === v.SIMPLE_EXPRESSION ? r.exp.content : ""
|
|
2186
|
+
}, mu(o, e)), t.push(o);
|
|
2110
2187
|
});
|
|
2111
2188
|
}
|
|
2112
|
-
} else if (a.type ===
|
|
2113
|
-
const
|
|
2114
|
-
if (
|
|
2115
|
-
const
|
|
2116
|
-
t.push(...
|
|
2189
|
+
} else if (a.type === v.JS_CALL_EXPRESSION) {
|
|
2190
|
+
const r = a.arguments?.[0];
|
|
2191
|
+
if (r) {
|
|
2192
|
+
const n = qu(r, cu);
|
|
2193
|
+
t.push(...n);
|
|
2117
2194
|
}
|
|
2118
|
-
} else if (a.type ===
|
|
2119
|
-
const
|
|
2120
|
-
|
|
2195
|
+
} else if (a.type === v.TEXT_CALL) {
|
|
2196
|
+
const r = Q(a, e);
|
|
2197
|
+
r && (Array.isArray(r) ? t.push(...r) : t.push(r));
|
|
2121
2198
|
} else {
|
|
2122
|
-
const
|
|
2123
|
-
|
|
2199
|
+
const r = Q(a, e);
|
|
2200
|
+
r && (Array.isArray(r) ? t.push(...r) : t.push(r));
|
|
2124
2201
|
}
|
|
2125
2202
|
if (t.length === 1) {
|
|
2126
2203
|
const a = t[0];
|
|
2127
|
-
e.children = typeof a == "string" ||
|
|
2204
|
+
e.children = typeof a == "string" || iu(a) ? a : [a];
|
|
2128
2205
|
} else
|
|
2129
|
-
e.children = t.map((a) => typeof a == "string" ? { name: "span", children: a } : a);
|
|
2206
|
+
e.children = t.map((a) => typeof a == "string" || iu(a) ? { name: "span", children: a } : a);
|
|
2130
2207
|
return e;
|
|
2131
2208
|
}
|
|
2132
|
-
function
|
|
2209
|
+
function It(e) {
|
|
2133
2210
|
const u = e.branches || [], t = u[0], a = t.children || [];
|
|
2134
|
-
if (t?.isTemplateIf || a.length > 1 || a[0].type !==
|
|
2135
|
-
const
|
|
2136
|
-
return
|
|
2211
|
+
if (t?.isTemplateIf || a.length > 1 || a[0].type !== v.ELEMENT) {
|
|
2212
|
+
const n = { name: "span", directives: eu(t, u) };
|
|
2213
|
+
return ou(n, t.children);
|
|
2137
2214
|
} else
|
|
2138
|
-
return
|
|
2215
|
+
return wt(u);
|
|
2216
|
+
}
|
|
2217
|
+
const At = {
|
|
2218
|
+
onBeforeMount: "beforeMount",
|
|
2219
|
+
onMounted: "mounted",
|
|
2220
|
+
onBeforeUpdate: "beforeUpdate",
|
|
2221
|
+
onUpdated: "updated",
|
|
2222
|
+
onBeforeUnmount: "beforeUnmount",
|
|
2223
|
+
onUnmounted: "unmounted",
|
|
2224
|
+
onErrorCaptured: "errorCaptured",
|
|
2225
|
+
onRenderTracked: "renderTracked",
|
|
2226
|
+
onRenderTriggered: "renderTriggered",
|
|
2227
|
+
onActivated: "activated",
|
|
2228
|
+
onDeactivated: "deactivated",
|
|
2229
|
+
// Uniapp 专用生命周期钩子(Composition 名与 Options 名相同)
|
|
2230
|
+
onLoad: "onLoad",
|
|
2231
|
+
onShow: "onShow",
|
|
2232
|
+
onReady: "onReady",
|
|
2233
|
+
onHide: "onHide",
|
|
2234
|
+
onUnload: "onUnload",
|
|
2235
|
+
onResize: "onResize",
|
|
2236
|
+
onPullDownRefresh: "onPullDownRefresh",
|
|
2237
|
+
onReachBottom: "onReachBottom",
|
|
2238
|
+
onTabItemTap: "onTabItemTap",
|
|
2239
|
+
onShareAppMessage: "onShareAppMessage",
|
|
2240
|
+
onPageScroll: "onPageScroll",
|
|
2241
|
+
onNavigationBarButtonTap: "onNavigationBarButtonTap",
|
|
2242
|
+
onBackPress: "onBackPress",
|
|
2243
|
+
onNavigationBarSearchInputChanged: "onNavigationBarSearchInputChanged",
|
|
2244
|
+
onNavigationBarSearchInputConfirmed: "onNavigationBarSearchInputConfirmed",
|
|
2245
|
+
onNavigationBarSearchInputClicked: "onNavigationBarSearchInputClicked",
|
|
2246
|
+
onShareTimeline: "onShareTimeline",
|
|
2247
|
+
onAddToFavorites: "onAddToFavorites"
|
|
2248
|
+
}, kt = /* @__PURE__ */ new Set([
|
|
2249
|
+
"vue-router",
|
|
2250
|
+
"pinia",
|
|
2251
|
+
"vue-i18n",
|
|
2252
|
+
"@vtj/renderer"
|
|
2253
|
+
]), Tt = new Set(
|
|
2254
|
+
Object.values(gu).map((e) => e.composable).filter((e) => !!e)
|
|
2255
|
+
);
|
|
2256
|
+
function Nt(e, u) {
|
|
2257
|
+
const t = jt(e), a = Vt(t), { dependencies: r = [] } = u || {}, n = r.reduce(
|
|
2258
|
+
(c, d) => (c[d.package] = d.library, c),
|
|
2259
|
+
{}
|
|
2260
|
+
), i = {
|
|
2261
|
+
imports: t,
|
|
2262
|
+
refs: {},
|
|
2263
|
+
reactives: {},
|
|
2264
|
+
state: {},
|
|
2265
|
+
computed: {},
|
|
2266
|
+
methods: {},
|
|
2267
|
+
watch: [],
|
|
2268
|
+
lifeCycles: {},
|
|
2269
|
+
props: [],
|
|
2270
|
+
emits: [],
|
|
2271
|
+
expose: [],
|
|
2272
|
+
inject: [],
|
|
2273
|
+
provide: {},
|
|
2274
|
+
composables: [],
|
|
2275
|
+
setup: void 0,
|
|
2276
|
+
handlers: {},
|
|
2277
|
+
dataSources: {},
|
|
2278
|
+
directives: {}
|
|
2279
|
+
}, s = [], o = B(e);
|
|
2280
|
+
if (J(o, {
|
|
2281
|
+
// 顶层变量声明
|
|
2282
|
+
VariableDeclaration(c) {
|
|
2283
|
+
if (c.parent.type !== "Program") return;
|
|
2284
|
+
const d = c.node;
|
|
2285
|
+
for (const p of d.declarations) {
|
|
2286
|
+
if (!p.init) continue;
|
|
2287
|
+
const b = p.init;
|
|
2288
|
+
if (b.type === "CallExpression") {
|
|
2289
|
+
const h = Cu(b);
|
|
2290
|
+
if (h === "ref") {
|
|
2291
|
+
const E = _(p.id);
|
|
2292
|
+
if (E) {
|
|
2293
|
+
const m = b.arguments[0] ? A(b.arguments[0]) : "undefined";
|
|
2294
|
+
i.refs[E] = T(m);
|
|
2295
|
+
}
|
|
2296
|
+
return;
|
|
2297
|
+
}
|
|
2298
|
+
if (h === "reactive") {
|
|
2299
|
+
const E = _(p.id);
|
|
2300
|
+
if (E)
|
|
2301
|
+
if (E === "__state")
|
|
2302
|
+
i.state = Dt(b.arguments[0]);
|
|
2303
|
+
else {
|
|
2304
|
+
const m = b.arguments[0] ? A(b.arguments[0]) : "{}";
|
|
2305
|
+
i.reactives[E] = T(m);
|
|
2306
|
+
}
|
|
2307
|
+
return;
|
|
2308
|
+
}
|
|
2309
|
+
if (h === "computed") {
|
|
2310
|
+
const E = _(p.id);
|
|
2311
|
+
if (E) {
|
|
2312
|
+
const m = b.arguments[0] ? A(b.arguments[0]) : "() => {}";
|
|
2313
|
+
i.computed[E] = C(m);
|
|
2314
|
+
}
|
|
2315
|
+
return;
|
|
2316
|
+
}
|
|
2317
|
+
if (h === "inject") {
|
|
2318
|
+
const E = _(p.id);
|
|
2319
|
+
if (E) {
|
|
2320
|
+
const m = b.arguments[0], y = b.arguments[1], x = m ? Lu(m) : E;
|
|
2321
|
+
i.inject.push({
|
|
2322
|
+
name: E,
|
|
2323
|
+
from: x || E,
|
|
2324
|
+
default: y ? T(A(y)) : void 0
|
|
2325
|
+
});
|
|
2326
|
+
}
|
|
2327
|
+
return;
|
|
2328
|
+
}
|
|
2329
|
+
if (h === "defineProps" || h === "withDefaults") {
|
|
2330
|
+
i.props = Pu(b);
|
|
2331
|
+
return;
|
|
2332
|
+
}
|
|
2333
|
+
if (h === "defineEmits") {
|
|
2334
|
+
i.emits = Ou(b);
|
|
2335
|
+
return;
|
|
2336
|
+
}
|
|
2337
|
+
if (h && /^use[A-Z]/.test(h)) {
|
|
2338
|
+
const E = a.get(h);
|
|
2339
|
+
if (qt(h, E)) {
|
|
2340
|
+
const x = _u(p.id);
|
|
2341
|
+
x.length > 0 && (i.globalApiDestructured ??= [], i.globalApiDestructured.push({ callee: h, destructure: x }));
|
|
2342
|
+
return;
|
|
2343
|
+
}
|
|
2344
|
+
if (h === "useProvider") return;
|
|
2345
|
+
if (!E)
|
|
2346
|
+
continue;
|
|
2347
|
+
const m = _(p.id), y = _u(p.id);
|
|
2348
|
+
if (m || y.length) {
|
|
2349
|
+
if (m && i.composables.some((D) => D.name === m))
|
|
2350
|
+
return;
|
|
2351
|
+
let x;
|
|
2352
|
+
const w = n[E];
|
|
2353
|
+
w ? x = `this.$libs.${w}.${h}` : x = h;
|
|
2354
|
+
const I = {
|
|
2355
|
+
name: m || y[0] || h,
|
|
2356
|
+
composable: {
|
|
2357
|
+
type: "JSExpression",
|
|
2358
|
+
value: x
|
|
2359
|
+
}
|
|
2360
|
+
};
|
|
2361
|
+
b.arguments.length > 0 && (I.args = b.arguments.map(
|
|
2362
|
+
(D) => T(A(D))
|
|
2363
|
+
)), y.length > 0 && (I.destructure = y), i.composables.push(I);
|
|
2364
|
+
}
|
|
2365
|
+
return;
|
|
2366
|
+
}
|
|
2367
|
+
const S = _(p.id);
|
|
2368
|
+
if (S && S.startsWith("__") || h === "getCurrentInstance")
|
|
2369
|
+
return;
|
|
2370
|
+
}
|
|
2371
|
+
if (b.type === "ArrowFunctionExpression" || b.type === "FunctionExpression") {
|
|
2372
|
+
const h = _(p.id);
|
|
2373
|
+
if (h) {
|
|
2374
|
+
const S = A(b);
|
|
2375
|
+
if (Bu(S)) {
|
|
2376
|
+
const E = Fu(h, S, u);
|
|
2377
|
+
if (E) {
|
|
2378
|
+
i.dataSources[h] = E;
|
|
2379
|
+
return;
|
|
2380
|
+
}
|
|
2381
|
+
}
|
|
2382
|
+
i.methods[h] = C(S);
|
|
2383
|
+
}
|
|
2384
|
+
return;
|
|
2385
|
+
}
|
|
2386
|
+
if (b.type === "MemberExpression") {
|
|
2387
|
+
const h = b.object, S = h.type === "Identifier" ? h.name : h.type === "MemberExpression" && h.object.type === "Identifier" ? h.object.name : null;
|
|
2388
|
+
if (S && a.has(S))
|
|
2389
|
+
return;
|
|
2390
|
+
}
|
|
2391
|
+
}
|
|
2392
|
+
if (d.declarations.some((p) => {
|
|
2393
|
+
const b = _(p.id);
|
|
2394
|
+
return b && b.startsWith("__");
|
|
2395
|
+
}))
|
|
2396
|
+
return;
|
|
2397
|
+
if (d.declarations.every((p) => {
|
|
2398
|
+
const b = p.init;
|
|
2399
|
+
return b && (b.type === "ObjectExpression" || b.type === "ArrayExpression");
|
|
2400
|
+
}) && d.declarations.length > 0) {
|
|
2401
|
+
for (const p of d.declarations) {
|
|
2402
|
+
const b = _(p.id);
|
|
2403
|
+
b && p.init && (i.reactives[b] = T(A(p.init)));
|
|
2404
|
+
}
|
|
2405
|
+
return;
|
|
2406
|
+
}
|
|
2407
|
+
for (const p of d.declarations) {
|
|
2408
|
+
const b = p.init;
|
|
2409
|
+
if (b) {
|
|
2410
|
+
const h = _(p.id) || "(unknown)", S = A(b), E = b.type;
|
|
2411
|
+
throw new Error(
|
|
2412
|
+
`[vtj/parser] 无法处理顶层变量声明 "const ${h} = ${S}":不支持的类型 "${E}"。仅支持 ObjectExpression / ArrayExpression 兜底自动转换为 reactive()。请改用 ref()、reactive()、computed() 或函数声明。`
|
|
2413
|
+
);
|
|
2414
|
+
}
|
|
2415
|
+
}
|
|
2416
|
+
throw new Error(
|
|
2417
|
+
"[vtj/parser] 无法处理顶层变量声明,请检查语句是否符合 DSL 要求。"
|
|
2418
|
+
);
|
|
2419
|
+
},
|
|
2420
|
+
// 顶层函数声明
|
|
2421
|
+
FunctionDeclaration(c) {
|
|
2422
|
+
if (c.parent.type !== "Program") return;
|
|
2423
|
+
const d = c.node;
|
|
2424
|
+
if (!d.id) return;
|
|
2425
|
+
const l = d.id.name, p = Lt(d);
|
|
2426
|
+
if (Bu(p)) {
|
|
2427
|
+
const b = Fu(l, p, u);
|
|
2428
|
+
if (b) {
|
|
2429
|
+
i.dataSources[l] = b;
|
|
2430
|
+
return;
|
|
2431
|
+
}
|
|
2432
|
+
}
|
|
2433
|
+
i.methods[l] = C(p);
|
|
2434
|
+
},
|
|
2435
|
+
// 顶层类声明 → 禁止,抛出异常
|
|
2436
|
+
ClassDeclaration(c) {
|
|
2437
|
+
if (c.parent.type !== "Program") return;
|
|
2438
|
+
const l = c.node.id?.name || "(anonymous)";
|
|
2439
|
+
throw new Error(
|
|
2440
|
+
`[vtj/parser] 无法处理顶层类声明 "class ${l}":DSL 不支持顶层 class 声明,请改用 ref()、reactive() 或函数声明。`
|
|
2441
|
+
);
|
|
2442
|
+
},
|
|
2443
|
+
// 顶层表达式语句
|
|
2444
|
+
ExpressionStatement(c) {
|
|
2445
|
+
if (c.parent.type !== "Program") return;
|
|
2446
|
+
const d = c.node, l = d.expression;
|
|
2447
|
+
if (l.type !== "CallExpression") {
|
|
2448
|
+
const h = A(d);
|
|
2449
|
+
throw new Error(
|
|
2450
|
+
`[vtj/parser] 无法处理顶层表达式语句 "${h}":DSL 不支持游离的顶层表达式,请改用生命周期钩子(如 onMounted)或声明确赋值。`
|
|
2451
|
+
);
|
|
2452
|
+
}
|
|
2453
|
+
const p = Cu(l);
|
|
2454
|
+
if (p === "watch") {
|
|
2455
|
+
const h = _t(l);
|
|
2456
|
+
h && i.watch.push(h);
|
|
2457
|
+
return;
|
|
2458
|
+
}
|
|
2459
|
+
if (p && p in At) {
|
|
2460
|
+
const h = l.arguments[0];
|
|
2461
|
+
h && (i.lifeCycles[p] = C(A(h)));
|
|
2462
|
+
return;
|
|
2463
|
+
}
|
|
2464
|
+
if (p === "provide") {
|
|
2465
|
+
const h = l.arguments[0], S = l.arguments[1];
|
|
2466
|
+
if (h && S) {
|
|
2467
|
+
const E = Lu(h);
|
|
2468
|
+
if (E) {
|
|
2469
|
+
const m = A(S);
|
|
2470
|
+
S.type === "ArrowFunctionExpression" || S.type === "FunctionExpression" ? i.provide[E] = C(m) : i.provide[E] = T(m);
|
|
2471
|
+
}
|
|
2472
|
+
}
|
|
2473
|
+
return;
|
|
2474
|
+
}
|
|
2475
|
+
if (p === "defineExpose") {
|
|
2476
|
+
i.expose = Ct(l);
|
|
2477
|
+
return;
|
|
2478
|
+
}
|
|
2479
|
+
if (p === "defineProps" || p === "withDefaults") {
|
|
2480
|
+
i.props = Pu(l);
|
|
2481
|
+
return;
|
|
2482
|
+
}
|
|
2483
|
+
if (p === "defineEmits") {
|
|
2484
|
+
i.emits = Ou(l);
|
|
2485
|
+
return;
|
|
2486
|
+
}
|
|
2487
|
+
const b = A(d);
|
|
2488
|
+
throw new Error(
|
|
2489
|
+
`[vtj/parser] 无法处理顶层调用语句 "${b}":DSL 不支持游离的顶层函数调用,请改用生命周期钩子(如 onMounted)或归类到方法声明中。`
|
|
2490
|
+
);
|
|
2491
|
+
}
|
|
2492
|
+
}), s.length > 0) {
|
|
2493
|
+
const d = s.some((l) => /\bawait\b/.test(l)) ? "async () =>" : "() =>";
|
|
2494
|
+
i.setup = C(
|
|
2495
|
+
`${d} {
|
|
2496
|
+
${s.join(`
|
|
2497
|
+
`)}
|
|
2498
|
+
}`
|
|
2499
|
+
);
|
|
2500
|
+
}
|
|
2501
|
+
return i;
|
|
2139
2502
|
}
|
|
2140
|
-
function
|
|
2503
|
+
function jt(e) {
|
|
2504
|
+
const u = /import\s+{(.+?)}\s+from\s+['"](.+?)['"]/g, t = /import\s+(.+?)\s+from\s+['"](.+?)['"]/g, a = /^{(.+?)}$/, r = [];
|
|
2505
|
+
let n;
|
|
2506
|
+
const i = e.replace(/\n/g, " ");
|
|
2507
|
+
for (; (n = u.exec(i)) !== null; ) {
|
|
2508
|
+
const s = n[2] === "@element-plus/icons-vue" ? "@vtj/icons" : n[2];
|
|
2509
|
+
r.push({
|
|
2510
|
+
from: s,
|
|
2511
|
+
imports: n[1].split(",").map((o) => o.trim())
|
|
2512
|
+
});
|
|
2513
|
+
}
|
|
2514
|
+
for (; (n = t.exec(i)) !== null; ) {
|
|
2515
|
+
const s = n[1], o = n[2];
|
|
2516
|
+
s && !a.test(s) && r.push({
|
|
2517
|
+
from: o,
|
|
2518
|
+
imports: s
|
|
2519
|
+
});
|
|
2520
|
+
}
|
|
2521
|
+
return r;
|
|
2522
|
+
}
|
|
2523
|
+
function Vt(e) {
|
|
2524
|
+
const u = /* @__PURE__ */ new Map();
|
|
2525
|
+
for (const t of e)
|
|
2526
|
+
if (Array.isArray(t.imports))
|
|
2527
|
+
for (const a of t.imports) {
|
|
2528
|
+
const r = a.match(/^\S+\s+as\s+(\S+)$/), n = r ? r[1] : a;
|
|
2529
|
+
u.set(n, t.from);
|
|
2530
|
+
}
|
|
2531
|
+
else
|
|
2532
|
+
u.set(t.imports, t.from);
|
|
2533
|
+
return u;
|
|
2534
|
+
}
|
|
2535
|
+
function qt(e, u) {
|
|
2536
|
+
return u && kt.has(u) ? !0 : Tt.has(e);
|
|
2537
|
+
}
|
|
2538
|
+
function Cu(e) {
|
|
2539
|
+
return e.callee.type === "Identifier" ? e.callee.name : null;
|
|
2540
|
+
}
|
|
2541
|
+
function _(e) {
|
|
2542
|
+
return e?.type === "Identifier" ? e.name : null;
|
|
2543
|
+
}
|
|
2544
|
+
function _u(e) {
|
|
2545
|
+
return e?.type === "ObjectPattern" ? e.properties.map((u) => u.type === "ObjectProperty" && u.key?.type === "Identifier" ? u.key.name : u.type === "RestElement" && u.argument?.type === "Identifier" ? u.argument.name : null).filter(Boolean) : e?.type === "ArrayPattern" ? e.elements.map((u) => u?.type === "Identifier" ? u.name : null).filter(Boolean) : [];
|
|
2546
|
+
}
|
|
2547
|
+
function Lu(e) {
|
|
2548
|
+
return e.type === "StringLiteral" ? e.value : null;
|
|
2549
|
+
}
|
|
2550
|
+
function Dt(e) {
|
|
2551
|
+
if (!e || e.type !== "ObjectExpression") return {};
|
|
2552
|
+
const u = {};
|
|
2553
|
+
for (const t of e.properties)
|
|
2554
|
+
if (t.type === "ObjectProperty") {
|
|
2555
|
+
const a = t.key?.name;
|
|
2556
|
+
a && (u[a] = T(A(t.value)));
|
|
2557
|
+
} else if (t.type === "ObjectMethod") {
|
|
2558
|
+
const a = t.key?.name;
|
|
2559
|
+
if (a) {
|
|
2560
|
+
const r = A(t.body), n = t.params.map((i) => i.name || "none").join(",");
|
|
2561
|
+
u[a] = T(`(${n}) => ${r}`);
|
|
2562
|
+
}
|
|
2563
|
+
}
|
|
2564
|
+
return u;
|
|
2565
|
+
}
|
|
2566
|
+
function Pu(e) {
|
|
2567
|
+
if (e.callee.type === "Identifier" && e.callee.name === "withDefaults") {
|
|
2568
|
+
const u = e.arguments[0];
|
|
2569
|
+
if (u?.type === "CallExpression") {
|
|
2570
|
+
const t = Mu(u), a = e.arguments[1];
|
|
2571
|
+
return a?.type === "ObjectExpression" && Rt(t, a), t;
|
|
2572
|
+
}
|
|
2573
|
+
}
|
|
2574
|
+
return Mu(e);
|
|
2575
|
+
}
|
|
2576
|
+
function Mu(e) {
|
|
2577
|
+
const u = e.arguments[0];
|
|
2578
|
+
return u ? u.type === "ArrayExpression" ? u.elements.map((t) => t?.type === "StringLiteral" ? t.value : "").filter(Boolean) : u.type === "ObjectExpression" ? u.properties.map((t) => {
|
|
2579
|
+
if (t.type !== "ObjectProperty") return null;
|
|
2580
|
+
const a = t.key?.name;
|
|
2581
|
+
if (!a) return null;
|
|
2582
|
+
if (t.value?.type === "Identifier")
|
|
2583
|
+
return { name: a, type: t.value.name };
|
|
2584
|
+
if (t.value?.type === "ObjectExpression") {
|
|
2585
|
+
const r = t.value.properties;
|
|
2586
|
+
return {
|
|
2587
|
+
name: a,
|
|
2588
|
+
type: Pt(r),
|
|
2589
|
+
required: xu(r, "required"),
|
|
2590
|
+
default: Mt(r)
|
|
2591
|
+
};
|
|
2592
|
+
}
|
|
2593
|
+
return a;
|
|
2594
|
+
}).filter(Boolean) : [] : [];
|
|
2595
|
+
}
|
|
2596
|
+
function Rt(e, u) {
|
|
2597
|
+
for (const t of u.properties) {
|
|
2598
|
+
if (t.type !== "ObjectProperty") continue;
|
|
2599
|
+
const a = t.key?.name;
|
|
2600
|
+
if (!a) continue;
|
|
2601
|
+
const r = e.findIndex(
|
|
2602
|
+
(n) => typeof n == "string" ? n === a : n.name === a
|
|
2603
|
+
);
|
|
2604
|
+
if (r >= 0) {
|
|
2605
|
+
const n = e[r];
|
|
2606
|
+
typeof n == "string" ? e[r] = {
|
|
2607
|
+
name: a,
|
|
2608
|
+
default: T(A(t.value))
|
|
2609
|
+
} : n.default = T(A(t.value));
|
|
2610
|
+
}
|
|
2611
|
+
}
|
|
2612
|
+
}
|
|
2613
|
+
function Ou(e) {
|
|
2614
|
+
const u = e.arguments[0];
|
|
2615
|
+
return u ? u.type === "ArrayExpression" ? u.elements.map((t) => t?.type === "StringLiteral" ? { name: t.value, params: [] } : null).filter(Boolean) : [] : [];
|
|
2616
|
+
}
|
|
2617
|
+
function Ct(e) {
|
|
2618
|
+
const u = e.arguments[0];
|
|
2619
|
+
return !u || u.type !== "ObjectExpression" ? [] : u.properties.map((t) => (t.type === "ObjectProperty" || t.type === "ObjectMethod") && t.key?.name || "").filter(Boolean);
|
|
2620
|
+
}
|
|
2621
|
+
function _t(e) {
|
|
2622
|
+
const [u, t, a] = e.arguments;
|
|
2623
|
+
if (!u || !t) return null;
|
|
2624
|
+
const r = A(u), n = A(t);
|
|
2625
|
+
let i = !1, s = !1;
|
|
2626
|
+
if (a?.type === "ObjectExpression") {
|
|
2627
|
+
const o = a.properties;
|
|
2628
|
+
i = xu(o, "deep"), s = xu(o, "immediate");
|
|
2629
|
+
}
|
|
2630
|
+
return {
|
|
2631
|
+
id: nu(),
|
|
2632
|
+
source: C(
|
|
2633
|
+
u.type === "ArrowFunctionExpression" || u.type === "FunctionExpression" ? r : `() => { return ${r}; }`
|
|
2634
|
+
),
|
|
2635
|
+
handler: C(n),
|
|
2636
|
+
deep: i,
|
|
2637
|
+
immediate: s
|
|
2638
|
+
};
|
|
2639
|
+
}
|
|
2640
|
+
function Lt(e) {
|
|
2641
|
+
const u = e.async ? "async " : "", t = e.params.map((r) => r.type === "ObjectPattern" ? `{${r.properties.map((i) => i.key?.name || i.name).join(",")}}` : r.type === "AssignmentPattern" ? r.left.name + "=" + (r.right?.extra?.raw || "null") : r.name).join(", "), a = A(e.body) || "{}";
|
|
2642
|
+
return `${u}(${t}) => ${a}`;
|
|
2643
|
+
}
|
|
2644
|
+
function Bu(e) {
|
|
2645
|
+
return e.includes("__provider.apis") || e.includes("__provider.createMock");
|
|
2646
|
+
}
|
|
2647
|
+
function Fu(e, u, t) {
|
|
2648
|
+
const a = /apis\['([\w]*)'\]/, n = Qu(""), i = (s) => {
|
|
2649
|
+
const o = s.indexOf(".then(");
|
|
2650
|
+
if (o === -1) return null;
|
|
2651
|
+
let c = 1, d = o + 6;
|
|
2652
|
+
for (; d < s.length && c > 0; ) {
|
|
2653
|
+
const l = s[d];
|
|
2654
|
+
l === "(" ? c++ : l === ")" && c--, d++;
|
|
2655
|
+
}
|
|
2656
|
+
return s.substring(o + 6, d - 1).trim();
|
|
2657
|
+
};
|
|
2658
|
+
if (u.includes("__provider.apis")) {
|
|
2659
|
+
const o = (u.match(a) || [])[1];
|
|
2660
|
+
if (!o) return null;
|
|
2661
|
+
const c = (t.apis || []).find((l) => l.id === o || l.name === o);
|
|
2662
|
+
if (!c) return null;
|
|
2663
|
+
const d = i(u);
|
|
2664
|
+
return {
|
|
2665
|
+
ref: o,
|
|
2666
|
+
name: e,
|
|
2667
|
+
test: n?.test || {
|
|
2668
|
+
type: "JSFunction",
|
|
2669
|
+
value: `() => this.runApi({
|
|
2670
|
+
/* 在这里可输入接口参数 */
|
|
2671
|
+
})`
|
|
2672
|
+
},
|
|
2673
|
+
type: "api",
|
|
2674
|
+
label: c.label,
|
|
2675
|
+
transform: {
|
|
2676
|
+
type: "JSFunction",
|
|
2677
|
+
value: d || `(res) => {
|
|
2678
|
+
return res;
|
|
2679
|
+
}`
|
|
2680
|
+
},
|
|
2681
|
+
mockTemplate: c.mockTemplate
|
|
2682
|
+
};
|
|
2683
|
+
}
|
|
2684
|
+
if (u.includes("__provider.createMock")) {
|
|
2685
|
+
const s = i(u);
|
|
2686
|
+
return {
|
|
2687
|
+
ref: "",
|
|
2688
|
+
name: e,
|
|
2689
|
+
test: n?.test || {
|
|
2690
|
+
type: "JSFunction",
|
|
2691
|
+
value: `() => this.runApi({
|
|
2692
|
+
/* 在这里可输入接口参数 */
|
|
2693
|
+
})`
|
|
2694
|
+
},
|
|
2695
|
+
type: "mock",
|
|
2696
|
+
label: n?.label || "",
|
|
2697
|
+
transform: n?.transform || {
|
|
2698
|
+
type: "JSFunction",
|
|
2699
|
+
value: s || `(res) => {
|
|
2700
|
+
return res;
|
|
2701
|
+
}`
|
|
2702
|
+
},
|
|
2703
|
+
mockTemplate: n?.mockTemplate || {
|
|
2704
|
+
type: "JSFunction",
|
|
2705
|
+
value: ""
|
|
2706
|
+
}
|
|
2707
|
+
};
|
|
2708
|
+
}
|
|
2709
|
+
return null;
|
|
2710
|
+
}
|
|
2711
|
+
function xu(e, u) {
|
|
2712
|
+
return !!e?.find(
|
|
2713
|
+
(a) => a.key?.name === u
|
|
2714
|
+
)?.value?.value;
|
|
2715
|
+
}
|
|
2716
|
+
function Pt(e) {
|
|
2717
|
+
const u = e?.find(
|
|
2718
|
+
(t) => t.key?.name === "type"
|
|
2719
|
+
);
|
|
2720
|
+
if (u)
|
|
2721
|
+
return u.value.type === "ArrayExpression" ? u.value.elements.map((t) => t.name) : u.value.name;
|
|
2722
|
+
}
|
|
2723
|
+
function Mt(e) {
|
|
2724
|
+
const u = e?.find(
|
|
2725
|
+
(t) => t.key?.name === "default"
|
|
2726
|
+
);
|
|
2727
|
+
if (u)
|
|
2728
|
+
return T(A(u.value));
|
|
2729
|
+
}
|
|
2730
|
+
function Ot(e) {
|
|
2141
2731
|
const u = [], t = {}, a = [];
|
|
2142
2732
|
try {
|
|
2143
|
-
const
|
|
2144
|
-
for (const
|
|
2145
|
-
if (
|
|
2733
|
+
const r = ve.compileString(e, { charset: !1 })?.css || "", n = Se.parse(r), i = /^.[\w]+_[\w]{5,}/;
|
|
2734
|
+
for (const s of n.nodes)
|
|
2735
|
+
if (s.type === "rule") {
|
|
2146
2736
|
const o = {};
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
}), t[
|
|
2737
|
+
i.test(s.selector) ? (s.nodes.forEach((c) => {
|
|
2738
|
+
c.type === "decl" && (o[c.prop] = c.value);
|
|
2739
|
+
}), t[s.selector] = o) : a.push(s.toString());
|
|
2150
2740
|
} else
|
|
2151
|
-
a.push(
|
|
2152
|
-
} catch (
|
|
2153
|
-
u.push(`css解析出错了,错误信息:[ ${
|
|
2741
|
+
a.push(s.toString());
|
|
2742
|
+
} catch (r) {
|
|
2743
|
+
u.push(`css解析出错了,错误信息:[ ${r.message} ]
|
|
2154
2744
|
`);
|
|
2155
2745
|
}
|
|
2156
2746
|
return {
|
|
@@ -2160,12 +2750,194 @@ function dt(e) {
|
|
|
2160
2750
|
`)
|
|
2161
2751
|
};
|
|
2162
2752
|
}
|
|
2163
|
-
|
|
2753
|
+
function uu(e, u, t) {
|
|
2754
|
+
let a = "", r = 0;
|
|
2755
|
+
const n = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*`/g;
|
|
2756
|
+
let i;
|
|
2757
|
+
for (; (i = n.exec(e)) !== null; ) {
|
|
2758
|
+
const s = e.slice(r, i.index);
|
|
2759
|
+
a += s.replace(u, t);
|
|
2760
|
+
const o = i[0];
|
|
2761
|
+
o.startsWith("`") ? a += Bt(o, u, t) : a += o, r = i.index + i[0].length;
|
|
2762
|
+
}
|
|
2763
|
+
return a += e.slice(r).replace(u, t), a;
|
|
2764
|
+
}
|
|
2765
|
+
function Bt(e, u, t) {
|
|
2766
|
+
let a = "", r = 0;
|
|
2767
|
+
const n = /\$\{([^}]*)\}/g;
|
|
2768
|
+
let i;
|
|
2769
|
+
for (; (i = n.exec(e)) !== null; ) {
|
|
2770
|
+
a += e.slice(r, i.index);
|
|
2771
|
+
const o = i[1].replace(u, t);
|
|
2772
|
+
a += "${" + o + "}", r = i.index + i[0].length;
|
|
2773
|
+
}
|
|
2774
|
+
return a += e.slice(r), a;
|
|
2775
|
+
}
|
|
2776
|
+
function Ft(e, u) {
|
|
2777
|
+
if (!e) return e;
|
|
2778
|
+
let t = e;
|
|
2779
|
+
const a = [...u.refs, ...u.computed];
|
|
2780
|
+
for (const r of a)
|
|
2781
|
+
t = uu(
|
|
2782
|
+
t,
|
|
2783
|
+
new RegExp(`(?<!\\.)\\b${Z(r)}\\.value\\b`, "g"),
|
|
2784
|
+
`this.${r}.value`
|
|
2785
|
+
);
|
|
2786
|
+
for (const r of a)
|
|
2787
|
+
t = uu(
|
|
2788
|
+
t,
|
|
2789
|
+
new RegExp(
|
|
2790
|
+
`(?<!this\\.)(?:(?<=_ctx\\.)|(?<!\\.))\\b${Z(r)}\\b(?!\\.value)`,
|
|
2791
|
+
"g"
|
|
2792
|
+
),
|
|
2793
|
+
`this.${r}.value`
|
|
2794
|
+
);
|
|
2795
|
+
t = uu(
|
|
2796
|
+
t,
|
|
2797
|
+
/__instance\.proxy\.\$forceUpdate\./g,
|
|
2798
|
+
"__instance.proxy."
|
|
2799
|
+
);
|
|
2800
|
+
for (const [r, n] of Object.entries(
|
|
2801
|
+
u.reverseMemberApiMap || {}
|
|
2802
|
+
))
|
|
2803
|
+
for (const [i, s] of Object.entries(n)) {
|
|
2804
|
+
const o = new RegExp(
|
|
2805
|
+
`\\b${Z(r)}\\.${Z(i)}\\b`,
|
|
2806
|
+
"g"
|
|
2807
|
+
);
|
|
2808
|
+
t = uu(t, o, `this.${s}`);
|
|
2809
|
+
}
|
|
2810
|
+
for (const r of u.props)
|
|
2811
|
+
t = $t(t, "__props", r, `this.${r}`);
|
|
2812
|
+
for (const r of u.props)
|
|
2813
|
+
t = R(t, r, `this.${r}`);
|
|
2814
|
+
for (const [r, n] of Object.entries(u.reverseApiMap))
|
|
2815
|
+
t = R(t, r, `this.${n}`);
|
|
2816
|
+
u.hasState && (t = R(t, "__state", "this.state"));
|
|
2817
|
+
for (const r of u.reactives)
|
|
2818
|
+
t = R(t, r, `this.${r}`);
|
|
2819
|
+
for (const r of u.methods)
|
|
2820
|
+
t = R(t, r, `this.${r}`);
|
|
2821
|
+
for (const r of u.composables)
|
|
2822
|
+
t = R(t, r, `this.${r}`);
|
|
2823
|
+
for (const r of u.injects)
|
|
2824
|
+
t = R(t, r, `this.${r}`);
|
|
2825
|
+
for (const r of u.dataSources)
|
|
2826
|
+
t = R(t, r, `this.${r}`);
|
|
2827
|
+
return t = t.replace(/this\.this\./g, "this."), t;
|
|
2828
|
+
}
|
|
2829
|
+
function Z(e) {
|
|
2830
|
+
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
2831
|
+
}
|
|
2832
|
+
function $t(e, u, t, a) {
|
|
2833
|
+
const r = new RegExp(
|
|
2834
|
+
`\\b${Z(u)}\\.${Z(t)}\\b`,
|
|
2835
|
+
"g"
|
|
2836
|
+
);
|
|
2837
|
+
return uu(e, r, a);
|
|
2838
|
+
}
|
|
2839
|
+
function ie(e) {
|
|
2840
|
+
const u = {}, t = {};
|
|
2841
|
+
for (const [a, r] of Object.entries(gu))
|
|
2842
|
+
if (r.replace)
|
|
2843
|
+
if (r.replace.includes(".")) {
|
|
2844
|
+
const n = r.replace.lastIndexOf("."), i = r.replace.substring(0, n), s = r.replace.substring(n + 1);
|
|
2845
|
+
t[i] || (t[i] = {}), t[i][s] = a, u[a] = a;
|
|
2846
|
+
} else
|
|
2847
|
+
u[r.replace] = a;
|
|
2848
|
+
if (e) {
|
|
2849
|
+
const a = Wu[e];
|
|
2850
|
+
if (a) {
|
|
2851
|
+
for (const [r, n] of Object.entries(a))
|
|
2852
|
+
if (n.replace)
|
|
2853
|
+
if (n.replace.includes(".")) {
|
|
2854
|
+
const i = n.replace.lastIndexOf("."), s = n.replace.substring(0, i), o = n.replace.substring(i + 1);
|
|
2855
|
+
t[s] || (t[s] = {}), t[s][o] = r, u[r] = r;
|
|
2856
|
+
} else
|
|
2857
|
+
u[n.replace] = r;
|
|
2858
|
+
}
|
|
2859
|
+
}
|
|
2860
|
+
return { simple: u, member: t };
|
|
2861
|
+
}
|
|
2862
|
+
function Ut(e) {
|
|
2863
|
+
for (const u of e)
|
|
2864
|
+
if (xe.includes(u.from)) return u.from;
|
|
2865
|
+
}
|
|
2866
|
+
function Gt(e) {
|
|
2867
|
+
const u = {}, t = (a) => {
|
|
2868
|
+
for (const [r, n] of Object.entries(a)) {
|
|
2869
|
+
if (!n.composable || !n.replace || !n.replace.includes("."))
|
|
2870
|
+
continue;
|
|
2871
|
+
u[n.composable] || (u[n.composable] = {});
|
|
2872
|
+
const i = n.replace.substring(n.replace.lastIndexOf(".") + 1);
|
|
2873
|
+
u[n.composable][i] = r;
|
|
2874
|
+
}
|
|
2875
|
+
};
|
|
2876
|
+
if (t(gu), e) {
|
|
2877
|
+
const a = Wu[e];
|
|
2878
|
+
a && t(a);
|
|
2879
|
+
}
|
|
2880
|
+
return u;
|
|
2881
|
+
}
|
|
2882
|
+
function $u(e, u) {
|
|
2883
|
+
if (!e) return e;
|
|
2884
|
+
const t = {
|
|
2885
|
+
refs: new Set(u.refs),
|
|
2886
|
+
reactives: new Set(u.reactives),
|
|
2887
|
+
computed: new Set(u.computed),
|
|
2888
|
+
methods: new Set(u.methods),
|
|
2889
|
+
props: new Set(u.props),
|
|
2890
|
+
composables: new Set(u.composables),
|
|
2891
|
+
injects: new Set(u.injects),
|
|
2892
|
+
dataSources: new Set(u.dataSources),
|
|
2893
|
+
hasState: u.hasState,
|
|
2894
|
+
reverseApiMap: u.globalApiVars,
|
|
2895
|
+
reverseMemberApiMap: u.reverseMemberApiMap || ie().member
|
|
2896
|
+
};
|
|
2897
|
+
let a = Ft(e, t);
|
|
2898
|
+
a = a.replace(/_ctx\./g, "this."), a = a.replace(/this\.this\./g, "this.");
|
|
2899
|
+
for (const [r, n] of Object.entries(u.libs || {}))
|
|
2900
|
+
a = R(a, r, `this.$libs.${n}.${r}`);
|
|
2901
|
+
return a;
|
|
2902
|
+
}
|
|
2903
|
+
function Ht(e) {
|
|
2904
|
+
const u = Ut(e.imports || []), { simple: t, member: a } = ie(u);
|
|
2905
|
+
if (e.globalApiDestructured && e.globalApiDestructured.length > 0) {
|
|
2906
|
+
const n = Gt(u);
|
|
2907
|
+
for (const { callee: i, destructure: s } of e.globalApiDestructured) {
|
|
2908
|
+
const o = n[i];
|
|
2909
|
+
if (o)
|
|
2910
|
+
for (const c of s)
|
|
2911
|
+
o[c] && (t[c] = o[c]);
|
|
2912
|
+
}
|
|
2913
|
+
}
|
|
2914
|
+
const r = /* @__PURE__ */ new Set();
|
|
2915
|
+
for (const n of e.composables || [])
|
|
2916
|
+
if (n.destructure && n.destructure.length > 0)
|
|
2917
|
+
for (const i of n.destructure) r.add(i);
|
|
2918
|
+
else n.name && r.add(n.name);
|
|
2919
|
+
return {
|
|
2920
|
+
refs: new Set(Object.keys(e.refs || {})),
|
|
2921
|
+
reactives: new Set(Object.keys(e.reactives || {})),
|
|
2922
|
+
computed: new Set(Object.keys(e.computed || {})),
|
|
2923
|
+
methods: new Set(Object.keys(e.methods || {})),
|
|
2924
|
+
props: new Set(
|
|
2925
|
+
(e.props || []).map((n) => typeof n == "string" ? n : n.name)
|
|
2926
|
+
),
|
|
2927
|
+
composables: r,
|
|
2928
|
+
injects: new Set((e.inject || []).map((n) => n.name)),
|
|
2929
|
+
dataSources: new Set(Object.keys(e.dataSources || {})),
|
|
2930
|
+
hasState: Object.keys(e.state || {}).length > 0,
|
|
2931
|
+
reverseApiMap: t,
|
|
2932
|
+
reverseMemberApiMap: a
|
|
2933
|
+
};
|
|
2934
|
+
}
|
|
2935
|
+
const se = "arrow-double-left, arrow-double-right, contact, notes, records, cash-back-record, newspaper, discount, completed, user, description, list-switch, list-switching, link-o, miniprogram-o, qq, wechat-moments, weibo, cash-o, guide-o, invitation, shield-o, exchange, eye, enlarge, expand-o, eye-o, expand, filter-o, fire, fail, failure, fire-o, flag-o, font, font-o, gem-o, flower-o, gem, gift-card, friends, friends-o, gold-coin, gold-coin-o, good-job-o, gift, gift-o, gift-card-o, good-job, home-o, goods-collect, graphic, goods-collect-o, hot-o, info, hotel-o, info-o, hot-sale-o, hot, like, idcard, like-o, hot-sale, location-o, location, label, lock, label-o, map-marked, logistics, manager, more, live, manager-o, medal, more-o, music-o, music, new-arrival-o, medal-o, new-o, free-postage, newspaper-o, new-arrival, minus, orders-o, new, paid, notes-o, other-pay, pause-circle, pause, pause-circle-o, peer-pay, pending-payment, passed, plus, phone-circle-o, phone-o, printer, photo-fail, phone, photo-o, play-circle, play, phone-circle, point-gift-o, point-gift, play-circle-o, shrink, photo, qr, qr-invalid, question-o, revoke, replay, service, question, search, refund-o, service-o, scan, share, send-gift-o, share-o, setting, points, photograph, shop, shop-o, shop-collect-o, shop-collect, smile, shopping-cart-o, sign, sort, star-o, smile-comment-o, stop, stop-circle-o, smile-o, star, success, stop-circle, records-o, shopping-cart, tosend, todo-list, thumb-circle-o, thumb-circle, umbrella-circle, underway, upgrade, todo-list-o, tv-o, underway-o, user-o, vip-card-o, vip-card, send-gift, wap-home, wap-nav, volume-o, video, wap-home-o, volume, warning, weapp-nav, wechat-pay, wechat, setting-o, youzan-shield, warn-o, smile-comment, user-circle-o, video-o, add-square, add, arrow-down, arrow-up, arrow, after-sale, add-o, alipay, ascending, apps-o, aim, award, arrow-left, award-o, audio, bag-o, balance-list, back-top, bag, balance-pay, balance-o, bar-chart-o, bars, balance-list-o, birthday-cake-o, bookmark, bill, bell, browsing-history-o, browsing-history, bookmark-o, bulb-o, bullhorn-o, bill-o, calendar-o, brush-o, card, cart-o, cart-circle, cart-circle-o, cart, cash-on-deliver, cash-back-record-o, cashier-o, chart-trending-o, certificate, chat, clear, chat-o, checked, clock, clock-o, close, closed-eye, circle, cluster-o, column, comment-circle-o, cluster, comment, comment-o, comment-circle, completed-o, credit-pay, coupon, debit-pay, coupon-o, contact-o, descending, desktop-o, diamond-o, description-o, delete, diamond, delete-o, cross, edit, ellipsis, down, discount-o, ecard-pay, envelop-o".split(
|
|
2164
2936
|
", "
|
|
2165
|
-
),
|
|
2937
|
+
), Wt = "AddLocation, Aim, AlarmClock, Apple, ArrowDownBold, ArrowDown, ArrowLeftBold, ArrowLeft, ArrowRightBold, ArrowRight, ArrowUpBold, ArrowUp, Avatar, Back, Baseball, Basketball, BellFilled, Bell, Bicycle, BottomLeft, BottomRight, Bottom, Bowl, Box, Briefcase, BrushFilled, Brush, Burger, Calendar, CameraFilled, Camera, CaretBottom, CaretLeft, CaretRight, CaretTop, Cellphone, ChatDotRound, ChatDotSquare, ChatLineRound, ChatLineSquare, ChatRound, ChatSquare, Check, Checked, Cherry, Chicken, ChromeFilled, CircleCheckFilled, CircleCheck, CircleCloseFilled, CircleClose, CirclePlusFilled, CirclePlus, Clock, CloseBold, Close, Cloudy, CoffeeCup, Coffee, Coin, ColdDrink, CollectionTag, Collection, Comment, Compass, Connection, Coordinate, CopyDocument, Cpu, CreditCard, Crop, DArrowLeft, DArrowRight, DCaret, DataAnalysis, DataBoard, DataLine, DeleteFilled, DeleteLocation, Delete, Dessert, Discount, DishDot, Dish, DocumentAdd, DocumentChecked, DocumentCopy, DocumentDelete, DocumentRemove, Document, Download, Drizzling, EditPen, Edit, ElemeFilled, Eleme, ElementPlus, Expand, Failed, Female, Files, Film, Filter, Finished, FirstAidKit, Flag, Fold, FolderAdd, FolderChecked, FolderDelete, FolderOpened, FolderRemove, Folder, Food, Football, ForkSpoon, Fries, FullScreen, GobletFull, GobletSquareFull, GobletSquare, Goblet, GoldMedal, GoodsFilled, Goods, Grape, Grid, Guide, Handbag, Headset, HelpFilled, Help, Hide, Histogram, HomeFilled, HotWater, House, IceCreamRound, IceCreamSquare, IceCream, IceDrink, IceTea, InfoFilled, Iphone, Key, KnifeFork, Lightning, Link, List, Loading, LocationFilled, LocationInformation, Location, Lock, Lollipop, MagicStick, Magnet, Male, Management, MapLocation, Medal, Memo, Menu, MessageBox, Message, Mic, Microphone, MilkTea, Minus, Money, Monitor, MoonNight, Moon, MoreFilled, More, MostlyCloudy, Mouse, Mug, MuteNotification, Mute, NoSmoking, Notebook, Notification, Odometer, OfficeBuilding, Open, Operation, Opportunity, Orange, Paperclip, PartlyCloudy, Pear, PhoneFilled, Phone, PictureFilled, PictureRounded, Picture, PieChart, Place, Platform, Plus, Pointer, Position, Postcard, Pouring, Present, PriceTag, Printer, Promotion, QuartzWatch, QuestionFilled, Rank, ReadingLamp, Reading, RefreshLeft, RefreshRight, Refresh, Refrigerator, RemoveFilled, Remove, Right, ScaleToOriginal, School, Scissor, Search, Select, Sell, SemiSelect, Service, SetUp, Setting, Share, Ship, Shop, ShoppingBag, ShoppingCartFull, ShoppingCart, ShoppingTrolley, Smoking, Soccer, SoldOut, SortDown, SortUp, Sort, Stamp, StarFilled, Star, Stopwatch, SuccessFilled, Sugar, SuitcaseLine, Suitcase, Sunny, Sunrise, Sunset, SwitchButton, SwitchFilled, Switch, TakeawayBox, Ticket, Tickets, Timer, ToiletPaper, Tools, TopLeft, TopRight, Top, TrendCharts, TrophyBase, Trophy, TurnOff, Umbrella, Unlock, UploadFilled, Upload, UserFilled, User, Van, VideoCameraFilled, VideoCamera, VideoPause, VideoPlay, View, WalletFilled, Wallet, WarnTriangleFilled, WarningFilled, Warning, Watch, Watermelon, WindPower, ZoomIn, ZoomOut, VtjIconChatRecord, VtjIconNewChat, VtjIconAi, VtjIconUniapp, VtjIconWindowMax, VtjIconWindowMin, VtjIconWindowClose, VtjIconWindowNormal, VtjIconWindowDown, VtjIconWindowUp, VtjIconNpSave, VtjIconNpFile, VtjIconNpEdit, VtjIconNpShare, VtjIconNpSearch, VtjIconNpExport, VtjIconNpImport, VtjIconNpList, VtjIconNpPrint, VtjIconNpCancel, VtjIconNpConfirm, VtjIconNpReset, VtjIconNpReturnAll, VtjIconNpReturn, VtjIconNpRemove, VtjIconNpRemoveRow, VtjIconNpDelete, VtjIconNpExit, VtjIconNpRefresh, VtjIconNpAdd, VtjIconNpSelect, VtjIconNpAddRow, VtjIconNpExtend, VtjIconNpClose, VtjIconNpSubmit, VtjIconDeps, VtjIconBack, VtjIconHome, VtjIconApi, VtjIconExport, VtjIconImport, VtjIconGreater, VtjIconSmaller, VtjIconCheck, VtjIconSwitch, VtjIconCopy, VtjIconLock, VtjIconUnlock, VtjIconLayers, VtjIconConsole, VtjIconTeam, VtjIconPublish, VtjIconPreview, VtjIconSave, VtjIconPc, VtjIconPhone, VtjIconPad, VtjIconRedo, VtjIconRefresh, VtjIconUndo, VtjIconCategory, VtjIconProject, VtjIconNotice, VtjIconFav, VtjIconBug, VtjIconFile, VtjIconFolder, VtjIconUpload, VtjIconDownload, VtjIconUser, VtjIconSetting, VtjIconArrowRight, VtjIconArrowLeft, VtjIconArrowDown, VtjIconArrowUp, VtjIconShare, VtjIconData, VtjIconTemplate, VtjIconExitFullscreen, VtjIconFullscreen, VtjIconEdit, VtjIconRemove, VtjIconJs, VtjIconDatabase, VtjIconInfo, VtjIconPlus, VtjIconMinus, VtjIconHelp, VtjIconVars, VtjIconOutline, VtjIconVisible, VtjIconInvisible, VtjIconDocument, VtjIconHistory, VtjIconFixed, VtjIconUnfixed, VtjIconSearch, VtjIconMore, VtjIconClose, VtjIconComponents, VtjIconBlock".split(
|
|
2166
2938
|
", "
|
|
2167
|
-
),
|
|
2168
|
-
class
|
|
2939
|
+
), Jt = "user", L = "User";
|
|
2940
|
+
class Xt {
|
|
2169
2941
|
validate(u) {
|
|
2170
2942
|
const t = {
|
|
2171
2943
|
valid: !0,
|
|
@@ -2179,7 +2951,7 @@ class bt {
|
|
|
2179
2951
|
}
|
|
2180
2952
|
isCompleteSFC(u) {
|
|
2181
2953
|
try {
|
|
2182
|
-
const t =
|
|
2954
|
+
const t = P(u);
|
|
2183
2955
|
return !!(t.template && t.script && t.styles);
|
|
2184
2956
|
} catch {
|
|
2185
2957
|
return !1;
|
|
@@ -2188,63 +2960,65 @@ class bt {
|
|
|
2188
2960
|
checkSyntax(u) {
|
|
2189
2961
|
let t = "";
|
|
2190
2962
|
try {
|
|
2191
|
-
const a =
|
|
2192
|
-
|
|
2963
|
+
const a = P(u);
|
|
2964
|
+
B(a.script);
|
|
2193
2965
|
} catch (a) {
|
|
2194
2966
|
a instanceof SyntaxError && (t = a.message);
|
|
2195
2967
|
}
|
|
2196
2968
|
return t;
|
|
2197
2969
|
}
|
|
2198
2970
|
checkSetup(u) {
|
|
2199
|
-
const t =
|
|
2971
|
+
const t = P(u);
|
|
2972
|
+
if (t.isScriptSetup)
|
|
2973
|
+
return !0;
|
|
2200
2974
|
let a = 0;
|
|
2201
|
-
return
|
|
2202
|
-
ObjectMethod(
|
|
2203
|
-
|
|
2204
|
-
(
|
|
2975
|
+
return Ju(t.script, {
|
|
2976
|
+
ObjectMethod(r) {
|
|
2977
|
+
r.node.key.name === "setup" && (a = r.node.body.body.filter(
|
|
2978
|
+
(i) => !q.isEmptyStatement(i)
|
|
2205
2979
|
).length);
|
|
2206
2980
|
}
|
|
2207
2981
|
}), a === 3;
|
|
2208
2982
|
}
|
|
2209
2983
|
findVantIcons(u) {
|
|
2210
|
-
const t =
|
|
2211
|
-
return
|
|
2212
|
-
const
|
|
2213
|
-
|
|
2214
|
-
}), [...new Set(
|
|
2984
|
+
const t = P(u), a = /<(?:VanIcon|van-icon)\b[^>]*>/g, r = t.template.match(a) || [], n = [];
|
|
2985
|
+
return r.forEach((i) => {
|
|
2986
|
+
const s = i.match(/\bname="([^"]+)"/);
|
|
2987
|
+
s && n.push(s[1]);
|
|
2988
|
+
}), [...new Set(n)];
|
|
2215
2989
|
}
|
|
2216
2990
|
checkVantIcons(u) {
|
|
2217
2991
|
const t = this.findVantIcons(u), a = [];
|
|
2218
|
-
for (const
|
|
2219
|
-
|
|
2992
|
+
for (const r of t)
|
|
2993
|
+
se.includes(r) || a.push(r);
|
|
2220
2994
|
return a;
|
|
2221
2995
|
}
|
|
2222
2996
|
findVtjIcons(u) {
|
|
2223
|
-
const t =
|
|
2224
|
-
return !
|
|
2997
|
+
const t = P(u), a = /import\s*{([^}]+)}\s*from\s*['"]\@vtj\/icons['"]/, r = t.script.match(a);
|
|
2998
|
+
return !r || !r[1] ? [] : r[1].split(",").map((n) => n.trim()).filter(Boolean);
|
|
2225
2999
|
}
|
|
2226
3000
|
checkVtjIcons(u) {
|
|
2227
3001
|
const t = this.findVtjIcons(u), a = [];
|
|
2228
|
-
for (const
|
|
2229
|
-
|
|
3002
|
+
for (const r of t)
|
|
3003
|
+
Wt.includes(r) || a.push(r);
|
|
2230
3004
|
return a;
|
|
2231
3005
|
}
|
|
2232
3006
|
hasUnchangedComment(u) {
|
|
2233
|
-
const t = /<!--([\s\S]*?)-->/g, a = /\/\*([\s\S]*?)\*\//g,
|
|
3007
|
+
const t = /<!--([\s\S]*?)-->/g, a = /\/\*([\s\S]*?)\*\//g, r = /\/\/(.*)/g;
|
|
2234
3008
|
return [
|
|
2235
3009
|
...u.match(t) || [],
|
|
2236
3010
|
...u.match(a) || [],
|
|
2237
|
-
...u.match(
|
|
3011
|
+
...u.match(r) || []
|
|
2238
3012
|
].some(
|
|
2239
|
-
(
|
|
3013
|
+
(i) => /不变/.test(i.replace(/\*/g, ""))
|
|
2240
3014
|
// 移除多行注释的星号避免干扰
|
|
2241
3015
|
);
|
|
2242
3016
|
}
|
|
2243
3017
|
}
|
|
2244
|
-
function
|
|
3018
|
+
function zt(e) {
|
|
2245
3019
|
const u = [];
|
|
2246
3020
|
let t = e;
|
|
2247
|
-
const a =
|
|
3021
|
+
const a = P(e);
|
|
2248
3022
|
if (!a.template || !a.script)
|
|
2249
3023
|
return {
|
|
2250
3024
|
fixed: !1,
|
|
@@ -2252,208 +3026,208 @@ function ht(e) {
|
|
|
2252
3026
|
fixedCode: e,
|
|
2253
3027
|
changes: []
|
|
2254
3028
|
};
|
|
2255
|
-
const
|
|
2256
|
-
let
|
|
2257
|
-
const
|
|
2258
|
-
let
|
|
2259
|
-
for (; (
|
|
2260
|
-
const
|
|
2261
|
-
if (
|
|
2262
|
-
const
|
|
2263
|
-
|
|
2264
|
-
start:
|
|
2265
|
-
end:
|
|
2266
|
-
original:
|
|
2267
|
-
replacement: `{{${
|
|
2268
|
-
line:
|
|
2269
|
-
column:
|
|
3029
|
+
const r = Qt(a.script), n = a.template;
|
|
3030
|
+
let i = n;
|
|
3031
|
+
const s = [], o = /\{\{([^}]+)\}\}/g;
|
|
3032
|
+
let c;
|
|
3033
|
+
for (; (c = o.exec(n)) !== null; ) {
|
|
3034
|
+
const m = c[0], y = c[1], x = H(y, r);
|
|
3035
|
+
if (x !== y) {
|
|
3036
|
+
const w = G(n, c.index);
|
|
3037
|
+
s.push({
|
|
3038
|
+
start: c.index,
|
|
3039
|
+
end: c.index + m.length,
|
|
3040
|
+
original: m,
|
|
3041
|
+
replacement: `{{${x}}}`,
|
|
3042
|
+
line: w.line,
|
|
3043
|
+
column: w.column
|
|
2270
3044
|
}), u.push({
|
|
2271
|
-
line:
|
|
2272
|
-
column:
|
|
2273
|
-
original:
|
|
2274
|
-
fixed:
|
|
3045
|
+
line: w.line + 1,
|
|
3046
|
+
column: w.column,
|
|
3047
|
+
original: y.trim(),
|
|
3048
|
+
fixed: x.trim(),
|
|
2275
3049
|
message: "修复插值表达式:添加 state. 前缀"
|
|
2276
3050
|
});
|
|
2277
3051
|
}
|
|
2278
3052
|
}
|
|
2279
|
-
const
|
|
2280
|
-
for (; (
|
|
2281
|
-
const
|
|
2282
|
-
if (
|
|
2283
|
-
const
|
|
2284
|
-
|
|
2285
|
-
start:
|
|
2286
|
-
end:
|
|
2287
|
-
original:
|
|
2288
|
-
replacement: `:${
|
|
2289
|
-
line:
|
|
2290
|
-
column:
|
|
3053
|
+
const d = /:(\w+)="([^"]+)"/g;
|
|
3054
|
+
for (; (c = d.exec(n)) !== null; ) {
|
|
3055
|
+
const m = c[0], y = c[1], x = c[2], w = H(x, r);
|
|
3056
|
+
if (w !== x) {
|
|
3057
|
+
const I = G(n, c.index);
|
|
3058
|
+
s.push({
|
|
3059
|
+
start: c.index,
|
|
3060
|
+
end: c.index + m.length,
|
|
3061
|
+
original: m,
|
|
3062
|
+
replacement: `:${y}="${w}"`,
|
|
3063
|
+
line: I.line,
|
|
3064
|
+
column: I.column
|
|
2291
3065
|
}), u.push({
|
|
2292
|
-
line:
|
|
2293
|
-
column:
|
|
2294
|
-
original:
|
|
2295
|
-
fixed:
|
|
3066
|
+
line: I.line + 1,
|
|
3067
|
+
column: I.column,
|
|
3068
|
+
original: x,
|
|
3069
|
+
fixed: w,
|
|
2296
3070
|
message: "修复绑定属性:添加 state. 前缀"
|
|
2297
3071
|
});
|
|
2298
3072
|
}
|
|
2299
3073
|
}
|
|
2300
3074
|
const l = /v-(if|else-if|show)="([^"]+)"/g;
|
|
2301
|
-
for (; (
|
|
2302
|
-
const
|
|
2303
|
-
if (
|
|
2304
|
-
const
|
|
2305
|
-
|
|
2306
|
-
start:
|
|
2307
|
-
end:
|
|
2308
|
-
original:
|
|
2309
|
-
replacement: `v-${
|
|
2310
|
-
line:
|
|
2311
|
-
column:
|
|
3075
|
+
for (; (c = l.exec(n)) !== null; ) {
|
|
3076
|
+
const m = c[0], y = c[1], x = c[2], w = H(x, r);
|
|
3077
|
+
if (w !== x) {
|
|
3078
|
+
const I = G(n, c.index);
|
|
3079
|
+
s.push({
|
|
3080
|
+
start: c.index,
|
|
3081
|
+
end: c.index + m.length,
|
|
3082
|
+
original: m,
|
|
3083
|
+
replacement: `v-${y}="${w}"`,
|
|
3084
|
+
line: I.line,
|
|
3085
|
+
column: I.column
|
|
2312
3086
|
}), u.push({
|
|
2313
|
-
line:
|
|
2314
|
-
column:
|
|
2315
|
-
original:
|
|
2316
|
-
fixed:
|
|
2317
|
-
message: `修复 v-${
|
|
3087
|
+
line: I.line + 1,
|
|
3088
|
+
column: I.column,
|
|
3089
|
+
original: x,
|
|
3090
|
+
fixed: w,
|
|
3091
|
+
message: `修复 v-${y} 指令:添加 state. 前缀`
|
|
2318
3092
|
});
|
|
2319
3093
|
}
|
|
2320
3094
|
}
|
|
2321
|
-
const
|
|
2322
|
-
for (; (
|
|
2323
|
-
const
|
|
2324
|
-
if (
|
|
2325
|
-
const [,
|
|
2326
|
-
|
|
2327
|
-
|
|
3095
|
+
const p = /v-for="([^"]+)"/g;
|
|
3096
|
+
for (; (c = p.exec(n)) !== null; ) {
|
|
3097
|
+
const m = c[0], x = c[1].match(/^(.+)\s+in\s+(.+)$/);
|
|
3098
|
+
if (x) {
|
|
3099
|
+
const [, w, I] = x, D = H(
|
|
3100
|
+
I,
|
|
3101
|
+
r
|
|
2328
3102
|
);
|
|
2329
|
-
if (
|
|
2330
|
-
const
|
|
2331
|
-
|
|
2332
|
-
start:
|
|
2333
|
-
end:
|
|
2334
|
-
original:
|
|
2335
|
-
replacement:
|
|
2336
|
-
line:
|
|
2337
|
-
column:
|
|
3103
|
+
if (D !== I) {
|
|
3104
|
+
const F = G(n, c.index), lu = `v-for="${w} in ${D}"`;
|
|
3105
|
+
s.push({
|
|
3106
|
+
start: c.index,
|
|
3107
|
+
end: c.index + m.length,
|
|
3108
|
+
original: m,
|
|
3109
|
+
replacement: lu,
|
|
3110
|
+
line: F.line,
|
|
3111
|
+
column: F.column
|
|
2338
3112
|
}), u.push({
|
|
2339
|
-
line:
|
|
2340
|
-
column:
|
|
2341
|
-
original:
|
|
2342
|
-
fixed:
|
|
3113
|
+
line: F.line + 1,
|
|
3114
|
+
column: F.column,
|
|
3115
|
+
original: I,
|
|
3116
|
+
fixed: D,
|
|
2343
3117
|
message: "修复 v-for 指令:添加 state. 前缀"
|
|
2344
3118
|
});
|
|
2345
3119
|
}
|
|
2346
3120
|
}
|
|
2347
3121
|
}
|
|
2348
|
-
const
|
|
2349
|
-
for (; (
|
|
2350
|
-
const
|
|
2351
|
-
if (
|
|
2352
|
-
const
|
|
2353
|
-
|
|
2354
|
-
start:
|
|
2355
|
-
end:
|
|
2356
|
-
original:
|
|
2357
|
-
replacement: `v-model="${
|
|
2358
|
-
line:
|
|
2359
|
-
column:
|
|
3122
|
+
const b = /v-model="([^"]+)"/g;
|
|
3123
|
+
for (; (c = b.exec(n)) !== null; ) {
|
|
3124
|
+
const m = c[0], y = c[1], x = H(y, r);
|
|
3125
|
+
if (x !== y) {
|
|
3126
|
+
const w = G(n, c.index);
|
|
3127
|
+
s.push({
|
|
3128
|
+
start: c.index,
|
|
3129
|
+
end: c.index + m.length,
|
|
3130
|
+
original: m,
|
|
3131
|
+
replacement: `v-model="${x}"`,
|
|
3132
|
+
line: w.line,
|
|
3133
|
+
column: w.column
|
|
2360
3134
|
}), u.push({
|
|
2361
|
-
line:
|
|
2362
|
-
column:
|
|
2363
|
-
original:
|
|
2364
|
-
fixed:
|
|
3135
|
+
line: w.line + 1,
|
|
3136
|
+
column: w.column,
|
|
3137
|
+
original: y,
|
|
3138
|
+
fixed: x,
|
|
2365
3139
|
message: "修复 v-model 指令:添加 state. 前缀"
|
|
2366
3140
|
});
|
|
2367
3141
|
}
|
|
2368
3142
|
}
|
|
2369
|
-
const
|
|
2370
|
-
for (; (
|
|
2371
|
-
const
|
|
2372
|
-
if (
|
|
2373
|
-
const
|
|
2374
|
-
|
|
2375
|
-
start:
|
|
2376
|
-
end:
|
|
2377
|
-
original:
|
|
2378
|
-
replacement: `v-bind="${
|
|
2379
|
-
line:
|
|
2380
|
-
column:
|
|
3143
|
+
const h = /v-bind="([^"]+)"/g;
|
|
3144
|
+
for (; (c = h.exec(n)) !== null; ) {
|
|
3145
|
+
const m = c[0], y = c[1], x = H(y, r);
|
|
3146
|
+
if (x !== y) {
|
|
3147
|
+
const w = G(n, c.index);
|
|
3148
|
+
s.push({
|
|
3149
|
+
start: c.index,
|
|
3150
|
+
end: c.index + m.length,
|
|
3151
|
+
original: m,
|
|
3152
|
+
replacement: `v-bind="${x}"`,
|
|
3153
|
+
line: w.line,
|
|
3154
|
+
column: w.column
|
|
2381
3155
|
}), u.push({
|
|
2382
|
-
line:
|
|
2383
|
-
column:
|
|
2384
|
-
original:
|
|
2385
|
-
fixed:
|
|
3156
|
+
line: w.line + 1,
|
|
3157
|
+
column: w.column,
|
|
3158
|
+
original: y,
|
|
3159
|
+
fixed: x,
|
|
2386
3160
|
message: "修复 v-bind 指令:添加 state. 前缀"
|
|
2387
3161
|
});
|
|
2388
3162
|
}
|
|
2389
3163
|
}
|
|
2390
|
-
const
|
|
2391
|
-
for (; (
|
|
2392
|
-
const
|
|
2393
|
-
if (
|
|
2394
|
-
const
|
|
2395
|
-
|
|
2396
|
-
start:
|
|
2397
|
-
end:
|
|
2398
|
-
original:
|
|
2399
|
-
replacement: `v-${
|
|
2400
|
-
line:
|
|
2401
|
-
column:
|
|
3164
|
+
const S = /v-(text|html)="([^"]+)"/g;
|
|
3165
|
+
for (; (c = S.exec(n)) !== null; ) {
|
|
3166
|
+
const m = c[0], y = c[1], x = c[2], w = H(x, r);
|
|
3167
|
+
if (w !== x) {
|
|
3168
|
+
const I = G(n, c.index);
|
|
3169
|
+
s.push({
|
|
3170
|
+
start: c.index,
|
|
3171
|
+
end: c.index + m.length,
|
|
3172
|
+
original: m,
|
|
3173
|
+
replacement: `v-${y}="${w}"`,
|
|
3174
|
+
line: I.line,
|
|
3175
|
+
column: I.column
|
|
2402
3176
|
}), u.push({
|
|
2403
|
-
line:
|
|
2404
|
-
column:
|
|
2405
|
-
original:
|
|
2406
|
-
fixed:
|
|
2407
|
-
message: `修复 v-${
|
|
3177
|
+
line: I.line + 1,
|
|
3178
|
+
column: I.column,
|
|
3179
|
+
original: x,
|
|
3180
|
+
fixed: w,
|
|
3181
|
+
message: `修复 v-${y} 指令:添加 state. 前缀`
|
|
2408
3182
|
});
|
|
2409
3183
|
}
|
|
2410
3184
|
}
|
|
2411
|
-
const
|
|
2412
|
-
for (; (
|
|
2413
|
-
const
|
|
2414
|
-
if (
|
|
2415
|
-
const
|
|
2416
|
-
|
|
2417
|
-
start:
|
|
2418
|
-
end:
|
|
2419
|
-
original:
|
|
2420
|
-
replacement: `${
|
|
2421
|
-
line:
|
|
2422
|
-
column:
|
|
3185
|
+
const E = /(@|v-on:)(\w+)="([^"]+)"/g;
|
|
3186
|
+
for (; (c = E.exec(n)) !== null; ) {
|
|
3187
|
+
const m = c[0], y = c[1], x = c[2], w = c[3], I = Zt(w, r);
|
|
3188
|
+
if (I !== w) {
|
|
3189
|
+
const D = G(n, c.index);
|
|
3190
|
+
s.push({
|
|
3191
|
+
start: c.index,
|
|
3192
|
+
end: c.index + m.length,
|
|
3193
|
+
original: m,
|
|
3194
|
+
replacement: `${y}${x}="${I}"`,
|
|
3195
|
+
line: D.line,
|
|
3196
|
+
column: D.column
|
|
2423
3197
|
}), u.push({
|
|
2424
|
-
line:
|
|
2425
|
-
column:
|
|
2426
|
-
original:
|
|
2427
|
-
fixed:
|
|
3198
|
+
line: D.line + 1,
|
|
3199
|
+
column: D.column,
|
|
3200
|
+
original: w,
|
|
3201
|
+
fixed: I,
|
|
2428
3202
|
message: "修复事件处理器:添加 state. 前缀"
|
|
2429
3203
|
});
|
|
2430
3204
|
}
|
|
2431
3205
|
}
|
|
2432
|
-
if (
|
|
2433
|
-
|
|
2434
|
-
}),
|
|
2435
|
-
const
|
|
2436
|
-
t = e.substring(0,
|
|
2437
|
-
` +
|
|
2438
|
-
</template>` + e.substring(
|
|
3206
|
+
if (s.sort((m, y) => y.start - m.start), s.forEach((m) => {
|
|
3207
|
+
i = i.substring(0, m.start) + m.replacement + i.substring(m.end);
|
|
3208
|
+
}), s.length > 0) {
|
|
3209
|
+
const m = e.indexOf("<template>"), y = e.lastIndexOf("</template>") + 11;
|
|
3210
|
+
t = e.substring(0, m) + `<template>
|
|
3211
|
+
` + i + `
|
|
3212
|
+
</template>` + e.substring(y);
|
|
2439
3213
|
}
|
|
2440
3214
|
return {
|
|
2441
|
-
fixed:
|
|
3215
|
+
fixed: s.length > 0,
|
|
2442
3216
|
originalCode: e,
|
|
2443
3217
|
fixedCode: t,
|
|
2444
3218
|
changes: u
|
|
2445
3219
|
};
|
|
2446
3220
|
}
|
|
2447
|
-
function
|
|
3221
|
+
function Qt(e) {
|
|
2448
3222
|
const u = /* @__PURE__ */ new Set();
|
|
2449
3223
|
try {
|
|
2450
|
-
const t =
|
|
2451
|
-
|
|
3224
|
+
const t = B(e);
|
|
3225
|
+
J(t, {
|
|
2452
3226
|
CallExpression(a) {
|
|
2453
3227
|
if (a.node.callee.type === "Identifier" && a.node.callee.name === "reactive" && a.node.arguments.length > 0 && a.node.arguments[0].type === "ObjectExpression") {
|
|
2454
|
-
const
|
|
2455
|
-
|
|
2456
|
-
|
|
3228
|
+
const r = a.parent;
|
|
3229
|
+
r.type === "VariableDeclarator" && r.id.type === "Identifier" && r.id.name === "state" && a.node.arguments[0].properties.forEach((i) => {
|
|
3230
|
+
i.type === "ObjectProperty" && i.key.type === "Identifier" && u.add(i.key.name);
|
|
2457
3231
|
});
|
|
2458
3232
|
}
|
|
2459
3233
|
}
|
|
@@ -2463,27 +3237,27 @@ function pt(e) {
|
|
|
2463
3237
|
}
|
|
2464
3238
|
return u;
|
|
2465
3239
|
}
|
|
2466
|
-
function
|
|
3240
|
+
function H(e, u) {
|
|
2467
3241
|
let t = e.trim();
|
|
2468
3242
|
return u.forEach((a) => {
|
|
2469
|
-
const
|
|
2470
|
-
|
|
3243
|
+
const r = new RegExp(`(?<![\\w.])${a}(?![\\w])`, "g");
|
|
3244
|
+
r.test(t) && !t.includes(`state.${a}`) && (t = t.replace(r, `state.${a}`));
|
|
2471
3245
|
}), t;
|
|
2472
3246
|
}
|
|
2473
|
-
function
|
|
3247
|
+
function Zt(e, u) {
|
|
2474
3248
|
let t = e.trim();
|
|
2475
3249
|
return u.forEach((a) => {
|
|
2476
|
-
const
|
|
3250
|
+
const r = new RegExp(
|
|
2477
3251
|
`(?<![\\w.])${a}(\\+\\+|--|\\s*[+\\-*/]=)`,
|
|
2478
3252
|
"g"
|
|
2479
|
-
),
|
|
3253
|
+
), n = new RegExp(
|
|
2480
3254
|
`(\\+\\+|--)?(?<![\\w.])${a}(?![\\w])`,
|
|
2481
3255
|
"g"
|
|
2482
3256
|
);
|
|
2483
|
-
t.includes(`state.${a}`) || (t = t.replace(
|
|
2484
|
-
}),
|
|
3257
|
+
t.includes(`state.${a}`) || (t = t.replace(r, `state.${a}$1`), t = t.replace(n, (i, s) => s ? `${s}state.${a}` : i.includes(a) && !i.includes("state.") ? `state.${a}` : i));
|
|
3258
|
+
}), H(t, u);
|
|
2485
3259
|
}
|
|
2486
|
-
function
|
|
3260
|
+
function G(e, u) {
|
|
2487
3261
|
const t = e.substring(0, u).split(`
|
|
2488
3262
|
`);
|
|
2489
3263
|
return {
|
|
@@ -2491,51 +3265,52 @@ function P(e, u) {
|
|
|
2491
3265
|
column: t[t.length - 1].length
|
|
2492
3266
|
};
|
|
2493
3267
|
}
|
|
2494
|
-
class
|
|
3268
|
+
class Kt {
|
|
2495
3269
|
fixBasedOnValidation(u, t) {
|
|
2496
3270
|
let a = u;
|
|
2497
|
-
return t.illegalVantIcons.length && (a = this.fixVantIcons(a)), t.illegalVtjIcons.length && (a = this.fixVtjIcons(a, t.illegalVtjIcons)),
|
|
3271
|
+
return t.illegalVantIcons.length && (a = this.fixVantIcons(a)), t.illegalVtjIcons.length && (a = this.fixVtjIcons(a, t.illegalVtjIcons)), zt(a).fixedCode;
|
|
2498
3272
|
}
|
|
2499
3273
|
fixVantIcons(u) {
|
|
2500
|
-
const t =
|
|
3274
|
+
const t = P(u), a = t.template.replace(
|
|
2501
3275
|
/<(?:VanIcon|van-icon)\s+[^>]*name="([^"]+)"[^>]*>/g,
|
|
2502
|
-
(
|
|
3276
|
+
(r, n) => r.includes(":name=") || r.includes("v-bind:name=") || se.includes(n) ? r : r.replace(n, Jt)
|
|
2503
3277
|
);
|
|
2504
3278
|
return this.reconstructSFC(t, a, t.script);
|
|
2505
3279
|
}
|
|
2506
3280
|
fixVtjIcons(u, t = []) {
|
|
2507
|
-
const a =
|
|
2508
|
-
|
|
3281
|
+
const a = P(u);
|
|
3282
|
+
let r = !1;
|
|
3283
|
+
a.script = Ju(a.script, {
|
|
2509
3284
|
ImportDeclaration(s) {
|
|
2510
3285
|
if (s.node.source.value === "@vtj/icons") {
|
|
2511
|
-
const
|
|
2512
|
-
let
|
|
2513
|
-
for (const
|
|
2514
|
-
const
|
|
2515
|
-
|
|
2516
|
-
|
|
3286
|
+
const o = s.node.specifiers, c = [];
|
|
3287
|
+
let d = !1;
|
|
3288
|
+
for (const l of o) {
|
|
3289
|
+
const p = l.imported?.name;
|
|
3290
|
+
p === L && (d = !0, r = !0), t.includes(p) || c.push(
|
|
3291
|
+
q.importSpecifier(l.local, l.imported)
|
|
2517
3292
|
);
|
|
2518
3293
|
}
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
3294
|
+
!d && !r && (r = !0, c.push(
|
|
3295
|
+
q.importSpecifier(
|
|
3296
|
+
q.identifier(L),
|
|
3297
|
+
q.identifier(L)
|
|
2523
3298
|
)
|
|
2524
|
-
), s.node.specifiers =
|
|
3299
|
+
)), s.node.specifiers = c;
|
|
2525
3300
|
}
|
|
2526
3301
|
},
|
|
2527
3302
|
ObjectMethod(s) {
|
|
2528
3303
|
if (s.node.key.name === "setup") {
|
|
2529
|
-
const
|
|
2530
|
-
for (const
|
|
2531
|
-
if (
|
|
2532
|
-
const
|
|
2533
|
-
|
|
2534
|
-
(
|
|
2535
|
-
),
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
3304
|
+
const o = s.node.body.body;
|
|
3305
|
+
for (const c of o)
|
|
3306
|
+
if (q.isReturnStatement(c) && q.isObjectExpression(c.argument)) {
|
|
3307
|
+
const d = c.argument.properties || [];
|
|
3308
|
+
c.argument.properties = d.filter(
|
|
3309
|
+
(l) => !t.includes(l.key.name)
|
|
3310
|
+
), c.argument.properties.push(
|
|
3311
|
+
q.objectProperty(
|
|
3312
|
+
q.identifier(L),
|
|
3313
|
+
q.identifier(L),
|
|
2539
3314
|
!1,
|
|
2540
3315
|
!0
|
|
2541
3316
|
)
|
|
@@ -2544,104 +3319,127 @@ class xt {
|
|
|
2544
3319
|
}
|
|
2545
3320
|
},
|
|
2546
3321
|
ObjectProperty(s) {
|
|
2547
|
-
if (
|
|
2548
|
-
const
|
|
2549
|
-
s.node.value.elements =
|
|
3322
|
+
if (q.isIdentifier(s.node.value) && t.includes(s.node.value.name) && (s.node.value = q.identifier(L)), q.isArrayExpression(s.node.value)) {
|
|
3323
|
+
const o = s.node.value.elements;
|
|
3324
|
+
s.node.value.elements = o.map((c) => q.isIdentifier(c) && t.includes(c.name) ? q.identifier(L) : c);
|
|
2550
3325
|
}
|
|
2551
3326
|
},
|
|
2552
3327
|
AssignmentExpression(s) {
|
|
2553
|
-
|
|
3328
|
+
q.isIdentifier(s.node.right) && t.includes(s.node.right.name) && (s.node.right = q.identifier(L));
|
|
2554
3329
|
}
|
|
2555
3330
|
});
|
|
2556
|
-
const
|
|
2557
|
-
if (
|
|
2558
|
-
for (const s of
|
|
2559
|
-
let
|
|
2560
|
-
for (const
|
|
2561
|
-
|
|
2562
|
-
a.template = a.template.replace(s,
|
|
3331
|
+
const n = /:icon\s*=\s*["']([^"']+)["']/g, i = a.template.match(n);
|
|
3332
|
+
if (i)
|
|
3333
|
+
for (const s of i) {
|
|
3334
|
+
let o = s;
|
|
3335
|
+
for (const c of t)
|
|
3336
|
+
o = o.replace(new RegExp(c, "g"), L);
|
|
3337
|
+
a.template = a.template.replace(s, o);
|
|
2563
3338
|
}
|
|
2564
3339
|
for (const s of t)
|
|
2565
3340
|
a.template = a.template.replace(
|
|
2566
3341
|
new RegExp(`:icon="${s}"`, "g"),
|
|
2567
|
-
`:icon="${
|
|
3342
|
+
`:icon="${L}"`
|
|
2568
3343
|
);
|
|
2569
3344
|
return this.reconstructSFC(a, a.template, a.script);
|
|
2570
3345
|
}
|
|
2571
3346
|
reconstructSFC(u, t, a) {
|
|
2572
|
-
let
|
|
2573
|
-
|
|
3347
|
+
let r = "";
|
|
3348
|
+
if (t && u.template && (r += `<template>
|
|
2574
3349
|
${t}
|
|
2575
3350
|
</template>
|
|
2576
3351
|
|
|
2577
|
-
`), a && u.script
|
|
3352
|
+
`), a && u.script) {
|
|
3353
|
+
const n = u.isScriptSetup ? " setup" : "";
|
|
3354
|
+
r += `<script${n}>
|
|
2578
3355
|
${a}
|
|
2579
3356
|
<\/script>
|
|
2580
3357
|
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
3358
|
+
`;
|
|
3359
|
+
}
|
|
3360
|
+
return u.styles.forEach((n) => {
|
|
3361
|
+
r += `<style lang="scss" scoped>
|
|
3362
|
+
`, r += `${n}
|
|
3363
|
+
`, r += `</style>
|
|
2585
3364
|
|
|
2586
3365
|
`;
|
|
2587
|
-
}),
|
|
3366
|
+
}), r;
|
|
2588
3367
|
}
|
|
2589
3368
|
}
|
|
2590
|
-
async function
|
|
2591
|
-
const { id: u, name: t, source: a, project:
|
|
2592
|
-
if (
|
|
2593
|
-
return Promise.reject(
|
|
2594
|
-
const { dependencies:
|
|
3369
|
+
async function b0(e) {
|
|
3370
|
+
const { id: u, name: t, source: a, project: r } = e, n = ke(a, t);
|
|
3371
|
+
if (n)
|
|
3372
|
+
return Promise.reject(n);
|
|
3373
|
+
const { dependencies: i = [], platform: s = "web" } = r || {}, o = new Xt(), c = new Kt(), d = o.validate(a);
|
|
2595
3374
|
let l = [];
|
|
2596
|
-
if (!
|
|
2597
|
-
return l =
|
|
2598
|
-
const
|
|
2599
|
-
|
|
2600
|
-
css: A,
|
|
2601
|
-
errors: H
|
|
2602
|
-
} = dt(h.styles.join(`
|
|
2603
|
-
`));
|
|
2604
|
-
if (l.push(...H), l.length)
|
|
2605
|
-
return Promise.reject(l);
|
|
3375
|
+
if (!d.valid)
|
|
3376
|
+
return l = d.errors, Promise.reject(l);
|
|
3377
|
+
const p = c.fixBasedOnValidation(a, d), b = P(p);
|
|
3378
|
+
b.script = Ae(b.script);
|
|
2606
3379
|
const {
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
emits: G,
|
|
2614
|
-
expose: tu,
|
|
2615
|
-
inject: Uu,
|
|
2616
|
-
handlers: Hu,
|
|
2617
|
-
imports: lu,
|
|
2618
|
-
dataSources: Gu,
|
|
2619
|
-
directives: Wu
|
|
2620
|
-
} = Fe(h.script, i), { nodes: Ju, slots: Xu, context: zu } = tt(u, t, h.template, {
|
|
2621
|
-
platform: c,
|
|
2622
|
-
handlers: Hu,
|
|
2623
|
-
styles: I,
|
|
2624
|
-
imports: lu,
|
|
2625
|
-
directives: Wu
|
|
2626
|
-
}), bu = {
|
|
3380
|
+
styles: h,
|
|
3381
|
+
css: S,
|
|
3382
|
+
errors: E
|
|
3383
|
+
} = Ot(b.styles.join(`
|
|
3384
|
+
`));
|
|
3385
|
+
return l.push(...E), l.length ? Promise.reject(l) : b.isScriptSetup ? u0(b, {
|
|
2627
3386
|
id: u,
|
|
2628
3387
|
name: t,
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
css:
|
|
2642
|
-
}
|
|
2643
|
-
|
|
2644
|
-
|
|
3388
|
+
project: r,
|
|
3389
|
+
platform: s,
|
|
3390
|
+
dependencies: i,
|
|
3391
|
+
styles: h,
|
|
3392
|
+
css: S
|
|
3393
|
+
}) : Yt(b, {
|
|
3394
|
+
id: u,
|
|
3395
|
+
name: t,
|
|
3396
|
+
project: r,
|
|
3397
|
+
platform: s,
|
|
3398
|
+
dependencies: i,
|
|
3399
|
+
styles: h,
|
|
3400
|
+
css: S
|
|
3401
|
+
});
|
|
3402
|
+
}
|
|
3403
|
+
async function Yt(e, u) {
|
|
3404
|
+
const { id: t, name: a, project: r, platform: n, dependencies: i, styles: s, css: o } = u, {
|
|
3405
|
+
state: c,
|
|
3406
|
+
watch: d,
|
|
3407
|
+
lifeCycles: l,
|
|
3408
|
+
computed: p,
|
|
3409
|
+
methods: b,
|
|
3410
|
+
props: h,
|
|
3411
|
+
emits: S,
|
|
3412
|
+
expose: E,
|
|
3413
|
+
inject: m,
|
|
3414
|
+
handlers: y,
|
|
3415
|
+
imports: x,
|
|
3416
|
+
dataSources: w,
|
|
3417
|
+
directives: I
|
|
3418
|
+
} = et(e.script, r), { nodes: D, slots: F, context: lu } = re(t, a, e.template, {
|
|
3419
|
+
platform: n,
|
|
3420
|
+
handlers: y,
|
|
3421
|
+
styles: s,
|
|
3422
|
+
imports: x,
|
|
3423
|
+
directives: I
|
|
3424
|
+
}), yu = {
|
|
3425
|
+
id: t,
|
|
3426
|
+
name: a,
|
|
3427
|
+
inject: m,
|
|
3428
|
+
props: h,
|
|
3429
|
+
state: c,
|
|
3430
|
+
watch: d,
|
|
3431
|
+
lifeCycles: l,
|
|
3432
|
+
computed: p,
|
|
3433
|
+
methods: b,
|
|
3434
|
+
dataSources: w,
|
|
3435
|
+
slots: F,
|
|
3436
|
+
emits: S,
|
|
3437
|
+
expose: E,
|
|
3438
|
+
nodes: D,
|
|
3439
|
+
css: o
|
|
3440
|
+
}, le = Object.keys(p || {}), fe = (h || []).map(
|
|
3441
|
+
($) => typeof $ == "string" ? $ : $.name
|
|
3442
|
+
), be = [
|
|
2645
3443
|
"$el",
|
|
2646
3444
|
"$emit",
|
|
2647
3445
|
"$nextTick",
|
|
@@ -2657,113 +3455,186 @@ async function Dt(e) {
|
|
|
2657
3455
|
"state",
|
|
2658
3456
|
"$props",
|
|
2659
3457
|
"props",
|
|
2660
|
-
...Object.keys(
|
|
2661
|
-
], { libs:
|
|
2662
|
-
platform:
|
|
2663
|
-
context:
|
|
2664
|
-
computed:
|
|
2665
|
-
libs:
|
|
2666
|
-
members:
|
|
2667
|
-
props:
|
|
3458
|
+
...Object.keys(b || {})
|
|
3459
|
+
], { libs: pe } = de(x, i), Su = {
|
|
3460
|
+
platform: n,
|
|
3461
|
+
context: lu,
|
|
3462
|
+
computed: le,
|
|
3463
|
+
libs: pe,
|
|
3464
|
+
members: be,
|
|
3465
|
+
props: fe
|
|
3466
|
+
};
|
|
3467
|
+
return await ce(
|
|
3468
|
+
yu,
|
|
3469
|
+
async ($) => {
|
|
3470
|
+
await oe($, async (K) => {
|
|
3471
|
+
if (du(K)) {
|
|
3472
|
+
const he = await ru(K.value);
|
|
3473
|
+
K.value = Iu(he, $.id, Su);
|
|
3474
|
+
}
|
|
3475
|
+
});
|
|
3476
|
+
},
|
|
3477
|
+
async ($) => {
|
|
3478
|
+
const K = await ru($.value);
|
|
3479
|
+
$.value = Iu(K, "", Su);
|
|
3480
|
+
}
|
|
3481
|
+
), new Hu(yu).toDsl();
|
|
3482
|
+
}
|
|
3483
|
+
async function u0(e, u) {
|
|
3484
|
+
const { id: t, name: a, project: r, platform: n, styles: i, css: s, dependencies: o } = u, c = Nt(e.script, r), { nodes: d, slots: l, context: p } = re(t, a, e.template, {
|
|
3485
|
+
platform: n,
|
|
3486
|
+
handlers: c.handlers,
|
|
3487
|
+
styles: i,
|
|
3488
|
+
imports: c.imports,
|
|
3489
|
+
directives: c.directives
|
|
3490
|
+
}), b = {
|
|
3491
|
+
id: t,
|
|
3492
|
+
name: a,
|
|
3493
|
+
apiMode: "composition",
|
|
3494
|
+
inject: c.inject,
|
|
3495
|
+
props: c.props,
|
|
3496
|
+
state: c.state,
|
|
3497
|
+
refs: c.refs,
|
|
3498
|
+
reactives: c.reactives,
|
|
3499
|
+
composables: c.composables,
|
|
3500
|
+
setup: c.setup,
|
|
3501
|
+
provide: c.provide,
|
|
3502
|
+
watch: c.watch,
|
|
3503
|
+
lifeCycles: c.lifeCycles,
|
|
3504
|
+
computed: c.computed,
|
|
3505
|
+
methods: c.methods,
|
|
3506
|
+
dataSources: c.dataSources,
|
|
3507
|
+
slots: l,
|
|
3508
|
+
emits: c.emits,
|
|
3509
|
+
expose: c.expose,
|
|
3510
|
+
nodes: d,
|
|
3511
|
+
css: s
|
|
3512
|
+
}, { libs: h } = de(c.imports, o), S = Ht(c), E = {
|
|
3513
|
+
refs: Array.from(S.refs),
|
|
3514
|
+
reactives: Array.from(S.reactives),
|
|
3515
|
+
hasState: S.hasState,
|
|
3516
|
+
computed: Array.from(S.computed),
|
|
3517
|
+
methods: Array.from(S.methods),
|
|
3518
|
+
props: Array.from(S.props),
|
|
3519
|
+
composables: Array.from(S.composables),
|
|
3520
|
+
injects: Array.from(S.injects),
|
|
3521
|
+
dataSources: Array.from(S.dataSources),
|
|
3522
|
+
globalApiVars: S.reverseApiMap,
|
|
3523
|
+
reverseMemberApiMap: S.reverseMemberApiMap,
|
|
3524
|
+
libs: h
|
|
2668
3525
|
};
|
|
2669
|
-
return await
|
|
2670
|
-
|
|
2671
|
-
async (
|
|
2672
|
-
await
|
|
2673
|
-
if (du(
|
|
2674
|
-
const
|
|
2675
|
-
|
|
3526
|
+
return await ce(
|
|
3527
|
+
b,
|
|
3528
|
+
async (y) => {
|
|
3529
|
+
await oe(y, async (x) => {
|
|
3530
|
+
if (du(x)) {
|
|
3531
|
+
const w = await ru(x.value);
|
|
3532
|
+
let I = $u(w, E);
|
|
3533
|
+
const D = Array.from(
|
|
3534
|
+
p[y.id] || /* @__PURE__ */ new Set()
|
|
3535
|
+
);
|
|
3536
|
+
for (const F of D)
|
|
3537
|
+
I = R(I, F, `this.context.${F}`);
|
|
3538
|
+
x.value = I;
|
|
2676
3539
|
}
|
|
2677
3540
|
});
|
|
2678
3541
|
},
|
|
2679
|
-
async (
|
|
2680
|
-
const
|
|
2681
|
-
|
|
2682
|
-
}
|
|
2683
|
-
), new
|
|
2684
|
-
}
|
|
2685
|
-
async function
|
|
2686
|
-
const a = async (
|
|
2687
|
-
if (await u(
|
|
2688
|
-
for (const
|
|
2689
|
-
await a(
|
|
2690
|
-
},
|
|
2691
|
-
if (!
|
|
2692
|
-
if (Array.isArray(
|
|
2693
|
-
for (let
|
|
2694
|
-
await
|
|
3542
|
+
async (y) => {
|
|
3543
|
+
const x = await ru(y.value);
|
|
3544
|
+
y.value = $u(x, E);
|
|
3545
|
+
}
|
|
3546
|
+
), new Hu(b).toDsl();
|
|
3547
|
+
}
|
|
3548
|
+
async function ce(e, u, t) {
|
|
3549
|
+
const a = async (m, y) => {
|
|
3550
|
+
if (await u(m, y), Array.isArray(m?.children))
|
|
3551
|
+
for (const x of m?.children || [])
|
|
3552
|
+
await a(x, m);
|
|
3553
|
+
}, r = async (m) => {
|
|
3554
|
+
if (!m || typeof m != "object") return;
|
|
3555
|
+
if (Array.isArray(m)) {
|
|
3556
|
+
for (let x of m)
|
|
3557
|
+
await r(x);
|
|
2695
3558
|
return;
|
|
2696
3559
|
}
|
|
2697
|
-
const
|
|
2698
|
-
for (const
|
|
2699
|
-
du(
|
|
3560
|
+
const y = Object.values(m);
|
|
3561
|
+
for (const x of y)
|
|
3562
|
+
du(x) ? await t(x) : await r(x);
|
|
2700
3563
|
}, {
|
|
2701
|
-
state:
|
|
2702
|
-
watch:
|
|
2703
|
-
computed:
|
|
3564
|
+
state: n,
|
|
3565
|
+
watch: i,
|
|
3566
|
+
computed: s,
|
|
2704
3567
|
props: o,
|
|
2705
|
-
dataSources:
|
|
2706
|
-
methods:
|
|
3568
|
+
dataSources: c,
|
|
3569
|
+
methods: d,
|
|
2707
3570
|
lifeCycles: l,
|
|
2708
|
-
inject:
|
|
3571
|
+
inject: p,
|
|
3572
|
+
setup: b,
|
|
3573
|
+
provide: h,
|
|
3574
|
+
refs: S,
|
|
3575
|
+
reactives: E
|
|
2709
3576
|
} = e;
|
|
2710
|
-
if (await
|
|
2711
|
-
state:
|
|
2712
|
-
watch:
|
|
2713
|
-
computed:
|
|
3577
|
+
if (await r({
|
|
3578
|
+
state: n,
|
|
3579
|
+
watch: i,
|
|
3580
|
+
computed: s,
|
|
2714
3581
|
props: o,
|
|
2715
|
-
dataSources:
|
|
2716
|
-
methods:
|
|
3582
|
+
dataSources: c,
|
|
3583
|
+
methods: d,
|
|
2717
3584
|
lifeCycles: l,
|
|
2718
|
-
inject:
|
|
3585
|
+
inject: p,
|
|
3586
|
+
setup: b,
|
|
3587
|
+
provide: h,
|
|
3588
|
+
refs: S,
|
|
3589
|
+
reactives: E
|
|
2719
3590
|
}), Array.isArray(e.nodes))
|
|
2720
|
-
for (const
|
|
2721
|
-
await a(
|
|
3591
|
+
for (const m of e.nodes)
|
|
3592
|
+
await a(m);
|
|
2722
3593
|
}
|
|
2723
|
-
async function
|
|
3594
|
+
async function oe(e, u) {
|
|
2724
3595
|
const t = async (a) => {
|
|
2725
3596
|
if (!a || typeof a != "object") return;
|
|
2726
3597
|
if (Array.isArray(a)) {
|
|
2727
|
-
for (let
|
|
2728
|
-
await u(
|
|
3598
|
+
for (let n of a)
|
|
3599
|
+
await u(n), await t(n);
|
|
2729
3600
|
return;
|
|
2730
3601
|
}
|
|
2731
3602
|
if (du(a)) {
|
|
2732
3603
|
await u(a);
|
|
2733
3604
|
return;
|
|
2734
3605
|
}
|
|
2735
|
-
const
|
|
2736
|
-
for (const
|
|
2737
|
-
await u(
|
|
3606
|
+
const r = Object.values(a);
|
|
3607
|
+
for (const n of r)
|
|
3608
|
+
await u(n), await t(n);
|
|
2738
3609
|
};
|
|
2739
3610
|
await t(e);
|
|
2740
3611
|
}
|
|
2741
|
-
function
|
|
3612
|
+
function de(e = [], u = []) {
|
|
2742
3613
|
const t = {}, a = u.reduce(
|
|
2743
|
-
(
|
|
3614
|
+
(r, n) => (r[n.package] = n.library, r),
|
|
2744
3615
|
{}
|
|
2745
3616
|
);
|
|
2746
|
-
for (const { from:
|
|
2747
|
-
if (Array.isArray(
|
|
2748
|
-
|
|
2749
|
-
const
|
|
2750
|
-
|
|
3617
|
+
for (const { from: r, imports: n } of e)
|
|
3618
|
+
if (Array.isArray(n))
|
|
3619
|
+
n.forEach((i) => {
|
|
3620
|
+
const s = a[r];
|
|
3621
|
+
s && (t[i] = s);
|
|
2751
3622
|
});
|
|
2752
3623
|
else {
|
|
2753
|
-
const
|
|
2754
|
-
|
|
3624
|
+
const i = a[r];
|
|
3625
|
+
i && (t[n] = i);
|
|
2755
3626
|
}
|
|
2756
3627
|
return {
|
|
2757
3628
|
libs: t
|
|
2758
3629
|
};
|
|
2759
3630
|
}
|
|
2760
3631
|
export {
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
3632
|
+
Kt as AutoFixer,
|
|
3633
|
+
Xt as ComponentValidator,
|
|
3634
|
+
l0 as VTJ_PARSER_VERSION,
|
|
3635
|
+
qu as htmlToNodes,
|
|
3636
|
+
f0 as parseUniApp,
|
|
3637
|
+
b0 as parseVue,
|
|
3638
|
+
Iu as patchCode,
|
|
3639
|
+
R as replacer
|
|
2769
3640
|
};
|