text: /* eslint-disable-next-line no-unused-vars */
  function clearForm() {
      document.getElementById('errorMessage').innerHTML = '&thinsp;';
      let form = document.forms.mainForm.getElementsByTagName('input');
  
      for (let i = 0; i < form.length; i++) {
          if (form[i].id !== 'cidrBlock') {
              form[i].value = '';
          }
      }
  }
  
  /* eslint-disable-next-line no-unused-vars */
  async function calculateCIDR() {
  
      const resp = await fetch('/calculate', {
          headers: {
              'Content-Type': 'application/json',
              CIDR: document.getElementById('cidrBlock').value,
          },
      });
  
      const response = await resp.json();
  
      if ('ERROR' in response) {
          document.getElementById('errorMessage').innerHTML = response.ERROR;
          setTimeout(() => { document.getElementById('errorMessage').innerHTML = '&thinsp;'; }, 5000);
      } else {
          Object.entries(response).forEach(([key, val]) => {
              document.getElementById(key).value = val;
          });
      }
  }
  