@adobe/helix-rum-enhancer 2.34.2 → 2.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.releaserc.cjs +7 -3
- package/CHANGELOG.md +14 -0
- package/package.json +8 -8
- package/rollup.config.js +69 -21
- package/src/index.md5 +1 -1
- package/src/index.sri +1 -0
- package/src/plugins/cwv.js +206 -286
- package/src/plugins/cwv.map.js +207 -287
- package/src/plugins/cwv.md5 +1 -1
- package/src/plugins/onetrust.md5 +1 -1
package/src/plugins/cwv.js
CHANGED
|
@@ -11,345 +11,265 @@
|
|
|
11
11
|
*/
|
|
12
12
|
(function (e) {
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
o,
|
|
19
|
-
a = -1,
|
|
20
|
-
c = function (e) {
|
|
21
|
-
addEventListener("pageshow", function (n) {
|
|
22
|
-
n.persisted && (a = n.timeStamp, e(n));
|
|
14
|
+
let t = -1;
|
|
15
|
+
const n = e => {
|
|
16
|
+
addEventListener("pageshow", n => {
|
|
17
|
+
n.persisted && (t = n.timeStamp, e(n));
|
|
23
18
|
}, true);
|
|
24
19
|
},
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
i = (e, t, n, i) => {
|
|
21
|
+
let o, s;
|
|
22
|
+
return r => {
|
|
23
|
+
t.value >= 0 && (r || i) && (s = t.value - (o ?? 0), (s || void 0 === o) && (o = t.value, t.delta = s, t.rating = ((e, t) => e > t[1] ? "poor" : e > t[0] ? "needs-improvement" : "good")(t.value, n), e(t)));
|
|
24
|
+
};
|
|
25
|
+
},
|
|
26
|
+
o = e => {
|
|
27
|
+
requestAnimationFrame(() => requestAnimationFrame(() => e()));
|
|
28
|
+
},
|
|
29
|
+
s = () => {
|
|
30
|
+
const e = performance.getEntriesByType("navigation")[0];
|
|
27
31
|
if (e && e.responseStart > 0 && e.responseStart < performance.now()) return e;
|
|
28
32
|
},
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return e
|
|
33
|
+
r = () => {
|
|
34
|
+
const e = s();
|
|
35
|
+
return e?.activationStart ?? 0;
|
|
32
36
|
},
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
c = (e, n = -1) => {
|
|
38
|
+
const i = s();
|
|
39
|
+
let o = "navigate";
|
|
40
|
+
t >= 0 ? o = "back-forward-cache" : i && (document.prerendering || r() > 0 ? o = "prerender" : document.wasDiscarded ? o = "restore" : i.type && (o = i.type.replace(/_/g, "-")));
|
|
37
41
|
return {
|
|
38
42
|
name: e,
|
|
39
|
-
value:
|
|
43
|
+
value: n,
|
|
40
44
|
rating: "good",
|
|
41
45
|
delta: 0,
|
|
42
46
|
entries: [],
|
|
43
|
-
id:
|
|
44
|
-
navigationType:
|
|
47
|
+
id: `v5-${Date.now()}-${Math.floor(8999999999999 * Math.random()) + 1e12}`,
|
|
48
|
+
navigationType: o
|
|
45
49
|
};
|
|
46
50
|
},
|
|
47
|
-
|
|
51
|
+
a = new WeakMap();
|
|
52
|
+
function d(e, t) {
|
|
53
|
+
return a.get(e) || a.set(e, new t()), a.get(e);
|
|
54
|
+
}
|
|
55
|
+
class h {
|
|
56
|
+
t;
|
|
57
|
+
i = 0;
|
|
58
|
+
o = [];
|
|
59
|
+
h(e) {
|
|
60
|
+
if (e.hadRecentInput) return;
|
|
61
|
+
const t = this.o[0],
|
|
62
|
+
n = this.o.at(-1);
|
|
63
|
+
this.i && t && n && e.startTime - n.startTime < 1e3 && e.startTime - t.startTime < 5e3 ? (this.i += e.value, this.o.push(e)) : (this.i = e.value, this.o = [e]), this.t?.(e);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
const f = (e, t, n = {}) => {
|
|
48
67
|
try {
|
|
49
68
|
if (PerformanceObserver.supportedEntryTypes.includes(e)) {
|
|
50
|
-
|
|
51
|
-
Promise.resolve().then(
|
|
52
|
-
|
|
69
|
+
const i = new PerformanceObserver(e => {
|
|
70
|
+
Promise.resolve().then(() => {
|
|
71
|
+
t(e.getEntries());
|
|
53
72
|
});
|
|
54
73
|
});
|
|
55
|
-
return
|
|
74
|
+
return i.observe({
|
|
56
75
|
type: e,
|
|
57
|
-
buffered: !0
|
|
58
|
-
|
|
76
|
+
buffered: !0,
|
|
77
|
+
...n
|
|
78
|
+
}), i;
|
|
59
79
|
}
|
|
60
|
-
} catch
|
|
61
|
-
},
|
|
62
|
-
l = function (e, n, t, r) {
|
|
63
|
-
var i, o;
|
|
64
|
-
return function (a) {
|
|
65
|
-
n.value >= 0 && (a || r) && ((o = n.value - (i || 0)) || void 0 === i) && (i = n.value, n.delta = o, n.rating = function (e, n) {
|
|
66
|
-
return e > n[1] ? "poor" : e > n[0] ? "needs-improvement" : "good";
|
|
67
|
-
}(n.value, t), e(n));
|
|
68
|
-
};
|
|
69
|
-
},
|
|
70
|
-
p = function (e) {
|
|
71
|
-
requestAnimationFrame(function () {
|
|
72
|
-
return requestAnimationFrame(function () {
|
|
73
|
-
return e();
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
},
|
|
77
|
-
v = function (e) {
|
|
78
|
-
document.addEventListener("visibilitychange", function () {
|
|
79
|
-
"hidden" === document.visibilityState && e();
|
|
80
|
-
});
|
|
80
|
+
} catch {}
|
|
81
81
|
},
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
return
|
|
85
|
-
|
|
82
|
+
u = e => {
|
|
83
|
+
let t = false;
|
|
84
|
+
return () => {
|
|
85
|
+
t || (e(), t = true);
|
|
86
86
|
};
|
|
87
|
+
};
|
|
88
|
+
let l = -1;
|
|
89
|
+
const m = () => "hidden" !== document.visibilityState || document.prerendering ? 1 / 0 : 0,
|
|
90
|
+
g = e => {
|
|
91
|
+
"hidden" === document.visibilityState && l > -1 && (l = "visibilitychange" === e.type ? e.timeStamp : 0, p());
|
|
87
92
|
},
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
return "hidden" !== document.visibilityState || document.prerendering ? 1 / 0 : 0;
|
|
91
|
-
},
|
|
92
|
-
T = function (e) {
|
|
93
|
-
"hidden" === document.visibilityState && h > -1 && (h = "visibilitychange" === e.type ? e.timeStamp : 0, E());
|
|
94
|
-
},
|
|
95
|
-
y = function () {
|
|
96
|
-
addEventListener("visibilitychange", T, true), addEventListener("prerenderingchange", T, true);
|
|
93
|
+
v = () => {
|
|
94
|
+
addEventListener("visibilitychange", g, true), addEventListener("prerenderingchange", g, true);
|
|
97
95
|
},
|
|
98
|
-
|
|
99
|
-
removeEventListener("visibilitychange",
|
|
96
|
+
p = () => {
|
|
97
|
+
removeEventListener("visibilitychange", g, true), removeEventListener("prerenderingchange", g, true);
|
|
100
98
|
},
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
99
|
+
y = () => {
|
|
100
|
+
if (l < 0) {
|
|
101
|
+
const e = r(),
|
|
102
|
+
t = document.prerendering ? void 0 : globalThis.performance.getEntriesByType("visibility-state").filter(t => "hidden" === t.name && t.startTime > e)[0]?.startTime;
|
|
103
|
+
l = t ?? m(), v(), n(() => {
|
|
104
|
+
setTimeout(() => {
|
|
105
|
+
l = m(), v();
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
return {
|
|
107
110
|
get firstHiddenTime() {
|
|
108
|
-
return
|
|
111
|
+
return l;
|
|
109
112
|
}
|
|
110
113
|
};
|
|
111
114
|
},
|
|
112
|
-
|
|
113
|
-
document.prerendering ? addEventListener("prerenderingchange",
|
|
114
|
-
return e();
|
|
115
|
-
}, true) : e();
|
|
115
|
+
b = e => {
|
|
116
|
+
document.prerendering ? addEventListener("prerenderingchange", () => e(), true) : e();
|
|
116
117
|
},
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
i = f("FCP"), t = l(e, i, S, n.reportAllChanges), p(function () {
|
|
130
|
-
i.value = performance.now() - r.timeStamp, t(true);
|
|
118
|
+
P = [1800, 3e3],
|
|
119
|
+
T = (e, t = {}) => {
|
|
120
|
+
b(() => {
|
|
121
|
+
const s = y();
|
|
122
|
+
let a,
|
|
123
|
+
d = c("FCP");
|
|
124
|
+
const h = f("paint", e => {
|
|
125
|
+
for (const t of e) "first-contentful-paint" === t.name && (h.disconnect(), t.startTime < s.firstHiddenTime && (d.value = Math.max(t.startTime - r(), 0), d.entries.push(t), a(true)));
|
|
126
|
+
});
|
|
127
|
+
h && (a = i(e, d, P, t.reportAllChanges), n(n => {
|
|
128
|
+
d = c("FCP"), a = i(e, d, P, t.reportAllChanges), o(() => {
|
|
129
|
+
d.value = performance.now() - n.timeStamp, a(true);
|
|
131
130
|
});
|
|
132
131
|
}));
|
|
133
132
|
});
|
|
134
133
|
},
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
},
|
|
147
|
-
k = function () {
|
|
148
|
-
"interactionCount" in performance || n || (n = d("event", F, {
|
|
134
|
+
E = [.1, .25];
|
|
135
|
+
let _ = 0,
|
|
136
|
+
L = 1 / 0,
|
|
137
|
+
M = 0;
|
|
138
|
+
const w = e => {
|
|
139
|
+
for (const t of e) t.interactionId && (L = Math.min(L, t.interactionId), M = Math.max(M, t.interactionId), _ = M ? (M - L) / 7 + 1 : 0);
|
|
140
|
+
};
|
|
141
|
+
let C;
|
|
142
|
+
const I = () => C ? _ : performance.interactionCount ?? 0,
|
|
143
|
+
F = () => {
|
|
144
|
+
"interactionCount" in performance || C || (C = f("event", w, {
|
|
149
145
|
type: "event",
|
|
150
146
|
buffered: true,
|
|
151
147
|
durationThreshold: 0
|
|
152
148
|
}));
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
}), D.length > 10 && D.splice(10).forEach(function (e) {
|
|
180
|
-
return B.delete(e.id);
|
|
181
|
-
});
|
|
149
|
+
};
|
|
150
|
+
let k = 0;
|
|
151
|
+
class A {
|
|
152
|
+
u = [];
|
|
153
|
+
l = new Map();
|
|
154
|
+
m;
|
|
155
|
+
v;
|
|
156
|
+
p() {
|
|
157
|
+
k = I(), this.u.length = 0, this.l.clear();
|
|
158
|
+
}
|
|
159
|
+
P() {
|
|
160
|
+
const e = Math.min(this.u.length - 1, Math.floor((I() - k) / 50));
|
|
161
|
+
return this.u[e];
|
|
162
|
+
}
|
|
163
|
+
h(e) {
|
|
164
|
+
if (this.m?.(e), !e.interactionId && "first-input" !== e.entryType) return;
|
|
165
|
+
const t = this.u.at(-1);
|
|
166
|
+
let n = this.l.get(e.interactionId);
|
|
167
|
+
if (n || this.u.length < 10 || e.duration > t.T) {
|
|
168
|
+
if (n ? e.duration > n.T ? (n.entries = [e], n.T = e.duration) : e.duration === n.T && e.startTime === n.entries[0].startTime && n.entries.push(e) : (n = {
|
|
169
|
+
id: e.interactionId,
|
|
170
|
+
entries: [e],
|
|
171
|
+
T: e.duration
|
|
172
|
+
}, this.l.set(n.id, n), this.u.push(n)), this.u.sort((e, t) => t.T - e.T), this.u.length > 10) {
|
|
173
|
+
const e = this.u.splice(10);
|
|
174
|
+
for (const t of e) this.l.delete(t.id);
|
|
182
175
|
}
|
|
176
|
+
this.v?.(n);
|
|
183
177
|
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
const B = e => {
|
|
181
|
+
const t = globalThis.requestIdleCallback || setTimeout;
|
|
182
|
+
"hidden" === document.visibilityState ? e() : (t(e = u(e)), document.addEventListener("visibilitychange", e, {
|
|
183
|
+
once: true
|
|
184
|
+
}));
|
|
184
185
|
},
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
document.prerendering ?
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
J = new Date(),
|
|
206
|
-
K = function (e, n) {
|
|
207
|
-
t || (t = n, r = e, i = new Date(), W(removeEventListener), Q());
|
|
208
|
-
},
|
|
209
|
-
Q = function () {
|
|
210
|
-
if (r >= 0 && r < i - J) {
|
|
211
|
-
var e = {
|
|
212
|
-
entryType: "first-input",
|
|
213
|
-
name: t.type,
|
|
214
|
-
target: t.target,
|
|
215
|
-
cancelable: t.cancelable,
|
|
216
|
-
startTime: t.timeStamp,
|
|
217
|
-
processingStart: t.timeStamp + r
|
|
218
|
-
};
|
|
219
|
-
o.forEach(function (n) {
|
|
220
|
-
n(e);
|
|
221
|
-
}), o = [];
|
|
222
|
-
}
|
|
223
|
-
},
|
|
224
|
-
U = function (e) {
|
|
225
|
-
if (e.cancelable) {
|
|
226
|
-
var n = (e.timeStamp > 1e12 ? new Date() : performance.now()) - e.timeStamp;
|
|
227
|
-
"pointerdown" == e.type ? function (e, n) {
|
|
228
|
-
var t = function () {
|
|
229
|
-
K(e, n), i();
|
|
230
|
-
},
|
|
231
|
-
r = function () {
|
|
232
|
-
i();
|
|
233
|
-
},
|
|
234
|
-
i = function () {
|
|
235
|
-
removeEventListener("pointerup", t, G), removeEventListener("pointercancel", r, G);
|
|
236
|
-
};
|
|
237
|
-
addEventListener("pointerup", t, G), addEventListener("pointercancel", r, G);
|
|
238
|
-
}(n, e) : K(n, e);
|
|
239
|
-
}
|
|
240
|
-
},
|
|
241
|
-
W = function (e) {
|
|
242
|
-
["mousedown", "keydown", "touchstart", "pointerdown"].forEach(function (n) {
|
|
243
|
-
return e(n, U, G);
|
|
244
|
-
});
|
|
245
|
-
},
|
|
246
|
-
X = [100, 300];
|
|
247
|
-
return e.CLSThresholds = w, e.FCPThresholds = S, e.FIDThresholds = X, e.INPThresholds = O, e.LCPThresholds = j, e.TTFBThresholds = _, e.onCLS = function (e, n) {
|
|
248
|
-
n = n || {}, b(m(function () {
|
|
249
|
-
var t,
|
|
250
|
-
r = f("CLS", 0),
|
|
251
|
-
i = 0,
|
|
252
|
-
o = [],
|
|
253
|
-
a = function (e) {
|
|
254
|
-
e.forEach(function (e) {
|
|
255
|
-
if (!e.hadRecentInput) {
|
|
256
|
-
var n = o[0],
|
|
257
|
-
t = o[o.length - 1];
|
|
258
|
-
i && e.startTime - t.startTime < 1e3 && e.startTime - n.startTime < 5e3 ? (i += e.value, o.push(e)) : (i = e.value, o = [e]);
|
|
259
|
-
}
|
|
260
|
-
}), i > r.value && (r.value = i, r.entries = o, t());
|
|
186
|
+
N = [200, 500];
|
|
187
|
+
class S {
|
|
188
|
+
m;
|
|
189
|
+
h(e) {
|
|
190
|
+
this.m?.(e);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
const q = [2500, 4e3],
|
|
194
|
+
O = [800, 1800],
|
|
195
|
+
V = e => {
|
|
196
|
+
document.prerendering ? b(() => V(e)) : "complete" !== document.readyState ? addEventListener("load", () => V(e), true) : setTimeout(e);
|
|
197
|
+
};
|
|
198
|
+
return e.CLSThresholds = E, e.FCPThresholds = P, e.INPThresholds = N, e.LCPThresholds = q, e.TTFBThresholds = O, e.onCLS = (e, t = {}) => {
|
|
199
|
+
T(u(() => {
|
|
200
|
+
let s,
|
|
201
|
+
r = c("CLS", 0);
|
|
202
|
+
const a = d(t, h),
|
|
203
|
+
u = e => {
|
|
204
|
+
for (const t of e) a.h(t);
|
|
205
|
+
a.i > r.value && (r.value = a.i, r.entries = a.o, s());
|
|
261
206
|
},
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
}),
|
|
266
|
-
i = 0, r =
|
|
267
|
-
|
|
268
|
-
});
|
|
269
|
-
}), setTimeout(t, 0));
|
|
207
|
+
l = f("layout-shift", u);
|
|
208
|
+
l && (s = i(e, r, E, t.reportAllChanges), document.addEventListener("visibilitychange", () => {
|
|
209
|
+
"hidden" === document.visibilityState && (u(l.takeRecords()), s(true));
|
|
210
|
+
}), n(() => {
|
|
211
|
+
a.i = 0, r = c("CLS", 0), s = i(e, r, E, t.reportAllChanges), o(() => s());
|
|
212
|
+
}), setTimeout(s));
|
|
270
213
|
}));
|
|
271
|
-
}, e.onFCP =
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
h = d("first-input", p);
|
|
283
|
-
i = l(e, u, X, n.reportAllChanges), h && (v(m(function () {
|
|
284
|
-
p(h.takeRecords()), h.disconnect();
|
|
285
|
-
})), c(function () {
|
|
286
|
-
var a;
|
|
287
|
-
u = f("FID"), i = l(e, u, X, n.reportAllChanges), o = [], r = -1, t = null, W(addEventListener), a = s, o.push(a), Q();
|
|
288
|
-
}));
|
|
289
|
-
});
|
|
290
|
-
}, e.onINP = function (e, n) {
|
|
291
|
-
"PerformanceEventTiming" in self && "interactionId" in PerformanceEventTiming.prototype && (n = n || {}, L(function () {
|
|
292
|
-
var t;
|
|
293
|
-
k();
|
|
294
|
-
var r,
|
|
295
|
-
i = f("INP"),
|
|
296
|
-
o = function (e) {
|
|
297
|
-
q(function () {
|
|
298
|
-
e.forEach(N);
|
|
299
|
-
var n = x();
|
|
300
|
-
n && n.latency !== i.value && (i.value = n.latency, i.entries = n.entries, r());
|
|
214
|
+
}, e.onFCP = T, e.onINP = (e, t = {}) => {
|
|
215
|
+
globalThis.PerformanceEventTiming && "interactionId" in PerformanceEventTiming.prototype && b(() => {
|
|
216
|
+
F();
|
|
217
|
+
let o,
|
|
218
|
+
s = c("INP");
|
|
219
|
+
const r = d(t, A),
|
|
220
|
+
a = e => {
|
|
221
|
+
B(() => {
|
|
222
|
+
for (const t of e) r.h(t);
|
|
223
|
+
const t = r.P();
|
|
224
|
+
t && t.T !== s.value && (s.value = t.T, s.entries = t.entries, o());
|
|
301
225
|
});
|
|
302
226
|
},
|
|
303
|
-
|
|
304
|
-
durationThreshold:
|
|
227
|
+
h = f("event", a, {
|
|
228
|
+
durationThreshold: t.durationThreshold ?? 40
|
|
305
229
|
});
|
|
306
|
-
|
|
230
|
+
o = i(e, s, N, t.reportAllChanges), h && (h.observe({
|
|
307
231
|
type: "first-input",
|
|
308
232
|
buffered: true
|
|
309
|
-
}),
|
|
310
|
-
|
|
311
|
-
}),
|
|
312
|
-
|
|
233
|
+
}), document.addEventListener("visibilitychange", () => {
|
|
234
|
+
"hidden" === document.visibilityState && (a(h.takeRecords()), o(true));
|
|
235
|
+
}), n(() => {
|
|
236
|
+
r.p(), s = c("INP"), o = i(e, s, N, t.reportAllChanges);
|
|
313
237
|
}));
|
|
314
|
-
})
|
|
315
|
-
}, e.onLCP =
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
238
|
+
});
|
|
239
|
+
}, e.onLCP = (e, t = {}) => {
|
|
240
|
+
b(() => {
|
|
241
|
+
const s = y();
|
|
242
|
+
let a,
|
|
243
|
+
h = c("LCP");
|
|
244
|
+
const l = d(t, S),
|
|
245
|
+
m = e => {
|
|
246
|
+
t.reportAllChanges || (e = e.slice(-1));
|
|
247
|
+
for (const t of e) l.h(t), t.startTime < s.firstHiddenTime && (h.value = Math.max(t.startTime - r(), 0), h.entries = [t], a());
|
|
324
248
|
},
|
|
325
|
-
|
|
326
|
-
if (
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
249
|
+
g = f("largest-contentful-paint", m);
|
|
250
|
+
if (g) {
|
|
251
|
+
a = i(e, h, q, t.reportAllChanges);
|
|
252
|
+
const s = u(() => {
|
|
253
|
+
m(g.takeRecords()), g.disconnect(), a(true);
|
|
330
254
|
});
|
|
331
|
-
["keydown", "click"]
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
}), v(u), c(function (r) {
|
|
339
|
-
i = f("LCP"), t = l(e, i, j, n.reportAllChanges), p(function () {
|
|
340
|
-
i.value = performance.now() - r.timeStamp, V[i.id] = true, t(true);
|
|
255
|
+
for (const e of ["keydown", "click", "visibilitychange"]) addEventListener(e, () => B(s), {
|
|
256
|
+
capture: true,
|
|
257
|
+
once: true
|
|
258
|
+
});
|
|
259
|
+
n(n => {
|
|
260
|
+
h = c("LCP"), a = i(e, h, q, t.reportAllChanges), o(() => {
|
|
261
|
+
h.value = performance.now() - n.timeStamp, a(true);
|
|
341
262
|
});
|
|
342
263
|
});
|
|
343
264
|
}
|
|
344
265
|
});
|
|
345
|
-
}, e.onTTFB =
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
t = f("TTFB", 0), (r = l(e, t, _, n.reportAllChanges))(true);
|
|
266
|
+
}, e.onTTFB = (e, t = {}) => {
|
|
267
|
+
let o = c("TTFB"),
|
|
268
|
+
a = i(e, o, O, t.reportAllChanges);
|
|
269
|
+
V(() => {
|
|
270
|
+
const d = s();
|
|
271
|
+
d && (o.value = Math.max(d.responseStart - r(), 0), o.entries = [d], a(true), n(() => {
|
|
272
|
+
o = c("TTFB", 0), a = i(e, o, O, t.reportAllChanges), a(true);
|
|
353
273
|
}));
|
|
354
274
|
});
|
|
355
275
|
}, e;
|