phong.dao commited on
Commit
38b12ed
·
1 Parent(s): 670a6ea
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. app.py +48 -1
  2. configs/base.yaml +2 -1
  3. ml/predictor.py +16 -0
  4. static/images/AR.png +0 -0
  5. static/images/AU.png +0 -0
  6. static/images/BE.png +0 -0
  7. static/images/BR.png +0 -0
  8. static/images/CA.png +0 -0
  9. static/images/CH.png +0 -0
  10. static/images/CM.png +0 -0
  11. static/images/CR.png +0 -0
  12. static/images/DE.png +0 -0
  13. static/images/DK.png +0 -0
  14. static/images/EC.png +0 -0
  15. static/images/ES.png +0 -0
  16. static/images/FR.png +0 -0
  17. static/images/GB.png +0 -0
  18. static/images/GH.png +0 -0
  19. static/images/HR.png +0 -0
  20. static/images/IR.png +0 -0
  21. static/images/JP.png +0 -0
  22. static/images/KR.png +0 -0
  23. static/images/MA.png +0 -0
  24. static/images/MX.png +0 -0
  25. static/images/NL.png +0 -0
  26. static/images/PL.png +0 -0
  27. static/images/PT.png +0 -0
  28. static/images/QA.png +0 -0
  29. static/images/RS.png +0 -0
  30. static/images/SA.png +0 -0
  31. static/images/SN.png +0 -0
  32. static/images/TN.png +0 -0
  33. static/images/US.png +0 -0
  34. static/images/UY.png +0 -0
  35. static/images/WA.png +0 -0
  36. templates/asset.html +0 -0
  37. templates/asset/13338772c896ca57363f55467619bf21.js +3 -0
  38. templates/asset/377c0add18dfd2afc4a117b068931453.js +0 -0
  39. templates/asset/5c0ec23f08fd76443a02ba34f049b87b.js +40 -0
  40. templates/asset/8d18ebe2ae149deda51cd43c04b53501.js +19 -0
  41. templates/asset/AR.png +0 -0
  42. templates/asset/AU.png +0 -0
  43. templates/asset/BE.png +0 -0
  44. templates/asset/BR.png +0 -0
  45. templates/asset/Bootstrap.js +0 -0
  46. templates/asset/CA.png +0 -0
  47. templates/asset/CH.png +0 -0
  48. templates/asset/CM.png +0 -0
  49. templates/asset/CR.png +0 -0
  50. templates/asset/DE.png +0 -0
app.py CHANGED
@@ -1,6 +1,12 @@
 
 
 
1
  import gradio as gr
2
  import random
3
 
 
 
 
4
  from ml.model import base_df, ml_model
5
  from ml.predictor import Predictor
6
  from ml.utils import load_pickle
@@ -13,6 +19,40 @@ def function(team1, team2):
13
  :param team2:
14
  :return:
15
  """
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  draw, winner, winner_proba = predictor.predict(team1, team2)
17
  if draw:
18
  return {
@@ -26,6 +66,12 @@ def function(team1, team2):
26
  }
27
 
28
 
 
 
 
 
 
 
29
  predictor = Predictor(base_df, ml_model)
30
  examples = random.choices([x[1:3] for x in load_pickle("data/table_match.pkl")['matches']], k=20)
31
  examples = [list(x) for x in examples]
@@ -34,7 +80,8 @@ iface = gr.Interface(fn=function,
34
  outputs="json",
35
  title="WorldCup-Prediction \n\n "
36
  "Predicting the 2022 FIFA World Cup results with Machine Learning!",
37
- examples=examples
 
38
  )
39
  iface.queue(concurrency_count=5)
40
  iface.launch()
 
1
+ import os.path
2
+ import shutil
3
+
4
  import gradio as gr
5
  import random
6
 
7
+ import requests
8
+
9
+ from configs.config import cfg
10
  from ml.model import base_df, ml_model
11
  from ml.predictor import Predictor
12
  from ml.utils import load_pickle
 
19
  :param team2:
20
  :return:
21
  """
22
+
23
+ response = requests.get(cfg.live_prediction)
24
+ if response.status_code == 200:
25
+ five_thirty_eight_predict = response.json()
26
+ for match in five_thirty_eight_predict['matches']:
27
+ if (team1 == match['team1'] and team2 == match['team2']) \
28
+ or (team1 == match['team2'] and team2 == match['team1']):
29
+ if match['status'] != 'live':
30
+ probability = {
31
+ match['team1']: match['prob1'],
32
+ match['team2']: match['prob2'],
33
+ 'draw': match['probtie'],
34
+ }
35
+ else:
36
+ probability = {
37
+ match['team1']: match['live_winprobs']['winprobs'][-1]['prob1'],
38
+ match['team2']: match['live_winprobs']['winprobs'][-1]['prob2'],
39
+ 'draw': match['live_winprobs']['winprobs'][-1]['probtie'],
40
+ }
41
+ if match['probtie'] < match['prob1'] or match['probtie'] < match['prob2']:
42
+ if match['prob1'] > match['prob2']:
43
+ winner = match['team1']
44
+ else:
45
+ winner = match['team2']
46
+ else:
47
+ return {
48
+ "result": 'Draw!',
49
+ "probability": probability
50
+ }
51
+ return {
52
+ "winner": winner,
53
+ "probability": probability
54
+ }
55
+
56
  draw, winner, winner_proba = predictor.predict(team1, team2)
57
  if draw:
58
  return {
 
66
  }
67
 
68
 
69
+ shutil.copytree("static", os.path.abspath(os.path.join(
70
+ os.path.dirname(gr.__file__), "templates/frontend/static")), dirs_exist_ok=True)
71
+ shutil.copy("templates/asset.html", os.path.abspath(os.path.join(
72
+ os.path.dirname(gr.__file__), "templates/frontend/static/asset.html")))
73
+ shutil.copytree("templates/asset", os.path.abspath(os.path.join(
74
+ os.path.dirname(gr.__file__), "templates/frontend/static/asset")), dirs_exist_ok=True)
75
  predictor = Predictor(base_df, ml_model)
76
  examples = random.choices([x[1:3] for x in load_pickle("data/table_match.pkl")['matches']], k=20)
77
  examples = [list(x) for x in examples]
 
80
  outputs="json",
81
  title="WorldCup-Prediction \n\n "
82
  "Predicting the 2022 FIFA World Cup results with Machine Learning!",
83
+ examples=examples,
84
+ article=f'<iframe style="width: 100%; height: 2000px" src=\'./static/asset.html\' ></iframe>',
85
  )
86
  iface.queue(concurrency_count=5)
87
  iface.launch()
configs/base.yaml CHANGED
@@ -5,4 +5,5 @@ data:
5
  table_matches: table_match.pkl
6
 
7
  day_get_rank: 2020-1-1 # Format: YYYY-MM-DD
8
- day_get_result: 2018-1-1
 
 
5
  table_matches: table_match.pkl
6
 
7
  day_get_rank: 2020-1-1 # Format: YYYY-MM-DD
8
+ day_get_result: 2018-1-1
9
+ live_prediction: https://projects.fivethirtyeight.com/soccer-api/international/2022/world-cup/summary.json
ml/predictor.py CHANGED
@@ -4,12 +4,28 @@ from typing import Text, Tuple
4
 
5
  import numpy as np
6
  import pandas as pd
 
7
 
8
  from configs.config import cfg
9
  from configs.constants import DATA_ROOT
10
  from ml.model import MLModel
11
  from ml.utils import load_pickle
12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
 
14
  class Predictor:
15
  """
 
4
 
5
  import numpy as np
6
  import pandas as pd
7
+ import requests
8
 
9
  from configs.config import cfg
10
  from configs.constants import DATA_ROOT
11
  from ml.model import MLModel
12
  from ml.utils import load_pickle
13
 
14
+ from datetime import tzinfo, timedelta, datetime
15
+
16
+ ZERO = timedelta(0)
17
+
18
+
19
+ class UTC(tzinfo):
20
+ def utcoffset(self, dt):
21
+ return ZERO
22
+
23
+ def tzname(self, dt):
24
+ return "UTC"
25
+
26
+ def dst(self, dt):
27
+ return ZERO
28
+
29
 
30
  class Predictor:
31
  """
static/images/AR.png ADDED
static/images/AU.png ADDED
static/images/BE.png ADDED
static/images/BR.png ADDED
static/images/CA.png ADDED
static/images/CH.png ADDED
static/images/CM.png ADDED
static/images/CR.png ADDED
static/images/DE.png ADDED
static/images/DK.png ADDED
static/images/EC.png ADDED
static/images/ES.png ADDED
static/images/FR.png ADDED
static/images/GB.png ADDED
static/images/GH.png ADDED
static/images/HR.png ADDED
static/images/IR.png ADDED
static/images/JP.png ADDED
static/images/KR.png ADDED
static/images/MA.png ADDED
static/images/MX.png ADDED
static/images/NL.png ADDED
static/images/PL.png ADDED
static/images/PT.png ADDED
static/images/QA.png ADDED
static/images/RS.png ADDED
static/images/SA.png ADDED
static/images/SN.png ADDED
static/images/TN.png ADDED
static/images/US.png ADDED
static/images/UY.png ADDED
static/images/WA.png ADDED
templates/asset.html ADDED
The diff for this file is too large to render. See raw diff
 
templates/asset/13338772c896ca57363f55467619bf21.js ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ Bootstrapper.bindDOMParsed(function(){var Bootstrapper=window["Bootstrapper"];var ensightenOptions=Bootstrapper.ensightenOptions;function trackVision(app,guestInfo,page){var waitVision=setInterval(function(){if(typeof VISION!=="undefined"){clearInterval(waitVision);appUrl="https://vision.fn-pz.com/v2/";VISION.setConfigs({app_id:"abcnews-web",app_bundle_id:app.app_id,app_suite:"wdgnewabcnwebprod",app_platform:"web",app_version:"0",url:appUrl,debugMode:window.debugMode||null});var SWID=Bootstrapper.Cookies.get("SWID");
2
+ var UNID=Bootstrapper.Cookies.get("UNID");if(SWID!=""){var loggedIn=SWID.indexOf("{")>=0;VISION.addGuestId(SWID,"swid",loggedIn,"primary")}if(UNID!="")VISION.addGuestId(UNID,"unid",false,"secondary");window.vision=new VISION;window.visionParams={event_name:"page_view",page_url:page.page_url,page_location:page.page_location,page_nav_method:page.page_nav_method,page_type:page.page_type};vision.track(visionParams)}})}if(typeof __dataLayer!=="undefined"&&typeof __dataLayer.subscribe==="function"){var app=
3
+ {app_id:__dataLayer.site.site};var guestInfo={status:__dataLayer.pzn.login_status,entitlements:__dataLayer.pzn.entitlements};var page={page_url:__dataLayer.page.page_url,page_location:__dataLayer.page.section,page_previous_url:__dataLayer.page.prev_page,page_nav_method:__dataLayer.page.nav_method,page_type:__dataLayer.page.content_type};trackVision(app,guestInfo,page)}},3596574,694810,24);
templates/asset/377c0add18dfd2afc4a117b068931453.js ADDED
The diff for this file is too large to render. See raw diff
 
templates/asset/5c0ec23f08fd76443a02ba34f049b87b.js ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Bootstrapper.bindDependencyImmediate(function(){var Bootstrapper=window["Bootstrapper"];var ensightenOptions=Bootstrapper.ensightenOptions;window.integrationSetup=function(){var cds=Bootstrapper.Cookies.get("s_ensCDS")==="1";window.consentSync=function(){localStorage.setItem("TWDC-DTCI_ENSIGHTEN_BLOCKED_URLS","");for(var temp=1;temp<11;temp++)oneTrustData.purpose.consents[temp]=oneTrustData.purpose.consents[temp]||false;oneTrustData.purpose.consents[11]=true;oneTrustData.purpose.consents[12]=true;
2
+ oneTrustData.purpose.consents[13]=oneTrustData.specialFeatureOptins[1]||false;oneTrustData.purpose.consents[14]=oneTrustData.specialFeatureOptins[2]||false;for(var vendorName in Bootstrapper.vendor_purpose_map){var curVendor=Bootstrapper.vendor_purpose_map[vendorName];for(var purposeIndex=0;purposeIndex<curVendor.purposes.length;purposeIndex++)if(oneTrustData.purpose.consents[curVendor.purposes[purposeIndex]]!==undefined&&oneTrustData.purpose.consents[curVendor.purposes[purposeIndex]]==false){curVendor.vendorConsent=
3
+ Bootstrapper.vendor_purpose_map[vendorName].vendorConsent=false;break}if(curVendor.iabID.length>0&&oneTrustData.vendor.consents[curVendor.iabID]===undefined)oneTrustData.vendor.consents[curVendor.iabID]=false;if(curVendor.vendorConsent&&curVendor.iabID.length>0&&oneTrustData.vendor.consents[curVendor.iabID]==false)curVendor.vendorConsent=Bootstrapper.vendor_purpose_map[vendorName].vendorConsent=false;if(curVendor.vendorConsent==false){Bootstrapper.Logging.logMsg("Blocking Vendor: "+vendorName);if(!cds){var ensWhiteList=
4
+ (!!window.gateway.environment.whitelist?window.gateway.environment.whitelist:ensClientConfig.whitelist)[ensClientConfig.cookieTypes[0]];for(var consentVendor in ensWhiteList)if(ensWhiteList[consentVendor].displayName.toLowerCase()===vendorName.toLowerCase()&&localStorage["TWDC-DTCI_ENSIGHTEN_BLOCKED_URLS"].indexOf(vendorName)===-1){gateway.blockTag(ensWhiteList[consentVendor]);break}}else gateway.blockTag({displayName:vendorName,tag:curVendor.validation})}else Bootstrapper.Logging.logMsg("Allowing Vendor: "+
5
+ vendorName)}if(!cds)gateway.updatePreferences();Bootstrapper.Logging.logMsg("consent sync callback complete");var ot=window.oneTrustData||{},purpose=ot.purpose||{},consents=purpose.consents||{},optins=ot.specialFeatureOptins||{},otEventStatus=ot.eventStatus;if(consents[1])if(document.referrer&&sessionStorage)sessionStorage.setItem("__previous_referrer",document.referrer);if(consents[1]&&consents[2]&&consents[3]&&consents[4]&&consents[7]&&consents[9]&&consents[10]){if(window.localStorage){if(Bootstrapper.Cookies)localStorage.setItem("_prevDcf",
6
+ Bootstrapper.Cookies.get("_dcf"));if(!localStorage.getItem("_dcf"))localStorage.setItem("_firstDcf",1);localStorage.setItem("_dcf","1")}document.cookie="_dcf\x3d1; path\x3d/;"}else{if(window.localStorage){if(Bootstrapper.Cookies)localStorage.setItem("_prevDcf",Bootstrapper.Cookies.get("_dcf"));if(!localStorage.getItem("_dcf"))localStorage.setItem("_firstDcf",1);localStorage.setItem("_dcf","0")}document.cookie="_dcf\x3d0; path\x3d/;"}if(window._otCount>=2&&otEventStatus==="useractioncomplete")setTimeout(function(){var otEvent=
7
+ new CustomEvent("ot.updated",{detail:ot});document.dispatchEvent(otEvent)},100)};window.ensOTListener=false;function oneTrustOnload(){if(!window.ensOTListener&&typeof __tcfapi==="function"){window.ensOTListener=true;__tcfapi("addEventListener",2,function(tcData,success){if(success){window._otCount++;var tcEventStatus=tcData&&tcData.eventStatus||"";if(tcEventStatus==="useractioncomplete"||tcEventStatus==="cmpuishown")if(tcData.purpose.consents["1"]!==undefined||tcData.vendor.consents["1"]!==undefined||
8
+ tcData.specialFeatureOptins["1"]!==undefined){window.oneTrustData=tcData;gateway.consentCookies.setCookie("TWDC_Vendor_Consent",1);window.consentSync()}else{if(tcEventStatus==="useractioncomplete"){gateway.consentCookies.setCookie("TWDC_Vendor_Consent",0);if(!cds)gateway.updatePreferences();if(window.localStorage){if(Bootstrapper.Cookies)localStorage.setItem("_prevDcf",Bootstrapper.Cookies.get("_dcf"));if(!localStorage.getItem("_dcf"))localStorage.setItem("_firstDcf",1);localStorage.setItem("_dcf",
9
+ "0")}document.cookie="_dcf\x3d0; path\x3d/;";document.dispatchEvent(new Event("ot.optout"))}}else if(tcData&&tcData.purpose&&tcData.purpose.consents){var consents=tcData.purpose.consents;if(consents[1]&&consents[2]&&consents[3]&&consents[4]&&consents[7]&&consents[9]&&consents[10]){document.cookie="_dcf\x3d1; path\x3d/;";localStorage&&localStorage.setItem("_dcf","1");Bootstrapper.Logging.logMsg("update: ad consent")}else{document.cookie="_dcf\x3d0; path\x3d/;";localStorage&&localStorage.setItem("_dcf",
10
+ "0");Bootstrapper.Logging.logMsg("update: ad reject")}}document.dispatchEvent(new Event("ot.ready"))}else Bootstrapper.Logging.logMsg("Error in tcfapi event listener")})}}if(OneTrust&&OneTrust.loaded)oneTrustOnload();else document.addEventListener("ot.loaded",oneTrustOnload);var needToTrackShown=true,allowAll=false,rejectAll=false,tracking={"c9":"consent choices made","events":"event200"};tracking.vid=""+(new Date).getTime()+Math.floor(Math.random()*1E3);function track(msg,reload){var queryString=
11
+ Object.keys(tracking).map(key=>{return encodeURIComponent(key)+"\x3d"+encodeURIComponent(tracking[key])}).join("\x26");var prefix="https://sinfo.dtcidev.co/b/ss/wdgespdcfespncomdev/0?",trackImg=prefix+queryString;var beacon=new Image;if(reload){beacon.onload=function(){window.location.reload()};beacon.onerror=function(){window.location.reload()}}beacon.src=trackImg}document.addEventListener("ot.updated",function(e){tracking.events="event200";var data=e&&e.detail;if(data){var consents=[{key:"c67",
12
+ data:data.purpose.consents},{key:"c68",data:data.vendor.consents},{key:"c71",data:data.specialFeatureOptins}];consents.map(function(a){var keys=Object.keys(a.data),values="",key;for(var i=0;i<keys.length;i++){key=keys[i];if(a.data[key]==true)values+=key+","}if(values!="")values=values.substring(0,values.length-1);else values="no consent given";tracking[a.key]=values;if(a.key=="c68")tracking.l3=values})}if(allowAll){tracking.c9="consent choices made";tracking.c66="opt in:all";track("TRACK: allow all consent",
13
+ true)}else{tracking.c9="consent choices made";tracking.c66="opt in:partial";track("TRACK: partial update",true)}});function trackManage(){tracking.c9="manage impression";tracking.events="event201";track("TRACK: update was shown????")}document.addEventListener("ot.ready",function(){if(needToTrackShown){var allowButton=document.getElementById("accept-recommended-btn-handler");if(allowButton)allowButton.addEventListener("click",function(){allowAll=true});var rejectButton=document.getElementById("onetrust-reject-all-handler");
14
+ if(rejectButton)rejectButton.addEventListener("click",function(){rejectAll=true});document.addEventListener("ot.optout",function(){setTimeout(function(){tracking.c9="consent choices made";tracking.events="event200";if(rejectAll)tracking.c66="opt out:reject all";else tracking.c66="opt out:all";tracking.c67="no consent given";tracking.c68="no consent given";track("track opt out of all")},100)});var acceptButton=document.getElementById("onetrust-accept-btn-handler");if(acceptButton){tracking.c9="banner impression";
15
+ tracking.events="event199";track("TRACK: overlay was shown");acceptButton.addEventListener("click",function(){allowAll=true})}var cached=OneTrust.ToggleInfoDisplay;if(cached)window.OneTrust.ToggleInfoDisplay=function(){trackManage();cached()};if(window.jQuery)jQuery("a.ot-sdk-show-settings").on("click",trackManage);needToTrackShown=false}})};window.nonIABIntegrationSetup=function(){var cds=Bootstrapper.Cookies.get("s_ensCDS")==="1",fullAccept=false,fullReject=false,partialAccept=false;var consentSync=
16
+ function(consents){localStorage.setItem("TWDC-DTCI_ENSIGHTEN_BLOCKED_URLS","");var vendorsToBlock=[],vendorsToAllow=[];var vendorPurposeMap=Bootstrapper.vendor_purpose_map||[];vendorPurposeMap.forEach(function(map){if(!consents[map["classification"]])vendorsToBlock=vendorsToBlock.concat(map["vendors"]);else vendorsToAllow=vendorsToAllow.concat(map["vendors"])});var ensWhiteList=(!!window.gateway.environment.whitelist?window.gateway.environment.whitelist:ensClientConfig.whitelist)[ensClientConfig.cookieTypes[0]],
17
+ ensObject={},preBlockList=localStorage.getItem("TWDC-DTCI_ENSIGHTEN_BLOCKED_URLS");ensWhiteList.forEach(function(wli){ensObject[wli.displayName]=wli.tag});if(vendorsToBlock.length){vendorsToBlock=vendorsToBlock.filter(function(t,index){return vendorsToBlock.indexOf(t)==index});vendorsToBlock.forEach(function(vtb){if(ensObject[vtb]&&preBlockList.indexOf(vtb)===-1){Bootstrapper.Logging.logMsg("OT NON IAB LOG: ","Blocking Vendor: ",{displayName:vtb,tag:ensObject[vtb]});gateway.blockTag({displayName:vtb,
18
+ tag:ensObject[vtb]})}})}if(vendorsToAllow.length)vendorsToAllow=vendorsToAllow.filter(function(t,index){return vendorsToAllow.indexOf(t)==index});if(!cds)gateway.updatePreferences();Bootstrapper.Logging.logMsg("OT NON IAB LOG: ","consent sync callback complete");if(document.referrer&&sessionStorage)sessionStorage.setItem("__previous_referrer",document.referrer);if(!localStorage.getItem("_dcf"))localStorage.setItem("_firstDcf",1);localStorage.setItem("_prevDcf",Bootstrapper.Cookies.get("_dcf"));if(consents["C0002"]||
19
+ consents["C0003"]||consents["C0004"]){var cGroupsToCheck=[];try{if(OneTrust&&typeof OneTrust.GetDomainData==="function"){var dData=OneTrust.GetDomainData();if(typeof dData==="object"&&dData.Groups&&Array.isArray(dData.Groups)){var gps=dData.Groups;gps.forEach(function(gp){if(gp.ShowInPopupNonIAB){var ckies=gp.Cookies,ckArr=Array.isArray(ckies),fpc=gp.FirstPartyCookies,fpcArr=Array.isArray(fpc),gvids=gp.GeneralVendorsIds,gvidsArr=Array.isArray(gvids),hsts=gp.Hosts,hstsArr=Array.isArray(hsts);if(ckArr&&
20
+ ckies.length||fpcArr&&fpc.length||gvidsArr&&gvids.length||hstsArr&&hsts.length)cGroupsToCheck.push(gp.OptanonGroupId)}})}}}catch(e){}if(cGroupsToCheck.length){var ffg=true;cGroupsToCheck.forEach(function(gp){if(!consents[gp])ffg=false});if(ffg){Bootstrapper.Logging.logMsg("OT NON IAB LOG: ","Full Consent Given");fullAccept=true}else{Bootstrapper.Logging.logMsg("OT NON IAB LOG: ","Partial Accept on Consent");partialAccept=true}}else if(consents["C0002"]&&consents["C0003"]&&consents["C0004"]){Bootstrapper.Logging.logMsg("OT NON IAB LOG: ",
21
+ "Full Consent Given");fullAccept=true}else{Bootstrapper.Logging.logMsg("OT NON IAB LOG: ","Partial Accept on Consent");partialAccept=true}localStorage.setItem("_dcf","1");document.cookie="_dcf\x3d1; path\x3d/;"}else{Bootstrapper.Logging.logMsg("OT NON IAB LOG: ","Full Reject on Consent");fullReject=true;localStorage.setItem("_dcf","0");document.cookie="_dcf\x3d0; path\x3d/;"}setTimeout(function(){Bootstrapper.Logging.logMsg("OT NON IAB LOG: ","Sending ot.updated event");var otEvent=new CustomEvent("ot.updated",
22
+ {detail:{consents:consents,status:{fullAccept:fullAccept,fullReject:fullReject,partialAccept:partialAccept},vendorsAllowed:vendorsToAllow}});document.dispatchEvent(otEvent)},100)};var vid=""+(new Date).getTime()+Math.floor(Math.random()*1E3),vlistDisplay=false,toggleVlist=function(){vlistDisplay=false},firstScreen=false;var track=function(obj,reload){obj["c75"]="no";obj["c72"]="emea";obj["vid"]=vid;var queryString=Object.keys(obj).map(key=>{return encodeURIComponent(key)+"\x3d"+encodeURIComponent(obj[key])}).join("\x26");
23
+ var prefix="https://sinfo.dtcidev.co/b/ss/wdgespdcfespncomdev/0?",trackImg=prefix+queryString;Bootstrapper.Logging.logMsg("OT NON IAB LOG: ","Tracking Img: ",trackImg);var beacon=new Image;if(reload){beacon.onload=function(){window.location.reload()};beacon.onerror=function(){window.location.reload()}}toggleVlist();beacon.src=trackImg};var getOtGroups=function(toStr){var otGroups={};if(OnetrustActiveGroups){var otFilter=OnetrustActiveGroups.split(",");otFilter=otFilter.filter(function(i){return i});
24
+ otFilter.forEach(function(g){otGroups[g]=1})}return toStr?JSON.stringify(otGroups):otGroups};var onLoadFired=false;var oneTrustOnload=function(){if(onLoadFired)return;onLoadFired=true;var bannerImpression=Bootstrapper.Cookies.get("OptanonAlertBoxClosed")=="";Bootstrapper.Logging.logMsg("OT NON IAB LOG: ","Do we have a banner impression: ",bannerImpression);if(bannerImpression){firstScreen=true;var bannerImpressionMeta={"c9":"banner impression","c74":"ot banner","events":"event199"};Bootstrapper.Logging.logMsg("OT NON IAB LOG: ",
25
+ "Tracking: Initial Banner Impression With Attributes: ",bannerImpressionMeta);track(bannerImpressionMeta)}if(OneTrust&&typeof OneTrust.OnConsentChanged==="function")OneTrust.OnConsentChanged(function(){var prevOTGroups=localStorage.getItem("_prevOTGroups");Bootstrapper.Logging.logMsg("OT NON IAB LOG: ","On OT Change, Previous OT Groups: ",prevOTGroups);var otGroups=getOtGroups(),curGroupsString=JSON.stringify(otGroups);Bootstrapper.Logging.logMsg("OT NON IAB LOG: ","On OT Change, Cur OT Groups: ",
26
+ otGroups);Bootstrapper.Logging.logMsg("OT NON IAB LOG: ","Setting previous consents as: ",otGroups);localStorage.setItem("_prevOTGroups",curGroupsString);if(prevOTGroups!=curGroupsString){Bootstrapper.Logging.logMsg("OT NON IAB LOG: ","Consent did change, set proper cookies");if(otGroups["C0002"]||otGroups["C0003"]||otGroups["C0004"])gateway.consentCookies.setCookie("TWDC_Vendor_Consent",1);else gateway.consentCookies.setCookie("TWDC_Vendor_Consent",0);if(prevOTGroups!==null)sessionStorage.setItem("s_ensNIABCChged",
27
+ 1);consentSync(otGroups)}else{Bootstrapper.Logging.logMsg("OT NON IAB LOG: ","Consent didnt change, set proper cookies");if(otGroups["C0002"]&&otGroups["C0003"]&&otGroups["C0004"]){document.cookie="_dcf\x3d1; path\x3d/;";localStorage.setItem("_dcf","1");Bootstrapper.Logging.logMsg("OT NON IAB LOG: ","update: ad consent")}else{document.cookie="_dcf\x3d0; path\x3d/;";localStorage.setItem("_dcf","0");Bootstrapper.Logging.logMsg("OT NON IAB LOG: ","update: ad reject")}}});var page=location.href,cblTest=
28
+ /www[_\.]disney[_\.]bg(-(dev\d+|qa)\.fe\.mh\.disney\.io)?\/adsales-(bulgaria|croatia|serbia|slovenia)/.test(page);if(!!cblTest&&!!window.OneTrust&&typeof window.OneTrust.changeLanguage==="function"){window.OneTrust.changeLanguage("en");if(firstScreen)var lcheck=setInterval(function(){var elemToCheck=document.querySelector("#onetrust-pc-btn-handler");if(!elemToCheck)return;var curText=elemToCheck.innerText;if(curText&&curText.toLowerCase()==="manage preferences"){document.dispatchEvent(new Event("ot.ready"));
29
+ clearInterval(lcheck)}},500);else document.dispatchEvent(new Event("ot.ready"))}else document.dispatchEvent(new Event("ot.ready"))};if(OneTrust&&OneTrust.loaded)oneTrustOnload();else document.addEventListener("ot.loaded",oneTrustOnload);document.addEventListener("ot.updated",function(e){var tracking={"c9":"consent choices made","events":"event200"};var data=e&&e.detail&&e.detail.consents,status=e&&e.detail&&e.detail.status,allowedVendors=e&&e.detail&&e.detail.vendorsAllowed;Bootstrapper.Logging.logMsg("OT NON IAB LOG: ",
30
+ "Trying to respond to ot.updated event with data: ",e);if(data){var values="",trackingKey="c67";for(var index=1;index<=4;index++){cCurConsent="C000"+index;if(data[cCurConsent])values+=cCurConsent+","}if(values!="")values=values.substring(0,values.length-1);if(values&&!status.fullReject)tracking[trackingKey]=values}if(allowedVendors&&allowedVendors.length){var vlist=allowedVendors.join(",");tracking.l3=tracking.c68=vlist}if(status.fullAccept){tracking.c66="full opt in";Bootstrapper.Logging.logMsg("OT NON IAB LOG: ",
31
+ "Tracking: Opt In All with attributes: ",tracking);track(tracking,true)}else if(status.fullReject){tracking.c66="full opt out";Bootstrapper.Logging.logMsg("OT NON IAB LOG: ","Tracking: Reject All with attributes: ",tracking);track(tracking,true)}else if(status.partialAccept){tracking.c66="partial opt in";Bootstrapper.Logging.logMsg("OT NON IAB LOG: ","Tracking: Opt In Partial with attributes: ",tracking);track(tracking,true)}});var wrapBannerAnalytics=function(){vlistDisplay=false;var bannerContainer=
32
+ document.querySelector("#onetrust-banner-sdk");if(bannerContainer){var btnsAndBase=[{"elem":"#onetrust-pc-btn-handler","evObj":{"events":"event202"},"type":"Save Settings","triggerScreen":true},{"elem":"#onetrust-reject-all-handler","evObj":{"events":"event210"},"type":"Reject All"},{"elem":"#onetrust-accept-btn-handler","evObj":{"events":"event209"},"type":"Accept All"}];btnsAndBase.forEach(function(b){var curButton=bannerContainer.querySelector(b.elem);if(curButton)curButton.addEventListener("click",
33
+ function(e){var evObj=b.evObj;evObj["c9"]="click on "+b.type+" button with text: "+e.target.innerText;evObj["c74"]="ot banner";Bootstrapper.Logging.logMsg("OT NON IAB LOG: ","Tracking: Click on Banner Button With Attributes: ",evObj);track(evObj);if(b.triggerScreen){var tsObj={"c9":"banner impression","c74":"preferences modal","events":"event203"};Bootstrapper.Logging.logMsg("OT NON IAB LOG: ","Tracking: Impression of Preferences Screen On Initial Consent Choice With Attributes: ",tsObj);track(tsObj)}})})}var prefBtns=
34
+ [{"elem":"#accept-recommended-btn-handler","evObj":{"events":"event209"},"type":"Accept All"},{"elem":".ot-pc-refuse-all-handler","evObj":{"events":"event210"},"type":"Reject All","checkScreen":true},{"elem":".save-preference-btn-handler","evObj":{"events":"event211"},"type":"Save Settings","checkScreen":true}];prefBtns.forEach(function(b){var curButton=document.querySelector(b.elem);if(curButton)curButton.addEventListener("click",function(e){var evObj=b.evObj;evObj["c9"]="click on "+b.type+" button with text: "+
35
+ e.target.innerText;evObj["c74"]="preferences modal";if(b.checkScreen)evObj["c74"]=vlistDisplay?"vendors modal":"preferences modal";Bootstrapper.Logging.logMsg("OT NON IAB LOG: ","Tracking: Click on Preferences Button With Attributes: ",evObj);track(evObj)})});var accordions=document.querySelectorAll(".ot-accordion-layout button[ot-accordion]");if(accordions.length)accordions.forEach(function(acc){acc.addEventListener("click",function(e){var elem=e.target,expanded=elem.getAttribute("aria-expanded")!=
36
+ "true";if(!expanded)return;var parent=elem.parentElement,stack=parent.getAttribute("data-optanongroupid")||"n/a",evObj={"c9":"preference stack expanded "+stack,"c74":"preferences modal","events":"event204"};Bootstrapper.Logging.logMsg("OT NON IAB LOG: ","Tracking: Expand of Consent Preferences Stack With Attributes: ",evObj);track(evObj)})});var toggles=document.querySelectorAll('input[type\x3d"checkbox"][id^\x3d"ot-group-id"][aria-checked]');if(toggles.length)toggles.forEach(function(t){t.addEventListener("click",
37
+ function(e){var elem=e.target,checked=!!elem.checked,onOff=checked?" on":" off",ev=checked?"event205":"event206",group=elem.getAttribute("data-optanongroupid")||"n/a";var evObj={"c9":group+onOff,"c74":"preferences modal","events":ev};Bootstrapper.Logging.logMsg("OT NON IAB LOG: ","Tracking: Toggle of Consent Preferences With Attributes: ",evObj);track(evObj)})});var vendorScreenClicks=document.querySelectorAll(".category-host-list-handler");if(vendorScreenClicks.length)vendorScreenClicks.forEach(function(s){s.addEventListener("click",
38
+ function(e){var elem=e.target,stack=elem.getAttribute("data-parent-id")||"not set";var evObj={"c9":"banner impression","c74":"vendors modal","events":"event208"};Bootstrapper.Logging.logMsg("OT NON IAB LOG: ","Tracking: Vendor Modal Open With Attributes: ",evObj);track(evObj);var clObj={"c9":"click on vendor button under stack "+stack,"c74":"preferences modal","events":"event212"};Bootstrapper.Logging.logMsg("OT NON IAB LOG: ","Tracking: Click on Vendor Button With Attributes: ",clObj);track(clObj);
39
+ vlistDisplay=true;var backListener=document.querySelector(".back-btn-handler");if(backListener)backListener.addEventListener("click",toggleVlist,{"once":true})})})};function trackManage(){if(!firstScreen)wrapBannerAnalytics();var tsObj={"c9":"banner impression","c74":"preferences modal","events":"event203"};Bootstrapper.Logging.logMsg("OT NON IAB LOG: ","Tracking: Impression of Preferences Screen After First Consent Choice With Attributes: ",tsObj);track(tsObj);var clObj={"c9":"manage impression",
40
+ "c74":"preferences modal","events":"event201"};Bootstrapper.Logging.logMsg("OT NON IAB LOG: ","Tracking: Click on Manage Link in Footer With Attributes: ",clObj);track(clObj)}document.addEventListener("ot.ready",function(){var cached=OneTrust.ToggleInfoDisplay;if(cached)window.OneTrust.ToggleInfoDisplay=function(){trackManage();cached()};if(firstScreen)wrapBannerAnalytics()})};document.dispatchEvent(new Event("integrationReady"))},3780073,[3790363],649567,[633864],24);
templates/asset/8d18ebe2ae149deda51cd43c04b53501.js ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Bootstrapper.bindDependencyImmediate(function(){var Bootstrapper=window["Bootstrapper"];var ensightenOptions=Bootstrapper.ensightenOptions;var trackingServer="w88.go.com",_host=window.location.hostname;function getMCID(){if(/espn|undefeated|andscape/i.test(_host)){trackingServer="w88.espn.com";return"EE0201AC512D2BE80A490D4C@AdobeOrg"}else if(/fivethirtyeight/i.test(_host))return"C7A21CFE532E6E920A490D45@AdobeOrg";return""}function get_report_suite(){if(_host.indexOf("fivethirtyeight-develop")>-1)return"wdgnewfivethirtyeightdev";
2
+ else if(/(theundefeated|andscape)-develop/.test(_host))return"wdgespundefeateddev,wdgespgedev";else if(/(theundefeated|andscape)/.test(_host))return"wdgespundefeated,wdgespge";else if(_host.indexOf("fivethirtyeight")>-1)return"wdgnewfivethirtyeight";return""}__dataLayer.adobeConfig={"visitorID_MCID":getMCID(),"visitorNamespace":"","linkInternalFilters":"javascript:,"+_host,"serverName":"","trackingServer":trackingServer,"trackingServerSecure":"s"+trackingServer,"reportSuite":get_report_suite(),"extra_link_track_vars":["site",
3
+ "swid","login_status","page_name","page_url","edition","language","edition","orientation","section1","section2","device_type","app_version","content_type","unid","mktg_campaign"]};Bootstrapper.ensEvent.trigger("adobeConfigSet");Bootstrapper.ensEvent.trigger("adobeConfigSet 10up")},3748178,[3786600,3786598,3787015,3612740,3750051],686999,[652718,652721,666974,686771,693604],24);
4
+ Bootstrapper.bindDependencyImmediate(function(){var Bootstrapper=window["Bootstrapper"];var ensightenOptions=Bootstrapper.ensightenOptions;Bootstrapper.AF.push(["push","SiteCatalyst","ns","s_omni"]);Bootstrapper.AF.push(["join","s_omni","pre",[["campaign",function(){try{return __dataLayer.page.mktg_campaign}catch(e){return""}}],["pageName",function(){try{return __dataLayer.page.page_name}catch(e){return""}}],["pageURL",function(){try{if(__dataLayer&&__dataLayer.page&&__dataLayer.page.content_type===
5
+ "404")__dataLayer.page.page_url=window.location.href;return __dataLayer.page.page_url}catch(e){return""}}],["server",function(){try{return __dataLayer.site.site}catch(e){return""}}],[["contextData","ad_blocker"],function(){try{return __dataLayer.visitor.ad_blocker}catch(e){return""}}],[["contextData","app_version"],function(){try{return __dataLayer.page.app_version}catch(e){return""}}],[["contextData","author"],function(){try{return __dataLayer.page.author}catch(e){return""}}],[["contextData","content_last_update_date"],
6
+ function(){try{return __dataLayer.page.content_last_update_date}catch(e){return""}}],[["contextData","content_last_update_time"],function(){try{return __dataLayer.page.content_last_update_time}catch(e){return""}}],[["contextData","content_publish_date"],function(){try{return __dataLayer.page.content_publish_date}catch(e){return""}}],[["contextData","content_publish_time"],function(){try{return __dataLayer.page.content_publish_time}catch(e){return""}}],[["contextData","content_type"],function(){try{return __dataLayer.page.content_type}catch(e){return""}}],
7
+ [["contextData","edition"],function(){try{return __dataLayer.site.edition}catch(e){return""}}],[["contextData","editorial_other_subjects"],function(){try{return __dataLayer.page.editorial_other_subjects}catch(e){return""}}],[["contextData","envName"],function(){try{return __dataLayer.envName}catch(e){return""}}],[["contextData","language"],function(){try{return __dataLayer.site.language}catch(e){return""}}],[["contextData","login_status"],function(){try{return __dataLayer.pzn.login_status}catch(e){return""}}],
8
+ [["contextData","mktg_campaign"],function(){try{return __dataLayer.page.mktg_campaign}catch(e){return""}}],[["contextData","orientation"],function(){try{return __dataLayer.site.orientation}catch(e){return""}}],[["contextData","page_id"],function(){try{return __dataLayer.page.page_id}catch(e){return""}}],[["contextData","page_name"],function(){try{return __dataLayer.page.page_name}catch(e){return""}}],[["contextData","page_url"],function(){try{return __dataLayer.page.page_url}catch(e){return""}}],
9
+ [["contextData","platform"],function(){try{return __dataLayer.page.platform}catch(e){return""}}],[["contextData","prev_page"],function(){try{return __dataLayer.page.prev_page}catch(e){return""}}],[["contextData","section1"],function(){try{return __dataLayer.page.section_1||__dataLayer.page.section1}catch(e){return""}}],[["contextData","section2"],function(){try{return __dataLayer.page.section_2||__dataLayer.page.section2}catch(e){return""}}],[["contextData","site"],function(){try{return __dataLayer.site.site}catch(e){return""}}],
10
+ [["contextData","story_id"],function(){try{return __dataLayer.page.story_id}catch(e){return""}}],[["contextData","story_title"],function(){try{return __dataLayer.page.story_title}catch(e){return""}}],[["contextData","swid"],function(){try{if(Bootstrapper.piNull){__dataLayer.visitor.swid="noconsent";return"noconsent"}else return __dataLayer.visitor.swid}catch(e){return""}}],[["contextData","time_of_day"],function(){try{return __dataLayer.page.time_of_day}catch(e){return""}}],[["contextData","unid"],
11
+ function(){try{if(Bootstrapper.piNull){__dataLayer.visitor.unid="noconsent";return"noconsent"}else return __dataLayer.visitor.unid}catch(e){return""}}],[["contextData","view_type"],function(){try{return __dataLayer.page.view_type}catch(e){return""}}],[["contextData","word_count"],function(){try{return __dataLayer.page.word_count}catch(e){return""}}],[["contextData","device_type"],function(){try{return __dataLayer.page.device_type||(__dataLayer.device&&__dataLayer.device.device_type?__dataLayer.device.device_type:
12
+ "")}catch(e){return""}}],[["contextData","post_available"],function(){try{return __dataLayer.page.post_available}catch(e){return""}}],[["contextData","premium"],function(){try{return __dataLayer.page.premium||"NO"}catch(e){return""}}],[["contextData","country"],function(){try{return __dataLayer.site.country}catch(e){return""}}],[["contextData","consent_string"],function(){try{return __dataLayer.privacy&&__dataLayer.privacy.consent?__dataLayer.privacy.consent:null}catch(e){return""}}],[["contextData",
13
+ "consent_mode"],function(){try{return __dataLayer.privacy&&__dataLayer.privacy.mode?__dataLayer.privacy.mode:null}catch(e){return""}}],[["contextData","search_result_count"],function(){try{return __dataLayer.page.search_result_count}catch(e){return""}}],[["contextData","template"],function(){try{return __dataLayer.page.template}catch(e){return""}}]]]);var doneonce=false;var waitForAdobe=setInterval(function(){if(!!window.s_omni)if(!doneonce){doneonce=true;clearInterval(waitForAdobe);setTimeout(function(){Bootstrapper.AF.push(["call",
14
+ "s_omni","exec"])},500)}},1E3)},3750051,[3786598],693604,[652721],24);
15
+ Bootstrapper.bindDependencyImmediate(function(){var Bootstrapper=window["Bootstrapper"];var ensightenOptions=Bootstrapper.ensightenOptions;var _dl=__dataLayer,site=_dl.site||{},siteSite=site.site||"",page=_dl.page||{},pageName=page.page_name||"",storyTitle=page.story_title||"",realHost=window.location.hostname||"",realPath=window.location.pathname||"",pageSection=page.section_1||realPath.split("/")[1]||"",configId,nielsenMetadata;switch(true){case /fivethirtyeight/i.test(siteSite):configId=nielsenConfig.fivethirtyeight.static;
16
+ break;case /andscape/i.test(siteSite):configId=nielsenConfig.andscape.static;break;case /(the)?undefeated/i.test(siteSite):configId=nielsenConfig.theundefeated.static;break;default:configId=null;break}nielsenMetadata={type:"static",assetid:storyTitle||pageName||realPath,section:pageSection||pageName||realPath};for(var key in nielsenMetadata){var val=nielsenMetadata[key];if(typeof val==="string")nielsenMetadata[key]=val.replace(/\s+/ig,"-").replace(/[^a-z-]/ig,"")}configId&&Bootstrapper.initNielsen(configId,
17
+ nielsenMetadata)},3669E3,[3786595,3612740],694696,[645962,686771],24);
18
+ Bootstrapper.bindDependencyImmediate(function(){var Bootstrapper=window["Bootstrapper"];var ensightenOptions=Bootstrapper.ensightenOptions;function getUid(site){return site==="fivethirtyeight"?12240:site==="andscape"||site==="theundefeated"?22222:0}var _dl=__dataLayer,_cb=_dl.chartBeatConfig||{},site=_dl.site,page=_dl.page,defaultConfig={"uid":getUid(site.site||""),"domain":location.hostname,"path":location.pathname,"title":document.title.replace(/The Undefeated \u2014 |FiveThirtyEight \| /,"").trim(),
19
+ "sections":page.section1||page.section_1||"","authors":page.author||"","useCanonical":true,"useCanonicalDomain":true,"flickerControl":false,"autoDetect":false,"mabSections":["home"]};_cb=Object.assign(defaultConfig,_cb);Bootstrapper.initChartbeat(_cb)},3668990,[3786622],694956,[693526],24);Bootstrapper.bindImmediate(function(){var Bootstrapper=window["Bootstrapper"];var ensightenOptions=Bootstrapper.ensightenOptions},3612740,686771,24);
templates/asset/AR.png ADDED
templates/asset/AU.png ADDED
templates/asset/BE.png ADDED
templates/asset/BR.png ADDED
templates/asset/Bootstrap.js ADDED
The diff for this file is too large to render. See raw diff
 
templates/asset/CA.png ADDED
templates/asset/CH.png ADDED
templates/asset/CM.png ADDED
templates/asset/CR.png ADDED
templates/asset/DE.png ADDED