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