@posthog/rrweb-player 0.0.33 → 0.0.35

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.
@@ -1,16 +1,4 @@
1
- (function (g, f) {
2
- if ("object" == typeof exports && "object" == typeof module) {
3
- module.exports = f();
4
- } else if ("function" == typeof define && define.amd) {
5
- define("rrwebPlayer", [], f);
6
- } else if ("object" == typeof exports) {
7
- exports["rrwebPlayer"] = f();
8
- } else {
9
- g["rrwebPlayer"] = f();
10
- }
11
- }(this, () => {
12
- var exports = {};
13
- var module = { exports };
1
+ (function (g, f) {if ("object" == typeof exports && "object" == typeof module) {module.exports = f();} else if ("function" == typeof define && define.amd) {define("rrwebPlayer", [], f);} else if ("object" == typeof exports) {exports["rrwebPlayer"] = f();} else {g["rrwebPlayer"] = f();}}(typeof self !== 'undefined' ? self : typeof globalThis !== 'undefined' ? globalThis : this, () => {var exports = {};var module = { exports };
14
2
  "use strict";
15
3
  var __defProp = Object.defineProperty;
16
4
  var __defProps = Object.defineProperties;
@@ -570,7 +558,7 @@ function getDefaultExportFromCjs$1(x) {
570
558
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
571
559
  }
572
560
  function getAugmentedNamespace$1(n2) {
573
- if (n2.__esModule) return n2;
561
+ if (Object.prototype.hasOwnProperty.call(n2, "__esModule")) return n2;
574
562
  var f2 = n2.default;
575
563
  if (typeof f2 == "function") {
576
564
  var a2 = function a3() {
@@ -1089,6 +1077,9 @@ function requireNode$1() {
1089
1077
  return offset;
1090
1078
  }
1091
1079
  class Node2 {
1080
+ get proxyOf() {
1081
+ return this;
1082
+ }
1092
1083
  constructor(defaults = {}) {
1093
1084
  this.raws = {};
1094
1085
  this[isClean] = false;
@@ -1207,7 +1198,7 @@ function requireNode$1() {
1207
1198
  let index2 = this.parent.index(this);
1208
1199
  return this.parent.nodes[index2 + 1];
1209
1200
  }
1210
- positionBy(opts) {
1201
+ positionBy(opts = {}) {
1211
1202
  let pos = this.source.start;
1212
1203
  if (opts.index) {
1213
1204
  pos = this.positionInside(opts.index);
@@ -1236,27 +1227,38 @@ function requireNode$1() {
1236
1227
  column += 1;
1237
1228
  }
1238
1229
  }
1239
- return { column, line };
1230
+ return { column, line, offset: end };
1240
1231
  }
1241
1232
  prev() {
1242
1233
  if (!this.parent) return void 0;
1243
1234
  let index2 = this.parent.index(this);
1244
1235
  return this.parent.nodes[index2 - 1];
1245
1236
  }
1246
- rangeBy(opts) {
1237
+ rangeBy(opts = {}) {
1238
+ let inputString = "document" in this.source.input ? this.source.input.document : this.source.input.css;
1247
1239
  let start = {
1248
1240
  column: this.source.start.column,
1249
- line: this.source.start.line
1241
+ line: this.source.start.line,
1242
+ offset: sourceOffset(inputString, this.source.start)
1250
1243
  };
1251
1244
  let end = this.source.end ? {
1252
1245
  column: this.source.end.column + 1,
1253
- line: this.source.end.line
1246
+ line: this.source.end.line,
1247
+ offset: typeof this.source.end.offset === "number" ? (
1248
+ // `source.end.offset` is exclusive, so we don't need to add 1
1249
+ this.source.end.offset
1250
+ ) : (
1251
+ // Since line/column in this.source.end is inclusive,
1252
+ // the `sourceOffset(... , this.source.end)` returns an inclusive offset.
1253
+ // So, we add 1 to convert it to exclusive.
1254
+ sourceOffset(inputString, this.source.end) + 1
1255
+ )
1254
1256
  } : {
1255
1257
  column: start.column + 1,
1256
- line: start.line
1258
+ line: start.line,
1259
+ offset: start.offset + 1
1257
1260
  };
1258
1261
  if (opts.word) {
1259
- let inputString = "document" in this.source.input ? this.source.input.document : this.source.input.css;
1260
1262
  let stringRepresentation = inputString.slice(
1261
1263
  sourceOffset(inputString, this.source.start),
1262
1264
  sourceOffset(inputString, this.source.end)
@@ -1264,15 +1266,14 @@ function requireNode$1() {
1264
1266
  let index2 = stringRepresentation.indexOf(opts.word);
1265
1267
  if (index2 !== -1) {
1266
1268
  start = this.positionInside(index2);
1267
- end = this.positionInside(
1268
- index2 + opts.word.length
1269
- );
1269
+ end = this.positionInside(index2 + opts.word.length);
1270
1270
  }
1271
1271
  } else {
1272
1272
  if (opts.start) {
1273
1273
  start = {
1274
1274
  column: opts.start.column,
1275
- line: opts.start.line
1275
+ line: opts.start.line,
1276
+ offset: sourceOffset(inputString, opts.start)
1276
1277
  };
1277
1278
  } else if (opts.index) {
1278
1279
  start = this.positionInside(opts.index);
@@ -1280,7 +1281,8 @@ function requireNode$1() {
1280
1281
  if (opts.end) {
1281
1282
  end = {
1282
1283
  column: opts.end.column,
1283
- line: opts.end.line
1284
+ line: opts.end.line,
1285
+ offset: sourceOffset(inputString, opts.end)
1284
1286
  };
1285
1287
  } else if (typeof opts.endIndex === "number") {
1286
1288
  end = this.positionInside(opts.endIndex);
@@ -1289,7 +1291,11 @@ function requireNode$1() {
1289
1291
  }
1290
1292
  }
1291
1293
  if (end.line < start.line || end.line === start.line && end.column <= start.column) {
1292
- end = { column: start.column + 1, line: start.line };
1294
+ end = {
1295
+ column: start.column + 1,
1296
+ line: start.line,
1297
+ offset: start.offset + 1
1298
+ };
1293
1299
  }
1294
1300
  return { end, start };
1295
1301
  }
@@ -1353,6 +1359,7 @@ function requireNode$1() {
1353
1359
  } else if (typeof value === "object" && value.toJSON) {
1354
1360
  fixed[name] = value.toJSON(null, inputs);
1355
1361
  } else if (name === "source") {
1362
+ if (value == null) continue;
1356
1363
  let inputId = inputs.get(value.input);
1357
1364
  if (inputId == null) {
1358
1365
  inputId = inputsNextIndex;
@@ -1387,14 +1394,11 @@ function requireNode$1() {
1387
1394
  });
1388
1395
  return result2;
1389
1396
  }
1390
- warn(result2, text2, opts) {
1397
+ warn(result2, text2, opts = {}) {
1391
1398
  let data = { node: this };
1392
1399
  for (let i2 in opts) data[i2] = opts[i2];
1393
1400
  return result2.warn(text2, data);
1394
1401
  }
1395
- get proxyOf() {
1396
- return this;
1397
- }
1398
1402
  }
1399
1403
  node$1 = Node2;
1400
1404
  Node2.default = Node2;
@@ -1423,6 +1427,9 @@ function requireDeclaration$1() {
1423
1427
  hasRequiredDeclaration$1 = 1;
1424
1428
  let Node2 = requireNode$1();
1425
1429
  class Declaration extends Node2 {
1430
+ get variable() {
1431
+ return this.prop.startsWith("--") || this.prop[0] === "$";
1432
+ }
1426
1433
  constructor(defaults) {
1427
1434
  if (defaults && typeof defaults.value !== "undefined" && typeof defaults.value !== "string") {
1428
1435
  defaults = __spreadProps(__spreadValues({}, defaults), { value: String(defaults.value) });
@@ -1430,9 +1437,6 @@ function requireDeclaration$1() {
1430
1437
  super(defaults);
1431
1438
  this.type = "decl";
1432
1439
  }
1433
- get variable() {
1434
- return this.prop.startsWith("--") || this.prop[0] === "$";
1435
- }
1436
1440
  }
1437
1441
  declaration$1 = Declaration;
1438
1442
  Declaration.default = Declaration;
@@ -1464,6 +1468,14 @@ function requireContainer$1() {
1464
1468
  }
1465
1469
  }
1466
1470
  class Container extends Node2 {
1471
+ get first() {
1472
+ if (!this.proxyOf.nodes) return void 0;
1473
+ return this.proxyOf.nodes[0];
1474
+ }
1475
+ get last() {
1476
+ if (!this.proxyOf.nodes) return void 0;
1477
+ return this.proxyOf.nodes[this.proxyOf.nodes.length - 1];
1478
+ }
1467
1479
  append(...children2) {
1468
1480
  for (let child of children2) {
1469
1481
  let nodes = this.normalize(child, this.last);
@@ -1776,14 +1788,6 @@ function requireContainer$1() {
1776
1788
  }
1777
1789
  });
1778
1790
  }
1779
- get first() {
1780
- if (!this.proxyOf.nodes) return void 0;
1781
- return this.proxyOf.nodes[0];
1782
- }
1783
- get last() {
1784
- if (!this.proxyOf.nodes) return void 0;
1785
- return this.proxyOf.nodes[this.proxyOf.nodes.length - 1];
1786
- }
1787
1791
  }
1788
1792
  Container.registerParse = (dependant) => {
1789
1793
  parse = dependant;
@@ -2033,10 +2037,25 @@ function requireInput$1() {
2033
2037
  let CssSyntaxError = requireCssSyntaxError$1();
2034
2038
  let PreviousMap = requirePreviousMap$1();
2035
2039
  let terminalHighlight = require$$2$1;
2036
- let fromOffsetCache = Symbol("fromOffsetCache");
2040
+ let lineToIndexCache = Symbol("lineToIndexCache");
2037
2041
  let sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator);
2038
2042
  let pathAvailable = Boolean(resolve && isAbsolute);
2043
+ function getLineToIndex(input2) {
2044
+ if (input2[lineToIndexCache]) return input2[lineToIndexCache];
2045
+ let lines = input2.css.split("\n");
2046
+ let lineToIndex = new Array(lines.length);
2047
+ let prevIndex = 0;
2048
+ for (let i2 = 0, l2 = lines.length; i2 < l2; i2++) {
2049
+ lineToIndex[i2] = prevIndex;
2050
+ prevIndex += lines[i2].length + 1;
2051
+ }
2052
+ input2[lineToIndexCache] = lineToIndex;
2053
+ return lineToIndex;
2054
+ }
2039
2055
  class Input {
2056
+ get from() {
2057
+ return this.file || this.id;
2058
+ }
2040
2059
  constructor(css, opts = {}) {
2041
2060
  if (css === null || typeof css === "undefined" || typeof css === "object" && !css.toString) {
2042
2061
  throw new Error(`PostCSS received ${css} instead of CSS string`);
@@ -2071,30 +2090,37 @@ function requireInput$1() {
2071
2090
  if (this.map) this.map.file = this.from;
2072
2091
  }
2073
2092
  error(message, line, column, opts = {}) {
2074
- let endColumn, endLine, result2;
2093
+ let endColumn, endLine, endOffset, offset, result2;
2075
2094
  if (line && typeof line === "object") {
2076
2095
  let start = line;
2077
2096
  let end = column;
2078
2097
  if (typeof start.offset === "number") {
2079
- let pos = this.fromOffset(start.offset);
2098
+ offset = start.offset;
2099
+ let pos = this.fromOffset(offset);
2080
2100
  line = pos.line;
2081
2101
  column = pos.col;
2082
2102
  } else {
2083
2103
  line = start.line;
2084
2104
  column = start.column;
2105
+ offset = this.fromLineAndColumn(line, column);
2085
2106
  }
2086
2107
  if (typeof end.offset === "number") {
2087
- let pos = this.fromOffset(end.offset);
2108
+ endOffset = end.offset;
2109
+ let pos = this.fromOffset(endOffset);
2088
2110
  endLine = pos.line;
2089
2111
  endColumn = pos.col;
2090
2112
  } else {
2091
2113
  endLine = end.line;
2092
2114
  endColumn = end.column;
2115
+ endOffset = this.fromLineAndColumn(end.line, end.column);
2093
2116
  }
2094
2117
  } else if (!column) {
2095
- let pos = this.fromOffset(line);
2118
+ offset = line;
2119
+ let pos = this.fromOffset(offset);
2096
2120
  line = pos.line;
2097
2121
  column = pos.col;
2122
+ } else {
2123
+ offset = this.fromLineAndColumn(line, column);
2098
2124
  }
2099
2125
  let origin = this.origin(line, column, endLine, endColumn);
2100
2126
  if (origin) {
@@ -2116,7 +2142,7 @@ function requireInput$1() {
2116
2142
  opts.plugin
2117
2143
  );
2118
2144
  }
2119
- result2.input = { column, endColumn, endLine, line, source: this.css };
2145
+ result2.input = { column, endColumn, endLine, endOffset, line, offset, source: this.css };
2120
2146
  if (this.file) {
2121
2147
  if (pathToFileURL) {
2122
2148
  result2.input.url = pathToFileURL(this.file).toString();
@@ -2125,21 +2151,14 @@ function requireInput$1() {
2125
2151
  }
2126
2152
  return result2;
2127
2153
  }
2154
+ fromLineAndColumn(line, column) {
2155
+ let lineToIndex = getLineToIndex(this);
2156
+ let index2 = lineToIndex[line - 1];
2157
+ return index2 + column - 1;
2158
+ }
2128
2159
  fromOffset(offset) {
2129
- let lastLine, lineToIndex;
2130
- if (!this[fromOffsetCache]) {
2131
- let lines = this.css.split("\n");
2132
- lineToIndex = new Array(lines.length);
2133
- let prevIndex = 0;
2134
- for (let i2 = 0, l2 = lines.length; i2 < l2; i2++) {
2135
- lineToIndex[i2] = prevIndex;
2136
- prevIndex += lines[i2].length + 1;
2137
- }
2138
- this[fromOffsetCache] = lineToIndex;
2139
- } else {
2140
- lineToIndex = this[fromOffsetCache];
2141
- }
2142
- lastLine = lineToIndex[lineToIndex.length - 1];
2160
+ let lineToIndex = getLineToIndex(this);
2161
+ let lastLine = lineToIndex[lineToIndex.length - 1];
2143
2162
  let min = 0;
2144
2163
  if (offset >= lastLine) {
2145
2164
  min = lineToIndex.length - 1;
@@ -2220,9 +2239,6 @@ function requireInput$1() {
2220
2239
  }
2221
2240
  return json;
2222
2241
  }
2223
- get from() {
2224
- return this.file || this.id;
2225
- }
2226
2242
  }
2227
2243
  input$1 = Input;
2228
2244
  Input.default = Input;
@@ -2348,11 +2364,6 @@ function requireRule$1() {
2348
2364
  let Container = requireContainer$1();
2349
2365
  let list = requireList$1();
2350
2366
  class Rule extends Container {
2351
- constructor(defaults) {
2352
- super(defaults);
2353
- this.type = "rule";
2354
- if (!this.nodes) this.nodes = [];
2355
- }
2356
2367
  get selectors() {
2357
2368
  return list.comma(this.selector);
2358
2369
  }
@@ -2361,6 +2372,11 @@ function requireRule$1() {
2361
2372
  let sep = match ? match[0] : "," + this.raw("between", "beforeOpen");
2362
2373
  this.selector = values.join(sep);
2363
2374
  }
2375
+ constructor(defaults) {
2376
+ super(defaults);
2377
+ this.type = "rule";
2378
+ if (!this.nodes) this.nodes = [];
2379
+ }
2364
2380
  }
2365
2381
  rule$1 = Rule;
2366
2382
  Rule.default = Rule;
@@ -3259,6 +3275,8 @@ function requireParser$1() {
3259
3275
  if (prev && prev.type === "rule" && !prev.raws.ownSemicolon) {
3260
3276
  prev.raws.ownSemicolon = this.spaces;
3261
3277
  this.spaces = "";
3278
+ prev.source.end = this.getPosition(token[2]);
3279
+ prev.source.end.offset += prev.raws.ownSemicolon.length;
3262
3280
  }
3263
3281
  }
3264
3282
  }
@@ -3470,7 +3488,7 @@ function requireParser$1() {
3470
3488
  }
3471
3489
  unknownWord(tokens) {
3472
3490
  throw this.input.error(
3473
- "Unknown word",
3491
+ "Unknown word " + tokens[0][1],
3474
3492
  { offset: tokens[0][2] },
3475
3493
  { offset: tokens[0][2] + tokens[0][1].length }
3476
3494
  );
@@ -3563,12 +3581,15 @@ function requireResult$1() {
3563
3581
  hasRequiredResult$1 = 1;
3564
3582
  let Warning = requireWarning$1();
3565
3583
  class Result {
3584
+ get content() {
3585
+ return this.css;
3586
+ }
3566
3587
  constructor(processor2, root2, opts) {
3567
3588
  this.processor = processor2;
3568
3589
  this.messages = [];
3569
3590
  this.root = root2;
3570
3591
  this.opts = opts;
3571
- this.css = void 0;
3592
+ this.css = "";
3572
3593
  this.map = void 0;
3573
3594
  }
3574
3595
  toString() {
@@ -3587,9 +3608,6 @@ function requireResult$1() {
3587
3608
  warnings() {
3588
3609
  return this.messages.filter((i2) => i2.type === "warning");
3589
3610
  }
3590
- get content() {
3591
- return this.css;
3592
- }
3593
3611
  }
3594
3612
  result$1 = Result;
3595
3613
  Result.default = Result;
@@ -3708,6 +3726,30 @@ function requireLazyResult$1() {
3708
3726
  }
3709
3727
  let postcss2 = {};
3710
3728
  class LazyResult {
3729
+ get content() {
3730
+ return this.stringify().content;
3731
+ }
3732
+ get css() {
3733
+ return this.stringify().css;
3734
+ }
3735
+ get map() {
3736
+ return this.stringify().map;
3737
+ }
3738
+ get messages() {
3739
+ return this.sync().messages;
3740
+ }
3741
+ get opts() {
3742
+ return this.result.opts;
3743
+ }
3744
+ get processor() {
3745
+ return this.result.processor;
3746
+ }
3747
+ get root() {
3748
+ return this.sync().root;
3749
+ }
3750
+ get [Symbol.toStringTag]() {
3751
+ return "LazyResult";
3752
+ }
3711
3753
  constructor(processor2, css, opts) {
3712
3754
  this.stringified = false;
3713
3755
  this.processed = false;
@@ -4050,30 +4092,6 @@ function requireLazyResult$1() {
4050
4092
  warnings() {
4051
4093
  return this.sync().warnings();
4052
4094
  }
4053
- get content() {
4054
- return this.stringify().content;
4055
- }
4056
- get css() {
4057
- return this.stringify().css;
4058
- }
4059
- get map() {
4060
- return this.stringify().map;
4061
- }
4062
- get messages() {
4063
- return this.sync().messages;
4064
- }
4065
- get opts() {
4066
- return this.result.opts;
4067
- }
4068
- get processor() {
4069
- return this.result.processor;
4070
- }
4071
- get root() {
4072
- return this.sync().root;
4073
- }
4074
- get [Symbol.toStringTag]() {
4075
- return "LazyResult";
4076
- }
4077
4095
  }
4078
4096
  LazyResult.registerPostcss = (dependant) => {
4079
4097
  postcss2 = dependant;
@@ -4095,6 +4113,45 @@ function requireNoWorkResult$1() {
4095
4113
  let stringify = requireStringify$1();
4096
4114
  let warnOnce2 = requireWarnOnce$1();
4097
4115
  class NoWorkResult {
4116
+ get content() {
4117
+ return this.result.css;
4118
+ }
4119
+ get css() {
4120
+ return this.result.css;
4121
+ }
4122
+ get map() {
4123
+ return this.result.map;
4124
+ }
4125
+ get messages() {
4126
+ return [];
4127
+ }
4128
+ get opts() {
4129
+ return this.result.opts;
4130
+ }
4131
+ get processor() {
4132
+ return this.result.processor;
4133
+ }
4134
+ get root() {
4135
+ if (this._root) {
4136
+ return this._root;
4137
+ }
4138
+ let root2;
4139
+ let parser2 = parse;
4140
+ try {
4141
+ root2 = parser2(this._css, this._opts);
4142
+ } catch (error) {
4143
+ this.error = error;
4144
+ }
4145
+ if (this.error) {
4146
+ throw this.error;
4147
+ } else {
4148
+ this._root = root2;
4149
+ return root2;
4150
+ }
4151
+ }
4152
+ get [Symbol.toStringTag]() {
4153
+ return "NoWorkResult";
4154
+ }
4098
4155
  constructor(processor2, css, opts) {
4099
4156
  css = css.toString();
4100
4157
  this.stringified = false;
@@ -4156,45 +4213,6 @@ function requireNoWorkResult$1() {
4156
4213
  warnings() {
4157
4214
  return [];
4158
4215
  }
4159
- get content() {
4160
- return this.result.css;
4161
- }
4162
- get css() {
4163
- return this.result.css;
4164
- }
4165
- get map() {
4166
- return this.result.map;
4167
- }
4168
- get messages() {
4169
- return [];
4170
- }
4171
- get opts() {
4172
- return this.result.opts;
4173
- }
4174
- get processor() {
4175
- return this.result.processor;
4176
- }
4177
- get root() {
4178
- if (this._root) {
4179
- return this._root;
4180
- }
4181
- let root2;
4182
- let parser2 = parse;
4183
- try {
4184
- root2 = parser2(this._css, this._opts);
4185
- } catch (error) {
4186
- this.error = error;
4187
- }
4188
- if (this.error) {
4189
- throw this.error;
4190
- } else {
4191
- this._root = root2;
4192
- return root2;
4193
- }
4194
- }
4195
- get [Symbol.toStringTag]() {
4196
- return "NoWorkResult";
4197
- }
4198
4216
  }
4199
4217
  noWorkResult$1 = NoWorkResult;
4200
4218
  NoWorkResult.default = NoWorkResult;
@@ -4211,7 +4229,7 @@ function requireProcessor$1() {
4211
4229
  let Root = requireRoot$1();
4212
4230
  class Processor {
4213
4231
  constructor(plugins = []) {
4214
- this.version = "8.5.1";
4232
+ this.version = "8.5.6";
4215
4233
  this.plugins = this.normalize(plugins);
4216
4234
  }
4217
4235
  normalize(plugins) {
@@ -4667,6 +4685,12 @@ function buildNode(n2, options) {
4667
4685
  node2.style.setProperty("width", value.toString());
4668
4686
  } else if (name === "rr_height") {
4669
4687
  node2.style.setProperty("height", value.toString());
4688
+ } else if (name === "rr_left") {
4689
+ node2.style.setProperty("left", value.toString());
4690
+ node2.style.setProperty("position", "absolute");
4691
+ } else if (name === "rr_top") {
4692
+ node2.style.setProperty("top", value.toString());
4693
+ node2.style.setProperty("position", "absolute");
4670
4694
  } else if (name === "rr_mediaCurrentTime" && typeof value === "number") {
4671
4695
  node2.currentTime = value;
4672
4696
  } else if (name === "rr_mediaState") {
@@ -4926,7 +4950,7 @@ function getDefaultExportFromCjs(x) {
4926
4950
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
4927
4951
  }
4928
4952
  function getAugmentedNamespace(n2) {
4929
- if (n2.__esModule) return n2;
4953
+ if (Object.prototype.hasOwnProperty.call(n2, "__esModule")) return n2;
4930
4954
  var f2 = n2.default;
4931
4955
  if (typeof f2 == "function") {
4932
4956
  var a2 = function a3() {
@@ -5445,6 +5469,9 @@ function requireNode() {
5445
5469
  return offset;
5446
5470
  }
5447
5471
  class Node2 {
5472
+ get proxyOf() {
5473
+ return this;
5474
+ }
5448
5475
  constructor(defaults = {}) {
5449
5476
  this.raws = {};
5450
5477
  this[isClean] = false;
@@ -5563,7 +5590,7 @@ function requireNode() {
5563
5590
  let index2 = this.parent.index(this);
5564
5591
  return this.parent.nodes[index2 + 1];
5565
5592
  }
5566
- positionBy(opts) {
5593
+ positionBy(opts = {}) {
5567
5594
  let pos = this.source.start;
5568
5595
  if (opts.index) {
5569
5596
  pos = this.positionInside(opts.index);
@@ -5592,27 +5619,38 @@ function requireNode() {
5592
5619
  column += 1;
5593
5620
  }
5594
5621
  }
5595
- return { column, line };
5622
+ return { column, line, offset: end };
5596
5623
  }
5597
5624
  prev() {
5598
5625
  if (!this.parent) return void 0;
5599
5626
  let index2 = this.parent.index(this);
5600
5627
  return this.parent.nodes[index2 - 1];
5601
5628
  }
5602
- rangeBy(opts) {
5629
+ rangeBy(opts = {}) {
5630
+ let inputString = "document" in this.source.input ? this.source.input.document : this.source.input.css;
5603
5631
  let start = {
5604
5632
  column: this.source.start.column,
5605
- line: this.source.start.line
5633
+ line: this.source.start.line,
5634
+ offset: sourceOffset(inputString, this.source.start)
5606
5635
  };
5607
5636
  let end = this.source.end ? {
5608
5637
  column: this.source.end.column + 1,
5609
- line: this.source.end.line
5638
+ line: this.source.end.line,
5639
+ offset: typeof this.source.end.offset === "number" ? (
5640
+ // `source.end.offset` is exclusive, so we don't need to add 1
5641
+ this.source.end.offset
5642
+ ) : (
5643
+ // Since line/column in this.source.end is inclusive,
5644
+ // the `sourceOffset(... , this.source.end)` returns an inclusive offset.
5645
+ // So, we add 1 to convert it to exclusive.
5646
+ sourceOffset(inputString, this.source.end) + 1
5647
+ )
5610
5648
  } : {
5611
5649
  column: start.column + 1,
5612
- line: start.line
5650
+ line: start.line,
5651
+ offset: start.offset + 1
5613
5652
  };
5614
5653
  if (opts.word) {
5615
- let inputString = "document" in this.source.input ? this.source.input.document : this.source.input.css;
5616
5654
  let stringRepresentation = inputString.slice(
5617
5655
  sourceOffset(inputString, this.source.start),
5618
5656
  sourceOffset(inputString, this.source.end)
@@ -5620,15 +5658,14 @@ function requireNode() {
5620
5658
  let index2 = stringRepresentation.indexOf(opts.word);
5621
5659
  if (index2 !== -1) {
5622
5660
  start = this.positionInside(index2);
5623
- end = this.positionInside(
5624
- index2 + opts.word.length
5625
- );
5661
+ end = this.positionInside(index2 + opts.word.length);
5626
5662
  }
5627
5663
  } else {
5628
5664
  if (opts.start) {
5629
5665
  start = {
5630
5666
  column: opts.start.column,
5631
- line: opts.start.line
5667
+ line: opts.start.line,
5668
+ offset: sourceOffset(inputString, opts.start)
5632
5669
  };
5633
5670
  } else if (opts.index) {
5634
5671
  start = this.positionInside(opts.index);
@@ -5636,7 +5673,8 @@ function requireNode() {
5636
5673
  if (opts.end) {
5637
5674
  end = {
5638
5675
  column: opts.end.column,
5639
- line: opts.end.line
5676
+ line: opts.end.line,
5677
+ offset: sourceOffset(inputString, opts.end)
5640
5678
  };
5641
5679
  } else if (typeof opts.endIndex === "number") {
5642
5680
  end = this.positionInside(opts.endIndex);
@@ -5645,7 +5683,11 @@ function requireNode() {
5645
5683
  }
5646
5684
  }
5647
5685
  if (end.line < start.line || end.line === start.line && end.column <= start.column) {
5648
- end = { column: start.column + 1, line: start.line };
5686
+ end = {
5687
+ column: start.column + 1,
5688
+ line: start.line,
5689
+ offset: start.offset + 1
5690
+ };
5649
5691
  }
5650
5692
  return { end, start };
5651
5693
  }
@@ -5709,6 +5751,7 @@ function requireNode() {
5709
5751
  } else if (typeof value === "object" && value.toJSON) {
5710
5752
  fixed[name] = value.toJSON(null, inputs);
5711
5753
  } else if (name === "source") {
5754
+ if (value == null) continue;
5712
5755
  let inputId = inputs.get(value.input);
5713
5756
  if (inputId == null) {
5714
5757
  inputId = inputsNextIndex;
@@ -5743,14 +5786,11 @@ function requireNode() {
5743
5786
  });
5744
5787
  return result2;
5745
5788
  }
5746
- warn(result2, text2, opts) {
5789
+ warn(result2, text2, opts = {}) {
5747
5790
  let data = { node: this };
5748
5791
  for (let i2 in opts) data[i2] = opts[i2];
5749
5792
  return result2.warn(text2, data);
5750
5793
  }
5751
- get proxyOf() {
5752
- return this;
5753
- }
5754
5794
  }
5755
5795
  node = Node2;
5756
5796
  Node2.default = Node2;
@@ -5779,6 +5819,9 @@ function requireDeclaration() {
5779
5819
  hasRequiredDeclaration = 1;
5780
5820
  let Node2 = requireNode();
5781
5821
  class Declaration extends Node2 {
5822
+ get variable() {
5823
+ return this.prop.startsWith("--") || this.prop[0] === "$";
5824
+ }
5782
5825
  constructor(defaults) {
5783
5826
  if (defaults && typeof defaults.value !== "undefined" && typeof defaults.value !== "string") {
5784
5827
  defaults = __spreadProps(__spreadValues({}, defaults), { value: String(defaults.value) });
@@ -5786,9 +5829,6 @@ function requireDeclaration() {
5786
5829
  super(defaults);
5787
5830
  this.type = "decl";
5788
5831
  }
5789
- get variable() {
5790
- return this.prop.startsWith("--") || this.prop[0] === "$";
5791
- }
5792
5832
  }
5793
5833
  declaration = Declaration;
5794
5834
  Declaration.default = Declaration;
@@ -5820,6 +5860,14 @@ function requireContainer() {
5820
5860
  }
5821
5861
  }
5822
5862
  class Container extends Node2 {
5863
+ get first() {
5864
+ if (!this.proxyOf.nodes) return void 0;
5865
+ return this.proxyOf.nodes[0];
5866
+ }
5867
+ get last() {
5868
+ if (!this.proxyOf.nodes) return void 0;
5869
+ return this.proxyOf.nodes[this.proxyOf.nodes.length - 1];
5870
+ }
5823
5871
  append(...children2) {
5824
5872
  for (let child of children2) {
5825
5873
  let nodes = this.normalize(child, this.last);
@@ -6132,14 +6180,6 @@ function requireContainer() {
6132
6180
  }
6133
6181
  });
6134
6182
  }
6135
- get first() {
6136
- if (!this.proxyOf.nodes) return void 0;
6137
- return this.proxyOf.nodes[0];
6138
- }
6139
- get last() {
6140
- if (!this.proxyOf.nodes) return void 0;
6141
- return this.proxyOf.nodes[this.proxyOf.nodes.length - 1];
6142
- }
6143
6183
  }
6144
6184
  Container.registerParse = (dependant) => {
6145
6185
  parse = dependant;
@@ -6389,10 +6429,25 @@ function requireInput() {
6389
6429
  let CssSyntaxError = requireCssSyntaxError();
6390
6430
  let PreviousMap = requirePreviousMap();
6391
6431
  let terminalHighlight = require$$2;
6392
- let fromOffsetCache = Symbol("fromOffsetCache");
6432
+ let lineToIndexCache = Symbol("lineToIndexCache");
6393
6433
  let sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator);
6394
6434
  let pathAvailable = Boolean(resolve && isAbsolute);
6435
+ function getLineToIndex(input2) {
6436
+ if (input2[lineToIndexCache]) return input2[lineToIndexCache];
6437
+ let lines = input2.css.split("\n");
6438
+ let lineToIndex = new Array(lines.length);
6439
+ let prevIndex = 0;
6440
+ for (let i2 = 0, l2 = lines.length; i2 < l2; i2++) {
6441
+ lineToIndex[i2] = prevIndex;
6442
+ prevIndex += lines[i2].length + 1;
6443
+ }
6444
+ input2[lineToIndexCache] = lineToIndex;
6445
+ return lineToIndex;
6446
+ }
6395
6447
  class Input {
6448
+ get from() {
6449
+ return this.file || this.id;
6450
+ }
6396
6451
  constructor(css, opts = {}) {
6397
6452
  if (css === null || typeof css === "undefined" || typeof css === "object" && !css.toString) {
6398
6453
  throw new Error(`PostCSS received ${css} instead of CSS string`);
@@ -6427,30 +6482,37 @@ function requireInput() {
6427
6482
  if (this.map) this.map.file = this.from;
6428
6483
  }
6429
6484
  error(message, line, column, opts = {}) {
6430
- let endColumn, endLine, result2;
6485
+ let endColumn, endLine, endOffset, offset, result2;
6431
6486
  if (line && typeof line === "object") {
6432
6487
  let start = line;
6433
6488
  let end = column;
6434
6489
  if (typeof start.offset === "number") {
6435
- let pos = this.fromOffset(start.offset);
6490
+ offset = start.offset;
6491
+ let pos = this.fromOffset(offset);
6436
6492
  line = pos.line;
6437
6493
  column = pos.col;
6438
6494
  } else {
6439
6495
  line = start.line;
6440
6496
  column = start.column;
6497
+ offset = this.fromLineAndColumn(line, column);
6441
6498
  }
6442
6499
  if (typeof end.offset === "number") {
6443
- let pos = this.fromOffset(end.offset);
6500
+ endOffset = end.offset;
6501
+ let pos = this.fromOffset(endOffset);
6444
6502
  endLine = pos.line;
6445
6503
  endColumn = pos.col;
6446
6504
  } else {
6447
6505
  endLine = end.line;
6448
6506
  endColumn = end.column;
6507
+ endOffset = this.fromLineAndColumn(end.line, end.column);
6449
6508
  }
6450
6509
  } else if (!column) {
6451
- let pos = this.fromOffset(line);
6510
+ offset = line;
6511
+ let pos = this.fromOffset(offset);
6452
6512
  line = pos.line;
6453
6513
  column = pos.col;
6514
+ } else {
6515
+ offset = this.fromLineAndColumn(line, column);
6454
6516
  }
6455
6517
  let origin = this.origin(line, column, endLine, endColumn);
6456
6518
  if (origin) {
@@ -6472,7 +6534,7 @@ function requireInput() {
6472
6534
  opts.plugin
6473
6535
  );
6474
6536
  }
6475
- result2.input = { column, endColumn, endLine, line, source: this.css };
6537
+ result2.input = { column, endColumn, endLine, endOffset, line, offset, source: this.css };
6476
6538
  if (this.file) {
6477
6539
  if (pathToFileURL) {
6478
6540
  result2.input.url = pathToFileURL(this.file).toString();
@@ -6481,21 +6543,14 @@ function requireInput() {
6481
6543
  }
6482
6544
  return result2;
6483
6545
  }
6546
+ fromLineAndColumn(line, column) {
6547
+ let lineToIndex = getLineToIndex(this);
6548
+ let index2 = lineToIndex[line - 1];
6549
+ return index2 + column - 1;
6550
+ }
6484
6551
  fromOffset(offset) {
6485
- let lastLine, lineToIndex;
6486
- if (!this[fromOffsetCache]) {
6487
- let lines = this.css.split("\n");
6488
- lineToIndex = new Array(lines.length);
6489
- let prevIndex = 0;
6490
- for (let i2 = 0, l2 = lines.length; i2 < l2; i2++) {
6491
- lineToIndex[i2] = prevIndex;
6492
- prevIndex += lines[i2].length + 1;
6493
- }
6494
- this[fromOffsetCache] = lineToIndex;
6495
- } else {
6496
- lineToIndex = this[fromOffsetCache];
6497
- }
6498
- lastLine = lineToIndex[lineToIndex.length - 1];
6552
+ let lineToIndex = getLineToIndex(this);
6553
+ let lastLine = lineToIndex[lineToIndex.length - 1];
6499
6554
  let min = 0;
6500
6555
  if (offset >= lastLine) {
6501
6556
  min = lineToIndex.length - 1;
@@ -6576,9 +6631,6 @@ function requireInput() {
6576
6631
  }
6577
6632
  return json;
6578
6633
  }
6579
- get from() {
6580
- return this.file || this.id;
6581
- }
6582
6634
  }
6583
6635
  input = Input;
6584
6636
  Input.default = Input;
@@ -6704,11 +6756,6 @@ function requireRule() {
6704
6756
  let Container = requireContainer();
6705
6757
  let list = requireList();
6706
6758
  class Rule extends Container {
6707
- constructor(defaults) {
6708
- super(defaults);
6709
- this.type = "rule";
6710
- if (!this.nodes) this.nodes = [];
6711
- }
6712
6759
  get selectors() {
6713
6760
  return list.comma(this.selector);
6714
6761
  }
@@ -6717,6 +6764,11 @@ function requireRule() {
6717
6764
  let sep = match ? match[0] : "," + this.raw("between", "beforeOpen");
6718
6765
  this.selector = values.join(sep);
6719
6766
  }
6767
+ constructor(defaults) {
6768
+ super(defaults);
6769
+ this.type = "rule";
6770
+ if (!this.nodes) this.nodes = [];
6771
+ }
6720
6772
  }
6721
6773
  rule = Rule;
6722
6774
  Rule.default = Rule;
@@ -7615,6 +7667,8 @@ function requireParser() {
7615
7667
  if (prev && prev.type === "rule" && !prev.raws.ownSemicolon) {
7616
7668
  prev.raws.ownSemicolon = this.spaces;
7617
7669
  this.spaces = "";
7670
+ prev.source.end = this.getPosition(token[2]);
7671
+ prev.source.end.offset += prev.raws.ownSemicolon.length;
7618
7672
  }
7619
7673
  }
7620
7674
  }
@@ -7826,7 +7880,7 @@ function requireParser() {
7826
7880
  }
7827
7881
  unknownWord(tokens) {
7828
7882
  throw this.input.error(
7829
- "Unknown word",
7883
+ "Unknown word " + tokens[0][1],
7830
7884
  { offset: tokens[0][2] },
7831
7885
  { offset: tokens[0][2] + tokens[0][1].length }
7832
7886
  );
@@ -7919,12 +7973,15 @@ function requireResult() {
7919
7973
  hasRequiredResult = 1;
7920
7974
  let Warning = requireWarning();
7921
7975
  class Result {
7976
+ get content() {
7977
+ return this.css;
7978
+ }
7922
7979
  constructor(processor2, root2, opts) {
7923
7980
  this.processor = processor2;
7924
7981
  this.messages = [];
7925
7982
  this.root = root2;
7926
7983
  this.opts = opts;
7927
- this.css = void 0;
7984
+ this.css = "";
7928
7985
  this.map = void 0;
7929
7986
  }
7930
7987
  toString() {
@@ -7943,9 +8000,6 @@ function requireResult() {
7943
8000
  warnings() {
7944
8001
  return this.messages.filter((i2) => i2.type === "warning");
7945
8002
  }
7946
- get content() {
7947
- return this.css;
7948
- }
7949
8003
  }
7950
8004
  result = Result;
7951
8005
  Result.default = Result;
@@ -8064,6 +8118,30 @@ function requireLazyResult() {
8064
8118
  }
8065
8119
  let postcss2 = {};
8066
8120
  class LazyResult {
8121
+ get content() {
8122
+ return this.stringify().content;
8123
+ }
8124
+ get css() {
8125
+ return this.stringify().css;
8126
+ }
8127
+ get map() {
8128
+ return this.stringify().map;
8129
+ }
8130
+ get messages() {
8131
+ return this.sync().messages;
8132
+ }
8133
+ get opts() {
8134
+ return this.result.opts;
8135
+ }
8136
+ get processor() {
8137
+ return this.result.processor;
8138
+ }
8139
+ get root() {
8140
+ return this.sync().root;
8141
+ }
8142
+ get [Symbol.toStringTag]() {
8143
+ return "LazyResult";
8144
+ }
8067
8145
  constructor(processor2, css, opts) {
8068
8146
  this.stringified = false;
8069
8147
  this.processed = false;
@@ -8406,30 +8484,6 @@ function requireLazyResult() {
8406
8484
  warnings() {
8407
8485
  return this.sync().warnings();
8408
8486
  }
8409
- get content() {
8410
- return this.stringify().content;
8411
- }
8412
- get css() {
8413
- return this.stringify().css;
8414
- }
8415
- get map() {
8416
- return this.stringify().map;
8417
- }
8418
- get messages() {
8419
- return this.sync().messages;
8420
- }
8421
- get opts() {
8422
- return this.result.opts;
8423
- }
8424
- get processor() {
8425
- return this.result.processor;
8426
- }
8427
- get root() {
8428
- return this.sync().root;
8429
- }
8430
- get [Symbol.toStringTag]() {
8431
- return "LazyResult";
8432
- }
8433
8487
  }
8434
8488
  LazyResult.registerPostcss = (dependant) => {
8435
8489
  postcss2 = dependant;
@@ -8451,6 +8505,45 @@ function requireNoWorkResult() {
8451
8505
  let stringify = requireStringify();
8452
8506
  let warnOnce2 = requireWarnOnce();
8453
8507
  class NoWorkResult {
8508
+ get content() {
8509
+ return this.result.css;
8510
+ }
8511
+ get css() {
8512
+ return this.result.css;
8513
+ }
8514
+ get map() {
8515
+ return this.result.map;
8516
+ }
8517
+ get messages() {
8518
+ return [];
8519
+ }
8520
+ get opts() {
8521
+ return this.result.opts;
8522
+ }
8523
+ get processor() {
8524
+ return this.result.processor;
8525
+ }
8526
+ get root() {
8527
+ if (this._root) {
8528
+ return this._root;
8529
+ }
8530
+ let root2;
8531
+ let parser2 = parse;
8532
+ try {
8533
+ root2 = parser2(this._css, this._opts);
8534
+ } catch (error) {
8535
+ this.error = error;
8536
+ }
8537
+ if (this.error) {
8538
+ throw this.error;
8539
+ } else {
8540
+ this._root = root2;
8541
+ return root2;
8542
+ }
8543
+ }
8544
+ get [Symbol.toStringTag]() {
8545
+ return "NoWorkResult";
8546
+ }
8454
8547
  constructor(processor2, css, opts) {
8455
8548
  css = css.toString();
8456
8549
  this.stringified = false;
@@ -8512,45 +8605,6 @@ function requireNoWorkResult() {
8512
8605
  warnings() {
8513
8606
  return [];
8514
8607
  }
8515
- get content() {
8516
- return this.result.css;
8517
- }
8518
- get css() {
8519
- return this.result.css;
8520
- }
8521
- get map() {
8522
- return this.result.map;
8523
- }
8524
- get messages() {
8525
- return [];
8526
- }
8527
- get opts() {
8528
- return this.result.opts;
8529
- }
8530
- get processor() {
8531
- return this.result.processor;
8532
- }
8533
- get root() {
8534
- if (this._root) {
8535
- return this._root;
8536
- }
8537
- let root2;
8538
- let parser2 = parse;
8539
- try {
8540
- root2 = parser2(this._css, this._opts);
8541
- } catch (error) {
8542
- this.error = error;
8543
- }
8544
- if (this.error) {
8545
- throw this.error;
8546
- } else {
8547
- this._root = root2;
8548
- return root2;
8549
- }
8550
- }
8551
- get [Symbol.toStringTag]() {
8552
- return "NoWorkResult";
8553
- }
8554
8608
  }
8555
8609
  noWorkResult = NoWorkResult;
8556
8610
  NoWorkResult.default = NoWorkResult;
@@ -8567,7 +8621,7 @@ function requireProcessor() {
8567
8621
  let Root = requireRoot();
8568
8622
  class Processor {
8569
8623
  constructor(plugins = []) {
8570
- this.version = "8.5.1";
8624
+ this.version = "8.5.6";
8571
8625
  this.plugins = this.normalize(plugins);
8572
8626
  }
8573
8627
  normalize(plugins) {
@@ -13812,14 +13866,7 @@ function strToU8(str, latin1) {
13812
13866
  ar = n2;
13813
13867
  }
13814
13868
  var c2 = str.charCodeAt(i);
13815
- if (c2 < 128 || latin1)
13816
- w(c2);
13817
- else if (c2 < 2048)
13818
- w(192 | c2 >>> 6), w(128 | c2 & 63);
13819
- else if (c2 > 55295 && c2 < 57344)
13820
- c2 = 65536 + (c2 & 1023 << 10) | str.charCodeAt(++i) & 1023, w(240 | c2 >>> 18), w(128 | c2 >>> 12 & 63), w(128 | c2 >>> 6 & 63), w(128 | c2 & 63);
13821
- else
13822
- w(224 | c2 >>> 12), w(128 | c2 >>> 6 & 63), w(128 | c2 & 63);
13869
+ w(c2);
13823
13870
  }
13824
13871
  return slc(ar, 0, ai);
13825
13872
  }
@@ -15760,7 +15807,7 @@ class Player2 extends Player$1 {
15760
15807
  }
15761
15808
  exports.Player = Player2;
15762
15809
  exports.default = Player2;
15763
- if (typeof module.exports == "object" && typeof exports == "object") {
15810
+ ;if (typeof module.exports == "object" && typeof exports == "object") {
15764
15811
  var __cp = (to, from, except, desc) => {
15765
15812
  if ((from && typeof from === "object") || typeof from === "function") {
15766
15813
  for (let key of Object.getOwnPropertyNames(from)) {