1function initQuiz() { let e = document.querySelector(".quiz-main__link"), t = document.querySelector("#quiz-main__link-prev"), n = document.querySelector("#quiz-main__link-next"), i = 1, r = {}, a = document.querySelector("#quiz-form"), s = document.querySelectorAll("input"), u = document.querySelectorAll(".quiz-info__block-send__input"); function o(e) { let t = Number(e.getAttribute("min")), n = Number(e.getAttribute("max")); e.value < t && (e.value = t), e.value > n && (e.value = n) } a.addEventListener("submit", function (e) { e.preventDefault() }), document.querySelector(".quiz-info__block-send__btn").addEventListener("click", async function (e) { e.preventDefault(); let t = a.querySelectorAll("div.error"); for (el of t) el.remove(); for (L of u) L.classList.contains("required") && L.classList.contains("err") && L.classList.remove("err"); var n = []; for (inp of u) if (inp.classList.contains("required")) { switch (inp.getAttribute("name")) { case "name": "" == inp.value && (inp.insertAdjacentHTML("beforeBegin", '<div class="error">ÐаполниÑе поле</div>'), inp.classList.add("err"), n.push("false")); break; case "phone": "" == inp.value ? (inp.insertAdjacentHTML("beforeBegin", '<div class="error">ÐаполниÑе поле</div>'), inp.classList.add("err"), n.push("false")) : inp.value != inp.value.match(/\+7 \(\d\d\d\) \d\d\d-\d\d-\d\d/) && (inp.insertAdjacentHTML("beforeBegin", '<div class="error">ÐведиÑе валиднÑй номеÑ</div>'), inp.classList.add("err"), n.push("false")) } } n.includes("false") || (document.querySelector("input.url").value = document.location.href, document.querySelector("input.title").value = document.querySelector("title").innerText, this.setAttribute("disabled", ""), this.querySelector(".textSend").style.display = "none", this.querySelector(".svgSend").style.display = "block", await fetch("/quiz/handler/handler.php", { method: "POST", body: new FormData(a) }).then(async e => { let t = await e.json(); var ct_frm = jQuery(this).closest('form'); var ct_site_id = '40520'; var ct_sub = 'ÐÑойден ÑеÑÑ'; var ct_fio = ct_frm.find('input[name="name"]').val(); var ct_phone = ct_frm.find('input[name="phone"]').val(); var ct_data = { fio: ct_fio, phoneNumber: ct_phone, subject: ct_sub, requestUrl: location.href, sessionId: window.call_value }; console.log(ct_data); if (!!ct_phone && /^\+\d \(\d\d\d\) \d\d\d-\d\d-\d\d$/igm.test(ct_phone) && !!ct_fio) { jQuery.ajax({ url: 'https://api.calltouch.ru/calls-service/RestAPI/requests/' + ct_site_id + '/register/', dataType: 'json', type: 'POST', data: ct_data, async: false }); } "ok" == t.status && (document.querySelector(".quiz").classList.add("dn"), document.querySelector(".quiz_wrap__success").classList.remove("dn"), this.querySelector(".textSend").style.display = "block", this.querySelector(".svgSend").style.display = "none", this.removeAttribute("disabled")), console.info("response: ", t) }).catch(function (e) { console.error("Failed to fetch page: ", e) })) }); let l = document.querySelectorAll(".quiz-main__answer-input-area-range"); for (ran of l) ran.addEventListener("change", function () { this.parentNode.querySelector(".quiz-main__answer-input-area-number").value = this.value, c(this, this.value, this.getAttribute("min"), this.getAttribute("max")) }); let d = document.querySelectorAll(".quiz-main__answer-input-area-number"); for (num of d) num.addEventListener("input", function () { this.value = this.value.replace(/\D/, ""), this.parentNode.parentNode.querySelector(".quiz-main__answer-input-area-range").value = this.value }), num.addEventListener("blur", function () { o(this) }); function c(e, t, n, i) { let r = Math.round(100 * Number(t) / (i - n) - (Number(n) + 1)), a = `linear-gradient(to right, ${getComputedStyle(e).getPropertyValue("--color-base")} 0%, \n ${getComputedStyle(e).getPropertyValue("--color-base")} ${r}%, \n rgba(255,255,255,0.1) ${r}%, \n rgba(255,255,255,0) 100%)`; e.style.setProperty("--runnable-track", a) } for (inp of s) inp.addEventListener("change", m), (inp.classList.contains("range") || inp.classList.contains("prevent")) && inp.addEventListener("keydown", function (e) { 13 == e.keyCode && (e.preventDefault(), o(this)) }); function m() { n.removeAttribute("disabled"), i in r || (r[i] = !0), this.classList.contains("next") && (h(n), y()) } let v = document.querySelectorAll(".answer-big.send input"); for (inp of v) inp.addEventListener("click", function () { document.querySelector(".quiz-info__block-send__btn").removeAttribute("disabled") }); let q = Number(a.getAttribute("data-question-num")); var _ = 100, f = document.querySelector("#progress"); function p(e, t) { let n = e / t; var i = Math.round(_ / n) + "%"; f.style.width = i, f.innerText = i } function y() { document.getElementById("quiz-form").scrollIntoView() } function h(a) { document.querySelector('.quiz-main__question[data-id="' + i + '"]').classList.add("dn"), document.querySelector('.quiz-info__block[data-id="' + i + '"]').classList.add("dn"), r[++i] ? n.removeAttribute("disabled") : a.setAttribute("disabled", ""), i <= q ? (document.querySelector('.quiz-main__question[data-id="' + i + '"]').classList.remove("dn"), document.querySelector('.quiz-info__block[data-id="' + i + '"]').classList.remove("dn"), p(q, i), 2 == i && (t.classList.remove("dn"), e.classList.remove("end"))) : (document.querySelector(".quiz-main").classList.add("dn"), document.querySelector("#quiz-info").classList.add("dn"), document.querySelector(".quiz").classList.add("send"), document.querySelector(".quiz-info__block.send").classList.remove("dn")) } function b(e) { var t = 0, n = "+7 (___) ___-__-__".replace(/\D/g, ""), i = this.value.replace(/\D/g, ""); n.length >= i.length && (i = n), this.value = "+7 (___) ___-__-__".replace(/./g, function (e) { return /[_\d]/.test(e) && t < i.length ? i.charAt(t++) : t >= i.length ? "" : e }), "blur" == e.type ? 2 == this.value.length && (this.value = "") : function (e, t) { if (t.focus(), t.setSelectionRange) t.setSelectionRange(e, e); else if (t.createTextRange) { var n = t.createTextRange(); n.collapse(!0), n.moveEnd("character", e), n.moveStart("character", e), n.select() } }(this.value.length, this) } p(q, i), t.addEventListener("click", function (a) { a.preventDefault(), document.querySelector('.quiz-main__question[data-id="' + i + '"]').classList.add("dn"), document.querySelector('.quiz-info__block[data-id="' + i + '"]').classList.add("dn"), r[--i] && n.removeAttribute("disabled"), document.querySelector('.quiz-main__question[data-id="' + i + '"]').classList.remove("dn"), document.querySelector('.quiz-info__block[data-id="' + i + '"]').classList.remove("dn"), p(q, i), 1 == i && (t.classList.add("dn"), e.classList.add("end")), y() }), n.addEventListener("click", function (e) { e.preventDefault(), h(this), y() }); for (var S = document.querySelectorAll('.quiz-info__block-send__input[type="tel"]'), L = 0; L < S.length; L++)S[L].addEventListener("input", b, !1), S[L].addEventListener("focus", b, !1), S[L].addEventListener("blur", b, !1) }
1 initQuiz();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.