{"version":3,"file":"apii.min.js","sources":["apii.min.js"],"sourcesContent":["(function (factory) {\n typeof define === 'function' && define.amd ? define(factory) :\n factory();\n})((function () { 'use strict';\n\n var MenuF = {\n\n init: function init() \n {\n var menuf = document.getElementById(\"menuf\");\n var listeAsChildren = menuf.querySelectorAll(\".menu-item-has-children\");\n listeAsChildren.forEach(function (li) {\n var submenu = li.getElementsByClassName(\"sub-menu\")[0];\n submenu.classList.add(\"displaynone\");\n /*if(submenu.classList.contains(\"displaycontent\")){\n li.addEventListener(\"click\", function( event ) {\n submenu.classList.remove(\"displaycontent\"); \n submenu.classList.add(\"displaynone\"); \n });\n }else{\n li.addEventListener(\"click\", function( event ) {\n submenu.classList.remove(\"displaynone\"); \n submenu.classList.add(\"displaycontent\");\n });\n }*/\n li.addEventListener(\"click\", function( event ) {\n if(submenu.classList.contains(\"displaycontent\")){\n submenu.classList.remove(\"displaycontent\"); \n submenu.classList.add(\"displaynone\"); \n }else { \n submenu.classList.remove(\"displaynone\"); \n submenu.classList.add(\"displaycontent\"); \n }\n });\n });\n }\n };\n\n var ContactF = {\n\n init: function init() \n {\n var formulaire = document.getElementById(\"contact-form\");\n if(formulaire){\n var textArea = formulaire.querySelectorAll('.elementor-field-group');\n //console.log(textArea);\n textArea.forEach(function (item) {\n //console.log(item.children[1])\n if(item.children[1]){\n item.children[1].addEventListener('focus', function (event) {\n item.children[0].classList.add(\"addbottom\");\n });\n } \n });\n }\n }\n };\n\n var Header = {\n \n init: function init() \n {\n /* Variables */\n document.getElementsByTagName('body')[0];\n var menuBurger = document.getElementsByClassName('menu-burger');\n var menuBurgerSvg = document.getElementsByClassName('menu-burger-icon');\n var menuContainer = document.getElementById('menu-header-container');\n \n /* MENU */\n function toggleMenu(){\n for (var j = 0; j < menuBurger.length; j++) {\n var svg = menuBurgerSvg[j].getElementsByTagName('i')[0];\n if (svg.classList.contains('rotate-menu')) {\n svg.classList.remove('rotate-menu');\n svg.classList.add('rotate-menu-back');\n menuContainer.classList.remove('show');\n menuContainer.classList.add('hide');\n setTimeout(function () {menuContainer.classList.remove('hide');}, 500);\n } else if (svg.classList.contains('rotate-menu-back')) {\n svg.classList.remove('rotate-menu-back');\n svg.classList.add('rotate-menu');\n menuContainer.classList.remove('hide');\n menuContainer.classList.add('show');\n } else {\n svg.classList.add('rotate-menu');\n menuContainer.classList.remove('hide');\n menuContainer.classList.add('show');\n }\n }\n }\n for (var i = 0; i < menuBurger.length; i++) {\n menuBurger[i].addEventListener('click', function() {\n toggleMenu();\n });\n }\n\n var hasSubMenu = document.querySelectorAll(\".menu-item-has-children\");\n hasSubMenu.forEach(function (subM) {\n\n subM.getElementsByTagName(\"a\")[0].classList.add(\"no-cursor\");\n var lesEnfants = subM.children[1].children;\n \n for (var i = 0; i < lesEnfants.length; i++) {\n if (lesEnfants[i].classList.contains(\"current_page_item\")){\n subM.getElementsByTagName(\"a\")[0].classList.add(\"red\");\n }\n }\n\n subM.childNodes[0].addEventListener('click', function() {\n \n if (subM.getElementsByTagName(\"ul\")[0].classList.contains(\"display-mob\")){\n subM.getElementsByTagName(\"ul\")[0].classList.remove(\"display-mob\");\n subM.getElementsByTagName(\"ul\")[0].classList.add(\"display-none\");\n }\n else {\n subM.getElementsByTagName(\"ul\")[0].classList.remove(\"display-none\");\n subM.getElementsByTagName(\"ul\")[0].classList.add(\"display-mob\");\n }\n \n });\n });\n }\n };\n\n var HomeP = {\n\n init: function init() \n {\n var clicArea = document.querySelectorAll('.go-to-inter');\n \n if(clicArea){\n clicArea.forEach(function (zone) {\n zone.addEventListener('click', function (event) {\n document.location.href = \"https://www.apiiexport.com/international/\";\n }); \n });\n }\n\n var clicGoTo = document.querySelectorAll('.go-to');\n \n if(clicGoTo){\n clicGoTo.forEach(function (nezo, i){\n nezo.addEventListener('click', function (event) {\n if(i==0){\n document.location.href = \"https://www.apiiexport.com/agro-equipements/\";\n }if(i==1){\n document.location.href = \"https://www.apiiexport.com/equipement-elevage/\";\n }if(i==2){\n document.location.href = \"https://www.apiiexport.com/agro-industrie/\";\n }\n }); \n });\n }\n }\n };\n\n window.elementorFrontend.elements.$window.one('elementor/frontend/init', function () {\n // Elementor frontend is loaded\n (function () {\n theme_config || {};\n ContactF.init();\n MenuF.init();\n Header.init();\n HomeP.init();\n })();\n });\n\n}));\n//# sourceMappingURL=apii.min.js.map\n"],"names":["factory","define","amd","MenuF","document","getElementById","querySelectorAll","forEach","li","submenu","getElementsByClassName","classList","add","addEventListener","event","contains","remove","ContactF","formulaire","item","children","Header","getElementsByTagName","menuBurger","menuBurgerSvg","menuContainer","i","length","j","svg","setTimeout","subM","lesEnfants","childNodes","HomeP","clicArea","clicGoTo","zone","location","href","nezo","window","elementorFrontend","elements","$window","one","theme_config"],"mappings":"CAAA,SAAWA,GACW,mBAAXC,QAAyBA,OAAOC,IAAMD,OAAOD,GACpDA,IAFJ,CAGG,wBAEC,IAAIG,EAEM,WAEUC,SAASC,eAAe,SACRC,iBAAiB,2BAC7BC,QAAQ,SAAUC,GAC9B,IAAIC,EAAUD,EAAGE,uBAAuB,YAAY,GACpDD,EAAQE,UAAUC,IAAI,eAYtBJ,EAAGK,iBAAiB,QAAS,SAAUC,GAChCL,EAAQE,UAAUI,SAAS,mBAC1BN,EAAQE,UAAUK,OAAO,kBACzBP,EAAQE,UAAUC,IAAI,iBAEtBH,EAAQE,UAAUK,OAAO,eACzBP,EAAQE,UAAUC,IAAI,wBAOtCK,EAEM,WAEF,IAAIC,EAAad,SAASC,eAAe,gBACtCa,GACgBA,EAAWZ,iBAAiB,0BAElCC,QAAQ,SAAUY,GAEpBA,EAAKC,SAAS,IACbD,EAAKC,SAAS,GAAGP,iBAAiB,QAAS,SAAUC,GACjDK,EAAKC,SAAS,GAAGT,UAAUC,IAAI,kBAQnDS,EAEM,WAGFjB,SAASkB,qBAAqB,QAAQ,GACtC,IAAIC,EAAanB,SAASM,uBAAuB,eAC7Cc,EAAgBpB,SAASM,uBAAuB,oBAChDe,EAAgBrB,SAASC,eAAe,yBAwB5C,IA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