"),l=t.parent().wrap("
"),y=t.children("li"),p=function(){s=1;t.append(y.clone(!0).addClass("tick-clones"));t.children("li").each(function(n){s+=i(this,n).outerWidth(!0)})},w=l.outerWidth(!0);s');v.insertAfter(l);i("body").on("click","#"+f+" .er-controls > .pause",function(){if(!r)return!1;i(this).toggleClass("pause glyphicon-pause play glyphicon-play");t.unbind("mouseenter mouseleave");r=!1});i("body").on("click","#"+f+" .er-controls > .play",function(){if(r)return!1;i(this).toggleClass("pause glyphicon-pause play glyphicon-play");r=!0;a();var f=t.offset().left,n=f+t.children("li:first").outerWidth(!0)-c,e=o/u*n;h(n,e)});e=!1;i("body").on("click","#"+f+" .er-controls > .next",function(){if(r){i("#"+f+" .er-controls > .pause").toggleClass("pause glyphicon-pause play glyphicon-play");r=!1;return}if(e)return!1;var u=t.children("li:first").outerWidth(!0),o=u/n.speed*1e3;e=!0;t.stop(!0,!0).animate({left:"-="+u},o,"linear",function(){t.children("li:first").appendTo(t);t.css("left",0);e=!1})});i("body").on("click","#"+f+" .er-controls > .prev",function(){var u,o;if(r){i("#"+f+" .er-controls > .pause").toggleClass("pause glyphicon-pause play glyphicon-play");r=!1;return}if(e)return!1;u=t.children("li:last").outerWidth(!0);t.css("left","-"+u+"px");t.children("li:last").prependTo(t);o=u/n.speed*1e3;e=!0;t.stop(!0,!0).animate({left:"+="+u},o,"linear",function(){e=!1})})}})};
$(()=>{function c(){const n=u.querySelectorAll(".prediction-item");return n.length>=2?n[1].offsetLeft-n[0].offsetLeft:n.length===1?n[0].offsetWidth:void 0}function l(){const n=u.scrollWidth-u.clientWidth;u.scrollLeft=n-1?(e.style.backgroundColor="#989898",e.style.pointerEvents="none"):(e.style.backgroundColor="",e.style.pointerEvents="auto")}const o=document.querySelector("#announcement_list");o&&o.childElementCount>0&&$(o).endlessRiver();const s=document.querySelector("#popular_providers");if(s){$(s).scrollingTabs({enableSwiping:!0,scrollToTabEdge:!0,disableScrollArrowsOnFullyScrolled:!0});const n=document.querySelector('#popular_providers [data-toggle="tab"]');n&&n.click()}const n=document.querySelector("#featured_games");if(n){const i=document.querySelector("#previous_new_featured_game"),r=document.querySelector("#next_new_featured_game"),t=250;i.onclick=()=>{const i=Math.ceil(n.querySelector("a").clientWidth),r=Math.ceil(n.scrollLeft/i)-1,u=Math.floor(n.scrollWidth/i),f=Math.ceil(r*i);if(r{const i=Math.ceil(n.querySelector("a").clientWidth),r=Math.ceil(n.scrollLeft/i)+1,f=Math.floor(n.scrollWidth/i),u=Math.ceil(r*i);if(r>=f){$(n).animate({scrollLeft:0},t);return}if(n.scrollWidth-n.scrollLeft{const i=Math.ceil(t.querySelector(".game-item").clientWidth)*2,r=Math.ceil(t.scrollLeft/i)-1,u=Math.floor(t.scrollWidth/i),f=Math.ceil(r*i);if(r{const i=Math.ceil(t.querySelector(".game-item").clientWidth)*2,r=Math.ceil(t.scrollLeft/i)+1,f=Math.floor(t.scrollWidth/i),u=Math.ceil(r*i);if(r>=f){$(t).animate({scrollLeft:0},n);return}if(t.scrollWidth-t.scrollLeft{const t=Math.ceil(i.querySelector(".game-item").clientWidth)*2,r=Math.ceil(i.scrollLeft/t)-1,u=Math.floor(i.scrollWidth/t),f=Math.ceil(r*t);if(r{const t=Math.ceil(i.querySelector(".game-item").clientWidth)*2,r=Math.ceil(i.scrollLeft/t)+1,f=Math.floor(i.scrollWidth/t),u=Math.ceil(r*t);if(r>=f){$(i).animate({scrollLeft:0},n);return}if(i.scrollWidth-i.scrollLeft{const t=Math.ceil(r.querySelector(".game-item").clientWidth),i=Math.ceil(r.scrollLeft/t)-1,u=Math.floor(r.scrollWidth/t),f=Math.ceil(i*t);if(i{const t=Math.ceil(r.querySelector(".game-item").clientWidth),i=Math.ceil(r.scrollLeft/t)+1,f=Math.floor(r.scrollWidth/t),u=Math.ceil(i*t);if(i>=f){$(r).animate({scrollLeft:0},n);return}if(r.scrollWidth-r.scrollLeft{const n=c();u.scrollBy({left:-n,behavior:"smooth"})});e&&e.addEventListener("click",()=>{const n=c();u.scrollBy({left:n,behavior:"smooth"})});u&&(u.addEventListener("scroll",l),window.addEventListener("load",l))});
window.initializeReportingOverlayItemEvent=n=>{n.onclick||n.addEventListener("click",function(t){if(t.target.closest(["a","button",".copy_account_number_button",".copy-btn"])){t.stopPropagation();return}const r=n.dataset.identifier,i=document.querySelector(`[data-reporting-detail][data-identifier="${r}"]`);if(i){document.body.classList.add("no-scroll");i.classList.add("open");const n=i.querySelector(".close_reporting_detail_button");n&&(n.onclick=()=>{document.body.classList.remove("no-scroll"),i.classList.remove("open")})}})};window.initializeReportingPopupItemEvent=n=>{n.onclick||(n.onclick=()=>{const i=n.dataset.identifier,t=document.querySelector(`[data-reporting-detail-popup][data-identifier="${i}"]`);if(t){t.classList.add("open");const n=t.querySelector(".close_reporting_detail_popup");n&&(n.onclick=()=>{t.classList.remove("open")})}})};window.initializePendingTransactionDetail=()=>{const n=document.querySelectorAll("[data-pending-transaction-info-header]");n&&n.length>0&&(Array.from(n).forEach(n=>{n.onclick||(n.onclick=()=>{n.parentElement.classList.toggle("open")})}),initializeCopyButton())};window.addEventListener("DOMContentLoaded",()=>{const n=document.querySelectorAll("[data-reporting-item]");n&&n.length>0&&Array.from(n).forEach(n=>{window.initializeReportingOverlayItemEvent(n)});const t=document.querySelectorAll("[data-reporting-row]");t&&t.length>0&&Array.from(t).forEach(n=>{initializeReportingPopupItemEvent(n)});initializePendingTransactionDetail()});
$(()=>{const n=document.querySelector("#date_range_picker"),t=document.querySelector("#starting_date"),i=document.querySelector("#ending_date"),r="DD-MMM-YYYY";n&&($(n).dateRangePicker({format:r,separator:" "+n.dataset.separator+" "}).bind("datepicker-change",function(n,u){t.value=moment(u.date1).format(r);i.value=moment(u.date2).format(r)}),$(n).data("dateRangePicker").setDateRange(t.value,i.value));const o=document.querySelectorAll(".table tfoot a");Array.prototype.slice.apply(o).forEach(n=>{n.href.includes("startingDate")===!1&&(n.href+=`&startingDate=${t.value}`),n.href.includes("endingDate")===!1&&(n.href+=`&endingDate=${i.value}`)});const u=document.querySelector(".grid_table"),f=document.querySelector("#totals_template");u&&f&&u.appendChild(f.content.cloneNode(!0));const s=document.querySelectorAll(".pending_transaction");Array.prototype.slice.call(s).forEach(n=>{n.onclick=()=>{$.ajax({type:"POST",data:JSON.stringify({ticketNumber:n.dataset.ticketNumber}),url:"/reporting/pending-transaction",contentType:"application/json; charset=utf-8",dataType:"html",success:n=>{!n||registerPopup({content:n,cssClass:"concise-transaction-popup"})}})}});const h=document.querySelectorAll(".copy_ticket_button");h.forEach(n=>{$(n).popover({content:n.dataset.popoverText,placement:"top",trigger:"manual"}),n.onclick=()=>{if(navigator.clipboard){const t=n.previousElementSibling;navigator.clipboard.writeText(t.innerText.replaceAll("-","")).then(()=>{const t=$(n);t.popover("show");setTimeout(()=>t.popover("hide"),500)}).catch(n=>console.log("Error when copying account number: "+n))}}});const c=document.querySelectorAll(".row_attributes");c.forEach(n=>{const t=n.parentElement.parentElement;Object.assign(t.dataset,n.dataset);window.initializeReportingPopupItemEvent(t)});const e=document.querySelector(".reporting_table");if(e){const n=e.querySelector("tfoot tr");if(n){const t=n.querySelector("td");t.classList.add("pagination-section")}}});