100 lines
3.0 KiB
JavaScript
100 lines
3.0 KiB
JavaScript
// Metro module 1055 (f1056).
|
|
import { getVisibilityWatcher } from "./onVisibilityUpdate";
|
|
import { whenActivated } from "./Module1038";
|
|
import { initInteractionCountPolyfill } from "./updateEstimate";
|
|
import { initMetric } from "./Module1044";
|
|
import { initUnique } from "./Module1049";
|
|
import { InteractionManager } from "./InteractionManager";
|
|
import { whenIdleOrHidden } from "./Module1053";
|
|
import { observe } from "./Module1046";
|
|
import { bindReporter } from "./Module1047";
|
|
function $mk113588($env) {
|
|
return () => {
|
|
let r17;
|
|
let r3 = $env[0][Symbol.iterator]();
|
|
const next = r3.next;
|
|
const r1 = $env.$parent;
|
|
while (true) {
|
|
const r6 = r3 === void 0 ? void 0 : (r17 = next.call(r3)).done ? r3 = void 0 : r17.value;
|
|
if (r3 === void 0) {
|
|
const r27 = r1[2]._estimateP98LongestInteraction();
|
|
if (r27 && r27._latency !== r1[1].value) {
|
|
const r32 = r1[1];
|
|
r32.value = r27._latency;
|
|
r32.entries = r27.entries;
|
|
(0, r1[0])();
|
|
}
|
|
return void 0;
|
|
}
|
|
try {
|
|
r1[2]._processEntry(r6);
|
|
} catch (r24) {
|
|
if (r3 !== void 0 && typeof r3.return === "function") {
|
|
try {
|
|
r3.return();
|
|
} catch {}
|
|
}
|
|
throw r24;
|
|
}
|
|
}
|
|
};
|
|
}
|
|
let env865 = {};
|
|
Object.defineProperty(exports, Symbol.toStringTag, {
|
|
value: "Module"
|
|
});
|
|
const c865_2 = [200, 500];
|
|
export { c865_2 as INPThresholds };
|
|
export const onINP = function(c12684_0, r7 = {}) {
|
|
let visibilityWatcher;
|
|
let c12684_1 = r7;
|
|
visibilityWatcher = void 0;
|
|
if (globalThis.globalThis.PerformanceEventTiming && "interactionId" in PerformanceEventTiming.prototype) {
|
|
visibilityWatcher = getVisibilityWatcher();
|
|
whenActivated(() => {
|
|
let env24026 = {
|
|
$parent: env865
|
|
};
|
|
initInteractionCountPolyfill();
|
|
const r11 = initMetric("INP");
|
|
env24026[1] = r11;
|
|
env24026[2] = initUnique(c12684_1, InteractionManager);
|
|
const handleEntries = (a0) => {
|
|
let env28747;
|
|
const r1 = env28747 = {
|
|
$parent: env24026
|
|
};
|
|
env28747[0] = a0;
|
|
whenIdleOrHidden($mk113588(r1));
|
|
};
|
|
env24026[3] = handleEntries;
|
|
let durationThreshold = c12684_1.durationThreshold;
|
|
if (durationThreshold == null) {
|
|
durationThreshold = 40;
|
|
}
|
|
const r37 = observe("event", handleEntries, {
|
|
durationThreshold
|
|
});
|
|
env24026[4] = r37;
|
|
env24026[0] = bindReporter(c12684_0, r11, c865_2, c12684_1.reportAllChanges);
|
|
if (r37) {
|
|
r37.observe({
|
|
type: "first-input",
|
|
buffered: true
|
|
});
|
|
visibilityWatcher.onHidden(() => {
|
|
const r3 = env24026[3];
|
|
const r7 = env24026[4].takeRecords();
|
|
let env28748;
|
|
const r9 = env28748 = {
|
|
$parent: env24026
|
|
};
|
|
env28748[0] = r7;
|
|
whenIdleOrHidden($mk113588(r9));
|
|
(0, env24026[0])(true);
|
|
});
|
|
}
|
|
});
|
|
}
|
|
};
|