leesto-connect 0.7.0 → 0.8.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.
@@ -1,62 +1,66 @@
1
- var Mt = "login", xt = "rrweb-buffer", Dt = "ambient", Pt = "login-anchor", Ft = 6e3, $t = 3e3;
2
- function Bt(e) {
1
+ var Mt = "login", xt = "rrweb-buffer", Ft = "ambient", Dt = "login-anchor", Pt = ["ArrowDown", "Escape"];
2
+ function $t(e) {
3
+ return Pt.includes(e);
4
+ }
5
+ var Bt = 6e3, qt = 3e3;
6
+ function Ut(e) {
3
7
  return typeof e == "object" && e !== null && typeof e.type == "string" && e.type.startsWith("leesto:");
4
8
  }
5
- var qt = [
9
+ var Ht = [
6
10
  "mask_all",
7
11
  "labels_visible",
8
12
  "inputs_only"
9
- ], ve = "mask_all";
10
- function Ht(e) {
11
- return typeof e == "string" && qt.includes(e);
13
+ ], Le = "mask_all";
14
+ function Gt(e) {
15
+ return typeof e == "string" && Ht.includes(e);
12
16
  }
13
- var Ut = "leesto_diag", Gt = "leesto_run", Ye = "X-Leesto-Run-Id", Wt = "leesto_mask", Vt = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
14
- function de(e) {
15
- return typeof e == "string" && Vt.test(e);
17
+ var Wt = "leesto_diag", Vt = "leesto_run", Ye = "X-Leesto-Run-Id", zt = "leesto_mask", Kt = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
18
+ function be(e) {
19
+ return typeof e == "string" && Kt.test(e);
16
20
  }
17
- function zt() {
21
+ function jt() {
18
22
  try {
19
23
  const e = globalThis.crypto, t = e?.randomUUID?.();
20
- if (de(t)) return t;
24
+ if (be(t)) return t;
21
25
  if (!e?.getRandomValues) return;
22
26
  const n = e.getRandomValues(/* @__PURE__ */ new Uint8Array(16));
23
27
  n[6] = (n[6] ?? 0) & 15 | 64, n[8] = (n[8] ?? 0) & 63 | 128;
24
28
  const r = Array.from(n, (i) => i.toString(16).padStart(2, "0")).join(""), o = `${r.slice(0, 8)}-${r.slice(8, 12)}-${r.slice(12, 16)}-${r.slice(16, 20)}-${r.slice(20)}`;
25
- return de(o) ? o : void 0;
29
+ return be(o) ? o : void 0;
26
30
  } catch {
27
31
  return;
28
32
  }
29
33
  }
30
- function jt(e) {
34
+ function Xt(e) {
31
35
  try {
32
- const t = new URLSearchParams(e).getAll(Wt), [n] = t;
33
- return t.some((r) => r !== n) ? ve : Ht(n) ? n : ve;
36
+ const t = new URLSearchParams(e).getAll(zt), [n] = t;
37
+ return t.some((r) => r !== n) ? Le : Gt(n) ? n : Le;
34
38
  } catch {
35
- return ve;
39
+ return Le;
36
40
  }
37
41
  }
38
- function Xt(e) {
42
+ function Yt(e) {
39
43
  try {
40
- const t = new URLSearchParams(e).get(Gt);
41
- return de(t) ? t : void 0;
44
+ const t = new URLSearchParams(e).get(Vt);
45
+ return be(t) ? t : void 0;
42
46
  } catch {
43
47
  return;
44
48
  }
45
49
  }
46
- function Le(e) {
50
+ function ke(e) {
47
51
  try {
48
- return new URLSearchParams(e).get(Ut) === "1";
52
+ return new URLSearchParams(e).get(Wt) === "1";
49
53
  } catch {
50
54
  return !1;
51
55
  }
52
56
  }
53
- function Kt(e, t) {
54
- if (Le(e)) return e;
57
+ function Zt(e, t) {
58
+ if (ke(e)) return e;
55
59
  if (typeof t != "string" || !t.startsWith("leesto-arming?")) return "";
56
60
  const n = `?${t.slice(14)}`;
57
- return Le(n) ? n : "";
61
+ return ke(n) ? n : "";
58
62
  }
59
- function mt(e) {
63
+ function ht(e) {
60
64
  try {
61
65
  const t = new URL(e);
62
66
  return `${t.origin}${t.pathname}`;
@@ -64,28 +68,28 @@ function mt(e) {
64
68
  return e.split(/[?#]/)[0] ?? e;
65
69
  }
66
70
  }
67
- var Ze = "leesto/console", Yt = "leesto/network", Zt = "leesto/network-ring", Qt = "leesto/console-ring", Jt = {
71
+ var Ze = "leesto/console", Qt = "leesto/network", Jt = "leesto/network-ring", en = "leesto/console-ring", tn = {
68
72
  primary: "#08783f",
69
73
  hover: "#066633",
70
74
  foreground: "#f3fff7"
71
- }, en = {
75
+ }, nn = {
72
76
  primary: "#46c383",
73
77
  hover: "#65d49b",
74
78
  foreground: "#082315"
75
- }, tn = {
76
- light: Jt,
77
- dark: en
78
- }, B = (e) => Math.min(1, Math.max(0, e));
79
- function Re(e, [t, n, r]) {
79
+ }, rn = {
80
+ light: tn,
81
+ dark: nn
82
+ }, W = (e) => Math.min(1, Math.max(0, e));
83
+ function Me(e, [t, n, r]) {
80
84
  return e.map((o) => o[0] * t + o[1] * n + o[2] * r);
81
85
  }
82
- var Y = (e) => {
86
+ var ee = (e) => {
83
87
  const t = Math.abs(e);
84
88
  return t <= 0.04045 ? e / 12.92 : Math.sign(e) * ((t + 0.055) / 1.055) ** 2.4;
85
- }, we = (e) => {
89
+ }, Ae = (e) => {
86
90
  const t = Math.abs(e);
87
91
  return t <= 31308e-7 ? e * 12.92 : Math.sign(e) * (1.055 * t ** (1 / 2.4) - 0.055);
88
- }, nn = [
92
+ }, on = [
89
93
  [
90
94
  1.2249401762805598,
91
95
  -0.22494017628055996,
@@ -101,7 +105,7 @@ var Y = (e) => {
101
105
  -0.07863604555063188,
102
106
  1.0982736001409663
103
107
  ]
104
- ], rn = [
108
+ ], sn = [
105
109
  [
106
110
  0.955473421488075,
107
111
  -0.02309845494876471,
@@ -117,7 +121,7 @@ var Y = (e) => {
117
121
  -0.020507649298898964,
118
122
  1.330365926242124
119
123
  ]
120
- ], on = [
124
+ ], an = [
121
125
  [
122
126
  3.2409699419045226,
123
127
  -1.537383177570094,
@@ -133,17 +137,17 @@ var Y = (e) => {
133
137
  -0.20397695888897652,
134
138
  1.0569715142428786
135
139
  ]
136
- ], Ee = [
140
+ ], Ie = [
137
141
  0.3457 / 0.3585,
138
142
  1,
139
143
  0.2958 / 0.3585
140
144
  ];
141
- function ie([e, t, n], r) {
145
+ function fe([e, t, n], r) {
142
146
  return {
143
- r: B(we(e)),
144
- g: B(we(t)),
145
- b: B(we(n)),
146
- a: B(r)
147
+ r: W(Ae(e)),
148
+ g: W(Ae(t)),
149
+ b: W(Ae(n)),
150
+ a: W(r)
147
151
  };
148
152
  }
149
153
  function Qe(e, t, n) {
@@ -155,21 +159,21 @@ function Qe(e, t, n) {
155
159
  ];
156
160
  }
157
161
  function Je(e, t, n) {
158
- const r = 903.2962962962963, o = 216 / 24389, i = (e + 16) / 116, l = i + t / 500, c = i - n / 200, s = l ** 3 > o ? l ** 3 : (116 * l - 16) / r, a = e > r * o ? i ** 3 : e / r, u = c ** 3 > o ? c ** 3 : (116 * c - 16) / r, d = [
159
- s * Ee[0],
160
- a * Ee[1],
161
- u * Ee[2]
162
+ const r = 903.2962962962963, o = 216 / 24389, i = (e + 16) / 116, l = i + t / 500, c = i - n / 200, s = l ** 3 > o ? l ** 3 : (116 * l - 16) / r, a = e > r * o ? i ** 3 : e / r, u = c ** 3 > o ? c ** 3 : (116 * c - 16) / r, f = [
163
+ s * Ie[0],
164
+ a * Ie[1],
165
+ u * Ie[2]
162
166
  ];
163
- return Re(on, Re(rn, d));
167
+ return Me(an, Me(sn, f));
164
168
  }
165
- function $(e, t) {
169
+ function G(e, t) {
166
170
  if (e === void 0) return null;
167
171
  if (e === "none") return 0;
168
172
  const n = Number.parseFloat(e);
169
173
  return Number.isFinite(n) ? e.endsWith("%") ? n / 100 * t : n : null;
170
174
  }
171
- var sn = /^(rgba?|oklch|oklab|lab|lch|color)\((.*)\)$/, an = /^#([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/;
172
- function ln(e) {
175
+ var ln = /^(rgba?|oklch|oklab|lab|lch|color)\((.*)\)$/, cn = /^#([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/;
176
+ function un(e) {
173
177
  const t = e.length <= 4 ? [...e].map((r) => r + r).join("") : e, n = (r) => Number.parseInt(t.slice(r * 2, r * 2 + 2), 16) / 255;
174
178
  return {
175
179
  r: n(0),
@@ -178,7 +182,7 @@ function ln(e) {
178
182
  a: t.length === 8 ? n(3) : 1
179
183
  };
180
184
  }
181
- function Pe(e) {
185
+ function He(e) {
182
186
  const t = e.trim().toLowerCase();
183
187
  if (t === "transparent") return {
184
188
  r: 0,
@@ -186,61 +190,61 @@ function Pe(e) {
186
190
  b: 0,
187
191
  a: 0
188
192
  };
189
- const n = an.exec(t);
190
- if (n) return ln(n[1] ?? "");
191
- const r = sn.exec(t);
193
+ const n = cn.exec(t);
194
+ if (n) return un(n[1] ?? "");
195
+ const r = ln.exec(t);
192
196
  if (!r) return null;
193
- const o = r[1], [i = "", l] = (r[2] ?? "").split("/"), c = i.split(/[\s,]+/).filter(Boolean), s = l?.trim() ?? (o === "color" ? void 0 : c[3]), a = s === void 0 ? 1 : $(s, 1);
197
+ const o = r[1], [i = "", l] = (r[2] ?? "").split("/"), c = i.split(/[\s,]+/).filter(Boolean), s = l?.trim() ?? (o === "color" ? void 0 : c[3]), a = s === void 0 ? 1 : G(s, 1);
194
198
  if (a === null) return null;
195
199
  if (o === "color") {
196
- const S = c[0], [v, _, L] = [
197
- $(c[1], 1),
198
- $(c[2], 1),
199
- $(c[3], 1)
200
+ const v = c[0], [E, _, A] = [
201
+ G(c[1], 1),
202
+ G(c[2], 1),
203
+ G(c[3], 1)
200
204
  ];
201
- return v === null || _ === null || L === null ? null : S === "srgb" ? {
202
- r: B(v),
203
- g: B(_),
204
- b: B(L),
205
- a: B(a)
206
- } : S === "srgb-linear" ? ie([
207
- v,
205
+ return E === null || _ === null || A === null ? null : v === "srgb" ? {
206
+ r: W(E),
207
+ g: W(_),
208
+ b: W(A),
209
+ a: W(a)
210
+ } : v === "srgb-linear" ? fe([
211
+ E,
208
212
  _,
209
- L
210
- ], a) : S === "display-p3" ? ie(Re(nn, [
211
- Y(v),
212
- Y(_),
213
- Y(L)
213
+ A
214
+ ], a) : v === "display-p3" ? fe(Me(on, [
215
+ ee(E),
216
+ ee(_),
217
+ ee(A)
214
218
  ]), a) : null;
215
219
  }
216
220
  if (o === "rgb" || o === "rgba") {
217
- const [S, v, _] = [
218
- $(c[0], 255),
219
- $(c[1], 255),
220
- $(c[2], 255)
221
+ const [v, E, _] = [
222
+ G(c[0], 255),
223
+ G(c[1], 255),
224
+ G(c[2], 255)
221
225
  ];
222
- return S === null || v === null || _ === null ? null : {
223
- r: B(S / 255),
224
- g: B(v / 255),
225
- b: B(_ / 255),
226
- a: B(a)
226
+ return v === null || E === null || _ === null ? null : {
227
+ r: W(v / 255),
228
+ g: W(E / 255),
229
+ b: W(_ / 255),
230
+ a: W(a)
227
231
  };
228
232
  }
229
- const u = o === "lab" || o === "lch", d = $(c[0], u ? 100 : 1);
230
- if (d === null) return null;
233
+ const u = o === "lab" || o === "lch", f = G(c[0], u ? 100 : 1);
234
+ if (f === null) return null;
231
235
  if (o === "oklab" || o === "lab") {
232
- const [S, v] = [$(c[1], u ? 125 : 0.4), $(c[2], u ? 125 : 0.4)];
233
- return S === null || v === null ? null : ie(u ? Je(d, S, v) : Qe(d, S, v), a);
236
+ const [v, E] = [G(c[1], u ? 125 : 0.4), G(c[2], u ? 125 : 0.4)];
237
+ return v === null || E === null ? null : fe(u ? Je(f, v, E) : Qe(f, v, E), a);
234
238
  }
235
- const [p, h] = [$(c[1], u ? 150 : 0.4), $(c[2], 1)];
236
- if (p === null || h === null) return null;
237
- const b = h * Math.PI / 180, [E, A] = [p * Math.cos(b), p * Math.sin(b)];
238
- return ie(u ? Je(d, E, A) : Qe(d, E, A), a);
239
+ const [d, p] = [G(c[1], u ? 150 : 0.4), G(c[2], 1)];
240
+ if (d === null || p === null) return null;
241
+ const y = p * Math.PI / 180, [S, R] = [d * Math.cos(y), d * Math.sin(y)];
242
+ return fe(u ? Je(f, S, R) : Qe(f, S, R), a);
239
243
  }
240
- var cn = /(?:rgba?|oklch|oklab|lab|lch|color)\([^()]*\)|\btransparent\b/g;
241
- function un(e) {
244
+ var fn = /(?:rgba?|oklch|oklab|lab|lch|color)\([^()]*\)|\btransparent\b/g;
245
+ function dn(e) {
242
246
  if (!e.includes("gradient(")) return null;
243
- const t = (e.toLowerCase().match(cn) ?? []).map(Pe).filter((o) => o !== null);
247
+ const t = (e.toLowerCase().match(fn) ?? []).map(He).filter((o) => o !== null);
244
248
  if (t.length === 0) return null;
245
249
  const n = t.reduce((o, i) => o + i.a, 0);
246
250
  if (n === 0) return {
@@ -257,37 +261,37 @@ function un(e) {
257
261
  a: n / t.length
258
262
  };
259
263
  }
260
- function Ie({ r: e, g: t, b: n }) {
264
+ function xe({ r: e, g: t, b: n }) {
261
265
  const [r, o, i] = [
262
- Y(e),
263
- Y(t),
264
- Y(n)
265
- ], l = Math.cbrt(0.4122214708 * r + 0.5363325363 * o + 0.0514459929 * i), c = Math.cbrt(0.2119034982 * r + 0.6806995451 * o + 0.1073969566 * i), s = Math.cbrt(0.0883024619 * r + 0.2817188376 * o + 0.6299787005 * i), a = 0.2104542553 * l + 0.793617785 * c - 0.0040720468 * s, u = 1.9779984951 * l - 2.428592205 * c + 0.4505937099 * s, d = 0.0259040371 * l + 0.7827717662 * c - 0.808675766 * s, p = Math.atan2(d, u) * 180 / Math.PI;
266
+ ee(e),
267
+ ee(t),
268
+ ee(n)
269
+ ], l = Math.cbrt(0.4122214708 * r + 0.5363325363 * o + 0.0514459929 * i), c = Math.cbrt(0.2119034982 * r + 0.6806995451 * o + 0.1073969566 * i), s = Math.cbrt(0.0883024619 * r + 0.2817188376 * o + 0.6299787005 * i), a = 0.2104542553 * l + 0.793617785 * c - 0.0040720468 * s, u = 1.9779984951 * l - 2.428592205 * c + 0.4505937099 * s, f = 0.0259040371 * l + 0.7827717662 * c - 0.808675766 * s, d = Math.atan2(f, u) * 180 / Math.PI;
266
270
  return {
267
271
  L: a,
268
- C: Math.hypot(u, d),
269
- H: p < 0 ? p + 360 : p
272
+ C: Math.hypot(u, f),
273
+ H: d < 0 ? d + 360 : d
270
274
  };
271
275
  }
272
- var fn = {
276
+ var pn = {
273
277
  r: 1,
274
278
  g: 1,
275
279
  b: 1
276
- }, dn = {
280
+ }, mn = {
277
281
  r: 18 / 255,
278
282
  g: 18 / 255,
279
283
  b: 18 / 255
280
284
  };
281
- function pn(e, t) {
282
- return e.includes("dark") && (!e.includes("light") || t) ? dn : fn;
285
+ function hn(e, t) {
286
+ return e.includes("dark") && (!e.includes("light") || t) ? mn : pn;
283
287
  }
284
- function hn(e) {
285
- const t = [], n = un(e.backgroundImage);
288
+ function gn(e) {
289
+ const t = [], n = dn(e.backgroundImage);
286
290
  n && n.a > 0 && t.push(n);
287
- const r = Pe(e.backgroundColor);
291
+ const r = He(e.backgroundColor);
288
292
  return r && r.a > 0 && t.push(r), t;
289
293
  }
290
- function mn(e, t) {
294
+ function yn(e, t) {
291
295
  const n = {
292
296
  r: 0,
293
297
  g: 0,
@@ -305,28 +309,28 @@ function mn(e, t) {
305
309
  b: n.b + t.b * r
306
310
  };
307
311
  }
308
- function gn(e) {
312
+ function bn(e) {
309
313
  const t = e.defaultView;
310
314
  if (!t || typeof e.elementsFromPoint != "function") return [];
311
315
  const { innerWidth: n, innerHeight: r } = t;
312
316
  if (!n || !r) return [];
313
- const o = pn(t.getComputedStyle(e.documentElement).colorScheme ?? "", typeof t.matchMedia == "function" && t.matchMedia("(prefers-color-scheme: dark)").matches), i = /* @__PURE__ */ new Map(), l = (s) => {
317
+ const o = hn(t.getComputedStyle(e.documentElement).colorScheme ?? "", typeof t.matchMedia == "function" && t.matchMedia("(prefers-color-scheme: dark)").matches), i = /* @__PURE__ */ new Map(), l = (s) => {
314
318
  let a = i.get(s);
315
- return a || (a = s.matches("[data-leesto-picker-outline], [data-leesto-capture-cover]") ? [] : hn(t.getComputedStyle(s)), i.set(s, a)), a;
319
+ return a || (a = s.matches("[data-leesto-picker-outline], [data-leesto-capture-cover]") ? [] : gn(t.getComputedStyle(s)), i.set(s, a)), a;
316
320
  }, c = [];
317
321
  for (let s = 0; s < 10; s++) for (let a = 0; a < 16; a++) {
318
- const u = (a + 0.5) * n / 16, d = (s + 0.5) * r / 10, p = [];
319
- let h = 0;
320
- for (const b of e.elementsFromPoint(u, d)) {
321
- for (const E of l(b))
322
- p.push(E), h += (1 - h) * E.a;
323
- if (h >= 0.95) break;
322
+ const u = (a + 0.5) * n / 16, f = (s + 0.5) * r / 10, d = [];
323
+ let p = 0;
324
+ for (const y of e.elementsFromPoint(u, f)) {
325
+ for (const S of l(y))
326
+ d.push(S), p += (1 - p) * S.a;
327
+ if (p >= 0.95) break;
324
328
  }
325
- c.push(mn(p, o));
329
+ c.push(yn(d, o));
326
330
  }
327
331
  return c;
328
332
  }
329
- function bn(e) {
333
+ function vn(e) {
330
334
  const t = e.defaultView, n = [];
331
335
  for (const r of e.querySelectorAll('meta[name="theme-color"]')) {
332
336
  const o = r.getAttribute("media");
@@ -334,33 +338,33 @@ function bn(e) {
334
338
  }
335
339
  t && n.push(t.getComputedStyle(e.documentElement).getPropertyValue("accent-color"));
336
340
  for (const r of n) {
337
- const o = Pe(r);
341
+ const o = He(r);
338
342
  if (!o || o.a < 0.95) continue;
339
343
  const i = {
340
344
  r: o.r,
341
345
  g: o.g,
342
346
  b: o.b
343
347
  };
344
- if (Ie(i).C >= 0.035) return i;
348
+ if (xe(i).C >= 0.035) return i;
345
349
  }
346
350
  return null;
347
351
  }
348
352
  var et = (e) => Math.floor(e / 30) % 12;
349
- function yn(e, t = null) {
353
+ function wn(e, t = null) {
350
354
  if (e.length === 0) return null;
351
- const n = e.map(Ie), r = n.reduce((p, h) => p + h.L, 0) / n.length, o = Math.round(Math.min(1, Math.max(0, r)) * 100) / 100, i = Array.from({ length: 12 }, () => 0), l = Array.from({ length: 12 }, () => 0);
352
- for (const p of n) {
353
- if (p.C < 0.035) continue;
354
- const h = et(p.H);
355
- i[h] = (i[h] ?? 0) + p.C ** 2, l[h] = (l[h] ?? 0) + 1;
355
+ const n = e.map(xe), r = n.reduce((d, p) => d + p.L, 0) / n.length, o = Math.round(Math.min(1, Math.max(0, r)) * 100) / 100, i = Array.from({ length: 12 }, () => 0), l = Array.from({ length: 12 }, () => 0);
356
+ for (const d of n) {
357
+ if (d.C < 0.035) continue;
358
+ const p = et(d.H);
359
+ i[p] = (i[p] ?? 0) + d.C ** 2, l[p] = (l[p] ?? 0) + 1;
356
360
  }
357
- const c = (p, h) => (p[(h + 11) % 12] ?? 0) + (p[h] ?? 0) + (p[(h + 1) % 12] ?? 0);
361
+ const c = (d, p) => (d[(p + 11) % 12] ?? 0) + (d[p] ?? 0) + (d[(p + 1) % 12] ?? 0);
358
362
  let s = null;
359
- for (let p = 0; p < 12; p++)
360
- c(l, p) < 4 || (s === null || c(i, p) > c(i, s)) && (s = p);
363
+ for (let d = 0; d < 12; d++)
364
+ c(l, d) < 4 || (s === null || c(i, d) > c(i, s)) && (s = d);
361
365
  if (s === null || c(i, s) < 3e-3) return {
362
366
  lightness: o,
363
- hue: t ? Math.round(Ie(t).H) % 360 : null
367
+ hue: t ? Math.round(xe(t).H) % 360 : null
364
368
  };
365
369
  const a = /* @__PURE__ */ new Set([
366
370
  (s + 11) % 12,
@@ -370,78 +374,78 @@ function yn(e, t = null) {
370
374
  x: 0,
371
375
  y: 0
372
376
  };
373
- for (const p of n) {
374
- if (p.C < 0.035 || !a.has(et(p.H))) continue;
375
- const h = p.C ** 2, b = p.H * Math.PI / 180;
376
- u.x += h * Math.cos(b), u.y += h * Math.sin(b);
377
+ for (const d of n) {
378
+ if (d.C < 0.035 || !a.has(et(d.H))) continue;
379
+ const p = d.C ** 2, y = d.H * Math.PI / 180;
380
+ u.x += p * Math.cos(y), u.y += p * Math.sin(y);
377
381
  }
378
- const d = Math.atan2(u.y, u.x) * 180 / Math.PI;
382
+ const f = Math.atan2(u.y, u.x) * 180 / Math.PI;
379
383
  return {
380
384
  lightness: o,
381
- hue: Math.round(d + 360) % 360
385
+ hue: Math.round(f + 360) % 360
382
386
  };
383
387
  }
384
- function vn(e, t) {
388
+ function En(e, t) {
385
389
  if (!e || Math.abs(Math.round(e.lightness * 100) - Math.round(t.lightness * 100)) >= 2) return !0;
386
390
  if (e.hue === null || t.hue === null) return e.hue !== t.hue;
387
391
  const n = Math.abs(e.hue - t.hue) % 360;
388
392
  return Math.min(n, 360 - n) >= 10;
389
393
  }
390
- var wn = [150, 800], En = 1e3;
391
- var Sn = 2e3, tt = [
394
+ var Sn = [150, 800], Tn = 1e3;
395
+ var _n = 2e3, tt = [
392
396
  "class",
393
397
  "style",
394
398
  "data-theme",
395
399
  "data-mode"
396
400
  ];
397
- function Tn(e, t = () => yn(gn(document), bn(document))) {
401
+ function Ln(e, t = () => wn(bn(document), vn(document))) {
398
402
  let n = !1, r = !1, o = null, i = Number.NEGATIVE_INFINITY, l = null, c = null, s = null, a = null, u = null;
399
- const d = /* @__PURE__ */ new Set(), p = () => {
403
+ const f = /* @__PURE__ */ new Set(), d = () => {
400
404
  if (n || document.hidden) return;
401
- const I = i + 250 - Date.now();
402
- if (I > 0) {
405
+ const N = i + 250 - Date.now();
406
+ if (N > 0) {
403
407
  l ?? (l = setTimeout(() => {
404
- l = null, p();
405
- }, I));
408
+ l = null, d();
409
+ }, N));
406
410
  return;
407
411
  }
408
412
  i = Date.now();
409
- let O;
413
+ let k;
410
414
  try {
411
- O = t();
415
+ k = t();
412
416
  } catch {
413
417
  return;
414
418
  }
415
- !O || !r && !vn(o, O) || (r = !1, o = O, e(O));
416
- }, h = (I) => {
417
- const O = setTimeout(() => {
418
- d.delete(O), p();
419
- }, I);
420
- d.add(O);
421
- }, b = () => {
422
- p(), c && clearTimeout(c), c = setTimeout(() => {
423
- c = null, p();
419
+ !k || !r && !En(o, k) || (r = !1, o = k, e(k));
420
+ }, p = (N) => {
421
+ const k = setTimeout(() => {
422
+ f.delete(k), d();
423
+ }, N);
424
+ f.add(k);
425
+ }, y = () => {
426
+ d(), c && clearTimeout(c), c = setTimeout(() => {
427
+ c = null, d();
424
428
  }, 250);
425
- }, E = () => {
426
- p(), a && clearTimeout(a), a = setTimeout(() => {
427
- a = null, p();
428
- }, En);
429
- }, A = () => {
430
- const I = Date.now();
431
- u ?? (u = I), s && clearTimeout(s);
432
- const O = Math.max(0, Math.min(500, u + Sn - I));
433
- s = setTimeout(() => {
434
- s = null, u = null, p();
435
- }, O);
436
429
  }, S = () => {
437
- document.hidden || h(0);
438
- }, v = () => p(), _ = typeof window.matchMedia == "function" ? window.matchMedia("(prefers-color-scheme: dark)") : null, L = () => h(0), k = new MutationObserver(E);
439
- k.observe(document.documentElement, {
430
+ d(), a && clearTimeout(a), a = setTimeout(() => {
431
+ a = null, d();
432
+ }, Tn);
433
+ }, R = () => {
434
+ const N = Date.now();
435
+ u ?? (u = N), s && clearTimeout(s);
436
+ const k = Math.max(0, Math.min(500, u + _n - N));
437
+ s = setTimeout(() => {
438
+ s = null, u = null, d();
439
+ }, k);
440
+ }, v = () => {
441
+ document.hidden || p(0);
442
+ }, E = () => d(), _ = typeof window.matchMedia == "function" ? window.matchMedia("(prefers-color-scheme: dark)") : null, A = () => p(0), M = new MutationObserver(S);
443
+ M.observe(document.documentElement, {
440
444
  attributes: !0,
441
445
  attributeFilter: tt
442
446
  });
443
- const D = new MutationObserver(A);
444
- return document.body && (k.observe(document.body, {
447
+ const D = new MutationObserver(R);
448
+ return document.body && (M.observe(document.body, {
445
449
  attributes: !0,
446
450
  attributeFilter: tt
447
451
  }), D.observe(document.body, {
@@ -449,38 +453,38 @@ function Tn(e, t = () => yn(gn(document), bn(document))) {
449
453
  childList: !0,
450
454
  attributes: !0,
451
455
  attributeFilter: ["class", "style"]
452
- })), document.addEventListener("scroll", b, {
456
+ })), document.addEventListener("scroll", y, {
453
457
  capture: !0,
454
458
  passive: !0
455
- }), window.addEventListener("resize", b), document.addEventListener("visibilitychange", S), _?.addEventListener("change", L), {
459
+ }), window.addEventListener("resize", y), document.addEventListener("visibilitychange", v), _?.addEventListener("change", A), {
456
460
  announce: () => {
457
- n || (r = !0, document.readyState === "complete" ? p() : window.addEventListener("load", v, { once: !0 }));
461
+ n || (r = !0, document.readyState === "complete" ? d() : window.addEventListener("load", E, { once: !0 }));
458
462
  },
459
463
  navigated: () => {
460
464
  if (!n)
461
- for (const I of wn) h(I);
465
+ for (const N of Sn) p(N);
462
466
  },
463
467
  stop: () => {
464
468
  n = !0;
465
- for (const I of [
466
- ...d,
469
+ for (const N of [
470
+ ...f,
467
471
  l,
468
472
  c,
469
473
  s,
470
474
  a
471
- ]) I && clearTimeout(I);
472
- d.clear(), k.disconnect(), D.disconnect(), document.removeEventListener("scroll", b, { capture: !0 }), window.removeEventListener("resize", b), document.removeEventListener("visibilitychange", S), window.removeEventListener("load", v), _?.removeEventListener("change", L);
475
+ ]) N && clearTimeout(N);
476
+ f.clear(), M.disconnect(), D.disconnect(), document.removeEventListener("scroll", y, { capture: !0 }), window.removeEventListener("resize", y), document.removeEventListener("visibilitychange", v), window.removeEventListener("load", E), _?.removeEventListener("change", A);
473
477
  }
474
478
  };
475
479
  }
476
- var _n = /[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g, An = /\b\d{3}-\d{2}-\d{4}\b/g, Ln = /\d(?:[ -]?\d){12,18}/g, Rn = /\b(Bearer|Basic|Token)\s+(?=[A-Za-z0-9._~+/=-]*\d)[A-Za-z0-9._~+/=-]{6,}/gi, In = /\b((?:proxy-)?authorization)\b(["']?\s*[:=]\s*["']?)(?:Digest\s+[^\r\n]*|(?:(?:Bearer|Basic|Token)\s+)?[^\s"'&,;}]+)/gi, Cn = /(token|secret|passw(?:or)?d|api[-_]?key)\b(["']?\s*[:=]\s*["']?)[^\s"'&,;}]+/gi, On = /\b((?:set-)?cookie)\b(["']?\s*[:=]\s*["']?)[^"'\r\n]+/gi, kn = /\b(session(?:[-_]?id)?)\b(["']?\s*[:=]\s*["']?)(?=[^\s"'&,;}]{0,256}\d)[^\s"'&,;}]+/gi, Nn = /\beyJ[A-Za-z0-9_-]{5,}\.[A-Za-z0-9_-]{5,}\.[A-Za-z0-9_-]{5,}\b/g, Mn = /\bhttps?:\/\/[^\s"'<>)]+/gi, xn = /(?::\d+){1,2}$/;
477
- function Dn(e) {
480
+ var An = /[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g, In = /\b\d{3}-\d{2}-\d{4}\b/g, Rn = /\d(?:[ -]?\d){12,18}/g, Nn = /\b(Bearer|Basic|Token)\s+(?=[A-Za-z0-9._~+/=-]*\d)[A-Za-z0-9._~+/=-]{6,}/gi, On = /\b((?:proxy-)?authorization)\b(["']?\s*[:=]\s*["']?)(?:Digest\s+[^\r\n]*|(?:(?:Bearer|Basic|Token)\s+)?[^\s"'&,;}]+)/gi, Cn = /(token|secret|passw(?:or)?d|api[-_]?key)\b(["']?\s*[:=]\s*["']?)[^\s"'&,;}]+/gi, kn = /\b((?:set-)?cookie)\b(["']?\s*[:=]\s*["']?)[^"'\r\n]+/gi, Mn = /\b(session(?:[-_]?id)?)\b(["']?\s*[:=]\s*["']?)(?=[^\s"'&,;}]{0,256}\d)[^\s"'&,;}]+/gi, xn = /\beyJ[A-Za-z0-9_-]{5,}\.[A-Za-z0-9_-]{5,}\.[A-Za-z0-9_-]{5,}\b/g, Fn = /\bhttps?:\/\/[^\s"'<>)]+/gi, Dn = /(?::\d+){1,2}$/;
481
+ function Pn(e) {
478
482
  const t = e.search(/[?#]/);
479
483
  if (t < 0) return e;
480
- const n = xn.exec(e.slice(t))?.[0] ?? "";
484
+ const n = Dn.exec(e.slice(t))?.[0] ?? "";
481
485
  return e.slice(0, t) + n;
482
486
  }
483
- function Pn(e) {
487
+ function $n(e) {
484
488
  let t = 0, n = !1;
485
489
  for (let r = e.length - 1; r >= 0; r--) {
486
490
  let o = e.charCodeAt(r) - 48;
@@ -489,47 +493,47 @@ function Pn(e) {
489
493
  }
490
494
  return t % 10 === 0;
491
495
  }
492
- function J(e) {
496
+ function oe(e) {
493
497
  if (!e) return e;
494
- let t = e.replace(Mn, Dn).replace(In, "$1$2[secret masqué]").replace(Rn, "$1 [secret masqué]").replace(Nn, "[jeton masqué]").replace(On, "$1$2[secret masqué]").replace(Cn, "$1$2[secret masqué]").replace(kn, "$1$2[secret masqué]");
495
- return t = t.replace(_n, "[email masqué]"), t = t.replace(An, "[id masqué]"), t = t.replace(Ln, (n) => {
498
+ let t = e.replace(Fn, Pn).replace(On, "$1$2[secret masqué]").replace(Nn, "$1 [secret masqué]").replace(xn, "[jeton masqué]").replace(kn, "$1$2[secret masqué]").replace(Cn, "$1$2[secret masqué]").replace(Mn, "$1$2[secret masqué]");
499
+ return t = t.replace(An, "[email masqué]"), t = t.replace(In, "[id masqué]"), t = t.replace(Rn, (n) => {
496
500
  const r = n.replace(/[ -]/g, "");
497
- return r.length >= 13 && r.length <= 19 && Pn(r) ? "[carte masquée]" : n;
501
+ return r.length >= 13 && r.length <= 19 && $n(r) ? "[carte masquée]" : n;
498
502
  }), t;
499
503
  }
500
- var Fn = /^(mailto|tel|sms|callto):/i;
501
- function Fe(e) {
502
- const t = e.trim(), n = Fn.exec(t);
503
- return n ? `${n[1]}:` : /^(data|blob):/i.test(t) ? e : J(mt(t));
504
+ var Bn = /^(mailto|tel|sms|callto):/i;
505
+ function Ge(e) {
506
+ const t = e.trim(), n = Bn.exec(t);
507
+ return n ? `${n[1]}:` : /^(data|blob):/i.test(t) ? e : oe(ht(t));
504
508
  }
505
- function $n(e) {
509
+ function qn(e) {
506
510
  return e.split(",").map((t) => {
507
511
  const [n = "", ...r] = t.trim().split(/\s+/);
508
- return [Fe(n), ...r].join(" ");
512
+ return [Ge(n), ...r].join(" ");
509
513
  }).join(", ");
510
514
  }
511
- function Bn(e) {
512
- return e.replace(/url\(\s*(['"]?)([^'")]*)\1\s*\)/gi, (t, n, r) => `url(${n}${Fe(r)}${n})`);
515
+ function Un(e) {
516
+ return e.replace(/url\(\s*(['"]?)([^'")]*)\1\s*\)/gi, (t, n, r) => `url(${n}${Ge(r)}${n})`);
513
517
  }
514
- var me = "leesto-mask", ee = "[data-leesto-block]", $e = "leesto-mask-text", Be = "[data-private]", gt = `.${$e}, ${Be}`, qn = 'img, picture, video, canvas, object, embed, svg image, input[type="image"]', Hn = 'button, a, [role="button"], [role="link"], input[type="button"], input[type="submit"], input[type="reset"]';
515
- var bt = 'input:not([type="button"]):not([type="submit"]):not([type="reset"]), textarea, select';
516
- function ge(e) {
518
+ var Ee = "leesto-mask", ie = "[data-leesto-block]", We = "leesto-mask-text", Ve = "[data-private]", gt = `.${We}, ${Ve}`, Hn = 'img, picture, video, canvas, object, embed, svg image, input[type="image"]', Gn = 'button, a, [role="button"], [role="link"], input[type="button"], input[type="submit"], input[type="reset"]';
519
+ var yt = 'input:not([type="button"]):not([type="submit"]):not([type="reset"]), textarea, select';
520
+ function Se(e) {
517
521
  return e.replace(/\S/g, "*");
518
522
  }
519
- function Un(e, t) {
523
+ function Wn(e, t) {
520
524
  try {
521
525
  return e.closest(t);
522
526
  } catch {
523
527
  return null;
524
528
  }
525
529
  }
526
- function yt(e) {
527
- return Un(e, gt) !== null;
530
+ function bt(e) {
531
+ return Wn(e, gt) !== null;
528
532
  }
529
- var Gn = `.${me}, ${ee}, ${gt}`;
530
- function ne(e) {
533
+ var Vn = `.${Ee}, ${ie}, ${gt}`;
534
+ function ae(e) {
531
535
  try {
532
- return e.closest(Gn) !== null;
536
+ return e.closest(Vn) !== null;
533
537
  } catch {
534
538
  return !0;
535
539
  }
@@ -537,8 +541,8 @@ function ne(e) {
537
541
  function vt(e) {
538
542
  if (!e || typeof e.closest != "function") return !1;
539
543
  try {
540
- if (yt(e) || e.matches(bt)) return !1;
541
- const t = e.closest(Hn);
544
+ if (bt(e) || e.matches(yt)) return !1;
545
+ const t = e.closest(Gn);
542
546
  return t ? (t.textContent ?? "").trim().length <= 80 : !1;
543
547
  } catch {
544
548
  return !1;
@@ -552,23 +556,23 @@ var nt = {
552
556
  tel: !0,
553
557
  text: !0
554
558
  },
555
- blockClass: me,
556
- maskTextClass: $e
559
+ blockClass: Ee,
560
+ maskTextClass: We
557
561
  };
558
562
  function wt(e) {
559
563
  if (e === "inputs_only") return {
560
564
  ...nt,
561
- blockSelector: ee,
562
- maskTextSelector: Be
565
+ blockSelector: ie,
566
+ maskTextSelector: Ve
563
567
  };
564
568
  const t = {
565
569
  ...nt,
566
- blockSelector: `${ee}, ${qn}`,
570
+ blockSelector: `${ie}, ${Hn}`,
567
571
  maskTextSelector: "*"
568
572
  };
569
573
  return e === "labels_visible" ? {
570
574
  ...t,
571
- maskTextFn: (n, r) => vt(r) ? n : ge(n)
575
+ maskTextFn: (n, r) => vt(r) ? n : Se(n)
572
576
  } : t;
573
577
  }
574
578
  var rt = /* @__PURE__ */ new Set([
@@ -581,7 +585,7 @@ var rt = /* @__PURE__ */ new Set([
581
585
  "aria-placeholder",
582
586
  "aria-roledescription",
583
587
  "aria-valuetext"
584
- ]), Wn = /* @__PURE__ */ new Set([
588
+ ]), zn = /* @__PURE__ */ new Set([
585
589
  "href",
586
590
  "src",
587
591
  "action",
@@ -594,16 +598,16 @@ var rt = /* @__PURE__ */ new Set([
594
598
  "longdesc",
595
599
  "xlink:href"
596
600
  ]);
597
- function Vn(e, t) {
598
- if (e === "srcset") return $n(t);
599
- if (e === "style") return Bn(t);
600
- if (Wn.has(e)) return Fe(t);
601
- if (e.startsWith("data-")) return J(t);
602
- }
603
- var zn = 2, jn = 3, Xn = 4, Kn = 0, Yn = 2;
604
- function Zn(e, t, n) {
601
+ function Kn(e, t) {
602
+ if (e === "srcset") return qn(t);
603
+ if (e === "style") return Un(t);
604
+ if (zn.has(e)) return Ge(t);
605
+ if (e.startsWith("data-")) return oe(t);
606
+ }
607
+ var jn = 2, Xn = 3, Yn = 4, Zn = 0, Qn = 2;
608
+ function Jn(e, t, n) {
605
609
  if (e) try {
606
- return e.matches(bt);
610
+ return e.matches(yt);
607
611
  } catch {
608
612
  return !0;
609
613
  }
@@ -624,33 +628,33 @@ function Et(e, t, n) {
624
628
  } catch {
625
629
  return null;
626
630
  }
627
- }, i = (a, u, d, p) => {
631
+ }, i = (a, u, f, d) => {
628
632
  if (u === "value") {
629
- if (Zn(a, d, p)) return !1;
633
+ if (Jn(a, f, d)) return !1;
630
634
  } else if (!rt.has(u)) return !0;
631
- return !a || yt(a) ? !1 : t === "inputs_only" ? !0 : t === "labels_visible" ? vt(a) : !1;
632
- }, l = (a, u, d) => {
633
- if (d)
634
- for (const p of Object.keys(d)) {
635
- const h = d[p];
636
- if (typeof h != "string" || !h) continue;
637
- const b = Vn(p, h);
638
- if (b !== void 0) {
639
- d[p] = b;
635
+ return !a || bt(a) ? !1 : t === "inputs_only" ? !0 : t === "labels_visible" ? vt(a) : !1;
636
+ }, l = (a, u, f) => {
637
+ if (f)
638
+ for (const d of Object.keys(f)) {
639
+ const p = f[d];
640
+ if (typeof p != "string" || !p) continue;
641
+ const y = Kn(d, p);
642
+ if (y !== void 0) {
643
+ f[d] = y;
640
644
  continue;
641
645
  }
642
- p !== "value" && !rt.has(p) || i(a, p, u, d) || (d[p] = ge(h));
646
+ d !== "value" && !rt.has(d) || i(a, d, u, f) || (f[d] = Se(p));
643
647
  }
644
648
  }, c = (a) => {
645
649
  const u = a ? [a] : [];
646
650
  for (; u.length > 0; ) {
647
- const d = u.pop();
648
- d.type === Yn && d.attributes && l(o(d.id), String(d.tagName ?? ""), d.attributes), Array.isArray(d.childNodes) && u.push(...d.childNodes);
651
+ const f = u.pop();
652
+ f.type === Qn && f.attributes && l(o(f.id), String(f.tagName ?? ""), f.attributes), Array.isArray(f.childNodes) && u.push(...f.childNodes);
649
653
  }
650
654
  }, s = r.data;
651
- if (r.type === Xn && typeof s.href == "string") s.href = mt(s.href);
652
- else if (r.type === zn) c(s.node);
653
- else if (r.type === jn && s.source === Kn) {
655
+ if (r.type === Yn && typeof s.href == "string") s.href = ht(s.href);
656
+ else if (r.type === jn) c(s.node);
657
+ else if (r.type === Xn && s.source === Zn) {
654
658
  for (const a of s.adds ?? []) c(a.node);
655
659
  for (const a of s.attributes ?? []) {
656
660
  const u = o(a.id);
@@ -659,50 +663,50 @@ function Et(e, t, n) {
659
663
  }
660
664
  return e;
661
665
  }
662
- var Ce = "data-leesto-capture-field", Oe = "data-leesto-capture-text", ke = "data-leesto-capture-block", St = `.${me}, ${ee}`, Qn = 'input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="image"]), textarea, select', Jn = `.${$e}, ${Be}`;
666
+ var Fe = "data-leesto-capture-field", De = "data-leesto-capture-text", Pe = "data-leesto-capture-block", St = `.${Ee}, ${ie}`, er = 'input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="image"]), textarea, select', tr = `.${We}, ${Ve}`;
663
667
  function ot(e, t = {}) {
664
668
  const n = [], r = (i, l, c = "") => {
665
669
  i.hasAttribute(l) || (i.setAttribute(l, c), n.push([i, l]));
666
670
  }, o = (i) => [...e.matches(i) ? [e] : [], ...e.querySelectorAll(i)];
667
- for (const i of o(Qn)) r(i, Ce);
668
- for (const i of o(Jn)) r(i, Oe);
671
+ for (const i of o(er)) r(i, Fe);
672
+ for (const i of o(tr)) r(i, De);
669
673
  if (t.blocks) for (const i of e.querySelectorAll(St)) {
670
674
  const l = i.getBoundingClientRect();
671
- r(i, ke, `${Math.round(l.width)}x${Math.round(l.height)}`);
675
+ r(i, Pe, `${Math.round(l.width)}x${Math.round(l.height)}`);
672
676
  }
673
677
  return () => {
674
678
  for (const [i, l] of n) i.removeAttribute(l);
675
679
  };
676
680
  }
677
- function Ne(e) {
681
+ function $e(e) {
678
682
  const t = e.ownerDocument.createTreeWalker(e, 4);
679
683
  for (let n = t.nextNode(); n; n = t.nextNode()) {
680
684
  const r = n;
681
- r.data = ge(r.data);
685
+ r.data = Se(r.data);
682
686
  }
683
687
  }
684
- function er(e) {
688
+ function nr(e) {
685
689
  const t = e.tagName.toLowerCase();
686
690
  if (t === "select") {
687
- for (const r of e.querySelectorAll("option")) Ne(r);
691
+ for (const r of e.querySelectorAll("option")) $e(r);
688
692
  return;
689
693
  }
690
694
  const n = e.getAttribute("value");
691
- n && e.setAttribute("value", ge(n)), t === "textarea" && Ne(e);
695
+ n && e.setAttribute("value", Se(n)), t === "textarea" && $e(e);
692
696
  }
693
697
  function it(e) {
694
698
  if (e.nodeType !== 1) return;
695
699
  const t = e, n = (r) => [...t.hasAttribute(r) ? [t] : [], ...t.querySelectorAll(`[${r}]`)];
696
- for (const r of n(Ce))
697
- er(r), r.removeAttribute(Ce);
698
- for (const r of n(Oe))
699
- Ne(r), r.removeAttribute(Oe);
700
- for (const r of t.querySelectorAll(`[${ke}]`)) {
701
- const [o, i] = (r.getAttribute(ke) ?? "0x0").split("x"), l = r.ownerDocument.createElement("div");
700
+ for (const r of n(Fe))
701
+ nr(r), r.removeAttribute(Fe);
702
+ for (const r of n(De))
703
+ $e(r), r.removeAttribute(De);
704
+ for (const r of t.querySelectorAll(`[${Pe}]`)) {
705
+ const [o, i] = (r.getAttribute(Pe) ?? "0x0").split("x"), l = r.ownerDocument.createElement("div");
702
706
  l.setAttribute("style", `display:inline-block;width:${o}px;height:${i}px;background:#a1a1aa`), r.replaceWith(l);
703
707
  }
704
708
  }
705
- function se(e) {
709
+ function de(e) {
706
710
  const t = [];
707
711
  return {
708
712
  push(n) {
@@ -713,46 +717,46 @@ function se(e) {
713
717
  }
714
718
  };
715
719
  }
716
- function j(e) {
720
+ function X(e) {
717
721
  const t = typeof e == "string" ? e : e instanceof URL ? e.href : e instanceof Request ? e.url : String(e);
718
722
  try {
719
723
  const n = new URL(t, typeof location < "u" ? location.href : void 0);
720
- return n.origin + J(n.pathname);
724
+ return n.origin + oe(n.pathname);
721
725
  } catch {
722
- return J(t.split("?")[0] ?? t);
726
+ return oe(t.split("?")[0] ?? t);
723
727
  }
724
728
  }
725
- var tr = /* @__PURE__ */ new Set(["fetch", "xmlhttprequest"]), nr = ["deprecation", "intervention"], rr = { teardown: () => {
729
+ var rr = /* @__PURE__ */ new Set(["fetch", "xmlhttprequest"]), or = ["deprecation", "intervention"], ir = { teardown: () => {
726
730
  } };
727
- function or(e) {
731
+ function sr(e) {
728
732
  const t = typeof performance < "u" ? performance.timeOrigin : 0;
729
733
  return Math.round(t + e);
730
734
  }
731
- function ir(e) {
735
+ function ar(e) {
732
736
  const t = e.responseStatus;
733
737
  return typeof t == "number" && t > 0 ? t : void 0;
734
738
  }
735
- function sr(e) {
736
- if (tr.has(e.initiatorType)) return null;
737
- const t = ir(e), n = e.transferSize || e.encodedBodySize || void 0;
739
+ function lr(e) {
740
+ if (rr.has(e.initiatorType)) return null;
741
+ const t = ar(e), n = e.transferSize || e.encodedBodySize || void 0;
738
742
  return {
739
743
  method: "GET",
740
- url: j(e.name),
744
+ url: X(e.name),
741
745
  ...t !== void 0 ? { status: t } : {},
742
746
  durationMs: Math.round(e.duration),
743
747
  ...n ? { responseSize: n } : {},
744
- startedAt: or(e.startTime),
748
+ startedAt: sr(e.startTime),
745
749
  ...t !== void 0 && t >= 400 ? { failed: !0 } : {},
746
750
  initiatorType: e.initiatorType
747
751
  };
748
752
  }
749
- function ar(e) {
750
- if (typeof window > "u") return rr;
753
+ function cr(e) {
754
+ if (typeof window > "u") return ir;
751
755
  const t = [];
752
756
  if (typeof PerformanceObserver < "u") try {
753
757
  const i = new PerformanceObserver((l) => {
754
758
  for (const c of l.getEntries()) try {
755
- const s = sr(c);
759
+ const s = lr(c);
756
760
  s && e.onResource(s);
757
761
  } catch {
758
762
  }
@@ -771,7 +775,7 @@ function ar(e) {
771
775
  e.onReport("warn", `Navigateur (${c.type}) : ${s}`);
772
776
  }
773
777
  }), {
774
- types: nr,
778
+ types: or,
775
779
  buffered: !0
776
780
  });
777
781
  i.observe(), t.push(() => i.disconnect());
@@ -793,31 +797,31 @@ function ar(e) {
793
797
  }
794
798
  } };
795
799
  }
796
- var lr = 50, cr = 30, ur = 100, fr = 50, te = 500, Tt = 8e3, dr = te * 4, pr = Tt * 2;
800
+ var ur = 50, fr = 30, dr = 100, pr = 50, se = 500, Tt = 8e3, mr = se * 4, hr = Tt * 2;
797
801
  function _t(e, t, n) {
798
- return J(e.slice(0, n)).slice(0, t);
802
+ return oe(e.slice(0, n)).slice(0, t);
799
803
  }
800
- function Z(e) {
801
- return _t(e, te, dr);
804
+ function ne(e) {
805
+ return _t(e, se, mr);
802
806
  }
803
- var hr = /(token|secret|passw(or)?d|api[-_]?key|authorization|cookie)$/i;
804
- function Se(e) {
807
+ var gr = /(token|secret|passw(or)?d|api[-_]?key|authorization|cookie)$/i;
808
+ function Re(e) {
805
809
  const t = e instanceof Error ? e.stack : void 0;
806
810
  if (t)
807
- return _t(t, Tt, pr);
811
+ return _t(t, Tt, hr);
808
812
  }
809
- function Te(e) {
813
+ function Ne(e) {
810
814
  if (e instanceof Error) return `${e.name}: ${e.message}`;
811
815
  if (typeof e == "string") return e;
812
816
  if (typeof e == "object" && e !== null) {
813
817
  const t = /* @__PURE__ */ Symbol("overflow");
814
- let n = te * 8;
818
+ let n = se * 8;
815
819
  try {
816
820
  return JSON.stringify(e, (r, o) => {
817
- if (hr.test(r)) return "[masqué]";
821
+ if (gr.test(r)) return "[masqué]";
818
822
  if (n -= r.length + (typeof o == "string" ? o.length : 8), n < 0) throw t;
819
823
  return o;
820
- }).slice(0, te);
824
+ }).slice(0, se);
821
825
  } catch (r) {
822
826
  return r === t ? "[objet volumineux]" : "[objet]";
823
827
  }
@@ -829,7 +833,7 @@ function st(e) {
829
833
  const t = Number(e);
830
834
  return Number.isFinite(t) && t >= 0 ? t : void 0;
831
835
  }
832
- var mr = {
836
+ var yr = {
833
837
  snapshot: () => ({
834
838
  errors: [],
835
839
  logs: [],
@@ -842,131 +846,131 @@ var mr = {
842
846
  teardown: () => {
843
847
  }
844
848
  };
845
- function At(e) {
846
- if (typeof window > "u") return mr;
847
- const t = se(lr), n = se(cr), r = se(ur), o = se(fr), i = de(e.runId) ? e.runId : void 0, l = (f) => {
849
+ function Lt(e) {
850
+ if (typeof window > "u") return yr;
851
+ const t = de(ur), n = de(fr), r = de(dr), o = de(pr), i = be(e.runId) ? e.runId : void 0, l = (m) => {
848
852
  if (!i) return !1;
849
853
  try {
850
- const m = new URL(String(f), location.href);
851
- return m.origin === location.origin || (e.runIdOrigins ?? []).includes(m.origin);
854
+ const b = new URL(String(m), location.href);
855
+ return b.origin === location.origin || (e.runIdOrigins ?? []).includes(b.origin);
852
856
  } catch {
853
857
  return !1;
854
858
  }
855
859
  };
856
860
  let c = e.sink ?? null;
857
- const s = (f, m) => {
858
- c?.(f, m);
859
- }, a = (f) => {
860
- e.captureNetwork && t.push(f);
861
- }, u = (f) => {
862
- e.captureNetwork && s(Yt, f);
863
- }, d = (f, m, y, R = {}) => {
864
- if (!m) return;
865
- const N = {
866
- level: f,
867
- message: m,
868
- ...y ? { stack: y } : {},
869
- ...R,
861
+ const s = (m, b) => {
862
+ c?.(m, b);
863
+ }, a = (m) => {
864
+ e.captureNetwork && t.push(m);
865
+ }, u = (m) => {
866
+ e.captureNetwork && s(Qt, m);
867
+ }, f = (m, b, w, I = {}) => {
868
+ if (!b) return;
869
+ const x = {
870
+ level: m,
871
+ message: b,
872
+ ...w ? { stack: w } : {},
873
+ ...I,
870
874
  at: Date.now()
871
875
  };
872
- o.push(N), s(Ze, N);
873
- }, p = (f, m) => {
876
+ o.push(x), s(Ze, x);
877
+ }, d = (m, b) => {
874
878
  try {
875
- const y = Z(m.map(Te).join(" ")), R = m.find((N) => N instanceof Error);
876
- d(f, y, Se(R), {
879
+ const w = ne(b.map(Ne).join(" ")), I = b.find((x) => x instanceof Error);
880
+ f(m, w, Re(I), {
877
881
  mechanism: "console",
878
- ...R instanceof Error && R.name ? { name: R.name } : {}
882
+ ...I instanceof Error && I.name ? { name: I.name } : {}
879
883
  });
880
884
  } catch {
881
885
  }
882
- }, h = (f, m) => {
886
+ }, p = (m, b) => {
883
887
  try {
884
- const y = Z(m.map(Te).join(" "));
885
- y && r.push({
886
- level: f,
887
- message: y,
888
+ const w = ne(b.map(Ne).join(" "));
889
+ w && r.push({
890
+ level: m,
891
+ message: w,
888
892
  at: Date.now()
889
893
  });
890
894
  } catch {
891
895
  }
892
- }, b = console.error, E = console.warn, A = console.log, S = console.info;
893
- console.error = (...f) => (p("error", f), b.apply(console, f)), console.warn = (...f) => (p("warn", f), E.apply(console, f)), console.log = (...f) => (h("log", f), A.apply(console, f)), console.info = (...f) => (h("info", f), S.apply(console, f));
894
- const v = (f) => {
895
- const m = f.target;
896
- if (m instanceof Element) {
897
- const R = m.src || m.href || "";
898
- if (!R) return;
899
- d("error", `Ressource non chargée : <${m.tagName.toLowerCase()}> ${j(R)}`.slice(0, te), void 0, {
896
+ }, y = console.error, S = console.warn, R = console.log, v = console.info;
897
+ console.error = (...m) => (d("error", m), y.apply(console, m)), console.warn = (...m) => (d("warn", m), S.apply(console, m)), console.log = (...m) => (p("log", m), R.apply(console, m)), console.info = (...m) => (p("info", m), v.apply(console, m));
898
+ const E = (m) => {
899
+ const b = m.target;
900
+ if (b instanceof Element) {
901
+ const I = b.src || b.href || "";
902
+ if (!I) return;
903
+ f("error", `Ressource non chargée : <${b.tagName.toLowerCase()}> ${X(I)}`.slice(0, se), void 0, {
900
904
  mechanism: "resource",
901
- sourceUrl: j(R)
905
+ sourceUrl: X(I)
902
906
  });
903
907
  return;
904
908
  }
905
- const y = f;
906
- d("error", Z(`Erreur non gérée : ${y.message}`), Se(y.error), {
909
+ const w = m;
910
+ f("error", ne(`Erreur non gérée : ${w.message}`), Re(w.error), {
907
911
  mechanism: "window.error",
908
- ...typeof y.error?.name == "string" ? { name: y.error.name } : {},
909
- ...typeof y.filename == "string" && y.filename ? { sourceUrl: j(y.filename) } : {},
910
- ...typeof y.lineno == "number" && y.lineno > 0 ? { line: y.lineno } : {},
911
- ...typeof y.colno == "number" && y.colno > 0 ? { column: y.colno } : {}
912
+ ...typeof w.error?.name == "string" ? { name: w.error.name } : {},
913
+ ...typeof w.filename == "string" && w.filename ? { sourceUrl: X(w.filename) } : {},
914
+ ...typeof w.lineno == "number" && w.lineno > 0 ? { line: w.lineno } : {},
915
+ ...typeof w.colno == "number" && w.colno > 0 ? { column: w.colno } : {}
912
916
  });
913
- }, _ = (f) => {
914
- d("error", Z(`Promesse rejetée : ${Te(f.reason)}`), Se(f.reason), {
917
+ }, _ = (m) => {
918
+ f("error", ne(`Promesse rejetée : ${Ne(m.reason)}`), Re(m.reason), {
915
919
  mechanism: "unhandledrejection",
916
- ...f.reason instanceof Error && f.reason.name ? { name: f.reason.name } : {}
920
+ ...m.reason instanceof Error && m.reason.name ? { name: m.reason.name } : {}
917
921
  });
918
922
  };
919
- window.addEventListener("error", v, !0), window.addEventListener("unhandledrejection", _);
920
- const L = typeof window.fetch == "function" ? window.fetch.bind(window) : null;
921
- L && (window.fetch = (async (f, m) => {
922
- const y = Date.now(), R = (m?.method ?? (f instanceof Request ? f.method : "GET") ?? "GET").toUpperCase(), N = j(f);
923
- let H = m;
924
- if (i && l(f)) {
925
- const C = new Headers(f instanceof Request ? f.headers : void 0);
926
- for (const [P, U] of new Headers(m?.headers)) C.set(P, U);
927
- C.set(Ye, i), H = {
928
- ...m,
923
+ window.addEventListener("error", E, !0), window.addEventListener("unhandledrejection", _);
924
+ const A = typeof window.fetch == "function" ? window.fetch.bind(window) : null;
925
+ A && (window.fetch = (async (m, b) => {
926
+ const w = Date.now(), I = (b?.method ?? (m instanceof Request ? m.method : "GET") ?? "GET").toUpperCase(), x = X(m);
927
+ let B = b;
928
+ if (i && l(m)) {
929
+ const C = new Headers(m instanceof Request ? m.headers : void 0);
930
+ for (const [P, U] of new Headers(b?.headers)) C.set(P, U);
931
+ C.set(Ye, i), B = {
932
+ ...b,
929
933
  headers: C
930
934
  };
931
935
  }
932
936
  try {
933
- const C = await L(f, H);
937
+ const C = await A(m, B);
934
938
  try {
935
939
  const P = C.headers.get("x-request-id"), U = C.headers.get("traceparent");
936
940
  a({
937
- method: R,
938
- url: N,
941
+ method: I,
942
+ url: x,
939
943
  status: C.status,
940
- durationMs: Date.now() - y,
944
+ durationMs: Date.now() - w,
941
945
  responseSize: st(C.headers.get("content-length")),
942
946
  contentType: C.headers.get("content-type") ?? void 0,
943
- startedAt: y,
947
+ startedAt: w,
944
948
  ...P ? { requestId: P.slice(0, 200) } : {},
945
949
  ...U ? { traceparent: U.slice(0, 200) } : {},
946
950
  ...i ? { runId: i } : {}
947
951
  }), C.ok || u({
948
- method: R,
949
- url: N,
952
+ method: I,
953
+ url: x,
950
954
  status: C.status,
951
- durationMs: Date.now() - y
955
+ durationMs: Date.now() - w
952
956
  });
953
957
  } catch {
954
958
  }
955
959
  return C;
956
960
  } catch (C) {
957
961
  try {
958
- const P = Date.now() - y;
962
+ const P = Date.now() - w;
959
963
  a({
960
- method: R,
961
- url: N,
964
+ method: I,
965
+ url: x,
962
966
  status: 0,
963
967
  durationMs: P,
964
- startedAt: y,
968
+ startedAt: w,
965
969
  failed: !0,
966
970
  ...i ? { runId: i } : {}
967
971
  }), u({
968
- method: R,
969
- url: N,
972
+ method: I,
973
+ url: x,
970
974
  status: 0,
971
975
  durationMs: P
972
976
  });
@@ -975,86 +979,86 @@ function At(e) {
975
979
  throw C;
976
980
  }
977
981
  }));
978
- const k = XMLHttpRequest.prototype.open, D = XMLHttpRequest.prototype.send, I = "__echoNet";
979
- XMLHttpRequest.prototype.open = function(f, m, ...y) {
980
- return this[I] = {
981
- method: (f || "GET").toUpperCase(),
982
- url: j(m),
982
+ const M = XMLHttpRequest.prototype.open, D = XMLHttpRequest.prototype.send, N = "__echoNet";
983
+ XMLHttpRequest.prototype.open = function(m, b, ...w) {
984
+ return this[N] = {
985
+ method: (m || "GET").toUpperCase(),
986
+ url: X(b),
983
987
  start: 0,
984
- propagate: l(m)
985
- }, k.apply(this, [
986
- f,
988
+ propagate: l(b)
989
+ }, M.apply(this, [
987
990
  m,
988
- ...y
991
+ b,
992
+ ...w
989
993
  ]);
990
- }, XMLHttpRequest.prototype.send = function(...f) {
991
- const m = this[I];
992
- if (m) {
993
- if (m.start = Date.now(), i && m.propagate) try {
994
+ }, XMLHttpRequest.prototype.send = function(...m) {
995
+ const b = this[N];
996
+ if (b) {
997
+ if (b.start = Date.now(), i && b.propagate) try {
994
998
  this.setRequestHeader(Ye, i);
995
999
  } catch {
996
1000
  }
997
1001
  this.addEventListener("loadend", () => {
998
1002
  try {
999
- const y = Date.now() - m.start, R = this.status, N = R === 0, H = this.getResponseHeader("x-request-id"), C = this.getResponseHeader("traceparent");
1003
+ const w = Date.now() - b.start, I = this.status, x = I === 0, B = this.getResponseHeader("x-request-id"), C = this.getResponseHeader("traceparent");
1000
1004
  a({
1001
- method: m.method,
1002
- url: m.url,
1003
- status: R,
1004
- durationMs: y,
1005
+ method: b.method,
1006
+ url: b.url,
1007
+ status: I,
1008
+ durationMs: w,
1005
1009
  responseSize: st(this.getResponseHeader("content-length")),
1006
1010
  contentType: this.getResponseHeader("content-type") ?? void 0,
1007
- startedAt: m.start,
1008
- ...N ? { failed: !0 } : {},
1011
+ startedAt: b.start,
1012
+ ...x ? { failed: !0 } : {},
1009
1013
  ...i ? { runId: i } : {},
1010
- ...H ? { requestId: H.slice(0, 200) } : {},
1014
+ ...B ? { requestId: B.slice(0, 200) } : {},
1011
1015
  ...C ? { traceparent: C.slice(0, 200) } : {}
1012
- }), (N || R >= 400) && u({
1013
- method: m.method,
1014
- url: m.url,
1015
- status: R,
1016
- durationMs: y
1016
+ }), (x || I >= 400) && u({
1017
+ method: b.method,
1018
+ url: b.url,
1019
+ status: I,
1020
+ durationMs: w
1017
1021
  });
1018
1022
  } catch {
1019
1023
  }
1020
1024
  }, { once: !0 });
1021
1025
  }
1022
- return D.apply(this, f);
1026
+ return D.apply(this, m);
1023
1027
  };
1024
- const O = ar({
1025
- onResource: (f) => {
1028
+ const k = cr({
1029
+ onResource: (m) => {
1026
1030
  e.captureNetwork && n.push(i ? {
1027
- ...f,
1031
+ ...m,
1028
1032
  runId: i
1029
- } : f);
1033
+ } : m);
1030
1034
  },
1031
- onReport: (f, m) => d(f, Z(m), void 0, { mechanism: "report" })
1032
- }), V = () => e.captureNetwork ? [...t.snapshot(), ...n.snapshot()].sort((f, m) => f.startedAt - m.startedAt) : [];
1033
- let q = !1;
1035
+ onReport: (m, b) => f(m, ne(b), void 0, { mechanism: "report" })
1036
+ }), z = () => e.captureNetwork ? [...t.snapshot(), ...n.snapshot()].sort((m, b) => m.startedAt - b.startedAt) : [];
1037
+ let V = !1;
1034
1038
  return {
1035
1039
  snapshot: () => ({
1036
1040
  errors: o.snapshot(),
1037
1041
  logs: r.snapshot(),
1038
- network: V(),
1042
+ network: z(),
1039
1043
  ...i ? { runId: i } : {}
1040
1044
  }),
1041
- setSink: (f) => {
1042
- c = f;
1045
+ setSink: (m) => {
1046
+ c = m;
1043
1047
  },
1044
1048
  flushRings: () => {
1045
- const f = V();
1046
- f.length > 0 && s(Zt, { entries: f });
1047
- const m = r.snapshot();
1048
- m.length > 0 && s(Qt, { entries: m });
1049
- const y = o.snapshot();
1050
- y.length > 0 && s(Ze, { entries: y });
1049
+ const m = z();
1050
+ m.length > 0 && s(Jt, { entries: m });
1051
+ const b = r.snapshot();
1052
+ b.length > 0 && s(en, { entries: b });
1053
+ const w = o.snapshot();
1054
+ w.length > 0 && s(Ze, { entries: w });
1051
1055
  },
1052
1056
  teardown: () => {
1053
- q || (q = !0, c = null, O.teardown(), console.error = b, console.warn = E, console.log = A, console.info = S, window.removeEventListener("error", v, !0), window.removeEventListener("unhandledrejection", _), L && (window.fetch = L), XMLHttpRequest.prototype.open = k, XMLHttpRequest.prototype.send = D);
1057
+ V || (V = !0, c = null, k.teardown(), console.error = y, console.warn = S, console.log = R, console.info = v, window.removeEventListener("error", E, !0), window.removeEventListener("unhandledrejection", _), A && (window.fetch = A), XMLHttpRequest.prototype.open = M, XMLHttpRequest.prototype.send = D);
1054
1058
  }
1055
1059
  };
1056
1060
  }
1057
- var gr = "data-leesto-scrollbars", br = `@supports selector(::-webkit-scrollbar) {
1061
+ var br = "data-leesto-scrollbars", vr = `@supports selector(::-webkit-scrollbar) {
1058
1062
  ::-webkit-scrollbar { width: 10px; height: 10px; }
1059
1063
  ::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
1060
1064
  ::-webkit-scrollbar-thumb {
@@ -1068,21 +1072,21 @@ var gr = "data-leesto-scrollbars", br = `@supports selector(::-webkit-scrollbar)
1068
1072
  :where(html) { scrollbar-color: rgb(128 128 128 / 0.5) transparent; }
1069
1073
  :where(*) { scrollbar-width: thin; }
1070
1074
  }`;
1071
- function yr(e) {
1075
+ function wr(e) {
1072
1076
  const t = e.createElement("div");
1073
1077
  t.style.cssText = "position:absolute;top:-9999px;width:100px;height:100px;overflow:scroll;visibility:hidden", e.documentElement.append(t);
1074
1078
  const n = t.offsetWidth - t.clientWidth;
1075
1079
  return t.remove(), n;
1076
1080
  }
1077
- function vr(e = document, t = yr) {
1081
+ function Er(e = document, t = wr) {
1078
1082
  if (e.querySelector("style[data-leesto-scrollbars]")) return () => {
1079
1083
  };
1080
1084
  if (t(e) <= 0) return () => {
1081
1085
  };
1082
1086
  const n = e.createElement("style");
1083
- return n.setAttribute(gr, ""), n.textContent = br, (e.head ?? e.documentElement).prepend(n), () => n.remove();
1087
+ return n.setAttribute(br, ""), n.textContent = vr, (e.head ?? e.documentElement).prepend(n), () => n.remove();
1084
1088
  }
1085
- var wr = 80, Er = {
1089
+ var Sr = 80, Tr = {
1086
1090
  a: "link",
1087
1091
  button: "button",
1088
1092
  img: "img",
@@ -1095,50 +1099,50 @@ var wr = 80, Er = {
1095
1099
  h5: "heading",
1096
1100
  h6: "heading",
1097
1101
  dialog: "dialog"
1098
- }, Sr = {
1102
+ }, _r = {
1099
1103
  button: "button",
1100
1104
  submit: "button",
1101
1105
  reset: "button",
1102
1106
  checkbox: "checkbox",
1103
1107
  radio: "radio",
1104
1108
  search: "searchbox"
1105
- }, z = (e) => {
1109
+ }, j = (e) => {
1106
1110
  const t = (e ?? "").replace(/\s+/g, " ").trim();
1107
- return t ? t.slice(0, wr) : null;
1111
+ return t ? t.slice(0, Sr) : null;
1108
1112
  };
1109
- function Tr(e) {
1113
+ function Lr(e) {
1110
1114
  const t = [];
1111
1115
  let n = 0;
1112
1116
  const r = e.ownerDocument.createTreeWalker(e, NodeFilter.SHOW_TEXT);
1113
1117
  for (let o = r.nextNode(); o && n < 320; o = r.nextNode()) {
1114
1118
  const i = o.parentElement;
1115
- if (i && i !== e && ne(i)) continue;
1119
+ if (i && i !== e && ae(i)) continue;
1116
1120
  const l = o.nodeValue ?? "";
1117
1121
  l.trim() && (t.push(l), n += l.length);
1118
1122
  }
1119
1123
  return t.join(" ");
1120
1124
  }
1121
- function _r(e, t) {
1125
+ function Ar(e, t) {
1122
1126
  const n = e.getAttribute("role")?.trim().split(/\s+/)[0];
1123
- return n || (t === "input" ? Sr[e.type] ?? "textbox" : t === "a" && !e.hasAttribute("href") ? null : Er[t] ?? null);
1127
+ return n || (t === "input" ? _r[e.type] ?? "textbox" : t === "a" && !e.hasAttribute("href") ? null : Tr[t] ?? null);
1124
1128
  }
1125
- function Ar(e) {
1129
+ function Ir(e) {
1126
1130
  const t = (e.getAttribute("aria-labelledby")?.split(/\s+/).filter(Boolean) ?? []).map((n) => {
1127
1131
  const r = e.ownerDocument.getElementById(n);
1128
- return r && !ne(r) ? r.textContent ?? "" : "";
1132
+ return r && !ae(r) ? r.textContent ?? "" : "";
1129
1133
  });
1130
- return z(t.join(" "));
1134
+ return j(t.join(" "));
1131
1135
  }
1132
- function Lr(e, t) {
1133
- const n = z(e.getAttribute("aria-label")) ?? Ar(e) ?? (t === "img" ? z(e.getAttribute("alt")) : null) ?? z(e.getAttribute("title"));
1136
+ function Rr(e, t) {
1137
+ const n = j(e.getAttribute("aria-label")) ?? Ir(e) ?? (t === "img" ? j(e.getAttribute("alt")) : null) ?? j(e.getAttribute("title"));
1134
1138
  if (n) return n;
1135
1139
  if (t === "input" || t === "textarea" || t === "select") {
1136
- const r = e.getAttribute("id"), o = r ? e.ownerDocument.querySelector(`label[for="${CSS.escape(r)}"]`) : null, i = o && !ne(o) ? o.textContent : null;
1137
- return z(i) ?? z(e.getAttribute("placeholder"));
1140
+ const r = e.getAttribute("id"), o = r ? e.ownerDocument.querySelector(`label[for="${CSS.escape(r)}"]`) : null, i = o && !ae(o) ? o.textContent : null;
1141
+ return j(i) ?? j(e.getAttribute("placeholder"));
1138
1142
  }
1139
- return z(Tr(e));
1143
+ return j(Lr(e));
1140
1144
  }
1141
- function Rr(e) {
1145
+ function Nr(e) {
1142
1146
  if (!e) return null;
1143
1147
  try {
1144
1148
  const t = new URL(e, document.baseURI);
@@ -1147,52 +1151,52 @@ function Rr(e) {
1147
1151
  return null;
1148
1152
  }
1149
1153
  }
1150
- function Ir(e) {
1151
- const t = e.tagName.toLowerCase(), n = ne(e), r = {
1154
+ function Or(e) {
1155
+ const t = e.tagName.toLowerCase(), n = ae(e), r = {
1152
1156
  tag: t,
1153
- role: _r(e, t),
1154
- name: n ? null : Lr(e, t)
1157
+ role: Ar(e, t),
1158
+ name: n ? null : Rr(e, t)
1155
1159
  };
1156
1160
  return e instanceof HTMLImageElement && (r.image = {
1157
- src: n ? null : Rr(e.currentSrc || e.getAttribute("src") || ""),
1161
+ src: n ? null : Nr(e.currentSrc || e.getAttribute("src") || ""),
1158
1162
  loaded: e.complete && e.naturalWidth > 0
1159
1163
  }), r;
1160
1164
  }
1161
- var Cr = /\b(se deconnecter|deconnexion|log ?out|sign ?out)\b/, Or = /\/(logout|log-out|signout|sign-out|deconnexion)\b/i, kr = 'a, button, [role="button"], [role="menuitem"], input[type="submit"], input[type="button"]', Nr = 3;
1162
- function Me(e) {
1165
+ var Cr = /\b(se deconnecter|deconnexion|log ?out|sign ?out)\b/, kr = /\/(logout|log-out|signout|sign-out|deconnexion)\b/i, Mr = 'a, button, [role="button"], [role="menuitem"], input[type="submit"], input[type="button"]', xr = 3;
1166
+ function Be(e) {
1163
1167
  return (e ?? "").normalize("NFD").replace(/[̀-ͯ]/g, "").replace(/\s+/g, " ").trim().toLowerCase();
1164
1168
  }
1165
- function Mr(e) {
1169
+ function Fr(e) {
1166
1170
  const t = e.getAttribute("aria-label");
1167
1171
  return t || (e instanceof HTMLInputElement ? e.value : e.textContent ?? "");
1168
1172
  }
1169
- function xr(e) {
1170
- for (const t of Array.from(e.querySelectorAll(kr))) {
1171
- if (Cr.test(Me(Mr(t)))) return !0;
1173
+ function Dr(e) {
1174
+ for (const t of Array.from(e.querySelectorAll(Mr))) {
1175
+ if (Cr.test(Be(Fr(t)))) return !0;
1172
1176
  const n = t.getAttribute("href");
1173
- if (n && Or.test(n)) return !0;
1177
+ if (n && kr.test(n)) return !0;
1174
1178
  }
1175
1179
  return !1;
1176
1180
  }
1177
- function Dr(e, t) {
1178
- const n = Me(t);
1179
- return n.length < Nr || !e.body ? !1 : Me(e.body.innerText ?? e.body.textContent).includes(n);
1180
- }
1181
1181
  function Pr(e, t) {
1182
- return Dr(e, t) ? "same-account" : xr(e) ? "signed-in" : "unknown";
1182
+ const n = Be(t);
1183
+ return n.length < xr || !e.body ? !1 : Be(e.body.innerText ?? e.body.textContent).includes(n);
1183
1184
  }
1184
- var Fr = 100, $r = 800, Br = [
1185
+ function $r(e, t) {
1186
+ return Pr(e, t) ? "same-account" : Dr(e) ? "signed-in" : "unknown";
1187
+ }
1188
+ var Br = 100, qr = 800, Ur = [
1185
1189
  "hidden",
1186
1190
  "class",
1187
1191
  "style",
1188
1192
  "type",
1189
1193
  "disabled",
1190
1194
  "aria-hidden"
1191
- ], be = 'input[type="password"]', Lt = 'input[autocomplete="username"], input[autocomplete="email"], input[type="email"]', ye = `${be}, ${Lt}`, pe = /\b(connexion|se connecter|connectez[- ]vous|s'identifier|identifiez[- ]vous|login|log ?in|sign ?in)\b/, xe = /\b(inscription|s'inscrire|inscrivez|creer (un|votre|mon) compte|sign ?up|register|create (an |your )?account|mot de passe oublie|oublie|reinitialiser|forgot|reset|lien de connexion|magic link|envoyer (un|le) lien|send (me )?(a |the )?link|code|newsletter|abonner|subscribe|enregistrer|sauvegarder|mettre a jour|save|update|confirmer|confirm|supprimer mon compte|delete account|payer|pay)\b/, qr = /\b(inscription|s'inscrire|inscrivez|creer (un|votre|mon) compte|sign ?up|create (an |your )?account|mot de passe oublie|reinitialiser|forgot|lien de connexion|magic link|envoyer (un|le) lien|send (me )?(a |the )?link|newsletter|abonner|subscribe)\b/, Hr = /\b(afficher|masquer|voir|show|hide|toggle)\b/, Ur = /\b(effacer|vider|supprimer|clear|reset)\b/, Gr = /[\u{1F441}\u{1F576}\u{1F440}]/u;
1192
- function Q(e) {
1195
+ ], Te = 'input[type="password"]', At = 'input[autocomplete="username"], input[autocomplete="email"], input[type="email"]', _e = `${Te}, ${At}`, ve = /\b(connexion|se connecter|connectez[- ]vous|s'identifier|identifiez[- ]vous|login|log ?in|sign ?in)\b/, qe = /\b(inscription|s'inscrire|inscrivez|creer (un|votre|mon) compte|sign ?up|register|create (an |your )?account|mot de passe oublie|oublie|reinitialiser|forgot|reset|lien de connexion|magic link|envoyer (un|le) lien|send (me )?(a |the )?link|code|newsletter|abonner|subscribe|enregistrer|sauvegarder|mettre a jour|save|update|confirmer|confirm|supprimer mon compte|delete account|payer|pay)\b/, Hr = /\b(inscription|s'inscrire|inscrivez|creer (un|votre|mon) compte|sign ?up|create (an |your )?account|mot de passe oublie|reinitialiser|forgot|lien de connexion|magic link|envoyer (un|le) lien|send (me )?(a |the )?link|newsletter|abonner|subscribe)\b/, Gr = /\b(afficher|masquer|voir|show|hide|toggle)\b/, Wr = /\b(effacer|vider|supprimer|clear|reset)\b/, Vr = /[\u{1F441}\u{1F576}\u{1F440}]/u;
1196
+ function re(e) {
1193
1197
  return (e ?? "").normalize("NFD").replace(/[̀-ͯ]/g, "").replace(/[’‘]/g, "'").replace(/\s+/g, " ").trim().toLowerCase();
1194
1198
  }
1195
- function re(e) {
1199
+ function le(e) {
1196
1200
  let t = e;
1197
1201
  for (; t; ) {
1198
1202
  if (t.hasAttribute("hidden") || t.getAttribute("aria-hidden") === "true" || t instanceof HTMLInputElement && t.type === "hidden") return !1;
@@ -1202,43 +1206,43 @@ function re(e) {
1202
1206
  }
1203
1207
  return !0;
1204
1208
  }
1205
- function X(e, t) {
1206
- return Array.from(e.querySelectorAll(t)).filter(re);
1209
+ function Y(e, t) {
1210
+ return Array.from(e.querySelectorAll(t)).filter(le);
1207
1211
  }
1208
- function Wr(e) {
1212
+ function zr(e) {
1209
1213
  return e ? e instanceof HTMLInputElement ? e.value : e.textContent ?? "" : "";
1210
1214
  }
1211
- function Rt(e, t) {
1215
+ function It(e, t) {
1212
1216
  return !e.outsideForms || !t.closest("form");
1213
1217
  }
1214
- function ae(e, t) {
1215
- return Array.from(e.scope.querySelectorAll(t)).filter((n) => re(n) && Rt(e, n));
1218
+ function pe(e, t) {
1219
+ return Array.from(e.scope.querySelectorAll(t)).filter((n) => le(n) && It(e, n));
1216
1220
  }
1217
- function he(e) {
1218
- return Q(e.getAttribute("aria-label") ?? e.getAttribute("title") ?? e.textContent);
1221
+ function we(e) {
1222
+ return re(e.getAttribute("aria-label") ?? e.getAttribute("title") ?? e.textContent);
1219
1223
  }
1220
- function Vr(e) {
1221
- const t = he(e);
1222
- return Hr.test(t) || Gr.test(t);
1224
+ function Kr(e) {
1225
+ const t = we(e);
1226
+ return Gr.test(t) || Vr.test(t);
1223
1227
  }
1224
- function zr(e, t) {
1228
+ function jr(e, t) {
1225
1229
  if (e.getAttribute("type") === "submit" || !t) return !1;
1226
1230
  const n = e.parentElement;
1227
- return !n || X(n, ye).length === 0 ? !1 : !n.contains(t);
1231
+ return !n || Y(n, _e).length === 0 ? !1 : !n.contains(t);
1228
1232
  }
1229
- var jr = 'button, input[type="submit"], input[type="button"], input[type="image"], a[href]';
1230
- function Xr(e) {
1231
- return Array.from(e.querySelectorAll(jr)).some(re);
1233
+ var Xr = 'button, input[type="submit"], input[type="button"], input[type="image"], a[href]';
1234
+ function Yr(e) {
1235
+ return Array.from(e.querySelectorAll(Xr)).some(le);
1232
1236
  }
1233
- function Kr(e, t) {
1237
+ function Zr(e, t) {
1234
1238
  let n = e.parentElement;
1235
1239
  for (; n && !n.contains(t); ) {
1236
- if (Xr(n)) return !0;
1240
+ if (Yr(n)) return !0;
1237
1241
  n = n.parentElement;
1238
1242
  }
1239
1243
  return !1;
1240
1244
  }
1241
- function Yr(e) {
1245
+ function Qr(e) {
1242
1246
  const t = [
1243
1247
  e.getAttribute("name"),
1244
1248
  e.getAttribute("id"),
@@ -1250,30 +1254,30 @@ function Yr(e) {
1250
1254
  const r = e.ownerDocument.querySelector(`label[for="${CSS.escape(n)}"]`);
1251
1255
  r && t.push(r.textContent);
1252
1256
  }
1253
- return Q(t.filter(Boolean).join(" "));
1257
+ return re(t.filter(Boolean).join(" "));
1254
1258
  }
1255
- function Zr(e, t) {
1259
+ function Jr(e, t) {
1256
1260
  const n = e.parentElement;
1257
1261
  if (!n) return null;
1258
- const r = e.ownerDocument.body, o = (u) => t ? It({
1262
+ const r = e.ownerDocument.body, o = (u) => t ? Rt({
1259
1263
  scope: u,
1260
1264
  outsideForms: !0
1261
- }, t) : e, i = (u) => De({
1265
+ }, t) : e, i = (u) => Ue({
1262
1266
  scope: u,
1263
1267
  outsideForms: !0
1264
1268
  }, e, o(u)), l = (u) => !!o(u) && !!i(u);
1265
1269
  let c = n, s = null;
1266
1270
  const a = (u) => {
1267
- const d = i(u);
1268
- d && !s && pe.test(he(d)) && (s = u);
1271
+ const f = i(u);
1272
+ f && !s && ve.test(we(f)) && (s = u);
1269
1273
  };
1270
1274
  for (a(n); c !== r && !l(c); ) {
1271
1275
  const u = c.parentElement;
1272
1276
  if (!u || u.querySelector("form")) break;
1273
- const d = [e], p = o(c);
1274
- p && p !== e && d.push(p);
1275
- const h = !!p;
1276
- if (X(u, ye).filter((b) => !b.closest("form") && !d.includes(b)).some((b) => b.matches(be) || h || xe.test(Yr(b)) ? !0 : Kr(b, e))) break;
1277
+ const f = [e], d = o(c);
1278
+ d && d !== e && f.push(d);
1279
+ const p = !!d;
1280
+ if (Y(u, _e).filter((y) => !y.closest("form") && !f.includes(y)).some((y) => y.matches(Te) || p || qe.test(Qr(y)) ? !0 : Zr(y, e))) break;
1277
1281
  c = u, a(u);
1278
1282
  }
1279
1283
  return {
@@ -1285,24 +1289,24 @@ function at(e, t, n) {
1285
1289
  return e ? {
1286
1290
  scope: e,
1287
1291
  outsideForms: !1
1288
- } : Zr(t, n);
1292
+ } : Jr(t, n);
1289
1293
  }
1290
- function Qr(e, t) {
1294
+ function eo(e, t) {
1291
1295
  let n = e.parentElement;
1292
1296
  for (; n && n !== t.scope; ) {
1293
- if (X(n, ye).length === 1) return !0;
1297
+ if (Y(n, _e).length === 1) return !0;
1294
1298
  n = n.parentElement;
1295
1299
  }
1296
1300
  return !1;
1297
1301
  }
1298
- function De(e, t, n) {
1299
- const r = (s) => !!(t.compareDocumentPosition(s) & Node.DOCUMENT_POSITION_FOLLOWING), o = Array.from(e.scope.querySelectorAll('button, input[type="submit"]')).filter((s) => re(s) && Rt(e, s) && (s.getAttribute("type") === "submit" || r(s)) && !Vr(s) && !Ur.test(he(s)) && !zr(s, n));
1302
+ function Ue(e, t, n) {
1303
+ const r = (s) => !!(t.compareDocumentPosition(s) & Node.DOCUMENT_POSITION_FOLLOWING), o = Array.from(e.scope.querySelectorAll('button, input[type="submit"]')).filter((s) => le(s) && It(e, s) && (s.getAttribute("type") === "submit" || r(s)) && !Kr(s) && !Wr.test(we(s)) && !jr(s, n));
1300
1304
  if (o.length === 0) return null;
1301
1305
  const i = (s, a) => {
1302
1306
  const u = r(s);
1303
1307
  return [
1304
- Qr(s, e) ? 1 : 0,
1305
- pe.test(he(s)) ? 0 : 1,
1308
+ eo(s, e) ? 1 : 0,
1309
+ ve.test(we(s)) ? 0 : 1,
1306
1310
  s.getAttribute("type") === "submit" ? 0 : 1,
1307
1311
  u ? 0 : 1,
1308
1312
  u ? a : -a
@@ -1311,19 +1315,19 @@ function De(e, t, n) {
1311
1315
  let l = o[0], c = i(l, 0);
1312
1316
  return o.forEach((s, a) => {
1313
1317
  const u = i(s, a);
1314
- for (let d = 0; d < u.length; d++) {
1315
- const p = u[d], h = c[d];
1316
- if (p !== h) {
1317
- p < h && (l = s, c = u);
1318
+ for (let f = 0; f < u.length; f++) {
1319
+ const d = u[f], p = c[f];
1320
+ if (d !== p) {
1321
+ d < p && (l = s, c = u);
1318
1322
  return;
1319
1323
  }
1320
1324
  }
1321
1325
  }), l;
1322
1326
  }
1323
1327
  function lt(e) {
1324
- return e.querySelectorAll("form").length + (X(e, ye).some((t) => !t.closest("form")) ? 1 : 0) === 1;
1328
+ return e.querySelectorAll("form").length + (Y(e, _e).some((t) => !t.closest("form")) ? 1 : 0) === 1;
1325
1329
  }
1326
- function Jr(e, t) {
1330
+ function to(e, t) {
1327
1331
  if (e) {
1328
1332
  const n = e.getAttribute("aria-label");
1329
1333
  if (n) return n;
@@ -1354,45 +1358,45 @@ function Jr(e, t) {
1354
1358
  return (t instanceof Document ? t.body : t)?.querySelector("h1, h2, h3")?.textContent ?? "";
1355
1359
  }
1356
1360
  function ct(e, t, n) {
1357
- const r = Q(Wr(n)), o = Q(Jr(e, t)), i = (e?.getAttribute("action") ?? "").split("?")[0], l = Q([
1361
+ const r = re(zr(n)), o = re(to(e, t)), i = (e?.getAttribute("action") ?? "").split("?")[0], l = re([
1358
1362
  e?.id,
1359
1363
  e?.getAttribute("name"),
1360
1364
  e?.className,
1361
1365
  i
1362
1366
  ].filter(Boolean).join(" "));
1363
1367
  return {
1364
- positive: pe.test(r) || pe.test(o),
1365
- negative: xe.test(r) || xe.test(o) || qr.test(l)
1368
+ positive: ve.test(r) || ve.test(o),
1369
+ negative: qe.test(r) || qe.test(o) || Hr.test(l)
1366
1370
  };
1367
1371
  }
1368
- function It(e, t) {
1369
- const n = ae(e, 'input[autocomplete="username"]')[0] ?? ae(e, 'input[autocomplete="email"]')[0] ?? ae(e, 'input[type="email"]')[0];
1372
+ function Rt(e, t) {
1373
+ const n = pe(e, 'input[autocomplete="username"]')[0] ?? pe(e, 'input[autocomplete="email"]')[0] ?? pe(e, 'input[type="email"]')[0];
1370
1374
  if (n) return n;
1371
1375
  if (!t) return null;
1372
- const r = ae(e, 'input[type="text"], input:not([type])').filter((o) => o.compareDocumentPosition(t) & Node.DOCUMENT_POSITION_FOLLOWING);
1376
+ const r = pe(e, 'input[type="text"], input:not([type])').filter((o) => o.compareDocumentPosition(t) & Node.DOCUMENT_POSITION_FOLLOWING);
1373
1377
  return r[r.length - 1] ?? null;
1374
1378
  }
1375
- function _e(e, t) {
1379
+ function Oe(e, t) {
1376
1380
  if (t.querySelector('input[autocomplete="new-password"]')) return null;
1377
- const n = X(t, be);
1381
+ const n = Y(t, Te);
1378
1382
  if (n.length > 1) return null;
1379
1383
  if (n.length === 1) {
1380
1384
  const s = n[0], a = at(e, s, s);
1381
1385
  if (!a) return null;
1382
- const u = It(a, s), d = De(a, s, u), p = ct(e, t, d);
1383
- return !(s.autocomplete === "current-password" || p.positive) || p.negative ? null : {
1386
+ const u = Rt(a, s), f = Ue(a, s, u), d = ct(e, t, f);
1387
+ return !(s.autocomplete === "current-password" || d.positive) || d.negative ? null : {
1384
1388
  kind: "password",
1385
1389
  form: e,
1386
1390
  identifier: u,
1387
1391
  password: s,
1388
- submit: d
1392
+ submit: f
1389
1393
  };
1390
1394
  }
1391
- const r = X(t, Lt);
1395
+ const r = Y(t, At);
1392
1396
  if (r.length !== 1) return null;
1393
1397
  const o = r[0], i = at(e, o, null);
1394
1398
  if (!i) return null;
1395
- const l = De(i, o, o), c = ct(e, t, l);
1399
+ const l = Ue(i, o, o), c = ct(e, t, l);
1396
1400
  return !(o.autocomplete === "username" || c.positive) || c.negative ? null : {
1397
1401
  kind: "identifier",
1398
1402
  form: e,
@@ -1401,22 +1405,22 @@ function _e(e, t) {
1401
1405
  submit: l
1402
1406
  };
1403
1407
  }
1404
- function le(e = document) {
1408
+ function me(e = document) {
1405
1409
  const t = Array.from(e.querySelectorAll("form"));
1406
1410
  for (const n of t) {
1407
- const r = _e(n, n);
1411
+ const r = Oe(n, n);
1408
1412
  if (r) return r;
1409
1413
  }
1410
- return t.length === 0 || X(e, be).find((n) => !n.closest("form")) ? _e(null, e) : null;
1414
+ return t.length === 0 || Y(e, Te).find((n) => !n.closest("form")) ? Oe(null, e) : null;
1411
1415
  }
1412
1416
  function ut(e, t) {
1413
1417
  const n = Object.getPrototypeOf(e), r = Object.getOwnPropertyDescriptor(n, "value")?.set ?? Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set;
1414
1418
  r ? r.call(e, t) : e.value = t, e.dispatchEvent(new Event("input", { bubbles: !0 })), e.dispatchEvent(new Event("change", { bubbles: !0 }));
1415
1419
  }
1416
- function eo(e) {
1420
+ function no(e) {
1417
1421
  return !!e.form || !!e.submit;
1418
1422
  }
1419
- function to(e) {
1423
+ function ro(e) {
1420
1424
  const t = e.form, n = t?.noValidate;
1421
1425
  t && (t.noValidate = !0);
1422
1426
  try {
@@ -1425,28 +1429,28 @@ function to(e) {
1425
1429
  t && (t.noValidate = n ?? !1);
1426
1430
  }
1427
1431
  }
1428
- var no = {
1432
+ var oo = {
1429
1433
  identifier: null,
1430
1434
  password: null
1431
1435
  };
1432
1436
  function ft(e, t) {
1433
1437
  return !e || e.disabled || e.readOnly ? !1 : e.value === "" || t !== null && e.value === t;
1434
1438
  }
1435
- function Ct(e, t, n) {
1439
+ function Nt(e, t, n) {
1436
1440
  return {
1437
1441
  identifier: ft(e.identifier, n.identifier) && !t.identifier,
1438
1442
  password: ft(e.password, n.password) && !t.password
1439
1443
  };
1440
1444
  }
1441
- function ro(e, t, n) {
1445
+ function io(e, t, n) {
1442
1446
  const r = e.identifier;
1443
1447
  return !r || n.identifier ? !1 : r.value !== "" && r.value !== t.login;
1444
1448
  }
1445
- function oo(e, t, n, r = no) {
1446
- const o = Ct(e, n, r);
1447
- return !o.identifier && !o.password ? { error: "nothing-to-fill" } : ro(e, t, o) ? { error: "identifier-mismatch" } : eo(e) ? (o.identifier && ut(e.identifier, t.login), o.password && ut(e.password, t.password), to(e) ? { step: o.identifier && o.password ? "both" : o.password ? "password" : "identifier" } : { error: "no-submit" }) : { error: "no-submit" };
1449
+ function so(e, t, n, r = oo) {
1450
+ const o = Nt(e, n, r);
1451
+ return !o.identifier && !o.password ? { error: "nothing-to-fill" } : io(e, t, o) ? { error: "identifier-mismatch" } : no(e) ? (o.identifier && ut(e.identifier, t.login), o.password && ut(e.password, t.password), ro(e) ? { step: o.identifier && o.password ? "both" : o.password ? "password" : "identifier" } : { error: "no-submit" }) : { error: "no-submit" };
1448
1452
  }
1449
- function io(e) {
1453
+ function ao(e) {
1450
1454
  if (typeof window > "u" || typeof MutationObserver > "u") return {
1451
1455
  watch() {
1452
1456
  },
@@ -1466,22 +1470,22 @@ function io(e) {
1466
1470
  }, o = !1, i = null, l = null, c = null, s = null, a = 0;
1467
1471
  const u = () => {
1468
1472
  c && clearTimeout(c), c = null;
1469
- }, d = () => {
1473
+ }, f = () => {
1470
1474
  s && clearTimeout(s), s = null, a = 0;
1475
+ }, d = () => {
1476
+ if (s = null, a = 0, !t || n.identifier || n.password || me(document)) return;
1477
+ const E = $r(document, t.login);
1478
+ t = null, e.onNoForm(E);
1471
1479
  }, p = () => {
1472
- if (s = null, a = 0, !t || n.identifier || n.password || le(document)) return;
1473
- const v = Pr(document, t.login);
1474
- t = null, e.onNoForm(v);
1475
- }, h = () => {
1476
1480
  if (!a) return;
1477
1481
  s && clearTimeout(s);
1478
- const v = Math.max(0, a - Date.now());
1479
- s = setTimeout(p, Math.min($r, v));
1480
- }, b = () => {
1481
- i?.disconnect(), i = null, u(), d(), l && clearTimeout(l), l = null;
1482
- }, E = () => {
1483
- const v = le(document);
1484
- if (e.onMatch?.(v), !v) {
1482
+ const E = Math.max(0, a - Date.now());
1483
+ s = setTimeout(d, Math.min(qr, E));
1484
+ }, y = () => {
1485
+ i?.disconnect(), i = null, u(), f(), l && clearTimeout(l), l = null;
1486
+ }, S = () => {
1487
+ const E = me(document);
1488
+ if (e.onMatch?.(E), !E) {
1485
1489
  o = !1, r = {
1486
1490
  identifier: null,
1487
1491
  password: null
@@ -1491,8 +1495,8 @@ function io(e) {
1491
1495
  if (!t)
1492
1496
  o || (o = !0, e.onDetected());
1493
1497
  else {
1494
- const _ = Ct(v, n, r), L = oo(v, t, n, r);
1495
- if ("error" in L || (_.identifier && (n = {
1498
+ const _ = Nt(E, n, r), A = so(E, t, n, r);
1499
+ if ("error" in A || (_.identifier && (n = {
1496
1500
  ...n,
1497
1501
  identifier: !0
1498
1502
  }, r = {
@@ -1504,46 +1508,46 @@ function io(e) {
1504
1508
  }, r = {
1505
1509
  ...r,
1506
1510
  password: t.password
1507
- })), "error" in L) {
1508
- const k = L.error !== "nothing-to-fill" ? L.error : !n.identifier && !n.password ? "already-filled" : null;
1509
- k && (e.onError(k), t = null, b());
1511
+ })), "error" in A) {
1512
+ const M = A.error !== "nothing-to-fill" ? A.error : !n.identifier && !n.password ? "already-filled" : null;
1513
+ M && (e.onError(M), t = null, y());
1510
1514
  } else
1511
- e.onFilled(L.step), n.password && (t = null, u(), c = setTimeout(() => {
1512
- c = null, le(document) && (o = !0, e.onDetected());
1513
- }, Ft));
1515
+ e.onFilled(A.step), n.password && (t = null, u(), c = setTimeout(() => {
1516
+ c = null, me(document) && (o = !0, e.onDetected());
1517
+ }, Bt));
1514
1518
  }
1515
- }, A = () => {
1516
- h(), l && clearTimeout(l), l = setTimeout(() => {
1517
- l = null, E();
1518
- }, Fr);
1519
- }, S = () => {
1520
- i || (i = new MutationObserver(A), i.observe(document.body, {
1519
+ }, R = () => {
1520
+ p(), l && clearTimeout(l), l = setTimeout(() => {
1521
+ l = null, S();
1522
+ }, Br);
1523
+ }, v = () => {
1524
+ i || (i = new MutationObserver(R), i.observe(document.body, {
1521
1525
  childList: !0,
1522
1526
  subtree: !0,
1523
1527
  attributes: !0,
1524
- attributeFilter: Br
1528
+ attributeFilter: Ur
1525
1529
  }));
1526
1530
  };
1527
1531
  return {
1528
1532
  watch() {
1529
- i || (o = !1, S()), E();
1533
+ i || (o = !1, v()), S();
1530
1534
  },
1531
- fill(v) {
1532
- d(), t = v, S(), E(), t && !n.identifier && !n.password && !le(document) && (a = Date.now() + $t, h());
1535
+ fill(E) {
1536
+ f(), t = E, v(), S(), t && !n.identifier && !n.password && !me(document) && (a = Date.now() + qt, p());
1533
1537
  },
1534
1538
  cancel() {
1535
1539
  t = null, n = {
1536
1540
  identifier: !1,
1537
1541
  password: !1
1538
- }, o = !1, b(), e.onMatch?.(null);
1542
+ }, o = !1, y(), e.onMatch?.(null);
1539
1543
  },
1540
1544
  teardown() {
1541
- t = null, b(), e.onMatch?.(null);
1545
+ t = null, y(), e.onMatch?.(null);
1542
1546
  }
1543
1547
  };
1544
1548
  }
1545
- var ce = 0.5;
1546
- function so(e) {
1549
+ var lo = 500, he = 0.5;
1550
+ function co(e) {
1547
1551
  const t = e?.identifier ?? e?.password ?? null;
1548
1552
  if (!e || !t) return null;
1549
1553
  const n = [e.identifier, e.password].filter((r) => r !== null);
@@ -1553,143 +1557,189 @@ function so(e) {
1553
1557
  inputs: n
1554
1558
  };
1555
1559
  }
1556
- var ue = (e) => Math.round(e * 2) / 2;
1557
- function ao(e, t) {
1558
- return e === null || t === null ? e === t : Math.abs(e.x - t.x) <= ce && Math.abs(e.y - t.y) <= ce && Math.abs(e.width - t.width) <= ce && Math.abs(e.height - t.height) <= ce;
1560
+ var ge = (e) => Math.round(e * 2) / 2;
1561
+ function uo(e, t) {
1562
+ return e === null || t === null ? e === t : e.crowded === t.crowded && Math.abs(e.x - t.x) <= he && Math.abs(e.y - t.y) <= he && Math.abs(e.width - t.width) <= he && Math.abs(e.height - t.height) <= he;
1559
1563
  }
1560
- function lo(e, t) {
1564
+ function fo(e, t) {
1561
1565
  if (typeof document.elementFromPoint != "function") return !1;
1562
1566
  const n = t.left + t.width / 2, r = t.top + t.height / 2;
1563
1567
  if (n < 0 || r < 0 || n >= window.innerWidth || r >= window.innerHeight) return !1;
1564
1568
  const o = document.elementFromPoint(n, r);
1565
1569
  return !o || o === e || e.contains(o) ? !1 : !Array.from(e.labels ?? []).some((i) => i.contains(o));
1566
1570
  }
1567
- function co(e) {
1568
- if (!e.isConnected || !re(e)) return null;
1571
+ var po = 8, mo = [24, 32], ho = "button, a[href], input, select, textarea, [role=button], [tabindex]";
1572
+ function go(e, t) {
1573
+ if (typeof document.elementFromPoint != "function") return !1;
1574
+ const n = t.top + t.height / 2;
1575
+ return mo.some((r) => {
1576
+ const o = t.right - po - r / 2;
1577
+ if (o <= t.left || o < 0 || n < 0 || o >= window.innerWidth || n >= window.innerHeight) return !1;
1578
+ const i = document.elementFromPoint(o, n)?.closest(ho);
1579
+ return !!i && !i.contains(e);
1580
+ });
1581
+ }
1582
+ function yo(e) {
1583
+ if (!e.isConnected || !le(e)) return null;
1569
1584
  const t = e.getBoundingClientRect();
1570
- return t.width <= 0 || t.height <= 0 || t.right <= 0 || t.bottom <= 0 || t.left >= window.innerWidth || t.top >= window.innerHeight || lo(e, t) ? null : {
1571
- x: ue(t.left),
1572
- y: ue(t.top),
1573
- width: ue(t.width),
1574
- height: ue(t.height)
1585
+ return t.width <= 0 || t.height <= 0 || t.right <= 0 || t.bottom <= 0 || t.left >= window.innerWidth || t.top >= window.innerHeight || fo(e, t) ? null : {
1586
+ x: ge(t.left),
1587
+ y: ge(t.top),
1588
+ width: ge(t.width),
1589
+ height: ge(t.height),
1590
+ ...go(e, t) ? { crowded: !0 } : {}
1575
1591
  };
1576
1592
  }
1577
- function uo(e, t = {}) {
1593
+ function bo(e, t = {}) {
1578
1594
  if (typeof window > "u") return {
1579
1595
  track() {
1580
1596
  },
1597
+ focusField() {
1598
+ },
1581
1599
  teardown() {
1582
1600
  }
1583
1601
  };
1584
- const n = t.frame ?? ((f) => window.requestAnimationFrame(() => f())), r = t.trusted ?? ((f) => f.isTrusted);
1585
- let o = null, i = null, l = !1, c = !1, s = Number.NEGATIVE_INFINITY, a = null, u = null, d = null;
1586
- const p = () => {
1602
+ const n = t.frame ?? ((h) => window.requestAnimationFrame(() => h())), r = t.trusted ?? ((h) => h.isTrusted);
1603
+ let o = null, i = null, l = !1, c = !1, s = Number.NEGATIVE_INFINITY, a = Number.NEGATIVE_INFINITY, u = Number.NEGATIVE_INFINITY, f = !1, d = !1, p = null, y = null, S = null;
1604
+ const R = () => {
1587
1605
  if (c = !1, !o) return;
1588
- const f = co(o.field);
1589
- i && i.scrolling === l && ao(i.rect, f) || (i = {
1590
- rect: f,
1606
+ const h = yo(o.field);
1607
+ i && i.scrolling === l && uo(i.rect, h) || (i = {
1608
+ rect: h,
1591
1609
  scrolling: l
1592
- }, e.onAnchor(f, l));
1593
- }, h = () => {
1594
- !o || c || (c = !0, n(p));
1595
- }, b = (f) => {
1610
+ }, e.onAnchor(h, l));
1611
+ }, v = () => {
1612
+ !o || c || (c = !0, n(R));
1613
+ }, E = (h) => {
1596
1614
  if (!o) return;
1597
- const m = f.target;
1598
- m instanceof Node && !m.contains(o.field) || (l = !0, a && clearTimeout(a), a = setTimeout(() => {
1599
- a = null, l = !1, h();
1600
- }, 150), h());
1601
- }, E = () => {
1602
- const f = Date.now();
1603
- f - s < 250 || (s = f, e.onInteraction());
1604
- }, A = /* @__PURE__ */ new Set(), S = (f) => f.pointerType === "touch", v = (f) => f.pointerId ?? 0, _ = (f) => {
1605
- !o || !r(f) || (S(f) ? A.add(v(f)) : E());
1606
- }, L = (f) => {
1607
- o && r(f) && S(f) && A.delete(v(f)) && E();
1608
- }, k = (f) => {
1609
- A.delete(v(f));
1610
- }, D = (f) => {
1611
- if (!o || !r(f) || !(f.target instanceof Node)) return;
1612
- const m = f.target;
1613
- (o.scope ? o.scope.contains(m) : o.inputs.some((y) => y === m)) && E();
1615
+ const O = h.target;
1616
+ O instanceof Node && !O.contains(o.field) || (l = !0, p && clearTimeout(p), p = setTimeout(() => {
1617
+ p = null, l = !1, v();
1618
+ }, 150), v());
1619
+ }, _ = () => {
1620
+ const h = Date.now();
1621
+ h - s < 250 || (s = h, e.onInteraction());
1622
+ }, A = /* @__PURE__ */ new Set(), M = (h) => h.pointerType === "touch", D = (h) => h.pointerId ?? 0, N = () => {
1623
+ e.onFieldFocus(), s = Number.NEGATIVE_INFINITY;
1624
+ }, k = (h) => {
1625
+ if (!o || (h.button ?? 0) !== 0) return;
1626
+ const O = h.target;
1627
+ if (!(O instanceof Node)) return;
1628
+ const H = o.field;
1629
+ !H.contains(O) && !Array.from(H.labels ?? []).some((Q) => Q.contains(O)) || (a = Date.now(), document.activeElement === H && N());
1630
+ }, z = (h) => {
1631
+ !o || !r(h) || (u = Date.now(), M(h) ? A.add(D(h)) : (_(), k(h)));
1632
+ }, V = (h) => {
1633
+ o && r(h) && (u = Date.now()), o && r(h) && M(h) && A.delete(D(h)) && (_(), k(h));
1634
+ }, m = (h) => {
1635
+ if (!o) return;
1636
+ const O = f;
1637
+ f = !1, !(h.target !== o.field || O || d || !r(h)) && (Date.now() - a > 1e3 || (_(), N()));
1638
+ }, b = (h) => {
1639
+ !o || h.target !== o.field || !r(h) || h.relatedTarget instanceof Node && _();
1640
+ }, w = (h) => {
1641
+ !r(h) || Date.now() - u <= lo || (a = Date.now());
1614
1642
  }, I = () => {
1615
- document.visibilityState === "visible" && h();
1616
- }, O = () => {
1617
- document.addEventListener("scroll", b, {
1643
+ o && document.activeElement === o.field && (f = !0);
1644
+ }, x = (h) => {
1645
+ if (!o || !r(h)) return;
1646
+ const { key: O, isComposing: H, shiftKey: Q, altKey: ce, ctrlKey: ue, metaKey: g } = h;
1647
+ O === "Tab" && (a = Date.now()), !(h.target !== o.field || H || Q || ce || ue || g) && $t(O) && e.onFieldKey(O);
1648
+ }, B = (h) => {
1649
+ A.delete(D(h));
1650
+ }, C = (h) => {
1651
+ if (!o || !r(h) || !(h.target instanceof Node)) return;
1652
+ const O = h.target;
1653
+ (o.scope ? o.scope.contains(O) : o.inputs.some((H) => H === O)) && _();
1654
+ }, P = () => {
1655
+ document.visibilityState === "visible" && v();
1656
+ }, U = () => {
1657
+ document.addEventListener("scroll", E, {
1618
1658
  capture: !0,
1619
1659
  passive: !0
1620
- }), window.addEventListener("resize", h), window.visualViewport?.addEventListener("resize", h), window.visualViewport?.addEventListener("scroll", h), document.addEventListener("pointerdown", _, !0), document.addEventListener("pointerup", L, !0), document.addEventListener("pointercancel", k, !0), document.addEventListener("input", D, !0), document.addEventListener("visibilitychange", I), u = setInterval(() => {
1621
- document.visibilityState === "visible" && h();
1660
+ }), window.addEventListener("resize", v), window.visualViewport?.addEventListener("resize", v), window.visualViewport?.addEventListener("scroll", v), document.addEventListener("pointerdown", z, !0), document.addEventListener("pointerup", V, !0), document.addEventListener("pointercancel", B, !0), document.addEventListener("input", C, !0), document.addEventListener("focusin", m, !0), document.addEventListener("focusout", b, !0), document.addEventListener("keydown", x, !0), window.addEventListener("focus", w), window.addEventListener("blur", I), document.addEventListener("visibilitychange", P), y = setInterval(() => {
1661
+ document.visibilityState === "visible" && v();
1622
1662
  }, 250);
1623
- }, V = () => {
1624
- document.removeEventListener("scroll", b, { capture: !0 }), window.removeEventListener("resize", h), window.visualViewport?.removeEventListener("resize", h), window.visualViewport?.removeEventListener("scroll", h), document.removeEventListener("pointerdown", _, !0), document.removeEventListener("pointerup", L, !0), document.removeEventListener("pointercancel", k, !0), document.removeEventListener("input", D, !0), A.clear(), document.removeEventListener("visibilitychange", I), u && clearInterval(u), a && clearTimeout(a), u = null, a = null, d?.disconnect(), d = null, l = !1, c = !1;
1625
- }, q = () => {
1626
- const f = o !== null;
1627
- o = null, V(), i = null, f && e.onAnchor(null, !1);
1663
+ }, Z = () => {
1664
+ document.removeEventListener("scroll", E, { capture: !0 }), window.removeEventListener("resize", v), window.visualViewport?.removeEventListener("resize", v), window.visualViewport?.removeEventListener("scroll", v), document.removeEventListener("pointerdown", z, !0), document.removeEventListener("pointerup", V, !0), document.removeEventListener("pointercancel", B, !0), document.removeEventListener("input", C, !0), document.removeEventListener("focusin", m, !0), document.removeEventListener("focusout", b, !0), document.removeEventListener("keydown", x, !0), window.removeEventListener("focus", w), window.removeEventListener("blur", I), A.clear(), f = !1, a = Number.NEGATIVE_INFINITY, u = Number.NEGATIVE_INFINITY, document.removeEventListener("visibilitychange", P), y && clearInterval(y), p && clearTimeout(p), y = null, p = null, S?.disconnect(), S = null, l = !1, c = !1;
1665
+ }, te = () => {
1666
+ const h = o !== null;
1667
+ o = null, Z(), i = null, h && e.onAnchor(null, !1);
1628
1668
  };
1629
1669
  return {
1630
- track(f) {
1631
- if (!f) {
1632
- q();
1670
+ track(h) {
1671
+ if (!h) {
1672
+ te();
1633
1673
  return;
1634
1674
  }
1635
- const m = o?.field === f.field, y = o !== null;
1636
- o = f, y || O(), m || (d?.disconnect(), d = typeof ResizeObserver > "u" ? null : new ResizeObserver(() => h()), d?.observe(f.field), i = null), h();
1675
+ const O = o?.field === h.field, H = o !== null;
1676
+ o = h, H || U(), O || (S?.disconnect(), S = typeof ResizeObserver > "u" ? null : new ResizeObserver(() => v()), S?.observe(h.field), i = null), v();
1677
+ },
1678
+ focusField() {
1679
+ if (o) {
1680
+ d = !0;
1681
+ try {
1682
+ o.field.focus({ preventScroll: !0 });
1683
+ } finally {
1684
+ d = !1;
1685
+ }
1686
+ }
1637
1687
  },
1638
- teardown: q
1688
+ teardown: te
1639
1689
  };
1640
1690
  }
1641
- var fo = "leesto/navigation";
1642
- function po(e) {
1691
+ var vo = "leesto/navigation";
1692
+ function wo(e) {
1643
1693
  const t = e?.timestamp;
1644
1694
  return typeof t == "number" ? t : void 0;
1645
1695
  }
1646
- function ho(e) {
1696
+ function Eo(e) {
1647
1697
  return e?.type === 4;
1648
1698
  }
1649
- function mo(e) {
1699
+ function So(e) {
1650
1700
  try {
1651
1701
  return JSON.stringify(e)?.length ?? 0;
1652
1702
  } catch {
1653
1703
  return 0;
1654
1704
  }
1655
1705
  }
1656
- function go(e) {
1657
- const t = e.now ?? Date.now, n = e.measure ?? mo;
1706
+ function To(e) {
1707
+ const t = e.now ?? Date.now, n = e.measure ?? So;
1658
1708
  let r = [], o = 0, i = !1, l = Number.NEGATIVE_INFINITY;
1659
1709
  const c = () => {
1660
1710
  const a = r.shift();
1661
1711
  a && (o -= a.bytes);
1662
1712
  }, s = () => {
1663
1713
  if (!i) {
1664
- const d = t() - e.windowMs;
1665
- for (; r.length > 1 && (r[1]?.start ?? Number.POSITIVE_INFINITY) <= d; ) c();
1714
+ const f = t() - e.windowMs;
1715
+ for (; r.length > 1 && (r[1]?.start ?? Number.POSITIVE_INFINITY) <= f; ) c();
1666
1716
  }
1667
1717
  const a = i ? e.heldMaxBytes : e.maxBytes;
1668
1718
  for (; o > a && r.length > 1; ) c();
1669
1719
  const u = r[r.length - 1];
1670
1720
  if (o > a && e.requestCheckout && (u?.events.length ?? 0) > 2) {
1671
- const d = t();
1672
- d - l >= e.minCheckoutIntervalMs && (l = d, e.requestCheckout());
1721
+ const f = t();
1722
+ f - l >= e.minCheckoutIntervalMs && (l = f, e.requestCheckout());
1673
1723
  }
1674
1724
  };
1675
1725
  return {
1676
1726
  push(a) {
1677
1727
  const u = n(a);
1678
- if (ho(a)) r.push({
1679
- start: po(a) ?? t(),
1728
+ if (Eo(a)) r.push({
1729
+ start: wo(a) ?? t(),
1680
1730
  events: [a],
1681
1731
  bytes: u
1682
1732
  });
1683
1733
  else {
1684
- const d = r[r.length - 1];
1685
- if (!d) return;
1686
- d.events.push(a), d.bytes += u;
1734
+ const f = r[r.length - 1];
1735
+ if (!f) return;
1736
+ f.events.push(a), f.bytes += u;
1687
1737
  }
1688
1738
  o += u, s();
1689
1739
  },
1690
1740
  snapshot() {
1691
1741
  const a = [];
1692
- for (const u of r) for (const d of u.events) a.push(d);
1742
+ for (const u of r) for (const f of u.events) a.push(f);
1693
1743
  return a;
1694
1744
  },
1695
1745
  hold() {
@@ -1713,44 +1763,44 @@ function go(e) {
1713
1763
  }
1714
1764
  };
1715
1765
  }
1716
- var Ot = 6e5, kt = 1e3, bo = {
1766
+ var Ot = 6e5, Ct = 1e3, _o = {
1717
1767
  mousemove: 100,
1718
1768
  scroll: 150
1719
- }, yo = {
1769
+ }, Lo = {
1720
1770
  windowMs: 12e4,
1721
1771
  checkoutEveryNms: 6e4,
1722
1772
  maxBytes: 8388608,
1723
1773
  heldMaxBytes: 33554432,
1724
1774
  minCheckoutIntervalMs: 15e3,
1725
- sampling: bo
1726
- }, vo = 5;
1727
- async function wo(e) {
1775
+ sampling: _o
1776
+ }, Ao = 5;
1777
+ async function Io(e) {
1728
1778
  const { record: t, addCustomEvent: n } = await import("./chunks/rrweb-qwppqH_c.js"), r = e.maskPolicy ?? "mask_all", o = Date.now();
1729
1779
  let i = [], l = !1, c = 0;
1730
1780
  const s = () => {
1731
1781
  if (i.length === 0) return;
1732
- const A = i;
1733
- i = [], e.onBatch(A);
1782
+ const R = i;
1783
+ i = [], e.onBatch(R);
1734
1784
  }, a = t({
1735
- emit(A) {
1736
- i.push(Et(A, r, (S) => t.mirror.getNode(S)));
1785
+ emit(R) {
1786
+ i.push(Et(R, r, (v) => t.mirror.getNode(v)));
1737
1787
  },
1738
1788
  ...wt(r)
1739
- }), u = e.diagnostics ?? null, d = a ? u ?? At({ captureNetwork: e.captureNetwork !== !1 }) : null, p = d !== null && u === null;
1740
- d?.setSink((A, S) => {
1789
+ }), u = e.diagnostics ?? null, f = a ? u ?? Lt({ captureNetwork: e.captureNetwork !== !1 }) : null, d = f !== null && u === null;
1790
+ f?.setSink((R, v) => {
1741
1791
  try {
1742
- n(A, S);
1792
+ n(R, v);
1743
1793
  } catch {
1744
1794
  }
1745
1795
  });
1746
- const h = setInterval(s, kt), b = { timer: null }, E = () => (l || (l = !0, clearInterval(h), clearTimeout(b.timer ?? void 0), d?.flushRings(), d?.setSink(null), p && d?.teardown(), a?.(), s(), c = Date.now() - o), c);
1747
- return b.timer = setTimeout(() => {
1748
- E(), e.onCap();
1749
- }, Ot), { stop: E };
1796
+ const p = setInterval(s, Ct), y = { timer: null }, S = () => (l || (l = !0, clearInterval(p), clearTimeout(y.timer ?? void 0), f?.flushRings(), f?.setSink(null), d && f?.teardown(), a?.(), s(), c = Date.now() - o), c);
1797
+ return y.timer = setTimeout(() => {
1798
+ S(), e.onCap();
1799
+ }, Ot), { stop: S };
1750
1800
  }
1751
- async function Eo(e) {
1801
+ async function Ro(e) {
1752
1802
  const { record: t, addCustomEvent: n } = await import("./chunks/rrweb-qwppqH_c.js"), r = {
1753
- ...yo,
1803
+ ...Lo,
1754
1804
  ...e.config
1755
1805
  }, { diagnostics: o } = e, i = e.maskPolicy ?? "mask_all";
1756
1806
  let l = !1, c = null, s = null;
@@ -1759,7 +1809,7 @@ async function Eo(e) {
1759
1809
  t.takeFullSnapshot(!0);
1760
1810
  } catch {
1761
1811
  }
1762
- }, u = go({
1812
+ }, u = To({
1763
1813
  windowMs: r.windowMs,
1764
1814
  maxBytes: r.maxBytes,
1765
1815
  heldMaxBytes: r.heldMaxBytes,
@@ -1767,78 +1817,78 @@ async function Eo(e) {
1767
1817
  requestCheckout: () => queueMicrotask(() => {
1768
1818
  l || a();
1769
1819
  })
1770
- }), d = t({
1771
- emit(h) {
1772
- const b = Et(h, i, (E) => t.mirror.getNode(E));
1773
- u.push(b), c?.(b);
1820
+ }), f = t({
1821
+ emit(p) {
1822
+ const y = Et(p, i, (S) => t.mirror.getNode(S));
1823
+ u.push(y), c?.(y);
1774
1824
  },
1775
1825
  checkoutEveryNms: r.checkoutEveryNms,
1776
1826
  sampling: r.sampling,
1777
1827
  ...wt(i)
1778
1828
  });
1779
- if (!d) return null;
1780
- const p = (h, b) => {
1829
+ if (!f) return null;
1830
+ const d = (p, y) => {
1781
1831
  try {
1782
- n(h, b);
1832
+ n(p, y);
1783
1833
  } catch {
1784
1834
  }
1785
1835
  };
1786
- return o.setSink(p), {
1836
+ return o.setSink(d), {
1787
1837
  snapshot() {
1788
- const h = u.snapshot(), b = Date.now();
1789
- o.setSink((A, S) => {
1790
- h.push({
1791
- type: vo,
1838
+ const p = u.snapshot(), y = Date.now();
1839
+ o.setSink((R, v) => {
1840
+ p.push({
1841
+ type: Ao,
1792
1842
  data: {
1793
- tag: A,
1794
- payload: S
1843
+ tag: R,
1844
+ payload: v
1795
1845
  },
1796
- timestamp: b
1846
+ timestamp: y
1797
1847
  });
1798
1848
  });
1799
1849
  try {
1800
1850
  o.flushRings();
1801
1851
  } finally {
1802
- o.setSink(l ? null : p);
1852
+ o.setSink(l ? null : d);
1803
1853
  }
1804
- const E = h[0]?.timestamp;
1854
+ const S = p[0]?.timestamp;
1805
1855
  return {
1806
- events: h,
1807
- durationMs: typeof E == "number" ? Math.max(0, b - E) : 0
1856
+ events: p,
1857
+ durationMs: typeof S == "number" ? Math.max(0, y - S) : 0
1808
1858
  };
1809
1859
  },
1810
1860
  hold: () => u.hold(),
1811
1861
  release: () => u.release(),
1812
- markNavigation(h) {
1813
- l || p(fo, { href: j(h) });
1862
+ markNavigation(p) {
1863
+ l || d(vo, { href: X(p) });
1814
1864
  },
1815
1865
  stats: () => u.stats(),
1816
- stream({ onBatch: h, onCap: b }) {
1866
+ stream({ onBatch: p, onCap: y }) {
1817
1867
  s?.stop();
1818
- const E = Date.now();
1819
- let A = [], S = !1, v = 0;
1868
+ const S = Date.now();
1869
+ let R = [], v = !1, E = 0;
1820
1870
  const _ = () => {
1821
- if (A.length === 0) return;
1822
- const O = A;
1823
- A = [], h(O);
1824
- }, L = (O) => {
1825
- A.push(O);
1871
+ if (R.length === 0) return;
1872
+ const k = R;
1873
+ R = [], p(k);
1874
+ }, A = (k) => {
1875
+ R.push(k);
1826
1876
  };
1827
- c = L, a();
1828
- const k = setInterval(_, kt), D = { timer: null }, I = { stop() {
1829
- return S || (S = !0, clearInterval(k), clearTimeout(D.timer ?? void 0), o.flushRings(), c === L && (c = null), s === I && (s = null), _(), v = Date.now() - E), v;
1877
+ c = A, a();
1878
+ const M = setInterval(_, Ct), D = { timer: null }, N = { stop() {
1879
+ return v || (v = !0, clearInterval(M), clearTimeout(D.timer ?? void 0), o.flushRings(), c === A && (c = null), s === N && (s = null), _(), E = Date.now() - S), E;
1830
1880
  } };
1831
1881
  return D.timer = setTimeout(() => {
1832
- I.stop(), b();
1833
- }, Ot), s = I, I;
1882
+ N.stop(), y();
1883
+ }, Ot), s = N, N;
1834
1884
  },
1835
1885
  stop() {
1836
- l || (l = !0, s?.stop(), o.setSink(null), d(), u.clear());
1886
+ l || (l = !0, s?.stop(), o.setSink(null), f(), u.clear());
1837
1887
  }
1838
1888
  };
1839
1889
  }
1840
- var So = ["https://lab.leesto.app", "https://lab-dev.leesto.app"], To = ["http://localhost:3505", "http://127.0.0.1:3505"];
1841
- function _o(e) {
1890
+ var No = ["https://lab.leesto.app", "https://lab-dev.leesto.app"], Oo = ["http://localhost:3505", "http://127.0.0.1:3505"];
1891
+ function Co(e) {
1842
1892
  try {
1843
1893
  const t = new URL(e).hostname;
1844
1894
  return t === "localhost" || t.endsWith(".localhost") || t === "127.0.0.1" || t === "[::1]";
@@ -1846,7 +1896,7 @@ function _o(e) {
1846
1896
  return !1;
1847
1897
  }
1848
1898
  }
1849
- function Ao(e) {
1899
+ function ko(e) {
1850
1900
  const t = e.trim();
1851
1901
  if (!t) return null;
1852
1902
  try {
@@ -1856,19 +1906,19 @@ function Ao(e) {
1856
1906
  return null;
1857
1907
  }
1858
1908
  }
1859
- function Lo(e) {
1860
- const t = (e.explicit ?? []).map(Ao).filter((r) => r !== null);
1909
+ function Mo(e) {
1910
+ const t = (e.explicit ?? []).map(ko).filter((r) => r !== null);
1861
1911
  if (t.length > 0) return [...new Set(t)];
1862
- const n = [...So];
1863
- return _o(e.pageOrigin) && n.push(...To), [...new Set(n)];
1912
+ const n = [...No];
1913
+ return Co(e.pageOrigin) && n.push(...Oo), [...new Set(n)];
1864
1914
  }
1865
- function Ae(e, t) {
1915
+ function Ce(e, t) {
1866
1916
  return !e || e === "*" || e === "null" ? !1 : t.includes(e);
1867
1917
  }
1868
- function fe() {
1918
+ function ye() {
1869
1919
  return typeof navigator < "u" && navigator.globalPrivacyControl === !0;
1870
1920
  }
1871
- function Ro(e) {
1921
+ function xo(e) {
1872
1922
  const t = (l) => {
1873
1923
  const c = typeof l == "string" ? l.trim() : "";
1874
1924
  return c.length > 0 ? c : void 0;
@@ -1882,7 +1932,7 @@ function Ro(e) {
1882
1932
  ...i ? { environment: i } : {}
1883
1933
  };
1884
1934
  }
1885
- function Io() {
1935
+ function Fo() {
1886
1936
  if (typeof document > "u") return;
1887
1937
  const e = document.querySelector('link[rel~="icon"], link[rel="shortcut icon"], link[rel="apple-touch-icon"]');
1888
1938
  if (e?.href)
@@ -1892,7 +1942,7 @@ function Io() {
1892
1942
  return;
1893
1943
  }
1894
1944
  }
1895
- function Co() {
1945
+ function Do() {
1896
1946
  const e = (r) => !!r && r !== "transparent" && !/^rgba\(\s*0,\s*0,\s*0,\s*0\s*\)$/.test(r), t = getComputedStyle(document.body).backgroundColor;
1897
1947
  if (e(t)) return t;
1898
1948
  const n = getComputedStyle(document.documentElement).backgroundColor;
@@ -1900,18 +1950,18 @@ function Co() {
1900
1950
  }
1901
1951
  var dt = Promise.resolve();
1902
1952
  function pt(e) {
1903
- const t = dt.then(() => ko(e));
1953
+ const t = dt.then(() => $o(e));
1904
1954
  return dt = t.catch(() => {
1905
1955
  }), t;
1906
1956
  }
1907
- function Oo(e, t, n, r) {
1957
+ function Po(e, t, n, r) {
1908
1958
  if (t !== "sticky") return [n, r];
1909
1959
  const o = e.getBoundingClientRect(), i = e.style.position;
1910
1960
  e.style.position = "static";
1911
1961
  const l = e.getBoundingClientRect();
1912
1962
  return e.style.position = i, [o.x - l.x, o.y - l.y];
1913
1963
  }
1914
- async function ko(e) {
1964
+ async function $o(e) {
1915
1965
  const { domToPng: t } = await import("./chunks/dist-BTlWkbvW.js");
1916
1966
  if (e) {
1917
1967
  const s = document.querySelector(e);
@@ -1932,7 +1982,7 @@ async function ko(e) {
1932
1982
  };
1933
1983
  try {
1934
1984
  c = ot(n);
1935
- for (const s of n.querySelectorAll(`.${me}, ${ee}`)) {
1985
+ for (const s of n.querySelectorAll(`.${Ee}, ${ie}`)) {
1936
1986
  const a = s.getBoundingClientRect();
1937
1987
  if (a.width <= 0 || a.height <= 0) continue;
1938
1988
  const u = document.createElement("div");
@@ -1950,13 +2000,13 @@ async function ko(e) {
1950
2000
  for (const s of n.querySelectorAll("*")) {
1951
2001
  const a = getComputedStyle(s).position;
1952
2002
  if (a === "fixed" || a === "sticky") {
1953
- const [u, d] = Oo(s, a, r, o), p = s.style.transform;
1954
- l.push([s, p]), s.style.transform = `translate(${u}px, ${d}px)${p ? ` ${p}` : ""}`;
2003
+ const [u, f] = Po(s, a, r, o), d = s.style.transform;
2004
+ l.push([s, d]), s.style.transform = `translate(${u}px, ${f}px)${d ? ` ${d}` : ""}`;
1955
2005
  }
1956
2006
  }
1957
2007
  return await t(n, {
1958
2008
  quality: 0.92,
1959
- backgroundColor: Co(),
2009
+ backgroundColor: Do(),
1960
2010
  width: n.clientWidth,
1961
2011
  height: n.clientHeight,
1962
2012
  style: {
@@ -1971,7 +2021,7 @@ async function ko(e) {
1971
2021
  for (const [s, a] of l) s.style.transform = a;
1972
2022
  }
1973
2023
  }
1974
- function No(e) {
2024
+ function Bo(e) {
1975
2025
  if (e.id) return `#${CSS.escape(e.id)}`;
1976
2026
  const t = [];
1977
2027
  let n = e;
@@ -1992,56 +2042,56 @@ function No(e) {
1992
2042
  }
1993
2043
  return t.join(" > ");
1994
2044
  }
1995
- function Mo(e) {
2045
+ function qo(e) {
1996
2046
  const t = e.tagName.toLowerCase();
1997
- if (ne(e)) return t;
2047
+ if (ae(e)) return t;
1998
2048
  const n = (e.textContent ?? "").replace(/\s+/g, " ").trim().slice(0, 40);
1999
2049
  return n ? `${t} · ${n}` : t;
2000
2050
  }
2001
- var Nt = "leesto:shell-origin";
2002
- function xo() {
2051
+ var kt = "leesto:shell-origin";
2052
+ function Uo() {
2003
2053
  try {
2004
- return sessionStorage.getItem(Nt);
2054
+ return sessionStorage.getItem(kt);
2005
2055
  } catch {
2006
2056
  return null;
2007
2057
  }
2008
2058
  }
2009
- function Do(e) {
2059
+ function Ho(e) {
2010
2060
  try {
2011
- sessionStorage.setItem(Nt, e);
2061
+ sessionStorage.setItem(kt, e);
2012
2062
  } catch {
2013
2063
  }
2014
2064
  }
2015
- function Po() {
2065
+ function Go() {
2016
2066
  try {
2017
2067
  return typeof window.name == "string" ? window.name : "";
2018
2068
  } catch {
2019
2069
  return "";
2020
2070
  }
2021
2071
  }
2022
- function ht(e = {}) {
2072
+ function mt(e = {}) {
2023
2073
  if (typeof window > "u" || window.parent === window) return () => {
2024
2074
  };
2025
- const t = window.parent, n = e.highlightColor ?? tn.light.primary, r = Lo({
2075
+ const t = window.parent, n = e.highlightColor ?? rn.light.primary, r = Mo({
2026
2076
  explicit: e.shellOrigins,
2027
2077
  pageOrigin: location.origin
2028
2078
  });
2029
2079
  let o = null;
2030
2080
  try {
2031
2081
  const g = document.referrer ? new URL(document.referrer).origin : "";
2032
- Ae(g, r) && (o = g);
2082
+ Ce(g, r) && (o = g);
2033
2083
  } catch {
2034
2084
  }
2035
2085
  if (!o) {
2036
- const g = xo();
2037
- g && Ae(g, r) && (o = g);
2086
+ const g = Uo();
2087
+ g && Ce(g, r) && (o = g);
2038
2088
  }
2039
2089
  const i = (g) => {
2040
2090
  if (o) {
2041
2091
  t.postMessage(g, o);
2042
2092
  return;
2043
2093
  }
2044
- for (const w of r) t.postMessage(g, w);
2094
+ for (const T of r) t.postMessage(g, T);
2045
2095
  };
2046
2096
  let l = null, c = "";
2047
2097
  const s = () => {
@@ -2060,90 +2110,95 @@ function ht(e = {}) {
2060
2110
  borderRadius: "4px",
2061
2111
  display: "none"
2062
2112
  }), document.documentElement.append(g);
2063
- let w = null, T = null, W = null;
2064
- const K = document.body.style.cursor, x = () => {
2065
- const M = T ?? w;
2066
- if (!M) return;
2067
- const F = M.getBoundingClientRect();
2068
- T ? i({
2113
+ let T = null, L = null, K = null;
2114
+ const J = document.body.style.cursor, $ = () => {
2115
+ const F = L ?? T;
2116
+ if (!F) return;
2117
+ const q = F.getBoundingClientRect();
2118
+ L ? i({
2069
2119
  type: "leesto:element-picked",
2070
- selector: No(M),
2071
- label: Mo(M),
2120
+ selector: Bo(F),
2121
+ label: qo(F),
2072
2122
  rect: {
2073
- x: F.x,
2074
- y: F.y,
2075
- width: F.width,
2076
- height: F.height
2123
+ x: q.x,
2124
+ y: q.y,
2125
+ width: q.width,
2126
+ height: q.height
2077
2127
  },
2078
- ...W ? { point: {
2079
- x: F.x + W.x,
2080
- y: F.y + W.y
2128
+ ...K ? { point: {
2129
+ x: q.x + K.x,
2130
+ y: q.y + K.y
2081
2131
  } } : {},
2082
2132
  viewport: {
2083
2133
  width: document.documentElement.clientWidth,
2084
2134
  height: document.documentElement.clientHeight
2085
2135
  },
2086
- context: Ir(M)
2136
+ context: Or(F)
2087
2137
  }) : Object.assign(g.style, {
2088
2138
  display: "block",
2089
- left: `${F.x}px`,
2090
- top: `${F.y}px`,
2091
- width: `${F.width}px`,
2092
- height: `${F.height}px`
2139
+ left: `${q.x}px`,
2140
+ top: `${q.y}px`,
2141
+ width: `${q.width}px`,
2142
+ height: `${q.height}px`
2093
2143
  });
2094
- }, ze = (M) => {
2095
- w = M.target instanceof Element ? M.target : null, x();
2096
- }, je = () => {
2097
- g.remove(), document.removeEventListener("mousemove", ze, !0), document.removeEventListener("click", Xe, !0), document.body.style.cursor = K;
2098
- }, Xe = (M) => {
2099
- if (M.preventDefault(), M.stopPropagation(), T = M.target instanceof Element ? M.target : null, T) {
2100
- const F = T.getBoundingClientRect();
2101
- W = {
2102
- x: M.clientX - F.x,
2103
- y: M.clientY - F.y
2144
+ }, ze = (F) => {
2145
+ T = F.target instanceof Element ? F.target : null, $();
2146
+ }, Ke = () => {
2147
+ g.remove(), document.removeEventListener("mousemove", ze, !0), document.removeEventListener("click", je, !0), document.body.style.cursor = J;
2148
+ }, je = (F) => {
2149
+ if (F.preventDefault(), F.stopPropagation(), L = F.target instanceof Element ? F.target : null, L) {
2150
+ const q = L.getBoundingClientRect();
2151
+ K = {
2152
+ x: F.clientX - q.x,
2153
+ y: F.clientY - q.y
2104
2154
  };
2105
2155
  }
2106
- je(), x();
2107
- }, Ke = (M) => {
2108
- M.key === "Escape" && (a?.(), i({ type: "leesto:pick-cancelled" }));
2156
+ Ke(), $();
2157
+ }, Xe = (F) => {
2158
+ F.key === "Escape" && (a?.(), i({ type: "leesto:pick-cancelled" }));
2109
2159
  };
2110
2160
  a = () => {
2111
- je(), document.removeEventListener("keydown", Ke, !0), document.removeEventListener("scroll", x, !0), window.removeEventListener("resize", x), a = null;
2112
- }, document.body.style.cursor = "crosshair", document.addEventListener("mousemove", ze, !0), document.addEventListener("click", Xe, !0), document.addEventListener("keydown", Ke, !0), document.addEventListener("scroll", x, !0), window.addEventListener("resize", x);
2113
- }, d = Kt(location.search, Po()), p = Le(d) && !fe(), h = jt(d), b = p ? Xt(d) ?? zt() : void 0, E = p ? At({
2161
+ Ke(), document.removeEventListener("keydown", Xe, !0), document.removeEventListener("scroll", $, !0), window.removeEventListener("resize", $), a = null;
2162
+ }, document.body.style.cursor = "crosshair", document.addEventListener("mousemove", ze, !0), document.addEventListener("click", je, !0), document.addEventListener("keydown", Xe, !0), document.addEventListener("scroll", $, !0), window.addEventListener("resize", $);
2163
+ }, f = Zt(location.search, Go()), d = ke(f) && !ye(), p = Xt(f), y = d ? Yt(f) ?? jt() : void 0, S = d ? Lt({
2114
2164
  captureNetwork: e.captureNetwork !== !1,
2115
- runId: b,
2165
+ runId: y,
2116
2166
  runIdOrigins: e.runIdOrigins
2117
2167
  }) : null;
2118
- let A = null;
2119
- const S = () => {
2120
- A ?? (A = vr());
2168
+ let R = null;
2169
+ const v = () => {
2170
+ R ?? (R = Er());
2121
2171
  };
2122
- (o || d) && S();
2123
- let v = !1;
2124
- const _ = E ? Eo({
2125
- diagnostics: E,
2126
- maskPolicy: h
2127
- }).then((g) => g && v ? (g.stop(), null) : g).catch(() => null) : null;
2128
- let L = null, k = !1, D = !1;
2129
- const I = () => {
2130
- if (L) {
2131
- const g = L.stop();
2132
- L = null, i({
2172
+ (o || f) && v();
2173
+ let E = !1;
2174
+ const _ = S ? Ro({
2175
+ diagnostics: S,
2176
+ maskPolicy: p
2177
+ }).then((g) => g && E ? (g.stop(), null) : g).catch(() => null) : null;
2178
+ let A = null, M = !1, D = !1;
2179
+ const N = () => {
2180
+ if (A) {
2181
+ const g = A.stop();
2182
+ A = null, i({
2133
2183
  type: "leesto:rec-stopped",
2134
2184
  durationMs: g
2135
2185
  });
2136
- } else k && (D = !0);
2186
+ } else M && (D = !0);
2137
2187
  };
2138
- let O = !1;
2139
- const V = uo({
2140
- onAnchor: (g, w) => i({
2188
+ let k = !1;
2189
+ const z = bo({
2190
+ onAnchor: (g, T) => i({
2141
2191
  type: "leesto:login-anchor",
2142
2192
  rect: g,
2143
- scrolling: w
2193
+ scrolling: T
2144
2194
  }),
2145
- onInteraction: () => i({ type: "leesto:login-interaction" })
2146
- }), q = io({
2195
+ onInteraction: () => i({ type: "leesto:login-interaction" }),
2196
+ onFieldFocus: () => i({ type: "leesto:login-field-focus" }),
2197
+ onFieldKey: (g) => i({
2198
+ type: "leesto:login-field-key",
2199
+ key: g
2200
+ })
2201
+ }), V = ao({
2147
2202
  onDetected: () => i({ type: "leesto:login-form-detected" }),
2148
2203
  onFilled: (g) => i({
2149
2204
  type: "leesto:login-filled",
@@ -2157,118 +2212,118 @@ function ht(e = {}) {
2157
2212
  type: "leesto:login-no-form",
2158
2213
  signedIn: g
2159
2214
  }),
2160
- onMatch: (g) => V.track(O ? so(g) : null)
2161
- }), f = () => q.cancel();
2162
- window.addEventListener("pagehide", f);
2163
- const m = Tn((g) => i({
2215
+ onMatch: (g) => z.track(k ? co(g) : null)
2216
+ }), m = () => V.cancel();
2217
+ window.addEventListener("pagehide", m);
2218
+ const b = Ln((g) => i({
2164
2219
  type: "leesto:ambient",
2165
2220
  ...g
2166
- })), y = Ro(e.build), R = window.navigation;
2167
- let N = !1;
2168
- const H = () => !N && R?.canGoBack === !0, C = () => !N && R?.canGoForward === !0;
2169
- let P = C(), U = H(), oe = location.href;
2170
- const qe = () => {
2171
- oe = location.href, U = H(), P = C();
2172
- const g = Io();
2221
+ })), w = xo(e.build), I = window.navigation;
2222
+ let x = !1;
2223
+ const B = () => !x && I?.canGoBack === !0, C = () => !x && I?.canGoForward === !0;
2224
+ let P = C(), U = B(), Z = location.href;
2225
+ const te = () => {
2226
+ Z = location.href, U = B(), P = C();
2227
+ const g = Fo();
2173
2228
  i({
2174
2229
  type: "leesto:ready",
2175
2230
  url: location.href,
2176
2231
  bridgeVersion: 1,
2177
2232
  capabilities: [
2178
2233
  Mt,
2179
- Pt,
2180
2234
  Dt,
2181
- ...R ? ["navigation", "navigation-forward"] : [],
2235
+ Ft,
2236
+ ...I ? ["navigation", "navigation-forward"] : [],
2182
2237
  ..._ ? [xt] : []
2183
2238
  ],
2184
2239
  canGoBack: U,
2185
2240
  canGoForward: P,
2186
2241
  ...g ? { favicon: g } : {},
2187
- ...y ? { build: y } : {},
2188
- ...b ? { diagnosticRunId: b } : {},
2189
- ...fe() ? { gpc: !0 } : {}
2190
- }), m.announce();
2191
- }, He = (g) => {
2192
- if (g.source !== t || !Ae(g.origin, r) || !Bt(g.data)) return;
2193
- o !== g.origin && (o = g.origin, Do(g.origin)), S();
2194
- const w = g.data;
2195
- if (w.type === "leesto:ping")
2196
- i({ type: "leesto:pong" }), qe();
2197
- else if (w.type === "leesto:navigate-back" || w.type === "leesto:navigate-forward") {
2198
- const T = w.type === "leesto:navigate-forward";
2199
- if (!R || !(T ? C() : H())) return;
2200
- N = !0, G(), Promise.resolve((T ? R.forward() : R.back()).finished).catch(() => {
2242
+ ...w ? { build: w } : {},
2243
+ ...y ? { diagnosticRunId: y } : {},
2244
+ ...ye() ? { gpc: !0 } : {}
2245
+ }), b.announce();
2246
+ }, h = (g) => {
2247
+ if (g.source !== t || !Ce(g.origin, r) || !Ut(g.data)) return;
2248
+ o !== g.origin && (o = g.origin, Ho(g.origin)), v();
2249
+ const T = g.data;
2250
+ if (T.type === "leesto:ping")
2251
+ i({ type: "leesto:pong" }), te();
2252
+ else if (T.type === "leesto:navigate-back" || T.type === "leesto:navigate-forward") {
2253
+ const L = T.type === "leesto:navigate-forward";
2254
+ if (!I || !(L ? C() : B())) return;
2255
+ x = !0, O(), Promise.resolve((L ? I.forward() : I.back()).finished).catch(() => {
2201
2256
  }).finally(() => {
2202
- N = !1, v || G();
2257
+ x = !1, E || O();
2203
2258
  });
2204
- } else if (w.type === "leesto:highlight") {
2205
- if (s(), w.selector) {
2206
- let T = null;
2259
+ } else if (T.type === "leesto:highlight") {
2260
+ if (s(), T.selector) {
2261
+ let L = null;
2207
2262
  try {
2208
- T = document.querySelector(w.selector);
2263
+ L = document.querySelector(T.selector);
2209
2264
  } catch {
2210
- T = null;
2265
+ L = null;
2211
2266
  }
2212
- T && (l = T, c = T.style.outline, T.style.outline = `2px solid ${n}`, T.style.outlineOffset = "2px", T.scrollIntoView({
2267
+ L && (l = L, c = L.style.outline, L.style.outline = `2px solid ${n}`, L.style.outlineOffset = "2px", L.scrollIntoView({
2213
2268
  block: "center",
2214
2269
  behavior: "smooth"
2215
2270
  }));
2216
2271
  }
2217
- } else if (w.type === "leesto:pick-start") u();
2218
- else if (w.type === "leesto:pick-stop") a?.();
2219
- else if (w.type === "leesto:capture-request") (w.selector ? pt(w.selector) : (e.capture ?? pt)()).then((T) => i({
2272
+ } else if (T.type === "leesto:pick-start") u();
2273
+ else if (T.type === "leesto:pick-stop") a?.();
2274
+ else if (T.type === "leesto:capture-request") (T.selector ? pt(T.selector) : (e.capture ?? pt)()).then((L) => i({
2220
2275
  type: "leesto:screenshot",
2221
- dataUrl: T,
2222
- ...w.selector ? { selector: w.selector } : {}
2223
- })).catch((T) => i({
2276
+ dataUrl: L,
2277
+ ...T.selector ? { selector: T.selector } : {}
2278
+ })).catch((L) => i({
2224
2279
  type: "leesto:capture-failed",
2225
- reason: T instanceof Error ? T.message : "capture_error"
2280
+ reason: L instanceof Error ? L.message : "capture_error"
2226
2281
  }));
2227
- else if (w.type === "leesto:rec-start") {
2228
- if (L || k) return;
2229
- if (fe()) {
2282
+ else if (T.type === "leesto:rec-start") {
2283
+ if (A || M) return;
2284
+ if (ye()) {
2230
2285
  i({
2231
2286
  type: "leesto:rec-blocked",
2232
2287
  reason: "gpc"
2233
2288
  });
2234
2289
  return;
2235
2290
  }
2236
- k = !0, D = !1;
2237
- const T = (x) => i({
2291
+ M = !0, D = !1;
2292
+ const L = ($) => i({
2238
2293
  type: "leesto:rec-batch",
2239
- events: x
2240
- }), W = () => I(), K = () => wo({
2241
- onBatch: T,
2242
- onCap: W,
2294
+ events: $
2295
+ }), K = () => N(), J = () => Io({
2296
+ onBatch: L,
2297
+ onCap: K,
2243
2298
  captureNetwork: e.captureNetwork,
2244
- maskPolicy: h,
2245
- diagnostics: E
2299
+ maskPolicy: p,
2300
+ diagnostics: S
2246
2301
  });
2247
- (_ ? _.then((x) => x ? x.stream({
2248
- onBatch: T,
2249
- onCap: W
2250
- }) : K()) : K()).then((x) => {
2251
- k = !1, L = x, D && I();
2252
- }).catch((x) => {
2253
- k = !1, i({
2302
+ (_ ? _.then(($) => $ ? $.stream({
2303
+ onBatch: L,
2304
+ onCap: K
2305
+ }) : J()) : J()).then(($) => {
2306
+ M = !1, A = $, D && N();
2307
+ }).catch(($) => {
2308
+ M = !1, i({
2254
2309
  type: "leesto:rec-error",
2255
- reason: x instanceof Error ? x.message : "rec_error"
2310
+ reason: $ instanceof Error ? $.message : "rec_error"
2256
2311
  });
2257
2312
  });
2258
- } else if (w.type === "leesto:rec-stop") I();
2259
- else if (w.type === "leesto:rec-buffer-request") {
2313
+ } else if (T.type === "leesto:rec-stop") N();
2314
+ else if (T.type === "leesto:rec-buffer-request") {
2260
2315
  if (!_) {
2261
2316
  i({
2262
2317
  type: "leesto:rec-buffer",
2263
2318
  events: [],
2264
2319
  durationMs: 0,
2265
- unavailable: fe() ? "gpc" : "not-armed"
2320
+ unavailable: ye() ? "gpc" : "not-armed"
2266
2321
  });
2267
2322
  return;
2268
2323
  }
2269
- _.then((T) => {
2270
- if (v) return;
2271
- if (!T) {
2324
+ _.then((L) => {
2325
+ if (E) return;
2326
+ if (!L) {
2272
2327
  i({
2273
2328
  type: "leesto:rec-buffer",
2274
2329
  events: [],
@@ -2277,33 +2332,33 @@ function ht(e = {}) {
2277
2332
  });
2278
2333
  return;
2279
2334
  }
2280
- const { events: W, durationMs: K } = T.snapshot();
2335
+ const { events: K, durationMs: J } = L.snapshot();
2281
2336
  i({
2282
2337
  type: "leesto:rec-buffer",
2283
- events: W,
2284
- durationMs: K
2338
+ events: K,
2339
+ durationMs: J
2285
2340
  });
2286
2341
  });
2287
- } else w.type === "leesto:rec-buffer-hold" ? _?.then((T) => T?.hold()) : w.type === "leesto:rec-buffer-release" ? _?.then((T) => T?.release()) : w.type === "leesto:diagnostics-request" ? i({
2342
+ } else T.type === "leesto:rec-buffer-hold" ? _?.then((L) => L?.hold()) : T.type === "leesto:rec-buffer-release" ? _?.then((L) => L?.release()) : T.type === "leesto:diagnostics-request" ? i({
2288
2343
  type: "leesto:diagnostics",
2289
- snapshot: E?.snapshot() ?? {
2344
+ snapshot: S?.snapshot() ?? {
2290
2345
  errors: [],
2291
2346
  logs: [],
2292
2347
  network: []
2293
2348
  }
2294
- }) : w.type === "leesto:login-watch" ? (O = w.anchor === !0, q.watch()) : w.type === "leesto:login-fill" ? q.fill({
2295
- login: w.login,
2296
- password: w.password
2297
- }) : w.type === "leesto:login-cancel" && q.cancel();
2349
+ }) : T.type === "leesto:login-watch" ? (k = T.anchor === !0, V.watch()) : T.type === "leesto:login-fill" ? V.fill({
2350
+ login: T.login,
2351
+ password: T.password
2352
+ }) : T.type === "leesto:login-cancel" ? V.cancel() : T.type === "leesto:login-focus-field" && z.focusField();
2298
2353
  };
2299
- window.addEventListener("message", He), qe();
2300
- const G = (g) => {
2301
- if (!(location.href === oe && H() === U && C() === P)) {
2302
- if (location.href !== oe) {
2303
- const w = location.href;
2304
- _?.then((T) => T?.markNavigation(w)), m.navigated();
2354
+ window.addEventListener("message", h), te();
2355
+ const O = (g) => {
2356
+ if (!(location.href === Z && B() === U && C() === P)) {
2357
+ if (location.href !== Z) {
2358
+ const T = location.href;
2359
+ _?.then((L) => L?.markNavigation(T)), b.navigated();
2305
2360
  }
2306
- oe = location.href, U = H(), P = C(), i({
2361
+ Z = location.href, U = B(), P = C(), i({
2307
2362
  type: "leesto:location",
2308
2363
  url: location.href,
2309
2364
  canGoBack: U,
@@ -2311,28 +2366,28 @@ function ht(e = {}) {
2311
2366
  navigationType: typeof g == "string" ? g : "traverse"
2312
2367
  });
2313
2368
  }
2314
- }, Ue = history.pushState, Ge = history.replaceState, We = (...g) => {
2315
- Ue.apply(history, g), G("push");
2316
- }, Ve = (...g) => {
2317
- Ge.apply(history, g), G("replace");
2369
+ }, H = history.pushState, Q = history.replaceState, ce = (...g) => {
2370
+ H.apply(history, g), O("push");
2371
+ }, ue = (...g) => {
2372
+ Q.apply(history, g), O("replace");
2318
2373
  };
2319
- return history.pushState = We, history.replaceState = Ve, R?.addEventListener("currententrychange", G), window.addEventListener("popstate", G), window.addEventListener("hashchange", G), () => {
2320
- v = !0, m.stop(), A?.(), R?.removeEventListener("currententrychange", G), I(), _?.then((g) => g?.stop()), E?.teardown(), s(), a?.(), q.teardown(), V.teardown(), window.removeEventListener("pagehide", f), window.removeEventListener("message", He), window.removeEventListener("popstate", G), window.removeEventListener("hashchange", G), history.pushState === We && (history.pushState = Ue), history.replaceState === Ve && (history.replaceState = Ge);
2374
+ return history.pushState = ce, history.replaceState = ue, I?.addEventListener("currententrychange", O), window.addEventListener("popstate", O), window.addEventListener("hashchange", O), () => {
2375
+ E = !0, b.stop(), R?.(), I?.removeEventListener("currententrychange", O), N(), _?.then((g) => g?.stop()), S?.teardown(), s(), a?.(), V.teardown(), z.teardown(), window.removeEventListener("pagehide", m), window.removeEventListener("message", h), window.removeEventListener("popstate", O), window.removeEventListener("hashchange", O), history.pushState === ce && (history.pushState = H), history.replaceState === ue && (history.replaceState = Q);
2321
2376
  };
2322
2377
  }
2323
- function Fo() {
2378
+ function Wo() {
2324
2379
  return typeof document > "u" ? null : document.currentScript ?? document.querySelector("script[data-leesto-connect]");
2325
2380
  }
2326
- function $o(e) {
2381
+ function Vo(e) {
2327
2382
  const t = {}, n = e?.dataset.highlightColor;
2328
2383
  n && (t.highlightColor = n);
2329
2384
  const r = (e?.dataset.shellOrigin ?? "").split(",").map((o) => o.trim()).filter(Boolean);
2330
2385
  return r.length > 0 && (t.shellOrigins = r), t;
2331
2386
  }
2332
2387
  if (typeof window < "u") {
2333
- window.LeestoConnect = { connect: (t) => ht(t) };
2334
- const e = Fo();
2335
- (!e || e.dataset.leestoManual === void 0) && ht($o(e));
2388
+ window.LeestoConnect = { connect: (t) => mt(t) };
2389
+ const e = Wo();
2390
+ (!e || e.dataset.leestoManual === void 0) && mt(Vo(e));
2336
2391
  }
2337
2392
 
2338
2393
  //# sourceMappingURL=leesto-connect.js.map