{"version":3,"sources":["app.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"scripts.js","sourcesContent":["(function($){\n //Validacao de email e Mascara de telefone\n jQuery.validator.addMethod(\"testEmail\", function (value, element) {\n return this.optional(element) || /[-0-9a-zA-Z.+_]+@[-0-9a-zA-Z.+_]+\\.[a-zA-Z]{2,4}/i.test(value);\n }, \"Digite e-mail valido.\");\n\n var SPMaskBehavior = function (val) {\n return val.replace(/\\D/g, '').length === 11 ? '(00) 00000-0000' : '(00) 0000-00009';\n }, spOptions = {\n onKeyPress: function (val, e, field, options) {\n field.mask(SPMaskBehavior.apply({}, arguments), options);\n }\n };\n $('.celular-input').mask(SPMaskBehavior, spOptions);\n var CPFMaskBehavior = function (val) {\n return val.replace(/\\D/g, '').length === 11 ? '000.000.000-00' : '000.000.000-00';\n }, cpfOptions = {\n onKeyPress: function (val, e, field, options) {\n field.mask(CPFMaskBehavior.apply({}, arguments), options);\n }\n }\n $('.cpf-input').mask(CPFMaskBehavior, cpfOptions);\n var DateMaskBehavior = function (val) {\n return val.replace(/\\D/g, '').length === 8 ? '00-00-0000' : '00-00-0000';\n }, DateOptions= {\n onKeyPress: function (val, e, field, options) {\n field.mask(DateMaskBehavior.apply({}, arguments), options);\n }\n }\n $('.date-input').mask(DateMaskBehavior, DateOptions);\n var AppForm = function(){\n return{\n searchForm: function () {\n var cont = 0;\n $('#formConsulta').validate({\n rules: {\n chassi: {\n required: true,\n minlength: 7\n },\n optionCliente: {\n required: true\n }\n },\n messages: {\n chassi: {\n required: 'Informe o número do chassi',\n minlength: 'Informe o número completo do chassi'\n },\n optionCliente: {\n required: 'Selecione o tipo de Cliente'\n }\n }, submitHandler: function (form) {\n data = $('#formConsulta').serialize();\n var actBtn = $(form).find('button[type=\"submit\"]');\n var oldText = actBtn.text();\n var url = '/chassi';\n var divTarget = $('.content-sect');\n oldText = actBtn.text();\n actBtn.text('Consultando ...');\n actBtn.prop('disabled', true);\n $.ajax({\n url: url,\n data: data,\n dataType: 'json',\n method: 'post'\n }).done(function(jsondata){\n console.info(jsondata);\n if(jsondata.length == 0){\n if($('label.main.error').length == 0){\n element = '';\n actBtn.text(oldText);\n actBtn.prop('disabled', false);\n divTarget.removeClass('loaded');\n $('.newsletter-sect').removeClass('loaded');\n $('.main-sect .content-wrapper').append(element);\n }\n else {\n divTarget.removeClass('loaded');\n $('.newsletter-sect').removeClass('loaded');\n actBtn.text(oldText);\n actBtn.prop('disabled', false);\n return false;\n }\n }else{\n $('label.error').remove();\n divTarget.find('.block').remove();\n divTarget.find('.car-info .chassi .value').html(jsondata[0].num_chassi);\n divTarget.find('.car-info .modelo .value').html(jsondata[0].modelo);\n $.each(jsondata, function (data) {\n element =\n '