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J,EAAsBE,GAAGG,SAASF,OAAQC,IAC1DJ,EAAsBE,GAAGG,SAASD,GAAGX,UAAUE,IAAI,gBAK3D,IAAIW,EAA8B9B,SAASyB,iBAAiB,kCAE5D,GAAIK,EAA4BH,OAC5B,IAAK,IAAII,EAAK,EAAGA,EAAKD,EAA4BH,OAAQI,IACtDlC,EACIiC,EAA4BC,GAAIC,aAAa,gCAI7D,EAEAvC,OAAOC,YAAYC,qCAAqCsC,WAAY","sources":["webpack://advanced-web/./UI/js/core/modules/refreshedrecommendationcarouselblock.js"],"sourcesContent":["(function () {\r\n window.oneadvanced = window.oneadvanced || {};\r\n window.oneadvanced.refreshedrecommendationcarouselblock = window.oneadvanced.refreshedrecommendationcarouselblock || {};\r\n window.oneadvanced.refreshedrecommendationcarouselblock.init = function () {\r\n //console.log(\"initializing refreshedrecommendationcarouselblock js.......\");\r\n\r\n //This function is used to add the swipper for refreshedrecommendationcarouselblock\r\n function rcHandler(BlockId) {\r\n // store the previous and next arrows html elements\r\n const prevButton = document.getElementById('swiperPrev_' + BlockId);\r\n const nextButton = document.getElementById('swiperNext_' + BlockId);\r\n\r\n // initialise unique blockID swiper\r\n const swiper = new Swiper('[data-recommendation-block-id=\"' + BlockId + '\"]', {\r\n direction: 'horizontal',\r\n slidesPerView: 'auto',\r\n initialSlide: 0,\r\n loop: false,\r\n navigation: {\r\n nextEl: nextButton,\r\n prevEl: prevButton,\r\n },\r\n grabCursor: true,\r\n on: {\r\n transitionEnd: function () {\r\n toggleButtons(prevButton, nextButton, swiper);\r\n },\r\n }\r\n });\r\n\r\n //Function to add inactive class conditionally\r\n toggleButtons = function (prevButton, nextButton, swiper) {\r\n if (swiper.isBeginning) {\r\n if (!prevButton.classList.contains('inactive')) {\r\n prevButton.classList.add('inactive');\r\n prevButton.setAttribute(\"disabled\", \"disabled\");\r\n }\r\n if (nextButton.classList.contains('inactive')) {\r\n nextButton.classList.remove('inactive');\r\n nextButton.removeAttribute(\"disabled\");\r\n }\r\n } else if (swiper.isEnd) {\r\n if (prevButton.classList.contains('inactive')) {\r\n prevButton.classList.remove('inactive');\r\n prevButton.removeAttribute(\"disabled\");\r\n }\r\n if (!nextButton.classList.contains('inactive')) {\r\n nextButton.classList.add('inactive');\r\n nextButton.setAttribute(\"disabled\", \"disabled\");\r\n }\r\n } else {\r\n if (prevButton.classList.contains('inactive')) {\r\n prevButton.classList.remove('inactive');\r\n prevButton.removeAttribute(\"disabled\");\r\n }\r\n if (nextButton.classList.contains('inactive')) {\r\n nextButton.classList.remove('inactive');\r\n nextButton.removeAttribute(\"disabled\");\r\n }\r\n }\r\n }\r\n }\r\n\r\n //Below Code is used to add swiper-slide class to the carousel\r\n var swiper_wraper_content = document.querySelectorAll('.refreshedrecommendationcarouselblock .swiper-wrapper');\r\n\r\n for (var i = 0; i < swiper_wraper_content.length; i++) {\r\n for (var e = 0; e < swiper_wraper_content[i].children.length; e++) {\r\n swiper_wraper_content[i].children[e].classList.add(\"swiper-slide\");\r\n }\r\n }\r\n\r\n //Below code is to call the rcHandler function defined above\r\n var recommendationcarouselblock = document.querySelectorAll('[data-recommendation-block-id]');\r\n\r\n if (recommendationcarouselblock.length) {\r\n for (var rc = 0; rc < recommendationcarouselblock.length; rc++) {\r\n rcHandler(\r\n recommendationcarouselblock[rc].getAttribute('data-recommendation-block-id')\r\n );\r\n }\r\n }\r\n };\r\n\r\n window.oneadvanced.refreshedrecommendationcarouselblock.hasLoaded = true;\r\n})();"],"names":["window","oneadvanced","refreshedrecommendationcarouselblock","init","rcHandler","BlockId","prevButton","document","getElementById","nextButton","swiper","Swiper","direction","slidesPerView","initialSlide","loop","navigation","nextEl","prevEl","grabCursor","on","transitionEnd","toggleButtons","isBeginning","classList","contains","add","setAttribute","remove","removeAttribute","isEnd","swiper_wraper_content","querySelectorAll","i","length","e","children","recommendationcarouselblock","rc","getAttribute","hasLoaded"],"sourceRoot":""}