@projectwallace/css-analyzer 5.15.0 → 6.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analyze-css.js +3636 -0
- package/dist/analyze-css.umd.cjs +7 -0
- package/dist/index.d.ts +892 -948
- package/package.json +15 -15
- package/readme.md +24 -70
- package/dist/analyzer.cjs +0 -2
- package/dist/analyzer.cjs.map +0 -1
- package/dist/analyzer.modern.js +0 -2
- package/dist/analyzer.modern.js.map +0 -1
- package/dist/analyzer.module.js +0 -2
- package/dist/analyzer.module.js.map +0 -1
- package/dist/analyzer.umd.js +0 -2
- package/dist/analyzer.umd.js.map +0 -1
|
@@ -0,0 +1,3636 @@
|
|
|
1
|
+
import oi from "css-tree/parser";
|
|
2
|
+
import pe from "css-tree/walker";
|
|
3
|
+
let De = null;
|
|
4
|
+
class H {
|
|
5
|
+
static createItem(e) {
|
|
6
|
+
return {
|
|
7
|
+
prev: null,
|
|
8
|
+
next: null,
|
|
9
|
+
data: e
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
constructor() {
|
|
13
|
+
this.head = null, this.tail = null, this.cursor = null;
|
|
14
|
+
}
|
|
15
|
+
createItem(e) {
|
|
16
|
+
return H.createItem(e);
|
|
17
|
+
}
|
|
18
|
+
// cursor helpers
|
|
19
|
+
allocateCursor(e, n) {
|
|
20
|
+
let r;
|
|
21
|
+
return De !== null ? (r = De, De = De.cursor, r.prev = e, r.next = n, r.cursor = this.cursor) : r = {
|
|
22
|
+
prev: e,
|
|
23
|
+
next: n,
|
|
24
|
+
cursor: this.cursor
|
|
25
|
+
}, this.cursor = r, r;
|
|
26
|
+
}
|
|
27
|
+
releaseCursor() {
|
|
28
|
+
const { cursor: e } = this;
|
|
29
|
+
this.cursor = e.cursor, e.prev = null, e.next = null, e.cursor = De, De = e;
|
|
30
|
+
}
|
|
31
|
+
updateCursors(e, n, r, i) {
|
|
32
|
+
let { cursor: o } = this;
|
|
33
|
+
for (; o !== null; )
|
|
34
|
+
o.prev === e && (o.prev = n), o.next === r && (o.next = i), o = o.cursor;
|
|
35
|
+
}
|
|
36
|
+
*[Symbol.iterator]() {
|
|
37
|
+
for (let e = this.head; e !== null; e = e.next)
|
|
38
|
+
yield e.data;
|
|
39
|
+
}
|
|
40
|
+
// getters
|
|
41
|
+
get size() {
|
|
42
|
+
let e = 0;
|
|
43
|
+
for (let n = this.head; n !== null; n = n.next)
|
|
44
|
+
e++;
|
|
45
|
+
return e;
|
|
46
|
+
}
|
|
47
|
+
get isEmpty() {
|
|
48
|
+
return this.head === null;
|
|
49
|
+
}
|
|
50
|
+
get first() {
|
|
51
|
+
return this.head && this.head.data;
|
|
52
|
+
}
|
|
53
|
+
get last() {
|
|
54
|
+
return this.tail && this.tail.data;
|
|
55
|
+
}
|
|
56
|
+
// convertors
|
|
57
|
+
fromArray(e) {
|
|
58
|
+
let n = null;
|
|
59
|
+
this.head = null;
|
|
60
|
+
for (let r of e) {
|
|
61
|
+
const i = H.createItem(r);
|
|
62
|
+
n !== null ? n.next = i : this.head = i, i.prev = n, n = i;
|
|
63
|
+
}
|
|
64
|
+
return this.tail = n, this;
|
|
65
|
+
}
|
|
66
|
+
toArray() {
|
|
67
|
+
return [...this];
|
|
68
|
+
}
|
|
69
|
+
toJSON() {
|
|
70
|
+
return [...this];
|
|
71
|
+
}
|
|
72
|
+
// array-like methods
|
|
73
|
+
forEach(e, n = this) {
|
|
74
|
+
const r = this.allocateCursor(null, this.head);
|
|
75
|
+
for (; r.next !== null; ) {
|
|
76
|
+
const i = r.next;
|
|
77
|
+
r.next = i.next, e.call(n, i.data, i, this);
|
|
78
|
+
}
|
|
79
|
+
this.releaseCursor();
|
|
80
|
+
}
|
|
81
|
+
forEachRight(e, n = this) {
|
|
82
|
+
const r = this.allocateCursor(this.tail, null);
|
|
83
|
+
for (; r.prev !== null; ) {
|
|
84
|
+
const i = r.prev;
|
|
85
|
+
r.prev = i.prev, e.call(n, i.data, i, this);
|
|
86
|
+
}
|
|
87
|
+
this.releaseCursor();
|
|
88
|
+
}
|
|
89
|
+
reduce(e, n, r = this) {
|
|
90
|
+
let i = this.allocateCursor(null, this.head), o = n, a;
|
|
91
|
+
for (; i.next !== null; )
|
|
92
|
+
a = i.next, i.next = a.next, o = e.call(r, o, a.data, a, this);
|
|
93
|
+
return this.releaseCursor(), o;
|
|
94
|
+
}
|
|
95
|
+
reduceRight(e, n, r = this) {
|
|
96
|
+
let i = this.allocateCursor(this.tail, null), o = n, a;
|
|
97
|
+
for (; i.prev !== null; )
|
|
98
|
+
a = i.prev, i.prev = a.prev, o = e.call(r, o, a.data, a, this);
|
|
99
|
+
return this.releaseCursor(), o;
|
|
100
|
+
}
|
|
101
|
+
some(e, n = this) {
|
|
102
|
+
for (let r = this.head; r !== null; r = r.next)
|
|
103
|
+
if (e.call(n, r.data, r, this))
|
|
104
|
+
return !0;
|
|
105
|
+
return !1;
|
|
106
|
+
}
|
|
107
|
+
map(e, n = this) {
|
|
108
|
+
const r = new H();
|
|
109
|
+
for (let i = this.head; i !== null; i = i.next)
|
|
110
|
+
r.appendData(e.call(n, i.data, i, this));
|
|
111
|
+
return r;
|
|
112
|
+
}
|
|
113
|
+
filter(e, n = this) {
|
|
114
|
+
const r = new H();
|
|
115
|
+
for (let i = this.head; i !== null; i = i.next)
|
|
116
|
+
e.call(n, i.data, i, this) && r.appendData(i.data);
|
|
117
|
+
return r;
|
|
118
|
+
}
|
|
119
|
+
nextUntil(e, n, r = this) {
|
|
120
|
+
if (e === null)
|
|
121
|
+
return;
|
|
122
|
+
const i = this.allocateCursor(null, e);
|
|
123
|
+
for (; i.next !== null; ) {
|
|
124
|
+
const o = i.next;
|
|
125
|
+
if (i.next = o.next, n.call(r, o.data, o, this))
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
this.releaseCursor();
|
|
129
|
+
}
|
|
130
|
+
prevUntil(e, n, r = this) {
|
|
131
|
+
if (e === null)
|
|
132
|
+
return;
|
|
133
|
+
const i = this.allocateCursor(e, null);
|
|
134
|
+
for (; i.prev !== null; ) {
|
|
135
|
+
const o = i.prev;
|
|
136
|
+
if (i.prev = o.prev, n.call(r, o.data, o, this))
|
|
137
|
+
break;
|
|
138
|
+
}
|
|
139
|
+
this.releaseCursor();
|
|
140
|
+
}
|
|
141
|
+
// mutation
|
|
142
|
+
clear() {
|
|
143
|
+
this.head = null, this.tail = null;
|
|
144
|
+
}
|
|
145
|
+
copy() {
|
|
146
|
+
const e = new H();
|
|
147
|
+
for (let n of this)
|
|
148
|
+
e.appendData(n);
|
|
149
|
+
return e;
|
|
150
|
+
}
|
|
151
|
+
prepend(e) {
|
|
152
|
+
return this.updateCursors(null, e, this.head, e), this.head !== null ? (this.head.prev = e, e.next = this.head) : this.tail = e, this.head = e, this;
|
|
153
|
+
}
|
|
154
|
+
prependData(e) {
|
|
155
|
+
return this.prepend(H.createItem(e));
|
|
156
|
+
}
|
|
157
|
+
append(e) {
|
|
158
|
+
return this.insert(e);
|
|
159
|
+
}
|
|
160
|
+
appendData(e) {
|
|
161
|
+
return this.insert(H.createItem(e));
|
|
162
|
+
}
|
|
163
|
+
insert(e, n = null) {
|
|
164
|
+
if (n !== null)
|
|
165
|
+
if (this.updateCursors(n.prev, e, n, e), n.prev === null) {
|
|
166
|
+
if (this.head !== n)
|
|
167
|
+
throw new Error("before doesn't belong to list");
|
|
168
|
+
this.head = e, n.prev = e, e.next = n, this.updateCursors(null, e);
|
|
169
|
+
} else
|
|
170
|
+
n.prev.next = e, e.prev = n.prev, n.prev = e, e.next = n;
|
|
171
|
+
else
|
|
172
|
+
this.updateCursors(this.tail, e, null, e), this.tail !== null ? (this.tail.next = e, e.prev = this.tail) : this.head = e, this.tail = e;
|
|
173
|
+
return this;
|
|
174
|
+
}
|
|
175
|
+
insertData(e, n) {
|
|
176
|
+
return this.insert(H.createItem(e), n);
|
|
177
|
+
}
|
|
178
|
+
remove(e) {
|
|
179
|
+
if (this.updateCursors(e, e.prev, e, e.next), e.prev !== null)
|
|
180
|
+
e.prev.next = e.next;
|
|
181
|
+
else {
|
|
182
|
+
if (this.head !== e)
|
|
183
|
+
throw new Error("item doesn't belong to list");
|
|
184
|
+
this.head = e.next;
|
|
185
|
+
}
|
|
186
|
+
if (e.next !== null)
|
|
187
|
+
e.next.prev = e.prev;
|
|
188
|
+
else {
|
|
189
|
+
if (this.tail !== e)
|
|
190
|
+
throw new Error("item doesn't belong to list");
|
|
191
|
+
this.tail = e.prev;
|
|
192
|
+
}
|
|
193
|
+
return e.prev = null, e.next = null, e;
|
|
194
|
+
}
|
|
195
|
+
push(e) {
|
|
196
|
+
this.insert(H.createItem(e));
|
|
197
|
+
}
|
|
198
|
+
pop() {
|
|
199
|
+
return this.tail !== null ? this.remove(this.tail) : null;
|
|
200
|
+
}
|
|
201
|
+
unshift(e) {
|
|
202
|
+
this.prepend(H.createItem(e));
|
|
203
|
+
}
|
|
204
|
+
shift() {
|
|
205
|
+
return this.head !== null ? this.remove(this.head) : null;
|
|
206
|
+
}
|
|
207
|
+
prependList(e) {
|
|
208
|
+
return this.insertList(e, this.head);
|
|
209
|
+
}
|
|
210
|
+
appendList(e) {
|
|
211
|
+
return this.insertList(e);
|
|
212
|
+
}
|
|
213
|
+
insertList(e, n) {
|
|
214
|
+
return e.head === null ? this : (n != null ? (this.updateCursors(n.prev, e.tail, n, e.head), n.prev !== null ? (n.prev.next = e.head, e.head.prev = n.prev) : this.head = e.head, n.prev = e.tail, e.tail.next = n) : (this.updateCursors(this.tail, e.tail, null, e.head), this.tail !== null ? (this.tail.next = e.head, e.head.prev = this.tail) : this.head = e.head, this.tail = e.tail), e.head = null, e.tail = null, this);
|
|
215
|
+
}
|
|
216
|
+
replace(e, n) {
|
|
217
|
+
"head" in n ? this.insertList(n, e) : this.insert(n, e), this.remove(e);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
function ai(t, e) {
|
|
221
|
+
const n = Object.create(SyntaxError.prototype), r = new Error();
|
|
222
|
+
return Object.assign(n, {
|
|
223
|
+
name: t,
|
|
224
|
+
message: e,
|
|
225
|
+
get stack() {
|
|
226
|
+
return (r.stack || "").replace(/^(.+\n){1,3}/, `${t}: ${e}
|
|
227
|
+
`);
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
const Gt = 100, nr = 60, rr = " ";
|
|
232
|
+
function ir({ source: t, line: e, column: n, baseLine: r, baseColumn: i }, o) {
|
|
233
|
+
function a(_, q) {
|
|
234
|
+
return s.slice(_, q).map(
|
|
235
|
+
(V, me) => String(_ + me + 1).padStart(y) + " |" + V
|
|
236
|
+
).join(`
|
|
237
|
+
`);
|
|
238
|
+
}
|
|
239
|
+
const f = `
|
|
240
|
+
`.repeat(Math.max(r - 1, 0)), c = " ".repeat(Math.max(i - 1, 0)), s = (f + c + t).split(/\r\n?|\n|\f/), l = Math.max(1, e - o) - 1, m = Math.min(e + o, s.length + 1), y = Math.max(4, String(m).length) + 1;
|
|
241
|
+
let C = 0;
|
|
242
|
+
n += (rr.length - 1) * (s[e - 1].substr(0, n - 1).match(/\t/g) || []).length, n > Gt && (C = n - nr + 3, n = nr - 2);
|
|
243
|
+
for (let _ = l; _ <= m; _++)
|
|
244
|
+
_ >= 0 && _ < s.length && (s[_] = s[_].replace(/\t/g, rr), s[_] = (C > 0 && s[_].length > C ? "…" : "") + s[_].substr(C, Gt - 2) + (s[_].length > C + Gt - 1 ? "…" : ""));
|
|
245
|
+
return [
|
|
246
|
+
a(l, e),
|
|
247
|
+
new Array(n + y + 2).join("-") + "^",
|
|
248
|
+
a(e, m)
|
|
249
|
+
].filter(Boolean).join(`
|
|
250
|
+
`).replace(/^(\s+\d+\s+\|\n)+/, "").replace(/\n(\s+\d+\s+\|)+$/, "");
|
|
251
|
+
}
|
|
252
|
+
function sr(t, e, n, r, i, o = 1, a = 1) {
|
|
253
|
+
return Object.assign(ai("SyntaxError", t), {
|
|
254
|
+
source: e,
|
|
255
|
+
offset: n,
|
|
256
|
+
line: r,
|
|
257
|
+
column: i,
|
|
258
|
+
sourceFragment(c) {
|
|
259
|
+
return ir({ source: e, line: r, column: i, baseLine: o, baseColumn: a }, isNaN(c) ? 0 : c);
|
|
260
|
+
},
|
|
261
|
+
get formattedMessage() {
|
|
262
|
+
return `Parse error: ${t}
|
|
263
|
+
` + ir({ source: e, line: r, column: i, baseLine: o, baseColumn: a }, 2);
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
const He = 0, k = 1, N = 2, U = 3, z = 4, Re = 5, li = 6, se = 7, oe = 8, $ = 9, E = 10, M = 11, I = 12, J = 13, Er = 14, ae = 15, ee = 16, Ct = 17, qe = 18, bt = 19, mt = 20, te = 21, O = 22, dn = 23, mn = 24, fe = 25, ci = 0;
|
|
268
|
+
function Q(t) {
|
|
269
|
+
return t >= 48 && t <= 57;
|
|
270
|
+
}
|
|
271
|
+
function Ke(t) {
|
|
272
|
+
return Q(t) || // 0 .. 9
|
|
273
|
+
t >= 65 && t <= 70 || // A .. F
|
|
274
|
+
t >= 97 && t <= 102;
|
|
275
|
+
}
|
|
276
|
+
function gn(t) {
|
|
277
|
+
return t >= 65 && t <= 90;
|
|
278
|
+
}
|
|
279
|
+
function ui(t) {
|
|
280
|
+
return t >= 97 && t <= 122;
|
|
281
|
+
}
|
|
282
|
+
function hi(t) {
|
|
283
|
+
return gn(t) || ui(t);
|
|
284
|
+
}
|
|
285
|
+
function fi(t) {
|
|
286
|
+
return t >= 128;
|
|
287
|
+
}
|
|
288
|
+
function gt(t) {
|
|
289
|
+
return hi(t) || fi(t) || t === 95;
|
|
290
|
+
}
|
|
291
|
+
function _r(t) {
|
|
292
|
+
return gt(t) || Q(t) || t === 45;
|
|
293
|
+
}
|
|
294
|
+
function pi(t) {
|
|
295
|
+
return t >= 0 && t <= 8 || t === 11 || t >= 14 && t <= 31 || t === 127;
|
|
296
|
+
}
|
|
297
|
+
function kt(t) {
|
|
298
|
+
return t === 10 || t === 13 || t === 12;
|
|
299
|
+
}
|
|
300
|
+
function Ye(t) {
|
|
301
|
+
return kt(t) || t === 32 || t === 9;
|
|
302
|
+
}
|
|
303
|
+
function ye(t, e) {
|
|
304
|
+
return !(t !== 92 || kt(e) || e === ci);
|
|
305
|
+
}
|
|
306
|
+
function Ht(t, e, n) {
|
|
307
|
+
return t === 45 ? gt(e) || e === 45 || ye(e, n) : gt(t) ? !0 : t === 92 ? ye(t, e) : !1;
|
|
308
|
+
}
|
|
309
|
+
function Wt(t, e, n) {
|
|
310
|
+
return t === 43 || t === 45 ? Q(e) ? 2 : e === 46 && Q(n) ? 3 : 0 : t === 46 ? Q(e) ? 2 : 0 : Q(t) ? 1 : 0;
|
|
311
|
+
}
|
|
312
|
+
function Tr(t) {
|
|
313
|
+
return t === 65279 || t === 65534 ? 1 : 0;
|
|
314
|
+
}
|
|
315
|
+
const an = new Array(128), di = 128, ht = 130, Or = 131, kn = 132, Ir = 133;
|
|
316
|
+
for (let t = 0; t < an.length; t++)
|
|
317
|
+
an[t] = Ye(t) && ht || Q(t) && Or || gt(t) && kn || pi(t) && Ir || t || di;
|
|
318
|
+
function Kt(t) {
|
|
319
|
+
return t < 128 ? an[t] : kn;
|
|
320
|
+
}
|
|
321
|
+
function Fe(t, e) {
|
|
322
|
+
return e < t.length ? t.charCodeAt(e) : 0;
|
|
323
|
+
}
|
|
324
|
+
function ln(t, e, n) {
|
|
325
|
+
return n === 13 && Fe(t, e + 1) === 10 ? 2 : 1;
|
|
326
|
+
}
|
|
327
|
+
function $r(t, e, n) {
|
|
328
|
+
let r = t.charCodeAt(e);
|
|
329
|
+
return gn(r) && (r = r | 32), r === n;
|
|
330
|
+
}
|
|
331
|
+
function yt(t, e, n, r) {
|
|
332
|
+
if (n - e !== r.length || e < 0 || n > t.length)
|
|
333
|
+
return !1;
|
|
334
|
+
for (let i = e; i < n; i++) {
|
|
335
|
+
const o = r.charCodeAt(i - e);
|
|
336
|
+
let a = t.charCodeAt(i);
|
|
337
|
+
if (gn(a) && (a = a | 32), a !== o)
|
|
338
|
+
return !1;
|
|
339
|
+
}
|
|
340
|
+
return !0;
|
|
341
|
+
}
|
|
342
|
+
function mi(t, e) {
|
|
343
|
+
for (; e >= 0 && Ye(t.charCodeAt(e)); e--)
|
|
344
|
+
;
|
|
345
|
+
return e + 1;
|
|
346
|
+
}
|
|
347
|
+
function at(t, e) {
|
|
348
|
+
for (; e < t.length && Ye(t.charCodeAt(e)); e++)
|
|
349
|
+
;
|
|
350
|
+
return e;
|
|
351
|
+
}
|
|
352
|
+
function Qt(t, e) {
|
|
353
|
+
for (; e < t.length && Q(t.charCodeAt(e)); e++)
|
|
354
|
+
;
|
|
355
|
+
return e;
|
|
356
|
+
}
|
|
357
|
+
function Qe(t, e) {
|
|
358
|
+
if (e += 2, Ke(Fe(t, e - 1))) {
|
|
359
|
+
for (const r = Math.min(t.length, e + 5); e < r && Ke(Fe(t, e)); e++)
|
|
360
|
+
;
|
|
361
|
+
const n = Fe(t, e);
|
|
362
|
+
Ye(n) && (e += ln(t, e, n));
|
|
363
|
+
}
|
|
364
|
+
return e;
|
|
365
|
+
}
|
|
366
|
+
function lt(t, e) {
|
|
367
|
+
for (; e < t.length; e++) {
|
|
368
|
+
const n = t.charCodeAt(e);
|
|
369
|
+
if (!_r(n)) {
|
|
370
|
+
if (ye(n, Fe(t, e + 1))) {
|
|
371
|
+
e = Qe(t, e) - 1;
|
|
372
|
+
continue;
|
|
373
|
+
}
|
|
374
|
+
break;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
return e;
|
|
378
|
+
}
|
|
379
|
+
function Nr(t, e) {
|
|
380
|
+
let n = t.charCodeAt(e);
|
|
381
|
+
if ((n === 43 || n === 45) && (n = t.charCodeAt(e += 1)), Q(n) && (e = Qt(t, e + 1), n = t.charCodeAt(e)), n === 46 && Q(t.charCodeAt(e + 1)) && (e += 2, e = Qt(t, e)), $r(
|
|
382
|
+
t,
|
|
383
|
+
e,
|
|
384
|
+
101
|
|
385
|
+
/* e */
|
|
386
|
+
)) {
|
|
387
|
+
let r = 0;
|
|
388
|
+
n = t.charCodeAt(e + 1), (n === 45 || n === 43) && (r = 1, n = t.charCodeAt(e + 2)), Q(n) && (e = Qt(t, e + 1 + r + 1));
|
|
389
|
+
}
|
|
390
|
+
return e;
|
|
391
|
+
}
|
|
392
|
+
function Jt(t, e) {
|
|
393
|
+
for (; e < t.length; e++) {
|
|
394
|
+
const n = t.charCodeAt(e);
|
|
395
|
+
if (n === 41) {
|
|
396
|
+
e++;
|
|
397
|
+
break;
|
|
398
|
+
}
|
|
399
|
+
ye(n, Fe(t, e + 1)) && (e = Qe(t, e));
|
|
400
|
+
}
|
|
401
|
+
return e;
|
|
402
|
+
}
|
|
403
|
+
function gi(t) {
|
|
404
|
+
if (t.length === 1 && !Ke(t.charCodeAt(0)))
|
|
405
|
+
return t[0];
|
|
406
|
+
let e = parseInt(t, 16);
|
|
407
|
+
return (e === 0 || // If this number is zero,
|
|
408
|
+
e >= 55296 && e <= 57343 || // or is for a surrogate,
|
|
409
|
+
e > 1114111) && (e = 65533), String.fromCodePoint(e);
|
|
410
|
+
}
|
|
411
|
+
const Dr = [
|
|
412
|
+
"EOF-token",
|
|
413
|
+
"ident-token",
|
|
414
|
+
"function-token",
|
|
415
|
+
"at-keyword-token",
|
|
416
|
+
"hash-token",
|
|
417
|
+
"string-token",
|
|
418
|
+
"bad-string-token",
|
|
419
|
+
"url-token",
|
|
420
|
+
"bad-url-token",
|
|
421
|
+
"delim-token",
|
|
422
|
+
"number-token",
|
|
423
|
+
"percentage-token",
|
|
424
|
+
"dimension-token",
|
|
425
|
+
"whitespace-token",
|
|
426
|
+
"CDO-token",
|
|
427
|
+
"CDC-token",
|
|
428
|
+
"colon-token",
|
|
429
|
+
"semicolon-token",
|
|
430
|
+
"comma-token",
|
|
431
|
+
"[-token",
|
|
432
|
+
"]-token",
|
|
433
|
+
"(-token",
|
|
434
|
+
")-token",
|
|
435
|
+
"{-token",
|
|
436
|
+
"}-token",
|
|
437
|
+
"comment-token"
|
|
438
|
+
], ki = 16 * 1024;
|
|
439
|
+
function St(t = null, e) {
|
|
440
|
+
return t === null || t.length < e ? new Uint32Array(Math.max(e + 1024, ki)) : t;
|
|
441
|
+
}
|
|
442
|
+
const or = 10, yi = 12, ar = 13;
|
|
443
|
+
function lr(t) {
|
|
444
|
+
const e = t.source, n = e.length, r = e.length > 0 ? Tr(e.charCodeAt(0)) : 0, i = St(t.lines, n), o = St(t.columns, n);
|
|
445
|
+
let a = t.startLine, f = t.startColumn;
|
|
446
|
+
for (let c = r; c < n; c++) {
|
|
447
|
+
const s = e.charCodeAt(c);
|
|
448
|
+
i[c] = a, o[c] = f++, (s === or || s === ar || s === yi) && (s === ar && c + 1 < n && e.charCodeAt(c + 1) === or && (c++, i[c] = a, o[c] = f), a++, f = 1);
|
|
449
|
+
}
|
|
450
|
+
i[n] = a, o[n] = f, t.lines = i, t.columns = o, t.computed = !0;
|
|
451
|
+
}
|
|
452
|
+
class Si {
|
|
453
|
+
constructor(e, n, r, i) {
|
|
454
|
+
this.setSource(e, n, r, i), this.lines = null, this.columns = null;
|
|
455
|
+
}
|
|
456
|
+
setSource(e = "", n = 0, r = 1, i = 1) {
|
|
457
|
+
this.source = e, this.startOffset = n, this.startLine = r, this.startColumn = i, this.computed = !1;
|
|
458
|
+
}
|
|
459
|
+
getLocation(e, n) {
|
|
460
|
+
return this.computed || lr(this), {
|
|
461
|
+
source: n,
|
|
462
|
+
offset: this.startOffset + e,
|
|
463
|
+
line: this.lines[e],
|
|
464
|
+
column: this.columns[e]
|
|
465
|
+
};
|
|
466
|
+
}
|
|
467
|
+
getLocationRange(e, n, r) {
|
|
468
|
+
return this.computed || lr(this), {
|
|
469
|
+
source: r,
|
|
470
|
+
start: {
|
|
471
|
+
offset: this.startOffset + e,
|
|
472
|
+
line: this.lines[e],
|
|
473
|
+
column: this.columns[e]
|
|
474
|
+
},
|
|
475
|
+
end: {
|
|
476
|
+
offset: this.startOffset + n,
|
|
477
|
+
line: this.lines[n],
|
|
478
|
+
column: this.columns[n]
|
|
479
|
+
}
|
|
480
|
+
};
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
const ce = 16777215, ue = 24, Te = new Uint8Array(32);
|
|
484
|
+
Te[N] = O;
|
|
485
|
+
Te[te] = O;
|
|
486
|
+
Te[bt] = mt;
|
|
487
|
+
Te[dn] = mn;
|
|
488
|
+
function cr(t) {
|
|
489
|
+
return Te[t] !== 0;
|
|
490
|
+
}
|
|
491
|
+
class xi {
|
|
492
|
+
constructor(e, n) {
|
|
493
|
+
this.setSource(e, n);
|
|
494
|
+
}
|
|
495
|
+
reset() {
|
|
496
|
+
this.eof = !1, this.tokenIndex = -1, this.tokenType = 0, this.tokenStart = this.firstCharOffset, this.tokenEnd = this.firstCharOffset;
|
|
497
|
+
}
|
|
498
|
+
setSource(e = "", n = () => {
|
|
499
|
+
}) {
|
|
500
|
+
e = String(e || "");
|
|
501
|
+
const r = e.length, i = St(this.offsetAndType, e.length + 1), o = St(this.balance, e.length + 1);
|
|
502
|
+
let a = 0, f = -1, c = 0, s = e.length;
|
|
503
|
+
this.offsetAndType = null, this.balance = null, o.fill(0), n(e, (l, m, y) => {
|
|
504
|
+
const C = a++;
|
|
505
|
+
if (i[C] = l << ue | y, f === -1 && (f = m), o[C] = s, l === c) {
|
|
506
|
+
const _ = o[s];
|
|
507
|
+
o[s] = C, s = _, c = Te[i[_] >> ue];
|
|
508
|
+
} else cr(l) && (s = C, c = Te[l]);
|
|
509
|
+
}), i[a] = He << ue | r, o[a] = a;
|
|
510
|
+
for (let l = 0; l < a; l++) {
|
|
511
|
+
const m = o[l];
|
|
512
|
+
if (m <= l) {
|
|
513
|
+
const y = o[m];
|
|
514
|
+
y !== l && (o[l] = y);
|
|
515
|
+
} else m > a && (o[l] = a);
|
|
516
|
+
}
|
|
517
|
+
this.source = e, this.firstCharOffset = f === -1 ? 0 : f, this.tokenCount = a, this.offsetAndType = i, this.balance = o, this.reset(), this.next();
|
|
518
|
+
}
|
|
519
|
+
lookupType(e) {
|
|
520
|
+
return e += this.tokenIndex, e < this.tokenCount ? this.offsetAndType[e] >> ue : He;
|
|
521
|
+
}
|
|
522
|
+
lookupTypeNonSC(e) {
|
|
523
|
+
for (let n = this.tokenIndex; n < this.tokenCount; n++) {
|
|
524
|
+
const r = this.offsetAndType[n] >> ue;
|
|
525
|
+
if (r !== J && r !== fe && e-- === 0)
|
|
526
|
+
return r;
|
|
527
|
+
}
|
|
528
|
+
return He;
|
|
529
|
+
}
|
|
530
|
+
lookupOffset(e) {
|
|
531
|
+
return e += this.tokenIndex, e < this.tokenCount ? this.offsetAndType[e - 1] & ce : this.source.length;
|
|
532
|
+
}
|
|
533
|
+
lookupOffsetNonSC(e) {
|
|
534
|
+
for (let n = this.tokenIndex; n < this.tokenCount; n++) {
|
|
535
|
+
const r = this.offsetAndType[n] >> ue;
|
|
536
|
+
if (r !== J && r !== fe && e-- === 0)
|
|
537
|
+
return n - this.tokenIndex;
|
|
538
|
+
}
|
|
539
|
+
return He;
|
|
540
|
+
}
|
|
541
|
+
lookupValue(e, n) {
|
|
542
|
+
return e += this.tokenIndex, e < this.tokenCount ? yt(
|
|
543
|
+
this.source,
|
|
544
|
+
this.offsetAndType[e - 1] & ce,
|
|
545
|
+
this.offsetAndType[e] & ce,
|
|
546
|
+
n
|
|
547
|
+
) : !1;
|
|
548
|
+
}
|
|
549
|
+
getTokenStart(e) {
|
|
550
|
+
return e === this.tokenIndex ? this.tokenStart : e > 0 ? e < this.tokenCount ? this.offsetAndType[e - 1] & ce : this.offsetAndType[this.tokenCount] & ce : this.firstCharOffset;
|
|
551
|
+
}
|
|
552
|
+
substrToCursor(e) {
|
|
553
|
+
return this.source.substring(e, this.tokenStart);
|
|
554
|
+
}
|
|
555
|
+
isBalanceEdge(e) {
|
|
556
|
+
return this.balance[this.tokenIndex] < e;
|
|
557
|
+
}
|
|
558
|
+
isDelim(e, n) {
|
|
559
|
+
return n ? this.lookupType(n) === $ && this.source.charCodeAt(this.lookupOffset(n)) === e : this.tokenType === $ && this.source.charCodeAt(this.tokenStart) === e;
|
|
560
|
+
}
|
|
561
|
+
skip(e) {
|
|
562
|
+
let n = this.tokenIndex + e;
|
|
563
|
+
n < this.tokenCount ? (this.tokenIndex = n, this.tokenStart = this.offsetAndType[n - 1] & ce, n = this.offsetAndType[n], this.tokenType = n >> ue, this.tokenEnd = n & ce) : (this.tokenIndex = this.tokenCount, this.next());
|
|
564
|
+
}
|
|
565
|
+
next() {
|
|
566
|
+
let e = this.tokenIndex + 1;
|
|
567
|
+
e < this.tokenCount ? (this.tokenIndex = e, this.tokenStart = this.tokenEnd, e = this.offsetAndType[e], this.tokenType = e >> ue, this.tokenEnd = e & ce) : (this.eof = !0, this.tokenIndex = this.tokenCount, this.tokenType = He, this.tokenStart = this.tokenEnd = this.source.length);
|
|
568
|
+
}
|
|
569
|
+
skipSC() {
|
|
570
|
+
for (; this.tokenType === J || this.tokenType === fe; )
|
|
571
|
+
this.next();
|
|
572
|
+
}
|
|
573
|
+
skipUntilBalanced(e, n) {
|
|
574
|
+
let r = e, i = 0, o = 0;
|
|
575
|
+
e:
|
|
576
|
+
for (; r < this.tokenCount; r++) {
|
|
577
|
+
if (i = this.balance[r], i < e)
|
|
578
|
+
break e;
|
|
579
|
+
switch (o = r > 0 ? this.offsetAndType[r - 1] & ce : this.firstCharOffset, n(this.source.charCodeAt(o))) {
|
|
580
|
+
case 1:
|
|
581
|
+
break e;
|
|
582
|
+
case 2:
|
|
583
|
+
r++;
|
|
584
|
+
break e;
|
|
585
|
+
default:
|
|
586
|
+
cr(this.offsetAndType[r] >> ue) && (r = i);
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
this.skip(r - this.tokenIndex);
|
|
590
|
+
}
|
|
591
|
+
forEachToken(e) {
|
|
592
|
+
for (let n = 0, r = this.firstCharOffset; n < this.tokenCount; n++) {
|
|
593
|
+
const i = r, o = this.offsetAndType[n], a = o & ce, f = o >> ue;
|
|
594
|
+
r = a, e(f, i, a, n);
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
dump() {
|
|
598
|
+
const e = new Array(this.tokenCount);
|
|
599
|
+
return this.forEachToken((n, r, i, o) => {
|
|
600
|
+
e[o] = {
|
|
601
|
+
idx: o,
|
|
602
|
+
type: Dr[n],
|
|
603
|
+
chunk: this.source.substring(r, i),
|
|
604
|
+
balance: this.balance[o]
|
|
605
|
+
};
|
|
606
|
+
}), e;
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
function Pr(t, e) {
|
|
610
|
+
function n(m) {
|
|
611
|
+
return m < f ? t.charCodeAt(m) : 0;
|
|
612
|
+
}
|
|
613
|
+
function r() {
|
|
614
|
+
if (s = Nr(t, s), Ht(n(s), n(s + 1), n(s + 2))) {
|
|
615
|
+
l = I, s = lt(t, s);
|
|
616
|
+
return;
|
|
617
|
+
}
|
|
618
|
+
if (n(s) === 37) {
|
|
619
|
+
l = M, s++;
|
|
620
|
+
return;
|
|
621
|
+
}
|
|
622
|
+
l = E;
|
|
623
|
+
}
|
|
624
|
+
function i() {
|
|
625
|
+
const m = s;
|
|
626
|
+
if (s = lt(t, s), yt(t, m, s, "url") && n(s) === 40) {
|
|
627
|
+
if (s = at(t, s + 1), n(s) === 34 || n(s) === 39) {
|
|
628
|
+
l = N, s = m + 4;
|
|
629
|
+
return;
|
|
630
|
+
}
|
|
631
|
+
a();
|
|
632
|
+
return;
|
|
633
|
+
}
|
|
634
|
+
if (n(s) === 40) {
|
|
635
|
+
l = N, s++;
|
|
636
|
+
return;
|
|
637
|
+
}
|
|
638
|
+
l = k;
|
|
639
|
+
}
|
|
640
|
+
function o(m) {
|
|
641
|
+
for (m || (m = n(s++)), l = Re; s < t.length; s++) {
|
|
642
|
+
const y = t.charCodeAt(s);
|
|
643
|
+
switch (Kt(y)) {
|
|
644
|
+
case m:
|
|
645
|
+
s++;
|
|
646
|
+
return;
|
|
647
|
+
case ht:
|
|
648
|
+
if (kt(y)) {
|
|
649
|
+
s += ln(t, s, y), l = li;
|
|
650
|
+
return;
|
|
651
|
+
}
|
|
652
|
+
break;
|
|
653
|
+
case 92:
|
|
654
|
+
if (s === t.length - 1)
|
|
655
|
+
break;
|
|
656
|
+
const C = n(s + 1);
|
|
657
|
+
kt(C) ? s += ln(t, s + 1, C) : ye(y, C) && (s = Qe(t, s) - 1);
|
|
658
|
+
break;
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
function a() {
|
|
663
|
+
for (l = se, s = at(t, s); s < t.length; s++) {
|
|
664
|
+
const m = t.charCodeAt(s);
|
|
665
|
+
switch (Kt(m)) {
|
|
666
|
+
case 41:
|
|
667
|
+
s++;
|
|
668
|
+
return;
|
|
669
|
+
case ht:
|
|
670
|
+
if (s = at(t, s), n(s) === 41 || s >= t.length) {
|
|
671
|
+
s < t.length && s++;
|
|
672
|
+
return;
|
|
673
|
+
}
|
|
674
|
+
s = Jt(t, s), l = oe;
|
|
675
|
+
return;
|
|
676
|
+
case 34:
|
|
677
|
+
case 39:
|
|
678
|
+
case 40:
|
|
679
|
+
case Ir:
|
|
680
|
+
s = Jt(t, s), l = oe;
|
|
681
|
+
return;
|
|
682
|
+
case 92:
|
|
683
|
+
if (ye(m, n(s + 1))) {
|
|
684
|
+
s = Qe(t, s) - 1;
|
|
685
|
+
break;
|
|
686
|
+
}
|
|
687
|
+
s = Jt(t, s), l = oe;
|
|
688
|
+
return;
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
t = String(t || "");
|
|
693
|
+
const f = t.length;
|
|
694
|
+
let c = Tr(n(0)), s = c, l;
|
|
695
|
+
for (; s < f; ) {
|
|
696
|
+
const m = t.charCodeAt(s);
|
|
697
|
+
switch (Kt(m)) {
|
|
698
|
+
case ht:
|
|
699
|
+
l = J, s = at(t, s + 1);
|
|
700
|
+
break;
|
|
701
|
+
case 34:
|
|
702
|
+
o();
|
|
703
|
+
break;
|
|
704
|
+
case 35:
|
|
705
|
+
_r(n(s + 1)) || ye(n(s + 1), n(s + 2)) ? (l = z, s = lt(t, s + 1)) : (l = $, s++);
|
|
706
|
+
break;
|
|
707
|
+
case 39:
|
|
708
|
+
o();
|
|
709
|
+
break;
|
|
710
|
+
case 40:
|
|
711
|
+
l = te, s++;
|
|
712
|
+
break;
|
|
713
|
+
case 41:
|
|
714
|
+
l = O, s++;
|
|
715
|
+
break;
|
|
716
|
+
case 43:
|
|
717
|
+
Wt(m, n(s + 1), n(s + 2)) ? r() : (l = $, s++);
|
|
718
|
+
break;
|
|
719
|
+
case 44:
|
|
720
|
+
l = qe, s++;
|
|
721
|
+
break;
|
|
722
|
+
case 45:
|
|
723
|
+
Wt(m, n(s + 1), n(s + 2)) ? r() : n(s + 1) === 45 && n(s + 2) === 62 ? (l = ae, s = s + 3) : Ht(m, n(s + 1), n(s + 2)) ? i() : (l = $, s++);
|
|
724
|
+
break;
|
|
725
|
+
case 46:
|
|
726
|
+
Wt(m, n(s + 1), n(s + 2)) ? r() : (l = $, s++);
|
|
727
|
+
break;
|
|
728
|
+
case 47:
|
|
729
|
+
n(s + 1) === 42 ? (l = fe, s = t.indexOf("*/", s + 2), s = s === -1 ? t.length : s + 2) : (l = $, s++);
|
|
730
|
+
break;
|
|
731
|
+
case 58:
|
|
732
|
+
l = ee, s++;
|
|
733
|
+
break;
|
|
734
|
+
case 59:
|
|
735
|
+
l = Ct, s++;
|
|
736
|
+
break;
|
|
737
|
+
case 60:
|
|
738
|
+
n(s + 1) === 33 && n(s + 2) === 45 && n(s + 3) === 45 ? (l = Er, s = s + 4) : (l = $, s++);
|
|
739
|
+
break;
|
|
740
|
+
case 64:
|
|
741
|
+
Ht(n(s + 1), n(s + 2), n(s + 3)) ? (l = U, s = lt(t, s + 1)) : (l = $, s++);
|
|
742
|
+
break;
|
|
743
|
+
case 91:
|
|
744
|
+
l = bt, s++;
|
|
745
|
+
break;
|
|
746
|
+
case 92:
|
|
747
|
+
ye(m, n(s + 1)) ? i() : (l = $, s++);
|
|
748
|
+
break;
|
|
749
|
+
case 93:
|
|
750
|
+
l = mt, s++;
|
|
751
|
+
break;
|
|
752
|
+
case 123:
|
|
753
|
+
l = dn, s++;
|
|
754
|
+
break;
|
|
755
|
+
case 125:
|
|
756
|
+
l = mn, s++;
|
|
757
|
+
break;
|
|
758
|
+
case Or:
|
|
759
|
+
r();
|
|
760
|
+
break;
|
|
761
|
+
case kn:
|
|
762
|
+
i();
|
|
763
|
+
break;
|
|
764
|
+
default:
|
|
765
|
+
l = $, s++;
|
|
766
|
+
}
|
|
767
|
+
e(l, c, c = s);
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
function Ci(t) {
|
|
771
|
+
const e = this.createList();
|
|
772
|
+
let n = !1;
|
|
773
|
+
const r = {
|
|
774
|
+
recognizer: t
|
|
775
|
+
};
|
|
776
|
+
for (; !this.eof; ) {
|
|
777
|
+
switch (this.tokenType) {
|
|
778
|
+
case fe:
|
|
779
|
+
this.next();
|
|
780
|
+
continue;
|
|
781
|
+
case J:
|
|
782
|
+
n = !0, this.next();
|
|
783
|
+
continue;
|
|
784
|
+
}
|
|
785
|
+
let i = t.getNode.call(this, r);
|
|
786
|
+
if (i === void 0)
|
|
787
|
+
break;
|
|
788
|
+
n && (t.onWhiteSpace && t.onWhiteSpace.call(this, i, e, r), n = !1), e.push(i);
|
|
789
|
+
}
|
|
790
|
+
return n && t.onWhiteSpace && t.onWhiteSpace.call(this, null, e, r), e;
|
|
791
|
+
}
|
|
792
|
+
const ur = () => {
|
|
793
|
+
}, bi = 33, wi = 35, Yt = 59, hr = 123, fr = 0;
|
|
794
|
+
function vi(t) {
|
|
795
|
+
return function() {
|
|
796
|
+
return this[t]();
|
|
797
|
+
};
|
|
798
|
+
}
|
|
799
|
+
function Xt(t) {
|
|
800
|
+
const e = /* @__PURE__ */ Object.create(null);
|
|
801
|
+
for (const n of Object.keys(t)) {
|
|
802
|
+
const r = t[n], i = r.parse || r;
|
|
803
|
+
i && (e[n] = i);
|
|
804
|
+
}
|
|
805
|
+
return e;
|
|
806
|
+
}
|
|
807
|
+
function Ai(t) {
|
|
808
|
+
const e = {
|
|
809
|
+
context: /* @__PURE__ */ Object.create(null),
|
|
810
|
+
features: Object.assign(/* @__PURE__ */ Object.create(null), t.features),
|
|
811
|
+
scope: Object.assign(/* @__PURE__ */ Object.create(null), t.scope),
|
|
812
|
+
atrule: Xt(t.atrule),
|
|
813
|
+
pseudo: Xt(t.pseudo),
|
|
814
|
+
node: Xt(t.node)
|
|
815
|
+
};
|
|
816
|
+
for (const [n, r] of Object.entries(t.parseContext))
|
|
817
|
+
switch (typeof r) {
|
|
818
|
+
case "function":
|
|
819
|
+
e.context[n] = r;
|
|
820
|
+
break;
|
|
821
|
+
case "string":
|
|
822
|
+
e.context[n] = vi(r);
|
|
823
|
+
break;
|
|
824
|
+
}
|
|
825
|
+
return {
|
|
826
|
+
config: e,
|
|
827
|
+
...e,
|
|
828
|
+
...e.node
|
|
829
|
+
};
|
|
830
|
+
}
|
|
831
|
+
function Li(t) {
|
|
832
|
+
let e = "", n = "<unknown>", r = !1, i = ur, o = !1;
|
|
833
|
+
const a = new Si(), f = Object.assign(new xi(), Ai(t || {}), {
|
|
834
|
+
parseAtrulePrelude: !0,
|
|
835
|
+
parseRulePrelude: !0,
|
|
836
|
+
parseValue: !0,
|
|
837
|
+
parseCustomProperty: !1,
|
|
838
|
+
readSequence: Ci,
|
|
839
|
+
consumeUntilBalanceEnd: () => 0,
|
|
840
|
+
consumeUntilLeftCurlyBracket(s) {
|
|
841
|
+
return s === hr ? 1 : 0;
|
|
842
|
+
},
|
|
843
|
+
consumeUntilLeftCurlyBracketOrSemicolon(s) {
|
|
844
|
+
return s === hr || s === Yt ? 1 : 0;
|
|
845
|
+
},
|
|
846
|
+
consumeUntilExclamationMarkOrSemicolon(s) {
|
|
847
|
+
return s === bi || s === Yt ? 1 : 0;
|
|
848
|
+
},
|
|
849
|
+
consumeUntilSemicolonIncluded(s) {
|
|
850
|
+
return s === Yt ? 2 : 0;
|
|
851
|
+
},
|
|
852
|
+
createList() {
|
|
853
|
+
return new H();
|
|
854
|
+
},
|
|
855
|
+
createSingleNodeList(s) {
|
|
856
|
+
return new H().appendData(s);
|
|
857
|
+
},
|
|
858
|
+
getFirstListNode(s) {
|
|
859
|
+
return s && s.first;
|
|
860
|
+
},
|
|
861
|
+
getLastListNode(s) {
|
|
862
|
+
return s && s.last;
|
|
863
|
+
},
|
|
864
|
+
parseWithFallback(s, l) {
|
|
865
|
+
const m = this.tokenIndex;
|
|
866
|
+
try {
|
|
867
|
+
return s.call(this);
|
|
868
|
+
} catch (y) {
|
|
869
|
+
if (o)
|
|
870
|
+
throw y;
|
|
871
|
+
this.skip(m - this.tokenIndex);
|
|
872
|
+
const C = l.call(this);
|
|
873
|
+
return o = !0, i(y, C), o = !1, C;
|
|
874
|
+
}
|
|
875
|
+
},
|
|
876
|
+
lookupNonWSType(s) {
|
|
877
|
+
let l;
|
|
878
|
+
do
|
|
879
|
+
if (l = this.lookupType(s++), l !== J && l !== fe)
|
|
880
|
+
return l;
|
|
881
|
+
while (l !== fr);
|
|
882
|
+
return fr;
|
|
883
|
+
},
|
|
884
|
+
charCodeAt(s) {
|
|
885
|
+
return s >= 0 && s < e.length ? e.charCodeAt(s) : 0;
|
|
886
|
+
},
|
|
887
|
+
substring(s, l) {
|
|
888
|
+
return e.substring(s, l);
|
|
889
|
+
},
|
|
890
|
+
substrToCursor(s) {
|
|
891
|
+
return this.source.substring(s, this.tokenStart);
|
|
892
|
+
},
|
|
893
|
+
cmpChar(s, l) {
|
|
894
|
+
return $r(e, s, l);
|
|
895
|
+
},
|
|
896
|
+
cmpStr(s, l, m) {
|
|
897
|
+
return yt(e, s, l, m);
|
|
898
|
+
},
|
|
899
|
+
consume(s) {
|
|
900
|
+
const l = this.tokenStart;
|
|
901
|
+
return this.eat(s), this.substrToCursor(l);
|
|
902
|
+
},
|
|
903
|
+
consumeFunctionName() {
|
|
904
|
+
const s = e.substring(this.tokenStart, this.tokenEnd - 1);
|
|
905
|
+
return this.eat(N), s;
|
|
906
|
+
},
|
|
907
|
+
consumeNumber(s) {
|
|
908
|
+
const l = e.substring(this.tokenStart, Nr(e, this.tokenStart));
|
|
909
|
+
return this.eat(s), l;
|
|
910
|
+
},
|
|
911
|
+
eat(s) {
|
|
912
|
+
if (this.tokenType !== s) {
|
|
913
|
+
const l = Dr[s].slice(0, -6).replace(/-/g, " ").replace(/^./, (C) => C.toUpperCase());
|
|
914
|
+
let m = `${/[[\](){}]/.test(l) ? `"${l}"` : l} is expected`, y = this.tokenStart;
|
|
915
|
+
switch (s) {
|
|
916
|
+
case k:
|
|
917
|
+
this.tokenType === N || this.tokenType === se ? (y = this.tokenEnd - 1, m = "Identifier is expected but function found") : m = "Identifier is expected";
|
|
918
|
+
break;
|
|
919
|
+
case z:
|
|
920
|
+
this.isDelim(wi) && (this.next(), y++, m = "Name is expected");
|
|
921
|
+
break;
|
|
922
|
+
case M:
|
|
923
|
+
this.tokenType === E && (y = this.tokenEnd, m = "Percent sign is expected");
|
|
924
|
+
break;
|
|
925
|
+
}
|
|
926
|
+
this.error(m, y);
|
|
927
|
+
}
|
|
928
|
+
this.next();
|
|
929
|
+
},
|
|
930
|
+
eatIdent(s) {
|
|
931
|
+
(this.tokenType !== k || this.lookupValue(0, s) === !1) && this.error(`Identifier "${s}" is expected`), this.next();
|
|
932
|
+
},
|
|
933
|
+
eatDelim(s) {
|
|
934
|
+
this.isDelim(s) || this.error(`Delim "${String.fromCharCode(s)}" is expected`), this.next();
|
|
935
|
+
},
|
|
936
|
+
getLocation(s, l) {
|
|
937
|
+
return r ? a.getLocationRange(
|
|
938
|
+
s,
|
|
939
|
+
l,
|
|
940
|
+
n
|
|
941
|
+
) : null;
|
|
942
|
+
},
|
|
943
|
+
getLocationFromList(s) {
|
|
944
|
+
if (r) {
|
|
945
|
+
const l = this.getFirstListNode(s), m = this.getLastListNode(s);
|
|
946
|
+
return a.getLocationRange(
|
|
947
|
+
l !== null ? l.loc.start.offset - a.startOffset : this.tokenStart,
|
|
948
|
+
m !== null ? m.loc.end.offset - a.startOffset : this.tokenStart,
|
|
949
|
+
n
|
|
950
|
+
);
|
|
951
|
+
}
|
|
952
|
+
return null;
|
|
953
|
+
},
|
|
954
|
+
error(s, l) {
|
|
955
|
+
const m = typeof l < "u" && l < e.length ? a.getLocation(l) : this.eof ? a.getLocation(mi(e, e.length - 1)) : a.getLocation(this.tokenStart);
|
|
956
|
+
throw new sr(
|
|
957
|
+
s || "Unexpected input",
|
|
958
|
+
e,
|
|
959
|
+
m.offset,
|
|
960
|
+
m.line,
|
|
961
|
+
m.column,
|
|
962
|
+
a.startLine,
|
|
963
|
+
a.startColumn
|
|
964
|
+
);
|
|
965
|
+
}
|
|
966
|
+
});
|
|
967
|
+
return Object.assign(function(s, l) {
|
|
968
|
+
e = s, l = l || {}, f.setSource(e, Pr), a.setSource(
|
|
969
|
+
e,
|
|
970
|
+
l.offset,
|
|
971
|
+
l.line,
|
|
972
|
+
l.column
|
|
973
|
+
), n = l.filename || "<unknown>", r = !!l.positions, i = typeof l.onParseError == "function" ? l.onParseError : ur, o = !1, f.parseAtrulePrelude = "parseAtrulePrelude" in l ? !!l.parseAtrulePrelude : !0, f.parseRulePrelude = "parseRulePrelude" in l ? !!l.parseRulePrelude : !0, f.parseValue = "parseValue" in l ? !!l.parseValue : !0, f.parseCustomProperty = "parseCustomProperty" in l ? !!l.parseCustomProperty : !1;
|
|
974
|
+
const { context: m = "default", onComment: y } = l;
|
|
975
|
+
if (!(m in f.context))
|
|
976
|
+
throw new Error("Unknown context `" + m + "`");
|
|
977
|
+
typeof y == "function" && f.forEachToken((_, q, V) => {
|
|
978
|
+
if (_ === fe) {
|
|
979
|
+
const me = f.getLocation(q, V), Oe = yt(e, V - 2, V, "*/") ? e.slice(q + 2, V - 2) : e.slice(q + 2, V);
|
|
980
|
+
y(Oe, me);
|
|
981
|
+
}
|
|
982
|
+
});
|
|
983
|
+
const C = f.context[m].call(f, l);
|
|
984
|
+
return f.eof || f.error(), C;
|
|
985
|
+
}, {
|
|
986
|
+
SyntaxError: sr,
|
|
987
|
+
config: f.config
|
|
988
|
+
});
|
|
989
|
+
}
|
|
990
|
+
const Ei = 35, _i = 38, Ti = 42, Oi = 43, Ii = 47, pr = 46, $i = 62, Ni = 124, Di = 126;
|
|
991
|
+
function Pi(t, e) {
|
|
992
|
+
e.last !== null && e.last.type !== "Combinator" && t !== null && t.type !== "Combinator" && e.push({
|
|
993
|
+
// FIXME: this.Combinator() should be used instead
|
|
994
|
+
type: "Combinator",
|
|
995
|
+
loc: null,
|
|
996
|
+
name: " "
|
|
997
|
+
});
|
|
998
|
+
}
|
|
999
|
+
function Mi() {
|
|
1000
|
+
switch (this.tokenType) {
|
|
1001
|
+
case bt:
|
|
1002
|
+
return this.AttributeSelector();
|
|
1003
|
+
case z:
|
|
1004
|
+
return this.IdSelector();
|
|
1005
|
+
case ee:
|
|
1006
|
+
return this.lookupType(1) === ee ? this.PseudoElementSelector() : this.PseudoClassSelector();
|
|
1007
|
+
case k:
|
|
1008
|
+
return this.TypeSelector();
|
|
1009
|
+
case E:
|
|
1010
|
+
case M:
|
|
1011
|
+
return this.Percentage();
|
|
1012
|
+
case I:
|
|
1013
|
+
this.charCodeAt(this.tokenStart) === pr && this.error("Identifier is expected", this.tokenStart + 1);
|
|
1014
|
+
break;
|
|
1015
|
+
case $: {
|
|
1016
|
+
switch (this.charCodeAt(this.tokenStart)) {
|
|
1017
|
+
case Oi:
|
|
1018
|
+
case $i:
|
|
1019
|
+
case Di:
|
|
1020
|
+
case Ii:
|
|
1021
|
+
return this.Combinator();
|
|
1022
|
+
case pr:
|
|
1023
|
+
return this.ClassSelector();
|
|
1024
|
+
case Ti:
|
|
1025
|
+
case Ni:
|
|
1026
|
+
return this.TypeSelector();
|
|
1027
|
+
case Ei:
|
|
1028
|
+
return this.IdSelector();
|
|
1029
|
+
case _i:
|
|
1030
|
+
return this.NestingSelector();
|
|
1031
|
+
}
|
|
1032
|
+
break;
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
const Fi = {
|
|
1037
|
+
onWhiteSpace: Pi,
|
|
1038
|
+
getNode: Mi
|
|
1039
|
+
};
|
|
1040
|
+
function zi() {
|
|
1041
|
+
const t = this.createList();
|
|
1042
|
+
this.skipSC();
|
|
1043
|
+
e: for (; !this.eof; ) {
|
|
1044
|
+
switch (this.tokenType) {
|
|
1045
|
+
case k:
|
|
1046
|
+
t.push(this.Identifier());
|
|
1047
|
+
break;
|
|
1048
|
+
case Re:
|
|
1049
|
+
t.push(this.String());
|
|
1050
|
+
break;
|
|
1051
|
+
case qe:
|
|
1052
|
+
t.push(this.Operator());
|
|
1053
|
+
break;
|
|
1054
|
+
case O:
|
|
1055
|
+
break e;
|
|
1056
|
+
default:
|
|
1057
|
+
this.error("Identifier, string or comma is expected");
|
|
1058
|
+
}
|
|
1059
|
+
this.skipSC();
|
|
1060
|
+
}
|
|
1061
|
+
return t;
|
|
1062
|
+
}
|
|
1063
|
+
const Le = {
|
|
1064
|
+
parse() {
|
|
1065
|
+
return this.createSingleNodeList(
|
|
1066
|
+
this.SelectorList()
|
|
1067
|
+
);
|
|
1068
|
+
}
|
|
1069
|
+
}, Zt = {
|
|
1070
|
+
parse() {
|
|
1071
|
+
return this.createSingleNodeList(
|
|
1072
|
+
this.Selector()
|
|
1073
|
+
);
|
|
1074
|
+
}
|
|
1075
|
+
}, Ri = {
|
|
1076
|
+
parse() {
|
|
1077
|
+
return this.createSingleNodeList(
|
|
1078
|
+
this.Identifier()
|
|
1079
|
+
);
|
|
1080
|
+
}
|
|
1081
|
+
}, qi = {
|
|
1082
|
+
parse: zi
|
|
1083
|
+
}, ct = {
|
|
1084
|
+
parse() {
|
|
1085
|
+
return this.createSingleNodeList(
|
|
1086
|
+
this.Nth()
|
|
1087
|
+
);
|
|
1088
|
+
}
|
|
1089
|
+
}, Bi = {
|
|
1090
|
+
dir: Ri,
|
|
1091
|
+
has: Le,
|
|
1092
|
+
lang: qi,
|
|
1093
|
+
matches: Le,
|
|
1094
|
+
is: Le,
|
|
1095
|
+
"-moz-any": Le,
|
|
1096
|
+
"-webkit-any": Le,
|
|
1097
|
+
where: Le,
|
|
1098
|
+
not: Le,
|
|
1099
|
+
"nth-child": ct,
|
|
1100
|
+
"nth-last-child": ct,
|
|
1101
|
+
"nth-last-of-type": ct,
|
|
1102
|
+
"nth-of-type": ct,
|
|
1103
|
+
slotted: Zt,
|
|
1104
|
+
host: Zt,
|
|
1105
|
+
"host-context": Zt
|
|
1106
|
+
}, he = 43, K = 45, ft = 110, Ee = !0, ji = !1;
|
|
1107
|
+
function pt(t, e) {
|
|
1108
|
+
let n = this.tokenStart + t;
|
|
1109
|
+
const r = this.charCodeAt(n);
|
|
1110
|
+
for ((r === he || r === K) && (e && this.error("Number sign is not allowed"), n++); n < this.tokenEnd; n++)
|
|
1111
|
+
Q(this.charCodeAt(n)) || this.error("Integer is expected", n);
|
|
1112
|
+
}
|
|
1113
|
+
function Pe(t) {
|
|
1114
|
+
return pt.call(this, 0, t);
|
|
1115
|
+
}
|
|
1116
|
+
function be(t, e) {
|
|
1117
|
+
if (!this.cmpChar(this.tokenStart + t, e)) {
|
|
1118
|
+
let n = "";
|
|
1119
|
+
switch (e) {
|
|
1120
|
+
case ft:
|
|
1121
|
+
n = "N is expected";
|
|
1122
|
+
break;
|
|
1123
|
+
case K:
|
|
1124
|
+
n = "HyphenMinus is expected";
|
|
1125
|
+
break;
|
|
1126
|
+
}
|
|
1127
|
+
this.error(n, this.tokenStart + t);
|
|
1128
|
+
}
|
|
1129
|
+
}
|
|
1130
|
+
function en() {
|
|
1131
|
+
let t = 0, e = 0, n = this.tokenType;
|
|
1132
|
+
for (; n === J || n === fe; )
|
|
1133
|
+
n = this.lookupType(++t);
|
|
1134
|
+
if (n !== E)
|
|
1135
|
+
if (this.isDelim(he, t) || this.isDelim(K, t)) {
|
|
1136
|
+
e = this.isDelim(he, t) ? he : K;
|
|
1137
|
+
do
|
|
1138
|
+
n = this.lookupType(++t);
|
|
1139
|
+
while (n === J || n === fe);
|
|
1140
|
+
n !== E && (this.skip(t), Pe.call(this, Ee));
|
|
1141
|
+
} else
|
|
1142
|
+
return null;
|
|
1143
|
+
return t > 0 && this.skip(t), e === 0 && (n = this.charCodeAt(this.tokenStart), n !== he && n !== K && this.error("Number sign is expected")), Pe.call(this, e !== 0), e === K ? "-" + this.consume(E) : this.consume(E);
|
|
1144
|
+
}
|
|
1145
|
+
function Ui() {
|
|
1146
|
+
const t = this.tokenStart;
|
|
1147
|
+
let e = null, n = null;
|
|
1148
|
+
if (this.tokenType === E)
|
|
1149
|
+
Pe.call(this, ji), n = this.consume(E);
|
|
1150
|
+
else if (this.tokenType === k && this.cmpChar(this.tokenStart, K))
|
|
1151
|
+
switch (e = "-1", be.call(this, 1, ft), this.tokenEnd - this.tokenStart) {
|
|
1152
|
+
case 2:
|
|
1153
|
+
this.next(), n = en.call(this);
|
|
1154
|
+
break;
|
|
1155
|
+
case 3:
|
|
1156
|
+
be.call(this, 2, K), this.next(), this.skipSC(), Pe.call(this, Ee), n = "-" + this.consume(E);
|
|
1157
|
+
break;
|
|
1158
|
+
default:
|
|
1159
|
+
be.call(this, 2, K), pt.call(this, 3, Ee), this.next(), n = this.substrToCursor(t + 2);
|
|
1160
|
+
}
|
|
1161
|
+
else if (this.tokenType === k || this.isDelim(he) && this.lookupType(1) === k) {
|
|
1162
|
+
let r = 0;
|
|
1163
|
+
switch (e = "1", this.isDelim(he) && (r = 1, this.next()), be.call(this, 0, ft), this.tokenEnd - this.tokenStart) {
|
|
1164
|
+
case 1:
|
|
1165
|
+
this.next(), n = en.call(this);
|
|
1166
|
+
break;
|
|
1167
|
+
case 2:
|
|
1168
|
+
be.call(this, 1, K), this.next(), this.skipSC(), Pe.call(this, Ee), n = "-" + this.consume(E);
|
|
1169
|
+
break;
|
|
1170
|
+
default:
|
|
1171
|
+
be.call(this, 1, K), pt.call(this, 2, Ee), this.next(), n = this.substrToCursor(t + r + 1);
|
|
1172
|
+
}
|
|
1173
|
+
} else if (this.tokenType === I) {
|
|
1174
|
+
const r = this.charCodeAt(this.tokenStart), i = r === he || r === K;
|
|
1175
|
+
let o = this.tokenStart + i;
|
|
1176
|
+
for (; o < this.tokenEnd && Q(this.charCodeAt(o)); o++)
|
|
1177
|
+
;
|
|
1178
|
+
o === this.tokenStart + i && this.error("Integer is expected", this.tokenStart + i), be.call(this, o - this.tokenStart, ft), e = this.substring(t, o), o + 1 === this.tokenEnd ? (this.next(), n = en.call(this)) : (be.call(this, o - this.tokenStart + 1, K), o + 2 === this.tokenEnd ? (this.next(), this.skipSC(), Pe.call(this, Ee), n = "-" + this.consume(E)) : (pt.call(this, o - this.tokenStart + 2, Ee), this.next(), n = this.substrToCursor(o + 1)));
|
|
1179
|
+
} else
|
|
1180
|
+
this.error();
|
|
1181
|
+
return e !== null && e.charCodeAt(0) === he && (e = e.substr(1)), n !== null && n.charCodeAt(0) === he && (n = n.substr(1)), {
|
|
1182
|
+
type: "AnPlusB",
|
|
1183
|
+
loc: this.getLocation(t, this.tokenStart),
|
|
1184
|
+
a: e,
|
|
1185
|
+
b: n
|
|
1186
|
+
};
|
|
1187
|
+
}
|
|
1188
|
+
function Vi(t) {
|
|
1189
|
+
if (t.a) {
|
|
1190
|
+
const e = t.a === "+1" && "n" || t.a === "1" && "n" || t.a === "-1" && "-n" || t.a + "n";
|
|
1191
|
+
if (t.b) {
|
|
1192
|
+
const n = t.b[0] === "-" || t.b[0] === "+" ? t.b : "+" + t.b;
|
|
1193
|
+
this.tokenize(e + n);
|
|
1194
|
+
} else
|
|
1195
|
+
this.tokenize(e);
|
|
1196
|
+
} else
|
|
1197
|
+
this.tokenize(t.b);
|
|
1198
|
+
}
|
|
1199
|
+
const Gi = 36, Mr = 42, dt = 61, Hi = 94, cn = 124, Wi = 126;
|
|
1200
|
+
function Ki() {
|
|
1201
|
+
this.eof && this.error("Unexpected end of input");
|
|
1202
|
+
const t = this.tokenStart;
|
|
1203
|
+
let e = !1;
|
|
1204
|
+
return this.isDelim(Mr) ? (e = !0, this.next()) : this.isDelim(cn) || this.eat(k), this.isDelim(cn) ? this.charCodeAt(this.tokenStart + 1) !== dt ? (this.next(), this.eat(k)) : e && this.error("Identifier is expected", this.tokenEnd) : e && this.error("Vertical line is expected"), {
|
|
1205
|
+
type: "Identifier",
|
|
1206
|
+
loc: this.getLocation(t, this.tokenStart),
|
|
1207
|
+
name: this.substrToCursor(t)
|
|
1208
|
+
};
|
|
1209
|
+
}
|
|
1210
|
+
function Qi() {
|
|
1211
|
+
const t = this.tokenStart, e = this.charCodeAt(t);
|
|
1212
|
+
return e !== dt && // =
|
|
1213
|
+
e !== Wi && // ~=
|
|
1214
|
+
e !== Hi && // ^=
|
|
1215
|
+
e !== Gi && // $=
|
|
1216
|
+
e !== Mr && // *=
|
|
1217
|
+
e !== cn && this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected"), this.next(), e !== dt && (this.isDelim(dt) || this.error("Equal sign is expected"), this.next()), this.substrToCursor(t);
|
|
1218
|
+
}
|
|
1219
|
+
function Ji() {
|
|
1220
|
+
const t = this.tokenStart;
|
|
1221
|
+
let e, n = null, r = null, i = null;
|
|
1222
|
+
return this.eat(bt), this.skipSC(), e = Ki.call(this), this.skipSC(), this.tokenType !== mt && (this.tokenType !== k && (n = Qi.call(this), this.skipSC(), r = this.tokenType === Re ? this.String() : this.Identifier(), this.skipSC()), this.tokenType === k && (i = this.consume(k), this.skipSC())), this.eat(mt), {
|
|
1223
|
+
type: "AttributeSelector",
|
|
1224
|
+
loc: this.getLocation(t, this.tokenStart),
|
|
1225
|
+
name: e,
|
|
1226
|
+
matcher: n,
|
|
1227
|
+
value: r,
|
|
1228
|
+
flags: i
|
|
1229
|
+
};
|
|
1230
|
+
}
|
|
1231
|
+
function Yi(t) {
|
|
1232
|
+
this.token($, "["), this.node(t.name), t.matcher !== null && (this.tokenize(t.matcher), this.node(t.value)), t.flags !== null && this.token(k, t.flags), this.token($, "]");
|
|
1233
|
+
}
|
|
1234
|
+
const Xi = 46;
|
|
1235
|
+
function Zi() {
|
|
1236
|
+
return this.eatDelim(Xi), {
|
|
1237
|
+
type: "ClassSelector",
|
|
1238
|
+
loc: this.getLocation(this.tokenStart - 1, this.tokenEnd),
|
|
1239
|
+
name: this.consume(k)
|
|
1240
|
+
};
|
|
1241
|
+
}
|
|
1242
|
+
function es(t) {
|
|
1243
|
+
this.token($, "."), this.token(k, t.name);
|
|
1244
|
+
}
|
|
1245
|
+
const ts = 43, dr = 47, ns = 62, rs = 126;
|
|
1246
|
+
function is() {
|
|
1247
|
+
const t = this.tokenStart;
|
|
1248
|
+
let e;
|
|
1249
|
+
switch (this.tokenType) {
|
|
1250
|
+
case J:
|
|
1251
|
+
e = " ";
|
|
1252
|
+
break;
|
|
1253
|
+
case $:
|
|
1254
|
+
switch (this.charCodeAt(this.tokenStart)) {
|
|
1255
|
+
case ns:
|
|
1256
|
+
case ts:
|
|
1257
|
+
case rs:
|
|
1258
|
+
this.next();
|
|
1259
|
+
break;
|
|
1260
|
+
case dr:
|
|
1261
|
+
this.next(), this.eatIdent("deep"), this.eatDelim(dr);
|
|
1262
|
+
break;
|
|
1263
|
+
default:
|
|
1264
|
+
this.error("Combinator is expected");
|
|
1265
|
+
}
|
|
1266
|
+
e = this.substrToCursor(t);
|
|
1267
|
+
break;
|
|
1268
|
+
}
|
|
1269
|
+
return {
|
|
1270
|
+
type: "Combinator",
|
|
1271
|
+
loc: this.getLocation(t, this.tokenStart),
|
|
1272
|
+
name: e
|
|
1273
|
+
};
|
|
1274
|
+
}
|
|
1275
|
+
function ss(t) {
|
|
1276
|
+
this.tokenize(t.name);
|
|
1277
|
+
}
|
|
1278
|
+
function os() {
|
|
1279
|
+
return {
|
|
1280
|
+
type: "Identifier",
|
|
1281
|
+
loc: this.getLocation(this.tokenStart, this.tokenEnd),
|
|
1282
|
+
name: this.consume(k)
|
|
1283
|
+
};
|
|
1284
|
+
}
|
|
1285
|
+
function as(t) {
|
|
1286
|
+
this.token(k, t.name);
|
|
1287
|
+
}
|
|
1288
|
+
function ls() {
|
|
1289
|
+
const t = this.tokenStart;
|
|
1290
|
+
return this.eat(z), {
|
|
1291
|
+
type: "IdSelector",
|
|
1292
|
+
loc: this.getLocation(t, this.tokenStart),
|
|
1293
|
+
name: this.substrToCursor(t + 1)
|
|
1294
|
+
};
|
|
1295
|
+
}
|
|
1296
|
+
function cs(t) {
|
|
1297
|
+
this.token($, "#" + t.name);
|
|
1298
|
+
}
|
|
1299
|
+
const us = 38;
|
|
1300
|
+
function hs() {
|
|
1301
|
+
const t = this.tokenStart;
|
|
1302
|
+
return this.eatDelim(us), {
|
|
1303
|
+
type: "NestingSelector",
|
|
1304
|
+
loc: this.getLocation(t, this.tokenStart)
|
|
1305
|
+
};
|
|
1306
|
+
}
|
|
1307
|
+
function fs() {
|
|
1308
|
+
this.token($, "&");
|
|
1309
|
+
}
|
|
1310
|
+
function ps() {
|
|
1311
|
+
this.skipSC();
|
|
1312
|
+
const t = this.tokenStart;
|
|
1313
|
+
let e = t, n = null, r;
|
|
1314
|
+
return this.lookupValue(0, "odd") || this.lookupValue(0, "even") ? r = this.Identifier() : r = this.AnPlusB(), e = this.tokenStart, this.skipSC(), this.lookupValue(0, "of") && (this.next(), n = this.SelectorList(), e = this.tokenStart), {
|
|
1315
|
+
type: "Nth",
|
|
1316
|
+
loc: this.getLocation(t, e),
|
|
1317
|
+
nth: r,
|
|
1318
|
+
selector: n
|
|
1319
|
+
};
|
|
1320
|
+
}
|
|
1321
|
+
function ds(t) {
|
|
1322
|
+
this.node(t.nth), t.selector !== null && (this.token(k, "of"), this.node(t.selector));
|
|
1323
|
+
}
|
|
1324
|
+
function ms() {
|
|
1325
|
+
const t = this.tokenStart;
|
|
1326
|
+
return this.next(), {
|
|
1327
|
+
type: "Operator",
|
|
1328
|
+
loc: this.getLocation(t, this.tokenStart),
|
|
1329
|
+
value: this.substrToCursor(t)
|
|
1330
|
+
};
|
|
1331
|
+
}
|
|
1332
|
+
function gs(t) {
|
|
1333
|
+
this.tokenize(t.value);
|
|
1334
|
+
}
|
|
1335
|
+
function ks() {
|
|
1336
|
+
return {
|
|
1337
|
+
type: "Percentage",
|
|
1338
|
+
loc: this.getLocation(this.tokenStart, this.tokenEnd),
|
|
1339
|
+
value: this.consumeNumber(M)
|
|
1340
|
+
};
|
|
1341
|
+
}
|
|
1342
|
+
function ys(t) {
|
|
1343
|
+
this.token(M, t.value + "%");
|
|
1344
|
+
}
|
|
1345
|
+
function Ss() {
|
|
1346
|
+
const t = this.tokenStart;
|
|
1347
|
+
let e = null, n, r;
|
|
1348
|
+
return this.eat(ee), this.tokenType === N ? (n = this.consumeFunctionName(), r = n.toLowerCase(), this.lookupNonWSType(0) == O ? e = this.createList() : hasOwnProperty.call(this.pseudo, r) ? (this.skipSC(), e = this.pseudo[r].call(this), this.skipSC()) : (e = this.createList(), e.push(
|
|
1349
|
+
this.Raw(null, !1)
|
|
1350
|
+
)), this.eat(O)) : n = this.consume(k), {
|
|
1351
|
+
type: "PseudoClassSelector",
|
|
1352
|
+
loc: this.getLocation(t, this.tokenStart),
|
|
1353
|
+
name: n,
|
|
1354
|
+
children: e
|
|
1355
|
+
};
|
|
1356
|
+
}
|
|
1357
|
+
function xs(t) {
|
|
1358
|
+
this.token(ee, ":"), t.children === null ? this.token(k, t.name) : (this.token(N, t.name + "("), this.children(t), this.token(O, ")"));
|
|
1359
|
+
}
|
|
1360
|
+
function Cs() {
|
|
1361
|
+
const t = this.tokenStart;
|
|
1362
|
+
let e = null, n, r;
|
|
1363
|
+
return this.eat(ee), this.eat(ee), this.tokenType === N ? (n = this.consumeFunctionName(), r = n.toLowerCase(), this.lookupNonWSType(0) == O ? e = this.createList() : hasOwnProperty.call(this.pseudo, r) ? (this.skipSC(), e = this.pseudo[r].call(this), this.skipSC()) : (e = this.createList(), e.push(
|
|
1364
|
+
this.Raw(null, !1)
|
|
1365
|
+
)), this.eat(O)) : n = this.consume(k), {
|
|
1366
|
+
type: "PseudoElementSelector",
|
|
1367
|
+
loc: this.getLocation(t, this.tokenStart),
|
|
1368
|
+
name: n,
|
|
1369
|
+
children: e
|
|
1370
|
+
};
|
|
1371
|
+
}
|
|
1372
|
+
function bs(t) {
|
|
1373
|
+
this.token(ee, ":"), this.token(ee, ":"), t.children === null ? this.token(k, t.name) : (this.token(N, t.name + "("), this.children(t), this.token(O, ")"));
|
|
1374
|
+
}
|
|
1375
|
+
function ws() {
|
|
1376
|
+
return this.tokenIndex > 0 && this.lookupType(-1) === J ? this.tokenIndex > 1 ? this.getTokenStart(this.tokenIndex - 1) : this.firstCharOffset : this.tokenStart;
|
|
1377
|
+
}
|
|
1378
|
+
function vs(t, e) {
|
|
1379
|
+
const n = this.getTokenStart(this.tokenIndex);
|
|
1380
|
+
let r;
|
|
1381
|
+
return this.skipUntilBalanced(this.tokenIndex, t || this.consumeUntilBalanceEnd), e && this.tokenStart > n ? r = ws.call(this) : r = this.tokenStart, {
|
|
1382
|
+
type: "Raw",
|
|
1383
|
+
loc: this.getLocation(n, r),
|
|
1384
|
+
value: this.substring(n, r)
|
|
1385
|
+
};
|
|
1386
|
+
}
|
|
1387
|
+
function As(t) {
|
|
1388
|
+
this.tokenize(t.value);
|
|
1389
|
+
}
|
|
1390
|
+
function Ls() {
|
|
1391
|
+
const t = this.readSequence(this.scope.Selector);
|
|
1392
|
+
return this.getFirstListNode(t) === null && this.error("Selector is expected"), {
|
|
1393
|
+
type: "Selector",
|
|
1394
|
+
loc: this.getLocationFromList(t),
|
|
1395
|
+
children: t
|
|
1396
|
+
};
|
|
1397
|
+
}
|
|
1398
|
+
function Es(t) {
|
|
1399
|
+
this.children(t);
|
|
1400
|
+
}
|
|
1401
|
+
function _s() {
|
|
1402
|
+
const t = this.createList();
|
|
1403
|
+
for (; !this.eof; ) {
|
|
1404
|
+
if (t.push(this.Selector()), this.tokenType === qe) {
|
|
1405
|
+
this.next();
|
|
1406
|
+
continue;
|
|
1407
|
+
}
|
|
1408
|
+
break;
|
|
1409
|
+
}
|
|
1410
|
+
return {
|
|
1411
|
+
type: "SelectorList",
|
|
1412
|
+
loc: this.getLocationFromList(t),
|
|
1413
|
+
children: t
|
|
1414
|
+
};
|
|
1415
|
+
}
|
|
1416
|
+
function Ts(t) {
|
|
1417
|
+
this.children(t, () => this.token(qe, ","));
|
|
1418
|
+
}
|
|
1419
|
+
const un = 92, Fr = 34, Os = 39;
|
|
1420
|
+
function Is(t) {
|
|
1421
|
+
const e = t.length, n = t.charCodeAt(0), r = n === Fr || n === Os ? 1 : 0, i = r === 1 && e > 1 && t.charCodeAt(e - 1) === n ? e - 2 : e - 1;
|
|
1422
|
+
let o = "";
|
|
1423
|
+
for (let a = r; a <= i; a++) {
|
|
1424
|
+
let f = t.charCodeAt(a);
|
|
1425
|
+
if (f === un) {
|
|
1426
|
+
if (a === i) {
|
|
1427
|
+
a !== e - 1 && (o = t.substr(a + 1));
|
|
1428
|
+
break;
|
|
1429
|
+
}
|
|
1430
|
+
if (f = t.charCodeAt(++a), ye(un, f)) {
|
|
1431
|
+
const c = a - 1, s = Qe(t, c);
|
|
1432
|
+
a = s - 1, o += gi(t.substring(c + 1, s));
|
|
1433
|
+
} else
|
|
1434
|
+
f === 13 && t.charCodeAt(a + 1) === 10 && a++;
|
|
1435
|
+
} else
|
|
1436
|
+
o += t[a];
|
|
1437
|
+
}
|
|
1438
|
+
return o;
|
|
1439
|
+
}
|
|
1440
|
+
function $s(t, e) {
|
|
1441
|
+
const n = '"', r = Fr;
|
|
1442
|
+
let i = "", o = !1;
|
|
1443
|
+
for (let a = 0; a < t.length; a++) {
|
|
1444
|
+
const f = t.charCodeAt(a);
|
|
1445
|
+
if (f === 0) {
|
|
1446
|
+
i += "�";
|
|
1447
|
+
continue;
|
|
1448
|
+
}
|
|
1449
|
+
if (f <= 31 || f === 127) {
|
|
1450
|
+
i += "\\" + f.toString(16), o = !0;
|
|
1451
|
+
continue;
|
|
1452
|
+
}
|
|
1453
|
+
f === r || f === un ? (i += "\\" + t.charAt(a), o = !1) : (o && (Ke(f) || Ye(f)) && (i += " "), i += t.charAt(a), o = !1);
|
|
1454
|
+
}
|
|
1455
|
+
return n + i + n;
|
|
1456
|
+
}
|
|
1457
|
+
function Ns() {
|
|
1458
|
+
return {
|
|
1459
|
+
type: "String",
|
|
1460
|
+
loc: this.getLocation(this.tokenStart, this.tokenEnd),
|
|
1461
|
+
value: Is(this.consume(Re))
|
|
1462
|
+
};
|
|
1463
|
+
}
|
|
1464
|
+
function Ds(t) {
|
|
1465
|
+
this.token(Re, $s(t.value));
|
|
1466
|
+
}
|
|
1467
|
+
const Ps = 42, mr = 124;
|
|
1468
|
+
function tn() {
|
|
1469
|
+
this.tokenType !== k && this.isDelim(Ps) === !1 && this.error("Identifier or asterisk is expected"), this.next();
|
|
1470
|
+
}
|
|
1471
|
+
function Ms() {
|
|
1472
|
+
const t = this.tokenStart;
|
|
1473
|
+
return this.isDelim(mr) ? (this.next(), tn.call(this)) : (tn.call(this), this.isDelim(mr) && (this.next(), tn.call(this))), {
|
|
1474
|
+
type: "TypeSelector",
|
|
1475
|
+
loc: this.getLocation(t, this.tokenStart),
|
|
1476
|
+
name: this.substrToCursor(t)
|
|
1477
|
+
};
|
|
1478
|
+
}
|
|
1479
|
+
function Fs(t) {
|
|
1480
|
+
this.tokenize(t.name);
|
|
1481
|
+
}
|
|
1482
|
+
const zs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1483
|
+
__proto__: null,
|
|
1484
|
+
AnPlusB: Ui,
|
|
1485
|
+
AttributeSelector: Ji,
|
|
1486
|
+
ClassSelector: Zi,
|
|
1487
|
+
Combinator: is,
|
|
1488
|
+
IdSelector: ls,
|
|
1489
|
+
Identifier: os,
|
|
1490
|
+
NestingSelector: hs,
|
|
1491
|
+
Nth: ps,
|
|
1492
|
+
Operator: ms,
|
|
1493
|
+
Percentage: ks,
|
|
1494
|
+
PseudoClassSelector: Ss,
|
|
1495
|
+
PseudoElementSelector: Cs,
|
|
1496
|
+
Raw: vs,
|
|
1497
|
+
Selector: Ls,
|
|
1498
|
+
SelectorList: _s,
|
|
1499
|
+
String: Ns,
|
|
1500
|
+
TypeSelector: Ms
|
|
1501
|
+
}, Symbol.toStringTag, { value: "Module" })), Rs = {
|
|
1502
|
+
parseContext: {
|
|
1503
|
+
default: "SelectorList",
|
|
1504
|
+
selectorList: "SelectorList",
|
|
1505
|
+
selector: "Selector"
|
|
1506
|
+
},
|
|
1507
|
+
scope: { Selector: Fi },
|
|
1508
|
+
atrule: {},
|
|
1509
|
+
pseudo: Bi,
|
|
1510
|
+
node: zs
|
|
1511
|
+
}, gr = Li(Rs);
|
|
1512
|
+
var yn = {}, Sn = {}, kr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
|
|
1513
|
+
Sn.encode = function(t) {
|
|
1514
|
+
if (0 <= t && t < kr.length)
|
|
1515
|
+
return kr[t];
|
|
1516
|
+
throw new TypeError("Must be between 0 and 63: " + t);
|
|
1517
|
+
};
|
|
1518
|
+
Sn.decode = function(t) {
|
|
1519
|
+
var e = 65, n = 90, r = 97, i = 122, o = 48, a = 57, f = 43, c = 47, s = 26, l = 52;
|
|
1520
|
+
return e <= t && t <= n ? t - e : r <= t && t <= i ? t - r + s : o <= t && t <= a ? t - o + l : t == f ? 62 : t == c ? 63 : -1;
|
|
1521
|
+
};
|
|
1522
|
+
var zr = Sn, xn = 5, Rr = 1 << xn, qr = Rr - 1, Br = Rr;
|
|
1523
|
+
function qs(t) {
|
|
1524
|
+
return t < 0 ? (-t << 1) + 1 : (t << 1) + 0;
|
|
1525
|
+
}
|
|
1526
|
+
function Bs(t) {
|
|
1527
|
+
var e = (t & 1) === 1, n = t >> 1;
|
|
1528
|
+
return e ? -n : n;
|
|
1529
|
+
}
|
|
1530
|
+
yn.encode = function(e) {
|
|
1531
|
+
var n = "", r, i = qs(e);
|
|
1532
|
+
do
|
|
1533
|
+
r = i & qr, i >>>= xn, i > 0 && (r |= Br), n += zr.encode(r);
|
|
1534
|
+
while (i > 0);
|
|
1535
|
+
return n;
|
|
1536
|
+
};
|
|
1537
|
+
yn.decode = function(e, n, r) {
|
|
1538
|
+
var i = e.length, o = 0, a = 0, f, c;
|
|
1539
|
+
do {
|
|
1540
|
+
if (n >= i)
|
|
1541
|
+
throw new Error("Expected more digits in base 64 VLQ value.");
|
|
1542
|
+
if (c = zr.decode(e.charCodeAt(n++)), c === -1)
|
|
1543
|
+
throw new Error("Invalid base64 digit: " + e.charAt(n - 1));
|
|
1544
|
+
f = !!(c & Br), c &= qr, o = o + (c << a), a += xn;
|
|
1545
|
+
} while (f);
|
|
1546
|
+
r.value = Bs(o), r.rest = n;
|
|
1547
|
+
};
|
|
1548
|
+
var wt = {};
|
|
1549
|
+
(function(t) {
|
|
1550
|
+
function e(u, h, g) {
|
|
1551
|
+
if (h in u)
|
|
1552
|
+
return u[h];
|
|
1553
|
+
if (arguments.length === 3)
|
|
1554
|
+
return g;
|
|
1555
|
+
throw new Error('"' + h + '" is a required argument.');
|
|
1556
|
+
}
|
|
1557
|
+
t.getArg = e;
|
|
1558
|
+
var n = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/, r = /^data:.+\,.+$/;
|
|
1559
|
+
function i(u) {
|
|
1560
|
+
var h = u.match(n);
|
|
1561
|
+
return h ? {
|
|
1562
|
+
scheme: h[1],
|
|
1563
|
+
auth: h[2],
|
|
1564
|
+
host: h[3],
|
|
1565
|
+
port: h[4],
|
|
1566
|
+
path: h[5]
|
|
1567
|
+
} : null;
|
|
1568
|
+
}
|
|
1569
|
+
t.urlParse = i;
|
|
1570
|
+
function o(u) {
|
|
1571
|
+
var h = "";
|
|
1572
|
+
return u.scheme && (h += u.scheme + ":"), h += "//", u.auth && (h += u.auth + "@"), u.host && (h += u.host), u.port && (h += ":" + u.port), u.path && (h += u.path), h;
|
|
1573
|
+
}
|
|
1574
|
+
t.urlGenerate = o;
|
|
1575
|
+
var a = 32;
|
|
1576
|
+
function f(u) {
|
|
1577
|
+
var h = [];
|
|
1578
|
+
return function(g) {
|
|
1579
|
+
for (var p = 0; p < h.length; p++)
|
|
1580
|
+
if (h[p].input === g) {
|
|
1581
|
+
var X = h[0];
|
|
1582
|
+
return h[0] = h[p], h[p] = X, h[0].result;
|
|
1583
|
+
}
|
|
1584
|
+
var j = u(g);
|
|
1585
|
+
return h.unshift({
|
|
1586
|
+
input: g,
|
|
1587
|
+
result: j
|
|
1588
|
+
}), h.length > a && h.pop(), j;
|
|
1589
|
+
};
|
|
1590
|
+
}
|
|
1591
|
+
var c = f(function(h) {
|
|
1592
|
+
var g = h, p = i(h);
|
|
1593
|
+
if (p) {
|
|
1594
|
+
if (!p.path)
|
|
1595
|
+
return h;
|
|
1596
|
+
g = p.path;
|
|
1597
|
+
}
|
|
1598
|
+
for (var X = t.isAbsolute(g), j = [], xe = 0, R = 0; ; )
|
|
1599
|
+
if (xe = R, R = g.indexOf("/", xe), R === -1) {
|
|
1600
|
+
j.push(g.slice(xe));
|
|
1601
|
+
break;
|
|
1602
|
+
} else
|
|
1603
|
+
for (j.push(g.slice(xe, R)); R < g.length && g[R] === "/"; )
|
|
1604
|
+
R++;
|
|
1605
|
+
for (var Ce, ge = 0, R = j.length - 1; R >= 0; R--)
|
|
1606
|
+
Ce = j[R], Ce === "." ? j.splice(R, 1) : Ce === ".." ? ge++ : ge > 0 && (Ce === "" ? (j.splice(R + 1, ge), ge = 0) : (j.splice(R, 2), ge--));
|
|
1607
|
+
return g = j.join("/"), g === "" && (g = X ? "/" : "."), p ? (p.path = g, o(p)) : g;
|
|
1608
|
+
});
|
|
1609
|
+
t.normalize = c;
|
|
1610
|
+
function s(u, h) {
|
|
1611
|
+
u === "" && (u = "."), h === "" && (h = ".");
|
|
1612
|
+
var g = i(h), p = i(u);
|
|
1613
|
+
if (p && (u = p.path || "/"), g && !g.scheme)
|
|
1614
|
+
return p && (g.scheme = p.scheme), o(g);
|
|
1615
|
+
if (g || h.match(r))
|
|
1616
|
+
return h;
|
|
1617
|
+
if (p && !p.host && !p.path)
|
|
1618
|
+
return p.host = h, o(p);
|
|
1619
|
+
var X = h.charAt(0) === "/" ? h : c(u.replace(/\/+$/, "") + "/" + h);
|
|
1620
|
+
return p ? (p.path = X, o(p)) : X;
|
|
1621
|
+
}
|
|
1622
|
+
t.join = s, t.isAbsolute = function(u) {
|
|
1623
|
+
return u.charAt(0) === "/" || n.test(u);
|
|
1624
|
+
};
|
|
1625
|
+
function l(u, h) {
|
|
1626
|
+
u === "" && (u = "."), u = u.replace(/\/$/, "");
|
|
1627
|
+
for (var g = 0; h.indexOf(u + "/") !== 0; ) {
|
|
1628
|
+
var p = u.lastIndexOf("/");
|
|
1629
|
+
if (p < 0 || (u = u.slice(0, p), u.match(/^([^\/]+:\/)?\/*$/)))
|
|
1630
|
+
return h;
|
|
1631
|
+
++g;
|
|
1632
|
+
}
|
|
1633
|
+
return Array(g + 1).join("../") + h.substr(u.length + 1);
|
|
1634
|
+
}
|
|
1635
|
+
t.relative = l;
|
|
1636
|
+
var m = function() {
|
|
1637
|
+
var u = /* @__PURE__ */ Object.create(null);
|
|
1638
|
+
return !("__proto__" in u);
|
|
1639
|
+
}();
|
|
1640
|
+
function y(u) {
|
|
1641
|
+
return u;
|
|
1642
|
+
}
|
|
1643
|
+
function C(u) {
|
|
1644
|
+
return q(u) ? "$" + u : u;
|
|
1645
|
+
}
|
|
1646
|
+
t.toSetString = m ? y : C;
|
|
1647
|
+
function _(u) {
|
|
1648
|
+
return q(u) ? u.slice(1) : u;
|
|
1649
|
+
}
|
|
1650
|
+
t.fromSetString = m ? y : _;
|
|
1651
|
+
function q(u) {
|
|
1652
|
+
if (!u)
|
|
1653
|
+
return !1;
|
|
1654
|
+
var h = u.length;
|
|
1655
|
+
if (h < 9 || u.charCodeAt(h - 1) !== 95 || u.charCodeAt(h - 2) !== 95 || u.charCodeAt(h - 3) !== 111 || u.charCodeAt(h - 4) !== 116 || u.charCodeAt(h - 5) !== 111 || u.charCodeAt(h - 6) !== 114 || u.charCodeAt(h - 7) !== 112 || u.charCodeAt(h - 8) !== 95 || u.charCodeAt(h - 9) !== 95)
|
|
1656
|
+
return !1;
|
|
1657
|
+
for (var g = h - 10; g >= 0; g--)
|
|
1658
|
+
if (u.charCodeAt(g) !== 36)
|
|
1659
|
+
return !1;
|
|
1660
|
+
return !0;
|
|
1661
|
+
}
|
|
1662
|
+
function V(u, h, g) {
|
|
1663
|
+
var p = Y(u.source, h.source);
|
|
1664
|
+
return p !== 0 || (p = u.originalLine - h.originalLine, p !== 0) || (p = u.originalColumn - h.originalColumn, p !== 0 || g) || (p = u.generatedColumn - h.generatedColumn, p !== 0) || (p = u.generatedLine - h.generatedLine, p !== 0) ? p : Y(u.name, h.name);
|
|
1665
|
+
}
|
|
1666
|
+
t.compareByOriginalPositions = V;
|
|
1667
|
+
function me(u, h, g) {
|
|
1668
|
+
var p;
|
|
1669
|
+
return p = u.originalLine - h.originalLine, p !== 0 || (p = u.originalColumn - h.originalColumn, p !== 0 || g) || (p = u.generatedColumn - h.generatedColumn, p !== 0) || (p = u.generatedLine - h.generatedLine, p !== 0) ? p : Y(u.name, h.name);
|
|
1670
|
+
}
|
|
1671
|
+
t.compareByOriginalPositionsNoSource = me;
|
|
1672
|
+
function Oe(u, h, g) {
|
|
1673
|
+
var p = u.generatedLine - h.generatedLine;
|
|
1674
|
+
return p !== 0 || (p = u.generatedColumn - h.generatedColumn, p !== 0 || g) || (p = Y(u.source, h.source), p !== 0) || (p = u.originalLine - h.originalLine, p !== 0) || (p = u.originalColumn - h.originalColumn, p !== 0) ? p : Y(u.name, h.name);
|
|
1675
|
+
}
|
|
1676
|
+
t.compareByGeneratedPositionsDeflated = Oe;
|
|
1677
|
+
function Be(u, h, g) {
|
|
1678
|
+
var p = u.generatedColumn - h.generatedColumn;
|
|
1679
|
+
return p !== 0 || g || (p = Y(u.source, h.source), p !== 0) || (p = u.originalLine - h.originalLine, p !== 0) || (p = u.originalColumn - h.originalColumn, p !== 0) ? p : Y(u.name, h.name);
|
|
1680
|
+
}
|
|
1681
|
+
t.compareByGeneratedPositionsDeflatedNoLine = Be;
|
|
1682
|
+
function Y(u, h) {
|
|
1683
|
+
return u === h ? 0 : u === null ? 1 : h === null ? -1 : u > h ? 1 : -1;
|
|
1684
|
+
}
|
|
1685
|
+
function Ze(u, h) {
|
|
1686
|
+
var g = u.generatedLine - h.generatedLine;
|
|
1687
|
+
return g !== 0 || (g = u.generatedColumn - h.generatedColumn, g !== 0) || (g = Y(u.source, h.source), g !== 0) || (g = u.originalLine - h.originalLine, g !== 0) || (g = u.originalColumn - h.originalColumn, g !== 0) ? g : Y(u.name, h.name);
|
|
1688
|
+
}
|
|
1689
|
+
t.compareByGeneratedPositionsInflated = Ze;
|
|
1690
|
+
function et(u) {
|
|
1691
|
+
return JSON.parse(u.replace(/^\)]}'[^\n]*\n/, ""));
|
|
1692
|
+
}
|
|
1693
|
+
t.parseSourceMapInput = et;
|
|
1694
|
+
function tt(u, h, g) {
|
|
1695
|
+
if (h = h || "", u && (u[u.length - 1] !== "/" && h[0] !== "/" && (u += "/"), h = u + h), g) {
|
|
1696
|
+
var p = i(g);
|
|
1697
|
+
if (!p)
|
|
1698
|
+
throw new Error("sourceMapURL could not be parsed");
|
|
1699
|
+
if (p.path) {
|
|
1700
|
+
var X = p.path.lastIndexOf("/");
|
|
1701
|
+
X >= 0 && (p.path = p.path.substring(0, X + 1));
|
|
1702
|
+
}
|
|
1703
|
+
h = s(o(p), h);
|
|
1704
|
+
}
|
|
1705
|
+
return c(h);
|
|
1706
|
+
}
|
|
1707
|
+
t.computeSourceURL = tt;
|
|
1708
|
+
})(wt);
|
|
1709
|
+
var jr = {}, Cn = wt, bn = Object.prototype.hasOwnProperty, _e = typeof Map < "u";
|
|
1710
|
+
function Se() {
|
|
1711
|
+
this._array = [], this._set = _e ? /* @__PURE__ */ new Map() : /* @__PURE__ */ Object.create(null);
|
|
1712
|
+
}
|
|
1713
|
+
Se.fromArray = function(e, n) {
|
|
1714
|
+
for (var r = new Se(), i = 0, o = e.length; i < o; i++)
|
|
1715
|
+
r.add(e[i], n);
|
|
1716
|
+
return r;
|
|
1717
|
+
};
|
|
1718
|
+
Se.prototype.size = function() {
|
|
1719
|
+
return _e ? this._set.size : Object.getOwnPropertyNames(this._set).length;
|
|
1720
|
+
};
|
|
1721
|
+
Se.prototype.add = function(e, n) {
|
|
1722
|
+
var r = _e ? e : Cn.toSetString(e), i = _e ? this.has(e) : bn.call(this._set, r), o = this._array.length;
|
|
1723
|
+
(!i || n) && this._array.push(e), i || (_e ? this._set.set(e, o) : this._set[r] = o);
|
|
1724
|
+
};
|
|
1725
|
+
Se.prototype.has = function(e) {
|
|
1726
|
+
if (_e)
|
|
1727
|
+
return this._set.has(e);
|
|
1728
|
+
var n = Cn.toSetString(e);
|
|
1729
|
+
return bn.call(this._set, n);
|
|
1730
|
+
};
|
|
1731
|
+
Se.prototype.indexOf = function(e) {
|
|
1732
|
+
if (_e) {
|
|
1733
|
+
var n = this._set.get(e);
|
|
1734
|
+
if (n >= 0)
|
|
1735
|
+
return n;
|
|
1736
|
+
} else {
|
|
1737
|
+
var r = Cn.toSetString(e);
|
|
1738
|
+
if (bn.call(this._set, r))
|
|
1739
|
+
return this._set[r];
|
|
1740
|
+
}
|
|
1741
|
+
throw new Error('"' + e + '" is not in the set.');
|
|
1742
|
+
};
|
|
1743
|
+
Se.prototype.at = function(e) {
|
|
1744
|
+
if (e >= 0 && e < this._array.length)
|
|
1745
|
+
return this._array[e];
|
|
1746
|
+
throw new Error("No element indexed by " + e);
|
|
1747
|
+
};
|
|
1748
|
+
Se.prototype.toArray = function() {
|
|
1749
|
+
return this._array.slice();
|
|
1750
|
+
};
|
|
1751
|
+
jr.ArraySet = Se;
|
|
1752
|
+
var Ur = {}, Vr = wt;
|
|
1753
|
+
function js(t, e) {
|
|
1754
|
+
var n = t.generatedLine, r = e.generatedLine, i = t.generatedColumn, o = e.generatedColumn;
|
|
1755
|
+
return r > n || r == n && o >= i || Vr.compareByGeneratedPositionsInflated(t, e) <= 0;
|
|
1756
|
+
}
|
|
1757
|
+
function vt() {
|
|
1758
|
+
this._array = [], this._sorted = !0, this._last = { generatedLine: -1, generatedColumn: 0 };
|
|
1759
|
+
}
|
|
1760
|
+
vt.prototype.unsortedForEach = function(e, n) {
|
|
1761
|
+
this._array.forEach(e, n);
|
|
1762
|
+
};
|
|
1763
|
+
vt.prototype.add = function(e) {
|
|
1764
|
+
js(this._last, e) ? (this._last = e, this._array.push(e)) : (this._sorted = !1, this._array.push(e));
|
|
1765
|
+
};
|
|
1766
|
+
vt.prototype.toArray = function() {
|
|
1767
|
+
return this._sorted || (this._array.sort(Vr.compareByGeneratedPositionsInflated), this._sorted = !0), this._array;
|
|
1768
|
+
};
|
|
1769
|
+
Ur.MappingList = vt;
|
|
1770
|
+
var We = yn, P = wt, xt = jr.ArraySet, Us = Ur.MappingList;
|
|
1771
|
+
function ne(t) {
|
|
1772
|
+
t || (t = {}), this._file = P.getArg(t, "file", null), this._sourceRoot = P.getArg(t, "sourceRoot", null), this._skipValidation = P.getArg(t, "skipValidation", !1), this._ignoreInvalidMapping = P.getArg(t, "ignoreInvalidMapping", !1), this._sources = new xt(), this._names = new xt(), this._mappings = new Us(), this._sourcesContents = null;
|
|
1773
|
+
}
|
|
1774
|
+
ne.prototype._version = 3;
|
|
1775
|
+
ne.fromSourceMap = function(e, n) {
|
|
1776
|
+
var r = e.sourceRoot, i = new ne(Object.assign(n || {}, {
|
|
1777
|
+
file: e.file,
|
|
1778
|
+
sourceRoot: r
|
|
1779
|
+
}));
|
|
1780
|
+
return e.eachMapping(function(o) {
|
|
1781
|
+
var a = {
|
|
1782
|
+
generated: {
|
|
1783
|
+
line: o.generatedLine,
|
|
1784
|
+
column: o.generatedColumn
|
|
1785
|
+
}
|
|
1786
|
+
};
|
|
1787
|
+
o.source != null && (a.source = o.source, r != null && (a.source = P.relative(r, a.source)), a.original = {
|
|
1788
|
+
line: o.originalLine,
|
|
1789
|
+
column: o.originalColumn
|
|
1790
|
+
}, o.name != null && (a.name = o.name)), i.addMapping(a);
|
|
1791
|
+
}), e.sources.forEach(function(o) {
|
|
1792
|
+
var a = o;
|
|
1793
|
+
r !== null && (a = P.relative(r, o)), i._sources.has(a) || i._sources.add(a);
|
|
1794
|
+
var f = e.sourceContentFor(o);
|
|
1795
|
+
f != null && i.setSourceContent(o, f);
|
|
1796
|
+
}), i;
|
|
1797
|
+
};
|
|
1798
|
+
ne.prototype.addMapping = function(e) {
|
|
1799
|
+
var n = P.getArg(e, "generated"), r = P.getArg(e, "original", null), i = P.getArg(e, "source", null), o = P.getArg(e, "name", null);
|
|
1800
|
+
!this._skipValidation && this._validateMapping(n, r, i, o) === !1 || (i != null && (i = String(i), this._sources.has(i) || this._sources.add(i)), o != null && (o = String(o), this._names.has(o) || this._names.add(o)), this._mappings.add({
|
|
1801
|
+
generatedLine: n.line,
|
|
1802
|
+
generatedColumn: n.column,
|
|
1803
|
+
originalLine: r != null && r.line,
|
|
1804
|
+
originalColumn: r != null && r.column,
|
|
1805
|
+
source: i,
|
|
1806
|
+
name: o
|
|
1807
|
+
}));
|
|
1808
|
+
};
|
|
1809
|
+
ne.prototype.setSourceContent = function(e, n) {
|
|
1810
|
+
var r = e;
|
|
1811
|
+
this._sourceRoot != null && (r = P.relative(this._sourceRoot, r)), n != null ? (this._sourcesContents || (this._sourcesContents = /* @__PURE__ */ Object.create(null)), this._sourcesContents[P.toSetString(r)] = n) : this._sourcesContents && (delete this._sourcesContents[P.toSetString(r)], Object.keys(this._sourcesContents).length === 0 && (this._sourcesContents = null));
|
|
1812
|
+
};
|
|
1813
|
+
ne.prototype.applySourceMap = function(e, n, r) {
|
|
1814
|
+
var i = n;
|
|
1815
|
+
if (n == null) {
|
|
1816
|
+
if (e.file == null)
|
|
1817
|
+
throw new Error(
|
|
1818
|
+
`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`
|
|
1819
|
+
);
|
|
1820
|
+
i = e.file;
|
|
1821
|
+
}
|
|
1822
|
+
var o = this._sourceRoot;
|
|
1823
|
+
o != null && (i = P.relative(o, i));
|
|
1824
|
+
var a = new xt(), f = new xt();
|
|
1825
|
+
this._mappings.unsortedForEach(function(c) {
|
|
1826
|
+
if (c.source === i && c.originalLine != null) {
|
|
1827
|
+
var s = e.originalPositionFor({
|
|
1828
|
+
line: c.originalLine,
|
|
1829
|
+
column: c.originalColumn
|
|
1830
|
+
});
|
|
1831
|
+
s.source != null && (c.source = s.source, r != null && (c.source = P.join(r, c.source)), o != null && (c.source = P.relative(o, c.source)), c.originalLine = s.line, c.originalColumn = s.column, s.name != null && (c.name = s.name));
|
|
1832
|
+
}
|
|
1833
|
+
var l = c.source;
|
|
1834
|
+
l != null && !a.has(l) && a.add(l);
|
|
1835
|
+
var m = c.name;
|
|
1836
|
+
m != null && !f.has(m) && f.add(m);
|
|
1837
|
+
}, this), this._sources = a, this._names = f, e.sources.forEach(function(c) {
|
|
1838
|
+
var s = e.sourceContentFor(c);
|
|
1839
|
+
s != null && (r != null && (c = P.join(r, c)), o != null && (c = P.relative(o, c)), this.setSourceContent(c, s));
|
|
1840
|
+
}, this);
|
|
1841
|
+
};
|
|
1842
|
+
ne.prototype._validateMapping = function(e, n, r, i) {
|
|
1843
|
+
if (n && typeof n.line != "number" && typeof n.column != "number") {
|
|
1844
|
+
var o = "original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.";
|
|
1845
|
+
if (this._ignoreInvalidMapping)
|
|
1846
|
+
return typeof console < "u" && console.warn && console.warn(o), !1;
|
|
1847
|
+
throw new Error(o);
|
|
1848
|
+
}
|
|
1849
|
+
if (!(e && "line" in e && "column" in e && e.line > 0 && e.column >= 0 && !n && !r && !i)) {
|
|
1850
|
+
if (e && "line" in e && "column" in e && n && "line" in n && "column" in n && e.line > 0 && e.column >= 0 && n.line > 0 && n.column >= 0 && r)
|
|
1851
|
+
return;
|
|
1852
|
+
var o = "Invalid mapping: " + JSON.stringify({
|
|
1853
|
+
generated: e,
|
|
1854
|
+
source: r,
|
|
1855
|
+
original: n,
|
|
1856
|
+
name: i
|
|
1857
|
+
});
|
|
1858
|
+
if (this._ignoreInvalidMapping)
|
|
1859
|
+
return typeof console < "u" && console.warn && console.warn(o), !1;
|
|
1860
|
+
throw new Error(o);
|
|
1861
|
+
}
|
|
1862
|
+
};
|
|
1863
|
+
ne.prototype._serializeMappings = function() {
|
|
1864
|
+
for (var e = 0, n = 1, r = 0, i = 0, o = 0, a = 0, f = "", c, s, l, m, y = this._mappings.toArray(), C = 0, _ = y.length; C < _; C++) {
|
|
1865
|
+
if (s = y[C], c = "", s.generatedLine !== n)
|
|
1866
|
+
for (e = 0; s.generatedLine !== n; )
|
|
1867
|
+
c += ";", n++;
|
|
1868
|
+
else if (C > 0) {
|
|
1869
|
+
if (!P.compareByGeneratedPositionsInflated(s, y[C - 1]))
|
|
1870
|
+
continue;
|
|
1871
|
+
c += ",";
|
|
1872
|
+
}
|
|
1873
|
+
c += We.encode(s.generatedColumn - e), e = s.generatedColumn, s.source != null && (m = this._sources.indexOf(s.source), c += We.encode(m - a), a = m, c += We.encode(s.originalLine - 1 - i), i = s.originalLine - 1, c += We.encode(s.originalColumn - r), r = s.originalColumn, s.name != null && (l = this._names.indexOf(s.name), c += We.encode(l - o), o = l)), f += c;
|
|
1874
|
+
}
|
|
1875
|
+
return f;
|
|
1876
|
+
};
|
|
1877
|
+
ne.prototype._generateSourcesContent = function(e, n) {
|
|
1878
|
+
return e.map(function(r) {
|
|
1879
|
+
if (!this._sourcesContents)
|
|
1880
|
+
return null;
|
|
1881
|
+
n != null && (r = P.relative(n, r));
|
|
1882
|
+
var i = P.toSetString(r);
|
|
1883
|
+
return Object.prototype.hasOwnProperty.call(this._sourcesContents, i) ? this._sourcesContents[i] : null;
|
|
1884
|
+
}, this);
|
|
1885
|
+
};
|
|
1886
|
+
ne.prototype.toJSON = function() {
|
|
1887
|
+
var e = {
|
|
1888
|
+
version: this._version,
|
|
1889
|
+
sources: this._sources.toArray(),
|
|
1890
|
+
names: this._names.toArray(),
|
|
1891
|
+
mappings: this._serializeMappings()
|
|
1892
|
+
};
|
|
1893
|
+
return this._file != null && (e.file = this._file), this._sourceRoot != null && (e.sourceRoot = this._sourceRoot), this._sourcesContents && (e.sourcesContent = this._generateSourcesContent(e.sources, e.sourceRoot)), e;
|
|
1894
|
+
};
|
|
1895
|
+
ne.prototype.toString = function() {
|
|
1896
|
+
return JSON.stringify(this.toJSON());
|
|
1897
|
+
};
|
|
1898
|
+
var Vs = ne;
|
|
1899
|
+
const yr = /* @__PURE__ */ new Set(["Atrule", "Selector", "Declaration"]);
|
|
1900
|
+
function Gs(t) {
|
|
1901
|
+
const e = new Vs(), n = {
|
|
1902
|
+
line: 1,
|
|
1903
|
+
column: 0
|
|
1904
|
+
}, r = {
|
|
1905
|
+
line: 0,
|
|
1906
|
+
// should be zero to add first mapping
|
|
1907
|
+
column: 0
|
|
1908
|
+
}, i = {
|
|
1909
|
+
line: 1,
|
|
1910
|
+
column: 0
|
|
1911
|
+
}, o = {
|
|
1912
|
+
generated: i
|
|
1913
|
+
};
|
|
1914
|
+
let a = 1, f = 0, c = !1;
|
|
1915
|
+
const s = t.node;
|
|
1916
|
+
t.node = function(y) {
|
|
1917
|
+
if (y.loc && y.loc.start && yr.has(y.type)) {
|
|
1918
|
+
const C = y.loc.start.line, _ = y.loc.start.column - 1;
|
|
1919
|
+
(r.line !== C || r.column !== _) && (r.line = C, r.column = _, n.line = a, n.column = f, c && (c = !1, (n.line !== i.line || n.column !== i.column) && e.addMapping(o)), c = !0, e.addMapping({
|
|
1920
|
+
source: y.loc.source,
|
|
1921
|
+
original: r,
|
|
1922
|
+
generated: n
|
|
1923
|
+
}));
|
|
1924
|
+
}
|
|
1925
|
+
s.call(this, y), c && yr.has(y.type) && (i.line = a, i.column = f);
|
|
1926
|
+
};
|
|
1927
|
+
const l = t.emit;
|
|
1928
|
+
t.emit = function(y, C, _) {
|
|
1929
|
+
for (let q = 0; q < y.length; q++)
|
|
1930
|
+
y.charCodeAt(q) === 10 ? (a++, f = 0) : f++;
|
|
1931
|
+
l(y, C, _);
|
|
1932
|
+
};
|
|
1933
|
+
const m = t.result;
|
|
1934
|
+
return t.result = function() {
|
|
1935
|
+
return c && e.addMapping(o), {
|
|
1936
|
+
css: m(),
|
|
1937
|
+
map: e
|
|
1938
|
+
};
|
|
1939
|
+
}, t;
|
|
1940
|
+
}
|
|
1941
|
+
const Hs = 43, Ws = 45, nn = (t, e) => {
|
|
1942
|
+
if (t === $ && (t = e), typeof t == "string") {
|
|
1943
|
+
const n = t.charCodeAt(0);
|
|
1944
|
+
return n > 127 ? 32768 : n << 8;
|
|
1945
|
+
}
|
|
1946
|
+
return t;
|
|
1947
|
+
}, Gr = [
|
|
1948
|
+
[k, k],
|
|
1949
|
+
[k, N],
|
|
1950
|
+
[k, se],
|
|
1951
|
+
[k, oe],
|
|
1952
|
+
[k, "-"],
|
|
1953
|
+
[k, E],
|
|
1954
|
+
[k, M],
|
|
1955
|
+
[k, I],
|
|
1956
|
+
[k, ae],
|
|
1957
|
+
[k, te],
|
|
1958
|
+
[U, k],
|
|
1959
|
+
[U, N],
|
|
1960
|
+
[U, se],
|
|
1961
|
+
[U, oe],
|
|
1962
|
+
[U, "-"],
|
|
1963
|
+
[U, E],
|
|
1964
|
+
[U, M],
|
|
1965
|
+
[U, I],
|
|
1966
|
+
[U, ae],
|
|
1967
|
+
[z, k],
|
|
1968
|
+
[z, N],
|
|
1969
|
+
[z, se],
|
|
1970
|
+
[z, oe],
|
|
1971
|
+
[z, "-"],
|
|
1972
|
+
[z, E],
|
|
1973
|
+
[z, M],
|
|
1974
|
+
[z, I],
|
|
1975
|
+
[z, ae],
|
|
1976
|
+
[I, k],
|
|
1977
|
+
[I, N],
|
|
1978
|
+
[I, se],
|
|
1979
|
+
[I, oe],
|
|
1980
|
+
[I, "-"],
|
|
1981
|
+
[I, E],
|
|
1982
|
+
[I, M],
|
|
1983
|
+
[I, I],
|
|
1984
|
+
[I, ae],
|
|
1985
|
+
["#", k],
|
|
1986
|
+
["#", N],
|
|
1987
|
+
["#", se],
|
|
1988
|
+
["#", oe],
|
|
1989
|
+
["#", "-"],
|
|
1990
|
+
["#", E],
|
|
1991
|
+
["#", M],
|
|
1992
|
+
["#", I],
|
|
1993
|
+
["#", ae],
|
|
1994
|
+
// https://github.com/w3c/csswg-drafts/pull/6874
|
|
1995
|
+
["-", k],
|
|
1996
|
+
["-", N],
|
|
1997
|
+
["-", se],
|
|
1998
|
+
["-", oe],
|
|
1999
|
+
["-", "-"],
|
|
2000
|
+
["-", E],
|
|
2001
|
+
["-", M],
|
|
2002
|
+
["-", I],
|
|
2003
|
+
["-", ae],
|
|
2004
|
+
// https://github.com/w3c/csswg-drafts/pull/6874
|
|
2005
|
+
[E, k],
|
|
2006
|
+
[E, N],
|
|
2007
|
+
[E, se],
|
|
2008
|
+
[E, oe],
|
|
2009
|
+
[E, E],
|
|
2010
|
+
[E, M],
|
|
2011
|
+
[E, I],
|
|
2012
|
+
[E, "%"],
|
|
2013
|
+
[E, ae],
|
|
2014
|
+
// https://github.com/w3c/csswg-drafts/pull/6874
|
|
2015
|
+
["@", k],
|
|
2016
|
+
["@", N],
|
|
2017
|
+
["@", se],
|
|
2018
|
+
["@", oe],
|
|
2019
|
+
["@", "-"],
|
|
2020
|
+
["@", ae],
|
|
2021
|
+
// https://github.com/w3c/csswg-drafts/pull/6874
|
|
2022
|
+
[".", E],
|
|
2023
|
+
[".", M],
|
|
2024
|
+
[".", I],
|
|
2025
|
+
["+", E],
|
|
2026
|
+
["+", M],
|
|
2027
|
+
["+", I],
|
|
2028
|
+
["/", "*"]
|
|
2029
|
+
], Ks = Gr.concat([
|
|
2030
|
+
[k, z],
|
|
2031
|
+
[I, z],
|
|
2032
|
+
[z, z],
|
|
2033
|
+
[U, te],
|
|
2034
|
+
[U, Re],
|
|
2035
|
+
[U, ee],
|
|
2036
|
+
[M, M],
|
|
2037
|
+
[M, I],
|
|
2038
|
+
[M, N],
|
|
2039
|
+
[M, "-"],
|
|
2040
|
+
[O, k],
|
|
2041
|
+
[O, N],
|
|
2042
|
+
[O, M],
|
|
2043
|
+
[O, I],
|
|
2044
|
+
[O, z],
|
|
2045
|
+
[O, "-"]
|
|
2046
|
+
]);
|
|
2047
|
+
function Hr(t) {
|
|
2048
|
+
const e = new Set(
|
|
2049
|
+
t.map(([n, r]) => nn(n) << 16 | nn(r))
|
|
2050
|
+
);
|
|
2051
|
+
return function(n, r, i) {
|
|
2052
|
+
const o = nn(r, i), a = i.charCodeAt(0);
|
|
2053
|
+
return (a === Ws && r !== k && r !== N && r !== ae || a === Hs ? e.has(n << 16 | a << 8) : e.has(n << 16 | o)) && this.emit(" ", J, !0), o;
|
|
2054
|
+
};
|
|
2055
|
+
}
|
|
2056
|
+
const Qs = Hr(Gr), Wr = Hr(Ks), Sr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2057
|
+
__proto__: null,
|
|
2058
|
+
safe: Wr,
|
|
2059
|
+
spec: Qs
|
|
2060
|
+
}, Symbol.toStringTag, { value: "Module" })), Js = 92;
|
|
2061
|
+
function Ys(t, e) {
|
|
2062
|
+
if (typeof e == "function") {
|
|
2063
|
+
let n = null;
|
|
2064
|
+
t.children.forEach((r) => {
|
|
2065
|
+
n !== null && e.call(this, n), this.node(r), n = r;
|
|
2066
|
+
});
|
|
2067
|
+
return;
|
|
2068
|
+
}
|
|
2069
|
+
t.children.forEach(this.node, this);
|
|
2070
|
+
}
|
|
2071
|
+
function Xs(t) {
|
|
2072
|
+
Pr(t, (e, n, r) => {
|
|
2073
|
+
this.token(e, t.slice(n, r));
|
|
2074
|
+
});
|
|
2075
|
+
}
|
|
2076
|
+
function Zs(t) {
|
|
2077
|
+
const e = /* @__PURE__ */ new Map();
|
|
2078
|
+
for (let [n, r] of Object.entries(t.node))
|
|
2079
|
+
typeof (r.generate || r) == "function" && e.set(n, r.generate || r);
|
|
2080
|
+
return function(n, r) {
|
|
2081
|
+
let i = "", o = 0, a = {
|
|
2082
|
+
node(c) {
|
|
2083
|
+
if (e.has(c.type))
|
|
2084
|
+
e.get(c.type).call(f, c);
|
|
2085
|
+
else
|
|
2086
|
+
throw new Error("Unknown node type: " + c.type);
|
|
2087
|
+
},
|
|
2088
|
+
tokenBefore: Wr,
|
|
2089
|
+
token(c, s) {
|
|
2090
|
+
o = this.tokenBefore(o, c, s), this.emit(s, c, !1), c === $ && s.charCodeAt(0) === Js && this.emit(`
|
|
2091
|
+
`, J, !0);
|
|
2092
|
+
},
|
|
2093
|
+
emit(c) {
|
|
2094
|
+
i += c;
|
|
2095
|
+
},
|
|
2096
|
+
result() {
|
|
2097
|
+
return i;
|
|
2098
|
+
}
|
|
2099
|
+
};
|
|
2100
|
+
r && (typeof r.decorator == "function" && (a = r.decorator(a)), r.sourceMap && (a = Gs(a)), r.mode in Sr && (a.tokenBefore = Sr[r.mode]));
|
|
2101
|
+
const f = {
|
|
2102
|
+
node: (c) => a.node(c),
|
|
2103
|
+
children: Ys,
|
|
2104
|
+
token: (c, s) => a.token(c, s),
|
|
2105
|
+
tokenize: Xs
|
|
2106
|
+
};
|
|
2107
|
+
return a.node(n), a.result();
|
|
2108
|
+
};
|
|
2109
|
+
}
|
|
2110
|
+
function eo(t) {
|
|
2111
|
+
this.token(U, "@" + t.name), t.prelude !== null && this.node(t.prelude), t.block ? this.node(t.block) : this.token(Ct, ";");
|
|
2112
|
+
}
|
|
2113
|
+
function to(t) {
|
|
2114
|
+
this.children(t);
|
|
2115
|
+
}
|
|
2116
|
+
function no(t) {
|
|
2117
|
+
this.token(dn, "{"), this.children(t, (e) => {
|
|
2118
|
+
e.type === "Declaration" && this.token(Ct, ";");
|
|
2119
|
+
}), this.token(mn, "}");
|
|
2120
|
+
}
|
|
2121
|
+
function ro(t) {
|
|
2122
|
+
this.token($, "["), this.children(t), this.token($, "]");
|
|
2123
|
+
}
|
|
2124
|
+
function io() {
|
|
2125
|
+
this.token(ae, "-->");
|
|
2126
|
+
}
|
|
2127
|
+
function so() {
|
|
2128
|
+
this.token(Er, "<!--");
|
|
2129
|
+
}
|
|
2130
|
+
function oo(t) {
|
|
2131
|
+
this.token(fe, "/*" + t.value + "*/");
|
|
2132
|
+
}
|
|
2133
|
+
function ao(t) {
|
|
2134
|
+
t.children.forEach((e) => {
|
|
2135
|
+
e.type === "Condition" ? (this.token(te, "("), this.node(e), this.token(O, ")")) : this.node(e);
|
|
2136
|
+
});
|
|
2137
|
+
}
|
|
2138
|
+
function lo(t) {
|
|
2139
|
+
this.token(k, t.property), this.token(ee, ":"), this.node(t.value), t.important && (this.token($, "!"), this.token(k, t.important === !0 ? "important" : t.important));
|
|
2140
|
+
}
|
|
2141
|
+
function co(t) {
|
|
2142
|
+
this.children(t, (e) => {
|
|
2143
|
+
e.type === "Declaration" && this.token(Ct, ";");
|
|
2144
|
+
});
|
|
2145
|
+
}
|
|
2146
|
+
function uo(t) {
|
|
2147
|
+
this.token(I, t.value + t.unit);
|
|
2148
|
+
}
|
|
2149
|
+
function ho(t) {
|
|
2150
|
+
this.token(te, "("), this.token(k, t.name), t.value !== null && (this.token(ee, ":"), this.node(t.value)), this.token(O, ")");
|
|
2151
|
+
}
|
|
2152
|
+
function fo(t) {
|
|
2153
|
+
this.token(N, t.feature + "("), this.node(t.value), this.token(O, ")");
|
|
2154
|
+
}
|
|
2155
|
+
function po(t) {
|
|
2156
|
+
this.token(te, "("), this.node(t.left), this.tokenize(t.leftComparison), this.node(t.middle), t.right && (this.tokenize(t.rightComparison), this.node(t.right)), this.token(O, ")");
|
|
2157
|
+
}
|
|
2158
|
+
function mo(t) {
|
|
2159
|
+
this.token(N, t.name + "("), this.children(t), this.token(O, ")");
|
|
2160
|
+
}
|
|
2161
|
+
function go(t) {
|
|
2162
|
+
t.function ? this.token(N, t.function + "(") : this.token(te, "("), this.children(t), this.token(O, ")");
|
|
2163
|
+
}
|
|
2164
|
+
function ko(t) {
|
|
2165
|
+
this.token(z, "#" + t.value);
|
|
2166
|
+
}
|
|
2167
|
+
function yo(t) {
|
|
2168
|
+
this.tokenize(t.name);
|
|
2169
|
+
}
|
|
2170
|
+
function So(t) {
|
|
2171
|
+
this.children(t, () => this.token(qe, ","));
|
|
2172
|
+
}
|
|
2173
|
+
function xo(t) {
|
|
2174
|
+
t.mediaType ? (t.modifier && this.token(k, t.modifier), this.token(k, t.mediaType), t.condition && (this.token(k, "and"), this.node(t.condition))) : t.condition && this.node(t.condition);
|
|
2175
|
+
}
|
|
2176
|
+
function Co(t) {
|
|
2177
|
+
this.children(t, () => this.token(qe, ","));
|
|
2178
|
+
}
|
|
2179
|
+
function bo(t) {
|
|
2180
|
+
this.token(E, t.value);
|
|
2181
|
+
}
|
|
2182
|
+
function wo(t) {
|
|
2183
|
+
this.token(te, "("), this.children(t), this.token(O, ")");
|
|
2184
|
+
}
|
|
2185
|
+
function vo(t) {
|
|
2186
|
+
this.node(t.left), this.token($, "/"), t.right ? this.node(t.right) : this.node(E, 1);
|
|
2187
|
+
}
|
|
2188
|
+
function Ao(t) {
|
|
2189
|
+
this.node(t.prelude), this.node(t.block);
|
|
2190
|
+
}
|
|
2191
|
+
function Lo(t) {
|
|
2192
|
+
t.root && (this.token(te, "("), this.node(t.root), this.token(O, ")")), t.limit && (this.token(k, "to"), this.token(te, "("), this.node(t.limit), this.token(O, ")"));
|
|
2193
|
+
}
|
|
2194
|
+
function Eo(t) {
|
|
2195
|
+
this.children(t);
|
|
2196
|
+
}
|
|
2197
|
+
function _o(t) {
|
|
2198
|
+
this.token(te, "("), this.node(t.declaration), this.token(O, ")");
|
|
2199
|
+
}
|
|
2200
|
+
function To(t) {
|
|
2201
|
+
this.tokenize(t.value);
|
|
2202
|
+
}
|
|
2203
|
+
const Oo = 32, Io = 92, $o = 34, No = 39, Do = 40, Po = 41;
|
|
2204
|
+
function Mo(t) {
|
|
2205
|
+
let e = "", n = !1;
|
|
2206
|
+
for (let r = 0; r < t.length; r++) {
|
|
2207
|
+
const i = t.charCodeAt(r);
|
|
2208
|
+
if (i === 0) {
|
|
2209
|
+
e += "�";
|
|
2210
|
+
continue;
|
|
2211
|
+
}
|
|
2212
|
+
if (i <= 31 || i === 127) {
|
|
2213
|
+
e += "\\" + i.toString(16), n = !0;
|
|
2214
|
+
continue;
|
|
2215
|
+
}
|
|
2216
|
+
i === Oo || i === Io || i === $o || i === No || i === Do || i === Po ? (e += "\\" + t.charAt(r), n = !1) : (n && Ke(i) && (e += " "), e += t.charAt(r), n = !1);
|
|
2217
|
+
}
|
|
2218
|
+
return "url(" + e + ")";
|
|
2219
|
+
}
|
|
2220
|
+
function Fo(t) {
|
|
2221
|
+
this.token(se, Mo(t.value));
|
|
2222
|
+
}
|
|
2223
|
+
function zo(t) {
|
|
2224
|
+
this.children(t);
|
|
2225
|
+
}
|
|
2226
|
+
function Ro(t) {
|
|
2227
|
+
this.token(J, t.value);
|
|
2228
|
+
}
|
|
2229
|
+
const qo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2230
|
+
__proto__: null,
|
|
2231
|
+
AnPlusB: Vi,
|
|
2232
|
+
Atrule: eo,
|
|
2233
|
+
AtrulePrelude: to,
|
|
2234
|
+
AttributeSelector: Yi,
|
|
2235
|
+
Block: no,
|
|
2236
|
+
Brackets: ro,
|
|
2237
|
+
CDC: io,
|
|
2238
|
+
CDO: so,
|
|
2239
|
+
ClassSelector: es,
|
|
2240
|
+
Combinator: ss,
|
|
2241
|
+
Comment: oo,
|
|
2242
|
+
Condition: ao,
|
|
2243
|
+
Declaration: lo,
|
|
2244
|
+
DeclarationList: co,
|
|
2245
|
+
Dimension: uo,
|
|
2246
|
+
Feature: ho,
|
|
2247
|
+
FeatureFunction: fo,
|
|
2248
|
+
FeatureRange: po,
|
|
2249
|
+
Function: mo,
|
|
2250
|
+
GeneralEnclosed: go,
|
|
2251
|
+
Hash: ko,
|
|
2252
|
+
IdSelector: cs,
|
|
2253
|
+
Identifier: as,
|
|
2254
|
+
Layer: yo,
|
|
2255
|
+
LayerList: So,
|
|
2256
|
+
MediaQuery: xo,
|
|
2257
|
+
MediaQueryList: Co,
|
|
2258
|
+
NestingSelector: fs,
|
|
2259
|
+
Nth: ds,
|
|
2260
|
+
Number: bo,
|
|
2261
|
+
Operator: gs,
|
|
2262
|
+
Parentheses: wo,
|
|
2263
|
+
Percentage: ys,
|
|
2264
|
+
PseudoClassSelector: xs,
|
|
2265
|
+
PseudoElementSelector: bs,
|
|
2266
|
+
Ratio: vo,
|
|
2267
|
+
Raw: As,
|
|
2268
|
+
Rule: Ao,
|
|
2269
|
+
Scope: Lo,
|
|
2270
|
+
Selector: Es,
|
|
2271
|
+
SelectorList: Ts,
|
|
2272
|
+
String: Ds,
|
|
2273
|
+
StyleSheet: Eo,
|
|
2274
|
+
SupportsDeclaration: _o,
|
|
2275
|
+
TypeSelector: Fs,
|
|
2276
|
+
UnicodeRange: To,
|
|
2277
|
+
Url: Fo,
|
|
2278
|
+
Value: zo,
|
|
2279
|
+
WhiteSpace: Ro
|
|
2280
|
+
}, Symbol.toStringTag, { value: "Module" })), Bo = {
|
|
2281
|
+
node: qo
|
|
2282
|
+
}, jo = Zs(Bo), Xe = (t, e) => t.a === e.a ? t.b === e.b ? t.c - e.c : t.b - e.b : t.a - e.a, xr = (t, e) => Xe(t, e) === 0, Cr = (t, e) => Xe(t, e) > 0, br = (t, e) => Xe(t, e) < 0, Kr = (t, e = "ASC") => {
|
|
2283
|
+
const n = t.sort(Xe);
|
|
2284
|
+
return e === "DESC" ? n.reverse() : n;
|
|
2285
|
+
}, Qr = (...t) => Kr(t, "ASC"), Jr = (...t) => Kr(t, "DESC"), hn = (...t) => Jr(...t)[0], Uo = (...t) => Qr(...t)[0];
|
|
2286
|
+
class rn extends Error {
|
|
2287
|
+
constructor() {
|
|
2288
|
+
super("Manipulating a Specificity instance is not allowed. Instead, create a new Specificity()");
|
|
2289
|
+
}
|
|
2290
|
+
}
|
|
2291
|
+
class Vo {
|
|
2292
|
+
constructor(e, n = null) {
|
|
2293
|
+
this.value = e, this.selector = n;
|
|
2294
|
+
}
|
|
2295
|
+
get a() {
|
|
2296
|
+
return this.value.a;
|
|
2297
|
+
}
|
|
2298
|
+
set a(e) {
|
|
2299
|
+
throw new rn();
|
|
2300
|
+
}
|
|
2301
|
+
get b() {
|
|
2302
|
+
return this.value.b;
|
|
2303
|
+
}
|
|
2304
|
+
set b(e) {
|
|
2305
|
+
throw new rn();
|
|
2306
|
+
}
|
|
2307
|
+
get c() {
|
|
2308
|
+
return this.value.c;
|
|
2309
|
+
}
|
|
2310
|
+
set c(e) {
|
|
2311
|
+
throw new rn();
|
|
2312
|
+
}
|
|
2313
|
+
selectorString() {
|
|
2314
|
+
return typeof this.selector == "string" || this.selector instanceof String ? this.selector : this.selector instanceof Object && this.selector.type === "Selector" ? jo(this.selector) : "";
|
|
2315
|
+
}
|
|
2316
|
+
toObject() {
|
|
2317
|
+
return this.value;
|
|
2318
|
+
}
|
|
2319
|
+
toArray() {
|
|
2320
|
+
return [this.value.a, this.value.b, this.value.c];
|
|
2321
|
+
}
|
|
2322
|
+
toString() {
|
|
2323
|
+
return `(${this.value.a},${this.value.b},${this.value.c})`;
|
|
2324
|
+
}
|
|
2325
|
+
toJSON() {
|
|
2326
|
+
return {
|
|
2327
|
+
selector: this.selectorString(),
|
|
2328
|
+
asObject: this.toObject(),
|
|
2329
|
+
asArray: this.toArray(),
|
|
2330
|
+
asString: this.toString()
|
|
2331
|
+
};
|
|
2332
|
+
}
|
|
2333
|
+
isEqualTo(e) {
|
|
2334
|
+
return xr(this, e);
|
|
2335
|
+
}
|
|
2336
|
+
isGreaterThan(e) {
|
|
2337
|
+
return Cr(this, e);
|
|
2338
|
+
}
|
|
2339
|
+
isLessThan(e) {
|
|
2340
|
+
return br(this, e);
|
|
2341
|
+
}
|
|
2342
|
+
static calculate(e) {
|
|
2343
|
+
return Me(e);
|
|
2344
|
+
}
|
|
2345
|
+
static calculateForAST(e) {
|
|
2346
|
+
return fn(e);
|
|
2347
|
+
}
|
|
2348
|
+
static compare(e, n) {
|
|
2349
|
+
return Xe(e, n);
|
|
2350
|
+
}
|
|
2351
|
+
static equals(e, n) {
|
|
2352
|
+
return xr(e, n);
|
|
2353
|
+
}
|
|
2354
|
+
static lessThan(e, n) {
|
|
2355
|
+
return br(e, n);
|
|
2356
|
+
}
|
|
2357
|
+
static greaterThan(e, n) {
|
|
2358
|
+
return Cr(e, n);
|
|
2359
|
+
}
|
|
2360
|
+
static min(...e) {
|
|
2361
|
+
return Uo(...e);
|
|
2362
|
+
}
|
|
2363
|
+
static max(...e) {
|
|
2364
|
+
return hn(...e);
|
|
2365
|
+
}
|
|
2366
|
+
static sortAsc(...e) {
|
|
2367
|
+
return Qr(...e);
|
|
2368
|
+
}
|
|
2369
|
+
static sortDesc(...e) {
|
|
2370
|
+
return Jr(...e);
|
|
2371
|
+
}
|
|
2372
|
+
}
|
|
2373
|
+
const fn = (t) => {
|
|
2374
|
+
if (!t || t.type !== "Selector")
|
|
2375
|
+
throw new TypeError("Passed in source is not a Selector AST");
|
|
2376
|
+
let e = 0, n = 0, r = 0;
|
|
2377
|
+
return t.children.forEach((i) => {
|
|
2378
|
+
switch (i.type) {
|
|
2379
|
+
case "IdSelector":
|
|
2380
|
+
e += 1;
|
|
2381
|
+
break;
|
|
2382
|
+
case "AttributeSelector":
|
|
2383
|
+
case "ClassSelector":
|
|
2384
|
+
n += 1;
|
|
2385
|
+
break;
|
|
2386
|
+
case "PseudoClassSelector":
|
|
2387
|
+
switch (i.name.toLowerCase()) {
|
|
2388
|
+
case "where":
|
|
2389
|
+
break;
|
|
2390
|
+
case "-webkit-any":
|
|
2391
|
+
case "any":
|
|
2392
|
+
i.children && (n += 1);
|
|
2393
|
+
break;
|
|
2394
|
+
case "-moz-any":
|
|
2395
|
+
case "is":
|
|
2396
|
+
case "matches":
|
|
2397
|
+
case "not":
|
|
2398
|
+
case "has":
|
|
2399
|
+
if (i.children) {
|
|
2400
|
+
const a = hn(...Me(i.children.first));
|
|
2401
|
+
e += a.a, n += a.b, r += a.c;
|
|
2402
|
+
}
|
|
2403
|
+
break;
|
|
2404
|
+
case "nth-child":
|
|
2405
|
+
case "nth-last-child":
|
|
2406
|
+
if (n += 1, i.children && i.children.first.selector) {
|
|
2407
|
+
const a = hn(...Me(i.children.first.selector));
|
|
2408
|
+
e += a.a, n += a.b, r += a.c;
|
|
2409
|
+
}
|
|
2410
|
+
break;
|
|
2411
|
+
case "host-context":
|
|
2412
|
+
case "host":
|
|
2413
|
+
if (n += 1, i.children) {
|
|
2414
|
+
const a = { type: "Selector", children: [] };
|
|
2415
|
+
let f = !1;
|
|
2416
|
+
i.children.first.children.forEach((s) => {
|
|
2417
|
+
if (f) return !1;
|
|
2418
|
+
if (s.type === "Combinator")
|
|
2419
|
+
return f = !0, !1;
|
|
2420
|
+
a.children.push(s);
|
|
2421
|
+
});
|
|
2422
|
+
const c = Me(a)[0];
|
|
2423
|
+
e += c.a, n += c.b, r += c.c;
|
|
2424
|
+
}
|
|
2425
|
+
break;
|
|
2426
|
+
case "after":
|
|
2427
|
+
case "before":
|
|
2428
|
+
case "first-letter":
|
|
2429
|
+
case "first-line":
|
|
2430
|
+
r += 1;
|
|
2431
|
+
break;
|
|
2432
|
+
default:
|
|
2433
|
+
n += 1;
|
|
2434
|
+
break;
|
|
2435
|
+
}
|
|
2436
|
+
break;
|
|
2437
|
+
case "PseudoElementSelector":
|
|
2438
|
+
switch (i.name) {
|
|
2439
|
+
case "slotted":
|
|
2440
|
+
if (r += 1, i.children) {
|
|
2441
|
+
const a = { type: "Selector", children: [] };
|
|
2442
|
+
let f = !1;
|
|
2443
|
+
i.children.first.children.forEach((s) => {
|
|
2444
|
+
if (f) return !1;
|
|
2445
|
+
if (s.type === "Combinator")
|
|
2446
|
+
return f = !0, !1;
|
|
2447
|
+
a.children.push(s);
|
|
2448
|
+
});
|
|
2449
|
+
const c = Me(a)[0];
|
|
2450
|
+
e += c.a, n += c.b, r += c.c;
|
|
2451
|
+
}
|
|
2452
|
+
break;
|
|
2453
|
+
case "view-transition-group":
|
|
2454
|
+
case "view-transition-image-pair":
|
|
2455
|
+
case "view-transition-old":
|
|
2456
|
+
case "view-transition-new":
|
|
2457
|
+
if (i.children && i.children.first.value === "*")
|
|
2458
|
+
break;
|
|
2459
|
+
r += 1;
|
|
2460
|
+
break;
|
|
2461
|
+
default:
|
|
2462
|
+
r += 1;
|
|
2463
|
+
break;
|
|
2464
|
+
}
|
|
2465
|
+
break;
|
|
2466
|
+
case "TypeSelector":
|
|
2467
|
+
let o = i.name;
|
|
2468
|
+
o.includes("|") && (o = o.split("|")[1]), o !== "*" && (r += 1);
|
|
2469
|
+
break;
|
|
2470
|
+
}
|
|
2471
|
+
}), new Vo({ a: e, b: n, c: r }, t);
|
|
2472
|
+
}, Go = (t) => {
|
|
2473
|
+
if (typeof t == "string" || t instanceof String)
|
|
2474
|
+
try {
|
|
2475
|
+
return gr(t, {
|
|
2476
|
+
context: "selectorList"
|
|
2477
|
+
});
|
|
2478
|
+
} catch (e) {
|
|
2479
|
+
throw new TypeError(`Could not convert passed in source '${t}' to SelectorList: ${e.message}`);
|
|
2480
|
+
}
|
|
2481
|
+
if (t instanceof Object) {
|
|
2482
|
+
if (t.type && ["Selector", "SelectorList"].includes(t.type))
|
|
2483
|
+
return t;
|
|
2484
|
+
if (t.type && t.type === "Raw")
|
|
2485
|
+
try {
|
|
2486
|
+
return gr(t.value, {
|
|
2487
|
+
context: "selectorList"
|
|
2488
|
+
});
|
|
2489
|
+
} catch (e) {
|
|
2490
|
+
throw new TypeError(`Could not convert passed in source to SelectorList: ${e.message}`);
|
|
2491
|
+
}
|
|
2492
|
+
throw new TypeError("Passed in source is an Object but no AST / AST of the type Selector or SelectorList");
|
|
2493
|
+
}
|
|
2494
|
+
throw new TypeError("Passed in source is not a String nor an Object. I don't know what to do with it.");
|
|
2495
|
+
}, Me = (t) => {
|
|
2496
|
+
if (!t)
|
|
2497
|
+
return [];
|
|
2498
|
+
const e = Go(t);
|
|
2499
|
+
if (e.type === "Selector")
|
|
2500
|
+
return [fn(t)];
|
|
2501
|
+
if (e.type === "SelectorList") {
|
|
2502
|
+
const n = [];
|
|
2503
|
+
return e.children.forEach((r) => {
|
|
2504
|
+
const i = fn(r);
|
|
2505
|
+
n.push(i);
|
|
2506
|
+
}), n;
|
|
2507
|
+
}
|
|
2508
|
+
};
|
|
2509
|
+
function wn(t, e) {
|
|
2510
|
+
return e >= 65 && e <= 90 && (e = e | 32), t === e;
|
|
2511
|
+
}
|
|
2512
|
+
function W(t, e) {
|
|
2513
|
+
if (t === e) return !0;
|
|
2514
|
+
let n = t.length;
|
|
2515
|
+
if (n !== e.length) return !1;
|
|
2516
|
+
for (let r = 0; r < n; r++)
|
|
2517
|
+
if (wn(t.charCodeAt(r), e.charCodeAt(r)) === !1)
|
|
2518
|
+
return !1;
|
|
2519
|
+
return !0;
|
|
2520
|
+
}
|
|
2521
|
+
function ke(t, e) {
|
|
2522
|
+
if (t === e) return !0;
|
|
2523
|
+
let n = e.length, r = n - t.length;
|
|
2524
|
+
if (r < 0)
|
|
2525
|
+
return !1;
|
|
2526
|
+
for (let i = n - 1; i >= r; i--)
|
|
2527
|
+
if (wn(t.charCodeAt(i - r), e.charCodeAt(i)) === !1)
|
|
2528
|
+
return !1;
|
|
2529
|
+
return !0;
|
|
2530
|
+
}
|
|
2531
|
+
function vn(t, e) {
|
|
2532
|
+
if (t === e) return !0;
|
|
2533
|
+
let n = t.length;
|
|
2534
|
+
if (e.length < n) return !1;
|
|
2535
|
+
for (let r = 0; r < n; r++)
|
|
2536
|
+
if (wn(t.charCodeAt(r), e.charCodeAt(r)) === !1)
|
|
2537
|
+
return !1;
|
|
2538
|
+
return !0;
|
|
2539
|
+
}
|
|
2540
|
+
const Ho = "Atrule", Wo = "MediaQuery", Ko = "MediaFeature", Qo = "Rule", An = "Selector", Yr = "TypeSelector", Je = "PseudoClassSelector", Xr = "AttributeSelector", Zr = "PseudoElementSelector", pn = "Declaration", Jo = "Value", de = "Identifier", Yo = "Nth", Xo = "Combinator", Zo = "Number", ei = "Dimension", ze = "Operator", ea = "Hash", ta = "Url", Ln = "Function";
|
|
2541
|
+
function wr(t, e, n) {
|
|
2542
|
+
let r = t.value.children.first;
|
|
2543
|
+
return W(e, t.property) && r.type === de && W(n, r.name);
|
|
2544
|
+
}
|
|
2545
|
+
function na(t) {
|
|
2546
|
+
let e = !1;
|
|
2547
|
+
return pe(t, function(n) {
|
|
2548
|
+
if (n.type === pn && (wr(n, "-webkit-appearance", "none") || wr(n, "-moz-appearance", "meterbar")))
|
|
2549
|
+
return e = !0, this.break;
|
|
2550
|
+
}), e;
|
|
2551
|
+
}
|
|
2552
|
+
function ra(t) {
|
|
2553
|
+
let e = !1;
|
|
2554
|
+
return pe(t, function(n) {
|
|
2555
|
+
let r = n.children, i = n.name, o = n.value;
|
|
2556
|
+
if (n.type === Wo && r.size === 1 && r.first.type === de) {
|
|
2557
|
+
let a = r.first.name;
|
|
2558
|
+
if (vn("\\0", a) || ke("\\9 ", a))
|
|
2559
|
+
return e = !0, this.break;
|
|
2560
|
+
} else if (n.type === Ko) {
|
|
2561
|
+
if (o && o.unit && o.unit === "\\0")
|
|
2562
|
+
return e = !0, this.break;
|
|
2563
|
+
if (W("-moz-images-in-menus", i) || W("min--moz-device-pixel-ratio", i) || W("-ms-high-contrast", i))
|
|
2564
|
+
return e = !0, this.break;
|
|
2565
|
+
if (W("min-resolution", i) && o && W(".001", o.value) && W("dpcm", o.unit))
|
|
2566
|
+
return e = !0, this.break;
|
|
2567
|
+
if (W("-webkit-min-device-pixel-ratio", i) && o && o.value && (W("0", o.value) || W("10000", o.value)))
|
|
2568
|
+
return e = !0, this.break;
|
|
2569
|
+
}
|
|
2570
|
+
}), e;
|
|
2571
|
+
}
|
|
2572
|
+
const vr = 45;
|
|
2573
|
+
function we(t) {
|
|
2574
|
+
return t.charCodeAt(0) === vr && t.charCodeAt(1) !== vr && t.indexOf("-", 2) !== -1;
|
|
2575
|
+
}
|
|
2576
|
+
class le {
|
|
2577
|
+
/** @param {string[]} items */
|
|
2578
|
+
constructor(e) {
|
|
2579
|
+
this.set = new Set(e);
|
|
2580
|
+
}
|
|
2581
|
+
/** @param {string} item */
|
|
2582
|
+
has(e) {
|
|
2583
|
+
return this.set.has(e.toLowerCase());
|
|
2584
|
+
}
|
|
2585
|
+
}
|
|
2586
|
+
function ti(t, e) {
|
|
2587
|
+
let n = [];
|
|
2588
|
+
return pe(t, {
|
|
2589
|
+
visit: An,
|
|
2590
|
+
enter: function(r) {
|
|
2591
|
+
n.push(e(r));
|
|
2592
|
+
}
|
|
2593
|
+
}), n;
|
|
2594
|
+
}
|
|
2595
|
+
const ni = new le([
|
|
2596
|
+
"nth-child",
|
|
2597
|
+
"where",
|
|
2598
|
+
"not",
|
|
2599
|
+
"is",
|
|
2600
|
+
"has",
|
|
2601
|
+
"nth-last-child",
|
|
2602
|
+
"matches",
|
|
2603
|
+
"-webkit-any",
|
|
2604
|
+
"-moz-any"
|
|
2605
|
+
]);
|
|
2606
|
+
function ri(t) {
|
|
2607
|
+
let e = !1;
|
|
2608
|
+
return pe(t, function(n) {
|
|
2609
|
+
if (n.type === Xr) {
|
|
2610
|
+
let r = n.name.name;
|
|
2611
|
+
if (W("role", r) || vn("aria-", r))
|
|
2612
|
+
return e = !0, this.break;
|
|
2613
|
+
} else if (n.type === Je && ni.has(n.name)) {
|
|
2614
|
+
let r = ti(n, ri);
|
|
2615
|
+
for (let i of r)
|
|
2616
|
+
if (i === !0) {
|
|
2617
|
+
e = !0;
|
|
2618
|
+
break;
|
|
2619
|
+
}
|
|
2620
|
+
return this.skip;
|
|
2621
|
+
}
|
|
2622
|
+
}), e;
|
|
2623
|
+
}
|
|
2624
|
+
function ia(t) {
|
|
2625
|
+
let e = !1;
|
|
2626
|
+
return pe(t, function(n) {
|
|
2627
|
+
let r = n.type;
|
|
2628
|
+
if ((r === Zr || r === Yr || r === Je) && we(n.name))
|
|
2629
|
+
return e = !0, this.break;
|
|
2630
|
+
}), e;
|
|
2631
|
+
}
|
|
2632
|
+
function sa(t) {
|
|
2633
|
+
let e = [];
|
|
2634
|
+
return pe(t, function(n) {
|
|
2635
|
+
n.type === Je && e.push(n.name);
|
|
2636
|
+
}), e.length === 0 ? !1 : e;
|
|
2637
|
+
}
|
|
2638
|
+
function ii(t) {
|
|
2639
|
+
let e = 0;
|
|
2640
|
+
return pe(t, function(n) {
|
|
2641
|
+
let r = n.type;
|
|
2642
|
+
if (!(r === An || r === Yo)) {
|
|
2643
|
+
if (e++, (r === Zr || r === Yr || r === Je) && we(n.name) && e++, r === Xr)
|
|
2644
|
+
return n.value && e++, this.skip;
|
|
2645
|
+
if (r === Je && ni.has(n.name)) {
|
|
2646
|
+
let i = ti(n, ii);
|
|
2647
|
+
if (i.length === 0) return;
|
|
2648
|
+
for (let o of i)
|
|
2649
|
+
e += o;
|
|
2650
|
+
return this.skip;
|
|
2651
|
+
}
|
|
2652
|
+
}
|
|
2653
|
+
}), e;
|
|
2654
|
+
}
|
|
2655
|
+
function oa(t, e) {
|
|
2656
|
+
pe(t, function(n, r) {
|
|
2657
|
+
if (n.type === Xo) {
|
|
2658
|
+
let i = n.loc, o = n.name;
|
|
2659
|
+
if (i === null) {
|
|
2660
|
+
let a = r.prev.data.loc.end, f = {
|
|
2661
|
+
offset: a.offset,
|
|
2662
|
+
line: a.line,
|
|
2663
|
+
column: a.column
|
|
2664
|
+
};
|
|
2665
|
+
e({
|
|
2666
|
+
name: o,
|
|
2667
|
+
loc: {
|
|
2668
|
+
start: f,
|
|
2669
|
+
end: {
|
|
2670
|
+
offset: f.offset + 1,
|
|
2671
|
+
line: f.line,
|
|
2672
|
+
column: f.column + 1
|
|
2673
|
+
}
|
|
2674
|
+
}
|
|
2675
|
+
});
|
|
2676
|
+
} else
|
|
2677
|
+
e({
|
|
2678
|
+
name: o,
|
|
2679
|
+
loc: i
|
|
2680
|
+
});
|
|
2681
|
+
}
|
|
2682
|
+
});
|
|
2683
|
+
}
|
|
2684
|
+
const aa = new le([
|
|
2685
|
+
// CSS Named Colors
|
|
2686
|
+
// Spec: https://drafts.csswg.org/css-color/#named-colors
|
|
2687
|
+
// Heuristic: popular names first for quick finding in set.has()
|
|
2688
|
+
// See: https://docs.google.com/spreadsheets/d/1OU8ahxC5oYU8VRryQs9BzHToaXcOntVlh6KUHjm15G4/edit#gid=2096495459
|
|
2689
|
+
"white",
|
|
2690
|
+
"black",
|
|
2691
|
+
"red",
|
|
2692
|
+
"gray",
|
|
2693
|
+
"silver",
|
|
2694
|
+
"grey",
|
|
2695
|
+
"green",
|
|
2696
|
+
"orange",
|
|
2697
|
+
"blue",
|
|
2698
|
+
"dimgray",
|
|
2699
|
+
"whitesmoke",
|
|
2700
|
+
"lightgray",
|
|
2701
|
+
"lightgrey",
|
|
2702
|
+
"yellow",
|
|
2703
|
+
"gold",
|
|
2704
|
+
"pink",
|
|
2705
|
+
"gainsboro",
|
|
2706
|
+
"magenta",
|
|
2707
|
+
"purple",
|
|
2708
|
+
"darkgray",
|
|
2709
|
+
"navy",
|
|
2710
|
+
"darkred",
|
|
2711
|
+
"teal",
|
|
2712
|
+
"maroon",
|
|
2713
|
+
"darkgrey",
|
|
2714
|
+
"tomato",
|
|
2715
|
+
"darkorange",
|
|
2716
|
+
"brown",
|
|
2717
|
+
"crimson",
|
|
2718
|
+
"lightyellow",
|
|
2719
|
+
"slategray",
|
|
2720
|
+
"salmon",
|
|
2721
|
+
"lightgreen",
|
|
2722
|
+
"lightblue",
|
|
2723
|
+
"orangered",
|
|
2724
|
+
"aliceblue",
|
|
2725
|
+
"dodgerblue",
|
|
2726
|
+
"lime",
|
|
2727
|
+
"darkblue",
|
|
2728
|
+
"darkgoldenrod",
|
|
2729
|
+
"skyblue",
|
|
2730
|
+
"royalblue",
|
|
2731
|
+
"darkgreen",
|
|
2732
|
+
"ivory",
|
|
2733
|
+
"olive",
|
|
2734
|
+
"aqua",
|
|
2735
|
+
"turquoise",
|
|
2736
|
+
"cyan",
|
|
2737
|
+
"khaki",
|
|
2738
|
+
"beige",
|
|
2739
|
+
"snow",
|
|
2740
|
+
"ghostwhite",
|
|
2741
|
+
"limegreen",
|
|
2742
|
+
"coral",
|
|
2743
|
+
"dimgrey",
|
|
2744
|
+
"hotpink",
|
|
2745
|
+
"midnightblue",
|
|
2746
|
+
"firebrick",
|
|
2747
|
+
"indigo",
|
|
2748
|
+
"wheat",
|
|
2749
|
+
"mediumblue",
|
|
2750
|
+
"lightpink",
|
|
2751
|
+
"plum",
|
|
2752
|
+
"azure",
|
|
2753
|
+
"violet",
|
|
2754
|
+
"lavender",
|
|
2755
|
+
"deepskyblue",
|
|
2756
|
+
"darkslategrey",
|
|
2757
|
+
"goldenrod",
|
|
2758
|
+
"cornflowerblue",
|
|
2759
|
+
"lightskyblue",
|
|
2760
|
+
"indianred",
|
|
2761
|
+
"yellowgreen",
|
|
2762
|
+
"saddlebrown",
|
|
2763
|
+
"palegreen",
|
|
2764
|
+
"bisque",
|
|
2765
|
+
"tan",
|
|
2766
|
+
"antiquewhite",
|
|
2767
|
+
"steelblue",
|
|
2768
|
+
"forestgreen",
|
|
2769
|
+
"fuchsia",
|
|
2770
|
+
"mediumaquamarine",
|
|
2771
|
+
"seagreen",
|
|
2772
|
+
"sienna",
|
|
2773
|
+
"deeppink",
|
|
2774
|
+
"mediumseagreen",
|
|
2775
|
+
"peru",
|
|
2776
|
+
"greenyellow",
|
|
2777
|
+
"lightgoldenrodyellow",
|
|
2778
|
+
"orchid",
|
|
2779
|
+
"cadetblue",
|
|
2780
|
+
"navajowhite",
|
|
2781
|
+
"lightsteelblue",
|
|
2782
|
+
"slategrey",
|
|
2783
|
+
"linen",
|
|
2784
|
+
"lightseagreen",
|
|
2785
|
+
"darkcyan",
|
|
2786
|
+
"lightcoral",
|
|
2787
|
+
"aquamarine",
|
|
2788
|
+
"blueviolet",
|
|
2789
|
+
"cornsilk",
|
|
2790
|
+
"lightsalmon",
|
|
2791
|
+
"chocolate",
|
|
2792
|
+
"lightslategray",
|
|
2793
|
+
"floralwhite",
|
|
2794
|
+
"darkturquoise",
|
|
2795
|
+
"darkslategray",
|
|
2796
|
+
"rebeccapurple",
|
|
2797
|
+
"burlywood",
|
|
2798
|
+
"chartreuse",
|
|
2799
|
+
"lightcyan",
|
|
2800
|
+
"lemonchiffon",
|
|
2801
|
+
"palevioletred",
|
|
2802
|
+
"darkslateblue",
|
|
2803
|
+
"mediumpurple",
|
|
2804
|
+
"lawngreen",
|
|
2805
|
+
"slateblue",
|
|
2806
|
+
"darkseagreen",
|
|
2807
|
+
"blanchedalmond",
|
|
2808
|
+
"mistyrose",
|
|
2809
|
+
"darkolivegreen",
|
|
2810
|
+
"seashell",
|
|
2811
|
+
"olivedrab",
|
|
2812
|
+
"peachpuff",
|
|
2813
|
+
"darkviolet",
|
|
2814
|
+
"powderblue",
|
|
2815
|
+
"darkmagenta",
|
|
2816
|
+
"lightslategrey",
|
|
2817
|
+
"honeydew",
|
|
2818
|
+
"palegoldenrod",
|
|
2819
|
+
"darkkhaki",
|
|
2820
|
+
"oldlace",
|
|
2821
|
+
"mintcream",
|
|
2822
|
+
"sandybrown",
|
|
2823
|
+
"mediumturquoise",
|
|
2824
|
+
"papayawhip",
|
|
2825
|
+
"paleturquoise",
|
|
2826
|
+
"mediumvioletred",
|
|
2827
|
+
"thistle",
|
|
2828
|
+
"springgreen",
|
|
2829
|
+
"moccasin",
|
|
2830
|
+
"rosybrown",
|
|
2831
|
+
"lavenderblush",
|
|
2832
|
+
"mediumslateblue",
|
|
2833
|
+
"darkorchid",
|
|
2834
|
+
"mediumorchid",
|
|
2835
|
+
"darksalmon",
|
|
2836
|
+
"mediumspringgreen"
|
|
2837
|
+
]), la = new le([
|
|
2838
|
+
// CSS System Colors
|
|
2839
|
+
// Spec: https://drafts.csswg.org/css-color/#css-system-colors
|
|
2840
|
+
"accentcolor",
|
|
2841
|
+
"accentcolortext",
|
|
2842
|
+
"activetext",
|
|
2843
|
+
"buttonborder",
|
|
2844
|
+
"buttonface",
|
|
2845
|
+
"buttontext",
|
|
2846
|
+
"canvas",
|
|
2847
|
+
"canvastext",
|
|
2848
|
+
"field",
|
|
2849
|
+
"fieldtext",
|
|
2850
|
+
"graytext",
|
|
2851
|
+
"highlight",
|
|
2852
|
+
"highlighttext",
|
|
2853
|
+
"linktext",
|
|
2854
|
+
"mark",
|
|
2855
|
+
"marktext",
|
|
2856
|
+
"selecteditem",
|
|
2857
|
+
"selecteditemtext",
|
|
2858
|
+
"visitedtext"
|
|
2859
|
+
]), ca = new le([
|
|
2860
|
+
"rgba",
|
|
2861
|
+
"rgb",
|
|
2862
|
+
"hsla",
|
|
2863
|
+
"hsl",
|
|
2864
|
+
"oklch",
|
|
2865
|
+
"color",
|
|
2866
|
+
"hwb",
|
|
2867
|
+
"lch",
|
|
2868
|
+
"lab",
|
|
2869
|
+
"oklab"
|
|
2870
|
+
]), ua = new le([
|
|
2871
|
+
"transparent",
|
|
2872
|
+
"currentcolor"
|
|
2873
|
+
]), At = new le([
|
|
2874
|
+
"auto",
|
|
2875
|
+
"none",
|
|
2876
|
+
// for `text-shadow`, `box-shadow` and `background`
|
|
2877
|
+
"inherit",
|
|
2878
|
+
"initial",
|
|
2879
|
+
"unset",
|
|
2880
|
+
"revert",
|
|
2881
|
+
"revert-layer"
|
|
2882
|
+
]);
|
|
2883
|
+
function ut(t) {
|
|
2884
|
+
let e = t.children, n = e.size;
|
|
2885
|
+
if (!e || n > 1 || n === 0) return !1;
|
|
2886
|
+
let r = e.first;
|
|
2887
|
+
return r.type === de && At.has(r.name);
|
|
2888
|
+
}
|
|
2889
|
+
const ha = new le([
|
|
2890
|
+
"caption",
|
|
2891
|
+
"icon",
|
|
2892
|
+
"menu",
|
|
2893
|
+
"message-box",
|
|
2894
|
+
"small-caption",
|
|
2895
|
+
"status-bar"
|
|
2896
|
+
]), fa = new le([
|
|
2897
|
+
/* <absolute-size> values */
|
|
2898
|
+
"xx-small",
|
|
2899
|
+
"x-small",
|
|
2900
|
+
"small",
|
|
2901
|
+
"medium",
|
|
2902
|
+
"large",
|
|
2903
|
+
"x-large",
|
|
2904
|
+
"xx-large",
|
|
2905
|
+
"xxx-large",
|
|
2906
|
+
/* <relative-size> values */
|
|
2907
|
+
"smaller",
|
|
2908
|
+
"larger"
|
|
2909
|
+
]), pa = 44, Ar = 47;
|
|
2910
|
+
function sn(t) {
|
|
2911
|
+
let e = t.children.first;
|
|
2912
|
+
return e === null ? !1 : e.type === de && ha.has(e.name);
|
|
2913
|
+
}
|
|
2914
|
+
function da(t, e, n) {
|
|
2915
|
+
let r = Array.from({ length: 2 }), i, o;
|
|
2916
|
+
t.children.forEach(function(f, c) {
|
|
2917
|
+
let s = c.prev ? c.prev.data : void 0, l = c.next ? c.next.data : void 0;
|
|
2918
|
+
if (f.type === de && At.has(f.name) && n({
|
|
2919
|
+
type: "keyword",
|
|
2920
|
+
value: f.name
|
|
2921
|
+
}), l && l.type === ze && l.value.charCodeAt(0) === Ar) {
|
|
2922
|
+
i = e(f);
|
|
2923
|
+
return;
|
|
2924
|
+
}
|
|
2925
|
+
if (s && s.type === ze && s.value.charCodeAt(0) === Ar) {
|
|
2926
|
+
o = e(f);
|
|
2927
|
+
return;
|
|
2928
|
+
}
|
|
2929
|
+
if (l && l.type === ze && l.value.charCodeAt(0) === pa && !r[0]) {
|
|
2930
|
+
r[0] = f, !i && s && (i = e(s));
|
|
2931
|
+
return;
|
|
2932
|
+
}
|
|
2933
|
+
if (f.type !== Zo) {
|
|
2934
|
+
if (c.next === null) {
|
|
2935
|
+
r[1] = f, !i && !r[0] && s && (i = e(s));
|
|
2936
|
+
return;
|
|
2937
|
+
}
|
|
2938
|
+
if (f.type === de) {
|
|
2939
|
+
let m = f.name;
|
|
2940
|
+
if (fa.has(m)) {
|
|
2941
|
+
i = m;
|
|
2942
|
+
return;
|
|
2943
|
+
}
|
|
2944
|
+
}
|
|
2945
|
+
}
|
|
2946
|
+
});
|
|
2947
|
+
let a = r[0] || r[1] ? e({
|
|
2948
|
+
loc: {
|
|
2949
|
+
start: {
|
|
2950
|
+
offset: (r[0] || r[1]).loc.start.offset
|
|
2951
|
+
},
|
|
2952
|
+
end: {
|
|
2953
|
+
offset: r[1].loc.end.offset
|
|
2954
|
+
}
|
|
2955
|
+
}
|
|
2956
|
+
}) : null;
|
|
2957
|
+
return {
|
|
2958
|
+
font_size: i,
|
|
2959
|
+
line_height: o,
|
|
2960
|
+
font_family: a
|
|
2961
|
+
};
|
|
2962
|
+
}
|
|
2963
|
+
const ma = new le([
|
|
2964
|
+
"linear",
|
|
2965
|
+
"ease",
|
|
2966
|
+
"ease-in",
|
|
2967
|
+
"ease-out",
|
|
2968
|
+
"ease-in-out",
|
|
2969
|
+
"step-start",
|
|
2970
|
+
"step-end"
|
|
2971
|
+
]), ga = new le([
|
|
2972
|
+
"cubic-bezier",
|
|
2973
|
+
"steps"
|
|
2974
|
+
]);
|
|
2975
|
+
function ka(t, e) {
|
|
2976
|
+
let n = !1;
|
|
2977
|
+
for (let r of t) {
|
|
2978
|
+
let i = r.type, o = r.name;
|
|
2979
|
+
i === ze ? n = !1 : i === ei && n === !1 ? (n = !0, e({
|
|
2980
|
+
type: "duration",
|
|
2981
|
+
value: r
|
|
2982
|
+
})) : i === de ? ma.has(o) ? e({
|
|
2983
|
+
type: "fn",
|
|
2984
|
+
value: r
|
|
2985
|
+
}) : At.has(o) && e({
|
|
2986
|
+
type: "keyword",
|
|
2987
|
+
value: r
|
|
2988
|
+
}) : i === Ln && ga.has(o) && e({
|
|
2989
|
+
type: "fn",
|
|
2990
|
+
value: r
|
|
2991
|
+
});
|
|
2992
|
+
}
|
|
2993
|
+
}
|
|
2994
|
+
function si(t) {
|
|
2995
|
+
let e = t.children;
|
|
2996
|
+
if (!e)
|
|
2997
|
+
return !1;
|
|
2998
|
+
for (let n of e) {
|
|
2999
|
+
let { type: r, name: i } = n;
|
|
3000
|
+
if (r === de && we(i) || r === Ln && (we(i) || si(n)))
|
|
3001
|
+
return !0;
|
|
3002
|
+
}
|
|
3003
|
+
return !1;
|
|
3004
|
+
}
|
|
3005
|
+
class x {
|
|
3006
|
+
/** @param {boolean} useLocations */
|
|
3007
|
+
constructor(e = !1) {
|
|
3008
|
+
this._items = /* @__PURE__ */ new Map(), this._total = 0, e && (this._nodes = []), this._useLocations = e;
|
|
3009
|
+
}
|
|
3010
|
+
/**
|
|
3011
|
+
* @param {string} item
|
|
3012
|
+
* @param {import('css-tree').CssLocation} node_location
|
|
3013
|
+
*/
|
|
3014
|
+
p(e, n) {
|
|
3015
|
+
let r = this._total;
|
|
3016
|
+
if (this._useLocations) {
|
|
3017
|
+
let i = n.start, o = i.offset, a = r * 4;
|
|
3018
|
+
this._nodes[a] = i.line, this._nodes[a + 1] = i.column, this._nodes[a + 2] = o, this._nodes[a + 3] = n.end.offset - o;
|
|
3019
|
+
}
|
|
3020
|
+
if (this._items.has(e)) {
|
|
3021
|
+
this._items.get(e).push(r), this._total++;
|
|
3022
|
+
return;
|
|
3023
|
+
}
|
|
3024
|
+
this._items.set(e, [r]), this._total++;
|
|
3025
|
+
}
|
|
3026
|
+
size() {
|
|
3027
|
+
return this._total;
|
|
3028
|
+
}
|
|
3029
|
+
/**
|
|
3030
|
+
* @typedef CssLocation
|
|
3031
|
+
* @property {number} line
|
|
3032
|
+
* @property {number} column
|
|
3033
|
+
* @property {number} offset
|
|
3034
|
+
* @property {number} length
|
|
3035
|
+
*
|
|
3036
|
+
* @returns {{
|
|
3037
|
+
* total: number;
|
|
3038
|
+
* totalUnique: number;
|
|
3039
|
+
* uniquenessRatio: number;
|
|
3040
|
+
* unique: Record<string, number>;
|
|
3041
|
+
* } & ({
|
|
3042
|
+
* uniqueWithLocations: Record<string, CssLocation[]>
|
|
3043
|
+
* } | {
|
|
3044
|
+
* uniqueWithLocations?: undefined
|
|
3045
|
+
* })}
|
|
3046
|
+
*/
|
|
3047
|
+
c() {
|
|
3048
|
+
let e = /* @__PURE__ */ new Map(), n = {}, r = this._useLocations, i = this._items, o = this._nodes, a = i.size;
|
|
3049
|
+
i.forEach((s, l) => {
|
|
3050
|
+
if (r) {
|
|
3051
|
+
let m = s.map(function(y) {
|
|
3052
|
+
let C = y * 4;
|
|
3053
|
+
return {
|
|
3054
|
+
line: o[C],
|
|
3055
|
+
column: o[C + 1],
|
|
3056
|
+
offset: o[C + 2],
|
|
3057
|
+
length: o[C + 3]
|
|
3058
|
+
};
|
|
3059
|
+
});
|
|
3060
|
+
e.set(l, m);
|
|
3061
|
+
} else
|
|
3062
|
+
n[l] = s.length;
|
|
3063
|
+
});
|
|
3064
|
+
let f = this._total, c = {
|
|
3065
|
+
total: f,
|
|
3066
|
+
totalUnique: a,
|
|
3067
|
+
unique: n,
|
|
3068
|
+
uniquenessRatio: f === 0 ? 0 : a / f
|
|
3069
|
+
};
|
|
3070
|
+
return r && (c.uniqueWithLocations = Object.fromEntries(e)), c;
|
|
3071
|
+
}
|
|
3072
|
+
}
|
|
3073
|
+
class on {
|
|
3074
|
+
/** @param {boolean} useLocations */
|
|
3075
|
+
constructor(e) {
|
|
3076
|
+
this._list = new x(e), this._contexts = /* @__PURE__ */ new Map(), this._useLocations = e;
|
|
3077
|
+
}
|
|
3078
|
+
/**
|
|
3079
|
+
* Add an item to this _list's context
|
|
3080
|
+
* @param {string} item Item to push
|
|
3081
|
+
* @param {string} context Context to push Item to
|
|
3082
|
+
* @param {import('css-tree').CssLocation} node_location
|
|
3083
|
+
*/
|
|
3084
|
+
push(e, n, r) {
|
|
3085
|
+
this._list.p(e, r), this._contexts.has(n) || this._contexts.set(n, new x(this._useLocations)), this._contexts.get(n).p(e, r);
|
|
3086
|
+
}
|
|
3087
|
+
count() {
|
|
3088
|
+
let e = /* @__PURE__ */ new Map();
|
|
3089
|
+
for (let [n, r] of this._contexts.entries())
|
|
3090
|
+
e.set(n, r.c());
|
|
3091
|
+
return Object.assign(this._list.c(), {
|
|
3092
|
+
itemsPerContext: Object.fromEntries(e)
|
|
3093
|
+
});
|
|
3094
|
+
}
|
|
3095
|
+
}
|
|
3096
|
+
function ya(t) {
|
|
3097
|
+
let e = /* @__PURE__ */ new Map(), n = -1, r = 0, i = 0, o = t.length;
|
|
3098
|
+
for (let a = 0; a < o; a++) {
|
|
3099
|
+
let f = t[a], c = (e.get(f) || 0) + 1;
|
|
3100
|
+
e.set(f, c), c > n && (n = c, r = 0, i = 0), c >= n && (r++, i += f);
|
|
3101
|
+
}
|
|
3102
|
+
return i / r;
|
|
3103
|
+
}
|
|
3104
|
+
class ie {
|
|
3105
|
+
constructor() {
|
|
3106
|
+
this._items = [], this._sum = 0;
|
|
3107
|
+
}
|
|
3108
|
+
/**
|
|
3109
|
+
* Add a new Integer at the end of this AggregateCollection
|
|
3110
|
+
* @param {number} item - The item to add
|
|
3111
|
+
*/
|
|
3112
|
+
push(e) {
|
|
3113
|
+
this._items.push(e), this._sum += e;
|
|
3114
|
+
}
|
|
3115
|
+
size() {
|
|
3116
|
+
return this._items.length;
|
|
3117
|
+
}
|
|
3118
|
+
aggregate() {
|
|
3119
|
+
let e = this._items.length;
|
|
3120
|
+
if (e === 0)
|
|
3121
|
+
return {
|
|
3122
|
+
min: 0,
|
|
3123
|
+
max: 0,
|
|
3124
|
+
mean: 0,
|
|
3125
|
+
mode: 0,
|
|
3126
|
+
range: 0,
|
|
3127
|
+
sum: 0
|
|
3128
|
+
};
|
|
3129
|
+
let n = this._items.slice().sort((f, c) => f - c), r = n[0], i = n[e - 1], o = ya(n), a = this._sum;
|
|
3130
|
+
return {
|
|
3131
|
+
min: r,
|
|
3132
|
+
max: i,
|
|
3133
|
+
mean: a / e,
|
|
3134
|
+
mode: o,
|
|
3135
|
+
range: i - r,
|
|
3136
|
+
sum: a
|
|
3137
|
+
};
|
|
3138
|
+
}
|
|
3139
|
+
/**
|
|
3140
|
+
* @returns {number[]} All _items in this collection
|
|
3141
|
+
*/
|
|
3142
|
+
toArray() {
|
|
3143
|
+
return this._items;
|
|
3144
|
+
}
|
|
3145
|
+
}
|
|
3146
|
+
function Sa(t) {
|
|
3147
|
+
if (En(t) || we(t)) return !1;
|
|
3148
|
+
let e = t.charCodeAt(0);
|
|
3149
|
+
return e === 47 || e === 42 || e === 95 || e === 43 || e === 38 || e === 36 || e === 35;
|
|
3150
|
+
}
|
|
3151
|
+
function En(t) {
|
|
3152
|
+
return t.length < 3 ? !1 : t.charCodeAt(0) === 45 && t.charCodeAt(1) === 45;
|
|
3153
|
+
}
|
|
3154
|
+
function G(t, e) {
|
|
3155
|
+
return En(e) ? !1 : ke(t, e);
|
|
3156
|
+
}
|
|
3157
|
+
function xa(t) {
|
|
3158
|
+
return we(t) ? t.slice(t.indexOf("-", 2) + 1) : t;
|
|
3159
|
+
}
|
|
3160
|
+
function Ca(t) {
|
|
3161
|
+
let e = 5, n = t.indexOf(";"), r = t.indexOf(",");
|
|
3162
|
+
return n === -1 || r !== -1 && r < n ? t.substring(e, r) : t.substring(e, n);
|
|
3163
|
+
}
|
|
3164
|
+
function ba(t) {
|
|
3165
|
+
let e = t.children;
|
|
3166
|
+
if (e) {
|
|
3167
|
+
let n = e.last;
|
|
3168
|
+
return n && n.type === de && ke("\\9", n.name);
|
|
3169
|
+
}
|
|
3170
|
+
return !1;
|
|
3171
|
+
}
|
|
3172
|
+
let wa = new le([
|
|
3173
|
+
"border-radius",
|
|
3174
|
+
"border-top-left-radius",
|
|
3175
|
+
"border-top-right-radius",
|
|
3176
|
+
"border-bottom-right-radius",
|
|
3177
|
+
"border-bottom-left-radius",
|
|
3178
|
+
"border-start-start-radius",
|
|
3179
|
+
"border-start-end-radius",
|
|
3180
|
+
"border-end-end-radius",
|
|
3181
|
+
"border-end-start-radius"
|
|
3182
|
+
]);
|
|
3183
|
+
function B(t, e) {
|
|
3184
|
+
return e === 0 ? 0 : t / e;
|
|
3185
|
+
}
|
|
3186
|
+
let va = {
|
|
3187
|
+
useLocations: !1
|
|
3188
|
+
};
|
|
3189
|
+
function Ea(t, e = {}) {
|
|
3190
|
+
let r = Object.assign({}, va, e).useLocations === !0, i = Date.now();
|
|
3191
|
+
function o(d) {
|
|
3192
|
+
return a(d).trim();
|
|
3193
|
+
}
|
|
3194
|
+
function a(d) {
|
|
3195
|
+
let w = d.loc;
|
|
3196
|
+
return t.substring(w.start.offset, w.end.offset);
|
|
3197
|
+
}
|
|
3198
|
+
let f = 0, c = 0, s = 0, l = {
|
|
3199
|
+
total: 0,
|
|
3200
|
+
/** @type {Map<string, { size: number, count: number } & ({ uniqueWithLocations?: undefined } | ({ uniqueWithLocations: { offset: number, line: number, column: number, length: number }[] })) }>} */
|
|
3201
|
+
unique: /* @__PURE__ */ new Map()
|
|
3202
|
+
}, m = Date.now(), y = oi(t, {
|
|
3203
|
+
parseCustomProperty: !0,
|
|
3204
|
+
// To find font-families, colors, etc.
|
|
3205
|
+
positions: !0,
|
|
3206
|
+
// So we can use stringifyNode()
|
|
3207
|
+
/** @param {string} comment */
|
|
3208
|
+
onComment: function(d) {
|
|
3209
|
+
f++, c += d.length;
|
|
3210
|
+
}
|
|
3211
|
+
}), C = Date.now(), _ = y.loc.end.line - y.loc.start.line + 1, q = 0, V = new ie(), me = [], Oe = new x(r), Be = new x(r), Y = new x(r), Ze = new x(r), et = new x(r), tt = new x(r), u = new x(r), h = new x(r), g = new x(r), p = new x(r), X = new x(r), j = new x(r), xe = 0, R = 0, Ce = new ie(), ge = new ie(), Lt = new ie(), _n = new x(r), Tn = new x(r), On = new x(r), Et = new x(r), In = /* @__PURE__ */ new Set(), _t = new x(r), ve, Ae, $n = new ie(), Nn = new ie(), Dn = new ie(), Pn = new x(r), nt = new ie(), Mn = new x(r), Fn = [], Tt = new x(r), Ot = new x(r), zn = new x(r), Rn = new x(r), qn = /* @__PURE__ */ new Set(), je = 0, Bn = new ie(), rt = 0, It = 0, $t = new x(r), Ue = new x(r), Nt = new x(r), Dt = new x(r), it = new x(r), Ve = new ie(), Pt = new ie(), jn = new x(r), Mt = new x(r), Un = new x(r), Vn = new x(r), Gn = new x(r), Ft = new x(r), zt = new x(r), Rt = new x(r), st = new x(r), ot = new x(r), Ie = new on(r), $e = new x(r), qt = new on(r), Hn = new x(r), Ge = new x(r), Wn = new on(r);
|
|
3212
|
+
pe(y, function(d) {
|
|
3213
|
+
switch (d.type) {
|
|
3214
|
+
case Ho: {
|
|
3215
|
+
q++;
|
|
3216
|
+
let w = d.name;
|
|
3217
|
+
if (w === "font-face") {
|
|
3218
|
+
let T = {};
|
|
3219
|
+
r && Oe.p(d.loc.start.offset, d.loc), d.block.children.forEach((A) => {
|
|
3220
|
+
A.type === pn && (T[A.property] = o(A.value));
|
|
3221
|
+
}), me.push(T), V.push(1);
|
|
3222
|
+
break;
|
|
3223
|
+
}
|
|
3224
|
+
let S = 1;
|
|
3225
|
+
if (d.prelude !== null) {
|
|
3226
|
+
let T = d.prelude, A = T && o(d.prelude), v = T.loc;
|
|
3227
|
+
if (w === "media")
|
|
3228
|
+
Ze.p(A, v), ra(T) && (et.p(A, v), S++);
|
|
3229
|
+
else if (w === "supports")
|
|
3230
|
+
u.p(A, v), na(T) && (h.p(A, v), S++);
|
|
3231
|
+
else if (ke("keyframes", w)) {
|
|
3232
|
+
let b = "@" + w + " " + A;
|
|
3233
|
+
we(w) && (p.p(b, v), S++), g.p(b, v);
|
|
3234
|
+
} else w === "import" ? Y.p(A, v) : w === "charset" ? tt.p(A, v) : w === "container" ? X.p(A, v) : w === "layer" ? A.split(",").forEach((b) => Be.p(b.trim(), v)) : w === "property" && j.p(A, v);
|
|
3235
|
+
} else
|
|
3236
|
+
w === "layer" && (Be.p("<anonymous>", d.loc), S++);
|
|
3237
|
+
V.push(S);
|
|
3238
|
+
break;
|
|
3239
|
+
}
|
|
3240
|
+
case Qo: {
|
|
3241
|
+
let w = d.prelude, S = d.block, T = w.children, A = S.children, v = T ? T.size : 0, b = A ? A.size : 0;
|
|
3242
|
+
Ce.push(v + b), _n.p(v + b, d.loc), ge.push(v), Tn.p(v, w.loc), Lt.push(b), On.p(b, S.loc), xe++, b === 0 && R++;
|
|
3243
|
+
break;
|
|
3244
|
+
}
|
|
3245
|
+
case An: {
|
|
3246
|
+
let w = o(d);
|
|
3247
|
+
if (this.atrule && ke("keyframes", this.atrule.name))
|
|
3248
|
+
return Et.p(w, d.loc), this.skip;
|
|
3249
|
+
ri(d) && Ot.p(w, d.loc);
|
|
3250
|
+
let S = sa(d);
|
|
3251
|
+
if (S !== !1)
|
|
3252
|
+
for (let Z of S)
|
|
3253
|
+
zn.p(Z, d.loc);
|
|
3254
|
+
let T = ii(d);
|
|
3255
|
+
ia(d) && _t.p(w, d.loc), In.add(w), nt.push(T), Mn.p(T, d.loc);
|
|
3256
|
+
let [{ value: A }] = Me(d), v = A.a, b = A.b, L = A.c, D = [v, b, L];
|
|
3257
|
+
return Pn.p(v + "," + b + "," + L, d.loc), $n.push(v), Nn.push(b), Dn.push(L), ve === void 0 && (ve = D), Ae === void 0 && (Ae = D), Ae !== void 0 && Lr(Ae, D) < 0 && (Ae = D), ve !== void 0 && Lr(ve, D) > 0 && (ve = D), Fn.push(D), v > 0 && Tt.p(w, d.loc), oa(d, function(re) {
|
|
3258
|
+
Rn.p(re.name, re.loc);
|
|
3259
|
+
}), this.skip;
|
|
3260
|
+
}
|
|
3261
|
+
case ei: {
|
|
3262
|
+
if (!this.declaration)
|
|
3263
|
+
break;
|
|
3264
|
+
let w = d.unit;
|
|
3265
|
+
return ke("\\9", w) ? qt.push(w.substring(0, w.length - 2), this.declaration.property, d.loc) : qt.push(w, this.declaration.property, d.loc), this.skip;
|
|
3266
|
+
}
|
|
3267
|
+
case ta: {
|
|
3268
|
+
if (vn("data:", d.value)) {
|
|
3269
|
+
let w = d.value, S = w.length, T = Ca(w);
|
|
3270
|
+
l.total++, s += S;
|
|
3271
|
+
let A = {
|
|
3272
|
+
/** @type {number} */
|
|
3273
|
+
line: d.loc.start.line,
|
|
3274
|
+
/** @type {number} */
|
|
3275
|
+
column: d.loc.start.column,
|
|
3276
|
+
/** @type {number} */
|
|
3277
|
+
offset: d.loc.start.offset,
|
|
3278
|
+
/** @type {number} */
|
|
3279
|
+
length: d.loc.end.offset - d.loc.start.offset
|
|
3280
|
+
};
|
|
3281
|
+
if (l.unique.has(T)) {
|
|
3282
|
+
let v = l.unique.get(T);
|
|
3283
|
+
v.count++, v.size += S, l.unique.set(T, v), r && v.uniqueWithLocations.push(A);
|
|
3284
|
+
} else {
|
|
3285
|
+
let v = {
|
|
3286
|
+
count: 1,
|
|
3287
|
+
size: S
|
|
3288
|
+
};
|
|
3289
|
+
r && (v.uniqueWithLocations = [A]), l.unique.set(T, v);
|
|
3290
|
+
}
|
|
3291
|
+
}
|
|
3292
|
+
break;
|
|
3293
|
+
}
|
|
3294
|
+
case Jo: {
|
|
3295
|
+
if (ut(d)) {
|
|
3296
|
+
Pt.push(1), Ge.p(o(d), d.loc);
|
|
3297
|
+
break;
|
|
3298
|
+
}
|
|
3299
|
+
let w = this.declaration, { property: S, important: T } = w, A = 1;
|
|
3300
|
+
si(d) && (jn.p(o(d), d.loc), A++), typeof T == "string" && (Mt.p(a(d) + "!" + T, d.loc), A++), ba(d) && (Mt.p(o(d), d.loc), A++);
|
|
3301
|
+
let v = d.children, b = d.loc;
|
|
3302
|
+
if (Pt.push(A), G("z-index", S))
|
|
3303
|
+
return Un.p(o(d), b), this.skip;
|
|
3304
|
+
if (G("font", S)) {
|
|
3305
|
+
if (sn(d)) return;
|
|
3306
|
+
let { font_size: L, line_height: D, font_family: Z } = da(d, o, function(re) {
|
|
3307
|
+
re.type === "keyword" && Ge.p(re.value, b);
|
|
3308
|
+
});
|
|
3309
|
+
Z && Ft.p(Z, b), L && zt.p(L, b), D && Rt.p(D, b);
|
|
3310
|
+
break;
|
|
3311
|
+
} else if (G("font-size", S)) {
|
|
3312
|
+
sn(d) || zt.p(o(d), b);
|
|
3313
|
+
break;
|
|
3314
|
+
} else if (G("font-family", S)) {
|
|
3315
|
+
sn(d) || Ft.p(o(d), b);
|
|
3316
|
+
break;
|
|
3317
|
+
} else if (G("line-height", S))
|
|
3318
|
+
Rt.p(o(d), b);
|
|
3319
|
+
else if (G("transition", S) || G("animation", S)) {
|
|
3320
|
+
ka(v, function(L) {
|
|
3321
|
+
L.type === "fn" ? st.p(o(L.value), b) : L.type === "duration" ? ot.p(o(L.value), b) : L.type === "keyword" && Ge.p(o(L.value), b);
|
|
3322
|
+
});
|
|
3323
|
+
break;
|
|
3324
|
+
} else if (G("animation-duration", S) || G("transition-duration", S)) {
|
|
3325
|
+
v && v.size > 1 ? v.forEach((L) => {
|
|
3326
|
+
L.type !== ze && ot.p(o(L), b);
|
|
3327
|
+
}) : ot.p(o(d), b);
|
|
3328
|
+
break;
|
|
3329
|
+
} else if (G("transition-timing-function", S) || G("animation-timing-function", S)) {
|
|
3330
|
+
v && v.size > 1 ? v.forEach((L) => {
|
|
3331
|
+
L.type !== ze && st.p(o(L), b);
|
|
3332
|
+
}) : st.p(o(d), b);
|
|
3333
|
+
break;
|
|
3334
|
+
} else if (wa.has(xa(S))) {
|
|
3335
|
+
ut(d) || Wn.push(o(d), S, b);
|
|
3336
|
+
break;
|
|
3337
|
+
} else G("text-shadow", S) ? ut(d) || Vn.p(o(d), b) : G("box-shadow", S) && (ut(d) || Gn.p(o(d), b));
|
|
3338
|
+
pe(d, function(L) {
|
|
3339
|
+
let D = L.name;
|
|
3340
|
+
switch (L.type) {
|
|
3341
|
+
case ea: {
|
|
3342
|
+
let Z = L.value.length;
|
|
3343
|
+
return ke("\\9", L.value) && (Z = Z - 2), Ie.push("#" + L.value, S, b), $e.p("hex" + Z, b), this.skip;
|
|
3344
|
+
}
|
|
3345
|
+
case de: {
|
|
3346
|
+
At.has(D) && Ge.p(D, b);
|
|
3347
|
+
let Z = D.length;
|
|
3348
|
+
if (Z > 20 || Z < 3)
|
|
3349
|
+
return this.skip;
|
|
3350
|
+
if (ua.has(D)) {
|
|
3351
|
+
let re = o(L);
|
|
3352
|
+
Ie.push(re, S, b), $e.p(D.toLowerCase(), b);
|
|
3353
|
+
return;
|
|
3354
|
+
}
|
|
3355
|
+
if (aa.has(D)) {
|
|
3356
|
+
let re = o(L);
|
|
3357
|
+
Ie.push(re, S, b), $e.p("named", b);
|
|
3358
|
+
return;
|
|
3359
|
+
}
|
|
3360
|
+
if (la.has(D)) {
|
|
3361
|
+
let re = o(L);
|
|
3362
|
+
Ie.push(re, S, b), $e.p("system", b);
|
|
3363
|
+
return;
|
|
3364
|
+
}
|
|
3365
|
+
return this.skip;
|
|
3366
|
+
}
|
|
3367
|
+
case Ln: {
|
|
3368
|
+
if (W("var", D))
|
|
3369
|
+
return this.skip;
|
|
3370
|
+
if (ca.has(D)) {
|
|
3371
|
+
Ie.push(o(L), S, L.loc), $e.p(D.toLowerCase(), L.loc);
|
|
3372
|
+
return;
|
|
3373
|
+
}
|
|
3374
|
+
if (ke("gradient", D)) {
|
|
3375
|
+
Hn.p(o(L), L.loc);
|
|
3376
|
+
return;
|
|
3377
|
+
}
|
|
3378
|
+
}
|
|
3379
|
+
}
|
|
3380
|
+
});
|
|
3381
|
+
break;
|
|
3382
|
+
}
|
|
3383
|
+
case pn: {
|
|
3384
|
+
if (this.atrulePrelude !== null)
|
|
3385
|
+
return this.skip;
|
|
3386
|
+
je++;
|
|
3387
|
+
let w = 1;
|
|
3388
|
+
qn.add(o(d)), d.important === !0 && (rt++, w++, this.atrule && ke("keyframes", this.atrule.name) && (It++, w++)), Bn.push(w);
|
|
3389
|
+
let { property: S, loc: { start: T } } = d, A = {
|
|
3390
|
+
start: {
|
|
3391
|
+
line: T.line,
|
|
3392
|
+
column: T.column,
|
|
3393
|
+
offset: T.offset
|
|
3394
|
+
},
|
|
3395
|
+
end: {
|
|
3396
|
+
offset: T.offset + S.length
|
|
3397
|
+
}
|
|
3398
|
+
};
|
|
3399
|
+
Ue.p(S, A), we(S) ? (Dt.p(S, A), Ve.push(2)) : Sa(S) ? (Nt.p(S, A), Ve.push(2)) : En(S) ? (it.p(S, A), Ve.push(d.important ? 3 : 2), d.important === !0 && $t.p(S, A)) : Ve.push(1);
|
|
3400
|
+
break;
|
|
3401
|
+
}
|
|
3402
|
+
}
|
|
3403
|
+
});
|
|
3404
|
+
let Kn = qn.size, Ne = nt.size(), Bt = $n.aggregate(), jt = Nn.aggregate(), Ut = Dn.aggregate(), Qn = In.size, F = Object.assign, Jn = t.length, Vt = me.length, Yn = V.aggregate(), Xn = nt.aggregate(), Zn = Bn.aggregate(), er = Ve.aggregate(), tr = Pt.aggregate();
|
|
3405
|
+
return {
|
|
3406
|
+
stylesheet: {
|
|
3407
|
+
sourceLinesOfCode: q + Ne + je + Et.size(),
|
|
3408
|
+
linesOfCode: _,
|
|
3409
|
+
size: Jn,
|
|
3410
|
+
complexity: Yn.sum + Xn.sum + Zn.sum + er.sum + tr.sum,
|
|
3411
|
+
comments: {
|
|
3412
|
+
total: f,
|
|
3413
|
+
size: c
|
|
3414
|
+
},
|
|
3415
|
+
embeddedContent: {
|
|
3416
|
+
size: {
|
|
3417
|
+
total: s,
|
|
3418
|
+
ratio: B(s, Jn)
|
|
3419
|
+
},
|
|
3420
|
+
types: {
|
|
3421
|
+
total: l.total,
|
|
3422
|
+
totalUnique: l.unique.size,
|
|
3423
|
+
uniquenessRatio: B(l.unique.size, l.total),
|
|
3424
|
+
unique: Object.fromEntries(l.unique)
|
|
3425
|
+
}
|
|
3426
|
+
}
|
|
3427
|
+
},
|
|
3428
|
+
atrules: {
|
|
3429
|
+
fontface: F({
|
|
3430
|
+
total: Vt,
|
|
3431
|
+
totalUnique: Vt,
|
|
3432
|
+
unique: me,
|
|
3433
|
+
uniquenessRatio: Vt === 0 ? 0 : 1
|
|
3434
|
+
}, r ? {
|
|
3435
|
+
uniqueWithLocations: Oe.c().uniqueWithLocations
|
|
3436
|
+
} : {}),
|
|
3437
|
+
import: Y.c(),
|
|
3438
|
+
media: F(
|
|
3439
|
+
Ze.c(),
|
|
3440
|
+
{
|
|
3441
|
+
browserhacks: et.c()
|
|
3442
|
+
}
|
|
3443
|
+
),
|
|
3444
|
+
charset: tt.c(),
|
|
3445
|
+
supports: F(
|
|
3446
|
+
u.c(),
|
|
3447
|
+
{
|
|
3448
|
+
browserhacks: h.c()
|
|
3449
|
+
}
|
|
3450
|
+
),
|
|
3451
|
+
keyframes: F(
|
|
3452
|
+
g.c(),
|
|
3453
|
+
{
|
|
3454
|
+
prefixed: F(
|
|
3455
|
+
p.c(),
|
|
3456
|
+
{
|
|
3457
|
+
ratio: B(p.size(), g.size())
|
|
3458
|
+
}
|
|
3459
|
+
)
|
|
3460
|
+
}
|
|
3461
|
+
),
|
|
3462
|
+
container: X.c(),
|
|
3463
|
+
layer: Be.c(),
|
|
3464
|
+
property: j.c(),
|
|
3465
|
+
total: q,
|
|
3466
|
+
complexity: Yn
|
|
3467
|
+
},
|
|
3468
|
+
rules: {
|
|
3469
|
+
total: xe,
|
|
3470
|
+
empty: {
|
|
3471
|
+
total: R,
|
|
3472
|
+
ratio: B(R, xe)
|
|
3473
|
+
},
|
|
3474
|
+
sizes: F(
|
|
3475
|
+
Ce.aggregate(),
|
|
3476
|
+
{
|
|
3477
|
+
items: Ce.toArray()
|
|
3478
|
+
},
|
|
3479
|
+
_n.c()
|
|
3480
|
+
),
|
|
3481
|
+
selectors: F(
|
|
3482
|
+
ge.aggregate(),
|
|
3483
|
+
{
|
|
3484
|
+
items: ge.toArray()
|
|
3485
|
+
},
|
|
3486
|
+
Tn.c()
|
|
3487
|
+
),
|
|
3488
|
+
declarations: F(
|
|
3489
|
+
Lt.aggregate(),
|
|
3490
|
+
{
|
|
3491
|
+
items: Lt.toArray()
|
|
3492
|
+
},
|
|
3493
|
+
On.c()
|
|
3494
|
+
)
|
|
3495
|
+
},
|
|
3496
|
+
selectors: {
|
|
3497
|
+
total: Ne,
|
|
3498
|
+
totalUnique: Qn,
|
|
3499
|
+
uniquenessRatio: B(Qn, Ne),
|
|
3500
|
+
specificity: F(
|
|
3501
|
+
{
|
|
3502
|
+
/** @type Specificity */
|
|
3503
|
+
min: Ae === void 0 ? [0, 0, 0] : Ae,
|
|
3504
|
+
/** @type Specificity */
|
|
3505
|
+
max: ve === void 0 ? [0, 0, 0] : ve,
|
|
3506
|
+
/** @type Specificity */
|
|
3507
|
+
sum: [Bt.sum, jt.sum, Ut.sum],
|
|
3508
|
+
/** @type Specificity */
|
|
3509
|
+
mean: [Bt.mean, jt.mean, Ut.mean],
|
|
3510
|
+
/** @type Specificity */
|
|
3511
|
+
mode: [Bt.mode, jt.mode, Ut.mode],
|
|
3512
|
+
/** @type Specificity */
|
|
3513
|
+
items: Fn
|
|
3514
|
+
},
|
|
3515
|
+
Pn.c()
|
|
3516
|
+
),
|
|
3517
|
+
complexity: F(
|
|
3518
|
+
Xn,
|
|
3519
|
+
Mn.c(),
|
|
3520
|
+
{
|
|
3521
|
+
items: nt.toArray()
|
|
3522
|
+
}
|
|
3523
|
+
),
|
|
3524
|
+
id: F(
|
|
3525
|
+
Tt.c(),
|
|
3526
|
+
{
|
|
3527
|
+
ratio: B(Tt.size(), Ne)
|
|
3528
|
+
}
|
|
3529
|
+
),
|
|
3530
|
+
pseudoClasses: zn.c(),
|
|
3531
|
+
accessibility: F(
|
|
3532
|
+
Ot.c(),
|
|
3533
|
+
{
|
|
3534
|
+
ratio: B(Ot.size(), Ne)
|
|
3535
|
+
}
|
|
3536
|
+
),
|
|
3537
|
+
keyframes: Et.c(),
|
|
3538
|
+
prefixed: F(
|
|
3539
|
+
_t.c(),
|
|
3540
|
+
{
|
|
3541
|
+
ratio: B(_t.size(), Ne)
|
|
3542
|
+
}
|
|
3543
|
+
),
|
|
3544
|
+
combinators: Rn.c()
|
|
3545
|
+
},
|
|
3546
|
+
declarations: {
|
|
3547
|
+
total: je,
|
|
3548
|
+
totalUnique: Kn,
|
|
3549
|
+
uniquenessRatio: B(Kn, je),
|
|
3550
|
+
importants: {
|
|
3551
|
+
total: rt,
|
|
3552
|
+
ratio: B(rt, je),
|
|
3553
|
+
inKeyframes: {
|
|
3554
|
+
total: It,
|
|
3555
|
+
ratio: B(It, rt)
|
|
3556
|
+
}
|
|
3557
|
+
},
|
|
3558
|
+
complexity: Zn
|
|
3559
|
+
},
|
|
3560
|
+
properties: F(
|
|
3561
|
+
Ue.c(),
|
|
3562
|
+
{
|
|
3563
|
+
prefixed: F(
|
|
3564
|
+
Dt.c(),
|
|
3565
|
+
{
|
|
3566
|
+
ratio: B(Dt.size(), Ue.size())
|
|
3567
|
+
}
|
|
3568
|
+
),
|
|
3569
|
+
custom: F(
|
|
3570
|
+
it.c(),
|
|
3571
|
+
{
|
|
3572
|
+
ratio: B(it.size(), Ue.size()),
|
|
3573
|
+
importants: F(
|
|
3574
|
+
$t.c(),
|
|
3575
|
+
{
|
|
3576
|
+
ratio: B($t.size(), it.size())
|
|
3577
|
+
}
|
|
3578
|
+
)
|
|
3579
|
+
}
|
|
3580
|
+
),
|
|
3581
|
+
browserhacks: F(
|
|
3582
|
+
Nt.c(),
|
|
3583
|
+
{
|
|
3584
|
+
ratio: B(Nt.size(), Ue.size())
|
|
3585
|
+
}
|
|
3586
|
+
),
|
|
3587
|
+
complexity: er
|
|
3588
|
+
}
|
|
3589
|
+
),
|
|
3590
|
+
values: {
|
|
3591
|
+
colors: F(
|
|
3592
|
+
Ie.count(),
|
|
3593
|
+
{
|
|
3594
|
+
formats: $e.c()
|
|
3595
|
+
}
|
|
3596
|
+
),
|
|
3597
|
+
gradients: Hn.c(),
|
|
3598
|
+
fontFamilies: Ft.c(),
|
|
3599
|
+
fontSizes: zt.c(),
|
|
3600
|
+
lineHeights: Rt.c(),
|
|
3601
|
+
zindexes: Un.c(),
|
|
3602
|
+
textShadows: Vn.c(),
|
|
3603
|
+
boxShadows: Gn.c(),
|
|
3604
|
+
borderRadiuses: Wn.count(),
|
|
3605
|
+
animations: {
|
|
3606
|
+
durations: ot.c(),
|
|
3607
|
+
timingFunctions: st.c()
|
|
3608
|
+
},
|
|
3609
|
+
prefixes: jn.c(),
|
|
3610
|
+
browserhacks: Mt.c(),
|
|
3611
|
+
units: qt.count(),
|
|
3612
|
+
complexity: tr,
|
|
3613
|
+
keywords: Ge.c()
|
|
3614
|
+
},
|
|
3615
|
+
__meta__: {
|
|
3616
|
+
parseTime: C - m,
|
|
3617
|
+
analyzeTime: Date.now() - C,
|
|
3618
|
+
total: Date.now() - i
|
|
3619
|
+
}
|
|
3620
|
+
};
|
|
3621
|
+
}
|
|
3622
|
+
function Lr(t, e) {
|
|
3623
|
+
return t[0] === e[0] ? t[1] === e[1] ? e[2] - t[2] : e[1] - t[1] : e[0] - t[0];
|
|
3624
|
+
}
|
|
3625
|
+
export {
|
|
3626
|
+
Ea as analyze,
|
|
3627
|
+
Lr as compareSpecificity,
|
|
3628
|
+
we as hasVendorPrefix,
|
|
3629
|
+
ri as isAccessibilitySelector,
|
|
3630
|
+
ra as isMediaBrowserhack,
|
|
3631
|
+
Sa as isPropertyHack,
|
|
3632
|
+
ia as isSelectorPrefixed,
|
|
3633
|
+
na as isSupportsBrowserhack,
|
|
3634
|
+
si as isValuePrefixed,
|
|
3635
|
+
ii as selectorComplexity
|
|
3636
|
+
};
|