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C,EAAS,MAAM,CAAC,WAAY,GAC5B,EAAS,MAAM,CAAC,SAAU,GAC1B,EAAS,MAAM,CAAC,UAAW,GAC3B,EAAS,MAAM,CAAC,UAAW,GAC3B,EAAY,kDAAmD,EACnE,IAkGY,EAAK,KAAK,GAElB,EA0CJ","sources":["","contact.js"],"sourcesContent":["const menuContainer = document.querySelector('.menu-icons');\nconst navigationContainer = document.querySelector('.navigation-container');\nconst phoneInput = document.getElementById('phone');\n// toggle menu\nlet openMenu = true;\nmenuContainer.addEventListener('click', ()=>{\n menuContainer.classList.toggle('change');\n if (openMenu) {\n navigationContainer.style.display = 'block';\n openMenu = false;\n } else {\n navigationContainer.style.display = 'none';\n openMenu = true;\n }\n});\n// acknowledgment\nfunction showAcknowledgment(message, isSuccess) {\n const statusDiv = document.getElementById('status');\n statusDiv.style.display = 'block'; // Show status\n statusDiv.style.color = isSuccess ? '#f0e1d9' : 'red';\n statusDiv.textContent = message;\n setTimeout(()=>{\n statusDiv.textContent = '';\n }, 2500);\n}\n// sending mails\nasync function sendRequest(url, formData) {\n const statusDiv = document.getElementById('status');\n statusDiv.style.display = 'block';\n statusDiv.style.color = '#f0e1d9'; // Indicate process\n statusDiv.textContent = \"Sending... \\u23F3\";\n try {\n const response = await fetch(url, {\n method: 'POST',\n body: formData\n });\n if (response.ok) showAcknowledgment(\"Inquiry sent successfully \\u2705, thank you\", true);\n else showAcknowledgment('Failed to send the message.', false);\n } catch (error) {\n showAcknowledgment('Error occurred while sending the message.', false);\n }\n}\nconst intlTelInput = window.intlTelInput(phoneInput, {\n utilsScript: 'https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.8/js/utils.js',\n preferredCountries: [\n 'us',\n 'gb',\n 'in',\n 'au'\n ],\n separateDialCode: true,\n initialCountry: 'auto',\n geoIpLookup: function(callback) {\n fetch('https://ipapi.co/json/').then((response)=>response.json()).then((data)=>callback(data.country_code)).catch(()=>callback('us')); // Fallback to US if IP lookup fails\n }\n});\n// storing form values in formdata\nfunction sendMessage() {\n const userName = document.getElementById('name').value;\n const userEmail = document.getElementById('email').value;\n const userMessage = document.getElementById('message').value;\n const companyName = document.getElementById('company-name').value;\n const fullPhoneNumber = intlTelInput.getNumber();\n const formData = new FormData();\n formData.append('username', `${userName}`);\n formData.append('usermail', userEmail);\n formData.append('number', fullPhoneNumber);\n formData.append('message', userMessage);\n formData.append('company', companyName);\n sendRequest('https://api.anjumaromatics.com/api/send-inquiry', formData);\n}\nfunction resetValue() {\n document.getElementById('name').value = '';\n document.getElementById('email').value = '';\n document.getElementById('phone').value = '';\n document.getElementById('message').value = '';\n document.getElementById('company-name').value = '';\n document.getElementById('status').innerText = '';\n}\nwindow.onclick = function(event) {\n let modal = document.querySelector('.modal');\n if (event.target === modal) {\n modal.style.display = 'none';\n resetValue();\n }\n};\ndocument.addEventListener('DOMContentLoaded', function() {\n const faqQuestions = document.querySelectorAll('.faq-question');\n faqQuestions.forEach((question)=>{\n question.addEventListener('click', function() {\n // Close all other answers and reset arrows\n faqQuestions.forEach((q)=>{\n if (q !== question) {\n q.nextElementSibling.style.display = 'none';\n q.querySelector('.faq-arrow').textContent = \"\\u2193\";\n }\n });\n // Toggle the clicked answer and change the arrow\n const answer = question.nextElementSibling;\n const arrow = question.querySelector('.faq-arrow');\n if (answer.style.display === 'block') {\n answer.style.display = 'none';\n arrow.textContent = \"\\u2193\";\n } else {\n answer.style.display = 'block';\n arrow.textContent = \"\\u2191\";\n }\n });\n });\n const form = document.querySelector('.form-container');\n const nameInput = document.getElementById('name');\n const companyName = document.getElementById('company-name');\n const emailInput = document.getElementById('email');\n const phoneInput = document.getElementById('phone');\n const messageInput = document.getElementById('message');\n const submitButton = document.querySelector('.submit-button');\n const statusDiv = document.getElementById('status');\n submitButton.addEventListener('click', function(event) {\n let isValid = true;\n statusDiv.innerHTML = ''; // Clear previous messages\n // Name Validation\n if (nameInput.value.trim() === '') {\n showError('Name is required');\n isValid = false;\n }\n if (companyName.value.trim() === '') {\n showError('Company name is required');\n isValid = false;\n }\n // Email Validation (Strict)\n const email = emailInput.value.trim();\n if (!validateEmail(email)) {\n showError('Enter a valid email address');\n isValid = false;\n } else if (isDisposableEmail(email)) {\n showError('Temporary/disposable email addresses are not allowed');\n isValid = false;\n }\n // Phone Validation (Only digits, length 10-15)\n if (!validatePhone(phoneInput.value.trim())) {\n showError('Enter a valid phone number (digits only, 10-15 characters)');\n isValid = false;\n }\n // Message Validation\n if (messageInput.value.trim() === '') {\n showError('Message cannot be empty');\n isValid = false;\n }\n // If form is valid, simulate submission\n if (isValid) {\n statusDiv.style.color = 'green';\n sendMessage();\n form.reset();\n }\n });\n function validateEmail(email) {\n const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$/;\n return emailRegex.test(email);\n }\n function validatePhone(phone) {\n const phoneRegex = /^[0-9]{10,15}$/;\n return phoneRegex.test(phone);\n }\n function isDisposableEmail(email) {\n const tempEmailDomains = [\n 'mailinator.com',\n 'tempmail.com',\n 'disposablemail.com',\n 'guerrillamail.com',\n '10minutemail.com',\n 'yopmail.com',\n 'fakeinbox.com',\n 'throwawaymail.com',\n 'getnada.com',\n 'temp-mail.org',\n 'maildrop.cc',\n 'sharklasers.com',\n 'anonbox.net',\n 'mailsac.com',\n 'mytemp.email',\n 'mailnesia.com'\n ];\n const domain = email.split('@')[1];\n return tempEmailDomains.includes(domain);\n }\n function showError(message) {\n const errorElement = document.createElement('p');\n errorElement.style.color = 'red';\n errorElement.textContent = message;\n statusDiv.appendChild(errorElement);\n }\n});\n\n//# sourceMappingURL=contact.7f363d5d.js.map\n","const menuContainer = document.querySelector('.menu-icons');\r\nconst navigationContainer = document.querySelector('.navigation-container');\r\nconst phoneInput = document.getElementById('phone');\r\n\r\n// toggle menu\r\nlet openMenu = true;\r\nmenuContainer.addEventListener('click', () => {\r\n menuContainer.classList.toggle('change');\r\n if (openMenu) {\r\n navigationContainer.style.display = 'block';\r\n openMenu = false;\r\n } else {\r\n navigationContainer.style.display = 'none';\r\n openMenu = true;\r\n }\r\n});\r\n\r\n// acknowledgment\r\nfunction showAcknowledgment(message, isSuccess) {\r\n const statusDiv = document.getElementById('status');\r\n statusDiv.style.display = 'block'; // Show status\r\n statusDiv.style.color = isSuccess ? '#f0e1d9' : 'red';\r\n statusDiv.textContent = message;\r\n setTimeout(() => {\r\n statusDiv.textContent = '';\r\n }, 2500);\r\n}\r\n\r\n// sending mails\r\nasync function sendRequest(url, formData) {\r\n const statusDiv = document.getElementById('status');\r\n statusDiv.style.display = 'block';\r\n statusDiv.style.color = '#f0e1d9'; // Indicate process\r\n statusDiv.textContent = 'Sending... ⏳';\r\n\r\n try {\r\n const response = await fetch(url, {\r\n method: 'POST',\r\n body: formData,\r\n });\r\n\r\n if (response.ok) {\r\n showAcknowledgment('Inquiry sent successfully ✅, thank you', true);\r\n } else {\r\n showAcknowledgment('Failed to send the message.', false);\r\n }\r\n } catch (error) {\r\n showAcknowledgment('Error occurred while sending the message.', false);\r\n }\r\n}\r\n\r\nconst intlTelInput = window.intlTelInput(phoneInput, {\r\n utilsScript:\r\n 'https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.8/js/utils.js', // Utility script for validation\r\n preferredCountries: ['us', 'gb', 'in', 'au'], // Preferred countries\r\n separateDialCode: true, // Show country code separately\r\n initialCountry: 'auto', // Auto-detect user's country\r\n geoIpLookup: function (callback) {\r\n fetch('https://ipapi.co/json/')\r\n .then((response) => response.json())\r\n .then((data) => callback(data.country_code))\r\n .catch(() => callback('us')); // Fallback to US if IP lookup fails\r\n },\r\n});\r\n\r\n// storing form values in formdata\r\nfunction sendMessage() {\r\n const userName = document.getElementById('name').value;\r\n const userEmail = document.getElementById('email').value;\r\n const userMessage = document.getElementById('message').value;\r\n const companyName = document.getElementById('company-name').value;\r\n const fullPhoneNumber = intlTelInput.getNumber();\r\n\r\n const formData = new FormData();\r\n formData.append('username', `${userName}`);\r\n formData.append('usermail', userEmail);\r\n formData.append('number', fullPhoneNumber);\r\n formData.append('message', userMessage);\r\n formData.append('company', companyName);\r\n sendRequest('https://api.anjumaromatics.com/api/send-inquiry', formData);\r\n}\r\n\r\nfunction resetValue() {\r\n document.getElementById('name').value = '';\r\n document.getElementById('email').value = '';\r\n document.getElementById('phone').value = '';\r\n document.getElementById('message').value = '';\r\n document.getElementById('company-name').value = '';\r\n document.getElementById('status').innerText = '';\r\n}\r\n\r\nwindow.onclick = function (event) {\r\n let modal = document.querySelector('.modal');\r\n if (event.target === modal) {\r\n modal.style.display = 'none';\r\n resetValue();\r\n }\r\n};\r\n\r\ndocument.addEventListener('DOMContentLoaded', function () {\r\n const faqQuestions = document.querySelectorAll('.faq-question');\r\n\r\n faqQuestions.forEach((question) => {\r\n question.addEventListener('click', function () {\r\n // Close all other answers and reset arrows\r\n faqQuestions.forEach((q) => {\r\n if (q !== question) {\r\n q.nextElementSibling.style.display = 'none';\r\n q.querySelector('.faq-arrow').textContent = '↓';\r\n }\r\n });\r\n\r\n // Toggle the clicked answer and change the arrow\r\n const answer = question.nextElementSibling;\r\n const arrow = question.querySelector('.faq-arrow');\r\n\r\n if (answer.style.display === 'block') {\r\n answer.style.display = 'none';\r\n arrow.textContent = '↓';\r\n } else {\r\n answer.style.display = 'block';\r\n arrow.textContent = '↑';\r\n }\r\n });\r\n });\r\n\r\n const form = document.querySelector('.form-container');\r\n const nameInput = document.getElementById('name');\r\n const companyName = document.getElementById('company-name');\r\n const emailInput = document.getElementById('email');\r\n const phoneInput = document.getElementById('phone');\r\n const messageInput = document.getElementById('message');\r\n const submitButton = document.querySelector('.submit-button');\r\n const statusDiv = document.getElementById('status');\r\n\r\n submitButton.addEventListener('click', function (event) {\r\n let isValid = true;\r\n statusDiv.innerHTML = ''; // Clear previous messages\r\n\r\n // Name Validation\r\n if (nameInput.value.trim() === '') {\r\n showError('Name is required');\r\n isValid = false;\r\n }\r\n\r\n if (companyName.value.trim() === '') {\r\n showError('Company name is required');\r\n isValid = false;\r\n }\r\n\r\n // Email Validation (Strict)\r\n const email = emailInput.value.trim();\r\n if (!validateEmail(email)) {\r\n showError('Enter a valid email address');\r\n isValid = false;\r\n } else if (isDisposableEmail(email)) {\r\n showError('Temporary/disposable email addresses are not allowed');\r\n isValid = false;\r\n }\r\n\r\n // Phone Validation (Only digits, length 10-15)\r\n if (!validatePhone(phoneInput.value.trim())) {\r\n showError(\r\n 'Enter a valid phone number (digits only, 10-15 characters)'\r\n );\r\n isValid = false;\r\n }\r\n\r\n // Message Validation\r\n if (messageInput.value.trim() === '') {\r\n showError('Message cannot be empty');\r\n isValid = false;\r\n }\r\n\r\n // If form is valid, simulate submission\r\n if (isValid) {\r\n statusDiv.style.color = 'green';\r\n sendMessage();\r\n form.reset();\r\n }\r\n });\r\n\r\n function validateEmail(email) {\r\n const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$/;\r\n return emailRegex.test(email);\r\n }\r\n\r\n function validatePhone(phone) {\r\n const phoneRegex = /^[0-9]{10,15}$/;\r\n return phoneRegex.test(phone);\r\n }\r\n\r\n function isDisposableEmail(email) {\r\n const tempEmailDomains = [\r\n 'mailinator.com',\r\n 'tempmail.com',\r\n 'disposablemail.com',\r\n 'guerrillamail.com',\r\n '10minutemail.com',\r\n 'yopmail.com',\r\n 'fakeinbox.com',\r\n 'throwawaymail.com',\r\n 'getnada.com',\r\n 'temp-mail.org',\r\n 'maildrop.cc',\r\n 'sharklasers.com',\r\n 'anonbox.net',\r\n 'mailsac.com',\r\n 'mytemp.email',\r\n 'mailnesia.com',\r\n ];\r\n\r\n const domain = email.split('@')[1];\r\n return tempEmailDomains.includes(domain);\r\n }\r\n\r\n function showError(message) {\r\n const errorElement = document.createElement('p');\r\n errorElement.style.color = 'red';\r\n errorElement.textContent = message;\r\n statusDiv.appendChild(errorElement);\r\n }\r\n});\r\n"],"names":["menuContainer","document","querySelector","navigationContainer","phoneInput","getElementById","openMenu","showAcknowledgment","message","isSuccess","statusDiv","style","display","color","textContent","setTimeout","sendRequest","url","formData","response","fetch","method","body","ok","error","addEventListener","classList","toggle","intlTelInput","window","utilsScript","preferredCountries","separateDialCode","initialCountry","geoIpLookup","callback","then","json","data","country_code","catch","onclick","event","modal","target","value","innerText","faqQuestions","querySelectorAll","forEach","question","q","nextElementSibling","answer","arrow","form","nameInput","companyName","emailInput","messageInput","submitButton","showError","errorElement","createElement","appendChild","phone","isValid","innerHTML","trim","email","emailRegex","test","tempEmailDomains","includes","split","phoneRegex","sendMessage","userName","userEmail","userMessage","fullPhoneNumber","getNumber","FormData","append","reset"],"version":3,"file":"contact.7f363d5d.js.map"}