{"version":3,"sources":["assets/src/modules/ElcaCustomEmailSubmit/js/ContactFormRecaptcha.js"],"names":["jsonData","_PostalCode","$","_Country","_City","document","ready","httpGet","theUrl","xmlHttp","XMLHttpRequest","open","send","responseText","attr","change","val","removeAttr","keyup","country","postalCode","jQuery","parseJSON","LSTERR","DSXERR","ZIP_AREA_OUT","ZIP","length","DSXOBJCNL","error","console","info","city","tam","CNL_AREA_OUT","CNL","options","Array","let","i","autocomplete","source","CDXZIP","CountryList","get","forEach","item","index","append","threeLetterIsoCode","name","queryString","QueryStringProcessor","getUrlParams","predIndex","countryCode","toLowerCase","getCountryCode","inputSiteName","each","this","contactUri","find","encodeURI","querySelector","getAttribute","on","event","selectedContactType","recaptchaBox","parentsUntil","parent","show","preventDefault","stopPropagation","post","NAME","COMPANY_NAME","FIRST_NAME","EMAIL","RELATION_TYPE","POSTAL_CODE","COUNTRY","TELEPHONE","SITE_NAME","hide","currentSite","contactFormSfUri","listOfActiveSites","split","contactFormPardotUri","includes","currentWidth","width","setTimeout","currentTarget","form","value","element","trigger","prop","stopImmediatePropagation","e","$this","trim"],"mappings":"AAAA,IAAIA,SACAC,YAAcC,EAAE,qDAChBC,SAAWD,EAAE,6CACbE,MAAQF,EAAE,sCAEdA,EAAEG,UAAUC,MAAM,WAqEd,SAASC,EAAQC,GACb,IAAIC,EAAU,IAAIC,eAGlB,OAFAD,EAAQE,KAAK,MAAOH,GAAQ,GAC5BC,EAAQG,KAAK,MACNH,EAAQI,aAvEnBZ,YAAYa,KAAK,WAAY,YAC7BV,MAAMU,KAAK,WAAY,YAEvBX,SAASY,OAAO,WACU,IAAlBZ,SAASa,OACTf,YAAYa,KAAK,WAAY,YAC7BV,MAAMU,KAAK,WAAY,cAEvBb,YAAYgB,WAAW,YACvBb,MAAMa,WAAW,eAIzBhB,YAAYiB,MAAM,WACd,IAAIC,EAAUhB,SAASa,MACnBI,EAAanB,YAAYe,MAC7B,IAEkC,OAD9BhB,SAAWqB,OAAOC,UAAUf,EAA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,QAAQ,UAC9DjG,EAAE,kBAAkBkG,KAAK,OAAO,SAASpF,IAAI,SAASmF,QAAQ,UAC9DjG,EAAE,kBAAkBkG,KAAK,OAAO,SAASpF,IAAI,SAASmF,QAAQ,UAE9DjG,EAAE,kBAAkBgE,GAAG,QAAS,SAAUC,GACtCA,EAAMM,iBACNN,EAAMO,kBACNP,EAAMkC,2BAGNnG,EAAE,oNAAoNc,IAAI,IAAImF,QAAQ,YAG1OjG,EAAE,kBAAkBgE,GAAG,QAAS,SAAUC,GACtCA,EAAMM,iBACNN,EAAMO,kBACNP,EAAMkC,2BACNnG,EAAE,oNAAoNc,IAAI,IAAImF,QAAQ,YAG1OjG,EAAE,kBAAkBgE,GAAG,QAAS,SAAUC,GACtCA,EAAMM,iBACNN,EAAMO,kBACNP,EAAMkC,2BACNnG,EAAE,0BAA0Be,WAAW,YACpBf,EAAE0D,MAAMU,aAAa,8CAA8CC,SAMtFrE,EAAE,oNAAoNc,IAAI,IAAImF,QAAQ,YAG1OjG,EAAE,gCAAgCgE,GAAG,cAAe,SAAUoC,GAC1D,IAAIC,EAAQrG,EAAE0D,MAAW5C,EAAMuF,EAAMvF,MAAO,GAAIA,EAAIwF,SAAWxF,EAA2B,OAApBsF,EAAE7B,kBAAyB,EAC1F8B,EAAMvF,IAAIA,EAAIwF,QAASD,EAAMxF","file":"ContactFormRecaptcha.js","sourcesContent":["var jsonData;\r\nvar _PostalCode = $('[name = \"POSTAL_CODE\"], [name = \"Postal_Code__c\"]');\r\nvar _Country = $('[name = \"COUNTRY\"],[name = \"Country2__c\"]');\r\nvar _City = $('[name = \"CITY\"],[name = \"City__c\"]');\r\n\r\n$(document).ready(function () {\r\n\r\n _PostalCode.attr(\"readonly\", \"readonly\");\r\n _City.attr(\"readonly\", \"readonly\");\r\n\r\n _Country.change(function() {\r\n if (_Country.val() == \"\") {\r\n _PostalCode.attr(\"readonly\", \"readonly\");\r\n _City.attr(\"readonly\", \"readonly\");\r\n } else {\r\n _PostalCode.removeAttr(\"readonly\"); \r\n _City.removeAttr(\"readonly\"); \r\n }\r\n });\r\n\r\n _PostalCode.keyup(function () {\r\n var country = _Country.val();\r\n var postalCode = _PostalCode.val();\r\n try {\r\n jsonData = jQuery.parseJSON(httpGet(\"https://wpwsc.egoncloud.com:1252/Egon/EgonLstJSON?LST=LstZip&CDXZIP=\" + postalCode + \"&MAXLIVLOC=8&TPXEXT=L&USER=WPTC04LCA01&PASW=Y0YGKFKH&WPXISO=\" + country));\r\n if (jsonData.LSTERR.DSXERR == \"Ok\") {\r\n //jsonData.ZIP_AREA_OUT.ZIP[x].DSXOBJDPT -->> PROVINCIA\r\n //jsonData.ZIP_AREA_OUT.ZIP[x].DSXOBJCNL -->> CIUDAD/POBLACI�N\r\n //jsonData.ZIP_AREA_OUT.ZIP[x].DSXOBJDS1 -->> DISTRITO\r\n\r\n if (jsonData.ZIP_AREA_OUT.ZIP.length >= 1) {\r\n _City.val(jsonData.ZIP_AREA_OUT.ZIP[0].DSXOBJCNL);\r\n }\r\n if (jsonData.ZIP_AREA_OUT.ZIP.length == 1) {\r\n _City.val(jsonData.ZIP_AREA_OUT.ZIP[0].DSXOBJCNL);\r\n }\r\n\r\n }\r\n } catch (error) {\r\n console.info(\"Error trying to access EgonCloud services: \" + error);\r\n }\r\n \r\n });\r\n\r\n _City.keyup(function () {\r\n var country = _Country.val();\r\n var city = _City.val();\r\n try {\r\n jsonData = jQuery.parseJSON(httpGet(\"https://wpwsc.egoncloud.com:1252/Egon/EgonLstJSON?LST=LstCnl&DSXCNL=\" + city + \"&MAXLIVLOC=8&TPXEXT=L&USER=WPTC04LCA01&PASW=Y0YGKFKH&WPXISO=\" + country));\r\n var tam = jsonData.CNL_AREA_OUT.CNL.length;\r\n var options = new Array(tam - 1);\r\n for (let i = 0; i < tam; i++) {\r\n options[i] = jsonData.CNL_AREA_OUT.CNL[i].DSXOBJCNL;\r\n }\r\n\r\n _City.autocomplete({ source: options });\r\n } catch (error) {\r\n console.info(\"Error trying to access EgonCloud services: \" + error);\r\n }\r\n });\r\n\r\n _City.change(function () {\r\n var country = _Country.val();\r\n var city = _City.val();\r\n try {\r\n jsonData = jQuery.parseJSON(httpGet(\"https://wpwsc.egoncloud.com:1252/Egon/EgonLstJSON?LST=LstCnl&DSXCNL=\" + city + \"&MAXLIVLOC=8&TPXEXT=L&USER=WPTC04LCA01&PASW=Y0YGKFKH&WPXISO=\" + country));\r\n if (jsonData.CNL_AREA_OUT.CNL.length >= 1 && $('[name = \"CITY\"]').val() != \"\") {\r\n _PostalCode.val(jsonData.CNL_AREA_OUT.CNL[0].CDXZIP);\r\n }\r\n } catch (error) {\r\n console.info(\"Error trying to access EgonCloud services: \" + error);\r\n }\r\n });\r\n\r\n function httpGet(theUrl) {\r\n var xmlHttp = new XMLHttpRequest();\r\n xmlHttp.open(\"GET\", theUrl, true); // false for synchronous request\r\n xmlHttp.send(null);\r\n return xmlHttp.responseText;\r\n }\r\n \r\n // filling country dropdown list with all the countries \r\n function saveCountry(item, index) {\r\n _Country.append(``);\r\n }\r\n\r\n function getCountryCode(country) {\r\n for (var i=0; i < CountryList().get().length; i++) {\r\n if (CountryList().get()[i].name.toLowerCase() == country.toLowerCase()) {\r\n return CountryList().get()[i].threeLetterIsoCode;\r\n }\r\n }\r\n }\r\n\r\n CountryList().get().forEach(saveCountry);\r\n let queryString = new QueryStringProcessor().getUrlParams();\r\n if (queryString.country) {\r\n var countryCode = getCountryCode(queryString.country);\r\n //$('[name=\"COUNTRY\"] option[text=\"'+queryString.country+'\"]').attr(\"selected\", true);\r\n $('[name=\"COUNTRY\"],[name=\"Country_c\"] option[value=\"'+countryCode+'\"]').attr(\"selected\", true);\r\n\r\n\r\n }\r\n\r\n\r\n // We didn't find the way of managing option IDs from SF back-end so we set them in order from 0 to 6\r\n // initial 'select a contact type' option plus 6 options. They should be in the correct order in SF back-end\r\n var predIndex = 0;\r\n $('[name=\"RELATION_TYPE\"] option').each(function () {\r\n $(this).val(predIndex);\r\n predIndex = predIndex + 1;\r\n });\r\n\r\n // create hidden field inside contact form with site_name (taken from the meta property fields in html's head)\r\n // it is needed inside the form when submitting to SF backEnd\r\n var inputSiteName = jQuery('');\r\n $('.mi-contact-form').find('form').append(inputSiteName);\r\n var contactUri = encodeURI(document.querySelector(\"meta[property='og:site_name']\").getAttribute(\"content\"));\r\n $('[name=\"SITE_NAME\"]').val(contactUri);\r\n\r\n // adding \r\n // - reCaptcha validation \r\n // - Pardot FORM request to SF \r\n // to submit button click event (it is executed before submit event)\r\n $('#mi-contact-form-email').on('click', function (event) {\r\n var selectedContactType = $('[name=\"RELATION_TYPE\"] option:selected').val();\r\n var recaptchaBox = $(this).parentsUntil(\"#mi-corpo-contact-form-custom-email-submit\").parent();\r\n if (recaptchaBox.find(\"input[name='completed_captcha']\").val() != 'valid') {\r\n recaptchaBox.find(\"#mi-corpo-contact-form-download-invalid-recaptcha\").show();\r\n event.preventDefault();\r\n event.stopPropagation();\r\n return false;\r\n } else {\r\n if (selectedContactType == 1 || selectedContactType == 6) {\r\n $.post(\"/register-form-action\",\r\n {\r\n NAME: $('[name=\"NAME\"]').val(),\r\n COMPANY_NAME: $('[name=\"COMPANY_NAME\"]').val(),\r\n FIRST_NAME: $('[name=\"FIRST_NAME\"]').val(),\r\n EMAIL: $('[name=\"EMAIL\"]').val(),\r\n RELATION_TYPE: $('[name=\"RELATION_TYPE\"]').val(),\r\n POSTAL_CODE: _PostalCode.val(),\r\n COUNTRY: _Country.val(),\r\n TELEPHONE: $('[name=\"TELEPHONE\"]').val(),\r\n SITE_NAME: document.querySelector(\"meta[property='og:site_name']\").getAttribute(\"content\")\r\n });\r\n }\r\n }\r\n\r\n recaptchaBox.find(\"#mi-corpo-contact-form-download-invalid-recaptcha\").hide();\r\n });\r\n\r\n $('[name=\"RELATION_TYPE\"]').on('change', function () {\r\n\r\n var selectedContactType = $('[name=\"RELATION_TYPE\"] option:selected').val();\r\n var currentSite = $('meta[property=\"og:site_name\"]').attr('content');\r\n var contactFormSfUri = $('#mi-corpo-contact-form-ajax-submit-url').val();\r\n var listOfActiveSites = $('#mi-corpo-contact-form-pardot_active_sites').val().split(\";\");\r\n var contactFormPardotUri = $('#mi-corpo-contact-form-pardot_uri').val();\r\n\r\n if (listOfActiveSites.includes(currentSite)) {\r\n if (selectedContactType == 1 || selectedContactType == 6) {\r\n // hide attachment\r\n $(\".sf-FileField.form-group\").hide();\r\n // change submit URI\r\n $('.mi-contact-form').find('form').attr('action', contactFormPardotUri);\r\n $('.mi-contact-form').find('form').removeAttr('enctype');\r\n\r\n } else {\r\n $(\".sf-FileField.form-group\").show();\r\n // change submit URI\r\n $('.mi-contact-form').find('form').attr('action', contactFormSfUri);\r\n $('.mi-contact-form').find('form').attr('enctype', 'multipart/form-data');\r\n }\r\n } else {\r\n // do normal action\r\n $(\".sf-FileField.form-group\").show();\r\n // TODO change submit URI\r\n $('.mi-contact-form').find('form').attr('action', contactFormSfUri);\r\n $('.mi-contact-form').find('form').attr('enctype', 'multipart/form-data');\r\n }\r\n });\r\n\r\n $('button[data-sf-btn-role=\"next\"]').on('click', function (event) {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n var currentWidth = $(\".progress-bar\").width() / $('.progress-bar').parent().width() * 100;\r\n\r\n setTimeout(function () {\r\n //if (!event.currentTarget.form[1].value) {\r\n if (event.currentTarget.form[1].value.length <= 35) {\r\n $(\".progress-bar\").width((currentWidth + 50) + \"%\");\r\n }\r\n },\r\n 50\r\n );\r\n\r\n });\r\n\r\n $('#mi-contact-form-email-reset-button').on('click', function (event) {\r\n $('input').each(function (index, element) {\r\n $(element).val('').trigger('change');\r\n });\r\n\r\n $('select').each(function (index, element) {\r\n $(element).val('').trigger('change');\r\n });\r\n\r\n $('textarea').each(function (index, element) {\r\n $(element).val('').trigger('change');\r\n });\r\n\r\n\r\n });\r\n\r\n $('a[data-sf-btn-role=\"prev\"]').on('click', function (event) {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n var currentWidth = $(\".progress-bar\").width() / $('.progress-bar').parent().width() * 100;\r\n\r\n setTimeout(function(){\r\n $(\".progress-bar\").width((currentWidth - 50) + \"%\");\r\n },\r\n 50\r\n );\r\n\r\n event.preventDefault();\r\n });\r\n\r\n $('#HiddenField-1').prop('type','reset').val('Reset').trigger('change');\r\n $('#HiddenField-2').prop('type','reset').val('Reset').trigger('change');\r\n $('#HiddenField-3').prop('type','reset').val('Reset').trigger('change');\r\n\r\n $('#HiddenField-1').on('click', function (event) {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n event.stopImmediatePropagation();\r\n\r\n //$('.mi-contact-form div[data-sf-role=\"separator\"][style=\"display: block;\"] input[type!=\"reset\"] ,.mi-contact-form div[data-sf-role=\"separator\"][style=\"display: block;\"] select,.mi-contact-form div[data-sf-role=\"separator\"][style=\"display: block;\"] textarea').val('').trigger('change');\r\n $('.mi-contact-form div[data-sf-role=\"separator\"][style=\"\"] input[type!=\"reset\"] ,.mi-contact-form div[data-sf-role=\"separator\"][style=\"\"] select,.mi-contact-form div[data-sf-role=\"separator\"][style=\"\"] textarea').val('').trigger('change');\r\n });\r\n\r\n $('#HiddenField-2').on('click', function (event) {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n event.stopImmediatePropagation();\r\n $('.mi-contact-form div[data-sf-role=\"separator\"][style=\"\"] input[type!=\"reset\"] ,.mi-contact-form div[data-sf-role=\"separator\"][style=\"\"] select,.mi-contact-form div[data-sf-role=\"separator\"][style=\"\"] textarea').val('').trigger('change');\r\n });\r\n\r\n $('#HiddenField-3').on('click', function (event) {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n event.stopImmediatePropagation();\r\n $('#mi-contact-form-email').removeAttr(\"disabled\");\r\n var recaptchaBox = $(this).parentsUntil(\"#mi-corpo-contact-form-custom-email-submit\").parent();\r\n //console.log(\"recaptchaBox.find(input[name = 'completed_captcha'])\", recaptchaBox.find(\"input[name='completed_captcha']\"));\r\n //console.log(\"recaptchaBox.find(input[name = 'completed_captcha'].val()) = \" + recaptchaBox.find(\"input[name='completed_captcha']\").val());\r\n //console.log(\"recaptchaBox.find(input[name = 'completed_captcha'].val())\", recaptchaBox.find(\"input[name='completed_captcha']\").);\r\n\r\n //recaptchaBox.value;\r\n $('.mi-contact-form div[data-sf-role=\"separator\"][style=\"\"] input[type!=\"reset\"] ,.mi-contact-form div[data-sf-role=\"separator\"][style=\"\"] select,.mi-contact-form div[data-sf-role=\"separator\"][style=\"\"] textarea').val('').trigger('change');\r\n });\r\n\r\n $('input[type=\"text\"], textarea').on('blur change', function (e) {\r\n var $this = $(this); var val = $this.val(); if (val.trim() === val) { e.preventDefault(); return false; }\r\n else { $this.val(val.trim()); $this.change(); }\r\n });\r\n});"]}