PageSourceSearch

https://www.topstudy.com/assets/scripts/get-in-touch.js?v=mur0p95w

js topstudy.com collected 2026-10-04 23:54:21 UTC 1,981 bytes, 65 lines download raw bytes

1import LanguageApi from './api/language-api.js'
2import RouterTranslationApi from './api/router-translation-api.js'
3import {showLoader, hideLoader} from './helpers/loader.js'
4const getInTouch = document.querySelector('.get-in-touch')
5const form = getInTouch.querySelector('form')
6
7let isShown = false
8
9// showContactForm()
10
11function showContactForm() {
12    if (isShown) return
13    getInTouch.classList.add('active')
14    document.body.classList.add('overflow-hidden')
15    const script = document.createElement('script')
16    script.src = '/assets/scripts/phone-number-input.js'
17    script.type = 'module'
18    script.defer = true
19    document.body.appendChild(script)
20    isShown = true
21    setTimeout(() => {
22        if (document.querySelector('.get-lead')?.classList.contains('active')) {
23            document.querySelector('.get-lead').classList.remove('active')
24        }
25    }, 1000)
26}
27
28getInTouch.addEventListener('click', e => {
29    if (e.target.classList.contains('get-in-touch')) {
30        getInTouch.classList.remove('active')
31        document.body.classList.remove('overflow-hidden')
32    }
33})
34
35form.addEventListener('submit', async e => {
36    e.preventDefault()
37    showLoader()
38    const formData = new FormData(form)
39
40    const {name, surname, phoneNumber, email} = Object.fromEntries(formData)
41
42    const response = await fetch('/lead/send-lead/request', {
43        method: 'POST',
44        body: JSON.stringify({
45            name,
46            surname,
47            phoneNumber,
48            email,
49            prefferedLanguage: LanguageApi.currentLanguage,
50        }),
51        headers: {
52            'content-type': 'application/json',
53        },
54    })
55    hideLoader()
56    if (response.ok) {
57        window.location.href = RouterTranslationApi.routes.requestReceived
58        hideLoader()
59    }
60})
61
62getInTouch.querySelector('.close-form').addEventListener('click', () => {
63    getInTouch.classList.remove('active')
64    document.body.classList.remove('overflow-hidden')
65})

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.