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YA,EAAZ,EAAoBA,IACZiB,EAAAA,QAAJjB,IACID,EAAAA,GAAAA,UAAAA,IAAAA,gC,EArUd3C,GAgVN,IAAIA,G,iBCvVJgE,EAAOC,QAAUpD,OAAe,S","sources":["webpack://sage/./resources/scripts/modules/nested-tab.js","webpack://sage/external window \"jQuery\""],"sourcesContent":["// import $ from \"jquery\";\n// import \"slick-carousel\";\nimport 'bootstrap/js/dist/tab';\nimport 'bootstrap/js/dist/collapse';\nimport Swiper, { Navigation, Pagination, Autoplay } from 'swiper';\n\n\nclass sliderSwiperStories {\n constructor() {\n this.events();\n this.customSelect();\n this.sliderInit();\n this.reportFilter();\n //this.scrollToForm();\n //this.sliderInit(item.value);\n //this.paginationClass = $('.slider-01-control .slider__pagination');\n //this.paginationClass = $('.slider-02-control .slider__pagination');\n }\n\n scrollToForm() {\n $(document).on('click', '.text-header-b-content a', (e) => {\n e.preventDefault();\n var myhash = $(\".scrollto\").attr(\"href\");\n //$(this).addClass('search-tag-is-active');\n //var _topHeight = $('#site-header').height()+$(\".search-result-new-header-wrap\").height();\n $('html, body').animate({\n scrollTop: $(myhash).offset().top-72,\n }, 200, function(){\n // Add hash (#) to URL when done scrolling (default click behavior)\n //window.location.hash = myhash;\n });\n });\n }\n\n addClassifactive(selItem){\n document.querySelector('.m-nested-tab').classList.remove('has-m-two-column-bullet-text');\n if (selItem.querySelector('.m-two-column-bullet-text') !== null) {\n selItem.closest('.m-nested-tab').classList.add('has-m-two-column-bullet-text')\n // console.log('✅ element has child with id of child-3');\n }else{\n // console.log('⛔️ element does NOT have child with id');\n }\n document.querySelector('.m-nested-tab').classList.remove('has-image-l-text-r');\n if (selItem.querySelector('.image-l-text-r') !== null) {\n selItem.closest('.m-nested-tab').classList.add('has-image-l-text-r')\n // console.log('✅ element has child with id of child-3');\n }else{\n // console.log('⛔️ element does NOT have child with id');\n }\n document.querySelectorAll('.m-nested-tab').forEach(function(selItem) {\n // Remove the 'has-active-tab' class initially\n selItem.classList.remove('has-active-tab');\n\n // Check if any child of selItem has the 'active' class\n if (selItem.querySelector('.active') !== null) {\n selItem.classList.add('has-active-tab');\n document.querySelector(\".moreInfoText\").classList.add('d-none');\n document.querySelector(\".moreInfoBut\").classList.remove('d-none');\n // console.log('✅ element has child with class \"active\"');\n } else {\n // console.log('⛔️ element does NOT have child with class \"active\"');\n }\n });\n\n }\n\n reportFilter() {\n // var selectfirst=document.querySelector('.select-items div');\n // selectfirst.classList.add('same-as-selected');\n // document.querySelector('.select-selected').innerHTML=selectfirst.textContent;\n if ($(window).width() >= 768) {\n var tabpane = document.querySelector(\".tab-pane\");\n tabpane.classList.add('show','active');\n }\n const listBtn = document.querySelector(\"#listMenu\");\n listBtn.addEventListener('click', function(e){\n e.preventDefault();\n \n document.querySelector(\".moreInfoBut\").classList.add('d-none');\n document.querySelector(\".moreInfoText\").classList.remove('d-none');\n\n //$('.m-nested-tab .pill-filter--sp .select-selected').trigger('click');\n const seledItem = document.querySelector(\".pill-filter--sp .select-selected\");\n seledItem.classList.add('d-none');\n const selItem = document.querySelector(\".pill-filter--sp .select-items\");\n setTimeout(function () {\n selItem.classList.remove('select-items--is-hide');\n }, 100);\n return false;\n });\n\n var hash=(window.location.hash.substring(1));\n if(hash!=undefined && hash!='' ){\n\n var ele = document.getElementById('m-nested-tab');\n window.scrollTo(ele.offsetLeft,ele.offsetTop);\n document.querySelectorAll(\"[data-anchor=\"+hash+\"]\").forEach(\n (elem)=>{\n elem.click();\n var navItem = elem.getAttribute( 'aria-controls' );\n var elem_mobile= document.querySelector(\"[data-partners=\"+navItem+\"]\");\n elem_mobile.click();\n document.querySelector('.select-selected').classList.remove('select-selected--is-active');\n document.querySelector('.select-items').classList.add('select-items--is-hide');\n document.querySelector('.select-selected').innerHTML=elem_mobile.textContent;\n var selItem = document.getElementById(navItem);\n this.addClassifactive(selItem);\n\n return false;\n }\n );\n }else{\n const selItem = document.querySelector(\".pill-filter--sp .select-items\");\n setTimeout(function () {\n selItem.classList.remove('select-items--is-hide');\n }, 100);\n // $('.m-nested-tab .pill-filter--sp .select-selected').trigger('click');\n }\n\n\n $(document).on( 'click', '.pill-filter--sp .select-items div', (e) => {\n // console.log('clicked');\n e.preventDefault();\n var elem = $(e.currentTarget),\n navItem = elem.attr( 'data-partners' ),\n tabpane = document.querySelectorAll(\".tab-pane\"),\n selItem = document.querySelector(navItem);\n if(selItem==null){\n selItem = document.getElementById(navItem);\n }\n if((elem.attr('data-url'))!=='null'){\n window.location.href=elem.attr('data-url');\n return false;\n }\n tabpane.forEach(function(item) {\n item.classList.remove('show','active','m-two-column-bullet-text');\n });\n this.addClassifactive(selItem)\n\n selItem.classList.add('show','active');\n });\n\n\n\n $(document).on('click','.nav-pills>li.nav-item>button',(e)=>{\n var elem = $(e.currentTarget),\n navItem = elem.attr( 'aria-controls' ),\n selItem = document.getElementById(navItem),\n url=elem.attr('data-url');\n if(url!==undefined){\n // document.getElementById(\"nav-tabContent\").innerHTML=\"
\";\n window.location.href=url;\n return false;\n }\n\n document.querySelector('.m-nested-tab').classList.remove('has-m-two-column-bullet-text');\n this.addClassifactive(selItem)\n })\n }\n\n sliderInit() {\n Swiper.use([Navigation, Pagination, Autoplay]);\n let ss = document.querySelectorAll('.swipid');\n var swiper = [];\n ss.forEach(function(item) {\n var sid = item.value;\n var isSlider = true;\n var isloop = false;\n var slidon = document.querySelector('.slider-'+sid);\n var slidNav = document.querySelector('.slider-'+sid+'-control');\n\n if(item.classList.contains('noSlider') && $(window).width() > 767){\n isSlider = false;\n //slidNav.parentElement.style.display='none';\n slidNav.parentNode.classList.remove('d-md-block');\n }\n //console.log(isSlider + \"here\"+$(window).width());\n if(isSlider){\n if(slidon.getAttribute('data-slide')=='on')\n isloop = true;\n swiper[sid] = new Swiper('.slider-'+sid, {\n slidesPerView: 1,\n spaceBetween: 36,\n grabCursor: true,\n loop: isloop,\n speed: 500,\n allowTouchMove: false,\n pagination: {\n el: '.slider-'+sid+'-control .slider__pagination',\n clickable: true,\n },\n navigation: {\n nextEl: '.slider-'+sid+'-control .slider__button-next',\n prevEl: '.slider-'+sid+'-control .slider__button-prev',\n },\n breakpoints: {\n 768: {\n spaceBetween: 16,\n slidesPerView: 3,\n },\n },\n });\n }\n });\n }\n\n resizeEvents() {\n $(window).on('resize', () => {\n // this.sliderInit();\n // if ($(window).width() >= 768) {\n // var tabpane = document.querySelector(\".tab-pane\");\n\n // tabpane.classList.add('show','active');\n // }else{\n // var tabpane = document.querySelector(\".tab-pane\");\n // tabpane.classList.remove('show','active');\n // }\n });\n }\n\n events() {\n this.resizeEvents();\n this.onLoad();\n }\n\n onLoad () {\n const element = document.querySelector('.stay-in-loop-with-svg #form-shortcode-wrap .primaryAction');\n if (element) {\n // The selector exists on the page\n element.value = \"Continue sign up in the next step\";\n }\n // document.querySelector('.stay-in-loop-with-svg #form-shortcode-wrap .primaryAction').value=\"Continue sign up in next step\";\n if ($(window).width() < 768) {\n var tabpane = document.querySelectorAll(\".tab-pane\");\n\n tabpane.forEach(function(item) {\n item.classList.remove('show','active');\n });\n }\n }\n\n clickEvents() {\n }\n\n customSelect() {\n var x, i, j, l, ll, selElmnt, a, b, c;\n /*look for any elements with the class \"custom-select\":*/\n x = document.getElementsByClassName('ft-custom-select');\n l = x.length;\n \n for (i = 0; i < l; i++) {\n selElmnt = x[i].getElementsByTagName('select')[0];\n ll = selElmnt.length;\n /*for each element, create a new DIV that will act as the selected item:*/\n a = document.createElement('DIV');\n a.setAttribute('class', 'select-selected d-none select-selected--is-active');\n a.innerHTML = selElmnt.options[selElmnt.selectedIndex].innerHTML;\n x[i].appendChild(a);\n /*for each element, create a new DIV that will contain the option list:*/\n b = document.createElement('DIV');\n b.setAttribute('class', 'select-items select-items--is-hide');\n b.setAttribute('id', 'myItems');\n for (j = 0; j < ll; j++) {\n /*for each option in the original select element,\n create a new DIV that will act as an option item:*/\n c = document.createElement('DIV');\n c.innerHTML = selElmnt.options[j].innerHTML;\n c.setAttribute( 'data-partners', selElmnt.options[j].getAttribute('value') );\n c.setAttribute( 'data-url', selElmnt.options[j].getAttribute('data-url') );\n c.addEventListener('click', function (e) {\n /*when an item is clicked, update the original select box,\n and the selected item:*/\n document.querySelector('.select-selected').classList.remove('d-none');\n var y, i, k, s, h, sl, yl, currentText;\n s = this.parentNode.parentNode.getElementsByTagName('select')[0];\n sl = s.length;\n h = this.parentNode.previousSibling;\n for (i = 0; i < sl; i++) {\n if (s.options[i].innerHTML == this.innerHTML) {\n s.selectedIndex = i;\n currentText = this.innerHTML;\n currentText = ( 'Clear Filter' == currentText ) ? 'Filter' : currentText;\n h.innerHTML = currentText;\n y = this.parentNode.getElementsByClassName('same-as-selected');\n yl = y.length;\n for (k = 0; k < yl; k++) {\n y[k].removeAttribute('class');\n }\n this.setAttribute('class', 'same-as-selected');\n break;\n }\n }\n h.click();\n });\n b.appendChild(c);\n }\n x[i].appendChild(b);\n a.addEventListener('click', function (e) {\n /*when the select box is clicked, close any other select boxes,\n and open/close the current select box:*/\n // console.log(\"in here\");\n // // return false;\n // e.stopPropagation();\n // closeAllSelect(this);\n // // // document.querySelector('.select-items').classList.toggle('select-items--is-hide');\n // // // document.querySelector('.select-selected').classList.toggle('select-selected--is-active');\n // this.nextSibling.classList.toggle('select-items--is-hide');\n // this.classList.toggle('select-selected--is-active');\n });\n }\n function closeAllSelect(elmnt) {\n /*a function that will close all select boxes in the document,\n except the current select box:*/\n var x,\n y,\n i,\n xl,\n yl,\n arrNo = [];\n x = document.getElementsByClassName('select-items');\n y = document.getElementsByClassName('select-selected');\n xl = x.length;\n yl = y.length;\n for (i = 0; i < yl; i++) {\n if (elmnt == y[i]) {\n arrNo.push(i);\n } else {\n y[i].classList.remove('select-selected--is-active');\n }\n }\n for (i = 0; i < xl; i++) {\n if (arrNo.indexOf(i)) {\n x[i].classList.add('select-items--is-hide');\n }\n }\n //y[0].classList.toggle('select-selected--is-active');\n }\n /*if the user clicks anywhere outside the select box,then close all select boxes:*/\n document.addEventListener('click', closeAllSelect);\n }\n}\n\nexport default sliderSwiperStories;\nnew sliderSwiperStories();\n","module.exports = window[\"jQuery\"];"],"names":["sliderSwiperStories","this","$","e","myhash","scrollTop","document","selItem","tabpane","listBtn","seledItem","setTimeout","hash","window","ele","elem","navItem","elem_mobile","item","url","Swiper","ss","swiper","sid","isSlider","isloop","slidon","slidNav","slidesPerView","spaceBetween","grabCursor","loop","speed","allowTouchMove","pagination","el","clickable","navigation","nextEl","prevEl","breakpoints","element","l","x","i","ll","selElmnt","a","b","j","c","sl","s","parentNode","getElementsByTagName","h","currentText","yl","y","getElementsByClassName","k","arrNo","xl","elmnt","module","exports"],"sourceRoot":""}