(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i 1000 && timeElapsed < 2000 && document.body.clientHeight !== pageHeight) { (0, _scrollToElement["default"])(form.element); } }); } if (submittedForm) { var element = document.getElementById(submittedForm.element_id); var form = forms.getByElement(element); handleFormRequest(form, submittedForm.event, submittedForm.errors, submittedForm.data); } },{"./misc/scroll-to-element.js":2}],2:[function(require,module,exports){ "use strict"; function scrollTo(element) { var x = window.pageXOffset || document.documentElement.scrollLeft; var y = calculateScrollOffset(element); window.scrollTo(x, y); } function calculateScrollOffset(elem) { var body = document.body; var html = document.documentElement; var elemRect = elem.getBoundingClientRect(); var clientHeight = html.clientHeight; var documentHeight = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight); var scrollPosition = elemRect.bottom - clientHeight / 2 - elemRect.height / 2; var maxScrollPosition = documentHeight - clientHeight; return Math.min(scrollPosition + window.pageYOffset, maxScrollPosition); } module.exports = scrollTo; },{}]},{},[1]);