@posthog/rrweb-record 0.0.34 → 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.
@@ -1432,7 +1432,7 @@ function getDefaultExportFromCjs$1(x) {
1432
1432
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
1433
1433
  }
1434
1434
  function getAugmentedNamespace$1(n2) {
1435
- if (n2.__esModule) return n2;
1435
+ if (Object.prototype.hasOwnProperty.call(n2, "__esModule")) return n2;
1436
1436
  var f2 = n2.default;
1437
1437
  if (typeof f2 == "function") {
1438
1438
  var a2 = function a3() {
@@ -1951,6 +1951,9 @@ function requireNode$1() {
1951
1951
  return offset;
1952
1952
  }
1953
1953
  class Node2 {
1954
+ get proxyOf() {
1955
+ return this;
1956
+ }
1954
1957
  constructor(defaults = {}) {
1955
1958
  this.raws = {};
1956
1959
  this[isClean] = false;
@@ -2069,7 +2072,7 @@ function requireNode$1() {
2069
2072
  let index2 = this.parent.index(this);
2070
2073
  return this.parent.nodes[index2 + 1];
2071
2074
  }
2072
- positionBy(opts) {
2075
+ positionBy(opts = {}) {
2073
2076
  let pos = this.source.start;
2074
2077
  if (opts.index) {
2075
2078
  pos = this.positionInside(opts.index);
@@ -2098,27 +2101,38 @@ function requireNode$1() {
2098
2101
  column += 1;
2099
2102
  }
2100
2103
  }
2101
- return { column, line };
2104
+ return { column, line, offset: end };
2102
2105
  }
2103
2106
  prev() {
2104
2107
  if (!this.parent) return void 0;
2105
2108
  let index2 = this.parent.index(this);
2106
2109
  return this.parent.nodes[index2 - 1];
2107
2110
  }
2108
- rangeBy(opts) {
2111
+ rangeBy(opts = {}) {
2112
+ let inputString = "document" in this.source.input ? this.source.input.document : this.source.input.css;
2109
2113
  let start = {
2110
2114
  column: this.source.start.column,
2111
- line: this.source.start.line
2115
+ line: this.source.start.line,
2116
+ offset: sourceOffset(inputString, this.source.start)
2112
2117
  };
2113
2118
  let end = this.source.end ? {
2114
2119
  column: this.source.end.column + 1,
2115
- line: this.source.end.line
2120
+ line: this.source.end.line,
2121
+ offset: typeof this.source.end.offset === "number" ? (
2122
+ // `source.end.offset` is exclusive, so we don't need to add 1
2123
+ this.source.end.offset
2124
+ ) : (
2125
+ // Since line/column in this.source.end is inclusive,
2126
+ // the `sourceOffset(... , this.source.end)` returns an inclusive offset.
2127
+ // So, we add 1 to convert it to exclusive.
2128
+ sourceOffset(inputString, this.source.end) + 1
2129
+ )
2116
2130
  } : {
2117
2131
  column: start.column + 1,
2118
- line: start.line
2132
+ line: start.line,
2133
+ offset: start.offset + 1
2119
2134
  };
2120
2135
  if (opts.word) {
2121
- let inputString = "document" in this.source.input ? this.source.input.document : this.source.input.css;
2122
2136
  let stringRepresentation = inputString.slice(
2123
2137
  sourceOffset(inputString, this.source.start),
2124
2138
  sourceOffset(inputString, this.source.end)
@@ -2126,15 +2140,14 @@ function requireNode$1() {
2126
2140
  let index2 = stringRepresentation.indexOf(opts.word);
2127
2141
  if (index2 !== -1) {
2128
2142
  start = this.positionInside(index2);
2129
- end = this.positionInside(
2130
- index2 + opts.word.length
2131
- );
2143
+ end = this.positionInside(index2 + opts.word.length);
2132
2144
  }
2133
2145
  } else {
2134
2146
  if (opts.start) {
2135
2147
  start = {
2136
2148
  column: opts.start.column,
2137
- line: opts.start.line
2149
+ line: opts.start.line,
2150
+ offset: sourceOffset(inputString, opts.start)
2138
2151
  };
2139
2152
  } else if (opts.index) {
2140
2153
  start = this.positionInside(opts.index);
@@ -2142,7 +2155,8 @@ function requireNode$1() {
2142
2155
  if (opts.end) {
2143
2156
  end = {
2144
2157
  column: opts.end.column,
2145
- line: opts.end.line
2158
+ line: opts.end.line,
2159
+ offset: sourceOffset(inputString, opts.end)
2146
2160
  };
2147
2161
  } else if (typeof opts.endIndex === "number") {
2148
2162
  end = this.positionInside(opts.endIndex);
@@ -2151,7 +2165,11 @@ function requireNode$1() {
2151
2165
  }
2152
2166
  }
2153
2167
  if (end.line < start.line || end.line === start.line && end.column <= start.column) {
2154
- end = { column: start.column + 1, line: start.line };
2168
+ end = {
2169
+ column: start.column + 1,
2170
+ line: start.line,
2171
+ offset: start.offset + 1
2172
+ };
2155
2173
  }
2156
2174
  return { end, start };
2157
2175
  }
@@ -2215,6 +2233,7 @@ function requireNode$1() {
2215
2233
  } else if (typeof value === "object" && value.toJSON) {
2216
2234
  fixed[name] = value.toJSON(null, inputs);
2217
2235
  } else if (name === "source") {
2236
+ if (value == null) continue;
2218
2237
  let inputId = inputs.get(value.input);
2219
2238
  if (inputId == null) {
2220
2239
  inputId = inputsNextIndex;
@@ -2249,14 +2268,11 @@ function requireNode$1() {
2249
2268
  });
2250
2269
  return result2;
2251
2270
  }
2252
- warn(result2, text, opts) {
2271
+ warn(result2, text, opts = {}) {
2253
2272
  let data = { node: this };
2254
2273
  for (let i2 in opts) data[i2] = opts[i2];
2255
2274
  return result2.warn(text, data);
2256
2275
  }
2257
- get proxyOf() {
2258
- return this;
2259
- }
2260
2276
  }
2261
2277
  node$1 = Node2;
2262
2278
  Node2.default = Node2;
@@ -2285,6 +2301,9 @@ function requireDeclaration$1() {
2285
2301
  hasRequiredDeclaration$1 = 1;
2286
2302
  let Node2 = requireNode$1();
2287
2303
  class Declaration extends Node2 {
2304
+ get variable() {
2305
+ return this.prop.startsWith("--") || this.prop[0] === "$";
2306
+ }
2288
2307
  constructor(defaults) {
2289
2308
  if (defaults && typeof defaults.value !== "undefined" && typeof defaults.value !== "string") {
2290
2309
  defaults = { ...defaults, value: String(defaults.value) };
@@ -2292,9 +2311,6 @@ function requireDeclaration$1() {
2292
2311
  super(defaults);
2293
2312
  this.type = "decl";
2294
2313
  }
2295
- get variable() {
2296
- return this.prop.startsWith("--") || this.prop[0] === "$";
2297
- }
2298
2314
  }
2299
2315
  declaration$1 = Declaration;
2300
2316
  Declaration.default = Declaration;
@@ -2326,6 +2342,14 @@ function requireContainer$1() {
2326
2342
  }
2327
2343
  }
2328
2344
  class Container extends Node2 {
2345
+ get first() {
2346
+ if (!this.proxyOf.nodes) return void 0;
2347
+ return this.proxyOf.nodes[0];
2348
+ }
2349
+ get last() {
2350
+ if (!this.proxyOf.nodes) return void 0;
2351
+ return this.proxyOf.nodes[this.proxyOf.nodes.length - 1];
2352
+ }
2329
2353
  append(...children) {
2330
2354
  for (let child of children) {
2331
2355
  let nodes = this.normalize(child, this.last);
@@ -2638,14 +2662,6 @@ function requireContainer$1() {
2638
2662
  }
2639
2663
  });
2640
2664
  }
2641
- get first() {
2642
- if (!this.proxyOf.nodes) return void 0;
2643
- return this.proxyOf.nodes[0];
2644
- }
2645
- get last() {
2646
- if (!this.proxyOf.nodes) return void 0;
2647
- return this.proxyOf.nodes[this.proxyOf.nodes.length - 1];
2648
- }
2649
2665
  }
2650
2666
  Container.registerParse = (dependant) => {
2651
2667
  parse = dependant;
@@ -2895,10 +2911,25 @@ function requireInput$1() {
2895
2911
  let CssSyntaxError = requireCssSyntaxError$1();
2896
2912
  let PreviousMap = requirePreviousMap$1();
2897
2913
  let terminalHighlight = require$$2$1;
2898
- let fromOffsetCache = Symbol("fromOffsetCache");
2914
+ let lineToIndexCache = Symbol("lineToIndexCache");
2899
2915
  let sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator);
2900
2916
  let pathAvailable = Boolean(resolve && isAbsolute);
2917
+ function getLineToIndex(input2) {
2918
+ if (input2[lineToIndexCache]) return input2[lineToIndexCache];
2919
+ let lines = input2.css.split("\n");
2920
+ let lineToIndex = new Array(lines.length);
2921
+ let prevIndex = 0;
2922
+ for (let i2 = 0, l2 = lines.length; i2 < l2; i2++) {
2923
+ lineToIndex[i2] = prevIndex;
2924
+ prevIndex += lines[i2].length + 1;
2925
+ }
2926
+ input2[lineToIndexCache] = lineToIndex;
2927
+ return lineToIndex;
2928
+ }
2901
2929
  class Input {
2930
+ get from() {
2931
+ return this.file || this.id;
2932
+ }
2902
2933
  constructor(css, opts = {}) {
2903
2934
  if (css === null || typeof css === "undefined" || typeof css === "object" && !css.toString) {
2904
2935
  throw new Error(`PostCSS received ${css} instead of CSS string`);
@@ -2933,30 +2964,37 @@ function requireInput$1() {
2933
2964
  if (this.map) this.map.file = this.from;
2934
2965
  }
2935
2966
  error(message, line, column, opts = {}) {
2936
- let endColumn, endLine, result2;
2967
+ let endColumn, endLine, endOffset, offset, result2;
2937
2968
  if (line && typeof line === "object") {
2938
2969
  let start = line;
2939
2970
  let end = column;
2940
2971
  if (typeof start.offset === "number") {
2941
- let pos = this.fromOffset(start.offset);
2972
+ offset = start.offset;
2973
+ let pos = this.fromOffset(offset);
2942
2974
  line = pos.line;
2943
2975
  column = pos.col;
2944
2976
  } else {
2945
2977
  line = start.line;
2946
2978
  column = start.column;
2979
+ offset = this.fromLineAndColumn(line, column);
2947
2980
  }
2948
2981
  if (typeof end.offset === "number") {
2949
- let pos = this.fromOffset(end.offset);
2982
+ endOffset = end.offset;
2983
+ let pos = this.fromOffset(endOffset);
2950
2984
  endLine = pos.line;
2951
2985
  endColumn = pos.col;
2952
2986
  } else {
2953
2987
  endLine = end.line;
2954
2988
  endColumn = end.column;
2989
+ endOffset = this.fromLineAndColumn(end.line, end.column);
2955
2990
  }
2956
2991
  } else if (!column) {
2957
- let pos = this.fromOffset(line);
2992
+ offset = line;
2993
+ let pos = this.fromOffset(offset);
2958
2994
  line = pos.line;
2959
2995
  column = pos.col;
2996
+ } else {
2997
+ offset = this.fromLineAndColumn(line, column);
2960
2998
  }
2961
2999
  let origin = this.origin(line, column, endLine, endColumn);
2962
3000
  if (origin) {
@@ -2978,7 +3016,7 @@ function requireInput$1() {
2978
3016
  opts.plugin
2979
3017
  );
2980
3018
  }
2981
- result2.input = { column, endColumn, endLine, line, source: this.css };
3019
+ result2.input = { column, endColumn, endLine, endOffset, line, offset, source: this.css };
2982
3020
  if (this.file) {
2983
3021
  if (pathToFileURL) {
2984
3022
  result2.input.url = pathToFileURL(this.file).toString();
@@ -2987,21 +3025,14 @@ function requireInput$1() {
2987
3025
  }
2988
3026
  return result2;
2989
3027
  }
3028
+ fromLineAndColumn(line, column) {
3029
+ let lineToIndex = getLineToIndex(this);
3030
+ let index2 = lineToIndex[line - 1];
3031
+ return index2 + column - 1;
3032
+ }
2990
3033
  fromOffset(offset) {
2991
- let lastLine, lineToIndex;
2992
- if (!this[fromOffsetCache]) {
2993
- let lines = this.css.split("\n");
2994
- lineToIndex = new Array(lines.length);
2995
- let prevIndex = 0;
2996
- for (let i2 = 0, l2 = lines.length; i2 < l2; i2++) {
2997
- lineToIndex[i2] = prevIndex;
2998
- prevIndex += lines[i2].length + 1;
2999
- }
3000
- this[fromOffsetCache] = lineToIndex;
3001
- } else {
3002
- lineToIndex = this[fromOffsetCache];
3003
- }
3004
- lastLine = lineToIndex[lineToIndex.length - 1];
3034
+ let lineToIndex = getLineToIndex(this);
3035
+ let lastLine = lineToIndex[lineToIndex.length - 1];
3005
3036
  let min = 0;
3006
3037
  if (offset >= lastLine) {
3007
3038
  min = lineToIndex.length - 1;
@@ -3082,9 +3113,6 @@ function requireInput$1() {
3082
3113
  }
3083
3114
  return json;
3084
3115
  }
3085
- get from() {
3086
- return this.file || this.id;
3087
- }
3088
3116
  }
3089
3117
  input$1 = Input;
3090
3118
  Input.default = Input;
@@ -3210,11 +3238,6 @@ function requireRule$1() {
3210
3238
  let Container = requireContainer$1();
3211
3239
  let list = requireList$1();
3212
3240
  class Rule extends Container {
3213
- constructor(defaults) {
3214
- super(defaults);
3215
- this.type = "rule";
3216
- if (!this.nodes) this.nodes = [];
3217
- }
3218
3241
  get selectors() {
3219
3242
  return list.comma(this.selector);
3220
3243
  }
@@ -3223,6 +3246,11 @@ function requireRule$1() {
3223
3246
  let sep = match ? match[0] : "," + this.raw("between", "beforeOpen");
3224
3247
  this.selector = values.join(sep);
3225
3248
  }
3249
+ constructor(defaults) {
3250
+ super(defaults);
3251
+ this.type = "rule";
3252
+ if (!this.nodes) this.nodes = [];
3253
+ }
3226
3254
  }
3227
3255
  rule$1 = Rule;
3228
3256
  Rule.default = Rule;
@@ -4122,6 +4150,8 @@ function requireParser$1() {
4122
4150
  if (prev && prev.type === "rule" && !prev.raws.ownSemicolon) {
4123
4151
  prev.raws.ownSemicolon = this.spaces;
4124
4152
  this.spaces = "";
4153
+ prev.source.end = this.getPosition(token[2]);
4154
+ prev.source.end.offset += prev.raws.ownSemicolon.length;
4125
4155
  }
4126
4156
  }
4127
4157
  }
@@ -4333,7 +4363,7 @@ function requireParser$1() {
4333
4363
  }
4334
4364
  unknownWord(tokens) {
4335
4365
  throw this.input.error(
4336
- "Unknown word",
4366
+ "Unknown word " + tokens[0][1],
4337
4367
  { offset: tokens[0][2] },
4338
4368
  { offset: tokens[0][2] + tokens[0][1].length }
4339
4369
  );
@@ -4426,12 +4456,15 @@ function requireResult$1() {
4426
4456
  hasRequiredResult$1 = 1;
4427
4457
  let Warning = requireWarning$1();
4428
4458
  class Result {
4459
+ get content() {
4460
+ return this.css;
4461
+ }
4429
4462
  constructor(processor2, root2, opts) {
4430
4463
  this.processor = processor2;
4431
4464
  this.messages = [];
4432
4465
  this.root = root2;
4433
4466
  this.opts = opts;
4434
- this.css = void 0;
4467
+ this.css = "";
4435
4468
  this.map = void 0;
4436
4469
  }
4437
4470
  toString() {
@@ -4450,9 +4483,6 @@ function requireResult$1() {
4450
4483
  warnings() {
4451
4484
  return this.messages.filter((i2) => i2.type === "warning");
4452
4485
  }
4453
- get content() {
4454
- return this.css;
4455
- }
4456
4486
  }
4457
4487
  result$1 = Result;
4458
4488
  Result.default = Result;
@@ -4571,6 +4601,30 @@ function requireLazyResult$1() {
4571
4601
  }
4572
4602
  let postcss2 = {};
4573
4603
  class LazyResult {
4604
+ get content() {
4605
+ return this.stringify().content;
4606
+ }
4607
+ get css() {
4608
+ return this.stringify().css;
4609
+ }
4610
+ get map() {
4611
+ return this.stringify().map;
4612
+ }
4613
+ get messages() {
4614
+ return this.sync().messages;
4615
+ }
4616
+ get opts() {
4617
+ return this.result.opts;
4618
+ }
4619
+ get processor() {
4620
+ return this.result.processor;
4621
+ }
4622
+ get root() {
4623
+ return this.sync().root;
4624
+ }
4625
+ get [Symbol.toStringTag]() {
4626
+ return "LazyResult";
4627
+ }
4574
4628
  constructor(processor2, css, opts) {
4575
4629
  this.stringified = false;
4576
4630
  this.processed = false;
@@ -4913,30 +4967,6 @@ function requireLazyResult$1() {
4913
4967
  warnings() {
4914
4968
  return this.sync().warnings();
4915
4969
  }
4916
- get content() {
4917
- return this.stringify().content;
4918
- }
4919
- get css() {
4920
- return this.stringify().css;
4921
- }
4922
- get map() {
4923
- return this.stringify().map;
4924
- }
4925
- get messages() {
4926
- return this.sync().messages;
4927
- }
4928
- get opts() {
4929
- return this.result.opts;
4930
- }
4931
- get processor() {
4932
- return this.result.processor;
4933
- }
4934
- get root() {
4935
- return this.sync().root;
4936
- }
4937
- get [Symbol.toStringTag]() {
4938
- return "LazyResult";
4939
- }
4940
4970
  }
4941
4971
  LazyResult.registerPostcss = (dependant) => {
4942
4972
  postcss2 = dependant;
@@ -4958,6 +4988,45 @@ function requireNoWorkResult$1() {
4958
4988
  let stringify = requireStringify$1();
4959
4989
  let warnOnce2 = requireWarnOnce$1();
4960
4990
  class NoWorkResult {
4991
+ get content() {
4992
+ return this.result.css;
4993
+ }
4994
+ get css() {
4995
+ return this.result.css;
4996
+ }
4997
+ get map() {
4998
+ return this.result.map;
4999
+ }
5000
+ get messages() {
5001
+ return [];
5002
+ }
5003
+ get opts() {
5004
+ return this.result.opts;
5005
+ }
5006
+ get processor() {
5007
+ return this.result.processor;
5008
+ }
5009
+ get root() {
5010
+ if (this._root) {
5011
+ return this._root;
5012
+ }
5013
+ let root2;
5014
+ let parser2 = parse;
5015
+ try {
5016
+ root2 = parser2(this._css, this._opts);
5017
+ } catch (error) {
5018
+ this.error = error;
5019
+ }
5020
+ if (this.error) {
5021
+ throw this.error;
5022
+ } else {
5023
+ this._root = root2;
5024
+ return root2;
5025
+ }
5026
+ }
5027
+ get [Symbol.toStringTag]() {
5028
+ return "NoWorkResult";
5029
+ }
4961
5030
  constructor(processor2, css, opts) {
4962
5031
  css = css.toString();
4963
5032
  this.stringified = false;
@@ -5019,45 +5088,6 @@ function requireNoWorkResult$1() {
5019
5088
  warnings() {
5020
5089
  return [];
5021
5090
  }
5022
- get content() {
5023
- return this.result.css;
5024
- }
5025
- get css() {
5026
- return this.result.css;
5027
- }
5028
- get map() {
5029
- return this.result.map;
5030
- }
5031
- get messages() {
5032
- return [];
5033
- }
5034
- get opts() {
5035
- return this.result.opts;
5036
- }
5037
- get processor() {
5038
- return this.result.processor;
5039
- }
5040
- get root() {
5041
- if (this._root) {
5042
- return this._root;
5043
- }
5044
- let root2;
5045
- let parser2 = parse;
5046
- try {
5047
- root2 = parser2(this._css, this._opts);
5048
- } catch (error) {
5049
- this.error = error;
5050
- }
5051
- if (this.error) {
5052
- throw this.error;
5053
- } else {
5054
- this._root = root2;
5055
- return root2;
5056
- }
5057
- }
5058
- get [Symbol.toStringTag]() {
5059
- return "NoWorkResult";
5060
- }
5061
5091
  }
5062
5092
  noWorkResult$1 = NoWorkResult;
5063
5093
  NoWorkResult.default = NoWorkResult;
@@ -5074,7 +5104,7 @@ function requireProcessor$1() {
5074
5104
  let Root = requireRoot$1();
5075
5105
  class Processor {
5076
5106
  constructor(plugins = []) {
5077
- this.version = "8.5.1";
5107
+ this.version = "8.5.6";
5078
5108
  this.plugins = this.normalize(plugins);
5079
5109
  }
5080
5110
  normalize(plugins) {
@@ -5347,7 +5377,7 @@ function getDefaultExportFromCjs(x) {
5347
5377
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
5348
5378
  }
5349
5379
  function getAugmentedNamespace(n2) {
5350
- if (n2.__esModule) return n2;
5380
+ if (Object.prototype.hasOwnProperty.call(n2, "__esModule")) return n2;
5351
5381
  var f2 = n2.default;
5352
5382
  if (typeof f2 == "function") {
5353
5383
  var a2 = function a3() {
@@ -5866,6 +5896,9 @@ function requireNode() {
5866
5896
  return offset;
5867
5897
  }
5868
5898
  class Node2 {
5899
+ get proxyOf() {
5900
+ return this;
5901
+ }
5869
5902
  constructor(defaults = {}) {
5870
5903
  this.raws = {};
5871
5904
  this[isClean] = false;
@@ -5984,7 +6017,7 @@ function requireNode() {
5984
6017
  let index2 = this.parent.index(this);
5985
6018
  return this.parent.nodes[index2 + 1];
5986
6019
  }
5987
- positionBy(opts) {
6020
+ positionBy(opts = {}) {
5988
6021
  let pos = this.source.start;
5989
6022
  if (opts.index) {
5990
6023
  pos = this.positionInside(opts.index);
@@ -6013,27 +6046,38 @@ function requireNode() {
6013
6046
  column += 1;
6014
6047
  }
6015
6048
  }
6016
- return { column, line };
6049
+ return { column, line, offset: end };
6017
6050
  }
6018
6051
  prev() {
6019
6052
  if (!this.parent) return void 0;
6020
6053
  let index2 = this.parent.index(this);
6021
6054
  return this.parent.nodes[index2 - 1];
6022
6055
  }
6023
- rangeBy(opts) {
6056
+ rangeBy(opts = {}) {
6057
+ let inputString = "document" in this.source.input ? this.source.input.document : this.source.input.css;
6024
6058
  let start = {
6025
6059
  column: this.source.start.column,
6026
- line: this.source.start.line
6060
+ line: this.source.start.line,
6061
+ offset: sourceOffset(inputString, this.source.start)
6027
6062
  };
6028
6063
  let end = this.source.end ? {
6029
6064
  column: this.source.end.column + 1,
6030
- line: this.source.end.line
6065
+ line: this.source.end.line,
6066
+ offset: typeof this.source.end.offset === "number" ? (
6067
+ // `source.end.offset` is exclusive, so we don't need to add 1
6068
+ this.source.end.offset
6069
+ ) : (
6070
+ // Since line/column in this.source.end is inclusive,
6071
+ // the `sourceOffset(... , this.source.end)` returns an inclusive offset.
6072
+ // So, we add 1 to convert it to exclusive.
6073
+ sourceOffset(inputString, this.source.end) + 1
6074
+ )
6031
6075
  } : {
6032
6076
  column: start.column + 1,
6033
- line: start.line
6077
+ line: start.line,
6078
+ offset: start.offset + 1
6034
6079
  };
6035
6080
  if (opts.word) {
6036
- let inputString = "document" in this.source.input ? this.source.input.document : this.source.input.css;
6037
6081
  let stringRepresentation = inputString.slice(
6038
6082
  sourceOffset(inputString, this.source.start),
6039
6083
  sourceOffset(inputString, this.source.end)
@@ -6041,15 +6085,14 @@ function requireNode() {
6041
6085
  let index2 = stringRepresentation.indexOf(opts.word);
6042
6086
  if (index2 !== -1) {
6043
6087
  start = this.positionInside(index2);
6044
- end = this.positionInside(
6045
- index2 + opts.word.length
6046
- );
6088
+ end = this.positionInside(index2 + opts.word.length);
6047
6089
  }
6048
6090
  } else {
6049
6091
  if (opts.start) {
6050
6092
  start = {
6051
6093
  column: opts.start.column,
6052
- line: opts.start.line
6094
+ line: opts.start.line,
6095
+ offset: sourceOffset(inputString, opts.start)
6053
6096
  };
6054
6097
  } else if (opts.index) {
6055
6098
  start = this.positionInside(opts.index);
@@ -6057,7 +6100,8 @@ function requireNode() {
6057
6100
  if (opts.end) {
6058
6101
  end = {
6059
6102
  column: opts.end.column,
6060
- line: opts.end.line
6103
+ line: opts.end.line,
6104
+ offset: sourceOffset(inputString, opts.end)
6061
6105
  };
6062
6106
  } else if (typeof opts.endIndex === "number") {
6063
6107
  end = this.positionInside(opts.endIndex);
@@ -6066,7 +6110,11 @@ function requireNode() {
6066
6110
  }
6067
6111
  }
6068
6112
  if (end.line < start.line || end.line === start.line && end.column <= start.column) {
6069
- end = { column: start.column + 1, line: start.line };
6113
+ end = {
6114
+ column: start.column + 1,
6115
+ line: start.line,
6116
+ offset: start.offset + 1
6117
+ };
6070
6118
  }
6071
6119
  return { end, start };
6072
6120
  }
@@ -6130,6 +6178,7 @@ function requireNode() {
6130
6178
  } else if (typeof value === "object" && value.toJSON) {
6131
6179
  fixed[name] = value.toJSON(null, inputs);
6132
6180
  } else if (name === "source") {
6181
+ if (value == null) continue;
6133
6182
  let inputId = inputs.get(value.input);
6134
6183
  if (inputId == null) {
6135
6184
  inputId = inputsNextIndex;
@@ -6164,14 +6213,11 @@ function requireNode() {
6164
6213
  });
6165
6214
  return result2;
6166
6215
  }
6167
- warn(result2, text, opts) {
6216
+ warn(result2, text, opts = {}) {
6168
6217
  let data = { node: this };
6169
6218
  for (let i2 in opts) data[i2] = opts[i2];
6170
6219
  return result2.warn(text, data);
6171
6220
  }
6172
- get proxyOf() {
6173
- return this;
6174
- }
6175
6221
  }
6176
6222
  node = Node2;
6177
6223
  Node2.default = Node2;
@@ -6200,6 +6246,9 @@ function requireDeclaration() {
6200
6246
  hasRequiredDeclaration = 1;
6201
6247
  let Node2 = requireNode();
6202
6248
  class Declaration extends Node2 {
6249
+ get variable() {
6250
+ return this.prop.startsWith("--") || this.prop[0] === "$";
6251
+ }
6203
6252
  constructor(defaults) {
6204
6253
  if (defaults && typeof defaults.value !== "undefined" && typeof defaults.value !== "string") {
6205
6254
  defaults = { ...defaults, value: String(defaults.value) };
@@ -6207,9 +6256,6 @@ function requireDeclaration() {
6207
6256
  super(defaults);
6208
6257
  this.type = "decl";
6209
6258
  }
6210
- get variable() {
6211
- return this.prop.startsWith("--") || this.prop[0] === "$";
6212
- }
6213
6259
  }
6214
6260
  declaration = Declaration;
6215
6261
  Declaration.default = Declaration;
@@ -6241,6 +6287,14 @@ function requireContainer() {
6241
6287
  }
6242
6288
  }
6243
6289
  class Container extends Node2 {
6290
+ get first() {
6291
+ if (!this.proxyOf.nodes) return void 0;
6292
+ return this.proxyOf.nodes[0];
6293
+ }
6294
+ get last() {
6295
+ if (!this.proxyOf.nodes) return void 0;
6296
+ return this.proxyOf.nodes[this.proxyOf.nodes.length - 1];
6297
+ }
6244
6298
  append(...children) {
6245
6299
  for (let child of children) {
6246
6300
  let nodes = this.normalize(child, this.last);
@@ -6553,14 +6607,6 @@ function requireContainer() {
6553
6607
  }
6554
6608
  });
6555
6609
  }
6556
- get first() {
6557
- if (!this.proxyOf.nodes) return void 0;
6558
- return this.proxyOf.nodes[0];
6559
- }
6560
- get last() {
6561
- if (!this.proxyOf.nodes) return void 0;
6562
- return this.proxyOf.nodes[this.proxyOf.nodes.length - 1];
6563
- }
6564
6610
  }
6565
6611
  Container.registerParse = (dependant) => {
6566
6612
  parse = dependant;
@@ -6810,10 +6856,25 @@ function requireInput() {
6810
6856
  let CssSyntaxError = requireCssSyntaxError();
6811
6857
  let PreviousMap = requirePreviousMap();
6812
6858
  let terminalHighlight = require$$2;
6813
- let fromOffsetCache = Symbol("fromOffsetCache");
6859
+ let lineToIndexCache = Symbol("lineToIndexCache");
6814
6860
  let sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator);
6815
6861
  let pathAvailable = Boolean(resolve && isAbsolute);
6862
+ function getLineToIndex(input2) {
6863
+ if (input2[lineToIndexCache]) return input2[lineToIndexCache];
6864
+ let lines = input2.css.split("\n");
6865
+ let lineToIndex = new Array(lines.length);
6866
+ let prevIndex = 0;
6867
+ for (let i2 = 0, l2 = lines.length; i2 < l2; i2++) {
6868
+ lineToIndex[i2] = prevIndex;
6869
+ prevIndex += lines[i2].length + 1;
6870
+ }
6871
+ input2[lineToIndexCache] = lineToIndex;
6872
+ return lineToIndex;
6873
+ }
6816
6874
  class Input {
6875
+ get from() {
6876
+ return this.file || this.id;
6877
+ }
6817
6878
  constructor(css, opts = {}) {
6818
6879
  if (css === null || typeof css === "undefined" || typeof css === "object" && !css.toString) {
6819
6880
  throw new Error(`PostCSS received ${css} instead of CSS string`);
@@ -6848,30 +6909,37 @@ function requireInput() {
6848
6909
  if (this.map) this.map.file = this.from;
6849
6910
  }
6850
6911
  error(message, line, column, opts = {}) {
6851
- let endColumn, endLine, result2;
6912
+ let endColumn, endLine, endOffset, offset, result2;
6852
6913
  if (line && typeof line === "object") {
6853
6914
  let start = line;
6854
6915
  let end = column;
6855
6916
  if (typeof start.offset === "number") {
6856
- let pos = this.fromOffset(start.offset);
6917
+ offset = start.offset;
6918
+ let pos = this.fromOffset(offset);
6857
6919
  line = pos.line;
6858
6920
  column = pos.col;
6859
6921
  } else {
6860
6922
  line = start.line;
6861
6923
  column = start.column;
6924
+ offset = this.fromLineAndColumn(line, column);
6862
6925
  }
6863
6926
  if (typeof end.offset === "number") {
6864
- let pos = this.fromOffset(end.offset);
6927
+ endOffset = end.offset;
6928
+ let pos = this.fromOffset(endOffset);
6865
6929
  endLine = pos.line;
6866
6930
  endColumn = pos.col;
6867
6931
  } else {
6868
6932
  endLine = end.line;
6869
6933
  endColumn = end.column;
6934
+ endOffset = this.fromLineAndColumn(end.line, end.column);
6870
6935
  }
6871
6936
  } else if (!column) {
6872
- let pos = this.fromOffset(line);
6937
+ offset = line;
6938
+ let pos = this.fromOffset(offset);
6873
6939
  line = pos.line;
6874
6940
  column = pos.col;
6941
+ } else {
6942
+ offset = this.fromLineAndColumn(line, column);
6875
6943
  }
6876
6944
  let origin = this.origin(line, column, endLine, endColumn);
6877
6945
  if (origin) {
@@ -6893,7 +6961,7 @@ function requireInput() {
6893
6961
  opts.plugin
6894
6962
  );
6895
6963
  }
6896
- result2.input = { column, endColumn, endLine, line, source: this.css };
6964
+ result2.input = { column, endColumn, endLine, endOffset, line, offset, source: this.css };
6897
6965
  if (this.file) {
6898
6966
  if (pathToFileURL) {
6899
6967
  result2.input.url = pathToFileURL(this.file).toString();
@@ -6902,21 +6970,14 @@ function requireInput() {
6902
6970
  }
6903
6971
  return result2;
6904
6972
  }
6973
+ fromLineAndColumn(line, column) {
6974
+ let lineToIndex = getLineToIndex(this);
6975
+ let index2 = lineToIndex[line - 1];
6976
+ return index2 + column - 1;
6977
+ }
6905
6978
  fromOffset(offset) {
6906
- let lastLine, lineToIndex;
6907
- if (!this[fromOffsetCache]) {
6908
- let lines = this.css.split("\n");
6909
- lineToIndex = new Array(lines.length);
6910
- let prevIndex = 0;
6911
- for (let i2 = 0, l2 = lines.length; i2 < l2; i2++) {
6912
- lineToIndex[i2] = prevIndex;
6913
- prevIndex += lines[i2].length + 1;
6914
- }
6915
- this[fromOffsetCache] = lineToIndex;
6916
- } else {
6917
- lineToIndex = this[fromOffsetCache];
6918
- }
6919
- lastLine = lineToIndex[lineToIndex.length - 1];
6979
+ let lineToIndex = getLineToIndex(this);
6980
+ let lastLine = lineToIndex[lineToIndex.length - 1];
6920
6981
  let min = 0;
6921
6982
  if (offset >= lastLine) {
6922
6983
  min = lineToIndex.length - 1;
@@ -6997,9 +7058,6 @@ function requireInput() {
6997
7058
  }
6998
7059
  return json;
6999
7060
  }
7000
- get from() {
7001
- return this.file || this.id;
7002
- }
7003
7061
  }
7004
7062
  input = Input;
7005
7063
  Input.default = Input;
@@ -7125,11 +7183,6 @@ function requireRule() {
7125
7183
  let Container = requireContainer();
7126
7184
  let list = requireList();
7127
7185
  class Rule extends Container {
7128
- constructor(defaults) {
7129
- super(defaults);
7130
- this.type = "rule";
7131
- if (!this.nodes) this.nodes = [];
7132
- }
7133
7186
  get selectors() {
7134
7187
  return list.comma(this.selector);
7135
7188
  }
@@ -7138,6 +7191,11 @@ function requireRule() {
7138
7191
  let sep = match ? match[0] : "," + this.raw("between", "beforeOpen");
7139
7192
  this.selector = values.join(sep);
7140
7193
  }
7194
+ constructor(defaults) {
7195
+ super(defaults);
7196
+ this.type = "rule";
7197
+ if (!this.nodes) this.nodes = [];
7198
+ }
7141
7199
  }
7142
7200
  rule = Rule;
7143
7201
  Rule.default = Rule;
@@ -8037,6 +8095,8 @@ function requireParser() {
8037
8095
  if (prev && prev.type === "rule" && !prev.raws.ownSemicolon) {
8038
8096
  prev.raws.ownSemicolon = this.spaces;
8039
8097
  this.spaces = "";
8098
+ prev.source.end = this.getPosition(token[2]);
8099
+ prev.source.end.offset += prev.raws.ownSemicolon.length;
8040
8100
  }
8041
8101
  }
8042
8102
  }
@@ -8248,7 +8308,7 @@ function requireParser() {
8248
8308
  }
8249
8309
  unknownWord(tokens) {
8250
8310
  throw this.input.error(
8251
- "Unknown word",
8311
+ "Unknown word " + tokens[0][1],
8252
8312
  { offset: tokens[0][2] },
8253
8313
  { offset: tokens[0][2] + tokens[0][1].length }
8254
8314
  );
@@ -8341,12 +8401,15 @@ function requireResult() {
8341
8401
  hasRequiredResult = 1;
8342
8402
  let Warning = requireWarning();
8343
8403
  class Result {
8404
+ get content() {
8405
+ return this.css;
8406
+ }
8344
8407
  constructor(processor2, root2, opts) {
8345
8408
  this.processor = processor2;
8346
8409
  this.messages = [];
8347
8410
  this.root = root2;
8348
8411
  this.opts = opts;
8349
- this.css = void 0;
8412
+ this.css = "";
8350
8413
  this.map = void 0;
8351
8414
  }
8352
8415
  toString() {
@@ -8365,9 +8428,6 @@ function requireResult() {
8365
8428
  warnings() {
8366
8429
  return this.messages.filter((i2) => i2.type === "warning");
8367
8430
  }
8368
- get content() {
8369
- return this.css;
8370
- }
8371
8431
  }
8372
8432
  result = Result;
8373
8433
  Result.default = Result;
@@ -8486,6 +8546,30 @@ function requireLazyResult() {
8486
8546
  }
8487
8547
  let postcss2 = {};
8488
8548
  class LazyResult {
8549
+ get content() {
8550
+ return this.stringify().content;
8551
+ }
8552
+ get css() {
8553
+ return this.stringify().css;
8554
+ }
8555
+ get map() {
8556
+ return this.stringify().map;
8557
+ }
8558
+ get messages() {
8559
+ return this.sync().messages;
8560
+ }
8561
+ get opts() {
8562
+ return this.result.opts;
8563
+ }
8564
+ get processor() {
8565
+ return this.result.processor;
8566
+ }
8567
+ get root() {
8568
+ return this.sync().root;
8569
+ }
8570
+ get [Symbol.toStringTag]() {
8571
+ return "LazyResult";
8572
+ }
8489
8573
  constructor(processor2, css, opts) {
8490
8574
  this.stringified = false;
8491
8575
  this.processed = false;
@@ -8828,30 +8912,6 @@ function requireLazyResult() {
8828
8912
  warnings() {
8829
8913
  return this.sync().warnings();
8830
8914
  }
8831
- get content() {
8832
- return this.stringify().content;
8833
- }
8834
- get css() {
8835
- return this.stringify().css;
8836
- }
8837
- get map() {
8838
- return this.stringify().map;
8839
- }
8840
- get messages() {
8841
- return this.sync().messages;
8842
- }
8843
- get opts() {
8844
- return this.result.opts;
8845
- }
8846
- get processor() {
8847
- return this.result.processor;
8848
- }
8849
- get root() {
8850
- return this.sync().root;
8851
- }
8852
- get [Symbol.toStringTag]() {
8853
- return "LazyResult";
8854
- }
8855
8915
  }
8856
8916
  LazyResult.registerPostcss = (dependant) => {
8857
8917
  postcss2 = dependant;
@@ -8873,6 +8933,45 @@ function requireNoWorkResult() {
8873
8933
  let stringify = requireStringify();
8874
8934
  let warnOnce2 = requireWarnOnce();
8875
8935
  class NoWorkResult {
8936
+ get content() {
8937
+ return this.result.css;
8938
+ }
8939
+ get css() {
8940
+ return this.result.css;
8941
+ }
8942
+ get map() {
8943
+ return this.result.map;
8944
+ }
8945
+ get messages() {
8946
+ return [];
8947
+ }
8948
+ get opts() {
8949
+ return this.result.opts;
8950
+ }
8951
+ get processor() {
8952
+ return this.result.processor;
8953
+ }
8954
+ get root() {
8955
+ if (this._root) {
8956
+ return this._root;
8957
+ }
8958
+ let root2;
8959
+ let parser2 = parse;
8960
+ try {
8961
+ root2 = parser2(this._css, this._opts);
8962
+ } catch (error) {
8963
+ this.error = error;
8964
+ }
8965
+ if (this.error) {
8966
+ throw this.error;
8967
+ } else {
8968
+ this._root = root2;
8969
+ return root2;
8970
+ }
8971
+ }
8972
+ get [Symbol.toStringTag]() {
8973
+ return "NoWorkResult";
8974
+ }
8876
8975
  constructor(processor2, css, opts) {
8877
8976
  css = css.toString();
8878
8977
  this.stringified = false;
@@ -8934,45 +9033,6 @@ function requireNoWorkResult() {
8934
9033
  warnings() {
8935
9034
  return [];
8936
9035
  }
8937
- get content() {
8938
- return this.result.css;
8939
- }
8940
- get css() {
8941
- return this.result.css;
8942
- }
8943
- get map() {
8944
- return this.result.map;
8945
- }
8946
- get messages() {
8947
- return [];
8948
- }
8949
- get opts() {
8950
- return this.result.opts;
8951
- }
8952
- get processor() {
8953
- return this.result.processor;
8954
- }
8955
- get root() {
8956
- if (this._root) {
8957
- return this._root;
8958
- }
8959
- let root2;
8960
- let parser2 = parse;
8961
- try {
8962
- root2 = parser2(this._css, this._opts);
8963
- } catch (error) {
8964
- this.error = error;
8965
- }
8966
- if (this.error) {
8967
- throw this.error;
8968
- } else {
8969
- this._root = root2;
8970
- return root2;
8971
- }
8972
- }
8973
- get [Symbol.toStringTag]() {
8974
- return "NoWorkResult";
8975
- }
8976
9036
  }
8977
9037
  noWorkResult = NoWorkResult;
8978
9038
  NoWorkResult.default = NoWorkResult;
@@ -8989,7 +9049,7 @@ function requireProcessor() {
8989
9049
  let Root = requireRoot();
8990
9050
  class Processor {
8991
9051
  constructor(plugins = []) {
8992
- this.version = "8.5.1";
9052
+ this.version = "8.5.6";
8993
9053
  this.plugins = this.normalize(plugins);
8994
9054
  }
8995
9055
  normalize(plugins) {
@@ -10404,7 +10464,7 @@ const callbackWrapper = (cb) => {
10404
10464
  if (!errorHandler) {
10405
10465
  return cb;
10406
10466
  }
10407
- const rrwebWrapped = (...rest) => {
10467
+ const rrwebWrapped = ((...rest) => {
10408
10468
  try {
10409
10469
  return cb(...rest);
10410
10470
  } catch (error) {
@@ -10413,7 +10473,7 @@ const callbackWrapper = (cb) => {
10413
10473
  }
10414
10474
  throw error;
10415
10475
  }
10416
- };
10476
+ });
10417
10477
  return rrwebWrapped;
10418
10478
  };
10419
10479
  const mutationBuffers = [];
@@ -11171,7 +11231,11 @@ function initFontObserver({ fontCb, doc }) {
11171
11231
  const fontMap = /* @__PURE__ */ new WeakMap();
11172
11232
  const originalFontFace = win.FontFace;
11173
11233
  win.FontFace = function FontFace2(family, source, descriptors) {
11174
- const fontFace = new originalFontFace(family, source, descriptors);
11234
+ const fontFace = new originalFontFace(
11235
+ family,
11236
+ source,
11237
+ descriptors
11238
+ );
11175
11239
  fontMap.set(fontFace, {
11176
11240
  family,
11177
11241
  buffer: typeof source !== "string",
@@ -11533,13 +11597,18 @@ class IframeManager {
11533
11597
  removeLoadListener() {
11534
11598
  this.loadListener = void 0;
11535
11599
  }
11600
+ trackIframeContent(iframeEl, content) {
11601
+ const iframeId = this.mirror.getId(iframeEl);
11602
+ this.attachedIframes.set(iframeId, { element: iframeEl, content });
11603
+ return iframeId;
11604
+ }
11536
11605
  attachIframe(iframeEl, childSn) {
11537
11606
  var _a2;
11538
- this.attachedIframes.set(iframeEl, childSn);
11607
+ const iframeId = this.trackIframeContent(iframeEl, childSn);
11539
11608
  this.mutationCb({
11540
11609
  adds: [
11541
11610
  {
11542
- parentId: this.mirror.getId(iframeEl),
11611
+ parentId: iframeId,
11543
11612
  nextId: null,
11544
11613
  node: childSn
11545
11614
  }
@@ -11591,7 +11660,7 @@ class IframeManager {
11591
11660
  const rootId = e2.data.node.id;
11592
11661
  this.crossOriginIframeRootIdMap.set(iframeEl, rootId);
11593
11662
  this.patchRootIdOnNode(e2.data.node, rootId);
11594
- this.attachedIframes.set(iframeEl, e2.data.node);
11663
+ this.trackIframeContent(iframeEl, e2.data.node);
11595
11664
  return {
11596
11665
  timestamp: e2.timestamp,
11597
11666
  type: EventType.IncrementalSnapshot,
@@ -11734,21 +11803,27 @@ class IframeManager {
11734
11803
  });
11735
11804
  }
11736
11805
  }
11806
+ removeIframeById(iframeId) {
11807
+ const entry = this.attachedIframes.get(iframeId);
11808
+ if (!entry) return;
11809
+ const win = entry.element.contentWindow;
11810
+ if (win && this.nestedIframeListeners.has(win)) {
11811
+ const handler = this.nestedIframeListeners.get(win);
11812
+ win.removeEventListener("message", handler);
11813
+ this.nestedIframeListeners.delete(win);
11814
+ }
11815
+ this.attachedIframes.delete(iframeId);
11816
+ }
11737
11817
  reattachIframes() {
11738
- this.attachedIframes.forEach((content, iframe) => {
11739
- if (!iframe.isConnected) {
11740
- this.attachedIframes.delete(iframe);
11741
- return;
11742
- }
11743
- const parentId = this.mirror.getId(iframe);
11744
- if (parentId === -1) {
11745
- this.attachedIframes.delete(iframe);
11818
+ this.attachedIframes.forEach(({ content }, iframeId) => {
11819
+ if (!this.mirror.has(iframeId)) {
11820
+ this.attachedIframes.delete(iframeId);
11746
11821
  return;
11747
11822
  }
11748
11823
  this.mutationCb({
11749
11824
  adds: [
11750
11825
  {
11751
- parentId,
11826
+ parentId: iframeId,
11752
11827
  nextId: null,
11753
11828
  node: content
11754
11829
  }
@@ -12703,6 +12778,11 @@ function record(options = {}) {
12703
12778
  }
12704
12779
  };
12705
12780
  const wrappedMutationEmit = (m) => {
12781
+ if (recordCrossOriginIframes && m.removes) {
12782
+ m.removes.forEach(({ id }) => {
12783
+ iframeManager.removeIframeById(id);
12784
+ });
12785
+ }
12706
12786
  wrappedEmit({
12707
12787
  type: EventType.IncrementalSnapshot,
12708
12788
  data: {
@@ -13062,9 +13142,9 @@ record.takeFullSnapshot = (isCheckout) => {
13062
13142
  };
13063
13143
  record.mirror = mirror;
13064
13144
  var n;
13065
- !function(t2) {
13145
+ !(function(t2) {
13066
13146
  t2[t2.NotStarted = 0] = "NotStarted", t2[t2.Running = 1] = "Running", t2[t2.Stopped = 2] = "Stopped";
13067
- }(n || (n = {}));
13147
+ })(n || (n = {}));
13068
13148
  const { addCustomEvent } = record;
13069
13149
  const { freezePage } = record;
13070
13150
  const { takeFullSnapshot } = record;