\n
").concat(modalMessage, "
\n
\n \n \n
\n
"); newModal.innerHTML = template; body.appendChild(newModal); var _negativeButton = newModal.querySelector('.modal-negative'); var _positiveButton = newModal.querySelector('.modal-positive'); _negativeButton.addEventListener("click", function () { disableButtons(_negativeButton, _positiveButton); rejectModal(); }); _positiveButton.addEventListener("click", function () { disableButtons(_negativeButton, _positiveButton); accpetModal(); }); }}function closeModals() { var allModals = document.querySelectorAll('.ag-modal'); for (var i = 0; i < allModals.length; i++) { allModals[i].dataset.status = 'closed'; }}function withdrawalModal() { function widthdrawalModalOpen() { closeModals(); Application.ContinueOpeningCashierPopup(null, "https://www.sportnation.bet/" + "eps-money-transfer/" + '?prodID=0&tranType=1'); } var withdrawalArgs = { title: 'Hold tight...', message: '
Before you continue, you should know you can no longer cancel withdrawals. You will need to redeposit in order to continue playing.
Do you want to continue with your withdrawal?
', confirmText: 'Withdraw', rejectText: 'Don\'t withdraw', acceptCB: widthdrawalModalOpen }; createModal('withdrawal-modal', withdrawalArgs);}function getBrand() { return { brand: 'sportnation', fancy: 'SportNation', full: 'SportNation.bet', initials: 'SN' };}function GenerateSBToken() { var token; var extractToken = function extractToken(res) { var result = eval(res); var isValid = false; if (result && result.status && result.status === 'success' && result.token) { isValid = true; } return isValid ? result.token : 'anon'; }; var init = function init() { sessionStorage.removeItem('ag-token'); function updateToken() { console.log('updating token'); PageMethods.ExtAPIGenerateToken(function (tkn) { tkn = extractToken(tkn); PageMethods.ExtAPIValidateToken(tkn, function (usr) { var user = eval(usr); if (user.email) { var brand = getBrand(); token = brand.initials + '_' + encodeURIComponent(tkn); console.log(token); sessionStorage.setItem('ag-token', token); } }); }); setTimeout(updateToken, 25000); } updateToken(); }; var onceToken = function onceToken() { return new Promise(function (resolve, reject) { PageMethods.ExtAPIGenerateToken(function (tkn) { tkn = extractToken(tkn); PageMethods.ExtAPIValidateToken(tkn, function (usr) { var user = eval(usr); if (user.email) { var brand = getBrand(); token = brand.initials + '_' + encodeURIComponent(tkn); console.log(token); resolve(token); } else { reject(new Error("token generatin error… no user found")); } }); }); }); }; var returnToken = function returnToken() { return token || 'token error'; }; return { onceToken: onceToken, init: init, getToken: returnToken };}var generateSBToken = GenerateSBToken();function agHttpRequestT(method, url, auth, data) { return new Promise(function (resolve, reject) { var xhr = new XMLHttpRequest(); xhr.open(method, url, true); if (auth) { var authToken = generateSBToken.getToken(); xhr.setRequestHeader('Authorization', 'Bearer ' + authToken); } if (data) { xhr.setRequestHeader("Content-Type", "application/json"); } xhr.onload = function () { if (xhr.status === 200 || xhr.status === 201) { resolve(JSON.parse(xhr.response)); } else { reject(Error(xhr.statusText)); } }; xhr.onerror = function () { reject(Error("Network Error")); }; if (data) { xhr.send(data); } else { xhr.send(); } });}function AgTagManager() { var tags = []; function getWhitelistTags() { return new Promise(function (resolve, reject) { if (tags.length > 0) { resolve(tags); } else { return generateSBToken.onceToken().then(function (token) { agHttpRequestT('GET', 'https://api.rewardsmatrix.com/virtual_shop/tags_whitelist/?sb_token=' + token).then(function (response) { console.log(response); resolve(response); }, function (error) { reject(error); }); }); } }); } function addTag(tags) { return new Promise(function (resolve, reject) { if (typeof tags === 'string') { tags = [tags]; } if (Array.isArray(tags)) { generateSBToken.onceToken().then(function (token) { var data = { sb_token: decodeURIComponent(token), tags: tags }; var payload = JSON.stringify(data); return agHttpRequestT('POST', 'https://api.rewardsmatrix.com/pc/atm/add_tag', true, payload).then(function (response) { console.log(response); resolve(response); }); }); } else { reject(new Error('tags not recognised')); } }); } return { whitelist: getWhitelistTags, add: addTag };}var agTagManager = AgTagManager();function AgNoteManager() { function addNote(note) { return new Promise(function (resolve, reject) { if (typeof note === 'string') { generateSBToken.onceToken().then(function (token) { var data = { sb_token: decodeURIComponent(token), note: note }; var payload = JSON.stringify(data); return agHttpRequestT('POST', 'https://api.rewardsmatrix.com/pc/atm/add_note', true, payload).then(function (response) { console.log(response); resolve(response); }); }); } else { reject(new Error('note must be of type: string')); } }); } return { add: addNote };}var agNoteManager = AgNoteManager();function reviewModals() { globalDetails.tags().then(function (userTags) { var docTags = ["REVIEW_2500_GREEN", "REVIEW_5K_GREEN", "REVIEW_8500_AMBER", "REVIEW_6800_AMBER", "REVIEW_5100_AMBER", "REVIEW_3400_AMBER", "REVIEW_1700_AMBER"]; var tag; function reviewContinue() { localStorage.setItem(tag, JSON.stringify({ date: new Date() })); Promise.all([agTagManager.add(tag + '_SEEN'), agNoteManager.add(tag + " Play, " + new Date().toGMTString())]).then(function () { closeModals(); }); } function sendToJira() { generateSBToken.onceToken().then(function (token) { var data = { sb_token: decodeURIComponent(token), jira_tag: tag, jira_issue_type: 'Compliance Account Review' }; var payload = JSON.stringify(data); return agHttpRequestT("POST", "https://api.rewardsmatrix.com/pc/atm/add_jira", true, payload); }); } function reviewLearn() { localStorage.setItem(tag, JSON.stringify({ date: new Date() })); Promise.all([agTagManager.add(tag + '_SEEN'), agNoteManager.add(tag + " Learn, " + new Date().toGMTString()), sendToJira()]).then(function () { window.location.href = window.location.origin + "/responsible-gaming-info/"; }); } for (var _i = 0, _docTags = docTags; _i < _docTags.length; _i++) { var t = _docTags[_i]; tag = t; if (userTags.contains(tag)) { var localVal = localStorage.getItem(tag); if (!userTags.contains(tag + '_SEEN') && !localVal) { createModal(tag, { title: "Hi from the Responsible Gaming team!", message: '
We are just checking in about your deposits. Are you happy to continue or would you like to learn more about our Responsible Gaming tools?
', confirmText: "Keep Playing", rejectText: "Learn More", acceptCB: reviewContinue, rejectCB: reviewLearn }); break; } } } });}function documentModals() { if (UserInfo.current && UserInfo.current.IsIdVerified === 0) { globalDetails.tags().then(function (userTags) { if (userTags.includes('KYC_TRIGGERED_17_AMBER') && !sessionStorage.getItem("KYC_PROMPT_1700") || userTags.includes('KYC_TRIGGERED_17') && !sessionStorage.getItem("KYC_PROMPT_1700")) { var documentModalOpen = function documentModalOpen() { sessionStorage.setItem('KYC_PROMPT_1700', JSON.stringify({ date: new Date() })); if (!userTags.includes("KYC_PROMPT_1500_SEEN")) { localStorage.setItem('KYC_PROMPT_1500', JSON.stringify({ date: new Date() })); agTagManager.add('KYC_PROMPT_1500_SEEN').then(function (resp) { closeModals(); openVerification(); }); } else { closeModals(); openVerification(); } }; var documentModalClose = function documentModalClose() { sessionStorage.setItem('KYC_PROMPT_1700', JSON.stringify({ date: new Date() })); if (!userTags.includes("KYC_PROMPT_1500_SEEN")) { localStorage.setItem('KYC_PROMPT_1500', JSON.stringify({ date: new Date() })); agTagManager.add('KYC_PROMPT_1500_SEEN').then(function (resp) { closeModals(); }); } else { closeModals(); } }; createModal("KYC_PROMPT_1700", { title: 'Documents Reminder', message: "
You have now hit the point in your SportNation journey at which we are required to ask for verification documents. We know this can be inconvenient so as a thank you, we’ll give you a £20 Free Bet once they’ve been accepted.
Here’s what we need:
- Proof of ID - Passport, Drivers Licence or National ID Card (front & back).
- Proof of Address - A Utility bill or Bank Statement dated within the last 3 months or any Government official documentation. (We’re unable to accept mobile phone bills)
As soon as your docs have been accepted, a £20 Free Bet will be added to your account. This can be used on any sport and is valid for 7 days.
", confirmText: 'Upload Docs Now', rejectText: 'Remind me later', acceptCB: documentModalOpen, rejectCB: documentModalClose }); } else if (userTags.includes("KYC_PROMPT_1500") && !userTags.includes("KYC_PROMPT_1500_SEEN") && !localStorage.getItem("KYC_PROMPT_1500")) { var _documentModalOpen = function _documentModalOpen() { localStorage.setItem('KYC_PROMPT_1500', JSON.stringify({ date: new Date() })); agTagManager.add('KYC_PROMPT_1500_SEEN').then(function (resp) { window.dataLayer.push({ 'event': 'ag-document-modal', 'document-data': { modalAmmount: 'KYC_PROMPT_1500', event: 'Submit Docs' } }); console.log(resp); closeModals(); openVerification(); }); }; var _documentModalClose = function _documentModalClose() { localStorage.setItem('KYC_PROMPT_1500', JSON.stringify({ date: new Date() })); agTagManager.add('KYC_PROMPT_1500_SEEN').then(function (resp) { window.dataLayer.push({ 'event': 'ag-document-modal', 'document-data': { modalAmmount: 'KYC_PROMPT_1500', event: 'Remind Me Later' } }); console.log(resp); closeModals(); }); }; createModal("KYC_PROMPT_1500", { title: 'Documents Reminder', message: "
You’re approaching a point in your SportNation journey in which we are required to ask for verification docs. We know this can be inconvenient so as a thank you, we’ll give you a £20 Free Bet once they’ve been accepted.
Here’s what we need:
- Proof of ID - Passport, Drivers Licence or National ID Card (front & back).
- Proof of Address - A Utility bill or Bank Statement dated within the last 3 months or any Government official documentation. (We’re unable to accept mobile phone bills)
As soon as your docs have been accepted, a £20 Free Bet will be added to your account. This can be used on any sport and is valid for 7 days.
", confirmText: 'Upload Docs Now', rejectText: 'Remind me later', acceptCB: _documentModalOpen, rejectCB: _documentModalClose }); } else if (userTags.includes("KYC_PROMPT_1000") && !userTags.includes("KYC_PROMPT_1500") && !userTags.includes("KYC_PROMPT_1000_SEEN") && !localStorage.getItem("KYC_PROMPT_1000")) { var _documentModalOpen2 = function _documentModalOpen2() { localStorage.setItem('KYC_PROMPT_1000', JSON.stringify({ date: new Date() })); agTagManager.add('KYC_PROMPT_1000_SEEN').then(function (resp) { window.dataLayer.push({ 'event': 'ag-document-modal', 'document-data': { modalAmmount: 'KYC_PROMPT_1000', event: 'Submit Docs' } }); console.log(resp); closeModals(); openVerification(); }); }; var _documentModalClose2 = function _documentModalClose2() { localStorage.setItem('KYC_PROMPT_1000', JSON.stringify({ date: new Date() })); agTagManager.add('KYC_PROMPT_1000_SEEN').then(function (resp) { window.dataLayer.push({ 'event': 'ag-document-modal', 'document-data': { modalAmmount: 'KYC_PROMPT_1000', event: 'Remind Me Later' } }); console.log(resp); closeModals(); }); }; createModal("KYC_PROMPT_1000", { title: 'Documents Reminder', message: "
You are approaching a point in your SportNation journey in which we are required to ask for verification docs. These can sometimes take a day or 2 to process so we advise that you send these beforehand to ensure that your experience is not disrupted.
Here’s what we need:
- Proof of ID - Passport, Drivers Licence or National ID Card (front & back).
- Proof of Address - A Utility bill or Bank Statement dated within the last 3 months or any Government official documentation. (We’re unable to accept mobile phone bills)
", confirmText: 'Upload Docs Now', rejectText: 'Remind me later', acceptCB: _documentModalOpen2, rejectCB: _documentModalClose2 }); } }); }}function openVerification() { if (event) { event.preventDefault(); } if (Application.Panels['my-account-pop-up']) { Application.navigateToAccountCheckDocumentBlock(); } else if (Application.Panels['account-verification-panel']) { Application.navigateTo('account-verification-panel'); } else { window.location = '/account-verification/'; }}function moveBetslipError() { var betSlip = document.querySelector('#idBetsSelections'); var errorMsgs = document.querySelectorAll('.betSlip-message-warning'); if (betSlip && errorMsgs) { this.disconnect(); for (var x = 0; x < errorMsgs.length; x++) { if (errorMsgs[x].textContent.indexOf("cannot be combined") === -1 && errorMsgs[x].textContent.indexOf("Score changed") && errorMsgs[x].textContent.indexOf("combo") === -1) { betSlip.appendChild(errorMsgs[x]); } } moveBetslipErrorMutation(); }}function moveBetslipErrorMutation() { var betSlip = document.querySelector('#betting_slip'); var errorObserver = new MutationObserver(moveBetslipError); if (betSlip) { errorObserver.observe(betSlip, { childList: true, subtree: true }); } else { var rightPanel = document.querySelector('.panel-right-inner'); if (rightPanel !== null) { errorObserver.observe(rightPanel, { childList: true, subtree: true }); } }}function parseJwt(token) { try { return JSON.parse(atob(token.split('.')[1])); } catch (e) { return null; }}function isToday(someDate) { var today = new Date(); return someDate.getDate() === today.getDate() && someDate.getMonth() === today.getMonth() && someDate.getFullYear() === today.getFullYear();}function checkCasinoModals() { function checkLocalTags(tag) { var storageItem = localStorage.getItem(tag); var localValue = false; if (storageItem) { try { localValue = JSON.parse(storageItem); } catch (_unused) { localValue = false; } } if (localValue && localValue.date) { var localDate = new Date(localValue.date); if (isToday(localDate)) { return true; } } return false; } function lateNightContinue() { generateSBToken.onceToken().then(function (token) { var data = { token: decodeURIComponent(token), casino_2am_consent: true }; var payload = JSON.stringify(data); return agHttpRequestT('POST', 'https://api.rewardsmatrix.com/pc/casino_2am_consent', true, payload); }).then(function () { localStorage.setItem('2AM_CASINO_FIRST', JSON.stringify({ date: new Date() })); agTagManager.add('2AM_CASINO_FIRST').then(function () { closeModals(); }); }); } function tagModalPlay() { localStorage.setItem('2AM_CASINO_SECOND', JSON.stringify({ date: new Date() })); Promise.all([agTagManager.add('2AM_CASINO_SECOND'), agNoteManager.add('2AM_CASINO, Play, ' + new Date().toGMTString())]).then(function () { closeModals(); }); } function tagModalLearn() { localStorage.setItem('2AM_CASINO_SECOND', JSON.stringify({ date: new Date() })); Promise.all([agTagManager.add(['2AM_CASINO_SECOND', 'LEARN_MORE']), agNoteManager.add('2AM_CASINO, Learn, ' + new Date().toGMTString())]).then(function () { window.location.href = window.location.origin + '/responsible-gaming-info/'; }); } globalDetails.tags().then(function (tags) { if (!checkLocalTags('2AM_CASINO_FIRST') && !tags.contains('2AM_CASINO_FIRST') && !tags.contains('2AM_CASINO_POPUP')) { createModal('AM_CASINO_FIRST', { title: 'Hold up, it’s late', message: '
It’s pretty late at the moment, we just wanted to check that you want to continue?
', confirmText: 'Keep Playing', rejectText: 'Stop for the Night', acceptCB: lateNightContinue, rejectCB: Application.goHome }); } else if (tags.contains('2AM_CASINO_POPUP') && !checkLocalTags('2AM_CASINO_SECOND') && !tags.contains('2AM_CASINO_SECOND')) { createModal('AM_CASINO_SECOND', { title: 'Hold up, it’s late', message: '
You\'ve been playing for over an hour since we last contacted you. We just wanted to make sure you\'d like to continue playing, or would you like to learn more about our Responsible Gaming tools?
', confirmText: 'Keep Playing', rejectText: 'Learn More', acceptCB: tagModalPlay, rejectCB: tagModalLearn }); } });}function checkCasinoTimegate() { function getDateFromToken(casToken) { var decodedToken = casToken ? parseJwt(casToken) : null; console.log(decodedToken); var decodedDate = casToken ? new Date(decodedToken.iat * 1000) : new Date(); console.log(decodedDate); return decodedDate; } var casToken = PlatformJWTManager.getPlatformJWT(); var tokenDate = getDateFromToken(casToken); if (tokenDate.getUTCHours() >= 3 && tokenDate.getUTCHours() < 7) { checkCasinoModals(); } else { var nowTime = tokenDate; var runTime; if (nowTime.getHours() < 1) { runTime = new Date(nowTime.getFullYear(), nowTime.getMonth(), nowTime.getDate(), 2, 0, 0, 0); } else { runTime = new Date(nowTime.getFullYear(), nowTime.getMonth(), nowTime.getDate() + 1, 2, 0, 0, 0); } var waitTime = runTime - nowTime; setTimeout(function () { checkCasinoModals(); }, waitTime); }}function moveCasBundle() { var casBundle = document.querySelector('link[rel="stylesheet"][href*="cas-bundle.css"'); if (casBundle) { var head = document.querySelector('head'); head.insertBefore(casBundle, head.firstChild); console.log('moving cas-bundle'); }}function initSpecials(p) { var panel = p.panel.ID; if (panel === "league-list" && p.params[0] === 1) { clearSpecials(); var viewBlock = document.querySelector('#league-list .tab-switch-responsive-block'); if (viewBlock) { var specialsEl = document.createElement('ag-specials'); var limitAmmount = document.documentElement.classList.contains('IsMobile') ? 2 : 3; specialsEl.setAttribute('sport', 'soccer'); specialsEl.setAttribute('limit', limitAmmount); specialsEl.setAttribute('selection-limit', '1'); specialsEl.setAttribute('by-date', 'true'); viewBlock.before(specialsEl); } else { setTimeout(function () { console.log('second specials'); if (Application.getCurrent().ID === "league-list") { var _viewBlock = document.querySelector('#league-list .tab-switch-responsive-block'); if (_viewBlock) { var _specialsEl = document.createElement('ag-specials'); var _limitAmmount = document.documentElement.classList.contains('IsMobile') ? 2 : 3; _specialsEl.setAttribute('sport', 'soccer'); _specialsEl.setAttribute('limit', _limitAmmount); _specialsEl.setAttribute('selection-limit', '1'); _specialsEl.setAttribute('by-date', 'true'); _viewBlock.before(_specialsEl); } } }, 250); } } if (panel === "league-view" && p.params[1] === 1) { clearSpecials(); var leagueId = p.params[0]; var _viewBlock2 = document.querySelector('#league-view .league-view-responsive-block'); if (_viewBlock2 && leagueId) { var _specialsEl2 = document.createElement('ag-specials'); var _limitAmmount2 = document.documentElement.classList.contains('IsMobile') ? 2 : 3; _specialsEl2.setAttribute('sport', 'soccer'); _specialsEl2.setAttribute('league', leagueId); _specialsEl2.setAttribute('limit', _limitAmmount2); _specialsEl2.setAttribute('selection-limit', '2'); _specialsEl2.setAttribute('by-date', 'true'); _viewBlock2.before(_specialsEl2); } else { setTimeout(function () { console.log('second specials'); if (Application.getCurrent().ID === "league-view") { var _viewBlock3 = document.querySelector('#league-view .league-view-responsive-block'); if (_viewBlock3 && leagueId) { var _specialsEl3 = document.createElement('ag-specials'); var _limitAmmount3 = document.documentElement.classList.contains('IsMobile') ? 2 : 3; _specialsEl3.setAttribute('sport', 'soccer'); _specialsEl3.setAttribute('league', leagueId); _specialsEl3.setAttribute('limit', _limitAmmount3); _specialsEl3.setAttribute('selection-limit', '2'); _specialsEl3.setAttribute('by-date', 'true'); _viewBlock3.before(_specialsEl3); } } }, 250); } } if (panel === "pre-live-betting" && p.params[2] === 1) { clearSpecials(); var eventId = p.params[0]; var _viewBlock4 = document.querySelector('#pre-live-betting [id^="event-view"].event-view'); if (_viewBlock4 && eventId) { var _specialsEl4 = document.createElement('ag-specials'); _specialsEl4.setAttribute('sport', 'soccer'); _specialsEl4.setAttribute('event', eventId); _viewBlock4.before(_specialsEl4); } else { setTimeout(function () { console.log('second specials'); if (Application.getCurrent().ID === "pre-live-betting") { var _viewBlock5 = document.querySelector('#pre-live-betting [id^="event-view"].event-view'); if (_viewBlock5 && eventId) { var _specialsEl5 = document.createElement('ag-specials'); _specialsEl5.setAttribute('sport', 'soccer'); _specialsEl5.setAttribute('event', eventId); _viewBlock5.before(_specialsEl5); } } }, 250); } } if (panel === "racing-branch-panel" && p.params[1] === 61) { clearSpecials(); var _viewBlock6 = document.querySelector('#racing-branch-panel ag-racing-timetable'); if (_viewBlock6) { var _specialsEl6 = document.createElement('ag-specials'); _specialsEl6.setAttribute('sport', 'horse-racing'); _specialsEl6.setAttribute('limit', '8'); _specialsEl6.classList.add('racing-specials'); _viewBlock6.before(_specialsEl6); } else { setTimeout(function () { console.log('second specials'); if (Application.getCurrent().ID === "racing-branch-panel") { var _viewBlock7 = document.querySelector('#racing-branch-panel ag-racing-timetable'); if (_viewBlock7) { var _specialsEl7 = document.createElement('ag-specials'); _specialsEl7.setAttribute('sport', 'horse-racing'); _specialsEl7.setAttribute('limit', '8'); _specialsEl7.classList.add('racing-specials'); _viewBlock7.before(_specialsEl7); } } }, 250); } }}function clearSpecials() { var oldEls = document.querySelectorAll('ag-specials:not(racing-specials)'); var _iterator = _createForOfIteratorHelper(oldEls), _step; try { for (_iterator.s(); !(_step = _iterator.n()).done;) { var el = _step.value; el.remove(); } } catch (err) { _iterator.e(err); } finally { _iterator.f(); }}function createFloatingBanner(banner) { var _document$querySelect; var fBanner = (_document$querySelect = document.querySelector('#floating-promo-img')) !== null && _document$querySelect !== void 0 ? _document$querySelect : document.createElement('div'); fBanner.id = 'floating-promo-img'; document.body.appendChild(fBanner); JSON.parse(localStorage.getItem("hidden_fBanners")) || []; var img = banner.image_url || 'https://volga.prod.gmx.flipsports.net/' + banner.image.data.asset_url; fBanner.innerHTML = ""); fBanner.setAttribute('data-action', 'fbStoreId'); fBanner.setAttribute('data-params', banner.name); window.fbStoreId = function (id) { document.querySelector('#floating-promo-img').classList.add('banner-hidden'); document.querySelector('#floating-promo-img').classList.remove('banner-visible'); var hiddenArray = JSON.parse(localStorage.getItem("hidden_fBanners")) || []; if (!Array.isArray(hiddenArray)) { hiddenArray = []; } if (hiddenArray.indexOf(id) === -1) { hiddenArray.push(id); } localStorage.setItem('hidden_fBanners', JSON.stringify(hiddenArray)); }; function promoScroller() { var fBanner = document.querySelector('#floating-promo-img'); if (fBanner) { var scrollPosition = window.pageYOffset; var scrollOffset = 180; if (scrollPosition > scrollOffset) { fBanner.classList.add('banner-visible'); } else { fBanner.classList.remove('banner-visible'); } } } window.addEventListener('scroll', promoScroller); Application.AfterNavigation.clearBanners = function (e) { var fBanner = document.querySelector('#floating-promo-img'); if (e.ID !== 'home' && e.ID !== 'league-view' || e.ID !== 'league-list') { if (fBanner) { fBanner.classList.add('banner-hidden'); } } else { if (fBanner) { fBanner.classList.remove('banner-hidden'); } } };}function checkBanners(banners) { var hiddenArray = JSON.parse(localStorage.getItem("hidden_fBanners")) || []; if (!Array.isArray(hiddenArray)) { hiddenArray = []; } var _iterator = _createForOfIteratorHelper(banners), _step; try { for (_iterator.s(); !(_step = _iterator.n()).done;) { var banner = _step.value; var tDate = new Date(); var s = banner !== null && banner !== void 0 && banner.start_date ? new Date(banner.start_date.replace(' ', 'T')) : new Date(0); var e = banner !== null && banner !== void 0 && banner.end_date ? new Date(banner.end_date.replace(' ', 'T')) : new Date('01-01-2100'); if (hiddenArray.indexOf(banner.name) === -1 && e !== 'Invalid Date' && s !== 'Invalid Date' && s < tDate && tDate < e) { if (banner.show_on === 'Sports' && window.location.pathname.split('/').filter(function (t) { return t; })[0] === 'sports' || banner.show_on === 'Casino' && Application.getCurrent().ID.includes('casino-panel')) { createFloatingBanner(banner); break; } } } } catch (err) { _iterator.e(err); } finally { _iterator.f(); }}function getFloatingBanners() { return agHttpRequestT('GET', 'https://volga.prod.gmx.flipsports.net/_/items/sn_mobile_floating_banner?fields=*,image.*').then(function (response) { if (response && response.data && response.data.length) { checkBanners(response.data); } })["catch"](function (err) { console.log('caught'); console.error(err); });}function createSportBanner(page, banner) { var _document$querySelect; var sBanner = (_document$querySelect = document.querySelector('#banner-under-odds')) !== null && _document$querySelect !== void 0 ? _document$querySelect : document.createElement('div'); sBanner.id = 'banner-under-odds'; if (banner.position) { sBanner.classList.remove('banner-above'); } else { sBanner.classList.add('banner-above'); } if (page === 'league-view') { var container = document.querySelector('#league-view .league-view-responsive-block'); container.parentNode.insertBefore(sBanner, container.nextSibling); } else if (page === 'league-list') { var _container = document.querySelector('#league-list .tab-switch-responsive-block'); _container.parentNode.insertBefore(sBanner, _container.nextSibling); } else if (page === 'all-leagues-per-country') { var _container2 = document.querySelector('#all-leagues-per-country .top-leagues-container'); _container2.parentNode.insertBefore(sBanner, _container2.nextSibling); } else if (page === 'racing-branch-panel') { var _container3 = document.querySelector('#racing-branch-panel .branch-docs-rblock'); _container3.parentNode.insertBefore(sBanner, _container3.nextSibling); } var img = banner.image_url || 'https://volga.prod.gmx.flipsports.net/' + banner.image.data.asset_url; sBanner.innerHTML = ""); if (banner.button_text) { sBanner.innerHTML += ""); } sBanner.setAttribute('data-params', banner.name);}function resetSportsBanners() { var banner = document.querySelector('#banner-under-odds'); if (banner) { banner.textContent = ''; }}function checkSportBanners(page, params, banners) { var found = false; var _iterator = _createForOfIteratorHelper(banners), _step; try { for (_iterator.s(); !(_step = _iterator.n()).done;) { var banner = _step.value; var tDate = new Date(); var s = banner !== null && banner !== void 0 && banner.start_date ? new Date(banner.start_date.replace(' ', 'T')) : new Date(0); var e = banner !== null && banner !== void 0 && banner.end_date ? new Date(banner.end_date.replace(' ', 'T')) : new Date('01-01-2100'); if (e !== 'Invalid Date' && s !== 'Invalid Date' && s < tDate && tDate < e && ((page === 'league-list' || page === 'all-leagues-per-country') && banner.branch_id && banner.branch_id === params[0] || page === 'racing-branch-panel' && banner.branch_id && banner.branch_id === params[1] || page === 'league-view' && banner.branch_id && banner.league_id && banner.branch_id === params[1] && banner.league_id === params[0])) { found = true; createSportBanner(page, banner); break; } } } catch (err) { _iterator.e(err); } finally { _iterator.f(); } if (!found) { resetSportsBanners(); }}function getSportBanners(page) { if (page.panel && page.panel.ID && (page.panel.ID === 'league-view' || page.panel.ID === 'league-list' || page.panel.ID === 'all-leagues-per-country' || page.panel.ID === 'racing-branch-panel')) { return agHttpRequestT('GET', 'https://volga.prod.gmx.flipsports.net/_/items/sn_banner_under_odds?fields=*,image.*').then(function (response) { console.log('sbresp', response); if (response && response.data && response.data.length) { checkSportBanners(page.panel.ID, page.params, response.data); } })["catch"](function (err) { console.log('caught'); console.error(err); }); }}function checkVip() { globalDetails.tags().then(function (tags) { if (tags.includes('VIP') || tags.includes('RBOOST')) { document.querySelector('body').classList.add('vip'); UserInfo.onLogout.vLogout = function () { document.querySelector('body').classList.remove('vip'); }; } if (tags.includes('VIPREWARDS')) { document.querySelector('body').classList.add('viprewards'); UserInfo.onLogout.vLogout = function () { document.querySelector('body').classList.remove('viprewards'); }; } });}function hideLeagues(p) { console.log('hl, ', p); var panel = p.panel.ID; window.vipLeague = { leagueId: 205437, sportId: 79, title: 'VIP Specials', href: 'vip-specials' }; var styleElem = document.head.appendChild(document.createElement("style")); styleElem.id = 'hide-league-style'; styleElem.innerHTML = "\n body:not(.vip) .vip-only,\n body:not(.vip) a[href*=\"".concat(window.vipLeague.href, "\"]{\n display:none;\n }"); if (panel === 'league-view' && window.vipLeague.leagueId === p.params[0]) { globalDetails.tags().then(function (tags) { if (!tags.includes('VIP')) { Application.goHome(); } }); } if (panel === 'all-leagues-per-country') { setTimeout(function () { hideVipMarkets(); }, 250); } if (panel === 'league-list' && window.vipLeague.sportId === p.params[0]) { var obs = new MutationObserver(hideVipMarketsCB); var watcher = document.querySelector('.page.current .tab-switch-tabs div[id*="TopLeaguesResponsiveBlock"]'); if (watcher) { obs.observe(watcher, { attributes: true }); hideVipMarkets(); } else { setTimeout(function () { var watcher = document.querySelector('.page.current .tab-switch-tabs div[id*="TopLeaguesResponsiveBlock"]'); if (watcher) { obs.observe(watcher, { attributes: true, attributeOldValue: true }); hideVipMarkets(); } }, 250); } Application.AfterNavigation.VipObsDisconnect = function (p) { if (window.vipLeague.sportId !== p.params[0]) { obs.disconnect(); } }; }}function hideVipMarketsCB(r) { console.log('market mutation', r); if (r && !r[0].target.classList.contains('tab-switch-tab-hidden')) { hideVipMarkets(); } else { setTimeout(function () { var leagueLinks = document.querySelectorAll('.rj-league-list__item-link[href*="' + window.vipLeague.href + '"]'); var _iterator = _createForOfIteratorHelper(leagueLinks), _step; try { for (_iterator.s(); !(_step = _iterator.n()).done;) { var link = _step.value; var toHide = link.closest('.rj-league-list__item-holder'); toHide === null || toHide === void 0 ? void 0 : toHide.classList.add('vip-only'); } } catch (err) { _iterator.e(err); } finally { _iterator.f(); } }, 250); }}function hideVipMarkets() { var panelTitles = document.querySelectorAll('.rj-ev-list__main-heading'); if (panelTitles.length === 0) { setTimeout(function () { hideVipMarkets(); }, 250); } var _iterator2 = _createForOfIteratorHelper(panelTitles), _step2; try { for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { var titleEl = _step2.value; if (titleEl.textContent.toLowerCase().includes(window.vipLeague.title.toLowerCase())) { var toHide = titleEl.closest('.rj-ev-list__content'); toHide === null || toHide === void 0 ? void 0 : toHide.classList.add('vip-only'); } } } catch (err) { _iterator2.e(err); } finally { _iterator2.f(); } var buttonTitles = document.querySelectorAll('.rj-league-list__item-holder'); var _iterator3 = _createForOfIteratorHelper(buttonTitles), _step3; try { for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) { var btnEl = _step3.value; if (btnEl.textContent.toLowerCase().includes(window.vipLeague.title)) { btnEl.classList.add('vip-only'); } } } catch (err) { _iterator3.e(err); } finally { _iterator3.f(); }}moveCasBundle();window.openHelpSection = openHelpSection;window.widthdrawalModal = withdrawalModal;window.agAddToBetslip = agAddToBetslip;window.openRealityCheck = openRealityCheck;Application.OpenCashierPopup = function (e, y) { e && e.preventDefault(); Application.ContinueOpeningCashierPopup(e, y);};Application.AfterNavigation.scripts = function (e) { console.debug('AfterNav', e); hideLeagues(e); initSpecials(e); getFloatingBanners(); window.sbPage = { page: e.panel.ID, sport: false, league: false }; if (e.panel.ID === 'league-list' || e.panel.ID === 'all-leagues-per-country') { window.sbPage.sport = e.params[0]; window.sbPage.league = false; getSportBanners(e); } if (e.panel.ID === 'league-view' || e.panel.ID === 'racing-branch-panel') { window.sbPage.sport = e.params[1]; window.sbPage.league = e.params[0]; getSportBanners(e); }};Application.AfterSwitchPanels.outrightQuery = function (p) { console.log('AfterSwitchPanels', p); if (p && p.ID === "league-view") { setTimeout(function () { outrightQuery(); }, 50); }};Application.AfterSwitchPanels.RegStatus = function (e) { if (e.ID && (e.ID === 'my-account-pop-up' || e.ID === 'account-verification-panel')) { checkVerification(); }};Application.AfterSwitchPanels.TimeoutAnalytics = function (e) { if (e.ID && (e.ID === 'my-account-pop-up' || e.ID === 'time-out-facility')) { timeoutAnalytics(); }};Application.AfterSwitchPanels.cashierFunction = function (e) { if (e.ID && e.ID === 'eps-transfer') { if (UserInfo && UserInfo.current) { checkEPSVerification(); } else { UserInfo.onLogin.cashierFunction = function () { checkEPSVerification(); }; } }};UserInfo.onLogin.scripts = function () { console.debug('OnLogin'); checkLastLogin(); globalDetails.tags(true).then(function () { reviewModals(); documentModals(); hideDocUpload(); checkVip(); bogRacing(); }); if (Application.getCurrent().ID.includes('casino-panel')) { checkCasinoTimegate(); }};UserInfo.onLogin.redirectOnTag = function () { var acceptedPages = ['account-notice', 'terms_and_conditions', 'help', 'contactus', 'documents-upload', 'faq', 'betting-rules', 'privacy_policy', 'responsible-gaming-info']; var tagPages = [{ tag: 'bulkrisk', page: '/help/account-notice' }, { tag: 'matchingphonenumber', page: '/help/matching-details' }, { tag: 'REVIEW_RG', page: '/help/more-info/manual' }, { tag: 'REVIEW_AML', page: '/help/more-info/manual' }, { tag: 'REVIEW_MANUAL_AMBER', page: '/help/more-info/manual' }, { tag: 'EQUIFAX_RED', page: '/help/alert/' }, { tag: 'BLK_X', page: '/help/account-notice' }]; redirectOnTag(acceptedPages, tagPages); setInterval(redirectOnTag(acceptedPages, tagPages), 180000);};UserInfo.onLogout.vLogout = function () { console.log('OnLogout'); document.querySelector('body').classList.remove('vip');};window.addEventListener('load', function () { console.debug('AfterLoad'); moveBetslipErrorMutation(); loginFix(); attachToggleFunction();});console.info('rollupscripts', 'version: ' + '0.1.7.ver', 'date: "2022-07-08T10:55:39.765Z"');