@mime8/recorder 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/recorder.js CHANGED
@@ -77,27 +77,27 @@ function ee(e, t) {
77
77
  function T(e) {
78
78
  return y("Node", e, "getRootNode")();
79
79
  }
80
- function E(e) {
80
+ function te(e) {
81
81
  return !e || !("host" in e) ? null : _("ShadowRoot", e, "host");
82
82
  }
83
- function D(e) {
83
+ function E(e) {
84
84
  return e.styleSheets;
85
85
  }
86
- function O(e) {
86
+ function D(e) {
87
87
  return !e || !("shadowRoot" in e) ? null : _("Element", e, "shadowRoot");
88
88
  }
89
- function k(e, t) {
89
+ function O(e, t) {
90
90
  return _("Element", e, "querySelector")(t);
91
91
  }
92
- function te(e, t) {
92
+ function ne(e, t) {
93
93
  return _("Element", e, "querySelectorAll")(t);
94
94
  }
95
- function ne() {
95
+ function re() {
96
96
  return [h("MutationObserver").constructor, p.MutationObserver ?? (() => {})];
97
97
  }
98
- var re = Date.now;
99
- /* @__PURE__ */ /[1-9][0-9]{12}/.test(Date.now().toString()) || (re = () => (/* @__PURE__ */ new Date()).getTime());
100
- function A(e, t, n) {
98
+ var ie = Date.now;
99
+ /* @__PURE__ */ /[1-9][0-9]{12}/.test(Date.now().toString()) || (ie = () => (/* @__PURE__ */ new Date()).getTime());
100
+ function k(e, t, n) {
101
101
  try {
102
102
  if (!(t in e)) return () => {};
103
103
  let r = e[t], i = n(r);
@@ -105,13 +105,13 @@ function A(e, t, n) {
105
105
  enumerable: !1,
106
106
  value: r
107
107
  } })), e[t] = i, () => {
108
- H || (e[t] = r);
108
+ V || (e[t] = r);
109
109
  };
110
110
  } catch {
111
111
  return () => {};
112
112
  }
113
113
  }
114
- var j = {
114
+ var A = {
115
115
  ownerDocument: b,
116
116
  childNodes: x,
117
117
  parentNode: S,
@@ -119,68 +119,68 @@ var j = {
119
119
  textContent: w,
120
120
  contains: ee,
121
121
  getRootNode: T,
122
- host: E,
123
- styleSheets: D,
124
- shadowRoot: O,
125
- querySelector: k,
126
- querySelectorAll: te,
127
- nowTimestamp: re,
128
- mutationObserverCtor: ne,
129
- patch: A
122
+ host: te,
123
+ styleSheets: E,
124
+ shadowRoot: D,
125
+ querySelector: O,
126
+ querySelectorAll: ne,
127
+ nowTimestamp: ie,
128
+ mutationObserverCtor: re,
129
+ patch: k
130
130
  };
131
- function ie(e) {
131
+ function ae(e) {
132
132
  return e.nodeType === e.ELEMENT_NODE;
133
133
  }
134
- function M(e) {
135
- let t = e && "host" in e && "mode" in e && j.host(e) || null;
136
- return !!(t && "shadowRoot" in t && j.shadowRoot(t) === e);
134
+ function j(e) {
135
+ let t = e && "host" in e && "mode" in e && A.host(e) || null;
136
+ return !!(t && "shadowRoot" in t && A.shadowRoot(t) === e);
137
137
  }
138
- function N(e) {
138
+ function M(e) {
139
139
  return Object.prototype.toString.call(e) === "[object ShadowRoot]";
140
140
  }
141
- function ae(e) {
141
+ function oe(e) {
142
142
  return e.includes(" background-clip: text;") && !e.includes(" -webkit-background-clip: text;") && (e = e.replace(/\sbackground-clip:\s*text;/g, " -webkit-background-clip: text; background-clip: text;")), e;
143
143
  }
144
- function oe(e) {
144
+ function se(e) {
145
145
  let { cssText: t } = e;
146
146
  if (t.split("\"").length < 3) return t;
147
147
  let n = ["@import", `url(${JSON.stringify(e.href)})`];
148
148
  return e.layerName === "" ? n.push("layer") : e.layerName && n.push(`layer(${e.layerName})`), e.supportsText && n.push(`supports(${e.supportsText})`), e.media.length && n.push(e.media.mediaText), n.join(" ") + ";";
149
149
  }
150
- function se(e) {
150
+ function ce(e) {
151
151
  try {
152
152
  let t = e.rules || e.cssRules;
153
153
  if (!t) return null;
154
154
  let n = e.href;
155
- return !n && e.ownerNode && (n = e.ownerNode.baseURI), ae(Array.from(t, (e) => ce(e, n)).join(""));
155
+ return !n && e.ownerNode && (n = e.ownerNode.baseURI), oe(Array.from(t, (e) => le(e, n)).join(""));
156
156
  } catch {
157
157
  return null;
158
158
  }
159
159
  }
160
- function ce(e, t) {
161
- if (ue(e)) {
160
+ function le(e, t) {
161
+ if (de(e)) {
162
162
  let t;
163
163
  try {
164
- t = se(e.styleSheet) || oe(e);
164
+ t = ce(e.styleSheet) || se(e);
165
165
  } catch {
166
166
  t = e.cssText;
167
167
  }
168
- return e.styleSheet.href ? xe(t, e.styleSheet.href) : t;
168
+ return e.styleSheet.href ? Se(t, e.styleSheet.href) : t;
169
169
  } else {
170
170
  let n = e.cssText;
171
- return de(e) && e.selectorText.includes(":") && (n = le(n)), t ? xe(n, t) : n;
171
+ return fe(e) && e.selectorText.includes(":") && (n = ue(n)), t ? Se(n, t) : n;
172
172
  }
173
173
  }
174
- function le(e) {
174
+ function ue(e) {
175
175
  return e.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm, "$1\\$2");
176
176
  }
177
- function ue(e) {
177
+ function de(e) {
178
178
  return "styleSheet" in e;
179
179
  }
180
- function de(e) {
180
+ function fe(e) {
181
181
  return "selectorText" in e;
182
182
  }
183
- var P = class {
183
+ var N = class {
184
184
  constructor() {
185
185
  n(this, "idNodeMap", /* @__PURE__ */ new Map()), n(this, "nodeMetaMap", /* @__PURE__ */ new WeakMap());
186
186
  }
@@ -222,31 +222,31 @@ var P = class {
222
222
  this.idNodeMap = /* @__PURE__ */ new Map(), this.nodeMetaMap = /* @__PURE__ */ new WeakMap();
223
223
  }
224
224
  };
225
- function F() {
226
- return new P();
225
+ function P() {
226
+ return new N();
227
227
  }
228
- function I({ element: e, maskInputOptions: t, tagName: n, type: r, value: i, maskInputFn: a }) {
229
- let o = i || "", s = r && L(r);
228
+ function F({ element: e, maskInputOptions: t, tagName: n, type: r, value: i, maskInputFn: a }) {
229
+ let o = i || "", s = r && I(r);
230
230
  return (t[n.toLowerCase()] || s && t[s]) && (o = a ? a(o, e) : "*".repeat(o.length)), o;
231
231
  }
232
- function L(e) {
232
+ function I(e) {
233
233
  return e.toLowerCase();
234
234
  }
235
- var fe = "__rrweb_original__";
236
- function pe(e) {
235
+ var pe = "__rrweb_original__";
236
+ function me(e) {
237
237
  let t = e.getContext("2d");
238
238
  if (!t) return !0;
239
239
  for (let n = 0; n < e.width; n += 50) for (let r = 0; r < e.height; r += 50) {
240
- let i = t.getImageData, a = fe in i ? i[fe] : i;
240
+ let i = t.getImageData, a = pe in i ? i[pe] : i;
241
241
  if (new Uint32Array(a.call(t, n, r, Math.min(50, e.width - n), Math.min(50, e.height - r)).data.buffer).some((e) => e !== 0)) return !1;
242
242
  }
243
243
  return !0;
244
244
  }
245
- function me(e) {
245
+ function he(e) {
246
246
  let t = e.type;
247
- return e.hasAttribute("data-rr-is-password") ? "password" : t ? L(t) : null;
247
+ return e.hasAttribute("data-rr-is-password") ? "password" : t ? I(t) : null;
248
248
  }
249
- function he(e, t) {
249
+ function ge(e, t) {
250
250
  let n;
251
251
  try {
252
252
  n = new URL(e, t ?? window.location.href);
@@ -255,17 +255,17 @@ function he(e, t) {
255
255
  }
256
256
  return n.pathname.match(/\.([0-9a-z]+)(?:$)/i)?.[1] ?? null;
257
257
  }
258
- function ge(e) {
258
+ function _e(e) {
259
259
  let t = "";
260
260
  return t = e.indexOf("//") > -1 ? e.split("/").slice(0, 3).join("/") : e.split("/")[0], t = t.split("?")[0], t;
261
261
  }
262
- var _e = /url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm, ve = /^(?:[a-z+]+:)?\/\//i, ye = /^www\..*/i, be = /^(data:)([^,]*),(.*)/i;
263
- function xe(e, t) {
264
- return (e || "").replace(_e, (e, n, r, i, a, o) => {
262
+ var ve = /url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm, ye = /^(?:[a-z+]+:)?\/\//i, be = /^www\..*/i, xe = /^(data:)([^,]*),(.*)/i;
263
+ function Se(e, t) {
264
+ return (e || "").replace(ve, (e, n, r, i, a, o) => {
265
265
  let s = r || a || o, c = n || i || "";
266
266
  if (!s) return e;
267
- if (ve.test(s) || ye.test(s) || be.test(s)) return `url(${c}${s}${c})`;
268
- if (s[0] === "/") return `url(${c}${ge(t) + s}${c})`;
267
+ if (ye.test(s) || be.test(s) || xe.test(s)) return `url(${c}${s}${c})`;
268
+ if (s[0] === "/") return `url(${c}${_e(t) + s}${c})`;
269
269
  let l = s.split("#")[0], u = s.substring(l.length), d = t.split("#")[0].split("/"), f = l.split("/");
270
270
  d.pop();
271
271
  for (let e of f) if (e === ".") continue;
@@ -273,15 +273,15 @@ function xe(e, t) {
273
273
  return `url(${c}${d.join("/")}${u}${c})`;
274
274
  });
275
275
  }
276
- function Se(e, t = !1) {
276
+ function Ce(e, t = !1) {
277
277
  return t ? e.replace(/(\/\*[^*]*\*\/)|[\s;]/g, "") : e.replace(/(\/\*[^*]*\*\/)|[\s;]/g, "").replace(/0px/g, "0");
278
278
  }
279
- function Ce(e, t, n = !1) {
279
+ function we(e, t, n = !1) {
280
280
  let r = Array.from(t.childNodes), i = [], a = 0;
281
281
  if (r.length > 1 && e && typeof e == "string") {
282
- let t = Se(e, n), o = t.length / e.length;
282
+ let t = Ce(e, n), o = t.length / e.length;
283
283
  for (let s = 1; s < r.length; s++) if (r[s].textContent && typeof r[s].textContent == "string") {
284
- let c = Se(r[s].textContent, n), l = 3;
284
+ let c = Ce(r[s].textContent, n), l = 3;
285
285
  for (; l < c.length && (c[l].match(/[a-zA-Z0-9]/) || c.indexOf(c.substring(0, l), 1) !== -1); l++);
286
286
  for (; l < c.length; l++) {
287
287
  let u = c.substring(0, l), d = t.split(u), f = -1;
@@ -294,7 +294,7 @@ function Ce(e, t, n = !1) {
294
294
  if (d.length >= 2 && l > 100) {
295
295
  let e = r[s - 1].textContent;
296
296
  if (e && typeof e == "string") {
297
- let n = Se(e).length;
297
+ let n = Ce(e).length;
298
298
  f = t.indexOf(u, n);
299
299
  }
300
300
  f === -1 && (f = d[0].length);
@@ -303,7 +303,7 @@ function Ce(e, t, n = !1) {
303
303
  let s = Math.floor(f / o);
304
304
  for (; s > 0 && s < e.length;) {
305
305
  if (a += 1, a > 50 * r.length) return i.push(e), i;
306
- let c = Se(e.substring(0, s), n);
306
+ let c = Ce(e.substring(0, s), n);
307
307
  if (c.length === f) {
308
308
  i.push(e.substring(0, s)), e = e.substring(s), t = t.substring(f);
309
309
  break;
@@ -316,20 +316,20 @@ function Ce(e, t, n = !1) {
316
316
  }
317
317
  return i.push(e), i;
318
318
  }
319
- function we(e, t) {
320
- return Ce(e, t).join("/* rr_split */");
319
+ function Te(e, t) {
320
+ return we(e, t).join("/* rr_split */");
321
321
  }
322
- var Te = 1, Ee = /* @__PURE__ */ RegExp("[^a-z0-9-_:]"), De = -2;
323
- function Oe() {
324
- return Te++;
322
+ var Ee = 1, De = /* @__PURE__ */ RegExp("[^a-z0-9-_:]"), Oe = -2;
323
+ function ke() {
324
+ return Ee++;
325
325
  }
326
- function ke(e) {
326
+ function Ae(e) {
327
327
  if (e instanceof HTMLFormElement) return "form";
328
- let t = L(e.tagName);
329
- return Ee.test(t) ? "div" : t;
328
+ let t = I(e.tagName);
329
+ return De.test(t) ? "div" : t;
330
330
  }
331
- var Ae, je, Me = /^[^ \t\n\r\u000c]+/, Ne = /^[, \t\n\r\u000c]+/;
332
- function Pe(e, t) {
331
+ var je, Me, Ne = /^[^ \t\n\r\u000c]+/, Pe = /^[, \t\n\r\u000c]+/;
332
+ function Fe(e, t) {
333
333
  if (t.trim() === "") return t;
334
334
  let n = 0;
335
335
  function r(e) {
@@ -337,12 +337,12 @@ function Pe(e, t) {
337
337
  return i ? (r = i[0], n += r.length, r) : "";
338
338
  }
339
339
  let i = [];
340
- for (; r(Ne), !(n >= t.length);) {
341
- let a = r(Me);
342
- if (a.slice(-1) === ",") a = Ie(e, a.substring(0, a.length - 1)), i.push(a);
340
+ for (; r(Pe), !(n >= t.length);) {
341
+ let a = r(Ne);
342
+ if (a.slice(-1) === ",") a = Le(e, a.substring(0, a.length - 1)), i.push(a);
343
343
  else {
344
344
  let r = "";
345
- a = Ie(e, a);
345
+ a = Le(e, a);
346
346
  let o = !1;
347
347
  for (;;) {
348
348
  let e = t.charAt(n);
@@ -360,30 +360,30 @@ function Pe(e, t) {
360
360
  }
361
361
  return i.join(", ");
362
362
  }
363
- var Fe = /* @__PURE__ */ new WeakMap();
364
- function Ie(e, t) {
365
- return !t || t.trim() === "" ? t : Re(e, t);
363
+ var Ie = /* @__PURE__ */ new WeakMap();
364
+ function Le(e, t) {
365
+ return !t || t.trim() === "" ? t : ze(e, t);
366
366
  }
367
- function Le(e) {
367
+ function Re(e) {
368
368
  return !!(e.tagName === "svg" || e.ownerSVGElement);
369
369
  }
370
- function Re(e, t) {
371
- let n = Fe.get(e);
372
- if (n || (n = e.createElement("a"), Fe.set(e, n)), !t) t = "";
370
+ function ze(e, t) {
371
+ let n = Ie.get(e);
372
+ if (n || (n = e.createElement("a"), Ie.set(e, n)), !t) t = "";
373
373
  else if (t.startsWith("blob:") || t.startsWith("data:")) return t;
374
374
  return n.setAttribute("href", t), n.href;
375
375
  }
376
- function ze(e, t, n, r) {
376
+ function Be(e, t, n, r) {
377
377
  return r && (n === "src" || n === "href" && (t !== "use" || r[0] !== "#") || n === "xlink:href" && r[0] !== "#" || n === "background" && [
378
378
  "table",
379
379
  "td",
380
380
  "th"
381
- ].includes(t) ? Ie(e, r) : n === "srcset" ? Pe(e, r) : n === "style" ? xe(r, Re(e)) : t === "object" && n === "data" ? Ie(e, r) : r);
381
+ ].includes(t) ? Le(e, r) : n === "srcset" ? Fe(e, r) : n === "style" ? Se(r, ze(e)) : t === "object" && n === "data" ? Le(e, r) : r);
382
382
  }
383
- function Be(e, t, n) {
383
+ function Ve(e, t, n) {
384
384
  return ["video", "audio"].includes(e) && t === "autoplay";
385
385
  }
386
- function Ve(e, t, n) {
386
+ function He(e, t, n) {
387
387
  try {
388
388
  if (typeof t == "string") {
389
389
  if (e.classList.contains(t)) return !0;
@@ -395,27 +395,27 @@ function Ve(e, t, n) {
395
395
  } catch {}
396
396
  return !1;
397
397
  }
398
- function He(e, t, n) {
398
+ function Ue(e, t, n) {
399
399
  if (!e) return !1;
400
- if (e.nodeType !== e.ELEMENT_NODE) return n ? He(j.parentNode(e), t, n) : !1;
400
+ if (e.nodeType !== e.ELEMENT_NODE) return n ? Ue(A.parentNode(e), t, n) : !1;
401
401
  for (let n = e.classList.length; n--;) {
402
402
  let r = e.classList[n];
403
403
  if (t.test(r)) return !0;
404
404
  }
405
- return n ? He(j.parentNode(e), t, n) : !1;
405
+ return n ? Ue(A.parentNode(e), t, n) : !1;
406
406
  }
407
- function Ue(e, t, n, r) {
407
+ function We(e, t, n, r) {
408
408
  let i;
409
- if (ie(e)) {
410
- if (i = e, !j.childNodes(i).length) return !1;
411
- } else if (j.parentElement(e) === null) return !1;
412
- else i = j.parentElement(e);
409
+ if (ae(e)) {
410
+ if (i = e, !A.childNodes(i).length) return !1;
411
+ } else if (A.parentElement(e) === null) return !1;
412
+ else i = A.parentElement(e);
413
413
  try {
414
414
  if (typeof t == "string") {
415
415
  if (r) {
416
416
  if (i.closest(`.${t}`)) return !0;
417
417
  } else if (i.classList.contains(t)) return !0;
418
- } else if (He(i, t, r)) return !0;
418
+ } else if (Ue(i, t, r)) return !0;
419
419
  if (n) {
420
420
  if (r) {
421
421
  if (i.closest(n)) return !0;
@@ -424,9 +424,9 @@ function Ue(e, t, n, r) {
424
424
  } catch {}
425
425
  return !1;
426
426
  }
427
- function We(e, t, n) {
427
+ function Ge(e, t, n) {
428
428
  let r = t;
429
- t = U(() => H || r());
429
+ t = H(() => V || r());
430
430
  let i = e.contentWindow;
431
431
  if (!i) return;
432
432
  let a = !1, o;
@@ -448,9 +448,9 @@ function We(e, t, n) {
448
448
  if (i.location.href !== s || e.src === s || e.src === "") return setTimeout(t, 0), e.addEventListener("load", t);
449
449
  e.addEventListener("load", t);
450
450
  }
451
- function Ge(e, t, n) {
451
+ function Ke(e, t, n) {
452
452
  let r = t;
453
- t = U(() => H || r());
453
+ t = H(() => V || r());
454
454
  let i = !1, a;
455
455
  try {
456
456
  a = e.sheet;
@@ -465,8 +465,8 @@ function Ge(e, t, n) {
465
465
  clearTimeout(o), i = !0, t();
466
466
  });
467
467
  }
468
- function Ke(e, t) {
469
- let { doc: n, mirror: r, blockClass: i, blockSelector: a, needsMask: o, inlineStylesheet: s, maskInputOptions: c = {}, maskTextFn: u, maskInputFn: d, dataURLOptions: f = {}, inlineImages: p, recordCanvas: m, keepIframeSrcFn: h, newlyAddedElement: g = !1, cssCaptured: _ = !1 } = t, v = qe(n, r);
468
+ function qe(e, t) {
469
+ let { doc: n, mirror: r, blockClass: i, blockSelector: a, needsMask: o, inlineStylesheet: s, maskInputOptions: c = {}, maskTextFn: u, maskInputFn: d, dataURLOptions: f = {}, inlineImages: p, recordCanvas: m, keepIframeSrcFn: h, newlyAddedElement: g = !1, cssCaptured: _ = !1 } = t, v = Je(n, r);
470
470
  switch (e.nodeType) {
471
471
  case e.DOCUMENT_NODE: return e.compatMode === "CSS1Compat" ? {
472
472
  type: l.Document,
@@ -483,7 +483,7 @@ function Ke(e, t) {
483
483
  systemId: e.systemId,
484
484
  rootId: v
485
485
  };
486
- case e.ELEMENT_NODE: return Ye(e, {
486
+ case e.ELEMENT_NODE: return Xe(e, {
487
487
  doc: n,
488
488
  blockClass: i,
489
489
  blockSelector: a,
@@ -497,7 +497,7 @@ function Ke(e, t) {
497
497
  newlyAddedElement: g,
498
498
  rootId: v
499
499
  });
500
- case e.TEXT_NODE: return Je(e, {
500
+ case e.TEXT_NODE: return Ye(e, {
501
501
  doc: n,
502
502
  needsMask: o,
503
503
  maskTextFn: u,
@@ -511,38 +511,38 @@ function Ke(e, t) {
511
511
  };
512
512
  case e.COMMENT_NODE: return {
513
513
  type: l.Comment,
514
- textContent: j.textContent(e) || "",
514
+ textContent: A.textContent(e) || "",
515
515
  rootId: v
516
516
  };
517
517
  default: return !1;
518
518
  }
519
519
  }
520
- function qe(e, t) {
520
+ function Je(e, t) {
521
521
  if (!t.hasNode(e)) return;
522
522
  let n = t.getId(e);
523
523
  return n === 1 ? void 0 : n;
524
524
  }
525
- function Je(e, t) {
526
- let { needsMask: n, maskTextFn: r, rootId: i, cssCaptured: a } = t, o = j.parentNode(e), s = o && o.tagName, c = "", u = s === "STYLE" || void 0, d = s === "SCRIPT" || void 0;
527
- return d ? c = "SCRIPT_PLACEHOLDER" : a || (c = j.textContent(e), u && c && (c = xe(c, Re(t.doc)))), !u && !d && c && n && (c = r ? r(c, j.parentElement(e)) : c.replace(/[\S]/g, "*")), {
525
+ function Ye(e, t) {
526
+ let { needsMask: n, maskTextFn: r, rootId: i, cssCaptured: a } = t, o = A.parentNode(e), s = o && o.tagName, c = "", u = s === "STYLE" || void 0, d = s === "SCRIPT" || void 0;
527
+ return d ? c = "SCRIPT_PLACEHOLDER" : a || (c = A.textContent(e), u && c && (c = Se(c, ze(t.doc)))), !u && !d && c && n && (c = r ? r(c, A.parentElement(e)) : c.replace(/[\S]/g, "*")), {
528
528
  type: l.Text,
529
529
  textContent: c || "",
530
530
  rootId: i
531
531
  };
532
532
  }
533
- function Ye(e, t) {
534
- let { doc: n, blockClass: r, blockSelector: i, inlineStylesheet: a, maskInputOptions: o = {}, maskInputFn: s, dataURLOptions: c = {}, inlineImages: u, recordCanvas: d, keepIframeSrcFn: f, newlyAddedElement: p = !1, rootId: m } = t, h = Ve(e, r, i), g = ke(e), _ = {}, v = e.attributes.length;
533
+ function Xe(e, t) {
534
+ let { doc: n, blockClass: r, blockSelector: i, inlineStylesheet: a, maskInputOptions: o = {}, maskInputFn: s, dataURLOptions: c = {}, inlineImages: u, recordCanvas: d, keepIframeSrcFn: f, newlyAddedElement: p = !1, rootId: m } = t, h = He(e, r, i), g = Ae(e), _ = {}, v = e.attributes.length;
535
535
  for (let t = 0; t < v; t++) {
536
536
  let r = e.attributes[t];
537
- Be(g, r.name, r.value) || (_[r.name] = ze(n, g, L(r.name), r.value));
537
+ Ve(g, r.name, r.value) || (_[r.name] = Be(n, g, I(r.name), r.value));
538
538
  }
539
539
  if (g === "link" && a) {
540
540
  let t = Array.from(n.styleSheets).find((t) => t.href === e.href), r = null;
541
- t && (r = se(t)), r && (delete _.rel, delete _.href, _._cssText = r);
541
+ t && (r = ce(t)), r && (delete _.rel, delete _.href, _._cssText = r);
542
542
  }
543
543
  if (g === "style" && e.sheet) {
544
- let t = se(e.sheet);
545
- t && (e.childNodes.length > 1 && (t = we(t, e)), _._cssText = t);
544
+ let t = ce(e.sheet);
545
+ t && (e.childNodes.length > 1 && (t = Te(t, e)), _._cssText = t);
546
546
  }
547
547
  if ([
548
548
  "input",
@@ -550,9 +550,9 @@ function Ye(e, t) {
550
550
  "select"
551
551
  ].includes(g)) {
552
552
  let t = e.value, n = e.checked;
553
- _.type !== "radio" && _.type !== "checkbox" && _.type !== "submit" && _.type !== "button" && t ? _.value = I({
553
+ _.type !== "radio" && _.type !== "checkbox" && _.type !== "submit" && _.type !== "button" && t ? _.value = F({
554
554
  element: e,
555
- type: me(e),
555
+ type: he(e),
556
556
  tagName: g,
557
557
  value: t,
558
558
  maskInputOptions: o,
@@ -560,18 +560,18 @@ function Ye(e, t) {
560
560
  }) : n && (_.checked = n);
561
561
  }
562
562
  if (g === "option" && (e.selected && !o.select ? _.selected = !0 : delete _.selected), g === "dialog" && e.open && (_.rr_open_mode = e.matches("dialog:modal") ? "modal" : "non-modal"), g === "canvas" && d) {
563
- if (e.__context === "2d") pe(e) || (_.rr_dataURL = e.toDataURL(c.type, c.quality));
563
+ if (e.__context === "2d") me(e) || (_.rr_dataURL = e.toDataURL(c.type, c.quality));
564
564
  else if (!("__context" in e)) {
565
565
  let t = e.toDataURL(c.type, c.quality), r = n.createElement("canvas");
566
566
  r.width = e.width, r.height = e.height, t !== r.toDataURL(c.type, c.quality) && (_.rr_dataURL = t);
567
567
  }
568
568
  }
569
569
  if (g === "img" && u) {
570
- Ae || (Ae = n.createElement("canvas"), je = Ae.getContext("2d"));
570
+ je || (je = n.createElement("canvas"), Me = je.getContext("2d"));
571
571
  let t = e, r = t.currentSrc || t.getAttribute("src") || "<unknown-src>", i = t.crossOrigin, a = () => {
572
572
  t.removeEventListener("load", a);
573
573
  try {
574
- Ae.width = t.naturalWidth, Ae.height = t.naturalHeight, je.drawImage(t, 0, 0), _.rr_dataURL = Ae.toDataURL(c.type, c.quality);
574
+ je.width = t.naturalWidth, je.height = t.naturalHeight, Me.drawImage(t, 0, 0), _.rr_dataURL = je.toDataURL(c.type, c.quality);
575
575
  } catch (e) {
576
576
  if (t.crossOrigin !== "anonymous") {
577
577
  t.crossOrigin = "anonymous", t.complete && t.naturalWidth !== 0 ? a() : t.addEventListener("load", a);
@@ -604,16 +604,16 @@ function Ye(e, t) {
604
604
  tagName: g,
605
605
  attributes: _,
606
606
  childNodes: [],
607
- isSVG: Le(e) || void 0,
607
+ isSVG: Re(e) || void 0,
608
608
  needBlock: h,
609
609
  rootId: m,
610
610
  isCustom: y
611
611
  };
612
612
  }
613
- function R(e) {
613
+ function L(e) {
614
614
  return e == null ? "" : e.toLowerCase();
615
615
  }
616
- function Xe(e) {
616
+ function Ze(e) {
617
617
  return e === !0 || e === "all" ? {
618
618
  script: !0,
619
619
  comment: !0,
@@ -628,13 +628,13 @@ function Xe(e) {
628
628
  headTitleMutations: e === "all"
629
629
  } : e || {};
630
630
  }
631
- function Ze(e, t) {
632
- return !!(t.comment && e.type === l.Comment || e.type === l.Element && (t.script && (e.tagName === "script" || e.tagName === "link" && (e.attributes.rel === "preload" && e.attributes.as === "script" || e.attributes.rel === "modulepreload") || e.tagName === "link" && e.attributes.rel === "prefetch" && typeof e.attributes.href == "string" && he(e.attributes.href) === "js") || t.headFavicon && (e.tagName === "link" && e.attributes.rel === "shortcut icon" || e.tagName === "meta" && (R(e.attributes.name).match(/^msapplication-tile(image|color)$/) || R(e.attributes.name) === "application-name" || R(e.attributes.rel) === "icon" || R(e.attributes.rel) === "apple-touch-icon" || R(e.attributes.rel) === "shortcut icon")) || e.tagName === "meta" && (t.headMetaDescKeywords && R(e.attributes.name).match(/^description|keywords$/) || t.headMetaSocial && (R(e.attributes.property).match(/^(og|twitter|fb):/) || R(e.attributes.name).match(/^(og|twitter):/) || R(e.attributes.name) === "pinterest") || t.headMetaRobots && (R(e.attributes.name) === "robots" || R(e.attributes.name) === "googlebot" || R(e.attributes.name) === "bingbot") || t.headMetaHttpEquiv && e.attributes["http-equiv"] !== void 0 || t.headMetaAuthorship && (R(e.attributes.name) === "author" || R(e.attributes.name) === "generator" || R(e.attributes.name) === "framework" || R(e.attributes.name) === "publisher" || R(e.attributes.name) === "progid" || R(e.attributes.property).match(/^article:/) || R(e.attributes.property).match(/^product:/)) || t.headMetaVerification && (R(e.attributes.name) === "google-site-verification" || R(e.attributes.name) === "yandex-verification" || R(e.attributes.name) === "csrf-token" || R(e.attributes.name) === "p:domain_verify" || R(e.attributes.name) === "verify-v1" || R(e.attributes.name) === "verification" || R(e.attributes.name) === "shopify-checkout-api-token"))));
633
- }
634
631
  function Qe(e, t) {
635
- let { doc: n, mirror: r, blockClass: i, blockSelector: a, maskTextClass: o, maskTextSelector: s, skipChild: c = !1, inlineStylesheet: u = !0, maskInputOptions: d = {}, maskTextFn: f, maskInputFn: p, slimDOMOptions: m, dataURLOptions: h = {}, inlineImages: g = !1, recordCanvas: _ = !1, onSerialize: v, onIframeLoad: y, iframeLoadTimeout: b = 5e3, onStylesheetLoad: x, stylesheetLoadTimeout: S = 5e3, keepIframeSrcFn: C = () => !1, newlyAddedElement: w = !1, cssCaptured: ee = !1 } = t, { needsMask: T } = t, { preserveWhiteSpace: E = !0 } = t;
636
- T ||= Ue(e, o, s, T === void 0);
637
- let D = Ke(e, {
632
+ return !!(t.comment && e.type === l.Comment || e.type === l.Element && (t.script && (e.tagName === "script" || e.tagName === "link" && (e.attributes.rel === "preload" && e.attributes.as === "script" || e.attributes.rel === "modulepreload") || e.tagName === "link" && e.attributes.rel === "prefetch" && typeof e.attributes.href == "string" && ge(e.attributes.href) === "js") || t.headFavicon && (e.tagName === "link" && e.attributes.rel === "shortcut icon" || e.tagName === "meta" && (L(e.attributes.name).match(/^msapplication-tile(image|color)$/) || L(e.attributes.name) === "application-name" || L(e.attributes.rel) === "icon" || L(e.attributes.rel) === "apple-touch-icon" || L(e.attributes.rel) === "shortcut icon")) || e.tagName === "meta" && (t.headMetaDescKeywords && L(e.attributes.name).match(/^description|keywords$/) || t.headMetaSocial && (L(e.attributes.property).match(/^(og|twitter|fb):/) || L(e.attributes.name).match(/^(og|twitter):/) || L(e.attributes.name) === "pinterest") || t.headMetaRobots && (L(e.attributes.name) === "robots" || L(e.attributes.name) === "googlebot" || L(e.attributes.name) === "bingbot") || t.headMetaHttpEquiv && e.attributes["http-equiv"] !== void 0 || t.headMetaAuthorship && (L(e.attributes.name) === "author" || L(e.attributes.name) === "generator" || L(e.attributes.name) === "framework" || L(e.attributes.name) === "publisher" || L(e.attributes.name) === "progid" || L(e.attributes.property).match(/^article:/) || L(e.attributes.property).match(/^product:/)) || t.headMetaVerification && (L(e.attributes.name) === "google-site-verification" || L(e.attributes.name) === "yandex-verification" || L(e.attributes.name) === "csrf-token" || L(e.attributes.name) === "p:domain_verify" || L(e.attributes.name) === "verify-v1" || L(e.attributes.name) === "verification" || L(e.attributes.name) === "shopify-checkout-api-token"))));
633
+ }
634
+ function $e(e, t) {
635
+ let { doc: n, mirror: r, blockClass: i, blockSelector: a, maskTextClass: o, maskTextSelector: s, skipChild: c = !1, inlineStylesheet: u = !0, maskInputOptions: d = {}, maskTextFn: f, maskInputFn: p, slimDOMOptions: m, dataURLOptions: h = {}, inlineImages: g = !1, recordCanvas: _ = !1, onSerialize: v, onIframeLoad: y, iframeLoadTimeout: b = 5e3, onStylesheetLoad: x, stylesheetLoadTimeout: S = 5e3, keepIframeSrcFn: C = () => !1, newlyAddedElement: w = !1, cssCaptured: ee = !1 } = t, { needsMask: T } = t, { preserveWhiteSpace: te = !0 } = t;
636
+ T ||= We(e, o, s, T === void 0);
637
+ let E = qe(e, {
638
638
  doc: n,
639
639
  mirror: r,
640
640
  blockClass: i,
@@ -651,20 +651,20 @@ function Qe(e, t) {
651
651
  newlyAddedElement: w,
652
652
  cssCaptured: ee
653
653
  });
654
- if (!D) return console.warn(e, "not serialized"), null;
655
- let O;
656
- O = r.hasNode(e) ? r.getId(e) : Ze(D, m) || !E && D.type === l.Text && !D.textContent.replace(/^\s+|\s+$/gm, "").length ? De : Oe();
657
- let k = Object.assign(D, { id: O });
658
- if (r.add(e, k), O === De) return null;
654
+ if (!E) return console.warn(e, "not serialized"), null;
655
+ let D;
656
+ D = r.hasNode(e) ? r.getId(e) : Qe(E, m) || !te && E.type === l.Text && !E.textContent.replace(/^\s+|\s+$/gm, "").length ? Oe : ke();
657
+ let O = Object.assign(E, { id: D });
658
+ if (r.add(e, O), D === Oe) return null;
659
659
  v && v(e);
660
- let te = !c;
661
- if (k.type === l.Element) {
662
- te &&= !k.needBlock, delete k.needBlock;
663
- let t = j.shadowRoot(e);
664
- t && N(t) && (k.isShadowHost = !0);
665
- }
666
- if ((k.type === l.Document || k.type === l.Element) && te) {
667
- m.headWhitespace && k.type === l.Element && k.tagName === "head" && (E = !1);
660
+ let ne = !c;
661
+ if (O.type === l.Element) {
662
+ ne &&= !O.needBlock, delete O.needBlock;
663
+ let t = A.shadowRoot(e);
664
+ t && M(t) && (O.isShadowHost = !0);
665
+ }
666
+ if ((O.type === l.Document || O.type === l.Element) && ne) {
667
+ m.headWhitespace && O.type === l.Element && O.tagName === "head" && (te = !1);
668
668
  let t = {
669
669
  doc: n,
670
670
  mirror: r,
@@ -682,7 +682,7 @@ function Qe(e, t) {
682
682
  dataURLOptions: h,
683
683
  inlineImages: g,
684
684
  recordCanvas: _,
685
- preserveWhiteSpace: E,
685
+ preserveWhiteSpace: te,
686
686
  onSerialize: v,
687
687
  onIframeLoad: y,
688
688
  iframeLoadTimeout: b,
@@ -691,24 +691,24 @@ function Qe(e, t) {
691
691
  keepIframeSrcFn: C,
692
692
  cssCaptured: !1
693
693
  };
694
- if (k.type !== l.Element || k.tagName !== "textarea" || k.attributes.value === void 0) {
695
- k.type === l.Element && k.attributes._cssText !== void 0 && typeof k.attributes._cssText == "string" && (t.cssCaptured = !0);
696
- for (let n of Array.from(j.childNodes(e))) {
697
- let e = Qe(n, t);
698
- e && k.childNodes.push(e);
694
+ if (O.type !== l.Element || O.tagName !== "textarea" || O.attributes.value === void 0) {
695
+ O.type === l.Element && O.attributes._cssText !== void 0 && typeof O.attributes._cssText == "string" && (t.cssCaptured = !0);
696
+ for (let n of Array.from(A.childNodes(e))) {
697
+ let e = $e(n, t);
698
+ e && O.childNodes.push(e);
699
699
  }
700
700
  }
701
701
  let w = null;
702
- if (ie(e) && (w = j.shadowRoot(e))) for (let e of Array.from(j.childNodes(w))) {
703
- let n = Qe(e, t);
704
- n && (N(w) && (n.isShadow = !0), k.childNodes.push(n));
702
+ if (ae(e) && (w = A.shadowRoot(e))) for (let e of Array.from(A.childNodes(w))) {
703
+ let n = $e(e, t);
704
+ n && (M(w) && (n.isShadow = !0), O.childNodes.push(n));
705
705
  }
706
706
  }
707
- let ne = j.parentNode(e);
708
- return ne && M(ne) && N(ne) && (k.isShadow = !0), k.type === l.Element && k.tagName === "iframe" && We(e, () => {
707
+ let re = A.parentNode(e);
708
+ return re && j(re) && M(re) && (O.isShadow = !0), O.type === l.Element && O.tagName === "iframe" && Ge(e, () => {
709
709
  let t = e.contentDocument;
710
710
  if (t && y) {
711
- let n = Qe(t, {
711
+ let n = $e(t, {
712
712
  doc: t,
713
713
  mirror: r,
714
714
  blockClass: i,
@@ -725,7 +725,7 @@ function Qe(e, t) {
725
725
  dataURLOptions: h,
726
726
  inlineImages: g,
727
727
  recordCanvas: _,
728
- preserveWhiteSpace: E,
728
+ preserveWhiteSpace: te,
729
729
  onSerialize: v,
730
730
  onIframeLoad: y,
731
731
  iframeLoadTimeout: b,
@@ -735,9 +735,9 @@ function Qe(e, t) {
735
735
  });
736
736
  n && y(e, n);
737
737
  }
738
- }, b), k.type === l.Element && k.tagName === "link" && typeof k.attributes.rel == "string" && (k.attributes.rel === "stylesheet" || k.attributes.rel === "preload" && typeof k.attributes.href == "string" && he(k.attributes.href) === "css") && Ge(e, () => {
738
+ }, b), O.type === l.Element && O.tagName === "link" && typeof O.attributes.rel == "string" && (O.attributes.rel === "stylesheet" || O.attributes.rel === "preload" && typeof O.attributes.href == "string" && ge(O.attributes.href) === "css") && Ke(e, () => {
739
739
  if (x) {
740
- let t = Qe(e, {
740
+ let t = $e(e, {
741
741
  doc: n,
742
742
  mirror: r,
743
743
  blockClass: i,
@@ -754,7 +754,7 @@ function Qe(e, t) {
754
754
  dataURLOptions: h,
755
755
  inlineImages: g,
756
756
  recordCanvas: _,
757
- preserveWhiteSpace: E,
757
+ preserveWhiteSpace: te,
758
758
  onSerialize: v,
759
759
  onIframeLoad: y,
760
760
  iframeLoadTimeout: b,
@@ -764,11 +764,11 @@ function Qe(e, t) {
764
764
  });
765
765
  t && x(e, t);
766
766
  }
767
- }, S), k;
767
+ }, S), O;
768
768
  }
769
- function $e(e, t) {
770
- let { mirror: n = new P(), blockClass: r = "rr-block", blockSelector: i = null, maskTextClass: a = "rr-mask", maskTextSelector: o = null, inlineStylesheet: s = !0, inlineImages: c = !1, recordCanvas: l = !1, maskAllInputs: u = !1, maskTextFn: d, maskInputFn: f, slimDOM: p = !1, dataURLOptions: m, preserveWhiteSpace: h, onSerialize: g, onIframeLoad: _, iframeLoadTimeout: v, onStylesheetLoad: y, stylesheetLoadTimeout: b, keepIframeSrcFn: x = () => !1 } = t;
771
- return Qe(e, {
769
+ function et(e, t) {
770
+ let { mirror: n = new N(), blockClass: r = "rr-block", blockSelector: i = null, maskTextClass: a = "rr-mask", maskTextSelector: o = null, inlineStylesheet: s = !0, inlineImages: c = !1, recordCanvas: l = !1, maskAllInputs: u = !1, maskTextFn: d, maskInputFn: f, slimDOM: p = !1, dataURLOptions: m, preserveWhiteSpace: h, onSerialize: g, onIframeLoad: _, iframeLoadTimeout: v, onStylesheetLoad: y, stylesheetLoadTimeout: b, keepIframeSrcFn: x = () => !1 } = t;
771
+ return $e(e, {
772
772
  doc: e,
773
773
  mirror: n,
774
774
  blockClass: r,
@@ -797,7 +797,7 @@ function $e(e, t) {
797
797
  } : u === !1 ? { password: !0 } : u,
798
798
  maskTextFn: d,
799
799
  maskInputFn: f,
800
- slimDOMOptions: Xe(p),
800
+ slimDOMOptions: Ze(p),
801
801
  dataURLOptions: m,
802
802
  inlineImages: c,
803
803
  recordCanvas: l,
@@ -811,7 +811,7 @@ function $e(e, t) {
811
811
  newlyAddedElement: !1
812
812
  });
813
813
  }
814
- var et = class e {
814
+ var tt = class e {
815
815
  constructor(...e) {
816
816
  n(this, "parentElement", null), n(this, "parentNode", null), n(this, "ownerDocument"), n(this, "firstChild", null), n(this, "lastChild", null), n(this, "previousSibling", null), n(this, "nextSibling", null), n(this, "ELEMENT_NODE", 1), n(this, "TEXT_NODE", 3), n(this, "nodeType"), n(this, "nodeName"), n(this, "RRNodeType");
817
817
  }
@@ -842,109 +842,109 @@ var et = class e {
842
842
  return "RRNode";
843
843
  }
844
844
  };
845
- function z(e, t, n = document) {
845
+ function R(e, t, n = document) {
846
846
  let r = {
847
847
  capture: !0,
848
848
  passive: !0
849
849
  };
850
850
  return n.addEventListener(e, t, r), () => n.removeEventListener(e, t, r);
851
851
  }
852
- var tt = "Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.", nt = {
852
+ var nt = "Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.", rt = {
853
853
  map: {},
854
854
  getId() {
855
- return console.error(tt), -1;
855
+ return console.error(nt), -1;
856
856
  },
857
857
  getNode() {
858
- return console.error(tt), null;
858
+ return console.error(nt), null;
859
859
  },
860
860
  removeNodeFromMap() {
861
- console.error(tt);
861
+ console.error(nt);
862
862
  },
863
863
  has() {
864
- return console.error(tt), !1;
864
+ return console.error(nt), !1;
865
865
  },
866
866
  reset() {
867
- console.error(tt);
867
+ console.error(nt);
868
868
  }
869
869
  };
870
- typeof window < "u" && window.Proxy && window.Reflect && (nt = new Proxy(nt, { get(e, t, n) {
871
- return t === "map" && console.error(tt), Reflect.get(e, t, n);
870
+ typeof window < "u" && window.Proxy && window.Reflect && (rt = new Proxy(rt, { get(e, t, n) {
871
+ return t === "map" && console.error(nt), Reflect.get(e, t, n);
872
872
  } }));
873
- function rt(e, t, n = {}) {
873
+ function it(e, t, n = {}) {
874
874
  let r = null, i = 0;
875
875
  return function(...a) {
876
876
  let o = Date.now();
877
877
  !i && n.leading === !1 && (i = o);
878
878
  let s = t - (o - i), c = this;
879
879
  s <= 0 || s > t ? (r &&= (clearTimeout(r), null), i = o, e.apply(c, a)) : !r && n.trailing !== !1 && (r = setTimeout(() => {
880
- i = n.leading === !1 ? 0 : Date.now(), r = null, H || e.apply(c, a);
880
+ i = n.leading === !1 ? 0 : Date.now(), r = null, V || e.apply(c, a);
881
881
  }, s));
882
882
  };
883
883
  }
884
- function it(e, t, n, r, i = window) {
884
+ function at(e, t, n, r, i = window) {
885
885
  let a = i.Object.getOwnPropertyDescriptor(e, t);
886
886
  return i.Object.defineProperty(e, t, r ? n : { set(e) {
887
- H || setTimeout(() => {
888
- H || n.set.call(this, e);
887
+ V || setTimeout(() => {
888
+ V || n.set.call(this, e);
889
889
  }, 0), a && a.set && a.set.call(this, e);
890
- } }), () => H || it(e, t, a || {}, !0);
890
+ } }), () => V || at(e, t, a || {}, !0);
891
891
  }
892
- function at(e) {
892
+ function ot(e) {
893
893
  let t = e.document;
894
894
  return {
895
- left: t.scrollingElement ? t.scrollingElement.scrollLeft : e.pageXOffset === void 0 ? t.documentElement.scrollLeft || t?.body && j.parentElement(t.body)?.scrollLeft || t?.body?.scrollLeft || 0 : e.pageXOffset,
896
- top: t.scrollingElement ? t.scrollingElement.scrollTop : e.pageYOffset === void 0 ? t?.documentElement.scrollTop || t?.body && j.parentElement(t.body)?.scrollTop || t?.body?.scrollTop || 0 : e.pageYOffset
895
+ left: t.scrollingElement ? t.scrollingElement.scrollLeft : e.pageXOffset === void 0 ? t.documentElement.scrollLeft || t?.body && A.parentElement(t.body)?.scrollLeft || t?.body?.scrollLeft || 0 : e.pageXOffset,
896
+ top: t.scrollingElement ? t.scrollingElement.scrollTop : e.pageYOffset === void 0 ? t?.documentElement.scrollTop || t?.body && A.parentElement(t.body)?.scrollTop || t?.body?.scrollTop || 0 : e.pageYOffset
897
897
  };
898
898
  }
899
- function ot() {
899
+ function st() {
900
900
  return window.innerHeight || document.documentElement && document.documentElement.clientHeight || document.body && document.body.clientHeight;
901
901
  }
902
- function st() {
902
+ function ct() {
903
903
  return window.innerWidth || document.documentElement && document.documentElement.clientWidth || document.body && document.body.clientWidth;
904
904
  }
905
- function ct(e) {
906
- return e ? e.nodeType === e.ELEMENT_NODE ? e : j.parentElement(e) : null;
905
+ function lt(e) {
906
+ return e ? e.nodeType === e.ELEMENT_NODE ? e : A.parentElement(e) : null;
907
907
  }
908
- function B(e, t, n, r) {
908
+ function z(e, t, n, r) {
909
909
  if (!e) return !1;
910
- let i = ct(e);
910
+ let i = lt(e);
911
911
  if (!i) return !1;
912
912
  try {
913
913
  if (typeof t == "string") {
914
914
  if (i.classList.contains(t) || r && i.closest("." + t) !== null) return !0;
915
- } else if (He(i, t, r)) return !0;
915
+ } else if (Ue(i, t, r)) return !0;
916
916
  } catch {}
917
917
  return !!(n && (i.matches(n) || r && i.closest(n) !== null));
918
918
  }
919
- function lt(e, t) {
919
+ function ut(e, t) {
920
920
  return t.getId(e) !== -1;
921
921
  }
922
- function ut(e, t, n) {
923
- return e.tagName === "TITLE" && n.headTitleMutations ? !0 : t.getId(e) === De;
922
+ function dt(e, t, n) {
923
+ return e.tagName === "TITLE" && n.headTitleMutations ? !0 : t.getId(e) === Oe;
924
924
  }
925
- function dt(e, t) {
926
- if (M(e)) return !1;
925
+ function ft(e, t) {
926
+ if (j(e)) return !1;
927
927
  let n = t.getId(e);
928
928
  if (!t.has(n)) return !0;
929
- let r = j.parentNode(e);
930
- return r && r.nodeType === e.DOCUMENT_NODE ? !1 : !r || dt(r, t);
929
+ let r = A.parentNode(e);
930
+ return r && r.nodeType === e.DOCUMENT_NODE ? !1 : !r || ft(r, t);
931
931
  }
932
- function ft(e) {
932
+ function pt(e) {
933
933
  return !!e.changedTouches;
934
934
  }
935
- function pt(e = window) {
935
+ function mt(e = window) {
936
936
  "NodeList" in e && !e.NodeList.prototype.forEach && (e.NodeList.prototype.forEach = Array.prototype.forEach), "DOMTokenList" in e && !e.DOMTokenList.prototype.forEach && (e.DOMTokenList.prototype.forEach = Array.prototype.forEach);
937
937
  }
938
- function mt(e, t) {
938
+ function ht(e, t) {
939
939
  return !!(e.nodeName === "IFRAME" && t.getMeta(e));
940
940
  }
941
- function ht(e, t) {
941
+ function gt(e, t) {
942
942
  return !!(e.nodeName === "LINK" && e.nodeType === e.ELEMENT_NODE && e.getAttribute && e.getAttribute("rel") === "stylesheet" && t.getMeta(e));
943
943
  }
944
- function gt(e) {
945
- return e ? e instanceof et && "shadowRoot" in e ? !!e.shadowRoot : !!j.shadowRoot(e) : !1;
944
+ function _t(e) {
945
+ return e ? e instanceof tt && "shadowRoot" in e ? !!e.shadowRoot : !!A.shadowRoot(e) : !1;
946
946
  }
947
- var _t = class {
947
+ var vt = class {
948
948
  constructor() {
949
949
  n(this, "id", 1), n(this, "styleIDMap", /* @__PURE__ */ new WeakMap()), n(this, "idStyleMap", /* @__PURE__ */ new Map());
950
950
  }
@@ -969,29 +969,29 @@ var _t = class {
969
969
  return this.id++;
970
970
  }
971
971
  };
972
- function vt(e) {
972
+ function yt(e) {
973
973
  let t = null;
974
- return "getRootNode" in e && j.getRootNode(e)?.nodeType === Node.DOCUMENT_FRAGMENT_NODE && j.host(j.getRootNode(e)) && (t = j.host(j.getRootNode(e))), t;
974
+ return "getRootNode" in e && A.getRootNode(e)?.nodeType === Node.DOCUMENT_FRAGMENT_NODE && A.host(A.getRootNode(e)) && (t = A.host(A.getRootNode(e))), t;
975
975
  }
976
- function yt(e) {
976
+ function bt(e) {
977
977
  let t = e, n;
978
- for (; n = vt(t);) t = n;
978
+ for (; n = yt(t);) t = n;
979
979
  return t;
980
980
  }
981
- function bt(e) {
982
- let t = j.ownerDocument(e);
983
- if (!t) return !1;
984
- let n = yt(e);
985
- return j.contains(t, n);
986
- }
987
981
  function xt(e) {
988
- let t = j.ownerDocument(e);
989
- return t ? j.contains(t, e) || bt(e) : !1;
982
+ let t = A.ownerDocument(e);
983
+ if (!t) return !1;
984
+ let n = bt(e);
985
+ return A.contains(t, n);
990
986
  }
991
987
  function St(e) {
988
+ let t = A.ownerDocument(e);
989
+ return t ? A.contains(t, e) || xt(e) : !1;
990
+ }
991
+ function Ct(e) {
992
992
  return "__ln" in e;
993
993
  }
994
- var Ct = class {
994
+ var wt = class {
995
995
  constructor() {
996
996
  n(this, "length", 0), n(this, "head", null), n(this, "tail", null);
997
997
  }
@@ -1007,10 +1007,10 @@ var Ct = class {
1007
1007
  previous: null,
1008
1008
  next: null
1009
1009
  };
1010
- if (e.__ln = t, e.previousSibling && St(e.previousSibling)) {
1010
+ if (e.__ln = t, e.previousSibling && Ct(e.previousSibling)) {
1011
1011
  let n = e.previousSibling.__ln.next;
1012
1012
  t.next = n, t.previous = e.previousSibling.__ln, e.previousSibling.__ln.next = t, n && (n.previous = t);
1013
- } else if (e.nextSibling && St(e.nextSibling) && e.nextSibling.__ln.previous) {
1013
+ } else if (e.nextSibling && Ct(e.nextSibling) && e.nextSibling.__ln.previous) {
1014
1014
  let n = e.nextSibling.__ln.previous;
1015
1015
  t.previous = n, t.next = e.nextSibling.__ln, e.nextSibling.__ln.previous = t, n && (n.next = t);
1016
1016
  } else this.head && (this.head.previous = t), t.next = this.head, this.head = t;
@@ -1020,28 +1020,28 @@ var Ct = class {
1020
1020
  let t = e.__ln;
1021
1021
  this.head && (t.previous ? (t.previous.next = t.next, t.next ? t.next.previous = t.previous : this.tail = t.previous) : (this.head = t.next, this.head ? this.head.previous = null : this.tail = null), e.__ln && delete e.__ln, this.length--);
1022
1022
  }
1023
- }, wt = (e, t) => `${e}@${t}`, Tt = class {
1023
+ }, Tt = (e, t) => `${e}@${t}`, Et = class {
1024
1024
  constructor() {
1025
1025
  n(this, "frozen", !1), n(this, "locked", !1), n(this, "texts", []), n(this, "attributes", []), n(this, "attributeMap", /* @__PURE__ */ new WeakMap()), n(this, "removes", []), n(this, "mapRemoves", []), n(this, "movedMap", {}), n(this, "addedSet", /* @__PURE__ */ new Set()), n(this, "movedSet", /* @__PURE__ */ new Set()), n(this, "droppedSet", /* @__PURE__ */ new Set()), n(this, "removesSubTreeCache", /* @__PURE__ */ new Set()), n(this, "mutationCb"), n(this, "blockClass"), n(this, "blockSelector"), n(this, "maskTextClass"), n(this, "maskTextSelector"), n(this, "inlineStylesheet"), n(this, "maskInputOptions"), n(this, "maskTextFn"), n(this, "maskInputFn"), n(this, "keepIframeSrcFn"), n(this, "recordCanvas"), n(this, "inlineImages"), n(this, "slimDOMOptions"), n(this, "dataURLOptions"), n(this, "doc"), n(this, "mirror"), n(this, "iframeManager"), n(this, "stylesheetManager"), n(this, "shadowDomManager"), n(this, "canvasManager"), n(this, "processedNodeManager"), n(this, "unattachedDoc"), n(this, "processMutations", (e) => {
1026
1026
  e.forEach(this.processMutation), this.emit();
1027
1027
  }), n(this, "emit", () => {
1028
1028
  if (this.frozen || this.locked) return;
1029
- let e = [], t = /* @__PURE__ */ new Set(), n = new Ct(), r = (e) => {
1030
- let t = e, n = De;
1031
- for (; n === De;) t &&= t.nextSibling, n = t && this.mirror.getId(t);
1029
+ let e = [], t = /* @__PURE__ */ new Set(), n = new wt(), r = (e) => {
1030
+ let t = e, n = Oe;
1031
+ for (; n === Oe;) t &&= t.nextSibling, n = t && this.mirror.getId(t);
1032
1032
  return n;
1033
1033
  }, i = (i) => {
1034
- let a = j.parentNode(i);
1035
- if (!a || !xt(i)) return;
1034
+ let a = A.parentNode(i);
1035
+ if (!a || !St(i)) return;
1036
1036
  let o = !1;
1037
1037
  if (i.nodeType === Node.TEXT_NODE) {
1038
1038
  let e = a.tagName;
1039
1039
  if (e === "TEXTAREA") return;
1040
1040
  e === "STYLE" && this.addedSet.has(a) && (o = !0);
1041
1041
  }
1042
- let s = M(a) ? this.mirror.getId(vt(i)) : this.mirror.getId(a), c = r(i);
1042
+ let s = j(a) ? this.mirror.getId(yt(i)) : this.mirror.getId(a), c = r(i);
1043
1043
  if (s === -1 || c === -1) return n.addNode(i);
1044
- let l = Qe(i, {
1044
+ let l = $e(i, {
1045
1045
  doc: this.doc,
1046
1046
  mirror: this.mirror,
1047
1047
  blockClass: this.blockClass,
@@ -1059,7 +1059,7 @@ var Ct = class {
1059
1059
  recordCanvas: this.recordCanvas,
1060
1060
  inlineImages: this.inlineImages,
1061
1061
  onSerialize: (e) => {
1062
- mt(e, this.mirror) && this.iframeManager.addIframe(e), ht(e, this.mirror) && this.stylesheetManager.trackLinkElement(e), gt(i) && this.shadowDomManager.addShadowRoot(j.shadowRoot(i), this.doc);
1062
+ ht(e, this.mirror) && this.iframeManager.addIframe(e), gt(e, this.mirror) && this.stylesheetManager.trackLinkElement(e), _t(i) && this.shadowDomManager.addShadowRoot(A.shadowRoot(i), this.doc);
1063
1063
  },
1064
1064
  onIframeLoad: (e, t) => {
1065
1065
  this.iframeManager.attachIframe(e, t), this.shadowDomManager.observeAttachShadow(e);
@@ -1076,13 +1076,13 @@ var Ct = class {
1076
1076
  }), t.add(l.id));
1077
1077
  };
1078
1078
  for (; this.mapRemoves.length;) this.mirror.removeNodeFromMap(this.mapRemoves.shift());
1079
- for (let e of this.movedSet) Ot(this.removesSubTreeCache, e, this.mirror) && !this.movedSet.has(j.parentNode(e)) || i(e);
1080
- for (let e of this.addedSet) !At(this.droppedSet, e) && !Ot(this.removesSubTreeCache, e, this.mirror) || At(this.movedSet, e) ? i(e) : this.droppedSet.add(e);
1079
+ for (let e of this.movedSet) kt(this.removesSubTreeCache, e, this.mirror) && !this.movedSet.has(A.parentNode(e)) || i(e);
1080
+ for (let e of this.addedSet) !jt(this.droppedSet, e) && !kt(this.removesSubTreeCache, e, this.mirror) || jt(this.movedSet, e) ? i(e) : this.droppedSet.add(e);
1081
1081
  let a = null;
1082
1082
  for (; n.length;) {
1083
1083
  let e = null;
1084
1084
  if (a) {
1085
- let t = this.mirror.getId(j.parentNode(a.value)), n = r(a.value);
1085
+ let t = this.mirror.getId(A.parentNode(a.value)), n = r(a.value);
1086
1086
  t !== -1 && n !== -1 && (e = a);
1087
1087
  }
1088
1088
  if (!e) {
@@ -1090,15 +1090,15 @@ var Ct = class {
1090
1090
  for (; t;) {
1091
1091
  let n = t;
1092
1092
  if (t = t.previous, n) {
1093
- let t = this.mirror.getId(j.parentNode(n.value));
1093
+ let t = this.mirror.getId(A.parentNode(n.value));
1094
1094
  if (r(n.value) === -1) continue;
1095
1095
  if (t !== -1) {
1096
1096
  e = n;
1097
1097
  break;
1098
1098
  } else {
1099
- let t = n.value, r = j.parentNode(t);
1099
+ let t = n.value, r = A.parentNode(t);
1100
1100
  if (r && r.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
1101
- let t = j.host(r);
1101
+ let t = A.host(r);
1102
1102
  if (this.mirror.getId(t) !== -1) {
1103
1103
  e = n;
1104
1104
  break;
@@ -1116,7 +1116,7 @@ var Ct = class {
1116
1116
  }
1117
1117
  let o = {
1118
1118
  texts: this.texts.map((e) => {
1119
- let t = e.node, n = j.parentNode(t);
1119
+ let t = e.node, n = A.parentNode(t);
1120
1120
  return n && n.tagName === "TEXTAREA" && this.genTextAreaValueMutation(n), {
1121
1121
  id: this.mirror.getId(t),
1122
1122
  value: e.value
@@ -1145,21 +1145,21 @@ var Ct = class {
1145
1145
  styleDiff: {},
1146
1146
  _unchangedStyles: {}
1147
1147
  }, this.attributes.push(t), this.attributeMap.set(e, t));
1148
- let n = Array.from(j.childNodes(e), (e) => j.textContent(e) || "").join("");
1149
- t.attributes.value = I({
1148
+ let n = Array.from(A.childNodes(e), (e) => A.textContent(e) || "").join("");
1149
+ t.attributes.value = F({
1150
1150
  element: e,
1151
1151
  maskInputOptions: this.maskInputOptions,
1152
1152
  tagName: e.tagName,
1153
- type: me(e),
1153
+ type: he(e),
1154
1154
  value: n,
1155
1155
  maskInputFn: this.maskInputFn
1156
1156
  });
1157
1157
  }), n(this, "processMutation", (e) => {
1158
- if (!ut(e.target, this.mirror, this.slimDOMOptions)) switch (e.type) {
1158
+ if (!dt(e.target, this.mirror, this.slimDOMOptions)) switch (e.type) {
1159
1159
  case "characterData": {
1160
- let t = j.textContent(e.target);
1161
- !B(e.target, this.blockClass, this.blockSelector, !1) && t !== e.oldValue && this.texts.push({
1162
- value: Ue(e.target, this.maskTextClass, this.maskTextSelector, !0) && t ? this.maskTextFn ? this.maskTextFn(t, ct(e.target)) : t.replace(/[\S]/g, "*") : t,
1160
+ let t = A.textContent(e.target);
1161
+ !z(e.target, this.blockClass, this.blockSelector, !1) && t !== e.oldValue && this.texts.push({
1162
+ value: We(e.target, this.maskTextClass, this.maskTextSelector, !0) && t ? this.maskTextFn ? this.maskTextFn(t, lt(e.target)) : t.replace(/[\S]/g, "*") : t,
1163
1163
  node: e.target
1164
1164
  });
1165
1165
  break;
@@ -1167,8 +1167,8 @@ var Ct = class {
1167
1167
  case "attributes": {
1168
1168
  let t = e.target, n = e.attributeName, r = e.target.getAttribute(n);
1169
1169
  if (n === "value") {
1170
- let e = me(t);
1171
- r = I({
1170
+ let e = he(t);
1171
+ r = F({
1172
1172
  element: t,
1173
1173
  maskInputOptions: this.maskInputOptions,
1174
1174
  tagName: t.tagName,
@@ -1177,7 +1177,7 @@ var Ct = class {
1177
1177
  maskInputFn: this.maskInputFn
1178
1178
  });
1179
1179
  }
1180
- if (B(e.target, this.blockClass, this.blockSelector, !1) || r === e.oldValue) return;
1180
+ if (z(e.target, this.blockClass, this.blockSelector, !1) || r === e.oldValue) return;
1181
1181
  let i = this.attributeMap.get(e.target);
1182
1182
  if (t.tagName === "IFRAME" && n === "src" && !this.keepIframeSrcFn(r)) if (!t.contentDocument) n = "rr_src";
1183
1183
  else return;
@@ -1186,7 +1186,7 @@ var Ct = class {
1186
1186
  attributes: {},
1187
1187
  styleDiff: {},
1188
1188
  _unchangedStyles: {}
1189
- }, this.attributes.push(i), this.attributeMap.set(e.target, i)), n === "type" && t.tagName === "INPUT" && (e.oldValue || "").toLowerCase() === "password" && t.setAttribute("data-rr-is-password", "true"), !Be(t.tagName, n)) if (i.attributes[n] = ze(this.doc, L(t.tagName), L(n), r), n === "style") {
1189
+ }, this.attributes.push(i), this.attributeMap.set(e.target, i)), n === "type" && t.tagName === "INPUT" && (e.oldValue || "").toLowerCase() === "password" && t.setAttribute("data-rr-is-password", "true"), !Ve(t.tagName, n)) if (i.attributes[n] = Be(this.doc, I(t.tagName), I(n), r), n === "style") {
1190
1190
  if (!this.unattachedDoc) try {
1191
1191
  this.unattachedDoc = document.implementation.createHTMLDocument();
1192
1192
  } catch {
@@ -1203,30 +1203,30 @@ var Ct = class {
1203
1203
  break;
1204
1204
  }
1205
1205
  case "childList":
1206
- if (B(e.target, this.blockClass, this.blockSelector, !0)) return;
1206
+ if (z(e.target, this.blockClass, this.blockSelector, !0)) return;
1207
1207
  if (e.target.tagName === "TEXTAREA") {
1208
1208
  this.genTextAreaValueMutation(e.target);
1209
1209
  return;
1210
1210
  }
1211
1211
  e.addedNodes.forEach((t) => this.genAdds(t, e.target)), e.removedNodes.forEach((t) => {
1212
- let n = this.mirror.getId(t), r = M(e.target) ? this.mirror.getId(j.host(e.target)) : this.mirror.getId(e.target);
1213
- B(e.target, this.blockClass, this.blockSelector, !1) || ut(t, this.mirror, this.slimDOMOptions) || !lt(t, this.mirror) || (this.addedSet.has(t) ? (Et(this.addedSet, t), this.droppedSet.add(t)) : this.addedSet.has(e.target) && n === -1 || dt(e.target, this.mirror) || (this.movedSet.has(t) && this.movedMap[wt(n, r)] ? Et(this.movedSet, t) : (this.removes.push({
1212
+ let n = this.mirror.getId(t), r = j(e.target) ? this.mirror.getId(A.host(e.target)) : this.mirror.getId(e.target);
1213
+ z(e.target, this.blockClass, this.blockSelector, !1) || dt(t, this.mirror, this.slimDOMOptions) || !ut(t, this.mirror) || (this.addedSet.has(t) ? (Dt(this.addedSet, t), this.droppedSet.add(t)) : this.addedSet.has(e.target) && n === -1 || ft(e.target, this.mirror) || (this.movedSet.has(t) && this.movedMap[Tt(n, r)] ? Dt(this.movedSet, t) : (this.removes.push({
1214
1214
  parentId: r,
1215
1215
  id: n,
1216
- isShadow: M(e.target) && N(e.target) ? !0 : void 0
1217
- }), Dt(t, this.removesSubTreeCache))), this.mapRemoves.push(t));
1216
+ isShadow: j(e.target) && M(e.target) ? !0 : void 0
1217
+ }), Ot(t, this.removesSubTreeCache))), this.mapRemoves.push(t));
1218
1218
  });
1219
1219
  break;
1220
1220
  }
1221
1221
  }), n(this, "genAdds", (e, t) => {
1222
1222
  if (!this.processedNodeManager.inOtherBuffer(e, this) && !(this.addedSet.has(e) || this.movedSet.has(e))) {
1223
1223
  if (this.mirror.hasNode(e)) {
1224
- if (ut(e, this.mirror, this.slimDOMOptions)) return;
1224
+ if (dt(e, this.mirror, this.slimDOMOptions)) return;
1225
1225
  this.movedSet.add(e);
1226
1226
  let n = null;
1227
- t && this.mirror.hasNode(t) && (n = this.mirror.getId(t)), n && n !== -1 && (this.movedMap[wt(this.mirror.getId(e), n)] = !0);
1227
+ t && this.mirror.hasNode(t) && (n = this.mirror.getId(t)), n && n !== -1 && (this.movedMap[Tt(this.mirror.getId(e), n)] = !0);
1228
1228
  } else this.addedSet.add(e), this.droppedSet.delete(e);
1229
- B(e, this.blockClass, this.blockSelector, !1) || (j.childNodes(e).forEach((e) => this.genAdds(e)), gt(e) && j.childNodes(j.shadowRoot(e)).forEach((t) => {
1229
+ z(e, this.blockClass, this.blockSelector, !1) || (A.childNodes(e).forEach((e) => this.genAdds(e)), _t(e) && A.childNodes(A.shadowRoot(e)).forEach((t) => {
1230
1230
  this.processedNodeManager.add(t, this), this.genAdds(t, e);
1231
1231
  }));
1232
1232
  }
@@ -1278,50 +1278,50 @@ var Ct = class {
1278
1278
  this.shadowDomManager.reset(), this.canvasManager.reset();
1279
1279
  }
1280
1280
  };
1281
- function Et(e, t) {
1282
- e.delete(t), j.childNodes(t).forEach((t) => Et(e, t));
1283
- }
1284
1281
  function Dt(e, t) {
1282
+ e.delete(t), A.childNodes(t).forEach((t) => Dt(e, t));
1283
+ }
1284
+ function Ot(e, t) {
1285
1285
  let n = [e];
1286
1286
  for (; n.length;) {
1287
1287
  let e = n.pop();
1288
- t.has(e) || (t.add(e), j.childNodes(e).forEach((e) => n.push(e)));
1288
+ t.has(e) || (t.add(e), A.childNodes(e).forEach((e) => n.push(e)));
1289
1289
  }
1290
1290
  }
1291
- function Ot(e, t, n) {
1292
- return e.size !== 0 && kt(e, t);
1293
- }
1294
1291
  function kt(e, t, n) {
1295
- let r = j.parentNode(t);
1296
- return r ? e.has(r) : !1;
1292
+ return e.size !== 0 && At(e, t);
1297
1293
  }
1298
- function At(e, t) {
1299
- return e.size !== 0 && jt(e, t);
1294
+ function At(e, t, n) {
1295
+ let r = A.parentNode(t);
1296
+ return r ? e.has(r) : !1;
1300
1297
  }
1301
1298
  function jt(e, t) {
1302
- let n = j.parentNode(t);
1303
- return n ? e.has(n) ? !0 : jt(e, n) : !1;
1299
+ return e.size !== 0 && Mt(e, t);
1304
1300
  }
1305
- var V, H = !1, Mt;
1306
- function Nt(e) {
1307
- V = e;
1301
+ function Mt(e, t) {
1302
+ let n = A.parentNode(t);
1303
+ return n ? e.has(n) ? !0 : Mt(e, n) : !1;
1308
1304
  }
1309
- var U = (e) => V ? (...t) => {
1305
+ var B, V = !1, Nt;
1306
+ function Pt(e) {
1307
+ B = e;
1308
+ }
1309
+ var H = (e) => B ? (...t) => {
1310
1310
  try {
1311
1311
  return e(...t);
1312
1312
  } catch (e) {
1313
- if (V && V(e) === !0) return;
1313
+ if (B && B(e) === !0) return;
1314
1314
  throw e;
1315
1315
  }
1316
1316
  } : e;
1317
- function W(e, t) {
1318
- let n = U(t);
1317
+ function U(e, t) {
1318
+ let n = H(t);
1319
1319
  return new Proxy(e, { apply(e, t, r) {
1320
- return H || n(t, r), e.apply(t, r);
1320
+ return V || n(t, r), e.apply(t, r);
1321
1321
  } });
1322
1322
  }
1323
- var G = [];
1324
- function Pt(e) {
1323
+ var W = [];
1324
+ function Ft(e) {
1325
1325
  try {
1326
1326
  if ("composedPath" in e) {
1327
1327
  let t = e.composedPath();
@@ -1330,11 +1330,11 @@ function Pt(e) {
1330
1330
  } catch {}
1331
1331
  return e && e.target;
1332
1332
  }
1333
- function Ft(e, t) {
1334
- let n = new Tt();
1335
- G.push(n), n.init(e);
1336
- let [r, i] = ne(), a = new r(U((e) => {
1337
- Mt && Mt(e) === !1 || n.processMutations(e);
1333
+ function It(e, t) {
1334
+ let n = new Et();
1335
+ W.push(n), n.init(e);
1336
+ let [r, i] = re(), a = new r(H((e) => {
1337
+ Nt && Nt(e) === !1 || n.processMutations(e);
1338
1338
  }));
1339
1339
  return a.observe(t, {
1340
1340
  attributes: !0,
@@ -1345,33 +1345,33 @@ function Ft(e, t) {
1345
1345
  subtree: !0
1346
1346
  }), [a, i];
1347
1347
  }
1348
- function It({ mousemoveCb: e, sampling: t, doc: n, mirror: r }) {
1348
+ function Lt({ mousemoveCb: e, sampling: t, doc: n, mirror: r }) {
1349
1349
  if (t.mousemove === !1) return () => {};
1350
- let a = typeof t.mousemove == "number" ? t.mousemove : 50, o = typeof t.mousemoveCallback == "number" ? t.mousemoveCallback : 500, s = [], c, l = rt(U((t) => {
1350
+ let a = typeof t.mousemove == "number" ? t.mousemove : 50, o = typeof t.mousemoveCallback == "number" ? t.mousemoveCallback : 500, s = [], c, l = it(H((t) => {
1351
1351
  let n = Date.now() - c;
1352
1352
  e(s.map((e) => (e.timeOffset -= n, e)), t), s = [], c = null;
1353
- }), o), u = U(rt(U((e) => {
1354
- let t = Pt(e), { clientX: n, clientY: a } = ft(e) ? e.changedTouches[0] : e;
1355
- c ||= re(), s.push({
1353
+ }), o), u = H(it(H((e) => {
1354
+ let t = Ft(e), { clientX: n, clientY: a } = pt(e) ? e.changedTouches[0] : e;
1355
+ c ||= ie(), s.push({
1356
1356
  x: n,
1357
1357
  y: a,
1358
1358
  id: r.getId(t),
1359
- timeOffset: re() - c
1359
+ timeOffset: ie() - c
1360
1360
  }), l(typeof DragEvent < "u" && e instanceof DragEvent ? i.Drag : e instanceof MouseEvent ? i.MouseMove : i.TouchMove);
1361
1361
  }), a, { trailing: !1 })), d = [
1362
- z("mousemove", u, n),
1363
- z("touchmove", u, n),
1364
- z("drag", u, n)
1362
+ R("mousemove", u, n),
1363
+ R("touchmove", u, n),
1364
+ R("drag", u, n)
1365
1365
  ];
1366
- return U(() => {
1366
+ return H(() => {
1367
1367
  d.forEach((e) => e());
1368
1368
  });
1369
1369
  }
1370
- function Lt({ mouseInteractionCb: e, doc: t, mirror: n, blockClass: r, blockSelector: i, sampling: s }) {
1370
+ function Rt({ mouseInteractionCb: e, doc: t, mirror: n, blockClass: r, blockSelector: i, sampling: s }) {
1371
1371
  if (s.mouseInteraction === !1) return () => {};
1372
1372
  let c = s.mouseInteraction === !0 || s.mouseInteraction === void 0 ? {} : s.mouseInteraction, l = [], u = null, d = (t) => (s) => {
1373
- let c = Pt(s);
1374
- if (B(c, r, i, !0)) return;
1373
+ let c = Ft(s);
1374
+ if (z(c, r, i, !0)) return;
1375
1375
  let l = null, d = t;
1376
1376
  if ("pointerType" in s) {
1377
1377
  switch (s.pointerType) {
@@ -1386,12 +1386,12 @@ function Lt({ mouseInteractionCb: e, doc: t, mirror: n, blockClass: r, blockSele
1386
1386
  break;
1387
1387
  }
1388
1388
  l === o.Touch ? a[t] === a.MouseDown ? d = "TouchStart" : a[t] === a.MouseUp && (d = "TouchEnd") : o.Pen;
1389
- } else ft(s) && (l = o.Touch);
1389
+ } else pt(s) && (l = o.Touch);
1390
1390
  l === null ? a[t] === a.Click && (l = u, u = null) : (u = l, (d.startsWith("Touch") && l === o.Touch || d.startsWith("Mouse") && l === o.Mouse) && (l = null));
1391
- let f = ft(s) ? s.changedTouches[0] : s;
1391
+ let f = pt(s) ? s.changedTouches[0] : s;
1392
1392
  if (!f) return;
1393
1393
  let p = n.getId(c), { clientX: m, clientY: h } = f;
1394
- U(e)({
1394
+ H(e)({
1395
1395
  type: a[d],
1396
1396
  id: p,
1397
1397
  x: m,
@@ -1400,7 +1400,7 @@ function Lt({ mouseInteractionCb: e, doc: t, mirror: n, blockClass: r, blockSele
1400
1400
  });
1401
1401
  };
1402
1402
  return Object.keys(a).filter((e) => Number.isNaN(Number(e)) && !e.endsWith("_Departed") && c[e] !== !1).forEach((e) => {
1403
- let n = L(e), r = U(d(e));
1403
+ let n = I(e), r = H(d(e));
1404
1404
  if (window.PointerEvent) switch (a[e]) {
1405
1405
  case a.MouseDown:
1406
1406
  case a.MouseUp:
@@ -1409,18 +1409,18 @@ function Lt({ mouseInteractionCb: e, doc: t, mirror: n, blockClass: r, blockSele
1409
1409
  case a.TouchStart:
1410
1410
  case a.TouchEnd: return;
1411
1411
  }
1412
- l.push(z(n, r, t));
1413
- }), U(() => {
1412
+ l.push(R(n, r, t));
1413
+ }), H(() => {
1414
1414
  l.forEach((e) => e());
1415
1415
  });
1416
1416
  }
1417
- function Rt({ scrollCb: e, doc: t, mirror: n, blockClass: r, blockSelector: i, sampling: a }) {
1418
- return z("scroll", U(rt(U((a) => {
1419
- let o = Pt(a);
1420
- if (!o || B(o, r, i, !0)) return;
1417
+ function zt({ scrollCb: e, doc: t, mirror: n, blockClass: r, blockSelector: i, sampling: a }) {
1418
+ return R("scroll", H(it(H((a) => {
1419
+ let o = Ft(a);
1420
+ if (!o || z(o, r, i, !0)) return;
1421
1421
  let s = n.getId(o);
1422
1422
  if (o === t && t.defaultView) {
1423
- let n = at(t.defaultView);
1423
+ let n = ot(t.defaultView);
1424
1424
  e({
1425
1425
  id: s,
1426
1426
  x: n.left,
@@ -1433,27 +1433,27 @@ function Rt({ scrollCb: e, doc: t, mirror: n, blockClass: r, blockSelector: i, s
1433
1433
  });
1434
1434
  }), a.scroll || 100)), t);
1435
1435
  }
1436
- function zt({ viewportResizeCb: e }, { win: t }) {
1436
+ function Bt({ viewportResizeCb: e }, { win: t }) {
1437
1437
  let n = -1, r = -1;
1438
- return z("resize", U(rt(U(() => {
1439
- let t = ot(), i = st();
1438
+ return R("resize", H(it(H(() => {
1439
+ let t = st(), i = ct();
1440
1440
  (n !== t || r !== i) && (e({
1441
1441
  width: Number(i),
1442
1442
  height: Number(t)
1443
1443
  }), n = t, r = i);
1444
1444
  }), 200)), t);
1445
1445
  }
1446
- var Bt = [
1446
+ var Vt = [
1447
1447
  "INPUT",
1448
1448
  "TEXTAREA",
1449
1449
  "SELECT"
1450
- ], Vt = /* @__PURE__ */ new WeakMap();
1451
- function Ht({ inputCb: e, doc: t, mirror: n, blockClass: r, blockSelector: i, ignoreClass: a, ignoreSelector: o, maskInputOptions: s, maskInputFn: c, sampling: l, userTriggeredOnInput: u }) {
1450
+ ], Ht = /* @__PURE__ */ new WeakMap();
1451
+ function Ut({ inputCb: e, doc: t, mirror: n, blockClass: r, blockSelector: i, ignoreClass: a, ignoreSelector: o, maskInputOptions: s, maskInputFn: c, sampling: l, userTriggeredOnInput: u }) {
1452
1452
  function d(e) {
1453
- let n = Pt(e), l = e.isTrusted, d = n && n.tagName;
1454
- if (n && d === "OPTION" && (n = j.parentElement(n)), !n || !d || Bt.indexOf(d) < 0 || B(n, r, i, !0) || n.classList.contains(a) || o && n.matches(o)) return;
1455
- let p = n.value, m = !1, h = me(n) || "";
1456
- h === "radio" || h === "checkbox" ? m = n.checked : (s[d.toLowerCase()] || s[h]) && (p = I({
1453
+ let n = Ft(e), l = e.isTrusted, d = n && n.tagName;
1454
+ if (n && d === "OPTION" && (n = A.parentElement(n)), !n || !d || Vt.indexOf(d) < 0 || z(n, r, i, !0) || n.classList.contains(a) || o && n.matches(o)) return;
1455
+ let p = n.value, m = !1, h = he(n) || "";
1456
+ h === "radio" || h === "checkbox" ? m = n.checked : (s[d.toLowerCase()] || s[h]) && (p = F({
1457
1457
  element: n,
1458
1458
  maskInputOptions: s,
1459
1459
  tagName: d,
@@ -1484,17 +1484,17 @@ function Ht({ inputCb: e, doc: t, mirror: n, blockClass: r, blockSelector: i, ig
1484
1484
  });
1485
1485
  }
1486
1486
  function f(t, r) {
1487
- let i = Vt.get(t);
1487
+ let i = Ht.get(t);
1488
1488
  if (!i || i.text !== r.text || i.isChecked !== r.isChecked) {
1489
- Vt.set(t, r);
1489
+ Ht.set(t, r);
1490
1490
  let i = n.getId(t);
1491
- U(e)({
1491
+ H(e)({
1492
1492
  ...r,
1493
1493
  id: i
1494
1494
  });
1495
1495
  }
1496
1496
  }
1497
- let p = (l.input === "last" ? ["change"] : ["input", "change"]).map((e) => z(e, U(d), t)), m = t.defaultView;
1497
+ let p = (l.input === "last" ? ["change"] : ["input", "change"]).map((e) => R(e, H(d), t)), m = t.defaultView;
1498
1498
  if (!m) return () => {
1499
1499
  p.forEach((e) => e());
1500
1500
  };
@@ -1506,19 +1506,19 @@ function Ht({ inputCb: e, doc: t, mirror: n, blockClass: r, blockSelector: i, ig
1506
1506
  [m.HTMLSelectElement.prototype, "selectedIndex"],
1507
1507
  [m.HTMLOptionElement.prototype, "selected"]
1508
1508
  ];
1509
- return h && h.set && p.push(...g.map((e) => it(e[0], e[1], { set() {
1510
- U(d)({
1509
+ return h && h.set && p.push(...g.map((e) => at(e[0], e[1], { set() {
1510
+ H(d)({
1511
1511
  target: this,
1512
1512
  isTrusted: !1
1513
1513
  });
1514
- } }, !1, m))), U(() => {
1514
+ } }, !1, m))), H(() => {
1515
1515
  p.forEach((e) => e());
1516
1516
  });
1517
1517
  }
1518
- function Ut(e) {
1518
+ function Wt(e) {
1519
1519
  let t = [];
1520
1520
  function n(e, t) {
1521
- if (en("CSSGroupingRule") && e.parentRule instanceof CSSGroupingRule || en("CSSMediaRule") && e.parentRule instanceof CSSMediaRule || en("CSSSupportsRule") && e.parentRule instanceof CSSSupportsRule || en("CSSConditionRule") && e.parentRule instanceof CSSConditionRule) {
1521
+ if (tn("CSSGroupingRule") && e.parentRule instanceof CSSGroupingRule || tn("CSSMediaRule") && e.parentRule instanceof CSSMediaRule || tn("CSSSupportsRule") && e.parentRule instanceof CSSSupportsRule || tn("CSSConditionRule") && e.parentRule instanceof CSSConditionRule) {
1522
1522
  let r = Array.from(e.parentRule.cssRules).indexOf(e);
1523
1523
  return t.unshift(r), n(e.parentRule, t);
1524
1524
  } else if (e.parentStyleSheet) {
@@ -1529,29 +1529,29 @@ function Ut(e) {
1529
1529
  }
1530
1530
  return n(e, t);
1531
1531
  }
1532
- function Wt(e, t, n) {
1532
+ function Gt(e, t, n) {
1533
1533
  let r, i;
1534
1534
  return e ? (e.ownerNode ? r = t.getId(e.ownerNode) : i = n.getId(e), {
1535
1535
  styleId: i,
1536
1536
  id: r
1537
1537
  }) : {};
1538
1538
  }
1539
- function Gt({ styleSheetRuleCb: e, mirror: t, stylesheetManager: n }, { win: r }) {
1539
+ function Kt({ styleSheetRuleCb: e, mirror: t, stylesheetManager: n }, { win: r }) {
1540
1540
  if (!r.CSSStyleSheet || !r.CSSStyleSheet.prototype) return () => {};
1541
1541
  let i = (r, i) => {
1542
- let { id: a, styleId: o } = Wt(r, t, n.styleMirror);
1542
+ let { id: a, styleId: o } = Gt(r, t, n.styleMirror);
1543
1543
  (a && a !== -1 || o && o !== -1) && e({
1544
1544
  id: a,
1545
1545
  styleId: o,
1546
1546
  ...i
1547
1547
  });
1548
1548
  }, a = r.CSSStyleSheet.prototype.insertRule;
1549
- r.CSSStyleSheet.prototype.insertRule = W(a, (e, [t, n]) => i(e, { adds: [{
1549
+ r.CSSStyleSheet.prototype.insertRule = U(a, (e, [t, n]) => i(e, { adds: [{
1550
1550
  rule: t,
1551
1551
  index: n
1552
1552
  }] }));
1553
1553
  let o = r.CSSStyleSheet.prototype.addRule;
1554
- r.CSSStyleSheet.prototype.addRule = o ? W(o, (e, [t, n, r = e.cssRules.length]) => i(e, { adds: [{
1554
+ r.CSSStyleSheet.prototype.addRule = o ? U(o, (e, [t, n, r = e.cssRules.length]) => i(e, { adds: [{
1555
1555
  rule: `${t} { ${n} }`,
1556
1556
  index: r
1557
1557
  }] })) : function(e, t, n = this.cssRules.length) {
@@ -1559,35 +1559,35 @@ function Gt({ styleSheetRuleCb: e, mirror: t, stylesheetManager: n }, { win: r }
1559
1559
  return r.CSSStyleSheet.prototype.insertRule.apply(this, [i, n]);
1560
1560
  };
1561
1561
  let s = r.CSSStyleSheet.prototype.deleteRule;
1562
- r.CSSStyleSheet.prototype.deleteRule = W(s, (e, [t]) => i(e, { removes: [{ index: t }] }));
1562
+ r.CSSStyleSheet.prototype.deleteRule = U(s, (e, [t]) => i(e, { removes: [{ index: t }] }));
1563
1563
  let c = r.CSSStyleSheet.prototype.removeRule;
1564
- r.CSSStyleSheet.prototype.removeRule = c ? W(c, (e, [t]) => i(e, { removes: [{ index: t }] })) : function(e) {
1564
+ r.CSSStyleSheet.prototype.removeRule = c ? U(c, (e, [t]) => i(e, { removes: [{ index: t }] })) : function(e) {
1565
1565
  return r.CSSStyleSheet.prototype.deleteRule.apply(this, [e]);
1566
1566
  };
1567
1567
  let l;
1568
- r.CSSStyleSheet.prototype.replace && (l = r.CSSStyleSheet.prototype.replace, r.CSSStyleSheet.prototype.replace = W(l, (e, [t]) => i(e, { replace: t })));
1568
+ r.CSSStyleSheet.prototype.replace && (l = r.CSSStyleSheet.prototype.replace, r.CSSStyleSheet.prototype.replace = U(l, (e, [t]) => i(e, { replace: t })));
1569
1569
  let u;
1570
- r.CSSStyleSheet.prototype.replaceSync && (u = r.CSSStyleSheet.prototype.replaceSync, r.CSSStyleSheet.prototype.replaceSync = W(u, (e, [t]) => i(e, { replaceSync: t })));
1570
+ r.CSSStyleSheet.prototype.replaceSync && (u = r.CSSStyleSheet.prototype.replaceSync, r.CSSStyleSheet.prototype.replaceSync = U(u, (e, [t]) => i(e, { replaceSync: t })));
1571
1571
  let d = {};
1572
- tn("CSSGroupingRule") ? d.CSSGroupingRule = r.CSSGroupingRule : (tn("CSSMediaRule") && (d.CSSMediaRule = r.CSSMediaRule), tn("CSSConditionRule") && (d.CSSConditionRule = r.CSSConditionRule), tn("CSSSupportsRule") && (d.CSSSupportsRule = r.CSSSupportsRule));
1572
+ nn("CSSGroupingRule") ? d.CSSGroupingRule = r.CSSGroupingRule : (nn("CSSMediaRule") && (d.CSSMediaRule = r.CSSMediaRule), nn("CSSConditionRule") && (d.CSSConditionRule = r.CSSConditionRule), nn("CSSSupportsRule") && (d.CSSSupportsRule = r.CSSSupportsRule));
1573
1573
  let f = {};
1574
1574
  return Object.entries(d).forEach(([e, t]) => {
1575
1575
  f[e] = {
1576
1576
  insertRule: t.prototype.insertRule,
1577
1577
  deleteRule: t.prototype.deleteRule
1578
- }, t.prototype.insertRule = W(f[e].insertRule, (e, [t, n]) => i(e.parentStyleSheet, { adds: [{
1578
+ }, t.prototype.insertRule = U(f[e].insertRule, (e, [t, n]) => i(e.parentStyleSheet, { adds: [{
1579
1579
  rule: t,
1580
- index: [...Ut(e), n || 0]
1581
- }] })), t.prototype.deleteRule = W(f[e].deleteRule, (e, [t]) => i(e.parentStyleSheet, { removes: [{ index: [...Ut(e), t] }] }));
1582
- }), U(() => {
1583
- H || (r.CSSStyleSheet.prototype.insertRule = a, r.CSSStyleSheet.prototype.deleteRule = s, o && (r.CSSStyleSheet.prototype.addRule = o), c && (r.CSSStyleSheet.prototype.removeRule = c), l && (r.CSSStyleSheet.prototype.replace = l), u && (r.CSSStyleSheet.prototype.replaceSync = u), Object.entries(d).forEach(([e, t]) => {
1580
+ index: [...Wt(e), n || 0]
1581
+ }] })), t.prototype.deleteRule = U(f[e].deleteRule, (e, [t]) => i(e.parentStyleSheet, { removes: [{ index: [...Wt(e), t] }] }));
1582
+ }), H(() => {
1583
+ V || (r.CSSStyleSheet.prototype.insertRule = a, r.CSSStyleSheet.prototype.deleteRule = s, o && (r.CSSStyleSheet.prototype.addRule = o), c && (r.CSSStyleSheet.prototype.removeRule = c), l && (r.CSSStyleSheet.prototype.replace = l), u && (r.CSSStyleSheet.prototype.replaceSync = u), Object.entries(d).forEach(([e, t]) => {
1584
1584
  t.prototype.insertRule = f[e].insertRule, t.prototype.deleteRule = f[e].deleteRule;
1585
1585
  }));
1586
1586
  });
1587
1587
  }
1588
- function Kt({ mirror: e, stylesheetManager: t }, n) {
1588
+ function qt({ mirror: e, stylesheetManager: t }, n) {
1589
1589
  let r = null;
1590
- r = n.nodeName === "#document" ? e.getId(n) : e.getId(j.host(n));
1590
+ r = n.nodeName === "#document" ? e.getId(n) : e.getId(A.host(n));
1591
1591
  let i = n.nodeName === "#document" ? n.defaultView?.Document : n.ownerDocument?.defaultView?.ShadowRoot, a = i?.prototype ? Object.getOwnPropertyDescriptor(i?.prototype, "adoptedStyleSheets") : void 0;
1592
1592
  return r === null || r === -1 || !i || !a ? () => {} : (Object.defineProperty(n, "adoptedStyleSheets", {
1593
1593
  configurable: a.configurable,
@@ -1597,13 +1597,13 @@ function Kt({ mirror: e, stylesheetManager: t }, n) {
1597
1597
  },
1598
1598
  set(e) {
1599
1599
  let n = a.set?.call(this, e);
1600
- if (!H && r !== null && r !== -1) try {
1600
+ if (!V && r !== null && r !== -1) try {
1601
1601
  t.adoptStyleSheets(e, r);
1602
1602
  } catch {}
1603
1603
  return n;
1604
1604
  }
1605
- }), U(() => {
1606
- H || Object.defineProperty(n, "adoptedStyleSheets", {
1605
+ }), H(() => {
1606
+ V || Object.defineProperty(n, "adoptedStyleSheets", {
1607
1607
  configurable: a.configurable,
1608
1608
  enumerable: a.enumerable,
1609
1609
  get: a.get,
@@ -1611,12 +1611,12 @@ function Kt({ mirror: e, stylesheetManager: t }, n) {
1611
1611
  });
1612
1612
  }));
1613
1613
  }
1614
- function qt({ styleDeclarationCb: e, mirror: t, ignoreCSSAttributes: n, stylesheetManager: r }, { win: i }) {
1614
+ function Jt({ styleDeclarationCb: e, mirror: t, ignoreCSSAttributes: n, stylesheetManager: r }, { win: i }) {
1615
1615
  let a = i.CSSStyleDeclaration.prototype.setProperty;
1616
- i.CSSStyleDeclaration.prototype.setProperty = W(a, (i, a) => {
1616
+ i.CSSStyleDeclaration.prototype.setProperty = U(a, (i, a) => {
1617
1617
  let [o, s, c] = a;
1618
1618
  if (n.has(o)) return;
1619
- let { id: l, styleId: u } = Wt(i.parentRule?.parentStyleSheet, t, r.styleMirror);
1619
+ let { id: l, styleId: u } = Gt(i.parentRule?.parentStyleSheet, t, r.styleMirror);
1620
1620
  (l && l !== -1 || u && u !== -1) && e({
1621
1621
  id: l,
1622
1622
  styleId: u,
@@ -1625,28 +1625,28 @@ function qt({ styleDeclarationCb: e, mirror: t, ignoreCSSAttributes: n, styleshe
1625
1625
  value: s,
1626
1626
  priority: c
1627
1627
  },
1628
- index: Ut(i.parentRule)
1628
+ index: Wt(i.parentRule)
1629
1629
  });
1630
1630
  });
1631
1631
  let o = i.CSSStyleDeclaration.prototype.removeProperty;
1632
- return i.CSSStyleDeclaration.prototype.removeProperty = W(o, (i, a) => {
1632
+ return i.CSSStyleDeclaration.prototype.removeProperty = U(o, (i, a) => {
1633
1633
  let [o] = a;
1634
1634
  if (n.has(o)) return;
1635
- let { id: s, styleId: c } = Wt(i.parentRule?.parentStyleSheet, t, r.styleMirror);
1635
+ let { id: s, styleId: c } = Gt(i.parentRule?.parentStyleSheet, t, r.styleMirror);
1636
1636
  (s && s !== -1 || c && c !== -1) && e({
1637
1637
  id: s,
1638
1638
  styleId: c,
1639
1639
  remove: { property: o },
1640
- index: Ut(i.parentRule)
1640
+ index: Wt(i.parentRule)
1641
1641
  });
1642
- }), U(() => {
1643
- H || (i.CSSStyleDeclaration.prototype.setProperty = a, i.CSSStyleDeclaration.prototype.removeProperty = o);
1642
+ }), H(() => {
1643
+ V || (i.CSSStyleDeclaration.prototype.setProperty = a, i.CSSStyleDeclaration.prototype.removeProperty = o);
1644
1644
  });
1645
1645
  }
1646
- function Jt({ mediaInteractionCb: e, blockClass: t, blockSelector: n, mirror: r, sampling: i, doc: a }) {
1647
- let o = U((a) => rt(U((i) => {
1648
- let o = Pt(i);
1649
- if (!o || B(o, t, n, !0)) return;
1646
+ function Yt({ mediaInteractionCb: e, blockClass: t, blockSelector: n, mirror: r, sampling: i, doc: a }) {
1647
+ let o = H((a) => it(H((i) => {
1648
+ let o = Ft(i);
1649
+ if (!o || z(o, t, n, !0)) return;
1650
1650
  let { currentTime: s, volume: c, muted: l, playbackRate: u, loop: d } = o;
1651
1651
  e({
1652
1652
  type: a,
@@ -1658,17 +1658,17 @@ function Jt({ mediaInteractionCb: e, blockClass: t, blockSelector: n, mirror: r,
1658
1658
  loop: d
1659
1659
  });
1660
1660
  }), i.media || 500)), s = [
1661
- z("play", o(c.Play), a),
1662
- z("pause", o(c.Pause), a),
1663
- z("seeked", o(c.Seeked), a),
1664
- z("volumechange", o(c.VolumeChange), a),
1665
- z("ratechange", o(c.RateChange), a)
1661
+ R("play", o(c.Play), a),
1662
+ R("pause", o(c.Pause), a),
1663
+ R("seeked", o(c.Seeked), a),
1664
+ R("volumechange", o(c.VolumeChange), a),
1665
+ R("ratechange", o(c.RateChange), a)
1666
1666
  ];
1667
- return U(() => {
1667
+ return H(() => {
1668
1668
  s.forEach((e) => e());
1669
1669
  });
1670
1670
  }
1671
- function Yt({ fontCb: e, doc: t }) {
1671
+ function Xt({ fontCb: e, doc: t }) {
1672
1672
  let n = t.defaultView;
1673
1673
  if (!n) return () => {};
1674
1674
  let r = [], i = /* @__PURE__ */ new WeakMap(), a = n.FontFace;
@@ -1681,9 +1681,9 @@ function Yt({ fontCb: e, doc: t }) {
1681
1681
  fontSource: typeof t == "string" ? t : JSON.stringify(Array.from(new Uint8Array(t)))
1682
1682
  }), r;
1683
1683
  };
1684
- let o = A(t.fonts, "add", function(t) {
1684
+ let o = k(t.fonts, "add", function(t) {
1685
1685
  return function(n) {
1686
- return setTimeout(U(() => {
1686
+ return setTimeout(H(() => {
1687
1687
  let t = i.get(n);
1688
1688
  t && (e(t), i.delete(n));
1689
1689
  }), 0), t.apply(this, [n]);
@@ -1691,19 +1691,19 @@ function Yt({ fontCb: e, doc: t }) {
1691
1691
  });
1692
1692
  return r.push(() => {
1693
1693
  n.FontFace = a;
1694
- }), r.push(o), U(() => {
1694
+ }), r.push(o), H(() => {
1695
1695
  r.forEach((e) => e());
1696
1696
  });
1697
1697
  }
1698
- function Xt(e) {
1699
- let { doc: t, mirror: n, blockClass: r, blockSelector: i, selectionCb: a } = e, o = !0, s = U(() => {
1698
+ function Zt(e) {
1699
+ let { doc: t, mirror: n, blockClass: r, blockSelector: i, selectionCb: a } = e, o = !0, s = H(() => {
1700
1700
  let e = t.getSelection();
1701
1701
  if (!e || o && e?.isCollapsed) return;
1702
1702
  o = e.isCollapsed || !1;
1703
1703
  let s = [], c = e.rangeCount || 0;
1704
1704
  for (let t = 0; t < c; t++) {
1705
1705
  let { startContainer: a, startOffset: o, endContainer: c, endOffset: l } = e.getRangeAt(t);
1706
- B(a, r, i, !0) || B(c, r, i, !0) || s.push({
1706
+ z(a, r, i, !0) || z(c, r, i, !0) || s.push({
1707
1707
  start: n.getId(a),
1708
1708
  startOffset: o,
1709
1709
  end: n.getId(c),
@@ -1712,16 +1712,16 @@ function Xt(e) {
1712
1712
  }
1713
1713
  a({ ranges: s });
1714
1714
  });
1715
- return s(), z("selectionchange", s);
1715
+ return s(), R("selectionchange", s);
1716
1716
  }
1717
- function Zt({ doc: e, customElementCb: t }) {
1717
+ function Qt({ doc: e, customElementCb: t }) {
1718
1718
  let n = e.defaultView;
1719
- return !n || !n.customElements ? () => {} : A(n.customElements, "define", function(e) {
1719
+ return !n || !n.customElements ? () => {} : k(n.customElements, "define", function(e) {
1720
1720
  return function(n, r, i) {
1721
- if (!H) try {
1721
+ if (!V) try {
1722
1722
  t({ define: { name: n } });
1723
1723
  } catch (e) {
1724
- V && V(e) === !0 || console.warn(`Custom element callback failed for ${n}`);
1724
+ B && B(e) === !0 || console.warn(`Custom element callback failed for ${n}`);
1725
1725
  }
1726
1726
  return e.apply(this, [
1727
1727
  n,
@@ -1731,7 +1731,7 @@ function Zt({ doc: e, customElementCb: t }) {
1731
1731
  };
1732
1732
  });
1733
1733
  }
1734
- function Qt(e, t) {
1734
+ function $t(e, t) {
1735
1735
  let { mutationCb: n, mousemoveCb: r, mouseInteractionCb: i, scrollCb: a, viewportResizeCb: o, inputCb: s, mediaInteractionCb: c, styleSheetRuleCb: l, styleDeclarationCb: u, canvasMutationCb: d, fontCb: f, selectionCb: p, customElementCb: m } = e;
1736
1736
  e.mutationCb = (...e) => {
1737
1737
  t.mutation && t.mutation(...e), n(...e);
@@ -1761,27 +1761,27 @@ function Qt(e, t) {
1761
1761
  t.customElement && t.customElement(...e), m(...e);
1762
1762
  };
1763
1763
  }
1764
- function $t(e, t = {}) {
1764
+ function en(e, t = {}) {
1765
1765
  let n = e.doc.defaultView;
1766
1766
  if (!n) return () => {};
1767
- Qt(e, t);
1767
+ $t(e, t);
1768
1768
  let r, i = () => {};
1769
- e.recordDOM && ([r, i] = Ft(e, e.doc));
1770
- let a = It(e), o = Lt(e), s = Rt(e), c = zt(e, { win: n }), l = Ht(e), u = Jt(e), d = () => {}, f = () => {}, p = () => {}, m = () => {};
1771
- e.recordDOM && (d = Gt(e, { win: n }), f = Kt(e, e.doc), p = qt(e, { win: n }), e.collectFonts && (m = Yt(e)));
1772
- let h = Xt(e), g = Zt(e), _ = [];
1769
+ e.recordDOM && ([r, i] = It(e, e.doc));
1770
+ let a = Lt(e), o = Rt(e), s = zt(e), c = Bt(e, { win: n }), l = Ut(e), u = Yt(e), d = () => {}, f = () => {}, p = () => {}, m = () => {};
1771
+ e.recordDOM && (d = Kt(e, { win: n }), f = qt(e, e.doc), p = Jt(e, { win: n }), e.collectFonts && (m = Xt(e)));
1772
+ let h = Zt(e), g = Qt(e), _ = [];
1773
1773
  for (let t of e.plugins) _.push(t.observer(t.callback, n, t.options));
1774
- return U(() => {
1775
- G.forEach((e) => e.reset()), r?.disconnect(), i(), a(), o(), s(), c(), l(), u(), d(), f(), p(), m(), h(), g(), _.forEach((e) => e());
1774
+ return H(() => {
1775
+ W.forEach((e) => e.reset()), r?.disconnect(), i(), a(), o(), s(), c(), l(), u(), d(), f(), p(), m(), h(), g(), _.forEach((e) => e());
1776
1776
  });
1777
1777
  }
1778
- function en(e) {
1778
+ function tn(e) {
1779
1779
  return window[e] !== void 0;
1780
1780
  }
1781
- function tn(e) {
1781
+ function nn(e) {
1782
1782
  return !!(window[e] !== void 0 && window[e].prototype && "insertRule" in window[e].prototype && "deleteRule" in window[e].prototype);
1783
1783
  }
1784
- for (var nn = class {
1784
+ for (var rn = class {
1785
1785
  constructor(e) {
1786
1786
  n(this, "iframeIdToRemoteIdMap", /* @__PURE__ */ new WeakMap()), n(this, "iframeRemoteIdToIdMap", /* @__PURE__ */ new WeakMap()), this.generateIdFn = e;
1787
1787
  }
@@ -1816,9 +1816,9 @@ for (var nn = class {
1816
1816
  let t = this.iframeRemoteIdToIdMap.get(e);
1817
1817
  return t || (t = /* @__PURE__ */ new Map(), this.iframeRemoteIdToIdMap.set(e, t)), t;
1818
1818
  }
1819
- }, rn = class {
1819
+ }, an = class {
1820
1820
  constructor(e) {
1821
- n(this, "iframes", /* @__PURE__ */ new WeakMap()), n(this, "crossOriginIframeMap", /* @__PURE__ */ new WeakMap()), n(this, "crossOriginIframeMirror", new nn(Oe)), n(this, "crossOriginIframeStyleMirror"), n(this, "crossOriginIframeRootIdMap", /* @__PURE__ */ new WeakMap()), n(this, "mirror"), n(this, "mutationCb"), n(this, "wrappedEmit"), n(this, "loadListener"), n(this, "stylesheetManager"), n(this, "recordCrossOriginIframes"), this.mutationCb = e.mutationCb, this.wrappedEmit = e.wrappedEmit, this.stylesheetManager = e.stylesheetManager, this.recordCrossOriginIframes = e.recordCrossOriginIframes, this.crossOriginIframeStyleMirror = new nn(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)), this.mirror = e.mirror, this.recordCrossOriginIframes && window.addEventListener("message", this.handleMessage.bind(this));
1821
+ n(this, "iframes", /* @__PURE__ */ new WeakMap()), n(this, "crossOriginIframeMap", /* @__PURE__ */ new WeakMap()), n(this, "crossOriginIframeMirror", new rn(ke)), n(this, "crossOriginIframeStyleMirror"), n(this, "crossOriginIframeRootIdMap", /* @__PURE__ */ new WeakMap()), n(this, "mirror"), n(this, "mutationCb"), n(this, "wrappedEmit"), n(this, "loadListener"), n(this, "stylesheetManager"), n(this, "recordCrossOriginIframes"), this.mutationCb = e.mutationCb, this.wrappedEmit = e.wrappedEmit, this.stylesheetManager = e.stylesheetManager, this.recordCrossOriginIframes = e.recordCrossOriginIframes, this.crossOriginIframeStyleMirror = new rn(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)), this.mirror = e.mirror, this.recordCrossOriginIframes && window.addEventListener("message", this.handleMessage.bind(this));
1822
1822
  }
1823
1823
  addIframe(e) {
1824
1824
  this.iframes.set(e, !0), e.contentWindow && this.crossOriginIframeMap.set(e.contentWindow, e);
@@ -1941,7 +1941,7 @@ for (var nn = class {
1941
1941
  this.patchRootIdOnNode(e, t);
1942
1942
  });
1943
1943
  }
1944
- }, an = class {
1944
+ }, on = class {
1945
1945
  constructor(e) {
1946
1946
  n(this, "shadowDoms", /* @__PURE__ */ new WeakSet()), n(this, "mutationCb"), n(this, "scrollCb"), n(this, "bypassOptions"), n(this, "mirror"), n(this, "restoreHandlers", []), this.mutationCb = e.mutationCb, this.scrollCb = e.scrollCb, this.bypassOptions = e.bypassOptions, this.mirror = e.mirror, this.init();
1947
1947
  }
@@ -1949,22 +1949,22 @@ for (var nn = class {
1949
1949
  this.reset(), this.patchAttachShadow(Element, document);
1950
1950
  }
1951
1951
  addShadowRoot(e, t) {
1952
- if (!N(e) || this.shadowDoms.has(e)) return;
1952
+ if (!M(e) || this.shadowDoms.has(e)) return;
1953
1953
  this.shadowDoms.add(e);
1954
- let [n] = Ft({
1954
+ let [n] = It({
1955
1955
  ...this.bypassOptions,
1956
1956
  doc: t,
1957
1957
  mutationCb: this.mutationCb,
1958
1958
  mirror: this.mirror,
1959
1959
  shadowDomManager: this
1960
1960
  }, e);
1961
- this.restoreHandlers.push(() => n.disconnect()), this.restoreHandlers.push(Rt({
1961
+ this.restoreHandlers.push(() => n.disconnect()), this.restoreHandlers.push(zt({
1962
1962
  ...this.bypassOptions,
1963
1963
  scrollCb: this.scrollCb,
1964
1964
  doc: e,
1965
1965
  mirror: this.mirror
1966
- })), setTimeout(U(() => {
1967
- H || (e.adoptedStyleSheets && e.adoptedStyleSheets.length > 0 && this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets, this.mirror.getId(j.host(e))), this.restoreHandlers.push(Kt({
1966
+ })), setTimeout(H(() => {
1967
+ V || (e.adoptedStyleSheets && e.adoptedStyleSheets.length > 0 && this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets, this.mirror.getId(A.host(e))), this.restoreHandlers.push(qt({
1968
1968
  mirror: this.mirror,
1969
1969
  stylesheetManager: this.bypassOptions.stylesheetManager
1970
1970
  }, e)));
@@ -1975,12 +1975,12 @@ for (var nn = class {
1975
1975
  }
1976
1976
  patchAttachShadow(e, t) {
1977
1977
  let n = this;
1978
- this.restoreHandlers.push(A(e.prototype, "attachShadow", function(e) {
1978
+ this.restoreHandlers.push(k(e.prototype, "attachShadow", function(e) {
1979
1979
  return function(r) {
1980
1980
  let i = e.call(this, r);
1981
- return H || U(() => {
1982
- let e = j.shadowRoot(this);
1983
- e && xt(this) && n.addShadowRoot(e, t);
1981
+ return V || H(() => {
1982
+ let e = A.shadowRoot(this);
1983
+ e && St(this) && n.addShadowRoot(e, t);
1984
1984
  })(), i;
1985
1985
  };
1986
1986
  }));
@@ -1992,23 +1992,23 @@ for (var nn = class {
1992
1992
  } catch {}
1993
1993
  }), this.restoreHandlers = [], this.shadowDoms = /* @__PURE__ */ new WeakSet();
1994
1994
  }
1995
- }, on = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", sn = typeof Uint8Array > "u" ? [] : /* @__PURE__ */ new Uint8Array(256), cn = 0; cn < on.length; cn++) sn[on.charCodeAt(cn)] = cn;
1996
- var ln = function(e) {
1995
+ }, sn = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", cn = typeof Uint8Array > "u" ? [] : /* @__PURE__ */ new Uint8Array(256), ln = 0; ln < sn.length; ln++) cn[sn.charCodeAt(ln)] = ln;
1996
+ var un = function(e) {
1997
1997
  var t = new Uint8Array(e), n, r = t.length, i = "";
1998
- for (n = 0; n < r; n += 3) i += on[t[n] >> 2], i += on[(t[n] & 3) << 4 | t[n + 1] >> 4], i += on[(t[n + 1] & 15) << 2 | t[n + 2] >> 6], i += on[t[n + 2] & 63];
1998
+ for (n = 0; n < r; n += 3) i += sn[t[n] >> 2], i += sn[(t[n] & 3) << 4 | t[n + 1] >> 4], i += sn[(t[n + 1] & 15) << 2 | t[n + 2] >> 6], i += sn[t[n + 2] & 63];
1999
1999
  return r % 3 == 2 ? i = i.substring(0, i.length - 1) + "=" : r % 3 == 1 && (i = i.substring(0, i.length - 2) + "=="), i;
2000
- }, un = /* @__PURE__ */ new Map();
2001
- function dn(e, t) {
2002
- let n = un.get(e);
2003
- return n || (n = /* @__PURE__ */ new Map(), un.set(e, n)), n.has(t) || n.set(t, []), n.get(t);
2004
- }
2005
- var fn = (e, t, n) => {
2006
- if (!e || !(hn(e, t) || typeof e == "object")) return;
2007
- let r = e.constructor.name, i = dn(n, r), a = i.indexOf(e);
2000
+ }, dn = /* @__PURE__ */ new Map();
2001
+ function fn(e, t) {
2002
+ let n = dn.get(e);
2003
+ return n || (n = /* @__PURE__ */ new Map(), dn.set(e, n)), n.has(t) || n.set(t, []), n.get(t);
2004
+ }
2005
+ var pn = (e, t, n) => {
2006
+ if (!e || !(gn(e, t) || typeof e == "object")) return;
2007
+ let r = e.constructor.name, i = fn(n, r), a = i.indexOf(e);
2008
2008
  return a === -1 && (a = i.length, i.push(e)), a;
2009
2009
  };
2010
- function pn(e, t, n) {
2011
- if (e instanceof Array) return e.map((e) => pn(e, t, n));
2010
+ function mn(e, t, n) {
2011
+ if (e instanceof Array) return e.map((e) => mn(e, t, n));
2012
2012
  if (e === null) return e;
2013
2013
  if (e instanceof Float32Array || e instanceof Float64Array || e instanceof Int32Array || e instanceof Uint32Array || e instanceof Uint8Array || e instanceof Uint16Array || e instanceof Int16Array || e instanceof Int8Array || e instanceof Uint8ClampedArray) return {
2014
2014
  rr_type: e.constructor.name,
@@ -2016,12 +2016,12 @@ function pn(e, t, n) {
2016
2016
  };
2017
2017
  if (e instanceof ArrayBuffer) return {
2018
2018
  rr_type: e.constructor.name,
2019
- base64: ln(e)
2019
+ base64: un(e)
2020
2020
  };
2021
2021
  if (e instanceof DataView) return {
2022
2022
  rr_type: e.constructor.name,
2023
2023
  args: [
2024
- pn(e.buffer, t, n),
2024
+ mn(e.buffer, t, n),
2025
2025
  e.byteOffset,
2026
2026
  e.byteLength
2027
2027
  ]
@@ -2039,18 +2039,18 @@ function pn(e, t, n) {
2039
2039
  else if (e instanceof ImageData) return {
2040
2040
  rr_type: e.constructor.name,
2041
2041
  args: [
2042
- pn(e.data, t, n),
2042
+ mn(e.data, t, n),
2043
2043
  e.width,
2044
2044
  e.height
2045
2045
  ]
2046
2046
  };
2047
- else if (hn(e, t) || typeof e == "object") return {
2047
+ else if (gn(e, t) || typeof e == "object") return {
2048
2048
  rr_type: e.constructor.name,
2049
- index: fn(e, t, n)
2049
+ index: pn(e, t, n)
2050
2050
  };
2051
2051
  return e;
2052
2052
  }
2053
- var mn = (e, t, n) => e.map((e) => pn(e, t, n)), hn = (e, t) => !![
2053
+ var hn = (e, t, n) => e.map((e) => mn(e, t, n)), gn = (e, t) => !![
2054
2054
  "WebGLActiveInfo",
2055
2055
  "WebGLBuffer",
2056
2056
  "WebGLFramebuffer",
@@ -2063,14 +2063,14 @@ var mn = (e, t, n) => e.map((e) => pn(e, t, n)), hn = (e, t) => !![
2063
2063
  "WebGLVertexArrayObject",
2064
2064
  "WebGLVertexArrayObjectOES"
2065
2065
  ].filter((e) => typeof t[e] == "function").find((n) => e instanceof t[n]);
2066
- function gn(e, t, n, r) {
2066
+ function _n(e, t, n, r) {
2067
2067
  let i = [], a = Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);
2068
2068
  for (let o of a) try {
2069
2069
  if (typeof t.CanvasRenderingContext2D.prototype[o] != "function") continue;
2070
- let a = A(t.CanvasRenderingContext2D.prototype, o, function(i) {
2070
+ let a = k(t.CanvasRenderingContext2D.prototype, o, function(i) {
2071
2071
  return function(...a) {
2072
- return B(this.canvas, n, r, !0) || setTimeout(() => {
2073
- let n = mn(a, t, this);
2072
+ return z(this.canvas, n, r, !0) || setTimeout(() => {
2073
+ let n = hn(a, t, this);
2074
2074
  e(this.canvas, {
2075
2075
  type: s["2D"],
2076
2076
  property: o,
@@ -2081,7 +2081,7 @@ function gn(e, t, n, r) {
2081
2081
  });
2082
2082
  i.push(a);
2083
2083
  } catch {
2084
- let n = it(t.CanvasRenderingContext2D.prototype, o, { set(t) {
2084
+ let n = at(t.CanvasRenderingContext2D.prototype, o, { set(t) {
2085
2085
  e(this.canvas, {
2086
2086
  type: s["2D"],
2087
2087
  property: o,
@@ -2095,16 +2095,16 @@ function gn(e, t, n, r) {
2095
2095
  i.forEach((e) => e());
2096
2096
  };
2097
2097
  }
2098
- function _n(e) {
2098
+ function vn(e) {
2099
2099
  return e === "experimental-webgl" ? "webgl" : e;
2100
2100
  }
2101
- function vn(e, t, n, r) {
2101
+ function yn(e, t, n, r) {
2102
2102
  let i = [];
2103
2103
  try {
2104
- let a = A(e.HTMLCanvasElement.prototype, "getContext", function(e) {
2104
+ let a = k(e.HTMLCanvasElement.prototype, "getContext", function(e) {
2105
2105
  return function(i, ...a) {
2106
- if (!B(this, t, n, !0)) {
2107
- let e = _n(i);
2106
+ if (!z(this, t, n, !0)) {
2107
+ let e = vn(i);
2108
2108
  if ("__context" in this || (this.__context = e), r && ["webgl", "webgl2"].includes(e)) if (a[0] && typeof a[0] == "object") {
2109
2109
  let e = a[0];
2110
2110
  e.preserveDrawingBuffer ||= !0;
@@ -2121,7 +2121,7 @@ function vn(e, t, n, r) {
2121
2121
  i.forEach((e) => e());
2122
2122
  };
2123
2123
  }
2124
- function yn(e, t, n, r, i, a) {
2124
+ function bn(e, t, n, r, i, a) {
2125
2125
  let o = [], s = Object.getOwnPropertyNames(e);
2126
2126
  for (let c of s) if (![
2127
2127
  "isContextLost",
@@ -2130,11 +2130,11 @@ function yn(e, t, n, r, i, a) {
2130
2130
  "drawingBufferHeight"
2131
2131
  ].includes(c)) try {
2132
2132
  if (typeof e[c] != "function") continue;
2133
- let s = A(e, c, function(e) {
2133
+ let s = k(e, c, function(e) {
2134
2134
  return function(...o) {
2135
2135
  let s = e.apply(this, o);
2136
- if (fn(s, a, this), "tagName" in this.canvas && !B(this.canvas, r, i, !0)) {
2137
- let e = mn(o, a, this), r = {
2136
+ if (pn(s, a, this), "tagName" in this.canvas && !z(this.canvas, r, i, !0)) {
2137
+ let e = hn(o, a, this), r = {
2138
2138
  type: t,
2139
2139
  property: c,
2140
2140
  args: e
@@ -2146,7 +2146,7 @@ function yn(e, t, n, r, i, a) {
2146
2146
  });
2147
2147
  o.push(s);
2148
2148
  } catch {
2149
- let r = it(e, c, { set(e) {
2149
+ let r = at(e, c, { set(e) {
2150
2150
  n(this.canvas, {
2151
2151
  type: t,
2152
2152
  property: c,
@@ -2158,28 +2158,28 @@ function yn(e, t, n, r, i, a) {
2158
2158
  }
2159
2159
  return o;
2160
2160
  }
2161
- function bn(e, t, n, r) {
2161
+ function xn(e, t, n, r) {
2162
2162
  let i = [];
2163
- return t.WebGLRenderingContext !== void 0 && i.push(...yn(t.WebGLRenderingContext.prototype, s.WebGL, e, n, r, t)), t.WebGL2RenderingContext !== void 0 && i.push(...yn(t.WebGL2RenderingContext.prototype, s.WebGL2, e, n, r, t)), () => {
2163
+ return t.WebGLRenderingContext !== void 0 && i.push(...bn(t.WebGLRenderingContext.prototype, s.WebGL, e, n, r, t)), t.WebGL2RenderingContext !== void 0 && i.push(...bn(t.WebGL2RenderingContext.prototype, s.WebGL2, e, n, r, t)), () => {
2164
2164
  i.forEach((e) => e());
2165
2165
  };
2166
2166
  }
2167
- var xn = "(function() {\n \"use strict\";\n var chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n var lookup = typeof Uint8Array === \"undefined\" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = \"\";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + \"=\";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + \"==\";\n }\n return base64;\n };\n const lastBlobMap = /* @__PURE__ */ new Map();\n const transparentBlobMap = /* @__PURE__ */ new Map();\n async function getTransparentBlobFor(width, height, dataURLOptions) {\n const id = `${width}-${height}`;\n if (\"OffscreenCanvas\" in globalThis) {\n if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);\n const offscreen = new OffscreenCanvas(width, height);\n offscreen.getContext(\"2d\");\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n transparentBlobMap.set(id, base64);\n return base64;\n } else {\n return \"\";\n }\n }\n const worker = self;\n worker.onmessage = async function(e) {\n if (\"OffscreenCanvas\" in globalThis) {\n const { id, bitmap, width, height, dataURLOptions } = e.data;\n const transparentBase64 = getTransparentBlobFor(\n width,\n height,\n dataURLOptions\n );\n const offscreen = new OffscreenCanvas(width, height);\n const ctx = offscreen.getContext(\"2d\");\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const type = blob.type;\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n if (!lastBlobMap.has(id) && await transparentBase64 === base64) {\n lastBlobMap.set(id, base64);\n return worker.postMessage({ id });\n }\n if (lastBlobMap.get(id) === base64) return worker.postMessage({ id });\n worker.postMessage({\n id,\n type,\n base64,\n width,\n height\n });\n lastBlobMap.set(id, base64);\n } else {\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n//# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map\n", Sn = typeof self < "u" && self.Blob && new Blob([xn], { type: "text/javascript;charset=utf-8" });
2168
- function Cn(e) {
2167
+ var Sn = "(function() {\n \"use strict\";\n var chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n var lookup = typeof Uint8Array === \"undefined\" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = \"\";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + \"=\";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + \"==\";\n }\n return base64;\n };\n const lastBlobMap = /* @__PURE__ */ new Map();\n const transparentBlobMap = /* @__PURE__ */ new Map();\n async function getTransparentBlobFor(width, height, dataURLOptions) {\n const id = `${width}-${height}`;\n if (\"OffscreenCanvas\" in globalThis) {\n if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);\n const offscreen = new OffscreenCanvas(width, height);\n offscreen.getContext(\"2d\");\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n transparentBlobMap.set(id, base64);\n return base64;\n } else {\n return \"\";\n }\n }\n const worker = self;\n worker.onmessage = async function(e) {\n if (\"OffscreenCanvas\" in globalThis) {\n const { id, bitmap, width, height, dataURLOptions } = e.data;\n const transparentBase64 = getTransparentBlobFor(\n width,\n height,\n dataURLOptions\n );\n const offscreen = new OffscreenCanvas(width, height);\n const ctx = offscreen.getContext(\"2d\");\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const type = blob.type;\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n if (!lastBlobMap.has(id) && await transparentBase64 === base64) {\n lastBlobMap.set(id, base64);\n return worker.postMessage({ id });\n }\n if (lastBlobMap.get(id) === base64) return worker.postMessage({ id });\n worker.postMessage({\n id,\n type,\n base64,\n width,\n height\n });\n lastBlobMap.set(id, base64);\n } else {\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n//# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map\n", Cn = typeof self < "u" && self.Blob && new Blob([Sn], { type: "text/javascript;charset=utf-8" });
2168
+ function wn(e) {
2169
2169
  let t;
2170
2170
  try {
2171
- if (t = Sn && (self.URL || self.webkitURL).createObjectURL(Sn), !t) throw "";
2171
+ if (t = Cn && (self.URL || self.webkitURL).createObjectURL(Cn), !t) throw "";
2172
2172
  let n = new Worker(t, { name: e?.name });
2173
2173
  return n.addEventListener("error", () => {
2174
2174
  (self.URL || self.webkitURL).revokeObjectURL(t);
2175
2175
  }), n;
2176
2176
  } catch {
2177
- return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(xn), { name: e?.name });
2177
+ return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(Sn), { name: e?.name });
2178
2178
  } finally {
2179
2179
  t && (self.URL || self.webkitURL).revokeObjectURL(t);
2180
2180
  }
2181
2181
  }
2182
- var wn = class {
2182
+ var Tn = class {
2183
2183
  constructor(e) {
2184
2184
  n(this, "pendingCanvasMutations", /* @__PURE__ */ new Map()), n(this, "rafStamps", {
2185
2185
  latestId: 0,
@@ -2206,7 +2206,7 @@ var wn = class {
2206
2206
  this.locked = !1;
2207
2207
  }
2208
2208
  initCanvasFPSObserver(e, t, n, r, i) {
2209
- let a = vn(t, n, r, !0), o = /* @__PURE__ */ new Map(), c = new Cn();
2209
+ let a = yn(t, n, r, !0), o = /* @__PURE__ */ new Map(), c = new wn();
2210
2210
  c.onmessage = (e) => {
2211
2211
  let { id: t } = e.data;
2212
2212
  if (o.set(t, !1), !("base64" in e.data)) return;
@@ -2245,7 +2245,7 @@ var wn = class {
2245
2245
  let l = 1e3 / e, u = 0, d, f = () => {
2246
2246
  let e = [];
2247
2247
  return t.document.querySelectorAll("canvas").forEach((t) => {
2248
- B(t, n, r, !0) || e.push(t);
2248
+ z(t, n, r, !0) || e.push(t);
2249
2249
  }), e;
2250
2250
  }, p = (e) => {
2251
2251
  if (u && e - u < l) {
@@ -2275,7 +2275,7 @@ var wn = class {
2275
2275
  }
2276
2276
  initCanvasMutationObserver(e, t, n) {
2277
2277
  this.startRAFTimestamping(), this.startPendingCanvasMutationFlusher();
2278
- let r = vn(e, t, n, !1), i = gn(this.processMutation.bind(this), e, t, n), a = bn(this.processMutation.bind(this), e, t, n);
2278
+ let r = yn(e, t, n, !1), i = _n(this.processMutation.bind(this), e, t, n), a = xn(this.processMutation.bind(this), e, t, n);
2279
2279
  this.resetObservers = () => {
2280
2280
  r(), i(), a();
2281
2281
  };
@@ -2309,9 +2309,9 @@ var wn = class {
2309
2309
  commands: r
2310
2310
  }), this.pendingCanvasMutations.delete(e);
2311
2311
  }
2312
- }, Tn = class {
2312
+ }, En = class {
2313
2313
  constructor(e) {
2314
- n(this, "trackedLinkElements", /* @__PURE__ */ new WeakSet()), n(this, "mutationCb"), n(this, "adoptedStyleSheetCb"), n(this, "styleMirror", new _t()), this.mutationCb = e.mutationCb, this.adoptedStyleSheetCb = e.adoptedStyleSheetCb;
2314
+ n(this, "trackedLinkElements", /* @__PURE__ */ new WeakSet()), n(this, "mutationCb"), n(this, "adoptedStyleSheetCb"), n(this, "styleMirror", new vt()), this.mutationCb = e.mutationCb, this.adoptedStyleSheetCb = e.adoptedStyleSheetCb;
2315
2315
  }
2316
2316
  attachLinkElement(e, t) {
2317
2317
  "_cssText" in t.attributes && this.mutationCb({
@@ -2338,7 +2338,7 @@ var wn = class {
2338
2338
  this.styleMirror.has(t) ? e = this.styleMirror.getId(t) : (e = this.styleMirror.add(t), r.push({
2339
2339
  styleId: e,
2340
2340
  rules: Array.from(t.rules || CSSRule, (e, n) => ({
2341
- rule: ce(e, t.href),
2341
+ rule: le(e, t.href),
2342
2342
  index: n
2343
2343
  }))
2344
2344
  })), n.styleIds.push(e);
@@ -2349,7 +2349,7 @@ var wn = class {
2349
2349
  this.styleMirror.reset(), this.trackedLinkElements = /* @__PURE__ */ new WeakSet();
2350
2350
  }
2351
2351
  trackStylesheetInLinkElement(e) {}
2352
- }, En = class {
2352
+ }, Dn = class {
2353
2353
  constructor() {
2354
2354
  n(this, "nodeMap", /* @__PURE__ */ new WeakMap()), n(this, "active", !1);
2355
2355
  }
@@ -2363,7 +2363,7 @@ var wn = class {
2363
2363
  })), this.nodeMap.set(e, (this.nodeMap.get(e) || /* @__PURE__ */ new Set()).add(t));
2364
2364
  }
2365
2365
  destroy() {}
2366
- }, K, Dn, On, kn = !1;
2366
+ }, G, On, kn, An = !1;
2367
2367
  try {
2368
2368
  if (Array.from([1], (e) => e * 2)[0] !== 2) {
2369
2369
  let e = document.createElement("iframe");
@@ -2372,21 +2372,21 @@ try {
2372
2372
  } catch (e) {
2373
2373
  console.debug("Unable to override Array.from", e);
2374
2374
  }
2375
- var q = F();
2376
- function An(e = {}) {
2377
- let { emit: t, checkoutEveryNms: n, checkoutEveryNth: a, blockClass: o = "rr-block", blockSelector: s = null, ignoreClass: c = "rr-ignore", ignoreSelector: l = null, maskTextClass: u = "rr-mask", maskTextSelector: d = null, inlineStylesheet: f = !0, maskAllInputs: p, maskInputOptions: m, slimDOMOptions: h, maskInputFn: g, maskTextFn: _, hooks: v, packFn: y, sampling: b = {}, dataURLOptions: x = {}, mousemoveWait: S, recordDOM: C = !0, recordCanvas: w = !1, recordCrossOriginIframes: ee = !1, recordAfter: T = e.recordAfter === "DOMContentLoaded" ? e.recordAfter : "load", userTriggeredOnInput: E = !1, collectFonts: D = !1, inlineImages: O = !1, plugins: k, keepIframeSrcFn: te = () => !1, ignoreCSSAttributes: ne = /* @__PURE__ */ new Set([]), errorHandler: A } = e;
2378
- if (H) return () => {};
2379
- Mt = e.onMutation, Nt(A);
2380
- let ie = !ee || window.parent === window, M = !1;
2381
- if (!ie) try {
2382
- window.parent.document && (M = !1);
2375
+ var K = P();
2376
+ function q(e = {}) {
2377
+ let { emit: t, checkoutEveryNms: n, checkoutEveryNth: a, blockClass: o = "rr-block", blockSelector: s = null, ignoreClass: c = "rr-ignore", ignoreSelector: l = null, maskTextClass: u = "rr-mask", maskTextSelector: d = null, inlineStylesheet: f = !0, maskAllInputs: p, maskInputOptions: m, slimDOMOptions: h, maskInputFn: g, maskTextFn: _, hooks: v, packFn: y, sampling: b = {}, dataURLOptions: x = {}, mousemoveWait: S, recordDOM: C = !0, recordCanvas: w = !1, recordCrossOriginIframes: ee = !1, recordAfter: T = e.recordAfter === "DOMContentLoaded" ? e.recordAfter : "load", userTriggeredOnInput: te = !1, collectFonts: E = !1, inlineImages: D = !1, plugins: O, keepIframeSrcFn: ne = () => !1, ignoreCSSAttributes: re = /* @__PURE__ */ new Set([]), errorHandler: k } = e;
2378
+ if (V) return () => {};
2379
+ Nt = e.onMutation, Pt(k);
2380
+ let ae = !ee || window.parent === window, j = !1;
2381
+ if (!ae) try {
2382
+ window.parent.document && (j = !1);
2383
2383
  } catch {
2384
- M = !0;
2384
+ j = !0;
2385
2385
  }
2386
- if (ie && !t) throw Error("emit function is required");
2387
- if (!ie && !M) return () => {};
2388
- S !== void 0 && b.mousemove === void 0 && (b.mousemove = S), q.reset();
2389
- let N = p === !0 ? {
2386
+ if (ae && !t) throw Error("emit function is required");
2387
+ if (!ae && !j) return () => {};
2388
+ S !== void 0 && b.mousemove === void 0 && (b.mousemove = S), K.reset();
2389
+ let M = p === !0 ? {
2390
2390
  color: !0,
2391
2391
  date: !0,
2392
2392
  "datetime-local": !0,
@@ -2403,208 +2403,208 @@ function An(e = {}) {
2403
2403
  textarea: !0,
2404
2404
  select: !0,
2405
2405
  password: !0
2406
- } : m === void 0 ? { password: !0 } : m, ae = Xe(h);
2407
- pt();
2408
- let oe, se = 0, ce = (e) => {
2409
- for (let t of k || []) t.eventProcessor && (e = t.eventProcessor(e));
2410
- return y && !M && (e = y(e)), e;
2406
+ } : m === void 0 ? { password: !0 } : m, oe = Ze(h);
2407
+ mt();
2408
+ let se, ce = 0, le = (e) => {
2409
+ for (let t of O || []) t.eventProcessor && (e = t.eventProcessor(e));
2410
+ return y && !j && (e = y(e)), e;
2411
2411
  };
2412
- K = (e, o) => {
2412
+ G = (e, o) => {
2413
2413
  let s = e;
2414
- if (s.timestamp = re(), G[0]?.isFrozen() && s.type !== r.FullSnapshot && (s.type !== r.IncrementalSnapshot || s.data.source !== i.Mutation) && G.forEach((e) => e.unfreeze()), ie) t?.(ce(s), o);
2415
- else if (M) {
2414
+ if (s.timestamp = ie(), W[0]?.isFrozen() && s.type !== r.FullSnapshot && (s.type !== r.IncrementalSnapshot || s.data.source !== i.Mutation) && W.forEach((e) => e.unfreeze()), ae) t?.(le(s), o);
2415
+ else if (j) {
2416
2416
  let e = {
2417
2417
  type: "rrweb",
2418
- event: ce(s),
2418
+ event: le(s),
2419
2419
  origin: window.location.origin,
2420
2420
  isCheckout: o
2421
2421
  };
2422
2422
  window.parent.postMessage(e, "*");
2423
2423
  }
2424
- if (s.type === r.FullSnapshot) oe = s, se = 0;
2424
+ if (s.type === r.FullSnapshot) se = s, ce = 0;
2425
2425
  else if (s.type === r.IncrementalSnapshot) {
2426
2426
  if (s.data.source === i.Mutation && s.data.isAttachIframe) return;
2427
- se++;
2428
- let e = a && se >= a, t = n && s.timestamp - oe.timestamp > n;
2429
- (e || t) && Dn(!0);
2427
+ ce++;
2428
+ let e = a && ce >= a, t = n && s.timestamp - se.timestamp > n;
2429
+ (e || t) && On(!0);
2430
2430
  }
2431
2431
  };
2432
- let le = (e) => {
2433
- K({
2432
+ let ue = (e) => {
2433
+ G({
2434
2434
  type: r.IncrementalSnapshot,
2435
2435
  data: {
2436
2436
  source: i.Mutation,
2437
2437
  ...e
2438
2438
  }
2439
2439
  });
2440
- }, ue = (e) => K({
2440
+ }, de = (e) => G({
2441
2441
  type: r.IncrementalSnapshot,
2442
2442
  data: {
2443
2443
  source: i.Scroll,
2444
2444
  ...e
2445
2445
  }
2446
- }), de = (e) => K({
2446
+ }), fe = (e) => G({
2447
2447
  type: r.IncrementalSnapshot,
2448
2448
  data: {
2449
2449
  source: i.CanvasMutation,
2450
2450
  ...e
2451
2451
  }
2452
- }), P = new Tn({
2453
- mutationCb: le,
2454
- adoptedStyleSheetCb: (e) => K({
2452
+ }), N = new En({
2453
+ mutationCb: ue,
2454
+ adoptedStyleSheetCb: (e) => G({
2455
2455
  type: r.IncrementalSnapshot,
2456
2456
  data: {
2457
2457
  source: i.AdoptedStyleSheet,
2458
2458
  ...e
2459
2459
  }
2460
2460
  })
2461
- }), F = new rn({
2462
- mirror: q,
2463
- mutationCb: le,
2464
- stylesheetManager: P,
2461
+ }), P = new an({
2462
+ mirror: K,
2463
+ mutationCb: ue,
2464
+ stylesheetManager: N,
2465
2465
  recordCrossOriginIframes: ee,
2466
- wrappedEmit: K
2466
+ wrappedEmit: G
2467
2467
  });
2468
- for (let e of k || []) e.getMirror && e.getMirror({
2469
- nodeMirror: q,
2470
- crossOriginIframeMirror: F.crossOriginIframeMirror,
2471
- crossOriginIframeStyleMirror: F.crossOriginIframeStyleMirror
2468
+ for (let e of O || []) e.getMirror && e.getMirror({
2469
+ nodeMirror: K,
2470
+ crossOriginIframeMirror: P.crossOriginIframeMirror,
2471
+ crossOriginIframeStyleMirror: P.crossOriginIframeStyleMirror
2472
2472
  });
2473
- let I = new En();
2474
- On = new wn({
2473
+ let F = new Dn();
2474
+ kn = new Tn({
2475
2475
  recordCanvas: w,
2476
- mutationCb: de,
2476
+ mutationCb: fe,
2477
2477
  win: window,
2478
2478
  blockClass: o,
2479
2479
  blockSelector: s,
2480
- mirror: q,
2480
+ mirror: K,
2481
2481
  sampling: b.canvas,
2482
2482
  dataURLOptions: x
2483
2483
  });
2484
- let L = new an({
2485
- mutationCb: le,
2486
- scrollCb: ue,
2484
+ let I = new on({
2485
+ mutationCb: ue,
2486
+ scrollCb: de,
2487
2487
  bypassOptions: {
2488
2488
  blockClass: o,
2489
2489
  blockSelector: s,
2490
2490
  maskTextClass: u,
2491
2491
  maskTextSelector: d,
2492
2492
  inlineStylesheet: f,
2493
- maskInputOptions: N,
2493
+ maskInputOptions: M,
2494
2494
  dataURLOptions: x,
2495
2495
  maskTextFn: _,
2496
2496
  maskInputFn: g,
2497
2497
  recordCanvas: w,
2498
- inlineImages: O,
2498
+ inlineImages: D,
2499
2499
  sampling: b,
2500
- slimDOMOptions: ae,
2501
- iframeManager: F,
2502
- stylesheetManager: P,
2503
- canvasManager: On,
2504
- keepIframeSrcFn: te,
2505
- processedNodeManager: I
2500
+ slimDOMOptions: oe,
2501
+ iframeManager: P,
2502
+ stylesheetManager: N,
2503
+ canvasManager: kn,
2504
+ keepIframeSrcFn: ne,
2505
+ processedNodeManager: F
2506
2506
  },
2507
- mirror: q
2507
+ mirror: K
2508
2508
  });
2509
- Dn = (e = !1) => {
2509
+ On = (e = !1) => {
2510
2510
  if (!C) return;
2511
- K({
2511
+ G({
2512
2512
  type: r.Meta,
2513
2513
  data: {
2514
2514
  href: window.location.href,
2515
- width: st(),
2516
- height: ot()
2515
+ width: ct(),
2516
+ height: st()
2517
2517
  }
2518
- }, e), P.reset(), L.init(), G.forEach((e) => e.lock());
2519
- let t = $e(document, {
2520
- mirror: q,
2518
+ }, e), N.reset(), I.init(), W.forEach((e) => e.lock());
2519
+ let t = et(document, {
2520
+ mirror: K,
2521
2521
  blockClass: o,
2522
2522
  blockSelector: s,
2523
2523
  maskTextClass: u,
2524
2524
  maskTextSelector: d,
2525
2525
  inlineStylesheet: f,
2526
- maskAllInputs: N,
2526
+ maskAllInputs: M,
2527
2527
  maskTextFn: _,
2528
2528
  maskInputFn: g,
2529
- slimDOM: ae,
2529
+ slimDOM: oe,
2530
2530
  dataURLOptions: x,
2531
2531
  recordCanvas: w,
2532
- inlineImages: O,
2532
+ inlineImages: D,
2533
2533
  onSerialize: (e) => {
2534
- mt(e, q) && F.addIframe(e), ht(e, q) && P.trackLinkElement(e), gt(e) && L.addShadowRoot(j.shadowRoot(e), document);
2534
+ ht(e, K) && P.addIframe(e), gt(e, K) && N.trackLinkElement(e), _t(e) && I.addShadowRoot(A.shadowRoot(e), document);
2535
2535
  },
2536
2536
  onIframeLoad: (e, t) => {
2537
- F.attachIframe(e, t), L.observeAttachShadow(e);
2537
+ P.attachIframe(e, t), I.observeAttachShadow(e);
2538
2538
  },
2539
2539
  onStylesheetLoad: (e, t) => {
2540
- P.attachLinkElement(e, t);
2540
+ N.attachLinkElement(e, t);
2541
2541
  },
2542
- keepIframeSrcFn: te
2542
+ keepIframeSrcFn: ne
2543
2543
  });
2544
2544
  if (!t) return console.warn("Failed to snapshot the document");
2545
- K({
2545
+ G({
2546
2546
  type: r.FullSnapshot,
2547
2547
  data: {
2548
2548
  node: t,
2549
- initialOffset: at(window)
2549
+ initialOffset: ot(window)
2550
2550
  }
2551
- }, e), G.forEach((e) => e.unlock()), document.adoptedStyleSheets && document.adoptedStyleSheets.length > 0 && P.adoptStyleSheets(document.adoptedStyleSheets, q.getId(document));
2551
+ }, e), W.forEach((e) => e.unlock()), document.adoptedStyleSheets && document.adoptedStyleSheets.length > 0 && N.adoptStyleSheets(document.adoptedStyleSheets, K.getId(document));
2552
2552
  };
2553
2553
  try {
2554
- let e = [], t = (e) => U($t)({
2555
- mutationCb: le,
2556
- mousemoveCb: (e, t) => K({
2554
+ let e = [], t = (e) => H(en)({
2555
+ mutationCb: ue,
2556
+ mousemoveCb: (e, t) => G({
2557
2557
  type: r.IncrementalSnapshot,
2558
2558
  data: {
2559
2559
  source: t,
2560
2560
  positions: e
2561
2561
  }
2562
2562
  }),
2563
- mouseInteractionCb: (e) => K({
2563
+ mouseInteractionCb: (e) => G({
2564
2564
  type: r.IncrementalSnapshot,
2565
2565
  data: {
2566
2566
  source: i.MouseInteraction,
2567
2567
  ...e
2568
2568
  }
2569
2569
  }),
2570
- scrollCb: ue,
2571
- viewportResizeCb: (e) => K({
2570
+ scrollCb: de,
2571
+ viewportResizeCb: (e) => G({
2572
2572
  type: r.IncrementalSnapshot,
2573
2573
  data: {
2574
2574
  source: i.ViewportResize,
2575
2575
  ...e
2576
2576
  }
2577
2577
  }),
2578
- inputCb: (e) => K({
2578
+ inputCb: (e) => G({
2579
2579
  type: r.IncrementalSnapshot,
2580
2580
  data: {
2581
2581
  source: i.Input,
2582
2582
  ...e
2583
2583
  }
2584
2584
  }),
2585
- mediaInteractionCb: (e) => K({
2585
+ mediaInteractionCb: (e) => G({
2586
2586
  type: r.IncrementalSnapshot,
2587
2587
  data: {
2588
2588
  source: i.MediaInteraction,
2589
2589
  ...e
2590
2590
  }
2591
2591
  }),
2592
- styleSheetRuleCb: (e) => K({
2592
+ styleSheetRuleCb: (e) => G({
2593
2593
  type: r.IncrementalSnapshot,
2594
2594
  data: {
2595
2595
  source: i.StyleSheetRule,
2596
2596
  ...e
2597
2597
  }
2598
2598
  }),
2599
- styleDeclarationCb: (e) => K({
2599
+ styleDeclarationCb: (e) => G({
2600
2600
  type: r.IncrementalSnapshot,
2601
2601
  data: {
2602
2602
  source: i.StyleDeclaration,
2603
2603
  ...e
2604
2604
  }
2605
2605
  }),
2606
- canvasMutationCb: de,
2607
- fontCb: (e) => K({
2606
+ canvasMutationCb: fe,
2607
+ fontCb: (e) => G({
2608
2608
  type: r.IncrementalSnapshot,
2609
2609
  data: {
2610
2610
  source: i.Font,
@@ -2612,7 +2612,7 @@ function An(e = {}) {
2612
2612
  }
2613
2613
  }),
2614
2614
  selectionCb: (e) => {
2615
- K({
2615
+ G({
2616
2616
  type: r.IncrementalSnapshot,
2617
2617
  data: {
2618
2618
  source: i.Selection,
@@ -2621,7 +2621,7 @@ function An(e = {}) {
2621
2621
  });
2622
2622
  },
2623
2623
  customElementCb: (e) => {
2624
- K({
2624
+ G({
2625
2625
  type: r.IncrementalSnapshot,
2626
2626
  data: {
2627
2627
  source: i.CustomElement,
@@ -2634,32 +2634,32 @@ function An(e = {}) {
2634
2634
  ignoreSelector: l,
2635
2635
  maskTextClass: u,
2636
2636
  maskTextSelector: d,
2637
- maskInputOptions: N,
2637
+ maskInputOptions: M,
2638
2638
  inlineStylesheet: f,
2639
2639
  sampling: b,
2640
2640
  recordDOM: C,
2641
2641
  recordCanvas: w,
2642
- inlineImages: O,
2643
- userTriggeredOnInput: E,
2644
- collectFonts: D,
2642
+ inlineImages: D,
2643
+ userTriggeredOnInput: te,
2644
+ collectFonts: E,
2645
2645
  doc: e,
2646
2646
  maskInputFn: g,
2647
2647
  maskTextFn: _,
2648
- keepIframeSrcFn: te,
2648
+ keepIframeSrcFn: ne,
2649
2649
  blockSelector: s,
2650
- slimDOMOptions: ae,
2650
+ slimDOMOptions: oe,
2651
2651
  dataURLOptions: x,
2652
- mirror: q,
2653
- iframeManager: F,
2654
- stylesheetManager: P,
2655
- shadowDomManager: L,
2656
- processedNodeManager: I,
2657
- canvasManager: On,
2658
- ignoreCSSAttributes: ne,
2659
- plugins: (k?.filter((e) => e.observer))?.map((e) => ({
2652
+ mirror: K,
2653
+ iframeManager: P,
2654
+ stylesheetManager: N,
2655
+ shadowDomManager: I,
2656
+ processedNodeManager: F,
2657
+ canvasManager: kn,
2658
+ ignoreCSSAttributes: re,
2659
+ plugins: (O?.filter((e) => e.observer))?.map((e) => ({
2660
2660
  observer: e.observer,
2661
2661
  options: e.options,
2662
- callback: (t) => K({
2662
+ callback: (t) => G({
2663
2663
  type: r.Plugin,
2664
2664
  data: {
2665
2665
  plugin: e.name,
@@ -2668,70 +2668,70 @@ function An(e = {}) {
2668
2668
  })
2669
2669
  })) || []
2670
2670
  }, v);
2671
- F.addLoadListener((n) => {
2671
+ P.addLoadListener((n) => {
2672
2672
  try {
2673
2673
  e.push(t(n.contentDocument));
2674
2674
  } catch (e) {
2675
- V && V(e) === !0 || console.warn(e);
2675
+ B && B(e) === !0 || console.warn(e);
2676
2676
  }
2677
2677
  });
2678
2678
  let n = () => {
2679
- Dn(), e.push(t(document)), kn = !0;
2679
+ On(), e.push(t(document)), An = !0;
2680
2680
  };
2681
- return ["interactive", "complete"].includes(document.readyState) ? n() : (e.push(z("DOMContentLoaded", () => {
2682
- K({
2681
+ return ["interactive", "complete"].includes(document.readyState) ? n() : (e.push(R("DOMContentLoaded", () => {
2682
+ G({
2683
2683
  type: r.DomContentLoaded,
2684
2684
  data: {}
2685
2685
  }), T === "DOMContentLoaded" && n();
2686
- })), e.push(z("load", () => {
2687
- K({
2686
+ })), e.push(R("load", () => {
2687
+ G({
2688
2688
  type: r.Load,
2689
2689
  data: {}
2690
2690
  }), T === "load" && n();
2691
2691
  }, window))), () => {
2692
- H = !0, e.forEach((e) => {
2692
+ V = !0, e.forEach((e) => {
2693
2693
  try {
2694
2694
  e();
2695
2695
  } catch (e) {
2696
- !String(e).toLowerCase().includes("cross-origin") && !(V && V(e) === !0) && console.warn(e);
2696
+ !String(e).toLowerCase().includes("cross-origin") && !(B && B(e) === !0) && console.warn(e);
2697
2697
  }
2698
- }), I.destroy(), q.reset(), P.reset(), kn = !1;
2698
+ }), F.destroy(), K.reset(), N.reset(), An = !1;
2699
2699
  };
2700
2700
  } catch (e) {
2701
- V && V(e) === !0 || console.warn(e);
2701
+ B && B(e) === !0 || console.warn(e);
2702
2702
  }
2703
2703
  }
2704
- An.addCustomEvent = (e, t) => {
2705
- if (!kn) throw Error("please add custom event after start recording");
2706
- K({
2704
+ q.addCustomEvent = (e, t) => {
2705
+ if (!An) throw Error("please add custom event after start recording");
2706
+ G({
2707
2707
  type: r.Custom,
2708
2708
  data: {
2709
2709
  tag: e,
2710
2710
  payload: t
2711
2711
  }
2712
2712
  });
2713
- }, An.freezePage = () => {
2714
- G.forEach((e) => e.freeze());
2715
- }, An.takeFullSnapshot = (e) => {
2716
- if (!kn) throw Error("please take full snapshot after start recording");
2717
- Dn(e);
2718
- }, An.mirror = q;
2713
+ }, q.freezePage = () => {
2714
+ W.forEach((e) => e.freeze());
2715
+ }, q.takeFullSnapshot = (e) => {
2716
+ if (!An) throw Error("please take full snapshot after start recording");
2717
+ On(e);
2718
+ }, q.mirror = K;
2719
2719
  //#endregion
2720
- //#region ../protocol/src/end.ts
2721
- var jn = "mime8/end@1", Mn = "mime8/environment@1";
2720
+ //#region ../protocol/src/drag.ts
2721
+ var jn = "mime8/drag@1", Mn = "mime8/end@1", Nn = "mime8/environment@1";
2722
2722
  //#endregion
2723
2723
  //#region ../protocol/src/hash.ts
2724
- function Nn(e) {
2724
+ function Pn(e) {
2725
2725
  let t = 2166136261;
2726
2726
  for (let n = 0; n < e.length; n++) t ^= e.charCodeAt(n), t = Math.imul(t, 16777619);
2727
2727
  return (t >>> 0).toString(16).padStart(8, "0");
2728
2728
  }
2729
2729
  //#endregion
2730
2730
  //#region ../protocol/src/keys.ts
2731
- var Pn = "mime8/keys@1", Fn = "mime8/rrweb-error@1", In = "mime8/network@1", Ln = "mime8/storage@1", Rn = "mime8/storage-change@1";
2731
+ var Fn = "mime8/keys@1", In = "mime8/rrweb-error@1", Ln = "mime8/network@1", Rn = "mime8/storage@1", zn = "mime8/storage-change@1";
2732
2732
  //#endregion
2733
2733
  //#region ../protocol/src/storage-wrap.ts
2734
- function zn(e, t, n, r) {
2734
+ function Bn(e, t, n, r) {
2735
2735
  let i = (e) => {
2736
2736
  try {
2737
2737
  e();
@@ -2795,50 +2795,50 @@ function zn(e, t, n, r) {
2795
2795
  }
2796
2796
  //#endregion
2797
2797
  //#region src/upload/stream.ts
2798
- function Bn(e) {
2798
+ function Vn(e) {
2799
2799
  return {
2800
2800
  type: 6,
2801
2801
  timestamp: e.t,
2802
2802
  data: {
2803
- plugin: In,
2803
+ plugin: Ln,
2804
2804
  payload: e
2805
2805
  }
2806
2806
  };
2807
2807
  }
2808
- function Vn(e, t) {
2808
+ function Hn(e, t) {
2809
2809
  return {
2810
2810
  type: 6,
2811
2811
  timestamp: t,
2812
2812
  data: {
2813
- plugin: Ln,
2813
+ plugin: Rn,
2814
2814
  payload: e
2815
2815
  }
2816
2816
  };
2817
2817
  }
2818
- function Hn(e, t) {
2818
+ function Un(e, t) {
2819
2819
  return {
2820
2820
  type: 6,
2821
2821
  timestamp: t,
2822
2822
  data: {
2823
- plugin: Mn,
2823
+ plugin: Nn,
2824
2824
  payload: e
2825
2825
  }
2826
2826
  };
2827
2827
  }
2828
- function Un(e, t) {
2828
+ function Wn(e, t) {
2829
2829
  return {
2830
2830
  type: 6,
2831
2831
  timestamp: t,
2832
2832
  data: {
2833
- plugin: jn,
2833
+ plugin: Mn,
2834
2834
  payload: e
2835
2835
  }
2836
2836
  };
2837
2837
  }
2838
2838
  //#endregion
2839
2839
  //#region src/upload/buffer.ts
2840
- var Wn = 2, Gn = 3, Kn = 5, qn = (e) => e.reduce((e, t) => e + t.length, 0);
2841
- function Jn(e, t = (e) => e, n = Infinity, r = () => {}, i = () => []) {
2840
+ var Gn = 2, Kn = 3, qn = 5, Jn = (e) => e.reduce((e, t) => e + t.length, 0);
2841
+ function Yn(e, t = (e) => e, n = Infinity, r = () => {}, i = () => []) {
2842
2842
  let a = [], o = [], s = 0, c = 0, l = !1, u = null, d = "", f = /* @__PURE__ */ new WeakMap();
2843
2843
  function p() {
2844
2844
  l || (l = !0, r());
@@ -2849,8 +2849,8 @@ function Jn(e, t = (e) => e, n = Infinity, r = () => {}, i = () => []) {
2849
2849
  let c = n.data;
2850
2850
  e.events.push(n), a.push(r), o.push({
2851
2851
  timestamp: n.timestamp,
2852
- full: n.type === Wn,
2853
- input: n.type === Gn && c?.source === Kn,
2852
+ full: n.type === Gn,
2853
+ input: n.type === Kn && c?.source === qn,
2854
2854
  url: d
2855
2855
  }), s += r.length;
2856
2856
  }
@@ -2862,7 +2862,7 @@ function Jn(e, t = (e) => e, n = Infinity, r = () => {}, i = () => []) {
2862
2862
  if (l) return;
2863
2863
  let t = JSON.stringify(e);
2864
2864
  if (s + c + t.length > n) {
2865
- h(Un({
2865
+ h(Wn({
2866
2866
  reason: "buffer",
2867
2867
  limitBytes: n,
2868
2868
  eventBytes: t.length
@@ -2880,7 +2880,7 @@ function Jn(e, t = (e) => e, n = Infinity, r = () => {}, i = () => []) {
2880
2880
  }
2881
2881
  if (n === 0) return null;
2882
2882
  let r = e.events.slice(0, n), l = a.slice(0, n), u = o.slice(0, n);
2883
- e.events = e.events.slice(n), a = a.slice(n), o = o.slice(n), s -= qn(l);
2883
+ e.events = e.events.slice(n), a = a.slice(n), o = o.slice(n), s -= Jn(l);
2884
2884
  let d = new Set(i(r, l));
2885
2885
  if (d.size > 0) {
2886
2886
  let e = (e, t) => !d.has(t);
@@ -2893,7 +2893,7 @@ function Jn(e, t = (e) => e, n = Infinity, r = () => {}, i = () => []) {
2893
2893
  events: r,
2894
2894
  json: `{"events":[${l.join(",")}]}`,
2895
2895
  parts: l,
2896
- bytes: qn(l),
2896
+ bytes: Jn(l),
2897
2897
  start: p,
2898
2898
  end: m,
2899
2899
  hasFullSnapshot: u.some((e) => e.full),
@@ -2908,14 +2908,15 @@ function Jn(e, t = (e) => e, n = Infinity, r = () => {}, i = () => []) {
2908
2908
  c -= e.bytes;
2909
2909
  },
2910
2910
  end: h,
2911
- close: p
2911
+ close: p,
2912
+ closed: () => l
2912
2913
  };
2913
2914
  }
2914
2915
  //#endregion
2915
2916
  //#region src/config.ts
2916
2917
  var J = {
2917
2918
  collectorUrl: "https://api.mime8.com",
2918
- recorderVersion: "0.2.0",
2919
+ recorderVersion: "0.3.0",
2919
2920
  ignoreUrls: [],
2920
2921
  maxBodySize: 1024 * 1024,
2921
2922
  redact: [
@@ -2928,6 +2929,8 @@ var J = {
2928
2929
  maxBufferBytes: 5 * 1024 * 1024,
2929
2930
  maxBatchChanges: 1e4,
2930
2931
  uploadInterval: 1e4,
2932
+ idleTimeout: 30 * 6e4,
2933
+ maxDuration: 60 * 6e4,
2931
2934
  streamingTypes: [
2932
2935
  "text/event-stream",
2933
2936
  "application/x-ndjson",
@@ -2948,9 +2951,12 @@ var J = {
2948
2951
  "font/",
2949
2952
  "application/wasm"
2950
2953
  ]
2951
- };
2952
- function Yn(e) {
2953
- let t = e.network ?? {}, n = t.redact ?? {};
2954
+ }, Xn = 6e4;
2955
+ function Zn(e, t) {
2956
+ return typeof e == "number" && Number.isFinite(e) && e >= Xn ? e : t;
2957
+ }
2958
+ function Qn(e) {
2959
+ let t = e.network ?? {}, n = t.redact ?? {}, r = e.session ?? {};
2954
2960
  return {
2955
2961
  ...J,
2956
2962
  projectKey: e.projectKey,
@@ -2964,30 +2970,60 @@ function Yn(e) {
2964
2970
  ...(n.bodyFields ?? []).map((e) => ({ bodyField: e }))
2965
2971
  ],
2966
2972
  beforeRecord: t.beforeRecord,
2973
+ idleTimeout: Zn(r.idleTimeout, J.idleTimeout),
2974
+ maxDuration: Zn(r.maxDuration, J.maxDuration),
2967
2975
  streamingTypes: [...J.streamingTypes],
2968
2976
  mediaTypes: [...J.mediaTypes]
2969
2977
  };
2970
2978
  }
2971
2979
  //#endregion
2980
+ //#region src/util/quietly.ts
2981
+ function Y(e) {
2982
+ try {
2983
+ e();
2984
+ } catch {}
2985
+ }
2986
+ function $n(e) {
2987
+ return e instanceof Error || e instanceof DOMException ? e.message : String(e);
2988
+ }
2989
+ //#endregion
2990
+ //#region src/capture/activity.ts
2991
+ var er = [
2992
+ "pointerdown",
2993
+ "keydown",
2994
+ "wheel",
2995
+ "touchstart",
2996
+ "input"
2997
+ ];
2998
+ function tr(e, t) {
2999
+ let n = (e) => {
3000
+ e.isTrusted && Y(t);
3001
+ };
3002
+ for (let t of er) e.addEventListener(t, n, {
3003
+ capture: !0,
3004
+ passive: !0
3005
+ });
3006
+ }
3007
+ //#endregion
2972
3008
  //#region src/capture/body.ts
2973
- var Xn = new TextDecoder("utf-8", {
3009
+ var nr = new TextDecoder("utf-8", {
2974
3010
  fatal: !0,
2975
3011
  ignoreBOM: !0
2976
3012
  });
2977
- function Zn(e) {
3013
+ function rr(e) {
2978
3014
  if (typeof e.toBase64 == "function") return e.toBase64();
2979
3015
  let t = "";
2980
3016
  for (let n = 0; n < e.length; n += 32768) t += String.fromCharCode(...e.subarray(n, n + 32768));
2981
3017
  return btoa(t);
2982
3018
  }
2983
- function Qn(e) {
3019
+ function ir(e) {
2984
3020
  try {
2985
- return { text: Xn.decode(e) };
3021
+ return { text: nr.decode(e) };
2986
3022
  } catch {
2987
- return { base64: Zn(e) };
3023
+ return { base64: rr(e) };
2988
3024
  }
2989
3025
  }
2990
- function $n(e) {
3026
+ function ar(e) {
2991
3027
  for (let t = e.length - 1; t >= Math.max(0, e.length - 3); t--) {
2992
3028
  let n = e[t];
2993
3029
  if ((n & 192) == 128) continue;
@@ -2996,37 +3032,37 @@ function $n(e) {
2996
3032
  }
2997
3033
  return e.length;
2998
3034
  }
2999
- function er(e, t) {
3035
+ function or(e, t) {
3000
3036
  if (e.length === 0) return t;
3001
3037
  let n = new Uint8Array(e.length + t.length);
3002
3038
  return n.set(e), n.set(t, e.length), n;
3003
3039
  }
3004
- function tr() {
3040
+ function sr() {
3005
3041
  let e = /* @__PURE__ */ new Uint8Array();
3006
3042
  return {
3007
3043
  push(t) {
3008
- let n = er(e, t), r = $n(n);
3044
+ let n = or(e, t), r = ar(n);
3009
3045
  try {
3010
- let t = Xn.decode(n.subarray(0, r));
3046
+ let t = nr.decode(n.subarray(0, r));
3011
3047
  return e = n.slice(r), t ? { text: t } : null;
3012
3048
  } catch {
3013
- return e = /* @__PURE__ */ new Uint8Array(), { base64: Zn(n) };
3049
+ return e = /* @__PURE__ */ new Uint8Array(), { base64: rr(n) };
3014
3050
  }
3015
3051
  },
3016
3052
  end() {
3017
3053
  if (e.length === 0) return null;
3018
- let t = Qn(e);
3054
+ let t = ir(e);
3019
3055
  return e = /* @__PURE__ */ new Uint8Array(), t;
3020
3056
  }
3021
3057
  };
3022
3058
  }
3023
- function nr(e, t) {
3059
+ function cr(e, t) {
3024
3060
  return e > t.maxBodySize ? {
3025
3061
  omitted: "too-large",
3026
3062
  size: e
3027
3063
  } : null;
3028
3064
  }
3029
- function rr(e) {
3065
+ function lr(e) {
3030
3066
  let t = 0;
3031
3067
  for (let n = 0; n < e.length; n++) {
3032
3068
  let r = e.charCodeAt(n);
@@ -3034,16 +3070,16 @@ function rr(e) {
3034
3070
  }
3035
3071
  return t;
3036
3072
  }
3037
- function ir(e, t) {
3038
- return e.length * 3 <= t.maxBodySize ? null : nr(rr(e), t);
3073
+ function ur(e, t) {
3074
+ return e.length * 3 <= t.maxBodySize ? null : cr(lr(e), t);
3039
3075
  }
3040
- async function ar(e, t, n = !1) {
3041
- let r = nr(e.size, t);
3076
+ async function dr(e, t, n = !1) {
3077
+ let r = cr(e.size, t);
3042
3078
  if (r) return r;
3043
3079
  let i = new Uint8Array(await e.arrayBuffer());
3044
- return n ? { base64: Zn(i) } : Qn(i);
3080
+ return n ? { base64: rr(i) } : ir(i);
3045
3081
  }
3046
- function or(e) {
3082
+ function fr(e) {
3047
3083
  let t = [];
3048
3084
  return e.forEach((e, n) => {
3049
3085
  t.push(typeof e == "string" ? {
@@ -3059,25 +3095,25 @@ function or(e) {
3059
3095
  });
3060
3096
  }), t;
3061
3097
  }
3062
- function sr(e, t) {
3098
+ function pr(e, t) {
3063
3099
  if (e != null) {
3064
3100
  if (typeof e == "string" || e instanceof URLSearchParams) {
3065
3101
  let n = e.toString();
3066
- return ir(n, t) ?? { text: n };
3102
+ return ur(n, t) ?? { text: n };
3067
3103
  }
3068
- if (e instanceof FormData) return { form: or(e) };
3069
- if (e instanceof Blob) return ar(e, t);
3104
+ if (e instanceof FormData) return { form: fr(e) };
3105
+ if (e instanceof Blob) return dr(e, t);
3070
3106
  if (e instanceof ArrayBuffer || ArrayBuffer.isView(e)) {
3071
3107
  let n = e instanceof ArrayBuffer ? new Uint8Array(e) : new Uint8Array(e.buffer, e.byteOffset, e.byteLength);
3072
- return nr(n.byteLength, t) ?? Qn(n);
3108
+ return cr(n.byteLength, t) ?? ir(n);
3073
3109
  }
3074
3110
  return e instanceof ReadableStream ? { omitted: "stream" } : { omitted: "unreadable" };
3075
3111
  }
3076
3112
  }
3077
- function cr(e) {
3113
+ function mr(e) {
3078
3114
  return typeof e == "string" ? "text/plain;charset=UTF-8" : e instanceof URLSearchParams ? "application/x-www-form-urlencoded;charset=UTF-8" : e instanceof FormData ? "multipart/form-data" : e instanceof Blob && e.type || null;
3079
3115
  }
3080
- async function lr(e, t) {
3116
+ async function hr(e, t) {
3081
3117
  let n = e.getReader(), r = [], i = 0;
3082
3118
  for (let e = await n.read(); !e.done; e = await n.read()) {
3083
3119
  if (i += e.value.byteLength, i > t) return n.cancel().catch(() => {}), null;
@@ -3088,18 +3124,8 @@ async function lr(e, t) {
3088
3124
  return a;
3089
3125
  }
3090
3126
  //#endregion
3091
- //#region src/util/quietly.ts
3092
- function Y(e) {
3093
- try {
3094
- e();
3095
- } catch {}
3096
- }
3097
- function ur(e) {
3098
- return e instanceof Error || e instanceof DOMException ? e.message : String(e);
3099
- }
3100
- //#endregion
3101
3127
  //#region src/capture/beacon.ts
3102
- function dr(e, t, n) {
3128
+ function gr(e, t, n) {
3103
3129
  let r = e.navigator;
3104
3130
  if (typeof r.sendBeacon != "function") return;
3105
3131
  let i = r.sendBeacon.bind(r), a = (e) => Y(() => t.emit(e));
@@ -3108,7 +3134,7 @@ function dr(e, t, n) {
3108
3134
  return Y(() => {
3109
3135
  let i = new URL(String(e), document.baseURI).href;
3110
3136
  if (t.ignores(i)) return;
3111
- let s = t.nextId(), c = Date.now(), l = cr(r), u = (e) => ({
3137
+ let s = t.nextId(), c = Date.now(), l = mr(r), u = (e) => ({
3112
3138
  type: "http-request",
3113
3139
  api: "beacon",
3114
3140
  method: "POST",
@@ -3118,7 +3144,7 @@ function dr(e, t, n) {
3118
3144
  queued: o,
3119
3145
  t: c,
3120
3146
  id: s
3121
- }), d = sr(r, n);
3147
+ }), d = pr(r, n);
3122
3148
  if (d instanceof Promise) {
3123
3149
  let e = t.place();
3124
3150
  d.catch(() => ({ omitted: "unreadable" })).then((t) => a({
@@ -3130,11 +3156,79 @@ function dr(e, t, n) {
3130
3156
  };
3131
3157
  }
3132
3158
  //#endregion
3159
+ //#region src/capture/drag.ts
3160
+ var _r = 3;
3161
+ function vr(e) {
3162
+ let t = /* @__PURE__ */ new Set();
3163
+ for (let n = yr(e); n; n = yr(n)) t.add(n);
3164
+ return {
3165
+ node: e,
3166
+ around: t
3167
+ };
3168
+ }
3169
+ function yr(e) {
3170
+ return e.parentNode instanceof ShadowRoot ? e.parentNode.host : e.parentNode;
3171
+ }
3172
+ function br(e, t, n, r) {
3173
+ for (let i of e.elementsFromPoint(t, n)) if (!r || !(i === r.node || r.around.has(i) || r.node.contains(i))) return i;
3174
+ return null;
3175
+ }
3176
+ function xr(e, t, n) {
3177
+ let r = null, i = !1, a = (i, a) => {
3178
+ let { clientX: o, clientY: s } = a, c = br(e.document, o, s, r?.press ?? null), l = {
3179
+ end: i,
3180
+ x: o,
3181
+ y: s,
3182
+ over: c ? n(c) : null
3183
+ };
3184
+ t({
3185
+ type: 6,
3186
+ timestamp: Date.now(),
3187
+ data: {
3188
+ plugin: jn,
3189
+ payload: l
3190
+ }
3191
+ });
3192
+ }, o = {
3193
+ pointerdown: (e) => {
3194
+ let t = e;
3195
+ if (t.pointerType !== "mouse" || t.button !== 0) return;
3196
+ let n = t.composedPath()[0];
3197
+ r = {
3198
+ press: n instanceof Node ? vr(n) : null,
3199
+ x: t.clientX,
3200
+ y: t.clientY
3201
+ }, i = !1;
3202
+ },
3203
+ drop: (e) => {
3204
+ i = !0, a("drop", e);
3205
+ },
3206
+ dragend: (e) => {
3207
+ i || a("cancel", e), r = null, i = !1;
3208
+ },
3209
+ pointerup: (e) => {
3210
+ let t = e;
3211
+ t.pointerType !== "mouse" || !r || ((Math.abs(t.clientX - r.x) >= _r || Math.abs(t.clientY - r.y) >= _r) && a("release", t), r = null);
3212
+ }
3213
+ }, s = {
3214
+ capture: !0,
3215
+ passive: !0
3216
+ }, c = Object.entries(o).map(([t, n]) => {
3217
+ let r = (e) => {
3218
+ e.isTrusted && Y(() => n(e));
3219
+ };
3220
+ return e.addEventListener(t, r, s), [t, r];
3221
+ });
3222
+ return () => {
3223
+ for (let [t, n] of c) e.removeEventListener(t, n, s);
3224
+ };
3225
+ }
3226
+ //#endregion
3133
3227
  //#region src/capture/environment.ts
3134
- function fr(e, t, n) {
3228
+ function Sr(e, t, n) {
3135
3229
  return n.find((n) => e.matchMedia(`(${t}: ${n})`).matches) ?? "unknown";
3136
3230
  }
3137
- function pr(e = window) {
3231
+ function Cr(e = window) {
3138
3232
  let { navigator: t, screen: n } = e;
3139
3233
  return {
3140
3234
  timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
@@ -3143,14 +3237,14 @@ function pr(e = window) {
3143
3237
  userAgent: t.userAgent,
3144
3238
  colorScheme: e.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light",
3145
3239
  reducedMotion: e.matchMedia("(prefers-reduced-motion: reduce)").matches,
3146
- hover: fr(e, "hover", ["hover", "none"]),
3147
- anyHover: fr(e, "any-hover", ["hover", "none"]),
3148
- pointer: fr(e, "pointer", [
3240
+ hover: Sr(e, "hover", ["hover", "none"]),
3241
+ anyHover: Sr(e, "any-hover", ["hover", "none"]),
3242
+ pointer: Sr(e, "pointer", [
3149
3243
  "fine",
3150
3244
  "coarse",
3151
3245
  "none"
3152
3246
  ]),
3153
- anyPointer: fr(e, "any-pointer", [
3247
+ anyPointer: Sr(e, "any-pointer", [
3154
3248
  "fine",
3155
3249
  "coarse",
3156
3250
  "none"
@@ -3164,7 +3258,7 @@ function pr(e = window) {
3164
3258
  }
3165
3259
  //#endregion
3166
3260
  //#region src/capture/keys.ts
3167
- var mr = /* @__PURE__ */ new Set([
3261
+ var wr = /* @__PURE__ */ new Set([
3168
3262
  "Enter",
3169
3263
  "Escape",
3170
3264
  "Tab",
@@ -3178,40 +3272,40 @@ var mr = /* @__PURE__ */ new Set([
3178
3272
  "End",
3179
3273
  "PageUp",
3180
3274
  "PageDown"
3181
- ]), hr = /* @__PURE__ */ new Set([
3275
+ ]), Tr = /* @__PURE__ */ new Set([
3182
3276
  "button",
3183
3277
  "submit",
3184
3278
  "reset",
3185
3279
  "checkbox",
3186
3280
  "radio"
3187
- ]), gr = /* @__PURE__ */ new Set([
3281
+ ]), Er = /* @__PURE__ */ new Set([
3188
3282
  "button",
3189
3283
  "checkbox",
3190
3284
  "switch",
3191
3285
  "menuitem"
3192
3286
  ]);
3193
- function _r(e) {
3194
- return e instanceof Element ? e instanceof HTMLButtonElement ? !0 : e instanceof HTMLInputElement ? hr.has(e.type) : gr.has(e.getAttribute("role") ?? "") : !1;
3287
+ function Dr(e) {
3288
+ return e instanceof Element ? e instanceof HTMLButtonElement ? !0 : e instanceof HTMLInputElement ? Tr.has(e.type) : Er.has(e.getAttribute("role") ?? "") : !1;
3195
3289
  }
3196
- function vr(e, t) {
3290
+ function Or(e, t) {
3197
3291
  if (e.isComposing || e.key === "Process" || e.keyCode === 229) return !1;
3198
- if (mr.has(e.key)) return !0;
3292
+ if (wr.has(e.key)) return !0;
3199
3293
  let { ctrlKey: n, metaKey: r, altKey: i } = e;
3200
3294
  if (/^.$/u.test(e.key)) {
3201
- if (e.key === " " && !n && !r && !i) return _r(t);
3295
+ if (e.key === " " && !n && !r && !i) return Dr(t);
3202
3296
  let a = e.getModifierState("AltGraph") || n && i || i && !r;
3203
3297
  return (n || r) && !a;
3204
3298
  }
3205
3299
  return n || r || i;
3206
3300
  }
3207
- function yr(e, t, n) {
3301
+ function kr(e, t, n) {
3208
3302
  let r = (e) => Y(() => {
3209
3303
  let r = e.composedPath()[0];
3210
- vr(e, r) && t({
3304
+ Or(e, r) && t({
3211
3305
  type: 6,
3212
3306
  timestamp: Date.now(),
3213
3307
  data: {
3214
- plugin: Pn,
3308
+ plugin: Fn,
3215
3309
  payload: {
3216
3310
  key: e.key,
3217
3311
  code: e.code,
@@ -3232,7 +3326,7 @@ function yr(e, t, n) {
3232
3326
  }
3233
3327
  //#endregion
3234
3328
  //#region src/capture/user-made.ts
3235
- var br = 3, xr = 2, Sr = 5, Cr = 2, wr = /* @__PURE__ */ new Set([
3329
+ var Ar = 3, jr = 2, Mr = 5, Nr = 2, Pr = /* @__PURE__ */ new Set([
3236
3330
  "click",
3237
3331
  "dblclick",
3238
3332
  "contextmenu",
@@ -3246,20 +3340,20 @@ var br = 3, xr = 2, Sr = 5, Cr = 2, wr = /* @__PURE__ */ new Set([
3246
3340
  "input",
3247
3341
  "change",
3248
3342
  "submit"
3249
- ]), Tr = /* @__PURE__ */ new Set([
3343
+ ]), Fr = /* @__PURE__ */ new Set([
3250
3344
  "keydown",
3251
3345
  "keyup",
3252
3346
  "keypress"
3253
3347
  ]);
3254
- function Er(e) {
3255
- return e?.isTrusted ? Tr.has(e.type) ? vr(e, e.composedPath()[0]) : wr.has(e.type) : !1;
3348
+ function Ir(e) {
3349
+ return e?.isTrusted ? Fr.has(e.type) ? Or(e, e.composedPath()[0]) : Pr.has(e.type) : !1;
3256
3350
  }
3257
- function Dr(e) {
3351
+ function Lr(e) {
3258
3352
  let t = e.HTMLElement.prototype, n = t.click, r = [], i = "event" in e;
3259
3353
  function a(...t) {
3260
3354
  let i = !1;
3261
3355
  Y(() => {
3262
- i = r.length > 0 ? r[r.length - 1] : Er(e.event);
3356
+ i = r.length > 0 ? r[r.length - 1] : Ir(e.event);
3263
3357
  }), r.push(i);
3264
3358
  try {
3265
3359
  return n.apply(this, t);
@@ -3269,8 +3363,8 @@ function Dr(e) {
3269
3363
  }
3270
3364
  t.click = a;
3271
3365
  let o = (t) => {
3272
- if (t.source === Sr) return t.userTriggered !== !1 || !i || e.event !== void 0 ? null : { byApp: !0 };
3273
- if (t.source !== xr || t.type !== Cr) return null;
3366
+ if (t.source === Mr) return t.userTriggered !== !1 || !i || e.event !== void 0 ? null : { byApp: !0 };
3367
+ if (t.source !== jr || t.type !== Nr) return null;
3274
3368
  let n = e.event;
3275
3369
  if (n?.type !== "click") return null;
3276
3370
  let a = { userTriggered: n.isTrusted };
@@ -3278,7 +3372,7 @@ function Dr(e) {
3278
3372
  };
3279
3373
  return {
3280
3374
  mark: (e) => {
3281
- if (e.type !== br) return e;
3375
+ if (e.type !== Ar) return e;
3282
3376
  let t;
3283
3377
  try {
3284
3378
  t = o(e.data);
@@ -3300,13 +3394,13 @@ function Dr(e) {
3300
3394
  }
3301
3395
  //#endregion
3302
3396
  //#region src/capture/eventsource.ts
3303
- var Or = EventTarget.prototype.addEventListener;
3304
- function kr(e, t) {
3397
+ var Rr = EventTarget.prototype.addEventListener;
3398
+ function zr(e, t) {
3305
3399
  let n = e.EventSource;
3306
3400
  if (typeof n != "function") return;
3307
3401
  let r = /* @__PURE__ */ new WeakMap(), i = (e) => Y(() => t.emit(e));
3308
3402
  function a(e, t, n) {
3309
- n === "open" || n === "error" || t.subscribed.has(n) || (t.subscribed.add(n), Or.call(e, n, (e) => {
3403
+ n === "open" || n === "error" || t.subscribed.has(n) || (t.subscribed.add(n), Rr.call(e, n, (e) => {
3310
3404
  let r = e;
3311
3405
  i({
3312
3406
  type: "sse-message",
@@ -3334,11 +3428,11 @@ function kr(e, t) {
3334
3428
  withCredentials: this.withCredentials,
3335
3429
  t: Date.now(),
3336
3430
  id: n
3337
- }), Or.call(this, "open", () => i({
3431
+ }), Rr.call(this, "open", () => i({
3338
3432
  type: "sse-open",
3339
3433
  t: Date.now(),
3340
3434
  id: n
3341
- })), Or.call(this, "error", () => i({
3435
+ })), Rr.call(this, "error", () => i({
3342
3436
  type: "sse-error",
3343
3437
  readyState: this.readyState,
3344
3438
  t: Date.now(),
@@ -3364,20 +3458,20 @@ function kr(e, t) {
3364
3458
  Y(() => {
3365
3459
  let t = r.get(this);
3366
3460
  t && a(this, t, e);
3367
- }), Or.call(this, e, t, n);
3461
+ }), Rr.call(this, e, t, n);
3368
3462
  }
3369
3463
  }), Object.defineProperty(o, "name", { value: "EventSource" }), e.EventSource = o;
3370
3464
  }
3371
3465
  //#endregion
3372
3466
  //#region src/capture/content-type.ts
3373
- function Ar(e, t) {
3467
+ function Br(e, t) {
3374
3468
  if (!e) return !1;
3375
3469
  let n = e.split(";")[0].trim().toLowerCase();
3376
3470
  return t.some((e) => e.endsWith("/") ? n.startsWith(e) : e.startsWith("+") ? n.endsWith(e) : n === e);
3377
3471
  }
3378
3472
  //#endregion
3379
3473
  //#region src/capture/method.ts
3380
- var jr = /* @__PURE__ */ new Set([
3474
+ var Vr = /* @__PURE__ */ new Set([
3381
3475
  "DELETE",
3382
3476
  "GET",
3383
3477
  "HEAD",
@@ -3385,69 +3479,69 @@ var jr = /* @__PURE__ */ new Set([
3385
3479
  "POST",
3386
3480
  "PUT"
3387
3481
  ]);
3388
- function Mr(e) {
3482
+ function Hr(e) {
3389
3483
  let t = e.toUpperCase();
3390
- return jr.has(t) ? t : e;
3484
+ return Vr.has(t) ? t : e;
3391
3485
  }
3392
3486
  //#endregion
3393
3487
  //#region src/capture/fetch.ts
3394
- function Nr(e) {
3488
+ function Ur(e) {
3395
3489
  return [...e];
3396
3490
  }
3397
- function Pr(e) {
3491
+ function Wr(e) {
3398
3492
  return e instanceof DOMException || e instanceof Error ? e.name : void 0;
3399
3493
  }
3400
- function Fr(e, t) {
3401
- return Pr(e) === "TimeoutError" || Pr(t?.reason) === "TimeoutError" ? "timeout" : Pr(e) === "AbortError" || t?.aborted === !0 ? "abort" : "network";
3494
+ function Gr(e, t) {
3495
+ return Wr(e) === "TimeoutError" || Wr(t?.reason) === "TimeoutError" ? "timeout" : Wr(e) === "AbortError" || t?.aborted === !0 ? "abort" : "network";
3402
3496
  }
3403
- async function Ir(e, t) {
3497
+ async function Kr(e, t) {
3404
3498
  if (!e.body) return;
3405
- let n = await lr(e.body, t.maxBodySize);
3499
+ let n = await hr(e.body, t.maxBodySize);
3406
3500
  if (!n) return { omitted: "too-large" };
3407
3501
  let r = e.headers.get("content-type");
3408
3502
  if (r?.toLowerCase().startsWith("multipart/form-data")) try {
3409
- return { form: or(await new Response(n, { headers: { "content-type": r } }).formData()) };
3503
+ return { form: fr(await new Response(n, { headers: { "content-type": r } }).formData()) };
3410
3504
  } catch {}
3411
- return Qn(n);
3505
+ return ir(n);
3412
3506
  }
3413
- function Lr(e) {
3507
+ function qr(e) {
3414
3508
  return e !== void 0 && !(e instanceof Headers) && !Array.isArray(e) && typeof e[Symbol.iterator] == "function" ? new Headers() : new Headers(e);
3415
3509
  }
3416
- function Rr(e, t, n) {
3417
- let r = t?.headers ? Lr(t.headers) : new Headers(e.headers);
3510
+ function Jr(e, t, n) {
3511
+ let r = t?.headers ? qr(t.headers) : new Headers(e.headers);
3418
3512
  if (n && !r.has("content-type")) {
3419
- let e = cr(t?.body);
3513
+ let e = mr(t?.body);
3420
3514
  e && r.set("content-type", e);
3421
3515
  }
3422
3516
  return r;
3423
3517
  }
3424
- function zr(e, t, n) {
3518
+ function Yr(e, t, n) {
3425
3519
  if (e instanceof Request) {
3426
3520
  let r = t?.body !== void 0 && t.body !== null, i = r ? null : e.clone();
3427
3521
  return {
3428
- method: Mr(t?.method ?? e.method),
3429
- headers: Nr(Rr(e, t, r)),
3430
- body: i ? Ir(i, n) : sr(t?.body, n),
3522
+ method: Hr(t?.method ?? e.method),
3523
+ headers: Ur(Jr(e, t, r)),
3524
+ body: i ? Kr(i, n) : pr(t?.body, n),
3431
3525
  signal: t?.signal ?? e.signal
3432
3526
  };
3433
3527
  }
3434
- let r = Lr(t?.headers), i = r.has("content-type") ? null : cr(t?.body);
3528
+ let r = qr(t?.headers), i = r.has("content-type") ? null : mr(t?.body);
3435
3529
  return i && r.set("content-type", i), {
3436
- method: Mr(t?.method ?? "GET"),
3437
- headers: Nr(r),
3438
- body: sr(t?.body, n),
3530
+ method: Hr(t?.method ?? "GET"),
3531
+ headers: Ur(r),
3532
+ body: pr(t?.body, n),
3439
3533
  signal: t?.signal
3440
3534
  };
3441
3535
  }
3442
- function Br(e) {
3536
+ function Xr(e) {
3443
3537
  return e instanceof Request ? e.url : new URL(e instanceof URL ? e.href : String(e), document.baseURI).href;
3444
3538
  }
3445
- function Vr(e, t, n) {
3539
+ function Zr(e, t, n) {
3446
3540
  let r = e.fetch;
3447
3541
  function i(e, r) {
3448
- let i = Br(e);
3542
+ let i = Xr(e);
3449
3543
  if (t.ignores(i)) return null;
3450
- let a = t.nextId(), o = Date.now(), { method: s, headers: c, body: l, signal: u } = zr(e, r, n), d = (e) => Y(() => t.emit(e)), f = (e) => ({
3544
+ let a = t.nextId(), o = Date.now(), { method: s, headers: c, body: l, signal: u } = Yr(e, r, n), d = (e) => Y(() => t.emit(e)), f = (e) => ({
3451
3545
  type: "http-request",
3452
3546
  api: "fetch",
3453
3547
  method: s,
@@ -3466,8 +3560,8 @@ function Vr(e, t, n) {
3466
3560
  } else d(f(l));
3467
3561
  let p = (e) => d({
3468
3562
  type: "http-error",
3469
- reason: Fr(e, u),
3470
- message: ur(e),
3563
+ reason: Gr(e, u),
3564
+ message: $n(e),
3471
3565
  t: Date.now(),
3472
3566
  id: a
3473
3567
  });
@@ -3482,11 +3576,11 @@ function Vr(e, t, n) {
3482
3576
  return;
3483
3577
  }
3484
3578
  try {
3485
- let r = await lr(t.body, n.maxBodySize);
3579
+ let r = await hr(t.body, n.maxBodySize);
3486
3580
  if (r) {
3487
3581
  d({
3488
3582
  type: "http-end",
3489
- body: Qn(r),
3583
+ body: ir(r),
3490
3584
  t: Date.now(),
3491
3585
  id: a
3492
3586
  });
@@ -3507,7 +3601,7 @@ function Vr(e, t, n) {
3507
3601
  }
3508
3602
  }
3509
3603
  function h(e, t) {
3510
- let r = tr(), i = null, o = 0, s = !1, c = (e) => Y(() => {
3604
+ let r = sr(), i = null, o = 0, s = !1, c = (e) => Y(() => {
3511
3605
  if (s) return;
3512
3606
  if (o += e.byteLength, o > n.maxBodySize) {
3513
3607
  s = !0;
@@ -3579,7 +3673,7 @@ function Vr(e, t, n) {
3579
3673
  url: e.url || i,
3580
3674
  redirected: e.redirected,
3581
3675
  fetchType: e.type,
3582
- headers: Nr(e.headers),
3676
+ headers: Ur(e.headers),
3583
3677
  t: Date.now(),
3584
3678
  id: a
3585
3679
  }), e.type === "opaque" || e.type === "opaqueredirect") {
@@ -3591,7 +3685,7 @@ function Vr(e, t, n) {
3591
3685
  return;
3592
3686
  }
3593
3687
  let t = e.headers.get("content-type");
3594
- if (Ar(t, n.mediaTypes)) {
3688
+ if (Br(t, n.mediaTypes)) {
3595
3689
  d({
3596
3690
  type: "http-end",
3597
3691
  body: { omitted: "media" },
@@ -3600,7 +3694,7 @@ function Vr(e, t, n) {
3600
3694
  });
3601
3695
  return;
3602
3696
  }
3603
- if (Ar(t, n.streamingTypes) && e.body) return h(e, e.body);
3697
+ if (Br(t, n.streamingTypes) && e.body) return h(e, e.body);
3604
3698
  m(e);
3605
3699
  }
3606
3700
  };
@@ -3626,15 +3720,15 @@ function Vr(e, t, n) {
3626
3720
  }
3627
3721
  //#endregion
3628
3722
  //#region src/capture/markers.ts
3629
- var Hr = [
3723
+ var Qr = [
3630
3724
  "RTCPeerConnection",
3631
3725
  "Worker",
3632
3726
  "SharedWorker",
3633
3727
  "WebTransport",
3634
3728
  "WebSocketStream"
3635
3729
  ];
3636
- function Ur(e, t) {
3637
- for (let n of Hr) {
3730
+ function $r(e, t) {
3731
+ for (let n of Qr) {
3638
3732
  let r = e[n];
3639
3733
  if (typeof r != "function") continue;
3640
3734
  let i = class extends r {
@@ -3655,7 +3749,7 @@ function Ur(e, t) {
3655
3749
  }
3656
3750
  //#endregion
3657
3751
  //#region src/capture/mutation-guard.ts
3658
- function Wr(e, t) {
3752
+ function ei(e, t) {
3659
3753
  if (e.length > t) return e.length;
3660
3754
  let n = e.length;
3661
3755
  for (let r of e) {
@@ -3667,7 +3761,7 @@ function Wr(e, t) {
3667
3761
  }
3668
3762
  return n;
3669
3763
  }
3670
- function Gr(e, t, n) {
3764
+ function ti(e, t, n) {
3671
3765
  return (r) => {
3672
3766
  let i = !1;
3673
3767
  return Y(() => {
@@ -3675,25 +3769,25 @@ function Gr(e, t, n) {
3675
3769
  i = !0;
3676
3770
  return;
3677
3771
  }
3678
- Wr(r, e) > e && (t(r.length), i = !0);
3772
+ ei(r, e) > e && (t(r.length), i = !0);
3679
3773
  }), !i;
3680
3774
  };
3681
3775
  }
3682
3776
  //#endregion
3683
3777
  //#region src/redact/matcher.ts
3684
- function Kr(e, t) {
3778
+ function ni(e, t) {
3685
3779
  return e.lastIndex = 0, e.test(t);
3686
3780
  }
3687
3781
  function X(e, t) {
3688
- return typeof e == "string" ? e.toLowerCase() === t.toLowerCase() : e instanceof RegExp ? Kr(e, t) : e(t);
3782
+ return typeof e == "string" ? e.toLowerCase() === t.toLowerCase() : e instanceof RegExp ? ni(e, t) : e(t);
3689
3783
  }
3690
- function qr(e, t) {
3691
- return typeof e == "string" ? t.startsWith(e) : e instanceof RegExp ? Kr(e, t) : e(t);
3784
+ function ri(e, t) {
3785
+ return typeof e == "string" ? t.startsWith(e) : e instanceof RegExp ? ni(e, t) : e(t);
3692
3786
  }
3693
3787
  //#endregion
3694
3788
  //#region src/redact/json.ts
3695
3789
  var Z = "[redacted]", Q = () => {};
3696
- function Jr(e, t, n, r = null) {
3790
+ function ii(e, t, n, r = null) {
3697
3791
  let i = (t) => {
3698
3792
  for (; /\s/.test(e[t] ?? "");) t++;
3699
3793
  return t;
@@ -3714,35 +3808,35 @@ function Jr(e, t, n, r = null) {
3714
3808
  for (; e[c] !== s;) {
3715
3809
  if (o === "{") {
3716
3810
  let t = a(c), r = JSON.parse(e.slice(c, t));
3717
- c = i(i(t) + 1), c = Jr(e, c, n, r);
3718
- } else c = Jr(e, c, n);
3811
+ c = i(i(t) + 1), c = ii(e, c, n, r);
3812
+ } else c = ii(e, c, n);
3719
3813
  c = i(c), e[c] === "," && (c = i(c + 1));
3720
3814
  }
3721
3815
  return n(r, t, c + 1), c + 1;
3722
3816
  }
3723
- function Yr(e, t) {
3817
+ function ai(e, t) {
3724
3818
  if (t.length === 0) return e;
3725
3819
  t.sort((e, t) => e[0] - t[0] || t[1] - e[1]);
3726
3820
  let n = "", r = 0;
3727
3821
  for (let [i, a, o] of t) i < r || (n += `${e.slice(r, i)}${o}`, r = a);
3728
3822
  return n + e.slice(r);
3729
3823
  }
3730
- function Xr(e) {
3824
+ function oi(e) {
3731
3825
  if (!e.startsWith("\"")) return null;
3732
3826
  let t = JSON.parse(e);
3733
- return /^\s*[[{]/.test(t) && Zr(t) ? t : null;
3827
+ return /^\s*[[{]/.test(t) && si(t) ? t : null;
3734
3828
  }
3735
- function Zr(e) {
3829
+ function si(e) {
3736
3830
  try {
3737
3831
  return JSON.parse(e), !0;
3738
3832
  } catch {
3739
3833
  return !1;
3740
3834
  }
3741
3835
  }
3742
- var Qr = (e) => /^\s*[[{]/.test(e) && Zr(e), $r = (e) => /^\s*"/.test(e) && Zr(e);
3743
- function ei(e, t) {
3836
+ var ci = (e) => /^\s*[[{]/.test(e) && si(e), li = (e) => /^\s*"/.test(e) && si(e);
3837
+ function ui(e, t) {
3744
3838
  let n = [];
3745
- return Jr(e, e.search(/\S/), (r, i, a) => {
3839
+ return ii(e, e.search(/\S/), (r, i, a) => {
3746
3840
  let o = e.slice(i, a);
3747
3841
  if (!o.startsWith("\"")) return;
3748
3842
  let s = JSON.stringify(t(JSON.parse(o)));
@@ -3751,12 +3845,12 @@ function ei(e, t) {
3751
3845
  a,
3752
3846
  s
3753
3847
  ]);
3754
- }), Yr(e, n);
3848
+ }), ai(e, n);
3755
3849
  }
3756
- function ti(e, t, n) {
3757
- if (!Zr(e)) return e;
3850
+ function di(e, t, n) {
3851
+ if (!si(e)) return e;
3758
3852
  let r = [];
3759
- return Jr(e, e.search(/\S/), (i, a, o) => {
3853
+ return ii(e, e.search(/\S/), (i, a, o) => {
3760
3854
  let s = e.slice(a, o);
3761
3855
  if (i !== null && X(t, i)) {
3762
3856
  s.startsWith("\"") ? r.push([
@@ -3766,7 +3860,7 @@ function ti(e, t, n) {
3766
3860
  ]) : s.startsWith("{") || s.startsWith("[") ? r.push([
3767
3861
  a,
3768
3862
  o,
3769
- ei(s, n)
3863
+ ui(s, n)
3770
3864
  ]) : r.push([
3771
3865
  a,
3772
3866
  o,
@@ -3774,20 +3868,20 @@ function ti(e, t, n) {
3774
3868
  ]);
3775
3869
  return;
3776
3870
  }
3777
- let c = Xr(s);
3871
+ let c = oi(s);
3778
3872
  if (c === null) return;
3779
- let l = ti(c, t, n);
3873
+ let l = di(c, t, n);
3780
3874
  l !== c && r.push([
3781
3875
  a,
3782
3876
  o,
3783
3877
  JSON.stringify(l)
3784
3878
  ]);
3785
- }), Yr(e, r);
3879
+ }), ai(e, r);
3786
3880
  }
3787
3881
  //#endregion
3788
3882
  //#region src/redact/kind.ts
3789
- var ni = /^([\w-]+)\.([\w-]+)\.([\w-]*)$/, ri = "cmVkYWN0ZWQ";
3790
- function ii(e) {
3883
+ var fi = /^([\w-]+)\.([\w-]+)\.([\w-]*)$/, pi = "cmVkYWN0ZWQ";
3884
+ function mi(e) {
3791
3885
  try {
3792
3886
  let t = atob(e.replace(/-/g, "+").replace(/_/g, "/"));
3793
3887
  return new TextDecoder("utf-8", { fatal: !0 }).decode(Uint8Array.from(t, (e) => e.charCodeAt(0)));
@@ -3795,12 +3889,12 @@ function ii(e) {
3795
3889
  return null;
3796
3890
  }
3797
3891
  }
3798
- function ai(e) {
3892
+ function hi(e) {
3799
3893
  let t = "";
3800
3894
  for (let n of new TextEncoder().encode(e)) t += String.fromCharCode(n);
3801
3895
  return btoa(t).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
3802
3896
  }
3803
- function oi(e) {
3897
+ function gi(e) {
3804
3898
  try {
3805
3899
  let t = e === null ? null : JSON.parse(e);
3806
3900
  return typeof t == "object" && t && !Array.isArray(t) ? t : null;
@@ -3808,25 +3902,25 @@ function oi(e) {
3808
3902
  return null;
3809
3903
  }
3810
3904
  }
3811
- function si(e, t = Q) {
3905
+ function _i(e, t = Q) {
3812
3906
  let n = (r) => {
3813
- let i = ni.exec(r);
3907
+ let i = fi.exec(r);
3814
3908
  if (!i) return null;
3815
- let o = oi(ii(i[1]))?.alg, s = ii(i[2]);
3816
- if (typeof o != "string" || !oi(s)) return null;
3909
+ let o = gi(mi(i[1]))?.alg, s = mi(i[2]);
3910
+ if (typeof o != "string" || !gi(s)) return null;
3817
3911
  let c = Z;
3818
3912
  if (i[3] !== "" && o.toLowerCase() !== "none") {
3819
3913
  let t = s;
3820
- for (let n of e) t = ti(t, n, a);
3914
+ for (let n of e) t = di(t, n, a);
3821
3915
  t = $(t, n);
3822
- let r = t === s ? i[2] : ai(t);
3823
- c = `${i[1]}.${r}.${ri}`;
3916
+ let r = t === s ? i[2] : hi(t);
3917
+ c = `${i[1]}.${r}.${pi}`;
3824
3918
  }
3825
3919
  return t(r, c), c;
3826
3920
  }, r = (e) => (t(e, Z), Z), i = (e) => n(e) ?? r(e), a = (e) => {
3827
- if (Qr(e)) return ei(e, a);
3828
- if ($r(e)) return JSON.stringify(a(JSON.parse(e)));
3829
- let t = ci.exec(e), i = t && n(t[2]);
3921
+ if (ci(e)) return ui(e, a);
3922
+ if (li(e)) return JSON.stringify(a(JSON.parse(e)));
3923
+ let t = vi.exec(e), i = t && n(t[2]);
3830
3924
  return i ? t[1] === void 0 ? i : `${t[1]} ${i}` : r(e);
3831
3925
  };
3832
3926
  return {
@@ -3835,17 +3929,17 @@ function si(e, t = Q) {
3835
3929
  jwt: n
3836
3930
  };
3837
3931
  }
3838
- var ci = /^(?:([A-Za-z][\w-]*) )?([\w-]+\.[\w-]+\.[\w-]*)$/, li = /^[^\s=&]+=[^\s&]*(?:&[^\s=&]+=[^\s&]*)*$/, ui = /(?:(?<=%[0-9A-Fa-f]{2})|(?<![\w.%-]))[\w-]+\.[\w-]+\.[\w-]*(?![\w-]|\.[\w-])/g;
3932
+ var vi = /^(?:([A-Za-z][\w-]*) )?([\w-]+\.[\w-]+\.[\w-]*)$/, yi = /^[^\s=&]+=[^\s&]*(?:&[^\s=&]+=[^\s&]*)*$/, bi = /(?:(?<=%[0-9A-Fa-f]{2})|(?<![\w.%-]))[\w-]+\.[\w-]+\.[\w-]*(?![\w-]|\.[\w-])/g;
3839
3933
  function $(e, t) {
3840
- return e.includes(".") ? e.replace(ui, (e) => t(e) ?? e) : e;
3934
+ return e.includes(".") ? e.replace(bi, (e) => t(e) ?? e) : e;
3841
3935
  }
3842
- function di(e, t, { plusIsSpace: n = !0 } = {}) {
3843
- let r = mi(e, n);
3936
+ function xi(e, t, { plusIsSpace: n = !0 } = {}) {
3937
+ let r = wi(e, n);
3844
3938
  if (r === e) return null;
3845
3939
  let i = $(r, t);
3846
3940
  return i === r ? null : encodeURIComponent(i);
3847
3941
  }
3848
- function fi(e, t) {
3942
+ function Si(e, t) {
3849
3943
  let n = !1, r = e.split("&").map((e) => {
3850
3944
  let r = e.indexOf("=");
3851
3945
  if (r === -1) return e;
@@ -3854,33 +3948,33 @@ function fi(e, t) {
3854
3948
  });
3855
3949
  return n ? r.join("&") : e;
3856
3950
  }
3857
- function pi(e) {
3951
+ function Ci(e) {
3858
3952
  return e.flatMap((e) => "bodyField" in e ? [e.bodyField] : []);
3859
3953
  }
3860
- function mi(e, t = !0) {
3954
+ function wi(e, t = !0) {
3861
3955
  try {
3862
3956
  return decodeURIComponent(t ? e.replaceAll("+", " ") : e);
3863
3957
  } catch {
3864
3958
  return e;
3865
3959
  }
3866
3960
  }
3867
- function hi(e, t, n) {
3961
+ function Ti(e, t, n) {
3868
3962
  let r = !1, i = e.split("&").map((e) => {
3869
3963
  let i = e.indexOf("=");
3870
3964
  if (i === -1) return e;
3871
3965
  let a = e.slice(0, i);
3872
- return X(t, mi(a)) ? (r = !0, `${a}=${n(e.slice(i + 1))}`) : e;
3966
+ return X(t, wi(a)) ? (r = !0, `${a}=${n(e.slice(i + 1))}`) : e;
3873
3967
  });
3874
3968
  return r ? i.join("&") : e;
3875
3969
  }
3876
3970
  //#endregion
3877
3971
  //#region src/redact/body-field.ts
3878
- function gi(e) {
3972
+ function Ei(e) {
3879
3973
  return (e.find(([e]) => e === "content-type")?.[1] ?? "").split(";")[0].trim().toLowerCase() === "application/x-www-form-urlencoded";
3880
3974
  }
3881
- function _i(e, t, n, r = !1) {
3975
+ function Di(e, t, n, r = !1) {
3882
3976
  if ("text" in e) {
3883
- let i = r ? hi(e.text, t, n) : ti(e.text, t, n);
3977
+ let i = r ? Ti(e.text, t, n) : di(e.text, t, n);
3884
3978
  return i === e.text ? e : { text: i };
3885
3979
  }
3886
3980
  return "form" in e && e.form.some((e) => X(t, e.name)) ? { form: e.form.map((e) => X(t, e.name) ? {
@@ -3888,14 +3982,14 @@ function _i(e, t, n, r = !1) {
3888
3982
  value: "value" in e ? n(e.value) : Z
3889
3983
  } : e) } : e;
3890
3984
  }
3891
- var vi = {
3985
+ var Oi = {
3892
3986
  is: (e) => "bodyField" in e,
3893
3987
  apply(e, t, n) {
3894
3988
  let r = t.bodyField;
3895
3989
  switch (e.type) {
3896
3990
  case "http-request": {
3897
3991
  if (!e.body) return e;
3898
- let t = _i(e.body, r, n, gi(e.headers));
3992
+ let t = Di(e.body, r, n, Ei(e.headers));
3899
3993
  return t === e.body ? e : {
3900
3994
  ...e,
3901
3995
  body: t
@@ -3903,7 +3997,7 @@ var vi = {
3903
3997
  }
3904
3998
  case "http-end": {
3905
3999
  if (!e.body) return e;
3906
- let t = "text" in e.body && li.test(e.body.text), i = _i(e.body, r, n, t);
4000
+ let t = "text" in e.body && yi.test(e.body.text), i = Di(e.body, r, n, t);
3907
4001
  return i === e.body ? e : {
3908
4002
  ...e,
3909
4003
  body: i
@@ -3911,14 +4005,14 @@ var vi = {
3911
4005
  }
3912
4006
  case "ws-send":
3913
4007
  case "ws-message": {
3914
- let t = _i(e.data, r, n);
4008
+ let t = Di(e.data, r, n);
3915
4009
  return t === e.data ? e : {
3916
4010
  ...e,
3917
4011
  data: t
3918
4012
  };
3919
4013
  }
3920
4014
  case "sse-message": {
3921
- let t = ti(e.data, r, n);
4015
+ let t = di(e.data, r, n);
3922
4016
  return t === e.data ? e : {
3923
4017
  ...e,
3924
4018
  data: t
@@ -3930,37 +4024,37 @@ var vi = {
3930
4024
  };
3931
4025
  //#endregion
3932
4026
  //#region src/redact/header.ts
3933
- function yi(e, t, n) {
4027
+ function ki(e, t, n) {
3934
4028
  if (e.toLowerCase() === "cookie") for (let e of t.split(/;\s*/)) {
3935
4029
  let t = e.indexOf("=");
3936
4030
  t !== -1 && n(e.slice(t + 1), Z);
3937
4031
  }
3938
4032
  }
3939
- function bi(e, t, n, r) {
3940
- return e.some(([e]) => X(t, e)) ? e.map(([e, i]) => X(t, e) ? (yi(e, i, r), [e, n(i)]) : [e, i]) : e;
4033
+ function Ai(e, t, n, r) {
4034
+ return e.some(([e]) => X(t, e)) ? e.map(([e, i]) => X(t, e) ? (ki(e, i, r), [e, n(i)]) : [e, i]) : e;
3941
4035
  }
3942
- var xi = {
4036
+ var ji = {
3943
4037
  is: (e) => "header" in e,
3944
4038
  apply(e, t, n, r) {
3945
4039
  if (e.type !== "http-request" && e.type !== "http-response") return e;
3946
- let i = bi(e.headers, t.header, n, r);
4040
+ let i = Ai(e.headers, t.header, n, r);
3947
4041
  return i === e.headers ? e : {
3948
4042
  ...e,
3949
4043
  headers: i
3950
4044
  };
3951
4045
  }
3952
- }, Si = (e) => (t) => (e(t, Z), Z);
3953
- function Ci(e, t) {
4046
+ }, Mi = (e) => (t) => (e(t, Z), Z);
4047
+ function Ni(e, t) {
3954
4048
  let n = e.indexOf("#"), r = n === -1 ? e : e.slice(0, n), i = n === -1 ? null : e.slice(n + 1), a = r, o = r.indexOf("?");
3955
4049
  if (o !== -1 && (a = r.slice(0, o + 1) + t(r.slice(o + 1))), i === null) return a;
3956
4050
  let s = i.indexOf("?"), c = i;
3957
4051
  return s === -1 ? i.includes("=") && (c = t(i)) : c = i.slice(0, s + 1) + t(i.slice(s + 1)), `${a}#${c}`;
3958
4052
  }
3959
- function wi(e, t, n = Q) {
3960
- return Ci(e, (e) => hi(e, t, Si(n)));
4053
+ function Pi(e, t, n = Q) {
4054
+ return Ni(e, (e) => Ti(e, t, Mi(n)));
3961
4055
  }
3962
- function Ti(e, t) {
3963
- let n = (e) => fi(e, (e) => $(Ei(e), t) === Ei(e) ? null : Z), r = (e) => $(e, t).split("/").map((e) => di(e, t, { plusIsSpace: !1 }) ?? e).join("/"), i = (e) => {
4056
+ function Fi(e, t) {
4057
+ let n = (e) => Si(e, (e) => $(Ii(e), t) === Ii(e) ? null : Z), r = (e) => $(e, t).split("/").map((e) => xi(e, t, { plusIsSpace: !1 }) ?? e).join("/"), i = (e) => {
3964
4058
  let t = e.indexOf("?");
3965
4059
  return t === -1 ? r(e) : r(e.slice(0, t)) + "?" + n(e.slice(t + 1));
3966
4060
  }, a = e.indexOf("#");
@@ -3968,14 +4062,14 @@ function Ti(e, t) {
3968
4062
  let o = e.slice(a + 1), s = !o.includes("?") && o.includes("=") ? n(o) : i(o);
3969
4063
  return `${i(e.slice(0, a))}#${s}`;
3970
4064
  }
3971
- function Ei(e) {
4065
+ function Ii(e) {
3972
4066
  try {
3973
4067
  return decodeURIComponent(e.replaceAll("+", " "));
3974
4068
  } catch {
3975
4069
  return e;
3976
4070
  }
3977
4071
  }
3978
- var Di = {
4072
+ var Li = {
3979
4073
  is: (e) => "queryParam" in e,
3980
4074
  apply(e, t, n, r) {
3981
4075
  switch (e.type) {
@@ -3985,7 +4079,7 @@ var Di = {
3985
4079
  case "ws-connect":
3986
4080
  case "marker": {
3987
4081
  if (e.url === void 0) return e;
3988
- let n = wi(e.url, t.queryParam, r);
4082
+ let n = Pi(e.url, t.queryParam, r);
3989
4083
  return n === e.url ? e : {
3990
4084
  ...e,
3991
4085
  url: n
@@ -3994,36 +4088,36 @@ var Di = {
3994
4088
  default: return e;
3995
4089
  }
3996
4090
  }
3997
- }, Oi = [
3998
- xi,
3999
- Di,
4000
- vi
4001
- ], ki = /^([a-z][a-z\d+.-]*:\/\/[^/?#@:]*:)([^/?#@]*)@/i;
4002
- function Ai(e, t) {
4003
- let n = ki.exec(e);
4091
+ }, Ri = [
4092
+ ji,
4093
+ Li,
4094
+ Oi
4095
+ ], zi = /^([a-z][a-z\d+.-]*:\/\/[^/?#@:]*:)([^/?#@]*)@/i;
4096
+ function Bi(e, t) {
4097
+ let n = zi.exec(e);
4004
4098
  return n ? (t(n[2], Z), `${n[1]}${Z}@${e.slice(n[0].length)}`) : e;
4005
4099
  }
4006
- function ji(e, t, n = Q) {
4100
+ function Vi(e, t, n = Q) {
4007
4101
  let r = e;
4008
4102
  if ("url" in r && r.url !== void 0) {
4009
- let e = Ai(r.url, n);
4103
+ let e = Bi(r.url, n);
4010
4104
  e !== r.url && (r = {
4011
4105
  ...r,
4012
4106
  url: e
4013
4107
  });
4014
4108
  }
4015
- let { replace: i, field: a, jwt: o } = si(pi(t), n);
4109
+ let { replace: i, field: a, jwt: o } = _i(Ci(t), n);
4016
4110
  for (let e of t) {
4017
- let t = Oi.find((t) => t.is(e));
4111
+ let t = Ri.find((t) => t.is(e));
4018
4112
  t && (r = t.apply(r, e, "bodyField" in e ? a : i, n));
4019
4113
  }
4020
- return Mi(r, o);
4114
+ return Hi(r, o);
4021
4115
  }
4022
- function Mi(e, t) {
4116
+ function Hi(e, t) {
4023
4117
  let n = (e) => {
4024
4118
  if ("text" in e) {
4025
4119
  let n = $(e.text, t);
4026
- return li.test(n) && (n = fi(n, (e) => di(e, t))), n === e.text ? e : { text: n };
4120
+ return yi.test(n) && (n = Si(n, (e) => xi(e, t))), n === e.text ? e : { text: n };
4027
4121
  }
4028
4122
  let n = (e) => $(e, t);
4029
4123
  return "form" in e && e.form.some((e) => "value" in e && n(e.value) !== e.value) ? { form: e.form.map((e) => "value" in e ? {
@@ -4032,7 +4126,7 @@ function Mi(e, t) {
4032
4126
  } : e) } : e;
4033
4127
  }, r = (e) => e.some(([, e]) => $(e, t) !== e) ? e.map(([e, n]) => [e, $(n, t)]) : e, i = e;
4034
4128
  if ("url" in i && i.url !== void 0) {
4035
- let e = Ti(i.url, t);
4129
+ let e = Fi(i.url, t);
4036
4130
  e !== i.url && (i = {
4037
4131
  ...i,
4038
4132
  url: e
@@ -4079,22 +4173,22 @@ function Mi(e, t) {
4079
4173
  default: return i;
4080
4174
  }
4081
4175
  }
4082
- function Ni(e, t, n = Q) {
4083
- let r = Ai(e, n);
4084
- for (let e of t) Di.is(e) && (r = wi(r, e.queryParam, n));
4085
- return Ti(r, si(pi(t), n).jwt);
4176
+ function Ui(e, t, n = Q) {
4177
+ let r = Bi(e, n);
4178
+ for (let e of t) Li.is(e) && (r = Pi(r, e.queryParam, n));
4179
+ return Fi(r, _i(Ci(t), n).jwt);
4086
4180
  }
4087
4181
  //#endregion
4088
4182
  //#region src/capture/pipeline.ts
4089
- function Pi(e, t, n = () => !1, r = Q) {
4183
+ function Wi(e, t, n = () => !1, r = Q) {
4090
4184
  let i = 0, a = 0;
4091
4185
  return {
4092
- ignores: (t) => n() || e.ignoreUrls.some((e) => qr(e, t)),
4186
+ ignores: (t) => n() || e.ignoreUrls.some((e) => ri(e, t)),
4093
4187
  nextId: () => a++,
4094
4188
  place: () => i++,
4095
4189
  emit(n) {
4096
4190
  try {
4097
- let a = ji(n, e.redact, r);
4191
+ let a = Vi(n, e.redact, r);
4098
4192
  if (e.beforeRecord && (a = e.beforeRecord(a)), !a) return;
4099
4193
  t({
4100
4194
  ...a,
@@ -4106,23 +4200,23 @@ function Pi(e, t, n = () => !1, r = Q) {
4106
4200
  }
4107
4201
  //#endregion
4108
4202
  //#region src/capture/rrweb-errors.ts
4109
- var Fi = 3, Ii = /^(?:[A-Z][A-Za-z]{0,58})?Error$/;
4110
- function Li(e) {
4203
+ var Gi = 3, Ki = /^(?:[A-Z][A-Za-z]{0,58})?Error$/;
4204
+ function qi(e) {
4111
4205
  let t;
4112
4206
  try {
4113
4207
  t = e?.name;
4114
4208
  } catch {}
4115
- return typeof t == "string" && Ii.test(t) ? t : "other";
4209
+ return typeof t == "string" && Ki.test(t) ? t : "other";
4116
4210
  }
4117
- function Ri(e) {
4211
+ function Ji(e) {
4118
4212
  let t = /* @__PURE__ */ new Set();
4119
4213
  return (n, r) => Y(() => {
4120
- let i = Li(n), a = `${i} ${r}`;
4121
- t.size >= Fi || t.has(a) || (t.add(a), e({
4214
+ let i = qi(n), a = `${i} ${r}`;
4215
+ t.size >= Gi || t.has(a) || (t.add(a), e({
4122
4216
  type: 6,
4123
4217
  timestamp: Date.now(),
4124
4218
  data: {
4125
- plugin: Fn,
4219
+ plugin: In,
4126
4220
  payload: {
4127
4221
  name: i,
4128
4222
  during: r
@@ -4133,8 +4227,8 @@ function Ri(e) {
4133
4227
  }
4134
4228
  //#endregion
4135
4229
  //#region src/capture/websocket.ts
4136
- var zi = EventTarget.prototype.addEventListener;
4137
- function Bi(e, t, n) {
4230
+ var Yi = EventTarget.prototype.addEventListener;
4231
+ function Xi(e, t, n) {
4138
4232
  let r = e.WebSocket;
4139
4233
  if (typeof r != "function") return;
4140
4234
  let i = /* @__PURE__ */ new WeakMap(), a = (e) => Y(() => t.emit(e));
@@ -4148,7 +4242,7 @@ function Bi(e, t, n) {
4148
4242
  let s = Date.now();
4149
4243
  if (r instanceof Blob) {
4150
4244
  let o = t.place();
4151
- ar(r, n, !0).catch(() => ({ omitted: "unreadable" })).then((t) => a({
4245
+ dr(r, n, !0).catch(() => ({ omitted: "unreadable" })).then((t) => a({
4152
4246
  type: e,
4153
4247
  data: t,
4154
4248
  t: s,
@@ -4158,10 +4252,10 @@ function Bi(e, t, n) {
4158
4252
  return;
4159
4253
  }
4160
4254
  let c;
4161
- if (typeof r == "string") c = ir(r, n) ?? { text: r };
4255
+ if (typeof r == "string") c = ur(r, n) ?? { text: r };
4162
4256
  else if (r instanceof ArrayBuffer || ArrayBuffer.isView(r)) {
4163
4257
  let e = r instanceof ArrayBuffer ? new Uint8Array(r) : new Uint8Array(r.buffer, r.byteOffset, r.byteLength);
4164
- c = o(e.byteLength) ?? { base64: Zn(e) };
4258
+ c = o(e.byteLength) ?? { base64: rr(e) };
4165
4259
  } else c = { omitted: "unreadable" };
4166
4260
  a({
4167
4261
  type: e,
@@ -4186,13 +4280,13 @@ function Bi(e, t, n) {
4186
4280
  protocols: n === void 0 ? [] : [n].flat(),
4187
4281
  t: Date.now(),
4188
4282
  id: r
4189
- }), zi.call(this, "open", () => a({
4283
+ }), Yi.call(this, "open", () => a({
4190
4284
  type: "ws-open",
4191
4285
  protocol: this.protocol,
4192
4286
  extensions: this.extensions,
4193
4287
  t: Date.now(),
4194
4288
  id: r
4195
- })), zi.call(this, "message", (e) => Y(() => s("ws-message", e.data, r))), zi.call(this, "close", (t) => {
4289
+ })), Yi.call(this, "message", (e) => Y(() => s("ws-message", e.data, r))), Yi.call(this, "close", (t) => {
4196
4290
  let n = t;
4197
4291
  a({
4198
4292
  type: "ws-close",
@@ -4203,7 +4297,7 @@ function Bi(e, t, n) {
4203
4297
  t: Date.now(),
4204
4298
  id: r
4205
4299
  });
4206
- }), zi.call(this, "error", () => a({
4300
+ }), Yi.call(this, "error", () => a({
4207
4301
  type: "ws-error",
4208
4302
  t: Date.now(),
4209
4303
  id: r
@@ -4227,44 +4321,44 @@ function Bi(e, t, n) {
4227
4321
  }
4228
4322
  //#endregion
4229
4323
  //#region src/redact/storage.ts
4230
- var Vi = /^(?:__Host-|__Secure-)?(?:session|sid|connect\.sid|phpsessid|jsessionid|asp\.net_sessionid|.+_session)$/i;
4231
- function Hi(e, t, n, r = Q) {
4232
- let i = pi(n), { replace: a, field: o, jwt: s } = si(i, r);
4233
- if (X(Vi, e)) return a(t);
4324
+ var Zi = /^(?:__Host-|__Secure-)?(?:session|sid|connect\.sid|phpsessid|jsessionid|asp\.net_sessionid|.+_session)$/i;
4325
+ function Qi(e, t, n, r = Q) {
4326
+ let i = Ci(n), { replace: a, field: o, jwt: s } = _i(i, r);
4327
+ if (X(Zi, e)) return a(t);
4234
4328
  if (i.some((t) => X(t, e))) return o(t);
4235
- if (Qr(t)) {
4329
+ if (ci(t)) {
4236
4330
  let e = t;
4237
- for (let t of i) e = ti(e, t, o);
4331
+ for (let t of i) e = di(e, t, o);
4238
4332
  return $(e, s);
4239
4333
  }
4240
4334
  return $(t, s);
4241
4335
  }
4242
- function Ui(e, t, n, r) {
4243
- (X(Vi, e) || pi(n).some((t) => X(t, e)) || t.includes(".eyJ")) && Hi(e, t, n, r);
4336
+ function $i(e, t, n, r) {
4337
+ (X(Zi, e) || Ci(n).some((t) => X(t, e)) || t.includes(".eyJ")) && Qi(e, t, n, r);
4244
4338
  }
4245
- function Wi(e, t, n, r = Q) {
4246
- let i = Gi(t);
4247
- if (i === null || i === t) return Hi(e, t, n, r);
4248
- let a = Hi(e, i, n, r);
4249
- return a === i ? t : qi(a);
4339
+ function ea(e, t, n, r = Q) {
4340
+ let i = ta(t);
4341
+ if (i === null || i === t) return Qi(e, t, n, r);
4342
+ let a = Qi(e, i, n, r);
4343
+ return a === i ? t : ra(a);
4250
4344
  }
4251
- function Gi(e) {
4345
+ function ta(e) {
4252
4346
  try {
4253
4347
  return decodeURIComponent(e);
4254
4348
  } catch {
4255
4349
  return null;
4256
4350
  }
4257
4351
  }
4258
- var Ki = /[%;,\s"\\\p{Cc}\P{ASCII}]/gu, qi = (e) => e.replace(Ki, encodeURIComponent);
4259
- function Ji(e, t, n = Q) {
4352
+ var na = /[%;,\s"\\\p{Cc}\P{ASCII}]/gu, ra = (e) => e.replace(na, encodeURIComponent);
4353
+ function ia(e, t, n = Q) {
4260
4354
  return e === "" ? e : e.split("; ").map((e) => {
4261
- let r = e.indexOf("="), [i, a] = r < 0 ? ["", e] : [e.slice(0, r), e.slice(r + 1)], o = Wi(i, a, t, n);
4355
+ let r = e.indexOf("="), [i, a] = r < 0 ? ["", e] : [e.slice(0, r), e.slice(r + 1)], o = ea(i, a, t, n);
4262
4356
  return r < 0 ? o : `${i}=${o}`;
4263
4357
  }).join("; ");
4264
4358
  }
4265
4359
  //#endregion
4266
4360
  //#region src/capture/storage.ts
4267
- function Yi(e, t, n = Q) {
4361
+ function aa(e, t, n = Q) {
4268
4362
  let r = (e) => {
4269
4363
  let r = [];
4270
4364
  for (let i = 0; i < e.length; i++) {
@@ -4273,7 +4367,7 @@ function Yi(e, t, n = Q) {
4273
4367
  let i = e.getItem(a);
4274
4368
  i !== null && r.push({
4275
4369
  key: a,
4276
- value: Hi(a, i, t, n)
4370
+ value: Qi(a, i, t, n)
4277
4371
  });
4278
4372
  }
4279
4373
  }
@@ -4282,20 +4376,20 @@ function Yi(e, t, n = Q) {
4282
4376
  return {
4283
4377
  localStorage: e.localStorage ? r(e.localStorage) : [],
4284
4378
  sessionStorage: e.sessionStorage ? r(e.sessionStorage) : [],
4285
- cookies: Ji(e.document.cookie ?? "", t, n)
4379
+ cookies: ia(e.document.cookie ?? "", t, n)
4286
4380
  };
4287
4381
  }
4288
- function Xi(e, t, n, r = Q) {
4382
+ function oa(e, t, n, r = Q) {
4289
4383
  let i = (e) => Y(() => t({
4290
4384
  type: 6,
4291
4385
  timestamp: Date.now(),
4292
4386
  data: {
4293
- plugin: Rn,
4387
+ plugin: zn,
4294
4388
  payload: e
4295
4389
  }
4296
4390
  }));
4297
- zn(e, i, Nn, (e, t) => {
4298
- t.length <= n.maxBodySize && Ui(e, t, n.redact, r);
4391
+ Bn(e, i, Pn, (e, t) => {
4392
+ t.length <= n.maxBodySize && $i(e, t, n.redact, r);
4299
4393
  }), e.addEventListener("storage", (t) => Y(() => {
4300
4394
  if (t.storageArea === e.localStorage) if (t.key === null) i({
4301
4395
  by: "other-tab",
@@ -4309,7 +4403,7 @@ function Xi(e, t, n, r = Q) {
4309
4403
  key: t.key
4310
4404
  });
4311
4405
  else {
4312
- let e = t.newValue.length, a = e > n.maxBodySize ? null : Hi(t.key, t.newValue, n.redact, r);
4406
+ let e = t.newValue.length, a = e > n.maxBodySize ? null : Qi(t.key, t.newValue, n.redact, r);
4313
4407
  i({
4314
4408
  by: "other-tab",
4315
4409
  area: "local",
@@ -4322,8 +4416,8 @@ function Xi(e, t, n, r = Q) {
4322
4416
  })), e.cookieStore?.addEventListener("change", (e) => Y(() => {
4323
4417
  let { changed: t, deleted: a } = e;
4324
4418
  for (let e of t) {
4325
- let t = Zi(e);
4326
- t.value = Wi(t.name, t.value, n.redact, r), i({
4419
+ let t = sa(e);
4420
+ t.value = ea(t.name, t.value, n.redact, r), i({
4327
4421
  by: "cookie",
4328
4422
  op: "set",
4329
4423
  cookie: t
@@ -4338,7 +4432,7 @@ function Xi(e, t, n, r = Q) {
4338
4432
  });
4339
4433
  }));
4340
4434
  }
4341
- function Zi(e) {
4435
+ function sa(e) {
4342
4436
  let t = e.sameSite === "strict" || e.sameSite === "none" ? e.sameSite : "lax";
4343
4437
  return {
4344
4438
  name: e.name ?? "",
@@ -4352,22 +4446,22 @@ function Zi(e) {
4352
4446
  }
4353
4447
  //#endregion
4354
4448
  //#region src/capture/xhr.ts
4355
- function Qi(e) {
4449
+ function ca(e) {
4356
4450
  let t = new Headers();
4357
4451
  for (let [n, r] of e) t.append(n, r);
4358
4452
  return [...t];
4359
4453
  }
4360
- function $i(e) {
4454
+ function la(e) {
4361
4455
  return e.trim().split(/[\r\n]+/).filter(Boolean).map((e) => {
4362
4456
  let t = e.indexOf(":");
4363
4457
  return [e.slice(0, t).trim(), e.slice(t + 1).trim()];
4364
4458
  });
4365
4459
  }
4366
- function ea(e) {
4460
+ function ua(e) {
4367
4461
  let t = e.indexOf("#");
4368
4462
  return t === -1 ? e : e.slice(0, t);
4369
4463
  }
4370
- function ta(e, t, n) {
4464
+ function da(e, t, n) {
4371
4465
  let r = e.XMLHttpRequest.prototype, { open: i, setRequestHeader: a, send: o } = r, s = /* @__PURE__ */ new WeakMap(), c = /* @__PURE__ */ new WeakSet(), l = (e) => Y(() => t.emit(e));
4372
4466
  function u(e) {
4373
4467
  return e > n.maxBodySize ? {
@@ -4381,8 +4475,8 @@ function ta(e, t, n) {
4381
4475
  status: e.status,
4382
4476
  statusText: e.statusText,
4383
4477
  url: e.responseURL || t.url,
4384
- redirected: !!e.responseURL && e.responseURL !== ea(t.url),
4385
- headers: Qi($i(e.getAllResponseHeaders())),
4478
+ redirected: !!e.responseURL && e.responseURL !== ua(t.url),
4479
+ headers: ca(la(e.getAllResponseHeaders())),
4386
4480
  t: Date.now(),
4387
4481
  id: t.id
4388
4482
  }));
@@ -4405,7 +4499,7 @@ function ta(e, t, n) {
4405
4499
  t: Date.now(),
4406
4500
  id: i
4407
4501
  });
4408
- if (Ar(e.getResponseHeader("content-type"), n.mediaTypes)) {
4502
+ if (Br(e.getResponseHeader("content-type"), n.mediaTypes)) {
4409
4503
  a({ omitted: "media" });
4410
4504
  return;
4411
4505
  }
@@ -4413,7 +4507,7 @@ function ta(e, t, n) {
4413
4507
  case "":
4414
4508
  case "text": {
4415
4509
  let t = e.responseText;
4416
- a(ir(t, n) ?? { text: t });
4510
+ a(ur(t, n) ?? { text: t });
4417
4511
  return;
4418
4512
  }
4419
4513
  case "json": {
@@ -4422,7 +4516,7 @@ function ta(e, t, n) {
4422
4516
  let e = JSON.stringify(r);
4423
4517
  l({
4424
4518
  type: "http-end",
4425
- body: ir(e, n) ?? { text: e },
4519
+ body: ur(e, n) ?? { text: e },
4426
4520
  t: a,
4427
4521
  id: i,
4428
4522
  n: o
@@ -4432,12 +4526,12 @@ function ta(e, t, n) {
4432
4526
  }
4433
4527
  case "arraybuffer": {
4434
4528
  let t = new Uint8Array(e.response);
4435
- a(u(t.byteLength) ?? Qn(t));
4529
+ a(u(t.byteLength) ?? ir(t));
4436
4530
  return;
4437
4531
  }
4438
4532
  case "blob": {
4439
4533
  let r = Date.now(), a = t.place();
4440
- ar(e.response, n).catch(() => ({ omitted: "unreadable" })).then((e) => l({
4534
+ dr(e.response, n).catch(() => ({ omitted: "unreadable" })).then((e) => l({
4441
4535
  type: "http-end",
4442
4536
  body: e,
4443
4537
  t: r,
@@ -4475,7 +4569,7 @@ function ta(e, t, n) {
4475
4569
  let [r, i] = e, a = new URL(String(i), document.baseURI).href;
4476
4570
  s.set(this, t.ignores(a) ? null : {
4477
4571
  id: t.nextId(),
4478
- method: Mr(r),
4572
+ method: Hr(r),
4479
4573
  url: a,
4480
4574
  headers: [],
4481
4575
  sent: !1,
@@ -4490,9 +4584,9 @@ function ta(e, t, n) {
4490
4584
  let r = s.get(this);
4491
4585
  if (!r || r.sent || this.readyState !== XMLHttpRequest.OPENED) return;
4492
4586
  r.sent = !0;
4493
- let i = Date.now(), { id: a, method: o, url: c } = r, u = [...r.headers], d = u.some(([e]) => e === "content-type") ? null : cr(e);
4587
+ let i = Date.now(), { id: a, method: o, url: c } = r, u = [...r.headers], d = u.some(([e]) => e === "content-type") ? null : mr(e);
4494
4588
  d && u.push(["content-type", d]);
4495
- let f = Qi(u);
4589
+ let f = ca(u);
4496
4590
  m(this);
4497
4591
  let p = (e) => ({
4498
4592
  type: "http-request",
@@ -4503,7 +4597,7 @@ function ta(e, t, n) {
4503
4597
  ...e ? { body: e } : {},
4504
4598
  t: i,
4505
4599
  id: a
4506
- }), h = sr(e, n);
4600
+ }), h = pr(e, n);
4507
4601
  if (h instanceof Promise) {
4508
4602
  let e = t.place();
4509
4603
  h.catch(() => ({ omitted: "unreadable" })).then((t) => l({
@@ -4516,40 +4610,40 @@ function ta(e, t, n) {
4516
4610
  }
4517
4611
  //#endregion
4518
4612
  //#region src/redact/scrub.ts
4519
- var na = 8, ra = 4096, ia = 256, aa = ".cmVkYWN0ZWQ", oa = /^(?:bearer|basic|token|bot|apikey|digest|negotiate) +(\S+)$/i;
4520
- function sa(e) {
4521
- return e.length < na || e.length > ra || /^[A-Za-z]{1,11}$/.test(e) || /^\d{1,11}$/.test(e) || new Set(e).size < 5 ? !1 : e !== "[redacted]" && e !== "[object Object]" && !e.endsWith(aa);
4613
+ var fa = 8, pa = 4096, ma = 256, ha = ".cmVkYWN0ZWQ", ga = /^(?:bearer|basic|token|bot|apikey|digest|negotiate) +(\S+)$/i;
4614
+ function _a(e) {
4615
+ return e.length < fa || e.length > pa || /^[A-Za-z]{1,11}$/.test(e) || /^\d{1,11}$/.test(e) || new Set(e).size < 5 ? !1 : e !== "[redacted]" && e !== "[object Object]" && !e.endsWith(ha);
4522
4616
  }
4523
- function ca(e) {
4617
+ function va(e) {
4524
4618
  return e.replace(/[a-z]/g, "x").replace(/[A-Z]/g, "X").replace(/\d/g, "0");
4525
4619
  }
4526
- var la = 31, ua = 1;
4527
- for (let e = 1; e < na; e++) ua = Math.imul(ua, la);
4528
- var da = 65536;
4529
- function fa(e, t) {
4620
+ var ya = 31, ba = 1;
4621
+ for (let e = 1; e < fa; e++) ba = Math.imul(ba, ya);
4622
+ var xa = 65536;
4623
+ function Sa(e, t) {
4530
4624
  let n = 0;
4531
- for (let r = 0; r < na; r++) n = Math.imul(n, la) + e.charCodeAt(t + r) | 0;
4625
+ for (let r = 0; r < fa; r++) n = Math.imul(n, ya) + e.charCodeAt(t + r) | 0;
4532
4626
  return n;
4533
4627
  }
4534
- function pa(e) {
4628
+ function Ca(e) {
4535
4629
  let t = /* @__PURE__ */ new Uint8Array(8192), n = /* @__PURE__ */ new Map();
4536
4630
  for (let r of e) {
4537
- let e = fa(r, 0), i = e & da - 1;
4631
+ let e = Sa(r, 0), i = e & xa - 1;
4538
4632
  t[i >> 3] |= 1 << (i & 7);
4539
4633
  let a = n.get(e);
4540
4634
  a ? a.push(r) : n.set(e, [r]);
4541
4635
  }
4542
4636
  let r = (r, i) => {
4543
- if (e.length === 0 || r.length < na) return;
4544
- let a = fa(r, 0);
4637
+ if (e.length === 0 || r.length < fa) return;
4638
+ let a = Sa(r, 0);
4545
4639
  for (let e = 0;; e++) {
4546
- let o = a & da - 1;
4640
+ let o = a & xa - 1;
4547
4641
  if (t[o >> 3] & 1 << (o & 7)) {
4548
4642
  for (let t of n.get(a) ?? []) if (r.startsWith(t, e) && i(t)) return;
4549
4643
  }
4550
- if (e + na >= r.length) return;
4551
- let s = Math.imul(r.charCodeAt(e), ua);
4552
- a = Math.imul(a - s, la) + r.charCodeAt(e + na) | 0;
4644
+ if (e + fa >= r.length) return;
4645
+ let s = Math.imul(r.charCodeAt(e), ba);
4646
+ a = Math.imul(a - s, ya) + r.charCodeAt(e + fa) | 0;
4553
4647
  }
4554
4648
  };
4555
4649
  return {
@@ -4563,26 +4657,26 @@ function pa(e) {
4563
4657
  }
4564
4658
  };
4565
4659
  }
4566
- var ma = /* @__PURE__ */ new Set([
4660
+ var wa = /* @__PURE__ */ new Set([
4567
4661
  2,
4568
4662
  3,
4569
4663
  4
4570
- ]), ha = 3, ga = 5, _a = (e) => {
4664
+ ]), Ta = 3, Ea = 5, Da = (e) => {
4571
4665
  try {
4572
4666
  return decodeURIComponent(e);
4573
4667
  } catch {
4574
4668
  return null;
4575
4669
  }
4576
4670
  };
4577
- function va(e) {
4671
+ function Oa(e) {
4578
4672
  let t = e.data;
4579
- return e.type === ha && t.source === ga ? t : null;
4673
+ return e.type === Ta && t.source === Ea ? t : null;
4580
4674
  }
4581
- function ya(e) {
4675
+ function ka(e) {
4582
4676
  let t = /* @__PURE__ */ new Map(), n = null, r = /* @__PURE__ */ new Map(), i = (e, r) => {
4583
- if (!sa(e)) return;
4677
+ if (!_a(e)) return;
4584
4678
  let i = t.get(e);
4585
- t.delete(e), t.size >= ia && t.delete(t.keys().next().value);
4679
+ t.delete(e), t.size >= ma && t.delete(t.keys().next().value);
4586
4680
  let a = i && i.replacement !== "[redacted]" ? i.replacement : r;
4587
4681
  t.set(e, {
4588
4682
  value: e,
@@ -4594,15 +4688,15 @@ function ya(e) {
4594
4688
  if (e === t) return;
4595
4689
  let n = e.trim();
4596
4690
  i(n, t);
4597
- let r = oa.exec(n)?.[1];
4691
+ let r = ga.exec(n)?.[1];
4598
4692
  r && i(r, Z);
4599
- for (let e of /* @__PURE__ */ new Set([_a(n), _a(n.replaceAll("+", " "))])) e !== null && e !== n && i(e, Z);
4693
+ for (let e of /* @__PURE__ */ new Set([Da(n), Da(n.replaceAll("+", " "))])) e !== null && e !== n && i(e, Z);
4600
4694
  } catch {}
4601
- }, { jwt: o } = si(pi(e), a), s = (e, t, n) => {
4695
+ }, { jwt: o } = _i(Ci(e), a), s = (e, t, n) => {
4602
4696
  let r = e.includes(".eyJ") ? $(e, o) : e;
4603
4697
  for (let e of t) {
4604
4698
  if (!r.includes(e.value)) continue;
4605
- let t = n && e.replacement === "[redacted]" ? ca(e.value) : e.replacement;
4699
+ let t = n && e.replacement === "[redacted]" ? va(e.value) : e.replacement;
4606
4700
  r = r.split(e.value).join(t);
4607
4701
  }
4608
4702
  return r;
@@ -4622,21 +4716,21 @@ function ya(e) {
4622
4716
  };
4623
4717
  function l(e, i) {
4624
4718
  let a = [...t.values()];
4625
- a.sort((e, t) => t.value.length - e.value.length), n ??= pa(a.map((e) => e.needle));
4719
+ a.sort((e, t) => t.value.length - e.value.length), n ??= Ca(a.map((e) => e.needle));
4626
4720
  let o = n, s = [], l = (t, n) => {
4627
4721
  e[t] = n, i[t] = JSON.stringify(n);
4628
4722
  };
4629
4723
  for (let t = 0; t < i.length; t++) {
4630
- if (!ma.has(e[t].type)) continue;
4631
- let n = i[t], u = va(e[t]), d = u?.text;
4632
- if (u?.id !== void 0 && d && d.length >= na && !r.has(u.id)) {
4724
+ if (!wa.has(e[t].type)) continue;
4725
+ let n = i[t], u = Oa(e[t]), d = u?.text;
4726
+ if (u?.id !== void 0 && d && d.length >= fa && !r.has(u.id)) {
4633
4727
  let e = a.find((e) => e.value.startsWith(d));
4634
4728
  e && r.set(u.id, e);
4635
4729
  }
4636
4730
  try {
4637
4731
  let e = n.includes(".eyJ"), i = o.all(n);
4638
4732
  if (i.size === 0 && !e) continue;
4639
- let s = a.filter((e) => i.has(e.needle)), u = JSON.parse(n), d = va(u), f = d?.text;
4733
+ let s = a.filter((e) => i.has(e.needle)), u = JSON.parse(n), d = Oa(u), f = d?.text;
4640
4734
  if (c(u.data, s, d !== null), d?.id !== void 0 && typeof f == "string") {
4641
4735
  let e = s.find((e) => f.includes(e.value));
4642
4736
  e && r.set(d.id, e);
@@ -4648,11 +4742,11 @@ function ya(e) {
4648
4742
  }
4649
4743
  if (r.size === 0) return s;
4650
4744
  for (let t = 0; t < e.length; t++) {
4651
- let n = va(e[t]);
4745
+ let n = Oa(e[t]);
4652
4746
  if (n?.id === void 0 || !n.text) continue;
4653
4747
  let a = r.get(n.id);
4654
4748
  if (!a || n.text === a.value || !a.value.startsWith(n.text)) continue;
4655
- let o = a.replacement === "[redacted]" ? ca(a.value) : a.replacement, s = JSON.parse(i[t]);
4749
+ let o = a.replacement === "[redacted]" ? va(a.value) : a.replacement, s = JSON.parse(i[t]);
4656
4750
  s.data.text = o.slice(0, n.text.length), l(t, s);
4657
4751
  }
4658
4752
  return s;
@@ -4664,14 +4758,56 @@ function ya(e) {
4664
4758
  try {
4665
4759
  return l(e, t);
4666
4760
  } catch {
4667
- return e.flatMap((e, t) => ma.has(e.type) ? [t] : []);
4761
+ return e.flatMap((e, t) => wa.has(e.type) ? [t] : []);
4668
4762
  }
4669
4763
  }
4670
4764
  };
4671
4765
  }
4672
4766
  //#endregion
4767
+ //#region src/session/clock.ts
4768
+ function Aa(e, t, n) {
4769
+ return n - e.lastInput >= t.idleTimeout ? "idle" : n - e.start >= t.maxDuration ? "duration" : null;
4770
+ }
4771
+ function ja(e, t) {
4772
+ return Math.min(e.lastInput + t.idleTimeout, e.start + t.maxDuration);
4773
+ }
4774
+ var Ma = 2 ** 31 - 1;
4775
+ function Na(e, t, n) {
4776
+ let r = Date.now(), i = {
4777
+ start: r,
4778
+ lastInput: r
4779
+ }, a = !0, o = !1, s;
4780
+ function c() {
4781
+ clearTimeout(s);
4782
+ let t = Math.min(Math.max(0, ja(i, e) - Date.now()), Ma);
4783
+ s = setTimeout(u, t);
4784
+ }
4785
+ function l() {
4786
+ a = !0, i.start = Date.now(), n(), o || c();
4787
+ }
4788
+ function u() {
4789
+ if (o || !a) return;
4790
+ let n = Aa(i, e, Date.now());
4791
+ if (!n) {
4792
+ c();
4793
+ return;
4794
+ }
4795
+ a = !1, t(n), n === "duration" && !o && l();
4796
+ }
4797
+ return c(), {
4798
+ input() {
4799
+ if (o) return;
4800
+ let n = Date.now(), r = a ? Aa(i, e, n) : null;
4801
+ r && (a = !1, clearTimeout(s), t(r)), i.lastInput = n, !a && !o && l();
4802
+ },
4803
+ stop() {
4804
+ o = !0, a = !1, clearTimeout(s);
4805
+ }
4806
+ };
4807
+ }
4808
+ //#endregion
4673
4809
  //#region src/upload/gzip.ts
4674
- async function ba(e) {
4810
+ async function Pa(e) {
4675
4811
  let t = new TextEncoder().encode(e), n = new ReadableStream({ start(e) {
4676
4812
  e.enqueue(t), e.close();
4677
4813
  } }).pipeThrough(new CompressionStream("gzip")).getReader(), r = [], i = 0;
@@ -4682,44 +4818,44 @@ async function ba(e) {
4682
4818
  }
4683
4819
  //#endregion
4684
4820
  //#region src/upload/uploader.ts
4685
- var xa = 64 * 1024, Sa = 1024;
4686
- function Ca(e) {
4821
+ var Fa = 64 * 1024, Ia = 1024;
4822
+ function La(e) {
4687
4823
  return e >= 400 && e < 500 && e !== 408 && e !== 429;
4688
4824
  }
4689
- var wa = 1e4, Ta = 5 * 6e4, Ea = 10 * 6e4;
4690
- function Da(e) {
4825
+ var Ra = 1e4, za = 5 * 6e4, Ba = 10 * 6e4;
4826
+ function Va(e) {
4691
4827
  let t = e.headers.get("Retry-After")?.trim();
4692
4828
  return t && /^\d+$/.test(t) ? Number(t) * 1e3 : null;
4693
4829
  }
4694
- function Oa(e, t, n, r) {
4695
- let i = `${e.collectorUrl}/api/projects/${e.projectKey}/sessions/${t}/chunks`, a = 0, o = null, s = 0, c = 0, l = !1;
4696
- function u(e) {
4697
- c++;
4698
- let t = e ?? Math.min(wa * 2 ** (c - 1), Ta);
4699
- s = Date.now() + t;
4830
+ function Ha(e, t, n, r, i = () => {}) {
4831
+ let a = `${e.collectorUrl}/api/projects/${e.projectKey}/sessions/${t}/chunks`, o = 0, s = null, c = 0, l = 0, u = !1;
4832
+ function d(e) {
4833
+ l++;
4834
+ let t = e ?? Math.min(Ra * 2 ** (l - 1), za);
4835
+ c = Date.now() + t;
4700
4836
  }
4701
- async function d(t, o) {
4702
- let d = n.take(t === "interval" ? { hold: e.uploadInterval } : {});
4703
- if (!d) return;
4837
+ async function f(t, i) {
4838
+ let s = n.take(t === "interval" ? { hold: e.uploadInterval } : {});
4839
+ if (!s) return;
4704
4840
  let f = !1;
4705
4841
  try {
4706
- if (l) return;
4707
- let { json: p } = d, m = await ba(p), h = {
4842
+ if (u) return;
4843
+ let { json: p } = s, m = await Pa(p), h = {
4708
4844
  version: 1,
4709
- sequenceNumber: a,
4845
+ sequenceNumber: o,
4710
4846
  sentAt: Date.now(),
4711
- start: d.start,
4712
- end: d.end,
4713
- eventCount: d.events.length,
4714
- hasFullSnapshot: d.hasFullSnapshot,
4847
+ start: s.start,
4848
+ end: s.end,
4849
+ eventCount: s.events.length,
4850
+ hasFullSnapshot: s.hasFullSnapshot,
4715
4851
  reason: t,
4716
- urls: d.urls,
4852
+ urls: s.urls,
4717
4853
  recorderVersion: e.recorderVersion,
4718
4854
  rawBytes: p.length
4719
4855
  }, g = JSON.stringify(h), _ = () => {
4720
4856
  let e = new FormData();
4721
4857
  return e.append("metadata", new Blob([g], { type: "application/json" })), e.append("events", new Blob([m], { type: "application/gzip" })), e;
4722
- }, v = o && m.byteLength + g.length + Sa <= xa, y = (e) => r(i, {
4858
+ }, v = i && m.byteLength + g.length + Ia <= Fa, y = (e) => r(a, {
4723
4859
  method: "POST",
4724
4860
  body: _(),
4725
4861
  keepalive: e
@@ -4727,49 +4863,55 @@ function Oa(e, t, n, r) {
4727
4863
  if (v && e instanceof TypeError) return y(!1);
4728
4864
  throw e;
4729
4865
  });
4730
- if (!b.ok && !Ca(b.status)) {
4731
- let e = Da(b);
4732
- if (e !== null && e > Ea) {
4733
- l = !0, n.close();
4866
+ if (!b.ok && !La(b.status)) {
4867
+ let e = Va(b);
4868
+ if (e !== null && e > Ba) {
4869
+ u = !0, n.close();
4734
4870
  return;
4735
4871
  }
4736
- u(e), f = !0;
4872
+ d(e), f = !0;
4737
4873
  return;
4738
4874
  }
4739
- a++, c = 0, s = 0;
4875
+ o++, l = 0, c = 0;
4740
4876
  } catch {
4741
- u(null), f = !0;
4877
+ d(null), f = !0;
4742
4878
  } finally {
4743
- f ? n.restore(d) : n.release(d);
4879
+ f ? n.restore(s) : n.release(s);
4744
4880
  }
4745
4881
  }
4746
- async function f(t, r) {
4747
- if (!(!r && Date.now() < s)) {
4748
- for (; o;) {
4749
- if (!r) return;
4750
- await o;
4882
+ async function p(t, r, i = r) {
4883
+ if (!(!r && Date.now() < c)) {
4884
+ for (; s;) {
4885
+ if (!i) return;
4886
+ await s;
4751
4887
  }
4752
- o = d(t, r);
4888
+ s = f(t, r);
4753
4889
  try {
4754
- await o;
4890
+ await s;
4755
4891
  } finally {
4756
- o = null;
4892
+ s = null;
4757
4893
  }
4758
- n.bytes() >= e.earlyUploadBytes && f("size", !1);
4894
+ n.bytes() >= e.earlyUploadBytes && p("size", !1);
4759
4895
  }
4760
4896
  }
4761
- return setInterval(() => {
4762
- f("interval", !1);
4763
- }, e.uploadInterval), {
4764
- flush: ({ final: e = !1 } = {}) => f(e ? "hidden" : "interval", e),
4897
+ let m = setInterval(() => {
4898
+ if (n.closed() && n.bytes() === 0 && !s) {
4899
+ clearInterval(m), i();
4900
+ return;
4901
+ }
4902
+ p("interval", !1);
4903
+ }, e.uploadInterval);
4904
+ return {
4905
+ flush: ({ final: e = !1 } = {}) => p(e ? "hidden" : "interval", e),
4906
+ drain: () => p("interval", !1, !0),
4765
4907
  notify() {
4766
- !o && n.bytes() >= e.earlyUploadBytes && f("size", !1);
4908
+ !s && n.bytes() >= e.earlyUploadBytes && p("size", !1);
4767
4909
  }
4768
4910
  };
4769
4911
  }
4770
4912
  //#endregion
4771
4913
  //#region src/util/uuid.ts
4772
- function ka() {
4914
+ function Ua() {
4773
4915
  let e = crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(16)), t = Date.now();
4774
4916
  for (let n = 0; n < 6; n++) e[n] = Math.floor(t / 2 ** (8 * (5 - n))) % 256;
4775
4917
  e[6] = e[6] & 15 | 112, e[8] = e[8] & 63 | 128;
@@ -4778,64 +4920,89 @@ function ka() {
4778
4920
  }
4779
4921
  //#endregion
4780
4922
  //#region src/init.ts
4781
- var Aa = 4, ja = 3, Ma = 5;
4782
- function Na(e) {
4923
+ var Wa = 4, Ga = 3, Ka = 5;
4924
+ function qa(e) {
4783
4925
  if (!e?.projectKey) throw Error("mime8.init: projectKey is required");
4784
4926
  if (window.mime8Replay === !0 || window.__mime8) return;
4785
- let t = Yn(e), n = window.fetch.bind(window);
4786
- window.__mime8 = {
4787
- sessionId: ka(),
4788
- events: []
4789
- };
4790
- let r = ya(t.redact), i = (e) => Ni(e, t.redact, r.note), a = !1, o, s = Jn(window.__mime8, i, t.maxBufferBytes, () => {
4791
- a = !0, queueMicrotask(() => Y(() => o?.()));
4792
- }, (e, t) => r.scrubChunk(e, t)), c = Date.now();
4793
- s.push(Vn(Yi(window, t.redact, r.note), c)), Y(() => s.push(Hn(pr(), c)));
4794
- let l = Oa(t, window.__mime8.sessionId, s, n), u = Gr(t.maxBatchChanges, (e) => {
4795
- s.end(Un({
4927
+ let t = Qn(e), n = window.fetch.bind(window), r = ka(t.redact), i = (e) => Ui(e, t.redact, r.note), a = null, o = /* @__PURE__ */ new Set(), s = !1, c, l;
4928
+ function u() {
4929
+ s = !0, a = null, l?.stop(), queueMicrotask(() => Y(() => c?.()));
4930
+ }
4931
+ function d(e) {
4932
+ let t = a;
4933
+ t && (t.buffer.push(e), t.transport.notify());
4934
+ }
4935
+ function f() {
4936
+ let e = {
4937
+ sessionId: Ua(),
4938
+ events: []
4939
+ };
4940
+ window.__mime8 = e;
4941
+ let s = { timed: !1 };
4942
+ s.buffer = Yn(e, i, t.maxBufferBytes, () => {
4943
+ s.timed || u();
4944
+ }, (e, t) => r.scrubChunk(e, t)), s.transport = Ha(t, e.sessionId, s.buffer, n, () => o.delete(s.transport)), o.add(s.transport), s.noteRrwebError = Ji(d), a = s;
4945
+ let c = Date.now();
4946
+ d(Hn(aa(window, t.redact, r.note), c)), Y(() => d(Un(Cr(), c)));
4947
+ }
4948
+ function p(e) {
4949
+ let n = a;
4950
+ if (!n) return;
4951
+ a = null, n.timed = !0;
4952
+ let r = e === "idle" ? t.idleTimeout : t.maxDuration;
4953
+ n.buffer.end(Wn({
4954
+ reason: e,
4955
+ limit: r
4956
+ }, Date.now())), n.transport.drain();
4957
+ }
4958
+ f();
4959
+ let m = ti(t.maxBatchChanges, (e) => {
4960
+ let n = a;
4961
+ n && (n.buffer.end(Wn({
4796
4962
  reason: "mutations",
4797
4963
  limit: t.maxBatchChanges,
4798
4964
  records: e
4799
- }, Date.now())), l.notify();
4800
- }, () => a), d = Pi(t, (e) => {
4801
- s.push(Bn(e)), l.notify();
4802
- }, () => a, r.note);
4803
- Vr(window, d, t), ta(window, d, t), dr(window, d, t), kr(window, d), Bi(window, d, t), Ur(window, d);
4804
- let f = Dr(window);
4805
- yr(document, (e) => {
4806
- s.push(e), l.notify();
4807
- }, (e) => {
4808
- let t = An.mirror.getId(e);
4965
+ }, Date.now())), n.transport.notify());
4966
+ }, () => s || a === null), h = Wi(t, (e) => d(Vn(e)), () => s, r.note);
4967
+ Zr(window, h, t), da(window, h, t), gr(window, h, t), zr(window, h), Xi(window, h, t), $r(window, h);
4968
+ let g = Lr(window), _ = (e) => {
4969
+ let t = q.mirror.getId(e);
4809
4970
  return t > 0 ? t : null;
4810
- }), Xi(window, (e) => {
4811
- s.push(e), l.notify();
4812
- }, t, r.note), document.addEventListener("visibilitychange", () => {
4813
- document.visibilityState === "hidden" && l.flush({ final: !0 });
4971
+ };
4972
+ kr(document, d, _), xr(window, d, _), oa(window, d, t, r.note);
4973
+ let v = !1;
4974
+ function y() {
4975
+ if (!s && (f(), v)) try {
4976
+ q.mirror.reset(), q.takeFullSnapshot();
4977
+ } catch (e) {
4978
+ a?.noteRrwebError(e, "start");
4979
+ }
4980
+ }
4981
+ l = Na(t, (e) => Y(() => p(e)), () => Y(y)), tr(window, () => l?.input()), document.addEventListener("visibilitychange", () => {
4982
+ if (document.visibilityState === "hidden") for (let e of o) e.flush({ final: !0 });
4814
4983
  });
4815
- let p = Ri((e) => {
4816
- s.push(e), l.notify();
4817
- }), m = !1, h = () => {
4984
+ let b = () => {
4818
4985
  try {
4819
- if (a) return;
4820
- o = An({
4821
- errorHandler: (e) => (p(e, m ? "recording" : "start"), !0),
4822
- onMutation: u,
4986
+ if (s) return;
4987
+ c = q({
4988
+ errorHandler: (e) => (a?.noteRrwebError(e, v ? "recording" : "start"), !0),
4989
+ onMutation: m,
4823
4990
  userTriggeredOnInput: !0,
4824
4991
  emit: (e) => Y(() => {
4825
- (e.type !== ja || e.data.source !== Ma || e.data.id !== -1) && (e.type === Aa && (e = {
4992
+ a && (e.type !== Ga || e.data.source !== Ka || e.data.id !== -1) && (e.type === Wa && (e = {
4826
4993
  ...e,
4827
4994
  data: {
4828
4995
  ...e.data,
4829
4996
  href: i(e.data.href)
4830
4997
  }
4831
- }), e = f.mark(e), s.push(e), l.notify());
4998
+ }), e = g.mark(e), d(e));
4832
4999
  })
4833
- }), m = !0;
5000
+ }), v = !0;
4834
5001
  } catch (e) {
4835
- p(e, "start");
5002
+ a?.noteRrwebError(e, "start");
4836
5003
  }
4837
5004
  };
4838
- document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", h) : h();
5005
+ document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", b) : b();
4839
5006
  }
4840
5007
  //#endregion
4841
- export { Na as init };
5008
+ export { qa as init };