var Geneity,$jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(a,c,b){a instanceof String&&(a=String(a));for(var d=a.length,e=0;e<d;e++){var g=a[e];if(c.call(b,g,e,a))return{i:e,v:g}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,c,b){a!=Array.prototype&&a!=Object.prototype&&(a[c]=b.value)};
$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);$jscomp.polyfill=function(a,c,b,d){if(c){b=$jscomp.global;a=a.split(".");for(d=0;d<a.length-1;d++){var e=a[d];e in b||(b[e]={});b=b[e]}a=a[a.length-1];d=b[a];c=c(d);c!=d&&null!=c&&$jscomp.defineProperty(b,a,{configurable:!0,writable:!0,value:c})}};
$jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,b){return $jscomp.findInternal(this,a,b).v}},"es6","es3");"object"!=typeof Geneity&&(Geneity={});
with(Geneity)(function(){function a(a,b){if(0==a.length)log("Darts score update for non-existing element.");else{if(""===b||void 0===b||null===b)log("Ignore score update for value = "+b),b="-";$.trim(a.text())!=$.trim(b)&&a.text(b)}}$(document).on("matchScoreDarts",function(c,b){"Y"!==b.deleted&&(c=$.cached(".sport-inplay.ev-"+b.ev_id),0==c.length?log("Received matchScoreDarts message for ev_id="+b.ev_id+" with no scoreboard."):c.each(function(){var d=$(this),e=d.find('[data-participant="1"] [data-sets]'),
c=d.find('[data-participant="2"] [data-sets]');var f=d.find('[data-participant="1"] [data-legs]');var h=d.find('[data-participant="2"] [data-legs]');var k=d.find('[data-participant="1"] [data-points]'),n=d.find('[data-participant="2"] [data-points]');if(0!=e.length){var l=b.sets_player1;var m=b.sets_player2;a(e,l);a(c,m)}l=b.legs_player1;m=b.legs_player2;a(f,l);a(h,m);"points_player1"in b&&(f=b.points_player1,h=b.points_player2,a(k,f),a(n,h));k=b.server;d.find("td[data-server] > div").removeClass("current-server");
d.find('tr[data-participant_id="'+k+'"] td[data-server] > div').addClass("current-server")}))}).on("setScoreDarts",function(c,b){"Y"!==b.deleted&&(c=$.cached(".sport-inplay.ev-"+b.ev_id),0==c.length?log("Received matchScoreDarts message for ev_id="+b.ev_id+" with no scoreboard."):c.each(function(){var d=$(this);if(0==d.find('[data-participant="1"] [data-sets]').length){var c=b.legs_player1,g=b.legs_player2,f=d.find('[data-participant="1"] [data-legs]');d=d.find('[data-participant="2"] [data-legs]');
a(f,c);a(d,g)}}))}).on("matchStat",function(a,b){"180S"===b.stat_type&&"Y"!==b.deleted&&(a=$.cached(".sport-inplay.ev-"+b.ev_id),0===a.length?log("Received matchStats message for ev_id="+b.ev_id+" with no scoreboard."):a.each(function(){var a=$(this),c=a.find(".sport-stats tr:first");0===c.find("th[data-180s]").length&&c.append($("<th/>",{text:b.stat_title,"data-180s":""}));c=a.find('.sport-stats tr[data-participant_id="'+b.player_id+'"]');0===c.find("td[data-180s]").length&&c.append($("<td/>",{text:b.stat_count,
"data-180s":b.stat_count}));c=b.stat_count;a=a.find('.sport-stats tr[data-participant_id="'+b.player_id+'"] td[data-180s]');a.data("180s",c);a.text(c)}))})})();
