{"version":3,"sources":["../../../../../dev/j/v2/smb/pages/business-support-contact.js"],"names":["$","avm","require","$_","document","ready","load","initAvastForm","focus","forEach","call","querySelectorAll","el","classList","add","labels","i","length","label","item","text","textContent","isRequired","parentNode","contains","nextElement","nextElementSibling","firstChild","setAttribute","replace","tagName","options","removeChild"],"mappings":"CAAA,WACC,YACA,IAAIA,GAAIC,IAAIC,QAAQ,SAGF,oBAAPC,MACVH,EAAIG,IAGLH,EAAEI,UAAUC,MAAM,WACjBL,EAAE,kCAAkCM,KAAK,gCAAiC,WACzEC,gBAEAP,EAAE,uCAAuCQ,WAGtCC,QAAQC,KACVN,SAASO,iBAAiB,8DAC1B,SAASC,GACRA,EAAGC,UAAUC,IAAI,qBAGhBL,QAAQC,KACVN,SAASO,iBAAiB,sBAC1B,SAASC,GACRA,EAAGC,UAAUC,IAAI,sBAGhBL,QAAQC,KACVN,SAASO,iBAAiB,uBAC1B,SAASC,GACRA,EAAGC,UAAUC,IAAI,OACjBF,EAAGC,UAAUC,IAAI,gBAQnB,KAHA,GAAIC,GAASX,SAASO,iBAAiB,sBACnCK,EAAID,EAAOE,OAERD,KAAK,CACF,GAAIE,GAAQH,EAAOI,KAAKH,GACpBI,EAAOF,EAAMG,YACbC,EAAaJ,EAAMK,WAAWV,UAAUW,SAAS,YACjDC,EAAcP,EAAMQ,mBAAmBC,UAEvCF,KAEAA,EAAYG,aAAa,aAAcR,EAAKS,QAAQ,IAAK,KACrDP,GACAG,EAAYG,aAAa,iBAAiB,GAItB,UAAvBH,EAAYK,QACfL,EAAYM,QAAQ,GAAGX,KAAOA,EAE9BK,EAAYG,aAAa,cAAeR,GAGzCF,EAAMK,WAAWS,YAAYd","file":"business-support-contact.js","sourcesContent":["(function () {\n\t\"use strict\";\n\tvar $ = avm.require(\"jquery\");\n\n\t//$_ refers to jQuery added into Text file\n\tif (typeof $_ !== 'undefined') {\n\t\t$ = $_;\n\t}\n\n\t$(document).ready(function() {\n\t\t$(\"#business-support-contact-form\").load(\"business-support-contact-form\", function() {\n\t\t\tinitAvastForm();\n\n\t\t\t$('#AVform *:input[type!=hidden]:first').focus();\n\t\t\t\n\t\t\t//DS TWEAKS\t\n\t\t\t[].forEach.call(\n\t\t\t\tdocument.querySelectorAll(\".form-group input:not([type=submit]), .form-group textarea\"),\n\t\t\t\tfunction(el) {\n\t\t\t\t\tel.classList.add(\"form-control\");\n\t\t\t\t}\n\t\t\t);\n\t\t\t[].forEach.call(\n\t\t\t\tdocument.querySelectorAll(\".form-group select\"),\n\t\t\t\tfunction(el) {\n\t\t\t\t\tel.classList.add(\"custom-select\");\n\t\t\t\t}\n\t\t\t);\n\t\t\t[].forEach.call(\n\t\t\t\tdocument.querySelectorAll(\".form-group .button\"),\n\t\t\t\tfunction(el) {\n\t\t\t\t\tel.classList.add(\"btn\");\n\t\t\t\t\tel.classList.add(\"btn-primary\");\n\t\t\t\t}\n\t\t\t);\n\t\t\t\n\n\t\t\tvar labels = document.querySelectorAll(\".form-group .label\");\n\t\t\tvar i = labels.length;\n\n\t\t\twhile (i--) {\n \tvar label = labels.item(i);\n \tvar text = label.textContent;\n \tvar isRequired = label.parentNode.classList.contains(\"required\"); \n \tvar nextElement = label.nextElementSibling.firstChild;\n \t\n \tif (nextElement) { \n \t\t //Aria\n \t nextElement.setAttribute(\"aria-label\", text.replace(':', ''));\n \t if (isRequired) {\n \t nextElement.setAttribute(\"aria-required\", true); \t \n \t }\n\n \t //Placeholder\n \t\tif (nextElement.tagName == 'SELECT') {\n \t\t\tnextElement.options[0].text = text;\n \t\t} else {\n \t\t\tnextElement.setAttribute(\"placeholder\", text);\n \t\t}\n \t\t\n \t\tlabel.parentNode.removeChild(label);\n \t}\n }\n\t });\n\t});\n\n})();\n"]}