@telegraph/style-engine 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/cjs/index.js +1 -49
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.mjs +57 -2368
- package/dist/esm/index.mjs.map +1 -1
- package/package.json +2 -1
package/dist/esm/index.mjs
CHANGED
|
@@ -1,2320 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
fileScope: e,
|
|
8
|
-
css: r
|
|
9
|
-
} = n, t = e.packageName ? [e.packageName, e.filePath].join("/") : e.filePath, a = le[t];
|
|
10
|
-
if (!a) {
|
|
11
|
-
var i = document.createElement("style");
|
|
12
|
-
e.packageName && i.setAttribute("data-package", e.packageName), i.setAttribute("data-file", e.filePath), i.setAttribute("type", "text/css"), a = le[t] = i, document.head.appendChild(i);
|
|
13
|
-
}
|
|
14
|
-
a.innerHTML = r;
|
|
15
|
-
};
|
|
16
|
-
function Be(n) {
|
|
17
|
-
var e = n.match(/^var\((.*)\)$/);
|
|
18
|
-
return e ? e[1] : n;
|
|
19
|
-
}
|
|
20
|
-
function ke(n) {
|
|
21
|
-
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
22
|
-
}
|
|
23
|
-
/*! https://mths.be/cssesc v3.0.0 by @mathias */
|
|
24
|
-
var qe = {}, Ue = qe.hasOwnProperty, $e = function(e, r) {
|
|
25
|
-
if (!e)
|
|
26
|
-
return r;
|
|
27
|
-
var t = {};
|
|
28
|
-
for (var a in r)
|
|
29
|
-
t[a] = Ue.call(e, a) ? e[a] : r[a];
|
|
30
|
-
return t;
|
|
31
|
-
}, We = /[ -,\.\/:-@\[-\^`\{-~]/, Ve = /[ -,\.\/:-@\[\]\^`\{-~]/, Ke = /(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g, re = function n(e, r) {
|
|
32
|
-
r = $e(r, n.options), r.quotes != "single" && r.quotes != "double" && (r.quotes = "single");
|
|
33
|
-
for (var t = r.quotes == "double" ? '"' : "'", a = r.isIdentifier, i = e.charAt(0), l = "", u = 0, o = e.length; u < o; ) {
|
|
34
|
-
var s = e.charAt(u++), p = s.charCodeAt(), h = void 0;
|
|
35
|
-
if (p < 32 || p > 126) {
|
|
36
|
-
if (p >= 55296 && p <= 56319 && u < o) {
|
|
37
|
-
var v = e.charCodeAt(u++);
|
|
38
|
-
(v & 64512) == 56320 ? p = ((p & 1023) << 10) + (v & 1023) + 65536 : u--;
|
|
39
|
-
}
|
|
40
|
-
h = "\\" + p.toString(16).toUpperCase() + " ";
|
|
41
|
-
} else
|
|
42
|
-
r.escapeEverything ? We.test(s) ? h = "\\" + s : h = "\\" + p.toString(16).toUpperCase() + " " : /[\t\n\f\r\x0B]/.test(s) ? h = "\\" + p.toString(16).toUpperCase() + " " : s == "\\" || !a && (s == '"' && t == s || s == "'" && t == s) || a && Ve.test(s) ? h = "\\" + s : h = s;
|
|
43
|
-
l += h;
|
|
44
|
-
}
|
|
45
|
-
return a && (/^-[-\d]/.test(l) ? l = "\\-" + l.slice(1) : /\d/.test(i) && (l = "\\3" + i + " " + l.slice(1))), l = l.replace(Ke, function(c, g, d) {
|
|
46
|
-
return g && g.length % 2 ? c : (g || "") + d;
|
|
47
|
-
}), !a && r.wrap ? t + l + t : l;
|
|
48
|
-
};
|
|
49
|
-
re.options = {
|
|
50
|
-
escapeEverything: !1,
|
|
51
|
-
isIdentifier: !1,
|
|
52
|
-
quotes: "single",
|
|
53
|
-
wrap: !1
|
|
54
|
-
};
|
|
55
|
-
re.version = "3.0.0";
|
|
56
|
-
var He = re;
|
|
57
|
-
const Oe = /* @__PURE__ */ ke(He);
|
|
58
|
-
class Ye {
|
|
59
|
-
constructor(e) {
|
|
60
|
-
const { failure: r, gotoFn: t, output: a } = this._buildTables(e);
|
|
61
|
-
this.gotoFn = t, this.output = a, this.failure = r;
|
|
62
|
-
}
|
|
63
|
-
_buildTables(e) {
|
|
64
|
-
const r = {
|
|
65
|
-
0: {}
|
|
66
|
-
}, t = {};
|
|
67
|
-
let a = 0;
|
|
68
|
-
for (const u of e) {
|
|
69
|
-
let o = 0;
|
|
70
|
-
for (const s of u)
|
|
71
|
-
r[o] && s in r[o] ? o = r[o][s] : (a++, r[o][s] = a, r[a] = {}, o = a, t[a] = []);
|
|
72
|
-
t[o].push(u);
|
|
73
|
-
}
|
|
74
|
-
const i = {}, l = [];
|
|
75
|
-
for (const u in r[0]) {
|
|
76
|
-
const o = r[0][u];
|
|
77
|
-
i[o] = 0, l.push(o);
|
|
78
|
-
}
|
|
79
|
-
for (; l.length > 0; ) {
|
|
80
|
-
const u = l.shift();
|
|
81
|
-
if (u !== void 0)
|
|
82
|
-
for (const o in r[u]) {
|
|
83
|
-
const s = r[u][o];
|
|
84
|
-
l.push(s);
|
|
85
|
-
let p = i[u];
|
|
86
|
-
for (; p > 0 && !(o in r[p]); )
|
|
87
|
-
p = i[p];
|
|
88
|
-
if (o in r[p]) {
|
|
89
|
-
const h = r[p][o];
|
|
90
|
-
i[s] = h, t[s] = [...t[s], ...t[h]];
|
|
91
|
-
} else
|
|
92
|
-
i[s] = 0;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
return {
|
|
96
|
-
gotoFn: r,
|
|
97
|
-
output: t,
|
|
98
|
-
failure: i
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
search(e) {
|
|
102
|
-
let r = 0;
|
|
103
|
-
const t = [];
|
|
104
|
-
for (let a = 0; a < e.length; a++) {
|
|
105
|
-
const i = e[a];
|
|
106
|
-
for (; r > 0 && !(i in this.gotoFn[r]); )
|
|
107
|
-
r = this.failure[r];
|
|
108
|
-
if (i in this.gotoFn[r] && (r = this.gotoFn[r][i], this.output[r].length > 0)) {
|
|
109
|
-
const l = this.output[r];
|
|
110
|
-
t.push([a, l]);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
return t;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
var Ze = {
|
|
117
|
-
appendCss: () => {
|
|
118
|
-
},
|
|
119
|
-
registerClassName: () => {
|
|
120
|
-
},
|
|
121
|
-
onEndFileScope: () => {
|
|
122
|
-
},
|
|
123
|
-
registerComposition: () => {
|
|
124
|
-
},
|
|
125
|
-
markCompositionUsed: () => {
|
|
126
|
-
},
|
|
127
|
-
getIdentOption: () => process.env.NODE_ENV === "production" ? "short" : "debug"
|
|
128
|
-
}, W = [Ze], B = () => {
|
|
129
|
-
if (W.length < 1)
|
|
130
|
-
throw new Error("No adapter configured");
|
|
131
|
-
return W[W.length - 1];
|
|
132
|
-
}, Ee = !1, Ge = (n) => {
|
|
133
|
-
Ee || Je(n);
|
|
134
|
-
}, Je = (n) => {
|
|
135
|
-
if (!n)
|
|
136
|
-
throw new Error('No adapter provided when calling "setAdapter"');
|
|
137
|
-
Ee = !0, W.push(n);
|
|
138
|
-
}, xe = function() {
|
|
139
|
-
return B().appendCss(...arguments);
|
|
140
|
-
}, je = function() {
|
|
141
|
-
return B().registerClassName(...arguments);
|
|
142
|
-
}, Xe = function() {
|
|
143
|
-
return B().registerComposition(...arguments);
|
|
144
|
-
}, Pe = function() {
|
|
145
|
-
return B().markCompositionUsed(...arguments);
|
|
146
|
-
}, _e = function() {
|
|
147
|
-
var e = B();
|
|
148
|
-
return "getIdentOption" in e ? e.getIdentOption(...arguments) : process.env.NODE_ENV === "production" ? "short" : "debug";
|
|
149
|
-
};
|
|
150
|
-
function te(n, e) {
|
|
151
|
-
return e || (e = n.slice(0)), Object.freeze(Object.defineProperties(n, {
|
|
152
|
-
raw: {
|
|
153
|
-
value: Object.freeze(e)
|
|
154
|
-
}
|
|
155
|
-
}));
|
|
156
|
-
}
|
|
157
|
-
var m;
|
|
158
|
-
(function(n) {
|
|
159
|
-
n.Attribute = "attribute", n.Pseudo = "pseudo", n.PseudoElement = "pseudo-element", n.Tag = "tag", n.Universal = "universal", n.Adjacent = "adjacent", n.Child = "child", n.Descendant = "descendant", n.Parent = "parent", n.Sibling = "sibling", n.ColumnCombinator = "column-combinator";
|
|
160
|
-
})(m || (m = {}));
|
|
161
|
-
var x;
|
|
162
|
-
(function(n) {
|
|
163
|
-
n.Any = "any", n.Element = "element", n.End = "end", n.Equals = "equals", n.Exists = "exists", n.Hyphen = "hyphen", n.Not = "not", n.Start = "start";
|
|
164
|
-
})(x || (x = {}));
|
|
165
|
-
const oe = /^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/, Qe = /\\([\da-f]{1,6}\s?|(\s)|.)/gi, Te = /* @__PURE__ */ new Map([
|
|
166
|
-
[126, x.Element],
|
|
167
|
-
[94, x.Start],
|
|
168
|
-
[36, x.End],
|
|
169
|
-
[42, x.Any],
|
|
170
|
-
[33, x.Not],
|
|
171
|
-
[124, x.Hyphen]
|
|
172
|
-
]), er = /* @__PURE__ */ new Set([
|
|
173
|
-
"has",
|
|
174
|
-
"not",
|
|
175
|
-
"matches",
|
|
176
|
-
"is",
|
|
177
|
-
"where",
|
|
178
|
-
"host",
|
|
179
|
-
"host-context"
|
|
180
|
-
]);
|
|
181
|
-
function rr(n) {
|
|
182
|
-
switch (n.type) {
|
|
183
|
-
case m.Adjacent:
|
|
184
|
-
case m.Child:
|
|
185
|
-
case m.Descendant:
|
|
186
|
-
case m.Parent:
|
|
187
|
-
case m.Sibling:
|
|
188
|
-
case m.ColumnCombinator:
|
|
189
|
-
return !0;
|
|
190
|
-
default:
|
|
191
|
-
return !1;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
const tr = /* @__PURE__ */ new Set(["contains", "icontains"]);
|
|
195
|
-
function ar(n, e, r) {
|
|
196
|
-
const t = parseInt(e, 16) - 65536;
|
|
197
|
-
return t !== t || r ? e : t < 0 ? (
|
|
198
|
-
// BMP codepoint
|
|
199
|
-
String.fromCharCode(t + 65536)
|
|
200
|
-
) : (
|
|
201
|
-
// Supplemental Plane codepoint (surrogate pair)
|
|
202
|
-
String.fromCharCode(t >> 10 | 55296, t & 1023 | 56320)
|
|
203
|
-
);
|
|
204
|
-
}
|
|
205
|
-
function F(n) {
|
|
206
|
-
return n.replace(Qe, ar);
|
|
207
|
-
}
|
|
208
|
-
function J(n) {
|
|
209
|
-
return n === 39 || n === 34;
|
|
210
|
-
}
|
|
211
|
-
function ue(n) {
|
|
212
|
-
return n === 32 || n === 9 || n === 10 || n === 12 || n === 13;
|
|
213
|
-
}
|
|
214
|
-
function nr(n) {
|
|
215
|
-
const e = [], r = Me(e, `${n}`, 0);
|
|
216
|
-
if (r < n.length)
|
|
217
|
-
throw new Error(`Unmatched selector: ${n.slice(r)}`);
|
|
218
|
-
return e;
|
|
219
|
-
}
|
|
220
|
-
function Me(n, e, r) {
|
|
221
|
-
let t = [];
|
|
222
|
-
function a(v) {
|
|
223
|
-
const c = e.slice(r + v).match(oe);
|
|
224
|
-
if (!c)
|
|
225
|
-
throw new Error(`Expected name, found ${e.slice(r)}`);
|
|
226
|
-
const [g] = c;
|
|
227
|
-
return r += v + g.length, F(g);
|
|
228
|
-
}
|
|
229
|
-
function i(v) {
|
|
230
|
-
for (r += v; r < e.length && ue(e.charCodeAt(r)); )
|
|
231
|
-
r++;
|
|
232
|
-
}
|
|
233
|
-
function l() {
|
|
234
|
-
r += 1;
|
|
235
|
-
const v = r;
|
|
236
|
-
let c = 1;
|
|
237
|
-
for (; c > 0 && r < e.length; r++)
|
|
238
|
-
e.charCodeAt(r) === 40 && !u(r) ? c++ : e.charCodeAt(r) === 41 && !u(r) && c--;
|
|
239
|
-
if (c)
|
|
240
|
-
throw new Error("Parenthesis not matched");
|
|
241
|
-
return F(e.slice(v, r - 1));
|
|
242
|
-
}
|
|
243
|
-
function u(v) {
|
|
244
|
-
let c = 0;
|
|
245
|
-
for (; e.charCodeAt(--v) === 92; )
|
|
246
|
-
c++;
|
|
247
|
-
return (c & 1) === 1;
|
|
248
|
-
}
|
|
249
|
-
function o() {
|
|
250
|
-
if (t.length > 0 && rr(t[t.length - 1]))
|
|
251
|
-
throw new Error("Did not expect successive traversals.");
|
|
252
|
-
}
|
|
253
|
-
function s(v) {
|
|
254
|
-
if (t.length > 0 && t[t.length - 1].type === m.Descendant) {
|
|
255
|
-
t[t.length - 1].type = v;
|
|
256
|
-
return;
|
|
257
|
-
}
|
|
258
|
-
o(), t.push({ type: v });
|
|
259
|
-
}
|
|
260
|
-
function p(v, c) {
|
|
261
|
-
t.push({
|
|
262
|
-
type: m.Attribute,
|
|
263
|
-
name: v,
|
|
264
|
-
action: c,
|
|
265
|
-
value: a(1),
|
|
266
|
-
namespace: null,
|
|
267
|
-
ignoreCase: "quirks"
|
|
268
|
-
});
|
|
269
|
-
}
|
|
270
|
-
function h() {
|
|
271
|
-
if (t.length && t[t.length - 1].type === m.Descendant && t.pop(), t.length === 0)
|
|
272
|
-
throw new Error("Empty sub-selector");
|
|
273
|
-
n.push(t);
|
|
274
|
-
}
|
|
275
|
-
if (i(0), e.length === r)
|
|
276
|
-
return r;
|
|
277
|
-
e: for (; r < e.length; ) {
|
|
278
|
-
const v = e.charCodeAt(r);
|
|
279
|
-
switch (v) {
|
|
280
|
-
case 32:
|
|
281
|
-
case 9:
|
|
282
|
-
case 10:
|
|
283
|
-
case 12:
|
|
284
|
-
case 13: {
|
|
285
|
-
(t.length === 0 || t[0].type !== m.Descendant) && (o(), t.push({ type: m.Descendant })), i(1);
|
|
286
|
-
break;
|
|
287
|
-
}
|
|
288
|
-
case 62: {
|
|
289
|
-
s(m.Child), i(1);
|
|
290
|
-
break;
|
|
291
|
-
}
|
|
292
|
-
case 60: {
|
|
293
|
-
s(m.Parent), i(1);
|
|
294
|
-
break;
|
|
295
|
-
}
|
|
296
|
-
case 126: {
|
|
297
|
-
s(m.Sibling), i(1);
|
|
298
|
-
break;
|
|
299
|
-
}
|
|
300
|
-
case 43: {
|
|
301
|
-
s(m.Adjacent), i(1);
|
|
302
|
-
break;
|
|
303
|
-
}
|
|
304
|
-
case 46: {
|
|
305
|
-
p("class", x.Element);
|
|
306
|
-
break;
|
|
307
|
-
}
|
|
308
|
-
case 35: {
|
|
309
|
-
p("id", x.Equals);
|
|
310
|
-
break;
|
|
311
|
-
}
|
|
312
|
-
case 91: {
|
|
313
|
-
i(1);
|
|
314
|
-
let c, g = null;
|
|
315
|
-
e.charCodeAt(r) === 124 ? c = a(1) : e.startsWith("*|", r) ? (g = "*", c = a(2)) : (c = a(0), e.charCodeAt(r) === 124 && e.charCodeAt(r + 1) !== 61 && (g = c, c = a(1))), i(0);
|
|
316
|
-
let d = x.Exists;
|
|
317
|
-
const f = Te.get(e.charCodeAt(r));
|
|
318
|
-
if (f) {
|
|
319
|
-
if (d = f, e.charCodeAt(r + 1) !== 61)
|
|
320
|
-
throw new Error("Expected `=`");
|
|
321
|
-
i(2);
|
|
322
|
-
} else e.charCodeAt(r) === 61 && (d = x.Equals, i(1));
|
|
323
|
-
let S = "", b = null;
|
|
324
|
-
if (d !== "exists") {
|
|
325
|
-
if (J(e.charCodeAt(r))) {
|
|
326
|
-
const O = e.charCodeAt(r);
|
|
327
|
-
let A = r + 1;
|
|
328
|
-
for (; A < e.length && (e.charCodeAt(A) !== O || u(A)); )
|
|
329
|
-
A += 1;
|
|
330
|
-
if (e.charCodeAt(A) !== O)
|
|
331
|
-
throw new Error("Attribute value didn't end");
|
|
332
|
-
S = F(e.slice(r + 1, A)), r = A + 1;
|
|
333
|
-
} else {
|
|
334
|
-
const O = r;
|
|
335
|
-
for (; r < e.length && (!ue(e.charCodeAt(r)) && e.charCodeAt(r) !== 93 || u(r)); )
|
|
336
|
-
r += 1;
|
|
337
|
-
S = F(e.slice(O, r));
|
|
338
|
-
}
|
|
339
|
-
i(0);
|
|
340
|
-
const C = e.charCodeAt(r) | 32;
|
|
341
|
-
C === 115 ? (b = !1, i(1)) : C === 105 && (b = !0, i(1));
|
|
342
|
-
}
|
|
343
|
-
if (e.charCodeAt(r) !== 93)
|
|
344
|
-
throw new Error("Attribute selector didn't terminate");
|
|
345
|
-
r += 1;
|
|
346
|
-
const w = {
|
|
347
|
-
type: m.Attribute,
|
|
348
|
-
name: c,
|
|
349
|
-
action: d,
|
|
350
|
-
value: S,
|
|
351
|
-
namespace: g,
|
|
352
|
-
ignoreCase: b
|
|
353
|
-
};
|
|
354
|
-
t.push(w);
|
|
355
|
-
break;
|
|
356
|
-
}
|
|
357
|
-
case 58: {
|
|
358
|
-
if (e.charCodeAt(r + 1) === 58) {
|
|
359
|
-
t.push({
|
|
360
|
-
type: m.PseudoElement,
|
|
361
|
-
name: a(2).toLowerCase(),
|
|
362
|
-
data: e.charCodeAt(r) === 40 ? l() : null
|
|
363
|
-
});
|
|
364
|
-
continue;
|
|
365
|
-
}
|
|
366
|
-
const c = a(1).toLowerCase();
|
|
367
|
-
let g = null;
|
|
368
|
-
if (e.charCodeAt(r) === 40)
|
|
369
|
-
if (er.has(c)) {
|
|
370
|
-
if (J(e.charCodeAt(r + 1)))
|
|
371
|
-
throw new Error(`Pseudo-selector ${c} cannot be quoted`);
|
|
372
|
-
if (g = [], r = Me(g, e, r + 1), e.charCodeAt(r) !== 41)
|
|
373
|
-
throw new Error(`Missing closing parenthesis in :${c} (${e})`);
|
|
374
|
-
r += 1;
|
|
375
|
-
} else {
|
|
376
|
-
if (g = l(), tr.has(c)) {
|
|
377
|
-
const d = g.charCodeAt(0);
|
|
378
|
-
d === g.charCodeAt(g.length - 1) && J(d) && (g = g.slice(1, -1));
|
|
379
|
-
}
|
|
380
|
-
g = F(g);
|
|
381
|
-
}
|
|
382
|
-
t.push({ type: m.Pseudo, name: c, data: g });
|
|
383
|
-
break;
|
|
384
|
-
}
|
|
385
|
-
case 44: {
|
|
386
|
-
h(), t = [], i(1);
|
|
387
|
-
break;
|
|
388
|
-
}
|
|
389
|
-
default: {
|
|
390
|
-
if (e.startsWith("/*", r)) {
|
|
391
|
-
const d = e.indexOf("*/", r + 2);
|
|
392
|
-
if (d < 0)
|
|
393
|
-
throw new Error("Comment was not terminated");
|
|
394
|
-
r = d + 2, t.length === 0 && i(0);
|
|
395
|
-
break;
|
|
396
|
-
}
|
|
397
|
-
let c = null, g;
|
|
398
|
-
if (v === 42)
|
|
399
|
-
r += 1, g = "*";
|
|
400
|
-
else if (v === 124) {
|
|
401
|
-
if (g = "", e.charCodeAt(r + 1) === 124) {
|
|
402
|
-
s(m.ColumnCombinator), i(2);
|
|
403
|
-
break;
|
|
404
|
-
}
|
|
405
|
-
} else if (oe.test(e.slice(r)))
|
|
406
|
-
g = a(0);
|
|
407
|
-
else
|
|
408
|
-
break e;
|
|
409
|
-
e.charCodeAt(r) === 124 && e.charCodeAt(r + 1) !== 124 && (c = g, e.charCodeAt(r + 1) === 42 ? (g = "*", r += 2) : g = a(1)), t.push(g === "*" ? { type: m.Universal, namespace: c } : { type: m.Tag, name: g, namespace: c });
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
return h(), r;
|
|
414
|
-
}
|
|
415
|
-
function se(n, e) {
|
|
416
|
-
var r = Object.keys(n);
|
|
417
|
-
if (Object.getOwnPropertySymbols) {
|
|
418
|
-
var t = Object.getOwnPropertySymbols(n);
|
|
419
|
-
e && (t = t.filter(function(a) {
|
|
420
|
-
return Object.getOwnPropertyDescriptor(n, a).enumerable;
|
|
421
|
-
})), r.push.apply(r, t);
|
|
422
|
-
}
|
|
423
|
-
return r;
|
|
424
|
-
}
|
|
425
|
-
function pe(n) {
|
|
426
|
-
for (var e = 1; e < arguments.length; e++) {
|
|
427
|
-
var r = arguments[e] != null ? arguments[e] : {};
|
|
428
|
-
e % 2 ? se(Object(r), !0).forEach(function(t) {
|
|
429
|
-
ir(n, t, r[t]);
|
|
430
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(r)) : se(Object(r)).forEach(function(t) {
|
|
431
|
-
Object.defineProperty(n, t, Object.getOwnPropertyDescriptor(r, t));
|
|
432
|
-
});
|
|
433
|
-
}
|
|
434
|
-
return n;
|
|
435
|
-
}
|
|
436
|
-
function ir(n, e, r) {
|
|
437
|
-
return e = lr(e), e in n ? Object.defineProperty(n, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : n[e] = r, n;
|
|
438
|
-
}
|
|
439
|
-
function lr(n) {
|
|
440
|
-
var e = or(n, "string");
|
|
441
|
-
return typeof e == "symbol" ? e : String(e);
|
|
442
|
-
}
|
|
443
|
-
function or(n, e) {
|
|
444
|
-
if (typeof n != "object" || n === null) return n;
|
|
445
|
-
var r = n[Symbol.toPrimitive];
|
|
446
|
-
if (r !== void 0) {
|
|
447
|
-
var t = r.call(n, e || "default");
|
|
448
|
-
if (typeof t != "object") return t;
|
|
449
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
450
|
-
}
|
|
451
|
-
return (e === "string" ? String : Number)(n);
|
|
452
|
-
}
|
|
453
|
-
const ae = Le({});
|
|
454
|
-
function Le(n) {
|
|
455
|
-
return e.withOptions = (r) => Le(pe(pe({}, n), r)), e;
|
|
456
|
-
function e(r, ...t) {
|
|
457
|
-
const a = typeof r == "string" ? [r] : r.raw, {
|
|
458
|
-
escapeSpecialCharacters: i = Array.isArray(r)
|
|
459
|
-
} = n;
|
|
460
|
-
let l = "";
|
|
461
|
-
for (let s = 0; s < a.length; s++) {
|
|
462
|
-
let p = a[s];
|
|
463
|
-
i && (p = p.replace(/\\\n[ \t]*/g, "").replace(/\\`/g, "`").replace(/\\\$/g, "$").replace(/\\\{/g, "{")), l += p, s < t.length && (l += t[s]);
|
|
464
|
-
}
|
|
465
|
-
const u = l.split(`
|
|
466
|
-
`);
|
|
467
|
-
let o = null;
|
|
468
|
-
for (const s of u) {
|
|
469
|
-
const p = s.match(/^(\s+)\S+/);
|
|
470
|
-
if (p) {
|
|
471
|
-
const h = p[1].length;
|
|
472
|
-
o ? o = Math.min(o, h) : o = h;
|
|
473
|
-
}
|
|
474
|
-
}
|
|
475
|
-
if (o !== null) {
|
|
476
|
-
const s = o;
|
|
477
|
-
l = u.map((p) => p[0] === " " || p[0] === " " ? p.slice(s) : p).join(`
|
|
478
|
-
`);
|
|
479
|
-
}
|
|
480
|
-
return l = l.trim(), i && (l = l.replace(/\\n/g, `
|
|
481
|
-
`)), l;
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
/*! @license MediaQueryParser - MIT License - Tom Golden (github@tbjgolden.com) */
|
|
485
|
-
/*! *****************************************************************************
|
|
486
|
-
Copyright (c) Microsoft Corporation.
|
|
487
|
-
|
|
488
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
489
|
-
purpose with or without fee is hereby granted.
|
|
490
|
-
|
|
491
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
492
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
493
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
494
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
495
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
496
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
497
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
498
|
-
***************************************************************************** */
|
|
499
|
-
var V = function() {
|
|
500
|
-
return V = Object.assign || function(e) {
|
|
501
|
-
for (var r, t = 1, a = arguments.length; t < a; t++) {
|
|
502
|
-
r = arguments[t];
|
|
503
|
-
for (var i in r) Object.prototype.hasOwnProperty.call(r, i) && (e[i] = r[i]);
|
|
504
|
-
}
|
|
505
|
-
return e;
|
|
506
|
-
}, V.apply(this, arguments);
|
|
507
|
-
};
|
|
508
|
-
function Q(n, e) {
|
|
509
|
-
var r = {};
|
|
510
|
-
for (var t in n) Object.prototype.hasOwnProperty.call(n, t) && e.indexOf(t) < 0 && (r[t] = n[t]);
|
|
511
|
-
if (n != null && typeof Object.getOwnPropertySymbols == "function")
|
|
512
|
-
for (var a = 0, t = Object.getOwnPropertySymbols(n); a < t.length; a++)
|
|
513
|
-
e.indexOf(t[a]) < 0 && Object.prototype.propertyIsEnumerable.call(n, t[a]) && (r[t[a]] = n[t[a]]);
|
|
514
|
-
return r;
|
|
515
|
-
}
|
|
516
|
-
function ur(n) {
|
|
517
|
-
var e = typeof Symbol == "function" && Symbol.iterator, r = e && n[e], t = 0;
|
|
518
|
-
if (r) return r.call(n);
|
|
519
|
-
if (n && typeof n.length == "number") return {
|
|
520
|
-
next: function() {
|
|
521
|
-
return n && t >= n.length && (n = void 0), { value: n && n[t++], done: !n };
|
|
522
|
-
}
|
|
523
|
-
};
|
|
524
|
-
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
525
|
-
}
|
|
526
|
-
function y(n, e) {
|
|
527
|
-
var r = typeof Symbol == "function" && n[Symbol.iterator];
|
|
528
|
-
if (!r) return n;
|
|
529
|
-
var t = r.call(n), a, i = [], l;
|
|
530
|
-
try {
|
|
531
|
-
for (; (e === void 0 || e-- > 0) && !(a = t.next()).done; ) i.push(a.value);
|
|
532
|
-
} catch (u) {
|
|
533
|
-
l = { error: u };
|
|
534
|
-
} finally {
|
|
535
|
-
try {
|
|
536
|
-
a && !a.done && (r = t.return) && r.call(t);
|
|
537
|
-
} finally {
|
|
538
|
-
if (l) throw l.error;
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
return i;
|
|
542
|
-
}
|
|
543
|
-
var sr = /(\u000D|\u000C|\u000D\u000A)/g, pr = /[\u0000\uD800-\uDFFF]/g, hr = /(\/\*)[\s\S]*?(\*\/)/g, fr = function(e, r) {
|
|
544
|
-
r === void 0 && (r = 0), e = e.replace(sr, `
|
|
545
|
-
`).replace(pr, "�"), e = e.replace(hr, "");
|
|
546
|
-
for (var t = []; r < e.length; r += 1) {
|
|
547
|
-
var a = e.charCodeAt(r);
|
|
548
|
-
if (a === 9 || a === 32 || a === 10) {
|
|
549
|
-
for (var i = e.charCodeAt(++r); i === 9 || i === 32 || i === 10; )
|
|
550
|
-
i = e.charCodeAt(++r);
|
|
551
|
-
r -= 1, t.push({
|
|
552
|
-
type: "<whitespace-token>"
|
|
553
|
-
});
|
|
554
|
-
} else if (a === 34) {
|
|
555
|
-
var l = he(e, r);
|
|
556
|
-
if (l === null)
|
|
557
|
-
return null;
|
|
558
|
-
var u = y(l, 2), o = u[0], s = u[1];
|
|
559
|
-
t.push({
|
|
560
|
-
type: "<string-token>",
|
|
561
|
-
value: s
|
|
562
|
-
}), r = o;
|
|
563
|
-
} else if (a === 35) {
|
|
564
|
-
if (r + 1 < e.length) {
|
|
565
|
-
var p = e.charCodeAt(r + 1);
|
|
566
|
-
if (p === 95 || p >= 65 && p <= 90 || p >= 97 && p <= 122 || p >= 128 || p >= 48 && p <= 57 || p === 92 && r + 2 < e.length && e.charCodeAt(r + 2) !== 10) {
|
|
567
|
-
var h = ze(e, r + 1) ? "id" : "unrestricted", l = gr(e, r + 1);
|
|
568
|
-
if (l !== null) {
|
|
569
|
-
var v = y(l, 2), o = v[0], s = v[1];
|
|
570
|
-
t.push({
|
|
571
|
-
type: "<hash-token>",
|
|
572
|
-
value: s.toLowerCase(),
|
|
573
|
-
flag: h
|
|
574
|
-
}), r = o;
|
|
575
|
-
continue;
|
|
576
|
-
}
|
|
577
|
-
}
|
|
578
|
-
}
|
|
579
|
-
t.push({
|
|
580
|
-
type: "<delim-token>",
|
|
581
|
-
value: a
|
|
582
|
-
});
|
|
583
|
-
} else if (a === 39) {
|
|
584
|
-
var l = he(e, r);
|
|
585
|
-
if (l === null)
|
|
586
|
-
return null;
|
|
587
|
-
var c = y(l, 2), o = c[0], s = c[1];
|
|
588
|
-
t.push({
|
|
589
|
-
type: "<string-token>",
|
|
590
|
-
value: s
|
|
591
|
-
}), r = o;
|
|
592
|
-
} else if (a === 40)
|
|
593
|
-
t.push({
|
|
594
|
-
type: "<(-token>"
|
|
595
|
-
});
|
|
596
|
-
else if (a === 41)
|
|
597
|
-
t.push({
|
|
598
|
-
type: "<)-token>"
|
|
599
|
-
});
|
|
600
|
-
else if (a === 43) {
|
|
601
|
-
var g = $(e, r);
|
|
602
|
-
if (g === null)
|
|
603
|
-
t.push({
|
|
604
|
-
type: "<delim-token>",
|
|
605
|
-
value: a
|
|
606
|
-
});
|
|
607
|
-
else {
|
|
608
|
-
var d = y(g, 2), o = d[0], f = d[1];
|
|
609
|
-
f[0] === "<dimension-token>" ? t.push({
|
|
610
|
-
type: "<dimension-token>",
|
|
611
|
-
value: f[1],
|
|
612
|
-
unit: f[2].toLowerCase(),
|
|
613
|
-
flag: "number"
|
|
614
|
-
}) : f[0] === "<number-token>" ? t.push({
|
|
615
|
-
type: f[0],
|
|
616
|
-
value: f[1],
|
|
617
|
-
flag: f[2]
|
|
618
|
-
}) : t.push({
|
|
619
|
-
type: f[0],
|
|
620
|
-
value: f[1],
|
|
621
|
-
flag: "number"
|
|
622
|
-
}), r = o;
|
|
623
|
-
}
|
|
624
|
-
} else if (a === 44)
|
|
625
|
-
t.push({
|
|
626
|
-
type: "<comma-token>"
|
|
627
|
-
});
|
|
628
|
-
else if (a === 45) {
|
|
629
|
-
var S = $(e, r);
|
|
630
|
-
if (S !== null) {
|
|
631
|
-
var b = y(S, 2), o = b[0], f = b[1];
|
|
632
|
-
f[0] === "<dimension-token>" ? t.push({
|
|
633
|
-
type: "<dimension-token>",
|
|
634
|
-
value: f[1],
|
|
635
|
-
unit: f[2].toLowerCase(),
|
|
636
|
-
flag: "number"
|
|
637
|
-
}) : f[0] === "<number-token>" ? t.push({
|
|
638
|
-
type: f[0],
|
|
639
|
-
value: f[1],
|
|
640
|
-
flag: f[2]
|
|
641
|
-
}) : t.push({
|
|
642
|
-
type: f[0],
|
|
643
|
-
value: f[1],
|
|
644
|
-
flag: "number"
|
|
645
|
-
}), r = o;
|
|
646
|
-
continue;
|
|
647
|
-
}
|
|
648
|
-
if (r + 2 < e.length) {
|
|
649
|
-
var p = e.charCodeAt(r + 1), w = e.charCodeAt(r + 2);
|
|
650
|
-
if (p === 45 && w === 62) {
|
|
651
|
-
t.push({
|
|
652
|
-
type: "<CDC-token>"
|
|
653
|
-
}), r += 2;
|
|
654
|
-
continue;
|
|
655
|
-
}
|
|
656
|
-
}
|
|
657
|
-
var l = fe(e, r);
|
|
658
|
-
if (l !== null) {
|
|
659
|
-
var C = y(l, 3), o = C[0], s = C[1], O = C[2];
|
|
660
|
-
t.push({
|
|
661
|
-
type: O,
|
|
662
|
-
value: s
|
|
663
|
-
}), r = o;
|
|
664
|
-
continue;
|
|
665
|
-
}
|
|
666
|
-
t.push({
|
|
667
|
-
type: "<delim-token>",
|
|
668
|
-
value: a
|
|
669
|
-
});
|
|
670
|
-
} else if (a === 46) {
|
|
671
|
-
var S = $(e, r);
|
|
672
|
-
if (S === null)
|
|
673
|
-
t.push({
|
|
674
|
-
type: "<delim-token>",
|
|
675
|
-
value: a
|
|
676
|
-
});
|
|
677
|
-
else {
|
|
678
|
-
var A = y(S, 2), o = A[0], f = A[1];
|
|
679
|
-
f[0] === "<dimension-token>" ? t.push({
|
|
680
|
-
type: "<dimension-token>",
|
|
681
|
-
value: f[1],
|
|
682
|
-
unit: f[2].toLowerCase(),
|
|
683
|
-
flag: "number"
|
|
684
|
-
}) : f[0] === "<number-token>" ? t.push({
|
|
685
|
-
type: f[0],
|
|
686
|
-
value: f[1],
|
|
687
|
-
flag: f[2]
|
|
688
|
-
}) : t.push({
|
|
689
|
-
type: f[0],
|
|
690
|
-
value: f[1],
|
|
691
|
-
flag: "number"
|
|
692
|
-
}), r = o;
|
|
693
|
-
continue;
|
|
694
|
-
}
|
|
695
|
-
} else if (a === 58)
|
|
696
|
-
t.push({
|
|
697
|
-
type: "<colon-token>"
|
|
698
|
-
});
|
|
699
|
-
else if (a === 59)
|
|
700
|
-
t.push({
|
|
701
|
-
type: "<semicolon-token>"
|
|
702
|
-
});
|
|
703
|
-
else if (a === 60) {
|
|
704
|
-
if (r + 3 < e.length) {
|
|
705
|
-
var p = e.charCodeAt(r + 1), w = e.charCodeAt(r + 2), Y = e.charCodeAt(r + 3);
|
|
706
|
-
if (p === 33 && w === 45 && Y === 45) {
|
|
707
|
-
t.push({
|
|
708
|
-
type: "<CDO-token>"
|
|
709
|
-
}), r += 3;
|
|
710
|
-
continue;
|
|
711
|
-
}
|
|
712
|
-
}
|
|
713
|
-
t.push({
|
|
714
|
-
type: "<delim-token>",
|
|
715
|
-
value: a
|
|
716
|
-
});
|
|
717
|
-
} else if (a === 64) {
|
|
718
|
-
var l = ne(e, r + 1);
|
|
719
|
-
if (l !== null) {
|
|
720
|
-
var E = y(l, 2), o = E[0], s = E[1];
|
|
721
|
-
t.push({
|
|
722
|
-
type: "<at-keyword-token>",
|
|
723
|
-
value: s.toLowerCase()
|
|
724
|
-
}), r = o;
|
|
725
|
-
continue;
|
|
726
|
-
}
|
|
727
|
-
t.push({
|
|
728
|
-
type: "<delim-token>",
|
|
729
|
-
value: a
|
|
730
|
-
});
|
|
731
|
-
} else if (a === 91)
|
|
732
|
-
t.push({
|
|
733
|
-
type: "<[-token>"
|
|
734
|
-
});
|
|
735
|
-
else if (a === 92) {
|
|
736
|
-
var l = q(e, r);
|
|
737
|
-
if (l === null)
|
|
738
|
-
return null;
|
|
739
|
-
var U = y(l, 2), o = U[0], s = U[1];
|
|
740
|
-
e = e.slice(0, r) + s + e.slice(o + 1), r -= 1;
|
|
741
|
-
} else if (a === 93)
|
|
742
|
-
t.push({
|
|
743
|
-
type: "<]-token>"
|
|
744
|
-
});
|
|
745
|
-
else if (a === 123)
|
|
746
|
-
t.push({
|
|
747
|
-
type: "<{-token>"
|
|
748
|
-
});
|
|
749
|
-
else if (a === 125)
|
|
750
|
-
t.push({
|
|
751
|
-
type: "<}-token>"
|
|
752
|
-
});
|
|
753
|
-
else if (a >= 48 && a <= 57) {
|
|
754
|
-
var l = $(e, r), ie = y(l, 2), o = ie[0], f = ie[1];
|
|
755
|
-
f[0] === "<dimension-token>" ? t.push({
|
|
756
|
-
type: "<dimension-token>",
|
|
757
|
-
value: f[1],
|
|
758
|
-
unit: f[2].toLowerCase(),
|
|
759
|
-
flag: "number"
|
|
760
|
-
}) : f[0] === "<number-token>" ? t.push({
|
|
761
|
-
type: f[0],
|
|
762
|
-
value: f[1],
|
|
763
|
-
flag: f[2]
|
|
764
|
-
}) : t.push({
|
|
765
|
-
type: f[0],
|
|
766
|
-
value: f[1],
|
|
767
|
-
flag: "number"
|
|
768
|
-
}), r = o;
|
|
769
|
-
} else if (a === 95 || a >= 65 && a <= 90 || a >= 97 && a <= 122 || a >= 128) {
|
|
770
|
-
var l = fe(e, r);
|
|
771
|
-
if (l === null)
|
|
772
|
-
return null;
|
|
773
|
-
var Z = y(l, 3), o = Z[0], s = Z[1], O = Z[2];
|
|
774
|
-
t.push({
|
|
775
|
-
type: O,
|
|
776
|
-
value: s
|
|
777
|
-
}), r = o;
|
|
778
|
-
} else
|
|
779
|
-
t.push({
|
|
780
|
-
type: "<delim-token>",
|
|
781
|
-
value: a
|
|
782
|
-
});
|
|
783
|
-
}
|
|
784
|
-
return t.push({
|
|
785
|
-
type: "<EOF-token>"
|
|
786
|
-
}), t;
|
|
787
|
-
}, he = function(e, r) {
|
|
788
|
-
if (e.length <= r + 1) return null;
|
|
789
|
-
for (var t = e.charCodeAt(r), a = [], i = r + 1; i < e.length; i += 1) {
|
|
790
|
-
var l = e.charCodeAt(i);
|
|
791
|
-
if (l === t)
|
|
792
|
-
return [i, String.fromCharCode.apply(null, a)];
|
|
793
|
-
if (l === 92) {
|
|
794
|
-
var u = q(e, i);
|
|
795
|
-
if (u === null) return null;
|
|
796
|
-
var o = y(u, 2), s = o[0], p = o[1];
|
|
797
|
-
a.push(p), i = s;
|
|
798
|
-
} else {
|
|
799
|
-
if (l === 10)
|
|
800
|
-
return null;
|
|
801
|
-
a.push(l);
|
|
802
|
-
}
|
|
803
|
-
}
|
|
804
|
-
return null;
|
|
805
|
-
}, ze = function(e, r) {
|
|
806
|
-
if (e.length <= r) return !1;
|
|
807
|
-
var t = e.charCodeAt(r);
|
|
808
|
-
if (t === 45) {
|
|
809
|
-
if (e.length <= r + 1) return !1;
|
|
810
|
-
var a = e.charCodeAt(r + 1);
|
|
811
|
-
if (a === 45 || a === 95 || a >= 65 && a <= 90 || a >= 97 && a <= 122 || a >= 128)
|
|
812
|
-
return !0;
|
|
813
|
-
if (a === 92) {
|
|
814
|
-
if (e.length <= r + 2) return !1;
|
|
815
|
-
var i = e.charCodeAt(r + 2);
|
|
816
|
-
return i !== 10;
|
|
817
|
-
} else
|
|
818
|
-
return !1;
|
|
819
|
-
} else {
|
|
820
|
-
if (t === 95 || t >= 65 && t <= 90 || t >= 97 && t <= 122 || t >= 128)
|
|
821
|
-
return !0;
|
|
822
|
-
if (t === 92) {
|
|
823
|
-
if (e.length <= r + 1) return !1;
|
|
824
|
-
var a = e.charCodeAt(r + 1);
|
|
825
|
-
return a !== 10;
|
|
826
|
-
} else
|
|
827
|
-
return !1;
|
|
828
|
-
}
|
|
829
|
-
}, q = function(e, r) {
|
|
830
|
-
if (e.length <= r + 1 || e.charCodeAt(r) !== 92) return null;
|
|
831
|
-
var t = e.charCodeAt(r + 1);
|
|
832
|
-
if (t === 10)
|
|
833
|
-
return null;
|
|
834
|
-
if (t >= 48 && t <= 57 || t >= 65 && t <= 70 || t >= 97 && t <= 102) {
|
|
835
|
-
for (var a = [t], i = Math.min(r + 7, e.length), l = r + 2; l < i; l += 1) {
|
|
836
|
-
var u = e.charCodeAt(l);
|
|
837
|
-
if (u >= 48 && u <= 57 || u >= 65 && u <= 70 || u >= 97 && u <= 102)
|
|
838
|
-
a.push(u);
|
|
839
|
-
else
|
|
840
|
-
break;
|
|
841
|
-
}
|
|
842
|
-
if (l < e.length) {
|
|
843
|
-
var o = e.charCodeAt(l);
|
|
844
|
-
(o === 9 || o === 32 || o === 10) && (l += 1);
|
|
845
|
-
}
|
|
846
|
-
return [l - 1, parseInt(String.fromCharCode.apply(null, a), 16)];
|
|
847
|
-
} else
|
|
848
|
-
return [r + 1, t];
|
|
849
|
-
}, $ = function(e, r) {
|
|
850
|
-
var t = cr(e, r);
|
|
851
|
-
if (t === null) return null;
|
|
852
|
-
var a = y(t, 3), i = a[0], l = a[1], u = a[2], o = ne(e, i + 1);
|
|
853
|
-
if (o !== null) {
|
|
854
|
-
var s = y(o, 2), p = s[0], h = s[1];
|
|
855
|
-
return [p, ["<dimension-token>", l, h]];
|
|
856
|
-
}
|
|
857
|
-
return i + 1 < e.length && e.charCodeAt(i + 1) === 37 ? [i + 1, ["<percentage-token>", l]] : [i, ["<number-token>", l, u]];
|
|
858
|
-
}, cr = function(e, r) {
|
|
859
|
-
if (e.length <= r) return null;
|
|
860
|
-
var t = "integer", a = [], i = e.charCodeAt(r);
|
|
861
|
-
for ((i === 43 || i === 45) && (r += 1, i === 45 && a.push(45)); r < e.length; ) {
|
|
862
|
-
var l = e.charCodeAt(r);
|
|
863
|
-
if (l >= 48 && l <= 57)
|
|
864
|
-
a.push(l), r += 1;
|
|
865
|
-
else
|
|
866
|
-
break;
|
|
867
|
-
}
|
|
868
|
-
if (r + 1 < e.length) {
|
|
869
|
-
var u = e.charCodeAt(r), o = e.charCodeAt(r + 1);
|
|
870
|
-
if (u === 46 && o >= 48 && o <= 57)
|
|
871
|
-
for (a.push(u, o), t = "number", r += 2; r < e.length; ) {
|
|
872
|
-
var l = e.charCodeAt(r);
|
|
873
|
-
if (l >= 48 && l <= 57)
|
|
874
|
-
a.push(l), r += 1;
|
|
875
|
-
else
|
|
876
|
-
break;
|
|
877
|
-
}
|
|
878
|
-
}
|
|
879
|
-
if (r + 1 < e.length) {
|
|
880
|
-
var u = e.charCodeAt(r), o = e.charCodeAt(r + 1), s = e.charCodeAt(r + 2);
|
|
881
|
-
if (u === 69 || u === 101) {
|
|
882
|
-
var p = o >= 48 && o <= 57;
|
|
883
|
-
if (p || (o === 43 || o === 45) && s >= 48 && s <= 57)
|
|
884
|
-
for (t = "number", p ? (a.push(69, o), r += 2) : o === 45 ? (a.push(69, 45, s), r += 3) : (a.push(69, s), r += 3); r < e.length; ) {
|
|
885
|
-
var l = e.charCodeAt(r);
|
|
886
|
-
if (l >= 48 && l <= 57)
|
|
887
|
-
a.push(l), r += 1;
|
|
888
|
-
else
|
|
889
|
-
break;
|
|
890
|
-
}
|
|
891
|
-
}
|
|
892
|
-
}
|
|
893
|
-
var h = String.fromCharCode.apply(null, a), v = t === "number" ? parseFloat(h) : parseInt(h);
|
|
894
|
-
return v === -0 && (v = 0), Number.isNaN(v) ? null : [r - 1, v, t];
|
|
895
|
-
}, gr = function(e, r) {
|
|
896
|
-
if (e.length <= r)
|
|
897
|
-
return null;
|
|
898
|
-
for (var t = [], a = e.charCodeAt(r); r < e.length; a = e.charCodeAt(++r)) {
|
|
899
|
-
if (a === 45 || a === 95 || a >= 65 && a <= 90 || a >= 97 && a <= 122 || a >= 128 || a >= 48 && a <= 57) {
|
|
900
|
-
t.push(a);
|
|
901
|
-
continue;
|
|
902
|
-
} else {
|
|
903
|
-
var i = q(e, r);
|
|
904
|
-
if (i !== null) {
|
|
905
|
-
var l = y(i, 2), u = l[0], o = l[1];
|
|
906
|
-
t.push(o), r = u;
|
|
907
|
-
continue;
|
|
908
|
-
}
|
|
909
|
-
}
|
|
910
|
-
break;
|
|
911
|
-
}
|
|
912
|
-
return r === 0 ? null : [r - 1, String.fromCharCode.apply(null, t)];
|
|
913
|
-
}, ne = function(e, r) {
|
|
914
|
-
if (e.length <= r || !ze(e, r))
|
|
915
|
-
return null;
|
|
916
|
-
for (var t = [], a = e.charCodeAt(r); r < e.length; a = e.charCodeAt(++r)) {
|
|
917
|
-
if (a === 45 || a === 95 || a >= 65 && a <= 90 || a >= 97 && a <= 122 || a >= 128 || a >= 48 && a <= 57) {
|
|
918
|
-
t.push(a);
|
|
919
|
-
continue;
|
|
920
|
-
} else {
|
|
921
|
-
var i = q(e, r);
|
|
922
|
-
if (i !== null) {
|
|
923
|
-
var l = y(i, 2), u = l[0], o = l[1];
|
|
924
|
-
t.push(o), r = u;
|
|
925
|
-
continue;
|
|
926
|
-
}
|
|
927
|
-
}
|
|
928
|
-
break;
|
|
929
|
-
}
|
|
930
|
-
return [r - 1, String.fromCharCode.apply(null, t)];
|
|
931
|
-
}, vr = function(e, r) {
|
|
932
|
-
for (var t = e.charCodeAt(r); t === 9 || t === 32 || t === 10; )
|
|
933
|
-
t = e.charCodeAt(++r);
|
|
934
|
-
for (var a = [], i = !1; r < e.length; ) {
|
|
935
|
-
if (t === 41)
|
|
936
|
-
return [r, String.fromCharCode.apply(null, a)];
|
|
937
|
-
if (t === 34 || t === 39 || t === 40)
|
|
938
|
-
return null;
|
|
939
|
-
if (t === 9 || t === 32 || t === 10)
|
|
940
|
-
!i && a.length !== 0 && (i = !0);
|
|
941
|
-
else if (t === 92) {
|
|
942
|
-
var l = q(e, r);
|
|
943
|
-
if (l === null || i) return null;
|
|
944
|
-
var u = y(l, 2), o = u[0], s = u[1];
|
|
945
|
-
a.push(s), r = o;
|
|
946
|
-
} else {
|
|
947
|
-
if (i) return null;
|
|
948
|
-
a.push(t);
|
|
949
|
-
}
|
|
950
|
-
t = e.charCodeAt(++r);
|
|
951
|
-
}
|
|
952
|
-
return null;
|
|
953
|
-
}, fe = function(e, r) {
|
|
954
|
-
var t = ne(e, r);
|
|
955
|
-
if (t === null) return null;
|
|
956
|
-
var a = y(t, 2), i = a[0], l = a[1];
|
|
957
|
-
if (l.toLowerCase() === "url") {
|
|
958
|
-
if (e.length > i + 1) {
|
|
959
|
-
var u = e.charCodeAt(i + 1);
|
|
960
|
-
if (u === 40) {
|
|
961
|
-
for (var o = 2; i + o < e.length; o += 1) {
|
|
962
|
-
var s = e.charCodeAt(i + o);
|
|
963
|
-
if (s === 34 || s === 39)
|
|
964
|
-
return [i + 1, l.toLowerCase(), "<function-token>"];
|
|
965
|
-
if (s !== 9 && s !== 32 && s !== 10) {
|
|
966
|
-
var p = vr(e, i + o);
|
|
967
|
-
if (p === null) return null;
|
|
968
|
-
var h = y(p, 2), v = h[0], c = h[1];
|
|
969
|
-
return [v, c, "<url-token>"];
|
|
970
|
-
}
|
|
971
|
-
}
|
|
972
|
-
return [i + 1, l.toLowerCase(), "<function-token>"];
|
|
973
|
-
}
|
|
974
|
-
}
|
|
975
|
-
} else if (e.length > i + 1) {
|
|
976
|
-
var u = e.charCodeAt(i + 1);
|
|
977
|
-
if (u === 40)
|
|
978
|
-
return [i + 1, l.toLowerCase(), "<function-token>"];
|
|
979
|
-
}
|
|
980
|
-
return [i, l.toLowerCase(), "<ident-token>"];
|
|
981
|
-
}, dr = function(e) {
|
|
982
|
-
for (var r = e.length - 1; r >= 0; r--)
|
|
983
|
-
e[r] = mr(e[r]);
|
|
984
|
-
return e;
|
|
985
|
-
}, mr = function(e) {
|
|
986
|
-
if (e.mediaCondition === null) return e;
|
|
987
|
-
var r = yr(e.mediaCondition);
|
|
988
|
-
return r.operator === null && r.children.length === 1 && "children" in r.children[0] && (r = r.children[0]), {
|
|
989
|
-
mediaPrefix: e.mediaPrefix,
|
|
990
|
-
mediaType: e.mediaType,
|
|
991
|
-
mediaCondition: r
|
|
992
|
-
};
|
|
993
|
-
}, yr = function n(e) {
|
|
994
|
-
for (var r = e.children.length - 1; r >= 0; r--) {
|
|
995
|
-
var t = e.children[r];
|
|
996
|
-
if (!("context" in t)) {
|
|
997
|
-
var a = n(t);
|
|
998
|
-
if (a.operator === null && a.children.length === 1)
|
|
999
|
-
e.children[r] = a.children[0];
|
|
1000
|
-
else if (a.operator === e.operator && (a.operator === "and" || a.operator === "or")) {
|
|
1001
|
-
for (var i = [r, 1], l = 0; l < a.children.length; l++)
|
|
1002
|
-
i.push(a.children[l]);
|
|
1003
|
-
e.children.splice.apply(e.children, i);
|
|
1004
|
-
}
|
|
1005
|
-
}
|
|
1006
|
-
}
|
|
1007
|
-
return e;
|
|
1008
|
-
}, k = function(e, r) {
|
|
1009
|
-
return r instanceof Error ? new Error("".concat(r.message.trim(), `
|
|
1010
|
-
`).concat(e.trim())) : new Error(e.trim());
|
|
1011
|
-
}, br = function(e) {
|
|
1012
|
-
return dr(wr(e));
|
|
1013
|
-
}, wr = function(e) {
|
|
1014
|
-
var r = fr(e.trim());
|
|
1015
|
-
if (r === null)
|
|
1016
|
-
throw k("Failed tokenizing");
|
|
1017
|
-
var t = 0, a = r.length - 1;
|
|
1018
|
-
if (r[0].type === "<at-keyword-token>" && r[0].value === "media") {
|
|
1019
|
-
if (r[1].type !== "<whitespace-token>")
|
|
1020
|
-
throw k("Expected whitespace after media");
|
|
1021
|
-
t = 2;
|
|
1022
|
-
for (var i = 2; i < r.length - 1; i++) {
|
|
1023
|
-
var l = r[i];
|
|
1024
|
-
if (l.type === "<{-token>") {
|
|
1025
|
-
a = i;
|
|
1026
|
-
break;
|
|
1027
|
-
} else if (l.type === "<semicolon-token>")
|
|
1028
|
-
throw k("Expected '{' in media query but found ';'");
|
|
1029
|
-
}
|
|
1030
|
-
}
|
|
1031
|
-
return r = r.slice(t, a), Ar(r);
|
|
1032
|
-
}, Cr = function(e) {
|
|
1033
|
-
for (var r = [], t = !1, a = 0; a < e.length; a++)
|
|
1034
|
-
e[a].type === "<whitespace-token>" ? (t = !0, r.length > 0 && (r[r.length - 1].wsAfter = !0)) : (r.push(V(V({}, e[a]), {
|
|
1035
|
-
wsBefore: t,
|
|
1036
|
-
wsAfter: !1
|
|
1037
|
-
})), t = !1);
|
|
1038
|
-
return r;
|
|
1039
|
-
}, Ar = function(e) {
|
|
1040
|
-
for (var r, t, a = [[]], i = 0; i < e.length; i++) {
|
|
1041
|
-
var l = e[i];
|
|
1042
|
-
l.type === "<comma-token>" ? a.push([]) : a[a.length - 1].push(l);
|
|
1043
|
-
}
|
|
1044
|
-
var u = a.map(Cr);
|
|
1045
|
-
if (u.length === 1 && u[0].length === 0)
|
|
1046
|
-
return [{
|
|
1047
|
-
mediaCondition: null,
|
|
1048
|
-
mediaPrefix: null,
|
|
1049
|
-
mediaType: "all"
|
|
1050
|
-
}];
|
|
1051
|
-
var o = u.map(function(c) {
|
|
1052
|
-
return c.length === 0 ? null : Sr(c);
|
|
1053
|
-
}), s = [];
|
|
1054
|
-
try {
|
|
1055
|
-
for (var p = ur(o), h = p.next(); !h.done; h = p.next()) {
|
|
1056
|
-
var v = h.value;
|
|
1057
|
-
v !== null && s.push(v);
|
|
1058
|
-
}
|
|
1059
|
-
} catch (c) {
|
|
1060
|
-
r = {
|
|
1061
|
-
error: c
|
|
1062
|
-
};
|
|
1063
|
-
} finally {
|
|
1064
|
-
try {
|
|
1065
|
-
h && !h.done && (t = p.return) && t.call(p);
|
|
1066
|
-
} finally {
|
|
1067
|
-
if (r) throw r.error;
|
|
1068
|
-
}
|
|
1069
|
-
}
|
|
1070
|
-
if (s.length === 0)
|
|
1071
|
-
throw k("No valid media queries");
|
|
1072
|
-
return s;
|
|
1073
|
-
}, Sr = function(e) {
|
|
1074
|
-
var r = e[0];
|
|
1075
|
-
if (r.type === "<(-token>")
|
|
1076
|
-
try {
|
|
1077
|
-
return {
|
|
1078
|
-
mediaPrefix: null,
|
|
1079
|
-
mediaType: "all",
|
|
1080
|
-
mediaCondition: X(e, !0)
|
|
1081
|
-
};
|
|
1082
|
-
} catch (h) {
|
|
1083
|
-
throw k("Expected media condition after '('", h);
|
|
1084
|
-
}
|
|
1085
|
-
else if (r.type === "<ident-token>") {
|
|
1086
|
-
var t = null, a = void 0, i = r.value;
|
|
1087
|
-
(i === "only" || i === "not") && (t = i);
|
|
1088
|
-
var l = t === null ? 0 : 1;
|
|
1089
|
-
if (e.length <= l)
|
|
1090
|
-
throw k("Expected extra token in media query");
|
|
1091
|
-
var u = e[l];
|
|
1092
|
-
if (u.type === "<ident-token>") {
|
|
1093
|
-
var o = u.value;
|
|
1094
|
-
if (o === "all")
|
|
1095
|
-
a = "all";
|
|
1096
|
-
else if (o === "print" || o === "screen")
|
|
1097
|
-
a = o;
|
|
1098
|
-
else if (o === "tty" || o === "tv" || o === "projection" || o === "handheld" || o === "braille" || o === "embossed" || o === "aural" || o === "speech")
|
|
1099
|
-
t = t === "not" ? null : "not", a = "all";
|
|
1100
|
-
else
|
|
1101
|
-
throw k("Unknown ident '".concat(o, "' in media query"));
|
|
1102
|
-
} else if (t === "not" && u.type === "<(-token>") {
|
|
1103
|
-
var s = [{
|
|
1104
|
-
type: "<(-token>",
|
|
1105
|
-
wsBefore: !1,
|
|
1106
|
-
wsAfter: !1
|
|
1107
|
-
}];
|
|
1108
|
-
s.push.apply(s, e), s.push({
|
|
1109
|
-
type: "<)-token>",
|
|
1110
|
-
wsBefore: !1,
|
|
1111
|
-
wsAfter: !1
|
|
1112
|
-
});
|
|
1113
|
-
try {
|
|
1114
|
-
return {
|
|
1115
|
-
mediaPrefix: null,
|
|
1116
|
-
mediaType: "all",
|
|
1117
|
-
mediaCondition: X(s, !0)
|
|
1118
|
-
};
|
|
1119
|
-
} catch (h) {
|
|
1120
|
-
throw k("Expected media condition after '('", h);
|
|
1121
|
-
}
|
|
1122
|
-
} else
|
|
1123
|
-
throw k("Invalid media query");
|
|
1124
|
-
if (l + 1 === e.length)
|
|
1125
|
-
return {
|
|
1126
|
-
mediaPrefix: t,
|
|
1127
|
-
mediaType: a,
|
|
1128
|
-
mediaCondition: null
|
|
1129
|
-
};
|
|
1130
|
-
if (l + 4 < e.length) {
|
|
1131
|
-
var p = e[l + 1];
|
|
1132
|
-
if (p.type === "<ident-token>" && p.value === "and")
|
|
1133
|
-
try {
|
|
1134
|
-
return {
|
|
1135
|
-
mediaPrefix: t,
|
|
1136
|
-
mediaType: a,
|
|
1137
|
-
mediaCondition: X(e.slice(l + 2), !1)
|
|
1138
|
-
};
|
|
1139
|
-
} catch (h) {
|
|
1140
|
-
throw k("Expected media condition after 'and'", h);
|
|
1141
|
-
}
|
|
1142
|
-
else
|
|
1143
|
-
throw k("Expected 'and' after media prefix");
|
|
1144
|
-
} else
|
|
1145
|
-
throw k("Expected media condition after media prefix");
|
|
1146
|
-
} else
|
|
1147
|
-
throw k("Expected media condition or media prefix");
|
|
1148
|
-
}, X = function n(e, r, t) {
|
|
1149
|
-
if (t === void 0 && (t = null), e.length < 3 || e[0].type !== "<(-token>" || e[e.length - 1].type !== "<)-token>")
|
|
1150
|
-
throw new Error("Invalid media condition");
|
|
1151
|
-
for (var a = e.length - 1, i = 0, l = 0, u = 0; u < e.length; u++) {
|
|
1152
|
-
var o = e[u];
|
|
1153
|
-
if (o.type === "<(-token>" ? (l += 1, i = Math.max(i, l)) : o.type === "<)-token>" && (l -= 1), l === 0) {
|
|
1154
|
-
a = u;
|
|
1155
|
-
break;
|
|
1156
|
-
}
|
|
1157
|
-
}
|
|
1158
|
-
if (l !== 0)
|
|
1159
|
-
throw new Error(`Mismatched parens
|
|
1160
|
-
Invalid media condition`);
|
|
1161
|
-
var s, p = e.slice(0, a + 1);
|
|
1162
|
-
if (i === 1 ? s = kr(p) : p[1].type === "<ident-token>" && p[1].value === "not" ? s = n(p.slice(2, -1), !0, "not") : s = n(p.slice(1, -1), !0), a === e.length - 1)
|
|
1163
|
-
return {
|
|
1164
|
-
operator: t,
|
|
1165
|
-
children: [s]
|
|
1166
|
-
};
|
|
1167
|
-
var h = e[a + 1];
|
|
1168
|
-
if (h.type !== "<ident-token>")
|
|
1169
|
-
throw new Error(`Invalid operator
|
|
1170
|
-
Invalid media condition`);
|
|
1171
|
-
if (t !== null && t !== h.value)
|
|
1172
|
-
throw new Error("'".concat(h.value, "' and '").concat(t, `' must not be at same level
|
|
1173
|
-
Invalid media condition`));
|
|
1174
|
-
if (h.value === "or" && !r)
|
|
1175
|
-
throw new Error(`Cannot use 'or' at top level of a media query
|
|
1176
|
-
Invalid media condition`);
|
|
1177
|
-
if (h.value !== "and" && h.value !== "or")
|
|
1178
|
-
throw new Error("Invalid operator: '".concat(h.value, `'
|
|
1179
|
-
Invalid media condition`));
|
|
1180
|
-
var v = n(e.slice(a + 2), r, h.value);
|
|
1181
|
-
return {
|
|
1182
|
-
operator: h.value,
|
|
1183
|
-
children: [s].concat(v.children)
|
|
1184
|
-
};
|
|
1185
|
-
}, kr = function(e) {
|
|
1186
|
-
if (e.length < 3 || e[0].type !== "<(-token>" || e[e.length - 1].type !== "<)-token>")
|
|
1187
|
-
throw new Error("Invalid media feature");
|
|
1188
|
-
for (var r = [e[0]], t = 1; t < e.length; t++) {
|
|
1189
|
-
if (t < e.length - 2) {
|
|
1190
|
-
var a = e[t], i = e[t + 1], l = e[t + 2];
|
|
1191
|
-
if (a.type === "<number-token>" && a.value > 0 && i.type === "<delim-token>" && i.value === 47 && l.type === "<number-token>" && l.value > 0) {
|
|
1192
|
-
r.push({
|
|
1193
|
-
type: "<ratio-token>",
|
|
1194
|
-
numerator: a.value,
|
|
1195
|
-
denominator: l.value,
|
|
1196
|
-
wsBefore: a.wsBefore,
|
|
1197
|
-
wsAfter: l.wsAfter
|
|
1198
|
-
}), t += 2;
|
|
1199
|
-
continue;
|
|
1200
|
-
}
|
|
1201
|
-
}
|
|
1202
|
-
r.push(e[t]);
|
|
1203
|
-
}
|
|
1204
|
-
var u = r[1];
|
|
1205
|
-
if (u.type === "<ident-token>" && r.length === 3)
|
|
1206
|
-
return {
|
|
1207
|
-
context: "boolean",
|
|
1208
|
-
feature: u.value
|
|
1209
|
-
};
|
|
1210
|
-
if (r.length === 5 && r[1].type === "<ident-token>" && r[2].type === "<colon-token>") {
|
|
1211
|
-
var o = r[3];
|
|
1212
|
-
if (o.type === "<number-token>" || o.type === "<dimension-token>" || o.type === "<ratio-token>" || o.type === "<ident-token>") {
|
|
1213
|
-
var s = r[1].value, p = null, h = s.slice(0, 4);
|
|
1214
|
-
h === "min-" ? (p = "min", s = s.slice(4)) : h === "max-" && (p = "max", s = s.slice(4)), o.wsBefore, o.wsAfter;
|
|
1215
|
-
var v = Q(o, ["wsBefore", "wsAfter"]);
|
|
1216
|
-
return {
|
|
1217
|
-
context: "value",
|
|
1218
|
-
prefix: p,
|
|
1219
|
-
feature: s,
|
|
1220
|
-
value: v
|
|
1221
|
-
};
|
|
1222
|
-
}
|
|
1223
|
-
} else if (r.length >= 5)
|
|
1224
|
-
try {
|
|
1225
|
-
var c = Or(r);
|
|
1226
|
-
return {
|
|
1227
|
-
context: "range",
|
|
1228
|
-
feature: c.featureName,
|
|
1229
|
-
range: c
|
|
1230
|
-
};
|
|
1231
|
-
} catch (g) {
|
|
1232
|
-
throw k("Invalid media feature", g);
|
|
1233
|
-
}
|
|
1234
|
-
throw new Error("Invalid media feature");
|
|
1235
|
-
}, Or = function(e) {
|
|
1236
|
-
var r, t, a, i;
|
|
1237
|
-
if (e.length < 5 || e[0].type !== "<(-token>" || e[e.length - 1].type !== "<)-token>")
|
|
1238
|
-
throw new Error("Invalid range");
|
|
1239
|
-
var l = {
|
|
1240
|
-
leftToken: null,
|
|
1241
|
-
leftOp: null,
|
|
1242
|
-
featureName: "",
|
|
1243
|
-
rightOp: null,
|
|
1244
|
-
rightToken: null
|
|
1245
|
-
}, u = e[1].type === "<number-token>" || e[1].type === "<dimension-token>" || e[1].type === "<ratio-token>" || e[1].type === "<ident-token>" && e[1].value === "infinite";
|
|
1246
|
-
if (e[2].type === "<delim-token>") {
|
|
1247
|
-
if (e[2].value === 60)
|
|
1248
|
-
e[3].type === "<delim-token>" && e[3].value === 61 && !e[3].wsBefore ? l[u ? "leftOp" : "rightOp"] = "<=" : l[u ? "leftOp" : "rightOp"] = "<";
|
|
1249
|
-
else if (e[2].value === 62)
|
|
1250
|
-
e[3].type === "<delim-token>" && e[3].value === 61 && !e[3].wsBefore ? l[u ? "leftOp" : "rightOp"] = ">=" : l[u ? "leftOp" : "rightOp"] = ">";
|
|
1251
|
-
else if (e[2].value === 61)
|
|
1252
|
-
l[u ? "leftOp" : "rightOp"] = "=";
|
|
1253
|
-
else
|
|
1254
|
-
throw new Error("Invalid range");
|
|
1255
|
-
if (u)
|
|
1256
|
-
l.leftToken = e[1];
|
|
1257
|
-
else if (e[1].type === "<ident-token>")
|
|
1258
|
-
l.featureName = e[1].value;
|
|
1259
|
-
else
|
|
1260
|
-
throw new Error("Invalid range");
|
|
1261
|
-
var o = 2 + ((t = (r = l[u ? "leftOp" : "rightOp"]) === null || r === void 0 ? void 0 : r.length) !== null && t !== void 0 ? t : 0), s = e[o];
|
|
1262
|
-
if (u)
|
|
1263
|
-
if (s.type === "<ident-token>") {
|
|
1264
|
-
if (l.featureName = s.value, e.length >= 7) {
|
|
1265
|
-
var p = e[o + 1], h = e[o + 2];
|
|
1266
|
-
if (p.type === "<delim-token>") {
|
|
1267
|
-
var v = p.value;
|
|
1268
|
-
if (v === 60)
|
|
1269
|
-
h.type === "<delim-token>" && h.value === 61 && !h.wsBefore ? l.rightOp = "<=" : l.rightOp = "<";
|
|
1270
|
-
else if (v === 62)
|
|
1271
|
-
h.type === "<delim-token>" && h.value === 61 && !h.wsBefore ? l.rightOp = ">=" : l.rightOp = ">";
|
|
1272
|
-
else
|
|
1273
|
-
throw new Error("Invalid range");
|
|
1274
|
-
var c = e[o + 1 + ((i = (a = l.rightOp) === null || a === void 0 ? void 0 : a.length) !== null && i !== void 0 ? i : 0)];
|
|
1275
|
-
l.rightToken = c;
|
|
1276
|
-
} else
|
|
1277
|
-
throw new Error("Invalid range");
|
|
1278
|
-
} else if (o + 2 !== e.length)
|
|
1279
|
-
throw new Error("Invalid range");
|
|
1280
|
-
} else
|
|
1281
|
-
throw new Error("Invalid range");
|
|
1282
|
-
else
|
|
1283
|
-
l.rightToken = s;
|
|
1284
|
-
var g = null, d = l.leftToken, f = l.leftOp, S = l.featureName, b = l.rightOp, w = l.rightToken, C = null;
|
|
1285
|
-
if (d !== null) {
|
|
1286
|
-
if (d.type === "<ident-token>") {
|
|
1287
|
-
var O = d.type, A = d.value;
|
|
1288
|
-
A === "infinite" && (C = {
|
|
1289
|
-
type: O,
|
|
1290
|
-
value: A
|
|
1291
|
-
});
|
|
1292
|
-
} else if (d.type === "<number-token>" || d.type === "<dimension-token>" || d.type === "<ratio-token>") {
|
|
1293
|
-
d.wsBefore, d.wsAfter;
|
|
1294
|
-
var Y = Q(d, ["wsBefore", "wsAfter"]);
|
|
1295
|
-
C = Y;
|
|
1296
|
-
}
|
|
1297
|
-
}
|
|
1298
|
-
var E = null;
|
|
1299
|
-
if (w !== null) {
|
|
1300
|
-
if (w.type === "<ident-token>") {
|
|
1301
|
-
var O = w.type, A = w.value;
|
|
1302
|
-
A === "infinite" && (E = {
|
|
1303
|
-
type: O,
|
|
1304
|
-
value: A
|
|
1305
|
-
});
|
|
1306
|
-
} else if (w.type === "<number-token>" || w.type === "<dimension-token>" || w.type === "<ratio-token>") {
|
|
1307
|
-
w.wsBefore, w.wsAfter;
|
|
1308
|
-
var U = Q(w, ["wsBefore", "wsAfter"]);
|
|
1309
|
-
E = U;
|
|
1310
|
-
}
|
|
1311
|
-
}
|
|
1312
|
-
if (C !== null && E !== null)
|
|
1313
|
-
if ((f === "<" || f === "<=") && (b === "<" || b === "<="))
|
|
1314
|
-
g = {
|
|
1315
|
-
leftToken: C,
|
|
1316
|
-
leftOp: f,
|
|
1317
|
-
featureName: S,
|
|
1318
|
-
rightOp: b,
|
|
1319
|
-
rightToken: E
|
|
1320
|
-
};
|
|
1321
|
-
else if ((f === ">" || f === ">=") && (b === ">" || b === ">="))
|
|
1322
|
-
g = {
|
|
1323
|
-
leftToken: C,
|
|
1324
|
-
leftOp: f,
|
|
1325
|
-
featureName: S,
|
|
1326
|
-
rightOp: b,
|
|
1327
|
-
rightToken: E
|
|
1328
|
-
};
|
|
1329
|
-
else
|
|
1330
|
-
throw new Error("Invalid range");
|
|
1331
|
-
else C === null && f === null && b !== null && E !== null ? g = {
|
|
1332
|
-
leftToken: C,
|
|
1333
|
-
leftOp: f,
|
|
1334
|
-
featureName: S,
|
|
1335
|
-
rightOp: b,
|
|
1336
|
-
rightToken: E
|
|
1337
|
-
} : C !== null && f !== null && b === null && E === null && (g = {
|
|
1338
|
-
leftToken: C,
|
|
1339
|
-
leftOp: f,
|
|
1340
|
-
featureName: S,
|
|
1341
|
-
rightOp: b,
|
|
1342
|
-
rightToken: E
|
|
1343
|
-
});
|
|
1344
|
-
return g;
|
|
1345
|
-
} else
|
|
1346
|
-
throw new Error("Invalid range");
|
|
1347
|
-
};
|
|
1348
|
-
function Er(n, e) {
|
|
1349
|
-
if (typeof n != "object" || !n) return n;
|
|
1350
|
-
var r = n[Symbol.toPrimitive];
|
|
1351
|
-
if (r !== void 0) {
|
|
1352
|
-
var t = r.call(n, e || "default");
|
|
1353
|
-
if (typeof t != "object") return t;
|
|
1354
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1355
|
-
}
|
|
1356
|
-
return (e === "string" ? String : Number)(n);
|
|
1357
|
-
}
|
|
1358
|
-
function xr(n) {
|
|
1359
|
-
var e = Er(n, "string");
|
|
1360
|
-
return typeof e == "symbol" ? e : String(e);
|
|
1361
|
-
}
|
|
1362
|
-
function jr(n, e, r) {
|
|
1363
|
-
return e = xr(e), e in n ? Object.defineProperty(n, e, {
|
|
1364
|
-
value: r,
|
|
1365
|
-
enumerable: !0,
|
|
1366
|
-
configurable: !0,
|
|
1367
|
-
writable: !0
|
|
1368
|
-
}) : n[e] = r, n;
|
|
1369
|
-
}
|
|
1370
|
-
function ce(n, e) {
|
|
1371
|
-
var r = Object.keys(n);
|
|
1372
|
-
if (Object.getOwnPropertySymbols) {
|
|
1373
|
-
var t = Object.getOwnPropertySymbols(n);
|
|
1374
|
-
e && (t = t.filter(function(a) {
|
|
1375
|
-
return Object.getOwnPropertyDescriptor(n, a).enumerable;
|
|
1376
|
-
})), r.push.apply(r, t);
|
|
1377
|
-
}
|
|
1378
|
-
return r;
|
|
1379
|
-
}
|
|
1380
|
-
function P(n) {
|
|
1381
|
-
for (var e = 1; e < arguments.length; e++) {
|
|
1382
|
-
var r = arguments[e] != null ? arguments[e] : {};
|
|
1383
|
-
e % 2 ? ce(Object(r), !0).forEach(function(t) {
|
|
1384
|
-
jr(n, t, r[t]);
|
|
1385
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(r)) : ce(Object(r)).forEach(function(t) {
|
|
1386
|
-
Object.defineProperty(n, t, Object.getOwnPropertyDescriptor(r, t));
|
|
1387
|
-
});
|
|
1388
|
-
}
|
|
1389
|
-
return n;
|
|
1390
|
-
}
|
|
1391
|
-
function Pr(n, e) {
|
|
1392
|
-
if (n == null) return {};
|
|
1393
|
-
var r = {}, t = Object.keys(n), a, i;
|
|
1394
|
-
for (i = 0; i < t.length; i++)
|
|
1395
|
-
a = t[i], !(e.indexOf(a) >= 0) && (r[a] = n[a]);
|
|
1396
|
-
return r;
|
|
1397
|
-
}
|
|
1398
|
-
function ge(n, e) {
|
|
1399
|
-
if (n == null) return {};
|
|
1400
|
-
var r = Pr(n, e), t, a;
|
|
1401
|
-
if (Object.getOwnPropertySymbols) {
|
|
1402
|
-
var i = Object.getOwnPropertySymbols(n);
|
|
1403
|
-
for (a = 0; a < i.length; a++)
|
|
1404
|
-
t = i[a], !(e.indexOf(t) >= 0) && Object.prototype.propertyIsEnumerable.call(n, t) && (r[t] = n[t]);
|
|
1405
|
-
}
|
|
1406
|
-
return r;
|
|
1407
|
-
}
|
|
1408
|
-
function R(n, e) {
|
|
1409
|
-
for (var r in n)
|
|
1410
|
-
e(n[r], r);
|
|
1411
|
-
}
|
|
1412
|
-
function L(n, e) {
|
|
1413
|
-
var r = {};
|
|
1414
|
-
for (var t in n)
|
|
1415
|
-
e.indexOf(t) === -1 && (r[t] = n[t]);
|
|
1416
|
-
return r;
|
|
1417
|
-
}
|
|
1418
|
-
function Mr(n, e) {
|
|
1419
|
-
var r = {};
|
|
1420
|
-
for (var t in n)
|
|
1421
|
-
r[e(n[t], t)] = n[t];
|
|
1422
|
-
return r;
|
|
1423
|
-
}
|
|
1424
|
-
function T(n) {
|
|
1425
|
-
for (var e = arguments.length, r = new Array(e > 1 ? e - 1 : 0), t = 1; t < e; t++)
|
|
1426
|
-
r[t - 1] = arguments[t];
|
|
1427
|
-
for (var a of r)
|
|
1428
|
-
a.length !== 0 && (typeof a == "string" ? a.includes(" ") ? T(n, ...a.trim().split(" ")) : n.add(a) : Array.isArray(a) && T(n, ...a));
|
|
1429
|
-
}
|
|
1430
|
-
function Lr(n) {
|
|
1431
|
-
var e = /* @__PURE__ */ new Set();
|
|
1432
|
-
return T(e, ...n), Array.from(e).join(" ");
|
|
1433
|
-
}
|
|
1434
|
-
var ve;
|
|
1435
|
-
function zr(n) {
|
|
1436
|
-
return n.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
|
|
1437
|
-
}
|
|
1438
|
-
var Ir = (n, e) => {
|
|
1439
|
-
var r = () => {
|
|
1440
|
-
var a = new RegExp(".".concat(zr(Oe(e, {
|
|
1441
|
-
isIdentifier: !0
|
|
1442
|
-
}))), "g");
|
|
1443
|
-
return n.replace(a, "&");
|
|
1444
|
-
}, t;
|
|
1445
|
-
try {
|
|
1446
|
-
t = nr(n);
|
|
1447
|
-
} catch {
|
|
1448
|
-
throw new Error("Invalid selector: ".concat(r()));
|
|
1449
|
-
}
|
|
1450
|
-
t.forEach((a) => {
|
|
1451
|
-
try {
|
|
1452
|
-
for (var i = a.length - 1; i >= -1; i--) {
|
|
1453
|
-
if (!a[i])
|
|
1454
|
-
throw new Error();
|
|
1455
|
-
var l = a[i];
|
|
1456
|
-
if (l.type === "child" || l.type === "parent" || l.type === "sibling" || l.type === "adjacent" || l.type === "descendant")
|
|
1457
|
-
throw new Error();
|
|
1458
|
-
if (l.type === "attribute" && l.name === "class" && l.value === e)
|
|
1459
|
-
return;
|
|
1460
|
-
}
|
|
1461
|
-
} catch {
|
|
1462
|
-
throw new Error(ae(ve || (ve = te([`
|
|
1463
|
-
Invalid selector: `, `
|
|
1464
|
-
|
|
1465
|
-
Style selectors must target the '&' character (along with any modifiers), e.g. `, " or ", `.
|
|
1466
|
-
|
|
1467
|
-
This is to ensure that each style block only affects the styling of a single class.
|
|
1468
|
-
|
|
1469
|
-
If your selector is targeting another class, you should move it to the style definition for that class, e.g. given we have styles for 'parent' and 'child' elements, instead of adding a selector of `, ") to 'parent', you should add ", ` to 'child').
|
|
1470
|
-
|
|
1471
|
-
If your selector is targeting something global, use the 'globalStyle' function instead, e.g. if you wanted to write `, ", you should instead write 'globalStyle(", `, { ... })'
|
|
1472
|
-
`])), r(), "`${parent} &`", "`${parent} &:hover`", "`& ${child}`", "`${parent} &`", "`& h1`", "`${parent} h1`"));
|
|
1473
|
-
}
|
|
1474
|
-
});
|
|
1475
|
-
};
|
|
1476
|
-
class K {
|
|
1477
|
-
/**
|
|
1478
|
-
* Stores information about where conditions must be in relation to other conditions
|
|
1479
|
-
*
|
|
1480
|
-
* e.g. mobile -> tablet, desktop
|
|
1481
|
-
*/
|
|
1482
|
-
constructor() {
|
|
1483
|
-
this.ruleset = /* @__PURE__ */ new Map(), this.precedenceLookup = /* @__PURE__ */ new Map();
|
|
1484
|
-
}
|
|
1485
|
-
findOrCreateCondition(e) {
|
|
1486
|
-
var r = this.ruleset.get(e);
|
|
1487
|
-
return r || (r = {
|
|
1488
|
-
query: e,
|
|
1489
|
-
rules: [],
|
|
1490
|
-
children: new K()
|
|
1491
|
-
}, this.ruleset.set(e, r)), r;
|
|
1492
|
-
}
|
|
1493
|
-
getConditionalRulesetByPath(e) {
|
|
1494
|
-
var r = this;
|
|
1495
|
-
for (var t of e) {
|
|
1496
|
-
var a = r.findOrCreateCondition(t);
|
|
1497
|
-
r = a.children;
|
|
1498
|
-
}
|
|
1499
|
-
return r;
|
|
1500
|
-
}
|
|
1501
|
-
addRule(e, r, t) {
|
|
1502
|
-
var a = this.getConditionalRulesetByPath(t), i = a.findOrCreateCondition(r);
|
|
1503
|
-
if (!i)
|
|
1504
|
-
throw new Error("Failed to add conditional rule");
|
|
1505
|
-
i.rules.push(e);
|
|
1506
|
-
}
|
|
1507
|
-
addConditionPrecedence(e, r) {
|
|
1508
|
-
for (var t = this.getConditionalRulesetByPath(e), a = 0; a < r.length; a++) {
|
|
1509
|
-
var i, l = r[a], u = (i = t.precedenceLookup.get(l)) !== null && i !== void 0 ? i : /* @__PURE__ */ new Set();
|
|
1510
|
-
for (var o of r.slice(a + 1))
|
|
1511
|
-
u.add(o);
|
|
1512
|
-
t.precedenceLookup.set(l, u);
|
|
1513
|
-
}
|
|
1514
|
-
}
|
|
1515
|
-
isCompatible(e) {
|
|
1516
|
-
for (var [r, t] of this.precedenceLookup.entries())
|
|
1517
|
-
for (var a of t) {
|
|
1518
|
-
var i;
|
|
1519
|
-
if ((i = e.precedenceLookup.get(a)) !== null && i !== void 0 && i.has(r))
|
|
1520
|
-
return !1;
|
|
1521
|
-
}
|
|
1522
|
-
for (var {
|
|
1523
|
-
query: l,
|
|
1524
|
-
children: u
|
|
1525
|
-
} of e.ruleset.values()) {
|
|
1526
|
-
var o = this.ruleset.get(l);
|
|
1527
|
-
if (o && !o.children.isCompatible(u))
|
|
1528
|
-
return !1;
|
|
1529
|
-
}
|
|
1530
|
-
return !0;
|
|
1531
|
-
}
|
|
1532
|
-
merge(e) {
|
|
1533
|
-
for (var {
|
|
1534
|
-
query: r,
|
|
1535
|
-
rules: t,
|
|
1536
|
-
children: a
|
|
1537
|
-
} of e.ruleset.values()) {
|
|
1538
|
-
var i = this.ruleset.get(r);
|
|
1539
|
-
i ? (i.rules.push(...t), i.children.merge(a)) : this.ruleset.set(r, {
|
|
1540
|
-
query: r,
|
|
1541
|
-
rules: t,
|
|
1542
|
-
children: a
|
|
1543
|
-
});
|
|
1544
|
-
}
|
|
1545
|
-
for (var [l, u] of e.precedenceLookup.entries()) {
|
|
1546
|
-
var o, s = (o = this.precedenceLookup.get(l)) !== null && o !== void 0 ? o : /* @__PURE__ */ new Set();
|
|
1547
|
-
this.precedenceLookup.set(l, /* @__PURE__ */ new Set([...s, ...u]));
|
|
1548
|
-
}
|
|
1549
|
-
}
|
|
1550
|
-
/**
|
|
1551
|
-
* Merge another ConditionalRuleset into this one if they are compatible
|
|
1552
|
-
*
|
|
1553
|
-
* @returns true if successful, false if the ruleset is incompatible
|
|
1554
|
-
*/
|
|
1555
|
-
mergeIfCompatible(e) {
|
|
1556
|
-
return this.isCompatible(e) ? (this.merge(e), !0) : !1;
|
|
1557
|
-
}
|
|
1558
|
-
getSortedRuleset() {
|
|
1559
|
-
var e = this, r = [], t = function(u) {
|
|
1560
|
-
var o = e.ruleset.get(a);
|
|
1561
|
-
if (!o)
|
|
1562
|
-
throw new Error("Can't find condition for ".concat(a));
|
|
1563
|
-
var s = r.findIndex((p) => u.has(p.query));
|
|
1564
|
-
s > -1 ? r.splice(s, 0, o) : r.push(o);
|
|
1565
|
-
};
|
|
1566
|
-
for (var [a, i] of this.precedenceLookup.entries())
|
|
1567
|
-
t(i);
|
|
1568
|
-
return r;
|
|
1569
|
-
}
|
|
1570
|
-
renderToArray() {
|
|
1571
|
-
var e = [];
|
|
1572
|
-
for (var {
|
|
1573
|
-
query: r,
|
|
1574
|
-
rules: t,
|
|
1575
|
-
children: a
|
|
1576
|
-
} of this.getSortedRuleset()) {
|
|
1577
|
-
var i = {};
|
|
1578
|
-
for (var l of t)
|
|
1579
|
-
i[l.selector] = P(P({}, i[l.selector]), l.rule);
|
|
1580
|
-
Object.assign(i, ...a.renderToArray()), e.push({
|
|
1581
|
-
[r]: i
|
|
1582
|
-
});
|
|
1583
|
-
}
|
|
1584
|
-
return e;
|
|
1585
|
-
}
|
|
1586
|
-
}
|
|
1587
|
-
var Ie = {
|
|
1588
|
-
":-moz-any-link": !0,
|
|
1589
|
-
":-moz-full-screen": !0,
|
|
1590
|
-
":-moz-placeholder": !0,
|
|
1591
|
-
":-moz-read-only": !0,
|
|
1592
|
-
":-moz-read-write": !0,
|
|
1593
|
-
":-ms-fullscreen": !0,
|
|
1594
|
-
":-ms-input-placeholder": !0,
|
|
1595
|
-
":-webkit-any-link": !0,
|
|
1596
|
-
":-webkit-full-screen": !0,
|
|
1597
|
-
"::-moz-color-swatch": !0,
|
|
1598
|
-
"::-moz-list-bullet": !0,
|
|
1599
|
-
"::-moz-list-number": !0,
|
|
1600
|
-
"::-moz-page-sequence": !0,
|
|
1601
|
-
"::-moz-page": !0,
|
|
1602
|
-
"::-moz-placeholder": !0,
|
|
1603
|
-
"::-moz-progress-bar": !0,
|
|
1604
|
-
"::-moz-range-progress": !0,
|
|
1605
|
-
"::-moz-range-thumb": !0,
|
|
1606
|
-
"::-moz-range-track": !0,
|
|
1607
|
-
"::-moz-scrolled-page-sequence": !0,
|
|
1608
|
-
"::-moz-selection": !0,
|
|
1609
|
-
"::-ms-backdrop": !0,
|
|
1610
|
-
"::-ms-browse": !0,
|
|
1611
|
-
"::-ms-check": !0,
|
|
1612
|
-
"::-ms-clear": !0,
|
|
1613
|
-
"::-ms-fill-lower": !0,
|
|
1614
|
-
"::-ms-fill-upper": !0,
|
|
1615
|
-
"::-ms-fill": !0,
|
|
1616
|
-
"::-ms-reveal": !0,
|
|
1617
|
-
"::-ms-thumb": !0,
|
|
1618
|
-
"::-ms-ticks-after": !0,
|
|
1619
|
-
"::-ms-ticks-before": !0,
|
|
1620
|
-
"::-ms-tooltip": !0,
|
|
1621
|
-
"::-ms-track": !0,
|
|
1622
|
-
"::-ms-value": !0,
|
|
1623
|
-
"::-webkit-backdrop": !0,
|
|
1624
|
-
"::-webkit-inner-spin-button": !0,
|
|
1625
|
-
"::-webkit-input-placeholder": !0,
|
|
1626
|
-
"::-webkit-meter-bar": !0,
|
|
1627
|
-
"::-webkit-meter-even-less-good-value": !0,
|
|
1628
|
-
"::-webkit-meter-inner-element": !0,
|
|
1629
|
-
"::-webkit-meter-optimum-value": !0,
|
|
1630
|
-
"::-webkit-meter-suboptimum-value": !0,
|
|
1631
|
-
"::-webkit-outer-spin-button": !0,
|
|
1632
|
-
"::-webkit-progress-bar": !0,
|
|
1633
|
-
"::-webkit-progress-inner-element": !0,
|
|
1634
|
-
"::-webkit-progress-inner-value": !0,
|
|
1635
|
-
"::-webkit-progress-value": !0,
|
|
1636
|
-
"::-webkit-resizer": !0,
|
|
1637
|
-
"::-webkit-scrollbar-button": !0,
|
|
1638
|
-
"::-webkit-scrollbar-corner": !0,
|
|
1639
|
-
"::-webkit-scrollbar-thumb": !0,
|
|
1640
|
-
"::-webkit-scrollbar-track-piece": !0,
|
|
1641
|
-
"::-webkit-scrollbar-track": !0,
|
|
1642
|
-
"::-webkit-scrollbar": !0,
|
|
1643
|
-
"::-webkit-search-cancel-button": !0,
|
|
1644
|
-
"::-webkit-search-results-button": !0,
|
|
1645
|
-
"::-webkit-slider-runnable-track": !0,
|
|
1646
|
-
"::-webkit-slider-thumb": !0,
|
|
1647
|
-
"::after": !0,
|
|
1648
|
-
"::backdrop": !0,
|
|
1649
|
-
"::before": !0,
|
|
1650
|
-
"::cue": !0,
|
|
1651
|
-
"::file-selector-button": !0,
|
|
1652
|
-
"::first-letter": !0,
|
|
1653
|
-
"::first-line": !0,
|
|
1654
|
-
"::grammar-error": !0,
|
|
1655
|
-
"::marker": !0,
|
|
1656
|
-
"::placeholder": !0,
|
|
1657
|
-
"::selection": !0,
|
|
1658
|
-
"::spelling-error": !0,
|
|
1659
|
-
"::target-text": !0,
|
|
1660
|
-
"::view-transition-group": !0,
|
|
1661
|
-
"::view-transition-image-pair": !0,
|
|
1662
|
-
"::view-transition-new": !0,
|
|
1663
|
-
"::view-transition-old": !0,
|
|
1664
|
-
"::view-transition": !0,
|
|
1665
|
-
":active": !0,
|
|
1666
|
-
":after": !0,
|
|
1667
|
-
":any-link": !0,
|
|
1668
|
-
":before": !0,
|
|
1669
|
-
":blank": !0,
|
|
1670
|
-
":checked": !0,
|
|
1671
|
-
":default": !0,
|
|
1672
|
-
":defined": !0,
|
|
1673
|
-
":disabled": !0,
|
|
1674
|
-
":empty": !0,
|
|
1675
|
-
":enabled": !0,
|
|
1676
|
-
":first-child": !0,
|
|
1677
|
-
":first-letter": !0,
|
|
1678
|
-
":first-line": !0,
|
|
1679
|
-
":first-of-type": !0,
|
|
1680
|
-
":first": !0,
|
|
1681
|
-
":focus-visible": !0,
|
|
1682
|
-
":focus-within": !0,
|
|
1683
|
-
":focus": !0,
|
|
1684
|
-
":fullscreen": !0,
|
|
1685
|
-
":hover": !0,
|
|
1686
|
-
":in-range": !0,
|
|
1687
|
-
":indeterminate": !0,
|
|
1688
|
-
":invalid": !0,
|
|
1689
|
-
":last-child": !0,
|
|
1690
|
-
":last-of-type": !0,
|
|
1691
|
-
":left": !0,
|
|
1692
|
-
":link": !0,
|
|
1693
|
-
":only-child": !0,
|
|
1694
|
-
":only-of-type": !0,
|
|
1695
|
-
":optional": !0,
|
|
1696
|
-
":out-of-range": !0,
|
|
1697
|
-
":placeholder-shown": !0,
|
|
1698
|
-
":read-only": !0,
|
|
1699
|
-
":read-write": !0,
|
|
1700
|
-
":required": !0,
|
|
1701
|
-
":right": !0,
|
|
1702
|
-
":root": !0,
|
|
1703
|
-
":scope": !0,
|
|
1704
|
-
":target": !0,
|
|
1705
|
-
":valid": !0,
|
|
1706
|
-
":visited": !0
|
|
1707
|
-
}, Dr = Object.keys(Ie), Fr = Ie, de, me = (n, e) => new Error(ae(de || (de = te([`
|
|
1708
|
-
Invalid media query: "`, `"
|
|
1709
|
-
|
|
1710
|
-
`, `
|
|
1711
|
-
|
|
1712
|
-
Read more on MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries
|
|
1713
|
-
`])), n, e)), Rr = (n) => {
|
|
1714
|
-
if (n === "@media ")
|
|
1715
|
-
throw me(n, "Query is empty");
|
|
1716
|
-
try {
|
|
1717
|
-
br(n);
|
|
1718
|
-
} catch (e) {
|
|
1719
|
-
throw me(n, e.message);
|
|
1720
|
-
}
|
|
1721
|
-
}, Nr = ["vars"], Br = ["content"], De = "__DECLARATION", qr = {
|
|
1722
|
-
animationIterationCount: !0,
|
|
1723
|
-
borderImage: !0,
|
|
1724
|
-
borderImageOutset: !0,
|
|
1725
|
-
borderImageSlice: !0,
|
|
1726
|
-
borderImageWidth: !0,
|
|
1727
|
-
boxFlex: !0,
|
|
1728
|
-
boxFlexGroup: !0,
|
|
1729
|
-
columnCount: !0,
|
|
1730
|
-
columns: !0,
|
|
1731
|
-
flex: !0,
|
|
1732
|
-
flexGrow: !0,
|
|
1733
|
-
flexShrink: !0,
|
|
1734
|
-
fontWeight: !0,
|
|
1735
|
-
gridArea: !0,
|
|
1736
|
-
gridColumn: !0,
|
|
1737
|
-
gridColumnEnd: !0,
|
|
1738
|
-
gridColumnStart: !0,
|
|
1739
|
-
gridRow: !0,
|
|
1740
|
-
gridRowEnd: !0,
|
|
1741
|
-
gridRowStart: !0,
|
|
1742
|
-
initialLetter: !0,
|
|
1743
|
-
lineClamp: !0,
|
|
1744
|
-
lineHeight: !0,
|
|
1745
|
-
maxLines: !0,
|
|
1746
|
-
opacity: !0,
|
|
1747
|
-
order: !0,
|
|
1748
|
-
orphans: !0,
|
|
1749
|
-
scale: !0,
|
|
1750
|
-
tabSize: !0,
|
|
1751
|
-
WebkitLineClamp: !0,
|
|
1752
|
-
widows: !0,
|
|
1753
|
-
zIndex: !0,
|
|
1754
|
-
zoom: !0,
|
|
1755
|
-
// svg properties
|
|
1756
|
-
fillOpacity: !0,
|
|
1757
|
-
floodOpacity: !0,
|
|
1758
|
-
maskBorder: !0,
|
|
1759
|
-
maskBorderOutset: !0,
|
|
1760
|
-
maskBorderSlice: !0,
|
|
1761
|
-
maskBorderWidth: !0,
|
|
1762
|
-
shapeImageThreshold: !0,
|
|
1763
|
-
stopOpacity: !0,
|
|
1764
|
-
strokeDashoffset: !0,
|
|
1765
|
-
strokeMiterlimit: !0,
|
|
1766
|
-
strokeOpacity: !0,
|
|
1767
|
-
strokeWidth: !0
|
|
1768
|
-
};
|
|
1769
|
-
function Ur(n) {
|
|
1770
|
-
return n.replace(/([A-Z])/g, "-$1").replace(/^ms-/, "-ms-").toLowerCase();
|
|
1771
|
-
}
|
|
1772
|
-
function $r(n, e, r, t) {
|
|
1773
|
-
var a = n.slice(0, e), i = n.slice(r);
|
|
1774
|
-
return "".concat(a).concat(t).concat(i);
|
|
1775
|
-
}
|
|
1776
|
-
var Wr = " ", z = [...Dr, "@layer", "@media", "@supports", "@container", "selectors"];
|
|
1777
|
-
class Vr {
|
|
1778
|
-
constructor(e, r) {
|
|
1779
|
-
this.rules = [], this.conditionalRulesets = [new K()], this.fontFaceRules = [], this.keyframesRules = [], this.localClassNamesMap = new Map(e.map((t) => [t, t])), this.localClassNamesSearch = new Ye(e), this.layers = /* @__PURE__ */ new Map(), this.composedClassLists = r.map((t) => {
|
|
1780
|
-
var {
|
|
1781
|
-
identifier: a,
|
|
1782
|
-
classList: i
|
|
1783
|
-
} = t;
|
|
1784
|
-
return {
|
|
1785
|
-
identifier: a,
|
|
1786
|
-
regex: RegExp("(".concat(i, ")"), "g")
|
|
1787
|
-
};
|
|
1788
|
-
}).reverse();
|
|
1789
|
-
}
|
|
1790
|
-
processCssObj(e) {
|
|
1791
|
-
if (e.type === "fontFace") {
|
|
1792
|
-
this.fontFaceRules.push(e.rule);
|
|
1793
|
-
return;
|
|
1794
|
-
}
|
|
1795
|
-
if (e.type === "keyframes") {
|
|
1796
|
-
e.rule = Object.fromEntries(Object.entries(e.rule).map((i) => {
|
|
1797
|
-
var [l, u] = i;
|
|
1798
|
-
return [l, this.transformProperties(u)];
|
|
1799
|
-
})), this.keyframesRules.push(e);
|
|
1800
|
-
return;
|
|
1801
|
-
}
|
|
1802
|
-
if (this.currConditionalRuleset = new K(), e.type === "layer") {
|
|
1803
|
-
var r = "@layer ".concat(e.name);
|
|
1804
|
-
this.addLayer([r]);
|
|
1805
|
-
} else {
|
|
1806
|
-
var t = L(e.rule, z);
|
|
1807
|
-
this.addRule({
|
|
1808
|
-
selector: e.selector,
|
|
1809
|
-
rule: t
|
|
1810
|
-
}), this.transformLayer(e, e.rule["@layer"]), this.transformMedia(e, e.rule["@media"]), this.transformSupports(e, e.rule["@supports"]), this.transformContainer(e, e.rule["@container"]), this.transformSimplePseudos(e, e.rule), this.transformSelectors(e, e.rule);
|
|
1811
|
-
}
|
|
1812
|
-
var a = this.conditionalRulesets[this.conditionalRulesets.length - 1];
|
|
1813
|
-
a.mergeIfCompatible(this.currConditionalRuleset) || this.conditionalRulesets.push(this.currConditionalRuleset);
|
|
1814
|
-
}
|
|
1815
|
-
addConditionalRule(e, r) {
|
|
1816
|
-
var t = this.transformVars(this.transformProperties(e.rule)), a = this.transformSelector(e.selector);
|
|
1817
|
-
if (!this.currConditionalRuleset)
|
|
1818
|
-
throw new Error("Couldn't add conditional rule");
|
|
1819
|
-
var i = r[r.length - 1], l = r.slice(0, r.length - 1);
|
|
1820
|
-
this.currConditionalRuleset.addRule({
|
|
1821
|
-
selector: a,
|
|
1822
|
-
rule: t
|
|
1823
|
-
}, i, l);
|
|
1824
|
-
}
|
|
1825
|
-
addRule(e) {
|
|
1826
|
-
var r = this.transformVars(this.transformProperties(e.rule)), t = this.transformSelector(e.selector);
|
|
1827
|
-
this.rules.push({
|
|
1828
|
-
selector: t,
|
|
1829
|
-
rule: r
|
|
1830
|
-
});
|
|
1831
|
-
}
|
|
1832
|
-
addLayer(e) {
|
|
1833
|
-
var r = e.join(" - ");
|
|
1834
|
-
this.layers.set(r, e);
|
|
1835
|
-
}
|
|
1836
|
-
transformProperties(e) {
|
|
1837
|
-
return this.transformContent(this.pixelifyProperties(e));
|
|
1838
|
-
}
|
|
1839
|
-
pixelifyProperties(e) {
|
|
1840
|
-
return R(e, (r, t) => {
|
|
1841
|
-
typeof r == "number" && r !== 0 && !qr[t] && (e[t] = "".concat(r, "px"));
|
|
1842
|
-
}), e;
|
|
1843
|
-
}
|
|
1844
|
-
transformVars(e) {
|
|
1845
|
-
var {
|
|
1846
|
-
vars: r
|
|
1847
|
-
} = e, t = ge(e, Nr);
|
|
1848
|
-
return r ? P(P({}, Mr(r, (a, i) => Be(i))), t) : t;
|
|
1849
|
-
}
|
|
1850
|
-
transformContent(e) {
|
|
1851
|
-
var {
|
|
1852
|
-
content: r
|
|
1853
|
-
} = e, t = ge(e, Br);
|
|
1854
|
-
if (typeof r > "u")
|
|
1855
|
-
return t;
|
|
1856
|
-
var a = Array.isArray(r) ? r : [r];
|
|
1857
|
-
return P({
|
|
1858
|
-
content: a.map((i) => (
|
|
1859
|
-
// This logic was adapted from Stitches :)
|
|
1860
|
-
i && (i.includes('"') || i.includes("'") || /^([A-Za-z\-]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)(\s|$)/.test(i)) ? i : '"'.concat(i, '"')
|
|
1861
|
-
))
|
|
1862
|
-
}, t);
|
|
1863
|
-
}
|
|
1864
|
-
transformClassname(e) {
|
|
1865
|
-
return ".".concat(Oe(e, {
|
|
1866
|
-
isIdentifier: !0
|
|
1867
|
-
}));
|
|
1868
|
-
}
|
|
1869
|
-
transformSelector(e) {
|
|
1870
|
-
var r = e, t = function(c) {
|
|
1871
|
-
r = r.replace(i, () => (Pe(c), c));
|
|
1872
|
-
};
|
|
1873
|
-
for (var {
|
|
1874
|
-
identifier: a,
|
|
1875
|
-
regex: i
|
|
1876
|
-
} of this.composedClassLists)
|
|
1877
|
-
t(a);
|
|
1878
|
-
if (this.localClassNamesMap.has(r))
|
|
1879
|
-
return this.transformClassname(r);
|
|
1880
|
-
for (var l = this.localClassNamesSearch.search(r), u = r.length, o = l.length - 1; o >= 0; o--) {
|
|
1881
|
-
var [s, [p]] = l[o], h = s - p.length + 1;
|
|
1882
|
-
h >= u || (u = h, r[h - 1] !== "." && (r = $r(r, h, s + 1, this.transformClassname(p))));
|
|
1883
|
-
}
|
|
1884
|
-
return r;
|
|
1885
|
-
}
|
|
1886
|
-
transformSelectors(e, r, t) {
|
|
1887
|
-
R(r.selectors, (a, i) => {
|
|
1888
|
-
if (e.type !== "local")
|
|
1889
|
-
throw new Error("Selectors are not allowed within ".concat(e.type === "global" ? '"globalStyle"' : '"selectors"'));
|
|
1890
|
-
var l = this.transformSelector(i.replace(RegExp("&", "g"), e.selector));
|
|
1891
|
-
Ir(l, e.selector);
|
|
1892
|
-
var u = {
|
|
1893
|
-
selector: l,
|
|
1894
|
-
rule: L(a, z)
|
|
1895
|
-
};
|
|
1896
|
-
t ? this.addConditionalRule(u, t) : this.addRule(u);
|
|
1897
|
-
var o = {
|
|
1898
|
-
type: "selector",
|
|
1899
|
-
selector: l,
|
|
1900
|
-
rule: a
|
|
1901
|
-
};
|
|
1902
|
-
this.transformLayer(o, a["@layer"], t), this.transformSupports(o, a["@supports"], t), this.transformMedia(o, a["@media"], t);
|
|
1903
|
-
});
|
|
1904
|
-
}
|
|
1905
|
-
transformMedia(e, r) {
|
|
1906
|
-
var t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
|
|
1907
|
-
if (r) {
|
|
1908
|
-
var a;
|
|
1909
|
-
(a = this.currConditionalRuleset) === null || a === void 0 || a.addConditionPrecedence(t, Object.keys(r).map((s) => "@media ".concat(s)));
|
|
1910
|
-
for (var [i, l] of Object.entries(r)) {
|
|
1911
|
-
var u = "@media ".concat(i);
|
|
1912
|
-
Rr(u);
|
|
1913
|
-
var o = [...t, u];
|
|
1914
|
-
this.addConditionalRule({
|
|
1915
|
-
selector: e.selector,
|
|
1916
|
-
rule: L(l, z)
|
|
1917
|
-
}, o), e.type === "local" && (this.transformSimplePseudos(e, l, o), this.transformSelectors(e, l, o)), this.transformLayer(e, l["@layer"], o), this.transformSupports(e, l["@supports"], o), this.transformContainer(e, l["@container"], o);
|
|
1918
|
-
}
|
|
1919
|
-
}
|
|
1920
|
-
}
|
|
1921
|
-
transformContainer(e, r) {
|
|
1922
|
-
var t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
|
|
1923
|
-
if (r) {
|
|
1924
|
-
var a;
|
|
1925
|
-
(a = this.currConditionalRuleset) === null || a === void 0 || a.addConditionPrecedence(t, Object.keys(r).map((i) => "@container ".concat(i))), R(r, (i, l) => {
|
|
1926
|
-
var u = "@container ".concat(l), o = [...t, u];
|
|
1927
|
-
this.addConditionalRule({
|
|
1928
|
-
selector: e.selector,
|
|
1929
|
-
rule: L(i, z)
|
|
1930
|
-
}, o), e.type === "local" && (this.transformSimplePseudos(e, i, o), this.transformSelectors(e, i, o)), this.transformLayer(e, i["@layer"], o), this.transformSupports(e, i["@supports"], o), this.transformMedia(e, i["@media"], o);
|
|
1931
|
-
});
|
|
1932
|
-
}
|
|
1933
|
-
}
|
|
1934
|
-
transformLayer(e, r) {
|
|
1935
|
-
var t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
|
|
1936
|
-
if (r) {
|
|
1937
|
-
var a;
|
|
1938
|
-
(a = this.currConditionalRuleset) === null || a === void 0 || a.addConditionPrecedence(t, Object.keys(r).map((i) => "@layer ".concat(i))), R(r, (i, l) => {
|
|
1939
|
-
var u = [...t, "@layer ".concat(l)];
|
|
1940
|
-
this.addLayer(u), this.addConditionalRule({
|
|
1941
|
-
selector: e.selector,
|
|
1942
|
-
rule: L(i, z)
|
|
1943
|
-
}, u), e.type === "local" && (this.transformSimplePseudos(e, i, u), this.transformSelectors(e, i, u)), this.transformMedia(e, i["@media"], u), this.transformSupports(e, i["@supports"], u), this.transformContainer(e, i["@container"], u);
|
|
1944
|
-
});
|
|
1945
|
-
}
|
|
1946
|
-
}
|
|
1947
|
-
transformSupports(e, r) {
|
|
1948
|
-
var t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
|
|
1949
|
-
if (r) {
|
|
1950
|
-
var a;
|
|
1951
|
-
(a = this.currConditionalRuleset) === null || a === void 0 || a.addConditionPrecedence(t, Object.keys(r).map((i) => "@supports ".concat(i))), R(r, (i, l) => {
|
|
1952
|
-
var u = [...t, "@supports ".concat(l)];
|
|
1953
|
-
this.addConditionalRule({
|
|
1954
|
-
selector: e.selector,
|
|
1955
|
-
rule: L(i, z)
|
|
1956
|
-
}, u), e.type === "local" && (this.transformSimplePseudos(e, i, u), this.transformSelectors(e, i, u)), this.transformLayer(e, i["@layer"], u), this.transformMedia(e, i["@media"], u), this.transformContainer(e, i["@container"], u);
|
|
1957
|
-
});
|
|
1958
|
-
}
|
|
1959
|
-
}
|
|
1960
|
-
transformSimplePseudos(e, r, t) {
|
|
1961
|
-
for (var a of Object.keys(r))
|
|
1962
|
-
if (Fr[a]) {
|
|
1963
|
-
if (e.type !== "local")
|
|
1964
|
-
throw new Error("Simple pseudos are not valid in ".concat(e.type === "global" ? '"globalStyle"' : '"selectors"'));
|
|
1965
|
-
t ? this.addConditionalRule({
|
|
1966
|
-
selector: "".concat(e.selector).concat(a),
|
|
1967
|
-
rule: r[a]
|
|
1968
|
-
}, t) : this.addRule({
|
|
1969
|
-
conditions: t,
|
|
1970
|
-
selector: "".concat(e.selector).concat(a),
|
|
1971
|
-
rule: r[a]
|
|
1972
|
-
});
|
|
1973
|
-
}
|
|
1974
|
-
}
|
|
1975
|
-
toCss() {
|
|
1976
|
-
var e = [];
|
|
1977
|
-
for (var r of this.fontFaceRules)
|
|
1978
|
-
e.push(j({
|
|
1979
|
-
"@font-face": r
|
|
1980
|
-
}));
|
|
1981
|
-
for (var t of this.keyframesRules)
|
|
1982
|
-
e.push(j({
|
|
1983
|
-
["@keyframes ".concat(t.name)]: t.rule
|
|
1984
|
-
}));
|
|
1985
|
-
for (var a of this.layers.values()) {
|
|
1986
|
-
var [i, ...l] = a.reverse(), u = {
|
|
1987
|
-
[i]: De
|
|
1988
|
-
};
|
|
1989
|
-
for (var o of l)
|
|
1990
|
-
u = {
|
|
1991
|
-
[o]: u
|
|
1992
|
-
};
|
|
1993
|
-
e.push(j(u));
|
|
1994
|
-
}
|
|
1995
|
-
for (var s of this.rules)
|
|
1996
|
-
e.push(j({
|
|
1997
|
-
[s.selector]: s.rule
|
|
1998
|
-
}));
|
|
1999
|
-
for (var p of this.conditionalRulesets)
|
|
2000
|
-
for (var h of p.renderToArray())
|
|
2001
|
-
e.push(j(h));
|
|
2002
|
-
return e.filter(Boolean);
|
|
2003
|
-
}
|
|
2004
|
-
}
|
|
2005
|
-
function j(n) {
|
|
2006
|
-
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "", r = [], t = function(l) {
|
|
2007
|
-
var u = n[l];
|
|
2008
|
-
if (u && Array.isArray(u))
|
|
2009
|
-
r.push(...u.map((s) => j({
|
|
2010
|
-
[l]: s
|
|
2011
|
-
}, e)));
|
|
2012
|
-
else if (u && typeof u == "object") {
|
|
2013
|
-
var o = Object.keys(u).length === 0;
|
|
2014
|
-
o || r.push("".concat(e).concat(l, ` {
|
|
2015
|
-
`).concat(j(u, e + Wr), `
|
|
2016
|
-
`).concat(e, "}"));
|
|
2017
|
-
} else u === De ? r.push("".concat(e).concat(l, ";")) : r.push("".concat(e).concat(l.startsWith("--") ? l : Ur(l), ": ").concat(u, ";"));
|
|
2018
|
-
};
|
|
2019
|
-
for (var a of Object.keys(n))
|
|
2020
|
-
t(a);
|
|
2021
|
-
return r.join(`
|
|
2022
|
-
`);
|
|
2023
|
-
}
|
|
2024
|
-
function Kr(n) {
|
|
2025
|
-
var {
|
|
2026
|
-
localClassNames: e,
|
|
2027
|
-
cssObjs: r,
|
|
2028
|
-
composedClassLists: t
|
|
2029
|
-
} = n, a = new Vr(e, t);
|
|
2030
|
-
for (var i of r)
|
|
2031
|
-
a.processCssObj(i);
|
|
2032
|
-
return a.toCss();
|
|
2033
|
-
}
|
|
2034
|
-
function Hr(n) {
|
|
2035
|
-
for (var e = 0, r, t = 0, a = n.length; a >= 4; ++t, a -= 4)
|
|
2036
|
-
r = n.charCodeAt(t) & 255 | (n.charCodeAt(++t) & 255) << 8 | (n.charCodeAt(++t) & 255) << 16 | (n.charCodeAt(++t) & 255) << 24, r = /* Math.imul(k, m): */
|
|
2037
|
-
(r & 65535) * 1540483477 + ((r >>> 16) * 59797 << 16), r ^= /* k >>> r: */
|
|
2038
|
-
r >>> 24, e = /* Math.imul(k, m): */
|
|
2039
|
-
(r & 65535) * 1540483477 + ((r >>> 16) * 59797 << 16) ^ /* Math.imul(h, m): */
|
|
2040
|
-
(e & 65535) * 1540483477 + ((e >>> 16) * 59797 << 16);
|
|
2041
|
-
switch (a) {
|
|
2042
|
-
case 3:
|
|
2043
|
-
e ^= (n.charCodeAt(t + 2) & 255) << 16;
|
|
2044
|
-
case 2:
|
|
2045
|
-
e ^= (n.charCodeAt(t + 1) & 255) << 8;
|
|
2046
|
-
case 1:
|
|
2047
|
-
e ^= n.charCodeAt(t) & 255, e = /* Math.imul(h, m): */
|
|
2048
|
-
(e & 65535) * 1540483477 + ((e >>> 16) * 59797 << 16);
|
|
2049
|
-
}
|
|
2050
|
-
return e ^= e >>> 13, e = /* Math.imul(h, m): */
|
|
2051
|
-
(e & 65535) * 1540483477 + ((e >>> 16) * 59797 << 16), ((e ^ e >>> 15) >>> 0).toString(36);
|
|
2052
|
-
}
|
|
2053
|
-
var ye, Yr = 0, be = [];
|
|
2054
|
-
function M() {
|
|
2055
|
-
if (be.length === 0)
|
|
2056
|
-
throw new Error(ae(ye || (ye = te([`
|
|
2057
|
-
Styles were unable to be assigned to a file. This is generally caused by one of the following:
|
|
2058
|
-
|
|
2059
|
-
- You may have created styles outside of a '.css.ts' context
|
|
2060
|
-
- You may have incorrect configuration. See https://vanilla-extract.style/documentation/getting-started
|
|
2061
|
-
`]))));
|
|
2062
|
-
return be[0];
|
|
2063
|
-
}
|
|
2064
|
-
function Zr() {
|
|
2065
|
-
return Yr++;
|
|
2066
|
-
}
|
|
2067
|
-
var Gr = function(e) {
|
|
2068
|
-
return Jr(e) && !Xr(e);
|
|
2069
|
-
};
|
|
2070
|
-
function Jr(n) {
|
|
2071
|
-
return !!n && typeof n == "object";
|
|
2072
|
-
}
|
|
2073
|
-
function Xr(n) {
|
|
2074
|
-
var e = Object.prototype.toString.call(n);
|
|
2075
|
-
return e === "[object RegExp]" || e === "[object Date]" || Tr(n);
|
|
2076
|
-
}
|
|
2077
|
-
var _r = typeof Symbol == "function" && Symbol.for, Qr = _r ? Symbol.for("react.element") : 60103;
|
|
2078
|
-
function Tr(n) {
|
|
2079
|
-
return n.$$typeof === Qr;
|
|
2080
|
-
}
|
|
2081
|
-
function et(n) {
|
|
2082
|
-
return Array.isArray(n) ? [] : {};
|
|
2083
|
-
}
|
|
2084
|
-
function N(n, e) {
|
|
2085
|
-
return e.clone !== !1 && e.isMergeableObject(n) ? I(et(n), n, e) : n;
|
|
2086
|
-
}
|
|
2087
|
-
function rt(n, e, r) {
|
|
2088
|
-
return n.concat(e).map(function(t) {
|
|
2089
|
-
return N(t, r);
|
|
2090
|
-
});
|
|
2091
|
-
}
|
|
2092
|
-
function tt(n, e) {
|
|
2093
|
-
if (!e.customMerge)
|
|
2094
|
-
return I;
|
|
2095
|
-
var r = e.customMerge(n);
|
|
2096
|
-
return typeof r == "function" ? r : I;
|
|
2097
|
-
}
|
|
2098
|
-
function at(n) {
|
|
2099
|
-
return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(n).filter(function(e) {
|
|
2100
|
-
return Object.propertyIsEnumerable.call(n, e);
|
|
2101
|
-
}) : [];
|
|
2102
|
-
}
|
|
2103
|
-
function we(n) {
|
|
2104
|
-
return Object.keys(n).concat(at(n));
|
|
2105
|
-
}
|
|
2106
|
-
function Fe(n, e) {
|
|
2107
|
-
try {
|
|
2108
|
-
return e in n;
|
|
2109
|
-
} catch {
|
|
2110
|
-
return !1;
|
|
2111
|
-
}
|
|
2112
|
-
}
|
|
2113
|
-
function nt(n, e) {
|
|
2114
|
-
return Fe(n, e) && !(Object.hasOwnProperty.call(n, e) && Object.propertyIsEnumerable.call(n, e));
|
|
2115
|
-
}
|
|
2116
|
-
function it(n, e, r) {
|
|
2117
|
-
var t = {};
|
|
2118
|
-
return r.isMergeableObject(n) && we(n).forEach(function(a) {
|
|
2119
|
-
t[a] = N(n[a], r);
|
|
2120
|
-
}), we(e).forEach(function(a) {
|
|
2121
|
-
nt(n, a) || (Fe(n, a) && r.isMergeableObject(e[a]) ? t[a] = tt(a, r)(n[a], e[a], r) : t[a] = N(e[a], r));
|
|
2122
|
-
}), t;
|
|
2123
|
-
}
|
|
2124
|
-
function I(n, e, r) {
|
|
2125
|
-
r = r || {}, r.arrayMerge = r.arrayMerge || rt, r.isMergeableObject = r.isMergeableObject || Gr, r.cloneUnlessOtherwiseSpecified = N;
|
|
2126
|
-
var t = Array.isArray(e), a = Array.isArray(n), i = t === a;
|
|
2127
|
-
return i ? t ? r.arrayMerge(n, e, r) : it(n, e, r) : N(e, r);
|
|
2128
|
-
}
|
|
2129
|
-
I.all = function(e, r) {
|
|
2130
|
-
if (!Array.isArray(e))
|
|
2131
|
-
throw new Error("first argument should be an array");
|
|
2132
|
-
return e.reduce(function(t, a) {
|
|
2133
|
-
return I(t, a, r);
|
|
2134
|
-
}, {});
|
|
2135
|
-
};
|
|
2136
|
-
var lt = I, ot = lt;
|
|
2137
|
-
const ut = /* @__PURE__ */ ke(ot);
|
|
2138
|
-
var Ce = /* @__PURE__ */ new Set(), Ae = [], _ = [], st = {
|
|
2139
|
-
appendCss: (n) => {
|
|
2140
|
-
_.push(n);
|
|
2141
|
-
},
|
|
2142
|
-
registerClassName: (n) => {
|
|
2143
|
-
Ce.add(n);
|
|
2144
|
-
},
|
|
2145
|
-
registerComposition: (n) => {
|
|
2146
|
-
Ae.push(n);
|
|
2147
|
-
},
|
|
2148
|
-
markCompositionUsed: () => {
|
|
2149
|
-
},
|
|
2150
|
-
onEndFileScope: (n) => {
|
|
2151
|
-
var e = Kr({
|
|
2152
|
-
localClassNames: Array.from(Ce),
|
|
2153
|
-
composedClassLists: Ae,
|
|
2154
|
-
cssObjs: _
|
|
2155
|
-
}).join(`
|
|
2156
|
-
`);
|
|
2157
|
-
Ne({
|
|
2158
|
-
fileScope: n,
|
|
2159
|
-
css: e
|
|
2160
|
-
}), _ = [];
|
|
2161
|
-
},
|
|
2162
|
-
getIdentOption: () => process.env.NODE_ENV === "production" ? "short" : "debug"
|
|
2163
|
-
};
|
|
2164
|
-
Ge(st);
|
|
2165
|
-
function H(n, e) {
|
|
2166
|
-
return H = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, a) {
|
|
2167
|
-
return t.__proto__ = a, t;
|
|
2168
|
-
}, H(n, e);
|
|
2169
|
-
}
|
|
2170
|
-
function pt(n, e) {
|
|
2171
|
-
if (typeof e != "function" && e !== null)
|
|
2172
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
2173
|
-
n.prototype = Object.create(e && e.prototype, {
|
|
2174
|
-
constructor: {
|
|
2175
|
-
value: n,
|
|
2176
|
-
writable: !0,
|
|
2177
|
-
configurable: !0
|
|
2178
|
-
}
|
|
2179
|
-
}), Object.defineProperty(n, "prototype", {
|
|
2180
|
-
writable: !1
|
|
2181
|
-
}), e && H(n, e);
|
|
2182
|
-
}
|
|
2183
|
-
function ee() {
|
|
2184
|
-
ee = function(a, i) {
|
|
2185
|
-
return new r(a, void 0, i);
|
|
2186
|
-
};
|
|
2187
|
-
var n = RegExp.prototype, e = /* @__PURE__ */ new WeakMap();
|
|
2188
|
-
function r(a, i, l) {
|
|
2189
|
-
var u = new RegExp(a, i);
|
|
2190
|
-
return e.set(u, l || e.get(a)), H(u, r.prototype);
|
|
2191
|
-
}
|
|
2192
|
-
function t(a, i) {
|
|
2193
|
-
var l = e.get(i);
|
|
2194
|
-
return Object.keys(l).reduce(function(u, o) {
|
|
2195
|
-
var s = l[o];
|
|
2196
|
-
if (typeof s == "number") u[o] = a[s];
|
|
2197
|
-
else {
|
|
2198
|
-
for (var p = 0; a[s[p]] === void 0 && p + 1 < s.length; ) p++;
|
|
2199
|
-
u[o] = a[s[p]];
|
|
2200
|
-
}
|
|
2201
|
-
return u;
|
|
2202
|
-
}, /* @__PURE__ */ Object.create(null));
|
|
2203
|
-
}
|
|
2204
|
-
return pt(r, RegExp), r.prototype.exec = function(a) {
|
|
2205
|
-
var i = n.exec.call(this, a);
|
|
2206
|
-
if (i) {
|
|
2207
|
-
i.groups = t(i, this);
|
|
2208
|
-
var l = i.indices;
|
|
2209
|
-
l && (l.groups = t(l, this));
|
|
2210
|
-
}
|
|
2211
|
-
return i;
|
|
2212
|
-
}, r.prototype[Symbol.replace] = function(a, i) {
|
|
2213
|
-
if (typeof i == "string") {
|
|
2214
|
-
var l = e.get(this);
|
|
2215
|
-
return n[Symbol.replace].call(this, a, i.replace(/\$<([^>]+)>/g, function(o, s) {
|
|
2216
|
-
var p = l[s];
|
|
2217
|
-
return "$" + (Array.isArray(p) ? p.join("$") : p);
|
|
2218
|
-
}));
|
|
2219
|
-
}
|
|
2220
|
-
if (typeof i == "function") {
|
|
2221
|
-
var u = this;
|
|
2222
|
-
return n[Symbol.replace].call(this, a, function() {
|
|
2223
|
-
var o = arguments;
|
|
2224
|
-
return typeof o[o.length - 1] != "object" && (o = [].slice.call(o)).push(t(o, u)), i.apply(this, o);
|
|
2225
|
-
});
|
|
2226
|
-
}
|
|
2227
|
-
return n[Symbol.replace].call(this, a, i);
|
|
2228
|
-
}, ee.apply(this, arguments);
|
|
2229
|
-
}
|
|
2230
|
-
function ht(n) {
|
|
2231
|
-
var {
|
|
2232
|
-
debugId: e,
|
|
2233
|
-
debugFileName: r
|
|
2234
|
-
} = n, t = e ? [e.replace(/\s/g, "_")] : [];
|
|
2235
|
-
if (r) {
|
|
2236
|
-
var {
|
|
2237
|
-
filePath: a
|
|
2238
|
-
} = M(), i = a.match(/* @__PURE__ */ ee(/([^\/\\]*)?[\/\\]?([^\/\\]*)\.css\.(ts|js|tsx|jsx|cjs|mjs)$/, {
|
|
2239
|
-
dir: 1,
|
|
2240
|
-
file: 2
|
|
2241
|
-
}));
|
|
2242
|
-
if (i && i.groups) {
|
|
2243
|
-
var {
|
|
2244
|
-
dir: l,
|
|
2245
|
-
file: u
|
|
2246
|
-
} = i.groups;
|
|
2247
|
-
t.unshift(u && u !== "index" ? u : l);
|
|
2248
|
-
}
|
|
2249
|
-
}
|
|
2250
|
-
return t.join("_");
|
|
2251
|
-
}
|
|
2252
|
-
function Se(n) {
|
|
2253
|
-
return n.match(/^[0-9]/) ? "_".concat(n) : n;
|
|
2254
|
-
}
|
|
2255
|
-
function Re(n) {
|
|
2256
|
-
var e = _e(), {
|
|
2257
|
-
debugId: r,
|
|
2258
|
-
debugFileName: t = !0
|
|
2259
|
-
} = P(P({}, typeof n == "string" ? {
|
|
2260
|
-
debugId: n
|
|
2261
|
-
} : null), typeof n == "object" ? n : null), a = Zr().toString(36), {
|
|
2262
|
-
filePath: i,
|
|
2263
|
-
packageName: l
|
|
2264
|
-
} = M(), u = Hr(l ? "".concat(l).concat(i) : i), o = "".concat(u).concat(a);
|
|
2265
|
-
if (e === "debug") {
|
|
2266
|
-
var s = ht({
|
|
2267
|
-
debugId: r,
|
|
2268
|
-
debugFileName: t
|
|
2269
|
-
});
|
|
2270
|
-
return s && (o = "".concat(s, "__").concat(o)), Se(o);
|
|
2271
|
-
}
|
|
2272
|
-
if (typeof e == "function") {
|
|
2273
|
-
if (o = e({
|
|
2274
|
-
hash: o,
|
|
2275
|
-
debugId: r,
|
|
2276
|
-
filePath: i,
|
|
2277
|
-
packageName: l
|
|
2278
|
-
}), !o.match(/^[A-Z_][0-9A-Z_-]+$/i))
|
|
2279
|
-
throw new Error('Identifier function returned invalid indentifier: "'.concat(o, '"'));
|
|
2280
|
-
return o;
|
|
2281
|
-
}
|
|
2282
|
-
return Se(o);
|
|
2283
|
-
}
|
|
2284
|
-
function ft(n, e) {
|
|
2285
|
-
var r = Re(e);
|
|
2286
|
-
je(r, M());
|
|
2287
|
-
var t = [], a = [];
|
|
2288
|
-
for (var i of n)
|
|
2289
|
-
typeof i == "string" ? t.push(i) : a.push(i);
|
|
2290
|
-
var l = r;
|
|
2291
|
-
if (t.length > 0 && (l = "".concat(r, " ").concat(Lr(t)), Xe({
|
|
2292
|
-
identifier: r,
|
|
2293
|
-
classList: l
|
|
2294
|
-
}, M()), a.length > 0 && Pe(r)), a.length > 0) {
|
|
2295
|
-
var u = ut.all(a, {
|
|
2296
|
-
// Replace arrays rather than merging
|
|
2297
|
-
arrayMerge: (o, s) => s
|
|
2298
|
-
});
|
|
2299
|
-
xe({
|
|
2300
|
-
type: "local",
|
|
2301
|
-
selector: r,
|
|
2302
|
-
rule: u
|
|
2303
|
-
}, M());
|
|
2304
|
-
}
|
|
2305
|
-
return l;
|
|
2306
|
-
}
|
|
2307
|
-
function Et(n, e) {
|
|
2308
|
-
if (Array.isArray(n))
|
|
2309
|
-
return ft(n, e);
|
|
2310
|
-
var r = Re(e);
|
|
2311
|
-
return je(r, M()), xe({
|
|
2312
|
-
type: "local",
|
|
2313
|
-
selector: r,
|
|
2314
|
-
rule: n
|
|
2315
|
-
}, M()), r;
|
|
2316
|
-
}
|
|
2317
|
-
const ct = {
|
|
1
|
+
import { style as j } from "@vanilla-extract/css";
|
|
2
|
+
import { recipe as M } from "@vanilla-extract/recipes";
|
|
3
|
+
import { createSprinkles as C, defineProperties as N } from "@vanilla-extract/sprinkles";
|
|
4
|
+
import v from "react";
|
|
5
|
+
import t from "@telegraph/tokens";
|
|
6
|
+
const o = {
|
|
2318
7
|
transparent: "var(--tgph-transparent)",
|
|
2319
8
|
white: "var(--tgph-white)",
|
|
2320
9
|
black: "var(--tgph-black)",
|
|
@@ -2440,7 +129,7 @@ const ct = {
|
|
|
2440
129
|
"purple-10": "var(--tgph-purple-10)",
|
|
2441
130
|
"purple-11": "var(--tgph-purple-11)",
|
|
2442
131
|
"purple-12": "var(--tgph-purple-12)"
|
|
2443
|
-
},
|
|
132
|
+
}, d = {
|
|
2444
133
|
0: "var(--tgph-rounded-0)",
|
|
2445
134
|
1: "var(--tgph-rounded-1)",
|
|
2446
135
|
2: "var(--tgph-rounded-2)",
|
|
@@ -2449,13 +138,13 @@ const ct = {
|
|
|
2449
138
|
5: "var(--tgph-rounded-5)",
|
|
2450
139
|
6: "var(--tgph-rounded-6)",
|
|
2451
140
|
full: "var(--tgph-rounded-full)"
|
|
2452
|
-
},
|
|
141
|
+
}, s = {
|
|
2453
142
|
0: "var(--tgph-shadow-0)",
|
|
2454
143
|
1: "var(--tgph-shadow-1)",
|
|
2455
144
|
2: "var(--tgph-shadow-2)",
|
|
2456
145
|
3: "var(--tgph-shadow-3)",
|
|
2457
146
|
inner: "var(--tgph-shadow-inner)"
|
|
2458
|
-
},
|
|
147
|
+
}, b = {
|
|
2459
148
|
0: "var(--tgph-spacing-0)",
|
|
2460
149
|
1: "var(--tgph-spacing-1)",
|
|
2461
150
|
2: "var(--tgph-spacing-2)",
|
|
@@ -2491,10 +180,10 @@ const ct = {
|
|
|
2491
180
|
px: "var(--tgph-spacing-px)",
|
|
2492
181
|
full: "var(--tgph-spacing-full)",
|
|
2493
182
|
auto: "var(--tgph-spacing-auto)"
|
|
2494
|
-
},
|
|
183
|
+
}, u = {
|
|
2495
184
|
sans: "var(--tgph-family-sans)",
|
|
2496
185
|
mono: "var(--tgph-family-mono)"
|
|
2497
|
-
},
|
|
186
|
+
}, w = {
|
|
2498
187
|
0: "var(--tgph-leading-0)",
|
|
2499
188
|
1: "var(--tgph-leading-1)",
|
|
2500
189
|
2: "var(--tgph-leading-2)",
|
|
@@ -2515,7 +204,7 @@ const ct = {
|
|
|
2515
204
|
"code-7": "var(--tgph-leading-code-7)",
|
|
2516
205
|
"code-8": "var(--tgph-leading-code-8)",
|
|
2517
206
|
"code-9": "var(--tgph-leading-code-9)"
|
|
2518
|
-
},
|
|
207
|
+
}, y = {
|
|
2519
208
|
0: "var(--tgph-tracking-0)",
|
|
2520
209
|
1: "var(--tgph-tracking-1)",
|
|
2521
210
|
2: "var(--tgph-tracking-2)",
|
|
@@ -2526,7 +215,7 @@ const ct = {
|
|
|
2526
215
|
7: "var(--tgph-tracking-7)",
|
|
2527
216
|
8: "var(--tgph-tracking-8)",
|
|
2528
217
|
9: "var(--tgph-tracking-9)"
|
|
2529
|
-
},
|
|
218
|
+
}, k = {
|
|
2530
219
|
0: "var(--tgph-text-0)",
|
|
2531
220
|
1: "var(--tgph-text-1)",
|
|
2532
221
|
2: "var(--tgph-text-2)",
|
|
@@ -2546,17 +235,17 @@ const ct = {
|
|
|
2546
235
|
"code-7": "var(--tgph-text-code-7)",
|
|
2547
236
|
"code-8": "var(--tgph-text-code-8)",
|
|
2548
237
|
"code-9": "var(--tgph-text-code-9)"
|
|
2549
|
-
},
|
|
238
|
+
}, m = {
|
|
2550
239
|
regular: "var(--tgph-weight-regular)",
|
|
2551
240
|
medium: "var(--tgph-weight-medium)",
|
|
2552
241
|
"semi-bold": "var(--tgph-weight-semi-bold)"
|
|
2553
|
-
},
|
|
242
|
+
}, x = {
|
|
2554
243
|
sm: "var(--tgph-breakpoint-sm)",
|
|
2555
244
|
md: "var(--tgph-breakpoint-md)",
|
|
2556
245
|
lg: "var(--tgph-breakpoint-lg)",
|
|
2557
246
|
xl: "var(--tgph-breakpoint-xl)",
|
|
2558
247
|
"2xl": "var(--tgph-breakpoint-2xl)"
|
|
2559
|
-
},
|
|
248
|
+
}, f = {
|
|
2560
249
|
hidden: "var(--tgph-zIndex-hidden)",
|
|
2561
250
|
base: "var(--tgph-zIndex-base)",
|
|
2562
251
|
auto: "var(--tgph-zIndex-auto)",
|
|
@@ -2569,62 +258,62 @@ const ct = {
|
|
|
2569
258
|
skipLink: "var(--tgph-zIndex-skipLink)",
|
|
2570
259
|
toast: "var(--tgph-zIndex-toast)",
|
|
2571
260
|
tooltip: "var(--tgph-zIndex-tooltip)"
|
|
2572
|
-
},
|
|
261
|
+
}, P = {
|
|
2573
262
|
"border-style": {
|
|
2574
263
|
solid: "var(--tgph-border-style-solid)",
|
|
2575
264
|
dashed: "var(--tgph-border-style-dashed)"
|
|
2576
265
|
},
|
|
2577
|
-
color:
|
|
2578
|
-
rounded:
|
|
2579
|
-
shadow:
|
|
2580
|
-
spacing:
|
|
2581
|
-
family:
|
|
2582
|
-
leading:
|
|
2583
|
-
tracking:
|
|
2584
|
-
text:
|
|
2585
|
-
weight:
|
|
2586
|
-
breakpoint:
|
|
2587
|
-
zIndex:
|
|
2588
|
-
},
|
|
2589
|
-
props:
|
|
2590
|
-
stylePropsFn:
|
|
266
|
+
color: o,
|
|
267
|
+
rounded: d,
|
|
268
|
+
shadow: s,
|
|
269
|
+
spacing: b,
|
|
270
|
+
family: u,
|
|
271
|
+
leading: w,
|
|
272
|
+
tracking: y,
|
|
273
|
+
text: k,
|
|
274
|
+
weight: m,
|
|
275
|
+
breakpoint: x,
|
|
276
|
+
zIndex: f
|
|
277
|
+
}, S = ({
|
|
278
|
+
props: l,
|
|
279
|
+
stylePropsFn: a
|
|
2591
280
|
}) => {
|
|
2592
|
-
const r =
|
|
2593
|
-
const
|
|
2594
|
-
return r ? (Object.keys(r).forEach((
|
|
2595
|
-
const
|
|
2596
|
-
|
|
2597
|
-
[
|
|
2598
|
-
}),
|
|
2599
|
-
[
|
|
281
|
+
const r = v.useMemo(() => l, [l]), p = v.useMemo(() => {
|
|
282
|
+
const n = a.properties, g = {}, h = {};
|
|
283
|
+
return r ? (Object.keys(r).forEach((i) => {
|
|
284
|
+
const e = i;
|
|
285
|
+
n.has(e) && Object.assign(g, {
|
|
286
|
+
[e]: r[e]
|
|
287
|
+
}), n.has(e) || Object.assign(h, {
|
|
288
|
+
[e]: r[e]
|
|
2600
289
|
});
|
|
2601
|
-
}), { styleProps:
|
|
2602
|
-
}, [r,
|
|
290
|
+
}), { styleProps: g, componentProps: h }) : { styleProps: g, componentProps: h };
|
|
291
|
+
}, [r, a == null ? void 0 : a.properties]), c = v.useMemo(() => a(p.styleProps), [p.styleProps, a]);
|
|
2603
292
|
return {
|
|
2604
|
-
styleProps:
|
|
2605
|
-
componentProps:
|
|
2606
|
-
styleClassName:
|
|
293
|
+
styleProps: p.styleProps,
|
|
294
|
+
componentProps: p.componentProps,
|
|
295
|
+
styleClassName: c
|
|
2607
296
|
};
|
|
2608
|
-
},
|
|
297
|
+
}, O = {
|
|
2609
298
|
conditions: {
|
|
2610
|
-
sm: { "@media": `screen and (min-width: ${
|
|
2611
|
-
md: { "@media": `screen and (min-width: ${
|
|
2612
|
-
lg: { "@media": `screen and (min-width: ${
|
|
2613
|
-
xl: { "@media": `screen and (min-width: ${
|
|
299
|
+
sm: { "@media": `screen and (min-width: ${t.tokens.breakpoint.sm})` },
|
|
300
|
+
md: { "@media": `screen and (min-width: ${t.tokens.breakpoint.md})` },
|
|
301
|
+
lg: { "@media": `screen and (min-width: ${t.tokens.breakpoint.lg})` },
|
|
302
|
+
xl: { "@media": `screen and (min-width: ${t.tokens.breakpoint.xl})` },
|
|
2614
303
|
"2xl": {
|
|
2615
|
-
"@media": `screen and (min-width: ${
|
|
304
|
+
"@media": `screen and (min-width: ${t.tokens.breakpoint["2xl"]})`
|
|
2616
305
|
}
|
|
2617
306
|
},
|
|
2618
307
|
defaultCondition: "sm",
|
|
2619
308
|
responsiveArray: ["sm", "md", "lg", "xl", "2xl"]
|
|
2620
309
|
};
|
|
2621
310
|
export {
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
311
|
+
O as RESPONSIVE_STYLE_PROPS,
|
|
312
|
+
C as createStyleProps,
|
|
313
|
+
N as defineStyleProps,
|
|
314
|
+
M as recipe,
|
|
315
|
+
j as style,
|
|
316
|
+
P as tokens,
|
|
317
|
+
S as useStyleProps
|
|
2629
318
|
};
|
|
2630
319
|
//# sourceMappingURL=index.mjs.map
|