soonjs 0.0.30 → 0.0.31
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/deps/acorn-MFuat2YCgG-e4p88nn1g.js +2895 -0
- package/dist/deps/angular-Nz7Izt9RB4-h18jjmowy.js +1448 -0
- package/dist/deps/babel-JaNXSJC73c-9yodyvvph.js +6844 -0
- package/dist/deps/estree-lrVsLbm9_D-frgb7tfnu.js +4265 -0
- package/dist/deps/flow-MAZ63dnw8p-m2rrmabt3.js +26221 -0
- package/dist/deps/glimmer-SKEURx3bl3-9q9t7pwdx.js +2756 -0
- package/dist/deps/graphql--N7MQg-wpp-ikfx3vyg2.js +1212 -0
- package/dist/deps/html-WW7XljTSl6-u2zm0618g.js +2623 -0
- package/dist/deps/markdown-i-DCK3AslU-27ooihdjf.js +3058 -0
- package/dist/deps/meriyah-0-URq6zZ8n-mvot02tnl.js +2320 -0
- package/dist/deps/postcss-urUw1vxeu1-ltys6ubta.js +4664 -0
- package/dist/deps/soon-id-t25L9qRGGZ-mseuvoose.js +30 -0
- package/dist/deps/typescript-5-LBeuVeDB-kqvbhavbi.js +12794 -0
- package/dist/deps/yaml-zChCAOpgM7-osfcioi5d.js +4088 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/vite-plugin-soon-client.cjs +2 -2
- package/dist/vite-plugin-soon-client.js +14 -14
- package/dist/vite-plugin-soon-server.cjs +1 -1
- package/dist/vite-plugin-soon-server.js +1 -1
- package/package.json +1 -1
- /package/dist/deps/{acorn-GEHm0ZzYiF.js → acorn-MFuat2YCgG-3o370z873.js} +0 -0
- /package/dist/deps/{angular-AsYEFZGiaL.js → angular-Nz7Izt9RB4-tpn6vrzzy.js} +0 -0
- /package/dist/deps/{babel-JF5SXjDJMg.js → babel-JaNXSJC73c-ynxn8i808.js} +0 -0
- /package/dist/deps/{estree-mpHydeVRIX.js → estree-lrVsLbm9_D-emih400u1.js} +0 -0
- /package/dist/deps/{flow-Nrt1FQ_Vve.js → flow-MAZ63dnw8p-wi0v0aena.js} +0 -0
- /package/dist/deps/{glimmer-wulBvI3ec4.js → glimmer-SKEURx3bl3-l70hzjhe4.js} +0 -0
- /package/dist/deps/{graphql-RtYSaK2zvJ.js → graphql--N7MQg-wpp-v49tdgcr9.js} +0 -0
- /package/dist/deps/{html-Rhm0swv15v.js → html-WW7XljTSl6-nxudy7vqp.js} +0 -0
- /package/dist/deps/{markdown-lYixUp5UIZ.js → markdown-i-DCK3AslU-wd4hbzpj4.js} +0 -0
- /package/dist/deps/{meriyah-sFHGgRXFc5.js → meriyah-0-URq6zZ8n-8hx0wdln8.js} +0 -0
- /package/dist/deps/{postcss-R-fq3Fq8sV.js → postcss-urUw1vxeu1-xxgu2fu5o.js} +0 -0
- /package/dist/deps/{soon-id-mHYJjIZNTr.js → soon-id-t25L9qRGGZ-l8lkjbbxl.js} +0 -0
- /package/dist/deps/{typescript-VhxF0z88nS.js → typescript-5-LBeuVeDB-7w9kseqyq.js} +0 -0
- /package/dist/deps/{yaml-bWZoUlV7rd.js → yaml-zChCAOpgM7-h7aopdk65.js} +0 -0
|
@@ -0,0 +1,2756 @@
|
|
|
1
|
+
var pn = Object.defineProperty;
|
|
2
|
+
var dn = (t, e, r) => e in t ? pn(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var w = (t, e, r) => dn(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
var mn = Object.defineProperty, Er = (t) => {
|
|
5
|
+
throw TypeError(t);
|
|
6
|
+
}, Pe = (t, e) => {
|
|
7
|
+
for (var r in e) mn(t, r, { get: e[r], enumerable: !0 });
|
|
8
|
+
}, vr = (t, e, r) => e.has(t) || Er("Cannot " + r), nt = (t, e, r) => (vr(t, e, "read from private field"), e.get(t)), fn = (t, e, r) => e.has(t) ? Er("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), gn = (t, e, r, n) => (vr(t, e, "write to private field"), e.set(t, r), r), Cr = {};
|
|
9
|
+
Pe(Cr, { languages: () => Ca, parsers: () => jr, printers: () => iu });
|
|
10
|
+
var bn = (t, e, r, n) => {
|
|
11
|
+
if (!(t && e == null)) return e.replaceAll ? e.replaceAll(r, n) : r.global ? e.replace(r, n) : e.split(r).join(n);
|
|
12
|
+
}, Sr = bn, wr = "string", Br = "array", kr = "cursor", Fe = "indent", Le = "align", xr = "trim", _e = "group", qe = "fill", Ie = "if-break", Tr = "indent-if-break", Nr = "line-suffix", Pr = "line-suffix-boundary", St = "line", Fr = "label", Oe = "break-parent", Lr = /* @__PURE__ */ new Set([kr, Fe, Le, xr, _e, qe, Ie, Tr, Nr, Pr, St, Fr, Oe]);
|
|
13
|
+
function yn(t) {
|
|
14
|
+
if (typeof t == "string") return wr;
|
|
15
|
+
if (Array.isArray(t)) return Br;
|
|
16
|
+
if (!t) return;
|
|
17
|
+
let { type: e } = t;
|
|
18
|
+
if (Lr.has(e)) return e;
|
|
19
|
+
}
|
|
20
|
+
var _r = yn, An = (t) => new Intl.ListFormat("en-US", { type: "disjunction" }).format(t);
|
|
21
|
+
function Dn(t) {
|
|
22
|
+
let e = t === null ? "null" : typeof t;
|
|
23
|
+
if (e !== "string" && e !== "object") return `Unexpected doc '${e}',
|
|
24
|
+
Expected it to be 'string' or 'object'.`;
|
|
25
|
+
if (_r(t)) throw new Error("doc is valid.");
|
|
26
|
+
let r = Object.prototype.toString.call(t);
|
|
27
|
+
if (r !== "[object Object]") return `Unexpected doc '${r}'.`;
|
|
28
|
+
let n = An([...Lr].map((a) => `'${a}'`));
|
|
29
|
+
return `Unexpected doc.type '${t.type}'.
|
|
30
|
+
Expected it to be ${n}.`;
|
|
31
|
+
}
|
|
32
|
+
var En = class extends Error {
|
|
33
|
+
constructor(e) {
|
|
34
|
+
super(Dn(e));
|
|
35
|
+
w(this, "name", "InvalidDocError");
|
|
36
|
+
this.doc = e;
|
|
37
|
+
}
|
|
38
|
+
}, vn = En, Cn = () => {
|
|
39
|
+
}, Sn = Cn;
|
|
40
|
+
function O(t) {
|
|
41
|
+
return { type: Fe, contents: t };
|
|
42
|
+
}
|
|
43
|
+
function wn(t, e) {
|
|
44
|
+
return { type: Le, contents: e, n: t };
|
|
45
|
+
}
|
|
46
|
+
function R(t, e = {}) {
|
|
47
|
+
return Sn(e.expandedStates), { type: _e, id: e.id, contents: t, break: !!e.shouldBreak, expandedStates: e.expandedStates };
|
|
48
|
+
}
|
|
49
|
+
function Xe(t) {
|
|
50
|
+
return wn(-1, t);
|
|
51
|
+
}
|
|
52
|
+
function Ze(t) {
|
|
53
|
+
return { type: qe, parts: t };
|
|
54
|
+
}
|
|
55
|
+
function tr(t, e = "", r = {}) {
|
|
56
|
+
return { type: Ie, breakContents: t, flatContents: e, groupId: r.groupId };
|
|
57
|
+
}
|
|
58
|
+
var qr = { type: Oe }, Bn = { type: St, hard: !0 }, kn = { type: St, hard: !0, literal: !0 }, L = { type: St }, K = { type: St, soft: !0 }, wt = [Bn, qr], xn = [kn, qr];
|
|
59
|
+
function Ot(t, e) {
|
|
60
|
+
let r = [];
|
|
61
|
+
for (let n = 0; n < e.length; n++) n !== 0 && r.push(t), r.push(e[n]);
|
|
62
|
+
return r;
|
|
63
|
+
}
|
|
64
|
+
var Tn = (t, e, r) => {
|
|
65
|
+
if (!(t && e == null)) return Array.isArray(e) || typeof e == "string" ? e[r < 0 ? e.length + r : r] : e.at(r);
|
|
66
|
+
}, Tt = Tn;
|
|
67
|
+
function Nn(t, e) {
|
|
68
|
+
if (typeof t == "string") return e(t);
|
|
69
|
+
let r = /* @__PURE__ */ new Map();
|
|
70
|
+
return n(t);
|
|
71
|
+
function n(s) {
|
|
72
|
+
if (r.has(s)) return r.get(s);
|
|
73
|
+
let u = a(s);
|
|
74
|
+
return r.set(s, u), u;
|
|
75
|
+
}
|
|
76
|
+
function a(s) {
|
|
77
|
+
switch (_r(s)) {
|
|
78
|
+
case Br:
|
|
79
|
+
return e(s.map(n));
|
|
80
|
+
case qe:
|
|
81
|
+
return e({ ...s, parts: s.parts.map(n) });
|
|
82
|
+
case Ie:
|
|
83
|
+
return e({ ...s, breakContents: n(s.breakContents), flatContents: n(s.flatContents) });
|
|
84
|
+
case _e: {
|
|
85
|
+
let { expandedStates: u, contents: i } = s;
|
|
86
|
+
return u ? (u = u.map(n), i = u[0]) : i = n(i), e({ ...s, contents: i, expandedStates: u });
|
|
87
|
+
}
|
|
88
|
+
case Le:
|
|
89
|
+
case Fe:
|
|
90
|
+
case Tr:
|
|
91
|
+
case Fr:
|
|
92
|
+
case Nr:
|
|
93
|
+
return e({ ...s, contents: n(s.contents) });
|
|
94
|
+
case wr:
|
|
95
|
+
case kr:
|
|
96
|
+
case xr:
|
|
97
|
+
case Pr:
|
|
98
|
+
case St:
|
|
99
|
+
case Oe:
|
|
100
|
+
return e(s);
|
|
101
|
+
default:
|
|
102
|
+
throw new vn(s);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
function Pn(t, e = xn) {
|
|
107
|
+
return Nn(t, (r) => typeof r == "string" ? Ot(e, r.split(`
|
|
108
|
+
`)) : r);
|
|
109
|
+
}
|
|
110
|
+
var zt = "'", er = '"';
|
|
111
|
+
function Fn(t, e) {
|
|
112
|
+
let r = e === !0 || e === zt ? zt : er, n = r === zt ? er : zt, a = 0, s = 0;
|
|
113
|
+
for (let u of t) u === r ? a++ : u === n && s++;
|
|
114
|
+
return a > s ? n : r;
|
|
115
|
+
}
|
|
116
|
+
var De = Fn;
|
|
117
|
+
function Ln(t) {
|
|
118
|
+
if (typeof t != "string") throw new TypeError("Expected a string");
|
|
119
|
+
return t.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
|
|
120
|
+
}
|
|
121
|
+
var z, _n = class {
|
|
122
|
+
constructor(t) {
|
|
123
|
+
fn(this, z), gn(this, z, new Set(t));
|
|
124
|
+
}
|
|
125
|
+
getLeadingWhitespaceCount(t) {
|
|
126
|
+
let e = nt(this, z), r = 0;
|
|
127
|
+
for (let n = 0; n < t.length && e.has(t.charAt(n)); n++) r++;
|
|
128
|
+
return r;
|
|
129
|
+
}
|
|
130
|
+
getTrailingWhitespaceCount(t) {
|
|
131
|
+
let e = nt(this, z), r = 0;
|
|
132
|
+
for (let n = t.length - 1; n >= 0 && e.has(t.charAt(n)); n--) r++;
|
|
133
|
+
return r;
|
|
134
|
+
}
|
|
135
|
+
getLeadingWhitespace(t) {
|
|
136
|
+
let e = this.getLeadingWhitespaceCount(t);
|
|
137
|
+
return t.slice(0, e);
|
|
138
|
+
}
|
|
139
|
+
getTrailingWhitespace(t) {
|
|
140
|
+
let e = this.getTrailingWhitespaceCount(t);
|
|
141
|
+
return t.slice(t.length - e);
|
|
142
|
+
}
|
|
143
|
+
hasLeadingWhitespace(t) {
|
|
144
|
+
return nt(this, z).has(t.charAt(0));
|
|
145
|
+
}
|
|
146
|
+
hasTrailingWhitespace(t) {
|
|
147
|
+
return nt(this, z).has(Tt(!1, t, -1));
|
|
148
|
+
}
|
|
149
|
+
trimStart(t) {
|
|
150
|
+
let e = this.getLeadingWhitespaceCount(t);
|
|
151
|
+
return t.slice(e);
|
|
152
|
+
}
|
|
153
|
+
trimEnd(t) {
|
|
154
|
+
let e = this.getTrailingWhitespaceCount(t);
|
|
155
|
+
return t.slice(0, t.length - e);
|
|
156
|
+
}
|
|
157
|
+
trim(t) {
|
|
158
|
+
return this.trimEnd(this.trimStart(t));
|
|
159
|
+
}
|
|
160
|
+
split(t, e = !1) {
|
|
161
|
+
let r = `[${Ln([...nt(this, z)].join(""))}]+`, n = new RegExp(e ? `(${r})` : r, "u");
|
|
162
|
+
return t.split(n);
|
|
163
|
+
}
|
|
164
|
+
hasWhitespaceCharacter(t) {
|
|
165
|
+
let e = nt(this, z);
|
|
166
|
+
return Array.prototype.some.call(t, (r) => e.has(r));
|
|
167
|
+
}
|
|
168
|
+
hasNonWhitespaceCharacter(t) {
|
|
169
|
+
let e = nt(this, z);
|
|
170
|
+
return Array.prototype.some.call(t, (r) => !e.has(r));
|
|
171
|
+
}
|
|
172
|
+
isWhitespaceOnly(t) {
|
|
173
|
+
let e = nt(this, z);
|
|
174
|
+
return Array.prototype.every.call(t, (r) => e.has(r));
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
z = /* @__PURE__ */ new WeakMap();
|
|
178
|
+
var qn = _n, In = [" ", `
|
|
179
|
+
`, "\f", "\r", " "], On = new qn(In), Z = On;
|
|
180
|
+
function $n(t) {
|
|
181
|
+
return Array.isArray(t) && t.length > 0;
|
|
182
|
+
}
|
|
183
|
+
var Xt = $n, Vn = class extends Error {
|
|
184
|
+
constructor(e, r, n = "type") {
|
|
185
|
+
super(`Unexpected ${r} node ${n}: ${JSON.stringify(e[n])}.`);
|
|
186
|
+
w(this, "name", "UnexpectedNodeError");
|
|
187
|
+
this.node = e;
|
|
188
|
+
}
|
|
189
|
+
}, Rn = Vn;
|
|
190
|
+
function Ir(t, e) {
|
|
191
|
+
if (t.type === "TextNode") {
|
|
192
|
+
let r = t.chars.trim();
|
|
193
|
+
if (!r) return null;
|
|
194
|
+
e.chars = Z.split(r).join(" ");
|
|
195
|
+
}
|
|
196
|
+
t.type === "ElementNode" && (delete e.startTag, delete e.openTag, delete e.parts, delete e.endTag, delete e.closeTag, delete e.nameNode, delete e.body, delete e.blockParamNodes, delete e.params, delete e.path), t.type === "Block" && (delete e.blockParamNodes, delete e.params), t.type === "AttrNode" && t.name.toLowerCase() === "class" && delete e.value, t.type === "PathExpression" && (e.head = t.head.original);
|
|
197
|
+
}
|
|
198
|
+
Ir.ignoredProperties = /* @__PURE__ */ new Set(["loc", "selfClosing"]);
|
|
199
|
+
var Un = Ir, kt = null;
|
|
200
|
+
function Nt(t) {
|
|
201
|
+
if (kt !== null && typeof kt.property) {
|
|
202
|
+
let e = kt;
|
|
203
|
+
return kt = Nt.prototype = null, e;
|
|
204
|
+
}
|
|
205
|
+
return kt = Nt.prototype = t ?? /* @__PURE__ */ Object.create(null), new Nt();
|
|
206
|
+
}
|
|
207
|
+
var Hn = 10;
|
|
208
|
+
for (let t = 0; t <= Hn; t++) Nt();
|
|
209
|
+
function Mn(t) {
|
|
210
|
+
return Nt(t);
|
|
211
|
+
}
|
|
212
|
+
function zn(t, e = "type") {
|
|
213
|
+
Mn(t);
|
|
214
|
+
function r(n) {
|
|
215
|
+
let a = n[e], s = t[a];
|
|
216
|
+
if (!Array.isArray(s)) throw Object.assign(new Error(`Missing visitor keys for '${a}'.`), { node: n });
|
|
217
|
+
return s;
|
|
218
|
+
}
|
|
219
|
+
return r;
|
|
220
|
+
}
|
|
221
|
+
var jn = zn, Gn = { Template: ["body"], Block: ["body"], MustacheStatement: ["path", "params", "hash"], BlockStatement: ["path", "params", "hash", "program", "inverse"], ElementModifierStatement: ["path", "params", "hash"], CommentStatement: [], MustacheCommentStatement: [], ElementNode: ["attributes", "modifiers", "children", "comments"], AttrNode: ["value"], TextNode: [], ConcatStatement: ["parts"], SubExpression: ["path", "params", "hash"], PathExpression: [], StringLiteral: [], BooleanLiteral: [], NumberLiteral: [], NullLiteral: [], UndefinedLiteral: [], Hash: ["pairs"], HashPair: ["value"] }, Wn = jn(Gn), Kn = Wn;
|
|
222
|
+
function Lt(t) {
|
|
223
|
+
return t.loc.start.offset;
|
|
224
|
+
}
|
|
225
|
+
function Ee(t) {
|
|
226
|
+
return t.loc.end.offset;
|
|
227
|
+
}
|
|
228
|
+
var Qn = /* @__PURE__ */ new Set(["area", "base", "br", "col", "command", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]);
|
|
229
|
+
function Or(t) {
|
|
230
|
+
return t.toUpperCase() === t;
|
|
231
|
+
}
|
|
232
|
+
function Jn(t) {
|
|
233
|
+
return t.type === "ElementNode" && typeof t.tag == "string" && !t.tag.startsWith(":") && (Or(t.tag[0]) || t.tag.includes("."));
|
|
234
|
+
}
|
|
235
|
+
function Yn(t) {
|
|
236
|
+
return Qn.has(t.toLowerCase()) && !Or(t[0]);
|
|
237
|
+
}
|
|
238
|
+
function $r(t) {
|
|
239
|
+
return t.selfClosing === !0 || Yn(t.tag) || Jn(t) && t.children.every((e) => $e(e));
|
|
240
|
+
}
|
|
241
|
+
function $e(t) {
|
|
242
|
+
return t.type === "TextNode" && !/\S/u.test(t.chars);
|
|
243
|
+
}
|
|
244
|
+
function rr(t) {
|
|
245
|
+
return (t == null ? void 0 : t.type) === "MustacheCommentStatement" && typeof t.value == "string" && t.value.trim() === "prettier-ignore";
|
|
246
|
+
}
|
|
247
|
+
function Xn(t) {
|
|
248
|
+
return rr(t.node) || t.isInArray && (t.key === "children" || t.key === "body" || t.key === "parts") && rr(t.siblings[t.index - 2]);
|
|
249
|
+
}
|
|
250
|
+
var Vr = 2;
|
|
251
|
+
function Zn(t, e, r) {
|
|
252
|
+
var n, a, s, u, i, l, g, h, m;
|
|
253
|
+
let { node: A } = t;
|
|
254
|
+
switch (A.type) {
|
|
255
|
+
case "Block":
|
|
256
|
+
case "Program":
|
|
257
|
+
case "Template":
|
|
258
|
+
return R(t.map(r, "body"));
|
|
259
|
+
case "ElementNode": {
|
|
260
|
+
let y = R(ea(t, r)), C = e.htmlWhitespaceSensitivity === "ignore" && ((n = t.next) == null ? void 0 : n.type) === "ElementNode" ? K : "";
|
|
261
|
+
if ($r(A)) return [y, C];
|
|
262
|
+
let T = ["</", A.tag, ">"];
|
|
263
|
+
return A.children.length === 0 ? [y, O(T), C] : e.htmlWhitespaceSensitivity === "ignore" ? [y, O(nr(t, e, r)), wt, O(T), C] : [y, O(R(nr(t, e, r))), O(T), C];
|
|
264
|
+
}
|
|
265
|
+
case "BlockStatement":
|
|
266
|
+
return ia(t) ? [oa(t, r), ur(t, r, e), ir(t, r, e)] : [sa(t, r), R([ur(t, r, e), ir(t, r, e), la(t, r, e)])];
|
|
267
|
+
case "ElementModifierStatement":
|
|
268
|
+
return R(["{{", lr(t, r), "}}"]);
|
|
269
|
+
case "MustacheStatement":
|
|
270
|
+
return R([Zt(A), lr(t, r), te(A)]);
|
|
271
|
+
case "SubExpression":
|
|
272
|
+
return R(["(", ga(t, r), K, ")"]);
|
|
273
|
+
case "AttrNode": {
|
|
274
|
+
let { name: y, value: C } = A, T = C.type === "TextNode";
|
|
275
|
+
if (T && C.chars === "" && Lt(C) === Ee(C)) return y;
|
|
276
|
+
let x = T ? De(C.chars, e.singleQuote) : C.type === "ConcatStatement" ? De(C.parts.map((U) => U.type === "TextNode" ? U.chars : "").join(""), e.singleQuote) : "", B = r("value");
|
|
277
|
+
return [y, "=", x, y === "class" && x ? R(O(B)) : B, x];
|
|
278
|
+
}
|
|
279
|
+
case "ConcatStatement":
|
|
280
|
+
return t.map(r, "parts");
|
|
281
|
+
case "Hash":
|
|
282
|
+
return Ot(L, t.map(r, "pairs"));
|
|
283
|
+
case "HashPair":
|
|
284
|
+
return [A.key, "=", r("value")];
|
|
285
|
+
case "TextNode": {
|
|
286
|
+
let y = Sr(!1, A.chars, "{{", String.raw`\{{`), C = ha(t);
|
|
287
|
+
if (C) {
|
|
288
|
+
if (C === "class") {
|
|
289
|
+
let Y = y.trim().split(/\s+/u).join(" "), tt = !1, $ = !1;
|
|
290
|
+
return t.parent.type === "ConcatStatement" && (((a = t.previous) == null ? void 0 : a.type) === "MustacheStatement" && /^\s/u.test(y) && (tt = !0), ((s = t.next) == null ? void 0 : s.type) === "MustacheStatement" && /\s$/u.test(y) && Y !== "" && ($ = !0)), [tt ? L : "", Y, $ ? L : ""];
|
|
291
|
+
}
|
|
292
|
+
return Pn(y);
|
|
293
|
+
}
|
|
294
|
+
let T = Z.isWhitespaceOnly(y), { isFirst: x, isLast: B } = t;
|
|
295
|
+
if (e.htmlWhitespaceSensitivity !== "ignore") {
|
|
296
|
+
let Y = B && t.parent.type === "Template", tt = x && t.parent.type === "Template";
|
|
297
|
+
if (T) {
|
|
298
|
+
if (tt || Y) return "";
|
|
299
|
+
let P = [L], rt = Dt(y);
|
|
300
|
+
return rt && (P = xt(rt)), B && (P = P.map((Vt) => Xe(Vt))), P;
|
|
301
|
+
}
|
|
302
|
+
let $ = Z.getLeadingWhitespace(y), ft = [];
|
|
303
|
+
if ($) {
|
|
304
|
+
ft = [L];
|
|
305
|
+
let P = Dt($);
|
|
306
|
+
P && (ft = xt(P)), y = y.slice($.length);
|
|
307
|
+
}
|
|
308
|
+
let V = Z.getTrailingWhitespace(y), et = [];
|
|
309
|
+
if (V) {
|
|
310
|
+
if (!Y) {
|
|
311
|
+
et = [L];
|
|
312
|
+
let P = Dt(V);
|
|
313
|
+
P && (et = xt(P)), B && (et = et.map((rt) => Xe(rt)));
|
|
314
|
+
}
|
|
315
|
+
y = y.slice(0, -V.length);
|
|
316
|
+
}
|
|
317
|
+
return [...ft, Ze(or(y)), ...et];
|
|
318
|
+
}
|
|
319
|
+
let U = Dt(y), j = pa(y), J = da(y);
|
|
320
|
+
if ((x || B) && T && (t.parent.type === "Block" || t.parent.type === "ElementNode" || t.parent.type === "Template")) return "";
|
|
321
|
+
T && U ? (j = Math.min(U, Vr), J = 0) : ((((u = t.next) == null ? void 0 : u.type) === "BlockStatement" || ((i = t.next) == null ? void 0 : i.type) === "ElementNode") && (J = Math.max(J, 1)), (((l = t.previous) == null ? void 0 : l.type) === "BlockStatement" || ((g = t.previous) == null ? void 0 : g.type) === "ElementNode") && (j = Math.max(j, 1)));
|
|
322
|
+
let dt = "", mt = "";
|
|
323
|
+
return J === 0 && ((h = t.next) == null ? void 0 : h.type) === "MustacheStatement" && (mt = " "), j === 0 && ((m = t.previous) == null ? void 0 : m.type) === "MustacheStatement" && (dt = " "), x && (j = 0, dt = ""), B && (J = 0, mt = ""), Z.hasLeadingWhitespace(y) && (y = dt + Z.trimStart(y)), Z.hasTrailingWhitespace(y) && (y = Z.trimEnd(y) + mt), [...xt(j), Ze(or(y)), ...xt(J)];
|
|
324
|
+
}
|
|
325
|
+
case "MustacheCommentStatement": {
|
|
326
|
+
let y = Lt(A), C = Ee(A), T = e.originalText.charAt(y + 2) === "~", x = e.originalText.charAt(C - 3) === "~", B = A.value.includes("}}") ? "--" : "";
|
|
327
|
+
return ["{{", T ? "~" : "", "!", B, A.value, B, x ? "~" : "", "}}"];
|
|
328
|
+
}
|
|
329
|
+
case "PathExpression":
|
|
330
|
+
return Da(A);
|
|
331
|
+
case "BooleanLiteral":
|
|
332
|
+
return String(A.value);
|
|
333
|
+
case "CommentStatement":
|
|
334
|
+
return ["<!--", A.value, "-->"];
|
|
335
|
+
case "StringLiteral":
|
|
336
|
+
return ma(t, e);
|
|
337
|
+
case "NumberLiteral":
|
|
338
|
+
return String(A.value);
|
|
339
|
+
case "UndefinedLiteral":
|
|
340
|
+
return "undefined";
|
|
341
|
+
case "NullLiteral":
|
|
342
|
+
return "null";
|
|
343
|
+
case "AtHead":
|
|
344
|
+
case "VarHead":
|
|
345
|
+
case "ThisHead":
|
|
346
|
+
default:
|
|
347
|
+
throw new Rn(A, "Handlebars");
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
function ta(t, e) {
|
|
351
|
+
return Lt(t) - Lt(e);
|
|
352
|
+
}
|
|
353
|
+
function ea(t, e) {
|
|
354
|
+
let { node: r } = t, n = ["attributes", "modifiers", "comments"].filter((s) => Xt(r[s])), a = n.flatMap((s) => r[s]).sort(ta);
|
|
355
|
+
for (let s of n) t.each(({ node: u }) => {
|
|
356
|
+
let i = a.indexOf(u);
|
|
357
|
+
a.splice(i, 1, [L, e()]);
|
|
358
|
+
}, s);
|
|
359
|
+
return Xt(r.blockParams) && a.push(L, Re(r)), ["<", r.tag, O(a), ra(r)];
|
|
360
|
+
}
|
|
361
|
+
function nr(t, e, r) {
|
|
362
|
+
let { node: n } = t, a = n.children.every((s) => $e(s));
|
|
363
|
+
return e.htmlWhitespaceSensitivity === "ignore" && a ? "" : t.map(({ isFirst: s }) => {
|
|
364
|
+
let u = r();
|
|
365
|
+
return s && e.htmlWhitespaceSensitivity === "ignore" ? [K, u] : u;
|
|
366
|
+
}, "children");
|
|
367
|
+
}
|
|
368
|
+
function ra(t) {
|
|
369
|
+
return $r(t) ? tr([K, "/>"], [" />", K]) : tr([K, ">"], ">");
|
|
370
|
+
}
|
|
371
|
+
function Zt(t) {
|
|
372
|
+
var e;
|
|
373
|
+
let r = t.trusting ? "{{{" : "{{", n = (e = t.strip) != null && e.open ? "~" : "";
|
|
374
|
+
return [r, n];
|
|
375
|
+
}
|
|
376
|
+
function te(t) {
|
|
377
|
+
var e;
|
|
378
|
+
let r = t.trusting ? "}}}" : "}}";
|
|
379
|
+
return [(e = t.strip) != null && e.close ? "~" : "", r];
|
|
380
|
+
}
|
|
381
|
+
function na(t) {
|
|
382
|
+
let e = Zt(t), r = t.openStrip.open ? "~" : "";
|
|
383
|
+
return [e, r, "#"];
|
|
384
|
+
}
|
|
385
|
+
function aa(t) {
|
|
386
|
+
let e = te(t);
|
|
387
|
+
return [t.openStrip.close ? "~" : "", e];
|
|
388
|
+
}
|
|
389
|
+
function ar(t) {
|
|
390
|
+
let e = Zt(t), r = t.closeStrip.open ? "~" : "";
|
|
391
|
+
return [e, r, "/"];
|
|
392
|
+
}
|
|
393
|
+
function sr(t) {
|
|
394
|
+
let e = te(t);
|
|
395
|
+
return [t.closeStrip.close ? "~" : "", e];
|
|
396
|
+
}
|
|
397
|
+
function Rr(t) {
|
|
398
|
+
let e = Zt(t), r = t.inverseStrip.open ? "~" : "";
|
|
399
|
+
return [e, r];
|
|
400
|
+
}
|
|
401
|
+
function Ur(t) {
|
|
402
|
+
let e = te(t);
|
|
403
|
+
return [t.inverseStrip.close ? "~" : "", e];
|
|
404
|
+
}
|
|
405
|
+
function sa(t, e) {
|
|
406
|
+
let { node: r } = t, n = [], a = ee(t, e);
|
|
407
|
+
return a && n.push(R(a)), Xt(r.program.blockParams) && n.push(Re(r.program)), R([na(r), Ve(t, e), n.length > 0 ? O([L, Ot(L, n)]) : "", K, aa(r)]);
|
|
408
|
+
}
|
|
409
|
+
function ua(t, e) {
|
|
410
|
+
return [e.htmlWhitespaceSensitivity === "ignore" ? wt : "", Rr(t), "else", Ur(t)];
|
|
411
|
+
}
|
|
412
|
+
var Hr = (t, e) => t.head.type === "VarHead" && e.head.type === "VarHead" && t.head.name === e.head.name;
|
|
413
|
+
function ia(t) {
|
|
414
|
+
var e;
|
|
415
|
+
let { grandparent: r, node: n } = t;
|
|
416
|
+
return ((e = r == null ? void 0 : r.inverse) == null ? void 0 : e.body.length) === 1 && r.inverse.body[0] === n && Hr(r.inverse.body[0].path, r.path);
|
|
417
|
+
}
|
|
418
|
+
function oa(t, e) {
|
|
419
|
+
let { node: r, grandparent: n } = t;
|
|
420
|
+
return R([Rr(n), ["else", " ", n.inverse.body[0].path.head.name], O([L, R(ee(t, e)), ...Xt(r.program.blockParams) ? [L, Re(r.program)] : []]), K, Ur(n)]);
|
|
421
|
+
}
|
|
422
|
+
function la(t, e, r) {
|
|
423
|
+
let { node: n } = t;
|
|
424
|
+
return r.htmlWhitespaceSensitivity === "ignore" ? [Mr(n) ? K : wt, ar(n), e("path"), sr(n)] : [ar(n), e("path"), sr(n)];
|
|
425
|
+
}
|
|
426
|
+
function Mr(t) {
|
|
427
|
+
return t.type === "BlockStatement" && t.program.body.every((e) => $e(e));
|
|
428
|
+
}
|
|
429
|
+
function ca(t) {
|
|
430
|
+
return zr(t) && t.inverse.body.length === 1 && t.inverse.body[0].type === "BlockStatement" && Hr(t.inverse.body[0].path, t.path);
|
|
431
|
+
}
|
|
432
|
+
function zr(t) {
|
|
433
|
+
return t.type === "BlockStatement" && t.inverse;
|
|
434
|
+
}
|
|
435
|
+
function ur(t, e, r) {
|
|
436
|
+
let { node: n } = t;
|
|
437
|
+
if (Mr(n)) return "";
|
|
438
|
+
let a = e("program");
|
|
439
|
+
return r.htmlWhitespaceSensitivity === "ignore" ? O([wt, a]) : O(a);
|
|
440
|
+
}
|
|
441
|
+
function ir(t, e, r) {
|
|
442
|
+
let { node: n } = t, a = e("inverse"), s = r.htmlWhitespaceSensitivity === "ignore" ? [wt, a] : a;
|
|
443
|
+
return ca(n) ? s : zr(n) ? [ua(n, r), O(s)] : "";
|
|
444
|
+
}
|
|
445
|
+
function or(t) {
|
|
446
|
+
return Ot(L, Z.split(t));
|
|
447
|
+
}
|
|
448
|
+
function ha(t) {
|
|
449
|
+
for (let e = 0; e < 2; e++) {
|
|
450
|
+
let r = t.getParentNode(e);
|
|
451
|
+
if ((r == null ? void 0 : r.type) === "AttrNode") return r.name.toLowerCase();
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
function Dt(t) {
|
|
455
|
+
return t = typeof t == "string" ? t : "", t.split(`
|
|
456
|
+
`).length - 1;
|
|
457
|
+
}
|
|
458
|
+
function pa(t) {
|
|
459
|
+
t = typeof t == "string" ? t : "";
|
|
460
|
+
let e = (t.match(/^([^\S\n\r]*[\n\r])+/gu) || [])[0] || "";
|
|
461
|
+
return Dt(e);
|
|
462
|
+
}
|
|
463
|
+
function da(t) {
|
|
464
|
+
t = typeof t == "string" ? t : "";
|
|
465
|
+
let e = (t.match(/([\n\r][^\S\n\r]*)+$/gu) || [])[0] || "";
|
|
466
|
+
return Dt(e);
|
|
467
|
+
}
|
|
468
|
+
function xt(t = 0) {
|
|
469
|
+
return Array.from({ length: Math.min(t, Vr) }).fill(wt);
|
|
470
|
+
}
|
|
471
|
+
function ma(t, e) {
|
|
472
|
+
let { node: { value: r } } = t, n = De(r, fa(t) ? !e.singleQuote : e.singleQuote);
|
|
473
|
+
return [n, Sr(!1, r, n, `\\${n}`), n];
|
|
474
|
+
}
|
|
475
|
+
function fa(t) {
|
|
476
|
+
let { ancestors: e } = t, r = e.findIndex((n) => n.type !== "SubExpression");
|
|
477
|
+
return r !== -1 && e[r + 1].type === "ConcatStatement" && e[r + 2].type === "AttrNode";
|
|
478
|
+
}
|
|
479
|
+
function ga(t, e) {
|
|
480
|
+
let r = Ve(t, e), n = ee(t, e);
|
|
481
|
+
return n ? O([r, L, R(n)]) : r;
|
|
482
|
+
}
|
|
483
|
+
function lr(t, e) {
|
|
484
|
+
let r = Ve(t, e), n = ee(t, e);
|
|
485
|
+
return n ? [O([r, L, n]), K] : r;
|
|
486
|
+
}
|
|
487
|
+
function Ve(t, e) {
|
|
488
|
+
return e("path");
|
|
489
|
+
}
|
|
490
|
+
function ee(t, e) {
|
|
491
|
+
var r;
|
|
492
|
+
let { node: n } = t, a = [];
|
|
493
|
+
return n.params.length > 0 && a.push(...t.map(e, "params")), ((r = n.hash) == null ? void 0 : r.pairs.length) > 0 && a.push(e("hash")), a.length === 0 ? "" : Ot(L, a);
|
|
494
|
+
}
|
|
495
|
+
function Re(t) {
|
|
496
|
+
return ["as |", t.blockParams.join(" "), "|"];
|
|
497
|
+
}
|
|
498
|
+
var ba = new Set("!\"#%&'()*+,./;<=>@[\\]^`{|}~"), ya = /* @__PURE__ */ new Set(["true", "false", "null", "undefined"]), Aa = (t, e) => e === 0 && t.startsWith("@") ? !1 : e !== 0 && ya.has(t) || /\s/u.test(t) || /^\d/u.test(t) || Array.prototype.some.call(t, (r) => ba.has(r));
|
|
499
|
+
function Da(t) {
|
|
500
|
+
return t.tail.length === 0 && t.original.includes("/") ? t.original : [t.head.original, ...t.tail].map((e, r) => Aa(e, r) ? `[${e}]` : e).join(".");
|
|
501
|
+
}
|
|
502
|
+
var Ea = { print: Zn, massageAstNode: Un, hasPrettierIgnore: Xn, getVisitorKeys: Kn }, va = Ea, Ca = [{ linguistLanguageId: 155, name: "Handlebars", type: "markup", color: "#f7931e", aliases: ["hbs", "htmlbars"], extensions: [".handlebars", ".hbs"], tmScope: "text.html.handlebars", aceMode: "handlebars", parsers: ["glimmer"], vscodeLanguageIds: ["handlebars"] }], jr = {};
|
|
503
|
+
Pe(jr, { glimmer: () => uu });
|
|
504
|
+
function S(t, e) {
|
|
505
|
+
if (!t) throw new Error(e || "assertion failure");
|
|
506
|
+
}
|
|
507
|
+
function M(t) {
|
|
508
|
+
Fa.warn(`DEPRECATION: ${t}`);
|
|
509
|
+
}
|
|
510
|
+
function Ue(t) {
|
|
511
|
+
if (t == null) throw new Error("Expected value to be present");
|
|
512
|
+
return t;
|
|
513
|
+
}
|
|
514
|
+
function Sa(t, e) {
|
|
515
|
+
if (t == null) throw new Error(e);
|
|
516
|
+
return t;
|
|
517
|
+
}
|
|
518
|
+
function Bt(t) {
|
|
519
|
+
return t.length > 0;
|
|
520
|
+
}
|
|
521
|
+
function ve(t, e = "unexpected empty list") {
|
|
522
|
+
if (!Bt(t)) throw new Error(e);
|
|
523
|
+
}
|
|
524
|
+
function _t(t, e = "unexpected empty list") {
|
|
525
|
+
return ve(t, e), t;
|
|
526
|
+
}
|
|
527
|
+
function He(t) {
|
|
528
|
+
return t.length === 0 ? void 0 : t[t.length - 1];
|
|
529
|
+
}
|
|
530
|
+
function wa(t) {
|
|
531
|
+
return t.length === 0 ? void 0 : t[0];
|
|
532
|
+
}
|
|
533
|
+
var Me = function(t) {
|
|
534
|
+
return t[t.MAX_SMI = 1073741823] = "MAX_SMI", t[t.MIN_SMI = -1073741824] = "MIN_SMI", t[t.SIGN_BIT = -536870913] = "SIGN_BIT", t[t.MAX_INT = 536870911] = "MAX_INT", t[t.MIN_INT = -536870912] = "MIN_INT", t[t.FALSE_HANDLE = 0] = "FALSE_HANDLE", t[t.TRUE_HANDLE = 1] = "TRUE_HANDLE", t[t.NULL_HANDLE = 2] = "NULL_HANDLE", t[t.UNDEFINED_HANDLE = 3] = "UNDEFINED_HANDLE", t[t.ENCODED_FALSE_HANDLE = 0] = "ENCODED_FALSE_HANDLE", t[t.ENCODED_TRUE_HANDLE = 1] = "ENCODED_TRUE_HANDLE", t[t.ENCODED_NULL_HANDLE = 2] = "ENCODED_NULL_HANDLE", t[t.ENCODED_UNDEFINED_HANDLE = 3] = "ENCODED_UNDEFINED_HANDLE", t;
|
|
535
|
+
}({});
|
|
536
|
+
function Ba(t) {
|
|
537
|
+
return t & Me.SIGN_BIT;
|
|
538
|
+
}
|
|
539
|
+
function ka(t) {
|
|
540
|
+
return t | ~Me.SIGN_BIT;
|
|
541
|
+
}
|
|
542
|
+
function xa(t) {
|
|
543
|
+
return ~t;
|
|
544
|
+
}
|
|
545
|
+
function Ta(t) {
|
|
546
|
+
return ~t;
|
|
547
|
+
}
|
|
548
|
+
function Na(t) {
|
|
549
|
+
return t |= 0, t < 0 ? Ba(t) : xa(t);
|
|
550
|
+
}
|
|
551
|
+
function Pa(t) {
|
|
552
|
+
return t |= 0, t > Me.SIGN_BIT ? Ta(t) : ka(t);
|
|
553
|
+
}
|
|
554
|
+
[1, -1].forEach((t) => Pa(Na(t)));
|
|
555
|
+
var Gr = Object.assign, Fa = console, cr = console;
|
|
556
|
+
function La(t, e = "unexpected unreachable branch") {
|
|
557
|
+
throw cr.log("unreachable", t), cr.log(`${e} :: ${JSON.stringify(t)} (${t})`), new Error("code reached unreachable");
|
|
558
|
+
}
|
|
559
|
+
var _a = function() {
|
|
560
|
+
var t = function(G, p, b, d) {
|
|
561
|
+
for (b = b || {}, d = G.length; d--; b[G[d]] = p) ;
|
|
562
|
+
return b;
|
|
563
|
+
}, e = [2, 44], r = [1, 20], n = [5, 14, 15, 19, 29, 34, 39, 44, 47, 48, 52, 56, 60], a = [1, 35], s = [1, 38], u = [1, 30], i = [1, 31], l = [1, 32], g = [1, 33], h = [1, 34], m = [1, 37], A = [14, 15, 19, 29, 34, 39, 44, 47, 48, 52, 56, 60], y = [14, 15, 19, 29, 34, 44, 47, 48, 52, 56, 60], C = [15, 18], T = [14, 15, 19, 29, 34, 47, 48, 52, 56, 60], x = [33, 64, 71, 79, 80, 81, 82, 83, 84], B = [23, 33, 55, 64, 67, 71, 74, 79, 80, 81, 82, 83, 84], U = [1, 51], j = [23, 33, 55, 64, 67, 71, 74, 79, 80, 81, 82, 83, 84, 86], J = [2, 43], dt = [55, 64, 71, 79, 80, 81, 82, 83, 84], mt = [1, 58], Y = [1, 59], tt = [1, 66], $ = [33, 64, 71, 74, 79, 80, 81, 82, 83, 84], ft = [23, 64, 71, 79, 80, 81, 82, 83, 84], V = [1, 76], et = [64, 67, 71, 79, 80, 81, 82, 83, 84], P = [33, 74], rt = [23, 33, 55, 67, 71, 74], Vt = [1, 106], se = [1, 118], Qe = [71, 76], ue = { trace: function() {
|
|
564
|
+
}, yy: {}, symbols_: { error: 2, root: 3, program: 4, EOF: 5, program_repetition0: 6, statement: 7, mustache: 8, block: 9, rawBlock: 10, partial: 11, partialBlock: 12, content: 13, COMMENT: 14, CONTENT: 15, openRawBlock: 16, rawBlock_repetition0: 17, END_RAW_BLOCK: 18, OPEN_RAW_BLOCK: 19, helperName: 20, openRawBlock_repetition0: 21, openRawBlock_option0: 22, CLOSE_RAW_BLOCK: 23, openBlock: 24, block_option0: 25, closeBlock: 26, openInverse: 27, block_option1: 28, OPEN_BLOCK: 29, openBlock_repetition0: 30, openBlock_option0: 31, openBlock_option1: 32, CLOSE: 33, OPEN_INVERSE: 34, openInverse_repetition0: 35, openInverse_option0: 36, openInverse_option1: 37, openInverseChain: 38, OPEN_INVERSE_CHAIN: 39, openInverseChain_repetition0: 40, openInverseChain_option0: 41, openInverseChain_option1: 42, inverseAndProgram: 43, INVERSE: 44, inverseChain: 45, inverseChain_option0: 46, OPEN_ENDBLOCK: 47, OPEN: 48, expr: 49, mustache_repetition0: 50, mustache_option0: 51, OPEN_UNESCAPED: 52, mustache_repetition1: 53, mustache_option1: 54, CLOSE_UNESCAPED: 55, OPEN_PARTIAL: 56, partial_repetition0: 57, partial_option0: 58, openPartialBlock: 59, OPEN_PARTIAL_BLOCK: 60, openPartialBlock_repetition0: 61, openPartialBlock_option0: 62, sexpr: 63, OPEN_SEXPR: 64, sexpr_repetition0: 65, sexpr_option0: 66, CLOSE_SEXPR: 67, hash: 68, hash_repetition_plus0: 69, hashSegment: 70, ID: 71, EQUALS: 72, blockParams: 73, OPEN_BLOCK_PARAMS: 74, blockParams_repetition_plus0: 75, CLOSE_BLOCK_PARAMS: 76, path: 77, dataName: 78, STRING: 79, NUMBER: 80, BOOLEAN: 81, UNDEFINED: 82, NULL: 83, DATA: 84, pathSegments: 85, SEP: 86, $accept: 0, $end: 1 }, terminals_: { 2: "error", 5: "EOF", 14: "COMMENT", 15: "CONTENT", 18: "END_RAW_BLOCK", 19: "OPEN_RAW_BLOCK", 23: "CLOSE_RAW_BLOCK", 29: "OPEN_BLOCK", 33: "CLOSE", 34: "OPEN_INVERSE", 39: "OPEN_INVERSE_CHAIN", 44: "INVERSE", 47: "OPEN_ENDBLOCK", 48: "OPEN", 52: "OPEN_UNESCAPED", 55: "CLOSE_UNESCAPED", 56: "OPEN_PARTIAL", 60: "OPEN_PARTIAL_BLOCK", 64: "OPEN_SEXPR", 67: "CLOSE_SEXPR", 71: "ID", 72: "EQUALS", 74: "OPEN_BLOCK_PARAMS", 76: "CLOSE_BLOCK_PARAMS", 79: "STRING", 80: "NUMBER", 81: "BOOLEAN", 82: "UNDEFINED", 83: "NULL", 84: "DATA", 86: "SEP" }, productions_: [0, [3, 2], [4, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [13, 1], [10, 3], [16, 5], [9, 4], [9, 4], [24, 6], [27, 6], [38, 6], [43, 2], [45, 3], [45, 1], [26, 3], [8, 5], [8, 5], [11, 5], [12, 3], [59, 5], [49, 1], [49, 1], [63, 5], [68, 1], [70, 3], [73, 3], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [78, 2], [77, 1], [85, 3], [85, 1], [6, 0], [6, 2], [17, 0], [17, 2], [21, 0], [21, 2], [22, 0], [22, 1], [25, 0], [25, 1], [28, 0], [28, 1], [30, 0], [30, 2], [31, 0], [31, 1], [32, 0], [32, 1], [35, 0], [35, 2], [36, 0], [36, 1], [37, 0], [37, 1], [40, 0], [40, 2], [41, 0], [41, 1], [42, 0], [42, 1], [46, 0], [46, 1], [50, 0], [50, 2], [51, 0], [51, 1], [53, 0], [53, 2], [54, 0], [54, 1], [57, 0], [57, 2], [58, 0], [58, 1], [61, 0], [61, 2], [62, 0], [62, 1], [65, 0], [65, 2], [66, 0], [66, 1], [69, 1], [69, 2], [75, 1], [75, 2]], performAction: function(G, p, b, d, E, o, _) {
|
|
565
|
+
var c = o.length - 1;
|
|
566
|
+
switch (E) {
|
|
567
|
+
case 1:
|
|
568
|
+
return o[c - 1];
|
|
569
|
+
case 2:
|
|
570
|
+
this.$ = d.prepareProgram(o[c]);
|
|
571
|
+
break;
|
|
572
|
+
case 3:
|
|
573
|
+
case 4:
|
|
574
|
+
case 5:
|
|
575
|
+
case 6:
|
|
576
|
+
case 7:
|
|
577
|
+
case 8:
|
|
578
|
+
case 20:
|
|
579
|
+
case 27:
|
|
580
|
+
case 28:
|
|
581
|
+
case 33:
|
|
582
|
+
case 34:
|
|
583
|
+
this.$ = o[c];
|
|
584
|
+
break;
|
|
585
|
+
case 9:
|
|
586
|
+
this.$ = { type: "CommentStatement", value: d.stripComment(o[c]), strip: d.stripFlags(o[c], o[c]), loc: d.locInfo(this._$) };
|
|
587
|
+
break;
|
|
588
|
+
case 10:
|
|
589
|
+
this.$ = { type: "ContentStatement", original: o[c], value: o[c], loc: d.locInfo(this._$) };
|
|
590
|
+
break;
|
|
591
|
+
case 11:
|
|
592
|
+
this.$ = d.prepareRawBlock(o[c - 2], o[c - 1], o[c], this._$);
|
|
593
|
+
break;
|
|
594
|
+
case 12:
|
|
595
|
+
this.$ = { path: o[c - 3], params: o[c - 2], hash: o[c - 1] };
|
|
596
|
+
break;
|
|
597
|
+
case 13:
|
|
598
|
+
this.$ = d.prepareBlock(o[c - 3], o[c - 2], o[c - 1], o[c], !1, this._$);
|
|
599
|
+
break;
|
|
600
|
+
case 14:
|
|
601
|
+
this.$ = d.prepareBlock(o[c - 3], o[c - 2], o[c - 1], o[c], !0, this._$);
|
|
602
|
+
break;
|
|
603
|
+
case 15:
|
|
604
|
+
this.$ = { open: o[c - 5], path: o[c - 4], params: o[c - 3], hash: o[c - 2], blockParams: o[c - 1], strip: d.stripFlags(o[c - 5], o[c]) };
|
|
605
|
+
break;
|
|
606
|
+
case 16:
|
|
607
|
+
case 17:
|
|
608
|
+
this.$ = { path: o[c - 4], params: o[c - 3], hash: o[c - 2], blockParams: o[c - 1], strip: d.stripFlags(o[c - 5], o[c]) };
|
|
609
|
+
break;
|
|
610
|
+
case 18:
|
|
611
|
+
this.$ = { strip: d.stripFlags(o[c - 1], o[c - 1]), program: o[c] };
|
|
612
|
+
break;
|
|
613
|
+
case 19:
|
|
614
|
+
var Rt = d.prepareBlock(o[c - 2], o[c - 1], o[c], o[c], !1, this._$), Ut = d.prepareProgram([Rt], o[c - 1].loc);
|
|
615
|
+
Ut.chained = !0, this.$ = { strip: o[c - 2].strip, program: Ut, chain: !0 };
|
|
616
|
+
break;
|
|
617
|
+
case 21:
|
|
618
|
+
this.$ = { path: o[c - 1], strip: d.stripFlags(o[c - 2], o[c]) };
|
|
619
|
+
break;
|
|
620
|
+
case 22:
|
|
621
|
+
case 23:
|
|
622
|
+
this.$ = d.prepareMustache(o[c - 3], o[c - 2], o[c - 1], o[c - 4], d.stripFlags(o[c - 4], o[c]), this._$);
|
|
623
|
+
break;
|
|
624
|
+
case 24:
|
|
625
|
+
this.$ = { type: "PartialStatement", name: o[c - 3], params: o[c - 2], hash: o[c - 1], indent: "", strip: d.stripFlags(o[c - 4], o[c]), loc: d.locInfo(this._$) };
|
|
626
|
+
break;
|
|
627
|
+
case 25:
|
|
628
|
+
this.$ = d.preparePartialBlock(o[c - 2], o[c - 1], o[c], this._$);
|
|
629
|
+
break;
|
|
630
|
+
case 26:
|
|
631
|
+
this.$ = { path: o[c - 3], params: o[c - 2], hash: o[c - 1], strip: d.stripFlags(o[c - 4], o[c]) };
|
|
632
|
+
break;
|
|
633
|
+
case 29:
|
|
634
|
+
this.$ = { type: "SubExpression", path: o[c - 3], params: o[c - 2], hash: o[c - 1], loc: d.locInfo(this._$) };
|
|
635
|
+
break;
|
|
636
|
+
case 30:
|
|
637
|
+
this.$ = { type: "Hash", pairs: o[c], loc: d.locInfo(this._$) };
|
|
638
|
+
break;
|
|
639
|
+
case 31:
|
|
640
|
+
this.$ = { type: "HashPair", key: d.id(o[c - 2]), value: o[c], loc: d.locInfo(this._$) };
|
|
641
|
+
break;
|
|
642
|
+
case 32:
|
|
643
|
+
this.$ = d.id(o[c - 1]);
|
|
644
|
+
break;
|
|
645
|
+
case 35:
|
|
646
|
+
this.$ = { type: "StringLiteral", value: o[c], original: o[c], loc: d.locInfo(this._$) };
|
|
647
|
+
break;
|
|
648
|
+
case 36:
|
|
649
|
+
this.$ = { type: "NumberLiteral", value: Number(o[c]), original: Number(o[c]), loc: d.locInfo(this._$) };
|
|
650
|
+
break;
|
|
651
|
+
case 37:
|
|
652
|
+
this.$ = { type: "BooleanLiteral", value: o[c] === "true", original: o[c] === "true", loc: d.locInfo(this._$) };
|
|
653
|
+
break;
|
|
654
|
+
case 38:
|
|
655
|
+
this.$ = { type: "UndefinedLiteral", original: void 0, value: void 0, loc: d.locInfo(this._$) };
|
|
656
|
+
break;
|
|
657
|
+
case 39:
|
|
658
|
+
this.$ = { type: "NullLiteral", original: null, value: null, loc: d.locInfo(this._$) };
|
|
659
|
+
break;
|
|
660
|
+
case 40:
|
|
661
|
+
this.$ = d.preparePath(!0, o[c], this._$);
|
|
662
|
+
break;
|
|
663
|
+
case 41:
|
|
664
|
+
this.$ = d.preparePath(!1, o[c], this._$);
|
|
665
|
+
break;
|
|
666
|
+
case 42:
|
|
667
|
+
o[c - 2].push({ part: d.id(o[c]), original: o[c], separator: o[c - 1] }), this.$ = o[c - 2];
|
|
668
|
+
break;
|
|
669
|
+
case 43:
|
|
670
|
+
this.$ = [{ part: d.id(o[c]), original: o[c] }];
|
|
671
|
+
break;
|
|
672
|
+
case 44:
|
|
673
|
+
case 46:
|
|
674
|
+
case 48:
|
|
675
|
+
case 56:
|
|
676
|
+
case 62:
|
|
677
|
+
case 68:
|
|
678
|
+
case 76:
|
|
679
|
+
case 80:
|
|
680
|
+
case 84:
|
|
681
|
+
case 88:
|
|
682
|
+
case 92:
|
|
683
|
+
this.$ = [];
|
|
684
|
+
break;
|
|
685
|
+
case 45:
|
|
686
|
+
case 47:
|
|
687
|
+
case 49:
|
|
688
|
+
case 57:
|
|
689
|
+
case 63:
|
|
690
|
+
case 69:
|
|
691
|
+
case 77:
|
|
692
|
+
case 81:
|
|
693
|
+
case 85:
|
|
694
|
+
case 89:
|
|
695
|
+
case 93:
|
|
696
|
+
case 97:
|
|
697
|
+
case 99:
|
|
698
|
+
o[c - 1].push(o[c]);
|
|
699
|
+
break;
|
|
700
|
+
case 96:
|
|
701
|
+
case 98:
|
|
702
|
+
this.$ = [o[c]];
|
|
703
|
+
break;
|
|
704
|
+
}
|
|
705
|
+
}, table: [t([5, 14, 15, 19, 29, 34, 48, 52, 56, 60], e, { 3: 1, 4: 2, 6: 3 }), { 1: [3] }, { 5: [1, 4] }, t([5, 39, 44, 47], [2, 2], { 7: 5, 8: 6, 9: 7, 10: 8, 11: 9, 12: 10, 13: 11, 24: 15, 27: 16, 16: 17, 59: 19, 14: [1, 12], 15: r, 19: [1, 23], 29: [1, 21], 34: [1, 22], 48: [1, 13], 52: [1, 14], 56: [1, 18], 60: [1, 24] }), { 1: [2, 1] }, t(n, [2, 45]), t(n, [2, 3]), t(n, [2, 4]), t(n, [2, 5]), t(n, [2, 6]), t(n, [2, 7]), t(n, [2, 8]), t(n, [2, 9]), { 20: 26, 49: 25, 63: 27, 64: a, 71: s, 77: 28, 78: 29, 79: u, 80: i, 81: l, 82: g, 83: h, 84: m, 85: 36 }, { 20: 26, 49: 39, 63: 27, 64: a, 71: s, 77: 28, 78: 29, 79: u, 80: i, 81: l, 82: g, 83: h, 84: m, 85: 36 }, t(A, e, { 6: 3, 4: 40 }), t(y, e, { 6: 3, 4: 41 }), t(C, [2, 46], { 17: 42 }), { 20: 26, 49: 43, 63: 27, 64: a, 71: s, 77: 28, 78: 29, 79: u, 80: i, 81: l, 82: g, 83: h, 84: m, 85: 36 }, t(T, e, { 6: 3, 4: 44 }), t([5, 14, 15, 18, 19, 29, 34, 39, 44, 47, 48, 52, 56, 60], [2, 10]), { 20: 45, 71: s, 77: 28, 78: 29, 79: u, 80: i, 81: l, 82: g, 83: h, 84: m, 85: 36 }, { 20: 46, 71: s, 77: 28, 78: 29, 79: u, 80: i, 81: l, 82: g, 83: h, 84: m, 85: 36 }, { 20: 47, 71: s, 77: 28, 78: 29, 79: u, 80: i, 81: l, 82: g, 83: h, 84: m, 85: 36 }, { 20: 26, 49: 48, 63: 27, 64: a, 71: s, 77: 28, 78: 29, 79: u, 80: i, 81: l, 82: g, 83: h, 84: m, 85: 36 }, t(x, [2, 76], { 50: 49 }), t(B, [2, 27]), t(B, [2, 28]), t(B, [2, 33]), t(B, [2, 34]), t(B, [2, 35]), t(B, [2, 36]), t(B, [2, 37]), t(B, [2, 38]), t(B, [2, 39]), { 20: 26, 49: 50, 63: 27, 64: a, 71: s, 77: 28, 78: 29, 79: u, 80: i, 81: l, 82: g, 83: h, 84: m, 85: 36 }, t(B, [2, 41], { 86: U }), { 71: s, 85: 52 }, t(j, J), t(dt, [2, 80], { 53: 53 }), { 25: 54, 38: 56, 39: mt, 43: 57, 44: Y, 45: 55, 47: [2, 52] }, { 28: 60, 43: 61, 44: Y, 47: [2, 54] }, { 13: 63, 15: r, 18: [1, 62] }, t(x, [2, 84], { 57: 64 }), { 26: 65, 47: tt }, t($, [2, 56], { 30: 67 }), t($, [2, 62], { 35: 68 }), t(ft, [2, 48], { 21: 69 }), t(x, [2, 88], { 61: 70 }), { 20: 26, 33: [2, 78], 49: 72, 51: 71, 63: 27, 64: a, 68: 73, 69: 74, 70: 75, 71: V, 77: 28, 78: 29, 79: u, 80: i, 81: l, 82: g, 83: h, 84: m, 85: 36 }, t(et, [2, 92], { 65: 77 }), { 71: [1, 78] }, t(B, [2, 40], { 86: U }), { 20: 26, 49: 80, 54: 79, 55: [2, 82], 63: 27, 64: a, 68: 81, 69: 74, 70: 75, 71: V, 77: 28, 78: 29, 79: u, 80: i, 81: l, 82: g, 83: h, 84: m, 85: 36 }, { 26: 82, 47: tt }, { 47: [2, 53] }, t(A, e, { 6: 3, 4: 83 }), { 47: [2, 20] }, { 20: 84, 71: s, 77: 28, 78: 29, 79: u, 80: i, 81: l, 82: g, 83: h, 84: m, 85: 36 }, t(T, e, { 6: 3, 4: 85 }), { 26: 86, 47: tt }, { 47: [2, 55] }, t(n, [2, 11]), t(C, [2, 47]), { 20: 26, 33: [2, 86], 49: 88, 58: 87, 63: 27, 64: a, 68: 89, 69: 74, 70: 75, 71: V, 77: 28, 78: 29, 79: u, 80: i, 81: l, 82: g, 83: h, 84: m, 85: 36 }, t(n, [2, 25]), { 20: 90, 71: s, 77: 28, 78: 29, 79: u, 80: i, 81: l, 82: g, 83: h, 84: m, 85: 36 }, t(P, [2, 58], { 20: 26, 63: 27, 77: 28, 78: 29, 85: 36, 69: 74, 70: 75, 31: 91, 49: 92, 68: 93, 64: a, 71: V, 79: u, 80: i, 81: l, 82: g, 83: h, 84: m }), t(P, [2, 64], { 20: 26, 63: 27, 77: 28, 78: 29, 85: 36, 69: 74, 70: 75, 36: 94, 49: 95, 68: 96, 64: a, 71: V, 79: u, 80: i, 81: l, 82: g, 83: h, 84: m }), { 20: 26, 22: 97, 23: [2, 50], 49: 98, 63: 27, 64: a, 68: 99, 69: 74, 70: 75, 71: V, 77: 28, 78: 29, 79: u, 80: i, 81: l, 82: g, 83: h, 84: m, 85: 36 }, { 20: 26, 33: [2, 90], 49: 101, 62: 100, 63: 27, 64: a, 68: 102, 69: 74, 70: 75, 71: V, 77: 28, 78: 29, 79: u, 80: i, 81: l, 82: g, 83: h, 84: m, 85: 36 }, { 33: [1, 103] }, t(x, [2, 77]), { 33: [2, 79] }, t([23, 33, 55, 67, 74], [2, 30], { 70: 104, 71: [1, 105] }), t(rt, [2, 96]), t(j, J, { 72: Vt }), { 20: 26, 49: 108, 63: 27, 64: a, 66: 107, 67: [2, 94], 68: 109, 69: 74, 70: 75, 71: V, 77: 28, 78: 29, 79: u, 80: i, 81: l, 82: g, 83: h, 84: m, 85: 36 }, t(j, [2, 42]), { 55: [1, 110] }, t(dt, [2, 81]), { 55: [2, 83] }, t(n, [2, 13]), { 38: 56, 39: mt, 43: 57, 44: Y, 45: 112, 46: 111, 47: [2, 74] }, t($, [2, 68], { 40: 113 }), { 47: [2, 18] }, t(n, [2, 14]), { 33: [1, 114] }, t(x, [2, 85]), { 33: [2, 87] }, { 33: [1, 115] }, { 32: 116, 33: [2, 60], 73: 117, 74: se }, t($, [2, 57]), t(P, [2, 59]), { 33: [2, 66], 37: 119, 73: 120, 74: se }, t($, [2, 63]), t(P, [2, 65]), { 23: [1, 121] }, t(ft, [2, 49]), { 23: [2, 51] }, { 33: [1, 122] }, t(x, [2, 89]), { 33: [2, 91] }, t(n, [2, 22]), t(rt, [2, 97]), { 72: Vt }, { 20: 26, 49: 123, 63: 27, 64: a, 71: s, 77: 28, 78: 29, 79: u, 80: i, 81: l, 82: g, 83: h, 84: m, 85: 36 }, { 67: [1, 124] }, t(et, [2, 93]), { 67: [2, 95] }, t(n, [2, 23]), { 47: [2, 19] }, { 47: [2, 75] }, t(P, [2, 70], { 20: 26, 63: 27, 77: 28, 78: 29, 85: 36, 69: 74, 70: 75, 41: 125, 49: 126, 68: 127, 64: a, 71: V, 79: u, 80: i, 81: l, 82: g, 83: h, 84: m }), t(n, [2, 24]), t(n, [2, 21]), { 33: [1, 128] }, { 33: [2, 61] }, { 71: [1, 130], 75: 129 }, { 33: [1, 131] }, { 33: [2, 67] }, t(C, [2, 12]), t(T, [2, 26]), t(rt, [2, 31]), t(B, [2, 29]), { 33: [2, 72], 42: 132, 73: 133, 74: se }, t($, [2, 69]), t(P, [2, 71]), t(A, [2, 15]), { 71: [1, 135], 76: [1, 134] }, t(Qe, [2, 98]), t(y, [2, 16]), { 33: [1, 136] }, { 33: [2, 73] }, { 33: [2, 32] }, t(Qe, [2, 99]), t(A, [2, 17])], defaultActions: { 4: [2, 1], 55: [2, 53], 57: [2, 20], 61: [2, 55], 73: [2, 79], 81: [2, 83], 85: [2, 18], 89: [2, 87], 99: [2, 51], 102: [2, 91], 109: [2, 95], 111: [2, 19], 112: [2, 75], 117: [2, 61], 120: [2, 67], 133: [2, 73], 134: [2, 32] }, parseError: function(G, p) {
|
|
706
|
+
if (p.recoverable) this.trace(G);
|
|
707
|
+
else {
|
|
708
|
+
var b = new Error(G);
|
|
709
|
+
throw b.hash = p, b;
|
|
710
|
+
}
|
|
711
|
+
}, parse: function(G) {
|
|
712
|
+
var p = this, b = [0], d = [null], E = [], o = this.table, _ = "", c = 0, Rt = 0, Ut = 0, on = 2, Je = 1, ln = E.slice.call(arguments, 1), N = Object.create(this.lexer), lt = { yy: {} };
|
|
713
|
+
for (var oe in this.yy) Object.prototype.hasOwnProperty.call(this.yy, oe) && (lt.yy[oe] = this.yy[oe]);
|
|
714
|
+
N.setInput(G, lt.yy), lt.yy.lexer = N, lt.yy.parser = this, typeof N.yylloc > "u" && (N.yylloc = {});
|
|
715
|
+
var le = N.yylloc;
|
|
716
|
+
E.push(le);
|
|
717
|
+
var cn = N.options && N.options.ranges;
|
|
718
|
+
typeof lt.yy.parseError == "function" ? this.parseError = lt.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
|
|
719
|
+
for (var hn = function() {
|
|
720
|
+
var bt;
|
|
721
|
+
return bt = N.lex() || Je, typeof bt != "number" && (bt = p.symbols_[bt] || bt), bt;
|
|
722
|
+
}, q, ce, ct, H, ou, he, gt = {}, Ht, X, Ye, Mt; ; ) {
|
|
723
|
+
if (ct = b[b.length - 1], this.defaultActions[ct] ? H = this.defaultActions[ct] : ((q === null || typeof q > "u") && (q = hn()), H = o[ct] && o[ct][q]), typeof H > "u" || !H.length || !H[0]) {
|
|
724
|
+
var pe = "";
|
|
725
|
+
Mt = [];
|
|
726
|
+
for (Ht in o[ct]) this.terminals_[Ht] && Ht > on && Mt.push("'" + this.terminals_[Ht] + "'");
|
|
727
|
+
N.showPosition ? pe = "Parse error on line " + (c + 1) + `:
|
|
728
|
+
` + N.showPosition() + `
|
|
729
|
+
Expecting ` + Mt.join(", ") + ", got '" + (this.terminals_[q] || q) + "'" : pe = "Parse error on line " + (c + 1) + ": Unexpected " + (q == Je ? "end of input" : "'" + (this.terminals_[q] || q) + "'"), this.parseError(pe, { text: N.match, token: this.terminals_[q] || q, line: N.yylineno, loc: le, expected: Mt });
|
|
730
|
+
}
|
|
731
|
+
if (H[0] instanceof Array && H.length > 1) throw new Error("Parse Error: multiple actions possible at state: " + ct + ", token: " + q);
|
|
732
|
+
switch (H[0]) {
|
|
733
|
+
case 1:
|
|
734
|
+
b.push(q), d.push(N.yytext), E.push(N.yylloc), b.push(H[1]), q = null, ce ? (q = ce, ce = null) : (Rt = N.yyleng, _ = N.yytext, c = N.yylineno, le = N.yylloc, Ut > 0);
|
|
735
|
+
break;
|
|
736
|
+
case 2:
|
|
737
|
+
if (X = this.productions_[H[1]][1], gt.$ = d[d.length - X], gt._$ = { first_line: E[E.length - (X || 1)].first_line, last_line: E[E.length - 1].last_line, first_column: E[E.length - (X || 1)].first_column, last_column: E[E.length - 1].last_column }, cn && (gt._$.range = [E[E.length - (X || 1)].range[0], E[E.length - 1].range[1]]), he = this.performAction.apply(gt, [_, Rt, c, lt.yy, H[1], d, E].concat(ln)), typeof he < "u") return he;
|
|
738
|
+
X && (b = b.slice(0, -1 * X * 2), d = d.slice(0, -1 * X), E = E.slice(0, -1 * X)), b.push(this.productions_[H[1]][0]), d.push(gt.$), E.push(gt._$), Ye = o[b[b.length - 2]][b[b.length - 1]], b.push(Ye);
|
|
739
|
+
break;
|
|
740
|
+
case 3:
|
|
741
|
+
return !0;
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
return !0;
|
|
745
|
+
} }, un = /* @__PURE__ */ function() {
|
|
746
|
+
var G = { EOF: 1, parseError: function(p, b) {
|
|
747
|
+
if (this.yy.parser) this.yy.parser.parseError(p, b);
|
|
748
|
+
else throw new Error(p);
|
|
749
|
+
}, setInput: function(p, b) {
|
|
750
|
+
return this.yy = b || this.yy || {}, this._input = p, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
|
|
751
|
+
}, input: function() {
|
|
752
|
+
var p = this._input[0];
|
|
753
|
+
this.yytext += p, this.yyleng++, this.offset++, this.match += p, this.matched += p;
|
|
754
|
+
var b = p.match(/(?:\r\n?|\n).*/g);
|
|
755
|
+
return b ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), p;
|
|
756
|
+
}, unput: function(p) {
|
|
757
|
+
var b = p.length, d = p.split(/(?:\r\n?|\n)/g);
|
|
758
|
+
this._input = p + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - b), this.offset -= b;
|
|
759
|
+
var E = this.match.split(/(?:\r\n?|\n)/g);
|
|
760
|
+
this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), d.length - 1 && (this.yylineno -= d.length - 1);
|
|
761
|
+
var o = this.yylloc.range;
|
|
762
|
+
return this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: d ? (d.length === E.length ? this.yylloc.first_column : 0) + E[E.length - d.length].length - d[0].length : this.yylloc.first_column - b }, this.options.ranges && (this.yylloc.range = [o[0], o[0] + this.yyleng - b]), this.yyleng = this.yytext.length, this;
|
|
763
|
+
}, more: function() {
|
|
764
|
+
return this._more = !0, this;
|
|
765
|
+
}, reject: function() {
|
|
766
|
+
if (this.options.backtrack_lexer) this._backtrack = !0;
|
|
767
|
+
else return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
768
|
+
` + this.showPosition(), { text: "", token: null, line: this.yylineno });
|
|
769
|
+
return this;
|
|
770
|
+
}, less: function(p) {
|
|
771
|
+
this.unput(this.match.slice(p));
|
|
772
|
+
}, pastInput: function() {
|
|
773
|
+
var p = this.matched.substr(0, this.matched.length - this.match.length);
|
|
774
|
+
return (p.length > 20 ? "..." : "") + p.substr(-20).replace(/\n/g, "");
|
|
775
|
+
}, upcomingInput: function() {
|
|
776
|
+
var p = this.match;
|
|
777
|
+
return p.length < 20 && (p += this._input.substr(0, 20 - p.length)), (p.substr(0, 20) + (p.length > 20 ? "..." : "")).replace(/\n/g, "");
|
|
778
|
+
}, showPosition: function() {
|
|
779
|
+
var p = this.pastInput(), b = new Array(p.length + 1).join("-");
|
|
780
|
+
return p + this.upcomingInput() + `
|
|
781
|
+
` + b + "^";
|
|
782
|
+
}, test_match: function(p, b) {
|
|
783
|
+
var d, E, o;
|
|
784
|
+
if (this.options.backtrack_lexer && (o = { yylineno: this.yylineno, yylloc: { first_line: this.yylloc.first_line, last_line: this.last_line, first_column: this.yylloc.first_column, last_column: this.yylloc.last_column }, yytext: this.yytext, match: this.match, matches: this.matches, matched: this.matched, yyleng: this.yyleng, offset: this.offset, _more: this._more, _input: this._input, yy: this.yy, conditionStack: this.conditionStack.slice(0), done: this.done }, this.options.ranges && (o.yylloc.range = this.yylloc.range.slice(0))), E = p[0].match(/(?:\r\n?|\n).*/g), E && (this.yylineno += E.length), this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: E ? E[E.length - 1].length - E[E.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + p[0].length }, this.yytext += p[0], this.match += p[0], this.matches = p, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(p[0].length), this.matched += p[0], d = this.performAction.call(this, this.yy, this, b, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), d) return d;
|
|
785
|
+
if (this._backtrack) {
|
|
786
|
+
for (var _ in o) this[_] = o[_];
|
|
787
|
+
return !1;
|
|
788
|
+
}
|
|
789
|
+
return !1;
|
|
790
|
+
}, next: function() {
|
|
791
|
+
if (this.done) return this.EOF;
|
|
792
|
+
this._input || (this.done = !0);
|
|
793
|
+
var p, b, d, E;
|
|
794
|
+
this._more || (this.yytext = "", this.match = "");
|
|
795
|
+
for (var o = this._currentRules(), _ = 0; _ < o.length; _++) if (d = this._input.match(this.rules[o[_]]), d && (!b || d[0].length > b[0].length)) {
|
|
796
|
+
if (b = d, E = _, this.options.backtrack_lexer) {
|
|
797
|
+
if (p = this.test_match(d, o[_]), p !== !1) return p;
|
|
798
|
+
if (this._backtrack) {
|
|
799
|
+
b = !1;
|
|
800
|
+
continue;
|
|
801
|
+
} else return !1;
|
|
802
|
+
} else if (!this.options.flex) break;
|
|
803
|
+
}
|
|
804
|
+
return b ? (p = this.test_match(b, o[E]), p !== !1 ? p : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
|
|
805
|
+
` + this.showPosition(), { text: "", token: null, line: this.yylineno });
|
|
806
|
+
}, lex: function() {
|
|
807
|
+
var p = this.next();
|
|
808
|
+
return p || this.lex();
|
|
809
|
+
}, begin: function(p) {
|
|
810
|
+
this.conditionStack.push(p);
|
|
811
|
+
}, popState: function() {
|
|
812
|
+
var p = this.conditionStack.length - 1;
|
|
813
|
+
return p > 0 ? this.conditionStack.pop() : this.conditionStack[0];
|
|
814
|
+
}, _currentRules: function() {
|
|
815
|
+
return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
|
|
816
|
+
}, topState: function(p) {
|
|
817
|
+
return p = this.conditionStack.length - 1 - Math.abs(p || 0), p >= 0 ? this.conditionStack[p] : "INITIAL";
|
|
818
|
+
}, pushState: function(p) {
|
|
819
|
+
this.begin(p);
|
|
820
|
+
}, stateStackSize: function() {
|
|
821
|
+
return this.conditionStack.length;
|
|
822
|
+
}, options: {}, performAction: function(p, b, d, E) {
|
|
823
|
+
function o(_, c) {
|
|
824
|
+
return b.yytext = b.yytext.substring(_, b.yyleng - c + _);
|
|
825
|
+
}
|
|
826
|
+
switch (d) {
|
|
827
|
+
case 0:
|
|
828
|
+
if (b.yytext.slice(-2) === "\\\\" ? (o(0, 1), this.begin("mu")) : b.yytext.slice(-1) === "\\" ? (o(0, 1), this.begin("emu")) : this.begin("mu"), b.yytext) return 15;
|
|
829
|
+
break;
|
|
830
|
+
case 1:
|
|
831
|
+
return 15;
|
|
832
|
+
case 2:
|
|
833
|
+
return this.popState(), 15;
|
|
834
|
+
case 3:
|
|
835
|
+
return this.begin("raw"), 15;
|
|
836
|
+
case 4:
|
|
837
|
+
return this.popState(), this.conditionStack[this.conditionStack.length - 1] === "raw" ? 15 : (o(5, 9), 18);
|
|
838
|
+
case 5:
|
|
839
|
+
return 15;
|
|
840
|
+
case 6:
|
|
841
|
+
return this.popState(), 14;
|
|
842
|
+
case 7:
|
|
843
|
+
return 64;
|
|
844
|
+
case 8:
|
|
845
|
+
return 67;
|
|
846
|
+
case 9:
|
|
847
|
+
return 19;
|
|
848
|
+
case 10:
|
|
849
|
+
return this.popState(), this.begin("raw"), 23;
|
|
850
|
+
case 11:
|
|
851
|
+
return 56;
|
|
852
|
+
case 12:
|
|
853
|
+
return 60;
|
|
854
|
+
case 13:
|
|
855
|
+
return 29;
|
|
856
|
+
case 14:
|
|
857
|
+
return 47;
|
|
858
|
+
case 15:
|
|
859
|
+
return this.popState(), 44;
|
|
860
|
+
case 16:
|
|
861
|
+
return this.popState(), 44;
|
|
862
|
+
case 17:
|
|
863
|
+
return 34;
|
|
864
|
+
case 18:
|
|
865
|
+
return 39;
|
|
866
|
+
case 19:
|
|
867
|
+
return 52;
|
|
868
|
+
case 20:
|
|
869
|
+
return 48;
|
|
870
|
+
case 21:
|
|
871
|
+
this.unput(b.yytext), this.popState(), this.begin("com");
|
|
872
|
+
break;
|
|
873
|
+
case 22:
|
|
874
|
+
return this.popState(), 14;
|
|
875
|
+
case 23:
|
|
876
|
+
return 48;
|
|
877
|
+
case 24:
|
|
878
|
+
return 72;
|
|
879
|
+
case 25:
|
|
880
|
+
return 71;
|
|
881
|
+
case 26:
|
|
882
|
+
return 71;
|
|
883
|
+
case 27:
|
|
884
|
+
return 86;
|
|
885
|
+
case 28:
|
|
886
|
+
break;
|
|
887
|
+
case 29:
|
|
888
|
+
return this.popState(), 55;
|
|
889
|
+
case 30:
|
|
890
|
+
return this.popState(), 33;
|
|
891
|
+
case 31:
|
|
892
|
+
return b.yytext = o(1, 2).replace(/\\"/g, '"'), 79;
|
|
893
|
+
case 32:
|
|
894
|
+
return b.yytext = o(1, 2).replace(/\\'/g, "'"), 79;
|
|
895
|
+
case 33:
|
|
896
|
+
return 84;
|
|
897
|
+
case 34:
|
|
898
|
+
return 81;
|
|
899
|
+
case 35:
|
|
900
|
+
return 81;
|
|
901
|
+
case 36:
|
|
902
|
+
return 82;
|
|
903
|
+
case 37:
|
|
904
|
+
return 83;
|
|
905
|
+
case 38:
|
|
906
|
+
return 80;
|
|
907
|
+
case 39:
|
|
908
|
+
return 74;
|
|
909
|
+
case 40:
|
|
910
|
+
return 76;
|
|
911
|
+
case 41:
|
|
912
|
+
return 71;
|
|
913
|
+
case 42:
|
|
914
|
+
return b.yytext = b.yytext.replace(/\\([\\\]])/g, "$1"), 71;
|
|
915
|
+
case 43:
|
|
916
|
+
return "INVALID";
|
|
917
|
+
case 44:
|
|
918
|
+
return 5;
|
|
919
|
+
}
|
|
920
|
+
}, rules: [/^(?:[^\x00]*?(?=(\{\{)))/, /^(?:[^\x00]+)/, /^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/, /^(?:\{\{\{\{(?=[^/]))/, /^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/, /^(?:[^\x00]+?(?=(\{\{\{\{)))/, /^(?:[\s\S]*?--(~)?\}\})/, /^(?:\()/, /^(?:\))/, /^(?:\{\{\{\{)/, /^(?:\}\}\}\})/, /^(?:\{\{(~)?>)/, /^(?:\{\{(~)?#>)/, /^(?:\{\{(~)?#\*?)/, /^(?:\{\{(~)?\/)/, /^(?:\{\{(~)?\^\s*(~)?\}\})/, /^(?:\{\{(~)?\s*else\s*(~)?\}\})/, /^(?:\{\{(~)?\^)/, /^(?:\{\{(~)?\s*else\b)/, /^(?:\{\{(~)?\{)/, /^(?:\{\{(~)?&)/, /^(?:\{\{(~)?!--)/, /^(?:\{\{(~)?![\s\S]*?\}\})/, /^(?:\{\{(~)?\*?)/, /^(?:=)/, /^(?:\.\.)/, /^(?:\.(?=([=~}\s\/.)|])))/, /^(?:[\/.])/, /^(?:\s+)/, /^(?:\}(~)?\}\})/, /^(?:(~)?\}\})/, /^(?:"(\\["]|[^"])*")/, /^(?:'(\\[']|[^'])*')/, /^(?:@)/, /^(?:true(?=([~}\s)])))/, /^(?:false(?=([~}\s)])))/, /^(?:undefined(?=([~}\s)])))/, /^(?:null(?=([~}\s)])))/, /^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/, /^(?:as\s+\|)/, /^(?:\|)/, /^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/, /^(?:\[(\\\]|[^\]])*\])/, /^(?:.)/, /^(?:$)/], conditions: { mu: { rules: [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44], inclusive: !1 }, emu: { rules: [2], inclusive: !1 }, com: { rules: [6], inclusive: !1 }, raw: { rules: [3, 4, 5], inclusive: !1 }, INITIAL: { rules: [0, 1, 44], inclusive: !0 } } };
|
|
921
|
+
return G;
|
|
922
|
+
}();
|
|
923
|
+
ue.lexer = un;
|
|
924
|
+
function ie() {
|
|
925
|
+
this.yy = {};
|
|
926
|
+
}
|
|
927
|
+
return ie.prototype = ue, ue.Parser = ie, new ie();
|
|
928
|
+
}(), de = _a, me = ["description", "fileName", "lineNumber", "endLineNumber", "message", "name", "number", "stack"];
|
|
929
|
+
function ze(t, e) {
|
|
930
|
+
var r = e && e.loc, n, a, s, u;
|
|
931
|
+
r && (n = r.start.line, a = r.end.line, s = r.start.column, u = r.end.column, t += " - " + n + ":" + s);
|
|
932
|
+
for (var i = Error.prototype.constructor.call(this, t), l = 0; l < me.length; l++) this[me[l]] = i[me[l]];
|
|
933
|
+
Error.captureStackTrace && Error.captureStackTrace(this, ze);
|
|
934
|
+
try {
|
|
935
|
+
r && (this.lineNumber = n, this.endLineNumber = a, Object.defineProperty ? (Object.defineProperty(this, "column", { value: s, enumerable: !0 }), Object.defineProperty(this, "endColumn", { value: u, enumerable: !0 })) : (this.column = s, this.endColumn = u));
|
|
936
|
+
} catch {
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
ze.prototype = new Error();
|
|
940
|
+
var Et = ze;
|
|
941
|
+
function Kt() {
|
|
942
|
+
this.parents = [];
|
|
943
|
+
}
|
|
944
|
+
Kt.prototype = { constructor: Kt, mutating: !1, acceptKey: function(t, e) {
|
|
945
|
+
var r = this.accept(t[e]);
|
|
946
|
+
if (this.mutating) {
|
|
947
|
+
if (r && !Kt.prototype[r.type]) throw new Et('Unexpected node type "' + r.type + '" found when accepting ' + e + " on " + t.type);
|
|
948
|
+
t[e] = r;
|
|
949
|
+
}
|
|
950
|
+
}, acceptRequired: function(t, e) {
|
|
951
|
+
if (this.acceptKey(t, e), !t[e]) throw new Et(t.type + " requires " + e);
|
|
952
|
+
}, acceptArray: function(t) {
|
|
953
|
+
for (var e = 0, r = t.length; e < r; e++) this.acceptKey(t, e), t[e] || (t.splice(e, 1), e--, r--);
|
|
954
|
+
}, accept: function(t) {
|
|
955
|
+
if (t) {
|
|
956
|
+
if (!this[t.type]) throw new Et("Unknown type: " + t.type, t);
|
|
957
|
+
this.current && this.parents.unshift(this.current), this.current = t;
|
|
958
|
+
var e = this[t.type](t);
|
|
959
|
+
if (this.current = this.parents.shift(), !this.mutating || e) return e;
|
|
960
|
+
if (e !== !1) return t;
|
|
961
|
+
}
|
|
962
|
+
}, Program: function(t) {
|
|
963
|
+
this.acceptArray(t.body);
|
|
964
|
+
}, MustacheStatement: Qt, Decorator: Qt, BlockStatement: hr, DecoratorBlock: hr, PartialStatement: pr, PartialBlockStatement: function(t) {
|
|
965
|
+
pr.call(this, t), this.acceptKey(t, "program");
|
|
966
|
+
}, ContentStatement: function() {
|
|
967
|
+
}, CommentStatement: function() {
|
|
968
|
+
}, SubExpression: Qt, PathExpression: function() {
|
|
969
|
+
}, StringLiteral: function() {
|
|
970
|
+
}, NumberLiteral: function() {
|
|
971
|
+
}, BooleanLiteral: function() {
|
|
972
|
+
}, UndefinedLiteral: function() {
|
|
973
|
+
}, NullLiteral: function() {
|
|
974
|
+
}, Hash: function(t) {
|
|
975
|
+
this.acceptArray(t.pairs);
|
|
976
|
+
}, HashPair: function(t) {
|
|
977
|
+
this.acceptRequired(t, "value");
|
|
978
|
+
} };
|
|
979
|
+
function Qt(t) {
|
|
980
|
+
this.acceptRequired(t, "path"), this.acceptArray(t.params), this.acceptKey(t, "hash");
|
|
981
|
+
}
|
|
982
|
+
function hr(t) {
|
|
983
|
+
Qt.call(this, t), this.acceptKey(t, "program"), this.acceptKey(t, "inverse");
|
|
984
|
+
}
|
|
985
|
+
function pr(t) {
|
|
986
|
+
this.acceptRequired(t, "name"), this.acceptArray(t.params), this.acceptKey(t, "hash");
|
|
987
|
+
}
|
|
988
|
+
var qa = Kt;
|
|
989
|
+
function Q(t) {
|
|
990
|
+
t === void 0 && (t = {}), this.options = t;
|
|
991
|
+
}
|
|
992
|
+
Q.prototype = new qa();
|
|
993
|
+
Q.prototype.Program = function(t) {
|
|
994
|
+
var e = !this.options.ignoreStandalone, r = !this.isRootSeen;
|
|
995
|
+
this.isRootSeen = !0;
|
|
996
|
+
for (var n = t.body, a = 0, s = n.length; a < s; a++) {
|
|
997
|
+
var u = n[a], i = this.accept(u);
|
|
998
|
+
if (i) {
|
|
999
|
+
var l = Ce(n, a, r), g = Se(n, a, r), h = i.openStandalone && l, m = i.closeStandalone && g, A = i.inlineStandalone && l && g;
|
|
1000
|
+
i.close && ht(n, a, !0), i.open && at(n, a, !0), e && A && (ht(n, a), at(n, a) && u.type === "PartialStatement" && (u.indent = /([ \t]+$)/.exec(n[a - 1].original)[1])), e && h && (ht((u.program || u.inverse).body), at(n, a)), e && m && (ht(n, a), at((u.inverse || u.program).body));
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
return t;
|
|
1004
|
+
};
|
|
1005
|
+
Q.prototype.BlockStatement = Q.prototype.DecoratorBlock = Q.prototype.PartialBlockStatement = function(t) {
|
|
1006
|
+
this.accept(t.program), this.accept(t.inverse);
|
|
1007
|
+
var e = t.program || t.inverse, r = t.program && t.inverse, n = r, a = r;
|
|
1008
|
+
if (r && r.chained) for (n = r.body[0].program; a.chained; ) a = a.body[a.body.length - 1].program;
|
|
1009
|
+
var s = { open: t.openStrip.open, close: t.closeStrip.close, openStandalone: Se(e.body), closeStandalone: Ce((n || e).body) };
|
|
1010
|
+
if (t.openStrip.close && ht(e.body, null, !0), r) {
|
|
1011
|
+
var u = t.inverseStrip;
|
|
1012
|
+
u.open && at(e.body, null, !0), u.close && ht(n.body, null, !0), t.closeStrip.open && at(a.body, null, !0), !this.options.ignoreStandalone && Ce(e.body) && Se(n.body) && (at(e.body), ht(n.body));
|
|
1013
|
+
} else t.closeStrip.open && at(e.body, null, !0);
|
|
1014
|
+
return s;
|
|
1015
|
+
};
|
|
1016
|
+
Q.prototype.Decorator = Q.prototype.MustacheStatement = function(t) {
|
|
1017
|
+
return t.strip;
|
|
1018
|
+
};
|
|
1019
|
+
Q.prototype.PartialStatement = Q.prototype.CommentStatement = function(t) {
|
|
1020
|
+
var e = t.strip || {};
|
|
1021
|
+
return { inlineStandalone: !0, open: e.open, close: e.close };
|
|
1022
|
+
};
|
|
1023
|
+
function Ce(t, e, r) {
|
|
1024
|
+
e === void 0 && (e = t.length);
|
|
1025
|
+
var n = t[e - 1], a = t[e - 2];
|
|
1026
|
+
if (!n) return r;
|
|
1027
|
+
if (n.type === "ContentStatement") return (a || !r ? /\r?\n\s*?$/ : /(^|\r?\n)\s*?$/).test(n.original);
|
|
1028
|
+
}
|
|
1029
|
+
function Se(t, e, r) {
|
|
1030
|
+
e === void 0 && (e = -1);
|
|
1031
|
+
var n = t[e + 1], a = t[e + 2];
|
|
1032
|
+
if (!n) return r;
|
|
1033
|
+
if (n.type === "ContentStatement") return (a || !r ? /^\s*?\r?\n/ : /^\s*?(\r?\n|$)/).test(n.original);
|
|
1034
|
+
}
|
|
1035
|
+
function ht(t, e, r) {
|
|
1036
|
+
var n = t[e == null ? 0 : e + 1];
|
|
1037
|
+
if (!(!n || n.type !== "ContentStatement" || !r && n.rightStripped)) {
|
|
1038
|
+
var a = n.value;
|
|
1039
|
+
n.value = n.value.replace(r ? /^\s+/ : /^[ \t]*\r?\n?/, ""), n.rightStripped = n.value !== a;
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
function at(t, e, r) {
|
|
1043
|
+
var n = t[e == null ? t.length - 1 : e - 1];
|
|
1044
|
+
if (!(!n || n.type !== "ContentStatement" || !r && n.leftStripped)) {
|
|
1045
|
+
var a = n.value;
|
|
1046
|
+
return n.value = n.value.replace(r ? /\s+$/ : /[ \t]+$/, ""), n.leftStripped = n.value !== a, n.leftStripped;
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
var Ia = Q, Jt = {};
|
|
1050
|
+
Pe(Jt, { SourceLocation: () => Wr, id: () => Oa, prepareBlock: () => Ma, prepareMustache: () => Ua, preparePartialBlock: () => ja, preparePath: () => Ra, prepareProgram: () => za, prepareRawBlock: () => Ha, stripComment: () => Va, stripFlags: () => $a });
|
|
1051
|
+
function je(t, e) {
|
|
1052
|
+
if (e = e.path ? e.path.original : e, t.path.original !== e) {
|
|
1053
|
+
var r = { loc: t.path.loc };
|
|
1054
|
+
throw new Et(t.path.original + " doesn't match " + e, r);
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
function Wr(t, e) {
|
|
1058
|
+
this.source = t, this.start = { line: e.first_line, column: e.first_column }, this.end = { line: e.last_line, column: e.last_column };
|
|
1059
|
+
}
|
|
1060
|
+
function Oa(t) {
|
|
1061
|
+
return /^\[.*\]$/.test(t) ? t.substring(1, t.length - 1) : t;
|
|
1062
|
+
}
|
|
1063
|
+
function $a(t, e) {
|
|
1064
|
+
return { open: t.charAt(2) === "~", close: e.charAt(e.length - 3) === "~" };
|
|
1065
|
+
}
|
|
1066
|
+
function Va(t) {
|
|
1067
|
+
return t.replace(/^\{\{~?!-?-?/, "").replace(/-?-?~?\}\}$/, "");
|
|
1068
|
+
}
|
|
1069
|
+
function Ra(t, e, r) {
|
|
1070
|
+
r = this.locInfo(r);
|
|
1071
|
+
for (var n = t ? "@" : "", a = [], s = 0, u = 0, i = e.length; u < i; u++) {
|
|
1072
|
+
var l = e[u].part, g = e[u].original !== l;
|
|
1073
|
+
if (n += (e[u].separator || "") + l, !g && (l === ".." || l === "." || l === "this")) {
|
|
1074
|
+
if (a.length > 0) throw new Et("Invalid path: " + n, { loc: r });
|
|
1075
|
+
l === ".." && s++;
|
|
1076
|
+
} else a.push(l);
|
|
1077
|
+
}
|
|
1078
|
+
return { type: "PathExpression", data: t, depth: s, parts: a, original: n, loc: r };
|
|
1079
|
+
}
|
|
1080
|
+
function Ua(t, e, r, n, a, s) {
|
|
1081
|
+
var u = n.charAt(3) || n.charAt(2), i = u !== "{" && u !== "&", l = /\*/.test(n);
|
|
1082
|
+
return { type: l ? "Decorator" : "MustacheStatement", path: t, params: e, hash: r, escaped: i, strip: a, loc: this.locInfo(s) };
|
|
1083
|
+
}
|
|
1084
|
+
function Ha(t, e, r, n) {
|
|
1085
|
+
je(t, r), n = this.locInfo(n);
|
|
1086
|
+
var a = { type: "Program", body: e, strip: {}, loc: n };
|
|
1087
|
+
return { type: "BlockStatement", path: t.path, params: t.params, hash: t.hash, program: a, openStrip: {}, inverseStrip: {}, closeStrip: {}, loc: n };
|
|
1088
|
+
}
|
|
1089
|
+
function Ma(t, e, r, n, a, s) {
|
|
1090
|
+
n && n.path && je(t, n);
|
|
1091
|
+
var u = /\*/.test(t.open);
|
|
1092
|
+
e.blockParams = t.blockParams;
|
|
1093
|
+
var i, l;
|
|
1094
|
+
if (r) {
|
|
1095
|
+
if (u) throw new Et("Unexpected inverse block on decorator", r);
|
|
1096
|
+
r.chain && (r.program.body[0].closeStrip = n.strip), l = r.strip, i = r.program;
|
|
1097
|
+
}
|
|
1098
|
+
return a && (a = i, i = e, e = a), { type: u ? "DecoratorBlock" : "BlockStatement", path: t.path, params: t.params, hash: t.hash, program: e, inverse: i, openStrip: t.strip, inverseStrip: l, closeStrip: n && n.strip, loc: this.locInfo(s) };
|
|
1099
|
+
}
|
|
1100
|
+
function za(t, e) {
|
|
1101
|
+
if (!e && t.length) {
|
|
1102
|
+
var r = t[0].loc, n = t[t.length - 1].loc;
|
|
1103
|
+
r && n && (e = { source: r.source, start: { line: r.start.line, column: r.start.column }, end: { line: n.end.line, column: n.end.column } });
|
|
1104
|
+
}
|
|
1105
|
+
return { type: "Program", body: t, strip: {}, loc: e };
|
|
1106
|
+
}
|
|
1107
|
+
function ja(t, e, r, n) {
|
|
1108
|
+
return je(t, r), { type: "PartialBlockStatement", name: t.path, params: t.params, hash: t.hash, program: e, openStrip: t.strip, closeStrip: r && r.strip, loc: this.locInfo(n) };
|
|
1109
|
+
}
|
|
1110
|
+
var Kr = {};
|
|
1111
|
+
for (jt in Jt) Object.prototype.hasOwnProperty.call(Jt, jt) && (Kr[jt] = Jt[jt]);
|
|
1112
|
+
var jt;
|
|
1113
|
+
function we(t, e) {
|
|
1114
|
+
if (t.type === "Program") return t;
|
|
1115
|
+
de.yy = Kr, de.yy.locInfo = function(n) {
|
|
1116
|
+
return new Wr(e && e.srcName, n);
|
|
1117
|
+
};
|
|
1118
|
+
var r = de.parse(t);
|
|
1119
|
+
return r;
|
|
1120
|
+
}
|
|
1121
|
+
function dr(t, e) {
|
|
1122
|
+
var r = we(t, e), n = new Ia(e);
|
|
1123
|
+
return n.accept(r);
|
|
1124
|
+
}
|
|
1125
|
+
var Ga = { Aacute: "Á", aacute: "á", Abreve: "Ă", abreve: "ă", ac: "∾", acd: "∿", acE: "∾̳", Acirc: "Â", acirc: "â", acute: "´", Acy: "А", acy: "а", AElig: "Æ", aelig: "æ", af: "", Afr: "𝔄", afr: "𝔞", Agrave: "À", agrave: "à", alefsym: "ℵ", aleph: "ℵ", Alpha: "Α", alpha: "α", Amacr: "Ā", amacr: "ā", amalg: "⨿", amp: "&", AMP: "&", andand: "⩕", And: "⩓", and: "∧", andd: "⩜", andslope: "⩘", andv: "⩚", ang: "∠", ange: "⦤", angle: "∠", angmsdaa: "⦨", angmsdab: "⦩", angmsdac: "⦪", angmsdad: "⦫", angmsdae: "⦬", angmsdaf: "⦭", angmsdag: "⦮", angmsdah: "⦯", angmsd: "∡", angrt: "∟", angrtvb: "⊾", angrtvbd: "⦝", angsph: "∢", angst: "Å", angzarr: "⍼", Aogon: "Ą", aogon: "ą", Aopf: "𝔸", aopf: "𝕒", apacir: "⩯", ap: "≈", apE: "⩰", ape: "≊", apid: "≋", apos: "'", ApplyFunction: "", approx: "≈", approxeq: "≊", Aring: "Å", aring: "å", Ascr: "𝒜", ascr: "𝒶", Assign: "≔", ast: "*", asymp: "≈", asympeq: "≍", Atilde: "Ã", atilde: "ã", Auml: "Ä", auml: "ä", awconint: "∳", awint: "⨑", backcong: "≌", backepsilon: "϶", backprime: "‵", backsim: "∽", backsimeq: "⋍", Backslash: "∖", Barv: "⫧", barvee: "⊽", barwed: "⌅", Barwed: "⌆", barwedge: "⌅", bbrk: "⎵", bbrktbrk: "⎶", bcong: "≌", Bcy: "Б", bcy: "б", bdquo: "„", becaus: "∵", because: "∵", Because: "∵", bemptyv: "⦰", bepsi: "϶", bernou: "ℬ", Bernoullis: "ℬ", Beta: "Β", beta: "β", beth: "ℶ", between: "≬", Bfr: "𝔅", bfr: "𝔟", bigcap: "⋂", bigcirc: "◯", bigcup: "⋃", bigodot: "⨀", bigoplus: "⨁", bigotimes: "⨂", bigsqcup: "⨆", bigstar: "★", bigtriangledown: "▽", bigtriangleup: "△", biguplus: "⨄", bigvee: "⋁", bigwedge: "⋀", bkarow: "⤍", blacklozenge: "⧫", blacksquare: "▪", blacktriangle: "▴", blacktriangledown: "▾", blacktriangleleft: "◂", blacktriangleright: "▸", blank: "␣", blk12: "▒", blk14: "░", blk34: "▓", block: "█", bne: "=⃥", bnequiv: "≡⃥", bNot: "⫭", bnot: "⌐", Bopf: "𝔹", bopf: "𝕓", bot: "⊥", bottom: "⊥", bowtie: "⋈", boxbox: "⧉", boxdl: "┐", boxdL: "╕", boxDl: "╖", boxDL: "╗", boxdr: "┌", boxdR: "╒", boxDr: "╓", boxDR: "╔", boxh: "─", boxH: "═", boxhd: "┬", boxHd: "╤", boxhD: "╥", boxHD: "╦", boxhu: "┴", boxHu: "╧", boxhU: "╨", boxHU: "╩", boxminus: "⊟", boxplus: "⊞", boxtimes: "⊠", boxul: "┘", boxuL: "╛", boxUl: "╜", boxUL: "╝", boxur: "└", boxuR: "╘", boxUr: "╙", boxUR: "╚", boxv: "│", boxV: "║", boxvh: "┼", boxvH: "╪", boxVh: "╫", boxVH: "╬", boxvl: "┤", boxvL: "╡", boxVl: "╢", boxVL: "╣", boxvr: "├", boxvR: "╞", boxVr: "╟", boxVR: "╠", bprime: "‵", breve: "˘", Breve: "˘", brvbar: "¦", bscr: "𝒷", Bscr: "ℬ", bsemi: "⁏", bsim: "∽", bsime: "⋍", bsolb: "⧅", bsol: "\\", bsolhsub: "⟈", bull: "•", bullet: "•", bump: "≎", bumpE: "⪮", bumpe: "≏", Bumpeq: "≎", bumpeq: "≏", Cacute: "Ć", cacute: "ć", capand: "⩄", capbrcup: "⩉", capcap: "⩋", cap: "∩", Cap: "⋒", capcup: "⩇", capdot: "⩀", CapitalDifferentialD: "ⅅ", caps: "∩︀", caret: "⁁", caron: "ˇ", Cayleys: "ℭ", ccaps: "⩍", Ccaron: "Č", ccaron: "č", Ccedil: "Ç", ccedil: "ç", Ccirc: "Ĉ", ccirc: "ĉ", Cconint: "∰", ccups: "⩌", ccupssm: "⩐", Cdot: "Ċ", cdot: "ċ", cedil: "¸", Cedilla: "¸", cemptyv: "⦲", cent: "¢", centerdot: "·", CenterDot: "·", cfr: "𝔠", Cfr: "ℭ", CHcy: "Ч", chcy: "ч", check: "✓", checkmark: "✓", Chi: "Χ", chi: "χ", circ: "ˆ", circeq: "≗", circlearrowleft: "↺", circlearrowright: "↻", circledast: "⊛", circledcirc: "⊚", circleddash: "⊝", CircleDot: "⊙", circledR: "®", circledS: "Ⓢ", CircleMinus: "⊖", CirclePlus: "⊕", CircleTimes: "⊗", cir: "○", cirE: "⧃", cire: "≗", cirfnint: "⨐", cirmid: "⫯", cirscir: "⧂", ClockwiseContourIntegral: "∲", CloseCurlyDoubleQuote: "”", CloseCurlyQuote: "’", clubs: "♣", clubsuit: "♣", colon: ":", Colon: "∷", Colone: "⩴", colone: "≔", coloneq: "≔", comma: ",", commat: "@", comp: "∁", compfn: "∘", complement: "∁", complexes: "ℂ", cong: "≅", congdot: "⩭", Congruent: "≡", conint: "∮", Conint: "∯", ContourIntegral: "∮", copf: "𝕔", Copf: "ℂ", coprod: "∐", Coproduct: "∐", copy: "©", COPY: "©", copysr: "℗", CounterClockwiseContourIntegral: "∳", crarr: "↵", cross: "✗", Cross: "⨯", Cscr: "𝒞", cscr: "𝒸", csub: "⫏", csube: "⫑", csup: "⫐", csupe: "⫒", ctdot: "⋯", cudarrl: "⤸", cudarrr: "⤵", cuepr: "⋞", cuesc: "⋟", cularr: "↶", cularrp: "⤽", cupbrcap: "⩈", cupcap: "⩆", CupCap: "≍", cup: "∪", Cup: "⋓", cupcup: "⩊", cupdot: "⊍", cupor: "⩅", cups: "∪︀", curarr: "↷", curarrm: "⤼", curlyeqprec: "⋞", curlyeqsucc: "⋟", curlyvee: "⋎", curlywedge: "⋏", curren: "¤", curvearrowleft: "↶", curvearrowright: "↷", cuvee: "⋎", cuwed: "⋏", cwconint: "∲", cwint: "∱", cylcty: "⌭", dagger: "†", Dagger: "‡", daleth: "ℸ", darr: "↓", Darr: "↡", dArr: "⇓", dash: "‐", Dashv: "⫤", dashv: "⊣", dbkarow: "⤏", dblac: "˝", Dcaron: "Ď", dcaron: "ď", Dcy: "Д", dcy: "д", ddagger: "‡", ddarr: "⇊", DD: "ⅅ", dd: "ⅆ", DDotrahd: "⤑", ddotseq: "⩷", deg: "°", Del: "∇", Delta: "Δ", delta: "δ", demptyv: "⦱", dfisht: "⥿", Dfr: "𝔇", dfr: "𝔡", dHar: "⥥", dharl: "⇃", dharr: "⇂", DiacriticalAcute: "´", DiacriticalDot: "˙", DiacriticalDoubleAcute: "˝", DiacriticalGrave: "`", DiacriticalTilde: "˜", diam: "⋄", diamond: "⋄", Diamond: "⋄", diamondsuit: "♦", diams: "♦", die: "¨", DifferentialD: "ⅆ", digamma: "ϝ", disin: "⋲", div: "÷", divide: "÷", divideontimes: "⋇", divonx: "⋇", DJcy: "Ђ", djcy: "ђ", dlcorn: "⌞", dlcrop: "⌍", dollar: "$", Dopf: "𝔻", dopf: "𝕕", Dot: "¨", dot: "˙", DotDot: "⃜", doteq: "≐", doteqdot: "≑", DotEqual: "≐", dotminus: "∸", dotplus: "∔", dotsquare: "⊡", doublebarwedge: "⌆", DoubleContourIntegral: "∯", DoubleDot: "¨", DoubleDownArrow: "⇓", DoubleLeftArrow: "⇐", DoubleLeftRightArrow: "⇔", DoubleLeftTee: "⫤", DoubleLongLeftArrow: "⟸", DoubleLongLeftRightArrow: "⟺", DoubleLongRightArrow: "⟹", DoubleRightArrow: "⇒", DoubleRightTee: "⊨", DoubleUpArrow: "⇑", DoubleUpDownArrow: "⇕", DoubleVerticalBar: "∥", DownArrowBar: "⤓", downarrow: "↓", DownArrow: "↓", Downarrow: "⇓", DownArrowUpArrow: "⇵", DownBreve: "̑", downdownarrows: "⇊", downharpoonleft: "⇃", downharpoonright: "⇂", DownLeftRightVector: "⥐", DownLeftTeeVector: "⥞", DownLeftVectorBar: "⥖", DownLeftVector: "↽", DownRightTeeVector: "⥟", DownRightVectorBar: "⥗", DownRightVector: "⇁", DownTeeArrow: "↧", DownTee: "⊤", drbkarow: "⤐", drcorn: "⌟", drcrop: "⌌", Dscr: "𝒟", dscr: "𝒹", DScy: "Ѕ", dscy: "ѕ", dsol: "⧶", Dstrok: "Đ", dstrok: "đ", dtdot: "⋱", dtri: "▿", dtrif: "▾", duarr: "⇵", duhar: "⥯", dwangle: "⦦", DZcy: "Џ", dzcy: "џ", dzigrarr: "⟿", Eacute: "É", eacute: "é", easter: "⩮", Ecaron: "Ě", ecaron: "ě", Ecirc: "Ê", ecirc: "ê", ecir: "≖", ecolon: "≕", Ecy: "Э", ecy: "э", eDDot: "⩷", Edot: "Ė", edot: "ė", eDot: "≑", ee: "ⅇ", efDot: "≒", Efr: "𝔈", efr: "𝔢", eg: "⪚", Egrave: "È", egrave: "è", egs: "⪖", egsdot: "⪘", el: "⪙", Element: "∈", elinters: "⏧", ell: "ℓ", els: "⪕", elsdot: "⪗", Emacr: "Ē", emacr: "ē", empty: "∅", emptyset: "∅", EmptySmallSquare: "◻", emptyv: "∅", EmptyVerySmallSquare: "▫", emsp13: " ", emsp14: " ", emsp: " ", ENG: "Ŋ", eng: "ŋ", ensp: " ", Eogon: "Ę", eogon: "ę", Eopf: "𝔼", eopf: "𝕖", epar: "⋕", eparsl: "⧣", eplus: "⩱", epsi: "ε", Epsilon: "Ε", epsilon: "ε", epsiv: "ϵ", eqcirc: "≖", eqcolon: "≕", eqsim: "≂", eqslantgtr: "⪖", eqslantless: "⪕", Equal: "⩵", equals: "=", EqualTilde: "≂", equest: "≟", Equilibrium: "⇌", equiv: "≡", equivDD: "⩸", eqvparsl: "⧥", erarr: "⥱", erDot: "≓", escr: "ℯ", Escr: "ℰ", esdot: "≐", Esim: "⩳", esim: "≂", Eta: "Η", eta: "η", ETH: "Ð", eth: "ð", Euml: "Ë", euml: "ë", euro: "€", excl: "!", exist: "∃", Exists: "∃", expectation: "ℰ", exponentiale: "ⅇ", ExponentialE: "ⅇ", fallingdotseq: "≒", Fcy: "Ф", fcy: "ф", female: "♀", ffilig: "ffi", fflig: "ff", ffllig: "ffl", Ffr: "𝔉", ffr: "𝔣", filig: "fi", FilledSmallSquare: "◼", FilledVerySmallSquare: "▪", fjlig: "fj", flat: "♭", fllig: "fl", fltns: "▱", fnof: "ƒ", Fopf: "𝔽", fopf: "𝕗", forall: "∀", ForAll: "∀", fork: "⋔", forkv: "⫙", Fouriertrf: "ℱ", fpartint: "⨍", frac12: "½", frac13: "⅓", frac14: "¼", frac15: "⅕", frac16: "⅙", frac18: "⅛", frac23: "⅔", frac25: "⅖", frac34: "¾", frac35: "⅗", frac38: "⅜", frac45: "⅘", frac56: "⅚", frac58: "⅝", frac78: "⅞", frasl: "⁄", frown: "⌢", fscr: "𝒻", Fscr: "ℱ", gacute: "ǵ", Gamma: "Γ", gamma: "γ", Gammad: "Ϝ", gammad: "ϝ", gap: "⪆", Gbreve: "Ğ", gbreve: "ğ", Gcedil: "Ģ", Gcirc: "Ĝ", gcirc: "ĝ", Gcy: "Г", gcy: "г", Gdot: "Ġ", gdot: "ġ", ge: "≥", gE: "≧", gEl: "⪌", gel: "⋛", geq: "≥", geqq: "≧", geqslant: "⩾", gescc: "⪩", ges: "⩾", gesdot: "⪀", gesdoto: "⪂", gesdotol: "⪄", gesl: "⋛︀", gesles: "⪔", Gfr: "𝔊", gfr: "𝔤", gg: "≫", Gg: "⋙", ggg: "⋙", gimel: "ℷ", GJcy: "Ѓ", gjcy: "ѓ", gla: "⪥", gl: "≷", glE: "⪒", glj: "⪤", gnap: "⪊", gnapprox: "⪊", gne: "⪈", gnE: "≩", gneq: "⪈", gneqq: "≩", gnsim: "⋧", Gopf: "𝔾", gopf: "𝕘", grave: "`", GreaterEqual: "≥", GreaterEqualLess: "⋛", GreaterFullEqual: "≧", GreaterGreater: "⪢", GreaterLess: "≷", GreaterSlantEqual: "⩾", GreaterTilde: "≳", Gscr: "𝒢", gscr: "ℊ", gsim: "≳", gsime: "⪎", gsiml: "⪐", gtcc: "⪧", gtcir: "⩺", gt: ">", GT: ">", Gt: "≫", gtdot: "⋗", gtlPar: "⦕", gtquest: "⩼", gtrapprox: "⪆", gtrarr: "⥸", gtrdot: "⋗", gtreqless: "⋛", gtreqqless: "⪌", gtrless: "≷", gtrsim: "≳", gvertneqq: "≩︀", gvnE: "≩︀", Hacek: "ˇ", hairsp: " ", half: "½", hamilt: "ℋ", HARDcy: "Ъ", hardcy: "ъ", harrcir: "⥈", harr: "↔", hArr: "⇔", harrw: "↭", Hat: "^", hbar: "ℏ", Hcirc: "Ĥ", hcirc: "ĥ", hearts: "♥", heartsuit: "♥", hellip: "…", hercon: "⊹", hfr: "𝔥", Hfr: "ℌ", HilbertSpace: "ℋ", hksearow: "⤥", hkswarow: "⤦", hoarr: "⇿", homtht: "∻", hookleftarrow: "↩", hookrightarrow: "↪", hopf: "𝕙", Hopf: "ℍ", horbar: "―", HorizontalLine: "─", hscr: "𝒽", Hscr: "ℋ", hslash: "ℏ", Hstrok: "Ħ", hstrok: "ħ", HumpDownHump: "≎", HumpEqual: "≏", hybull: "⁃", hyphen: "‐", Iacute: "Í", iacute: "í", ic: "", Icirc: "Î", icirc: "î", Icy: "И", icy: "и", Idot: "İ", IEcy: "Е", iecy: "е", iexcl: "¡", iff: "⇔", ifr: "𝔦", Ifr: "ℑ", Igrave: "Ì", igrave: "ì", ii: "ⅈ", iiiint: "⨌", iiint: "∭", iinfin: "⧜", iiota: "℩", IJlig: "IJ", ijlig: "ij", Imacr: "Ī", imacr: "ī", image: "ℑ", ImaginaryI: "ⅈ", imagline: "ℐ", imagpart: "ℑ", imath: "ı", Im: "ℑ", imof: "⊷", imped: "Ƶ", Implies: "⇒", incare: "℅", in: "∈", infin: "∞", infintie: "⧝", inodot: "ı", intcal: "⊺", int: "∫", Int: "∬", integers: "ℤ", Integral: "∫", intercal: "⊺", Intersection: "⋂", intlarhk: "⨗", intprod: "⨼", InvisibleComma: "", InvisibleTimes: "", IOcy: "Ё", iocy: "ё", Iogon: "Į", iogon: "į", Iopf: "𝕀", iopf: "𝕚", Iota: "Ι", iota: "ι", iprod: "⨼", iquest: "¿", iscr: "𝒾", Iscr: "ℐ", isin: "∈", isindot: "⋵", isinE: "⋹", isins: "⋴", isinsv: "⋳", isinv: "∈", it: "", Itilde: "Ĩ", itilde: "ĩ", Iukcy: "І", iukcy: "і", Iuml: "Ï", iuml: "ï", Jcirc: "Ĵ", jcirc: "ĵ", Jcy: "Й", jcy: "й", Jfr: "𝔍", jfr: "𝔧", jmath: "ȷ", Jopf: "𝕁", jopf: "𝕛", Jscr: "𝒥", jscr: "𝒿", Jsercy: "Ј", jsercy: "ј", Jukcy: "Є", jukcy: "є", Kappa: "Κ", kappa: "κ", kappav: "ϰ", Kcedil: "Ķ", kcedil: "ķ", Kcy: "К", kcy: "к", Kfr: "𝔎", kfr: "𝔨", kgreen: "ĸ", KHcy: "Х", khcy: "х", KJcy: "Ќ", kjcy: "ќ", Kopf: "𝕂", kopf: "𝕜", Kscr: "𝒦", kscr: "𝓀", lAarr: "⇚", Lacute: "Ĺ", lacute: "ĺ", laemptyv: "⦴", lagran: "ℒ", Lambda: "Λ", lambda: "λ", lang: "⟨", Lang: "⟪", langd: "⦑", langle: "⟨", lap: "⪅", Laplacetrf: "ℒ", laquo: "«", larrb: "⇤", larrbfs: "⤟", larr: "←", Larr: "↞", lArr: "⇐", larrfs: "⤝", larrhk: "↩", larrlp: "↫", larrpl: "⤹", larrsim: "⥳", larrtl: "↢", latail: "⤙", lAtail: "⤛", lat: "⪫", late: "⪭", lates: "⪭︀", lbarr: "⤌", lBarr: "⤎", lbbrk: "❲", lbrace: "{", lbrack: "[", lbrke: "⦋", lbrksld: "⦏", lbrkslu: "⦍", Lcaron: "Ľ", lcaron: "ľ", Lcedil: "Ļ", lcedil: "ļ", lceil: "⌈", lcub: "{", Lcy: "Л", lcy: "л", ldca: "⤶", ldquo: "“", ldquor: "„", ldrdhar: "⥧", ldrushar: "⥋", ldsh: "↲", le: "≤", lE: "≦", LeftAngleBracket: "⟨", LeftArrowBar: "⇤", leftarrow: "←", LeftArrow: "←", Leftarrow: "⇐", LeftArrowRightArrow: "⇆", leftarrowtail: "↢", LeftCeiling: "⌈", LeftDoubleBracket: "⟦", LeftDownTeeVector: "⥡", LeftDownVectorBar: "⥙", LeftDownVector: "⇃", LeftFloor: "⌊", leftharpoondown: "↽", leftharpoonup: "↼", leftleftarrows: "⇇", leftrightarrow: "↔", LeftRightArrow: "↔", Leftrightarrow: "⇔", leftrightarrows: "⇆", leftrightharpoons: "⇋", leftrightsquigarrow: "↭", LeftRightVector: "⥎", LeftTeeArrow: "↤", LeftTee: "⊣", LeftTeeVector: "⥚", leftthreetimes: "⋋", LeftTriangleBar: "⧏", LeftTriangle: "⊲", LeftTriangleEqual: "⊴", LeftUpDownVector: "⥑", LeftUpTeeVector: "⥠", LeftUpVectorBar: "⥘", LeftUpVector: "↿", LeftVectorBar: "⥒", LeftVector: "↼", lEg: "⪋", leg: "⋚", leq: "≤", leqq: "≦", leqslant: "⩽", lescc: "⪨", les: "⩽", lesdot: "⩿", lesdoto: "⪁", lesdotor: "⪃", lesg: "⋚︀", lesges: "⪓", lessapprox: "⪅", lessdot: "⋖", lesseqgtr: "⋚", lesseqqgtr: "⪋", LessEqualGreater: "⋚", LessFullEqual: "≦", LessGreater: "≶", lessgtr: "≶", LessLess: "⪡", lesssim: "≲", LessSlantEqual: "⩽", LessTilde: "≲", lfisht: "⥼", lfloor: "⌊", Lfr: "𝔏", lfr: "𝔩", lg: "≶", lgE: "⪑", lHar: "⥢", lhard: "↽", lharu: "↼", lharul: "⥪", lhblk: "▄", LJcy: "Љ", ljcy: "љ", llarr: "⇇", ll: "≪", Ll: "⋘", llcorner: "⌞", Lleftarrow: "⇚", llhard: "⥫", lltri: "◺", Lmidot: "Ŀ", lmidot: "ŀ", lmoustache: "⎰", lmoust: "⎰", lnap: "⪉", lnapprox: "⪉", lne: "⪇", lnE: "≨", lneq: "⪇", lneqq: "≨", lnsim: "⋦", loang: "⟬", loarr: "⇽", lobrk: "⟦", longleftarrow: "⟵", LongLeftArrow: "⟵", Longleftarrow: "⟸", longleftrightarrow: "⟷", LongLeftRightArrow: "⟷", Longleftrightarrow: "⟺", longmapsto: "⟼", longrightarrow: "⟶", LongRightArrow: "⟶", Longrightarrow: "⟹", looparrowleft: "↫", looparrowright: "↬", lopar: "⦅", Lopf: "𝕃", lopf: "𝕝", loplus: "⨭", lotimes: "⨴", lowast: "∗", lowbar: "_", LowerLeftArrow: "↙", LowerRightArrow: "↘", loz: "◊", lozenge: "◊", lozf: "⧫", lpar: "(", lparlt: "⦓", lrarr: "⇆", lrcorner: "⌟", lrhar: "⇋", lrhard: "⥭", lrm: "", lrtri: "⊿", lsaquo: "‹", lscr: "𝓁", Lscr: "ℒ", lsh: "↰", Lsh: "↰", lsim: "≲", lsime: "⪍", lsimg: "⪏", lsqb: "[", lsquo: "‘", lsquor: "‚", Lstrok: "Ł", lstrok: "ł", ltcc: "⪦", ltcir: "⩹", lt: "<", LT: "<", Lt: "≪", ltdot: "⋖", lthree: "⋋", ltimes: "⋉", ltlarr: "⥶", ltquest: "⩻", ltri: "◃", ltrie: "⊴", ltrif: "◂", ltrPar: "⦖", lurdshar: "⥊", luruhar: "⥦", lvertneqq: "≨︀", lvnE: "≨︀", macr: "¯", male: "♂", malt: "✠", maltese: "✠", Map: "⤅", map: "↦", mapsto: "↦", mapstodown: "↧", mapstoleft: "↤", mapstoup: "↥", marker: "▮", mcomma: "⨩", Mcy: "М", mcy: "м", mdash: "—", mDDot: "∺", measuredangle: "∡", MediumSpace: " ", Mellintrf: "ℳ", Mfr: "𝔐", mfr: "𝔪", mho: "℧", micro: "µ", midast: "*", midcir: "⫰", mid: "∣", middot: "·", minusb: "⊟", minus: "−", minusd: "∸", minusdu: "⨪", MinusPlus: "∓", mlcp: "⫛", mldr: "…", mnplus: "∓", models: "⊧", Mopf: "𝕄", mopf: "𝕞", mp: "∓", mscr: "𝓂", Mscr: "ℳ", mstpos: "∾", Mu: "Μ", mu: "μ", multimap: "⊸", mumap: "⊸", nabla: "∇", Nacute: "Ń", nacute: "ń", nang: "∠⃒", nap: "≉", napE: "⩰̸", napid: "≋̸", napos: "ʼn", napprox: "≉", natural: "♮", naturals: "ℕ", natur: "♮", nbsp: " ", nbump: "≎̸", nbumpe: "≏̸", ncap: "⩃", Ncaron: "Ň", ncaron: "ň", Ncedil: "Ņ", ncedil: "ņ", ncong: "≇", ncongdot: "⩭̸", ncup: "⩂", Ncy: "Н", ncy: "н", ndash: "–", nearhk: "⤤", nearr: "↗", neArr: "⇗", nearrow: "↗", ne: "≠", nedot: "≐̸", NegativeMediumSpace: "", NegativeThickSpace: "", NegativeThinSpace: "", NegativeVeryThinSpace: "", nequiv: "≢", nesear: "⤨", nesim: "≂̸", NestedGreaterGreater: "≫", NestedLessLess: "≪", NewLine: `
|
|
1126
|
+
`, nexist: "∄", nexists: "∄", Nfr: "𝔑", nfr: "𝔫", ngE: "≧̸", nge: "≱", ngeq: "≱", ngeqq: "≧̸", ngeqslant: "⩾̸", nges: "⩾̸", nGg: "⋙̸", ngsim: "≵", nGt: "≫⃒", ngt: "≯", ngtr: "≯", nGtv: "≫̸", nharr: "↮", nhArr: "⇎", nhpar: "⫲", ni: "∋", nis: "⋼", nisd: "⋺", niv: "∋", NJcy: "Њ", njcy: "њ", nlarr: "↚", nlArr: "⇍", nldr: "‥", nlE: "≦̸", nle: "≰", nleftarrow: "↚", nLeftarrow: "⇍", nleftrightarrow: "↮", nLeftrightarrow: "⇎", nleq: "≰", nleqq: "≦̸", nleqslant: "⩽̸", nles: "⩽̸", nless: "≮", nLl: "⋘̸", nlsim: "≴", nLt: "≪⃒", nlt: "≮", nltri: "⋪", nltrie: "⋬", nLtv: "≪̸", nmid: "∤", NoBreak: "", NonBreakingSpace: " ", nopf: "𝕟", Nopf: "ℕ", Not: "⫬", not: "¬", NotCongruent: "≢", NotCupCap: "≭", NotDoubleVerticalBar: "∦", NotElement: "∉", NotEqual: "≠", NotEqualTilde: "≂̸", NotExists: "∄", NotGreater: "≯", NotGreaterEqual: "≱", NotGreaterFullEqual: "≧̸", NotGreaterGreater: "≫̸", NotGreaterLess: "≹", NotGreaterSlantEqual: "⩾̸", NotGreaterTilde: "≵", NotHumpDownHump: "≎̸", NotHumpEqual: "≏̸", notin: "∉", notindot: "⋵̸", notinE: "⋹̸", notinva: "∉", notinvb: "⋷", notinvc: "⋶", NotLeftTriangleBar: "⧏̸", NotLeftTriangle: "⋪", NotLeftTriangleEqual: "⋬", NotLess: "≮", NotLessEqual: "≰", NotLessGreater: "≸", NotLessLess: "≪̸", NotLessSlantEqual: "⩽̸", NotLessTilde: "≴", NotNestedGreaterGreater: "⪢̸", NotNestedLessLess: "⪡̸", notni: "∌", notniva: "∌", notnivb: "⋾", notnivc: "⋽", NotPrecedes: "⊀", NotPrecedesEqual: "⪯̸", NotPrecedesSlantEqual: "⋠", NotReverseElement: "∌", NotRightTriangleBar: "⧐̸", NotRightTriangle: "⋫", NotRightTriangleEqual: "⋭", NotSquareSubset: "⊏̸", NotSquareSubsetEqual: "⋢", NotSquareSuperset: "⊐̸", NotSquareSupersetEqual: "⋣", NotSubset: "⊂⃒", NotSubsetEqual: "⊈", NotSucceeds: "⊁", NotSucceedsEqual: "⪰̸", NotSucceedsSlantEqual: "⋡", NotSucceedsTilde: "≿̸", NotSuperset: "⊃⃒", NotSupersetEqual: "⊉", NotTilde: "≁", NotTildeEqual: "≄", NotTildeFullEqual: "≇", NotTildeTilde: "≉", NotVerticalBar: "∤", nparallel: "∦", npar: "∦", nparsl: "⫽⃥", npart: "∂̸", npolint: "⨔", npr: "⊀", nprcue: "⋠", nprec: "⊀", npreceq: "⪯̸", npre: "⪯̸", nrarrc: "⤳̸", nrarr: "↛", nrArr: "⇏", nrarrw: "↝̸", nrightarrow: "↛", nRightarrow: "⇏", nrtri: "⋫", nrtrie: "⋭", nsc: "⊁", nsccue: "⋡", nsce: "⪰̸", Nscr: "𝒩", nscr: "𝓃", nshortmid: "∤", nshortparallel: "∦", nsim: "≁", nsime: "≄", nsimeq: "≄", nsmid: "∤", nspar: "∦", nsqsube: "⋢", nsqsupe: "⋣", nsub: "⊄", nsubE: "⫅̸", nsube: "⊈", nsubset: "⊂⃒", nsubseteq: "⊈", nsubseteqq: "⫅̸", nsucc: "⊁", nsucceq: "⪰̸", nsup: "⊅", nsupE: "⫆̸", nsupe: "⊉", nsupset: "⊃⃒", nsupseteq: "⊉", nsupseteqq: "⫆̸", ntgl: "≹", Ntilde: "Ñ", ntilde: "ñ", ntlg: "≸", ntriangleleft: "⋪", ntrianglelefteq: "⋬", ntriangleright: "⋫", ntrianglerighteq: "⋭", Nu: "Ν", nu: "ν", num: "#", numero: "№", numsp: " ", nvap: "≍⃒", nvdash: "⊬", nvDash: "⊭", nVdash: "⊮", nVDash: "⊯", nvge: "≥⃒", nvgt: ">⃒", nvHarr: "⤄", nvinfin: "⧞", nvlArr: "⤂", nvle: "≤⃒", nvlt: "<⃒", nvltrie: "⊴⃒", nvrArr: "⤃", nvrtrie: "⊵⃒", nvsim: "∼⃒", nwarhk: "⤣", nwarr: "↖", nwArr: "⇖", nwarrow: "↖", nwnear: "⤧", Oacute: "Ó", oacute: "ó", oast: "⊛", Ocirc: "Ô", ocirc: "ô", ocir: "⊚", Ocy: "О", ocy: "о", odash: "⊝", Odblac: "Ő", odblac: "ő", odiv: "⨸", odot: "⊙", odsold: "⦼", OElig: "Œ", oelig: "œ", ofcir: "⦿", Ofr: "𝔒", ofr: "𝔬", ogon: "˛", Ograve: "Ò", ograve: "ò", ogt: "⧁", ohbar: "⦵", ohm: "Ω", oint: "∮", olarr: "↺", olcir: "⦾", olcross: "⦻", oline: "‾", olt: "⧀", Omacr: "Ō", omacr: "ō", Omega: "Ω", omega: "ω", Omicron: "Ο", omicron: "ο", omid: "⦶", ominus: "⊖", Oopf: "𝕆", oopf: "𝕠", opar: "⦷", OpenCurlyDoubleQuote: "“", OpenCurlyQuote: "‘", operp: "⦹", oplus: "⊕", orarr: "↻", Or: "⩔", or: "∨", ord: "⩝", order: "ℴ", orderof: "ℴ", ordf: "ª", ordm: "º", origof: "⊶", oror: "⩖", orslope: "⩗", orv: "⩛", oS: "Ⓢ", Oscr: "𝒪", oscr: "ℴ", Oslash: "Ø", oslash: "ø", osol: "⊘", Otilde: "Õ", otilde: "õ", otimesas: "⨶", Otimes: "⨷", otimes: "⊗", Ouml: "Ö", ouml: "ö", ovbar: "⌽", OverBar: "‾", OverBrace: "⏞", OverBracket: "⎴", OverParenthesis: "⏜", para: "¶", parallel: "∥", par: "∥", parsim: "⫳", parsl: "⫽", part: "∂", PartialD: "∂", Pcy: "П", pcy: "п", percnt: "%", period: ".", permil: "‰", perp: "⊥", pertenk: "‱", Pfr: "𝔓", pfr: "𝔭", Phi: "Φ", phi: "φ", phiv: "ϕ", phmmat: "ℳ", phone: "☎", Pi: "Π", pi: "π", pitchfork: "⋔", piv: "ϖ", planck: "ℏ", planckh: "ℎ", plankv: "ℏ", plusacir: "⨣", plusb: "⊞", pluscir: "⨢", plus: "+", plusdo: "∔", plusdu: "⨥", pluse: "⩲", PlusMinus: "±", plusmn: "±", plussim: "⨦", plustwo: "⨧", pm: "±", Poincareplane: "ℌ", pointint: "⨕", popf: "𝕡", Popf: "ℙ", pound: "£", prap: "⪷", Pr: "⪻", pr: "≺", prcue: "≼", precapprox: "⪷", prec: "≺", preccurlyeq: "≼", Precedes: "≺", PrecedesEqual: "⪯", PrecedesSlantEqual: "≼", PrecedesTilde: "≾", preceq: "⪯", precnapprox: "⪹", precneqq: "⪵", precnsim: "⋨", pre: "⪯", prE: "⪳", precsim: "≾", prime: "′", Prime: "″", primes: "ℙ", prnap: "⪹", prnE: "⪵", prnsim: "⋨", prod: "∏", Product: "∏", profalar: "⌮", profline: "⌒", profsurf: "⌓", prop: "∝", Proportional: "∝", Proportion: "∷", propto: "∝", prsim: "≾", prurel: "⊰", Pscr: "𝒫", pscr: "𝓅", Psi: "Ψ", psi: "ψ", puncsp: " ", Qfr: "𝔔", qfr: "𝔮", qint: "⨌", qopf: "𝕢", Qopf: "ℚ", qprime: "⁗", Qscr: "𝒬", qscr: "𝓆", quaternions: "ℍ", quatint: "⨖", quest: "?", questeq: "≟", quot: '"', QUOT: '"', rAarr: "⇛", race: "∽̱", Racute: "Ŕ", racute: "ŕ", radic: "√", raemptyv: "⦳", rang: "⟩", Rang: "⟫", rangd: "⦒", range: "⦥", rangle: "⟩", raquo: "»", rarrap: "⥵", rarrb: "⇥", rarrbfs: "⤠", rarrc: "⤳", rarr: "→", Rarr: "↠", rArr: "⇒", rarrfs: "⤞", rarrhk: "↪", rarrlp: "↬", rarrpl: "⥅", rarrsim: "⥴", Rarrtl: "⤖", rarrtl: "↣", rarrw: "↝", ratail: "⤚", rAtail: "⤜", ratio: "∶", rationals: "ℚ", rbarr: "⤍", rBarr: "⤏", RBarr: "⤐", rbbrk: "❳", rbrace: "}", rbrack: "]", rbrke: "⦌", rbrksld: "⦎", rbrkslu: "⦐", Rcaron: "Ř", rcaron: "ř", Rcedil: "Ŗ", rcedil: "ŗ", rceil: "⌉", rcub: "}", Rcy: "Р", rcy: "р", rdca: "⤷", rdldhar: "⥩", rdquo: "”", rdquor: "”", rdsh: "↳", real: "ℜ", realine: "ℛ", realpart: "ℜ", reals: "ℝ", Re: "ℜ", rect: "▭", reg: "®", REG: "®", ReverseElement: "∋", ReverseEquilibrium: "⇋", ReverseUpEquilibrium: "⥯", rfisht: "⥽", rfloor: "⌋", rfr: "𝔯", Rfr: "ℜ", rHar: "⥤", rhard: "⇁", rharu: "⇀", rharul: "⥬", Rho: "Ρ", rho: "ρ", rhov: "ϱ", RightAngleBracket: "⟩", RightArrowBar: "⇥", rightarrow: "→", RightArrow: "→", Rightarrow: "⇒", RightArrowLeftArrow: "⇄", rightarrowtail: "↣", RightCeiling: "⌉", RightDoubleBracket: "⟧", RightDownTeeVector: "⥝", RightDownVectorBar: "⥕", RightDownVector: "⇂", RightFloor: "⌋", rightharpoondown: "⇁", rightharpoonup: "⇀", rightleftarrows: "⇄", rightleftharpoons: "⇌", rightrightarrows: "⇉", rightsquigarrow: "↝", RightTeeArrow: "↦", RightTee: "⊢", RightTeeVector: "⥛", rightthreetimes: "⋌", RightTriangleBar: "⧐", RightTriangle: "⊳", RightTriangleEqual: "⊵", RightUpDownVector: "⥏", RightUpTeeVector: "⥜", RightUpVectorBar: "⥔", RightUpVector: "↾", RightVectorBar: "⥓", RightVector: "⇀", ring: "˚", risingdotseq: "≓", rlarr: "⇄", rlhar: "⇌", rlm: "", rmoustache: "⎱", rmoust: "⎱", rnmid: "⫮", roang: "⟭", roarr: "⇾", robrk: "⟧", ropar: "⦆", ropf: "𝕣", Ropf: "ℝ", roplus: "⨮", rotimes: "⨵", RoundImplies: "⥰", rpar: ")", rpargt: "⦔", rppolint: "⨒", rrarr: "⇉", Rrightarrow: "⇛", rsaquo: "›", rscr: "𝓇", Rscr: "ℛ", rsh: "↱", Rsh: "↱", rsqb: "]", rsquo: "’", rsquor: "’", rthree: "⋌", rtimes: "⋊", rtri: "▹", rtrie: "⊵", rtrif: "▸", rtriltri: "⧎", RuleDelayed: "⧴", ruluhar: "⥨", rx: "℞", Sacute: "Ś", sacute: "ś", sbquo: "‚", scap: "⪸", Scaron: "Š", scaron: "š", Sc: "⪼", sc: "≻", sccue: "≽", sce: "⪰", scE: "⪴", Scedil: "Ş", scedil: "ş", Scirc: "Ŝ", scirc: "ŝ", scnap: "⪺", scnE: "⪶", scnsim: "⋩", scpolint: "⨓", scsim: "≿", Scy: "С", scy: "с", sdotb: "⊡", sdot: "⋅", sdote: "⩦", searhk: "⤥", searr: "↘", seArr: "⇘", searrow: "↘", sect: "§", semi: ";", seswar: "⤩", setminus: "∖", setmn: "∖", sext: "✶", Sfr: "𝔖", sfr: "𝔰", sfrown: "⌢", sharp: "♯", SHCHcy: "Щ", shchcy: "щ", SHcy: "Ш", shcy: "ш", ShortDownArrow: "↓", ShortLeftArrow: "←", shortmid: "∣", shortparallel: "∥", ShortRightArrow: "→", ShortUpArrow: "↑", shy: "", Sigma: "Σ", sigma: "σ", sigmaf: "ς", sigmav: "ς", sim: "∼", simdot: "⩪", sime: "≃", simeq: "≃", simg: "⪞", simgE: "⪠", siml: "⪝", simlE: "⪟", simne: "≆", simplus: "⨤", simrarr: "⥲", slarr: "←", SmallCircle: "∘", smallsetminus: "∖", smashp: "⨳", smeparsl: "⧤", smid: "∣", smile: "⌣", smt: "⪪", smte: "⪬", smtes: "⪬︀", SOFTcy: "Ь", softcy: "ь", solbar: "⌿", solb: "⧄", sol: "/", Sopf: "𝕊", sopf: "𝕤", spades: "♠", spadesuit: "♠", spar: "∥", sqcap: "⊓", sqcaps: "⊓︀", sqcup: "⊔", sqcups: "⊔︀", Sqrt: "√", sqsub: "⊏", sqsube: "⊑", sqsubset: "⊏", sqsubseteq: "⊑", sqsup: "⊐", sqsupe: "⊒", sqsupset: "⊐", sqsupseteq: "⊒", square: "□", Square: "□", SquareIntersection: "⊓", SquareSubset: "⊏", SquareSubsetEqual: "⊑", SquareSuperset: "⊐", SquareSupersetEqual: "⊒", SquareUnion: "⊔", squarf: "▪", squ: "□", squf: "▪", srarr: "→", Sscr: "𝒮", sscr: "𝓈", ssetmn: "∖", ssmile: "⌣", sstarf: "⋆", Star: "⋆", star: "☆", starf: "★", straightepsilon: "ϵ", straightphi: "ϕ", strns: "¯", sub: "⊂", Sub: "⋐", subdot: "⪽", subE: "⫅", sube: "⊆", subedot: "⫃", submult: "⫁", subnE: "⫋", subne: "⊊", subplus: "⪿", subrarr: "⥹", subset: "⊂", Subset: "⋐", subseteq: "⊆", subseteqq: "⫅", SubsetEqual: "⊆", subsetneq: "⊊", subsetneqq: "⫋", subsim: "⫇", subsub: "⫕", subsup: "⫓", succapprox: "⪸", succ: "≻", succcurlyeq: "≽", Succeeds: "≻", SucceedsEqual: "⪰", SucceedsSlantEqual: "≽", SucceedsTilde: "≿", succeq: "⪰", succnapprox: "⪺", succneqq: "⪶", succnsim: "⋩", succsim: "≿", SuchThat: "∋", sum: "∑", Sum: "∑", sung: "♪", sup1: "¹", sup2: "²", sup3: "³", sup: "⊃", Sup: "⋑", supdot: "⪾", supdsub: "⫘", supE: "⫆", supe: "⊇", supedot: "⫄", Superset: "⊃", SupersetEqual: "⊇", suphsol: "⟉", suphsub: "⫗", suplarr: "⥻", supmult: "⫂", supnE: "⫌", supne: "⊋", supplus: "⫀", supset: "⊃", Supset: "⋑", supseteq: "⊇", supseteqq: "⫆", supsetneq: "⊋", supsetneqq: "⫌", supsim: "⫈", supsub: "⫔", supsup: "⫖", swarhk: "⤦", swarr: "↙", swArr: "⇙", swarrow: "↙", swnwar: "⤪", szlig: "ß", Tab: " ", target: "⌖", Tau: "Τ", tau: "τ", tbrk: "⎴", Tcaron: "Ť", tcaron: "ť", Tcedil: "Ţ", tcedil: "ţ", Tcy: "Т", tcy: "т", tdot: "⃛", telrec: "⌕", Tfr: "𝔗", tfr: "𝔱", there4: "∴", therefore: "∴", Therefore: "∴", Theta: "Θ", theta: "θ", thetasym: "ϑ", thetav: "ϑ", thickapprox: "≈", thicksim: "∼", ThickSpace: " ", ThinSpace: " ", thinsp: " ", thkap: "≈", thksim: "∼", THORN: "Þ", thorn: "þ", tilde: "˜", Tilde: "∼", TildeEqual: "≃", TildeFullEqual: "≅", TildeTilde: "≈", timesbar: "⨱", timesb: "⊠", times: "×", timesd: "⨰", tint: "∭", toea: "⤨", topbot: "⌶", topcir: "⫱", top: "⊤", Topf: "𝕋", topf: "𝕥", topfork: "⫚", tosa: "⤩", tprime: "‴", trade: "™", TRADE: "™", triangle: "▵", triangledown: "▿", triangleleft: "◃", trianglelefteq: "⊴", triangleq: "≜", triangleright: "▹", trianglerighteq: "⊵", tridot: "◬", trie: "≜", triminus: "⨺", TripleDot: "⃛", triplus: "⨹", trisb: "⧍", tritime: "⨻", trpezium: "⏢", Tscr: "𝒯", tscr: "𝓉", TScy: "Ц", tscy: "ц", TSHcy: "Ћ", tshcy: "ћ", Tstrok: "Ŧ", tstrok: "ŧ", twixt: "≬", twoheadleftarrow: "↞", twoheadrightarrow: "↠", Uacute: "Ú", uacute: "ú", uarr: "↑", Uarr: "↟", uArr: "⇑", Uarrocir: "⥉", Ubrcy: "Ў", ubrcy: "ў", Ubreve: "Ŭ", ubreve: "ŭ", Ucirc: "Û", ucirc: "û", Ucy: "У", ucy: "у", udarr: "⇅", Udblac: "Ű", udblac: "ű", udhar: "⥮", ufisht: "⥾", Ufr: "𝔘", ufr: "𝔲", Ugrave: "Ù", ugrave: "ù", uHar: "⥣", uharl: "↿", uharr: "↾", uhblk: "▀", ulcorn: "⌜", ulcorner: "⌜", ulcrop: "⌏", ultri: "◸", Umacr: "Ū", umacr: "ū", uml: "¨", UnderBar: "_", UnderBrace: "⏟", UnderBracket: "⎵", UnderParenthesis: "⏝", Union: "⋃", UnionPlus: "⊎", Uogon: "Ų", uogon: "ų", Uopf: "𝕌", uopf: "𝕦", UpArrowBar: "⤒", uparrow: "↑", UpArrow: "↑", Uparrow: "⇑", UpArrowDownArrow: "⇅", updownarrow: "↕", UpDownArrow: "↕", Updownarrow: "⇕", UpEquilibrium: "⥮", upharpoonleft: "↿", upharpoonright: "↾", uplus: "⊎", UpperLeftArrow: "↖", UpperRightArrow: "↗", upsi: "υ", Upsi: "ϒ", upsih: "ϒ", Upsilon: "Υ", upsilon: "υ", UpTeeArrow: "↥", UpTee: "⊥", upuparrows: "⇈", urcorn: "⌝", urcorner: "⌝", urcrop: "⌎", Uring: "Ů", uring: "ů", urtri: "◹", Uscr: "𝒰", uscr: "𝓊", utdot: "⋰", Utilde: "Ũ", utilde: "ũ", utri: "▵", utrif: "▴", uuarr: "⇈", Uuml: "Ü", uuml: "ü", uwangle: "⦧", vangrt: "⦜", varepsilon: "ϵ", varkappa: "ϰ", varnothing: "∅", varphi: "ϕ", varpi: "ϖ", varpropto: "∝", varr: "↕", vArr: "⇕", varrho: "ϱ", varsigma: "ς", varsubsetneq: "⊊︀", varsubsetneqq: "⫋︀", varsupsetneq: "⊋︀", varsupsetneqq: "⫌︀", vartheta: "ϑ", vartriangleleft: "⊲", vartriangleright: "⊳", vBar: "⫨", Vbar: "⫫", vBarv: "⫩", Vcy: "В", vcy: "в", vdash: "⊢", vDash: "⊨", Vdash: "⊩", VDash: "⊫", Vdashl: "⫦", veebar: "⊻", vee: "∨", Vee: "⋁", veeeq: "≚", vellip: "⋮", verbar: "|", Verbar: "‖", vert: "|", Vert: "‖", VerticalBar: "∣", VerticalLine: "|", VerticalSeparator: "❘", VerticalTilde: "≀", VeryThinSpace: " ", Vfr: "𝔙", vfr: "𝔳", vltri: "⊲", vnsub: "⊂⃒", vnsup: "⊃⃒", Vopf: "𝕍", vopf: "𝕧", vprop: "∝", vrtri: "⊳", Vscr: "𝒱", vscr: "𝓋", vsubnE: "⫋︀", vsubne: "⊊︀", vsupnE: "⫌︀", vsupne: "⊋︀", Vvdash: "⊪", vzigzag: "⦚", Wcirc: "Ŵ", wcirc: "ŵ", wedbar: "⩟", wedge: "∧", Wedge: "⋀", wedgeq: "≙", weierp: "℘", Wfr: "𝔚", wfr: "𝔴", Wopf: "𝕎", wopf: "𝕨", wp: "℘", wr: "≀", wreath: "≀", Wscr: "𝒲", wscr: "𝓌", xcap: "⋂", xcirc: "◯", xcup: "⋃", xdtri: "▽", Xfr: "𝔛", xfr: "𝔵", xharr: "⟷", xhArr: "⟺", Xi: "Ξ", xi: "ξ", xlarr: "⟵", xlArr: "⟸", xmap: "⟼", xnis: "⋻", xodot: "⨀", Xopf: "𝕏", xopf: "𝕩", xoplus: "⨁", xotime: "⨂", xrarr: "⟶", xrArr: "⟹", Xscr: "𝒳", xscr: "𝓍", xsqcup: "⨆", xuplus: "⨄", xutri: "△", xvee: "⋁", xwedge: "⋀", Yacute: "Ý", yacute: "ý", YAcy: "Я", yacy: "я", Ycirc: "Ŷ", ycirc: "ŷ", Ycy: "Ы", ycy: "ы", yen: "¥", Yfr: "𝔜", yfr: "𝔶", YIcy: "Ї", yicy: "ї", Yopf: "𝕐", yopf: "𝕪", Yscr: "𝒴", yscr: "𝓎", YUcy: "Ю", yucy: "ю", yuml: "ÿ", Yuml: "Ÿ", Zacute: "Ź", zacute: "ź", Zcaron: "Ž", zcaron: "ž", Zcy: "З", zcy: "з", Zdot: "Ż", zdot: "ż", zeetrf: "ℨ", ZeroWidthSpace: "", Zeta: "Ζ", zeta: "ζ", zfr: "𝔷", Zfr: "ℨ", ZHcy: "Ж", zhcy: "ж", zigrarr: "⇝", zopf: "𝕫", Zopf: "ℤ", Zscr: "𝒵", zscr: "𝓏", zwj: "", zwnj: "" }, Wa = /^#[xX]([A-Fa-f0-9]+)$/, Ka = /^#([0-9]+)$/, Qa = /^([A-Za-z0-9]+)$/, Qr = function() {
|
|
1127
|
+
function t(e) {
|
|
1128
|
+
this.named = e;
|
|
1129
|
+
}
|
|
1130
|
+
return t.prototype.parse = function(e) {
|
|
1131
|
+
if (e) {
|
|
1132
|
+
var r = e.match(Wa);
|
|
1133
|
+
if (r) return String.fromCharCode(parseInt(r[1], 16));
|
|
1134
|
+
if (r = e.match(Ka), r) return String.fromCharCode(parseInt(r[1], 10));
|
|
1135
|
+
if (r = e.match(Qa), r) return this.named[r[1]];
|
|
1136
|
+
}
|
|
1137
|
+
}, t;
|
|
1138
|
+
}(), Ja = /[\t\n\f ]/, Ya = /[A-Za-z]/, Xa = /\r\n?/g;
|
|
1139
|
+
function F(t) {
|
|
1140
|
+
return Ja.test(t);
|
|
1141
|
+
}
|
|
1142
|
+
function mr(t) {
|
|
1143
|
+
return Ya.test(t);
|
|
1144
|
+
}
|
|
1145
|
+
function Za(t) {
|
|
1146
|
+
return t.replace(Xa, `
|
|
1147
|
+
`);
|
|
1148
|
+
}
|
|
1149
|
+
var ts = function() {
|
|
1150
|
+
function t(e, r, n) {
|
|
1151
|
+
n === void 0 && (n = "precompile"), this.delegate = e, this.entityParser = r, this.mode = n, this.state = "beforeData", this.line = -1, this.column = -1, this.input = "", this.index = -1, this.tagNameBuffer = "", this.states = { beforeData: function() {
|
|
1152
|
+
var a = this.peek();
|
|
1153
|
+
if (a === "<" && !this.isIgnoredEndTag()) this.transitionTo("tagOpen"), this.markTagStart(), this.consume();
|
|
1154
|
+
else {
|
|
1155
|
+
if (this.mode === "precompile" && a === `
|
|
1156
|
+
`) {
|
|
1157
|
+
var s = this.tagNameBuffer.toLowerCase();
|
|
1158
|
+
(s === "pre" || s === "textarea") && this.consume();
|
|
1159
|
+
}
|
|
1160
|
+
this.transitionTo("data"), this.delegate.beginData();
|
|
1161
|
+
}
|
|
1162
|
+
}, data: function() {
|
|
1163
|
+
var a = this.peek(), s = this.tagNameBuffer;
|
|
1164
|
+
a === "<" && !this.isIgnoredEndTag() ? (this.delegate.finishData(), this.transitionTo("tagOpen"), this.markTagStart(), this.consume()) : a === "&" && s !== "script" && s !== "style" ? (this.consume(), this.delegate.appendToData(this.consumeCharRef() || "&")) : (this.consume(), this.delegate.appendToData(a));
|
|
1165
|
+
}, tagOpen: function() {
|
|
1166
|
+
var a = this.consume();
|
|
1167
|
+
a === "!" ? this.transitionTo("markupDeclarationOpen") : a === "/" ? this.transitionTo("endTagOpen") : (a === "@" || a === ":" || mr(a)) && (this.transitionTo("tagName"), this.tagNameBuffer = "", this.delegate.beginStartTag(), this.appendToTagName(a));
|
|
1168
|
+
}, markupDeclarationOpen: function() {
|
|
1169
|
+
var a = this.consume();
|
|
1170
|
+
if (a === "-" && this.peek() === "-") this.consume(), this.transitionTo("commentStart"), this.delegate.beginComment();
|
|
1171
|
+
else {
|
|
1172
|
+
var s = a.toUpperCase() + this.input.substring(this.index, this.index + 6).toUpperCase();
|
|
1173
|
+
s === "DOCTYPE" && (this.consume(), this.consume(), this.consume(), this.consume(), this.consume(), this.consume(), this.transitionTo("doctype"), this.delegate.beginDoctype && this.delegate.beginDoctype());
|
|
1174
|
+
}
|
|
1175
|
+
}, doctype: function() {
|
|
1176
|
+
var a = this.consume();
|
|
1177
|
+
F(a) && this.transitionTo("beforeDoctypeName");
|
|
1178
|
+
}, beforeDoctypeName: function() {
|
|
1179
|
+
var a = this.consume();
|
|
1180
|
+
F(a) || (this.transitionTo("doctypeName"), this.delegate.appendToDoctypeName && this.delegate.appendToDoctypeName(a.toLowerCase()));
|
|
1181
|
+
}, doctypeName: function() {
|
|
1182
|
+
var a = this.consume();
|
|
1183
|
+
F(a) ? this.transitionTo("afterDoctypeName") : a === ">" ? (this.delegate.endDoctype && this.delegate.endDoctype(), this.transitionTo("beforeData")) : this.delegate.appendToDoctypeName && this.delegate.appendToDoctypeName(a.toLowerCase());
|
|
1184
|
+
}, afterDoctypeName: function() {
|
|
1185
|
+
var a = this.consume();
|
|
1186
|
+
if (!F(a)) if (a === ">") this.delegate.endDoctype && this.delegate.endDoctype(), this.transitionTo("beforeData");
|
|
1187
|
+
else {
|
|
1188
|
+
var s = a.toUpperCase() + this.input.substring(this.index, this.index + 5).toUpperCase(), u = s.toUpperCase() === "PUBLIC", i = s.toUpperCase() === "SYSTEM";
|
|
1189
|
+
(u || i) && (this.consume(), this.consume(), this.consume(), this.consume(), this.consume(), this.consume()), u ? this.transitionTo("afterDoctypePublicKeyword") : i && this.transitionTo("afterDoctypeSystemKeyword");
|
|
1190
|
+
}
|
|
1191
|
+
}, afterDoctypePublicKeyword: function() {
|
|
1192
|
+
var a = this.peek();
|
|
1193
|
+
F(a) ? (this.transitionTo("beforeDoctypePublicIdentifier"), this.consume()) : a === '"' ? (this.transitionTo("doctypePublicIdentifierDoubleQuoted"), this.consume()) : a === "'" ? (this.transitionTo("doctypePublicIdentifierSingleQuoted"), this.consume()) : a === ">" && (this.consume(), this.delegate.endDoctype && this.delegate.endDoctype(), this.transitionTo("beforeData"));
|
|
1194
|
+
}, doctypePublicIdentifierDoubleQuoted: function() {
|
|
1195
|
+
var a = this.consume();
|
|
1196
|
+
a === '"' ? this.transitionTo("afterDoctypePublicIdentifier") : a === ">" ? (this.delegate.endDoctype && this.delegate.endDoctype(), this.transitionTo("beforeData")) : this.delegate.appendToDoctypePublicIdentifier && this.delegate.appendToDoctypePublicIdentifier(a);
|
|
1197
|
+
}, doctypePublicIdentifierSingleQuoted: function() {
|
|
1198
|
+
var a = this.consume();
|
|
1199
|
+
a === "'" ? this.transitionTo("afterDoctypePublicIdentifier") : a === ">" ? (this.delegate.endDoctype && this.delegate.endDoctype(), this.transitionTo("beforeData")) : this.delegate.appendToDoctypePublicIdentifier && this.delegate.appendToDoctypePublicIdentifier(a);
|
|
1200
|
+
}, afterDoctypePublicIdentifier: function() {
|
|
1201
|
+
var a = this.consume();
|
|
1202
|
+
F(a) ? this.transitionTo("betweenDoctypePublicAndSystemIdentifiers") : a === ">" ? (this.delegate.endDoctype && this.delegate.endDoctype(), this.transitionTo("beforeData")) : a === '"' ? this.transitionTo("doctypeSystemIdentifierDoubleQuoted") : a === "'" && this.transitionTo("doctypeSystemIdentifierSingleQuoted");
|
|
1203
|
+
}, betweenDoctypePublicAndSystemIdentifiers: function() {
|
|
1204
|
+
var a = this.consume();
|
|
1205
|
+
F(a) || (a === ">" ? (this.delegate.endDoctype && this.delegate.endDoctype(), this.transitionTo("beforeData")) : a === '"' ? this.transitionTo("doctypeSystemIdentifierDoubleQuoted") : a === "'" && this.transitionTo("doctypeSystemIdentifierSingleQuoted"));
|
|
1206
|
+
}, doctypeSystemIdentifierDoubleQuoted: function() {
|
|
1207
|
+
var a = this.consume();
|
|
1208
|
+
a === '"' ? this.transitionTo("afterDoctypeSystemIdentifier") : a === ">" ? (this.delegate.endDoctype && this.delegate.endDoctype(), this.transitionTo("beforeData")) : this.delegate.appendToDoctypeSystemIdentifier && this.delegate.appendToDoctypeSystemIdentifier(a);
|
|
1209
|
+
}, doctypeSystemIdentifierSingleQuoted: function() {
|
|
1210
|
+
var a = this.consume();
|
|
1211
|
+
a === "'" ? this.transitionTo("afterDoctypeSystemIdentifier") : a === ">" ? (this.delegate.endDoctype && this.delegate.endDoctype(), this.transitionTo("beforeData")) : this.delegate.appendToDoctypeSystemIdentifier && this.delegate.appendToDoctypeSystemIdentifier(a);
|
|
1212
|
+
}, afterDoctypeSystemIdentifier: function() {
|
|
1213
|
+
var a = this.consume();
|
|
1214
|
+
F(a) || a === ">" && (this.delegate.endDoctype && this.delegate.endDoctype(), this.transitionTo("beforeData"));
|
|
1215
|
+
}, commentStart: function() {
|
|
1216
|
+
var a = this.consume();
|
|
1217
|
+
a === "-" ? this.transitionTo("commentStartDash") : a === ">" ? (this.delegate.finishComment(), this.transitionTo("beforeData")) : (this.delegate.appendToCommentData(a), this.transitionTo("comment"));
|
|
1218
|
+
}, commentStartDash: function() {
|
|
1219
|
+
var a = this.consume();
|
|
1220
|
+
a === "-" ? this.transitionTo("commentEnd") : a === ">" ? (this.delegate.finishComment(), this.transitionTo("beforeData")) : (this.delegate.appendToCommentData("-"), this.transitionTo("comment"));
|
|
1221
|
+
}, comment: function() {
|
|
1222
|
+
var a = this.consume();
|
|
1223
|
+
a === "-" ? this.transitionTo("commentEndDash") : this.delegate.appendToCommentData(a);
|
|
1224
|
+
}, commentEndDash: function() {
|
|
1225
|
+
var a = this.consume();
|
|
1226
|
+
a === "-" ? this.transitionTo("commentEnd") : (this.delegate.appendToCommentData("-" + a), this.transitionTo("comment"));
|
|
1227
|
+
}, commentEnd: function() {
|
|
1228
|
+
var a = this.consume();
|
|
1229
|
+
a === ">" ? (this.delegate.finishComment(), this.transitionTo("beforeData")) : (this.delegate.appendToCommentData("--" + a), this.transitionTo("comment"));
|
|
1230
|
+
}, tagName: function() {
|
|
1231
|
+
var a = this.consume();
|
|
1232
|
+
F(a) ? this.transitionTo("beforeAttributeName") : a === "/" ? this.transitionTo("selfClosingStartTag") : a === ">" ? (this.delegate.finishTag(), this.transitionTo("beforeData")) : this.appendToTagName(a);
|
|
1233
|
+
}, endTagName: function() {
|
|
1234
|
+
var a = this.consume();
|
|
1235
|
+
F(a) ? (this.transitionTo("beforeAttributeName"), this.tagNameBuffer = "") : a === "/" ? (this.transitionTo("selfClosingStartTag"), this.tagNameBuffer = "") : a === ">" ? (this.delegate.finishTag(), this.transitionTo("beforeData"), this.tagNameBuffer = "") : this.appendToTagName(a);
|
|
1236
|
+
}, beforeAttributeName: function() {
|
|
1237
|
+
var a = this.peek();
|
|
1238
|
+
if (F(a)) {
|
|
1239
|
+
this.consume();
|
|
1240
|
+
return;
|
|
1241
|
+
} else a === "/" ? (this.transitionTo("selfClosingStartTag"), this.consume()) : a === ">" ? (this.consume(), this.delegate.finishTag(), this.transitionTo("beforeData")) : a === "=" ? (this.delegate.reportSyntaxError("attribute name cannot start with equals sign"), this.transitionTo("attributeName"), this.delegate.beginAttribute(), this.consume(), this.delegate.appendToAttributeName(a)) : (this.transitionTo("attributeName"), this.delegate.beginAttribute());
|
|
1242
|
+
}, attributeName: function() {
|
|
1243
|
+
var a = this.peek();
|
|
1244
|
+
F(a) ? (this.transitionTo("afterAttributeName"), this.consume()) : a === "/" ? (this.delegate.beginAttributeValue(!1), this.delegate.finishAttributeValue(), this.consume(), this.transitionTo("selfClosingStartTag")) : a === "=" ? (this.transitionTo("beforeAttributeValue"), this.consume()) : a === ">" ? (this.delegate.beginAttributeValue(!1), this.delegate.finishAttributeValue(), this.consume(), this.delegate.finishTag(), this.transitionTo("beforeData")) : a === '"' || a === "'" || a === "<" ? (this.delegate.reportSyntaxError(a + " is not a valid character within attribute names"), this.consume(), this.delegate.appendToAttributeName(a)) : (this.consume(), this.delegate.appendToAttributeName(a));
|
|
1245
|
+
}, afterAttributeName: function() {
|
|
1246
|
+
var a = this.peek();
|
|
1247
|
+
if (F(a)) {
|
|
1248
|
+
this.consume();
|
|
1249
|
+
return;
|
|
1250
|
+
} else a === "/" ? (this.delegate.beginAttributeValue(!1), this.delegate.finishAttributeValue(), this.consume(), this.transitionTo("selfClosingStartTag")) : a === "=" ? (this.consume(), this.transitionTo("beforeAttributeValue")) : a === ">" ? (this.delegate.beginAttributeValue(!1), this.delegate.finishAttributeValue(), this.consume(), this.delegate.finishTag(), this.transitionTo("beforeData")) : (this.delegate.beginAttributeValue(!1), this.delegate.finishAttributeValue(), this.transitionTo("attributeName"), this.delegate.beginAttribute(), this.consume(), this.delegate.appendToAttributeName(a));
|
|
1251
|
+
}, beforeAttributeValue: function() {
|
|
1252
|
+
var a = this.peek();
|
|
1253
|
+
F(a) ? this.consume() : a === '"' ? (this.transitionTo("attributeValueDoubleQuoted"), this.delegate.beginAttributeValue(!0), this.consume()) : a === "'" ? (this.transitionTo("attributeValueSingleQuoted"), this.delegate.beginAttributeValue(!0), this.consume()) : a === ">" ? (this.delegate.beginAttributeValue(!1), this.delegate.finishAttributeValue(), this.consume(), this.delegate.finishTag(), this.transitionTo("beforeData")) : (this.transitionTo("attributeValueUnquoted"), this.delegate.beginAttributeValue(!1), this.consume(), this.delegate.appendToAttributeValue(a));
|
|
1254
|
+
}, attributeValueDoubleQuoted: function() {
|
|
1255
|
+
var a = this.consume();
|
|
1256
|
+
a === '"' ? (this.delegate.finishAttributeValue(), this.transitionTo("afterAttributeValueQuoted")) : a === "&" ? this.delegate.appendToAttributeValue(this.consumeCharRef() || "&") : this.delegate.appendToAttributeValue(a);
|
|
1257
|
+
}, attributeValueSingleQuoted: function() {
|
|
1258
|
+
var a = this.consume();
|
|
1259
|
+
a === "'" ? (this.delegate.finishAttributeValue(), this.transitionTo("afterAttributeValueQuoted")) : a === "&" ? this.delegate.appendToAttributeValue(this.consumeCharRef() || "&") : this.delegate.appendToAttributeValue(a);
|
|
1260
|
+
}, attributeValueUnquoted: function() {
|
|
1261
|
+
var a = this.peek();
|
|
1262
|
+
F(a) ? (this.delegate.finishAttributeValue(), this.consume(), this.transitionTo("beforeAttributeName")) : a === "/" ? (this.delegate.finishAttributeValue(), this.consume(), this.transitionTo("selfClosingStartTag")) : a === "&" ? (this.consume(), this.delegate.appendToAttributeValue(this.consumeCharRef() || "&")) : a === ">" ? (this.delegate.finishAttributeValue(), this.consume(), this.delegate.finishTag(), this.transitionTo("beforeData")) : (this.consume(), this.delegate.appendToAttributeValue(a));
|
|
1263
|
+
}, afterAttributeValueQuoted: function() {
|
|
1264
|
+
var a = this.peek();
|
|
1265
|
+
F(a) ? (this.consume(), this.transitionTo("beforeAttributeName")) : a === "/" ? (this.consume(), this.transitionTo("selfClosingStartTag")) : a === ">" ? (this.consume(), this.delegate.finishTag(), this.transitionTo("beforeData")) : this.transitionTo("beforeAttributeName");
|
|
1266
|
+
}, selfClosingStartTag: function() {
|
|
1267
|
+
var a = this.peek();
|
|
1268
|
+
a === ">" ? (this.consume(), this.delegate.markTagAsSelfClosing(), this.delegate.finishTag(), this.transitionTo("beforeData")) : this.transitionTo("beforeAttributeName");
|
|
1269
|
+
}, endTagOpen: function() {
|
|
1270
|
+
var a = this.consume();
|
|
1271
|
+
(a === "@" || a === ":" || mr(a)) && (this.transitionTo("endTagName"), this.tagNameBuffer = "", this.delegate.beginEndTag(), this.appendToTagName(a));
|
|
1272
|
+
} }, this.reset();
|
|
1273
|
+
}
|
|
1274
|
+
return t.prototype.reset = function() {
|
|
1275
|
+
this.transitionTo("beforeData"), this.input = "", this.tagNameBuffer = "", this.index = 0, this.line = 1, this.column = 0, this.delegate.reset();
|
|
1276
|
+
}, t.prototype.transitionTo = function(e) {
|
|
1277
|
+
this.state = e;
|
|
1278
|
+
}, t.prototype.tokenize = function(e) {
|
|
1279
|
+
this.reset(), this.tokenizePart(e), this.tokenizeEOF();
|
|
1280
|
+
}, t.prototype.tokenizePart = function(e) {
|
|
1281
|
+
for (this.input += Za(e); this.index < this.input.length; ) {
|
|
1282
|
+
var r = this.states[this.state];
|
|
1283
|
+
if (r !== void 0) r.call(this);
|
|
1284
|
+
else throw new Error("unhandled state " + this.state);
|
|
1285
|
+
}
|
|
1286
|
+
}, t.prototype.tokenizeEOF = function() {
|
|
1287
|
+
this.flushData();
|
|
1288
|
+
}, t.prototype.flushData = function() {
|
|
1289
|
+
this.state === "data" && (this.delegate.finishData(), this.transitionTo("beforeData"));
|
|
1290
|
+
}, t.prototype.peek = function() {
|
|
1291
|
+
return this.input.charAt(this.index);
|
|
1292
|
+
}, t.prototype.consume = function() {
|
|
1293
|
+
var e = this.peek();
|
|
1294
|
+
return this.index++, e === `
|
|
1295
|
+
` ? (this.line++, this.column = 0) : this.column++, e;
|
|
1296
|
+
}, t.prototype.consumeCharRef = function() {
|
|
1297
|
+
var e = this.input.indexOf(";", this.index);
|
|
1298
|
+
if (e !== -1) {
|
|
1299
|
+
var r = this.input.slice(this.index, e), n = this.entityParser.parse(r);
|
|
1300
|
+
if (n) {
|
|
1301
|
+
for (var a = r.length; a; ) this.consume(), a--;
|
|
1302
|
+
return this.consume(), n;
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
}, t.prototype.markTagStart = function() {
|
|
1306
|
+
this.delegate.tagOpen();
|
|
1307
|
+
}, t.prototype.appendToTagName = function(e) {
|
|
1308
|
+
this.tagNameBuffer += e, this.delegate.appendToTagName(e);
|
|
1309
|
+
}, t.prototype.isIgnoredEndTag = function() {
|
|
1310
|
+
var e = this.tagNameBuffer;
|
|
1311
|
+
return e === "title" && this.input.substring(this.index, this.index + 8) !== "</title>" || e === "style" && this.input.substring(this.index, this.index + 8) !== "</style>" || e === "script" && this.input.substring(this.index, this.index + 9) !== "<\/script>";
|
|
1312
|
+
}, t;
|
|
1313
|
+
}(), Be = /* @__PURE__ */ new Set(["area", "base", "br", "col", "command", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]);
|
|
1314
|
+
function es(t) {
|
|
1315
|
+
var e;
|
|
1316
|
+
return Be.has(t.toLowerCase()) && ((e = t[0]) == null ? void 0 : e.toLowerCase()) === t[0];
|
|
1317
|
+
}
|
|
1318
|
+
var it = Object.freeze({ line: 1, column: 0 }), rs = Object.freeze({ source: "(synthetic)", start: it, end: it }), Pt = Object.freeze({ source: "(nonexistent)", start: it, end: it }), st = Object.freeze({ source: "(broken)", start: it, end: it }), v = function(t) {
|
|
1319
|
+
return t.CharPosition = "CharPosition", t.HbsPosition = "HbsPosition", t.InternalsSynthetic = "InternalsSynthetic", t.NonExistent = "NonExistent", t.Broken = "Broken", t;
|
|
1320
|
+
}({}), qt = "MATCH_ANY", ke = "IS_INVISIBLE", ns = class {
|
|
1321
|
+
constructor(t) {
|
|
1322
|
+
w(this, "_whens");
|
|
1323
|
+
this._whens = t;
|
|
1324
|
+
}
|
|
1325
|
+
first(t) {
|
|
1326
|
+
for (let e of this._whens) {
|
|
1327
|
+
let r = e.match(t);
|
|
1328
|
+
if (Bt(r)) return r[0];
|
|
1329
|
+
}
|
|
1330
|
+
return null;
|
|
1331
|
+
}
|
|
1332
|
+
}, fr = class {
|
|
1333
|
+
constructor() {
|
|
1334
|
+
w(this, "_map", /* @__PURE__ */ new Map());
|
|
1335
|
+
}
|
|
1336
|
+
get(t, e) {
|
|
1337
|
+
let r = this._map.get(t);
|
|
1338
|
+
return r || (r = e(), this._map.set(t, r), r);
|
|
1339
|
+
}
|
|
1340
|
+
add(t, e) {
|
|
1341
|
+
this._map.set(t, e);
|
|
1342
|
+
}
|
|
1343
|
+
match(t) {
|
|
1344
|
+
let e = ss(t), r = [], n = this._map.get(e), a = this._map.get(qt);
|
|
1345
|
+
return n && r.push(n), a && r.push(a), r;
|
|
1346
|
+
}
|
|
1347
|
+
};
|
|
1348
|
+
function Jr(t) {
|
|
1349
|
+
return t(new as()).check();
|
|
1350
|
+
}
|
|
1351
|
+
var as = class {
|
|
1352
|
+
constructor() {
|
|
1353
|
+
w(this, "_whens", new fr());
|
|
1354
|
+
}
|
|
1355
|
+
check() {
|
|
1356
|
+
return (t, e) => this.matchFor(t.kind, e.kind)(t, e);
|
|
1357
|
+
}
|
|
1358
|
+
matchFor(t, e) {
|
|
1359
|
+
let r = this._whens.match(t);
|
|
1360
|
+
S(Bt(r), `no match defined for (${t}, ${e}) and no AnyMatch defined either`);
|
|
1361
|
+
let n = new ns(r).first(e);
|
|
1362
|
+
return S(n !== null, `no match defined for (${t}, ${e}) and no AnyMatch defined either`), n;
|
|
1363
|
+
}
|
|
1364
|
+
when(t, e, r) {
|
|
1365
|
+
return this._whens.get(t, () => new fr()).add(e, r), this;
|
|
1366
|
+
}
|
|
1367
|
+
};
|
|
1368
|
+
function ss(t) {
|
|
1369
|
+
switch (t) {
|
|
1370
|
+
case v.Broken:
|
|
1371
|
+
case v.InternalsSynthetic:
|
|
1372
|
+
case v.NonExistent:
|
|
1373
|
+
return ke;
|
|
1374
|
+
default:
|
|
1375
|
+
return t;
|
|
1376
|
+
}
|
|
1377
|
+
}
|
|
1378
|
+
var us = class xe {
|
|
1379
|
+
constructor(e) {
|
|
1380
|
+
w(this, "chars");
|
|
1381
|
+
w(this, "loc");
|
|
1382
|
+
this.loc = e.loc, this.chars = e.chars;
|
|
1383
|
+
}
|
|
1384
|
+
static synthetic(e) {
|
|
1385
|
+
let r = I.synthetic(e);
|
|
1386
|
+
return new xe({ loc: r, chars: e });
|
|
1387
|
+
}
|
|
1388
|
+
static load(e, r) {
|
|
1389
|
+
return new xe({ loc: I.load(e, r[1]), chars: r[0] });
|
|
1390
|
+
}
|
|
1391
|
+
getString() {
|
|
1392
|
+
return this.chars;
|
|
1393
|
+
}
|
|
1394
|
+
serialize() {
|
|
1395
|
+
return [this.chars, this.loc.serialize()];
|
|
1396
|
+
}
|
|
1397
|
+
}, I = class At {
|
|
1398
|
+
constructor(e) {
|
|
1399
|
+
w(this, "isInvisible");
|
|
1400
|
+
this.data = e, this.isInvisible = e.kind !== v.CharPosition && e.kind !== v.HbsPosition;
|
|
1401
|
+
}
|
|
1402
|
+
static get NON_EXISTENT() {
|
|
1403
|
+
return new pt(v.NonExistent, Pt).wrap();
|
|
1404
|
+
}
|
|
1405
|
+
static load(e, r) {
|
|
1406
|
+
if (typeof r == "number") return At.forCharPositions(e, r, r);
|
|
1407
|
+
if (typeof r == "string") return At.synthetic(r);
|
|
1408
|
+
if (Array.isArray(r)) return At.forCharPositions(e, r[0], r[1]);
|
|
1409
|
+
if (r === v.NonExistent) return At.NON_EXISTENT;
|
|
1410
|
+
if (r === v.Broken) return At.broken(st);
|
|
1411
|
+
La(r);
|
|
1412
|
+
}
|
|
1413
|
+
static forHbsLoc(e, r) {
|
|
1414
|
+
let n = new Ct(e, r.start), a = new Ct(e, r.end);
|
|
1415
|
+
return new We(e, { start: n, end: a }, r).wrap();
|
|
1416
|
+
}
|
|
1417
|
+
static forCharPositions(e, r, n) {
|
|
1418
|
+
let a = new It(e, r), s = new It(e, n);
|
|
1419
|
+
return new Ge(e, { start: a, end: s }).wrap();
|
|
1420
|
+
}
|
|
1421
|
+
static synthetic(e) {
|
|
1422
|
+
return new pt(v.InternalsSynthetic, Pt, e).wrap();
|
|
1423
|
+
}
|
|
1424
|
+
static broken(e = st) {
|
|
1425
|
+
return new pt(v.Broken, e).wrap();
|
|
1426
|
+
}
|
|
1427
|
+
getStart() {
|
|
1428
|
+
return this.data.getStart().wrap();
|
|
1429
|
+
}
|
|
1430
|
+
getEnd() {
|
|
1431
|
+
return this.data.getEnd().wrap();
|
|
1432
|
+
}
|
|
1433
|
+
get loc() {
|
|
1434
|
+
let e = this.data.toHbsSpan();
|
|
1435
|
+
return e === null ? st : e.toHbsLoc();
|
|
1436
|
+
}
|
|
1437
|
+
get module() {
|
|
1438
|
+
return this.data.getModule();
|
|
1439
|
+
}
|
|
1440
|
+
get startPosition() {
|
|
1441
|
+
return this.loc.start;
|
|
1442
|
+
}
|
|
1443
|
+
get endPosition() {
|
|
1444
|
+
return this.loc.end;
|
|
1445
|
+
}
|
|
1446
|
+
toJSON() {
|
|
1447
|
+
return this.loc;
|
|
1448
|
+
}
|
|
1449
|
+
withStart(e) {
|
|
1450
|
+
return W(e.data, this.data.getEnd());
|
|
1451
|
+
}
|
|
1452
|
+
withEnd(e) {
|
|
1453
|
+
return W(this.data.getStart(), e.data);
|
|
1454
|
+
}
|
|
1455
|
+
asString() {
|
|
1456
|
+
return this.data.asString();
|
|
1457
|
+
}
|
|
1458
|
+
toSlice(e) {
|
|
1459
|
+
let r = this.data.asString();
|
|
1460
|
+
return new us({ loc: this, chars: e || r });
|
|
1461
|
+
}
|
|
1462
|
+
get start() {
|
|
1463
|
+
return this.loc.start;
|
|
1464
|
+
}
|
|
1465
|
+
set start(e) {
|
|
1466
|
+
this.data.locDidUpdate({ start: e });
|
|
1467
|
+
}
|
|
1468
|
+
get end() {
|
|
1469
|
+
return this.loc.end;
|
|
1470
|
+
}
|
|
1471
|
+
set end(e) {
|
|
1472
|
+
this.data.locDidUpdate({ end: e });
|
|
1473
|
+
}
|
|
1474
|
+
get source() {
|
|
1475
|
+
return this.module;
|
|
1476
|
+
}
|
|
1477
|
+
collapse(e) {
|
|
1478
|
+
switch (e) {
|
|
1479
|
+
case "start":
|
|
1480
|
+
return this.getStart().collapsed();
|
|
1481
|
+
case "end":
|
|
1482
|
+
return this.getEnd().collapsed();
|
|
1483
|
+
}
|
|
1484
|
+
}
|
|
1485
|
+
extend(e) {
|
|
1486
|
+
return W(this.data.getStart(), e.data.getEnd());
|
|
1487
|
+
}
|
|
1488
|
+
serialize() {
|
|
1489
|
+
return this.data.serialize();
|
|
1490
|
+
}
|
|
1491
|
+
slice({ skipStart: e = 0, skipEnd: r = 0 }) {
|
|
1492
|
+
return W(this.getStart().move(e).data, this.getEnd().move(-r).data);
|
|
1493
|
+
}
|
|
1494
|
+
sliceStartChars({ skipStart: e = 0, chars: r }) {
|
|
1495
|
+
return W(this.getStart().move(e).data, this.getStart().move(e + r).data);
|
|
1496
|
+
}
|
|
1497
|
+
sliceEndChars({ skipEnd: e = 0, chars: r }) {
|
|
1498
|
+
return W(this.getEnd().move(e - r).data, this.getStart().move(-e).data);
|
|
1499
|
+
}
|
|
1500
|
+
}, Ge = class {
|
|
1501
|
+
constructor(t, e) {
|
|
1502
|
+
w(this, "kind", v.CharPosition);
|
|
1503
|
+
w(this, "_locPosSpan", null);
|
|
1504
|
+
this.source = t, this.charPositions = e;
|
|
1505
|
+
}
|
|
1506
|
+
wrap() {
|
|
1507
|
+
return new I(this);
|
|
1508
|
+
}
|
|
1509
|
+
asString() {
|
|
1510
|
+
return this.source.slice(this.charPositions.start.charPos, this.charPositions.end.charPos);
|
|
1511
|
+
}
|
|
1512
|
+
getModule() {
|
|
1513
|
+
return this.source.module;
|
|
1514
|
+
}
|
|
1515
|
+
getStart() {
|
|
1516
|
+
return this.charPositions.start;
|
|
1517
|
+
}
|
|
1518
|
+
getEnd() {
|
|
1519
|
+
return this.charPositions.end;
|
|
1520
|
+
}
|
|
1521
|
+
locDidUpdate() {
|
|
1522
|
+
}
|
|
1523
|
+
toHbsSpan() {
|
|
1524
|
+
let t = this._locPosSpan;
|
|
1525
|
+
if (t === null) {
|
|
1526
|
+
let e = this.charPositions.start.toHbsPos(), r = this.charPositions.end.toHbsPos();
|
|
1527
|
+
e === null || r === null ? t = this._locPosSpan = ot : t = this._locPosSpan = new We(this.source, { start: e, end: r });
|
|
1528
|
+
}
|
|
1529
|
+
return t === ot ? null : t;
|
|
1530
|
+
}
|
|
1531
|
+
serialize() {
|
|
1532
|
+
let { start: { charPos: t }, end: { charPos: e } } = this.charPositions;
|
|
1533
|
+
return t === e ? t : [t, e];
|
|
1534
|
+
}
|
|
1535
|
+
toCharPosSpan() {
|
|
1536
|
+
return this;
|
|
1537
|
+
}
|
|
1538
|
+
}, We = class {
|
|
1539
|
+
constructor(t, e, r = null) {
|
|
1540
|
+
w(this, "kind", v.HbsPosition);
|
|
1541
|
+
w(this, "_charPosSpan", null);
|
|
1542
|
+
w(this, "_providedHbsLoc");
|
|
1543
|
+
this.source = t, this.hbsPositions = e, this._providedHbsLoc = r;
|
|
1544
|
+
}
|
|
1545
|
+
serialize() {
|
|
1546
|
+
let t = this.toCharPosSpan();
|
|
1547
|
+
return t === null ? v.Broken : t.wrap().serialize();
|
|
1548
|
+
}
|
|
1549
|
+
wrap() {
|
|
1550
|
+
return new I(this);
|
|
1551
|
+
}
|
|
1552
|
+
updateProvided(t, e) {
|
|
1553
|
+
this._providedHbsLoc && (this._providedHbsLoc[e] = t), this._charPosSpan = null, this._providedHbsLoc = { start: t, end: t };
|
|
1554
|
+
}
|
|
1555
|
+
locDidUpdate({ start: t, end: e }) {
|
|
1556
|
+
t !== void 0 && (this.updateProvided(t, "start"), this.hbsPositions.start = new Ct(this.source, t, null)), e !== void 0 && (this.updateProvided(e, "end"), this.hbsPositions.end = new Ct(this.source, e, null));
|
|
1557
|
+
}
|
|
1558
|
+
asString() {
|
|
1559
|
+
let t = this.toCharPosSpan();
|
|
1560
|
+
return t === null ? "" : t.asString();
|
|
1561
|
+
}
|
|
1562
|
+
getModule() {
|
|
1563
|
+
return this.source.module;
|
|
1564
|
+
}
|
|
1565
|
+
getStart() {
|
|
1566
|
+
return this.hbsPositions.start;
|
|
1567
|
+
}
|
|
1568
|
+
getEnd() {
|
|
1569
|
+
return this.hbsPositions.end;
|
|
1570
|
+
}
|
|
1571
|
+
toHbsLoc() {
|
|
1572
|
+
return { start: this.hbsPositions.start.hbsPos, end: this.hbsPositions.end.hbsPos };
|
|
1573
|
+
}
|
|
1574
|
+
toHbsSpan() {
|
|
1575
|
+
return this;
|
|
1576
|
+
}
|
|
1577
|
+
toCharPosSpan() {
|
|
1578
|
+
let t = this._charPosSpan;
|
|
1579
|
+
if (t === null) {
|
|
1580
|
+
let e = this.hbsPositions.start.toCharPos(), r = this.hbsPositions.end.toCharPos();
|
|
1581
|
+
if (e && r) t = this._charPosSpan = new Ge(this.source, { start: e, end: r });
|
|
1582
|
+
else return t = this._charPosSpan = ot, null;
|
|
1583
|
+
}
|
|
1584
|
+
return t === ot ? null : t;
|
|
1585
|
+
}
|
|
1586
|
+
}, pt = class {
|
|
1587
|
+
constructor(t, e, r = null) {
|
|
1588
|
+
this.kind = t, this.loc = e, this.string = r;
|
|
1589
|
+
}
|
|
1590
|
+
serialize() {
|
|
1591
|
+
switch (this.kind) {
|
|
1592
|
+
case v.Broken:
|
|
1593
|
+
case v.NonExistent:
|
|
1594
|
+
return this.kind;
|
|
1595
|
+
case v.InternalsSynthetic:
|
|
1596
|
+
return this.string || "";
|
|
1597
|
+
}
|
|
1598
|
+
}
|
|
1599
|
+
wrap() {
|
|
1600
|
+
return new I(this);
|
|
1601
|
+
}
|
|
1602
|
+
asString() {
|
|
1603
|
+
return this.string || "";
|
|
1604
|
+
}
|
|
1605
|
+
locDidUpdate({ start: t, end: e }) {
|
|
1606
|
+
t !== void 0 && (this.loc.start = t), e !== void 0 && (this.loc.end = e);
|
|
1607
|
+
}
|
|
1608
|
+
getModule() {
|
|
1609
|
+
return "an unknown module";
|
|
1610
|
+
}
|
|
1611
|
+
getStart() {
|
|
1612
|
+
return new Ne(this.kind, this.loc.start);
|
|
1613
|
+
}
|
|
1614
|
+
getEnd() {
|
|
1615
|
+
return new Ne(this.kind, this.loc.end);
|
|
1616
|
+
}
|
|
1617
|
+
toCharPosSpan() {
|
|
1618
|
+
return this;
|
|
1619
|
+
}
|
|
1620
|
+
toHbsSpan() {
|
|
1621
|
+
return null;
|
|
1622
|
+
}
|
|
1623
|
+
toHbsLoc() {
|
|
1624
|
+
return st;
|
|
1625
|
+
}
|
|
1626
|
+
}, W = Jr((t) => t.when(v.HbsPosition, v.HbsPosition, (e, r) => new We(e.source, { start: e, end: r }).wrap()).when(v.CharPosition, v.CharPosition, (e, r) => new Ge(e.source, { start: e, end: r }).wrap()).when(v.CharPosition, v.HbsPosition, (e, r) => {
|
|
1627
|
+
let n = r.toCharPos();
|
|
1628
|
+
return n === null ? new pt(v.Broken, st).wrap() : W(e, n);
|
|
1629
|
+
}).when(v.HbsPosition, v.CharPosition, (e, r) => {
|
|
1630
|
+
let n = e.toCharPos();
|
|
1631
|
+
return n === null ? new pt(v.Broken, st).wrap() : W(n, r);
|
|
1632
|
+
}).when(ke, qt, (e) => new pt(e.kind, st).wrap()).when(qt, ke, (e, r) => new pt(r.kind, st).wrap())), ot = "BROKEN", re = class Te {
|
|
1633
|
+
static forHbsPos(e, r) {
|
|
1634
|
+
return new Ct(e, r, null).wrap();
|
|
1635
|
+
}
|
|
1636
|
+
static broken(e = it) {
|
|
1637
|
+
return new Ne(v.Broken, e).wrap();
|
|
1638
|
+
}
|
|
1639
|
+
constructor(e) {
|
|
1640
|
+
this.data = e;
|
|
1641
|
+
}
|
|
1642
|
+
get offset() {
|
|
1643
|
+
let e = this.data.toCharPos();
|
|
1644
|
+
return e === null ? null : e.offset;
|
|
1645
|
+
}
|
|
1646
|
+
eql(e) {
|
|
1647
|
+
return is(this.data, e.data);
|
|
1648
|
+
}
|
|
1649
|
+
until(e) {
|
|
1650
|
+
return W(this.data, e.data);
|
|
1651
|
+
}
|
|
1652
|
+
move(e) {
|
|
1653
|
+
let r = this.data.toCharPos();
|
|
1654
|
+
if (r === null) return Te.broken();
|
|
1655
|
+
{
|
|
1656
|
+
let n = r.offset + e;
|
|
1657
|
+
return r.source.check(n) ? new It(r.source, n).wrap() : Te.broken();
|
|
1658
|
+
}
|
|
1659
|
+
}
|
|
1660
|
+
collapsed() {
|
|
1661
|
+
return W(this.data, this.data);
|
|
1662
|
+
}
|
|
1663
|
+
toJSON() {
|
|
1664
|
+
return this.data.toJSON();
|
|
1665
|
+
}
|
|
1666
|
+
}, It = class {
|
|
1667
|
+
constructor(t, e) {
|
|
1668
|
+
w(this, "kind", v.CharPosition);
|
|
1669
|
+
w(this, "_locPos", null);
|
|
1670
|
+
this.source = t, this.charPos = e;
|
|
1671
|
+
}
|
|
1672
|
+
toCharPos() {
|
|
1673
|
+
return this;
|
|
1674
|
+
}
|
|
1675
|
+
toJSON() {
|
|
1676
|
+
let t = this.toHbsPos();
|
|
1677
|
+
return t === null ? it : t.toJSON();
|
|
1678
|
+
}
|
|
1679
|
+
wrap() {
|
|
1680
|
+
return new re(this);
|
|
1681
|
+
}
|
|
1682
|
+
get offset() {
|
|
1683
|
+
return this.charPos;
|
|
1684
|
+
}
|
|
1685
|
+
toHbsPos() {
|
|
1686
|
+
let t = this._locPos;
|
|
1687
|
+
if (t === null) {
|
|
1688
|
+
let e = this.source.hbsPosFor(this.charPos);
|
|
1689
|
+
e === null ? this._locPos = t = ot : this._locPos = t = new Ct(this.source, e, this.charPos);
|
|
1690
|
+
}
|
|
1691
|
+
return t === ot ? null : t;
|
|
1692
|
+
}
|
|
1693
|
+
}, Ct = class {
|
|
1694
|
+
constructor(t, e, r = null) {
|
|
1695
|
+
w(this, "kind", v.HbsPosition);
|
|
1696
|
+
w(this, "_charPos");
|
|
1697
|
+
this.source = t, this.hbsPos = e, this._charPos = r === null ? null : new It(t, r);
|
|
1698
|
+
}
|
|
1699
|
+
toCharPos() {
|
|
1700
|
+
let t = this._charPos;
|
|
1701
|
+
if (t === null) {
|
|
1702
|
+
let e = this.source.charPosFor(this.hbsPos);
|
|
1703
|
+
e === null ? this._charPos = t = ot : this._charPos = t = new It(this.source, e);
|
|
1704
|
+
}
|
|
1705
|
+
return t === ot ? null : t;
|
|
1706
|
+
}
|
|
1707
|
+
toJSON() {
|
|
1708
|
+
return this.hbsPos;
|
|
1709
|
+
}
|
|
1710
|
+
wrap() {
|
|
1711
|
+
return new re(this);
|
|
1712
|
+
}
|
|
1713
|
+
toHbsPos() {
|
|
1714
|
+
return this;
|
|
1715
|
+
}
|
|
1716
|
+
}, Ne = class {
|
|
1717
|
+
constructor(t, e) {
|
|
1718
|
+
this.kind = t, this.pos = e;
|
|
1719
|
+
}
|
|
1720
|
+
toCharPos() {
|
|
1721
|
+
return null;
|
|
1722
|
+
}
|
|
1723
|
+
toJSON() {
|
|
1724
|
+
return this.pos;
|
|
1725
|
+
}
|
|
1726
|
+
wrap() {
|
|
1727
|
+
return new re(this);
|
|
1728
|
+
}
|
|
1729
|
+
get offset() {
|
|
1730
|
+
return null;
|
|
1731
|
+
}
|
|
1732
|
+
}, is = Jr((t) => t.when(v.HbsPosition, v.HbsPosition, ({ hbsPos: e }, { hbsPos: r }) => e.column === r.column && e.line === r.line).when(v.CharPosition, v.CharPosition, ({ charPos: e }, { charPos: r }) => e === r).when(v.CharPosition, v.HbsPosition, ({ offset: e }, r) => {
|
|
1733
|
+
var n;
|
|
1734
|
+
return e === ((n = r.toCharPos()) == null ? void 0 : n.offset);
|
|
1735
|
+
}).when(v.HbsPosition, v.CharPosition, (e, { offset: r }) => {
|
|
1736
|
+
var n;
|
|
1737
|
+
return ((n = e.toCharPos()) == null ? void 0 : n.offset) === r;
|
|
1738
|
+
}).when(qt, qt, () => !1)), Ft = class Yr {
|
|
1739
|
+
static from(e, r = {}) {
|
|
1740
|
+
var n;
|
|
1741
|
+
return new Yr(e, (n = r.meta) == null ? void 0 : n.moduleName);
|
|
1742
|
+
}
|
|
1743
|
+
constructor(e, r = "an unknown module") {
|
|
1744
|
+
this.source = e, this.module = r;
|
|
1745
|
+
}
|
|
1746
|
+
check(e) {
|
|
1747
|
+
return e >= 0 && e <= this.source.length;
|
|
1748
|
+
}
|
|
1749
|
+
slice(e, r) {
|
|
1750
|
+
return this.source.slice(e, r);
|
|
1751
|
+
}
|
|
1752
|
+
offsetFor(e, r) {
|
|
1753
|
+
return re.forHbsPos(this, { line: e, column: r });
|
|
1754
|
+
}
|
|
1755
|
+
spanFor({ start: e, end: r }) {
|
|
1756
|
+
return I.forHbsLoc(this, { start: { line: e.line, column: e.column }, end: { line: r.line, column: r.column } });
|
|
1757
|
+
}
|
|
1758
|
+
hbsPosFor(e) {
|
|
1759
|
+
let r = 0, n = 0;
|
|
1760
|
+
if (e > this.source.length) return null;
|
|
1761
|
+
for (; ; ) {
|
|
1762
|
+
let a = this.source.indexOf(`
|
|
1763
|
+
`, n);
|
|
1764
|
+
if (e <= a || a === -1) return { line: r + 1, column: e - n };
|
|
1765
|
+
r += 1, n = a + 1;
|
|
1766
|
+
}
|
|
1767
|
+
}
|
|
1768
|
+
charPosFor(e) {
|
|
1769
|
+
let { line: r, column: n } = e, a = this.source.length, s = 0, u = 0;
|
|
1770
|
+
for (; u < a; ) {
|
|
1771
|
+
let i = this.source.indexOf(`
|
|
1772
|
+
`, u);
|
|
1773
|
+
if (i === -1 && (i = this.source.length), s === r - 1)
|
|
1774
|
+
return u + n > i ? i : u + n;
|
|
1775
|
+
if (i === -1) return 0;
|
|
1776
|
+
s += 1, u = i + 1;
|
|
1777
|
+
}
|
|
1778
|
+
return a;
|
|
1779
|
+
}
|
|
1780
|
+
};
|
|
1781
|
+
function D(t, e) {
|
|
1782
|
+
let { module: r, loc: n } = e, { line: a, column: s } = n.start, u = e.asString(), i = u ? `
|
|
1783
|
+
|
|
1784
|
+
|
|
|
1785
|
+
| ${u.split(`
|
|
1786
|
+
`).join(`
|
|
1787
|
+
| `)}
|
|
1788
|
+
|
|
|
1789
|
+
|
|
1790
|
+
` : "", l = new Error(`${t}: ${i}(error occurred in '${r}' @ line ${a} : column ${s})`);
|
|
1791
|
+
return l.name = "SyntaxError", l.location = e, l.code = u, l;
|
|
1792
|
+
}
|
|
1793
|
+
var os = { Template: ["body"], Block: ["body"], MustacheStatement: ["path", "params", "hash"], BlockStatement: ["path", "params", "hash", "program", "inverse"], ElementModifierStatement: ["path", "params", "hash"], CommentStatement: [], MustacheCommentStatement: [], ElementNode: ["attributes", "modifiers", "children", "comments"], AttrNode: ["value"], TextNode: [], ConcatStatement: ["parts"], SubExpression: ["path", "params", "hash"], PathExpression: [], StringLiteral: [], BooleanLiteral: [], NumberLiteral: [], NullLiteral: [], UndefinedLiteral: [], Hash: ["pairs"], HashPair: ["value"] }, Ke = function() {
|
|
1794
|
+
t.prototype = Object.create(Error.prototype), t.prototype.constructor = t;
|
|
1795
|
+
function t(e, r, n, a) {
|
|
1796
|
+
let s = Error.call(this, e);
|
|
1797
|
+
this.key = a, this.message = e, this.node = r, this.parent = n, s.stack && (this.stack = s.stack);
|
|
1798
|
+
}
|
|
1799
|
+
return t;
|
|
1800
|
+
}();
|
|
1801
|
+
function gr(t, e, r) {
|
|
1802
|
+
return new Ke("Cannot remove a node unless it is part of an array", t, e, r);
|
|
1803
|
+
}
|
|
1804
|
+
function ls(t, e, r) {
|
|
1805
|
+
return new Ke("Cannot replace a node with multiple nodes unless it is part of an array", t, e, r);
|
|
1806
|
+
}
|
|
1807
|
+
function br(t, e) {
|
|
1808
|
+
return new Ke("Replacing and removing in key handlers is not yet supported.", t, null, e);
|
|
1809
|
+
}
|
|
1810
|
+
var ne = class {
|
|
1811
|
+
constructor(t, e = null, r = null) {
|
|
1812
|
+
w(this, "node");
|
|
1813
|
+
w(this, "parent");
|
|
1814
|
+
w(this, "parentKey");
|
|
1815
|
+
this.node = t, this.parent = e, this.parentKey = r;
|
|
1816
|
+
}
|
|
1817
|
+
get parentNode() {
|
|
1818
|
+
return this.parent ? this.parent.node : null;
|
|
1819
|
+
}
|
|
1820
|
+
parents() {
|
|
1821
|
+
return { [Symbol.iterator]: () => new cs(this) };
|
|
1822
|
+
}
|
|
1823
|
+
}, cs = class {
|
|
1824
|
+
constructor(t) {
|
|
1825
|
+
w(this, "path");
|
|
1826
|
+
this.path = t;
|
|
1827
|
+
}
|
|
1828
|
+
next() {
|
|
1829
|
+
return this.path.parent ? (this.path = this.path.parent, { done: !1, value: this.path }) : { done: !0, value: null };
|
|
1830
|
+
}
|
|
1831
|
+
};
|
|
1832
|
+
function Xr(t) {
|
|
1833
|
+
return typeof t == "function" ? t : t.enter;
|
|
1834
|
+
}
|
|
1835
|
+
function Zr(t) {
|
|
1836
|
+
if (typeof t != "function") return t.exit;
|
|
1837
|
+
}
|
|
1838
|
+
function hs(t, e) {
|
|
1839
|
+
let r = typeof t != "function" ? t.keys : void 0;
|
|
1840
|
+
if (r === void 0) return;
|
|
1841
|
+
let n = r[e];
|
|
1842
|
+
return n !== void 0 ? n : r.All;
|
|
1843
|
+
}
|
|
1844
|
+
function ps(t, e) {
|
|
1845
|
+
if (t.Program && (e === "Template" && !t.Template || e === "Block" && !t.Block)) return M(`The 'Program' visitor node is deprecated. Use 'Template' or 'Block' instead (node was '${e}') `), t.Program;
|
|
1846
|
+
let r = t[e];
|
|
1847
|
+
return r !== void 0 ? r : t.All;
|
|
1848
|
+
}
|
|
1849
|
+
function ae(t, e) {
|
|
1850
|
+
let { node: r, parent: n, parentKey: a } = e, s = ps(t, r.type), u, i;
|
|
1851
|
+
s !== void 0 && (u = Xr(s), i = Zr(s));
|
|
1852
|
+
let l;
|
|
1853
|
+
if (u !== void 0 && (l = u(r, e)), l != null) if (JSON.stringify(r) === JSON.stringify(l)) l = void 0;
|
|
1854
|
+
else {
|
|
1855
|
+
if (Array.isArray(l)) return tn(t, l, n, a), l;
|
|
1856
|
+
{
|
|
1857
|
+
let g = new ne(l, n, a);
|
|
1858
|
+
return ae(t, g) || l;
|
|
1859
|
+
}
|
|
1860
|
+
}
|
|
1861
|
+
if (l === void 0) {
|
|
1862
|
+
let g = os[r.type];
|
|
1863
|
+
for (let h = 0; h < g.length; h++) {
|
|
1864
|
+
let m = g[h];
|
|
1865
|
+
ms(t, s, e, m);
|
|
1866
|
+
}
|
|
1867
|
+
i !== void 0 && (l = i(r, e));
|
|
1868
|
+
}
|
|
1869
|
+
return l;
|
|
1870
|
+
}
|
|
1871
|
+
function ds(t, e) {
|
|
1872
|
+
return t[e];
|
|
1873
|
+
}
|
|
1874
|
+
function yr(t, e, r) {
|
|
1875
|
+
t[e] = r;
|
|
1876
|
+
}
|
|
1877
|
+
function ms(t, e, r, n) {
|
|
1878
|
+
let { node: a } = r, s = ds(a, n);
|
|
1879
|
+
if (!s) return;
|
|
1880
|
+
let u, i;
|
|
1881
|
+
if (e !== void 0) {
|
|
1882
|
+
let l = hs(e, n);
|
|
1883
|
+
l !== void 0 && (u = Xr(l), i = Zr(l));
|
|
1884
|
+
}
|
|
1885
|
+
if (u !== void 0 && u(a, n) !== void 0) throw br(a, n);
|
|
1886
|
+
if (Array.isArray(s)) tn(t, s, r, n);
|
|
1887
|
+
else {
|
|
1888
|
+
let l = new ne(s, r, n), g = ae(t, l);
|
|
1889
|
+
g !== void 0 && fs(a, n, s, g);
|
|
1890
|
+
}
|
|
1891
|
+
if (i !== void 0 && i(a, n) !== void 0) throw br(a, n);
|
|
1892
|
+
}
|
|
1893
|
+
function tn(t, e, r, n) {
|
|
1894
|
+
for (let a = 0; a < e.length; a++) {
|
|
1895
|
+
let s = Ue(e[a]), u = new ne(s, r, n), i = ae(t, u);
|
|
1896
|
+
i !== void 0 && (a += gs(e, a, i) - 1);
|
|
1897
|
+
}
|
|
1898
|
+
}
|
|
1899
|
+
function fs(t, e, r, n) {
|
|
1900
|
+
if (n === null) throw gr(r, t, e);
|
|
1901
|
+
if (Array.isArray(n)) if (n.length === 1) yr(t, e, n[0]);
|
|
1902
|
+
else throw n.length === 0 ? gr(r, t, e) : ls(r, t, e);
|
|
1903
|
+
else yr(t, e, n);
|
|
1904
|
+
}
|
|
1905
|
+
function gs(t, e, r) {
|
|
1906
|
+
return r === null ? (t.splice(e, 1), 0) : Array.isArray(r) ? (t.splice(e, 1, ...r), r.length) : (t.splice(e, 1, r), 1);
|
|
1907
|
+
}
|
|
1908
|
+
function bs(t, e) {
|
|
1909
|
+
let r = new ne(t);
|
|
1910
|
+
ae(e, r);
|
|
1911
|
+
}
|
|
1912
|
+
function ys(t) {
|
|
1913
|
+
switch (t.type) {
|
|
1914
|
+
case "Block":
|
|
1915
|
+
case "Template":
|
|
1916
|
+
return t.body;
|
|
1917
|
+
case "ElementNode":
|
|
1918
|
+
return t.children;
|
|
1919
|
+
}
|
|
1920
|
+
}
|
|
1921
|
+
function vt(t, e) {
|
|
1922
|
+
ys(t).push(e);
|
|
1923
|
+
}
|
|
1924
|
+
function en(t) {
|
|
1925
|
+
return t.type === "StringLiteral" || t.type === "BooleanLiteral" || t.type === "NumberLiteral" || t.type === "NullLiteral" || t.type === "UndefinedLiteral";
|
|
1926
|
+
}
|
|
1927
|
+
function As(t) {
|
|
1928
|
+
return t.type === "UndefinedLiteral" ? "undefined" : JSON.stringify(t.value);
|
|
1929
|
+
}
|
|
1930
|
+
var fe;
|
|
1931
|
+
function ge() {
|
|
1932
|
+
return fe || (fe = new Ft("", "(synthetic)")), fe;
|
|
1933
|
+
}
|
|
1934
|
+
function Ds(t, e = [], r = $t([]), n = !1, a, s) {
|
|
1935
|
+
return f.mustache({ path: ut(t), params: e, hash: r, trusting: n, strip: s, loc: k(a || null) });
|
|
1936
|
+
}
|
|
1937
|
+
function Es(t, e, r, n, a = null, s, u, i, l) {
|
|
1938
|
+
let g, h = null;
|
|
1939
|
+
return n.type === "Template" ? (M("b.program is deprecated. Use b.blockItself instead."), g = f.blockItself({ params: nn(n.blockParams), body: n.body, loc: n.loc })) : g = n, (a == null ? void 0 : a.type) === "Template" ? (M("b.program is deprecated. Use b.blockItself instead."), S(a.blockParams.length === 0, "{{else}} block cannot have block params"), h = f.blockItself({ params: [], body: a.body, loc: a.loc })) : h = a, f.block({ path: ut(t), params: e || [], hash: r || $t([]), defaultBlock: g, elseBlock: h, loc: k(s || null), openStrip: u, inverseStrip: i, closeStrip: l });
|
|
1940
|
+
}
|
|
1941
|
+
function vs(t, e, r, n) {
|
|
1942
|
+
return f.elementModifier({ path: ut(t), params: e || [], hash: r || $t([]), loc: k(n || null) });
|
|
1943
|
+
}
|
|
1944
|
+
function Cs(t, e) {
|
|
1945
|
+
return f.comment({ value: t, loc: k(e || null) });
|
|
1946
|
+
}
|
|
1947
|
+
function Ss(t, e) {
|
|
1948
|
+
return f.mustacheComment({ value: t, loc: k(e || null) });
|
|
1949
|
+
}
|
|
1950
|
+
function ws(t, e) {
|
|
1951
|
+
if (!Bt(t)) throw new Error("b.concat requires at least one part");
|
|
1952
|
+
return f.concat({ parts: t, loc: k(e || null) });
|
|
1953
|
+
}
|
|
1954
|
+
function Bs(t, e = {}) {
|
|
1955
|
+
let { attrs: r, blockParams: n, modifiers: a, comments: s, children: u, openTag: i, closeTag: l, loc: g } = e, h, m;
|
|
1956
|
+
typeof t == "string" ? t.endsWith("/") ? (h = ut(t.slice(0, -1)), m = !0) : h = ut(t) : "type" in t ? (S(t.type === "PathExpression", `Invalid tag type ${t.type}`), h = t) : "path" in t ? (S(t.path.type === "PathExpression", `Invalid tag type ${t.path.type}`), h = t.path, m = t.selfClosing) : (h = ut(t.name), m = t.selfClosing), m && S(l == null, "Cannot build a self-closing tag with a closeTag source location");
|
|
1957
|
+
let A = n == null ? void 0 : n.map((C) => typeof C == "string" ? rn(C) : C), y = null;
|
|
1958
|
+
return l ? y = k(l || null) : l === void 0 && (y = m || es(h.original) ? null : k(null)), f.element({ path: h, selfClosing: m || !1, attributes: r || [], params: A || [], modifiers: a || [], comments: s || [], children: u || [], openTag: k(i || null), closeTag: y, loc: k(g || null) });
|
|
1959
|
+
}
|
|
1960
|
+
function ks(t, e, r) {
|
|
1961
|
+
return f.attr({ name: t, value: e, loc: k(r || null) });
|
|
1962
|
+
}
|
|
1963
|
+
function xs(t = "", e) {
|
|
1964
|
+
return f.text({ chars: t, loc: k(e || null) });
|
|
1965
|
+
}
|
|
1966
|
+
function Ts(t, e = [], r = $t([]), n) {
|
|
1967
|
+
return f.sexpr({ path: ut(t), params: e, hash: r, loc: k(n || null) });
|
|
1968
|
+
}
|
|
1969
|
+
function Ns(t, e) {
|
|
1970
|
+
let [r, ...n] = _t(t.split(".")), a = f.head({ original: r, loc: k(e || null) });
|
|
1971
|
+
return f.path({ head: a, tail: n, loc: k(e || null) });
|
|
1972
|
+
}
|
|
1973
|
+
function Ps(t) {
|
|
1974
|
+
return f.this({ loc: k(t || null) });
|
|
1975
|
+
}
|
|
1976
|
+
function Fs(t, e) {
|
|
1977
|
+
return f.atName({ name: t, loc: k(e || null) });
|
|
1978
|
+
}
|
|
1979
|
+
function rn(t, e) {
|
|
1980
|
+
return f.var({ name: t, loc: k(e || null) });
|
|
1981
|
+
}
|
|
1982
|
+
function Ls(t, e) {
|
|
1983
|
+
return f.head({ original: t, loc: k(e || null) });
|
|
1984
|
+
}
|
|
1985
|
+
function _s(t, e = [], r) {
|
|
1986
|
+
return f.path({ head: t, tail: e, loc: k(r || null) });
|
|
1987
|
+
}
|
|
1988
|
+
function ut(t, e) {
|
|
1989
|
+
let r = k(e || null);
|
|
1990
|
+
if (typeof t != "string") {
|
|
1991
|
+
if ("type" in t) return t;
|
|
1992
|
+
{
|
|
1993
|
+
S(t.head.indexOf(".") === -1, "builder.path({ head, tail }) should not be called with a head with dots in it");
|
|
1994
|
+
let { head: s, tail: u } = t;
|
|
1995
|
+
return f.path({ head: f.head({ original: s, loc: r.sliceStartChars({ chars: s.length }) }), tail: u, loc: k(e || null) });
|
|
1996
|
+
}
|
|
1997
|
+
}
|
|
1998
|
+
let { head: n, tail: a } = Ns(t, r);
|
|
1999
|
+
return f.path({ head: n, tail: a, loc: r });
|
|
2000
|
+
}
|
|
2001
|
+
function Yt(t, e, r) {
|
|
2002
|
+
return f.literal({ type: t, value: e, loc: k(r || null) });
|
|
2003
|
+
}
|
|
2004
|
+
function $t(t = [], e) {
|
|
2005
|
+
return f.hash({ pairs: t, loc: k(e || null) });
|
|
2006
|
+
}
|
|
2007
|
+
function qs(t, e, r) {
|
|
2008
|
+
return f.pair({ key: t, value: e, loc: k(r || null) });
|
|
2009
|
+
}
|
|
2010
|
+
function Is(t, e, r) {
|
|
2011
|
+
return M("b.program is deprecated. Use b.template or b.blockItself instead."), e && e.length ? an(t, e, !1, r) : sn(t, [], r);
|
|
2012
|
+
}
|
|
2013
|
+
function nn(t) {
|
|
2014
|
+
return t.map((e) => typeof e == "string" ? f.var({ name: e, loc: I.synthetic(e) }) : e);
|
|
2015
|
+
}
|
|
2016
|
+
function an(t = [], e = [], r = !1, n) {
|
|
2017
|
+
return f.blockItself({ body: t, params: nn(e), chained: r, loc: k(n || null) });
|
|
2018
|
+
}
|
|
2019
|
+
function sn(t = [], e = [], r) {
|
|
2020
|
+
return f.template({ body: t, blockParams: e, loc: k(r || null) });
|
|
2021
|
+
}
|
|
2022
|
+
function Os(t, e) {
|
|
2023
|
+
return f.pos({ line: t, column: e });
|
|
2024
|
+
}
|
|
2025
|
+
function k(...t) {
|
|
2026
|
+
if (t.length === 1) {
|
|
2027
|
+
let e = t[0];
|
|
2028
|
+
return e && typeof e == "object" ? I.forHbsLoc(ge(), e) : I.forHbsLoc(ge(), rs);
|
|
2029
|
+
} else {
|
|
2030
|
+
let [e, r, n, a, s] = t, u = s ? new Ft("", s) : ge();
|
|
2031
|
+
return I.forHbsLoc(u, { start: { line: e, column: r }, end: { line: n || e, column: a || r } });
|
|
2032
|
+
}
|
|
2033
|
+
}
|
|
2034
|
+
var $s = { mustache: Ds, block: Es, comment: Cs, mustacheComment: Ss, element: Bs, elementModifier: vs, attr: ks, text: xs, sexpr: Ts, concat: ws, hash: $t, pair: qs, literal: Yt, program: Is, blockItself: an, template: sn, loc: k, pos: Os, path: ut, fullPath: _s, head: Ls, at: Fs, var: rn, this: Ps, string: be("StringLiteral"), boolean: be("BooleanLiteral"), number: be("NumberLiteral"), undefined() {
|
|
2035
|
+
return Yt("UndefinedLiteral", void 0);
|
|
2036
|
+
}, null() {
|
|
2037
|
+
return Yt("NullLiteral", null);
|
|
2038
|
+
} };
|
|
2039
|
+
function be(t) {
|
|
2040
|
+
return function(e, r) {
|
|
2041
|
+
return Yt(t, e, r);
|
|
2042
|
+
};
|
|
2043
|
+
}
|
|
2044
|
+
function Vs({ path: t, params: e, hash: r, trusting: n, strip: a, loc: s }) {
|
|
2045
|
+
let u = { type: "MustacheStatement", path: t, params: e, hash: r, trusting: n, strip: a, loc: s };
|
|
2046
|
+
return Object.defineProperty(u, "escaped", { enumerable: !1, get() {
|
|
2047
|
+
return M("The escaped property on mustache nodes is deprecated, use trusting instead"), !this.trusting;
|
|
2048
|
+
}, set(i) {
|
|
2049
|
+
M("The escaped property on mustache nodes is deprecated, use trusting instead"), this.trusting = !i;
|
|
2050
|
+
} }), u;
|
|
2051
|
+
}
|
|
2052
|
+
function Rs({ head: t, tail: e, loc: r }) {
|
|
2053
|
+
let n = { type: "PathExpression", head: t, tail: e, get original() {
|
|
2054
|
+
return [this.head.original, ...this.tail].join(".");
|
|
2055
|
+
}, set original(a) {
|
|
2056
|
+
let [s, ...u] = _t(a.split("."));
|
|
2057
|
+
this.head = $s.head(s, this.head.loc), this.tail = u;
|
|
2058
|
+
}, loc: r };
|
|
2059
|
+
return Object.defineProperty(n, "parts", { enumerable: !1, get() {
|
|
2060
|
+
M("The parts property on path nodes is deprecated, use head and tail instead");
|
|
2061
|
+
let a = _t(this.original.split("."));
|
|
2062
|
+
return a[0] === "this" ? a.shift() : a[0].startsWith("@") && (a[0] = a[0].slice(1)), Object.freeze(a);
|
|
2063
|
+
}, set(a) {
|
|
2064
|
+
var s;
|
|
2065
|
+
M("The parts property on mustache nodes is deprecated, use head and tail instead");
|
|
2066
|
+
let u = [...a];
|
|
2067
|
+
u[0] !== "this" && !((s = u[0]) != null && s.startsWith("@")) && (this.head.type === "ThisHead" ? u.unshift("this") : this.head.type === "AtHead" && (u[0] = `@${u[0]}`)), this.original = u.join(".");
|
|
2068
|
+
} }), Object.defineProperty(n, "this", { enumerable: !1, get() {
|
|
2069
|
+
return M("The this property on path nodes is deprecated, use head.type instead"), this.head.type === "ThisHead";
|
|
2070
|
+
} }), Object.defineProperty(n, "data", { enumerable: !1, get() {
|
|
2071
|
+
return M("The data property on path nodes is deprecated, use head.type instead"), this.head.type === "AtHead";
|
|
2072
|
+
} }), n;
|
|
2073
|
+
}
|
|
2074
|
+
function Us({ type: t, value: e, loc: r }) {
|
|
2075
|
+
let n = { type: t, value: e, loc: r };
|
|
2076
|
+
return Object.defineProperty(n, "original", { enumerable: !1, get() {
|
|
2077
|
+
return M("The original property on literal nodes is deprecated, use value instead"), this.value;
|
|
2078
|
+
}, set(a) {
|
|
2079
|
+
M("The original property on literal nodes is deprecated, use value instead"), this.value = a;
|
|
2080
|
+
} }), n;
|
|
2081
|
+
}
|
|
2082
|
+
var Gt = { close: !1, open: !1 }, Hs = class {
|
|
2083
|
+
pos({ line: t, column: e }) {
|
|
2084
|
+
return { line: t, column: e };
|
|
2085
|
+
}
|
|
2086
|
+
blockItself({ body: t, params: e, chained: r = !1, loc: n }) {
|
|
2087
|
+
return { type: "Block", body: t, params: e, get blockParams() {
|
|
2088
|
+
return this.params.map((a) => a.name);
|
|
2089
|
+
}, set blockParams(a) {
|
|
2090
|
+
this.params = a.map((s) => f.var({ name: s, loc: I.synthetic(s) }));
|
|
2091
|
+
}, chained: r, loc: n };
|
|
2092
|
+
}
|
|
2093
|
+
template({ body: t, blockParams: e, loc: r }) {
|
|
2094
|
+
return { type: "Template", body: t, blockParams: e, loc: r };
|
|
2095
|
+
}
|
|
2096
|
+
mustache({ path: t, params: e, hash: r, trusting: n, loc: a, strip: s = Gt }) {
|
|
2097
|
+
return Vs({ path: t, params: e, hash: r, trusting: n, strip: s, loc: a });
|
|
2098
|
+
}
|
|
2099
|
+
block({ path: t, params: e, hash: r, defaultBlock: n, elseBlock: a = null, loc: s, openStrip: u = Gt, inverseStrip: i = Gt, closeStrip: l = Gt }) {
|
|
2100
|
+
return { type: "BlockStatement", path: t, params: e, hash: r, program: n, inverse: a, loc: s, openStrip: u, inverseStrip: i, closeStrip: l };
|
|
2101
|
+
}
|
|
2102
|
+
comment({ value: t, loc: e }) {
|
|
2103
|
+
return { type: "CommentStatement", value: t, loc: e };
|
|
2104
|
+
}
|
|
2105
|
+
mustacheComment({ value: t, loc: e }) {
|
|
2106
|
+
return { type: "MustacheCommentStatement", value: t, loc: e };
|
|
2107
|
+
}
|
|
2108
|
+
concat({ parts: t, loc: e }) {
|
|
2109
|
+
return { type: "ConcatStatement", parts: t, loc: e };
|
|
2110
|
+
}
|
|
2111
|
+
element({ path: t, selfClosing: e, attributes: r, modifiers: n, params: a, comments: s, children: u, openTag: i, closeTag: l, loc: g }) {
|
|
2112
|
+
let h = e;
|
|
2113
|
+
return { type: "ElementNode", path: t, attributes: r, modifiers: n, params: a, comments: s, children: u, openTag: i, closeTag: l, loc: g, get tag() {
|
|
2114
|
+
return this.path.original;
|
|
2115
|
+
}, set tag(m) {
|
|
2116
|
+
this.path.original = m;
|
|
2117
|
+
}, get blockParams() {
|
|
2118
|
+
return this.params.map((m) => m.name);
|
|
2119
|
+
}, set blockParams(m) {
|
|
2120
|
+
this.params = m.map((A) => f.var({ name: A, loc: I.synthetic(A) }));
|
|
2121
|
+
}, get selfClosing() {
|
|
2122
|
+
return h;
|
|
2123
|
+
}, set selfClosing(m) {
|
|
2124
|
+
h = m, m ? this.closeTag = null : this.closeTag = I.synthetic(`</${this.tag}>`);
|
|
2125
|
+
} };
|
|
2126
|
+
}
|
|
2127
|
+
elementModifier({ path: t, params: e, hash: r, loc: n }) {
|
|
2128
|
+
return { type: "ElementModifierStatement", path: t, params: e, hash: r, loc: n };
|
|
2129
|
+
}
|
|
2130
|
+
attr({ name: t, value: e, loc: r }) {
|
|
2131
|
+
return { type: "AttrNode", name: t, value: e, loc: r };
|
|
2132
|
+
}
|
|
2133
|
+
text({ chars: t, loc: e }) {
|
|
2134
|
+
return { type: "TextNode", chars: t, loc: e };
|
|
2135
|
+
}
|
|
2136
|
+
sexpr({ path: t, params: e, hash: r, loc: n }) {
|
|
2137
|
+
return { type: "SubExpression", path: t, params: e, hash: r, loc: n };
|
|
2138
|
+
}
|
|
2139
|
+
path({ head: t, tail: e, loc: r }) {
|
|
2140
|
+
return Rs({ head: t, tail: e, loc: r });
|
|
2141
|
+
}
|
|
2142
|
+
head({ original: t, loc: e }) {
|
|
2143
|
+
return t === "this" ? this.this({ loc: e }) : t[0] === "@" ? this.atName({ name: t, loc: e }) : this.var({ name: t, loc: e });
|
|
2144
|
+
}
|
|
2145
|
+
this({ loc: t }) {
|
|
2146
|
+
return { type: "ThisHead", get original() {
|
|
2147
|
+
return "this";
|
|
2148
|
+
}, loc: t };
|
|
2149
|
+
}
|
|
2150
|
+
atName({ name: t, loc: e }) {
|
|
2151
|
+
let r = "", n = { type: "AtHead", get name() {
|
|
2152
|
+
return r;
|
|
2153
|
+
}, set name(a) {
|
|
2154
|
+
S(a[0] === "@", "call builders.at() with a string that starts with '@'"), S(a.indexOf(".") === -1, "builder.at() should not be called with a name with dots in it"), r = a;
|
|
2155
|
+
}, get original() {
|
|
2156
|
+
return this.name;
|
|
2157
|
+
}, set original(a) {
|
|
2158
|
+
this.name = a;
|
|
2159
|
+
}, loc: e };
|
|
2160
|
+
return n.name = t, n;
|
|
2161
|
+
}
|
|
2162
|
+
var({ name: t, loc: e }) {
|
|
2163
|
+
let r = "", n = { type: "VarHead", get name() {
|
|
2164
|
+
return r;
|
|
2165
|
+
}, set name(a) {
|
|
2166
|
+
S(a !== "this", "You called builders.var() with 'this'. Call builders.this instead"), S(a[0] !== "@", `You called builders.var() with '${t}'. Call builders.at('${t}') instead`), S(a.indexOf(".") === -1, "builder.var() should not be called with a name with dots in it"), r = a;
|
|
2167
|
+
}, get original() {
|
|
2168
|
+
return this.name;
|
|
2169
|
+
}, set original(a) {
|
|
2170
|
+
this.name = a;
|
|
2171
|
+
}, loc: e };
|
|
2172
|
+
return n.name = t, n;
|
|
2173
|
+
}
|
|
2174
|
+
hash({ pairs: t, loc: e }) {
|
|
2175
|
+
return { type: "Hash", pairs: t, loc: e };
|
|
2176
|
+
}
|
|
2177
|
+
pair({ key: t, value: e, loc: r }) {
|
|
2178
|
+
return { type: "HashPair", key: t, value: e, loc: r };
|
|
2179
|
+
}
|
|
2180
|
+
literal({ type: t, value: e, loc: r }) {
|
|
2181
|
+
return Us({ type: t, value: e, loc: r });
|
|
2182
|
+
}
|
|
2183
|
+
}, f = new Hs(), Ms = class {
|
|
2184
|
+
constructor(t, e = new Qr(Ga), r = "precompile") {
|
|
2185
|
+
w(this, "elementStack", []);
|
|
2186
|
+
w(this, "lines");
|
|
2187
|
+
w(this, "source");
|
|
2188
|
+
w(this, "currentAttribute", null);
|
|
2189
|
+
w(this, "currentNode", null);
|
|
2190
|
+
w(this, "tokenizer");
|
|
2191
|
+
this.source = t, this.lines = t.source.split(/\r\n?|\n/u), this.tokenizer = new ts(this, e, r);
|
|
2192
|
+
}
|
|
2193
|
+
offset() {
|
|
2194
|
+
let { line: t, column: e } = this.tokenizer;
|
|
2195
|
+
return this.source.offsetFor(t, e);
|
|
2196
|
+
}
|
|
2197
|
+
pos({ line: t, column: e }) {
|
|
2198
|
+
return this.source.offsetFor(t, e);
|
|
2199
|
+
}
|
|
2200
|
+
finish(t) {
|
|
2201
|
+
return Gr({}, t, { loc: t.start.until(this.offset()) });
|
|
2202
|
+
}
|
|
2203
|
+
get currentAttr() {
|
|
2204
|
+
return Sa(this.currentAttribute, "expected attribute");
|
|
2205
|
+
}
|
|
2206
|
+
get currentTag() {
|
|
2207
|
+
let t = this.currentNode;
|
|
2208
|
+
return S(t && (t.type === "StartTag" || t.type === "EndTag"), "expected tag"), t;
|
|
2209
|
+
}
|
|
2210
|
+
get currentStartTag() {
|
|
2211
|
+
let t = this.currentNode;
|
|
2212
|
+
return S(t && t.type === "StartTag", "expected start tag"), t;
|
|
2213
|
+
}
|
|
2214
|
+
get currentEndTag() {
|
|
2215
|
+
let t = this.currentNode;
|
|
2216
|
+
return S(t && t.type === "EndTag", "expected end tag"), t;
|
|
2217
|
+
}
|
|
2218
|
+
get currentComment() {
|
|
2219
|
+
let t = this.currentNode;
|
|
2220
|
+
return S(t && t.type === "CommentStatement", "expected a comment"), t;
|
|
2221
|
+
}
|
|
2222
|
+
get currentData() {
|
|
2223
|
+
let t = this.currentNode;
|
|
2224
|
+
return S(t && t.type === "TextNode", "expected a text node"), t;
|
|
2225
|
+
}
|
|
2226
|
+
acceptNode(t) {
|
|
2227
|
+
return this[t.type](t);
|
|
2228
|
+
}
|
|
2229
|
+
currentElement() {
|
|
2230
|
+
return He(_t(this.elementStack));
|
|
2231
|
+
}
|
|
2232
|
+
sourceForNode(t, e) {
|
|
2233
|
+
let r = t.loc.start.line - 1, n = r - 1, a = t.loc.start.column, s = [], u, i, l;
|
|
2234
|
+
for (e ? (i = e.loc.end.line - 1, l = e.loc.end.column) : (i = t.loc.end.line - 1, l = t.loc.end.column); n < i; ) n++, u = Ue(this.lines[n]), n === r ? r === i ? s.push(u.slice(a, l)) : s.push(u.slice(a)) : n === i ? s.push(u.slice(0, l)) : s.push(u);
|
|
2235
|
+
return s.join(`
|
|
2236
|
+
`);
|
|
2237
|
+
}
|
|
2238
|
+
}, Ar = "beforeAttributeName", zs = "attributeValueUnquoted", js = class extends Ms {
|
|
2239
|
+
constructor() {
|
|
2240
|
+
super(...arguments);
|
|
2241
|
+
w(this, "pendingError", null);
|
|
2242
|
+
}
|
|
2243
|
+
parse(e, r) {
|
|
2244
|
+
var n;
|
|
2245
|
+
let a = f.template({ body: [], blockParams: r, loc: this.source.spanFor(e.loc) }), s = this.parseProgram(a, e);
|
|
2246
|
+
return (n = this.pendingError) == null || n.eof(s.loc.getEnd()), s;
|
|
2247
|
+
}
|
|
2248
|
+
Program(e, r) {
|
|
2249
|
+
S(Array.isArray(r), "[BUG] Program in parser unexpectedly called without block params");
|
|
2250
|
+
let n = f.blockItself({ body: [], params: r, chained: e.chained, loc: this.source.spanFor(e.loc) });
|
|
2251
|
+
return this.parseProgram(n, e);
|
|
2252
|
+
}
|
|
2253
|
+
parseProgram(e, r) {
|
|
2254
|
+
if (r.body.length === 0) return e;
|
|
2255
|
+
let n;
|
|
2256
|
+
try {
|
|
2257
|
+
this.elementStack.push(e);
|
|
2258
|
+
for (let a of r.body) this.acceptNode(a);
|
|
2259
|
+
} finally {
|
|
2260
|
+
n = this.elementStack.pop();
|
|
2261
|
+
}
|
|
2262
|
+
if (e !== n) {
|
|
2263
|
+
if ((n == null ? void 0 : n.type) === "ElementNode") throw D(`Unclosed element \`${n.tag}\``, n.loc);
|
|
2264
|
+
S(n !== void 0, "[BUG] empty parser elementStack"), S(!1, `[BUG] mismatched parser elementStack node: ${e.type}`);
|
|
2265
|
+
}
|
|
2266
|
+
return e;
|
|
2267
|
+
}
|
|
2268
|
+
BlockStatement(e) {
|
|
2269
|
+
var r;
|
|
2270
|
+
if (this.tokenizer.state === "comment") {
|
|
2271
|
+
this.appendToCommentData(this.sourceForNode(e));
|
|
2272
|
+
return;
|
|
2273
|
+
}
|
|
2274
|
+
if (this.tokenizer.state !== "data" && this.tokenizer.state !== "beforeData") throw D("A block may only be used inside an HTML element or another block.", this.source.spanFor(e.loc));
|
|
2275
|
+
let { path: n, params: a, hash: s } = ye(this, e), u = this.source.spanFor(e.loc), i = [];
|
|
2276
|
+
if ((r = e.program.blockParams) != null && r.length) {
|
|
2277
|
+
let A = s.loc.collapse("end");
|
|
2278
|
+
e.program.loc ? A = A.withEnd(this.source.spanFor(e.program.loc).getStart()) : e.program.body[0] ? A = A.withEnd(this.source.spanFor(e.program.body[0].loc).getStart()) : A = A.withEnd(u.getEnd());
|
|
2279
|
+
let y = A.asString(), C = y.indexOf("|") + 1, T = y.indexOf("|", C);
|
|
2280
|
+
for (let x of e.program.blockParams) {
|
|
2281
|
+
let B, U;
|
|
2282
|
+
C >= T ? B = -1 : B = y.indexOf(x, C), B === -1 || B + x.length > T ? (C = T, U = this.source.spanFor(Pt)) : (C = B, U = A.sliceStartChars({ skipStart: C, chars: x.length }), C += x.length), i.push(f.var({ name: x, loc: U }));
|
|
2283
|
+
}
|
|
2284
|
+
}
|
|
2285
|
+
e.program.loc || (e.program.loc = Pt), e.inverse && !e.inverse.loc && (e.inverse.loc = Pt);
|
|
2286
|
+
let l = this.Program(e.program, i), g = e.inverse ? this.Program(e.inverse, []) : null, h = f.block({ path: n, params: a, hash: s, defaultBlock: l, elseBlock: g, loc: this.source.spanFor(e.loc), openStrip: e.openStrip, inverseStrip: e.inverseStrip, closeStrip: e.closeStrip }), m = this.currentElement();
|
|
2287
|
+
vt(m, h);
|
|
2288
|
+
}
|
|
2289
|
+
MustacheStatement(e) {
|
|
2290
|
+
var r;
|
|
2291
|
+
(r = this.pendingError) == null || r.mustache(this.source.spanFor(e.loc));
|
|
2292
|
+
let { tokenizer: n } = this;
|
|
2293
|
+
if (n.state === "comment") {
|
|
2294
|
+
this.appendToCommentData(this.sourceForNode(e));
|
|
2295
|
+
return;
|
|
2296
|
+
}
|
|
2297
|
+
let a, { escaped: s, loc: u, strip: i } = e;
|
|
2298
|
+
if ("original" in e.path && e.path.original === "...attributes") throw D("Illegal use of ...attributes", this.source.spanFor(e.loc));
|
|
2299
|
+
if (en(e.path)) a = f.mustache({ path: this.acceptNode(e.path), params: [], hash: f.hash({ pairs: [], loc: this.source.spanFor(e.path.loc).collapse("end") }), trusting: !s, loc: this.source.spanFor(u), strip: i });
|
|
2300
|
+
else {
|
|
2301
|
+
let { path: l, params: g, hash: h } = ye(this, e);
|
|
2302
|
+
a = f.mustache({ path: l, params: g, hash: h, trusting: !s, loc: this.source.spanFor(u), strip: i });
|
|
2303
|
+
}
|
|
2304
|
+
switch (n.state) {
|
|
2305
|
+
case "tagOpen":
|
|
2306
|
+
case "tagName":
|
|
2307
|
+
throw D("Cannot use mustaches in an elements tagname", a.loc);
|
|
2308
|
+
case "beforeAttributeName":
|
|
2309
|
+
Ae(this.currentStartTag, a);
|
|
2310
|
+
break;
|
|
2311
|
+
case "attributeName":
|
|
2312
|
+
case "afterAttributeName":
|
|
2313
|
+
this.beginAttributeValue(!1), this.finishAttributeValue(), Ae(this.currentStartTag, a), n.transitionTo(Ar);
|
|
2314
|
+
break;
|
|
2315
|
+
case "afterAttributeValueQuoted":
|
|
2316
|
+
Ae(this.currentStartTag, a), n.transitionTo(Ar);
|
|
2317
|
+
break;
|
|
2318
|
+
case "beforeAttributeValue":
|
|
2319
|
+
this.beginAttributeValue(!1), this.appendDynamicAttributeValuePart(a), n.transitionTo(zs);
|
|
2320
|
+
break;
|
|
2321
|
+
case "attributeValueDoubleQuoted":
|
|
2322
|
+
case "attributeValueSingleQuoted":
|
|
2323
|
+
case "attributeValueUnquoted":
|
|
2324
|
+
this.appendDynamicAttributeValuePart(a);
|
|
2325
|
+
break;
|
|
2326
|
+
default:
|
|
2327
|
+
vt(this.currentElement(), a);
|
|
2328
|
+
}
|
|
2329
|
+
return a;
|
|
2330
|
+
}
|
|
2331
|
+
appendDynamicAttributeValuePart(e) {
|
|
2332
|
+
this.finalizeTextPart();
|
|
2333
|
+
let r = this.currentAttr;
|
|
2334
|
+
r.isDynamic = !0, r.parts.push(e);
|
|
2335
|
+
}
|
|
2336
|
+
finalizeTextPart() {
|
|
2337
|
+
let e = this.currentAttr.currentPart;
|
|
2338
|
+
e !== null && (this.currentAttr.parts.push(e), this.startTextPart());
|
|
2339
|
+
}
|
|
2340
|
+
startTextPart() {
|
|
2341
|
+
this.currentAttr.currentPart = null;
|
|
2342
|
+
}
|
|
2343
|
+
ContentStatement(e) {
|
|
2344
|
+
Ws(this.tokenizer, e), this.tokenizer.tokenizePart(e.value), this.tokenizer.flushData();
|
|
2345
|
+
}
|
|
2346
|
+
CommentStatement(e) {
|
|
2347
|
+
let { tokenizer: r } = this;
|
|
2348
|
+
if (r.state === "comment") return this.appendToCommentData(this.sourceForNode(e)), null;
|
|
2349
|
+
let { value: n, loc: a } = e, s = f.mustacheComment({ value: n, loc: this.source.spanFor(a) });
|
|
2350
|
+
switch (r.state) {
|
|
2351
|
+
case "beforeAttributeName":
|
|
2352
|
+
case "afterAttributeName":
|
|
2353
|
+
this.currentStartTag.comments.push(s);
|
|
2354
|
+
break;
|
|
2355
|
+
case "beforeData":
|
|
2356
|
+
case "data":
|
|
2357
|
+
vt(this.currentElement(), s);
|
|
2358
|
+
break;
|
|
2359
|
+
default:
|
|
2360
|
+
throw D(`Using a Handlebars comment when in the \`${r.state}\` state is not supported`, this.source.spanFor(e.loc));
|
|
2361
|
+
}
|
|
2362
|
+
return s;
|
|
2363
|
+
}
|
|
2364
|
+
PartialStatement(e) {
|
|
2365
|
+
throw D("Handlebars partials are not supported", this.source.spanFor(e.loc));
|
|
2366
|
+
}
|
|
2367
|
+
PartialBlockStatement(e) {
|
|
2368
|
+
throw D("Handlebars partial blocks are not supported", this.source.spanFor(e.loc));
|
|
2369
|
+
}
|
|
2370
|
+
Decorator(e) {
|
|
2371
|
+
throw D("Handlebars decorators are not supported", this.source.spanFor(e.loc));
|
|
2372
|
+
}
|
|
2373
|
+
DecoratorBlock(e) {
|
|
2374
|
+
throw D("Handlebars decorator blocks are not supported", this.source.spanFor(e.loc));
|
|
2375
|
+
}
|
|
2376
|
+
SubExpression(e) {
|
|
2377
|
+
let { path: r, params: n, hash: a } = ye(this, e);
|
|
2378
|
+
return f.sexpr({ path: r, params: n, hash: a, loc: this.source.spanFor(e.loc) });
|
|
2379
|
+
}
|
|
2380
|
+
PathExpression(e) {
|
|
2381
|
+
let { original: r } = e, n;
|
|
2382
|
+
if (r.indexOf("/") !== -1) {
|
|
2383
|
+
if (r.slice(0, 2) === "./") throw D('Using "./" is not supported in Glimmer and unnecessary', this.source.spanFor(e.loc));
|
|
2384
|
+
if (r.slice(0, 3) === "../") throw D('Changing context using "../" is not supported in Glimmer', this.source.spanFor(e.loc));
|
|
2385
|
+
if (r.indexOf(".") !== -1) throw D("Mixing '.' and '/' in paths is not supported in Glimmer; use only '.' to separate property paths", this.source.spanFor(e.loc));
|
|
2386
|
+
n = [e.parts.join("/")];
|
|
2387
|
+
} else {
|
|
2388
|
+
if (r === ".") throw D("'.' is not a supported path in Glimmer; check for a path with a trailing '.'", this.source.spanFor(e.loc));
|
|
2389
|
+
n = e.parts;
|
|
2390
|
+
}
|
|
2391
|
+
let a = !1;
|
|
2392
|
+
/^this(?:\..+)?$/u.test(r) && (a = !0);
|
|
2393
|
+
let s;
|
|
2394
|
+
if (a) s = f.this({ loc: this.source.spanFor({ start: e.loc.start, end: { line: e.loc.start.line, column: e.loc.start.column + 4 } }) });
|
|
2395
|
+
else if (e.data) {
|
|
2396
|
+
let u = n.shift();
|
|
2397
|
+
if (u === void 0) throw D("Attempted to parse a path expression, but it was not valid. Paths beginning with @ must start with a-z.", this.source.spanFor(e.loc));
|
|
2398
|
+
s = f.atName({ name: `@${u}`, loc: this.source.spanFor({ start: e.loc.start, end: { line: e.loc.start.line, column: e.loc.start.column + u.length + 1 } }) });
|
|
2399
|
+
} else {
|
|
2400
|
+
let u = n.shift();
|
|
2401
|
+
if (u === void 0) throw D("Attempted to parse a path expression, but it was not valid. Paths must start with a-z or A-Z.", this.source.spanFor(e.loc));
|
|
2402
|
+
s = f.var({ name: u, loc: this.source.spanFor({ start: e.loc.start, end: { line: e.loc.start.line, column: e.loc.start.column + u.length } }) });
|
|
2403
|
+
}
|
|
2404
|
+
return f.path({ head: s, tail: n, loc: this.source.spanFor(e.loc) });
|
|
2405
|
+
}
|
|
2406
|
+
Hash(e) {
|
|
2407
|
+
let r = e.pairs.map((n) => f.pair({ key: n.key, value: this.acceptNode(n.value), loc: this.source.spanFor(n.loc) }));
|
|
2408
|
+
return f.hash({ pairs: r, loc: this.source.spanFor(e.loc) });
|
|
2409
|
+
}
|
|
2410
|
+
StringLiteral(e) {
|
|
2411
|
+
return f.literal({ type: "StringLiteral", value: e.value, loc: this.source.spanFor(e.loc) });
|
|
2412
|
+
}
|
|
2413
|
+
BooleanLiteral(e) {
|
|
2414
|
+
return f.literal({ type: "BooleanLiteral", value: e.value, loc: this.source.spanFor(e.loc) });
|
|
2415
|
+
}
|
|
2416
|
+
NumberLiteral(e) {
|
|
2417
|
+
return f.literal({ type: "NumberLiteral", value: e.value, loc: this.source.spanFor(e.loc) });
|
|
2418
|
+
}
|
|
2419
|
+
UndefinedLiteral(e) {
|
|
2420
|
+
return f.literal({ type: "UndefinedLiteral", value: void 0, loc: this.source.spanFor(e.loc) });
|
|
2421
|
+
}
|
|
2422
|
+
NullLiteral(e) {
|
|
2423
|
+
return f.literal({ type: "NullLiteral", value: null, loc: this.source.spanFor(e.loc) });
|
|
2424
|
+
}
|
|
2425
|
+
};
|
|
2426
|
+
function Gs(t, e) {
|
|
2427
|
+
if (e === "") return { lines: t.split(`
|
|
2428
|
+
`).length - 1, columns: 0 };
|
|
2429
|
+
let [r] = t.split(e), n = r.split(/\n/u), a = n.length - 1;
|
|
2430
|
+
return { lines: a, columns: Ue(n[a]).length };
|
|
2431
|
+
}
|
|
2432
|
+
function Ws(t, e) {
|
|
2433
|
+
let r = e.loc.start.line, n = e.loc.start.column, a = Gs(e.original, e.value);
|
|
2434
|
+
r = r + a.lines, a.lines ? n = a.columns : n = n + a.columns, t.line = r, t.column = n;
|
|
2435
|
+
}
|
|
2436
|
+
function ye(t, e) {
|
|
2437
|
+
let r;
|
|
2438
|
+
switch (e.path.type) {
|
|
2439
|
+
case "PathExpression":
|
|
2440
|
+
r = t.PathExpression(e.path);
|
|
2441
|
+
break;
|
|
2442
|
+
case "SubExpression":
|
|
2443
|
+
r = t.SubExpression(e.path);
|
|
2444
|
+
break;
|
|
2445
|
+
case "StringLiteral":
|
|
2446
|
+
case "UndefinedLiteral":
|
|
2447
|
+
case "NullLiteral":
|
|
2448
|
+
case "NumberLiteral":
|
|
2449
|
+
case "BooleanLiteral": {
|
|
2450
|
+
let u;
|
|
2451
|
+
throw e.path.type === "BooleanLiteral" ? u = e.path.original.toString() : e.path.type === "StringLiteral" ? u = `"${e.path.original}"` : e.path.type === "NullLiteral" ? u = "null" : e.path.type === "NumberLiteral" ? u = e.path.value.toString() : u = "undefined", D(`${e.path.type} "${e.path.type === "StringLiteral" ? e.path.original : u}" cannot be called as a sub-expression, replace (${u}) with ${u}`, t.source.spanFor(e.path.loc));
|
|
2452
|
+
}
|
|
2453
|
+
}
|
|
2454
|
+
let n = e.params ? e.params.map((u) => t.acceptNode(u)) : [], a = Bt(n) ? He(n).loc : r.loc, s = e.hash ? t.Hash(e.hash) : f.hash({ pairs: [], loc: t.source.spanFor(a).collapse("end") });
|
|
2455
|
+
return { path: r, params: n, hash: s };
|
|
2456
|
+
}
|
|
2457
|
+
function Ae(t, e) {
|
|
2458
|
+
let { path: r, params: n, hash: a, loc: s } = e;
|
|
2459
|
+
if (en(r)) {
|
|
2460
|
+
let i = `{{${As(r)}}}`, l = `<${t.name} ... ${i} ...`;
|
|
2461
|
+
throw D(`In ${l}, ${i} is not a valid modifier`, e.loc);
|
|
2462
|
+
}
|
|
2463
|
+
let u = f.elementModifier({ path: r, params: n, hash: a, loc: s });
|
|
2464
|
+
t.modifiers.push(u);
|
|
2465
|
+
}
|
|
2466
|
+
function yt(t) {
|
|
2467
|
+
return /[\t\n\f ]/u.test(t);
|
|
2468
|
+
}
|
|
2469
|
+
var Ks = class extends js {
|
|
2470
|
+
constructor() {
|
|
2471
|
+
super(...arguments);
|
|
2472
|
+
w(this, "tagOpenLine", 0);
|
|
2473
|
+
w(this, "tagOpenColumn", 0);
|
|
2474
|
+
}
|
|
2475
|
+
reset() {
|
|
2476
|
+
this.currentNode = null;
|
|
2477
|
+
}
|
|
2478
|
+
beginComment() {
|
|
2479
|
+
this.currentNode = { type: "CommentStatement", value: "", start: this.source.offsetFor(this.tagOpenLine, this.tagOpenColumn) };
|
|
2480
|
+
}
|
|
2481
|
+
appendToCommentData(e) {
|
|
2482
|
+
this.currentComment.value += e;
|
|
2483
|
+
}
|
|
2484
|
+
finishComment() {
|
|
2485
|
+
vt(this.currentElement(), f.comment(this.finish(this.currentComment)));
|
|
2486
|
+
}
|
|
2487
|
+
beginData() {
|
|
2488
|
+
this.currentNode = { type: "TextNode", chars: "", start: this.offset() };
|
|
2489
|
+
}
|
|
2490
|
+
appendToData(e) {
|
|
2491
|
+
this.currentData.chars += e;
|
|
2492
|
+
}
|
|
2493
|
+
finishData() {
|
|
2494
|
+
vt(this.currentElement(), f.text(this.finish(this.currentData)));
|
|
2495
|
+
}
|
|
2496
|
+
tagOpen() {
|
|
2497
|
+
this.tagOpenLine = this.tokenizer.line, this.tagOpenColumn = this.tokenizer.column;
|
|
2498
|
+
}
|
|
2499
|
+
beginStartTag() {
|
|
2500
|
+
this.currentNode = { type: "StartTag", name: "", nameStart: null, nameEnd: null, attributes: [], modifiers: [], comments: [], params: [], selfClosing: !1, start: this.source.offsetFor(this.tagOpenLine, this.tagOpenColumn) };
|
|
2501
|
+
}
|
|
2502
|
+
beginEndTag() {
|
|
2503
|
+
this.currentNode = { type: "EndTag", name: "", start: this.source.offsetFor(this.tagOpenLine, this.tagOpenColumn) };
|
|
2504
|
+
}
|
|
2505
|
+
finishTag() {
|
|
2506
|
+
let e = this.finish(this.currentTag);
|
|
2507
|
+
if (e.type === "StartTag") {
|
|
2508
|
+
if (this.finishStartTag(), e.name === ":") throw D("Invalid named block named detected, you may have created a named block without a name, or you may have began your name with a number. Named blocks must have names that are at least one character long, and begin with a lower case letter", this.source.spanFor({ start: this.currentTag.start.toJSON(), end: this.offset().toJSON() }));
|
|
2509
|
+
(Be.has(e.name) || e.selfClosing) && this.finishEndTag(!0);
|
|
2510
|
+
} else e.type === "EndTag" && this.finishEndTag(!1);
|
|
2511
|
+
}
|
|
2512
|
+
finishStartTag() {
|
|
2513
|
+
let { name: e, nameStart: r, nameEnd: n } = this.currentStartTag;
|
|
2514
|
+
S(e !== "", "tag name cannot be empty"), S(r !== null, "nameStart unexpectedly null"), S(n !== null, "nameEnd unexpectedly null");
|
|
2515
|
+
let a = r.until(n), [s, ...u] = _t(e.split(".")), i = f.path({ head: f.head({ original: s, loc: a.sliceStartChars({ chars: s.length }) }), tail: u, loc: a }), { attributes: l, modifiers: g, comments: h, params: m, selfClosing: A, loc: y } = this.finish(this.currentStartTag), C = f.element({ path: i, selfClosing: A, attributes: l, modifiers: g, comments: h, params: m, children: [], openTag: y, closeTag: A ? null : I.broken(), loc: y });
|
|
2516
|
+
this.elementStack.push(C);
|
|
2517
|
+
}
|
|
2518
|
+
finishEndTag(e) {
|
|
2519
|
+
let { start: r } = this.currentTag, n = this.finish(this.currentTag), a = this.elementStack.pop();
|
|
2520
|
+
this.validateEndTag(n, a, e);
|
|
2521
|
+
let s = this.currentElement();
|
|
2522
|
+
e ? a.closeTag = null : a.selfClosing ? S(a.closeTag === null, "element.closeTag unexpectedly present") : a.closeTag = r.until(this.offset()), a.loc = a.loc.withEnd(this.offset()), vt(s, f.element(a));
|
|
2523
|
+
}
|
|
2524
|
+
markTagAsSelfClosing() {
|
|
2525
|
+
let e = this.currentTag;
|
|
2526
|
+
if (e.type === "StartTag") e.selfClosing = !0;
|
|
2527
|
+
else throw D("Invalid end tag: closing tag must not be self-closing", this.source.spanFor({ start: e.start.toJSON(), end: this.offset().toJSON() }));
|
|
2528
|
+
}
|
|
2529
|
+
appendToTagName(e) {
|
|
2530
|
+
let r = this.currentTag;
|
|
2531
|
+
if (r.name += e, r.type === "StartTag") {
|
|
2532
|
+
let n = this.offset();
|
|
2533
|
+
r.nameStart === null && (S(r.nameEnd === null, "nameStart and nameEnd must both be null"), r.nameStart = n.move(-1)), r.nameEnd = n;
|
|
2534
|
+
}
|
|
2535
|
+
}
|
|
2536
|
+
beginAttribute() {
|
|
2537
|
+
let e = this.offset();
|
|
2538
|
+
this.currentAttribute = { name: "", parts: [], currentPart: null, isQuoted: !1, isDynamic: !1, start: e, valueSpan: e.collapsed() };
|
|
2539
|
+
}
|
|
2540
|
+
appendToAttributeName(e) {
|
|
2541
|
+
this.currentAttr.name += e, this.currentAttr.name === "as" && this.parsePossibleBlockParams();
|
|
2542
|
+
}
|
|
2543
|
+
beginAttributeValue(e) {
|
|
2544
|
+
this.currentAttr.isQuoted = e, this.startTextPart(), this.currentAttr.valueSpan = this.offset().collapsed();
|
|
2545
|
+
}
|
|
2546
|
+
appendToAttributeValue(e) {
|
|
2547
|
+
let r = this.currentAttr.parts, n = r[r.length - 1], a = this.currentAttr.currentPart;
|
|
2548
|
+
if (a) a.chars += e, a.loc = a.loc.withEnd(this.offset());
|
|
2549
|
+
else {
|
|
2550
|
+
let s = this.offset();
|
|
2551
|
+
e === `
|
|
2552
|
+
` ? s = n ? n.loc.getEnd() : this.currentAttr.valueSpan.getStart() : s = s.move(-1), this.currentAttr.currentPart = f.text({ chars: e, loc: s.collapsed() });
|
|
2553
|
+
}
|
|
2554
|
+
}
|
|
2555
|
+
finishAttributeValue() {
|
|
2556
|
+
this.finalizeTextPart();
|
|
2557
|
+
let e = this.currentTag, r = this.offset();
|
|
2558
|
+
if (e.type === "EndTag") throw D("Invalid end tag: closing tag must not have attributes", this.source.spanFor({ start: e.start.toJSON(), end: r.toJSON() }));
|
|
2559
|
+
let { name: n, parts: a, start: s, isQuoted: u, isDynamic: i, valueSpan: l } = this.currentAttr;
|
|
2560
|
+
if (n.startsWith("|") && a.length === 0 && !u && !i) throw D("Invalid block parameters syntax: block parameters must be preceded by the `as` keyword", s.until(s.move(n.length)));
|
|
2561
|
+
let g = this.assembleAttributeValue(a, u, i, s.until(r));
|
|
2562
|
+
g.loc = l.withEnd(r);
|
|
2563
|
+
let h = f.attr({ name: n, value: g, loc: s.until(r) });
|
|
2564
|
+
this.currentStartTag.attributes.push(h);
|
|
2565
|
+
}
|
|
2566
|
+
parsePossibleBlockParams() {
|
|
2567
|
+
let e = "beforeAttributeName", r = "attributeName", n = "afterAttributeName", a = /[!"#%&'()*+./;<=>@[\\\]^`{|}~]/u;
|
|
2568
|
+
S(this.tokenizer.state === r, "must be in TokenizerState.attributeName");
|
|
2569
|
+
let s = this.currentStartTag, u = this.currentAttr, i = { state: "PossibleAs" }, l = { PossibleAs: (h) => {
|
|
2570
|
+
if (S(i.state === "PossibleAs", "bug in block params parser"), yt(h)) i = { state: "BeforeStartPipe" }, this.tokenizer.transitionTo(n), this.tokenizer.consume();
|
|
2571
|
+
else {
|
|
2572
|
+
if (h === "|") throw D('Invalid block parameters syntax: expecting at least one space character between "as" and "|"', u.start.until(this.offset().move(1)));
|
|
2573
|
+
i = { state: "Done" };
|
|
2574
|
+
}
|
|
2575
|
+
}, BeforeStartPipe: (h) => {
|
|
2576
|
+
S(i.state === "BeforeStartPipe", "bug in block params parser"), yt(h) ? this.tokenizer.consume() : h === "|" ? (i = { state: "BeforeBlockParamName" }, this.tokenizer.transitionTo(e), this.tokenizer.consume()) : i = { state: "Done" };
|
|
2577
|
+
}, BeforeBlockParamName: (h) => {
|
|
2578
|
+
if (S(i.state === "BeforeBlockParamName", "bug in block params parser"), yt(h)) this.tokenizer.consume();
|
|
2579
|
+
else if (h === "") i = { state: "Done" }, this.pendingError = { mustache(m) {
|
|
2580
|
+
throw D("Invalid block parameters syntax: mustaches cannot be used inside parameters list", m);
|
|
2581
|
+
}, eof(m) {
|
|
2582
|
+
throw D('Invalid block parameters syntax: expecting the tag to be closed with ">" or "/>" after parameters list', u.start.until(m));
|
|
2583
|
+
} };
|
|
2584
|
+
else if (h === "|") {
|
|
2585
|
+
if (s.params.length === 0) throw D("Invalid block parameters syntax: empty parameters list, expecting at least one identifier", u.start.until(this.offset().move(1)));
|
|
2586
|
+
i = { state: "AfterEndPipe" }, this.tokenizer.consume();
|
|
2587
|
+
} else {
|
|
2588
|
+
if (h === ">" || h === "/") throw D('Invalid block parameters syntax: incomplete parameters list, expecting "|" but the tag was closed prematurely', u.start.until(this.offset().move(1)));
|
|
2589
|
+
i = { state: "BlockParamName", name: h, start: this.offset() }, this.tokenizer.consume();
|
|
2590
|
+
}
|
|
2591
|
+
}, BlockParamName: (h) => {
|
|
2592
|
+
if (S(i.state === "BlockParamName", "bug in block params parser"), h === "") i = { state: "Done" }, this.pendingError = { mustache(m) {
|
|
2593
|
+
throw D("Invalid block parameters syntax: mustaches cannot be used inside parameters list", m);
|
|
2594
|
+
}, eof(m) {
|
|
2595
|
+
throw D('Invalid block parameters syntax: expecting the tag to be closed with ">" or "/>" after parameters list', u.start.until(m));
|
|
2596
|
+
} };
|
|
2597
|
+
else if (h === "|" || yt(h)) {
|
|
2598
|
+
let m = i.start.until(this.offset());
|
|
2599
|
+
if (i.name === "this" || a.test(i.name)) throw D(`Invalid block parameters syntax: invalid identifier name \`${i.name}\``, m);
|
|
2600
|
+
s.params.push(f.var({ name: i.name, loc: m })), i = h === "|" ? { state: "AfterEndPipe" } : { state: "BeforeBlockParamName" }, this.tokenizer.consume();
|
|
2601
|
+
} else {
|
|
2602
|
+
if (h === ">" || h === "/") throw D('Invalid block parameters syntax: expecting "|" but the tag was closed prematurely', u.start.until(this.offset().move(1)));
|
|
2603
|
+
i.name += h, this.tokenizer.consume();
|
|
2604
|
+
}
|
|
2605
|
+
}, AfterEndPipe: (h) => {
|
|
2606
|
+
S(i.state === "AfterEndPipe", "bug in block params parser"), yt(h) ? this.tokenizer.consume() : h === "" ? (i = { state: "Done" }, this.pendingError = { mustache(m) {
|
|
2607
|
+
throw D("Invalid block parameters syntax: modifiers cannot follow parameters list", m);
|
|
2608
|
+
}, eof(m) {
|
|
2609
|
+
throw D('Invalid block parameters syntax: expecting the tag to be closed with ">" or "/>" after parameters list', u.start.until(m));
|
|
2610
|
+
} }) : h === ">" || h === "/" ? i = { state: "Done" } : (i = { state: "Error", message: 'Invalid block parameters syntax: expecting the tag to be closed with ">" or "/>" after parameters list', start: this.offset() }, this.tokenizer.consume());
|
|
2611
|
+
}, Error: (h) => {
|
|
2612
|
+
if (S(i.state === "Error", "bug in block params parser"), h === "" || h === "/" || h === ">" || yt(h)) throw D(i.message, i.start.until(this.offset()));
|
|
2613
|
+
this.tokenizer.consume();
|
|
2614
|
+
}, Done: () => {
|
|
2615
|
+
S(!1, "This should never be called");
|
|
2616
|
+
} }, g;
|
|
2617
|
+
do
|
|
2618
|
+
g = this.tokenizer.peek(), l[i.state](g);
|
|
2619
|
+
while (i.state !== "Done" && g !== "");
|
|
2620
|
+
S(i.state === "Done", "bug in block params parser");
|
|
2621
|
+
}
|
|
2622
|
+
reportSyntaxError(e) {
|
|
2623
|
+
throw D(e, this.offset().collapsed());
|
|
2624
|
+
}
|
|
2625
|
+
assembleConcatenatedValue(e) {
|
|
2626
|
+
for (let a of e) if (a.type !== "MustacheStatement" && a.type !== "TextNode") throw D(`Unsupported node in quoted attribute value: ${a.type}`, a.loc);
|
|
2627
|
+
ve(e, "the concatenation parts of an element should not be empty");
|
|
2628
|
+
let r = wa(e), n = He(e);
|
|
2629
|
+
return f.concat({ parts: e, loc: this.source.spanFor(r.loc).extend(this.source.spanFor(n.loc)) });
|
|
2630
|
+
}
|
|
2631
|
+
validateEndTag(e, r, n) {
|
|
2632
|
+
if (Be.has(e.name) && !n) throw D(`<${e.name}> elements do not need end tags. You should remove it`, e.loc);
|
|
2633
|
+
if (r.tag === void 0) throw D(`Closing tag </${e.name}> without an open tag`, e.loc);
|
|
2634
|
+
if (r.tag !== e.name) throw D(`Closing tag </${e.name}> did not match last open tag <${r.tag}> (on line ${r.loc.startPosition.line})`, e.loc);
|
|
2635
|
+
}
|
|
2636
|
+
assembleAttributeValue(e, r, n, a) {
|
|
2637
|
+
if (n) {
|
|
2638
|
+
if (r) return this.assembleConcatenatedValue(e);
|
|
2639
|
+
{
|
|
2640
|
+
ve(e);
|
|
2641
|
+
let [s, u] = e;
|
|
2642
|
+
if (u === void 0 || u.type === "TextNode" && u.chars === "/") return s;
|
|
2643
|
+
throw D("An unquoted attribute value must be a string or a mustache, preceded by whitespace or a '=' character, and followed by whitespace, a '>' character, or '/>'", a);
|
|
2644
|
+
}
|
|
2645
|
+
} else return Bt(e) ? e[0] : f.text({ chars: "", loc: a });
|
|
2646
|
+
}
|
|
2647
|
+
}, Qs = {}, Js = class extends Qr {
|
|
2648
|
+
constructor() {
|
|
2649
|
+
super({});
|
|
2650
|
+
}
|
|
2651
|
+
parse() {
|
|
2652
|
+
}
|
|
2653
|
+
};
|
|
2654
|
+
function Ys(t, e = {}) {
|
|
2655
|
+
var r, n, a;
|
|
2656
|
+
let s = e.mode || "precompile", u, i;
|
|
2657
|
+
typeof t == "string" ? (u = new Ft(t, (r = e.meta) == null ? void 0 : r.moduleName), s === "codemod" ? i = we(t, e.parseOptions) : i = dr(t, e.parseOptions)) : t instanceof Ft ? (u = t, s === "codemod" ? i = we(t.source, e.parseOptions) : i = dr(t.source, e.parseOptions)) : (u = new Ft("", (n = e.meta) == null ? void 0 : n.moduleName), i = t);
|
|
2658
|
+
let l;
|
|
2659
|
+
s === "codemod" && (l = new Js());
|
|
2660
|
+
let g = I.forCharPositions(u, 0, u.source.length);
|
|
2661
|
+
i.loc = { source: "(program)", start: g.startPosition, end: g.endPosition };
|
|
2662
|
+
let h = new Ks(u, l, s).parse(i, e.locals ?? []);
|
|
2663
|
+
if ((a = e == null ? void 0 : e.plugins) != null && a.ast) for (let m of e.plugins.ast) {
|
|
2664
|
+
let A = Gr({}, e, { syntax: Qs }, { plugins: void 0 }), y = m(A);
|
|
2665
|
+
bs(h, y.visitor);
|
|
2666
|
+
}
|
|
2667
|
+
return h;
|
|
2668
|
+
}
|
|
2669
|
+
(function(t) {
|
|
2670
|
+
return t.Helper = "Helper", t.Modifier = "Modifier", t.Component = "Component", t;
|
|
2671
|
+
})({});
|
|
2672
|
+
var Wt = `
|
|
2673
|
+
`, Dr = "\r", Xs = function() {
|
|
2674
|
+
function t(e) {
|
|
2675
|
+
this.length = e.length;
|
|
2676
|
+
for (var r = [0], n = 0; n < e.length; ) switch (e[n]) {
|
|
2677
|
+
case Wt:
|
|
2678
|
+
n += Wt.length, r.push(n);
|
|
2679
|
+
break;
|
|
2680
|
+
case Dr:
|
|
2681
|
+
n += Dr.length, e[n] === Wt && (n += Wt.length), r.push(n);
|
|
2682
|
+
break;
|
|
2683
|
+
default:
|
|
2684
|
+
n++;
|
|
2685
|
+
break;
|
|
2686
|
+
}
|
|
2687
|
+
this.offsets = r;
|
|
2688
|
+
}
|
|
2689
|
+
return t.prototype.locationForIndex = function(e) {
|
|
2690
|
+
if (e < 0 || e > this.length) return null;
|
|
2691
|
+
for (var r = 0, n = this.offsets; n[r + 1] <= e; ) r++;
|
|
2692
|
+
var a = e - n[r];
|
|
2693
|
+
return { line: r, column: a };
|
|
2694
|
+
}, t.prototype.indexForLocation = function(e) {
|
|
2695
|
+
var r = e.line, n = e.column;
|
|
2696
|
+
return r < 0 || r >= this.offsets.length || n < 0 || n > this.lengthOfLine(r) ? null : this.offsets[r] + n;
|
|
2697
|
+
}, t.prototype.lengthOfLine = function(e) {
|
|
2698
|
+
var r = this.offsets[e], n = e === this.offsets.length - 1 ? this.length : this.offsets[e + 1];
|
|
2699
|
+
return n - r;
|
|
2700
|
+
}, t;
|
|
2701
|
+
}();
|
|
2702
|
+
function Zs(t, e) {
|
|
2703
|
+
let r = new SyntaxError(t + " (" + e.loc.start.line + ":" + e.loc.start.column + ")");
|
|
2704
|
+
return Object.assign(r, e);
|
|
2705
|
+
}
|
|
2706
|
+
var tu = Zs;
|
|
2707
|
+
function eu(t) {
|
|
2708
|
+
let e = t.children ?? t.body;
|
|
2709
|
+
if (e) for (let r = 0; r < e.length - 1; r++) e[r].type === "TextNode" && e[r + 1].type === "MustacheStatement" && (e[r].chars = e[r].chars.replace(/\\$/u, "\\\\"));
|
|
2710
|
+
}
|
|
2711
|
+
function ru(t) {
|
|
2712
|
+
let e = new Xs(t), r = ({ line: a, column: s }) => e.indexForLocation({ line: a - 1, column: s }), n = (a) => {
|
|
2713
|
+
let { start: s, end: u } = a.loc;
|
|
2714
|
+
s.offset = r(s), u.offset = r(u);
|
|
2715
|
+
};
|
|
2716
|
+
return () => ({ name: "prettierParsePlugin", visitor: { All(a) {
|
|
2717
|
+
n(a), eu(a);
|
|
2718
|
+
} } });
|
|
2719
|
+
}
|
|
2720
|
+
function nu(t) {
|
|
2721
|
+
let e;
|
|
2722
|
+
try {
|
|
2723
|
+
e = Ys(t, { mode: "codemod", plugins: { ast: [ru(t)] } });
|
|
2724
|
+
} catch (r) {
|
|
2725
|
+
let n = su(r);
|
|
2726
|
+
if (n) {
|
|
2727
|
+
let a = au(r);
|
|
2728
|
+
throw tu(a, { loc: n, cause: r });
|
|
2729
|
+
}
|
|
2730
|
+
throw r;
|
|
2731
|
+
}
|
|
2732
|
+
return e;
|
|
2733
|
+
}
|
|
2734
|
+
function au(t) {
|
|
2735
|
+
let { message: e } = t, r = e.split(`
|
|
2736
|
+
`);
|
|
2737
|
+
return r.length >= 4 && /^Parse error on line \d+:$/u.test(r[0]) && /^-*\^$/u.test(Tt(!1, r, -2)) ? Tt(!1, r, -1) : r.length >= 4 && /:\s?$/u.test(r[0]) && /^\(error occurred in '.*?' @ line \d+ : column \d+\)$/u.test(Tt(!1, r, -1)) && r[1] === "" && Tt(!1, r, -2) === "" && r.slice(2, -2).every((n) => n.startsWith("|")) ? r[0].trim().slice(0, -1) : e;
|
|
2738
|
+
}
|
|
2739
|
+
function su(t) {
|
|
2740
|
+
let { location: e, hash: r } = t;
|
|
2741
|
+
if (e) {
|
|
2742
|
+
let { start: n, end: a } = e;
|
|
2743
|
+
return typeof a.line != "number" ? { start: n } : e;
|
|
2744
|
+
}
|
|
2745
|
+
if (r) {
|
|
2746
|
+
let { loc: { last_line: n, last_column: a } } = r;
|
|
2747
|
+
return { start: { line: n, column: a + 1 } };
|
|
2748
|
+
}
|
|
2749
|
+
}
|
|
2750
|
+
var uu = { parse: nu, astFormat: "glimmer", locStart: Lt, locEnd: Ee }, iu = { glimmer: va }, cu = Cr;
|
|
2751
|
+
export {
|
|
2752
|
+
cu as default,
|
|
2753
|
+
Ca as languages,
|
|
2754
|
+
jr as parsers,
|
|
2755
|
+
iu as printers
|
|
2756
|
+
};
|