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,CAACE,SAAR,GAAoBC,UAAU,CAACF,YAAY,GAAC,CAAd,CAAV,GAA2B,KAA3B,GAAiCE,UAAU,CAACxB,cAAc,CAACc,QAAf,CAAwBW,MAAzB,CAA/D;EACH,CA3BD;AA4BH,CA7BD;;AA+BA,IAAID,UAAU,GAAC,UAASM,MAAT,EAAgB;EAC3B,OAAOA,MAAM,CAACC,QAAP,GAAkBC,QAAlB,CAA2B,CAA3B,EAA8B,GAA9B,CAAP;AACH,CAFD,C","sources":["webpack://baseul-dev-gutenblocks/./src/nouvelles/view.js"],"sourcesContent":["const nouvellesPrevBtns = document.querySelectorAll(\".baseul-remontee-nouvelles-nav-prev\");\r\nnouvellesPrevBtns.forEach(nouvellesPrevBtn => {\r\n nouvellesPrevBtn.addEventListener(\"click\",function(e){\r\n console.log(\"pressed\");\r\n const listeNouvelles=e.target.parentElement.parentElement.parentElement.querySelector(\"ul.baseul-remontee-nouvelles\");\r\n const currentItem=listeNouvelles.querySelector(\"li.current\");\r\n currentItem.classList.remove(\"current\");\r\n currentItem.classList.add(\"previous\");\r\n currentItem.classList.add(\"reverse\");\r\n currentItem.setAttribute(\"aria-hidden\",true);\r\n const currentItemLinks=currentItem.querySelectorAll(\"a\");\r\n currentItemLinks.forEach(currentItemLink => {\r\n currentItemLink.setAttribute(\"tabindex\",\"-1\");\r\n });\r\n currentItem.setAttribute(\"tabindex\",\"-1\");\r\n const currentItemIndex = Array.from(listeNouvelles.children).indexOf(currentItem);\r\n const nextItem = (currentItemIndex==0)?listeNouvelles.lastChild:currentItem.previousElementSibling;\r\n nextItem.classList.remove(\"first-slide\");\r\n nextItem.classList.remove(\"previous\");\r\n nextItem.classList.add(\"reverse\");\r\n nextItem.classList.add(\"current\");\r\n nextItem.removeAttribute(\"aria-hidden\");\r\n const nextItemLinks=nextItem.querySelectorAll(\"a\");\r\n nextItemLinks.forEach(nextItemLinks => {\r\n nextItemLinks.removeAttribute(\"tabindex\");\r\n });\r\n\r\n const counter=e.target.parentElement.parentElement.querySelector(\".baseul-remontee-nouvelles-counter\");\r\n const newItemIndex=Array.from(listeNouvelles.children).indexOf(nextItem);\r\n counter.innerHTML = leadZeroes(newItemIndex+1)+\" / \"+leadZeroes(listeNouvelles.children.length);\r\n });\r\n});\r\nconst nouvellesNextBtns = document.querySelectorAll(\".baseul-remontee-nouvelles-nav-next\");\r\nnouvellesNextBtns.forEach(nouvellesNextBtn => {\r\n nouvellesNextBtn.addEventListener(\"click\",function(e){\r\n const listeNouvelles=e.target.parentElement.parentElement.parentElement.querySelector(\"ul.baseul-remontee-nouvelles\");\r\n const currentItem=listeNouvelles.querySelector(\"li.current\");\r\n currentItem.classList.remove(\"current\");\r\n currentItem.classList.remove(\"reverse\");\r\n currentItem.classList.add(\"previous\");\r\n currentItem.setAttribute(\"aria-hidden\",true);\r\n const currentItemLinks=currentItem.querySelectorAll(\"a\");\r\n currentItemLinks.forEach(currentItemLink => {\r\n currentItemLink.setAttribute(\"tabindex\",\"-1\");\r\n });\r\n const currentItemIndex = Array.from(listeNouvelles.children).indexOf(currentItem);\r\n const nextItem = ((currentItemIndex+1)==listeNouvelles.children.length)?listeNouvelles.firstChild:currentItem.nextElementSibling;\r\n nextItem.classList.remove(\"first-slide\");\r\n nextItem.classList.remove(\"previous\");\r\n nextItem.classList.remove(\"reverse\");\r\n nextItem.classList.add(\"current\");\r\n nextItem.removeAttribute(\"aria-hidden\");\r\n nextItem.removeAttribute(\"tabindex\");\r\n const nextItemLinks=nextItem.querySelectorAll(\"a\");\r\n nextItemLinks.forEach(nextItemLinks => {\r\n nextItemLinks.removeAttribute(\"tabindex\");\r\n });\r\n\r\n const counter=e.target.parentElement.parentElement.querySelector(\".baseul-remontee-nouvelles-counter\");\r\n const newItemIndex=Array.from(listeNouvelles.children).indexOf(nextItem);\r\n counter.innerHTML = leadZeroes(newItemIndex+1)+\" / \"+leadZeroes(listeNouvelles.children.length);\r\n });\r\n});\r\n\r\nvar leadZeroes=function(number){\r\n return number.toString().padStart(2, '0');\r\n}"],"names":["nouvellesPrevBtns","document","querySelectorAll","forEach","nouvellesPrevBtn","addEventListener","e","console","log","listeNouvelles","target","parentElement","querySelector","currentItem","classList","remove","add","setAttribute","currentItemLinks","currentItemLink","currentItemIndex","Array","from","children","indexOf","nextItem","lastChild","previousElementSibling","removeAttribute","nextItemLinks","counter","newItemIndex","innerHTML","leadZeroes","length","nouvellesNextBtns","nouvellesNextBtn","firstChild","nextElementSibling","number","toString","padStart"],"sourceRoot":""}