var ArticlePage=ArticlePage||{};ArticlePage.Carousel=ArticlePage.Carousel||{},function(n,t,i){var u,f=[],o,r,s=0,e=0,h=20,c=500,l=function(){s=r.offsetWidth;for(var t=0;t<r.children.length;t++)e+=r.children[t].offsetWidth;s>e||r&&(r.setAttribute("class","carousel-container"),u=n.createElement("div"),u.setAttribute("class","carousel-inner-container"),u.innerHTML=r.innerHTML,u.style.width=e+"px",r.innerHTML="",n.body.appendChild(u),r.appendChild(u),f.push(u),r.style.opacity=1,r.style.visibility="visible")},w=function(n,t){const i=t===0?f[1]:f[0];parseFloat(n.style.left)<-n.offsetWidth&&(n.style.left=i.offsetWidth+"px")},a=function(){o=setInterval(function(){clearInterval(o);o=null;a()},h);f.forEach(function(n,t){n.style.left=parseFloat(n.style.left)-1+"px";w(n,t)})},v=function(){if(s<e){r.setAttribute("class","carousel-container active-carousel-container");u.setAttribute("class","carousel-inner-container");u.style.left="0px";var n=u.cloneNode(!0);r.appendChild(n);n.style.left=e+"px";f.push(n);a()}},b=function(t,i,u){i&&(h=i);i&&(c=u);r=n.getElementById(t);setTimeout(function(){l();v()},c)},y=function(){if(f=[],e=0,s=0,r.setAttribute("class","carousel-container"),u){r.innerHTML="";var n=u.children.length;do r.appendChild(u.children[0]),n--;while(n>0)}u=duplicateInnerContainer=null;clearInterval(o);o=null;l();v()},p;t.addEventListener("resize",function(){t.clearTimeout(p);p=t.setTimeout(function(){y()},100)});i.init=b;i.reInit=y}(document,window,ArticlePage.Carousel)