(s=>{"function"==typeof define&&define.amd?define("ctsCarousel",s):s()})(function(){jQuery(document).ready(function(i){var l="rtl"===i("html").attr("dir");i(".cts-carousel").each(function(s,c){function t(){var s=c.scrollLeft,t=c.scrollWidth-c.offsetWidth;l?(10<t+s?r.classList.add("cts-show"):r.classList.remove("cts-show"),s<-10?o.classList.add("cts-show"):o.classList.remove("cts-show")):(10<t-s?r.classList.add("cts-show"):r.classList.remove("cts-show"),10<s?o.classList.add("cts-show"):o.classList.remove("cts-show"))}function e(s){var t=l?Math.abs(c.scrollLeft):c.scrollLeft,e=c.scrollWidth-c.offsetWidth;return"next"===s?Math.min(300,e-t):Math.min(300,t)}var o=c.querySelector(".cts-prev"),r=c.querySelector(".cts-next");i(r).on("click",function(){var s=e("next");c.scrollBy({left:l?-s:s,behavior:"smooth"})}),i(o).on("click",function(){var s=e("prev");c.scrollBy({left:l?s:-s,behavior:"smooth"})}),c.addEventListener("scroll",MyListing.Helpers.debounce(t,20)),new ResizeSensor(c,MyListing.Helpers.debounce(t,100)),t()})})});
