var app;(function(){var n=new Date;setInterval(function(){var t=new Date-n,i;if(t>5e3)try{i=new CustomEvent("sleepDetected",{Delay:t});document.dispatchEvent(i)}catch(r){}n=new Date},750)})();!function(n){"use strict";function a(n,t,i){"addEventListener"in window?n.addEventListener(t,i,!1):"attachEvent"in window&&n.attachEvent("on"+t,i)}function dt(n,t,i){"removeEventListener"in window?n.removeEventListener(t,i,!1):"detachEvent"in window&&n.detachEvent("on"+t,i)}function gt(n){return n.charAt(0).toUpperCase()+n.slice(1)}function er(n){var i,r,f,t=null,u=0,e=function(){u=rt();t=null;f=n.apply(i,r);t||(i=r=null)};return function(){var s=rt(),o;return u||(u=s),o=w-(s-u),i=this,r=arguments,0>=o||o>w?(t&&(clearTimeout(t),t=null),u=s,f=n.apply(i,r),t||(i=r=null)):t||(t=setTimeout(e,o)),f}}function ni(n){return nt+"["+tt+"] "+n}function t(n){lt&&"object"==typeof console&&console.log(ni(n))}function o(n){"object"==typeof console&&console.warn(ni(n))}function or(){sr();t("Initialising iFrame ("+location.href+")");hr();lr();ut("background",pi);ut("padding",wi);br();ri();ui();ar();dr();fi();y=kr();h("init","Init message from host page");pt()}function sr(){function i(n){return"true"===n?!0:!1}var t=di.substr(nr).split(":");tt=t[0];ot=n!==t[1]?Number(t[1]):ot;g=n!==t[2]?i(t[2]):g;lt=n!==t[3]?i(t[3]):lt;c=n!==t[4]?Number(t[4]):c;e=n!==t[6]?i(t[6]):e;d=t[7];r=n!==t[8]?t[8]:r;pi=t[9];wi=t[10];vt=n!==t[11]?Number(t[11]):vt;y.enable=n!==t[12]?i(t[12]):!1;at=n!==t[13]?t[13]:at;u=n!==t[14]?t[14]:u}function hr(){function i(){var n=window.iFrameResizer;t("Reading data from page: "+JSON.stringify(n));yt="messageCallback"in n?n.messageCallback:yt;pt="readyCallback"in n?n.readyCallback:pt;p="targetOrigin"in n?n.targetOrigin:p;r="heightCalculationMethod"in n?n.heightCalculationMethod:r;u="widthCalculationMethod"in n?n.widthCalculationMethod:u}function n(n,i){return"function"==typeof n&&(t("Setup custom "+i+"CalcMethod"),bt[i]=n,n="custom"),n}"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&(i(),r=n(r,"height"),u=n(u,"width"));t("TargetOrigin for parent set to: "+p)}function cr(n,t){return-1!==t.indexOf("-")&&(o("Negative CSS value ignored for "+n),t=""),t}function ut(i,r){n!==r&&""!==r&&"null"!==r&&(document.body.style[i]=r,t("Body "+i+' set to "'+r+'"'))}function lr(){n===d&&(d=ot+"px");ut("margin",cr("margin",d))}function ar(){document.documentElement.style.height="";document.body.style.height="";t('HTML & body height set to "auto"')}function i(n){var i={add:function(t){function i(){h(n.eventName,n.eventType)}kt[t]=i;a(window,t,i)},remove:function(n){var t=kt[n];delete kt[n];dt(window,n,t)}};n.eventNames&&Array.prototype.map?(n.eventName=n.eventNames[0],n.eventNames.map(i[n.method])):i[n.method](n.eventName);t(gt(n.method)+" event listener: "+n.eventType)}function ti(n){i({method:n,eventType:"Animation Start",eventNames:["animationstart","webkitAnimationStart"]});i({method:n,eventType:"Animation Iteration",eventNames:["animationiteration","webkitAnimationIteration"]});i({method:n,eventType:"Animation End",eventNames:["animationend","webkitAnimationEnd"]});i({method:n,eventType:"Input",eventName:"input"});i({method:n,eventType:"Mouse Up",eventName:"mouseup"});i({method:n,eventType:"Mouse Down",eventName:"mousedown"});i({method:n,eventType:"Orientation Change",eventName:"orientationchange"});i({method:n,eventType:"Print",eventName:["afterprint","beforeprint"]});i({method:n,eventType:"Ready State Change",eventName:"readystatechange"});i({method:n,eventType:"Touch Start",eventName:"touchstart"});i({method:n,eventType:"Touch End",eventName:"touchend"});i({method:n,eventType:"Touch Cancel",eventName:"touchcancel"});i({method:n,eventType:"Transition Start",eventNames:["transitionstart","webkitTransitionStart","MSTransitionStart","oTransitionStart","otransitionstart"]});i({method:n,eventType:"Transition Iteration",eventNames:["transitioniteration","webkitTransitionIteration","MSTransitionIteration","oTransitionIteration","otransitioniteration"]});i({method:n,eventType:"Transition End",eventNames:["transitionend","webkitTransitionEnd","MSTransitionEnd","oTransitionEnd","otransitionend"]});"child"===at&&i({method:n,eventType:"IFrame Resized",eventName:"resize"})}function ii(n,i,r,u){return i!==n&&(n in r||(o(n+" is not a valid option for "+u+"CalculationMethod."),n=i),t(u+' calculation method set to "'+n+'"')),n}function ri(){r=ii(r,ct,s,"height")}function ui(){u=ii(u,fr,l,"width")}function fi(){!0===e?(ti("add"),nu()):t("Auto Resize disabled")}function vr(){t("Disable outgoing messages");ir=!1}function yr(){t("Remove event listener: Message");dt(window,"message",vi)}function pr(){null!==st&&st.disconnect()}function ei(){ti("remove");pr();clearInterval(gi)}function wr(){vr();yr();!0===e&&ei()}function br(){var n=document.createElement("div");n.style.clear="both";n.style.display="block";document.body.appendChild(n)}function kr(){function u(){return{x:window.pageXOffset!==n?window.pageXOffset:document.documentElement.scrollLeft,y:window.pageYOffset!==n?window.pageYOffset:document.documentElement.scrollTop}}function e(n){var t=n.getBoundingClientRect(),i=u();return{x:parseInt(t.left,10)+parseInt(i.x,10),y:parseInt(t.top,10)+parseInt(i.y,10)}}function i(i){function s(n){var i=e(n);t("Moving to in page link (#"+r+") at x: "+i.x+" y: "+i.y);f(i.y,i.x,"scrollToOffset")}var r=i.split("#")[1]||i,u=decodeURIComponent(r),o=document.getElementById(u)||document.getElementsByName(u)[0];n!==o?s(o):(t("In page link (#"+r+") not found in iFrame, so sending to parent"),f(0,0,"inPageLink","#"+r))}function r(){""!==location.hash&&"#"!==location.hash&&i(location.href)}function s(){function n(n){function t(n){n.preventDefault();i(this.getAttribute("href"))}"#"!==n.getAttribute("href")&&a(n,"click",t)}Array.prototype.forEach.call(document.querySelectorAll('a[href^="#"]'),n)}function h(){a(window,"hashchange",r)}function c(){setTimeout(r,ht)}function l(){Array.prototype.forEach&&document.querySelectorAll?(t("Setting up location.hash handlers"),s(),h(),c()):o("In page linking not fully supported in this browser! (See README.md for IE8 workaround)")}return y.enable?l():t("In page linking not enabled"),{findTarget:i}}function dr(){t("Enable public methods");fu.parentIFrame={autoResize:function(n){return!0===n&&!1===e?(e=!0,fi()):!1===n&&!0===e&&(e=!1,ei()),e},close:function(){f(0,0,"close");wr()},getId:function(){return tt},getPageInfo:function(n){"function"==typeof n?(wt=n,f(0,0,"pageInfo")):(wt=function(){},f(0,0,"pageInfoStop"))},moveToAnchor:function(n){y.findTarget(n)},reset:function(){ai("parentIFrame.reset")},scrollTo:function(n,t){f(t,n,"scrollTo")},scrollToOffset:function(n,t){f(t,n,"scrollToOffset")},sendMessage:function(n,t){f(0,0,"message",JSON.stringify(n),t)},setHeightCalculationMethod:function(n){r=n;ri()},setWidthCalculationMethod:function(n){u=n;ui()},setTargetOrigin:function(n){t("Set targetOrigin: "+n);p=n},size:function(n,t){var i=""+(n?n:"")+(t?","+t:"");h("size","parentIFrame.size("+i+")",n,t)}}}function oi(){0!==c&&(t("setInterval: "+c+"ms"),gi=setInterval(function(){h("interval","setInterval: "+c)},Math.abs(c)))}function gr(){function s(n){function i(n){!1===n.complete&&(t("Attach listeners to "+n.src),n.addEventListener("load",e,!1),n.addEventListener("error",o,!1),r.push(n))}"attributes"===n.type&&"src"===n.attributeName?i(n.target):"childList"===n.type&&Array.prototype.forEach.call(n.target.querySelectorAll("img"),i)}function c(n){r.splice(r.indexOf(n),1)}function u(n){t("Remove listeners from "+n.src);n.removeEventListener("load",e,!1);n.removeEventListener("error",o,!1);c(n)}function f(t,i,r){u(t.target);h(i,r+": "+t.target.src,n,n)}function e(n){f(n,"imageLoad","Image loaded")}function o(n){f(n,"imageLoadFailed","Image load failed")}function l(n){h("mutationObserver","mutationObserver: "+n[0].target+" "+n[0].type);n.forEach(s)}function a(){var n=document.querySelector("body");return i=new v(l),t("Create body MutationObserver"),i.observe(n,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}),i}var r=[],v=window.MutationObserver||window.WebKitMutationObserver,i=a();return{disconnect:function(){"disconnect"in i&&(t("Disconnect body MutationObserver"),i.disconnect(),r.forEach(u))}}}function nu(){var n=0>c;window.MutationObserver||window.WebKitMutationObserver?n?oi():st=gr():(t("MutationObserver not supported in this browser!"),oi())}function ft(n,t){function r(n){var i,r;return/^\d+(px)?$/i.test(n)?parseInt(n,yi):(i=t.style.left,r=t.runtimeStyle.left,t.runtimeStyle.left=t.currentStyle.left,t.style.left=n||0,n=t.style.pixelLeft,t.style.left=i,t.runtimeStyle.left=r,n)}var i=0;return t=t||document.body,"defaultView"in document&&"getComputedStyle"in document.defaultView?(i=document.defaultView.getComputedStyle(t,null),i=null!==i?i[n]:0):i=r(t.currentStyle[n]),parseInt(i,yi)}function tu(n){n>w/2&&(w=2*n,t("Event throttle increased to "+w+"ms"))}function et(n,i){for(var o=i.length,f=0,e=0,s=gt(n),r=rt(),u=0;o>u;u++)f=i[u].getBoundingClientRect()[n]+ft("margin"+s,i[u]),f>e&&(e=f);return r=rt()-r,t("Parsed "+o+" HTML elements"),t("Element position calculated in "+r+"ms"),tu(r),e}function k(n){return[n.bodyOffset(),n.bodyScroll(),n.documentElementOffset(),n.documentElementScroll()]}function si(n,t){function r(){return o("No tagged elements ("+t+") found on page"),document.querySelectorAll("body *")}var i=document.querySelectorAll("["+t+"]");return 0===i.length&&r(),et(n,i)}function hi(){return document.querySelectorAll("body *")}function iu(i,e,o,h){function y(){v=c;b=a;f(v,b,i)}function p(){function t(n,t){var i=Math.abs(n-t)<=vt;return!i}return c=n!==o?o:s[r](),a=n!==h?h:l[u](),t(v,c)||g&&t(b,a)}function w(){return!(i in{init:1,interval:1,size:1})}function k(){return r in tr||g&&u in tr}function d(){t("No change in size detected")}function nt(){w()&&k()?ai(e):i in{interval:1}||d()}var c,a;p()||"init"===i?(ci(),y()):nt()}function h(n,i,r,u){function f(){n in{reset:1,resetPage:1,init:1}||t("Trigger event: "+i)}function e(){return it&&n in uu}e()?t("Trigger event cancelled: "+n):(f(),eu(n,i,r,u))}function ci(){it||(it=!0,t("Trigger event lock on"));clearTimeout(ur);ur=setTimeout(function(){it=!1;t("Trigger event lock off");t("--")},ht)}function li(n){v=s[r]();b=l[u]();f(v,b,n)}function ai(n){var i=r;r=ct;t("Reset trigger event: "+n);ci();li("reset");r=i}function f(i,r,u,f,e){function o(){n===e?e=p:t("Message targetOrigin: "+e)}function s(){var s=i+":"+r,o=tt+":"+s+":"+u+(n!==f?":"+f:"");t("Sending message to host page ("+o+")");rr.postMessage(nt+o,e)}!0===ir&&(o(),s())}function vi(n){function e(){return nt===(""+n.data).substr(0,nr)}function u(){return n.data.split("]")[1].split(":")[0]}function r(){return n.data.substr(n.data.indexOf(":")+1)}function s(){return!("undefined"!=typeof module&&module.exports)&&"iFrameResize"in window}function f(){return n.data.split(":")[2]in{"true":1,"false":1}}function c(){var t=u();t in i?i[t]():s()||f()||o("Unexpected message ("+n.data+")")}function l(){!1===bi?c():f()?i.init():t('Ignored message of type "'+u()+'". Received before initialization.')}var i={init:function(){function r(){di=n.data;rr=n.source;or();bi=!1;setTimeout(function(){ki=!1},ht)}document.body?r():(t("Waiting for page ready"),a(window,"readystatechange",i.initFromParent))},reset:function(){ki?t("Page reset ignored by init"):(t("Page size reset by host page"),li("resetPage"))},resize:function(){h("resizeParent","Parent window requested size check")},moveToAnchor:function(){y.findTarget(r())},inPageLink:function(){this.moveToAnchor()},pageInfo:function(){var n=r();t("PageInfoFromParent called from parent: "+n);wt(JSON.parse(n));t(" --")},message:function(){var n=r();t("MessageCallback called from parent: "+n);yt(JSON.parse(n));t(" --")}};e()&&l()}function ru(){"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}if("undefined"!=typeof window){var e=!0,yi=10,pi="",ot=0,d="",st=null,wi="",g=!1,uu={resize:1,click:1},ht=128,bi=!0,v=1,ct="bodyOffset",r=ct,ki=!0,di="",y={},c=32,gi=null,lt=!1,nt="[iFrameSizer]",nr=nt.length,tt="",tr={max:1,min:1,bodyScroll:1,documentElementScroll:1},at="child",ir=!0,rr=window.parent,p="*",vt=0,it=!1,ur=null,w=16,b=1,fr="scroll",u=fr,fu=window,yt=function(){o("MessageCallback function not defined")},pt=function(){},wt=function(){},bt={height:function(){return o("Custom height calculation function not defined"),document.documentElement.offsetHeight},width:function(){return o("Custom width calculation function not defined"),document.body.scrollWidth}},kt={},rt=Date.now||function(){return(new Date).getTime()},s={bodyOffset:function(){return document.body.offsetHeight+ft("marginTop")+ft("marginBottom")},offset:function(){return s.bodyOffset()},bodyScroll:function(){return document.body.scrollHeight},custom:function(){return bt.height()},documentElementOffset:function(){return document.documentElement.offsetHeight},documentElementScroll:function(){return document.documentElement.scrollHeight},max:function(){return Math.max.apply(null,k(s))},min:function(){return Math.min.apply(null,k(s))},grow:function(){return s.max()},lowestElement:function(){return Math.max(s.bodyOffset(),et("bottom",hi()))},taggedElement:function(){return si("bottom","data-iframe-height")}},l={bodyScroll:function(){return document.body.scrollWidth},bodyOffset:function(){return document.body.offsetWidth},custom:function(){return bt.width()},documentElementScroll:function(){return document.documentElement.scrollWidth},documentElementOffset:function(){return document.documentElement.offsetWidth},scroll:function(){return Math.max(l.bodyScroll(),l.documentElementScroll())},max:function(){return Math.max.apply(null,k(l))},min:function(){return Math.min.apply(null,k(l))},rightMostElement:function(){return et("right",hi())},taggedElement:function(){return si("right","data-iframe-width")}},eu=er(iu);a(window,"message",vi);ru()}}(),function(n){var i=function(){function t(t,i,r,u,f){t.useApplyAsync(!0);var e=n.Constants.Default.apiRoot;i.state("main",{templateUrl:e+"site/main/main.html"}).state("main.match",{templateUrl:e+"site/match/match.html"}).state("main.ranking",{templateUrl:e+"site/ranking/ranking.html"}).state("main.statistics",{templateUrl:e+"site/statistics/statistics.html"}).state("main.topScorer",{templateUrl:e+"site/topScorer/topScorer.html"});u.preferredLanguage("nl").useMissingTranslationHandlerLog().useStaticFilesLoader({prefix:e+"site/translations/locale-",suffix:".json"});u.useSanitizeValueStrategy(null);f.html5Mode({enabled:!0,rewriteLinks:!1,requireBase:!1})}return t}(),t;i.$inject=["$httpProvider","$stateProvider","$qProvider","$translateProvider","$locationProvider"];t=angular.module("liveWidgetApp",["ui.router","pascalprecht.translate","slickCarousel","matchMedia","timer","heatmap"]);t.config(i);t.run(["$state","$location","settingService","sleepModeDetectionService","$translate",function(n,t,i,r,u){var f,e,o;n.transitionTo("main.match");r.Start();f=t.search().language;f!=undefined&&u.use(f);e=t.search().competitionEdition;e!=undefined&&(o=e.split("-"),i.setCompetitions(o))}])}(app||(app={})),function(n){var t=function(){function n(){}return Object.defineProperty(n,"Default",{get:function(){return{apiRoot:""}},enumerable:!0,configurable:!0}),n}();n.Constants=t}(app||(app={})),function(n){var t=function(){function n(n,t,i,r,u){var f=this;this.$scope=n;this.screenSize=t;this.imageService=i;this.settingService=r;this.dataService=u;this.isMobile=t.is("xs, sm");t.on("xs, sm",function(n){f.isMobile=n})}return n}();t.initializer=function(){return{controller:t,controllerAs:"ctrl",scope:{competition:"="},templateUrl:n.Constants.Default.apiRoot+"site/directives/competitionlogo.html",bindToController:!0}};t.$inject=["$scope","screenSize","imageService","settingService","dataService"];n.competitionLogoDirective=t;angular.module("liveWidgetApp").directive("competitionlogo",t.initializer)}(app||(app={})),function(n){var t=function(){function n(n,t){this.$scope=n;this.imageService=t}return n}();t.initializer=function(){return{controller:t,controllerAs:"ctrl",scope:{data:"="},templateUrl:n.Constants.Default.apiRoot+"site/directives/events.html",bindToController:!0}};t.$inject=["$scope","imageService"];n.eventsDirectiveController=t;angular.module("liveWidgetApp").filter("reverse",function(){return function(n){return n.slice().reverse()}});angular.module("liveWidgetApp").directive("events",t.initializer)}(app||(app={})),function(n){var t=function(){function n(n,t,i){var r=this;this.$scope=n;this.imageService=t;this.screenSize=i;this.isFieldEvents=function(n){return n=="GOAL"||n=="OWNGOAL"||n=="YELLOWCARD"||n=="REDCARD"||n=="YELLOWREDCARD"?!0:!1};this.range=function(){var t=[],i=0,n;for(this.homeLineUp!=null&&this.awayLineUp!=null&&(i=this.homeLineUp.length>=this.awayLineUp.length?this.homeLineUp.length:this.awayLineUp.length),n=0;n<i;n++)t.push(n);return t};this.generateField=function(n,t){var i;$(".soccer-player").remove();this.soccerfieldElem=$("#"+n);var o=t.homeTeam.formation,s=t.awayTeam.formation,h="1-"+o,c="1-"+s,r=h.split("-"),u=c.split("-").reverse(),l=100/r.length,a=100/u.length,f=this.soccerfieldElem.find(".team1-holder"),e=this.soccerfieldElem.find(".team2-holder");f.empty();e.empty();i=1;r.forEach(function(n){for(var r,u=$("<div>",{"class":"team-player-row",style:"height:"+l+"%"}),e=0;e<parseInt(n);e++)r=t.homeTeam.startingLineUp[i],u.append("<div class='soccerfield-player-t1' style='float:right; width: "+100/parseInt(n)+"%'><div class='shirt-1'><span class='shirtnumberHolder'> <span class='soccer-player' title='"+r.label+"'>"+r.shirtNumber+"<\/span><\/span><\/div><\/div>"),i++;f.append(u)});i--;u.forEach(function(n){for(var r,u=$("<div>",{"class":"team-player-row",style:"height:"+a+"%"}),f=0;f<parseInt(n);f++)r=t.awayTeam.startingLineUp[i],u.append("<div class='soccerfield-player-t2' style='float:right; width: "+100/parseInt(n)+"%'><div class='shirt-2' ><span class='shirtnumberHolder'> <span class='soccer-player' title='"+r.label+"'>"+r.shirtNumber+"<\/span><\/span><\/div><\/div>"),i--;e.append(u)});$(".soccer-player").uitooltip()};n.ctrl.isMobile=i.is("xs, sm");i.on("xs, sm",function(t){n.ctrl.isMobile=t});this.watcher=n.$watchGroup(["ctrl.data","ctrl.fieldevents"],function(t){var r=[],u=[],i;if(t[0]!=null&&(n.ctrl.generateField(n.ctrl.id,t[0]),t[1]!=null)){for(i in t[0].homeTeam.startingLineUp)t[0].homeTeam.startingLineUp[i].benchPlayer=!1,t[0].homeTeam.startingLineUp[i].events=[],r.push(t[0].homeTeam.startingLineUp[i]);t[0].homeTeam.benchPlayers.forEach(function(n){n.benchPlayer=!0;n.events=[];r.push(n)});for(i in t[0].awayTeam.startingLineUp)t[0].awayTeam.startingLineUp[i].benchPlayer=!1,t[0].awayTeam.startingLineUp[i].events=[],u.push(t[0].awayTeam.startingLineUp[i]);t[0].awayTeam.benchPlayers.forEach(function(n){n.benchPlayer=!0;n.events=[];u.push(n)});t[1].forEach(function(n){var t,i;if(n.eventType=="GOAL"||n.eventType=="YELLOWCARD"||n.eventType=="OWNGOAL"||n.eventType=="REDCARD"||n.eventType=="YELLOWCARDSECOND"||n.eventType=="YELLOWCARDSECOND")t=$.grep(r,function(t){return t.id==n.person1.id}),i=$.grep(u,function(t){return t.id==n.person1.id}),t.length==1?t[0].events.push([n.eventType,n.matchTime]):i.length==1&&i[0].events.push([n.eventType,n.matchTime]);else if(n.eventType=="SUBIN"){var f=$.grep(r,function(t){return t.id==n.person1.id}),e=$.grep(u,function(t){return t.id==n.person1.id}),o=$.grep(r,function(t){return t.id==n.person2.id}),s=$.grep(u,function(t){return t.id==n.person2.id});f.length==1&&f[0].events.push([n.eventType,n.matchTime]);e.length==1&&e[0].events.push([n.eventType,n.matchTime]);o.length==1&&o[0].events.push([n.eventType2,n.matchTime]);s.length==1&&s[0].events.push([n.eventType2,n.matchTime])}});n.ctrl.homeLineUp=r;n.ctrl.awayLineUp=u}});n.$on("$destroy",function(){try{$(".soccer-player").remove()}catch(n){}r.watcher&&r.watcher()})}return n}();t.$inject=["$scope","imageService","screenSize"];t.initializer=function(){return{controller:t,controllerAs:"ctrl",scope:{id:"@",data:"=",fieldevents:"=",hometeam:"=",awayteam:"="},templateUrl:n.Constants.Default.apiRoot+"site/directives/field.html",bindToController:!0}};n.fieldDirectiveController=t;angular.module("liveWidgetApp").directive("field",t.initializer)}(app||(app={})),function(n){var t=function(){function n(n,t,i,r){var u=this;this.$scope=n;this.imageService=t;this.settingService=i;this.screenSize=r;this.selectedMapIndex=0;this.selectMap=function(n){u.selectedMapIndex=u.selectedMapIndex==n?0:n;u.heatmapData&&(u.selectedHeatmap=u.heatmapData[u.selectedMapIndex])};this.getStat=function(n,t){if(u.data==null)return"";var i=u.data.stats.filter(function(i){return i.entity.id==t&&i.type==n});return i.length==1?i[0].value.toString():"-"};this.getIconFromEventType=function(n){return n};this.firstLetter=function(n){return n.length>=1?n.charAt(0):""};this.changematch=function(n){u.settingService.setCurrentMatchId(n)};this.getSelectionEditionLogo=function(n){return u.imageService.getSelectionEditionLogo(n)};this.showGoal=function(n){return n=="GOAL"||n=="GOAL_PENALTY"?!0:!1};this.dateTimeNowString=function(){return(new Date).toISOString()};n.ctrl.slickEnabled=!1;this.watcher=n.$watch("ctrl.heatmapData",function(t){n.ctrl.selectedMapIndex=0;t&&(n.ctrl.selectedHeatmap=t[n.ctrl.selectedMapIndex])},!0);n.ctrl.isMobile=r.is("xs, sm");r.on("xs, sm",function(t){n.ctrl.isMobile=t});n.$on("$destroy",function(){u.watcher&&u.watcher()})}return n}();t.initializer=function(){return{controller:t,controllerAs:"ctrl",scope:{id:"@",data:"=",heatmapData:"="},templateUrl:n.Constants.Default.apiRoot+"site/directives/generalinfo2.html",bindToController:!0}};t.$inject=["$scope","imageService","settingService","screenSize"];n.generalInfoDirectiveController=t;angular.module("liveWidgetApp").directive("generalinfo",t.initializer)}(app||(app={})),function(n){var t=function(){function n(n,t,i){var r=this;this.$scope=n;this.imageService=t;this.$translate=i;n.ctrl.initialized=!1;this.watcher=n.$watch("ctrl.data",function(t){t!="undefined"&&t!=null&&t!=undefined&&n.ctrl.generateGraph(n.ctrl.id,n.ctrl.phase,t,n.ctrl.initialized)});n.$on("$destroy",function(){r.chart&&(r.chart.destroy(),r.chart=null);r.graphData=null;r.watcher&&r.watcher()})}return n.prototype.generateGraph=function(n,t,i,r){var f=this,u=50,e;this.graphData={homeTeam:[],awayTeam:[]};e=parseInt(t);t=="1"&&i.grades.homeTeamGradesPhase1!=null?this.graphData={homeTeam:i.grades.homeTeamGradesPhase1,awayTeam:i.grades.awayTeamGradesPhase1}:t=="2"&&i.grades.homeTeamGradesPhase2!=null?this.graphData={homeTeam:i.grades.homeTeamGradesPhase2,awayTeam:i.grades.awayTeamGradesPhase2}:t=="3"&&i.grades.homeTeamGradesPhase3!=null?(this.graphData={homeTeam:i.grades.homeTeamGradesPhase3,awayTeam:i.grades.awayTeamGradesPhase3},u=17):t=="4"&&i.grades.homeTeamGradesPhase4!=null&&(this.graphData={homeTeam:i.grades.homeTeamGradesPhase4,awayTeam:i.grades.awayTeamGradesPhase4},u=17);this.chart!=null&&this.chart.destroy();this.chart=c3.generate({bindto:"#"+n,data:{json:this.graphData,labels:{format:function(){return""}},names:{homeTeam:i.matchInfo.homeTeam.label,awayTeam:i.matchInfo.awayTeam.label}},padding:{top:0,right:10,bottom:0,left:20},axis:{x:{min:0,max:u,tick:{culling:{max:10}}},y:{max:10,min:0,"default":[0,10],padding:{top:0,bottom:0}}},tooltip:{show:!1},point:{show:!1},interaction:{enabled:!1},transition:{duration:0},grid:{y:{show:!0}},legend:{show:!0,item:{onclick:function(){return null},onmouseover:function(){return null},onmouseout:function(){return null}}},onresized:function(){var t=$("#"+n).parent().width();$("#"+n+" > svg").attr("width",t)},onrendered:function(){if(!r){var t=d3.select("#"+n).select(".c3-chart").append("g").attr("class","c3-labels"),u=f.imageService,o=f.$translate;jQuery.each(i.events,function(r,f){var c,v;if(f.phase!=e)return!0;var l=-1,s="",a="",h=null;if(f.selectionEdition.id==i.matchInfo.awayTeam.id?(l=f.selectionEdition.id,s="awayTeam"):(l=f.selectionEdition.id,s="homeTeam"),l>=0){for(h=d3.select("#"+n).select(".c3-texts-"+s).select(".c3-text-"+f.minute),c=f.minute;h[0][0]==null&&c>0;)c=c-1,h=d3.select("#"+n).select(".c3-texts-"+s).select(".c3-text-"+c);a=u.getIcon(f.eventType);v=t.append("image").attr("x",parseFloat(h.attr("x"))-10).attr("y",parseFloat(h.attr("y"))-5).attr("xlink:href",a).attr("title",f.person1.label+" "+o.instant(f.eventType)).attr("class","graphEvent c3-label-icon c3-label-"+f.eventType+"").attr("minute",f.minute).attr("homeoraway",s).attr("width","20px").attr("height","20px").attr("style","cursor:pointer")}});$(".c3-label-icon").uitooltip({show:!1,hide:!1});$(".c3-label-icon");r=!0}d3.select("#"+n).selectAll(".graphEvent").each(function(){var t=d3.select("#"+n).select(".c3-texts-"+d3.select(this).attr("homeoraway")).select(".c3-text-"+d3.select(this).attr("minute"));t[0][0]!=null&&d3.select(this).attr("x",parseFloat(t.attr("x"))-10).attr("y",parseFloat(t.attr("y"))-5)})}})},n}();t.$inject=["$scope","imageService","$translate"];t.initializer=function(){return{controller:t,controllerAs:"ctrl",scope:{id:"@",data:"=",phase:"@"},template:"<div class='graphHolder'><\/div>",bindToController:!0}};n.graphsDirectiveController=t;angular.module("liveWidgetApp").directive("graph",t.initializer)}(app||(app={})),function(n){var t=function(){function n(n,t,i,r,u,f,e){var o=this;this.$scope=n;this.$timeout=t;this.$heatmapService=i;this.imageService=r;this.settingService=u;this.dataService=f;this.screenSize=e;this.getHeatMap=function(n){o.isMobile&&(o.$scope.heatmapConfig={radius:25});o.isMobile||(o.$scope.heatmapConfig={radius:40});o.heatMap=null;o.heatMap2=null;o.matchId=n;var t=1;o.isMobile||(t=2);console.log("MatchID = "+n);o.dataService.getHeatmap(n).then(function(n){o.heatMapData=n;console.log(n);var i=angular.copy(n.locations.filter(function(n){return n.team=="H"})),r=angular.copy(n.locations.filter(function(n){return n.team=="A"})),u=angular.copy(n.locations);i.forEach(function(n){n.x=n.x*3*t;n.y=n.y*2*t;n.value=n.value*5*t});r.forEach(function(n){n.x=n.x*3*t;n.y=n.y*2*t;n.value=n.value*5*t});u.forEach(function(n){n.y=n.y*2*t;n.x=n.x*3*t;n.value=o.isMobile?n.value*7:n.value*5*t});o.heatMap={min:0,max:100,data:u};o.heatMap2={min:0,max:100,data:i};o.heatMap3={min:0,max:100,data:r}})};this.heatmap2Show=3;this.watcher=n.$watch("ctrl.matchid",function(t){t!=null&&n.ctrl.getHeatMap(t)});e.onChange(n,"xs, sm",function(n){o.isMobile=n;o.getHeatMap(o.settingService.getCurrentMatchId())});e.onChange(n,"md, lg",function(){o.getHeatMap(o.settingService.getCurrentMatchId())});n.ctrl.isMobile=e.is("xs, sm");n.$on("$destroy",function(){o.watcher&&o.watcher()})}return n}();t.initializer=function(){return{controller:t,controllerAs:"ctrl",scope:{matchid:"="},templateUrl:n.Constants.Default.apiRoot+"site/directives/heatmapView.html",bindToController:!0}};t.$inject=["$scope","$timeout","$heatmapService","imageService","settingService","dataService","screenSize"];n.heatmapViewDirective=t;angular.module("liveWidgetApp").directive("heatmapview",t.initializer)}(app||(app={})),function(n){var t=function(){function t(i,r,u){var f=this;this.templateUrl=n.Constants.Default.apiRoot+"site/directives/heatmapWrapper.html";this.scope={mapData:"="};t.prototype.link=function(n,t){i(function(){var i=angular.element(t.find("div")[0]),u='<heatmap width="'+i[0].scrollWidth+'" height="'+i[0].scrollHeight+'" config="heatmapConfig" id="heatMapContainer" class="coveringCanvas" data="heatmap"><\/heatmap>',f=angular.element(t.find("div")[1]),e=r(u)(n);f.append(e)});f.watcher=n.$watch("mapData",function(n){f.isMobile=u.is("xs, sm");n!=null&&e(angular.copy(n))},!0);u.onChange(n,"xs, sm",function(t){f.isMobile=t;e(n.mapData)});u.onChange(n,"md, lg",function(){e(n.mapData)});var e=function(t){f.isMobile?(f.coordinateMultiplier=1,n.heatmapConfig={radius:25}):(f.coordinateMultiplier=1.5,n.heatmapConfig={radius:30});t.forEach(function(n){n.x=n.x*3*f.coordinateMultiplier;n.y=n.y*2*f.coordinateMultiplier;n.value=n.value*7*f.coordinateMultiplier});n.heatmap={min:0,max:100,data:t}};n.$on("$destroy",function(){f.heatmap=null;f.watcher&&f.watcher()})}}return t.Factory=function(){var n=function(n,i,r){return new t(n,i,r)};return n.$inject=["$timeout","$compile","screenSize"],n},t}();angular.module("liveWidgetApp").directive("heatmapWrapper",t.Factory())}(app||(app={})),function(n){var t=function(){function n(n,t,i,r,u,f){var e=this;this.$scope=n;this.$timeout=t;this.$state=i;this.imageService=r;this.settingService=u;this.$translate=f;this.matchInfos=[];this.getTotalSecondsFromDateTime=function(n){return console.log(n),new Date(n).getSeconds()};this.processChange=function(n){n!=undefined&&(e.matchInfos.length!=n.length?(e.$scope.ctrl.slickEnabled=!1,angular.copy(n,e.matchInfos),e.$timeout(function(){return e.$scope.ctrl.slickEnabled=!0})):n.forEach(function(n){e.matchInfos.forEach(function(t){n.id==t.id&&(t.awayScore=n.awayScore,t.homeScore=n.homeScore,t.currentlyPlayingAndAnalyzed=n.currentlyPlayingAndAnalyzed,t.currentMatchTime=n.currentMatchTime,t.matchEnded=n.matchEnded,t.matchFinished=n.matchFinished)})}))};this.dateTimeNowString=function(){return(new Date).toISOString()};this.getCurrentMatch=function(){return e.settingService.getCurrentMatchId()};this.changematch=function(n){e.settingService.setCurrentMatchId(n);var t=e.matchInfos.filter(function(t){return t.id==n})[0];e.settingService.getCurrentCompetitionId()!=t.competition.competitionPhaseId&&e.settingService.setCurrentCompetitionPhaseId(t.competition.competitionPhaseId);e.$state.current.name!="main.match"&&e.$state.go("main.match")};n.ctrl.slickEnabled=!1;this.watcher=n.$watch("ctrl.data",function(t){t!=null&&n.ctrl.processChange(t)});n.$on("$destroy",function(){e.watcher&&e.watcher()});n.ctrl.currentIndex=0;n.ctrl.slickConfig={event:{afterChange:function(t,i,r){n.ctrl.currentIndex=r},init:function(t,i){i.slickGoTo(n.ctrl.currentIndex,!0)}}}}return n}();t.initializer=function(){return{controller:t,controllerAs:"ctrl",scope:{id:"@",data:"="},templateUrl:n.Constants.Default.apiRoot+"site/directives/matches.html",bindToController:!0}};t.$inject=["$scope","$timeout","$state","imageService","settingService","$translate"];n.matchesDirectiveController=t;angular.module("liveWidgetApp").directive("matchbar",t.initializer)}(app||(app={})),function(n){var t=function(){function n(n,t){var i=this;this.$scope=n;this.imageService=t;this.getStat=function(n,t){if(i.data==null)return"";var r=i.data.stats.filter(function(i){return i.entity.id==t&&i.type==n});return r.length==1?r[0].value.toString():""};this.getIconFromEventType=function(n){return n}}return n}();t.initializer=function(){return{controller:t,controllerAs:"ctrl",scope:{data:"="},templateUrl:n.Constants.Default.apiRoot+"site/directives/matchStats.html",bindToController:!0}};t.$inject=["$scope","imageService"];n.matchStatsDirectiveController=t;angular.module("liveWidgetApp").directive("matchstats",t.initializer)}(app||(app={})),function(){var n=function(){function n(n,t,i,r,u,f,e,o){var s=this,h;this.$scope=n;this.$timeout=t;this.$state=i;this.$translate=r;this.dataService=u;this.settingService=f;this.imageService=e;this.screenSize=o;this.setState=function(n){s.$state.go(n)};this.getState=function(){return s.$state.current.name};this.getCompetitions=function(){s.matchesData!=undefined&&s.matchesData.forEach(function(n){s.competitionData.some(function(t){return n.competition.competitionId==t.competitionId})||s.competitionData.push(n.competition)})};this.setComp=function(n){n.competitionPhaseId!="-1"?s.settingService.getCurrentCompetitionId()!=n.competitionPhaseId&&(s.settingService.setCurrentCompetitionPhaseId(n.competitionPhaseId),s.selectedCompetitionId=n.competitionPhaseId,s.filterOnCompetition(),s.settingService.setCurrentMatchId(s.matchesData[0].id)):(s.selectedCompetitionId="-1",s.filterOnCompetition())};this.filterOnCompetition=function(){s.matchesData=s.selectedCompetitionId!="-1"?s.matchesDataAll.filter(function(n){return n.competition.competitionPhaseId==s.selectedCompetitionId}):s.matchesDataAll};this.updateData=function(){s.$timeout.cancel(s.updateTimeout);var n=s.settingService.getCompetitions();s.dataService.getMatchesMultiple(n).then(function(n){s.matchesDataAll=s.matchesDataAll=s.sortMatches(n);s.filterOnCompetition();s.getCompetitions();s.updateTimeout=s.matchesDataAll.some(function(n){return n.currentlyPlayingAndAnalyzed})?s.$timeout(function(){return s.updateData()},3e4):s.matchesDataAll.every(function(n){return n.matchFinished})?s.$timeout(function(){return s.updateData()},3e5):s.$timeout(function(){return s.updateData()},6e4);s.settingService.getCurrentMatchId()==null&&(s.settingService.setCurrentMatchId(s.matchesData[0].id),s.settingService.setCurrentCompetitionPhaseId(s.matchesData[0].competition.competitionPhaseId))})};this.sortMatches=function(n){return n.sort(function(n,t){if(n.currentlyPlayingAndAnalyzed||t.currentlyPlayingAndAnalyzed)return n.currentlyPlayingAndAnalyzed&&!t.currentlyPlayingAndAnalyzed?-1:!n.currentlyPlayingAndAnalyzed&&t.currentlyPlayingAndAnalyzed?1:s.generateMatchScore(t)-s.generateMatchScore(n);var i=Date.parse(n.dateTime.toString()),r=Date.parse(t.dateTime.toString());if(n.matchFinished||t.matchFinished){if(n.matchEnded&&!t.matchEnded)return 1;if(!n.matchFinished&&t.matchFinished)return-1}return i==r?s.generateMatchScore(t)-s.generateMatchScore(n):i<r?-1:1})};this.getPreferdTeam=function(n){return[6578].indexOf(n)>-1?!0:!1};this.generateMatchScore=function(n){var t=0;return s.getPreferdTeam(n.awayTeam.id)&&t++,s.getPreferdTeam(n.homeTeam.id)&&t++,t};this.isMobile=o.is("xs, sm");o.on("xs, sm",function(n){s.isMobile=n});this.selectedCompetitionId="-1";this.competitionData=[];this.competitionData.push({competitionLabel:r.instant("Main_AllCOMP"),competitionPhaseId:"-1"});h=this.settingService.getCompetitions();this.updateData();n.$on("$sleepDetected",function(){s.updateData()})}return n}();n.$inject=["$scope","$timeout","$state","$translate","dataService","settingService","imageService","screenSize"];angular.module("liveWidgetApp").controller("mainController",n)}(app||(app={})),function(){var n=function(){function n(n,t,i,r,u,f,e){var o=this;this.$scope=n;this.$timeout=t;this.dataService=i;this.settingService=r;this.imageService=u;this.screenSize=f;this.matchContentView=e;this.getPenalties=function(n,t){var i=0;return t!=null&&t!=undefined&&t.some(function(t){t.eventType=="SHOOTOUTSCORED"&&t.selectionEdition.id==n&&i++}),i};this.hasPenalties=function(n){return n!=null&&n!=undefined?n.some(function(n){return n.eventType=="SHOOTOUTSCORED"||n.eventType=="SHOOTOUTMISSED"}):!1};this.updateData=function(){o.$timeout.cancel(o.updateTimeout);o.settingService.getCurrentMatchId()&&o.dataService.getMatchData(o.settingService.getCurrentMatchId()).then(function(n){$(".c3-label-icon").each(function(n,t){try{t.remove()}catch(i){}});o.matchData=n;o.matchLineUpData=o.matchData.matchLineUp;o.dataService.getHeatmap(n.matchInfo.id).then(function(n){o.heatmaps=[];o.heatmaps.push(angular.copy(n.locations));o.heatmaps.push(angular.copy(n.locations.filter(function(n){return n.team=="H"})));o.heatmaps.push(angular.copy(n.locations.filter(function(n){return n.team=="A"})))});o.updateTimeout=o.matchData.matchInfo.currentlyPlayingAndAnalyzed?o.$timeout(function(){return o.updateData()},3e4):o.matchData.matchInfo.matchFinished?o.$timeout(function(){return o.updateData()},3e5):o.$timeout(function(){return o.updateData()},6e4)})};this.updateData();this.isMobile=f.is("xs, sm");f.on("xs, sm",function(n){o.isMobile=n});this.matchContentView=1;this.watcher=this.$scope.$on("matchId",function(){o.updateTimeout!=null&&o.$timeout.cancel(o.updateTimeout);o.updateData()});this.$scope.$on("$destroy",function(){t.cancel(o.updateTimeout);o.watcher()});n.$on("$sleepDetected",function(){o.updateData()})}return n}();n.$inject=["$scope","$timeout","dataService","settingService","imageService","screenSize"];angular.module("liveWidgetApp").controller("matchController",n)}(app||(app={})),function(){var n=function(){function n(n,t,i,r,u){var f=this;this.$scope=n;this.dataService=t;this.imageService=i;this.settingService=r;this.screenSize=u;this.getSelectionEditionLogo=function(n){return f.imageService.getSelectionEditionLogo(n)};this.isMobile=u.is("xs, sm");u.on("xs, sm",function(n){f.isMobile=n});this.watcher=this.$scope.$on("competitionPhaseId",function(){f.dataService.getRanking(f.settingService.getCurrentCompetitionId()).then(function(n){f.ranking=n})});n.$on("$destroy",function(){f.watcher&&f.watcher()});this.dataService.getRanking(this.settingService.getCurrentCompetitionId()).then(function(n){f.ranking=n})}return n}();n.$inject=["$scope","dataService","imageService","settingService","screenSize"];angular.module("liveWidgetApp").controller("rankingController",n)}(app||(app={})),function(n){var t=function(){function t(t,i){this.$http=t;this.$q=i;this.apiRoot=n.Constants.Default.apiRoot}return t.prototype.getMatchesMultiple=function(n){var t=this.$q.defer(),i=n.join("_");return this.$http.get(this.apiRoot+"/api/MatchInfo/all/"+i).then(function(n){var i=n.data;t.resolve(i)}),t.promise},t.prototype.getMatches=function(n){var t=this.$q.defer();return this.$http.get(this.apiRoot+"/api/MatchInfo/"+n).then(function(n){var i=n.data;t.resolve(i)}),t.promise},t.prototype.getMatchData=function(n){var t=this.$q.defer();return n&&this.$http.get(this.apiRoot+"/api/matchdata/"+n).then(function(n){var i=n.data;t.resolve(i)}),t.promise},t.prototype.getRanking=function(n){var t=this.$q.defer();return this.$http.get(this.apiRoot+"api/Ranking/"+n).then(function(n){var i=n.data;t.resolve(i)}),t.promise},t.prototype.getStatistics=function(n){var t=this.$q.defer();return this.$http.get(this.apiRoot+"api/TopX/"+n).then(function(n){var i=n.data;t.resolve(i)}),t.promise},t.prototype.getStatisticsTotal=function(n){var t=this.$q.defer();return this.$http.get(this.apiRoot+"api/TopX/"+n+"/Total").then(function(n){var i=n.data;t.resolve(i)}),t.promise},t.prototype.getTopScorer=function(n){var t=this.$q.defer();return this.$http.get(this.apiRoot+"api/TopScorer/"+n).then(function(n){var i=n.data;t.resolve(i)}),t.promise},t.prototype.getHeatmap=function(n){var t=this.$q.defer();return this.$http.get(this.apiRoot+"api/MatchData/heatmap/"+n).then(function(n){var i=n.data;t.resolve(i)}),t.promise},t}();t.$inject=["$http","$q",];angular.module("liveWidgetApp").service("dataService",t)}(app||(app={})),function(n){var t=function(){function t(){this.baseUrl="https://static.ortecsports.com/";this.apiRoot=n.Constants.Default.apiRoot}return t.prototype.getSelectionEditionLogo=function(n){return this.baseUrl+"selection/"+n+".svg"},t.prototype.getCompetitionEditionLogo=function(n){return this.baseUrl+"competition/"+n+".svg"},t.prototype.getEventTypeIcon=function(){return""},t.prototype.getPlayerImage=function(n){return this.baseUrl+"cropped_150_150/"+n+".jpg"},t.prototype.getIcon=function(n){switch(n){case"GOAL":return this.apiRoot+"/Content/images/events/football.svg";case"YELLOWCARD":return this.apiRoot+"/Content/images/events/yellowcard.svg";case"REDCARD":return this.apiRoot+"/Content/images/events/redcard.svg";case"YELLOWCARDSECOND":return this.apiRoot+"/Content/images/events/yellowredcard.svg";case"SUBIN":return this.apiRoot+"/Content/images/events/substitution.svg";case"RSUBIN":return this.apiRoot+"/Content/images/events/subin.svg";case"SUBOUT":return this.apiRoot+"/Content/images/events/subout.svg";case"PENALTYMISSED":return this.apiRoot+"/Content/images/events/penaltymissed.svg";case"KICKOFF":return this.apiRoot+"/Content/images/events/whistle.svg";case"ENDPHASE":return this.apiRoot+"/Content/images/events/whistle.svg";case"ENDMATCH":return this.apiRoot+"/Content/images/events/whistle.svg";case"GOAL_PENALTY":return this.apiRoot+"/Content/images/events/football.svg";case"OWNGOAL":return this.apiRoot+"/Content/images/events/owngoal.svg";case"SHOOTOUTMISSED":return this.apiRoot+"/Content/images/events/penaltymissed.svg";case"SHOOTOUTSCORED":return this.apiRoot+"/Content/images/events/football.svg";default:return console.log("missing icon for "+n),""}},t}();angular.module("liveWidgetApp").service("imageService",t)}(app||(app={})),function(){var n=function(){function n(n){this.$rootScope=n}return n.prototype.getCurrentMatchId=function(){return this.matchID},n.prototype.getCurrentCompetitionId=function(){return this.compID},n.prototype.setCurrentMatchId=function(n){this.matchID=n;this.$rootScope.$broadcast("matchId",n)},n.prototype.setCurrentCompetitionPhaseId=function(n){this.compID=n;this.$rootScope.$broadcast("competitionPhaseId",n)},n.prototype.getCompetitions=function(){return this.competitions},n.prototype.setCompetitions=function(n){this.competitions=n;this.$rootScope.$broadcast("competitions",n)},n}();n.$inject=["$rootScope"];angular.module("liveWidgetApp").service("settingService",n)}(app||(app={})),function(){var n=function(){function n(n){this.$rootScope=n}return n.prototype.Start=function(){var n=this;document.addEventListener("sleepDetected",function(t){n.$rootScope.$evalAsync(function(){n.$rootScope.$broadcast("$sleepDetected",t)})})},n}();n.$inject=["$rootScope"];angular.module("liveWidgetApp").service("sleepModeDetectionService",n)}(app||(app={})),function(){var n=function(){function n(n,t,i,r,u){var f=this;this.$scope=n;this.dataService=t;this.imageService=i;this.settingService=r;this.screenSize=u;this.getType=function(n){return f.value=f.statisticstypes.filter(function(t){return t.id==n}),f.value[0].value.toString()};this.getData=function(n){var t=n!="league"?"getStatistics":"getStatisticsTotal";f.dataService[t](f.settingService.getCurrentCompetitionId()).then(function(n){f.roundstatistics=n;f.onstatisticsChange(f.selectedstatisticsType)})};this.selectedstatisticsType="totalBallActions";this.onstatisticsChange=function(n){f.noData=!1;f.selectedstatisticsType=n;f.selectedstatistics=f.roundstatistics[f.selectedstatisticsType];f.selectedstatistics.length==0&&(f.noData=!0)};this.selectedDataset="round";this.$scope.$watch("vm.selectedDataset",function(){f.getData(f.selectedDataset)},!0);this.isMobile=u.is("xs, sm");u.on("xs, sm",function(n){f.isMobile=n});this.getData("round");this.watcher=this.$scope.$on("competitionPhaseId",function(){f.dataService.getStatistics(f.settingService.getCurrentCompetitionId()).then(function(n){f.roundstatistics=n;f.onstatisticsChange(f.selectedstatisticsType)})});n.$on("$destroy",function(){f.watcher&&f.watcher()});this.statisticstypes=[];this.statisticstypes.push({id:"totalBallActions",value:"Statistics_TYPE_TOTALBALLACTIONS"});this.statisticstypes.push({id:"totalBallActionCompleted",value:"Statistics_TYPE_TOTALBALLACTIONSCOMPLETED"});this.statisticstypes.push({id:"passes",value:"Statistics_TYPE_PASSES"});this.statisticstypes.push({id:"shotsTotal",value:"Statistics_TYPE_SHOTSTOTAL"});this.statisticstypes.push({id:"shotsOnTarget",value:"Statistics_TYPE_SHOTSONTARGET"});this.statisticstypes.push({id:"shotsOnBar",value:"Statistics_TYPE_SHOTSONBAR"});this.statisticstypes.push({id:"shotsOnPost",value:"Statistics_TYPE_SHOTSONPOST"});this.statisticstypes.push({id:"shotsWide",value:"Statistics_TYPE_SHOTSWIDE"});this.statisticstypes.push({id:"shotsScored",value:"Statistics_TYPE_SHOTSCORED"});this.statisticstypes.push({id:"shotsHeader",value:"Statistics_TYPE_SHOTSHEADER"});this.statisticstypes.push({id:"saveOnGoalAttempt",value:"Statistics_TYPE_SAVEONGOALATTEMPT"});this.statisticstypes.push({id:"saveOnGoalAttemptSuccessful",value:"Statistics_TYPE_SAVEONGOALATTEMPTSUCCESSFUL"});this.statisticstypes.push({id:"crossPasses",value:"Statistics_TYPE_CROSSPASSES"});this.statisticstypes.push({id:"crossesPassesCompleted",value:"Statistics_TYPE_CROSSPASSESSUCCESSFUL"});this.statisticstypes.push({id:"keyActions",value:"Statistics_TYPE_KEYACTIONS"});this.statisticstypes.push({id:"assists",value:"Statistics_TYPE_ASSISTS"});this.statisticstypes.push({id:"offsides",value:"Statistics_TYPE_OFFSIDES"});this.statisticstypes.push({id:"possessionLost",value:"Statistics_TYPE_POSSESSIONLOST"});this.statisticstypes.push({id:"fouls",value:"Statistics_TYPE_FOULS"});this.statisticstypes.push({id:"grade",value:"Statistics_TYPE_GRADE"})}return n}();n.$inject=["$scope","dataService","imageService","settingService","screenSize"];angular.module("liveWidgetApp").controller("statisticsController",n)}(app||(app={})),function(){var n=function(){function n(n,t,i,r,u){var f=this;this.$scope=n;this.dataService=t;this.imageService=i;this.settingService=r;this.screenSize=u;this.changeIsMobile=function(n){f.isMobile=n};this.isMobile=u.is("xs, sm");u.on("xs, sm",function(n){f.isMobile=n});this.watcher=this.$scope.$on("competitionPhaseId",function(){f.dataService.getTopScorer(f.settingService.getCurrentCompetitionId()).then(function(n){f.topScorerData=n;f.noData==!1})});n.$on("$destroy",function(){f.watcher&&f.watcher()});this.dataService.getTopScorer(this.settingService.getCurrentCompetitionId()).then(function(n){f.topScorerData=n;f.noData==!1});this.topScorerData==null&&(this.noData=!0)}return n}();n.$inject=["$scope","dataService","imageService","settingService","screenSize"];angular.module("liveWidgetApp").controller("topScorerController",n)}(app||(app={}))