<script>
(() => {
"use strict";
const parameters = new URLSearchParams(location.search);
if (
window.self === window.top ||
parameters.get("gt_contact_frame") !== "1"
) {
return;
}
if (window.__gtContactSizeReporter) return;
window.__gtContactSizeReporter = true;
const allowedParents = new Set([
"https://gerometayao.com",
"https://www.gerometayao.com",
"https://tech.gerometayao.com"
]);
let parentOrigin = null;
let frame = 0;
let lastBottom = 0;
try {
const origin = new URL(document.referrer).origin;
if (allowedParents.has(origin)) {
parentOrigin = origin;
}
} catch {
// A validated parent request can establish the origin.
}
function reportSize() {
frame = 0;
const form = document.getElementById("wpforms-133");
if (!form || !parentOrigin) return;
/*
Measure through the bottom of the form, including its
current validation errors or submission confirmation.
*/
const bottom = Math.ceil(
form.getBoundingClientRect().bottom + window.scrollY + 28
);
if (bottom < 160 || bottom === lastBottom) return;
lastBottom = bottom;
window.parent.postMessage(
{
type: "GT_CONTACT_FORM_SIZE",
bottom
},
parentOrigin
);
}
function scheduleReport() {
if (frame) return;
frame = requestAnimationFrame(reportSize);
}
window.addEventListener("message", (event) => {
if (
event.source !== window.parent ||
!allowedParents.has(event.origin) ||
!event.data ||
event.data.type !== "GT_CONTACT_REQUEST_SIZE"
) {
return;
}
parentOrigin = event.origin;
lastBottom = 0;
scheduleReport();
});
function start() {
const form = document.getElementById("wpforms-133");
if (!form) return;
if ("ResizeObserver" in window) {
const observer = new ResizeObserver(scheduleReport);
observer.observe(form);
}
const mutations = new MutationObserver(scheduleReport);
mutations.observe(form, {
subtree: true,
childList: true,
attributes: true,
characterData: true
});
window.addEventListener("resize", scheduleReport);
window.addEventListener("load", scheduleReport);
form.addEventListener("input", scheduleReport, true);
form.addEventListener("change", scheduleReport, true);
form.addEventListener("load", scheduleReport, true);
if (document.fonts?.ready) {
document.fonts.ready.then(scheduleReport);
}
scheduleReport();
}
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", start, {
once: true
});
} else {
start();
}
})();
</script>