@betterbugs/rrdom-nodejs 2.0.0-alpha.19

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.
@@ -0,0 +1,4446 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
+ var __defProp2 = Object.defineProperty;
5
+ var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __publicField2 = (obj, key, value) => __defNormalProp2(obj, typeof key !== "symbol" ? key + "" : key, value);
7
+ function getDefaultExportFromCjs(x2) {
8
+ return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
9
+ }
10
+ function getAugmentedNamespace(n) {
11
+ if (n.__esModule) return n;
12
+ var f = n.default;
13
+ if (typeof f == "function") {
14
+ var a = function a2() {
15
+ if (this instanceof a2) {
16
+ return Reflect.construct(f, arguments, this.constructor);
17
+ }
18
+ return f.apply(this, arguments);
19
+ };
20
+ a.prototype = f.prototype;
21
+ } else a = {};
22
+ Object.defineProperty(a, "__esModule", { value: true });
23
+ Object.keys(n).forEach(function(k) {
24
+ var d = Object.getOwnPropertyDescriptor(n, k);
25
+ Object.defineProperty(a, k, d.get ? d : {
26
+ enumerable: true,
27
+ get: function() {
28
+ return n[k];
29
+ }
30
+ });
31
+ });
32
+ return a;
33
+ }
34
+ var picocolors_browser = { exports: {} };
35
+ var x = String;
36
+ var create = function() {
37
+ return { isColorSupported: false, reset: x, bold: x, dim: x, italic: x, underline: x, inverse: x, hidden: x, strikethrough: x, black: x, red: x, green: x, yellow: x, blue: x, magenta: x, cyan: x, white: x, gray: x, bgBlack: x, bgRed: x, bgGreen: x, bgYellow: x, bgBlue: x, bgMagenta: x, bgCyan: x, bgWhite: x };
38
+ };
39
+ picocolors_browser.exports = create();
40
+ picocolors_browser.exports.createColors = create;
41
+ var picocolors_browserExports = picocolors_browser.exports;
42
+ const __viteBrowserExternal = {};
43
+ const __viteBrowserExternal$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
44
+ __proto__: null,
45
+ default: __viteBrowserExternal
46
+ }, Symbol.toStringTag, { value: "Module" }));
47
+ const require$$2 = /* @__PURE__ */ getAugmentedNamespace(__viteBrowserExternal$1);
48
+ let pico = picocolors_browserExports;
49
+ let terminalHighlight$1 = require$$2;
50
+ let CssSyntaxError$3 = class CssSyntaxError extends Error {
51
+ constructor(message, line, column, source, file, plugin2) {
52
+ super(message);
53
+ this.name = "CssSyntaxError";
54
+ this.reason = message;
55
+ if (file) {
56
+ this.file = file;
57
+ }
58
+ if (source) {
59
+ this.source = source;
60
+ }
61
+ if (plugin2) {
62
+ this.plugin = plugin2;
63
+ }
64
+ if (typeof line !== "undefined" && typeof column !== "undefined") {
65
+ if (typeof line === "number") {
66
+ this.line = line;
67
+ this.column = column;
68
+ } else {
69
+ this.line = line.line;
70
+ this.column = line.column;
71
+ this.endLine = column.line;
72
+ this.endColumn = column.column;
73
+ }
74
+ }
75
+ this.setMessage();
76
+ if (Error.captureStackTrace) {
77
+ Error.captureStackTrace(this, CssSyntaxError);
78
+ }
79
+ }
80
+ setMessage() {
81
+ this.message = this.plugin ? this.plugin + ": " : "";
82
+ this.message += this.file ? this.file : "<css input>";
83
+ if (typeof this.line !== "undefined") {
84
+ this.message += ":" + this.line + ":" + this.column;
85
+ }
86
+ this.message += ": " + this.reason;
87
+ }
88
+ showSourceCode(color) {
89
+ if (!this.source) return "";
90
+ let css = this.source;
91
+ if (color == null) color = pico.isColorSupported;
92
+ if (terminalHighlight$1) {
93
+ if (color) css = terminalHighlight$1(css);
94
+ }
95
+ let lines = css.split(/\r?\n/);
96
+ let start = Math.max(this.line - 3, 0);
97
+ let end = Math.min(this.line + 2, lines.length);
98
+ let maxWidth = String(end).length;
99
+ let mark, aside;
100
+ if (color) {
101
+ let { bold, gray, red } = pico.createColors(true);
102
+ mark = (text) => bold(red(text));
103
+ aside = (text) => gray(text);
104
+ } else {
105
+ mark = aside = (str) => str;
106
+ }
107
+ return lines.slice(start, end).map((line, index2) => {
108
+ let number = start + 1 + index2;
109
+ let gutter = " " + (" " + number).slice(-maxWidth) + " | ";
110
+ if (number === this.line) {
111
+ let spacing = aside(gutter.replace(/\d/g, " ")) + line.slice(0, this.column - 1).replace(/[^\t]/g, " ");
112
+ return mark(">") + aside(gutter) + line + "\n " + spacing + mark("^");
113
+ }
114
+ return " " + aside(gutter) + line;
115
+ }).join("\n");
116
+ }
117
+ toString() {
118
+ let code = this.showSourceCode();
119
+ if (code) {
120
+ code = "\n\n" + code + "\n";
121
+ }
122
+ return this.name + ": " + this.message + code;
123
+ }
124
+ };
125
+ var cssSyntaxError = CssSyntaxError$3;
126
+ CssSyntaxError$3.default = CssSyntaxError$3;
127
+ var symbols = {};
128
+ symbols.isClean = Symbol("isClean");
129
+ symbols.my = Symbol("my");
130
+ const DEFAULT_RAW = {
131
+ after: "\n",
132
+ beforeClose: "\n",
133
+ beforeComment: "\n",
134
+ beforeDecl: "\n",
135
+ beforeOpen: " ",
136
+ beforeRule: "\n",
137
+ colon: ": ",
138
+ commentLeft: " ",
139
+ commentRight: " ",
140
+ emptyBody: "",
141
+ indent: " ",
142
+ semicolon: false
143
+ };
144
+ function capitalize(str) {
145
+ return str[0].toUpperCase() + str.slice(1);
146
+ }
147
+ let Stringifier$2 = class Stringifier {
148
+ constructor(builder) {
149
+ this.builder = builder;
150
+ }
151
+ atrule(node2, semicolon) {
152
+ let name = "@" + node2.name;
153
+ let params = node2.params ? this.rawValue(node2, "params") : "";
154
+ if (typeof node2.raws.afterName !== "undefined") {
155
+ name += node2.raws.afterName;
156
+ } else if (params) {
157
+ name += " ";
158
+ }
159
+ if (node2.nodes) {
160
+ this.block(node2, name + params);
161
+ } else {
162
+ let end = (node2.raws.between || "") + (semicolon ? ";" : "");
163
+ this.builder(name + params + end, node2);
164
+ }
165
+ }
166
+ beforeAfter(node2, detect) {
167
+ let value;
168
+ if (node2.type === "decl") {
169
+ value = this.raw(node2, null, "beforeDecl");
170
+ } else if (node2.type === "comment") {
171
+ value = this.raw(node2, null, "beforeComment");
172
+ } else if (detect === "before") {
173
+ value = this.raw(node2, null, "beforeRule");
174
+ } else {
175
+ value = this.raw(node2, null, "beforeClose");
176
+ }
177
+ let buf = node2.parent;
178
+ let depth = 0;
179
+ while (buf && buf.type !== "root") {
180
+ depth += 1;
181
+ buf = buf.parent;
182
+ }
183
+ if (value.includes("\n")) {
184
+ let indent = this.raw(node2, null, "indent");
185
+ if (indent.length) {
186
+ for (let step = 0; step < depth; step++) value += indent;
187
+ }
188
+ }
189
+ return value;
190
+ }
191
+ block(node2, start) {
192
+ let between = this.raw(node2, "between", "beforeOpen");
193
+ this.builder(start + between + "{", node2, "start");
194
+ let after;
195
+ if (node2.nodes && node2.nodes.length) {
196
+ this.body(node2);
197
+ after = this.raw(node2, "after");
198
+ } else {
199
+ after = this.raw(node2, "after", "emptyBody");
200
+ }
201
+ if (after) this.builder(after);
202
+ this.builder("}", node2, "end");
203
+ }
204
+ body(node2) {
205
+ let last = node2.nodes.length - 1;
206
+ while (last > 0) {
207
+ if (node2.nodes[last].type !== "comment") break;
208
+ last -= 1;
209
+ }
210
+ let semicolon = this.raw(node2, "semicolon");
211
+ for (let i = 0; i < node2.nodes.length; i++) {
212
+ let child = node2.nodes[i];
213
+ let before = this.raw(child, "before");
214
+ if (before) this.builder(before);
215
+ this.stringify(child, last !== i || semicolon);
216
+ }
217
+ }
218
+ comment(node2) {
219
+ let left = this.raw(node2, "left", "commentLeft");
220
+ let right = this.raw(node2, "right", "commentRight");
221
+ this.builder("/*" + left + node2.text + right + "*/", node2);
222
+ }
223
+ decl(node2, semicolon) {
224
+ let between = this.raw(node2, "between", "colon");
225
+ let string = node2.prop + between + this.rawValue(node2, "value");
226
+ if (node2.important) {
227
+ string += node2.raws.important || " !important";
228
+ }
229
+ if (semicolon) string += ";";
230
+ this.builder(string, node2);
231
+ }
232
+ document(node2) {
233
+ this.body(node2);
234
+ }
235
+ raw(node2, own, detect) {
236
+ let value;
237
+ if (!detect) detect = own;
238
+ if (own) {
239
+ value = node2.raws[own];
240
+ if (typeof value !== "undefined") return value;
241
+ }
242
+ let parent = node2.parent;
243
+ if (detect === "before") {
244
+ if (!parent || parent.type === "root" && parent.first === node2) {
245
+ return "";
246
+ }
247
+ if (parent && parent.type === "document") {
248
+ return "";
249
+ }
250
+ }
251
+ if (!parent) return DEFAULT_RAW[detect];
252
+ let root2 = node2.root();
253
+ if (!root2.rawCache) root2.rawCache = {};
254
+ if (typeof root2.rawCache[detect] !== "undefined") {
255
+ return root2.rawCache[detect];
256
+ }
257
+ if (detect === "before" || detect === "after") {
258
+ return this.beforeAfter(node2, detect);
259
+ } else {
260
+ let method = "raw" + capitalize(detect);
261
+ if (this[method]) {
262
+ value = this[method](root2, node2);
263
+ } else {
264
+ root2.walk((i) => {
265
+ value = i.raws[own];
266
+ if (typeof value !== "undefined") return false;
267
+ });
268
+ }
269
+ }
270
+ if (typeof value === "undefined") value = DEFAULT_RAW[detect];
271
+ root2.rawCache[detect] = value;
272
+ return value;
273
+ }
274
+ rawBeforeClose(root2) {
275
+ let value;
276
+ root2.walk((i) => {
277
+ if (i.nodes && i.nodes.length > 0) {
278
+ if (typeof i.raws.after !== "undefined") {
279
+ value = i.raws.after;
280
+ if (value.includes("\n")) {
281
+ value = value.replace(/[^\n]+$/, "");
282
+ }
283
+ return false;
284
+ }
285
+ }
286
+ });
287
+ if (value) value = value.replace(/\S/g, "");
288
+ return value;
289
+ }
290
+ rawBeforeComment(root2, node2) {
291
+ let value;
292
+ root2.walkComments((i) => {
293
+ if (typeof i.raws.before !== "undefined") {
294
+ value = i.raws.before;
295
+ if (value.includes("\n")) {
296
+ value = value.replace(/[^\n]+$/, "");
297
+ }
298
+ return false;
299
+ }
300
+ });
301
+ if (typeof value === "undefined") {
302
+ value = this.raw(node2, null, "beforeDecl");
303
+ } else if (value) {
304
+ value = value.replace(/\S/g, "");
305
+ }
306
+ return value;
307
+ }
308
+ rawBeforeDecl(root2, node2) {
309
+ let value;
310
+ root2.walkDecls((i) => {
311
+ if (typeof i.raws.before !== "undefined") {
312
+ value = i.raws.before;
313
+ if (value.includes("\n")) {
314
+ value = value.replace(/[^\n]+$/, "");
315
+ }
316
+ return false;
317
+ }
318
+ });
319
+ if (typeof value === "undefined") {
320
+ value = this.raw(node2, null, "beforeRule");
321
+ } else if (value) {
322
+ value = value.replace(/\S/g, "");
323
+ }
324
+ return value;
325
+ }
326
+ rawBeforeOpen(root2) {
327
+ let value;
328
+ root2.walk((i) => {
329
+ if (i.type !== "decl") {
330
+ value = i.raws.between;
331
+ if (typeof value !== "undefined") return false;
332
+ }
333
+ });
334
+ return value;
335
+ }
336
+ rawBeforeRule(root2) {
337
+ let value;
338
+ root2.walk((i) => {
339
+ if (i.nodes && (i.parent !== root2 || root2.first !== i)) {
340
+ if (typeof i.raws.before !== "undefined") {
341
+ value = i.raws.before;
342
+ if (value.includes("\n")) {
343
+ value = value.replace(/[^\n]+$/, "");
344
+ }
345
+ return false;
346
+ }
347
+ }
348
+ });
349
+ if (value) value = value.replace(/\S/g, "");
350
+ return value;
351
+ }
352
+ rawColon(root2) {
353
+ let value;
354
+ root2.walkDecls((i) => {
355
+ if (typeof i.raws.between !== "undefined") {
356
+ value = i.raws.between.replace(/[^\s:]/g, "");
357
+ return false;
358
+ }
359
+ });
360
+ return value;
361
+ }
362
+ rawEmptyBody(root2) {
363
+ let value;
364
+ root2.walk((i) => {
365
+ if (i.nodes && i.nodes.length === 0) {
366
+ value = i.raws.after;
367
+ if (typeof value !== "undefined") return false;
368
+ }
369
+ });
370
+ return value;
371
+ }
372
+ rawIndent(root2) {
373
+ if (root2.raws.indent) return root2.raws.indent;
374
+ let value;
375
+ root2.walk((i) => {
376
+ let p = i.parent;
377
+ if (p && p !== root2 && p.parent && p.parent === root2) {
378
+ if (typeof i.raws.before !== "undefined") {
379
+ let parts = i.raws.before.split("\n");
380
+ value = parts[parts.length - 1];
381
+ value = value.replace(/\S/g, "");
382
+ return false;
383
+ }
384
+ }
385
+ });
386
+ return value;
387
+ }
388
+ rawSemicolon(root2) {
389
+ let value;
390
+ root2.walk((i) => {
391
+ if (i.nodes && i.nodes.length && i.last.type === "decl") {
392
+ value = i.raws.semicolon;
393
+ if (typeof value !== "undefined") return false;
394
+ }
395
+ });
396
+ return value;
397
+ }
398
+ rawValue(node2, prop) {
399
+ let value = node2[prop];
400
+ let raw = node2.raws[prop];
401
+ if (raw && raw.value === value) {
402
+ return raw.raw;
403
+ }
404
+ return value;
405
+ }
406
+ root(node2) {
407
+ this.body(node2);
408
+ if (node2.raws.after) this.builder(node2.raws.after);
409
+ }
410
+ rule(node2) {
411
+ this.block(node2, this.rawValue(node2, "selector"));
412
+ if (node2.raws.ownSemicolon) {
413
+ this.builder(node2.raws.ownSemicolon, node2, "end");
414
+ }
415
+ }
416
+ stringify(node2, semicolon) {
417
+ if (!this[node2.type]) {
418
+ throw new Error(
419
+ "Unknown AST node type " + node2.type + ". Maybe you need to change PostCSS stringifier."
420
+ );
421
+ }
422
+ this[node2.type](node2, semicolon);
423
+ }
424
+ };
425
+ var stringifier = Stringifier$2;
426
+ Stringifier$2.default = Stringifier$2;
427
+ let Stringifier$1 = stringifier;
428
+ function stringify$4(node2, builder) {
429
+ let str = new Stringifier$1(builder);
430
+ str.stringify(node2);
431
+ }
432
+ var stringify_1 = stringify$4;
433
+ stringify$4.default = stringify$4;
434
+ let { isClean: isClean$2, my: my$2 } = symbols;
435
+ let CssSyntaxError$2 = cssSyntaxError;
436
+ let Stringifier2 = stringifier;
437
+ let stringify$3 = stringify_1;
438
+ function cloneNode(obj, parent) {
439
+ let cloned = new obj.constructor();
440
+ for (let i in obj) {
441
+ if (!Object.prototype.hasOwnProperty.call(obj, i)) {
442
+ continue;
443
+ }
444
+ if (i === "proxyCache") continue;
445
+ let value = obj[i];
446
+ let type = typeof value;
447
+ if (i === "parent" && type === "object") {
448
+ if (parent) cloned[i] = parent;
449
+ } else if (i === "source") {
450
+ cloned[i] = value;
451
+ } else if (Array.isArray(value)) {
452
+ cloned[i] = value.map((j) => cloneNode(j, cloned));
453
+ } else {
454
+ if (type === "object" && value !== null) value = cloneNode(value);
455
+ cloned[i] = value;
456
+ }
457
+ }
458
+ return cloned;
459
+ }
460
+ let Node$4 = class Node2 {
461
+ constructor(defaults = {}) {
462
+ this.raws = {};
463
+ this[isClean$2] = false;
464
+ this[my$2] = true;
465
+ for (let name in defaults) {
466
+ if (name === "nodes") {
467
+ this.nodes = [];
468
+ for (let node2 of defaults[name]) {
469
+ if (typeof node2.clone === "function") {
470
+ this.append(node2.clone());
471
+ } else {
472
+ this.append(node2);
473
+ }
474
+ }
475
+ } else {
476
+ this[name] = defaults[name];
477
+ }
478
+ }
479
+ }
480
+ addToError(error) {
481
+ error.postcssNode = this;
482
+ if (error.stack && this.source && /\n\s{4}at /.test(error.stack)) {
483
+ let s = this.source;
484
+ error.stack = error.stack.replace(
485
+ /\n\s{4}at /,
486
+ `$&${s.input.from}:${s.start.line}:${s.start.column}$&`
487
+ );
488
+ }
489
+ return error;
490
+ }
491
+ after(add) {
492
+ this.parent.insertAfter(this, add);
493
+ return this;
494
+ }
495
+ assign(overrides = {}) {
496
+ for (let name in overrides) {
497
+ this[name] = overrides[name];
498
+ }
499
+ return this;
500
+ }
501
+ before(add) {
502
+ this.parent.insertBefore(this, add);
503
+ return this;
504
+ }
505
+ cleanRaws(keepBetween) {
506
+ delete this.raws.before;
507
+ delete this.raws.after;
508
+ if (!keepBetween) delete this.raws.between;
509
+ }
510
+ clone(overrides = {}) {
511
+ let cloned = cloneNode(this);
512
+ for (let name in overrides) {
513
+ cloned[name] = overrides[name];
514
+ }
515
+ return cloned;
516
+ }
517
+ cloneAfter(overrides = {}) {
518
+ let cloned = this.clone(overrides);
519
+ this.parent.insertAfter(this, cloned);
520
+ return cloned;
521
+ }
522
+ cloneBefore(overrides = {}) {
523
+ let cloned = this.clone(overrides);
524
+ this.parent.insertBefore(this, cloned);
525
+ return cloned;
526
+ }
527
+ error(message, opts = {}) {
528
+ if (this.source) {
529
+ let { end, start } = this.rangeBy(opts);
530
+ return this.source.input.error(
531
+ message,
532
+ { column: start.column, line: start.line },
533
+ { column: end.column, line: end.line },
534
+ opts
535
+ );
536
+ }
537
+ return new CssSyntaxError$2(message);
538
+ }
539
+ getProxyProcessor() {
540
+ return {
541
+ get(node2, prop) {
542
+ if (prop === "proxyOf") {
543
+ return node2;
544
+ } else if (prop === "root") {
545
+ return () => node2.root().toProxy();
546
+ } else {
547
+ return node2[prop];
548
+ }
549
+ },
550
+ set(node2, prop, value) {
551
+ if (node2[prop] === value) return true;
552
+ node2[prop] = value;
553
+ if (prop === "prop" || prop === "value" || prop === "name" || prop === "params" || prop === "important" || /* c8 ignore next */
554
+ prop === "text") {
555
+ node2.markDirty();
556
+ }
557
+ return true;
558
+ }
559
+ };
560
+ }
561
+ markDirty() {
562
+ if (this[isClean$2]) {
563
+ this[isClean$2] = false;
564
+ let next = this;
565
+ while (next = next.parent) {
566
+ next[isClean$2] = false;
567
+ }
568
+ }
569
+ }
570
+ next() {
571
+ if (!this.parent) return void 0;
572
+ let index2 = this.parent.index(this);
573
+ return this.parent.nodes[index2 + 1];
574
+ }
575
+ positionBy(opts, stringRepresentation) {
576
+ let pos = this.source.start;
577
+ if (opts.index) {
578
+ pos = this.positionInside(opts.index, stringRepresentation);
579
+ } else if (opts.word) {
580
+ stringRepresentation = this.toString();
581
+ let index2 = stringRepresentation.indexOf(opts.word);
582
+ if (index2 !== -1) pos = this.positionInside(index2, stringRepresentation);
583
+ }
584
+ return pos;
585
+ }
586
+ positionInside(index2, stringRepresentation) {
587
+ let string = stringRepresentation || this.toString();
588
+ let column = this.source.start.column;
589
+ let line = this.source.start.line;
590
+ for (let i = 0; i < index2; i++) {
591
+ if (string[i] === "\n") {
592
+ column = 1;
593
+ line += 1;
594
+ } else {
595
+ column += 1;
596
+ }
597
+ }
598
+ return { column, line };
599
+ }
600
+ prev() {
601
+ if (!this.parent) return void 0;
602
+ let index2 = this.parent.index(this);
603
+ return this.parent.nodes[index2 - 1];
604
+ }
605
+ rangeBy(opts) {
606
+ let start = {
607
+ column: this.source.start.column,
608
+ line: this.source.start.line
609
+ };
610
+ let end = this.source.end ? {
611
+ column: this.source.end.column + 1,
612
+ line: this.source.end.line
613
+ } : {
614
+ column: start.column + 1,
615
+ line: start.line
616
+ };
617
+ if (opts.word) {
618
+ let stringRepresentation = this.toString();
619
+ let index2 = stringRepresentation.indexOf(opts.word);
620
+ if (index2 !== -1) {
621
+ start = this.positionInside(index2, stringRepresentation);
622
+ end = this.positionInside(index2 + opts.word.length, stringRepresentation);
623
+ }
624
+ } else {
625
+ if (opts.start) {
626
+ start = {
627
+ column: opts.start.column,
628
+ line: opts.start.line
629
+ };
630
+ } else if (opts.index) {
631
+ start = this.positionInside(opts.index);
632
+ }
633
+ if (opts.end) {
634
+ end = {
635
+ column: opts.end.column,
636
+ line: opts.end.line
637
+ };
638
+ } else if (typeof opts.endIndex === "number") {
639
+ end = this.positionInside(opts.endIndex);
640
+ } else if (opts.index) {
641
+ end = this.positionInside(opts.index + 1);
642
+ }
643
+ }
644
+ if (end.line < start.line || end.line === start.line && end.column <= start.column) {
645
+ end = { column: start.column + 1, line: start.line };
646
+ }
647
+ return { end, start };
648
+ }
649
+ raw(prop, defaultType) {
650
+ let str = new Stringifier2();
651
+ return str.raw(this, prop, defaultType);
652
+ }
653
+ remove() {
654
+ if (this.parent) {
655
+ this.parent.removeChild(this);
656
+ }
657
+ this.parent = void 0;
658
+ return this;
659
+ }
660
+ replaceWith(...nodes) {
661
+ if (this.parent) {
662
+ let bookmark = this;
663
+ let foundSelf = false;
664
+ for (let node2 of nodes) {
665
+ if (node2 === this) {
666
+ foundSelf = true;
667
+ } else if (foundSelf) {
668
+ this.parent.insertAfter(bookmark, node2);
669
+ bookmark = node2;
670
+ } else {
671
+ this.parent.insertBefore(bookmark, node2);
672
+ }
673
+ }
674
+ if (!foundSelf) {
675
+ this.remove();
676
+ }
677
+ }
678
+ return this;
679
+ }
680
+ root() {
681
+ let result2 = this;
682
+ while (result2.parent && result2.parent.type !== "document") {
683
+ result2 = result2.parent;
684
+ }
685
+ return result2;
686
+ }
687
+ toJSON(_, inputs) {
688
+ let fixed = {};
689
+ let emitInputs = inputs == null;
690
+ inputs = inputs || /* @__PURE__ */ new Map();
691
+ let inputsNextIndex = 0;
692
+ for (let name in this) {
693
+ if (!Object.prototype.hasOwnProperty.call(this, name)) {
694
+ continue;
695
+ }
696
+ if (name === "parent" || name === "proxyCache") continue;
697
+ let value = this[name];
698
+ if (Array.isArray(value)) {
699
+ fixed[name] = value.map((i) => {
700
+ if (typeof i === "object" && i.toJSON) {
701
+ return i.toJSON(null, inputs);
702
+ } else {
703
+ return i;
704
+ }
705
+ });
706
+ } else if (typeof value === "object" && value.toJSON) {
707
+ fixed[name] = value.toJSON(null, inputs);
708
+ } else if (name === "source") {
709
+ let inputId = inputs.get(value.input);
710
+ if (inputId == null) {
711
+ inputId = inputsNextIndex;
712
+ inputs.set(value.input, inputsNextIndex);
713
+ inputsNextIndex++;
714
+ }
715
+ fixed[name] = {
716
+ end: value.end,
717
+ inputId,
718
+ start: value.start
719
+ };
720
+ } else {
721
+ fixed[name] = value;
722
+ }
723
+ }
724
+ if (emitInputs) {
725
+ fixed.inputs = [...inputs.keys()].map((input2) => input2.toJSON());
726
+ }
727
+ return fixed;
728
+ }
729
+ toProxy() {
730
+ if (!this.proxyCache) {
731
+ this.proxyCache = new Proxy(this, this.getProxyProcessor());
732
+ }
733
+ return this.proxyCache;
734
+ }
735
+ toString(stringifier2 = stringify$3) {
736
+ if (stringifier2.stringify) stringifier2 = stringifier2.stringify;
737
+ let result2 = "";
738
+ stringifier2(this, (i) => {
739
+ result2 += i;
740
+ });
741
+ return result2;
742
+ }
743
+ warn(result2, text, opts) {
744
+ let data = { node: this };
745
+ for (let i in opts) data[i] = opts[i];
746
+ return result2.warn(text, data);
747
+ }
748
+ get proxyOf() {
749
+ return this;
750
+ }
751
+ };
752
+ var node = Node$4;
753
+ Node$4.default = Node$4;
754
+ let Node$3 = node;
755
+ let Declaration$4 = class Declaration extends Node$3 {
756
+ constructor(defaults) {
757
+ if (defaults && typeof defaults.value !== "undefined" && typeof defaults.value !== "string") {
758
+ defaults = { ...defaults, value: String(defaults.value) };
759
+ }
760
+ super(defaults);
761
+ this.type = "decl";
762
+ }
763
+ get variable() {
764
+ return this.prop.startsWith("--") || this.prop[0] === "$";
765
+ }
766
+ };
767
+ var declaration = Declaration$4;
768
+ Declaration$4.default = Declaration$4;
769
+ let urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
770
+ let customAlphabet = (alphabet, defaultSize = 21) => {
771
+ return (size = defaultSize) => {
772
+ let id = "";
773
+ let i = size;
774
+ while (i--) {
775
+ id += alphabet[Math.random() * alphabet.length | 0];
776
+ }
777
+ return id;
778
+ };
779
+ };
780
+ let nanoid$1 = (size = 21) => {
781
+ let id = "";
782
+ let i = size;
783
+ while (i--) {
784
+ id += urlAlphabet[Math.random() * 64 | 0];
785
+ }
786
+ return id;
787
+ };
788
+ var nonSecure = { nanoid: nanoid$1, customAlphabet };
789
+ let { SourceMapConsumer: SourceMapConsumer$2, SourceMapGenerator: SourceMapGenerator$2 } = require$$2;
790
+ let { existsSync, readFileSync } = require$$2;
791
+ let { dirname: dirname$1, join } = require$$2;
792
+ function fromBase64(str) {
793
+ if (Buffer) {
794
+ return Buffer.from(str, "base64").toString();
795
+ } else {
796
+ return window.atob(str);
797
+ }
798
+ }
799
+ let PreviousMap$2 = class PreviousMap {
800
+ constructor(css, opts) {
801
+ if (opts.map === false) return;
802
+ this.loadAnnotation(css);
803
+ this.inline = this.startWith(this.annotation, "data:");
804
+ let prev = opts.map ? opts.map.prev : void 0;
805
+ let text = this.loadMap(opts.from, prev);
806
+ if (!this.mapFile && opts.from) {
807
+ this.mapFile = opts.from;
808
+ }
809
+ if (this.mapFile) this.root = dirname$1(this.mapFile);
810
+ if (text) this.text = text;
811
+ }
812
+ consumer() {
813
+ if (!this.consumerCache) {
814
+ this.consumerCache = new SourceMapConsumer$2(this.text);
815
+ }
816
+ return this.consumerCache;
817
+ }
818
+ decodeInline(text) {
819
+ let baseCharsetUri = /^data:application\/json;charset=utf-?8;base64,/;
820
+ let baseUri = /^data:application\/json;base64,/;
821
+ let charsetUri = /^data:application\/json;charset=utf-?8,/;
822
+ let uri = /^data:application\/json,/;
823
+ if (charsetUri.test(text) || uri.test(text)) {
824
+ return decodeURIComponent(text.substr(RegExp.lastMatch.length));
825
+ }
826
+ if (baseCharsetUri.test(text) || baseUri.test(text)) {
827
+ return fromBase64(text.substr(RegExp.lastMatch.length));
828
+ }
829
+ let encoding = text.match(/data:application\/json;([^,]+),/)[1];
830
+ throw new Error("Unsupported source map encoding " + encoding);
831
+ }
832
+ getAnnotationURL(sourceMapString) {
833
+ return sourceMapString.replace(/^\/\*\s*# sourceMappingURL=/, "").trim();
834
+ }
835
+ isMap(map) {
836
+ if (typeof map !== "object") return false;
837
+ return typeof map.mappings === "string" || typeof map._mappings === "string" || Array.isArray(map.sections);
838
+ }
839
+ loadAnnotation(css) {
840
+ let comments = css.match(/\/\*\s*# sourceMappingURL=/gm);
841
+ if (!comments) return;
842
+ let start = css.lastIndexOf(comments.pop());
843
+ let end = css.indexOf("*/", start);
844
+ if (start > -1 && end > -1) {
845
+ this.annotation = this.getAnnotationURL(css.substring(start, end));
846
+ }
847
+ }
848
+ loadFile(path) {
849
+ this.root = dirname$1(path);
850
+ if (existsSync(path)) {
851
+ this.mapFile = path;
852
+ return readFileSync(path, "utf-8").toString().trim();
853
+ }
854
+ }
855
+ loadMap(file, prev) {
856
+ if (prev === false) return false;
857
+ if (prev) {
858
+ if (typeof prev === "string") {
859
+ return prev;
860
+ } else if (typeof prev === "function") {
861
+ let prevPath = prev(file);
862
+ if (prevPath) {
863
+ let map = this.loadFile(prevPath);
864
+ if (!map) {
865
+ throw new Error(
866
+ "Unable to load previous source map: " + prevPath.toString()
867
+ );
868
+ }
869
+ return map;
870
+ }
871
+ } else if (prev instanceof SourceMapConsumer$2) {
872
+ return SourceMapGenerator$2.fromSourceMap(prev).toString();
873
+ } else if (prev instanceof SourceMapGenerator$2) {
874
+ return prev.toString();
875
+ } else if (this.isMap(prev)) {
876
+ return JSON.stringify(prev);
877
+ } else {
878
+ throw new Error(
879
+ "Unsupported previous source map format: " + prev.toString()
880
+ );
881
+ }
882
+ } else if (this.inline) {
883
+ return this.decodeInline(this.annotation);
884
+ } else if (this.annotation) {
885
+ let map = this.annotation;
886
+ if (file) map = join(dirname$1(file), map);
887
+ return this.loadFile(map);
888
+ }
889
+ }
890
+ startWith(string, start) {
891
+ if (!string) return false;
892
+ return string.substr(0, start.length) === start;
893
+ }
894
+ withContent() {
895
+ return !!(this.consumer().sourcesContent && this.consumer().sourcesContent.length > 0);
896
+ }
897
+ };
898
+ var previousMap = PreviousMap$2;
899
+ PreviousMap$2.default = PreviousMap$2;
900
+ let { SourceMapConsumer: SourceMapConsumer$1, SourceMapGenerator: SourceMapGenerator$1 } = require$$2;
901
+ let { fileURLToPath, pathToFileURL: pathToFileURL$1 } = require$$2;
902
+ let { isAbsolute, resolve: resolve$1 } = require$$2;
903
+ let { nanoid } = nonSecure;
904
+ let terminalHighlight = require$$2;
905
+ let CssSyntaxError$1 = cssSyntaxError;
906
+ let PreviousMap$1 = previousMap;
907
+ let fromOffsetCache = Symbol("fromOffsetCache");
908
+ let sourceMapAvailable$1 = Boolean(SourceMapConsumer$1 && SourceMapGenerator$1);
909
+ let pathAvailable$1 = Boolean(resolve$1 && isAbsolute);
910
+ let Input$4 = class Input {
911
+ constructor(css, opts = {}) {
912
+ if (css === null || typeof css === "undefined" || typeof css === "object" && !css.toString) {
913
+ throw new Error(`PostCSS received ${css} instead of CSS string`);
914
+ }
915
+ this.css = css.toString();
916
+ if (this.css[0] === "\uFEFF" || this.css[0] === "￾") {
917
+ this.hasBOM = true;
918
+ this.css = this.css.slice(1);
919
+ } else {
920
+ this.hasBOM = false;
921
+ }
922
+ if (opts.from) {
923
+ if (!pathAvailable$1 || /^\w+:\/\//.test(opts.from) || isAbsolute(opts.from)) {
924
+ this.file = opts.from;
925
+ } else {
926
+ this.file = resolve$1(opts.from);
927
+ }
928
+ }
929
+ if (pathAvailable$1 && sourceMapAvailable$1) {
930
+ let map = new PreviousMap$1(this.css, opts);
931
+ if (map.text) {
932
+ this.map = map;
933
+ let file = map.consumer().file;
934
+ if (!this.file && file) this.file = this.mapResolve(file);
935
+ }
936
+ }
937
+ if (!this.file) {
938
+ this.id = "<input css " + nanoid(6) + ">";
939
+ }
940
+ if (this.map) this.map.file = this.from;
941
+ }
942
+ error(message, line, column, opts = {}) {
943
+ let result2, endLine, endColumn;
944
+ if (line && typeof line === "object") {
945
+ let start = line;
946
+ let end = column;
947
+ if (typeof start.offset === "number") {
948
+ let pos = this.fromOffset(start.offset);
949
+ line = pos.line;
950
+ column = pos.col;
951
+ } else {
952
+ line = start.line;
953
+ column = start.column;
954
+ }
955
+ if (typeof end.offset === "number") {
956
+ let pos = this.fromOffset(end.offset);
957
+ endLine = pos.line;
958
+ endColumn = pos.col;
959
+ } else {
960
+ endLine = end.line;
961
+ endColumn = end.column;
962
+ }
963
+ } else if (!column) {
964
+ let pos = this.fromOffset(line);
965
+ line = pos.line;
966
+ column = pos.col;
967
+ }
968
+ let origin = this.origin(line, column, endLine, endColumn);
969
+ if (origin) {
970
+ result2 = new CssSyntaxError$1(
971
+ message,
972
+ origin.endLine === void 0 ? origin.line : { column: origin.column, line: origin.line },
973
+ origin.endLine === void 0 ? origin.column : { column: origin.endColumn, line: origin.endLine },
974
+ origin.source,
975
+ origin.file,
976
+ opts.plugin
977
+ );
978
+ } else {
979
+ result2 = new CssSyntaxError$1(
980
+ message,
981
+ endLine === void 0 ? line : { column, line },
982
+ endLine === void 0 ? column : { column: endColumn, line: endLine },
983
+ this.css,
984
+ this.file,
985
+ opts.plugin
986
+ );
987
+ }
988
+ result2.input = { column, endColumn, endLine, line, source: this.css };
989
+ if (this.file) {
990
+ if (pathToFileURL$1) {
991
+ result2.input.url = pathToFileURL$1(this.file).toString();
992
+ }
993
+ result2.input.file = this.file;
994
+ }
995
+ return result2;
996
+ }
997
+ fromOffset(offset) {
998
+ let lastLine, lineToIndex;
999
+ if (!this[fromOffsetCache]) {
1000
+ let lines = this.css.split("\n");
1001
+ lineToIndex = new Array(lines.length);
1002
+ let prevIndex = 0;
1003
+ for (let i = 0, l = lines.length; i < l; i++) {
1004
+ lineToIndex[i] = prevIndex;
1005
+ prevIndex += lines[i].length + 1;
1006
+ }
1007
+ this[fromOffsetCache] = lineToIndex;
1008
+ } else {
1009
+ lineToIndex = this[fromOffsetCache];
1010
+ }
1011
+ lastLine = lineToIndex[lineToIndex.length - 1];
1012
+ let min = 0;
1013
+ if (offset >= lastLine) {
1014
+ min = lineToIndex.length - 1;
1015
+ } else {
1016
+ let max = lineToIndex.length - 2;
1017
+ let mid;
1018
+ while (min < max) {
1019
+ mid = min + (max - min >> 1);
1020
+ if (offset < lineToIndex[mid]) {
1021
+ max = mid - 1;
1022
+ } else if (offset >= lineToIndex[mid + 1]) {
1023
+ min = mid + 1;
1024
+ } else {
1025
+ min = mid;
1026
+ break;
1027
+ }
1028
+ }
1029
+ }
1030
+ return {
1031
+ col: offset - lineToIndex[min] + 1,
1032
+ line: min + 1
1033
+ };
1034
+ }
1035
+ mapResolve(file) {
1036
+ if (/^\w+:\/\//.test(file)) {
1037
+ return file;
1038
+ }
1039
+ return resolve$1(this.map.consumer().sourceRoot || this.map.root || ".", file);
1040
+ }
1041
+ origin(line, column, endLine, endColumn) {
1042
+ if (!this.map) return false;
1043
+ let consumer = this.map.consumer();
1044
+ let from = consumer.originalPositionFor({ column, line });
1045
+ if (!from.source) return false;
1046
+ let to;
1047
+ if (typeof endLine === "number") {
1048
+ to = consumer.originalPositionFor({ column: endColumn, line: endLine });
1049
+ }
1050
+ let fromUrl;
1051
+ if (isAbsolute(from.source)) {
1052
+ fromUrl = pathToFileURL$1(from.source);
1053
+ } else {
1054
+ fromUrl = new URL(
1055
+ from.source,
1056
+ this.map.consumer().sourceRoot || pathToFileURL$1(this.map.mapFile)
1057
+ );
1058
+ }
1059
+ let result2 = {
1060
+ column: from.column,
1061
+ endColumn: to && to.column,
1062
+ endLine: to && to.line,
1063
+ line: from.line,
1064
+ url: fromUrl.toString()
1065
+ };
1066
+ if (fromUrl.protocol === "file:") {
1067
+ if (fileURLToPath) {
1068
+ result2.file = fileURLToPath(fromUrl);
1069
+ } else {
1070
+ throw new Error(`file: protocol is not available in this PostCSS build`);
1071
+ }
1072
+ }
1073
+ let source = consumer.sourceContentFor(from.source);
1074
+ if (source) result2.source = source;
1075
+ return result2;
1076
+ }
1077
+ toJSON() {
1078
+ let json = {};
1079
+ for (let name of ["hasBOM", "css", "file", "id"]) {
1080
+ if (this[name] != null) {
1081
+ json[name] = this[name];
1082
+ }
1083
+ }
1084
+ if (this.map) {
1085
+ json.map = { ...this.map };
1086
+ if (json.map.consumerCache) {
1087
+ json.map.consumerCache = void 0;
1088
+ }
1089
+ }
1090
+ return json;
1091
+ }
1092
+ get from() {
1093
+ return this.file || this.id;
1094
+ }
1095
+ };
1096
+ var input = Input$4;
1097
+ Input$4.default = Input$4;
1098
+ if (terminalHighlight && terminalHighlight.registerInput) {
1099
+ terminalHighlight.registerInput(Input$4);
1100
+ }
1101
+ let { SourceMapConsumer, SourceMapGenerator } = require$$2;
1102
+ let { dirname, relative, resolve, sep } = require$$2;
1103
+ let { pathToFileURL } = require$$2;
1104
+ let Input$3 = input;
1105
+ let sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator);
1106
+ let pathAvailable = Boolean(dirname && resolve && relative && sep);
1107
+ let MapGenerator$2 = class MapGenerator {
1108
+ constructor(stringify2, root2, opts, cssString) {
1109
+ this.stringify = stringify2;
1110
+ this.mapOpts = opts.map || {};
1111
+ this.root = root2;
1112
+ this.opts = opts;
1113
+ this.css = cssString;
1114
+ this.originalCSS = cssString;
1115
+ this.usesFileUrls = !this.mapOpts.from && this.mapOpts.absolute;
1116
+ this.memoizedFileURLs = /* @__PURE__ */ new Map();
1117
+ this.memoizedPaths = /* @__PURE__ */ new Map();
1118
+ this.memoizedURLs = /* @__PURE__ */ new Map();
1119
+ }
1120
+ addAnnotation() {
1121
+ let content;
1122
+ if (this.isInline()) {
1123
+ content = "data:application/json;base64," + this.toBase64(this.map.toString());
1124
+ } else if (typeof this.mapOpts.annotation === "string") {
1125
+ content = this.mapOpts.annotation;
1126
+ } else if (typeof this.mapOpts.annotation === "function") {
1127
+ content = this.mapOpts.annotation(this.opts.to, this.root);
1128
+ } else {
1129
+ content = this.outputFile() + ".map";
1130
+ }
1131
+ let eol = "\n";
1132
+ if (this.css.includes("\r\n")) eol = "\r\n";
1133
+ this.css += eol + "/*# sourceMappingURL=" + content + " */";
1134
+ }
1135
+ applyPrevMaps() {
1136
+ for (let prev of this.previous()) {
1137
+ let from = this.toUrl(this.path(prev.file));
1138
+ let root2 = prev.root || dirname(prev.file);
1139
+ let map;
1140
+ if (this.mapOpts.sourcesContent === false) {
1141
+ map = new SourceMapConsumer(prev.text);
1142
+ if (map.sourcesContent) {
1143
+ map.sourcesContent = null;
1144
+ }
1145
+ } else {
1146
+ map = prev.consumer();
1147
+ }
1148
+ this.map.applySourceMap(map, from, this.toUrl(this.path(root2)));
1149
+ }
1150
+ }
1151
+ clearAnnotation() {
1152
+ if (this.mapOpts.annotation === false) return;
1153
+ if (this.root) {
1154
+ let node2;
1155
+ for (let i = this.root.nodes.length - 1; i >= 0; i--) {
1156
+ node2 = this.root.nodes[i];
1157
+ if (node2.type !== "comment") continue;
1158
+ if (node2.text.indexOf("# sourceMappingURL=") === 0) {
1159
+ this.root.removeChild(i);
1160
+ }
1161
+ }
1162
+ } else if (this.css) {
1163
+ this.css = this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm, "");
1164
+ }
1165
+ }
1166
+ generate() {
1167
+ this.clearAnnotation();
1168
+ if (pathAvailable && sourceMapAvailable && this.isMap()) {
1169
+ return this.generateMap();
1170
+ } else {
1171
+ let result2 = "";
1172
+ this.stringify(this.root, (i) => {
1173
+ result2 += i;
1174
+ });
1175
+ return [result2];
1176
+ }
1177
+ }
1178
+ generateMap() {
1179
+ if (this.root) {
1180
+ this.generateString();
1181
+ } else if (this.previous().length === 1) {
1182
+ let prev = this.previous()[0].consumer();
1183
+ prev.file = this.outputFile();
1184
+ this.map = SourceMapGenerator.fromSourceMap(prev, {
1185
+ ignoreInvalidMapping: true
1186
+ });
1187
+ } else {
1188
+ this.map = new SourceMapGenerator({
1189
+ file: this.outputFile(),
1190
+ ignoreInvalidMapping: true
1191
+ });
1192
+ this.map.addMapping({
1193
+ generated: { column: 0, line: 1 },
1194
+ original: { column: 0, line: 1 },
1195
+ source: this.opts.from ? this.toUrl(this.path(this.opts.from)) : "<no source>"
1196
+ });
1197
+ }
1198
+ if (this.isSourcesContent()) this.setSourcesContent();
1199
+ if (this.root && this.previous().length > 0) this.applyPrevMaps();
1200
+ if (this.isAnnotation()) this.addAnnotation();
1201
+ if (this.isInline()) {
1202
+ return [this.css];
1203
+ } else {
1204
+ return [this.css, this.map];
1205
+ }
1206
+ }
1207
+ generateString() {
1208
+ this.css = "";
1209
+ this.map = new SourceMapGenerator({
1210
+ file: this.outputFile(),
1211
+ ignoreInvalidMapping: true
1212
+ });
1213
+ let line = 1;
1214
+ let column = 1;
1215
+ let noSource = "<no source>";
1216
+ let mapping = {
1217
+ generated: { column: 0, line: 0 },
1218
+ original: { column: 0, line: 0 },
1219
+ source: ""
1220
+ };
1221
+ let lines, last;
1222
+ this.stringify(this.root, (str, node2, type) => {
1223
+ this.css += str;
1224
+ if (node2 && type !== "end") {
1225
+ mapping.generated.line = line;
1226
+ mapping.generated.column = column - 1;
1227
+ if (node2.source && node2.source.start) {
1228
+ mapping.source = this.sourcePath(node2);
1229
+ mapping.original.line = node2.source.start.line;
1230
+ mapping.original.column = node2.source.start.column - 1;
1231
+ this.map.addMapping(mapping);
1232
+ } else {
1233
+ mapping.source = noSource;
1234
+ mapping.original.line = 1;
1235
+ mapping.original.column = 0;
1236
+ this.map.addMapping(mapping);
1237
+ }
1238
+ }
1239
+ lines = str.match(/\n/g);
1240
+ if (lines) {
1241
+ line += lines.length;
1242
+ last = str.lastIndexOf("\n");
1243
+ column = str.length - last;
1244
+ } else {
1245
+ column += str.length;
1246
+ }
1247
+ if (node2 && type !== "start") {
1248
+ let p = node2.parent || { raws: {} };
1249
+ let childless = node2.type === "decl" || node2.type === "atrule" && !node2.nodes;
1250
+ if (!childless || node2 !== p.last || p.raws.semicolon) {
1251
+ if (node2.source && node2.source.end) {
1252
+ mapping.source = this.sourcePath(node2);
1253
+ mapping.original.line = node2.source.end.line;
1254
+ mapping.original.column = node2.source.end.column - 1;
1255
+ mapping.generated.line = line;
1256
+ mapping.generated.column = column - 2;
1257
+ this.map.addMapping(mapping);
1258
+ } else {
1259
+ mapping.source = noSource;
1260
+ mapping.original.line = 1;
1261
+ mapping.original.column = 0;
1262
+ mapping.generated.line = line;
1263
+ mapping.generated.column = column - 1;
1264
+ this.map.addMapping(mapping);
1265
+ }
1266
+ }
1267
+ }
1268
+ });
1269
+ }
1270
+ isAnnotation() {
1271
+ if (this.isInline()) {
1272
+ return true;
1273
+ }
1274
+ if (typeof this.mapOpts.annotation !== "undefined") {
1275
+ return this.mapOpts.annotation;
1276
+ }
1277
+ if (this.previous().length) {
1278
+ return this.previous().some((i) => i.annotation);
1279
+ }
1280
+ return true;
1281
+ }
1282
+ isInline() {
1283
+ if (typeof this.mapOpts.inline !== "undefined") {
1284
+ return this.mapOpts.inline;
1285
+ }
1286
+ let annotation = this.mapOpts.annotation;
1287
+ if (typeof annotation !== "undefined" && annotation !== true) {
1288
+ return false;
1289
+ }
1290
+ if (this.previous().length) {
1291
+ return this.previous().some((i) => i.inline);
1292
+ }
1293
+ return true;
1294
+ }
1295
+ isMap() {
1296
+ if (typeof this.opts.map !== "undefined") {
1297
+ return !!this.opts.map;
1298
+ }
1299
+ return this.previous().length > 0;
1300
+ }
1301
+ isSourcesContent() {
1302
+ if (typeof this.mapOpts.sourcesContent !== "undefined") {
1303
+ return this.mapOpts.sourcesContent;
1304
+ }
1305
+ if (this.previous().length) {
1306
+ return this.previous().some((i) => i.withContent());
1307
+ }
1308
+ return true;
1309
+ }
1310
+ outputFile() {
1311
+ if (this.opts.to) {
1312
+ return this.path(this.opts.to);
1313
+ } else if (this.opts.from) {
1314
+ return this.path(this.opts.from);
1315
+ } else {
1316
+ return "to.css";
1317
+ }
1318
+ }
1319
+ path(file) {
1320
+ if (this.mapOpts.absolute) return file;
1321
+ if (file.charCodeAt(0) === 60) return file;
1322
+ if (/^\w+:\/\//.test(file)) return file;
1323
+ let cached = this.memoizedPaths.get(file);
1324
+ if (cached) return cached;
1325
+ let from = this.opts.to ? dirname(this.opts.to) : ".";
1326
+ if (typeof this.mapOpts.annotation === "string") {
1327
+ from = dirname(resolve(from, this.mapOpts.annotation));
1328
+ }
1329
+ let path = relative(from, file);
1330
+ this.memoizedPaths.set(file, path);
1331
+ return path;
1332
+ }
1333
+ previous() {
1334
+ if (!this.previousMaps) {
1335
+ this.previousMaps = [];
1336
+ if (this.root) {
1337
+ this.root.walk((node2) => {
1338
+ if (node2.source && node2.source.input.map) {
1339
+ let map = node2.source.input.map;
1340
+ if (!this.previousMaps.includes(map)) {
1341
+ this.previousMaps.push(map);
1342
+ }
1343
+ }
1344
+ });
1345
+ } else {
1346
+ let input2 = new Input$3(this.originalCSS, this.opts);
1347
+ if (input2.map) this.previousMaps.push(input2.map);
1348
+ }
1349
+ }
1350
+ return this.previousMaps;
1351
+ }
1352
+ setSourcesContent() {
1353
+ let already = {};
1354
+ if (this.root) {
1355
+ this.root.walk((node2) => {
1356
+ if (node2.source) {
1357
+ let from = node2.source.input.from;
1358
+ if (from && !already[from]) {
1359
+ already[from] = true;
1360
+ let fromUrl = this.usesFileUrls ? this.toFileUrl(from) : this.toUrl(this.path(from));
1361
+ this.map.setSourceContent(fromUrl, node2.source.input.css);
1362
+ }
1363
+ }
1364
+ });
1365
+ } else if (this.css) {
1366
+ let from = this.opts.from ? this.toUrl(this.path(this.opts.from)) : "<no source>";
1367
+ this.map.setSourceContent(from, this.css);
1368
+ }
1369
+ }
1370
+ sourcePath(node2) {
1371
+ if (this.mapOpts.from) {
1372
+ return this.toUrl(this.mapOpts.from);
1373
+ } else if (this.usesFileUrls) {
1374
+ return this.toFileUrl(node2.source.input.from);
1375
+ } else {
1376
+ return this.toUrl(this.path(node2.source.input.from));
1377
+ }
1378
+ }
1379
+ toBase64(str) {
1380
+ if (Buffer) {
1381
+ return Buffer.from(str).toString("base64");
1382
+ } else {
1383
+ return window.btoa(unescape(encodeURIComponent(str)));
1384
+ }
1385
+ }
1386
+ toFileUrl(path) {
1387
+ let cached = this.memoizedFileURLs.get(path);
1388
+ if (cached) return cached;
1389
+ if (pathToFileURL) {
1390
+ let fileURL = pathToFileURL(path).toString();
1391
+ this.memoizedFileURLs.set(path, fileURL);
1392
+ return fileURL;
1393
+ } else {
1394
+ throw new Error(
1395
+ "`map.absolute` option is not available in this PostCSS build"
1396
+ );
1397
+ }
1398
+ }
1399
+ toUrl(path) {
1400
+ let cached = this.memoizedURLs.get(path);
1401
+ if (cached) return cached;
1402
+ if (sep === "\\") {
1403
+ path = path.replace(/\\/g, "/");
1404
+ }
1405
+ let url = encodeURI(path).replace(/[#?]/g, encodeURIComponent);
1406
+ this.memoizedURLs.set(path, url);
1407
+ return url;
1408
+ }
1409
+ };
1410
+ var mapGenerator = MapGenerator$2;
1411
+ let Node$2 = node;
1412
+ let Comment$4 = class Comment extends Node$2 {
1413
+ constructor(defaults) {
1414
+ super(defaults);
1415
+ this.type = "comment";
1416
+ }
1417
+ };
1418
+ var comment = Comment$4;
1419
+ Comment$4.default = Comment$4;
1420
+ let { isClean: isClean$1, my: my$1 } = symbols;
1421
+ let Declaration$3 = declaration;
1422
+ let Comment$3 = comment;
1423
+ let Node$1 = node;
1424
+ let parse$4, Rule$4, AtRule$4, Root$6;
1425
+ function cleanSource(nodes) {
1426
+ return nodes.map((i) => {
1427
+ if (i.nodes) i.nodes = cleanSource(i.nodes);
1428
+ delete i.source;
1429
+ return i;
1430
+ });
1431
+ }
1432
+ function markDirtyUp(node2) {
1433
+ node2[isClean$1] = false;
1434
+ if (node2.proxyOf.nodes) {
1435
+ for (let i of node2.proxyOf.nodes) {
1436
+ markDirtyUp(i);
1437
+ }
1438
+ }
1439
+ }
1440
+ let Container$7 = class Container extends Node$1 {
1441
+ append(...children) {
1442
+ for (let child of children) {
1443
+ let nodes = this.normalize(child, this.last);
1444
+ for (let node2 of nodes) this.proxyOf.nodes.push(node2);
1445
+ }
1446
+ this.markDirty();
1447
+ return this;
1448
+ }
1449
+ cleanRaws(keepBetween) {
1450
+ super.cleanRaws(keepBetween);
1451
+ if (this.nodes) {
1452
+ for (let node2 of this.nodes) node2.cleanRaws(keepBetween);
1453
+ }
1454
+ }
1455
+ each(callback) {
1456
+ if (!this.proxyOf.nodes) return void 0;
1457
+ let iterator = this.getIterator();
1458
+ let index2, result2;
1459
+ while (this.indexes[iterator] < this.proxyOf.nodes.length) {
1460
+ index2 = this.indexes[iterator];
1461
+ result2 = callback(this.proxyOf.nodes[index2], index2);
1462
+ if (result2 === false) break;
1463
+ this.indexes[iterator] += 1;
1464
+ }
1465
+ delete this.indexes[iterator];
1466
+ return result2;
1467
+ }
1468
+ every(condition) {
1469
+ return this.nodes.every(condition);
1470
+ }
1471
+ getIterator() {
1472
+ if (!this.lastEach) this.lastEach = 0;
1473
+ if (!this.indexes) this.indexes = {};
1474
+ this.lastEach += 1;
1475
+ let iterator = this.lastEach;
1476
+ this.indexes[iterator] = 0;
1477
+ return iterator;
1478
+ }
1479
+ getProxyProcessor() {
1480
+ return {
1481
+ get(node2, prop) {
1482
+ if (prop === "proxyOf") {
1483
+ return node2;
1484
+ } else if (!node2[prop]) {
1485
+ return node2[prop];
1486
+ } else if (prop === "each" || typeof prop === "string" && prop.startsWith("walk")) {
1487
+ return (...args) => {
1488
+ return node2[prop](
1489
+ ...args.map((i) => {
1490
+ if (typeof i === "function") {
1491
+ return (child, index2) => i(child.toProxy(), index2);
1492
+ } else {
1493
+ return i;
1494
+ }
1495
+ })
1496
+ );
1497
+ };
1498
+ } else if (prop === "every" || prop === "some") {
1499
+ return (cb) => {
1500
+ return node2[prop](
1501
+ (child, ...other) => cb(child.toProxy(), ...other)
1502
+ );
1503
+ };
1504
+ } else if (prop === "root") {
1505
+ return () => node2.root().toProxy();
1506
+ } else if (prop === "nodes") {
1507
+ return node2.nodes.map((i) => i.toProxy());
1508
+ } else if (prop === "first" || prop === "last") {
1509
+ return node2[prop].toProxy();
1510
+ } else {
1511
+ return node2[prop];
1512
+ }
1513
+ },
1514
+ set(node2, prop, value) {
1515
+ if (node2[prop] === value) return true;
1516
+ node2[prop] = value;
1517
+ if (prop === "name" || prop === "params" || prop === "selector") {
1518
+ node2.markDirty();
1519
+ }
1520
+ return true;
1521
+ }
1522
+ };
1523
+ }
1524
+ index(child) {
1525
+ if (typeof child === "number") return child;
1526
+ if (child.proxyOf) child = child.proxyOf;
1527
+ return this.proxyOf.nodes.indexOf(child);
1528
+ }
1529
+ insertAfter(exist, add) {
1530
+ let existIndex = this.index(exist);
1531
+ let nodes = this.normalize(add, this.proxyOf.nodes[existIndex]).reverse();
1532
+ existIndex = this.index(exist);
1533
+ for (let node2 of nodes) this.proxyOf.nodes.splice(existIndex + 1, 0, node2);
1534
+ let index2;
1535
+ for (let id in this.indexes) {
1536
+ index2 = this.indexes[id];
1537
+ if (existIndex < index2) {
1538
+ this.indexes[id] = index2 + nodes.length;
1539
+ }
1540
+ }
1541
+ this.markDirty();
1542
+ return this;
1543
+ }
1544
+ insertBefore(exist, add) {
1545
+ let existIndex = this.index(exist);
1546
+ let type = existIndex === 0 ? "prepend" : false;
1547
+ let nodes = this.normalize(add, this.proxyOf.nodes[existIndex], type).reverse();
1548
+ existIndex = this.index(exist);
1549
+ for (let node2 of nodes) this.proxyOf.nodes.splice(existIndex, 0, node2);
1550
+ let index2;
1551
+ for (let id in this.indexes) {
1552
+ index2 = this.indexes[id];
1553
+ if (existIndex <= index2) {
1554
+ this.indexes[id] = index2 + nodes.length;
1555
+ }
1556
+ }
1557
+ this.markDirty();
1558
+ return this;
1559
+ }
1560
+ normalize(nodes, sample) {
1561
+ if (typeof nodes === "string") {
1562
+ nodes = cleanSource(parse$4(nodes).nodes);
1563
+ } else if (typeof nodes === "undefined") {
1564
+ nodes = [];
1565
+ } else if (Array.isArray(nodes)) {
1566
+ nodes = nodes.slice(0);
1567
+ for (let i of nodes) {
1568
+ if (i.parent) i.parent.removeChild(i, "ignore");
1569
+ }
1570
+ } else if (nodes.type === "root" && this.type !== "document") {
1571
+ nodes = nodes.nodes.slice(0);
1572
+ for (let i of nodes) {
1573
+ if (i.parent) i.parent.removeChild(i, "ignore");
1574
+ }
1575
+ } else if (nodes.type) {
1576
+ nodes = [nodes];
1577
+ } else if (nodes.prop) {
1578
+ if (typeof nodes.value === "undefined") {
1579
+ throw new Error("Value field is missed in node creation");
1580
+ } else if (typeof nodes.value !== "string") {
1581
+ nodes.value = String(nodes.value);
1582
+ }
1583
+ nodes = [new Declaration$3(nodes)];
1584
+ } else if (nodes.selector) {
1585
+ nodes = [new Rule$4(nodes)];
1586
+ } else if (nodes.name) {
1587
+ nodes = [new AtRule$4(nodes)];
1588
+ } else if (nodes.text) {
1589
+ nodes = [new Comment$3(nodes)];
1590
+ } else {
1591
+ throw new Error("Unknown node type in node creation");
1592
+ }
1593
+ let processed = nodes.map((i) => {
1594
+ if (!i[my$1]) Container.rebuild(i);
1595
+ i = i.proxyOf;
1596
+ if (i.parent) i.parent.removeChild(i);
1597
+ if (i[isClean$1]) markDirtyUp(i);
1598
+ if (typeof i.raws.before === "undefined") {
1599
+ if (sample && typeof sample.raws.before !== "undefined") {
1600
+ i.raws.before = sample.raws.before.replace(/\S/g, "");
1601
+ }
1602
+ }
1603
+ i.parent = this.proxyOf;
1604
+ return i;
1605
+ });
1606
+ return processed;
1607
+ }
1608
+ prepend(...children) {
1609
+ children = children.reverse();
1610
+ for (let child of children) {
1611
+ let nodes = this.normalize(child, this.first, "prepend").reverse();
1612
+ for (let node2 of nodes) this.proxyOf.nodes.unshift(node2);
1613
+ for (let id in this.indexes) {
1614
+ this.indexes[id] = this.indexes[id] + nodes.length;
1615
+ }
1616
+ }
1617
+ this.markDirty();
1618
+ return this;
1619
+ }
1620
+ push(child) {
1621
+ child.parent = this;
1622
+ this.proxyOf.nodes.push(child);
1623
+ return this;
1624
+ }
1625
+ removeAll() {
1626
+ for (let node2 of this.proxyOf.nodes) node2.parent = void 0;
1627
+ this.proxyOf.nodes = [];
1628
+ this.markDirty();
1629
+ return this;
1630
+ }
1631
+ removeChild(child) {
1632
+ child = this.index(child);
1633
+ this.proxyOf.nodes[child].parent = void 0;
1634
+ this.proxyOf.nodes.splice(child, 1);
1635
+ let index2;
1636
+ for (let id in this.indexes) {
1637
+ index2 = this.indexes[id];
1638
+ if (index2 >= child) {
1639
+ this.indexes[id] = index2 - 1;
1640
+ }
1641
+ }
1642
+ this.markDirty();
1643
+ return this;
1644
+ }
1645
+ replaceValues(pattern, opts, callback) {
1646
+ if (!callback) {
1647
+ callback = opts;
1648
+ opts = {};
1649
+ }
1650
+ this.walkDecls((decl) => {
1651
+ if (opts.props && !opts.props.includes(decl.prop)) return;
1652
+ if (opts.fast && !decl.value.includes(opts.fast)) return;
1653
+ decl.value = decl.value.replace(pattern, callback);
1654
+ });
1655
+ this.markDirty();
1656
+ return this;
1657
+ }
1658
+ some(condition) {
1659
+ return this.nodes.some(condition);
1660
+ }
1661
+ walk(callback) {
1662
+ return this.each((child, i) => {
1663
+ let result2;
1664
+ try {
1665
+ result2 = callback(child, i);
1666
+ } catch (e) {
1667
+ throw child.addToError(e);
1668
+ }
1669
+ if (result2 !== false && child.walk) {
1670
+ result2 = child.walk(callback);
1671
+ }
1672
+ return result2;
1673
+ });
1674
+ }
1675
+ walkAtRules(name, callback) {
1676
+ if (!callback) {
1677
+ callback = name;
1678
+ return this.walk((child, i) => {
1679
+ if (child.type === "atrule") {
1680
+ return callback(child, i);
1681
+ }
1682
+ });
1683
+ }
1684
+ if (name instanceof RegExp) {
1685
+ return this.walk((child, i) => {
1686
+ if (child.type === "atrule" && name.test(child.name)) {
1687
+ return callback(child, i);
1688
+ }
1689
+ });
1690
+ }
1691
+ return this.walk((child, i) => {
1692
+ if (child.type === "atrule" && child.name === name) {
1693
+ return callback(child, i);
1694
+ }
1695
+ });
1696
+ }
1697
+ walkComments(callback) {
1698
+ return this.walk((child, i) => {
1699
+ if (child.type === "comment") {
1700
+ return callback(child, i);
1701
+ }
1702
+ });
1703
+ }
1704
+ walkDecls(prop, callback) {
1705
+ if (!callback) {
1706
+ callback = prop;
1707
+ return this.walk((child, i) => {
1708
+ if (child.type === "decl") {
1709
+ return callback(child, i);
1710
+ }
1711
+ });
1712
+ }
1713
+ if (prop instanceof RegExp) {
1714
+ return this.walk((child, i) => {
1715
+ if (child.type === "decl" && prop.test(child.prop)) {
1716
+ return callback(child, i);
1717
+ }
1718
+ });
1719
+ }
1720
+ return this.walk((child, i) => {
1721
+ if (child.type === "decl" && child.prop === prop) {
1722
+ return callback(child, i);
1723
+ }
1724
+ });
1725
+ }
1726
+ walkRules(selector, callback) {
1727
+ if (!callback) {
1728
+ callback = selector;
1729
+ return this.walk((child, i) => {
1730
+ if (child.type === "rule") {
1731
+ return callback(child, i);
1732
+ }
1733
+ });
1734
+ }
1735
+ if (selector instanceof RegExp) {
1736
+ return this.walk((child, i) => {
1737
+ if (child.type === "rule" && selector.test(child.selector)) {
1738
+ return callback(child, i);
1739
+ }
1740
+ });
1741
+ }
1742
+ return this.walk((child, i) => {
1743
+ if (child.type === "rule" && child.selector === selector) {
1744
+ return callback(child, i);
1745
+ }
1746
+ });
1747
+ }
1748
+ get first() {
1749
+ if (!this.proxyOf.nodes) return void 0;
1750
+ return this.proxyOf.nodes[0];
1751
+ }
1752
+ get last() {
1753
+ if (!this.proxyOf.nodes) return void 0;
1754
+ return this.proxyOf.nodes[this.proxyOf.nodes.length - 1];
1755
+ }
1756
+ };
1757
+ Container$7.registerParse = (dependant) => {
1758
+ parse$4 = dependant;
1759
+ };
1760
+ Container$7.registerRule = (dependant) => {
1761
+ Rule$4 = dependant;
1762
+ };
1763
+ Container$7.registerAtRule = (dependant) => {
1764
+ AtRule$4 = dependant;
1765
+ };
1766
+ Container$7.registerRoot = (dependant) => {
1767
+ Root$6 = dependant;
1768
+ };
1769
+ var container = Container$7;
1770
+ Container$7.default = Container$7;
1771
+ Container$7.rebuild = (node2) => {
1772
+ if (node2.type === "atrule") {
1773
+ Object.setPrototypeOf(node2, AtRule$4.prototype);
1774
+ } else if (node2.type === "rule") {
1775
+ Object.setPrototypeOf(node2, Rule$4.prototype);
1776
+ } else if (node2.type === "decl") {
1777
+ Object.setPrototypeOf(node2, Declaration$3.prototype);
1778
+ } else if (node2.type === "comment") {
1779
+ Object.setPrototypeOf(node2, Comment$3.prototype);
1780
+ } else if (node2.type === "root") {
1781
+ Object.setPrototypeOf(node2, Root$6.prototype);
1782
+ }
1783
+ node2[my$1] = true;
1784
+ if (node2.nodes) {
1785
+ node2.nodes.forEach((child) => {
1786
+ Container$7.rebuild(child);
1787
+ });
1788
+ }
1789
+ };
1790
+ let Container$6 = container;
1791
+ let LazyResult$4, Processor$3;
1792
+ let Document$3 = class Document2 extends Container$6 {
1793
+ constructor(defaults) {
1794
+ super({ type: "document", ...defaults });
1795
+ if (!this.nodes) {
1796
+ this.nodes = [];
1797
+ }
1798
+ }
1799
+ toResult(opts = {}) {
1800
+ let lazy = new LazyResult$4(new Processor$3(), this, opts);
1801
+ return lazy.stringify();
1802
+ }
1803
+ };
1804
+ Document$3.registerLazyResult = (dependant) => {
1805
+ LazyResult$4 = dependant;
1806
+ };
1807
+ Document$3.registerProcessor = (dependant) => {
1808
+ Processor$3 = dependant;
1809
+ };
1810
+ var document$1 = Document$3;
1811
+ Document$3.default = Document$3;
1812
+ let printed = {};
1813
+ var warnOnce$2 = function warnOnce(message) {
1814
+ if (printed[message]) return;
1815
+ printed[message] = true;
1816
+ if (typeof console !== "undefined" && console.warn) {
1817
+ console.warn(message);
1818
+ }
1819
+ };
1820
+ let Warning$2 = class Warning {
1821
+ constructor(text, opts = {}) {
1822
+ this.type = "warning";
1823
+ this.text = text;
1824
+ if (opts.node && opts.node.source) {
1825
+ let range = opts.node.rangeBy(opts);
1826
+ this.line = range.start.line;
1827
+ this.column = range.start.column;
1828
+ this.endLine = range.end.line;
1829
+ this.endColumn = range.end.column;
1830
+ }
1831
+ for (let opt in opts) this[opt] = opts[opt];
1832
+ }
1833
+ toString() {
1834
+ if (this.node) {
1835
+ return this.node.error(this.text, {
1836
+ index: this.index,
1837
+ plugin: this.plugin,
1838
+ word: this.word
1839
+ }).message;
1840
+ }
1841
+ if (this.plugin) {
1842
+ return this.plugin + ": " + this.text;
1843
+ }
1844
+ return this.text;
1845
+ }
1846
+ };
1847
+ var warning = Warning$2;
1848
+ Warning$2.default = Warning$2;
1849
+ let Warning$1 = warning;
1850
+ let Result$3 = class Result {
1851
+ constructor(processor2, root2, opts) {
1852
+ this.processor = processor2;
1853
+ this.messages = [];
1854
+ this.root = root2;
1855
+ this.opts = opts;
1856
+ this.css = void 0;
1857
+ this.map = void 0;
1858
+ }
1859
+ toString() {
1860
+ return this.css;
1861
+ }
1862
+ warn(text, opts = {}) {
1863
+ if (!opts.plugin) {
1864
+ if (this.lastPlugin && this.lastPlugin.postcssPlugin) {
1865
+ opts.plugin = this.lastPlugin.postcssPlugin;
1866
+ }
1867
+ }
1868
+ let warning2 = new Warning$1(text, opts);
1869
+ this.messages.push(warning2);
1870
+ return warning2;
1871
+ }
1872
+ warnings() {
1873
+ return this.messages.filter((i) => i.type === "warning");
1874
+ }
1875
+ get content() {
1876
+ return this.css;
1877
+ }
1878
+ };
1879
+ var result = Result$3;
1880
+ Result$3.default = Result$3;
1881
+ const SINGLE_QUOTE = "'".charCodeAt(0);
1882
+ const DOUBLE_QUOTE = '"'.charCodeAt(0);
1883
+ const BACKSLASH = "\\".charCodeAt(0);
1884
+ const SLASH = "/".charCodeAt(0);
1885
+ const NEWLINE = "\n".charCodeAt(0);
1886
+ const SPACE = " ".charCodeAt(0);
1887
+ const FEED = "\f".charCodeAt(0);
1888
+ const TAB = " ".charCodeAt(0);
1889
+ const CR = "\r".charCodeAt(0);
1890
+ const OPEN_SQUARE = "[".charCodeAt(0);
1891
+ const CLOSE_SQUARE = "]".charCodeAt(0);
1892
+ const OPEN_PARENTHESES = "(".charCodeAt(0);
1893
+ const CLOSE_PARENTHESES = ")".charCodeAt(0);
1894
+ const OPEN_CURLY = "{".charCodeAt(0);
1895
+ const CLOSE_CURLY = "}".charCodeAt(0);
1896
+ const SEMICOLON = ";".charCodeAt(0);
1897
+ const ASTERISK = "*".charCodeAt(0);
1898
+ const COLON = ":".charCodeAt(0);
1899
+ const AT = "@".charCodeAt(0);
1900
+ const RE_AT_END = /[\t\n\f\r "#'()/;[\\\]{}]/g;
1901
+ const RE_WORD_END = /[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g;
1902
+ const RE_BAD_BRACKET = /.[\r\n"'(/\\]/;
1903
+ const RE_HEX_ESCAPE = /[\da-f]/i;
1904
+ var tokenize = function tokenizer(input2, options = {}) {
1905
+ let css = input2.css.valueOf();
1906
+ let ignore = options.ignoreErrors;
1907
+ let code, next, quote, content, escape;
1908
+ let escaped, escapePos, prev, n, currentToken;
1909
+ let length = css.length;
1910
+ let pos = 0;
1911
+ let buffer = [];
1912
+ let returned = [];
1913
+ function position() {
1914
+ return pos;
1915
+ }
1916
+ function unclosed(what) {
1917
+ throw input2.error("Unclosed " + what, pos);
1918
+ }
1919
+ function endOfFile() {
1920
+ return returned.length === 0 && pos >= length;
1921
+ }
1922
+ function nextToken(opts) {
1923
+ if (returned.length) return returned.pop();
1924
+ if (pos >= length) return;
1925
+ let ignoreUnclosed = opts ? opts.ignoreUnclosed : false;
1926
+ code = css.charCodeAt(pos);
1927
+ switch (code) {
1928
+ case NEWLINE:
1929
+ case SPACE:
1930
+ case TAB:
1931
+ case CR:
1932
+ case FEED: {
1933
+ next = pos;
1934
+ do {
1935
+ next += 1;
1936
+ code = css.charCodeAt(next);
1937
+ } while (code === SPACE || code === NEWLINE || code === TAB || code === CR || code === FEED);
1938
+ currentToken = ["space", css.slice(pos, next)];
1939
+ pos = next - 1;
1940
+ break;
1941
+ }
1942
+ case OPEN_SQUARE:
1943
+ case CLOSE_SQUARE:
1944
+ case OPEN_CURLY:
1945
+ case CLOSE_CURLY:
1946
+ case COLON:
1947
+ case SEMICOLON:
1948
+ case CLOSE_PARENTHESES: {
1949
+ let controlChar = String.fromCharCode(code);
1950
+ currentToken = [controlChar, controlChar, pos];
1951
+ break;
1952
+ }
1953
+ case OPEN_PARENTHESES: {
1954
+ prev = buffer.length ? buffer.pop()[1] : "";
1955
+ n = css.charCodeAt(pos + 1);
1956
+ if (prev === "url" && n !== SINGLE_QUOTE && n !== DOUBLE_QUOTE && n !== SPACE && n !== NEWLINE && n !== TAB && n !== FEED && n !== CR) {
1957
+ next = pos;
1958
+ do {
1959
+ escaped = false;
1960
+ next = css.indexOf(")", next + 1);
1961
+ if (next === -1) {
1962
+ if (ignore || ignoreUnclosed) {
1963
+ next = pos;
1964
+ break;
1965
+ } else {
1966
+ unclosed("bracket");
1967
+ }
1968
+ }
1969
+ escapePos = next;
1970
+ while (css.charCodeAt(escapePos - 1) === BACKSLASH) {
1971
+ escapePos -= 1;
1972
+ escaped = !escaped;
1973
+ }
1974
+ } while (escaped);
1975
+ currentToken = ["brackets", css.slice(pos, next + 1), pos, next];
1976
+ pos = next;
1977
+ } else {
1978
+ next = css.indexOf(")", pos + 1);
1979
+ content = css.slice(pos, next + 1);
1980
+ if (next === -1 || RE_BAD_BRACKET.test(content)) {
1981
+ currentToken = ["(", "(", pos];
1982
+ } else {
1983
+ currentToken = ["brackets", content, pos, next];
1984
+ pos = next;
1985
+ }
1986
+ }
1987
+ break;
1988
+ }
1989
+ case SINGLE_QUOTE:
1990
+ case DOUBLE_QUOTE: {
1991
+ quote = code === SINGLE_QUOTE ? "'" : '"';
1992
+ next = pos;
1993
+ do {
1994
+ escaped = false;
1995
+ next = css.indexOf(quote, next + 1);
1996
+ if (next === -1) {
1997
+ if (ignore || ignoreUnclosed) {
1998
+ next = pos + 1;
1999
+ break;
2000
+ } else {
2001
+ unclosed("string");
2002
+ }
2003
+ }
2004
+ escapePos = next;
2005
+ while (css.charCodeAt(escapePos - 1) === BACKSLASH) {
2006
+ escapePos -= 1;
2007
+ escaped = !escaped;
2008
+ }
2009
+ } while (escaped);
2010
+ currentToken = ["string", css.slice(pos, next + 1), pos, next];
2011
+ pos = next;
2012
+ break;
2013
+ }
2014
+ case AT: {
2015
+ RE_AT_END.lastIndex = pos + 1;
2016
+ RE_AT_END.test(css);
2017
+ if (RE_AT_END.lastIndex === 0) {
2018
+ next = css.length - 1;
2019
+ } else {
2020
+ next = RE_AT_END.lastIndex - 2;
2021
+ }
2022
+ currentToken = ["at-word", css.slice(pos, next + 1), pos, next];
2023
+ pos = next;
2024
+ break;
2025
+ }
2026
+ case BACKSLASH: {
2027
+ next = pos;
2028
+ escape = true;
2029
+ while (css.charCodeAt(next + 1) === BACKSLASH) {
2030
+ next += 1;
2031
+ escape = !escape;
2032
+ }
2033
+ code = css.charCodeAt(next + 1);
2034
+ if (escape && code !== SLASH && code !== SPACE && code !== NEWLINE && code !== TAB && code !== CR && code !== FEED) {
2035
+ next += 1;
2036
+ if (RE_HEX_ESCAPE.test(css.charAt(next))) {
2037
+ while (RE_HEX_ESCAPE.test(css.charAt(next + 1))) {
2038
+ next += 1;
2039
+ }
2040
+ if (css.charCodeAt(next + 1) === SPACE) {
2041
+ next += 1;
2042
+ }
2043
+ }
2044
+ }
2045
+ currentToken = ["word", css.slice(pos, next + 1), pos, next];
2046
+ pos = next;
2047
+ break;
2048
+ }
2049
+ default: {
2050
+ if (code === SLASH && css.charCodeAt(pos + 1) === ASTERISK) {
2051
+ next = css.indexOf("*/", pos + 2) + 1;
2052
+ if (next === 0) {
2053
+ if (ignore || ignoreUnclosed) {
2054
+ next = css.length;
2055
+ } else {
2056
+ unclosed("comment");
2057
+ }
2058
+ }
2059
+ currentToken = ["comment", css.slice(pos, next + 1), pos, next];
2060
+ pos = next;
2061
+ } else {
2062
+ RE_WORD_END.lastIndex = pos + 1;
2063
+ RE_WORD_END.test(css);
2064
+ if (RE_WORD_END.lastIndex === 0) {
2065
+ next = css.length - 1;
2066
+ } else {
2067
+ next = RE_WORD_END.lastIndex - 2;
2068
+ }
2069
+ currentToken = ["word", css.slice(pos, next + 1), pos, next];
2070
+ buffer.push(currentToken);
2071
+ pos = next;
2072
+ }
2073
+ break;
2074
+ }
2075
+ }
2076
+ pos++;
2077
+ return currentToken;
2078
+ }
2079
+ function back(token) {
2080
+ returned.push(token);
2081
+ }
2082
+ return {
2083
+ back,
2084
+ endOfFile,
2085
+ nextToken,
2086
+ position
2087
+ };
2088
+ };
2089
+ let Container$5 = container;
2090
+ let AtRule$3 = class AtRule extends Container$5 {
2091
+ constructor(defaults) {
2092
+ super(defaults);
2093
+ this.type = "atrule";
2094
+ }
2095
+ append(...children) {
2096
+ if (!this.proxyOf.nodes) this.nodes = [];
2097
+ return super.append(...children);
2098
+ }
2099
+ prepend(...children) {
2100
+ if (!this.proxyOf.nodes) this.nodes = [];
2101
+ return super.prepend(...children);
2102
+ }
2103
+ };
2104
+ var atRule = AtRule$3;
2105
+ AtRule$3.default = AtRule$3;
2106
+ Container$5.registerAtRule(AtRule$3);
2107
+ let Container$4 = container;
2108
+ let LazyResult$3, Processor$2;
2109
+ let Root$5 = class Root extends Container$4 {
2110
+ constructor(defaults) {
2111
+ super(defaults);
2112
+ this.type = "root";
2113
+ if (!this.nodes) this.nodes = [];
2114
+ }
2115
+ normalize(child, sample, type) {
2116
+ let nodes = super.normalize(child);
2117
+ if (sample) {
2118
+ if (type === "prepend") {
2119
+ if (this.nodes.length > 1) {
2120
+ sample.raws.before = this.nodes[1].raws.before;
2121
+ } else {
2122
+ delete sample.raws.before;
2123
+ }
2124
+ } else if (this.first !== sample) {
2125
+ for (let node2 of nodes) {
2126
+ node2.raws.before = sample.raws.before;
2127
+ }
2128
+ }
2129
+ }
2130
+ return nodes;
2131
+ }
2132
+ removeChild(child, ignore) {
2133
+ let index2 = this.index(child);
2134
+ if (!ignore && index2 === 0 && this.nodes.length > 1) {
2135
+ this.nodes[1].raws.before = this.nodes[index2].raws.before;
2136
+ }
2137
+ return super.removeChild(child);
2138
+ }
2139
+ toResult(opts = {}) {
2140
+ let lazy = new LazyResult$3(new Processor$2(), this, opts);
2141
+ return lazy.stringify();
2142
+ }
2143
+ };
2144
+ Root$5.registerLazyResult = (dependant) => {
2145
+ LazyResult$3 = dependant;
2146
+ };
2147
+ Root$5.registerProcessor = (dependant) => {
2148
+ Processor$2 = dependant;
2149
+ };
2150
+ var root = Root$5;
2151
+ Root$5.default = Root$5;
2152
+ Container$4.registerRoot(Root$5);
2153
+ let list$2 = {
2154
+ comma(string) {
2155
+ return list$2.split(string, [","], true);
2156
+ },
2157
+ space(string) {
2158
+ let spaces = [" ", "\n", " "];
2159
+ return list$2.split(string, spaces);
2160
+ },
2161
+ split(string, separators, last) {
2162
+ let array = [];
2163
+ let current = "";
2164
+ let split = false;
2165
+ let func = 0;
2166
+ let inQuote = false;
2167
+ let prevQuote = "";
2168
+ let escape = false;
2169
+ for (let letter of string) {
2170
+ if (escape) {
2171
+ escape = false;
2172
+ } else if (letter === "\\") {
2173
+ escape = true;
2174
+ } else if (inQuote) {
2175
+ if (letter === prevQuote) {
2176
+ inQuote = false;
2177
+ }
2178
+ } else if (letter === '"' || letter === "'") {
2179
+ inQuote = true;
2180
+ prevQuote = letter;
2181
+ } else if (letter === "(") {
2182
+ func += 1;
2183
+ } else if (letter === ")") {
2184
+ if (func > 0) func -= 1;
2185
+ } else if (func === 0) {
2186
+ if (separators.includes(letter)) split = true;
2187
+ }
2188
+ if (split) {
2189
+ if (current !== "") array.push(current.trim());
2190
+ current = "";
2191
+ split = false;
2192
+ } else {
2193
+ current += letter;
2194
+ }
2195
+ }
2196
+ if (last || current !== "") array.push(current.trim());
2197
+ return array;
2198
+ }
2199
+ };
2200
+ var list_1 = list$2;
2201
+ list$2.default = list$2;
2202
+ let Container$3 = container;
2203
+ let list$1 = list_1;
2204
+ let Rule$3 = class Rule extends Container$3 {
2205
+ constructor(defaults) {
2206
+ super(defaults);
2207
+ this.type = "rule";
2208
+ if (!this.nodes) this.nodes = [];
2209
+ }
2210
+ get selectors() {
2211
+ return list$1.comma(this.selector);
2212
+ }
2213
+ set selectors(values) {
2214
+ let match = this.selector ? this.selector.match(/,\s*/) : null;
2215
+ let sep2 = match ? match[0] : "," + this.raw("between", "beforeOpen");
2216
+ this.selector = values.join(sep2);
2217
+ }
2218
+ };
2219
+ var rule = Rule$3;
2220
+ Rule$3.default = Rule$3;
2221
+ Container$3.registerRule(Rule$3);
2222
+ let Declaration$2 = declaration;
2223
+ let tokenizer2 = tokenize;
2224
+ let Comment$2 = comment;
2225
+ let AtRule$2 = atRule;
2226
+ let Root$4 = root;
2227
+ let Rule$2 = rule;
2228
+ const SAFE_COMMENT_NEIGHBOR = {
2229
+ empty: true,
2230
+ space: true
2231
+ };
2232
+ function findLastWithPosition(tokens) {
2233
+ for (let i = tokens.length - 1; i >= 0; i--) {
2234
+ let token = tokens[i];
2235
+ let pos = token[3] || token[2];
2236
+ if (pos) return pos;
2237
+ }
2238
+ }
2239
+ let Parser$1 = class Parser {
2240
+ constructor(input2) {
2241
+ this.input = input2;
2242
+ this.root = new Root$4();
2243
+ this.current = this.root;
2244
+ this.spaces = "";
2245
+ this.semicolon = false;
2246
+ this.createTokenizer();
2247
+ this.root.source = { input: input2, start: { column: 1, line: 1, offset: 0 } };
2248
+ }
2249
+ atrule(token) {
2250
+ let node2 = new AtRule$2();
2251
+ node2.name = token[1].slice(1);
2252
+ if (node2.name === "") {
2253
+ this.unnamedAtrule(node2, token);
2254
+ }
2255
+ this.init(node2, token[2]);
2256
+ let type;
2257
+ let prev;
2258
+ let shift;
2259
+ let last = false;
2260
+ let open = false;
2261
+ let params = [];
2262
+ let brackets = [];
2263
+ while (!this.tokenizer.endOfFile()) {
2264
+ token = this.tokenizer.nextToken();
2265
+ type = token[0];
2266
+ if (type === "(" || type === "[") {
2267
+ brackets.push(type === "(" ? ")" : "]");
2268
+ } else if (type === "{" && brackets.length > 0) {
2269
+ brackets.push("}");
2270
+ } else if (type === brackets[brackets.length - 1]) {
2271
+ brackets.pop();
2272
+ }
2273
+ if (brackets.length === 0) {
2274
+ if (type === ";") {
2275
+ node2.source.end = this.getPosition(token[2]);
2276
+ node2.source.end.offset++;
2277
+ this.semicolon = true;
2278
+ break;
2279
+ } else if (type === "{") {
2280
+ open = true;
2281
+ break;
2282
+ } else if (type === "}") {
2283
+ if (params.length > 0) {
2284
+ shift = params.length - 1;
2285
+ prev = params[shift];
2286
+ while (prev && prev[0] === "space") {
2287
+ prev = params[--shift];
2288
+ }
2289
+ if (prev) {
2290
+ node2.source.end = this.getPosition(prev[3] || prev[2]);
2291
+ node2.source.end.offset++;
2292
+ }
2293
+ }
2294
+ this.end(token);
2295
+ break;
2296
+ } else {
2297
+ params.push(token);
2298
+ }
2299
+ } else {
2300
+ params.push(token);
2301
+ }
2302
+ if (this.tokenizer.endOfFile()) {
2303
+ last = true;
2304
+ break;
2305
+ }
2306
+ }
2307
+ node2.raws.between = this.spacesAndCommentsFromEnd(params);
2308
+ if (params.length) {
2309
+ node2.raws.afterName = this.spacesAndCommentsFromStart(params);
2310
+ this.raw(node2, "params", params);
2311
+ if (last) {
2312
+ token = params[params.length - 1];
2313
+ node2.source.end = this.getPosition(token[3] || token[2]);
2314
+ node2.source.end.offset++;
2315
+ this.spaces = node2.raws.between;
2316
+ node2.raws.between = "";
2317
+ }
2318
+ } else {
2319
+ node2.raws.afterName = "";
2320
+ node2.params = "";
2321
+ }
2322
+ if (open) {
2323
+ node2.nodes = [];
2324
+ this.current = node2;
2325
+ }
2326
+ }
2327
+ checkMissedSemicolon(tokens) {
2328
+ let colon = this.colon(tokens);
2329
+ if (colon === false) return;
2330
+ let founded = 0;
2331
+ let token;
2332
+ for (let j = colon - 1; j >= 0; j--) {
2333
+ token = tokens[j];
2334
+ if (token[0] !== "space") {
2335
+ founded += 1;
2336
+ if (founded === 2) break;
2337
+ }
2338
+ }
2339
+ throw this.input.error(
2340
+ "Missed semicolon",
2341
+ token[0] === "word" ? token[3] + 1 : token[2]
2342
+ );
2343
+ }
2344
+ colon(tokens) {
2345
+ let brackets = 0;
2346
+ let token, type, prev;
2347
+ for (let [i, element] of tokens.entries()) {
2348
+ token = element;
2349
+ type = token[0];
2350
+ if (type === "(") {
2351
+ brackets += 1;
2352
+ }
2353
+ if (type === ")") {
2354
+ brackets -= 1;
2355
+ }
2356
+ if (brackets === 0 && type === ":") {
2357
+ if (!prev) {
2358
+ this.doubleColon(token);
2359
+ } else if (prev[0] === "word" && prev[1] === "progid") {
2360
+ continue;
2361
+ } else {
2362
+ return i;
2363
+ }
2364
+ }
2365
+ prev = token;
2366
+ }
2367
+ return false;
2368
+ }
2369
+ comment(token) {
2370
+ let node2 = new Comment$2();
2371
+ this.init(node2, token[2]);
2372
+ node2.source.end = this.getPosition(token[3] || token[2]);
2373
+ node2.source.end.offset++;
2374
+ let text = token[1].slice(2, -2);
2375
+ if (/^\s*$/.test(text)) {
2376
+ node2.text = "";
2377
+ node2.raws.left = text;
2378
+ node2.raws.right = "";
2379
+ } else {
2380
+ let match = text.match(/^(\s*)([^]*\S)(\s*)$/);
2381
+ node2.text = match[2];
2382
+ node2.raws.left = match[1];
2383
+ node2.raws.right = match[3];
2384
+ }
2385
+ }
2386
+ createTokenizer() {
2387
+ this.tokenizer = tokenizer2(this.input);
2388
+ }
2389
+ decl(tokens, customProperty) {
2390
+ let node2 = new Declaration$2();
2391
+ this.init(node2, tokens[0][2]);
2392
+ let last = tokens[tokens.length - 1];
2393
+ if (last[0] === ";") {
2394
+ this.semicolon = true;
2395
+ tokens.pop();
2396
+ }
2397
+ node2.source.end = this.getPosition(
2398
+ last[3] || last[2] || findLastWithPosition(tokens)
2399
+ );
2400
+ node2.source.end.offset++;
2401
+ while (tokens[0][0] !== "word") {
2402
+ if (tokens.length === 1) this.unknownWord(tokens);
2403
+ node2.raws.before += tokens.shift()[1];
2404
+ }
2405
+ node2.source.start = this.getPosition(tokens[0][2]);
2406
+ node2.prop = "";
2407
+ while (tokens.length) {
2408
+ let type = tokens[0][0];
2409
+ if (type === ":" || type === "space" || type === "comment") {
2410
+ break;
2411
+ }
2412
+ node2.prop += tokens.shift()[1];
2413
+ }
2414
+ node2.raws.between = "";
2415
+ let token;
2416
+ while (tokens.length) {
2417
+ token = tokens.shift();
2418
+ if (token[0] === ":") {
2419
+ node2.raws.between += token[1];
2420
+ break;
2421
+ } else {
2422
+ if (token[0] === "word" && /\w/.test(token[1])) {
2423
+ this.unknownWord([token]);
2424
+ }
2425
+ node2.raws.between += token[1];
2426
+ }
2427
+ }
2428
+ if (node2.prop[0] === "_" || node2.prop[0] === "*") {
2429
+ node2.raws.before += node2.prop[0];
2430
+ node2.prop = node2.prop.slice(1);
2431
+ }
2432
+ let firstSpaces = [];
2433
+ let next;
2434
+ while (tokens.length) {
2435
+ next = tokens[0][0];
2436
+ if (next !== "space" && next !== "comment") break;
2437
+ firstSpaces.push(tokens.shift());
2438
+ }
2439
+ this.precheckMissedSemicolon(tokens);
2440
+ for (let i = tokens.length - 1; i >= 0; i--) {
2441
+ token = tokens[i];
2442
+ if (token[1].toLowerCase() === "!important") {
2443
+ node2.important = true;
2444
+ let string = this.stringFrom(tokens, i);
2445
+ string = this.spacesFromEnd(tokens) + string;
2446
+ if (string !== " !important") node2.raws.important = string;
2447
+ break;
2448
+ } else if (token[1].toLowerCase() === "important") {
2449
+ let cache = tokens.slice(0);
2450
+ let str = "";
2451
+ for (let j = i; j > 0; j--) {
2452
+ let type = cache[j][0];
2453
+ if (str.trim().indexOf("!") === 0 && type !== "space") {
2454
+ break;
2455
+ }
2456
+ str = cache.pop()[1] + str;
2457
+ }
2458
+ if (str.trim().indexOf("!") === 0) {
2459
+ node2.important = true;
2460
+ node2.raws.important = str;
2461
+ tokens = cache;
2462
+ }
2463
+ }
2464
+ if (token[0] !== "space" && token[0] !== "comment") {
2465
+ break;
2466
+ }
2467
+ }
2468
+ let hasWord = tokens.some((i) => i[0] !== "space" && i[0] !== "comment");
2469
+ if (hasWord) {
2470
+ node2.raws.between += firstSpaces.map((i) => i[1]).join("");
2471
+ firstSpaces = [];
2472
+ }
2473
+ this.raw(node2, "value", firstSpaces.concat(tokens), customProperty);
2474
+ if (node2.value.includes(":") && !customProperty) {
2475
+ this.checkMissedSemicolon(tokens);
2476
+ }
2477
+ }
2478
+ doubleColon(token) {
2479
+ throw this.input.error(
2480
+ "Double colon",
2481
+ { offset: token[2] },
2482
+ { offset: token[2] + token[1].length }
2483
+ );
2484
+ }
2485
+ emptyRule(token) {
2486
+ let node2 = new Rule$2();
2487
+ this.init(node2, token[2]);
2488
+ node2.selector = "";
2489
+ node2.raws.between = "";
2490
+ this.current = node2;
2491
+ }
2492
+ end(token) {
2493
+ if (this.current.nodes && this.current.nodes.length) {
2494
+ this.current.raws.semicolon = this.semicolon;
2495
+ }
2496
+ this.semicolon = false;
2497
+ this.current.raws.after = (this.current.raws.after || "") + this.spaces;
2498
+ this.spaces = "";
2499
+ if (this.current.parent) {
2500
+ this.current.source.end = this.getPosition(token[2]);
2501
+ this.current.source.end.offset++;
2502
+ this.current = this.current.parent;
2503
+ } else {
2504
+ this.unexpectedClose(token);
2505
+ }
2506
+ }
2507
+ endFile() {
2508
+ if (this.current.parent) this.unclosedBlock();
2509
+ if (this.current.nodes && this.current.nodes.length) {
2510
+ this.current.raws.semicolon = this.semicolon;
2511
+ }
2512
+ this.current.raws.after = (this.current.raws.after || "") + this.spaces;
2513
+ this.root.source.end = this.getPosition(this.tokenizer.position());
2514
+ }
2515
+ freeSemicolon(token) {
2516
+ this.spaces += token[1];
2517
+ if (this.current.nodes) {
2518
+ let prev = this.current.nodes[this.current.nodes.length - 1];
2519
+ if (prev && prev.type === "rule" && !prev.raws.ownSemicolon) {
2520
+ prev.raws.ownSemicolon = this.spaces;
2521
+ this.spaces = "";
2522
+ }
2523
+ }
2524
+ }
2525
+ // Helpers
2526
+ getPosition(offset) {
2527
+ let pos = this.input.fromOffset(offset);
2528
+ return {
2529
+ column: pos.col,
2530
+ line: pos.line,
2531
+ offset
2532
+ };
2533
+ }
2534
+ init(node2, offset) {
2535
+ this.current.push(node2);
2536
+ node2.source = {
2537
+ input: this.input,
2538
+ start: this.getPosition(offset)
2539
+ };
2540
+ node2.raws.before = this.spaces;
2541
+ this.spaces = "";
2542
+ if (node2.type !== "comment") this.semicolon = false;
2543
+ }
2544
+ other(start) {
2545
+ let end = false;
2546
+ let type = null;
2547
+ let colon = false;
2548
+ let bracket = null;
2549
+ let brackets = [];
2550
+ let customProperty = start[1].startsWith("--");
2551
+ let tokens = [];
2552
+ let token = start;
2553
+ while (token) {
2554
+ type = token[0];
2555
+ tokens.push(token);
2556
+ if (type === "(" || type === "[") {
2557
+ if (!bracket) bracket = token;
2558
+ brackets.push(type === "(" ? ")" : "]");
2559
+ } else if (customProperty && colon && type === "{") {
2560
+ if (!bracket) bracket = token;
2561
+ brackets.push("}");
2562
+ } else if (brackets.length === 0) {
2563
+ if (type === ";") {
2564
+ if (colon) {
2565
+ this.decl(tokens, customProperty);
2566
+ return;
2567
+ } else {
2568
+ break;
2569
+ }
2570
+ } else if (type === "{") {
2571
+ this.rule(tokens);
2572
+ return;
2573
+ } else if (type === "}") {
2574
+ this.tokenizer.back(tokens.pop());
2575
+ end = true;
2576
+ break;
2577
+ } else if (type === ":") {
2578
+ colon = true;
2579
+ }
2580
+ } else if (type === brackets[brackets.length - 1]) {
2581
+ brackets.pop();
2582
+ if (brackets.length === 0) bracket = null;
2583
+ }
2584
+ token = this.tokenizer.nextToken();
2585
+ }
2586
+ if (this.tokenizer.endOfFile()) end = true;
2587
+ if (brackets.length > 0) this.unclosedBracket(bracket);
2588
+ if (end && colon) {
2589
+ if (!customProperty) {
2590
+ while (tokens.length) {
2591
+ token = tokens[tokens.length - 1][0];
2592
+ if (token !== "space" && token !== "comment") break;
2593
+ this.tokenizer.back(tokens.pop());
2594
+ }
2595
+ }
2596
+ this.decl(tokens, customProperty);
2597
+ } else {
2598
+ this.unknownWord(tokens);
2599
+ }
2600
+ }
2601
+ parse() {
2602
+ let token;
2603
+ while (!this.tokenizer.endOfFile()) {
2604
+ token = this.tokenizer.nextToken();
2605
+ switch (token[0]) {
2606
+ case "space":
2607
+ this.spaces += token[1];
2608
+ break;
2609
+ case ";":
2610
+ this.freeSemicolon(token);
2611
+ break;
2612
+ case "}":
2613
+ this.end(token);
2614
+ break;
2615
+ case "comment":
2616
+ this.comment(token);
2617
+ break;
2618
+ case "at-word":
2619
+ this.atrule(token);
2620
+ break;
2621
+ case "{":
2622
+ this.emptyRule(token);
2623
+ break;
2624
+ default:
2625
+ this.other(token);
2626
+ break;
2627
+ }
2628
+ }
2629
+ this.endFile();
2630
+ }
2631
+ precheckMissedSemicolon() {
2632
+ }
2633
+ raw(node2, prop, tokens, customProperty) {
2634
+ let token, type;
2635
+ let length = tokens.length;
2636
+ let value = "";
2637
+ let clean = true;
2638
+ let next, prev;
2639
+ for (let i = 0; i < length; i += 1) {
2640
+ token = tokens[i];
2641
+ type = token[0];
2642
+ if (type === "space" && i === length - 1 && !customProperty) {
2643
+ clean = false;
2644
+ } else if (type === "comment") {
2645
+ prev = tokens[i - 1] ? tokens[i - 1][0] : "empty";
2646
+ next = tokens[i + 1] ? tokens[i + 1][0] : "empty";
2647
+ if (!SAFE_COMMENT_NEIGHBOR[prev] && !SAFE_COMMENT_NEIGHBOR[next]) {
2648
+ if (value.slice(-1) === ",") {
2649
+ clean = false;
2650
+ } else {
2651
+ value += token[1];
2652
+ }
2653
+ } else {
2654
+ clean = false;
2655
+ }
2656
+ } else {
2657
+ value += token[1];
2658
+ }
2659
+ }
2660
+ if (!clean) {
2661
+ let raw = tokens.reduce((all, i) => all + i[1], "");
2662
+ node2.raws[prop] = { raw, value };
2663
+ }
2664
+ node2[prop] = value;
2665
+ }
2666
+ rule(tokens) {
2667
+ tokens.pop();
2668
+ let node2 = new Rule$2();
2669
+ this.init(node2, tokens[0][2]);
2670
+ node2.raws.between = this.spacesAndCommentsFromEnd(tokens);
2671
+ this.raw(node2, "selector", tokens);
2672
+ this.current = node2;
2673
+ }
2674
+ spacesAndCommentsFromEnd(tokens) {
2675
+ let lastTokenType;
2676
+ let spaces = "";
2677
+ while (tokens.length) {
2678
+ lastTokenType = tokens[tokens.length - 1][0];
2679
+ if (lastTokenType !== "space" && lastTokenType !== "comment") break;
2680
+ spaces = tokens.pop()[1] + spaces;
2681
+ }
2682
+ return spaces;
2683
+ }
2684
+ // Errors
2685
+ spacesAndCommentsFromStart(tokens) {
2686
+ let next;
2687
+ let spaces = "";
2688
+ while (tokens.length) {
2689
+ next = tokens[0][0];
2690
+ if (next !== "space" && next !== "comment") break;
2691
+ spaces += tokens.shift()[1];
2692
+ }
2693
+ return spaces;
2694
+ }
2695
+ spacesFromEnd(tokens) {
2696
+ let lastTokenType;
2697
+ let spaces = "";
2698
+ while (tokens.length) {
2699
+ lastTokenType = tokens[tokens.length - 1][0];
2700
+ if (lastTokenType !== "space") break;
2701
+ spaces = tokens.pop()[1] + spaces;
2702
+ }
2703
+ return spaces;
2704
+ }
2705
+ stringFrom(tokens, from) {
2706
+ let result2 = "";
2707
+ for (let i = from; i < tokens.length; i++) {
2708
+ result2 += tokens[i][1];
2709
+ }
2710
+ tokens.splice(from, tokens.length - from);
2711
+ return result2;
2712
+ }
2713
+ unclosedBlock() {
2714
+ let pos = this.current.source.start;
2715
+ throw this.input.error("Unclosed block", pos.line, pos.column);
2716
+ }
2717
+ unclosedBracket(bracket) {
2718
+ throw this.input.error(
2719
+ "Unclosed bracket",
2720
+ { offset: bracket[2] },
2721
+ { offset: bracket[2] + 1 }
2722
+ );
2723
+ }
2724
+ unexpectedClose(token) {
2725
+ throw this.input.error(
2726
+ "Unexpected }",
2727
+ { offset: token[2] },
2728
+ { offset: token[2] + 1 }
2729
+ );
2730
+ }
2731
+ unknownWord(tokens) {
2732
+ throw this.input.error(
2733
+ "Unknown word",
2734
+ { offset: tokens[0][2] },
2735
+ { offset: tokens[0][2] + tokens[0][1].length }
2736
+ );
2737
+ }
2738
+ unnamedAtrule(node2, token) {
2739
+ throw this.input.error(
2740
+ "At-rule without name",
2741
+ { offset: token[2] },
2742
+ { offset: token[2] + token[1].length }
2743
+ );
2744
+ }
2745
+ };
2746
+ var parser = Parser$1;
2747
+ let Container$2 = container;
2748
+ let Parser2 = parser;
2749
+ let Input$2 = input;
2750
+ function parse$3(css, opts) {
2751
+ let input2 = new Input$2(css, opts);
2752
+ let parser2 = new Parser2(input2);
2753
+ try {
2754
+ parser2.parse();
2755
+ } catch (e) {
2756
+ if (process.env.NODE_ENV !== "production") {
2757
+ if (e.name === "CssSyntaxError" && opts && opts.from) {
2758
+ if (/\.scss$/i.test(opts.from)) {
2759
+ e.message += "\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser";
2760
+ } else if (/\.sass/i.test(opts.from)) {
2761
+ e.message += "\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser";
2762
+ } else if (/\.less$/i.test(opts.from)) {
2763
+ e.message += "\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser";
2764
+ }
2765
+ }
2766
+ }
2767
+ throw e;
2768
+ }
2769
+ return parser2.root;
2770
+ }
2771
+ var parse_1 = parse$3;
2772
+ parse$3.default = parse$3;
2773
+ Container$2.registerParse(parse$3);
2774
+ let { isClean, my } = symbols;
2775
+ let MapGenerator$1 = mapGenerator;
2776
+ let stringify$2 = stringify_1;
2777
+ let Container$1 = container;
2778
+ let Document$2 = document$1;
2779
+ let warnOnce$1 = warnOnce$2;
2780
+ let Result$2 = result;
2781
+ let parse$2 = parse_1;
2782
+ let Root$3 = root;
2783
+ const TYPE_TO_CLASS_NAME = {
2784
+ atrule: "AtRule",
2785
+ comment: "Comment",
2786
+ decl: "Declaration",
2787
+ document: "Document",
2788
+ root: "Root",
2789
+ rule: "Rule"
2790
+ };
2791
+ const PLUGIN_PROPS = {
2792
+ AtRule: true,
2793
+ AtRuleExit: true,
2794
+ Comment: true,
2795
+ CommentExit: true,
2796
+ Declaration: true,
2797
+ DeclarationExit: true,
2798
+ Document: true,
2799
+ DocumentExit: true,
2800
+ Once: true,
2801
+ OnceExit: true,
2802
+ postcssPlugin: true,
2803
+ prepare: true,
2804
+ Root: true,
2805
+ RootExit: true,
2806
+ Rule: true,
2807
+ RuleExit: true
2808
+ };
2809
+ const NOT_VISITORS = {
2810
+ Once: true,
2811
+ postcssPlugin: true,
2812
+ prepare: true
2813
+ };
2814
+ const CHILDREN = 0;
2815
+ function isPromise(obj) {
2816
+ return typeof obj === "object" && typeof obj.then === "function";
2817
+ }
2818
+ function getEvents(node2) {
2819
+ let key = false;
2820
+ let type = TYPE_TO_CLASS_NAME[node2.type];
2821
+ if (node2.type === "decl") {
2822
+ key = node2.prop.toLowerCase();
2823
+ } else if (node2.type === "atrule") {
2824
+ key = node2.name.toLowerCase();
2825
+ }
2826
+ if (key && node2.append) {
2827
+ return [
2828
+ type,
2829
+ type + "-" + key,
2830
+ CHILDREN,
2831
+ type + "Exit",
2832
+ type + "Exit-" + key
2833
+ ];
2834
+ } else if (key) {
2835
+ return [type, type + "-" + key, type + "Exit", type + "Exit-" + key];
2836
+ } else if (node2.append) {
2837
+ return [type, CHILDREN, type + "Exit"];
2838
+ } else {
2839
+ return [type, type + "Exit"];
2840
+ }
2841
+ }
2842
+ function toStack(node2) {
2843
+ let events;
2844
+ if (node2.type === "document") {
2845
+ events = ["Document", CHILDREN, "DocumentExit"];
2846
+ } else if (node2.type === "root") {
2847
+ events = ["Root", CHILDREN, "RootExit"];
2848
+ } else {
2849
+ events = getEvents(node2);
2850
+ }
2851
+ return {
2852
+ eventIndex: 0,
2853
+ events,
2854
+ iterator: 0,
2855
+ node: node2,
2856
+ visitorIndex: 0,
2857
+ visitors: []
2858
+ };
2859
+ }
2860
+ function cleanMarks(node2) {
2861
+ node2[isClean] = false;
2862
+ if (node2.nodes) node2.nodes.forEach((i) => cleanMarks(i));
2863
+ return node2;
2864
+ }
2865
+ let postcss$2 = {};
2866
+ let LazyResult$2 = class LazyResult {
2867
+ constructor(processor2, css, opts) {
2868
+ this.stringified = false;
2869
+ this.processed = false;
2870
+ let root2;
2871
+ if (typeof css === "object" && css !== null && (css.type === "root" || css.type === "document")) {
2872
+ root2 = cleanMarks(css);
2873
+ } else if (css instanceof LazyResult || css instanceof Result$2) {
2874
+ root2 = cleanMarks(css.root);
2875
+ if (css.map) {
2876
+ if (typeof opts.map === "undefined") opts.map = {};
2877
+ if (!opts.map.inline) opts.map.inline = false;
2878
+ opts.map.prev = css.map;
2879
+ }
2880
+ } else {
2881
+ let parser2 = parse$2;
2882
+ if (opts.syntax) parser2 = opts.syntax.parse;
2883
+ if (opts.parser) parser2 = opts.parser;
2884
+ if (parser2.parse) parser2 = parser2.parse;
2885
+ try {
2886
+ root2 = parser2(css, opts);
2887
+ } catch (error) {
2888
+ this.processed = true;
2889
+ this.error = error;
2890
+ }
2891
+ if (root2 && !root2[my]) {
2892
+ Container$1.rebuild(root2);
2893
+ }
2894
+ }
2895
+ this.result = new Result$2(processor2, root2, opts);
2896
+ this.helpers = { ...postcss$2, postcss: postcss$2, result: this.result };
2897
+ this.plugins = this.processor.plugins.map((plugin2) => {
2898
+ if (typeof plugin2 === "object" && plugin2.prepare) {
2899
+ return { ...plugin2, ...plugin2.prepare(this.result) };
2900
+ } else {
2901
+ return plugin2;
2902
+ }
2903
+ });
2904
+ }
2905
+ async() {
2906
+ if (this.error) return Promise.reject(this.error);
2907
+ if (this.processed) return Promise.resolve(this.result);
2908
+ if (!this.processing) {
2909
+ this.processing = this.runAsync();
2910
+ }
2911
+ return this.processing;
2912
+ }
2913
+ catch(onRejected) {
2914
+ return this.async().catch(onRejected);
2915
+ }
2916
+ finally(onFinally) {
2917
+ return this.async().then(onFinally, onFinally);
2918
+ }
2919
+ getAsyncError() {
2920
+ throw new Error("Use process(css).then(cb) to work with async plugins");
2921
+ }
2922
+ handleError(error, node2) {
2923
+ let plugin2 = this.result.lastPlugin;
2924
+ try {
2925
+ if (node2) node2.addToError(error);
2926
+ this.error = error;
2927
+ if (error.name === "CssSyntaxError" && !error.plugin) {
2928
+ error.plugin = plugin2.postcssPlugin;
2929
+ error.setMessage();
2930
+ } else if (plugin2.postcssVersion) {
2931
+ if (process.env.NODE_ENV !== "production") {
2932
+ let pluginName = plugin2.postcssPlugin;
2933
+ let pluginVer = plugin2.postcssVersion;
2934
+ let runtimeVer = this.result.processor.version;
2935
+ let a = pluginVer.split(".");
2936
+ let b = runtimeVer.split(".");
2937
+ if (a[0] !== b[0] || parseInt(a[1]) > parseInt(b[1])) {
2938
+ console.error(
2939
+ "Unknown error from PostCSS plugin. Your current PostCSS version is " + runtimeVer + ", but " + pluginName + " uses " + pluginVer + ". Perhaps this is the source of the error below."
2940
+ );
2941
+ }
2942
+ }
2943
+ }
2944
+ } catch (err) {
2945
+ if (console && console.error) console.error(err);
2946
+ }
2947
+ return error;
2948
+ }
2949
+ prepareVisitors() {
2950
+ this.listeners = {};
2951
+ let add = (plugin2, type, cb) => {
2952
+ if (!this.listeners[type]) this.listeners[type] = [];
2953
+ this.listeners[type].push([plugin2, cb]);
2954
+ };
2955
+ for (let plugin2 of this.plugins) {
2956
+ if (typeof plugin2 === "object") {
2957
+ for (let event in plugin2) {
2958
+ if (!PLUGIN_PROPS[event] && /^[A-Z]/.test(event)) {
2959
+ throw new Error(
2960
+ `Unknown event ${event} in ${plugin2.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`
2961
+ );
2962
+ }
2963
+ if (!NOT_VISITORS[event]) {
2964
+ if (typeof plugin2[event] === "object") {
2965
+ for (let filter in plugin2[event]) {
2966
+ if (filter === "*") {
2967
+ add(plugin2, event, plugin2[event][filter]);
2968
+ } else {
2969
+ add(
2970
+ plugin2,
2971
+ event + "-" + filter.toLowerCase(),
2972
+ plugin2[event][filter]
2973
+ );
2974
+ }
2975
+ }
2976
+ } else if (typeof plugin2[event] === "function") {
2977
+ add(plugin2, event, plugin2[event]);
2978
+ }
2979
+ }
2980
+ }
2981
+ }
2982
+ }
2983
+ this.hasListener = Object.keys(this.listeners).length > 0;
2984
+ }
2985
+ async runAsync() {
2986
+ this.plugin = 0;
2987
+ for (let i = 0; i < this.plugins.length; i++) {
2988
+ let plugin2 = this.plugins[i];
2989
+ let promise = this.runOnRoot(plugin2);
2990
+ if (isPromise(promise)) {
2991
+ try {
2992
+ await promise;
2993
+ } catch (error) {
2994
+ throw this.handleError(error);
2995
+ }
2996
+ }
2997
+ }
2998
+ this.prepareVisitors();
2999
+ if (this.hasListener) {
3000
+ let root2 = this.result.root;
3001
+ while (!root2[isClean]) {
3002
+ root2[isClean] = true;
3003
+ let stack = [toStack(root2)];
3004
+ while (stack.length > 0) {
3005
+ let promise = this.visitTick(stack);
3006
+ if (isPromise(promise)) {
3007
+ try {
3008
+ await promise;
3009
+ } catch (e) {
3010
+ let node2 = stack[stack.length - 1].node;
3011
+ throw this.handleError(e, node2);
3012
+ }
3013
+ }
3014
+ }
3015
+ }
3016
+ if (this.listeners.OnceExit) {
3017
+ for (let [plugin2, visitor] of this.listeners.OnceExit) {
3018
+ this.result.lastPlugin = plugin2;
3019
+ try {
3020
+ if (root2.type === "document") {
3021
+ let roots = root2.nodes.map(
3022
+ (subRoot) => visitor(subRoot, this.helpers)
3023
+ );
3024
+ await Promise.all(roots);
3025
+ } else {
3026
+ await visitor(root2, this.helpers);
3027
+ }
3028
+ } catch (e) {
3029
+ throw this.handleError(e);
3030
+ }
3031
+ }
3032
+ }
3033
+ }
3034
+ this.processed = true;
3035
+ return this.stringify();
3036
+ }
3037
+ runOnRoot(plugin2) {
3038
+ this.result.lastPlugin = plugin2;
3039
+ try {
3040
+ if (typeof plugin2 === "object" && plugin2.Once) {
3041
+ if (this.result.root.type === "document") {
3042
+ let roots = this.result.root.nodes.map(
3043
+ (root2) => plugin2.Once(root2, this.helpers)
3044
+ );
3045
+ if (isPromise(roots[0])) {
3046
+ return Promise.all(roots);
3047
+ }
3048
+ return roots;
3049
+ }
3050
+ return plugin2.Once(this.result.root, this.helpers);
3051
+ } else if (typeof plugin2 === "function") {
3052
+ return plugin2(this.result.root, this.result);
3053
+ }
3054
+ } catch (error) {
3055
+ throw this.handleError(error);
3056
+ }
3057
+ }
3058
+ stringify() {
3059
+ if (this.error) throw this.error;
3060
+ if (this.stringified) return this.result;
3061
+ this.stringified = true;
3062
+ this.sync();
3063
+ let opts = this.result.opts;
3064
+ let str = stringify$2;
3065
+ if (opts.syntax) str = opts.syntax.stringify;
3066
+ if (opts.stringifier) str = opts.stringifier;
3067
+ if (str.stringify) str = str.stringify;
3068
+ let map = new MapGenerator$1(str, this.result.root, this.result.opts);
3069
+ let data = map.generate();
3070
+ this.result.css = data[0];
3071
+ this.result.map = data[1];
3072
+ return this.result;
3073
+ }
3074
+ sync() {
3075
+ if (this.error) throw this.error;
3076
+ if (this.processed) return this.result;
3077
+ this.processed = true;
3078
+ if (this.processing) {
3079
+ throw this.getAsyncError();
3080
+ }
3081
+ for (let plugin2 of this.plugins) {
3082
+ let promise = this.runOnRoot(plugin2);
3083
+ if (isPromise(promise)) {
3084
+ throw this.getAsyncError();
3085
+ }
3086
+ }
3087
+ this.prepareVisitors();
3088
+ if (this.hasListener) {
3089
+ let root2 = this.result.root;
3090
+ while (!root2[isClean]) {
3091
+ root2[isClean] = true;
3092
+ this.walkSync(root2);
3093
+ }
3094
+ if (this.listeners.OnceExit) {
3095
+ if (root2.type === "document") {
3096
+ for (let subRoot of root2.nodes) {
3097
+ this.visitSync(this.listeners.OnceExit, subRoot);
3098
+ }
3099
+ } else {
3100
+ this.visitSync(this.listeners.OnceExit, root2);
3101
+ }
3102
+ }
3103
+ }
3104
+ return this.result;
3105
+ }
3106
+ then(onFulfilled, onRejected) {
3107
+ if (process.env.NODE_ENV !== "production") {
3108
+ if (!("from" in this.opts)) {
3109
+ warnOnce$1(
3110
+ "Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning."
3111
+ );
3112
+ }
3113
+ }
3114
+ return this.async().then(onFulfilled, onRejected);
3115
+ }
3116
+ toString() {
3117
+ return this.css;
3118
+ }
3119
+ visitSync(visitors, node2) {
3120
+ for (let [plugin2, visitor] of visitors) {
3121
+ this.result.lastPlugin = plugin2;
3122
+ let promise;
3123
+ try {
3124
+ promise = visitor(node2, this.helpers);
3125
+ } catch (e) {
3126
+ throw this.handleError(e, node2.proxyOf);
3127
+ }
3128
+ if (node2.type !== "root" && node2.type !== "document" && !node2.parent) {
3129
+ return true;
3130
+ }
3131
+ if (isPromise(promise)) {
3132
+ throw this.getAsyncError();
3133
+ }
3134
+ }
3135
+ }
3136
+ visitTick(stack) {
3137
+ let visit2 = stack[stack.length - 1];
3138
+ let { node: node2, visitors } = visit2;
3139
+ if (node2.type !== "root" && node2.type !== "document" && !node2.parent) {
3140
+ stack.pop();
3141
+ return;
3142
+ }
3143
+ if (visitors.length > 0 && visit2.visitorIndex < visitors.length) {
3144
+ let [plugin2, visitor] = visitors[visit2.visitorIndex];
3145
+ visit2.visitorIndex += 1;
3146
+ if (visit2.visitorIndex === visitors.length) {
3147
+ visit2.visitors = [];
3148
+ visit2.visitorIndex = 0;
3149
+ }
3150
+ this.result.lastPlugin = plugin2;
3151
+ try {
3152
+ return visitor(node2.toProxy(), this.helpers);
3153
+ } catch (e) {
3154
+ throw this.handleError(e, node2);
3155
+ }
3156
+ }
3157
+ if (visit2.iterator !== 0) {
3158
+ let iterator = visit2.iterator;
3159
+ let child;
3160
+ while (child = node2.nodes[node2.indexes[iterator]]) {
3161
+ node2.indexes[iterator] += 1;
3162
+ if (!child[isClean]) {
3163
+ child[isClean] = true;
3164
+ stack.push(toStack(child));
3165
+ return;
3166
+ }
3167
+ }
3168
+ visit2.iterator = 0;
3169
+ delete node2.indexes[iterator];
3170
+ }
3171
+ let events = visit2.events;
3172
+ while (visit2.eventIndex < events.length) {
3173
+ let event = events[visit2.eventIndex];
3174
+ visit2.eventIndex += 1;
3175
+ if (event === CHILDREN) {
3176
+ if (node2.nodes && node2.nodes.length) {
3177
+ node2[isClean] = true;
3178
+ visit2.iterator = node2.getIterator();
3179
+ }
3180
+ return;
3181
+ } else if (this.listeners[event]) {
3182
+ visit2.visitors = this.listeners[event];
3183
+ return;
3184
+ }
3185
+ }
3186
+ stack.pop();
3187
+ }
3188
+ walkSync(node2) {
3189
+ node2[isClean] = true;
3190
+ let events = getEvents(node2);
3191
+ for (let event of events) {
3192
+ if (event === CHILDREN) {
3193
+ if (node2.nodes) {
3194
+ node2.each((child) => {
3195
+ if (!child[isClean]) this.walkSync(child);
3196
+ });
3197
+ }
3198
+ } else {
3199
+ let visitors = this.listeners[event];
3200
+ if (visitors) {
3201
+ if (this.visitSync(visitors, node2.toProxy())) return;
3202
+ }
3203
+ }
3204
+ }
3205
+ }
3206
+ warnings() {
3207
+ return this.sync().warnings();
3208
+ }
3209
+ get content() {
3210
+ return this.stringify().content;
3211
+ }
3212
+ get css() {
3213
+ return this.stringify().css;
3214
+ }
3215
+ get map() {
3216
+ return this.stringify().map;
3217
+ }
3218
+ get messages() {
3219
+ return this.sync().messages;
3220
+ }
3221
+ get opts() {
3222
+ return this.result.opts;
3223
+ }
3224
+ get processor() {
3225
+ return this.result.processor;
3226
+ }
3227
+ get root() {
3228
+ return this.sync().root;
3229
+ }
3230
+ get [Symbol.toStringTag]() {
3231
+ return "LazyResult";
3232
+ }
3233
+ };
3234
+ LazyResult$2.registerPostcss = (dependant) => {
3235
+ postcss$2 = dependant;
3236
+ };
3237
+ var lazyResult = LazyResult$2;
3238
+ LazyResult$2.default = LazyResult$2;
3239
+ Root$3.registerLazyResult(LazyResult$2);
3240
+ Document$2.registerLazyResult(LazyResult$2);
3241
+ let MapGenerator2 = mapGenerator;
3242
+ let stringify$1 = stringify_1;
3243
+ let warnOnce2 = warnOnce$2;
3244
+ let parse$1 = parse_1;
3245
+ const Result$1 = result;
3246
+ let NoWorkResult$1 = class NoWorkResult {
3247
+ constructor(processor2, css, opts) {
3248
+ css = css.toString();
3249
+ this.stringified = false;
3250
+ this._processor = processor2;
3251
+ this._css = css;
3252
+ this._opts = opts;
3253
+ this._map = void 0;
3254
+ let root2;
3255
+ let str = stringify$1;
3256
+ this.result = new Result$1(this._processor, root2, this._opts);
3257
+ this.result.css = css;
3258
+ let self = this;
3259
+ Object.defineProperty(this.result, "root", {
3260
+ get() {
3261
+ return self.root;
3262
+ }
3263
+ });
3264
+ let map = new MapGenerator2(str, root2, this._opts, css);
3265
+ if (map.isMap()) {
3266
+ let [generatedCSS, generatedMap] = map.generate();
3267
+ if (generatedCSS) {
3268
+ this.result.css = generatedCSS;
3269
+ }
3270
+ if (generatedMap) {
3271
+ this.result.map = generatedMap;
3272
+ }
3273
+ } else {
3274
+ map.clearAnnotation();
3275
+ this.result.css = map.css;
3276
+ }
3277
+ }
3278
+ async() {
3279
+ if (this.error) return Promise.reject(this.error);
3280
+ return Promise.resolve(this.result);
3281
+ }
3282
+ catch(onRejected) {
3283
+ return this.async().catch(onRejected);
3284
+ }
3285
+ finally(onFinally) {
3286
+ return this.async().then(onFinally, onFinally);
3287
+ }
3288
+ sync() {
3289
+ if (this.error) throw this.error;
3290
+ return this.result;
3291
+ }
3292
+ then(onFulfilled, onRejected) {
3293
+ if (process.env.NODE_ENV !== "production") {
3294
+ if (!("from" in this._opts)) {
3295
+ warnOnce2(
3296
+ "Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning."
3297
+ );
3298
+ }
3299
+ }
3300
+ return this.async().then(onFulfilled, onRejected);
3301
+ }
3302
+ toString() {
3303
+ return this._css;
3304
+ }
3305
+ warnings() {
3306
+ return [];
3307
+ }
3308
+ get content() {
3309
+ return this.result.css;
3310
+ }
3311
+ get css() {
3312
+ return this.result.css;
3313
+ }
3314
+ get map() {
3315
+ return this.result.map;
3316
+ }
3317
+ get messages() {
3318
+ return [];
3319
+ }
3320
+ get opts() {
3321
+ return this.result.opts;
3322
+ }
3323
+ get processor() {
3324
+ return this.result.processor;
3325
+ }
3326
+ get root() {
3327
+ if (this._root) {
3328
+ return this._root;
3329
+ }
3330
+ let root2;
3331
+ let parser2 = parse$1;
3332
+ try {
3333
+ root2 = parser2(this._css, this._opts);
3334
+ } catch (error) {
3335
+ this.error = error;
3336
+ }
3337
+ if (this.error) {
3338
+ throw this.error;
3339
+ } else {
3340
+ this._root = root2;
3341
+ return root2;
3342
+ }
3343
+ }
3344
+ get [Symbol.toStringTag]() {
3345
+ return "NoWorkResult";
3346
+ }
3347
+ };
3348
+ var noWorkResult = NoWorkResult$1;
3349
+ NoWorkResult$1.default = NoWorkResult$1;
3350
+ let NoWorkResult2 = noWorkResult;
3351
+ let LazyResult$1 = lazyResult;
3352
+ let Document$1 = document$1;
3353
+ let Root$2 = root;
3354
+ let Processor$1 = class Processor {
3355
+ constructor(plugins = []) {
3356
+ this.version = "8.4.38";
3357
+ this.plugins = this.normalize(plugins);
3358
+ }
3359
+ normalize(plugins) {
3360
+ let normalized = [];
3361
+ for (let i of plugins) {
3362
+ if (i.postcss === true) {
3363
+ i = i();
3364
+ } else if (i.postcss) {
3365
+ i = i.postcss;
3366
+ }
3367
+ if (typeof i === "object" && Array.isArray(i.plugins)) {
3368
+ normalized = normalized.concat(i.plugins);
3369
+ } else if (typeof i === "object" && i.postcssPlugin) {
3370
+ normalized.push(i);
3371
+ } else if (typeof i === "function") {
3372
+ normalized.push(i);
3373
+ } else if (typeof i === "object" && (i.parse || i.stringify)) {
3374
+ if (process.env.NODE_ENV !== "production") {
3375
+ throw new Error(
3376
+ "PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation."
3377
+ );
3378
+ }
3379
+ } else {
3380
+ throw new Error(i + " is not a PostCSS plugin");
3381
+ }
3382
+ }
3383
+ return normalized;
3384
+ }
3385
+ process(css, opts = {}) {
3386
+ if (!this.plugins.length && !opts.parser && !opts.stringifier && !opts.syntax) {
3387
+ return new NoWorkResult2(this, css, opts);
3388
+ } else {
3389
+ return new LazyResult$1(this, css, opts);
3390
+ }
3391
+ }
3392
+ use(plugin2) {
3393
+ this.plugins = this.plugins.concat(this.normalize([plugin2]));
3394
+ return this;
3395
+ }
3396
+ };
3397
+ var processor = Processor$1;
3398
+ Processor$1.default = Processor$1;
3399
+ Root$2.registerProcessor(Processor$1);
3400
+ Document$1.registerProcessor(Processor$1);
3401
+ let Declaration$1 = declaration;
3402
+ let PreviousMap2 = previousMap;
3403
+ let Comment$1 = comment;
3404
+ let AtRule$1 = atRule;
3405
+ let Input$1 = input;
3406
+ let Root$1 = root;
3407
+ let Rule$1 = rule;
3408
+ function fromJSON$1(json, inputs) {
3409
+ if (Array.isArray(json)) return json.map((n) => fromJSON$1(n));
3410
+ let { inputs: ownInputs, ...defaults } = json;
3411
+ if (ownInputs) {
3412
+ inputs = [];
3413
+ for (let input2 of ownInputs) {
3414
+ let inputHydrated = { ...input2, __proto__: Input$1.prototype };
3415
+ if (inputHydrated.map) {
3416
+ inputHydrated.map = {
3417
+ ...inputHydrated.map,
3418
+ __proto__: PreviousMap2.prototype
3419
+ };
3420
+ }
3421
+ inputs.push(inputHydrated);
3422
+ }
3423
+ }
3424
+ if (defaults.nodes) {
3425
+ defaults.nodes = json.nodes.map((n) => fromJSON$1(n, inputs));
3426
+ }
3427
+ if (defaults.source) {
3428
+ let { inputId, ...source } = defaults.source;
3429
+ defaults.source = source;
3430
+ if (inputId != null) {
3431
+ defaults.source.input = inputs[inputId];
3432
+ }
3433
+ }
3434
+ if (defaults.type === "root") {
3435
+ return new Root$1(defaults);
3436
+ } else if (defaults.type === "decl") {
3437
+ return new Declaration$1(defaults);
3438
+ } else if (defaults.type === "rule") {
3439
+ return new Rule$1(defaults);
3440
+ } else if (defaults.type === "comment") {
3441
+ return new Comment$1(defaults);
3442
+ } else if (defaults.type === "atrule") {
3443
+ return new AtRule$1(defaults);
3444
+ } else {
3445
+ throw new Error("Unknown node type: " + json.type);
3446
+ }
3447
+ }
3448
+ var fromJSON_1 = fromJSON$1;
3449
+ fromJSON$1.default = fromJSON$1;
3450
+ let CssSyntaxError2 = cssSyntaxError;
3451
+ let Declaration2 = declaration;
3452
+ let LazyResult2 = lazyResult;
3453
+ let Container2 = container;
3454
+ let Processor2 = processor;
3455
+ let stringify = stringify_1;
3456
+ let fromJSON = fromJSON_1;
3457
+ let Document22 = document$1;
3458
+ let Warning2 = warning;
3459
+ let Comment2 = comment;
3460
+ let AtRule2 = atRule;
3461
+ let Result2 = result;
3462
+ let Input2 = input;
3463
+ let parse = parse_1;
3464
+ let list = list_1;
3465
+ let Rule2 = rule;
3466
+ let Root2 = root;
3467
+ let Node22 = node;
3468
+ function postcss(...plugins) {
3469
+ if (plugins.length === 1 && Array.isArray(plugins[0])) {
3470
+ plugins = plugins[0];
3471
+ }
3472
+ return new Processor2(plugins);
3473
+ }
3474
+ postcss.plugin = function plugin(name, initializer) {
3475
+ let warningPrinted = false;
3476
+ function creator(...args) {
3477
+ if (console && console.warn && !warningPrinted) {
3478
+ warningPrinted = true;
3479
+ console.warn(
3480
+ name + ": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"
3481
+ );
3482
+ if (process.env.LANG && process.env.LANG.startsWith("cn")) {
3483
+ console.warn(
3484
+ name + ": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"
3485
+ );
3486
+ }
3487
+ }
3488
+ let transformer = initializer(...args);
3489
+ transformer.postcssPlugin = name;
3490
+ transformer.postcssVersion = new Processor2().version;
3491
+ return transformer;
3492
+ }
3493
+ let cache;
3494
+ Object.defineProperty(creator, "postcss", {
3495
+ get() {
3496
+ if (!cache) cache = creator();
3497
+ return cache;
3498
+ }
3499
+ });
3500
+ creator.process = function(css, processOpts, pluginOpts) {
3501
+ return postcss([creator(pluginOpts)]).process(css, processOpts);
3502
+ };
3503
+ return creator;
3504
+ };
3505
+ postcss.stringify = stringify;
3506
+ postcss.parse = parse;
3507
+ postcss.fromJSON = fromJSON;
3508
+ postcss.list = list;
3509
+ postcss.comment = (defaults) => new Comment2(defaults);
3510
+ postcss.atRule = (defaults) => new AtRule2(defaults);
3511
+ postcss.decl = (defaults) => new Declaration2(defaults);
3512
+ postcss.rule = (defaults) => new Rule2(defaults);
3513
+ postcss.root = (defaults) => new Root2(defaults);
3514
+ postcss.document = (defaults) => new Document22(defaults);
3515
+ postcss.CssSyntaxError = CssSyntaxError2;
3516
+ postcss.Declaration = Declaration2;
3517
+ postcss.Container = Container2;
3518
+ postcss.Processor = Processor2;
3519
+ postcss.Document = Document22;
3520
+ postcss.Comment = Comment2;
3521
+ postcss.Warning = Warning2;
3522
+ postcss.AtRule = AtRule2;
3523
+ postcss.Result = Result2;
3524
+ postcss.Input = Input2;
3525
+ postcss.Rule = Rule2;
3526
+ postcss.Root = Root2;
3527
+ postcss.Node = Node22;
3528
+ LazyResult2.registerPostcss(postcss);
3529
+ var postcss_1 = postcss;
3530
+ postcss.default = postcss;
3531
+ const postcss$1 = /* @__PURE__ */ getDefaultExportFromCjs(postcss_1);
3532
+ postcss$1.stringify;
3533
+ postcss$1.fromJSON;
3534
+ postcss$1.plugin;
3535
+ postcss$1.parse;
3536
+ postcss$1.list;
3537
+ postcss$1.document;
3538
+ postcss$1.comment;
3539
+ postcss$1.atRule;
3540
+ postcss$1.rule;
3541
+ postcss$1.decl;
3542
+ postcss$1.root;
3543
+ postcss$1.CssSyntaxError;
3544
+ postcss$1.Declaration;
3545
+ postcss$1.Container;
3546
+ postcss$1.Processor;
3547
+ postcss$1.Document;
3548
+ postcss$1.Comment;
3549
+ postcss$1.Warning;
3550
+ postcss$1.AtRule;
3551
+ postcss$1.Result;
3552
+ postcss$1.Input;
3553
+ postcss$1.Rule;
3554
+ postcss$1.Root;
3555
+ postcss$1.Node;
3556
+ var NodeType$1 = /* @__PURE__ */ ((NodeType2) => {
3557
+ NodeType2[NodeType2["Document"] = 0] = "Document";
3558
+ NodeType2[NodeType2["DocumentType"] = 1] = "DocumentType";
3559
+ NodeType2[NodeType2["Element"] = 2] = "Element";
3560
+ NodeType2[NodeType2["Text"] = 3] = "Text";
3561
+ NodeType2[NodeType2["CDATA"] = 4] = "CDATA";
3562
+ NodeType2[NodeType2["Comment"] = 5] = "Comment";
3563
+ return NodeType2;
3564
+ })(NodeType$1 || {});
3565
+ function parseCSSText(cssText) {
3566
+ const res = {};
3567
+ const listDelimiter = /;(?![^(]*\))/g;
3568
+ const propertyDelimiter = /:(.+)/;
3569
+ const comment2 = /\/\*.*?\*\//g;
3570
+ cssText.replace(comment2, "").split(listDelimiter).forEach(function(item) {
3571
+ if (item) {
3572
+ const tmp = item.split(propertyDelimiter);
3573
+ tmp.length > 1 && (res[camelize(tmp[0].trim())] = tmp[1].trim());
3574
+ }
3575
+ });
3576
+ return res;
3577
+ }
3578
+ function toCSSText(style) {
3579
+ const properties = [];
3580
+ for (const name in style) {
3581
+ const value = style[name];
3582
+ if (typeof value !== "string") continue;
3583
+ const normalizedName = hyphenate(name);
3584
+ properties.push(`${normalizedName}: ${value};`);
3585
+ }
3586
+ return properties.join(" ");
3587
+ }
3588
+ const camelizeRE = /-([a-z])/g;
3589
+ const CUSTOM_PROPERTY_REGEX = /^--[a-zA-Z0-9-]+$/;
3590
+ const camelize = (str) => {
3591
+ if (CUSTOM_PROPERTY_REGEX.test(str)) return str;
3592
+ return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
3593
+ };
3594
+ const hyphenateRE = /\B([A-Z])/g;
3595
+ const hyphenate = (str) => {
3596
+ return str.replace(hyphenateRE, "-$1").toLowerCase();
3597
+ };
3598
+ class BaseRRNode {
3599
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
3600
+ constructor(..._args) {
3601
+ __publicField2(this, "parentElement", null);
3602
+ __publicField2(this, "parentNode", null);
3603
+ __publicField2(this, "ownerDocument");
3604
+ __publicField2(this, "firstChild", null);
3605
+ __publicField2(this, "lastChild", null);
3606
+ __publicField2(this, "previousSibling", null);
3607
+ __publicField2(this, "nextSibling", null);
3608
+ __publicField2(this, "ELEMENT_NODE", 1);
3609
+ __publicField2(this, "TEXT_NODE", 3);
3610
+ __publicField2(this, "nodeType");
3611
+ __publicField2(this, "nodeName");
3612
+ __publicField2(this, "RRNodeType");
3613
+ }
3614
+ get childNodes() {
3615
+ const childNodes = [];
3616
+ let childIterator = this.firstChild;
3617
+ while (childIterator) {
3618
+ childNodes.push(childIterator);
3619
+ childIterator = childIterator.nextSibling;
3620
+ }
3621
+ return childNodes;
3622
+ }
3623
+ contains(node2) {
3624
+ if (!(node2 instanceof BaseRRNode)) return false;
3625
+ else if (node2.ownerDocument !== this.ownerDocument) return false;
3626
+ else if (node2 === this) return true;
3627
+ while (node2.parentNode) {
3628
+ if (node2.parentNode === this) return true;
3629
+ node2 = node2.parentNode;
3630
+ }
3631
+ return false;
3632
+ }
3633
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
3634
+ appendChild(_newChild) {
3635
+ throw new Error(
3636
+ `RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.`
3637
+ );
3638
+ }
3639
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
3640
+ insertBefore(_newChild, _refChild) {
3641
+ throw new Error(
3642
+ `RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.`
3643
+ );
3644
+ }
3645
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
3646
+ removeChild(_node) {
3647
+ throw new Error(
3648
+ `RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.`
3649
+ );
3650
+ }
3651
+ toString() {
3652
+ return "RRNode";
3653
+ }
3654
+ }
3655
+ class BaseRRDocument extends BaseRRNode {
3656
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3657
+ constructor(...args) {
3658
+ super(args);
3659
+ __publicField2(this, "nodeType", 9);
3660
+ __publicField2(this, "nodeName", "#document");
3661
+ __publicField2(this, "compatMode", "CSS1Compat");
3662
+ __publicField2(this, "RRNodeType", NodeType$1.Document);
3663
+ __publicField2(this, "textContent", null);
3664
+ this.ownerDocument = this;
3665
+ }
3666
+ get documentElement() {
3667
+ return this.childNodes.find(
3668
+ (node2) => node2.RRNodeType === NodeType$1.Element && node2.tagName === "HTML"
3669
+ ) || null;
3670
+ }
3671
+ get body() {
3672
+ var _a;
3673
+ return ((_a = this.documentElement) == null ? void 0 : _a.childNodes.find(
3674
+ (node2) => node2.RRNodeType === NodeType$1.Element && node2.tagName === "BODY"
3675
+ )) || null;
3676
+ }
3677
+ get head() {
3678
+ var _a;
3679
+ return ((_a = this.documentElement) == null ? void 0 : _a.childNodes.find(
3680
+ (node2) => node2.RRNodeType === NodeType$1.Element && node2.tagName === "HEAD"
3681
+ )) || null;
3682
+ }
3683
+ get implementation() {
3684
+ return this;
3685
+ }
3686
+ get firstElementChild() {
3687
+ return this.documentElement;
3688
+ }
3689
+ appendChild(newChild) {
3690
+ const nodeType = newChild.RRNodeType;
3691
+ if (nodeType === NodeType$1.Element || nodeType === NodeType$1.DocumentType) {
3692
+ if (this.childNodes.some((s) => s.RRNodeType === nodeType)) {
3693
+ throw new Error(
3694
+ `RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${nodeType === NodeType$1.Element ? "RRElement" : "RRDoctype"} on RRDocument allowed.`
3695
+ );
3696
+ }
3697
+ }
3698
+ const child = appendChild(this, newChild);
3699
+ child.parentElement = null;
3700
+ return child;
3701
+ }
3702
+ insertBefore(newChild, refChild) {
3703
+ const nodeType = newChild.RRNodeType;
3704
+ if (nodeType === NodeType$1.Element || nodeType === NodeType$1.DocumentType) {
3705
+ if (this.childNodes.some((s) => s.RRNodeType === nodeType)) {
3706
+ throw new Error(
3707
+ `RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${nodeType === NodeType$1.Element ? "RRElement" : "RRDoctype"} on RRDocument allowed.`
3708
+ );
3709
+ }
3710
+ }
3711
+ const child = insertBefore(this, newChild, refChild);
3712
+ child.parentElement = null;
3713
+ return child;
3714
+ }
3715
+ removeChild(node2) {
3716
+ return removeChild(this, node2);
3717
+ }
3718
+ open() {
3719
+ this.firstChild = null;
3720
+ this.lastChild = null;
3721
+ }
3722
+ close() {
3723
+ }
3724
+ /**
3725
+ * Adhoc implementation for setting xhtml namespace in rebuilt.ts (rrweb-snapshot).
3726
+ * There are two lines used this function:
3727
+ * 1. doc.write('\<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""\>')
3728
+ * 2. doc.write('\<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" ""\>')
3729
+ */
3730
+ write(content) {
3731
+ let publicId;
3732
+ if (content === '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">')
3733
+ publicId = "-//W3C//DTD XHTML 1.0 Transitional//EN";
3734
+ else if (content === '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')
3735
+ publicId = "-//W3C//DTD HTML 4.0 Transitional//EN";
3736
+ if (publicId) {
3737
+ const doctype = this.createDocumentType("html", publicId, "");
3738
+ this.open();
3739
+ this.appendChild(doctype);
3740
+ }
3741
+ }
3742
+ createDocument(_namespace, _qualifiedName, _doctype) {
3743
+ return new BaseRRDocument();
3744
+ }
3745
+ createDocumentType(qualifiedName, publicId, systemId) {
3746
+ const doctype = new BaseRRDocumentType(qualifiedName, publicId, systemId);
3747
+ doctype.ownerDocument = this;
3748
+ return doctype;
3749
+ }
3750
+ createElement(tagName) {
3751
+ const element = new BaseRRElement(tagName);
3752
+ element.ownerDocument = this;
3753
+ return element;
3754
+ }
3755
+ createElementNS(_namespaceURI, qualifiedName) {
3756
+ return this.createElement(qualifiedName);
3757
+ }
3758
+ createTextNode(data) {
3759
+ const text = new BaseRRText(data);
3760
+ text.ownerDocument = this;
3761
+ return text;
3762
+ }
3763
+ createComment(data) {
3764
+ const comment2 = new BaseRRComment(data);
3765
+ comment2.ownerDocument = this;
3766
+ return comment2;
3767
+ }
3768
+ createCDATASection(data) {
3769
+ const CDATASection = new BaseRRCDATASection(data);
3770
+ CDATASection.ownerDocument = this;
3771
+ return CDATASection;
3772
+ }
3773
+ toString() {
3774
+ return "RRDocument";
3775
+ }
3776
+ }
3777
+ class BaseRRDocumentType extends BaseRRNode {
3778
+ constructor(qualifiedName, publicId, systemId) {
3779
+ super();
3780
+ __publicField2(this, "nodeType", 10);
3781
+ __publicField2(this, "RRNodeType", NodeType$1.DocumentType);
3782
+ __publicField2(this, "name");
3783
+ __publicField2(this, "publicId");
3784
+ __publicField2(this, "systemId");
3785
+ __publicField2(this, "textContent", null);
3786
+ this.name = qualifiedName;
3787
+ this.publicId = publicId;
3788
+ this.systemId = systemId;
3789
+ this.nodeName = qualifiedName;
3790
+ }
3791
+ toString() {
3792
+ return "RRDocumentType";
3793
+ }
3794
+ }
3795
+ class BaseRRElement extends BaseRRNode {
3796
+ constructor(tagName) {
3797
+ super();
3798
+ __publicField2(this, "nodeType", 1);
3799
+ __publicField2(this, "RRNodeType", NodeType$1.Element);
3800
+ __publicField2(this, "tagName");
3801
+ __publicField2(this, "attributes", {});
3802
+ __publicField2(this, "shadowRoot", null);
3803
+ __publicField2(this, "scrollLeft");
3804
+ __publicField2(this, "scrollTop");
3805
+ this.tagName = tagName.toUpperCase();
3806
+ this.nodeName = tagName.toUpperCase();
3807
+ }
3808
+ get textContent() {
3809
+ let result2 = "";
3810
+ this.childNodes.forEach((node2) => result2 += node2.textContent);
3811
+ return result2;
3812
+ }
3813
+ set textContent(textContent) {
3814
+ this.firstChild = null;
3815
+ this.lastChild = null;
3816
+ this.appendChild(this.ownerDocument.createTextNode(textContent));
3817
+ }
3818
+ get classList() {
3819
+ return new ClassList(
3820
+ this.attributes.class,
3821
+ (newClassName) => {
3822
+ this.attributes.class = newClassName;
3823
+ }
3824
+ );
3825
+ }
3826
+ get id() {
3827
+ return this.attributes.id || "";
3828
+ }
3829
+ get className() {
3830
+ return this.attributes.class || "";
3831
+ }
3832
+ get style() {
3833
+ const style = this.attributes.style ? parseCSSText(this.attributes.style) : {};
3834
+ const hyphenateRE2 = /\B([A-Z])/g;
3835
+ style.setProperty = (name, value, priority) => {
3836
+ if (hyphenateRE2.test(name)) return;
3837
+ const normalizedName = camelize(name);
3838
+ if (!value) delete style[normalizedName];
3839
+ else style[normalizedName] = value;
3840
+ if (priority === "important") style[normalizedName] += " !important";
3841
+ this.attributes.style = toCSSText(style);
3842
+ };
3843
+ style.removeProperty = (name) => {
3844
+ if (hyphenateRE2.test(name)) return "";
3845
+ const normalizedName = camelize(name);
3846
+ const value = style[normalizedName] || "";
3847
+ delete style[normalizedName];
3848
+ this.attributes.style = toCSSText(style);
3849
+ return value;
3850
+ };
3851
+ return style;
3852
+ }
3853
+ getAttribute(name) {
3854
+ if (this.attributes[name] === void 0) return null;
3855
+ return this.attributes[name];
3856
+ }
3857
+ setAttribute(name, attribute) {
3858
+ this.attributes[name] = attribute;
3859
+ }
3860
+ setAttributeNS(_namespace, qualifiedName, value) {
3861
+ this.setAttribute(qualifiedName, value);
3862
+ }
3863
+ removeAttribute(name) {
3864
+ delete this.attributes[name];
3865
+ }
3866
+ appendChild(newChild) {
3867
+ return appendChild(this, newChild);
3868
+ }
3869
+ insertBefore(newChild, refChild) {
3870
+ return insertBefore(this, newChild, refChild);
3871
+ }
3872
+ removeChild(node2) {
3873
+ return removeChild(this, node2);
3874
+ }
3875
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
3876
+ attachShadow(_init) {
3877
+ const shadowRoot = this.ownerDocument.createElement("SHADOWROOT");
3878
+ this.shadowRoot = shadowRoot;
3879
+ return shadowRoot;
3880
+ }
3881
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
3882
+ dispatchEvent(_event) {
3883
+ return true;
3884
+ }
3885
+ toString() {
3886
+ let attributeString = "";
3887
+ for (const attribute in this.attributes) {
3888
+ attributeString += `${attribute}="${this.attributes[attribute]}" `;
3889
+ }
3890
+ return `${this.tagName} ${attributeString}`;
3891
+ }
3892
+ }
3893
+ class BaseRRMediaElement extends BaseRRElement {
3894
+ constructor() {
3895
+ super(...arguments);
3896
+ __publicField2(this, "currentTime");
3897
+ __publicField2(this, "volume");
3898
+ __publicField2(this, "paused");
3899
+ __publicField2(this, "muted");
3900
+ __publicField2(this, "playbackRate");
3901
+ __publicField2(this, "loop");
3902
+ }
3903
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
3904
+ attachShadow(_init) {
3905
+ throw new Error(
3906
+ `RRDomException: Failed to execute 'attachShadow' on 'RRElement': This RRElement does not support attachShadow`
3907
+ );
3908
+ }
3909
+ play() {
3910
+ this.paused = false;
3911
+ }
3912
+ pause() {
3913
+ this.paused = true;
3914
+ }
3915
+ }
3916
+ class BaseRRText extends BaseRRNode {
3917
+ constructor(data) {
3918
+ super();
3919
+ __publicField2(this, "nodeType", 3);
3920
+ __publicField2(this, "nodeName", "#text");
3921
+ __publicField2(this, "RRNodeType", NodeType$1.Text);
3922
+ __publicField2(this, "data");
3923
+ this.data = data;
3924
+ }
3925
+ get textContent() {
3926
+ return this.data;
3927
+ }
3928
+ set textContent(textContent) {
3929
+ this.data = textContent;
3930
+ }
3931
+ toString() {
3932
+ return `RRText text=${JSON.stringify(this.data)}`;
3933
+ }
3934
+ }
3935
+ class BaseRRComment extends BaseRRNode {
3936
+ constructor(data) {
3937
+ super();
3938
+ __publicField2(this, "nodeType", 8);
3939
+ __publicField2(this, "nodeName", "#comment");
3940
+ __publicField2(this, "RRNodeType", NodeType$1.Comment);
3941
+ __publicField2(this, "data");
3942
+ this.data = data;
3943
+ }
3944
+ get textContent() {
3945
+ return this.data;
3946
+ }
3947
+ set textContent(textContent) {
3948
+ this.data = textContent;
3949
+ }
3950
+ toString() {
3951
+ return `RRComment text=${JSON.stringify(this.data)}`;
3952
+ }
3953
+ }
3954
+ class BaseRRCDATASection extends BaseRRNode {
3955
+ constructor(data) {
3956
+ super();
3957
+ __publicField2(this, "nodeName", "#cdata-section");
3958
+ __publicField2(this, "nodeType", 4);
3959
+ __publicField2(this, "RRNodeType", NodeType$1.CDATA);
3960
+ __publicField2(this, "data");
3961
+ this.data = data;
3962
+ }
3963
+ get textContent() {
3964
+ return this.data;
3965
+ }
3966
+ set textContent(textContent) {
3967
+ this.data = textContent;
3968
+ }
3969
+ toString() {
3970
+ return `RRCDATASection data=${JSON.stringify(this.data)}`;
3971
+ }
3972
+ }
3973
+ class ClassList {
3974
+ constructor(classText, onChange) {
3975
+ __publicField2(this, "onChange");
3976
+ __publicField2(this, "classes", []);
3977
+ __publicField2(this, "add", (...classNames) => {
3978
+ for (const item of classNames) {
3979
+ const className = String(item);
3980
+ if (this.classes.indexOf(className) >= 0) continue;
3981
+ this.classes.push(className);
3982
+ }
3983
+ this.onChange && this.onChange(this.classes.join(" "));
3984
+ });
3985
+ __publicField2(this, "remove", (...classNames) => {
3986
+ this.classes = this.classes.filter(
3987
+ (item) => classNames.indexOf(item) === -1
3988
+ );
3989
+ this.onChange && this.onChange(this.classes.join(" "));
3990
+ });
3991
+ if (classText) {
3992
+ const classes = classText.trim().split(/\s+/);
3993
+ this.classes.push(...classes);
3994
+ }
3995
+ this.onChange = onChange;
3996
+ }
3997
+ }
3998
+ function appendChild(parent, newChild) {
3999
+ if (newChild.parentNode) newChild.parentNode.removeChild(newChild);
4000
+ if (parent.lastChild) {
4001
+ parent.lastChild.nextSibling = newChild;
4002
+ newChild.previousSibling = parent.lastChild;
4003
+ } else {
4004
+ parent.firstChild = newChild;
4005
+ newChild.previousSibling = null;
4006
+ }
4007
+ parent.lastChild = newChild;
4008
+ newChild.nextSibling = null;
4009
+ newChild.parentNode = parent;
4010
+ newChild.parentElement = parent;
4011
+ newChild.ownerDocument = parent.ownerDocument;
4012
+ return newChild;
4013
+ }
4014
+ function insertBefore(parent, newChild, refChild) {
4015
+ if (!refChild) return appendChild(parent, newChild);
4016
+ if (refChild.parentNode !== parent)
4017
+ throw new Error(
4018
+ "Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode."
4019
+ );
4020
+ if (newChild === refChild) return newChild;
4021
+ if (newChild.parentNode) newChild.parentNode.removeChild(newChild);
4022
+ newChild.previousSibling = refChild.previousSibling;
4023
+ refChild.previousSibling = newChild;
4024
+ newChild.nextSibling = refChild;
4025
+ if (newChild.previousSibling) newChild.previousSibling.nextSibling = newChild;
4026
+ else parent.firstChild = newChild;
4027
+ newChild.parentElement = parent;
4028
+ newChild.parentNode = parent;
4029
+ newChild.ownerDocument = parent.ownerDocument;
4030
+ return newChild;
4031
+ }
4032
+ function removeChild(parent, child) {
4033
+ if (child.parentNode !== parent)
4034
+ throw new Error(
4035
+ "Failed to execute 'removeChild' on 'RRNode': The RRNode to be removed is not a child of this RRNode."
4036
+ );
4037
+ if (child.previousSibling)
4038
+ child.previousSibling.nextSibling = child.nextSibling;
4039
+ else parent.firstChild = child.nextSibling;
4040
+ if (child.nextSibling)
4041
+ child.nextSibling.previousSibling = child.previousSibling;
4042
+ else parent.lastChild = child.previousSibling;
4043
+ child.previousSibling = null;
4044
+ child.nextSibling = null;
4045
+ child.parentElement = null;
4046
+ child.parentNode = null;
4047
+ return child;
4048
+ }
4049
+ var NodeType = /* @__PURE__ */ ((NodeType2) => {
4050
+ NodeType2[NodeType2["Document"] = 0] = "Document";
4051
+ NodeType2[NodeType2["DocumentType"] = 1] = "DocumentType";
4052
+ NodeType2[NodeType2["Element"] = 2] = "Element";
4053
+ NodeType2[NodeType2["Text"] = 3] = "Text";
4054
+ NodeType2[NodeType2["CDATA"] = 4] = "CDATA";
4055
+ NodeType2[NodeType2["Comment"] = 5] = "Comment";
4056
+ return NodeType2;
4057
+ })(NodeType || {});
4058
+ const nwsapi = require("nwsapi");
4059
+ const cssom = require("cssom");
4060
+ const cssstyle = require("cssstyle");
4061
+ class RRWindow {
4062
+ constructor() {
4063
+ __publicField(this, "scrollLeft", 0);
4064
+ __publicField(this, "scrollTop", 0);
4065
+ }
4066
+ scrollTo(options) {
4067
+ if (!options) return;
4068
+ if (typeof options.left === "number") this.scrollLeft = options.left;
4069
+ if (typeof options.top === "number") this.scrollTop = options.top;
4070
+ }
4071
+ }
4072
+ class RRDocument extends BaseRRDocument {
4073
+ constructor() {
4074
+ super(...arguments);
4075
+ __publicField(this, "nodeName", "#document");
4076
+ __publicField(this, "_nwsapi");
4077
+ }
4078
+ get nwsapi() {
4079
+ if (!this._nwsapi) {
4080
+ this._nwsapi = nwsapi({
4081
+ document: this,
4082
+ DOMException: null
4083
+ });
4084
+ this._nwsapi.configure({
4085
+ LOGERRORS: false,
4086
+ IDS_DUPES: true,
4087
+ MIXEDCASE: true
4088
+ });
4089
+ }
4090
+ return this._nwsapi;
4091
+ }
4092
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
4093
+ // @ts-ignore
4094
+ get documentElement() {
4095
+ return super.documentElement;
4096
+ }
4097
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
4098
+ // @ts-ignore
4099
+ get body() {
4100
+ return super.body;
4101
+ }
4102
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
4103
+ // @ts-ignore
4104
+ get head() {
4105
+ return super.head;
4106
+ }
4107
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
4108
+ // @ts-ignore
4109
+ get implementation() {
4110
+ return this;
4111
+ }
4112
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
4113
+ // @ts-ignore
4114
+ get firstElementChild() {
4115
+ return this.documentElement;
4116
+ }
4117
+ appendChild(childNode) {
4118
+ return super.appendChild(childNode);
4119
+ }
4120
+ insertBefore(newChild, refChild) {
4121
+ return super.insertBefore(newChild, refChild);
4122
+ }
4123
+ querySelectorAll(selectors) {
4124
+ return this.nwsapi.select(selectors);
4125
+ }
4126
+ getElementsByTagName(tagName) {
4127
+ if (this.documentElement)
4128
+ return this.documentElement.getElementsByTagName(tagName);
4129
+ return [];
4130
+ }
4131
+ getElementsByClassName(className) {
4132
+ if (this.documentElement)
4133
+ return this.documentElement.getElementsByClassName(className);
4134
+ return [];
4135
+ }
4136
+ getElementById(elementId) {
4137
+ if (this.documentElement)
4138
+ return this.documentElement.getElementById(elementId);
4139
+ return null;
4140
+ }
4141
+ createDocument(_namespace, _qualifiedName, _doctype) {
4142
+ return new RRDocument();
4143
+ }
4144
+ createDocumentType(qualifiedName, publicId, systemId) {
4145
+ const documentTypeNode = new RRDocumentType(
4146
+ qualifiedName,
4147
+ publicId,
4148
+ systemId
4149
+ );
4150
+ documentTypeNode.ownerDocument = this;
4151
+ return documentTypeNode;
4152
+ }
4153
+ createElement(tagName) {
4154
+ const upperTagName = tagName.toUpperCase();
4155
+ let element;
4156
+ switch (upperTagName) {
4157
+ case "AUDIO":
4158
+ case "VIDEO":
4159
+ element = new RRMediaElement(upperTagName);
4160
+ break;
4161
+ case "IFRAME":
4162
+ element = new RRIFrameElement(upperTagName);
4163
+ break;
4164
+ case "IMG":
4165
+ element = new RRImageElement(upperTagName);
4166
+ break;
4167
+ case "CANVAS":
4168
+ element = new RRCanvasElement(upperTagName);
4169
+ break;
4170
+ case "STYLE":
4171
+ element = new RRStyleElement(upperTagName);
4172
+ break;
4173
+ default:
4174
+ element = new RRElement(upperTagName);
4175
+ break;
4176
+ }
4177
+ element.ownerDocument = this;
4178
+ return element;
4179
+ }
4180
+ createElementNS(_namespaceURI, qualifiedName) {
4181
+ return this.createElement(qualifiedName);
4182
+ }
4183
+ createComment(data) {
4184
+ const commentNode = new RRComment(data);
4185
+ commentNode.ownerDocument = this;
4186
+ return commentNode;
4187
+ }
4188
+ createCDATASection(data) {
4189
+ const sectionNode = new RRCDATASection(data);
4190
+ sectionNode.ownerDocument = this;
4191
+ return sectionNode;
4192
+ }
4193
+ createTextNode(data) {
4194
+ const textNode = new RRText(data);
4195
+ textNode.ownerDocument = this;
4196
+ return textNode;
4197
+ }
4198
+ }
4199
+ class RRDocumentType extends BaseRRDocumentType {
4200
+ }
4201
+ class RRElement extends BaseRRElement {
4202
+ constructor(tagName) {
4203
+ super(tagName);
4204
+ __publicField(this, "_style");
4205
+ this._style = new cssstyle.CSSStyleDeclaration();
4206
+ const style = this._style;
4207
+ Object.defineProperty(this.attributes, "style", {
4208
+ get() {
4209
+ return style.cssText;
4210
+ },
4211
+ set(cssText) {
4212
+ style.cssText = cssText;
4213
+ }
4214
+ });
4215
+ }
4216
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
4217
+ // @ts-ignore
4218
+ get style() {
4219
+ return this._style;
4220
+ }
4221
+ attachShadow(_init) {
4222
+ return super.attachShadow(_init);
4223
+ }
4224
+ appendChild(newChild) {
4225
+ return super.appendChild(newChild);
4226
+ }
4227
+ insertBefore(newChild, refChild) {
4228
+ return super.insertBefore(newChild, refChild);
4229
+ }
4230
+ getAttribute(name) {
4231
+ const upperName = name && name.toLowerCase();
4232
+ if (upperName in this.attributes) return this.attributes[upperName];
4233
+ return null;
4234
+ }
4235
+ setAttribute(name, attribute) {
4236
+ this.attributes[name.toLowerCase()] = attribute;
4237
+ }
4238
+ removeAttribute(name) {
4239
+ delete this.attributes[name.toLowerCase()];
4240
+ }
4241
+ get firstElementChild() {
4242
+ for (const child of this.childNodes)
4243
+ if (child.RRNodeType === NodeType.Element) return child;
4244
+ return null;
4245
+ }
4246
+ get nextElementSibling() {
4247
+ const parentNode = this.parentNode;
4248
+ if (!parentNode) return null;
4249
+ const siblings = parentNode.childNodes;
4250
+ const index = siblings.indexOf(this);
4251
+ for (let i = index + 1; i < siblings.length; i++)
4252
+ if (siblings[i] instanceof RRElement) return siblings[i];
4253
+ return null;
4254
+ }
4255
+ querySelectorAll(selectors) {
4256
+ const result2 = [];
4257
+ if (this.ownerDocument !== null) {
4258
+ this.ownerDocument.nwsapi.select(
4259
+ selectors,
4260
+ this,
4261
+ (element) => {
4262
+ if (element !== this)
4263
+ result2.push(element);
4264
+ }
4265
+ );
4266
+ }
4267
+ return result2;
4268
+ }
4269
+ getElementById(elementId) {
4270
+ if (this.id === elementId) return this;
4271
+ for (const child of this.childNodes) {
4272
+ if (child instanceof RRElement) {
4273
+ const result2 = child.getElementById(elementId);
4274
+ if (result2 !== null) return result2;
4275
+ }
4276
+ }
4277
+ return null;
4278
+ }
4279
+ getElementsByClassName(className) {
4280
+ let elements = [];
4281
+ const queryClassList = new ClassList(className);
4282
+ if (this instanceof RRElement && queryClassList.classes.filter(
4283
+ (queriedClassName) => this.classList.classes.some((name) => name === queriedClassName)
4284
+ ).length == queryClassList.classes.length)
4285
+ elements.push(this);
4286
+ for (const child of this.childNodes) {
4287
+ if (child instanceof RRElement)
4288
+ elements = elements.concat(child.getElementsByClassName(className));
4289
+ }
4290
+ return elements;
4291
+ }
4292
+ getElementsByTagName(tagName) {
4293
+ let elements = [];
4294
+ const normalizedTagName = tagName.toUpperCase();
4295
+ if (this instanceof RRElement && this.tagName === normalizedTagName)
4296
+ elements.push(this);
4297
+ for (const child of this.childNodes) {
4298
+ if (child instanceof RRElement)
4299
+ elements = elements.concat(child.getElementsByTagName(tagName));
4300
+ }
4301
+ return elements;
4302
+ }
4303
+ }
4304
+ class RRImageElement extends RRElement {
4305
+ constructor() {
4306
+ super(...arguments);
4307
+ __publicField(this, "src", "");
4308
+ __publicField(this, "width", 0);
4309
+ __publicField(this, "height", 0);
4310
+ __publicField(this, "onload", null);
4311
+ }
4312
+ }
4313
+ class RRMediaElement extends BaseRRMediaElement {
4314
+ }
4315
+ class RRCanvasElement extends RRElement {
4316
+ /**
4317
+ * This is just a dummy implementation to prevent rrweb replayer from drawing mouse tail. If further analysis of canvas is needed, we may implement it with node-canvas.
4318
+ */
4319
+ getContext() {
4320
+ return null;
4321
+ }
4322
+ }
4323
+ class RRStyleElement extends RRElement {
4324
+ constructor() {
4325
+ super(...arguments);
4326
+ __publicField(this, "_sheet", null);
4327
+ }
4328
+ get sheet() {
4329
+ if (!this._sheet) {
4330
+ let result2 = "";
4331
+ for (const child of this.childNodes)
4332
+ if (child.RRNodeType === NodeType.Text)
4333
+ result2 += child.textContent;
4334
+ this._sheet = cssom.parse(result2);
4335
+ }
4336
+ return this._sheet;
4337
+ }
4338
+ }
4339
+ class RRIFrameElement extends RRElement {
4340
+ constructor(tagName) {
4341
+ super(tagName);
4342
+ __publicField(this, "width", "");
4343
+ __publicField(this, "height", "");
4344
+ __publicField(this, "src", "");
4345
+ __publicField(this, "contentDocument", new RRDocument());
4346
+ __publicField(this, "contentWindow", new RRWindow());
4347
+ const htmlElement = this.contentDocument.createElement("HTML");
4348
+ this.contentDocument.appendChild(htmlElement);
4349
+ htmlElement.appendChild(this.contentDocument.createElement("HEAD"));
4350
+ htmlElement.appendChild(this.contentDocument.createElement("BODY"));
4351
+ }
4352
+ }
4353
+ class RRText extends BaseRRText {
4354
+ constructor() {
4355
+ super(...arguments);
4356
+ __publicField(this, "nodeName", "#text");
4357
+ }
4358
+ }
4359
+ class RRComment extends BaseRRComment {
4360
+ constructor() {
4361
+ super(...arguments);
4362
+ __publicField(this, "nodeName", "#comment");
4363
+ }
4364
+ }
4365
+ class RRCDATASection extends BaseRRCDATASection {
4366
+ constructor() {
4367
+ super(...arguments);
4368
+ __publicField(this, "nodeName", "#cdata-section");
4369
+ }
4370
+ }
4371
+ function polyfillPerformance() {
4372
+ if (typeof window !== "undefined" || "performance" in global) return;
4373
+ const performance = require("perf_hooks").performance;
4374
+ global.performance = performance;
4375
+ }
4376
+ function polyfillRAF() {
4377
+ if (typeof window !== "undefined" || "requestAnimationFrame" in global)
4378
+ return;
4379
+ const FPS = 60, INTERVAL = 1e3 / FPS;
4380
+ let timeoutHandle = null, rafCount = 0, requests = /* @__PURE__ */ Object.create(null);
4381
+ function onFrameTimer() {
4382
+ const currentRequests = requests;
4383
+ requests = /* @__PURE__ */ Object.create(null);
4384
+ timeoutHandle = null;
4385
+ Object.keys(currentRequests).forEach(function(id) {
4386
+ const request = currentRequests[id];
4387
+ if (request) request(Date.now());
4388
+ });
4389
+ }
4390
+ function requestAnimationFrame(callback) {
4391
+ const cbHandle = ++rafCount;
4392
+ requests[cbHandle] = callback;
4393
+ if (timeoutHandle === null)
4394
+ timeoutHandle = setTimeout(onFrameTimer, INTERVAL);
4395
+ return cbHandle;
4396
+ }
4397
+ function cancelAnimationFrame(handleId) {
4398
+ delete requests[handleId];
4399
+ if (Object.keys(requests).length === 0 && timeoutHandle !== null) {
4400
+ clearTimeout(timeoutHandle);
4401
+ timeoutHandle = null;
4402
+ }
4403
+ }
4404
+ global.requestAnimationFrame = requestAnimationFrame;
4405
+ global.cancelAnimationFrame = cancelAnimationFrame;
4406
+ }
4407
+ function polyfillEvent() {
4408
+ if (typeof Event !== "undefined") return;
4409
+ global.Event = function() {
4410
+ };
4411
+ }
4412
+ function polyfillNode() {
4413
+ if (typeof Node !== "undefined") return;
4414
+ global.Node = BaseRRNode;
4415
+ }
4416
+ function polyfillDocument() {
4417
+ if (typeof document !== "undefined") return;
4418
+ const rrdom = new RRDocument();
4419
+ (() => {
4420
+ var _a, _b;
4421
+ rrdom.appendChild(rrdom.createElement("html"));
4422
+ (_a = rrdom.documentElement) == null ? void 0 : _a.appendChild(rrdom.createElement("head"));
4423
+ (_b = rrdom.documentElement) == null ? void 0 : _b.appendChild(rrdom.createElement("body"));
4424
+ })();
4425
+ global.document = rrdom;
4426
+ }
4427
+ polyfillPerformance();
4428
+ polyfillRAF();
4429
+ polyfillEvent();
4430
+ polyfillNode();
4431
+ polyfillDocument();
4432
+ export {
4433
+ RRCDATASection,
4434
+ RRCanvasElement,
4435
+ RRComment,
4436
+ RRDocument,
4437
+ RRDocumentType,
4438
+ RRElement,
4439
+ RRIFrameElement,
4440
+ RRImageElement,
4441
+ RRMediaElement,
4442
+ RRStyleElement,
4443
+ RRText,
4444
+ RRWindow
4445
+ };
4446
+ //# sourceMappingURL=rrdom-nodejs.js.map