Google Scripts braces unrecognized (JavaScript based)
<p>That's my first post here.
I've coded the script below for send some daily notifications.
The first 3 braces aren't recognized by Google Script terminal, but when I copy this code to Notepad++, it shows all opened and closed braces in their right places.
Can someone help me?</p>

<p>Code:</p>

<pre><code>function MailNotificacaoEmpresa(array, id){
  try{
    var url = "https://docs.google.com/spreadsheets/d/" + id;
    var responsavel;
    var emailResponsavel;
    responsavel = '';
    emailResponsavel = '';
    var x, y, assunto;
    //  assunto = x = y = 'TESTE';
    var parceiro = array.split("/*-*/")[4].toLowerCase();
    (parceiro == '' || parceiro == '' || parceiro == '' || parceiro == '') ? parceiro = '' : parceiro = array.split("/*-*/")[4].toLowerCase();
    assunto = (parceiro == '') ? '' : '';
    var empresa = array.split("/*-*/")[6];
    var nome = array.split("/*-*/")[1];
    var estado = array.split("/*-*/")[2];
    var cidade = array.split("/*-*/")[3];
    var eixo = array.split("/*-*/")[5];
    var fixo = array.split("/*-*/")[8];
    var celular = array.split("/*-*/")[9];
    var email = array.split("/*-*/")[10];
    var dId = '';
    var doc = DocumentApp.openById(dId);
    var body = doc.getText();
    var replacement;

    switch (eixo.toLowerCase()){
      case '':
        x = y = ''
        responsavel = '';
        emailResponsavel = '';
        break;
      case '':
        x = y = '';
        switch(estado.toLowerCase()){
          case '':
            responsavel = '';
            emailResponsavel = '';
            break;
          case '':
            (cidade.toLowerCase() == '') ? responsavel = '' : responsavel = '';
            (cidade.toLowerCase() == '') ? emailResponsavel = '' : emailResponsavel = ''; 
            break;
          case '':
            responsavel = '';
            emailResponsavel = '';
            break;
          default:
            responsavel = '';
            emailResponsavel = ''; 
        }
        break;
      case '':
        x = y = '';
        switch(estado.toLowerCase()){
          case '':
            responsavel = '';
            emailResponsavel = '';
            break;
          case '':
            (cidade.toLowerCase() == '') ? responsavel = '' : responsavel = '';
            (cidade.toLowerCase() == '') ? emailResponsavel = '' : emailResponsavel = ''; 
            break;
          case '':
            responsavel = '';
            emailResponsavel = '';
            break;
          default:
            responsavel = '';
            emailResponsavel = ''; 
        }
        break;
      case '':
        x = y = ''
        switch(estado.toLowerCase()){
          case '':
            responsavel = '';
            emailResponsavel = '';
            break;
          case '':
            responsavel = '';
            emailResponsavel = '';
            break;
          default:
            responsavel = '';
            emailResponsavel = ''; 
        }
        break;
      case '':
        x = ''
        y = (parceiro == '') ? '' : '';
        responsavel = '';
        emailResponsavel = '';
        break;
      case '':
        x = ''
        y = (parceiro == '') ? '' : '';
        responsavel = '';
        emailResponsavel = '';
        break;
      case'':
        x = '';
        y = '';
        responsavel = '';
        emailResponsavel = '';
    }

    var keys = {
      RESPONSAVEL: responsavel,
      EIXOX: x,
      SPREADSHEET: url,
      EIXOY: y
    }

    var k;
    for (k in keys){
      if (keys.hasOwnProperty(k)){
        replacement = new RegExp("%" + k + "%",'g');
        body = body.replace(replacement, keys[k]);
      }
    }

    MailApp.sendEmail(emailResponsavel, assunto, 'textBody', {htmlBody: body});
  }catch(erro){
    trataErro(erro);
  }
}
</code></pre>